Re: [PATCH] staging: dwc2: add microframe scheduler from downstream Pi kernel

2013-07-18 Thread Matthijs Kooijman
Hi Paul, The transfer scheduler in the dwc2 driver is pretty basic, not to mention buggy. It works fairly well with just a couple of devices plugged in, but if you add, say, multiple devices with periodic endpoints, the scheduler breaks down and can't even enumerate all the devices. This

[PATCH 0/3] staging: dwc2: Add some dma-related defensive programming

2013-07-19 Thread Matthijs Kooijman
Hi Greg, here's three patches for dwc2, acked by Paul. They're not critical, so no need to push them to 3.11. Gr. Matthijs Matthijs Kooijman (3): staging: dwc2: disable dma when no dma_mask was setup staging: dwc2: when dma is disabled, clear hcd-self.uses_dma staging: dwc2: Don't touch

[PATCH 3/3] staging: dwc2: Don't touch the dma_mask when dma is disabled

2013-07-19 Thread Matthijs Kooijman
cause problems (when reloading a module, for example). Signed-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman paul.zimmer...@synopsys.com --- drivers/staging/dwc2/hcd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c

[PATCH 1/3] staging: dwc2: disable dma when no dma_mask was setup

2013-07-19 Thread Matthijs Kooijman
or addition of new glue layers). Signed-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman paul.zimmer...@synopsys.com --- drivers/staging/dwc2/hcd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c index 2ed54b1

[PATCH 2/3] staging: dwc2: when dma is disabled, clear hcd-self.uses_dma

2013-07-19 Thread Matthijs Kooijman
the dma_enable value in dwc2. To prevent problems resulting from a mismatch, better to explicitely disable dma in this case (though everything seemed to work with the wrong value of uses_dma as well, probably only resulted in some unneeded work). Signed-off-by: Matthijs Kooijman matth...@stdin.nl

Re: dwc2: Transaction errors with device connected at boot

2013-07-22 Thread Matthijs Kooijman
Hi Paul, I noticed that this bug occurs with the old dwc_otg driver (from the Ralink SDK) as well, so it is not dwc2-specific. However, I also ound out this bug does not occur on another (identical) unit I have (using the old driver), so it seems likely that this is somehow a one-off (hardware)

Re: dwc2: Transaction errors with device connected at boot

2013-07-22 Thread Matthijs Kooijman
Hi Paul, There's no firmware in the HSOTG core, so I don't see how running the driver could permanently damage the core. However, if it's your only good working unit then I guess some paranoia is understandable ;) Well, it was just that I had only one unit where running a clean 3.10 kernel was

Re: [PATCH V3] usb: Add Device Tree support to XHCI Platform driver

2013-07-23 Thread Matthijs Kooijman
Hi Alan, This compiles without CONFIG_OF because of_match_ptr() assigns NULL if CONFIG_OF is not defined. Ah, I guess that makes sense :-) Apologies for the noise... Gr. Matthijs -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to

Re: [PATCH] staging: dwc2: add driver parameter to set AHB config register value

2013-07-24 Thread Matthijs Kooijman
Hey Paul, diff --git a/drivers/staging/dwc2/core.h b/drivers/staging/dwc2/core.h index fc075a7..e771e40 100644 --- a/drivers/staging/dwc2/core.h +++ b/drivers/staging/dwc2/core.h @@ -150,10 +150,11 @@ enum dwc2_lx_state { * are enabled * @reload_ctl:

Re: [PATCH] staging: dwc2: add driver parameter to set AHB config register value

2013-07-24 Thread Matthijs Kooijman
Hey Paul, one more thing: + * -1 - GAHBCFG value will not be overridden This seems incorrect: If it is set to -1, GAHBCFG will be set to 0x06 (INCR4), it is not left unchanged. I'll also include this in my documentation patch. Gr. Matthijs -- To

[PATCH v2] staging: dwc2: Don't touch the dma_mask when dma is disabled

2013-07-24 Thread Matthijs Kooijman
cause problems (when reloading a module, for example). Signed-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman paul.zimmer...@synopsys.com --- v2: Rebased on top of the latest staging-next drivers/staging/dwc2/hcd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers

Re: [PATCH] staging: dwc2: add microframe scheduler from downstream Pi kernel

2013-07-25 Thread Matthijs Kooijman
Hi Paul, Furthermore, I wonder about how this scheduler works exactly. What I see is: - the number usecs needed for a single transfer in a periodic qh is calculated - When the qh is scheduled, the first of the 8 microframes with enough usecs available is picked for this qh

Re: [PATCH 00/13] staging: dwc2: Register-related cleanups

2013-08-05 Thread Matthijs Kooijman
Hi Paul, With the exception of 1 and 13 which I already commented on, you can add my acked-by to the rest of this series. I assume you meant 3 instead of 13 here, given that you commented on patch 3 (about unshifting stuff) but not 13? Gr. Matthijs -- To unsubscribe from this list: send the

Re: [PATCH 03/13] staging: dwc2: unshift non-bool register value constants

2013-08-05 Thread Matthijs Kooijman
Hi Paul, On Wed, Jul 17, 2013 at 06:52:56PM +, Paul Zimmerman wrote: From: Matthijs Kooijman [mailto:matth...@stdin.nl] Sent: Wednesday, July 17, 2013 8:10 AM Various register fields wider than one bit have constants defined for their value. Previously, these registers would define

Re: [PATCH 2/3] staging: dwc2: add NAK holdoff patch from downstream Pi kernel

2013-08-12 Thread Matthijs Kooijman
Hi Paul, Add the NAK holdoff patch from the downstream Raspberry Pi kernel. This allows the transfer scheduler to better handle cheeky devices that just hold off using NAKs. @@ -365,6 +366,7 @@ struct dwc2_hsotg { u8 otg_port; u32 *frame_list; dma_addr_t frame_list_dma;

Re: [PATCH 3/3] staging: dwc2: add microframe scheduler from downstream Pi kernel

2013-08-12 Thread Matthijs Kooijman
Hi Paul Dom, I haven't got time to look closely right now, but at first glance most of my comments have been resolved. One thing that is still in there, is this piece of code for which I'm not sure if it is really related to the topic of the patch: @@ -780,6 +784,10 @@ static void

Re: [PATCH 0/3] staging: dwc2: 2nd try at uframe scheduler patch

2013-08-12 Thread Matthijs Kooijman
Hi Paul, Matthijs' concern about periodic endpoints with bInterval=1 seems to be unfounded. I tried a webcam, which uses a bInterval=1 isoc endpoint, on my PCI-based dev board, and it still works fine with this patch applied. For the record, I still think this concern actually exists, but you

Re: [PATCH 03/13] staging: dwc2: unshift non-bool register value constants

2013-08-12 Thread Matthijs Kooijman
Hey Paul, OK, I'm kind of on the fence about this one, so if you prefer it this way I guess it's OK with me. Acked-by: Paul Zimmerman pa...@synopsys.com Thanks. What platforms have you tested this on, BTW? You said you have a Raspberry Pi, so I'd like you to test these patches there

Re: [PATCH 2/3] staging: dwc2: add NAK holdoff patch from downstream Pi kernel

2013-08-21 Thread Matthijs Kooijman
Hi Paul, @@ -365,6 +366,7 @@ struct dwc2_hsotg { u8 otg_port; u32 *frame_list; dma_addr_t frame_list_dma; + int next_sched_frame; This variable is still not really used, I think. Most of the mentions in the patch are assignments, except for these two: +

Re: staging:DWC2 USB driver issues

2013-08-27 Thread Matthijs Kooijman
Hi Dinh, Any chance anyone has a similar experience with this DWC2 driver, any help will greatly appreciated. Of course, I will go back and verify the initialization between the DWC2 and the old driver to see if I can spot anything. At first glance, the symptoms (getting transaction errors on

[PATCH V2 13/13] staging: dwc2: make dwc2_core_params documentation more complete

2013-08-30 Thread Matthijs Kooijman
are all -1. Signed-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman pa...@synopsys.com --- v2: Rebase on top of Paul's ahbcfg patch and documentation re-ordering patch Fix the documentation for the ahbcfg parameter --- drivers/staging/dwc2/core.h | 85

[PATCH V2 05/13] staging: dwc2: simplify register shift expressions

2013-08-30 Thread Matthijs Kooijman
This commit changes expressions from (val shift) (mask shift) to (val mask) shift. Signed-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman pa...@synopsys.com --- drivers/staging/dwc2/core.c | 20 ++--- drivers/staging/dwc2/hcd.c | 62

[PATCH V2 06/13] staging: dwc2: add missing shift

2013-08-30 Thread Matthijs Kooijman
to increase readability a bit more. Signed-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman pa...@synopsys.com --- drivers/staging/dwc2/hcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c index f11b4f0

[PATCH V2 02/13] staging: dwc2: fix off-by-one in check for max_packet_count parameter

2013-08-30 Thread Matthijs Kooijman
, but the upper limit for the set value was off-by-one. This change makes the check the same as the one for max_transfer_size, which was already correct. Signed-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman pa...@synopsys.com --- drivers/staging/dwc2/core.c | 2 +- 1 file changed

[PATCH V2 10/13] staging: dwc2: properly mask the GRXFSIZ register

2013-08-30 Thread Matthijs Kooijman
. Signed-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman pa...@synopsys.com --- drivers/staging/dwc2/core.c | 23 --- drivers/staging/dwc2/hw.h | 2 ++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/staging/dwc2/core.c b/drivers

[PATCH V2 11/13] staging: dwc2: interpret all hwcfg and related register at init time

2013-08-30 Thread Matthijs Kooijman
are debug printed after unpacking them, so a bunch of debug prints can be removed from other places. Signed-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman pa...@synopsys.com --- v2: Update to use FIFOSIZE_* constants Use u32 instead of unsigned for temporary variables

[PATCH V2 09/13] staging: dwc2: remove redundant register reads

2013-08-30 Thread Matthijs Kooijman
-off-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman pa...@synopsys.com --- drivers/staging/dwc2/core.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c index 5799f47..f6494df 100644 --- a/drivers

[PATCH V2 01/13] staging: dwc2: remove specific fifo size constants

2013-08-30 Thread Matthijs Kooijman
those untouched. Also note that the GRXFSIZ register also contains a fifo size, but there is no corresponding start address register (it is always the first fifo in memory), the layout of the GRXFSIZ register is different and cannot use the same constants. Signed-off-by: Matthijs Kooijman matth

Re: [PATCH v3 1/2] staging: dwc2: validate urb-actual_length for OUT endpoints

2013-09-26 Thread Matthijs Kooijman
Hi folks, On Tue, Sep 24, 2013 at 11:08:53AM -0500, Felipe Balbi wrote: On Mon, Sep 23, 2013 at 02:23:33PM -0700, Paul Zimmerman wrote: + if ((urb-actual_length 0 || urb-actual_length urb-length) + !dwc2_hcd_is_pipe_in(urb-pipe_info)) +

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Matthijs Kooijman
On Tue, Oct 01, 2013 at 10:05:17AM +0300, Dan Carpenter wrote: On Tue, Oct 01, 2013 at 01:21:28AM +, Paul Zimmerman wrote: From: Dan Carpenter [mailto:dan.carpen...@oracle.com] Sent: Monday, September 30, 2013 6:09 PM Yeah. I guess it's fine... I was going to suggest adding the

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Matthijs Kooijman
Hi Dinh, Somehow I assumed that was fixed by the hardware, but I see now that you are right. Yes, making the definition larger is better than moving the + 1. This was my original fix to the problem, but I thought that it would be confusing when reading the code. I also thought about the +1

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Matthijs Kooijman
Hey Dan, Dinh, [resend]: previous reply didn't include Matthijs He sets his Mail-Followup-To: so that we don't CC him on replies. I assume it's deliberate because he only wants the copy from the mailing list? Exactly, I just set that for whatever mailing list I subscribe to. However,

[PATCH] staging: dwc2: Make dwc2_hw_params.host_channels large enough

2013-10-01 Thread Matthijs Kooijman
-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/dwc2/core.h b/drivers/staging/dwc2/core.h index f7ba34b..fab718d 100644 --- a/drivers/staging/dwc2/core.h +++ b/drivers/staging/dwc2/core.h @@ -294,7

Re: [PATCH] staging: dwc2: Make dwc2_hw_params.host_channels large enough

2013-10-02 Thread Matthijs Kooijman
Hey Dinh, Reported-by: Dinh Nguyen dinh.li...@gmail.com Can you please use: Dinh Nguyen dingu...@altera.com Sorry, I just used your sender address, should have checked your patch instead. Paul, if you can ack this patch, I'll resend it with the proper tag and include your acked-by as well.

Re: [PATCH] staging: dwc2: Make dwc2_hw_params.host_channels large enough

2013-10-03 Thread Matthijs Kooijman
Hi Paul, By the way, it looks like 'num_dev_ep' would have the same problem, I don't think so, since the hardware doesn't do the off-by-one trick there (presumably because having 0 endpoints make sense, but 0 host channels doesn't): hw-num_dev_ep = (hwcfg2 GHWCFG2_NUM_DEV_EP_MASK)

[PATCH] staging: dwc2: Make dwc2_hw_params.host_channels large enough

2013-10-03 Thread Matthijs Kooijman
-by: Matthijs Kooijman matth...@stdin.nl Acked-by: Paul Zimmerman pa...@synopsys.com --- This is exactly the same patch as before, but with updated tags in the commit message. drivers/staging/dwc2/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/dwc2/core.h b

Re: [RFC] Does PHY UTMI data width belong to DWC2 or PHY binding?

2013-10-22 Thread Matthijs Kooijman
Hi Kishon, On Mon, Oct 21, 2013 at 02:57:26PM +0530, Kishon Vijay Abraham I wrote: I think it makes sense to keep the data width property in the dwc2 node itself. I mean it describes how the dwc2 IP is configured in that particular SoC (given that it can be either 8 or 16). If I'm reading

dwc2: Host channel not always released on dequeue

2013-03-22 Thread Matthijs Kooijman
commit c49ae5c418b561cf277f34d14e20eb49226f8dd7 Author: Matthijs Kooijman matth...@stdin.nl Date: Fri Mar 22 13:05:22 2013 +0100 staging: dwc2: Always release host channel after dequeueing Previously, when an active urb was dequeued, its host channel would not always

Re: [PATCH] staging: dwc2: fix wrong setting of DMA masks

2013-03-23 Thread Matthijs Kooijman
Hi Paul, + /* Set device flags indicating whether the HCD supports DMA */ + if (hsotg-core_params-dma_enable 0) { + if (dma_set_mask(hsotg-dev, DMA_BIT_MASK(32)) 0) + dev_warn(hsotg-dev, + can't enable workaround for 4GB

Re: dwc2: Host channel not always released on dequeue

2013-03-23 Thread Matthijs Kooijman
Hi Paul, I would prefer to keep that part of the code as-is for now. I haven't quite convinced myself that the function can never be called with halt_status = DWC2_HC_XFER_URB_DEQUEUE. Ok. For arguments sake, it should be easy to convince yourself: dwc2_hc_chhltd_intr is a static function

Re: [PATCH] USB: EHCI: DT support for generic bus glue

2013-03-27 Thread Matthijs Kooijman
Hi folks, I don't think we are consistent in any way. PowerPC sets up a 32 bit DMA mask for all devices during DT probe from arch code, while the common code sets up coherent_dma_mask but not dma_mask, except for AMBA devices, which also get the 32 bit mask. The MIPS Octeon and PowerPC PS3

[PATCH/RFC] staging: dwc: Moving all hwcfg accesses to one place

2013-03-27 Thread Matthijs Kooijman
WIP patch below, let me know what you think. Gr. Matthijs commit 5f67447a06581bf9d9d5f154e635a45a1406994c Author: Matthijs Kooijman matth...@stdin.nl Date: Tue Mar 26 17:35:34 2013 +0100 staging: dwc2: Interpret all hwcfg and related register at init time Before, the hwcfg4

Re: [PATCH/RFC] staging: dwc: Moving all hwcfg accesses to one place

2013-03-27 Thread Matthijs Kooijman
Hi Greg, But yes, it does seem to be a good idea, Ok, thanks. as long as these options can't change over time. It's only read-only registers, or registers whose power-on values determine their maximum possible value, so they indeed won't change over time. Gr. Matthijs -- To unsubscribe from

Re: [PATCH/RFC] staging: dwc: Moving all hwcfg accesses to one place

2013-03-28 Thread Matthijs Kooijman
Hi Paul, Overall this seems to be an improvement, so I have no objections. There is a pretty high likelihood of something getting broken in the translation, however. For example, this: + hw-host_nperio_tx_fifo_size = (readl(hsotg-regs + GNPTXFSIZ) GNPTXFSIZ_NP_TXF_DEP_MASK)

Re: [PATCH/RFC] staging: dwc: Moving all hwcfg accesses to one place

2013-03-28 Thread Matthijs Kooijman
Hi Paul, while continuing this patch, I stumbled upon a bit of code which doesn't make sense to me. In dwc2_dump_global_registers is the following bit: if (hsotg-core_params-en_multiple_tx_fifo = 0) { ep_num = hsotg-hwcfg4 GHWCFG4_NUM_DEV_PERIO_IN_EP_SHIFT

Re: [PATCH/RFC] staging: dwc: Moving all hwcfg accesses to one place

2013-03-28 Thread Matthijs Kooijman
Hi Paul, If you look closely at the databook, you will see that DPTXFSIZn and DIEPTXFn are both aliases for the same register address. Ah, right. Remebmer I don't have the databook, only the register descriptions from the RT3052 datasheet, which are riddled with typos, so I had assumed the

Re: [PATCH] USB: EHCI: fix regression during bus resume

2013-03-30 Thread Matthijs Kooijman
Hi Alan, This patch (as1663) fixes a regression caused by commit 6e0c3339a6f19d748f16091d0a05adeb1e1f822b (USB: EHCI: unlink one async QH at a time). [...] The symptom is that when the root hub is resumed, USB communications don't work for some period of time. This is because ehci-hcd

Re: [PATCH] USB: EHCI: fix regression during bus resume

2013-03-30 Thread Matthijs Kooijman
Hi Alan, The same sort of thing has happened to me. Often you're better off looking to see if someone has already fixed a problem than trying to fix it yourself. :-) I started debugging this before rc4 was out, and it was still broken in rc3 (but since the lockup only occured with an SD

Re: EHCI: port power regression when canceling suspend-to-disk

2013-03-31 Thread Matthijs Kooijman
Hi Alan, Are you totally certain about this? I can't see how removing code to change the EHCI port power would make any difference in your case, because the power was on the whole time. Hmm, something fishy is going on: If I revert the patch on top of 3.9-rc4 (ignoring any conflicts and

Re: EHCI: port power regression when canceling suspend-to-disk

2013-04-01 Thread Matthijs Kooijman
Hi Alan, So either something more complicated is happening, or I messed up my bisection results. I'll retest the rev under suspicion and its parent and get back to you. Seems you were right: The revision I bisected to was not the culprit. It seems that there is some other factor involved that

Re: Cannot open two tyyACMs at a time when using 2514b USB hub

2013-04-03 Thread Matthijs Kooijman
Hi Arshad, Did you manage to find a fix for the problem. Could you please share it. What driver does the USB controller in your TI board use? This problem sounds familiar to a problem I have observed in an Ralink RT3052 board, which uses the dwc_otg / dwc2 driver. Here, the problem was that the

[RFC PATCH 38/41] staging: dwc2: load parameters from the devicetree

2013-04-05 Thread Matthijs Kooijman
Each of the parameters in the dwc2_core_params struct can now be changed using devicetree parameters. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- Documentation/devicetree/bindings/staging/dwc2.txt | 36 drivers/staging/dwc2/platform.c| 68

[RFC PATCH 17/41] staging: dwc2: properly mask the GRXFSIZ register

2013-04-05 Thread Matthijs Kooijman
. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 17 ++--- drivers/staging/dwc2/hw.h | 2 ++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c index cc2431f..0388641 100644

[RFC PATCH 20/41] staging: dwc2: make dwc2_core_params documentation more complete

2013-04-05 Thread Matthijs Kooijman
are all -1. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.h | 83 +++-- 1 file changed, 57 insertions(+), 26 deletions(-) diff --git a/drivers/staging/dwc2/core.h b/drivers/staging/dwc2/core.h index 710de03..2817b60 100644

[RFC PATCH 03/41] staging: dwc2: fix naming of register constants

2013-04-05 Thread Matthijs Kooijman
and removes the generic constants. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 8 drivers/staging/dwc2/hw.h | 14 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2

[RFC PATCH 04/41] staging: dwc2: fix off-by-one in check for max_packet_count parameter

2013-04-05 Thread Matthijs Kooijman
, but the upper limit for the set value was off-by-one. This change makes the check the same as the one for max_transfer_size, which was already correct. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[RFC PATCH 01/41] staging: dwc2: when dma is disabled, clear dev-dma_mask

2013-04-05 Thread Matthijs Kooijman
-specific stuff that isn't needed (though everything seemed to work with the wrong value of uses_dma as well). Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/dwc2/hcd.c b/drivers

[RFC PATCH 21/41] staging: dwc2: add const to handling of dwc2_core_params

2013-04-05 Thread Matthijs Kooijman
From: Stephen Warren swar...@wwwdotorg.org Signed-off-by: Stephen Warren swar...@wwwdotorg.org [matth...@stdin.nl: Split patch from bigger patch and added commit message] Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 2 +- drivers/staging/dwc2/hcd.c | 2

[RFC PATCH 10/41] staging: dwc2: only read the snpsid register once

2013-04-05 Thread Matthijs Kooijman
This (read-only) register was read twice, storing it for later use the second time. Now it is only read once, storing it right away. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/hcd.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git

[RFC PATCH 36/41] staging: dwc2: Make dwc2_set_uninitialized more specific

2013-04-05 Thread Matthijs Kooijman
instead of by the caller. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.h | 2 ++ drivers/staging/dwc2/hcd.c | 12 +--- drivers/staging/dwc2/hcd.h | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/staging/dwc2/core.h b

[RFC PATCH 09/41] staging: dwc2: unshift non-bool register value constants

2013-04-05 Thread Matthijs Kooijman
the handling of these values more consistent with other register fields that represent natural numbers instead of enumerations (e.g., number of host channels). Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 52 ++-- drivers/staging/dwc2/hcd.c

[RFC PATCH 34/41] staging: dwc2: cleanup includes in pci.c

2013-04-05 Thread Matthijs Kooijman
Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/pci.c | 7 --- 1 file changed, 7 deletions(-) This is just the minimal list of includes that made the compile work. diff --git a/drivers/staging/dwc2/pci.c b/drivers/staging/dwc2/pci.c index acf2008..a1d2ede 100644

[RFC PATCH 05/41] staging: dwc2: replace some magic numbers by constants

2013-04-05 Thread Matthijs Kooijman
Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c index 9162bed..9a34ac7 100644 --- a/drivers/staging/dwc2/core.c +++ b

[RFC PATCH 14/41] staging: dwc2: simplify debug output in dwc_hc_init

2013-04-05 Thread Matthijs Kooijman
Before, the value of the hcchar register was shifted and masked and then the debug output extracted the individual values out of the complete hcchar register again. This commit makes the debug prints directly use the original values instead. Signed-off-by: Matthijs Kooijman matth...@stdin.nl

[RFC PATCH 35/41] staging: dwc2: set the driver name to dwc2

2013-04-05 Thread Matthijs Kooijman
Previously, it was dwc_otg, but this does not correspond to the directory name and might cause confusion with the old out-of-tree dwc_otg driver of which many versions circulate. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/hcd.c | 2 +- drivers/staging/dwc2/pci.c

[RFC PATCH 27/41] staging: dwc2: add dwc2_disable_common_interrupts function

2013-04-05 Thread Matthijs Kooijman
This function disables all common interrupts, i.e., those that are handled by the common interrupt handler. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 14 ++ drivers/staging/dwc2/core.h | 6 ++ drivers/staging/dwc2/core_intr.c

[RFC PATCH 23/41] staging: dwc2: do not use IRQF_DISABLED

2013-04-05 Thread Matthijs Kooijman
This flag is a deprecated NOOP, interrupt handlers are always run with interupts disabled. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) See include/linux/interrupt.h and 6932bf37 (genirq: Remove

[RFC PATCH 02/41] staging: dwc2: disable dma when no dma_mask was setup

2013-04-05 Thread Matthijs Kooijman
-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/hcd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c index 0eb4a3b..c73ddf2 100644 --- a/drivers/staging/dwc2/hcd.c +++ b/drivers/staging/dwc2/hcd.c

[RFC PATCH 06/41] staging: dwc2: remove unneeded check

2013-04-05 Thread Matthijs Kooijman
The value in params-enable_dynamic_fifo can only be true if the corresponding bit in hwcfg2 is set, this is already checked by dwc2_set_param_enable_dynamic_fifo. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 3 +-- 1 file changed, 1 insertion(+), 2

[RFC PATCH 41/41] WIP: enable dwc2 for raspberry pi

2013-04-05 Thread Matthijs Kooijman
--- arch/arm/Kconfig | 1 + arch/arm/boot/dts/bcm2835.dtsi | 6 ++ arch/arm/configs/bcm2835_defconfig | 20 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) This patch is just FYI. diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index

[RFC PATCH 13/41] staging: dwc2: add missing shift

2013-04-05 Thread Matthijs Kooijman
to increase readability a bit more. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/hcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c index 29f9911..458669b 100644 --- a/drivers/staging/dwc2

[RFC PATCH 12/41] staging: dwc2: simplify register shift expressions

2013-04-05 Thread Matthijs Kooijman
This commit changes expressions from (val shift) (mask shift) to (val mask) shift. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 20 ++--- drivers/staging/dwc2/hcd.c | 62 +++-- drivers/staging/dwc2

[RFC PATCH 32/41] staging: dwc2: register common irq handler in dwc2_core_init

2013-04-05 Thread Matthijs Kooijman
and by disabling interrupts before calling dwc2_core_init instead of after, we can be sure the handler is registered before the interrupts are enabled, which should close this window. Reported-by: Stephen Warren swar...@wwwdotorg.org Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging

[RFC PATCH 40/41] MIPS: ralink: setup dma_mask for the rt305x dwc2 usb controller

2013-04-05 Thread Matthijs Kooijman
--- arch/mips/ralink/rt305x-usb.c | 5 + 1 file changed, 5 insertions(+) This patch is just FYI. diff --git a/arch/mips/ralink/rt305x-usb.c b/arch/mips/ralink/rt305x-usb.c index 793fc82..7d87740 100644 --- a/arch/mips/ralink/rt305x-usb.c +++ b/arch/mips/ralink/rt305x-usb.c @@ -108,6 +108,7

[RFC PATCH 37/41] staging: dwc2: add platform device bindings

2013-04-05 Thread Matthijs Kooijman
This adds a dwc_platform.ko module that can be loaded by using compatible = snps,dwc2 in a device tree. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- Documentation/devicetree/bindings/staging/dwc2.txt | 15 +++ drivers/staging/dwc2/Kconfig | 6 +- drivers

[RFC PATCH 15/41] staging: dwc2: re-use hptxfsiz variable

2013-04-05 Thread Matthijs Kooijman
For some reason, the value of the HPTXFSIZ register was built in the ptxfsiz variable, while there was also a hptxfsiz variable availble. Better just use that. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 12 ++-- 1 file changed, 6 insertions(+), 6

[RFC PATCH 11/41] staging: dwc2: remove some device-mode related debug code

2013-04-05 Thread Matthijs Kooijman
This code appears to be partially incorrect. Since this is only debug code and only applies to device mode, it seems better to remove this code for now than to invest time fixing it. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 19 --- 1

[RFC PATCH 26/41] staging: dwc2: disable I2CINT in dwc2_disable_host_interrupts

2013-04-05 Thread Matthijs Kooijman
This interrupt is currently not enabled anywhere, but there is some (dummy) handling for it in the host interrupt handler. This marks it as a host mode interrupt, so it makes sense to disable it when disabling the other host mode interrupts. Signed-off-by: Matthijs Kooijman matth...@stdin.nl

[RFC PATCH 19/41] staging: dwc2: validate the value for phy_utmi_width

2013-04-05 Thread Matthijs Kooijman
that the default should be 16. Also, the pci bindings explicitely set the value to 16, so this commit changes the default to 16 bits (if supported, 8 bits otherwise). With the default changed, the value set in pci.c is changed to -1 to make it autodetected as well. Signed-off-by: Matthijs Kooijman

[RFC PATCH 39/41] MIPS: ralink: use the dwc2 driver for the rt305x USB controller

2013-04-05 Thread Matthijs Kooijman
--- arch/mips/ralink/dts/rt3050.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) This patch is just FYI. diff --git a/arch/mips/ralink/dts/rt3050.dtsi b/arch/mips/ralink/dts/rt3050.dtsi index 5aede8d..2b7ab42 100644 --- a/arch/mips/ralink/dts/rt3050.dtsi +++

[RFC PATCH 24/41] staging: dwc2: do not handle PRTINT in dwc2_handle_common_intr

2013-04-05 Thread Matthijs Kooijman
. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core_intr.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/staging/dwc2/core_intr.c b/drivers/staging/dwc2/core_intr.c index 454c502..3099f2d 100644 --- a/drivers/staging/dwc2

[RFC PATCH 33/41] staging: dwc2: convert to devm_ioremap_resource()

2013-04-05 Thread Matthijs Kooijman
Convert use of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages so the explicit error code can be removed from the failure code path. Signed-off-by: Matthijs Kooijman

[RFC PATCH 16/41] staging: dwc2: remove redundant register reads

2013-04-05 Thread Matthijs Kooijman
-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) If there is some scenario possible where the FIFO size values written to these registers are not actually applied, this patch could cause a problem. However

[RFC PATCH 31/41] staging: dwc2: don't pass IRQ_LEVEL to devm_request_irq

2013-04-05 Thread Matthijs Kooijman
It seems this flag is intended to pass to irq_set_status_flags, not request_irq, and is not available on all architectures. Its value corresponds to IRQF_PROBE_SHARED, which shouldn't be needed for this driver, so removing this flag should be safe. Signed-off-by: Matthijs Kooijman matth

[RFC PATCH 25/41] staging: dwc2: move some interrupt enabling around

2013-04-05 Thread Matthijs Kooijman
where they are handled. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c index 66aa4aa..4a8caf2 100644 --- a/drivers/staging

[RFC PATCH 29/41] staging: dwc2: use functions to disable interrupts

2013-04-05 Thread Matthijs Kooijman
enabled, so the result should be the same. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/hcd.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c index 01e7eb1..3656a3c 100644 --- a/drivers

[RFC PATCH 08/41] staging: dwc2: add helper variable to simplify code

2013-04-05 Thread Matthijs Kooijman
Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/hcd_intr.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dwc2/hcd_intr.c b/drivers/staging/dwc2/hcd_intr.c index 12b5a89..281c2f4 100644 --- a/drivers/staging/dwc2/hcd_intr.c

[RFC PATCH 28/41] staging: dwc2: introduce GINTMSK_HOST macro

2013-04-05 Thread Matthijs Kooijman
This simply defines a list of interrupts handled by the the host interrupt handler. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core.c | 4 +--- drivers/staging/dwc2/core.h | 4 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging

[RFC PATCH 30/41] staging: dwc2: properly separate common and host interrupt enabling

2013-04-05 Thread Matthijs Kooijman
others alone. This makes the functions do what you'd expect them to. In practice, both of these functions are only called together during initialization and cleanup, so there shouldn't be any behaviour change (though some timing changes could occur). Signed-off-by: Matthijs Kooijman matth

[RFC PATCH 22/41] staging: dwc2: use irq_return_t for interrupt handlers

2013-04-05 Thread Matthijs Kooijman
of the various constants, this didn't result in wrong behaviour). Signed-off-by: Stephen Warren swar...@wwwdotorg.org [matth...@stdin.nl: Split patch from bigger patch and added commit message] Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging/dwc2/core_intr.c | 8

Re: Cannot open two tyyACMs at a time when using 2514b USB hub

2013-04-08 Thread Matthijs Kooijman
Hi Arshad, The driver used by the USB controller is MUSB_HDRC. Looking at musb_core.c, I've found the following comment: * * Control and bulk use dedicated endpoints, and there's as *yet no mechanism to either (a) reclaim the hardware when *peripherals are NAKing, which

Re: [RFC PATCH 14/41] staging: dwc2: simplify debug output in dwc_hc_init

2013-04-08 Thread Matthijs Kooijman
On Sat, Apr 06, 2013 at 08:43:51PM +0400, Sergei Shtylyov wrote: Before, the value of the hcchar register was shifted and masked and then the debug output extracted the individual values out of the complete hcchar register again. This commit makes the debug prints directly use the original

Re: [RFC PATCH 00/41] staging: dwc2: Miscellaneous cleanups and fixes

2013-04-08 Thread Matthijs Kooijman
Hi Paul, But you really need to split this into a more manageable series of patches. It's really difficult to review when you have so many different things all munged together like this. It's also discouraging to potential reviewers to see one set of 41 patches, where if it was four series of

[PATCH v2] staging: dwc2: toggle periodic debugging output separately

2013-04-09 Thread Matthijs Kooijman
to debug messages). In addition, a debug message from dwc2_hcd_is_status_changed is removed entirely, since it often floods the log regardless of periodic transfers. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- Since this patch touches a lot of code and I've developed all my other patches

Re: [PATCH v2] staging: dwc2: toggle periodic debugging output separately

2013-04-09 Thread Matthijs Kooijman
CPU time going to debug messages). [...] Signed-off-by: Matthijs Kooijman matth...@stdin.nl why don't you just use dynamic printk instead ? In some cases, this could help, but a lot of the prints modified by this patch are used for both periodic and non-periodic transfers. AFAIU

[PATCH v3] staging: dwc2: toggle periodic debugging output separately

2013-04-10 Thread Matthijs Kooijman
to debug messages). In addition, a debug message from dwc2_hcd_is_status_changed is removed entirely, since it often floods the log regardless of periodic transfers. Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- v2: fix some coding style issues v3: convert dbg_* macros to static inline

Re: [PATCH v2] staging: dwc2: toggle periodic debugging output separately

2013-04-10 Thread Matthijs Kooijman
Hi Felipe, In some cases, this could help, but a lot of the prints modified by this patch are used for both periodic and non-periodic transfers. AFAIU, with dynamic printks you could only enable/disable them altogether, not based on some arbitrary condition (e.g., the urb being handled is

[PATCH 0/2] staging: dwc2: Interrupt-related fixes

2013-04-11 Thread Matthijs Kooijman
in the big 40-patch series last week. Gr. Matthijs Matthijs Kooijman (2): staging: dwc2: don't pass IRQ_LEVEL to devm_request_irq staging: dwc2: register common irq handler in dwc2_core_init drivers/staging/dwc2/core.c | 13 - drivers/staging/dwc2/core.h | 2 +- drivers/staging/dwc2

[PATCH 1/2] staging: dwc2: don't pass IRQ_LEVEL to devm_request_irq

2013-04-11 Thread Matthijs Kooijman
It seems this flag is intended to pass to irq_set_status_flags, not request_irq, and is not available on all architectures. Its value corresponds to IRQF_PROBE_SHARED, which shouldn't be needed for this driver, so removing this flag should be safe. Signed-off-by: Matthijs Kooijman matth

[PATCH 2/2] staging: dwc2: register common irq handler in dwc2_core_init

2013-04-11 Thread Matthijs Kooijman
and by disabling interrupts before calling dwc2_core_init instead of after, we can be sure the handler is registered before the interrupts are enabled, which should close this window. Reported-by: Stephen Warren swar...@wwwdotorg.org Signed-off-by: Matthijs Kooijman matth...@stdin.nl --- drivers/staging

  1   2   3   >