Merge tag 'usb-3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 20 Sep 2014 17:42:56 +0000 (10:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 20 Sep 2014 17:42:56 +0000 (10:42 -0700)
Pull USB fixes / quirks from Greg KH:
 "Here are some USB and PHY fixes and quirks for 3.17-rc6.  Nothing
  major, just a few things that have been reported"

* tag 'usb-3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters
  USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter
  USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter
  USB: EHCI: unlink QHs even after the controller has stopped
  phy: spear1340-miphy: fix driver dependencies
  phy: spear1310-miphy: fix driver dependencies
  phy: miphy365x: Fix off-by-one error

130 files changed:
Documentation/devicetree/bindings/input/atmel,maxtouch.txt
Documentation/devicetree/bindings/sound/rockchip-i2s.txt
Documentation/devicetree/bindings/spi/spi-rockchip.txt
MAINTAINERS
arch/arm64/mm/init.c
arch/ia64/include/uapi/asm/unistd.h
arch/ia64/pci/fixup.c
arch/mips/Kconfig
arch/mips/Makefile
arch/mips/bcm63xx/irq.c
arch/mips/boot/compressed/decompress.c
arch/mips/include/asm/cop2.h
arch/mips/include/asm/mach-ip28/spaces.h
arch/mips/include/asm/page.h
arch/mips/include/asm/smp.h
arch/mips/include/asm/switch_to.h
arch/mips/include/asm/topology.h
arch/mips/include/uapi/asm/unistd.h
arch/mips/kernel/machine_kexec.c
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-64.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/mips/net/bpf_jit.c
arch/x86/boot/compressed/eboot.c
arch/x86/boot/compressed/head_32.S
arch/x86/boot/compressed/head_64.S
arch/x86/include/asm/io_apic.h
arch/x86/kernel/kprobes/opt.c
arch/x86/mm/dump_pagetables.c
arch/x86/mm/mmap.c
arch/x86/pci/fixup.c
crypto/drbg.c
drivers/acpi/bus.c
drivers/base/regmap/regmap-debugfs.c
drivers/char/hw_random/virtio-rng.c
drivers/firmware/efi/libstub/fdt.c
drivers/gpu/drm/bochs/bochs_kms.c
drivers/gpu/drm/cirrus/cirrus_mode.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c
drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c
drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c
drivers/gpu/drm/nouveau/core/subdev/ltc/gk104.c
drivers/gpu/drm/nouveau/core/subdev/ltc/gm107.c
drivers/gpu/drm/nouveau/nouveau_acpi.c
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/nouveau/nouveau_vga.c
drivers/gpu/drm/radeon/cik_sdma.c
drivers/gpu/drm/radeon/kv_dpm.c
drivers/gpu/drm/radeon/ni_dma.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r600_dma.c
drivers/gpu/drm/radeon/r600d.h
drivers/gpu/drm/radeon/radeon_asic.c
drivers/gpu/drm/radeon/radeon_asic.h
drivers/gpu/drm/radeon/radeon_atpx_handler.c
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/rs400.c
drivers/gpu/drm/sti/sti_hdmi.c
drivers/gpu/vga/vga_switcheroo.c
drivers/gpu/vga/vgaarb.c
drivers/infiniband/ulp/isert/ib_isert.c
drivers/input/keyboard/atkbd.c
drivers/input/serio/i8042-x86ia64io.h
drivers/input/serio/i8042.c
drivers/pci/host/pci-imx6.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/pciehp_hpc.c
drivers/pci/hotplug/pcihp_slot.c
drivers/regulator/88pm8607.c
drivers/regulator/da9052-regulator.c
drivers/regulator/max8907-regulator.c
drivers/regulator/max8925-regulator.c
drivers/regulator/max8997.c
drivers/regulator/palmas-regulator.c
drivers/regulator/tps65910-regulator.c
drivers/scsi/libiscsi.c
drivers/scsi/scsi_lib.c
drivers/spi/spi-davinci.c
drivers/spi/spi-dw.c
drivers/spi/spi-fsl-espi.c
drivers/spi/spi-fsl-spi.c
drivers/spi/spi-pl022.c
drivers/spi/spi-rockchip.c
drivers/spi/spi-sirf.c
drivers/target/iscsi/iscsi_target.c
drivers/target/iscsi/iscsi_target_parameters.c
drivers/target/iscsi/iscsi_target_util.c
drivers/target/target_core_configfs.c
drivers/target/target_core_spc.c
fs/btrfs/btrfs_inode.h
fs/btrfs/tree-log.c
fs/btrfs/volumes.c
fs/cifs/cifsfs.h
fs/cifs/connect.c
fs/cifs/link.c
fs/cifs/netmisc.c
fs/cifs/sess.c
fs/gfs2/bmap.c
fs/gfs2/file.c
fs/gfs2/incore.h
fs/gfs2/inode.c
fs/gfs2/super.c
fs/namei.c
fs/nfs/nfs4client.c
fs/nfs/nfs4proc.c
include/acpi/acpi_bus.h
include/crypto/drbg.h
include/linux/pci.h
include/linux/vga_switcheroo.h
include/linux/vgaarb.h
include/scsi/scsi_tcq.h
init/do_mounts.c
kernel/events/core.c
mm/dmapool.c
sound/pci/hda/patch_sigmatel.c
sound/soc/codecs/cs4265.c
sound/soc/codecs/sta529.c
sound/soc/codecs/tlv320aic31xx.c
sound/soc/davinci/davinci-mcasp.c
sound/soc/dwc/designware_i2s.c
sound/soc/rockchip/rockchip_i2s.c
sound/soc/samsung/i2s.c
sound/soc/soc-compress.c
sound/soc/soc-pcm.c
sound/soc/spear/spear_pcm.c

index 0ac23f2ed1040c2c9f820677fdf3f5092a7c1a6d..1852906517ab1c1b691fb4df75f8b5bdd7c9c78c 100644 (file)
@@ -11,10 +11,6 @@ Required properties:
 
 Optional properties for main touchpad device:
 
-- linux,gpio-keymap: An array of up to 4 entries indicating the Linux
-    keycode generated by each GPIO. Linux keycodes are defined in
-    <dt-bindings/input/input.h>.
-
 - linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages
     on GPIO bit changes. An array of up to 8 entries can be provided
     indicating the Linux keycode mapped to each bit of the status byte,
index 6c55fcfe5e1d095f5b3303df5351c99a7319d86b..9b82c20b306bb1e10e6bf8be84dc2a9c97933438 100644 (file)
@@ -31,7 +31,7 @@ i2s@ff890000 {
        #address-cells = <1>;
        #size-cells = <0>;
        dmas = <&pdma1 0>, <&pdma1 1>;
-       dma-names = "rx", "tx";
+       dma-names = "tx", "rx";
        clock-names = "i2s_hclk", "i2s_clk";
        clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>;
 };
index 7bab355758173f428ef256e73bd06f2ac6221f8e..467dec441c62a545f3d011f45c8707f35287ded4 100644 (file)
@@ -16,11 +16,15 @@ Required Properties:
 - clocks: Must contain an entry for each entry in clock-names.
 - clock-names: Shall be "spiclk" for the transfer-clock, and "apb_pclk" for
                           the peripheral clock.
+- #address-cells: should be 1.
+- #size-cells: should be 0.
+
+Optional Properties:
+
 - dmas: DMA specifiers for tx and rx dma. See the DMA client binding,
                Documentation/devicetree/bindings/dma/dma.txt
 - dma-names: DMA request names should include "tx" and "rx" if present.
-- #address-cells: should be 1.
-- #size-cells: should be 0.
+
 
 Example:
 
index 809ecd680d8829f6148ababe654d30a7882b11fe..670b3dcce2de84c35c14ec92c19bd72605ba4827 100644 (file)
@@ -6876,7 +6876,7 @@ F:        arch/x86/kernel/quirks.c
 
 PCI DRIVER FOR IMX6
 M:     Richard Zhu <r65037@freescale.com>
-M:     Shawn Guo <shawn.guo@freescale.com>
+M:     Lucas Stach <l.stach@pengutronix.de>
 L:     linux-pci@vger.kernel.org
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
index 5472c24018766ea5348d2d0cb56f9a932f46356a..a83061f37e431be889442a954864faa9cbfcebb6 100644 (file)
@@ -149,8 +149,7 @@ void __init arm64_memblock_init(void)
                memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start);
 #endif
 
-       if (!efi_enabled(EFI_MEMMAP))
-               early_init_fdt_scan_reserved_mem();
+       early_init_fdt_scan_reserved_mem();
 
        /* 4GB maximum for 32-bit only capable devices */
        if (IS_ENABLED(CONFIG_ZONE_DMA))
index 6a65bb7d06571050157bda55a30f9fe366387cbf..18026b2eb5823c86ab0455088e9b3b1b0c409393 100644 (file)
 #define __NR_sched_getattr             1337
 #define __NR_renameat2                 1338
 #define __NR_getrandom                 1339
-#define __NR_memfd_create              1339
+#define __NR_memfd_create              1340
 
 #endif /* _UAPI_ASM_IA64_UNISTD_H */
index ec73b2cf912a45d2ce350c26bd19e0de54c09e75..fc505d58f078ecfb55210cd3e802ed23c4b41a8e 100644 (file)
@@ -38,27 +38,6 @@ static void pci_fixup_video(struct pci_dev *pdev)
                return;
        /* Maybe, this machine supports legacy memory map. */
 
-       if (!vga_default_device()) {
-               resource_size_t start, end;
-               int i;
-
-               /* Does firmware framebuffer belong to us? */
-               for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
-                       if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
-                               continue;
-
-                       start = pci_resource_start(pdev, i);
-                       end  = pci_resource_end(pdev, i);
-
-                       if (!start || !end)
-                               continue;
-
-                       if (screen_info.lfb_base >= start &&
-                           (screen_info.lfb_base + screen_info.lfb_size) < end)
-                               vga_set_default_device(pdev);
-               }
-       }
-
        /* Is VGA routed to us? */
        bus = pdev->bus;
        while (bus) {
@@ -83,8 +62,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
                pci_read_config_word(pdev, PCI_COMMAND, &config);
                if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
                        pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
-                       dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
-                       vga_set_default_device(pdev);
+                       dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
                }
        }
 }
index 900c7e5333b650666c374a8e378129b1c7eb43f1..574c430006997427b564ef9bdeda2c16c3497279 100644 (file)
@@ -546,6 +546,7 @@ config SGI_IP28
        # select SYS_HAS_EARLY_PRINTK
        select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
+       select MIPS_L1_CACHE_SHIFT_7
       help
         This is the SGI Indigo2 with R10000 processor.  To compile a Linux
         kernel that runs on these, say Y here.
@@ -2029,7 +2030,9 @@ config MIPS_CMP
        bool "MIPS CMP framework support (DEPRECATED)"
        depends on SYS_SUPPORTS_MIPS_CMP
        select MIPS_GIC_IPI
+       select SMP
        select SYNC_R4K
+       select SYS_SUPPORTS_SMP
        select WEAK_ORDERING
        default n
        help
index 9336509f47ad61b129598d3f1ed6ee4a99aabefa..bbac51e11179af67698250417512a92136a11a0f 100644 (file)
@@ -113,7 +113,16 @@ predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
 cflags-$(CONFIG_CPU_BIG_ENDIAN)                += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be))
 cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le))
 
-cflags-$(CONFIG_CPU_HAS_SMARTMIPS)     += $(call cc-option,-msmartmips)
+# For smartmips configurations, there are hundreds of warnings due to ISA overrides
+# in assembly and header files. smartmips is only supported for MIPS32r1 onwards
+# and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or
+# similar directives in the kernel will spam the build logs with the following warnings:
+# Warning: the `smartmips' extension requires MIPS32 revision 1 or greater
+# or
+# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
+# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has
+# been fixed properly.
+cflags-$(CONFIG_CPU_HAS_SMARTMIPS)     += $(call cc-option,-msmartmips) -Wa,--no-warn
 cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips)
 
 cflags-$(CONFIG_SB1XXX_CORELIS)        += $(call cc-option,-mno-sched-prolog) \
index 37eb2d1fa69a7f293bfb24ea8f759cfafb56e851..b94bf44d8d8e297f85c9cdce01f9836d457f3bb6 100644 (file)
@@ -434,7 +434,7 @@ static void bcm63xx_init_irq(void)
                irq_stat_addr[0] += PERF_IRQSTAT_3368_REG;
                irq_mask_addr[0] += PERF_IRQMASK_3368_REG;
                irq_stat_addr[1] = 0;
-               irq_stat_addr[1] = 0;
+               irq_mask_addr[1] = 0;
                irq_bits = 32;
                ext_irq_count = 4;
                ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368;
@@ -443,7 +443,7 @@ static void bcm63xx_init_irq(void)
                irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0);
                irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0);
                irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1);
-               irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1);
+               irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1);
                irq_bits = 64;
                ext_irq_count = 4;
                is_ext_irq_cascaded = 1;
index b49c7adbfa895140f1194acb35d294a2a8647511..31903cf9709d6d5b755a22ef0e478ea7fc3585de 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/types.h>
 #include <linux/kernel.h>
+#include <linux/string.h>
 
 #include <asm/addrspace.h>
 
index d0352983b94d6f21f859bedc771a3dbcf5f1a757..51f80bd36fcc457a46782bc4266241d4de34ee2c 100644 (file)
@@ -16,8 +16,8 @@
 extern void octeon_cop2_save(struct octeon_cop2_state *);
 extern void octeon_cop2_restore(struct octeon_cop2_state *);
 
-#define cop2_save(r)           octeon_cop2_save(r)
-#define cop2_restore(r)                octeon_cop2_restore(r)
+#define cop2_save(r)           octeon_cop2_save(&(r)->thread.cp2)
+#define cop2_restore(r)                octeon_cop2_restore(&(r)->thread.cp2)
 
 #define cop2_present           1
 #define cop2_lazy_restore      1
@@ -26,26 +26,26 @@ extern void octeon_cop2_restore(struct octeon_cop2_state *);
 
 extern void nlm_cop2_save(struct nlm_cop2_state *);
 extern void nlm_cop2_restore(struct nlm_cop2_state *);
-#define cop2_save(r)           nlm_cop2_save(r)
-#define cop2_restore(r)                nlm_cop2_restore(r)
+
+#define cop2_save(r)           nlm_cop2_save(&(r)->thread.cp2)
+#define cop2_restore(r)                nlm_cop2_restore(&(r)->thread.cp2)
 
 #define cop2_present           1
 #define cop2_lazy_restore      0
 
 #elif defined(CONFIG_CPU_LOONGSON3)
 
-#define cop2_save(r)
-#define cop2_restore(r)
-
 #define cop2_present           1
 #define cop2_lazy_restore      1
+#define cop2_save(r)           do { (r); } while (0)
+#define cop2_restore(r)                do { (r); } while (0)
 
 #else
 
 #define cop2_present           0
 #define cop2_lazy_restore      0
-#define cop2_save(r)
-#define cop2_restore(r)
+#define cop2_save(r)           do { (r); } while (0)
+#define cop2_restore(r)                do { (r); } while (0)
 #endif
 
 enum cu2_ops {
index 5d6a76434d00b12a7bb4e2078e03b86c2e8f8e49..c4a912733b65d8d113e344009232021d7dd6baac 100644 (file)
 #ifndef _ASM_MACH_IP28_SPACES_H
 #define _ASM_MACH_IP28_SPACES_H
 
-#define CAC_BASE       _AC(0xa800000000000000, UL)
-
-#define HIGHMEM_START  (~0UL)
-
 #define PHYS_OFFSET    _AC(0x20000000, UL)
 
-#define UNCAC_BASE     _AC(0xc0000000, UL)     /* 0xa0000000 + PHYS_OFFSET */
-#define IO_BASE                UNCAC_BASE
-
 #include <asm/mach-generic/spaces.h>
 
 #endif /* _ASM_MACH_IP28_SPACES_H */
index 5699ec3a71af3b42c6afb98b33a87ceceb58c175..3be81803595d5b6b41044804124d0ab93745f5dd 100644 (file)
@@ -37,7 +37,7 @@
 
 /*
  * This is used for calculating the real page sizes
- * for FTLB or VTLB + FTLB confugrations.
+ * for FTLB or VTLB + FTLB configurations.
  */
 static inline unsigned int page_size_ftlb(unsigned int mmuextdef)
 {
@@ -223,7 +223,8 @@ static inline int pfn_valid(unsigned long pfn)
 
 #endif
 
-#define virt_to_page(kaddr)    pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
+#define virt_to_page(kaddr)    pfn_to_page(PFN_DOWN(virt_to_phys((void *)     \
+                                                                 (kaddr))))
 
 extern int __virt_addr_valid(const volatile void *kaddr);
 #define virt_addr_valid(kaddr)                                         \
index 1e0f20a9cddaa0caac16e0e5adfe09537cdce1dc..eacf865d21c2fc533a36d6b2138253dacba667a9 100644 (file)
@@ -37,11 +37,6 @@ extern int __cpu_logical_map[NR_CPUS];
 
 #define NO_PROC_ID     (-1)
 
-#define topology_physical_package_id(cpu)      (cpu_data[cpu].package)
-#define topology_core_id(cpu)                  (cpu_data[cpu].core)
-#define topology_core_cpumask(cpu)             (&cpu_core_map[cpu])
-#define topology_thread_cpumask(cpu)           (&cpu_sibling_map[cpu])
-
 #define SMP_RESCHEDULE_YOURSELF 0x1    /* XXX braindead */
 #define SMP_CALL_FUNCTION      0x2
 /* Octeon - Tell another core to flush its icache */
index 495c1041a2cc24e3ca1207ac31e7e3ff41f45382..b928b6f898cd5266efe89465d2dc87089f8f357c 100644 (file)
@@ -92,7 +92,7 @@ do {                                                                  \
                        KSTK_STATUS(prev) &= ~ST0_CU2;                  \
                __c0_stat = read_c0_status();                           \
                write_c0_status(__c0_stat | ST0_CU2);                   \
-               cop2_save(&prev->thread.cp2);                           \
+               cop2_save(prev);                                        \
                write_c0_status(__c0_stat & ~ST0_CU2);                  \
        }                                                               \
        __clear_software_ll_bit();                                      \
@@ -111,7 +111,7 @@ do {                                                                        \
                        (KSTK_STATUS(current) & ST0_CU2)) {             \
                __c0_stat = read_c0_status();                           \
                write_c0_status(__c0_stat | ST0_CU2);                   \
-               cop2_restore(&current->thread.cp2);                     \
+               cop2_restore(current);                                  \
                write_c0_status(__c0_stat & ~ST0_CU2);                  \
        }                                                               \
        if (cpu_has_dsp)                                                \
index 20ea4859c82259534425ceb3833aa098f7400cf2..3e307ec2afbae2f7308df902f450006bafd006f9 100644 (file)
@@ -9,5 +9,13 @@
 #define __ASM_TOPOLOGY_H
 
 #include <topology.h>
+#include <linux/smp.h>
+
+#ifdef CONFIG_SMP
+#define topology_physical_package_id(cpu)      (cpu_data[cpu].package)
+#define topology_core_id(cpu)                  (cpu_data[cpu].core)
+#define topology_core_cpumask(cpu)             (&cpu_core_map[cpu])
+#define topology_thread_cpumask(cpu)           (&cpu_sibling_map[cpu])
+#endif
 
 #endif /* __ASM_TOPOLOGY_H */
index 9bc13eaf9d6776e8e9e2dd2dbde8401784dfb45c..fdb4923777d1347822517b9671b80f378c74d16b 100644 (file)
 #define __NR_sched_getattr             (__NR_Linux + 350)
 #define __NR_renameat2                 (__NR_Linux + 351)
 #define __NR_seccomp                   (__NR_Linux + 352)
+#define __NR_getrandom                 (__NR_Linux + 353)
+#define __NR_memfd_create              (__NR_Linux + 354)
 
 /*
  * Offset of the last Linux o32 flavoured syscall
  */
-#define __NR_Linux_syscalls            352
+#define __NR_Linux_syscalls            354
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
 
 #define __NR_O32_Linux                 4000
-#define __NR_O32_Linux_syscalls                352
+#define __NR_O32_Linux_syscalls                354
 
 #if _MIPS_SIM == _MIPS_SIM_ABI64
 
 #define __NR_sched_getattr             (__NR_Linux + 310)
 #define __NR_renameat2                 (__NR_Linux + 311)
 #define __NR_seccomp                   (__NR_Linux + 312)
+#define __NR_getrandom                 (__NR_Linux + 313)
+#define __NR_memfd_create              (__NR_Linux + 314)
 
 /*
  * Offset of the last Linux 64-bit flavoured syscall
  */
-#define __NR_Linux_syscalls            312
+#define __NR_Linux_syscalls            314
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
 
 #define __NR_64_Linux                  5000
-#define __NR_64_Linux_syscalls         312
+#define __NR_64_Linux_syscalls         314
 
 #if _MIPS_SIM == _MIPS_SIM_NABI32
 
 #define __NR_sched_getattr             (__NR_Linux + 314)
 #define __NR_renameat2                 (__NR_Linux + 315)
 #define __NR_seccomp                   (__NR_Linux + 316)
+#define __NR_getrandom                 (__NR_Linux + 317)
+#define __NR_memfd_create              (__NR_Linux + 318)
 
 /*
  * Offset of the last N32 flavoured syscall
  */
-#define __NR_Linux_syscalls            316
+#define __NR_Linux_syscalls            318
 
 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
 
 #define __NR_N32_Linux                 6000
-#define __NR_N32_Linux_syscalls                316
+#define __NR_N32_Linux_syscalls                318
 
 #endif /* _UAPI_ASM_UNISTD_H */
index 992e18474da5da89f1ff4b878dbbc8e8db47e919..50980bf3983ef3654d4f24c1dbf95e4576d0c3a8 100644 (file)
@@ -71,8 +71,12 @@ machine_kexec(struct kimage *image)
        kexec_start_address =
                (unsigned long) phys_to_virt(image->start);
 
-       kexec_indirection_page =
-               (unsigned long) phys_to_virt(image->head & PAGE_MASK);
+       if (image->type == KEXEC_TYPE_DEFAULT) {
+               kexec_indirection_page =
+                       (unsigned long) phys_to_virt(image->head & PAGE_MASK);
+       } else {
+               kexec_indirection_page = (unsigned long)&image->head;
+       }
 
        memcpy((void*)reboot_code_buffer, relocate_new_kernel,
               relocate_new_kernel_size);
index f93b4cbec739efedeb3cc2f7347aa3c573182c81..744cd10ba599e260b97e0a53da6d872792f7bd54 100644 (file)
@@ -577,3 +577,5 @@ EXPORT(sys_call_table)
        PTR     sys_sched_getattr               /* 4350 */
        PTR     sys_renameat2
        PTR     sys_seccomp
+       PTR     sys_getrandom
+       PTR     sys_memfd_create
index 03ebd9979ad29553139a009b5fe27e1685c56958..002b1bc09c387c44dcd5ac4157a97ef8223344cb 100644 (file)
@@ -432,4 +432,6 @@ EXPORT(sys_call_table)
        PTR     sys_sched_getattr               /* 5310 */
        PTR     sys_renameat2
        PTR     sys_seccomp
+       PTR     sys_getrandom
+       PTR     sys_memfd_create
        .size   sys_call_table,.-sys_call_table
index ebc9228e2e150b5d2f853781066aaddcf500d41b..ca6cbbe9805bf8cdc28657468e93390c1ff117eb 100644 (file)
@@ -425,4 +425,6 @@ EXPORT(sysn32_call_table)
        PTR     sys_sched_getattr
        PTR     sys_renameat2                   /* 6315 */
        PTR     sys_seccomp
+       PTR     sys_getrandom
+       PTR     sys_memfd_create
        .size   sysn32_call_table,.-sysn32_call_table
index 25bb8400156da3905d1ba2d586da26a4672b4379..9e10d11fbb84799840f48ca08143bf44aeddc644 100644 (file)
@@ -562,4 +562,6 @@ EXPORT(sys32_call_table)
        PTR     sys_sched_getattr               /* 4350 */
        PTR     sys_renameat2
        PTR     sys_seccomp
+       PTR     sys_getrandom
+       PTR     sys_memfd_create
        .size   sys32_call_table,.-sys32_call_table
index 05a56619ece2f72044641c6aa1fd2d99f558bb69..9f7ecbda250c2569daae114e9fae539407d00766 100644 (file)
@@ -793,6 +793,7 @@ static int build_body(struct jit_ctx *ctx)
        const struct sock_filter *inst;
        unsigned int i, off, load_order, condt;
        u32 k, b_off __maybe_unused;
+       int tmp;
 
        for (i = 0; i < prog->len; i++) {
                u16 code;
@@ -1332,9 +1333,9 @@ jmp_cmp:
                case BPF_ANC | SKF_AD_PKTTYPE:
                        ctx->flags |= SEEN_SKB;
 
-                       off = pkt_type_offset();
+                       tmp = off = pkt_type_offset();
 
-                       if (off < 0)
+                       if (tmp < 0)
                                return -1;
                        emit_load_byte(r_tmp, r_skb, off, ctx);
                        /* Keep only the last 3 bits */
index f277184e2ac1356686d9b200bccf54bdf7bf7f9f..dca9842d8f91de05592aae52a3df7a166af1b91d 100644 (file)
@@ -1032,7 +1032,6 @@ struct boot_params *make_boot_params(struct efi_config *c)
        int i;
        unsigned long ramdisk_addr;
        unsigned long ramdisk_size;
-       unsigned long initrd_addr_max;
 
        efi_early = c;
        sys_table = (efi_system_table_t *)(unsigned long)efi_early->table;
@@ -1095,15 +1094,20 @@ struct boot_params *make_boot_params(struct efi_config *c)
 
        memset(sdt, 0, sizeof(*sdt));
 
-       if (hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G)
-               initrd_addr_max = -1UL;
-       else
-               initrd_addr_max = hdr->initrd_addr_max;
-
        status = handle_cmdline_files(sys_table, image,
                                      (char *)(unsigned long)hdr->cmd_line_ptr,
-                                     "initrd=", initrd_addr_max,
+                                     "initrd=", hdr->initrd_addr_max,
                                      &ramdisk_addr, &ramdisk_size);
+
+       if (status != EFI_SUCCESS &&
+           hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) {
+               efi_printk(sys_table, "Trying to load files to higher address\n");
+               status = handle_cmdline_files(sys_table, image,
+                                     (char *)(unsigned long)hdr->cmd_line_ptr,
+                                     "initrd=", -1UL,
+                                     &ramdisk_addr, &ramdisk_size);
+       }
+
        if (status != EFI_SUCCESS)
                goto fail2;
        hdr->ramdisk_image = ramdisk_addr & 0xffffffff;
index cbed1407a5cdb7ead8fa0cae90d2e7902133aaa7..d6b8aa4c986c038fa12d3f76242ea7d738f2b329 100644 (file)
 #include <asm/boot.h>
 #include <asm/asm-offsets.h>
 
+/*
+ * Adjust our own GOT
+ *
+ * The relocation base must be in %ebx
+ *
+ * It is safe to call this macro more than once, because in some of the
+ * code paths multiple invocations are inevitable, e.g. via the efi*
+ * entry points.
+ *
+ * Relocation is only performed the first time.
+ */
+.macro FIXUP_GOT
+       cmpb    $1, got_fixed(%ebx)
+       je      2f
+
+       leal    _got(%ebx), %edx
+       leal    _egot(%ebx), %ecx
+1:
+       cmpl    %ecx, %edx
+       jae     2f
+       addl    %ebx, (%edx)
+       addl    $4, %edx
+       jmp     1b
+2:
+       movb    $1, got_fixed(%ebx)
+.endm
+
        __HEAD
 ENTRY(startup_32)
 #ifdef CONFIG_EFI_STUB
@@ -56,6 +83,9 @@ ENTRY(efi_pe_entry)
        add     %esi, 88(%eax)
        pushl   %eax
 
+       movl    %esi, %ebx
+       FIXUP_GOT
+
        call    make_boot_params
        cmpl    $0, %eax
        je      fail
@@ -81,6 +111,10 @@ ENTRY(efi32_stub_entry)
        leal    efi32_config(%esi), %eax
        add     %esi, 88(%eax)
        pushl   %eax
+
+       movl    %esi, %ebx
+       FIXUP_GOT
+
 2:
        call    efi_main
        cmpl    $0, %eax
@@ -190,19 +224,7 @@ relocated:
        shrl    $2, %ecx
        rep     stosl
 
-/*
- * Adjust our own GOT
- */
-       leal    _got(%ebx), %edx
-       leal    _egot(%ebx), %ecx
-1:
-       cmpl    %ecx, %edx
-       jae     2f
-       addl    %ebx, (%edx)
-       addl    $4, %edx
-       jmp     1b
-2:
-
+       FIXUP_GOT
 /*
  * Do the decompression, and jump to the new kernel..
  */
@@ -225,8 +247,12 @@ relocated:
        xorl    %ebx, %ebx
        jmp     *%eax
 
-#ifdef CONFIG_EFI_STUB
        .data
+/* Have we relocated the GOT? */
+got_fixed:
+       .byte 0
+
+#ifdef CONFIG_EFI_STUB
 efi32_config:
        .fill 11,8,0
        .long efi_call_phys
index 2884e0c3e8a5880411ce63955b01c103e6eabd00..50f69c7eaaf4bc98b14ad68f76cd2d262982a19a 100644 (file)
 #include <asm/processor-flags.h>
 #include <asm/asm-offsets.h>
 
+/*
+ * Adjust our own GOT
+ *
+ * The relocation base must be in %rbx
+ *
+ * It is safe to call this macro more than once, because in some of the
+ * code paths multiple invocations are inevitable, e.g. via the efi*
+ * entry points.
+ *
+ * Relocation is only performed the first time.
+ */
+.macro FIXUP_GOT
+       cmpb    $1, got_fixed(%rip)
+       je      2f
+
+       leaq    _got(%rip), %rdx
+       leaq    _egot(%rip), %rcx
+1:
+       cmpq    %rcx, %rdx
+       jae     2f
+       addq    %rbx, (%rdx)
+       addq    $8, %rdx
+       jmp     1b
+2:
+       movb    $1, got_fixed(%rip)
+.endm
+
        __HEAD
        .code32
 ENTRY(startup_32)
@@ -252,10 +279,13 @@ ENTRY(efi_pe_entry)
        subq    $1b, %rbp
 
        /*
-        * Relocate efi_config->call().
+        * Relocate efi_config->call() and the GOT entries.
         */
        addq    %rbp, efi64_config+88(%rip)
 
+       movq    %rbp, %rbx
+       FIXUP_GOT
+
        movq    %rax, %rdi
        call    make_boot_params
        cmpq    $0,%rax
@@ -271,10 +301,13 @@ handover_entry:
        subq    $1b, %rbp
 
        /*
-        * Relocate efi_config->call().
+        * Relocate efi_config->call() and the GOT entries.
         */
        movq    efi_config(%rip), %rax
        addq    %rbp, 88(%rax)
+
+       movq    %rbp, %rbx
+       FIXUP_GOT
 2:
        movq    efi_config(%rip), %rdi
        call    efi_main
@@ -385,19 +418,8 @@ relocated:
        shrq    $3, %rcx
        rep     stosq
 
-/*
- * Adjust our own GOT
- */
-       leaq    _got(%rip), %rdx
-       leaq    _egot(%rip), %rcx
-1:
-       cmpq    %rcx, %rdx
-       jae     2f
-       addq    %rbx, (%rdx)
-       addq    $8, %rdx
-       jmp     1b
-2:
-       
+       FIXUP_GOT
+
 /*
  * Do the decompression, and jump to the new kernel..
  */
@@ -437,6 +459,10 @@ gdt:
        .quad   0x0000000000000000      /* TS continued */
 gdt_end:
 
+/* Have we relocated the GOT? */
+got_fixed:
+       .byte   0
+
 #ifdef CONFIG_EFI_STUB
 efi_config:
        .quad   0
index 478c490f36547930e7101c4ad051292810fb04db..1733ab49ac5e3f878eb7c3ad69bf23df068ea258 100644 (file)
@@ -239,6 +239,7 @@ static inline int mp_find_ioapic(u32 gsi) { return 0; }
 static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; }
 static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; }
 static inline void mp_unmap_irq(int irq) { }
+static inline bool mp_should_keep_irq(struct device *dev) { return 1; }
 
 static inline int save_ioapic_entries(void)
 {
index f304773285ae360810e4290b67aa4c6f0e832ef0..f1314d0bcf0ab64c7ff65099b9b3dd835f192c72 100644 (file)
@@ -338,8 +338,10 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
         * a relative jump.
         */
        rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE;
-       if (abs(rel) > 0x7fffffff)
+       if (abs(rel) > 0x7fffffff) {
+               __arch_remove_optimized_kprobe(op, 0);
                return -ERANGE;
+       }
 
        buf = (u8 *)op->optinsn.insn;
 
index 167ffcac16ed1912d0c5b10761edce535909d8a6..95a427e57887a664af5f1f7d01df90a7a9dd7d34 100644 (file)
@@ -48,7 +48,9 @@ enum address_markers_idx {
        LOW_KERNEL_NR,
        VMALLOC_START_NR,
        VMEMMAP_START_NR,
+# ifdef CONFIG_X86_ESPFIX64
        ESPFIX_START_NR,
+# endif
        HIGH_KERNEL_NR,
        MODULES_VADDR_NR,
        MODULES_END_NR,
@@ -71,7 +73,9 @@ static struct addr_marker address_markers[] = {
        { PAGE_OFFSET,          "Low Kernel Mapping" },
        { VMALLOC_START,        "vmalloc() Area" },
        { VMEMMAP_START,        "Vmemmap" },
+# ifdef CONFIG_X86_ESPFIX64
        { ESPFIX_BASE_ADDR,     "ESPfix Area", 16 },
+# endif
        { __START_KERNEL_map,   "High Kernel Mapping" },
        { MODULES_VADDR,        "Modules" },
        { MODULES_END,          "End Modules" },
index 25e7e1372bb26e961b580c753407edf28a320aa3..919b91205cd4be57760c50956eddb2d02dc13c45 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/sched.h>
 #include <asm/elf.h>
 
-struct __read_mostly va_alignment va_align = {
+struct va_alignment __read_mostly va_align = {
        .flags = -1,
 };
 
index c61ea57d1ba1d9e8124a039d6aec59d1163c1c75..9a2b7101ae8af6d402f15c66831bcd15b7790325 100644 (file)
@@ -326,27 +326,6 @@ static void pci_fixup_video(struct pci_dev *pdev)
        struct pci_bus *bus;
        u16 config;
 
-       if (!vga_default_device()) {
-               resource_size_t start, end;
-               int i;
-
-               /* Does firmware framebuffer belong to us? */
-               for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
-                       if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
-                               continue;
-
-                       start = pci_resource_start(pdev, i);
-                       end  = pci_resource_end(pdev, i);
-
-                       if (!start || !end)
-                               continue;
-
-                       if (screen_info.lfb_base >= start &&
-                           (screen_info.lfb_base + screen_info.lfb_size) < end)
-                               vga_set_default_device(pdev);
-               }
-       }
-
        /* Is VGA routed to us? */
        bus = pdev->bus;
        while (bus) {
@@ -371,8 +350,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
                pci_read_config_word(pdev, PCI_COMMAND, &config);
                if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
                        pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
-                       dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
-                       vga_set_default_device(pdev);
+                       dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
                }
        }
 }
index 7894db9ca90b1e13c742841e41b309b39584e622..a53ee099e28131f198aa48772f68b605cfdf6fc3 100644 (file)
@@ -1922,9 +1922,6 @@ static inline int __init drbg_healthcheck_sanity(void)
        /* overflow max addtllen with personalization string */
        ret = drbg_instantiate(drbg, &addtl, coreref, pr);
        BUG_ON(0 == ret);
-       /* test uninstantated DRBG */
-       len = drbg_generate(drbg, buf, (max_request_bytes + 1), NULL);
-       BUG_ON(0 < len);
        /* all tests passed */
        rc = 0;
 
index 8581f5b84f48b6d2b66fa4b1f7c120f6b0928bf6..8b67bd0f6bb5e629d77de4b18490c0f64e329ad6 100644 (file)
@@ -177,16 +177,6 @@ void acpi_bus_detach_private_data(acpi_handle handle)
 }
 EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data);
 
-void acpi_bus_no_hotplug(acpi_handle handle)
-{
-       struct acpi_device *adev = NULL;
-
-       acpi_bus_get_device(handle, &adev);
-       if (adev)
-               adev->flags.no_hotplug = true;
-}
-EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug);
-
 static void acpi_print_osc_error(acpi_handle handle,
        struct acpi_osc_context *context, char *error)
 {
index 65ea7b256b3eab603100bfe451383bb1fa339ae8..0c94b661c16f87da22f1ed90a0c1d3512bcaf69e 100644 (file)
@@ -512,7 +512,14 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
                            map, &regmap_reg_ranges_fops);
 
        if (map->max_register || regmap_readable(map, 0)) {
-               debugfs_create_file("registers", 0400, map->debugfs,
+               umode_t registers_mode;
+
+               if (IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS))
+                       registers_mode = 0600;
+               else
+                       registers_mode = 0400;
+
+               debugfs_create_file("registers", registers_mode, map->debugfs,
                                    map, &regmap_map_fops);
                debugfs_create_file("access", 0400, map->debugfs,
                                    map, &regmap_access_fops);
index 2e3139eda93b687568aeda1698c5022eb9144c64..132c9ccfdc62b382cb22a9870e44038c6495a39d 100644 (file)
@@ -36,6 +36,7 @@ struct virtrng_info {
        int index;
        bool busy;
        bool hwrng_register_done;
+       bool hwrng_removed;
 };
 
 
@@ -68,6 +69,9 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait)
        int ret;
        struct virtrng_info *vi = (struct virtrng_info *)rng->priv;
 
+       if (vi->hwrng_removed)
+               return -ENODEV;
+
        if (!vi->busy) {
                vi->busy = true;
                init_completion(&vi->have_data);
@@ -137,6 +141,9 @@ static void remove_common(struct virtio_device *vdev)
 {
        struct virtrng_info *vi = vdev->priv;
 
+       vi->hwrng_removed = true;
+       vi->data_avail = 0;
+       complete(&vi->have_data);
        vdev->config->reset(vdev);
        vi->busy = false;
        if (vi->hwrng_register_done)
index a56bb3528755377b8fd6cb29dbd5fcb85692a55d..c846a9608cbd7bb23878954feefcee6eaddf5b88 100644 (file)
@@ -22,7 +22,7 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
                        unsigned long map_size, unsigned long desc_size,
                        u32 desc_ver)
 {
-       int node, prev;
+       int node, prev, num_rsv;
        int status;
        u32 fdt_val32;
        u64 fdt_val64;
@@ -73,6 +73,14 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
                prev = node;
        }
 
+       /*
+        * Delete all memory reserve map entries. When booting via UEFI,
+        * kernel will use the UEFI memory map to find reserved regions.
+        */
+       num_rsv = fdt_num_mem_rsv(fdt);
+       while (num_rsv-- > 0)
+               fdt_del_mem_rsv(fdt, num_rsv);
+
        node = fdt_subnode_offset(fdt, 0, "chosen");
        if (node < 0) {
                node = fdt_add_subnode(fdt, 0, "chosen");
index 9d7346b92653436ab6e753a2802c4ad6652279aa..6b7efcf363d61df33e493326b54daa8ce6f36825 100644 (file)
@@ -250,6 +250,7 @@ static void bochs_connector_init(struct drm_device *dev)
                           DRM_MODE_CONNECTOR_VIRTUAL);
        drm_connector_helper_add(connector,
                                 &bochs_connector_connector_helper_funcs);
+       drm_connector_register(connector);
 }
 
 
index e1c5c322212901beb63cc8757305fc18efd9a4ef..c7c5a9d91fa0082b2967a55fb8614bcdb6f74a1d 100644 (file)
@@ -555,6 +555,7 @@ static struct drm_connector *cirrus_vga_init(struct drm_device *dev)
 
        drm_connector_helper_add(connector, &cirrus_vga_connector_helper_funcs);
 
+       drm_connector_register(connector);
        return connector;
 }
 
index 81d7681faa638f1c7879b5cd0aafb3f56a948adf..fdff1d420c14ab3536717607975c6cfa273fb474 100644 (file)
@@ -1631,6 +1631,10 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
 
        pipe_config->adjusted_mode.flags |= flags;
 
+       if (!HAS_PCH_SPLIT(dev) && !IS_VALLEYVIEW(dev) &&
+           tmp & DP_COLOR_RANGE_16_235)
+               pipe_config->limited_color_range = true;
+
        pipe_config->has_dp_encoder = true;
 
        intel_dp_get_m_n(crtc, pipe_config);
index f9151f6641d9ba5b2ad6ebd341853378a2132fa2..ca34de7f6a7b7495da4378e9322d0044a0771333 100644 (file)
@@ -712,7 +712,8 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
                                  struct intel_crtc_config *pipe_config)
 {
        struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
-       struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
+       struct drm_device *dev = encoder->base.dev;
+       struct drm_i915_private *dev_priv = dev->dev_private;
        u32 tmp, flags = 0;
        int dotclock;
 
@@ -734,6 +735,10 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
        if (tmp & HDMI_MODE_SELECT_HDMI)
                pipe_config->has_audio = true;
 
+       if (!HAS_PCH_SPLIT(dev) &&
+           tmp & HDMI_COLOR_RANGE_16_235)
+               pipe_config->limited_color_range = true;
+
        pipe_config->adjusted_mode.flags |= flags;
 
        if ((tmp & SDVO_COLOR_FORMAT_MASK) == HDMI_COLOR_FORMAT_12bpc)
index 2d068edd1adc41bc8d71cd919a55361de093b19d..47a126a0493f811cad30474532477cfe5994734e 100644 (file)
@@ -1400,7 +1400,7 @@ i830_dispatch_execbuffer(struct intel_engine_cs *ring,
                 */
                intel_ring_emit(ring, SRC_COPY_BLT_CMD | BLT_WRITE_RGBA);
                intel_ring_emit(ring, BLT_DEPTH_32 | BLT_ROP_SRC_COPY | 4096);
-               intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 1024);
+               intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 4096);
                intel_ring_emit(ring, cs_offset);
                intel_ring_emit(ring, 4096);
                intel_ring_emit(ring, offset);
index 0a44459844e30958e8710af20265889fc1fec5ab..05a278bab2477f0b1d12f25d73e3c47b1a054873 100644 (file)
@@ -200,7 +200,6 @@ nvc0_bar_init(struct nouveau_object *object)
 
        nv_mask(priv, 0x000200, 0x00000100, 0x00000000);
        nv_mask(priv, 0x000200, 0x00000100, 0x00000100);
-       nv_mask(priv, 0x100c80, 0x00000001, 0x00000000);
 
        nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12);
        if (priv->bar[0].mem)
index b19a2b3c10813fb9327e415f1985afc76d8c65ee..32f28dc73ef23465cb0cb83c43818bd2154809da 100644 (file)
@@ -60,6 +60,7 @@ nvc0_fb_init(struct nouveau_object *object)
 
        if (priv->r100c10_page)
                nv_wr32(priv, 0x100c10, priv->r100c10 >> 8);
+       nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */
        return 0;
 }
 
index b54b582e72c4764e040769718d6dca566f1bb840..d5d65285efe59188072f90fc020939d14c3f1dec 100644 (file)
@@ -98,6 +98,7 @@ static int
 gf100_ltc_init(struct nouveau_object *object)
 {
        struct nvkm_ltc_priv *priv = (void *)object;
+       u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
        int ret;
 
        ret = nvkm_ltc_init(priv);
@@ -107,6 +108,7 @@ gf100_ltc_init(struct nouveau_object *object)
        nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */
        nv_wr32(priv, 0x17e8d8, priv->ltc_nr);
        nv_wr32(priv, 0x17e8d4, priv->tag_base);
+       nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
        return 0;
 }
 
index ea716569745df755d28e4acaf0c624132e5a95c4..b39b5d0eb8f91f82180e53cc2a35707207ce0258 100644 (file)
@@ -28,6 +28,7 @@ static int
 gk104_ltc_init(struct nouveau_object *object)
 {
        struct nvkm_ltc_priv *priv = (void *)object;
+       u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
        int ret;
 
        ret = nvkm_ltc_init(priv);
@@ -37,6 +38,7 @@ gk104_ltc_init(struct nouveau_object *object)
        nv_wr32(priv, 0x17e8d8, priv->ltc_nr);
        nv_wr32(priv, 0x17e000, priv->ltc_nr);
        nv_wr32(priv, 0x17e8d4, priv->tag_base);
+       nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
        return 0;
 }
 
index 4761b2e9af0049f65c2a001ad3b96a4450396e4b..a4de64289762fc9cfe82ab40e424b4fba67fe0f0 100644 (file)
@@ -98,6 +98,7 @@ static int
 gm107_ltc_init(struct nouveau_object *object)
 {
        struct nvkm_ltc_priv *priv = (void *)object;
+       u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
        int ret;
 
        ret = nvkm_ltc_init(priv);
@@ -106,6 +107,7 @@ gm107_ltc_init(struct nouveau_object *object)
 
        nv_wr32(priv, 0x17e27c, priv->ltc_nr);
        nv_wr32(priv, 0x17e278, priv->tag_base);
+       nv_mask(priv, 0x17e264, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
        return 0;
 }
 
index 279206997e5cd7d091d44e26f84ce5efdfb06f1d..622424692b3bddea7fb37e728e32909865da17ee 100644 (file)
@@ -46,7 +46,6 @@ static struct nouveau_dsm_priv {
        bool dsm_detected;
        bool optimus_detected;
        acpi_handle dhandle;
-       acpi_handle other_handle;
        acpi_handle rom_handle;
 } nouveau_dsm_priv;
 
@@ -222,10 +221,9 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev)
        if (!dhandle)
                return false;
 
-       if (!acpi_has_method(dhandle, "_DSM")) {
-               nouveau_dsm_priv.other_handle = dhandle;
+       if (!acpi_has_method(dhandle, "_DSM"))
                return false;
-       }
+
        if (acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102,
                           1 << NOUVEAU_DSM_POWER))
                retval |= NOUVEAU_DSM_HAS_MUX;
@@ -301,16 +299,6 @@ static bool nouveau_dsm_detect(void)
                printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n",
                        acpi_method_name);
                nouveau_dsm_priv.dsm_detected = true;
-               /*
-                * On some systems hotplug events are generated for the device
-                * being switched off when _DSM is executed.  They cause ACPI
-                * hotplug to trigger and attempt to remove the device from
-                * the system, which causes it to break down.  Prevent that from
-                * happening by setting the no_hotplug flag for the involved
-                * ACPI device objects.
-                */
-               acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle);
-               acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle);
                ret = true;
        }
 
index 250a5e88c7516f78aba08cf39b6a0b7696072fb4..9c3af96a71538999f70a8786b03756eeaec71f75 100644 (file)
@@ -627,6 +627,7 @@ int nouveau_pmops_suspend(struct device *dev)
 
        pci_save_state(pdev);
        pci_disable_device(pdev);
+       pci_ignore_hotplug(pdev);
        pci_set_power_state(pdev, PCI_D3hot);
        return 0;
 }
index 18d55d4472483ea5ef43c72087807eb0971ec9b4..c7592ec8ecb8e430a49e836e05d64914dd2693ac 100644 (file)
@@ -108,7 +108,16 @@ void
 nouveau_vga_fini(struct nouveau_drm *drm)
 {
        struct drm_device *dev = drm->dev;
+       bool runtime = false;
+
+       if (nouveau_runtime_pm == 1)
+               runtime = true;
+       if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm()))
+               runtime = true;
+
        vga_switcheroo_unregister_client(dev->pdev);
+       if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
+               vga_switcheroo_fini_domain_pm_ops(drm->dev->dev);
        vga_client_register(dev->pdev, NULL, NULL, NULL);
 }
 
index 192278bc993ce581e42b9eb2e47a207533a45cd5..c4ffa54b1e3df503dc5dd9645765b2f0927e87b2 100644 (file)
@@ -489,13 +489,6 @@ int cik_sdma_resume(struct radeon_device *rdev)
 {
        int r;
 
-       /* Reset dma */
-       WREG32(SRBM_SOFT_RESET, SOFT_RESET_SDMA | SOFT_RESET_SDMA1);
-       RREG32(SRBM_SOFT_RESET);
-       udelay(50);
-       WREG32(SRBM_SOFT_RESET, 0);
-       RREG32(SRBM_SOFT_RESET);
-
        r = cik_sdma_load_microcode(rdev);
        if (r)
                return r;
index 8b58e11b64fa5a13611941b3aca6b04d2c1600a0..67cb472d188ce05ec36c5a812ae5751fbb618254 100644 (file)
@@ -33,6 +33,8 @@
 #define KV_MINIMUM_ENGINE_CLOCK         800
 #define SMC_RAM_END                     0x40000
 
+static int kv_enable_nb_dpm(struct radeon_device *rdev,
+                           bool enable);
 static void kv_init_graphics_levels(struct radeon_device *rdev);
 static int kv_calculate_ds_divider(struct radeon_device *rdev);
 static int kv_calculate_nbps_level_settings(struct radeon_device *rdev);
@@ -1295,6 +1297,9 @@ void kv_dpm_disable(struct radeon_device *rdev)
 {
        kv_smc_bapm_enable(rdev, false);
 
+       if (rdev->family == CHIP_MULLINS)
+               kv_enable_nb_dpm(rdev, false);
+
        /* powerup blocks */
        kv_dpm_powergate_acp(rdev, false);
        kv_dpm_powergate_samu(rdev, false);
@@ -1769,15 +1774,24 @@ static int kv_update_dfs_bypass_settings(struct radeon_device *rdev,
        return ret;
 }
 
-static int kv_enable_nb_dpm(struct radeon_device *rdev)
+static int kv_enable_nb_dpm(struct radeon_device *rdev,
+                           bool enable)
 {
        struct kv_power_info *pi = kv_get_pi(rdev);
        int ret = 0;
 
-       if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) {
-               ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable);
-               if (ret == 0)
-                       pi->nb_dpm_enabled = true;
+       if (enable) {
+               if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) {
+                       ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable);
+                       if (ret == 0)
+                               pi->nb_dpm_enabled = true;
+               }
+       } else {
+               if (pi->enable_nb_dpm && pi->nb_dpm_enabled) {
+                       ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Disable);
+                       if (ret == 0)
+                               pi->nb_dpm_enabled = false;
+               }
        }
 
        return ret;
@@ -1864,7 +1878,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev)
                        }
                        kv_update_sclk_t(rdev);
                        if (rdev->family == CHIP_MULLINS)
-                               kv_enable_nb_dpm(rdev);
+                               kv_enable_nb_dpm(rdev, true);
                }
        } else {
                if (pi->enable_dpm) {
@@ -1889,7 +1903,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev)
                        }
                        kv_update_acp_boot_level(rdev);
                        kv_update_sclk_t(rdev);
-                       kv_enable_nb_dpm(rdev);
+                       kv_enable_nb_dpm(rdev, true);
                }
        }
 
index 8a3e6221cece2c9eb09ca94a2d8b749dd6ea60e1..f26f0a9fb522ae4671740a7decd4ec18455656b0 100644 (file)
@@ -191,12 +191,6 @@ int cayman_dma_resume(struct radeon_device *rdev)
        u32 reg_offset, wb_offset;
        int i, r;
 
-       /* Reset dma */
-       WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA | SOFT_RESET_DMA1);
-       RREG32(SRBM_SOFT_RESET);
-       udelay(50);
-       WREG32(SRBM_SOFT_RESET, 0);
-
        for (i = 0; i < 2; i++) {
                if (i == 0) {
                        ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX];
index 4c5ec44ff328b3c63203e4c7c92f5283126e65e9..b0098e792e62337a6b4d511ca62baa7f37bc4eba 100644 (file)
@@ -821,6 +821,20 @@ u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc)
                return RREG32(RADEON_CRTC2_CRNT_FRAME);
 }
 
+/**
+ * r100_ring_hdp_flush - flush Host Data Path via the ring buffer
+ * rdev: radeon device structure
+ * ring: ring buffer struct for emitting packets
+ */
+static void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring)
+{
+       radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0));
+       radeon_ring_write(ring, rdev->config.r100.hdp_cntl |
+                               RADEON_HDP_READ_BUFFER_INVALIDATE);
+       radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0));
+       radeon_ring_write(ring, rdev->config.r100.hdp_cntl);
+}
+
 /* Who ever call radeon_fence_emit should call ring_lock and ask
  * for enough space (today caller are ib schedule and buffer move) */
 void r100_fence_ring_emit(struct radeon_device *rdev,
@@ -1056,20 +1070,6 @@ void r100_gfx_set_wptr(struct radeon_device *rdev,
        (void)RREG32(RADEON_CP_RB_WPTR);
 }
 
-/**
- * r100_ring_hdp_flush - flush Host Data Path via the ring buffer
- * rdev: radeon device structure
- * ring: ring buffer struct for emitting packets
- */
-void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring)
-{
-       radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0));
-       radeon_ring_write(ring, rdev->config.r100.hdp_cntl |
-                               RADEON_HDP_READ_BUFFER_INVALIDATE);
-       radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0));
-       radeon_ring_write(ring, rdev->config.r100.hdp_cntl);
-}
-
 static void r100_cp_load_microcode(struct radeon_device *rdev)
 {
        const __be32 *fw_data;
index 51fd98553eaf6c4a34e73c5baeecf95b94220e29..a908daa006d23980bd51fe50d93e94ea3464aac5 100644 (file)
@@ -124,15 +124,6 @@ int r600_dma_resume(struct radeon_device *rdev)
        u32 rb_bufsz;
        int r;
 
-       /* Reset dma */
-       if (rdev->family >= CHIP_RV770)
-               WREG32(SRBM_SOFT_RESET, RV770_SOFT_RESET_DMA);
-       else
-               WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA);
-       RREG32(SRBM_SOFT_RESET);
-       udelay(50);
-       WREG32(SRBM_SOFT_RESET, 0);
-
        WREG32(DMA_SEM_INCOMPLETE_TIMER_CNTL, 0);
        WREG32(DMA_SEM_WAIT_FAIL_TIMER_CNTL, 0);
 
index 0c4a7d8d93e0465e9f2d094fe127f283602b3239..31e1052ad3e3780cec522ab8a2e04bb62698c573 100644 (file)
 #define R6XX_MAX_PIPES                         8
 #define R6XX_MAX_PIPES_MASK                    0xff
 
-/* PTE flags */
-#define PTE_VALID                              (1 << 0)
-#define PTE_SYSTEM                             (1 << 1)
-#define PTE_SNOOPED                            (1 << 2)
-#define PTE_READABLE                           (1 << 5)
-#define PTE_WRITEABLE                          (1 << 6)
-
 /* tiling bits */
 #define     ARRAY_LINEAR_GENERAL              0x00000000
 #define     ARRAY_LINEAR_ALIGNED              0x00000001
index eeeeabe09758ddccf2175ad48d9b9bd62e896e83..2dd5847f9b98e8a428e63b9ff9563f52b94d2709 100644 (file)
@@ -185,7 +185,6 @@ static struct radeon_asic_ring r100_gfx_ring = {
        .get_rptr = &r100_gfx_get_rptr,
        .get_wptr = &r100_gfx_get_wptr,
        .set_wptr = &r100_gfx_set_wptr,
-       .hdp_flush = &r100_ring_hdp_flush,
 };
 
 static struct radeon_asic r100_asic = {
@@ -332,7 +331,6 @@ static struct radeon_asic_ring r300_gfx_ring = {
        .get_rptr = &r100_gfx_get_rptr,
        .get_wptr = &r100_gfx_get_wptr,
        .set_wptr = &r100_gfx_set_wptr,
-       .hdp_flush = &r100_ring_hdp_flush,
 };
 
 static struct radeon_asic r300_asic = {
index 275a5dc01780f7bedbed2cb3486c4c3d383710eb..7756bc1e1cd3ef088ac4bb96fa04a9ab632ad088 100644 (file)
@@ -148,8 +148,7 @@ u32 r100_gfx_get_wptr(struct radeon_device *rdev,
                      struct radeon_ring *ring);
 void r100_gfx_set_wptr(struct radeon_device *rdev,
                       struct radeon_ring *ring);
-void r100_ring_hdp_flush(struct radeon_device *rdev,
-                        struct radeon_ring *ring);
+
 /*
  * r200,rv250,rs300,rv280
  */
index a9fb0d016d387683a1d4bb96f77c046b7cd804b7..8bc7d0bbd3c80a94529cea79bf4f078d7951a87a 100644 (file)
@@ -33,7 +33,6 @@ static struct radeon_atpx_priv {
        bool atpx_detected;
        /* handle for device - and atpx */
        acpi_handle dhandle;
-       acpi_handle other_handle;
        struct radeon_atpx atpx;
 } radeon_atpx_priv;
 
@@ -453,10 +452,9 @@ static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev)
                return false;
 
        status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
-       if (ACPI_FAILURE(status)) {
-               radeon_atpx_priv.other_handle = dhandle;
+       if (ACPI_FAILURE(status))
                return false;
-       }
+
        radeon_atpx_priv.dhandle = dhandle;
        radeon_atpx_priv.atpx.handle = atpx_handle;
        return true;
@@ -540,16 +538,6 @@ static bool radeon_atpx_detect(void)
                printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n",
                       acpi_method_name);
                radeon_atpx_priv.atpx_detected = true;
-               /*
-                * On some systems hotplug events are generated for the device
-                * being switched off when ATPX is executed.  They cause ACPI
-                * hotplug to trigger and attempt to remove the device from
-                * the system, which causes it to break down.  Prevent that from
-                * happening by setting the no_hotplug flag for the involved
-                * ACPI device objects.
-                */
-               acpi_bus_no_hotplug(radeon_atpx_priv.dhandle);
-               acpi_bus_no_hotplug(radeon_atpx_priv.other_handle);
                return true;
        }
        return false;
index 6a219bcee66d2d8a5d7b8bf49f2344584a0a36fd..75223dd3a8a35e5c5930942140c91f2a42416bad 100644 (file)
@@ -1393,7 +1393,7 @@ int radeon_device_init(struct radeon_device *rdev,
 
        r = radeon_init(rdev);
        if (r)
-               return r;
+               goto failed;
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -1413,7 +1413,7 @@ int radeon_device_init(struct radeon_device *rdev,
                radeon_agp_disable(rdev);
                r = radeon_init(rdev);
                if (r)
-                       return r;
+                       goto failed;
        }
 
        if ((radeon_testing & 1)) {
@@ -1435,6 +1435,11 @@ int radeon_device_init(struct radeon_device *rdev,
                        DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n");
        }
        return 0;
+
+failed:
+       if (runtime)
+               vga_switcheroo_fini_domain_pm_ops(rdev->dev);
+       return r;
 }
 
 static void radeon_debugfs_remove_files(struct radeon_device *rdev);
@@ -1455,6 +1460,8 @@ void radeon_device_fini(struct radeon_device *rdev)
        radeon_bo_evict_vram(rdev);
        radeon_fini(rdev);
        vga_switcheroo_unregister_client(rdev->pdev);
+       if (rdev->flags & RADEON_IS_PX)
+               vga_switcheroo_fini_domain_pm_ops(rdev->dev);
        vga_client_register(rdev->pdev, NULL, NULL, NULL);
        if (rdev->rio_mem)
                pci_iounmap(rdev->pdev, rdev->rio_mem);
index 8df888908833f5d1a3e8d9f745edb5fe9b6143ea..4126fd0937a222c87841ea17cce31ab2f57c9aef 100644 (file)
@@ -83,7 +83,7 @@
  *            CIK: 1D and linear tiling modes contain valid PIPE_CONFIG
  *   2.39.0 - Add INFO query for number of active CUs
  *   2.40.0 - Add RADEON_GEM_GTT_WC/UC, flush HDP cache before submitting
- *            CS to GPU
+ *            CS to GPU on >= r600
  */
 #define KMS_DRIVER_MAJOR       2
 #define KMS_DRIVER_MINOR       40
@@ -440,6 +440,7 @@ static int radeon_pmops_runtime_suspend(struct device *dev)
        ret = radeon_suspend_kms(drm_dev, false, false);
        pci_save_state(pdev);
        pci_disable_device(pdev);
+       pci_ignore_hotplug(pdev);
        pci_set_power_state(pdev, PCI_D3cold);
        drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
 
index 6c1fc339d228142fe09de798a62ad4df8880959b..c5799f16aa4b2f27157b3946ec4c7b65ac85011f 100644 (file)
@@ -221,9 +221,9 @@ void rs400_gart_set_page(struct radeon_device *rdev, unsigned i,
        entry = (lower_32_bits(addr) & PAGE_MASK) |
                ((upper_32_bits(addr) & 0xff) << 4);
        if (flags & RADEON_GART_PAGE_READ)
-               addr |= RS400_PTE_READABLE;
+               entry |= RS400_PTE_READABLE;
        if (flags & RADEON_GART_PAGE_WRITE)
-               addr |= RS400_PTE_WRITEABLE;
+               entry |= RS400_PTE_WRITEABLE;
        if (!(flags & RADEON_GART_PAGE_SNOOP))
                entry |= RS400_PTE_UNSNOOPED;
        entry = cpu_to_le32(entry);
index ef93156a69c6fdad9dd2af368ef68e8ecd9a9b9a..b22968c08d1fb7babe739939992a060eb9756cd3 100644 (file)
@@ -298,7 +298,6 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi)
        hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD2(HDMI_IFRAME_SLOT_AVI));
 
        val = frame[0xC];
-       val |= frame[0xD] << 8;
        hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD3(HDMI_IFRAME_SLOT_AVI));
 
        /* Enable transmission slot for AVI infoframe
index 6866448083b2c1d6ad99686c2854db9ad94a5bb7..37ac7b5dbd066025c90009d6b44a1c08fffcc800 100644 (file)
@@ -660,6 +660,12 @@ int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *
 }
 EXPORT_SYMBOL(vga_switcheroo_init_domain_pm_ops);
 
+void vga_switcheroo_fini_domain_pm_ops(struct device *dev)
+{
+       dev->pm_domain = NULL;
+}
+EXPORT_SYMBOL(vga_switcheroo_fini_domain_pm_ops);
+
 static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
index d2077f040f3ec87f0922b8eb67db413539851e53..77711623b9739526f8605fef680120424e4f9a59 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/poll.h>
 #include <linux/miscdevice.h>
 #include <linux/slab.h>
+#include <linux/screen_info.h>
 
 #include <linux/uaccess.h>
 
@@ -112,10 +113,8 @@ both:
        return 1;
 }
 
-#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
 /* this is only used a cookie - it should not be dereferenced */
 static struct pci_dev *vga_default;
-#endif
 
 static void vga_arb_device_card_gone(struct pci_dev *pdev);
 
@@ -131,7 +130,6 @@ static struct vga_device *vgadev_find(struct pci_dev *pdev)
 }
 
 /* Returns the default VGA device (vgacon's babe) */
-#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
 struct pci_dev *vga_default_device(void)
 {
        return vga_default;
@@ -147,7 +145,6 @@ void vga_set_default_device(struct pci_dev *pdev)
        pci_dev_put(vga_default);
        vga_default = pci_dev_get(pdev);
 }
-#endif
 
 static inline void vga_irq_set_state(struct vga_device *vgadev, bool state)
 {
@@ -583,11 +580,12 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev)
        /* Deal with VGA default device. Use first enabled one
         * by default if arch doesn't have it's own hook
         */
-#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
        if (vga_default == NULL &&
-           ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK))
+           ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) {
+               pr_info("vgaarb: setting as boot device: PCI:%s\n",
+                       pci_name(pdev));
                vga_set_default_device(pdev);
-#endif
+       }
 
        vga_arbiter_check_bridge_sharing(vgadev);
 
@@ -621,10 +619,8 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
                goto bail;
        }
 
-#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
        if (vga_default == pdev)
                vga_set_default_device(NULL);
-#endif
 
        if (vgadev->decodes & (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM))
                vga_decode_count--;
@@ -1320,6 +1316,38 @@ static int __init vga_arb_device_init(void)
        pr_info("vgaarb: loaded\n");
 
        list_for_each_entry(vgadev, &vga_list, list) {
+#if defined(CONFIG_X86) || defined(CONFIG_IA64)
+               /* Override I/O based detection done by vga_arbiter_add_pci_device()
+                * as it may take the wrong device (e.g. on Apple system under EFI).
+                *
+                * Select the device owning the boot framebuffer if there is one.
+                */
+               resource_size_t start, end;
+               int i;
+
+               /* Does firmware framebuffer belong to us? */
+               for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+                       if (!(pci_resource_flags(vgadev->pdev, i) & IORESOURCE_MEM))
+                               continue;
+
+                       start = pci_resource_start(vgadev->pdev, i);
+                       end  = pci_resource_end(vgadev->pdev, i);
+
+                       if (!start || !end)
+                               continue;
+
+                       if (screen_info.lfb_base < start ||
+                           (screen_info.lfb_base + screen_info.lfb_size) >= end)
+                               continue;
+                       if (!vga_default_device())
+                               pr_info("vgaarb: setting as boot device: PCI:%s\n",
+                                       pci_name(vgadev->pdev));
+                       else if (vgadev->pdev != vga_default_device())
+                               pr_info("vgaarb: overriding boot device: PCI:%s\n",
+                                       pci_name(vgadev->pdev));
+                       vga_set_default_device(vgadev->pdev);
+               }
+#endif
                if (vgadev->bridge_has_one_vga)
                        pr_info("vgaarb: bridge control possible %s\n", pci_name(vgadev->pdev));
                else
index d4c7928a0f36143844f3ca0b4735f9c22a1c148a..da8ff124762a3362eab5f26c1cd52f4bcfdac099 100644 (file)
@@ -586,17 +586,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
        init_completion(&isert_conn->conn_wait);
        init_completion(&isert_conn->conn_wait_comp_err);
        kref_init(&isert_conn->conn_kref);
-       kref_get(&isert_conn->conn_kref);
        mutex_init(&isert_conn->conn_mutex);
        spin_lock_init(&isert_conn->conn_lock);
        INIT_LIST_HEAD(&isert_conn->conn_fr_pool);
 
        cma_id->context = isert_conn;
        isert_conn->conn_cm_id = cma_id;
-       isert_conn->responder_resources = event->param.conn.responder_resources;
-       isert_conn->initiator_depth = event->param.conn.initiator_depth;
-       pr_debug("Using responder_resources: %u initiator_depth: %u\n",
-                isert_conn->responder_resources, isert_conn->initiator_depth);
 
        isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN +
                                        ISER_RX_LOGIN_SIZE, GFP_KERNEL);
@@ -643,6 +638,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
                goto out_rsp_dma_map;
        }
 
+       /* Set max inflight RDMA READ requests */
+       isert_conn->initiator_depth = min_t(u8,
+                               event->param.conn.initiator_depth,
+                               device->dev_attr.max_qp_init_rd_atom);
+       pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth);
+
        isert_conn->conn_device = device;
        isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device);
        if (IS_ERR(isert_conn->conn_pd)) {
@@ -746,7 +747,9 @@ isert_connect_release(struct isert_conn *isert_conn)
 static void
 isert_connected_handler(struct rdma_cm_id *cma_id)
 {
-       return;
+       struct isert_conn *isert_conn = cma_id->context;
+
+       kref_get(&isert_conn->conn_kref);
 }
 
 static void
@@ -798,7 +801,6 @@ isert_disconnect_work(struct work_struct *work)
 
 wake_up:
        complete(&isert_conn->conn_wait);
-       isert_put_conn(isert_conn);
 }
 
 static void
@@ -3067,7 +3069,6 @@ isert_rdma_accept(struct isert_conn *isert_conn)
        int ret;
 
        memset(&cp, 0, sizeof(struct rdma_conn_param));
-       cp.responder_resources = isert_conn->responder_resources;
        cp.initiator_depth = isert_conn->initiator_depth;
        cp.retry_count = 7;
        cp.rnr_retry_count = 7;
@@ -3215,7 +3216,7 @@ static void isert_wait_conn(struct iscsi_conn *conn)
        pr_debug("isert_wait_conn: Starting \n");
 
        mutex_lock(&isert_conn->conn_mutex);
-       if (isert_conn->conn_cm_id) {
+       if (isert_conn->conn_cm_id && !isert_conn->disconnect) {
                pr_debug("Calling rdma_disconnect from isert_wait_conn\n");
                rdma_disconnect(isert_conn->conn_cm_id);
        }
@@ -3234,6 +3235,7 @@ static void isert_wait_conn(struct iscsi_conn *conn)
        wait_for_completion(&isert_conn->conn_wait_comp_err);
 
        wait_for_completion(&isert_conn->conn_wait);
+       isert_put_conn(isert_conn);
 }
 
 static void isert_free_conn(struct iscsi_conn *conn)
index 2dd1d0dd4f7de03233752e57704ff60c17e6d992..6f5d79569136f3adf0bf9248988b107426b85e9c 100644 (file)
@@ -1791,14 +1791,6 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
        {
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"),
-               },
-               .callback = atkbd_deactivate_fixup,
-       },
-       {
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"),
                },
                .callback = atkbd_deactivate_fixup,
        },
index 136b7b204f56c8d111812559384d6acd8e732514..713e3ddb43bd2eeab90c0c7b3300b1f429216ab9 100644 (file)
@@ -465,6 +465,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
                },
        },
+       {
+               /* Avatar AVIU-145A6 */
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
+               },
+       },
        { }
 };
 
@@ -608,6 +615,14 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
                },
        },
+       {
+               /* Fujitsu U574 laptop */
+               /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
+               },
+       },
        { }
 };
 
index 3807c3e971cca79e6ff42b745409ac418487bb0c..f5a98af3b325c1f3257759e31a450c67b2fa00a5 100644 (file)
@@ -1254,6 +1254,8 @@ static int __init i8042_create_aux_port(int idx)
        } else {
                snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx);
                snprintf(serio->phys, sizeof(serio->phys), I8042_MUX_PHYS_DESC, idx + 1);
+               strlcpy(serio->firmware_id, i8042_aux_firmware_id,
+                       sizeof(serio->firmware_id));
        }
 
        port->serio = serio;
index a568efaa331c57cc35144b08fe3f3b386118c926..35fc73a8d0b3d0cff77f13c280d17549a57c1128 100644 (file)
@@ -49,6 +49,9 @@ struct imx6_pcie {
 
 /* PCIe Port Logic registers (memory-mapped) */
 #define PL_OFFSET 0x700
+#define PCIE_PL_PFLR (PL_OFFSET + 0x08)
+#define PCIE_PL_PFLR_LINK_STATE_MASK           (0x3f << 16)
+#define PCIE_PL_PFLR_FORCE_LINK                        (1 << 15)
 #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28)
 #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c)
 #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING        (1 << 29)
@@ -214,6 +217,32 @@ static int imx6q_pcie_abort_handler(unsigned long addr,
 static int imx6_pcie_assert_core_reset(struct pcie_port *pp)
 {
        struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp);
+       u32 val, gpr1, gpr12;
+
+       /*
+        * If the bootloader already enabled the link we need some special
+        * handling to get the core back into a state where it is safe to
+        * touch it for configuration.  As there is no dedicated reset signal
+        * wired up for MX6QDL, we need to manually force LTSSM into "detect"
+        * state before completely disabling LTSSM, which is a prerequisite
+        * for core configuration.
+        *
+        * If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have a strong
+        * indication that the bootloader activated the link.
+        */
+       regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, &gpr1);
+       regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, &gpr12);
+
+       if ((gpr1 & IMX6Q_GPR1_PCIE_REF_CLK_EN) &&
+           (gpr12 & IMX6Q_GPR12_PCIE_CTL_2)) {
+               val = readl(pp->dbi_base + PCIE_PL_PFLR);
+               val &= ~PCIE_PL_PFLR_LINK_STATE_MASK;
+               val |= PCIE_PL_PFLR_FORCE_LINK;
+               writel(val, pp->dbi_base + PCIE_PL_PFLR);
+
+               regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
+                               IMX6Q_GPR12_PCIE_CTL_2, 0 << 10);
+       }
 
        regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
                        IMX6Q_GPR1_PCIE_TEST_PD, 1 << 18);
@@ -589,6 +618,14 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
        return 0;
 }
 
+static void imx6_pcie_shutdown(struct platform_device *pdev)
+{
+       struct imx6_pcie *imx6_pcie = platform_get_drvdata(pdev);
+
+       /* bring down link, so bootloader gets clean state in case of reboot */
+       imx6_pcie_assert_core_reset(&imx6_pcie->pp);
+}
+
 static const struct of_device_id imx6_pcie_of_match[] = {
        { .compatible = "fsl,imx6q-pcie", },
        {},
@@ -601,6 +638,7 @@ static struct platform_driver imx6_pcie_driver = {
                .owner  = THIS_MODULE,
                .of_match_table = imx6_pcie_of_match,
        },
+       .shutdown = imx6_pcie_shutdown,
 };
 
 /* Freescale PCIe driver does not allow module unload */
index 70741c8c46a0cae82069ea1eba5ffc8e98a3d834..6cd5160fc057654a20e2630e438513028a5bab39 100644 (file)
@@ -560,19 +560,15 @@ static void disable_slot(struct acpiphp_slot *slot)
        slot->flags &= (~SLOT_ENABLED);
 }
 
-static bool acpiphp_no_hotplug(struct acpi_device *adev)
-{
-       return adev && adev->flags.no_hotplug;
-}
-
 static bool slot_no_hotplug(struct acpiphp_slot *slot)
 {
-       struct acpiphp_func *func;
+       struct pci_bus *bus = slot->bus;
+       struct pci_dev *dev;
 
-       list_for_each_entry(func, &slot->funcs, sibling)
-               if (acpiphp_no_hotplug(func_to_acpi_device(func)))
+       list_for_each_entry(dev, &bus->devices, bus_list) {
+               if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug)
                        return true;
-
+       }
        return false;
 }
 
@@ -645,7 +641,7 @@ static void trim_stale_devices(struct pci_dev *dev)
 
                status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta);
                alive = (ACPI_SUCCESS(status) && device_status_valid(sta))
-                       || acpiphp_no_hotplug(adev);
+                       || dev->ignore_hotplug;
        }
        if (!alive)
                alive = pci_device_is_present(dev);
index 9da84b8b27d8a4cdac4305cde5ac50d203b89583..5e01ae39ec46a29930b3ac21de0d7a3fd3900314 100644 (file)
@@ -506,6 +506,8 @@ static irqreturn_t pcie_isr(int irq, void *dev_id)
 {
        struct controller *ctrl = (struct controller *)dev_id;
        struct pci_dev *pdev = ctrl_dev(ctrl);
+       struct pci_bus *subordinate = pdev->subordinate;
+       struct pci_dev *dev;
        struct slot *slot = ctrl->slot;
        u16 detected, intr_loc;
 
@@ -539,6 +541,16 @@ static irqreturn_t pcie_isr(int irq, void *dev_id)
                wake_up(&ctrl->queue);
        }
 
+       if (subordinate) {
+               list_for_each_entry(dev, &subordinate->devices, bus_list) {
+                       if (dev->ignore_hotplug) {
+                               ctrl_dbg(ctrl, "ignoring hotplug event %#06x (%s requested no hotplug)\n",
+                                        intr_loc, pci_name(dev));
+                               return IRQ_HANDLED;
+                       }
+               }
+       }
+
        if (!(intr_loc & ~PCI_EXP_SLTSTA_CC))
                return IRQ_HANDLED;
 
index e246a10a0d2c5e4eb729e3d4c822f6dda19f176a..3e36ec8d708afe7afa52c733436786a7f1efe3dd 100644 (file)
@@ -46,7 +46,6 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp)
                 */
                if (pci_is_pcie(dev))
                        return;
-               dev_info(&dev->dev, "using default PCI settings\n");
                hpp = &pci_default_type0;
        }
 
@@ -153,7 +152,6 @@ void pci_configure_slot(struct pci_dev *dev)
 {
        struct pci_dev *cdev;
        struct hotplug_params hpp;
-       int ret;
 
        if (!(dev->hdr_type == PCI_HEADER_TYPE_NORMAL ||
                        (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
@@ -163,9 +161,7 @@ void pci_configure_slot(struct pci_dev *dev)
        pcie_bus_configure_settings(dev->bus);
 
        memset(&hpp, 0, sizeof(hpp));
-       ret = pci_get_hp_params(dev, &hpp);
-       if (ret)
-               dev_warn(&dev->dev, "no hotplug settings from platform\n");
+       pci_get_hp_params(dev, &hpp);
 
        program_hpp_type2(dev, hpp.t2);
        program_hpp_type1(dev, hpp.t1);
index 337634ad0562449495c12fb4e39efd989f85edef..6d77dcd7dcf6cfb3a8f76745c779d09eae2f7d97 100644 (file)
@@ -319,7 +319,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
                                    struct regulator_config *config)
 {
        struct device_node *nproot, *np;
-       nproot = of_node_get(pdev->dev.parent->of_node);
+       nproot = pdev->dev.parent->of_node;
        if (!nproot)
                return -ENODEV;
        nproot = of_get_child_by_name(nproot, "regulators");
index fdb6ea8ae7e64dc73a7cb2cc4f16a8b43c533b72..00033625a09ce3c601833ec6f7f6b8a0e723956a 100644 (file)
@@ -422,9 +422,9 @@ static int da9052_regulator_probe(struct platform_device *pdev)
                config.init_data = pdata->regulators[pdev->id];
        } else {
 #ifdef CONFIG_OF
-               struct device_node *nproot, *np;
+               struct device_node *nproot = da9052->dev->of_node;
+               struct device_node *np;
 
-               nproot = of_node_get(da9052->dev->of_node);
                if (!nproot)
                        return -ENODEV;
 
index 9623e9e290bf91bb1b7a330946b6783e5bdc7707..3426be89c9f6e3753b36f90fe87cc72324d4a2e4 100644 (file)
@@ -226,7 +226,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev)
        struct device_node *np, *regulators;
        int ret;
 
-       np = of_node_get(pdev->dev.parent->of_node);
+       np = pdev->dev.parent->of_node;
        if (!np)
                return 0;
 
index dad2bcd14e962759d9f5e7b9ae579f6c1369b325..7770777befc448a848c0071faddd1b0818cb6137 100644 (file)
@@ -250,7 +250,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
        struct device_node *nproot, *np;
        int rcount;
 
-       nproot = of_node_get(pdev->dev.parent->of_node);
+       nproot = pdev->dev.parent->of_node;
        if (!nproot)
                return -ENODEV;
        np = of_get_child_by_name(nproot, "regulators");
index 90b4c530dee530b7255b21d238929d744de5abcd..9c31e215a521e71c7cf7148f8e69a09ce5f58acc 100644 (file)
@@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
        struct max8997_regulator_data *rdata;
        unsigned int i, dvs_voltage_nr = 1, ret;
 
-       pmic_np = of_node_get(iodev->dev->of_node);
+       pmic_np = iodev->dev->of_node;
        if (!pmic_np) {
                dev_err(&pdev->dev, "could not find pmic sub-node\n");
                return -ENODEV;
index a7ce34d1b5f2e8514ad33fcb2170c35ab7e5ecca..1878e5b567efc6b98662670ab183e99d9c5c1e38 100644 (file)
@@ -1427,7 +1427,6 @@ static void palmas_dt_to_pdata(struct device *dev,
        u32 prop;
        int idx, ret;
 
-       node = of_node_get(node);
        regulators = of_get_child_by_name(node, "regulators");
        if (!regulators) {
                dev_info(dev, "regulator node not found\n");
index fa7db8847578abd61787d0820661e675c3cd80b0..e584c998b55f203eb601559c1b4ea0113cd29c34 100644 (file)
@@ -1014,7 +1014,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
        if (!pmic_plat_data)
                return NULL;
 
-       np = of_node_get(pdev->dev.parent->of_node);
+       np = pdev->dev.parent->of_node;
        regulators = of_get_child_by_name(np, "regulators");
        if (!regulators) {
                dev_err(&pdev->dev, "regulator node not found\n");
index ea025e4806b61bb53471e79765bb3c165e31eb8f..191b5979351935aac252fbeaadf5a8dee66d6293 100644 (file)
@@ -717,11 +717,21 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
                        return NULL;
                }
 
+               if (data_size > ISCSI_DEF_MAX_RECV_SEG_LEN) {
+                       iscsi_conn_printk(KERN_ERR, conn, "Invalid buffer len of %u for login task. Max len is %u\n", data_size, ISCSI_DEF_MAX_RECV_SEG_LEN);
+                       return NULL;
+               }
+
                task = conn->login_task;
        } else {
                if (session->state != ISCSI_STATE_LOGGED_IN)
                        return NULL;
 
+               if (data_size != 0) {
+                       iscsi_conn_printk(KERN_ERR, conn, "Can not send data buffer of len %u for op 0x%x\n", data_size, opcode);
+                       return NULL;
+               }
+
                BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE);
                BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED);
 
index d837dc180522142fa1dcaf5b4e09c141effbfc4a..aaea4b98af1628c8ca8d0217ebca9a9da1708b8a 100644 (file)
@@ -733,12 +733,13 @@ static bool scsi_end_request(struct request *req, int error,
        } else {
                unsigned long flags;
 
+               if (bidi_bytes)
+                       scsi_release_bidi_buffers(cmd);
+
                spin_lock_irqsave(q->queue_lock, flags);
                blk_finish_request(req, error);
                spin_unlock_irqrestore(q->queue_lock, flags);
 
-               if (bidi_bytes)
-                       scsi_release_bidi_buffers(cmd);
                scsi_release_buffers(cmd);
                scsi_next_command(cmd);
        }
index 48f1d26e6ad9868f9ac8c8e11fb0953e90f707da..134fb6eb7b19247dd2bf729d102fcf5e9263bf7c 100644 (file)
@@ -397,24 +397,21 @@ static int davinci_spi_setup(struct spi_device *spi)
        struct spi_master *master = spi->master;
        struct device_node *np = spi->dev.of_node;
        bool internal_cs = true;
-       unsigned long flags = GPIOF_DIR_OUT;
 
        dspi = spi_master_get_devdata(spi->master);
        pdata = &dspi->pdata;
 
-       flags |= (spi->mode & SPI_CS_HIGH) ? GPIOF_INIT_LOW : GPIOF_INIT_HIGH;
-
        if (!(spi->mode & SPI_NO_CS)) {
                if (np && (master->cs_gpios != NULL) && (spi->cs_gpio >= 0)) {
-                       retval = gpio_request_one(spi->cs_gpio,
-                                                 flags, dev_name(&spi->dev));
+                       retval = gpio_direction_output(
+                                     spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
                        internal_cs = false;
                } else if (pdata->chip_sel &&
                           spi->chip_select < pdata->num_chipselect &&
                           pdata->chip_sel[spi->chip_select] != SPI_INTERN_CS) {
                        spi->cs_gpio = pdata->chip_sel[spi->chip_select];
-                       retval = gpio_request_one(spi->cs_gpio,
-                                                 flags, dev_name(&spi->dev));
+                       retval = gpio_direction_output(
+                                     spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
                        internal_cs = false;
                }
 
@@ -439,12 +436,6 @@ static int davinci_spi_setup(struct spi_device *spi)
        return retval;
 }
 
-static void davinci_spi_cleanup(struct spi_device *spi)
-{
-       if (spi->cs_gpio >= 0)
-               gpio_free(spi->cs_gpio);
-}
-
 static int davinci_spi_check_error(struct davinci_spi *dspi, int int_status)
 {
        struct device *sdev = dspi->bitbang.master->dev.parent;
@@ -956,7 +947,6 @@ static int davinci_spi_probe(struct platform_device *pdev)
        master->num_chipselect = pdata->num_chipselect;
        master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16);
        master->setup = davinci_spi_setup;
-       master->cleanup = davinci_spi_cleanup;
 
        dspi->bitbang.chipselect = davinci_spi_chipselect;
        dspi->bitbang.setup_transfer = davinci_spi_setup_transfer;
@@ -967,6 +957,27 @@ static int davinci_spi_probe(struct platform_device *pdev)
        if (dspi->version == SPI_VERSION_2)
                dspi->bitbang.flags |= SPI_READY;
 
+       if (pdev->dev.of_node) {
+               int i;
+
+               for (i = 0; i < pdata->num_chipselect; i++) {
+                       int cs_gpio = of_get_named_gpio(pdev->dev.of_node,
+                                                       "cs-gpios", i);
+
+                       if (cs_gpio == -EPROBE_DEFER) {
+                               ret = cs_gpio;
+                               goto free_clk;
+                       }
+
+                       if (gpio_is_valid(cs_gpio)) {
+                               ret = devm_gpio_request(&pdev->dev, cs_gpio,
+                                                       dev_name(&pdev->dev));
+                               if (ret)
+                                       goto free_clk;
+                       }
+               }
+       }
+
        r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
        if (r)
                dma_rx_chan = r->start;
index 670f0627f3bfc793092495be55f3d6fd9854dd34..0dd0623319b08d708a2e869443618f43436e81aa 100644 (file)
@@ -547,8 +547,7 @@ static int dw_spi_setup(struct spi_device *spi)
        /* Only alloc on first setup */
        chip = spi_get_ctldata(spi);
        if (!chip) {
-               chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data),
-                               GFP_KERNEL);
+               chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL);
                if (!chip)
                        return -ENOMEM;
                spi_set_ctldata(spi, chip);
@@ -606,6 +605,14 @@ static int dw_spi_setup(struct spi_device *spi)
        return 0;
 }
 
+static void dw_spi_cleanup(struct spi_device *spi)
+{
+       struct chip_data *chip = spi_get_ctldata(spi);
+
+       kfree(chip);
+       spi_set_ctldata(spi, NULL);
+}
+
 /* Restart the controller, disable all interrupts, clean rx fifo */
 static void spi_hw_init(struct dw_spi *dws)
 {
@@ -661,6 +668,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
        master->bus_num = dws->bus_num;
        master->num_chipselect = dws->num_cs;
        master->setup = dw_spi_setup;
+       master->cleanup = dw_spi_cleanup;
        master->transfer_one_message = dw_spi_transfer_one_message;
        master->max_speed_hz = dws->max_freq;
 
index 8ebd724e4c59761511d55de13e55ac277a75e71a..429e111902651ba12ea41ec9c272c5ab2b3cb4ef 100644 (file)
@@ -452,16 +452,16 @@ static int fsl_espi_setup(struct spi_device *spi)
        int retval;
        u32 hw_mode;
        u32 loop_mode;
-       struct spi_mpc8xxx_cs *cs = spi->controller_state;
+       struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
 
        if (!spi->max_speed_hz)
                return -EINVAL;
 
        if (!cs) {
-               cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL);
+               cs = kzalloc(sizeof(*cs), GFP_KERNEL);
                if (!cs)
                        return -ENOMEM;
-               spi->controller_state = cs;
+               spi_set_ctldata(spi, cs);
        }
 
        mpc8xxx_spi = spi_master_get_devdata(spi->master);
@@ -496,6 +496,14 @@ static int fsl_espi_setup(struct spi_device *spi)
        return 0;
 }
 
+static void fsl_espi_cleanup(struct spi_device *spi)
+{
+       struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
+
+       kfree(cs);
+       spi_set_ctldata(spi, NULL);
+}
+
 void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events)
 {
        struct fsl_espi_reg *reg_base = mspi->reg_base;
@@ -605,6 +613,7 @@ static struct spi_master * fsl_espi_probe(struct device *dev,
 
        master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16);
        master->setup = fsl_espi_setup;
+       master->cleanup = fsl_espi_cleanup;
 
        mpc8xxx_spi = spi_master_get_devdata(master);
        mpc8xxx_spi->spi_do_one_msg = fsl_espi_do_one_msg;
index 9452f6740997b1970e8645e4cd141010b5389b38..590f31bc0aba17d6640357aca6c971cb9297c9e1 100644 (file)
@@ -425,16 +425,16 @@ static int fsl_spi_setup(struct spi_device *spi)
        struct fsl_spi_reg *reg_base;
        int retval;
        u32 hw_mode;
-       struct spi_mpc8xxx_cs   *cs = spi->controller_state;
+       struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
 
        if (!spi->max_speed_hz)
                return -EINVAL;
 
        if (!cs) {
-               cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL);
+               cs = kzalloc(sizeof(*cs), GFP_KERNEL);
                if (!cs)
                        return -ENOMEM;
-               spi->controller_state = cs;
+               spi_set_ctldata(spi, cs);
        }
        mpc8xxx_spi = spi_master_get_devdata(spi->master);
 
@@ -496,9 +496,13 @@ static int fsl_spi_setup(struct spi_device *spi)
 static void fsl_spi_cleanup(struct spi_device *spi)
 {
        struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
+       struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
 
        if (mpc8xxx_spi->type == TYPE_GRLIB && gpio_is_valid(spi->cs_gpio))
                gpio_free(spi->cs_gpio);
+
+       kfree(cs);
+       spi_set_ctldata(spi, NULL);
 }
 
 static void fsl_spi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events)
index 1189cfd96477c7cb53236d110b4a077b3aeb270a..f1f0a587e4fcd596d0df0f6de579ed954c17ebbc 100644 (file)
@@ -2136,7 +2136,7 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id)
                                                cs_gpio);
                                else if (gpio_direction_output(cs_gpio, 1))
                                        dev_err(&adev->dev,
-                                               "could set gpio %d as output\n",
+                                               "could not set gpio %d as output\n",
                                                cs_gpio);
                        }
                }
index cd0e08b0c9f66c7d99d1421e8fdbf882f62f7e77..3afc266b666d38f874c1f8f4d1f8f8f4dd9b2747 100644 (file)
@@ -220,7 +220,7 @@ static inline void wait_for_idle(struct rockchip_spi *rs)
        do {
                if (!(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY))
                        return;
-       } while (time_before(jiffies, timeout));
+       } while (!time_after(jiffies, timeout));
 
        dev_warn(rs->dev, "spi controller is in busy state!\n");
 }
@@ -529,7 +529,8 @@ static int rockchip_spi_transfer_one(
        int ret = 0;
        struct rockchip_spi *rs = spi_master_get_devdata(master);
 
-       WARN_ON((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
+       WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) &&
+               (readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
 
        if (!xfer->tx_buf && !xfer->rx_buf) {
                dev_err(rs->dev, "No buffer for transfer\n");
index 95ac276eaafe6ab7a6c1f6b82aede8bad00bdac0..6f0602fd74012f298467397f0aca2d15709a5d15 100644 (file)
@@ -312,6 +312,8 @@ static int spi_sirfsoc_cmd_transfer(struct spi_device *spi,
        u32 cmd;
 
        sspi = spi_master_get_devdata(spi->master);
+       writel(SIRFSOC_SPI_FIFO_RESET, sspi->base + SIRFSOC_SPI_TXFIFO_OP);
+       writel(SIRFSOC_SPI_FIFO_START, sspi->base + SIRFSOC_SPI_TXFIFO_OP);
        memcpy(&cmd, sspi->tx, t->len);
        if (sspi->word_width == 1 && !(spi->mode & SPI_LSB_FIRST))
                cmd = cpu_to_be32(cmd) >>
@@ -438,7 +440,8 @@ static void spi_sirfsoc_pio_transfer(struct spi_device *spi,
                        sspi->tx_word(sspi);
                writel(SIRFSOC_SPI_TXFIFO_EMPTY_INT_EN |
                        SIRFSOC_SPI_TX_UFLOW_INT_EN |
-                       SIRFSOC_SPI_RX_OFLOW_INT_EN,
+                       SIRFSOC_SPI_RX_OFLOW_INT_EN |
+                       SIRFSOC_SPI_RX_IO_DMA_INT_EN,
                        sspi->base + SIRFSOC_SPI_INT_EN);
                writel(SIRFSOC_SPI_RX_EN | SIRFSOC_SPI_TX_EN,
                        sspi->base + SIRFSOC_SPI_TX_RX_EN);
index 1f4c794f5fcc27b26ad4260e52ba8a78548fd779..260c3e1e312c66310917238cada772696e457b6a 100644 (file)
@@ -4540,6 +4540,7 @@ static void iscsit_logout_post_handler_diffcid(
 {
        struct iscsi_conn *l_conn;
        struct iscsi_session *sess = conn->sess;
+       bool conn_found = false;
 
        if (!sess)
                return;
@@ -4548,12 +4549,13 @@ static void iscsit_logout_post_handler_diffcid(
        list_for_each_entry(l_conn, &sess->sess_conn_list, conn_list) {
                if (l_conn->cid == cid) {
                        iscsit_inc_conn_usage_count(l_conn);
+                       conn_found = true;
                        break;
                }
        }
        spin_unlock_bh(&sess->conn_lock);
 
-       if (!l_conn)
+       if (!conn_found)
                return;
 
        if (l_conn->sock)
index 02f9de26f38ab930b9810a20abaf8b972f42f93d..18c29260b4a213d959463b41083abe6555166985 100644 (file)
@@ -601,7 +601,7 @@ int iscsi_copy_param_list(
        param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL);
        if (!param_list) {
                pr_err("Unable to allocate memory for struct iscsi_param_list.\n");
-               goto err_out;
+               return -1;
        }
        INIT_LIST_HEAD(&param_list->param_list);
        INIT_LIST_HEAD(&param_list->extra_response_list);
index fd90b28f1d94358db7361899b32928b0d1b5fee2..73355f4fca745a71d0fa3cb66956148c64e41f11 100644 (file)
@@ -400,6 +400,8 @@ struct iscsi_cmd *iscsit_find_cmd_from_itt_or_dump(
 
        spin_lock_bh(&conn->cmd_lock);
        list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
+               if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT)
+                       continue;
                if (cmd->init_task_tag == init_task_tag) {
                        spin_unlock_bh(&conn->cmd_lock);
                        return cmd;
index bf55c5a04cfac68983b2c565c9f9498f6aaad1ed..756def38c77af934a3e16ef3ae9219e67ceb06cc 100644 (file)
@@ -2363,7 +2363,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_support_##_name(\
                pr_err("Invalid value '%ld', must be '0' or '1'\n", tmp); \
                return -EINVAL;                                         \
        }                                                               \
-       if (!tmp)                                                       \
+       if (tmp)                                                        \
                t->_var |= _bit;                                        \
        else                                                            \
                t->_var &= ~_bit;                                       \
index 6cd7222738fc4697f8c1be7c337ef7418fd09075..bc286a67af7c4e876e0ac6075e8af8fffe2b9c92 100644 (file)
@@ -664,7 +664,7 @@ spc_emulate_evpd_b3(struct se_cmd *cmd, unsigned char *buf)
        buf[0] = dev->transport->get_device_type(dev);
        buf[3] = 0x0c;
        put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[8]);
-       put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[12]);
+       put_unaligned_be32(dev->t10_alua.lba_map_segment_multiplier, &buf[12]);
 
        return 0;
 }
index 43527fd78825b690503347426118e09f76017c95..56b8522d5767b5858928d4152c0ab64ca43886ca 100644 (file)
@@ -234,8 +234,17 @@ static inline int btrfs_inode_in_log(struct inode *inode, u64 generation)
            BTRFS_I(inode)->last_sub_trans <=
            BTRFS_I(inode)->last_log_commit &&
            BTRFS_I(inode)->last_sub_trans <=
-           BTRFS_I(inode)->root->last_log_commit)
-               return 1;
+           BTRFS_I(inode)->root->last_log_commit) {
+               /*
+                * After a ranged fsync we might have left some extent maps
+                * (that fall outside the fsync's range). So return false
+                * here if the list isn't empty, to make sure btrfs_log_inode()
+                * will be called and process those extent maps.
+                */
+               smp_mb();
+               if (list_empty(&BTRFS_I(inode)->extent_tree.modified_extents))
+                       return 1;
+       }
        return 0;
 }
 
index d296efe2d3e76ce4f690687a9647cf7f8c71a27f..1d1ba083ca6ecc1497bd1c141a431a2d5fa26cd9 100644 (file)
@@ -4093,18 +4093,8 @@ log_extents:
                }
        }
 
-       write_lock(&em_tree->lock);
-       /*
-        * If we're doing a ranged fsync and there are still modified extents
-        * in the list, we must run on the next fsync call as it might cover
-        * those extents (a full fsync or an fsync for other range).
-        */
-       if (list_empty(&em_tree->modified_extents)) {
-               BTRFS_I(inode)->logged_trans = trans->transid;
-               BTRFS_I(inode)->last_log_commit =
-                       BTRFS_I(inode)->last_sub_trans;
-       }
-       write_unlock(&em_tree->lock);
+       BTRFS_I(inode)->logged_trans = trans->transid;
+       BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->last_sub_trans;
 out_unlock:
        if (unlikely(err))
                btrfs_put_logged_extents(&logged_list);
index 340a92d08e84d9e5268a18fe5f3112465fa47888..2c2d6d1d8eee929fc910a82cd17fbec79803cbb2 100644 (file)
@@ -529,12 +529,12 @@ static noinline int device_list_add(const char *path,
                 */
 
                /*
-                * As of now don't allow update to btrfs_fs_device through
-                * the btrfs dev scan cli, after FS has been mounted.
+                * For now, we do allow update to btrfs_fs_device through the
+                * btrfs dev scan cli after FS has been mounted.  We're still
+                * tracking a problem where systems fail mount by subvolume id
+                * when we reject replacement on a mounted FS.
                 */
-               if (fs_devices->opened) {
-                       return -EBUSY;
-               } else {
+               if (!fs_devices->opened && found_transid < device->generation) {
                        /*
                         * That is if the FS is _not_ mounted and if you
                         * are here, that means there is more than one
@@ -542,8 +542,7 @@ static noinline int device_list_add(const char *path,
                         * with larger generation number or the last-in if
                         * generation are equal.
                         */
-                       if (found_transid < device->generation)
-                               return -EEXIST;
+                       return -EEXIST;
                }
 
                name = rcu_string_strdup(path, GFP_NOFS);
index b0fafa499505218fb0cecac43cfb9db4e9a77f26..002e0c17393903f62fe4e382acb23df44a9ccec7 100644 (file)
@@ -136,5 +136,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
 extern const struct export_operations cifs_export_ops;
 #endif /* CONFIG_CIFS_NFSD_EXPORT */
 
-#define CIFS_VERSION   "2.04"
+#define CIFS_VERSION   "2.05"
 #endif                         /* _CIFSFS_H */
index 8a9fded7c135f6deb936873ad06fa86fc11c9f85..36ca2045009bf342ef507c132921484c7eaf7ded 100644 (file)
@@ -837,6 +837,7 @@ cifs_demultiplex_thread(void *p)
        struct TCP_Server_Info *server = p;
        unsigned int pdu_length;
        char *buf = NULL;
+       struct task_struct *task_to_wake = NULL;
        struct mid_q_entry *mid_entry;
 
        current->flags |= PF_MEMALLOC;
@@ -927,7 +928,19 @@ cifs_demultiplex_thread(void *p)
        if (server->smallbuf) /* no sense logging a debug message if NULL */
                cifs_small_buf_release(server->smallbuf);
 
+       task_to_wake = xchg(&server->tsk, NULL);
        clean_demultiplex_info(server);
+
+       /* if server->tsk was NULL then wait for a signal before exiting */
+       if (!task_to_wake) {
+               set_current_state(TASK_INTERRUPTIBLE);
+               while (!signal_pending(current)) {
+                       schedule();
+                       set_current_state(TASK_INTERRUPTIBLE);
+               }
+               set_current_state(TASK_RUNNING);
+       }
+
        module_put_and_exit(0);
 }
 
@@ -2050,6 +2063,8 @@ cifs_find_tcp_session(struct smb_vol *vol)
 static void
 cifs_put_tcp_session(struct TCP_Server_Info *server)
 {
+       struct task_struct *task;
+
        spin_lock(&cifs_tcp_ses_lock);
        if (--server->srv_count > 0) {
                spin_unlock(&cifs_tcp_ses_lock);
@@ -2073,6 +2088,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server)
        kfree(server->session_key.response);
        server->session_key.response = NULL;
        server->session_key.len = 0;
+
+       task = xchg(&server->tsk, NULL);
+       if (task)
+               force_sig(SIGKILL, task);
 }
 
 static struct TCP_Server_Info *
index 68559fd557fbbc845e71c71498f314887494c7fc..5657416d3483fd9dea39601e61e5c64e08ec3894 100644 (file)
@@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon,
        if (rc)
                goto out;
 
-       rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb,
-                                       fromName, buf, &bytes_written);
+       if (tcon->ses->server->ops->create_mf_symlink)
+               rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon,
+                                       cifs_sb, fromName, buf, &bytes_written);
+       else
+               rc = -EOPNOTSUPP;
+
        if (rc)
                goto out;
 
@@ -339,9 +343,11 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
        if (rc)
                return rc;
 
-       if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE))
+       if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) {
+               rc = -ENOENT;
                /* it's not a symlink */
                goto out;
+       }
 
        io_parms.netfid = fid.netfid;
        io_parms.pid = current->tgid;
index 6834b9c3bec12505fe1adc55e17f911fef018eac..b333ff60781d295809d8fa8f23366f9bcf8d9285 100644 (file)
@@ -925,11 +925,23 @@ cifs_NTtimeToUnix(__le64 ntutc)
        /* BB what about the timezone? BB */
 
        /* Subtract the NTFS time offset, then convert to 1s intervals. */
-       u64 t;
+       s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;
+
+       /*
+        * Unfortunately can not use normal 64 bit division on 32 bit arch, but
+        * the alternative, do_div, does not work with negative numbers so have
+        * to special case them
+        */
+       if (t < 0) {
+               t = -t;
+               ts.tv_nsec = (long)(do_div(t, 10000000) * 100);
+               ts.tv_nsec = -ts.tv_nsec;
+               ts.tv_sec = -t;
+       } else {
+               ts.tv_nsec = (long)do_div(t, 10000000) * 100;
+               ts.tv_sec = t;
+       }
 
-       t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;
-       ts.tv_nsec = do_div(t, 10000000) * 100;
-       ts.tv_sec = t;
        return ts;
 }
 
index 3a5e83317683d1c16156c4511ab7657940b48d97..57db63ff88da282cca615c998e0e495ccc58ee15 100644 (file)
@@ -745,14 +745,6 @@ out:
        sess_free_buffer(sess_data);
 }
 
-#else
-
-static void
-sess_auth_lanman(struct sess_data *sess_data)
-{
-       sess_data->result = -EOPNOTSUPP;
-       sess_data->func = NULL;
-}
 #endif
 
 static void
@@ -1103,15 +1095,6 @@ out:
        ses->auth_key.response = NULL;
 }
 
-#else
-
-static void
-sess_auth_kerberos(struct sess_data *sess_data)
-{
-       cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n");
-       sess_data->result = -ENOSYS;
-       sess_data->func = NULL;
-}
 #endif /* ! CONFIG_CIFS_UPCALL */
 
 /*
index e6ee5b6e8d99379e97cf5d777892dbd1065e595d..f0b945ab853e488a852a1a8459e9aa873def54b9 100644 (file)
@@ -359,7 +359,7 @@ static inline void release_metapath(struct metapath *mp)
  * Returns: The length of the extent (minimum of one block)
  */
 
-static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, unsigned limit, int *eob)
+static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, size_t limit, int *eob)
 {
        const __be64 *end = (start + len);
        const __be64 *first = ptr;
@@ -449,7 +449,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock,
                           struct buffer_head *bh_map, struct metapath *mp,
                           const unsigned int sheight,
                           const unsigned int height,
-                          const unsigned int maxlen)
+                          const size_t maxlen)
 {
        struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_sbd *sdp = GFS2_SB(inode);
@@ -483,7 +483,8 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock,
        } else {
                /* Need to allocate indirect blocks */
                ptrs_per_blk = height > 1 ? sdp->sd_inptrs : sdp->sd_diptrs;
-               dblks = min(maxlen, ptrs_per_blk - mp->mp_list[end_of_metadata]);
+               dblks = min(maxlen, (size_t)(ptrs_per_blk -
+                                            mp->mp_list[end_of_metadata]));
                if (height == ip->i_height) {
                        /* Writing into existing tree, extend tree down */
                        iblks = height - sheight;
@@ -605,7 +606,7 @@ int gfs2_block_map(struct inode *inode, sector_t lblock,
        struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_sbd *sdp = GFS2_SB(inode);
        unsigned int bsize = sdp->sd_sb.sb_bsize;
-       const unsigned int maxlen = bh_map->b_size >> inode->i_blkbits;
+       const size_t maxlen = bh_map->b_size >> inode->i_blkbits;
        const u64 *arr = sdp->sd_heightsize;
        __be64 *ptr;
        u64 size;
index 26b3f952e6b19cccd2e0333f45498c5531a99c62..7f4ed3daa38c4a190132c1c1fa6ce1b1877e0b94 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/dlm.h>
 #include <linux/dlm_plock.h>
 #include <linux/aio.h>
+#include <linux/delay.h>
 
 #include "gfs2.h"
 #include "incore.h"
@@ -979,9 +980,10 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
        unsigned int state;
        int flags;
        int error = 0;
+       int sleeptime;
 
        state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
-       flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY) | GL_EXACT;
+       flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY_1CB) | GL_EXACT;
 
        mutex_lock(&fp->f_fl_mutex);
 
@@ -1001,7 +1003,14 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
                gfs2_holder_init(gl, state, flags, fl_gh);
                gfs2_glock_put(gl);
        }
-       error = gfs2_glock_nq(fl_gh);
+       for (sleeptime = 1; sleeptime <= 4; sleeptime <<= 1) {
+               error = gfs2_glock_nq(fl_gh);
+               if (error != GLR_TRYFAILED)
+                       break;
+               fl_gh->gh_flags = LM_FLAG_TRY | GL_EXACT;
+               fl_gh->gh_error = 0;
+               msleep(sleeptime);
+       }
        if (error) {
                gfs2_holder_uninit(fl_gh);
                if (error == GLR_TRYFAILED)
@@ -1024,7 +1033,7 @@ static void do_unflock(struct file *file, struct file_lock *fl)
        mutex_lock(&fp->f_fl_mutex);
        flock_lock_file_wait(file, fl);
        if (fl_gh->gh_gl) {
-               gfs2_glock_dq_wait(fl_gh);
+               gfs2_glock_dq(fl_gh);
                gfs2_holder_uninit(fl_gh);
        }
        mutex_unlock(&fp->f_fl_mutex);
index 67d310c9ada3222ef1c08333397f65a29d1e454a..39e7e9959b7462f99a7d04dff4759445f581d9df 100644 (file)
@@ -262,6 +262,9 @@ struct gfs2_holder {
        unsigned long gh_ip;
 };
 
+/* Number of quota types we support */
+#define GFS2_MAXQUOTAS 2
+
 /* Resource group multi-block reservation, in order of appearance:
 
    Step 1. Function prepares to write, allocates a mb, sets the size hint.
@@ -282,8 +285,8 @@ struct gfs2_blkreserv {
        u64 rs_inum;                  /* Inode number for reservation */
 
        /* ancillary quota stuff */
-       struct gfs2_quota_data *rs_qa_qd[2 * MAXQUOTAS];
-       struct gfs2_holder rs_qa_qd_ghs[2 * MAXQUOTAS];
+       struct gfs2_quota_data *rs_qa_qd[2 * GFS2_MAXQUOTAS];
+       struct gfs2_holder rs_qa_qd_ghs[2 * GFS2_MAXQUOTAS];
        unsigned int rs_qa_qd_num;
 };
 
index e62e594778848ba313b17269cf9f3e7832aba0bb..fc8ac2ee0667c8d66082aa48f05f9acee452a8ac 100644 (file)
@@ -626,8 +626,10 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
        if (!IS_ERR(inode)) {
                d = d_splice_alias(inode, dentry);
                error = PTR_ERR(d);
-               if (IS_ERR(d))
+               if (IS_ERR(d)) {
+                       inode = ERR_CAST(d);
                        goto fail_gunlock;
+               }
                error = 0;
                if (file) {
                        if (S_ISREG(inode->i_mode)) {
@@ -840,8 +842,10 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
        int error;
 
        inode = gfs2_lookupi(dir, &dentry->d_name, 0);
-       if (!inode)
+       if (inode == NULL) {
+               d_add(dentry, NULL);
                return NULL;
+       }
        if (IS_ERR(inode))
                return ERR_CAST(inode);
 
@@ -854,7 +858,6 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
 
        d = d_splice_alias(inode, dentry);
        if (IS_ERR(d)) {
-               iput(inode);
                gfs2_glock_dq_uninit(&gh);
                return d;
        }
index 2607ff13d4864536a3f60ca6e2343f39b58b1b93..a346f56c4c6df97dfbc1459b61a9f6d70e42bc11 100644 (file)
@@ -1294,7 +1294,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root)
        int val;
 
        if (is_ancestor(root, sdp->sd_master_dir))
-               seq_printf(s, ",meta");
+               seq_puts(s, ",meta");
        if (args->ar_lockproto[0])
                seq_printf(s, ",lockproto=%s", args->ar_lockproto);
        if (args->ar_locktable[0])
@@ -1302,13 +1302,13 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root)
        if (args->ar_hostdata[0])
                seq_printf(s, ",hostdata=%s", args->ar_hostdata);
        if (args->ar_spectator)
-               seq_printf(s, ",spectator");
+               seq_puts(s, ",spectator");
        if (args->ar_localflocks)
-               seq_printf(s, ",localflocks");
+               seq_puts(s, ",localflocks");
        if (args->ar_debug)
-               seq_printf(s, ",debug");
+               seq_puts(s, ",debug");
        if (args->ar_posix_acl)
-               seq_printf(s, ",acl");
+               seq_puts(s, ",acl");
        if (args->ar_quota != GFS2_QUOTA_DEFAULT) {
                char *state;
                switch (args->ar_quota) {
@@ -1328,7 +1328,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root)
                seq_printf(s, ",quota=%s", state);
        }
        if (args->ar_suiddir)
-               seq_printf(s, ",suiddir");
+               seq_puts(s, ",suiddir");
        if (args->ar_data != GFS2_DATA_DEFAULT) {
                char *state;
                switch (args->ar_data) {
@@ -1345,7 +1345,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root)
                seq_printf(s, ",data=%s", state);
        }
        if (args->ar_discard)
-               seq_printf(s, ",discard");
+               seq_puts(s, ",discard");
        val = sdp->sd_tune.gt_logd_secs;
        if (val != 30)
                seq_printf(s, ",commit=%d", val);
@@ -1376,11 +1376,11 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root)
                seq_printf(s, ",errors=%s", state);
        }
        if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags))
-               seq_printf(s, ",nobarrier");
+               seq_puts(s, ",nobarrier");
        if (test_bit(SDF_DEMOTE, &sdp->sd_flags))
-               seq_printf(s, ",demote_interface_used");
+               seq_puts(s, ",demote_interface_used");
        if (args->ar_rgrplvb)
-               seq_printf(s, ",rgrplvb");
+               seq_puts(s, ",rgrplvb");
        return 0;
 }
 
index 215e44254c5328c1a992db483da80e27a1dbed6c..a7b05bf82d31ad2e8eacbac999a049cab1f8d446 100644 (file)
@@ -1674,14 +1674,13 @@ EXPORT_SYMBOL(full_name_hash);
 
 /*
  * Calculate the length and hash of the path component, and
- * fill in the qstr. return the "len" as the result.
+ * return the "hash_len" as the result.
  */
-static inline unsigned long hash_name(const char *name, struct qstr *res)
+static inline u64 hash_name(const char *name)
 {
        unsigned long a, b, adata, bdata, mask, hash, len;
        const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
 
-       res->name = name;
        hash = a = 0;
        len = -sizeof(unsigned long);
        do {
@@ -1698,9 +1697,7 @@ static inline unsigned long hash_name(const char *name, struct qstr *res)
 
        hash += a & zero_bytemask(mask);
        len += find_zero(mask);
-       res->hash_len = hashlen_create(fold_hash(hash), len);
-
-       return len;
+       return hashlen_create(fold_hash(hash), len);
 }
 
 #else
@@ -1718,20 +1715,18 @@ EXPORT_SYMBOL(full_name_hash);
  * We know there's a real path component here of at least
  * one character.
  */
-static inline long hash_name(const char *name, struct qstr *res)
+static inline u64 hash_name(const char *name)
 {
        unsigned long hash = init_name_hash();
        unsigned long len = 0, c;
 
-       res->name = name;
        c = (unsigned char)*name;
        do {
                len++;
                hash = partial_name_hash(c, hash);
                c = (unsigned char)name[len];
        } while (c && c != '/');
-       res->hash_len = hashlen_create(end_name_hash(hash), len);
-       return len;
+       return hashlen_create(end_name_hash(hash), len);
 }
 
 #endif
@@ -1756,18 +1751,17 @@ static int link_path_walk(const char *name, struct nameidata *nd)
 
        /* At this point we know we have a real path component. */
        for(;;) {
-               struct qstr this;
-               long len;
+               u64 hash_len;
                int type;
 
                err = may_lookup(nd);
                if (err)
                        break;
 
-               len = hash_name(name, &this);
+               hash_len = hash_name(name);
 
                type = LAST_NORM;
-               if (name[0] == '.') switch (len) {
+               if (name[0] == '.') switch (hashlen_len(hash_len)) {
                        case 2:
                                if (name[1] == '.') {
                                        type = LAST_DOTDOT;
@@ -1781,29 +1775,32 @@ static int link_path_walk(const char *name, struct nameidata *nd)
                        struct dentry *parent = nd->path.dentry;
                        nd->flags &= ~LOOKUP_JUMPED;
                        if (unlikely(parent->d_flags & DCACHE_OP_HASH)) {
+                               struct qstr this = { { .hash_len = hash_len }, .name = name };
                                err = parent->d_op->d_hash(parent, &this);
                                if (err < 0)
                                        break;
+                               hash_len = this.hash_len;
+                               name = this.name;
                        }
                }
 
-               nd->last = this;
+               nd->last.hash_len = hash_len;
+               nd->last.name = name;
                nd->last_type = type;
 
-               if (!name[len])
+               name += hashlen_len(hash_len);
+               if (!*name)
                        return 0;
                /*
                 * If it wasn't NUL, we know it was '/'. Skip that
                 * slash, and continue until no more slashes.
                 */
                do {
-                       len++;
-               } while (unlikely(name[len] == '/'));
-               if (!name[len])
+                       name++;
+               } while (unlikely(*name == '/'));
+               if (!*name)
                        return 0;
 
-               name += len;
-
                err = walk_component(nd, &next, LOOKUP_FOLLOW);
                if (err < 0)
                        return err;
index 53e435a952602aa5037cc8a9605b399f646edc81..ffdb28d86cf81636e22d6e2899a677fc967772d2 100644 (file)
@@ -482,6 +482,16 @@ int nfs40_walk_client_list(struct nfs_client *new,
 
        spin_lock(&nn->nfs_client_lock);
        list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {
+
+               if (pos->rpc_ops != new->rpc_ops)
+                       continue;
+
+               if (pos->cl_proto != new->cl_proto)
+                       continue;
+
+               if (pos->cl_minorversion != new->cl_minorversion)
+                       continue;
+
                /* If "pos" isn't marked ready, we can't trust the
                 * remaining fields in "pos" */
                if (pos->cl_cons_state > NFS_CS_READY) {
@@ -501,15 +511,6 @@ int nfs40_walk_client_list(struct nfs_client *new,
                if (pos->cl_cons_state != NFS_CS_READY)
                        continue;
 
-               if (pos->rpc_ops != new->rpc_ops)
-                       continue;
-
-               if (pos->cl_proto != new->cl_proto)
-                       continue;
-
-               if (pos->cl_minorversion != new->cl_minorversion)
-                       continue;
-
                if (pos->cl_clientid != new->cl_clientid)
                        continue;
 
@@ -622,6 +623,16 @@ int nfs41_walk_client_list(struct nfs_client *new,
 
        spin_lock(&nn->nfs_client_lock);
        list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {
+
+               if (pos->rpc_ops != new->rpc_ops)
+                       continue;
+
+               if (pos->cl_proto != new->cl_proto)
+                       continue;
+
+               if (pos->cl_minorversion != new->cl_minorversion)
+                       continue;
+
                /* If "pos" isn't marked ready, we can't trust the
                 * remaining fields in "pos", especially the client
                 * ID and serverowner fields.  Wait for CREATE_SESSION
@@ -647,15 +658,6 @@ int nfs41_walk_client_list(struct nfs_client *new,
                if (pos->cl_cons_state != NFS_CS_READY)
                        continue;
 
-               if (pos->rpc_ops != new->rpc_ops)
-                       continue;
-
-               if (pos->cl_proto != new->cl_proto)
-                       continue;
-
-               if (pos->cl_minorversion != new->cl_minorversion)
-                       continue;
-
                if (!nfs4_match_clientids(pos, new))
                        continue;
 
index 7dd8aca31c29b9c0079dce94136e70d716072f78..6ca0c8e7a9453d24585aba5e2d9546554353b58f 100644 (file)
@@ -2226,9 +2226,13 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
        ret = _nfs4_proc_open(opendata);
        if (ret != 0) {
                if (ret == -ENOENT) {
-                       d_drop(opendata->dentry);
-                       d_add(opendata->dentry, NULL);
-                       nfs_set_verifier(opendata->dentry,
+                       dentry = opendata->dentry;
+                       if (dentry->d_inode)
+                               d_delete(dentry);
+                       else if (d_unhashed(dentry))
+                               d_add(dentry, NULL);
+
+                       nfs_set_verifier(dentry,
                                         nfs_save_change_attribute(opendata->dir->d_inode));
                }
                goto out;
@@ -2614,23 +2618,23 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
        is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags);
        is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags);
        is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags);
-       /* Calculate the current open share mode */
-       calldata->arg.fmode = 0;
-       if (is_rdonly || is_rdwr)
-               calldata->arg.fmode |= FMODE_READ;
-       if (is_wronly || is_rdwr)
-               calldata->arg.fmode |= FMODE_WRITE;
        /* Calculate the change in open mode */
+       calldata->arg.fmode = 0;
        if (state->n_rdwr == 0) {
-               if (state->n_rdonly == 0) {
-                       call_close |= is_rdonly || is_rdwr;
-                       calldata->arg.fmode &= ~FMODE_READ;
-               }
-               if (state->n_wronly == 0) {
-                       call_close |= is_wronly || is_rdwr;
-                       calldata->arg.fmode &= ~FMODE_WRITE;
-               }
-       }
+               if (state->n_rdonly == 0)
+                       call_close |= is_rdonly;
+               else if (is_rdonly)
+                       calldata->arg.fmode |= FMODE_READ;
+               if (state->n_wronly == 0)
+                       call_close |= is_wronly;
+               else if (is_wronly)
+                       calldata->arg.fmode |= FMODE_WRITE;
+       } else if (is_rdwr)
+               calldata->arg.fmode |= FMODE_READ|FMODE_WRITE;
+
+       if (calldata->arg.fmode == 0)
+               call_close |= is_rdwr;
+
        if (!nfs4_valid_open_stateid(state))
                call_close = 0;
        spin_unlock(&state->owner->so_lock);
index c1c9de19edbe8abc62f2508bf9a7723bd9027d08..d91e59b79f0de4c903594a69b59098d1694dde6a 100644 (file)
@@ -204,10 +204,9 @@ struct acpi_device_flags {
        u32 match_driver:1;
        u32 initialized:1;
        u32 visited:1;
-       u32 no_hotplug:1;
        u32 hotplug_notify:1;
        u32 is_dock_station:1;
-       u32 reserved:22;
+       u32 reserved:23;
 };
 
 /* File System */
@@ -411,7 +410,6 @@ void acpi_bus_private_data_handler(acpi_handle, void *);
 int acpi_bus_get_private_data(acpi_handle, void **);
 int acpi_bus_attach_private_data(acpi_handle, void *);
 void acpi_bus_detach_private_data(acpi_handle);
-void acpi_bus_no_hotplug(acpi_handle handle);
 extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
 extern int register_acpi_notifier(struct notifier_block *);
 extern int unregister_acpi_notifier(struct notifier_block *);
index 831d786976c56fe64c71fa7f3f6c400ea4ca7eb4..882675e7c055d8248c724081b199b77e3785066b 100644 (file)
@@ -162,12 +162,25 @@ static inline size_t drbg_max_request_bytes(struct drbg_state *drbg)
 
 static inline size_t drbg_max_addtl(struct drbg_state *drbg)
 {
+#if (__BITS_PER_LONG == 32)
+       /*
+        * SP800-90A allows smaller maximum numbers to be returned -- we
+        * return SIZE_MAX - 1 to allow the verification of the enforcement
+        * of this value in drbg_healthcheck_sanity.
+        */
+       return (SIZE_MAX - 1);
+#else
        return (1UL<<(drbg->core->max_addtllen));
+#endif
 }
 
 static inline size_t drbg_max_requests(struct drbg_state *drbg)
 {
+#if (__BITS_PER_LONG == 32)
+       return SIZE_MAX;
+#else
        return (1UL<<(drbg->core->max_req));
+#endif
 }
 
 /*
index 61978a4608412896a3f199024c9c7b7d349c152d..96453f9bc8bafa947d87a64b1102f8115ad43ea9 100644 (file)
@@ -303,6 +303,7 @@ struct pci_dev {
                                                   D3cold, not set for devices
                                                   powered on/off by the
                                                   corresponding bridge */
+       unsigned int    ignore_hotplug:1;       /* Ignore hotplug events */
        unsigned int    d3_delay;       /* D3->D0 transition time in ms */
        unsigned int    d3cold_delay;   /* D3cold->D0 transition time in ms */
 
@@ -1021,6 +1022,11 @@ bool pci_dev_run_wake(struct pci_dev *dev);
 bool pci_check_pme_status(struct pci_dev *dev);
 void pci_pme_wakeup_bus(struct pci_bus *bus);
 
+static inline void pci_ignore_hotplug(struct pci_dev *dev)
+{
+       dev->ignore_hotplug = 1;
+}
+
 static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
                                  bool enable)
 {
index 502073a53dd320b115925a654ef7dabdbd49872e..b483abd344934f9cb9827d112883bfdf8e861d2b 100644 (file)
@@ -64,6 +64,7 @@ int vga_switcheroo_get_client_state(struct pci_dev *dev);
 void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic);
 
 int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain);
+void vga_switcheroo_fini_domain_pm_ops(struct device *dev);
 int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain);
 #else
 
@@ -82,6 +83,7 @@ static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return
 static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {}
 
 static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
+static inline void vga_switcheroo_fini_domain_pm_ops(struct device *dev) {}
 static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
 
 #endif
index 2c02f3a8d2ba3f4ba079a51f537be25742b17162..c37bd4d06739034cf9592305a152f9ed6eb35db3 100644 (file)
@@ -182,7 +182,6 @@ extern void vga_put(struct pci_dev *pdev, unsigned int rsrc);
  *     vga_get()...
  */
 
-#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
 #ifdef CONFIG_VGA_ARB
 extern struct pci_dev *vga_default_device(void);
 extern void vga_set_default_device(struct pci_dev *pdev);
@@ -190,7 +189,6 @@ extern void vga_set_default_device(struct pci_dev *pdev);
 static inline struct pci_dev *vga_default_device(void) { return NULL; };
 static inline void vga_set_default_device(struct pci_dev *pdev) { };
 #endif
-#endif
 
 /**
  *     vga_conflicts
index cdcc90b07ecba7ec8bb675bdb1e1b26498f77a24..e64583560701bb1f2f0038717457321597b39e85 100644 (file)
@@ -68,7 +68,7 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
                return;
 
        if (!shost_use_blk_mq(sdev->host) &&
-           blk_queue_tagged(sdev->request_queue))
+           !blk_queue_tagged(sdev->request_queue))
                blk_queue_init_tags(sdev->request_queue, depth,
                                    sdev->host->bqt);
 
index b6237c31b0e2469cac9b2287cecb6932ad49462e..82f22885c87e995c3d18f6a0080bf639d99d9331 100644 (file)
@@ -539,6 +539,12 @@ void __init prepare_namespace(void)
 {
        int is_floppy;
 
+       if (root_delay) {
+               printk(KERN_INFO "Waiting %d sec before mounting root device...\n",
+                      root_delay);
+               ssleep(root_delay);
+       }
+
        /*
         * wait for the known devices to complete their probing
         *
@@ -565,12 +571,6 @@ void __init prepare_namespace(void)
        if (initrd_load())
                goto out;
 
-       if (root_delay) {
-               pr_info("Waiting %d sec before mounting root device...\n",
-                       root_delay);
-               ssleep(root_delay);
-       }
-
        /* wait for any asynchronous scanning to complete */
        if ((ROOT_DEV == 0) && root_wait) {
                printk(KERN_INFO "Waiting for root device %s...\n",
index f9c1ed002dbc81997e6e062f358c57b6e459ce84..d640a8b4dcbcc22dc197f1feb017d2bb5edb6889 100644 (file)
@@ -1524,6 +1524,11 @@ retry:
         */
        if (ctx->is_active) {
                raw_spin_unlock_irq(&ctx->lock);
+               /*
+                * Reload the task pointer, it might have been changed by
+                * a concurrent perf_event_context_sched_out().
+                */
+               task = ctx->task;
                goto retry;
        }
 
@@ -1967,6 +1972,11 @@ retry:
         */
        if (ctx->is_active) {
                raw_spin_unlock_irq(&ctx->lock);
+               /*
+                * Reload the task pointer, it might have been changed by
+                * a concurrent perf_event_context_sched_out().
+                */
+               task = ctx->task;
                goto retry;
        }
 
index 306baa594f95cd8ed8e5c945e4cc46e4f19c1f93..ba8019b063e18ecb14da4cf3a64dfa671586f8e0 100644 (file)
@@ -176,7 +176,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev,
        if (list_empty(&dev->dma_pools) &&
            device_create_file(dev, &dev_attr_pools)) {
                kfree(retval);
-               return NULL;
+               retval = NULL;
        } else
                list_add(&retval->pools, &dev->dma_pools);
        mutex_unlock(&pools_lock);
index ea823e1100dac29ad087267adfb1ebcecb8ce3c6..98cd1908c0393856e8bfeec7622874079d60c3c1 100644 (file)
@@ -566,8 +566,8 @@ static void stac_init_power_map(struct hda_codec *codec)
                if (snd_hda_jack_tbl_get(codec, nid))
                        continue;
                if (def_conf == AC_JACK_PORT_COMPLEX &&
-                   !(spec->vref_mute_led_nid == nid ||
-                     is_jack_detectable(codec, nid))) {
+                   spec->vref_mute_led_nid != nid &&
+                   is_jack_detectable(codec, nid)) {
                        snd_hda_jack_detect_enable_callback(codec, nid,
                                                            STAC_PWR_EVENT,
                                                            jack_update_power);
@@ -4276,11 +4276,18 @@ static int stac_parse_auto_config(struct hda_codec *codec)
                        return err;
        }
 
-       stac_init_power_map(codec);
-
        return 0;
 }
 
+static int stac_build_controls(struct hda_codec *codec)
+{
+       int err = snd_hda_gen_build_controls(codec);
+
+       if (err < 0)
+               return err;
+       stac_init_power_map(codec);
+       return 0;
+}
 
 static int stac_init(struct hda_codec *codec)
 {
@@ -4392,7 +4399,7 @@ static int stac_suspend(struct hda_codec *codec)
 #endif /* CONFIG_PM */
 
 static const struct hda_codec_ops stac_patch_ops = {
-       .build_controls = snd_hda_gen_build_controls,
+       .build_controls = stac_build_controls,
        .build_pcms = snd_hda_gen_build_pcms,
        .init = stac_init,
        .free = stac_free,
index 98523209f7391852cb0e517fb373c6635e2ded99..69a85164357c58ab66ae761edfe0449e9f9f471b 100644 (file)
@@ -458,12 +458,12 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream,
                if (params_width(params) == 16) {
                        snd_soc_update_bits(codec, CS4265_DAC_CTL,
                                CS4265_DAC_CTL_DIF, (1 << 5));
-                       snd_soc_update_bits(codec, CS4265_ADC_CTL,
+                       snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
                                CS4265_SPDIF_CTL2_DIF, (1 << 7));
                } else {
                        snd_soc_update_bits(codec, CS4265_DAC_CTL,
                                CS4265_DAC_CTL_DIF, (3 << 5));
-                       snd_soc_update_bits(codec, CS4265_ADC_CTL,
+                       snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
                                CS4265_SPDIF_CTL2_DIF, (1 << 7));
                }
                break;
@@ -472,7 +472,7 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream,
                        CS4265_DAC_CTL_DIF, 0);
                snd_soc_update_bits(codec, CS4265_ADC_CTL,
                        CS4265_ADC_DIF, 0);
-               snd_soc_update_bits(codec, CS4265_ADC_CTL,
+               snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
                        CS4265_SPDIF_CTL2_DIF, (1 << 6));
 
                break;
index 9aa1323fb2abef7d937125590aba3d36daa1523e..89c748dd3d6edd4f1075ef28afd518470b6ef518 100644 (file)
@@ -4,7 +4,7 @@
  * sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver
  *
  * Copyright (C) 2012 ST Microelectronics
- * Rajeev Kumar <rajeev-dlh.kumar@st.com>
+ * Rajeev Kumar <rajeevkumar.linux@gmail.com>
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2. This program is licensed "as is" without any
@@ -426,5 +426,5 @@ static struct i2c_driver sta529_i2c_driver = {
 module_i2c_driver(sta529_i2c_driver);
 
 MODULE_DESCRIPTION("ASoC STA529 codec driver");
-MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
+MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
 MODULE_LICENSE("GPL");
index 0f64c7890eed65a6efaaf1cea2bdf4b888950ca7..aea9e1ff9126592b91c70d29195725b0b2e183bd 100644 (file)
@@ -189,46 +189,57 @@ static const struct aic31xx_rate_divs aic31xx_divs[] = {
        /* mclk      rate  pll: p  j     d     dosr ndac mdac  aors nadc madc */
        /* 8k rate */
        {12000000,   8000,      1, 8, 1920,     128,  48,  2,   128,  48,  2},
+       {12000000,   8000,      1, 8, 1920,     128,  32,  3,   128,  32,  3},
        {24000000,   8000,      2, 8, 1920,     128,  48,  2,   128,  48,  2},
        {25000000,   8000,      2, 7, 8643,     128,  48,  2,   128,  48,  2},
        /* 11.025k rate */
        {12000000,  11025,      1, 7, 5264,     128,  32,  2,   128,  32,  2},
+       {12000000,  11025,      1, 8, 4672,     128,  24,  3,   128,  24,  3},
        {24000000,  11025,      2, 7, 5264,     128,  32,  2,   128,  32,  2},
        {25000000,  11025,      2, 7, 2253,     128,  32,  2,   128,  32,  2},
        /* 16k rate */
        {12000000,  16000,      1, 8, 1920,     128,  24,  2,   128,  24,  2},
+       {12000000,  16000,      1, 8, 1920,     128,  16,  3,   128,  16,  3},
        {24000000,  16000,      2, 8, 1920,     128,  24,  2,   128,  24,  2},
        {25000000,  16000,      2, 7, 8643,     128,  24,  2,   128,  24,  2},
        /* 22.05k rate */
        {12000000,  22050,      1, 7, 5264,     128,  16,  2,   128,  16,  2},
+       {12000000,  22050,      1, 8, 4672,     128,  12,  3,   128,  12,  3},
        {24000000,  22050,      2, 7, 5264,     128,  16,  2,   128,  16,  2},
        {25000000,  22050,      2, 7, 2253,     128,  16,  2,   128,  16,  2},
        /* 32k rate */
        {12000000,  32000,      1, 8, 1920,     128,  12,  2,   128,  12,  2},
+       {12000000,  32000,      1, 8, 1920,     128,   8,  3,   128,   8,  3},
        {24000000,  32000,      2, 8, 1920,     128,  12,  2,   128,  12,  2},
        {25000000,  32000,      2, 7, 8643,     128,  12,  2,   128,  12,  2},
        /* 44.1k rate */
        {12000000,  44100,      1, 7, 5264,     128,   8,  2,   128,   8,  2},
+       {12000000,  44100,      1, 8, 4672,     128,   6,  3,   128,   6,  3},
        {24000000,  44100,      2, 7, 5264,     128,   8,  2,   128,   8,  2},
        {25000000,  44100,      2, 7, 2253,     128,   8,  2,   128,   8,  2},
        /* 48k rate */
        {12000000,  48000,      1, 8, 1920,     128,   8,  2,   128,   8,  2},
+       {12000000,  48000,      1, 7, 6800,      96,   5,  4,    96,   5,  4},
        {24000000,  48000,      2, 8, 1920,     128,   8,  2,   128,   8,  2},
        {25000000,  48000,      2, 7, 8643,     128,   8,  2,   128,   8,  2},
        /* 88.2k rate */
        {12000000,  88200,      1, 7, 5264,      64,   8,  2,    64,   8,  2},
+       {12000000,  88200,      1, 8, 4672,      64,   6,  3,    64,   6,  3},
        {24000000,  88200,      2, 7, 5264,      64,   8,  2,    64,   8,  2},
        {25000000,  88200,      2, 7, 2253,      64,   8,  2,    64,   8,  2},
        /* 96k rate */
        {12000000,  96000,      1, 8, 1920,      64,   8,  2,    64,   8,  2},
+       {12000000,  96000,      1, 7, 6800,      48,   5,  4,    48,   5,  4},
        {24000000,  96000,      2, 8, 1920,      64,   8,  2,    64,   8,  2},
        {25000000,  96000,      2, 7, 8643,      64,   8,  2,    64,   8,  2},
        /* 176.4k rate */
        {12000000, 176400,      1, 7, 5264,      32,   8,  2,    32,   8,  2},
+       {12000000, 176400,      1, 8, 4672,      32,   6,  3,    32,   6,  3},
        {24000000, 176400,      2, 7, 5264,      32,   8,  2,    32,   8,  2},
        {25000000, 176400,      2, 7, 2253,      32,   8,  2,    32,   8,  2},
        /* 192k rate */
        {12000000, 192000,      1, 8, 1920,      32,   8,  2,    32,   8,  2},
+       {12000000, 192000,      1, 7, 6800,      24,   5,  4,    24,   5,  4},
        {24000000, 192000,      2, 8, 1920,      32,   8,  2,    32,   8,  2},
        {25000000, 192000,      2, 7, 8643,      32,   8,  2,    32,   8,  2},
 };
@@ -680,7 +691,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
                             struct snd_pcm_hw_params *params)
 {
        struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
+       int bclk_score = snd_soc_params_to_frame_size(params);
        int bclk_n = 0;
+       int match = -1;
        int i;
 
        /* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */
@@ -691,15 +704,37 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
 
        for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) {
                if (aic31xx_divs[i].rate == params_rate(params) &&
-                   aic31xx_divs[i].mclk == aic31xx->sysclk)
-                       break;
+                   aic31xx_divs[i].mclk == aic31xx->sysclk) {
+                       int s = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) %
+                               snd_soc_params_to_frame_size(params);
+                       int bn = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) /
+                               snd_soc_params_to_frame_size(params);
+                       if (s < bclk_score && bn > 0) {
+                               match = i;
+                               bclk_n = bn;
+                               bclk_score = s;
+                       }
+               }
        }
 
-       if (i == ARRAY_SIZE(aic31xx_divs)) {
-               dev_err(codec->dev, "%s: Sampling rate %u not supported\n",
+       if (match == -1) {
+               dev_err(codec->dev,
+                       "%s: Sample rate (%u) and format not supported\n",
                        __func__, params_rate(params));
+               /* See bellow for details how fix this. */
                return -EINVAL;
        }
+       if (bclk_score != 0) {
+               dev_warn(codec->dev, "Can not produce exact bitclock");
+               /* This is fine if using dsp format, but if using i2s
+                  there may be trouble. To fix the issue edit the
+                  aic31xx_divs table for your mclk and sample
+                  rate. Details can be found from:
+                  http://www.ti.com/lit/ds/symlink/tlv320aic3100.pdf
+                  Section: 5.6 CLOCK Generation and PLL
+               */
+       }
+       i = match;
 
        /* PLL configuration */
        snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK,
@@ -729,14 +764,6 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
        snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr);
 
        /* Bit clock divider configuration. */
-       bclk_n = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac)
-               / snd_soc_params_to_frame_size(params);
-       if (bclk_n == 0) {
-               dev_err(codec->dev, "%s: Not enough BLCK bandwidth\n",
-                       __func__);
-               return -EINVAL;
-       }
-
        snd_soc_update_bits(codec, AIC31XX_BCLKN,
                            AIC31XX_PLL_MASK, bclk_n);
 
index 6a6b2ff7d7d73daf4b6742242af4247e5585ebcc..68347b55f6e17ecd2aa900c875d22c45e4ab0bbe 100644 (file)
@@ -467,8 +467,17 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp,
 {
        u32 fmt;
        u32 tx_rotate = (word_length / 4) & 0x7;
-       u32 rx_rotate = (32 - word_length) / 4;
        u32 mask = (1ULL << word_length) - 1;
+       /*
+        * For captured data we should not rotate, inversion and masking is
+        * enoguh to get the data to the right position:
+        * Format         data from bus         after reverse (XRBUF)
+        * S16_LE:      |LSB|MSB|xxx|xxx|       |xxx|xxx|MSB|LSB|
+        * S24_3LE:     |LSB|DAT|MSB|xxx|       |xxx|MSB|DAT|LSB|
+        * S24_LE:      |LSB|DAT|MSB|xxx|       |xxx|MSB|DAT|LSB|
+        * S32_LE:      |LSB|DAT|DAT|MSB|       |MSB|DAT|DAT|LSB|
+        */
+       u32 rx_rotate = 0;
 
        /*
         * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv()
index 25c31f1655f682f3e5c630c08c8b09fdfe2901cc..e961388e6e9c07ce3b5b7249d464538e5d418ea0 100644 (file)
@@ -4,7 +4,7 @@
  * sound/soc/dwc/designware_i2s.c
  *
  * Copyright (C) 2010 ST Microelectronics
- * Rajeev Kumar <rajeev-dlh.kumar@st.com>
+ * Rajeev Kumar <rajeevkumar.linux@gmail.com>
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2. This program is licensed "as is" without any
@@ -455,7 +455,7 @@ static struct platform_driver dw_i2s_driver = {
 
 module_platform_driver(dw_i2s_driver);
 
-MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
+MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
 MODULE_DESCRIPTION("DESIGNWARE I2S SoC Interface");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:designware_i2s");
index 8d8e4b59049f2669fc503e05dd66ef52cb9e960c..fb9e05c9f47199c7bdcbd8413846899b074615ce 100644 (file)
@@ -165,13 +165,14 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
        struct rk_i2s_dev *i2s = to_info(cpu_dai);
        unsigned int mask = 0, val = 0;
 
-       mask = I2S_CKR_MSS_SLAVE;
+       mask = I2S_CKR_MSS_MASK;
        switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
        case SND_SOC_DAIFMT_CBS_CFS:
-               val = I2S_CKR_MSS_SLAVE;
+               /* Set source clock in Master mode */
+               val = I2S_CKR_MSS_MASTER;
                break;
        case SND_SOC_DAIFMT_CBM_CFM:
-               val = I2S_CKR_MSS_MASTER;
+               val = I2S_CKR_MSS_SLAVE;
                break;
        default:
                return -EINVAL;
@@ -361,6 +362,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg)
        case I2S_XFER:
        case I2S_CLR:
        case I2S_RXDR:
+       case I2S_FIFOLR:
+       case I2S_INTSR:
                return true;
        default:
                return false;
@@ -370,8 +373,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg)
 static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
 {
        switch (reg) {
-       case I2S_FIFOLR:
        case I2S_INTSR:
+       case I2S_CLR:
                return true;
        default:
                return false;
@@ -381,8 +384,6 @@ static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
 static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg)
 {
        switch (reg) {
-       case I2S_FIFOLR:
-               return true;
        default:
                return false;
        }
index 03eec22f0f46e9288ee3e6ec5a2928e3ddff8fb1..9d513473b3007c0c3e022ca6927e29071dfb6db6 100644 (file)
@@ -462,7 +462,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
                if (dir == SND_SOC_CLOCK_IN)
                        rfs = 0;
 
-               if ((rfs && other->rfs && (other->rfs != rfs)) ||
+               if ((rfs && other && other->rfs && (other->rfs != rfs)) ||
                                (any_active(i2s) &&
                                (((dir == SND_SOC_CLOCK_IN)
                                        && !(mod & MOD_CDCLKCON)) ||
@@ -762,7 +762,8 @@ static void i2s_shutdown(struct snd_pcm_substream *substream,
        } else {
                u32 mod = readl(i2s->addr + I2SMOD);
                i2s->cdclk_out = !(mod & MOD_CDCLKCON);
-               other->cdclk_out = i2s->cdclk_out;
+               if (other)
+                       other->cdclk_out = i2s->cdclk_out;
        }
        /* Reset any constraint on RFS and BFS */
        i2s->rfs = 0;
index 27c06acce205c0887a3663cc0854b851eddefcf3..3092b58fede640cf369e69e9cb0f72e6e89e5593 100644 (file)
@@ -101,7 +101,11 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
 
        fe->dpcm[stream].runtime = fe_substream->runtime;
 
-       if (dpcm_path_get(fe, stream, &list) <= 0) {
+       ret = dpcm_path_get(fe, stream, &list);
+       if (ret < 0) {
+               mutex_unlock(&fe->card->mutex);
+               goto fe_err;
+       } else if (ret == 0) {
                dev_dbg(fe->dev, "ASoC: %s no valid %s route\n",
                        fe->dai_link->name, stream ? "capture" : "playback");
        }
index 731fdb5b5f9bf898c84533641252b561cc0065fa..642c862407520db3e36b4ddadf1b5d7a6b467749 100644 (file)
@@ -2352,7 +2352,11 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
        mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
        fe->dpcm[stream].runtime = fe_substream->runtime;
 
-       if (dpcm_path_get(fe, stream, &list) <= 0) {
+       ret = dpcm_path_get(fe, stream, &list);
+       if (ret < 0) {
+               mutex_unlock(&fe->card->mutex);
+               return ret;
+       } else if (ret == 0) {
                dev_dbg(fe->dev, "ASoC: %s no valid %s route\n",
                        fe->dai_link->name, stream ? "capture" : "playback");
        }
index 0e5a8f35d0ad22da7925445a5d074fefb5478ab1..a7dc3c56f44d95cfc611ca27975bf43349f90ca1 100644 (file)
@@ -4,7 +4,7 @@
  * sound/soc/spear/spear_pcm.c
  *
  * Copyright (C) 2012 ST Microelectronics
- * Rajeev Kumar<rajeev-dlh.kumar@st.com>
+ * Rajeev Kumar<rajeevkumar.linux@gmail.com>
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2. This program is licensed "as is" without any
@@ -50,6 +50,6 @@ int devm_spear_pcm_platform_register(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register);
 
-MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
+MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
 MODULE_DESCRIPTION("SPEAr PCM DMA module");
 MODULE_LICENSE("GPL");