]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branches 'bugzilla-14886', 'bugzilla-15000', 'bugzilla-15040', 'bugzilla-15108...
authorLen Brown <len.brown@intel.com>
Thu, 18 Feb 2010 08:51:04 +0000 (03:51 -0500)
committerLen Brown <len.brown@intel.com>
Thu, 18 Feb 2010 08:51:04 +0000 (03:51 -0500)
82 files changed:
Documentation/kernel-parameters.txt
arch/ia64/include/asm/acpi.h
arch/ia64/include/asm/elf.h
arch/sh/kernel/ptrace_64.c
arch/sh/kernel/signal_64.c
arch/x86/include/asm/elf.h
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/process_64.c
drivers/acpi/dock.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_pdc.c
drivers/acpi/scan.c
drivers/acpi/tables.c
drivers/base/class.c
drivers/firewire/net.c
drivers/firewire/ohci.c
drivers/gpu/drm/drm_mm.c
drivers/gpu/drm/radeon/atom.c
drivers/gpu/drm/radeon/atombios_dp.c
drivers/gpu/drm/ttm/ttm_bo.c
drivers/md/dm-log-userspace-transfer.c
drivers/md/dm-raid1.c
drivers/md/dm-region-hash.c
drivers/md/dm-snap-persistent.c
drivers/md/dm-stripe.c
drivers/md/dm-sysfs.c
drivers/md/dm.c
drivers/net/benet/be_cmds.c
drivers/net/ixgbe/ixgbe_82598.c
drivers/net/ixgbe/ixgbe_main.c
drivers/net/sfc/efx.c
drivers/net/sfc/qt202x_phy.c
drivers/net/via-velocity.c
drivers/net/wireless/ath/ath9k/xmit.c
drivers/net/wireless/b43/b43.h
drivers/net/wireless/b43/main.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-rx.c
drivers/net/wireless/iwmc3200wifi/rx.c
drivers/net/wireless/rtl818x/rtl8187_dev.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/platform/x86/thinkpad_acpi.c
drivers/serial/8250.c
drivers/ssb/main.c
drivers/usb/core/devio.c
drivers/usb/gadget/f_eem.c
drivers/usb/gadget/multi.c
drivers/usb/gadget/r8a66597-udc.c
drivers/usb/gadget/s3c-hsotg.c
drivers/usb/host/ehci-hub.c
drivers/usb/host/fhci-tds.c
drivers/usb/misc/sisusbvga/sisusb.c
drivers/usb/otg/Kconfig
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio_ids.h
drivers/usb/serial/sierra.c
drivers/usb/storage/unusual_devs.h
fs/btrfs/file.c
fs/nfs/direct.c
fs/reiserfs/inode.c
fs/sysfs/inode.c
include/linux/hw_breakpoint.h
include/linux/kfifo.h
include/linux/perf_event.h
kernel/hw_breakpoint.c
kernel/kfifo.c
kernel/perf_event.c
kernel/softirq.c
kernel/trace/trace_kprobe.c
kernel/trace/trace_stack.c
net/core/ethtool.c
net/ipv4/igmp.c
net/ipv4/ipcomp.c
net/ipv4/tcp_input.c
net/ipv6/ipcomp6.c
net/mac80211/ibss.c
net/mac80211/rate.c
net/mac80211/scan.c
net/xfrm/xfrm_state.c
sound/pci/hda/hda_intel.c
tools/perf/builtin-top.c
tools/perf/util/event.c

index 736d45602886ea7b08024f246f06e9c7c6dc1a05..826b6e1483166d499ed9de7c2240dc35eb7d990a 100644 (file)
@@ -199,6 +199,10 @@ and is between 256 and 4096 characters. It is defined in the file
                        acpi_display_output=video
                        See above.
 
+       acpi_early_pdc_eval     [HW,ACPI] Evaluate processor _PDC methods
+                               early. Needed on some platforms to properly
+                               initialize the EC.
+
        acpi_irq_balance [HW,ACPI]
                        ACPI will balance active IRQs
                        default in APIC mode
index 7ae58892ba8d87ee699925380bcd92d59eca06ff..e97b255d97bcd8e74edbf0f501fa701bc588a51f 100644 (file)
@@ -94,6 +94,7 @@ ia64_acpi_release_global_lock (unsigned int *lock)
 #define acpi_noirq 0   /* ACPI always enabled on IA64 */
 #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
 #define acpi_strict 1  /* no ACPI spec workarounds on IA64 */
+#define acpi_ht 0      /* no HT-only mode on IA64 */
 #endif
 #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
 static inline void disable_acpi(void) { }
index e14108b19c091a654eb2a28cbf45ff104efa5ace..4c41656ede87e828e95226fabf409fedc09406ca 100644 (file)
@@ -201,7 +201,9 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
    relevant until we have real hardware to play with... */
 #define ELF_PLATFORM   NULL
 
-#define SET_PERSONALITY(ex)    set_personality(PER_LINUX)
+#define SET_PERSONALITY(ex)    \
+       set_personality((current->personality & ~PER_MASK) | PER_LINUX)
+
 #define elf_read_implies_exec(ex, executable_stack)                                    \
        ((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
 
index 873ebdc4f98efcaed37132f524f78d35fb7c9d3a..b063eb8b18e30061088abe291a5eb6973eff09a3 100644 (file)
@@ -133,6 +133,8 @@ void user_enable_single_step(struct task_struct *child)
        struct pt_regs *regs = child->thread.uregs;
 
        regs->sr |= SR_SSTEP;   /* auto-resetting upon exception */
+
+       set_tsk_thread_flag(child, TIF_SINGLESTEP);
 }
 
 void user_disable_single_step(struct task_struct *child)
@@ -140,6 +142,8 @@ void user_disable_single_step(struct task_struct *child)
        struct pt_regs *regs = child->thread.uregs;
 
        regs->sr &= ~SR_SSTEP;
+
+       clear_tsk_thread_flag(child, TIF_SINGLESTEP);
 }
 
 static int genregs_get(struct task_struct *target,
@@ -454,6 +458,8 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)
 
 asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
 {
+       int step;
+
        if (unlikely(current->audit_context))
                audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]),
                                   regs->regs[9]);
@@ -461,8 +467,9 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
        if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
                trace_sys_exit(regs, regs->regs[9]);
 
-       if (test_thread_flag(TIF_SYSCALL_TRACE))
-               tracehook_report_syscall_exit(regs, 0);
+       step = test_thread_flag(TIF_SINGLESTEP);
+       if (step || test_thread_flag(TIF_SYSCALL_TRACE))
+               tracehook_report_syscall_exit(regs, step);
 }
 
 /* Called with interrupts disabled */
index ce76dbdef2940fa8e920dcbc8f4bc265a0607b5f..580e97d46ca5a2dbb78132f148cfc71e7be43756 100644 (file)
@@ -118,7 +118,9 @@ static int do_signal(struct pt_regs *regs, sigset_t *oldset)
                         * clear the TS_RESTORE_SIGMASK flag.
                         */
                        current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
-                       tracehook_signal_handler(signr, &info, &ka, regs, 0);
+
+                       tracehook_signal_handler(signr, &info, &ka, regs,
+                                       test_thread_flag(TIF_SINGLESTEP));
                        return 1;
                }
        }
index 1994d3f5844311a53db371914df14a29b669db72..f2ad2163109daab72f9fed6bee91839f3e83601e 100644 (file)
@@ -170,10 +170,7 @@ static inline void elf_common_init(struct thread_struct *t,
 }
 
 #define ELF_PLAT_INIT(_r, load_addr)                   \
-do {                                                   \
-       elf_common_init(&current->thread, _r, 0);       \
-       clear_thread_flag(TIF_IA32);                    \
-} while (0)
+       elf_common_init(&current->thread, _r, 0)
 
 #define        COMPAT_ELF_PLAT_INIT(regs, load_addr)           \
        elf_common_init(&current->thread, regs, __USER_DS)
index 0acbcdfa5ca43d5533b8ec42939e7d05888e2cc4..af1c5833ff23dd4d026f6a6a7e06df67af652068 100644 (file)
@@ -1342,14 +1342,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
                     DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
                     },
         },
-       {
-        .callback = force_acpi_ht,
-        .ident = "ASUS P2B-DS",
-        .matches = {
-                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-                    DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
-                    },
-        },
        {
         .callback = force_acpi_ht,
         .ident = "ASUS CUR-DLS",
index 41a26a82470ad3970721bd2c3a00c6987b3f2d1c..126f0b493d049f0e0393d9c5c58d2ebb43fd25fd 100644 (file)
@@ -527,6 +527,7 @@ void set_personality_ia32(void)
 
        /* Make sure to be in 32bit mode */
        set_thread_flag(TIF_IA32);
+       current->personality |= force_personality32;
 
        /* Prepare the first "return" to user space */
        current_thread_info()->status |= TS_COMPAT;
index bbc2c1315c473ca7c7e8ff3770506ba645f16f0f..b2586f57e1f5fc1347757cbf24044acbac922a8d 100644 (file)
@@ -935,6 +935,7 @@ static int dock_add(acpi_handle handle)
        struct platform_device *dd;
 
        id = dock_station_count;
+       memset(&ds, 0, sizeof(ds));
        dd = platform_device_register_data(NULL, "dock", id, &ds, sizeof(ds));
        if (IS_ERR(dd))
                return PTR_ERR(dd);
index 7c0441f63b3963a0bcbe72ed3c8d2670442cd1f6..e88e8ae04fdbe5a9ecd8fe44c8128e65ab7f96bf 100644 (file)
@@ -110,6 +110,14 @@ static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = {
          DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
          DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")},
         (void *)2},
+       { set_max_cstate, "Pavilion zv5000", {
+         DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+         DMI_MATCH(DMI_PRODUCT_NAME,"Pavilion zv5000 (DS502A#ABA)")},
+        (void *)1},
+       { set_max_cstate, "Asus L8400B", {
+         DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
+         DMI_MATCH(DMI_PRODUCT_NAME,"L8400B series Notebook PC")},
+        (void *)1},
        {},
 };
 
index 7247819dbd80b0679af19bb17b152b4ba1f7dee9..e306ba9aa34e6bd0c50a4311474e4855453884fb 100644 (file)
@@ -125,6 +125,8 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in)
        return status;
 }
 
+static int early_pdc_done;
+
 void acpi_processor_set_pdc(acpi_handle handle)
 {
        struct acpi_object_list *obj_list;
@@ -132,6 +134,9 @@ void acpi_processor_set_pdc(acpi_handle handle)
        if (arch_has_acpi_pdc() == false)
                return;
 
+       if (early_pdc_done)
+               return;
+
        obj_list = acpi_processor_alloc_pdc();
        if (!obj_list)
                return;
@@ -151,6 +156,13 @@ static int set_early_pdc_optin(const struct dmi_system_id *id)
        return 0;
 }
 
+static int param_early_pdc_optin(char *s)
+{
+       early_pdc_optin = 1;
+       return 1;
+}
+__setup("acpi_early_pdc_eval", param_early_pdc_optin);
+
 static struct dmi_system_id __cpuinitdata early_pdc_optin_table[] = {
        {
        set_early_pdc_optin, "HP Envy", {
@@ -192,4 +204,6 @@ void __init acpi_early_processor_set_pdc(void)
        acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
                            ACPI_UINT32_MAX,
                            early_init_pdc, NULL, NULL, NULL);
+
+       early_pdc_done = 1;
 }
index ff9f6226085d04638bc3777e2c06bcba9686e09c..3e009674f333e31d032630e5fd2b51cb04f6ca85 100644 (file)
@@ -1336,9 +1336,25 @@ static int acpi_bus_scan(acpi_handle handle, struct acpi_bus_ops *ops,
 
        if (child)
                *child = device;
-       return 0;
+
+       if (device)
+               return 0;
+       else
+               return -ENODEV;
 }
 
+/*
+ * acpi_bus_add and acpi_bus_start
+ *
+ * scan a given ACPI tree and (probably recently hot-plugged)
+ * create and add or starts found devices.
+ *
+ * If no devices were found -ENODEV is returned which does not
+ * mean that this is a real error, there just have been no suitable
+ * ACPI objects in the table trunk from which the kernel could create
+ * a device and add/start an appropriate driver.
+ */
+
 int
 acpi_bus_add(struct acpi_device **child,
             struct acpi_device *parent, acpi_handle handle, int type)
@@ -1348,8 +1364,7 @@ acpi_bus_add(struct acpi_device **child,
        memset(&ops, 0, sizeof(ops));
        ops.acpi_op_add = 1;
 
-       acpi_bus_scan(handle, &ops, child);
-       return 0;
+       return acpi_bus_scan(handle, &ops, child);
 }
 EXPORT_SYMBOL(acpi_bus_add);
 
@@ -1357,11 +1372,13 @@ int acpi_bus_start(struct acpi_device *device)
 {
        struct acpi_bus_ops ops;
 
+       if (!device)
+               return -EINVAL;
+
        memset(&ops, 0, sizeof(ops));
        ops.acpi_op_start = 1;
 
-       acpi_bus_scan(device->handle, &ops, NULL);
-       return 0;
+       return acpi_bus_scan(device->handle, &ops, NULL);
 }
 EXPORT_SYMBOL(acpi_bus_start);
 
index f336bca7c4503ec1d03d7741ee8185afae942381..8a0ed2800e6359a49f781b41d2afc44cd183225b 100644 (file)
@@ -213,7 +213,7 @@ acpi_table_parse_entries(char *id,
        unsigned long table_end;
        acpi_size tbl_size;
 
-       if (acpi_disabled)
+       if (acpi_disabled && !acpi_ht)
                return -ENODEV;
 
        if (!handler)
@@ -280,7 +280,7 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
        struct acpi_table_header *table = NULL;
        acpi_size tbl_size;
 
-       if (acpi_disabled)
+       if (acpi_disabled && !acpi_ht)
                return -ENODEV;
 
        if (!handler)
index 161746deab4baabb00bebdf4fb0991bbdf693f7f..6e2c3b064f53759d9ea0e56cf43783ff0ecd1a39 100644 (file)
@@ -59,6 +59,8 @@ static void class_release(struct kobject *kobj)
        else
                pr_debug("class '%s' does not have a release() function, "
                         "be careful\n", class->name);
+
+       kfree(cp);
 }
 
 static struct sysfs_ops class_sysfs_ops = {
index cbaf420c36c531d4c09d612b62bca003dd86896e..2d3dc7ded0a94d88fd80e8506685e755ce09113e 100644 (file)
@@ -893,20 +893,31 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context,
 
 static struct kmem_cache *fwnet_packet_task_cache;
 
+static void fwnet_free_ptask(struct fwnet_packet_task *ptask)
+{
+       dev_kfree_skb_any(ptask->skb);
+       kmem_cache_free(fwnet_packet_task_cache, ptask);
+}
+
 static int fwnet_send_packet(struct fwnet_packet_task *ptask);
 
 static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask)
 {
-       struct fwnet_device *dev;
+       struct fwnet_device *dev = ptask->dev;
        unsigned long flags;
-
-       dev = ptask->dev;
+       bool free;
 
        spin_lock_irqsave(&dev->lock, flags);
-       list_del(&ptask->pt_link);
-       spin_unlock_irqrestore(&dev->lock, flags);
 
-       ptask->outstanding_pkts--; /* FIXME access inside lock */
+       ptask->outstanding_pkts--;
+
+       /* Check whether we or the networking TX soft-IRQ is last user. */
+       free = (ptask->outstanding_pkts == 0 && !list_empty(&ptask->pt_link));
+
+       if (ptask->outstanding_pkts == 0)
+               list_del(&ptask->pt_link);
+
+       spin_unlock_irqrestore(&dev->lock, flags);
 
        if (ptask->outstanding_pkts > 0) {
                u16 dg_size;
@@ -951,10 +962,10 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask)
                        ptask->max_payload = skb->len + RFC2374_FRAG_HDR_SIZE;
                }
                fwnet_send_packet(ptask);
-       } else {
-               dev_kfree_skb_any(ptask->skb);
-               kmem_cache_free(fwnet_packet_task_cache, ptask);
        }
+
+       if (free)
+               fwnet_free_ptask(ptask);
 }
 
 static void fwnet_write_complete(struct fw_card *card, int rcode,
@@ -977,6 +988,7 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask)
        unsigned tx_len;
        struct rfc2734_header *bufhdr;
        unsigned long flags;
+       bool free;
 
        dev = ptask->dev;
        tx_len = ptask->max_payload;
@@ -1022,12 +1034,16 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask)
                                generation, SCODE_100, 0ULL, ptask->skb->data,
                                tx_len + 8, fwnet_write_complete, ptask);
 
-               /* FIXME race? */
                spin_lock_irqsave(&dev->lock, flags);
-               list_add_tail(&ptask->pt_link, &dev->broadcasted_list);
+
+               /* If the AT tasklet already ran, we may be last user. */
+               free = (ptask->outstanding_pkts == 0 && list_empty(&ptask->pt_link));
+               if (!free)
+                       list_add_tail(&ptask->pt_link, &dev->broadcasted_list);
+
                spin_unlock_irqrestore(&dev->lock, flags);
 
-               return 0;
+               goto out;
        }
 
        fw_send_request(dev->card, &ptask->transaction,
@@ -1035,12 +1051,19 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask)
                        ptask->generation, ptask->speed, ptask->fifo_addr,
                        ptask->skb->data, tx_len, fwnet_write_complete, ptask);
 
-       /* FIXME race? */
        spin_lock_irqsave(&dev->lock, flags);
-       list_add_tail(&ptask->pt_link, &dev->sent_list);
+
+       /* If the AT tasklet already ran, we may be last user. */
+       free = (ptask->outstanding_pkts == 0 && list_empty(&ptask->pt_link));
+       if (!free)
+               list_add_tail(&ptask->pt_link, &dev->sent_list);
+
        spin_unlock_irqrestore(&dev->lock, flags);
 
        dev->netdev->trans_start = jiffies;
+ out:
+       if (free)
+               fwnet_free_ptask(ptask);
 
        return 0;
 }
@@ -1298,6 +1321,8 @@ static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net)
        spin_unlock_irqrestore(&dev->lock, flags);
 
        ptask->max_payload = max_payload;
+       INIT_LIST_HEAD(&ptask->pt_link);
+
        fwnet_send_packet(ptask);
 
        return NETDEV_TX_OK;
index 2345d4103fe6b3c3a62d7f8fc67bd1db049083b2..43ebf337b131152bb0503372cadd8173535e5e62 100644 (file)
@@ -2101,11 +2101,6 @@ static int ohci_queue_iso_transmit(struct fw_iso_context *base,
        u32 payload_index, payload_end_index, next_page_index;
        int page, end_page, i, length, offset;
 
-       /*
-        * FIXME: Cycle lost behavior should be configurable: lose
-        * packet, retransmit or terminate..
-        */
-
        p = packet;
        payload_index = payload;
 
@@ -2135,6 +2130,14 @@ static int ohci_queue_iso_transmit(struct fw_iso_context *base,
        if (!p->skip) {
                d[0].control   = cpu_to_le16(DESCRIPTOR_KEY_IMMEDIATE);
                d[0].req_count = cpu_to_le16(8);
+               /*
+                * Link the skip address to this descriptor itself.  This causes
+                * a context to skip a cycle whenever lost cycles or FIFO
+                * overruns occur, without dropping the data.  The application
+                * should then decide whether this is an error condition or not.
+                * FIXME:  Make the context's cycle-lost behaviour configurable?
+                */
+               d[0].branch_address = cpu_to_le32(d_bus | z);
 
                header = (__le32 *) &d[1];
                header[0] = cpu_to_le32(IT_HEADER_SY(p->sy) |
index cdec32977129b98bf00179f01e919dc297fcf333..2ac074c8f5d2e546d40ff53fa3fe54c83547773d 100644 (file)
@@ -405,7 +405,8 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
                                wasted += alignment - tmp;
                }
 
-               if (entry->size >= size + wasted) {
+               if (entry->size >= size + wasted &&
+                   (entry->start + wasted + size) <= end) {
                        if (!best_match)
                                return entry;
                        if (entry->size < best_size) {
index e3b44562d2654f7ab2c29da917d50a864db736ef..2a3df5599ab48b0056fc2a4ad4b2d37bac29b4a1 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <asm/unaligned.h>
 
 #define ATOM_DEBUG
 
@@ -212,7 +213,9 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr,
        case ATOM_ARG_PS:
                idx = U8(*ptr);
                (*ptr)++;
-               val = le32_to_cpu(ctx->ps[idx]);
+               /* get_unaligned_le32 avoids unaligned accesses from atombios
+                * tables, noticed on a DEC Alpha. */
+               val = get_unaligned_le32((u32 *)&ctx->ps[idx]);
                if (print)
                        DEBUG("PS[0x%02X,0x%04X]", idx, val);
                break;
index b32eeea5bb8b24796318ab165712e39afbcfc3ef..99915a682d593deb4b4aabaf2cd81fd902bc9103 100644 (file)
@@ -350,7 +350,7 @@ retry:
        atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
 
        if (args.ucReplyStatus && !args.ucDataOutLen) {
-               if (args.ucReplyStatus == 0x20 && retry_count < 10)
+               if (args.ucReplyStatus == 0x20 && retry_count++ < 10)
                        goto retry;
                DRM_DEBUG("failed to get auxch %02x%02x %02x %02x 0x%02x %02x after %d retries\n",
                          req_bytes[1], req_bytes[0], req_bytes[2], req_bytes[3],
index 1a3e909b7bba6e926cd5aa3b90e5a51419b1db03..c7320ce4567de25569eb23c6fe352ae9f62a3bf9 100644 (file)
@@ -1020,6 +1020,12 @@ static int ttm_bo_mem_compat(struct ttm_placement *placement,
                             struct ttm_mem_reg *mem)
 {
        int i;
+       struct drm_mm_node *node = mem->mm_node;
+
+       if (node && placement->lpfn != 0 &&
+           (node->start < placement->fpfn ||
+            node->start + node->size > placement->lpfn))
+               return -1;
 
        for (i = 0; i < placement->num_placement; i++) {
                if ((placement->placement[i] & mem->placement &
index 54abf9e303b7d66c4f41de1ef1ff17197572d292..f1c8cae70b4ba0c8de108a88ee72ecc26def140a 100644 (file)
@@ -172,11 +172,15 @@ int dm_consult_userspace(const char *uuid, uint64_t luid, int request_type,
 {
        int r = 0;
        size_t dummy = 0;
-       int overhead_size =
-               sizeof(struct dm_ulog_request *) + sizeof(struct cn_msg);
+       int overhead_size = sizeof(struct dm_ulog_request) + sizeof(struct cn_msg);
        struct dm_ulog_request *tfr = prealloced_ulog_tfr;
        struct receiving_pkg pkg;
 
+       /*
+        * Given the space needed to hold the 'struct cn_msg' and
+        * 'struct dm_ulog_request' - do we have enough payload
+        * space remaining?
+        */
        if (data_size > (DM_ULOG_PREALLOCED_SIZE - overhead_size)) {
                DMINFO("Size of tfr exceeds preallocated size");
                return -EINVAL;
@@ -191,7 +195,7 @@ resend:
         */
        mutex_lock(&dm_ulog_lock);
 
-       memset(tfr, 0, DM_ULOG_PREALLOCED_SIZE - overhead_size);
+       memset(tfr, 0, DM_ULOG_PREALLOCED_SIZE - sizeof(struct cn_msg));
        memcpy(tfr->uuid, uuid, DM_UUID_LEN);
        tfr->luid = luid;
        tfr->seq = dm_ulog_seq++;
index ad779bd13aec43ac6aba859be57a8e94d01a5001..6c1046df81f6f7738cd74eec6a6d5558a8e23f13 100644 (file)
@@ -724,7 +724,7 @@ static void do_writes(struct mirror_set *ms, struct bio_list *writes)
        /*
         * Dispatch io.
         */
-       if (unlikely(ms->log_failure)) {
+       if (unlikely(ms->log_failure) && errors_handled(ms)) {
                spin_lock_irq(&ms->lock);
                bio_list_merge(&ms->failures, &sync);
                spin_unlock_irq(&ms->lock);
index 5f19ceb6fe91f6c214c9103cc4b5b4037de84a9f..168bd38f50060968cf59e3543708701f1f1f575a 100644 (file)
@@ -660,10 +660,9 @@ void dm_rh_recovery_end(struct dm_region *reg, int success)
        spin_lock_irq(&rh->region_lock);
        if (success)
                list_add(&reg->list, &reg->rh->recovered_regions);
-       else {
-               reg->state = DM_RH_NOSYNC;
+       else
                list_add(&reg->list, &reg->rh->failed_recovered_regions);
-       }
+
        spin_unlock_irq(&rh->region_lock);
 
        rh->wakeup_workers(rh->context);
index 7d08879689acc27b6e91f038e53fb1be4deb1b89..c097d8a4823d65f7e3408c9f116c235b19cec735 100644 (file)
@@ -254,7 +254,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw,
         * Issue the synchronous I/O from a different thread
         * to avoid generic_make_request recursion.
         */
-       INIT_WORK(&req.work, do_metadata);
+       INIT_WORK_ON_STACK(&req.work, do_metadata);
        queue_work(ps->metadata_wq, &req.work);
        flush_workqueue(ps->metadata_wq);
 
index e0efc1adcaffa173e2177596579193217f353b8f..bd58703ee8f6b83d2a245328e9f30fa5e47dfcf4 100644 (file)
@@ -110,7 +110,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
        }
 
        stripes = simple_strtoul(argv[0], &end, 10);
-       if (*end) {
+       if (!stripes || *end) {
                ti->error = "Invalid stripe count";
                return -EINVAL;
        }
index f53392df7b97984438e8ec823abccb59d4386ee9..f91b40942e07885a1d2265de3c41e6abf6465fc7 100644 (file)
@@ -79,13 +79,6 @@ static struct sysfs_ops dm_sysfs_ops = {
        .show   = dm_attr_show,
 };
 
-/*
- * The sysfs structure is embedded in md struct, nothing to do here
- */
-static void dm_sysfs_release(struct kobject *kobj)
-{
-}
-
 /*
  * dm kobject is embedded in mapped_device structure
  * no need to define release function here
@@ -93,7 +86,6 @@ static void dm_sysfs_release(struct kobject *kobj)
 static struct kobj_type dm_ktype = {
        .sysfs_ops      = &dm_sysfs_ops,
        .default_attrs  = dm_attrs,
-       .release        = dm_sysfs_release
 };
 
 /*
index 3167480b532cd92e64c12831bb3ac4d424f37270..aa4e2aa86d490c5aa1af423d23c176ed69c25302 100644 (file)
@@ -1595,10 +1595,15 @@ static int dm_prep_fn(struct request_queue *q, struct request *rq)
        return BLKPREP_OK;
 }
 
-static void map_request(struct dm_target *ti, struct request *clone,
-                       struct mapped_device *md)
+/*
+ * Returns:
+ * 0  : the request has been processed (not requeued)
+ * !0 : the request has been requeued
+ */
+static int map_request(struct dm_target *ti, struct request *clone,
+                      struct mapped_device *md)
 {
-       int r;
+       int r, requeued = 0;
        struct dm_rq_target_io *tio = clone->end_io_data;
 
        /*
@@ -1625,6 +1630,7 @@ static void map_request(struct dm_target *ti, struct request *clone,
        case DM_MAPIO_REQUEUE:
                /* The target wants to requeue the I/O */
                dm_requeue_unmapped_request(clone);
+               requeued = 1;
                break;
        default:
                if (r > 0) {
@@ -1636,6 +1642,8 @@ static void map_request(struct dm_target *ti, struct request *clone,
                dm_kill_unmapped_request(clone, r);
                break;
        }
+
+       return requeued;
 }
 
 /*
@@ -1677,12 +1685,17 @@ static void dm_request_fn(struct request_queue *q)
                atomic_inc(&md->pending[rq_data_dir(clone)]);
 
                spin_unlock(q->queue_lock);
-               map_request(ti, clone, md);
+               if (map_request(ti, clone, md))
+                       goto requeued;
+
                spin_lock_irq(q->queue_lock);
        }
 
        goto out;
 
+requeued:
+       spin_lock_irq(q->queue_lock);
+
 plug_and_out:
        if (!elv_queue_empty(q))
                /* Some requests still remain, retry later */
index fee6eee7ae5ba583bf345a79a4be188fbdd2345d..006cb2efcd2250691df59c94350252b4eee4b926 100644 (file)
@@ -296,6 +296,7 @@ static void be_cmd_hdr_prepare(struct be_cmd_req_hdr *req_hdr,
        req_hdr->opcode = opcode;
        req_hdr->subsystem = subsystem;
        req_hdr->request_length = cpu_to_le32(cmd_len - sizeof(*req_hdr));
+       req_hdr->version = 0;
 }
 
 static void be_cmd_page_addrs_prepare(struct phys_addr *pages, u32 max_pages,
index 3103f4165311e4b32080731241a392a2573f6d18..35a06b47587bd2bf57a376bf4f95ee65a7c93c0e 100644 (file)
@@ -357,12 +357,34 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num)
        u32 fctrl_reg;
        u32 rmcs_reg;
        u32 reg;
+       u32 link_speed = 0;
+       bool link_up;
 
 #ifdef CONFIG_DCB
        if (hw->fc.requested_mode == ixgbe_fc_pfc)
                goto out;
 
 #endif /* CONFIG_DCB */
+       /*
+        * On 82598 having Rx FC on causes resets while doing 1G
+        * so if it's on turn it off once we know link_speed. For
+        * more details see 82598 Specification update.
+        */
+       hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
+       if (link_up && link_speed == IXGBE_LINK_SPEED_1GB_FULL) {
+               switch (hw->fc.requested_mode) {
+               case ixgbe_fc_full:
+                       hw->fc.requested_mode = ixgbe_fc_tx_pause;
+                       break;
+               case ixgbe_fc_rx_pause:
+                       hw->fc.requested_mode = ixgbe_fc_none;
+                       break;
+               default:
+                       /* no change */
+                       break;
+               }
+       }
+
        /* Negotiate the fc mode to use */
        ret_val = ixgbe_fc_autoneg(hw);
        if (ret_val)
index 7b7c8486c0bf8dee604ea17949a1d945abeabf9c..951b73cf5ca2b2f9dd53e4bcd6c8509740a659b0 100644 (file)
@@ -5763,6 +5763,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
        if (err)
                goto err_sw_init;
 
+       /* Make it possible the adapter to be woken up via WOL */
+       if (adapter->hw.mac.type == ixgbe_mac_82599EB)
+               IXGBE_WRITE_REG(&adapter->hw, IXGBE_WUS, ~0);
+
        /*
         * If there is a fan on this device and it has failed log the
         * failure.
index 103e8b0e2a0d67e6682cb827e010a7e8f260e025..46997e177ee3661fb6c1d0d57338d6b0268af4ee 100644 (file)
@@ -2284,6 +2284,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
  fail2:
        efx_fini_struct(efx);
  fail1:
+       WARN_ON(rc > 0);
        EFX_LOG(efx, "initialisation failed. rc=%d\n", rc);
        free_netdev(net_dev);
        return rc;
index e0d13a451019753112ebc72e23cf9def99486896..67eec7a6e48716e000bd6485837471196dd90359 100644 (file)
@@ -320,7 +320,7 @@ static int qt202x_reset_phy(struct efx_nic *efx)
 
        falcon_board(efx)->type->init_phy(efx);
 
-       return rc;
+       return 0;
 
  fail:
        EFX_ERR(efx, "PHY reset timed out\n");
index c93f58f5c6f2f14be1bbc51ad9133dd15a989f5f..317aa34b21cf6b21c42c81c33f0bb014eeb9948f 100644 (file)
@@ -1877,13 +1877,12 @@ static void velocity_error(struct velocity_info *vptr, int status)
 /**
  *     tx_srv          -       transmit interrupt service
  *     @vptr; Velocity
- *     @status:
  *
  *     Scan the queues looking for transmitted packets that
  *     we can complete and clean up. Update any statistics as
  *     necessary/
  */
-static int velocity_tx_srv(struct velocity_info *vptr, u32 status)
+static int velocity_tx_srv(struct velocity_info *vptr)
 {
        struct tx_desc *td;
        int qnum;
@@ -2090,14 +2089,12 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx)
 /**
  *     velocity_rx_srv         -       service RX interrupt
  *     @vptr: velocity
- *     @status: adapter status (unused)
  *
  *     Walk the receive ring of the velocity adapter and remove
  *     any received packets from the receive queue. Hand the ring
  *     slots back to the adapter for reuse.
  */
-static int velocity_rx_srv(struct velocity_info *vptr, int status,
-               int budget_left)
+static int velocity_rx_srv(struct velocity_info *vptr, int budget_left)
 {
        struct net_device_stats *stats = &vptr->dev->stats;
        int rd_curr = vptr->rx.curr;
@@ -2151,32 +2148,24 @@ static int velocity_poll(struct napi_struct *napi, int budget)
        struct velocity_info *vptr = container_of(napi,
                        struct velocity_info, napi);
        unsigned int rx_done;
-       u32 isr_status;
-
-       spin_lock(&vptr->lock);
-       isr_status = mac_read_isr(vptr->mac_regs);
-
-       /* Ack the interrupt */
-       mac_write_isr(vptr->mac_regs, isr_status);
-       if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI)))
-               velocity_error(vptr, isr_status);
+       unsigned long flags;
 
+       spin_lock_irqsave(&vptr->lock, flags);
        /*
         * Do rx and tx twice for performance (taken from the VIA
         * out-of-tree driver).
         */
-       rx_done = velocity_rx_srv(vptr, isr_status, budget / 2);
-       velocity_tx_srv(vptr, isr_status);
-       rx_done += velocity_rx_srv(vptr, isr_status, budget - rx_done);
-       velocity_tx_srv(vptr, isr_status);
-
-       spin_unlock(&vptr->lock);
+       rx_done = velocity_rx_srv(vptr, budget / 2);
+       velocity_tx_srv(vptr);
+       rx_done += velocity_rx_srv(vptr, budget - rx_done);
+       velocity_tx_srv(vptr);
 
        /* If budget not fully consumed, exit the polling mode */
        if (rx_done < budget) {
                napi_complete(napi);
                mac_enable_int(vptr->mac_regs);
        }
+       spin_unlock_irqrestore(&vptr->lock, flags);
 
        return rx_done;
 }
@@ -2206,10 +2195,17 @@ static irqreturn_t velocity_intr(int irq, void *dev_instance)
                return IRQ_NONE;
        }
 
+       /* Ack the interrupt */
+       mac_write_isr(vptr->mac_regs, isr_status);
+
        if (likely(napi_schedule_prep(&vptr->napi))) {
                mac_disable_int(vptr->mac_regs);
                __napi_schedule(&vptr->napi);
        }
+
+       if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI)))
+               velocity_error(vptr, isr_status);
+
        spin_unlock(&vptr->lock);
 
        return IRQ_HANDLED;
@@ -3100,7 +3096,7 @@ static int velocity_resume(struct pci_dev *pdev)
        velocity_init_registers(vptr, VELOCITY_INIT_WOL);
        mac_disable_int(vptr->mac_regs);
 
-       velocity_tx_srv(vptr, 0);
+       velocity_tx_srv(vptr);
 
        for (i = 0; i < vptr->tx.numq; i++) {
                if (vptr->tx.used[i])
@@ -3344,6 +3340,7 @@ static int velocity_set_coalesce(struct net_device *dev,
 {
        struct velocity_info *vptr = netdev_priv(dev);
        int max_us = 0x3f * 64;
+       unsigned long flags;
 
        /* 6 bits of  */
        if (ecmd->tx_coalesce_usecs > max_us)
@@ -3365,6 +3362,7 @@ static int velocity_set_coalesce(struct net_device *dev,
                        ecmd->tx_coalesce_usecs);
 
        /* Setup the interrupt suppression and queue timers */
+       spin_lock_irqsave(&vptr->lock, flags);
        mac_disable_int(vptr->mac_regs);
        setup_adaptive_interrupts(vptr);
        setup_queue_timers(vptr);
@@ -3372,6 +3370,7 @@ static int velocity_set_coalesce(struct net_device *dev,
        mac_write_int_mask(vptr->int_mask, vptr->mac_regs);
        mac_clear_isr(vptr->mac_regs);
        mac_enable_int(vptr->mac_regs);
+       spin_unlock_irqrestore(&vptr->lock, flags);
 
        return 0;
 }
index fa12b9060b0bbc1f0d5ae375501abdb9c2d31a0b..29bf33692f71be2427de03c21ae0d547ebdb844e 100644 (file)
@@ -1615,7 +1615,7 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
                bf->bf_frmlen -= padsize;
        }
 
-       if (conf_is_ht(&hw->conf) && !is_pae(skb))
+       if (conf_is_ht(&hw->conf))
                bf->bf_state.bf_type |= BUF_HT;
 
        bf->bf_flags = setup_tx_flags(sc, skb, txctl->txq);
@@ -1701,7 +1701,7 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf,
                        goto tx_done;
                }
 
-               if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
+               if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && !is_pae(skb)) {
                        /*
                         * Try aggregation if it's a unicast data frame
                         * and the destination is HT capable.
index fe3bf949199780bea902d3ad3cad122311c5612f..c484cc25389255f7609a55cdff7b414adeb805fe 100644 (file)
 #define B43_MMIO_TSF_2                 0x636   /* core rev < 3 only */
 #define B43_MMIO_TSF_3                 0x638   /* core rev < 3 only */
 #define B43_MMIO_RNG                   0x65A
+#define B43_MMIO_IFSSLOT               0x684   /* Interframe slot time */
 #define B43_MMIO_IFSCTL                        0x688 /* Interframe space control */
 #define  B43_MMIO_IFSCTL_USE_EDCF      0x0004
 #define B43_MMIO_POWERUP_DELAY         0x6A8
index 4c41cfe44f261494eceaa4080d85d7889344b42c..490fb45d1d053ebbd9c2dd21f5571cbf953eb934 100644 (file)
@@ -628,10 +628,17 @@ static void b43_upload_card_macaddress(struct b43_wldev *dev)
 static void b43_set_slot_time(struct b43_wldev *dev, u16 slot_time)
 {
        /* slot_time is in usec. */
-       if (dev->phy.type != B43_PHYTYPE_G)
+       /* This test used to exit for all but a G PHY. */
+       if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ)
                return;
-       b43_write16(dev, 0x684, 510 + slot_time);
-       b43_shm_write16(dev, B43_SHM_SHARED, 0x0010, slot_time);
+       b43_write16(dev, B43_MMIO_IFSSLOT, 510 + slot_time);
+       /* Shared memory location 0x0010 is the slot time and should be
+        * set to slot_time; however, this register is initially 0 and changing
+        * the value adversely affects the transmit rate for BCM4311
+        * devices. Until this behavior is unterstood, delete this step
+        *
+        * b43_shm_write16(dev, B43_SHM_SHARED, 0x0010, slot_time);
+        */
 }
 
 static void b43_short_slot_timing_enable(struct b43_wldev *dev)
index 5461f105bd2dcb61971d17c64ef17c640c553c8b..d10bea64fce3004335557f07cbc084ae5921a2d0 100644 (file)
@@ -2744,6 +2744,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
                if ((le16_to_cpu(priv->staging_rxon.channel) != ch))
                        priv->staging_rxon.flags = 0;
 
+               iwl_set_rxon_ht(priv, ht_conf);
                iwl_set_rxon_channel(priv, conf->channel);
 
                iwl_set_flags_for_band(priv, conf->channel->band);
index 6f36b6e79f5e3db56d72fdcbcab1da493ae41e8a..2dbce85404aa00b03f6cb217b145fcbe8661da5e 100644 (file)
@@ -928,7 +928,10 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv,
        if (ieee80211_is_mgmt(fc) ||
            ieee80211_has_protected(fc) ||
            ieee80211_has_morefrags(fc) ||
-           le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG)
+           le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG ||
+           (ieee80211_is_data_qos(fc) &&
+            *ieee80211_get_qos_ctl(hdr) &
+            IEEE80211_QOS_CONTROL_A_MSDU_PRESENT))
                ret = skb_linearize(skb);
        else
                ret = __pskb_pull_tail(skb, min_t(u16, IWL_LINK_HDR_MAX, len)) ?
index 6d6ed7485175a6f2d8f8d05793767e08c6f91c69..f727b4a83196bca7b15bf349a44ab1ad243f20a5 100644 (file)
@@ -794,7 +794,7 @@ static int iwm_mlme_update_bss_table(struct iwm_priv *iwm, u8 *buf,
        }
 
        bss->bss = kzalloc(bss_len, GFP_KERNEL);
-       if (!bss) {
+       if (!bss->bss) {
                kfree(bss);
                IWM_ERR(iwm, "Couldn't allocate bss\n");
                return -ENOMEM;
index bc5726dd5fe49f5fc7582f4a94d6bce4402de7af..7ba3052b0708aef88e7b8d32caaf6634b1c709b0 100644 (file)
@@ -65,6 +65,7 @@ static struct usb_device_id rtl8187_table[] __devinitdata = {
        /* Sitecom */
        {USB_DEVICE(0x0df6, 0x000d), .driver_info = DEVICE_RTL8187},
        {USB_DEVICE(0x0df6, 0x0028), .driver_info = DEVICE_RTL8187B},
+       {USB_DEVICE(0x0df6, 0x0029), .driver_info = DEVICE_RTL8187B},
        /* Sphairon Access Systems GmbH */
        {USB_DEVICE(0x114B, 0x0150), .driver_info = DEVICE_RTL8187},
        /* Dick Smith Electronics */
index 8e952fdab7642a83aaedfefeba108826127e8807..cb2fd01eddaed6fa23b679ecadf86d15171e8518 100644 (file)
@@ -720,12 +720,6 @@ static int acpiphp_bus_add(struct acpiphp_func *func)
                        -ret_val);
                goto acpiphp_bus_add_out;
        }
-       /*
-        * try to start anyway.  We could have failed to add
-        * simply because this bus had previously been added
-        * on another add.  Don't bother with the return value
-        * we just keep going.
-        */
        ret_val = acpi_bus_start(device);
 
 acpiphp_bus_add_out:
index e67e4feb35cb814f85ad2df10bc1836c00cc79b6..eb603f1d55ca4ba0ecf4f2fa685cc7364142a740 100644 (file)
@@ -5771,7 +5771,7 @@ static void thermal_exit(void)
        case TPACPI_THERMAL_ACPI_TMP07:
        case TPACPI_THERMAL_ACPI_UPDT:
                sysfs_remove_group(&tpacpi_sensors_pdev->dev.kobj,
-                                  &thermal_temp_input16_group);
+                                  &thermal_temp_input8_group);
                break;
        case TPACPI_THERMAL_NONE:
        default:
index c3e37c8e7e26a8b8ecc4a767561aea15b2378909..e9b15c3746fa0307bc91c929c929374efd0f1bea 100644 (file)
@@ -83,6 +83,9 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */
 
 #define PASS_LIMIT     256
 
+#define BOTH_EMPTY     (UART_LSR_TEMT | UART_LSR_THRE)
+
+
 /*
  * We default to IRQ0 for the "no irq" hack.   Some
  * machine types want others as well - they're free
@@ -1792,7 +1795,7 @@ static unsigned int serial8250_tx_empty(struct uart_port *port)
        up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
        spin_unlock_irqrestore(&up->port.lock, flags);
 
-       return lsr & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
+       return (lsr & BOTH_EMPTY) == BOTH_EMPTY ? TIOCSER_TEMT : 0;
 }
 
 static unsigned int serial8250_get_mctrl(struct uart_port *port)
@@ -1850,8 +1853,6 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state)
        spin_unlock_irqrestore(&up->port.lock, flags);
 }
 
-#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
-
 /*
  *     Wait for transmitter & holding register to empty
  */
index 5681ebed9c65d879132235a165af705d25cf37ab..03dfd27c4bfba8cb78df400a12589be531879f6b 100644 (file)
@@ -494,8 +494,7 @@ static int ssb_devices_register(struct ssb_bus *bus)
 #endif
                        break;
                case SSB_BUSTYPE_SDIO:
-#ifdef CONFIG_SSB_SDIO
-                       sdev->irq = bus->host_sdio->dev.irq;
+#ifdef CONFIG_SSB_SDIOHOST
                        dev->parent = &bus->host_sdio->dev;
 #endif
                        break;
index 6e8bcdfd23b41ee8435efbbb5e6bfadeb8095eb3..a678186f218fa84dc8b5fadcb8b196ff54898b06 100644 (file)
@@ -1312,9 +1312,9 @@ static int processcompl(struct async *as, void __user * __user *arg)
        void __user *addr = as->userurb;
        unsigned int i;
 
-       if (as->userbuffer)
+       if (as->userbuffer && urb->actual_length)
                if (copy_to_user(as->userbuffer, urb->transfer_buffer,
-                                urb->transfer_buffer_length))
+                                urb->actual_length))
                        goto err_out;
        if (put_user(as->status, &userurb->status))
                goto err_out;
@@ -1334,14 +1334,11 @@ static int processcompl(struct async *as, void __user * __user *arg)
                }
        }
 
-       free_async(as);
-
        if (put_user(addr, (void __user * __user *)arg))
                return -EFAULT;
        return 0;
 
 err_out:
-       free_async(as);
        return -EFAULT;
 }
 
@@ -1371,8 +1368,11 @@ static struct async *reap_as(struct dev_state *ps)
 static int proc_reapurb(struct dev_state *ps, void __user *arg)
 {
        struct async *as = reap_as(ps);
-       if (as)
-               return processcompl(as, (void __user * __user *)arg);
+       if (as) {
+               int retval = processcompl(as, (void __user * __user *)arg);
+               free_async(as);
+               return retval;
+       }
        if (signal_pending(current))
                return -EINTR;
        return -EIO;
@@ -1380,11 +1380,16 @@ static int proc_reapurb(struct dev_state *ps, void __user *arg)
 
 static int proc_reapurbnonblock(struct dev_state *ps, void __user *arg)
 {
+       int retval;
        struct async *as;
 
-       if (!(as = async_getcompleted(ps)))
-               return -EAGAIN;
-       return processcompl(as, (void __user * __user *)arg);
+       as = async_getcompleted(ps);
+       retval = -EAGAIN;
+       if (as) {
+               retval = processcompl(as, (void __user * __user *)arg);
+               free_async(as);
+       }
+       return retval;
 }
 
 #ifdef CONFIG_COMPAT
@@ -1475,9 +1480,9 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
        void __user *addr = as->userurb;
        unsigned int i;
 
-       if (as->userbuffer)
+       if (as->userbuffer && urb->actual_length)
                if (copy_to_user(as->userbuffer, urb->transfer_buffer,
-                                urb->transfer_buffer_length))
+                                urb->actual_length))
                        return -EFAULT;
        if (put_user(as->status, &userurb->status))
                return -EFAULT;
@@ -1497,7 +1502,6 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
                }
        }
 
-       free_async(as);
        if (put_user(ptr_to_compat(addr), (u32 __user *)arg))
                return -EFAULT;
        return 0;
@@ -1506,8 +1510,11 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
 static int proc_reapurb_compat(struct dev_state *ps, void __user *arg)
 {
        struct async *as = reap_as(ps);
-       if (as)
-               return processcompl_compat(as, (void __user * __user *)arg);
+       if (as) {
+               int retval = processcompl_compat(as, (void __user * __user *)arg);
+               free_async(as);
+               return retval;
+       }
        if (signal_pending(current))
                return -EINTR;
        return -EIO;
@@ -1515,11 +1522,16 @@ static int proc_reapurb_compat(struct dev_state *ps, void __user *arg)
 
 static int proc_reapurbnonblock_compat(struct dev_state *ps, void __user *arg)
 {
+       int retval;
        struct async *as;
 
-       if (!(as = async_getcompleted(ps)))
-               return -EAGAIN;
-       return processcompl_compat(as, (void __user * __user *)arg);
+       retval = -EAGAIN;
+       as = async_getcompleted(ps);
+       if (as) {
+               retval = processcompl_compat(as, (void __user * __user *)arg);
+               free_async(as);
+       }
+       return retval;
 }
 
 
index 0a577d5694fdb9b379d2533335c2f03ad394b65b..d4f0db58a8ad11238ee9ded4995f4f5780b863ab 100644 (file)
@@ -358,7 +358,7 @@ done:
         * b15:         bmType (0 == data)
         */
        len = skb->len;
-       put_unaligned_le16((len & 0x3FFF) | BIT(14), skb_push(skb, 2));
+       put_unaligned_le16(len & 0x3FFF, skb_push(skb, 2));
 
        /* add a zero-length EEM packet, if needed */
        if (padlen)
@@ -464,7 +464,6 @@ static int eem_unwrap(struct gether *port,
                        }
 
                        /* validate CRC */
-                       crc = get_unaligned_le32(skb->data + len - ETH_FCS_LEN);
                        if (header & BIT(14)) {
                                crc = get_unaligned_le32(skb->data + len
                                                        - ETH_FCS_LEN);
index 429560100b10fc048a9e6c92d65efeac51effe20..76496f5d272c59cebd3856aa8cce245d5c4352f3 100644 (file)
@@ -29,7 +29,7 @@
 #if defined USB_ETH_RNDIS
 #  undef USB_ETH_RNDIS
 #endif
-#ifdef CONFIG_USB_ETH_RNDIS
+#ifdef CONFIG_USB_G_MULTI_RNDIS
 #  define USB_ETH_RNDIS y
 #endif
 
index e220fb8091a3618d536123f86c724d95bc7e8325..8b45145b913618ea302bf062e905a67ed87baaf2 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
index 4b5dbd0127f500a458094d4e7fc4fc267de146be..5fc80a104150aef353391596fc0ed17c476136c6 100644 (file)
@@ -2582,6 +2582,7 @@ err:
        hsotg->gadget.dev.driver = NULL;
        return ret;
 }
+EXPORT_SYMBOL(usb_gadget_register_driver);
 
 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 {
index c75d9270c752921ee8751e2106ce522c6db2ee85..19372673bf09aadffc955c2ca531b8133b219149 100644 (file)
@@ -196,7 +196,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
                        if (hostpc_reg) {
                                u32     t3;
 
+                               spin_unlock_irq(&ehci->lock);
                                msleep(5);/* 5ms for HCD enter low pwr mode */
+                               spin_lock_irq(&ehci->lock);
                                t3 = ehci_readl(ehci, hostpc_reg);
                                ehci_writel(ehci, t3 | HOSTPC_PHCD, hostpc_reg);
                                t3 = ehci_readl(ehci, hostpc_reg);
@@ -904,17 +906,18 @@ static int ehci_hub_control (
                        if ((temp & PORT_PE) == 0
                                        || (temp & PORT_RESET) != 0)
                                goto error;
-                       ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
+
                        /* After above check the port must be connected.
                         * Set appropriate bit thus could put phy into low power
                         * mode if we have hostpc feature
                         */
+                       temp &= ~PORT_WKCONN_E;
+                       temp |= PORT_WKDISC_E | PORT_WKOC_E;
+                       ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
                        if (hostpc_reg) {
-                               temp &= ~PORT_WKCONN_E;
-                               temp |= (PORT_WKDISC_E | PORT_WKOC_E);
-                               ehci_writel(ehci, temp | PORT_SUSPEND,
-                                                       status_reg);
+                               spin_unlock_irqrestore(&ehci->lock, flags);
                                msleep(5);/* 5ms for HCD enter low pwr mode */
+                               spin_lock_irqsave(&ehci->lock, flags);
                                temp1 = ehci_readl(ehci, hostpc_reg);
                                ehci_writel(ehci, temp1 | HOSTPC_PHCD,
                                        hostpc_reg);
index d224ab467a401d729b13b2d8c9f44f380616f184..e1232890c78bb9f9f4d931589dc14adeb363f2ba 100644 (file)
@@ -105,7 +105,7 @@ void fhci_ep0_free(struct fhci_usb *usb)
                if (ep->td_base)
                        cpm_muram_free(cpm_muram_offset(ep->td_base));
 
-               if (ep->conf_frame_Q) {
+               if (kfifo_initialized(&ep->conf_frame_Q)) {
                        size = cq_howmany(&ep->conf_frame_Q);
                        for (; size; size--) {
                                struct packet *pkt = cq_get(&ep->conf_frame_Q);
@@ -115,7 +115,7 @@ void fhci_ep0_free(struct fhci_usb *usb)
                        cq_delete(&ep->conf_frame_Q);
                }
 
-               if (ep->empty_frame_Q) {
+               if (kfifo_initialized(&ep->empty_frame_Q)) {
                        size = cq_howmany(&ep->empty_frame_Q);
                        for (; size; size--) {
                                struct packet *pkt = cq_get(&ep->empty_frame_Q);
@@ -125,7 +125,7 @@ void fhci_ep0_free(struct fhci_usb *usb)
                        cq_delete(&ep->empty_frame_Q);
                }
 
-               if (ep->dummy_packets_Q) {
+               if (kfifo_initialized(&ep->dummy_packets_Q)) {
                        size = cq_howmany(&ep->dummy_packets_Q);
                        for (; size; size--) {
                                u8 *buff = cq_get(&ep->dummy_packets_Q);
index 0025847743f30fc12500045e7980bd5568e4e83c..8b37a4b9839edcbc047258f391c73a8a16a82263 100644 (file)
@@ -3245,6 +3245,7 @@ static struct usb_device_id sisusb_table [] = {
        { USB_DEVICE(0x0711, 0x0902) },
        { USB_DEVICE(0x0711, 0x0903) },
        { USB_DEVICE(0x0711, 0x0918) },
+       { USB_DEVICE(0x0711, 0x0920) },
        { USB_DEVICE(0x182d, 0x021c) },
        { USB_DEVICE(0x182d, 0x0269) },
        { }
index de56b3d743d781a4294801e32af9341967943d06..3d2d3e549bd18cbe8392b72b212209e79c8a1b7f 100644 (file)
@@ -44,6 +44,7 @@ config ISP1301_OMAP
 config USB_ULPI
        bool "Generic ULPI Transceiver Driver"
        depends on ARM
+       select USB_OTG_UTILS
        help
          Enable this to support ULPI connected USB OTG transceivers which
          are likely found on embedded boards.
index 216f187582ab4ea17ffe40234a2300c78f3d99a5..7638828e7317787bbd8905f426032c3dbbaa2dce 100644 (file)
@@ -50,7 +50,7 @@
  * Version Information
  */
 #define DRIVER_VERSION "v1.5.0"
-#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>"
+#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>, Andreas Mohr"
 #define DRIVER_DESC "USB FTDI Serial Converters Driver"
 
 static int debug;
@@ -145,10 +145,15 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
 
 
 
+/*
+ * Device ID not listed? Test via module params product/vendor or
+ * /sys/bus/usb/ftdi_sio/new_id, then send patch/report!
+ */
 static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
@@ -552,9 +557,16 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) },
        /*
-        * Due to many user requests for multiple ELV devices we enable
-        * them by default.
+        * ELV devices:
         */
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_WS550_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_EC3000_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_WS888_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_TWS550_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_FEM_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_CLI7000_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_PPS7330_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_TFM100_PID) },
@@ -571,11 +583,17 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_ELV_PCK100_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_RFP500_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_UTP8_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_WS444PC_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_HS485_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_UMS100_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_TFD128_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_FM3RX_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_WS777_PID) },
        { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
        { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
        { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) },
@@ -697,6 +715,7 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
        { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
        { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
+       { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
        { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
index da92b4952ffb0bdc855f3a8186181aa7ae55ec85..c8951aeed98379d93d3793a70440eb426ffb2286 100644 (file)
@@ -38,6 +38,8 @@
 /* www.candapter.com Ewert Energy Systems CANdapter device */
 #define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */
 
+#define FTDI_NXTCAM_PID                0xABB8 /* NXTCam for Mindstorms NXT */
+
 /* OOCDlink by Joern Kaipf <joernk@web.de>
  * (http://www.joernonline.de/dw/doku.php?id=start&idx=projects:oocdlink) */
 #define FTDI_OOCDLINK_PID      0xbaf8  /* Amontec JTAGkey */
 /*
  * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).
  * All of these devices use FTDI's vendor ID (0x0403).
+ * Further IDs taken from ELV Windows .inf file.
  *
  * The previously included PID for the UO 100 module was incorrect.
  * In fact, that PID was for ELV's UR 100 USB-RS232 converter (0xFB58).
  *
  * Armin Laeuger originally sent the PID for the UM 100 module.
  */
+#define FTDI_ELV_USR_PID       0xE000  /* ELV Universal-Sound-Recorder */
+#define FTDI_ELV_MSM1_PID      0xE001  /* ELV Mini-Sound-Modul */
+#define FTDI_ELV_KL100_PID     0xE002  /* ELV Kfz-Leistungsmesser KL 100 */
+#define FTDI_ELV_WS550_PID     0xE004  /* WS 550 */
+#define FTDI_ELV_EC3000_PID    0xE006  /* ENERGY CONTROL 3000 USB */
+#define FTDI_ELV_WS888_PID     0xE008  /* WS 888 */
+#define FTDI_ELV_TWS550_PID    0xE009  /* Technoline WS 550 */
+#define FTDI_ELV_FEM_PID       0xE00A  /* Funk Energie Monitor */
 #define FTDI_ELV_FHZ1300PC_PID 0xE0E8  /* FHZ 1300 PC */
 #define FTDI_ELV_WS500_PID     0xE0E9  /* PC-Wetterstation (WS 500) */
 #define FTDI_ELV_HS485_PID     0xE0EA  /* USB to RS-485 adapter */
+#define FTDI_ELV_UMS100_PID    0xE0EB  /* ELV USB Master-Slave Schaltsteckdose UMS 100 */
+#define FTDI_ELV_TFD128_PID    0xE0EC  /* ELV Temperatur-Feuchte-Datenlogger TFD 128 */
+#define FTDI_ELV_FM3RX_PID     0xE0ED  /* ELV Messwertuebertragung FM3 RX */
+#define FTDI_ELV_WS777_PID     0xE0EE  /* Conrad WS 777 */
 #define FTDI_ELV_EM1010PC_PID  0xE0EF  /* Engery monitor EM 1010 PC */
 #define FTDI_ELV_CSI8_PID      0xE0F0  /* Computer-Schalt-Interface (CSI 8) */
 #define FTDI_ELV_EM1000DL_PID  0xE0F1  /* PC-Datenlogger fuer Energiemonitor (EM 1000 DL) */
 #define FTDI_ELV_PCK100_PID    0xE0F2  /* PC-Kabeltester (PCK 100) */
 #define FTDI_ELV_RFP500_PID    0xE0F3  /* HF-Leistungsmesser (RFP 500) */
 #define FTDI_ELV_FS20SIG_PID   0xE0F4  /* Signalgeber (FS 20 SIG) */
+#define FTDI_ELV_UTP8_PID      0xE0F5  /* ELV UTP 8 */
 #define FTDI_ELV_WS300PC_PID   0xE0F6  /* PC-Wetterstation (WS 300 PC) */
+#define FTDI_ELV_WS444PC_PID   0xE0F7  /* Conrad WS 444 PC */
 #define FTDI_PHI_FISCO_PID      0xE40B  /* PHI Fisco USB to Serial cable */
 #define FTDI_ELV_UAD8_PID      0xF068  /* USB-AD-Wandler (UAD 8) */
 #define FTDI_ELV_UDA7_PID      0xF069  /* USB-DA-Wandler (UDA 7) */
 #define PAPOUCH_VID                    0x5050  /* Vendor ID */
 #define PAPOUCH_TMU_PID                        0x0400  /* TMU USB Thermometer */
 #define PAPOUCH_QUIDO4x4_PID           0x0900  /* Quido 4/4 Module */
+#define PAPOUCH_AD4USB_PID             0x8003  /* AD4USB Measurement Module */
 
 /*
  * Marvell SheevaPlug
index ac1b6449fb6abc779f6904cd4899508f466426de..3eb6143bb6468135fe45f64af73b41a1a12f7845 100644 (file)
@@ -298,6 +298,7 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x1199, 0x68A3),   /* Sierra Wireless Direct IP modems */
          .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
        },
+       { USB_DEVICE(0x413C, 0x08133) }, /* Dell Computer Corp. Wireless 5720 VZW Mobile Broadband (EVDO Rev-A) Minicard GPS Port */
 
        { }
 };
index c932f9053188b32857a6b331ad188b3d88b97706..49575fba37560424fa6959f827577089995be580 100644 (file)
@@ -941,7 +941,7 @@ UNUSUAL_DEV(  0x07ab, 0xfccd, 0x0000, 0x9999,
 UNUSUAL_DEV(  0x07af, 0x0004, 0x0100, 0x0133,
                "Microtech",
                "USB-SCSI-DB25",
-               US_SC_SCSI, US_PR_BULK, usb_stor_euscsi_init,
+               US_SC_DEVICE, US_PR_DEVICE, usb_stor_euscsi_init,
                US_FL_SCM_MULT_TARG ), 
 
 UNUSUAL_DEV(  0x07af, 0x0005, 0x0100, 0x0100,
index 9d08096299675548651069e4aa613712b827ba67..6ed434ac037faac00117e5d633478bd7a2e0805b 100644 (file)
@@ -720,13 +720,15 @@ again:
                                        inode->i_ino, orig_offset);
                BUG_ON(ret);
        }
-       fi = btrfs_item_ptr(leaf, path->slots[0],
-                          struct btrfs_file_extent_item);
        if (del_nr == 0) {
+               fi = btrfs_item_ptr(leaf, path->slots[0],
+                          struct btrfs_file_extent_item);
                btrfs_set_file_extent_type(leaf, fi,
                                           BTRFS_FILE_EXTENT_REG);
                btrfs_mark_buffer_dirty(leaf);
        } else {
+               fi = btrfs_item_ptr(leaf, del_slot - 1,
+                          struct btrfs_file_extent_item);
                btrfs_set_file_extent_type(leaf, fi,
                                           BTRFS_FILE_EXTENT_REG);
                btrfs_set_file_extent_num_bytes(leaf, fi,
index e1d415e97849a882052914509abaf59804d47b43..0d289823e8564b49969710e4c16688abbc61b15d 100644 (file)
@@ -342,6 +342,7 @@ static ssize_t nfs_direct_read_schedule_segment(struct nfs_direct_req *dreq,
                data->res.fattr = &data->fattr;
                data->res.eof = 0;
                data->res.count = bytes;
+               nfs_fattr_init(&data->fattr);
                msg.rpc_argp = &data->args;
                msg.rpc_resp = &data->res;
 
@@ -575,6 +576,7 @@ static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq)
        data->res.count = 0;
        data->res.fattr = &data->fattr;
        data->res.verf = &data->verf;
+       nfs_fattr_init(&data->fattr);
 
        NFS_PROTO(data->inode)->commit_setup(data, &msg);
 
@@ -766,6 +768,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_direct_req *dreq,
                data->res.fattr = &data->fattr;
                data->res.count = bytes;
                data->res.verf = &data->verf;
+               nfs_fattr_init(&data->fattr);
 
                task_setup_data.task = &data->task;
                task_setup_data.callback_data = data;
index 9087b10209e634c4f694aceaad2e14bde7e01ba2..2df0f5c7c60bf37b69b7949e239e2d81a57b0ab5 100644 (file)
@@ -1497,9 +1497,11 @@ struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key)
 
        args.objectid = key->on_disk_key.k_objectid;
        args.dirid = key->on_disk_key.k_dir_id;
+       reiserfs_write_unlock(s);
        inode = iget5_locked(s, key->on_disk_key.k_objectid,
                             reiserfs_find_actor, reiserfs_init_locked_inode,
                             (void *)(&args));
+       reiserfs_write_lock(s);
        if (!inode)
                return ERR_PTR(-ENOMEM);
 
index 220b758523aed175e426a9e61a2085430e034364..6a06a1d1ea7b1c31a19997fb04e01aac1afb7137 100644 (file)
@@ -81,24 +81,23 @@ int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr * iattr)
                if (!sd_attrs)
                        return -ENOMEM;
                sd->s_iattr = sd_attrs;
-       } else {
-               /* attributes were changed at least once in past */
-               iattrs = &sd_attrs->ia_iattr;
-
-               if (ia_valid & ATTR_UID)
-                       iattrs->ia_uid = iattr->ia_uid;
-               if (ia_valid & ATTR_GID)
-                       iattrs->ia_gid = iattr->ia_gid;
-               if (ia_valid & ATTR_ATIME)
-                       iattrs->ia_atime = iattr->ia_atime;
-               if (ia_valid & ATTR_MTIME)
-                       iattrs->ia_mtime = iattr->ia_mtime;
-               if (ia_valid & ATTR_CTIME)
-                       iattrs->ia_ctime = iattr->ia_ctime;
-               if (ia_valid & ATTR_MODE) {
-                       umode_t mode = iattr->ia_mode;
-                       iattrs->ia_mode = sd->s_mode = mode;
-               }
+       }
+       /* attributes were changed at least once in past */
+       iattrs = &sd_attrs->ia_iattr;
+
+       if (ia_valid & ATTR_UID)
+               iattrs->ia_uid = iattr->ia_uid;
+       if (ia_valid & ATTR_GID)
+               iattrs->ia_gid = iattr->ia_gid;
+       if (ia_valid & ATTR_ATIME)
+               iattrs->ia_atime = iattr->ia_atime;
+       if (ia_valid & ATTR_MTIME)
+               iattrs->ia_mtime = iattr->ia_mtime;
+       if (ia_valid & ATTR_CTIME)
+               iattrs->ia_ctime = iattr->ia_ctime;
+       if (ia_valid & ATTR_MODE) {
+               umode_t mode = iattr->ia_mode;
+               iattrs->ia_mode = sd->s_mode = mode;
        }
        return 0;
 }
index 070ba0621738d698523914f981eb2be15d092c95..5977b724f7c6884ee19ee6d657f91eaf84f9bde0 100644 (file)
@@ -44,7 +44,7 @@ static inline int hw_breakpoint_type(struct perf_event *bp)
        return bp->attr.bp_type;
 }
 
-static inline int hw_breakpoint_len(struct perf_event *bp)
+static inline unsigned long hw_breakpoint_len(struct perf_event *bp)
 {
        return bp->attr.bp_len;
 }
index 6f6c5f300af6f9bb1485c59960832eca7d8d0983..bc0fc795bd3536c90feb50b0ce4226c6461447e5 100644 (file)
@@ -124,7 +124,7 @@ extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo,
  */
 static inline bool kfifo_initialized(struct kfifo *fifo)
 {
-       return fifo->buffer != 0;
+       return fifo->buffer != NULL;
 }
 
 /**
index 8fa71874113f326106bc79ea699910f75b6c3d9e..a177698d95e26a492fef20aa90c6e43cb7111386 100644 (file)
@@ -211,11 +211,9 @@ struct perf_event_attr {
                __u32           wakeup_watermark; /* bytes before wakeup   */
        };
 
-       __u32                   __reserved_2;
-
-       __u64                   bp_addr;
        __u32                   bp_type;
-       __u32                   bp_len;
+       __u64                   bp_addr;
+       __u64                   bp_len;
 };
 
 /*
index 8a5c7d55ac9fab9bdbd97bb7701d92ed2b3fa310..967e66143e117096262c65fa646a1570e5f035d3 100644 (file)
@@ -360,8 +360,8 @@ EXPORT_SYMBOL_GPL(register_user_hw_breakpoint);
 int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr)
 {
        u64 old_addr = bp->attr.bp_addr;
+       u64 old_len = bp->attr.bp_len;
        int old_type = bp->attr.bp_type;
-       int old_len = bp->attr.bp_len;
        int err = 0;
 
        perf_event_disable(bp);
index 498cabba225e9c90fa37edc1cda2120dbcd27a1f..35edbe22e9a955a1a69cdad290f4861dd76c33e1 100644 (file)
@@ -80,7 +80,7 @@ int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask)
 
        buffer = kmalloc(size, gfp_mask);
        if (!buffer) {
-               _kfifo_init(fifo, 0, 0);
+               _kfifo_init(fifo, NULL, 0);
                return -ENOMEM;
        }
 
@@ -97,6 +97,7 @@ EXPORT_SYMBOL(kfifo_alloc);
 void kfifo_free(struct kfifo *fifo)
 {
        kfree(fifo->buffer);
+       _kfifo_init(fifo, NULL, 0);
 }
 EXPORT_SYMBOL(kfifo_free);
 
index d27746bd3a06097af5635539b690fe272b78cf2c..2b19297742cb5761141e509732c0efdab63a4f9a 100644 (file)
@@ -4580,7 +4580,7 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
        if (attr->type >= PERF_TYPE_MAX)
                return -EINVAL;
 
-       if (attr->__reserved_1 || attr->__reserved_2)
+       if (attr->__reserved_1)
                return -EINVAL;
 
        if (attr->sample_type & ~(PERF_SAMPLE_MAX-1))
index a09502e2ef758721917ab537e345da0036197628..7c1a67ef027431e8f82d341ed7e729b9c0eec044 100644 (file)
@@ -500,22 +500,17 @@ EXPORT_SYMBOL(tasklet_kill);
  */
 
 /*
- * The trampoline is called when the hrtimer expires. If this is
- * called from the hrtimer interrupt then we schedule the tasklet as
- * the timer callback function expects to run in softirq context. If
- * it's called in softirq context anyway (i.e. high resolution timers
- * disabled) then the hrtimer callback is called right away.
+ * The trampoline is called when the hrtimer expires. It schedules a tasklet
+ * to run __tasklet_hrtimer_trampoline() which in turn will call the intended
+ * hrtimer callback, but from softirq context.
  */
 static enum hrtimer_restart __hrtimer_tasklet_trampoline(struct hrtimer *timer)
 {
        struct tasklet_hrtimer *ttimer =
                container_of(timer, struct tasklet_hrtimer, timer);
 
-       if (hrtimer_is_hres_active(timer)) {
-               tasklet_hi_schedule(&ttimer->tasklet);
-               return HRTIMER_NORESTART;
-       }
-       return ttimer->function(timer);
+       tasklet_hi_schedule(&ttimer->tasklet);
+       return HRTIMER_NORESTART;
 }
 
 /*
index 6ea90c0e2c96a89835216314f3b9f792161c49de..50b1b823980637c4bd619ea4f567b5d26324481a 100644 (file)
@@ -689,7 +689,7 @@ static int create_trace_probe(int argc, char **argv)
                        return -EINVAL;
                }
                /* an address specified */
-               ret = strict_strtoul(&argv[0][2], 0, (unsigned long *)&addr);
+               ret = strict_strtoul(&argv[1][0], 0, (unsigned long *)&addr);
                if (ret) {
                        pr_info("Failed to parse address.\n");
                        return ret;
index 678a5120ee301bf1d22d051f710c03ccff60f236..f4bc9b27de5fd13d131dd13b204b1e5432a4283a 100644 (file)
@@ -157,6 +157,7 @@ stack_max_size_write(struct file *filp, const char __user *ubuf,
        unsigned long val, flags;
        char buf[64];
        int ret;
+       int cpu;
 
        if (count >= sizeof(buf))
                return -EINVAL;
@@ -171,9 +172,20 @@ stack_max_size_write(struct file *filp, const char __user *ubuf,
                return ret;
 
        local_irq_save(flags);
+
+       /*
+        * In case we trace inside arch_spin_lock() or after (NMI),
+        * we will cause circular lock, so we also need to increase
+        * the percpu trace_active here.
+        */
+       cpu = smp_processor_id();
+       per_cpu(trace_active, cpu)++;
+
        arch_spin_lock(&max_stack_lock);
        *ptr = val;
        arch_spin_unlock(&max_stack_lock);
+
+       per_cpu(trace_active, cpu)--;
        local_irq_restore(flags);
 
        return count;
@@ -206,7 +218,13 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
 
 static void *t_start(struct seq_file *m, loff_t *pos)
 {
+       int cpu;
+
        local_irq_disable();
+
+       cpu = smp_processor_id();
+       per_cpu(trace_active, cpu)++;
+
        arch_spin_lock(&max_stack_lock);
 
        if (*pos == 0)
@@ -217,7 +235,13 @@ static void *t_start(struct seq_file *m, loff_t *pos)
 
 static void t_stop(struct seq_file *m, void *p)
 {
+       int cpu;
+
        arch_spin_unlock(&max_stack_lock);
+
+       cpu = smp_processor_id();
+       per_cpu(trace_active, cpu)--;
+
        local_irq_enable();
 }
 
index d8aee584e8d1fe17edc534e2aba7c27b080bfa8b..236a9988ea91443ebee44141935239a267c2b027 100644 (file)
@@ -927,6 +927,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
        case ETHTOOL_GPERMADDR:
        case ETHTOOL_GUFO:
        case ETHTOOL_GGSO:
+       case ETHTOOL_GGRO:
        case ETHTOOL_GFLAGS:
        case ETHTOOL_GPFLAGS:
        case ETHTOOL_GRXFH:
index 76c08402c933941ea475045545ff3206cc0cadb8..a42f658e756aef0428cec2602a9295a9f6855a19 100644 (file)
@@ -946,7 +946,6 @@ int igmp_rcv(struct sk_buff *skb)
                break;
        case IGMP_HOST_MEMBERSHIP_REPORT:
        case IGMPV2_HOST_MEMBERSHIP_REPORT:
-       case IGMPV3_HOST_MEMBERSHIP_REPORT:
                /* Is it our report looped back? */
                if (skb_rtable(skb)->fl.iif == 0)
                        break;
@@ -960,6 +959,7 @@ int igmp_rcv(struct sk_buff *skb)
                in_dev_put(in_dev);
                return pim_rcv_v1(skb);
 #endif
+       case IGMPV3_HOST_MEMBERSHIP_REPORT:
        case IGMP_DVMRP:
        case IGMP_TRACE:
        case IGMP_HOST_LEAVE_MESSAGE:
index 38fbf04150ae7ec60ccafa1a4bd740995fb13427..544ce0876f12dcd78cfcf0d777e1b78bab5b4acf 100644 (file)
@@ -124,16 +124,12 @@ static int ipcomp4_init_state(struct xfrm_state *x)
        if (x->props.mode == XFRM_MODE_TUNNEL) {
                err = ipcomp_tunnel_attach(x);
                if (err)
-                       goto error_tunnel;
+                       goto out;
        }
 
        err = 0;
 out:
        return err;
-
-error_tunnel:
-       ipcomp_destroy(x);
-       goto out;
 }
 
 static const struct xfrm_type ipcomp_type = {
index 28e029632493629ca409b02d094c18de56279eaf..3fddc69ccccc5a10032c2b50aff50ebd38a8c137 100644 (file)
@@ -5783,11 +5783,9 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 
                                /* tcp_ack considers this ACK as duplicate
                                 * and does not calculate rtt.
-                                * Fix it at least with timestamps.
+                                * Force it here.
                                 */
-                               if (tp->rx_opt.saw_tstamp &&
-                                   tp->rx_opt.rcv_tsecr && !tp->srtt)
-                                       tcp_ack_saw_tstamp(sk, 0);
+                               tcp_ack_update_rtt(sk, 0, 0);
 
                                if (tp->rx_opt.tstamp_ok)
                                        tp->advmss -= TCPOLEN_TSTAMP_ALIGNED;
index 2f2a5ca2c8786599560f7328d64401f837ab5e38..002e6eef91204ea9f21e49a36660fc0e3952fd81 100644 (file)
@@ -154,16 +154,12 @@ static int ipcomp6_init_state(struct xfrm_state *x)
        if (x->props.mode == XFRM_MODE_TUNNEL) {
                err = ipcomp6_tunnel_attach(x);
                if (err)
-                       goto error_tunnel;
+                       goto out;
        }
 
        err = 0;
 out:
        return err;
-error_tunnel:
-       ipcomp_destroy(x);
-
-       goto out;
 }
 
 static const struct xfrm_type ipcomp6_type =
index 1f2db647bb5ccd3526d8fc40ef3e6aeb3cb68da6..22f0c2aa7a89b393437e8bacc5dd15cf3eee1c6d 100644 (file)
@@ -647,7 +647,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
        }
        if (pos[1] != 0 &&
            (pos[1] != ifibss->ssid_len ||
-            !memcmp(pos + 2, ifibss->ssid, ifibss->ssid_len))) {
+            memcmp(pos + 2, ifibss->ssid, ifibss->ssid_len))) {
                /* Ignore ProbeReq for foreign SSID */
                return;
        }
index b9007f80cb9231bb99bb9a726d3e286ccabfb8ff..12a2bff7dcdbc1959b2cb0792d4f0508f63a2fdc 100644 (file)
@@ -245,6 +245,9 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
                info->control.rates[i].count = 1;
        }
 
+       if (sdata->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)
+               return;
+
        if (sta && sdata->force_unicast_rateidx > -1) {
                info->control.rates[0].idx = sdata->force_unicast_rateidx;
        } else {
index f934c9620b738a393429fba09ece0a80da912106..bc17cf7d68dba0b124304c5d9fced8f271e24edc 100644 (file)
@@ -439,6 +439,16 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
        if (local->scan_req)
                return -EBUSY;
 
+       if (req != local->int_scan_req &&
+           sdata->vif.type == NL80211_IFTYPE_STATION &&
+           !list_empty(&ifmgd->work_list)) {
+               /* actually wait for the work it's doing to finish/time out */
+               set_bit(IEEE80211_STA_REQ_SCAN, &ifmgd->request);
+               local->scan_req = req;
+               local->scan_sdata = sdata;
+               return 0;
+       }
+
        if (local->ops->hw_scan) {
                u8 *ies;
 
@@ -463,14 +473,6 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
        local->scan_req = req;
        local->scan_sdata = sdata;
 
-       if (req != local->int_scan_req &&
-           sdata->vif.type == NL80211_IFTYPE_STATION &&
-           !list_empty(&ifmgd->work_list)) {
-               /* actually wait for the work it's doing to finish/time out */
-               set_bit(IEEE80211_STA_REQ_SCAN, &ifmgd->request);
-               return 0;
-       }
-
        if (local->ops->hw_scan)
                __set_bit(SCAN_HW_SCANNING, &local->scanning);
        else
index b36cc344474b33a76d6d257d4a8f6474ef3ba204..f445ea1c5f52b46392a2860c4381d626da893ff3 100644 (file)
@@ -1102,7 +1102,7 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
        int err = -ENOMEM;
        struct xfrm_state *x = xfrm_state_alloc(net);
        if (!x)
-               goto error;
+               goto out;
 
        memcpy(&x->id, &orig->id, sizeof(x->id));
        memcpy(&x->sel, &orig->sel, sizeof(x->sel));
@@ -1160,16 +1160,10 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
        return x;
 
  error:
+       xfrm_state_put(x);
+out:
        if (errp)
                *errp = err;
-       if (x) {
-               kfree(x->aalg);
-               kfree(x->ealg);
-               kfree(x->calg);
-               kfree(x->encap);
-               kfree(x->coaddr);
-       }
-       kfree(x);
        return NULL;
 }
 
index 3600e9cc9bc604ce61a1b11871424a40c7b5c5a3..ff6da6f386d14c7ecdd0975723552680d5080b46 100644 (file)
@@ -2350,7 +2350,7 @@ static void __devinit check_probe_mask(struct azx *chip, int dev)
  */
 static struct snd_pci_quirk msi_black_list[] __devinitdata = {
        SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */
-       SND_PCI_QUIRK(0x1043, 0x829c, "ASUS", 0), /* nvidia */
+       SND_PCI_QUIRK(0x1043, 0x81f6, "ASUS", 0), /* nvidia */
        {}
 };
 
index ddc584b64871019f0eb08dcd447ff511ce639983..4b91d8cf00eca94953d4a91746a1bdba679f6fe7 100644 (file)
@@ -705,7 +705,7 @@ static void print_mapped_keys(void)
                fprintf(stdout, "\t[w]     toggle display weighted/count[E]r. \t(%d)\n", display_weighted ? 1 : 0);
 
        fprintf(stdout,
-               "\t[K]     hide kernel_symbols symbols.             \t(%s)\n",
+               "\t[K]     hide kernel_symbols symbols.     \t(%s)\n",
                hide_kernel_symbols ? "yes" : "no");
        fprintf(stdout,
                "\t[U]     hide user symbols.               \t(%s)\n",
index bb0fd6da2d56f3850885d1d51df089dccc15d1d6..8a9e6baa3099db1ffb8e8a22ad57e7b1fb194a9e 100644 (file)
@@ -295,10 +295,10 @@ void thread__find_addr_location(struct thread *self,
        al->thread = self;
        al->addr = addr;
 
-       if (cpumode & PERF_RECORD_MISC_KERNEL) {
+       if (cpumode == PERF_RECORD_MISC_KERNEL) {
                al->level = 'k';
                mg = &session->kmaps;
-       } else if (cpumode & PERF_RECORD_MISC_USER)
+       } else if (cpumode == PERF_RECORD_MISC_USER)
                al->level = '.';
        else {
                al->level = 'H';