[patch 2/2 -next] usb: gadget: f_hid: fix error handling in ghid_setup()

2014-11-12 Thread Dan Carpenter
There were a two issues here. 1) We returned PTR_ERR(NULL) which means success if class_create() failed. 2) If alloc_chrdev_region() failed then we should clean up before returning. Also kernel style is to have "error handling" as opposed to "success handling". In the original code checkin

[patch 1/2 -next] usb: gadget: f_hid: use after free in hidg_alloc_inst()

2014-11-12 Thread Dan Carpenter
We free "opts" on the error path and then dereference it. Fixes: 21a9476a7ba8 ('usb: gadget: hid: add configfs support') Signed-off-by: Dan Carpenter diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index 56ca3fc..220035f 100644 --- a/drivers/usb/gadget/fun

Re: [PATCH] usb: phy: fsl: Fix build errors

2014-11-12 Thread Peter Chen
On Wed, Nov 12, 2014 at 08:39:06AM -0600, Felipe Balbi wrote: > commit e47d925 (usb: move the OTG state from > the USB PHY to the OTG structure) moved the > OTG state from struct usb_phy to struct usb_otg. > > Unfortunately, even though I fixed quite a few > build regressions with that patch alrea

Re: [PATCH net-next 2/2] r8152: adjust rtl_start_rx

2014-11-12 Thread David Miller
From: Hayes Wang Date: Thu, 13 Nov 2014 02:31:14 + > My last method which I mentioned yesterday is similar to > this one. The difference is that I would re-use the rx > buffers, so I have to add them to the list for re-submitting, > not alwayes allocate new one. > > Although one rx buffer co

Re: [PATCH v4] usb: gadget: f_fs: add "no_disconnect" mode

2014-11-12 Thread Felipe Balbi
HI, On Wed, Nov 05, 2014 at 01:43:21PM -0600, Felipe Balbi wrote: > On Mon, Nov 03, 2014 at 10:11:02AM -0600, Felipe Balbi wrote: > > Hi, > > > > On Thu, Oct 09, 2014 at 03:21:51PM +0200, Robert Baldyga wrote: > > > Since we can compose gadgets from many functions, there is the problem > > > rela

RE: [PATCH net-next 2/2] r8152: adjust rtl_start_rx

2014-11-12 Thread Hayes Wang
David Miller [mailto:da...@davemloft.net] > Sent: Thursday, November 13, 2014 3:50 AM [...] > > According to the usbnet.c, it would make sure to submit the > > number of min(10, RX_QLEN(dev)) rx buffers. If there are > > not enough rx buffers, it schedule a tasklet for next try. > > > > The brief

Re: [PATCH v3] usb: dwc2: add bus suspend/resume for dwc2

2014-11-12 Thread Kever Yang
Doug, On 11/13/2014 07:22 AM, Doug Anderson wrote: Kever, On Mon, Nov 10, 2014 at 5:09 AM, Kever Yang wrote: Hcd controller needs bus_suspend/resume, dwc2 controller make root hub generate suspend/resume signal with hprt0 register when work in host mode. After the root hub enter suspend, we c

[PATCH] usb: ehci-orion: enable big-endian support

2014-11-12 Thread Marcin Wojtas
This commit fixes ehci-orion operation in big-endian mode by enabling byteswap when accessing registers using 'rdl' and 'wrl' macros. Signed-off-by: Grzegorz Jaszczyk Signed-off-by: Marcin Wojtas Reviewed-by: Gregory CLEMENT --- drivers/usb/host/ehci-orion.c | 4 ++-- 1 file changed, 2 inserti

Re: [PATCH v3] usb: dwc2: add bus suspend/resume for dwc2

2014-11-12 Thread Doug Anderson
Kever, On Mon, Nov 10, 2014 at 5:09 AM, Kever Yang wrote: > Hcd controller needs bus_suspend/resume, dwc2 controller make > root hub generate suspend/resume signal with hprt0 register > when work in host mode. > After the root hub enter suspend, we can make controller enter > low power state with

Re: [V2 PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-12 Thread Sean O. Stalley
Sorry, for got to respond to a couple comments. See responses below. On Wed, Nov 12, 2014 at 01:40:21PM -0800, Sean O. Stalley wrote: > Thanks for reviewing. My responses are inline. > > Greg has asked that we clean up this code internally before we > send out another patchset to the mailing list

Re: [RFC/PATCH v2] usb: host: xhci: issue 'Reset Endpoint' for !CONTROL EPs from finish_td()

2014-11-12 Thread Felipe Balbi
Hi, On Wed, Nov 12, 2014 at 04:54:06PM -0500, Alan Stern wrote: [...] > > and the doorbell will never rung. But even if I drop EP_HALTED from the > > check below and let EP doorbell be rung, nothing will happen because, > > according to XHCI spec 1.0, we *must* first issue a Reset Endpoint > > c

Re: [V2 PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-12 Thread Alan Stern
On Wed, 12 Nov 2014, Sean O. Stalley wrote: > On Tue, Nov 11, 2014 at 10:54:30AM -0500, Alan Stern wrote: > > On Mon, 10 Nov 2014, Stephanie Wallick wrote: > > > > > +static struct mausb_hcd mhcd; > > > > Only one statically-allocated structure? What if somebody wants to > > have more than one

Re: [RFC/PATCH v2] usb: host: xhci: issue 'Reset Endpoint' for !CONTROL EPs from finish_td()

2014-11-12 Thread Alan Stern
On Wed, 12 Nov 2014, Felipe Balbi wrote: > Hi, > > On Wed, Nov 12, 2014 at 03:03:10PM -0500, Alan Stern wrote: > > On Wed, 12 Nov 2014, Felipe Balbi wrote: > > > > > If class driver wants to SetFeature(ENDPOINT_HALT) and > > > later tries to talk to the stalled endpoint, xhci will > > > move end

Re: [V2 PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-12 Thread Sean O. Stalley
Thanks for reviewing. My responses are inline. Greg has asked that we clean up this code internally before we send out another patchset to the mailing list. I will address the issues you pointed out, but it may be a while before you see another patchset. Thanks Again, Sean On Tue, Nov 11, 2014 a

Re: [RFC/PATCH v2] usb: host: xhci: issue 'Reset Endpoint' for !CONTROL EPs from finish_td()

2014-11-12 Thread Felipe Balbi
Hi, On Wed, Nov 12, 2014 at 03:03:10PM -0500, Alan Stern wrote: > On Wed, 12 Nov 2014, Felipe Balbi wrote: > > > If class driver wants to SetFeature(ENDPOINT_HALT) and > > later tries to talk to the stalled endpoint, xhci will > > move endpoint to EP_STATE_STALL and subsequent usb_submit_urb() >

Re: [RFC/PATCH v2] usb: host: xhci: issue 'Reset Endpoint' for !CONTROL EPs from finish_td()

2014-11-12 Thread Alan Stern
On Wed, 12 Nov 2014, Felipe Balbi wrote: > If class driver wants to SetFeature(ENDPOINT_HALT) and > later tries to talk to the stalled endpoint, xhci will > move endpoint to EP_STATE_STALL and subsequent usb_submit_urb() > will not cause a USB token to be shifted into the data lines. > > Because

Re: [V2 PATCH 02/10] added media agnostic (MA) USB HCD roothubs

2014-11-12 Thread Alan Stern
On Wed, 12 Nov 2014, Sean O. Stalley wrote: > > > --- /dev/null > > > +++ b/drivers/staging/mausb/drivers/mausb_hub.c > > > > > +/** > > > + * Returns true if the given is the superspeed HCD. Note: The primary > > > HCD is > > > + * High Speed and the shared HCD is SuperSpeed. > > > + */ > > >

Re: [PATCH net-next 2/2] r8152: adjust rtl_start_rx

2014-11-12 Thread David Miller
From: Hayes Wang Date: Wed, 12 Nov 2014 06:29:46 + > David Miller [mailto:da...@davemloft.net] >> Sent: Wednesday, November 12, 2014 1:44 PM > [...] >> What do other USB network drivers do in similar situations? > > According to the usbnet.c, it would make sure to submit the > number of min

Re: [PATCH net-next v3 0/3] Code adjustment

2014-11-12 Thread David Miller
From: Hayes Wang Date: Wed, 12 Nov 2014 10:05:02 +0800 > v3: > Remove the test_bit for patch #2. > > v2: > Correct the spelling error for the comment of patch #3. > > v1: > Adjust some codes to make them more reasonable. Series applied, thanks. -- To unsubscribe from this list: send the line

Re: [PATCH RESEND v2] usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC

2014-11-12 Thread Felipe Balbi
Hi, On Wed, Nov 12, 2014 at 12:24:11PM -0700, Ashwini Pahuja wrote: > On Wed, Nov 5, 2014 at 12:18 PM, Felipe Balbi wrote: > > On Fri, Oct 31, 2014 at 01:14:33PM -0700, Ashwini Pahuja wrote: > >> This patch adds a UDC driver for Broadcom's USB3.0 Peripheral core > >> named BDC. BDC is capable of

Re: [V2 PATCH 02/10] added media agnostic (MA) USB HCD roothubs

2014-11-12 Thread Sean O. Stalley
Thank you for your review. My responses are inline. Greg has requested that we clean up the driver internally before we resubmit another patchset to the mailing list. I will make sure the changes you requested make it in, but it may be a while before you see a patchset with the fixes included. Th

[RFC/PATCH v2] usb: host: xhci: issue 'Reset Endpoint' for !CONTROL EPs from finish_td()

2014-11-12 Thread Felipe Balbi
If class driver wants to SetFeature(ENDPOINT_HALT) and later tries to talk to the stalled endpoint, xhci will move endpoint to EP_STATE_STALL and subsequent usb_submit_urb() will not cause a USB token to be shifted into the data lines. Because of that, peripheral will never have any means of STALL

Re: "asix: Don't reset PHY on if_up for ASIX 88772" breaks net on arndale platform

2014-11-12 Thread David Miller
Please do not top-post. -- 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: dwc3: gadget: Fix broken gadget on system suspend/resume

2014-11-12 Thread Felipe Balbi
On Wed, Nov 12, 2014 at 05:40:59PM +0200, Roger Quadros wrote: > On 11/12/2014 05:36 PM, Felipe Balbi wrote: > > Hi, > > > > On Wed, Nov 12, 2014 at 05:32:00PM +0200, Roger Quadros wrote: > >> On 11/12/2014 05:08 PM, Felipe Balbi wrote: > >>> On Wed, Nov 12, 2014 at 04:58:16PM +0200, Roger Quadros

Re: [PATCH] usb: dwc3: gadget: Fix broken gadget on system suspend/resume

2014-11-12 Thread Roger Quadros
On 11/12/2014 05:36 PM, Felipe Balbi wrote: > Hi, > > On Wed, Nov 12, 2014 at 05:32:00PM +0200, Roger Quadros wrote: >> On 11/12/2014 05:08 PM, Felipe Balbi wrote: >>> On Wed, Nov 12, 2014 at 04:58:16PM +0200, Roger Quadros wrote: On TI SoCs (e.g. DRA7) we don't support the DWC3 hibernation f

Re: [PATCH] usb: dwc3: gadget: Fix broken gadget on system suspend/resume

2014-11-12 Thread Felipe Balbi
Hi, On Wed, Nov 12, 2014 at 05:32:00PM +0200, Roger Quadros wrote: > On 11/12/2014 05:08 PM, Felipe Balbi wrote: > > On Wed, Nov 12, 2014 at 04:58:16PM +0200, Roger Quadros wrote: > >> On TI SoCs (e.g. DRA7) we don't support the DWC3 hibernation feature. > >> We need to stop the gadget controller

Re: [PATCH] usb: dwc3: gadget: Fix broken gadget on system suspend/resume

2014-11-12 Thread Roger Quadros
On 11/12/2014 05:08 PM, Felipe Balbi wrote: > On Wed, Nov 12, 2014 at 04:58:16PM +0200, Roger Quadros wrote: >> On TI SoCs (e.g. DRA7) we don't support the DWC3 hibernation feature. >> We need to stop the gadget controller while system suspend >> else it results in L3 Bus errors on resume with brok

Re: [PATCH] usb: dwc3: gadget: Fix broken gadget on system suspend/resume

2014-11-12 Thread Felipe Balbi
On Wed, Nov 12, 2014 at 04:58:16PM +0200, Roger Quadros wrote: > On TI SoCs (e.g. DRA7) we don't support the DWC3 hibernation feature. > We need to stop the gadget controller while system suspend > else it results in L3 Bus errors on resume with broken > USB gadget on J6-evm. > > [ 55.718226] WA

Re: usb: gadget: midi: f_midi_alloc() can be static

2014-11-12 Thread Felipe Balbi
On Wed, Nov 12, 2014 at 09:28:24PM +0800, Fengguang Wu wrote: > drivers/usb/gadget/function/f_midi.c:1072:21: sparse: symbol 'f_midi_alloc' > was not declared. Should it be static? > drivers/usb/gadget/legacy/gmidi.c:118:30: sparse: symbol 'fi_midi' was not > declared. Should it be static? > driv

Re: [PATCH v8 0/7] usb: add support for the generic PHY framework

2014-11-12 Thread Felipe Balbi
On Wed, Nov 12, 2014 at 09:33:09AM +0800, Peter Chen wrote: > On Fri, Nov 07, 2014 at 12:08:52PM -0600, Felipe Balbi wrote: > > On Fri, Nov 07, 2014 at 12:08:20PM -0600, Felipe Balbi wrote: > > > Hi, > > > > > > On Fri, Nov 07, 2014 at 01:33:25PM +, Peter Chen wrote: > > > > > > > > > > > >

[PATCH] usb: dwc3: gadget: Fix broken gadget on system suspend/resume

2014-11-12 Thread Roger Quadros
On TI SoCs (e.g. DRA7) we don't support the DWC3 hibernation feature. We need to stop the gadget controller while system suspend else it results in L3 Bus errors on resume with broken USB gadget on J6-evm. [ 55.718226] WARNING: CPU: 0 PID: 0 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler

[PATCH] usb: gadget: f_hid: hidg_alloc() can be static

2014-11-12 Thread Fengguang Wu
drivers/usb/gadget/function/f_hid.c:852:21: sparse: symbol 'hidg_alloc' was not declared. Should it be static? Signed-off-by: Fengguang Wu --- f_hid.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.

[PATCH] usb: phy: fsl: Fix build errors

2014-11-12 Thread Felipe Balbi
commit e47d925 (usb: move the OTG state from the USB PHY to the OTG structure) moved the OTG state from struct usb_phy to struct usb_otg. Unfortunately, even though I fixed quite a few build regressions with that patch already, this one was still missing. Note that this driver still has other ran

Re: [V2 PATCH 04/10] added media agnostic (MA) USB packet handling

2014-11-12 Thread Oliver Neukum
On Mon, 2014-11-10 at 18:09 -0800, Stephanie Wallick wrote: > +/** > + * Compares 2 request IDs. Returns true if a is less than b. Handles > request id > + * wraparound. > + */ > +bool mausb_req_id_lt(u8 a, u8 b) Unify such functions. It's just silly to have so many of them. > +/** > + * Calculat

Re: Understanding what's going on when using a Huawei E173 USB 3G web-stick (UMTS/HSPA)

2014-11-12 Thread Sedat Dilek
On Wed, Nov 12, 2014 at 12:51 PM, Aleksander Morgado wrote: > [...} > I saw the reporter talk about Ubuntu Precise (12.04) and Trusty (14.04), so > only in the latter mmcli will be available (if I'm not mistaken). For > Precise, this Ubuntu page shows how to enable debug logs: > https://wiki.ubunt

Re: Patch for 3.18-rc4 to add OLIMEX ISP500 AVR Programmer

2014-11-12 Thread Sid Boyce
On 12/11/14 08:27, Johan Hovold wrote: On Wed, Nov 12, 2014 at 12:04:27AM +, Sid Boyce wrote: On 11/11/14 19:46, Johan Hovold wrote: On Tue, Nov 11, 2014 at 04:43:52PM +, Sid Boyce wrote: Results --- root@sdrbox:~# lsusb Bus 002 Device 004: ID 13fd:1840 Initio Corporation INIC-

Re: Understanding what's going on when using a Huawei E173 USB 3G web-stick (UMTS/HSPA)

2014-11-12 Thread Sedat Dilek
On Wed, Nov 12, 2014 at 12:51 PM, Aleksander Morgado wrote: > > On Tue, Nov 4, 2014 at 5:55 PM, Dan Williams wrote: >> >> > The next mystery is what is network-manager doing in the background? >> > I have seen that modem-manager is invoked, but as said I would like to >> > understand the "interna

Re: Understanding what's going on when using a Huawei E173 USB 3G web-stick (UMTS/HSPA)

2014-11-12 Thread Sedat Dilek
On Tue, Nov 4, 2014 at 5:55 PM, Dan Williams wrote: > On Tue, 2014-11-04 at 16:11 +0100, Sedat Dilek wrote: >> Hi, >> >> I wanted to understand what is going on the kernel-side when >> connecting to the Internet via a Huawei E173 USB web-stick (3rd >> Generation: UMTS / HSPA). >> >> Especially the

Re: Understanding what's going on when using a Huawei E173 USB 3G web-stick (UMTS/HSPA)

2014-11-12 Thread Aleksander Morgado
> > NetworkManager uses ModemManager for all WWAN control, NM only handles > the configuration storage and IP addressing parts of the setup. > ModemManager handles modem hardware detection, capability detection, > WWAN registration and setup, signal strength reporting, network > connection initiati

[PATCH] usb: Use dma_zalloc_coherent

2014-11-12 Thread Jisheng Zhang
Use the zeroing version instead of dma_alloc_coherent and memset() as 0. Signed-off-by: Jisheng Zhang --- drivers/usb/dwc2/hcd_ddma.c | 5 + drivers/usb/host/uhci-hcd.c | 3 +-- drivers/usb/host/xhci-mem.c | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dw

[PATCH] phy: phy-samsung-usb2: Don't use same name for driver name and global structure

2014-11-12 Thread Vivek Gautam
Using the same driver name for platform driver and a globally defined, structure used throughout the file, looks a bit unpleasing. So changing the driver name from "samsung_usb2_phy_driver" to "samsung_usb2_phy" Signed-off-by: Vivek Gautam Cc: Kamil Debski Cc: Kishon Vijay Abraham I --- driver

RE: "asix: Don't reset PHY on if_up for ASIX 88772" breaks net on arndale platform

2014-11-12 Thread Stam, Michel [FINT]
Hello Ben, Regarding the code snippet; Good question, The original code didn't do this either, which is why I left it as it is. It could cause undesirable behaviour, agreed. After a quick driver examination: I do see that asix_set_sw_mii and asix_set_hw_mii are called prior to the actual write

Re: [V2 PATCH 02/10] added media agnostic (MA) USB HCD roothubs

2014-11-12 Thread Oliver Neukum
On Mon, 2014-11-10 at 18:09 -0800, Stephanie Wallick wrote: > This is where we implement USB 2.0 and 3.0 roothubs. From the host's > perspective, hub state is set and tracked just like any other USB roothub. > Likewise, requests to the roothub appear to be handled like any other wired > USB request

Re: usb media detection issue on USB_MUSB_HDRC on kernel 3.17

2014-11-12 Thread Angelo Dureghello
Hi don't know if you have already fixed this, anyway, i finally solved with this patch, iff --git a/drivers/usb/musb/da8xx.c b/../linux-3.17/drivers/usb/musb/da8xx.c index 4e13fe2..058775e 100644 --- a/drivers/usb/musb/da8xx.c +++ b/../linux-3.17/drivers/usb/musb/da8xx.c @@ -184,11 +184,6 @@ s

Re: Patch for 3.18-rc4 to add OLIMEX ISP500 AVR Programmer

2014-11-12 Thread Johan Hovold
On Wed, Nov 12, 2014 at 12:04:27AM +, Sid Boyce wrote: > On 11/11/14 19:46, Johan Hovold wrote: > > On Tue, Nov 11, 2014 at 04:43:52PM +, Sid Boyce wrote: > >> Results > >> --- > >> root@sdrbox:~# lsusb > >> Bus 002 Device 004: ID 13fd:1840 Initio Corporation INIC-1608 SATA bridge >