Re: [PATCH v3 2/4] extcon: usb-gpio: add support for VBUS detection

2015-04-16 Thread Chanwoo Choi
Hi Peter, On 04/16/2015 10:59 AM, Peter Chen wrote: > On Wed, Apr 15, 2015 at 06:26:23PM +0900, Chanwoo Choi wrote: >> Hi Roger and Peter, >> >> On 04/15/2015 04:50 PM, Roger Quadros wrote: >>> On 15/04/15 06:27, Peter Chen wrote: On Tue, Apr 14, 2015 at 08:29:34PM +0900, Chanwoo Choi wrote:

Re: [PATCH v3 2/4] extcon: usb-gpio: add support for VBUS detection

2015-04-16 Thread Ivan T. Ivanov
Hi, On Thu, 2015-04-16 at 16:00 +0900, Chanwoo Choi wrote: > Hi Peter, > > On 04/16/2015 10:59 AM, Peter Chen wrote: > > > > Ok, from USB point, external id/vbus value can't decide > > which role the controller will be, the controller driver > > will decide role according to many things, eg, us

Re: [PATCH v3 2/4] extcon: usb-gpio: add support for VBUS detection

2015-04-16 Thread Roger Quadros
On 16/04/15 10:00, Chanwoo Choi wrote: > Hi Peter, > > On 04/16/2015 10:59 AM, Peter Chen wrote: >> On Wed, Apr 15, 2015 at 06:26:23PM +0900, Chanwoo Choi wrote: >>> Hi Roger and Peter, >>> >>> On 04/15/2015 04:50 PM, Roger Quadros wrote: On 15/04/15 06:27, Peter Chen wrote: > On Tue, Apr

Re: [PATCHv2 1/3] phy: core: Add devm_of_phy_get_by_index to phy-core

2015-04-16 Thread Peter Chen
On Mon, Apr 13, 2015 at 03:10:45PM -0700, Arun Ramamurthy wrote: > Some generic drivers, such as ehci, may use multiple phys and for such > drivers referencing phy(s) by name(s) does not make sense. Instead of > inventing new naming schemes and using custom code to iterate through them, > such driv

Re: [PATCH] usb: ehci-msm: Don't ioremap configuration space exclusively

2015-04-16 Thread Ivan T. Ivanov
Hi, On Wed, 2015-04-15 at 21:28 +0530, Vivek Gautam wrote: > On Thu, Apr 9, 2015 at 8:19 PM, Alan Stern wrote: > > On Thu, 9 Apr 2015, Ivan T. Ivanov wrote: > > > > > This allow same IO space to be shared between HCD and Device > > > controller driver. Which can be loaded simultaneously and > >

Re: [PATCH v2] usb: chipidea: Use extcon framework for VBUS and ID detect

2015-04-16 Thread Peter Chen
On Wed, Apr 15, 2015 at 04:35:15PM +0300, Ivan T. Ivanov wrote: > On recent Qualcomm platforms VBUS and ID lines are not routed to > USB PHY LINK controller. Use extcon framework to receive connect > and disconnect ID and VBUS notification. > > Signed-off-by: Ivan T. Ivanov > --- > > Changes sin

Re: [PATCH v3 2/4] extcon: usb-gpio: add support for VBUS detection

2015-04-16 Thread Chanwoo Choi
On 04/16/2015 04:13 PM, Ivan T. Ivanov wrote: > Hi, > > On Thu, 2015-04-16 at 16:00 +0900, Chanwoo Choi wrote: >> Hi Peter, >> >> On 04/16/2015 10:59 AM, Peter Chen wrote: >>> > >>> Ok, from USB point, external id/vbus value can't decide >>> which role the controller will be, the controller drive

Re: [PATCH v3 2/4] extcon: usb-gpio: add support for VBUS detection

2015-04-16 Thread Peter Chen
On Thu, Apr 16, 2015 at 10:13:44AM +0300, Ivan T. Ivanov wrote: > Hi, > > On Thu, 2015-04-16 at 16:00 +0900, Chanwoo Choi wrote: > > Hi Peter, > > > > On 04/16/2015 10:59 AM, Peter Chen wrote: > > > > > > > Ok, from USB point, external id/vbus value can't decide > > > which role the controller

Re: [PATCH v3 2/4] extcon: usb-gpio: add support for VBUS detection

2015-04-16 Thread Peter Chen
On Thu, Apr 16, 2015 at 04:59:31PM +0900, Chanwoo Choi wrote: > On 04/16/2015 04:13 PM, Ivan T. Ivanov wrote: > > Hi, > > > > On Thu, 2015-04-16 at 16:00 +0900, Chanwoo Choi wrote: > >> Hi Peter, > >> > >> On 04/16/2015 10:59 AM, Peter Chen wrote: > >>> > > > >>> Ok, from USB point, external id/v

Re: [PATCH v3 2/4] extcon: usb-gpio: add support for VBUS detection

2015-04-16 Thread Chanwoo Choi
On 04/16/2015 05:01 PM, Peter Chen wrote: > On Thu, Apr 16, 2015 at 04:59:31PM +0900, Chanwoo Choi wrote: >> On 04/16/2015 04:13 PM, Ivan T. Ivanov wrote: >>> Hi, >>> >>> On Thu, 2015-04-16 at 16:00 +0900, Chanwoo Choi wrote: Hi Peter, On 04/16/2015 10:59 AM, Peter Chen wrote: >

Re: [RFC][PATCH v2 01/13] usb: otg-fsm: Add documentation for struct otg_fsm

2015-04-16 Thread Peter Chen
On Tue, Apr 14, 2015 at 01:41:48PM +0300, Roger Quadros wrote: > struct otg_fsm is the interface to the OTG state machine. > > Document the input, output and internal state variables. > Definations are taken from Table 7-2 and Table 7-4 of > the USB OTG & EH Specification Rev.2.0 > > Re-arrange s

Re: [RFC][PATCH v2 02/13] usb: otg-fsm: support multiple instances

2015-04-16 Thread Peter Chen
On Tue, Apr 14, 2015 at 01:41:49PM +0300, Roger Quadros wrote: > Move the state_changed variable into struct otg_fsm > so that we can support multiple instances. OTG device has only one port. See 3.1.1. If you go to pass OTG Certification, the lab requires that there is only one port at your board

Re: [RFC][PATCH v2 03/13] usb: otg-fsm: Prevent build warning "VDBG" redefined

2015-04-16 Thread Peter Chen
On Tue, Apr 14, 2015 at 01:41:50PM +0300, Roger Quadros wrote: > If usb/otg-fsm.h and usb/composite.h are included together > then it results in the build warning [1]. > > Prevent that by moving the VDBG defination into the > usb-otg-fsm.c file where it is used. > > Also get rid of MPC_LOC which

Re: Unable to access USB mass storage device with xhci. okay with ehci

2015-04-16 Thread Hans de Goede
Hi, On 09-04-15 20:30, Steve Bangert wrote: On Thu, 2015-04-09 at 16:49 +0200, Hans de Goede wrote: Hi, On 09-04-15 15:27, Steve Bangert wrote: On Wed, 2015-04-08 at 10:56 -0400, Alan Stern wrote: On Wed, 8 Apr 2015, Steve Bangert wrote: What i did was not correct, usb-storage.quirks=174c:

Re: [RFC][PATCH v2 04/13] usb: gadget: add usb_gadget_start/stop()

2015-04-16 Thread Peter Chen
On Tue, Apr 14, 2015 at 01:41:51PM +0300, Roger Quadros wrote: > The OTG state machine needs a mechanism to start and > stop the gadget controller. Add usb_gadget_start() > and usb_gadget_stop(). > > Signed-off-by: Roger Quadros > --- > drivers/usb/gadget/udc/udc-core.c | 74 > +

Re: Unable to access USB mass storage device with xhci. okay with ehci

2015-04-16 Thread Steve Bangert
On Thu, 2015-04-16 at 13:49 +0200, Hans de Goede wrote: > Hi, > > On 09-04-15 20:30, Steve Bangert wrote: > > On Thu, 2015-04-09 at 16:49 +0200, Hans de Goede wrote: > >> Hi, > >> > >> On 09-04-15 15:27, Steve Bangert wrote: > >>> On Wed, 2015-04-08 at 10:56 -0400, Alan Stern wrote: > On Wed,

Re: [RFC][PATCH v2 02/13] usb: otg-fsm: support multiple instances

2015-04-16 Thread Roger Quadros
On 16/04/15 14:36, Peter Chen wrote: > On Tue, Apr 14, 2015 at 01:41:49PM +0300, Roger Quadros wrote: >> Move the state_changed variable into struct otg_fsm >> so that we can support multiple instances. > > OTG device has only one port. See 3.1.1. > If you go to pass OTG Certification, the lab req

Re: [RFC][PATCH v2 03/13] usb: otg-fsm: Prevent build warning "VDBG" redefined

2015-04-16 Thread Roger Quadros
On 16/04/15 14:41, Peter Chen wrote: > On Tue, Apr 14, 2015 at 01:41:50PM +0300, Roger Quadros wrote: >> If usb/otg-fsm.h and usb/composite.h are included together >> then it results in the build warning [1]. >> >> Prevent that by moving the VDBG defination into the >> usb-otg-fsm.c file where it i

Re: [RFC][PATCH v2 05/13] usb: otg: add OTG core

2015-04-16 Thread Peter Chen
On Tue, Apr 14, 2015 at 01:41:52PM +0300, Roger Quadros wrote: > The OTG core instantiates the OTG Finite State Machine > per OTG controller and manages starting/stopping the > host and gadget controllers based on the bus state. > > It provides APIs for the following tasks > > - Registering an OT

Re: [RFC][PATCH v2 04/13] usb: gadget: add usb_gadget_start/stop()

2015-04-16 Thread Roger Quadros
On 16/04/15 14:48, Peter Chen wrote: > On Tue, Apr 14, 2015 at 01:41:51PM +0300, Roger Quadros wrote: >> The OTG state machine needs a mechanism to start and >> stop the gadget controller. Add usb_gadget_start() >> and usb_gadget_stop(). >> >> Signed-off-by: Roger Quadros >> --- >> drivers/usb/ga

Re: [RFC][PATCH v2 02/13] usb: otg-fsm: support multiple instances

2015-04-16 Thread Peter Chen
On Thu, Apr 16, 2015 at 02:58:20PM +0300, Roger Quadros wrote: > On 16/04/15 14:36, Peter Chen wrote: > > On Tue, Apr 14, 2015 at 01:41:49PM +0300, Roger Quadros wrote: > >> Move the state_changed variable into struct otg_fsm > >> so that we can support multiple instances. > > > > OTG device has o

Re: [RFC][PATCH v2 03/13] usb: otg-fsm: Prevent build warning "VDBG" redefined

2015-04-16 Thread Peter Chen
On Thu, Apr 16, 2015 at 02:59:12PM +0300, Roger Quadros wrote: > On 16/04/15 14:41, Peter Chen wrote: > > On Tue, Apr 14, 2015 at 01:41:50PM +0300, Roger Quadros wrote: > >> If usb/otg-fsm.h and usb/composite.h are included together > >> then it results in the build warning [1]. > >> > >> Prevent t

Re: [RFC][PATCH v2 04/13] usb: gadget: add usb_gadget_start/stop()

2015-04-16 Thread Peter Chen
On Thu, Apr 16, 2015 at 03:07:41PM +0300, Roger Quadros wrote: > On 16/04/15 14:48, Peter Chen wrote: > > On Tue, Apr 14, 2015 at 01:41:51PM +0300, Roger Quadros wrote: > >> The OTG state machine needs a mechanism to start and > >> stop the gadget controller. Add usb_gadget_start() > >> and usb_gad

[PATCH 3/3] uas: Set max_sectors_240 quirk for ASM1053 devices

2015-04-16 Thread Hans de Goede
Testing has shown that ASM1053 devices do not work properly with transfers larger than 240 sectors, so set max_sectors to 240 on these. Reported-by: Steve Bangert Signed-off-by: Hans de Goede --- drivers/usb/storage/uas-detect.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --

[PATCH 2/3] uas: Add US_FL_MAX_SECTORS_240 flag

2015-04-16 Thread Hans de Goede
The usb-storage driver sets max_sectors = 240 in its scsi-host template, for uas we do not want to do that for all devices, but testing has shown that some devices need it. This commit adds a US_FL_MAX_SECTORS_240 flag for such devices, and implements support for it in uas.c, while at it it also a

[PATCH 1/3] uas: Allow uas_use_uas_driver to return usb-storage flags

2015-04-16 Thread Hans de Goede
uas_use_uas_driver may set some US_FL_foo flags during detection, currently these are stored in a local variable and then throw away, but these may be of interest to the caller, so add an extra parameter to (optionally) return the detected flags, and use this in the uas driver. Signed-off-by: Hans

[PATCH] usb: gadget: xudc: fix return value check in xudc_probe()

2015-04-16 Thread weiyj_lk
From: Wei Yongjun In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- drivers/usb/gadget/udc/udc-xilinx.c | 4 ++-- 1 file changed, 2 insertions

Re: [RFC][PATCH v2 05/13] usb: otg: add OTG core

2015-04-16 Thread Roger Quadros
On 16/04/15 15:02, Peter Chen wrote: > On Tue, Apr 14, 2015 at 01:41:52PM +0300, Roger Quadros wrote: >> The OTG core instantiates the OTG Finite State Machine >> per OTG controller and manages starting/stopping the >> host and gadget controllers based on the bus state. >> >> It provides APIs for t

[PATCH -next] usb: gadget: uvc: remove unused including

2015-04-16 Thread weiyj_lk
From: Wei Yongjun Remove including that don't need it. Signed-off-by: Wei Yongjun --- drivers/usb/gadget/function/uvc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/function/uvc.h b/drivers/usb/gadget/function/uvc.h index 3390ecd..eedf0b1 100644 --- a/drivers/usb/gad

Re: [PATCH] hso: fix refcnt leak in recent patch.

2015-04-16 Thread Olivier Sobrie
On Tue, Apr 14, 2015 at 11:03:03AM +1000, NeilBrown wrote: > On Tue, 14 Apr 2015 09:36:34 +1000 NeilBrown wrote: > > > > > > > Prior to > > commit 29bd3bc1194c624ce863cab2a7da9bc1f0c3b47b > > hso: fix crash when device disappears while serial port is open > > > > hso_serial_open would alwa

Re: [PATCH 1/3] uas: Allow uas_use_uas_driver to return usb-storage flags

2015-04-16 Thread Steve Bangert
On Thu, 2015-04-16 at 14:17 +0200, Hans de Goede wrote: > uas_use_uas_driver may set some US_FL_foo flags during detection, currently > these are stored in a local variable and then throw away, but these may be > of interest to the caller, so add an extra parameter to (optionally) return > the dete

Error: DMA: Out of SW-IOMMU space [was: External USB drives become unresponsive after few hours.]

2015-04-16 Thread Alan Stern
On Thu, 16 Apr 2015, Dorian Gray wrote: > I have tested the following kernel versions: > - 3.18.4, 3.18.6, 3.18.7, 3.19.4 [all affected] > - 3.17.1 [unaffected] > - 3.17.8 [probably the last unaffected version; I'm using it currently] > > Also, I've been using the very same configuration (hardwar

Re: [PATCH] usb: gadget: xudc: fix return value check in xudc_probe()

2015-04-16 Thread Michal Simek
On 04/16/2015 02:17 PM, weiyj...@163.com wrote: > From: Wei Yongjun > > In case of error, the function devm_ioremap_resource() returns > ERR_PTR() and never returns NULL. The NULL test in the return > value check should be replaced with IS_ERR(). > > Signed-off-by: Wei Yongjun > --- > drivers/

Re: [PATCH 2/3] uas: Add US_FL_MAX_SECTORS_240 flag

2015-04-16 Thread Alan Stern
On Thu, 16 Apr 2015, Hans de Goede wrote: > The usb-storage driver sets max_sectors = 240 in its scsi-host template, for > uas we do not want to do that for all devices, but testing has shown that > some devices need it. > > This commit adds a US_FL_MAX_SECTORS_240 flag for such devices, and impl

Re: Error: DMA: Out of SW-IOMMU space [was: External USB drives become unresponsive after few hours.]

2015-04-16 Thread Suman Tripathi
On Thu, 16 Apr 2015, Dorian Gray wrote: > I have tested the following kernel versions: > - 3.18.4, 3.18.6, 3.18.7, 3.19.4 [all affected] > - 3.17.1 [unaffected] > - 3.17.8 [probably the last unaffected version; I'm using it currently] > > Also, I've been using the very same configuration (hardware

Re: Error: DMA: Out of SW-IOMMU space [was: External USB drives become unresponsive after few hours.]

2015-04-16 Thread Alexander Duyck
On 04/16/2015 07:15 AM, Alan Stern wrote: > On Thu, 16 Apr 2015, Dorian Gray wrote: > >> I have tested the following kernel versions: >> - 3.18.4, 3.18.6, 3.18.7, 3.19.4 [all affected] >> - 3.17.1 [unaffected] >> - 3.17.8 [probably the last unaffected version; I'm using it currently] >> >> Also, I'

Re: irritating message "defaulting to EHCI.", if USB isn't compiled into the kernel

2015-04-16 Thread Alan Stern
On Wed, 15 Apr 2015, Toralf Förster wrote: > Hi, > > the following warning "pci :00:14.0: CONFIG_USB_XHCI_HCD is > turned off, defaulting to EHCI." > > makes no sense, if USB isn't compiled into the kernel. > > Looks like another cosmetic issue in the same field as already > discussed earli

Re: irritating message "defaulting to EHCI.", if USB isn't compiled into the kernel

2015-04-16 Thread Toralf Förster
On 04/16/2015 05:54 PM, Alan Stern wrote: > On Wed, 15 Apr 2015, Toralf Förster wrote: > >> Hi, >> >> the following warning "pci :00:14.0: CONFIG_USB_XHCI_HCD is >> turned off, defaulting to EHCI." >> >> makes no sense, if USB isn't compiled into the kernel. >> >> Looks like another cosmetic i

Re: Error: DMA: Out of SW-IOMMU space [was: External USB drives become unresponsive after few hours.]

2015-04-16 Thread Dorian Gray
On 16 April 2015 at 16:15, Alan Stern wrote: > This appears to be a problem with the IOMMU or SWIOTLB subsystems, not > the USB subsystem. I have CC'ed the appropriate mailing lists. Thanks, I'm far from being a kernel expert, so was expecting it could be wrong subsection. On 16 April 2015 at

[PATCH] USB: don't build PCI quirks if USB support isn't configured

2015-04-16 Thread Alan Stern
The USB PCI quirks code gets built into the kernel whenever CONFIG_PCI is enabled, even if CONFIG_USB is not set. This can cause unnecessary messages to show up in the kernel log, such as "CONFIG_USB_XHCI_HCD is turned off, defaulting to EHCI" (which makes no sense when the kernel has been configu

Re: Error: DMA: Out of SW-IOMMU space [was: External USB drives become unresponsive after few hours.]

2015-04-16 Thread Konrad Rzeszutek Wilk
On Thu, Apr 16, 2015 at 06:57:46PM +0200, Dorian Gray wrote: > On 16 April 2015 at 16:15, Alan Stern wrote: > > This appears to be a problem with the IOMMU or SWIOTLB subsystems, not > > the USB subsystem. I have CC'ed the appropriate mailing lists. > > Thanks, I'm far from being a kernel expert

Re: Error: DMA: Out of SW-IOMMU space [was: External USB drives become unresponsive after few hours.]

2015-04-16 Thread Dorian Gray
On 16 April 2015 at 20:42, Konrad Rzeszutek Wilk wrote: > And easier way is to compile the kernel with CONFIG_DMA_API_DEBUG > and then load the attached module. > > That should tell you who and what else is holding on the buffers. Thanks, this will be my next step then, right after I'm done with

Driver initial sequence of usb drivers

2015-04-16 Thread yoma sophian
hi all: if we build usb driver as module, the dependence is like below: usb-common.ko usbcore.ko ehci-hcd.ko ... etc. if we choose build-in instead of modules, how could we make sure the initial sequence is indeed followed what we expected? appreciate your kind help in advance, -- To unsubscribe f

Re: [RFC][PATCH v2 06/13] usb: hcd: Add hcd add/remove functions for OTG use

2015-04-16 Thread Peter Chen
On Tue, Apr 14, 2015 at 01:41:53PM +0300, Roger Quadros wrote: > The existing usb_add/remove_hcd() functionality > remains unchanged for non-OTG devices. For OTG > devices they only register the HCD with the OTG core. > > Introduce _usb_add/remove_hcd() for use by OTG core. > These functions actua

Re: [RFC][PATCH v2 08/13] usb: otg: hub: Notify OTG fsm when A device sets b_hnp_enable

2015-04-16 Thread Peter Chen
On Tue, Apr 14, 2015 at 01:41:55PM +0300, Roger Quadros wrote: > This is the a_set_b_hnp_enable flag in the OTG state machine > diagram and must be set when the A-Host has successfully set > the b_hnp_enable feature of the OTG-B-Peripheral attached to it. > > When this bit changes we kick our OTG

[PATCH 1/1] drivers/usb/chipidea/debuc.c: avoid out of bound read

2015-04-16 Thread Heinrich Schuchardt
A string written by the user may not be zero terminated. sscanf may read memory beyond the buffer if no zero byte is found. Signed-off-by: Heinrich Schuchardt --- drivers/usb/chipidea/debug.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/debug.c b

Re: Driver initial sequence of usb drivers

2015-04-16 Thread Greg KH
On Fri, Apr 17, 2015 at 09:22:02AM +0800, yoma sophian wrote: > hi all: > if we build usb driver as module, the dependence is like below: > usb-common.ko > usbcore.ko > ehci-hcd.ko > ... > etc. > if we choose build-in instead of modules, how could we make sure the > initial sequence is indeed follo