History

Merge branches 'acpi-hotplug', 'acpi-scan', 'acpi-lpss', 'acpi-gpio' and 'acpi-video'

* acpi-hotplug: ACPI / hotplug: Generate online uevents for ACPI containers * acpi-scan: ACPI / scan: Correct error return value of create_modalias() * acpi-lpss: ACPI / platform / LPSS: disable async suspend/resume of LPSS devices * acpi-gpio: gpio / ACPI: Use pin index and bit length ACPICA: Update to GPIO region handler interface. * acpi-video: ACPI / video: disable native backlight for ThinkPad X201s

Rafael J. Wysocki committed 12 years ago

Commit 9ef5a305 parents 8ab17fc 98d28d0 4579208 c15d821 789eeea177 files · +1195 −631Browse files

Unified · Split

177 files
  1. Documentation/devicetree/bindings/input/atmel,maxtouch.txt +0 −4
  2. Documentation/devicetree/bindings/sound/rockchip-i2s.txt +1 −1
  3. Documentation/devicetree/bindings/spi/spi-rockchip.txt +6 −2
  4. MAINTAINERS +1 −1
  5. Makefile +1 −1
  6. arch/arm/include/asm/tls.h +62 −0
  7. arch/arm/include/asm/uaccess.h +39 −9
  8. arch/arm/kernel/armksyms.c +8 −0
  9. arch/arm/kernel/irq.c +1 −1
  10. arch/arm/kernel/perf_event_cpu.c +4 −10
  11. arch/arm/kernel/process.c +2 −0
  12. arch/arm/kernel/swp_emulate.c +0 −15
  13. arch/arm/kernel/thumbee.c +1 −1
  14. arch/arm/kernel/traps.c +1 −16
  15. arch/arm/lib/getuser.S +36 −2
  16. arch/arm/mm/proc-v7-3level.S +0 −1
  17. arch/arm64/mm/init.c +1 −2
  18. arch/ia64/include/uapi/asm/unistd.h +1 −1
  19. arch/ia64/pci/fixup.c +1 −23
  20. arch/mips/Kconfig +3 −0
  21. arch/mips/Makefile +10 −1
  22. arch/mips/bcm63xx/irq.c +2 −2
  23. arch/mips/boot/compressed/decompress.c +1 −0
  24. arch/mips/include/asm/cop2.h +9 −9
  25. arch/mips/include/asm/mach-ip28/spaces.h +0 −7
  26. arch/mips/include/asm/page.h +3 −2
  27. arch/mips/include/asm/smp.h +0 −5
  28. arch/mips/include/asm/switch_to.h +2 −2
  29. arch/mips/include/asm/topology.h +8 −0
  30. arch/mips/include/uapi/asm/unistd.h +12 −6
  31. arch/mips/kernel/machine_kexec.c +6 −2
  32. arch/mips/kernel/scall32-o32.S +2 −0
  33. arch/mips/kernel/scall64-64.S +2 −0
  34. arch/mips/kernel/scall64-n32.S +2 −0
  35. arch/mips/kernel/scall64-o32.S +2 −0
  36. arch/mips/net/bpf_jit.c +3 −2
  37. arch/x86/boot/compressed/eboot.c +11 −7
  38. arch/x86/boot/compressed/head_32.S +40 −14
  39. arch/x86/boot/compressed/head_64.S +41 −15
  40. arch/x86/include/asm/io_apic.h +1 −0
  41. arch/x86/kernel/kprobes/opt.c +3 −1
  42. arch/x86/mm/dump_pagetables.c +4 −0
  43. arch/x86/mm/mmap.c +1 −1
  44. arch/x86/pci/fixup.c +1 −23
  45. crypto/drbg.c +0 −3
  46. drivers/acpi/acpi_lpss.c +0 −1
  47. drivers/acpi/acpica/aclocal.h +1 −0
  48. drivers/acpi/acpica/acobject.h +1 −0
  49. drivers/acpi/acpica/dsfield.c +2 −0
  50. drivers/acpi/acpica/evregion.c +31 −16
  51. drivers/acpi/acpica/exfield.c +67 −0
  52. drivers/acpi/acpica/exprep.c +2 −0
  53. drivers/acpi/bus.c +0 −10
  54. drivers/acpi/scan.c +1 −1
  55. drivers/acpi/video.c +8 −0
  56. drivers/base/regmap/regmap-debugfs.c +8 −1
  57. drivers/char/hw_random/virtio-rng.c +7 −0
  58. drivers/firmware/efi/libstub/fdt.c +9 −1
  59. drivers/gpio/gpiolib-acpi.c +4 −1
  60. drivers/gpu/drm/bochs/bochs_kms.c +1 −0
  61. drivers/gpu/drm/cirrus/cirrus_mode.c +1 −0
  62. drivers/gpu/drm/i915/intel_dp.c +4 −0
  63. drivers/gpu/drm/i915/intel_hdmi.c +6 −1
  64. drivers/gpu/drm/i915/intel_ringbuffer.c +1 −1
  65. drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c +0 −1
  66. drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c +1 −0
  67. drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c +2 −0
  68. drivers/gpu/drm/nouveau/core/subdev/ltc/gk104.c +2 −0
  69. drivers/gpu/drm/nouveau/core/subdev/ltc/gm107.c +2 −0
  70. drivers/gpu/drm/nouveau/nouveau_acpi.c +2 −14
  71. drivers/gpu/drm/nouveau/nouveau_drm.c +1 −0
  72. drivers/gpu/drm/nouveau/nouveau_vga.c +9 −0
  73. drivers/gpu/drm/radeon/cik_sdma.c +0 −7
  74. drivers/gpu/drm/radeon/kv_dpm.c +21 −7
  75. drivers/gpu/drm/radeon/ni_dma.c +0 −6
  76. drivers/gpu/drm/radeon/r100.c +14 −14
  77. drivers/gpu/drm/radeon/r600_dma.c +0 −9
  78. drivers/gpu/drm/radeon/r600d.h +0 −7
  79. drivers/gpu/drm/radeon/radeon_asic.c +0 −2
  80. drivers/gpu/drm/radeon/radeon_asic.h +1 −2
  81. drivers/gpu/drm/radeon/radeon_atpx_handler.c +2 −14
  82. drivers/gpu/drm/radeon/radeon_device.c +9 −2
  83. drivers/gpu/drm/radeon/radeon_drv.c +2 −1
  84. drivers/gpu/drm/radeon/rs400.c +2 −2
  85. drivers/gpu/drm/sti/sti_hdmi.c +0 −1
  86. drivers/gpu/vga/vga_switcheroo.c +6 −0
  87. drivers/gpu/vga/vgaarb.c +37 −9
  88. drivers/iio/accel/bma180.c +1 −1
  89. drivers/iio/adc/ad_sigma_delta.c +1 −1
  90. drivers/iio/adc/at91_adc.c +7 −5
  91. drivers/iio/adc/xilinx-xadc-core.c +1 −1
  92. drivers/iio/common/hid-sensors/hid-sensor-trigger.c +2 −1
  93. drivers/iio/common/st_sensors/st_sensors_trigger.c +1 −1
  94. drivers/iio/gyro/itg3200_buffer.c +1 −1
  95. drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c +1 −1
  96. drivers/iio/inkern.c +1 −1
  97. drivers/iio/magnetometer/st_magn_core.c +30 −22
  98. drivers/infiniband/ulp/isert/ib_isert.c +11 −9
  99. drivers/input/keyboard/atkbd.c +0 −8
  100. drivers/input/serio/i8042-x86ia64io.h +15 −0
  101. drivers/input/serio/i8042.c +2 −0
  102. drivers/media/Kconfig +0 −1
  103. drivers/media/dvb-core/dvb-usb-ids.h +2 −0
  104. drivers/media/dvb-frontends/af9033.c +13 −0
  105. drivers/media/dvb-frontends/af9033_priv.h +9 −11
  106. drivers/media/i2c/smiapp/smiapp-core.c +3 −10
  107. drivers/media/pci/cx18/cx18-driver.c +1 −0
  108. drivers/media/tuners/tuner_it913x.c +6 −0
  109. drivers/media/usb/dvb-usb-v2/af9035.c +4 −0
  110. drivers/pci/host/pci-imx6.c +38 −0
  111. drivers/pci/hotplug/acpiphp_glue.c +6 −10
  112. drivers/pci/hotplug/pciehp_hpc.c +12 −0
  113. drivers/pci/hotplug/pcihp_slot.c +1 −5
  114. drivers/phy/Kconfig +2 −0
  115. drivers/phy/phy-miphy365x.c +1 −0
  116. drivers/regulator/88pm8607.c +1 −1
  117. drivers/regulator/da9052-regulator.c +2 −2
  118. drivers/regulator/max8907-regulator.c +1 −1
  119. drivers/regulator/max8925-regulator.c +1 −1
  120. drivers/regulator/max8997.c +1 −1
  121. drivers/regulator/palmas-regulator.c +0 −1
  122. drivers/regulator/tps65910-regulator.c +1 −1
  123. drivers/scsi/libiscsi.c +10 −0
  124. drivers/scsi/scsi_lib.c +3 −2
  125. drivers/spi/spi-davinci.c +25 −14
  126. drivers/spi/spi-dw.c +10 −2
  127. drivers/spi/spi-fsl-espi.c +12 −3
  128. drivers/spi/spi-fsl-spi.c +7 −3
  129. drivers/spi/spi-pl022.c +1 −1
  130. drivers/spi/spi-rockchip.c +3 −2
  131. drivers/spi/spi-sirf.c +4 −1
  132. drivers/staging/iio/meter/ade7758_trigger.c +1 −1
  133. drivers/staging/vt6655/hostap.c +3 −0
  134. drivers/target/iscsi/iscsi_target.c +3 −1
  135. drivers/target/iscsi/iscsi_target_parameters.c +1 −1
  136. drivers/target/iscsi/iscsi_target_util.c +2 −0
  137. drivers/target/target_core_configfs.c +1 −1
  138. drivers/target/target_core_spc.c +1 −1
  139. drivers/usb/host/ehci-hcd.c +0 −2
  140. drivers/usb/storage/unusual_devs.h +32 −0
  141. fs/btrfs/btrfs_inode.h +11 −2
  142. fs/btrfs/tree-log.c +2 −12
  143. fs/btrfs/volumes.c +6 −7
  144. fs/cifs/cifsfs.h +1 −1
  145. fs/cifs/connect.c +19 −0
  146. fs/cifs/link.c +9 −3
  147. fs/cifs/netmisc.c +16 −4
  148. fs/cifs/sess.c +0 −17
  149. fs/gfs2/bmap.c +5 −4
  150. fs/gfs2/file.c +12 −3
  151. fs/gfs2/incore.h +5 −2
  152. fs/gfs2/inode.c +6 −3
  153. fs/gfs2/super.c +10 −10
  154. fs/namei.c +18 −21
  155. fs/nfs/nfs4client.c +20 −18
  156. fs/nfs/nfs4proc.c +22 −18
  157. include/acpi/acpi_bus.h +1 −3
  158. include/crypto/drbg.h +13 −0
  159. include/linux/iio/trigger.h +3 −1
  160. include/linux/pci.h +6 −0
  161. include/linux/vga_switcheroo.h +2 −0
  162. include/linux/vgaarb.h +0 −2
  163. include/scsi/scsi_tcq.h +1 −1
  164. init/do_mounts.c +6 −6
  165. kernel/events/core.c +10 −0
  166. mm/dmapool.c +1 −1
  167. sound/pci/hda/patch_sigmatel.c +12 −5
  168. sound/soc/codecs/cs4265.c +3 −3
  169. sound/soc/codecs/sta529.c +2 −2
  170. sound/soc/codecs/tlv320aic31xx.c +39 −12
  171. sound/soc/davinci/davinci-mcasp.c +10 −1
  172. sound/soc/dwc/designware_i2s.c +2 −2
  173. sound/soc/rockchip/rockchip_i2s.c +7 −6
  174. sound/soc/samsung/i2s.c +3 −2
  175. sound/soc/soc-compress.c +5 −1
  176. sound/soc/soc-pcm.c +5 −1
  177. sound/soc/spear/spear_pcm.c +2 −2
Documentation/devicetree/bindings/input/atmel,maxtouch.txt+0−4
@@ -11,10 +11,6 @@ Required properties: · 10 unmodified lines
1111
1212 Optional properties for main touchpad device:
1313
14−- linux,gpio-keymap: An array of up to 4 entries indicating the Linux
15− keycode generated by each GPIO. Linux keycodes are defined in
16− <dt-bindings/input/input.h>.
17−
1814 - linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages
1915 on GPIO bit changes. An array of up to 8 entries can be provided
2016 indicating the Linux keycode mapped to each bit of the status byte,
Documentation/devicetree/bindings/sound/rockchip-i2s.txt+1−1
@@ -31,7 +31,7 @@ i2s@ff890000 { · 30 unmodified lines
3131 #address-cells = <1>;
3232 #size-cells = <0>;
3333 dmas = <&pdma1 0>, <&pdma1 1>;
34− dma-names = "rx", "tx";
34+ dma-names = "tx", "rx";
3535 clock-names = "i2s_hclk", "i2s_clk";
3636 clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>;
3737 };
Documentation/devicetree/bindings/spi/spi-rockchip.txt+6−2
@@ -16,11 +16,15 @@ Required Properties: · 15 unmodified lines
1616 - clocks: Must contain an entry for each entry in clock-names.
1717 - clock-names: Shall be "spiclk" for the transfer-clock, and "apb_pclk" for
1818 the peripheral clock.
19+- #address-cells: should be 1.
20+- #size-cells: should be 0.
21+
22+Optional Properties:
23+
1924 - dmas: DMA specifiers for tx and rx dma. See the DMA client binding,
2025 Documentation/devicetree/bindings/dma/dma.txt
2126 - dma-names: DMA request names should include "tx" and "rx" if present.
22−- #address-cells: should be 1.
23−- #size-cells: should be 0.
27+
2428
2529 Example:
2630
MAINTAINERS+1−1
@@ -6876,7 +6876,7 @@ F: arch/x86/kernel/quirks.c · 6875 unmodified lines
68766876
68776877 PCI DRIVER FOR IMX6
68786878 M: Richard Zhu <r65037@freescale.com>
6879−M: Shawn Guo <shawn.guo@freescale.com>
6879+M: Lucas Stach <l.stach@pengutronix.de>
68806880 L: linux-pci@vger.kernel.org
68816881 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
68826882 S: Maintained
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 3
22 PATCHLEVEL = 17
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc5
4+EXTRAVERSION = -rc6
55 NAME = Shuffling Zombie Juror
66
77 # *DOCUMENTATION*
arch/arm/include/asm/tls.h+62−0
@@ -1,6 +1,9 @@
11 #ifndef __ASMARM_TLS_H
22 #define __ASMARM_TLS_H
33
4+#include <linux/compiler.h>
5+#include <asm/thread_info.h>
6+
47 #ifdef __ASSEMBLY__
58 #include <asm/asm-offsets.h>
69 .macro switch_tls_none, base, tp, tpuser, tmp1, tmp2
@@ -50,6 +53,47 @@ · 43 unmodified lines
5053 #endif
5154
5255 #ifndef __ASSEMBLY__
56+
57+static inline void set_tls(unsigned long val)
58+{
59+ struct thread_info *thread;
60+
61+ thread = current_thread_info();
62+
63+ thread->tp_value[0] = val;
64+
65+ /*
66+ * This code runs with preemption enabled and therefore must
67+ * be reentrant with respect to switch_tls.
68+ *
69+ * We need to ensure ordering between the shadow state and the
70+ * hardware state, so that we don't corrupt the hardware state
71+ * with a stale shadow state during context switch.
72+ *
73+ * If we're preempted here, switch_tls will load TPIDRURO from
74+ * thread_info upon resuming execution and the following mcr
75+ * is merely redundant.
76+ */
77+ barrier();
78+
79+ if (!tls_emu) {
80+ if (has_tls_reg) {
81+ asm("mcr p15, 0, %0, c13, c0, 3"
82+ : : "r" (val));
83+ } else {
84+ /*
85+ * User space must never try to access this
86+ * directly. Expect your app to break
87+ * eventually if you do so. The user helper
88+ * at 0xffff0fe0 must be used instead. (see
89+ * entry-armv.S for details)
90+ */
91+ *((unsigned int *)0xffff0ff0) = val;
92+ }
93+
94+ }
95+}
96+
5397 static inline unsigned long get_tpuser(void)
5498 {
5599 unsigned long reg = 0;
@@ -59,5 +103,23 @@ static inline unsigned long get_tpuser(void) · 3 unmodified lines
59103
60104 return reg;
61105 }
106+
107+static inline void set_tpuser(unsigned long val)
108+{
109+ /* Since TPIDRURW is fully context-switched (unlike TPIDRURO),
110+ * we need not update thread_info.
111+ */
112+ if (has_tls_reg && !tls_emu) {
113+ asm("mcr p15, 0, %0, c13, c0, 2"
114+ : : "r" (val));
115+ }
116+}
117+
118+static inline void flush_tls(void)
119+{
120+ set_tls(0);
121+ set_tpuser(0);
122+}
123+
62124 #endif
63125 #endif /* __ASMARM_TLS_H */
arch/arm/include/asm/uaccess.h+39−9
@@ -107,8 +107,11 @@ static inline void set_fs(mm_segment_t fs) · 106 unmodified lines
107107 extern int __get_user_1(void *);
108108 extern int __get_user_2(void *);
109109 extern int __get_user_4(void *);
110−extern int __get_user_lo8(void *);
110+extern int __get_user_32t_8(void *);
111111 extern int __get_user_8(void *);
112+extern int __get_user_64t_1(void *);
113+extern int __get_user_64t_2(void *);
114+extern int __get_user_64t_4(void *);
112115
113116 #define __GUP_CLOBBER_1 "lr", "cc"
114117 #ifdef CONFIG_CPU_USE_DOMAINS
@@ -117,7 +120,7 @@ extern int __get_user_8(void *); · 2 unmodified lines
117120 #define __GUP_CLOBBER_2 "lr", "cc"
118121 #endif
119122 #define __GUP_CLOBBER_4 "lr", "cc"
120−#define __GUP_CLOBBER_lo8 "lr", "cc"
123+#define __GUP_CLOBBER_32t_8 "lr", "cc"
121124 #define __GUP_CLOBBER_8 "lr", "cc"
122125
123126 #define __get_user_x(__r2,__p,__e,__l,__s) \
@@ -131,12 +134,30 @@ extern int __get_user_8(void *); · 7 unmodified lines
131134
132135 /* narrowing a double-word get into a single 32bit word register: */
133136 #ifdef __ARMEB__
134−#define __get_user_xb(__r2, __p, __e, __l, __s) \
135− __get_user_x(__r2, __p, __e, __l, lo8)
137+#define __get_user_x_32t(__r2, __p, __e, __l, __s) \
138+ __get_user_x(__r2, __p, __e, __l, 32t_8)
136139 #else
137−#define __get_user_xb __get_user_x
140+#define __get_user_x_32t __get_user_x
138141 #endif
139142
143+/*
144+ * storing result into proper least significant word of 64bit target var,
145+ * different only for big endian case where 64 bit __r2 lsw is r3:
146+ */
147+#ifdef __ARMEB__
148+#define __get_user_x_64t(__r2, __p, __e, __l, __s) \
149+ __asm__ __volatile__ ( \
150+ __asmeq("%0", "r0") __asmeq("%1", "r2") \
151+ __asmeq("%3", "r1") \
152+ "bl __get_user_64t_" #__s \
153+ : "=&r" (__e), "=r" (__r2) \
154+ : "0" (__p), "r" (__l) \
155+ : __GUP_CLOBBER_##__s)
156+#else
157+#define __get_user_x_64t __get_user_x
158+#endif
159+
160+
140161 #define __get_user_check(x,p) \
141162 ({ \
142163 unsigned long __limit = current_thread_info()->addr_limit - 1; \
@@ -146,17 +167,26 @@ extern int __get_user_8(void *); · 3 unmodified lines
146167 register int __e asm("r0"); \
147168 switch (sizeof(*(__p))) { \
148169 case 1: \
149− __get_user_x(__r2, __p, __e, __l, 1); \
170+ if (sizeof((x)) >= 8) \
171+ __get_user_x_64t(__r2, __p, __e, __l, 1); \
172+ else \
173+ __get_user_x(__r2, __p, __e, __l, 1); \
150174 break; \
151175 case 2: \
152− __get_user_x(__r2, __p, __e, __l, 2); \
176+ if (sizeof((x)) >= 8) \
177+ __get_user_x_64t(__r2, __p, __e, __l, 2); \
178+ else \
179+ __get_user_x(__r2, __p, __e, __l, 2); \
153180 break; \
154181 case 4: \
155− __get_user_x(__r2, __p, __e, __l, 4); \
182+ if (sizeof((x)) >= 8) \
183+ __get_user_x_64t(__r2, __p, __e, __l, 4); \
184+ else \
185+ __get_user_x(__r2, __p, __e, __l, 4); \
156186 break; \
157187 case 8: \
158188 if (sizeof((x)) < 8) \
159− __get_user_xb(__r2, __p, __e, __l, 4); \
189+ __get_user_x_32t(__r2, __p, __e, __l, 4); \
160190 else \
161191 __get_user_x(__r2, __p, __e, __l, 8); \
162192 break; \
arch/arm/kernel/armksyms.c+8−0
@@ -98,6 +98,14 @@ EXPORT_SYMBOL(__clear_user); · 97 unmodified lines
9898 EXPORT_SYMBOL(__get_user_1);
9999 EXPORT_SYMBOL(__get_user_2);
100100 EXPORT_SYMBOL(__get_user_4);
101+EXPORT_SYMBOL(__get_user_8);
102+
103+#ifdef __ARMEB__
104+EXPORT_SYMBOL(__get_user_64t_1);
105+EXPORT_SYMBOL(__get_user_64t_2);
106+EXPORT_SYMBOL(__get_user_64t_4);
107+EXPORT_SYMBOL(__get_user_32t_8);
108+#endif
101109
102110 EXPORT_SYMBOL(__put_user_1);
103111 EXPORT_SYMBOL(__put_user_2);
arch/arm/kernel/irq.c+1−1
@@ -175,7 +175,7 @@ static bool migrate_one_irq(struct irq_desc *desc) · 174 unmodified lines
175175 c = irq_data_get_irq_chip(d);
176176 if (!c->irq_set_affinity)
177177 pr_debug("IRQ%u: unable to set affinity\n", d->irq);
178− else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
178+ else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
179179 cpumask_copy(d->affinity, affinity);
180180
181181 return ret;
arch/arm/kernel/perf_event_cpu.c+4−10
@@ -76,21 +76,15 @@ static struct pmu_hw_events *cpu_pmu_get_cpu_events(void) · 75 unmodified lines
7676
7777 static void cpu_pmu_enable_percpu_irq(void *data)
7878 {
79− struct arm_pmu *cpu_pmu = data;
80− struct platform_device *pmu_device = cpu_pmu->plat_device;
81− int irq = platform_get_irq(pmu_device, 0);
79+ int irq = *(int *)data;
8280
8381 enable_percpu_irq(irq, IRQ_TYPE_NONE);
84− cpumask_set_cpu(smp_processor_id(), &cpu_pmu->active_irqs);
8582 }
8683
8784 static void cpu_pmu_disable_percpu_irq(void *data)
8885 {
89− struct arm_pmu *cpu_pmu = data;
90− struct platform_device *pmu_device = cpu_pmu->plat_device;
91− int irq = platform_get_irq(pmu_device, 0);
86+ int irq = *(int *)data;
9287
93− cpumask_clear_cpu(smp_processor_id(), &cpu_pmu->active_irqs);
9488 disable_percpu_irq(irq);
9589 }
9690
@@ -103,7 +97,7 @@ static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu) · 6 unmodified lines
10397
10498 irq = platform_get_irq(pmu_device, 0);
10599 if (irq >= 0 && irq_is_percpu(irq)) {
106− on_each_cpu(cpu_pmu_disable_percpu_irq, cpu_pmu, 1);
100+ on_each_cpu(cpu_pmu_disable_percpu_irq, &irq, 1);
107101 free_percpu_irq(irq, &percpu_pmu);
108102 } else {
109103 for (i = 0; i < irqs; ++i) {
@@ -138,7 +132,7 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler) · 28 unmodified lines
138132 irq);
139133 return err;
140134 }
141− on_each_cpu(cpu_pmu_enable_percpu_irq, cpu_pmu, 1);
135+ on_each_cpu(cpu_pmu_enable_percpu_irq, &irq, 1);
142136 } else {
143137 for (i = 0; i < irqs; ++i) {
144138 err = 0;
arch/arm/kernel/process.c+2−0
@@ -334,6 +334,8 @@ void flush_thread(void) · 333 unmodified lines
334334 memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
335335 memset(&thread->fpstate, 0, sizeof(union fp_state));
336336
337+ flush_tls();
338+
337339 thread_notify(THREAD_NOTIFY_FLUSH, thread);
338340 }
339341
arch/arm/kernel/swp_emulate.c+0−15
@@ -142,14 +142,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data, · 141 unmodified lines
142142 while (1) {
143143 unsigned long temp;
144144
145− /*
146− * Barrier required between accessing protected resource and
147− * releasing a lock for it. Legacy code might not have done
148− * this, and we cannot determine that this is not the case
149− * being emulated, so insert always.
150− */
151− smp_mb();
152−
153145 if (type == TYPE_SWPB)
154146 __user_swpb_asm(*data, address, res, temp);
155147 else
@@ -162,13 +154,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data, · 6 unmodified lines
162154 }
163155
164156 if (res == 0) {
165− /*
166− * Barrier also required between acquiring a lock for a
167− * protected resource and accessing the resource. Inserted for
168− * same reason as above.
169− */
170− smp_mb();
171−
172157 if (type == TYPE_SWPB)
173158 swpbcounter++;
174159 else
arch/arm/kernel/thumbee.c+1−1
@@ -45,7 +45,7 @@ static int thumbee_notifier(struct notifier_block *self, unsigned long cmd, void · 44 unmodified lines
4545
4646 switch (cmd) {
4747 case THREAD_NOTIFY_FLUSH:
48− thread->thumbee_state = 0;
48+ teehbr_write(0);
4949 break;
5050 case THREAD_NOTIFY_SWITCH:
5151 current_thread_info()->thumbee_state = teehbr_read();
arch/arm/kernel/traps.c+1−16
@@ -581,7 +581,6 @@ do_cache_op(unsigned long start, unsigned long end, int flags) · 580 unmodified lines
581581 #define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE)
582582 asmlinkage int arm_syscall(int no, struct pt_regs *regs)
583583 {
584− struct thread_info *thread = current_thread_info();
585584 siginfo_t info;
586585
587586 if ((no >> 16) != (__ARM_NR_BASE>> 16))
@@ -632,21 +631,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) · 44 unmodified lines
632631 return regs->ARM_r0;
633632
634633 case NR(set_tls):
635− thread->tp_value[0] = regs->ARM_r0;
636− if (tls_emu)
637− return 0;
638− if (has_tls_reg) {
639− asm ("mcr p15, 0, %0, c13, c0, 3"
640− : : "r" (regs->ARM_r0));
641− } else {
642− /*
643− * User space must never try to access this directly.
644− * Expect your app to break eventually if you do so.
645− * The user helper at 0xffff0fe0 must be used instead.
646− * (see entry-armv.S for details)
647− */
648− *((unsigned int *)0xffff0ff0) = regs->ARM_r0;
649− }
634+ set_tls(regs->ARM_r0);
650635 return 0;
651636
652637 #ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG
arch/arm/lib/getuser.S+36−2
@@ -80,7 +80,7 @@ ENTRY(__get_user_8) · 79 unmodified lines
8080 ENDPROC(__get_user_8)
8181
8282 #ifdef __ARMEB__
83−ENTRY(__get_user_lo8)
83+ENTRY(__get_user_32t_8)
8484 check_uaccess r0, 8, r1, r2, __get_user_bad
8585 #ifdef CONFIG_CPU_USE_DOMAINS
8686 add r0, r0, #4
@@ -90,7 +90,37 @@ ENTRY(__get_user_lo8) · 3 unmodified lines
9090 #endif
9191 mov r0, #0
9292 ret lr
93−ENDPROC(__get_user_lo8)
93+ENDPROC(__get_user_32t_8)
94+
95+ENTRY(__get_user_64t_1)
96+ check_uaccess r0, 1, r1, r2, __get_user_bad8
97+8: TUSER(ldrb) r3, [r0]
98+ mov r0, #0
99+ ret lr
100+ENDPROC(__get_user_64t_1)
101+
102+ENTRY(__get_user_64t_2)
103+ check_uaccess r0, 2, r1, r2, __get_user_bad8
104+#ifdef CONFIG_CPU_USE_DOMAINS
105+rb .req ip
106+9: ldrbt r3, [r0], #1
107+10: ldrbt rb, [r0], #0
108+#else
109+rb .req r0
110+9: ldrb r3, [r0]
111+10: ldrb rb, [r0, #1]
112+#endif
113+ orr r3, rb, r3, lsl #8
114+ mov r0, #0
115+ ret lr
116+ENDPROC(__get_user_64t_2)
117+
118+ENTRY(__get_user_64t_4)
119+ check_uaccess r0, 4, r1, r2, __get_user_bad8
120+11: TUSER(ldr) r3, [r0]
121+ mov r0, #0
122+ ret lr
123+ENDPROC(__get_user_64t_4)
94124 #endif
95125
96126 __get_user_bad8:
@@ -111,5 +141,9 @@ ENDPROC(__get_user_bad8) · 14 unmodified lines
111141 .long 6b, __get_user_bad8
112142 #ifdef __ARMEB__
113143 .long 7b, __get_user_bad
144+ .long 8b, __get_user_bad8
145+ .long 9b, __get_user_bad8
146+ .long 10b, __get_user_bad8
147+ .long 11b, __get_user_bad8
114148 #endif
115149 .popsection
arch/arm/mm/proc-v7-3level.S+0−1
@@ -146,7 +146,6 @@ ENDPROC(cpu_v7_set_pte_ext) · 145 unmodified lines
146146 mov \tmp, \ttbr1, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits
147147 mov \ttbr1, \ttbr1, lsl #ARCH_PGD_SHIFT @ lower bits
148148 addls \ttbr1, \ttbr1, #TTBR1_OFFSET
149− adcls \tmp, \tmp, #0
150149 mcrr p15, 1, \ttbr1, \tmp, c2 @ load TTBR1
151150 mov \tmp, \ttbr0, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits
152151 mov \ttbr0, \ttbr0, lsl #ARCH_PGD_SHIFT @ lower bits
arch/arm64/mm/init.c+1−2
@@ -149,8 +149,7 @@ void __init arm64_memblock_init(void) · 148 unmodified lines
149149 memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start);
150150 #endif
151151
152− if (!efi_enabled(EFI_MEMMAP))
153− early_init_fdt_scan_reserved_mem();
152+ early_init_fdt_scan_reserved_mem();
154153
155154 /* 4GB maximum for 32-bit only capable devices */
156155 if (IS_ENABLED(CONFIG_ZONE_DMA))
arch/ia64/include/uapi/asm/unistd.h+1−1
@@ -329,6 +329,6 @@ · 328 unmodified lines
329329 #define __NR_sched_getattr 1337
330330 #define __NR_renameat2 1338
331331 #define __NR_getrandom 1339
332−#define __NR_memfd_create 1339
332+#define __NR_memfd_create 1340
333333
334334 #endif /* _UAPI_ASM_IA64_UNISTD_H */
arch/ia64/pci/fixup.c+1−23
@@ -38,27 +38,6 @@ static void pci_fixup_video(struct pci_dev *pdev) · 37 unmodified lines
3838 return;
3939 /* Maybe, this machine supports legacy memory map. */
4040
41− if (!vga_default_device()) {
42− resource_size_t start, end;
43− int i;
44−
45− /* Does firmware framebuffer belong to us? */
46− for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
47− if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
48− continue;
49−
50− start = pci_resource_start(pdev, i);
51− end = pci_resource_end(pdev, i);
52−
53− if (!start || !end)
54− continue;
55−
56− if (screen_info.lfb_base >= start &&
57− (screen_info.lfb_base + screen_info.lfb_size) < end)
58− vga_set_default_device(pdev);
59− }
60− }
61−
6241 /* Is VGA routed to us? */
6342 bus = pdev->bus;
6443 while (bus) {
@@ -83,8 +62,7 @@ static void pci_fixup_video(struct pci_dev *pdev) · 18 unmodified lines
8362 pci_read_config_word(pdev, PCI_COMMAND, &config);
8463 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
8564 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
86− dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
87− vga_set_default_device(pdev);
65+ dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
8866 }
8967 }
9068 }
arch/mips/Kconfig+3−0
@@ -546,6 +546,7 @@ config SGI_IP28 · 545 unmodified lines
546546 # select SYS_HAS_EARLY_PRINTK
547547 select SYS_SUPPORTS_64BIT_KERNEL
548548 select SYS_SUPPORTS_BIG_ENDIAN
549+ select MIPS_L1_CACHE_SHIFT_7
549550 help
550551 This is the SGI Indigo2 with R10000 processor. To compile a Linux
551552 kernel that runs on these, say Y here.
@@ -2029,7 +2030,9 @@ config MIPS_CMP · 1477 unmodified lines
20292030 bool "MIPS CMP framework support (DEPRECATED)"
20302031 depends on SYS_SUPPORTS_MIPS_CMP
20312032 select MIPS_GIC_IPI
2033+ select SMP
20322034 select SYNC_R4K
2035+ select SYS_SUPPORTS_SMP
20332036 select WEAK_ORDERING
20342037 default n
20352038 help
arch/mips/Makefile+10−1
@@ -113,7 +113,16 @@ predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ · 112 unmodified lines
113113 cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be))
114114 cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le))
115115
116−cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips)
116+# For smartmips configurations, there are hundreds of warnings due to ISA overrides
117+# in assembly and header files. smartmips is only supported for MIPS32r1 onwards
118+# and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or
119+# similar directives in the kernel will spam the build logs with the following warnings:
120+# Warning: the `smartmips' extension requires MIPS32 revision 1 or greater
121+# or
122+# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
123+# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has
124+# been fixed properly.
125+cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) -Wa,--no-warn
117126 cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips)
118127
119128 cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \
arch/mips/bcm63xx/irq.c+2−2
@@ -434,7 +434,7 @@ static void bcm63xx_init_irq(void) · 433 unmodified lines
434434 irq_stat_addr[0] += PERF_IRQSTAT_3368_REG;
435435 irq_mask_addr[0] += PERF_IRQMASK_3368_REG;
436436 irq_stat_addr[1] = 0;
437− irq_stat_addr[1] = 0;
437+ irq_mask_addr[1] = 0;
438438 irq_bits = 32;
439439 ext_irq_count = 4;
440440 ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368;
@@ -443,7 +443,7 @@ static void bcm63xx_init_irq(void) · 2 unmodified lines
443443 irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0);
444444 irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0);
445445 irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1);
446− irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1);
446+ irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1);
447447 irq_bits = 64;
448448 ext_irq_count = 4;
449449 is_ext_irq_cascaded = 1;
arch/mips/boot/compressed/decompress.c+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313
1414 #include <linux/types.h>
1515 #include <linux/kernel.h>
16+#include <linux/string.h>
1617
1718 #include <asm/addrspace.h>
1819
arch/mips/include/asm/cop2.h+9−9
@@ -16,8 +16,8 @@ · 15 unmodified lines
1616 extern void octeon_cop2_save(struct octeon_cop2_state *);
1717 extern void octeon_cop2_restore(struct octeon_cop2_state *);
1818
19−#define cop2_save(r) octeon_cop2_save(r)
20−#define cop2_restore(r) octeon_cop2_restore(r)
19+#define cop2_save(r) octeon_cop2_save(&(r)->thread.cp2)
20+#define cop2_restore(r) octeon_cop2_restore(&(r)->thread.cp2)
2121
2222 #define cop2_present 1
2323 #define cop2_lazy_restore 1
@@ -26,26 +26,26 @@ extern void octeon_cop2_restore(struct octeon_cop2_state *); · 2 unmodified lines
2626
2727 extern void nlm_cop2_save(struct nlm_cop2_state *);
2828 extern void nlm_cop2_restore(struct nlm_cop2_state *);
29−#define cop2_save(r) nlm_cop2_save(r)
30−#define cop2_restore(r) nlm_cop2_restore(r)
29+
30+#define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2)
31+#define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2)
3132
3233 #define cop2_present 1
3334 #define cop2_lazy_restore 0
3435
3536 #elif defined(CONFIG_CPU_LOONGSON3)
3637
37−#define cop2_save(r)
38−#define cop2_restore(r)
39−
4038 #define cop2_present 1
4139 #define cop2_lazy_restore 1
40+#define cop2_save(r) do { (r); } while (0)
41+#define cop2_restore(r) do { (r); } while (0)
4242
4343 #else
4444
4545 #define cop2_present 0
4646 #define cop2_lazy_restore 0
47−#define cop2_save(r)
48−#define cop2_restore(r)
47+#define cop2_save(r) do { (r); } while (0)
48+#define cop2_restore(r) do { (r); } while (0)
4949 #endif
5050
5151 enum cu2_ops {
arch/mips/include/asm/mach-ip28/spaces.h+0−7
@@ -11,15 +11,8 @@ · 10 unmodified lines
1111 #ifndef _ASM_MACH_IP28_SPACES_H
1212 #define _ASM_MACH_IP28_SPACES_H
1313
14−#define CAC_BASE _AC(0xa800000000000000, UL)
15−
16−#define HIGHMEM_START (~0UL)
17−
1814 #define PHYS_OFFSET _AC(0x20000000, UL)
1915
20−#define UNCAC_BASE _AC(0xc0000000, UL) /* 0xa0000000 + PHYS_OFFSET */
21−#define IO_BASE UNCAC_BASE
22−
2316 #include <asm/mach-generic/spaces.h>
2417
2518 #endif /* _ASM_MACH_IP28_SPACES_H */
arch/mips/include/asm/page.h+3−2
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737
3838 /*
3939 * This is used for calculating the real page sizes
40− * for FTLB or VTLB + FTLB confugrations.
40+ * for FTLB or VTLB + FTLB configurations.
4141 */
4242 static inline unsigned int page_size_ftlb(unsigned int mmuextdef)
4343 {
@@ -223,7 +223,8 @@ static inline int pfn_valid(unsigned long pfn) · 179 unmodified lines
223223
224224 #endif
225225
226−#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
226+#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \
227+ (kaddr))))
227228
228229 extern int __virt_addr_valid(const volatile void *kaddr);
229230 #define virt_addr_valid(kaddr) \
arch/mips/include/asm/smp.h+0−5
@@ -37,11 +37,6 @@ extern int __cpu_logical_map[NR_CPUS]; · 36 unmodified lines
3737
3838 #define NO_PROC_ID (-1)
3939
40−#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
41−#define topology_core_id(cpu) (cpu_data[cpu].core)
42−#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
43−#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu])
44−
4540 #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */
4641 #define SMP_CALL_FUNCTION 0x2
4742 /* Octeon - Tell another core to flush its icache */
arch/mips/include/asm/switch_to.h+2−2
@@ -92,7 +92,7 @@ do { \ · 91 unmodified lines
9292 KSTK_STATUS(prev) &= ~ST0_CU2; \
9393 __c0_stat = read_c0_status(); \
9494 write_c0_status(__c0_stat | ST0_CU2); \
95− cop2_save(&prev->thread.cp2); \
95+ cop2_save(prev); \
9696 write_c0_status(__c0_stat & ~ST0_CU2); \
9797 } \
9898 __clear_software_ll_bit(); \
@@ -111,7 +111,7 @@ do { \ · 12 unmodified lines
111111 (KSTK_STATUS(current) & ST0_CU2)) { \
112112 __c0_stat = read_c0_status(); \
113113 write_c0_status(__c0_stat | ST0_CU2); \
114− cop2_restore(&current->thread.cp2); \
114+ cop2_restore(current); \
115115 write_c0_status(__c0_stat & ~ST0_CU2); \
116116 } \
117117 if (cpu_has_dsp) \
arch/mips/include/asm/topology.h+8−0
@@ -9,5 +9,13 @@ · 8 unmodified lines
99 #define __ASM_TOPOLOGY_H
1010
1111 #include <topology.h>
12+#include <linux/smp.h>
13+
14+#ifdef CONFIG_SMP
15+#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
16+#define topology_core_id(cpu) (cpu_data[cpu].core)
17+#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
18+#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu])
19+#endif
1220
1321 #endif /* __ASM_TOPOLOGY_H */
arch/mips/include/uapi/asm/unistd.h+12−6
@@ -373,16 +373,18 @@ · 372 unmodified lines
373373 #define __NR_sched_getattr (__NR_Linux + 350)
374374 #define __NR_renameat2 (__NR_Linux + 351)
375375 #define __NR_seccomp (__NR_Linux + 352)
376+#define __NR_getrandom (__NR_Linux + 353)
377+#define __NR_memfd_create (__NR_Linux + 354)
376378
377379 /*
378380 * Offset of the last Linux o32 flavoured syscall
379381 */
380−#define __NR_Linux_syscalls 352
382+#define __NR_Linux_syscalls 354
381383
382384 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
383385
384386 #define __NR_O32_Linux 4000
385−#define __NR_O32_Linux_syscalls 352
387+#define __NR_O32_Linux_syscalls 354
386388
387389 #if _MIPS_SIM == _MIPS_SIM_ABI64
388390
@@ -703,16 +705,18 @@ · 314 unmodified lines
703705 #define __NR_sched_getattr (__NR_Linux + 310)
704706 #define __NR_renameat2 (__NR_Linux + 311)
705707 #define __NR_seccomp (__NR_Linux + 312)
708+#define __NR_getrandom (__NR_Linux + 313)
709+#define __NR_memfd_create (__NR_Linux + 314)
706710
707711 /*
708712 * Offset of the last Linux 64-bit flavoured syscall
709713 */
710−#define __NR_Linux_syscalls 312
714+#define __NR_Linux_syscalls 314
711715
712716 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
713717
714718 #define __NR_64_Linux 5000
715−#define __NR_64_Linux_syscalls 312
719+#define __NR_64_Linux_syscalls 314
716720
717721 #if _MIPS_SIM == _MIPS_SIM_NABI32
718722
@@ -1037,15 +1041,17 @@ · 318 unmodified lines
10371041 #define __NR_sched_getattr (__NR_Linux + 314)
10381042 #define __NR_renameat2 (__NR_Linux + 315)
10391043 #define __NR_seccomp (__NR_Linux + 316)
1044+#define __NR_getrandom (__NR_Linux + 317)
1045+#define __NR_memfd_create (__NR_Linux + 318)
10401046
10411047 /*
10421048 * Offset of the last N32 flavoured syscall
10431049 */
1044−#define __NR_Linux_syscalls 316
1050+#define __NR_Linux_syscalls 318
10451051
10461052 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
10471053
10481054 #define __NR_N32_Linux 6000
1049−#define __NR_N32_Linux_syscalls 316
1055+#define __NR_N32_Linux_syscalls 318
10501056
10511057 #endif /* _UAPI_ASM_UNISTD_H */
arch/mips/kernel/machine_kexec.c+6−2
@@ -71,8 +71,12 @@ machine_kexec(struct kimage *image) · 70 unmodified lines
7171 kexec_start_address =
7272 (unsigned long) phys_to_virt(image->start);
7373
74− kexec_indirection_page =
75− (unsigned long) phys_to_virt(image->head & PAGE_MASK);
74+ if (image->type == KEXEC_TYPE_DEFAULT) {
75+ kexec_indirection_page =
76+ (unsigned long) phys_to_virt(image->head & PAGE_MASK);
77+ } else {
78+ kexec_indirection_page = (unsigned long)&image->head;
79+ }
7680
7781 memcpy((void*)reboot_code_buffer, relocate_new_kernel,
7882 relocate_new_kernel_size);
arch/mips/kernel/scall32-o32.S+2−0
@@ -577,3 +577,5 @@ EXPORT(sys_call_table) · 576 unmodified lines
577577 PTR sys_sched_getattr /* 4350 */
578578 PTR sys_renameat2
579579 PTR sys_seccomp
580+ PTR sys_getrandom
581+ PTR sys_memfd_create
arch/mips/kernel/scall64-64.S+2−0
@@ -432,4 +432,6 @@ EXPORT(sys_call_table) · 431 unmodified lines
432432 PTR sys_sched_getattr /* 5310 */
433433 PTR sys_renameat2
434434 PTR sys_seccomp
435+ PTR sys_getrandom
436+ PTR sys_memfd_create
435437 .size sys_call_table,.-sys_call_table
arch/mips/kernel/scall64-n32.S+2−0
@@ -425,4 +425,6 @@ EXPORT(sysn32_call_table) · 424 unmodified lines
425425 PTR sys_sched_getattr
426426 PTR sys_renameat2 /* 6315 */
427427 PTR sys_seccomp
428+ PTR sys_getrandom
429+ PTR sys_memfd_create
428430 .size sysn32_call_table,.-sysn32_call_table
arch/mips/kernel/scall64-o32.S+2−0
@@ -562,4 +562,6 @@ EXPORT(sys32_call_table) · 561 unmodified lines
562562 PTR sys_sched_getattr /* 4350 */
563563 PTR sys_renameat2
564564 PTR sys_seccomp
565+ PTR sys_getrandom
566+ PTR sys_memfd_create
565567 .size sys32_call_table,.-sys32_call_table
arch/mips/net/bpf_jit.c+3−2
@@ -793,6 +793,7 @@ static int build_body(struct jit_ctx *ctx) · 792 unmodified lines
793793 const struct sock_filter *inst;
794794 unsigned int i, off, load_order, condt;
795795 u32 k, b_off __maybe_unused;
796+ int tmp;
796797
797798 for (i = 0; i < prog->len; i++) {
798799 u16 code;
@@ -1332,9 +1333,9 @@ jmp_cmp: · 533 unmodified lines
13321333 case BPF_ANC | SKF_AD_PKTTYPE:
13331334 ctx->flags |= SEEN_SKB;
13341335
1335− off = pkt_type_offset();
1336+ tmp = off = pkt_type_offset();
13361337
1337− if (off < 0)
1338+ if (tmp < 0)
13381339 return -1;
13391340 emit_load_byte(r_tmp, r_skb, off, ctx);
13401341 /* Keep only the last 3 bits */
arch/x86/boot/compressed/eboot.c+11−7
@@ -1032,7 +1032,6 @@ struct boot_params *make_boot_params(struct efi_config *c) · 1031 unmodified lines
10321032 int i;
10331033 unsigned long ramdisk_addr;
10341034 unsigned long ramdisk_size;
1035− unsigned long initrd_addr_max;
10361035
10371036 efi_early = c;
10381037 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) · 56 unmodified lines
10951094
10961095 memset(sdt, 0, sizeof(*sdt));
10971096
1098− if (hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G)
1099− initrd_addr_max = -1UL;
1100− else
1101− initrd_addr_max = hdr->initrd_addr_max;
1102−
11031097 status = handle_cmdline_files(sys_table, image,
11041098 (char *)(unsigned long)hdr->cmd_line_ptr,
1105− "initrd=", initrd_addr_max,
1099+ "initrd=", hdr->initrd_addr_max,
11061100 &ramdisk_addr, &ramdisk_size);
1101+
1102+ if (status != EFI_SUCCESS &&
1103+ hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) {
1104+ efi_printk(sys_table, "Trying to load files to higher address\n");
1105+ status = handle_cmdline_files(sys_table, image,
1106+ (char *)(unsigned long)hdr->cmd_line_ptr,
1107+ "initrd=", -1UL,
1108+ &ramdisk_addr, &ramdisk_size);
1109+ }
1110+
11071111 if (status != EFI_SUCCESS)
11081112 goto fail2;
11091113 hdr->ramdisk_image = ramdisk_addr & 0xffffffff;
arch/x86/boot/compressed/head_32.S+40−14
@@ -30,6 +30,33 @@ · 29 unmodified lines
3030 #include <asm/boot.h>
3131 #include <asm/asm-offsets.h>
3232
33+/*
34+ * Adjust our own GOT
35+ *
36+ * The relocation base must be in %ebx
37+ *
38+ * It is safe to call this macro more than once, because in some of the
39+ * code paths multiple invocations are inevitable, e.g. via the efi*
40+ * entry points.
41+ *
42+ * Relocation is only performed the first time.
43+ */
44+.macro FIXUP_GOT
45+ cmpb $1, got_fixed(%ebx)
46+ je 2f
47+
48+ leal _got(%ebx), %edx
49+ leal _egot(%ebx), %ecx
50+1:
51+ cmpl %ecx, %edx
52+ jae 2f
53+ addl %ebx, (%edx)
54+ addl $4, %edx
55+ jmp 1b
56+2:
57+ movb $1, got_fixed(%ebx)
58+.endm
59+
3360 __HEAD
3461 ENTRY(startup_32)
3562 #ifdef CONFIG_EFI_STUB
@@ -56,6 +83,9 @@ ENTRY(efi_pe_entry) · 20 unmodified lines
5683 add %esi, 88(%eax)
5784 pushl %eax
5885
86+ movl %esi, %ebx
87+ FIXUP_GOT
88+
5989 call make_boot_params
6090 cmpl $0, %eax
6191 je fail
@@ -81,6 +111,10 @@ ENTRY(efi32_stub_entry) · 19 unmodified lines
81111 leal efi32_config(%esi), %eax
82112 add %esi, 88(%eax)
83113 pushl %eax
114+
115+ movl %esi, %ebx
116+ FIXUP_GOT
117+
84118 2:
85119 call efi_main
86120 cmpl $0, %eax
@@ -190,19 +224,7 @@ relocated: · 103 unmodified lines
190224 shrl $2, %ecx
191225 rep stosl
192226
193−/*
194− * Adjust our own GOT
195− */
196− leal _got(%ebx), %edx
197− leal _egot(%ebx), %ecx
198−1:
199− cmpl %ecx, %edx
200− jae 2f
201− addl %ebx, (%edx)
202− addl $4, %edx
203− jmp 1b
204−2:
205−
227+ FIXUP_GOT
206228 /*
207229 * Do the decompression, and jump to the new kernel..
208230 */
@@ -225,8 +247,12 @@ relocated: · 16 unmodified lines
225247 xorl %ebx, %ebx
226248 jmp *%eax
227249
228−#ifdef CONFIG_EFI_STUB
229250 .data
251+/* Have we relocated the GOT? */
252+got_fixed:
253+ .byte 0
254+
255+#ifdef CONFIG_EFI_STUB
230256 efi32_config:
231257 .fill 11,8,0
232258 .long efi_call_phys
arch/x86/boot/compressed/head_64.S+41−15
@@ -32,6 +32,33 @@ · 31 unmodified lines
3232 #include <asm/processor-flags.h>
3333 #include <asm/asm-offsets.h>
3434
35+/*
36+ * Adjust our own GOT
37+ *
38+ * The relocation base must be in %rbx
39+ *
40+ * It is safe to call this macro more than once, because in some of the
41+ * code paths multiple invocations are inevitable, e.g. via the efi*
42+ * entry points.
43+ *
44+ * Relocation is only performed the first time.
45+ */
46+.macro FIXUP_GOT
47+ cmpb $1, got_fixed(%rip)
48+ je 2f
49+
50+ leaq _got(%rip), %rdx
51+ leaq _egot(%rip), %rcx
52+1:
53+ cmpq %rcx, %rdx
54+ jae 2f
55+ addq %rbx, (%rdx)
56+ addq $8, %rdx
57+ jmp 1b
58+2:
59+ movb $1, got_fixed(%rip)
60+.endm
61+
3562 __HEAD
3663 .code32
3764 ENTRY(startup_32)
@@ -252,10 +279,13 @@ ENTRY(efi_pe_entry) · 214 unmodified lines
252279 subq $1b, %rbp
253280
254281 /*
255− * Relocate efi_config->call().
282+ * Relocate efi_config->call() and the GOT entries.
256283 */
257284 addq %rbp, efi64_config+88(%rip)
258285
286+ movq %rbp, %rbx
287+ FIXUP_GOT
288+
259289 movq %rax, %rdi
260290 call make_boot_params
261291 cmpq $0,%rax
@@ -271,10 +301,13 @@ handover_entry: · 9 unmodified lines
271301 subq $1b, %rbp
272302
273303 /*
274− * Relocate efi_config->call().
304+ * Relocate efi_config->call() and the GOT entries.
275305 */
276306 movq efi_config(%rip), %rax
277307 addq %rbp, 88(%rax)
308+
309+ movq %rbp, %rbx
310+ FIXUP_GOT
278311 2:
279312 movq efi_config(%rip), %rdi
280313 call efi_main
@@ -385,19 +418,8 @@ relocated: · 104 unmodified lines
385418 shrq $3, %rcx
386419 rep stosq
387420
388−/*
389− * Adjust our own GOT
390− */
391− leaq _got(%rip), %rdx
392− leaq _egot(%rip), %rcx
393−1:
394− cmpq %rcx, %rdx
395− jae 2f
396− addq %rbx, (%rdx)
397− addq $8, %rdx
398− jmp 1b
399−2:
400−
421+ FIXUP_GOT
422+
401423 /*
402424 * Do the decompression, and jump to the new kernel..
403425 */
@@ -437,6 +459,10 @@ gdt: · 33 unmodified lines
437459 .quad 0x0000000000000000 /* TS continued */
438460 gdt_end:
439461
462+/* Have we relocated the GOT? */
463+got_fixed:
464+ .byte 0
465+
440466 #ifdef CONFIG_EFI_STUB
441467 efi_config:
442468 .quad 0
arch/x86/include/asm/io_apic.h+1−0
@@ -239,6 +239,7 @@ static inline int mp_find_ioapic(u32 gsi) { return 0; } · 238 unmodified lines
239239 static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; }
240240 static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; }
241241 static inline void mp_unmap_irq(int irq) { }
242+static inline bool mp_should_keep_irq(struct device *dev) { return 1; }
242243
243244 static inline int save_ioapic_entries(void)
244245 {
arch/x86/kernel/kprobes/opt.c+3−1
@@ -338,8 +338,10 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op) · 337 unmodified lines
338338 * a relative jump.
339339 */
340340 rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE;
341− if (abs(rel) > 0x7fffffff)
341+ if (abs(rel) > 0x7fffffff) {
342+ __arch_remove_optimized_kprobe(op, 0);
342343 return -ERANGE;
344+ }
343345
344346 buf = (u8 *)op->optinsn.insn;
345347
arch/x86/mm/dump_pagetables.c+4−0
@@ -48,7 +48,9 @@ enum address_markers_idx { · 47 unmodified lines
4848 LOW_KERNEL_NR,
4949 VMALLOC_START_NR,
5050 VMEMMAP_START_NR,
51+# ifdef CONFIG_X86_ESPFIX64
5152 ESPFIX_START_NR,
53+# endif
5254 HIGH_KERNEL_NR,
5355 MODULES_VADDR_NR,
5456 MODULES_END_NR,
@@ -71,7 +73,9 @@ static struct addr_marker address_markers[] = { · 16 unmodified lines
7173 { PAGE_OFFSET, "Low Kernel Mapping" },
7274 { VMALLOC_START, "vmalloc() Area" },
7375 { VMEMMAP_START, "Vmemmap" },
76+# ifdef CONFIG_X86_ESPFIX64
7477 { ESPFIX_BASE_ADDR, "ESPfix Area", 16 },
78+# endif
7579 { __START_KERNEL_map, "High Kernel Mapping" },
7680 { MODULES_VADDR, "Modules" },
7781 { MODULES_END, "End Modules" },
arch/x86/mm/mmap.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <linux/sched.h>
3232 #include <asm/elf.h>
3333
34−struct __read_mostly va_alignment va_align = {
34+struct va_alignment __read_mostly va_align = {
3535 .flags = -1,
3636 };
3737
arch/x86/pci/fixup.c+1−23
@@ -326,27 +326,6 @@ static void pci_fixup_video(struct pci_dev *pdev) · 325 unmodified lines
326326 struct pci_bus *bus;
327327 u16 config;
328328
329− if (!vga_default_device()) {
330− resource_size_t start, end;
331− int i;
332−
333− /* Does firmware framebuffer belong to us? */
334− for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
335− if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
336− continue;
337−
338− start = pci_resource_start(pdev, i);
339− end = pci_resource_end(pdev, i);
340−
341− if (!start || !end)
342− continue;
343−
344− if (screen_info.lfb_base >= start &&
345− (screen_info.lfb_base + screen_info.lfb_size) < end)
346− vga_set_default_device(pdev);
347− }
348− }
349−
350329 /* Is VGA routed to us? */
351330 bus = pdev->bus;
352331 while (bus) {
@@ -371,8 +350,7 @@ static void pci_fixup_video(struct pci_dev *pdev) · 18 unmodified lines
371350 pci_read_config_word(pdev, PCI_COMMAND, &config);
372351 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
373352 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
374− dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
375− vga_set_default_device(pdev);
353+ dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
376354 }
377355 }
378356 }
crypto/drbg.c+0−3
@@ -1922,9 +1922,6 @@ static inline int __init drbg_healthcheck_sanity(void) · 1921 unmodified lines
19221922 /* overflow max addtllen with personalization string */
19231923 ret = drbg_instantiate(drbg, &addtl, coreref, pr);
19241924 BUG_ON(0 == ret);
1925− /* test uninstantated DRBG */
1926− len = drbg_generate(drbg, buf, (max_request_bytes + 1), NULL);
1927− BUG_ON(0 < len);
19281925 /* all tests passed */
19291926 rc = 0;
19301927
drivers/acpi/acpi_lpss.c+0−1
@@ -419,7 +419,6 @@ static int acpi_lpss_create_device(struct acpi_device *adev, · 418 unmodified lines
419419 adev->driver_data = pdata;
420420 pdev = acpi_create_platform_device(adev);
421421 if (!IS_ERR_OR_NULL(pdev)) {
422− device_enable_async_suspend(&pdev->dev);
423422 return 1;
424423 }
425424
drivers/acpi/acpica/aclocal.h+1−0
@@ -254,6 +254,7 @@ struct acpi_create_field_info { · 253 unmodified lines
254254 u32 field_bit_position;
255255 u32 field_bit_length;
256256 u16 resource_length;
257+ u16 pin_number_index;
257258 u8 field_flags;
258259 u8 attribute;
259260 u8 field_type;
drivers/acpi/acpica/acobject.h+1−0
@@ -264,6 +264,7 @@ struct acpi_object_region_field { · 263 unmodified lines
264264 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO u16 resource_length;
265265 union acpi_operand_object *region_obj; /* Containing op_region object */
266266 u8 *resource_buffer; /* resource_template for serial regions/fields */
267+ u16 pin_number_index; /* Index relative to previous Connection/Template */
267268 };
268269
269270 struct acpi_object_bank_field {
drivers/acpi/acpica/dsfield.c+2−0
@@ -360,6 +360,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, · 359 unmodified lines
360360 */
361361 info->resource_buffer = NULL;
362362 info->connection_node = NULL;
363+ info->pin_number_index = 0;
363364
364365 /*
365366 * A Connection() is either an actual resource descriptor (buffer)
@@ -437,6 +438,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, · 71 unmodified lines
437438 }
438439
439440 info->field_bit_position += info->field_bit_length;
441+ info->pin_number_index++; /* Index relative to previous Connection() */
440442 break;
441443
442444 default:
drivers/acpi/acpica/evregion.c+31−16
@@ -142,6 +142,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 141 unmodified lines
142142 union acpi_operand_object *region_obj2;
143143 void *region_context = NULL;
144144 struct acpi_connection_info *context;
145+ acpi_physical_address address;
145146
146147 ACPI_FUNCTION_TRACE(ev_address_space_dispatch);
147148
@@ -231,25 +232,23 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 83 unmodified lines
231232 /* We have everything we need, we can invoke the address space handler */
232233
233234 handler = handler_desc->address_space.handler;
234−
235− ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
236− "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
237− &region_obj->region.handler->address_space, handler,
238− ACPI_FORMAT_NATIVE_UINT(region_obj->region.address +
239− region_offset),
240− acpi_ut_get_region_name(region_obj->region.
241− space_id)));
235+ address = (region_obj->region.address + region_offset);
242236
243237 /*
244238 * Special handling for generic_serial_bus and general_purpose_io:
245239 * There are three extra parameters that must be passed to the
246240 * handler via the context:
247− * 1) Connection buffer, a resource template from Connection() op.
248− * 2) Length of the above buffer.
249− * 3) Actual access length from the access_as() op.
241+ * 1) Connection buffer, a resource template from Connection() op
242+ * 2) Length of the above buffer
243+ * 3) Actual access length from the access_as() op
244+ *
245+ * In addition, for general_purpose_io, the Address and bit_width fields
246+ * are defined as follows:
247+ * 1) Address is the pin number index of the field (bit offset from
248+ * the previous Connection)
249+ * 2) bit_width is the actual bit length of the field (number of pins)
250250 */
251− if (((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) ||
252− (region_obj->region.space_id == ACPI_ADR_SPACE_GPIO)) &&
251+ if ((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) &&
253252 context && field_obj) {
254253
255254 /* Get the Connection (resource_template) buffer */
@@ -258,6 +257,24 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 2 unmodified lines
258257 context->length = field_obj->field.resource_length;
259258 context->access_length = field_obj->field.access_length;
260259 }
260+ if ((region_obj->region.space_id == ACPI_ADR_SPACE_GPIO) &&
261+ context && field_obj) {
262+
263+ /* Get the Connection (resource_template) buffer */
264+
265+ context->connection = field_obj->field.resource_buffer;
266+ context->length = field_obj->field.resource_length;
267+ context->access_length = field_obj->field.access_length;
268+ address = field_obj->field.pin_number_index;
269+ bit_width = field_obj->field.bit_length;
270+ }
271+
272+ ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
273+ "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
274+ &region_obj->region.handler->address_space, handler,
275+ ACPI_FORMAT_NATIVE_UINT(address),
276+ acpi_ut_get_region_name(region_obj->region.
277+ space_id)));
261278
262279 if (!(handler_desc->address_space.handler_flags &
263280 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
@@ -271,9 +288,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 7 unmodified lines
271288
272289 /* Call the handler */
273290
274− status = handler(function,
275− (region_obj->region.address + region_offset),
276− bit_width, value, context,
291+ status = handler(function, address, bit_width, value, context,
277292 region_obj2->extra.region_context);
278293
279294 if (ACPI_FAILURE(status)) {
drivers/acpi/acpica/exfield.c+67−0
@@ -253,6 +253,37 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, · 252 unmodified lines
253253 buffer = &buffer_desc->integer.value;
254254 }
255255
256+ if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
257+ (obj_desc->field.region_obj->region.space_id ==
258+ ACPI_ADR_SPACE_GPIO)) {
259+ /*
260+ * For GPIO (general_purpose_io), the Address will be the bit offset
261+ * from the previous Connection() operator, making it effectively a
262+ * pin number index. The bit_length is the length of the field, which
263+ * is thus the number of pins.
264+ */
265+ ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
266+ "GPIO FieldRead [FROM]: Pin %u Bits %u\n",
267+ obj_desc->field.pin_number_index,
268+ obj_desc->field.bit_length));
269+
270+ /* Lock entire transaction if requested */
271+
272+ acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
273+
274+ /* Perform the write */
275+
276+ status = acpi_ex_access_region(obj_desc, 0,
277+ (u64 *)buffer, ACPI_READ);
278+ acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
279+ if (ACPI_FAILURE(status)) {
280+ acpi_ut_remove_reference(buffer_desc);
281+ } else {
282+ *ret_buffer_desc = buffer_desc;
283+ }
284+ return_ACPI_STATUS(status);
285+ }
286+
256287 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
257288 "FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n",
258289 obj_desc, obj_desc->common.type, buffer,
@@ -413,6 +444,42 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, · 154 unmodified lines
413444
414445 *result_desc = buffer_desc;
415446 return_ACPI_STATUS(status);
447+ } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
448+ (obj_desc->field.region_obj->region.space_id ==
449+ ACPI_ADR_SPACE_GPIO)) {
450+ /*
451+ * For GPIO (general_purpose_io), we will bypass the entire field
452+ * mechanism and handoff the bit address and bit width directly to
453+ * the handler. The Address will be the bit offset
454+ * from the previous Connection() operator, making it effectively a
455+ * pin number index. The bit_length is the length of the field, which
456+ * is thus the number of pins.
457+ */
458+ if (source_desc->common.type != ACPI_TYPE_INTEGER) {
459+ return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
460+ }
461+
462+ ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
463+ "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
464+ acpi_ut_get_type_name(source_desc->common.
465+ type),
466+ source_desc->common.type,
467+ (u32)source_desc->integer.value,
468+ obj_desc->field.pin_number_index,
469+ obj_desc->field.bit_length));
470+
471+ buffer = &source_desc->integer.value;
472+
473+ /* Lock entire transaction if requested */
474+
475+ acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
476+
477+ /* Perform the write */
478+
479+ status = acpi_ex_access_region(obj_desc, 0,
480+ (u64 *)buffer, ACPI_WRITE);
481+ acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
482+ return_ACPI_STATUS(status);
416483 }
417484
418485 /* Get a pointer to the data to be written */
drivers/acpi/acpica/exprep.c+2−0
@@ -484,6 +484,8 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info) · 483 unmodified lines
484484 obj_desc->field.resource_length = info->resource_length;
485485 }
486486
487+ obj_desc->field.pin_number_index = info->pin_number_index;
488+
487489 /* Allow full data read from EC address space */
488490
489491 if ((obj_desc->field.region_obj->region.space_id ==
drivers/acpi/bus.c+0−10
@@ -177,16 +177,6 @@ void acpi_bus_detach_private_data(acpi_handle handle) · 176 unmodified lines
177177 }
178178 EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data);
179179
180−void acpi_bus_no_hotplug(acpi_handle handle)
181−{
182− struct acpi_device *adev = NULL;
183−
184− acpi_bus_get_device(handle, &adev);
185− if (adev)
186− adev->flags.no_hotplug = true;
187−}
188−EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug);
189−
190180 static void acpi_print_osc_error(acpi_handle handle,
191181 struct acpi_osc_context *context, char *error)
192182 {
drivers/acpi/scan.c+1−1
@@ -130,7 +130,7 @@ static int create_modalias(struct acpi_device *acpi_dev, char *modalias, · 129 unmodified lines
130130 list_for_each_entry(id, &acpi_dev->pnp.ids, list) {
131131 count = snprintf(&modalias[len], size, "%s:", id->id);
132132 if (count < 0)
133− return EINVAL;
133+ return -EINVAL;
134134 if (count >= size)
135135 return -ENOMEM;
136136 len += count;
drivers/acpi/video.c+8−0
@@ -750,6 +750,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { · 749 unmodified lines
750750 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T520"),
751751 },
752752 },
753+ {
754+ .callback = video_disable_native_backlight,
755+ .ident = "ThinkPad X201s",
756+ .matches = {
757+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
758+ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
759+ },
760+ },
753761
754762 /* The native backlight controls do not work on some older machines */
755763 {
drivers/base/regmap/regmap-debugfs.c+8−1
@@ -512,7 +512,14 @@ void regmap_debugfs_init(struct regmap *map, const char *name) · 511 unmodified lines
512512 map, &regmap_reg_ranges_fops);
513513
514514 if (map->max_register || regmap_readable(map, 0)) {
515− debugfs_create_file("registers", 0400, map->debugfs,
515+ umode_t registers_mode;
516+
517+ if (IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS))
518+ registers_mode = 0600;
519+ else
520+ registers_mode = 0400;
521+
522+ debugfs_create_file("registers", registers_mode, map->debugfs,
516523 map, &regmap_map_fops);
517524 debugfs_create_file("access", 0400, map->debugfs,
518525 map, &regmap_access_fops);
drivers/char/hw_random/virtio-rng.c+7−0
@@ -36,6 +36,7 @@ struct virtrng_info { · 35 unmodified lines
3636 int index;
3737 bool busy;
3838 bool hwrng_register_done;
39+ bool hwrng_removed;
3940 };
4041
4142
@@ -68,6 +69,9 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) · 26 unmodified lines
6869 int ret;
6970 struct virtrng_info *vi = (struct virtrng_info *)rng->priv;
7071
72+ if (vi->hwrng_removed)
73+ return -ENODEV;
74+
7175 if (!vi->busy) {
7276 vi->busy = true;
7377 init_completion(&vi->have_data);
@@ -137,6 +141,9 @@ static void remove_common(struct virtio_device *vdev) · 63 unmodified lines
137141 {
138142 struct virtrng_info *vi = vdev->priv;
139143
144+ vi->hwrng_removed = true;
145+ vi->data_avail = 0;
146+ complete(&vi->have_data);
140147 vdev->config->reset(vdev);
141148 vi->busy = false;
142149 if (vi->hwrng_register_done)
drivers/firmware/efi/libstub/fdt.c+9−1
@@ -22,7 +22,7 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, · 21 unmodified lines
2222 unsigned long map_size, unsigned long desc_size,
2323 u32 desc_ver)
2424 {
25− int node, prev;
25+ int node, prev, num_rsv;
2626 int status;
2727 u32 fdt_val32;
2828 u64 fdt_val64;
@@ -73,6 +73,14 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, · 44 unmodified lines
7373 prev = node;
7474 }
7575
76+ /*
77+ * Delete all memory reserve map entries. When booting via UEFI,
78+ * kernel will use the UEFI memory map to find reserved regions.
79+ */
80+ num_rsv = fdt_num_mem_rsv(fdt);
81+ while (num_rsv-- > 0)
82+ fdt_del_mem_rsv(fdt, num_rsv);
83+
7684 node = fdt_subnode_offset(fdt, 0, "chosen");
7785 if (node < 0) {
7886 node = fdt_add_subnode(fdt, 0, "chosen");
drivers/gpio/gpiolib-acpi.c+4−1
@@ -377,8 +377,10 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, · 376 unmodified lines
377377 struct gpio_chip *chip = achip->chip;
378378 struct acpi_resource_gpio *agpio;
379379 struct acpi_resource *ares;
380+ int pin_index = (int)address;
380381 acpi_status status;
381382 bool pull_up;
383+ int length;
382384 int i;
383385
384386 status = acpi_buffer_to_resource(achip->conn_info.connection,
@@ -400,7 +402,8 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, · 15 unmodified lines
400402 return AE_BAD_PARAMETER;
401403 }
402404
403− for (i = 0; i < agpio->pin_table_length; i++) {
405+ length = min(agpio->pin_table_length, (u16)(pin_index + bits));
406+ for (i = pin_index; i < length; ++i) {
404407 unsigned pin = agpio->pin_table[i];
405408 struct acpi_gpio_connection *conn;
406409 struct gpio_desc *desc;
drivers/gpu/drm/bochs/bochs_kms.c+1−0
@@ -250,6 +250,7 @@ static void bochs_connector_init(struct drm_device *dev) · 249 unmodified lines
250250 DRM_MODE_CONNECTOR_VIRTUAL);
251251 drm_connector_helper_add(connector,
252252 &bochs_connector_connector_helper_funcs);
253+ drm_connector_register(connector);
253254 }
254255
255256
drivers/gpu/drm/cirrus/cirrus_mode.c+1−0
@@ -555,6 +555,7 @@ static struct drm_connector *cirrus_vga_init(struct drm_device *dev) · 554 unmodified lines
555555
556556 drm_connector_helper_add(connector, &cirrus_vga_connector_helper_funcs);
557557
558+ drm_connector_register(connector);
558559 return connector;
559560 }
560561
drivers/gpu/drm/i915/intel_dp.c+4−0
@@ -1631,6 +1631,10 @@ static void intel_dp_get_config(struct intel_encoder *encoder, · 1630 unmodified lines
16311631
16321632 pipe_config->adjusted_mode.flags |= flags;
16331633
1634+ if (!HAS_PCH_SPLIT(dev) && !IS_VALLEYVIEW(dev) &&
1635+ tmp & DP_COLOR_RANGE_16_235)
1636+ pipe_config->limited_color_range = true;
1637+
16341638 pipe_config->has_dp_encoder = true;
16351639
16361640 intel_dp_get_m_n(crtc, pipe_config);
drivers/gpu/drm/i915/intel_hdmi.c+6−1
@@ -712,7 +712,8 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, · 711 unmodified lines
712712 struct intel_crtc_config *pipe_config)
713713 {
714714 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
715− struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
715+ struct drm_device *dev = encoder->base.dev;
716+ struct drm_i915_private *dev_priv = dev->dev_private;
716717 u32 tmp, flags = 0;
717718 int dotclock;
718719
@@ -734,6 +735,10 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, · 15 unmodified lines
734735 if (tmp & HDMI_MODE_SELECT_HDMI)
735736 pipe_config->has_audio = true;
736737
738+ if (!HAS_PCH_SPLIT(dev) &&
739+ tmp & HDMI_COLOR_RANGE_16_235)
740+ pipe_config->limited_color_range = true;
741+
737742 pipe_config->adjusted_mode.flags |= flags;
738743
739744 if ((tmp & SDVO_COLOR_FORMAT_MASK) == HDMI_COLOR_FORMAT_12bpc)
drivers/gpu/drm/i915/intel_ringbuffer.c+1−1
@@ -1400,7 +1400,7 @@ i830_dispatch_execbuffer(struct intel_engine_cs *ring, · 1399 unmodified lines
14001400 */
14011401 intel_ring_emit(ring, SRC_COPY_BLT_CMD | BLT_WRITE_RGBA);
14021402 intel_ring_emit(ring, BLT_DEPTH_32 | BLT_ROP_SRC_COPY | 4096);
1403− intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 1024);
1403+ intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 4096);
14041404 intel_ring_emit(ring, cs_offset);
14051405 intel_ring_emit(ring, 4096);
14061406 intel_ring_emit(ring, offset);
drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c+0−1
@@ -200,7 +200,6 @@ nvc0_bar_init(struct nouveau_object *object) · 199 unmodified lines
200200
201201 nv_mask(priv, 0x000200, 0x00000100, 0x00000000);
202202 nv_mask(priv, 0x000200, 0x00000100, 0x00000100);
203− nv_mask(priv, 0x100c80, 0x00000001, 0x00000000);
204203
205204 nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12);
206205 if (priv->bar[0].mem)
drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c+1−0
@@ -60,6 +60,7 @@ nvc0_fb_init(struct nouveau_object *object) · 59 unmodified lines
6060
6161 if (priv->r100c10_page)
6262 nv_wr32(priv, 0x100c10, priv->r100c10 >> 8);
63+ nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */
6364 return 0;
6465 }
6566
drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c+2−0
@@ -98,6 +98,7 @@ static int · 97 unmodified lines
9898 gf100_ltc_init(struct nouveau_object *object)
9999 {
100100 struct nvkm_ltc_priv *priv = (void *)object;
101+ u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
101102 int ret;
102103
103104 ret = nvkm_ltc_init(priv);
@@ -107,6 +108,7 @@ gf100_ltc_init(struct nouveau_object *object) · 3 unmodified lines
107108 nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */
108109 nv_wr32(priv, 0x17e8d8, priv->ltc_nr);
109110 nv_wr32(priv, 0x17e8d4, priv->tag_base);
111+ nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
110112 return 0;
111113 }
112114
drivers/gpu/drm/nouveau/core/subdev/ltc/gk104.c+2−0
@@ -28,6 +28,7 @@ static int · 27 unmodified lines
2828 gk104_ltc_init(struct nouveau_object *object)
2929 {
3030 struct nvkm_ltc_priv *priv = (void *)object;
31+ u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
3132 int ret;
3233
3334 ret = nvkm_ltc_init(priv);
@@ -37,6 +38,7 @@ gk104_ltc_init(struct nouveau_object *object) · 3 unmodified lines
3738 nv_wr32(priv, 0x17e8d8, priv->ltc_nr);
3839 nv_wr32(priv, 0x17e000, priv->ltc_nr);
3940 nv_wr32(priv, 0x17e8d4, priv->tag_base);
41+ nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
4042 return 0;
4143 }
4244
drivers/gpu/drm/nouveau/core/subdev/ltc/gm107.c+2−0
@@ -98,6 +98,7 @@ static int · 97 unmodified lines
9898 gm107_ltc_init(struct nouveau_object *object)
9999 {
100100 struct nvkm_ltc_priv *priv = (void *)object;
101+ u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
101102 int ret;
102103
103104 ret = nvkm_ltc_init(priv);
@@ -106,6 +107,7 @@ gm107_ltc_init(struct nouveau_object *object) · 2 unmodified lines
106107
107108 nv_wr32(priv, 0x17e27c, priv->ltc_nr);
108109 nv_wr32(priv, 0x17e278, priv->tag_base);
110+ nv_mask(priv, 0x17e264, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
109111 return 0;
110112 }
111113
drivers/gpu/drm/nouveau/nouveau_acpi.c+2−14
@@ -46,7 +46,6 @@ static struct nouveau_dsm_priv { · 45 unmodified lines
4646 bool dsm_detected;
4747 bool optimus_detected;
4848 acpi_handle dhandle;
49− acpi_handle other_handle;
5049 acpi_handle rom_handle;
5150 } nouveau_dsm_priv;
5251
@@ -222,10 +221,9 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev) · 169 unmodified lines
222221 if (!dhandle)
223222 return false;
224223
225− if (!acpi_has_method(dhandle, "_DSM")) {
226− nouveau_dsm_priv.other_handle = dhandle;
224+ if (!acpi_has_method(dhandle, "_DSM"))
227225 return false;
228− }
226+
229227 if (acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102,
230228 1 << NOUVEAU_DSM_POWER))
231229 retval |= NOUVEAU_DSM_HAS_MUX;
@@ -301,16 +299,6 @@ static bool nouveau_dsm_detect(void) · 69 unmodified lines
301299 printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n",
302300 acpi_method_name);
303301 nouveau_dsm_priv.dsm_detected = true;
304− /*
305− * On some systems hotplug events are generated for the device
306− * being switched off when _DSM is executed. They cause ACPI
307− * hotplug to trigger and attempt to remove the device from
308− * the system, which causes it to break down. Prevent that from
309− * happening by setting the no_hotplug flag for the involved
310− * ACPI device objects.
311− */
312− acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle);
313− acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle);
314302 ret = true;
315303 }
316304
drivers/gpu/drm/nouveau/nouveau_drm.c+1−0
@@ -627,6 +627,7 @@ int nouveau_pmops_suspend(struct device *dev) · 626 unmodified lines
627627
628628 pci_save_state(pdev);
629629 pci_disable_device(pdev);
630+ pci_ignore_hotplug(pdev);
630631 pci_set_power_state(pdev, PCI_D3hot);
631632 return 0;
632633 }
drivers/gpu/drm/nouveau/nouveau_vga.c+9−0
@@ -108,7 +108,16 @@ void · 107 unmodified lines
108108 nouveau_vga_fini(struct nouveau_drm *drm)
109109 {
110110 struct drm_device *dev = drm->dev;
111+ bool runtime = false;
112+
113+ if (nouveau_runtime_pm == 1)
114+ runtime = true;
115+ if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm()))
116+ runtime = true;
117+
111118 vga_switcheroo_unregister_client(dev->pdev);
119+ if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
120+ vga_switcheroo_fini_domain_pm_ops(drm->dev->dev);
112121 vga_client_register(dev->pdev, NULL, NULL, NULL);
113122 }
114123
drivers/gpu/drm/radeon/cik_sdma.c+0−7
@@ -489,13 +489,6 @@ int cik_sdma_resume(struct radeon_device *rdev) · 488 unmodified lines
489489 {
490490 int r;
491491
492− /* Reset dma */
493− WREG32(SRBM_SOFT_RESET, SOFT_RESET_SDMA | SOFT_RESET_SDMA1);
494− RREG32(SRBM_SOFT_RESET);
495− udelay(50);
496− WREG32(SRBM_SOFT_RESET, 0);
497− RREG32(SRBM_SOFT_RESET);
498−
499492 r = cik_sdma_load_microcode(rdev);
500493 if (r)
501494 return r;
drivers/gpu/drm/radeon/kv_dpm.c+21−7
@@ -33,6 +33,8 @@ · 32 unmodified lines
3333 #define KV_MINIMUM_ENGINE_CLOCK 800
3434 #define SMC_RAM_END 0x40000
3535
36+static int kv_enable_nb_dpm(struct radeon_device *rdev,
37+ bool enable);
3638 static void kv_init_graphics_levels(struct radeon_device *rdev);
3739 static int kv_calculate_ds_divider(struct radeon_device *rdev);
3840 static int kv_calculate_nbps_level_settings(struct radeon_device *rdev);
@@ -1295,6 +1297,9 @@ void kv_dpm_disable(struct radeon_device *rdev) · 1256 unmodified lines
12951297 {
12961298 kv_smc_bapm_enable(rdev, false);
12971299
1300+ if (rdev->family == CHIP_MULLINS)
1301+ kv_enable_nb_dpm(rdev, false);
1302+
12981303 /* powerup blocks */
12991304 kv_dpm_powergate_acp(rdev, false);
13001305 kv_dpm_powergate_samu(rdev, false);
@@ -1769,15 +1774,24 @@ static int kv_update_dfs_bypass_settings(struct radeon_device *rdev, · 468 unmodified lines
17691774 return ret;
17701775 }
17711776
1772−static int kv_enable_nb_dpm(struct radeon_device *rdev)
1777+static int kv_enable_nb_dpm(struct radeon_device *rdev,
1778+ bool enable)
17731779 {
17741780 struct kv_power_info *pi = kv_get_pi(rdev);
17751781 int ret = 0;
17761782
1777− if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) {
1778− ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable);
1779− if (ret == 0)
1780− pi->nb_dpm_enabled = true;
1783+ if (enable) {
1784+ if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) {
1785+ ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable);
1786+ if (ret == 0)
1787+ pi->nb_dpm_enabled = true;
1788+ }
1789+ } else {
1790+ if (pi->enable_nb_dpm && pi->nb_dpm_enabled) {
1791+ ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Disable);
1792+ if (ret == 0)
1793+ pi->nb_dpm_enabled = false;
1794+ }
17811795 }
17821796
17831797 return ret;
@@ -1864,7 +1878,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) · 80 unmodified lines
18641878 }
18651879 kv_update_sclk_t(rdev);
18661880 if (rdev->family == CHIP_MULLINS)
1867− kv_enable_nb_dpm(rdev);
1881+ kv_enable_nb_dpm(rdev, true);
18681882 }
18691883 } else {
18701884 if (pi->enable_dpm) {
@@ -1889,7 +1903,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) · 18 unmodified lines
18891903 }
18901904 kv_update_acp_boot_level(rdev);
18911905 kv_update_sclk_t(rdev);
1892− kv_enable_nb_dpm(rdev);
1906+ kv_enable_nb_dpm(rdev, true);
18931907 }
18941908 }
18951909
drivers/gpu/drm/radeon/ni_dma.c+0−6
@@ -191,12 +191,6 @@ int cayman_dma_resume(struct radeon_device *rdev) · 190 unmodified lines
191191 u32 reg_offset, wb_offset;
192192 int i, r;
193193
194− /* Reset dma */
195− WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA | SOFT_RESET_DMA1);
196− RREG32(SRBM_SOFT_RESET);
197− udelay(50);
198− WREG32(SRBM_SOFT_RESET, 0);
199−
200194 for (i = 0; i < 2; i++) {
201195 if (i == 0) {
202196 ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX];
drivers/gpu/drm/radeon/r100.c+14−14
@@ -821,6 +821,20 @@ u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc) · 820 unmodified lines
821821 return RREG32(RADEON_CRTC2_CRNT_FRAME);
822822 }
823823
824+/**
825+ * r100_ring_hdp_flush - flush Host Data Path via the ring buffer
826+ * rdev: radeon device structure
827+ * ring: ring buffer struct for emitting packets
828+ */
829+static void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring)
830+{
831+ radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0));
832+ radeon_ring_write(ring, rdev->config.r100.hdp_cntl |
833+ RADEON_HDP_READ_BUFFER_INVALIDATE);
834+ radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0));
835+ radeon_ring_write(ring, rdev->config.r100.hdp_cntl);
836+}
837+
824838 /* Who ever call radeon_fence_emit should call ring_lock and ask
825839 * for enough space (today caller are ib schedule and buffer move) */
826840 void r100_fence_ring_emit(struct radeon_device *rdev,
@@ -1056,20 +1070,6 @@ void r100_gfx_set_wptr(struct radeon_device *rdev, · 229 unmodified lines
10561070 (void)RREG32(RADEON_CP_RB_WPTR);
10571071 }
10581072
1059−/**
1060− * r100_ring_hdp_flush - flush Host Data Path via the ring buffer
1061− * rdev: radeon device structure
1062− * ring: ring buffer struct for emitting packets
1063− */
1064−void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring)
1065−{
1066− radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0));
1067− radeon_ring_write(ring, rdev->config.r100.hdp_cntl |
1068− RADEON_HDP_READ_BUFFER_INVALIDATE);
1069− radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0));
1070− radeon_ring_write(ring, rdev->config.r100.hdp_cntl);
1071−}
1072−
10731073 static void r100_cp_load_microcode(struct radeon_device *rdev)
10741074 {
10751075 const __be32 *fw_data;
drivers/gpu/drm/radeon/r600_dma.c+0−9
@@ -124,15 +124,6 @@ int r600_dma_resume(struct radeon_device *rdev) · 123 unmodified lines
124124 u32 rb_bufsz;
125125 int r;
126126
127− /* Reset dma */
128− if (rdev->family >= CHIP_RV770)
129− WREG32(SRBM_SOFT_RESET, RV770_SOFT_RESET_DMA);
130− else
131− WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA);
132− RREG32(SRBM_SOFT_RESET);
133− udelay(50);
134− WREG32(SRBM_SOFT_RESET, 0);
135−
136127 WREG32(DMA_SEM_INCOMPLETE_TIMER_CNTL, 0);
137128 WREG32(DMA_SEM_WAIT_FAIL_TIMER_CNTL, 0);
138129
drivers/gpu/drm/radeon/r600d.h+0−7
@@ -44,13 +44,6 @@ · 43 unmodified lines
4444 #define R6XX_MAX_PIPES 8
4545 #define R6XX_MAX_PIPES_MASK 0xff
4646
47−/* PTE flags */
48−#define PTE_VALID (1 << 0)
49−#define PTE_SYSTEM (1 << 1)
50−#define PTE_SNOOPED (1 << 2)
51−#define PTE_READABLE (1 << 5)
52−#define PTE_WRITEABLE (1 << 6)
53−
5447 /* tiling bits */
5548 #define ARRAY_LINEAR_GENERAL 0x00000000
5649 #define ARRAY_LINEAR_ALIGNED 0x00000001
drivers/gpu/drm/radeon/radeon_asic.c+0−2
@@ -185,7 +185,6 @@ static struct radeon_asic_ring r100_gfx_ring = { · 184 unmodified lines
185185 .get_rptr = &r100_gfx_get_rptr,
186186 .get_wptr = &r100_gfx_get_wptr,
187187 .set_wptr = &r100_gfx_set_wptr,
188− .hdp_flush = &r100_ring_hdp_flush,
189188 };
190189
191190 static struct radeon_asic r100_asic = {
@@ -332,7 +331,6 @@ static struct radeon_asic_ring r300_gfx_ring = { · 140 unmodified lines
332331 .get_rptr = &r100_gfx_get_rptr,
333332 .get_wptr = &r100_gfx_get_wptr,
334333 .set_wptr = &r100_gfx_set_wptr,
335− .hdp_flush = &r100_ring_hdp_flush,
336334 };
337335
338336 static struct radeon_asic r300_asic = {
drivers/gpu/drm/radeon/radeon_asic.h+1−2
@@ -148,8 +148,7 @@ u32 r100_gfx_get_wptr(struct radeon_device *rdev, · 147 unmodified lines
148148 struct radeon_ring *ring);
149149 void r100_gfx_set_wptr(struct radeon_device *rdev,
150150 struct radeon_ring *ring);
151−void r100_ring_hdp_flush(struct radeon_device *rdev,
152− struct radeon_ring *ring);
151+
153152 /*
154153 * r200,rv250,rs300,rv280
155154 */
drivers/gpu/drm/radeon/radeon_atpx_handler.c+2−14
@@ -33,7 +33,6 @@ static struct radeon_atpx_priv { · 32 unmodified lines
3333 bool atpx_detected;
3434 /* handle for device - and atpx */
3535 acpi_handle dhandle;
36− acpi_handle other_handle;
3736 struct radeon_atpx atpx;
3837 } radeon_atpx_priv;
3938
@@ -453,10 +452,9 @@ static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev) · 413 unmodified lines
453452 return false;
454453
455454 status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
456− if (ACPI_FAILURE(status)) {
457− radeon_atpx_priv.other_handle = dhandle;
455+ if (ACPI_FAILURE(status))
458456 return false;
459− }
457+
460458 radeon_atpx_priv.dhandle = dhandle;
461459 radeon_atpx_priv.atpx.handle = atpx_handle;
462460 return true;
@@ -540,16 +538,6 @@ static bool radeon_atpx_detect(void) · 77 unmodified lines
540538 printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n",
541539 acpi_method_name);
542540 radeon_atpx_priv.atpx_detected = true;
543− /*
544− * On some systems hotplug events are generated for the device
545− * being switched off when ATPX is executed. They cause ACPI
546− * hotplug to trigger and attempt to remove the device from
547− * the system, which causes it to break down. Prevent that from
548− * happening by setting the no_hotplug flag for the involved
549− * ACPI device objects.
550− */
551− acpi_bus_no_hotplug(radeon_atpx_priv.dhandle);
552− acpi_bus_no_hotplug(radeon_atpx_priv.other_handle);
553541 return true;
554542 }
555543 return false;
drivers/gpu/drm/radeon/radeon_device.c+9−2
@@ -1393,7 +1393,7 @@ int radeon_device_init(struct radeon_device *rdev, · 1392 unmodified lines
13931393
13941394 r = radeon_init(rdev);
13951395 if (r)
1396− return r;
1396+ goto failed;
13971397
13981398 r = radeon_ib_ring_tests(rdev);
13991399 if (r)
@@ -1413,7 +1413,7 @@ int radeon_device_init(struct radeon_device *rdev, · 13 unmodified lines
14131413 radeon_agp_disable(rdev);
14141414 r = radeon_init(rdev);
14151415 if (r)
1416− return r;
1416+ goto failed;
14171417 }
14181418
14191419 if ((radeon_testing & 1)) {
@@ -1435,6 +1435,11 @@ int radeon_device_init(struct radeon_device *rdev, · 15 unmodified lines
14351435 DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n");
14361436 }
14371437 return 0;
1438+
1439+failed:
1440+ if (runtime)
1441+ vga_switcheroo_fini_domain_pm_ops(rdev->dev);
1442+ return r;
14381443 }
14391444
14401445 static void radeon_debugfs_remove_files(struct radeon_device *rdev);
@@ -1455,6 +1460,8 @@ void radeon_device_fini(struct radeon_device *rdev) · 14 unmodified lines
14551460 radeon_bo_evict_vram(rdev);
14561461 radeon_fini(rdev);
14571462 vga_switcheroo_unregister_client(rdev->pdev);
1463+ if (rdev->flags & RADEON_IS_PX)
1464+ vga_switcheroo_fini_domain_pm_ops(rdev->dev);
14581465 vga_client_register(rdev->pdev, NULL, NULL, NULL);
14591466 if (rdev->rio_mem)
14601467 pci_iounmap(rdev->pdev, rdev->rio_mem);
drivers/gpu/drm/radeon/radeon_drv.c+2−1
@@ -83,7 +83,7 @@ · 82 unmodified lines
8383 * CIK: 1D and linear tiling modes contain valid PIPE_CONFIG
8484 * 2.39.0 - Add INFO query for number of active CUs
8585 * 2.40.0 - Add RADEON_GEM_GTT_WC/UC, flush HDP cache before submitting
86− * CS to GPU
86+ * CS to GPU on >= r600
8787 */
8888 #define KMS_DRIVER_MAJOR 2
8989 #define KMS_DRIVER_MINOR 40
@@ -440,6 +440,7 @@ static int radeon_pmops_runtime_suspend(struct device *dev) · 350 unmodified lines
440440 ret = radeon_suspend_kms(drm_dev, false, false);
441441 pci_save_state(pdev);
442442 pci_disable_device(pdev);
443+ pci_ignore_hotplug(pdev);
443444 pci_set_power_state(pdev, PCI_D3cold);
444445 drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
445446
drivers/gpu/drm/radeon/rs400.c+2−2
@@ -221,9 +221,9 @@ void rs400_gart_set_page(struct radeon_device *rdev, unsigned i, · 220 unmodified lines
221221 entry = (lower_32_bits(addr) & PAGE_MASK) |
222222 ((upper_32_bits(addr) & 0xff) << 4);
223223 if (flags & RADEON_GART_PAGE_READ)
224− addr |= RS400_PTE_READABLE;
224+ entry |= RS400_PTE_READABLE;
225225 if (flags & RADEON_GART_PAGE_WRITE)
226− addr |= RS400_PTE_WRITEABLE;
226+ entry |= RS400_PTE_WRITEABLE;
227227 if (!(flags & RADEON_GART_PAGE_SNOOP))
228228 entry |= RS400_PTE_UNSNOOPED;
229229 entry = cpu_to_le32(entry);
drivers/gpu/drm/sti/sti_hdmi.c+0−1
@@ -298,7 +298,6 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi) · 297 unmodified lines
298298 hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD2(HDMI_IFRAME_SLOT_AVI));
299299
300300 val = frame[0xC];
301− val |= frame[0xD] << 8;
302301 hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD3(HDMI_IFRAME_SLOT_AVI));
303302
304303 /* Enable transmission slot for AVI infoframe
drivers/gpu/vga/vga_switcheroo.c+6−0
@@ -660,6 +660,12 @@ int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain * · 659 unmodified lines
660660 }
661661 EXPORT_SYMBOL(vga_switcheroo_init_domain_pm_ops);
662662
663+void vga_switcheroo_fini_domain_pm_ops(struct device *dev)
664+{
665+ dev->pm_domain = NULL;
666+}
667+EXPORT_SYMBOL(vga_switcheroo_fini_domain_pm_ops);
668+
663669 static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev)
664670 {
665671 struct pci_dev *pdev = to_pci_dev(dev);
drivers/gpu/vga/vgaarb.c+37−9
@@ -41,6 +41,7 @@ · 40 unmodified lines
4141 #include <linux/poll.h>
4242 #include <linux/miscdevice.h>
4343 #include <linux/slab.h>
44+#include <linux/screen_info.h>
4445
4546 #include <linux/uaccess.h>
4647
@@ -112,10 +113,8 @@ both: · 65 unmodified lines
112113 return 1;
113114 }
114115
115−#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
116116 /* this is only used a cookie - it should not be dereferenced */
117117 static struct pci_dev *vga_default;
118−#endif
119118
120119 static void vga_arb_device_card_gone(struct pci_dev *pdev);
121120
@@ -131,7 +130,6 @@ static struct vga_device *vgadev_find(struct pci_dev *pdev) · 9 unmodified lines
131130 }
132131
133132 /* Returns the default VGA device (vgacon's babe) */
134−#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
135133 struct pci_dev *vga_default_device(void)
136134 {
137135 return vga_default;
@@ -147,7 +145,6 @@ void vga_set_default_device(struct pci_dev *pdev) · 9 unmodified lines
147145 pci_dev_put(vga_default);
148146 vga_default = pci_dev_get(pdev);
149147 }
150−#endif
151148
152149 static inline void vga_irq_set_state(struct vga_device *vgadev, bool state)
153150 {
@@ -583,11 +580,12 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) · 429 unmodified lines
583580 /* Deal with VGA default device. Use first enabled one
584581 * by default if arch doesn't have it's own hook
585582 */
586−#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
587583 if (vga_default == NULL &&
588− ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK))
584+ ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) {
585+ pr_info("vgaarb: setting as boot device: PCI:%s\n",
586+ pci_name(pdev));
589587 vga_set_default_device(pdev);
590−#endif
588+ }
591589
592590 vga_arbiter_check_bridge_sharing(vgadev);
593591
@@ -621,10 +619,8 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev) · 27 unmodified lines
621619 goto bail;
622620 }
623621
624−#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
625622 if (vga_default == pdev)
626623 vga_set_default_device(NULL);
627−#endif
628624
629625 if (vgadev->decodes & (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM))
630626 vga_decode_count--;
@@ -1320,6 +1316,38 @@ static int __init vga_arb_device_init(void) · 689 unmodified lines
13201316 pr_info("vgaarb: loaded\n");
13211317
13221318 list_for_each_entry(vgadev, &vga_list, list) {
1319+#if defined(CONFIG_X86) || defined(CONFIG_IA64)
1320+ /* Override I/O based detection done by vga_arbiter_add_pci_device()
1321+ * as it may take the wrong device (e.g. on Apple system under EFI).
1322+ *
1323+ * Select the device owning the boot framebuffer if there is one.
1324+ */
1325+ resource_size_t start, end;
1326+ int i;
1327+
1328+ /* Does firmware framebuffer belong to us? */
1329+ for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
1330+ if (!(pci_resource_flags(vgadev->pdev, i) & IORESOURCE_MEM))
1331+ continue;
1332+
1333+ start = pci_resource_start(vgadev->pdev, i);
1334+ end = pci_resource_end(vgadev->pdev, i);
1335+
1336+ if (!start || !end)
1337+ continue;
1338+
1339+ if (screen_info.lfb_base < start ||
1340+ (screen_info.lfb_base + screen_info.lfb_size) >= end)
1341+ continue;
1342+ if (!vga_default_device())
1343+ pr_info("vgaarb: setting as boot device: PCI:%s\n",
1344+ pci_name(vgadev->pdev));
1345+ else if (vgadev->pdev != vga_default_device())
1346+ pr_info("vgaarb: overriding boot device: PCI:%s\n",
1347+ pci_name(vgadev->pdev));
1348+ vga_set_default_device(vgadev->pdev);
1349+ }
1350+#endif
13231351 if (vgadev->bridge_has_one_vga)
13241352 pr_info("vgaarb: bridge control possible %s\n", pci_name(vgadev->pdev));
13251353 else
drivers/iio/accel/bma180.c+1−1
@@ -571,7 +571,7 @@ static int bma180_probe(struct i2c_client *client, · 570 unmodified lines
571571 trig->ops = &bma180_trigger_ops;
572572 iio_trigger_set_drvdata(trig, indio_dev);
573573 data->trig = trig;
574− indio_dev->trig = trig;
574+ indio_dev->trig = iio_trigger_get(trig);
575575
576576 ret = iio_trigger_register(trig);
577577 if (ret)
drivers/iio/adc/ad_sigma_delta.c+1−1
@@ -472,7 +472,7 @@ static int ad_sd_probe_trigger(struct iio_dev *indio_dev) · 471 unmodified lines
472472 goto error_free_irq;
473473
474474 /* select default trigger */
475− indio_dev->trig = sigma_delta->trig;
475+ indio_dev->trig = iio_trigger_get(sigma_delta->trig);
476476
477477 return 0;
478478
drivers/iio/adc/at91_adc.c+7−5
@@ -196,6 +196,7 @@ struct at91_adc_state { · 195 unmodified lines
196196 bool done;
197197 int irq;
198198 u16 last_value;
199+ int chnb;
199200 struct mutex lock;
200201 u8 num_channels;
201202 void __iomem *reg_base;
@@ -274,7 +275,7 @@ void handle_adc_eoc_trigger(int irq, struct iio_dev *idev) · 72 unmodified lines
274275 disable_irq_nosync(irq);
275276 iio_trigger_poll(idev->trig);
276277 } else {
277− st->last_value = at91_adc_readl(st, AT91_ADC_LCDR);
278+ st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb));
278279 st->done = true;
279280 wake_up_interruptible(&st->wq_data_avail);
280281 }
@@ -351,7 +352,7 @@ static irqreturn_t at91_adc_rl_interrupt(int irq, void *private) · 70 unmodified lines
351352 unsigned int reg;
352353
353354 status &= at91_adc_readl(st, AT91_ADC_IMR);
354− if (status & st->registers->drdy_mask)
355+ if (status & GENMASK(st->num_channels - 1, 0))
355356 handle_adc_eoc_trigger(irq, idev);
356357
357358 if (status & AT91RL_ADC_IER_PEN) {
@@ -418,7 +419,7 @@ static irqreturn_t at91_adc_9x5_interrupt(int irq, void *private) · 60 unmodified lines
418419 AT91_ADC_IER_YRDY |
419420 AT91_ADC_IER_PRDY;
420421
421− if (status & st->registers->drdy_mask)
422+ if (status & GENMASK(st->num_channels - 1, 0))
422423 handle_adc_eoc_trigger(irq, idev);
423424
424425 if (status & AT91_ADC_IER_PEN) {
@@ -689,9 +690,10 @@ static int at91_adc_read_raw(struct iio_dev *idev, · 264 unmodified lines
689690 case IIO_CHAN_INFO_RAW:
690691 mutex_lock(&st->lock);
691692
693+ st->chnb = chan->channel;
692694 at91_adc_writel(st, AT91_ADC_CHER,
693695 AT91_ADC_CH(chan->channel));
694− at91_adc_writel(st, AT91_ADC_IER, st->registers->drdy_mask);
696+ at91_adc_writel(st, AT91_ADC_IER, BIT(chan->channel));
695697 at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_START);
696698
697699 ret = wait_event_interruptible_timeout(st->wq_data_avail,
@@ -708,7 +710,7 @@ static int at91_adc_read_raw(struct iio_dev *idev, · 10 unmodified lines
708710
709711 at91_adc_writel(st, AT91_ADC_CHDR,
710712 AT91_ADC_CH(chan->channel));
711− at91_adc_writel(st, AT91_ADC_IDR, st->registers->drdy_mask);
713+ at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel));
712714
713715 st->last_value = 0;
714716 st->done = false;
drivers/iio/adc/xilinx-xadc-core.c+1−1
@@ -1126,7 +1126,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np, · 1125 unmodified lines
11261126 chan->address = XADC_REG_VPVN;
11271127 } else {
11281128 chan->scan_index = 15 + reg;
1129− chan->scan_index = XADC_REG_VAUX(reg - 1);
1129+ chan->address = XADC_REG_VAUX(reg - 1);
11301130 }
11311131 num_channels++;
11321132 chan++;
drivers/iio/common/hid-sensors/hid-sensor-trigger.c+2−1
@@ -122,7 +122,8 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, · 121 unmodified lines
122122 dev_err(&indio_dev->dev, "Trigger Register Failed\n");
123123 goto error_free_trig;
124124 }
125− indio_dev->trig = attrb->trigger = trig;
125+ attrb->trigger = trig;
126+ indio_dev->trig = iio_trigger_get(trig);
126127
127128 return ret;
128129
drivers/iio/common/st_sensors/st_sensors_trigger.c+1−1
@@ -49,7 +49,7 @@ int st_sensors_allocate_trigger(struct iio_dev *indio_dev, · 48 unmodified lines
4949 dev_err(&indio_dev->dev, "failed to register iio trigger.\n");
5050 goto iio_trigger_register_error;
5151 }
52− indio_dev->trig = sdata->trig;
52+ indio_dev->trig = iio_trigger_get(sdata->trig);
5353
5454 return 0;
5555
drivers/iio/gyro/itg3200_buffer.c+1−1
@@ -132,7 +132,7 @@ int itg3200_probe_trigger(struct iio_dev *indio_dev) · 131 unmodified lines
132132 goto error_free_irq;
133133
134134 /* select default trigger */
135− indio_dev->trig = st->trig;
135+ indio_dev->trig = iio_trigger_get(st->trig);
136136
137137 return 0;
138138
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c+1−1
@@ -135,7 +135,7 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev) · 134 unmodified lines
135135 ret = iio_trigger_register(st->trig);
136136 if (ret)
137137 goto error_free_irq;
138− indio_dev->trig = st->trig;
138+ indio_dev->trig = iio_trigger_get(st->trig);
139139
140140 return 0;
141141
drivers/iio/inkern.c+1−1
@@ -178,7 +178,7 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, · 177 unmodified lines
178178 index = of_property_match_string(np, "io-channel-names",
179179 name);
180180 chan = of_iio_channel_get(np, index);
181− if (!IS_ERR(chan))
181+ if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER)
182182 break;
183183 else if (name && index >= 0) {
184184 pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",
drivers/iio/magnetometer/st_magn_core.c+30−22
@@ -42,7 +42,8 @@ · 41 unmodified lines
4242 #define ST_MAGN_FS_AVL_5600MG 5600
4343 #define ST_MAGN_FS_AVL_8000MG 8000
4444 #define ST_MAGN_FS_AVL_8100MG 8100
45−#define ST_MAGN_FS_AVL_10000MG 10000
45+#define ST_MAGN_FS_AVL_12000MG 12000
46+#define ST_MAGN_FS_AVL_16000MG 16000
4647
4748 /* CUSTOM VALUES FOR SENSOR 1 */
4849 #define ST_MAGN_1_WAI_EXP 0x3c
@@ -69,20 +70,20 @@ · 20 unmodified lines
6970 #define ST_MAGN_1_FS_AVL_4700_VAL 0x05
7071 #define ST_MAGN_1_FS_AVL_5600_VAL 0x06
7172 #define ST_MAGN_1_FS_AVL_8100_VAL 0x07
72−#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 1100
73−#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 855
74−#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 670
75−#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 450
76−#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 400
77−#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 330
78−#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 230
79−#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 980
80−#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 760
81−#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 600
82−#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 400
83−#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 355
84−#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 295
85−#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 205
73+#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 909
74+#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 1169
75+#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 1492
76+#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 2222
77+#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 2500
78+#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 3030
79+#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 4347
80+#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 1020
81+#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 1315
82+#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 1666
83+#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 2500
84+#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 2816
85+#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 3389
86+#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 4878
8687 #define ST_MAGN_1_MULTIREAD_BIT false
8788
8889 /* CUSTOM VALUES FOR SENSOR 2 */
@@ -105,10 +106,12 @@ · 16 unmodified lines
105106 #define ST_MAGN_2_FS_MASK 0x60
106107 #define ST_MAGN_2_FS_AVL_4000_VAL 0x00
107108 #define ST_MAGN_2_FS_AVL_8000_VAL 0x01
108−#define ST_MAGN_2_FS_AVL_10000_VAL 0x02
109−#define ST_MAGN_2_FS_AVL_4000_GAIN 430
110−#define ST_MAGN_2_FS_AVL_8000_GAIN 230
111−#define ST_MAGN_2_FS_AVL_10000_GAIN 230
109+#define ST_MAGN_2_FS_AVL_12000_VAL 0x02
110+#define ST_MAGN_2_FS_AVL_16000_VAL 0x03
111+#define ST_MAGN_2_FS_AVL_4000_GAIN 146
112+#define ST_MAGN_2_FS_AVL_8000_GAIN 292
113+#define ST_MAGN_2_FS_AVL_12000_GAIN 438
114+#define ST_MAGN_2_FS_AVL_16000_GAIN 584
112115 #define ST_MAGN_2_MULTIREAD_BIT false
113116 #define ST_MAGN_2_OUT_X_L_ADDR 0x28
114117 #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a
@@ -266,9 +269,14 @@ static const struct st_sensors st_magn_sensors[] = { · 151 unmodified lines
266269 .gain = ST_MAGN_2_FS_AVL_8000_GAIN,
267270 },
268271 [2] = {
269− .num = ST_MAGN_FS_AVL_10000MG,
270− .value = ST_MAGN_2_FS_AVL_10000_VAL,
271− .gain = ST_MAGN_2_FS_AVL_10000_GAIN,
272+ .num = ST_MAGN_FS_AVL_12000MG,
273+ .value = ST_MAGN_2_FS_AVL_12000_VAL,
274+ .gain = ST_MAGN_2_FS_AVL_12000_GAIN,
275+ },
276+ [3] = {
277+ .num = ST_MAGN_FS_AVL_16000MG,
278+ .value = ST_MAGN_2_FS_AVL_16000_VAL,
279+ .gain = ST_MAGN_2_FS_AVL_16000_GAIN,
272280 },
273281 },
274282 },
drivers/infiniband/ulp/isert/ib_isert.c+11−9
@@ -586,17 +586,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) · 585 unmodified lines
586586 init_completion(&isert_conn->conn_wait);
587587 init_completion(&isert_conn->conn_wait_comp_err);
588588 kref_init(&isert_conn->conn_kref);
589− kref_get(&isert_conn->conn_kref);
590589 mutex_init(&isert_conn->conn_mutex);
591590 spin_lock_init(&isert_conn->conn_lock);
592591 INIT_LIST_HEAD(&isert_conn->conn_fr_pool);
593592
594593 cma_id->context = isert_conn;
595594 isert_conn->conn_cm_id = cma_id;
596− isert_conn->responder_resources = event->param.conn.responder_resources;
597− isert_conn->initiator_depth = event->param.conn.initiator_depth;
598− pr_debug("Using responder_resources: %u initiator_depth: %u\n",
599− isert_conn->responder_resources, isert_conn->initiator_depth);
600595
601596 isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN +
602597 ISER_RX_LOGIN_SIZE, GFP_KERNEL);
@@ -643,6 +638,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) · 40 unmodified lines
643638 goto out_rsp_dma_map;
644639 }
645640
641+ /* Set max inflight RDMA READ requests */
642+ isert_conn->initiator_depth = min_t(u8,
643+ event->param.conn.initiator_depth,
644+ device->dev_attr.max_qp_init_rd_atom);
645+ pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth);
646+
646647 isert_conn->conn_device = device;
647648 isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device);
648649 if (IS_ERR(isert_conn->conn_pd)) {
@@ -746,7 +747,9 @@ isert_connect_release(struct isert_conn *isert_conn) · 97 unmodified lines
746747 static void
747748 isert_connected_handler(struct rdma_cm_id *cma_id)
748749 {
749− return;
750+ struct isert_conn *isert_conn = cma_id->context;
751+
752+ kref_get(&isert_conn->conn_kref);
750753 }
751754
752755 static void
@@ -798,7 +801,6 @@ isert_disconnect_work(struct work_struct *work) · 45 unmodified lines
798801
799802 wake_up:
800803 complete(&isert_conn->conn_wait);
801− isert_put_conn(isert_conn);
802804 }
803805
804806 static void
@@ -3067,7 +3069,6 @@ isert_rdma_accept(struct isert_conn *isert_conn) · 2262 unmodified lines
30673069 int ret;
30683070
30693071 memset(&cp, 0, sizeof(struct rdma_conn_param));
3070− cp.responder_resources = isert_conn->responder_resources;
30713072 cp.initiator_depth = isert_conn->initiator_depth;
30723073 cp.retry_count = 7;
30733074 cp.rnr_retry_count = 7;
@@ -3215,7 +3216,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) · 141 unmodified lines
32153216 pr_debug("isert_wait_conn: Starting \n");
32163217
32173218 mutex_lock(&isert_conn->conn_mutex);
3218− if (isert_conn->conn_cm_id) {
3219+ if (isert_conn->conn_cm_id && !isert_conn->disconnect) {
32193220 pr_debug("Calling rdma_disconnect from isert_wait_conn\n");
32203221 rdma_disconnect(isert_conn->conn_cm_id);
32213222 }
@@ -3234,6 +3235,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) · 12 unmodified lines
32343235 wait_for_completion(&isert_conn->conn_wait_comp_err);
32353236
32363237 wait_for_completion(&isert_conn->conn_wait);
3238+ isert_put_conn(isert_conn);
32373239 }
32383240
32393241 static void isert_free_conn(struct iscsi_conn *conn)
drivers/input/keyboard/atkbd.c+0−8
@@ -1791,14 +1791,6 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = { · 1790 unmodified lines
17911791 {
17921792 .matches = {
17931793 DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
1794− DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"),
1795− },
1796− .callback = atkbd_deactivate_fixup,
1797− },
1798− {
1799− .matches = {
1800− DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
1801− DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"),
18021794 },
18031795 .callback = atkbd_deactivate_fixup,
18041796 },
drivers/input/serio/i8042-x86ia64io.h+15−0
@@ -465,6 +465,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { · 464 unmodified lines
465465 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
466466 },
467467 },
468+ {
469+ /* Avatar AVIU-145A6 */
470+ .matches = {
471+ DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
472+ DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
473+ },
474+ },
468475 { }
469476 };
470477
@@ -608,6 +615,14 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = { · 137 unmodified lines
608615 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
609616 },
610617 },
618+ {
619+ /* Fujitsu U574 laptop */
620+ /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
621+ .matches = {
622+ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
623+ DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
624+ },
625+ },
611626 { }
612627 };
613628
drivers/input/serio/i8042.c+2−0
@@ -1254,6 +1254,8 @@ static int __init i8042_create_aux_port(int idx) · 1253 unmodified lines
12541254 } else {
12551255 snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx);
12561256 snprintf(serio->phys, sizeof(serio->phys), I8042_MUX_PHYS_DESC, idx + 1);
1257+ strlcpy(serio->firmware_id, i8042_aux_firmware_id,
1258+ sizeof(serio->firmware_id));
12571259 }
12581260
12591261 port->serio = serio;
drivers/media/Kconfig+0−1
@@ -182,7 +182,6 @@ config MEDIA_SUBDRV_AUTOSELECT · 181 unmodified lines
182182 depends on HAS_IOMEM
183183 select I2C
184184 select I2C_MUX
185− select SPI
186185 default y
187186 help
188187 By default, a media driver auto-selects all possible ancillary
drivers/media/dvb-core/dvb-usb-ids.h+2−0
@@ -280,6 +280,8 @@ · 279 unmodified lines
280280 #define USB_PID_PCTV_400E 0x020f
281281 #define USB_PID_PCTV_450E 0x0222
282282 #define USB_PID_PCTV_452E 0x021f
283+#define USB_PID_PCTV_78E 0x025a
284+#define USB_PID_PCTV_79E 0x0262
283285 #define USB_PID_REALTEK_RTL2831U 0x2831
284286 #define USB_PID_REALTEK_RTL2832U 0x2832
285287 #define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007
drivers/media/dvb-frontends/af9033.c+13−0
@@ -314,6 +314,19 @@ static int af9033_init(struct dvb_frontend *fe) · 313 unmodified lines
314314 goto err;
315315 }
316316
317+ /* feed clock to RF tuner */
318+ switch (state->cfg.tuner) {
319+ case AF9033_TUNER_IT9135_38:
320+ case AF9033_TUNER_IT9135_51:
321+ case AF9033_TUNER_IT9135_52:
322+ case AF9033_TUNER_IT9135_60:
323+ case AF9033_TUNER_IT9135_61:
324+ case AF9033_TUNER_IT9135_62:
325+ ret = af9033_wr_reg(state, 0x80fba8, 0x00);
326+ if (ret < 0)
327+ goto err;
328+ }
329+
317330 /* settings for TS interface */
318331 if (state->cfg.ts_mode == AF9033_TS_MODE_USB) {
319332 ret = af9033_wr_reg_mask(state, 0x80f9a5, 0x00, 0x01);
drivers/media/dvb-frontends/af9033_priv.h+9−11
@@ -1418,7 +1418,7 @@ static const struct reg_val tuner_init_it9135_60[] = { · 1417 unmodified lines
14181418 { 0x800068, 0x0a },
14191419 { 0x80006a, 0x03 },
14201420 { 0x800070, 0x0a },
1421− { 0x800071, 0x05 },
1421+ { 0x800071, 0x0a },
14221422 { 0x800072, 0x02 },
14231423 { 0x800075, 0x8c },
14241424 { 0x800076, 0x8c },
@@ -1484,7 +1484,6 @@ static const struct reg_val tuner_init_it9135_60[] = { · 59 unmodified lines
14841484 { 0x800104, 0x02 },
14851485 { 0x800105, 0xbe },
14861486 { 0x800106, 0x00 },
1487− { 0x800109, 0x02 },
14881487 { 0x800115, 0x0a },
14891488 { 0x800116, 0x03 },
14901489 { 0x80011a, 0xbe },
@@ -1510,7 +1509,6 @@ static const struct reg_val tuner_init_it9135_60[] = { · 19 unmodified lines
15101509 { 0x80014b, 0x8c },
15111510 { 0x80014d, 0xac },
15121511 { 0x80014e, 0xc6 },
1513− { 0x80014f, 0x03 },
15141512 { 0x800151, 0x1e },
15151513 { 0x800153, 0xbc },
15161514 { 0x800178, 0x09 },
@@ -1522,9 +1520,10 @@ static const struct reg_val tuner_init_it9135_60[] = { · 5 unmodified lines
15221520 { 0x80018d, 0x5f },
15231521 { 0x80018f, 0xa0 },
15241522 { 0x800190, 0x5a },
1525− { 0x80ed02, 0xff },
1526− { 0x80ee42, 0xff },
1527− { 0x80ee82, 0xff },
1523+ { 0x800191, 0x00 },
1524+ { 0x80ed02, 0x40 },
1525+ { 0x80ee42, 0x40 },
1526+ { 0x80ee82, 0x40 },
15281527 { 0x80f000, 0x0f },
15291528 { 0x80f01f, 0x8c },
15301529 { 0x80f020, 0x00 },
@@ -1699,7 +1698,6 @@ static const struct reg_val tuner_init_it9135_61[] = { · 168 unmodified lines
16991698 { 0x800104, 0x02 },
17001699 { 0x800105, 0xc8 },
17011700 { 0x800106, 0x00 },
1702− { 0x800109, 0x02 },
17031701 { 0x800115, 0x0a },
17041702 { 0x800116, 0x03 },
17051703 { 0x80011a, 0xc6 },
@@ -1725,7 +1723,6 @@ static const struct reg_val tuner_init_it9135_61[] = { · 19 unmodified lines
17251723 { 0x80014b, 0x8c },
17261724 { 0x80014d, 0xa8 },
17271725 { 0x80014e, 0xc6 },
1728− { 0x80014f, 0x03 },
17291726 { 0x800151, 0x28 },
17301727 { 0x800153, 0xcc },
17311728 { 0x800178, 0x09 },
@@ -1737,9 +1734,10 @@ static const struct reg_val tuner_init_it9135_61[] = { · 5 unmodified lines
17371734 { 0x80018d, 0x5f },
17381735 { 0x80018f, 0xfb },
17391736 { 0x800190, 0x5c },
1740− { 0x80ed02, 0xff },
1741− { 0x80ee42, 0xff },
1742− { 0x80ee82, 0xff },
1737+ { 0x800191, 0x00 },
1738+ { 0x80ed02, 0x40 },
1739+ { 0x80ee42, 0x40 },
1740+ { 0x80ee82, 0x40 },
17431741 { 0x80f000, 0x0f },
17441742 { 0x80f01f, 0x8c },
17451743 { 0x80f020, 0x00 },
drivers/media/i2c/smiapp/smiapp-core.c+3−10
@@ -1282,19 +1282,12 @@ static int smiapp_set_power(struct v4l2_subdev *subdev, int on) · 1281 unmodified lines
12821282
12831283 mutex_lock(&sensor->power_mutex);
12841284
1285− /*
1286− * If the power count is modified from 0 to != 0 or from != 0
1287− * to 0, update the power state.
1288− */
1289− if (!sensor->power_count == !on)
1290− goto out;
1291−
1292− if (on) {
1285+ if (on && !sensor->power_count) {
12931286 /* Power on and perform initialisation. */
12941287 ret = smiapp_power_on(sensor);
12951288 if (ret < 0)
12961289 goto out;
1297− } else {
1290+ } else if (!on && sensor->power_count == 1) {
12981291 smiapp_power_off(sensor);
12991292 }
13001293
@@ -2572,7 +2565,7 @@ static int smiapp_registered(struct v4l2_subdev *subdev) · 1271 unmodified lines
25722565
25732566 this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
25742567 this->sd.internal_ops = &smiapp_internal_ops;
2575− this->sd.owner = NULL;
2568+ this->sd.owner = THIS_MODULE;
25762569 v4l2_set_subdevdata(&this->sd, client);
25772570
25782571 rval = media_entity_init(&this->sd.entity,
drivers/media/pci/cx18/cx18-driver.c+1−0
@@ -1091,6 +1091,7 @@ static int cx18_probe(struct pci_dev *pci_dev, · 1090 unmodified lines
10911091 setup.addr = ADDR_UNSET;
10921092 setup.type = cx->options.tuner;
10931093 setup.mode_mask = T_ANALOG_TV; /* matches TV tuners */
1094+ setup.config = NULL;
10941095 if (cx->options.radio > 0)
10951096 setup.mode_mask |= T_RADIO;
10961097 setup.tuner_callback = (setup.type == TUNER_XC2028) ?
drivers/media/tuners/tuner_it913x.c+6−0
@@ -396,6 +396,7 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe, · 395 unmodified lines
396396 struct i2c_adapter *i2c_adap, u8 i2c_addr, u8 config)
397397 {
398398 struct it913x_state *state = NULL;
399+ int ret;
399400
400401 /* allocate memory for the internal state */
401402 state = kzalloc(sizeof(struct it913x_state), GFP_KERNEL);
@@ -425,6 +426,11 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe, · 23 unmodified lines
425426 state->tuner_type = config;
426427 state->firmware_ver = 1;
427428
429+ /* tuner RF initial */
430+ ret = it913x_wr_reg(state, PRO_DMOD, 0xec4c, 0x68);
431+ if (ret < 0)
432+ goto error;
433+
428434 fe->tuner_priv = state;
429435 memcpy(&fe->ops.tuner_ops, &it913x_tuner_ops,
430436 sizeof(struct dvb_tuner_ops));
drivers/media/usb/dvb-usb-v2/af9035.c+4−0
@@ -1575,6 +1575,10 @@ static const struct usb_device_id af9035_id_table[] = { · 1574 unmodified lines
15751575 &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) },
15761576 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xf900,
15771577 &af9035_props, "Hauppauge WinTV-MiniStick 2", NULL) },
1578+ { DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_78E,
1579+ &af9035_props, "PCTV 78e", RC_MAP_IT913X_V1) },
1580+ { DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_79E,
1581+ &af9035_props, "PCTV 79e", RC_MAP_IT913X_V2) },
15781582 { }
15791583 };
15801584 MODULE_DEVICE_TABLE(usb, af9035_id_table);
drivers/pci/host/pci-imx6.c+38−0
@@ -49,6 +49,9 @@ struct imx6_pcie { · 48 unmodified lines
4949
5050 /* PCIe Port Logic registers (memory-mapped) */
5151 #define PL_OFFSET 0x700
52+#define PCIE_PL_PFLR (PL_OFFSET + 0x08)
53+#define PCIE_PL_PFLR_LINK_STATE_MASK (0x3f << 16)
54+#define PCIE_PL_PFLR_FORCE_LINK (1 << 15)
5255 #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28)
5356 #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c)
5457 #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29)
@@ -214,6 +217,32 @@ static int imx6q_pcie_abort_handler(unsigned long addr, · 159 unmodified lines
214217 static int imx6_pcie_assert_core_reset(struct pcie_port *pp)
215218 {
216219 struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp);
220+ u32 val, gpr1, gpr12;
221+
222+ /*
223+ * If the bootloader already enabled the link we need some special
224+ * handling to get the core back into a state where it is safe to
225+ * touch it for configuration. As there is no dedicated reset signal
226+ * wired up for MX6QDL, we need to manually force LTSSM into "detect"
227+ * state before completely disabling LTSSM, which is a prerequisite
228+ * for core configuration.
229+ *
230+ * If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have a strong
231+ * indication that the bootloader activated the link.
232+ */
233+ regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, &gpr1);
234+ regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, &gpr12);
235+
236+ if ((gpr1 & IMX6Q_GPR1_PCIE_REF_CLK_EN) &&
237+ (gpr12 & IMX6Q_GPR12_PCIE_CTL_2)) {
238+ val = readl(pp->dbi_base + PCIE_PL_PFLR);
239+ val &= ~PCIE_PL_PFLR_LINK_STATE_MASK;
240+ val |= PCIE_PL_PFLR_FORCE_LINK;
241+ writel(val, pp->dbi_base + PCIE_PL_PFLR);
242+
243+ regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
244+ IMX6Q_GPR12_PCIE_CTL_2, 0 << 10);
245+ }
217246
218247 regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
219248 IMX6Q_GPR1_PCIE_TEST_PD, 1 << 18);
@@ -589,6 +618,14 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) · 369 unmodified lines
589618 return 0;
590619 }
591620
621+static void imx6_pcie_shutdown(struct platform_device *pdev)
622+{
623+ struct imx6_pcie *imx6_pcie = platform_get_drvdata(pdev);
624+
625+ /* bring down link, so bootloader gets clean state in case of reboot */
626+ imx6_pcie_assert_core_reset(&imx6_pcie->pp);
627+}
628+
592629 static const struct of_device_id imx6_pcie_of_match[] = {
593630 { .compatible = "fsl,imx6q-pcie", },
594631 {},
@@ -601,6 +638,7 @@ static struct platform_driver imx6_pcie_driver = { · 6 unmodified lines
601638 .owner = THIS_MODULE,
602639 .of_match_table = imx6_pcie_of_match,
603640 },
641+ .shutdown = imx6_pcie_shutdown,
604642 };
605643
606644 /* Freescale PCIe driver does not allow module unload */
drivers/pci/hotplug/acpiphp_glue.c+6−10
@@ -560,19 +560,15 @@ static void disable_slot(struct acpiphp_slot *slot) · 559 unmodified lines
560560 slot->flags &= (~SLOT_ENABLED);
561561 }
562562
563−static bool acpiphp_no_hotplug(struct acpi_device *adev)
564−{
565− return adev && adev->flags.no_hotplug;
566−}
567−
568563 static bool slot_no_hotplug(struct acpiphp_slot *slot)
569564 {
570− struct acpiphp_func *func;
565+ struct pci_bus *bus = slot->bus;
566+ struct pci_dev *dev;
571567
572− list_for_each_entry(func, &slot->funcs, sibling)
573− if (acpiphp_no_hotplug(func_to_acpi_device(func)))
568+ list_for_each_entry(dev, &bus->devices, bus_list) {
569+ if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug)
574570 return true;
575−
571+ }
576572 return false;
577573 }
578574
@@ -645,7 +641,7 @@ static void trim_stale_devices(struct pci_dev *dev) · 66 unmodified lines
645641
646642 status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta);
647643 alive = (ACPI_SUCCESS(status) && device_status_valid(sta))
648− || acpiphp_no_hotplug(adev);
644+ || dev->ignore_hotplug;
649645 }
650646 if (!alive)
651647 alive = pci_device_is_present(dev);
drivers/pci/hotplug/pciehp_hpc.c+12−0
@@ -506,6 +506,8 @@ static irqreturn_t pcie_isr(int irq, void *dev_id) · 505 unmodified lines
506506 {
507507 struct controller *ctrl = (struct controller *)dev_id;
508508 struct pci_dev *pdev = ctrl_dev(ctrl);
509+ struct pci_bus *subordinate = pdev->subordinate;
510+ struct pci_dev *dev;
509511 struct slot *slot = ctrl->slot;
510512 u16 detected, intr_loc;
511513
@@ -539,6 +541,16 @@ static irqreturn_t pcie_isr(int irq, void *dev_id) · 27 unmodified lines
539541 wake_up(&ctrl->queue);
540542 }
541543
544+ if (subordinate) {
545+ list_for_each_entry(dev, &subordinate->devices, bus_list) {
546+ if (dev->ignore_hotplug) {
547+ ctrl_dbg(ctrl, "ignoring hotplug event %#06x (%s requested no hotplug)\n",
548+ intr_loc, pci_name(dev));
549+ return IRQ_HANDLED;
550+ }
551+ }
552+ }
553+
542554 if (!(intr_loc & ~PCI_EXP_SLTSTA_CC))
543555 return IRQ_HANDLED;
544556
drivers/pci/hotplug/pcihp_slot.c+1−5
@@ -46,7 +46,6 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp) · 45 unmodified lines
4646 */
4747 if (pci_is_pcie(dev))
4848 return;
49− dev_info(&dev->dev, "using default PCI settings\n");
5049 hpp = &pci_default_type0;
5150 }
5251
@@ -153,7 +152,6 @@ void pci_configure_slot(struct pci_dev *dev) · 100 unmodified lines
153152 {
154153 struct pci_dev *cdev;
155154 struct hotplug_params hpp;
156− int ret;
157155
158156 if (!(dev->hdr_type == PCI_HEADER_TYPE_NORMAL ||
159157 (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
@@ -163,9 +161,7 @@ void pci_configure_slot(struct pci_dev *dev) · 3 unmodified lines
163161 pcie_bus_configure_settings(dev->bus);
164162
165163 memset(&hpp, 0, sizeof(hpp));
166− ret = pci_get_hp_params(dev, &hpp);
167− if (ret)
168− dev_warn(&dev->dev, "no hotplug settings from platform\n");
164+ pci_get_hp_params(dev, &hpp);
169165
170166 program_hpp_type2(dev, hpp.t2);
171167 program_hpp_type1(dev, hpp.t1);
drivers/phy/Kconfig+2−0
@@ -214,12 +214,14 @@ config PHY_QCOM_IPQ806X_SATA · 213 unmodified lines
214214 config PHY_ST_SPEAR1310_MIPHY
215215 tristate "ST SPEAR1310-MIPHY driver"
216216 select GENERIC_PHY
217+ depends on MACH_SPEAR1310 || COMPILE_TEST
217218 help
218219 Support for ST SPEAr1310 MIPHY which can be used for PCIe and SATA.
219220
220221 config PHY_ST_SPEAR1340_MIPHY
221222 tristate "ST SPEAR1340-MIPHY driver"
222223 select GENERIC_PHY
224+ depends on MACH_SPEAR1340 || COMPILE_TEST
223225 help
224226 Support for ST SPEAr1340 MIPHY which can be used for PCIe and SATA.
225227
drivers/phy/phy-miphy365x.c+1−0
@@ -163,6 +163,7 @@ enum miphy_sata_gen { · 162 unmodified lines
163163 };
164164
165165 static u8 rx_tx_spd[] = {
166+ 0, /* GEN0 doesn't exist. */
166167 TX_SPDSEL_GEN1_VAL | RX_SPDSEL_GEN1_VAL,
167168 TX_SPDSEL_GEN2_VAL | RX_SPDSEL_GEN2_VAL,
168169 TX_SPDSEL_GEN3_VAL | RX_SPDSEL_GEN3_VAL
drivers/regulator/88pm8607.c+1−1
@@ -319,7 +319,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, · 318 unmodified lines
319319 struct regulator_config *config)
320320 {
321321 struct device_node *nproot, *np;
322− nproot = of_node_get(pdev->dev.parent->of_node);
322+ nproot = pdev->dev.parent->of_node;
323323 if (!nproot)
324324 return -ENODEV;
325325 nproot = of_get_child_by_name(nproot, "regulators");
drivers/regulator/da9052-regulator.c+2−2
@@ -422,9 +422,9 @@ static int da9052_regulator_probe(struct platform_device *pdev) · 421 unmodified lines
422422 config.init_data = pdata->regulators[pdev->id];
423423 } else {
424424 #ifdef CONFIG_OF
425− struct device_node *nproot, *np;
425+ struct device_node *nproot = da9052->dev->of_node;
426+ struct device_node *np;
426427
427− nproot = of_node_get(da9052->dev->of_node);
428428 if (!nproot)
429429 return -ENODEV;
430430
drivers/regulator/max8907-regulator.c+1−1
@@ -226,7 +226,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev) · 225 unmodified lines
226226 struct device_node *np, *regulators;
227227 int ret;
228228
229− np = of_node_get(pdev->dev.parent->of_node);
229+ np = pdev->dev.parent->of_node;
230230 if (!np)
231231 return 0;
232232
drivers/regulator/max8925-regulator.c+1−1
@@ -250,7 +250,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev, · 249 unmodified lines
250250 struct device_node *nproot, *np;
251251 int rcount;
252252
253− nproot = of_node_get(pdev->dev.parent->of_node);
253+ nproot = pdev->dev.parent->of_node;
254254 if (!nproot)
255255 return -ENODEV;
256256 np = of_get_child_by_name(nproot, "regulators");
drivers/regulator/max8997.c+1−1
@@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, · 916 unmodified lines
917917 struct max8997_regulator_data *rdata;
918918 unsigned int i, dvs_voltage_nr = 1, ret;
919919
920− pmic_np = of_node_get(iodev->dev->of_node);
920+ pmic_np = iodev->dev->of_node;
921921 if (!pmic_np) {
922922 dev_err(&pdev->dev, "could not find pmic sub-node\n");
923923 return -ENODEV;
drivers/regulator/palmas-regulator.c+0−1
@@ -1427,7 +1427,6 @@ static void palmas_dt_to_pdata(struct device *dev, · 1426 unmodified lines
14271427 u32 prop;
14281428 int idx, ret;
14291429
1430− node = of_node_get(node);
14311430 regulators = of_get_child_by_name(node, "regulators");
14321431 if (!regulators) {
14331432 dev_info(dev, "regulator node not found\n");
drivers/regulator/tps65910-regulator.c+1−1
@@ -1014,7 +1014,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( · 1013 unmodified lines
10141014 if (!pmic_plat_data)
10151015 return NULL;
10161016
1017− np = of_node_get(pdev->dev.parent->of_node);
1017+ np = pdev->dev.parent->of_node;
10181018 regulators = of_get_child_by_name(np, "regulators");
10191019 if (!regulators) {
10201020 dev_err(&pdev->dev, "regulator node not found\n");
drivers/scsi/libiscsi.c+10−0
@@ -717,11 +717,21 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, · 716 unmodified lines
717717 return NULL;
718718 }
719719
720+ if (data_size > ISCSI_DEF_MAX_RECV_SEG_LEN) {
721+ 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);
722+ return NULL;
723+ }
724+
720725 task = conn->login_task;
721726 } else {
722727 if (session->state != ISCSI_STATE_LOGGED_IN)
723728 return NULL;
724729
730+ if (data_size != 0) {
731+ iscsi_conn_printk(KERN_ERR, conn, "Can not send data buffer of len %u for op 0x%x\n", data_size, opcode);
732+ return NULL;
733+ }
734+
725735 BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE);
726736 BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED);
727737
drivers/scsi/scsi_lib.c+3−2
@@ -733,12 +733,13 @@ static bool scsi_end_request(struct request *req, int error, · 732 unmodified lines
733733 } else {
734734 unsigned long flags;
735735
736+ if (bidi_bytes)
737+ scsi_release_bidi_buffers(cmd);
738+
736739 spin_lock_irqsave(q->queue_lock, flags);
737740 blk_finish_request(req, error);
738741 spin_unlock_irqrestore(q->queue_lock, flags);
739742
740− if (bidi_bytes)
741− scsi_release_bidi_buffers(cmd);
742743 scsi_release_buffers(cmd);
743744 scsi_next_command(cmd);
744745 }
drivers/spi/spi-davinci.c+25−14
@@ -397,24 +397,21 @@ static int davinci_spi_setup(struct spi_device *spi) · 396 unmodified lines
397397 struct spi_master *master = spi->master;
398398 struct device_node *np = spi->dev.of_node;
399399 bool internal_cs = true;
400− unsigned long flags = GPIOF_DIR_OUT;
401400
402401 dspi = spi_master_get_devdata(spi->master);
403402 pdata = &dspi->pdata;
404403
405− flags |= (spi->mode & SPI_CS_HIGH) ? GPIOF_INIT_LOW : GPIOF_INIT_HIGH;
406−
407404 if (!(spi->mode & SPI_NO_CS)) {
408405 if (np && (master->cs_gpios != NULL) && (spi->cs_gpio >= 0)) {
409− retval = gpio_request_one(spi->cs_gpio,
410− flags, dev_name(&spi->dev));
406+ retval = gpio_direction_output(
407+ spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
411408 internal_cs = false;
412409 } else if (pdata->chip_sel &&
413410 spi->chip_select < pdata->num_chipselect &&
414411 pdata->chip_sel[spi->chip_select] != SPI_INTERN_CS) {
415412 spi->cs_gpio = pdata->chip_sel[spi->chip_select];
416− retval = gpio_request_one(spi->cs_gpio,
417− flags, dev_name(&spi->dev));
413+ retval = gpio_direction_output(
414+ spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
418415 internal_cs = false;
419416 }
420417
@@ -439,12 +436,6 @@ static int davinci_spi_setup(struct spi_device *spi) · 18 unmodified lines
439436 return retval;
440437 }
441438
442−static void davinci_spi_cleanup(struct spi_device *spi)
443−{
444− if (spi->cs_gpio >= 0)
445− gpio_free(spi->cs_gpio);
446−}
447−
448439 static int davinci_spi_check_error(struct davinci_spi *dspi, int int_status)
449440 {
450441 struct device *sdev = dspi->bitbang.master->dev.parent;
@@ -956,7 +947,6 @@ static int davinci_spi_probe(struct platform_device *pdev) · 505 unmodified lines
956947 master->num_chipselect = pdata->num_chipselect;
957948 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16);
958949 master->setup = davinci_spi_setup;
959− master->cleanup = davinci_spi_cleanup;
960950
961951 dspi->bitbang.chipselect = davinci_spi_chipselect;
962952 dspi->bitbang.setup_transfer = davinci_spi_setup_transfer;
@@ -967,6 +957,27 @@ static int davinci_spi_probe(struct platform_device *pdev) · 4 unmodified lines
967957 if (dspi->version == SPI_VERSION_2)
968958 dspi->bitbang.flags |= SPI_READY;
969959
960+ if (pdev->dev.of_node) {
961+ int i;
962+
963+ for (i = 0; i < pdata->num_chipselect; i++) {
964+ int cs_gpio = of_get_named_gpio(pdev->dev.of_node,
965+ "cs-gpios", i);
966+
967+ if (cs_gpio == -EPROBE_DEFER) {
968+ ret = cs_gpio;
969+ goto free_clk;
970+ }
971+
972+ if (gpio_is_valid(cs_gpio)) {
973+ ret = devm_gpio_request(&pdev->dev, cs_gpio,
974+ dev_name(&pdev->dev));
975+ if (ret)
976+ goto free_clk;
977+ }
978+ }
979+ }
980+
970981 r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
971982 if (r)
972983 dma_rx_chan = r->start;
drivers/spi/spi-dw.c+10−2
@@ -547,8 +547,7 @@ static int dw_spi_setup(struct spi_device *spi) · 546 unmodified lines
547547 /* Only alloc on first setup */
548548 chip = spi_get_ctldata(spi);
549549 if (!chip) {
550− chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data),
551− GFP_KERNEL);
550+ chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL);
552551 if (!chip)
553552 return -ENOMEM;
554553 spi_set_ctldata(spi, chip);
@@ -606,6 +605,14 @@ static int dw_spi_setup(struct spi_device *spi) · 51 unmodified lines
606605 return 0;
607606 }
608607
608+static void dw_spi_cleanup(struct spi_device *spi)
609+{
610+ struct chip_data *chip = spi_get_ctldata(spi);
611+
612+ kfree(chip);
613+ spi_set_ctldata(spi, NULL);
614+}
615+
609616 /* Restart the controller, disable all interrupts, clean rx fifo */
610617 static void spi_hw_init(struct dw_spi *dws)
611618 {
@@ -661,6 +668,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) · 49 unmodified lines
661668 master->bus_num = dws->bus_num;
662669 master->num_chipselect = dws->num_cs;
663670 master->setup = dw_spi_setup;
671+ master->cleanup = dw_spi_cleanup;
664672 master->transfer_one_message = dw_spi_transfer_one_message;
665673 master->max_speed_hz = dws->max_freq;
666674
drivers/spi/spi-fsl-espi.c+12−3
@@ -452,16 +452,16 @@ static int fsl_espi_setup(struct spi_device *spi) · 451 unmodified lines
452452 int retval;
453453 u32 hw_mode;
454454 u32 loop_mode;
455− struct spi_mpc8xxx_cs *cs = spi->controller_state;
455+ struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
456456
457457 if (!spi->max_speed_hz)
458458 return -EINVAL;
459459
460460 if (!cs) {
461− cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL);
461+ cs = kzalloc(sizeof(*cs), GFP_KERNEL);
462462 if (!cs)
463463 return -ENOMEM;
464− spi->controller_state = cs;
464+ spi_set_ctldata(spi, cs);
465465 }
466466
467467 mpc8xxx_spi = spi_master_get_devdata(spi->master);
@@ -496,6 +496,14 @@ static int fsl_espi_setup(struct spi_device *spi) · 28 unmodified lines
496496 return 0;
497497 }
498498
499+static void fsl_espi_cleanup(struct spi_device *spi)
500+{
501+ struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
502+
503+ kfree(cs);
504+ spi_set_ctldata(spi, NULL);
505+}
506+
499507 void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events)
500508 {
501509 struct fsl_espi_reg *reg_base = mspi->reg_base;
@@ -605,6 +613,7 @@ static struct spi_master * fsl_espi_probe(struct device *dev, · 103 unmodified lines
605613
606614 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16);
607615 master->setup = fsl_espi_setup;
616+ master->cleanup = fsl_espi_cleanup;
608617
609618 mpc8xxx_spi = spi_master_get_devdata(master);
610619 mpc8xxx_spi->spi_do_one_msg = fsl_espi_do_one_msg;
drivers/spi/spi-fsl-spi.c+7−3
@@ -425,16 +425,16 @@ static int fsl_spi_setup(struct spi_device *spi) · 424 unmodified lines
425425 struct fsl_spi_reg *reg_base;
426426 int retval;
427427 u32 hw_mode;
428− struct spi_mpc8xxx_cs *cs = spi->controller_state;
428+ struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
429429
430430 if (!spi->max_speed_hz)
431431 return -EINVAL;
432432
433433 if (!cs) {
434− cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL);
434+ cs = kzalloc(sizeof(*cs), GFP_KERNEL);
435435 if (!cs)
436436 return -ENOMEM;
437− spi->controller_state = cs;
437+ spi_set_ctldata(spi, cs);
438438 }
439439 mpc8xxx_spi = spi_master_get_devdata(spi->master);
440440
@@ -496,9 +496,13 @@ static int fsl_spi_setup(struct spi_device *spi) · 55 unmodified lines
496496 static void fsl_spi_cleanup(struct spi_device *spi)
497497 {
498498 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
499+ struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
499500
500501 if (mpc8xxx_spi->type == TYPE_GRLIB && gpio_is_valid(spi->cs_gpio))
501502 gpio_free(spi->cs_gpio);
503+
504+ kfree(cs);
505+ spi_set_ctldata(spi, NULL);
502506 }
503507
504508 static void fsl_spi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events)
drivers/spi/spi-pl022.c+1−1
@@ -2136,7 +2136,7 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) · 2135 unmodified lines
21362136 cs_gpio);
21372137 else if (gpio_direction_output(cs_gpio, 1))
21382138 dev_err(&adev->dev,
2139− "could set gpio %d as output\n",
2139+ "could not set gpio %d as output\n",
21402140 cs_gpio);
21412141 }
21422142 }
drivers/spi/spi-rockchip.c+3−2
@@ -220,7 +220,7 @@ static inline void wait_for_idle(struct rockchip_spi *rs) · 219 unmodified lines
220220 do {
221221 if (!(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY))
222222 return;
223− } while (time_before(jiffies, timeout));
223+ } while (!time_after(jiffies, timeout));
224224
225225 dev_warn(rs->dev, "spi controller is in busy state!\n");
226226 }
@@ -529,7 +529,8 @@ static int rockchip_spi_transfer_one( · 302 unmodified lines
529529 int ret = 0;
530530 struct rockchip_spi *rs = spi_master_get_devdata(master);
531531
532− WARN_ON((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
532+ WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) &&
533+ (readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
533534
534535 if (!xfer->tx_buf && !xfer->rx_buf) {
535536 dev_err(rs->dev, "No buffer for transfer\n");
drivers/spi/spi-sirf.c+4−1
@@ -312,6 +312,8 @@ static int spi_sirfsoc_cmd_transfer(struct spi_device *spi, · 311 unmodified lines
312312 u32 cmd;
313313
314314 sspi = spi_master_get_devdata(spi->master);
315+ writel(SIRFSOC_SPI_FIFO_RESET, sspi->base + SIRFSOC_SPI_TXFIFO_OP);
316+ writel(SIRFSOC_SPI_FIFO_START, sspi->base + SIRFSOC_SPI_TXFIFO_OP);
315317 memcpy(&cmd, sspi->tx, t->len);
316318 if (sspi->word_width == 1 && !(spi->mode & SPI_LSB_FIRST))
317319 cmd = cpu_to_be32(cmd) >>
@@ -438,7 +440,8 @@ static void spi_sirfsoc_pio_transfer(struct spi_device *spi, · 120 unmodified lines
438440 sspi->tx_word(sspi);
439441 writel(SIRFSOC_SPI_TXFIFO_EMPTY_INT_EN |
440442 SIRFSOC_SPI_TX_UFLOW_INT_EN |
441− SIRFSOC_SPI_RX_OFLOW_INT_EN,
443+ SIRFSOC_SPI_RX_OFLOW_INT_EN |
444+ SIRFSOC_SPI_RX_IO_DMA_INT_EN,
442445 sspi->base + SIRFSOC_SPI_INT_EN);
443446 writel(SIRFSOC_SPI_RX_EN | SIRFSOC_SPI_TX_EN,
444447 sspi->base + SIRFSOC_SPI_TX_RX_EN);
drivers/staging/iio/meter/ade7758_trigger.c+1−1
@@ -85,7 +85,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) · 84 unmodified lines
8585 ret = iio_trigger_register(st->trig);
8686
8787 /* select default trigger */
88− indio_dev->trig = st->trig;
88+ indio_dev->trig = iio_trigger_get(st->trig);
8989 if (ret)
9090 goto error_free_irq;
9191
drivers/staging/vt6655/hostap.c+3−0
@@ -350,6 +350,9 @@ static int hostap_set_generic_element(PSDevice pDevice, · 349 unmodified lines
350350 {
351351 PSMgmtObject pMgmt = pDevice->pMgmt;
352352
353+ if (param->u.generic_elem.len > sizeof(pMgmt->abyWPAIE))
354+ return -EINVAL;
355+
353356 memcpy(pMgmt->abyWPAIE,
354357 param->u.generic_elem.data,
355358 param->u.generic_elem.len
drivers/target/iscsi/iscsi_target.c+3−1
@@ -4540,6 +4540,7 @@ static void iscsit_logout_post_handler_diffcid( · 4539 unmodified lines
45404540 {
45414541 struct iscsi_conn *l_conn;
45424542 struct iscsi_session *sess = conn->sess;
4543+ bool conn_found = false;
45434544
45444545 if (!sess)
45454546 return;
@@ -4548,12 +4549,13 @@ static void iscsit_logout_post_handler_diffcid( · 2 unmodified lines
45484549 list_for_each_entry(l_conn, &sess->sess_conn_list, conn_list) {
45494550 if (l_conn->cid == cid) {
45504551 iscsit_inc_conn_usage_count(l_conn);
4552+ conn_found = true;
45514553 break;
45524554 }
45534555 }
45544556 spin_unlock_bh(&sess->conn_lock);
45554557
4556− if (!l_conn)
4558+ if (!conn_found)
45574559 return;
45584560
45594561 if (l_conn->sock)
drivers/target/iscsi/iscsi_target_parameters.c+1−1
@@ -601,7 +601,7 @@ int iscsi_copy_param_list( · 600 unmodified lines
601601 param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL);
602602 if (!param_list) {
603603 pr_err("Unable to allocate memory for struct iscsi_param_list.\n");
604− goto err_out;
604+ return -1;
605605 }
606606 INIT_LIST_HEAD(&param_list->param_list);
607607 INIT_LIST_HEAD(&param_list->extra_response_list);
drivers/target/iscsi/iscsi_target_util.c+2−0
@@ -400,6 +400,8 @@ struct iscsi_cmd *iscsit_find_cmd_from_itt_or_dump( · 399 unmodified lines
400400
401401 spin_lock_bh(&conn->cmd_lock);
402402 list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
403+ if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT)
404+ continue;
403405 if (cmd->init_task_tag == init_task_tag) {
404406 spin_unlock_bh(&conn->cmd_lock);
405407 return cmd;
drivers/target/target_core_configfs.c+1−1
@@ -2363,7 +2363,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_support_##_name(\ · 2362 unmodified lines
23632363 pr_err("Invalid value '%ld', must be '0' or '1'\n", tmp); \
23642364 return -EINVAL; \
23652365 } \
2366− if (!tmp) \
2366+ if (tmp) \
23672367 t->_var |= _bit; \
23682368 else \
23692369 t->_var &= ~_bit; \
drivers/target/target_core_spc.c+1−1
@@ -664,7 +664,7 @@ spc_emulate_evpd_b3(struct se_cmd *cmd, unsigned char *buf) · 663 unmodified lines
664664 buf[0] = dev->transport->get_device_type(dev);
665665 buf[3] = 0x0c;
666666 put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[8]);
667− put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[12]);
667+ put_unaligned_be32(dev->t10_alua.lba_map_segment_multiplier, &buf[12]);
668668
669669 return 0;
670670 }
drivers/usb/host/ehci-hcd.c+0−2
@@ -965,8 +965,6 @@ rescan: · 964 unmodified lines
965965 }
966966
967967 qh->exception = 1;
968− if (ehci->rh_state < EHCI_RH_RUNNING)
969− qh->qh_state = QH_STATE_IDLE;
970968 switch (qh->qh_state) {
971969 case QH_STATE_LINKED:
972970 WARN_ON(!list_empty(&qh->qtd_list));
drivers/usb/storage/unusual_devs.h+32−0
@@ -101,6 +101,12 @@ UNUSUAL_DEV( 0x03f0, 0x4002, 0x0001, 0x0001, · 100 unmodified lines
101101 "PhotoSmart R707",
102102 USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_FIX_CAPACITY),
103103
104+UNUSUAL_DEV( 0x03f3, 0x0001, 0x0000, 0x9999,
105+ "Adaptec",
106+ "USBConnect 2000",
107+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
108+ US_FL_SCM_MULT_TARG ),
109+
104110 /* Reported by Sebastian Kapfer <sebastian_kapfer@gmx.net>
105111 * and Olaf Hering <olh@suse.de> (different bcd's, same vendor/product)
106112 * for USB floppies that need the SINGLE_LUN enforcement.
@@ -1125,6 +1131,18 @@ UNUSUAL_DEV( 0x0851, 0x1543, 0x0200, 0x0200, · 1018 unmodified lines
11251131 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
11261132 US_FL_NOT_LOCKABLE),
11271133
1134+UNUSUAL_DEV( 0x085a, 0x0026, 0x0100, 0x0133,
1135+ "Xircom",
1136+ "PortGear USB-SCSI (Mac USB Dock)",
1137+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
1138+ US_FL_SCM_MULT_TARG ),
1139+
1140+UNUSUAL_DEV( 0x085a, 0x0028, 0x0100, 0x0133,
1141+ "Xircom",
1142+ "PortGear USB to SCSI Converter",
1143+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
1144+ US_FL_SCM_MULT_TARG ),
1145+
11281146 /* Submitted by Jan De Luyck <lkml@kcore.org> */
11291147 UNUSUAL_DEV( 0x08bd, 0x1100, 0x0000, 0x0000,
11301148 "CITIZEN",
@@ -1964,6 +1982,14 @@ UNUSUAL_DEV( 0x152d, 0x2329, 0x0100, 0x0100, · 833 unmodified lines
19641982 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
19651983 US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ),
19661984
1985+/* Entrega Technologies U1-SC25 (later Xircom PortGear PGSCSI)
1986+ * and Mac USB Dock USB-SCSI */
1987+UNUSUAL_DEV( 0x1645, 0x0007, 0x0100, 0x0133,
1988+ "Entrega Technologies",
1989+ "USB to SCSI Converter",
1990+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
1991+ US_FL_SCM_MULT_TARG ),
1992+
19671993 /* Reported by Robert Schedel <r.schedel@yahoo.de>
19681994 * Note: this is a 'super top' device like the above 14cd/6600 device */
19691995 UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201,
@@ -1986,6 +2012,12 @@ UNUSUAL_DEV( 0x177f, 0x0400, 0x0000, 0x0000, · 16 unmodified lines
19862012 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
19872013 US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ),
19882014
2015+UNUSUAL_DEV( 0x1822, 0x0001, 0x0000, 0x9999,
2016+ "Ariston Technologies",
2017+ "iConnect USB to SCSI adapter",
2018+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
2019+ US_FL_SCM_MULT_TARG ),
2020+
19892021 /* Reported by Hans de Goede <hdegoede@redhat.com>
19902022 * These Appotech controllers are found in Picture Frames, they provide a
19912023 * (buggy) emulation of a cdrom drive which contains the windows software
fs/btrfs/btrfs_inode.h+11−2
@@ -234,8 +234,17 @@ static inline int btrfs_inode_in_log(struct inode *inode, u64 generation) · 233 unmodified lines
234234 BTRFS_I(inode)->last_sub_trans <=
235235 BTRFS_I(inode)->last_log_commit &&
236236 BTRFS_I(inode)->last_sub_trans <=
237− BTRFS_I(inode)->root->last_log_commit)
238− return 1;
237+ BTRFS_I(inode)->root->last_log_commit) {
238+ /*
239+ * After a ranged fsync we might have left some extent maps
240+ * (that fall outside the fsync's range). So return false
241+ * here if the list isn't empty, to make sure btrfs_log_inode()
242+ * will be called and process those extent maps.
243+ */
244+ smp_mb();
245+ if (list_empty(&BTRFS_I(inode)->extent_tree.modified_extents))
246+ return 1;
247+ }
239248 return 0;
240249 }
241250
fs/btrfs/tree-log.c+2−12
@@ -4093,18 +4093,8 @@ log_extents: · 4092 unmodified lines
40934093 }
40944094 }
40954095
4096− write_lock(&em_tree->lock);
4097− /*
4098− * If we're doing a ranged fsync and there are still modified extents
4099− * in the list, we must run on the next fsync call as it might cover
4100− * those extents (a full fsync or an fsync for other range).
4101− */
4102− if (list_empty(&em_tree->modified_extents)) {
4103− BTRFS_I(inode)->logged_trans = trans->transid;
4104− BTRFS_I(inode)->last_log_commit =
4105− BTRFS_I(inode)->last_sub_trans;
4106− }
4107− write_unlock(&em_tree->lock);
4096+ BTRFS_I(inode)->logged_trans = trans->transid;
4097+ BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->last_sub_trans;
41084098 out_unlock:
41094099 if (unlikely(err))
41104100 btrfs_put_logged_extents(&logged_list);
fs/btrfs/volumes.c+6−7
@@ -529,12 +529,12 @@ static noinline int device_list_add(const char *path, · 528 unmodified lines
529529 */
530530
531531 /*
532− * As of now don't allow update to btrfs_fs_device through
533− * the btrfs dev scan cli, after FS has been mounted.
532+ * For now, we do allow update to btrfs_fs_device through the
533+ * btrfs dev scan cli after FS has been mounted. We're still
534+ * tracking a problem where systems fail mount by subvolume id
535+ * when we reject replacement on a mounted FS.
534536 */
535− if (fs_devices->opened) {
536− return -EBUSY;
537− } else {
537+ if (!fs_devices->opened && found_transid < device->generation) {
538538 /*
539539 * That is if the FS is _not_ mounted and if you
540540 * are here, that means there is more than one
@@ -542,8 +542,7 @@ static noinline int device_list_add(const char *path, · 1 unmodified line
542542 * with larger generation number or the last-in if
543543 * generation are equal.
544544 */
545− if (found_transid < device->generation)
546− return -EEXIST;
545+ return -EEXIST;
547546 }
548547
549548 name = rcu_string_strdup(path, GFP_NOFS);
fs/cifs/cifsfs.h+1−1
@@ -136,5 +136,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); · 135 unmodified lines
136136 extern const struct export_operations cifs_export_ops;
137137 #endif /* CONFIG_CIFS_NFSD_EXPORT */
138138
139−#define CIFS_VERSION "2.04"
139+#define CIFS_VERSION "2.05"
140140 #endif /* _CIFSFS_H */
fs/cifs/connect.c+19−0
@@ -837,6 +837,7 @@ cifs_demultiplex_thread(void *p) · 836 unmodified lines
837837 struct TCP_Server_Info *server = p;
838838 unsigned int pdu_length;
839839 char *buf = NULL;
840+ struct task_struct *task_to_wake = NULL;
840841 struct mid_q_entry *mid_entry;
841842
842843 current->flags |= PF_MEMALLOC;
@@ -927,7 +928,19 @@ cifs_demultiplex_thread(void *p) · 84 unmodified lines
927928 if (server->smallbuf) /* no sense logging a debug message if NULL */
928929 cifs_small_buf_release(server->smallbuf);
929930
931+ task_to_wake = xchg(&server->tsk, NULL);
930932 clean_demultiplex_info(server);
933+
934+ /* if server->tsk was NULL then wait for a signal before exiting */
935+ if (!task_to_wake) {
936+ set_current_state(TASK_INTERRUPTIBLE);
937+ while (!signal_pending(current)) {
938+ schedule();
939+ set_current_state(TASK_INTERRUPTIBLE);
940+ }
941+ set_current_state(TASK_RUNNING);
942+ }
943+
931944 module_put_and_exit(0);
932945 }
933946
@@ -2050,6 +2063,8 @@ cifs_find_tcp_session(struct smb_vol *vol) · 1116 unmodified lines
20502063 static void
20512064 cifs_put_tcp_session(struct TCP_Server_Info *server)
20522065 {
2066+ struct task_struct *task;
2067+
20532068 spin_lock(&cifs_tcp_ses_lock);
20542069 if (--server->srv_count > 0) {
20552070 spin_unlock(&cifs_tcp_ses_lock);
@@ -2073,6 +2088,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server) · 17 unmodified lines
20732088 kfree(server->session_key.response);
20742089 server->session_key.response = NULL;
20752090 server->session_key.len = 0;
2091+
2092+ task = xchg(&server->tsk, NULL);
2093+ if (task)
2094+ force_sig(SIGKILL, task);
20762095 }
20772096
20782097 static struct TCP_Server_Info *
fs/cifs/link.c+9−3
@@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon, · 212 unmodified lines
213213 if (rc)
214214 goto out;
215215
216− rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb,
217− fromName, buf, &bytes_written);
216+ if (tcon->ses->server->ops->create_mf_symlink)
217+ rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon,
218+ cifs_sb, fromName, buf, &bytes_written);
219+ else
220+ rc = -EOPNOTSUPP;
221+
218222 if (rc)
219223 goto out;
220224
@@ -339,9 +343,11 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, · 118 unmodified lines
339343 if (rc)
340344 return rc;
341345
342− if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE))
346+ if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) {
347+ rc = -ENOENT;
343348 /* it's not a symlink */
344349 goto out;
350+ }
345351
346352 io_parms.netfid = fid.netfid;
347353 io_parms.pid = current->tgid;
fs/cifs/netmisc.c+16−4
@@ -925,11 +925,23 @@ cifs_NTtimeToUnix(__le64 ntutc) · 924 unmodified lines
925925 /* BB what about the timezone? BB */
926926
927927 /* Subtract the NTFS time offset, then convert to 1s intervals. */
928− u64 t;
928+ s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;
929+
930+ /*
931+ * Unfortunately can not use normal 64 bit division on 32 bit arch, but
932+ * the alternative, do_div, does not work with negative numbers so have
933+ * to special case them
934+ */
935+ if (t < 0) {
936+ t = -t;
937+ ts.tv_nsec = (long)(do_div(t, 10000000) * 100);
938+ ts.tv_nsec = -ts.tv_nsec;
939+ ts.tv_sec = -t;
940+ } else {
941+ ts.tv_nsec = (long)do_div(t, 10000000) * 100;
942+ ts.tv_sec = t;
943+ }
929944
930− t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;
931− ts.tv_nsec = do_div(t, 10000000) * 100;
932− ts.tv_sec = t;
933945 return ts;
934946 }
935947
fs/cifs/sess.c+0−17
@@ -745,14 +745,6 @@ out: · 744 unmodified lines
745745 sess_free_buffer(sess_data);
746746 }
747747
748−#else
749−
750−static void
751−sess_auth_lanman(struct sess_data *sess_data)
752−{
753− sess_data->result = -EOPNOTSUPP;
754− sess_data->func = NULL;
755−}
756748 #endif
757749
758750 static void
@@ -1103,15 +1095,6 @@ out: · 344 unmodified lines
11031095 ses->auth_key.response = NULL;
11041096 }
11051097
1106−#else
1107−
1108−static void
1109−sess_auth_kerberos(struct sess_data *sess_data)
1110−{
1111− cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n");
1112− sess_data->result = -ENOSYS;
1113− sess_data->func = NULL;
1114−}
11151098 #endif /* ! CONFIG_CIFS_UPCALL */
11161099
11171100 /*
fs/gfs2/bmap.c+5−4
@@ -359,7 +359,7 @@ static inline void release_metapath(struct metapath *mp) · 358 unmodified lines
359359 * Returns: The length of the extent (minimum of one block)
360360 */
361361
362−static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, unsigned limit, int *eob)
362+static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, size_t limit, int *eob)
363363 {
364364 const __be64 *end = (start + len);
365365 const __be64 *first = ptr;
@@ -449,7 +449,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, · 83 unmodified lines
449449 struct buffer_head *bh_map, struct metapath *mp,
450450 const unsigned int sheight,
451451 const unsigned int height,
452− const unsigned int maxlen)
452+ const size_t maxlen)
453453 {
454454 struct gfs2_inode *ip = GFS2_I(inode);
455455 struct gfs2_sbd *sdp = GFS2_SB(inode);
@@ -483,7 +483,8 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, · 27 unmodified lines
483483 } else {
484484 /* Need to allocate indirect blocks */
485485 ptrs_per_blk = height > 1 ? sdp->sd_inptrs : sdp->sd_diptrs;
486− dblks = min(maxlen, ptrs_per_blk - mp->mp_list[end_of_metadata]);
486+ dblks = min(maxlen, (size_t)(ptrs_per_blk -
487+ mp->mp_list[end_of_metadata]));
487488 if (height == ip->i_height) {
488489 /* Writing into existing tree, extend tree down */
489490 iblks = height - sheight;
@@ -605,7 +606,7 @@ int gfs2_block_map(struct inode *inode, sector_t lblock, · 115 unmodified lines
605606 struct gfs2_inode *ip = GFS2_I(inode);
606607 struct gfs2_sbd *sdp = GFS2_SB(inode);
607608 unsigned int bsize = sdp->sd_sb.sb_bsize;
608− const unsigned int maxlen = bh_map->b_size >> inode->i_blkbits;
609+ const size_t maxlen = bh_map->b_size >> inode->i_blkbits;
609610 const u64 *arr = sdp->sd_heightsize;
610611 __be64 *ptr;
611612 u64 size;
fs/gfs2/file.c+12−3
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/dlm.h>
2727 #include <linux/dlm_plock.h>
2828 #include <linux/aio.h>
29+#include <linux/delay.h>
2930
3031 #include "gfs2.h"
3132 #include "incore.h"
@@ -979,9 +980,10 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) · 947 unmodified lines
979980 unsigned int state;
980981 int flags;
981982 int error = 0;
983+ int sleeptime;
982984
983985 state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
984− flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY) | GL_EXACT;
986+ flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY_1CB) | GL_EXACT;
985987
986988 mutex_lock(&fp->f_fl_mutex);
987989
@@ -1001,7 +1003,14 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) · 13 unmodified lines
10011003 gfs2_holder_init(gl, state, flags, fl_gh);
10021004 gfs2_glock_put(gl);
10031005 }
1004− error = gfs2_glock_nq(fl_gh);
1006+ for (sleeptime = 1; sleeptime <= 4; sleeptime <<= 1) {
1007+ error = gfs2_glock_nq(fl_gh);
1008+ if (error != GLR_TRYFAILED)
1009+ break;
1010+ fl_gh->gh_flags = LM_FLAG_TRY | GL_EXACT;
1011+ fl_gh->gh_error = 0;
1012+ msleep(sleeptime);
1013+ }
10051014 if (error) {
10061015 gfs2_holder_uninit(fl_gh);
10071016 if (error == GLR_TRYFAILED)
@@ -1024,7 +1033,7 @@ static void do_unflock(struct file *file, struct file_lock *fl) · 16 unmodified lines
10241033 mutex_lock(&fp->f_fl_mutex);
10251034 flock_lock_file_wait(file, fl);
10261035 if (fl_gh->gh_gl) {
1027− gfs2_glock_dq_wait(fl_gh);
1036+ gfs2_glock_dq(fl_gh);
10281037 gfs2_holder_uninit(fl_gh);
10291038 }
10301039 mutex_unlock(&fp->f_fl_mutex);
fs/gfs2/incore.h+5−2
@@ -262,6 +262,9 @@ struct gfs2_holder { · 261 unmodified lines
262262 unsigned long gh_ip;
263263 };
264264
265+/* Number of quota types we support */
266+#define GFS2_MAXQUOTAS 2
267+
265268 /* Resource group multi-block reservation, in order of appearance:
266269
267270 Step 1. Function prepares to write, allocates a mb, sets the size hint.
@@ -282,8 +285,8 @@ struct gfs2_blkreserv { · 14 unmodified lines
282285 u64 rs_inum; /* Inode number for reservation */
283286
284287 /* ancillary quota stuff */
285− struct gfs2_quota_data *rs_qa_qd[2 * MAXQUOTAS];
286− struct gfs2_holder rs_qa_qd_ghs[2 * MAXQUOTAS];
288+ struct gfs2_quota_data *rs_qa_qd[2 * GFS2_MAXQUOTAS];
289+ struct gfs2_holder rs_qa_qd_ghs[2 * GFS2_MAXQUOTAS];
287290 unsigned int rs_qa_qd_num;
288291 };
289292
fs/gfs2/inode.c+6−3
@@ -626,8 +626,10 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, · 625 unmodified lines
626626 if (!IS_ERR(inode)) {
627627 d = d_splice_alias(inode, dentry);
628628 error = PTR_ERR(d);
629− if (IS_ERR(d))
629+ if (IS_ERR(d)) {
630+ inode = ERR_CAST(d);
630631 goto fail_gunlock;
632+ }
631633 error = 0;
632634 if (file) {
633635 if (S_ISREG(inode->i_mode)) {
@@ -840,8 +842,10 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, · 206 unmodified lines
840842 int error;
841843
842844 inode = gfs2_lookupi(dir, &dentry->d_name, 0);
843− if (!inode)
845+ if (inode == NULL) {
846+ d_add(dentry, NULL);
844847 return NULL;
848+ }
845849 if (IS_ERR(inode))
846850 return ERR_CAST(inode);
847851
@@ -854,7 +858,6 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, · 6 unmodified lines
854858
855859 d = d_splice_alias(inode, dentry);
856860 if (IS_ERR(d)) {
857− iput(inode);
858861 gfs2_glock_dq_uninit(&gh);
859862 return d;
860863 }
fs/gfs2/super.c+10−10
@@ -1294,7 +1294,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 1293 unmodified lines
12941294 int val;
12951295
12961296 if (is_ancestor(root, sdp->sd_master_dir))
1297− seq_printf(s, ",meta");
1297+ seq_puts(s, ",meta");
12981298 if (args->ar_lockproto[0])
12991299 seq_printf(s, ",lockproto=%s", args->ar_lockproto);
13001300 if (args->ar_locktable[0])
@@ -1302,13 +1302,13 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 1 unmodified line
13021302 if (args->ar_hostdata[0])
13031303 seq_printf(s, ",hostdata=%s", args->ar_hostdata);
13041304 if (args->ar_spectator)
1305− seq_printf(s, ",spectator");
1305+ seq_puts(s, ",spectator");
13061306 if (args->ar_localflocks)
1307− seq_printf(s, ",localflocks");
1307+ seq_puts(s, ",localflocks");
13081308 if (args->ar_debug)
1309− seq_printf(s, ",debug");
1309+ seq_puts(s, ",debug");
13101310 if (args->ar_posix_acl)
1311− seq_printf(s, ",acl");
1311+ seq_puts(s, ",acl");
13121312 if (args->ar_quota != GFS2_QUOTA_DEFAULT) {
13131313 char *state;
13141314 switch (args->ar_quota) {
@@ -1328,7 +1328,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 13 unmodified lines
13281328 seq_printf(s, ",quota=%s", state);
13291329 }
13301330 if (args->ar_suiddir)
1331− seq_printf(s, ",suiddir");
1331+ seq_puts(s, ",suiddir");
13321332 if (args->ar_data != GFS2_DATA_DEFAULT) {
13331333 char *state;
13341334 switch (args->ar_data) {
@@ -1345,7 +1345,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 10 unmodified lines
13451345 seq_printf(s, ",data=%s", state);
13461346 }
13471347 if (args->ar_discard)
1348− seq_printf(s, ",discard");
1348+ seq_puts(s, ",discard");
13491349 val = sdp->sd_tune.gt_logd_secs;
13501350 if (val != 30)
13511351 seq_printf(s, ",commit=%d", val);
@@ -1376,11 +1376,11 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) · 24 unmodified lines
13761376 seq_printf(s, ",errors=%s", state);
13771377 }
13781378 if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags))
1379− seq_printf(s, ",nobarrier");
1379+ seq_puts(s, ",nobarrier");
13801380 if (test_bit(SDF_DEMOTE, &sdp->sd_flags))
1381− seq_printf(s, ",demote_interface_used");
1381+ seq_puts(s, ",demote_interface_used");
13821382 if (args->ar_rgrplvb)
1383− seq_printf(s, ",rgrplvb");
1383+ seq_puts(s, ",rgrplvb");
13841384 return 0;
13851385 }
13861386
fs/namei.c+18−21
@@ -1674,14 +1674,13 @@ EXPORT_SYMBOL(full_name_hash); · 1673 unmodified lines
16741674
16751675 /*
16761676 * Calculate the length and hash of the path component, and
1677− * fill in the qstr. return the "len" as the result.
1677+ * return the "hash_len" as the result.
16781678 */
1679−static inline unsigned long hash_name(const char *name, struct qstr *res)
1679+static inline u64 hash_name(const char *name)
16801680 {
16811681 unsigned long a, b, adata, bdata, mask, hash, len;
16821682 const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
16831683
1684− res->name = name;
16851684 hash = a = 0;
16861685 len = -sizeof(unsigned long);
16871686 do {
@@ -1698,9 +1697,7 @@ static inline unsigned long hash_name(const char *name, struct qstr *res) · 10 unmodified lines
16981697
16991698 hash += a & zero_bytemask(mask);
17001699 len += find_zero(mask);
1701− res->hash_len = hashlen_create(fold_hash(hash), len);
1702−
1703− return len;
1700+ return hashlen_create(fold_hash(hash), len);
17041701 }
17051702
17061703 #else
@@ -1718,20 +1715,18 @@ EXPORT_SYMBOL(full_name_hash); · 11 unmodified lines
17181715 * We know there's a real path component here of at least
17191716 * one character.
17201717 */
1721−static inline long hash_name(const char *name, struct qstr *res)
1718+static inline u64 hash_name(const char *name)
17221719 {
17231720 unsigned long hash = init_name_hash();
17241721 unsigned long len = 0, c;
17251722
1726− res->name = name;
17271723 c = (unsigned char)*name;
17281724 do {
17291725 len++;
17301726 hash = partial_name_hash(c, hash);
17311727 c = (unsigned char)name[len];
17321728 } while (c && c != '/');
1733− res->hash_len = hashlen_create(end_name_hash(hash), len);
1734− return len;
1729+ return hashlen_create(end_name_hash(hash), len);
17351730 }
17361731
17371732 #endif
@@ -1756,18 +1751,17 @@ static int link_path_walk(const char *name, struct nameidata *nd) · 18 unmodified lines
17561751
17571752 /* At this point we know we have a real path component. */
17581753 for(;;) {
1759− struct qstr this;
1760− long len;
1754+ u64 hash_len;
17611755 int type;
17621756
17631757 err = may_lookup(nd);
17641758 if (err)
17651759 break;
17661760
1767− len = hash_name(name, &this);
1761+ hash_len = hash_name(name);
17681762
17691763 type = LAST_NORM;
1770− if (name[0] == '.') switch (len) {
1764+ if (name[0] == '.') switch (hashlen_len(hash_len)) {
17711765 case 2:
17721766 if (name[1] == '.') {
17731767 type = LAST_DOTDOT;
@@ -1781,29 +1775,32 @@ static int link_path_walk(const char *name, struct nameidata *nd) · 7 unmodified lines
17811775 struct dentry *parent = nd->path.dentry;
17821776 nd->flags &= ~LOOKUP_JUMPED;
17831777 if (unlikely(parent->d_flags & DCACHE_OP_HASH)) {
1778+ struct qstr this = { { .hash_len = hash_len }, .name = name };
17841779 err = parent->d_op->d_hash(parent, &this);
17851780 if (err < 0)
17861781 break;
1782+ hash_len = this.hash_len;
1783+ name = this.name;
17871784 }
17881785 }
17891786
1790− nd->last = this;
1787+ nd->last.hash_len = hash_len;
1788+ nd->last.name = name;
17911789 nd->last_type = type;
17921790
1793− if (!name[len])
1791+ name += hashlen_len(hash_len);
1792+ if (!*name)
17941793 return 0;
17951794 /*
17961795 * If it wasn't NUL, we know it was '/'. Skip that
17971796 * slash, and continue until no more slashes.
17981797 */
17991798 do {
1800− len++;
1801− } while (unlikely(name[len] == '/'));
1802− if (!name[len])
1799+ name++;
1800+ } while (unlikely(*name == '/'));
1801+ if (!*name)
18031802 return 0;
18041803
1805− name += len;
1806−
18071804 err = walk_component(nd, &next, LOOKUP_FOLLOW);
18081805 if (err < 0)
18091806 return err;
fs/nfs/nfs4client.c+20−18
@@ -482,6 +482,16 @@ int nfs40_walk_client_list(struct nfs_client *new, · 481 unmodified lines
482482
483483 spin_lock(&nn->nfs_client_lock);
484484 list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {
485+
486+ if (pos->rpc_ops != new->rpc_ops)
487+ continue;
488+
489+ if (pos->cl_proto != new->cl_proto)
490+ continue;
491+
492+ if (pos->cl_minorversion != new->cl_minorversion)
493+ continue;
494+
485495 /* If "pos" isn't marked ready, we can't trust the
486496 * remaining fields in "pos" */
487497 if (pos->cl_cons_state > NFS_CS_READY) {
@@ -501,15 +511,6 @@ int nfs40_walk_client_list(struct nfs_client *new, · 13 unmodified lines
501511 if (pos->cl_cons_state != NFS_CS_READY)
502512 continue;
503513
504− if (pos->rpc_ops != new->rpc_ops)
505− continue;
506−
507− if (pos->cl_proto != new->cl_proto)
508− continue;
509−
510− if (pos->cl_minorversion != new->cl_minorversion)
511− continue;
512−
513514 if (pos->cl_clientid != new->cl_clientid)
514515 continue;
515516
@@ -622,6 +623,16 @@ int nfs41_walk_client_list(struct nfs_client *new, · 106 unmodified lines
622623
623624 spin_lock(&nn->nfs_client_lock);
624625 list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {
626+
627+ if (pos->rpc_ops != new->rpc_ops)
628+ continue;
629+
630+ if (pos->cl_proto != new->cl_proto)
631+ continue;
632+
633+ if (pos->cl_minorversion != new->cl_minorversion)
634+ continue;
635+
625636 /* If "pos" isn't marked ready, we can't trust the
626637 * remaining fields in "pos", especially the client
627638 * ID and serverowner fields. Wait for CREATE_SESSION
@@ -647,15 +658,6 @@ int nfs41_walk_client_list(struct nfs_client *new, · 19 unmodified lines
647658 if (pos->cl_cons_state != NFS_CS_READY)
648659 continue;
649660
650− if (pos->rpc_ops != new->rpc_ops)
651− continue;
652−
653− if (pos->cl_proto != new->cl_proto)
654− continue;
655−
656− if (pos->cl_minorversion != new->cl_minorversion)
657− continue;
658−
659661 if (!nfs4_match_clientids(pos, new))
660662 continue;
661663
fs/nfs/nfs4proc.c+22−18
@@ -2226,9 +2226,13 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, · 2225 unmodified lines
22262226 ret = _nfs4_proc_open(opendata);
22272227 if (ret != 0) {
22282228 if (ret == -ENOENT) {
2229− d_drop(opendata->dentry);
2230− d_add(opendata->dentry, NULL);
2231− nfs_set_verifier(opendata->dentry,
2229+ dentry = opendata->dentry;
2230+ if (dentry->d_inode)
2231+ d_delete(dentry);
2232+ else if (d_unhashed(dentry))
2233+ d_add(dentry, NULL);
2234+
2235+ nfs_set_verifier(dentry,
22322236 nfs_save_change_attribute(opendata->dir->d_inode));
22332237 }
22342238 goto out;
@@ -2614,23 +2618,23 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) · 379 unmodified lines
26142618 is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags);
26152619 is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags);
26162620 is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags);
2617− /* Calculate the current open share mode */
2618− calldata->arg.fmode = 0;
2619− if (is_rdonly || is_rdwr)
2620− calldata->arg.fmode |= FMODE_READ;
2621− if (is_wronly || is_rdwr)
2622− calldata->arg.fmode |= FMODE_WRITE;
26232621 /* Calculate the change in open mode */
2622+ calldata->arg.fmode = 0;
26242623 if (state->n_rdwr == 0) {
2625− if (state->n_rdonly == 0) {
2626− call_close |= is_rdonly || is_rdwr;
2627− calldata->arg.fmode &= ~FMODE_READ;
2628− }
2629− if (state->n_wronly == 0) {
2630− call_close |= is_wronly || is_rdwr;
2631− calldata->arg.fmode &= ~FMODE_WRITE;
2632− }
2633− }
2624+ if (state->n_rdonly == 0)
2625+ call_close |= is_rdonly;
2626+ else if (is_rdonly)
2627+ calldata->arg.fmode |= FMODE_READ;
2628+ if (state->n_wronly == 0)
2629+ call_close |= is_wronly;
2630+ else if (is_wronly)
2631+ calldata->arg.fmode |= FMODE_WRITE;
2632+ } else if (is_rdwr)
2633+ calldata->arg.fmode |= FMODE_READ|FMODE_WRITE;
2634+
2635+ if (calldata->arg.fmode == 0)
2636+ call_close |= is_rdwr;
2637+
26342638 if (!nfs4_valid_open_stateid(state))
26352639 call_close = 0;
26362640 spin_unlock(&state->owner->so_lock);
include/acpi/acpi_bus.h+1−3
@@ -205,10 +205,9 @@ struct acpi_device_flags { · 204 unmodified lines
205205 u32 match_driver:1;
206206 u32 initialized:1;
207207 u32 visited:1;
208− u32 no_hotplug:1;
209208 u32 hotplug_notify:1;
210209 u32 is_dock_station:1;
211− u32 reserved:22;
210+ u32 reserved:23;
212211 };
213212
214213 /* File System */
@@ -412,7 +411,6 @@ void acpi_bus_private_data_handler(acpi_handle, void *); · 197 unmodified lines
412411 int acpi_bus_get_private_data(acpi_handle, void **);
413412 int acpi_bus_attach_private_data(acpi_handle, void *);
414413 void acpi_bus_detach_private_data(acpi_handle);
415−void acpi_bus_no_hotplug(acpi_handle handle);
416414 extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
417415 extern int register_acpi_notifier(struct notifier_block *);
418416 extern int unregister_acpi_notifier(struct notifier_block *);
include/crypto/drbg.h+13−0
@@ -162,12 +162,25 @@ static inline size_t drbg_max_request_bytes(struct drbg_state *drbg) · 161 unmodified lines
162162
163163 static inline size_t drbg_max_addtl(struct drbg_state *drbg)
164164 {
165+#if (__BITS_PER_LONG == 32)
166+ /*
167+ * SP800-90A allows smaller maximum numbers to be returned -- we
168+ * return SIZE_MAX - 1 to allow the verification of the enforcement
169+ * of this value in drbg_healthcheck_sanity.
170+ */
171+ return (SIZE_MAX - 1);
172+#else
165173 return (1UL<<(drbg->core->max_addtllen));
174+#endif
166175 }
167176
168177 static inline size_t drbg_max_requests(struct drbg_state *drbg)
169178 {
179+#if (__BITS_PER_LONG == 32)
180+ return SIZE_MAX;
181+#else
170182 return (1UL<<(drbg->core->max_req));
183+#endif
171184 }
172185
173186 /*
include/linux/iio/trigger.h+3−1
@@ -84,10 +84,12 @@ static inline void iio_trigger_put(struct iio_trigger *trig) · 83 unmodified lines
8484 put_device(&trig->dev);
8585 }
8686
87−static inline void iio_trigger_get(struct iio_trigger *trig)
87+static inline struct iio_trigger *iio_trigger_get(struct iio_trigger *trig)
8888 {
8989 get_device(&trig->dev);
9090 __module_get(trig->ops->owner);
91+
92+ return trig;
9193 }
9294
9395 /**
include/linux/pci.h+6−0
@@ -303,6 +303,7 @@ struct pci_dev { · 302 unmodified lines
303303 D3cold, not set for devices
304304 powered on/off by the
305305 corresponding bridge */
306+ unsigned int ignore_hotplug:1; /* Ignore hotplug events */
306307 unsigned int d3_delay; /* D3->D0 transition time in ms */
307308 unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */
308309
@@ -1021,6 +1022,11 @@ bool pci_dev_run_wake(struct pci_dev *dev); · 712 unmodified lines
10211022 bool pci_check_pme_status(struct pci_dev *dev);
10221023 void pci_pme_wakeup_bus(struct pci_bus *bus);
10231024
1025+static inline void pci_ignore_hotplug(struct pci_dev *dev)
1026+{
1027+ dev->ignore_hotplug = 1;
1028+}
1029+
10241030 static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
10251031 bool enable)
10261032 {
include/linux/vga_switcheroo.h+2−0
@@ -64,6 +64,7 @@ int vga_switcheroo_get_client_state(struct pci_dev *dev); · 63 unmodified lines
6464 void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic);
6565
6666 int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain);
67+void vga_switcheroo_fini_domain_pm_ops(struct device *dev);
6768 int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain);
6869 #else
6970
@@ -82,6 +83,7 @@ static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return · 12 unmodified lines
8283 static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {}
8384
8485 static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
86+static inline void vga_switcheroo_fini_domain_pm_ops(struct device *dev) {}
8587 static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
8688
8789 #endif
include/linux/vgaarb.h+0−2
@@ -182,7 +182,6 @@ extern void vga_put(struct pci_dev *pdev, unsigned int rsrc); · 181 unmodified lines
182182 * vga_get()...
183183 */
184184
185−#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
186185 #ifdef CONFIG_VGA_ARB
187186 extern struct pci_dev *vga_default_device(void);
188187 extern void vga_set_default_device(struct pci_dev *pdev);
@@ -190,7 +189,6 @@ extern void vga_set_default_device(struct pci_dev *pdev); · 1 unmodified line
190189 static inline struct pci_dev *vga_default_device(void) { return NULL; };
191190 static inline void vga_set_default_device(struct pci_dev *pdev) { };
192191 #endif
193−#endif
194192
195193 /**
196194 * vga_conflicts
include/scsi/scsi_tcq.h+1−1
@@ -68,7 +68,7 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) · 67 unmodified lines
6868 return;
6969
7070 if (!shost_use_blk_mq(sdev->host) &&
71− blk_queue_tagged(sdev->request_queue))
71+ !blk_queue_tagged(sdev->request_queue))
7272 blk_queue_init_tags(sdev->request_queue, depth,
7373 sdev->host->bqt);
7474
init/do_mounts.c+6−6
@@ -539,6 +539,12 @@ void __init prepare_namespace(void) · 538 unmodified lines
539539 {
540540 int is_floppy;
541541
542+ if (root_delay) {
543+ printk(KERN_INFO "Waiting %d sec before mounting root device...\n",
544+ root_delay);
545+ ssleep(root_delay);
546+ }
547+
542548 /*
543549 * wait for the known devices to complete their probing
544550 *
@@ -565,12 +571,6 @@ void __init prepare_namespace(void) · 20 unmodified lines
565571 if (initrd_load())
566572 goto out;
567573
568− if (root_delay) {
569− pr_info("Waiting %d sec before mounting root device...\n",
570− root_delay);
571− ssleep(root_delay);
572− }
573−
574574 /* wait for any asynchronous scanning to complete */
575575 if ((ROOT_DEV == 0) && root_wait) {
576576 printk(KERN_INFO "Waiting for root device %s...\n",
kernel/events/core.c+10−0
@@ -1524,6 +1524,11 @@ retry: · 1523 unmodified lines
15241524 */
15251525 if (ctx->is_active) {
15261526 raw_spin_unlock_irq(&ctx->lock);
1527+ /*
1528+ * Reload the task pointer, it might have been changed by
1529+ * a concurrent perf_event_context_sched_out().
1530+ */
1531+ task = ctx->task;
15271532 goto retry;
15281533 }
15291534
@@ -1967,6 +1972,11 @@ retry: · 437 unmodified lines
19671972 */
19681973 if (ctx->is_active) {
19691974 raw_spin_unlock_irq(&ctx->lock);
1975+ /*
1976+ * Reload the task pointer, it might have been changed by
1977+ * a concurrent perf_event_context_sched_out().
1978+ */
1979+ task = ctx->task;
19701980 goto retry;
19711981 }
19721982
mm/dmapool.c+1−1
@@ -176,7 +176,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev, · 175 unmodified lines
176176 if (list_empty(&dev->dma_pools) &&
177177 device_create_file(dev, &dev_attr_pools)) {
178178 kfree(retval);
179− return NULL;
179+ retval = NULL;
180180 } else
181181 list_add(&retval->pools, &dev->dma_pools);
182182 mutex_unlock(&pools_lock);
sound/pci/hda/patch_sigmatel.c+12−5
@@ -566,8 +566,8 @@ static void stac_init_power_map(struct hda_codec *codec) · 565 unmodified lines
566566 if (snd_hda_jack_tbl_get(codec, nid))
567567 continue;
568568 if (def_conf == AC_JACK_PORT_COMPLEX &&
569− !(spec->vref_mute_led_nid == nid ||
570− is_jack_detectable(codec, nid))) {
569+ spec->vref_mute_led_nid != nid &&
570+ is_jack_detectable(codec, nid)) {
571571 snd_hda_jack_detect_enable_callback(codec, nid,
572572 STAC_PWR_EVENT,
573573 jack_update_power);
@@ -4276,11 +4276,18 @@ static int stac_parse_auto_config(struct hda_codec *codec) · 3702 unmodified lines
42764276 return err;
42774277 }
42784278
4279− stac_init_power_map(codec);
4280−
42814279 return 0;
42824280 }
42834281
4282+static int stac_build_controls(struct hda_codec *codec)
4283+{
4284+ int err = snd_hda_gen_build_controls(codec);
4285+
4286+ if (err < 0)
4287+ return err;
4288+ stac_init_power_map(codec);
4289+ return 0;
4290+}
42844291
42854292 static int stac_init(struct hda_codec *codec)
42864293 {
@@ -4392,7 +4399,7 @@ static int stac_suspend(struct hda_codec *codec) · 105 unmodified lines
43924399 #endif /* CONFIG_PM */
43934400
43944401 static const struct hda_codec_ops stac_patch_ops = {
4395− .build_controls = snd_hda_gen_build_controls,
4402+ .build_controls = stac_build_controls,
43964403 .build_pcms = snd_hda_gen_build_pcms,
43974404 .init = stac_init,
43984405 .free = stac_free,
sound/soc/codecs/cs4265.c+3−3
@@ -458,12 +458,12 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, · 457 unmodified lines
458458 if (params_width(params) == 16) {
459459 snd_soc_update_bits(codec, CS4265_DAC_CTL,
460460 CS4265_DAC_CTL_DIF, (1 << 5));
461− snd_soc_update_bits(codec, CS4265_ADC_CTL,
461+ snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
462462 CS4265_SPDIF_CTL2_DIF, (1 << 7));
463463 } else {
464464 snd_soc_update_bits(codec, CS4265_DAC_CTL,
465465 CS4265_DAC_CTL_DIF, (3 << 5));
466− snd_soc_update_bits(codec, CS4265_ADC_CTL,
466+ snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
467467 CS4265_SPDIF_CTL2_DIF, (1 << 7));
468468 }
469469 break;
@@ -472,7 +472,7 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, · 2 unmodified lines
472472 CS4265_DAC_CTL_DIF, 0);
473473 snd_soc_update_bits(codec, CS4265_ADC_CTL,
474474 CS4265_ADC_DIF, 0);
475− snd_soc_update_bits(codec, CS4265_ADC_CTL,
475+ snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
476476 CS4265_SPDIF_CTL2_DIF, (1 << 6));
477477
478478 break;
sound/soc/codecs/sta529.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver
55 *
66 * Copyright (C) 2012 ST Microelectronics
7− * Rajeev Kumar <rajeev-dlh.kumar@st.com>
7+ * Rajeev Kumar <rajeevkumar.linux@gmail.com>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
@@ -426,5 +426,5 @@ static struct i2c_driver sta529_i2c_driver = { · 415 unmodified lines
426426 module_i2c_driver(sta529_i2c_driver);
427427
428428 MODULE_DESCRIPTION("ASoC STA529 codec driver");
429−MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
429+MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
430430 MODULE_LICENSE("GPL");
sound/soc/codecs/tlv320aic31xx.c+39−12
@@ -189,46 +189,57 @@ static const struct aic31xx_rate_divs aic31xx_divs[] = { · 188 unmodified lines
189189 /* mclk rate pll: p j d dosr ndac mdac aors nadc madc */
190190 /* 8k rate */
191191 {12000000, 8000, 1, 8, 1920, 128, 48, 2, 128, 48, 2},
192+ {12000000, 8000, 1, 8, 1920, 128, 32, 3, 128, 32, 3},
192193 {24000000, 8000, 2, 8, 1920, 128, 48, 2, 128, 48, 2},
193194 {25000000, 8000, 2, 7, 8643, 128, 48, 2, 128, 48, 2},
194195 /* 11.025k rate */
195196 {12000000, 11025, 1, 7, 5264, 128, 32, 2, 128, 32, 2},
197+ {12000000, 11025, 1, 8, 4672, 128, 24, 3, 128, 24, 3},
196198 {24000000, 11025, 2, 7, 5264, 128, 32, 2, 128, 32, 2},
197199 {25000000, 11025, 2, 7, 2253, 128, 32, 2, 128, 32, 2},
198200 /* 16k rate */
199201 {12000000, 16000, 1, 8, 1920, 128, 24, 2, 128, 24, 2},
202+ {12000000, 16000, 1, 8, 1920, 128, 16, 3, 128, 16, 3},
200203 {24000000, 16000, 2, 8, 1920, 128, 24, 2, 128, 24, 2},
201204 {25000000, 16000, 2, 7, 8643, 128, 24, 2, 128, 24, 2},
202205 /* 22.05k rate */
203206 {12000000, 22050, 1, 7, 5264, 128, 16, 2, 128, 16, 2},
207+ {12000000, 22050, 1, 8, 4672, 128, 12, 3, 128, 12, 3},
204208 {24000000, 22050, 2, 7, 5264, 128, 16, 2, 128, 16, 2},
205209 {25000000, 22050, 2, 7, 2253, 128, 16, 2, 128, 16, 2},
206210 /* 32k rate */
207211 {12000000, 32000, 1, 8, 1920, 128, 12, 2, 128, 12, 2},
212+ {12000000, 32000, 1, 8, 1920, 128, 8, 3, 128, 8, 3},
208213 {24000000, 32000, 2, 8, 1920, 128, 12, 2, 128, 12, 2},
209214 {25000000, 32000, 2, 7, 8643, 128, 12, 2, 128, 12, 2},
210215 /* 44.1k rate */
211216 {12000000, 44100, 1, 7, 5264, 128, 8, 2, 128, 8, 2},
217+ {12000000, 44100, 1, 8, 4672, 128, 6, 3, 128, 6, 3},
212218 {24000000, 44100, 2, 7, 5264, 128, 8, 2, 128, 8, 2},
213219 {25000000, 44100, 2, 7, 2253, 128, 8, 2, 128, 8, 2},
214220 /* 48k rate */
215221 {12000000, 48000, 1, 8, 1920, 128, 8, 2, 128, 8, 2},
222+ {12000000, 48000, 1, 7, 6800, 96, 5, 4, 96, 5, 4},
216223 {24000000, 48000, 2, 8, 1920, 128, 8, 2, 128, 8, 2},
217224 {25000000, 48000, 2, 7, 8643, 128, 8, 2, 128, 8, 2},
218225 /* 88.2k rate */
219226 {12000000, 88200, 1, 7, 5264, 64, 8, 2, 64, 8, 2},
227+ {12000000, 88200, 1, 8, 4672, 64, 6, 3, 64, 6, 3},
220228 {24000000, 88200, 2, 7, 5264, 64, 8, 2, 64, 8, 2},
221229 {25000000, 88200, 2, 7, 2253, 64, 8, 2, 64, 8, 2},
222230 /* 96k rate */
223231 {12000000, 96000, 1, 8, 1920, 64, 8, 2, 64, 8, 2},
232+ {12000000, 96000, 1, 7, 6800, 48, 5, 4, 48, 5, 4},
224233 {24000000, 96000, 2, 8, 1920, 64, 8, 2, 64, 8, 2},
225234 {25000000, 96000, 2, 7, 8643, 64, 8, 2, 64, 8, 2},
226235 /* 176.4k rate */
227236 {12000000, 176400, 1, 7, 5264, 32, 8, 2, 32, 8, 2},
237+ {12000000, 176400, 1, 8, 4672, 32, 6, 3, 32, 6, 3},
228238 {24000000, 176400, 2, 7, 5264, 32, 8, 2, 32, 8, 2},
229239 {25000000, 176400, 2, 7, 2253, 32, 8, 2, 32, 8, 2},
230240 /* 192k rate */
231241 {12000000, 192000, 1, 8, 1920, 32, 8, 2, 32, 8, 2},
242+ {12000000, 192000, 1, 7, 6800, 24, 5, 4, 24, 5, 4},
232243 {24000000, 192000, 2, 8, 1920, 32, 8, 2, 32, 8, 2},
233244 {25000000, 192000, 2, 7, 8643, 32, 8, 2, 32, 8, 2},
234245 };
@@ -680,7 +691,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, · 445 unmodified lines
680691 struct snd_pcm_hw_params *params)
681692 {
682693 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
694+ int bclk_score = snd_soc_params_to_frame_size(params);
683695 int bclk_n = 0;
696+ int match = -1;
684697 int i;
685698
686699 /* 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, · 4 unmodified lines
691704
692705 for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) {
693706 if (aic31xx_divs[i].rate == params_rate(params) &&
694− aic31xx_divs[i].mclk == aic31xx->sysclk)
695− break;
707+ aic31xx_divs[i].mclk == aic31xx->sysclk) {
708+ int s = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) %
709+ snd_soc_params_to_frame_size(params);
710+ int bn = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) /
711+ snd_soc_params_to_frame_size(params);
712+ if (s < bclk_score && bn > 0) {
713+ match = i;
714+ bclk_n = bn;
715+ bclk_score = s;
716+ }
717+ }
696718 }
697719
698− if (i == ARRAY_SIZE(aic31xx_divs)) {
699− dev_err(codec->dev, "%s: Sampling rate %u not supported\n",
720+ if (match == -1) {
721+ dev_err(codec->dev,
722+ "%s: Sample rate (%u) and format not supported\n",
700723 __func__, params_rate(params));
724+ /* See bellow for details how fix this. */
701725 return -EINVAL;
702726 }
727+ if (bclk_score != 0) {
728+ dev_warn(codec->dev, "Can not produce exact bitclock");
729+ /* This is fine if using dsp format, but if using i2s
730+ there may be trouble. To fix the issue edit the
731+ aic31xx_divs table for your mclk and sample
732+ rate. Details can be found from:
733+ http://www.ti.com/lit/ds/symlink/tlv320aic3100.pdf
734+ Section: 5.6 CLOCK Generation and PLL
735+ */
736+ }
737+ i = match;
703738
704739 /* PLL configuration */
705740 snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK,
@@ -729,14 +764,6 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, · 23 unmodified lines
729764 snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr);
730765
731766 /* Bit clock divider configuration. */
732− bclk_n = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac)
733− / snd_soc_params_to_frame_size(params);
734− if (bclk_n == 0) {
735− dev_err(codec->dev, "%s: Not enough BLCK bandwidth\n",
736− __func__);
737− return -EINVAL;
738− }
739−
740767 snd_soc_update_bits(codec, AIC31XX_BCLKN,
741768 AIC31XX_PLL_MASK, bclk_n);
742769
sound/soc/davinci/davinci-mcasp.c+10−1
@@ -467,8 +467,17 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp, · 466 unmodified lines
467467 {
468468 u32 fmt;
469469 u32 tx_rotate = (word_length / 4) & 0x7;
470− u32 rx_rotate = (32 - word_length) / 4;
471470 u32 mask = (1ULL << word_length) - 1;
471+ /*
472+ * For captured data we should not rotate, inversion and masking is
473+ * enoguh to get the data to the right position:
474+ * Format data from bus after reverse (XRBUF)
475+ * S16_LE: |LSB|MSB|xxx|xxx| |xxx|xxx|MSB|LSB|
476+ * S24_3LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB|
477+ * S24_LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB|
478+ * S32_LE: |LSB|DAT|DAT|MSB| |MSB|DAT|DAT|LSB|
479+ */
480+ u32 rx_rotate = 0;
472481
473482 /*
474483 * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv()
sound/soc/dwc/designware_i2s.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * sound/soc/dwc/designware_i2s.c
55 *
66 * Copyright (C) 2010 ST Microelectronics
7− * Rajeev Kumar <rajeev-dlh.kumar@st.com>
7+ * Rajeev Kumar <rajeevkumar.linux@gmail.com>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
@@ -455,7 +455,7 @@ static struct platform_driver dw_i2s_driver = { · 444 unmodified lines
455455
456456 module_platform_driver(dw_i2s_driver);
457457
458−MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
458+MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
459459 MODULE_DESCRIPTION("DESIGNWARE I2S SoC Interface");
460460 MODULE_LICENSE("GPL");
461461 MODULE_ALIAS("platform:designware_i2s");
sound/soc/rockchip/rockchip_i2s.c+7−6
@@ -165,13 +165,14 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, · 164 unmodified lines
165165 struct rk_i2s_dev *i2s = to_info(cpu_dai);
166166 unsigned int mask = 0, val = 0;
167167
168− mask = I2S_CKR_MSS_SLAVE;
168+ mask = I2S_CKR_MSS_MASK;
169169 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
170170 case SND_SOC_DAIFMT_CBS_CFS:
171− val = I2S_CKR_MSS_SLAVE;
171+ /* Set source clock in Master mode */
172+ val = I2S_CKR_MSS_MASTER;
172173 break;
173174 case SND_SOC_DAIFMT_CBM_CFM:
174− val = I2S_CKR_MSS_MASTER;
175+ val = I2S_CKR_MSS_SLAVE;
175176 break;
176177 default:
177178 return -EINVAL;
@@ -361,6 +362,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg) · 183 unmodified lines
361362 case I2S_XFER:
362363 case I2S_CLR:
363364 case I2S_RXDR:
365+ case I2S_FIFOLR:
366+ case I2S_INTSR:
364367 return true;
365368 default:
366369 return false;
@@ -370,8 +373,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg) · 3 unmodified lines
370373 static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
371374 {
372375 switch (reg) {
373− case I2S_FIFOLR:
374376 case I2S_INTSR:
377+ case I2S_CLR:
375378 return true;
376379 default:
377380 return false;
@@ -381,8 +384,6 @@ static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) · 3 unmodified lines
381384 static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg)
382385 {
383386 switch (reg) {
384− case I2S_FIFOLR:
385− return true;
386387 default:
387388 return false;
388389 }
sound/soc/samsung/i2s.c+3−2
@@ -462,7 +462,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, · 461 unmodified lines
462462 if (dir == SND_SOC_CLOCK_IN)
463463 rfs = 0;
464464
465− if ((rfs && other->rfs && (other->rfs != rfs)) ||
465+ if ((rfs && other && other->rfs && (other->rfs != rfs)) ||
466466 (any_active(i2s) &&
467467 (((dir == SND_SOC_CLOCK_IN)
468468 && !(mod & MOD_CDCLKCON)) ||
@@ -762,7 +762,8 @@ static void i2s_shutdown(struct snd_pcm_substream *substream, · 293 unmodified lines
762762 } else {
763763 u32 mod = readl(i2s->addr + I2SMOD);
764764 i2s->cdclk_out = !(mod & MOD_CDCLKCON);
765− other->cdclk_out = i2s->cdclk_out;
765+ if (other)
766+ other->cdclk_out = i2s->cdclk_out;
766767 }
767768 /* Reset any constraint on RFS and BFS */
768769 i2s->rfs = 0;
sound/soc/soc-compress.c+5−1
@@ -101,7 +101,11 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) · 100 unmodified lines
101101
102102 fe->dpcm[stream].runtime = fe_substream->runtime;
103103
104− if (dpcm_path_get(fe, stream, &list) <= 0) {
104+ ret = dpcm_path_get(fe, stream, &list);
105+ if (ret < 0) {
106+ mutex_unlock(&fe->card->mutex);
107+ goto fe_err;
108+ } else if (ret == 0) {
105109 dev_dbg(fe->dev, "ASoC: %s no valid %s route\n",
106110 fe->dai_link->name, stream ? "capture" : "playback");
107111 }
sound/soc/soc-pcm.c+5−1
@@ -2352,7 +2352,11 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream) · 2351 unmodified lines
23522352 mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
23532353 fe->dpcm[stream].runtime = fe_substream->runtime;
23542354
2355− if (dpcm_path_get(fe, stream, &list) <= 0) {
2355+ ret = dpcm_path_get(fe, stream, &list);
2356+ if (ret < 0) {
2357+ mutex_unlock(&fe->card->mutex);
2358+ return ret;
2359+ } else if (ret == 0) {
23562360 dev_dbg(fe->dev, "ASoC: %s no valid %s route\n",
23572361 fe->dai_link->name, stream ? "capture" : "playback");
23582362 }
sound/soc/spear/spear_pcm.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * sound/soc/spear/spear_pcm.c
55 *
66 * Copyright (C) 2012 ST Microelectronics
7− * Rajeev Kumar<rajeev-dlh.kumar@st.com>
7+ * Rajeev Kumar<rajeevkumar.linux@gmail.com>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
@@ -50,6 +50,6 @@ int devm_spear_pcm_platform_register(struct device *dev, · 39 unmodified lines
5050 }
5151 EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register);
5252
53−MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
53+MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
5454 MODULE_DESCRIPTION("SPEAr PCM DMA module");
5555 MODULE_LICENSE("GPL");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t