Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 18 Aug 2007 16:38:56 +0000 (09:38 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 18 Aug 2007 16:38:56 +0000 (09:38 -0700)
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  Cross-compilation between e.g. i386 -> 64bit could break -> work around it
  [IA64] Enable early console for Ski simulator
  [IA64] forbid ptrace changes psr.ri to 3
  [IA64] Failure to grow RBS
  [IA64] Fix processor_get_freq
  [IA64] SGI Altix : fix a force_interrupt bug on altix
  [IA64] Update arch/ia64/configs/* s/SLAB/SLUB/
  [IA64] get back PT_IA_64_UNWIND program header
  [IA64] need NOTES in vmlinux.lds.S
  [IA64] make unwinder stop at last frame of the bootloader
  [IA64] Clean up CPE handler registration
  [IA64] Include Kconfig.preempt
  [IA64] SN2 needs platform specific irq_to_vector() function.
  [IA64] Use atomic64_read to read an atomic64_t.
  [IA64] disable irq's and check need_resched before safe_halt

131 files changed:
MAINTAINERS
arch/avr32/boards/atngw100/setup.c
arch/avr32/boards/atstk1000/Kconfig
arch/avr32/boards/atstk1000/atstk1002.c
arch/i386/boot/edd.c
arch/i386/boot/video.c
arch/powerpc/boot/flatdevtree.c
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/misc_32.S
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/platforms/cell/spu_syscalls.c
arch/powerpc/platforms/ps3/device-init.c
arch/ppc/kernel/misc.S
arch/sparc/kernel/ebus.c
arch/sparc/mm/init.c
arch/sparc/mm/io-unit.c
arch/sparc/mm/iommu.c
arch/sparc/mm/sun4c.c
arch/sparc64/kernel/head.S
arch/sparc64/kernel/mdesc.c
arch/sparc64/kernel/trampoline.S
arch/sparc64/lib/Makefile
arch/sparc64/lib/NG2copy_from_user.S [new file with mode: 0644]
arch/sparc64/lib/NG2copy_to_user.S [new file with mode: 0644]
arch/sparc64/lib/NG2memcpy.S [new file with mode: 0644]
arch/sparc64/lib/NG2page.S [new file with mode: 0644]
arch/sparc64/lib/NG2patch.S [new file with mode: 0644]
arch/sparc64/lib/NGpage.S
drivers/acpi/ec.c
drivers/ata/ata_piix.c
drivers/ata/libata-core.c
drivers/ata/pata_artop.c
drivers/ata/pata_hpt37x.c
drivers/ata/pata_hpt3x2n.c
drivers/ata/pata_isapnp.c
drivers/ata/sata_mv.c
drivers/atm/fore200e.c
drivers/atm/iphase.c
drivers/atm/lanai.c
drivers/dma/ioatdma.c
drivers/dma/ioatdma.h
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-iop3xx.c
drivers/i2c/busses/i2c-mpc.c
drivers/i2c/busses/i2c-mv64xxx.c
drivers/i2c/busses/i2c-s3c2410.c
drivers/i2c/chips/isp1301_omap.c
drivers/i2c/chips/menelaus.c
drivers/infiniband/core/agent.c
drivers/infiniband/core/agent.h
drivers/infiniband/core/device.c
drivers/infiniband/core/mad.c
drivers/infiniband/core/mad_rmpp.c
drivers/infiniband/core/sa_query.c
drivers/infiniband/core/umem.c
drivers/infiniband/hw/cxgb3/iwch_cm.c
drivers/infiniband/hw/mlx4/cq.c
drivers/infiniband/hw/mlx4/mad.c
drivers/infiniband/ulp/ipoib/ipoib_verbs.c
drivers/infiniband/ulp/srp/ib_srp.c
drivers/net/3c59x.c
drivers/net/ax88796.c
drivers/net/bonding/bond_main.c
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_hw.c
drivers/net/e1000/e1000_hw.h
drivers/net/e1000/e1000_main.c
drivers/net/irda/irda-usb.c
drivers/net/mlx4/reset.c
drivers/net/myri10ge/myri10ge.c
drivers/net/natsemi.c
drivers/net/via-rhine.c
drivers/net/wan/hdlc_fr.c
drivers/net/xen-netfront.c
fs/cifs/CHANGES
fs/cifs/README
fs/cifs/TODO
fs/cifs/file.c
fs/cifs/sess.c
fs/dlm/lock.c
fs/dlm/lowcomms.c
fs/dlm/member.c
fs/dlm/rcom.c
fs/exec.c
fs/gfs2/lops.c
fs/gfs2/mount.c
fs/gfs2/ops_address.c
fs/gfs2/ops_file.c
fs/gfs2/rgrp.c
include/asm-avr32/io.h
include/asm-avr32/pgalloc.h
include/asm-avr32/pgtable.h
include/asm-sparc/sbus.h
include/asm-sparc/sfp-machine.h
include/asm-sparc64/elf.h
include/asm-sparc64/sfp-machine.h
include/linux/netdevice.h
include/math-emu/op-common.h
include/math-emu/soft-fp.h
include/rdma/ib_mad.h
include/rdma/ib_verbs.h
net/8021q/vlanproc.c
net/atm/lec.c
net/ax25/ax25_iface.c
net/bridge/br_device.c
net/bridge/br_if.c
net/bridge/br_stp_if.c
net/bridge/br_sysfs_br.c
net/core/dev.c
net/core/ethtool.c
net/dccp/ccid.c
net/dccp/feat.c
net/econet/af_econet.c
net/ipv4/ip_output.c
net/ipv4/ipconfig.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/nf_nat_sip.c
net/ipv6/ipv6_sockglue.c
net/ipv6/tcp_ipv6.c
net/mac80211/ieee80211.c
net/mac80211/ieee80211_sta.c
net/netfilter/nf_conntrack_sip.c
net/netfilter/xt_u32.c
net/sched/act_police.c
net/socket.c
net/sunrpc/auth_gss/svcauth_gss.c
net/tipc/port.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_state.c
security/selinux/ss/services.c

index d3a0684945b41e3a5c39a684a391d6011b823f53..371fe67a4eef3eb4bfe00039ea895da2a2c318c8 100644 (file)
@@ -97,6 +97,12 @@ M:   philb@gnu.org
 L:     netdev@vger.kernel.org
 S:     Maintained
 
+3C59X NETWORK DRIVER
+P:     Steffen Klassert
+M:     klassert@mathematik.tu-chemnitz.de
+L:     netdev@vger.kernel.org
+S:     Maintained
+
 3CR990 NETWORK DRIVER
 P:     David Dillow
 M:     dave@thedillows.org
@@ -1003,7 +1009,7 @@ P:        Steve French
 M:     sfrench@samba.org
 L:     linux-cifs-client@lists.samba.org
 L:     samba-technical@lists.samba.org
-W:     http://us1.samba.org/samba/Linux_CIFS_client.html
+W:     http://linux-cifs.samba.org/
 T:     git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
 S:     Supported
 
index 2edcecdea8bdd3402c2e323e0afceb7c7937bb83..ef801563bbf58930cfb90762a345b0d480c99841 100644 (file)
@@ -9,6 +9,7 @@
  */
 #include <linux/clk.h>
 #include <linux/etherdevice.h>
+#include <linux/i2c-gpio.h>
 #include <linux/init.h>
 #include <linux/linkage.h>
 #include <linux/platform_device.h>
@@ -123,6 +124,19 @@ static struct platform_device ngw_gpio_leds = {
        }
 };
 
+static struct i2c_gpio_platform_data i2c_gpio_data = {
+       .sda_pin        = GPIO_PIN_PA(6),
+       .scl_pin        = GPIO_PIN_PA(7),
+};
+
+static struct platform_device i2c_gpio_device = {
+       .name           = "i2c-gpio",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &i2c_gpio_data,
+       },
+};
+
 static int __init atngw100_init(void)
 {
        unsigned        i;
@@ -147,6 +161,10 @@ static int __init atngw100_init(void)
        }
        platform_device_register(&ngw_gpio_leds);
 
+       at32_select_gpio(i2c_gpio_data.sda_pin, 0);
+       at32_select_gpio(i2c_gpio_data.scl_pin, 0);
+       platform_device_register(&i2c_gpio_device);
+
        return 0;
 }
 postcore_initcall(atngw100_init);
index 71bc7d364fb7c17ee8f1884f6f58d64732aedfa2..718578f640691c2e9b692c1b98acf53e6d7b5ca1 100644 (file)
@@ -50,4 +50,30 @@ config BOARD_ATSTK1002_SPI1
          GPIO lines and accessed through the J1 jumper block.  Say "y"
          here to configure that SPI controller.
 
+config BOARD_ATSTK1002_J2_LED
+       bool
+       default BOARD_ATSTK1002_J2_LED8 || BOARD_ATSTK1002_J2_RGB
+
+choice
+       prompt "LEDs connected to J2:"
+       depends on LEDS_GPIO && !BOARD_ATSTK1002_SW4_CUSTOM
+       optional
+       help
+         Select this if you have jumpered the J2 jumper block to the
+         LED0..LED7 amber leds, or to the RGB leds, using a ten-pin
+         IDC cable.  A default "heartbeat" trigger is provided, but
+         you can of course override this.
+
+config BOARD_ATSTK1002_J2_LED8
+       bool "LED0..LED7"
+       help
+         Select this if J2 is jumpered to LED0..LED7 amber leds.
+
+config BOARD_ATSTK1002_J2_RGB
+       bool "RGB leds"
+       help
+         Select this if J2 is jumpered to the RGB leds.
+
+endchoice
+
 endif  # stk 1002
index cb93eabb9c6c4145947df0bda8afaefd0d734340..c9981b731efa58e1d20aecee60222081ed813b06 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/etherdevice.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/leds.h>
 #include <linux/platform_device.h>
 #include <linux/string.h>
 #include <linux/types.h>
@@ -120,6 +121,65 @@ static void __init set_hw_addr(struct platform_device *pdev)
        clk_put(pclk);
 }
 
+#ifdef CONFIG_BOARD_ATSTK1002_J2_LED
+
+static struct gpio_led stk_j2_led[] = {
+#ifdef CONFIG_BOARD_ATSTK1002_J2_LED8
+#define LEDSTRING "J2 jumpered to LED8"
+       { .name = "led0:amber", .gpio = GPIO_PIN_PB( 8), },
+       { .name = "led1:amber", .gpio = GPIO_PIN_PB( 9), },
+       { .name = "led2:amber", .gpio = GPIO_PIN_PB(10), },
+       { .name = "led3:amber", .gpio = GPIO_PIN_PB(13), },
+       { .name = "led4:amber", .gpio = GPIO_PIN_PB(14), },
+       { .name = "led5:amber", .gpio = GPIO_PIN_PB(15), },
+       { .name = "led6:amber", .gpio = GPIO_PIN_PB(16), },
+       { .name = "led7:amber", .gpio = GPIO_PIN_PB(30),
+                       .default_trigger = "heartbeat", },
+#else  /* RGB */
+#define LEDSTRING "J2 jumpered to RGB LEDs"
+       { .name = "r1:red",     .gpio = GPIO_PIN_PB( 8), },
+       { .name = "g1:green",   .gpio = GPIO_PIN_PB(10), },
+       { .name = "b1:blue",    .gpio = GPIO_PIN_PB(14), },
+
+       { .name = "r2:red",     .gpio = GPIO_PIN_PB( 9),
+                       .default_trigger = "heartbeat", },
+       { .name = "g2:green",   .gpio = GPIO_PIN_PB(13), },
+       { .name = "b2:blue",    .gpio = GPIO_PIN_PB(15),
+                       .default_trigger = "heartbeat", },
+       /* PB16, PB30 unused */
+#endif
+};
+
+static struct gpio_led_platform_data stk_j2_led_data = {
+       .num_leds       = ARRAY_SIZE(stk_j2_led),
+       .leds           = stk_j2_led,
+};
+
+static struct platform_device stk_j2_led_dev = {
+       .name           = "leds-gpio",
+       .id             = 2,    /* gpio block J2 */
+       .dev            = {
+               .platform_data  = &stk_j2_led_data,
+       },
+};
+
+static void setup_j2_leds(void)
+{
+       unsigned        i;
+
+       for (i = 0; i < ARRAY_SIZE(stk_j2_led); i++)
+               at32_select_gpio(stk_j2_led[i].gpio, AT32_GPIOF_OUTPUT);
+
+       printk("STK1002: " LEDSTRING "\n");
+       platform_device_register(&stk_j2_led_dev);
+}
+
+#else
+static void setup_j2_leds(void)
+{
+}
+#endif
+
 void __init setup_board(void)
 {
 #ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM
@@ -185,6 +245,8 @@ static int __init atstk1002_init(void)
        at32_add_device_ssc(0, ATMEL_SSC_TX);
 #endif
 
+       setup_j2_leds();
+
        return 0;
 }
 postcore_initcall(atstk1002_init);
index 658834d9f92a098acc2de75a1a5e9c028540b254..82b5c846a194acae54c1275150a76edf53d52518 100644 (file)
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
 
-struct edd_dapa {
-       u8      pkt_size;
-       u8      rsvd;
-       u16     sector_cnt;
-       u16     buf_off, buf_seg;
-       u64     lba;
-       u64     buf_lin_addr;
-};
-
 /*
  * Read the MBR (first sector) from a specific device.
  */
 static int read_mbr(u8 devno, void *buf)
 {
-       struct edd_dapa dapa;
-       u16 ax, bx, cx, dx, si;
-
-       memset(&dapa, 0, sizeof dapa);
-       dapa.pkt_size = sizeof(dapa);
-       dapa.sector_cnt = 1;
-       dapa.buf_off = (size_t)buf;
-       dapa.buf_seg = ds();
-       /* dapa.lba = 0; */
-
-       ax = 0x4200;            /* Extended Read */
-       si = (size_t)&dapa;
-       dx = devno;
-       asm("pushfl; stc; int $0x13; setc %%al; popfl"
-           : "+a" (ax), "+S" (si), "+d" (dx)
-           : "m" (dapa)
-           : "ebx", "ecx", "edi", "memory");
-
-       if (!(u8)ax)
-               return 0;       /* OK */
+       u16 ax, bx, cx, dx;
 
        ax = 0x0201;            /* Legacy Read, one sector */
        cx = 0x0001;            /* Sector 0-0-1 */
@@ -65,11 +37,10 @@ static int read_mbr(u8 devno, void *buf)
        return -(u8)ax;         /* 0 or -1 */
 }
 
-static u32 read_mbr_sig(u8 devno, struct edd_info *ei)
+static u32 read_mbr_sig(u8 devno, struct edd_info *ei, u32 *mbrsig)
 {
        int sector_size;
        char *mbrbuf_ptr, *mbrbuf_end;
-       u32 mbrsig;
        u32 buf_base, mbr_base;
        extern char _end[];
 
@@ -85,15 +56,15 @@ static u32 read_mbr_sig(u8 devno, struct edd_info *ei)
 
        /* Make sure we actually have space on the heap... */
        if (!(boot_params.hdr.loadflags & CAN_USE_HEAP))
-               return 0;
+               return -1;
        if (mbrbuf_end > (char *)(size_t)boot_params.hdr.heap_end_ptr)
-               return 0;
+               return -1;
 
        if (read_mbr(devno, mbrbuf_ptr))
-               return 0;
+               return -1;
 
-       mbrsig = *(u32 *)&mbrbuf_ptr[EDD_MBR_SIG_OFFSET];
-       return mbrsig;
+       *mbrsig = *(u32 *)&mbrbuf_ptr[EDD_MBR_SIG_OFFSET];
+       return 0;
 }
 
 static int get_edd_info(u8 devno, struct edd_info *ei)
@@ -160,6 +131,7 @@ void query_edd(void)
        int do_edd = 1;
        int devno;
        struct edd_info ei, *edp;
+       u32 *mbrptr;
 
        if (cmdline_find_option("edd", eddarg, sizeof eddarg) > 0) {
                if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip"))
@@ -168,7 +140,8 @@ void query_edd(void)
                        do_edd = 0;
        }
 
-       edp = (struct edd_info *)boot_params.eddbuf;
+       edp    = boot_params.eddbuf;
+       mbrptr = boot_params.edd_mbr_sig_buffer;
 
        if (!do_edd)
                return;
@@ -186,11 +159,8 @@ void query_edd(void)
                        boot_params.eddbuf_entries++;
                }
 
-               if (do_mbr) {
-                       u32 mbr_sig;
-                       mbr_sig = read_mbr_sig(devno, &ei);
-                       boot_params.edd_mbr_sig_buffer[devno-0x80] = mbr_sig;
-               }
+               if (do_mbr && !read_mbr_sig(devno, &ei, mbrptr++))
+                       boot_params.edd_mbr_sig_buf_entries = devno-0x80+1;
        }
 }
 
index 958130ef004296c02f79614838152f0e1beae102..693f20d3102e9322759adca6834f2de4e159d0a1 100644 (file)
@@ -61,7 +61,7 @@ static void store_video_mode(void)
 
        /* Not all BIOSes are clean with respect to the top bit */
        boot_params.screen_info.orig_video_mode = ax & 0x7f;
-       boot_params.screen_info.orig_video_page = page;
+       boot_params.screen_info.orig_video_page = page >> 8;
 }
 
 /*
index b732644788db799f83c6c90921ac14cd5f4e8069..13761bf160c406c4b4e29fb9fa8b869db35886f5 100644 (file)
@@ -134,20 +134,6 @@ static char *ft_next(struct ft_cxt *cxt, char *p, struct ft_atom *ret)
 #define HDR_SIZE       _ALIGN(sizeof(struct boot_param_header), 8)
 #define EXPAND_INCR    1024    /* alloc this much extra when expanding */
 
-/* See if the regions are in the standard order and non-overlapping */
-static int ft_ordered(struct ft_cxt *cxt)
-{
-       char *p = (char *)cxt->bph + HDR_SIZE;
-       enum ft_rgn_id r;
-
-       for (r = FT_RSVMAP; r <= FT_STRINGS; ++r) {
-               if (p > cxt->rgn[r].start)
-                       return 0;
-               p = cxt->rgn[r].start + cxt->rgn[r].size;
-       }
-       return p <= (char *)cxt->bph + cxt->max_size;
-}
-
 /* Copy the tree to a newly-allocated region and put things in order */
 static int ft_reorder(struct ft_cxt *cxt, int nextra)
 {
@@ -573,10 +559,6 @@ int ft_open(struct ft_cxt *cxt, void *blob, unsigned int max_size,
        cxt->rgn[FT_STRUCT].size = struct_size(cxt);
        cxt->rgn[FT_STRINGS].start = blob + be32_to_cpu(bph->off_dt_strings);
        cxt->rgn[FT_STRINGS].size = be32_to_cpu(bph->dt_strings_size);
-       /* Leave as '0' to force first ft_make_space call to do a ft_reorder
-        * and move dt to an area allocated by realloc.
-       cxt->isordered = ft_ordered(cxt);
-       */
 
        cxt->p = cxt->rgn[FT_STRUCT].start;
        cxt->str_anchor = cxt->rgn[FT_STRINGS].start;
index f39a72f30aadb81543fd3873491ccf94689b4d85..b0cb2e662c25a6e14f3b8e708a46993422c5e19f 100644 (file)
@@ -81,6 +81,7 @@ obj-y                         += iomap.o
 endif
 
 ifeq ($(CONFIG_PPC_ISERIES),y)
+CFLAGS_lparmap.s               += -g0
 extra-y += lparmap.s
 $(obj)/head_64.o:      $(obj)/lparmap.s
 AFLAGS_head_64.o += -I$(obj)
index e708ab7ca9e845968a6b71d910ecbaaa3f64c6e2..8533de50347d5284b23cbe0538673ba74b6b95fe 100644 (file)
@@ -301,9 +301,19 @@ _GLOBAL(_tlbie)
        mfspr   r4,SPRN_MMUCR
        mfspr   r5,SPRN_PID                     /* Get PID */
        rlwimi  r4,r5,0,24,31                   /* Set TID */
-       mtspr   SPRN_MMUCR,r4
 
+       /* We have to run the search with interrupts disabled, even critical
+        * and debug interrupts (in fact the only critical exceptions we have
+        * are debug and machine check).  Otherwise  an interrupt which causes
+        * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
+       mfmsr   r5
+       lis     r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
+       addi    r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
+       andc    r6,r5,r6
+       mtmsr   r6
+       mtspr   SPRN_MMUCR,r4
        tlbsx.  r3, 0, r3
+       mtmsr   r5
        bne     10f
        sync
        /* There are only 64 TLB entries, so r3 < 64,
index f1789578747aa340c7cf3cc7cc006f3f8ef39a98..a47151e806cae072c1836b49f4c3c8630a4c2bd0 100644 (file)
@@ -795,7 +795,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
 
 #ifdef CONFIG_PPC_MM_SLICES
        /* We only prefault standard pages for now */
-       if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize));
+       if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize))
                return;
 #endif
 
index dd2c6688c8aaa6f0bad47ab8b160856b24c34290..027ac32cc63659c8c2af89270041742dcb96e345 100644 (file)
@@ -45,6 +45,7 @@ asmlinkage long sys_spu_create(const char __user *name,
        if (owner && try_module_get(owner)) {
                if (flags & SPU_CREATE_AFFINITY_SPU) {
                        neighbor = fget_light(neighbor_fd, &fput_needed);
+                       ret = -EBADF;
                        if (neighbor) {
                                ret = spufs_calls.create_thread(name, flags,
                                                                mode, neighbor);
index e23a5a874ad39ae436152ad0475df49a1f48ae8d..ce15cada88d4ed992b478d828e8f896b0e6f85be 100644 (file)
@@ -372,7 +372,7 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
                    notify_event->dev_type == repo->dev_type) {
                        pr_debug("%s:%u: device ready: dev_id %u\n", __func__,
                                 __LINE__, repo->dev_id);
-                       result = 0;
+                       error = 0;
                        break;
                }
 
index 0da55368655c90a0018504d79c0125fd51326e25..a22e1f4d94c82edd1c3ee92d7ea491b82a716b30 100644 (file)
@@ -237,9 +237,19 @@ _GLOBAL(_tlbie)
        mfspr   r4,SPRN_MMUCR
        mfspr   r5,SPRN_PID                     /* Get PID */
        rlwimi  r4,r5,0,24,31                   /* Set TID */
-       mtspr   SPRN_MMUCR,r4
 
+       /* We have to run the search with interrupts disabled, even critical
+        * and debug interrupts (in fact the only critical exceptions we have
+        * are debug and machine check).  Otherwise  an interrupt which causes
+        * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
+       mfmsr   r5
+       lis     r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
+       addi    r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
+       andc    r6,r5,r6
+       mtmsr   r6
+       mtspr   SPRN_MMUCR,r4
        tlbsx.  r3, 0, r3
+       mtmsr   r5
        bne     10f
        sync
        /* There are only 64 TLB entries, so r3 < 64,
index ac352eb6dff3beb4753cefc885078c87284c053e..e2d02fd13f35f6284d7f54fe4352d60b9279dd12 100644 (file)
@@ -238,6 +238,7 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
        sd = &dev->ofdev.dev.archdata;
        sd->prom_node = dp;
        sd->op = &dev->ofdev;
+       sd->iommu = dev->bus->ofdev.dev.parent->archdata.iommu;
 
        dev->ofdev.node = dp;
        dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
index a1bef07755a920076d186880269af56f5f9348db..c13e6cd279ac0bae8ad49043b9c11f73310f349e 100644 (file)
@@ -206,8 +206,7 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
 #ifdef CONFIG_BLK_DEV_INITRD
        /* Now have to check initial ramdisk, so that bootmap does not overwrite it */
        if (sparc_ramdisk_image) {
-               if (sparc_ramdisk_image >= (unsigned long)&_end - 2 * PAGE_SIZE)
-                       sparc_ramdisk_image -= KERNBASE;
+               sparc_ramdisk_image -= KERNBASE;
                initrd_start = sparc_ramdisk_image + phys_base;
                initrd_end = initrd_start + sparc_ramdisk_size;
                if (initrd_end > end_of_phys_memory) {
index 4ccda77d08d6bf7d180036f09d452b2813784676..7c89893b1fe8789e71a05694660540ac943bb4c8 100644 (file)
@@ -66,7 +66,7 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus)
        }
        if(!xpt) panic("Cannot map External Page Table.");
        
-       sbus->iommu = (struct iommu_struct *)iounit;
+       sbus->ofdev.dev.archdata.iommu = iounit;
        iounit->page_table = xpt;
        spin_lock_init(&iounit->lock);
        
@@ -127,7 +127,7 @@ nexti:      scan = find_next_zero_bit(iounit->bmap, limit, scan);
 static __u32 iounit_get_scsi_one(char *vaddr, unsigned long len, struct sbus_bus *sbus)
 {
        unsigned long ret, flags;
-       struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
+       struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu;
        
        spin_lock_irqsave(&iounit->lock, flags);
        ret = iounit_get_area(iounit, (unsigned long)vaddr, len);
@@ -138,7 +138,7 @@ static __u32 iounit_get_scsi_one(char *vaddr, unsigned long len, struct sbus_bus
 static void iounit_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus *sbus)
 {
        unsigned long flags;
-       struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
+       struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu;
 
        /* FIXME: Cache some resolved pages - often several sg entries are to the same page */
        spin_lock_irqsave(&iounit->lock, flags);
@@ -153,7 +153,7 @@ static void iounit_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus
 static void iounit_release_scsi_one(__u32 vaddr, unsigned long len, struct sbus_bus *sbus)
 {
        unsigned long flags;
-       struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
+       struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu;
        
        spin_lock_irqsave(&iounit->lock, flags);
        len = ((vaddr & ~PAGE_MASK) + len + (PAGE_SIZE-1)) >> PAGE_SHIFT;
@@ -168,7 +168,7 @@ static void iounit_release_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_
 {
        unsigned long flags;
        unsigned long vaddr, len;
-       struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
+       struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu;
 
        spin_lock_irqsave(&iounit->lock, flags);
        while (sz != 0) {
@@ -211,7 +211,7 @@ static int iounit_map_dma_area(dma_addr_t *pba, unsigned long va, __u32 addr, in
                        i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT);
 
                        for_each_sbus(sbus) {
-                               struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
+                               struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu;
 
                                iopte = (iopte_t *)(iounit->page_table + i);
                                *iopte = MKIOPTE(__pa(page));
@@ -235,7 +235,7 @@ static void iounit_unmap_dma_area(unsigned long addr, int len)
 static struct page *iounit_translate_dvma(unsigned long addr)
 {
        struct sbus_bus *sbus = sbus_root;      /* They are all the same */
-       struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
+       struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu;
        int i;
        iopte_t *iopte;
 
@@ -279,7 +279,7 @@ __u32 iounit_map_dma_init(struct sbus_bus *sbus, int size)
        unsigned long rotor, scan, limit;
        unsigned long flags;
        __u32 ret;
-       struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
+       struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu;
 
         npages = (size + (PAGE_SIZE-1)) >> PAGE_SHIFT;
        i = 0x0213;
@@ -315,7 +315,7 @@ nexti:      scan = find_next_zero_bit(iounit->bmap, limit, scan);
 __u32 iounit_map_dma_page(__u32 vaddr, void *addr, struct sbus_bus *sbus)
 {
        int scan = (vaddr - IOUNIT_DMA_BASE) >> PAGE_SHIFT;
-       struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
+       struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu;
        
        iounit->page_table[scan] = MKIOPTE(__pa(((unsigned long)addr) & PAGE_MASK));
        return vaddr + (((unsigned long)addr) & ~PAGE_MASK);
index be042efd1ba4311b6060a92f565f492e6fe04c6d..52e907af9d29e7b248a09b60987432cfe017cb9a 100644 (file)
@@ -132,7 +132,7 @@ iommu_init(int iommund, struct sbus_bus *sbus)
            impl, vers, iommu->page_table,
            (int)(IOMMU_NPTES*sizeof(iopte_t)), (int)IOMMU_NPTES);
 
-       sbus->iommu = iommu;
+       sbus->ofdev.dev.archdata.iommu = iommu;
 }
 
 /* This begs to be btfixup-ed by srmmu. */
@@ -166,7 +166,7 @@ static void iommu_flush_iotlb(iopte_t *iopte, unsigned int niopte)
 
 static u32 iommu_get_one(struct page *page, int npages, struct sbus_bus *sbus)
 {
-       struct iommu_struct *iommu = sbus->iommu;
+       struct iommu_struct *iommu = sbus->ofdev.dev.archdata.iommu;
        int ioptex;
        iopte_t *iopte, *iopte0;
        unsigned int busa, busa0;
@@ -291,7 +291,7 @@ static void iommu_get_scsi_sgl_pflush(struct scatterlist *sg, int sz, struct sbu
 
 static void iommu_release_one(u32 busa, int npages, struct sbus_bus *sbus)
 {
-       struct iommu_struct *iommu = sbus->iommu;
+       struct iommu_struct *iommu = sbus->ofdev.dev.archdata.iommu;
        int ioptex;
        int i;
 
@@ -334,7 +334,7 @@ static int iommu_map_dma_area(dma_addr_t *pba, unsigned long va,
     unsigned long addr, int len)
 {
        unsigned long page, end;
-       struct iommu_struct *iommu = sbus_root->iommu;
+       struct iommu_struct *iommu = sbus_root->ofdev.dev.archdata.iommu;
        iopte_t *iopte = iommu->page_table;
        iopte_t *first;
        int ioptex;
@@ -399,7 +399,7 @@ static int iommu_map_dma_area(dma_addr_t *pba, unsigned long va,
 
 static void iommu_unmap_dma_area(unsigned long busa, int len)
 {
-       struct iommu_struct *iommu = sbus_root->iommu;
+       struct iommu_struct *iommu = sbus_root->ofdev.dev.archdata.iommu;
        iopte_t *iopte = iommu->page_table;
        unsigned long end;
        int ioptex = (busa - iommu->start) >> PAGE_SHIFT;
@@ -420,7 +420,7 @@ static void iommu_unmap_dma_area(unsigned long busa, int len)
 
 static struct page *iommu_translate_dvma(unsigned long busa)
 {
-       struct iommu_struct *iommu = sbus_root->iommu;
+       struct iommu_struct *iommu = sbus_root->ofdev.dev.archdata.iommu;
        iopte_t *iopte = iommu->page_table;
 
        iopte += ((busa - iommu->start) >> PAGE_SHIFT);
index 79d60d86f6f8785b11dbf09c75bb8ef6ecc5f3ae..005a3e72d4f2dbf468b6a31a47d85c8ed507ebab 100644 (file)
@@ -268,7 +268,6 @@ static inline void sun4c_init_clean_mmu(unsigned long kernel_end)
        unsigned char savectx, ctx;
 
        savectx = sun4c_get_context();
-       kernel_end = SUN4C_REAL_PGDIR_ALIGN(kernel_end);
        for (ctx = 0; ctx < num_contexts; ctx++) {
                sun4c_set_context(ctx);
                for (vaddr = 0; vaddr < 0x20000000; vaddr += SUN4C_REAL_PGDIR_SIZE)
@@ -2064,7 +2063,6 @@ void __init sun4c_paging_init(void)
        unsigned long end_pfn, pages_avail;
 
        kernel_end = (unsigned long) &end;
-       kernel_end += (SUN4C_REAL_PGDIR_SIZE * 4);
        kernel_end = SUN4C_REAL_PGDIR_ALIGN(kernel_end);
 
        pages_avail = 0;
index ac18bd8e273f5badb0df5bcd5d467f5349e50568..63144ad476f6663c1ab3ed98fd252503fc89ebdb 100644 (file)
@@ -501,7 +501,7 @@ niagara_tlb_fixup:
        cmp     %g1, SUN4V_CHIP_NIAGARA1
        be,pt   %xcc, niagara_patch
         cmp    %g1, SUN4V_CHIP_NIAGARA2
-       be,pt   %xcc, niagara_patch
+       be,pt   %xcc, niagara2_patch
         nop
 
        call    generic_patch_copyops
@@ -512,6 +512,15 @@ niagara_tlb_fixup:
         nop
 
        ba,a,pt %xcc, 80f
+niagara2_patch:
+       call    niagara2_patch_copyops
+        nop
+       call    niagara_patch_bzero
+        nop
+       call    niagara2_patch_pageops
+        nop
+
+       ba,a,pt %xcc, 80f
 
 niagara_patch:
        call    niagara_patch_copyops
@@ -706,12 +715,13 @@ setup_trap_table:
 
        membar  #Sync
 
+       BRANCH_IF_SUN4V(o2, 1f)
+
        /* Kill PROM timer */
        sethi   %hi(0x80000000), %o2
        sllx    %o2, 32, %o2
        wr      %o2, 0, %tick_cmpr
 
-       BRANCH_IF_SUN4V(o2, 1f)
        BRANCH_IF_ANY_CHEETAH(o2, o3, 1f)
 
        ba,pt   %xcc, 2f
index 95059c2ec414804e50d63681b60ddd2ccfaa4be4..9f22e4ff6015771e8c39106f7df2baff3c315633 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
+#include <linux/miscdevice.h>
 
 #include <asm/hypervisor.h>
 #include <asm/mdesc.h>
@@ -836,6 +837,43 @@ void __devinit mdesc_fill_in_cpu_data(cpumask_t mask)
        mdesc_release(hp);
 }
 
+static ssize_t mdesc_read(struct file *file, char __user *buf,
+                         size_t len, loff_t *offp)
+{
+       struct mdesc_handle *hp = mdesc_grab();
+       int err;
+
+       if (!hp)
+               return -ENODEV;
+
+       err = hp->handle_size;
+       if (len < hp->handle_size)
+               err = -EMSGSIZE;
+       else if (copy_to_user(buf, &hp->mdesc, hp->handle_size))
+               err = -EFAULT;
+       mdesc_release(hp);
+
+       return err;
+}
+
+static const struct file_operations mdesc_fops = {
+       .read   = mdesc_read,
+       .owner  = THIS_MODULE,
+};
+
+static struct miscdevice mdesc_misc = {
+       .minor  = MISC_DYNAMIC_MINOR,
+       .name   = "mdesc",
+       .fops   = &mdesc_fops,
+};
+
+static int __init mdesc_misc_init(void)
+{
+       return misc_register(&mdesc_misc);
+}
+
+__initcall(mdesc_misc_init);
+
 void __init sun4v_mdesc_init(void)
 {
        struct mdesc_handle *hp;
index 9448595f9063f346202575ee5a0a2d72caef797b..9533a25ce5d2191f9ceb251695c0141acc78071c 100644 (file)
@@ -95,14 +95,13 @@ spitfire_startup:
        membar          #Sync
 
 startup_continue:
+       mov             %o0, %l0
+       BRANCH_IF_SUN4V(g1, niagara_lock_tlb)
+
        sethi           %hi(0x80000000), %g2
        sllx            %g2, 32, %g2
        wr              %g2, 0, %tick_cmpr
 
-       mov             %o0, %l0
-
-       BRANCH_IF_SUN4V(g1, niagara_lock_tlb)
-
        /* Call OBP by hand to lock KERNBASE into i/d tlbs.
         * We lock 2 consequetive entries if we are 'bigkernel'.
         */
index f95fbfa3eeb86b8a9389eb273514226c7b1a5bd5..f095e13910bc9ebf69646cec413297c89f08ff08 100644 (file)
@@ -13,6 +13,8 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \
         U3memcpy.o U3copy_from_user.o U3copy_to_user.o U3patch.o \
         NGmemcpy.o NGcopy_from_user.o NGcopy_to_user.o NGpatch.o \
         NGpage.o NGbzero.o \
+        NG2memcpy.o NG2copy_from_user.o NG2copy_to_user.o NG2patch.o \
+        NG2page.o \
         GENmemcpy.o GENcopy_from_user.o GENcopy_to_user.o GENpatch.o \
         GENpage.o GENbzero.o \
         copy_in_user.o user_fixup.o memmove.o \
diff --git a/arch/sparc64/lib/NG2copy_from_user.S b/arch/sparc64/lib/NG2copy_from_user.S
new file mode 100644 (file)
index 0000000..c77ef5f
--- /dev/null
@@ -0,0 +1,40 @@
+/* NG2copy_from_user.S: Niagara-2 optimized copy from userspace.
+ *
+ * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
+ */
+
+#define EX_LD(x)               \
+98:    x;                      \
+       .section .fixup;        \
+       .align 4;               \
+99:    wr      %g0, ASI_AIUS, %asi;\
+       retl;                   \
+        mov    1, %o0;         \
+       .section __ex_table,"a";\
+       .align 4;               \
+       .word 98b, 99b;         \
+       .text;                  \
+       .align 4;
+
+#ifndef ASI_AIUS
+#define ASI_AIUS       0x11
+#endif
+
+#ifndef ASI_BLK_AIUS_4V
+#define ASI_BLK_AIUS_4V        0x17
+#endif
+
+#define FUNC_NAME              NG2copy_from_user
+#define LOAD(type,addr,dest)   type##a [addr] %asi, dest
+#define LOAD_BLK(addr,dest)    ldda [addr] ASI_BLK_AIUS_4V, dest
+#define EX_RETVAL(x)           0
+
+#ifdef __KERNEL__
+#define PREAMBLE                                       \
+       rd              %asi, %g1;                      \
+       cmp             %g1, ASI_AIUS;                  \
+       bne,pn          %icc, memcpy_user_stub;         \
+        nop
+#endif
+
+#include "NG2memcpy.S"
diff --git a/arch/sparc64/lib/NG2copy_to_user.S b/arch/sparc64/lib/NG2copy_to_user.S
new file mode 100644 (file)
index 0000000..4bd4093
--- /dev/null
@@ -0,0 +1,49 @@
+/* NG2copy_to_user.S: Niagara-2 optimized copy to userspace.
+ *
+ * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
+ */
+
+#define EX_ST(x)               \
+98:    x;                      \
+       .section .fixup;        \
+       .align 4;               \
+99:    wr      %g0, ASI_AIUS, %asi;\
+       retl;                   \
+        mov    1, %o0;         \
+       .section __ex_table,"a";\
+       .align 4;               \
+       .word 98b, 99b;         \
+       .text;                  \
+       .align 4;
+
+#ifndef ASI_AIUS
+#define ASI_AIUS       0x11
+#endif
+
+#ifndef ASI_BLK_AIUS_4V
+#define ASI_BLK_AIUS_4V        0x17
+#endif
+
+#ifndef ASI_BLK_INIT_QUAD_LDD_AIUS
+#define ASI_BLK_INIT_QUAD_LDD_AIUS 0x23
+#endif
+
+#define FUNC_NAME              NG2copy_to_user
+#define STORE(type,src,addr)   type##a src, [addr] ASI_AIUS
+#define STORE_ASI              ASI_BLK_INIT_QUAD_LDD_AIUS
+#define STORE_BLK(src,addr)    stda src, [addr] ASI_BLK_AIUS_4V
+#define EX_RETVAL(x)           0
+
+#ifdef __KERNEL__
+       /* Writing to %asi is _expensive_ so we hardcode it.
+        * Reading %asi to check for KERNEL_DS is comparatively
+        * cheap.
+        */
+#define PREAMBLE                                       \
+       rd              %asi, %g1;                      \
+       cmp             %g1, ASI_AIUS;                  \
+       bne,pn          %icc, memcpy_user_stub;         \
+        nop
+#endif
+
+#include "NG2memcpy.S"
diff --git a/arch/sparc64/lib/NG2memcpy.S b/arch/sparc64/lib/NG2memcpy.S
new file mode 100644 (file)
index 0000000..0aed756
--- /dev/null
@@ -0,0 +1,520 @@
+/* NG2memcpy.S: Niagara-2 optimized memcpy.
+ *
+ * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
+ */
+
+#ifdef __KERNEL__
+#include <asm/visasm.h>
+#include <asm/asi.h>
+#define GLOBAL_SPARE   %g7
+#else
+#define ASI_PNF 0x82
+#define ASI_BLK_P 0xf0
+#define ASI_BLK_INIT_QUAD_LDD_P 0xe2
+#define FPRS_FEF  0x04
+#ifdef MEMCPY_DEBUG
+#define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs; \
+                    clr %g1; clr %g2; clr %g3; subcc %g0, %g0, %g0;
+#define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
+#else
+#define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs
+#define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
+#endif
+#define GLOBAL_SPARE   %g5
+#endif
+
+#ifndef STORE_ASI
+#ifndef SIMULATE_NIAGARA_ON_NON_NIAGARA
+#define STORE_ASI      ASI_BLK_INIT_QUAD_LDD_P
+#else
+#define STORE_ASI      0x80            /* ASI_P */
+#endif
+#endif
+
+#ifndef EX_LD
+#define EX_LD(x)       x
+#endif
+
+#ifndef EX_ST
+#define EX_ST(x)       x
+#endif
+
+#ifndef EX_RETVAL
+#define EX_RETVAL(x)   x
+#endif
+
+#ifndef LOAD
+#define LOAD(type,addr,dest)   type [addr], dest
+#endif
+
+#ifndef LOAD_BLK
+#define LOAD_BLK(addr,dest)    ldda [addr] ASI_BLK_P, dest
+#endif
+
+#ifndef STORE
+#ifndef MEMCPY_DEBUG
+#define STORE(type,src,addr)   type src, [addr]
+#else
+#define STORE(type,src,addr)   type##a src, [addr] 0x80
+#endif
+#endif
+
+#ifndef STORE_BLK
+#define STORE_BLK(src,addr)    stda src, [addr] ASI_BLK_P
+#endif
+
+#ifndef STORE_INIT
+#define STORE_INIT(src,addr)   stxa src, [addr] STORE_ASI
+#endif
+
+#ifndef FUNC_NAME
+#define FUNC_NAME      NG2memcpy
+#endif
+
+#ifndef PREAMBLE
+#define PREAMBLE
+#endif
+
+#ifndef XCC
+#define XCC xcc
+#endif
+
+#define FREG_FROB(x0, x1, x2, x3, x4, x5, x6, x7, x8) \
+       faligndata      %x0, %x1, %f0; \
+       faligndata      %x1, %x2, %f2; \
+       faligndata      %x2, %x3, %f4; \
+       faligndata      %x3, %x4, %f6; \
+       faligndata      %x4, %x5, %f8; \
+       faligndata      %x5, %x6, %f10; \
+       faligndata      %x6, %x7, %f12; \
+       faligndata      %x7, %x8, %f14;
+
+#define FREG_MOVE_1(x0) \
+       fmovd           %x0, %f0;
+#define FREG_MOVE_2(x0, x1) \
+       fmovd           %x0, %f0; \
+       fmovd           %x1, %f2;
+#define FREG_MOVE_3(x0, x1, x2) \
+       fmovd           %x0, %f0; \
+       fmovd           %x1, %f2; \
+       fmovd           %x2, %f4;
+#define FREG_MOVE_4(x0, x1, x2, x3) \
+       fmovd           %x0, %f0; \
+       fmovd           %x1, %f2; \
+       fmovd           %x2, %f4; \
+       fmovd           %x3, %f6;
+#define FREG_MOVE_5(x0, x1, x2, x3, x4) \
+       fmovd           %x0, %f0; \
+       fmovd           %x1, %f2; \
+       fmovd           %x2, %f4; \
+       fmovd           %x3, %f6; \
+       fmovd           %x4, %f8;
+#define FREG_MOVE_6(x0, x1, x2, x3, x4, x5) \
+       fmovd           %x0, %f0; \
+       fmovd           %x1, %f2; \
+       fmovd           %x2, %f4; \
+       fmovd           %x3, %f6; \
+       fmovd           %x4, %f8; \
+       fmovd           %x5, %f10;
+#define FREG_MOVE_7(x0, x1, x2, x3, x4, x5, x6) \
+       fmovd           %x0, %f0; \
+       fmovd           %x1, %f2; \
+       fmovd           %x2, %f4; \
+       fmovd           %x3, %f6; \
+       fmovd           %x4, %f8; \
+       fmovd           %x5, %f10; \
+       fmovd           %x6, %f12;
+#define FREG_MOVE_8(x0, x1, x2, x3, x4, x5, x6, x7) \
+       fmovd           %x0, %f0; \
+       fmovd           %x1, %f2; \
+       fmovd           %x2, %f4; \
+       fmovd           %x3, %f6; \
+       fmovd           %x4, %f8; \
+       fmovd           %x5, %f10; \
+       fmovd           %x6, %f12; \
+       fmovd           %x7, %f14;
+#define FREG_LOAD_1(base, x0) \
+       EX_LD(LOAD(ldd, base + 0x00, %x0))
+#define FREG_LOAD_2(base, x0, x1) \
+       EX_LD(LOAD(ldd, base + 0x00, %x0)); \
+       EX_LD(LOAD(ldd, base + 0x08, %x1));
+#define FREG_LOAD_3(base, x0, x1, x2) \
+       EX_LD(LOAD(ldd, base + 0x00, %x0)); \
+       EX_LD(LOAD(ldd, base + 0x08, %x1)); \
+       EX_LD(LOAD(ldd, base + 0x10, %x2));
+#define FREG_LOAD_4(base, x0, x1, x2, x3) \
+       EX_LD(LOAD(ldd, base + 0x00, %x0)); \
+       EX_LD(LOAD(ldd, base + 0x08, %x1)); \
+       EX_LD(LOAD(ldd, base + 0x10, %x2)); \
+       EX_LD(LOAD(ldd, base + 0x18, %x3));
+#define FREG_LOAD_5(base, x0, x1, x2, x3, x4) \
+       EX_LD(LOAD(ldd, base + 0x00, %x0)); \
+       EX_LD(LOAD(ldd, base + 0x08, %x1)); \
+       EX_LD(LOAD(ldd, base + 0x10, %x2)); \
+       EX_LD(LOAD(ldd, base + 0x18, %x3)); \
+       EX_LD(LOAD(ldd, base + 0x20, %x4));
+#define FREG_LOAD_6(base, x0, x1, x2, x3, x4, x5) \
+       EX_LD(LOAD(ldd, base + 0x00, %x0)); \
+       EX_LD(LOAD(ldd, base + 0x08, %x1)); \
+       EX_LD(LOAD(ldd, base + 0x10, %x2)); \
+       EX_LD(LOAD(ldd, base + 0x18, %x3)); \
+       EX_LD(LOAD(ldd, base + 0x20, %x4)); \
+       EX_LD(LOAD(ldd, base + 0x28, %x5));
+#define FREG_LOAD_7(base, x0, x1, x2, x3, x4, x5, x6) \
+       EX_LD(LOAD(ldd, base + 0x00, %x0)); \
+       EX_LD(LOAD(ldd, base + 0x08, %x1)); \
+       EX_LD(LOAD(ldd, base + 0x10, %x2)); \
+       EX_LD(LOAD(ldd, base + 0x18, %x3)); \
+       EX_LD(LOAD(ldd, base + 0x20, %x4)); \
+       EX_LD(LOAD(ldd, base + 0x28, %x5)); \
+       EX_LD(LOAD(ldd, base + 0x30, %x6));
+
+       .register       %g2,#scratch
+       .register       %g3,#scratch
+
+       .text
+       .align          64
+
+       .globl  FUNC_NAME
+       .type   FUNC_NAME,#function
+FUNC_NAME:     /* %o0=dst, %o1=src, %o2=len */
+       srlx            %o2, 31, %g2
+       cmp             %g2, 0
+       tne             %xcc, 5
+       PREAMBLE
+       mov             %o0, GLOBAL_SPARE
+       cmp             %o2, 0
+       be,pn           %XCC, 85f
+        or             %o0, %o1, %o3
+       cmp             %o2, 16
+       blu,a,pn        %XCC, 80f
+        or             %o3, %o2, %o3
+
+       /* 2 blocks (128 bytes) is the minimum we can do the block
+        * copy with.  We need to ensure that we'll iterate at least
+        * once in the block copy loop.  At worst we'll need to align
+        * the destination to a 64-byte boundary which can chew up
+        * to (64 - 1) bytes from the length before we perform the
+        * block copy loop.
+        *
+        * However, the cut-off point, performance wise, is around
+        * 4 64-byte blocks.
+        */
+       cmp             %o2, (4 * 64)
+       blu,pt          %XCC, 75f
+        andcc          %o3, 0x7, %g0
+
+       /* %o0: dst
+        * %o1: src
+        * %o2: len  (known to be >= 128)
+        *
+        * The block copy loops can use %o4, %g2, %g3 as
+        * temporaries while copying the data.  %o5 must
+        * be preserved between VISEntryHalf and VISExitHalf
+        */
+
+       LOAD(prefetch, %o1 + 0x000, #one_read)
+       LOAD(prefetch, %o1 + 0x040, #one_read)
+       LOAD(prefetch, %o1 + 0x080, #one_read)
+
+       /* Align destination on 64-byte boundary.  */
+       andcc           %o0, (64 - 1), %o4
+       be,pt           %XCC, 2f
+        sub            %o4, 64, %o4
+       sub             %g0, %o4, %o4   ! bytes to align dst
+       sub             %o2, %o4, %o2
+1:     subcc           %o4, 1, %o4
+       EX_LD(LOAD(ldub, %o1, %g1))
+       EX_ST(STORE(stb, %g1, %o0))
+       add             %o1, 1, %o1
+       bne,pt          %XCC, 1b
+       add             %o0, 1, %o0
+
+2:
+       /* Clobbers o5/g1/g2/g3/g7/icc/xcc.  We must preserve
+        * o5 from here until we hit VISExitHalf.
+        */
+       VISEntryHalf
+
+       alignaddr       %o1, %g0, %g0
+
+       add             %o1, (64 - 1), %o4
+       andn            %o4, (64 - 1), %o4
+       andn            %o2, (64 - 1), %g1
+       sub             %o2, %g1, %o2
+
+       and             %o1, (64 - 1), %g2
+       add             %o1, %g1, %o1
+       sub             %o0, %o4, %g3
+       brz,pt          %g2, 190f
+        cmp            %g2, 32
+       blu,a           5f
+        cmp            %g2, 16
+       cmp             %g2, 48
+       blu,a           4f
+        cmp            %g2, 40
+       cmp             %g2, 56
+       blu             170f
+        nop
+       ba,a,pt         %xcc, 180f
+
+4:     /* 32 <= low bits < 48 */
+       blu             150f
+        nop
+       ba,a,pt         %xcc, 160f
+5:     /* 0 < low bits < 32 */
+       blu,a           6f
+        cmp            %g2, 8
+       cmp             %g2, 24
+       blu             130f
+        nop
+       ba,a,pt         %xcc, 140f
+6:     /* 0 < low bits < 16 */
+       bgeu            120f
+        nop
+       /* fall through for 0 < low bits < 8 */
+110:   sub             %o4, 64, %g2
+       EX_LD(LOAD_BLK(%g2, %f0))
+1:     EX_ST(STORE_INIT(%g0, %o4 + %g3))
+       EX_LD(LOAD_BLK(%o4, %f16))
+       FREG_FROB(f0, f2, f4, f6, f8, f10, f12, f14, f16)
+       EX_ST(STORE_BLK(%f0, %o4 + %g3))
+       FREG_MOVE_8(f16, f18, f20, f22, f24, f26, f28, f30)
+       subcc           %g1, 64, %g1
+       add             %o4, 64, %o4
+       bne,pt          %xcc, 1b
+        LOAD(prefetch, %o4 + 64, #one_read)
+       ba,pt           %xcc, 195f
+        nop
+
+120:   sub             %o4, 56, %g2
+       FREG_LOAD_7(%g2, f0, f2, f4, f6, f8, f10, f12)
+1:     EX_ST(STORE_INIT(%g0, %o4 + %g3))
+       EX_LD(LOAD_BLK(%o4, %f16))
+       FREG_FROB(f0, f2, f4, f6, f8, f10, f12, f16, f18)
+       EX_ST(STORE_BLK(%f0, %o4 + %g3))
+       FREG_MOVE_7(f18, f20, f22, f24, f26, f28, f30)
+       subcc           %g1, 64, %g1
+       add             %o4, 64, %o4
+       bne,pt          %xcc, 1b
+        LOAD(prefetch, %o4 + 64, #one_read)
+       ba,pt           %xcc, 195f
+        nop
+
+130:   sub             %o4, 48, %g2
+       FREG_LOAD_6(%g2, f0, f2, f4, f6, f8, f10)
+1:     EX_ST(STORE_INIT(%g0, %o4 + %g3))
+       EX_LD(LOAD_BLK(%o4, %f16))
+       FREG_FROB(f0, f2, f4, f6, f8, f10, f16, f18, f20)
+       EX_ST(STORE_BLK(%f0, %o4 + %g3))
+       FREG_MOVE_6(f20, f22, f24, f26, f28, f30)
+       subcc           %g1, 64, %g1
+       add             %o4, 64, %o4
+       bne,pt          %xcc, 1b
+        LOAD(prefetch, %o4 + 64, #one_read)
+       ba,pt           %xcc, 195f
+        nop
+
+140:   sub             %o4, 40, %g2
+       FREG_LOAD_5(%g2, f0, f2, f4, f6, f8)
+1:     EX_ST(STORE_INIT(%g0, %o4 + %g3))
+       EX_LD(LOAD_BLK(%o4, %f16))
+       FREG_FROB(f0, f2, f4, f6, f8, f16, f18, f20, f22)
+       EX_ST(STORE_BLK(%f0, %o4 + %g3))
+       FREG_MOVE_5(f22, f24, f26, f28, f30)
+       subcc           %g1, 64, %g1
+       add             %o4, 64, %o4
+       bne,pt          %xcc, 1b
+        LOAD(prefetch, %o4 + 64, #one_read)
+       ba,pt           %xcc, 195f
+        nop
+
+150:   sub             %o4, 32, %g2
+       FREG_LOAD_4(%g2, f0, f2, f4, f6)
+1:     EX_ST(STORE_INIT(%g0, %o4 + %g3))
+       EX_LD(LOAD_BLK(%o4, %f16))
+       FREG_FROB(f0, f2, f4, f6, f16, f18, f20, f22, f24)
+       EX_ST(STORE_BLK(%f0, %o4 + %g3))
+       FREG_MOVE_4(f24, f26, f28, f30)
+       subcc           %g1, 64, %g1
+       add             %o4, 64, %o4
+       bne,pt          %xcc, 1b
+        LOAD(prefetch, %o4 + 64, #one_read)
+       ba,pt           %xcc, 195f
+        nop
+
+160:   sub             %o4, 24, %g2
+       FREG_LOAD_3(%g2, f0, f2, f4)
+1:     EX_ST(STORE_INIT(%g0, %o4 + %g3))
+       EX_LD(LOAD_BLK(%o4, %f16))
+       FREG_FROB(f0, f2, f4, f16, f18, f20, f22, f24, f26)
+       EX_ST(STORE_BLK(%f0, %o4 + %g3))
+       FREG_MOVE_3(f26, f28, f30)
+       subcc           %g1, 64, %g1
+       add             %o4, 64, %o4
+       bne,pt          %xcc, 1b
+        LOAD(prefetch, %o4 + 64, #one_read)
+       ba,pt           %xcc, 195f
+        nop
+
+170:   sub             %o4, 16, %g2
+       FREG_LOAD_2(%g2, f0, f2)
+1:     EX_ST(STORE_INIT(%g0, %o4 + %g3))
+       EX_LD(LOAD_BLK(%o4, %f16))
+       FREG_FROB(f0, f2, f16, f18, f20, f22, f24, f26, f28)
+       EX_ST(STORE_BLK(%f0, %o4 + %g3))
+       FREG_MOVE_2(f28, f30)
+       subcc           %g1, 64, %g1
+       add             %o4, 64, %o4
+       bne,pt          %xcc, 1b
+        LOAD(prefetch, %o4 + 64, #one_read)
+       ba,pt           %xcc, 195f
+        nop
+
+180:   sub             %o4, 8, %g2
+       FREG_LOAD_1(%g2, f0)
+1:     EX_ST(STORE_INIT(%g0, %o4 + %g3))
+       EX_LD(LOAD_BLK(%o4, %f16))
+       FREG_FROB(f0, f16, f18, f20, f22, f24, f26, f28, f30)
+       EX_ST(STORE_BLK(%f0, %o4 + %g3))
+       FREG_MOVE_1(f30)
+       subcc           %g1, 64, %g1
+       add             %o4, 64, %o4
+       bne,pt          %xcc, 1b
+        LOAD(prefetch, %o4 + 64, #one_read)
+       ba,pt           %xcc, 195f
+        nop
+
+190:
+1:     EX_ST(STORE_INIT(%g0, %o4 + %g3))
+       subcc           %g1, 64, %g1
+       EX_LD(LOAD_BLK(%o4, %f0))
+       EX_ST(STORE_BLK(%f0, %o4 + %g3))
+       add             %o4, 64, %o4
+       bne,pt          %xcc, 1b
+        LOAD(prefetch, %o4 + 64, #one_read)
+
+195:
+       add             %o4, %g3, %o0
+       membar          #Sync
+
+       VISExitHalf
+
+       /* %o2 contains any final bytes still needed to be copied
+        * over. If anything is left, we copy it one byte at a time.
+        */
+       brz,pt          %o2, 85f
+        sub            %o0, %o1, %o3
+       ba,a,pt         %XCC, 90f
+
+       .align          64
+75: /* 16 < len <= 64 */
+       bne,pn          %XCC, 75f
+        sub            %o0, %o1, %o3
+
+72:
+       andn            %o2, 0xf, %o4
+       and             %o2, 0xf, %o2
+1:     subcc           %o4, 0x10, %o4
+       EX_LD(LOAD(ldx, %o1, %o5))
+       add             %o1, 0x08, %o1
+       EX_LD(LOAD(ldx, %o1, %g1))
+       sub             %o1, 0x08, %o1
+       EX_ST(STORE(stx, %o5, %o1 + %o3))
+       add             %o1, 0x8, %o1
+       EX_ST(STORE(stx, %g1, %o1 + %o3))
+       bgu,pt          %XCC, 1b
+        add            %o1, 0x8, %o1
+73:    andcc           %o2, 0x8, %g0
+       be,pt           %XCC, 1f
+        nop
+       sub             %o2, 0x8, %o2
+       EX_LD(LOAD(ldx, %o1, %o5))
+       EX_ST(STORE(stx, %o5, %o1 + %o3))
+       add             %o1, 0x8, %o1
+1:     andcc           %o2, 0x4, %g0
+       be,pt           %XCC, 1f
+        nop
+       sub             %o2, 0x4, %o2
+       EX_LD(LOAD(lduw, %o1, %o5))
+       EX_ST(STORE(stw, %o5, %o1 + %o3))
+       add             %o1, 0x4, %o1
+1:     cmp             %o2, 0
+       be,pt           %XCC, 85f
+        nop
+       ba,pt           %xcc, 90f
+        nop
+
+75:
+       andcc           %o0, 0x7, %g1
+       sub             %g1, 0x8, %g1
+       be,pn           %icc, 2f
+        sub            %g0, %g1, %g1
+       sub             %o2, %g1, %o2
+
+1:     subcc           %g1, 1, %g1
+       EX_LD(LOAD(ldub, %o1, %o5))
+       EX_ST(STORE(stb, %o5, %o1 + %o3))
+       bgu,pt          %icc, 1b
+        add            %o1, 1, %o1
+
+2:     add             %o1, %o3, %o0
+       andcc           %o1, 0x7, %g1
+       bne,pt          %icc, 8f
+        sll            %g1, 3, %g1
+
+       cmp             %o2, 16
+       bgeu,pt         %icc, 72b
+        nop
+       ba,a,pt         %xcc, 73b
+
+8:     mov             64, %o3
+       andn            %o1, 0x7, %o1
+       EX_LD(LOAD(ldx, %o1, %g2))
+       sub             %o3, %g1, %o3
+       andn            %o2, 0x7, %o4
+       sllx            %g2, %g1, %g2
+1:     add             %o1, 0x8, %o1
+       EX_LD(LOAD(ldx, %o1, %g3))
+       subcc           %o4, 0x8, %o4
+       srlx            %g3, %o3, %o5
+       or              %o5, %g2, %o5
+       EX_ST(STORE(stx, %o5, %o0))
+       add             %o0, 0x8, %o0
+       bgu,pt          %icc, 1b
+        sllx           %g3, %g1, %g2
+
+       srl             %g1, 3, %g1
+       andcc           %o2, 0x7, %o2
+       be,pn           %icc, 85f
+        add            %o1, %g1, %o1
+       ba,pt           %xcc, 90f
+        sub            %o0, %o1, %o3
+
+       .align          64
+80: /* 0 < len <= 16 */
+       andcc           %o3, 0x3, %g0
+       bne,pn          %XCC, 90f
+        sub            %o0, %o1, %o3
+
+1:
+       subcc           %o2, 4, %o2
+       EX_LD(LOAD(lduw, %o1, %g1))
+       EX_ST(STORE(stw, %g1, %o1 + %o3))
+       bgu,pt          %XCC, 1b
+        add            %o1, 4, %o1
+
+85:    retl
+        mov            EX_RETVAL(GLOBAL_SPARE), %o0
+
+       .align          32
+90:
+       subcc           %o2, 1, %o2
+       EX_LD(LOAD(ldub, %o1, %g1))
+       EX_ST(STORE(stb, %g1, %o1 + %o3))
+       bgu,pt          %XCC, 90b
+        add            %o1, 1, %o1
+       retl
+        mov            EX_RETVAL(GLOBAL_SPARE), %o0
+
+       .size           FUNC_NAME, .-FUNC_NAME
diff --git a/arch/sparc64/lib/NG2page.S b/arch/sparc64/lib/NG2page.S
new file mode 100644 (file)
index 0000000..73b6b7c
--- /dev/null
@@ -0,0 +1,61 @@
+/* NG2page.S: Niagara-2 optimized clear and copy page.
+ *
+ * Copyright (C) 2007 (davem@davemloft.net)
+ */
+
+#include <asm/asi.h>
+#include <asm/page.h>
+#include <asm/visasm.h>
+
+       .text
+       .align  32
+
+       /* This is heavily simplified from the sun4u variants
+        * because Niagara-2 does not have any D-cache aliasing issues.
+        */
+NG2copy_user_page:     /* %o0=dest, %o1=src, %o2=vaddr */
+       prefetch        [%o1 + 0x00], #one_read
+       prefetch        [%o1 + 0x40], #one_read
+       VISEntryHalf
+       set             PAGE_SIZE, %g7
+       sub             %o0, %o1, %g3
+1:     stxa            %g0, [%o1 + %g3] ASI_BLK_INIT_QUAD_LDD_P
+       subcc           %g7, 64, %g7
+       ldda            [%o1] ASI_BLK_P, %f0
+       stda            %f0, [%o1 + %g3] ASI_BLK_P
+       add             %o1, 64, %o1
+       bne,pt          %xcc, 1b
+        prefetch       [%o1 + 0x40], #one_read
+       membar          #Sync
+       VISExitHalf
+       retl
+        nop
+
+#define BRANCH_ALWAYS  0x10680000
+#define NOP            0x01000000
+#define NG_DO_PATCH(OLD, NEW)  \
+       sethi   %hi(NEW), %g1; \
+       or      %g1, %lo(NEW), %g1; \
+       sethi   %hi(OLD), %g2; \
+       or      %g2, %lo(OLD), %g2; \
+       sub     %g1, %g2, %g1; \
+       sethi   %hi(BRANCH_ALWAYS), %g3; \
+       sll     %g1, 11, %g1; \
+       srl     %g1, 11 + 2, %g1; \
+       or      %g3, %lo(BRANCH_ALWAYS), %g3; \
+       or      %g3, %g1, %g3; \
+       stw     %g3, [%g2]; \
+       sethi   %hi(NOP), %g3; \
+       or      %g3, %lo(NOP), %g3; \
+       stw     %g3, [%g2 + 0x4]; \
+       flush   %g2;
+
+       .globl  niagara2_patch_pageops
+       .type   niagara2_patch_pageops,#function
+niagara2_patch_pageops:
+       NG_DO_PATCH(copy_user_page, NG2copy_user_page)
+       NG_DO_PATCH(_clear_page, NGclear_page)
+       NG_DO_PATCH(clear_user_page, NGclear_user_page)
+       retl
+        nop
+       .size   niagara2_patch_pageops,.-niagara2_patch_pageops
diff --git a/arch/sparc64/lib/NG2patch.S b/arch/sparc64/lib/NG2patch.S
new file mode 100644 (file)
index 0000000..28c36f0
--- /dev/null
@@ -0,0 +1,33 @@
+/* NG2patch.S: Patch Ultra-I routines with Niagara-2 variant.
+ *
+ * Copyright (C) 2007 David S. Miller <davem@davemloft.net>
+ */
+
+#define BRANCH_ALWAYS  0x10680000
+#define NOP            0x01000000
+#define NG_DO_PATCH(OLD, NEW)  \
+       sethi   %hi(NEW), %g1; \
+       or      %g1, %lo(NEW), %g1; \
+       sethi   %hi(OLD), %g2; \
+       or      %g2, %lo(OLD), %g2; \
+       sub     %g1, %g2, %g1; \
+       sethi   %hi(BRANCH_ALWAYS), %g3; \
+       sll     %g1, 11, %g1; \
+       srl     %g1, 11 + 2, %g1; \
+       or      %g3, %lo(BRANCH_ALWAYS), %g3; \
+       or      %g3, %g1, %g3; \
+       stw     %g3, [%g2]; \
+       sethi   %hi(NOP), %g3; \
+       or      %g3, %lo(NOP), %g3; \
+       stw     %g3, [%g2 + 0x4]; \
+       flush   %g2;
+
+       .globl  niagara2_patch_copyops
+       .type   niagara2_patch_copyops,#function
+niagara2_patch_copyops:
+       NG_DO_PATCH(memcpy, NG2memcpy)
+       NG_DO_PATCH(___copy_from_user, NG2copy_from_user)
+       NG_DO_PATCH(___copy_to_user, NG2copy_to_user)
+       retl
+        nop
+       .size   niagara2_patch_copyops,.-niagara2_patch_copyops
index 8ce3a0c9c537ed4ac862afda0cca7f41ed4c0b98..428920de05baeb4f87b80a93d3a09480ef19ffec 100644 (file)
@@ -45,6 +45,7 @@ NGcopy_user_page:     /* %o0=dest, %o1=src, %o2=vaddr */
        retl
         nop
 
+       .globl          NGclear_page, NGclear_user_page
 NGclear_page:          /* %o0=dest */
 NGclear_user_page:     /* %o0=dest, %o1=vaddr */
        mov             8, %g1
index 2300d81bbc4e4aaf9b8fd17050ab0b4df9923d67..56bee9e065cf3e395e6680b4667cdaad5da45d84 100644 (file)
@@ -651,6 +651,19 @@ static struct acpi_ec *make_acpi_ec(void)
        return ec;
 }
 
+static acpi_status
+acpi_ec_register_query_methods(acpi_handle handle, u32 level,
+                              void *context, void **return_value)
+{
+       struct acpi_namespace_node *node = handle;
+       struct acpi_ec *ec = context;
+       int value = 0;
+       if (sscanf(node->name.ascii, "_Q%x", &value) == 1) {
+               acpi_ec_add_query_handler(ec, value, handle, NULL, NULL);
+       }
+       return AE_OK;
+}
+
 static acpi_status
 ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
 {
@@ -668,6 +681,10 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
        if (ACPI_FAILURE(status))
                return status;
 
+       /* Find and register all query methods */
+       acpi_walk_namespace(ACPI_TYPE_METHOD, handle, 1,
+                           acpi_ec_register_query_methods, ec, NULL);
+
        /* Use the global lock for all EC transactions? */
        acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock);
 
index a78832ea81fa0f5cc9460cca362f498307820cb1..071d274afaabcf6a971831019c44e50900d306c9 100644 (file)
@@ -436,7 +436,7 @@ static const struct piix_map_db ich8_map_db = {
                /* PM   PS   SM   SS       MAP */
                {  P0,  P2,  P1,  P3 }, /* 00b (hardwired when in AHCI) */
                {  RV,  RV,  RV,  RV },
-               {  IDE,  IDE,  NA,  NA }, /* 10b (IDE mode) */
+               {  P0,  P2, IDE, IDE }, /* 10b (IDE mode) */
                {  RV,  RV,  RV,  RV },
        },
 };
@@ -900,6 +900,13 @@ static int piix_broken_suspend(void)
                                DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"),
                        },
                },
+               {
+                       .ident = "TECRA M7",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+                               DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M7"),
+                       },
+               },
                {
                        .ident = "Satellite U205",
                        .matches = {
index 60e78bef469fed2f49423deea956a16b60a0448b..99d4fbffb0dfd574acd2f280c960895548254791 100644 (file)
@@ -1723,7 +1723,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
                tf.protocol = ATA_PROT_NODATA;
                tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
                err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
-               if (err_mask) {
+               if (err_mask && id[2] != 0x738c) {
                        rc = -EIO;
                        reason = "SPINUP failed";
                        goto err_out;
index ce589d96ca424f3083564dc9f193eef0717501f2..b5352ebecef93a9cf047b5f6cdb3cd4dc1a10c50 100644 (file)
@@ -2,6 +2,7 @@
  *    pata_artop.c - ARTOP ATA controller driver
  *
  *     (C) 2006 Red Hat <alan@redhat.com>
+ *     (C) 2007 Bartlomiej Zolnierkiewicz
  *
  *    Based in part on drivers/ide/pci/aec62xx.c
  *     Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
@@ -28,7 +29,7 @@
 #include <linux/ata.h>
 
 #define DRV_NAME       "pata_artop"
-#define DRV_VERSION    "0.4.3"
+#define DRV_VERSION    "0.4.4"
 
 /*
  *     The ARTOP has 33 Mhz and "over clocked" timing tables. Until we
@@ -430,7 +431,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
                .udma_mask      = ATA_UDMA4,
                .port_ops       = &artop6260_ops,
        };
-       static const struct ata_port_info info_626x_fast = {
+       static const struct ata_port_info info_628x = {
                .sht            = &artop_sht,
                .flags          = ATA_FLAG_SLAVE_POSS,
                .pio_mask       = 0x1f, /* pio0-4 */
@@ -438,6 +439,14 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
                .udma_mask      = ATA_UDMA5,
                .port_ops       = &artop6260_ops,
        };
+       static const struct ata_port_info info_628x_fast = {
+               .sht            = &artop_sht,
+               .flags          = ATA_FLAG_SLAVE_POSS,
+               .pio_mask       = 0x1f, /* pio0-4 */
+               .mwdma_mask     = 0x07, /* mwdma0-2 */
+               .udma_mask      = ATA_UDMA6,
+               .port_ops       = &artop6260_ops,
+       };
        const struct ata_port_info *ppi[] = { NULL, NULL };
 
        if (!printed_version++)
@@ -455,13 +464,13 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
        }
        else if (id->driver_data == 1)  /* 6260 */
                ppi[0] = &info_626x;
-       else if (id->driver_data == 2)  { /* 6260 or 6260 + fast */
+       else if (id->driver_data == 2)  { /* 6280 or 6280 + fast */
                unsigned long io = pci_resource_start(pdev, 4);
                u8 reg;
 
-               ppi[0] = &info_626x;
+               ppi[0] = &info_628x;
                if (inb(io) & 0x10)
-                       ppi[0] = &info_626x_fast;
+                       ppi[0] = &info_628x_fast;
                /* Mac systems come up with some registers not set as we
                   will need them */
 
index 84d9c5568567461b782da104f41c857fb8f75f11..c5ddd937dbf21a438af2cbe8fb0f2c385b88a774 100644 (file)
@@ -8,12 +8,10 @@
  * Copyright (C) 1999-2003             Andre Hedrick <andre@linux-ide.org>
  * Portions Copyright (C) 2001         Sun Microsystems, Inc.
  * Portions Copyright (C) 2003         Red Hat Inc
- * Portions Copyright (C) 2005-2006    MontaVista Software, Inc.
+ * Portions Copyright (C) 2005-2007    MontaVista Software, Inc.
  *
  * TODO
- *     PLL mode
- *     Look into engine reset on timeout errors. Should not be
- *             required.
+ *     Look into engine reset on timeout errors. Should not be required.
  */
 
 #include <linux/kernel.h>
@@ -26,7 +24,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "pata_hpt37x"
-#define DRV_VERSION    "0.6.7"
+#define DRV_VERSION    "0.6.9"
 
 struct hpt_clock {
        u8      xfer_speed;
@@ -1092,9 +1090,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                int dpll, adjust;
 
                /* Compute DPLL */
-               dpll = 2;
-               if (port->udma_mask & 0xE0)
-                       dpll = 3;
+               dpll = (port->udma_mask & 0xC0) ? 3 : 2;
 
                f_low = (MHz[clock_slot] * 48) / MHz[dpll];
                f_high = f_low + 2;
@@ -1116,7 +1112,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                        pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100);
                }
                if (adjust == 8) {
-                       printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n");
+                       printk(KERN_ERR "pata_hpt37x: DPLL did not stabilize!\n");
                        return -ENODEV;
                }
                if (dpll == 3)
@@ -1124,7 +1120,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                else
                        private_data = (void *)hpt37x_timings_50;
 
-               printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[dpll]);
+               printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using %dMHz DPLL.\n",
+                      MHz[clock_slot], MHz[dpll]);
        } else {
                private_data = (void *)chip_table->clocks[clock_slot];
                /*
@@ -1137,7 +1134,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                        port = &info_hpt370_33;
                if (clock_slot < 2 && port == &info_hpt370a)
                        port = &info_hpt370a_33;
-               printk(KERN_INFO "hpt37x: %s: Bus clock %dMHz.\n", chip_table->name, MHz[clock_slot]);
+               printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n",
+                      chip_table->name, MHz[clock_slot]);
        }
 
        /* Now kick off ATA set up */
index aa29cde09f8bbd594022f23a1e7803b6adfc5d87..f8f234bfc8ce2bc1ef075fccedd6df98d52fec2f 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright (C) 1999-2003             Andre Hedrick <andre@linux-ide.org>
  * Portions Copyright (C) 2001         Sun Microsystems, Inc.
  * Portions Copyright (C) 2003         Red Hat Inc
- * Portions Copyright (C) 2005-2006    MontaVista Software, Inc.
+ * Portions Copyright (C) 2005-2007    MontaVista Software, Inc.
  *
  *
  * TODO
@@ -25,7 +25,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "pata_hpt3x2n"
-#define DRV_VERSION    "0.3.3"
+#define DRV_VERSION    "0.3.4"
 
 enum {
        HPT_PCI_FAST    =       (1 << 31),
@@ -579,10 +579,12 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
        }
        if (adjust == 8) {
-               printk(KERN_WARNING "hpt3x2n: DPLL did not stabilize.\n");
+               printk(KERN_ERR "pata_hpt3x2n: DPLL did not stabilize!\n");
                return -ENODEV;
        }
 
+       printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using 66MHz DPLL.\n",
+              pci_mhz);
        /* Set our private data up. We only need a few flags so we use
           it directly */
        port.private_data = NULL;
index 5525518204e65dc07850f2283f8a5e1b775a9703..91a396fa5b20f0f75fdbc550ab6d1b9654738145 100644 (file)
@@ -139,6 +139,8 @@ static struct pnp_device_id isapnp_devices[] = {
        {.id = ""}
 };
 
+MODULE_DEVICE_TABLE(pnp, isapnp_devices);
+
 static struct pnp_driver isapnp_driver = {
        .name           = DRV_NAME,
        .id_table       = isapnp_devices,
index 8ec520885b959557d0dc8d6bc3d80407cda3460f..3acf65e75eb2dd0b64b6ce2d2bfc7670c7f1cf8b 100644 (file)
@@ -621,6 +621,9 @@ static const struct pci_device_id mv_pci_tbl[] = {
        { PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
        { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
        { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
+       /* RocketRAID 1740/174x have different identifiers */
+       { PCI_VDEVICE(TTI, 0x1740), chip_508x },
+       { PCI_VDEVICE(TTI, 0x1742), chip_508x },
 
        { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
        { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
index 405ee5e092211ee8078ff80adbc4fbaa5cd928b7..8b12925fe7a41e7a54f846d1f64274c737a82009 100644 (file)
@@ -2435,7 +2435,7 @@ fore200e_init_cmd_queue(struct fore200e* fore200e)
 }
 
 
-static void __init
+static void __devinit
 fore200e_param_bs_queue(struct fore200e* fore200e,
                        enum buffer_scheme scheme, enum buffer_magn magn,
                        int queue_length, int pool_size, int supply_blksize)
index a3b605a0ca17a47e106359e4299d5db2e70515df..ef52452640e0b7f9c89594e6a9195653a1eee1a9 100644 (file)
@@ -1601,14 +1601,14 @@ static int rx_init(struct atm_dev *dev)
   
        skb_queue_head_init(&iadev->rx_dma_q);  
        iadev->rx_free_desc_qhead = NULL;   
-       iadev->rx_open = kmalloc(4*iadev->num_vc,GFP_KERNEL);
-       if (!iadev->rx_open)  
-       {  
+
+       iadev->rx_open = kzalloc(4 * iadev->num_vc, GFP_KERNEL);
+       if (!iadev->rx_open) {
                printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n",
                dev->number);  
                goto err_free_dle;
        }  
-       memset(iadev->rx_open, 0, 4*iadev->num_vc);  
+
         iadev->rxing = 1;
         iadev->rx_pkt_cnt = 0;
        /* Mode Register */  
@@ -3171,12 +3171,12 @@ static int __devinit ia_init_one(struct pci_dev *pdev,
         unsigned long flags;
        int ret;
 
-       iadev = kmalloc(sizeof(*iadev), GFP_KERNEL); 
+       iadev = kzalloc(sizeof(*iadev), GFP_KERNEL);
        if (!iadev) {
                ret = -ENOMEM;
                goto err_out;
        }
-       memset(iadev, 0, sizeof(*iadev));
+
        iadev->pci = pdev;
 
        IF_INIT(printk("ia detected at bus:%d dev: %d function:%d\n",
index 55fd1b4543fdc5e034e8c358fc05967259f339b4..144a49f152207402c044caca1c0c8dde47f10747 100644 (file)
@@ -65,7 +65,6 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <linux/dma-mapping.h>
 
 /* -------------------- TUNABLE PARAMATERS: */
 
index 5fbe56b5cea09bb01f74e40488f63187dd851c1f..2d1f17865b64a933f8a9901b899952fe0018706c 100644 (file)
@@ -347,8 +347,7 @@ ioat_dma_prep_memcpy(struct dma_chan *chan, size_t len, int int_en)
        new->async_tx.ack = 0; /* client is in control of this ack */
        new->async_tx.cookie = -EBUSY;
 
-       pci_unmap_len_set(new, src_len, orig_len);
-       pci_unmap_len_set(new, dst_len, orig_len);
+       pci_unmap_len_set(new, len, orig_len);
        spin_unlock_bh(&ioat_chan->desc_lock);
 
        return new ? &new->async_tx : NULL;
@@ -423,11 +422,11 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *chan)
                        */
                        pci_unmap_page(chan->device->pdev,
                                        pci_unmap_addr(desc, dst),
-                                       pci_unmap_len(desc, dst_len),
+                                       pci_unmap_len(desc, len),
                                        PCI_DMA_FROMDEVICE);
                        pci_unmap_page(chan->device->pdev,
                                        pci_unmap_addr(desc, src),
-                                       pci_unmap_len(desc, src_len),
+                                       pci_unmap_len(desc, len),
                                        PCI_DMA_TODEVICE);
                }
 
index d3726478031a4ffd3c66db68e5e3361792658fb5..bf4dad70e0f59b78b328e1fb4fe8e60240d8fe7a 100644 (file)
@@ -111,10 +111,9 @@ struct ioat_desc_sw {
        struct ioat_dma_descriptor *hw;
        struct list_head node;
        int tx_cnt;
+       DECLARE_PCI_UNMAP_LEN(len)
        DECLARE_PCI_UNMAP_ADDR(src)
-       DECLARE_PCI_UNMAP_LEN(src_len)
        DECLARE_PCI_UNMAP_ADDR(dst)
-       DECLARE_PCI_UNMAP_LEN(dst_len)
        struct dma_async_tx_descriptor async_tx;
 };
 
index 8f5c686123b8a5da5fae95064cb3bd8355ca5428..289816db52aed4b956dd515238f65a8fda481597 100644 (file)
@@ -272,11 +272,11 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
                /* Make sure the SMBus host is ready to start transmitting */
                temp = inb_p(SMBHSTSTS);
                if (i == 1) {
-                       /* Erronenous conditions before transaction:
+                       /* Erroneous conditions before transaction:
                         * Byte_Done, Failed, Bus_Err, Dev_Err, Intr, Host_Busy */
                        errmask = 0x9f;
                } else {
-                       /* Erronenous conditions during transaction:
+                       /* Erroneous conditions during transaction:
                         * Failed, Bus_Err, Dev_Err, Intr */
                        errmask = 0x1e;
                }
index 440342bc62e183d0d20b8acced8ea0a9a5cd5b86..ace644e21b14380585f05103028a133b02a904af 100644 (file)
@@ -490,6 +490,7 @@ iop3xx_i2c_probe(struct platform_device *pdev)
        memcpy(new_adapter->name, pdev->name, strlen(pdev->name));
        new_adapter->id = I2C_HW_IOP3XX;
        new_adapter->owner = THIS_MODULE;
+       new_adapter->class = I2C_CLASS_HWMON;
        new_adapter->dev.parent = &pdev->dev;
        new_adapter->nr = pdev->id;
 
index 851c3ed513d015e50b5c75c362a014dfa09c1c1d..d8de4ac88b7d9d7718b9693eb1506f8ec45709a6 100644 (file)
@@ -105,6 +105,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
                        schedule();
                        if (time_after(jiffies, orig_jiffies + timeout)) {
                                pr_debug("I2C: timeout\n");
+                               writeccr(i2c, 0);
                                result = -EIO;
                                break;
                        }
@@ -116,10 +117,12 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
                result = wait_event_interruptible_timeout(i2c->queue,
                        (i2c->interrupt & CSR_MIF), timeout * HZ);
 
-               if (unlikely(result < 0))
+               if (unlikely(result < 0)) {
                        pr_debug("I2C: wait interrupted\n");
-               else if (unlikely(!(i2c->interrupt & CSR_MIF))) {
+                       writeccr(i2c, 0);
+               } else if (unlikely(!(i2c->interrupt & CSR_MIF))) {
                        pr_debug("I2C: wait timeout\n");
+                       writeccr(i2c, 0);
                        result = -ETIMEDOUT;
                }
 
@@ -172,7 +175,6 @@ static void mpc_i2c_start(struct mpc_i2c *i2c)
 static void mpc_i2c_stop(struct mpc_i2c *i2c)
 {
        writeccr(i2c, CCR_MEN);
-       writeccr(i2c, 0);
 }
 
 static int mpc_write(struct mpc_i2c *i2c, int target,
@@ -261,6 +263,7 @@ static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
        while (readb(i2c->base + MPC_I2C_SR) & CSR_MBB) {
                if (signal_pending(current)) {
                        pr_debug("I2C: Interrupted\n");
+                       writeccr(i2c, 0);
                        return -EINTR;
                }
                if (time_after(jiffies, orig_jiffies + HZ)) {
@@ -362,7 +365,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
 
       fail_add:
        if (i2c->irq != 0)
-               free_irq(i2c->irq, NULL);
+               free_irq(i2c->irq, i2c);
       fail_irq:
        iounmap(i2c->base);
       fail_map:
index 251154ae5d97ad3eb0bddff1067c3a655075ba5f..bb7bf68a7fb66eb4fb648ba0d770d2bcbda38333 100644 (file)
@@ -107,6 +107,21 @@ struct mv64xxx_i2c_data {
  *
  *****************************************************************************
  */
+
+/* Reset hardware and initialize FSM */
+static void
+mv64xxx_i2c_hw_init(struct mv64xxx_i2c_data *drv_data)
+{
+       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SOFT_RESET);
+       writel((((drv_data->freq_m & 0xf) << 3) | (drv_data->freq_n & 0x7)),
+               drv_data->reg_base + MV64XXX_I2C_REG_BAUD);
+       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SLAVE_ADDR);
+       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_EXT_SLAVE_ADDR);
+       writel(MV64XXX_I2C_REG_CONTROL_TWSIEN | MV64XXX_I2C_REG_CONTROL_STOP,
+               drv_data->reg_base + MV64XXX_I2C_REG_CONTROL);
+       drv_data->state = MV64XXX_I2C_STATE_IDLE;
+}
+
 static void
 mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
 {
@@ -203,7 +218,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
                         drv_data->state, status, drv_data->msg->addr,
                         drv_data->msg->flags);
                drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP;
-               drv_data->state = MV64XXX_I2C_STATE_IDLE;
+               mv64xxx_i2c_hw_init(drv_data);
                drv_data->rc = -EIO;
        }
 }
@@ -367,6 +382,7 @@ mv64xxx_i2c_wait_for_completion(struct mv64xxx_i2c_data *drv_data)
                                "mv64xxx: I2C bus locked, block: %d, "
                                "time_left: %d\n", drv_data->block,
                                (int)time_left);
+                       mv64xxx_i2c_hw_init(drv_data);
                }
        } else
                spin_unlock_irqrestore(&drv_data->lock, flags);
@@ -443,19 +459,6 @@ static const struct i2c_algorithm mv64xxx_i2c_algo = {
  *
  *****************************************************************************
  */
-static void __devinit
-mv64xxx_i2c_hw_init(struct mv64xxx_i2c_data *drv_data)
-{
-       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SOFT_RESET);
-       writel((((drv_data->freq_m & 0xf) << 3) | (drv_data->freq_n & 0x7)),
-               drv_data->reg_base + MV64XXX_I2C_REG_BAUD);
-       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SLAVE_ADDR);
-       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_EXT_SLAVE_ADDR);
-       writel(MV64XXX_I2C_REG_CONTROL_TWSIEN | MV64XXX_I2C_REG_CONTROL_STOP,
-               drv_data->reg_base + MV64XXX_I2C_REG_CONTROL);
-       drv_data->state = MV64XXX_I2C_STATE_IDLE;
-}
-
 static int __devinit
 mv64xxx_i2c_map_regs(struct platform_device *pd,
        struct mv64xxx_i2c_data *drv_data)
index e4540fcf6476e17fc5aa6d1f764d583fc0403c1d..c44ada5f4292e301bfb4e2e1165e06b1007b626f 100644 (file)
@@ -39,8 +39,8 @@
 #include <asm/io.h>
 
 #include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-iic.h>
-#include <asm/arch/iic.h>
+#include <asm/plat-s3c/regs-iic.h>
+#include <asm/plat-s3c/iic.h>
 
 /* i2c controller state */
 
index 9fafadb92510219e74ddce66bdc223e88165bc9a..fe04e46991aa9911967c267166c4b11db944cc6f 100644 (file)
@@ -18,8 +18,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#undef DEBUG
-#undef VERBOSE
 
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -44,7 +42,7 @@
 
 
 #define        DRIVER_VERSION  "24 August 2004"
-#define        DRIVER_NAME     (isp1301_driver.name)
+#define        DRIVER_NAME     (isp1301_driver.driver.name)
 
 MODULE_DESCRIPTION("ISP1301 USB OTG Transceiver Driver");
 MODULE_LICENSE("GPL");
@@ -55,6 +53,7 @@ struct isp1301 {
        void                    (*i2c_release)(struct device *dev);
 
        int                     irq;
+       int                     irq_type;
 
        u32                     last_otg_ctrl;
        unsigned                working:1;
@@ -63,7 +62,7 @@ struct isp1301 {
 
        /* use keventd context to change the state for us */
        struct work_struct      work;
-       
+
        unsigned long           todo;
 #              define WORK_UPDATE_ISP  0       /* update ISP from OTG */
 #              define WORK_UPDATE_OTG  1       /* update OTG from ISP */
@@ -94,7 +93,7 @@ struct isp1301 {
 
 /* board-specific PM hooks */
 
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/mux.h>
 #include <asm/mach-types.h>
 
@@ -291,7 +290,7 @@ static void power_up(struct isp1301 *isp)
 {
        // isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_2, MC2_GLOBAL_PWR_DN);
        isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_1, MC1_SUSPEND_REG);
-       
+
        /* do this only when cpu is driving transceiver,
         * so host won't see a low speed device...
         */
@@ -799,7 +798,7 @@ static irqreturn_t omap_otg_irq(int irq, void *_isp)
                /* role is host */
                } else {
                        if (!(otg_ctrl & OTG_ID)) {
-                               otg_ctrl &= OTG_CTRL_MASK & ~OTG_XCEIV_INPUTS;
+                               otg_ctrl &= OTG_CTRL_MASK & ~OTG_XCEIV_INPUTS;
                                OTG_CTRL_REG = otg_ctrl | OTG_A_BUSREQ;
                        }
 
@@ -1100,9 +1099,9 @@ static u8 isp1301_clear_latch(struct isp1301 *isp)
 }
 
 static void
-isp1301_work(void *data)
+isp1301_work(struct work_struct *work)
 {
-       struct isp1301  *isp = data;
+       struct isp1301  *isp = container_of(work, struct isp1301, work);
        int             stop;
 
        /* implicit lock:  we're the only task using this device */
@@ -1244,7 +1243,7 @@ static int isp1301_detach_client(struct i2c_client *i2c)
  *  - DEVICE mode, for when there's a B/Mini-B (device) connector
  *
  * As a rule, you won't have an isp1301 chip unless it's there to
- * support the OTG mode.  Other modes help testing USB controllers 
+ * support the OTG mode.  Other modes help testing USB controllers
  * in isolation from (full) OTG support, or maybe so later board
  * revisions can help to support those feature.
  */
@@ -1260,9 +1259,9 @@ static int isp1301_otg_enable(struct isp1301 *isp)
         * a few more interrupts than are strictly needed.
         */
        isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
-               INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
+               INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
        isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
-               INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
+               INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
 
        dev_info(&isp->client.dev, "ready for dual-role USB ...\n");
 
@@ -1306,9 +1305,9 @@ isp1301_set_host(struct otg_transceiver *otg, struct usb_bus *host)
 
        dev_info(&isp->client.dev, "A-Host sessions ok\n");
        isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
-               INTR_ID_GND);
+               INTR_ID_GND);
        isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
-               INTR_ID_GND);
+               INTR_ID_GND);
 
        /* If this has a Mini-AB connector, this mode is highly
         * nonstandard ... but can be handy for testing, especially with
@@ -1368,9 +1367,9 @@ isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget)
                isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1, MC1_DAT_SE0);
 
        isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
-               INTR_SESS_VLD);
+               INTR_SESS_VLD);
        isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
-               INTR_VBUS_VLD);
+               INTR_VBUS_VLD);
        dev_info(&isp->client.dev, "B-Peripheral sessions ok\n");
        dump_regs(isp, __FUNCTION__);
 
@@ -1494,7 +1493,7 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind)
        if (!isp)
                return 0;
 
-       INIT_WORK(&isp->work, isp1301_work, isp);
+       INIT_WORK(&isp->work, isp1301_work);
        init_timer(&isp->timer);
        isp->timer.function = isp1301_timer;
        isp->timer.data = (unsigned long) isp;
@@ -1572,13 +1571,14 @@ fail1:
                /* IRQ wired at M14 */
                omap_cfg_reg(M14_1510_GPIO2);
                isp->irq = OMAP_GPIO_IRQ(2);
-               omap_request_gpio(2);
-               omap_set_gpio_direction(2, 1);
-               omap_set_gpio_edge_ctrl(2, OMAP_GPIO_FALLING_EDGE);
+               if (gpio_request(2, "isp1301") == 0)
+                       gpio_direction_input(2);
+               isp->irq_type = IRQF_TRIGGER_FALLING;
        }
 
+       isp->irq_type |= IRQF_SAMPLE_RANDOM;
        status = request_irq(isp->irq, isp1301_irq,
-                       IRQF_SAMPLE_RANDOM, DRIVER_NAME, isp);
+                       isp->irq_type, DRIVER_NAME, isp);
        if (status < 0) {
                dev_dbg(&i2c->dev, "can't get IRQ %d, err %d\n",
                                isp->irq, status);
index 48a7e2f0bdd3c87d9385bd32bb675d52abd88835..d9c92c5e007730ac62f7140ef51f5edb9d5eafb3 100644 (file)
@@ -1,4 +1,3 @@
-#define DEBUG
 /*
  * Copyright (C) 2004 Texas Instruments, Inc.
  *
@@ -933,7 +932,7 @@ static int menelaus_set_time(struct device *dev, struct rtc_time *t)
                return status;
        status = menelaus_write_reg(MENELAUS_RTC_WKDAY, BIN2BCD(t->tm_wday));
        if (status < 0) {
-               dev_err(&the_menelaus->client->dev, "rtc write reg %02x",
+               dev_err(&the_menelaus->client->dev, "rtc write reg %02x "
                                "err %d\n", MENELAUS_RTC_WKDAY, status);
                return status;
        }
index db2633e4aae6ec65b2bc49ecba6752a57b02650f..ae7c2880e6248fff4746613d69330f0f07e55fce 100644 (file)
@@ -78,15 +78,14 @@ ib_get_agent_port(struct ib_device *device, int port_num)
        return entry;
 }
 
-int agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
-                       struct ib_wc *wc, struct ib_device *device,
-                       int port_num, int qpn)
+void agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
+                        struct ib_wc *wc, struct ib_device *device,
+                        int port_num, int qpn)
 {
        struct ib_agent_port_private *port_priv;
        struct ib_mad_agent *agent;
        struct ib_mad_send_buf *send_buf;
        struct ib_ah *ah;
-       int ret;
        struct ib_mad_send_wr_private *mad_send_wr;
 
        if (device->node_type == RDMA_NODE_IB_SWITCH)
@@ -96,23 +95,21 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
 
        if (!port_priv) {
                printk(KERN_ERR SPFX "Unable to find port agent\n");
-               return -ENODEV;
+               return;
        }
 
        agent = port_priv->agent[qpn];
        ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num);
        if (IS_ERR(ah)) {
-               ret = PTR_ERR(ah);
-               printk(KERN_ERR SPFX "ib_create_ah_from_wc error:%d\n", ret);
-               return ret;
+               printk(KERN_ERR SPFX "ib_create_ah_from_wc error\n");
+               return;
        }
 
        send_buf = ib_create_send_mad(agent, wc->src_qp, wc->pkey_index, 0,
                                      IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA,
                                      GFP_KERNEL);
        if (IS_ERR(send_buf)) {
-               ret = PTR_ERR(send_buf);
-               printk(KERN_ERR SPFX "ib_create_send_mad error:%d\n", ret);
+               printk(KERN_ERR SPFX "ib_create_send_mad error\n");
                goto err1;
        }
 
@@ -126,16 +123,15 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
                mad_send_wr->send_wr.wr.ud.port_num = port_num;
        }
 
-       if ((ret = ib_post_send_mad(send_buf, NULL))) {
-               printk(KERN_ERR SPFX "ib_post_send_mad error:%d\n", ret);
+       if (ib_post_send_mad(send_buf, NULL)) {
+               printk(KERN_ERR SPFX "ib_post_send_mad error\n");
                goto err2;
        }
-       return 0;
+       return;
 err2:
        ib_free_send_mad(send_buf);
 err1:
        ib_destroy_ah(ah);
-       return ret;
 }
 
 static void agent_send_handler(struct ib_mad_agent *mad_agent,
index 86d72fab37b0d4cccff79885368e608abd1ebcec..fb9ed1489f95e6e09208ae3a777a60060fd96135 100644 (file)
@@ -46,8 +46,8 @@ extern int ib_agent_port_open(struct ib_device *device, int port_num);
 
 extern int ib_agent_port_close(struct ib_device *device, int port_num);
 
-extern int agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
-                              struct ib_wc *wc, struct ib_device *device,
-                              int port_num, int qpn);
+extern void agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
+                               struct ib_wc *wc, struct ib_device *device,
+                               int port_num, int qpn);
 
 #endif /* __AGENT_H_ */
index 3ada17c0f23921b87094cdacf638dbdc33a927fc..2506c43ba041c996a54a30b80efb455d908da5a7 100644 (file)
@@ -702,7 +702,7 @@ int ib_find_pkey(struct ib_device *device,
                if (ret)
                        return ret;
 
-               if (pkey == tmp_pkey) {
+               if ((pkey & 0x7fff) == (tmp_pkey & 0x7fff)) {
                        *index = i;
                        return 0;
                }
index bc547f1d34ba98d0dc5c5663f2e50b75ff6fe098..6f4287716ab1b63516e89197282925e30e86a279 100644 (file)
@@ -1842,16 +1842,11 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv,
 {
        struct ib_mad_qp_info *qp_info;
        struct ib_mad_private_header *mad_priv_hdr;
-       struct ib_mad_private *recv, *response;
+       struct ib_mad_private *recv, *response = NULL;
        struct ib_mad_list_head *mad_list;
        struct ib_mad_agent_private *mad_agent;
        int port_num;
 
-       response = kmem_cache_alloc(ib_mad_cache, GFP_KERNEL);
-       if (!response)
-               printk(KERN_ERR PFX "ib_mad_recv_done_handler no memory "
-                      "for response buffer\n");
-
        mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id;
        qp_info = mad_list->mad_queue->qp_info;
        dequeue_mad(mad_list);
@@ -1879,6 +1874,13 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv,
        if (!validate_mad(&recv->mad.mad, qp_info->qp->qp_num))
                goto out;
 
+       response = kmem_cache_alloc(ib_mad_cache, GFP_KERNEL);
+       if (!response) {
+               printk(KERN_ERR PFX "ib_mad_recv_done_handler no memory "
+                      "for response buffer\n");
+               goto out;
+       }
+
        if (port_priv->device->node_type == RDMA_NODE_IB_SWITCH)
                port_num = wc->port_num;
        else
@@ -1914,12 +1916,11 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv,
                        response->header.recv_wc.recv_buf.mad = &response->mad.mad;
                        response->header.recv_wc.recv_buf.grh = &response->grh;
 
-                       if (!agent_send_response(&response->mad.mad,
-                                                &response->grh, wc,
-                                                port_priv->device,
-                                                smi_get_fwd_port(&recv->mad.smp),
-                                                qp_info->qp->qp_num))
-                               response = NULL;
+                       agent_send_response(&response->mad.mad,
+                                           &response->grh, wc,
+                                           port_priv->device,
+                                           smi_get_fwd_port(&recv->mad.smp),
+                                           qp_info->qp->qp_num);
 
                        goto out;
                }
index 3663fd7022be6764d60d19ff7a19039931802723..d43bc62005b3d151607f212d2a66f90003b8639f 100644 (file)
@@ -163,8 +163,10 @@ static struct ib_mad_send_buf *alloc_response_msg(struct ib_mad_agent *agent,
                                 hdr_len, 0, GFP_KERNEL);
        if (IS_ERR(msg))
                ib_destroy_ah(ah);
-       else
+       else {
                msg->ah = ah;
+               msg->context[0] = ah;
+       }
 
        return msg;
 }
@@ -197,9 +199,7 @@ static void ack_ds_ack(struct ib_mad_agent_private *agent,
 
 void ib_rmpp_send_handler(struct ib_mad_send_wc *mad_send_wc)
 {
-       struct ib_rmpp_mad *rmpp_mad = mad_send_wc->send_buf->mad;
-
-       if (rmpp_mad->rmpp_hdr.rmpp_type != IB_MGMT_RMPP_TYPE_ACK)
+       if (mad_send_wc->send_buf->context[0] == mad_send_wc->send_buf->ah)
                ib_destroy_ah(mad_send_wc->send_buf->ah);
        ib_free_send_mad(mad_send_wc->send_buf);
 }
index 20ab6b3e484d517f29a21fa316f51e01681b30c7..d271bd715c12920a9a0e907f28865e1e120a816e 100644 (file)
@@ -385,9 +385,7 @@ static void update_sm_ah(struct work_struct *work)
 
        new_ah->pkey_index = 0;
        if (ib_find_pkey(port->agent->device, port->port_num,
-                        IB_DEFAULT_PKEY_FULL, &new_ah->pkey_index) &&
-           ib_find_pkey(port->agent->device, port->port_num,
-                        IB_DEFAULT_PKEY_PARTIAL, &new_ah->pkey_index))
+                        IB_DEFAULT_PKEY_FULL, &new_ah->pkey_index))
                printk(KERN_ERR "Couldn't find index for default PKey\n");
 
        memset(&ah_attr, 0, sizeof ah_attr);
index 26d0470eef6ec2c2a3abb706c821cc23437e26c1..664d2faa9e744b48aa6ce11e4c195ad18d2d66eb 100644 (file)
 
 #include "uverbs.h"
 
+#define IB_UMEM_MAX_PAGE_CHUNK                                         \
+       ((PAGE_SIZE - offsetof(struct ib_umem_chunk, page_list)) /      \
+        ((void *) &((struct ib_umem_chunk *) 0)->page_list[1] -        \
+         (void *) &((struct ib_umem_chunk *) 0)->page_list[0]))
+
 static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int dirty)
 {
        struct ib_umem_chunk *chunk, *tmp;
index 9574088f0d4e6e5857427cddb6a1ff2b277175b4..1cdfcd43b0bcb6bd8dff940fd4c11d19c07fc3ea 100644 (file)
@@ -139,7 +139,7 @@ static void release_tid(struct t3cdev *tdev, u32 hwtid, struct sk_buff *skb)
        req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
        OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, hwtid));
        skb->priority = CPL_PRIORITY_SETUP;
-       tdev->send(tdev, skb);
+       cxgb3_ofld_send(tdev, skb);
        return;
 }
 
@@ -161,7 +161,7 @@ int iwch_quiesce_tid(struct iwch_ep *ep)
        req->val = cpu_to_be64(1 << S_TCB_RX_QUIESCE);
 
        skb->priority = CPL_PRIORITY_DATA;
-       ep->com.tdev->send(ep->com.tdev, skb);
+       cxgb3_ofld_send(ep->com.tdev, skb);
        return 0;
 }
 
@@ -183,7 +183,7 @@ int iwch_resume_tid(struct iwch_ep *ep)
        req->val = 0;
 
        skb->priority = CPL_PRIORITY_DATA;
-       ep->com.tdev->send(ep->com.tdev, skb);
+       cxgb3_ofld_send(ep->com.tdev, skb);
        return 0;
 }
 
@@ -784,7 +784,7 @@ static int update_rx_credits(struct iwch_ep *ep, u32 credits)
        OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RX_DATA_ACK, ep->hwtid));
        req->credit_dack = htonl(V_RX_CREDITS(credits) | V_RX_FORCE_ACK(1));
        skb->priority = CPL_PRIORITY_ACK;
-       ep->com.tdev->send(ep->com.tdev, skb);
+       cxgb3_ofld_send(ep->com.tdev, skb);
        return credits;
 }
 
@@ -1152,7 +1152,7 @@ static int listen_start(struct iwch_listen_ep *ep)
        req->opt1 = htonl(V_CONN_POLICY(CPL_CONN_POLICY_ASK));
 
        skb->priority = 1;
-       ep->com.tdev->send(ep->com.tdev, skb);
+       cxgb3_ofld_send(ep->com.tdev, skb);
        return 0;
 }
 
@@ -1186,7 +1186,7 @@ static int listen_stop(struct iwch_listen_ep *ep)
        req->cpu_idx = 0;
        OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, ep->stid));
        skb->priority = 1;
-       ep->com.tdev->send(ep->com.tdev, skb);
+       cxgb3_ofld_send(ep->com.tdev, skb);
        return 0;
 }
 
@@ -1264,7 +1264,7 @@ static void reject_cr(struct t3cdev *tdev, u32 hwtid, __be32 peer_ip,
                rpl->opt0l_status = htonl(CPL_PASS_OPEN_REJECT);
                rpl->opt2 = 0;
                rpl->rsvd = rpl->opt2;
-               tdev->send(tdev, skb);
+               cxgb3_ofld_send(tdev, skb);
        }
 }
 
@@ -1557,7 +1557,7 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
        rpl->wr.wr_lo = htonl(V_WR_TID(ep->hwtid));
        OPCODE_TID(rpl) = htonl(MK_OPCODE_TID(CPL_ABORT_RPL, ep->hwtid));
        rpl->cmd = CPL_ABORT_NO_RST;
-       ep->com.tdev->send(ep->com.tdev, rpl_skb);
+       cxgb3_ofld_send(ep->com.tdev, rpl_skb);
        if (state != ABORTING) {
                state_set(&ep->com, DEAD);
                release_ep_resources(ep);
index 660b27aecae56e42b54f0a4764079d7563a5119f..8bf44daf45ecd851e858bc72b12678ada60be0d8 100644 (file)
@@ -389,7 +389,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
                        wc->opcode    = IB_WC_SEND;
                        break;
                case MLX4_OPCODE_RDMA_READ:
-                       wc->opcode    = IB_WC_SEND;
+                       wc->opcode    = IB_WC_RDMA_READ;
                        wc->byte_len  = be32_to_cpu(cqe->byte_cnt);
                        break;
                case MLX4_OPCODE_ATOMIC_CS:
index 333091787c5f57548a14bc3cc3d06770c81d5cd1..0ed02b7834dab398e09b141f67a0a50f2ef46766 100644 (file)
@@ -109,7 +109,7 @@ int mlx4_MAD_IFC(struct mlx4_ib_dev *dev, int ignore_mkey, int ignore_bkey,
                           in_modifier, op_modifier,
                           MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C);
 
-       if (!err);
+       if (!err)
                memcpy(response_mad, outmailbox->buf, 256);
 
        mlx4_free_cmd_mailbox(dev->dev, inmailbox);
index 982eb88e27ec0f2451ac4ee5ced6bc72e47e7129..563aeacf9e14088cc9054030f418d4c0bf717756 100644 (file)
@@ -211,6 +211,7 @@ out_free_cq:
 
 out_free_mr:
        ib_dereg_mr(priv->mr);
+       ipoib_cm_dev_cleanup(dev);
 
 out_free_pd:
        ib_dealloc_pd(priv->pd);
index f01ca182f226a5df9c1d21adf195458ca95325e6..f6a05142814447fb3106fb7037e0b541d0a908c7 100644 (file)
@@ -75,16 +75,12 @@ module_param(topspin_workarounds, int, 0444);
 MODULE_PARM_DESC(topspin_workarounds,
                 "Enable workarounds for Topspin/Cisco SRP target bugs if != 0");
 
-static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad };
-
 static int mellanox_workarounds = 1;
 
 module_param(mellanox_workarounds, int, 0444);
 MODULE_PARM_DESC(mellanox_workarounds,
                 "Enable workarounds for Mellanox SRP target bugs if != 0");
 
-static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 };
-
 static void srp_add_one(struct ib_device *device);
 static void srp_remove_one(struct ib_device *device);
 static void srp_completion(struct ib_cq *cq, void *target_ptr);
@@ -108,6 +104,24 @@ static const char *srp_target_info(struct Scsi_Host *host)
        return host_to_target(host)->target_name;
 }
 
+static int srp_target_is_topspin(struct srp_target_port *target)
+{
+       static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad };
+       static const u8 cisco_oui[3]   = { 0x00, 0x1b, 0x0d };
+
+       return topspin_workarounds &&
+               (!memcmp(&target->ioc_guid, topspin_oui, sizeof topspin_oui) ||
+                !memcmp(&target->ioc_guid, cisco_oui, sizeof cisco_oui));
+}
+
+static int srp_target_is_mellanox(struct srp_target_port *target)
+{
+       static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 };
+
+       return mellanox_workarounds &&
+               !memcmp(&target->ioc_guid, mellanox_oui, sizeof mellanox_oui);
+}
+
 static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size,
                                   gfp_t gfp_mask,
                                   enum dma_data_direction direction)
@@ -360,7 +374,7 @@ static int srp_send_req(struct srp_target_port *target)
         * zero out the first 8 bytes of our initiator port ID and set
         * the second 8 bytes to the local node GUID.
         */
-       if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) {
+       if (srp_target_is_topspin(target)) {
                printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround "
                       "activated for target GUID %016llx\n",
                       (unsigned long long) be64_to_cpu(target->ioc_guid));
@@ -585,8 +599,8 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
        if (!dev->fmr_pool)
                return -ENODEV;
 
-       if ((ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask) &&
-           mellanox_workarounds && !memcmp(&target->ioc_guid, mellanox_oui, 3))
+       if (srp_target_is_mellanox(target) &&
+           (ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask))
                return -EINVAL;
 
        len = page_cnt = 0;
@@ -1087,8 +1101,7 @@ static void srp_cm_rej_handler(struct ib_cm_id *cm_id,
                break;
 
        case IB_CM_REJ_PORT_REDIRECT:
-               if (topspin_workarounds &&
-                   !memcmp(&target->ioc_guid, topspin_oui, 3)) {
+               if (srp_target_is_topspin(target)) {
                        /*
                         * Topspin/Cisco SRP gateways incorrectly send
                         * reject reason code 25 when they mean 24
index 001c66dd3a94055a53e60da7f9988e6c6236b854..a8c0f436cdd2b3088e4cdeb165841f243e2823d0 100644 (file)
@@ -1555,6 +1555,7 @@ vortex_up(struct net_device *dev)
                mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
                mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA);
                vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
+               vp->mii.full_duplex = vp->full_duplex;
 
                vortex_check_media(dev, 1);
        }
index 83da1770bafb6cde94eb3bda73b97e2118996fae..90e0734e60375abe0325cc5cfd0c7a49e0b9c43f 100644 (file)
@@ -821,8 +821,9 @@ static int ax_probe(struct platform_device *pdev)
        dev->base_addr = (unsigned long)ei_status.mem;
 
        if (ei_status.mem == NULL) {
-               dev_err(&pdev->dev, "Cannot ioremap area (%08zx,%08zx)\n",
-                       res->start, res->end);
+               dev_err(&pdev->dev, "Cannot ioremap area (%08llx,%08llx)\n",
+                       (unsigned long long)res->start,
+                       (unsigned long long)res->end);
 
                ret = -ENXIO;
                goto exit_req;
index 070b78d959cc1f3f87dc709aecbc4d5d06f3e286..1afda3230defc01c1d38db13f9e17cf8b80397cd 100644 (file)
@@ -1202,43 +1202,35 @@ static int bond_sethwaddr(struct net_device *bond_dev,
        return 0;
 }
 
-#define BOND_INTERSECT_FEATURES \
-       (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_TSO | NETIF_F_UFO)
+#define BOND_VLAN_FEATURES \
+       (NETIF_F_VLAN_CHALLENGED | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX | \
+        NETIF_F_HW_VLAN_FILTER)
 
 /* 
  * Compute the common dev->feature set available to all slaves.  Some
- * feature bits are managed elsewhere, so preserve feature bits set on
- * master device that are not part of the examined set.
+ * feature bits are managed elsewhere, so preserve those feature bits
+ * on the master device.
  */
 static int bond_compute_features(struct bonding *bond)
 {
-       unsigned long features = BOND_INTERSECT_FEATURES;
        struct slave *slave;
        struct net_device *bond_dev = bond->dev;
+       unsigned long features = bond_dev->features;
        unsigned short max_hard_header_len = ETH_HLEN;
        int i;
 
+       features &= ~(NETIF_F_ALL_CSUM | BOND_VLAN_FEATURES);
+       features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
+                   NETIF_F_GSO_MASK | NETIF_F_NO_CSUM;
+
        bond_for_each_slave(bond, slave, i) {
-               features &= (slave->dev->features & BOND_INTERSECT_FEATURES);
+               features = netdev_compute_features(features,
+                                                  slave->dev->features);
                if (slave->dev->hard_header_len > max_hard_header_len)
                        max_hard_header_len = slave->dev->hard_header_len;
        }
 
-       if ((features & NETIF_F_SG) && 
-           !(features & NETIF_F_ALL_CSUM))
-               features &= ~NETIF_F_SG;
-
-       /* 
-        * features will include NETIF_F_TSO (NETIF_F_UFO) iff all 
-        * slave devices support NETIF_F_TSO (NETIF_F_UFO), which 
-        * implies that all slaves also support scatter-gather 
-        * (NETIF_F_SG), which implies that features also includes 
-        * NETIF_F_SG. So no need to check whether we have an  
-        * illegal combination of NETIF_F_{TSO,UFO} and 
-        * !NETIF_F_SG 
-        */
-
-       features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES);
+       features |= (bond_dev->features & BOND_VLAN_FEATURES);
        bond_dev->features = features;
        bond_dev->hard_header_len = max_hard_header_len;
 
index c90c92e72d2a525839e0f5d181aac56fffa94cb9..4c3785c9d4b811067b5af3dafd0de33224591bae 100644 (file)
@@ -1706,6 +1706,7 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol
        case E1000_DEV_ID_82545EM_COPPER:
        case E1000_DEV_ID_82546GB_QUAD_COPPER:
        case E1000_DEV_ID_82546GB_PCIE:
+       case E1000_DEV_ID_82571EB_SERDES_QUAD:
                /* these don't support WoL at all */
                wol->supported = 0;
                break;
@@ -1723,6 +1724,7 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol
                retval = 0;
                break;
        case E1000_DEV_ID_82571EB_QUAD_COPPER:
+       case E1000_DEV_ID_82571EB_QUAD_FIBER:
        case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE:
        case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
                /* quad port adapters only support WoL on port A */
index 9be44699300b8a350041d923917cae5630b724c0..ba120f7fb0bef2c619475fcd5742170f02b44124 100644 (file)
@@ -384,7 +384,10 @@ e1000_set_mac_type(struct e1000_hw *hw)
        case E1000_DEV_ID_82571EB_COPPER:
        case E1000_DEV_ID_82571EB_FIBER:
        case E1000_DEV_ID_82571EB_SERDES:
+       case E1000_DEV_ID_82571EB_SERDES_DUAL:
+       case E1000_DEV_ID_82571EB_SERDES_QUAD:
        case E1000_DEV_ID_82571EB_QUAD_COPPER:
+       case E1000_DEV_ID_82571EB_QUAD_FIBER:
        case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE:
                hw->mac_type = e1000_82571;
                break;
@@ -485,6 +488,8 @@ e1000_set_media_type(struct e1000_hw *hw)
     case E1000_DEV_ID_82545GM_SERDES:
     case E1000_DEV_ID_82546GB_SERDES:
     case E1000_DEV_ID_82571EB_SERDES:
+    case E1000_DEV_ID_82571EB_SERDES_DUAL:
+    case E1000_DEV_ID_82571EB_SERDES_QUAD:
     case E1000_DEV_ID_82572EI_SERDES:
     case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
         hw->media_type = e1000_media_type_internal_serdes;
index bd000b802ee7190a325e9b573621350affe4ce36..fe8714655c90445808000870543f5539d70e1dfa 100644 (file)
@@ -475,7 +475,10 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
 #define E1000_DEV_ID_82571EB_FIBER       0x105F
 #define E1000_DEV_ID_82571EB_SERDES      0x1060
 #define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4
+#define E1000_DEV_ID_82571EB_QUAD_FIBER  0x10A5
 #define E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE  0x10BC
+#define E1000_DEV_ID_82571EB_SERDES_DUAL 0x10D9
+#define E1000_DEV_ID_82571EB_SERDES_QUAD 0x10DA
 #define E1000_DEV_ID_82572EI_COPPER      0x107D
 #define E1000_DEV_ID_82572EI_FIBER       0x107E
 #define E1000_DEV_ID_82572EI_SERDES      0x107F
index f48b659e0c2bd3dbdfbb6015ad22acdd5f876951..4a225950fb43f6cbe30feff14945857305825dbe 100644 (file)
@@ -100,6 +100,7 @@ static struct pci_device_id e1000_pci_tbl[] = {
        INTEL_E1000_ETHERNET_DEVICE(0x1099),
        INTEL_E1000_ETHERNET_DEVICE(0x109A),
        INTEL_E1000_ETHERNET_DEVICE(0x10A4),
+       INTEL_E1000_ETHERNET_DEVICE(0x10A5),
        INTEL_E1000_ETHERNET_DEVICE(0x10B5),
        INTEL_E1000_ETHERNET_DEVICE(0x10B9),
        INTEL_E1000_ETHERNET_DEVICE(0x10BA),
@@ -107,6 +108,8 @@ static struct pci_device_id e1000_pci_tbl[] = {
        INTEL_E1000_ETHERNET_DEVICE(0x10BC),
        INTEL_E1000_ETHERNET_DEVICE(0x10C4),
        INTEL_E1000_ETHERNET_DEVICE(0x10C5),
+       INTEL_E1000_ETHERNET_DEVICE(0x10D9),
+       INTEL_E1000_ETHERNET_DEVICE(0x10DA),
        /* required last entry */
        {0,}
 };
@@ -1096,6 +1099,7 @@ e1000_probe(struct pci_dev *pdev,
                break;
        case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
        case E1000_DEV_ID_82571EB_QUAD_COPPER:
+       case E1000_DEV_ID_82571EB_QUAD_FIBER:
        case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE:
                /* if quad port adapter, disable WoL on all but port A */
                if (global_quad_port_a != 0)
index 0ac240ca905b8504d7a9524e532c0a6f5e504608..3b0fd83fa26634351695b3f98e68a550c83d5701 100644 (file)
@@ -1561,10 +1561,9 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf
        struct irda_class_desc *desc;
        int ret;
 
-       desc = kmalloc(sizeof (*desc), GFP_KERNEL);
-       if (desc == NULL) 
+       desc = kzalloc(sizeof(*desc), GFP_KERNEL);
+       if (!desc)
                return NULL;
-       memset(desc, 0, sizeof(*desc));
 
        /* USB-IrDA class spec 1.0:
         *      6.1.3: Standard "Get Descriptor" Device Request is not
@@ -1617,7 +1616,7 @@ static int irda_usb_probe(struct usb_interface *intf,
 {
        struct net_device *net;
        struct usb_device *dev = interface_to_usbdev(intf);
-       struct irda_usb_cb *self = NULL;
+       struct irda_usb_cb *self;
        struct usb_host_interface *interface;
        struct irda_class_desc *irda_desc;
        int ret = -ENOMEM;
@@ -1655,7 +1654,7 @@ static int irda_usb_probe(struct usb_interface *intf,
                self->header_length = USB_IRDA_HEADER;
        }
 
-       self->rx_urb = kzalloc(self->max_rx_urb * sizeof(struct urb *),
+       self->rx_urb = kcalloc(self->max_rx_urb, sizeof(struct urb *),
                                GFP_KERNEL);
 
        for (i = 0; i < self->max_rx_urb; i++) {
@@ -1715,7 +1714,7 @@ static int irda_usb_probe(struct usb_interface *intf,
        /* Find IrDA class descriptor */
        irda_desc = irda_usb_find_class_desc(intf);
        ret = -ENODEV;
-       if (irda_desc == NULL)
+       if (!irda_desc)
                goto err_out_3;
 
        if (self->needspatch) {
@@ -1738,15 +1737,13 @@ static int irda_usb_probe(struct usb_interface *intf,
        /* Don't change this buffer size and allocation without doing
         * some heavy and complete testing. Don't ask why :-(
         * Jean II */
-       self->speed_buff = kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
-       if (self->speed_buff == NULL) 
+       self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
+       if (!self->speed_buff)
                goto err_out_3;
 
-       memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU);
-
        self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length,
                                GFP_KERNEL);
-       if (self->tx_buff == NULL)
+       if (!self->tx_buff)
                goto err_out_4;
 
        ret = irda_usb_open(self);
@@ -1767,12 +1764,11 @@ static int irda_usb_probe(struct usb_interface *intf,
 
                /* replace IrDA class descriptor with what patched device is now reporting */
                irda_desc = irda_usb_find_class_desc (self->usbintf);
-               if (irda_desc == NULL) {
+               if (!irda_desc) {
                        ret = -ENODEV;
                        goto err_out_6;
                }
-               if (self->irda_desc)
-                       kfree (self->irda_desc);
+               kfree(self->irda_desc);
                self->irda_desc = irda_desc;
                irda_usb_init_qos(self);
        }
index e4dfd4b11a4a2f41616a7aecd199f91227e84e61..e199715fabd0947d6014a9b068bd583aa3745eb6 100644 (file)
@@ -119,6 +119,9 @@ int mlx4_reset(struct mlx4_dev *dev)
        writel(MLX4_RESET_VALUE, reset + MLX4_RESET_OFFSET);
        iounmap(reset);
 
+       /* Docs say to wait one second before accessing device */
+       msleep(1000);
+
        end = jiffies + MLX4_RESET_TIMEOUT_JIFFIES;
        do {
                if (!pci_read_config_word(dev->pdev, PCI_VENDOR_ID, &vendor) &&
index deca65330b0f19f2ed085b8c3aeb146db77017f2..ae9bb7b7fd6756d240c7b2587a8d6afd5d23c5ec 100644 (file)
@@ -191,6 +191,7 @@ struct myri10ge_priv {
        struct timer_list watchdog_timer;
        int watchdog_tx_done;
        int watchdog_tx_req;
+       int watchdog_pause;
        int watchdog_resets;
        int tx_linearized;
        int pause;
@@ -2800,6 +2801,7 @@ static void myri10ge_watchdog(struct work_struct *work)
 static void myri10ge_watchdog_timer(unsigned long arg)
 {
        struct myri10ge_priv *mgp;
+       u32 rx_pause_cnt;
 
        mgp = (struct myri10ge_priv *)arg;
 
@@ -2816,19 +2818,28 @@ static void myri10ge_watchdog_timer(unsigned long arg)
                    myri10ge_fill_thresh)
                        mgp->rx_big.watchdog_needed = 0;
        }
+       rx_pause_cnt = ntohl(mgp->fw_stats->dropped_pause);
 
        if (mgp->tx.req != mgp->tx.done &&
            mgp->tx.done == mgp->watchdog_tx_done &&
-           mgp->watchdog_tx_req != mgp->watchdog_tx_done)
+           mgp->watchdog_tx_req != mgp->watchdog_tx_done) {
                /* nic seems like it might be stuck.. */
-               schedule_work(&mgp->watchdog_work);
-       else
-               /* rearm timer */
-               mod_timer(&mgp->watchdog_timer,
-                         jiffies + myri10ge_watchdog_timeout * HZ);
-
+               if (rx_pause_cnt != mgp->watchdog_pause) {
+                       if (net_ratelimit())
+                               printk(KERN_WARNING "myri10ge %s:"
+                                      "TX paused, check link partner\n",
+                                      mgp->dev->name);
+               } else {
+                       schedule_work(&mgp->watchdog_work);
+                       return;
+               }
+       }
+       /* rearm timer */
+       mod_timer(&mgp->watchdog_timer,
+                 jiffies + myri10ge_watchdog_timeout * HZ);
        mgp->watchdog_tx_done = mgp->tx.done;
        mgp->watchdog_tx_req = mgp->tx.req;
+       mgp->watchdog_pause = rx_pause_cnt;
 }
 
 static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
index 6bb48ba809649ca7e3ab940f42ba98ba1f9dc643..b47a12d684f9ed30dd0b8cd302c09259ee394636 100644 (file)
@@ -2438,13 +2438,16 @@ static void netdev_error(struct net_device *dev, int intr_status)
                                dev->name);
                }
                np->stats.rx_fifo_errors++;
+               np->stats.rx_errors++;
        }
        /* Hmmmmm, it's not clear how to recover from PCI faults. */
        if (intr_status & IntrPCIErr) {
                printk(KERN_NOTICE "%s: PCI error %#08x\n", dev->name,
                        intr_status & IntrPCIErr);
                np->stats.tx_fifo_errors++;
+               np->stats.tx_errors++;
                np->stats.rx_fifo_errors++;
+               np->stats.rx_errors++;
        }
        spin_unlock(&np->lock);
 }
index c3fe230695a0132bee7c882d646266b96fe0e41b..b56dff26772de6a1f194b446a481c286439b7d77 100644 (file)
@@ -42,7 +42,13 @@ static int max_interrupt_work = 20;
 
 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
    Setting to > 1518 effectively disables this feature. */
+#if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \
+       || defined(CONFIG_SPARC) || defined(__ia64__) \
+       || defined(__sh__) || defined(__mips__)
+static int rx_copybreak = 1518;
+#else
 static int rx_copybreak;
+#endif
 
 /* Work-around for broken BIOSes: they are unable to get the chip back out of
    power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */
index 15b6e07a4382020a4d8fc9aaeb721c3dd0953732..071a64cacd5c29cdedfc959c922bea885a7a7cc2 100644 (file)
@@ -212,14 +212,13 @@ static pvc_device* add_pvc(struct net_device *dev, u16 dlci)
                pvc_p = &(*pvc_p)->next;
        }
 
-       pvc = kmalloc(sizeof(pvc_device), GFP_ATOMIC);
+       pvc = kzalloc(sizeof(pvc_device), GFP_ATOMIC);
 #ifdef DEBUG_PVC
        printk(KERN_DEBUG "add_pvc: allocated pvc %p, frad %p\n", pvc, dev);
 #endif
        if (!pvc)
                return NULL;
 
-       memset(pvc, 0, sizeof(pvc_device));
        pvc->dlci = dlci;
        pvc->frad = dev;
        pvc->next = *pvc_p;     /* Put it in the chain */
index 489f69c5d6ca057f671c8d78faa42c1683814e62..4445810335a8ef7dff90f4c01683308d12e66c73 100644 (file)
@@ -566,6 +566,10 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (notify)
                notify_remote_via_irq(np->netdev->irq);
 
+       np->stats.tx_bytes += skb->len;
+       np->stats.tx_packets++;
+
+       /* Note: It is not safe to access skb after xennet_tx_buf_gc()! */
        xennet_tx_buf_gc(dev);
 
        if (!netfront_tx_slot_available(np))
@@ -573,9 +577,6 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        spin_unlock_irq(&np->tx_lock);
 
-       np->stats.tx_bytes += skb->len;
-       np->stats.tx_packets++;
-
        return 0;
 
  drop:
index 6d84ca2beead8db4b0cd324c6c1ccc9d5b56a0d3..bed6215c0794ef8d9264b113aff767dc85ef4025 100644 (file)
@@ -3,7 +3,10 @@ Version 1.50
 Fix NTLMv2 signing. NFS server mounted over cifs works (if cifs mount is
 done with "serverino" mount option).  Add support for POSIX Unlink
 (helps with certain sharing violation cases when server such as
-Samba supports newer POSIX CIFS Protocol Extensions).
+Samba supports newer POSIX CIFS Protocol Extensions). Add "nounix"
+mount option to allow disabling the CIFS Unix Extensions for just
+that mount. Fix hang on spinlock in find_writable_file (race when
+reopening file after session crash).
 
 Version 1.49
 ------------
index 85f1eb14083eb2c3057027f60863f80db82df1b8..b806b11b5560e912f67fca11219381328744dd34 100644 (file)
@@ -444,6 +444,13 @@ A partial list of the supported mount options follows:
  noposixpaths   If CIFS Unix extensions are supported, do not request
                posix path name support (this may cause servers to
                reject creatingfile with certain reserved characters).
+ nounix         Disable the CIFS Unix Extensions for this mount (tree
+               connection). This is rarely needed, but it may be useful
+               in order to turn off multiple settings all at once (ie
+               posix acls, posix locks, posix paths, symlink support
+               and retrieving uids/gids/mode from the server) or to
+               work around a bug in server which implement the Unix
+               Extensions.
  nobrl          Do not send byte range lock requests to the server.
                This is necessary for certain applications that break
                with cifs style mandatory byte range locks (and most
@@ -451,6 +458,12 @@ A partial list of the supported mount options follows:
                byte range locks).
  remount        remount the share (often used to change from ro to rw mounts
                or vice versa)
+ servern        Specify the server 's netbios name (RFC1001 name) to use
+               when attempting to setup a session to the server.  This is
+               This is needed for mounting to some older servers (such
+               as OS/2 or Windows 98 and Windows ME) since they do not
+               support a default server name.  A server name can be up
+               to 15 characters long and is usually uppercased.
  sfu            When the CIFS Unix Extensions are not negotiated, attempt to
                create device files and fifos in a format compatible with
                Services for Unix (SFU).  In addition retrieve bits 10-12
index d7bd51575fd63888ab34f4de3f4c579187b02b81..29d4b2715254847cdf702283b96681e50ce1ed4a 100644 (file)
@@ -82,8 +82,7 @@ u) DOS attrs - returned as pseudo-xattr in Samba format (check VFAT and NTFS for
 
 v) mount check for unmatched uids
 
-w) Add mount option for Linux extension disable per mount, and partial
-disable per mount (uid off, symlink/fifo/mknod on but what about posix acls?)
+w) Add support for new vfs entry points for setlease and fallocate 
 
 x) Fix Samba 3 server to handle Linux kernel aio so dbench with lots of 
 processes can proceed better in parallel (on the server)
index e13592afca9c830565c420295cbc186e9f834fee..894b1f7b299d5d5dc679b391bb54ca6e1abc092e 100644 (file)
@@ -1904,6 +1904,25 @@ static int cifs_readpage(struct file *file, struct page *page)
        return rc;
 }
 
+static int is_inode_writable(struct cifsInodeInfo *cifs_inode)
+{
+       struct cifsFileInfo *open_file;
+
+       read_lock(&GlobalSMBSeslock);
+       list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
+               if (open_file->closePend)
+                       continue;
+               if (open_file->pfile &&
+                   ((open_file->pfile->f_flags & O_RDWR) ||
+                    (open_file->pfile->f_flags & O_WRONLY))) {
+                       read_unlock(&GlobalSMBSeslock);
+                       return 1;
+               }
+       }
+       read_unlock(&GlobalSMBSeslock);
+       return 0;
+}
+
 /* We do not want to update the file size from server for inodes
    open for write - to avoid races with writepage extending
    the file - in the future we could consider allowing
@@ -1912,19 +1931,13 @@ static int cifs_readpage(struct file *file, struct page *page)
    page caching in the current Linux kernel design */
 int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
 {
-       struct cifsFileInfo *open_file = NULL;
-
-       if (cifsInode)
-               open_file =  find_writable_file(cifsInode);
+       if (!cifsInode)
+               return 1;
 
-       if (open_file) {
+       if (is_inode_writable(cifsInode)) {
+               /* This inode is open for write at least once */
                struct cifs_sb_info *cifs_sb;
 
-               /* there is not actually a write pending so let
-               this handle go free and allow it to
-               be closable if needed */
-               atomic_dec(&open_file->wrtPending);
-
                cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb);
                if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) {
                        /* since no page cache to corrupt on directio
index 2ea027dda215cc2053d6645ca8a306ed959220c6..892be9b4d1f362351de1c0075b2f9b3086aff514 100644 (file)
@@ -372,6 +372,10 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
 
        /* 2000 big enough to fit max user, domain, NOS name etc. */
        str_area = kmalloc(2000, GFP_KERNEL);
+       if (str_area == NULL) {
+               cifs_small_buf_release(smb_buf);
+               return -ENOMEM;
+       }
        bcc_ptr = str_area;
 
        ses->flags &= ~CIFS_SES_LANMAN;
index b455919c19984ad408d4ca498ad72f40a7d33d1f..2082daf083d86cdec3b3697e061f8f3ff703e867 100644 (file)
@@ -1670,9 +1670,10 @@ static int can_be_granted(struct dlm_rsb *r, struct dlm_lkb *lkb, int now,
    with a deadlk here, we'd have to generate something like grant_lock with
    the deadlk error.) */
 
-/* returns the highest requested mode of all blocked conversions */
+/* Returns the highest requested mode of all blocked conversions; sets
+   cw if there's a blocked conversion to DLM_LOCK_CW. */
 
-static int grant_pending_convert(struct dlm_rsb *r, int high)
+static int grant_pending_convert(struct dlm_rsb *r, int high, int *cw)
 {
        struct dlm_lkb *lkb, *s;
        int hi, demoted, quit, grant_restart, demote_restart;
@@ -1709,6 +1710,9 @@ static int grant_pending_convert(struct dlm_rsb *r, int high)
                }
 
                hi = max_t(int, lkb->lkb_rqmode, hi);
+
+               if (cw && lkb->lkb_rqmode == DLM_LOCK_CW)
+                       *cw = 1;
        }
 
        if (grant_restart)
@@ -1721,29 +1725,52 @@ static int grant_pending_convert(struct dlm_rsb *r, int high)
        return max_t(int, high, hi);
 }
 
-static int grant_pending_wait(struct dlm_rsb *r, int high)
+static int grant_pending_wait(struct dlm_rsb *r, int high, int *cw)
 {
        struct dlm_lkb *lkb, *s;
 
        list_for_each_entry_safe(lkb, s, &r->res_waitqueue, lkb_statequeue) {
                if (can_be_granted(r, lkb, 0, NULL))
                        grant_lock_pending(r, lkb);
-                else
+                else {
                        high = max_t(int, lkb->lkb_rqmode, high);
+                       if (lkb->lkb_rqmode == DLM_LOCK_CW)
+                               *cw = 1;
+               }
        }
 
        return high;
 }
 
+/* cw of 1 means there's a lock with a rqmode of DLM_LOCK_CW that's blocked
+   on either the convert or waiting queue.
+   high is the largest rqmode of all locks blocked on the convert or
+   waiting queue. */
+
+static int lock_requires_bast(struct dlm_lkb *gr, int high, int cw)
+{
+       if (gr->lkb_grmode == DLM_LOCK_PR && cw) {
+               if (gr->lkb_highbast < DLM_LOCK_EX)
+                       return 1;
+               return 0;
+       }
+
+       if (gr->lkb_highbast < high &&
+           !__dlm_compat_matrix[gr->lkb_grmode+1][high+1])
+               return 1;
+       return 0;
+}
+
 static void grant_pending_locks(struct dlm_rsb *r)
 {
        struct dlm_lkb *lkb, *s;
        int high = DLM_LOCK_IV;
+       int cw = 0;
 
        DLM_ASSERT(is_master(r), dlm_dump_rsb(r););
 
-       high = grant_pending_convert(r, high);
-       high = grant_pending_wait(r, high);
+       high = grant_pending_convert(r, high, &cw);
+       high = grant_pending_wait(r, high, &cw);
 
        if (high == DLM_LOCK_IV)
                return;
@@ -1751,27 +1778,41 @@ static void grant_pending_locks(struct dlm_rsb *r)
        /*
         * If there are locks left on the wait/convert queue then send blocking
         * ASTs to granted locks based on the largest requested mode (high)
-        * found above. FIXME: highbast < high comparison not valid for PR/CW.
+        * found above.
         */
 
        list_for_each_entry_safe(lkb, s, &r->res_grantqueue, lkb_statequeue) {
-               if (lkb->lkb_bastaddr && (lkb->lkb_highbast < high) &&
-                   !__dlm_compat_matrix[lkb->lkb_grmode+1][high+1]) {
-                       queue_bast(r, lkb, high);
+               if (lkb->lkb_bastaddr && lock_requires_bast(lkb, high, cw)) {
+                       if (cw && high == DLM_LOCK_PR)
+                               queue_bast(r, lkb, DLM_LOCK_CW);
+                       else
+                               queue_bast(r, lkb, high);
                        lkb->lkb_highbast = high;
                }
        }
 }
 
+static int modes_require_bast(struct dlm_lkb *gr, struct dlm_lkb *rq)
+{
+       if ((gr->lkb_grmode == DLM_LOCK_PR && rq->lkb_rqmode == DLM_LOCK_CW) ||
+           (gr->lkb_grmode == DLM_LOCK_CW && rq->lkb_rqmode == DLM_LOCK_PR)) {
+               if (gr->lkb_highbast < DLM_LOCK_EX)
+                       return 1;
+               return 0;
+       }
+
+       if (gr->lkb_highbast < rq->lkb_rqmode && !modes_compat(gr, rq))
+               return 1;
+       return 0;
+}
+
 static void send_bast_queue(struct dlm_rsb *r, struct list_head *head,
                            struct dlm_lkb *lkb)
 {
        struct dlm_lkb *gr;
 
        list_for_each_entry(gr, head, lkb_statequeue) {
-               if (gr->lkb_bastaddr &&
-                   gr->lkb_highbast < lkb->lkb_rqmode &&
-                   !modes_compat(gr, lkb)) {
+               if (gr->lkb_bastaddr && modes_require_bast(gr, lkb)) {
                        queue_bast(r, gr, lkb->lkb_rqmode);
                        gr->lkb_highbast = lkb->lkb_rqmode;
                }
@@ -2235,7 +2276,7 @@ static int do_convert(struct dlm_rsb *r, struct dlm_lkb *lkb)
           before we try again to grant this one. */
 
        if (is_demoted(lkb)) {
-               grant_pending_convert(r, DLM_LOCK_IV);
+               grant_pending_convert(r, DLM_LOCK_IV, NULL);
                if (_can_be_granted(r, lkb, 1)) {
                        grant_lock(r, lkb);
                        queue_cast(r, lkb, 0);
index dd362739d291e8a5d125ec2d2172e19d497bdecc..9e9d2e82f40fb36a62307e92b5ab48285a3c4654 100644 (file)
@@ -313,6 +313,7 @@ static void make_sockaddr(struct sockaddr_storage *saddr, uint16_t port,
                in6_addr->sin6_port = cpu_to_be16(port);
                *addr_len = sizeof(struct sockaddr_in6);
        }
+       memset((char *)saddr + *addr_len, 0, sizeof(struct sockaddr_storage) - *addr_len);
 }
 
 /* Close a remote connection and tidy up */
@@ -332,8 +333,19 @@ static void close_connection(struct connection *con, bool and_other)
                __free_page(con->rx_page);
                con->rx_page = NULL;
        }
-       con->retries = 0;
-       mutex_unlock(&con->sock_mutex);
+
+       /* If we are an 'othercon' then NULL the pointer to us
+          from the parent and tidy ourself up */
+       if (test_bit(CF_IS_OTHERCON, &con->flags)) {
+               struct connection *parent = __nodeid2con(con->nodeid, 0);
+               parent->othercon = NULL;
+               kmem_cache_free(con_cache, con);
+       }
+       else {
+               /* Parent connections get reused */
+               con->retries = 0;
+               mutex_unlock(&con->sock_mutex);
+       }
 }
 
 /* We only send shutdown messages to nodes that are not part of the cluster */
@@ -631,7 +643,7 @@ out_resched:
 
 out_close:
        mutex_unlock(&con->sock_mutex);
-       if (ret != -EAGAIN && !test_bit(CF_IS_OTHERCON, &con->flags)) {
+       if (ret != -EAGAIN) {
                close_connection(con, false);
                /* Reconnect when there is something to send */
        }
@@ -1122,8 +1134,6 @@ static int tcp_listen_for_all(void)
 
        log_print("Using TCP for communications");
 
-       set_bit(CF_IS_OTHERCON, &con->flags);
-
        sock = tcp_create_listen_sock(con, dlm_local_addr[0]);
        if (sock) {
                add_sock(sock, con);
@@ -1407,7 +1417,7 @@ void dlm_lowcomms_stop(void)
        for (i = 0; i <= max_nodeid; i++) {
                con = __nodeid2con(i, 0);
                if (con) {
-                       con->flags |= 0xFF;
+                       con->flags |= 0x0F;
                        if (con->sock)
                                con->sock->sk->sk_user_data = NULL;
                }
@@ -1423,8 +1433,6 @@ void dlm_lowcomms_stop(void)
                con = __nodeid2con(i, 0);
                if (con) {
                        close_connection(con, true);
-                       if (con->othercon)
-                               kmem_cache_free(con_cache, con->othercon);
                        kmem_cache_free(con_cache, con);
                }
        }
index 073599dced2ab4b2562f8f7df44db66aeaa079cc..d09977528f692c7e133a9d7702cae88411536e75 100644 (file)
@@ -56,8 +56,10 @@ static int dlm_add_member(struct dlm_ls *ls, int nodeid)
                return -ENOMEM;
 
        w = dlm_node_weight(ls->ls_name, nodeid);
-       if (w < 0)
+       if (w < 0) {
+               kfree(memb);
                return w;
+       }
 
        memb->nodeid = nodeid;
        memb->weight = w;
index e3a1527cbdbe7c8cd4bb0a8b6605e486b8ea538c..188b91c027e4b16a811c30b398654018ad63a771 100644 (file)
@@ -386,8 +386,7 @@ static void receive_rcom_lock_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
        dlm_recover_process_copy(ls, rc_in);
 }
 
-static int send_ls_not_ready(struct dlm_ls *ls, int nodeid,
-                            struct dlm_rcom *rc_in)
+static int send_ls_not_ready(int nodeid, struct dlm_rcom *rc_in)
 {
        struct dlm_rcom *rc;
        struct rcom_config *rf;
@@ -395,7 +394,7 @@ static int send_ls_not_ready(struct dlm_ls *ls, int nodeid,
        char *mb;
        int mb_len = sizeof(struct dlm_rcom) + sizeof(struct rcom_config);
 
-       mh = dlm_lowcomms_get_buffer(nodeid, mb_len, ls->ls_allocation, &mb);
+       mh = dlm_lowcomms_get_buffer(nodeid, mb_len, GFP_NOFS, &mb);
        if (!mh)
                return -ENOBUFS;
        memset(mb, 0, mb_len);
@@ -465,7 +464,7 @@ void dlm_receive_rcom(struct dlm_header *hd, int nodeid)
                log_print("lockspace %x from %d type %x not found",
                          hd->h_lockspace, nodeid, rc->rc_type);
                if (rc->rc_type == DLM_RCOM_STATUS)
-                       send_ls_not_ready(ls, nodeid, rc);
+                       send_ls_not_ready(nodeid, rc);
                return;
        }
 
index 7bdea7937ee896179e34b3fe0102f76803fedecb..ce62f7b65f17aa3963c67c8ff095974489b4f033 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1084,9 +1084,12 @@ int flush_old_exec(struct linux_binprm * bprm)
         */
        current->mm->task_size = TASK_SIZE;
 
-       if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || 
-           file_permission(bprm->file, MAY_READ) ||
-           (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) {
+       if (bprm->e_uid != current->euid || bprm->e_gid != current->egid) {
+               suid_keys(current);
+               set_dumpable(current->mm, suid_dumpable);
+               current->pdeath_signal = 0;
+       } else if (file_permission(bprm->file, MAY_READ) ||
+                       (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) {
                suid_keys(current);
                set_dumpable(current->mm, suid_dumpable);
        }
@@ -1177,8 +1180,10 @@ void compute_creds(struct linux_binprm *bprm)
 {
        int unsafe;
 
-       if (bprm->e_uid != current->uid)
+       if (bprm->e_uid != current->uid) {
                suid_keys(current);
+               current->pdeath_signal = 0;
+       }
        exec_keys(current);
 
        task_lock(current);
index aff70f0698fdd887799e3d23a0057ea715714112..3b395c41b2f3f9acefc623e6e008949231b1e8d3 100644 (file)
@@ -486,8 +486,8 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
                gfs2_pin(sdp, bd->bd_bh);
                tr->tr_num_databuf_new++;
        }
-       sdp->sd_log_num_databuf++;
        gfs2_log_lock(sdp);
+       sdp->sd_log_num_databuf++;
        list_add(&le->le_list, &sdp->sd_log_le_databuf);
        gfs2_log_unlock(sdp);
 }
@@ -523,7 +523,7 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
        struct buffer_head *bh = NULL,*bh1 = NULL;
        struct gfs2_log_descriptor *ld;
        unsigned int limit;
-       unsigned int total_dbuf = sdp->sd_log_num_databuf;
+       unsigned int total_dbuf;
        unsigned int total_jdata = sdp->sd_log_num_jdata;
        unsigned int num, n;
        __be64 *ptr = NULL;
@@ -535,6 +535,7 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
         * into the log along with a header
         */
        gfs2_log_lock(sdp);
+       total_dbuf = sdp->sd_log_num_databuf;
        bd2 = bd1 = list_prepare_entry(bd1, &sdp->sd_log_le_databuf,
                                       bd_le.le_list);
        while(total_dbuf) {
@@ -653,6 +654,7 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
                                break;
                }
                bh = NULL;
+               BUG_ON(total_dbuf < num);
                total_dbuf -= num;
                total_jdata -= num;
        }
index 6f006a804db33c48310c5af608ed4aa53805625c..4864659555d4f94d49132a2727a4acd0b5e1d5e4 100644 (file)
@@ -82,19 +82,20 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, char *data_arg, int remount)
        char *options, *o, *v;
        int error = 0;
 
-       /*  If someone preloaded options, use those instead  */
-       spin_lock(&gfs2_sys_margs_lock);
-       if (!remount && gfs2_sys_margs) {
-               data = gfs2_sys_margs;
-               gfs2_sys_margs = NULL;
-       }
-       spin_unlock(&gfs2_sys_margs_lock);
+       if (!remount) {
+               /*  If someone preloaded options, use those instead  */
+               spin_lock(&gfs2_sys_margs_lock);
+               if (gfs2_sys_margs) {
+                       data = gfs2_sys_margs;
+                       gfs2_sys_margs = NULL;
+               }
+               spin_unlock(&gfs2_sys_margs_lock);
 
-       /*  Set some defaults  */
-       memset(args, 0, sizeof(struct gfs2_args));
-       args->ar_num_glockd = GFS2_GLOCKD_DEFAULT;
-       args->ar_quota = GFS2_QUOTA_DEFAULT;
-       args->ar_data = GFS2_DATA_DEFAULT;
+               /*  Set some defaults  */
+               args->ar_num_glockd = GFS2_GLOCKD_DEFAULT;
+               args->ar_quota = GFS2_QUOTA_DEFAULT;
+               args->ar_data = GFS2_DATA_DEFAULT;
+       }
 
        /* Split the options into tokens with the "," character and
           process them */
index ce90032c010ec7176d8f31505a5c859833dc3650..42a5f58f6fca4adf5ad1faae9edec36939b05d2c 100644 (file)
@@ -416,7 +416,7 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
 
        error = gfs2_trans_begin(sdp, rblocks, 0);
        if (error)
-               goto out;
+               goto out_trans_fail;
 
        if (gfs2_is_stuffed(ip)) {
                if (end > sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)) {
@@ -434,6 +434,7 @@ prepare_write:
 out:
        if (error) {
                gfs2_trans_end(sdp);
+out_trans_fail:
                if (alloc_required) {
                        gfs2_inplace_release(ip);
 out_qunlock:
index 77342113011657ee4e9c3697d072816d6ebc77d6..94d76ace0b95b840427552c33636f3c0bab46fd3 100644 (file)
@@ -177,8 +177,8 @@ static const u32 fsflags_to_gfs2[32] = {
        [5] = GFS2_DIF_APPENDONLY,
        [7] = GFS2_DIF_NOATIME,
        [12] = GFS2_DIF_EXHASH,
-       [14] = GFS2_DIF_JDATA,
-       [20] = GFS2_DIF_DIRECTIO,
+       [14] = GFS2_DIF_INHERIT_JDATA,
+       [20] = GFS2_DIF_INHERIT_DIRECTIO,
 };
 
 static const u32 gfs2_to_fsflags[32] = {
@@ -187,8 +187,6 @@ static const u32 gfs2_to_fsflags[32] = {
        [gfs2fl_AppendOnly] = FS_APPEND_FL,
        [gfs2fl_NoAtime] = FS_NOATIME_FL,
        [gfs2fl_ExHash] = FS_INDEX_FL,
-       [gfs2fl_Jdata] = FS_JOURNAL_DATA_FL,
-       [gfs2fl_Directio] = FS_DIRECTIO_FL,
        [gfs2fl_InheritDirectio] = FS_DIRECTIO_FL,
        [gfs2fl_InheritJdata] = FS_JOURNAL_DATA_FL,
 };
@@ -207,6 +205,12 @@ static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
                return error;
 
        fsflags = fsflags_cvt(gfs2_to_fsflags, ip->i_di.di_flags);
+       if (!S_ISDIR(inode->i_mode)) {
+               if (ip->i_di.di_flags & GFS2_DIF_JDATA)
+                       fsflags |= FS_JOURNAL_DATA_FL;
+               if (ip->i_di.di_flags & GFS2_DIF_DIRECTIO)
+                       fsflags |= FS_DIRECTIO_FL;
+       }
        if (put_user(fsflags, ptr))
                error = -EFAULT;
 
@@ -270,13 +274,6 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
        if ((new_flags ^ flags) == 0)
                goto out;
 
-       if (S_ISDIR(inode->i_mode)) {
-               if ((new_flags ^ flags) & GFS2_DIF_JDATA)
-                       new_flags ^= (GFS2_DIF_JDATA|GFS2_DIF_INHERIT_JDATA);
-               if ((new_flags ^ flags) & GFS2_DIF_DIRECTIO)
-                       new_flags ^= (GFS2_DIF_DIRECTIO|GFS2_DIF_INHERIT_DIRECTIO);
-       }
-
        error = -EINVAL;
        if ((new_flags ^ flags) & ~GFS2_FLAGS_USER_SET)
                goto out;
@@ -315,11 +312,19 @@ out:
 
 static int gfs2_set_flags(struct file *filp, u32 __user *ptr)
 {
+       struct inode *inode = filp->f_path.dentry->d_inode;
        u32 fsflags, gfsflags;
        if (get_user(fsflags, ptr))
                return -EFAULT;
        gfsflags = fsflags_cvt(fsflags_to_gfs2, fsflags);
-       return do_gfs2_set_flags(filp, gfsflags, ~0);
+       if (!S_ISDIR(inode->i_mode)) {
+               if (gfsflags & GFS2_DIF_INHERIT_JDATA)
+                       gfsflags ^= (GFS2_DIF_JDATA | GFS2_DIF_INHERIT_JDATA);
+               if (gfsflags & GFS2_DIF_INHERIT_DIRECTIO)
+                       gfsflags ^= (GFS2_DIF_DIRECTIO | GFS2_DIF_INHERIT_DIRECTIO);
+               return do_gfs2_set_flags(filp, gfsflags, ~0);
+       }
+       return do_gfs2_set_flags(filp, gfsflags, ~GFS2_DIF_JDATA);
 }
 
 static long gfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
index e4e040625153aa29b2254e51276eb6ac9807380e..ce48c4594ec88f9dc9fb64eb8d0413c5a04cc272 100644 (file)
@@ -863,16 +863,19 @@ static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked)
        u64 no_addr;
 
        for(;;) {
+               if (goal >= rgd->rd_data)
+                       break;
                goal = rgblk_search(rgd, goal, GFS2_BLKST_UNLINKED,
                                    GFS2_BLKST_UNLINKED);
-               if (goal == 0)
-                       return 0;
+               if (goal == BFITNOENT)
+                       break;
                no_addr = goal + rgd->rd_data0;
-               if (no_addr <= *last_unlinked)
+               goal++;
+               if (no_addr < *last_unlinked)
                        continue;
                *last_unlinked = no_addr;
                inode = gfs2_inode_lookup(rgd->rd_sbd->sd_vfs, DT_UNKNOWN,
-                                       no_addr, -1);
+                                         no_addr, -1);
                if (!IS_ERR(inode))
                        return inode;
        }
@@ -1313,7 +1316,7 @@ static u32 rgblk_search(struct gfs2_rgrpd *rgd, u32 goal,
                                    bi->bi_len, blk, new_state);
        }
 
-       return (blk == BFITNOENT) ? 0 : (bi->bi_start * GFS2_NBBY) + blk;
+       return (blk == BFITNOENT) ? blk : (bi->bi_start * GFS2_NBBY) + blk;
 }
 
 /**
@@ -1393,6 +1396,7 @@ u64 gfs2_alloc_data(struct gfs2_inode *ip)
                goal = rgd->rd_last_alloc_data;
 
        blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED);
+       BUG_ON(blk == BFITNOENT);
        rgd->rd_last_alloc_data = blk;
 
        block = rgd->rd_data0 + blk;
@@ -1437,6 +1441,7 @@ u64 gfs2_alloc_meta(struct gfs2_inode *ip)
                goal = rgd->rd_last_alloc_meta;
 
        blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED);
+       BUG_ON(blk == BFITNOENT);
        rgd->rd_last_alloc_meta = blk;
 
        block = rgd->rd_data0 + blk;
@@ -1478,6 +1483,7 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation)
 
        blk = rgblk_search(rgd, rgd->rd_last_alloc_meta,
                           GFS2_BLKST_FREE, GFS2_BLKST_DINODE);
+       BUG_ON(blk == BFITNOENT);
 
        rgd->rd_last_alloc_meta = blk;
 
index e30d4b3bd83610d40628e70345dc786f09e75c3a..64bb92bb677338ec3c2ee872e0431719fb16bc91 100644 (file)
@@ -255,6 +255,8 @@ static inline void memset_io(volatile void __iomem *addr, unsigned char val,
        memset((void __force *)addr, val, count);
 }
 
+#define mmiowb()
+
 #define IO_SPACE_LIMIT 0xffffffff
 
 extern void __iomem *__ioremap(unsigned long offset, size_t size,
index bb82e70cde8d048fb01c3594b0233ba8c9d83fbd..0e680f47209fbc87ca98f90683f8cc57510d10e8 100644 (file)
@@ -27,13 +27,7 @@ static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
  */
 static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-       unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t));
-       pgd_t *pgd = kmalloc(pgd_size, GFP_KERNEL);
-
-       if (pgd)
-               memset(pgd, 0, pgd_size);
-
-       return pgd;
+       return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL);
 }
 
 static inline void pgd_free(pgd_t *pgd)
@@ -44,18 +38,9 @@ static inline void pgd_free(pgd_t *pgd)
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
                                          unsigned long address)
 {
-       int count = 0;
        pte_t *pte;
 
-       do {
-               pte = (pte_t *) __get_free_page(GFP_KERNEL | __GFP_REPEAT);
-               if (pte)
-                       clear_page(pte);
-               else {
-                       current->state = TASK_UNINTERRUPTIBLE;
-                       schedule_timeout(HZ);
-               }
-       } while (!pte && (count++ < 10));
+       pte = (pte_t *)get_zeroed_page(GFP_KERNEL | __GFP_REPEAT);
 
        return pte;
 }
@@ -63,18 +48,9 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
 static inline struct page *pte_alloc_one(struct mm_struct *mm,
                                         unsigned long address)
 {
-       int count = 0;
        struct page *pte;
 
-       do {
-               pte = alloc_pages(GFP_KERNEL, 0);
-               if (pte)
-                       clear_page(page_address(pte));
-               else {
-                       current->state = TASK_UNINTERRUPTIBLE;
-                       schedule_timeout(HZ);
-               }
-       } while (!pte && (count++ < 10));
+       pte = alloc_page(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO);
 
        return pte;
 }
index c07bdd10b8911733ce4c3fd7ebb3816db36951f6..018f6e2a02425d4acc7372fc0111c701332cff68 100644 (file)
@@ -32,8 +32,6 @@
 #define USER_PTRS_PER_PGD      (TASK_SIZE / PGDIR_SIZE)
 #define FIRST_USER_ADDRESS     0
 
-#define PTE_PHYS_MASK  0x1ffff000
-
 #ifndef __ASSEMBLY__
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 extern void paging_init(void);
@@ -265,7 +263,7 @@ static inline pte_t pte_mkyoung(pte_t pte)
  * trivial.
  */
 #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
-#define pte_page(x)    phys_to_page(pte_val(x) & PTE_PHYS_MASK)
+#define pte_page(x)    (pfn_to_page(pte_pfn(x)))
 
 /*
  * Mark the prot value as uncacheable and unbufferable
index d036e4419d7958a1245c631cd19d4ea76f3a9a65..27d076c46964a9fd537f7b8cca8c7169b9c8aa13 100644 (file)
@@ -68,7 +68,6 @@ struct sbus_dev {
 /* This struct describes the SBus(s) found on this machine. */
 struct sbus_bus {
        struct of_device        ofdev;
-       void                    *iommu;         /* Opaque IOMMU cookie */
        struct sbus_dev         *devices;       /* Link to devices on this SBus */
        struct sbus_bus         *next;          /* next SBus, if more than one SBus */
        int                     prom_node;      /* PROM device tree node for this SBus */
index ecfc86a4a725caee13da26b328f2992975534a92..266a42b8f99fad61d7f907bad23d306b4846846d 100644 (file)
@@ -203,4 +203,10 @@ extern struct task_struct *last_task_used_math;
 #define FP_INHIBIT_RESULTS ((last_task_used_math->thread.fsr >> 23) & _fex)
 #endif
 
+#ifdef CONFIG_SMP
+#define FP_TRAPPING_EXCEPTIONS ((current->thread.fsr >> 23) & 0x1f)
+#else
+#define FP_TRAPPING_EXCEPTIONS ((last_task_used_math->thread.fsr >> 23) & 0x1f)
+#endif
+
 #endif
index 303d85e2f82ee003b1a6866b766ebb1731975d0d..8653e86650097b4de2d7635a6231a1e684fd082c 100644 (file)
@@ -70,6 +70,7 @@
 #define HWCAP_SPARC_V9         16
 #define HWCAP_SPARC_ULTRA3     32
 #define HWCAP_SPARC_BLKINIT    64
+#define HWCAP_SPARC_N2         128
 
 /*
  * These are used to set parameters in the core dumps.
@@ -155,8 +156,13 @@ static inline unsigned int sparc64_elf_hwcap(void)
 
        if (tlb_type == cheetah || tlb_type == cheetah_plus)
                cap |= HWCAP_SPARC_ULTRA3;
-       else if (tlb_type == hypervisor)
-               cap |= HWCAP_SPARC_BLKINIT;
+       else if (tlb_type == hypervisor) {
+               if (sun4v_chip_type == SUN4V_CHIP_NIAGARA1 ||
+                   sun4v_chip_type == SUN4V_CHIP_NIAGARA2)
+                       cap |= HWCAP_SPARC_BLKINIT;
+               if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2)
+                       cap |= HWCAP_SPARC_N2;
+       }
 
        return cap;
 }
index 89d42431efb58e0cba76b903623c678cdfaf1e67..c9331b02d9c85df91a829906c1dfa5b1c79af04e 100644 (file)
@@ -88,4 +88,6 @@
 
 #define FP_INHIBIT_RESULTS ((current_thread_info()->xfsr[0] >> 23) & _fex)
 
+#define FP_TRAPPING_EXCEPTIONS ((current_thread_info()->xfsr[0] >> 23) & 0x1f)
+
 #endif
index 4a616d73cc259230ca43d542cd81ae60871599cd..e679b27516659699280c42b1e6e15839cfedb787 100644 (file)
@@ -1131,6 +1131,8 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
 
 extern void linkwatch_run_queue(void);
 
+extern int netdev_compute_features(unsigned long all, unsigned long one);
+
 static inline int net_gso_ok(int features, int gso_type)
 {
        int feature = gso_type << NETIF_F_GSO_SHIFT;
index 93780abd01bc60a4d23e09f90f90a684de2ebe52..bb46e7645d537234bdc44221bccfa8e0e332e4c5 100644 (file)
@@ -145,13 +145,16 @@ do {                                                              \
              {                                                 \
                X##_e = 1;                                      \
                _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);        \
+               FP_SET_EXCEPTION(FP_EX_INEXACT);                \
              }                                                 \
            else                                                \
              {                                                 \
                X##_e = 0;                                      \
                _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);             \
-               FP_SET_EXCEPTION(FP_EX_UNDERFLOW);              \
              }                                                 \
+           if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) ||          \
+               (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW))     \
+               FP_SET_EXCEPTION(FP_EX_UNDERFLOW);              \
          }                                                     \
        else                                                    \
          {                                                     \
index d02eb64a865bb4acbe81a148584fd92341cd14ae..a0721ef5c2f9e24b2c9c3317aa10fd9bb1b4d4a1 100644 (file)
 #define FP_INHIBIT_RESULTS 0
 #endif
 
+#ifndef FP_TRAPPING_EXCEPTIONS
+#define FP_TRAPPING_EXCPETIONS 0
+#endif
+
 #define FP_SET_EXCEPTION(ex)                           \
   _fex |= (ex)
   
 #define FP_UNSET_EXCEPTION(ex)                         \
   _fex &= ~(ex)
 
+#define FP_CUR_EXCEPTIONS                              \
+  (_fex)
+
 #define FP_CLEAR_EXCEPTIONS                            \
   _fex = 0
 
index 30712ddd8a5e6b6cc1add751f95948e9a3382bbd..8ec3799e42e17066dbd2d22e8f90d5069f91c283 100644 (file)
@@ -39,6 +39,8 @@
 #if !defined( IB_MAD_H )
 #define IB_MAD_H
 
+#include <linux/list.h>
+
 #include <rdma/ib_verbs.h>
 
 /* Management base version */
index 0627a6aa282ac220660d625cd832b34ed939de63..4bea182d7116c4aa80e863ed2d5a59fed24967e0 100644 (file)
@@ -46,6 +46,8 @@
 #include <linux/mm.h>
 #include <linux/dma-mapping.h>
 #include <linux/kref.h>
+#include <linux/list.h>
+#include <linux/rwsem.h>
 
 #include <asm/atomic.h>
 #include <asm/scatterlist.h>
@@ -731,11 +733,6 @@ struct ib_udata {
        size_t       outlen;
 };
 
-#define IB_UMEM_MAX_PAGE_CHUNK                                         \
-       ((PAGE_SIZE - offsetof(struct ib_umem_chunk, page_list)) /      \
-        ((void *) &((struct ib_umem_chunk *) 0)->page_list[1] -        \
-         (void *) &((struct ib_umem_chunk *) 0)->page_list[0]))
-
 struct ib_pd {
        struct ib_device       *device;
        struct ib_uobject      *uobject;
index c0040c9064a144a0f7afb3e47411eaed6ce13576..bd08aa090763ad469e7e9c795f8057d8370e46f0 100644 (file)
@@ -319,7 +319,7 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset)
        static const char fmt[] = "%30s %12lu\n";
        int i;
 
-       if ((vlandev == NULL) || (!(vlandev->priv_flags & IFF_802_1Q_VLAN)))
+       if (!(vlandev->priv_flags & IFF_802_1Q_VLAN))
                return 0;
 
        seq_printf(seq, "%s  VID: %d     REORDER_HDR: %i  dev->priv_flags: %hx\n",
index 2770fb451ae87dbe089cc32a16eef523fb18a374..59d5aa3366f229636ec7ca7a1ab8d821e8d97b41 100644 (file)
@@ -21,7 +21,6 @@
 #include <net/dst.h>
 #include <linux/proc_fs.h>
 #include <linux/spinlock.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 
 /* TokenRing if needed */
index 16be0c14780a18415bf203f617b8cb1c4cdb0808..8443af57a3740253f10ddcf505246165fee5e56a 100644 (file)
@@ -69,7 +69,6 @@ void ax25_protocol_release(unsigned int pid)
        if (protocol->pid == pid) {
                protocol_list = protocol->next;
                write_unlock_bh(&protocol_list_lock);
-               kfree(protocol);
                return;
        }
 
@@ -78,7 +77,6 @@ void ax25_protocol_release(unsigned int pid)
                        s = protocol->next;
                        protocol->next = protocol->next->next;
                        write_unlock_bh(&protocol_list_lock);
-                       kfree(s);
                        return;
                }
 
index 5e1892d8d874a0eaa8a95c5a697285b11dc25163..0eded176ce99bfa0aa3dd352d8e676b3067d257b 100644 (file)
@@ -179,5 +179,5 @@ void br_dev_setup(struct net_device *dev)
        dev->priv_flags = IFF_EBRIDGE;
 
        dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
-                       NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_GSO_ROBUST;
+                       NETIF_F_GSO_MASK | NETIF_F_NO_CSUM | NETIF_F_LLTX;
 }
index b40dada002bf3df459474da2c33a848ee1f17aaa..749f0e8f541d124f1975e6e6aa5a1e8d06ddb439 100644 (file)
@@ -349,43 +349,15 @@ int br_min_mtu(const struct net_bridge *br)
 void br_features_recompute(struct net_bridge *br)
 {
        struct net_bridge_port *p;
-       unsigned long features, checksum;
+       unsigned long features;
 
-       checksum = br->feature_mask & NETIF_F_ALL_CSUM ? NETIF_F_NO_CSUM : 0;
-       features = br->feature_mask & ~NETIF_F_ALL_CSUM;
+       features = br->feature_mask;
 
        list_for_each_entry(p, &br->port_list, list) {
-               unsigned long feature = p->dev->features;
-
-               /* if device needs checksumming, downgrade to hw checksumming */
-               if (checksum & NETIF_F_NO_CSUM && !(feature & NETIF_F_NO_CSUM))
-                       checksum ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM;
-
-               /* if device can't do all checksum, downgrade to ipv4/ipv6 */
-               if (checksum & NETIF_F_HW_CSUM && !(feature & NETIF_F_HW_CSUM))
-                       checksum ^= NETIF_F_HW_CSUM
-                               | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
-
-               if (checksum & NETIF_F_IPV6_CSUM && !(feature & NETIF_F_IPV6_CSUM))
-                       checksum &= ~NETIF_F_IPV6_CSUM;
-
-               if (!(feature & NETIF_F_IP_CSUM))
-                       checksum = 0;
-
-               if (feature & NETIF_F_GSO)
-                       feature |= NETIF_F_GSO_SOFTWARE;
-               feature |= NETIF_F_GSO;
-
-               features &= feature;
+               features = netdev_compute_features(features, p->dev->features);
        }
 
-       if (!(checksum & NETIF_F_ALL_CSUM))
-               features &= ~NETIF_F_SG;
-       if (!(features & NETIF_F_SG))
-               features &= ~NETIF_F_GSO_MASK;
-
-       br->dev->features = features | checksum | NETIF_F_LLTX |
-                           NETIF_F_GSO_ROBUST;
+       br->dev->features = features;
 }
 
 /* called with RTNL */
index 1ea2f86f7683b1b6ec101158db133bc37af7896f..1a430eccec9b8a25aef64971e812f4ec3483b242 100644 (file)
@@ -132,7 +132,7 @@ static void br_stp_start(struct net_bridge *br)
        } else {
                br->stp_enabled = BR_KERNEL_STP;
                printk(KERN_INFO "%s: starting userspace STP failed, "
-                               "staring kernel STP\n", br->dev->name);
+                               "starting kernel STP\n", br->dev->name);
 
                /* To start timers on any ports left in blocking */
                spin_lock_bh(&br->lock);
index 4f42263e0a8a8ba8e3e45d2979f34508b19ecbc4..88f43003b193ad0c3919b2f58f37e4d65346e9f3 100644 (file)
@@ -147,20 +147,26 @@ static ssize_t show_stp_state(struct device *d,
        return sprintf(buf, "%d\n", br->stp_enabled);
 }
 
-static void set_stp_state(struct net_bridge *br, unsigned long val)
-{
-       rtnl_lock();
-       spin_unlock_bh(&br->lock);
-       br_stp_set_enabled(br, val);
-       spin_lock_bh(&br->lock);
-       rtnl_unlock();
-}
 
 static ssize_t store_stp_state(struct device *d,
                               struct device_attribute *attr, const char *buf,
                               size_t len)
 {
-       return store_bridge_parm(d, buf, len, set_stp_state);
+       struct net_bridge *br = to_bridge(d);
+       char *endp;
+       unsigned long val;
+
+       if (!capable(CAP_NET_ADMIN))
+               return -EPERM;
+
+       val = simple_strtoul(buf, &endp, 0);
+       if (endp == buf)
+               return -EINVAL;
+
+       rtnl_lock();
+       br_stp_set_enabled(br, val);
+       rtnl_unlock();
+
 }
 static DEVICE_ATTR(stp_state, S_IRUGO | S_IWUSR, show_stp_state,
                   store_stp_state);
index 6cc8a70350ac05bb9526e244f7b5b427ee9d2ea1..a76021c71207a6bf4578cc4995412e68eca18bba 100644 (file)
@@ -3993,6 +3993,45 @@ static int __init netdev_dma_register(void)
 static int __init netdev_dma_register(void) { return -ENODEV; }
 #endif /* CONFIG_NET_DMA */
 
+/**
+ *     netdev_compute_feature - compute conjunction of two feature sets
+ *     @all: first feature set
+ *     @one: second feature set
+ *
+ *     Computes a new feature set after adding a device with feature set
+ *     @one to the master device with current feature set @all.  Returns
+ *     the new feature set.
+ */
+int netdev_compute_features(unsigned long all, unsigned long one)
+{
+       /* if device needs checksumming, downgrade to hw checksumming */
+       if (all & NETIF_F_NO_CSUM && !(one & NETIF_F_NO_CSUM))
+               all ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM;
+
+       /* if device can't do all checksum, downgrade to ipv4/ipv6 */
+       if (all & NETIF_F_HW_CSUM && !(one & NETIF_F_HW_CSUM))
+               all ^= NETIF_F_HW_CSUM
+                       | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
+
+       if (one & NETIF_F_GSO)
+               one |= NETIF_F_GSO_SOFTWARE;
+       one |= NETIF_F_GSO;
+
+       /* If even one device supports robust GSO, enable it for all. */
+       if (one & NETIF_F_GSO_ROBUST)
+               all |= NETIF_F_GSO_ROBUST;
+
+       all &= one | NETIF_F_LLTX;
+
+       if (!(all & NETIF_F_ALL_CSUM))
+               all &= ~NETIF_F_SG;
+       if (!(all & NETIF_F_SG))
+               all &= ~NETIF_F_GSO_MASK;
+
+       return all;
+}
+EXPORT_SYMBOL(netdev_compute_features);
+
 /*
  *     Initialize the DEV module. At boot time this walks the device list and
  *     unhooks any devices that fail to initialise (normally hardware not
index 2ab0a60046a5ca9c65a13164f10180a8f8833ced..c5e059352d43f1e4cfe8f17589825c82a28523a4 100644 (file)
@@ -948,7 +948,6 @@ int dev_ethtool(struct ifreq *ifr)
        return rc;
 }
 
-EXPORT_SYMBOL(dev_ethtool);
 EXPORT_SYMBOL(ethtool_op_get_link);
 EXPORT_SYMBOL(ethtool_op_get_sg);
 EXPORT_SYMBOL(ethtool_op_get_tso);
index ccbf72c793b6c61381b40d466073a89f2bfb4575..c45088b5e6fb68f5c8a453561453061dee512d54 100644 (file)
@@ -40,6 +40,7 @@ static inline void ccids_write_unlock(void)
 static inline void ccids_read_lock(void)
 {
        atomic_inc(&ccids_lockct);
+       smp_mb__after_atomic_inc();
        spin_unlock_wait(&ccids_lock);
 }
 
index cd845df5320dbe6bb74d6ee2dfcbad8244a7723e..5ebdd86c1b99f34ae2c86c36e8cbda2b23fed0cc 100644 (file)
@@ -327,10 +327,16 @@ static void dccp_feat_empty_confirm(struct dccp_minisock *dmsk,
        }
 
        switch (type) {
-       case DCCPO_CHANGE_L: opt->dccpop_type = DCCPO_CONFIRM_R; break;
-       case DCCPO_CHANGE_R: opt->dccpop_type = DCCPO_CONFIRM_L; break;
-       default:             DCCP_WARN("invalid type %d\n", type); return;
-
+       case DCCPO_CHANGE_L:
+               opt->dccpop_type = DCCPO_CONFIRM_R;
+               break;
+       case DCCPO_CHANGE_R:
+               opt->dccpop_type = DCCPO_CONFIRM_L;
+               break;
+       default:
+               DCCP_WARN("invalid type %d\n", type);
+               kfree(opt);
+               return;
        }
        opt->dccpop_feat = feature;
        opt->dccpop_val  = NULL;
index b5524f32ac2d5128aa0f3513c3fb45e3f52fe215..35c96bcc0f32d445649cc67901814ad11b003ead 100644 (file)
@@ -1146,6 +1146,9 @@ static void __exit econet_proto_exit(void)
                sock_release(udpsock);
 #endif
        unregister_netdevice_notifier(&econet_netdev_notifier);
+#ifdef CONFIG_ECONET_NATIVE
+       dev_remove_pack(&econet_packet_type);
+#endif
        sock_unregister(econet_family_ops.family);
        proto_unregister(&econet_proto);
 }
index c9e2b5e6305e2288966735800d950814899ca53b..0f1d7beacf782042b4ed9115b4441f88214f29f3 100644 (file)
@@ -75,7 +75,6 @@
 #include <net/icmp.h>
 #include <net/checksum.h>
 #include <net/inetpeer.h>
-#include <net/checksum.h>
 #include <linux/igmp.h>
 #include <linux/netfilter_ipv4.h>
 #include <linux/netfilter_bridge.h>
index 342ca8d89458a7b9aa9edc6124533b0a9a6cd4de..c5b24707753997db84ddcd310ae876f94d8243eb 100644 (file)
@@ -1281,9 +1281,9 @@ static int __init ip_auto_config(void)
         */
        if (ic_myaddr == NONE ||
 #ifdef CONFIG_ROOT_NFS
-           (MAJOR(ROOT_DEV) == UNNAMED_MAJOR
-            && root_server_addr == NONE
-            && ic_servaddr == NONE) ||
+           (root_server_addr == NONE
+            && ic_servaddr == NONE
+            && ROOT_DEV == Root_NFS) ||
 #endif
            ic_first_dev->next) {
 #ifdef IPCONFIG_DYNAMIC
index e1052bcf4ed190ecefc35c7380eaa0be407c6b24..902fd578aa3c1853c034bd7e867566dcdde683f3 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/proc_fs.h>
 #include <linux/workqueue.h>
 #include <linux/swap.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 
 #include <linux/netfilter.h>
@@ -909,7 +908,7 @@ ip_vs_edit_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest)
        write_lock_bh(&__ip_vs_svc_lock);
 
        /* Wait until all other svc users go away */
-       while (atomic_read(&svc->usecnt) > 1) {};
+       IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1);
 
        /* call the update_service, because server weight may be changed */
        svc->scheduler->update_service(svc);
index dcc12b1834747a513a7468f780604b738124f0c2..69bd362b5fa20d8c1ed42f79aed68f93a431b98f 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/udp.h>
 #include <linux/icmp.h>
 #include <linux/if_arp.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/netfilter_arp.h>
 #include <linux/netfilter/x_tables.h>
index a889ec3ec83abb7edb80a0c91241226b7e978dae..e14d41976c279c24f76b90de3a74d5abbefcef24 100644 (file)
@@ -104,7 +104,7 @@ static unsigned int ip_nat_sip(struct sk_buff **pskb,
        dataoff = ip_hdrlen(*pskb) + sizeof(struct udphdr);
        datalen = (*pskb)->len - dataoff;
        if (datalen < sizeof("SIP/2.0") - 1)
-               return NF_DROP;
+               return NF_ACCEPT;
 
        addr_map_init(ct, &map);
 
index d6846393182d4294dc08f30d9fa99921dd881319..761a910f4f9717754cdb3d6280bda31de43bb125 100644 (file)
@@ -820,7 +820,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
                return 0;
 
        len = min_t(unsigned int, len, ipv6_optlen(hdr));
-       if (copy_to_user(optval, hdr, len));
+       if (copy_to_user(optval, hdr, len))
                return -EFAULT;
        return ipv6_optlen(hdr);
 }
index cbdb78487915de967bcf99e91d104e145c98f9fb..0f7defb482e9bf18411eef3d1911d922b6dbda1d 100644 (file)
@@ -56,7 +56,6 @@
 #include <net/inet_ecn.h>
 #include <net/protocol.h>
 #include <net/xfrm.h>
-#include <net/addrconf.h>
 #include <net/snmp.h>
 #include <net/dsfield.h>
 #include <net/timewait_sock.h>
index 8ec5ed192b5d889f3211c6a955e656442ebd4fd9..7286c389a4d0ccd418a1d953e3dd921b179a9730 100644 (file)
@@ -4678,7 +4678,6 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
                        memset(skb->cb, 0, sizeof(skb->cb));
                        netif_rx(skb);
                        skb = skb2;
-                       break;
                }
        }
  out:
index 7ba352e3ffe0d451ad2bca62852e84a5b79b5d2e..0d99b685df5f6cf46ea3254b92bc3f103e539d17 100644 (file)
@@ -2154,7 +2154,11 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
                return 0;
        } else {
                if (ifsta->state != IEEE80211_AUTHENTICATE) {
-                       ieee80211_sta_start_scan(dev, NULL, 0);
+                       if (ifsta->auto_ssid_sel)
+                               ieee80211_sta_start_scan(dev, NULL, 0);
+                       else
+                               ieee80211_sta_start_scan(dev, ifsta->ssid,
+                                                        ifsta->ssid_len);
                        ifsta->state = IEEE80211_AUTHENTICATE;
                        set_bit(IEEE80211_STA_REQ_AUTH, &ifsta->request);
                } else
index 1276a442f10c53936d021be834631860285fd660..d449fa47491cfea5c65bfb957bda4ca60afe15a0 100644 (file)
@@ -295,6 +295,7 @@ static int epaddr_len(struct nf_conn *ct, const char *dptr,
 static int skp_epaddr_len(struct nf_conn *ct, const char *dptr,
                          const char *limit, int *shift)
 {
+       const char *start = dptr;
        int s = *shift;
 
        /* Search for @, but stop at the end of the line.
@@ -309,8 +310,10 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr,
        if (dptr <= limit && *dptr == '@') {
                dptr++;
                (*shift)++;
-       } else
+       } else {
+               dptr = start;
                *shift = s;
+       }
 
        return epaddr_len(ct, dptr, limit, shift);
 }
@@ -330,7 +333,8 @@ int ct_sip_get_info(struct nf_conn *ct,
 
        while (dptr <= limit) {
                if ((strncmp(dptr, hnfo->lname, hnfo->lnlen) != 0) &&
-                   (strncmp(dptr, hnfo->sname, hnfo->snlen) != 0)) {
+                   (hnfo->sname == NULL ||
+                    strncmp(dptr, hnfo->sname, hnfo->snlen) != 0)) {
                        dptr++;
                        continue;
                }
index 74f9b14c012f45e819938e6bb5c2873163d0cd13..bec427915b302fa2d9731de6045a9a6e8bd14ee4 100644 (file)
@@ -36,7 +36,7 @@ static bool u32_match_it(const struct xt_u32 *data,
                at  = 0;
                pos = ct->location[0].number;
 
-               if (skb->len < 4 || pos > skb->len - 4);
+               if (skb->len < 4 || pos > skb->len - 4)
                        return false;
 
                ret   = skb_copy_bits(skb, pos, &n, sizeof(n));
index bf90e60f8411c1ff49281bef88360a98f2a32188..6085be5784598e1b5c40e712d80b24d2d6643209 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/skbuff.h>
-#include <linux/module.h>
 #include <linux/rtnetlink.h>
 #include <linux/init.h>
 #include <net/act_api.h>
index ec077037f534b6a3265342fc0ccfd1dd56893505..7d44453dfae13a43a4e4a1a72e077ff644d96661 100644 (file)
@@ -1168,7 +1168,7 @@ static int __sock_create(int family, int type, int protocol,
        module_put(pf->owner);
        err = security_socket_post_create(sock, family, type, protocol, kern);
        if (err)
-               goto out_release;
+               goto out_sock_release;
        *res = sock;
 
        return 0;
index dc2f41e9f577dbb657bc9a6fbd8277a8e352f029..7da7050f06c39cfcc79f1383256ebbc66ba7e07b 100644 (file)
@@ -42,7 +42,6 @@
 #include <linux/pagemap.h>
 
 #include <linux/sunrpc/auth_gss.h>
-#include <linux/sunrpc/svcauth.h>
 #include <linux/sunrpc/gss_err.h>
 #include <linux/sunrpc/svcauth.h>
 #include <linux/sunrpc/svcauth_gss.h>
index 5d2b9ce84d0a1016ecc7fe076b31da8b232a6849..76088153524cf2da2d22f20a4ccdef77643a15be 100644 (file)
@@ -41,7 +41,6 @@
 #include "addr.h"
 #include "link.h"
 #include "node.h"
-#include "port.h"
 #include "name_table.h"
 #include "user_reg.h"
 #include "msg.h"
index e5a3be03aa0d0afb50dcfd886aeb4127d04badd7..7012891d39f2c6757b1c50784299043d353cc07a 100644 (file)
 #include <linux/netfilter.h>
 #include <linux/module.h>
 #include <linux/cache.h>
+#include <linux/audit.h>
 #include <net/xfrm.h>
 #include <net/ip.h>
-#include <linux/audit.h>
-#include <linux/cache.h>
 
 #include "xfrm_hash.h"
 
index 31be405efb55281326830ff701cf0681e5ac4c1d..d4356e6f7f9bc65fd67eeba6663b1cc9f321fa55 100644 (file)
@@ -19,9 +19,8 @@
 #include <linux/ipsec.h>
 #include <linux/module.h>
 #include <linux/cache.h>
-#include <asm/uaccess.h>
 #include <linux/audit.h>
-#include <linux/cache.h>
+#include <asm/uaccess.h>
 
 #include "xfrm_hash.h"
 
index f00161ef99ed17450ae395913730ca4154469e2d..6100fc023055c0b62e4d3d4691e0593424d38113 100644 (file)
@@ -2127,7 +2127,7 @@ int selinux_audit_rule_init(u32 field, u32 op, char *rulestr,
        *rule = NULL;
 
        if (!ss_initialized)
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
 
        switch (field) {
        case AUDIT_SUBJ_USER:
This page took 0.160323 seconds and 5 git commands to generate.