LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2.6.28-rc2] i386: fix forbid_dac linkage error when CONFIG_PCI=n
@ 2008-10-27  8:17 Mikael Pettersson
  2008-10-27  9:41 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Pettersson @ 2008-10-27  8:17 UTC (permalink / raw)
  To: mingo; +Cc: hpa, linux-kernel, tglx

Fix 2.6.28-rc2 build failure on i386 with CONFIG_PCI=n:

  ld -m elf_i386  -o .tmp_vmlinux1 -T arch/x86/kernel/vmlinux.lds arch/x86/kernel/head_32.o arch/x86/kernel/head32.o arch/x86/kernel/head.o arch/x86/kernel/init_task.o  init/built-in.o --start-group  usr/built-in.o  arch/x86/kernel/built-in.o  arch/x86/mm/built-in.o  arch/x86/mach-default/built-in.o  arch/x86/crypto/built-in.o  arch/x86/vdso/built-in.o  kernel/built-in.o  mm/built-in.o  fs/built-in.o  ipc/built-in.o  security/built-in.o  crypto/built-in.o  block/built-in.o  lib/lib.a  arch/x86/lib/lib.a  lib/built-in.o  arch/x86/lib/built-in.o  drivers/built-in.o  sound/built-in.o  firmware/built-in.o  net/built-in.o --end-group 
arch/x86/kernel/built-in.o: In function `iommu_setup':
pci-dma.c:(.init.text+0x3120): undefined reference to `forbid_dac'
pci-dma.c:(.init.text+0x313f): undefined reference to `forbid_dac'
pci-dma.c:(.init.text+0x3187): undefined reference to `forbid_dac'
make: *** [.tmp_vmlinux1] Error 1

The variable forbid_dac was moved from arch/x86/kernel/pci-dma.c
to drivers/pci/quirks.c. When CONFIG_PCI=n pci-dma.c now refers to
a variable that's never defined, causing a linkage error.

Fixed by bracketing the forbid_dac accesses (command-line options
parsing) with #ifdef CONFIG_PCI ... #endif.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
---
 arch/x86/kernel/pci-dma.c |    2 ++
 1 file changed, 2 insertions(+)

diff -rupN linux-2.6.28-rc2/arch/x86/kernel/pci-dma.c linux-2.6.28-rc2.x86-forbid_dac-is-pci-only/arch/x86/kernel/pci-dma.c
--- linux-2.6.28-rc2/arch/x86/kernel/pci-dma.c	2008-10-26 21:35:33.000000000 +0100
+++ linux-2.6.28-rc2.x86-forbid_dac-is-pci-only/arch/x86/kernel/pci-dma.c	2008-10-27 08:55:10.000000000 +0100
@@ -202,6 +202,7 @@ static __init int iommu_setup(char *p)
 			iommu_merge = 0;
 		if (!strncmp(p, "forcesac", 8))
 			iommu_sac_force = 1;
+#ifdef CONFIG_PCI
 		if (!strncmp(p, "allowdac", 8))
 			forbid_dac = 0;
 		if (!strncmp(p, "nodac", 5))
@@ -210,6 +211,7 @@ static __init int iommu_setup(char *p)
 			forbid_dac = -1;
 			return 1;
 		}
+#endif /* CONFIG_PCI */
 #ifdef CONFIG_SWIOTLB
 		if (!strncmp(p, "soft", 4))
 			swiotlb = 1;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2.6.28-rc2] i386: fix forbid_dac linkage error when CONFIG_PCI=n
  2008-10-27  8:17 [PATCH 2.6.28-rc2] i386: fix forbid_dac linkage error when CONFIG_PCI=n Mikael Pettersson
@ 2008-10-27  9:41 ` Ingo Molnar
  2008-10-27 10:05   ` Mikael Pettersson
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2008-10-27  9:41 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: mingo, hpa, linux-kernel, tglx, Jesse Barnes


* Mikael Pettersson <mikpe@it.uu.se> wrote:

> Fix 2.6.28-rc2 build failure on i386 with CONFIG_PCI=n:

> +#ifdef CONFIG_PCI
>  		if (!strncmp(p, "allowdac", 8))
>  			forbid_dac = 0;
>  		if (!strncmp(p, "nodac", 5))
> @@ -210,6 +211,7 @@ static __init int iommu_setup(char *p)
>  			forbid_dac = -1;
>  			return 1;
>  		}
> +#endif /* CONFIG_PCI */

there's a better fix for this queued up in the PCI tree, see:

 http://marc.info/?l=linux-kernel&m=122480590627590&w=2

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2.6.28-rc2] i386: fix forbid_dac linkage error when CONFIG_PCI=n
  2008-10-27  9:41 ` Ingo Molnar
@ 2008-10-27 10:05   ` Mikael Pettersson
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Pettersson @ 2008-10-27 10:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Mikael Pettersson, mingo, hpa, linux-kernel, tglx, Jesse Barnes

Ingo Molnar writes:
 > 
 > * Mikael Pettersson <mikpe@it.uu.se> wrote:
 > 
 > > Fix 2.6.28-rc2 build failure on i386 with CONFIG_PCI=n:
 > 
 > > +#ifdef CONFIG_PCI
 > >  		if (!strncmp(p, "allowdac", 8))
 > >  			forbid_dac = 0;
 > >  		if (!strncmp(p, "nodac", 5))
 > > @@ -210,6 +211,7 @@ static __init int iommu_setup(char *p)
 > >  			forbid_dac = -1;
 > >  			return 1;
 > >  		}
 > > +#endif /* CONFIG_PCI */
 > 
 > there's a better fix for this queued up in the PCI tree, see:
 > 
 >  http://marc.info/?l=linux-kernel&m=122480590627590&w=2

Got it. Thanks.

/Mikael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-27 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-27  8:17 [PATCH 2.6.28-rc2] i386: fix forbid_dac linkage error when CONFIG_PCI=n Mikael Pettersson
2008-10-27  9:41 ` Ingo Molnar
2008-10-27 10:05   ` Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).