diff mbox

USB-related build errors on Tegra in next-20130319

Message ID 20130320122031.GI29659@arwen.pp.htv.fi
State Not Applicable, archived
Headers show

Commit Message

Felipe Balbi March 20, 2013, 12:20 p.m. UTC
Hi,

On Tue, Mar 19, 2013 at 10:29:05AM -0600, Stephen Warren wrote:
> I see the following Kconfig warnings in next-20130319:
> 
> > warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI which has unmet direct dependencies (USB_SUPPORT && USB_PHY && ARM)
> > warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has unmet direct dependencies (USB_SUPPORT && USB_PHY && USB_ULPI)
> > include/config/auto.conf:624:warning: override: ARCH_MULTIPLATFORM changes choice state
> > warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI which has unmet direct dependencies (USB_SUPPORT && USB_PHY && ARM)
> > warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has unmet direct dependencies (USB_SUPPORT && USB_PHY && USB_ULPI)
> 
> Which I believe are the cause of the following build errors:
> 
> > drivers/built-in.o: In function `controller_resume':
> > drivers/usb/host/ehci-tegra.c:556: undefined reference to `tegra_usb_phy_preresume'
> > drivers/usb/host/ehci-tegra.c:479: undefined reference to `tegra_ehci_phy_restore_start'
> > drivers/usb/host/ehci-tegra.c:551: undefined reference to `tegra_ehci_phy_restore_end'
> > drivers/usb/host/ehci-tegra.c:546: undefined reference to `tegra_ehci_phy_restore_end'
> > drivers/built-in.o: In function `tegra_ehci_probe':
> > drivers/usb/host/ehci-tegra.c:734: undefined reference to `tegra_usb_phy_open'
> > drivers/built-in.o: In function `tegra_ehci_hub_control':
> > drivers/usb/host/ehci-tegra.c:162: undefined reference to `tegra_usb_phy_postresume'
> > drivers/usb/host/ehci-tegra.c:215: undefined reference to `tegra_usb_phy_preresume'
> > make: *** [vmlinux] Error 1
> 
> I pointed out at least the Kconfig problems when you posted the PHY
> error handling cleanup series, so I'm not sure why those patches were
> applied.

Because tegra EHCI shouldn't be selecting the PHY and you didn't even
have a proper PHY driver. Try patch below:

From cc705d4038f6adc24dc0d2ad9a1b28a798fafb95 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <balbi@ti.com>
Date: Wed, 20 Mar 2013 14:18:28 +0200
Subject: [PATCH] arm: tegra: fix Kconfig select clauses

USB_ULPI and USB_ULPI_VIEWPORT shouldn't really
be selected directly by anyone, but since Tegra
still needs some time before turning ulpi viewport
into a proper PHY driver, we need to keep the
selects in place.

This patch just fixes the conditional select
so that it will continue to build after merging
the latest PHY layer changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 arch/arm/mach-tegra/Kconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Stephen Warren March 20, 2013, 4:39 p.m. UTC | #1
On 03/20/2013 06:20 AM, Felipe Balbi wrote:
> Hi,
> 
> On Tue, Mar 19, 2013 at 10:29:05AM -0600, Stephen Warren wrote:
>> I see the following Kconfig warnings in next-20130319:
>> 
>>> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
>>> USB_ULPI which has unmet direct dependencies (USB_SUPPORT &&
>>> USB_PHY && ARM) warning: (ARCH_TEGRA_2x_SOC &&
>>> ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has unmet
>>> direct dependencies (USB_SUPPORT && USB_PHY && USB_ULPI) 
>>> include/config/auto.conf:624:warning: override:
>>> ARCH_MULTIPLATFORM changes choice state warning:
>>> (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI which
>>> has unmet direct dependencies (USB_SUPPORT && USB_PHY && ARM) 
>>> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
>>> USB_ULPI_VIEWPORT which has unmet direct dependencies
>>> (USB_SUPPORT && USB_PHY && USB_ULPI)
>> 
>> Which I believe are the cause of the following build errors:
>> 
>>> drivers/built-in.o: In function `controller_resume': 
>>> drivers/usb/host/ehci-tegra.c:556: undefined reference to
>>> `tegra_usb_phy_preresume' drivers/usb/host/ehci-tegra.c:479:
>>> undefined reference to `tegra_ehci_phy_restore_start' 
>>> drivers/usb/host/ehci-tegra.c:551: undefined reference to
>>> `tegra_ehci_phy_restore_end' drivers/usb/host/ehci-tegra.c:546:
>>> undefined reference to `tegra_ehci_phy_restore_end' 
>>> drivers/built-in.o: In function `tegra_ehci_probe': 
>>> drivers/usb/host/ehci-tegra.c:734: undefined reference to
>>> `tegra_usb_phy_open' drivers/built-in.o: In function
>>> `tegra_ehci_hub_control': drivers/usb/host/ehci-tegra.c:162:
>>> undefined reference to `tegra_usb_phy_postresume' 
>>> drivers/usb/host/ehci-tegra.c:215: undefined reference to
>>> `tegra_usb_phy_preresume' make: *** [vmlinux] Error 1
>> 
>> I pointed out at least the Kconfig problems when you posted the
>> PHY error handling cleanup series, so I'm not sure why those
>> patches were applied.
> 
> Because tegra EHCI shouldn't be selecting the PHY and you didn't
> even have a proper PHY driver. Try patch below:

I understand that, but applying the patches without that resolved
still seems wrong. Just because something is currently sub-optimal
doesn't mean it should get broken.

The patch you gave fixes the Kconfig warnings, but not the build failure.

The issue is that: tegra_defconfig enables CONFIG_USB_EHCI_TEGRA, but
not CONFIG_USB_PHY since it's new. ehci-tegra.c directly calls
functions exported by phy-tegra-usb.c. However, phy-tegra-usb.c
doesn't get built, since drivers/usb/Makefile adds phy/ to
obj-$(CONFIG_USB_PHY), so doesn't end up "recursing" into the
sub-directory at all. drivers/usb/phy/Makefile contains:
obj-$(CONFIG_USB_EHCI_TEGRA)+= phy-tegra-usb.o which used to couple
the two builds together, in the absence of this new change that limits
the building of phy/.

For now, I think the correct solution is to have USB_EHCI_TEGRA select
USB_PHY. I validated that solves the build problem, and has the bonus
of not needing any changes to tegra_defconfig.

In the series that converts phy-usb-tegra.c to a real driver, we can
give it its own Kconfig option, and have USB_EHCI_TEGRA depend on
that, if you want. We'll then also need to take a patch through the
Tegra tree to update tegra_defconfig.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Felipe Balbi March 20, 2013, 4:45 p.m. UTC | #2
Hi,

On Wed, Mar 20, 2013 at 10:39:11AM -0600, Stephen Warren wrote:
> On 03/20/2013 06:20 AM, Felipe Balbi wrote:
> > Hi,
> > 
> > On Tue, Mar 19, 2013 at 10:29:05AM -0600, Stephen Warren wrote:
> >> I see the following Kconfig warnings in next-20130319:
> >> 
> >>> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
> >>> USB_ULPI which has unmet direct dependencies (USB_SUPPORT &&
> >>> USB_PHY && ARM) warning: (ARCH_TEGRA_2x_SOC &&
> >>> ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has unmet
> >>> direct dependencies (USB_SUPPORT && USB_PHY && USB_ULPI) 
> >>> include/config/auto.conf:624:warning: override:
> >>> ARCH_MULTIPLATFORM changes choice state warning:
> >>> (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI which
> >>> has unmet direct dependencies (USB_SUPPORT && USB_PHY && ARM) 
> >>> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
> >>> USB_ULPI_VIEWPORT which has unmet direct dependencies
> >>> (USB_SUPPORT && USB_PHY && USB_ULPI)
> >> 
> >> Which I believe are the cause of the following build errors:
> >> 
> >>> drivers/built-in.o: In function `controller_resume': 
> >>> drivers/usb/host/ehci-tegra.c:556: undefined reference to
> >>> `tegra_usb_phy_preresume' drivers/usb/host/ehci-tegra.c:479:
> >>> undefined reference to `tegra_ehci_phy_restore_start' 
> >>> drivers/usb/host/ehci-tegra.c:551: undefined reference to
> >>> `tegra_ehci_phy_restore_end' drivers/usb/host/ehci-tegra.c:546:
> >>> undefined reference to `tegra_ehci_phy_restore_end' 
> >>> drivers/built-in.o: In function `tegra_ehci_probe': 
> >>> drivers/usb/host/ehci-tegra.c:734: undefined reference to
> >>> `tegra_usb_phy_open' drivers/built-in.o: In function
> >>> `tegra_ehci_hub_control': drivers/usb/host/ehci-tegra.c:162:
> >>> undefined reference to `tegra_usb_phy_postresume' 
> >>> drivers/usb/host/ehci-tegra.c:215: undefined reference to
> >>> `tegra_usb_phy_preresume' make: *** [vmlinux] Error 1
> >> 
> >> I pointed out at least the Kconfig problems when you posted the
> >> PHY error handling cleanup series, so I'm not sure why those
> >> patches were applied.
> > 
> > Because tegra EHCI shouldn't be selecting the PHY and you didn't
> > even have a proper PHY driver. Try patch below:
> 
> I understand that, but applying the patches without that resolved
> still seems wrong. Just because something is currently sub-optimal
> doesn't mean it should get broken.
> 
> The patch you gave fixes the Kconfig warnings, but not the build failure.
> 
> The issue is that: tegra_defconfig enables CONFIG_USB_EHCI_TEGRA, but
> not CONFIG_USB_PHY since it's new. ehci-tegra.c directly calls
> functions exported by phy-tegra-usb.c. However, phy-tegra-usb.c
> doesn't get built, since drivers/usb/Makefile adds phy/ to
> obj-$(CONFIG_USB_PHY), so doesn't end up "recursing" into the
> sub-directory at all. drivers/usb/phy/Makefile contains:
> obj-$(CONFIG_USB_EHCI_TEGRA)+= phy-tegra-usb.o which used to couple
> the two builds together, in the absence of this new change that limits
> the building of phy/.
> 
> For now, I think the correct solution is to have USB_EHCI_TEGRA select
> USB_PHY. I validated that solves the build problem, and has the bonus
> of not needing any changes to tegra_defconfig.
>
> In the series that converts phy-usb-tegra.c to a real driver, we can
> give it its own Kconfig option, and have USB_EHCI_TEGRA depend on
> that, if you want. We'll then also need to take a patch through the
> Tegra tree to update tegra_defconfig.

Alright, do you want to send that patch ? My bad that I missed that
build error...
Stephen Warren March 20, 2013, 4:51 p.m. UTC | #3
On 03/20/2013 10:45 AM, Felipe Balbi wrote:
> Hi,
> 
> On Wed, Mar 20, 2013 at 10:39:11AM -0600, Stephen Warren wrote:
>> On 03/20/2013 06:20 AM, Felipe Balbi wrote:
...
>> The patch you gave fixes the Kconfig warnings, but not the build
>> failure.
...
>> For now, I think the correct solution is to have USB_EHCI_TEGRA
>> select USB_PHY. I validated that solves the build problem, and
>> has the bonus of not needing any changes to tegra_defconfig.
...
> Alright, do you want to send that patch ? My bad that I missed
> that build error...

Sure. Do you want to roll it into your patch and repost it, or me to
send a separate patch?

I assume you'd apply both to the same branch that contains the patches
that add the USB_PHY config option? If the arch/arm patch gets applied
to the Tegra tree instead, it'll cause breakage there since USB_PHY
won't exist yet, so USB will be disabled until merged with the USB
tree in 3.10-rc1.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index d1c4893..dbc653e 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -18,8 +18,8 @@  config ARCH_TEGRA_2x_SOC
 	select PL310_ERRATA_727915 if CACHE_L2X0
 	select PL310_ERRATA_769419 if CACHE_L2X0
 	select USB_ARCH_HAS_EHCI if USB_SUPPORT
-	select USB_ULPI if USB
-	select USB_ULPI_VIEWPORT if USB_SUPPORT
+	select USB_ULPI if USB_PHY
+	select USB_ULPI_VIEWPORT if USB_PHY
 	help
 	  Support for NVIDIA Tegra AP20 and T20 processors, based on the
 	  ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
@@ -37,8 +37,8 @@  config ARCH_TEGRA_3x_SOC
 	select PINCTRL_TEGRA30
 	select PL310_ERRATA_769419 if CACHE_L2X0
 	select USB_ARCH_HAS_EHCI if USB_SUPPORT
-	select USB_ULPI if USB
-	select USB_ULPI_VIEWPORT if USB_SUPPORT
+	select USB_ULPI if USB_PHY
+	select USB_ULPI_VIEWPORT if USB_PHY
 	help
 	  Support for NVIDIA Tegra T30 processor family, based on the
 	  ARM CortexA9MP CPU and the ARM PL310 L2 cache controller