Re: [PATCHv3] usb: musb: Fix unbalanced platform_disable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Bin Liu <b-liu@xxxxxx> [160916 07:04]:
> Hi,
> 
> On Wed, Sep 14, 2016 at 11:10:19AM -0700, Tony Lindgren wrote:
> > Commit a83e17d0f73b ("usb: musb: Improve PM runtime and phy handling
> > for 2430 glue layer") moved PHY enable/disable calls to happen from
> > omap2430_musb_enable/disable(). That broke enumeration for several
> > devices as PM runtime in the PHY will never enable it.
> > 
> > The root cause of the problem is unpaired calls from musb_core.c to
> > musb_platform_enable/disable in musb_core.c as reported by
> > Andreas Kemnade <andreas@xxxxxxxxxxxx>.
> > 
> > As musb_platform_enable/disable are being called from various functions,
> > let's not attempt to make them paiered immediately. This would require
> > fixing all the callers like musb_remove.
> > 
> > Instead, let's first fix the regression in a minimal way by removing
> > the initial call to musb_platform_disable. To do that in a safe way,
> > we need to call the glue specific *_musb_disable() directly in the
> > glue layer *_musb_init() as noted by Bin Liu <b-liu@xxxxxx>.
> > 
> > AFAIK the initial musb_platform_disable call has always been just an
> > attempted workaround for the 2430 glue layer announcing itself too
> > early before the gadgets are configured. And that issue finally
> > got fixed with commit a118df07f5b1 ("usb: musb: Don't set d+ high
> > before enable for 2430 glue layer").
> > 
> > Further, most of the glue layers already do a reset of the musb
> > controller in the *_musb_init(), so later on we may want to
> > consider removing the calls to *__musb_disable() where a reset is
> > already done.
> > 
> > Note that we now also need to fix the twl4030-phy accordingly making
> > it's PM runtime call only needed in twl4030_phy_power_on and have it
> > autosuspend. The cable state will keep the phy active when connected.
> > 
> > Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
> > Cc: Kishon Vijay Abraham I <kishon@xxxxxx>
> > Fixes: a83e17d0f73b ("usb: musb: Improve PM runtime and phy handling
> > for 2430 glue layer")
> > Reported-by: Andreas Kemnade <andreas@xxxxxxxxxxxx>
> > Acked-by: Andreas Kemnade <andreas@xxxxxxxxxxxx>
> > Reported-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> > Tested-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> > Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>
> > ---
> 
> If Kishon wants to take it, here is my
> 
> Acked-by: Bin Liu <b-liu@xxxxxx>

To recap, this seems to be now only partially needed with
commit d8e5f0eca1e8 ("usb: musb: Fix hardirq-safe hardirq-unsafe
lock order error") heading into v4.9-rc2.

The rest of the changes in the $subject patch we should probably
wait on until we have things working in a sane way with PM runtime.

I'll be sending the phy-twl4030-usb related changes separately.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux