On Tue, 2016-12-27 at 21:19 -0500, Alan Stern wrote:
> On Tue, 27 Dec 2016, George Cherian wrote:
> > True. I am afraid that there necessarily is a window for resetting a
> > disconnected device. But the check you proposed is better.
> > however, I'd like to encapsulate that together with a test f
Instead of always defaulting to a 256-entry array,
we can dynamically allocate devs based on what HW
tells us it supports.
Note that we can't, yet, purge MAX_HC_SLOTS
completely because of struct
xhci_device_context_array reliance on it.
Signed-off-by: Felipe Balbi
---
Changes since v1:
Hi Mathias,
Here's a resend of my previous series. This time I've added a few more
patches which I have been working on and also cherry-pick three old
patches which have been pending since May this year.
Note, in particular, the work done for XHCI tracers which will help us a
lot on debugging ses
Many other bits in USBSTS register are "clear-by-writing-1". Let's make
sure that we clear *only* STS_EINT and not any of the other bits as they
might be needed later.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
Stop Endpoint command can come at any point and we
have no control of that. We should make sure to
handle COMP_STOP on SETUP phase as well, otherwise
urb->actual_lenght might be set to negative values
in some occasions such as below:
urb->length = 4;
build_control_transfer_td_for(urb, ep);
COMP_SUCCESS should only be asserted on a *true* sucessful transfer. Any
other cases are bogus and we should aim to catch them. One easy way to
get bug reports is to trigger a WARN_ONCE() on such cases.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 28 +++
Instead of having several return points, let's use a local variable and
a single place to return. This makes the code slightly easier to read.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 31 ---
1 file changed, 16 insertions(+), 15 deletions(-)
dif
it does no good, let's remove it.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ext-caps.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-ext-caps.h b/drivers/usb/host/xhci-ext-caps.h
index e0244fb3903d..28deea584884 100644
--- a/drivers/usb/hos
If we get an interrupt while we don't have an allocated event_ring, that
means we're enabling IRQs far too early. Instead of just printing an
error message, let's make sure to add a scary-looking Stack Trace so
people report these things and we fix them.
Eventually, when we're happy that this does
When calling xhci_dbg_regs() we actually _do_ want to know XHCI's
version. This might help figure out why certain problems only happen
in some cases.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-dbg.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/usb/host/xhci-dbg.c b/dri
Cleanup only. This patch is a mechaninal rename to make sure our macros
for TRB completion codes match what the specification uses to refer to
such errors. The idea behind this is that it makes it far easier to grep
the specification and match it with implementation.
Signed-off-by: Felipe Balbi
-
Replace list_entry() with list_first_entry() and list_for_each() with
list_for_each_entry(). This makes the code slightly more readable.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/h
This is a cleanup patch only, no functional changes. The idea is just to
make sure for loops look the same all over the driver.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-dbg.c | 20 ++--
drivers/usb/host/xhci-mem.c | 10 +-
drivers/usb/host/xhci.c | 14 +++
Now that finish_td() is the only place calling
xhci_requires_manual_halt_cleanup() we can remove that function and use
that to cleanup finish_td() by converting it into a switch statement
using trb_comp_code.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 59 +++--
process_ctrl_td() is too complex and difficult to read. We can clean it
up a lot and maintain same functionality as before. Note that while
cleaning up, one comment was introduced to explain the special case - it
wasn't clear before from code.
Much of the changes are related to removal of duplicat
Similar to previous patch on process_ctrl_td(), we can also clean up
process_bulk_intr_td() and turn it into an easier to read and maintain
function.
This patch shuffles code around, defines each variable in one line,
removes unnecessary debugging messages and an unnecessary goto
statement.
Signe
no functional changes. Simple cleanup to make sure variables are ordered
in a 'reverse christmas tree' fashion. While at that, also remove an
obsolete comment which doesn't apply anymore.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 12
1 file changed, 4 insertions
By extracting xhci_td_cleanup() from finish_td(), code before clearer
and easier to follow.
There are no functional changes with this patch. It's merely a cleanup.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 92
1 file changed, 50
xhci_unmap_td_bounce_buffer() already checks for a valid td->bounce_seg
and bails out early if that's invalid. There's no need to check for this
twice.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/driver
This way we can remove checks for valid ring from call sites of
xhci_unmap_td_bounce_buffer()
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index a6a9363
handle_tx_event() is not releasing xhci->lock nor reacquiring it, remove
the bogus annotation.
Signed-off-by: Felipe Balbi
---
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 19647b8aa8a1..a6a9363
Let's start tracing at least part of an xhci_virt_device lifetime. We
might want to extend this tracepoint class later, but for now it already
exposes quite a bit of valuable information.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-hub.c | 2 ++
drivers/usb/host/xhci-mem.c | 7 ++
In order to make xhci_hub_control() easier to read,
let's break it into smaller functions. This will aid
maintainability and readability of the code. There
are no functional changes here, just shuffling code
around.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-hub.c | 652 ++
Instead of *always* allocating an array of 256 pointers, we can
dynamically allocate it based on number of maximum slots $this XHCI
implementation supports.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-mem.c | 45 ++---
drivers/usb/host/xhci.h
trb_in_td() has a single user in the same file where it is defined,
there's no need to expose it anywhere else.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 2 +-
drivers/usb/host/xhci.h | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/usb/host
If we just provide a helper to convert completion code to string, we can
combine all debugging messages into a single print.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 28
drivers/usb/host/xhci.h | 80
2 files
when getting endpoint type, a switch statement looks
better than a series of if () branches. There are no
functional changes with this patch, cleanup only.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-mem.c | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/d
If we add that newline, the output will like like the following:
kworker/2:1-42[002] 169.811435: xhci_address_ctx:
ctx_64=0, ctx_type=2, ctx_dma=@153fbd000, ctx_va=@880153fbd000
We would rather have that in a single line.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhc
Instead of fixing actual_length and setting status to 0, let's make sure
the error is propagated and we print a big scary stack trace so errors
are reported and we have a chance of fixing them.
While at that, also remove unnecessary initialization of urb variable.
Signed-off-by: Felipe Balbi
---
instead of open coding how to convert a TRB to no-op, let's use our
newly introduced helper.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 33 +++--
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers
the _safe() version of list iterators are supposed to be used when
list_entry is going to be removed from the list while iterating. Since
xhci_handle_stopped_cmd_ring() is not removing anything from the list,
just converting commands into No-Op TRBs, we don't need to use the safe
version.
Signed-o
It's unlikely that we will ever know the avg so
instead of assuming it'll be something really large,
we will calculate the avg as we go as mentioned in
XHCI specification section 4.14.1.1.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-mem.c | 34 --
drive
These three new tracers will help us tie TRBs into URBs by *also*
looking into URB lifetime.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 1 +
drivers/usb/host/xhci-trace.h | 70 +++
drivers/usb/host/xhci.c | 5
3 files chan
By just replacing xhci_warn() with xhci_dbg() we can get rid of the
extra argument.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-mem.c | 5 ++---
drivers/usb/host/xhci-ring.c | 10 --
drivers/usb/host/xhci.h | 2 +-
3 files changed, 7 insertions(+), 10 deletions(-)
diff
instead of having a tracer that can only trace command completions,
let's promote this tracer so it can trace and decode any TRB.
With that, it will be easier to extrapolate the lifetime of any TRB
which might help debugging certain issues.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-
trb_in_td() has the task of checking whether a given TRB belongs to a
given TD. Currently implementation is far too complex and used wrongly
in some places.
Let's simplify the implementation to the point that we can assume it to
be working always, this means we can remove xhci_test_trb_in_td() and
instead of using while(!list_empty()) followed by list_first_entry(), we
can actually use list_for_each_entry_safe().
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/dr
this will be used in several places to convert a single TRB into
No-Op. No functional changes in this patch.
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 39 +++
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/host
extract __trb_to_noop() to avoid a minor duplication
of code in trb_to_noop().
Signed-off-by: Felipe Balbi
---
drivers/usb/host/xhci-ring.c | 24
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
i
From: Rafał Miłecki
Some LEDs can be related to particular USB ports (common case for home
routers). This property allows describing such a relation.
Signed-off-by: Rafał Miłecki
---
This patch is based on top of commit 52e847dc431 ("DT: leds: Improve examples
by adding some context") sitting i
From: Rafał Miłecki
This adds support for using description of relation between LEDs and USB
ports from device tree. If device has a properly described LEDs, trigger
will know when to turn them on.
Signed-off-by: Rafał Miłecki
---
drivers/usb/core/ledtrig-usbport.c | 54 +++
From: Rafał Miłecki
Signed-off-by: Rafał Miłecki
---
This patch was tested & works as expected. It's marked as EXAMPLE just
because it should go through ARM tree.
---
arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/bcm47189-tenda-ac
On Mon, 19 Dec 2016 14:56:00 -0600
Bin Liu wrote:
> On Fri, Dec 16, 2016 at 07:19:39PM -0500, Jérémy Lefaure wrote:
> > When CONFIG_PM_SLEEP is disabled, SIMPLE_DEV_PM_OPS does not use
> > bfin_resume and bfin_suspend even if CONFIG_PM is enabled:
> >
> > drivers/usb/musb/blackfin.c:602:12: warn
This fixes a regression which was introduced by commit f1bddbb, by
reverting a small fragment of commit 855ed04.
If the following conditions were met, usb_gadget_probe_driver() returned
0, although the call was unsuccessful:
1. A particular UDC was specified by thge gadget driver (using member
"ud
Hi,
On 12/29/2016 07:00 PM, Felipe Balbi wrote:
> COMP_SUCCESS should only be asserted on a *true* sucessful transfer. Any
> other cases are bogus and we should aim to catch them. One easy way to
> get bug reports is to trigger a WARN_ONCE() on such cases.
>
> Signed-off-by: Felipe Balbi
> ---
>
Hi,
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 clear *only* STS_EINT and not any of the other bits as they
> might be needed later.
Bit 13~31 in status register is for RsvdP (Reserved and Preserved).
This me
Hi,
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.
>
> Signed-off-by: Felipe Balbi
> ---
> drivers/usb/host/xhci-ring.c | 33 +++--
> 1 file changed, 23 insertions(+), 10 del
Hi,
On 12/29/2016 07:01 PM, Felipe Balbi wrote:
> instead of having a tracer that can only trace command completions,
> let's promote this tracer so it can trace and decode any TRB.
>
> With that, it will be easier to extrapolate the lifetime of any TRB
> which might help debugging certain issues.
Hi Felipe,
On 2016년 12월 02일 18:03, Felipe Balbi wrote:
>
> Hi,
>
> Chanwoo Choi writes:
>> Hi Felipe,
>>
>> On 2016년 11월 30일 19:36, Felipe Balbi wrote:
>>>
>>> Hi,
>>>
>>> Chanwoo Choi writes:
This patch uses the resource-managed extcon API for
extcon_register_notifier()
and re
This patch replaces the deprecated extcon API as following:
- extcon_set_cable_state_() -> extcon_set_state_sync()
Signed-off-by: Chanwoo Choi
Acked-by: Felipe Balbi
---
drivers/usb/phy/phy-tahvo.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/phy/ph
This patch uses the resource-managed extcon API for extcon_register_notifier()
and replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()
Signed-off-by: Chanwoo Choi
Acked-by: Felipe Balbi
---
drivers/usb/phy/phy-omap-otg.c | 24 ++
This patch uses the resource-managed extcon API for extcon_register_notifier()
and replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()
Signed-off-by: Chanwoo Choi
Acked-by: Felipe Balbi
---
drivers/usb/phy/phy-qcom-8x16-usb.c | 13 -
1
This patch replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()
Cc: Rob Herring
Cc: Geert Uytterhoeven
Signed-off-by: Chanwoo Choi
Acked-by: Felipe Balbi
Acked-by: Yoshihiro Shimoda
---
drivers/usb/renesas_usbhs/common.c | 2 +-
1 file changed, 1
This patches just replace the deprecated extcon API without any change
of extcon operation and use the resource-managed function for
extcon_register_notifier().
The new extcon API instead of deprecated API.
- extcon_set_cable_state_() -> extcon_set_state_sync();
- extcon_get_cable_state_() -> extc
This patch uses the resource-managed extcon API for extcon_register_notifier()
and replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()
Signed-off-by: Chanwoo Choi
Acked-by: Felipe Balbi
---
drivers/usb/dwc3/dwc3-omap.c | 20 +++-
1
This patch uses the resource-managed extcon API for extcon_register_notifier()
and replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()
Cc: Peter Chen
Signed-off-by: Chanwoo Choi
---
Changes from v1:
- Rebase these patches based on v4.10-rc1.
- Drop
This patch uses the resource-managed extcon API for extcon_register_notifier()
and replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()
Signed-off-by: Chanwoo Choi
Acked-by: Felipe Balbi
---
drivers/usb/phy/phy-msm-usb.c | 33 +++
This patch just uses the resource-managed extcon API when registering
the extcon notifier.
Signed-off-by: Chanwoo Choi
Acked-by: Maxime Ripard
Acked-by: Bin Liu
---
Changes from v1:
- Rebase this patch based on v4.10-rc1.
- Add acked-by tag from Maxime Ripard and Bin Lin.
- Drop the phy/power-s
EINT(Event Interrupt) is a write-1-to-clear type of bit in xhci
status register. It should be cleared by writing a 1. Writing 0
to this bit has no effect.
Xhci driver tries to clear this bit by writing 0 to it. This is
not the right way to go. This patch corrects this by reading the
register first
Hi Lu,
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v4.10-rc1 next-20161224]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system]
url:
https://github.com/0day-ci/linux/commits/Lu-Baolu/usb-xhci-clear-EINT-bit-in-status
Hi Lu,
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v4.10-rc1 next-20161224]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system]
url:
https://github.com/0day-ci/linux/commits/Lu-Baolu/usb-xhci-clear-EINT-bit-in-status
Hi Felipe,
On 2016년 12월 30일 11:46, Chanwoo Choi wrote:
> Hi Felipe,
>
> On 2016년 12월 02일 18:03, Felipe Balbi wrote:
>>
>> Hi,
>>
>> Chanwoo Choi writes:
>>> Hi Felipe,
>>>
>>> On 2016년 11월 30일 19:36, Felipe Balbi wrote:
Hi,
Chanwoo Choi writes:
> This patch uses the reso
Hi,
Lu Baolu writes:
>> +DEFINE_EVENT(xhci_log_trb, xhci_handle_event,
>> +TP_PROTO(struct xhci_ring *ring, struct xhci_generic_trb *trb),
>> +TP_ARGS(ring, trb)
>> +);
>> +
>> +DEFINE_EVENT(xhci_log_trb, xhci_handle_command,
>> +TP_PROTO(struct xhci_ring *ring, struct xhci_generic_t
Hi,
Lu Baolu writes:
> On 12/29/2016 07:00 PM, Felipe Balbi wrote:
>> COMP_SUCCESS should only be asserted on a *true* sucessful transfer. Any
>> other cases are bogus and we should aim to catch them. One easy way to
>> get bug reports is to trigger a WARN_ONCE() on such cases.
>>
>> Signed-off-
Hi,
Lu Baolu 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 clear *only* STS_EINT and not any of the other bits as they
>> might be needed later.
>
> Bit 13~31 in status register is for RsvdP (Reser
Hi,
Lu Baolu 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.
>>
>> Signed-off-by: Felipe Balbi
>> ---
>> drivers/usb/host/xhci-ring.c | 33 +++--
>> 1 file chang
66 matches
Mail list logo