mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dingyan Li <18500469033@163.com>
To: gregkh@linuxfoundation.org, stern@rowland.harvard.edu
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] USB: add new speed value to USB debugfs
Date: Fri, 18 Aug 2023 23:35:09 +0800	[thread overview]
Message-ID: <20230818153509.38814-1-18500469033@163.com> (raw)

Current max speed supported in USB debugfs is 10000.
Since USB 3.2 GEN_2x2 has reached 20000, it's better
to add it. The idea is borrowed from USB sysfs, with
a combination of USB_SPEED_SUPER_PLUS and
USB_SSP_GEN_2x2, the actual speed should be 20000.

Signed-off-by: Dingyan Li <18500469033@163.com>
---
 drivers/usb/core/devices.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index a247da73f34d..78ebcb657dce 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -429,7 +429,11 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes,
 	case USB_SPEED_SUPER:
 		speed = "5000"; break;
 	case USB_SPEED_SUPER_PLUS:
-		speed = "10000"; break;
+		if (usbdev->ssp_rate == USB_SSP_GEN_2x2)
+			speed = "20000";
+		else
+			speed = "10000";
+		break;
 	default:
 		speed = "??";
 	}
-- 
2.25.1


             reply	other threads:[~2023-08-18 15:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18 15:35 Dingyan Li [this message]
2023-08-20  6:30 ` Dingyan Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230818153509.38814-1-18500469033@163.com \
    --to=18500469033@163.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®