Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-12 Thread Tony Lindgren
* Laurent Pinchart [160911 02:06]: > Hi Tony, > > On Saturday 10 Sep 2016 06:07:50 Tony Lindgren wrote: > > * Andreas Kemnade [160910 04:27]: > > > On Fri, 9 Sep 2016 16:40:15 -0700 Tony Lindgren wrote: > > >> * Tony Lindgren [160909 14:33]: > > >>> * Andreas Kemnade [160909 14:22]: > > W

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-11 Thread Laurent Pinchart
Hi Tony, On Saturday 10 Sep 2016 06:07:50 Tony Lindgren wrote: > * Andreas Kemnade [160910 04:27]: > > On Fri, 9 Sep 2016 16:40:15 -0700 Tony Lindgren wrote: > >> * Tony Lindgren [160909 14:33]: > >>> * Andreas Kemnade [160909 14:22]: > We have two independant things: > 1. phy-twl4030

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-10 Thread Tony Lindgren
* Andreas Kemnade [160910 04:27]: > On Fri, 9 Sep 2016 16:40:15 -0700 > Tony Lindgren wrote: > > > * Tony Lindgren [160909 14:33]: > > > * Andreas Kemnade [160909 14:22]: > > > > We have two independant things: > > > > 1. phy-twl4030-usb (and perhaps others) do not enable > > > > the phy eno

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-10 Thread Andreas Kemnade
On Fri, 9 Sep 2016 16:40:15 -0700 Tony Lindgren wrote: > * Tony Lindgren [160909 14:33]: > > * Andreas Kemnade [160909 14:22]: > > > We have two independant things: > > > 1. phy-twl4030-usb (and perhaps others) do not enable > > > the phy enough to allow charging on pm_runtime_get(). > > >

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-09 Thread Tony Lindgren
* Tony Lindgren [160909 14:33]: > * Andreas Kemnade [160909 14:22]: > > We have two independant things: > > 1. phy-twl4030-usb (and perhaps others) do not enable > > the phy enough to allow charging on pm_runtime_get(). > > That is fixed by my phy-related patches. > > OK > > > 2. phy_power_o

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-09 Thread Tony Lindgren
* Andreas Kemnade [160909 14:22]: > On Fri, 9 Sep 2016 13:51:04 -0700 > Tony Lindgren wrote: > > Well for the phy-twl4030-usb.c, AFAIK the right fix is to fix the PHY > > driver as done in "[PATCH v2] phy-twl4030-usb: initialize > > charging-related stuff via pm_runtime". I suspect something simi

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-09 Thread Andreas Kemnade
On Fri, 9 Sep 2016 13:51:04 -0700 Tony Lindgren wrote: > * Laurent Pinchart [160909 13:21]: > > On Friday 09 Sep 2016 13:08:03 Tony Lindgren wrote: > > > This patch has a side effect of fixing the issue by breaking PM > > > runtime, not a good fix as discussed. > > > > How exactly is it worse b

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-09 Thread Tony Lindgren
* Andreas Kemnade [160909 13:40]: > On Fri, 09 Sep 2016 23:21:50 +0300 > Laurent Pinchart wrote: > > > > How exactly is it worse breaking runtime PM than breaking USB gadget > > completely ? :-) > > > Does it still break with my phy-twl4030 fixes? At least on gta04, > they fix real problems an

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-09 Thread Tony Lindgren
* Laurent Pinchart [160909 13:21]: > On Friday 09 Sep 2016 13:08:03 Tony Lindgren wrote: > > This patch has a side effect of fixing the issue by breaking PM > > runtime, not a good fix as discussed. > > How exactly is it worse breaking runtime PM than breaking USB gadget > completely ? :-) Yeah

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-09 Thread Andreas Kemnade
On Fri, 09 Sep 2016 23:21:50 +0300 Laurent Pinchart wrote: > Hi Tony, > > On Friday 09 Sep 2016 13:08:03 Tony Lindgren wrote: > > * Laurent Pinchart [160909 > > 12:27]: > > > On Wednesday 03 Aug 2016 17:38:51 Andreas Kemnade wrote: > > >> The code assumes that omap2430_musb_enable() and > > >>

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-09 Thread Laurent Pinchart
Hi Tony, On Friday 09 Sep 2016 13:08:03 Tony Lindgren wrote: > * Laurent Pinchart [160909 12:27]: > > On Wednesday 03 Aug 2016 17:38:51 Andreas Kemnade wrote: > >> The code assumes that omap2430_musb_enable() and > >> omap2430_musb_disable() are called in a balanced way. > >> That fact is broken

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-09 Thread Tony Lindgren
* Laurent Pinchart [160909 12:27]: > Hi Andreas, > > Thank you for the patch. > > On Wednesday 03 Aug 2016 17:38:51 Andreas Kemnade wrote: > > The code assumes that omap2430_musb_enable() and > > omap2430_musb_disable() are called in a balanced way. > > That fact is broken by the fact that musb_

Re: [v2] musb: omap2430: do not assume balanced enable()/disable()

2016-09-09 Thread Laurent Pinchart
Hi Andreas, Thank you for the patch. On Wednesday 03 Aug 2016 17:38:51 Andreas Kemnade wrote: > The code assumes that omap2430_musb_enable() and > omap2430_musb_disable() are called in a balanced way. > That fact is broken by the fact that musb_init_controller() calls > musb_platform_disable() to

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-11 Thread Tony Lindgren
* Andreas Kemnade [160808 22:36]: > Calls to musb_platform_enable() occur at only 1 place. > musb_platform_disable() is called at 4 places. > > about balancing: > There is musb_start() and musb_stop(). They are called from > musb_gadget_start/stop() > These call musb_platform_enable() and musb_pl

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-08 Thread Andreas Kemnade
On Fri, 5 Aug 2016 23:21:35 -0700 Tony Lindgren wrote: > * Andreas Kemnade [160805 08:35]: > > I repeat the subject line of the patch: > > [PATCH v2] musb: omap2430: do not assume balanced enable()/disable() > > It is *not* fix charging. > > > > So you mean t

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-06 Thread Tony Lindgren
* Andreas Kemnade [160805 08:35]: > I repeat the subject line of the patch: > [PATCH v2] musb: omap2430: do not assume balanced enable()/disable() > It is *not* fix charging. > > So you mean that the phy should magically know at which refcounter > it should power on and off

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-05 Thread Andreas Kemnade
d separately increment the PM runtime count and then > enable the component specific things. And then we have the > errata to deal with when VBUS is enabled. I repeat the subject line of the patch: [PATCH v2] musb: omap2430: do not assume balanced enable()/disable() It is *not* fix charging. S

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-05 Thread Tony Lindgren
* Andreas Kemnade [160804 09:44]: > Nothing happens here, so the previous state of the phy remains. > It would be disabled by the generic phy layer in drivers/phy/phy-core.c > > > gadget driver is loaded. > > musb_start() is called > > omap2430_musb_enable() is called > > calls phy_power_o

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Andreas Kemnade
On Thu, 4 Aug 2016 16:49:30 +0200 "H. Nikolaus Schaller" wrote: > > Rationale: > > > > The charger driver calls pm_runtime_get_sync(bci->transceiver->dev); > > which should indirectly call twl4030_usb_set_mode to set the > > POWER_CTRL_OTG_ENAB bit. This enables the prescaler hardware > > for AD

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Andreas Kemnade
On Thu, 4 Aug 2016 18:31:29 +0200 Andreas Kemnade wrote: > Hi, > > On Thu, 4 Aug 2016 07:29:19 -0700 > Tony Lindgren wrote: > > > Hi, > > > > * H. Nikolaus Schaller [160803 10:07]: > > > All this prevents detection of cable plugin-events and VBUS > > > measurement and setting OTG_EN before c

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Andreas Kemnade
Hi, On Thu, 4 Aug 2016 07:29:19 -0700 Tony Lindgren wrote: > Hi, > > * H. Nikolaus Schaller [160803 10:07]: > > All this prevents detection of cable plugin-events and VBUS > > measurement and setting OTG_EN before charging is attempted. > > So I gave this patch a try but it now blocks all dee

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Tony Lindgren
* H. Nikolaus Schaller [160804 07:50]: > > Am 04.08.2016 um 16:29 schrieb Tony Lindgren : > > > > So I gave this patch a try but it now blocks all deeper SoC idle > > states as the PHY stays active. I think the real fix is to make > > sure the charger behaves independent of the USB PHY state. >

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread H. Nikolaus Schaller
Hi Tony, > Am 04.08.2016 um 16:29 schrieb Tony Lindgren : > > Hi, > > * H. Nikolaus Schaller [160803 10:07]: >> All this prevents detection of cable plugin-events and VBUS measurement >> and setting OTG_EN before charging is attempted. > > So I gave this patch a try but it now blocks all deepe

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Tony Lindgren
Hi, * H. Nikolaus Schaller [160803 10:07]: > All this prevents detection of cable plugin-events and VBUS measurement > and setting OTG_EN before charging is attempted. So I gave this patch a try but it now blocks all deeper SoC idle states as the PHY stays active. I think the real fix is to make

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-03 Thread H. Nikolaus Schaller
> Am 03.08.2016 um 17:38 schrieb Andreas Kemnade : > > The code assumes that omap2430_musb_enable() and > omap2430_musb_disable() are called in a balanced way. > That fact is broken by the fact that musb_init_controller() calls > musb_platform_disable() to switch from unknown state to off state >

[PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-03 Thread Andreas Kemnade
The code assumes that omap2430_musb_enable() and omap2430_musb_disable() are called in a balanced way. That fact is broken by the fact that musb_init_controller() calls musb_platform_disable() to switch from unknown state to off state on initialisation. That means that phy_power_off() is called fi