Skip to contentSkip to conversation

thunderbolt: fix compile-test dependencies

PATCH In review Arnd Bergmann 2 participants 8 messages Nov 15, 2016 – Nov 17, 2016 1 message not in the archive Thunderbolt driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thunderbolt: fix compile-test dependencies

Building the Apple thunderbolt driver on non-x86 machines now produces a harmless warning:

warning: (THUNDERBOLT) selects APPLE_PROPERTIES which has unmet direct dependencies (EFI && EFI_STUB && X86)

As there is no compile-time dependency to the Apple properties support, we can make that 'select' statement conditional on the dependencies of that driver.

Fixes c9cc3aaa0281 ("thunderbolt: Use Device ROM retrieved from EFI")
---
 drivers/thunderbolt/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/thunderbolt/Kconfig +2 -1
index 0056df7f3c09..4e7d92193b65 100644
@@ -1,7 +1,8 @@
 menuconfig THUNDERBOLT
 	tristate "Thunderbolt support for Apple devices"
+	depends on (EFI_STUB && X86) || COMPILE_TEST
 	depends on PCI
-	select APPLE_PROPERTIES
+	select APPLE_PROPERTIES if (X86 && EFI_STUB)
 	select CRC32
 	help
 	  Cactus Ridge Thunderbolt Controller driver
Signature · 1 line
2.9.0
#1 lore raw
Quoted 8 lines · Arnd Bergmann

Building the Apple thunderbolt driver on non-x86 machines now produces a harmless warning:

warning: (THUNDERBOLT) selects APPLE_PROPERTIES which has unmet direct dependencies (EFI && EFI_STUB && X86)

As there is no compile-time dependency to the Apple properties support, we can make that 'select' statement conditional on the dependencies of that driver.

Thanks Arnd, a commit fixing this is already on the tip.git efi/core branch since this morning and will hopefully have landed in linux-next by tomorrow:
http://git.kernel.org/tip/79f9cd35b05e3e91ccf9b4038a8b74b9362b5da7

Previous discussion on LKML:
https://lkml.org/lkml/2016/11/14/456

Another comment below...

Quoted 12 lines
Fixes c9cc3aaa0281 ("thunderbolt: Use Device ROM retrieved from EFI")
---
 drivers/thunderbolt/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/thunderbolt/Kconfig +0 -0
index 0056df7f3c09..4e7d92193b65 100644

drivers/thunderbolt/Kconfig line 3

Quoted 3 lines
drivers/thunderbolt/Kconfig +1 -0
@@ -1,7 +1,8 @@
 menuconfig THUNDERBOLT
 	tristate "Thunderbolt support for Apple devices"
+	depends on (EFI_STUB && X86) || COMPILE_TEST

This addition isn't correct, the thunderbolt driver works without the EFI stub, it just falls back to a hardcoded Device ROM.

In other words, using the Device ROM retrieved by the EFI stub is an optional feature that is supposed to be enabled by default in the config if the EFI stub is also enabled. That is what the patch now in tip.git does.

Nevertheless, thanks for your efforts and sorry for having caused you extra work.

Lukas

Quoted 8 lines
drivers/thunderbolt/Kconfig +1 -1
 	depends on PCI
-	select APPLE_PROPERTIES
+	select APPLE_PROPERTIES if (X86 && EFI_STUB)
 	select CRC32
 	help
 	  Cactus Ridge Thunderbolt Controller driver
Signature · 1 line
2.9.0
#2 lore raw
Quoted 12 lines · CET Lukas Wunner

drivers/thunderbolt/Kconfig line 3

Quoted 8 lines · Arnd Bergmann
drivers/thunderbolt/Kconfig +1 -0
index 0056df7f3c09..4e7d92193b65 100644
@@ -1,7 +1,8 @@
 menuconfig THUNDERBOLT
 	tristate "Thunderbolt support for Apple devices"
+	depends on (EFI_STUB && X86) || COMPILE_TEST

This addition isn't correct, the thunderbolt driver works without the EFI stub, it just falls back to a hardcoded Device ROM.

Ok, makes sense.

I also needed this one though:

drivers/thunderbolt/Kconfig +1 -1
index bb0318ceaf93..de5d27ec67d6 100644
@@ -1,7 +1,7 @@
 menuconfig THUNDERBOLT
 	tristate "Thunderbolt support for Apple devices"
 	depends on PCI
-	select APPLE_PROPERTIES if EFI_STUB
+	select APPLE_PROPERTIES if EFI_STUB && X86
 	select CRC32
 	help
 	  Cactus Ridge Thunderbolt Controller driver

Without that change, building on ARM with EFI_STUB enabled still gives me a build failure.

Arnd

#3 lore raw
Quoted 33 lines · Arnd Bergmann
Quoted 12 lines · CET Lukas Wunner

drivers/thunderbolt/Kconfig line 3

Quoted 8 lines · Arnd Bergmann
drivers/thunderbolt/Kconfig +1 -0
index 0056df7f3c09..4e7d92193b65 100644
@@ -1,7 +1,8 @@
 menuconfig THUNDERBOLT
 	tristate "Thunderbolt support for Apple devices"
+	depends on (EFI_STUB && X86) || COMPILE_TEST

This addition isn't correct, the thunderbolt driver works without the EFI stub, it just falls back to a hardcoded Device ROM.

Ok, makes sense.

I also needed this one though:

drivers/thunderbolt/Kconfig +1 -1
index bb0318ceaf93..de5d27ec67d6 100644
@@ -1,7 +1,7 @@
 menuconfig THUNDERBOLT
 	tristate "Thunderbolt support for Apple devices"
 	depends on PCI
-	select APPLE_PROPERTIES if EFI_STUB
+	select APPLE_PROPERTIES if EFI_STUB && X86
 	select CRC32
 	help
 	  Cactus Ridge Thunderbolt Controller driver
Quoted 2 lines

Without that change, building on ARM with EFI_STUB enabled still gives me a build failure.

Hm, so far Thunderbolt is (unfortunately) an Intel proprietary technology that is only available on x86, so compiling anything in drivers/thunderbolt/ on other arches doesn't seem to make much sense. So maybe a "depends on X86" would be more appropriate?

One could argue that compiling on other arches helps avoid x86-isms in case Thunderbolt does become available on other arches one day, then again it seems like an enormous waste of CPU cycles. *shrug*

Opinions?

Thanks,

Lukas

A message that is not in the archive (sent off-list or not yet received): 3694785.gp6vtA09eN@wuerfel

#5 lore raw
Quoted 8 lines · Arnd Bergmann
Quoted 4 lines · CET Lukas Wunner

Hm, so far Thunderbolt is (unfortunately) an Intel proprietary technology that is only available on x86, so compiling anything in drivers/thunderbolt/ on other arches doesn't seem to make much sense. So maybe a "depends on X86" would be more appropriate?

I also found that we need "depends on ACPI" because APPLE_PROPERTIES does "select EFI_DEV_PATH_PARSER" and that requires APCI...

There's a series coming up to power the Thunderbolt controller down when nothing is plugged in and this is done via ACPI. This commit (slated for 4.11) was going to add a dependency on ACPI anyway:
https://github.com/l1k/linux/commit/c1f379d5dee4

So adding "depends on ACPI" now would be fine I guess.

Quoted 10 lines
Quoted 5 lines

One could argue that compiling on other arches helps avoid x86-isms in case Thunderbolt does become available on other arches one day, then again it seems like an enormous waste of CPU cycles. *shrug*

Opinions?

We try to avoid adding architecture-specific dependencies that prevent build testing, and we are adding '|| COMPILE_TEST' to a lot of drivers for this. We could use 'depends on X86 || COMPILE_TEST' here, but that wouldn't help the problem on ARM.

Yes, "depends on X86 || COMPILE_TEST" sounds like the right thing to do, independently of the build breakage at hand.

Quoted 4 lines

Another option would be to use 'depends on APPLE_PROPERTIES || APPLE_PROPERTIES=n', which would force the thunderbolt driver to be a loadable module if APPLE_PROPERTIES is one, but otherwise just allow all configurations.

APPLE_PROPERTIES is bool, not tristate, so this would work. However the solution you proposed earlier ("select APPLE_PROPERTIES if (X86 && EFI_STUB)") is more explicit and easier to understand, thus seems preferable to me.

Thanks!

Lukas

#6 lore raw
Quoted 10 lines · CET Lukas Wunner
Quoted 8 lines · Arnd Bergmann
Quoted 4 lines · CET Lukas Wunner

Hm, so far Thunderbolt is (unfortunately) an Intel proprietary technology that is only available on x86, so compiling anything in drivers/thunderbolt/ on other arches doesn't seem to make much sense. So maybe a "depends on X86" would be more appropriate?

I also found that we need "depends on ACPI" because APPLE_PROPERTIES does "select EFI_DEV_PATH_PARSER" and that requires APCI...

Quoted 7 lines

There's a series coming up to power the Thunderbolt controller down when nothing is plugged in and this is done via ACPI. This commit (slated for 4.11) was going to add a dependency on ACPI anyway:
https://github.com/l1k/linux/commit/c1f379d5dee4

So adding "depends on ACPI" now would be fine I guess.

It would take care of ARM, but not ARM64: ARM64 has ACPI and EFI_STUB, but cannot build APPLE_PROPERTIES. Adding the ACPI dependency by itself would not be sufficient.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

One could argue that compiling on other arches helps avoid x86-isms in case Thunderbolt does become available on other arches one day, then again it seems like an enormous waste of CPU cycles. *shrug*

Opinions?

Quoted 7 lines
Quoted 4 lines

We try to avoid adding architecture-specific dependencies that prevent build testing, and we are adding '|| COMPILE_TEST' to a lot of drivers for this. We could use 'depends on X86 || COMPILE_TEST' here, but that wouldn't help the problem on ARM.

Yes, "depends on X86 || COMPILE_TEST" sounds like the right thing to do, independently of the build breakage at hand.

Ok.

Quoted 9 lines
Quoted 4 lines

Another option would be to use 'depends on APPLE_PROPERTIES || APPLE_PROPERTIES=n', which would force the thunderbolt driver to be a loadable module if APPLE_PROPERTIES is one, but otherwise just allow all configurations.

APPLE_PROPERTIES is bool, not tristate, so this would work. However the solution you proposed earlier ("select APPLE_PROPERTIES if (X86 && EFI_STUB)") is more explicit and easier to understand, thus seems preferable to me.

Ok, sounds good. That should also fix ARM64 then.

Arnd

#7 lore raw
Quoted 44 lines · Arnd Bergmann
Quoted 10 lines · CET Lukas Wunner
Quoted 8 lines · Arnd Bergmann
Quoted 4 lines · CET Lukas Wunner

Hm, so far Thunderbolt is (unfortunately) an Intel proprietary technology that is only available on x86, so compiling anything in drivers/thunderbolt/ on other arches doesn't seem to make much sense. So maybe a "depends on X86" would be more appropriate?

I also found that we need "depends on ACPI" because APPLE_PROPERTIES does "select EFI_DEV_PATH_PARSER" and that requires APCI...

Quoted 7 lines

There's a series coming up to power the Thunderbolt controller down when nothing is plugged in and this is done via ACPI. This commit (slated for 4.11) was going to add a dependency on ACPI anyway:
https://github.com/l1k/linux/commit/c1f379d5dee4

So adding "depends on ACPI" now would be fine I guess.

It would take care of ARM, but not ARM64: ARM64 has ACPI and EFI_STUB, but cannot build APPLE_PROPERTIES. Adding the ACPI dependency by itself would not be sufficient.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

One could argue that compiling on other arches helps avoid x86-isms in case Thunderbolt does become available on other arches one day, then again it seems like an enormous waste of CPU cycles. *shrug*

Opinions?

Quoted 7 lines
Quoted 4 lines

We try to avoid adding architecture-specific dependencies that prevent build testing, and we are adding '|| COMPILE_TEST' to a lot of drivers for this. We could use 'depends on X86 || COMPILE_TEST' here, but that wouldn't help the problem on ARM.

Yes, "depends on X86 || COMPILE_TEST" sounds like the right thing to do, independently of the build breakage at hand.

Ok.

Quoted 5 lines
Quoted 4 lines

Another option would be to use 'depends on APPLE_PROPERTIES || APPLE_PROPERTIES=n', which would force the thunderbolt driver to be a loadable module if APPLE_PROPERTIES is one, but otherwise just allow all configurations.

Quoted 6 lines
Quoted 4 lines

APPLE_PROPERTIES is bool, not tristate, so this would work. However the solution you proposed earlier ("select APPLE_PROPERTIES if (X86 && EFI_STUB)") is more explicit and easier to understand, thus seems preferable to me.

Ok, sounds good. That should also fix ARM64 then.

Are you going to submit a fix for this or would you prefer me to do it? Given the effort you've already put into it you might as well claim credit for the fix, but I'll be happy to do it if that is preferred.

Thanks,

Lukas

#8 lore raw
Quoted 6 lines · CET Lukas Wunner
Quoted 2 lines

Ok, sounds good. That should also fix ARM64 then.

Are you going to submit a fix for this or would you prefer me to do it? Given the effort you've already put into it you might as well claim credit for the fix, but I'll be happy to do it if that is preferred.

I'd rather have you do it, less work for me that way, just add

Thanks,

Arnd