lkml.org 
[lkml]   [2016]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH V5 3/6] slimbus: Add messaging APIs to slimbus framework
Date
On Wednesday 27 April 2016 17:58:06 Sagar Dharia wrote:

> + ctrl->tx.base = dma_alloc_coherent(ctrl->dev.parent,
> + (ctrl->tx.sl_sz * ctrl->tx.n),
> + &ctrl->tx.phy, GFP_KERNEL);
> + if (!ctrl->tx.base) {
> + ret = -ENOMEM;
> + goto tx_alloc_failed;
> + }

This looks controller specific, and hints that some parts of the "common"
framework should actually be part of the controller driver instead.

In particular, the use of "ctrl->dev.parent" suggests that this should
have been allocated by the controller.

> @@ -162,6 +279,15 @@ struct slim_controller {
> struct slim_addrt *addrt;
> u8 num_dev;
> struct workqueue_struct *wq;
> + struct slim_val_inf *tid_tbl[SLIM_MAX_TIDS];
> + u8 last_tid;
> + spinlock_t txn_lock;
> + struct slim_ctrl_buf tx;
> + struct slim_ctrl_buf rx;
> + struct slim_pending *pending_wr;
> + struct semaphore tx_sem;

Please try to avoid the use of semaphores in new code.

Arnd

\
 
 \ /
  Last update: 2016-04-28 12:21    [W:0.135 / U:9.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site