Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265420 > unrolled thread

[PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

Started byLu Baolu <baolu.lu@linux.intel.com>
First post2015-11-09 08:50 +0100
Last post2015-11-13 07:30 +0100
Articles 20 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port Lu Baolu <baolu.lu@linux.intel.com> - 2015-11-09 08:50 +0100
    [PATCH v3 11/12] usb: serial: usb_debug: add support for dbc debug device Lu Baolu <baolu.lu@linux.intel.com> - 2015-11-09 08:50 +0100
    [PATCH v3 09/12] x86: early_printk: add USB3 debug port earlyprintk support Lu Baolu <baolu.lu@linux.intel.com> - 2015-11-09 08:50 +0100
    [PATCH v3 04/12] usb: xhci: dbc: add support for Intel xHCI dbc quirk Lu Baolu <baolu.lu@linux.intel.com> - 2015-11-09 08:50 +0100
    [PATCH v3 02/12] x86: fixmap: add permanent fixmap for xhci debug port Lu Baolu <baolu.lu@linux.intel.com> - 2015-11-09 08:50 +0100
    [PATCH v3 10/12] usb: xhci: dbc: add handshake between debug target and host Lu Baolu <baolu.lu@linux.intel.com> - 2015-11-09 08:50 +0100
    [PATCH v3 07/12] usb: xhci: dbc: handle dbc-configured exit Lu Baolu <baolu.lu@linux.intel.com> - 2015-11-09 08:50 +0100
    [PATCH v3 01/12] usb: xhci: add sysfs file for xHCI debug port Lu Baolu <baolu.lu@linux.intel.com> - 2015-11-09 08:50 +0100
      Re: [PATCH v3 01/12] usb: xhci: add sysfs file for xHCI debug port Dave Young <dyoung@redhat.com> - 2015-11-10 10:40 +0100
        Re: [PATCH v3 01/12] usb: xhci: add sysfs file for xHCI debug port "Lu, Baolu" <baolu.lu@linux.intel.com> - 2015-11-11 03:10 +0100
    Re: [PATCH v3 00/12] usb: early: add support for early printk  through USB3 debug port Dave Young <dyoung@redhat.com> - 2015-11-10 10:50 +0100
      Re: [PATCH v3 00/12] usb: early: add support for early printk through  USB3 debug port "Lu, Baolu" <baolu.lu@linux.intel.com> - 2015-11-11 02:40 +0100
        Re: [PATCH v3 00/12] usb: early: add support for early printk  through USB3 debug port Dave Young <dyoung@redhat.com> - 2015-11-11 03:30 +0100
          Re: [PATCH v3 00/12] usb: early: add support for early printk through  USB3 debug port "Lu, Baolu" <baolu.lu@linux.intel.com> - 2015-11-11 03:50 +0100
          Re: [PATCH v3 00/12] usb: early: add support for early printk through  USB3 debug port "Lu, Baolu" <baolu.lu@linux.intel.com> - 2015-11-11 07:00 +0100
          Re: [PATCH v3 00/12] usb: early: add support for early printk through  USB3 debug port "Lu, Baolu" <baolu.lu@linux.intel.com> - 2015-11-12 03:50 +0100
            Re: [PATCH v3 00/12] usb: early: add support for early printk  through USB3 debug port Dave Young <dyoung@redhat.com> - 2015-11-12 07:10 +0100
              Re: [PATCH v3 00/12] usb: early: add support for early printk through  USB3 debug port "Lu, Baolu" <baolu.lu@linux.intel.com> - 2015-11-13 03:10 +0100
                Re: [PATCH v3 00/12] usb: early: add support for early printk  through USB3 debug port Dave Young <dyoung@redhat.com> - 2015-11-13 03:30 +0100
                  Re: [PATCH v3 00/12] usb: early: add support for early printk through  USB3 debug port Lu Baolu <baolu.lu@linux.intel.com> - 2015-11-13 07:30 +0100

#1265420 — [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

FromLu Baolu <baolu.lu@linux.intel.com>
Date2015-11-09 08:50 +0100
Subject[PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qsPnb-3rE-3@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1265422 — [PATCH v3 11/12] usb: serial: usb_debug: add support for dbc debug device

FromLu Baolu <baolu.lu@linux.intel.com>
Date2015-11-09 08:50 +0100
Subject[PATCH v3 11/12] usb: serial: usb_debug: add support for dbc debug device
Message-ID<qsPnc-3rE-19@gated-at.bofh.it>
In reply to#1265420
This patch add dbc debug device support in usb_debug driver.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Acked-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/usb_debug.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c
index ca2fa5b..92f7e5c 100644
--- a/drivers/usb/serial/usb_debug.c
+++ b/drivers/usb/serial/usb_debug.c
@@ -32,7 +32,18 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(0x0525, 0x127a) },
 	{ },
 };
-MODULE_DEVICE_TABLE(usb, id_table);
+
+static const struct usb_device_id dbc_id_table[] = {
+	{ USB_DEVICE(0x1d6b, 0x0004) },
+	{ },
+};
+
+static const struct usb_device_id id_table_combined[] = {
+	{ USB_DEVICE(0x0525, 0x127a) },
+	{ USB_DEVICE(0x1d6b, 0x0004) },
+	{ },
+};
+MODULE_DEVICE_TABLE(usb, id_table_combined);
 
 /* This HW really does not support a serial break, so one will be
  * emulated when ever the break state is set to true.
@@ -71,9 +82,20 @@ static struct usb_serial_driver debug_device = {
 	.process_read_urb =	usb_debug_process_read_urb,
 };
 
+static struct usb_serial_driver dbc_device = {
+	.driver = {
+		.owner =	THIS_MODULE,
+		.name =		"xhci_dbc",
+	},
+	.id_table =		dbc_id_table,
+	.num_ports =		1,
+	.break_ctl =		usb_debug_break_ctl,
+	.process_read_urb =	usb_debug_process_read_urb,
+};
+
 static struct usb_serial_driver * const serial_drivers[] = {
-	&debug_device, NULL
+	&debug_device, &dbc_device, NULL
 };
 
-module_usb_serial_driver(serial_drivers, id_table);
+module_usb_serial_driver(serial_drivers, id_table_combined);
 MODULE_LICENSE("GPL");
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265424 — [PATCH v3 09/12] x86: early_printk: add USB3 debug port earlyprintk support

FromLu Baolu <baolu.lu@linux.intel.com>
Date2015-11-09 08:50 +0100
Subject[PATCH v3 09/12] x86: early_printk: add USB3 debug port earlyprintk support
Message-ID<qsPnc-3rE-25@gated-at.bofh.it>
In reply to#1265420
Add support for early printk by writing debug messages to the USB3
debug port. Users can use this type of early printk by specifying
kernel parameter of "earlyprintk=xdbc". This gives users a chance
of providing debug output.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 Documentation/kernel-parameters.txt |  1 +
 arch/x86/kernel/early_printk.c      |  5 +++++
 drivers/usb/early/xhci-dbc.c        | 43 +++++++++++++++++++++++++++++++++++++
 include/linux/usb/xhci-dbc.h        |  5 +++++
 4 files changed, 54 insertions(+)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 22a4b68..b65b07f 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1032,6 +1032,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			earlyprintk=ttySn[,baudrate]
 			earlyprintk=dbgp[debugController#]
 			earlyprintk=pciserial,bus:device.function[,baudrate]
+			earlyprintk=xdbc[xhciController#]
 
 			earlyprintk is useful when the kernel crashes before
 			the normal console is initialized. It is not enabled by
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index eec40f5..5341a16 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -17,6 +17,7 @@
 #include <asm/intel-mid.h>
 #include <asm/pgtable.h>
 #include <linux/usb/ehci_def.h>
+#include <linux/usb/xhci-dbc.h>
 #include <linux/efi.h>
 #include <asm/efi.h>
 #include <asm/pci_x86.h>
@@ -373,6 +374,10 @@ static int __init setup_early_printk(char *buf)
 		if (!strncmp(buf, "dbgp", 4) && !early_dbgp_init(buf + 4))
 			early_console_register(&early_dbgp_console, keep);
 #endif
+#ifdef CONFIG_EARLY_PRINTK_XDBC
+		if (!strncmp(buf, "xdbc", 4) && !early_xdbc_init(buf + 4))
+			early_console_register(&early_xdbc_console, keep);
+#endif
 #ifdef CONFIG_HVC_XEN
 		if (!strncmp(buf, "xen", 3))
 			early_console_register(&xenboot_console, keep);
diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index aaf655f..68a7139 100644
--- a/drivers/usb/early/xhci-dbc.c
+++ b/drivers/usb/early/xhci-dbc.c
@@ -10,6 +10,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/console.h>
 #include <linux/pci_regs.h>
 #include <linux/pci_ids.h>
 #include <linux/bootmem.h>
@@ -1332,3 +1333,45 @@ int xdbc_bulk_write(const char *bytes, int size)
 
 	return ret;
 }
+
+/*
+ * Start a bulk-in or bulk-out transfer, wait until transfer completion
+ * or error. Return the count of actually transferred bytes or error.
+ */
+static void early_xdbc_write(struct console *con, const char *str, u32 n)
+{
+	int chunk, ret;
+	static char buf[XDBC_MAX_PACKET];
+	int use_cr = 0;
+
+	if (!xdbcp->xdbc_reg)
+		return;
+	memset(buf, 0, XDBC_MAX_PACKET);
+	while (n > 0) {
+		for (chunk = 0; chunk < XDBC_MAX_PACKET && n > 0;
+		     str++, chunk++, n--) {
+			if (!use_cr && *str == '\n') {
+				use_cr = 1;
+				buf[chunk] = '\r';
+				str--;
+				n++;
+				continue;
+			}
+			if (use_cr)
+				use_cr = 0;
+			buf[chunk] = *str;
+		}
+		if (chunk > 0) {
+			ret = xdbc_bulk_write(buf, chunk);
+			if (ret < 0)
+				break;
+		}
+	}
+}
+
+struct console early_xdbc_console = {
+	.name =		"earlyxdbc",
+	.write =	early_xdbc_write,
+	.flags =	CON_PRINTBUFFER,
+	.index =	-1,
+};
diff --git a/include/linux/usb/xhci-dbc.h b/include/linux/usb/xhci-dbc.h
index 289ba58..a556eb8 100644
--- a/include/linux/usb/xhci-dbc.h
+++ b/include/linux/usb/xhci-dbc.h
@@ -216,4 +216,9 @@ struct xdbc_state {
 #define	xdbc_read64(regs)	xhci_read_64(NULL, (regs))
 #define	xdbc_write64(val, regs)	xhci_write_64(NULL, (val), (regs))
 
+#ifdef CONFIG_EARLY_PRINTK_XDBC
+extern int early_xdbc_init(char *s);
+extern struct console early_xdbc_console;
+#endif /* CONFIG_EARLY_PRINTK_XDBC */
+
 #endif /* __LINUX_XHCI_DBC_H */
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265425 — [PATCH v3 04/12] usb: xhci: dbc: add support for Intel xHCI dbc quirk

FromLu Baolu <baolu.lu@linux.intel.com>
Date2015-11-09 08:50 +0100
Subject[PATCH v3 04/12] usb: xhci: dbc: add support for Intel xHCI dbc quirk
Message-ID<qsPnc-3rE-27@gated-at.bofh.it>
In reply to#1265420
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.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/usb/early/xhci-dbc.c | 52 ++++++++++++++++++++++++++++++++++++++++++++
 include/linux/usb/xhci-dbc.h |  2 ++
 2 files changed, 54 insertions(+)

diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index 22a1de9..6b23f09 100644
--- a/drivers/usb/early/xhci-dbc.c
+++ b/drivers/usb/early/xhci-dbc.c
@@ -255,6 +255,8 @@ static void __iomem *xdbc_map_pci_mmio(u32 bus,
 	xdbcp->bar = bar;
 	xdbcp->xhci_base = base;
 	xdbcp->xhci_length = sz64;
+	xdbcp->vendor = read_pci_config_16(bus, dev, func, PCI_VENDOR_ID);
+	xdbcp->device = read_pci_config_16(bus, dev, func, PCI_DEVICE_ID);
 
 	if (length)
 		*length = sz64;
@@ -651,6 +653,52 @@ static int xdbc_mem_init(void)
 	return 0;
 }
 
+static void xdbc_reset_debug_port_callback(int cap_offset, void *data)
+{
+	u8 major;
+	u32 val, port_offset, port_count;
+	u32 cap_length;
+	void __iomem *ops_reg;
+	void __iomem *portsc;
+	int i;
+
+	val = readl(xdbcp->xhci_base + cap_offset);
+	major = (u8) XHCI_EXT_PORT_MAJOR(val);
+
+	/* only reset super-speed port */
+	if (major != 0x3)
+		return;
+
+	val = readl(xdbcp->xhci_base + cap_offset + 8);
+	port_offset = XHCI_EXT_PORT_OFF(val);
+	port_count = XHCI_EXT_PORT_COUNT(val);
+	xdbc_trace("Extcap Port offset %d count %d\n",
+			port_offset, port_count);
+
+	cap_length = readl(xdbcp->xhci_base) & 0xff;
+	ops_reg = xdbcp->xhci_base + cap_length;
+
+	port_offset--;
+	for (i = port_offset; i < (port_offset + port_count); i++) {
+		portsc = ops_reg + 0x400 + i * 0x10;
+		val = readl(portsc);
+		/* reset the port if CCS bit is cleared */
+		if (!(val & 0x1))
+			writel(val | (1 << 4), portsc);
+	}
+}
+
+static void xdbc_reset_debug_port(void)
+{
+	xdbc_walk_excap(xdbcp->bus,
+			xdbcp->dev,
+			xdbcp->func,
+			XHCI_EXT_CAPS_PROTOCOL,
+			false,
+			xdbc_reset_debug_port_callback,
+			NULL);
+}
+
 /*
  * xdbc_start: start DbC
  *
@@ -669,6 +717,10 @@ static int xdbc_start(void)
 		return -ENODEV;
 	}
 
+	/* reset port to avoid bus hang */
+	if (xdbcp->vendor == PCI_VENDOR_ID_INTEL)
+		xdbc_reset_debug_port();
+
 	/* wait for port connection */
 	if (handshake(&xdbcp->xdbc_reg->portsc, PORTSC_CCS,
 			PORTSC_CCS, 5000000, 100) < 0) {
diff --git a/include/linux/usb/xhci-dbc.h b/include/linux/usb/xhci-dbc.h
index 153fb87..fc0ef9a 100644
--- a/include/linux/usb/xhci-dbc.h
+++ b/include/linux/usb/xhci-dbc.h
@@ -128,6 +128,8 @@ struct xdbc_state {
 	u32		dev;
 	u32		func;
 	u8		bar;
+	u16		vendor;
+	u16		device;
 	void __iomem	*xhci_base;
 	size_t		xhci_length;
 #define	XDBC_PCI_MAX_BUSES		256
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265427 — [PATCH v3 02/12] x86: fixmap: add permanent fixmap for xhci debug port

FromLu Baolu <baolu.lu@linux.intel.com>
Date2015-11-09 08:50 +0100
Subject[PATCH v3 02/12] x86: fixmap: add permanent fixmap for xhci debug port
Message-ID<qsPnc-3rE-21@gated-at.bofh.it>
In reply to#1265420
xHCI compatible USB3 host controller may provide debug capability
which enables low-level system debug over USB. In order to probing
this debug capability, Linux kernel needs to map and access the
mmio of the host controller during early boot.

This patch adds permenent fixmap pages in fixed_addresses table for
xHCI mmio access.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 arch/x86/include/asm/fixmap.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index f80d700..fbf452f 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -82,6 +82,10 @@ enum fixed_addresses {
 #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
 	FIX_OHCI1394_BASE,
 #endif
+#ifdef CONFIG_EARLY_PRINTK_XDBC
+	FIX_XDBC_BASE,
+	FIX_XDBC_END = FIX_XDBC_BASE + 15,
+#endif
 #ifdef CONFIG_X86_LOCAL_APIC
 	FIX_APIC_BASE,	/* local (CPU) APIC) -- required for SMP or not */
 #endif
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265428 — [PATCH v3 10/12] usb: xhci: dbc: add handshake between debug target and host

FromLu Baolu <baolu.lu@linux.intel.com>
Date2015-11-09 08:50 +0100
Subject[PATCH v3 10/12] usb: xhci: dbc: add handshake between debug target and host
Message-ID<qsPnc-3rE-33@gated-at.bofh.it>
In reply to#1265420
After DbC setup, debug target needs to wait until tty driver and
application (e.g. mincom) on debug taget start.  Otherwise, out
messages might be ignored.

This patch adds a ping/pong mechanism between debug target and
host. Debug target will be waiting there until user presses 'Y'
or 'y' in the tty application.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/usb/early/xhci-dbc.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index 68a7139..b75c523 100644
--- a/drivers/usb/early/xhci-dbc.c
+++ b/drivers/usb/early/xhci-dbc.c
@@ -32,6 +32,9 @@
 static struct xdbc_state xdbc_stat;
 static struct xdbc_state *xdbcp = &xdbc_stat;
 
+static int early_xdbc_read(struct console *con, char *str, unsigned n);
+static void early_xdbc_write(struct console *con, const char *str, u32 n);
+
 #ifdef DBC_DEBUG
 #define	XDBC_DEBUG_BUF_SIZE	(PAGE_SIZE * 32)
 #define	MSG_MAX_LINE		128
@@ -873,8 +876,12 @@ int __init early_xdbc_init(char *s)
 {
 	u32 bus = 0, dev = 0, func = 0;
 	unsigned long dbgp_num = 0;
+	char *ping = "Press Y to continue...\n";
+	char pong[64];
+	size_t size;
 	u32 offset;
 	int ret;
+	int retry = 20;
 
 	if (!early_pci_allowed())
 		return -EPERM;
@@ -917,6 +924,21 @@ int __init early_xdbc_init(char *s)
 		return ret;
 	}
 
+	while (retry > 0) {
+		early_xdbc_write(NULL, ping, strlen(ping));
+		size = early_xdbc_read(NULL, pong, 64);
+		if (size > 0) {
+			xdbc_trace("%s: pong message: %s\n", __func__, pong);
+			if (pong[0] == 'Y' || pong[0] == 'y')
+				break;
+		} else {
+			xdbc_trace("%s: pong message error %d\n",
+				__func__, size);
+		}
+
+		retry--;
+	}
+
 	return 0;
 }
 
@@ -1338,6 +1360,11 @@ int xdbc_bulk_write(const char *bytes, int size)
  * Start a bulk-in or bulk-out transfer, wait until transfer completion
  * or error. Return the count of actually transferred bytes or error.
  */
+static int early_xdbc_read(struct console *con, char *str, unsigned n)
+{
+	return xdbc_bulk_read(str, n, 0);
+}
+
 static void early_xdbc_write(struct console *con, const char *str, u32 n)
 {
 	int chunk, ret;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265429 — [PATCH v3 07/12] usb: xhci: dbc: handle dbc-configured exit

FromLu Baolu <baolu.lu@linux.intel.com>
Date2015-11-09 08:50 +0100
Subject[PATCH v3 07/12] usb: xhci: dbc: handle dbc-configured exit
Message-ID<qsPnc-3rE-37@gated-at.bofh.it>
In reply to#1265420
DbC might exit configured state in some cases (refer to 7.6.4.4 in
xHCI spec 1.1). Software needs detect and clear this situation by
clearing DCCTRL.DCR and wait until the DbC configured before read
or write oprations.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/usb/early/xhci-dbc.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index f51daa4..8a5a51f 100644
--- a/drivers/usb/early/xhci-dbc.c
+++ b/drivers/usb/early/xhci-dbc.c
@@ -1153,6 +1153,29 @@ static int xdbc_wait_until_bulk_done(struct xdbc_trb *trb, int loops)
 	return -EIO;
 }
 
+static int xdbc_wait_until_dbc_configured(void)
+{
+	int timeout = 0;
+	u32 reg;
+
+	/* Port exits configured state */
+	reg = readl(&xdbcp->xdbc_reg->control);
+	if (!(reg & CTRL_DRC))
+		return 0;
+
+	/* clear run change bit (RW1C) */
+	writel(reg | CTRL_DRC, &xdbcp->xdbc_reg->control);
+
+	do {
+		if (readl(&xdbcp->xdbc_reg->control) & CTRL_DCR)
+			return 0;
+
+		xdbc_udelay(10);
+	} while (timeout++ < XDBC_LOOPS);
+
+	return -ETIMEDOUT;
+}
+
 static int xdbc_bulk_transfer(void *data, int size, int loops, bool read)
 {
 	u64 addr;
@@ -1167,6 +1190,11 @@ static int xdbc_bulk_transfer(void *data, int size, int loops, bool read)
 		return -EINVAL;
 	}
 
+	if (xdbc_wait_until_dbc_configured()) {
+		xdbc_trace("%s: hardware not ready\n", __func__);
+		return -EPERM;
+	}
+
 	ring = (read ? &xdbcp->in_ring : &xdbcp->out_ring);
 	trb = ring->enqueue;
 	cycle = ring->cycle_state;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265430 — [PATCH v3 01/12] usb: xhci: add sysfs file for xHCI debug port

FromLu Baolu <baolu.lu@linux.intel.com>
Date2015-11-09 08:50 +0100
Subject[PATCH v3 01/12] usb: xhci: add sysfs file for xHCI debug port
Message-ID<qsPnd-3rE-39@gated-at.bofh.it>
In reply to#1265420
This patch adds a sysfs file for users to check 1) whether the debug
capability is implemented by hardware; 2) if supported, which state
does it stay at.

With a host that supports debug port, a file named "debug_port_state"
will be created under the device sysfs directory. Reading this file
will show users the state (disabled, enabled or configured) of the
debug port.

With a host that does NOT support debug port, "debug_port_state" file
won't be created.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 .../ABI/testing/sysfs-bus-pci-drivers-xhci_hcd     |  23 +++++
 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 +
 6 files changed, 145 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-pci-drivers-xhci_hcd
 create mode 100644 drivers/usb/host/xhci-sysfs.c

diff --git a/Documentation/ABI/testing/sysfs-bus-pci-drivers-xhci_hcd b/Documentation/ABI/testing/sysfs-bus-pci-drivers-xhci_hcd
new file mode 100644
index 0000000..dd3e722
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-pci-drivers-xhci_hcd
@@ -0,0 +1,23 @@
+What:		/sys/bus/pci/drivers/xhci_hcd/.../debug_port_state
+Date:		November 2015
+KernelVersion:	4.3.0
+Contact:	Lu Baolu <baolu.lu@linux.intel.com>
+Description:
+		This file is designed for users to check the state of a
+		USB3 debug port. On a machine which supports USB3 debug
+		port, this file will be created. Reading this file will
+		show the state (disabled, enabled or configured) of the
+		debug port. On a machine that doesn't support USB3 debug
+		port, this file doesn't exist.
+
+		The state of a debug port could be:
+		1) disabled: The debug port is not enabled and the root
+			port has been switched to xHCI host as a normal
+			root port.
+		2) enabled: The debug port is enabled. The debug port
+			has been assigned to debug capability. The debug
+			capability is able to handle the control requests
+			defined in USB3 spec.
+		3) configured: The debug port has been enumerated by the
+			debug host as a debug device. The debug port is
+			in use now.
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index e7558ab..810c304 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -12,7 +12,7 @@ fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o
 
 xhci-hcd-y := xhci.o xhci-mem.o
 xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o
-xhci-hcd-y += xhci-trace.o
+xhci-hcd-y += xhci-trace.o xhci-sysfs.o
 
 xhci-plat-hcd-y := xhci-plat.o
 ifneq ($(CONFIG_USB_XHCI_MVEBU), )
diff --git a/drivers/usb/host/xhci-ext-caps.h b/drivers/usb/host/xhci-ext-caps.h
index 9fe3225..12c87e5 100644
--- a/drivers/usb/host/xhci-ext-caps.h
+++ b/drivers/usb/host/xhci-ext-caps.h
@@ -49,8 +49,15 @@
 #define XHCI_EXT_CAPS_PM	3
 #define XHCI_EXT_CAPS_VIRT	4
 #define XHCI_EXT_CAPS_ROUTE	5
-/* IDs 6-9 reserved */
+#define XHCI_EXT_CAPS_LOCALMEM	6
+/* IDs 7-9 reserved */
 #define XHCI_EXT_CAPS_DEBUG	10
+/* IDs 192-255 vendor specific */
+#define XHCI_EXT_CAPS_VEN_START	192
+#define XHCI_EXT_CAPS_VEN_END	255
+#define XHCI_EXT_CAPS_VENDOR(p)	(((p) >= XHCI_EXT_CAPS_VEN_START) && \
+				((p) <= XHCI_EXT_CAPS_VEN_END))
+#define XHCI_EXT_MAX_CAPID	XHCI_EXT_CAPS_VEN_END
 /* USB Legacy Support Capability - section 7.1.1 */
 #define XHCI_HC_BIOS_OWNED	(1 << 16)
 #define XHCI_HC_OS_OWNED	(1 << 24)
@@ -73,6 +80,11 @@
 #define XHCI_HLC               (1 << 19)
 #define XHCI_BLC               (1 << 20)
 
+/* Debug capability - section 7.6.8 */
+#define XHCI_DBC_DCCTRL		0x20
+#define XHCI_DBC_DCCTRL_DCR	(1 << 0)
+#define	XHCI_DBC_DCCTRL_DCE	(1 << 31)
+
 /* command register values to disable interrupts and halt the HC */
 /* start/stop HC execution - do not write unless HC is halted*/
 #define XHCI_CMD_RUN		(1 << 0)
diff --git a/drivers/usb/host/xhci-sysfs.c b/drivers/usb/host/xhci-sysfs.c
new file mode 100644
index 0000000..0192ac4
--- /dev/null
+++ b/drivers/usb/host/xhci-sysfs.c
@@ -0,0 +1,100 @@
+/*
+ * sysfs interface for xHCI host controller driver
+ *
+ * Copyright (C) 2015 Intel Corp.
+ *
+ * Author: Lu Baolu <baolu.lu@linux.intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+
+#include "xhci.h"
+
+/*
+ * Return the register offset of a extended capability specified
+ * by @cap_id. Return 0 if @cap_id capability is not supported or
+ * in error cases.
+ */
+static int get_extended_capability_offset(struct xhci_hcd *xhci,
+					int cap_id)
+{
+	u32		cap_reg;
+	unsigned long	flags;
+	int		offset;
+	void __iomem	*base = (void __iomem *) xhci->cap_regs;
+	struct usb_hcd	*hcd = xhci_to_hcd(xhci);
+	int		time_to_leave = XHCI_EXT_MAX_CAPID;
+
+	spin_lock_irqsave(&xhci->lock, flags);
+
+	offset = xhci_find_next_cap_offset(base, XHCI_HCC_PARAMS_OFFSET);
+	if (!HCD_HW_ACCESSIBLE(hcd) || !offset) {
+		spin_unlock_irqrestore(&xhci->lock, flags);
+		return 0;
+	}
+
+	while (time_to_leave--) {
+		cap_reg = readl(base + offset);
+
+		if (XHCI_EXT_CAPS_ID(cap_reg) == cap_id)
+			break;
+
+		offset = xhci_find_next_cap_offset(base, offset);
+		if (!offset)
+			break;
+	}
+
+	spin_unlock_irqrestore(&xhci->lock, flags);
+
+	return offset;
+}
+
+static ssize_t debug_port_state_show(struct device *dev,
+		struct device_attribute *attr, char *buf)
+{
+	int		count = 0, offset;
+	char		*state;
+	void __iomem	*dbc_base;
+	u32		dcctrl_reg;
+	struct xhci_hcd	*xhci = hcd_to_xhci(dev_get_drvdata(dev));
+
+	offset = get_extended_capability_offset(xhci, XHCI_EXT_CAPS_DEBUG);
+	if (!offset)
+		return 0;
+
+	dbc_base = (void __iomem *) xhci->cap_regs + offset;
+	dcctrl_reg = readl(dbc_base + XHCI_DBC_DCCTRL);
+
+	if (!(dcctrl_reg & XHCI_DBC_DCCTRL_DCE))
+		state = "disabled";
+	else if (dcctrl_reg & XHCI_DBC_DCCTRL_DCR)
+		state = "configured";
+	else
+		state = "enabled";
+
+	count = scnprintf(buf, PAGE_SIZE, "%s\n", state);
+
+	return count;
+}
+static DEVICE_ATTR_RO(debug_port_state);
+
+int xhci_sysfs_create_files(struct xhci_hcd *xhci)
+{
+	struct device *dev = xhci_to_hcd(xhci)->self.controller;
+
+	if (get_extended_capability_offset(xhci, XHCI_EXT_CAPS_DEBUG))
+		return device_create_file(dev, &dev_attr_debug_port_state);
+
+	return 0;
+}
+
+void xhci_sysfs_remove_files(struct xhci_hcd *xhci)
+{
+	struct device *dev = xhci_to_hcd(xhci)->self.controller;
+
+	if (get_extended_capability_offset(xhci, XHCI_EXT_CAPS_DEBUG))
+		device_remove_file(dev, &dev_attr_debug_port_state);
+}
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 6e7dc6f..583b59f 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -651,6 +651,9 @@ int xhci_run(struct usb_hcd *hcd)
 	}
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 			"Finished xhci_run for USB2 roothub");
+
+	xhci_sysfs_create_files(xhci);
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(xhci_run);
@@ -684,6 +687,7 @@ void xhci_stop(struct usb_hcd *hcd)
 	xhci_reset(xhci);
 	spin_unlock_irq(&xhci->lock);
 
+	xhci_sysfs_remove_files(xhci);
 	xhci_cleanup_msix(xhci);
 
 	/* Deleting Compliance Mode Recovery Timer */
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index be9048e..6bd2e6a 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1950,4 +1950,8 @@ struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_container_
 struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx);
 struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index);
 
+/* xHCI sysfs interfaces */
+int xhci_sysfs_create_files(struct xhci_hcd *xhci);
+void xhci_sysfs_remove_files(struct xhci_hcd *xhci);
+
 #endif /* __LINUX_XHCI_HCD_H */
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1266356 — Re: [PATCH v3 01/12] usb: xhci: add sysfs file for xHCI debug port

FromDave Young <dyoung@redhat.com>
Date2015-11-10 10:40 +0100
SubjectRe: [PATCH v3 01/12] usb: xhci: add sysfs file for xHCI debug port
Message-ID<qtdzc-3g9-15@gated-at.bofh.it>
In reply to#1265430
[snip]

> diff --git a/drivers/usb/host/xhci-sysfs.c b/drivers/usb/host/xhci-sysfs.c
> new file mode 100644
> index 0000000..0192ac4
> --- /dev/null
> +++ b/drivers/usb/host/xhci-sysfs.c
> @@ -0,0 +1,100 @@
> +/*
> + * sysfs interface for xHCI host controller driver
> + *
> + * Copyright (C) 2015 Intel Corp.
> + *
> + * Author: Lu Baolu <baolu.lu@linux.intel.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +#include <linux/kernel.h>
> +
> +#include "xhci.h"
> +
> +/*
> + * Return the register offset of a extended capability specified
> + * by @cap_id. Return 0 if @cap_id capability is not supported or
> + * in error cases.
> + */
> +static int get_extended_capability_offset(struct xhci_hcd *xhci,
> +					int cap_id)
> +{
> +	u32		cap_reg;
> +	unsigned long	flags;
> +	int		offset;
> +	void __iomem	*base = (void __iomem *) xhci->cap_regs;
> +	struct usb_hcd	*hcd = xhci_to_hcd(xhci);
> +	int		time_to_leave = XHCI_EXT_MAX_CAPID;
> +
> +	spin_lock_irqsave(&xhci->lock, flags);
> +
> +	offset = xhci_find_next_cap_offset(base, XHCI_HCC_PARAMS_OFFSET);
> +	if (!HCD_HW_ACCESSIBLE(hcd) || !offset) {
> +		spin_unlock_irqrestore(&xhci->lock, flags);
> +		return 0;
> +	}
> +
> +	while (time_to_leave--) {
> +		cap_reg = readl(base + offset);
> +
> +		if (XHCI_EXT_CAPS_ID(cap_reg) == cap_id)
> +			break;
> +
> +		offset = xhci_find_next_cap_offset(base, offset);
> +		if (!offset)
> +			break;
> +	}
> +
> +	spin_unlock_irqrestore(&xhci->lock, flags);

I'm not sure spin_lock is good and necessary here, also seems there's already
a function to find the cap offset:
xhci_find_ext_cap_by_id() in xhci-ext-caps.h

> +
> +	return offset;
> +}
> +

Thanks
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1266921 — Re: [PATCH v3 01/12] usb: xhci: add sysfs file for xHCI debug port

From"Lu, Baolu" <baolu.lu@linux.intel.com>
Date2015-11-11 03:10 +0100
SubjectRe: [PATCH v3 01/12] usb: xhci: add sysfs file for xHCI debug port
Message-ID<qtt1f-4Vo-1@gated-at.bofh.it>
In reply to#1266356

On 11/10/2015 05:36 PM, Dave Young wrote:
> [snip]
>
>> diff --git a/drivers/usb/host/xhci-sysfs.c b/drivers/usb/host/xhci-sysfs.c
>> new file mode 100644
>> index 0000000..0192ac4
>> --- /dev/null
>> +++ b/drivers/usb/host/xhci-sysfs.c
>> @@ -0,0 +1,100 @@
>> +/*
>> + * sysfs interface for xHCI host controller driver
>> + *
>> + * Copyright (C) 2015 Intel Corp.
>> + *
>> + * Author: Lu Baolu <baolu.lu@linux.intel.com>
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + */
>> +#include <linux/kernel.h>
>> +
>> +#include "xhci.h"
>> +
>> +/*
>> + * Return the register offset of a extended capability specified
>> + * by @cap_id. Return 0 if @cap_id capability is not supported or
>> + * in error cases.
>> + */
>> +static int get_extended_capability_offset(struct xhci_hcd *xhci,
>> +					int cap_id)
>> +{
>> +	u32		cap_reg;
>> +	unsigned long	flags;
>> +	int		offset;
>> +	void __iomem	*base = (void __iomem *) xhci->cap_regs;
>> +	struct usb_hcd	*hcd = xhci_to_hcd(xhci);
>> +	int		time_to_leave = XHCI_EXT_MAX_CAPID;
>> +
>> +	spin_lock_irqsave(&xhci->lock, flags);
>> +
>> +	offset = xhci_find_next_cap_offset(base, XHCI_HCC_PARAMS_OFFSET);
>> +	if (!HCD_HW_ACCESSIBLE(hcd) || !offset) {
>> +		spin_unlock_irqrestore(&xhci->lock, flags);
>> +		return 0;
>> +	}
>> +
>> +	while (time_to_leave--) {
>> +		cap_reg = readl(base + offset);
>> +
>> +		if (XHCI_EXT_CAPS_ID(cap_reg) == cap_id)
>> +			break;
>> +
>> +		offset = xhci_find_next_cap_offset(base, offset);
>> +		if (!offset)
>> +			break;
>> +	}
>> +
>> +	spin_unlock_irqrestore(&xhci->lock, flags);
> I'm not sure spin_lock is good and necessary here, also seems there's already

The lock is unnecessary here. I will remove it.

> a function to find the cap offset:
> xhci_find_ext_cap_by_id() in xhci-ext-caps.h

Yes, I will refactor the code.

Thanks,
Baolu
>
>> +
>> +	return offset;
>> +}
>> +
> Thanks
> Dave
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1266365 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

FromDave Young <dyoung@redhat.com>
Date2015-11-10 10:50 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qtdIS-3jG-27@gated-at.bofh.it>
In reply to#1265420
Hi,

On 11/09/15 at 03:38pm, Lu Baolu wrote:
> 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.
> 

I did a test with your previous patchset with the manually wired cable.
debug host detected the remote device, but later the devie automaticlly
disconnected and earlyprintk hangs.

I have not got more time, will try your new patchset when I have time.

Thanks
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1266914 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

From"Lu, Baolu" <baolu.lu@linux.intel.com>
Date2015-11-11 02:40 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qtsyd-4v7-3@gated-at.bofh.it>
In reply to#1266365

On 11/10/2015 05:39 PM, Dave Young wrote:
> Hi,
>
> On 11/09/15 at 03:38pm, Lu Baolu wrote:
>> 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.
>>
> I did a test with your previous patchset with the manually wired cable.
> debug host detected the remote device, but later the devie automaticlly
> disconnected and earlyprintk hangs.

Hi Dave,

What I have done is:

(1) Build a new kernel for debug target with this patch series applied.
(2) Add "earlyprintk=xdbc" to the kernel option of debug target. The
      "keep" option for early printk doesn't support yet. (That's my next
      target.)

(3) Boot the debug host, and disable USB runtime suspend:

# echo on > /sys/bus/pci/devices/<xhci_pci_bus_name>/power/control
# echo on | tee /sys/bus/usb/devices/*/power/control

(4) Boot the debug target. Check the dmesg message on debug host.

# tail -f /var/log/kern.log

Nov 12 01:27:50 allen-ult kernel: [ 1815.983374] usb 4-3: new SuperSpeed 
USB device number 4 using xhci_hcd
Nov 12 01:27:50 allen-ult kernel: [ 1815.999595] usb 4-3: LPM exit 
latency is zeroed, disabling LPM.
Nov 12 01:27:50 allen-ult kernel: [ 1815.999899] usb 4-3: New USB device 
found, idVendor=1d6b, idProduct=0004
Nov 12 01:27:50 allen-ult kernel: [ 1815.999902] usb 4-3: New USB device 
strings: Mfr=1, Product=2, SerialNumber=3
Nov 12 01:27:50 allen-ult kernel: [ 1815.999903] usb 4-3: Product: 
Remote GDB
Nov 12 01:27:50 allen-ult kernel: [ 1815.999904] usb 4-3: Manufacturer: 
Linux
Nov 12 01:27:50 allen-ult kernel: [ 1815.999905] usb 4-3: SerialNumber: 0001
Nov 12 01:27:50 allen-ult kernel: [ 1816.000240] usb_debug 4-3:1.0: 
xhci_dbc converter detected
Nov 12 01:27:50 allen-ult kernel: [ 1816.000360] usb 4-3: xhci_dbc 
converter now attached to ttyUSB0

(5) Host has completed enumeration of debug device. Start "minicom" on 
debug host.


Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Jan  1 2014, 17:13:19.
Port /dev/ttyUSB0, 01:28:02

Press CTRL-A Z for help on special keys

Press Y to continue...

(6) You should be able to see "Press Y to continue..." (if not, try 
pressing Enter key)
Press Y key, debug target should go ahead with boot and early boot 
messages should show in mincom.

Press Y to continue...
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.3.0-rc7+ (allen@blu-skl) (gcc version 
4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) 5
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.3.0-rc7+ 
root=UUID=5a2fb856-0238-4b6e-aa45-beeccb7
[    0.000000] KERNEL supported cpus:

[...skipped...]

[    0.000000]  Offload RCU callbacks from CPUs: 0-7.
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] bootconsole [earlyxdbc0] disabled


So "the devie automaticlly disconnected and earlyprintk hangs" happens 
in which step?

Thanks,
Baolu

>
> I have not got more time, will try your new patchset when I have time.
>
> Thanks
> Dave
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1266934 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

FromDave Young <dyoung@redhat.com>
Date2015-11-11 03:30 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qttkC-528-17@gated-at.bofh.it>
In reply to#1266914
Hi,

On 11/11/15 at 09:32am, Lu, Baolu wrote:
> 
> 
> On 11/10/2015 05:39 PM, Dave Young wrote:
> >Hi,
> >
> >On 11/09/15 at 03:38pm, Lu Baolu wrote:
> >>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.
> >>
> >I did a test with your previous patchset with the manually wired cable.
> >debug host detected the remote device, but later the devie automaticlly
> >disconnected and earlyprintk hangs.
> 
> Hi Dave,
> 
> What I have done is:

Retested it, seems it is not stable. I got a sucessful boot with earlyprintk
But only once and there was no "Press Y to continue", I just blindly pressed Y.

The other tests failed.

Since it is not convinience to test, do you have way to enable the dbc
after kernel boot? like echo 1 to a sysfs file to enable it.
> 
> (1) Build a new kernel for debug target with this patch series applied.
> (2) Add "earlyprintk=xdbc" to the kernel option of debug target. The
>      "keep" option for early printk doesn't support yet. (That's my next
>      target.)
> 
> (3) Boot the debug host, and disable USB runtime suspend:
> 
> # echo on > /sys/bus/pci/devices/<xhci_pci_bus_name>/power/control
> # echo on | tee /sys/bus/usb/devices/*/power/control
> 
> (4) Boot the debug target. Check the dmesg message on debug host.
> 
> # tail -f /var/log/kern.log
> 
> Nov 12 01:27:50 allen-ult kernel: [ 1815.983374] usb 4-3: new SuperSpeed USB
> device number 4 using xhci_hcd
> Nov 12 01:27:50 allen-ult kernel: [ 1815.999595] usb 4-3: LPM exit latency
> is zeroed, disabling LPM.
> Nov 12 01:27:50 allen-ult kernel: [ 1815.999899] usb 4-3: New USB device
> found, idVendor=1d6b, idProduct=0004
> Nov 12 01:27:50 allen-ult kernel: [ 1815.999902] usb 4-3: New USB device
> strings: Mfr=1, Product=2, SerialNumber=3
> Nov 12 01:27:50 allen-ult kernel: [ 1815.999903] usb 4-3: Product: Remote
> GDB
> Nov 12 01:27:50 allen-ult kernel: [ 1815.999904] usb 4-3: Manufacturer:
> Linux
> Nov 12 01:27:50 allen-ult kernel: [ 1815.999905] usb 4-3: SerialNumber: 0001
> Nov 12 01:27:50 allen-ult kernel: [ 1816.000240] usb_debug 4-3:1.0: xhci_dbc
> converter detected
> Nov 12 01:27:50 allen-ult kernel: [ 1816.000360] usb 4-3: xhci_dbc converter
> now attached to ttyUSB0
> 
> (5) Host has completed enumeration of debug device. Start "minicom" on debug
> host.
> 

Most times I have no chance to run minicom before the usb disconnection here.

> 
> Welcome to minicom 2.7
> 
> OPTIONS: I18n
> Compiled on Jan  1 2014, 17:13:19.
> Port /dev/ttyUSB0, 01:28:02
> 
> Press CTRL-A Z for help on special keys
> 
> Press Y to continue...
> 
> (6) You should be able to see "Press Y to continue..." (if not, try pressing
> Enter key)
> Press Y key, debug target should go ahead with boot and early boot messages
> should show in mincom.
> 
> Press Y to continue...
> [    0.000000] Initializing cgroup subsys cpuset
> [    0.000000] Initializing cgroup subsys cpu
> [    0.000000] Initializing cgroup subsys cpuacct
> [    0.000000] Linux version 4.3.0-rc7+ (allen@blu-skl) (gcc version 4.8.4
> (Ubuntu 4.8.4-2ubuntu1~14.04) 5
> [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.3.0-rc7+
> root=UUID=5a2fb856-0238-4b6e-aa45-beeccb7
> [    0.000000] KERNEL supported cpus:
> 
> [...skipped...]
> 
> [    0.000000]  Offload RCU callbacks from CPUs: 0-7.
> [    0.000000] Console: colour dummy device 80x25
> [    0.000000] console [tty0] enabled
> [    0.000000] bootconsole [earlyxdbc0] disabled
> 
> 
> So "the devie automaticlly disconnected and earlyprintk hangs" happens in
> which step?
> 

Here is some log on host side.

[ 1568.052135] usb 2-2: new SuperSpeed USB device number 5 using xhci_hcd
[ 1568.063416] usb 2-2: LPM exit latency is zeroed, disabling LPM.
[ 1568.063750] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
[ 1568.063751] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1568.063752] usb 2-2: Product: Remote GDB
[ 1568.063753] usb 2-2: Manufacturer: Linux
[ 1568.063754] usb 2-2: SerialNumber: 0001
[ 1568.065580] usb_debug 2-2:1.0: xhci_dbc converter detected
[ 1568.066309] usb 2-2: xhci_dbc converter now attached to ttyUSB0
[ 1580.464706] usb 2-2: USB disconnect, device number 5
[ 1580.464996] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
[ 1580.465062] usb_debug 2-2:1.0: device disconnected
[ 1580.670743] usb 2-2: new SuperSpeed USB device number 6 using xhci_hcd
[ 1580.682068] usb 2-2: LPM exit latency is zeroed, disabling LPM.
[ 1580.682667] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
[ 1580.682672] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1580.682675] usb 2-2: Product: Remote GDB
[ 1580.682678] usb 2-2: Manufacturer: Linux
[ 1580.682681] usb 2-2: SerialNumber: 0001
[ 1580.685190] usb_debug 2-2:1.0: xhci_dbc converter detected
[ 1580.687106] usb 2-2: xhci_dbc converter now attached to ttyUSB0
[ 1586.751477] usb 2-2: USB disconnect, device number 6
[ 1586.754248] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
[ 1586.754287] usb_debug 2-2:1.0: device disconnected
[ 1586.960399] usb 2-2: new SuperSpeed USB device number 7 using xhci_hcd
[ 1586.971562] usb 2-2: LPM exit latency is zeroed, disabling LPM.
[ 1586.971916] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
[ 1586.971918] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1586.971919] usb 2-2: Product: Remote GDB
[ 1586.971921] usb 2-2: Manufacturer: Linux
[ 1586.971922] usb 2-2: SerialNumber: 0001
[ 1586.973140] usb_debug 2-2:1.0: xhci_dbc converter detected
[ 1586.973939] usb 2-2: xhci_dbc converter now attached to ttyUSB0
[ 1616.615418] usb 2-2: USB disconnect, device number 7
[ 1616.617865] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
[ 1616.617918] usb_debug 2-2:1.0: device disconnected
[ 1616.823351] usb 2-2: new SuperSpeed USB device number 8 using xhci_hcd
[ 1616.834520] usb 2-2: LPM exit latency is zeroed, disabling LPM.
[ 1616.834856] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
[ 1616.834858] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1616.834859] usb 2-2: Product: Remote GDB
[ 1616.834860] usb 2-2: Manufacturer: Linux
[ 1616.834860] usb 2-2: SerialNumber: 0001
[ 1616.836715] usb_debug 2-2:1.0: xhci_dbc converter detected
[ 1616.837327] usb 2-2: xhci_dbc converter now attached to ttyUSB0
[ 1622.719311] usb 2-2: USB disconnect, device number 8
[ 1622.721962] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
[ 1622.721995] usb_debug 2-2:1.0: device disconnected
[ 1622.928226] usb 2-2: new SuperSpeed USB device number 9 using xhci_hcd
[ 1622.939383] usb 2-2: LPM exit latency is zeroed, disabling LPM.
[ 1622.939714] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
[ 1622.939715] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1622.939716] usb 2-2: Product: Remote GDB
[ 1622.939717] usb 2-2: Manufacturer: Linux
[ 1622.939718] usb 2-2: SerialNumber: 0001
[ 1622.941593] usb_debug 2-2:1.0: xhci_dbc converter detected
[ 1622.942187] usb 2-2: xhci_dbc converter now attached to ttyUSB0
[ 1631.312112] usb 2-2: USB disconnect, device number 9
[ 1631.315427] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
[ 1631.315465] usb_debug 2-2:1.0: device disconnected
[ 1631.521007] usb 2-2: new SuperSpeed USB device number 10 using xhci_hcd
[ 1631.532212] usb 2-2: LPM exit latency is zeroed, disabling LPM.
[ 1631.532544] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
[ 1631.532545] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1631.532546] usb 2-2: Product: Remote GDB
[ 1631.532547] usb 2-2: Manufacturer: Linux
[ 1631.532548] usb 2-2: SerialNumber: 0001
[ 1631.534413] usb_debug 2-2:1.0: xhci_dbc converter detected
[ 1631.535117] usb 2-2: xhci_dbc converter now attached to ttyUSB0
[ 1633.252488] usb 2-2: USB disconnect, device number 10
[ 1633.255279] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
[ 1633.255314] usb_debug 2-2:1.0: device disconnected
[ 1633.461411] usb 2-2: new SuperSpeed USB device number 11 using xhci_hcd
[ 1633.472598] usb 2-2: LPM exit latency is zeroed, disabling LPM.
[ 1633.472932] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
[ 1633.472933] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1633.472934] usb 2-2: Product: Remote GDB
[ 1633.472935] usb 2-2: Manufacturer: Linux
[ 1633.472936] usb 2-2: SerialNumber: 0001
[ 1633.473987] usb_debug 2-2:1.0: xhci_dbc converter detected
[ 1633.474624] usb 2-2: xhci_dbc converter now attached to ttyUSB0
[ 1633.900927] usb 2-2: USB disconnect, device number 11
[ 1633.901176] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
[ 1633.901226] usb_debug 2-2:1.0: device disconnected
[ 1634.106831] usb 2-2: new SuperSpeed USB device number 12 using xhci_hcd
[ 1634.117987] usb 2-2: LPM exit latency is zeroed, disabling LPM.
[ 1634.118328] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
[ 1634.118329] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1634.118330] usb 2-2: Product: Remote GDB
[ 1634.118331] usb 2-2: Manufacturer: Linux
[ 1634.118332] usb 2-2: SerialNumber: 0001
[ 1634.120194] usb_debug 2-2:1.0: xhci_dbc converter detected
[ 1634.120949] usb 2-2: xhci_dbc converter now attached to ttyUSB0

Thanks
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1266940 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

From"Lu, Baolu" <baolu.lu@linux.intel.com>
Date2015-11-11 03:50 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qttDX-59m-11@gated-at.bofh.it>
In reply to#1266934

On 11/11/2015 10:25 AM, Dave Young wrote:
> Hi,
>
> On 11/11/15 at 09:32am, Lu, Baolu wrote:
>>
>> On 11/10/2015 05:39 PM, Dave Young wrote:
>>> Hi,
>>>
>>> On 11/09/15 at 03:38pm, Lu Baolu wrote:
>>>> 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.
>>>>
>>> I did a test with your previous patchset with the manually wired cable.
>>> debug host detected the remote device, but later the devie automaticlly
>>> disconnected and earlyprintk hangs.
>> Hi Dave,
>>
>> What I have done is:
> Retested it, seems it is not stable. I got a sucessful boot with earlyprintk
> But only once and there was no "Press Y to continue", I just blindly pressed Y.
>
> The other tests failed.

Problem seems to exist at the place where host and target sync with
each other.

>
> Since it is not convinience to test, do you have way to enable the dbc
> after kernel boot? like echo 1 to a sysfs file to enable it.

This is the first phase of code. I could do this in the next phase.
The problems exist in the interferer between DbC and the host
controller. They share the same power well so host reset, or
suspend/resume will cause DbC not work.

>> (1) Build a new kernel for debug target with this patch series applied.
>> (2) Add "earlyprintk=xdbc" to the kernel option of debug target. The
>>       "keep" option for early printk doesn't support yet. (That's my next
>>       target.)
>>
>> (3) Boot the debug host, and disable USB runtime suspend:
>>
>> # echo on > /sys/bus/pci/devices/<xhci_pci_bus_name>/power/control
>> # echo on | tee /sys/bus/usb/devices/*/power/control
>>
>> (4) Boot the debug target. Check the dmesg message on debug host.
>>
>> # tail -f /var/log/kern.log
>>
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.983374] usb 4-3: new SuperSpeed USB
>> device number 4 using xhci_hcd
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999595] usb 4-3: LPM exit latency
>> is zeroed, disabling LPM.
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999899] usb 4-3: New USB device
>> found, idVendor=1d6b, idProduct=0004
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999902] usb 4-3: New USB device
>> strings: Mfr=1, Product=2, SerialNumber=3
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999903] usb 4-3: Product: Remote
>> GDB
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999904] usb 4-3: Manufacturer:
>> Linux
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999905] usb 4-3: SerialNumber: 0001
>> Nov 12 01:27:50 allen-ult kernel: [ 1816.000240] usb_debug 4-3:1.0: xhci_dbc
>> converter detected
>> Nov 12 01:27:50 allen-ult kernel: [ 1816.000360] usb 4-3: xhci_dbc converter
>> now attached to ttyUSB0
>>
>> (5) Host has completed enumeration of debug device. Start "minicom" on debug
>> host.
>>
> Most times I have no chance to run minicom before the usb disconnection here.

I will send you a new version for test later. By the way, which hardware
are you using for test?

>
>> Welcome to minicom 2.7
>>
>> OPTIONS: I18n
>> Compiled on Jan  1 2014, 17:13:19.
>> Port /dev/ttyUSB0, 01:28:02
>>
>> Press CTRL-A Z for help on special keys
>>
>> Press Y to continue...
>>
>> (6) You should be able to see "Press Y to continue..." (if not, try pressing
>> Enter key)
>> Press Y key, debug target should go ahead with boot and early boot messages
>> should show in mincom.
>>
>> Press Y to continue...
>> [    0.000000] Initializing cgroup subsys cpuset
>> [    0.000000] Initializing cgroup subsys cpu
>> [    0.000000] Initializing cgroup subsys cpuacct
>> [    0.000000] Linux version 4.3.0-rc7+ (allen@blu-skl) (gcc version 4.8.4
>> (Ubuntu 4.8.4-2ubuntu1~14.04) 5
>> [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.3.0-rc7+
>> root=UUID=5a2fb856-0238-4b6e-aa45-beeccb7
>> [    0.000000] KERNEL supported cpus:
>>
>> [...skipped...]
>>
>> [    0.000000]  Offload RCU callbacks from CPUs: 0-7.
>> [    0.000000] Console: colour dummy device 80x25
>> [    0.000000] console [tty0] enabled
>> [    0.000000] bootconsole [earlyxdbc0] disabled
>>
>>
>> So "the devie automaticlly disconnected and earlyprintk hangs" happens in
>> which step?
>>
> Here is some log on host side.
>
> [ 1568.052135] usb 2-2: new SuperSpeed USB device number 5 using xhci_hcd
> [ 1568.063416] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1568.063750] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1568.063751] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1568.063752] usb 2-2: Product: Remote GDB
> [ 1568.063753] usb 2-2: Manufacturer: Linux
> [ 1568.063754] usb 2-2: SerialNumber: 0001
> [ 1568.065580] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1568.066309] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1580.464706] usb 2-2: USB disconnect, device number 5
> [ 1580.464996] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1580.465062] usb_debug 2-2:1.0: device disconnected
> [ 1580.670743] usb 2-2: new SuperSpeed USB device number 6 using xhci_hcd
> [ 1580.682068] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1580.682667] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1580.682672] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1580.682675] usb 2-2: Product: Remote GDB
> [ 1580.682678] usb 2-2: Manufacturer: Linux
> [ 1580.682681] usb 2-2: SerialNumber: 0001
> [ 1580.685190] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1580.687106] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1586.751477] usb 2-2: USB disconnect, device number 6
> [ 1586.754248] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1586.754287] usb_debug 2-2:1.0: device disconnected
> [ 1586.960399] usb 2-2: new SuperSpeed USB device number 7 using xhci_hcd
> [ 1586.971562] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1586.971916] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1586.971918] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1586.971919] usb 2-2: Product: Remote GDB
> [ 1586.971921] usb 2-2: Manufacturer: Linux
> [ 1586.971922] usb 2-2: SerialNumber: 0001
> [ 1586.973140] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1586.973939] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1616.615418] usb 2-2: USB disconnect, device number 7
> [ 1616.617865] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1616.617918] usb_debug 2-2:1.0: device disconnected
> [ 1616.823351] usb 2-2: new SuperSpeed USB device number 8 using xhci_hcd
> [ 1616.834520] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1616.834856] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1616.834858] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1616.834859] usb 2-2: Product: Remote GDB
> [ 1616.834860] usb 2-2: Manufacturer: Linux
> [ 1616.834860] usb 2-2: SerialNumber: 0001
> [ 1616.836715] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1616.837327] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1622.719311] usb 2-2: USB disconnect, device number 8
> [ 1622.721962] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1622.721995] usb_debug 2-2:1.0: device disconnected
> [ 1622.928226] usb 2-2: new SuperSpeed USB device number 9 using xhci_hcd
> [ 1622.939383] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1622.939714] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1622.939715] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1622.939716] usb 2-2: Product: Remote GDB
> [ 1622.939717] usb 2-2: Manufacturer: Linux
> [ 1622.939718] usb 2-2: SerialNumber: 0001
> [ 1622.941593] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1622.942187] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1631.312112] usb 2-2: USB disconnect, device number 9
> [ 1631.315427] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1631.315465] usb_debug 2-2:1.0: device disconnected
> [ 1631.521007] usb 2-2: new SuperSpeed USB device number 10 using xhci_hcd
> [ 1631.532212] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1631.532544] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1631.532545] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1631.532546] usb 2-2: Product: Remote GDB
> [ 1631.532547] usb 2-2: Manufacturer: Linux
> [ 1631.532548] usb 2-2: SerialNumber: 0001
> [ 1631.534413] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1631.535117] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1633.252488] usb 2-2: USB disconnect, device number 10
> [ 1633.255279] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1633.255314] usb_debug 2-2:1.0: device disconnected
> [ 1633.461411] usb 2-2: new SuperSpeed USB device number 11 using xhci_hcd
> [ 1633.472598] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1633.472932] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1633.472933] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1633.472934] usb 2-2: Product: Remote GDB
> [ 1633.472935] usb 2-2: Manufacturer: Linux
> [ 1633.472936] usb 2-2: SerialNumber: 0001
> [ 1633.473987] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1633.474624] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1633.900927] usb 2-2: USB disconnect, device number 11
> [ 1633.901176] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1633.901226] usb_debug 2-2:1.0: device disconnected
> [ 1634.106831] usb 2-2: new SuperSpeed USB device number 12 using xhci_hcd
> [ 1634.117987] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1634.118328] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1634.118329] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1634.118330] usb 2-2: Product: Remote GDB
> [ 1634.118331] usb 2-2: Manufacturer: Linux
> [ 1634.118332] usb 2-2: SerialNumber: 0001
> [ 1634.120194] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1634.120949] usb 2-2: xhci_dbc converter now attached to ttyUSB0
>
> Thanks
> Dave

Thanks,
Baolu


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1266974 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

From"Lu, Baolu" <baolu.lu@linux.intel.com>
Date2015-11-11 07:00 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qtwBQ-77u-3@gated-at.bofh.it>
In reply to#1266934

On 11/11/2015 10:25 AM, Dave Young wrote:
> [ 1616.823351] usb 2-2: new SuperSpeed USB device number 8 using xhci_hcd
> [ 1616.834520] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1616.834856] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1616.834858] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1616.834859] usb 2-2: Product: Remote GDB
> [ 1616.834860] usb 2-2: Manufacturer: Linux
> [ 1616.834860] usb 2-2: SerialNumber: 0001
> [ 1616.836715] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1616.837327] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1622.719311] usb 2-2: USB disconnect, device number 8
  Hi Dave,

I revisited the kernel log. It seems the debug host enumerated
the debug target successfully. Can you please check the
minicom configuration?

The configure on my debug host looks like below.

Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Jan  1 2014, 17:13:19.
Port /dev/ttyUSB0, 01:28:02

Rate: 115200

Please make sure you have disabled runtime power management
for USB devices and host controller in debug host. And sometimes,
reboot the debug host helps when enumeration fails.

Thanks,
Baolu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267596 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

From"Lu, Baolu" <baolu.lu@linux.intel.com>
Date2015-11-12 03:50 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qtQ7v-2Vw-3@gated-at.bofh.it>
In reply to#1266934
Hi Dave,

Which device are you testing with? This implementation was developed
and tested on Intel Skylake devices.

It doesn't surprise me if it doesn't work with other silicons. But it do
remind me to create a verified-list and put those known-to-work devices
in it.

Thanks,
Baolu

On 11/11/2015 10:25 AM, Dave Young wrote:
> Hi,
>
> On 11/11/15 at 09:32am, Lu, Baolu wrote:
>>
>> On 11/10/2015 05:39 PM, Dave Young wrote:
>>> Hi,
>>>
>>> On 11/09/15 at 03:38pm, Lu Baolu wrote:
>>>> 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.
>>>>
>>> I did a test with your previous patchset with the manually wired cable.
>>> debug host detected the remote device, but later the devie automaticlly
>>> disconnected and earlyprintk hangs.
>> Hi Dave,
>>
>> What I have done is:
> Retested it, seems it is not stable. I got a sucessful boot with earlyprintk
> But only once and there was no "Press Y to continue", I just blindly pressed Y.
>
> The other tests failed.
>
> Since it is not convinience to test, do you have way to enable the dbc
> after kernel boot? like echo 1 to a sysfs file to enable it.
>> (1) Build a new kernel for debug target with this patch series applied.
>> (2) Add "earlyprintk=xdbc" to the kernel option of debug target. The
>>       "keep" option for early printk doesn't support yet. (That's my next
>>       target.)
>>
>> (3) Boot the debug host, and disable USB runtime suspend:
>>
>> # echo on > /sys/bus/pci/devices/<xhci_pci_bus_name>/power/control
>> # echo on | tee /sys/bus/usb/devices/*/power/control
>>
>> (4) Boot the debug target. Check the dmesg message on debug host.
>>
>> # tail -f /var/log/kern.log
>>
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.983374] usb 4-3: new SuperSpeed USB
>> device number 4 using xhci_hcd
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999595] usb 4-3: LPM exit latency
>> is zeroed, disabling LPM.
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999899] usb 4-3: New USB device
>> found, idVendor=1d6b, idProduct=0004
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999902] usb 4-3: New USB device
>> strings: Mfr=1, Product=2, SerialNumber=3
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999903] usb 4-3: Product: Remote
>> GDB
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999904] usb 4-3: Manufacturer:
>> Linux
>> Nov 12 01:27:50 allen-ult kernel: [ 1815.999905] usb 4-3: SerialNumber: 0001
>> Nov 12 01:27:50 allen-ult kernel: [ 1816.000240] usb_debug 4-3:1.0: xhci_dbc
>> converter detected
>> Nov 12 01:27:50 allen-ult kernel: [ 1816.000360] usb 4-3: xhci_dbc converter
>> now attached to ttyUSB0
>>
>> (5) Host has completed enumeration of debug device. Start "minicom" on debug
>> host.
>>
> Most times I have no chance to run minicom before the usb disconnection here.
>
>> Welcome to minicom 2.7
>>
>> OPTIONS: I18n
>> Compiled on Jan  1 2014, 17:13:19.
>> Port /dev/ttyUSB0, 01:28:02
>>
>> Press CTRL-A Z for help on special keys
>>
>> Press Y to continue...
>>
>> (6) You should be able to see "Press Y to continue..." (if not, try pressing
>> Enter key)
>> Press Y key, debug target should go ahead with boot and early boot messages
>> should show in mincom.
>>
>> Press Y to continue...
>> [    0.000000] Initializing cgroup subsys cpuset
>> [    0.000000] Initializing cgroup subsys cpu
>> [    0.000000] Initializing cgroup subsys cpuacct
>> [    0.000000] Linux version 4.3.0-rc7+ (allen@blu-skl) (gcc version 4.8.4
>> (Ubuntu 4.8.4-2ubuntu1~14.04) 5
>> [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.3.0-rc7+
>> root=UUID=5a2fb856-0238-4b6e-aa45-beeccb7
>> [    0.000000] KERNEL supported cpus:
>>
>> [...skipped...]
>>
>> [    0.000000]  Offload RCU callbacks from CPUs: 0-7.
>> [    0.000000] Console: colour dummy device 80x25
>> [    0.000000] console [tty0] enabled
>> [    0.000000] bootconsole [earlyxdbc0] disabled
>>
>>
>> So "the devie automaticlly disconnected and earlyprintk hangs" happens in
>> which step?
>>
> Here is some log on host side.
>
> [ 1568.052135] usb 2-2: new SuperSpeed USB device number 5 using xhci_hcd
> [ 1568.063416] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1568.063750] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1568.063751] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1568.063752] usb 2-2: Product: Remote GDB
> [ 1568.063753] usb 2-2: Manufacturer: Linux
> [ 1568.063754] usb 2-2: SerialNumber: 0001
> [ 1568.065580] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1568.066309] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1580.464706] usb 2-2: USB disconnect, device number 5
> [ 1580.464996] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1580.465062] usb_debug 2-2:1.0: device disconnected
> [ 1580.670743] usb 2-2: new SuperSpeed USB device number 6 using xhci_hcd
> [ 1580.682068] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1580.682667] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1580.682672] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1580.682675] usb 2-2: Product: Remote GDB
> [ 1580.682678] usb 2-2: Manufacturer: Linux
> [ 1580.682681] usb 2-2: SerialNumber: 0001
> [ 1580.685190] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1580.687106] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1586.751477] usb 2-2: USB disconnect, device number 6
> [ 1586.754248] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1586.754287] usb_debug 2-2:1.0: device disconnected
> [ 1586.960399] usb 2-2: new SuperSpeed USB device number 7 using xhci_hcd
> [ 1586.971562] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1586.971916] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1586.971918] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1586.971919] usb 2-2: Product: Remote GDB
> [ 1586.971921] usb 2-2: Manufacturer: Linux
> [ 1586.971922] usb 2-2: SerialNumber: 0001
> [ 1586.973140] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1586.973939] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1616.615418] usb 2-2: USB disconnect, device number 7
> [ 1616.617865] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1616.617918] usb_debug 2-2:1.0: device disconnected
> [ 1616.823351] usb 2-2: new SuperSpeed USB device number 8 using xhci_hcd
> [ 1616.834520] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1616.834856] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1616.834858] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1616.834859] usb 2-2: Product: Remote GDB
> [ 1616.834860] usb 2-2: Manufacturer: Linux
> [ 1616.834860] usb 2-2: SerialNumber: 0001
> [ 1616.836715] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1616.837327] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1622.719311] usb 2-2: USB disconnect, device number 8
> [ 1622.721962] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1622.721995] usb_debug 2-2:1.0: device disconnected
> [ 1622.928226] usb 2-2: new SuperSpeed USB device number 9 using xhci_hcd
> [ 1622.939383] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1622.939714] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1622.939715] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1622.939716] usb 2-2: Product: Remote GDB
> [ 1622.939717] usb 2-2: Manufacturer: Linux
> [ 1622.939718] usb 2-2: SerialNumber: 0001
> [ 1622.941593] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1622.942187] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1631.312112] usb 2-2: USB disconnect, device number 9
> [ 1631.315427] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1631.315465] usb_debug 2-2:1.0: device disconnected
> [ 1631.521007] usb 2-2: new SuperSpeed USB device number 10 using xhci_hcd
> [ 1631.532212] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1631.532544] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1631.532545] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1631.532546] usb 2-2: Product: Remote GDB
> [ 1631.532547] usb 2-2: Manufacturer: Linux
> [ 1631.532548] usb 2-2: SerialNumber: 0001
> [ 1631.534413] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1631.535117] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1633.252488] usb 2-2: USB disconnect, device number 10
> [ 1633.255279] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1633.255314] usb_debug 2-2:1.0: device disconnected
> [ 1633.461411] usb 2-2: new SuperSpeed USB device number 11 using xhci_hcd
> [ 1633.472598] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1633.472932] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1633.472933] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1633.472934] usb 2-2: Product: Remote GDB
> [ 1633.472935] usb 2-2: Manufacturer: Linux
> [ 1633.472936] usb 2-2: SerialNumber: 0001
> [ 1633.473987] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1633.474624] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> [ 1633.900927] usb 2-2: USB disconnect, device number 11
> [ 1633.901176] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> [ 1633.901226] usb_debug 2-2:1.0: device disconnected
> [ 1634.106831] usb 2-2: new SuperSpeed USB device number 12 using xhci_hcd
> [ 1634.117987] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> [ 1634.118328] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> [ 1634.118329] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1634.118330] usb 2-2: Product: Remote GDB
> [ 1634.118331] usb 2-2: Manufacturer: Linux
> [ 1634.118332] usb 2-2: SerialNumber: 0001
> [ 1634.120194] usb_debug 2-2:1.0: xhci_dbc converter detected
> [ 1634.120949] usb 2-2: xhci_dbc converter now attached to ttyUSB0
>
> Thanks
> Dave
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267649 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

FromDave Young <dyoung@redhat.com>
Date2015-11-12 07:10 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qtTf3-5bY-5@gated-at.bofh.it>
In reply to#1267596
Hi, Baolu

On 11/12/15 at 10:45am, Lu, Baolu wrote:
> Hi Dave,
> 
> Which device are you testing with? This implementation was developed
> and tested on Intel Skylake devices.
> 
> It doesn't surprise me if it doesn't work with other silicons. But it do
> remind me to create a verified-list and put those known-to-work devices
> in it.
> 

I have not got time to do more test. What infomation do you want? 
lsusb -v?


> Thanks,
> Baolu
> 
> On 11/11/2015 10:25 AM, Dave Young wrote:
> >Hi,
> >
> >On 11/11/15 at 09:32am, Lu, Baolu wrote:
> >>
> >>On 11/10/2015 05:39 PM, Dave Young wrote:
> >>>Hi,
> >>>
> >>>On 11/09/15 at 03:38pm, Lu Baolu wrote:
> >>>>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.
> >>>>
> >>>I did a test with your previous patchset with the manually wired cable.
> >>>debug host detected the remote device, but later the devie automaticlly
> >>>disconnected and earlyprintk hangs.
> >>Hi Dave,
> >>
> >>What I have done is:
> >Retested it, seems it is not stable. I got a sucessful boot with earlyprintk
> >But only once and there was no "Press Y to continue", I just blindly pressed Y.
> >
> >The other tests failed.
> >
> >Since it is not convinience to test, do you have way to enable the dbc
> >after kernel boot? like echo 1 to a sysfs file to enable it.
> >>(1) Build a new kernel for debug target with this patch series applied.
> >>(2) Add "earlyprintk=xdbc" to the kernel option of debug target. The
> >>      "keep" option for early printk doesn't support yet. (That's my next
> >>      target.)
> >>
> >>(3) Boot the debug host, and disable USB runtime suspend:
> >>
> >># echo on > /sys/bus/pci/devices/<xhci_pci_bus_name>/power/control
> >># echo on | tee /sys/bus/usb/devices/*/power/control
> >>
> >>(4) Boot the debug target. Check the dmesg message on debug host.
> >>
> >># tail -f /var/log/kern.log
> >>
> >>Nov 12 01:27:50 allen-ult kernel: [ 1815.983374] usb 4-3: new SuperSpeed USB
> >>device number 4 using xhci_hcd
> >>Nov 12 01:27:50 allen-ult kernel: [ 1815.999595] usb 4-3: LPM exit latency
> >>is zeroed, disabling LPM.
> >>Nov 12 01:27:50 allen-ult kernel: [ 1815.999899] usb 4-3: New USB device
> >>found, idVendor=1d6b, idProduct=0004
> >>Nov 12 01:27:50 allen-ult kernel: [ 1815.999902] usb 4-3: New USB device
> >>strings: Mfr=1, Product=2, SerialNumber=3
> >>Nov 12 01:27:50 allen-ult kernel: [ 1815.999903] usb 4-3: Product: Remote
> >>GDB
> >>Nov 12 01:27:50 allen-ult kernel: [ 1815.999904] usb 4-3: Manufacturer:
> >>Linux
> >>Nov 12 01:27:50 allen-ult kernel: [ 1815.999905] usb 4-3: SerialNumber: 0001
> >>Nov 12 01:27:50 allen-ult kernel: [ 1816.000240] usb_debug 4-3:1.0: xhci_dbc
> >>converter detected
> >>Nov 12 01:27:50 allen-ult kernel: [ 1816.000360] usb 4-3: xhci_dbc converter
> >>now attached to ttyUSB0
> >>
> >>(5) Host has completed enumeration of debug device. Start "minicom" on debug
> >>host.
> >>
> >Most times I have no chance to run minicom before the usb disconnection here.
> >
> >>Welcome to minicom 2.7
> >>
> >>OPTIONS: I18n
> >>Compiled on Jan  1 2014, 17:13:19.
> >>Port /dev/ttyUSB0, 01:28:02
> >>
> >>Press CTRL-A Z for help on special keys
> >>
> >>Press Y to continue...
> >>
> >>(6) You should be able to see "Press Y to continue..." (if not, try pressing
> >>Enter key)
> >>Press Y key, debug target should go ahead with boot and early boot messages
> >>should show in mincom.
> >>
> >>Press Y to continue...
> >>[    0.000000] Initializing cgroup subsys cpuset
> >>[    0.000000] Initializing cgroup subsys cpu
> >>[    0.000000] Initializing cgroup subsys cpuacct
> >>[    0.000000] Linux version 4.3.0-rc7+ (allen@blu-skl) (gcc version 4.8.4
> >>(Ubuntu 4.8.4-2ubuntu1~14.04) 5
> >>[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.3.0-rc7+
> >>root=UUID=5a2fb856-0238-4b6e-aa45-beeccb7
> >>[    0.000000] KERNEL supported cpus:
> >>
> >>[...skipped...]
> >>
> >>[    0.000000]  Offload RCU callbacks from CPUs: 0-7.
> >>[    0.000000] Console: colour dummy device 80x25
> >>[    0.000000] console [tty0] enabled
> >>[    0.000000] bootconsole [earlyxdbc0] disabled
> >>
> >>
> >>So "the devie automaticlly disconnected and earlyprintk hangs" happens in
> >>which step?
> >>
> >Here is some log on host side.
> >
> >[ 1568.052135] usb 2-2: new SuperSpeed USB device number 5 using xhci_hcd
> >[ 1568.063416] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> >[ 1568.063750] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> >[ 1568.063751] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> >[ 1568.063752] usb 2-2: Product: Remote GDB
> >[ 1568.063753] usb 2-2: Manufacturer: Linux
> >[ 1568.063754] usb 2-2: SerialNumber: 0001
> >[ 1568.065580] usb_debug 2-2:1.0: xhci_dbc converter detected
> >[ 1568.066309] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> >[ 1580.464706] usb 2-2: USB disconnect, device number 5
> >[ 1580.464996] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> >[ 1580.465062] usb_debug 2-2:1.0: device disconnected
> >[ 1580.670743] usb 2-2: new SuperSpeed USB device number 6 using xhci_hcd
> >[ 1580.682068] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> >[ 1580.682667] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> >[ 1580.682672] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> >[ 1580.682675] usb 2-2: Product: Remote GDB
> >[ 1580.682678] usb 2-2: Manufacturer: Linux
> >[ 1580.682681] usb 2-2: SerialNumber: 0001
> >[ 1580.685190] usb_debug 2-2:1.0: xhci_dbc converter detected
> >[ 1580.687106] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> >[ 1586.751477] usb 2-2: USB disconnect, device number 6
> >[ 1586.754248] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> >[ 1586.754287] usb_debug 2-2:1.0: device disconnected
> >[ 1586.960399] usb 2-2: new SuperSpeed USB device number 7 using xhci_hcd
> >[ 1586.971562] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> >[ 1586.971916] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> >[ 1586.971918] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> >[ 1586.971919] usb 2-2: Product: Remote GDB
> >[ 1586.971921] usb 2-2: Manufacturer: Linux
> >[ 1586.971922] usb 2-2: SerialNumber: 0001
> >[ 1586.973140] usb_debug 2-2:1.0: xhci_dbc converter detected
> >[ 1586.973939] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> >[ 1616.615418] usb 2-2: USB disconnect, device number 7
> >[ 1616.617865] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> >[ 1616.617918] usb_debug 2-2:1.0: device disconnected
> >[ 1616.823351] usb 2-2: new SuperSpeed USB device number 8 using xhci_hcd
> >[ 1616.834520] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> >[ 1616.834856] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> >[ 1616.834858] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> >[ 1616.834859] usb 2-2: Product: Remote GDB
> >[ 1616.834860] usb 2-2: Manufacturer: Linux
> >[ 1616.834860] usb 2-2: SerialNumber: 0001
> >[ 1616.836715] usb_debug 2-2:1.0: xhci_dbc converter detected
> >[ 1616.837327] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> >[ 1622.719311] usb 2-2: USB disconnect, device number 8
> >[ 1622.721962] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> >[ 1622.721995] usb_debug 2-2:1.0: device disconnected
> >[ 1622.928226] usb 2-2: new SuperSpeed USB device number 9 using xhci_hcd
> >[ 1622.939383] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> >[ 1622.939714] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> >[ 1622.939715] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> >[ 1622.939716] usb 2-2: Product: Remote GDB
> >[ 1622.939717] usb 2-2: Manufacturer: Linux
> >[ 1622.939718] usb 2-2: SerialNumber: 0001
> >[ 1622.941593] usb_debug 2-2:1.0: xhci_dbc converter detected
> >[ 1622.942187] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> >[ 1631.312112] usb 2-2: USB disconnect, device number 9
> >[ 1631.315427] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> >[ 1631.315465] usb_debug 2-2:1.0: device disconnected
> >[ 1631.521007] usb 2-2: new SuperSpeed USB device number 10 using xhci_hcd
> >[ 1631.532212] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> >[ 1631.532544] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> >[ 1631.532545] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> >[ 1631.532546] usb 2-2: Product: Remote GDB
> >[ 1631.532547] usb 2-2: Manufacturer: Linux
> >[ 1631.532548] usb 2-2: SerialNumber: 0001
> >[ 1631.534413] usb_debug 2-2:1.0: xhci_dbc converter detected
> >[ 1631.535117] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> >[ 1633.252488] usb 2-2: USB disconnect, device number 10
> >[ 1633.255279] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> >[ 1633.255314] usb_debug 2-2:1.0: device disconnected
> >[ 1633.461411] usb 2-2: new SuperSpeed USB device number 11 using xhci_hcd
> >[ 1633.472598] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> >[ 1633.472932] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> >[ 1633.472933] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> >[ 1633.472934] usb 2-2: Product: Remote GDB
> >[ 1633.472935] usb 2-2: Manufacturer: Linux
> >[ 1633.472936] usb 2-2: SerialNumber: 0001
> >[ 1633.473987] usb_debug 2-2:1.0: xhci_dbc converter detected
> >[ 1633.474624] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> >[ 1633.900927] usb 2-2: USB disconnect, device number 11
> >[ 1633.901176] xhci_dbc ttyUSB0: xhci_dbc converter now disconnected from ttyUSB0
> >[ 1633.901226] usb_debug 2-2:1.0: device disconnected
> >[ 1634.106831] usb 2-2: new SuperSpeed USB device number 12 using xhci_hcd
> >[ 1634.117987] usb 2-2: LPM exit latency is zeroed, disabling LPM.
> >[ 1634.118328] usb 2-2: New USB device found, idVendor=1d6b, idProduct=0004
> >[ 1634.118329] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> >[ 1634.118330] usb 2-2: Product: Remote GDB
> >[ 1634.118331] usb 2-2: Manufacturer: Linux
> >[ 1634.118332] usb 2-2: SerialNumber: 0001
> >[ 1634.120194] usb_debug 2-2:1.0: xhci_dbc converter detected
> >[ 1634.120949] usb 2-2: xhci_dbc converter now attached to ttyUSB0
> >
> >Thanks
> >Dave
> >--
> >To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> >the body of a message to majordomo@vger.kernel.org
> >More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1268545 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

From"Lu, Baolu" <baolu.lu@linux.intel.com>
Date2015-11-13 03:10 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qubYm-gb-7@gated-at.bofh.it>
In reply to#1267649
Hi Dave,

On 11/12/2015 02:01 PM, Dave Young wrote:
> Hi, Baolu
>
> On 11/12/15 at 10:45am, Lu, Baolu wrote:
>> >Hi Dave,
>> >
>> >Which device are you testing with? This implementation was developed
>> >and tested on Intel Skylake devices.
>> >
>> >It doesn't surprise me if it doesn't work with other silicons. But it do
>> >remind me to create a verified-list and put those known-to-work devices
>> >in it.
>> >
> I have not got time to do more test. What infomation do you want?
> lsusb -v?

lspci -v

Thanks,
-Baolu

>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1268554 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

FromDave Young <dyoung@redhat.com>
Date2015-11-13 03:30 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<quchH-nf-11@gated-at.bofh.it>
In reply to#1268545
On 11/13/15 at 10:04am, Lu, Baolu wrote:
> Hi Dave,
> 
> On 11/12/2015 02:01 PM, Dave Young wrote:
> >Hi, Baolu
> >
> >On 11/12/15 at 10:45am, Lu, Baolu wrote:
> >>>Hi Dave,
> >>>
> >>>Which device are you testing with? This implementation was developed
> >>>and tested on Intel Skylake devices.
> >>>
> >>>It doesn't surprise me if it doesn't work with other silicons. But it do
> >>>remind me to create a verified-list and put those known-to-work devices
> >>>in it.
> >>>
> >I have not got time to do more test. What infomation do you want?
> >lsusb -v?
> 
> lspci -v
> 

Here is the controller information:

Host side:

00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05) (prog-if 30 [XHCI])
	Subsystem: Hewlett-Packard Company Device 1905
	Flags: bus master, medium devsel, latency 0, IRQ 27
	Memory at ef120000 (64-bit, non-prefetchable) [size=64K]
	Capabilities: <access denied>
	Kernel driver in use: xhci_hcd

Target side:

00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04) (prog-if 30 [XHCI])
	Subsystem: Lenovo Device 220c
	Flags: bus master, medium devsel, latency 0, IRQ 41
	Memory at f0620000 (64-bit, non-prefetchable) [size=64K]
	Capabilities: <access denied>
	Kernel driver in use: xhci_hcd

Thanks
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1268647 — Re: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port

FromLu Baolu <baolu.lu@linux.intel.com>
Date2015-11-13 07:30 +0100
SubjectRe: [PATCH v3 00/12] usb: early: add support for early printk through USB3 debug port
Message-ID<qug1Y-2OU-15@gated-at.bofh.it>
In reply to#1268554

On 11/13/2015 10:26 AM, Dave Young wrote:
> On 11/13/15 at 10:04am, Lu, Baolu wrote:
>> Hi Dave,
>>
>> On 11/12/2015 02:01 PM, Dave Young wrote:
>>> Hi, Baolu
>>>
>>> On 11/12/15 at 10:45am, Lu, Baolu wrote:
>>>>> Hi Dave,
>>>>>
>>>>> Which device are you testing with? This implementation was developed
>>>>> and tested on Intel Skylake devices.
>>>>>
>>>>> It doesn't surprise me if it doesn't work with other silicons. But it do
>>>>> remind me to create a verified-list and put those known-to-work devices
>>>>> in it.
>>>>>
>>> I have not got time to do more test. What infomation do you want?
>>> lsusb -v?
>> lspci -v
>>
> Here is the controller information:
>
> Host side:
>
> 00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05) (prog-if 30 [XHCI])
> 	Subsystem: Hewlett-Packard Company Device 1905
> 	Flags: bus master, medium devsel, latency 0, IRQ 27
> 	Memory at ef120000 (64-bit, non-prefetchable) [size=64K]
> 	Capabilities: <access denied>
> 	Kernel driver in use: xhci_hcd
>
> Target side:
>
> 00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04) (prog-if 30 [XHCI])
> 	Subsystem: Lenovo Device 220c
> 	Flags: bus master, medium devsel, latency 0, IRQ 41
> 	Memory at f0620000 (64-bit, non-prefetchable) [size=64K]
> 	Capabilities: <access denied>
> 	Kernel driver in use: xhci_hcd

Okay, thank you.

Thanks,
-Baolu

> Thanks
> Dave
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web