Skip to contentSkip to conversation

tty/powerpc: fix build break with ehv_bytechan.c on allyesconfig

PATCH Superseded Timur Tabi 2 participants 6 messages Aug 25, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/1 tty/powerpc: fix build break with ehv_bytechan.c on allyesconfig

The Kconfig for the ePAPR hypervisor byte channel driver has a "depends on PPC", which means it would compile on all PowerPC platforms, even though it's only been tested on Freescale platforms. Change the Kconfig to depend on FSL_SOC instead.

---
 drivers/tty/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/tty/Kconfig +1 -1
index f1ea59b..535af0a 100644
@@ -353,7 +353,7 @@ config TRACE_SINK
 
 config PPC_EPAPR_HV_BYTECHAN
 	tristate "ePAPR hypervisor byte channel driver"
-	depends on PPC
+	depends on FSL_SOC
 	help
 	  This driver creates /dev entries for each ePAPR hypervisor byte
 	  channel, thereby allowing applications to communicate with byte
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 4 lines · Timur Tabi

The Kconfig for the ePAPR hypervisor byte channel driver has a "depends on PPC", which means it would compile on all PowerPC platforms, even though it's only been tested on Freescale platforms. Change the Kconfig to depend on FSL_SOC instead.

tested doesn't mean that it shouldn't still build properly for other platforms, right?

What is keeping the driver from building on all PPC, or even all arches today?

greg k-h

author
#2 lore raw
Quoted 2 lines · Greg KH

tested doesn't mean that it shouldn't still build properly for other platforms, right?

The problem is the dependency on MSR_GS, which is defined only for Book-E PowerPC chips, not all PowerPC.

So I gave it some more thought, and technically ePAPR extends beyond Book-E, so it's wrong for the driver to depend on anything specific to Book-E. I've removed the code that breaks:

	/* Check if we're running as a guest of a hypervisor */
	if (!(mfmsr() & MSR_GS))
		return;
Quoted 2 lines

What is keeping the driver from building on all PPC, or even all arches today?

I've made a few changes, and it builds on all PPC now. I'll post a new patch.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#3 lore raw
Quoted 7 lines · Timur Tabi
Quoted 2 lines · Greg KH

tested doesn't mean that it shouldn't still build properly for other platforms, right?

The problem is the dependency on MSR_GS, which is defined only for Book-E PowerPC chips, not all PowerPC.

Quoted 7 lines

So I gave it some more thought, and technically ePAPR extends beyond Book-E, so it's wrong for the driver to depend on anything specific to Book-E. I've removed the code that breaks:

	/* Check if we're running as a guest of a hypervisor */
	if (!(mfmsr() & MSR_GS))
		return;

But don't you really want this type of check at runtime? What happens if you load this driver on a machine that is not a guest? Will things break? Shouldn't you still refuse to load somehow?

thanks,

greg k-h

author
#4 lore raw
Quoted 3 lines · Greg KH

But don't you really want this type of check at runtime? What happens if you load this driver on a machine that is not a guest? Will things break? Shouldn't you still refuse to load somehow?

This is in the udbg code, which falls under the category of, "turn this on only if you know what you're doing."

The udbg code runs very early, before the device tree is available. There's no way of knowing at this point whether or not we're running under a hypervisor. If you turn on udbg support, then it means that you're trying to do some very specific debugging on a specific platform.

So I'm not removing this code just to fix the build break. It really should never have been there in the first place.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#5 lore raw
Quoted 8 lines · Timur Tabi
Quoted 3 lines · Greg KH

But don't you really want this type of check at runtime? What happens if you load this driver on a machine that is not a guest? Will things break? Shouldn't you still refuse to load somehow?

This is in the udbg code, which falls under the category of, "turn this on only if you know what you're doing."

Quoted 7 lines

The udbg code runs very early, before the device tree is available. There's no way of knowing at this point whether or not we're running under a hypervisor. If you turn on udbg support, then it means that you're trying to do some very specific debugging on a specific platform.

So I'm not removing this code just to fix the build break. It really should never have been there in the first place.

Ok, thanks for the details, I'll queue up the patch in a bit.

greg k-h