diff mbox series

[v2,3/8] usb: core: hub: Print speed name based on ssp rate

Message ID d7049743924adf82f93ddfe403a5ebb9ac06e49b.1612410491.git.Thinh.Nguyen@synopsys.com (mailing list archive)
State Superseded
Headers show
Series usb: Check for genXxY on host | expand

Commit Message

Thinh Nguyen Feb. 4, 2021, 4:10 a.m. UTC
Check for usb_device->ssp_rate to print the SuperSpeed Plus signaling
rate generation and lane count.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
---
 Changes in v2:
 - None

 drivers/usb/core/hub.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Mathias Nyman March 10, 2021, 8:37 a.m. UTC | #1
On 4.2.2021 6.10, Thinh Nguyen wrote:
> Check for usb_device->ssp_rate to print the SuperSpeed Plus signaling
> rate generation and lane count.
> 
> Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> ---
>  Changes in v2:
>  - None
> 
>  drivers/usb/core/hub.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 823470607d58..6dc4e7385e75 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -4830,9 +4830,13 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
>  						"%s SuperSpeed%s%s USB device number %d using %s\n",
>  						(udev->config) ? "reset" : "new",
>  					 (udev->speed == USB_SPEED_SUPER_PLUS) ?
> -							"Plus Gen 2" : " Gen 1",
> -					 (udev->rx_lanes == 2 && udev->tx_lanes == 2) ?
> -							"x2" : "",
> +							" Plus" : "",
> +					 (udev->ssp_rate == USB_SSP_GEN_2x2) ?
> +							" gen2x2" :
> +					 (udev->ssp_rate == USB_SSP_GEN_2x1) ?
> +							" gen2x1" :
> +					 (udev->ssp_rate == USB_SSP_GEN_1x2) ?
> +							" gen1x2" : "",

Minor nit:
Should we keep the "Gen XxY" format used in spec and driver, instead of this "genXxY"

Thanks
Mathias
Thinh Nguyen March 11, 2021, 3:46 a.m. UTC | #2
Mathias Nyman wrote:
> On 4.2.2021 6.10, Thinh Nguyen wrote:
>> Check for usb_device->ssp_rate to print the SuperSpeed Plus signaling
>> rate generation and lane count.
>>
>> Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
>> ---
>>  Changes in v2:
>>  - None
>>
>>  drivers/usb/core/hub.c | 10 +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
>> index 823470607d58..6dc4e7385e75 100644
>> --- a/drivers/usb/core/hub.c
>> +++ b/drivers/usb/core/hub.c
>> @@ -4830,9 +4830,13 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
>>  						"%s SuperSpeed%s%s USB device number %d using %s\n",
>>  						(udev->config) ? "reset" : "new",
>>  					 (udev->speed == USB_SPEED_SUPER_PLUS) ?
>> -							"Plus Gen 2" : " Gen 1",
>> -					 (udev->rx_lanes == 2 && udev->tx_lanes == 2) ?
>> -							"x2" : "",
>> +							" Plus" : "",
>> +					 (udev->ssp_rate == USB_SSP_GEN_2x2) ?
>> +							" gen2x2" :
>> +					 (udev->ssp_rate == USB_SSP_GEN_2x1) ?
>> +							" gen2x1" :
>> +					 (udev->ssp_rate == USB_SSP_GEN_1x2) ?
>> +							" gen1x2" : "",
> Minor nit:
> Should we keep the "Gen XxY" format used in spec and driver, instead of this "genXxY"
>

Ok. I've made the fix.

Thanks,
Thinh
diff mbox series

Patch

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 823470607d58..6dc4e7385e75 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4830,9 +4830,13 @@  hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
 						"%s SuperSpeed%s%s USB device number %d using %s\n",
 						(udev->config) ? "reset" : "new",
 					 (udev->speed == USB_SPEED_SUPER_PLUS) ?
-							"Plus Gen 2" : " Gen 1",
-					 (udev->rx_lanes == 2 && udev->tx_lanes == 2) ?
-							"x2" : "",
+							" Plus" : "",
+					 (udev->ssp_rate == USB_SSP_GEN_2x2) ?
+							" gen2x2" :
+					 (udev->ssp_rate == USB_SSP_GEN_2x1) ?
+							" gen2x1" :
+					 (udev->ssp_rate == USB_SSP_GEN_1x2) ?
+							" gen1x2" : "",
 					 devnum, driver_name);
 			}