mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@it.uu.se>
To: mingo@redhat.com
Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de
Subject: [PATCH 2.6.28-rc2] i386: fix forbid_dac linkage error when CONFIG_PCI=n
Date: Mon, 27 Oct 2008 09:17:54 +0100 (MET)	[thread overview]
Message-ID: <200810270817.m9R8HsJu029399@harpo.it.uu.se> (raw)

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;

             reply	other threads:[~2008-10-27  8:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-27  8:17 Mikael Pettersson [this message]
2008-10-27  9:41 ` Ingo Molnar
2008-10-27 10:05   ` Mikael Pettersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810270817.m9R8HsJu029399@harpo.it.uu.se \
    --to=mikpe@it.uu.se \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®