public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3 04/12] usb: xhci: dbc: add support for Intel xHCI dbc quirk
@ 2015-11-13 14:40 Dmitry Malkin
  2015-11-13 15:34 ` Dmitry Malkin
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Malkin @ 2015-11-13 14:40 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org

On Mon, 9 Nov 2015 15:38:33 +0800, Lu Baolu wrote:
> On Intel platform, if the debug target is connected with debug
> host, enabling DCE bit in command register leads to a hung bus
> state. In the hung state, the host system will not see a port
> connected status bit set. Hence debug target fails to be probed.
>
> The state could be resolved by performing a port reset to the
> debug port from the host xHCI. This patch introduces this work
> around.

Is it correct to call this a "hung bus state"?  Wouldn't calling it
"hung port state" more appropriate?

I have observed this DCE-enable-related hung port state,
but the reason seemed to be different in my case:

Citing a note (sic!) from The Holy XHCI Spec, section 7.6.4.1:
> If a Debug Host attempts to attach to a Debug Target before the DCE flag is set,
> both ends of the link shall transition to the Inactive state.
> So a Debug Host should periodically issue a Warm Reset
> to ports that are Inactive to enable a connection to the DbC of the Debug Target.

Indeed, the inactive state is what I have observed (PLS field of port register PORTSC)
when the DCE bit is set to 1 with the cable already plugged in.

Now, according to my interpretation of The Hole USB 3.1 spec, section 7.5.2,
which says:
> eSS.Inactive is a state where a link has failed Enhanced SuperSpeed operation.
> A downstream port can only exit from this state when directed, or upon detection of
> an absence of a far-end receiver termination (R RX-DC ) specified in Table 6-21,
> or upon a Warm Reset.

It follows, that since hosts without DBC cannot listen to upstream requests,
the debug target-originated port reset requests (both hot and warm) will be ignored
by the debug host.

This is the essence of the "hung port state" that I was able to observe.

Note, that this roadblock doesn't appear if you attach the cable /after/ enabling the DCE bit,
or, alternatively, if the host has DBC.

And indeed, your quirk will work in the latter case, since the debug host hub
will be able to see the upstream reset request.

-- 
with best regards,
Dmitry Malkin

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
@ 2015-11-09  7:38 Lu Baolu
  2015-11-09  7:38 ` [PATCH v3 04/12] usb: xhci: dbc: add support for Intel xHCI dbc quirk Lu Baolu
  0 siblings, 1 reply; 6+ messages in thread
From: Lu Baolu @ 2015-11-09  7:38 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman, Alan Stern
  Cc: linux-usb, x86, linux-kernel, Lu Baolu

This patch series adds support for early printk through USB3 debug port.
USB3 debug port is described in xHCI specification as an optional extended
capability.

The first patch adds a file in sysfs, through which users can check
whether the debug capability is supported by a specific host controller,
and the hardware state.

Patch 2 to 10 add the driver for xHCI debug capability. It interfaces with
the register set and provides the required ops (read/write/control) to upper
layers. Early printk is one consumer of these ops. The hooks for early printk
are introduced in patch 9. This design is similar to what we have done in
drivers/usb/early/ehci-dbgp.c.

Patch 11 is a minor change to usb_debug module. This change is required to
bind usb_debug with the USB3 debug device.

Patch 12 is the design document and user guide.

Change log:
v1->v2:
(1) Patch 1 re-implemented. "debugfs" has been replaced with sysfs.
    The scope reduced from all extended capabilities to debug port
    specific.
(2) Patch 11 changed. Removed unnecessary .bulk_out_size setting.

v2->v3:
(1) Patch 11 got acked by Johan Hovold.

Lu Baolu (12):
  usb: xhci: add sysfs file for xHCI debug port
  x86: fixmap: add permanent fixmap for xhci debug port
  usb: xhci: dbc: probe and setup xhci debug capability
  usb: xhci: dbc: add support for Intel xHCI dbc quirk
  usb: xhci: dbc: add debug buffer
  usb: xhci: dbc: add bulk out and bulk in interfaces
  usb: xhci: dbc: handle dbc-configured exit
  usb: xhci: dbc: handle endpoint stall
  x86: early_printk: add USB3 debug port earlyprintk support
  usb: xhci: dbc: add handshake between debug target and host
  usb: serial: usb_debug: add support for dbc debug device
  usb: doc: add document for xHCI DbC driver

 .../ABI/testing/sysfs-bus-pci-drivers-xhci_hcd     |   23 +
 Documentation/kernel-parameters.txt                |    1 +
 Documentation/usb/xhci-dbc.txt                     |  325 +++++
 MAINTAINERS                                        |    8 +
 arch/x86/Kconfig.debug                             |   12 +
 arch/x86/include/asm/fixmap.h                      |    4 +
 arch/x86/kernel/early_printk.c                     |    5 +
 drivers/usb/early/Makefile                         |    1 +
 drivers/usb/early/xhci-dbc.c                       | 1407 ++++++++++++++++++++
 drivers/usb/host/Makefile                          |    2 +-
 drivers/usb/host/xhci-ext-caps.h                   |   14 +-
 drivers/usb/host/xhci-sysfs.c                      |  100 ++
 drivers/usb/host/xhci.c                            |    4 +
 drivers/usb/host/xhci.h                            |    4 +
 drivers/usb/serial/usb_debug.c                     |   28 +-
 include/linux/usb/xhci-dbc.h                       |  224 ++++
 16 files changed, 2157 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-pci-drivers-xhci_hcd
 create mode 100644 Documentation/usb/xhci-dbc.txt
 create mode 100644 drivers/usb/early/xhci-dbc.c
 create mode 100644 drivers/usb/host/xhci-sysfs.c
 create mode 100644 include/linux/usb/xhci-dbc.h

-- 
2.1.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-18 11:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13 14:40 [PATCH v3 04/12] usb: xhci: dbc: add support for Intel xHCI dbc quirk Dmitry Malkin
2015-11-13 15:34 ` Dmitry Malkin
2015-11-16  2:18   ` Lu Baolu
2015-11-17 10:28     ` Dmitry Malkin
2015-11-18 11:10       ` Lu Baolu
  -- strict thread matches above, loose matches on Subject: below --
2015-11-09  7:38 [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port Lu Baolu
2015-11-09  7:38 ` [PATCH v3 04/12] usb: xhci: dbc: add support for Intel xHCI dbc quirk Lu Baolu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox