Re: [PATCH 3/3] musb: fixes vbus off issue after disconnect

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

 



On Thu, Oct 30, 2008 at 02:43:08PM +0530, Ajay Kumar Gupta wrote:
> Vbus is switched off (after a_wait_bcon) whenever a device
> is disconnected from musb host even when musb is configured
> only as host.Earlier we use to switch on the power using
> [echo "F" >/proc/driver/musb_hdrc] but now this proc entry is
> deleted thus musb doesn't work after device disconnect.
> 
> This patch puts is_otg_enabled() check before scheduling
> a switch-off timer in disconnect path.
> 
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@xxxxxx>
> ---
>  drivers/usb/musb/musb_core.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index dbf8861..6856da3 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -767,7 +767,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
>  		case OTG_STATE_A_HOST:
>  		case OTG_STATE_A_SUSPEND:
>  			musb_root_disconnect(musb);
> -			if (musb->a_wait_bcon != 0)
> +			if (musb->a_wait_bcon != 0 && is_otg_enabled(musb))

I'd say we need to turn off vbus whenever possible. This looks like the
problem is somewhere else but here. Maybe we're missing a disconnect
event. I recall we only ack disconnect upon next reconnection of the
device due to isses with tusb rev1.0. Maybe  the problem lies there.

Turning off vbus is good to save batery, and I'd say we keep it off as
long as possible. Vbus should probably be handled by userland in otg
cases, although I couldn't get Dave to agree with it :-p

I believe that we should have a "session" entry on sysfs and upon cable
connection, one side switches to a_idle and the other stays in b_idle.
The device that writes to session (echo 1 > session) will become host
(either b_host or a_host, meaning that hnp would also trigger based on
that).

Anyways, this is story for another patch.

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