mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
usb: vhci-hcd: Prevent suspending virtually attached devices
[ Upstream commit e40b984b6c4ce3f80814f39f86f87b2a48f2e662 ]
The VHCI platform driver aims to forbid entering system suspend when at
least one of the virtual USB ports are bound to an active USB/IP
connection.
However, in some cases, the detection logic doesn't work reliably, i.e.
when all devices attached to the virtual root hub have been already
suspended, leading to a broken suspend state, with unrecoverable resume.
Ensure the virtually attached devices do not enter suspend by setting
the syscore PM flag. Note this is currently limited to the client side
only, since the server side doesn't implement system suspend prevention.
Fixes: 04679b3489
("Staging: USB/IP: add client driver")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250902-vhci-hcd-suspend-fix-v3-1-864e4e833559@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
fa153fb40c
commit
f71f5eea51
|
@ -764,6 +764,17 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
|
|||
ctrlreq->wValue, vdev->rhport);
|
||||
|
||||
vdev->udev = usb_get_dev(urb->dev);
|
||||
/*
|
||||
* NOTE: A similar operation has been done via
|
||||
* USB_REQ_GET_DESCRIPTOR handler below, which is
|
||||
* supposed to always precede USB_REQ_SET_ADDRESS.
|
||||
*
|
||||
* It's not entirely clear if operating on a different
|
||||
* usb_device instance here is a real possibility,
|
||||
* otherwise this call and vdev->udev assignment above
|
||||
* should be dropped.
|
||||
*/
|
||||
dev_pm_syscore_device(&vdev->udev->dev, true);
|
||||
usb_put_dev(old);
|
||||
|
||||
spin_lock(&vdev->ud.lock);
|
||||
|
@ -784,6 +795,17 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
|
|||
"Not yet?:Get_Descriptor to device 0 (get max pipe size)\n");
|
||||
|
||||
vdev->udev = usb_get_dev(urb->dev);
|
||||
/*
|
||||
* Set syscore PM flag for the virtually attached
|
||||
* devices to ensure they will not enter suspend on
|
||||
* the client side.
|
||||
*
|
||||
* Note this doesn't have any impact on the physical
|
||||
* devices attached to the host system on the server
|
||||
* side, hence there is no need to undo the operation
|
||||
* on disconnect.
|
||||
*/
|
||||
dev_pm_syscore_device(&vdev->udev->dev, true);
|
||||
usb_put_dev(old);
|
||||
goto out;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user