[PATCH 1/3] libertas_spi: Use workqueue in hw_host_to_card

Vasily Khoruzhick anarsoul at gmail.com
Fri Jan 21 16:24:29 EST 2011


On Friday 21 January 2011 23:22:37 Marek Vasut wrote:
> On Friday 21 January 2011 21:44:48 Vasily Khoruzhick wrote:
> > Use workqueue to perform SPI xfers, it's necessary to fix
> > nasty "BUG: scheduling while atomic", because
> > spu_write() calls spi_sync() and spi_sync() may sleep, but
> > hw_host_to_card() callback can be called from atomic context.
> > Remove kthread completely, workqueue now does its job.
> > Restore intermediate buffers which were removed in commit
> > 86c34fe89e9cad9e1ba4d1a8bbf98259035f4caf that introduced
> > mentioned bug.
> 
> I have two questions:
> 
> 1) Why not leave kthread there? ie. why switch to workqueue

Because it's not easy to ensure that kthread did its job in suspend handler,
and to make if_spi.c look similar to if_sdio.c.

> 2) This should be split into two patches I guess -- a) revert the change b)
> convert to workqueue -- so they can be (N)ACKed separatedly

Actually just reverting commit does not make driver work (it will fail on 
rmmod), and it can impact on future bisect (if it'll be necessary). But if 
it's requirement - ok.

> Cheers



More information about the libertas-dev mailing list