Re: [PATCH] usb: gadget: udc-xilinx: remove useless variable assignment in xudc_read_fifo()

2017-06-27 Thread Sören Brinkmann
On Tue, 2017-06-27 at 16:30:30 -0500, Gustavo A. R. Silva wrote:
> Value assigned to variable bufferspace at line 637 is overwritten
> at line 613, before it can be used. This makes such variable
> assignment useless.
> 
> Addresses-Coverity-ID: 1397677
> Signed-off-by: Gustavo A. R. Silva 
Reviewed-by: Sören Brinkmann 

Sören
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: gadget: udc-xilinx: clean up a variable name

2017-04-27 Thread Sören Brinkmann
On Thu, 2017-04-27 at 12:11:18 +0300, Dan Carpenter wrote:
> "ep->udc->lock" and "udc->lock" are the same thing.  It confuses Smatch
> if we don't use the same name consistently.
> 
> Signed-off-by: Dan Carpenter 
Reviewed-by: Sören Brinkmann 

Sören
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5] Axi-usb: Add support for 64-bit addressing.

2016-09-01 Thread Sören Brinkmann
On Thu, 2016-09-01 at 14:22:56 +0530, Nava kishore Manne wrote:
> This patch updates the driver to support 64-bit DMA addressing.
> 
> Signed-off-by: Nava kishore Manne 
> Acked-by: Rob Herring 
> ---
> Changes for v5:
> -None.
> 
> Changes for v4:
> -Used boolen property insted of addrwith property in the DT
>  as suggested by Arnd Bergmann.
> -Adopt the DT relevant changes into the driver.
> 
> Changes for v3:
> -Added new compatable string for 5.00 IP version as suggested 
> by
>  Arnd Bergmann.
> -Used write_fn() insted of lo_hi_writeq() as suggested by
>  Arnd Bergmann.
> Changes for v2:
> -Added dma-ranges property in device tree as suggested by
>  Arnd Bergmann.
> -Modified the driver code based on the xlnx,addrwidth.
> 
>  .../devicetree/bindings/usb/udc-xilinx.txt |  5 ++-
>  drivers/usb/gadget/udc/udc-xilinx.c| 52 
> +-
>  2 files changed, 54 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/udc-xilinx.txt 
> b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
> index 47b4e39..d08d972 100644
> --- a/Documentation/devicetree/bindings/usb/udc-xilinx.txt
> +++ b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
> @@ -1,12 +1,14 @@
>  Xilinx USB2 device controller
>  
>  Required properties:
> -- compatible : Should be "xlnx,usb2-device-4.00.a"
> +- compatible : Should be "xlnx,usb2-device-4.00.a" or
> +   "xlnx,usb2-device-5.00"
>  - reg: Physical base address and size of the USB2
> device registers map.
>  - interrupts : Should contain single irq line of USB2 device
> controller
>  - xlnx,has-builtin-dma   : if DMA is included
> +- xlnx,has-64bit-dma : if DMA is included 64-bit addressing support.

We add these properties to describe the IP configuration + we have the
version indicator in the compatible string. Do we really need both? It
seems that all versions use the same driver and differentiation is made
through the DT properties that describe the IP configuration parameters.
Wouldn't it be better to just have one generic 'xlnx,axi-usb2' (or
whatever) compatible string instead of patching the driver for each new
version without really needing to differentiate the IP versions through
it?

Sören
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: gadget: xilinx: fix devm_ioremap_resource() check

2015-03-29 Thread Sören Brinkmann
On Sun, 2015-03-29 at 05:43AM +0300, Vladimir Zapolskiy wrote:
> devm_ioremap_resource() returns IOMEM_ERR_PTR() and it never
> returns NULL, fix the check to prevent access to invalid
> virtual address.
> 
> Signed-off-by: Vladimir Zapolskiy 
Reviewed-by: Sören Brinkmann 

Sören
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: phy: generic: fix the gpios to be optional

2015-01-28 Thread Sören Brinkmann
On Wed, 2015-01-28 at 09:29AM +0100, Robert Jarzmik wrote:
> All the gpios, ie. reset-gpios and vbus-detect-gpio, should be optional
> and not prevent the driver from working. Fix the regression in the
> behavior introduced by commit "usb: phy: generic: migrate to gpio_desc".
> 
> At the same time, declare the interrupt as "one shot" so that it is
> masked until the end of the threaded handler. This prevents the irq core
> from spitting out an error :
>   "Threaded irq requested with handler=NULL and !ONESHOT for irq 63"

Shouldn't this be a separate patch?

> 
> Signed-off-by: Robert Jarzmik 
> ---
>  drivers/usb/phy/phy-generic.c | 13 +++--
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
> index 9a826ff..49db411 100644
> --- a/drivers/usb/phy/phy-generic.c
> +++ b/drivers/usb/phy/phy-generic.c
> @@ -41,7 +41,8 @@
>  #include "phy-generic.h"
>  
>  #define VBUS_IRQ_FLAGS \
> - (IRQF_SHARED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
> + (IRQF_SHARED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | \
> + IRQF_ONESHOT)

IMHO, unrelated to the regression fix.

>  
>  struct platform_device *usb_phy_generic_register(void)
>  {
> @@ -218,12 +219,12 @@ int usb_phy_gen_create_phy(struct device *dev, struct 
> usb_phy_generic *nop,
>   clk_rate = 0;
>  
>   needs_vcc = of_property_read_bool(node, "vcc-supply");
> - nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset-gpios");
> - err = PTR_ERR(nop->gpiod_reset);
> + nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset");
> + err = PTR_ERR_OR_ZERO(nop->gpiod_reset);
>   if (!err) {
>   nop->gpiod_vbus = devm_gpiod_get_optional(dev,
> -  "vbus-detect-gpio");
> - err = PTR_ERR(nop->gpiod_vbus);
> +  "vbus-detect");
> + err = PTR_ERR_OR_ZERO(nop->gpiod_vbus);
>   }
>   } else if (pdata) {
>   type = pdata->type;
> @@ -242,7 +243,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct 
> usb_phy_generic *nop,
>   if (err == -EPROBE_DEFER)
>   return -EPROBE_DEFER;
>   if (err) {
> - dev_err(dev, "Error requesting RESET GPIO\n");
> + dev_err(dev, "Error requesting RESET or VBUS GPIO\n");
>   return err;

The patch didn't apply cleanly for me on linux-next, but I merged it in.
Works for me. If you separate out the IRQ flag change, feel free to add
my
Tested-by: Soren Brinkmann 

Sören
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: phy: make GPIOs optional for the generic phy

2015-01-27 Thread Sören Brinkmann
On Fri, 2015-01-16 at 12:14PM +0100, Robert Jarzmik wrote:
> Paul Zimmerman  writes:
> 
> > From 47bd18e210fecf701d493c27884e13c69bc449ea Mon Sep 17 00:00:00 2001
> > From: Paul Zimmerman 
> > Date: Wed, 14 Jan 2015 18:15:58 -0800
> > Subject: [PATCH] usb: phy: make GPIOs optional for the generic phy
> >
> > The use of GPIOs should be optional for the generic phy, otherwise
> > the Altera SOCFPGA platform at least is broken.
> >
> > Fixes breakage caused by a combination of e9f2cefb0cd "usb: phy: 
> > generic: migrate to gpio_desc" and 135b3c4304d "usb: dwc2: platform: 
> > add generic PHY framework support".
> >
> > Signed-off-by: Paul Zimmerman 
> Reviewed-by: Robert Jarzmik 
Tested-by: Soren Brinkmann 

Zynq suffers of the same problem.

Sören
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: phy-generic: Don't fail on missing gpio reset

2015-01-27 Thread Sören Brinkmann
On Tue, 2015-01-27 at 09:20AM -0600, Felipe Balbi wrote:
> On Mon, Jan 26, 2015 at 05:45:29PM -0800, Soren Brinkmann wrote:
> > A reset through a GPIO is optional. Don't fail probing when it is
> > missing.
> > 
> > Reported-by: Andreas Färber 
> > Signed-off-by: Soren Brinkmann 
> > ---
> > Hi Andreas,
> > 
> > does this do the trick?
> > 
> > Thanks,
> > Sören
> > 
> >  drivers/usb/phy/phy-generic.c | 6 ++
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
> > index dd05254241fb..a73d4c738f0b 100644
> > --- a/drivers/usb/phy/phy-generic.c
> > +++ b/drivers/usb/phy/phy-generic.c
> > @@ -241,10 +241,8 @@ int usb_phy_gen_create_phy(struct device *dev, struct 
> > usb_phy_generic *nop,
> >  
> > if (err == -EPROBE_DEFER)
> > return -EPROBE_DEFER;
> > -   if (err) {
> > -   dev_err(dev, "Error requesting RESET GPIO\n");
> > -   return err;
> > -   }
> > +   if (err)
> > +   nop->gpiod_reset = NULL;
> 
> there's a better patch to use gpiod_get_optional(), instead.

Great, apparently that wasn't in linux-next yesterday. I'll give it a
shot once it arrives there.

Sören
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] ARM: zynq: DT: Add USB to device tree

2015-01-26 Thread Sören Brinkmann
On Tue, 2015-01-27 at 02:14AM +0100, Andreas Färber wrote:
> + linux-gpio, linux-usb, Felipe Balbi
> 
> Am 26.01.2015 um 19:44 schrieb Sören Brinkmann:
> > On Mon, 2015-01-26 at 08:23AM -0800, Sören Brinkmann wrote:
> >> On Mon, 2015-01-26 at 05:21PM +0100, Andreas Färber wrote:
> >>> Am 26.01.2015 um 16:50 schrieb Sören Brinkmann:
> >>>> On Mon, 2015-01-26 at 10:35AM +0100, Andreas Färber wrote:
> >>>>> Am 26.01.2015 um 09:33 schrieb Andreas Färber:
> >>>>>> Am 26.01.2015 um 09:23 schrieb Michal Simek:
> >>>>>>> On 01/26/2015 09:19 AM, Andreas Färber wrote:
> >>>>>>>> And if I apply it to my -next based tree, adding corresponding nodes 
> >>>>>>>> to
> >>>>>>>> zynq-parallella.dts, I get repeatedly:
> >>>>>>>>
> >>>>>>>> [  +0,012242] ci_hdrc ci_hdrc.0: no of_node; not parsing pinctrl DT
> >>>>>>>> [  +0,000157] ci_hdrc ci_hdrc.0: ChipIdea HDRC found, lpm: 0; cap:
> >>>>>>>> f090e100 op: f090e140
> >>>>>>>> [  +0,81] platform ci_hdrc.0: Driver ci_hdrc requests probe 
> >>>>>>>> deferral
> >>>>>>>> [  +0,005360] ci_hdrc ci_hdrc.1: no of_node; not parsing pinctrl DT
> >>>>>>>> [  +0,000120] ci_hdrc ci_hdrc.1: ChipIdea HDRC found, lpm: 0; cap:
> >>>>>>>> f0910100 op: f0910140
> >>>>>>>> [  +0,001810] platform ci_hdrc.1: Driver ci_hdrc requests probe 
> >>>>>>>> deferral
> >>>>>>>>
> >>>>>>>> Am I missing any other patches or config options?
> [...]
> >>>>>>> Why is it deferred? Is it because of pinmuxing stuff?
> >>>>>>
> >>>>>> No, happened without as well.
> >>>>>>
> >>>>>> Looking at a different place in dmesg, I spot this:
> >>>>>>
> >>>>>> [  +0,003988] usb_phy_generic phy0: GPIO lookup for consumer 
> >>>>>> reset-gpios
> >>>>>> [  +0,12] usb_phy_generic phy0: using device tree for GPIO lookup
> >>>>>> [  +0,15] of_get_named_gpiod_flags: can't parse 'reset-gpios-gpios'
> >>>>>> property
> >>>>>>  of node '/phy0[0]'
> >>>>>> [  +0,13] of_get_named_gpiod_flags: can't parse 'reset-gpios-gpio'
> >>>>>> property
> >>>>>> of node '/phy0[0]'
> >>>>>> [  +0,10] usb_phy_generic phy0: using lookup tables for GPIO lookup
> >>>>>> [  +0,000153] usb_phy_generic phy0: lookup for GPIO reset-gpios failed
> >>>>>> [  +0,12] usb_phy_generic phy0: Error requesting RESET GPIO
> >>>>>> [  +0,004360] usb_phy_generic: probe of phy0 failed with error -2
> >>>>>> [  +0,004991] usb_phy_generic phy1: GPIO lookup for consumer 
> >>>>>> reset-gpios
> >>>>>> [  +0,12] usb_phy_generic phy1: using device tree for GPIO lookup
> >>>>>> [  +0,13] of_get_named_gpiod_flags: can't parse 'reset-gpios-gpios'
> >>>>>> property
> >>>>>>  of node '/phy1[0]'
> >>>>>> [  +0,13] of_get_named_gpiod_flags: can't parse 'reset-gpios-gpio'
> >>>>>> property of node '/phy1[0]'
> >>>>>> [  +0,10] usb_phy_generic phy1: using lookup tables for GPIO lookup
> >>>>>> [  +0,12] usb_phy_generic phy1: lookup for GPIO reset-gpios failed
> >>>>>> [  +0,11] usb_phy_generic phy1: Error requesting RESET GPIO
> >>>>>> [  +0,004337] usb_phy_generic: probe of phy1 failed with error -2
> >>>>>>
> >>>>>> So, I guess the chipidea driver is deferring because the phys want a
> >>>>>> property that neither me nor you are specifying? [...]
> [...]
> >>>>> In my manuals and notes I can't find any GPIO being used as reset for
> >>>>> the USB PHYs. Any thoughts appreciated.
> >>>>
> >>>> Such a connection is optional. The platform might rely on its reset
> >>>> circuit, though it might not work for warm reboots.
> >>>> I haven't looked at parallela docs, but if there 

Re: [PATCH v6 07/12] usb: chipidea: add a usb2 driver for ci13xxx

2014-09-24 Thread Sören Brinkmann
On Tue, 2014-09-23 at 12:28PM +0200, Antoine Tenart wrote:
> Add a USB2 ChipIdea driver for ci13xxx, with optional PHY, clock
> and DMA mask, to support USB2 ChipIdea controllers that don't need
> specific functions.
> 
> Tested on the Marvell Berlin SoCs USB controllers.
> 
> Signed-off-by: Antoine Tenart 

This driver also works for Zynq. I didn't do extensive testing, but I
could access a flash drive successfully.

Tested-by: Soren Brinkmann 

Thanks,
Sören
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html