mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* mcs7830 usb net: "scheduling while atomic" danger?
@ 2010-01-18 18:49 Andreas Mohr
  2010-01-18 20:25 ` Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Andreas Mohr @ 2010-01-18 18:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg KH, Julia Lawall

Hi,

drivers/net/usb/mcs7830.c does several:

        mutex_lock(&dev->phy_mutex);
        /* write the MII command */
        ret = mcs7830_set_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
        if (ret < 0)
                goto out;

        /* wait for the data to become valid, should be within < 1ms */
        for (i = 0; i < 10; i++) {
                ret = mcs7830_get_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
                if ((ret < 0) || (cmd[1] &
HIF_REG_PHY_CMD2_READY_FLAG_BIT))
                        break;
                ret = -EIO;
                msleep(1);
        }


Forgive me, but doesn't that mutex_lock()/msleep() (ab)use mean
risking a "scheduling while atomic"?
(such as discussed in e.g.
http://search.luky.org/linux-kernel.2004/msg92817.html )


And, if that is the case, shouldn't all such cases simply be killed for
good via a capable semantic patch?

Thanks,

Andreas Mohr

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-01-19  8:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-18 18:49 mcs7830 usb net: "scheduling while atomic" danger? Andreas Mohr
2010-01-18 20:25 ` Julia Lawall
2010-01-18 20:47 ` Thomas Gleixner
2010-01-18 21:10 ` Julia Lawall
2010-01-18 21:23   ` Arnd Bergmann
2010-01-18 21:35     ` Julia Lawall
2010-01-18 22:25       ` Arnd Bergmann
2010-01-19  8:31         ` [PATCH] ehci: phy low power mode bug fixing alek du
2010-01-19  2:53     ` mcs7830 usb net: "scheduling while atomic" danger? Du, Alek
2010-01-19  6:25       ` Julia Lawall
2010-01-18 21:24   ` Thomas Gleixner
2010-01-18 21:32     ` Julia Lawall
2010-01-18 21:38       ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®