lkml.org 
[lkml]   [2013]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [REPOST PATCH] spi: Unlock a spinlock before calling into the controller driver.
On Wed, Mar 13, 2013 at 11:17:40AM -0700, Doug Anderson wrote:
> From: Bryan Freed <bfreed@chromium.org>
>
> spi_pump_messages() calls into a controller driver with
> unprepare_transfer_hardware() which is documented as "This may sleep".
> As in the prepare_transfer_hardware() call below, we should release the
> queue_lock spinlock before making the call.
> Rework the logic a bit to hold queue_lock to protect the 'busy' flag,
> then release it to call unprepare_transfer_hardware().

Applied, thanks. However...

> spin_unlock_irqrestore(&master->queue_lock, flags);
> + if (master->unprepare_transfer_hardware &&
> + master->unprepare_transfer_hardware(master))
> + dev_err(&master->dev,
> + "failed to unprepare transfer hardware\n");

...it'd be nicer to pay attention to and log the error code if we fail
to unprepare.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-04-01 16:01    [W:0.104 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site