From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755972AbdKCKxE (ORCPT ); Fri, 3 Nov 2017 06:53:04 -0400 Received: from mga04.intel.com ([192.55.52.120]:59004 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754520AbdKCKxC (ORCPT ); Fri, 3 Nov 2017 06:53:02 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,338,1505804400"; d="asc'?scan'208";a="1033077317" From: Felipe Balbi To: Greg Kroah-Hartman , Lu Baolu Cc: "'Mathias Nyman'" , "linux-usb\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" Subject: Re: [PATCH v3 2/3] usb: xhci: Add DbC support in xHCI driver In-Reply-To: <20171103062702.GB16958@kroah.com> References: <1504576740-11689-1-git-send-email-baolu.lu@linux.intel.com> <1504576740-11689-3-git-send-email-baolu.lu@linux.intel.com> <59FA76AA.4060602@linux.intel.com> <20171102081720.GA3298@kroah.com> <871slhvy68.fsf@linux.intel.com> <20171102093216.GA16369@kroah.com> <87y3npufr2.fsf@linux.intel.com> <20171102165113.GB18566@kroah.com> <59FBBC3A.3040809@linux.intel.com> <20171103062702.GB16958@kroah.com> Date: Fri, 03 Nov 2017 12:52:43 +0200 Message-ID: <87fu9vvdl0.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Greg Kroah-Hartman writes: >> >>>> > >> Greg Kroah-Hartman writes: >> >>>>>>> > >> >> > xHCI compatible USB host controllers(i.e. super-speed = USB3 controllers) >> >>>>>>> > >> >> > can be implemented with the Debug Capability(DbC). It = presents a debug >> >>>>>>> > >> >> > device which is fully compliant with the USB framework= and provides the >> >>>>>>> > >> >> > equivalent of a very high performance full-duplex seri= al link. The debug >> >>>>>>> > >> >> > capability operation model and registers interface are= defined in 7.6.8 >> >>>>>>> > >> >> > of the xHCI specification, revision 1.1. >> >>>>>>> > >> >> > >> >>>>>>> > >> >> > The DbC debug device shares a root port with the xHCI = host. By default, >> >>>>>>> > >> >> > the debug capability is disabled and the root port is = assigned to xHCI. >> >>>>>>> > >> >> > When the DbC is enabled, the root port will be assigne= d to the DbC debug >> >>>>>>> > >> >> > device, and the xHCI sees nothing on this port. This i= mplementation uses >> >>>>>>> > >> >> > a sysfs node named under the xHCI device to mana= ge the enabling >> >>>>>>> > >> >> > and disabling of the debug capability. >> >>>>>>> > >> >> > >> >>>>>>> > >> >> > When the debug capability is enabled, it will present = a debug device >> >>>>>>> > >> >> > through the debug port. This debug device is fully com= pliant with the >> >>>>>>> > >> >> > USB3 framework, and it can be enumerated by a debug ho= st on the other >> >>>>>>> > >> >> > end of the USB link. As soon as the debug device is co= nfigured, a TTY >> >>>>>>> > >> >> > serial device named /dev/ttyDBC0 will be created. >> >>>>>>> > >> >> > >> >>>>>>> > >> >> > One use of this link is running a login service on the= debug target. >> >>>>>>> > >> >> > Hence it can be remote accessed by a debug host. Anoth= er use case can >> >>>>>>> > >> >> > probably be found in servers. It provides a peer-to-pe= er USB link >> >>>>>>> > >> >> > between two host-only machines. This provides a reason= able out-of-band >> >>>>>>> > >> >> > communication method between two servers. >> >>>>>>> > >> >> > >> >>>>>>> > >> >> > Signed-off-by: Lu Baolu >> >>>>>>> > >> >> > --- >> >>>>>>> > >> >> > .../ABI/testing/sysfs-bus-pci-drivers-xhci_hcd | = 25 + >> >>>>>>> > >> >> > drivers/usb/host/Kconfig | = 9 + >> >>>>>>> > >> >> > drivers/usb/host/Makefile | = 5 + >> >>>>>>> > >> >> > drivers/usb/host/xhci-dbgcap.c | = 1016 ++++++++++++++++++++ >> >>>>>>> > >> >> > drivers/usb/host/xhci-dbgcap.h | = 247 +++++ >> >>>>>>> > >> >> > drivers/usb/host/xhci-dbgtty.c | = 586 +++++++++++ >> >>>>>>> > >> >> > drivers/usb/host/xhci-trace.h | = 60 ++ >> >>>>>>> > >> >> > drivers/usb/host/xhci.c | = 10 + >> >>>>>>> > >> >> > drivers/usb/host/xhci.h | = 1 + >> >>>>>>> > >> >> > 9 files changed, 1959 insertions(+) >> >>>>>>> > >> >> > create mode 100644 Documentation/ABI/testing/sysfs-bu= s-pci-drivers-xhci_hcd >> >>>>>>> > >> >> > create mode 100644 drivers/usb/host/xhci-dbgcap.c >> >>>>>>> > >> >> > create mode 100644 drivers/usb/host/xhci-dbgcap.h >> >>>>>>> > >> >> > create mode 100644 drivers/usb/host/xhci-dbgtty.c >> >>>>>>> > >> >> > >> >>>>>> > >> >>=20 >> >>>>>> > >> >> [snip] >> >>>>>> > >> >>=20 >> >>>>>>> > >> >> > +#define DBC_VENDOR_ID 0x1d6b /* Linux Foundation 0x= 1d6b */ >> >>>>>>> > >> >> > +#define DBC_PRODUCT_ID 0x0004 /* device 0004 */ >> >>>>>>> > >> >> > >> >>>>>> > >> >>=20 >> >>>>>> > >> >> The DbC (xHCI DeBug Capability) is an optional functional= ity in >> >>>>>> > >> >> some xHCI host controllers. It will present a super-speed= debug >> >>>>>> > >> >> device through the debug port after it is enabled. >> >>>>>> > >> >>=20 >> >>>>>> > >> >> The DbC register set defines an interface for system soft= ware >> >>>>>> > >> >> to specify the vendor id and product id of the debug devi= ce. >> >>>>>> > >> >> These two values will be presented by the debug device in= its >> >>>>>> > >> >> device descriptor idVendor and idProduct fields. >> >>>>>> > >> >>=20 >> >>>>>> > >> >> Microsoft Windows have a well established protocol for >> >>>>>> > >> >> debugging over DbC. And it assigns below values for its u= se. >> >>>>>> > >> >>=20 >> >>>>>> > >> >> USB\VID_045E&PID_062D.DeviceDesc=3D"Microsoft USB Debug T= arget" >> >>>>>> > >> >>=20 >> >>>>>> > >> >> I'm going to use 0x1d6b/0x0004 value pair for DbC use in >> >>>>>> > >> >> Linux. Do you approve me to do so? >> >>>>> > >> > >> >>>>> > >> > No. Why can't you use the same ids as Windows? This is im= plementing >> >>>>> > >> > the same protocol, right? >> >>>> > >>=20 >> >>>> > >> the protocol running on top is 100% vendor specific. More than= likely, >> >>>> > >> we would just run kgdb on top of this, right? We really don't = support >> >>>> > >> microsoft's debug architecture. >> >>> > > >> >>> > > Ah, I didn't know about the protocol specifics here, if it is >> >>> > > vendor-specific, then yes, we need our own id. >> >> >=20 >> >> > Great, thanks :-) >> >> >=20 >> >> > Let us know which one we're allowed to use and I'm sure Baolu can r= espin >> >> > the patch in no time. >> > Can I get a "full" description of what string this device id will >> > reference? Is it "Linux USB Debug Target" or something else? >> > >>=20 >> Current manufacturer and product strings are set like this. >>=20 >> +#define DBC_STRING_MANUFACTURER "Linux" >> +#define DBC_STRING_PRODUCT "Remote GDB" >>=20 >> These are also place holders. We can change them to more meaningful stri= ngs. > > As the vendor id is assigned to "Linux Foundation" can we change that > string please? > > And why not match what Microsoft does here, "USB Debug Target" makes > more sense than "Remote GDB", right? I agree. It just happens to talk remote GDB protocol through KGDB, but we could run KDB directly or, even, come up with a new protocol. > If so, please use device id 0x0010, I've reserved that for the driver > now. thanks Greg =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAln8SnsACgkQzL64meEa mQbWGw/+P30toxelvO9fjnWaK47IHvirjv4CJh4wfdWR4fOkDF9Hg3RVfWYFaD+W 0uq92+8wuCnH2Se/bArES0aY3Vr0WFockGwsN0bcA4ZxMcY8LbReUJUCvpDh2xow O/YuDD6CimGLko6HculJU1W1IVGkfAZAcnk0zPWIUrTWTUqwq9NlxphlmiXrKFZU FRntLtBFmPngrk2eXlDzFdyoCNYzSS90AEiRuXZyQBNkmvE5eP/M5jddqV7M3bU3 c+Xa4OlI+RgxonlobGFPM6yTB8rdknLu1XwtCJ5gunotfdlH15SdpSzuZZi3N9xS zYB23EXWkjFkXZeenDFzAFuA8rG5RhT7hbWJUNYUZr9j/ANaceVr7+vt4sa7D7bK pX6Vs2VcKDwYrQcP4raRxlcweHAahDijF0uAd598cYNJdFBsibzDTsNn8srZgW5P S96AbexerEhDlhsGpG4fuHBwZATBh8J8b3DSL1CkzYXykRTJWpOuhoClWT6nQ4P7 kMzXXHm0yCn4EVc02C6WqoeNsWmb+W9G6a00/Y3+zZaycLBBpdlwN8wlSP5X76uv L1Ozb362ao/3JyhSfeknD7+lj0hWUPt4VYrpDzjWmOpB1KWZVa9Vguk6JERGrNXQ 5cmKW/yPHIdI0PoCHMnc/sut3SUDeJK53GYKP5TE91cYjhOW1t4= =NOkb -----END PGP SIGNATURE----- --=-=-=--