Re: xHCI regression for VIA USB 3.0 controller in handle_cmd_completion

2014-05-30 Thread Xenia Ragiadakou
On 30/05/2014 04:13 πμ, Saran Neti wrote: Hi Xenia, Thanks for looking into this. On Thu, May 29, 2014 at 6:31 PM, Xenia Ragiadakou burzalod...@gmail.com wrote: I misunderstood the following description regarding the slot id field of Command Completion Event TRB: The Slot ID field shall

Re: xHCI regression for VIA USB 3.0 controller in handle_cmd_completion

2014-05-29 Thread Xenia Ragiadakou
it out of command # git show 20e7acb13ff48fbc884d5918c3697c27de63922a commit 20e7acb13ff48fbc884d5918c3697c27de63922a Author: Xenia Ragiadakou burzalod...@gmail.com mailto:burzalod...@gmail.com Date: Mon Sep 9 13:29:50 2013 +0300 xhci: use completion event's slot id rather than dig it out

Re: xhci regression since xhci: replace xhci_write_64() with writeq() - devices not detected

2014-01-30 Thread Xenia Ragiadakou
On 30/01/2014 11:21 πμ, Rafał Miłecki wrote: 2014-01-29 Xenia Ragiadakou burzalod...@gmail.com: Rafał is it possible to send all the bad output with xhci debugging on? Since your config file shows that dynamic debugging is on, that would be easy to do by adding dyndbg='module xhci_hcd +p

Re: xhci regression since xhci: replace xhci_write_64() with writeq() - devices not detected

2014-01-30 Thread Xenia Ragiadakou
On 30/01/2014 12:00 πμ, Sarah Sharp wrote: On Wed, Jan 29, 2014 at 12:50:04PM +0200, Xenia Ragiadakou wrote: On 29/01/2014 12:08 μμ, Rafał Miłecki wrote: I've enabled some debugging in xhci-dbg.c, does it help? xhci_hcd :04:00.0: xHCI capability registers at c90004e6: xhci_hcd

Re: xhci regression since xhci: replace xhci_write_64() with writeq() - devices not detected

2014-01-30 Thread Xenia Ragiadakou
On 30/01/2014 07:42 μμ, Xenia Ragiadakou wrote: On 30/01/2014 12:00 πμ, Sarah Sharp wrote: On Wed, Jan 29, 2014 at 12:50:04PM +0200, Xenia Ragiadakou wrote: On 29/01/2014 12:08 μμ, Rafał Miłecki wrote: I've enabled some debugging in xhci-dbg.c, does it help? xhci_hcd :04:00.0: xHCI

Re: xhci regression since xhci: replace xhci_write_64() with writeq() - devices not detected

2014-01-29 Thread Xenia Ragiadakou
On 29/01/2014 12:08 μμ, Rafał Miłecki wrote: 2014-01-29 David Laight david.lai...@aculab.com: Maybe I misunderstand something, but won't that commit end up replacing the previous pair of writel() with a single native writeq() on 64bit platforms? Judging by the comment in front of the

Re: xhci regression since xhci: replace xhci_write_64() with writeq() - devices not detected

2014-01-29 Thread Xenia Ragiadakou
On 29/01/2014 01:43 μμ, David Laight wrote: From: Xenia Ragiadakou On 29/01/2014 12:08 μμ, Rafał Miłecki wrote: 2014-01-29 David Laight david.lai...@aculab.com: Maybe I misunderstand something, but won't that commit end up replacing the previous pair of writel() with a single native writeq

Re: xhci_hcd and Canon Lide 110 not playing well together

2014-01-08 Thread Xenia Ragiadakou
On 07/01/2014 11:46 μμ, Sarah Sharp wrote: On Wed, Dec 25, 2013 at 09:51:28PM -0500, Alan Stern wrote: Okay, now we know that usb_enable_interface takes a long time. That routine does nothing but call usb_enable_endpoint, which does nothing but call usb_hcd_reset_endpoint, which calls the

Re: [PATCH 1/2] xhci: fix reset for not halted endpoints

2013-11-25 Thread Xenia Ragiadakou
On 11/25/2013 04:41 AM, Alan Stern wrote: On Mon, 25 Nov 2013, Xenia Ragiadakou wrote: You can simplify part of the problem by not allowing an endpoint to be reset if it has any pending URBs. Just fail the reset in this case. Yes, you are right since, from what i understand

Re: [PATCH 1/2] xhci: fix reset for not halted endpoints

2013-11-25 Thread Xenia Ragiadakou
On 11/25/2013 04:44 AM, Alan Stern wrote: On Mon, 25 Nov 2013, Xenia Ragiadakou wrote: On 11/25/2013 01:50 AM, Xenia Ragiadakou wrote: [snip] Also, while you're going through the whole remove-and-add procedure for endpoints that aren't halted, do you want to hold the bandwidth mutex

Re: [PATCH 1/2] xhci: fix reset for not halted endpoints

2013-11-24 Thread Xenia Ragiadakou
Hi Alan and Sarah, Sorry for my late response but i had some personal issues that held me back for a while. My comments follow below. On 10/17/2013 06:11 PM, Alan Stern wrote: On Wed, 16 Oct 2013, Sarah Sharp wrote: I think there's some nasty race conditions here. There's several

Re: [PATCH 1/2] xhci: fix reset for not halted endpoints

2013-11-24 Thread Xenia Ragiadakou
On 11/25/2013 01:50 AM, Xenia Ragiadakou wrote: [snip] Also, while you're going through the whole remove-and-add procedure for endpoints that aren't halted, do you want to hold the bandwidth mutex? If the procedure isn't atomic, there's a possibility that some other device could change configs

Re: [RFC 03/21] xhci: fix incorrect type in assignment in xhci_address_device()

2013-11-14 Thread Xenia Ragiadakou
:08PM +0300, Xenia Ragiadakou wrote: The field 'dev_info' in struct xhci_slot_ctx has type __le32 and it needs to be converted to CPU byteorder for the correct retrieval of its subfield 'Context Entries'. This field is used by the trace event 'xhci_address_ctx' to trace only the contexts of valid

[RFC v2] xhci: fix incorrect type in assignment in xhci_address_device()

2013-11-14 Thread Xenia Ragiadakou
sparse. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Changes from v1: * fix patch to apply cleanly on for-usb-next-queue branch of xhci tree drivers/usb/host/xhci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host

[RFC v2] xhci: remove conversion from generic to pci device in xhci_mem.c

2013-11-14 Thread Xenia Ragiadakou
This patch removes the to_pci_dev() conversion performed to generic struct device since it is not actually useful (the pointer to the generic device can be used directly rather through a conversion to pci_dev) and it is pci bus specific. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com

[RFC v2 1/4] xhci: replace xhci_readl() with readl()

2013-11-14 Thread Xenia Ragiadakou
to be called in a context where a pointer to xhci_hcd is available. Remove the unnecessary xhci_readl() wrapper function and replace its calls to with calls to readl() to make the code more straightforward. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-dbg.c

[RFC v2 2/4] xhci: replace xhci_writel() with writel()

2013-11-14 Thread Xenia Ragiadakou
function that has to be called in a context where a pointer to xhci_hcd is available. Remove xhci_writel() wrapper function and replace its calls with calls to writel() to make the code more straight-forward. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-hub.c

[RFC v2 3/4] xhci: replace xhci_read_64() with readq()

2013-11-14 Thread Xenia Ragiadakou
systems. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-dbg.c | 6 +++--- drivers/usb/host/xhci-mem.c | 6 +++--- drivers/usb/host/xhci-ring.c | 6 +++--- drivers/usb/host/xhci.c | 12 ++-- drivers/usb/host/xhci.h | 10 ++ 5 files

[RFC v2 0/4] remove unnecessary code related to MMIO reads/writes

2013-11-14 Thread Xenia Ragiadakou
and the rest of the headers to improve readability. Xenia Ragiadakou (4): xhci: replace xhci_readl() with readl() xhci: replace xhci_writel() with writel() xhci: replace xhci_read_64() with readq() xhci: replace xhci_write_64() with writeq() drivers/usb/host/xhci-dbg.c | 42 ++-- drivers

[RFC v2 4/4] xhci: replace xhci_write_64() with writeq()

2013-11-14 Thread Xenia Ragiadakou
on 64bit systems. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-mem.c | 8 drivers/usb/host/xhci-ring.c | 8 +++- drivers/usb/host/xhci.c | 8 drivers/usb/host/xhci.h | 29 + 4 files changed, 20

Re: [PATCH 2/2] xhci: fix last valid endpoint when dropping an endpoint

2013-10-11 Thread Xenia Ragiadakou
Hi Sarah, On 10/10/2013 09:25 PM, Sarah Sharp wrote: Hi Xenia, On Mon, Oct 07, 2013 at 06:52:39PM +0300, Xenia Ragiadakou wrote: The previous patch on the endpoint reset uses the already implemented function xhci_drop_endpoint() to reduce code duplication. However, the way that xhci updates

Re: [PATCH 2/2] xhci: fix last valid endpoint when dropping an endpoint

2013-10-11 Thread Xenia Ragiadakou
On 10/11/2013 11:40 AM, Xenia Ragiadakou wrote: [snip] The main reasons that made me come to this conclusion was the fact that Context Entries by being updated with a value other than the last valid endpoint will be inconsistent with the definition in xhci spec (revision 1.0 5/21/10) Context

Re: [PATCH 2/2] xhci: fix last valid endpoint when dropping an endpoint

2013-10-11 Thread Xenia Ragiadakou
On 10/11/2013 09:26 PM, Sarah Sharp wrote: On Fri, Oct 11, 2013 at 07:30:17PM +0300, Xenia Ragiadakou wrote: [snip] To test if a smaller value will cause a problem, I reset first endpoint 4 and, then, endpoint 3 so that the Context Entries field get updated with the value 3 while the actual

Re: [PATCH 1/2] xhci: fix reset for not halted endpoints

2013-10-10 Thread Xenia Ragiadakou
On 10/07/2013 06:52 PM, Xenia Ragiadakou wrote: [snip] +static int xhci_reset_ep0(struct xhci_hcd *xhci, struct usb_device *udev, + struct usb_host_endpoint *ep) +{ + struct xhci_virt_device *vdev; + struct xhci_input_control_ctx *ctrl_ctx; + struct xhci_slot_ctx

[PATCH 2/2] xhci: fix last valid endpoint when dropping an endpoint

2013-10-07 Thread Xenia Ragiadakou
them as invalid and the transactions to these endpoints will break. This patch updates the last valid endpoint with the index of the first not disabled endpoint, starting from the current last valid endpoint and skipping the dropped endpoint. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com

[PATCH 1/2] xhci: fix reset for not halted endpoints

2013-10-07 Thread Xenia Ragiadakou
. At this early stage, it is useful for debugging the xhci_reset_not_halted_ep() and it may be removed later when further testing and revisioning show that the function works as expected. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- This patch needs to be tested further because I did not find

Re: New USB core API to change interval and max packet size

2013-10-01 Thread Xenia Ragiadakou
On 10/01/2013 11:45 PM, Sarah Sharp wrote: On Tue, Oct 01, 2013 at 10:01:08PM +0300, Xenia Ragiadakou wrote: Hi Sarah, I read the mail on 'possible conflict between xhci_hcd and a patched usbhid'. For reference to others: http://marc.info/?l=linux-usbm=138064948726038w=2 http://marc.info/?l

Re: [PATCH] xhci: fix write to USB3_PSSEN and XUSB2PRM pci config registers

2013-09-23 Thread Xenia Ragiadakou
On 09/23/2013 07:45 PM, Sarah Sharp wrote: On Fri, Sep 20, 2013 at 07:45:53PM +0300, Xenia Ragiadakou wrote: The function pci_write_config_dword() sets the appropriate byteordering internally so the value argument should not be converted to little-endian. This bug was found by sparse. Can you

[PATCH] xhci: fix write to USB3_PSSEN and XUSB2PRM pci config registers

2013-09-20 Thread Xenia Ragiadakou
The function pci_write_config_dword() sets the appropriate byteordering internally so the value argument should not be converted to little-endian. This bug was found by sparse. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/pci-quirks.c | 4 ++-- 1 file changed, 2

Re: [RFC 10/21] xhci: replace xhci_readl() with readl() in xhci-dbg.c

2013-09-13 Thread Xenia Ragiadakou
On 09/13/2013 06:49 AM, Pratyush Anand wrote: On Tue, Sep 10, 2013 at 02:03:15AM +0800, Xenia Ragiadakou wrote: Function xhci_readl() is used to read 32bit xHC registers residing in MMIO address space. It takes as first argument a pointer to the xhci_hcd although it does not use it because

Re: [RFC 10/21] xhci: replace xhci_readl() with readl() in xhci-dbg.c

2013-09-13 Thread Xenia Ragiadakou
On 09/13/2013 12:28 PM, Pratyush Anand wrote: Hi ksenia, On Fri, Sep 13, 2013 at 04:45:23PM +0800, Xenia Ragiadakou wrote: On 09/13/2013 06:49 AM, Pratyush Anand wrote: On Tue, Sep 10, 2013 at 02:03:15AM +0800, Xenia Ragiadakou wrote: Function xhci_readl() is used to read 32bit xHC registers

Re: [RFC v4 06/19] xhci: use completion event's slot id rather than dig it out of command

2013-09-09 Thread Xenia Ragiadakou
On 09/04/2013 08:39 AM, Xenia Ragiadakou wrote: Since the slot id retrieved from the command TRB matches the one in Slot ID field of the command completion event, which is available, there is no need to determine it again. This patch removes the uneccessary reassignment to slot id and adds

[RFC v5 02/19] xhci: rename existing Command Completion Event handlers

2013-09-09 Thread Xenia Ragiadakou
to reference to them more easily. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp sarah.a.sh...@linux.intel.com --- drivers/usb/host/xhci-ring.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb

[RFC v5 13/19] xhci: add variable 'cmd_trb' in handle_cmd_completion()

2013-09-09 Thread Xenia Ragiadakou
This patch adds a new variable 'cmd_trb' to hold the address of the command TRB, that is associated with the command completion event, and to replace repetitions of xhci-cmd_ring-dequeue into the code. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp sarah.a.sh

[RFC v5 10/19] xhci: remove unused 'ep_ring' variable in handle_cmd_completion()

2013-09-09 Thread Xenia Ragiadakou
This patch removes the variable 'ep_ring' that is assigned in TRB_CONFIG_EP switch case but never used. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.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

[RFC v5 07/19] xhci: refactor TRB_RESET_DEV case into function

2013-09-09 Thread Xenia Ragiadakou
xhci_handle_cmd_reset_dev(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci

[RFC v5 19/19] xhci: add trace for missed periodic transfers

2013-09-09 Thread Xenia Ragiadakou
'xhci_dbg_missed_periodic_tx', to trace the debug statements related to missed periodic transfers. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: -make changelog more clear -add two additional tracepoints drivers/usb/host/xhci-ring.c | 26

[RFC v5 12/19] xhci: add variable 'cmd_comp_code' in handle_cmd_completion()

2013-09-09 Thread Xenia Ragiadakou
This patch adds a new variable 'cmd_comp_code' to hold the command completion status code aiming to reduce code duplication and to improve code readability. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp sarah.a.sh...@linux.intel.com --- drivers/usb/host/xhci-ring.c

[RFC v5 04/19] xhci: refactor TRB_DISABLE_SLOT case into function

2013-09-09 Thread Xenia Ragiadakou
xhci_handle_cmd_disable_slot(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host

[RFC v5 16/19] xhci: add argument 'slot_id' in stop_ep, set_deq and reset_ep cmd handlers

2013-09-09 Thread Xenia Ragiadakou
calculation in each of them. Also, a WARN_ON() was added in case the slot ids reported by command TRB and event TRB differ (although according to xhci spec rev1.0 that should not happen) Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v4: -add a WARN_ON() in case the two slot id

[RFC v5 06/19] xhci: use completion event's slot id rather than dig it out of command

2013-09-09 Thread Xenia Ragiadakou
according xhci spec rev1.0 they should not differ). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: -the above change is performed now in a separate patch -a warning is triggered in case the slot id reported in event trb is different from the slot id renoted in command

[RFC v5 05/19] xhci: refactor TRB_ADDR_DEV case into function

2013-09-09 Thread Xenia Ragiadakou
xhci_handle_cmd_addr_dev(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b

[RFC v5 14/19] xhci: add variable 'cmd_type' in handle_cmd_completion()

2013-09-09 Thread Xenia Ragiadakou
This patch adds a new variable 'cmd_type' to hold the command type so that switch cases can be simplified by removing TRB_TYPE() macro improving code readability. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: update changelog to report the reason for such change

[RFC v5 09/19] xhci: refactor TRB_EVAL_CONTEXT case into function

2013-09-09 Thread Xenia Ragiadakou
xhci_handle_cmd_eval_ctx(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci

[RFC v5 15/19] xhci: replace 'xhci-cmd_ring-dequeue' with 'trb' in stop_ep cmd handler

2013-09-09 Thread Xenia Ragiadakou
This patch replaces 'xhci-cmd_ring-dequeue' with 'trb', the address of the command TRB, since it is available to reduce line length. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp sarah.a.sh...@linux.intel.com --- drivers/usb/host/xhci-ring.c | 6 ++ 1 file

[RFC v5 11/19] xhci: refactor TRB_CONFIG_EP case into function

2013-09-09 Thread Xenia Ragiadakou
xhci_handle_cmd_config_ep(). There were added two additional variables, 'add_flags' and 'drop_flags', to reduce line length below 80 chars and improve code readability. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: -add reason for new function creation in change log

[RFC v5 03/19] xhci: refactor TRB_ENABLE_SLOT case into function

2013-09-09 Thread Xenia Ragiadakou
xhci_handle_cmd_enable_slot(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci

[RFC v5 18/19] xhci: add label 'update_ring' in handle_cmd_completion()

2013-09-09 Thread Xenia Ragiadakou
This patch adds the label 'update_ring' for the common code path: inc_deq(xhci, xhci-cmd_ring); return; Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: -remove return statement drivers/usb/host/xhci-ring.c | 7 +++ 1 file changed, 3 insertions(+), 4

[RFC v5 17/19] xhci: replace 'event' with 'cmd_comp_code' in set_deq and reset_ep handlers

2013-09-09 Thread Xenia Ragiadakou
This patch replaces the 'event' argument of xhci_handle_cmd_set_deq() and xhci_handle_cmd_reset_ep(), which is used to retrieve the command completion status code, with the cmd_comp_code directly, since it is available. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp

[RFC 07/21] xhci: fix sparse warning in xhci-trace.h

2013-09-09 Thread Xenia Ragiadakou
. The trace-cmd tool with the help of plugin_xhci.py will use this field to parse the TRB contents in a human readable way. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci

[RFC 03/21] xhci: fix incorrect type in assignment in xhci_address_device()

2013-09-09 Thread Xenia Ragiadakou
sparse. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index bda0cdf..9f22ddf 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host

[RFC 15/21] xhci: replace xhci_writel() with writel() in xhci.c

2013-09-09 Thread Xenia Ragiadakou
function that has to be called in a context where a pointer to xhci_hcd is available. This patch replaces calls to xhci_writel() with calls to writel() in xhci.c. This is done so that xhci_writel() can be removed completely and code can become more straight-forward. Signed-off-by: Xenia Ragiadakou

[RFC 06/21] xhci: fix derivation of TRB's DMA address in xhci_log_event Trace Event Class

2013-09-09 Thread Xenia Ragiadakou
, the typecasting of le32 to u64 was incorrect and the subsequent conversion to le64 reverts the low and high address parts. This bug was found using sparse. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-trace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[RFC 18/21] xhci: replace xhci_writel() with writel() in xhci-ring.c

2013-09-09 Thread Xenia Ragiadakou
function that has to be called in a context where a pointer to xhci_hcd is available. This patch replaces calls to xhci_writel() with calls to writel() in xhci-ring.c. This is done so that xhci_writel() can be removed completely and code can become more straight-forward. Signed-off-by: Xenia Ragiadakou

[RFC 14/21] xhci: remove xhci_readl()

2013-09-09 Thread Xenia Ragiadakou
This patch removes xhci_readl() because it has been replaced with readl() and it is not used anymore. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci.h | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index

[RFC 04/21] xhci: convert TRB_CYCLE to le32 before using it to set Link TRB's cycle bit

2013-09-09 Thread Xenia Ragiadakou
This patch converts TRB_CYCLE to le32 to update correctly the Cycle Bit in 'control' field of the link TRB. This bug was found using sparse. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-mem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[RFC 16/21] xhci: replace xhci_writel() with writel() in xhci-hub.c

2013-09-09 Thread Xenia Ragiadakou
function that has to be called in a context where a pointer to xhci_hcd is available. This patch replaces calls to xhci_writel() with calls to writel() in xhci-hub.c. This is done so that xhci_writel() can be removed completely and code can become more straight-forward. Signed-off-by: Xenia Ragiadakou

[RFC 11/21] xhci: replace xhci_readl() with readl() in xhci-hub.c

2013-09-09 Thread Xenia Ragiadakou
to be called in a context where a pointer to xhci_hcd is available. This patch replaces calls to xhci_readl() with calls to readl() in xhci-hub.c. This is done so that xhci_readl() can be removed completely and code can become more straightforward. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com

[RFC 12/21] xhci: replace xhci_readl() with readl() in xhci-mem.c

2013-09-09 Thread Xenia Ragiadakou
to be called in a context where a pointer to xhci_hcd is available. This patch replaces calls to xhci_readl() with calls to readl() in xhci-mem.c. This is done so that xhci_readl() can be removed completely and code can become more straightforward. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com

[RFC 01/21] xhci: fix incorrect type in assignment in xhci_count_num_new_endpoints()

2013-09-09 Thread Xenia Ragiadakou
The fields 'add_flags' and 'drop_flags' in struct xhci_input_control_ctx have type __le32 and need to be converted to CPU byteorder before being used to derive the number of added endpoints. This bug was found using sparse. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb

[RFC 08/21] xhci: use ffs() for page size's calculation in xhci_mem_init()

2013-09-09 Thread Xenia Ragiadakou
specific instructions that implement this computation more efficiently. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-mem.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index

[RFC 10/21] xhci: replace xhci_readl() with readl() in xhci-dbg.c

2013-09-09 Thread Xenia Ragiadakou
to be called in a context where a pointer to xhci_hcd is available. This patch replaces calls to xhci_readl() with calls to readl() in xhci-dbg.c. This is done so that xhci_readl() can be removed completely and code can become more straight-forward. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com

[RFC 09/21] xhci: replace xhci_readl() with readl() in xhci.c

2013-09-09 Thread Xenia Ragiadakou
to be called in a context where a pointer to xhci_hcd is available. This patch replaces calls to xhci_readl() with calls to readl() in xhci.c. This is done so that xhci_readl() can be removed completely and code can become more straightforward. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com

[RFC 17/21] xhci: replace xhci_writel() with writel() in xhci-mem.c

2013-09-09 Thread Xenia Ragiadakou
function that has to be called in a context where a pointer to xhci_hcd is available. This patch replaces calls to xhci_writel() with calls to writel() in xhci-mem.c. This is done so that xhci_writel() can be removed completely and code can become more straight-forward. Signed-off-by: Xenia Ragiadakou

[RFC 13/21] xhci: replace xhci_readl() with readl() in xhci-ring.c

2013-09-09 Thread Xenia Ragiadakou
to be called in a context where a pointer to xhci_hcd is available. This patch replaces calls to xhci_readl() with calls to readl() in xhci-ring.c. This is done so that xhci_readl() can be removed completely and code can become more straight-forward. Signed-off-by: Xenia Ragiadakou burzalod

[RFC 05/21] xhci: fix incorrect type in assignment in handle_device_notification()

2013-09-09 Thread Xenia Ragiadakou
This patch converts Event TRB's 3rd field, which has type le32, to CPU byteorder before using it to retrieve the Slot ID with TRB_TO_SLOT_ID macro. This bug was found using sparse. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-ring.c | 2 +- 1 file changed, 1

[RFC 02/21] xhci: fix incorrect type in assignment in xhci_count_num_dropped_endpoints()

2013-09-09 Thread Xenia Ragiadakou
The fields 'add_flags' and 'drop_flags' in struct xhci_input_control_ctx have type __le32 and need to be converted to CPU byteorder before being used to derive the number of dropped endpoints. This bug was found using sparse. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb

[RFC 19/21] xhci: remove xhci_writel()

2013-09-09 Thread Xenia Ragiadakou
This patch removes xhci_writel() since its calls has been replaced with writel() and it is not used anymore. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci.h | 8 1 file changed, 8 deletions(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host

[RFC 21/21] xhci: replace xhci_write_64() with writeq() and remove xhci_write_64()

2013-09-09 Thread Xenia Ragiadakou
operation is already implemented. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-mem.c | 8 drivers/usb/host/xhci-ring.c | 8 +++- drivers/usb/host/xhci.c | 8 drivers/usb/host/xhci.h | 30 ++ 4 files

[RFC 20/21] xhci: replace xhci_read_64() with readq() and remove xhci_read_64()

2013-09-09 Thread Xenia Ragiadakou
that if the system is not 64bit, readq() will read registers in low-high order. Also, it replaces all calls to xhci_read_64() with calls to readq() and removes xhci_read_64(). This is done to reduce code duplication since 64bit register read operation is already implemented. Signed-off-by: Xenia

Re: [PATCH v3] usbcore: check usb device's state before sending a Set SEL control transfer

2013-09-06 Thread Xenia Ragiadakou
On 09/04/2013 09:25 PM, Martin MOKREJŠ wrote: Hi Xenia, thank you. I tested this patch on 3.11 kernel and the messages don't appear anymore upon LPM-capable device disconnect (tested with ASMedia AS2105 devices). Not much to show here, there is just no error/warning related to LPM while

[PATCH v3] usbcore: check usb device's state before sending a Set SEL control transfer

2013-09-04 Thread Xenia Ragiadakou
Set SEL control urbs cannot be sent to a device in unconfigured state. This patch adds a check in usb_req_set_sel() to ensure the usb device's state is USB_STATE_CONFIGURED. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Reported-by: Martin MOKREJS mmokr...@gmail.com Suggested-by: Sarah

[RFC v4 13/19] xhci: add variable 'cmd_trb' in handle_cmd_completion()

2013-09-03 Thread Xenia Ragiadakou
This patch adds a new variable 'cmd_trb' to hold the address of the command TRB, that is associated with the command completion event, and to replace repetitions of xhci-cmd_ring-dequeue into the code. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp sarah.a.sh

[RFC v4 11/19] xhci: refactor TRB_CONFIG_EP case into function

2013-09-03 Thread Xenia Ragiadakou
xhci_handle_cmd_config_ep(). There were added two additional variables, 'add_flags' and 'drop_flags', to reduce line length below 80 chars and improve code readability. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: -add reason for new function creation in change log

[RFC v4 18/19] xhci: add label 'update_ring' in handle_cmd_completion()

2013-09-03 Thread Xenia Ragiadakou
This patch adds the label 'update_ring' for the common code path: inc_deq(xhci, xhci-cmd_ring); return; Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: remove return statement drivers/usb/host/xhci-ring.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions

[RFC v4 04/19] xhci: refactor TRB_DISABLE_SLOT case into function

2013-09-03 Thread Xenia Ragiadakou
xhci_handle_cmd_disable_slot(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host

[RFC v4 02/19] xhci: rename existing Command Completion Event handlers

2013-09-03 Thread Xenia Ragiadakou
to reference to them more easily. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp sarah.a.sh...@linux.intel.com --- drivers/usb/host/xhci-ring.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb

[RFC v4 10/19] xhci: remove unused 'ep_ring' variable in handle_cmd_completion()

2013-09-03 Thread Xenia Ragiadakou
This patch removes the variable 'ep_ring' that is assigned in TRB_CONFIG_EP switch case but never used. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.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

[RFC v4 16/19] xhci: add argument 'slot_id' in stop_ep, set_deq and reset_ep cmd handlers

2013-09-03 Thread Xenia Ragiadakou
calculation in each of them. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/xhci-ring.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 485ce5c..9cb0f42 100644 --- a/drivers

[RFC v4 15/19] xhci: replace 'xhci-cmd_ring-dequeue' with 'trb' in stop_ep cmd handler

2013-09-03 Thread Xenia Ragiadakou
This patch replaces 'xhci-cmd_ring-dequeue' with 'trb', the address of the command TRB, since it is available to reduce line length. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp sarah.a.sh...@linux.intel.com --- drivers/usb/host/xhci-ring.c | 6 ++ 1 file

[RFC v4 08/19] xhci: refactor TRB_NEC_GET_FW case into function

2013-09-03 Thread Xenia Ragiadakou
xhci_handle_cmd_nec_get_fw(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/xhci

[RFC v4 07/19] xhci: refactor TRB_RESET_DEV case into function

2013-09-03 Thread Xenia Ragiadakou
xhci_handle_cmd_reset_dev(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci

[RFC v4 14/19] xhci: add variable 'cmd_type' in handle_cmd_completion()

2013-09-03 Thread Xenia Ragiadakou
This patch adds a new variable 'cmd_type' to hold the command type so that switch cases can be simplified by removing TRB_TYPE() macro improving code readability. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: update changelog to report the reason for such change

[RFC v4 09/19] xhci: refactor TRB_EVAL_CONTEXT case into function

2013-09-03 Thread Xenia Ragiadakou
xhci_handle_cmd_eval_ctx(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci

[RFC v4 12/19] xhci: add variable 'cmd_comp_code' in handle_cmd_completion()

2013-09-03 Thread Xenia Ragiadakou
This patch adds a new variable 'cmd_comp_code' to hold the command completion status code aiming to reduce code duplication and to improve code readability. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp sarah.a.sh...@linux.intel.com --- drivers/usb/host/xhci-ring.c

[RFC v4 17/19] xhci: replace 'event' with 'cmd_comp_code' in set_deq and reset_ep handlers

2013-09-03 Thread Xenia Ragiadakou
This patch replaces the 'event' argument of xhci_handle_cmd_set_deq() and xhci_handle_cmd_reset_ep(), which is used to retrieve the command completion status code, with the cmd_comp_code directly, since it is available. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp

[RFC v4 01/19] xhci: remove unused argument from xhci_giveback_urb_in_irq()

2013-09-03 Thread Xenia Ragiadakou
This patch removes the adjective argument from xhci_giveback_urb_in_irq(), since it is not used in the function anymore. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Acked-by: Sarah Sharp sarah.a.sh...@linux.intel.com --- drivers/usb/host/xhci-ring.c | 8 1 file changed, 4

[RFC v4 03/19] xhci: refactor TRB_ENABLE_SLOT case into function

2013-09-03 Thread Xenia Ragiadakou
xhci_handle_cmd_enable_slot(). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: add reason for new function creation in change log drivers/usb/host/xhci-ring.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci

[RFC v4 06/19] xhci: use completion event's slot id rather than dig it out of command

2013-09-03 Thread Xenia Ragiadakou
. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- Differences from v3: -the above change is performed now in a separate patch -a warning is triggered in case the slot id reported in event trb is different from the slot id renoted in command trb drivers/usb/host/xhci-ring.c | 5 +++-- 1 file

Re: [PATCH 1/3] usbcore: set lpm_capable field for LPM capable root hubs

2013-09-01 Thread Xenia Ragiadakou
On 09/01/2013 06:04 AM, Greg KH wrote: On Sun, Sep 01, 2013 at 02:56:42AM +0200, Martin MOKREJŠ wrote: Martin MOKREJŠ wrote: Hi Xenia, I tried these 3 patches and ... I will rather leave it up to you to decide if everything went right. Attached is a diff of dmesg from unpatched and patched

[PATCH] usbcore: add check on usb device's state before trying to disable lpm

2013-09-01 Thread Xenia Ragiadakou
usb_submit_urb() will fail). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/core/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index fe8d95d..a6c10f0 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core

[PATCH v2] usbcore: add check on usb device's state before trying to disable lpm

2013-09-01 Thread Xenia Ragiadakou
usb_submit_urb() will fail). Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Reported-by: Martin MOKREJS mmokr...@gmail.com --- drivers/usb/core/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index fe8d95d..a6c10f0 100644

Re: [PATCH v3] usbcore: compare and release one bos descriptor in usb_reset_and_verify_device()

2013-08-31 Thread Xenia Ragiadakou
On 08/31/2013 07:52 AM, Greg KH wrote: On Sat, Aug 31, 2013 at 04:52:47AM +0300, Xenia Ragiadakou wrote: On 08/31/2013 04:25 AM, Greg KH wrote: On Sat, Aug 31, 2013 at 04:20:09AM +0300, Xenia Ragiadakou wrote: In usb_reset_and_verify_device(), hub_port_init() allocates a new bos descriptor

[PATCH 1/3] usbcore: set lpm_capable field for LPM capable root hubs

2013-08-31 Thread Xenia Ragiadakou
This patch sets the lpm_capable field for root hubs with LPM capabilities. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Reported-by: Martin MOKREJS mmokr...@gmail.com Suggested-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/core/hcd.c | 1 + drivers/usb/core/hub.c | 7

[PATCH 3/3] usbcore: fix read of usbdevfs_ctrltransfer fields in proc_control()

2013-08-31 Thread Xenia Ragiadakou
Urb fields are stored in struct usbdevfs_ctrltransfer in CPU byteorder and not in little endian, so there is no need to be converted. This bug was reported by sparse. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/core/devio.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH 2/3] usbcore: fix incorrect type in assignment in usb_set_lpm_parameters()

2013-08-31 Thread Xenia Ragiadakou
the assignmenment to [udev/hub]_u2_del variables. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com Reported-by: kbuild test robot fengguang...@intel.com --- drivers/usb/core/hub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core

Re: Include parent hub number in current warning message Parent hub missing LPM exit latency info

2013-08-30 Thread Xenia Ragiadakou
On 08/29/2013 04:31 PM, Martin MOKREJŠ wrote: Actually, there is some new bug I haven't seen before (this is 3.10.9 kernel). First of all, I see my TI XHCI controller does not use MSI-X anymore, will have to check my .config why is it so. Why are you saying that xhci does not use MSI-X? Can

Re: [PATCH v3] usbcore: compare and release one bos descriptor in usb_reset_and_verify_device()

2013-08-30 Thread Xenia Ragiadakou
On 08/31/2013 04:25 AM, Greg KH wrote: On Sat, Aug 31, 2013 at 04:20:09AM +0300, Xenia Ragiadakou wrote: In usb_reset_and_verify_device(), hub_port_init() allocates a new bos descriptor to hold the value read by the device. The new bos descriptor has to be compared with the old one in order

[PATCH 1/4] ehci: remove ehci_vdbg() verbose debugging statements

2013-08-29 Thread Xenia Ragiadakou
This patch removes ehci_vdbg debugging statements from EHCI host controller driver because they produce too much information, lowering the signal to noise ratio when debugging, and because they are not used anymore. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/ehci

[PATCH 4/4] ehci: enable debugging code when CONFIG_DYNAMIC_DEBUG is set

2013-08-29 Thread Xenia Ragiadakou
The debugging code for ehci is enabled to run if the DEBUG flag is defined. This patch enables the debugging code also when the kernel is configured with dynamic debugging on. Signed-off-by: Xenia Ragiadakou burzalod...@gmail.com --- drivers/usb/host/ehci-dbg.c | 8 drivers/usb/host

  1   2   >