[PATCH 1/2] Add hub port switchable when checking port power

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

 



In check_port_resume_type, we will check port power status to determine whether the status should change to -ENODEV.
If all ports power control of the hub are handled at once, the port power status may not represent the real case and cause resume fail.
At this patch, we add hub_is_port_power_switchable as well as checking the port power.

Signed-off-by: Chechun Kuo <vichy.kuo@xxxxxxxxx>
---
 drivers/usb/core/hub.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index b649fef..a50b257 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2904,7 +2904,8 @@ static int check_port_resume_type(struct usb_device *udev,
 	}
 	/* Is the device still present? */
 	else if (status || port_is_suspended(hub, portstatus) ||
-			!port_is_power_on(hub, portstatus) ||
+			(hub_is_port_power_switchable(hub)
+				&& !port_is_power_on(hub, portstatus)) ||
 			!(portstatus & USB_PORT_STAT_CONNECTION)) {
 		if (status >= 0)
 			status = -ENODEV;
-- 
1.9.1

--
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