Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-10-27 Thread Baolin Wang
Hi Felipe, On 19 October 2016 at 10:37, Baolin Wang <baolin.w...@linaro.org> wrote: > Currently the Linux kernel does not provide any standard integration of this > feature that integrates the USB subsystem with the system power regulation > provided by PMICs meaning that either v

Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-11-07 Thread Baolin Wang
On 3 November 2016 at 09:25, NeilBrown <ne...@suse.com> wrote: > On Tue, Nov 01 2016, Baolin Wang wrote: > > >>> So I won't be responding on this topic any further until I see a genuine >>> attempt to understand and resolve the inconsistencies with >>>

Re: [PATCH v4] USB hub_probe: rework ugly goto-into-compound-statement

2016-11-09 Thread Baolin Wang
Hi, On 9 November 2016 at 23:35, Eugene Korenevsky wrote: > Rework smelling code (goto inside compound statement). Perhaps this is > legacy. Anyway such code is not appropriate for Linux kernel. > > Changes since v3: fix typo > Changes since v2: extract the code to static

Re: [PATCH v3 5/6] usb: dwc3: use bus->sysdev for DMA configuration

2016-11-10 Thread Baolin Wang
ns(-) > Tested on my dwc3 platform, it can work well as host or gadget. You can add my tested tag for patch 1/4/5 after fixing Felipe's issue. Tested-by: Baolin Wang <baolin.w...@linaro.org> -- Baolin.wang Best Regards -- To unsubscribe from this list: send the line "unsu

Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-11-10 Thread Baolin Wang
Hi On 8 November 2016 at 04:36, NeilBrown <ne...@suse.com> wrote: > On Mon, Nov 07 2016, Baolin Wang wrote: > >> On 3 November 2016 at 09:25, NeilBrown <ne...@suse.com> wrote: >>> On Tue, Nov 01 2016, Baolin Wang wrote: >> >> I agree with your most op

Re: usb_ep_{dis,en}able() calling context (was: Re: [PATCH 2/3] usb: dwc3: gadget: wait for End Transfer to complete)

2016-10-18 Thread Baolin Wang
Hi, On 18 October 2016 at 16:21, Felipe Balbi <felipe.ba...@linux.intel.com> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> Sure. The problem I met was, when we change the USB function with >> configfs frequently, sometimes it will han

Re: usb_ep_{dis,en}able() calling context (was: Re: [PATCH 2/3] usb: dwc3: gadget: wait for End Transfer to complete)

2016-10-18 Thread Baolin Wang
On 18 October 2016 at 16:21, Felipe Balbi <felipe.ba...@linux.intel.com> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>> Alan Stern <st...@rowland.harvard.edu> writes: >>>>> Baolin Wang <baolin.w...@linaro.org> writes:

Re: usb_ep_{dis,en}able() calling context (was: Re: [PATCH 2/3] usb: dwc3: gadget: wait for End Transfer to complete)

2016-10-18 Thread Baolin Wang
Hi, On 18 October 2016 at 15:19, Felipe Balbi <felipe.ba...@linux.intel.com> wrote: > > Hi, > > Alan Stern <st...@rowland.harvard.edu> writes: >>> Baolin Wang <baolin.w...@linaro.org> writes: >>> >> Felipe Balbi <felipe.ba...@linux.intel.co

Re: usb_ep_{dis,en}able() calling context (was: Re: [PATCH 2/3] usb: dwc3: gadget: wait for End Transfer to complete)

2016-10-20 Thread Baolin Wang
Hi, On 19 October 2016 at 18:09, Felipe Balbi <felipe.ba...@linux.intel.com> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> >> We should not check the DWC3_EP_ENABLED flag, since we will clear all >> flags i

Re: [PATCH v2] usb: dwc3: gadget: Wait for end transfer complete before free irq

2016-10-14 Thread Baolin Wang
Hi Felipe, On 14 October 2016 at 15:46, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>>>>>>>> I see what the problem is. Databook tells us we *must* set CMDIOC >>>>>>&g

[PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-14 Thread Baolin Wang
the DEVCTRLHLT flag. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v3: - Remove the patch 1 which will cause start gadget failed. - Remove try_again and refactor the code. Changes since v2: - Move disconnect checking into dwc3_send_gadget_ep_cmd(). - Rename completio

Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-17 Thread Baolin Wang
Hi, On 17 October 2016 at 19:53, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>> Baolin Wang <baolin.w...@linaro.org> writes: >>>> When we change the USB function with configfs dynamically,

[PATCH v18 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger

2016-10-18 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger can implement the usb_charger_plug_by_gadget() function, usb_charger_exit() function and dev_to_uchger() function by getting 'struct usb_charger' from 'struct gadget'. Signed-off-by: Baolin Wang <baolin.w...@linaro.

[PATCH v18 1/4] usb: gadget: Introduce the usb charger framework

2016-10-18 Thread Baolin Wang
or usb gadget state. This patch doesn't yet integrate with the gadget code, so some functions which rely on the 'gadget' are not completed, that will be implemented in the following patches. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Reviewed-by: Li Jun <jun...@nxp.com> Tested-by:

[PATCH v18 2/4] usb: gadget: Support for the usb charger framework

2016-10-18 Thread Baolin Wang
For supporting the usb charger, it adds the usb_charger_init() and usb_charger_exit() functions for usb charger initialization and exit. It will report to the usb charger when the gadget state is changed, then the usb charger can do the power things. Signed-off-by: Baolin Wang <baoli

[PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-10-18 Thread Baolin Wang
since v11: - Reviewed and tested by Li Jun. Changes since v10: - Introduce usb_charger_get_state() function to check charger state. - Remove the mutex lock in usb_charger_set_cur_limit_by_type() function in case will be issued in atomic context. Baolin Wang (4): usb: gadget: Introduce the u

[PATCH v18 4/4] power: wm831x_power: Support USB charger current limit management

2016-10-18 Thread Baolin Wang
-by: Mark Brown <broo...@kernel.org> Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Acked-by: Lee Jones <lee.jo...@linaro.org> Acked-by: Charles Keepax <ckee...@opensource.wolfsonmicro.com> Acked-by: Peter Chen <peter.c...@freescale.com> Acked-by: Seba

Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-11-14 Thread Baolin Wang
On 14 November 2016 at 12:21, NeilBrown <ne...@suse.com> wrote: > On Thu, Nov 10 2016, Baolin Wang wrote: > >> Hi >> >> On 8 November 2016 at 04:36, NeilBrown <ne...@suse.com> wrote: >>> On Mon, Nov 07 2016, Baolin Wang wrote: >>> >>>

[PATCH] usb: dwc3: core: Disable USB2.0 phy suspend when dwc3 acts as host role

2016-11-15 Thread Baolin Wang
clock when disconnecting the slow USB decice, that will hang on the xHCI commands executing which depends on the phy clock. Thus we should disable USB2.0 phy suspend feature when dwc3 acts as host role. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/dwc3/core.c

[PATCH] usb: host: xhci: Remove unused 'addr_64' variable in xhci_hcd structure

2016-11-15 Thread Baolin Wang
Since the 'addr_64' variable as legacy is unused now, then remove it from xhci_hcd structure. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/host/xhci.h |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 3

[PATCH v3 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-23 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this requirement. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v2: -

[PATCH v3 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-23 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Also call pm_runtime_get_noresume() in probe() function in case the parent device doesn't call suspend/resume callback by runtime PM now. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v2:

[PATCH] usb: xhci: Remove unuseful 'return' statement

2016-11-24 Thread Baolin Wang
Since these 'return' statements are not generally useful in void function, remove them. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/host/xhci-hub.c |2 -- drivers/usb/host/xhci-mem.c |1 - drivers/usb/host/xhci-ring.c |4 drivers/usb/host/

Re: [PATCH v3 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-24 Thread Baolin Wang
e, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Baolin-Wang/usb-host-plat-Enable-xhci-plat-runtime-PM/20161124-012323 > config: x86_64-randconfig-x008-201647 (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.

[PATCH v2] usb: xhci: Remove unuseful 'return' and 'break' statement

2016-11-24 Thread Baolin Wang
Since these 'return' statements are not generally useful in void function, remove them. Also remove one unuseful 'break' statement in xhci_setup_addressable_virt_dev() function. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v1: - Add description of removing

Re: [PATCH] usb: xhci: Remove unuseful 'return' statement

2016-11-24 Thread Baolin Wang
Hi, On 24 November 2016 at 17:30, Sergei Shtylyov <sergei.shtyl...@cogentembedded.com> wrote: > Hello. > > On 11/24/2016 11:13 AM, Baolin Wang wrote: > >> Since these 'return' statements are not generally useful in void function, >> remove them. >> >

Re: [PATCH v2] usb: xhci: Remove unuseful 'return' and 'break' statement

2016-11-28 Thread Baolin Wang
On 28 November 2016 at 23:14, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: > On 28.11.2016 09:41, Baolin Wang wrote: >> >> On 28 November 2016 at 15:21, Greg KH <gre...@linuxfoundation.org> wrote: >>> >>> On Mon, Nov 28, 2016 at 02:29:25PM +

Re: [PATCH v2 1/4] usb: host: xhci: dynamically allocate devs array

2016-11-28 Thread Baolin Wang
st/xhci.c | 19 +++ > drivers/usb/host/xhci.h | 2 +- > 5 files changed, 20 insertions(+), 9 deletions(-) > > Changes since v1: > - accounted for invalid slot 0 which driver assumes to exist. Tested on my dwc3 platform, it can work well as host role.

Re: [PATCH v2] usb: xhci: Remove unuseful 'return' and 'break' statement

2016-11-27 Thread Baolin Wang
On 28 November 2016 at 15:21, Greg KH <gre...@linuxfoundation.org> wrote: > On Mon, Nov 28, 2016 at 02:29:25PM +0800, Baolin Wang wrote: >> Hi Mathias, >> >> On 24 November 2016 at 19:16, Baolin Wang <baolin.w...@linaro.org> wrote: >> > Since these 'r

Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-11-27 Thread Baolin Wang
On 25 November 2016 at 21:00, Mark Brown wrote: > On Tue, Nov 22, 2016 at 09:40:07AM +1100, NeilBrown wrote: > >> I agree that the question of where the responsibility for information >> aggregation lies is open for discussion. If fact all details on how >> things should work

Re: [PATCH v2] usb: xhci: Remove unuseful 'return' and 'break' statement

2016-11-27 Thread Baolin Wang
Hi Mathias, On 24 November 2016 at 19:16, Baolin Wang <baolin.w...@linaro.org> wrote: > Since these 'return' statements are not generally useful in void > function, remove them. Also remove one unuseful 'break' statement > in xhci_setup_addressable_virt_dev() function. > >

[PATCH v4 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-27 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Also call pm_runtime_get_noresume() in probe() function in case the parent device doesn't call suspend/resume callback by runtime PM now. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v3:

[PATCH v4 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-27 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this requirement. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v3: - No u

[PATCH 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-18 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this requirement. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/dwc3/Kconfig

[PATCH 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-18 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/host/xhci-plat.c | 37 - 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci-

Re: [PATCH] usb: dwc3: core: Disable USB2.0 phy suspend when dwc3 acts as host role

2016-11-15 Thread Baolin Wang
Hi, On 15 November 2016 at 18:49, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> When dwc3 controller acts as host role with attaching slow speed device >> (like mouse or keypad). Then if we plugged out the s

Re: [PATCH 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-20 Thread Baolin Wang
e, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Baolin-Wang/usb-host-plat-Enable-xhci-plat-runtime-PM/20161118-202029 > config: i386-allmodconfig (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901

[PATCH v2 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-20 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this requirement. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v1:

[PATCH v2 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-20 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v1: - No updates. --- drivers/usb/host/xhci-plat.c | 37 - 1 file changed, 32 insertions(+), 5 deletions(-)

[PATCH v2] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-31 Thread Baolin Wang
improvements ] Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v1: - Move the suspend checking to right place to avoid checking twice. --- drivers/usb/dwc3/core.h |8 drivers/usb/dwc3/gadget.c | 49 + 2

Re: [PATCH v1] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-31 Thread Baolin Wang
Hi, On 31 October 2016 at 20:53, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> Instead of just delaying for 100us, we should >> actually wait for End Transfer Command Complete >> interrupt before moving

Re: [PATCH v2] usb: dwc3: gadget: wait for End Transfer to complete

2016-11-01 Thread Baolin Wang
Hi, On 1 November 2016 at 19:36, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> Hi, >> >> On 1 November 2016 at 19:01, Felipe Balbi <ba...@kernel.org> wrote: >>> >>> Hi, >>

Re: [PATCH v2] usb: dwc3: gadget: wait for End Transfer to complete

2016-11-01 Thread Baolin Wang
Hi, On 1 November 2016 at 19:01, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> Changes since v1: >> - Move the suspend checking to right place to avoid checking twice. > > there is still one probl

Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-11-01 Thread Baolin Wang
Hi, On 31 October 2016 at 08:00, NeilBrown <ne...@suse.com> wrote: > On Fri, Oct 28 2016, Baolin Wang wrote: > >>> >>> 3/ usb_charger_notify_state() does nothing if the state doesn't change. >>> When the extcon detects an SDP, it will be called to set

Re: [PATCH 75/82] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-31 Thread Baolin Wang
Hi Feilpe, On 31 October 2016 at 18:55, Felipe Balbi <felipe.ba...@linux.intel.com> wrote: > > Hi Baolin, > > Felipe Balbi <felipe.ba...@linux.intel.com> writes: >> From: Baolin Wang <baolin.w...@linaro.org> >> >> Instead of just delaying for 10

[PATCH v1] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-31 Thread Baolin Wang
improvements ] Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/dwc3/core.h |8 drivers/usb/dwc3/gadget.c | 47 + 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/core.h b/drive

Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-10-31 Thread Baolin Wang
On 29 October 2016 at 01:03, Mark Brown <broo...@kernel.org> wrote: > On Fri, Oct 28, 2016 at 08:51:41PM +0800, Baolin Wang wrote: >> On 28 October 2016 at 06:00, NeilBrown <ne...@suse.com> wrote: > >> > 1/ I think we agreed that it doesn't make sense for there to

Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-10-28 Thread Baolin Wang
Hi, On 28 October 2016 at 06:00, NeilBrown <ne...@suse.com> wrote: > On Thu, Oct 27 2016, Baolin Wang wrote: > >> Hi Felipe, >> >> On 19 October 2016 at 10:37, Baolin Wang <baolin.w...@linaro.org> wrote: >>> Currently the Linux kernel does not provide

[PATCH v2] usb: dwc3: gadget: Wait for end transfer complete before free irq

2016-10-12 Thread Baolin Wang
irq, it will not shutdown this gadget irq line), which will trigger the interrupt all the time. Thus we should check if we need wait for the end transfer command completion before free gadget irq. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v1: - Simply the ope

Re: [PATCH v2] usb: dwc3: gadget: Wait for end transfer complete before free irq

2016-10-14 Thread Baolin Wang
Hi Felipe, On 13 October 2016 at 21:34, Felipe Balbi <ba...@kernel.org> wrote: > > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>> Baolin Wang <baolin.w...@linaro.org> writes: >>>>>> Baolin Wang <baolin.w...@linaro

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Baolin Wang
On 13 October 2016 at 16:28, Janusz Dziedzic <janusz.dzied...@tieto.com> wrote: > On 13 October 2016 at 10:21, Baolin Wang <baolin.w...@linaro.org> wrote: >> Hi, >> >> On 13 October 2016 at 16:16, Janusz Dziedzic <janusz.dzied...@tieto.com> >> wrote:

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Baolin Wang
Hi, On 13 October 2016 at 16:16, Janusz Dziedzic <janusz.dzied...@tieto.com> wrote: > On 13 October 2016 at 09:37, Baolin Wang <baolin.w...@linaro.org> wrote: >> Hi, >> >> On 13 October 2016 at 15:06, Felipe Balbi <ba...@kernel.org> wrote: >>> >

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Baolin Wang
Hi, On 13 October 2016 at 15:06, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> When system has stpped the gadget, we should avoid queuing any requests > > queueing is *not* a problem. Starting is. In fact, th

Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-13 Thread Baolin Wang
Hi, On 13 October 2016 at 15:08, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> @@ -1487,10 +1496,22 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, >> int is_on) >> >> is_on = !!is_

Re: [PATCH v2] usb: dwc3: gadget: Wait for end transfer complete before free irq

2016-10-13 Thread Baolin Wang
Hi, On 13 October 2016 at 15:51, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> Hi, >> >> On 13 October 2016 at 15:02, Felipe Balbi <ba...@kernel.org> wrote: >>> >>> Hi, &g

Re: [PATCH v2] usb: dwc3: gadget: Wait for end transfer complete before free irq

2016-10-13 Thread Baolin Wang
Hi, On 13 October 2016 at 15:02, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> @@ -1742,6 +1791,17 @@ static int dwc3_gadget_stop(struct usb_gadget *g) >> dwc->gadget_driver = NULL; >&

Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-13 Thread Baolin Wang
On 13 October 2016 at 15:54, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> Hi, >> >> On 13 October 2016 at 15:08, Felipe Balbi <ba...@kernel.org> wrote: >>> >>> Hi, >>>

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Baolin Wang
On 13 October 2016 at 17:49, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>>>>>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c >>>>>>>> index 1783406

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Baolin Wang
Hi, On 13 October 2016 at 19:22, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Janusz Dziedzic <janusz.dzied...@tieto.com> writes: >>>> Baolin Wang <baolin.w...@linaro.org> writes: >>>>>>>>>>> diff --git a/driv

Re: [PATCH v2] usb: dwc3: gadget: Wait for end transfer complete before free irq

2016-10-13 Thread Baolin Wang
On 13 October 2016 at 18:56, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Felipe Balbi <ba...@kernel.org> writes: >> Hi, >> >> Baolin Wang <baolin.w...@linaro.org> writes: >>>>>> I'm thinking this is a bug in

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Baolin Wang
Hi Felipe, On 13 October 2016 at 19:22, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Janusz Dziedzic <janusz.dzied...@tieto.com> writes: >>>> Baolin Wang <baolin.w...@linaro.org> writes: >>>>>>>>>>> diff --git a/driv

Re: [PATCH v2] usb: dwc3: gadget: Wait for end transfer complete before free irq

2016-10-13 Thread Baolin Wang
Hi Felipe, On 13 October 2016 at 19:23, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>> Baolin Wang <baolin.w...@linaro.org> writes: >>>>>>>> I'm thinking this is a bug in co

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Baolin Wang
On 13 October 2016 at 20:17, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>>>>>>>>>>> @@ -241,6 +241,9 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep >>>>>>>&

[PATCH v17 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger

2016-10-10 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger can implement the usb_charger_plug_by_gadget() function, usb_charger_exit() function and dev_to_uchger() function by getting 'struct usb_charger' from 'struct gadget'. Signed-off-by: Baolin Wang <baolin.w...@linaro.

[PATCH] usb: dwc3: gadget: Wait for end transfer complete before free irq

2016-10-10 Thread Baolin Wang
irq, it will not shutdown this gadget irq line), which will trigger the interrupt all the time. Thus we should check if we need wait for the end transfer command completion before free gadget irq. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/dwc3/core.h |3 ++ d

[PATCH v17 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-10-10 Thread Baolin Wang
mutex lock in usb_charger_set_cur_limit_by_type() function in case will be issued in atomic context. Baolin Wang (4): usb: gadget: Introduce the usb charger framework usb: gadget: Support for the usb charger framework usb: gadget: Integrate with the usb gadget supporting for usb charger power: wm831x_power: S

[PATCH v17 1/4] usb: gadget: Introduce the usb charger framework

2016-10-10 Thread Baolin Wang
or usb gadget state. This patch doesn't yet integrate with the gadget code, so some functions which rely on the 'gadget' are not completed, that will be implemented in the following patches. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Reviewed-by: Li Jun <jun...@nxp.com> Tested-by:

[PATCH v17 2/4] usb: gadget: Support for the usb charger framework

2016-10-10 Thread Baolin Wang
For supporting the usb charger, it adds the usb_charger_init() and usb_charger_exit() functions for usb charger initialization and exit. It will report to the usb charger when the gadget state is changed, then the usb charger can do the power things. Signed-off-by: Baolin Wang <baoli

[PATCH v17 4/4] power: wm831x_power: Support USB charger current limit management

2016-10-10 Thread Baolin Wang
-by: Mark Brown <broo...@kernel.org> Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Acked-by: Lee Jones <lee.jo...@linaro.org> Acked-by: Charles Keepax <ckee...@opensource.wolfsonmicro.com> Acked-by: Peter Chen <peter.c...@freescale.com> Acked-by: Seba

Re: [PATCH v17 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger

2016-10-10 Thread Baolin Wang
Hi Baolu, On 11 October 2016 at 12:32, Lu Baolu <baolu...@linux.intel.com> wrote: > Hi, > > On 10/11/2016 12:07 PM, Baolin Wang wrote: >>>> /* >>>> >> + * usb_charger_unregister() - Unregister a usb charger. >>>> >> + * @uchger - t

Re: [PATCH v17 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger

2016-10-10 Thread Baolin Wang
Hi Baolu, On 11 October 2016 at 11:06, Lu Baolu <baolu...@linux.intel.com> wrote: > Hi, > > On 10/10/2016 02:22 PM, Baolin Wang wrote: >> When the usb gadget supporting for usb charger is ready, the usb charger >> can implement the usb_charger_plug_by_gadget()

Re: [PATCH v17 1/4] usb: gadget: Introduce the usb charger framework

2016-10-10 Thread Baolin Wang
Hi Baolu, On 11 October 2016 at 10:59, Lu Baolu <baolu...@linux.intel.com> wrote: > Hi Baolin, > > Some review comments below. > > On 10/10/2016 02:22 PM, Baolin Wang wrote: >> This patch introduces the usb charger driver based on usb gadget that >> makes

Re: [PATCH 2/3] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-16 Thread Baolin Wang
>> interrupt before moving on. Note that this should >> only be done if we're dealing with one of the core >> revisions that actually require the interrupt before >> moving on. >> >> Reported-by: Baolin Wang <baolin.w...@linaro.org> >> Signed-off-by: F

Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget

2016-10-17 Thread Baolin Wang
Hi, On 17 October 2016 at 18:10, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> When we change the USB function with configfs dynamically, we possibly met >> this >> situation: one core is doing th

[PATCH] usb: gadget: f_fs: Fix possibe deadlock

2016-12-08 Thread Baolin Wang
t+0x4c/0xb0 [ 52.642647] c1 [] get_signal+0x380/0x89c [ 52.642651] c1 [] do_signal+0x154/0x518 [ 52.642656] c1 [] do_notify_resume+0x70/0x78 [ 52.642659] c1 [] work_pending+0x1c/0x20 Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/gadget/function/f_fs.c |8

Re: [PATCH v4 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-12-07 Thread Baolin Wang
Hi Mathias and Felipe, On 28 November 2016 at 14:43, Baolin Wang <baolin.w...@linaro.org> wrote: > Enable the xhci plat runtime PM for parent device to suspend/resume xhci. > Also call pm_runtime_get_noresume() in probe() function in case the parent > device doesn't call suspend/

Re: [PATCH v4 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-12-08 Thread Baolin Wang
Hi, On 8 December 2016 at 19:02, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>> On 28 November 2016 at 14:43, Baolin Wang <baolin.w...@linaro.org> wrote: >>>>> For some

Re: [PATCH v4 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-12-07 Thread Baolin Wang
Hi Felipe, On 28 November 2016 at 14:43, Baolin Wang <baolin.w...@linaro.org> wrote: > For some mobile devices with strict power management, we also want to suspend > the host when the slave is detached for power saving. Thus we add the host > suspend/resume functions to support t

Re: [PATCH v4 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-12-08 Thread Baolin Wang
Hi, On 8 December 2016 at 17:40, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> Hi Felipe, >> >> On 28 November 2016 at 14:43, Baolin Wang <baolin.w...@linaro.org> wrote: >>> For some

[PATCH v5 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-12-12 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this requirement. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes since v4: -

[PATCH v5 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-12-12 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Also call pm_runtime_get_noresume() in probe() function in case the parent device doesn't call suspend/resume callback by runtime PM now. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- Changes si

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-12 Thread Baolin Wang
Hi Mathias, On 12 December 2016 at 23:52, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: > On 05.12.2016 09:51, Baolin Wang wrote: >> >> If a command event is found on the event ring during an interrupt, >> we need to stop the command timer with del_timer(). Si

[PATCH] usb: host: xhci: Clean up commands when stop endpoint command is timeout

2016-12-13 Thread Baolin Wang
Since the stop endpoint command is timeout, we will halt the xHCI controller and issuing the usb_hc_died() to report abnormal shutdown of a host controller, but before that, we should clean up the command queue to free commands memory and complete the pending commands. Signed-off-by: Baolin Wang

Re: [PATCH] usb: gadget: f_fs: Fix possibe deadlock

2016-12-08 Thread Baolin Wang
Hi Michal, On 8 December 2016 at 23:18, Michal Nazarewicz <min...@mina86.com> wrote: > On Thu, Dec 08 2016, Baolin Wang wrote: >> When system try to close /dev/usb-ffs/adb/ep0 on one core, at the same >> time another core try to attach new UDC, which will cause deadlock as &g

Re: [PATCH v4 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-12-08 Thread Baolin Wang
Hi, On 9 December 2016 at 01:52, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>> Baolin Wang <baolin.w...@linaro.org> writes: >>>>>> On 28 November 2016 at 14:43, Baolin Wang <ba

[PATCH] usb: dwc3: ep0: Fix the possible missed request for handling delay STATUS phase

2017-01-14 Thread Baolin Wang
tready(), if so, we should handle it. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/dwc3/ep0.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 9bb1f85..e689ced 100644 --- a/drivers/usb/dwc3

Re: [PATCH 22/25] usb: host: xhci: remove unnecessary list_for_each_entry_safe()

2016-12-02 Thread Baolin Wang
Hi Felipe, On 2 December 2016 at 18:15, Sergei Shtylyov wrote: > Hello! > > On 12/1/2016 4:31 PM, Felipe Balbi wrote: > >> the _save() version of list iterators are supposed to be used when > > >_safe(). > >> list_entry is going to be removed from the list

[PATCH] usb: host: xhci: Handle the right timeout command

2016-12-02 Thread Baolin Wang
it for new current command. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- This patch is based on Lu Baolu's new fix patch: usb: xhci: fix possible wild pointer --- drivers/usb/host/xhci-ring.c | 26 +- drivers/usb/host/xhci.h |1 + 2 files chan

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-12-01 Thread Baolin Wang
On 2 December 2016 at 09:17, Lu Baolu <baolu...@linux.intel.com> wrote: > Hi, > > On 12/01/2016 04:03 PM, Baolin Wang wrote: >> On 1 December 2016 at 15:44, Lu Baolu <baolu...@linux.intel.com> wrote: >>> Hi, >>> >>> On 12/01/2016 03:35 PM, B

Re: [PATCH 1/1] usb: xhci: fix possible wild pointer

2016-12-01 Thread Baolin Wang
k. Afterward, timer function > grabs the lock and go ahead with checking and setting members > of xhci->current_cmd. > > Cc: <sta...@vger.kernel.org> # v3.16+ > Signed-off-by: Lu Baolu <baolu...@linux.intel.com> Nice catch. I was also curious where set xhci->current_

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-12-01 Thread Baolin Wang
On 1 December 2016 at 21:28, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: > On 01.12.2016 06:54, Baolin Wang wrote: >> >> On 30 November 2016 at 22:09, Mathias Nyman >> <mathias.ny...@linux.intel.com> wrote: >>> >>> On 30.11.2016 11:02

[RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
to halt the xHCI host in xhci_stop_endpoint_command_timeout() function. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/host/xhci-mem.c | 10 +-- drivers/usb/host/xhci-ring.c | 61 +- drivers/usb/host/xhci.c |8 +- d

Re: [PATCH] usb: host: xhci: Handle the right timeout command

2016-12-04 Thread Baolin Wang
On 2 December 2016 at 19:21, Baolin Wang <baolin.w...@linaro.org> wrote: > If a command event is found on the event ring during an interrupt, > we need to stop the command timer with del_timer(). Since del_timer() > can fail if the timer is running and waiting on the xHCI lock, then

[PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-05 Thread Baolin Wang
it for new current command. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/host/xhci-ring.c | 29 - drivers/usb/host/xhci.h |1 + 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/us

[PATCH 1/2] usb: host: xhci: Fix possible wild pointer when handling abort command

2016-12-04 Thread Baolin Wang
When current command was supposed to be aborted, host will free the command in handle_cmd_completion() function. But it might be still referenced by xhci->current_cmd, which need to set NULL. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- This patch is based on Lu Baolu's new

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
Hi Baolu, On 1 December 2016 at 13:45, Lu Baolu <baolu...@linux.intel.com> wrote: > Hi, > > On 11/30/2016 05:02 PM, Baolin Wang wrote: >> If the hardware never responds to the stop endpoint command, the >> URBs will never be completed, and we might hang the USB subsyste

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
On 1 December 2016 at 14:04, Baolin Wang <baolin.w...@linaro.org> wrote: > Hi Baolu, > > On 1 December 2016 at 13:45, Lu Baolu <baolu...@linux.intel.com> wrote: >> Hi, >> >> On 11/30/2016 05:02 PM, Baolin Wang wrote: >>> If the hardware never res

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-12-01 Thread Baolin Wang
On 1 December 2016 at 15:44, Lu Baolu <baolu...@linux.intel.com> wrote: > Hi, > > On 12/01/2016 03:35 PM, Baolin Wang wrote: >> On 1 December 2016 at 14:35, Lu Baolu <baolu...@linux.intel.com> wrote: >>> Hi, >>> >>> On 12/01/2016 02:04 PM, Bao

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
On 1 December 2016 at 14:35, Lu Baolu <baolu...@linux.intel.com> wrote: > Hi, > > On 12/01/2016 02:04 PM, Baolin Wang wrote: >> Hi Baolu, >> >> On 1 December 2016 at 13:45, Lu Baolu <baolu...@linux.intel.com> wrote: >>> Hi, >>> >>&g

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
On 30 November 2016 at 22:09, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: > On 30.11.2016 11:02, Baolin Wang wrote: >> >> If the hardware never responds to the stop endpoint command, the >> URBs will never be completed, and we might hang the USB subsystem. >

<    1   2   3   4   5   6   >