Re: g_file_storage: handle_exception() handled too late after the usb device sleep and wakeup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 17, 2009 at 11:05 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, 17 Dec 2009, Yuping Luo wrote:
>
>> > You should try removing the set_freezable() call.  It might solve your
>> > problem.
>> >
>> it works while some trivial complaints like "sending command-failure
>> status" occur.
>
> Those may be normal.
>
>> > But a better approach would be to use register_pm_notifier (see
>> > include/linux/suspend.h).  When you get a PM_SUSPEND_PREPARE message,
>> > call usb_gadget_disconnect().  When you get a PM_POST_SUSPEND message,
>> > call usb_gadget_connect().  Then it won't matter that the thread gets
>> > woken up late.
>> >
>> > Alan Stern
>> >
>> it doesn't work, since when system wakeup, the
>> pm_notifier_call_chain() called very late, after the restarting the
>> tasks.
>
> That's the whole point.  pm_notifier_call_chain() runs very late, after
> the FSG thread is awake.  Hence when usb_gadget_connect() is called and
> the D+ pullup is enabled, the thread will be running and able to handle
> exceptions.
>
> You will need to modify the controller driver if it doesn't implement
> the ops->pullup method correctly.
>
> Alan Stern
>
>
my pcd_pullup() already supported, it will set the RS bit with  0 for
USBCMD. however, my device controller resumed earlier than the pm
notifier, and will start the usb controller, the RS bit will be set
with 1,  so the device enumeration procedure started not as we
expected.  Maybe I need delay the resume of the device controller.

Yuping Luo
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux