Re: [PATCH] USB: fix Scheduling while atomic warning when resuming.

Jeff Garzik
2004-12-22T03:49:00Z

Linux Kernel Mailing List wrote:
> ChangeSet 1.2215, 2004/12/21 16:25:03-08:00, greg@kroah.com
>
> [PATCH] USB: fix Scheduling while atomic warning when resuming.
>
> This fixes a warning when resuming the USB EHCI host controller driver.

> diff -Nru a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
> --- a/drivers/usb/host/ehci-hub.c 2004-12-21 17:04:09 -08:00
> +++ b/drivers/usb/host/ehci-hub.c 2004-12-21 17:04:09 -08:00
> @@ -122,7 +122,7 @@
> writel (temp, &ehci->regs->port_status [i]);
> }
> i = HCS_N_PORTS (ehci->hcs_params);
> - msleep (20);
> + mdelay (20);
> while (i--) {
> temp = readl (&ehci->regs->port_status [i]);

This is more than a little bit silly.

The entire resume function holds spin_lock_irq() for far longer than a
timer tick.

If we are going for a minimalist -rc patch, why not drop the lock,
sleep, then reacquire the lock?

This strikes me as a bad change, make in haste for -rc, that will get
quickly forgotten (and left as-is) once 2.6.10 is released.

Jeff