Re: [PATCH V2 4/6] USB: EHCI: tegra: remove all power management

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

 



On Tue, 4 Jun 2013, Stephen Warren wrote:

> From: Stephen Warren <swarren@xxxxxxxxxx>
> 
> The PM routines in ehci-tegra.c use APIs such as ehci_reset(),
> ehci_halt(), and ehci_tdi_reset() that would need to be exported to
> convert ehci-tegra.c into a separate module from ehci-hcd.c. However,
> we'd prefer not to export them.
> 
> Instead, simply remove all power management functionality. Runtime PM
> was disabled since it didn't work correctly, and system suspend isn't
> yet supported in a meaningful way. So, this change doesn't lose any
> functionality.
> 
> Hopefully the power management logic can be reimplemented in a cleaner
> way in the future.
> 
> Signed-off-by: Stephen Warren <swarren@xxxxxxxxxx>
> ---
> NOTE: This could do with a little more testing on a few more boards. If
> Alan is OK with this series, I'll go through and do that, and let you
> know when I've tested it enough to be applied. I saw no issues on the one
> board I tested with though.
> 
> I'd appreciate any hints if this patch is actually removing more
> functionality than I think, and is going to break something horribly.

This is a good way to break the logjam.  It needs just a couple of
improvements:

> diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
> index 289b9b8..8f42b3a 100644
> --- a/drivers/usb/host/ehci-tegra.c
> +++ b/drivers/usb/host/ehci-tegra.c
> @@ -61,15 +61,6 @@ static void tegra_ehci_power_up(struct usb_hcd *hcd)
>  	tegra->host_resumed = 1;
>  }
>  
> -static void tegra_ehci_power_down(struct usb_hcd *hcd)
> -{
> -	struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
> -
> -	tegra->host_resumed = 0;
> -	usb_phy_set_suspend(hcd->phy, 1);
> -	clk_disable_unprepare(tegra->clk);
> -}
> -

tegra_ehci_power_up() shouldn't be retained either.  And with these
functions removed, there's no need to keep the tegra->host_resumed
field.

Related to this, the tegra_ehci_shutdown() routine should be removed,
and the .shutdown entry in tegra_ehci_hc_driver should point to
ehci_shutdown.

> @@ -399,10 +369,6 @@ static const struct hc_driver tegra_ehci_hc_driver = {
>  	.map_urb_for_dma	= tegra_ehci_map_urb_for_dma,
>  	.unmap_urb_for_dma	= tegra_ehci_unmap_urb_for_dma,
>  	.hub_control		= tegra_ehci_hub_control,
> -#ifdef CONFIG_PM
> -	.bus_suspend		= ehci_bus_suspend,
> -	.bus_resume		= ehci_bus_resume,
> -#endif
>  };

These two entries should be retained.  They refer to USB bus suspend
rather than controller suspend, and they don't use any Tegra-specific
code.

Alan Stern

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




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux