Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 5 Oct 2007 15:08:08 +0000 (08:08 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 5 Oct 2007 15:08:08 +0000 (08:08 -0700)
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Fix 'niu' complex IRQ probing.
  [SPARC64]: check fork_idle() error
  [SPARC64]: Temporary workaround for PCI-E slot on T1000.
  [SPARC64]: VIO device addition log message level is too high.
  [SPARC64]: Fix domain-services port probing.
  [SPARC64]: Don't use in/local regs for ldx/stx data in N1 memcpy.

28 files changed:
arch/blackfin/kernel/bfin_gpio.c
arch/blackfin/mach-common/entry.S
arch/mips/mm/pg-r4k.c
drivers/ata/pata_ixp4xx_cf.c
drivers/ata/pata_marvell.c
drivers/ata/sata_mv.c
drivers/net/sky2.c
drivers/net/wireless/bcm43xx/bcm43xx_wx.c
drivers/scsi/megaraid.c
fs/binfmt_flat.c
fs/ocfs2/localalloc.c
include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
include/asm-blackfin/mach-bf537/portmux.h
include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
include/asm-blackfin/portmux.h
include/asm-blackfin/unistd.h
include/asm-h8300/flat.h
include/asm-m32r/flat.h
include/asm-m68knommu/flat.h
include/asm-mips/cmpxchg.h [new file with mode: 0644]
include/asm-mips/local.h
include/asm-mips/system.h
include/asm-sh/flat.h
include/asm-v850/flat.h
include/asm-x86_64/processor.h
mm/memory.c
net/ieee80211/softmac/ieee80211softmac_wx.c

index bafcfa52142ba0731f5caf3ecc71e672d7678285..5d488ef965ce771a95e6db2567752f10c806f052 100644 (file)
@@ -84,6 +84,7 @@
 #include <linux/err.h>
 #include <asm/blackfin.h>
 #include <asm/gpio.h>
+#include <asm/portmux.h>
 #include <linux/irq.h>
 
 #ifdef BF533_FAMILY
@@ -115,7 +116,11 @@ static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
 };
 #endif
 
-static unsigned short reserved_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
+static unsigned short reserved_gpio_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
+static unsigned short reserved_peri_map[gpio_bank(MAX_BLACKFIN_GPIOS + 16)];
+char *str_ident = NULL;
+
+#define RESOURCE_LABEL_SIZE 16
 
 #ifdef CONFIG_PM
 static unsigned short wakeup_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
@@ -143,22 +148,100 @@ inline int check_gpio(unsigned short gpio)
        return 0;
 }
 
+static void set_label(unsigned short ident, const char *label)
+{
+
+       if (label && str_ident) {
+               strncpy(str_ident + ident * RESOURCE_LABEL_SIZE, label,
+                        RESOURCE_LABEL_SIZE);
+               str_ident[ident * RESOURCE_LABEL_SIZE +
+                        RESOURCE_LABEL_SIZE - 1] = 0;
+       }
+}
+
+static char *get_label(unsigned short ident)
+{
+       if (!str_ident)
+               return "UNKNOWN";
+
+       return (str_ident[ident * RESOURCE_LABEL_SIZE] ?
+               (str_ident + ident * RESOURCE_LABEL_SIZE) : "UNKNOWN");
+}
+
+static int cmp_label(unsigned short ident, const char *label)
+{
+       if (label && str_ident)
+               return strncmp(str_ident + ident * RESOURCE_LABEL_SIZE,
+                                label, strlen(label));
+       else
+               return -EINVAL;
+}
+
 #ifdef BF537_FAMILY
 static void port_setup(unsigned short gpio, unsigned short usage)
 {
-       if (usage == GPIO_USAGE) {
-               if (*port_fer[gpio_bank(gpio)] & gpio_bit(gpio))
-                       printk(KERN_WARNING "bfin-gpio: Possible Conflict with Peripheral "
-                              "usage and GPIO %d detected!\n", gpio);
-               *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
-       } else
-               *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
-       SSYNC();
+       if (!check_gpio(gpio)) {
+               if (usage == GPIO_USAGE) {
+                       *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
+               } else
+                       *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
+               SSYNC();
+       }
 }
 #else
 # define port_setup(...)  do { } while (0)
 #endif
 
+#ifdef BF537_FAMILY
+
+#define PMUX_LUT_RES           0
+#define PMUX_LUT_OFFSET                1
+#define PMUX_LUT_ENTRIES       41
+#define PMUX_LUT_SIZE          2
+
+static unsigned short port_mux_lut[PMUX_LUT_ENTRIES][PMUX_LUT_SIZE] = {
+       {P_PPI0_D13, 11}, {P_PPI0_D14, 11}, {P_PPI0_D15, 11},
+       {P_SPORT1_TFS, 11}, {P_SPORT1_TSCLK, 11}, {P_SPORT1_DTPRI, 11},
+       {P_PPI0_D10, 10}, {P_PPI0_D11, 10}, {P_PPI0_D12, 10},
+       {P_SPORT1_RSCLK, 10}, {P_SPORT1_RFS, 10}, {P_SPORT1_DRPRI, 10},
+       {P_PPI0_D8, 9}, {P_PPI0_D9, 9}, {P_SPORT1_DRSEC, 9},
+       {P_SPORT1_DTSEC, 9}, {P_TMR2, 8}, {P_PPI0_FS3, 8}, {P_TMR3, 7},
+       {P_SPI0_SSEL4, 7}, {P_TMR4, 6}, {P_SPI0_SSEL5, 6}, {P_TMR5, 5},
+       {P_SPI0_SSEL6, 5}, {P_UART1_RX, 4}, {P_UART1_TX, 4}, {P_TMR6, 4},
+       {P_TMR7, 4}, {P_UART0_RX, 3}, {P_UART0_TX, 3}, {P_DMAR0, 3},
+       {P_DMAR1, 3}, {P_SPORT0_DTSEC, 1}, {P_SPORT0_DRSEC, 1},
+       {P_CAN0_RX, 1}, {P_CAN0_TX, 1}, {P_SPI0_SSEL7, 1},
+       {P_SPORT0_TFS, 0}, {P_SPORT0_DTPRI, 0}, {P_SPI0_SSEL2, 0},
+       {P_SPI0_SSEL3, 0}
+};
+
+static void portmux_setup(unsigned short per, unsigned short function)
+{
+       u16 y, muxreg, offset;
+
+       for (y = 0; y < PMUX_LUT_ENTRIES; y++) {
+               if (port_mux_lut[y][PMUX_LUT_RES] == per) {
+
+                       /* SET PORTMUX REG */
+
+                       offset = port_mux_lut[y][PMUX_LUT_OFFSET];
+                       muxreg = bfin_read_PORT_MUX();
+
+                       if (offset != 1) {
+                               muxreg &= ~(1 << offset);
+                       } else {
+                               muxreg &= ~(3 << 1);
+                       }
+
+                       muxreg |= (function << offset);
+                       bfin_write_PORT_MUX(muxreg);
+               }
+       }
+}
+
+#else
+# define portmux_setup(...)  do { } while (0)
+#endif
 
 static void default_gpio(unsigned short gpio)
 {
@@ -179,22 +262,15 @@ static void default_gpio(unsigned short gpio)
 
 static int __init bfin_gpio_init(void)
 {
-       int i;
-
-       printk(KERN_INFO "Blackfin GPIO Controller\n");
 
-       for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE)
-               reserved_map[gpio_bank(i)] = 0;
+       str_ident = kzalloc(RESOURCE_LABEL_SIZE * 256, GFP_KERNEL);
+       if (!str_ident)
+               return -ENOMEM;
 
-#if defined(BF537_FAMILY) && (defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE))
-# if defined(CONFIG_BFIN_MAC_RMII)
-       reserved_map[gpio_bank(PORT_H)] = 0xC373;
-# else
-       reserved_map[gpio_bank(PORT_H)] = 0xFFFF;
-# endif
-#endif
+       printk(KERN_INFO "Blackfin GPIO Controller\n");
 
        return 0;
+
 }
 
 arch_initcall(bfin_gpio_init);
@@ -223,7 +299,7 @@ arch_initcall(bfin_gpio_init);
 void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \
 { \
        unsigned long flags; \
-       BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); \
+       BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \
        local_irq_save(flags); \
        if (arg) \
                gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \
@@ -243,7 +319,7 @@ SET_GPIO(both)
 #define SET_GPIO_SC(name) \
 void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \
 { \
-       BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); \
+       BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \
        if (arg) \
                gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \
        else \
@@ -258,7 +334,7 @@ SET_GPIO_SC(maskb)
 void set_gpio_data(unsigned short gpio, unsigned short arg)
 {
        unsigned long flags;
-       BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio)));
+       BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
        local_irq_save(flags);
        if (arg)
                gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
@@ -277,7 +353,7 @@ SET_GPIO_SC(data)
 void set_gpio_toggle(unsigned short gpio)
 {
        unsigned long flags;
-       BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio)));
+       BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
        local_irq_save(flags);
        gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
        bfin_read_CHIPID();
@@ -286,7 +362,7 @@ void set_gpio_toggle(unsigned short gpio)
 #else
 void set_gpio_toggle(unsigned short gpio)
 {
-       BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio)));
+       BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
        gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
 }
 #endif
@@ -350,7 +426,7 @@ unsigned short get_gpio_data(unsigned short gpio)
 {
        unsigned long flags;
        unsigned short ret;
-       BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio)));
+       BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
        local_irq_save(flags);
        ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->data >> gpio_sub_n(gpio));
        bfin_read_CHIPID();
@@ -494,13 +570,14 @@ u32 gpio_pm_setup(void)
                        gpio_bank_saved[bank].dir   = gpio_bankb[bank]->dir;
                        gpio_bank_saved[bank].edge  = gpio_bankb[bank]->edge;
                        gpio_bank_saved[bank].both  = gpio_bankb[bank]->both;
-                       gpio_bank_saved[bank].reserved = reserved_map[bank];
+                       gpio_bank_saved[bank].reserved =
+                                               reserved_gpio_map[bank];
 
                        gpio = i;
 
                        while (mask) {
                                if (mask & 1) {
-                                       reserved_map[gpio_bank(gpio)] |=
+                                       reserved_gpio_map[gpio_bank(gpio)] |=
                                                        gpio_bit(gpio);
                                        bfin_gpio_wakeup_type(gpio,
                                                wakeup_flags_map[gpio]);
@@ -540,7 +617,8 @@ void gpio_pm_restore(void)
                        gpio_bankb[bank]->edge  = gpio_bank_saved[bank].edge;
                        gpio_bankb[bank]->both  = gpio_bank_saved[bank].both;
 
-                       reserved_map[bank] = gpio_bank_saved[bank].reserved;
+                       reserved_gpio_map[bank] =
+                                       gpio_bank_saved[bank].reserved;
 
                }
 
@@ -550,6 +628,141 @@ void gpio_pm_restore(void)
 
 #endif
 
+
+
+
+int peripheral_request(unsigned short per, const char *label)
+{
+       unsigned long flags;
+       unsigned short ident = P_IDENT(per);
+
+       /*
+        * Don't cares are pins with only one dedicated function
+        */
+
+       if (per & P_DONTCARE)
+               return 0;
+
+       if (!(per & P_DEFINED))
+               return -ENODEV;
+
+       local_irq_save(flags);
+
+       if (!check_gpio(ident)) {
+
+       if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
+               printk(KERN_ERR
+                      "%s: Peripheral %d is already reserved as GPIO by %s !\n",
+                      __FUNCTION__, ident, get_label(ident));
+               dump_stack();
+               local_irq_restore(flags);
+               return -EBUSY;
+       }
+
+       }
+
+       if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) {
+
+       /*
+        * Pin functions like AMC address strobes my
+        * be requested and used by several drivers
+        */
+
+       if (!(per & P_MAYSHARE)) {
+
+       /*
+        * Allow that the identical pin function can
+        * be requested from the same driver twice
+        */
+
+               if (cmp_label(ident, label) == 0)
+                       goto anyway;
+
+                       printk(KERN_ERR
+                              "%s: Peripheral %d function %d is already"
+                              "reserved by %s !\n",
+                              __FUNCTION__, ident, P_FUNCT2MUX(per),
+                               get_label(ident));
+                       dump_stack();
+                       local_irq_restore(flags);
+                       return -EBUSY;
+               }
+
+       }
+
+anyway:
+
+
+       portmux_setup(per, P_FUNCT2MUX(per));
+
+       port_setup(ident, PERIPHERAL_USAGE);
+
+       reserved_peri_map[gpio_bank(ident)] |= gpio_bit(ident);
+       local_irq_restore(flags);
+       set_label(ident, label);
+
+       return 0;
+}
+EXPORT_SYMBOL(peripheral_request);
+
+int peripheral_request_list(unsigned short per[], const char *label)
+{
+       u16 cnt;
+       int ret;
+
+       for (cnt = 0; per[cnt] != 0; cnt++) {
+               ret = peripheral_request(per[cnt], label);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL(peripheral_request_list);
+
+void peripheral_free(unsigned short per)
+{
+       unsigned long flags;
+       unsigned short ident = P_IDENT(per);
+
+       if (per & P_DONTCARE)
+               return;
+
+       if (!(per & P_DEFINED))
+               return;
+
+       if (check_gpio(ident) < 0)
+               return;
+
+       local_irq_save(flags);
+
+       if (unlikely(!(reserved_peri_map[gpio_bank(ident)]
+                        & gpio_bit(ident)))) {
+               local_irq_restore(flags);
+               return;
+       }
+
+       if (!(per & P_MAYSHARE)) {
+               port_setup(ident, GPIO_USAGE);
+       }
+
+       reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident);
+
+       local_irq_restore(flags);
+}
+EXPORT_SYMBOL(peripheral_free);
+
+void peripheral_free_list(unsigned short per[])
+{
+       u16 cnt;
+
+       for (cnt = 0; per[cnt] != 0; cnt++) {
+               peripheral_free(per[cnt]);
+       }
+
+}
+EXPORT_SYMBOL(peripheral_free_list);
+
 /***********************************************************
 *
 * FUNCTIONS: Blackfin GPIO Driver
@@ -574,13 +787,13 @@ int gpio_request(unsigned short gpio, const char *label)
 
        local_irq_save(flags);
 
-       if (unlikely(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
+       if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
                printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved!\n", gpio);
                dump_stack();
                local_irq_restore(flags);
                return -EBUSY;
        }
-       reserved_map[gpio_bank(gpio)] |= gpio_bit(gpio);
+       reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio);
 
        local_irq_restore(flags);
 
@@ -599,7 +812,7 @@ void gpio_free(unsigned short gpio)
 
        local_irq_save(flags);
 
-       if (unlikely(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
+       if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
                printk(KERN_ERR "bfin-gpio: GPIO %d wasn't reserved!\n", gpio);
                dump_stack();
                local_irq_restore(flags);
@@ -608,7 +821,7 @@ void gpio_free(unsigned short gpio)
 
        default_gpio(gpio);
 
-       reserved_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
+       reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
 
        local_irq_restore(flags);
 }
@@ -618,7 +831,7 @@ void gpio_direction_input(unsigned short gpio)
 {
        unsigned long flags;
 
-       BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio)));
+       BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
 
        local_irq_save(flags);
        gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
@@ -631,7 +844,7 @@ void gpio_direction_output(unsigned short gpio)
 {
        unsigned long flags;
 
-       BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio)));
+       BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
 
        local_irq_save(flags);
        gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
index d61bba98fb548b8baf63980e11aca302902419d4..9604588083446d6c866595e4336d0e63fc6c7b97 100644 (file)
@@ -815,7 +815,7 @@ _extable:
 
 ALIGN
 ENTRY(_sys_call_table)
-       .long _sys_ni_syscall   /* 0  -  old "setup()" system call*/
+       .long _sys_restart_syscall      /* 0 */
        .long _sys_exit
        .long _sys_fork
        .long _sys_read
@@ -978,13 +978,13 @@ ENTRY(_sys_call_table)
        .long _sys_sched_get_priority_min  /* 160 */
        .long _sys_sched_rr_get_interval
        .long _sys_nanosleep
-       .long _sys_ni_syscall   /* sys_mremap */
+       .long _sys_mremap
        .long _sys_setresuid    /* setresuid16 */
        .long _sys_getresuid    /* getresuid16 */       /* 165 */
        .long _sys_ni_syscall   /* for vm86 */
        .long _sys_ni_syscall   /* old "query_module" */
        .long _sys_ni_syscall   /* sys_poll */
-       .long _sys_ni_syscall   /* sys_nfsservctl */
+       .long _sys_nfsservctl
        .long _sys_setresgid    /* setresgid16 */       /* 170 */
        .long _sys_getresgid    /* getresgid16 */
        .long _sys_prctl
@@ -1040,7 +1040,7 @@ ENTRY(_sys_call_table)
        .long _sys_ni_syscall   /* reserved for TUX */
        .long _sys_ni_syscall
        .long _sys_gettid
-       .long _sys_ni_syscall   /* 225 */ /* sys_readahead */
+       .long _sys_readahead    /* 225 */
        .long _sys_setxattr
        .long _sys_lsetxattr
        .long _sys_fsetxattr
@@ -1157,6 +1157,21 @@ ENTRY(_sys_call_table)
        .long _sys_shmctl
        .long _sys_shmdt        /* 340 */
        .long _sys_shmget
+       .long _sys_splice
+       .long _sys_sync_file_range
+       .long _sys_tee
+       .long _sys_vmsplice     /* 345 */
+       .long _sys_epoll_pwait
+       .long _sys_utimensat
+       .long _sys_signalfd
+       .long _sys_timerfd
+       .long _sys_eventfd      /* 350 */
+       .long _sys_pread64
+       .long _sys_pwrite64
+       .long _sys_fadvise64
+       .long _sys_set_robust_list
+       .long _sys_get_robust_list      /* 355 */
+       .long _sys_fallocate
        .rept NR_syscalls-(.-_sys_call_table)/4
        .long _sys_ni_syscall
        .endr
index dc795be62807d1d1bf22af966ad961d0918794bf..e47e9e9486bf962cef8e44aa4d265a875c6f94d0 100644 (file)
@@ -209,7 +209,7 @@ static inline void build_cdex_p(void)
        }
 
        if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
-               build_insn_word(0x3c01a000);    /* lui     $at, 0xa000  */
+               build_insn_word(0x8c200000);    /* lw      $zero, ($at) */
 
        mi.c_format.opcode     = cache_op;
        mi.c_format.rs         = 4;             /* $a0 */
index 4ca7fd6118d50f6d52a1b7c464d1266614282b2d..5dea3584c6c2fc439846b190b2d3627bf22a6156 100644 (file)
@@ -189,6 +189,9 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)
        data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000);
        data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000);
 
+       if (!data->cs0 || !data->cs1)
+               return -ENOMEM;
+
        irq = platform_get_irq(pdev, 0);
        if (irq)
                set_irq_type(irq, IRQT_RISING);
index ae206f35f747a677e54675847e6fb049c4043569..b45506f1ef73e0db979a1614ffaa58048a63f721 100644 (file)
@@ -44,10 +44,10 @@ static int marvell_pre_reset(struct ata_port *ap, unsigned long deadline)
                return -ENOMEM;
        printk("BAR5:");
        for(i = 0; i <= 0x0F; i++)
-               printk("%02X:%02X ", i, readb(barp + i));
+               printk("%02X:%02X ", i, ioread8(barp + i));
        printk("\n");
 
-       devices = readl(barp + 0x0C);
+       devices = ioread32(barp + 0x0C);
        pci_iounmap(pdev, barp);
 
        if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
index 11bf6c7ac12260d4ba40551b5eef854022ab8eb3..1a82e22b3efda91ba02e927031341cc73ca36011 100644 (file)
@@ -1139,15 +1139,27 @@ static unsigned int mv_fill_sg(struct ata_queued_cmd *qc)
                dma_addr_t addr = sg_dma_address(sg);
                u32 sg_len = sg_dma_len(sg);
 
-               mv_sg->addr = cpu_to_le32(addr & 0xffffffff);
-               mv_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16);
-               mv_sg->flags_size = cpu_to_le32(sg_len & 0xffff);
+               while (sg_len) {
+                       u32 offset = addr & 0xffff;
+                       u32 len = sg_len;
 
-               if (ata_sg_is_last(sg, qc))
-                       mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
+                       if ((offset + sg_len > 0x10000))
+                               len = 0x10000 - offset;
+
+                       mv_sg->addr = cpu_to_le32(addr & 0xffffffff);
+                       mv_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16);
+                       mv_sg->flags_size = cpu_to_le32(len);
+
+                       sg_len -= len;
+                       addr += len;
+
+                       if (!sg_len && ata_sg_is_last(sg, qc))
+                               mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
+
+                       mv_sg++;
+                       n_sg++;
+               }
 
-               mv_sg++;
-               n_sg++;
        }
 
        return n_sg;
index 162489b9f5990b9ea2093ff5afc3c8b936c8abc1..ea117fc3d5e390c6da6b763a61f6d94a071c3c86 100644 (file)
@@ -2163,9 +2163,6 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
        sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
        prefetch(sky2->rx_ring + sky2->rx_next);
 
-       if (length < ETH_ZLEN || length > sky2->rx_data_size)
-               goto len_error;
-
        /* This chip has hardware problems that generates bogus status.
         * So do only marginal checking and expect higher level protocols
         * to handle crap frames.
index d6d9413d7f23cdd662eadf09cc675dd667b2fda1..6acfdc49dccd30507f4b8b9521f4e75a2a237fbd 100644 (file)
@@ -444,7 +444,7 @@ static int bcm43xx_wx_set_xmitpower(struct net_device *net_dev,
        u16 maxpower;
 
        if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) {
-               printk(PFX KERN_ERR "TX power not in dBm.\n");
+               printk(KERN_ERR PFX "TX power not in dBm.\n");
                return -EOPNOTSUPP;
        }
 
index 3907f6718ede11272e797bc7b6f7d7a1bfc34210..da56163c30a8f6404b02c16743595561a7b2a692 100644 (file)
@@ -1753,6 +1753,14 @@ mega_build_sglist(adapter_t *adapter, scb_t *scb, u32 *buf, u32 *len)
 
        *len = 0;
 
+       if (scsi_sg_count(cmd) == 1 && !adapter->has_64bit_addr) {
+               sg = scsi_sglist(cmd);
+               scb->dma_h_bulkdata = sg_dma_address(sg);
+               *buf = (u32)scb->dma_h_bulkdata;
+               *len = sg_dma_len(sg);
+               return 0;
+       }
+
        scsi_for_each_sg(cmd, sg, sgcnt, idx) {
                if (adapter->has_64bit_addr) {
                        scb->sgl64[idx].address = sg_dma_address(sg);
index 861141b4f6d6f4cbbfcd96366074db8e4adbeaf3..fcb3405bb14e99b64aa322f7e3856ee3fa2ddbb1 100644 (file)
@@ -742,6 +742,7 @@ static int load_flat_file(struct linux_binprm * bprm,
         * __start to address 4 so that is okay).
         */
        if (rev > OLD_FLAT_VERSION) {
+               unsigned long persistent = 0;
                for (i=0; i < relocs; i++) {
                        unsigned long addr, relval;
 
@@ -749,6 +750,8 @@ static int load_flat_file(struct linux_binprm * bprm,
                           relocated (of course, the address has to be
                           relocated first).  */
                        relval = ntohl(reloc[i]);
+                       if (flat_set_persistent (relval, &persistent))
+                               continue;
                        addr = flat_get_relocate_addr(relval);
                        rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1);
                        if (rp == (unsigned long *)RELOC_FAILED) {
@@ -757,7 +760,8 @@ static int load_flat_file(struct linux_binprm * bprm,
                        }
 
                        /* Get the pointer's value.  */
-                       addr = flat_get_addr_from_rp(rp, relval, flags);
+                       addr = flat_get_addr_from_rp(rp, relval, flags,
+                                                       &persistent);
                        if (addr != 0) {
                                /*
                                 * Do the relocation.  PIC relocs in the data section are
index de984d2725760ee1d523b8fe588831c09891ec2f..d272847d5a070491d22cda6b1f0b482423b33a39 100644 (file)
@@ -514,8 +514,10 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
        ac->ac_bh = osb->local_alloc_bh;
        status = 0;
 bail:
-       if (status < 0 && local_alloc_inode)
+       if (status < 0 && local_alloc_inode) {
+               mutex_unlock(&local_alloc_inode->i_mutex);
                iput(local_alloc_inode);
+       }
 
        mlog_exit(status);
        return status;
index e043cafa3c429795c3eb7e473e04da4eac58c50f..69b9f8e120e93402b5cae571f2e8dfdd26084e49 100644 (file)
@@ -1,5 +1,6 @@
 #include <linux/serial.h>
 #include <asm/dma.h>
+#include <asm/portmux.h>
 
 #define NR_PORTS                1
 
@@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = {
        }
 };
 
+#define DRIVER_NAME "bfin-uart"
 
 int nr_ports = NR_PORTS;
 static void bfin_serial_hw_init(struct bfin_serial_port *uart)
 {
 
+#ifdef CONFIG_SERIAL_BFIN_UART0
+       peripheral_request(P_UART0_TX, DRIVER_NAME);
+       peripheral_request(P_UART0_RX, DRIVER_NAME);
+#endif
+
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
        if (uart->cts_pin >= 0) {
-               gpio_request(uart->cts_pin, NULL);
+               gpio_request(uart->cts_pin, DRIVER_NAME);
                gpio_direction_input(uart->cts_pin);
        }
        if (uart->rts_pin >= 0) {
-               gpio_request(uart->rts_pin, NULL);
+               gpio_request(uart->rts_pin, DRIVER_NAME);
                gpio_direction_input(uart->rts_pin);
        }
 #endif
index 8f5d9c4d8d5b836e51f7ffcb0bfdd396bbd9610c..6fb328f5186a25dd759e35e944576ab434306f55 100644 (file)
@@ -1,5 +1,6 @@
 #include <linux/serial.h>
 #include <asm/dma.h>
+#include <asm/portmux.h>
 
 #define NR_PORTS               2
 
@@ -122,25 +123,29 @@ struct bfin_serial_res bfin_serial_resource[] = {
 
 int nr_ports = ARRAY_SIZE(bfin_serial_resource);
 
+#define DRIVER_NAME "bfin-uart"
+
 static void bfin_serial_hw_init(struct bfin_serial_port *uart)
 {
-       unsigned short val;
-       val = bfin_read16(BFIN_PORT_MUX);
-       val &= ~(PFDE | PFTE);
-       bfin_write16(BFIN_PORT_MUX, val);
 
-       val = bfin_read16(PORTF_FER);
-       val |= 0xF;
-       bfin_write16(PORTF_FER, val);
+#ifdef CONFIG_SERIAL_BFIN_UART0
+       peripheral_request(P_UART0_TX, DRIVER_NAME);
+       peripheral_request(P_UART0_RX, DRIVER_NAME);
+#endif
+
+#ifdef CONFIG_SERIAL_BFIN_UART1
+       peripheral_request(P_UART1_TX, DRIVER_NAME);
+       peripheral_request(P_UART1_RX, DRIVER_NAME);
+#endif
 
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
        if (uart->cts_pin >= 0) {
-               gpio_request(uart->cts_pin, NULL);
+               gpio_request(uart->cts_pin, DRIVER_NAME);
                gpio_direction_input(uart->cts_pin);
        }
 
        if (uart->rts_pin >= 0) {
-               gpio_request(uart->rts_pin, NULL);
+               gpio_request(uart->rts_pin, DRIVER_NAME);
                gpio_direction_output(uart->rts_pin);
        }
 #endif
index 23e13c5abc4d9deb689c2d4c5d69c6d62567045e..ae6c53b28452520919decaa007c3979a2dd2896a 100644 (file)
 #define P_SPI0_SSEL2   (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1))
 #define P_SPI0_SSEL7   (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2))
 
-#endif /* _MACH_PORTMUX_H_ */
+#define P_MII0 {\
+       P_MII0_ETxD0, \
+       P_MII0_ETxD1, \
+       P_MII0_ETxD2, \
+       P_MII0_ETxD3, \
+       P_MII0_ETxEN, \
+       P_MII0_TxCLK, \
+       P_MII0_PHYINT, \
+       P_MII0_COL, \
+       P_MII0_ERxD0, \
+       P_MII0_ERxD1, \
+       P_MII0_ERxD2, \
+       P_MII0_ERxD3, \
+       P_MII0_ERxDV, \
+       P_MII0_ERxCLK, \
+       P_MII0_ERxER, \
+       P_MII0_CRS, \
+       P_MDC, \
+       P_MDIO, 0}
+
+
+#define P_RMII0 {\
+       P_MII0_ETxD0, \
+       P_MII0_ETxD1, \
+       P_MII0_ETxEN, \
+       P_MII0_ERxD0, \
+       P_MII0_ERxD1, \
+       P_MII0_ERxER, \
+       P_RMII0_REF_CLK, \
+       P_RMII0_MDINT, \
+       P_RMII0_CRS_DV, \
+       P_MDC, \
+       P_MDIO, 0}
+#endif                                 /* _MACH_PORTMUX_H_ */
index e043cafa3c429795c3eb7e473e04da4eac58c50f..69b9f8e120e93402b5cae571f2e8dfdd26084e49 100644 (file)
@@ -1,5 +1,6 @@
 #include <linux/serial.h>
 #include <asm/dma.h>
+#include <asm/portmux.h>
 
 #define NR_PORTS                1
 
@@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = {
        }
 };
 
+#define DRIVER_NAME "bfin-uart"
 
 int nr_ports = NR_PORTS;
 static void bfin_serial_hw_init(struct bfin_serial_port *uart)
 {
 
+#ifdef CONFIG_SERIAL_BFIN_UART0
+       peripheral_request(P_UART0_TX, DRIVER_NAME);
+       peripheral_request(P_UART0_RX, DRIVER_NAME);
+#endif
+
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
        if (uart->cts_pin >= 0) {
-               gpio_request(uart->cts_pin, NULL);
+               gpio_request(uart->cts_pin, DRIVER_NAME);
                gpio_direction_input(uart->cts_pin);
        }
        if (uart->rts_pin >= 0) {
-               gpio_request(uart->rts_pin, NULL);
+               gpio_request(uart->rts_pin, DRIVER_NAME);
                gpio_direction_input(uart->rts_pin);
        }
 #endif
index 9d3681e4211107524e66ed1a25a88c97f5567b40..0d3f650d2d99ad50ecc4dc4269d1117581985507 100644 (file)
 #define P_MAYSHARE     0x2000
 #define P_DONTCARE     0x1000
 
+
+int peripheral_request(unsigned short per, const char *label);
+void peripheral_free(unsigned short per);
+int peripheral_request_list(unsigned short per[], const char *label);
+void peripheral_free_list(unsigned short per[]);
+
 #include <asm/gpio.h>
 #include <asm/mach/portmux.h>
 
 #define P_SPI2_SSEL3 P_UNDEF
 #endif
 
+#ifndef P_SPI2_SSEL4
+#define P_SPI2_SSEL4 P_UNDEF
+#endif
+
+#ifndef P_SPI2_SSEL5
+#define P_SPI2_SSEL5 P_UNDEF
+#endif
+
+#ifndef P_SPI2_SSEL6
+#define P_SPI2_SSEL6 P_UNDEF
+#endif
+
+#ifndef P_SPI2_SSEL7
+#define P_SPI2_SSEL7 P_UNDEF
+#endif
+
 #ifndef P_SPI2_SCK
 #define P_SPI2_SCK P_UNDEF
 #endif
 #define P_SPI0_SSEL3 P_UNDEF
 #endif
 
+#ifndef P_SPI0_SSEL4
+#define P_SPI0_SSEL4 P_UNDEF
+#endif
+
+#ifndef P_SPI0_SSEL5
+#define P_SPI0_SSEL5 P_UNDEF
+#endif
+
+#ifndef P_SPI0_SSEL6
+#define P_SPI0_SSEL6 P_UNDEF
+#endif
+
+#ifndef P_SPI0_SSEL7
+#define P_SPI0_SSEL7 P_UNDEF
+#endif
+
 #ifndef P_UART0_TX
 #define P_UART0_TX P_UNDEF
 #endif
 #define P_SPI1_SSEL3 P_UNDEF
 #endif
 
+
+#ifndef P_SPI1_SSEL4
+#define P_SPI1_SSEL4 P_UNDEF
+#endif
+
+#ifndef P_SPI1_SSEL5
+#define P_SPI1_SSEL5 P_UNDEF
+#endif
+
+#ifndef P_SPI1_SSEL6
+#define P_SPI1_SSEL6 P_UNDEF
+#endif
+
+#ifndef P_SPI1_SSEL7
+#define P_SPI1_SSEL7 P_UNDEF
+#endif
+
 #ifndef P_SPI1_SCK
 #define P_SPI1_SCK P_UNDEF
 #endif
index 0df9f2d322a3a473b54ef9bd4c14ad194966b0c9..07ffe8b718c51a0d379ec07d43b5277c20a63eda 100644 (file)
@@ -3,6 +3,7 @@
 /*
  * This file contains the system call numbers.
  */
+#define __NR_restart_syscall     0
 #define __NR_exit                1
 #define __NR_fork                2
 #define __NR_read                3
 #define __NR_sched_get_priority_min    160
 #define __NR_sched_rr_get_interval     161
 #define __NR_nanosleep         162
-                               /* 163 __NR_mremap */
+#define __NR_mremap            163
 #define __NR_setresuid         164
 #define __NR_getresuid         165
                                /* 166 __NR_vm86 */
                                /* 167 __NR_query_module */
                                /* 168 __NR_poll */
-                               /* 169 __NR_nfsservctl */
+#define __NR_nfsservctl                169
 #define __NR_setresgid         170
 #define __NR_getresgid         171
 #define __NR_prctl             172
                                /* 222 reserved for TUX */
                                /* 223 reserved for TUX */
 #define __NR_gettid            224
-                               /* 225 __NR_readahead */
+#define __NR_readahead         225
 #define __NR_setxattr          226
 #define __NR_lsetxattr         227
 #define __NR_fsetxattr         228
 #define __NR_mq_timedreceive   (__NR_mq_open+3)
 #define __NR_mq_notify         (__NR_mq_open+4)
 #define __NR_mq_getsetattr     (__NR_mq_open+5)
-                               /* 284 __NR_sys_kexec_load */
+#define __NR_kexec_load                284
 #define __NR_waitid            285
 #define __NR_add_key           286
 #define __NR_request_key       287
 #define __NR_shmdt             340
 #define __NR_shmget            341
 
-#define __NR_syscall           342
+#define __NR_splice            342
+#define __NR_sync_file_range   343
+#define __NR_tee               344
+#define __NR_vmsplice          345
+
+#define __NR_epoll_pwait       346
+#define __NR_utimensat         347
+#define __NR_signalfd          348
+#define __NR_timerfd           349
+#define __NR_eventfd           350
+#define __NR_pread64           351
+#define __NR_pwrite64          352
+#define __NR_fadvise64         353
+#define __NR_set_robust_list   354
+#define __NR_get_robust_list   355
+#define __NR_fallocate         356
+
+#define __NR_syscall           357
 #define NR_syscalls            __NR_syscall
 
+/* Old optional stuff no one actually uses */
+#define __IGNORE_sysfs
+#define __IGNORE_uselib
+
+/* Implement the newer interfaces */
+#define __IGNORE_mmap
+#define __IGNORE_poll
+#define __IGNORE_select
+#define __IGNORE_utime
+
+/* Not relevant on no-mmu */
+#define __IGNORE_swapon
+#define __IGNORE_swapoff
+#define __IGNORE_msync
+#define __IGNORE_mlock
+#define __IGNORE_munlock
+#define __IGNORE_mlockall
+#define __IGNORE_munlockall
+#define __IGNORE_mincore
+#define __IGNORE_madvise
+#define __IGNORE_remap_file_pages
+#define __IGNORE_mbind
+#define __IGNORE_get_mempolicy
+#define __IGNORE_set_mempolicy
+#define __IGNORE_migrate_pages
+#define __IGNORE_move_pages
+#define __IGNORE_getcpu
+
 #ifdef __KERNEL__
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_STAT64
index c20eee767d6f1ebeca20e5933dbd8f71452d199e..2a873508a9a101b359483ebbf086f84aa769f0f0 100644 (file)
@@ -9,6 +9,7 @@
 #define        flat_argvp_envp_on_stack()              1
 #define        flat_old_ram_flag(flags)                1
 #define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
+#define        flat_set_persistent(relval, p)          0
 
 /*
  * on the H8 a couple of the relocations have an instruction in the
@@ -18,7 +19,7 @@
  */
 
 #define        flat_get_relocate_addr(rel)             (rel)
-#define flat_get_addr_from_rp(rp, relval, flags) \
+#define flat_get_addr_from_rp(rp, relval, flags, persistent) \
         (get_unaligned(rp) & ((flags & FLAT_FLAG_GOTPIC) ? 0xffffffff: 0x00ffffff))
 #define flat_put_addr_at_rp(rp, addr, rel) \
        put_unaligned (((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), rp)
index 1b285f65cab631506ed7169d50a6ae94dde311b5..d851cf0c4aa5ecff7902da7a54fdab618eccdad4 100644 (file)
 #define        flat_stack_align(sp)            (*sp += (*sp & 3 ? (4 - (*sp & 3)): 0))
 #define        flat_argvp_envp_on_stack()              0
 #define        flat_old_ram_flag(flags)                (flags)
+#define        flat_set_persistent(relval, p)          0
 #define        flat_reloc_valid(reloc, size)           \
        (((reloc) - textlen_for_m32r_lo16_data) <= (size))
-#define flat_get_addr_from_rp(rp, relval, flags) \
+#define flat_get_addr_from_rp(rp, relval, flags, persistent) \
        m32r_flat_get_addr_from_rp(rp, relval, (text_len) )
 
 #define flat_put_addr_at_rp(rp, addr, relval) \
index 2d836edc43441e9a005b533147d29cca26180f18..814b5174a8e0ffb623aa96e65f9b2a1b52a4ddad 100644 (file)
@@ -9,8 +9,9 @@
 #define        flat_argvp_envp_on_stack()              1
 #define        flat_old_ram_flag(flags)                (flags)
 #define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
-#define        flat_get_addr_from_rp(rp, relval, flags)        get_unaligned(rp)
+#define        flat_get_addr_from_rp(rp, relval, flags, p)     get_unaligned(rp)
 #define        flat_put_addr_at_rp(rp, val, relval)    put_unaligned(val,rp)
 #define        flat_get_relocate_addr(rel)             (rel)
+#define        flat_set_persistent(relval, p)          0
 
 #endif /* __M68KNOMMU_FLAT_H__ */
diff --git a/include/asm-mips/cmpxchg.h b/include/asm-mips/cmpxchg.h
new file mode 100644 (file)
index 0000000..c5b4708
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2003, 06, 07 by Ralf Baechle (ralf@linux-mips.org)
+ */
+#ifndef __ASM_CMPXCHG_H
+#define __ASM_CMPXCHG_H
+
+#include <linux/irqflags.h>
+
+#define __HAVE_ARCH_CMPXCHG 1
+
+#define __cmpxchg_asm(ld, st, m, old, new)                             \
+({                                                                     \
+       __typeof(*(m)) __ret;                                           \
+                                                                       \
+       if (cpu_has_llsc && R10000_LLSC_WAR) {                          \
+               __asm__ __volatile__(                                   \
+               "       .set    push                            \n"     \
+               "       .set    noat                            \n"     \
+               "       .set    mips3                           \n"     \
+               "1:     " ld "  %0, %2          # __cmpxchg_asm \n"     \
+               "       bne     %0, %z3, 2f                     \n"     \
+               "       .set    mips0                           \n"     \
+               "       move    $1, %z4                         \n"     \
+               "       .set    mips3                           \n"     \
+               "       " st "  $1, %1                          \n"     \
+               "       beqzl   $1, 1b                          \n"     \
+               "2:                                             \n"     \
+               "       .set    pop                             \n"     \
+               : "=&r" (__ret), "=R" (*m)                              \
+               : "R" (*m), "Jr" (old), "Jr" (new)                      \
+               : "memory");                                            \
+       } else if (cpu_has_llsc) {                                      \
+               __asm__ __volatile__(                                   \
+               "       .set    push                            \n"     \
+               "       .set    noat                            \n"     \
+               "       .set    mips3                           \n"     \
+               "1:     " ld "  %0, %2          # __cmpxchg_asm \n"     \
+               "       bne     %0, %z3, 2f                     \n"     \
+               "       .set    mips0                           \n"     \
+               "       move    $1, %z4                         \n"     \
+               "       .set    mips3                           \n"     \
+               "       " st "  $1, %1                          \n"     \
+               "       beqz    $1, 3f                          \n"     \
+               "2:                                             \n"     \
+               "       .subsection 2                           \n"     \
+               "3:     b       1b                              \n"     \
+               "       .previous                               \n"     \
+               "       .set    pop                             \n"     \
+               : "=&r" (__ret), "=R" (*m)                              \
+               : "R" (*m), "Jr" (old), "Jr" (new)                      \
+               : "memory");                                            \
+       } else {                                                        \
+               unsigned long __flags;                                  \
+                                                                       \
+               raw_local_irq_save(__flags);                            \
+               __ret = *m;                                             \
+               if (__ret == old)                                       \
+                       *m = new;                                       \
+               raw_local_irq_restore(__flags);                         \
+       }                                                               \
+                                                                       \
+       __ret;                                                          \
+})
+
+/*
+ * This function doesn't exist, so you'll get a linker error
+ * if something tries to do an invalid cmpxchg().
+ */
+extern void __cmpxchg_called_with_bad_pointer(void);
+
+#define __cmpxchg(ptr,old,new,barrier)                                 \
+({                                                                     \
+       __typeof__(ptr) __ptr = (ptr);                                  \
+       __typeof__(*(ptr)) __old = (old);                               \
+       __typeof__(*(ptr)) __new = (new);                               \
+       __typeof__(*(ptr)) __res = 0;                                   \
+                                                                       \
+       barrier;                                                        \
+                                                                       \
+       switch (sizeof(*(__ptr))) {                                     \
+       case 4:                                                         \
+               __res = __cmpxchg_asm("ll", "sc", __ptr, __old, __new); \
+               break;                                                  \
+       case 8:                                                         \
+               if (sizeof(long) == 8) {                                \
+                       __res = __cmpxchg_asm("lld", "scd", __ptr,      \
+                                          __old, __new);               \
+                       break;                                          \
+               }                                                       \
+       default:                                                        \
+               __cmpxchg_called_with_bad_pointer();                    \
+               break;                                                  \
+       }                                                               \
+                                                                       \
+       barrier;                                                        \
+                                                                       \
+       __res;                                                          \
+})
+
+#define cmpxchg(ptr, old, new)         __cmpxchg(ptr, old, new, smp_llsc_mb())
+#define cmpxchg_local(ptr, old, new)   __cmpxchg(ptr, old, new,)
+
+#endif /* __ASM_CMPXCHG_H */
index ed882c88e0caa0e8d9add0be6b7c8ce7576c36cd..f9a5ce5c9af174aae59d3da955f0c351280f4d7f 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/percpu.h>
 #include <linux/bitops.h>
 #include <asm/atomic.h>
+#include <asm/cmpxchg.h>
 #include <asm/war.h>
 
 typedef struct
@@ -114,68 +115,6 @@ static __inline__ long local_sub_return(long i, local_t * l)
        return result;
 }
 
-/*
- * local_sub_if_positive - conditionally subtract integer from atomic variable
- * @i: integer value to subtract
- * @l: pointer of type local_t
- *
- * Atomically test @l and subtract @i if @l is greater or equal than @i.
- * The function returns the old value of @l minus @i.
- */
-static __inline__ long local_sub_if_positive(long i, local_t * l)
-{
-       unsigned long result;
-
-       if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
-
-               __asm__ __volatile__(
-               "       .set    mips3                                   \n"
-               "1:"    __LL    "%1, %2         # local_sub_if_positive\n"
-               "       dsubu   %0, %1, %3                              \n"
-               "       bltz    %0, 1f                                  \n"
-                       __SC    "%0, %2                                 \n"
-               "       .set    noreorder                               \n"
-               "       beqzl   %0, 1b                                  \n"
-               "        dsubu  %0, %1, %3                              \n"
-               "       .set    reorder                                 \n"
-               "1:                                                     \n"
-               "       .set    mips0                                   \n"
-               : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
-               : "Ir" (i), "m" (l->a.counter)
-               : "memory");
-       } else if (cpu_has_llsc) {
-               unsigned long temp;
-
-               __asm__ __volatile__(
-               "       .set    mips3                                   \n"
-               "1:"    __LL    "%1, %2         # local_sub_if_positive\n"
-               "       dsubu   %0, %1, %3                              \n"
-               "       bltz    %0, 1f                                  \n"
-                       __SC    "%0, %2                                 \n"
-               "       .set    noreorder                               \n"
-               "       beqz    %0, 1b                                  \n"
-               "        dsubu  %0, %1, %3                              \n"
-               "       .set    reorder                                 \n"
-               "1:                                                     \n"
-               "       .set    mips0                                   \n"
-               : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
-               : "Ir" (i), "m" (l->a.counter)
-               : "memory");
-       } else {
-               unsigned long flags;
-
-               local_irq_save(flags);
-               result = l->a.counter;
-               result -= i;
-               if (result >= 0)
-                       l->a.counter = result;
-               local_irq_restore(flags);
-       }
-
-       return result;
-}
-
 #define local_cmpxchg(l, o, n) \
        ((long)cmpxchg_local(&((l)->a.counter), (o), (n)))
 #define local_xchg(l, n) (xchg_local(&((l)->a.counter),(n)))
@@ -233,12 +172,6 @@ static __inline__ long local_sub_if_positive(long i, local_t * l)
  */
 #define local_dec_and_test(l) (local_sub_return(1, (l)) == 0)
 
-/*
- * local_dec_if_positive - decrement by 1 if old value positive
- * @l: pointer of type local_t
- */
-#define local_dec_if_positive(l)       local_sub_if_positive(1, l)
-
 /*
  * local_add_negative - add and test if negative
  * @l: pointer of type local_t
index 357251f42518bdb51e7c402ae720140880425007..480b574e2483a6a22581280e8091d23ba9afaa5d 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <asm/addrspace.h>
 #include <asm/barrier.h>
+#include <asm/cmpxchg.h>
 #include <asm/cpu-features.h>
 #include <asm/dsp.h>
 #include <asm/war.h>
@@ -194,266 +195,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
 
 #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
 
-#define __HAVE_ARCH_CMPXCHG 1
-
-static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
-       unsigned long new)
-{
-       __u32 retval;
-
-       if (cpu_has_llsc && R10000_LLSC_WAR) {
-               __asm__ __volatile__(
-               "       .set    push                                    \n"
-               "       .set    noat                                    \n"
-               "       .set    mips3                                   \n"
-               "1:     ll      %0, %2                  # __cmpxchg_u32 \n"
-               "       bne     %0, %z3, 2f                             \n"
-               "       .set    mips0                                   \n"
-               "       move    $1, %z4                                 \n"
-               "       .set    mips3                                   \n"
-               "       sc      $1, %1                                  \n"
-               "       beqzl   $1, 1b                                  \n"
-               "2:                                                     \n"
-               "       .set    pop                                     \n"
-               : "=&r" (retval), "=R" (*m)
-               : "R" (*m), "Jr" (old), "Jr" (new)
-               : "memory");
-       } else if (cpu_has_llsc) {
-               __asm__ __volatile__(
-               "       .set    push                                    \n"
-               "       .set    noat                                    \n"
-               "       .set    mips3                                   \n"
-               "1:     ll      %0, %2                  # __cmpxchg_u32 \n"
-               "       bne     %0, %z3, 2f                             \n"
-               "       .set    mips0                                   \n"
-               "       move    $1, %z4                                 \n"
-               "       .set    mips3                                   \n"
-               "       sc      $1, %1                                  \n"
-               "       beqz    $1, 3f                                  \n"
-               "2:                                                     \n"
-               "       .subsection 2                                   \n"
-               "3:     b       1b                                      \n"
-               "       .previous                                       \n"
-               "       .set    pop                                     \n"
-               : "=&r" (retval), "=R" (*m)
-               : "R" (*m), "Jr" (old), "Jr" (new)
-               : "memory");
-       } else {
-               unsigned long flags;
-
-               raw_local_irq_save(flags);
-               retval = *m;
-               if (retval == old)
-                       *m = new;
-               raw_local_irq_restore(flags);   /* implies memory barrier  */
-       }
-
-       smp_llsc_mb();
-
-       return retval;
-}
-
-static inline unsigned long __cmpxchg_u32_local(volatile int * m,
-       unsigned long old, unsigned long new)
-{
-       __u32 retval;
-
-       if (cpu_has_llsc && R10000_LLSC_WAR) {
-               __asm__ __volatile__(
-               "       .set    push                                    \n"
-               "       .set    noat                                    \n"
-               "       .set    mips3                                   \n"
-               "1:     ll      %0, %2                  # __cmpxchg_u32 \n"
-               "       bne     %0, %z3, 2f                             \n"
-               "       .set    mips0                                   \n"
-               "       move    $1, %z4                                 \n"
-               "       .set    mips3                                   \n"
-               "       sc      $1, %1                                  \n"
-               "       beqzl   $1, 1b                                  \n"
-               "2:                                                     \n"
-               "       .set    pop                                     \n"
-               : "=&r" (retval), "=R" (*m)
-               : "R" (*m), "Jr" (old), "Jr" (new)
-               : "memory");
-       } else if (cpu_has_llsc) {
-               __asm__ __volatile__(
-               "       .set    push                                    \n"
-               "       .set    noat                                    \n"
-               "       .set    mips3                                   \n"
-               "1:     ll      %0, %2                  # __cmpxchg_u32 \n"
-               "       bne     %0, %z3, 2f                             \n"
-               "       .set    mips0                                   \n"
-               "       move    $1, %z4                                 \n"
-               "       .set    mips3                                   \n"
-               "       sc      $1, %1                                  \n"
-               "       beqz    $1, 1b                                  \n"
-               "2:                                                     \n"
-               "       .set    pop                                     \n"
-               : "=&r" (retval), "=R" (*m)
-               : "R" (*m), "Jr" (old), "Jr" (new)
-               : "memory");
-       } else {
-               unsigned long flags;
-
-               local_irq_save(flags);
-               retval = *m;
-               if (retval == old)
-                       *m = new;
-               local_irq_restore(flags);       /* implies memory barrier  */
-       }
-
-       return retval;
-}
-
-#ifdef CONFIG_64BIT
-static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
-       unsigned long new)
-{
-       __u64 retval;
-
-       if (cpu_has_llsc && R10000_LLSC_WAR) {
-               __asm__ __volatile__(
-               "       .set    push                                    \n"
-               "       .set    noat                                    \n"
-               "       .set    mips3                                   \n"
-               "1:     lld     %0, %2                  # __cmpxchg_u64 \n"
-               "       bne     %0, %z3, 2f                             \n"
-               "       move    $1, %z4                                 \n"
-               "       scd     $1, %1                                  \n"
-               "       beqzl   $1, 1b                                  \n"
-               "2:                                                     \n"
-               "       .set    pop                                     \n"
-               : "=&r" (retval), "=R" (*m)
-               : "R" (*m), "Jr" (old), "Jr" (new)
-               : "memory");
-       } else if (cpu_has_llsc) {
-               __asm__ __volatile__(
-               "       .set    push                                    \n"
-               "       .set    noat                                    \n"
-               "       .set    mips3                                   \n"
-               "1:     lld     %0, %2                  # __cmpxchg_u64 \n"
-               "       bne     %0, %z3, 2f                             \n"
-               "       move    $1, %z4                                 \n"
-               "       scd     $1, %1                                  \n"
-               "       beqz    $1, 3f                                  \n"
-               "2:                                                     \n"
-               "       .subsection 2                                   \n"
-               "3:     b       1b                                      \n"
-               "       .previous                                       \n"
-               "       .set    pop                                     \n"
-               : "=&r" (retval), "=R" (*m)
-               : "R" (*m), "Jr" (old), "Jr" (new)
-               : "memory");
-       } else {
-               unsigned long flags;
-
-               raw_local_irq_save(flags);
-               retval = *m;
-               if (retval == old)
-                       *m = new;
-               raw_local_irq_restore(flags);   /* implies memory barrier  */
-       }
-
-       smp_llsc_mb();
-
-       return retval;
-}
-
-static inline unsigned long __cmpxchg_u64_local(volatile int * m,
-       unsigned long old, unsigned long new)
-{
-       __u64 retval;
-
-       if (cpu_has_llsc && R10000_LLSC_WAR) {
-               __asm__ __volatile__(
-               "       .set    push                                    \n"
-               "       .set    noat                                    \n"
-               "       .set    mips3                                   \n"
-               "1:     lld     %0, %2                  # __cmpxchg_u64 \n"
-               "       bne     %0, %z3, 2f                             \n"
-               "       move    $1, %z4                                 \n"
-               "       scd     $1, %1                                  \n"
-               "       beqzl   $1, 1b                                  \n"
-               "2:                                                     \n"
-               "       .set    pop                                     \n"
-               : "=&r" (retval), "=R" (*m)
-               : "R" (*m), "Jr" (old), "Jr" (new)
-               : "memory");
-       } else if (cpu_has_llsc) {
-               __asm__ __volatile__(
-               "       .set    push                                    \n"
-               "       .set    noat                                    \n"
-               "       .set    mips3                                   \n"
-               "1:     lld     %0, %2                  # __cmpxchg_u64 \n"
-               "       bne     %0, %z3, 2f                             \n"
-               "       move    $1, %z4                                 \n"
-               "       scd     $1, %1                                  \n"
-               "       beqz    $1, 1b                                  \n"
-               "2:                                                     \n"
-               "       .set    pop                                     \n"
-               : "=&r" (retval), "=R" (*m)
-               : "R" (*m), "Jr" (old), "Jr" (new)
-               : "memory");
-       } else {
-               unsigned long flags;
-
-               local_irq_save(flags);
-               retval = *m;
-               if (retval == old)
-                       *m = new;
-               local_irq_restore(flags);       /* implies memory barrier  */
-       }
-
-       return retval;
-}
-
-#else
-extern unsigned long __cmpxchg_u64_unsupported_on_32bit_kernels(
-       volatile int * m, unsigned long old, unsigned long new);
-#define __cmpxchg_u64 __cmpxchg_u64_unsupported_on_32bit_kernels
-extern unsigned long __cmpxchg_u64_local_unsupported_on_32bit_kernels(
-       volatile int * m, unsigned long old, unsigned long new);
-#define __cmpxchg_u64_local __cmpxchg_u64_local_unsupported_on_32bit_kernels
-#endif
-
-/* This function doesn't exist, so you'll get a linker error
-   if something tries to do an invalid cmpxchg().  */
-extern void __cmpxchg_called_with_bad_pointer(void);
-
-static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
-       unsigned long new, int size)
-{
-       switch (size) {
-       case 4:
-               return __cmpxchg_u32(ptr, old, new);
-       case 8:
-               return __cmpxchg_u64(ptr, old, new);
-       }
-       __cmpxchg_called_with_bad_pointer();
-       return old;
-}
-
-static inline unsigned long __cmpxchg_local(volatile void * ptr,
-       unsigned long old, unsigned long new, int size)
-{
-       switch (size) {
-       case 4:
-               return __cmpxchg_u32_local(ptr, old, new);
-       case 8:
-               return __cmpxchg_u64_local(ptr, old, new);
-       }
-       __cmpxchg_called_with_bad_pointer();
-       return old;
-}
-
-#define cmpxchg(ptr,old,new) \
-       ((__typeof__(*(ptr)))__cmpxchg((ptr), \
-               (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr))))
-
-#define cmpxchg_local(ptr,old,new) \
-       ((__typeof__(*(ptr)))__cmpxchg_local((ptr), \
-               (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr))))
-
 extern void set_handler (unsigned long offset, void *addr, unsigned long len);
 extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len);
 
index 0d5cc04ab005db06809770d4b551c4475382569e..dc4f5950dafaab9a074c9845c56b2f4de6f72abc 100644 (file)
@@ -16,8 +16,9 @@
 #define        flat_argvp_envp_on_stack()              0
 #define        flat_old_ram_flag(flags)                (flags)
 #define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
-#define        flat_get_addr_from_rp(rp, relval, flags)        get_unaligned(rp)
+#define        flat_get_addr_from_rp(rp, relval, flags, p)     get_unaligned(rp)
 #define        flat_put_addr_at_rp(rp, val, relval)    put_unaligned(val,rp)
 #define        flat_get_relocate_addr(rel)             (rel)
+#define        flat_set_persistent(relval, p)          0
 
 #endif /* __ASM_SH_FLAT_H */
index 3888f59d6881494bcbd7f4d183846d1ba62896c9..17f0ea566611bfffe443462903333b7e49c49901 100644 (file)
@@ -25,6 +25,7 @@
 #define        flat_stack_align(sp)            /* nothing needed */
 #define        flat_argvp_envp_on_stack()      0
 #define        flat_old_ram_flag(flags)        (flags)
+#define        flat_set_persistent(relval, p)  0
 
 /* We store the type of relocation in the top 4 bits of the `relval.' */
 
@@ -46,7 +47,8 @@ flat_get_relocate_addr (unsigned long relval)
    For the v850, RP should always be half-word aligned.  */
 static inline unsigned long flat_get_addr_from_rp (unsigned long *rp,
                                                   unsigned long relval,
-                                                  unsigned long flags)
+                                                  unsigned long flags,
+                                                  unsigned long *persistent)
 {
        short *srp = (short *)rp;
 
index 19525175b91c2a7793bf463c4e78eba925030d3c..31f579b828f232de4789f515b3aa5c1d633e46a1 100644 (file)
@@ -371,7 +371,7 @@ static inline void sync_core(void)
 #define ARCH_HAS_PREFETCH
 static inline void prefetch(void *x) 
 { 
-       asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x));
+       asm volatile("prefetcht0 (%0)" :: "r" (x));
 } 
 
 #define ARCH_HAS_PREFETCHW 1
index ca8cac11bd2cf4930533f306a0209bbbea0e9c31..c0e7741a98de961f555e3971dad2e82ef5d8a87c 100644 (file)
@@ -2307,13 +2307,14 @@ oom:
  * do not need to flush old virtual caches or the TLB.
  *
  * We enter with non-exclusive mmap_sem (to exclude vma changes,
- * but allow concurrent faults), and pte mapped but not yet locked.
+ * but allow concurrent faults), and pte neither mapped nor locked.
  * We return with mmap_sem still held, but pte unmapped and unlocked.
  */
 static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
-               unsigned long address, pte_t *page_table, pmd_t *pmd,
+               unsigned long address, pmd_t *pmd,
                pgoff_t pgoff, unsigned int flags, pte_t orig_pte)
 {
+       pte_t *page_table;
        spinlock_t *ptl;
        struct page *page;
        pte_t entry;
@@ -2327,7 +2328,6 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
        vmf.flags = flags;
        vmf.page = NULL;
 
-       pte_unmap(page_table);
        BUG_ON(vma->vm_flags & VM_PFNMAP);
 
        if (likely(vma->vm_ops->fault)) {
@@ -2468,8 +2468,8 @@ static int do_linear_fault(struct mm_struct *mm, struct vm_area_struct *vma,
                        - vma->vm_start) >> PAGE_CACHE_SHIFT) + vma->vm_pgoff;
        unsigned int flags = (write_access ? FAULT_FLAG_WRITE : 0);
 
-       return __do_fault(mm, vma, address, page_table, pmd, pgoff,
-                                                       flags, orig_pte);
+       pte_unmap(page_table);
+       return __do_fault(mm, vma, address, pmd, pgoff, flags, orig_pte);
 }
 
 
@@ -2552,9 +2552,7 @@ static int do_nonlinear_fault(struct mm_struct *mm, struct vm_area_struct *vma,
        }
 
        pgoff = pte_to_pgoff(orig_pte);
-
-       return __do_fault(mm, vma, address, page_table, pmd, pgoff,
-                                                       flags, orig_pte);
+       return __do_fault(mm, vma, address, pmd, pgoff, flags, orig_pte);
 }
 
 /*
index 442b9875f3fb84acfe9b0577bfc4869944ee0c79..5742dc803b796af7423f36cf871ce60e74fe62fc 100644 (file)
@@ -114,7 +114,7 @@ check_assoc_again:
        sm->associnfo.associating = 1;
        /* queue lower level code to do work (if necessary) */
        schedule_delayed_work(&sm->associnfo.work, 0);
-out:
+
        mutex_unlock(&sm->associnfo.mutex);
 
        return 0;