summaryrefslogtreecommitdiffstats
path: root/kernel/arch/sh
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/sh')
-rw-r--r--kernel/arch/sh/Kconfig1
-rw-r--r--kernel/arch/sh/boards/mach-highlander/psw.c2
-rw-r--r--kernel/arch/sh/boards/mach-landisk/psw.c2
-rw-r--r--kernel/arch/sh/boards/mach-rsk/setup.c3
-rw-r--r--kernel/arch/sh/boards/mach-se/7343/irq.c4
-rw-r--r--kernel/arch/sh/boards/mach-se/7722/irq.c4
-rw-r--r--kernel/arch/sh/boards/mach-se/7724/irq.c3
-rw-r--r--kernel/arch/sh/boards/mach-x3proto/gpio.c4
-rw-r--r--kernel/arch/sh/cchips/hd6446x/hd64461.c2
-rw-r--r--kernel/arch/sh/drivers/pci/ops-sh5.c1
-rw-r--r--kernel/arch/sh/drivers/pci/pci-sh4.h8
-rw-r--r--kernel/arch/sh/drivers/pci/pci-sh5.c1
-rw-r--r--kernel/arch/sh/include/asm/Kbuild2
-rw-r--r--kernel/arch/sh/include/asm/atomic-grb.h43
-rw-r--r--kernel/arch/sh/include/asm/atomic-irq.h21
-rw-r--r--kernel/arch/sh/include/asm/atomic-llsc.h31
-rw-r--r--kernel/arch/sh/include/asm/atomic.h4
-rw-r--r--kernel/arch/sh/include/asm/barrier.h2
-rw-r--r--kernel/arch/sh/include/asm/cmpxchg.h2
-rw-r--r--kernel/arch/sh/include/asm/dma-mapping.h77
-rw-r--r--kernel/arch/sh/include/asm/ftrace.h2
-rw-r--r--kernel/arch/sh/include/asm/hugetlb.h12
-rw-r--r--kernel/arch/sh/include/asm/io.h2
-rw-r--r--kernel/arch/sh/include/asm/page.h1
-rw-r--r--kernel/arch/sh/include/asm/pci.h18
-rw-r--r--kernel/arch/sh/include/asm/switch_to_32.h8
-rw-r--r--kernel/arch/sh/include/uapi/asm/unistd_64.h2
-rw-r--r--kernel/arch/sh/kernel/cpu/sh4/sq.c3
-rw-r--r--kernel/arch/sh/kernel/cpu/sh4a/clock-sh7724.c2
-rw-r--r--kernel/arch/sh/kernel/cpu/sh4a/clock-sh7734.c3
-rw-r--r--kernel/arch/sh/kernel/cpu/sh4a/clock-sh7757.c4
-rw-r--r--kernel/arch/sh/kernel/cpu/sh4a/clock-sh7785.c4
-rw-r--r--kernel/arch/sh/kernel/cpu/sh4a/clock-sh7786.c4
-rw-r--r--kernel/arch/sh/kernel/cpu/sh4a/clock-shx3.c4
-rw-r--r--kernel/arch/sh/kernel/cpu/sh5/unwind.c2
-rw-r--r--kernel/arch/sh/kernel/irq.c9
-rw-r--r--kernel/arch/sh/kernel/localtimer.c6
-rw-r--r--kernel/arch/sh/kernel/perf_event.c2
-rw-r--r--kernel/arch/sh/kernel/traps_64.c2
-rw-r--r--kernel/arch/sh/mm/hugetlbpage.c5
-rw-r--r--kernel/arch/sh/mm/init.c9
-rw-r--r--kernel/arch/sh/mm/numa.c4
42 files changed, 61 insertions, 264 deletions
diff --git a/kernel/arch/sh/Kconfig b/kernel/arch/sh/Kconfig
index 50057fed8..d514df7e0 100644
--- a/kernel/arch/sh/Kconfig
+++ b/kernel/arch/sh/Kconfig
@@ -602,6 +602,7 @@ source kernel/Kconfig.hz
config KEXEC
bool "kexec system call (EXPERIMENTAL)"
depends on SUPERH32 && MMU
+ select KEXEC_CORE
help
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
diff --git a/kernel/arch/sh/boards/mach-highlander/psw.c b/kernel/arch/sh/boards/mach-highlander/psw.c
index 522786318..40e2b585d 100644
--- a/kernel/arch/sh/boards/mach-highlander/psw.c
+++ b/kernel/arch/sh/boards/mach-highlander/psw.c
@@ -10,7 +10,7 @@
* for more details.
*/
#include <linux/io.h>
-#include <linux/init.h>
+#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <mach/highlander.h>
diff --git a/kernel/arch/sh/boards/mach-landisk/psw.c b/kernel/arch/sh/boards/mach-landisk/psw.c
index bef83522f..5192b1f43 100644
--- a/kernel/arch/sh/boards/mach-landisk/psw.c
+++ b/kernel/arch/sh/boards/mach-landisk/psw.c
@@ -140,4 +140,4 @@ static int __init psw_init(void)
{
return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
}
-module_init(psw_init);
+device_initcall(psw_init);
diff --git a/kernel/arch/sh/boards/mach-rsk/setup.c b/kernel/arch/sh/boards/mach-rsk/setup.c
index 2685ea03b..6bc134bd7 100644
--- a/kernel/arch/sh/boards/mach-rsk/setup.c
+++ b/kernel/arch/sh/boards/mach-rsk/setup.c
@@ -27,8 +27,6 @@ static struct regulator_consumer_supply dummy_supplies[] = {
REGULATOR_SUPPLY("vdd33a", "smsc911x"),
};
-static const char *part_probes[] = { "cmdlinepart", NULL };
-
static struct mtd_partition rsk_partitions[] = {
{
.name = "Bootloader",
@@ -50,7 +48,6 @@ static struct physmap_flash_data flash_data = {
.parts = rsk_partitions,
.nr_parts = ARRAY_SIZE(rsk_partitions),
.width = 2,
- .part_probe_types = part_probes,
};
static struct resource flash_resource = {
diff --git a/kernel/arch/sh/boards/mach-se/7343/irq.c b/kernel/arch/sh/boards/mach-se/7343/irq.c
index 1087dba9b..6129aef6d 100644
--- a/kernel/arch/sh/boards/mach-se/7343/irq.c
+++ b/kernel/arch/sh/boards/mach-se/7343/irq.c
@@ -29,9 +29,9 @@
static void __iomem *se7343_irq_regs;
struct irq_domain *se7343_irq_domain;
-static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void se7343_irq_demux(struct irq_desc *desc)
{
- struct irq_data *data = irq_get_irq_data(irq);
+ struct irq_data *data = irq_desc_get_irq_data(desc);
struct irq_chip *chip = irq_data_get_irq_chip(data);
unsigned long mask;
int bit;
diff --git a/kernel/arch/sh/boards/mach-se/7722/irq.c b/kernel/arch/sh/boards/mach-se/7722/irq.c
index 00e699232..24c74a882 100644
--- a/kernel/arch/sh/boards/mach-se/7722/irq.c
+++ b/kernel/arch/sh/boards/mach-se/7722/irq.c
@@ -28,9 +28,9 @@
static void __iomem *se7722_irq_regs;
struct irq_domain *se7722_irq_domain;
-static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void se7722_irq_demux(struct irq_desc *desc)
{
- struct irq_data *data = irq_get_irq_data(irq);
+ struct irq_data *data = irq_desc_get_irq_data(desc);
struct irq_chip *chip = irq_data_get_irq_chip(data);
unsigned long mask;
int bit;
diff --git a/kernel/arch/sh/boards/mach-se/7724/irq.c b/kernel/arch/sh/boards/mach-se/7724/irq.c
index 5d1d3ec9a..64e681e66 100644
--- a/kernel/arch/sh/boards/mach-se/7724/irq.c
+++ b/kernel/arch/sh/boards/mach-se/7724/irq.c
@@ -92,8 +92,9 @@ static struct irq_chip se7724_irq_chip __read_mostly = {
.irq_unmask = enable_se7724_irq,
};
-static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void se7724_irq_demux(struct irq_desc *desc)
{
+ unsigned int irq = irq_desc_get_irq(desc);
struct fpga_irq set = get_fpga_irq(irq);
unsigned short intv = __raw_readw(set.sraddr);
unsigned int ext_irq = set.base;
diff --git a/kernel/arch/sh/boards/mach-x3proto/gpio.c b/kernel/arch/sh/boards/mach-x3proto/gpio.c
index f035a7ac6..1fb2cbee2 100644
--- a/kernel/arch/sh/boards/mach-x3proto/gpio.c
+++ b/kernel/arch/sh/boards/mach-x3proto/gpio.c
@@ -60,9 +60,9 @@ static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
return virq;
}
-static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void x3proto_gpio_irq_handler(struct irq_desc *desc)
{
- struct irq_data *data = irq_get_irq_data(irq);
+ struct irq_data *data = irq_desc_get_irq_data(desc);
struct irq_chip *chip = irq_data_get_irq_chip(data);
unsigned long mask;
int pin;
diff --git a/kernel/arch/sh/cchips/hd6446x/hd64461.c b/kernel/arch/sh/cchips/hd6446x/hd64461.c
index e9735616b..818009250 100644
--- a/kernel/arch/sh/cchips/hd6446x/hd64461.c
+++ b/kernel/arch/sh/cchips/hd6446x/hd64461.c
@@ -56,7 +56,7 @@ static struct irq_chip hd64461_irq_chip = {
.irq_unmask = hd64461_unmask_irq,
};
-static void hd64461_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void hd64461_irq_demux(struct irq_desc *desc)
{
unsigned short intv = __raw_readw(HD64461_NIRR);
unsigned int ext_irq = HD64461_IRQBASE;
diff --git a/kernel/arch/sh/drivers/pci/ops-sh5.c b/kernel/arch/sh/drivers/pci/ops-sh5.c
index 4ce95a001..453619464 100644
--- a/kernel/arch/sh/drivers/pci/ops-sh5.c
+++ b/kernel/arch/sh/drivers/pci/ops-sh5.c
@@ -18,7 +18,6 @@
#include <linux/delay.h>
#include <linux/types.h>
#include <linux/irq.h>
-#include <asm/pci.h>
#include <asm/io.h>
#include "pci-sh5.h"
diff --git a/kernel/arch/sh/drivers/pci/pci-sh4.h b/kernel/arch/sh/drivers/pci/pci-sh4.h
index cbf763b30..0288efc17 100644
--- a/kernel/arch/sh/drivers/pci/pci-sh4.h
+++ b/kernel/arch/sh/drivers/pci/pci-sh4.h
@@ -11,14 +11,6 @@
#include <asm/io.h>
-/* startup values */
-#define PCI_PROBE_BIOS 1
-#define PCI_PROBE_CONF1 2
-#define PCI_PROBE_CONF2 4
-#define PCI_NO_CHECKS 0x400
-#define PCI_ASSIGN_ROMS 0x1000
-#define PCI_BIOS_IRQ_SCAN 0x2000
-
#define SH4_PCICR 0x100 /* PCI Control Register */
#define SH4_PCICR_PREFIX 0xA5000000 /* CR prefix for write */
#define SH4_PCICR_FTO 0x00000400 /* TRDY/IRDY Enable */
diff --git a/kernel/arch/sh/drivers/pci/pci-sh5.c b/kernel/arch/sh/drivers/pci/pci-sh5.c
index 16c1e721b..8229114c6 100644
--- a/kernel/arch/sh/drivers/pci/pci-sh5.c
+++ b/kernel/arch/sh/drivers/pci/pci-sh5.c
@@ -20,7 +20,6 @@
#include <linux/types.h>
#include <linux/irq.h>
#include <cpu/irq.h>
-#include <asm/pci.h>
#include <asm/io.h>
#include "pci-sh5.h"
diff --git a/kernel/arch/sh/include/asm/Kbuild b/kernel/arch/sh/include/asm/Kbuild
index 654ebb6bd..aac452b26 100644
--- a/kernel/arch/sh/include/asm/Kbuild
+++ b/kernel/arch/sh/include/asm/Kbuild
@@ -16,6 +16,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 += mman.h
generic-y += msgbuf.h
generic-y += param.h
@@ -24,7 +25,6 @@ generic-y += percpu.h
generic-y += poll.h
generic-y += preempt.h
generic-y += resource.h
-generic-y += scatterlist.h
generic-y += sembuf.h
generic-y += serial.h
generic-y += shmbuf.h
diff --git a/kernel/arch/sh/include/asm/atomic-grb.h b/kernel/arch/sh/include/asm/atomic-grb.h
index 97a5fda83..b94df40e5 100644
--- a/kernel/arch/sh/include/asm/atomic-grb.h
+++ b/kernel/arch/sh/include/asm/atomic-grb.h
@@ -48,47 +48,12 @@ 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 tmp;
- unsigned int _mask = ~mask;
-
- __asm__ __volatile__ (
- " .align 2 \n\t"
- " mova 1f, r0 \n\t" /* r0 = end point */
- " mov r15, r1 \n\t" /* r1 = saved sp */
- " mov #-6, r15 \n\t" /* LOGIN: r15 = size */
- " mov.l @%1, %0 \n\t" /* load old value */
- " and %2, %0 \n\t" /* add */
- " mov.l %0, @%1 \n\t" /* store new value */
- "1: mov r1, r15 \n\t" /* LOGOUT */
- : "=&r" (tmp),
- "+r" (v)
- : "r" (_mask)
- : "memory" , "r0", "r1");
-}
-
-static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
-{
- int tmp;
-
- __asm__ __volatile__ (
- " .align 2 \n\t"
- " mova 1f, r0 \n\t" /* r0 = end point */
- " mov r15, r1 \n\t" /* r1 = saved sp */
- " mov #-6, r15 \n\t" /* LOGIN: r15 = size */
- " mov.l @%1, %0 \n\t" /* load old value */
- " or %2, %0 \n\t" /* or */
- " mov.l %0, @%1 \n\t" /* store new value */
- "1: mov r1, r15 \n\t" /* LOGOUT */
- : "=&r" (tmp),
- "+r" (v)
- : "r" (mask)
- : "memory" , "r0", "r1");
-}
-
#endif /* __ASM_SH_ATOMIC_GRB_H */
diff --git a/kernel/arch/sh/include/asm/atomic-irq.h b/kernel/arch/sh/include/asm/atomic-irq.h
index 61d107523..23fcdad57 100644
--- a/kernel/arch/sh/include/asm/atomic-irq.h
+++ b/kernel/arch/sh/include/asm/atomic-irq.h
@@ -37,27 +37,12 @@ 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;
-
- raw_local_irq_save(flags);
- v->counter &= ~mask;
- raw_local_irq_restore(flags);
-}
-
-static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
-{
- unsigned long flags;
-
- raw_local_irq_save(flags);
- v->counter |= mask;
- raw_local_irq_restore(flags);
-}
-
#endif /* __ASM_SH_ATOMIC_IRQ_H */
diff --git a/kernel/arch/sh/include/asm/atomic-llsc.h b/kernel/arch/sh/include/asm/atomic-llsc.h
index 8575dccb9..33d34b16d 100644
--- a/kernel/arch/sh/include/asm/atomic-llsc.h
+++ b/kernel/arch/sh/include/asm/atomic-llsc.h
@@ -52,37 +52,12 @@ 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 tmp;
-
- __asm__ __volatile__ (
-"1: movli.l @%2, %0 ! atomic_clear_mask \n"
-" and %1, %0 \n"
-" movco.l %0, @%2 \n"
-" bf 1b \n"
- : "=&z" (tmp)
- : "r" (~mask), "r" (&v->counter)
- : "t");
-}
-
-static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
-{
- unsigned long tmp;
-
- __asm__ __volatile__ (
-"1: movli.l @%2, %0 ! atomic_set_mask \n"
-" or %1, %0 \n"
-" movco.l %0, @%2 \n"
-" bf 1b \n"
- : "=&z" (tmp)
- : "r" (mask), "r" (&v->counter)
- : "t");
-}
-
#endif /* __ASM_SH_ATOMIC_LLSC_H */
diff --git a/kernel/arch/sh/include/asm/atomic.h b/kernel/arch/sh/include/asm/atomic.h
index 05b9f74ce..c399e1c55 100644
--- a/kernel/arch/sh/include/asm/atomic.h
+++ b/kernel/arch/sh/include/asm/atomic.h
@@ -14,8 +14,8 @@
#define ATOMIC_INIT(i) { (i) }
-#define atomic_read(v) ACCESS_ONCE((v)->counter)
-#define atomic_set(v,i) ((v)->counter = (i))
+#define atomic_read(v) READ_ONCE((v)->counter)
+#define atomic_set(v,i) WRITE_ONCE((v)->counter, (i))
#if defined(CONFIG_GUSA_RB)
#include <asm/atomic-grb.h>
diff --git a/kernel/arch/sh/include/asm/barrier.h b/kernel/arch/sh/include/asm/barrier.h
index 43715308b..bf91037db 100644
--- a/kernel/arch/sh/include/asm/barrier.h
+++ b/kernel/arch/sh/include/asm/barrier.h
@@ -32,7 +32,7 @@
#define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
#endif
-#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
+#define smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0)
#include <asm-generic/barrier.h>
diff --git a/kernel/arch/sh/include/asm/cmpxchg.h b/kernel/arch/sh/include/asm/cmpxchg.h
index f6bd1406b..85c97b188 100644
--- a/kernel/arch/sh/include/asm/cmpxchg.h
+++ b/kernel/arch/sh/include/asm/cmpxchg.h
@@ -46,8 +46,6 @@ extern void __xchg_called_with_bad_pointer(void);
* if something tries to do an invalid cmpxchg(). */
extern void __cmpxchg_called_with_bad_pointer(void);
-#define __HAVE_ARCH_CMPXCHG 1
-
static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
unsigned long new, int size)
{
diff --git a/kernel/arch/sh/include/asm/dma-mapping.h b/kernel/arch/sh/include/asm/dma-mapping.h
index b437f2c78..a3745a3fe 100644
--- a/kernel/arch/sh/include/asm/dma-mapping.h
+++ b/kernel/arch/sh/include/asm/dma-mapping.h
@@ -9,86 +9,13 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)
return dma_ops;
}
-#include <asm-generic/dma-coherent.h>
-#include <asm-generic/dma-mapping-common.h>
-
-static inline int dma_supported(struct device *dev, u64 mask)
-{
- struct dma_map_ops *ops = get_dma_ops(dev);
-
- if (ops->dma_supported)
- return ops->dma_supported(dev, mask);
-
- return 1;
-}
-
-static inline int dma_set_mask(struct device *dev, u64 mask)
-{
- struct dma_map_ops *ops = get_dma_ops(dev);
+#define DMA_ERROR_CODE 0
- if (!dev->dma_mask || !dma_supported(dev, mask))
- return -EIO;
- if (ops->set_dma_mask)
- return ops->set_dma_mask(dev, mask);
-
- *dev->dma_mask = mask;
-
- return 0;
-}
+#include <asm-generic/dma-mapping-common.h>
void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
enum dma_data_direction dir);
-#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
-#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
-
-static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
-{
- struct dma_map_ops *ops = get_dma_ops(dev);
-
- debug_dma_mapping_error(dev, dma_addr);
- if (ops->mapping_error)
- return ops->mapping_error(dev, dma_addr);
-
- return dma_addr == 0;
-}
-
-#define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL)
-
-static inline void *dma_alloc_attrs(struct device *dev, size_t size,
- dma_addr_t *dma_handle, gfp_t gfp,
- struct dma_attrs *attrs)
-{
- struct dma_map_ops *ops = get_dma_ops(dev);
- void *memory;
-
- if (dma_alloc_from_coherent(dev, size, dma_handle, &memory))
- return memory;
- if (!ops->alloc)
- return NULL;
-
- memory = ops->alloc(dev, size, dma_handle, gfp, attrs);
- debug_dma_alloc_coherent(dev, size, *dma_handle, memory);
-
- return memory;
-}
-
-#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL)
-
-static inline void dma_free_attrs(struct device *dev, size_t size,
- void *vaddr, dma_addr_t dma_handle,
- struct dma_attrs *attrs)
-{
- struct dma_map_ops *ops = get_dma_ops(dev);
-
- if (dma_release_from_coherent(dev, get_order(size), vaddr))
- return;
-
- debug_dma_free_coherent(dev, size, vaddr, dma_handle);
- if (ops->free)
- ops->free(dev, size, vaddr, dma_handle, attrs);
-}
-
/* arch/sh/mm/consistent.c */
extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_addr, gfp_t flag,
diff --git a/kernel/arch/sh/include/asm/ftrace.h b/kernel/arch/sh/include/asm/ftrace.h
index e79fb6eba..1f157b86e 100644
--- a/kernel/arch/sh/include/asm/ftrace.h
+++ b/kernel/arch/sh/include/asm/ftrace.h
@@ -9,7 +9,7 @@
#ifndef __ASSEMBLY__
extern void mcount(void);
-#define MCOUNT_ADDR ((long)(mcount))
+#define MCOUNT_ADDR ((unsigned long)(mcount))
#ifdef CONFIG_DYNAMIC_FTRACE
#define CALL_ADDR ((long)(ftrace_call))
diff --git a/kernel/arch/sh/include/asm/hugetlb.h b/kernel/arch/sh/include/asm/hugetlb.h
index 699255d6d..ef489a56f 100644
--- a/kernel/arch/sh/include/asm/hugetlb.h
+++ b/kernel/arch/sh/include/asm/hugetlb.h
@@ -26,9 +26,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}
-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,
@@ -82,15 +79,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)
{
clear_bit(PG_dcache_clean, &page->flags);
diff --git a/kernel/arch/sh/include/asm/io.h b/kernel/arch/sh/include/asm/io.h
index 728c4c571..3280a6bfa 100644
--- a/kernel/arch/sh/include/asm/io.h
+++ b/kernel/arch/sh/include/asm/io.h
@@ -342,6 +342,7 @@ ioremap_cache(phys_addr_t offset, unsigned long size)
{
return __ioremap_mode(offset, size, PAGE_KERNEL);
}
+#define ioremap_cache ioremap_cache
#ifdef CONFIG_HAVE_IOREMAP_PROT
static inline void __iomem *
@@ -368,6 +369,7 @@ static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; }
#endif
#define ioremap_nocache ioremap
+#define ioremap_uc ioremap
#define iounmap __iounmap
/*
diff --git a/kernel/arch/sh/include/asm/page.h b/kernel/arch/sh/include/asm/page.h
index fe20d14ae..ceb5201a3 100644
--- a/kernel/arch/sh/include/asm/page.h
+++ b/kernel/arch/sh/include/asm/page.h
@@ -59,6 +59,7 @@ pages_do_alias(unsigned long addr1, unsigned long addr2)
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
extern void copy_page(void *to, void *from);
+#define copy_user_page(to, from, vaddr, pg) __copy_user(to, from, PAGE_SIZE)
struct page;
struct vm_area_struct;
diff --git a/kernel/arch/sh/include/asm/pci.h b/kernel/arch/sh/include/asm/pci.h
index 5b4511552..e343dbd02 100644
--- a/kernel/arch/sh/include/asm/pci.h
+++ b/kernel/arch/sh/include/asm/pci.h
@@ -86,24 +86,6 @@ extern void pcibios_set_master(struct pci_dev *dev);
* direct memory write.
*/
#define PCI_DISABLE_MWI
-
-static inline void pci_dma_burst_advice(struct pci_dev *pdev,
- enum pci_dma_burst_strategy *strat,
- unsigned long *strategy_parameter)
-{
- unsigned long cacheline_size;
- u8 byte;
-
- pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
-
- if (byte == 0)
- cacheline_size = L1_CACHE_BYTES;
- else
- cacheline_size = byte << 2;
-
- *strat = PCI_DMA_BURST_MULTIPLE;
- *strategy_parameter = cacheline_size;
-}
#endif
/* Board-specific fixup routines. */
diff --git a/kernel/arch/sh/include/asm/switch_to_32.h b/kernel/arch/sh/include/asm/switch_to_32.h
index 0c065513e..7661b4ba8 100644
--- a/kernel/arch/sh/include/asm/switch_to_32.h
+++ b/kernel/arch/sh/include/asm/switch_to_32.h
@@ -78,6 +78,8 @@ do { \
\
if (is_dsp_enabled(prev)) \
__save_dsp(prev); \
+ if (is_dsp_enabled(next)) \
+ __restore_dsp(next); \
\
__ts1 = (u32 *)&prev->thread.sp; \
__ts2 = (u32 *)&prev->thread.pc; \
@@ -125,10 +127,4 @@ do { \
last = __last; \
} while (0)
-#define finish_arch_switch(prev) \
-do { \
- if (is_dsp_enabled(prev)) \
- __restore_dsp(prev); \
-} while (0)
-
#endif /* __ASM_SH_SWITCH_TO_32_H */
diff --git a/kernel/arch/sh/include/uapi/asm/unistd_64.h b/kernel/arch/sh/include/uapi/asm/unistd_64.h
index e6820c86e..47ebd5b5e 100644
--- a/kernel/arch/sh/include/uapi/asm/unistd_64.h
+++ b/kernel/arch/sh/include/uapi/asm/unistd_64.h
@@ -278,7 +278,7 @@
#define __NR_fsetxattr 256
#define __NR_getxattr 257
#define __NR_lgetxattr 258
-#define __NR_fgetxattr 269
+#define __NR_fgetxattr 259
#define __NR_listxattr 260
#define __NR_llistxattr 261
#define __NR_flistxattr 262
diff --git a/kernel/arch/sh/kernel/cpu/sh4/sq.c b/kernel/arch/sh/kernel/cpu/sh4/sq.c
index 0a47bd3e7..4ca78ed71 100644
--- a/kernel/arch/sh/kernel/cpu/sh4/sq.c
+++ b/kernel/arch/sh/kernel/cpu/sh4/sq.c
@@ -355,13 +355,12 @@ static int sq_dev_add(struct device *dev, struct subsys_interface *sif)
return error;
}
-static int sq_dev_remove(struct device *dev, struct subsys_interface *sif)
+static void sq_dev_remove(struct device *dev, struct subsys_interface *sif)
{
unsigned int cpu = dev->id;
struct kobject *kobj = sq_kobject[cpu];
kobject_put(kobj);
- return 0;
}
static struct subsys_interface sq_interface = {
diff --git a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index c187b9579..f27c618de 100644
--- a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -343,7 +343,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]),
CLKDEV_DEV_ID("sh_fsi.0", &mstp_clks[HWBLK_SPU]),
CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
- CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]),
+ CLKDEV_DEV_ID("sh-vou", &mstp_clks[HWBLK_VOU]),
CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]),
CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[HWBLK_CEU0]),
CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU0]),
diff --git a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7734.c b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
index 1fdf1ee67..7f54bf2f4 100644
--- a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
+++ b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
@@ -246,8 +246,7 @@ int __init arch_clk_init(void)
for (i = 0; i < ARRAY_SIZE(main_clks); i++)
ret |= clk_register(main_clks[i]);
- for (i = 0; i < ARRAY_SIZE(lookups); i++)
- clkdev_add(&lookups[i]);
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
index 9a28fdb36..e40ec2c97 100644
--- a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+++ b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
@@ -141,8 +141,8 @@ int __init arch_clk_init(void)
for (i = 0; i < ARRAY_SIZE(clks); i++)
ret |= clk_register(clks[i]);
- for (i = 0; i < ARRAY_SIZE(lookups); i++)
- clkdev_add(&lookups[i]);
+
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
index 17d0ea55a..8eb6e6234 100644
--- a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
@@ -164,8 +164,8 @@ int __init arch_clk_init(void)
for (i = 0; i < ARRAY_SIZE(clks); i++)
ret |= clk_register(clks[i]);
- for (i = 0; i < ARRAY_SIZE(lookups); i++)
- clkdev_add(&lookups[i]);
+
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
index bec2a83f1..5e50e7ebe 100644
--- a/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+++ b/kernel/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -179,8 +179,8 @@ int __init arch_clk_init(void)
for (i = 0; i < ARRAY_SIZE(clks); i++)
ret |= clk_register(clks[i]);
- for (i = 0; i < ARRAY_SIZE(lookups); i++)
- clkdev_add(&lookups[i]);
+
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/kernel/arch/sh/kernel/cpu/sh4a/clock-shx3.c b/kernel/arch/sh/kernel/cpu/sh4a/clock-shx3.c
index 9a49a44f6..605221d14 100644
--- a/kernel/arch/sh/kernel/cpu/sh4a/clock-shx3.c
+++ b/kernel/arch/sh/kernel/cpu/sh4a/clock-shx3.c
@@ -138,8 +138,8 @@ int __init arch_clk_init(void)
for (i = 0; i < ARRAY_SIZE(clks); i++)
ret |= clk_register(clks[i]);
- for (i = 0; i < ARRAY_SIZE(lookups); i++)
- clkdev_add(&lookups[i]);
+
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/kernel/arch/sh/kernel/cpu/sh5/unwind.c b/kernel/arch/sh/kernel/cpu/sh5/unwind.c
index 10aed4175..3a4fed406 100644
--- a/kernel/arch/sh/kernel/cpu/sh5/unwind.c
+++ b/kernel/arch/sh/kernel/cpu/sh5/unwind.c
@@ -159,7 +159,7 @@ static int lookup_prev_stack_frame(unsigned long fp, unsigned long pc,
/* Sign extend */
regcache[dest] =
- ((((s64)(u64)op >> 10) & 0xffff) << 54) >> 54;
+ sign_extend64((((u64)op >> 10) & 0xffff), 9);
break;
case (0xd0 >> 2): /* addi */
case (0xd4 >> 2): /* addi.l */
diff --git a/kernel/arch/sh/kernel/irq.c b/kernel/arch/sh/kernel/irq.c
index 6fe8089e6..abd58b4df 100644
--- a/kernel/arch/sh/kernel/irq.c
+++ b/kernel/arch/sh/kernel/irq.c
@@ -229,16 +229,17 @@ void migrate_irqs(void)
for_each_active_irq(irq) {
struct irq_data *data = irq_get_irq_data(irq);
- if (data->node == cpu) {
- unsigned int newcpu = cpumask_any_and(data->affinity,
+ if (irq_data_get_node(data) == cpu) {
+ struct cpumask *mask = irq_data_get_affinity_mask(data);
+ unsigned int 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",
irq, cpu);
- cpumask_setall(data->affinity);
+ cpumask_setall(mask);
}
- irq_set_affinity(irq, data->affinity);
+ irq_set_affinity(irq, mask);
}
}
}
diff --git a/kernel/arch/sh/kernel/localtimer.c b/kernel/arch/sh/kernel/localtimer.c
index b880a7e2a..cbb7d4636 100644
--- a/kernel/arch/sh/kernel/localtimer.c
+++ b/kernel/arch/sh/kernel/localtimer.c
@@ -39,11 +39,6 @@ void local_timer_interrupt(void)
irq_exit();
}
-static void dummy_timer_set_mode(enum clock_event_mode mode,
- struct clock_event_device *clk)
-{
-}
-
void local_timer_setup(unsigned int cpu)
{
struct clock_event_device *clk = &per_cpu(local_clockevent, cpu);
@@ -54,7 +49,6 @@ void local_timer_setup(unsigned int cpu)
CLOCK_EVT_FEAT_DUMMY;
clk->rating = 400;
clk->mult = 1;
- clk->set_mode = dummy_timer_set_mode;
clk->broadcast = smp_timer_broadcast;
clk->cpumask = cpumask_of(cpu);
diff --git a/kernel/arch/sh/kernel/perf_event.c b/kernel/arch/sh/kernel/perf_event.c
index 7cfd7f153..4dca18347 100644
--- a/kernel/arch/sh/kernel/perf_event.c
+++ b/kernel/arch/sh/kernel/perf_event.c
@@ -10,7 +10,7 @@
* Copyright (C) 2008-2009 Red Hat, Inc., Ingo Molnar
* Copyright (C) 2009 Jaswinder Singh Rajput
* Copyright (C) 2009 Advanced Micro Devices, Inc., Robert Richter
- * Copyright (C) 2008-2009 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com>
+ * Copyright (C) 2008-2009 Red Hat, Inc., Peter Zijlstra
* Copyright (C) 2009 Intel Corporation, <markus.t.metzger@intel.com>
*
* ppc:
diff --git a/kernel/arch/sh/kernel/traps_64.c b/kernel/arch/sh/kernel/traps_64.c
index 112ea11c0..d208c27cc 100644
--- a/kernel/arch/sh/kernel/traps_64.c
+++ b/kernel/arch/sh/kernel/traps_64.c
@@ -101,7 +101,7 @@ static int generate_and_check_address(struct pt_regs *regs,
if (displacement_not_indexed) {
__s64 displacement;
displacement = (opcode >> 10) & 0x3ff;
- displacement = ((displacement << 54) >> 54); /* sign extend */
+ displacement = sign_extend64(displacement, 9);
addr = (__u64)((__s64)base_address + (displacement << width_shift));
} else {
__u64 offset;
diff --git a/kernel/arch/sh/mm/hugetlbpage.c b/kernel/arch/sh/mm/hugetlbpage.c
index 534bc978a..6385f6020 100644
--- a/kernel/arch/sh/mm/hugetlbpage.c
+++ b/kernel/arch/sh/mm/hugetlbpage.c
@@ -62,11 +62,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 0;
diff --git a/kernel/arch/sh/mm/init.c b/kernel/arch/sh/mm/init.c
index 2790b6a64..75491862d 100644
--- a/kernel/arch/sh/mm/init.c
+++ b/kernel/arch/sh/mm/init.c
@@ -485,10 +485,10 @@ void free_initrd_mem(unsigned long start, unsigned long end)
#endif
#ifdef CONFIG_MEMORY_HOTPLUG
-int arch_add_memory(int nid, u64 start, u64 size)
+int arch_add_memory(int nid, u64 start, u64 size, bool for_device)
{
pg_data_t *pgdat;
- unsigned long start_pfn = start >> PAGE_SHIFT;
+ unsigned long start_pfn = PFN_DOWN(start);
unsigned long nr_pages = size >> PAGE_SHIFT;
int ret;
@@ -496,7 +496,8 @@ int arch_add_memory(int nid, u64 start, u64 size)
/* We only have ZONE_NORMAL, so this is easy.. */
ret = __add_pages(nid, pgdat->node_zones +
- zone_for_memory(nid, start, size, ZONE_NORMAL),
+ zone_for_memory(nid, start, size, ZONE_NORMAL,
+ for_device),
start_pfn, nr_pages);
if (unlikely(ret))
printk("%s: Failed, __add_pages() == %d\n", __func__, ret);
@@ -517,7 +518,7 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
#ifdef CONFIG_MEMORY_HOTREMOVE
int arch_remove_memory(u64 start, u64 size)
{
- unsigned long start_pfn = start >> PAGE_SHIFT;
+ unsigned long start_pfn = PFN_DOWN(start);
unsigned long nr_pages = size >> PAGE_SHIFT;
struct zone *zone;
int ret;
diff --git a/kernel/arch/sh/mm/numa.c b/kernel/arch/sh/mm/numa.c
index bce52ba66..05713d190 100644
--- a/kernel/arch/sh/mm/numa.c
+++ b/kernel/arch/sh/mm/numa.c
@@ -33,8 +33,8 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
/* Don't allow bogus node assignment */
BUG_ON(nid >= MAX_NUMNODES || nid <= 0);
- start_pfn = start >> PAGE_SHIFT;
- end_pfn = end >> PAGE_SHIFT;
+ start_pfn = PFN_DOWN(start);
+ end_pfn = PFN_DOWN(end);
pmb_bolt_mapping((unsigned long)__va(start), start, end - start,
PAGE_KERNEL);