Re: mcs7830 usb net: "scheduling while atomic" danger?

From: Arnd Bergmann
Date: Mon Jan 18 2010 - 17:25:37 EST


On Monday 18 January 2010, Julia Lawall wrote:
> > That code looks indeed broken as was added las July as part of 331ac6b288d9
> > "USB: EHCI: Add Intel Moorestown EHCI controller HOSTPCx extensions and
> > support phy low power mode". The reason that this hasn't triggered is
> > probably the lack of Moorestown machines in the field.
>
> The fix is just msleep -> mdelay?

No, that would just kill the warning but still leave horrible code. There
should really be some way to move the sleeping operation outside of the
spinlock.

>From a brief look at the code, I think the sequence could be converted
from

lock();
suspend();
sleep();
clock_disable();
unlock();

to

lock();
again:
suspend();
unlock();
sleep();
lock();
if (!suspended())
goto again;
clock_disable();
unlock();

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/