lkml.org 
[lkml]   [2012]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/6 v2] usb/gadget/pch_udc: Fix disconnect issue
    Date
    ISSUE:
    When the driver notifies a gadget of a disconnect event, a system rarely freezes.

    CAUSE:
    When the driver calls dev->driver->disconnect(), it is not calling spinlock().

    Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
    ---
    V2: Divide into 6 patches
    ---
    drivers/usb/gadget/pch_udc.c | 5 ++++-
    1 files changed, 4 insertions(+), 1 deletions(-)

    diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
    index f222659..a4f8b08 100644
    --- a/drivers/usb/gadget/pch_udc.c
    +++ b/drivers/usb/gadget/pch_udc.c
    @@ -2340,8 +2340,11 @@ static void pch_udc_svc_ur_interrupt(struct pch_udc_dev *dev)
    /* Complete request queue */
    empty_req_queue(ep);
    }
    - if (dev->driver && dev->driver->disconnect)
    + if (dev->driver && dev->driver->disconnect) {
    + spin_unlock(&dev->lock);
    dev->driver->disconnect(&dev->gadget);
    + spin_lock(&dev->lock);
    + }
    }

    /**
    --
    1.7.4.4


    \
     
     \ /
      Last update: 2012-01-12 03:35    [W:0.023 / U:0.868 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site