Re: [PATCH] x86/timers: Move simple_udelay_calibration past init_hypervisor_platform

2017-05-24 Thread Lu Baolu
via USB3 debug port"), comes much later > into play. Acked-by: Lu Baolu > > Signed-off-by: Jan Kiszka > --- > arch/x86/kernel/setup.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c >

Re: [tip:x86/debug] x86/timers: Add simple udelay calibration

2017-05-24 Thread Lu Baolu
Hi, On 05/25/2017 12:56 AM, Jan Kiszka wrote: > On 2017-03-21 13:19, tip-bot for Lu Baolu wrote: >> Commit-ID: dd759d93f4dd4fd2f345a78ad1223bb3edf3ee7b >> Gitweb: >> http://git.kernel.org/tip/dd759d93f4dd4fd2f345a78ad1223bb3edf3ee7b >> Author: Lu Baolu >

Re: [PATCH v8 1/5] x86: add simple udelay calibration

2017-05-04 Thread Lu Baolu
Hi, On 05/03/2017 06:38 AM, Boris Ostrovsky wrote: > On 03/21/2017 04:01 AM, Lu Baolu wrote: >> Add a simple udelay calibration in x86 architecture-specific >> boot-time initializations. This will get a workable estimate >> for loops_per_jiffy. Hence, udelay() cou

Re: [PATCH v1] Revert "extcon: usb-gpio: add support for ACPI gpio interface"

2017-03-26 Thread Lu Baolu
Hi, On 03/24/2017 07:47 PM, Chanwoo Choi wrote: > Hi Lu Baolu, > > On 2017년 03월 24일 20:24, Andy Shevchenko wrote: >> On Fri, 2017-03-24 at 20:03 +0900, Chanwoo Choi wrote: >>> On 2017년 03월 22일 22:09, Andy Shevchenko wrote: >>>> On Wed, 2017-03-22 at 10:14 +0900

Re: [PATCH v8 0/5] usb: early: add support for early printk through USB3 debug port

2017-03-21 Thread Lu Baolu
Hi, On 03/21/2017 07:33 PM, Ingo Molnar wrote: >> Lu Baolu (5): >> > x86: add simple udelay calibration >> > usb: early: add driver for xhci debug capability >> > x86: add support for earlyprintk via USB3 debug port >> > usb: serial: add dbc de

[tip:x86/debug] usb/serial: Add DBC debug device support to usb_debug

2017-03-21 Thread tip-bot for Lu Baolu
Commit-ID: 57fb47279a04cd53641dc5ae55a6d47e4f32a2fd Gitweb: http://git.kernel.org/tip/57fb47279a04cd53641dc5ae55a6d47e4f32a2fd Author: Lu Baolu AuthorDate: Tue, 21 Mar 2017 16:01:32 +0800 Committer: Ingo Molnar CommitDate: Tue, 21 Mar 2017 12:30:17 +0100 usb/serial: Add DBC debug

[tip:x86/debug] usb/doc: Add document for USB3 debug port usage

2017-03-21 Thread tip-bot for Lu Baolu
Commit-ID: 1b326277798aa820c1043617786609b9bb4bee78 Gitweb: http://git.kernel.org/tip/1b326277798aa820c1043617786609b9bb4bee78 Author: Lu Baolu AuthorDate: Tue, 21 Mar 2017 16:01:33 +0800 Committer: Ingo Molnar CommitDate: Tue, 21 Mar 2017 12:30:17 +0100 usb/doc: Add document for USB3

[tip:x86/debug] x86/earlyprintk: Add support for earlyprintk via USB3 debug port

2017-03-21 Thread tip-bot for Lu Baolu
Commit-ID: 1b5aeebf3a92273b4d85aeff37a16037bc3c3abf Gitweb: http://git.kernel.org/tip/1b5aeebf3a92273b4d85aeff37a16037bc3c3abf Author: Lu Baolu AuthorDate: Tue, 21 Mar 2017 16:01:31 +0800 Committer: Ingo Molnar CommitDate: Tue, 21 Mar 2017 12:30:16 +0100 x86/earlyprintk: Add support

[tip:x86/debug] usb/early: Add driver for xhci debug capability

2017-03-21 Thread tip-bot for Lu Baolu
Commit-ID: aeb9dd1de98c1a5f2007ea5d2a154c1244caf8a0 Gitweb: http://git.kernel.org/tip/aeb9dd1de98c1a5f2007ea5d2a154c1244caf8a0 Author: Lu Baolu AuthorDate: Tue, 21 Mar 2017 16:01:30 +0800 Committer: Ingo Molnar CommitDate: Tue, 21 Mar 2017 12:30:05 +0100 usb/early: Add driver for xhci

[tip:x86/debug] x86/timers: Add simple udelay calibration

2017-03-21 Thread tip-bot for Lu Baolu
Commit-ID: dd759d93f4dd4fd2f345a78ad1223bb3edf3ee7b Gitweb: http://git.kernel.org/tip/dd759d93f4dd4fd2f345a78ad1223bb3edf3ee7b Author: Lu Baolu AuthorDate: Tue, 21 Mar 2017 16:01:29 +0800 Committer: Ingo Molnar CommitDate: Tue, 21 Mar 2017 12:28:45 +0100 x86/timers: Add simple udelay

[PATCH v8 3/5] x86: add support for earlyprintk via USB3 debug port

2017-03-21 Thread Lu Baolu
ory blocks. This requires to delay setting up debugging hardware and registering boot console until the memblocks are filled. Cc: Ingo Molnar Cc: x...@kernel.org Signed-off-by: Lu Baolu --- Documentation/admin-guide/kernel-parameters.txt | 1 + arch/x86/kernel/early_printk.c | 5 +

[PATCH v8 5/5] usb: doc: add document for USB3 debug port usage

2017-03-21 Thread Lu Baolu
Add Documentation/usb/usb3-debug-port.rst. This document includes the guide for using USB3 debug port. Cc: linux-...@vger.kernel.org Signed-off-by: Lu Baolu --- Documentation/usb/usb3-debug-port.rst | 100 ++ 1 file changed, 100 insertions(+) create mode 100644

[PATCH v8 2/5] usb: early: add driver for xhci debug capability

2017-03-21 Thread Lu Baolu
when your machine crashes very early before the regular console code is initialized. Other uses include simpler, lockless logging instead of a full-blown printk console driver and klogd. Cc: Ingo Molnar Cc: Mathias Nyman Signed-off-by: Lu Baolu --- arch/x86/Kconfig.debug| 23 + dr

[PATCH v8 4/5] usb: serial: add dbc debug device support to usb_debug

2017-03-21 Thread Lu Baolu
This patch adds dbc debug device support to the usb_debug driver. Signed-off-by: Lu Baolu Acked-by: Johan Hovold --- 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

[PATCH v8 0/5] usb: early: add support for early printk through USB3 debug port

2017-03-21 Thread Lu Baolu
gt;v2: - Refactor the duplicate code in xdbc_early_start() and xdbc_handle_external_reset(). - Free resources when hardware not used any more. - Refine the user guide document. Lu Baolu (5): x86: add simple udelay calibration usb: early: add driver for xhci debug capability x86: add support

[PATCH v8 1/5] x86: add simple udelay calibration

2017-03-21 Thread Lu Baolu
Add a simple udelay calibration in x86 architecture-specific boot-time initializations. This will get a workable estimate for loops_per_jiffy. Hence, udelay() could be used after this initialization. Cc: Ingo Molnar Cc: x...@kernel.org Signed-off-by: Lu Baolu --- arch/x86/kernel/setup.c | 22

Re: [PATCH v7 0/5] usb: early: add support for early printk through USB3 debug port

2017-03-16 Thread Lu Baolu
Hi Ingo, On 03/16/2017 03:17 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> Hi Ingo, >> >> On 03/02/2017 02:40 PM, Ingo Molnar wrote: >>> * Lu Baolu wrote: >>> >>>> Hi Ingo, >>>> >>>> How about this version? Any fu

Re: [PATCH v7 0/5] usb: early: add support for early printk through USB3 debug port

2017-03-03 Thread Lu Baolu
Hi Ingo, On 03/02/2017 02:40 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> Hi Ingo, >> >> How about this version? Any further comments? > So I have re-read the review feedback I gave on Jan 19 and found at least one > thing I pointed out that you didn't ad

Re: [PATCH v7 0/5] usb: early: add support for early printk through USB3 debug port

2017-03-01 Thread Lu Baolu
Hi Ingo, How about this version? Any further comments? Best regards, Lu Baolu On 02/14/2017 10:27 AM, Lu Baolu wrote: > xHCI debug capability (DbC) is an optional but standalone > functionality provided by an xHCI host controller. With DbC > hardware initialized, the system will

Re: [PATCH 1/6] usb: xhci: add xhci_log_cmd trace events

2017-02-15 Thread Lu Baolu
Hi, On 02/15/2017 04:56 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >>> Lu Baolu writes: >>>> diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h >>>> index 1ac2cdf..c31eeaf 100644 >>>> --- a/drivers/usb/host

Re: [PATCH 2/6] usb: xhci: enhance xhci_log_ctx trace events

2017-02-15 Thread Lu Baolu
Hi, On 02/15/2017 04:00 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >> XHCI driver has defined xhci_log_ctx trace events to trace >> the change of an xhci input or output context. This patch >> extends the trace class of xhci_log_ctx to print out the >>

Re: [PATCH 1/6] usb: xhci: add xhci_log_cmd trace events

2017-02-15 Thread Lu Baolu
Hi, On 02/15/2017 03:58 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >> diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h >> index 1ac2cdf..c31eeaf 100644 >> --- a/drivers/usb/host/xhci-trace.h >> +++ b/drivers/usb/host/

[PATCH 5/6] usb: xhci: fix link trb decoding

2017-02-14 Thread Lu Baolu
xhci_decode_trb() treats a link trb in the same way as that for an event trb. This patch fixes this by decoding the link trb according to the spec. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci.h | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/usb

[PATCH 1/6] usb: xhci: add xhci_log_cmd trace events

2017-02-14 Thread Lu Baolu
plugin. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-hub.c | 2 + drivers/usb/host/xhci-ring.c | 13 +-- drivers/usb/host/xhci-trace.h | 90 +++ drivers/usb/host/xhci.c | 7 4 files changed, 108 insertions(+), 4 deletions(-) diff

[PATCH 3/6] usb: xhci: remove xhci_debug_trb()

2017-02-14 Thread Lu Baolu
Every XHCI TRB has already been traced by the trb trace events. It is unnecessary to put the same message in kernel log. This patch removes xhci_debug_trb(). Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-dbg.c | 57 drivers/usb/host/xhci-ring.c

[PATCH 2/6] usb: xhci: enhance xhci_log_ctx trace events

2017-02-14 Thread Lu Baolu
xhci input or output context changes. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-trace.h | 63 ++- drivers/usb/host/xhci.c | 23 +++- drivers/usb/host/xhci.h | 60 + 3 files changed, 121

[PATCH 4/6] usb: xhci: remove xhci_dbg_ctx()

2017-02-14 Thread Lu Baolu
XHCI context changes have already been traced by the trace events. It's unnecessary to put the same message in kernel log. This patch removes the use of xhci_dbg_ctx(). Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-dbg.c | 143 drivers/usb

[PATCH 6/6] usb: xhci: cleanup xhci_decode_trb() slightly

2017-02-14 Thread Lu Baolu
Replace 'TRB_FIELD_TO_TYPE(field3)' with 'type' to simplify code. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci.h | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/

[PATCH 0/6] usb: xhci: several patches for xhci trace

2017-02-14 Thread Lu Baolu
device contexts of a USB device. This also includes some cleanups to remove duplicated code. Best regards, Lu Baolu Lu Baolu (6): usb: xhci: add xhci_log_cmd trace events usb: xhci: enhance xhci_log_ctx trace events usb: xhci: remove xhci_debug_trb() usb: xhci: remove xhci_dbg_ctx() usb

Re: [PATCH v7 1/5] x86: add simple udelay calibration

2017-02-14 Thread Lu Baolu
Hi, On 02/14/2017 05:23 PM, Sergei Shtylyov wrote: > Hello! > > On 2/14/2017 5:27 AM, Lu Baolu wrote: > >> Add a simple udelay calibration in x86 architecture-specific >> boot-time initializations. This will get a workable estimate >> for loops_per_jiffy. Hence, ude

Re: [PATCH v7 5/5] usb: doc: add document for USB3 debug port usage

2017-02-13 Thread Lu Baolu
Hi, On 02/14/2017 02:13 PM, Peter Chen wrote: > >> On 02/14/2017 11:45 AM, Peter Chen wrote: >>> On Tue, Feb 14, 2017 at 10:27 AM, Lu Baolu wrote: >>> >>>> Add Documentation/usb/usb3-debug-port.rst. This document includes the >>>>

Re: [PATCH v7 5/5] usb: doc: add document for USB3 debug port usage

2017-02-13 Thread Lu Baolu
Hi, On 02/14/2017 11:45 AM, Peter Chen wrote: > On Tue, Feb 14, 2017 at 10:27 AM, Lu Baolu wrote: > >> Add Documentation/usb/usb3-debug-port.rst. This document includes >> the user guide for USB3 debug port. >> >> Cc: linux-...@vger.kernel.org >> Signed-off-by

[PATCH v7 0/5] usb: early: add support for early printk through USB3 debug port

2017-02-13 Thread Lu Baolu
cesfuly tested on in the document. v2->v3: - Removed spinlock usage. - Removed work queue usage. - Refined the user guide document. v1->v2: - Refactor the duplicate code in xdbc_early_start() and xdbc_handle_external_reset(). - Free resources when hardware not used any mo

[PATCH v7 3/5] x86: add support for earlyprintk via USB3 debug port

2017-02-13 Thread Lu Baolu
ocks. This requires to delay setting up debugging hardware and registering boot console until the memblocks are filled. Cc: Ingo Molnar Cc: x...@kernel.org Signed-off-by: Lu Baolu --- Documentation/admin-guide/kernel-parameters.txt | 1 + arch/x86/kernel/early_printk.c | 5 +

[PATCH v7 5/5] usb: doc: add document for USB3 debug port usage

2017-02-13 Thread Lu Baolu
Add Documentation/usb/usb3-debug-port.rst. This document includes the user guide for USB3 debug port. Cc: linux-...@vger.kernel.org Signed-off-by: Lu Baolu --- Documentation/usb/usb3-debug-port.rst | 98 +++ 1 file changed, 98 insertions(+) create mode 100644

[PATCH v7 4/5] usb: serial: add dbc debug device support to usb_debug

2017-02-13 Thread Lu Baolu
This patch adds dbc debug device support to the usb_debug driver. Signed-off-by: Lu Baolu Acked-by: Johan Hovold --- 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

[PATCH v7 2/5] usb: dbc: early driver for xhci debug capability

2017-02-13 Thread Lu Baolu
faces. These interfaces could be used to implement early printk bootconsole or hook to various system debuggers. Cc: Mathias Nyman Signed-off-by: Lu Baolu --- arch/x86/Kconfig.debug| 17 + drivers/usb/Kconfig |3 + drivers/usb/Makefile |2 +- drivers/usb/

[PATCH v7 1/5] x86: add simple udelay calibration

2017-02-13 Thread Lu Baolu
Add a simple udelay calibration in x86 architecture-specific boot-time initializations. This will get a workable estimate for loops_per_jiffy. Hence, udelay() could be used after this initialization. Cc: Ingo Molnar Cc: x...@kernel.org Signed-off-by: Lu Baolu --- arch/x86/kernel/setup.c | 22

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-02-08 Thread Lu Baolu
Hi Ingo, On 01/26/2017 03:22 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> Hi, >> >> On 01/25/2017 10:38 PM, Peter Zijlstra wrote: >>> On Wed, Jan 25, 2017 at 08:27:38PM +0800, Lu Baolu wrote: >>>> In my driver, udelay() is mostly used to handle t

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-02-08 Thread Lu Baolu
Hi Ingo, On 01/26/2017 03:19 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> Fair enough. >> >> USB connection is stable enough, unless the user unplugs the >> USB cable during debugging. > What does the hardware do in this case? The XHCI registers are in th

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-01-25 Thread Lu Baolu
Hi Ingo, On 01/26/2017 03:19 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> Fair enough. >> >> USB connection is stable enough, unless the user unplugs the >> USB cable during debugging. > What does the hardware do in this case? The XHCI registers are in th

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-01-25 Thread Lu Baolu
Hi, On 01/26/2017 12:16 AM, Peter Zijlstra wrote: > On Wed, Jan 25, 2017 at 11:51:34PM +0800, Lu Baolu wrote: > >>> What is timeout and why? >> Put it in simple: >> >> The driver sets the RUN bit in control register and polls READY >> bit in status

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-01-25 Thread Lu Baolu
Hi Ingo, On 01/25/2017 05:23 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >>> Hiding essentially an early udelay() implementation in an early-printk >>> driver is >>> ugly and counterproductive. >> Sure. How about below change? >> >> diff

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-01-25 Thread Lu Baolu
Hi, On 01/25/2017 10:38 PM, Peter Zijlstra wrote: > On Wed, Jan 25, 2017 at 08:27:38PM +0800, Lu Baolu wrote: >> In my driver, udelay() is mostly used to handle time out. >> >> Xdbc hides most USB things in its firmware. Early printk driver only needs >> to setup th

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-01-25 Thread Lu Baolu
Hi, On 01/25/2017 05:57 PM, Peter Zijlstra wrote: > On Wed, Jan 25, 2017 at 10:23:55AM +0100, Ingo Molnar wrote: >> * Lu Baolu wrote: >> >>>> Hiding essentially an early udelay() implementation in an early-printk >>>> driver is >>>> ugly and

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-01-25 Thread Lu Baolu
Hi, On 01/25/2017 05:23 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >>> Hiding essentially an early udelay() implementation in an early-printk >>> driver is >>> ugly and counterproductive. >> Sure. How about below change? >> >> diff --git

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-01-24 Thread Lu Baolu
Hi Ingo, On 01/24/2017 04:20 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> Hi Ingo, >> >> On 01/22/2017 05:04 PM, Ingo Molnar wrote: >>> * Lu Baolu wrote: >>> >>>>>> +static void xdbc_runtime_delay(unsigned long count) >>&g

Re: [PATCH v6 1/4] usb: dbc: early driver for xhci debug capability

2017-01-23 Thread Lu Baolu
Hi Ingo, On 01/22/2017 05:31 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> xHCI debug capability (DbC) is an optional but standalone >> functionality provided by an xHCI host controller. Software >> learns this capability by walking through the extended >> cap

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-01-23 Thread Lu Baolu
Hi Ingo, On 01/22/2017 05:04 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >>>> +static void xdbc_runtime_delay(unsigned long count) >>>> +{ >>>> + udelay(count); >>>> +} >>>> +static void (*xdbc_delay)(unsigned long) = xdbc_early

[PATCH v6 1/4] usb: dbc: early driver for xhci debug capability

2017-01-21 Thread Lu Baolu
faces could be used to implement early printk bootconsole or hook to various system debuggers. Cc: Mathias Nyman Signed-off-by: Lu Baolu --- arch/x86/Kconfig.debug| 17 + drivers/usb/Kconfig |3 + drivers/usb/Makefile |2 +- drivers/usb/early/Makefile|

[PATCH v6 3/4] usb: serial: add dbc debug device support to usb_debug

2017-01-21 Thread Lu Baolu
This patch adds dbc debug device support to the usb_debug driver. Signed-off-by: Lu Baolu Acked-by: Johan Hovold --- 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

[PATCH v6 4/4] usb: doc: add document for USB3 debug port usage

2017-01-21 Thread Lu Baolu
Add Documentation/usb/usb3-debug-port.rst. This document includes the user guide for USB3 debug port. Cc: linux-...@vger.kernel.org Signed-off-by: Lu Baolu --- Documentation/usb/usb3-debug-port.rst | 98 +++ 1 file changed, 98 insertions(+) create mode 100644

[PATCH v6 2/4] x86: add support for earlyprintk via USB3 debug port

2017-01-21 Thread Lu Baolu
ocks. This requires to delay setting up debugging hardware and registering boot console until the memblocks are filled. Cc: Ingo Molnar Cc: x...@kernel.org Signed-off-by: Lu Baolu --- Documentation/admin-guide/kernel-parameters.txt | 1 + arch/x86/kernel/early_printk.c | 5 +

[PATCH v6 0/4] usb: early: add support for early printk through USB3 debug port

2017-01-21 Thread Lu Baolu
nt. v2->v3: - Removed spinlock usage. - Removed work queue usage. - Refined the user guide document. v1->v2: - Refactor the duplicate code in xdbc_early_start() and xdbc_handle_external_reset(). - Free resources when hardware not used any more. - Refine the user guide docum

Re: [PATCH v5 0/4] usb: early: add support for early printk through USB3 debug port

2017-01-19 Thread Lu Baolu
Hi Ingo, On 01/19/2017 05:12 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> xHCI debug capability (DbC) is an optional but standalone >> functionality provided by an xHCI host controller. With DbC >> hardware initialized, the system will present a debug device >&g

Re: [PATCH v5 4/4] usb: doc: add document for USB3 debug port usage

2017-01-19 Thread Lu Baolu
Hi Ingo, On 01/19/2017 05:41 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> Add Documentation/usb/usb3-debug-port.rst. This document includes >> the user guide for USB3 debug port. >> >> Cc: linux-...@vger.kernel.org >> Signed-off-by: Lu Baolu >> ---

Re: [PATCH v5 3/4] usb: serial: usb_debug: add support for dbc debug device

2017-01-19 Thread Lu Baolu
Hi Ingo, On 01/19/2017 05:39 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> This patch add dbc debug device support in usb_debug driver. > s/add dbc debug device support in usb_debug driver > /adds dbc debug device support to the usb_debug driver > > Please fix the tit

Re: [PATCH v5 2/4] x86: add support for earlyprintk via USB3 debug port

2017-01-19 Thread Lu Baolu
Hi Ingo, On 01/19/2017 05:38 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> index 8a12199..c4031b9 100644 >> --- a/arch/x86/kernel/early_printk.c >> +++ b/arch/x86/kernel/early_printk.c >> @@ -17,6 +17,7 @@ >> #include >> #include >> #i

Re: [PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2017-01-19 Thread Lu Baolu
Hi Ingo, I'm very appreciated for your review comments. I've put my replies in lines. On 01/19/2017 05:37 PM, Ingo Molnar wrote: > * Lu Baolu wrote: > >> xHCI debug capability (DbC) is an optional but standalone >> functionality provided by an xHCI host control

Re: [PATCH v5 0/4] usb: early: add support for early printk through USB3 debug port

2017-01-17 Thread Lu Baolu
Hi Greg, This patch series has been there for 2 months without further comments. Will you consider it for usb-next? Best regards, Lu Baolu On 11/15/2016 02:02 PM, Lu Baolu wrote: > xHCI debug capability (DbC) is an optional but standalone > functionality provided by an xHCI host cont

Re: [PATCH 1/1] usb: xhci: set RWE only for remote wakeup capable devices

2017-01-12 Thread Lu Baolu
Hi Mathias, On 01/12/2017 04:53 PM, Lu Baolu wrote: > Xhci spec requires in section 4.23.5.1.1.1 that the RWE bit of USB2 > PORTPMSC register should only set for remote wakeup capble devices. > > This was suggested by Mathias in the following discussion thread. > http://marc.info

[PATCH 1/1] usb: xhci: set RWE only for remote wakeup capable devices

2017-01-12 Thread Lu Baolu
d-off-by: Lu Baolu --- drivers/usb/host/xhci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 0c8deb9..d887e09 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4191,7 +4191,

[PATCH v2 1/1] usb: xhci: clear EINT bit in status correctly

2017-01-02 Thread Lu Baolu
4+ Cc: Felipe Balbi Signed-off-by: Lu Baolu --- Change log: v1->v2: - Fixed a warning reported by 0-day kbuild robot. drivers/usb/host/xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 1cd5641..bb08c6b 1006

[PATCH 1/1] usb: xhci: clear EINT bit in status correctly

2016-12-29 Thread Lu Baolu
4+ CC: Felipe Balbi Signed-off-by: Lu Baolu --- drivers/usb/host/xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 1cd5641..18ea6b8 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -721,7 +

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-26 Thread Lu Baolu
Hi, On 12/27/2016 10:58 AM, Baolin Wang wrote: > Hi, > > On 27 December 2016 at 10:39, Lu Baolu wrote: >> Hi, >> >> On 12/26/2016 04:01 PM, Baolin Wang wrote: >>> On some platfroms(like x86 platform), when one core is running the USB >>> gadget &g

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-26 Thread Lu Baolu
and interrupt threads. Or, I missed anything? Best regards, Lu Baolu > > Signed-off-by: Baolin Wang > --- > drivers/usb/dwc3/gadget.c |6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c >

[PATCH 3/4] usb: xhci: add XHCI_MISS_CA_EVENT quirk bit

2016-12-22 Thread Lu Baolu
ts, if the command completion for abort command ring misses, we shall assume that there are larger problems with the host and assert HCRST. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 17 + drivers/usb/host/xhci.h | 6 ++ 2 files changed, 11 insertions(+), 12

[PATCH 1/4] usb: xhci: remove unnecessary second abort try

2016-12-22 Thread Lu Baolu
The second try was a workaround for (what we thought was) command ring failing to stop in the first place. But this turns out to be due to the race that we have fixed(see "xhci: Fix race related to abort operation"). With that fix, it is time to remove the second try. Signed-off-by

[PATCH 0/4] refactor command timeout handling

2016-12-22 Thread Lu Baolu
usb: xhci: warn on command timeout in stopped command ring are my proposals. They base on the top of your timeout_race_fixes branch. (git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git timeout_race_fixes) Lu Baolu (4): usb: xhci: remove unnecessary second abort try usb: xhci: r

[PATCH 2/4] usb: xhci: remove CRR polling in xhci_abort_cmd_ring()

2016-12-22 Thread Lu Baolu
cpu cycles are wasted on polling registers. This patch removes polling for CRR (Command Ring Running). Wait for completion, and check CRR if completion times out is enough. Suggested-by: Mathias Nyman Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 49

[PATCH 4/4] usb: xhci: warn on command timeout in stopped command ring

2016-12-22 Thread Lu Baolu
situation to the upper layer. In rare cases, if the driver sees a command timeout in a stopped command ring, driver should let the user know it. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci

[PATCH 0/1] xhci: Fix race related to abort operation

2016-12-22 Thread Lu Baolu
ng waiting for the command stopped event. It sits at the same place in your timeout_race_fixes branch. (git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git timeout_race_fixes) Best regards, Lu Baolu OGAWA Hirofumi (1): xhci: Fix race related to abort operation drivers/usb/host

[PATCH 1/1] xhci: Fix race related to abort operation

2016-12-22 Thread Lu Baolu
CMD_RING_PAUSE operation] [baolu: release xhci->lock before wait and apply it back again after wait. This is the reason my signed-off-by is added.] CC: Signed-off-by: OGAWA Hirofumi Signed-off-by: Lu Baolu Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 1 + drivers/usb/host/x

[PATCH 0/1] usb: xhci: hold lock over xhci_abort_cmd_ring()

2016-12-22 Thread Lu Baolu
Hi Mathias, This is a follow-up patch for below comment "fix the lock to cover abort+CRR check, and send it to usb-linus +stable" in below discussion thread. https://lkml.org/lkml/2016/12/21/186 It's based on v4.9. Best regards, Lu Baolu Lu Baolu (1): usb: xhci:

[PATCH 1/1] usb: xhci: hold lock over xhci_abort_cmd_ring()

2016-12-22 Thread Lu Baolu
of calling functions without locking in xhci_handle_command_timeout(). Cc: # 3.7+ Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 7971

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Lu Baolu
D to >> CMD_RING_STATE_RUNNING so ring will really restart in the interrupt >> handler. > Just for record (no chance to make patch I myself for now, sorry), while > checking locking slightly, I noticed unrelated missing locking. > > xhci_cleanup_command_queue() > > We are calling it without locking, but we need to lock for accessing list. Yeah. I can make the patch. Best regards, Lu Baolu

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Lu Baolu
Hi, On 12/21/2016 08:48 PM, Mathias Nyman wrote: > On 21.12.2016 08:17, Lu Baolu wrote: >> Hi Mathias, >> >> I have some comments for the implementation of xhci_abort_cmd_ring() below. >> >> On 12/20/2016 11:13 PM, Mathias Nyman wrote: >>&

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Lu Baolu
Hi, On 12/21/2016 08:57 PM, Mathias Nyman wrote: > On 21.12.2016 08:57, Lu Baolu wrote: >> Hi Mathias, >> >> I have some comments for the implementation of >> xhci_handle_command_timeout() as well. >> >> On 12/20/2016 11:13 PM, Mathias Nyman wrote: >

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-20 Thread Lu Baolu
>current_cmd); 1327 spin_unlock_irqrestore(&xhci->lock, flags); This part of code is tricky. I have no idea about in which case should this code be executed? Anyway, we shouldn't call xhci_handle_stopped_cmd_ring() here, right? 1328 return; 1329 } Best regards, Lu Baolu

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-20 Thread Lu Baolu
n"); 368 xhci_cleanup_command_queue(xhci); 369 } else { 370 unsigned long flags; 371 372 spin_lock_irqsave(&xhci->lock, flags); 373 xhci_handle_stopped_cmd_ring(xhci, xhci_next_queued_cmd(xhci)); 374 spin_unlock_irqrestore(&xhci->lock, flags); 375 } 376 return 0; 377 } Best regards, Lu Baolu

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-19 Thread Lu Baolu
Hi, On 12/20/2016 02:46 PM, Baolin Wang wrote: > On 20 December 2016 at 14:39, Lu Baolu wrote: >> Hi, >> >> On 12/20/2016 02:06 PM, Baolin Wang wrote: >>> Hi, >>> >>> On 20 December 2016 at 12:29, Lu Baolu wrote: >>>> Hi Mathias, >

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-19 Thread Lu Baolu
Hi, On 12/20/2016 02:06 PM, Baolin Wang wrote: > Hi, > > On 20 December 2016 at 12:29, Lu Baolu wrote: >> Hi Mathias, >> >> On 12/19/2016 08:13 PM, Mathias Nyman wrote: >>> On 19.12.2016 13:34, Baolin Wang wrote: >>>> Hi Mathias, >>>>

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-19 Thread Lu Baolu
atch for that one case > it seems that patch 2/2 can be replaced by a single line change: > > if (!xhci->current_cmd || timer_pending(&xhci->cmd_timer)) > > Right? > > -Mathias > It seems that the watch dog algorithm for command queue becomes more and more complicated and hard for maintain. I am also seeing another case where a command may lose the chance to be tracked by the watch dog timer. Say, queue_command(the only command in queue) - completion irq fires--- timer times out at same time-- - another command enqueue-- - lock(xhci_lock ) - spin_on(xhci_lock) - spin_on(xhci_lock) - del_timer() fail - free the command and set current_cmd to NULL - unlock(xhci_lock) - lock(xhci_lock) - queue_command()(timer will not rescheduled since the timer is pending) - lock(xhci_lock) - no current command - return As the result, the later command isn't under track of the watch dog. If hardware fails to response to this command, kernel will hang in the thread which is waiting for the completion of the command. I can write a patch to fix this and cc stable kernel as well. For long term, in order to make it simple and easy to maintain, how about allocating a watch dog timer for each command? It could be part of the command structure and be managed just like the life cycle of a command structure. I can write a patch for review and discussion, if you think this change is possible. Best regards, Lu Baolu

Re: [PATCH 1/1] usb: xhci: fix possible wild pointer

2016-12-05 Thread Lu Baolu
Hi, On 12/02/2016 09:39 PM, Mathias Nyman wrote: > On 02.12.2016 04:29, Lu Baolu wrote: >> handle_cmd_completion() frees a command structure which might >> be still referenced by xhci->current_cmd. This might cause >> problem when xhci->current_cmd is accessed after t

Re: [PATCH 1/1] usb: xhci: fix possible wild pointer

2016-12-01 Thread Lu Baolu
Hi, On 12/02/2016 12:18 PM, Baolin Wang wrote: > On 2 December 2016 at 10:29, Lu Baolu wrote: >> handle_cmd_completion() frees a command structure which might >> be still referenced by xhci->current_cmd. This might cause >> problem when xhci->current_cmd is accessed af

[PATCH 1/1] usb: xhci: fix possible wild pointer

2016-12-01 Thread Lu Baolu
# v3.16+ Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index bdf6b13..13e05f6 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/h

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-12-01 Thread Lu Baolu
Hi, On 12/01/2016 04:03 PM, Baolin Wang wrote: > On 1 December 2016 at 15:44, Lu Baolu wrote: >> Hi, >> >> On 12/01/2016 03:35 PM, Baolin Wang wrote: >>> On 1 December 2016 at 14:35, Lu Baolu wrote: >>>> Hi, >>>> >>>> On 12/01/

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Lu Baolu
Hi, On 12/01/2016 03:35 PM, Baolin Wang wrote: > On 1 December 2016 at 14:35, Lu Baolu wrote: >> Hi, >> >> On 12/01/2016 02:04 PM, Baolin Wang wrote: >>> Hi Baolu, >>> >>> On 1 December 2016 at 13:45, Lu Baolu wrote: >>>> Hi, >&

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Lu Baolu
Hi, On 12/01/2016 02:04 PM, Baolin Wang wrote: > Hi Baolu, > > On 1 December 2016 at 13:45, Lu Baolu wrote: >> Hi, >> >> On 11/30/2016 05:02 PM, Baolin Wang wrote: >>> If the hardware never responds to the stop endpoint command, the >>> URBs will

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Lu Baolu
stop endpoint commands. If the timer is the tail end of the last - * stop endpoint command, and the endpoint's command is still pending, we assume - * the host is dying. Best regards, Lu Baolu > > We also need to clean up the command queue before trying to halt the > xHCI host in xhci_stop_endpoint_command_timeout() function. > > Signed-off-by: Baolin Wang

[PATCH v5 2/4] x86: add support for earlyprintk via USB3 debug port

2016-11-14 Thread Lu Baolu
ocks. This requires to delay setting up debugging hardware and registering boot console until the memblocks are filled. Cc: Ingo Molnar Cc: x...@kernel.org Signed-off-by: Lu Baolu --- Documentation/kernel-parameters.txt | 1 + arch/x86/kernel/early_printk.c | 5 + arch/x86/kern

[PATCH v5 0/4] usb: early: add support for early printk through USB3 debug port

2016-11-14 Thread Lu Baolu
guide document. v1->v2: - Refactor the duplicate code in xdbc_early_start() and xdbc_handle_external_reset(). - Free resources when hardware not used any more. - Refine the user guide document. Lu Baolu (4): usb: dbc: early driver for xhci debug capability x86: add support for ear

[PATCH v5 1/4] usb: dbc: early driver for xhci debug capability

2016-11-14 Thread Lu Baolu
ew file mode 100644 index 000..5ac4223 --- /dev/null +++ b/drivers/usb/early/xhci-dbc.c @@ -0,0 +1,1068 @@ +/** + * xhci-dbc.c - xHCI debug capability early driver + * + * Copyright (C) 2016 Intel Corporation + * + * Author: Lu Baolu + * + * This program is free software; you can redistr

[PATCH v5 4/4] usb: doc: add document for USB3 debug port usage

2016-11-14 Thread Lu Baolu
Add Documentation/usb/usb3-debug-port.rst. This document includes the user guide for USB3 debug port. Cc: linux-...@vger.kernel.org Signed-off-by: Lu Baolu --- Documentation/usb/usb3-debug-port.rst | 95 +++ 1 file changed, 95 insertions(+) create mode 100644

[PATCH v5 3/4] usb: serial: usb_debug: add support for dbc debug device

2016-11-14 Thread Lu Baolu
This patch add dbc debug device support in usb_debug driver. Signed-off-by: Lu Baolu Acked-by: Johan Hovold --- 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

Re: [PATCH v4 1/4] usb: dbc: early driver for xhci debug capability

2016-11-11 Thread Lu Baolu
Hi Peter, On 11/11/2016 08:28 PM, Peter Zijlstra wrote: > On Fri, Nov 11, 2016 at 12:33:29PM +0800, Lu Baolu wrote: > >> Things become complicated when it comes to USB debug port. >> But it's still addressable. >> >> At this time, we can do it like this. &g

Re: [PATCH v4 1/4] usb: dbc: early driver for xhci debug capability

2016-11-10 Thread Lu Baolu
Hi Peter, On 11/10/2016 07:44 PM, Peter Zijlstra wrote: > On Thu, Nov 10, 2016 at 09:56:41AM +0100, Thomas Gleixner wrote: >> On Thu, 10 Nov 2016, Lu Baolu wrote: >>> This seems to be a common issue for all early printk drivers. >> No. The other early printk drivers like

Re: [PATCH v4 1/4] usb: dbc: early driver for xhci debug capability

2016-11-10 Thread Lu Baolu
Hi, On 11/11/2016 10:24 AM, Lu Baolu wrote: >> The only thing you can do to make this work is to prevent printing in NMI >> > context: >> > >> > write() >> > { >> >if (in_nmi()) >> >return; >> > >>

Re: [PATCH v4 1/4] usb: dbc: early driver for xhci debug capability

2016-11-10 Thread Lu Baolu
Hi, On 11/10/2016 04:56 PM, Thomas Gleixner wrote: > On Thu, 10 Nov 2016, Lu Baolu wrote: >> On 11/09/2016 05:37 PM, Thomas Gleixner wrote: >>> On Tue, 1 Nov 2016, Lu Baolu wrote: >>>> +static void early_xdbc_write(struct console *con, const char *str, u32 n)

[PATCH v2 1/1] usb: xhci: handle endpoint error caused by TRB error

2016-11-10 Thread Lu Baolu
rresponding USB device stays in unresponsive state. This patch enhances xHCI driver on this by printing out the malformed TRB and clearing the endpoint Error state. Tested-by: Wang Wendy Signed-off-by: Lu Baolu --- Change log: v1->v2: - Correct the email of Tested-by. drivers/usb/hos

<    3   4   5   6   7   8   9   10   11   12   >