Re: [PATCH 1/1] usb: xhci: cleanup cmd_completion in xhci_virt_device

2016-11-03 Thread Lu Baolu
Hi, On 11/03/2016 07:36 PM, Mathias Nyman wrote: > On 03.11.2016 12:22, Sergei Shtylyov wrote: >> On 11/3/2016 9:48 AM, Lu Baolu wrote: >> >>> cmd_completion in struct xhci_virt_device is legacy. With command >>> strutcture and command queue i

[PATCH 1/1] usb: xhci: remove the use of xhci->addr_dev

2016-11-01 Thread Lu Baolu
ver. It is time to get rid of addr_dev and use the completion in the command structure instead. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-mem.c | 1 - drivers/usb/host/xhci.c | 18 ++ drivers/usb/host/xhci.h | 1 - 3 files changed, 10 i

Re: [PATCH v17 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger

2016-10-10 Thread Lu Baolu
't usb_charger_exit() a better place? > The usb_charger_exit() will issue usb_charger_unregister() and we need > use the usb_charger structure in usb_charger_unregister() to > unregister the usb charger. > This seems not to be a strong reason. :-) You can unregister the charger first an

[PATCH 1/1] usb: dwc3: remove unused struct member dwc3->mem

2016-10-12 Thread Lu Baolu
Member @mem in struct dwc3 is not used in any places. Clean up it. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/dwc3/core.c | 1 - drivers/usb/dwc3/core.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 7

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

2017-01-12 Thread Lu Baolu
.ny...@linux.intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- 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/driv

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.in

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

2016-12-01 Thread Lu Baolu
_cmd. Cc: <sta...@vger.kernel.org> # v3.16+ Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- 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 10

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 <baolu...@linux.intel.com> wrote: >> Hi, >> >> On 12/01/2016 03:35 PM, Baolin Wang wrote: >>> On 1 December 2016 at 14:35, Lu Baolu <baolu...@linux.intel.com> wrote:

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: [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 <baolu...@linux.intel.com> wrote: >> Hi, >> >> On 11/30/2016 05:02 PM, Baolin Wang wrote: >>> If the hardware never responds to the stop endpoint com

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 <baolu...@linux.intel.com> wrote: >> Hi, >> >> On 12/01/2016 02:04 PM, Baolin Wang wrote: >>> Hi Baolu, >>> >>> On 1 December 2016 at 13:45, Lu Baolu <

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

2016-11-30 Thread Lu Baolu
e 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_time

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 <baolu...@linux.intel.com> wrote: >> handle_cmd_completion() frees a command structure which might >> be still referenced by xhci->current_cmd. This might cause >> problem when

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

2017-01-02 Thread Lu Baolu
sta...@vger.kernel.org> # v3.14+ Cc: Felipe Balbi <felipe.ba...@linux.intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- 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(-)

Re: [PATCH 4/4] usb: xhci: remove unnecessary return in xhci_pci_setup()

2017-01-04 Thread Lu Baolu
Hi, On 01/05/2017 02:12 AM, Andy Shevchenko wrote: > On Wed, Jan 4, 2017 at 3:51 AM, Lu Baolu <baolu...@linux.intel.com> wrote: >> Remove the unnecessary return line in xhci_pci_setup(). >> >> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> >> --- >&

[PATCH 1/4] usb: xhci: remove unnecessary assignment

2017-01-03 Thread Lu Baolu
Drop an unnecessary assignment in prepare_transfer(). Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-ring.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index bdf6b13..3cc303f 100644 --- a/d

[PATCH 2/4] usb: xhci: avoid unnecessary calculation

2017-01-03 Thread Lu Baolu
No need to calculate remainder and length_field, if there is no data phase of a control transfer. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-ring.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/usb/hos

[PATCH 3/4] usb: xhci: use list_is_singular for cmd_list

2017-01-03 Thread Lu Baolu
Use list_is_singular() to check if cmd_list has only one entry. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 9

[PATCH 4/4] usb: xhci: remove unnecessary return in xhci_pci_setup()

2017-01-03 Thread Lu Baolu
Remove the unnecessary return line in xhci_pci_setup(). Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-pci.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index e96ae80..ace3f57 100644 --- a/d

[PATCH 0/4] several cleanup patches

2017-01-03 Thread Lu Baolu
Hi Mathias, This series includes several tiny cleanup patches for xhci host controller driver. These make the code slightly more readable. There's no functional change. Please consider it for your for-usb-next branch. Best regards, Lu Baolu Lu Baolu (4): usb: xhci: remove unnecessary

Re: [PATCH 24/37] usb: host: xhci: use trb_to_noop() from xhci_handle_stopped_cmd_ring()

2016-12-31 Thread Lu Baolu
Hi, On 12/30/2016 03:54 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu <baolu...@linux.intel.com> writes: >> On 12/29/2016 07:00 PM, Felipe Balbi wrote: >>> instead of open coding how to convert a TRB to no-op, let's use our >>> newly introduced helper. >>

Re: [PATCH 09/37] usb: host: xhci: clear only STS_EINT

2016-12-31 Thread Lu Baolu
Hi, On 12/30/2016 03:52 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu <baolu...@linux.intel.com> writes: >> On 12/29/2016 07:00 PM, Felipe Balbi wrote: >>> Many other bits in USBSTS register are "clear-by-writing-1". Let's make >>> sure that we cl

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2016-12-31 Thread Lu Baolu
Hi, On 12/30/2016 03:47 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu <baolu...@linux.intel.com> writes: >>> +DEFINE_EVENT(xhci_log_trb, xhci_handle_event, >>> + TP_PROTO(struct xhci_ring *ring, struct xhci_generic_trb *trb), >>> + TP_ARGS(ring, trb) &g

Re: [PATCH 06/37] usb: host: xhci: WARN on unexpected COMP_SUCCESS

2016-12-29 Thread Lu Baolu
td->urb->ep->desc.bEndpointAddress, > - requested, remaining); > - } > + dev_WARN_ONCE(dev, (ep_trb != td->last_trb) || remaining, > + "ep%d%s: unexpected success! TRB %p/%p size > %d/%d\n&quo

Re: [PATCH 09/37] usb: host: xhci: clear only STS_EINT

2016-12-29 Thread Lu Baolu
temp = readl(>op_regs->status); 725 writel(temp & ~STS_EINT, >op_regs->status); I will correct these in a separated patch and cc stable as well. Best regards, Lu Baolu > > Signed-off-by: Felipe Balbi <felipe.ba...@linux.intel.com> > --- > drivers/usb/ho

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2016-12-29 Thread Lu Baolu
rb) > +); > + > +DEFINE_EVENT(xhci_log_trb, xhci_handle_command, > + TP_PROTO(struct xhci_ring *ring, struct xhci_generic_trb *trb), > + TP_ARGS(ring, trb) > +); > + > +DEFINE_EVENT(xhci_log_trb, xhci_handle_transfer, > + TP_PROTO(struct xhci_ring *ring, struct x

Re: [PATCH 24/37] usb: host: xhci: use trb_to_noop() from xhci_handle_stopped_cmd_ring()

2016-12-29 Thread Lu Baolu
b->generic.field[0] = 0; > + trb->generic.field[1] = 0; > + trb->generic.field[2] = 0; > + /* Preserve only the cycle bit of this TRB */ > + trb->generic.field[3] &= cpu_to_le32(TRB_CYCLE); > + trb->generic.field[3]

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

2016-12-29 Thread Lu Baolu
sta...@vger.kernel.org> # v3.14+ CC: Felipe Balbi <felipe.ba...@linux.intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- 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 1cd56

Re: [PATCH 09/37] usb: host: xhci: clear only STS_EINT

2017-01-02 Thread Lu Baolu
Hi, On 01/02/2017 04:47 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu <baolu...@linux.intel.com> writes: >> Hi, >> >> On 12/30/2016 03:52 PM, Felipe Balbi wrote: >>> Hi, >>> >>> Lu Baolu <baolu...@linux.intel.com> writes: >

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2017-01-02 Thread Lu Baolu
Hi, On 01/02/2017 04:53 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu <baolu...@linux.intel.com> writes: >> Hi, >> >> On 12/30/2016 03:47 PM, Felipe Balbi wrote: >>> Hi, >>> >>> Lu Baolu <baolu...@linux.intel.com> writes: >>&g

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 <baolu...@linux.intel.com> wrote: >> Hi, >> >> On 12/20/2016 02:06 PM, Baolin Wang wrote: >>> Hi, >>> >>> On 20 December 2016 at 12:29, Lu B

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

2016-12-19 Thread Lu Baolu
mand 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 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

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 <baolu...@linux.intel.com> wrote: >> Hi Mathias, >> >> On 12/19/2016 08:13 PM, Mathias Nyman wrote: >>> On 19.12.2016 13:34, Baolin Wang wrote: >>>&

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

2016-12-20 Thread Lu Baolu
} else { 370 unsigned long flags; 371 372 spin_lock_irqsave(>lock, flags); 373 xhci_handle_stopped_cmd_ring(xhci, xhci_next_queued_cmd(xhci)); 374 spin_unlock_irqrestore(>lock, flags); 375 } 376 return 0; 377 } Best regards, Lu Baolu -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

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

2016-12-20 Thread Lu Baolu
ved up to line 1295. 1323 1324 /* command timeout on stopped ring, ring can't be aborted */ 1325 xhci_dbg(xhci, "Command timeout on stopped ring\n"); 1326 xhci_handle_stopped_cmd_ring(xhci, xhci->current_cmd); 1327 spin_unlock_irqrestore(>lock, flags);

[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: hold

[PATCH 0/4] refactor command timeout handling

2016-12-22 Thread Lu Baolu
it 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

[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 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 <mathias.ny...@linux.intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> ---

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

2016-12-22 Thread Lu Baolu
rmal hosts, 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 <baolu...@linux.intel.com> --- drivers/usb/host/xhci-ring.c | 17 + drivers/usb/host/xhci.h | 6 ++ 2 f

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

2016-12-22 Thread Lu Baolu
the 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 <baolu...@linux.intel.com> --- drivers/usb/host/xhci-ring.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff

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

2016-12-22 Thread Lu Baolu
ues of calling functions without locking in xhci_handle_command_timeout(). Cc: <sta...@vger.kernel.org> # 3.7+ Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-ring.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/driver

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

2016-12-22 Thread Lu Baolu
would be easily extend to add 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: <sta...@vger.kernel.org> Signed-off-by: OGAWA Hirofumi <hirof...@mail.parknet.co.jp> Signed-of

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

2016-12-22 Thread Lu Baolu
uring 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/xhci

Re: [PATCH 0/2] Intel cherrytrail xhci extended cap phy/mux support

2016-12-22 Thread Lu Baolu
re :-) Let's get Greg and Oliver to agree though. > >> About the "other 2-patch dwc3 series", I'm fine with you not taking >> the IDA patch, but the first patch is unrelated to IDA, it is a pure >> bug-fix and really should be upstreamed. > right, th

Re: [PATCH 0/2] Intel cherrytrail xhci extended cap phy/mux support

2016-12-22 Thread Lu Baolu
it is a pure >>> bug-fix and really should be upstreamed. >>> >>> Matthias, assuming Felipe is ok with putting this in drivers/misc >>> (minus the phy bindings), are you ok with the xhci blurb which >>> registers the platform-device for the "misc"

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 <baolin.w...@linaro.org> > --- > drivers/usb/dwc3/gadget.c |6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/dr

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 <baolu...@linux.intel.com> wrote: >> Hi, >> >> On 12/26/2016 04:01 PM, Baolin Wang wrote: >>> On some platfroms(like x86 platform), when one core is running

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-21 Thread Lu Baolu
ci_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 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/2] phy: Add new Intel Cherrytrail USB OTG phy driver

2016-12-22 Thread Lu Baolu
rm_get_resource(pdev, IORESOURCE_MEM, 0); > + size = (res->end + 1) - res->start; "res" is used without check. > + phy->base = devm_ioremap_nocache(dev, res->start, size); This resource is part of xHCI MMIO. xHCI driver has already declared to use the whole memory space. I

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2017-01-15 Thread Lu Baolu
sprintf(str, "%s: deq %08x%08x stream %d slot %d ep %d flags > %c", > + xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)), > + field1, field0, > + TRB_TO_STREAM_ID(field2), > +

Re: extcon-usb-gpio ACPI support

2017-03-21 Thread Lu Baolu
ins device enumerated by this > driver? > 2. If "yes" on 1, does that DSDT contain _DSD method for the device? > 3. If "no" on 2, how is it supposed to work at all? > > So, regarding on the answers, I am in between of reverting > > commit 942c7924a51edb75baf8056

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

2017-03-21 Thread Lu Baolu
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 <mi...@redhat.com> Cc: Mathias Nyman <mathias.ny...@linux.intel.com> Signed-off-by: Lu

[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 <baolu...@linux.intel.com> Acked-by: Johan Hovold <jo...@kernel.org> --- drivers/usb/serial/usb_debug.c | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-)

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

2017-03-21 Thread Lu Baolu
1->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 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 <baolu...@linux.intel.com> --- Documentation/usb/usb3-debug-port.rst | 100 ++ 1 file change

[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 <mi...@redhat.com> Cc: x...@kernel.org Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- Documentation/admin-guide/kernel-parameters.txt

[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 <mi...@redhat.com> Cc: x...@kernel.org Signed-off-by: Lu Baolu

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 <baolu...@linux.intel.com> wrote: > >> Hi Ingo, >> >> On 03/02/2017 02:40 PM, Ingo Molnar wrote: >>> * Lu Baolu <baolu...@linux.intel.com> wrote: >>> >>>> Hi Ingo

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

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 <baolu...@linux.intel.com> 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

[PATCH 1/1] usb: xhci: Free the right ring in xhci_add_endpoint()

2017-07-31 Thread Lu Baolu
In the xhci_add_endpoint(), a new ring was allocated and saved at xhci_virt_ep->new_ring. Hence, when error happens, we need to free the allocated ring before returning error. Current code frees xhci_virt_ep->ring instead of the new_ring. This patch fixes this. Signed-off-by: Lu Baolu

[PATCH 1/1] usb: xhci: Add debugfs interface for xHCI driver

2017-07-29 Thread Lu Baolu
___enqueue <[ring enqueue pointer] |______trbs <---[ring trbs] Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/Makefile | 4 + drivers/usb/host/xhci-debugfs.c | 552

Re: [PATCH 1/1] usb: xhci: Add debugfs interface for xHCI driver

2017-07-29 Thread Lu Baolu
Hi Greg, On 07/29/2017 09:34 PM, Greg KH wrote: > On Sat, Jul 29, 2017 at 04:18:03PM +0800, Lu Baolu wrote: >> +static void xhci_debugfs_create_files(struct xhci_hcd *xhci, >> + struct xhci_file_map *files, >> +

Re: [PATCH v3 5/5] usb: xhci: Handle USB transaction error on address command

2017-08-15 Thread Lu Baolu
Hi, On 08/15/2017 07:30 PM, Mathias Nyman wrote: > On 11.08.2017 05:41, Lu Baolu wrote: >> Xhci driver handles USB transaction errors on transfer events, >> but transaction errors are possible on address device command >> completion events as well. >> >> The

[PATCH v4 2/5] usb: xhci: Fix potential memory leak in xhci_disable_slot()

2017-08-16 Thread Lu Baolu
m> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-hub.c | 2 +- drivers/usb/host/xhci.c | 30 +- drivers/usb/host/xhci.h | 3 +-- 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b

[PATCH v4 4/5] usb: xhci: Return error when host is dead in xhci_disable_slot()

2017-08-16 Thread Lu Baolu
to a dead host. Fixes: f9e609b82479 ("usb: xhci: Add helper function xhci_disable_slot().") Cc: Guoqing Zhang <guoqing.zh...@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --

[PATCH v4 3/5] usb: xhci: Fix memory leak when xhci_disable_slot() returns error

2017-08-16 Thread Lu Baolu
the responsibilities to free the slot related data structure. Otherwise, memory leakage happens. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/

[PATCH v4 5/5] usb: xhci: Handle USB transaction error on address command

2017-08-16 Thread Lu Baolu
/?l=linux-usb=149362010728921=2 http://marc.info/?l=linux-usb=149252752825755=2 Suggested-by: Mathias Nyman <mathias.ny...@linux.intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/driv

[PATCH v4 0/5] usb: xhci: Handle USB transaction error on address command

2017-08-16 Thread Lu Baolu
ecking virt dev for test mode in PATCH 1/5. v3->v4: - Resolve xhci->mutex locking issue in 5/5. Lu Baolu (5): usb: xhci: Disable slot even virt-dev is null usb: xhci: Fix potential memory leak in xhci_disable_slot() usb: xhci: Fix memory leak when xhci_disable_slot() returns error

[PATCH v4 1/5] usb: xhci: Disable slot even virt-dev is null

2017-08-16 Thread Lu Baolu
c: Guoqing Zhang <guoqing.zh...@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-hub.c | 3 +++ drivers/usb/host/xhci.c | 4 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xh

[PATCH v3 2/5] usb: xhci: Fix potential memory leak in xhci_disable_slot()

2017-08-10 Thread Lu Baolu
m> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-hub.c | 2 +- drivers/usb/host/xhci.c | 30 +- drivers/usb/host/xhci.h | 3 +-- 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b

[PATCH v3 4/5] usb: xhci: Return error when host is dead in xhci_disable_slot()

2017-08-10 Thread Lu Baolu
to a dead host. Fixes: f9e609b82479 ("usb: xhci: Add helper function xhci_disable_slot().") Cc: Guoqing Zhang <guoqing.zh...@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --

[PATCH v3 0/5] usb: xhci: Handle USB transaction error on address command

2017-08-10 Thread Lu Baolu
ecking virt dev for test mode in PATCH 1/5. Lu Baolu (5): usb: xhci: Disable slot even virt-dev is null usb: xhci: Fix potential memory leak in xhci_disable_slot() usb: xhci: Fix memory leak when xhci_disable_slot() returns error usb: xhci: Return error when host is dead in xhci_disabl

[PATCH v3 3/5] usb: xhci: Fix memory leak when xhci_disable_slot() returns error

2017-08-10 Thread Lu Baolu
the responsibilities to free the slot related data structure. Otherwise, memory leakage happens. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/

[PATCH v3 1/5] usb: xhci: Disable slot even virt-dev is null

2017-08-10 Thread Lu Baolu
c: Guoqing Zhang <guoqing.zh...@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-hub.c | 3 +++ drivers/usb/host/xhci.c | 4 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xh

[PATCH v3 5/5] usb: xhci: Handle USB transaction error on address command

2017-08-10 Thread Lu Baolu
/?l=linux-usb=149362010728921=2 http://marc.info/?l=linux-usb=149252752825755=2 Suggested-by: Mathias Nyman <mathias.ny...@linux.intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 5 + 1 file changed, 5 insertions(+) diff --git a/driv

Re: [PATCH v2 1/5] usb: xhci: Disable slot even virt-dev is null

2017-08-10 Thread Lu Baolu
Hi, On 08/10/2017 06:00 PM, Mathias Nyman wrote: > On 10.08.2017 03:35, Lu Baolu wrote: >> Hi, >> >> On 08/09/2017 03:58 PM, Mathias Nyman wrote: >>> On 27.07.2017 05:21, Lu Baolu wrote: >>>> xhci_disable_slot() is a helper for disabling a slot when a de

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

2017-07-12 Thread Lu Baolu
Hi, On 07/12/2017 04:02 PM, Dou Liyang wrote: > Hi, Lu > > At 05/05/2017 08:50 PM, Boris Ostrovsky wrote: >> On 05/05/2017 01:41 AM, Lu Baolu wrote: >>> Hi, >>> >>> On 05/03/2017 06:38 AM, Boris Ostrovsky wrote: >>>> On 03/21/2017 04:01 AM,

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

2017-07-12 Thread Lu Baolu
Hi, On 07/13/2017 09:39 AM, Dou Liyang wrote: > Hi, Lu > > At 07/13/2017 09:17 AM, Lu Baolu wrote: >> Hi, >> >> On 07/12/2017 04:02 PM, Dou Liyang wrote: >>> Hi, Lu >>> >>> At 05/05/2017 08:50 PM, Boris Ostrovsky wrote: >>>> On 0

[PATCH 1/3] usb: xhci: Make some static functions global

2017-07-21 Thread Lu Baolu
This patch makes some static functions global to avoid duplications in different files. These functions can be used in the implementation of xHCI debug capability. There is no functional change. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-mem.c

[PATCH 2/3] usb: xhci: Add DbC support in xHCI driver

2017-07-21 Thread Lu Baolu
. Hence it can be remote accessed by a debug host. Another use case can probably be found in servers. It provides a peer-to-peer USB link between two host-only machines. This provides a reasonable out-of-band communication method between two servers. Signed-off-by: Lu Baolu <baolu...@linux.intel.

[PATCH 0/3] usb: xhci: Add debug capability support in xhci

2017-07-21 Thread Lu Baolu
communication method between two servers. Best regards, Lu Baolu Lu Baolu (3): usb: xhci: Make some static functions global usb: xhci: Add DbC support in xHCI driver usb: doc: Update document for USB3 debug port usage .../ABI/testing/sysfs-bus-pci-drivers-xhci_hcd | 25

[PATCH 3/3] usb: doc: Update document for USB3 debug port usage

2017-07-21 Thread Lu Baolu
Update Documentation/driver-api/usb/usb3-debug-port.rst. This update includes the guide for using xHCI debug capability based TTY serial link. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- Documentation/driver-api/usb/usb3-debug-port.rst | 68 1 file chang

Re: [PATCH 2/3] usb: xhci: Add DbC support in xHCI driver

2017-07-23 Thread Lu Baolu
Hi Felipe, On 07/21/2017 06:31 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu <baolu...@linux.intel.com> writes: >> +static void xhci_dbc_stop(struct xhci_hcd *xhci) >> +{ >> +struct xhci_dbc *dbc = xhci->dbc; >> + >> +WARN_ON(!dbc); &

[PATCH 1/1] usb: xhci: Handle USB transaction error on address command

2017-07-24 Thread Lu Baolu
/?l=linux-usb=149362010728921=2 http://marc.info/?l=linux-usb=149252752825755=2 Suggested-by: Mathias Nyman <mathias.ny...@linux.intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/driv

Re: [PATCH v2 5/5] usb: xhci: Handle USB transaction error on address command

2017-07-27 Thread Lu Baolu
Hi, On 07/27/2017 03:55 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu <baolu...@linux.intel.com> writes: >> Xhci driver handles USB transaction errors on transfer events, >> but transaction errors are possible on address device command >> completion events as w

Re: [PATCH 1/1] usb: xhci: Handle USB transaction error on address command

2017-07-25 Thread Lu Baolu
Hi, On 07/26/2017 01:11 PM, Xing, Zhengjun wrote: > > > On 7/25/2017 1:09 PM, Lu Baolu wrote: >> Xhci driver handles USB transaction errors on transfer events, >> but transaction errors are possible on address device command >> completion events as well. >> &

[PATCH v2 2/5] usb: xhci: Fix potential memory leak in xhci_disable_slot()

2017-07-26 Thread Lu Baolu
m> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-hub.c | 2 +- drivers/usb/host/xhci.c | 30 +- drivers/usb/host/xhci.h | 3 +-- 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b

[PATCH v2 4/5] usb: xhci: Return error when host is dead in xhci_disable_slot()

2017-07-26 Thread Lu Baolu
to a dead host. Fixes: f9e609b82479 ("usb: xhci: Add helper function xhci_disable_slot().") Cc: Guoqing Zhang <guoqing.zh...@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --

[PATCH v2 1/5] usb: xhci: Disable slot even virt-dev is null

2017-07-26 Thread Lu Baolu
c: Guoqing Zhang <guoqing.zh...@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index b2ff1ff..e69073f 100644 --- a/drivers/usb/host/xhci.c

[PATCH v2 5/5] usb: xhci: Handle USB transaction error on address command

2017-07-26 Thread Lu Baolu
/?l=linux-usb=149362010728921=2 http://marc.info/?l=linux-usb=149252752825755=2 Suggested-by: Mathias Nyman <mathias.ny...@linux.intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 5 + 1 file changed, 5 insertions(+) diff --git a/driv

[PATCH v2 3/5] usb: xhci: Fix memory leak when xhci_disable_slot() returns error

2017-07-26 Thread Lu Baolu
the responsibilities to free the slot related data structure. Otherwise, memory leakage happens. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/

[PATCH v2 0/5] usb: xhci: Handle USB transaction error on address command

2017-07-26 Thread Lu Baolu
This patch set includes some fixes in xhci_disable_slot() as well which will be used to handle USB transaction error on address command. --- Change log: v1->v2: - include 4 fixes in xhci_disable_slot which will be used to handle USB transaction error on address command. Lu Baolu (5):

Re: [PATCH v2 2/4] usb: common: Move u_serial from gadget/function to usb/common

2017-08-07 Thread Lu Baolu
Hi, On 08/07/2017 04:13 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu <baolu...@linux.intel.com> writes: >> The component u_serial provides a glue layer between TTY layer >> and a USB gadget device needed to provide a basic serial port >> functionality. Currently, u_

Re: [PATCH v2 2/4] usb: common: Move u_serial from gadget/function to usb/common

2017-08-08 Thread Lu Baolu
Hi, On 08/08/2017 02:14 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu <baolu...@linux.intel.com> writes: >>> Lu Baolu <baolu...@linux.intel.com> writes: >>>> The component u_serial provides a glue layer between TTY layer >>>> and a U

[PATCH v2 1/1] usb: xhci: Add debugfs interface for xHCI driver

2017-08-01 Thread Lu Baolu
___enqueue <[ring enqueue pointer] |______trbs <---[ring trbs] Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- Change log: v1->v2: - No need to check return valuse of debugfs interfaces. - Remove file entries when adding e

Re: [PATCH v2 1/5] usb: xhci: Disable slot even virt-dev is null

2017-08-09 Thread Lu Baolu
Hi, On 08/09/2017 03:58 PM, Mathias Nyman wrote: > On 27.07.2017 05:21, Lu Baolu wrote: >> xhci_disable_slot() is a helper for disabling a slot when a device >> goes away or recovers from error situations. Currently, it checks >> the corespoding virt-dev pointer and returns

<    1   2   3   4   5   6   7   >