Merge 4.4.100 into android-4.4
authorGreg Kroah-Hartman <gregkh@google.com>
Tue, 21 Nov 2017 09:26:59 +0000 (10:26 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 21 Nov 2017 09:26:59 +0000 (10:26 +0100)
Changes in 4.4.100
media: imon: Fix null-ptr-deref in imon_probe
media: dib0700: fix invalid dvb_detach argument
ext4: fix data exposure after a crash
KVM: x86: fix singlestepping over syscall
bpf: don't let ldimm64 leak map addresses on unprivileged
xen-blkback: don't leak stack data via response ring
sctp: do not peel off an assoc from one netns to another one
net: cdc_ether: fix divide by 0 on bad descriptors
net: qmi_wwan: fix divide by 0 on bad descriptors
arm: crypto: reduce priority of bit-sliced AES cipher
Bluetooth: btusb: fix QCA Rome suspend/resume
dmaengine: dmatest: warn user when dma test times out
extcon: palmas: Check the parent instance to prevent the NULL
fm10k: request reset when mbx->state changes
ARM: dts: Fix compatible for ti81xx uarts for 8250
ARM: dts: Fix am335x and dm814x scm syscon to probe children
ARM: OMAP2+: Fix init for multiple quirks for the same SoC
ARM: dts: Fix omap3 off mode pull defines
ata: ATA_BMDMA should depend on HAS_DMA
ata: SATA_HIGHBANK should depend on HAS_DMA
ata: SATA_MV should depend on HAS_DMA
drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache
igb: reset the PHY before reading the PHY ID
igb: close/suspend race in netif_device_detach
igb: Fix hw_dbg logging in igb_update_flash_i210
scsi: ufs-qcom: Fix module autoload
scsi: ufs: add capability to keep auto bkops always enabled
staging: rtl8188eu: fix incorrect ERROR tags from logs
scsi: lpfc: Add missing memory barrier
scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort
scsi: lpfc: Correct host name in symbolic_name field
scsi: lpfc: Correct issue leading to oops during link reset
scsi: lpfc: Clear the VendorVersion in the PLOGI/PLOGI ACC payload
ALSA: vx: Don't try to update capture stream before running
ALSA: vx: Fix possible transfer overflow
backlight: lcd: Fix race condition during register
backlight: adp5520: Fix error handling in adp5520_bl_probe()
gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap
ALSA: hda/realtek - Add new codec ID ALC299
arm64: dts: NS2: reserve memory for Nitro firmware
ixgbe: fix AER error handling
ixgbe: handle close/suspend race with netif_device_detach/present
ixgbe: Reduce I2C retry count on X550 devices
ixgbe: add mask for 64 RSS queues
ixgbe: do not disable FEC from the driver
staging: rtl8712: fixed little endian problem
MIPS: End asm function prologue macros with .insn
mm: add PHYS_PFN, use it in __phys_to_pfn()
MIPS: init: Ensure bootmem does not corrupt reserved memory
MIPS: init: Ensure reserved memory regions are not added to bootmem
MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds
Revert "crypto: xts - Add ECB dependency"
Revert "uapi: fix linux/rds.h userspace compilation errors"
uapi: fix linux/rds.h userspace compilation error
uapi: fix linux/rds.h userspace compilation errors
USB: usbfs: compute urb->actual_length for isochronous
USB: Add delay-init quirk for Corsair K70 LUX keyboards
USB: serial: qcserial: add pid/vid for Sierra Wireless EM7355 fw update
USB: serial: garmin_gps: fix I/O after failed probe and remove
USB: serial: garmin_gps: fix memory leak on probe errors
Linux 4.4.100

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
58 files changed:
Makefile
arch/arm/boot/dts/am33xx.dtsi
arch/arm/boot/dts/dm814x.dtsi
arch/arm/boot/dts/dm816x.dtsi
arch/arm/crypto/aesbs-glue.c
arch/arm/mach-omap2/pdata-quirks.c
arch/arm64/boot/dts/broadcom/ns2.dtsi
arch/mips/include/asm/asm.h
arch/mips/kernel/setup.c
arch/mips/netlogic/common/irq.c
arch/x86/include/asm/kvm_emulate.h
arch/x86/kvm/emulate.c
arch/x86/kvm/x86.c
crypto/Kconfig
drivers/ata/Kconfig
drivers/block/xen-blkback/blkback.c
drivers/block/xen-blkback/common.h
drivers/bluetooth/btusb.c
drivers/dma/dmatest.c
drivers/extcon/extcon-palmas.c
drivers/gpu/drm/mgag200/mgag200_main.c
drivers/gpu/drm/sti/sti_vtg.c
drivers/media/rc/imon.c
drivers/media/usb/dvb-usb/dib0700_devices.c
drivers/net/ethernet/intel/fm10k/fm10k_mbx.c
drivers/net/ethernet/intel/fm10k/fm10k_pci.c
drivers/net/ethernet/intel/igb/e1000_82575.c
drivers/net/ethernet/intel/igb/e1000_i210.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
drivers/net/usb/cdc_ether.c
drivers/net/usb/qmi_wwan.c
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hw.h
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_vport.c
drivers/scsi/ufs/ufs-qcom.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h
drivers/staging/rtl8188eu/include/rtw_debug.h
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
drivers/usb/core/devio.c
drivers/usb/core/quirks.c
drivers/usb/serial/garmin_gps.c
drivers/usb/serial/qcserial.c
drivers/video/backlight/adp5520_bl.c
drivers/video/backlight/lcd.c
include/dt-bindings/pinctrl/omap.h
include/uapi/linux/rds.h
net/sctp/socket.c
sound/drivers/vx/vx_pcm.c
sound/pci/hda/patch_realtek.c
sound/pci/vx222/vx222_ops.c
sound/pcmcia/vx/vxp_ops.c

index 15cecc83c02c7d1b70e2d7d3c953830c2e460aa8..7c1eaabacb34d103ca5c0aaf475efe8ebc0e6908 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 4
-SUBLEVEL = 99
+SUBLEVEL = 100
 EXTRAVERSION =
 NAME = Blurry Fish Butt
 
index d23e2524d694e95512a0ab967c6ef4fd9c1b8314..be9c37e89be1ab7483f7ae364055f856c1c4d624 100644 (file)
                                };
 
                                scm_conf: scm_conf@0 {
-                                       compatible = "syscon";
+                                       compatible = "syscon", "simple-bus";
                                        reg = <0x0 0x800>;
                                        #address-cells = <1>;
                                        #size-cells = <1>;
+                                       ranges = <0 0 0x800>;
 
                                        scm_clocks: clocks {
                                                #address-cells = <1>;
index 7988b42e57640584df8f8c459f6ff6652e325ed6..c226c3d952d8fe07aaf019950aafc4ed49e30ec5 100644 (file)
                        };
 
                        uart1: uart@20000 {
-                               compatible = "ti,omap3-uart";
+                               compatible = "ti,am3352-uart", "ti,omap3-uart";
                                ti,hwmods = "uart1";
                                reg = <0x20000 0x2000>;
                                clock-frequency = <48000000>;
                        };
 
                        uart2: uart@22000 {
-                               compatible = "ti,omap3-uart";
+                               compatible = "ti,am3352-uart", "ti,omap3-uart";
                                ti,hwmods = "uart2";
                                reg = <0x22000 0x2000>;
                                clock-frequency = <48000000>;
                        };
 
                        uart3: uart@24000 {
-                               compatible = "ti,omap3-uart";
+                               compatible = "ti,am3352-uart", "ti,omap3-uart";
                                ti,hwmods = "uart3";
                                reg = <0x24000 0x2000>;
                                clock-frequency = <48000000>;
                                ranges = <0 0x160000 0x16d000>;
 
                                scm_conf: scm_conf@0 {
-                                       compatible = "syscon";
+                                       compatible = "syscon", "simple-bus";
                                        reg = <0x0 0x800>;
                                        #address-cells = <1>;
                                        #size-cells = <1>;
+                                       ranges = <0 0 0x800>;
 
                                        scm_clocks: clocks {
                                                #address-cells = <1>;
index eee636de4cd844237f5490b71c5f00d56dd9f06c..e526928e6e960e43e5c5e73909a1963198d70de2 100644 (file)
                };
 
                uart1: uart@48020000 {
-                       compatible = "ti,omap3-uart";
+                       compatible = "ti,am3352-uart", "ti,omap3-uart";
                        ti,hwmods = "uart1";
                        reg = <0x48020000 0x2000>;
                        clock-frequency = <48000000>;
                };
 
                uart2: uart@48022000 {
-                       compatible = "ti,omap3-uart";
+                       compatible = "ti,am3352-uart", "ti,omap3-uart";
                        ti,hwmods = "uart2";
                        reg = <0x48022000 0x2000>;
                        clock-frequency = <48000000>;
                };
 
                uart3: uart@48024000 {
-                       compatible = "ti,omap3-uart";
+                       compatible = "ti,am3352-uart", "ti,omap3-uart";
                        ti,hwmods = "uart3";
                        reg = <0x48024000 0x2000>;
                        clock-frequency = <48000000>;
index 6d685298690ed228b416c7cf67c58e8b6d6f2909..648d5fac9cbf62201a38ef53703997317dfd6958 100644 (file)
@@ -357,7 +357,7 @@ static struct crypto_alg aesbs_algs[] = { {
 }, {
        .cra_name               = "cbc(aes)",
        .cra_driver_name        = "cbc-aes-neonbs",
-       .cra_priority           = 300,
+       .cra_priority           = 250,
        .cra_flags              = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
        .cra_blocksize          = AES_BLOCK_SIZE,
        .cra_ctxsize            = sizeof(struct async_helper_ctx),
@@ -377,7 +377,7 @@ static struct crypto_alg aesbs_algs[] = { {
 }, {
        .cra_name               = "ctr(aes)",
        .cra_driver_name        = "ctr-aes-neonbs",
-       .cra_priority           = 300,
+       .cra_priority           = 250,
        .cra_flags              = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
        .cra_blocksize          = 1,
        .cra_ctxsize            = sizeof(struct async_helper_ctx),
@@ -397,7 +397,7 @@ static struct crypto_alg aesbs_algs[] = { {
 }, {
        .cra_name               = "xts(aes)",
        .cra_driver_name        = "xts-aes-neonbs",
-       .cra_priority           = 300,
+       .cra_priority           = 250,
        .cra_flags              = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
        .cra_blocksize          = AES_BLOCK_SIZE,
        .cra_ctxsize            = sizeof(struct async_helper_ctx),
index 58144779dec4c118aac35f60cab6f0c33a68929a..1e6e098417078ad2f6a610812a9220c503a0f91b 100644 (file)
@@ -522,7 +522,6 @@ static void pdata_quirks_check(struct pdata_init *quirks)
                if (of_machine_is_compatible(quirks->compatible)) {
                        if (quirks->fn)
                                quirks->fn();
-                       break;
                }
                quirks++;
        }
index 3c92d92278e5795df4cf7654186959248fc35872..a14a6bb31887fe2a99032621e42d9f72192e8764 100644 (file)
@@ -30,6 +30,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/memreserve/ 0x81000000 0x00200000;
+
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 
 /memreserve/ 0x84b00000 0x00000008;
index 7c26b28bf2526856f7a96e1a2c39c61b78bf4e59..859cf7048347bf4b0ebad1f619507202976f74b3 100644 (file)
@@ -54,7 +54,8 @@
                .align  2;                              \
                .type   symbol, @function;              \
                .ent    symbol, 0;                      \
-symbol:                .frame  sp, 0, ra
+symbol:                .frame  sp, 0, ra;                      \
+               .insn
 
 /*
  * NESTED - declare nested routine entry point
@@ -63,8 +64,9 @@ symbol:               .frame  sp, 0, ra
                .globl  symbol;                         \
                .align  2;                              \
                .type   symbol, @function;              \
-               .ent    symbol, 0;                       \
-symbol:                .frame  sp, framesize, rpc
+               .ent    symbol, 0;                      \
+symbol:                .frame  sp, framesize, rpc;             \
+               .insn
 
 /*
  * END - mark end of function
@@ -86,7 +88,7 @@ symbol:
 #define FEXPORT(symbol)                                        \
                .globl  symbol;                         \
                .type   symbol, @function;              \
-symbol:
+symbol:                .insn
 
 /*
  * ABS - export absolute symbol
index 8acae316f26bdf3d3f7389a1bfbf6d333f2c5e41..4f9f1ae4921383f1bd0d230fb2bb54bed1e4462f 100644 (file)
@@ -152,6 +152,35 @@ void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_add
        add_memory_region(start, size, BOOT_MEM_RAM);
 }
 
+bool __init memory_region_available(phys_addr_t start, phys_addr_t size)
+{
+       int i;
+       bool in_ram = false, free = true;
+
+       for (i = 0; i < boot_mem_map.nr_map; i++) {
+               phys_addr_t start_, end_;
+
+               start_ = boot_mem_map.map[i].addr;
+               end_ = boot_mem_map.map[i].addr + boot_mem_map.map[i].size;
+
+               switch (boot_mem_map.map[i].type) {
+               case BOOT_MEM_RAM:
+                       if (start >= start_ && start + size <= end_)
+                               in_ram = true;
+                       break;
+               case BOOT_MEM_RESERVED:
+                       if ((start >= start_ && start < end_) ||
+                           (start < start_ && start + size >= start_))
+                               free = false;
+                       break;
+               default:
+                       continue;
+               }
+       }
+
+       return in_ram && free;
+}
+
 static void __init print_memory_map(void)
 {
        int i;
@@ -300,11 +329,19 @@ static void __init bootmem_init(void)
 
 #else  /* !CONFIG_SGI_IP27 */
 
+static unsigned long __init bootmap_bytes(unsigned long pages)
+{
+       unsigned long bytes = DIV_ROUND_UP(pages, 8);
+
+       return ALIGN(bytes, sizeof(long));
+}
+
 static void __init bootmem_init(void)
 {
        unsigned long reserved_end;
        unsigned long mapstart = ~0UL;
        unsigned long bootmap_size;
+       bool bootmap_valid = false;
        int i;
 
        /*
@@ -385,11 +422,42 @@ static void __init bootmem_init(void)
 #endif
 
        /*
-        * Initialize the boot-time allocator with low memory only.
+        * check that mapstart doesn't overlap with any of
+        * memory regions that have been reserved through eg. DTB
         */
-       bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart,
-                                        min_low_pfn, max_low_pfn);
+       bootmap_size = bootmap_bytes(max_low_pfn - min_low_pfn);
+
+       bootmap_valid = memory_region_available(PFN_PHYS(mapstart),
+                                               bootmap_size);
+       for (i = 0; i < boot_mem_map.nr_map && !bootmap_valid; i++) {
+               unsigned long mapstart_addr;
+
+               switch (boot_mem_map.map[i].type) {
+               case BOOT_MEM_RESERVED:
+                       mapstart_addr = PFN_ALIGN(boot_mem_map.map[i].addr +
+                                               boot_mem_map.map[i].size);
+                       if (PHYS_PFN(mapstart_addr) < mapstart)
+                               break;
+
+                       bootmap_valid = memory_region_available(mapstart_addr,
+                                                               bootmap_size);
+                       if (bootmap_valid)
+                               mapstart = PHYS_PFN(mapstart_addr);
+                       break;
+               default:
+                       break;
+               }
+       }
 
+       if (!bootmap_valid)
+               panic("No memory area to place a bootmap bitmap");
+
+       /*
+        * Initialize the boot-time allocator with low memory only.
+        */
+       if (bootmap_size != init_bootmem_node(NODE_DATA(0), mapstart,
+                                        min_low_pfn, max_low_pfn))
+               panic("Unexpected memory size required for bootmap");
 
        for (i = 0; i < boot_mem_map.nr_map; i++) {
                unsigned long start, end;
@@ -438,6 +506,10 @@ static void __init bootmem_init(void)
                        continue;
                default:
                        /* Not usable memory */
+                       if (start > min_low_pfn && end < max_low_pfn)
+                               reserve_bootmem(boot_mem_map.map[i].addr,
+                                               boot_mem_map.map[i].size,
+                                               BOOTMEM_DEFAULT);
                        continue;
                }
 
index 3660dc67d544fbd44c4ff7188fbc0d000fcabf4e..f4961bc9a61d54baad92908ec1660ba534d471a0 100644 (file)
@@ -275,7 +275,7 @@ asmlinkage void plat_irq_dispatch(void)
        do_IRQ(nlm_irq_to_xirq(node, i));
 }
 
-#ifdef CONFIG_OF
+#ifdef CONFIG_CPU_XLP
 static const struct irq_domain_ops xlp_pic_irq_domain_ops = {
        .xlate = irq_domain_xlate_onetwocell,
 };
@@ -348,7 +348,7 @@ void __init arch_init_irq(void)
 #if defined(CONFIG_CPU_XLR)
        nlm_setup_fmn_irq();
 #endif
-#if defined(CONFIG_OF)
+#ifdef CONFIG_CPU_XLP
        of_irq_init(xlp_pic_irq_ids);
 #endif
 }
index 19d14ac23ef961a0fe7bf8fcdfe953773ab724dc..fc3c7e49c8e48982552c551a74925dda6cd6eebd 100644 (file)
@@ -296,6 +296,7 @@ struct x86_emulate_ctxt {
 
        bool perm_ok; /* do not check permissions if true */
        bool ud;        /* inject an #UD if host doesn't support insn */
+       bool tf;        /* TF value before instruction (after for syscall/sysret) */
 
        bool have_exception;
        struct x86_exception exception;
index 04b2f3cad7ba16825de562f4181dc7be81f962e3..684edebb4a0c66263e4204be0cbe890465d3de88 100644 (file)
@@ -2726,6 +2726,7 @@ static int em_syscall(struct x86_emulate_ctxt *ctxt)
                ctxt->eflags &= ~(X86_EFLAGS_VM | X86_EFLAGS_IF);
        }
 
+       ctxt->tf = (ctxt->eflags & X86_EFLAGS_TF) != 0;
        return X86EMUL_CONTINUE;
 }
 
index 8e526c6fd784f72c2731d528b1c7cae9c2aca1e9..3ffd5900da5b2372a3bd8d9d8296a407b0db302c 100644 (file)
@@ -5095,6 +5095,8 @@ static void init_emulate_ctxt(struct kvm_vcpu *vcpu)
        kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
 
        ctxt->eflags = kvm_get_rflags(vcpu);
+       ctxt->tf = (ctxt->eflags & X86_EFLAGS_TF) != 0;
+
        ctxt->eip = kvm_rip_read(vcpu);
        ctxt->mode = (!is_protmode(vcpu))               ? X86EMUL_MODE_REAL :
                     (ctxt->eflags & X86_EFLAGS_VM)     ? X86EMUL_MODE_VM86 :
@@ -5315,37 +5317,26 @@ static int kvm_vcpu_check_hw_bp(unsigned long addr, u32 type, u32 dr7,
        return dr6;
 }
 
-static void kvm_vcpu_check_singlestep(struct kvm_vcpu *vcpu, unsigned long rflags, int *r)
+static void kvm_vcpu_do_singlestep(struct kvm_vcpu *vcpu, int *r)
 {
        struct kvm_run *kvm_run = vcpu->run;
 
-       /*
-        * rflags is the old, "raw" value of the flags.  The new value has
-        * not been saved yet.
-        *
-        * This is correct even for TF set by the guest, because "the
-        * processor will not generate this exception after the instruction
-        * that sets the TF flag".
-        */
-       if (unlikely(rflags & X86_EFLAGS_TF)) {
-               if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) {
-                       kvm_run->debug.arch.dr6 = DR6_BS | DR6_FIXED_1 |
-                                                 DR6_RTM;
-                       kvm_run->debug.arch.pc = vcpu->arch.singlestep_rip;
-                       kvm_run->debug.arch.exception = DB_VECTOR;
-                       kvm_run->exit_reason = KVM_EXIT_DEBUG;
-                       *r = EMULATE_USER_EXIT;
-               } else {
-                       vcpu->arch.emulate_ctxt.eflags &= ~X86_EFLAGS_TF;
-                       /*
-                        * "Certain debug exceptions may clear bit 0-3.  The
-                        * remaining contents of the DR6 register are never
-                        * cleared by the processor".
-                        */
-                       vcpu->arch.dr6 &= ~15;
-                       vcpu->arch.dr6 |= DR6_BS | DR6_RTM;
-                       kvm_queue_exception(vcpu, DB_VECTOR);
-               }
+       if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) {
+               kvm_run->debug.arch.dr6 = DR6_BS | DR6_FIXED_1 | DR6_RTM;
+               kvm_run->debug.arch.pc = vcpu->arch.singlestep_rip;
+               kvm_run->debug.arch.exception = DB_VECTOR;
+               kvm_run->exit_reason = KVM_EXIT_DEBUG;
+               *r = EMULATE_USER_EXIT;
+       } else {
+               vcpu->arch.emulate_ctxt.eflags &= ~X86_EFLAGS_TF;
+               /*
+                * "Certain debug exceptions may clear bit 0-3.  The
+                * remaining contents of the DR6 register are never
+                * cleared by the processor".
+                */
+               vcpu->arch.dr6 &= ~15;
+               vcpu->arch.dr6 |= DR6_BS | DR6_RTM;
+               kvm_queue_exception(vcpu, DB_VECTOR);
        }
 }
 
@@ -5500,8 +5491,9 @@ restart:
                toggle_interruptibility(vcpu, ctxt->interruptibility);
                vcpu->arch.emulate_regs_need_sync_to_vcpu = false;
                kvm_rip_write(vcpu, ctxt->eip);
-               if (r == EMULATE_DONE)
-                       kvm_vcpu_check_singlestep(vcpu, rflags, &r);
+               if (r == EMULATE_DONE &&
+                   (ctxt->tf || (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)))
+                       kvm_vcpu_do_singlestep(vcpu, &r);
                if (!ctxt->have_exception ||
                    exception_type(ctxt->exception.vector) == EXCPT_TRAP)
                        __kvm_set_rflags(vcpu, ctxt->eflags);
index 248d1a8f9409369052fcdb636a05918ebd4e7ff4..3240d394426c046b27b233562a62d3628d7c6866 100644 (file)
@@ -361,7 +361,6 @@ config CRYPTO_XTS
        select CRYPTO_BLKCIPHER
        select CRYPTO_MANAGER
        select CRYPTO_GF128MUL
-       select CRYPTO_ECB
        help
          XTS: IEEE1619/D16 narrow block cipher use with aes-xts-plain,
          key size 256, 384 or 512 bits. This implementation currently
index 6aaa3f81755be2e4917decb14c8f52348efeb0d0..c2ba811993d4e892d0da8e8837fd75d1103d4799 100644 (file)
@@ -272,6 +272,7 @@ config SATA_SX4
 
 config ATA_BMDMA
        bool "ATA BMDMA support"
+       depends on HAS_DMA
        default y
        help
          This option adds support for SFF ATA controllers with BMDMA
@@ -318,6 +319,7 @@ config SATA_DWC_VDEBUG
 
 config SATA_HIGHBANK
        tristate "Calxeda Highbank SATA support"
+       depends on HAS_DMA
        depends on ARCH_HIGHBANK || COMPILE_TEST
        help
          This option enables support for the Calxeda Highbank SoC's
@@ -327,6 +329,7 @@ config SATA_HIGHBANK
 
 config SATA_MV
        tristate "Marvell SATA support"
+       depends on HAS_DMA
        depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \
                   ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST
        select GENERIC_PHY
index 33e23a7a691f8d0ee328181286371b0f7ca20277..a295ad6a1674fb05d6f9178542629cf9d41d9f86 100644 (file)
@@ -1407,33 +1407,34 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
 static void make_response(struct xen_blkif *blkif, u64 id,
                          unsigned short op, int st)
 {
-       struct blkif_response  resp;
+       struct blkif_response *resp;
        unsigned long     flags;
        union blkif_back_rings *blk_rings = &blkif->blk_rings;
        int notify;
 
-       resp.id        = id;
-       resp.operation = op;
-       resp.status    = st;
-
        spin_lock_irqsave(&blkif->blk_ring_lock, flags);
        /* Place on the response ring for the relevant domain. */
        switch (blkif->blk_protocol) {
        case BLKIF_PROTOCOL_NATIVE:
-               memcpy(RING_GET_RESPONSE(&blk_rings->native, blk_rings->native.rsp_prod_pvt),
-                      &resp, sizeof(resp));
+               resp = RING_GET_RESPONSE(&blk_rings->native,
+                                        blk_rings->native.rsp_prod_pvt);
                break;
        case BLKIF_PROTOCOL_X86_32:
-               memcpy(RING_GET_RESPONSE(&blk_rings->x86_32, blk_rings->x86_32.rsp_prod_pvt),
-                      &resp, sizeof(resp));
+               resp = RING_GET_RESPONSE(&blk_rings->x86_32,
+                                        blk_rings->x86_32.rsp_prod_pvt);
                break;
        case BLKIF_PROTOCOL_X86_64:
-               memcpy(RING_GET_RESPONSE(&blk_rings->x86_64, blk_rings->x86_64.rsp_prod_pvt),
-                      &resp, sizeof(resp));
+               resp = RING_GET_RESPONSE(&blk_rings->x86_64,
+                                        blk_rings->x86_64.rsp_prod_pvt);
                break;
        default:
                BUG();
        }
+
+       resp->id        = id;
+       resp->operation = op;
+       resp->status    = st;
+
        blk_rings->common.rsp_prod_pvt++;
        RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blk_rings->common, notify);
        spin_unlock_irqrestore(&blkif->blk_ring_lock, flags);
index c929ae22764c9dd4345195a1542df997c5a8e29b..04cfee719334ef883c7f46b25bcb2adf5b64a6a3 100644 (file)
@@ -74,9 +74,8 @@ extern unsigned int xen_blkif_max_ring_order;
 struct blkif_common_request {
        char dummy;
 };
-struct blkif_common_response {
-       char dummy;
-};
+
+/* i386 protocol version */
 
 struct blkif_x86_32_request_rw {
        uint8_t        nr_segments;  /* number of segments                   */
@@ -128,14 +127,6 @@ struct blkif_x86_32_request {
        } u;
 } __attribute__((__packed__));
 
-/* i386 protocol version */
-#pragma pack(push, 4)
-struct blkif_x86_32_response {
-       uint64_t        id;              /* copied from request */
-       uint8_t         operation;       /* copied from request */
-       int16_t         status;          /* BLKIF_RSP_???       */
-};
-#pragma pack(pop)
 /* x86_64 protocol version */
 
 struct blkif_x86_64_request_rw {
@@ -192,18 +183,12 @@ struct blkif_x86_64_request {
        } u;
 } __attribute__((__packed__));
 
-struct blkif_x86_64_response {
-       uint64_t       __attribute__((__aligned__(8))) id;
-       uint8_t         operation;       /* copied from request */
-       int16_t         status;          /* BLKIF_RSP_???       */
-};
-
 DEFINE_RING_TYPES(blkif_common, struct blkif_common_request,
-                 struct blkif_common_response);
+                 struct blkif_response);
 DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request,
-                 struct blkif_x86_32_response);
+                 struct blkif_response __packed);
 DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request,
-                 struct blkif_x86_64_response);
+                 struct blkif_response);
 
 union blkif_back_rings {
        struct blkif_back_ring        native;
index 7bb8055bd10c095681ff6b202e8eb69373d9e48b..1ccad79ce77c1733746f9e6241050b97dbc717c9 100644 (file)
@@ -2969,6 +2969,12 @@ static int btusb_probe(struct usb_interface *intf,
        if (id->driver_info & BTUSB_QCA_ROME) {
                data->setup_on_usb = btusb_setup_qca;
                hdev->set_bdaddr = btusb_set_bdaddr_ath3012;
+
+               /* QCA Rome devices lose their updated firmware over suspend,
+                * but the USB hub doesn't notice any status change.
+                * Explicitly request a device reset on resume.
+                */
+               set_bit(BTUSB_RESET_RESUME, &data->flags);
        }
 
 #ifdef CONFIG_BT_HCIBTUSB_RTL
index b8576fd6bd0e544730bfc07a19ce92b21ab1aba6..1c7568c0055a1da7c203eb7c7ec7e917f10b8bc1 100644 (file)
@@ -634,6 +634,7 @@ static int dmatest_func(void *data)
                         * free it this time?" dancing.  For now, just
                         * leave it dangling.
                         */
+                       WARN(1, "dmatest: Kernel stack may be corrupted!!\n");
                        dmaengine_unmap_put(um);
                        result("test timed out", total_tests, src_off, dst_off,
                               len, 0);
index 93c30a885740e9bebb08c8f80162118c7e3f2359..aa2f6bb82b32442212ba178a1c5aa783c2fd224f 100644 (file)
@@ -190,6 +190,11 @@ static int palmas_usb_probe(struct platform_device *pdev)
        struct palmas_usb *palmas_usb;
        int status;
 
+       if (!palmas) {
+               dev_err(&pdev->dev, "failed to get valid parent\n");
+               return -EINVAL;
+       }
+
        palmas_usb = devm_kzalloc(&pdev->dev, sizeof(*palmas_usb), GFP_KERNEL);
        if (!palmas_usb)
                return -ENOMEM;
index b1a0f565617510d5797349004f1ee3dd63063042..44df959cbadb44ddf3859b13303971fdb2c3bf49 100644 (file)
@@ -145,6 +145,8 @@ static int mga_vram_init(struct mga_device *mdev)
        }
 
        mem = pci_iomap(mdev->dev->pdev, 0, 0);
+       if (!mem)
+               return -ENOMEM;
 
        mdev->mc.vram_size = mga_probe_vram(mdev, mem);
 
index d56630c60039fead79ca37f1ed52b7614f9e8aee..117a2f52fb4eadbc1bc4715d7e0a4a728dbb4f18 100644 (file)
@@ -346,6 +346,10 @@ static int vtg_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
        vtg->regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
+       if (!vtg->regs) {
+               DRM_ERROR("failed to remap I/O memory\n");
+               return -ENOMEM;
+       }
 
        np = of_parse_phandle(pdev->dev.of_node, "st,slave", 0);
        if (np) {
index eb9e7feb9b131bb84d751f10a3a11ff3538030b7..7a16e9ea041c5e020f68facf8e421416c69c119f 100644 (file)
@@ -2419,6 +2419,11 @@ static int imon_probe(struct usb_interface *interface,
        mutex_lock(&driver_lock);
 
        first_if = usb_ifnum_to_if(usbdev, 0);
+       if (!first_if) {
+               ret = -ENODEV;
+               goto fail;
+       }
+
        first_if_ctx = usb_get_intfdata(first_if);
 
        if (ifnum == 0) {
index 7ed49646a699dd750fe7eded35632de7fd7cf4a4..7df0707a0455d348f036688159afe90ce4e43fb9 100644 (file)
@@ -292,7 +292,7 @@ static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap)
                                             stk7700d_dib7000p_mt2266_config)
                    != 0) {
                        err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n", __func__);
-                       dvb_detach(&state->dib7000p_ops);
+                       dvb_detach(state->dib7000p_ops.set_wbd_ref);
                        return -ENODEV;
                }
        }
@@ -326,7 +326,7 @@ static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap)
                                             stk7700d_dib7000p_mt2266_config)
                    != 0) {
                        err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n", __func__);
-                       dvb_detach(&state->dib7000p_ops);
+                       dvb_detach(state->dib7000p_ops.set_wbd_ref);
                        return -ENODEV;
                }
        }
@@ -479,7 +479,7 @@ static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap)
                                     &stk7700ph_dib7700_xc3028_config) != 0) {
                err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n",
                    __func__);
-               dvb_detach(&state->dib7000p_ops);
+               dvb_detach(state->dib7000p_ops.set_wbd_ref);
                return -ENODEV;
        }
 
@@ -1010,7 +1010,7 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
                                     &dib7070p_dib7000p_config) != 0) {
                err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n",
                    __func__);
-               dvb_detach(&state->dib7000p_ops);
+               dvb_detach(state->dib7000p_ops.set_wbd_ref);
                return -ENODEV;
        }
 
@@ -1068,7 +1068,7 @@ static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap)
                                     &dib7770p_dib7000p_config) != 0) {
                err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n",
                    __func__);
-               dvb_detach(&state->dib7000p_ops);
+               dvb_detach(state->dib7000p_ops.set_wbd_ref);
                return -ENODEV;
        }
 
@@ -3036,7 +3036,7 @@ static int nim7090_frontend_attach(struct dvb_usb_adapter *adap)
 
        if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, &nim7090_dib7000p_config) != 0) {
                err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n", __func__);
-               dvb_detach(&state->dib7000p_ops);
+               dvb_detach(state->dib7000p_ops.set_wbd_ref);
                return -ENODEV;
        }
        adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, &nim7090_dib7000p_config);
@@ -3089,7 +3089,7 @@ static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter *adap)
        /* initialize IC 0 */
        if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x20, &tfe7090pvr_dib7000p_config[0]) != 0) {
                err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n", __func__);
-               dvb_detach(&state->dib7000p_ops);
+               dvb_detach(state->dib7000p_ops.set_wbd_ref);
                return -ENODEV;
        }
 
@@ -3119,7 +3119,7 @@ static int tfe7090pvr_frontend1_attach(struct dvb_usb_adapter *adap)
        i2c = state->dib7000p_ops.get_i2c_master(adap->dev->adapter[0].fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_6_7, 1);
        if (state->dib7000p_ops.i2c_enumeration(i2c, 1, 0x10, &tfe7090pvr_dib7000p_config[1]) != 0) {
                err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n", __func__);
-               dvb_detach(&state->dib7000p_ops);
+               dvb_detach(state->dib7000p_ops.set_wbd_ref);
                return -ENODEV;
        }
 
@@ -3194,7 +3194,7 @@ static int tfe7790p_frontend_attach(struct dvb_usb_adapter *adap)
                                1, 0x10, &tfe7790p_dib7000p_config) != 0) {
                err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n",
                                __func__);
-               dvb_detach(&state->dib7000p_ops);
+               dvb_detach(state->dib7000p_ops.set_wbd_ref);
                return -ENODEV;
        }
        adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap,
@@ -3289,7 +3289,7 @@ static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap)
                                     stk7070pd_dib7000p_config) != 0) {
                err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n",
                    __func__);
-               dvb_detach(&state->dib7000p_ops);
+               dvb_detach(state->dib7000p_ops.set_wbd_ref);
                return -ENODEV;
        }
 
@@ -3364,7 +3364,7 @@ static int novatd_frontend_attach(struct dvb_usb_adapter *adap)
                                             stk7070pd_dib7000p_config) != 0) {
                        err("%s: state->dib7000p_ops.i2c_enumeration failed.  Cannot continue\n",
                            __func__);
-                       dvb_detach(&state->dib7000p_ops);
+                       dvb_detach(state->dib7000p_ops.set_wbd_ref);
                        return -ENODEV;
                }
        }
@@ -3600,7 +3600,7 @@ static int pctv340e_frontend_attach(struct dvb_usb_adapter *adap)
 
        if (state->dib7000p_ops.dib7000pc_detection(&adap->dev->i2c_adap) == 0) {
                /* Demodulator not found for some reason? */
-               dvb_detach(&state->dib7000p_ops);
+               dvb_detach(state->dib7000p_ops.set_wbd_ref);
                return -ENODEV;
        }
 
index af09a1b272e68112c052df952c35ad6e8123dd6b..6a2d1454befe0de579056af3c72dec9d99248346 100644 (file)
@@ -2002,9 +2002,10 @@ static void fm10k_sm_mbx_create_reply(struct fm10k_hw *hw,
  *  function can also be used to respond to an error as the connection
  *  resetting would also be a means of dealing with errors.
  **/
-static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw,
-                                      struct fm10k_mbx_info *mbx)
+static s32 fm10k_sm_mbx_process_reset(struct fm10k_hw *hw,
+                                     struct fm10k_mbx_info *mbx)
 {
+       s32 err = 0;
        const enum fm10k_mbx_state state = mbx->state;
 
        switch (state) {
@@ -2017,6 +2018,7 @@ static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw,
        case FM10K_STATE_OPEN:
                /* flush any incomplete work */
                fm10k_sm_mbx_connect_reset(mbx);
+               err = FM10K_ERR_RESET_REQUESTED;
                break;
        case FM10K_STATE_CONNECT:
                /* Update remote value to match local value */
@@ -2026,6 +2028,8 @@ static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw,
        }
 
        fm10k_sm_mbx_create_reply(hw, mbx, mbx->tail);
+
+       return err;
 }
 
 /**
@@ -2106,7 +2110,7 @@ static s32 fm10k_sm_mbx_process(struct fm10k_hw *hw,
 
        switch (FM10K_MSG_HDR_FIELD_GET(mbx->mbx_hdr, SM_VER)) {
        case 0:
-               fm10k_sm_mbx_process_reset(hw, mbx);
+               err = fm10k_sm_mbx_process_reset(hw, mbx);
                break;
        case FM10K_SM_MBX_VERSION:
                err = fm10k_sm_mbx_process_version_1(hw, mbx);
index 7f3fb51bc37b59bc74bc71fc7bfb43ebca220a7b..06f35700840b6ac73dbe3ce05a7ce10cafcc2dac 100644 (file)
@@ -1072,6 +1072,7 @@ static irqreturn_t fm10k_msix_mbx_pf(int __always_unused irq, void *data)
        struct fm10k_hw *hw = &interface->hw;
        struct fm10k_mbx_info *mbx = &hw->mbx;
        u32 eicr;
+       s32 err = 0;
 
        /* unmask any set bits related to this interrupt */
        eicr = fm10k_read_reg(hw, FM10K_EICR);
@@ -1087,12 +1088,15 @@ static irqreturn_t fm10k_msix_mbx_pf(int __always_unused irq, void *data)
 
        /* service mailboxes */
        if (fm10k_mbx_trylock(interface)) {
-               mbx->ops.process(hw, mbx);
+               err = mbx->ops.process(hw, mbx);
                /* handle VFLRE events */
                fm10k_iov_event(interface);
                fm10k_mbx_unlock(interface);
        }
 
+       if (err == FM10K_ERR_RESET_REQUESTED)
+               interface->flags |= FM10K_FLAG_RESET_REQUESTED;
+
        /* if switch toggled state we should reset GLORTs */
        if (eicr & FM10K_EICR_SWITCHNOTREADY) {
                /* force link down for at least 4 seconds */
index 97bf0c3d5c69e06fd604c9685cfab129cd83e66c..f3f3b95d5512475c8285458f95f76c56be887d86 100644 (file)
@@ -223,6 +223,17 @@ static s32 igb_init_phy_params_82575(struct e1000_hw *hw)
        hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >>
                        E1000_STATUS_FUNC_SHIFT;
 
+       /* Make sure the PHY is in a good state. Several people have reported
+        * firmware leaving the PHY's page select register set to something
+        * other than the default of zero, which causes the PHY ID read to
+        * access something other than the intended register.
+        */
+       ret_val = hw->phy.ops.reset(hw);
+       if (ret_val) {
+               hw_dbg("Error resetting the PHY.\n");
+               goto out;
+       }
+
        /* Set phy->phy_addr and phy->id. */
        ret_val = igb_get_phy_id_82575(hw);
        if (ret_val)
index 29f59c76878a59a61e4e7d61a084b25db33e8726..851225b5dc0fc3901a2a5d6edca4f77cd1234654 100644 (file)
@@ -699,9 +699,9 @@ static s32 igb_update_flash_i210(struct e1000_hw *hw)
 
        ret_val = igb_pool_flash_update_done_i210(hw);
        if (ret_val)
-               hw_dbg("Flash update complete\n");
-       else
                hw_dbg("Flash update time out\n");
+       else
+               hw_dbg("Flash update complete\n");
 
 out:
        return ret_val;
index a481ea64e2872d9e93affc5efe596a1215e5c688..ff6e57d788eb17377943f7ea6130b096524df83b 100644 (file)
@@ -3172,7 +3172,9 @@ static int __igb_close(struct net_device *netdev, bool suspending)
 
 static int igb_close(struct net_device *netdev)
 {
-       return __igb_close(netdev, false);
+       if (netif_device_present(netdev))
+               return __igb_close(netdev, false);
+       return 0;
 }
 
 /**
@@ -7325,12 +7327,14 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,
        int retval = 0;
 #endif
 
+       rtnl_lock();
        netif_device_detach(netdev);
 
        if (netif_running(netdev))
                __igb_close(netdev, true);
 
        igb_clear_interrupt_scheme(adapter);
+       rtnl_unlock();
 
 #ifdef CONFIG_PM
        retval = pci_save_state(pdev);
@@ -7450,16 +7454,15 @@ static int igb_resume(struct device *dev)
 
        wr32(E1000_WUS, ~0);
 
-       if (netdev->flags & IFF_UP) {
-               rtnl_lock();
+       rtnl_lock();
+       if (!err && netif_running(netdev))
                err = __igb_open(netdev, true);
-               rtnl_unlock();
-               if (err)
-                       return err;
-       }
 
-       netif_device_attach(netdev);
-       return 0;
+       if (!err)
+               netif_device_attach(netdev);
+       rtnl_unlock();
+
+       return err;
 }
 
 static int igb_runtime_idle(struct device *dev)
index f3168bcc7d87905b2f3563ea64c0fbfeda01d1d4..f0de09db828368299025e9379931113642b41d8a 100644 (file)
@@ -307,6 +307,7 @@ static void ixgbe_cache_ring_register(struct ixgbe_adapter *adapter)
        ixgbe_cache_ring_rss(adapter);
 }
 
+#define IXGBE_RSS_64Q_MASK     0x3F
 #define IXGBE_RSS_16Q_MASK     0xF
 #define IXGBE_RSS_8Q_MASK      0x7
 #define IXGBE_RSS_4Q_MASK      0x3
@@ -602,6 +603,7 @@ static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter)
  **/
 static bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter)
 {
+       struct ixgbe_hw *hw = &adapter->hw;
        struct ixgbe_ring_feature *f;
        u16 rss_i;
 
@@ -610,7 +612,11 @@ static bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter)
        rss_i = f->limit;
 
        f->indices = rss_i;
-       f->mask = IXGBE_RSS_16Q_MASK;
+
+       if (hw->mac.type < ixgbe_mac_X550)
+               f->mask = IXGBE_RSS_16Q_MASK;
+       else
+               f->mask = IXGBE_RSS_64Q_MASK;
 
        /* disable ATR by default, it will be configured below */
        adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
index cd9b284bc83b6294e47361005b21e1e96352324b..83645d8503d462296e05676047e686e4181a4a15 100644 (file)
@@ -5878,7 +5878,8 @@ static int ixgbe_close(struct net_device *netdev)
 
        ixgbe_ptp_stop(adapter);
 
-       ixgbe_close_suspend(adapter);
+       if (netif_device_present(netdev))
+               ixgbe_close_suspend(adapter);
 
        ixgbe_fdir_filter_exit(adapter);
 
@@ -5923,14 +5924,12 @@ static int ixgbe_resume(struct pci_dev *pdev)
        if (!err && netif_running(netdev))
                err = ixgbe_open(netdev);
 
-       rtnl_unlock();
-
-       if (err)
-               return err;
 
-       netif_device_attach(netdev);
+       if (!err)
+               netif_device_attach(netdev);
+       rtnl_unlock();
 
-       return 0;
+       return err;
 }
 #endif /* CONFIG_PM */
 
@@ -5945,14 +5944,14 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
        int retval = 0;
 #endif
 
+       rtnl_lock();
        netif_device_detach(netdev);
 
-       rtnl_lock();
        if (netif_running(netdev))
                ixgbe_close_suspend(adapter);
-       rtnl_unlock();
 
        ixgbe_clear_interrupt_scheme(adapter);
+       rtnl_unlock();
 
 #ifdef CONFIG_PM
        retval = pci_save_state(pdev);
@@ -9221,7 +9220,7 @@ skip_bad_vf_detection:
        }
 
        if (netif_running(netdev))
-               ixgbe_down(adapter);
+               ixgbe_close_suspend(adapter);
 
        if (!test_and_set_bit(__IXGBE_DISABLED, &adapter->state))
                pci_disable_device(pdev);
@@ -9291,10 +9290,12 @@ static void ixgbe_io_resume(struct pci_dev *pdev)
        }
 
 #endif
+       rtnl_lock();
        if (netif_running(netdev))
-               ixgbe_up(adapter);
+               ixgbe_open(netdev);
 
        netif_device_attach(netdev);
+       rtnl_unlock();
 }
 
 static const struct pci_error_handlers ixgbe_err_handler = {
index fb8673d6380689fa7a79ebba5d5d493777d1bdc2..48d97cb730d8ac1e93c0f0ade0e7a25c404beb6d 100644 (file)
@@ -113,7 +113,7 @@ static s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr,
                                               u16 reg, u16 *val, bool lock)
 {
        u32 swfw_mask = hw->phy.phy_semaphore_mask;
-       int max_retry = 10;
+       int max_retry = 3;
        int retry = 0;
        u8 csum_byte;
        u8 high_bits;
@@ -1764,6 +1764,8 @@ static s32 ixgbe_read_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset,
        u32 swfw_mask = hw->phy.phy_semaphore_mask;
        bool nack = true;
 
+       if (hw->mac.type >= ixgbe_mac_X550)
+               max_retry = 3;
        if (ixgbe_is_sfp_probe(hw, byte_offset, dev_addr))
                max_retry = IXGBE_SFP_DETECT_RETRIES;
 
index ebe0ac950b14e72a0d5dae2e51d3250c250846d1..31f864fb30c1a70e65fcee143606909ca9ea9c04 100644 (file)
@@ -1643,8 +1643,6 @@ static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw,
                return status;
 
        reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_ENABLE;
-       reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_FEC_REQ |
-                    IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC);
        reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KR |
                     IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KX);
 
index 8c408aa2f20800cea420483936a40de464c01b23..f9343bee1de3c74bb9f4440048dd533e001bedba 100644 (file)
@@ -221,7 +221,7 @@ skip:
                        goto bad_desc;
        }
 
-       if (header.usb_cdc_ether_desc) {
+       if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) {
                dev->hard_mtu = le16_to_cpu(info->ether->wMaxSegmentSize);
                /* because of Zaurus, we may be ignoring the host
                 * side link address we were given.
index 958af3b1af7f1a7d3de5a4e1b7cc8fdc40c6104e..e325ca3ad56513287ec1904664e1c8819251781e 100644 (file)
@@ -262,7 +262,7 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
        }
 
        /* errors aren't fatal - we can live with the dynamic address */
-       if (cdc_ether) {
+       if (cdc_ether && cdc_ether->wMaxSegmentSize) {
                dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize);
                usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress);
        }
index f6446d759d7f9f6fd7dfa1dfb5323e2f5cf825bd..4639dac64e7f48c52691b12cc196a4d9d30c22be 100644 (file)
@@ -5147,6 +5147,19 @@ lpfc_free_sysfs_attr(struct lpfc_vport *vport)
  * Dynamic FC Host Attributes Support
  */
 
+/**
+ * lpfc_get_host_symbolic_name - Copy symbolic name into the scsi host
+ * @shost: kernel scsi host pointer.
+ **/
+static void
+lpfc_get_host_symbolic_name(struct Scsi_Host *shost)
+{
+       struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata;
+
+       lpfc_vport_symbolic_node_name(vport, fc_host_symbolic_name(shost),
+                                     sizeof fc_host_symbolic_name(shost));
+}
+
 /**
  * lpfc_get_host_port_id - Copy the vport DID into the scsi host port id
  * @shost: kernel scsi host pointer.
@@ -5684,6 +5697,8 @@ struct fc_function_template lpfc_transport_functions = {
        .show_host_supported_fc4s = 1,
        .show_host_supported_speeds = 1,
        .show_host_maxframe_size = 1,
+
+       .get_host_symbolic_name = lpfc_get_host_symbolic_name,
        .show_host_symbolic_name = 1,
 
        /* dynamic attributes the driver supports */
@@ -5751,6 +5766,8 @@ struct fc_function_template lpfc_vport_transport_functions = {
        .show_host_supported_fc4s = 1,
        .show_host_supported_speeds = 1,
        .show_host_maxframe_size = 1,
+
+       .get_host_symbolic_name = lpfc_get_host_symbolic_name,
        .show_host_symbolic_name = 1,
 
        /* dynamic attributes the driver supports */
index c74f74ab981c8c79e393071837421167e527f507..d278362448ca89302135d42ca324a6e28661d3a7 100644 (file)
@@ -1982,6 +1982,9 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry)
        if (sp->cmn.fcphHigh < FC_PH3)
                sp->cmn.fcphHigh = FC_PH3;
 
+       sp->cmn.valid_vendor_ver_level = 0;
+       memset(sp->vendorVersion, 0, sizeof(sp->vendorVersion));
+
        lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD,
                "Issue PLOGI:     did:x%x",
                did, 0, 0);
@@ -3966,6 +3969,9 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
                } else {
                        memcpy(pcmd, &vport->fc_sparam,
                               sizeof(struct serv_parm));
+
+                       sp->cmn.valid_vendor_ver_level = 0;
+                       memset(sp->vendorVersion, 0, sizeof(sp->vendorVersion));
                }
 
                lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP,
index 2cce88e967ce168500e4f5bc738451532fb49144..a8ad97300177e37b7b259a7742ac277202a11936 100644 (file)
@@ -360,6 +360,12 @@ struct csp {
  * Word 1 Bit 30 in PLOGI request is random offset
  */
 #define virtual_fabric_support randomOffset /* Word 1, bit 30 */
+/*
+ * Word 1 Bit 29 in common service parameter is overloaded.
+ * Word 1 Bit 29 in FLOGI response is multiple NPort assignment
+ * Word 1 Bit 29 in FLOGI/PLOGI request is Valid Vendor Version Level
+ */
+#define valid_vendor_ver_level response_multiple_NPort /* Word 1, bit 29 */
 #ifdef __BIG_ENDIAN_BITFIELD
        uint16_t request_multiple_Nport:1;      /* FC Word 1, bit 31 */
        uint16_t randomOffset:1;        /* FC Word 1, bit 30 */
index 38e90d9c2ceda022a8d6d32e3009ad8a7792c955..8379fbbc60db4c0e46520961357059727c880499 100644 (file)
@@ -118,6 +118,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, union lpfc_wqe *wqe)
        if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED)
                bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id);
        lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size);
+       /* ensure WQE bcopy flushed before doorbell write */
+       wmb();
 
        /* Update the host index before invoking device */
        host_index = q->host_index;
@@ -9805,6 +9807,7 @@ lpfc_sli_abort_iotag_issue(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
                iabt->ulpCommand = CMD_CLOSE_XRI_CN;
 
        abtsiocbp->iocb_cmpl = lpfc_sli_abort_els_cmpl;
+       abtsiocbp->vport = vport;
 
        lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI,
                         "0339 Abort xri x%x, original iotag x%x, "
index 769012663a8f53c2590234009fec7d7127e15f85..861c57bc4520a31b7e33ba42f8ef6a93f3dcb343 100644 (file)
@@ -528,6 +528,12 @@ enable_vport(struct fc_vport *fc_vport)
 
        spin_lock_irq(shost->host_lock);
        vport->load_flag |= FC_LOADING;
+       if (vport->fc_flag & FC_VPORT_NEEDS_INIT_VPI) {
+               spin_unlock_irq(shost->host_lock);
+               lpfc_issue_init_vpi(vport);
+               goto out;
+       }
+
        vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
        spin_unlock_irq(shost->host_lock);
 
@@ -548,6 +554,8 @@ enable_vport(struct fc_vport *fc_vport)
        } else {
                lpfc_vport_set_state(vport, FC_VPORT_FAILED);
        }
+
+out:
        lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
                         "1827 Vport Enabled.\n");
        return VPORT_OK;
index 4f38d008bfb401d9eeeb359472e643bdf3e85c9b..4b82c3765e0139a1a617c4eed9c41dea902f3942 100644 (file)
@@ -1552,6 +1552,7 @@ static const struct of_device_id ufs_qcom_of_match[] = {
        { .compatible = "qcom,ufshc"},
        {},
 };
+MODULE_DEVICE_TABLE(of, ufs_qcom_of_match);
 
 static const struct dev_pm_ops ufs_qcom_pm_ops = {
        .suspend        = ufshcd_pltfrm_suspend,
index 4167bdbf0ecf29a4e275824bf3aa36378845586a..1b9008cab6ebd186d3b806420f53892d7a720c6a 100644 (file)
@@ -3369,18 +3369,25 @@ out:
 }
 
 /**
- * ufshcd_force_reset_auto_bkops - force enable of auto bkops
+ * ufshcd_force_reset_auto_bkops - force reset auto bkops state
  * @hba: per adapter instance
  *
  * After a device reset the device may toggle the BKOPS_EN flag
  * to default value. The s/w tracking variables should be updated
- * as well. Do this by forcing enable of auto bkops.
+ * as well. This function would change the auto-bkops state based on
+ * UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND.
  */
-static void  ufshcd_force_reset_auto_bkops(struct ufs_hba *hba)
+static void ufshcd_force_reset_auto_bkops(struct ufs_hba *hba)
 {
-       hba->auto_bkops_enabled = false;
-       hba->ee_ctrl_mask |= MASK_EE_URGENT_BKOPS;
-       ufshcd_enable_auto_bkops(hba);
+       if (ufshcd_keep_autobkops_enabled_except_suspend(hba)) {
+               hba->auto_bkops_enabled = false;
+               hba->ee_ctrl_mask |= MASK_EE_URGENT_BKOPS;
+               ufshcd_enable_auto_bkops(hba);
+       } else {
+               hba->auto_bkops_enabled = true;
+               hba->ee_ctrl_mask &= ~MASK_EE_URGENT_BKOPS;
+               ufshcd_disable_auto_bkops(hba);
+       }
 }
 
 static inline int ufshcd_get_bkops_status(struct ufs_hba *hba, u32 *status)
@@ -5178,11 +5185,15 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
                        goto set_old_link_state;
        }
 
-       /*
-        * If BKOPs operations are urgently needed at this moment then
-        * keep auto-bkops enabled or else disable it.
-        */
-       ufshcd_urgent_bkops(hba);
+       if (ufshcd_keep_autobkops_enabled_except_suspend(hba))
+               ufshcd_enable_auto_bkops(hba);
+       else
+               /*
+                * If BKOPs operations are urgently needed at this moment then
+                * keep auto-bkops enabled or else disable it.
+                */
+               ufshcd_urgent_bkops(hba);
+
        hba->clk_gating.is_suspended = false;
 
        if (ufshcd_is_clkscaling_enabled(hba))
index f3780cf7d89520528efdfbab4561a27b1fde1a1d..b74eedbd831ff54a8136883265e8579d020c6f79 100644 (file)
@@ -528,6 +528,14 @@ struct ufs_hba {
         * CAUTION: Enabling this might reduce overall UFS throughput.
         */
 #define UFSHCD_CAP_INTR_AGGR (1 << 4)
+       /*
+        * This capability allows the device auto-bkops to be always enabled
+        * except during suspend (both runtime and suspend).
+        * Enabling this capability means that device will always be allowed
+        * to do background operation when it's active but it might degrade
+        * the performance of ongoing read/write operations.
+        */
+#define UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND (1 << 5)
 
        struct devfreq *devfreq;
        struct ufs_clk_scaling clk_scaling;
@@ -626,6 +634,11 @@ static inline void *ufshcd_get_variant(struct ufs_hba *hba)
        BUG_ON(!hba);
        return hba->priv;
 }
+static inline bool ufshcd_keep_autobkops_enabled_except_suspend(
+                                                       struct ufs_hba *hba)
+{
+       return hba->caps & UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND;
+}
 
 extern int ufshcd_runtime_suspend(struct ufs_hba *hba);
 extern int ufshcd_runtime_resume(struct ufs_hba *hba);
index 971bf457f32d1149cb3f5ccc6c4277cb8072e46d..e75a386344e432fce1609958b3721118b66f93fb 100644 (file)
@@ -75,7 +75,7 @@ extern u32 GlobalDebugLevel;
 #define DBG_88E_LEVEL(_level, fmt, arg...)                             \
        do {                                                            \
                if (_level <= GlobalDebugLevel)                         \
-                       pr_info(DRIVER_PREFIX"ERROR " fmt, ##arg);      \
+                       pr_info(DRIVER_PREFIX fmt, ##arg);      \
        } while (0)
 
 #define DBG_88E(...)                                                   \
index edfc6805e0128e6c6001756342babff0b63e6593..2b348439242f1cd2b2c5647e010196c13540a36f 100644 (file)
@@ -199,7 +199,7 @@ static inline char *translate_scan(struct _adapter *padapter,
        iwe.cmd = SIOCGIWMODE;
        memcpy((u8 *)&cap, r8712_get_capability_from_ie(pnetwork->network.IEs),
                2);
-       cap = le16_to_cpu(cap);
+       le16_to_cpus(&cap);
        if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_BSS)) {
                if (cap & WLAN_CAPABILITY_BSS)
                        iwe.u.mode = (u32)IW_MODE_MASTER;
index 873ba02d59e693b5a44e8a0f780ee57a9b7e98d2..f4c3a37e00bafdd166b2c0ac41b3e00094c4b85d 100644 (file)
@@ -1653,6 +1653,18 @@ static int proc_unlinkurb(struct usb_dev_state *ps, void __user *arg)
        return 0;
 }
 
+static void compute_isochronous_actual_length(struct urb *urb)
+{
+       unsigned int i;
+
+       if (urb->number_of_packets > 0) {
+               urb->actual_length = 0;
+               for (i = 0; i < urb->number_of_packets; i++)
+                       urb->actual_length +=
+                                       urb->iso_frame_desc[i].actual_length;
+       }
+}
+
 static int processcompl(struct async *as, void __user * __user *arg)
 {
        struct urb *urb = as->urb;
@@ -1660,6 +1672,7 @@ static int processcompl(struct async *as, void __user * __user *arg)
        void __user *addr = as->userurb;
        unsigned int i;
 
+       compute_isochronous_actual_length(urb);
        if (as->userbuffer && urb->actual_length) {
                if (copy_urb_data_to_user(as->userbuffer, urb))
                        goto err_out;
@@ -1829,6 +1842,7 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
        void __user *addr = as->userurb;
        unsigned int i;
 
+       compute_isochronous_actual_length(urb);
        if (as->userbuffer && urb->actual_length) {
                if (copy_urb_data_to_user(as->userbuffer, urb))
                        return -EFAULT;
index a6aaf2f193a464450c96fd30f9acf9f1503eecb1..37c418e581fbe33036334344cf589ccb4cb746be 100644 (file)
@@ -221,6 +221,9 @@ static const struct usb_device_id usb_quirk_list[] = {
        /* Corsair Strafe RGB */
        { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT },
 
+       /* Corsair K70 LUX */
+       { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT },
+
        /* MIDI keyboard WORLDE MINI */
        { USB_DEVICE(0x1c75, 0x0204), .driver_info =
                        USB_QUIRK_CONFIG_INTF_STRINGS },
index 37d0e8cc7af6b608d2a79f815c06b90ee5425718..2220c1b9df10b18ff4e093dc2a84f6746182e3b4 100644 (file)
@@ -138,6 +138,7 @@ struct garmin_data {
        __u8   privpkt[4*6];
        spinlock_t lock;
        struct list_head pktlist;
+       struct usb_anchor write_urbs;
 };
 
 
@@ -906,13 +907,19 @@ static int garmin_init_session(struct usb_serial_port *port)
                                        sizeof(GARMIN_START_SESSION_REQ), 0);
 
                        if (status < 0)
-                               break;
+                               goto err_kill_urbs;
                }
 
                if (status > 0)
                        status = 0;
        }
 
+       return status;
+
+err_kill_urbs:
+       usb_kill_anchored_urbs(&garmin_data_p->write_urbs);
+       usb_kill_urb(port->interrupt_in_urb);
+
        return status;
 }
 
@@ -931,7 +938,6 @@ static int garmin_open(struct tty_struct *tty, struct usb_serial_port *port)
        spin_unlock_irqrestore(&garmin_data_p->lock, flags);
 
        /* shutdown any bulk reads that might be going on */
-       usb_kill_urb(port->write_urb);
        usb_kill_urb(port->read_urb);
 
        if (garmin_data_p->state == STATE_RESET)
@@ -954,7 +960,7 @@ static void garmin_close(struct usb_serial_port *port)
 
        /* shutdown our urbs */
        usb_kill_urb(port->read_urb);
-       usb_kill_urb(port->write_urb);
+       usb_kill_anchored_urbs(&garmin_data_p->write_urbs);
 
        /* keep reset state so we know that we must start a new session */
        if (garmin_data_p->state != STATE_RESET)
@@ -1038,12 +1044,14 @@ static int garmin_write_bulk(struct usb_serial_port *port,
        }
 
        /* send it down the pipe */
+       usb_anchor_urb(urb, &garmin_data_p->write_urbs);
        status = usb_submit_urb(urb, GFP_ATOMIC);
        if (status) {
                dev_err(&port->dev,
                   "%s - usb_submit_urb(write bulk) failed with status = %d\n",
                                __func__, status);
                count = status;
+               usb_unanchor_urb(urb);
                kfree(buffer);
        }
 
@@ -1402,9 +1410,16 @@ static int garmin_port_probe(struct usb_serial_port *port)
        garmin_data_p->state = 0;
        garmin_data_p->flags = 0;
        garmin_data_p->count = 0;
+       init_usb_anchor(&garmin_data_p->write_urbs);
        usb_set_serial_port_data(port, garmin_data_p);
 
        status = garmin_init_session(port);
+       if (status)
+               goto err_free;
+
+       return 0;
+err_free:
+       kfree(garmin_data_p);
 
        return status;
 }
@@ -1414,6 +1429,7 @@ static int garmin_port_remove(struct usb_serial_port *port)
 {
        struct garmin_data *garmin_data_p = usb_get_serial_port_data(port);
 
+       usb_kill_anchored_urbs(&garmin_data_p->write_urbs);
        usb_kill_urb(port->interrupt_in_urb);
        del_timer_sync(&garmin_data_p->timer);
        kfree(garmin_data_p);
index e1c1e329c8775ccfde0a5f5c18f8194765134266..4516291df1b854eb98044c41fd3edd2260e6383a 100644 (file)
@@ -148,6 +148,7 @@ static const struct usb_device_id id_table[] = {
        {DEVICE_SWI(0x1199, 0x68a2)},   /* Sierra Wireless MC7710 */
        {DEVICE_SWI(0x1199, 0x68c0)},   /* Sierra Wireless MC7304/MC7354 */
        {DEVICE_SWI(0x1199, 0x901c)},   /* Sierra Wireless EM7700 */
+       {DEVICE_SWI(0x1199, 0x901e)},   /* Sierra Wireless EM7355 QDL */
        {DEVICE_SWI(0x1199, 0x901f)},   /* Sierra Wireless EM7355 */
        {DEVICE_SWI(0x1199, 0x9040)},   /* Sierra Wireless Modem */
        {DEVICE_SWI(0x1199, 0x9041)},   /* Sierra Wireless MC7305/MC7355 */
index dd88ba1d71ceb64849535542a8cb3289d89df4c1..35373e2065b2ca46baae953125490fc4ed984a01 100644 (file)
@@ -332,10 +332,18 @@ static int adp5520_bl_probe(struct platform_device *pdev)
        }
 
        platform_set_drvdata(pdev, bl);
-       ret |= adp5520_bl_setup(bl);
+       ret = adp5520_bl_setup(bl);
+       if (ret) {
+               dev_err(&pdev->dev, "failed to setup\n");
+               if (data->pdata->en_ambl_sens)
+                       sysfs_remove_group(&bl->dev.kobj,
+                                       &adp5520_bl_attr_group);
+               return ret;
+       }
+
        backlight_update_status(bl);
 
-       return ret;
+       return 0;
 }
 
 static int adp5520_bl_remove(struct platform_device *pdev)
index 7de847df224fd2c24ac62b4c97d46c174f5e026f..4b40c6a4d44190a554b9676b3cb9ced5579789ff 100644 (file)
@@ -226,6 +226,8 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent,
        dev_set_name(&new_ld->dev, "%s", name);
        dev_set_drvdata(&new_ld->dev, devdata);
 
+       new_ld->ops = ops;
+
        rc = device_register(&new_ld->dev);
        if (rc) {
                put_device(&new_ld->dev);
@@ -238,8 +240,6 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent,
                return ERR_PTR(rc);
        }
 
-       new_ld->ops = ops;
-
        return new_ld;
 }
 EXPORT_SYMBOL(lcd_device_register);
index 13949259705adb43729a83d981fd2752f8a4664c..0d4fe32b3ae25fe0541d194a4fb0fe5591f67de4 100644 (file)
@@ -45,8 +45,8 @@
 #define PIN_OFF_NONE           0
 #define PIN_OFF_OUTPUT_HIGH    (OFF_EN | OFFOUT_EN | OFFOUT_VAL)
 #define PIN_OFF_OUTPUT_LOW     (OFF_EN | OFFOUT_EN)
-#define PIN_OFF_INPUT_PULLUP   (OFF_EN | OFF_PULL_EN | OFF_PULL_UP)
-#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN)
+#define PIN_OFF_INPUT_PULLUP   (OFF_EN | OFFOUT_EN | OFF_PULL_EN | OFF_PULL_UP)
+#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFFOUT_EN | OFF_PULL_EN)
 #define PIN_OFF_WAKEUPENABLE   WAKEUP_EN
 
 /*
index 7af20a13642911957889a99a74aeac94957ed4cc..804c9b2bfce325ca281cf0af8e44d6ae99c8512f 100644 (file)
 #define RDS_INFO_LAST                  10010
 
 struct rds_info_counter {
-       uint8_t name[32];
-       uint64_t        value;
+       __u8    name[32];
+       __u64   value;
 } __attribute__((packed));
 
 #define RDS_INFO_CONNECTION_FLAG_SENDING       0x01
@@ -115,35 +115,35 @@ struct rds_info_counter {
 #define TRANSNAMSIZ    16
 
 struct rds_info_connection {
-       uint64_t        next_tx_seq;
-       uint64_t        next_rx_seq;
+       __u64           next_tx_seq;
+       __u64           next_rx_seq;
        __be32          laddr;
        __be32          faddr;
-       uint8_t transport[TRANSNAMSIZ];         /* null term ascii */
-       uint8_t flags;
+       __u8            transport[TRANSNAMSIZ];         /* null term ascii */
+       __u8            flags;
 } __attribute__((packed));
 
 #define RDS_INFO_MESSAGE_FLAG_ACK               0x01
 #define RDS_INFO_MESSAGE_FLAG_FAST_ACK          0x02
 
 struct rds_info_message {
-       uint64_t        seq;
-       uint32_t        len;
+       __u64           seq;
+       __u32           len;
        __be32          laddr;
        __be32          faddr;
        __be16          lport;
        __be16          fport;
-       uint8_t flags;
+       __u8            flags;
 } __attribute__((packed));
 
 struct rds_info_socket {
-       uint32_t        sndbuf;
+       __u32           sndbuf;
        __be32          bound_addr;
        __be32          connected_addr;
        __be16          bound_port;
        __be16          connected_port;
-       uint32_t        rcvbuf;
-       uint64_t        inum;
+       __u32           rcvbuf;
+       __u64           inum;
 } __attribute__((packed));
 
 struct rds_info_tcp_socket {
@@ -151,25 +151,25 @@ struct rds_info_tcp_socket {
        __be16          local_port;
        __be32          peer_addr;
        __be16          peer_port;
-       uint64_t       hdr_rem;
-       uint64_t       data_rem;
-       uint32_t       last_sent_nxt;
-       uint32_t       last_expected_una;
-       uint32_t       last_seen_una;
+       __u64           hdr_rem;
+       __u64           data_rem;
+       __u32           last_sent_nxt;
+       __u32           last_expected_una;
+       __u32           last_seen_una;
 } __attribute__((packed));
 
 #define RDS_IB_GID_LEN 16
 struct rds_info_rdma_connection {
        __be32          src_addr;
        __be32          dst_addr;
-       uint8_t         src_gid[RDS_IB_GID_LEN];
-       uint8_t         dst_gid[RDS_IB_GID_LEN];
+       __u8            src_gid[RDS_IB_GID_LEN];
+       __u8            dst_gid[RDS_IB_GID_LEN];
 
-       uint32_t        max_send_wr;
-       uint32_t        max_recv_wr;
-       uint32_t        max_send_sge;
-       uint32_t        rdma_mr_max;
-       uint32_t        rdma_mr_size;
+       __u32           max_send_wr;
+       __u32           max_recv_wr;
+       __u32           max_send_sge;
+       __u32           rdma_mr_max;
+       __u32           rdma_mr_size;
 };
 
 /*
@@ -210,70 +210,70 @@ struct rds_info_rdma_connection {
  * (so that the application does not have to worry about
  * alignment).
  */
-typedef uint64_t       rds_rdma_cookie_t;
+typedef __u64          rds_rdma_cookie_t;
 
 struct rds_iovec {
-       uint64_t        addr;
-       uint64_t        bytes;
+       __u64           addr;
+       __u64           bytes;
 };
 
 struct rds_get_mr_args {
        struct rds_iovec vec;
-       uint64_t        cookie_addr;
-       uint64_t        flags;
+       __u64           cookie_addr;
+       __u64           flags;
 };
 
 struct rds_get_mr_for_dest_args {
        struct __kernel_sockaddr_storage dest_addr;
        struct rds_iovec        vec;
-       uint64_t                cookie_addr;
-       uint64_t                flags;
+       __u64                   cookie_addr;
+       __u64                   flags;
 };
 
 struct rds_free_mr_args {
        rds_rdma_cookie_t cookie;
-       uint64_t        flags;
+       __u64           flags;
 };
 
 struct rds_rdma_args {
        rds_rdma_cookie_t cookie;
        struct rds_iovec remote_vec;
-       uint64_t        local_vec_addr;
-       uint64_t        nr_local;
-       uint64_t        flags;
-       uint64_t        user_token;
+       __u64           local_vec_addr;
+       __u64           nr_local;
+       __u64           flags;
+       __u64           user_token;
 };
 
 struct rds_atomic_args {
        rds_rdma_cookie_t cookie;
-       uint64_t        local_addr;
-       uint64_t        remote_addr;
+       __u64           local_addr;
+       __u64           remote_addr;
        union {
                struct {
-                       uint64_t        compare;
-                       uint64_t        swap;
+                       __u64           compare;
+                       __u64           swap;
                } cswp;
                struct {
-                       uint64_t        add;
+                       __u64           add;
                } fadd;
                struct {
-                       uint64_t        compare;
-                       uint64_t        swap;
-                       uint64_t        compare_mask;
-                       uint64_t        swap_mask;
+                       __u64           compare;
+                       __u64           swap;
+                       __u64           compare_mask;
+                       __u64           swap_mask;
                } m_cswp;
                struct {
-                       uint64_t        add;
-                       uint64_t        nocarry_mask;
+                       __u64           add;
+                       __u64           nocarry_mask;
                } m_fadd;
        };
-       uint64_t        flags;
-       uint64_t        user_token;
+       __u64           flags;
+       __u64           user_token;
 };
 
 struct rds_rdma_notify {
-       uint64_t        user_token;
-       int32_t         status;
+       __u64           user_token;
+       __s32           status;
 };
 
 #define RDS_RDMA_SUCCESS       0
index 73eec73ff73351cd26ecbe739a3a7a1935a0be48..7f0f689b8d2b1535708f2facc4932682a45c8bbc 100644 (file)
@@ -4453,6 +4453,10 @@ int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
        struct socket *sock;
        int err = 0;
 
+       /* Do not peel off from one netns to another one. */
+       if (!net_eq(current->nsproxy->net_ns, sock_net(sk)))
+               return -EINVAL;
+
        if (!asoc)
                return -EINVAL;
 
index 11467272089e45632935912c4e2b94f8cb604978..ea7b377f03787cdb3ba5b21266b5df57b5b41340 100644 (file)
@@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream
        int size, space, count;
        struct snd_pcm_runtime *runtime = subs->runtime;
 
-       if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE))
+       if (!pipe->running || (chip->chip_status & VX_STAT_IS_STALE))
                return;
 
        size = runtime->buffer_size - snd_pcm_capture_avail(runtime);
@@ -1048,8 +1048,10 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream
                /* ok, let's accelerate! */
                int align = pipe->align * 3;
                space = (count / align) * align;
-               vx_pseudo_dma_read(chip, runtime, pipe, space);
-               count -= space;
+               if (space > 0) {
+                       vx_pseudo_dma_read(chip, runtime, pipe, space);
+                       count -= space;
+               }
        }
        /* read the rest of bytes */
        while (count > 0) {
index a83688f8672e266a4ac38460be8e110a5aeca490..af0962307b7f8808430bde8d6b88a82ab3d306c9 100644 (file)
@@ -338,6 +338,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
        case 0x10ec0288:
        case 0x10ec0295:
        case 0x10ec0298:
+       case 0x10ec0299:
                alc_update_coef_idx(codec, 0x10, 1<<9, 0);
                break;
        case 0x10ec0285:
@@ -914,6 +915,7 @@ static struct alc_codec_rename_pci_table rename_pci_tbl[] = {
        { 0x10ec0256, 0x1028, 0, "ALC3246" },
        { 0x10ec0225, 0x1028, 0, "ALC3253" },
        { 0x10ec0295, 0x1028, 0, "ALC3254" },
+       { 0x10ec0299, 0x1028, 0, "ALC3271" },
        { 0x10ec0670, 0x1025, 0, "ALC669X" },
        { 0x10ec0676, 0x1025, 0, "ALC679X" },
        { 0x10ec0282, 0x1043, 0, "ALC3229" },
@@ -3721,6 +3723,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
                break;
        case 0x10ec0225:
        case 0x10ec0295:
+       case 0x10ec0299:
                alc_process_coef_fw(codec, coef0225);
                break;
        }
@@ -3823,6 +3826,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
                break;
        case 0x10ec0225:
        case 0x10ec0295:
+       case 0x10ec0299:
                alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
                snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
                alc_process_coef_fw(codec, coef0225);
@@ -3881,6 +3885,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
        switch (codec->core.vendor_id) {
        case 0x10ec0225:
        case 0x10ec0295:
+       case 0x10ec0299:
                alc_process_coef_fw(codec, coef0225);
                break;
        case 0x10ec0236:
@@ -3995,6 +4000,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
                break;
        case 0x10ec0225:
        case 0x10ec0295:
+       case 0x10ec0299:
                alc_process_coef_fw(codec, coef0225);
                break;
        }
@@ -4086,6 +4092,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
                break;
        case 0x10ec0225:
        case 0x10ec0295:
+       case 0x10ec0299:
                alc_process_coef_fw(codec, coef0225);
                break;
        }
@@ -4171,6 +4178,7 @@ static void alc_determine_headset_type(struct hda_codec *codec)
                break;
        case 0x10ec0225:
        case 0x10ec0295:
+       case 0x10ec0299:
                alc_process_coef_fw(codec, coef0225);
                msleep(800);
                val = alc_read_coef_idx(codec, 0x46);
@@ -6233,6 +6241,7 @@ static int patch_alc269(struct hda_codec *codec)
                break;
        case 0x10ec0225:
        case 0x10ec0295:
+       case 0x10ec0299:
                spec->codec_variant = ALC269_TYPE_ALC225;
                break;
        case 0x10ec0234:
@@ -7191,6 +7200,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
        HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
        HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
        HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
+       HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
        HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
        HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
        HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
index af83b3b380523e75c897695a292bfecbdb2734fb..8e457ea27f8918e13a5e949d7ee243503b2f294f 100644 (file)
@@ -269,12 +269,12 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
 
        /* Transfer using pseudo-dma.
         */
-       if (offset + count > pipe->buffer_bytes) {
+       if (offset + count >= pipe->buffer_bytes) {
                int length = pipe->buffer_bytes - offset;
                count -= length;
                length >>= 2; /* in 32bit words */
                /* Transfer using pseudo-dma. */
-               while (length-- > 0) {
+               for (; length > 0; length--) {
                        outl(cpu_to_le32(*addr), port);
                        addr++;
                }
@@ -284,7 +284,7 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
        pipe->hw_ptr += count;
        count >>= 2; /* in 32bit words */
        /* Transfer using pseudo-dma. */
-       while (count-- > 0) {
+       for (; count > 0; count--) {
                outl(cpu_to_le32(*addr), port);
                addr++;
        }
@@ -307,12 +307,12 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
        vx2_setup_pseudo_dma(chip, 0);
        /* Transfer using pseudo-dma.
         */
-       if (offset + count > pipe->buffer_bytes) {
+       if (offset + count >= pipe->buffer_bytes) {
                int length = pipe->buffer_bytes - offset;
                count -= length;
                length >>= 2; /* in 32bit words */
                /* Transfer using pseudo-dma. */
-               while (length-- > 0)
+               for (; length > 0; length--)
                        *addr++ = le32_to_cpu(inl(port));
                addr = (u32 *)runtime->dma_area;
                pipe->hw_ptr = 0;
@@ -320,7 +320,7 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
        pipe->hw_ptr += count;
        count >>= 2; /* in 32bit words */
        /* Transfer using pseudo-dma. */
-       while (count-- > 0)
+       for (; count > 0; count--)
                *addr++ = le32_to_cpu(inl(port));
 
        vx2_release_pseudo_dma(chip);
index 281972913c32140939c087067f4340d6882e6626..56aa1ba73ccc1ccb488bc662aa7ad459213eb696 100644 (file)
@@ -369,12 +369,12 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
        unsigned short *addr = (unsigned short *)(runtime->dma_area + offset);
 
        vx_setup_pseudo_dma(chip, 1);
-       if (offset + count > pipe->buffer_bytes) {
+       if (offset + count >= pipe->buffer_bytes) {
                int length = pipe->buffer_bytes - offset;
                count -= length;
                length >>= 1; /* in 16bit words */
                /* Transfer using pseudo-dma. */
-               while (length-- > 0) {
+               for (; length > 0; length--) {
                        outw(cpu_to_le16(*addr), port);
                        addr++;
                }
@@ -384,7 +384,7 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
        pipe->hw_ptr += count;
        count >>= 1; /* in 16bit words */
        /* Transfer using pseudo-dma. */
-       while (count-- > 0) {
+       for (; count > 0; count--) {
                outw(cpu_to_le16(*addr), port);
                addr++;
        }
@@ -411,12 +411,12 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
        if (snd_BUG_ON(count % 2))
                return;
        vx_setup_pseudo_dma(chip, 0);
-       if (offset + count > pipe->buffer_bytes) {
+       if (offset + count >= pipe->buffer_bytes) {
                int length = pipe->buffer_bytes - offset;
                count -= length;
                length >>= 1; /* in 16bit words */
                /* Transfer using pseudo-dma. */
-               while (length-- > 0)
+               for (; length > 0; length--)
                        *addr++ = le16_to_cpu(inw(port));
                addr = (unsigned short *)runtime->dma_area;
                pipe->hw_ptr = 0;
@@ -424,7 +424,7 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
        pipe->hw_ptr += count;
        count >>= 1; /* in 16bit words */
        /* Transfer using pseudo-dma. */
-       while (count-- > 1)
+       for (; count > 1; count--)
                *addr++ = le16_to_cpu(inw(port));
        /* Disable DMA */
        pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK;