Commit 1faa6ec8 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, mcheck: Avoid duplicate sysfs links/files for thresholding banks
  io-mapping: Fix the address space annotations
  x86: Fix the address space annotations of iomap_atomic_prot_pfn()
  x86, mm: Fix CONFIG_VMSPLIT_1G and 2G_OPT trampoline
  x86, hwmon: Fix unsafe smp_processor_id() in thermal_throttle_add_dev
parents 79637a41 1389298f
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
void * void __iomem *
iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);
void void
iounmap_atomic(void *kvaddr, enum km_type type); iounmap_atomic(void __iomem *kvaddr, enum km_type type);
int int
iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot); iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot);
......
...@@ -530,7 +530,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) ...@@ -530,7 +530,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
} }
if (!alloc_cpumask_var(&b->cpus, GFP_KERNEL)) { if (!zalloc_cpumask_var(&b->cpus, GFP_KERNEL)) {
kfree(b); kfree(b);
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -543,7 +543,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) ...@@ -543,7 +543,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
cpumask_setall(b->cpus); cpumask_setall(b->cpus);
#else #else
cpumask_copy(b->cpus, c->llc_shared_map); cpumask_set_cpu(cpu, b->cpus);
#endif #endif
per_cpu(threshold_banks, cpu)[bank] = b; per_cpu(threshold_banks, cpu)[bank] = b;
......
...@@ -202,10 +202,11 @@ static int therm_throt_process(bool new_event, int event, int level) ...@@ -202,10 +202,11 @@ static int therm_throt_process(bool new_event, int event, int level)
#ifdef CONFIG_SYSFS #ifdef CONFIG_SYSFS
/* Add/Remove thermal_throttle interface for CPU device: */ /* Add/Remove thermal_throttle interface for CPU device: */
static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev) static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev,
unsigned int cpu)
{ {
int err; int err;
struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); struct cpuinfo_x86 *c = &cpu_data(cpu);
err = sysfs_create_group(&sys_dev->kobj, &thermal_attr_group); err = sysfs_create_group(&sys_dev->kobj, &thermal_attr_group);
if (err) if (err)
...@@ -251,7 +252,7 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb, ...@@ -251,7 +252,7 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb,
case CPU_UP_PREPARE: case CPU_UP_PREPARE:
case CPU_UP_PREPARE_FROZEN: case CPU_UP_PREPARE_FROZEN:
mutex_lock(&therm_cpu_lock); mutex_lock(&therm_cpu_lock);
err = thermal_throttle_add_dev(sys_dev); err = thermal_throttle_add_dev(sys_dev, cpu);
mutex_unlock(&therm_cpu_lock); mutex_unlock(&therm_cpu_lock);
WARN_ON(err); WARN_ON(err);
break; break;
...@@ -287,7 +288,7 @@ static __init int thermal_throttle_init_device(void) ...@@ -287,7 +288,7 @@ static __init int thermal_throttle_init_device(void)
#endif #endif
/* connect live CPUs to sysfs */ /* connect live CPUs to sysfs */
for_each_online_cpu(cpu) { for_each_online_cpu(cpu) {
err = thermal_throttle_add_dev(get_cpu_sysdev(cpu)); err = thermal_throttle_add_dev(get_cpu_sysdev(cpu), cpu);
WARN_ON(err); WARN_ON(err);
} }
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
......
...@@ -45,8 +45,7 @@ void __init setup_trampoline_page_table(void) ...@@ -45,8 +45,7 @@ void __init setup_trampoline_page_table(void)
/* Copy kernel address range */ /* Copy kernel address range */
clone_pgd_range(trampoline_pg_dir + KERNEL_PGD_BOUNDARY, clone_pgd_range(trampoline_pg_dir + KERNEL_PGD_BOUNDARY,
swapper_pg_dir + KERNEL_PGD_BOUNDARY, swapper_pg_dir + KERNEL_PGD_BOUNDARY,
min_t(unsigned long, KERNEL_PGD_PTRS, KERNEL_PGD_PTRS);
KERNEL_PGD_BOUNDARY));
/* Initialize low mappings */ /* Initialize low mappings */
clone_pgd_range(trampoline_pg_dir, clone_pgd_range(trampoline_pg_dir,
......
...@@ -74,7 +74,7 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) ...@@ -74,7 +74,7 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
/* /*
* Map 'pfn' using fixed map 'type' and protections 'prot' * Map 'pfn' using fixed map 'type' and protections 'prot'
*/ */
void * void __iomem *
iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
{ {
/* /*
...@@ -86,12 +86,12 @@ iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) ...@@ -86,12 +86,12 @@ iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC)) if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC))
prot = PAGE_KERNEL_UC_MINUS; prot = PAGE_KERNEL_UC_MINUS;
return kmap_atomic_prot_pfn(pfn, type, prot); return (void __force __iomem *) kmap_atomic_prot_pfn(pfn, type, prot);
} }
EXPORT_SYMBOL_GPL(iomap_atomic_prot_pfn); EXPORT_SYMBOL_GPL(iomap_atomic_prot_pfn);
void void
iounmap_atomic(void *kvaddr, enum km_type type) iounmap_atomic(void __iomem *kvaddr, enum km_type type)
{ {
unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
......
...@@ -79,7 +79,7 @@ io_mapping_free(struct io_mapping *mapping) ...@@ -79,7 +79,7 @@ io_mapping_free(struct io_mapping *mapping)
} }
/* Atomic map/unmap */ /* Atomic map/unmap */
static inline void * static inline void __iomem *
io_mapping_map_atomic_wc(struct io_mapping *mapping, io_mapping_map_atomic_wc(struct io_mapping *mapping,
unsigned long offset, unsigned long offset,
int slot) int slot)
...@@ -94,12 +94,12 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, ...@@ -94,12 +94,12 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping,
} }
static inline void static inline void
io_mapping_unmap_atomic(void *vaddr, int slot) io_mapping_unmap_atomic(void __iomem *vaddr, int slot)
{ {
iounmap_atomic(vaddr, slot); iounmap_atomic(vaddr, slot);
} }
static inline void * static inline void __iomem *
io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
{ {
resource_size_t phys_addr; resource_size_t phys_addr;
...@@ -111,7 +111,7 @@ io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) ...@@ -111,7 +111,7 @@ io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
} }
static inline void static inline void
io_mapping_unmap(void *vaddr) io_mapping_unmap(void __iomem *vaddr)
{ {
iounmap(vaddr); iounmap(vaddr);
} }
...@@ -125,38 +125,38 @@ struct io_mapping; ...@@ -125,38 +125,38 @@ struct io_mapping;
static inline struct io_mapping * static inline struct io_mapping *
io_mapping_create_wc(resource_size_t base, unsigned long size) io_mapping_create_wc(resource_size_t base, unsigned long size)
{ {
return (struct io_mapping *) ioremap_wc(base, size); return (struct io_mapping __force *) ioremap_wc(base, size);
} }
static inline void static inline void
io_mapping_free(struct io_mapping *mapping) io_mapping_free(struct io_mapping *mapping)
{ {
iounmap(mapping); iounmap((void __force __iomem *) mapping);
} }
/* Atomic map/unmap */ /* Atomic map/unmap */
static inline void * static inline void __iomem *
io_mapping_map_atomic_wc(struct io_mapping *mapping, io_mapping_map_atomic_wc(struct io_mapping *mapping,
unsigned long offset, unsigned long offset,
int slot) int slot)
{ {
return ((char *) mapping) + offset; return ((char __force __iomem *) mapping) + offset;
} }
static inline void static inline void
io_mapping_unmap_atomic(void *vaddr, int slot) io_mapping_unmap_atomic(void __iomem *vaddr, int slot)
{ {
} }
/* Non-atomic map/unmap */ /* Non-atomic map/unmap */
static inline void * static inline void __iomem *
io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
{ {
return ((char *) mapping) + offset; return ((char __force __iomem *) mapping) + offset;
} }
static inline void static inline void
io_mapping_unmap(void *vaddr) io_mapping_unmap(void __iomem *vaddr)
{ {
} }
......
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