diff options
Diffstat (limited to 'kernel/arch/metag')
-rw-r--r-- | kernel/arch/metag/Makefile | 2 | ||||
-rw-r--r-- | kernel/arch/metag/boot/dts/Makefile | 7 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/Kbuild | 3 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/atomic_lnkget.h | 40 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/atomic_lock1.h | 25 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/barrier.h | 6 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/cmpxchg.h | 2 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/dma-mapping.h | 14 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/elf.h | 2 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/ftrace.h | 2 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/highmem.h | 1 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/hugetlb.h | 13 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/io.h | 3 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/irq.h | 8 | ||||
-rw-r--r-- | kernel/arch/metag/kernel/irq.c | 14 | ||||
-rw-r--r-- | kernel/arch/metag/kernel/smp.c | 2 | ||||
-rw-r--r-- | kernel/arch/metag/mm/highmem.c | 14 | ||||
-rw-r--r-- | kernel/arch/metag/mm/hugetlbpage.c | 5 |
18 files changed, 47 insertions, 116 deletions
diff --git a/kernel/arch/metag/Makefile b/kernel/arch/metag/Makefile index 9739857bd..033a58214 100644 --- a/kernel/arch/metag/Makefile +++ b/kernel/arch/metag/Makefile @@ -72,7 +72,7 @@ $(boot_targets): vmlinux $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ dtbs: scripts - $(Q)$(MAKE) $(build)=$(boot)/dts dtbs + $(Q)$(MAKE) $(build)=$(boot)/dts archclean: $(Q)$(MAKE) $(clean)=$(boot) diff --git a/kernel/arch/metag/boot/dts/Makefile b/kernel/arch/metag/boot/dts/Makefile index 72c121879..097c6da45 100644 --- a/kernel/arch/metag/boot/dts/Makefile +++ b/kernel/arch/metag/boot/dts/Makefile @@ -12,11 +12,10 @@ endif dtb-$(CONFIG_METAG_BUILTIN_DTB) += $(builtindtb-y).dtb obj-$(CONFIG_METAG_BUILTIN_DTB) += $(builtindtb-y).dtb.o -targets += dtbs -targets += $(dtb-y) +dtstree := $(srctree)/$(src) +dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts)) .SECONDARY: $(obj)/$(builtindtb-y).dtb.S -dtbs: $(addprefix $(obj)/, $(dtb-y)) - +always += $(dtb-y) clean-files += *.dtb *.dtb.S diff --git a/kernel/arch/metag/include/asm/Kbuild b/kernel/arch/metag/include/asm/Kbuild index 0bf5d525b..29acb89da 100644 --- a/kernel/arch/metag/include/asm/Kbuild +++ b/kernel/arch/metag/include/asm/Kbuild @@ -25,6 +25,7 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h +generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h @@ -33,7 +34,6 @@ generic-y += percpu.h generic-y += poll.h generic-y += posix_types.h generic-y += preempt.h -generic-y += scatterlist.h generic-y += sections.h generic-y += sembuf.h generic-y += serial.h @@ -54,4 +54,5 @@ generic-y += ucontext.h generic-y += unaligned.h generic-y += user.h generic-y += vga.h +generic-y += word-at-a-time.h generic-y += xor.h diff --git a/kernel/arch/metag/include/asm/atomic_lnkget.h b/kernel/arch/metag/include/asm/atomic_lnkget.h index 948d86886..a62581815 100644 --- a/kernel/arch/metag/include/asm/atomic_lnkget.h +++ b/kernel/arch/metag/include/asm/atomic_lnkget.h @@ -3,7 +3,7 @@ #define ATOMIC_INIT(i) { (i) } -#define atomic_set(v, i) ((v)->counter = (i)) +#define atomic_set(v, i) WRITE_ONCE((v)->counter, (i)) #include <linux/compiler.h> @@ -74,44 +74,14 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \ ATOMIC_OPS(add) ATOMIC_OPS(sub) +ATOMIC_OP(and) +ATOMIC_OP(or) +ATOMIC_OP(xor) + #undef ATOMIC_OPS #undef ATOMIC_OP_RETURN #undef ATOMIC_OP -static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) -{ - int temp; - - asm volatile ( - "1: LNKGETD %0, [%1]\n" - " AND %0, %0, %2\n" - " LNKSETD [%1] %0\n" - " DEFR %0, TXSTAT\n" - " ANDT %0, %0, #HI(0x3f000000)\n" - " CMPT %0, #HI(0x02000000)\n" - " BNZ 1b\n" - : "=&d" (temp) - : "da" (&v->counter), "bd" (~mask) - : "cc"); -} - -static inline void atomic_set_mask(unsigned int mask, atomic_t *v) -{ - int temp; - - asm volatile ( - "1: LNKGETD %0, [%1]\n" - " OR %0, %0, %2\n" - " LNKSETD [%1], %0\n" - " DEFR %0, TXSTAT\n" - " ANDT %0, %0, #HI(0x3f000000)\n" - " CMPT %0, #HI(0x02000000)\n" - " BNZ 1b\n" - : "=&d" (temp) - : "da" (&v->counter), "bd" (mask) - : "cc"); -} - static inline int atomic_cmpxchg(atomic_t *v, int old, int new) { int result, temp; diff --git a/kernel/arch/metag/include/asm/atomic_lock1.h b/kernel/arch/metag/include/asm/atomic_lock1.h index f5d5898c1..0295d9b8d 100644 --- a/kernel/arch/metag/include/asm/atomic_lock1.h +++ b/kernel/arch/metag/include/asm/atomic_lock1.h @@ -10,7 +10,7 @@ static inline int atomic_read(const atomic_t *v) { - return (v)->counter; + return READ_ONCE((v)->counter); } /* @@ -68,31 +68,14 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \ ATOMIC_OPS(add, +=) ATOMIC_OPS(sub, -=) +ATOMIC_OP(and, &=) +ATOMIC_OP(or, |=) +ATOMIC_OP(xor, ^=) #undef ATOMIC_OPS #undef ATOMIC_OP_RETURN #undef ATOMIC_OP -static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) -{ - unsigned long flags; - - __global_lock1(flags); - fence(); - v->counter &= ~mask; - __global_unlock1(flags); -} - -static inline void atomic_set_mask(unsigned int mask, atomic_t *v) -{ - unsigned long flags; - - __global_lock1(flags); - fence(); - v->counter |= mask; - __global_unlock1(flags); -} - static inline int atomic_cmpxchg(atomic_t *v, int old, int new) { int ret; diff --git a/kernel/arch/metag/include/asm/barrier.h b/kernel/arch/metag/include/asm/barrier.h index d703d8e26..172b7e5ef 100644 --- a/kernel/arch/metag/include/asm/barrier.h +++ b/kernel/arch/metag/include/asm/barrier.h @@ -84,18 +84,18 @@ static inline void fence(void) #define read_barrier_depends() do { } while (0) #define smp_read_barrier_depends() do { } while (0) -#define set_mb(var, value) do { var = value; smp_mb(); } while (0) +#define smp_store_mb(var, value) do { WRITE_ONCE(var, value); smp_mb(); } while (0) #define smp_store_release(p, v) \ do { \ compiletime_assert_atomic_type(*p); \ smp_mb(); \ - ACCESS_ONCE(*p) = (v); \ + WRITE_ONCE(*p, v); \ } while (0) #define smp_load_acquire(p) \ ({ \ - typeof(*p) ___p1 = ACCESS_ONCE(*p); \ + typeof(*p) ___p1 = READ_ONCE(*p); \ compiletime_assert_atomic_type(*p); \ smp_mb(); \ ___p1; \ diff --git a/kernel/arch/metag/include/asm/cmpxchg.h b/kernel/arch/metag/include/asm/cmpxchg.h index b1bc1be85..be29e3e44 100644 --- a/kernel/arch/metag/include/asm/cmpxchg.h +++ b/kernel/arch/metag/include/asm/cmpxchg.h @@ -51,8 +51,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, return old; } -#define __HAVE_ARCH_CMPXCHG 1 - #define cmpxchg(ptr, o, n) \ ({ \ __typeof__(*(ptr)) _o_ = (o); \ diff --git a/kernel/arch/metag/include/asm/dma-mapping.h b/kernel/arch/metag/include/asm/dma-mapping.h index 14b23efd9..eb5cdec94 100644 --- a/kernel/arch/metag/include/asm/dma-mapping.h +++ b/kernel/arch/metag/include/asm/dma-mapping.h @@ -134,20 +134,24 @@ dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, } static inline void -dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, +dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, int nelems, enum dma_data_direction direction) { int i; - for (i = 0; i < nelems; i++, sg++) + struct scatterlist *sg; + + for_each_sg(sglist, sg, nelems, i) dma_sync_for_cpu(sg_virt(sg), sg->length, direction); } static inline void -dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, - enum dma_data_direction direction) +dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist, + int nelems, enum dma_data_direction direction) { int i; - for (i = 0; i < nelems; i++, sg++) + struct scatterlist *sg; + + for_each_sg(sglist, sg, nelems, i) dma_sync_for_device(sg_virt(sg), sg->length, direction); } diff --git a/kernel/arch/metag/include/asm/elf.h b/kernel/arch/metag/include/asm/elf.h index d2baf6961..87b0cf1e0 100644 --- a/kernel/arch/metag/include/asm/elf.h +++ b/kernel/arch/metag/include/asm/elf.h @@ -11,7 +11,7 @@ #define R_METAG_RELBRANCH 4 #define R_METAG_GETSETOFF 5 -/* Backward compatability */ +/* Backward compatibility */ #define R_METAG_REG32OP1 6 #define R_METAG_REG32OP2 7 #define R_METAG_REG32OP3 8 diff --git a/kernel/arch/metag/include/asm/ftrace.h b/kernel/arch/metag/include/asm/ftrace.h index 2901f0f7d..a2269d60a 100644 --- a/kernel/arch/metag/include/asm/ftrace.h +++ b/kernel/arch/metag/include/asm/ftrace.h @@ -6,7 +6,7 @@ #ifndef __ASSEMBLY__ extern void mcount_wrapper(void); -#define MCOUNT_ADDR ((long)(mcount_wrapper)) +#define MCOUNT_ADDR ((unsigned long)(mcount_wrapper)) static inline unsigned long ftrace_call_adjust(unsigned long addr) { diff --git a/kernel/arch/metag/include/asm/highmem.h b/kernel/arch/metag/include/asm/highmem.h index 6646a15c7..9b1d172cd 100644 --- a/kernel/arch/metag/include/asm/highmem.h +++ b/kernel/arch/metag/include/asm/highmem.h @@ -56,7 +56,6 @@ extern void kunmap(struct page *page); extern void *kmap_atomic(struct page *page); extern void __kunmap_atomic(void *kvaddr); extern void *kmap_atomic_pfn(unsigned long pfn); -extern struct page *kmap_atomic_to_page(void *ptr); #endif #endif diff --git a/kernel/arch/metag/include/asm/hugetlb.h b/kernel/arch/metag/include/asm/hugetlb.h index 471f481e6..905ed422d 100644 --- a/kernel/arch/metag/include/asm/hugetlb.h +++ b/kernel/arch/metag/include/asm/hugetlb.h @@ -14,10 +14,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, int prepare_hugepage_range(struct file *file, unsigned long addr, unsigned long len); -static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) -{ -} - static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, @@ -71,15 +67,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep) return *ptep; } -static inline int arch_prepare_hugepage(struct page *page) -{ - return 0; -} - -static inline void arch_release_hugepage(struct page *page) -{ -} - static inline void arch_clear_hugepage_flags(struct page *page) { } diff --git a/kernel/arch/metag/include/asm/io.h b/kernel/arch/metag/include/asm/io.h index d5779b0ec..9890f21ea 100644 --- a/kernel/arch/metag/include/asm/io.h +++ b/kernel/arch/metag/include/asm/io.h @@ -160,6 +160,9 @@ extern void __iounmap(void __iomem *addr); #define ioremap_wc(offset, size) \ __ioremap((offset), (size), _PAGE_WR_COMBINE) +#define ioremap_wt(offset, size) \ + __ioremap((offset), (size), 0) + #define iounmap(addr) \ __iounmap(addr) diff --git a/kernel/arch/metag/include/asm/irq.h b/kernel/arch/metag/include/asm/irq.h index ad6bd0edb..6ac6d4a05 100644 --- a/kernel/arch/metag/include/asm/irq.h +++ b/kernel/arch/metag/include/asm/irq.h @@ -6,8 +6,12 @@ extern void irq_ctx_init(int cpu); extern void irq_ctx_exit(int cpu); # define __ARCH_HAS_DO_SOFTIRQ #else -# define irq_ctx_init(cpu) do { } while (0) -# define irq_ctx_exit(cpu) do { } while (0) +static inline void irq_ctx_init(int cpu) +{ +} +static inline void irq_ctx_exit(int cpu) +{ +} #endif void tbi_startup_interrupt(int); diff --git a/kernel/arch/metag/kernel/irq.c b/kernel/arch/metag/kernel/irq.c index 4f8f1f87e..3074b6479 100644 --- a/kernel/arch/metag/kernel/irq.c +++ b/kernel/arch/metag/kernel/irq.c @@ -94,13 +94,11 @@ void do_IRQ(int irq, struct pt_regs *regs) "MOV D0.5,%0\n" "MOV D1Ar1,%1\n" "MOV D1RtP,%2\n" - "MOV D0Ar2,%3\n" "SWAP A0StP,D0.5\n" "SWAP PC,D1RtP\n" "MOV A0StP,D0.5\n" : - : "r" (isp), "r" (irq), "r" (desc->handle_irq), - "r" (desc) + : "r" (isp), "r" (desc), "r" (desc->handle_irq) : "memory", "cc", "D1Ar1", "D0Ar2", "D1Ar3", "D0Ar4", "D1Ar5", "D0Ar6", "D0Re0", "D1Re0", "D0.4", "D1RtP", "D0.5" @@ -270,23 +268,25 @@ void migrate_irqs(void) for_each_active_irq(i) { struct irq_data *data = irq_get_irq_data(i); + struct cpumask *mask; unsigned int newcpu; if (irqd_is_per_cpu(data)) continue; - if (!cpumask_test_cpu(cpu, data->affinity)) + mask = irq_data_get_affinity_mask(data); + if (!cpumask_test_cpu(cpu, mask)) continue; - newcpu = cpumask_any_and(data->affinity, cpu_online_mask); + newcpu = cpumask_any_and(mask, cpu_online_mask); if (newcpu >= nr_cpu_ids) { pr_info_ratelimited("IRQ%u no longer affine to CPU%u\n", i, cpu); - cpumask_setall(data->affinity); + cpumask_setall(mask); } - irq_set_affinity(i, data->affinity); + irq_set_affinity(i, mask); } } #endif /* CONFIG_HOTPLUG_CPU */ diff --git a/kernel/arch/metag/kernel/smp.c b/kernel/arch/metag/kernel/smp.c index ac3a199e3..c3c6f0864 100644 --- a/kernel/arch/metag/kernel/smp.c +++ b/kernel/arch/metag/kernel/smp.c @@ -312,6 +312,7 @@ void cpu_die(void) { local_irq_disable(); idle_task_exit(); + irq_ctx_exit(smp_processor_id()); (void)cpu_report_death(); @@ -366,6 +367,7 @@ asmlinkage void secondary_start_kernel(void) panic("No TBI found!"); per_cpu_trap_init(cpu); + irq_ctx_init(cpu); preempt_disable(); diff --git a/kernel/arch/metag/mm/highmem.c b/kernel/arch/metag/mm/highmem.c index 807f1b1c4..f19a87f2c 100644 --- a/kernel/arch/metag/mm/highmem.c +++ b/kernel/arch/metag/mm/highmem.c @@ -111,20 +111,6 @@ void *kmap_atomic_pfn(unsigned long pfn) return (void *)vaddr; } -struct page *kmap_atomic_to_page(void *ptr) -{ - unsigned long vaddr = (unsigned long)ptr; - int idx; - pte_t *pte; - - if (vaddr < FIXADDR_START) - return virt_to_page(ptr); - - idx = virt_to_fix(vaddr); - pte = kmap_pte - (idx - FIX_KMAP_BEGIN); - return pte_page(*pte); -} - void __init kmap_init(void) { unsigned long kmap_vstart; diff --git a/kernel/arch/metag/mm/hugetlbpage.c b/kernel/arch/metag/mm/hugetlbpage.c index 7ca80ac42..53f0f6c47 100644 --- a/kernel/arch/metag/mm/hugetlbpage.c +++ b/kernel/arch/metag/mm/hugetlbpage.c @@ -89,11 +89,6 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) return pte; } -int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep) -{ - return 0; -} - int pmd_huge(pmd_t pmd) { return pmd_page_shift(pmd) > PAGE_SHIFT; |