usb: dwc_otg: prevent sleeping function called from atomic context
authorlyz <lyz@rock-chips.com>
Tue, 9 Sep 2014 01:32:14 +0000 (09:32 +0800)
committerlyz <lyz@rock-chips.com>
Wed, 17 Sep 2014 06:55:12 +0000 (14:55 +0800)
Disable _local_ irq make no sense here and we don't really need
it, if we need to disable usb irqs from dwc_otg call func
dwc_otg_disable_global_interrupts() can be more useful.

drivers/usb/dwc_otg_310/dwc_otg_pcd_linux.c

index c16e5671f87046c61635d85f78ff031e7ba61863..da339bfba07613cd857902b0293e887ad5b89d65 100755 (executable)
@@ -1508,9 +1508,6 @@ static void dwc_otg_pcd_check_vbus_work(struct work_struct *work)
            container_of(work, dwc_otg_pcd_t, check_vbus_work.work);
        struct dwc_otg_device *otg_dev = _pcd->otg_dev;
        struct dwc_otg_platform_data *pldata = otg_dev->pldata;
-       unsigned long flags;
-
-       local_irq_save(flags);
 
        if (!pldata->get_status(USB_STATUS_ID)) {
                /* id low, host mode */
@@ -1597,8 +1594,6 @@ static void dwc_otg_pcd_check_vbus_work(struct work_struct *work)
        }
 
        schedule_delayed_work(&_pcd->check_vbus_work, HZ);
-       local_irq_restore(flags);
-
        return;
 
 connect:
@@ -1612,7 +1607,6 @@ connect:
 
        schedule_delayed_work(&_pcd->reconnect, 8);     /* delay 8 jiffies */
        schedule_delayed_work(&_pcd->check_vbus_work, (HZ << 2));
-       local_irq_restore(flags);
 
        return;
 }