Re: [PATCH v7 14/16] usb: resume (wakeup) child device when port is powered on

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

 



On Mon, Apr 28, 2014 at 2:00 PM, Dan Williams <dan.j.williams@xxxxxxxxx> wrote:
> On Mon, Apr 28, 2014 at 1:29 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>> On Wed, 19 Mar 2014, Dan Williams wrote:
[..]
>> But this got me thinking...  It looks like the reference to
>> port_dev->child in usb_port_runtime_resume() already races with the
>> line
>>
>>         *pdev = NULL;
>>
>> in usb_disconnect().  We need to make sure that a port runtime-resume
>> is mutually exclusive with child device removal.  (Consider, for
>> example, what happens if a thread does a runtime resume on a port and
>> at the same time, the hub is unplugged.)  Any ideas?
>
> Yes, I think we simply need to add
> pm_runtime_{get|put}(&port_dev->dev) to guarantee that port_dev->child
> is always safe to de-reference in usb_port_runtime{suspend|resume}.

...and as I go to add this I notice that prior to the "use
pm_request_resume" suggestion we don't de-reference port_dev->child in
usb_port_runtime_resume().  This realization plus the usage count
tracking that usb_remote_wakeup() affords is leaning me towards
leaving the "force wakeup" mechanism as is for the upcoming re-post.
--
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