lkml.org 
[lkml]   [2010]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: mcs7830 usb net: "scheduling while atomic" danger?
    On Mon, 18 Jan 2010, Andreas Mohr wrote:

    > 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?

    This could easily be done, if the diagnosis is correct.

    julia


    \
     
     \ /
      Last update: 2010-01-18 21:27    [W:0.021 / U:1.592 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site