diff options
| author | Ingo Molnar <mingo@kernel.org> | 2024-03-25 13:32:29 +0300 | 
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2024-03-25 13:32:29 +0300 | 
| commit | f4566a1e73957800df75a3dd2dccee8a4697f327 (patch) | |
| tree | b043b875228c0b25988af66c680d60cae69d761d /drivers/usb/core/hub.c | |
| parent | b9e6e28663928cab836a19abbdec3d036a07db3b (diff) | |
| parent | 4cece764965020c22cff7665b18a012006359095 (diff) | |
| download | linux-f4566a1e73957800df75a3dd2dccee8a4697f327.tar.xz | |
Merge tag 'v6.9-rc1' into sched/core, to pick up fixes and to refresh the branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/usb/core/hub.c')
| -rw-r--r-- | drivers/usb/core/hub.c | 29 | 
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index e38a4124f610..3ee8455585b6 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -37,6 +37,7 @@  #include <asm/byteorder.h>  #include "hub.h" +#include "phy.h"  #include "otg_productlist.h"  #define USB_VENDOR_GENESYS_LOGIC		0x05e3 @@ -634,6 +635,34 @@ static int hub_ext_port_status(struct usb_hub *hub, int port1, int type,  		ret = 0;  	}  	mutex_unlock(&hub->status_mutex); + +	/* +	 * There is no need to lock status_mutex here, because status_mutex +	 * protects hub->status, and the phy driver only checks the port +	 * status without changing the status. +	 */ +	if (!ret) { +		struct usb_device *hdev = hub->hdev; + +		/* +		 * Only roothub will be notified of connection changes, +		 * since the USB PHY only cares about changes at the next +		 * level. +		 */ +		if (is_root_hub(hdev)) { +			struct usb_hcd *hcd = bus_to_hcd(hdev->bus); +			bool connect; +			bool connect_change; + +			connect_change = *change & USB_PORT_STAT_C_CONNECTION; +			connect = *status & USB_PORT_STAT_CONNECTION; +			if (connect_change && connect) +				usb_phy_roothub_notify_connect(hcd->phy_roothub, port1 - 1); +			else if (connect_change) +				usb_phy_roothub_notify_disconnect(hcd->phy_roothub, port1 - 1); +		} +	} +  	return ret;  }  | 
