Commit 2d959e95 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-fixes-for-linus' of...

Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86/agp: Fix agp_amd64_init() initialization with CONFIG_GART_IOMMU enabled
  x86: SGI UV: Fix writes to led registers on remote uv hubs
  x86, kmemcheck: Use KERN_WARNING for error reporting
  x86: Use KERN_DEFAULT log-level in __show_regs()
  x86, compress: Force i386 instructions for the decompressor
  x86/amd-iommu: Fix initialization failure panic
  dma-debug: Do not add notifier when dma debugging is disabled.
  x86: Fix objdump version check in chkobjdump.awk for different formats.

Trivial conflicts in arch/x86/include/asm/uv/uv_hub.h due to me having
applied an earlier version of an SGI UV fix.
parents 9d6e323c f405d2c0
...@@ -9,6 +9,7 @@ targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinu ...@@ -9,6 +9,7 @@ targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinu
KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
KBUILD_CFLAGS += -fno-strict-aliasing -fPIC KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
cflags-$(CONFIG_X86_32) := -march=i386
cflags-$(CONFIG_X86_64) := -mcmodel=small cflags-$(CONFIG_X86_64) := -mcmodel=small
KBUILD_CFLAGS += $(cflags-y) KBUILD_CFLAGS += $(cflags-y)
KBUILD_CFLAGS += $(call cc-option,-ffreestanding) KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
......
...@@ -31,20 +31,20 @@ ...@@ -31,20 +31,20 @@
* contiguous (although various IO spaces may punch holes in * contiguous (although various IO spaces may punch holes in
* it).. * it)..
* *
* N - Number of bits in the node portion of a socket physical * N - Number of bits in the node portion of a socket physical
* address. * address.
* *
* NASID - network ID of a router, Mbrick or Cbrick. Nasid values of * NASID - network ID of a router, Mbrick or Cbrick. Nasid values of
* routers always have low bit of 1, C/MBricks have low bit * routers always have low bit of 1, C/MBricks have low bit
* equal to 0. Most addressing macros that target UV hub chips * equal to 0. Most addressing macros that target UV hub chips
* right shift the NASID by 1 to exclude the always-zero bit. * right shift the NASID by 1 to exclude the always-zero bit.
* NASIDs contain up to 15 bits. * NASIDs contain up to 15 bits.
* *
* GNODE - NASID right shifted by 1 bit. Most mmrs contain gnodes instead * GNODE - NASID right shifted by 1 bit. Most mmrs contain gnodes instead
* of nasids. * of nasids.
* *
* PNODE - the low N bits of the GNODE. The PNODE is the most useful variant * PNODE - the low N bits of the GNODE. The PNODE is the most useful variant
* of the nasid for socket usage. * of the nasid for socket usage.
* *
* *
* NumaLink Global Physical Address Format: * NumaLink Global Physical Address Format:
...@@ -71,12 +71,12 @@ ...@@ -71,12 +71,12 @@
* *
* *
* APICID format * APICID format
* NOTE!!!!!! This is the current format of the APICID. However, code * NOTE!!!!!! This is the current format of the APICID. However, code
* should assume that this will change in the future. Use functions * should assume that this will change in the future. Use functions
* in this file for all APICID bit manipulations and conversion. * in this file for all APICID bit manipulations and conversion.
* *
* 1111110000000000 * 1111110000000000
* 5432109876543210 * 5432109876543210
* pppppppppplc0cch * pppppppppplc0cch
* sssssssssss * sssssssssss
* *
...@@ -89,9 +89,9 @@ ...@@ -89,9 +89,9 @@
* Note: Processor only supports 12 bits in the APICID register. The ACPI * Note: Processor only supports 12 bits in the APICID register. The ACPI
* tables hold all 16 bits. Software needs to be aware of this. * tables hold all 16 bits. Software needs to be aware of this.
* *
* Unless otherwise specified, all references to APICID refer to * Unless otherwise specified, all references to APICID refer to
* the FULL value contained in ACPI tables, not the subset in the * the FULL value contained in ACPI tables, not the subset in the
* processor APICID register. * processor APICID register.
*/ */
...@@ -151,16 +151,16 @@ struct uv_hub_info_s { ...@@ -151,16 +151,16 @@ struct uv_hub_info_s {
}; };
DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
#define uv_hub_info (&__get_cpu_var(__uv_hub_info)) #define uv_hub_info (&__get_cpu_var(__uv_hub_info))
#define uv_cpu_hub_info(cpu) (&per_cpu(__uv_hub_info, cpu)) #define uv_cpu_hub_info(cpu) (&per_cpu(__uv_hub_info, cpu))
/* /*
* Local & Global MMR space macros. * Local & Global MMR space macros.
* Note: macros are intended to be used ONLY by inline functions * Note: macros are intended to be used ONLY by inline functions
* in this file - not by other kernel code. * in this file - not by other kernel code.
* n - NASID (full 15-bit global nasid) * n - NASID (full 15-bit global nasid)
* g - GNODE (full 15-bit global nasid, right shifted 1) * g - GNODE (full 15-bit global nasid, right shifted 1)
* p - PNODE (local part of nsids, right shifted 1) * p - PNODE (local part of nsids, right shifted 1)
*/ */
#define UV_NASID_TO_PNODE(n) (((n) >> 1) & uv_hub_info->pnode_mask) #define UV_NASID_TO_PNODE(n) (((n) >> 1) & uv_hub_info->pnode_mask)
#define UV_PNODE_TO_GNODE(p) ((p) |uv_hub_info->gnode_extra) #define UV_PNODE_TO_GNODE(p) ((p) |uv_hub_info->gnode_extra)
...@@ -215,8 +215,8 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); ...@@ -215,8 +215,8 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
/* /*
* Macros for converting between kernel virtual addresses, socket local physical * Macros for converting between kernel virtual addresses, socket local physical
* addresses, and UV global physical addresses. * addresses, and UV global physical addresses.
* Note: use the standard __pa() & __va() macros for converting * Note: use the standard __pa() & __va() macros for converting
* between socket virtual and socket physical addresses. * between socket virtual and socket physical addresses.
*/ */
/* socket phys RAM --> UV global physical address */ /* socket phys RAM --> UV global physical address */
...@@ -287,21 +287,18 @@ static inline int uv_apicid_to_pnode(int apicid) ...@@ -287,21 +287,18 @@ static inline int uv_apicid_to_pnode(int apicid)
* Access global MMRs using the low memory MMR32 space. This region supports * Access global MMRs using the low memory MMR32 space. This region supports
* faster MMR access but not all MMRs are accessible in this space. * faster MMR access but not all MMRs are accessible in this space.
*/ */
static inline unsigned long *uv_global_mmr32_address(int pnode, static inline unsigned long *uv_global_mmr32_address(int pnode, unsigned long offset)
unsigned long offset)
{ {
return __va(UV_GLOBAL_MMR32_BASE | return __va(UV_GLOBAL_MMR32_BASE |
UV_GLOBAL_MMR32_PNODE_BITS(pnode) | offset); UV_GLOBAL_MMR32_PNODE_BITS(pnode) | offset);
} }
static inline void uv_write_global_mmr32(int pnode, unsigned long offset, static inline void uv_write_global_mmr32(int pnode, unsigned long offset, unsigned long val)
unsigned long val)
{ {
writeq(val, uv_global_mmr32_address(pnode, offset)); writeq(val, uv_global_mmr32_address(pnode, offset));
} }
static inline unsigned long uv_read_global_mmr32(int pnode, static inline unsigned long uv_read_global_mmr32(int pnode, unsigned long offset)
unsigned long offset)
{ {
return readq(uv_global_mmr32_address(pnode, offset)); return readq(uv_global_mmr32_address(pnode, offset));
} }
...@@ -310,21 +307,18 @@ static inline unsigned long uv_read_global_mmr32(int pnode, ...@@ -310,21 +307,18 @@ static inline unsigned long uv_read_global_mmr32(int pnode,
* Access Global MMR space using the MMR space located at the top of physical * Access Global MMR space using the MMR space located at the top of physical
* memory. * memory.
*/ */
static inline unsigned long *uv_global_mmr64_address(int pnode, static inline unsigned long *uv_global_mmr64_address(int pnode, unsigned long offset)
unsigned long offset)
{ {
return __va(UV_GLOBAL_MMR64_BASE | return __va(UV_GLOBAL_MMR64_BASE |
UV_GLOBAL_MMR64_PNODE_BITS(pnode) | offset); UV_GLOBAL_MMR64_PNODE_BITS(pnode) | offset);
} }
static inline void uv_write_global_mmr64(int pnode, unsigned long offset, static inline void uv_write_global_mmr64(int pnode, unsigned long offset, unsigned long val)
unsigned long val)
{ {
writeq(val, uv_global_mmr64_address(pnode, offset)); writeq(val, uv_global_mmr64_address(pnode, offset));
} }
static inline unsigned long uv_read_global_mmr64(int pnode, static inline unsigned long uv_read_global_mmr64(int pnode, unsigned long offset)
unsigned long offset)
{ {
return readq(uv_global_mmr64_address(pnode, offset)); return readq(uv_global_mmr64_address(pnode, offset));
} }
...@@ -338,14 +332,12 @@ static inline unsigned long uv_global_gru_mmr_address(int pnode, unsigned long o ...@@ -338,14 +332,12 @@ static inline unsigned long uv_global_gru_mmr_address(int pnode, unsigned long o
return UV_GLOBAL_GRU_MMR_BASE | offset | (pnode << uv_hub_info->m_val); return UV_GLOBAL_GRU_MMR_BASE | offset | (pnode << uv_hub_info->m_val);
} }
static inline void uv_write_global_mmr8(int pnode, unsigned long offset, static inline void uv_write_global_mmr8(int pnode, unsigned long offset, unsigned char val)
unsigned char val)
{ {
writeb(val, uv_global_mmr64_address(pnode, offset)); writeb(val, uv_global_mmr64_address(pnode, offset));
} }
static inline unsigned char uv_read_global_mmr8(int pnode, static inline unsigned char uv_read_global_mmr8(int pnode, unsigned long offset)
unsigned long offset)
{ {
return readb(uv_global_mmr64_address(pnode, offset)); return readb(uv_global_mmr64_address(pnode, offset));
} }
......
...@@ -137,6 +137,11 @@ int amd_iommus_present; ...@@ -137,6 +137,11 @@ int amd_iommus_present;
/* IOMMUs have a non-present cache? */ /* IOMMUs have a non-present cache? */
bool amd_iommu_np_cache __read_mostly; bool amd_iommu_np_cache __read_mostly;
/*
* Set to true if ACPI table parsing and hardware intialization went properly
*/
static bool amd_iommu_initialized;
/* /*
* List of protection domains - used during resume * List of protection domains - used during resume
*/ */
...@@ -929,6 +934,8 @@ static int __init init_iommu_all(struct acpi_table_header *table) ...@@ -929,6 +934,8 @@ static int __init init_iommu_all(struct acpi_table_header *table)
} }
WARN_ON(p != end); WARN_ON(p != end);
amd_iommu_initialized = true;
return 0; return 0;
} }
...@@ -1263,6 +1270,9 @@ static int __init amd_iommu_init(void) ...@@ -1263,6 +1270,9 @@ static int __init amd_iommu_init(void)
if (acpi_table_parse("IVRS", init_iommu_all) != 0) if (acpi_table_parse("IVRS", init_iommu_all) != 0)
goto free; goto free;
if (!amd_iommu_initialized)
goto free;
if (acpi_table_parse("IVRS", init_memory_definitions) != 0) if (acpi_table_parse("IVRS", init_memory_definitions) != 0)
goto free; goto free;
......
...@@ -103,8 +103,8 @@ void show_regs_common(void) ...@@ -103,8 +103,8 @@ void show_regs_common(void)
if (!product) if (!product)
product = ""; product = "";
printk("\n"); printk(KERN_CONT "\n");
printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s %s/%s\n", printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s %s/%s\n",
current->pid, current->comm, print_tainted(), current->pid, current->comm, print_tainted(),
init_utsname()->release, init_utsname()->release,
(int)strcspn(init_utsname()->version, " "), (int)strcspn(init_utsname()->version, " "),
......
...@@ -139,16 +139,16 @@ void __show_regs(struct pt_regs *regs, int all) ...@@ -139,16 +139,16 @@ void __show_regs(struct pt_regs *regs, int all)
show_regs_common(); show_regs_common();
printk("EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n", printk(KERN_DEFAULT "EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n",
(u16)regs->cs, regs->ip, regs->flags, (u16)regs->cs, regs->ip, regs->flags,
smp_processor_id()); smp_processor_id());
print_symbol("EIP is at %s\n", regs->ip); print_symbol("EIP is at %s\n", regs->ip);
printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", printk(KERN_DEFAULT "EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
regs->ax, regs->bx, regs->cx, regs->dx); regs->ax, regs->bx, regs->cx, regs->dx);
printk("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n", printk(KERN_DEFAULT "ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n",
regs->si, regs->di, regs->bp, sp); regs->si, regs->di, regs->bp, sp);
printk(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n", printk(KERN_DEFAULT " DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n",
(u16)regs->ds, (u16)regs->es, (u16)regs->fs, gs, ss); (u16)regs->ds, (u16)regs->es, (u16)regs->fs, gs, ss);
if (!all) if (!all)
...@@ -158,19 +158,19 @@ void __show_regs(struct pt_regs *regs, int all) ...@@ -158,19 +158,19 @@ void __show_regs(struct pt_regs *regs, int all)
cr2 = read_cr2(); cr2 = read_cr2();
cr3 = read_cr3(); cr3 = read_cr3();
cr4 = read_cr4_safe(); cr4 = read_cr4_safe();
printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", printk(KERN_DEFAULT "CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n",
cr0, cr2, cr3, cr4); cr0, cr2, cr3, cr4);
get_debugreg(d0, 0); get_debugreg(d0, 0);
get_debugreg(d1, 1); get_debugreg(d1, 1);
get_debugreg(d2, 2); get_debugreg(d2, 2);
get_debugreg(d3, 3); get_debugreg(d3, 3);
printk("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n", printk(KERN_DEFAULT "DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
d0, d1, d2, d3); d0, d1, d2, d3);
get_debugreg(d6, 6); get_debugreg(d6, 6);
get_debugreg(d7, 7); get_debugreg(d7, 7);
printk("DR6: %08lx DR7: %08lx\n", printk(KERN_DEFAULT "DR6: %08lx DR7: %08lx\n",
d6, d7); d6, d7);
} }
......
...@@ -161,19 +161,19 @@ void __show_regs(struct pt_regs *regs, int all) ...@@ -161,19 +161,19 @@ void __show_regs(struct pt_regs *regs, int all)
unsigned int ds, cs, es; unsigned int ds, cs, es;
show_regs_common(); show_regs_common();
printk(KERN_INFO "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); printk(KERN_DEFAULT "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip);
printk_address(regs->ip, 1); printk_address(regs->ip, 1);
printk(KERN_INFO "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, printk(KERN_DEFAULT "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss,
regs->sp, regs->flags); regs->sp, regs->flags);
printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n", printk(KERN_DEFAULT "RAX: %016lx RBX: %016lx RCX: %016lx\n",
regs->ax, regs->bx, regs->cx); regs->ax, regs->bx, regs->cx);
printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n", printk(KERN_DEFAULT "RDX: %016lx RSI: %016lx RDI: %016lx\n",
regs->dx, regs->si, regs->di); regs->dx, regs->si, regs->di);
printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n", printk(KERN_DEFAULT "RBP: %016lx R08: %016lx R09: %016lx\n",
regs->bp, regs->r8, regs->r9); regs->bp, regs->r8, regs->r9);
printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n", printk(KERN_DEFAULT "R10: %016lx R11: %016lx R12: %016lx\n",
regs->r10, regs->r11, regs->r12); regs->r10, regs->r11, regs->r12);
printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n", printk(KERN_DEFAULT "R13: %016lx R14: %016lx R15: %016lx\n",
regs->r13, regs->r14, regs->r15); regs->r13, regs->r14, regs->r15);
asm("movl %%ds,%0" : "=r" (ds)); asm("movl %%ds,%0" : "=r" (ds));
...@@ -194,21 +194,21 @@ void __show_regs(struct pt_regs *regs, int all) ...@@ -194,21 +194,21 @@ void __show_regs(struct pt_regs *regs, int all)
cr3 = read_cr3(); cr3 = read_cr3();
cr4 = read_cr4(); cr4 = read_cr4();
printk(KERN_INFO "FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n", printk(KERN_DEFAULT "FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n",
fs, fsindex, gs, gsindex, shadowgs); fs, fsindex, gs, gsindex, shadowgs);
printk(KERN_INFO "CS: %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds, printk(KERN_DEFAULT "CS: %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds,
es, cr0); es, cr0);
printk(KERN_INFO "CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3, printk(KERN_DEFAULT "CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3,
cr4); cr4);
get_debugreg(d0, 0); get_debugreg(d0, 0);
get_debugreg(d1, 1); get_debugreg(d1, 1);
get_debugreg(d2, 2); get_debugreg(d2, 2);
printk(KERN_INFO "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2); printk(KERN_DEFAULT "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2);
get_debugreg(d3, 3); get_debugreg(d3, 3);
get_debugreg(d6, 6); get_debugreg(d6, 6);
get_debugreg(d7, 7); get_debugreg(d7, 7);
printk(KERN_INFO "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7); printk(KERN_DEFAULT "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7);
} }
void show_regs(struct pt_regs *regs) void show_regs(struct pt_regs *regs)
......
...@@ -106,26 +106,25 @@ void kmemcheck_error_recall(void) ...@@ -106,26 +106,25 @@ void kmemcheck_error_recall(void)
switch (e->type) { switch (e->type) {
case KMEMCHECK_ERROR_INVALID_ACCESS: case KMEMCHECK_ERROR_INVALID_ACCESS:
printk(KERN_ERR "WARNING: kmemcheck: Caught %d-bit read " printk(KERN_WARNING "WARNING: kmemcheck: Caught %d-bit read from %s memory (%p)\n",
"from %s memory (%p)\n",
8 * e->size, e->state < ARRAY_SIZE(desc) ? 8 * e->size, e->state < ARRAY_SIZE(desc) ?
desc[e->state] : "(invalid shadow state)", desc[e->state] : "(invalid shadow state)",
(void *) e->address); (void *) e->address);
printk(KERN_INFO); printk(KERN_WARNING);
for (i = 0; i < SHADOW_COPY_SIZE; ++i) for (i = 0; i < SHADOW_COPY_SIZE; ++i)
printk("%02x", e->memory_copy[i]); printk(KERN_CONT "%02x", e->memory_copy[i]);
printk("\n"); printk(KERN_CONT "\n");
printk(KERN_INFO); printk(KERN_WARNING);
for (i = 0; i < SHADOW_COPY_SIZE; ++i) { for (i = 0; i < SHADOW_COPY_SIZE; ++i) {
if (e->shadow_copy[i] < ARRAY_SIZE(short_desc)) if (e->shadow_copy[i] < ARRAY_SIZE(short_desc))
printk(" %c", short_desc[e->shadow_copy[i]]); printk(KERN_CONT " %c", short_desc[e->shadow_copy[i]]);
else else
printk(" ?"); printk(KERN_CONT " ?");
} }
printk("\n"); printk(KERN_CONT "\n");
printk(KERN_INFO "%*c\n", 2 + 2 printk(KERN_WARNING "%*c\n", 2 + 2
* (int) (e->address & (SHADOW_COPY_SIZE - 1)), '^'); * (int) (e->address & (SHADOW_COPY_SIZE - 1)), '^');
break; break;
case KMEMCHECK_ERROR_BUG: case KMEMCHECK_ERROR_BUG:
......
...@@ -8,14 +8,24 @@ BEGIN { ...@@ -8,14 +8,24 @@ BEGIN {
od_sver = 19; od_sver = 19;
} }
/^GNU/ { /^GNU objdump/ {
split($3, ver, "."); verstr = ""
for (i = 3; i <= NF; i++)
if (match($(i), "^[0-9]")) {
verstr = $(i);
break;
}
if (verstr == "") {
printf("Warning: Failed to find objdump version number.\n");
exit 0;
}
split(verstr, ver, ".");
if (ver[1] > od_ver || if (ver[1] > od_ver ||
(ver[1] == od_ver && ver[2] >= od_sver)) { (ver[1] == od_ver && ver[2] >= od_sver)) {
exit 1; exit 1;
} else { } else {
printf("Warning: objdump version %s is older than %d.%d\n", printf("Warning: objdump version %s is older than %d.%d\n",
$4, od_ver, od_sver); verstr, od_ver, od_sver);
print("Warning: Skipping posttest."); print("Warning: Skipping posttest.");
# Logic is inverted, because we just skip test without error. # Logic is inverted, because we just skip test without error.
exit 0; exit 0;
......
...@@ -725,9 +725,14 @@ static struct pci_driver agp_amd64_pci_driver = { ...@@ -725,9 +725,14 @@ static struct pci_driver agp_amd64_pci_driver = {
int __init agp_amd64_init(void) int __init agp_amd64_init(void)
{ {
int err = 0; int err = 0;
static int done = 0;
if (agp_off) if (agp_off)
return -EINVAL; return -EINVAL;
if (done++)
return agp_bridges_found ? 0 : -ENODEV;
err = pci_register_driver(&agp_amd64_pci_driver); err = pci_register_driver(&agp_amd64_pci_driver);
if (err < 0) if (err < 0)
return err; return err;
...@@ -771,12 +776,8 @@ static void __exit agp_amd64_cleanup(void) ...@@ -771,12 +776,8 @@ static void __exit agp_amd64_cleanup(void)
pci_unregister_driver(&agp_amd64_pci_driver); pci_unregister_driver(&agp_amd64_pci_driver);
} }
/* On AMD64 the PCI driver needs to initialize this driver early
for the IOMMU, so it has to be called via a backdoor. */
#ifndef CONFIG_GART_IOMMU
module_init(agp_amd64_init); module_init(agp_amd64_init);
module_exit(agp_amd64_cleanup); module_exit(agp_amd64_cleanup);
#endif
MODULE_AUTHOR("Dave Jones <davej@redhat.com>, Andi Kleen"); MODULE_AUTHOR("Dave Jones <davej@redhat.com>, Andi Kleen");
module_param(agp_try_unsupported, bool, 0); module_param(agp_try_unsupported, bool, 0);
......
...@@ -676,6 +676,8 @@ static int dma_debug_device_change(struct notifier_block *nb, ...@@ -676,6 +676,8 @@ static int dma_debug_device_change(struct notifier_block *nb,
struct device *dev = data; struct device *dev = data;
int count; int count;
if (global_disable)
return;
switch (action) { switch (action) {
case BUS_NOTIFY_UNBOUND_DRIVER: case BUS_NOTIFY_UNBOUND_DRIVER:
...@@ -697,6 +699,9 @@ void dma_debug_add_bus(struct bus_type *bus) ...@@ -697,6 +699,9 @@ void dma_debug_add_bus(struct bus_type *bus)
{ {
struct notifier_block *nb; struct notifier_block *nb;
if (global_disable)
return;
nb = kzalloc(sizeof(struct notifier_block), GFP_KERNEL); nb = kzalloc(sizeof(struct notifier_block), GFP_KERNEL);
if (nb == NULL) { if (nb == NULL) {
pr_err("dma_debug_add_bus: out of memory\n"); pr_err("dma_debug_add_bus: out of memory\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment