Re: [PATCH 0/4] musb fixes for v4.9-rc cycle

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

 



Hello,

On Friday 11 Nov 2016 00:27:52 Laurent Pinchart wrote:
> On Thursday 10 Nov 2016 13:42:34 Tony Lindgren wrote:
> > * Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> [161110 13:29]:
> >> I had to disable CONFIG_USB_GADGET is compiling it as a module prevents
> >> selecting CONFIG_NOP_USB_XCEIV=y, which is a dependency for
> >> CONFIG_USB_EHCI_HCD_OMAP=m.
> >> 
> >> The new configuration resulted in a few changes, among which the most
> >> notable is
> >> 
> >> -# CONFIG_USB_MUSB_HOST is not set
> >> -# CONFIG_USB_MUSB_GADGET is not set
> >> -CONFIG_USB_MUSB_DUAL_ROLE=y
> >> +CONFIG_USB_MUSB_HOST=y
> >> 
> >> I then get the same error as originally reported.
> > 
> > Yeah OK, that's the problem.. We still have musb hardware
> > trying to do things on it's own and phy trying to detect
> > the state.
> > 
> > Any ideas why we have a dependency like that in Kconfig?
> 
> Well, with CONFIG_USB_GADGET disabled, I don't expect CONFIG_USB_MUSB_GADGET
> to be enabled. MUSB can only operate in host mode in that case, so musb->
> xceiv->otg->state = OTG_STATE_A_IDLE makes sense.

I've tried to investigate this but I'm not familiar enough with the MUSB 
driver to reach any conclusion. Felipe, if you have time could you give me a 
hand ?

To summarize the issue, on a pandaboard-es where the MUSB is wired to an OTG 
connector with mode rightfully set to MUSB_PORT_MODE_DUAL_ROLE in DT, a kernel 
configured with CONFIG_USB_MUSB_HOST=y (for instance because CONFIG_USB_GADGET 
is disabled) will print an endless stream of the following meessage.

[    2.766174] musb_bus_suspend 2586: trying to suspend as a_idle while active

musb_init_controller() performs the following actions

        case MUSB_PORT_MODE_DUAL_ROLE:
                status = musb_host_setup(musb, plat->power);
                if (status < 0)
                        goto fail3;
                status = musb_gadget_setup(musb);
                if (status) {
                        musb_host_cleanup(musb);
                        goto fail3;
                }
                status = musb_platform_set_mode(musb, MUSB_OTG);
                break;

and as gadget support is disabled musb_gadget_setup() compiles to a no-op 
inline function. The system is thus configured in host mode by 
musb_host_setup() with musb->xceiv->otg->state = OTG_STATE_A_IDLE. A later 
call to musb_start() verifies the condition

        if (musb->port_mode != MUSB_PORT_MODE_HOST &&
                        musb->xceiv->otg->state != OTG_STATE_A_WAIT_BCON &&
                        (devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) {

and sets musb->is_active to 1. Later, musb_bus_suspend() complains because 
is_active is not 0.

What is wrong in that sequence ?

-- 
Regards,

Laurent Pinchart

--
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