History

Merge 5.12-rc4 into usb-next

We need the usb/thunderbolt fixes in here as well.

Greg Kroah-Hartman committed 5 years ago

Commit f85142a2 parents e00943e 0d02ec6412 files · +2472 −1804Browse files

Unified · Split

412 files
  1. Documentation/ABI/testing/sysfs-fs-xfs +1 −1
  2. Documentation/devicetree/bindings/sound/fsl,spdif.yaml +4 −0
  3. Documentation/virt/kvm/api.rst +6 −3
  4. MAINTAINERS +3 −4
  5. Makefile +1 −1
  6. arch/csky/kernel/probes/ftrace.c +1 −1
  7. arch/mips/kernel/vmlinux.lds.S +1 −1
  8. arch/powerpc/include/asm/cpu_has_feature.h +2 −2
  9. arch/powerpc/kernel/vdso32/gettimeofday.S +11 −0
  10. arch/riscv/Kconfig +2 −2
  11. arch/riscv/Kconfig.socs +2 −0
  12. arch/riscv/include/asm/asm-prototypes.h +16 −0
  13. arch/riscv/include/asm/irq.h +2 −0
  14. arch/riscv/include/asm/processor.h +1 −0
  15. arch/riscv/include/asm/ptrace.h +5 −0
  16. arch/riscv/include/asm/sbi.h +2 −2
  17. arch/riscv/include/asm/timex.h +2 −0
  18. arch/riscv/kernel/Makefile +1 −0
  19. arch/riscv/kernel/probes/ftrace.c +10 −8
  20. arch/riscv/kernel/probes/kprobes.c +1 −2
  21. arch/riscv/kernel/process.c +1 −0
  22. arch/riscv/kernel/sbi.c +1 −1
  23. arch/riscv/kernel/setup.c +2 −1
  24. arch/riscv/kernel/time.c +1 −0
  25. arch/riscv/kernel/traps.c +1 −0
  26. arch/riscv/mm/kasan_init.c +3 −1
  27. arch/s390/include/asm/pci.h +1 −1
  28. arch/s390/kernel/perf_cpum_cf_diag.c +2 −1
  29. arch/s390/kernel/vtime.c +1 −1
  30. arch/s390/pci/pci.c +24 −4
  31. arch/s390/pci/pci_event.c +6 −12
  32. arch/x86/events/intel/core.c +3 −0
  33. arch/x86/events/intel/ds.c +1 −1
  34. arch/x86/include/asm/kvm_host.h +26 −8
  35. arch/x86/include/asm/processor.h +0 −9
  36. arch/x86/include/asm/thread_info.h +14 −1
  37. arch/x86/kernel/apic/apic.c +5 −0
  38. arch/x86/kernel/apic/io_apic.c +10 −0
  39. arch/x86/kernel/kprobes/ftrace.c +1 −1
  40. arch/x86/kernel/kvm.c +10 −13
  41. arch/x86/kernel/signal.c +1 −23
  42. arch/x86/kvm/hyperv.c +81 −10
  43. arch/x86/kvm/hyperv.h +1 −0
  44. arch/x86/kvm/mmu/mmu_internal.h +5 −0
  45. arch/x86/kvm/mmu/tdp_iter.c +18 −12
  46. arch/x86/kvm/mmu/tdp_iter.h +3 −1
  47. arch/x86/kvm/mmu/tdp_mmu.c +15 −25
  48. arch/x86/kvm/x86.c +68 −45
  49. arch/x86/platform/iris/iris.c +0 −1
  50. drivers/atm/fore200e.c +0 −2
  51. drivers/base/power/runtime.c +25 −37
  52. drivers/block/floppy.c +0 −1
  53. drivers/bluetooth/btrsi.c +0 −1
  54. drivers/char/applicom.c +0 −3
  55. drivers/char/toshiba.c +0 −1
  56. drivers/counter/stm32-timer-cnt.c +33 −22
  57. drivers/firmware/efi/efi.c +2 −1
  58. drivers/firmware/efi/vars.c +4 −0
  59. drivers/gpio/gpiolib.c +9 −1
  60. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +2 −32
  61. drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +5 −0
  62. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c +18 −8
  63. drivers/gpu/drm/i915/i915_perf.c +5 −8
  64. drivers/gpu/drm/i915/i915_reg.h +22 −1
  65. drivers/gpu/drm/i915/intel_pm.c +15 −1
  66. drivers/gpu/drm/nouveau/nouveau_bo.c +8 −0
  67. drivers/gpu/drm/omapdrm/dss/dsi.c +4 −3
  68. drivers/iio/adc/Kconfig +3 −0
  69. drivers/iio/adc/ab8500-gpadc.c +1 −1
  70. drivers/iio/adc/ad7949.c +1 −1
  71. drivers/iio/adc/qcom-spmi-vadc.c +1 −1
  72. drivers/iio/gyro/mpu3050-core.c +2 −0
  73. drivers/iio/humidity/hid-sensor-humidity.c +7 −5
  74. drivers/iio/imu/adis16400.c +1 −2
  75. drivers/iio/light/hid-sensor-prox.c +11 −2
  76. drivers/iio/temperature/hid-sensor-temperature.c +8 −6
  77. drivers/input/joydev.c +0 −1
  78. drivers/iommu/amd/init.c +20 −16
  79. drivers/iommu/tegra-smmu.c +3 −4
  80. drivers/media/firewire/firedtv-fw.c +0 −1
  81. drivers/media/pci/cx18/cx18-alsa-main.c +0 −1
  82. drivers/media/pci/cx18/cx18-driver.c +0 −1
  83. drivers/media/pci/cx25821/cx25821-alsa.c +0 −1
  84. drivers/media/pci/cx88/cx88-alsa.c +0 −1
  85. drivers/media/pci/ivtv/ivtv-alsa-main.c +0 −1
  86. drivers/media/pci/ivtv/ivtv-driver.c +0 −3
  87. drivers/media/pci/sta2x11/sta2x11_vip.c +0 −1
  88. drivers/media/platform/atmel/atmel-isi.c +0 −1
  89. drivers/media/platform/atmel/atmel-sama5d2-isc.c +0 −1
  90. drivers/media/platform/marvell-ccic/cafe-driver.c +0 −4
  91. drivers/media/platform/stm32/stm32-dcmi.c +0 −1
  92. drivers/media/usb/cpia2/cpia2_v4l.c +0 −1
  93. drivers/media/usb/tm6000/tm6000-alsa.c +0 −1
  94. drivers/media/usb/tm6000/tm6000-dvb.c +0 −2
  95. drivers/mtd/maps/sun_uflash.c +0 −1
  96. drivers/net/can/peak_canfd/peak_pciefd_main.c +0 −1
  97. drivers/net/can/sja1000/ems_pci.c +0 −1
  98. drivers/net/can/sja1000/ems_pcmcia.c +0 −1
  99. drivers/net/can/sja1000/kvaser_pci.c +0 −1
  100. drivers/net/can/sja1000/peak_pci.c +0 −2
  101. drivers/net/can/sja1000/peak_pcmcia.c +0 −1
  102. drivers/net/can/sja1000/plx_pci.c +0 −12
  103. drivers/net/can/usb/peak_usb/pcan_usb.c +0 −2
  104. drivers/net/can/usb/peak_usb/pcan_usb_fd.c +0 −3
  105. drivers/net/can/usb/peak_usb/pcan_usb_pro.c +0 −2
  106. drivers/net/hamradio/scc.c +0 −1
  107. drivers/net/wireless/admtek/adm8211.c +0 −1
  108. drivers/net/wireless/ath/ath5k/base.c +0 −1
  109. drivers/net/wireless/ath/ath9k/hw.c +0 −1
  110. drivers/net/wireless/ath/ath9k/init.c +0 −1
  111. drivers/net/wireless/atmel/atmel.c +0 −1
  112. drivers/net/wireless/atmel/atmel_cs.c +0 −1
  113. drivers/net/wireless/atmel/atmel_pci.c +0 −1
  114. drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +0 −1
  115. drivers/net/wireless/broadcom/brcm80211/brcmutil/utils.c +0 −1
  116. drivers/net/wireless/cisco/airo.c +0 −1
  117. drivers/net/wireless/cisco/airo_cs.c +0 −1
  118. drivers/net/wireless/intersil/hostap/hostap_cs.c +0 −1
  119. drivers/net/wireless/intersil/hostap/hostap_pci.c +0 −1
  120. drivers/net/wireless/intersil/hostap/hostap_plx.c +0 −1
  121. drivers/net/wireless/ralink/rt2x00/rt2400pci.c +0 −1
  122. drivers/net/wireless/ralink/rt2x00/rt2500pci.c +0 −1
  123. drivers/net/wireless/ralink/rt2x00/rt2500usb.c +0 −1
  124. drivers/net/wireless/ralink/rt2x00/rt2800pci.c +0 −1
  125. drivers/net/wireless/ralink/rt2x00/rt2800usb.c +0 −1
  126. drivers/net/wireless/ralink/rt2x00/rt61pci.c +0 −2
  127. drivers/net/wireless/ralink/rt2x00/rt73usb.c +0 −1
  128. drivers/net/wireless/rsi/rsi_91x_main.c +0 −1
  129. drivers/net/wireless/rsi/rsi_91x_sdio.c +0 −1
  130. drivers/net/wireless/rsi/rsi_91x_usb.c +0 −1
  131. drivers/nvme/host/core.c +21 −43
  132. drivers/nvme/host/fabrics.h +7 −0
  133. drivers/nvme/host/fc.c +2 −2
  134. drivers/nvme/host/rdma.c +7 −4
  135. drivers/nvme/host/tcp.c +15 −5
  136. drivers/nvme/target/core.c +14 −3
  137. drivers/nvme/target/loop.c +2 −2
  138. drivers/nvme/target/tcp.c +1 −1
  139. drivers/parport/parport_amiga.c +0 −1
  140. drivers/parport/parport_atari.c +0 −1
  141. drivers/parport/parport_gsc.c +0 −1
  142. drivers/parport/parport_mfc3.c +0 −1
  143. drivers/parport/parport_sunbpp.c +0 −1
  144. drivers/pci/hotplug/rpadlpar_sysfs.c +6 −8
  145. drivers/pci/hotplug/s390_pci_hpc.c +2 −1
  146. drivers/s390/block/dasd.c +0 −1
  147. drivers/sbus/char/display7seg.c +0 −1
  148. drivers/scsi/hpsa.c +0 −1
  149. drivers/scsi/ibmvscsi/ibmvfc.c +2 −0
  150. drivers/scsi/lpfc/lpfc_debugfs.c +2 −2
  151. drivers/scsi/mpt3sas/mpt3sas_scsih.c +1 −1
  152. drivers/scsi/myrs.c +1 −1
  153. drivers/scsi/pcmcia/nsp_cs.c +0 −1
  154. drivers/scsi/qla2xxx/qla_target.h +1 −1
  155. drivers/scsi/sd_zbc.c +11 −8
  156. drivers/scsi/smartpqi/smartpqi_init.c +0 −1
  157. drivers/scsi/st.c +1 −1
  158. drivers/scsi/ufs/ufs-mediatek.c +1 −1
  159. drivers/sh/maple/maple.c +0 −1
  160. drivers/spi/spi-cadence-quadspi.c +1 −0
  161. drivers/staging/comedi/drivers/cb_pcidas.c +1 −1
  162. drivers/staging/comedi/drivers/cb_pcidas64.c +1 −1
  163. drivers/staging/comedi/drivers/vmk80xx.c +0 −1
  164. drivers/staging/vt6655/rxtx.h +2 −2
  165. drivers/tee/optee/core.c +0 −1
  166. drivers/thermal/thermal_sysfs.c +3 −0
  167. drivers/thunderbolt/switch.c +8 −10
  168. drivers/thunderbolt/tb.c +4 −0
  169. drivers/tty/serial/icom.c +0 −2
  170. drivers/tty/serial/jsm/jsm_driver.c +0 −1
  171. drivers/usb/cdns3/cdnsp-ring.c +4 −1
  172. drivers/usb/dwc3/gadget.c +5 −6
  173. drivers/usb/gadget/configfs.c +10 −4
  174. drivers/usb/misc/ldusb.c +0 −1
  175. drivers/usb/storage/transport.c +7 −0
  176. drivers/usb/storage/unusual_devs.h +12 −0
  177. drivers/usb/typec/tcpm/tcpm.c +9 −2
  178. drivers/usb/typec/tipd/core.c +0 −1
  179. drivers/usb/usbip/vudc_sysfs.c +1 −1
  180. drivers/vdpa/ifcvf/ifcvf_main.c +2 −3
  181. drivers/vdpa/mlx5/net/mlx5_vnet.c +2 −2
  182. drivers/vdpa/vdpa.c +10 −8
  183. drivers/vdpa/vdpa_sim/vdpa_sim.c +1 −1
  184. drivers/vdpa/vdpa_sim/vdpa_sim_net.c +2 −3
  185. drivers/vfio/Kconfig +2 −2
  186. drivers/vfio/platform/Kconfig +2 −2
  187. drivers/vfio/vfio_iommu_type1.c +12 −8
  188. drivers/vhost/vdpa.c +11 −9
  189. drivers/vhost/vhost.c +1 −1
  190. drivers/virtio/virtio.c +2 −4
  191. drivers/virtio/virtio_mmio.c +1 −2
  192. drivers/watchdog/cpu5wdt.c +0 −1
  193. drivers/watchdog/cpwd.c +0 −1
  194. drivers/watchdog/riowd.c +0 −1
  195. fs/afs/dir.c +0 −1
  196. fs/afs/file.c +0 −1
  197. fs/afs/fs_operation.c +5 −2
  198. fs/afs/inode.c +0 −1
  199. fs/afs/internal.h +0 −1
  200. fs/afs/mntpt.c +0 −1
  201. fs/afs/xattr.c +7 −24
  202. fs/btrfs/ctree.c +2 −0
  203. fs/btrfs/extent-tree.c +22 −1
  204. fs/btrfs/extent_io.c +31 −2
  205. fs/btrfs/inode.c +26 −11
  206. fs/btrfs/reada.c +18 −17
  207. fs/btrfs/tree-log.c +4 −4
  208. fs/cifs/cifs_swn.c +1 −1
  209. fs/cifs/cifsacl.c +6 −3
  210. fs/cifs/fs_context.c +4 −2
  211. fs/cifs/inode.c +9 −1
  212. fs/cifs/transport.c +6 −1
  213. fs/ext4/balloc.c +26 −12
  214. fs/ext4/ext4.h +3 −0
  215. fs/ext4/extents.c +1 −1
  216. fs/ext4/fast_commit.c +7 −2
  217. fs/ext4/inode.c +10 −8
  218. fs/ext4/mballoc.c +9 −2
  219. fs/ext4/namei.c +39 −11
  220. fs/ext4/super.c +6 −1
  221. fs/ext4/sysfs.c +7 −0
  222. fs/ext4/verity.c +55 −34
  223. fs/ext4/xattr.c +5 −1
  224. fs/fuse/dev.c +16 −10
  225. fs/fuse/fuse_i.h +1 −0
  226. fs/fuse/virtio_fs.c +8 −1
  227. fs/io-wq.c +11 −3
  228. fs/io-wq.h +9 −1
  229. fs/io_uring.c +147 −105
  230. fs/iomap/swapfile.c +10 −0
  231. fs/locks.c +0 −3
  232. fs/nfsd/Kconfig +1 −0
  233. fs/nfsd/filecache.c +2 −0
  234. fs/nfsd/nfs4callback.c +1 −0
  235. fs/nfsd/nfs4proc.c +1 −1
  236. fs/nfsd/nfs4state.c +15 −40
  237. fs/select.c +4 −6
  238. fs/xfs/xfs_inode.c +8 −6
  239. fs/xfs/xfs_itable.c +6 −0
  240. fs/xfs/xfs_mount.c +44 −46
  241. fs/xfs/xfs_symlink.c +2 −1
  242. fs/zonefs/super.c +87 −14
  243. include/drm/ttm/ttm_bo_api.h +4 −2
  244. include/linux/amba/bus.h +11 −0
  245. include/linux/efi.h +4 −2
  246. include/linux/io_uring.h +0 −25
  247. include/linux/module.h +0 −3
  248. include/linux/restart_block.h +1 −0
  249. include/linux/sunrpc/svc_rdma.h +0 −1
  250. include/linux/thread_info.h +13 −0
  251. include/linux/usb_usual.h +2 −0
  252. include/linux/vdpa.h +5 −5
  253. include/linux/virtio.h +0 −2
  254. include/linux/ww_mutex.h +3 −2
  255. include/trace/events/workqueue.h +3 −3
  256. include/uapi/linux/fuse.h +2 −1
  257. kernel/fork.c +0 −1
  258. kernel/freezer.c +1 −1
  259. kernel/futex.c +1 −2
  260. kernel/irq/irq_sim.c +2 −2
  261. kernel/irq/manage.c +4 −0
  262. kernel/jump_label.c +8 −0
  263. kernel/locking/mutex.c +14 −11
  264. kernel/reboot.c +0 −2
  265. kernel/signal.c +5 −1
  266. kernel/static_call.c +24 −18
  267. kernel/time/alarmtimer.c +1 −1
  268. kernel/time/hrtimer.c +1 −1
  269. kernel/time/posix-cpu-timers.c +1 −1
  270. net/batman-adv/main.c +0 −1
  271. net/sunrpc/auth_gss/svcauth_gss.c +7 −4
  272. net/sunrpc/svc.c +4 −2
  273. net/sunrpc/svc_xprt.c +2 −2
  274. net/sunrpc/xprtrdma/svc_rdma_backchannel.c +3 −3
  275. net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +39 −43
  276. sound/drivers/aloop.c +0 −1
  277. sound/drivers/dummy.c +0 −1
  278. sound/drivers/mtpav.c +0 −1
  279. sound/drivers/mts64.c +0 −1
  280. sound/drivers/pcsp/pcsp.c +0 −1
  281. sound/drivers/portman2x4.c +0 −1
  282. sound/drivers/serial-u16550.c +0 −1
  283. sound/drivers/virmidi.c +0 −1
  284. sound/firewire/dice/dice-stream.c +2 −3
  285. sound/isa/ad1816a/ad1816a.c +0 −7
  286. sound/isa/ad1848/ad1848.c +0 −3
  287. sound/isa/als100.c +0 −11
  288. sound/isa/azt2320.c +0 −5
  289. sound/isa/cmi8330.c +0 −1
  290. sound/isa/cs423x/cs4231.c +0 −1
  291. sound/isa/cs423x/cs4236.c +0 −34
  292. sound/isa/es1688/es1688.c +0 −5
  293. sound/isa/es18xx.c +1 −9
  294. sound/isa/gus/gusclassic.c +0 −1
  295. sound/isa/gus/gusextreme.c +0 −1
  296. sound/isa/gus/gusmax.c +0 −1
  297. sound/isa/gus/interwave.c +0 −6
  298. sound/isa/opl3sa2.c +0 −5
  299. sound/isa/opti9xx/miro.c +0 −3
  300. sound/isa/opti9xx/opti92x-ad1848.c +0 −6
  301. sound/isa/sb/jazz16.c +0 −3
  302. sound/isa/sb/sb16.c +0 −8
  303. sound/isa/sb/sb8.c +0 −1
  304. sound/isa/sc6000.c +0 −3
  305. sound/isa/wavefront/wavefront.c +0 −1
  306. sound/mips/sgio2audio.c +0 −1
  307. sound/pci/ad1889.c +0 −1
  308. sound/pci/ali5451/ali5451.c +0 −1
  309. sound/pci/als300.c +0 −1
  310. sound/pci/als4000.c +0 −1
  311. sound/pci/atiixp.c +0 −1
  312. sound/pci/atiixp_modem.c +0 −1
  313. sound/pci/au88x0/au88x0.c +0 −2
  314. sound/pci/azt3328.c +0 −1
  315. sound/pci/bt87x.c +0 −2
  316. sound/pci/ca0106/ca0106_main.c +0 −1
  317. sound/pci/cmipci.c +0 −4
  318. sound/pci/cs4281.c +0 −1
  319. sound/pci/cs46xx/cs46xx.c +0 −7
  320. sound/pci/cs5535audio/cs5535audio.c +0 −1
  321. sound/pci/ctxfi/xfi.c +0 −1
  322. sound/pci/echoaudio/echoaudio.c +0 −1
  323. sound/pci/emu10k1/emu10k1.c +0 −2
  324. sound/pci/emu10k1/emu10k1x.c +0 −1
  325. sound/pci/ens1370.c +0 −8
  326. sound/pci/es1938.c +0 −4
  327. sound/pci/es1968.c +0 −4
  328. sound/pci/fm801.c +0 −2
  329. sound/pci/hda/hda_generic.c +1 −1
  330. sound/pci/hda/hda_intel.c +0 −34
  331. sound/pci/hda/patch_realtek.c +16 −0
  332. sound/pci/ice1712/ice1712.c +0 −6
  333. sound/pci/ice1712/ice1724.c +0 −19
  334. sound/pci/intel8x0.c +0 −23
  335. sound/pci/intel8x0m.c +0 −15
  336. sound/pci/korg1212/korg1212.c +0 −1
  337. sound/pci/lola/lola.c +0 −1
  338. sound/pci/lx6464es/lx6464es.c +0 −2
  339. sound/pci/maestro3.c +0 −5
  340. sound/pci/mixart/mixart.c +0 −1
  341. sound/pci/nm256/nm256.c +0 −2
  342. sound/pci/oxygen/oxygen.c +0 −3
  343. sound/pci/oxygen/se6x.c +0 −1
  344. sound/pci/oxygen/virtuoso.c +0 −1
  345. sound/pci/pcxhr/pcxhr.c +0 −1
  346. sound/pci/riptide/riptide.c +0 −1
  347. sound/pci/rme32.c +0 −1
  348. sound/pci/rme96.c +0 −5
  349. sound/pci/rme9652/hdsp.c +0 −3
  350. sound/pci/rme9652/hdspm.c +0 −1
  351. sound/pci/rme9652/rme9652.c +0 −2
  352. sound/pci/sis7019.c +0 −1
  353. sound/pci/sonicvibes.c +0 −1
  354. sound/pci/trident/trident.c +0 −12
  355. sound/pci/via82xx.c +0 −1
  356. sound/pci/via82xx_modem.c +0 −1
  357. sound/pci/vx222/vx222.c +0 −1
  358. sound/pci/ymfpci/ymfpci.c +0 −6
  359. sound/pcmcia/pdaudiocf/pdaudiocf.c +0 −1
  360. sound/pcmcia/vx/vxpocket.c +0 −4
  361. sound/ppc/powermac.c +0 −1
  362. sound/sh/aica.c +0 −1
  363. sound/sh/sh_dac_audio.c +0 −1
  364. sound/soc/codecs/Kconfig +0 −5
  365. sound/soc/codecs/ak4458.c +1 −0
  366. sound/soc/codecs/ak5558.c +1 −0
  367. sound/soc/codecs/cs42l42.c +34 −78
  368. sound/soc/codecs/cs42l42.h +7 −6
  369. sound/soc/codecs/es8316.c +2 −7
  370. sound/soc/codecs/lpass-rx-macro.c +1 −1
  371. sound/soc/codecs/lpass-va-macro.c +13 −15
  372. sound/soc/codecs/lpass-wsa-macro.c +11 −9
  373. sound/soc/codecs/rt1015.c +2 −0
  374. sound/soc/codecs/rt5640.c +2 −2
  375. sound/soc/codecs/rt5651.c +2 −2
  376. sound/soc/codecs/rt5659.c +5 −0
  377. sound/soc/codecs/rt5670.c +96 −14
  378. sound/soc/codecs/rt5670.h +5 −4
  379. sound/soc/codecs/rt711.c +8 −0
  380. sound/soc/codecs/sgtl5000.c +1 −1
  381. sound/soc/codecs/sirf-audio-codec.h +0 −124
  382. sound/soc/codecs/wcd934x.c +6 −0
  383. sound/soc/fsl/fsl_ssi.c +4 −2
  384. sound/soc/generic/simple-card-utils.c +7 −6
  385. sound/soc/intel/boards/bytcr_rt5640.c +1 −1
  386. sound/soc/mediatek/mt8192/mt8192-dai-tdm.c +3 −1
  387. sound/soc/mediatek/mt8192/mt8192-reg.h +5 −3
  388. sound/soc/qcom/lpass-cpu.c +1 −1
  389. sound/soc/qcom/sdm845.c +3 −3
  390. sound/soc/soc-core.c +4 −0
  391. sound/soc/sof/intel/hda-dsp.c +1 −1
  392. sound/soc/sof/intel/hda.c +1 −0
  393. sound/sparc/amd7930.c +0 −1
  394. sound/sparc/cs4231.c +0 −1
  395. sound/sparc/dbri.c +0 −1
  396. sound/usb/6fire/chip.c +0 −1
  397. sound/usb/caiaq/device.c +0 −14
  398. sound/usb/card.c +0 −2
  399. sound/usb/hiface/chip.c +0 −17
  400. sound/usb/misc/ua101.c +0 −1
  401. sound/usb/mixer_quirks.c +2 −2
  402. sound/usb/usx2y/usbusx2y.c +0 −1
  403. sound/x86/intel_hdmi_audio.c +0 −1
  404. sound/xen/xen_snd_front.c +0 −1
  405. tools/testing/selftests/kvm/.gitignore +3 −0
  406. tools/testing/selftests/kvm/Makefile +3 −0
  407. tools/testing/selftests/kvm/include/kvm_util.h +2 −0
  408. tools/testing/selftests/kvm/lib/kvm_util.c +6 −1
  409. tools/testing/selftests/kvm/lib/kvm_util_internal.h +0 −2
  410. tools/testing/selftests/kvm/x86_64/get_msr_index_features.c +134 −0
  411. tools/testing/selftests/kvm/x86_64/hyperv_clock.c +260 −0
  412. tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c +166 −0
Documentation/ABI/testing/sysfs-fs-xfs+1−1
@@ -33,7 +33,7 @@ Contact: xfs@oss.sgi.com · 32 unmodified lines
3333 Description:
3434 The current state of the log write grant head. It
3535 represents the total log reservation of all currently
36− oustanding transactions, including regrants due to
36+ outstanding transactions, including regrants due to
3737 rolling transactions. The grant head is exported in
3838 "cycle:bytes" format.
3939 Users: xfstests
Documentation/devicetree/bindings/sound/fsl,spdif.yaml+4−0
@@ -21,6 +21,10 @@ properties: · 20 unmodified lines
2121 - fsl,vf610-spdif
2222 - fsl,imx6sx-spdif
2323 - fsl,imx8qm-spdif
24+ - fsl,imx8qxp-spdif
25+ - fsl,imx8mq-spdif
26+ - fsl,imx8mm-spdif
27+ - fsl,imx8mn-spdif
2428
2529 reg:
2630 maxItems: 1
Documentation/virt/kvm/api.rst+6−3
@@ -1495,7 +1495,8 @@ Fails if any VCPU has already been created. · 1494 unmodified lines
14951495
14961496 Define which vcpu is the Bootstrap Processor (BSP). Values are the same
14971497 as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default
1498−is vcpu 0.
1498+is vcpu 0. This ioctl has to be called before vcpu creation,
1499+otherwise it will return EBUSY error.
14991500
15001501
15011502 4.42 KVM_GET_XSAVE
@@ -4806,8 +4807,10 @@ If an MSR access is not permitted through the filtering, it generates a · 3304 unmodified lines
48064807 allows user space to deflect and potentially handle various MSR accesses
48074808 into user space.
48084809
4809−If a vCPU is in running state while this ioctl is invoked, the vCPU may
4810−experience inconsistent filtering behavior on MSR accesses.
4810+Note, invoking this ioctl with a vCPU is running is inherently racy. However,
4811+KVM does guarantee that vCPUs will see either the previous filter or the new
4812+filter, e.g. MSRs with identical settings in both the old and new filter will
4813+have deterministic behavior.
48114814
48124815 4.127 KVM_XEN_HVM_SET_ATTR
48134816 --------------------------
MAINTAINERS+3−4
@@ -1181,7 +1181,7 @@ M: Joel Fernandes <joel@joelfernandes.org> · 1180 unmodified lines
11811181 M: Christian Brauner <christian@brauner.io>
11821182 M: Hridya Valsaraju <hridya@google.com>
11831183 M: Suren Baghdasaryan <surenb@google.com>
1184−L: devel@driverdev.osuosl.org
1184+L: linux-kernel@vger.kernel.org
11851185 S: Supported
11861186 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
11871187 F: drivers/android/
@@ -8116,7 +8116,6 @@ F: drivers/crypto/hisilicon/sec2/sec_main.c · 6928 unmodified lines
81168116
81178117 HISILICON STAGING DRIVERS FOR HIKEY 960/970
81188118 M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
8119−L: devel@driverdev.osuosl.org
81208119 S: Maintained
81218120 F: drivers/staging/hikey9xx/
81228121
@@ -17040,7 +17039,7 @@ F: drivers/staging/vt665?/ · 8917 unmodified lines
1704017039
1704117040 STAGING SUBSYSTEM
1704217041 M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17043−L: devel@driverdev.osuosl.org
17042+L: linux-staging@lists.linux.dev
1704417043 S: Supported
1704517044 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
1704617045 F: drivers/staging/
@@ -19135,7 +19134,7 @@ VME SUBSYSTEM · 2088 unmodified lines
1913519134 M: Martyn Welch <martyn@welchs.me.uk>
1913619135 M: Manohar Vanga <manohar.vanga@gmail.com>
1913719136 M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19138−L: devel@driverdev.osuosl.org
19137+L: linux-kernel@vger.kernel.org
1913919138 S: Maintained
1914019139 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
1914119140 F: Documentation/driver-api/vme.rst
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 12
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc3
5+EXTRAVERSION = -rc4
66 NAME = Frozen Wasteland
77
88 # *DOCUMENTATION*
arch/csky/kernel/probes/ftrace.c+1−1
@@ -9,7 +9,7 @@ int arch_check_ftrace_location(struct kprobe *p) · 8 unmodified lines
99 return 0;
1010 }
1111
12−/* Ftrace callback handler for kprobes -- called under preepmt disabed */
12+/* Ftrace callback handler for kprobes -- called under preepmt disabled */
1313 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
1414 struct ftrace_ops *ops, struct ftrace_regs *fregs)
1515 {
arch/mips/kernel/vmlinux.lds.S+1−1
@@ -176,7 +176,7 @@ SECTIONS · 175 unmodified lines
176176 .fill : {
177177 FILL(0);
178178 BYTE(0);
179− . = ALIGN(8);
179+ STRUCT_ALIGN();
180180 }
181181 __appended_dtb = .;
182182 /* leave space for appended DTB */
arch/powerpc/include/asm/cpu_has_feature.h+2−2
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 #include <linux/bug.h>
88 #include <asm/cputable.h>
99
10−static inline bool early_cpu_has_feature(unsigned long feature)
10+static __always_inline bool early_cpu_has_feature(unsigned long feature)
1111 {
1212 return !!((CPU_FTRS_ALWAYS & feature) ||
1313 (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature));
@@ -46,7 +46,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature) · 32 unmodified lines
4646 return static_branch_likely(&cpu_feature_keys[i]);
4747 }
4848 #else
49−static inline bool cpu_has_feature(unsigned long feature)
49+static __always_inline bool cpu_has_feature(unsigned long feature)
5050 {
5151 return early_cpu_has_feature(feature);
5252 }
arch/powerpc/kernel/vdso32/gettimeofday.S+11−0
@@ -65,3 +65,14 @@ V_FUNCTION_END(__kernel_clock_getres) · 64 unmodified lines
6565 V_FUNCTION_BEGIN(__kernel_time)
6666 cvdso_call_time __c_kernel_time
6767 V_FUNCTION_END(__kernel_time)
68+
69+/* Routines for restoring integer registers, called by the compiler. */
70+/* Called with r11 pointing to the stack header word of the caller of the */
71+/* function, just beyond the end of the integer restore area. */
72+_GLOBAL(_restgpr_31_x)
73+_GLOBAL(_rest32gpr_31_x)
74+ lwz r0,4(r11)
75+ lwz r31,-4(r11)
76+ mtlr r0
77+ mr r1,r11
78+ blr
arch/riscv/Kconfig+2−2
@@ -93,7 +93,6 @@ config RISCV · 92 unmodified lines
9393 select PCI_MSI if PCI
9494 select RISCV_INTC
9595 select RISCV_TIMER if RISCV_SBI
96− select SPARSEMEM_STATIC if 32BIT
9796 select SPARSE_IRQ
9897 select SYSCTL_EXCEPTION_TRACE
9998 select THREAD_INFO_IN_TASK
@@ -154,7 +153,8 @@ config ARCH_FLATMEM_ENABLE · 54 unmodified lines
154153 config ARCH_SPARSEMEM_ENABLE
155154 def_bool y
156155 depends on MMU
157− select SPARSEMEM_VMEMMAP_ENABLE
156+ select SPARSEMEM_STATIC if 32BIT && SPARSMEM
157+ select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
158158
159159 config ARCH_SELECT_MEMORY_MODEL
160160 def_bool ARCH_SPARSEMEM_ENABLE
arch/riscv/Kconfig.socs+2−0
@@ -31,6 +31,8 @@ config SOC_CANAAN · 30 unmodified lines
3131 select SIFIVE_PLIC
3232 select ARCH_HAS_RESET_CONTROLLER
3333 select PINCTRL
34+ select COMMON_CLK
35+ select COMMON_CLK_K210
3436 help
3537 This enables support for Canaan Kendryte K210 SoC platform hardware.
3638
arch/riscv/include/asm/asm-prototypes.h+16−0
@@ -9,4 +9,20 @@ long long __lshrti3(long long a, int b); · 8 unmodified lines
99 long long __ashrti3(long long a, int b);
1010 long long __ashlti3(long long a, int b);
1111
12+
13+#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs)
14+
15+DECLARE_DO_ERROR_INFO(do_trap_unknown);
16+DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned);
17+DECLARE_DO_ERROR_INFO(do_trap_insn_fault);
18+DECLARE_DO_ERROR_INFO(do_trap_insn_illegal);
19+DECLARE_DO_ERROR_INFO(do_trap_load_fault);
20+DECLARE_DO_ERROR_INFO(do_trap_load_misaligned);
21+DECLARE_DO_ERROR_INFO(do_trap_store_misaligned);
22+DECLARE_DO_ERROR_INFO(do_trap_store_fault);
23+DECLARE_DO_ERROR_INFO(do_trap_ecall_u);
24+DECLARE_DO_ERROR_INFO(do_trap_ecall_s);
25+DECLARE_DO_ERROR_INFO(do_trap_ecall_m);
26+DECLARE_DO_ERROR_INFO(do_trap_break);
27+
1228 #endif /* _ASM_RISCV_PROTOTYPES_H */
arch/riscv/include/asm/irq.h+2−0
@@ -12,4 +12,6 @@ · 11 unmodified lines
1212
1313 #include <asm-generic/irq.h>
1414
15+extern void __init init_IRQ(void);
16+
1517 #endif /* _ASM_RISCV_IRQ_H */
arch/riscv/include/asm/processor.h+1−0
@@ -71,6 +71,7 @@ int riscv_of_processor_hartid(struct device_node *node); · 70 unmodified lines
7171 int riscv_of_parent_hartid(struct device_node *node);
7272
7373 extern void riscv_fill_hwcap(void);
74+extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
7475
7576 #endif /* __ASSEMBLY__ */
7677
arch/riscv/include/asm/ptrace.h+5−0
@@ -119,6 +119,11 @@ extern int regs_query_register_offset(const char *name); · 118 unmodified lines
119119 extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
120120 unsigned int n);
121121
122+void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
123+ unsigned long frame_pointer);
124+int do_syscall_trace_enter(struct pt_regs *regs);
125+void do_syscall_trace_exit(struct pt_regs *regs);
126+
122127 /**
123128 * regs_get_register() - get register value from its offset
124129 * @regs: pt_regs from which register value is gotten
arch/riscv/include/asm/sbi.h+2−2
@@ -51,10 +51,10 @@ enum sbi_ext_rfence_fid { · 50 unmodified lines
5151 SBI_EXT_RFENCE_REMOTE_FENCE_I = 0,
5252 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
5353 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID,
54− SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
5554 SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID,
56− SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,
55+ SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
5756 SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID,
57+ SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,
5858 };
5959
6060 enum sbi_ext_hsm_fid {
arch/riscv/include/asm/timex.h+2−0
@@ -88,4 +88,6 @@ static inline int read_current_timer(unsigned long *timer_val) · 87 unmodified lines
8888 return 0;
8989 }
9090
91+extern void time_init(void);
92+
9193 #endif /* _ASM_RISCV_TIMEX_H */
arch/riscv/kernel/Makefile+1−0
@@ -8,6 +8,7 @@ CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) · 7 unmodified lines
88 CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE)
99 CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE)
1010 endif
11+CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,)
1112
1213 extra-y += head.o
1314 extra-y += vmlinux.lds
arch/riscv/kernel/probes/ftrace.c+10−8
@@ -2,39 +2,41 @@ · 1 unmodified line
22
33 #include <linux/kprobes.h>
44
5−/* Ftrace callback handler for kprobes -- called under preepmt disabed */
5+/* Ftrace callback handler for kprobes -- called under preepmt disabled */
66 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
7− struct ftrace_ops *ops, struct ftrace_regs *regs)
7+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
88 {
99 struct kprobe *p;
10+ struct pt_regs *regs;
1011 struct kprobe_ctlblk *kcb;
1112
1213 p = get_kprobe((kprobe_opcode_t *)ip);
1314 if (unlikely(!p) || kprobe_disabled(p))
1415 return;
1516
17+ regs = ftrace_get_regs(fregs);
1618 kcb = get_kprobe_ctlblk();
1719 if (kprobe_running()) {
1820 kprobes_inc_nmissed_count(p);
1921 } else {
20− unsigned long orig_ip = instruction_pointer(&(regs->regs));
22+ unsigned long orig_ip = instruction_pointer(regs);
2123
22− instruction_pointer_set(&(regs->regs), ip);
24+ instruction_pointer_set(regs, ip);
2325
2426 __this_cpu_write(current_kprobe, p);
2527 kcb->kprobe_status = KPROBE_HIT_ACTIVE;
26− if (!p->pre_handler || !p->pre_handler(p, &(regs->regs))) {
28+ if (!p->pre_handler || !p->pre_handler(p, regs)) {
2729 /*
2830 * Emulate singlestep (and also recover regs->pc)
2931 * as if there is a nop
3032 */
31− instruction_pointer_set(&(regs->regs),
33+ instruction_pointer_set(regs,
3234 (unsigned long)p->addr + MCOUNT_INSN_SIZE);
3335 if (unlikely(p->post_handler)) {
3436 kcb->kprobe_status = KPROBE_HIT_SSDONE;
35− p->post_handler(p, &(regs->regs), 0);
37+ p->post_handler(p, regs, 0);
3638 }
37− instruction_pointer_set(&(regs->regs), orig_ip);
39+ instruction_pointer_set(regs, orig_ip);
3840 }
3941
4042 /*
arch/riscv/kernel/probes/kprobes.c+1−2
@@ -256,8 +256,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int trapnr) · 255 unmodified lines
256256 * normal page fault.
257257 */
258258 regs->epc = (unsigned long) cur->addr;
259− if (!instruction_pointer(regs))
260− BUG();
259+ BUG_ON(!instruction_pointer(regs));
261260
262261 if (kcb->kprobe_status == KPROBE_REENTER)
263262 restore_previous_kprobe(kcb);
arch/riscv/kernel/process.c+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/cpu.h>
1111 #include <linux/kernel.h>
1212 #include <linux/sched.h>
13+#include <linux/sched/debug.h>
1314 #include <linux/sched/task_stack.h>
1415 #include <linux/tick.h>
1516 #include <linux/ptrace.h>
arch/riscv/kernel/sbi.c+1−1
@@ -116,7 +116,7 @@ void sbi_clear_ipi(void) · 115 unmodified lines
116116 EXPORT_SYMBOL(sbi_clear_ipi);
117117
118118 /**
119− * sbi_set_timer_v01() - Program the timer for next timer event.
119+ * __sbi_set_timer_v01() - Program the timer for next timer event.
120120 * @stime_value: The value after which next timer event should fire.
121121 *
122122 * Return: None
arch/riscv/kernel/setup.c+2−1
@@ -147,7 +147,8 @@ static void __init init_resources(void) · 146 unmodified lines
147147 bss_res.end = __pa_symbol(__bss_stop) - 1;
148148 bss_res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
149149
150− mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt) * sizeof(*mem_res);
150+ /* + 1 as memblock_alloc() might increase memblock.reserved.cnt */
151+ mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt + 1) * sizeof(*mem_res);
151152 mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES);
152153 if (!mem_res)
153154 panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz);
arch/riscv/kernel/time.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <linux/delay.h>
1010 #include <asm/sbi.h>
1111 #include <asm/processor.h>
12+#include <asm/timex.h>
1213
1314 unsigned long riscv_timebase;
1415 EXPORT_SYMBOL_GPL(riscv_timebase);
arch/riscv/kernel/traps.c+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/module.h>
1818 #include <linux/irq.h>
1919
20+#include <asm/asm-prototypes.h>
2021 #include <asm/bug.h>
2122 #include <asm/processor.h>
2223 #include <asm/ptrace.h>
arch/riscv/mm/kasan_init.c+3−1
@@ -155,7 +155,7 @@ static void __init kasan_populate(void *start, void *end) · 154 unmodified lines
155155 memset(start, KASAN_SHADOW_INIT, end - start);
156156 }
157157
158−void __init kasan_shallow_populate(void *start, void *end)
158+static void __init kasan_shallow_populate(void *start, void *end)
159159 {
160160 unsigned long vaddr = (unsigned long)start & PAGE_MASK;
161161 unsigned long vend = PAGE_ALIGN((unsigned long)end);
@@ -187,6 +187,8 @@ void __init kasan_shallow_populate(void *start, void *end) · 25 unmodified lines
187187 }
188188 vaddr += PAGE_SIZE;
189189 }
190+
191+ local_flush_tlb_all();
190192 }
191193
192194 void __init kasan_init(void)
arch/s390/include/asm/pci.h+1−1
@@ -202,7 +202,7 @@ extern unsigned int s390_pci_no_rid; · 201 unmodified lines
202202 ----------------------------------------------------------------------------- */
203203 /* Base stuff */
204204 int zpci_create_device(u32 fid, u32 fh, enum zpci_state state);
205−void zpci_remove_device(struct zpci_dev *zdev);
205+void zpci_remove_device(struct zpci_dev *zdev, bool set_error);
206206 int zpci_enable_device(struct zpci_dev *);
207207 int zpci_disable_device(struct zpci_dev *);
208208 int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64);
arch/s390/kernel/perf_cpum_cf_diag.c+2−1
@@ -968,7 +968,7 @@ static int cf_diag_all_start(void) · 967 unmodified lines
968968 */
969969 static size_t cf_diag_needspace(unsigned int sets)
970970 {
971− struct cpu_cf_events *cpuhw = this_cpu_ptr(&cpu_cf_events);
971+ struct cpu_cf_events *cpuhw = get_cpu_ptr(&cpu_cf_events);
972972 size_t bytes = 0;
973973 int i;
974974
@@ -984,6 +984,7 @@ static size_t cf_diag_needspace(unsigned int sets) · 9 unmodified lines
984984 sizeof(((struct s390_ctrset_cpudata *)0)->no_sets));
985985 debug_sprintf_event(cf_diag_dbg, 5, "%s bytes %ld\n", __func__,
986986 bytes);
987+ put_cpu_ptr(&cpu_cf_events);
987988 return bytes;
988989 }
989990
arch/s390/kernel/vtime.c+1−1
@@ -214,7 +214,7 @@ void vtime_flush(struct task_struct *tsk) · 213 unmodified lines
214214 avg_steal = S390_lowcore.avg_steal_timer / 2;
215215 if ((s64) steal > 0) {
216216 S390_lowcore.steal_timer = 0;
217− account_steal_time(steal);
217+ account_steal_time(cputime_to_nsecs(steal));
218218 avg_steal += steal;
219219 }
220220 S390_lowcore.avg_steal_timer = avg_steal;
arch/s390/pci/pci.c+24−4
@@ -682,16 +682,36 @@ int zpci_disable_device(struct zpci_dev *zdev) · 681 unmodified lines
682682 }
683683 EXPORT_SYMBOL_GPL(zpci_disable_device);
684684
685−void zpci_remove_device(struct zpci_dev *zdev)
685+/* zpci_remove_device - Removes the given zdev from the PCI core
686+ * @zdev: the zdev to be removed from the PCI core
687+ * @set_error: if true the device's error state is set to permanent failure
688+ *
689+ * Sets a zPCI device to a configured but offline state; the zPCI
690+ * device is still accessible through its hotplug slot and the zPCI
691+ * API but is removed from the common code PCI bus, making it
692+ * no longer available to drivers.
693+ */
694+void zpci_remove_device(struct zpci_dev *zdev, bool set_error)
686695 {
687696 struct zpci_bus *zbus = zdev->zbus;
688697 struct pci_dev *pdev;
689698
699+ if (!zdev->zbus->bus)
700+ return;
701+
690702 pdev = pci_get_slot(zbus->bus, zdev->devfn);
691703 if (pdev) {
692− if (pdev->is_virtfn)
693− return zpci_iov_remove_virtfn(pdev, zdev->vfn);
704+ if (set_error)
705+ pdev->error_state = pci_channel_io_perm_failure;
706+ if (pdev->is_virtfn) {
707+ zpci_iov_remove_virtfn(pdev, zdev->vfn);
708+ /* balance pci_get_slot */
709+ pci_dev_put(pdev);
710+ return;
711+ }
694712 pci_stop_and_remove_bus_device_locked(pdev);
713+ /* balance pci_get_slot */
714+ pci_dev_put(pdev);
695715 }
696716 }
697717
@@ -765,7 +785,7 @@ void zpci_release_device(struct kref *kref) · 67 unmodified lines
765785 struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref);
766786
767787 if (zdev->zbus->bus)
768− zpci_remove_device(zdev);
788+ zpci_remove_device(zdev, false);
769789
770790 switch (zdev->state) {
771791 case ZPCI_FN_STATE_ONLINE:
arch/s390/pci/pci_event.c+6−12
@@ -76,13 +76,10 @@ void zpci_event_error(void *data) · 75 unmodified lines
7676 static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
7777 {
7878 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
79− struct pci_dev *pdev = NULL;
8079 enum zpci_state state;
80+ struct pci_dev *pdev;
8181 int ret;
8282
83− if (zdev && zdev->zbus->bus)
84− pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn);
85−
8683 zpci_err("avail CCDF:\n");
8784 zpci_err_hex(ccdf, sizeof(*ccdf));
8885
@@ -124,8 +121,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 35 unmodified lines
124121 case 0x0303: /* Deconfiguration requested */
125122 if (!zdev)
126123 break;
127− if (pdev)
128− zpci_remove_device(zdev);
124+ zpci_remove_device(zdev, false);
129125
130126 ret = zpci_disable_device(zdev);
131127 if (ret)
@@ -140,12 +136,10 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 8 unmodified lines
140136 case 0x0304: /* Configured -> Standby|Reserved */
141137 if (!zdev)
142138 break;
143− if (pdev) {
144− /* Give the driver a hint that the function is
145− * already unusable. */
146− pdev->error_state = pci_channel_io_perm_failure;
147− zpci_remove_device(zdev);
148− }
139+ /* Give the driver a hint that the function is
140+ * already unusable.
141+ */
142+ zpci_remove_device(zdev, true);
149143
150144 zdev->fh = ccdf->fh;
151145 zpci_disable_device(zdev);
arch/x86/events/intel/core.c+3−0
@@ -3659,6 +3659,9 @@ static int intel_pmu_hw_config(struct perf_event *event) · 3658 unmodified lines
36593659 return ret;
36603660
36613661 if (event->attr.precise_ip) {
3662+ if ((event->attr.config & INTEL_ARCH_EVENT_MASK) == INTEL_FIXED_VLBR_EVENT)
3663+ return -EINVAL;
3664+
36623665 if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) {
36633666 event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;
36643667 if (!(event->attr.sample_type &
arch/x86/events/intel/ds.c+1−1
@@ -2010,7 +2010,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_d · 2009 unmodified lines
20102010 */
20112011 if (!pebs_status && cpuc->pebs_enabled &&
20122012 !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1)))
2013− pebs_status = cpuc->pebs_enabled;
2013+ pebs_status = p->status = cpuc->pebs_enabled;
20142014
20152015 bit = find_first_bit((unsigned long *)&pebs_status,
20162016 x86_pmu.max_pebs_events);
arch/x86/include/asm/kvm_host.h+26−8
@@ -884,12 +884,29 @@ struct kvm_hv_syndbg { · 883 unmodified lines
884884 u64 options;
885885 };
886886
887+/* Current state of Hyper-V TSC page clocksource */
888+enum hv_tsc_page_status {
889+ /* TSC page was not set up or disabled */
890+ HV_TSC_PAGE_UNSET = 0,
891+ /* TSC page MSR was written by the guest, update pending */
892+ HV_TSC_PAGE_GUEST_CHANGED,
893+ /* TSC page MSR was written by KVM userspace, update pending */
894+ HV_TSC_PAGE_HOST_CHANGED,
895+ /* TSC page was properly set up and is currently active */
896+ HV_TSC_PAGE_SET,
897+ /* TSC page is currently being updated and therefore is inactive */
898+ HV_TSC_PAGE_UPDATING,
899+ /* TSC page was set up with an inaccessible GPA */
900+ HV_TSC_PAGE_BROKEN,
901+};
902+
887903 /* Hyper-V emulation context */
888904 struct kvm_hv {
889905 struct mutex hv_lock;
890906 u64 hv_guest_os_id;
891907 u64 hv_hypercall;
892908 u64 hv_tsc_page;
909+ enum hv_tsc_page_status hv_tsc_page_status;
893910
894911 /* Hyper-v based guest crash (NT kernel bugcheck) parameters */
895912 u64 hv_crash_param[HV_X64_MSR_CRASH_PARAMS];
@@ -931,6 +948,12 @@ enum kvm_irqchip_mode { · 35 unmodified lines
931948 KVM_IRQCHIP_SPLIT, /* created with KVM_CAP_SPLIT_IRQCHIP */
932949 };
933950
951+struct kvm_x86_msr_filter {
952+ u8 count;
953+ bool default_allow:1;
954+ struct msr_bitmap_range ranges[16];
955+};
956+
934957 #define APICV_INHIBIT_REASON_DISABLE 0
935958 #define APICV_INHIBIT_REASON_HYPERV 1
936959 #define APICV_INHIBIT_REASON_NESTED 2
@@ -1025,16 +1048,11 @@ struct kvm_arch { · 88 unmodified lines
10251048 bool guest_can_read_msr_platform_info;
10261049 bool exception_payload_enabled;
10271050
1051+ bool bus_lock_detection_enabled;
1052+
10281053 /* Deflect RDMSR and WRMSR to user space when they trigger a #GP */
10291054 u32 user_space_msr_mask;
1030−
1031− struct {
1032− u8 count;
1033− bool default_allow:1;
1034− struct msr_bitmap_range ranges[16];
1035− } msr_filter;
1036−
1037− bool bus_lock_detection_enabled;
1055+ struct kvm_x86_msr_filter __rcu *msr_filter;
10381056
10391057 struct kvm_pmu_event_filter __rcu *pmu_event_filter;
10401058 struct task_struct *nx_lpage_recovery_thread;
arch/x86/include/asm/processor.h+0−9
@@ -551,15 +551,6 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset, · 550 unmodified lines
551551 *size = fpu_kernel_xstate_size;
552552 }
553553
554−/*
555− * Thread-synchronous status.
556− *
557− * This is different from the flags in that nobody else
558− * ever touches our thread-synchronous status, so we don't
559− * have to worry about atomic accesses.
560− */
561−#define TS_COMPAT 0x0002 /* 32bit syscall active (64BIT)*/
562−
563554 static inline void
564555 native_load_sp0(unsigned long sp0)
565556 {
arch/x86/include/asm/thread_info.h+14−1
@@ -205,10 +205,23 @@ static inline int arch_within_stack_frames(const void * const stack, · 204 unmodified lines
205205
206206 #endif
207207
208+/*
209+ * Thread-synchronous status.
210+ *
211+ * This is different from the flags in that nobody else
212+ * ever touches our thread-synchronous status, so we don't
213+ * have to worry about atomic accesses.
214+ */
215+#define TS_COMPAT 0x0002 /* 32bit syscall active (64BIT)*/
216+
217+#ifndef __ASSEMBLY__
208218 #ifdef CONFIG_COMPAT
209219 #define TS_I386_REGS_POKED 0x0004 /* regs poked by 32-bit ptracer */
220+
221+#define arch_set_restart_data(restart) \
222+ do { restart->arch_data = current_thread_info()->status; } while (0)
223+
210224 #endif
211−#ifndef __ASSEMBLY__
212225
213226 #ifdef CONFIG_X86_32
214227 #define in_ia32_syscall() true
arch/x86/kernel/apic/apic.c+5−0
@@ -2342,6 +2342,11 @@ static int cpuid_to_apicid[] = { · 2341 unmodified lines
23422342 [0 ... NR_CPUS - 1] = -1,
23432343 };
23442344
2345+bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
2346+{
2347+ return phys_id == cpuid_to_apicid[cpu];
2348+}
2349+
23452350 #ifdef CONFIG_SMP
23462351 /**
23472352 * apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread
arch/x86/kernel/apic/io_apic.c+10−0
@@ -1032,6 +1032,16 @@ static int mp_map_pin_to_irq(u32 gsi, int idx, int ioapic, int pin, · 1031 unmodified lines
10321032 if (idx >= 0 && test_bit(mp_irqs[idx].srcbus, mp_bus_not_pci)) {
10331033 irq = mp_irqs[idx].srcbusirq;
10341034 legacy = mp_is_legacy_irq(irq);
1035+ /*
1036+ * IRQ2 is unusable for historical reasons on systems which
1037+ * have a legacy PIC. See the comment vs. IRQ2 further down.
1038+ *
1039+ * If this gets removed at some point then the related code
1040+ * in lapic_assign_system_vectors() needs to be adjusted as
1041+ * well.
1042+ */
1043+ if (legacy && irq == PIC_CASCADE_IR)
1044+ return -EINVAL;
10351045 }
10361046
10371047 mutex_lock(&ioapic_mutex);
arch/x86/kernel/kprobes/ftrace.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212
1313 #include "common.h"
1414
15−/* Ftrace callback handler for kprobes -- called under preepmt disabed */
15+/* Ftrace callback handler for kprobes -- called under preepmt disabled */
1616 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
1717 struct ftrace_ops *ops, struct ftrace_regs *fregs)
1818 {
arch/x86/kernel/kvm.c+10−13
@@ -836,28 +836,25 @@ static void kvm_kick_cpu(int cpu) · 835 unmodified lines
836836
837837 static void kvm_wait(u8 *ptr, u8 val)
838838 {
839− unsigned long flags;
840−
841839 if (in_nmi())
842840 return;
843841
844− local_irq_save(flags);
845−
846− if (READ_ONCE(*ptr) != val)
847− goto out;
848−
849842 /*
850843 * halt until it's our turn and kicked. Note that we do safe halt
851844 * for irq enabled case to avoid hang when lock info is overwritten
852845 * in irq spinlock slowpath and no spurious interrupt occur to save us.
853846 */
854− if (arch_irqs_disabled_flags(flags))
855− halt();
856− else
857− safe_halt();
847+ if (irqs_disabled()) {
848+ if (READ_ONCE(*ptr) == val)
849+ halt();
850+ } else {
851+ local_irq_disable();
858852
859−out:
860− local_irq_restore(flags);
853+ if (READ_ONCE(*ptr) == val)
854+ safe_halt();
855+
856+ local_irq_enable();
857+ }
861858 }
862859
863860 #ifdef CONFIG_X86_32
arch/x86/kernel/signal.c+1−23
@@ -766,30 +766,8 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 765 unmodified lines
766766
767767 static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)
768768 {
769− /*
770− * This function is fundamentally broken as currently
771− * implemented.
772− *
773− * The idea is that we want to trigger a call to the
774− * restart_block() syscall and that we want in_ia32_syscall(),
775− * in_x32_syscall(), etc. to match whatever they were in the
776− * syscall being restarted. We assume that the syscall
777− * instruction at (regs->ip - 2) matches whatever syscall
778− * instruction we used to enter in the first place.
779− *
780− * The problem is that we can get here when ptrace pokes
781− * syscall-like values into regs even if we're not in a syscall
782− * at all.
783− *
784− * For now, we maintain historical behavior and guess based on
785− * stored state. We could do better by saving the actual
786− * syscall arch in restart_block or (with caveats on x32) by
787− * checking if regs->ip points to 'int $0x80'. The current
788− * behavior is incorrect if a tracer has a different bitness
789− * than the tracee.
790− */
791769 #ifdef CONFIG_IA32_EMULATION
792− if (current_thread_info()->status & (TS_COMPAT|TS_I386_REGS_POKED))
770+ if (current->restart_block.arch_data & TS_COMPAT)
793771 return __NR_ia32_restart_syscall;
794772 #endif
795773 #ifdef CONFIG_X86_X32_ABI
arch/x86/kvm/hyperv.c+81−10
@@ -520,10 +520,10 @@ static u64 get_time_ref_counter(struct kvm *kvm) · 519 unmodified lines
520520 u64 tsc;
521521
522522 /*
523− * The guest has not set up the TSC page or the clock isn't
524− * stable, fall back to get_kvmclock_ns.
523+ * Fall back to get_kvmclock_ns() when TSC page hasn't been set up,
524+ * is broken, disabled or being updated.
525525 */
526− if (!hv->tsc_ref.tsc_sequence)
526+ if (hv->hv_tsc_page_status != HV_TSC_PAGE_SET)
527527 return div_u64(get_kvmclock_ns(kvm), 100);
528528
529529 vcpu = kvm_get_vcpu(kvm, 0);
@@ -1077,6 +1077,21 @@ static bool compute_tsc_page_parameters(struct pvclock_vcpu_time_info *hv_clock, · 547 unmodified lines
10771077 return true;
10781078 }
10791079
1080+/*
1081+ * Don't touch TSC page values if the guest has opted for TSC emulation after
1082+ * migration. KVM doesn't fully support reenlightenment notifications and TSC
1083+ * access emulation and Hyper-V is known to expect the values in TSC page to
1084+ * stay constant before TSC access emulation is disabled from guest side
1085+ * (HV_X64_MSR_TSC_EMULATION_STATUS). KVM userspace is expected to preserve TSC
1086+ * frequency and guest visible TSC value across migration (and prevent it when
1087+ * TSC scaling is unsupported).
1088+ */
1089+static inline bool tsc_page_update_unsafe(struct kvm_hv *hv)
1090+{
1091+ return (hv->hv_tsc_page_status != HV_TSC_PAGE_GUEST_CHANGED) &&
1092+ hv->hv_tsc_emulation_control;
1093+}
1094+
10801095 void kvm_hv_setup_tsc_page(struct kvm *kvm,
10811096 struct pvclock_vcpu_time_info *hv_clock)
10821097 {
@@ -1087,7 +1102,8 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 4 unmodified lines
10871102 BUILD_BUG_ON(sizeof(tsc_seq) != sizeof(hv->tsc_ref.tsc_sequence));
10881103 BUILD_BUG_ON(offsetof(struct ms_hyperv_tsc_page, tsc_sequence) != 0);
10891104
1090− if (!(hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE))
1105+ if (hv->hv_tsc_page_status == HV_TSC_PAGE_BROKEN ||
1106+ hv->hv_tsc_page_status == HV_TSC_PAGE_UNSET)
10911107 return;
10921108
10931109 mutex_lock(&hv->hv_lock);
@@ -1101,7 +1117,15 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 7 unmodified lines
11011117 */
11021118 if (unlikely(kvm_read_guest(kvm, gfn_to_gpa(gfn),
11031119 &tsc_seq, sizeof(tsc_seq))))
1120+ goto out_err;
1121+
1122+ if (tsc_seq && tsc_page_update_unsafe(hv)) {
1123+ if (kvm_read_guest(kvm, gfn_to_gpa(gfn), &hv->tsc_ref, sizeof(hv->tsc_ref)))
1124+ goto out_err;
1125+
1126+ hv->hv_tsc_page_status = HV_TSC_PAGE_SET;
11041127 goto out_unlock;
1128+ }
11051129
11061130 /*
11071131 * While we're computing and writing the parameters, force the
@@ -1110,15 +1134,15 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 2 unmodified lines
11101134 hv->tsc_ref.tsc_sequence = 0;
11111135 if (kvm_write_guest(kvm, gfn_to_gpa(gfn),
11121136 &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence)))
1113− goto out_unlock;
1137+ goto out_err;
11141138
11151139 if (!compute_tsc_page_parameters(hv_clock, &hv->tsc_ref))
1116− goto out_unlock;
1140+ goto out_err;
11171141
11181142 /* Ensure sequence is zero before writing the rest of the struct. */
11191143 smp_wmb();
11201144 if (kvm_write_guest(kvm, gfn_to_gpa(gfn), &hv->tsc_ref, sizeof(hv->tsc_ref)))
1121− goto out_unlock;
1145+ goto out_err;
11221146
11231147 /*
11241148 * Now switch to the TSC page mechanism by writing the sequence.
@@ -1131,8 +1155,45 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 6 unmodified lines
11311155 smp_wmb();
11321156
11331157 hv->tsc_ref.tsc_sequence = tsc_seq;
1134− kvm_write_guest(kvm, gfn_to_gpa(gfn),
1135− &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence));
1158+ if (kvm_write_guest(kvm, gfn_to_gpa(gfn),
1159+ &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence)))
1160+ goto out_err;
1161+
1162+ hv->hv_tsc_page_status = HV_TSC_PAGE_SET;
1163+ goto out_unlock;
1164+
1165+out_err:
1166+ hv->hv_tsc_page_status = HV_TSC_PAGE_BROKEN;
1167+out_unlock:
1168+ mutex_unlock(&hv->hv_lock);
1169+}
1170+
1171+void kvm_hv_invalidate_tsc_page(struct kvm *kvm)
1172+{
1173+ struct kvm_hv *hv = to_kvm_hv(kvm);
1174+ u64 gfn;
1175+
1176+ if (hv->hv_tsc_page_status == HV_TSC_PAGE_BROKEN ||
1177+ hv->hv_tsc_page_status == HV_TSC_PAGE_UNSET ||
1178+ tsc_page_update_unsafe(hv))
1179+ return;
1180+
1181+ mutex_lock(&hv->hv_lock);
1182+
1183+ if (!(hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE))
1184+ goto out_unlock;
1185+
1186+ /* Preserve HV_TSC_PAGE_GUEST_CHANGED/HV_TSC_PAGE_HOST_CHANGED states */
1187+ if (hv->hv_tsc_page_status == HV_TSC_PAGE_SET)
1188+ hv->hv_tsc_page_status = HV_TSC_PAGE_UPDATING;
1189+
1190+ gfn = hv->hv_tsc_page >> HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT;
1191+
1192+ hv->tsc_ref.tsc_sequence = 0;
1193+ if (kvm_write_guest(kvm, gfn_to_gpa(gfn),
1194+ &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence)))
1195+ hv->hv_tsc_page_status = HV_TSC_PAGE_BROKEN;
1196+
11361197 out_unlock:
11371198 mutex_unlock(&hv->hv_lock);
11381199 }
@@ -1193,8 +1254,15 @@ static int kvm_hv_set_msr_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data, · 54 unmodified lines
11931254 }
11941255 case HV_X64_MSR_REFERENCE_TSC:
11951256 hv->hv_tsc_page = data;
1196− if (hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE)
1257+ if (hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE) {
1258+ if (!host)
1259+ hv->hv_tsc_page_status = HV_TSC_PAGE_GUEST_CHANGED;
1260+ else
1261+ hv->hv_tsc_page_status = HV_TSC_PAGE_HOST_CHANGED;
11971262 kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);
1263+ } else {
1264+ hv->hv_tsc_page_status = HV_TSC_PAGE_UNSET;
1265+ }
11981266 break;
11991267 case HV_X64_MSR_CRASH_P0 ... HV_X64_MSR_CRASH_P4:
12001268 return kvm_hv_msr_set_crash_data(kvm,
@@ -1229,6 +1297,9 @@ static int kvm_hv_set_msr_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data, · 28 unmodified lines
12291297 hv->hv_tsc_emulation_control = data;
12301298 break;
12311299 case HV_X64_MSR_TSC_EMULATION_STATUS:
1300+ if (data && !host)
1301+ return 1;
1302+
12321303 hv->hv_tsc_emulation_status = data;
12331304 break;
12341305 case HV_X64_MSR_TIME_REF_COUNT:
arch/x86/kvm/hyperv.h+1−0
@@ -133,6 +133,7 @@ void kvm_hv_process_stimers(struct kvm_vcpu *vcpu); · 132 unmodified lines
133133
134134 void kvm_hv_setup_tsc_page(struct kvm *kvm,
135135 struct pvclock_vcpu_time_info *hv_clock);
136+void kvm_hv_invalidate_tsc_page(struct kvm *kvm);
136137
137138 void kvm_hv_init_vm(struct kvm *kvm);
138139 void kvm_hv_destroy_vm(struct kvm *kvm);
arch/x86/kvm/mmu/mmu_internal.h+5−0
@@ -78,6 +78,11 @@ static inline struct kvm_mmu_page *sptep_to_sp(u64 *sptep) · 77 unmodified lines
7878 return to_shadow_page(__pa(sptep));
7979 }
8080
81+static inline int kvm_mmu_page_as_id(struct kvm_mmu_page *sp)
82+{
83+ return sp->role.smm ? 1 : 0;
84+}
85+
8186 static inline bool kvm_vcpu_ad_need_write_protect(struct kvm_vcpu *vcpu)
8287 {
8388 /*
arch/x86/kvm/mmu/tdp_iter.c+18−12
@@ -20,6 +20,21 @@ static gfn_t round_gfn_for_level(gfn_t gfn, int level) · 19 unmodified lines
2020 return gfn & -KVM_PAGES_PER_HPAGE(level);
2121 }
2222
23+/*
24+ * Return the TDP iterator to the root PT and allow it to continue its
25+ * traversal over the paging structure from there.
26+ */
27+void tdp_iter_restart(struct tdp_iter *iter)
28+{
29+ iter->yielded_gfn = iter->next_last_level_gfn;
30+ iter->level = iter->root_level;
31+
32+ iter->gfn = round_gfn_for_level(iter->next_last_level_gfn, iter->level);
33+ tdp_iter_refresh_sptep(iter);
34+
35+ iter->valid = true;
36+}
37+
2338 /*
2439 * Sets a TDP iterator to walk a pre-order traversal of the paging structure
2540 * rooted at root_pt, starting with the walk to translate next_last_level_gfn.
@@ -31,16 +46,12 @@ void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level, · 5 unmodified lines
3146 WARN_ON(root_level > PT64_ROOT_MAX_LEVEL);
3247
3348 iter->next_last_level_gfn = next_last_level_gfn;
34− iter->yielded_gfn = iter->next_last_level_gfn;
3549 iter->root_level = root_level;
3650 iter->min_level = min_level;
37− iter->level = root_level;
38− iter->pt_path[iter->level - 1] = (tdp_ptep_t)root_pt;
39−
40− iter->gfn = round_gfn_for_level(iter->next_last_level_gfn, iter->level);
41− tdp_iter_refresh_sptep(iter);
51+ iter->pt_path[iter->root_level - 1] = (tdp_ptep_t)root_pt;
52+ iter->as_id = kvm_mmu_page_as_id(sptep_to_sp(root_pt));
4253
43− iter->valid = true;
54+ tdp_iter_restart(iter);
4455 }
4556
4657 /*
@@ -159,8 +170,3 @@ void tdp_iter_next(struct tdp_iter *iter) · 112 unmodified lines
159170 iter->valid = false;
160171 }
161172
162−tdp_ptep_t tdp_iter_root_pt(struct tdp_iter *iter)
163−{
164− return iter->pt_path[iter->root_level - 1];
165−}
166−
arch/x86/kvm/mmu/tdp_iter.h+3−1
@@ -36,6 +36,8 @@ struct tdp_iter { · 35 unmodified lines
3636 int min_level;
3737 /* The iterator's current level within the paging structure */
3838 int level;
39+ /* The address space ID, i.e. SMM vs. regular. */
40+ int as_id;
3941 /* A snapshot of the value at sptep */
4042 u64 old_spte;
4143 /*
@@ -62,6 +64,6 @@ tdp_ptep_t spte_to_child_pt(u64 pte, int level); · 20 unmodified lines
6264 void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level,
6365 int min_level, gfn_t next_last_level_gfn);
6466 void tdp_iter_next(struct tdp_iter *iter);
65−tdp_ptep_t tdp_iter_root_pt(struct tdp_iter *iter);
67+void tdp_iter_restart(struct tdp_iter *iter);
6668
6769 #endif /* __KVM_X86_MMU_TDP_ITER_H */
arch/x86/kvm/mmu/tdp_mmu.c+15−25
@@ -203,11 +203,6 @@ static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn, · 202 unmodified lines
203203 u64 old_spte, u64 new_spte, int level,
204204 bool shared);
205205
206−static int kvm_mmu_page_as_id(struct kvm_mmu_page *sp)
207−{
208− return sp->role.smm ? 1 : 0;
209−}
210−
211206 static void handle_changed_spte_acc_track(u64 old_spte, u64 new_spte, int level)
212207 {
213208 bool pfn_changed = spte_to_pfn(old_spte) != spte_to_pfn(new_spte);
@@ -301,11 +296,16 @@ static void tdp_mmu_unlink_page(struct kvm *kvm, struct kvm_mmu_page *sp, · 87 unmodified lines
301296 *
302297 * Given a page table that has been removed from the TDP paging structure,
303298 * iterates through the page table to clear SPTEs and free child page tables.
299+ *
300+ * Note that pt is passed in as a tdp_ptep_t, but it does not need RCU
301+ * protection. Since this thread removed it from the paging structure,
302+ * this thread will be responsible for ensuring the page is freed. Hence the
303+ * early rcu_dereferences in the function.
304304 */
305−static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt,
305+static void handle_removed_tdp_mmu_page(struct kvm *kvm, tdp_ptep_t pt,
306306 bool shared)
307307 {
308− struct kvm_mmu_page *sp = sptep_to_sp(pt);
308+ struct kvm_mmu_page *sp = sptep_to_sp(rcu_dereference(pt));
309309 int level = sp->role.level;
310310 gfn_t base_gfn = sp->gfn;
311311 u64 old_child_spte;
@@ -318,7 +318,7 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt, · 6 unmodified lines
318318 tdp_mmu_unlink_page(kvm, sp, shared);
319319
320320 for (i = 0; i < PT64_ENT_PER_PAGE; i++) {
321− sptep = pt + i;
321+ sptep = rcu_dereference(pt) + i;
322322 gfn = base_gfn + (i * KVM_PAGES_PER_HPAGE(level - 1));
323323
324324 if (shared) {
@@ -492,10 +492,6 @@ static inline bool tdp_mmu_set_spte_atomic(struct kvm *kvm, · 167 unmodified lines
492492 struct tdp_iter *iter,
493493 u64 new_spte)
494494 {
495− u64 *root_pt = tdp_iter_root_pt(iter);
496− struct kvm_mmu_page *root = sptep_to_sp(root_pt);
497− int as_id = kvm_mmu_page_as_id(root);
498−
499495 lockdep_assert_held_read(&kvm->mmu_lock);
500496
501497 /*
@@ -509,8 +505,8 @@ static inline bool tdp_mmu_set_spte_atomic(struct kvm *kvm, · 7 unmodified lines
509505 new_spte) != iter->old_spte)
510506 return false;
511507
512− handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte,
513− iter->level, true);
508+ handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte,
509+ new_spte, iter->level, true);
514510
515511 return true;
516512 }
@@ -538,7 +534,7 @@ static inline bool tdp_mmu_zap_spte_atomic(struct kvm *kvm, · 21 unmodified lines
538534 * here since the SPTE is going from non-present
539535 * to non-present.
540536 */
541− WRITE_ONCE(*iter->sptep, 0);
537+ WRITE_ONCE(*rcu_dereference(iter->sptep), 0);
542538
543539 return true;
544540 }
@@ -564,10 +560,6 @@ static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter, · 19 unmodified lines
564560 u64 new_spte, bool record_acc_track,
565561 bool record_dirty_log)
566562 {
567− tdp_ptep_t root_pt = tdp_iter_root_pt(iter);
568− struct kvm_mmu_page *root = sptep_to_sp(root_pt);
569− int as_id = kvm_mmu_page_as_id(root);
570−
571563 lockdep_assert_held_write(&kvm->mmu_lock);
572564
573565 /*
@@ -581,13 +573,13 @@ static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter, · 7 unmodified lines
581573
582574 WRITE_ONCE(*rcu_dereference(iter->sptep), new_spte);
583575
584− __handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte,
585− iter->level, false);
576+ __handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte,
577+ new_spte, iter->level, false);
586578 if (record_acc_track)
587579 handle_changed_spte_acc_track(iter->old_spte, new_spte,
588580 iter->level);
589581 if (record_dirty_log)
590− handle_changed_spte_dirty_log(kvm, as_id, iter->gfn,
582+ handle_changed_spte_dirty_log(kvm, iter->as_id, iter->gfn,
591583 iter->old_spte, new_spte,
592584 iter->level);
593585 }
@@ -659,9 +651,7 @@ static inline bool tdp_mmu_iter_cond_resched(struct kvm *kvm, · 65 unmodified lines
659651
660652 WARN_ON(iter->gfn > iter->next_last_level_gfn);
661653
662− tdp_iter_start(iter, iter->pt_path[iter->root_level - 1],
663− iter->root_level, iter->min_level,
664− iter->next_last_level_gfn);
654+ tdp_iter_restart(iter);
665655
666656 return true;
667657 }
arch/x86/kvm/x86.c+68−45
@@ -1526,35 +1526,44 @@ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits); · 1525 unmodified lines
15261526
15271527 bool kvm_msr_allowed(struct kvm_vcpu *vcpu, u32 index, u32 type)
15281528 {
1529+ struct kvm_x86_msr_filter *msr_filter;
1530+ struct msr_bitmap_range *ranges;
15291531 struct kvm *kvm = vcpu->kvm;
1530− struct msr_bitmap_range *ranges = kvm->arch.msr_filter.ranges;
1531− u32 count = kvm->arch.msr_filter.count;
1532− u32 i;
1533− bool r = kvm->arch.msr_filter.default_allow;
1532+ bool allowed;
15341533 int idx;
1534+ u32 i;
15351535
1536− /* MSR filtering not set up or x2APIC enabled, allow everything */
1537− if (!count || (index >= 0x800 && index <= 0x8ff))
1536+ /* x2APIC MSRs do not support filtering. */
1537+ if (index >= 0x800 && index <= 0x8ff)
15381538 return true;
15391539
1540− /* Prevent collision with set_msr_filter */
15411540 idx = srcu_read_lock(&kvm->srcu);
15421541
1543− for (i = 0; i < count; i++) {
1542+ msr_filter = srcu_dereference(kvm->arch.msr_filter, &kvm->srcu);
1543+ if (!msr_filter) {
1544+ allowed = true;
1545+ goto out;
1546+ }
1547+
1548+ allowed = msr_filter->default_allow;
1549+ ranges = msr_filter->ranges;
1550+
1551+ for (i = 0; i < msr_filter->count; i++) {
15441552 u32 start = ranges[i].base;
15451553 u32 end = start + ranges[i].nmsrs;
15461554 u32 flags = ranges[i].flags;
15471555 unsigned long *bitmap = ranges[i].bitmap;
15481556
15491557 if ((index >= start) && (index < end) && (flags & type)) {
1550− r = !!test_bit(index - start, bitmap);
1558+ allowed = !!test_bit(index - start, bitmap);
15511559 break;
15521560 }
15531561 }
15541562
1563+out:
15551564 srcu_read_unlock(&kvm->srcu, idx);
15561565
1557− return r;
1566+ return allowed;
15581567 }
15591568 EXPORT_SYMBOL_GPL(kvm_msr_allowed);
15601569
@@ -2551,6 +2560,8 @@ static void kvm_gen_update_masterclock(struct kvm *kvm) · 990 unmodified lines
25512560 struct kvm_vcpu *vcpu;
25522561 struct kvm_arch *ka = &kvm->arch;
25532562
2563+ kvm_hv_invalidate_tsc_page(kvm);
2564+
25542565 spin_lock(&ka->pvclock_gtod_sync_lock);
25552566 kvm_make_mclock_inprogress_request(kvm);
25562567 /* no guest entries from this point */
@@ -5352,25 +5363,34 @@ split_irqchip_unlock: · 2795 unmodified lines
53525363 return r;
53535364 }
53545365
5355−static void kvm_clear_msr_filter(struct kvm *kvm)
5366+static struct kvm_x86_msr_filter *kvm_alloc_msr_filter(bool default_allow)
5367+{
5368+ struct kvm_x86_msr_filter *msr_filter;
5369+
5370+ msr_filter = kzalloc(sizeof(*msr_filter), GFP_KERNEL_ACCOUNT);
5371+ if (!msr_filter)
5372+ return NULL;
5373+
5374+ msr_filter->default_allow = default_allow;
5375+ return msr_filter;
5376+}
5377+
5378+static void kvm_free_msr_filter(struct kvm_x86_msr_filter *msr_filter)
53565379 {
53575380 u32 i;
5358− u32 count = kvm->arch.msr_filter.count;
5359− struct msr_bitmap_range ranges[16];
53605381
5361− mutex_lock(&kvm->lock);
5362− kvm->arch.msr_filter.count = 0;
5363− memcpy(ranges, kvm->arch.msr_filter.ranges, count * sizeof(ranges[0]));
5364− mutex_unlock(&kvm->lock);
5365− synchronize_srcu(&kvm->srcu);
5382+ if (!msr_filter)
5383+ return;
53665384
5367− for (i = 0; i < count; i++)
5368− kfree(ranges[i].bitmap);
5385+ for (i = 0; i < msr_filter->count; i++)
5386+ kfree(msr_filter->ranges[i].bitmap);
5387+
5388+ kfree(msr_filter);
53695389 }
53705390
5371−static int kvm_add_msr_filter(struct kvm *kvm, struct kvm_msr_filter_range *user_range)
5391+static int kvm_add_msr_filter(struct kvm_x86_msr_filter *msr_filter,
5392+ struct kvm_msr_filter_range *user_range)
53725393 {
5373− struct msr_bitmap_range *ranges = kvm->arch.msr_filter.ranges;
53745394 struct msr_bitmap_range range;
53755395 unsigned long *bitmap = NULL;
53765396 size_t bitmap_size;
@@ -5404,11 +5424,9 @@ static int kvm_add_msr_filter(struct kvm *kvm, struct kvm_msr_filter_range *user · 27 unmodified lines
54045424 goto err;
54055425 }
54065426
5407− /* Everything ok, add this range identifier to our global pool */
5408− ranges[kvm->arch.msr_filter.count] = range;
5409− /* Make sure we filled the array before we tell anyone to walk it */
5410− smp_wmb();
5411− kvm->arch.msr_filter.count++;
5427+ /* Everything ok, add this range identifier. */
5428+ msr_filter->ranges[msr_filter->count] = range;
5429+ msr_filter->count++;
54125430
54135431 return 0;
54145432 err:
@@ -5419,10 +5437,11 @@ err: · 4 unmodified lines
54195437 static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp)
54205438 {
54215439 struct kvm_msr_filter __user *user_msr_filter = argp;
5440+ struct kvm_x86_msr_filter *new_filter, *old_filter;
54225441 struct kvm_msr_filter filter;
54235442 bool default_allow;
5424− int r = 0;
54255443 bool empty = true;
5444+ int r = 0;
54265445 u32 i;
54275446
54285447 if (copy_from_user(&filter, user_msr_filter, sizeof(filter)))
@@ -5435,25 +5454,32 @@ static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp) · 6 unmodified lines
54355454 if (empty && !default_allow)
54365455 return -EINVAL;
54375456
5438− kvm_clear_msr_filter(kvm);
5439−
5440− kvm->arch.msr_filter.default_allow = default_allow;
5457+ new_filter = kvm_alloc_msr_filter(default_allow);
5458+ if (!new_filter)
5459+ return -ENOMEM;
54415460
5442− /*
5443− * Protect from concurrent calls to this function that could trigger
5444− * a TOCTOU violation on kvm->arch.msr_filter.count.
5445− */
5446− mutex_lock(&kvm->lock);
54475461 for (i = 0; i < ARRAY_SIZE(filter.ranges); i++) {
5448− r = kvm_add_msr_filter(kvm, &filter.ranges[i]);
5449− if (r)
5450− break;
5462+ r = kvm_add_msr_filter(new_filter, &filter.ranges[i]);
5463+ if (r) {
5464+ kvm_free_msr_filter(new_filter);
5465+ return r;
5466+ }
54515467 }
54525468
5469+ mutex_lock(&kvm->lock);
5470+
5471+ /* The per-VM filter is protected by kvm->lock... */
5472+ old_filter = srcu_dereference_check(kvm->arch.msr_filter, &kvm->srcu, 1);
5473+
5474+ rcu_assign_pointer(kvm->arch.msr_filter, new_filter);
5475+ synchronize_srcu(&kvm->srcu);
5476+
5477+ kvm_free_msr_filter(old_filter);
5478+
54535479 kvm_make_all_cpus_request(kvm, KVM_REQ_MSR_FILTER_CHANGED);
54545480 mutex_unlock(&kvm->lock);
54555481
5456− return r;
5482+ return 0;
54575483 }
54585484
54595485 long kvm_arch_vm_ioctl(struct file *filp,
@@ -6603,7 +6629,7 @@ static int kvm_emulate_wbinvd_noskip(struct kvm_vcpu *vcpu) · 1143 unmodified lines
66036629 int cpu = get_cpu();
66046630
66056631 cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask);
6606− smp_call_function_many(vcpu->arch.wbinvd_dirty_mask,
6632+ on_each_cpu_mask(vcpu->arch.wbinvd_dirty_mask,
66076633 wbinvd_ipi, NULL, 1);
66086634 put_cpu();
66096635 cpumask_clear(vcpu->arch.wbinvd_dirty_mask);
@@ -10634,8 +10660,6 @@ void kvm_arch_pre_destroy_vm(struct kvm *kvm) · 4024 unmodified lines
1063410660
1063510661 void kvm_arch_destroy_vm(struct kvm *kvm)
1063610662 {
10637− u32 i;
10638−
1063910663 if (current->mm == kvm->mm) {
1064010664 /*
1064110665 * Free memory regions allocated on behalf of userspace,
@@ -10651,8 +10675,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) · 9 unmodified lines
1065110675 mutex_unlock(&kvm->slots_lock);
1065210676 }
1065310677 static_call_cond(kvm_x86_vm_destroy)(kvm);
10654− for (i = 0; i < kvm->arch.msr_filter.count; i++)
10655− kfree(kvm->arch.msr_filter.ranges[i].bitmap);
10678+ kvm_free_msr_filter(srcu_dereference_check(kvm->arch.msr_filter, &kvm->srcu, 1));
1065610679 kvm_pic_destroy(kvm);
1065710680 kvm_ioapic_destroy(kvm);
1065810681 kvm_free_vcpus(kvm);
arch/x86/platform/iris/iris.c+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 MODULE_LICENSE("GPL");
2828 MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>");
2929 MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille");
30−MODULE_SUPPORTED_DEVICE("Eurobraille/Iris");
3130
3231 static bool force;
3332
drivers/atm/fore200e.c+0−2
@@ -100,8 +100,6 @@ static LIST_HEAD(fore200e_boards); · 99 unmodified lines
100100
101101 MODULE_AUTHOR("Christophe Lizzi - credits to Uwe Dannowski and Heikki Vatiainen");
102102 MODULE_DESCRIPTION("FORE Systems 200E-series ATM driver - version " FORE200E_VERSION);
103−MODULE_SUPPORTED_DEVICE("PCA-200E, SBA-200E");
104−
105103
106104 static const int fore200e_rx_buf_nbr[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ] = {
107105 { BUFFER_S1_NBR, BUFFER_L1_NBR },
drivers/base/power/runtime.c+25−37
@@ -325,22 +325,22 @@ static void rpm_put_suppliers(struct device *dev) · 324 unmodified lines
325325 static int __rpm_callback(int (*cb)(struct device *), struct device *dev)
326326 __releases(&dev->power.lock) __acquires(&dev->power.lock)
327327 {
328− bool use_links = dev->power.links_count > 0;
329− bool get = false;
330328 int retval, idx;
331− bool put;
329+ bool use_links = dev->power.links_count > 0;
332330
333331 if (dev->power.irq_safe) {
334332 spin_unlock(&dev->power.lock);
335− } else if (!use_links) {
336− spin_unlock_irq(&dev->power.lock);
337333 } else {
338− get = dev->power.runtime_status == RPM_RESUMING;
339−
340334 spin_unlock_irq(&dev->power.lock);
341335
342− /* Resume suppliers if necessary. */
343− if (get) {
336+ /*
337+ * Resume suppliers if necessary.
338+ *
339+ * The device's runtime PM status cannot change until this
340+ * routine returns, so it is safe to read the status outside of
341+ * the lock.
342+ */
343+ if (use_links && dev->power.runtime_status == RPM_RESUMING) {
344344 idx = device_links_read_lock();
345345
346346 retval = rpm_get_suppliers(dev);
@@ -355,36 +355,24 @@ static int __rpm_callback(int (*cb)(struct device *), struct device *dev) · 8 unmodified lines
355355
356356 if (dev->power.irq_safe) {
357357 spin_lock(&dev->power.lock);
358− return retval;
359− }
360−
361− spin_lock_irq(&dev->power.lock);
362−
363− if (!use_links)
364− return retval;
365−
366− /*
367− * If the device is suspending and the callback has returned success,
368− * drop the usage counters of the suppliers that have been reference
369− * counted on its resume.
370− *
371− * Do that if the resume fails too.
372− */
373− put = dev->power.runtime_status == RPM_SUSPENDING && !retval;
374− if (put)
375− __update_runtime_status(dev, RPM_SUSPENDED);
376− else
377− put = get && retval;
378−
379− if (put) {
380− spin_unlock_irq(&dev->power.lock);
381−
382− idx = device_links_read_lock();
358+ } else {
359+ /*
360+ * If the device is suspending and the callback has returned
361+ * success, drop the usage counters of the suppliers that have
362+ * been reference counted on its resume.
363+ *
364+ * Do that if resume fails too.
365+ */
366+ if (use_links
367+ && ((dev->power.runtime_status == RPM_SUSPENDING && !retval)
368+ || (dev->power.runtime_status == RPM_RESUMING && retval))) {
369+ idx = device_links_read_lock();
383370
384−fail:
385− rpm_put_suppliers(dev);
371+ fail:
372+ rpm_put_suppliers(dev);
386373
387− device_links_read_unlock(idx);
374+ device_links_read_unlock(idx);
375+ }
388376
389377 spin_lock_irq(&dev->power.lock);
390378 }
drivers/block/floppy.c+0−1
@@ -5091,7 +5091,6 @@ module_param(floppy, charp, 0); · 5090 unmodified lines
50915091 module_param(FLOPPY_IRQ, int, 0);
50925092 module_param(FLOPPY_DMA, int, 0);
50935093 MODULE_AUTHOR("Alain L. Knaff");
5094−MODULE_SUPPORTED_DEVICE("fd");
50955094 MODULE_LICENSE("GPL");
50965095
50975096 /* This doesn't actually get used other than for module information */
drivers/bluetooth/btrsi.c+0−1
@@ -194,5 +194,4 @@ module_init(rsi_91x_bt_module_init); · 193 unmodified lines
194194 module_exit(rsi_91x_bt_module_exit);
195195 MODULE_AUTHOR("Redpine Signals Inc");
196196 MODULE_DESCRIPTION("RSI BT driver");
197−MODULE_SUPPORTED_DEVICE("RSI-BT");
198197 MODULE_LICENSE("Dual BSD/GPL");
drivers/char/applicom.c+0−3
@@ -81,9 +81,6 @@ MODULE_DESCRIPTION("Driver for Applicom Profibus card"); · 80 unmodified lines
8181 MODULE_LICENSE("GPL");
8282 MODULE_ALIAS_MISCDEV(AC_MINOR);
8383
84−MODULE_SUPPORTED_DEVICE("ac");
85−
86−
8784 static struct applicom_board {
8885 unsigned long PhysIO;
8986 void __iomem *RamIO;
drivers/char/toshiba.c+0−1
@@ -64,7 +64,6 @@ · 63 unmodified lines
6464 MODULE_LICENSE("GPL");
6565 MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>");
6666 MODULE_DESCRIPTION("Toshiba laptop SMM driver");
67−MODULE_SUPPORTED_DEVICE("toshiba");
6867
6968 static DEFINE_MUTEX(tosh_mutex);
7069 static int tosh_fn;
drivers/counter/stm32-timer-cnt.c+33−22
@@ -31,7 +31,7 @@ struct stm32_timer_cnt { · 30 unmodified lines
3131 struct counter_device counter;
3232 struct regmap *regmap;
3333 struct clk *clk;
34− u32 ceiling;
34+ u32 max_arr;
3535 bool enabled;
3636 struct stm32_timer_regs bak;
3737 };
@@ -44,13 +44,14 @@ struct stm32_timer_cnt { · 6 unmodified lines
4444 * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges
4545 */
4646 enum stm32_count_function {
47− STM32_COUNT_SLAVE_MODE_DISABLED = -1,
47+ STM32_COUNT_SLAVE_MODE_DISABLED,
4848 STM32_COUNT_ENCODER_MODE_1,
4949 STM32_COUNT_ENCODER_MODE_2,
5050 STM32_COUNT_ENCODER_MODE_3,
5151 };
5252
5353 static enum counter_count_function stm32_count_functions[] = {
54+ [STM32_COUNT_SLAVE_MODE_DISABLED] = COUNTER_COUNT_FUNCTION_INCREASE,
5455 [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A,
5556 [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B,
5657 [STM32_COUNT_ENCODER_MODE_3] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4,
@@ -73,8 +74,10 @@ static int stm32_count_write(struct counter_device *counter, · 16 unmodified lines
7374 const unsigned long val)
7475 {
7576 struct stm32_timer_cnt *const priv = counter->priv;
77+ u32 ceiling;
7678
77− if (val > priv->ceiling)
79+ regmap_read(priv->regmap, TIM_ARR, &ceiling);
80+ if (val > ceiling)
7881 return -EINVAL;
7982
8083 return regmap_write(priv->regmap, TIM_CNT, val);
@@ -90,6 +93,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 9 unmodified lines
9093 regmap_read(priv->regmap, TIM_SMCR, &smcr);
9194
9295 switch (smcr & TIM_SMCR_SMS) {
96+ case 0:
97+ *function = STM32_COUNT_SLAVE_MODE_DISABLED;
98+ return 0;
9399 case 1:
94100 *function = STM32_COUNT_ENCODER_MODE_1;
95101 return 0;
@@ -99,9 +105,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 3 unmodified lines
99105 case 3:
100106 *function = STM32_COUNT_ENCODER_MODE_3;
101107 return 0;
108+ default:
109+ return -EINVAL;
102110 }
103−
104− return -EINVAL;
105111 }
106112
107113 static int stm32_count_function_set(struct counter_device *counter,
@@ -112,6 +118,9 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines
112118 u32 cr1, sms;
113119
114120 switch (function) {
121+ case STM32_COUNT_SLAVE_MODE_DISABLED:
122+ sms = 0;
123+ break;
115124 case STM32_COUNT_ENCODER_MODE_1:
116125 sms = 1;
117126 break;
@@ -122,8 +131,7 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines
122131 sms = 3;
123132 break;
124133 default:
125− sms = 0;
126− break;
134+ return -EINVAL;
127135 }
128136
129137 /* Store enable status */
@@ -131,10 +139,6 @@ static int stm32_count_function_set(struct counter_device *counter, · 1 unmodified line
131139
132140 regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0);
133141
134− /* TIMx_ARR register shouldn't be buffered (ARPE=0) */
135− regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0);
136− regmap_write(priv->regmap, TIM_ARR, priv->ceiling);
137−
138142 regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms);
139143
140144 /* Make sure that registers are updated */
@@ -185,11 +189,13 @@ static ssize_t stm32_count_ceiling_write(struct counter_device *counter, · 44 unmodified lines
185189 if (ret)
186190 return ret;
187191
192+ if (ceiling > priv->max_arr)
193+ return -ERANGE;
194+
188195 /* TIMx_ARR register shouldn't be buffered (ARPE=0) */
189196 regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0);
190197 regmap_write(priv->regmap, TIM_ARR, ceiling);
191198
192− priv->ceiling = ceiling;
193199 return len;
194200 }
195201
@@ -274,31 +280,36 @@ static int stm32_action_get(struct counter_device *counter, · 78 unmodified lines
274280 size_t function;
275281 int err;
276282
277− /* Default action mode (e.g. STM32_COUNT_SLAVE_MODE_DISABLED) */
278− *action = STM32_SYNAPSE_ACTION_NONE;
279−
280283 err = stm32_count_function_get(counter, count, &function);
281284 if (err)
282− return 0;
285+ return err;
283286
284287 switch (function) {
288+ case STM32_COUNT_SLAVE_MODE_DISABLED:
289+ /* counts on internal clock when CEN=1 */
290+ *action = STM32_SYNAPSE_ACTION_NONE;
291+ return 0;
285292 case STM32_COUNT_ENCODER_MODE_1:
286293 /* counts up/down on TI1FP1 edge depending on TI2FP2 level */
287294 if (synapse->signal->id == count->synapses[0].signal->id)
288295 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;
289− break;
296+ else
297+ *action = STM32_SYNAPSE_ACTION_NONE;
298+ return 0;
290299 case STM32_COUNT_ENCODER_MODE_2:
291300 /* counts up/down on TI2FP2 edge depending on TI1FP1 level */
292301 if (synapse->signal->id == count->synapses[1].signal->id)
293302 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;
294− break;
303+ else
304+ *action = STM32_SYNAPSE_ACTION_NONE;
305+ return 0;
295306 case STM32_COUNT_ENCODER_MODE_3:
296307 /* counts up/down on both TI1FP1 and TI2FP2 edges */
297308 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;
298− break;
309+ return 0;
310+ default:
311+ return -EINVAL;
299312 }
300−
301− return 0;
302313 }
303314
304315 static const struct counter_ops stm32_timer_cnt_ops = {
@@ -359,7 +370,7 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev) · 54 unmodified lines
359370
360371 priv->regmap = ddata->regmap;
361372 priv->clk = ddata->clk;
362− priv->ceiling = ddata->max_arr;
373+ priv->max_arr = ddata->max_arr;
363374
364375 priv->counter.name = dev_name(dev);
365376 priv->counter.parent = dev;
drivers/firmware/efi/efi.c+2−1
@@ -927,7 +927,7 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size) · 926 unmodified lines
927927 }
928928
929929 /* first try to find a slot in an existing linked list entry */
930− for (prsv = efi_memreserve_root->next; prsv; prsv = rsv->next) {
930+ for (prsv = efi_memreserve_root->next; prsv; ) {
931931 rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB);
932932 index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size);
933933 if (index < rsv->size) {
@@ -937,6 +937,7 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size) · 3 unmodified lines
937937 memunmap(rsv);
938938 return efi_mem_reserve_iomem(addr, size);
939939 }
940+ prsv = rsv->next;
940941 memunmap(rsv);
941942 }
942943
drivers/firmware/efi/vars.c+4−0
@@ -484,6 +484,10 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *), · 483 unmodified lines
484484 }
485485 }
486486
487+ break;
488+ case EFI_UNSUPPORTED:
489+ err = -EOPNOTSUPP;
490+ status = EFI_NOT_FOUND;
487491 break;
488492 case EFI_NOT_FOUND:
489493 break;
drivers/gpio/gpiolib.c+9−1
@@ -571,6 +571,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 570 unmodified lines
571571 struct lock_class_key *lock_key,
572572 struct lock_class_key *request_key)
573573 {
574+ struct fwnode_handle *fwnode = gc->parent ? dev_fwnode(gc->parent) : NULL;
574575 unsigned long flags;
575576 int ret = 0;
576577 unsigned i;
@@ -594,6 +595,12 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 17 unmodified lines
594595
595596 of_gpio_dev_init(gc, gdev);
596597
598+ /*
599+ * Assign fwnode depending on the result of the previous calls,
600+ * if none of them succeed, assign it to the parent's one.
601+ */
602+ gdev->dev.fwnode = dev_fwnode(&gdev->dev) ?: fwnode;
603+
597604 gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL);
598605 if (gdev->id < 0) {
599606 ret = gdev->id;
@@ -4256,7 +4263,8 @@ static int __init gpiolib_dev_init(void) · 3656 unmodified lines
42564263 return ret;
42574264 }
42584265
4259− if (driver_register(&gpio_stub_drv) < 0) {
4266+ ret = driver_register(&gpio_stub_drv);
4267+ if (ret < 0) {
42604268 pr_err("gpiolib: could not register GPIO stub driver\n");
42614269 bus_unregister(&gpio_bus_type);
42624270 return ret;
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c+2−32
@@ -1507,38 +1507,8 @@ static void dcn20_update_dchubp_dpp( · 1506 unmodified lines
15071507 if (pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed
15081508 || pipe_ctx->stream->update_flags.bits.gamut_remap
15091509 || pipe_ctx->stream->update_flags.bits.out_csc) {
1510− struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc;
1511−
1512− if (mpc->funcs->set_gamut_remap) {
1513− int i;
1514− int mpcc_id = hubp->inst;
1515− struct mpc_grph_gamut_adjustment adjust;
1516− bool enable_remap_dpp = false;
1517−
1518− memset(&adjust, 0, sizeof(adjust));
1519− adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
1520−
1521− /* save the enablement of gamut remap for dpp */
1522− enable_remap_dpp = pipe_ctx->stream->gamut_remap_matrix.enable_remap;
1523−
1524− /* force bypass gamut remap for dpp/cm */
1525− pipe_ctx->stream->gamut_remap_matrix.enable_remap = false;
1526− dc->hwss.program_gamut_remap(pipe_ctx);
1527−
1528− /* restore gamut remap flag and use this remap into mpc */
1529− pipe_ctx->stream->gamut_remap_matrix.enable_remap = enable_remap_dpp;
1530−
1531− /* build remap matrix for top plane if enabled */
1532− if (enable_remap_dpp && pipe_ctx->top_pipe == NULL) {
1533− adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
1534− for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++)
1535− adjust.temperature_matrix[i] =
1536− pipe_ctx->stream->gamut_remap_matrix.matrix[i];
1537− }
1538− mpc->funcs->set_gamut_remap(mpc, mpcc_id, &adjust);
1539− } else
1540− /* dpp/cm gamut remap*/
1541− dc->hwss.program_gamut_remap(pipe_ctx);
1510+ /* dpp/cm gamut remap*/
1511+ dc->hwss.program_gamut_remap(pipe_ctx);
15421512
15431513 /*call the dcn2 method which uses mpc csc*/
15441514 dc->hwss.program_output_csc(dc,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c+5−0
@@ -1595,6 +1595,11 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param · 1594 unmodified lines
15951595 dcn2_1_soc.num_chans = bw_params->num_channels;
15961596
15971597 ASSERT(clk_table->num_entries);
1598+ /* Copy dcn2_1_soc.clock_limits to clock_limits to avoid copying over null states later */
1599+ for (i = 0; i < dcn2_1_soc.num_states + 1; i++) {
1600+ clock_limits[i] = dcn2_1_soc.clock_limits[i];
1601+ }
1602+
15981603 for (i = 0; i < clk_table->num_entries; i++) {
15991604 /* loop backwards*/
16001605 for (closest_clk_lvl = 0, j = dcn2_1_soc.num_states - 1; j >= 0; j--) {
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c+18−8
@@ -113,6 +113,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 112 unmodified lines
113113 struct pwl_result_data *rgb_resulted;
114114 struct pwl_result_data *rgb;
115115 struct pwl_result_data *rgb_plus_1;
116+ struct pwl_result_data *rgb_minus_1;
116117 struct fixed31_32 end_value;
117118
118119 int32_t region_start, region_end;
@@ -140,7 +141,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 21 unmodified lines
140141 region_start = -MAX_LOW_POINT;
141142 region_end = NUMBER_REGIONS - MAX_LOW_POINT;
142143 } else {
143− /* 10 segments
144+ /* 11 segments
144145 * segment is from 2^-10 to 2^0
145146 * There are less than 256 points, for optimization
146147 */
@@ -154,9 +155,10 @@ bool cm3_helper_translate_curve_to_hw_format( · 7 unmodified lines
154155 seg_distr[7] = 4;
155156 seg_distr[8] = 4;
156157 seg_distr[9] = 4;
158+ seg_distr[10] = 1;
157159
158160 region_start = -10;
159− region_end = 0;
161+ region_end = 1;
160162 }
161163
162164 for (i = region_end - region_start; i < MAX_REGIONS_NUMBER ; i++)
@@ -189,6 +191,10 @@ bool cm3_helper_translate_curve_to_hw_format( · 26 unmodified lines
189191 rgb_resulted[hw_points - 1].green = output_tf->tf_pts.green[start_index];
190192 rgb_resulted[hw_points - 1].blue = output_tf->tf_pts.blue[start_index];
191193
194+ rgb_resulted[hw_points].red = rgb_resulted[hw_points - 1].red;
195+ rgb_resulted[hw_points].green = rgb_resulted[hw_points - 1].green;
196+ rgb_resulted[hw_points].blue = rgb_resulted[hw_points - 1].blue;
197+
192198 // All 3 color channels have same x
193199 corner_points[0].red.x = dc_fixpt_pow(dc_fixpt_from_int(2),
194200 dc_fixpt_from_int(region_start));
@@ -259,15 +265,18 @@ bool cm3_helper_translate_curve_to_hw_format( · 64 unmodified lines
259265
260266 rgb = rgb_resulted;
261267 rgb_plus_1 = rgb_resulted + 1;
268+ rgb_minus_1 = rgb;
262269
263270 i = 1;
264271 while (i != hw_points + 1) {
265− if (dc_fixpt_lt(rgb_plus_1->red, rgb->red))
266− rgb_plus_1->red = rgb->red;
267− if (dc_fixpt_lt(rgb_plus_1->green, rgb->green))
268− rgb_plus_1->green = rgb->green;
269− if (dc_fixpt_lt(rgb_plus_1->blue, rgb->blue))
270− rgb_plus_1->blue = rgb->blue;
272+ if (i >= hw_points - 1) {
273+ if (dc_fixpt_lt(rgb_plus_1->red, rgb->red))
274+ rgb_plus_1->red = dc_fixpt_add(rgb->red, rgb_minus_1->delta_red);
275+ if (dc_fixpt_lt(rgb_plus_1->green, rgb->green))
276+ rgb_plus_1->green = dc_fixpt_add(rgb->green, rgb_minus_1->delta_green);
277+ if (dc_fixpt_lt(rgb_plus_1->blue, rgb->blue))
278+ rgb_plus_1->blue = dc_fixpt_add(rgb->blue, rgb_minus_1->delta_blue);
279+ }
271280
272281 rgb->delta_red = dc_fixpt_sub(rgb_plus_1->red, rgb->red);
273282 rgb->delta_green = dc_fixpt_sub(rgb_plus_1->green, rgb->green);
@@ -283,6 +292,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 9 unmodified lines
283292 }
284293
285294 ++rgb_plus_1;
295+ rgb_minus_1 = rgb;
286296 ++rgb;
287297 ++i;
288298 }
drivers/gpu/drm/i915/i915_perf.c+5−8
@@ -603,7 +603,6 @@ static int append_oa_sample(struct i915_perf_stream *stream, · 602 unmodified lines
603603 {
604604 int report_size = stream->oa_buffer.format_size;
605605 struct drm_i915_perf_record_header header;
606− u32 sample_flags = stream->sample_flags;
607606
608607 header.type = DRM_I915_PERF_RECORD_SAMPLE;
609608 header.pad = 0;
@@ -617,10 +616,8 @@ static int append_oa_sample(struct i915_perf_stream *stream, · 7 unmodified lines
617616 return -EFAULT;
618617 buf += sizeof(header);
619618
620− if (sample_flags & SAMPLE_OA_REPORT) {
621− if (copy_to_user(buf, report, report_size))
622− return -EFAULT;
623− }
619+ if (copy_to_user(buf, report, report_size))
620+ return -EFAULT;
624621
625622 (*offset) += header.size;
626623
@@ -2682,7 +2679,7 @@ static void i915_oa_stream_enable(struct i915_perf_stream *stream) · 2055 unmodified lines
26822679
26832680 stream->perf->ops.oa_enable(stream);
26842681
2685− if (stream->periodic)
2682+ if (stream->sample_flags & SAMPLE_OA_REPORT)
26862683 hrtimer_start(&stream->poll_check_timer,
26872684 ns_to_ktime(stream->poll_oa_period),
26882685 HRTIMER_MODE_REL_PINNED);
@@ -2745,7 +2742,7 @@ static void i915_oa_stream_disable(struct i915_perf_stream *stream) · 56 unmodified lines
27452742 {
27462743 stream->perf->ops.oa_disable(stream);
27472744
2748− if (stream->periodic)
2745+ if (stream->sample_flags & SAMPLE_OA_REPORT)
27492746 hrtimer_cancel(&stream->poll_check_timer);
27502747 }
27512748
@@ -3028,7 +3025,7 @@ static ssize_t i915_perf_read(struct file *file, · 276 unmodified lines
30283025 * disabled stream as an error. In particular it might otherwise lead
30293026 * to a deadlock for blocking file descriptors...
30303027 */
3031− if (!stream->enabled)
3028+ if (!stream->enabled || !(stream->sample_flags & SAMPLE_OA_REPORT))
30323029 return -EIO;
30333030
30343031 if (!(file->f_flags & O_NONBLOCK)) {
drivers/gpu/drm/i915/i915_reg.h+22−1
@@ -3316,7 +3316,18 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) · 3315 unmodified lines
33163316
33173317 #define ILK_DISPLAY_CHICKEN1 _MMIO(0x42000)
33183318 #define ILK_FBCQ_DIS (1 << 22)
3319−#define ILK_PABSTRETCH_DIS (1 << 21)
3319+#define ILK_PABSTRETCH_DIS REG_BIT(21)
3320+#define ILK_SABSTRETCH_DIS REG_BIT(20)
3321+#define IVB_PRI_STRETCH_MAX_MASK REG_GENMASK(21, 20)
3322+#define IVB_PRI_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 0)
3323+#define IVB_PRI_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 1)
3324+#define IVB_PRI_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 2)
3325+#define IVB_PRI_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 3)
3326+#define IVB_SPR_STRETCH_MAX_MASK REG_GENMASK(19, 18)
3327+#define IVB_SPR_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 0)
3328+#define IVB_SPR_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 1)
3329+#define IVB_SPR_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 2)
3330+#define IVB_SPR_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 3)
33203331
33213332
33223333 /*
@@ -8039,6 +8050,16 @@ enum { · 4716 unmodified lines
80398050
80408051 #define _CHICKEN_PIPESL_1_A 0x420b0
80418052 #define _CHICKEN_PIPESL_1_B 0x420b4
8053+#define HSW_PRI_STRETCH_MAX_MASK REG_GENMASK(28, 27)
8054+#define HSW_PRI_STRETCH_MAX_X8 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 0)
8055+#define HSW_PRI_STRETCH_MAX_X4 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 1)
8056+#define HSW_PRI_STRETCH_MAX_X2 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 2)
8057+#define HSW_PRI_STRETCH_MAX_X1 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 3)
8058+#define HSW_SPR_STRETCH_MAX_MASK REG_GENMASK(26, 25)
8059+#define HSW_SPR_STRETCH_MAX_X8 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 0)
8060+#define HSW_SPR_STRETCH_MAX_X4 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 1)
8061+#define HSW_SPR_STRETCH_MAX_X2 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 2)
8062+#define HSW_SPR_STRETCH_MAX_X1 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 3)
80428063 #define HSW_FBCQ_DIS (1 << 22)
80438064 #define BDW_DPRS_MASK_VBLANK_SRD (1 << 0)
80448065 #define CHICKEN_PIPESL_1(pipe) _MMIO_PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B)
drivers/gpu/drm/i915/intel_pm.c+15−1
@@ -7245,11 +7245,16 @@ static void bdw_init_clock_gating(struct drm_i915_private *dev_priv) · 7244 unmodified lines
72457245 intel_uncore_write(&dev_priv->uncore, CHICKEN_PAR1_1,
72467246 intel_uncore_read(&dev_priv->uncore, CHICKEN_PAR1_1) | DPA_MASK_VBLANK_SRD);
72477247
7248− /* WaPsrDPRSUnmaskVBlankInSRD:bdw */
72497248 for_each_pipe(dev_priv, pipe) {
7249+ /* WaPsrDPRSUnmaskVBlankInSRD:bdw */
72507250 intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe),
72517251 intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe)) |
72527252 BDW_DPRS_MASK_VBLANK_SRD);
7253+
7254+ /* Undocumented but fixes async flip + VT-d corruption */
7255+ if (intel_vtd_active())
7256+ intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe),
7257+ HSW_PRI_STRETCH_MAX_MASK, HSW_PRI_STRETCH_MAX_X1);
72537258 }
72547259
72557260 /* WaVSRefCountFullforceMissDisable:bdw */
@@ -7285,11 +7290,20 @@ static void bdw_init_clock_gating(struct drm_i915_private *dev_priv) · 29 unmodified lines
72857290
72867291 static void hsw_init_clock_gating(struct drm_i915_private *dev_priv)
72877292 {
7293+ enum pipe pipe;
7294+
72887295 /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */
72897296 intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A),
72907297 intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A)) |
72917298 HSW_FBCQ_DIS);
72927299
7300+ for_each_pipe(dev_priv, pipe) {
7301+ /* Undocumented but fixes async flip + VT-d corruption */
7302+ if (intel_vtd_active())
7303+ intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe),
7304+ HSW_PRI_STRETCH_MAX_MASK, HSW_PRI_STRETCH_MAX_X1);
7305+ }
7306+
72937307 /* This is required by WaCatErrorRejectionIssue:hsw */
72947308 intel_uncore_write(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
72957309 intel_uncore_read(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
drivers/gpu/drm/nouveau/nouveau_bo.c+8−0
@@ -551,6 +551,10 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) · 550 unmodified lines
551551
552552 if (!ttm_dma)
553553 return;
554+ if (!ttm_dma->pages) {
555+ NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma);
556+ return;
557+ }
554558
555559 /* Don't waste time looping if the object is coherent */
556560 if (nvbo->force_coherent)
@@ -583,6 +587,10 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) · 26 unmodified lines
583587
584588 if (!ttm_dma)
585589 return;
590+ if (!ttm_dma->pages) {
591+ NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma);
592+ return;
593+ }
586594
587595 /* Don't waste time looping if the object is coherent */
588596 if (nvbo->force_coherent)
drivers/gpu/drm/omapdrm/dss/dsi.c+4−3
@@ -2149,11 +2149,12 @@ static int dsi_vc_send_short(struct dsi_data *dsi, int vc, · 2148 unmodified lines
21492149 const struct mipi_dsi_msg *msg)
21502150 {
21512151 struct mipi_dsi_packet pkt;
2152+ int ret;
21522153 u32 r;
21532154
2154− r = mipi_dsi_create_packet(&pkt, msg);
2155− if (r < 0)
2156− return r;
2155+ ret = mipi_dsi_create_packet(&pkt, msg);
2156+ if (ret < 0)
2157+ return ret;
21572158
21582159 WARN_ON(!dsi_bus_is_locked(dsi));
21592160
drivers/iio/adc/Kconfig+3−0
@@ -266,6 +266,8 @@ config ADI_AXI_ADC · 265 unmodified lines
266266 select IIO_BUFFER
267267 select IIO_BUFFER_HW_CONSUMER
268268 select IIO_BUFFER_DMAENGINE
269+ depends on HAS_IOMEM
270+ depends on OF
269271 help
270272 Say yes here to build support for Analog Devices Generic
271273 AXI ADC IP core. The IP core is used for interfacing with
@@ -923,6 +925,7 @@ config STM32_ADC_CORE · 651 unmodified lines
923925 depends on ARCH_STM32 || COMPILE_TEST
924926 depends on OF
925927 depends on REGULATOR
928+ depends on HAS_IOMEM
926929 select IIO_BUFFER
927930 select MFD_STM32_TIMERS
928931 select IIO_STM32_TIMER_TRIGGER
drivers/iio/adc/ab8500-gpadc.c+1−1
@@ -918,7 +918,7 @@ static int ab8500_gpadc_read_raw(struct iio_dev *indio_dev, · 917 unmodified lines
918918 return processed;
919919
920920 /* Return millivolt or milliamps or millicentigrades */
921− *val = processed * 1000;
921+ *val = processed;
922922 return IIO_VAL_INT;
923923 }
924924
drivers/iio/adc/ad7949.c+1−1
@@ -91,7 +91,7 @@ static int ad7949_spi_read_channel(struct ad7949_adc_chip *ad7949_adc, int *val, · 90 unmodified lines
9191 int ret;
9292 int i;
9393 int bits_per_word = ad7949_adc->resolution;
94− int mask = GENMASK(ad7949_adc->resolution, 0);
94+ int mask = GENMASK(ad7949_adc->resolution - 1, 0);
9595 struct spi_message msg;
9696 struct spi_transfer tx[] = {
9797 {
drivers/iio/adc/qcom-spmi-vadc.c+1−1
@@ -597,7 +597,7 @@ static const struct vadc_channels vadc_chans[] = { · 596 unmodified lines
597597 VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1)
598598
599599 VADC_CHAN_NO_SCALE(LR_MUX1_BAT_THERM, 0)
600− VADC_CHAN_NO_SCALE(LR_MUX2_BAT_ID, 0)
600+ VADC_CHAN_VOLT(LR_MUX2_BAT_ID, 0, SCALE_DEFAULT)
601601 VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0)
602602 VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0)
603603 VADC_CHAN_NO_SCALE(LR_MUX5_AMUX_THM2, 0)
drivers/iio/gyro/mpu3050-core.c+2−0
@@ -551,6 +551,8 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p) · 550 unmodified lines
551551 MPU3050_FIFO_R,
552552 &fifo_values[offset],
553553 toread);
554+ if (ret)
555+ goto out_trigger_unlock;
554556
555557 dev_dbg(mpu3050->dev,
556558 "%04x %04x %04x %04x %04x\n",
drivers/iio/humidity/hid-sensor-humidity.c+7−5
@@ -15,7 +15,10 @@ · 14 unmodified lines
1515 struct hid_humidity_state {
1616 struct hid_sensor_common common_attributes;
1717 struct hid_sensor_hub_attribute_info humidity_attr;
18− s32 humidity_data;
18+ struct {
19+ s32 humidity_data;
20+ u64 timestamp __aligned(8);
21+ } scan;
1922 int scale_pre_decml;
2023 int scale_post_decml;
2124 int scale_precision;
@@ -125,9 +128,8 @@ static int humidity_proc_event(struct hid_sensor_hub_device *hsdev, · 103 unmodified lines
125128 struct hid_humidity_state *humid_st = iio_priv(indio_dev);
126129
127130 if (atomic_read(&humid_st->common_attributes.data_ready))
128− iio_push_to_buffers_with_timestamp(indio_dev,
129− &humid_st->humidity_data,
130− iio_get_time_ns(indio_dev));
131+ iio_push_to_buffers_with_timestamp(indio_dev, &humid_st->scan,
132+ iio_get_time_ns(indio_dev));
131133
132134 return 0;
133135 }
@@ -142,7 +144,7 @@ static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines
142144
143145 switch (usage_id) {
144146 case HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY:
145− humid_st->humidity_data = *(s32 *)raw_data;
147+ humid_st->scan.humidity_data = *(s32 *)raw_data;
146148
147149 return 0;
148150 default:
drivers/iio/imu/adis16400.c+1−2
@@ -462,8 +462,7 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev) · 461 unmodified lines
462462 if (ret)
463463 goto err_ret;
464464
465− ret = sscanf(indio_dev->name, "adis%u\n", &device_id);
466− if (ret != 1) {
465+ if (sscanf(indio_dev->name, "adis%u\n", &device_id) != 1) {
467466 ret = -EINVAL;
468467 goto err_ret;
469468 }
drivers/iio/light/hid-sensor-prox.c+11−2
@@ -23,6 +23,9 @@ struct prox_state { · 22 unmodified lines
2323 struct hid_sensor_common common_attributes;
2424 struct hid_sensor_hub_attribute_info prox_attr;
2525 u32 human_presence;
26+ int scale_pre_decml;
27+ int scale_post_decml;
28+ int scale_precision;
2629 };
2730
2831 /* Channel definitions */
@@ -93,8 +96,9 @@ static int prox_read_raw(struct iio_dev *indio_dev, · 64 unmodified lines
9396 ret_type = IIO_VAL_INT;
9497 break;
9598 case IIO_CHAN_INFO_SCALE:
96− *val = prox_state->prox_attr.units;
97− ret_type = IIO_VAL_INT;
99+ *val = prox_state->scale_pre_decml;
100+ *val2 = prox_state->scale_post_decml;
101+ ret_type = prox_state->scale_precision;
98102 break;
99103 case IIO_CHAN_INFO_OFFSET:
100104 *val = hid_sensor_convert_exponent(
@@ -234,6 +238,11 @@ static int prox_parse_report(struct platform_device *pdev, · 133 unmodified lines
234238 HID_USAGE_SENSOR_HUMAN_PRESENCE,
235239 &st->common_attributes.sensitivity);
236240
241+ st->scale_precision = hid_sensor_format_scale(
242+ hsdev->usage,
243+ &st->prox_attr,
244+ &st->scale_pre_decml, &st->scale_post_decml);
245+
237246 return ret;
238247 }
239248
drivers/iio/temperature/hid-sensor-temperature.c+8−6
@@ -15,7 +15,10 @@ · 14 unmodified lines
1515 struct temperature_state {
1616 struct hid_sensor_common common_attributes;
1717 struct hid_sensor_hub_attribute_info temperature_attr;
18− s32 temperature_data;
18+ struct {
19+ s32 temperature_data;
20+ u64 timestamp __aligned(8);
21+ } scan;
1922 int scale_pre_decml;
2023 int scale_post_decml;
2124 int scale_precision;
@@ -32,7 +35,7 @@ static const struct iio_chan_spec temperature_channels[] = { · 10 unmodified lines
3235 BIT(IIO_CHAN_INFO_SAMP_FREQ) |
3336 BIT(IIO_CHAN_INFO_HYSTERESIS),
3437 },
35− IIO_CHAN_SOFT_TIMESTAMP(3),
38+ IIO_CHAN_SOFT_TIMESTAMP(1),
3639 };
3740
3841 /* Adjust channel real bits based on report descriptor */
@@ -123,9 +126,8 @@ static int temperature_proc_event(struct hid_sensor_hub_device *hsdev, · 84 unmodified lines
123126 struct temperature_state *temp_st = iio_priv(indio_dev);
124127
125128 if (atomic_read(&temp_st->common_attributes.data_ready))
126− iio_push_to_buffers_with_timestamp(indio_dev,
127− &temp_st->temperature_data,
128− iio_get_time_ns(indio_dev));
129+ iio_push_to_buffers_with_timestamp(indio_dev, &temp_st->scan,
130+ iio_get_time_ns(indio_dev));
129131
130132 return 0;
131133 }
@@ -140,7 +142,7 @@ static int temperature_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines
140142
141143 switch (usage_id) {
142144 case HID_USAGE_SENSOR_DATA_ENVIRONMENTAL_TEMPERATURE:
143− temp_st->temperature_data = *(s32 *)raw_data;
145+ temp_st->scan.temperature_data = *(s32 *)raw_data;
144146 return 0;
145147 default:
146148 return -EINVAL;
drivers/input/joydev.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626
2727 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
2828 MODULE_DESCRIPTION("Joystick device interfaces");
29−MODULE_SUPPORTED_DEVICE("input/js");
3029 MODULE_LICENSE("GPL");
3130
3231 #define JOYDEV_MINOR_BASE 0
drivers/iommu/amd/init.c+20−16
@@ -2714,7 +2714,6 @@ static int __init early_amd_iommu_init(void) · 2713 unmodified lines
27142714 struct acpi_table_header *ivrs_base;
27152715 int i, remap_cache_sz, ret;
27162716 acpi_status status;
2717− u32 pci_id;
27182717
27192718 if (!amd_iommu_detected)
27202719 return -ENODEV;
@@ -2804,16 +2803,6 @@ static int __init early_amd_iommu_init(void) · 83 unmodified lines
28042803 if (ret)
28052804 goto out;
28062805
2807− /* Disable IOMMU if there's Stoney Ridge graphics */
2808− for (i = 0; i < 32; i++) {
2809− pci_id = read_pci_config(0, i, 0, 0);
2810− if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) {
2811− pr_info("Disable IOMMU on Stoney Ridge\n");
2812− amd_iommu_disabled = true;
2813− break;
2814− }
2815− }
2816−
28172806 /* Disable any previously enabled IOMMUs */
28182807 if (!is_kdump_kernel() || amd_iommu_disabled)
28192808 disable_iommus();
@@ -2880,6 +2869,7 @@ static bool detect_ivrs(void) · 60 unmodified lines
28802869 {
28812870 struct acpi_table_header *ivrs_base;
28822871 acpi_status status;
2872+ int i;
28832873
28842874 status = acpi_get_table("IVRS", 0, &ivrs_base);
28852875 if (status == AE_NOT_FOUND)
@@ -2892,6 +2882,17 @@ static bool detect_ivrs(void) · 6 unmodified lines
28922882
28932883 acpi_put_table(ivrs_base);
28942884
2885+ /* Don't use IOMMU if there is Stoney Ridge graphics */
2886+ for (i = 0; i < 32; i++) {
2887+ u32 pci_id;
2888+
2889+ pci_id = read_pci_config(0, i, 0, 0);
2890+ if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) {
2891+ pr_info("Disable IOMMU on Stoney Ridge\n");
2892+ return false;
2893+ }
2894+ }
2895+
28952896 /* Make sure ACS will be enabled during PCI probe */
28962897 pci_request_acs();
28972898
@@ -2918,12 +2919,12 @@ static int __init state_next(void) · 20 unmodified lines
29182919 }
29192920 break;
29202921 case IOMMU_IVRS_DETECTED:
2921− ret = early_amd_iommu_init();
2922− init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
2923− if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) {
2924− pr_info("AMD IOMMU disabled\n");
2922+ if (amd_iommu_disabled) {
29252923 init_state = IOMMU_CMDLINE_DISABLED;
29262924 ret = -EINVAL;
2925+ } else {
2926+ ret = early_amd_iommu_init();
2927+ init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
29272928 }
29282929 break;
29292930 case IOMMU_ACPI_FINISHED:
@@ -3001,8 +3002,11 @@ int __init amd_iommu_prepare(void) · 71 unmodified lines
30013002 amd_iommu_irq_remap = true;
30023003
30033004 ret = iommu_go_to_state(IOMMU_ACPI_FINISHED);
3004− if (ret)
3005+ if (ret) {
3006+ amd_iommu_irq_remap = false;
30053007 return ret;
3008+ }
3009+
30063010 return amd_iommu_irq_remap ? 0 : -ENODEV;
30073011 }
30083012
drivers/iommu/tegra-smmu.c+3−4
@@ -849,12 +849,11 @@ static struct iommu_device *tegra_smmu_probe_device(struct device *dev) · 848 unmodified lines
849849 smmu = tegra_smmu_find(args.np);
850850 if (smmu) {
851851 err = tegra_smmu_configure(smmu, dev, &args);
852− of_node_put(args.np);
853852
854− if (err < 0)
853+ if (err < 0) {
854+ of_node_put(args.np);
855855 return ERR_PTR(err);
856−
857− break;
856+ }
858857 }
859858
860859 of_node_put(args.np);
drivers/media/firewire/firedtv-fw.c+0−1
@@ -430,4 +430,3 @@ MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>"); · 429 unmodified lines
430430 MODULE_AUTHOR("Ben Backx <ben@bbackx.com>");
431431 MODULE_DESCRIPTION("FireDTV DVB Driver");
432432 MODULE_LICENSE("GPL");
433−MODULE_SUPPORTED_DEVICE("FireDTV DVB");
drivers/media/pci/cx18/cx18-alsa-main.c+0−1
@@ -41,7 +41,6 @@ MODULE_PARM_DESC(debug, · 40 unmodified lines
4141
4242 MODULE_AUTHOR("Andy Walls");
4343 MODULE_DESCRIPTION("CX23418 ALSA Interface");
44−MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder");
4544 MODULE_LICENSE("GPL");
4645
4746 MODULE_VERSION(CX18_VERSION);
drivers/media/pci/cx18/cx18-driver.c+0−1
@@ -232,7 +232,6 @@ MODULE_PARM_DESC(cx18_first_minor, · 231 unmodified lines
232232
233233 MODULE_AUTHOR("Hans Verkuil");
234234 MODULE_DESCRIPTION("CX23418 driver");
235−MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder");
236235 MODULE_LICENSE("GPL");
237236
238237 MODULE_VERSION(CX18_VERSION);
drivers/media/pci/cx25821/cx25821-alsa.c+0−1
@@ -104,7 +104,6 @@ MODULE_PARM_DESC(index, "Index value for cx25821 capture interface(s)."); · 103 unmodified lines
104104 MODULE_DESCRIPTION("ALSA driver module for cx25821 based capture cards");
105105 MODULE_AUTHOR("Hiep Huynh");
106106 MODULE_LICENSE("GPL");
107−MODULE_SUPPORTED_DEVICE("{{Conexant,25821}"); /* "{{Conexant,23881}," */
108107
109108 static unsigned int debug;
110109 module_param(debug, int, 0644);
drivers/media/pci/cx88/cx88-alsa.c+0−1
@@ -98,7 +98,6 @@ MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); · 97 unmodified lines
9898 MODULE_LICENSE("GPL v2");
9999 MODULE_VERSION(CX88_VERSION);
100100
101−MODULE_SUPPORTED_DEVICE("{{Conexant,23881},{{Conexant,23882},{{Conexant,23883}");
102101 static unsigned int debug;
103102 module_param(debug, int, 0644);
104103 MODULE_PARM_DESC(debug, "enable debug messages");
drivers/media/pci/ivtv/ivtv-alsa-main.c+0−1
@@ -38,7 +38,6 @@ MODULE_PARM_DESC(index, · 37 unmodified lines
3838
3939 MODULE_AUTHOR("Andy Walls");
4040 MODULE_DESCRIPTION("CX23415/CX23416 ALSA Interface");
41−MODULE_SUPPORTED_DEVICE("CX23415/CX23416 MPEG2 encoder");
4241 MODULE_LICENSE("GPL");
4342
4443 MODULE_VERSION(IVTV_VERSION);
drivers/media/pci/ivtv/ivtv-driver.c+0−3
@@ -275,9 +275,6 @@ MODULE_PARM_DESC(ivtv_first_minor, "Set device node number assigned to first car · 274 unmodified lines
275275
276276 MODULE_AUTHOR("Kevin Thayer, Chris Kennedy, Hans Verkuil");
277277 MODULE_DESCRIPTION("CX23415/CX23416 driver");
278−MODULE_SUPPORTED_DEVICE
279− ("CX23415/CX23416 MPEG2 encoder (WinTV PVR-150/250/350/500,\n"
280− "\t\t\tYuan MPG series and similar)");
281278 MODULE_LICENSE("GPL");
282279
283280 MODULE_VERSION(IVTV_VERSION);
drivers/media/pci/sta2x11/sta2x11_vip.c+0−1
@@ -1269,6 +1269,5 @@ late_initcall_sync(sta2x11_vip_init_module); · 1268 unmodified lines
12691269 MODULE_DESCRIPTION("STA2X11 Video Input Port driver");
12701270 MODULE_AUTHOR("Wind River");
12711271 MODULE_LICENSE("GPL v2");
1272−MODULE_SUPPORTED_DEVICE("sta2x11 video input");
12731272 MODULE_VERSION(DRV_VERSION);
12741273 MODULE_DEVICE_TABLE(pci, sta2x11_vip_pci_tbl);
drivers/media/platform/atmel/atmel-isi.c+0−1
@@ -1363,4 +1363,3 @@ module_platform_driver(atmel_isi_driver); · 1362 unmodified lines
13631363 MODULE_AUTHOR("Josh Wu <josh.wu@atmel.com>");
13641364 MODULE_DESCRIPTION("The V4L2 driver for Atmel Linux");
13651365 MODULE_LICENSE("GPL");
1366−MODULE_SUPPORTED_DEVICE("video");
drivers/media/platform/atmel/atmel-sama5d2-isc.c+0−1
@@ -330,4 +330,3 @@ module_platform_driver(atmel_isc_driver); · 329 unmodified lines
330330 MODULE_AUTHOR("Songjun Wu");
331331 MODULE_DESCRIPTION("The V4L2 driver for Atmel-ISC");
332332 MODULE_LICENSE("GPL v2");
333−MODULE_SUPPORTED_DEVICE("video");
drivers/media/platform/marvell-ccic/cafe-driver.c+0−4
@@ -44,10 +44,6 @@ · 43 unmodified lines
4444 MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>");
4545 MODULE_DESCRIPTION("Marvell 88ALP01 CMOS Camera Controller driver");
4646 MODULE_LICENSE("GPL");
47−MODULE_SUPPORTED_DEVICE("Video");
48−
49−
50−
5147
5248 struct cafe_camera {
5349 int registered; /* Fully initialized? */
drivers/media/platform/stm32/stm32-dcmi.c+0−1
@@ -2149,4 +2149,3 @@ MODULE_AUTHOR("Yannick Fertre <yannick.fertre@st.com>"); · 2148 unmodified lines
21492149 MODULE_AUTHOR("Hugues Fruchet <hugues.fruchet@st.com>");
21502150 MODULE_DESCRIPTION("STMicroelectronics STM32 Digital Camera Memory Interface driver");
21512151 MODULE_LICENSE("GPL");
2152−MODULE_SUPPORTED_DEVICE("video");
drivers/media/usb/cpia2/cpia2_v4l.c+0−1
@@ -56,7 +56,6 @@ MODULE_PARM_DESC(flicker_mode, "Flicker frequency (0 (disabled), " __stringify(5 · 55 unmodified lines
5656
5757 MODULE_AUTHOR("Steve Miller (STMicroelectronics) <steve.miller@st.com>");
5858 MODULE_DESCRIPTION("V4L-driver for STMicroelectronics CPiA2 based cameras");
59−MODULE_SUPPORTED_DEVICE("video");
6059 MODULE_LICENSE("GPL");
6160 MODULE_VERSION(CPIA_VERSION);
6261
drivers/media/usb/tm6000/tm6000-alsa.c+0−1
@@ -51,7 +51,6 @@ MODULE_PARM_DESC(index, "Index value for tm6000x capture interface(s)."); · 50 unmodified lines
5151 MODULE_DESCRIPTION("ALSA driver module for tm5600/tm6000/tm6010 based TV cards");
5252 MODULE_AUTHOR("Mauro Carvalho Chehab");
5353 MODULE_LICENSE("GPL v2");
54−MODULE_SUPPORTED_DEVICE("{{Trident,tm5600},{{Trident,tm6000},{{Trident,tm6010}");
5554 static unsigned int debug;
5655 module_param(debug, int, 0644);
5756 MODULE_PARM_DESC(debug, "enable debug messages");
drivers/media/usb/tm6000/tm6000-dvb.c+0−2
@@ -23,8 +23,6 @@ MODULE_DESCRIPTION("DVB driver extension module for tm5600/6000/6010 based TV ca · 22 unmodified lines
2323 MODULE_AUTHOR("Mauro Carvalho Chehab");
2424 MODULE_LICENSE("GPL");
2525
26−MODULE_SUPPORTED_DEVICE("{{Trident, tm5600},{{Trident, tm6000},{{Trident, tm6010}");
27−
2826 static int debug;
2927
3028 module_param(debug, int, 0644);
drivers/mtd/maps/sun_uflash.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232
3333 MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");
3434 MODULE_DESCRIPTION("User-programmable flash device on Sun Microsystems boardsets");
35−MODULE_SUPPORTED_DEVICE(DRIVER_NAME);
3635 MODULE_LICENSE("GPL");
3736 MODULE_VERSION("2.1");
3837
drivers/net/can/peak_canfd/peak_pciefd_main.c+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121
2222 MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
2323 MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards");
24−MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe/M.2 FD CAN cards");
2524 MODULE_LICENSE("GPL v2");
2625
2726 #define PCIEFD_DRV_NAME "peak_pciefd"
drivers/net/can/sja1000/ems_pci.c+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121
2222 MODULE_AUTHOR("Sebastian Haas <haas@ems-wuenche.com>");
2323 MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-PCI/PCIe/104P CAN cards");
24−MODULE_SUPPORTED_DEVICE("EMS CPC-PCI/PCIe/104P CAN card");
2524 MODULE_LICENSE("GPL v2");
2625
2726 #define EMS_PCI_V1_MAX_CHAN 2
drivers/net/can/sja1000/ems_pcmcia.c+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121
2222 MODULE_AUTHOR("Markus Plessing <plessing@ems-wuensche.com>");
2323 MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-CARD cards");
24−MODULE_SUPPORTED_DEVICE("EMS CPC-CARD CAN card");
2524 MODULE_LICENSE("GPL v2");
2625
2726 #define EMS_PCMCIA_MAX_CHAN 2
drivers/net/can/sja1000/kvaser_pci.c+0−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333
3434 MODULE_AUTHOR("Per Dalen <per.dalen@cnw.se>");
3535 MODULE_DESCRIPTION("Socket-CAN driver for KVASER PCAN PCI cards");
36−MODULE_SUPPORTED_DEVICE("KVASER PCAN PCI CAN card");
3736 MODULE_LICENSE("GPL v2");
3837
3938 #define MAX_NO_OF_CHANNELS 4 /* max no of channels on a single card */
drivers/net/can/sja1000/peak_pci.c+0−2
@@ -24,8 +24,6 @@ · 23 unmodified lines
2424
2525 MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
2626 MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCI family cards");
27−MODULE_SUPPORTED_DEVICE("PEAK PCAN PCI/PCIe/PCIeC miniPCI CAN cards");
28−MODULE_SUPPORTED_DEVICE("PEAK PCAN miniPCIe/cPCI PC/104+ PCI/104e CAN Cards");
2927 MODULE_LICENSE("GPL v2");
3028
3129 #define DRV_NAME "peak_pci"
drivers/net/can/sja1000/peak_pcmcia.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
2323 MODULE_DESCRIPTION("CAN driver for PEAK-System PCAN-PC Cards");
2424 MODULE_LICENSE("GPL v2");
25−MODULE_SUPPORTED_DEVICE("PEAK PCAN-PC Card");
2625
2726 /* PEAK-System PCMCIA driver name */
2827 #define PCC_NAME "peak_pcmcia"
drivers/net/can/sja1000/plx_pci.c+0−12
@@ -25,18 +25,6 @@ · 24 unmodified lines
2525 MODULE_AUTHOR("Pavel Cheblakov <P.B.Cheblakov@inp.nsk.su>");
2626 MODULE_DESCRIPTION("Socket-CAN driver for PLX90xx PCI-bridge cards with "
2727 "the SJA1000 chips");
28−MODULE_SUPPORTED_DEVICE("Adlink PCI-7841/cPCI-7841, "
29− "Adlink PCI-7841/cPCI-7841 SE, "
30− "Marathon CAN-bus-PCI, "
31− "Marathon CAN-bus-PCIe, "
32− "TEWS TECHNOLOGIES TPMC810, "
33− "esd CAN-PCI/CPCI/PCI104/200, "
34− "esd CAN-PCI/PMC/266, "
35− "esd CAN-PCIe/2000, "
36− "Connect Tech Inc. CANpro/104-Plus Opto (CRG001), "
37− "IXXAT PC-I 04/PCI, "
38− "ELCUS CAN-200-PCI, "
39− "ASEM DUAL CAN-RAW")
4028 MODULE_LICENSE("GPL v2");
4129
4230 #define PLX_PCI_MAX_CHAN 2
drivers/net/can/usb/peak_usb/pcan_usb.c+0−2
@@ -18,8 +18,6 @@ · 17 unmodified lines
1818
1919 #include "pcan_usb_core.h"
2020
21−MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB adapter");
22−
2321 /* PCAN-USB Endpoints */
2422 #define PCAN_USB_EP_CMDOUT 1
2523 #define PCAN_USB_EP_CMDIN (PCAN_USB_EP_CMDOUT | USB_DIR_IN)
drivers/net/can/usb/peak_usb/pcan_usb_fd.c+0−3
@@ -16,9 +16,6 @@ · 15 unmodified lines
1616 #include "pcan_usb_core.h"
1717 #include "pcan_usb_pro.h"
1818
19−MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB FD adapter");
20−MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro FD adapter");
21−
2219 #define PCAN_USBPROFD_CHANNEL_COUNT 2
2320 #define PCAN_USBFD_CHANNEL_COUNT 1
2421
drivers/net/can/usb/peak_usb/pcan_usb_pro.c+0−2
@@ -17,8 +17,6 @@ · 16 unmodified lines
1717 #include "pcan_usb_core.h"
1818 #include "pcan_usb_pro.h"
1919
20−MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro adapter");
21−
2220 #define PCAN_USBPRO_CHANNEL_COUNT 2
2321
2422 /* PCAN-USB Pro adapter internal clock (MHz) */
drivers/net/hamradio/scc.c+0−1
@@ -2167,7 +2167,6 @@ static void __exit scc_cleanup_driver(void) · 2166 unmodified lines
21672167
21682168 MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>");
21692169 MODULE_DESCRIPTION("AX.25 Device Driver for Z8530 based HDLC cards");
2170−MODULE_SUPPORTED_DEVICE("Z8530 based SCC cards for Amateur Radio");
21712170 MODULE_LICENSE("GPL");
21722171 module_init(scc_init_driver);
21732172 module_exit(scc_cleanup_driver);
drivers/net/wireless/admtek/adm8211.c+0−1
@@ -28,7 +28,6 @@ · 27 unmodified lines
2828 MODULE_AUTHOR("Michael Wu <flamingice@sourmilk.net>");
2929 MODULE_AUTHOR("Jouni Malinen <j@w1.fi>");
3030 MODULE_DESCRIPTION("Driver for IEEE 802.11b wireless cards based on ADMtek ADM8211");
31−MODULE_SUPPORTED_DEVICE("ADM8211");
3231 MODULE_LICENSE("GPL");
3332
3433 static unsigned int tx_ring_size __read_mostly = 16;
drivers/net/wireless/ath/ath5k/base.c+0−1
@@ -90,7 +90,6 @@ MODULE_PARM_DESC(no_hw_rfkill_switch, "Ignore the GPIO RFKill switch state"); · 89 unmodified lines
9090 MODULE_AUTHOR("Jiri Slaby");
9191 MODULE_AUTHOR("Nick Kossifidis");
9292 MODULE_DESCRIPTION("Support for 5xxx series of Atheros 802.11 wireless LAN cards.");
93−MODULE_SUPPORTED_DEVICE("Atheros 5xxx WLAN cards");
9493 MODULE_LICENSE("Dual BSD/GPL");
9594
9695 static int ath5k_init(struct ieee80211_hw *hw);
drivers/net/wireless/ath/ath9k/hw.c+0−1
@@ -34,7 +34,6 @@ static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type); · 33 unmodified lines
3434
3535 MODULE_AUTHOR("Atheros Communications");
3636 MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");
37−MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards");
3837 MODULE_LICENSE("Dual BSD/GPL");
3938
4039 static void ath9k_hw_set_clockrate(struct ath_hw *ah)
drivers/net/wireless/ath/ath9k/init.c+0−1
@@ -37,7 +37,6 @@ static char *dev_info = "ath9k"; · 36 unmodified lines
3737
3838 MODULE_AUTHOR("Atheros Communications");
3939 MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");
40−MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards");
4140 MODULE_LICENSE("Dual BSD/GPL");
4241
4342 static unsigned int ath9k_debug = ATH_DBG_DEFAULT;
drivers/net/wireless/atmel/atmel.c+0−1
@@ -75,7 +75,6 @@ · 74 unmodified lines
7575 MODULE_AUTHOR("Simon Kelley");
7676 MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
7777 MODULE_LICENSE("GPL");
78−MODULE_SUPPORTED_DEVICE("Atmel at76c50x wireless cards");
7978
8079 /* The name of the firmware file to be loaded
8180 over-rides any automatic selection */
drivers/net/wireless/atmel/atmel_cs.c+0−1
@@ -57,7 +57,6 @@ · 56 unmodified lines
5757 MODULE_AUTHOR("Simon Kelley");
5858 MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
5959 MODULE_LICENSE("GPL");
60−MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards");
6160
6261 /*====================================================================*/
6362
drivers/net/wireless/atmel/atmel_pci.c+0−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 MODULE_AUTHOR("Simon Kelley");
1717 MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
1818 MODULE_LICENSE("GPL");
19−MODULE_SUPPORTED_DEVICE("Atmel at76c506 PCI wireless cards");
2019
2120 static const struct pci_device_id card_ids[] = {
2221 { 0x1114, 0x0506, PCI_ANY_ID, PCI_ANY_ID },
drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c+0−1
@@ -87,7 +87,6 @@ static int n_adapters_found; · 86 unmodified lines
8787
8888 MODULE_AUTHOR("Broadcom Corporation");
8989 MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver.");
90−MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN cards");
9190 MODULE_LICENSE("Dual BSD/GPL");
9291 /* This needs to be adjusted when brcms_firmwares changes */
9392 MODULE_FIRMWARE("brcm/bcm43xx-0.fw");
drivers/net/wireless/broadcom/brcm80211/brcmutil/utils.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212
1313 MODULE_AUTHOR("Broadcom Corporation");
1414 MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver utilities.");
15−MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN cards");
1615 MODULE_LICENSE("Dual BSD/GPL");
1716
1817 struct sk_buff *brcmu_pkt_buf_get_skb(uint len)
drivers/net/wireless/cisco/airo.c+0−1
@@ -251,7 +251,6 @@ MODULE_AUTHOR("Benjamin Reed"); · 250 unmodified lines
251251 MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet cards. "
252252 "Direct support for ISA/PCI/MPI cards and support for PCMCIA when used with airo_cs.");
253253 MODULE_LICENSE("Dual BSD/GPL");
254−MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340/350");
255254 module_param_hw_array(io, int, ioport, NULL, 0);
256255 module_param_hw_array(irq, int, irq, NULL, 0);
257256 module_param_array(rates, int, NULL, 0);
drivers/net/wireless/cisco/airo_cs.c+0−1
@@ -47,7 +47,6 @@ MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet " · 46 unmodified lines
4747 "cards. This is the module that links the PCMCIA card "
4848 "with the airo module.");
4949 MODULE_LICENSE("Dual BSD/GPL");
50−MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340 PCMCIA cards");
5150
5251 /*====================================================================*/
5352
drivers/net/wireless/intersil/hostap/hostap_cs.c+0−1
@@ -26,7 +26,6 @@ static char *dev_info = "hostap_cs"; · 25 unmodified lines
2626 MODULE_AUTHOR("Jouni Malinen");
2727 MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN "
2828 "cards (PC Card).");
29−MODULE_SUPPORTED_DEVICE("Intersil Prism2-based WLAN cards (PC Card)");
3029 MODULE_LICENSE("GPL");
3130
3231
drivers/net/wireless/intersil/hostap/hostap_pci.c+0−1
@@ -27,7 +27,6 @@ static char *dev_info = "hostap_pci"; · 26 unmodified lines
2727 MODULE_AUTHOR("Jouni Malinen");
2828 MODULE_DESCRIPTION("Support for Intersil Prism2.5-based 802.11 wireless LAN "
2929 "PCI cards.");
30−MODULE_SUPPORTED_DEVICE("Intersil Prism2.5-based WLAN PCI cards");
3130 MODULE_LICENSE("GPL");
3231
3332
drivers/net/wireless/intersil/hostap/hostap_plx.c+0−1
@@ -30,7 +30,6 @@ static char *dev_info = "hostap_plx"; · 29 unmodified lines
3030 MODULE_AUTHOR("Jouni Malinen");
3131 MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN "
3232 "cards (PLX).");
33−MODULE_SUPPORTED_DEVICE("Intersil Prism2-based WLAN cards (PLX)");
3433 MODULE_LICENSE("GPL");
3534
3635
drivers/net/wireless/ralink/rt2x00/rt2400pci.c+0−1
@@ -1821,7 +1821,6 @@ static const struct pci_device_id rt2400pci_device_table[] = { · 1820 unmodified lines
18211821 MODULE_AUTHOR(DRV_PROJECT);
18221822 MODULE_VERSION(DRV_VERSION);
18231823 MODULE_DESCRIPTION("Ralink RT2400 PCI & PCMCIA Wireless LAN driver.");
1824−MODULE_SUPPORTED_DEVICE("Ralink RT2460 PCI & PCMCIA chipset based cards");
18251824 MODULE_DEVICE_TABLE(pci, rt2400pci_device_table);
18261825 MODULE_LICENSE("GPL");
18271826
drivers/net/wireless/ralink/rt2x00/rt2500pci.c+0−1
@@ -2119,7 +2119,6 @@ static const struct pci_device_id rt2500pci_device_table[] = { · 2118 unmodified lines
21192119 MODULE_AUTHOR(DRV_PROJECT);
21202120 MODULE_VERSION(DRV_VERSION);
21212121 MODULE_DESCRIPTION("Ralink RT2500 PCI & PCMCIA Wireless LAN driver.");
2122−MODULE_SUPPORTED_DEVICE("Ralink RT2560 PCI & PCMCIA chipset based cards");
21232122 MODULE_DEVICE_TABLE(pci, rt2500pci_device_table);
21242123 MODULE_LICENSE("GPL");
21252124
drivers/net/wireless/ralink/rt2x00/rt2500usb.c+0−1
@@ -1956,7 +1956,6 @@ static const struct usb_device_id rt2500usb_device_table[] = { · 1955 unmodified lines
19561956 MODULE_AUTHOR(DRV_PROJECT);
19571957 MODULE_VERSION(DRV_VERSION);
19581958 MODULE_DESCRIPTION("Ralink RT2500 USB Wireless LAN driver.");
1959−MODULE_SUPPORTED_DEVICE("Ralink RT2570 USB chipset based cards");
19601959 MODULE_DEVICE_TABLE(usb, rt2500usb_device_table);
19611960 MODULE_LICENSE("GPL");
19621961
drivers/net/wireless/ralink/rt2x00/rt2800pci.c+0−1
@@ -439,7 +439,6 @@ static const struct pci_device_id rt2800pci_device_table[] = { · 438 unmodified lines
439439 MODULE_AUTHOR(DRV_PROJECT);
440440 MODULE_VERSION(DRV_VERSION);
441441 MODULE_DESCRIPTION("Ralink RT2800 PCI & PCMCIA Wireless LAN driver.");
442−MODULE_SUPPORTED_DEVICE("Ralink RT2860 PCI & PCMCIA chipset based cards");
443442 MODULE_FIRMWARE(FIRMWARE_RT2860);
444443 MODULE_DEVICE_TABLE(pci, rt2800pci_device_table);
445444 MODULE_LICENSE("GPL");
drivers/net/wireless/ralink/rt2x00/rt2800usb.c+0−1
@@ -1248,7 +1248,6 @@ static const struct usb_device_id rt2800usb_device_table[] = { · 1247 unmodified lines
12481248 MODULE_AUTHOR(DRV_PROJECT);
12491249 MODULE_VERSION(DRV_VERSION);
12501250 MODULE_DESCRIPTION("Ralink RT2800 USB Wireless LAN driver.");
1251−MODULE_SUPPORTED_DEVICE("Ralink RT2870 USB chipset based cards");
12521251 MODULE_DEVICE_TABLE(usb, rt2800usb_device_table);
12531252 MODULE_FIRMWARE(FIRMWARE_RT2870);
12541253 MODULE_LICENSE("GPL");
drivers/net/wireless/ralink/rt2x00/rt61pci.c+0−2
@@ -2993,8 +2993,6 @@ static const struct pci_device_id rt61pci_device_table[] = { · 2992 unmodified lines
29932993 MODULE_AUTHOR(DRV_PROJECT);
29942994 MODULE_VERSION(DRV_VERSION);
29952995 MODULE_DESCRIPTION("Ralink RT61 PCI & PCMCIA Wireless LAN driver.");
2996−MODULE_SUPPORTED_DEVICE("Ralink RT2561, RT2561s & RT2661 "
2997− "PCI & PCMCIA chipset based cards");
29982996 MODULE_DEVICE_TABLE(pci, rt61pci_device_table);
29992997 MODULE_FIRMWARE(FIRMWARE_RT2561);
30002998 MODULE_FIRMWARE(FIRMWARE_RT2561s);
drivers/net/wireless/ralink/rt2x00/rt73usb.c+0−1
@@ -2513,7 +2513,6 @@ static const struct usb_device_id rt73usb_device_table[] = { · 2512 unmodified lines
25132513 MODULE_AUTHOR(DRV_PROJECT);
25142514 MODULE_VERSION(DRV_VERSION);
25152515 MODULE_DESCRIPTION("Ralink RT73 USB Wireless LAN driver.");
2516−MODULE_SUPPORTED_DEVICE("Ralink RT2571W & RT2671 USB chipset based cards");
25172516 MODULE_DEVICE_TABLE(usb, rt73usb_device_table);
25182517 MODULE_FIRMWARE(FIRMWARE_RT2571);
25192518 MODULE_LICENSE("GPL");
drivers/net/wireless/rsi/rsi_91x_main.c+0−1
@@ -441,6 +441,5 @@ module_init(rsi_91x_hal_module_init); · 440 unmodified lines
441441 module_exit(rsi_91x_hal_module_exit);
442442 MODULE_AUTHOR("Redpine Signals Inc");
443443 MODULE_DESCRIPTION("Station driver for RSI 91x devices");
444−MODULE_SUPPORTED_DEVICE("RSI-91x");
445444 MODULE_VERSION("0.1");
446445 MODULE_LICENSE("Dual BSD/GPL");
drivers/net/wireless/rsi/rsi_91x_sdio.c+0−1
@@ -1571,7 +1571,6 @@ module_exit(rsi_module_exit); · 1570 unmodified lines
15711571
15721572 MODULE_AUTHOR("Redpine Signals Inc");
15731573 MODULE_DESCRIPTION("Common SDIO layer for RSI drivers");
1574−MODULE_SUPPORTED_DEVICE("RSI-91x");
15751574 MODULE_DEVICE_TABLE(sdio, rsi_dev_table);
15761575 MODULE_FIRMWARE(FIRMWARE_RSI9113);
15771576 MODULE_VERSION("0.1");
drivers/net/wireless/rsi/rsi_91x_usb.c+0−1
@@ -928,7 +928,6 @@ module_usb_driver(rsi_driver); · 927 unmodified lines
928928
929929 MODULE_AUTHOR("Redpine Signals Inc");
930930 MODULE_DESCRIPTION("Common USB layer for RSI drivers");
931−MODULE_SUPPORTED_DEVICE("RSI-91x");
932931 MODULE_DEVICE_TABLE(usb, rsi_dev_table);
933932 MODULE_FIRMWARE(FIRMWARE_RSI9113);
934933 MODULE_VERSION("0.1");
drivers/nvme/host/core.c+21−43
@@ -1226,28 +1226,12 @@ static void nvme_keep_alive_end_io(struct request *rq, blk_status_t status) · 1225 unmodified lines
12261226 queue_delayed_work(nvme_wq, &ctrl->ka_work, ctrl->kato * HZ);
12271227 }
12281228
1229−static int nvme_keep_alive(struct nvme_ctrl *ctrl)
1230−{
1231− struct request *rq;
1232−
1233− rq = nvme_alloc_request(ctrl->admin_q, &ctrl->ka_cmd,
1234− BLK_MQ_REQ_RESERVED);
1235− if (IS_ERR(rq))
1236− return PTR_ERR(rq);
1237−
1238− rq->timeout = ctrl->kato * HZ;
1239− rq->end_io_data = ctrl;
1240−
1241− blk_execute_rq_nowait(NULL, rq, 0, nvme_keep_alive_end_io);
1242−
1243− return 0;
1244−}
1245−
12461229 static void nvme_keep_alive_work(struct work_struct *work)
12471230 {
12481231 struct nvme_ctrl *ctrl = container_of(to_delayed_work(work),
12491232 struct nvme_ctrl, ka_work);
12501233 bool comp_seen = ctrl->comp_seen;
1234+ struct request *rq;
12511235
12521236 if ((ctrl->ctratt & NVME_CTRL_ATTR_TBKAS) && comp_seen) {
12531237 dev_dbg(ctrl->device,
@@ -1257,12 +1241,18 @@ static void nvme_keep_alive_work(struct work_struct *work) · 3 unmodified lines
12571241 return;
12581242 }
12591243
1260− if (nvme_keep_alive(ctrl)) {
1244+ rq = nvme_alloc_request(ctrl->admin_q, &ctrl->ka_cmd,
1245+ BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT);
1246+ if (IS_ERR(rq)) {
12611247 /* allocation failure, reset the controller */
1262− dev_err(ctrl->device, "keep-alive failed\n");
1248+ dev_err(ctrl->device, "keep-alive failed: %ld\n", PTR_ERR(rq));
12631249 nvme_reset_ctrl(ctrl);
12641250 return;
12651251 }
1252+
1253+ rq->timeout = ctrl->kato * HZ;
1254+ rq->end_io_data = ctrl;
1255+ blk_execute_rq_nowait(NULL, rq, 0, nvme_keep_alive_end_io);
12661256 }
12671257
12681258 static void nvme_start_keep_alive(struct nvme_ctrl *ctrl)
@@ -1964,30 +1954,18 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns) · 695 unmodified lines
19641954 blk_queue_max_write_zeroes_sectors(queue, UINT_MAX);
19651955 }
19661956
1967−static void nvme_config_write_zeroes(struct gendisk *disk, struct nvme_ns *ns)
1957+/*
1958+ * Even though NVMe spec explicitly states that MDTS is not applicable to the
1959+ * write-zeroes, we are cautious and limit the size to the controllers
1960+ * max_hw_sectors value, which is based on the MDTS field and possibly other
1961+ * limiting factors.
1962+ */
1963+static void nvme_config_write_zeroes(struct request_queue *q,
1964+ struct nvme_ctrl *ctrl)
19681965 {
1969− u64 max_blocks;
1970−
1971− if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) ||
1972− (ns->ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES))
1973− return;
1974− /*
1975− * Even though NVMe spec explicitly states that MDTS is not
1976− * applicable to the write-zeroes:- "The restriction does not apply to
1977− * commands that do not transfer data between the host and the
1978− * controller (e.g., Write Uncorrectable ro Write Zeroes command).".
1979− * In order to be more cautious use controller's max_hw_sectors value
1980− * to configure the maximum sectors for the write-zeroes which is
1981− * configured based on the controller's MDTS field in the
1982− * nvme_init_identify() if available.
1983− */
1984− if (ns->ctrl->max_hw_sectors == UINT_MAX)
1985− max_blocks = (u64)USHRT_MAX + 1;
1986− else
1987− max_blocks = ns->ctrl->max_hw_sectors + 1;
1988−
1989− blk_queue_max_write_zeroes_sectors(disk->queue,
1990− nvme_lba_to_sect(ns, max_blocks));
1966+ if ((ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) &&
1967+ !(ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES))
1968+ blk_queue_max_write_zeroes_sectors(q, ctrl->max_hw_sectors);
19911969 }
19921970
19931971 static bool nvme_ns_ids_valid(struct nvme_ns_ids *ids)
@@ -2159,7 +2137,7 @@ static void nvme_update_disk_info(struct gendisk *disk, · 165 unmodified lines
21592137 set_capacity_and_notify(disk, capacity);
21602138
21612139 nvme_config_discard(disk, ns);
2162− nvme_config_write_zeroes(disk, ns);
2140+ nvme_config_write_zeroes(disk->queue, ns->ctrl);
21632141
21642142 set_disk_ro(disk, (id->nsattr & NVME_NS_ATTR_RO) ||
21652143 test_bit(NVME_NS_FORCE_RO, &ns->flags));
drivers/nvme/host/fabrics.h+7−0
@@ -18,6 +18,13 @@ · 17 unmodified lines
1818 /* default is -1: the fail fast mechanism is disabled */
1919 #define NVMF_DEF_FAIL_FAST_TMO -1
2020
21+/*
22+ * Reserved one command for internal usage. This command is used for sending
23+ * the connect command, as well as for the keep alive command on the admin
24+ * queue once live.
25+ */
26+#define NVMF_RESERVED_TAGS 1
27+
2128 /*
2229 * Define a host as seen by the target. We allocate one at boot, but also
2330 * allow the override it when creating controllers. This is both to provide
drivers/nvme/host/fc.c+2−2
@@ -2863,7 +2863,7 @@ nvme_fc_create_io_queues(struct nvme_fc_ctrl *ctrl) · 2862 unmodified lines
28632863 memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set));
28642864 ctrl->tag_set.ops = &nvme_fc_mq_ops;
28652865 ctrl->tag_set.queue_depth = ctrl->ctrl.opts->queue_size;
2866− ctrl->tag_set.reserved_tags = 1; /* fabric connect */
2866+ ctrl->tag_set.reserved_tags = NVMF_RESERVED_TAGS;
28672867 ctrl->tag_set.numa_node = ctrl->ctrl.numa_node;
28682868 ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
28692869 ctrl->tag_set.cmd_size =
@@ -3485,7 +3485,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · 615 unmodified lines
34853485 memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set));
34863486 ctrl->admin_tag_set.ops = &nvme_fc_admin_mq_ops;
34873487 ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH;
3488− ctrl->admin_tag_set.reserved_tags = 2; /* fabric connect + Keep-Alive */
3488+ ctrl->admin_tag_set.reserved_tags = NVMF_RESERVED_TAGS;
34893489 ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node;
34903490 ctrl->admin_tag_set.cmd_size =
34913491 struct_size((struct nvme_fcp_op_w_sgl *)NULL, priv,
drivers/nvme/host/rdma.c+7−4
@@ -736,8 +736,11 @@ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl) · 735 unmodified lines
736736 return ret;
737737
738738 ctrl->ctrl.queue_count = nr_io_queues + 1;
739− if (ctrl->ctrl.queue_count < 2)
740− return 0;
739+ if (ctrl->ctrl.queue_count < 2) {
740+ dev_err(ctrl->ctrl.device,
741+ "unable to set any I/O queues\n");
742+ return -ENOMEM;
743+ }
741744
742745 dev_info(ctrl->ctrl.device,
743746 "creating %d I/O queues.\n", nr_io_queues);
@@ -798,7 +801,7 @@ static struct blk_mq_tag_set *nvme_rdma_alloc_tagset(struct nvme_ctrl *nctrl, · 54 unmodified lines
798801 memset(set, 0, sizeof(*set));
799802 set->ops = &nvme_rdma_admin_mq_ops;
800803 set->queue_depth = NVME_AQ_MQ_TAG_DEPTH;
801− set->reserved_tags = 2; /* connect + keep-alive */
804+ set->reserved_tags = NVMF_RESERVED_TAGS;
802805 set->numa_node = nctrl->numa_node;
803806 set->cmd_size = sizeof(struct nvme_rdma_request) +
804807 NVME_RDMA_DATA_SGL_SIZE;
@@ -811,7 +814,7 @@ static struct blk_mq_tag_set *nvme_rdma_alloc_tagset(struct nvme_ctrl *nctrl, · 6 unmodified lines
811814 memset(set, 0, sizeof(*set));
812815 set->ops = &nvme_rdma_mq_ops;
813816 set->queue_depth = nctrl->sqsize + 1;
814− set->reserved_tags = 1; /* fabric connect */
817+ set->reserved_tags = NVMF_RESERVED_TAGS;
815818 set->numa_node = nctrl->numa_node;
816819 set->flags = BLK_MQ_F_SHOULD_MERGE;
817820 set->cmd_size = sizeof(struct nvme_rdma_request) +
drivers/nvme/host/tcp.c+15−5
@@ -287,7 +287,7 @@ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req, · 286 unmodified lines
287287 * directly, otherwise queue io_work. Also, only do that if we
288288 * are on the same cpu, so we don't introduce contention.
289289 */
290− if (queue->io_cpu == __smp_processor_id() &&
290+ if (queue->io_cpu == raw_smp_processor_id() &&
291291 sync && empty && mutex_trylock(&queue->send_mutex)) {
292292 queue->more_requests = !last;
293293 nvme_tcp_send_all(queue);
@@ -568,6 +568,13 @@ static int nvme_tcp_setup_h2c_data_pdu(struct nvme_tcp_request *req, · 274 unmodified lines
568568 req->pdu_len = le32_to_cpu(pdu->r2t_length);
569569 req->pdu_sent = 0;
570570
571+ if (unlikely(!req->pdu_len)) {
572+ dev_err(queue->ctrl->ctrl.device,
573+ "req %d r2t len is %u, probably a bug...\n",
574+ rq->tag, req->pdu_len);
575+ return -EPROTO;
576+ }
577+
571578 if (unlikely(req->data_sent + req->pdu_len > req->data_len)) {
572579 dev_err(queue->ctrl->ctrl.device,
573580 "req %d r2t len %u exceeded data len %u (%zu sent)\n",
@@ -1575,7 +1582,7 @@ static struct blk_mq_tag_set *nvme_tcp_alloc_tagset(struct nvme_ctrl *nctrl, · 1001 unmodified lines
15751582 memset(set, 0, sizeof(*set));
15761583 set->ops = &nvme_tcp_admin_mq_ops;
15771584 set->queue_depth = NVME_AQ_MQ_TAG_DEPTH;
1578− set->reserved_tags = 2; /* connect + keep-alive */
1585+ set->reserved_tags = NVMF_RESERVED_TAGS;
15791586 set->numa_node = nctrl->numa_node;
15801587 set->flags = BLK_MQ_F_BLOCKING;
15811588 set->cmd_size = sizeof(struct nvme_tcp_request);
@@ -1587,7 +1594,7 @@ static struct blk_mq_tag_set *nvme_tcp_alloc_tagset(struct nvme_ctrl *nctrl, · 5 unmodified lines
15871594 memset(set, 0, sizeof(*set));
15881595 set->ops = &nvme_tcp_mq_ops;
15891596 set->queue_depth = nctrl->sqsize + 1;
1590− set->reserved_tags = 1; /* fabric connect */
1597+ set->reserved_tags = NVMF_RESERVED_TAGS;
15911598 set->numa_node = nctrl->numa_node;
15921599 set->flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING;
15931600 set->cmd_size = sizeof(struct nvme_tcp_request);
@@ -1745,8 +1752,11 @@ static int nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl) · 151 unmodified lines
17451752 return ret;
17461753
17471754 ctrl->queue_count = nr_io_queues + 1;
1748− if (ctrl->queue_count < 2)
1749− return 0;
1755+ if (ctrl->queue_count < 2) {
1756+ dev_err(ctrl->device,
1757+ "unable to set any I/O queues\n");
1758+ return -ENOMEM;
1759+ }
17501760
17511761 dev_info(ctrl->device,
17521762 "creating %d I/O queues.\n", nr_io_queues);
drivers/nvme/target/core.c+14−3
@@ -1118,9 +1118,20 @@ static void nvmet_start_ctrl(struct nvmet_ctrl *ctrl) · 1117 unmodified lines
11181118 {
11191119 lockdep_assert_held(&ctrl->lock);
11201120
1121− if (nvmet_cc_iosqes(ctrl->cc) != NVME_NVM_IOSQES ||
1122− nvmet_cc_iocqes(ctrl->cc) != NVME_NVM_IOCQES ||
1123− nvmet_cc_mps(ctrl->cc) != 0 ||
1121+ /*
1122+ * Only I/O controllers should verify iosqes,iocqes.
1123+ * Strictly speaking, the spec says a discovery controller
1124+ * should verify iosqes,iocqes are zeroed, however that
1125+ * would break backwards compatibility, so don't enforce it.
1126+ */
1127+ if (ctrl->subsys->type != NVME_NQN_DISC &&
1128+ (nvmet_cc_iosqes(ctrl->cc) != NVME_NVM_IOSQES ||
1129+ nvmet_cc_iocqes(ctrl->cc) != NVME_NVM_IOCQES)) {
1130+ ctrl->csts = NVME_CSTS_CFS;
1131+ return;
1132+ }
1133+
1134+ if (nvmet_cc_mps(ctrl->cc) != 0 ||
11241135 nvmet_cc_ams(ctrl->cc) != 0 ||
11251136 nvmet_cc_css(ctrl->cc) != 0) {
11261137 ctrl->csts = NVME_CSTS_CFS;
drivers/nvme/target/loop.c+2−2
@@ -349,7 +349,7 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl) · 348 unmodified lines
349349 memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set));
350350 ctrl->admin_tag_set.ops = &nvme_loop_admin_mq_ops;
351351 ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH;
352− ctrl->admin_tag_set.reserved_tags = 2; /* connect + keep-alive */
352+ ctrl->admin_tag_set.reserved_tags = NVMF_RESERVED_TAGS;
353353 ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node;
354354 ctrl->admin_tag_set.cmd_size = sizeof(struct nvme_loop_iod) +
355355 NVME_INLINE_SG_CNT * sizeof(struct scatterlist);
@@ -520,7 +520,7 @@ static int nvme_loop_create_io_queues(struct nvme_loop_ctrl *ctrl) · 164 unmodified lines
520520 memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set));
521521 ctrl->tag_set.ops = &nvme_loop_mq_ops;
522522 ctrl->tag_set.queue_depth = ctrl->ctrl.opts->queue_size;
523− ctrl->tag_set.reserved_tags = 1; /* fabric connect */
523+ ctrl->tag_set.reserved_tags = NVMF_RESERVED_TAGS;
524524 ctrl->tag_set.numa_node = ctrl->ctrl.numa_node;
525525 ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
526526 ctrl->tag_set.cmd_size = sizeof(struct nvme_loop_iod) +
drivers/nvme/target/tcp.c+1−1
@@ -1098,11 +1098,11 @@ static int nvmet_tcp_try_recv_data(struct nvmet_tcp_queue *queue) · 1097 unmodified lines
10981098 cmd->rbytes_done += ret;
10991099 }
11001100
1101+ nvmet_tcp_unmap_pdu_iovec(cmd);
11011102 if (queue->data_digest) {
11021103 nvmet_tcp_prep_recv_ddgst(cmd);
11031104 return 0;
11041105 }
1105− nvmet_tcp_unmap_pdu_iovec(cmd);
11061106
11071107 if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED) &&
11081108 cmd->rbytes_done == cmd->req.transfer_len) {
drivers/parport/parport_amiga.c+0−1
@@ -241,6 +241,5 @@ module_platform_driver_probe(amiga_parallel_driver, amiga_parallel_probe); · 240 unmodified lines
241241
242242 MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>");
243243 MODULE_DESCRIPTION("Parport Driver for Amiga builtin Port");
244−MODULE_SUPPORTED_DEVICE("Amiga builtin Parallel Port");
245244 MODULE_LICENSE("GPL");
246245 MODULE_ALIAS("platform:amiga-parallel");
drivers/parport/parport_atari.c+0−1
@@ -218,7 +218,6 @@ static void __exit parport_atari_exit(void) · 217 unmodified lines
218218
219219 MODULE_AUTHOR("Andreas Schwab");
220220 MODULE_DESCRIPTION("Parport Driver for Atari builtin Port");
221−MODULE_SUPPORTED_DEVICE("Atari builtin Parallel Port");
222221 MODULE_LICENSE("GPL");
223222
224223 module_init(parport_atari_init)
drivers/parport/parport_gsc.c+0−1
@@ -41,7 +41,6 @@ · 40 unmodified lines
4141
4242 MODULE_AUTHOR("Helge Deller <deller@gmx.de>");
4343 MODULE_DESCRIPTION("HP-PARISC PC-style parallel port driver");
44−MODULE_SUPPORTED_DEVICE("integrated PC-style parallel port");
4544 MODULE_LICENSE("GPL");
4645
4746
drivers/parport/parport_mfc3.c+0−1
@@ -359,7 +359,6 @@ static void __exit parport_mfc3_exit(void) · 358 unmodified lines
359359
360360 MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>");
361361 MODULE_DESCRIPTION("Parport Driver for Multiface 3 expansion cards Parallel Port");
362−MODULE_SUPPORTED_DEVICE("Multiface 3 Parallel Port");
363362 MODULE_LICENSE("GPL");
364363
365364 module_init(parport_mfc3_init)
drivers/parport/parport_sunbpp.c+0−1
@@ -377,6 +377,5 @@ module_platform_driver(bpp_sbus_driver); · 376 unmodified lines
377377
378378 MODULE_AUTHOR("Derrick J Brashear");
379379 MODULE_DESCRIPTION("Parport Driver for Sparc bidirectional Port");
380−MODULE_SUPPORTED_DEVICE("Sparc Bidirectional Parallel Port");
381380 MODULE_VERSION("2.0");
382381 MODULE_LICENSE("GPL");
drivers/pci/hotplug/rpadlpar_sysfs.c+6−8
@@ -34,12 +34,11 @@ static ssize_t add_slot_store(struct kobject *kobj, struct kobj_attribute *attr, · 33 unmodified lines
3434 if (nbytes >= MAX_DRC_NAME_LEN)
3535 return 0;
3636
37− memcpy(drc_name, buf, nbytes);
37+ strscpy(drc_name, buf, nbytes + 1);
3838
3939 end = strchr(drc_name, '\n');
40− if (!end)
41− end = &drc_name[nbytes];
42− *end = '\0';
40+ if (end)
41+ *end = '\0';
4342
4443 rc = dlpar_add_slot(drc_name);
4544 if (rc)
@@ -65,12 +64,11 @@ static ssize_t remove_slot_store(struct kobject *kobj, · 19 unmodified lines
6564 if (nbytes >= MAX_DRC_NAME_LEN)
6665 return 0;
6766
68− memcpy(drc_name, buf, nbytes);
67+ strscpy(drc_name, buf, nbytes + 1);
6968
7069 end = strchr(drc_name, '\n');
71− if (!end)
72− end = &drc_name[nbytes];
73− *end = '\0';
70+ if (end)
71+ *end = '\0';
7472
7573 rc = dlpar_remove_slot(drc_name);
7674 if (rc)
drivers/pci/hotplug/s390_pci_hpc.c+2−1
@@ -93,8 +93,9 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) · 92 unmodified lines
9393 pci_dev_put(pdev);
9494 return -EBUSY;
9595 }
96+ pci_dev_put(pdev);
9697
97− zpci_remove_device(zdev);
98+ zpci_remove_device(zdev, false);
9899
99100 rc = zpci_disable_device(zdev);
100101 if (rc)
drivers/s390/block/dasd.c+0−1
@@ -63,7 +63,6 @@ void dasd_int_handler(struct ccw_device *, unsigned long, struct irb *); · 62 unmodified lines
6363 MODULE_AUTHOR("Holger Smolinski <Holger.Smolinski@de.ibm.com>");
6464 MODULE_DESCRIPTION("Linux on S/390 DASD device driver,"
6565 " Copyright IBM Corp. 2000");
66−MODULE_SUPPORTED_DEVICE("dasd");
6766 MODULE_LICENSE("GPL");
6867
6968 /*
drivers/sbus/char/display7seg.c+0−1
@@ -50,7 +50,6 @@ MODULE_PARM_DESC(sol_compat, · 49 unmodified lines
5050 MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");
5151 MODULE_DESCRIPTION("7-Segment Display driver for Sun Microsystems CP1400/1500");
5252 MODULE_LICENSE("GPL");
53−MODULE_SUPPORTED_DEVICE("d7s");
5453
5554 struct d7s {
5655 void __iomem *regs;
drivers/scsi/hpsa.c+0−1
@@ -80,7 +80,6 @@ · 79 unmodified lines
8080 MODULE_AUTHOR("Hewlett-Packard Company");
8181 MODULE_DESCRIPTION("Driver for HP Smart Array Controller version " \
8282 HPSA_DRIVER_VERSION);
83−MODULE_SUPPORTED_DEVICE("HP Smart Array Controllers");
8483 MODULE_VERSION(HPSA_DRIVER_VERSION);
8584 MODULE_LICENSE("GPL");
8685 MODULE_ALIAS("cciss");
drivers/scsi/ibmvscsi/ibmvfc.c+2−0
@@ -5784,6 +5784,8 @@ static void ibmvfc_free_mem(struct ibmvfc_host *vhost) · 5783 unmodified lines
57845784 vhost->disc_buf_dma);
57855785 dma_free_coherent(vhost->dev, sizeof(*vhost->login_buf),
57865786 vhost->login_buf, vhost->login_buf_dma);
5787+ dma_free_coherent(vhost->dev, sizeof(*vhost->channel_setup_buf),
5788+ vhost->channel_setup_buf, vhost->channel_setup_dma);
57875789 dma_pool_destroy(vhost->sg_pool);
57885790 ibmvfc_free_queue(vhost, async_q);
57895791 LEAVE;
drivers/scsi/lpfc/lpfc_debugfs.c+2−2
@@ -2421,7 +2421,7 @@ lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf, · 2420 unmodified lines
24212421 memset(dstbuf, 0, 33);
24222422 size = (nbytes < 32) ? nbytes : 32;
24232423 if (copy_from_user(dstbuf, buf, size))
2424− return 0;
2424+ return -EFAULT;
24252425
24262426 if (dent == phba->debug_InjErrLBA) {
24272427 if ((dstbuf[0] == 'o') && (dstbuf[1] == 'f') &&
@@ -2430,7 +2430,7 @@ lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf, · 2 unmodified lines
24302430 }
24312431
24322432 if ((tmp == 0) && (kstrtoull(dstbuf, 0, &tmp)))
2433− return 0;
2433+ return -EINVAL;
24342434
24352435 if (dent == phba->debug_writeGuard)
24362436 phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp;
drivers/scsi/mpt3sas/mpt3sas_scsih.c+1−1
@@ -413,7 +413,7 @@ mpt3sas_get_port_by_id(struct MPT3SAS_ADAPTER *ioc, · 412 unmodified lines
413413 * And add this object to port_table_list.
414414 */
415415 if (!ioc->multipath_on_hba) {
416− port = kzalloc(sizeof(struct hba_port), GFP_KERNEL);
416+ port = kzalloc(sizeof(struct hba_port), GFP_ATOMIC);
417417 if (!port)
418418 return NULL;
419419
drivers/scsi/myrs.c+1−1
@@ -2273,12 +2273,12 @@ static void myrs_cleanup(struct myrs_hba *cs) · 2272 unmodified lines
22732273 if (cs->mmio_base) {
22742274 cs->disable_intr(cs);
22752275 iounmap(cs->mmio_base);
2276+ cs->mmio_base = NULL;
22762277 }
22772278 if (cs->irq)
22782279 free_irq(cs->irq, cs);
22792280 if (cs->io_addr)
22802281 release_region(cs->io_addr, 0x80);
2281− iounmap(cs->mmio_base);
22822282 pci_set_drvdata(pdev, NULL);
22832283 pci_disable_device(pdev);
22842284 scsi_host_put(cs->host);
drivers/scsi/pcmcia/nsp_cs.c+0−1
@@ -55,7 +55,6 @@ · 54 unmodified lines
5555
5656 MODULE_AUTHOR("YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>");
5757 MODULE_DESCRIPTION("WorkBit NinjaSCSI-3 / NinjaSCSI-32Bi(16bit) PCMCIA SCSI host adapter module");
58−MODULE_SUPPORTED_DEVICE("sd,sr,sg,st");
5958 MODULE_LICENSE("GPL");
6059
6160 #include "nsp_io.h"
drivers/scsi/qla2xxx/qla_target.h+1−1
@@ -116,7 +116,6 @@ · 115 unmodified lines
116116 (min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \
117117 QLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0))
118118 #endif
119−#endif
120119
121120 #define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha)) \
122121 ? le16_to_cpu((iocb)->u.isp2x.target.extended) \
@@ -244,6 +243,7 @@ struct ctio_to_2xxx { · 121 unmodified lines
244243 #ifndef CTIO_RET_TYPE
245244 #define CTIO_RET_TYPE 0x17 /* CTIO return entry */
246245 #define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */
246+#endif
247247
248248 struct fcp_hdr {
249249 uint8_t r_ctl;
drivers/scsi/sd_zbc.c+11−8
@@ -280,27 +280,28 @@ static int sd_zbc_update_wp_offset_cb(struct blk_zone *zone, unsigned int idx, · 279 unmodified lines
280280 static void sd_zbc_update_wp_offset_workfn(struct work_struct *work)
281281 {
282282 struct scsi_disk *sdkp;
283+ unsigned long flags;
283284 unsigned int zno;
284285 int ret;
285286
286287 sdkp = container_of(work, struct scsi_disk, zone_wp_offset_work);
287288
288− spin_lock_bh(&sdkp->zones_wp_offset_lock);
289+ spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags);
289290 for (zno = 0; zno < sdkp->nr_zones; zno++) {
290291 if (sdkp->zones_wp_offset[zno] != SD_ZBC_UPDATING_WP_OFST)
291292 continue;
292293
293− spin_unlock_bh(&sdkp->zones_wp_offset_lock);
294+ spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags);
294295 ret = sd_zbc_do_report_zones(sdkp, sdkp->zone_wp_update_buf,
295296 SD_BUF_SIZE,
296297 zno * sdkp->zone_blocks, true);
297− spin_lock_bh(&sdkp->zones_wp_offset_lock);
298+ spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags);
298299 if (!ret)
299300 sd_zbc_parse_report(sdkp, sdkp->zone_wp_update_buf + 64,
300301 zno, sd_zbc_update_wp_offset_cb,
301302 sdkp);
302303 }
303− spin_unlock_bh(&sdkp->zones_wp_offset_lock);
304+ spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags);
304305
305306 scsi_device_put(sdkp->device);
306307 }
@@ -324,6 +325,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba, · 17 unmodified lines
324325 struct request *rq = cmd->request;
325326 struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);
326327 unsigned int wp_offset, zno = blk_rq_zone_no(rq);
328+ unsigned long flags;
327329 blk_status_t ret;
328330
329331 ret = sd_zbc_cmnd_checks(cmd);
@@ -337,7 +339,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba, · 7 unmodified lines
337339 if (!blk_req_zone_write_trylock(rq))
338340 return BLK_STS_ZONE_RESOURCE;
339341
340− spin_lock_bh(&sdkp->zones_wp_offset_lock);
342+ spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags);
341343 wp_offset = sdkp->zones_wp_offset[zno];
342344 switch (wp_offset) {
343345 case SD_ZBC_INVALID_WP_OFST:
@@ -366,7 +368,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba, · 22 unmodified lines
366368
367369 *lba += wp_offset;
368370 }
369− spin_unlock_bh(&sdkp->zones_wp_offset_lock);
371+ spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags);
370372 if (ret)
371373 blk_req_zone_write_unlock(rq);
372374 return ret;
@@ -445,6 +447,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, · 72 unmodified lines
445447 struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);
446448 unsigned int zno = blk_rq_zone_no(rq);
447449 enum req_opf op = req_op(rq);
450+ unsigned long flags;
448451
449452 /*
450453 * If we got an error for a command that needs updating the write
@@ -452,7 +455,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, · 1 unmodified line
452455 * invalid to force an update from disk the next time a zone append
453456 * command is issued.
454457 */
455− spin_lock_bh(&sdkp->zones_wp_offset_lock);
458+ spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags);
456459
457460 if (result && op != REQ_OP_ZONE_RESET_ALL) {
458461 if (op == REQ_OP_ZONE_APPEND) {
@@ -496,7 +499,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, · 37 unmodified lines
496499 }
497500
498501 unlock_wp_offset:
499− spin_unlock_bh(&sdkp->zones_wp_offset_lock);
502+ spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags);
500503
501504 return good_bytes;
502505 }
drivers/scsi/smartpqi/smartpqi_init.c+0−1
@@ -48,7 +48,6 @@ · 47 unmodified lines
4848 MODULE_AUTHOR("Microsemi");
4949 MODULE_DESCRIPTION("Driver for Microsemi Smart Family Controller version "
5050 DRIVER_VERSION);
51−MODULE_SUPPORTED_DEVICE("Microsemi Smart Family Controllers");
5251 MODULE_VERSION(DRIVER_VERSION);
5352 MODULE_LICENSE("GPL");
5453
drivers/scsi/st.c+1−1
@@ -1269,8 +1269,8 @@ static int st_open(struct inode *inode, struct file *filp) · 1268 unmodified lines
12691269 spin_lock(&st_use_lock);
12701270 if (STp->in_use) {
12711271 spin_unlock(&st_use_lock);
1272− scsi_tape_put(STp);
12731272 DEBC_printk(STp, "Device already in use.\n");
1273+ scsi_tape_put(STp);
12741274 return (-EBUSY);
12751275 }
12761276
drivers/scsi/ufs/ufs-mediatek.c+1−1
@@ -911,7 +911,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm) · 910 unmodified lines
911911 if (!hba->vreg_info.vccq2 || !hba->vreg_info.vcc)
912912 return;
913913
914− if (lpm & !hba->vreg_info.vcc->enabled)
914+ if (lpm && !hba->vreg_info.vcc->enabled)
915915 regulator_set_mode(hba->vreg_info.vccq2->reg,
916916 REGULATOR_MODE_IDLE);
917917 else if (!lpm)
drivers/sh/maple/maple.c+0−1
@@ -30,7 +30,6 @@ · 29 unmodified lines
3030 MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");
3131 MODULE_DESCRIPTION("Maple bus driver for Dreamcast");
3232 MODULE_LICENSE("GPL v2");
33−MODULE_SUPPORTED_DEVICE("{{SEGA, Dreamcast/Maple}}");
3433
3534 static void maple_dma_handler(struct work_struct *work);
3635 static void maple_vblank_handler(struct work_struct *work);
drivers/spi/spi-cadence-quadspi.c+1−0
@@ -1433,6 +1433,7 @@ static int cqspi_probe(struct platform_device *pdev) · 1432 unmodified lines
14331433 cqspi = spi_master_get_devdata(master);
14341434
14351435 cqspi->pdev = pdev;
1436+ platform_set_drvdata(pdev, cqspi);
14361437
14371438 /* Obtain configuration from OF. */
14381439 ret = cqspi_of_get_pdata(cqspi);
drivers/staging/comedi/drivers/cb_pcidas.c+1−1
@@ -1281,7 +1281,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev, · 1280 unmodified lines
12811281 devpriv->amcc + AMCC_OP_REG_INTCSR);
12821282
12831283 ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED,
1284− dev->board_name, dev);
1284+ "cb_pcidas", dev);
12851285 if (ret) {
12861286 dev_dbg(dev->class_dev, "unable to allocate irq %d\n",
12871287 pcidev->irq);
drivers/staging/comedi/drivers/cb_pcidas64.c+1−1
@@ -4035,7 +4035,7 @@ static int auto_attach(struct comedi_device *dev, · 4034 unmodified lines
40354035 init_stc_registers(dev);
40364036
40374037 retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
4038− dev->board_name, dev);
4038+ "cb_pcidas64", dev);
40394039 if (retval) {
40404040 dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
40414041 pcidev->irq);
drivers/staging/comedi/drivers/vmk80xx.c+0−1
@@ -877,5 +877,4 @@ module_comedi_usb_driver(vmk80xx_driver, vmk80xx_usb_driver); · 876 unmodified lines
877877
878878 MODULE_AUTHOR("Manuel Gebele <forensixs@gmx.de>");
879879 MODULE_DESCRIPTION("Velleman USB Board Low-Level Driver");
880−MODULE_SUPPORTED_DEVICE("K8055/K8061 aka VM110/VM140");
881880 MODULE_LICENSE("GPL");
drivers/staging/vt6655/rxtx.h+2−2
@@ -150,7 +150,7 @@ struct vnt_cts { · 149 unmodified lines
150150 u16 reserved;
151151 struct ieee80211_cts data;
152152 u16 reserved2;
153−} __packed;
153+} __packed __aligned(2);
154154
155155 struct vnt_cts_fb {
156156 struct vnt_phy_field b;
@@ -160,7 +160,7 @@ struct vnt_cts_fb { · 3 unmodified lines
160160 __le16 cts_duration_ba_f1;
161161 struct ieee80211_cts data;
162162 u16 reserved2;
163−} __packed;
163+} __packed __aligned(2);
164164
165165 struct vnt_tx_fifo_head {
166166 u8 tx_key[WLAN_KEY_LEN_CCMP];
drivers/tee/optee/core.c+0−1
@@ -747,7 +747,6 @@ module_platform_driver(optee_driver); · 746 unmodified lines
747747
748748 MODULE_AUTHOR("Linaro");
749749 MODULE_DESCRIPTION("OP-TEE driver");
750−MODULE_SUPPORTED_DEVICE("");
751750 MODULE_VERSION("1.0");
752751 MODULE_LICENSE("GPL v2");
753752 MODULE_ALIAS("platform:optee");
drivers/thermal/thermal_sysfs.c+3−0
@@ -674,6 +674,9 @@ void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev, · 673 unmodified lines
674674 {
675675 struct cooling_dev_stats *stats = cdev->stats;
676676
677+ if (!stats)
678+ return;
679+
677680 spin_lock(&stats->lock);
678681
679682 if (stats->state == new_state)
drivers/thunderbolt/switch.c+8−10
@@ -768,12 +768,6 @@ static int tb_init_port(struct tb_port *port) · 767 unmodified lines
768768
769769 tb_dump_port(port->sw->tb, &port->config);
770770
771− /* Control port does not need HopID allocation */
772− if (port->port) {
773− ida_init(&port->in_hopids);
774− ida_init(&port->out_hopids);
775− }
776−
777771 INIT_LIST_HEAD(&port->list);
778772 return 0;
779773
@@ -1842,10 +1836,8 @@ static void tb_switch_release(struct device *dev) · 1062 unmodified lines
18421836 dma_port_free(sw->dma_port);
18431837
18441838 tb_switch_for_each_port(sw, port) {
1845− if (!port->disabled) {
1846− ida_destroy(&port->in_hopids);
1847− ida_destroy(&port->out_hopids);
1848− }
1839+ ida_destroy(&port->in_hopids);
1840+ ida_destroy(&port->out_hopids);
18491841 }
18501842
18511843 kfree(sw->uuid);
@@ -2025,6 +2017,12 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, struct device *parent, · 173 unmodified lines
20252017 /* minimum setup for tb_find_cap and tb_drom_read to work */
20262018 sw->ports[i].sw = sw;
20272019 sw->ports[i].port = i;
2020+
2021+ /* Control port does not need HopID allocation */
2022+ if (i) {
2023+ ida_init(&sw->ports[i].in_hopids);
2024+ ida_init(&sw->ports[i].out_hopids);
2025+ }
20282026 }
20292027
20302028 ret = tb_switch_find_vse_cap(sw, TB_VSE_CAP_PLUG_EVENTS);
drivers/thunderbolt/tb.c+4−0
@@ -138,6 +138,10 @@ static void tb_discover_tunnels(struct tb_switch *sw) · 137 unmodified lines
138138 parent->boot = true;
139139 parent = tb_switch_parent(parent);
140140 }
141+ } else if (tb_tunnel_is_dp(tunnel)) {
142+ /* Keep the domain from powering down */
143+ pm_runtime_get_sync(&tunnel->src_port->sw->dev);
144+ pm_runtime_get_sync(&tunnel->dst_port->sw->dev);
141145 }
142146
143147 list_add_tail(&tunnel->list, &tcm->tunnel_list);
drivers/tty/serial/icom.c+0−2
@@ -1639,8 +1639,6 @@ module_exit(icom_exit); · 1638 unmodified lines
16391639
16401640 MODULE_AUTHOR("Michael Anderson <mjanders@us.ibm.com>");
16411641 MODULE_DESCRIPTION("IBM iSeries Serial IOA driver");
1642−MODULE_SUPPORTED_DEVICE
1643− ("IBM iSeries 2745, 2771, 2772, 2742, 2793 and 2805 Communications adapters");
16441642 MODULE_LICENSE("GPL");
16451643 MODULE_FIRMWARE("icom_call_setup.bin");
16461644 MODULE_FIRMWARE("icom_res_dce.bin");
drivers/tty/serial/jsm/jsm_driver.c+0−1
@@ -19,7 +19,6 @@ · 18 unmodified lines
1919 MODULE_AUTHOR("Digi International, https://www.digi.com");
2020 MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI based product line");
2121 MODULE_LICENSE("GPL");
22−MODULE_SUPPORTED_DEVICE("jsm");
2322
2423 #define JSM_DRIVER_NAME "jsm"
2524 #define NR_PORTS 32
drivers/usb/cdns3/cdnsp-ring.c+4−1
@@ -2197,7 +2197,10 @@ static int cdnsp_queue_isoc_tx(struct cdnsp_device *pdev, · 2196 unmodified lines
21972197 * inverted in the first TDs isoc TRB.
21982198 */
21992199 field = TRB_TYPE(TRB_ISOC) | TRB_TLBPC(last_burst_pkt) |
2200− start_cycle ? 0 : 1 | TRB_SIA | TRB_TBC(burst_count);
2200+ TRB_SIA | TRB_TBC(burst_count);
2201+
2202+ if (!start_cycle)
2203+ field |= TRB_CYCLE;
22012204
22022205 /* Fill the rest of the TRB fields, and remaining normal TRBs. */
22032206 for (i = 0; i < trbs_per_td; i++) {
drivers/usb/dwc3/gadget.c+5−6
@@ -783,8 +783,6 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) · 782 unmodified lines
783783
784784 trace_dwc3_gadget_ep_disable(dep);
785785
786− dwc3_remove_requests(dwc, dep);
787−
788786 /* make sure HW endpoint isn't stalled */
789787 if (dep->flags & DWC3_EP_STALL)
790788 __dwc3_gadget_ep_set_halt(dep, 0, false);
@@ -803,6 +801,8 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) · 12 unmodified lines
803801 dep->endpoint.desc = NULL;
804802 }
805803
804+ dwc3_remove_requests(dwc, dep);
805+
806806 return 0;
807807 }
808808
@@ -1617,7 +1617,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) · 808 unmodified lines
16171617 {
16181618 struct dwc3 *dwc = dep->dwc;
16191619
1620− if (!dep->endpoint.desc || !dwc->pullups_connected) {
1620+ if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) {
16211621 dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
16221622 dep->name);
16231623 return -ESHUTDOWN;
@@ -2247,6 +2247,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) · 623 unmodified lines
22472247 if (!is_on) {
22482248 u32 count;
22492249
2250+ dwc->connected = false;
22502251 /*
22512252 * In the Synopsis DesignWare Cores USB3 Databook Rev. 3.30a
22522253 * Section 4.1.8 Table 4-7, it states that for a device-initiated
@@ -2271,7 +2272,6 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) · 18 unmodified lines
22712272 dwc->ev_buf->lpos = (dwc->ev_buf->lpos + count) %
22722273 dwc->ev_buf->length;
22732274 }
2274− dwc->connected = false;
22752275 } else {
22762276 __dwc3_gadget_start(dwc);
22772277 }
@@ -3329,8 +3329,6 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc) · 1051 unmodified lines
33293329 {
33303330 u32 reg;
33313331
3332− dwc->connected = true;
3333−
33343332 /*
33353333 * WORKAROUND: DWC3 revisions <1.88a have an issue which
33363334 * would cause a missing Disconnect Event if there's a
@@ -3370,6 +3368,7 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc) · 33 unmodified lines
33703368 * transfers."
33713369 */
33723370 dwc3_stop_active_transfers(dwc);
3371+ dwc->connected = true;
33733372
33743373 reg = dwc3_readl(dwc->regs, DWC3_DCTL);
33753374 reg &= ~DWC3_DCTL_TSTCTRL_MASK;
drivers/usb/gadget/configfs.c+10−4
@@ -97,6 +97,8 @@ struct gadget_config_name { · 96 unmodified lines
9797 struct list_head list;
9898 };
9999
100+#define USB_MAX_STRING_WITH_NULL_LEN (USB_MAX_STRING_LEN+1)
101+
100102 static int usb_string_copy(const char *s, char **s_copy)
101103 {
102104 int ret;
@@ -106,12 +108,16 @@ static int usb_string_copy(const char *s, char **s_copy) · 3 unmodified lines
106108 if (ret > USB_MAX_STRING_LEN)
107109 return -EOVERFLOW;
108110
109− str = kstrdup(s, GFP_KERNEL);
110− if (!str)
111− return -ENOMEM;
111+ if (copy) {
112+ str = copy;
113+ } else {
114+ str = kmalloc(USB_MAX_STRING_WITH_NULL_LEN, GFP_KERNEL);
115+ if (!str)
116+ return -ENOMEM;
117+ }
118+ strcpy(str, s);
112119 if (str[ret - 1] == '\n')
113120 str[ret - 1] = '\0';
114− kfree(copy);
115121 *s_copy = str;
116122 return 0;
117123 }
drivers/usb/misc/ldusb.c+0−1
@@ -117,7 +117,6 @@ MODULE_DEVICE_TABLE(usb, ld_usb_table); · 116 unmodified lines
117117 MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>");
118118 MODULE_DESCRIPTION("LD USB Driver");
119119 MODULE_LICENSE("GPL");
120−MODULE_SUPPORTED_DEVICE("LD USB Devices");
121120
122121 /* All interrupt in transfers are collected in a ring buffer to
123122 * avoid racing conditions and get better performance of the driver.
drivers/usb/storage/transport.c+7−0
@@ -656,6 +656,13 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) · 655 unmodified lines
656656 need_auto_sense = 1;
657657 }
658658
659+ /* Some devices (Kindle) require another command after SYNC CACHE */
660+ if ((us->fflags & US_FL_SENSE_AFTER_SYNC) &&
661+ srb->cmnd[0] == SYNCHRONIZE_CACHE) {
662+ usb_stor_dbg(us, "-- sense after SYNC CACHE\n");
663+ need_auto_sense = 1;
664+ }
665+
659666 /*
660667 * If we have a failure, we're going to do a REQUEST_SENSE
661668 * automatically. Note that we differentiate between a command
drivers/usb/storage/unusual_devs.h+12−0
@@ -2211,6 +2211,18 @@ UNUSUAL_DEV( 0x1908, 0x3335, 0x0200, 0x0200, · 2210 unmodified lines
22112211 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
22122212 US_FL_NO_READ_DISC_INFO ),
22132213
2214+/*
2215+ * Reported by Matthias Schwarzott <zzam@gentoo.org>
2216+ * The Amazon Kindle treats SYNCHRONIZE CACHE as an indication that
2217+ * the host may be finished with it, and automatically ejects its
2218+ * emulated media unless it receives another command within one second.
2219+ */
2220+UNUSUAL_DEV( 0x1949, 0x0004, 0x0000, 0x9999,
2221+ "Amazon",
2222+ "Kindle",
2223+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
2224+ US_FL_SENSE_AFTER_SYNC ),
2225+
22142226 /*
22152227 * Reported by Oliver Neukum <oneukum@suse.com>
22162228 * This device morphes spontaneously into another device if the access
drivers/usb/typec/tcpm/tcpm.c+9−2
@@ -945,6 +945,7 @@ static int tcpm_set_current_limit(struct tcpm_port *port, u32 max_ma, u32 mv) · 944 unmodified lines
945945
946946 port->supply_voltage = mv;
947947 port->current_limit = max_ma;
948+ power_supply_changed(port->psy);
948949
949950 if (port->tcpc->set_current_limit)
950951 ret = port->tcpc->set_current_limit(port->tcpc, max_ma, mv);
@@ -2931,6 +2932,7 @@ static int tcpm_pd_select_pdo(struct tcpm_port *port, int *sink_pdo, · 1980 unmodified lines
29312932
29322933 port->pps_data.supported = false;
29332934 port->usb_type = POWER_SUPPLY_USB_TYPE_PD;
2935+ power_supply_changed(port->psy);
29342936
29352937 /*
29362938 * Select the source PDO providing the most power which has a
@@ -2955,6 +2957,7 @@ static int tcpm_pd_select_pdo(struct tcpm_port *port, int *sink_pdo, · 18 unmodified lines
29552957 port->pps_data.supported = true;
29562958 port->usb_type =
29572959 POWER_SUPPLY_USB_TYPE_PD_PPS;
2960+ power_supply_changed(port->psy);
29582961 }
29592962 continue;
29602963 default:
@@ -3112,6 +3115,7 @@ static unsigned int tcpm_pd_select_pps_apdo(struct tcpm_port *port) · 151 unmodified lines
31123115 port->pps_data.out_volt));
31133116 port->pps_data.op_curr = min(port->pps_data.max_curr,
31143117 port->pps_data.op_curr);
3118+ power_supply_changed(port->psy);
31153119 }
31163120
31173121 return src_pdo;
@@ -3347,6 +3351,7 @@ static int tcpm_set_charge(struct tcpm_port *port, bool charge) · 229 unmodified lines
33473351 return ret;
33483352 }
33493353 port->vbus_charge = charge;
3354+ power_supply_changed(port->psy);
33503355 return 0;
33513356 }
33523357
@@ -3530,6 +3535,7 @@ static void tcpm_reset_port(struct tcpm_port *port) · 177 unmodified lines
35303535 port->try_src_count = 0;
35313536 port->try_snk_count = 0;
35323537 port->usb_type = POWER_SUPPLY_USB_TYPE_C;
3538+ power_supply_changed(port->psy);
35333539 port->nr_sink_caps = 0;
35343540 port->sink_cap_done = false;
35353541 if (port->tcpc->enable_frs)
@@ -5219,7 +5225,7 @@ static void tcpm_enable_frs_work(struct kthread_work *work) · 1683 unmodified lines
52195225 goto unlock;
52205226
52215227 /* Send when the state machine is idle */
5222− if (port->state != SNK_READY || port->vdm_state != VDM_STATE_DONE || port->send_discover)
5228+ if (port->state != SNK_READY || port->vdm_sm_running || port->send_discover)
52235229 goto resched;
52245230
52255231 port->upcoming_state = GET_SINK_CAP;
@@ -5957,7 +5963,7 @@ static int tcpm_psy_set_prop(struct power_supply *psy, · 731 unmodified lines
59575963 ret = -EINVAL;
59585964 break;
59595965 }
5960−
5966+ power_supply_changed(port->psy);
59615967 return ret;
59625968 }
59635969
@@ -6110,6 +6116,7 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) · 146 unmodified lines
61106116 err = devm_tcpm_psy_register(port);
61116117 if (err)
61126118 goto out_role_sw_put;
6119+ power_supply_changed(port->psy);
61136120
61146121 port->typec_port = typec_register_port(port->dev, &port->typec_caps);
61156122 if (IS_ERR(port->typec_port)) {
drivers/usb/typec/tipd/core.c+0−1
@@ -53,7 +53,6 @@ enum { · 52 unmodified lines
5353 struct tps6598x_rx_identity_reg {
5454 u8 status;
5555 struct usb_pd_identity identity;
56− u32 vdo[3];
5756 } __packed;
5857
5958 /* Standard Task return codes */
drivers/usb/usbip/vudc_sysfs.c+1−1
@@ -174,7 +174,7 @@ static ssize_t usbip_sockfd_store(struct device *dev, · 173 unmodified lines
174174
175175 udc->ud.tcp_socket = socket;
176176 udc->ud.tcp_rx = tcp_rx;
177− udc->ud.tcp_rx = tcp_tx;
177+ udc->ud.tcp_tx = tcp_tx;
178178 udc->ud.status = SDEV_ST_USED;
179179
180180 spin_unlock_irq(&udc->ud.lock);
drivers/vdpa/ifcvf/ifcvf_main.c+2−3
@@ -431,8 +431,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 430 unmodified lines
431431 }
432432
433433 adapter = vdpa_alloc_device(struct ifcvf_adapter, vdpa,
434− dev, &ifc_vdpa_ops,
435− IFCVF_MAX_QUEUE_PAIRS * 2, NULL);
434+ dev, &ifc_vdpa_ops, NULL);
436435 if (adapter == NULL) {
437436 IFCVF_ERR(pdev, "Failed to allocate vDPA structure");
438437 return -ENOMEM;
@@ -456,7 +455,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 17 unmodified lines
456455 for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++)
457456 vf->vring[i].irq = -EINVAL;
458457
459− ret = vdpa_register_device(&adapter->vdpa);
458+ ret = vdpa_register_device(&adapter->vdpa, IFCVF_MAX_QUEUE_PAIRS * 2);
460459 if (ret) {
461460 IFCVF_ERR(pdev, "Failed to register ifcvf to vdpa bus");
462461 goto err;
drivers/vdpa/mlx5/net/mlx5_vnet.c+2−2
@@ -1982,7 +1982,7 @@ static int mlx5v_probe(struct auxiliary_device *adev, · 1981 unmodified lines
19821982 max_vqs = min_t(u32, max_vqs, MLX5_MAX_SUPPORTED_VQS);
19831983
19841984 ndev = vdpa_alloc_device(struct mlx5_vdpa_net, mvdev.vdev, mdev->device, &mlx5_vdpa_ops,
1985− 2 * mlx5_vdpa_max_qps(max_vqs), NULL);
1985+ NULL);
19861986 if (IS_ERR(ndev))
19871987 return PTR_ERR(ndev);
19881988
@@ -2009,7 +2009,7 @@ static int mlx5v_probe(struct auxiliary_device *adev, · 20 unmodified lines
20092009 if (err)
20102010 goto err_res;
20112011
2012− err = vdpa_register_device(&mvdev->vdev);
2012+ err = vdpa_register_device(&mvdev->vdev, 2 * mlx5_vdpa_max_qps(max_vqs));
20132013 if (err)
20142014 goto err_reg;
20152015
drivers/vdpa/vdpa.c+10−8
@@ -69,7 +69,6 @@ static void vdpa_release_dev(struct device *d) · 68 unmodified lines
6969 * initialized but before registered.
7070 * @parent: the parent device
7171 * @config: the bus operations that is supported by this device
72− * @nvqs: number of virtqueues supported by this device
7372 * @size: size of the parent structure that contains private data
7473 * @name: name of the vdpa device; optional.
7574 *
@@ -81,7 +80,7 @@ static void vdpa_release_dev(struct device *d) · 5 unmodified lines
8180 */
8281 struct vdpa_device *__vdpa_alloc_device(struct device *parent,
8382 const struct vdpa_config_ops *config,
84− int nvqs, size_t size, const char *name)
83+ size_t size, const char *name)
8584 {
8685 struct vdpa_device *vdev;
8786 int err = -EINVAL;
@@ -107,7 +106,6 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent, · 19 unmodified lines
107106 vdev->index = err;
108107 vdev->config = config;
109108 vdev->features_valid = false;
110− vdev->nvqs = nvqs;
111109
112110 if (name)
113111 err = dev_set_name(&vdev->dev, "%s", name);
@@ -136,10 +134,12 @@ static int vdpa_name_match(struct device *dev, const void *data) · 22 unmodified lines
136134 return (strcmp(dev_name(&vdev->dev), data) == 0);
137135 }
138136
139−static int __vdpa_register_device(struct vdpa_device *vdev)
137+static int __vdpa_register_device(struct vdpa_device *vdev, int nvqs)
140138 {
141139 struct device *dev;
142140
141+ vdev->nvqs = nvqs;
142+
143143 lockdep_assert_held(&vdpa_dev_mutex);
144144 dev = bus_find_device(&vdpa_bus, NULL, dev_name(&vdev->dev), vdpa_name_match);
145145 if (dev) {
@@ -155,15 +155,16 @@ static int __vdpa_register_device(struct vdpa_device *vdev) · 9 unmodified lines
155155 * Caller must invoke this routine in the management device dev_add()
156156 * callback after setting up valid mgmtdev for this vdpa device.
157157 * @vdev: the vdpa device to be registered to vDPA bus
158+ * @nvqs: number of virtqueues supported by this device
158159 *
159160 * Returns an error when fail to add device to vDPA bus
160161 */
161−int _vdpa_register_device(struct vdpa_device *vdev)
162+int _vdpa_register_device(struct vdpa_device *vdev, int nvqs)
162163 {
163164 if (!vdev->mdev)
164165 return -EINVAL;
165166
166− return __vdpa_register_device(vdev);
167+ return __vdpa_register_device(vdev, nvqs);
167168 }
168169 EXPORT_SYMBOL_GPL(_vdpa_register_device);
169170
@@ -171,15 +172,16 @@ EXPORT_SYMBOL_GPL(_vdpa_register_device); · 1 unmodified line
171172 * vdpa_register_device - register a vDPA device
172173 * Callers must have a succeed call of vdpa_alloc_device() before.
173174 * @vdev: the vdpa device to be registered to vDPA bus
175+ * @nvqs: number of virtqueues supported by this device
174176 *
175177 * Returns an error when fail to add to vDPA bus
176178 */
177−int vdpa_register_device(struct vdpa_device *vdev)
179+int vdpa_register_device(struct vdpa_device *vdev, int nvqs)
178180 {
179181 int err;
180182
181183 mutex_lock(&vdpa_dev_mutex);
182− err = __vdpa_register_device(vdev);
184+ err = __vdpa_register_device(vdev, nvqs);
183185 mutex_unlock(&vdpa_dev_mutex);
184186 return err;
185187 }
drivers/vdpa/vdpa_sim/vdpa_sim.c+1−1
@@ -235,7 +235,7 @@ struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr) · 234 unmodified lines
235235 ops = &vdpasim_config_ops;
236236
237237 vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops,
238− dev_attr->nvqs, dev_attr->name);
238+ dev_attr->name);
239239 if (!vdpasim)
240240 goto err_alloc;
241241
drivers/vdpa/vdpa_sim/vdpa_sim_net.c+2−3
@@ -110,8 +110,7 @@ out: · 109 unmodified lines
110110
111111 static void vdpasim_net_get_config(struct vdpasim *vdpasim, void *config)
112112 {
113− struct virtio_net_config *net_config =
114− (struct virtio_net_config *)config;
113+ struct virtio_net_config *net_config = config;
115114
116115 net_config->mtu = cpu_to_vdpasim16(vdpasim, 1500);
117116 net_config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP);
@@ -147,7 +146,7 @@ static int vdpasim_net_dev_add(struct vdpa_mgmt_dev *mdev, const char *name) · 29 unmodified lines
147146 if (IS_ERR(simdev))
148147 return PTR_ERR(simdev);
149148
150− ret = _vdpa_register_device(&simdev->vdpa);
149+ ret = _vdpa_register_device(&simdev->vdpa, VDPASIM_NET_VQ_NUM);
151150 if (ret)
152151 goto reg_err;
153152
drivers/vfio/Kconfig+2−2
@@ -21,8 +21,8 @@ config VFIO_VIRQFD · 20 unmodified lines
2121
2222 menuconfig VFIO
2323 tristate "VFIO Non-Privileged userspace driver framework"
24− depends on IOMMU_API
25− select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM || ARM64)
24+ select IOMMU_API
25+ select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
2626 help
2727 VFIO provides a framework for secure userspace device drivers.
2828 See Documentation/driver-api/vfio.rst for more details.
drivers/vfio/platform/Kconfig+2−2
@@ -1,7 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 config VFIO_PLATFORM
33 tristate "VFIO support for platform devices"
4− depends on VFIO && EVENTFD && (ARM || ARM64)
4+ depends on VFIO && EVENTFD && (ARM || ARM64 || COMPILE_TEST)
55 select VFIO_VIRQFD
66 help
77 Support for platform devices with VFIO. This is required to make
@@ -12,7 +12,7 @@ config VFIO_PLATFORM · 4 unmodified lines
1212
1313 config VFIO_AMBA
1414 tristate "VFIO support for AMBA devices"
15− depends on VFIO_PLATFORM && ARM_AMBA
15+ depends on VFIO_PLATFORM && (ARM_AMBA || COMPILE_TEST)
1616 help
1717 Support for ARM AMBA devices with VFIO. This is required to make
1818 use of ARM AMBA devices present on the system using the VFIO
drivers/vfio/vfio_iommu_type1.c+12−8
@@ -189,7 +189,7 @@ static struct vfio_dma *vfio_find_dma(struct vfio_iommu *iommu, · 188 unmodified lines
189189 }
190190
191191 static struct rb_node *vfio_find_dma_first_node(struct vfio_iommu *iommu,
192− dma_addr_t start, size_t size)
192+ dma_addr_t start, u64 size)
193193 {
194194 struct rb_node *res = NULL;
195195 struct rb_node *node = iommu->dma_list.rb_node;
@@ -785,7 +785,12 @@ static int vfio_pin_page_external(struct vfio_dma *dma, unsigned long vaddr, · 589 unmodified lines
785785 return -ENODEV;
786786
787787 ret = vaddr_get_pfns(mm, vaddr, 1, dma->prot, pfn_base, pages);
788− if (ret == 1 && do_accounting && !is_invalid_reserved_pfn(*pfn_base)) {
788+ if (ret != 1)
789+ goto out;
790+
791+ ret = 0;
792+
793+ if (do_accounting && !is_invalid_reserved_pfn(*pfn_base)) {
789794 ret = vfio_lock_acct(dma, 1, true);
790795 if (ret) {
791796 put_pfn(*pfn_base, dma->prot);
@@ -797,6 +802,7 @@ static int vfio_pin_page_external(struct vfio_dma *dma, unsigned long vaddr, · 5 unmodified lines
797802 }
798803 }
799804
805+out:
800806 mmput(mm);
801807 return ret;
802808 }
@@ -1288,7 +1294,7 @@ static int vfio_dma_do_unmap(struct vfio_iommu *iommu, · 485 unmodified lines
12881294 int ret = -EINVAL, retries = 0;
12891295 unsigned long pgshift;
12901296 dma_addr_t iova = unmap->iova;
1291− unsigned long size = unmap->size;
1297+ u64 size = unmap->size;
12921298 bool unmap_all = unmap->flags & VFIO_DMA_UNMAP_FLAG_ALL;
12931299 bool invalidate_vaddr = unmap->flags & VFIO_DMA_UNMAP_FLAG_VADDR;
12941300 struct rb_node *n, *first_n;
@@ -1304,14 +1310,12 @@ static int vfio_dma_do_unmap(struct vfio_iommu *iommu, · 9 unmodified lines
13041310 if (unmap_all) {
13051311 if (iova || size)
13061312 goto unlock;
1307− size = SIZE_MAX;
1308− } else if (!size || size & (pgsize - 1)) {
1313+ size = U64_MAX;
1314+ } else if (!size || size & (pgsize - 1) ||
1315+ iova + size - 1 < iova || size > SIZE_MAX) {
13091316 goto unlock;
13101317 }
13111318
1312− if (iova + size - 1 < iova || size > SIZE_MAX)
1313− goto unlock;
1314−
13151319 /* When dirty tracking is enabled, allow only min supported pgsize */
13161320 if ((unmap->flags & VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP) &&
13171321 (!iommu->dirty_page_tracking || (bitmap->pgsize != pgsize))) {
drivers/vhost/vdpa.c+11−9
@@ -308,8 +308,10 @@ static long vhost_vdpa_get_vring_num(struct vhost_vdpa *v, u16 __user *argp) · 307 unmodified lines
308308
309309 static void vhost_vdpa_config_put(struct vhost_vdpa *v)
310310 {
311− if (v->config_ctx)
311+ if (v->config_ctx) {
312312 eventfd_ctx_put(v->config_ctx);
313+ v->config_ctx = NULL;
314+ }
313315 }
314316
315317 static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)
@@ -329,8 +331,12 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp) · 13 unmodified lines
329331 if (!IS_ERR_OR_NULL(ctx))
330332 eventfd_ctx_put(ctx);
331333
332− if (IS_ERR(v->config_ctx))
333− return PTR_ERR(v->config_ctx);
334+ if (IS_ERR(v->config_ctx)) {
335+ long ret = PTR_ERR(v->config_ctx);
336+
337+ v->config_ctx = NULL;
338+ return ret;
339+ }
334340
335341 v->vdpa->config->set_config_cb(v->vdpa, &cb);
336342
@@ -900,14 +906,10 @@ err: · 563 unmodified lines
900906
901907 static void vhost_vdpa_clean_irq(struct vhost_vdpa *v)
902908 {
903− struct vhost_virtqueue *vq;
904909 int i;
905910
906− for (i = 0; i < v->nvqs; i++) {
907− vq = &v->vqs[i];
908− if (vq->call_ctx.producer.irq)
909− irq_bypass_unregister_producer(&vq->call_ctx.producer);
910− }
911+ for (i = 0; i < v->nvqs; i++)
912+ vhost_vdpa_unsetup_vq_irq(v, i);
911913 }
912914
913915 static int vhost_vdpa_release(struct inode *inode, struct file *filep)
drivers/vhost/vhost.c+1−1
@@ -332,8 +332,8 @@ static void vhost_vq_reset(struct vhost_dev *dev, · 331 unmodified lines
332332 vq->error_ctx = NULL;
333333 vq->kick = NULL;
334334 vq->log_ctx = NULL;
335− vhost_reset_is_le(vq);
336335 vhost_disable_cross_endian(vq);
336+ vhost_reset_is_le(vq);
337337 vq->busyloop_timeout = 0;
338338 vq->umem = NULL;
339339 vq->iotlb = NULL;
drivers/virtio/virtio.c+2−4
@@ -141,15 +141,14 @@ void virtio_config_changed(struct virtio_device *dev) · 140 unmodified lines
141141 }
142142 EXPORT_SYMBOL_GPL(virtio_config_changed);
143143
144−void virtio_config_disable(struct virtio_device *dev)
144+static void virtio_config_disable(struct virtio_device *dev)
145145 {
146146 spin_lock_irq(&dev->config_lock);
147147 dev->config_enabled = false;
148148 spin_unlock_irq(&dev->config_lock);
149149 }
150−EXPORT_SYMBOL_GPL(virtio_config_disable);
151150
152−void virtio_config_enable(struct virtio_device *dev)
151+static void virtio_config_enable(struct virtio_device *dev)
153152 {
154153 spin_lock_irq(&dev->config_lock);
155154 dev->config_enabled = true;
@@ -158,7 +157,6 @@ void virtio_config_enable(struct virtio_device *dev) · 2 unmodified lines
158157 dev->config_change_pending = false;
159158 spin_unlock_irq(&dev->config_lock);
160159 }
161−EXPORT_SYMBOL_GPL(virtio_config_enable);
162160
163161 void virtio_add_status(struct virtio_device *dev, unsigned int status)
164162 {
drivers/virtio/virtio_mmio.c+1−2
@@ -548,8 +548,7 @@ static void virtio_mmio_release_dev(struct device *_d) · 547 unmodified lines
548548 {
549549 struct virtio_device *vdev =
550550 container_of(_d, struct virtio_device, dev);
551− struct virtio_mmio_device *vm_dev =
552− container_of(vdev, struct virtio_mmio_device, vdev);
551+ struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
553552 struct platform_device *pdev = vm_dev->pdev;
554553
555554 devm_kfree(&pdev->dev, vm_dev);
drivers/watchdog/cpu5wdt.c+0−1
@@ -273,7 +273,6 @@ module_exit(cpu5wdt_exit_module); · 272 unmodified lines
273273
274274 MODULE_AUTHOR("Heiko Ronsdorf <hero@ihg.uni-duisburg.de>");
275275 MODULE_DESCRIPTION("sma cpu5 watchdog driver");
276−MODULE_SUPPORTED_DEVICE("sma cpu5 watchdog");
277276 MODULE_LICENSE("GPL");
278277
279278 module_param_hw(port, int, ioport, 0);
drivers/watchdog/cpwd.c+0−1
@@ -172,7 +172,6 @@ MODULE_PARM_DESC(wd2_timeout, "Default watchdog2 timeout in 1/10secs"); · 171 unmodified lines
172172 MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");
173173 MODULE_DESCRIPTION("Hardware watchdog driver for Sun Microsystems CP1400/1500");
174174 MODULE_LICENSE("GPL");
175−MODULE_SUPPORTED_DEVICE("watchdog");
176175
177176 static void cpwd_writew(u16 val, void __iomem *addr)
178177 {
drivers/watchdog/riowd.c+0−1
@@ -46,7 +46,6 @@ · 45 unmodified lines
4646
4747 MODULE_AUTHOR("David S. Miller <davem@davemloft.net>");
4848 MODULE_DESCRIPTION("Hardware watchdog driver for Sun RIO");
49−MODULE_SUPPORTED_DEVICE("watchdog");
5049 MODULE_LICENSE("GPL");
5150
5251 #define DRIVER_NAME "riowd"
fs/afs/dir.c+0−1
@@ -70,7 +70,6 @@ const struct inode_operations afs_dir_inode_operations = { · 69 unmodified lines
7070 .permission = afs_permission,
7171 .getattr = afs_getattr,
7272 .setattr = afs_setattr,
73− .listxattr = afs_listxattr,
7473 };
7574
7675 const struct address_space_operations afs_dir_aops = {
fs/afs/file.c+0−1
@@ -43,7 +43,6 @@ const struct inode_operations afs_file_inode_operations = { · 42 unmodified lines
4343 .getattr = afs_getattr,
4444 .setattr = afs_setattr,
4545 .permission = afs_permission,
46− .listxattr = afs_listxattr,
4746 };
4847
4948 const struct address_space_operations afs_fs_aops = {
fs/afs/fs_operation.c+5−2
@@ -181,10 +181,13 @@ void afs_wait_for_operation(struct afs_operation *op) · 180 unmodified lines
181181 if (test_bit(AFS_SERVER_FL_IS_YFS, &op->server->flags) &&
182182 op->ops->issue_yfs_rpc)
183183 op->ops->issue_yfs_rpc(op);
184− else
184+ else if (op->ops->issue_afs_rpc)
185185 op->ops->issue_afs_rpc(op);
186+ else
187+ op->ac.error = -ENOTSUPP;
186188
187− op->error = afs_wait_for_call_to_complete(op->call, &op->ac);
189+ if (op->call)
190+ op->error = afs_wait_for_call_to_complete(op->call, &op->ac);
188191 }
189192
190193 switch (op->error) {
fs/afs/inode.c+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727
2828 static const struct inode_operations afs_symlink_inode_operations = {
2929 .get_link = page_get_link,
30− .listxattr = afs_listxattr,
3130 };
3231
3332 static noinline void dump_vnode(struct afs_vnode *vnode, struct afs_vnode *parent_vnode)
fs/afs/internal.h+0−1
@@ -1509,7 +1509,6 @@ extern int afs_launder_page(struct page *); · 1508 unmodified lines
15091509 * xattr.c
15101510 */
15111511 extern const struct xattr_handler *afs_xattr_handlers[];
1512−extern ssize_t afs_listxattr(struct dentry *, char *, size_t);
15131512
15141513 /*
15151514 * yfsclient.c
fs/afs/mntpt.c+0−1
@@ -32,7 +32,6 @@ const struct inode_operations afs_mntpt_inode_operations = { · 31 unmodified lines
3232 .lookup = afs_mntpt_lookup,
3333 .readlink = page_readlink,
3434 .getattr = afs_getattr,
35− .listxattr = afs_listxattr,
3635 };
3736
3837 const struct inode_operations afs_autocell_inode_operations = {
fs/afs/xattr.c+7−24
@@ -11,29 +11,6 @@ · 10 unmodified lines
1111 #include <linux/xattr.h>
1212 #include "internal.h"
1313
14−static const char afs_xattr_list[] =
15− "afs.acl\0"
16− "afs.cell\0"
17− "afs.fid\0"
18− "afs.volume\0"
19− "afs.yfs.acl\0"
20− "afs.yfs.acl_inherited\0"
21− "afs.yfs.acl_num_cleaned\0"
22− "afs.yfs.vol_acl";
23−
24−/*
25− * Retrieve a list of the supported xattrs.
26− */
27−ssize_t afs_listxattr(struct dentry *dentry, char *buffer, size_t size)
28−{
29− if (size == 0)
30− return sizeof(afs_xattr_list);
31− if (size < sizeof(afs_xattr_list))
32− return -ERANGE;
33− memcpy(buffer, afs_xattr_list, sizeof(afs_xattr_list));
34− return sizeof(afs_xattr_list);
35−}
36−
3714 /*
3815 * Deal with the result of a successful fetch ACL operation.
3916 */
@@ -231,6 +208,8 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, · 191 unmodified lines
231208 else
232209 ret = -ERANGE;
233210 }
211+ } else if (ret == -ENOTSUPP) {
212+ ret = -ENODATA;
234213 }
235214
236215 error_yacl:
@@ -256,6 +235,7 @@ static int afs_xattr_set_yfs(const struct xattr_handler *handler, · 19 unmodified lines
256235 {
257236 struct afs_operation *op;
258237 struct afs_vnode *vnode = AFS_FS_I(inode);
238+ int ret;
259239
260240 if (flags == XATTR_CREATE ||
261241 strcmp(name, "acl") != 0)
@@ -270,7 +250,10 @@ static int afs_xattr_set_yfs(const struct xattr_handler *handler, · 8 unmodified lines
270250 return afs_put_operation(op);
271251
272252 op->ops = &yfs_store_opaque_acl2_operation;
273− return afs_do_sync_operation(op);
253+ ret = afs_do_sync_operation(op);
254+ if (ret == -ENOTSUPP)
255+ ret = -ENODATA;
256+ return ret;
274257 }
275258
276259 static const struct xattr_handler afs_xattr_yfs_handler = {
fs/btrfs/ctree.c+2−0
@@ -1365,7 +1365,9 @@ get_old_root(struct btrfs_root *root, u64 time_seq) · 1364 unmodified lines
13651365 "failed to read tree block %llu from get_old_root",
13661366 logical);
13671367 } else {
1368+ btrfs_tree_read_lock(old);
13681369 eb = btrfs_clone_extent_buffer(old);
1370+ btrfs_tree_read_unlock(old);
13691371 free_extent_buffer(old);
13701372 }
13711373 } else if (old_root) {
fs/btrfs/extent-tree.c+22−1
@@ -3323,6 +3323,7 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans, · 3322 unmodified lines
33233323
33243324 if (last_ref && btrfs_header_generation(buf) == trans->transid) {
33253325 struct btrfs_block_group *cache;
3326+ bool must_pin = false;
33263327
33273328 if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) {
33283329 ret = check_ref_cleanup(trans, buf->start);
@@ -3340,7 +3341,27 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans, · 11 unmodified lines
33403341 goto out;
33413342 }
33423343
3343− if (btrfs_is_zoned(fs_info)) {
3344+ /*
3345+ * If this is a leaf and there are tree mod log users, we may
3346+ * have recorded mod log operations that point to this leaf.
3347+ * So we must make sure no one reuses this leaf's extent before
3348+ * mod log operations are applied to a node, otherwise after
3349+ * rewinding a node using the mod log operations we get an
3350+ * inconsistent btree, as the leaf's extent may now be used as
3351+ * a node or leaf for another different btree.
3352+ * We are safe from races here because at this point no other
3353+ * node or root points to this extent buffer, so if after this
3354+ * check a new tree mod log user joins, it will not be able to
3355+ * find a node pointing to this leaf and record operations that
3356+ * point to this leaf.
3357+ */
3358+ if (btrfs_header_level(buf) == 0) {
3359+ read_lock(&fs_info->tree_mod_log_lock);
3360+ must_pin = !list_empty(&fs_info->tree_mod_seq_list);
3361+ read_unlock(&fs_info->tree_mod_log_lock);
3362+ }
3363+
3364+ if (must_pin || btrfs_is_zoned(fs_info)) {
33443365 btrfs_redirty_list_add(trans->transaction, buf);
33453366 pin_down_extent(trans, cache, buf->start, buf->len, 1);
33463367 btrfs_put_block_group(cache);
fs/btrfs/extent_io.c+31−2
@@ -2885,6 +2885,35 @@ static void end_page_read(struct page *page, bool uptodate, u64 start, u32 len) · 2884 unmodified lines
28852885 btrfs_subpage_end_reader(fs_info, page, start, len);
28862886 }
28872887
2888+/*
2889+ * Find extent buffer for a givne bytenr.
2890+ *
2891+ * This is for end_bio_extent_readpage(), thus we can't do any unsafe locking
2892+ * in endio context.
2893+ */
2894+static struct extent_buffer *find_extent_buffer_readpage(
2895+ struct btrfs_fs_info *fs_info, struct page *page, u64 bytenr)
2896+{
2897+ struct extent_buffer *eb;
2898+
2899+ /*
2900+ * For regular sectorsize, we can use page->private to grab extent
2901+ * buffer
2902+ */
2903+ if (fs_info->sectorsize == PAGE_SIZE) {
2904+ ASSERT(PagePrivate(page) && page->private);
2905+ return (struct extent_buffer *)page->private;
2906+ }
2907+
2908+ /* For subpage case, we need to lookup buffer radix tree */
2909+ rcu_read_lock();
2910+ eb = radix_tree_lookup(&fs_info->buffer_radix,
2911+ bytenr >> fs_info->sectorsize_bits);
2912+ rcu_read_unlock();
2913+ ASSERT(eb);
2914+ return eb;
2915+}
2916+
28882917 /*
28892918 * after a readpage IO is done, we need to:
28902919 * clear the uptodate bits on error
@@ -2996,7 +3025,7 @@ static void end_bio_extent_readpage(struct bio *bio) · 105 unmodified lines
29963025 } else {
29973026 struct extent_buffer *eb;
29983027
2999− eb = (struct extent_buffer *)page->private;
3028+ eb = find_extent_buffer_readpage(fs_info, page, start);
30003029 set_bit(EXTENT_BUFFER_READ_ERR, &eb->bflags);
30013030 eb->read_mirror = mirror;
30023031 atomic_dec(&eb->io_pages);
@@ -3020,7 +3049,7 @@ readpage_ok: · 17 unmodified lines
30203049 */
30213050 if (page->index == end_index && i_size <= end) {
30223051 u32 zero_start = max(offset_in_page(i_size),
3023− offset_in_page(end));
3052+ offset_in_page(start));
30243053
30253054 zero_user_segment(page, zero_start,
30263055 offset_in_page(end) + 1);
fs/btrfs/inode.c+26−11
@@ -9008,7 +9008,7 @@ int __init btrfs_init_cachep(void) · 9007 unmodified lines
90089008
90099009 btrfs_free_space_bitmap_cachep = kmem_cache_create("btrfs_free_space_bitmap",
90109010 PAGE_SIZE, PAGE_SIZE,
9011− SLAB_RED_ZONE, NULL);
9011+ SLAB_MEM_SPREAD, NULL);
90129012 if (!btrfs_free_space_bitmap_cachep)
90139013 goto fail;
90149014
@@ -9877,6 +9877,7 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent( · 862 unmodified lines
98779877 struct btrfs_path *path;
98789878 u64 start = ins->objectid;
98799879 u64 len = ins->offset;
9880+ int qgroup_released;
98809881 int ret;
98819882
98829883 memset(&stack_fi, 0, sizeof(stack_fi));
@@ -9889,16 +9890,16 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent( · 6 unmodified lines
98899890 btrfs_set_stack_file_extent_compression(&stack_fi, BTRFS_COMPRESS_NONE);
98909891 /* Encryption and other encoding is reserved and all 0 */
98919892
9892− ret = btrfs_qgroup_release_data(inode, file_offset, len);
9893− if (ret < 0)
9894− return ERR_PTR(ret);
9893+ qgroup_released = btrfs_qgroup_release_data(inode, file_offset, len);
9894+ if (qgroup_released < 0)
9895+ return ERR_PTR(qgroup_released);
98959896
98969897 if (trans) {
98979898 ret = insert_reserved_file_extent(trans, inode,
98989899 file_offset, &stack_fi,
9899− true, ret);
9900+ true, qgroup_released);
99009901 if (ret)
9901− return ERR_PTR(ret);
9902+ goto free_qgroup;
99029903 return trans;
99039904 }
99049905
@@ -9909,21 +9910,35 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent( · 4 unmodified lines
99099910 extent_info.file_offset = file_offset;
99109911 extent_info.extent_buf = (char *)&stack_fi;
99119912 extent_info.is_new_extent = true;
9912− extent_info.qgroup_reserved = ret;
9913+ extent_info.qgroup_reserved = qgroup_released;
99139914 extent_info.insertions = 0;
99149915
99159916 path = btrfs_alloc_path();
9916− if (!path)
9917− return ERR_PTR(-ENOMEM);
9917+ if (!path) {
9918+ ret = -ENOMEM;
9919+ goto free_qgroup;
9920+ }
99189921
99199922 ret = btrfs_replace_file_extents(&inode->vfs_inode, path, file_offset,
99209923 file_offset + len - 1, &extent_info,
99219924 &trans);
99229925 btrfs_free_path(path);
99239926 if (ret)
9924− return ERR_PTR(ret);
9925−
9927+ goto free_qgroup;
99269928 return trans;
9929+
9930+free_qgroup:
9931+ /*
9932+ * We have released qgroup data range at the beginning of the function,
9933+ * and normally qgroup_released bytes will be freed when committing
9934+ * transaction.
9935+ * But if we error out early, we have to free what we have released
9936+ * or we leak qgroup data reservation.
9937+ */
9938+ btrfs_qgroup_free_refroot(inode->root->fs_info,
9939+ inode->root->root_key.objectid, qgroup_released,
9940+ BTRFS_QGROUP_RSV_DATA);
9941+ return ERR_PTR(ret);
99279942 }
99289943
99299944 static int __btrfs_prealloc_file_range(struct inode *inode, int mode,
fs/btrfs/reada.c+18−17
@@ -209,7 +209,7 @@ int btree_readahead_hook(struct extent_buffer *eb, int err) · 208 unmodified lines
209209 /* find extent */
210210 spin_lock(&fs_info->reada_lock);
211211 re = radix_tree_lookup(&fs_info->reada_tree,
212− eb->start >> PAGE_SHIFT);
212+ eb->start >> fs_info->sectorsize_bits);
213213 if (re)
214214 re->refcnt++;
215215 spin_unlock(&fs_info->reada_lock);
@@ -240,7 +240,7 @@ static struct reada_zone *reada_find_zone(struct btrfs_device *dev, u64 logical, · 24 unmodified lines
240240 zone = NULL;
241241 spin_lock(&fs_info->reada_lock);
242242 ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone,
243− logical >> PAGE_SHIFT, 1);
243+ logical >> fs_info->sectorsize_bits, 1);
244244 if (ret == 1 && logical >= zone->start && logical <= zone->end) {
245245 kref_get(&zone->refcnt);
246246 spin_unlock(&fs_info->reada_lock);
@@ -283,13 +283,13 @@ static struct reada_zone *reada_find_zone(struct btrfs_device *dev, u64 logical, · 36 unmodified lines
283283
284284 spin_lock(&fs_info->reada_lock);
285285 ret = radix_tree_insert(&dev->reada_zones,
286− (unsigned long)(zone->end >> PAGE_SHIFT),
287− zone);
286+ (unsigned long)(zone->end >> fs_info->sectorsize_bits),
287+ zone);
288288
289289 if (ret == -EEXIST) {
290290 kfree(zone);
291291 ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone,
292− logical >> PAGE_SHIFT, 1);
292+ logical >> fs_info->sectorsize_bits, 1);
293293 if (ret == 1 && logical >= zone->start && logical <= zone->end)
294294 kref_get(&zone->refcnt);
295295 else
@@ -315,7 +315,7 @@ static struct reada_extent *reada_find_extent(struct btrfs_fs_info *fs_info, · 19 unmodified lines
315315 u64 length;
316316 int real_stripes;
317317 int nzones = 0;
318− unsigned long index = logical >> PAGE_SHIFT;
318+ unsigned long index = logical >> fs_info->sectorsize_bits;
319319 int dev_replace_is_ongoing;
320320 int have_zone = 0;
321321
@@ -497,7 +497,7 @@ static void reada_extent_put(struct btrfs_fs_info *fs_info, · 175 unmodified lines
497497 struct reada_extent *re)
498498 {
499499 int i;
500− unsigned long index = re->logical >> PAGE_SHIFT;
500+ unsigned long index = re->logical >> fs_info->sectorsize_bits;
501501
502502 spin_lock(&fs_info->reada_lock);
503503 if (--re->refcnt) {
@@ -538,11 +538,12 @@ static void reada_extent_put(struct btrfs_fs_info *fs_info, · 34 unmodified lines
538538 static void reada_zone_release(struct kref *kref)
539539 {
540540 struct reada_zone *zone = container_of(kref, struct reada_zone, refcnt);
541+ struct btrfs_fs_info *fs_info = zone->device->fs_info;
541542
542− lockdep_assert_held(&zone->device->fs_info->reada_lock);
543+ lockdep_assert_held(&fs_info->reada_lock);
543544
544545 radix_tree_delete(&zone->device->reada_zones,
545− zone->end >> PAGE_SHIFT);
546+ zone->end >> fs_info->sectorsize_bits);
546547
547548 kfree(zone);
548549 }
@@ -593,7 +594,7 @@ static int reada_add_block(struct reada_control *rc, u64 logical, · 44 unmodified lines
593594 static void reada_peer_zones_set_lock(struct reada_zone *zone, int lock)
594595 {
595596 int i;
596− unsigned long index = zone->end >> PAGE_SHIFT;
597+ unsigned long index = zone->end >> zone->device->fs_info->sectorsize_bits;
597598
598599 for (i = 0; i < zone->ndevs; ++i) {
599600 struct reada_zone *peer;
@@ -628,7 +629,7 @@ static int reada_pick_zone(struct btrfs_device *dev) · 28 unmodified lines
628629 (void **)&zone, index, 1);
629630 if (ret == 0)
630631 break;
631− index = (zone->end >> PAGE_SHIFT) + 1;
632+ index = (zone->end >> dev->fs_info->sectorsize_bits) + 1;
632633 if (zone->locked) {
633634 if (zone->elems > top_locked_elems) {
634635 top_locked_elems = zone->elems;
@@ -709,7 +710,7 @@ static int reada_start_machine_dev(struct btrfs_device *dev) · 74 unmodified lines
709710 * plugging to speed things up
710711 */
711712 ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re,
712− dev->reada_next >> PAGE_SHIFT, 1);
713+ dev->reada_next >> fs_info->sectorsize_bits, 1);
713714 if (ret == 0 || re->logical > dev->reada_curr_zone->end) {
714715 ret = reada_pick_zone(dev);
715716 if (!ret) {
@@ -718,7 +719,7 @@ static int reada_start_machine_dev(struct btrfs_device *dev) · 2 unmodified lines
718719 }
719720 re = NULL;
720721 ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re,
721− dev->reada_next >> PAGE_SHIFT, 1);
722+ dev->reada_next >> fs_info->sectorsize_bits, 1);
722723 }
723724 if (ret == 0) {
724725 spin_unlock(&fs_info->reada_lock);
@@ -885,7 +886,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 160 unmodified lines
885886 pr_cont(" curr off %llu",
886887 device->reada_next - zone->start);
887888 pr_cont("\n");
888− index = (zone->end >> PAGE_SHIFT) + 1;
889+ index = (zone->end >> fs_info->sectorsize_bits) + 1;
889890 }
890891 cnt = 0;
891892 index = 0;
@@ -910,7 +911,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 18 unmodified lines
910911 }
911912 }
912913 pr_cont("\n");
913− index = (re->logical >> PAGE_SHIFT) + 1;
914+ index = (re->logical >> fs_info->sectorsize_bits) + 1;
914915 if (++cnt > 15)
915916 break;
916917 }
@@ -926,7 +927,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 9 unmodified lines
926927 if (ret == 0)
927928 break;
928929 if (!re->scheduled) {
929− index = (re->logical >> PAGE_SHIFT) + 1;
930+ index = (re->logical >> fs_info->sectorsize_bits) + 1;
930931 continue;
931932 }
932933 pr_debug("re: logical %llu size %u list empty %d scheduled %d",
@@ -942,7 +943,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 9 unmodified lines
942943 }
943944 }
944945 pr_cont("\n");
945− index = (re->logical >> PAGE_SHIFT) + 1;
946+ index = (re->logical >> fs_info->sectorsize_bits) + 1;
946947 }
947948 spin_unlock(&fs_info->reada_lock);
948949 }
fs/btrfs/tree-log.c+4−4
@@ -3169,10 +3169,6 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, · 3168 unmodified lines
31693169
31703170 mutex_lock(&log_root_tree->log_mutex);
31713171
3172− index2 = log_root_tree->log_transid % 2;
3173− list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]);
3174− root_log_ctx.log_transid = log_root_tree->log_transid;
3175−
31763172 if (btrfs_is_zoned(fs_info)) {
31773173 if (!log_root_tree->node) {
31783174 ret = btrfs_alloc_log_tree_node(trans, log_root_tree);
@@ -3183,6 +3179,10 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, · 4 unmodified lines
31833179 }
31843180 }
31853181
3182+ index2 = log_root_tree->log_transid % 2;
3183+ list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]);
3184+ root_log_ctx.log_transid = log_root_tree->log_transid;
3185+
31863186 /*
31873187 * Now we are safe to update the log_root_tree because we're under the
31883188 * log_mutex, and we're a current writer so we're holding the commit
fs/cifs/cifs_swn.c+1−1
@@ -248,7 +248,7 @@ nlmsg_fail: · 247 unmodified lines
248248
249249 /*
250250 * Try to find a matching registration for the tcon's server name and share name.
251− * Calls to this funciton must be protected by cifs_swnreg_idr_mutex.
251+ * Calls to this function must be protected by cifs_swnreg_idr_mutex.
252252 * TODO Try to avoid memory allocations
253253 */
254254 static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon)
fs/cifs/cifsacl.c+6−3
@@ -1118,7 +1118,6 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl, · 1117 unmodified lines
11181118 /* Retain old ACEs which we can retain */
11191119 for (i = 0; i < src_num_aces; ++i) {
11201120 pntace = (struct cifs_ace *) (acl_base + size);
1121− pnntace = (struct cifs_ace *) (nacl_base + nsize);
11221121
11231122 if (!new_aces_set && (pntace->flags & INHERITED_ACE)) {
11241123 /* Place the new ACEs in between existing explicit and inherited */
@@ -1131,14 +1130,18 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl, · 6 unmodified lines
11311130 }
11321131
11331132 /* If it's any one of the ACE we're replacing, skip! */
1134− if ((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) ||
1133+ if (!mode_from_sid &&
1134+ ((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) ||
11351135 (compare_sids(&pntace->sid, pownersid) == 0) ||
11361136 (compare_sids(&pntace->sid, pgrpsid) == 0) ||
11371137 (compare_sids(&pntace->sid, &sid_everyone) == 0) ||
1138− (compare_sids(&pntace->sid, &sid_authusers) == 0)) {
1138+ (compare_sids(&pntace->sid, &sid_authusers) == 0))) {
11391139 goto next_ace;
11401140 }
11411141
1142+ /* update the pointer to the next ACE to populate*/
1143+ pnntace = (struct cifs_ace *) (nacl_base + nsize);
1144+
11421145 nsize += cifs_copy_ace(pnntace, pntace, NULL);
11431146 num_aces++;
11441147
fs/cifs/fs_context.c+4−2
@@ -1196,9 +1196,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, · 1195 unmodified lines
11961196 pr_warn_once("Witness protocol support is experimental\n");
11971197 break;
11981198 case Opt_rootfs:
1199−#ifdef CONFIG_CIFS_ROOT
1200− ctx->rootfs = true;
1199+#ifndef CONFIG_CIFS_ROOT
1200+ cifs_dbg(VFS, "rootfs support requires CONFIG_CIFS_ROOT config option\n");
1201+ goto cifs_parse_mount_err;
12011202 #endif
1203+ ctx->rootfs = true;
12021204 break;
12031205 case Opt_posixpaths:
12041206 if (result.negated)
fs/cifs/inode.c+9−1
@@ -2395,7 +2395,7 @@ int cifs_getattr(struct user_namespace *mnt_userns, const struct path *path, · 2394 unmodified lines
23952395 * We need to be sure that all dirty pages are written and the server
23962396 * has actual ctime, mtime and file length.
23972397 */
2398− if ((request_mask & (STATX_CTIME | STATX_MTIME | STATX_SIZE)) &&
2398+ if ((request_mask & (STATX_CTIME | STATX_MTIME | STATX_SIZE | STATX_BLOCKS)) &&
23992399 !CIFS_CACHE_READ(CIFS_I(inode)) &&
24002400 inode->i_mapping && inode->i_mapping->nrpages != 0) {
24012401 rc = filemap_fdatawait(inode->i_mapping);
@@ -2585,6 +2585,14 @@ set_size_out: · 183 unmodified lines
25852585 if (rc == 0) {
25862586 cifsInode->server_eof = attrs->ia_size;
25872587 cifs_setsize(inode, attrs->ia_size);
2588+ /*
2589+ * i_blocks is not related to (i_size / i_blksize), but instead
2590+ * 512 byte (2**9) size is required for calculating num blocks.
2591+ * Until we can query the server for actual allocation size,
2592+ * this is best estimate we have for blocks allocated for a file
2593+ * Number of blocks must be rounded up so size 1 is not 0 blocks
2594+ */
2595+ inode->i_blocks = (512 - 1 + attrs->ia_size) >> 9;
25882596
25892597 /*
25902598 * The man page of truncate says if the size changed,
fs/cifs/transport.c+6−1
@@ -1196,9 +1196,12 @@ compound_send_recv(const unsigned int xid, struct cifs_ses *ses, · 1195 unmodified lines
11961196 /*
11971197 * Compounding is never used during session establish.
11981198 */
1199− if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP) || (optype & CIFS_SESS_OP))
1199+ if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP) || (optype & CIFS_SESS_OP)) {
1200+ mutex_lock(&server->srv_mutex);
12001201 smb311_update_preauth_hash(ses, rqst[0].rq_iov,
12011202 rqst[0].rq_nvec);
1203+ mutex_unlock(&server->srv_mutex);
1204+ }
12021205
12031206 for (i = 0; i < num_rqst; i++) {
12041207 rc = wait_for_response(server, midQ[i]);
@@ -1266,7 +1269,9 @@ compound_send_recv(const unsigned int xid, struct cifs_ses *ses, · 61 unmodified lines
12661269 .iov_base = resp_iov[0].iov_base,
12671270 .iov_len = resp_iov[0].iov_len
12681271 };
1272+ mutex_lock(&server->srv_mutex);
12691273 smb311_update_preauth_hash(ses, &iov, 1);
1274+ mutex_unlock(&server->srv_mutex);
12701275 }
12711276
12721277 out:
fs/ext4/balloc.c+26−12
@@ -626,27 +626,41 @@ int ext4_claim_free_clusters(struct ext4_sb_info *sbi, · 625 unmodified lines
626626
627627 /**
628628 * ext4_should_retry_alloc() - check if a block allocation should be retried
629− * @sb: super block
630− * @retries: number of attemps has been made
629+ * @sb: superblock
630+ * @retries: number of retry attempts made so far
631631 *
632− * ext4_should_retry_alloc() is called when ENOSPC is returned, and if
633− * it is profitable to retry the operation, this function will wait
634− * for the current or committing transaction to complete, and then
635− * return TRUE. We will only retry once.
632+ * ext4_should_retry_alloc() is called when ENOSPC is returned while
633+ * attempting to allocate blocks. If there's an indication that a pending
634+ * journal transaction might free some space and allow another attempt to
635+ * succeed, this function will wait for the current or committing transaction
636+ * to complete and then return TRUE.
636637 */
637638 int ext4_should_retry_alloc(struct super_block *sb, int *retries)
638639 {
639− if (!ext4_has_free_clusters(EXT4_SB(sb), 1, 0) ||
640− (*retries)++ > 1 ||
641− !EXT4_SB(sb)->s_journal)
640+ struct ext4_sb_info *sbi = EXT4_SB(sb);
641+
642+ if (!sbi->s_journal)
642643 return 0;
643644
644− smp_mb();
645− if (EXT4_SB(sb)->s_mb_free_pending == 0)
645+ if (++(*retries) > 3) {
646+ percpu_counter_inc(&sbi->s_sra_exceeded_retry_limit);
646647 return 0;
648+ }
647649
650+ /*
651+ * if there's no indication that blocks are about to be freed it's
652+ * possible we just missed a transaction commit that did so
653+ */
654+ smp_mb();
655+ if (sbi->s_mb_free_pending == 0)
656+ return ext4_has_free_clusters(sbi, 1, 0);
657+
658+ /*
659+ * it's possible we've just missed a transaction commit here,
660+ * so ignore the returned status
661+ */
648662 jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
649− jbd2_journal_force_commit_nested(EXT4_SB(sb)->s_journal);
663+ (void) jbd2_journal_force_commit_nested(sbi->s_journal);
650664 return 1;
651665 }
652666
fs/ext4/ext4.h+3−0
@@ -1484,6 +1484,7 @@ struct ext4_sb_info { · 1483 unmodified lines
14841484 struct percpu_counter s_freeinodes_counter;
14851485 struct percpu_counter s_dirs_counter;
14861486 struct percpu_counter s_dirtyclusters_counter;
1487+ struct percpu_counter s_sra_exceeded_retry_limit;
14871488 struct blockgroup_lock *s_blockgroup_lock;
14881489 struct proc_dir_entry *s_proc;
14891490 struct kobject s_kobj;
@@ -2793,6 +2794,8 @@ void __ext4_fc_track_link(handle_t *handle, struct inode *inode, · 1303 unmodified lines
27932794 struct dentry *dentry);
27942795 void ext4_fc_track_unlink(handle_t *handle, struct dentry *dentry);
27952796 void ext4_fc_track_link(handle_t *handle, struct dentry *dentry);
2797+void __ext4_fc_track_create(handle_t *handle, struct inode *inode,
2798+ struct dentry *dentry);
27962799 void ext4_fc_track_create(handle_t *handle, struct dentry *dentry);
27972800 void ext4_fc_track_inode(handle_t *handle, struct inode *inode);
27982801 void ext4_fc_mark_ineligible(struct super_block *sb, int reason);
fs/ext4/extents.c+1−1
@@ -4382,7 +4382,7 @@ static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset, · 4381 unmodified lines
43824382 {
43834383 struct inode *inode = file_inode(file);
43844384 handle_t *handle;
4385− int ret, ret2 = 0, ret3 = 0;
4385+ int ret = 0, ret2 = 0, ret3 = 0;
43864386 int retries = 0;
43874387 int depth = 0;
43884388 struct ext4_map_blocks map;
fs/ext4/fast_commit.c+7−2
@@ -513,10 +513,10 @@ void ext4_fc_track_link(handle_t *handle, struct dentry *dentry) · 512 unmodified lines
513513 __ext4_fc_track_link(handle, d_inode(dentry), dentry);
514514 }
515515
516−void ext4_fc_track_create(handle_t *handle, struct dentry *dentry)
516+void __ext4_fc_track_create(handle_t *handle, struct inode *inode,
517+ struct dentry *dentry)
517518 {
518519 struct __track_dentry_update_args args;
519− struct inode *inode = d_inode(dentry);
520520 int ret;
521521
522522 args.dentry = dentry;
@@ -527,6 +527,11 @@ void ext4_fc_track_create(handle_t *handle, struct dentry *dentry) · 4 unmodified lines
527527 trace_ext4_fc_track_create(inode, dentry, ret);
528528 }
529529
530+void ext4_fc_track_create(handle_t *handle, struct dentry *dentry)
531+{
532+ __ext4_fc_track_create(handle, d_inode(dentry), dentry);
533+}
534+
530535 /* __track_fn for inode tracking */
531536 static int __track_inode(struct inode *inode, void *arg, bool update)
532537 {
fs/ext4/inode.c+10−8
@@ -1938,13 +1938,13 @@ static int __ext4_journalled_writepage(struct page *page, · 1937 unmodified lines
19381938 if (!ret)
19391939 ret = err;
19401940
1941− if (!ext4_has_inline_data(inode))
1942− ext4_walk_page_buffers(NULL, page_bufs, 0, len,
1943− NULL, bput_one);
19441941 ext4_set_inode_state(inode, EXT4_STATE_JDATA);
19451942 out:
19461943 unlock_page(page);
19471944 out_no_pagelock:
1945+ if (!inline_data && page_bufs)
1946+ ext4_walk_page_buffers(NULL, page_bufs, 0, len,
1947+ NULL, bput_one);
19481948 brelse(inode_bh);
19491949 return ret;
19501950 }
@@ -5026,7 +5026,7 @@ static int ext4_do_update_inode(handle_t *handle, · 3075 unmodified lines
50265026 struct ext4_inode_info *ei = EXT4_I(inode);
50275027 struct buffer_head *bh = iloc->bh;
50285028 struct super_block *sb = inode->i_sb;
5029− int err = 0, rc, block;
5029+ int err = 0, block;
50305030 int need_datasync = 0, set_large_file = 0;
50315031 uid_t i_uid;
50325032 gid_t i_gid;
@@ -5138,9 +5138,9 @@ static int ext4_do_update_inode(handle_t *handle, · 105 unmodified lines
51385138 bh->b_data);
51395139
51405140 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
5141− rc = ext4_handle_dirty_metadata(handle, NULL, bh);
5142− if (!err)
5143− err = rc;
5141+ err = ext4_handle_dirty_metadata(handle, NULL, bh);
5142+ if (err)
5143+ goto out_brelse;
51445144 ext4_clear_inode_state(inode, EXT4_STATE_NEW);
51455145 if (set_large_file) {
51465146 BUFFER_TRACE(EXT4_SB(sb)->s_sbh, "get write access");
@@ -5387,8 +5387,10 @@ int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, · 240 unmodified lines
53875387 inode->i_gid = attr->ia_gid;
53885388 error = ext4_mark_inode_dirty(handle, inode);
53895389 ext4_journal_stop(handle);
5390− if (unlikely(error))
5390+ if (unlikely(error)) {
5391+ ext4_fc_stop_update(inode);
53915392 return error;
5393+ }
53925394 }
53935395
53945396 if (attr->ia_valid & ATTR_SIZE) {
fs/ext4/mballoc.c+9−2
@@ -2709,8 +2709,15 @@ static int ext4_mb_init_backend(struct super_block *sb) · 2708 unmodified lines
27092709 }
27102710
27112711 if (ext4_has_feature_flex_bg(sb)) {
2712− /* a single flex group is supposed to be read by a single IO */
2713− sbi->s_mb_prefetch = min(1 << sbi->s_es->s_log_groups_per_flex,
2712+ /* a single flex group is supposed to be read by a single IO.
2713+ * 2 ^ s_log_groups_per_flex != UINT_MAX as s_mb_prefetch is
2714+ * unsigned integer, so the maximum shift is 32.
2715+ */
2716+ if (sbi->s_es->s_log_groups_per_flex >= 32) {
2717+ ext4_msg(sb, KERN_ERR, "too many log groups per flexible block group");
2718+ goto err_freesgi;
2719+ }
2720+ sbi->s_mb_prefetch = min_t(uint, 1 << sbi->s_es->s_log_groups_per_flex,
27142721 BLK_MAX_SEGMENT_SIZE >> (sb->s_blocksize_bits - 9));
27152722 sbi->s_mb_prefetch *= 8; /* 8 prefetch IOs in flight at most */
27162723 } else {
fs/ext4/namei.c+39−11
@@ -3613,6 +3613,31 @@ static int ext4_setent(handle_t *handle, struct ext4_renament *ent, · 3612 unmodified lines
36133613 return retval;
36143614 }
36153615
3616+static void ext4_resetent(handle_t *handle, struct ext4_renament *ent,
3617+ unsigned ino, unsigned file_type)
3618+{
3619+ struct ext4_renament old = *ent;
3620+ int retval = 0;
3621+
3622+ /*
3623+ * old->de could have moved from under us during make indexed dir,
3624+ * so the old->de may no longer valid and need to find it again
3625+ * before reset old inode info.
3626+ */
3627+ old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de, NULL);
3628+ if (IS_ERR(old.bh))
3629+ retval = PTR_ERR(old.bh);
3630+ if (!old.bh)
3631+ retval = -ENOENT;
3632+ if (retval) {
3633+ ext4_std_error(old.dir->i_sb, retval);
3634+ return;
3635+ }
3636+
3637+ ext4_setent(handle, &old, ino, file_type);
3638+ brelse(old.bh);
3639+}
3640+
36163641 static int ext4_find_delete_entry(handle_t *handle, struct inode *dir,
36173642 const struct qstr *d_name)
36183643 {
@@ -3774,14 +3799,14 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 155 unmodified lines
37743799 */
37753800 retval = -ENOENT;
37763801 if (!old.bh || le32_to_cpu(old.de->inode) != old.inode->i_ino)
3777− goto end_rename;
3802+ goto release_bh;
37783803
37793804 new.bh = ext4_find_entry(new.dir, &new.dentry->d_name,
37803805 &new.de, &new.inlined);
37813806 if (IS_ERR(new.bh)) {
37823807 retval = PTR_ERR(new.bh);
37833808 new.bh = NULL;
3784− goto end_rename;
3809+ goto release_bh;
37853810 }
37863811 if (new.bh) {
37873812 if (!new.inode) {
@@ -3798,15 +3823,13 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 10 unmodified lines
37983823 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits);
37993824 if (IS_ERR(handle)) {
38003825 retval = PTR_ERR(handle);
3801− handle = NULL;
3802− goto end_rename;
3826+ goto release_bh;
38033827 }
38043828 } else {
38053829 whiteout = ext4_whiteout_for_rename(mnt_userns, &old, credits, &handle);
38063830 if (IS_ERR(whiteout)) {
38073831 retval = PTR_ERR(whiteout);
3808− whiteout = NULL;
3809− goto end_rename;
3832+ goto release_bh;
38103833 }
38113834 }
38123835
@@ -3850,6 +3873,7 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 37 unmodified lines
38503873 retval = ext4_mark_inode_dirty(handle, whiteout);
38513874 if (unlikely(retval))
38523875 goto end_rename;
3876+
38533877 }
38543878 if (!new.bh) {
38553879 retval = ext4_add_entry(handle, new.dentry, old.inode);
@@ -3923,6 +3947,8 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 67 unmodified lines
39233947 ext4_fc_track_unlink(handle, new.dentry);
39243948 __ext4_fc_track_link(handle, old.inode, new.dentry);
39253949 __ext4_fc_track_unlink(handle, old.inode, old.dentry);
3950+ if (whiteout)
3951+ __ext4_fc_track_create(handle, whiteout, old.dentry);
39263952 }
39273953
39283954 if (new.inode) {
@@ -3937,19 +3963,21 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 8 unmodified lines
39373963 end_rename:
39383964 if (whiteout) {
39393965 if (retval) {
3940− ext4_setent(handle, &old,
3941− old.inode->i_ino, old_file_type);
3966+ ext4_resetent(handle, &old,
3967+ old.inode->i_ino, old_file_type);
39423968 drop_nlink(whiteout);
3969+ ext4_orphan_add(handle, whiteout);
39433970 }
39443971 unlock_new_inode(whiteout);
3972+ ext4_journal_stop(handle);
39453973 iput(whiteout);
3946−
3974+ } else {
3975+ ext4_journal_stop(handle);
39473976 }
3977+release_bh:
39483978 brelse(old.dir_bh);
39493979 brelse(old.bh);
39503980 brelse(new.bh);
3951− if (handle)
3952− ext4_journal_stop(handle);
39533981 return retval;
39543982 }
39553983
fs/ext4/super.c+6−1
@@ -1210,6 +1210,7 @@ static void ext4_put_super(struct super_block *sb) · 1209 unmodified lines
12101210 percpu_counter_destroy(&sbi->s_freeinodes_counter);
12111211 percpu_counter_destroy(&sbi->s_dirs_counter);
12121212 percpu_counter_destroy(&sbi->s_dirtyclusters_counter);
1213+ percpu_counter_destroy(&sbi->s_sra_exceeded_retry_limit);
12131214 percpu_free_rwsem(&sbi->s_writepages_rwsem);
12141215 #ifdef CONFIG_QUOTA
12151216 for (i = 0; i < EXT4_MAXQUOTAS; i++)
@@ -5011,6 +5012,9 @@ no_journal: · 3795 unmodified lines
50115012 if (!err)
50125013 err = percpu_counter_init(&sbi->s_dirtyclusters_counter, 0,
50135014 GFP_KERNEL);
5015+ if (!err)
5016+ err = percpu_counter_init(&sbi->s_sra_exceeded_retry_limit, 0,
5017+ GFP_KERNEL);
50145018 if (!err)
50155019 err = percpu_init_rwsem(&sbi->s_writepages_rwsem);
50165020
@@ -5124,6 +5128,7 @@ failed_mount6: · 107 unmodified lines
51245128 percpu_counter_destroy(&sbi->s_freeinodes_counter);
51255129 percpu_counter_destroy(&sbi->s_dirs_counter);
51265130 percpu_counter_destroy(&sbi->s_dirtyclusters_counter);
5131+ percpu_counter_destroy(&sbi->s_sra_exceeded_retry_limit);
51275132 percpu_free_rwsem(&sbi->s_writepages_rwsem);
51285133 failed_mount5:
51295134 ext4_ext_release(sb);
@@ -5149,8 +5154,8 @@ failed_mount_wq: · 19 unmodified lines
51495154 failed_mount3a:
51505155 ext4_es_unregister_shrinker(sbi);
51515156 failed_mount3:
5152− del_timer_sync(&sbi->s_err_report);
51535157 flush_work(&sbi->s_error_work);
5158+ del_timer_sync(&sbi->s_err_report);
51545159 if (sbi->s_mmp_tsk)
51555160 kthread_stop(sbi->s_mmp_tsk);
51565161 failed_mount2:
fs/ext4/sysfs.c+7−0
@@ -24,6 +24,7 @@ typedef enum { · 23 unmodified lines
2424 attr_session_write_kbytes,
2525 attr_lifetime_write_kbytes,
2626 attr_reserved_clusters,
27+ attr_sra_exceeded_retry_limit,
2728 attr_inode_readahead,
2829 attr_trigger_test_error,
2930 attr_first_error_time,
@@ -202,6 +203,7 @@ EXT4_ATTR_FUNC(delayed_allocation_blocks, 0444); · 172 unmodified lines
202203 EXT4_ATTR_FUNC(session_write_kbytes, 0444);
203204 EXT4_ATTR_FUNC(lifetime_write_kbytes, 0444);
204205 EXT4_ATTR_FUNC(reserved_clusters, 0644);
206+EXT4_ATTR_FUNC(sra_exceeded_retry_limit, 0444);
205207
206208 EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, inode_readahead,
207209 ext4_sb_info, s_inode_readahead_blks);
@@ -251,6 +253,7 @@ static struct attribute *ext4_attrs[] = { · 43 unmodified lines
251253 ATTR_LIST(session_write_kbytes),
252254 ATTR_LIST(lifetime_write_kbytes),
253255 ATTR_LIST(reserved_clusters),
256+ ATTR_LIST(sra_exceeded_retry_limit),
254257 ATTR_LIST(inode_readahead_blks),
255258 ATTR_LIST(inode_goal),
256259 ATTR_LIST(mb_stats),
@@ -374,6 +377,10 @@ static ssize_t ext4_attr_show(struct kobject *kobj, · 117 unmodified lines
374377 return snprintf(buf, PAGE_SIZE, "%llu\n",
375378 (unsigned long long)
376379 atomic64_read(&sbi->s_resv_clusters));
380+ case attr_sra_exceeded_retry_limit:
381+ return snprintf(buf, PAGE_SIZE, "%llu\n",
382+ (unsigned long long)
383+ percpu_counter_sum(&sbi->s_sra_exceeded_retry_limit));
377384 case attr_inode_readahead:
378385 case attr_pointer_ui:
379386 if (!ptr)
fs/ext4/verity.c+55−34
@@ -201,55 +201,76 @@ static int ext4_end_enable_verity(struct file *filp, const void *desc, · 200 unmodified lines
201201 struct inode *inode = file_inode(filp);
202202 const int credits = 2; /* superblock and inode for ext4_orphan_del() */
203203 handle_t *handle;
204+ struct ext4_iloc iloc;
204205 int err = 0;
205− int err2;
206206
207− if (desc != NULL) {
208− /* Succeeded; write the verity descriptor. */
209− err = ext4_write_verity_descriptor(inode, desc, desc_size,
210− merkle_tree_size);
211−
212− /* Write all pages before clearing VERITY_IN_PROGRESS. */
213− if (!err)
214− err = filemap_write_and_wait(inode->i_mapping);
215− }
207+ /*
208+ * If an error already occurred (which fs/verity/ signals by passing
209+ * desc == NULL), then only clean-up is needed.
210+ */
211+ if (desc == NULL)
212+ goto cleanup;
216213
217− /* If we failed, truncate anything we wrote past i_size. */
218− if (desc == NULL || err)
219− ext4_truncate(inode);
214+ /* Append the verity descriptor. */
215+ err = ext4_write_verity_descriptor(inode, desc, desc_size,
216+ merkle_tree_size);
217+ if (err)
218+ goto cleanup;
220219
221220 /*
222− * We must always clean up by clearing EXT4_STATE_VERITY_IN_PROGRESS and
223− * deleting the inode from the orphan list, even if something failed.
224− * If everything succeeded, we'll also set the verity bit in the same
225− * transaction.
221+ * Write all pages (both data and verity metadata). Note that this must
222+ * happen before clearing EXT4_STATE_VERITY_IN_PROGRESS; otherwise pages
223+ * beyond i_size won't be written properly. For crash consistency, this
224+ * also must happen before the verity inode flag gets persisted.
226225 */
226+ err = filemap_write_and_wait(inode->i_mapping);
227+ if (err)
228+ goto cleanup;
227229
228− ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS);
230+ /*
231+ * Finally, set the verity inode flag and remove the inode from the
232+ * orphan list (in a single transaction).
233+ */
229234
230235 handle = ext4_journal_start(inode, EXT4_HT_INODE, credits);
231236 if (IS_ERR(handle)) {
232− ext4_orphan_del(NULL, inode);
233− return PTR_ERR(handle);
237+ err = PTR_ERR(handle);
238+ goto cleanup;
234239 }
235240
236− err2 = ext4_orphan_del(handle, inode);
237− if (err2)
238− goto out_stop;
241+ err = ext4_orphan_del(handle, inode);
242+ if (err)
243+ goto stop_and_cleanup;
239244
240− if (desc != NULL && !err) {
241− struct ext4_iloc iloc;
245+ err = ext4_reserve_inode_write(handle, inode, &iloc);
246+ if (err)
247+ goto stop_and_cleanup;
242248
243− err = ext4_reserve_inode_write(handle, inode, &iloc);
244− if (err)
245− goto out_stop;
246− ext4_set_inode_flag(inode, EXT4_INODE_VERITY);
247− ext4_set_inode_flags(inode, false);
248− err = ext4_mark_iloc_dirty(handle, inode, &iloc);
249− }
250−out_stop:
249+ ext4_set_inode_flag(inode, EXT4_INODE_VERITY);
250+ ext4_set_inode_flags(inode, false);
251+ err = ext4_mark_iloc_dirty(handle, inode, &iloc);
252+ if (err)
253+ goto stop_and_cleanup;
254+
255+ ext4_journal_stop(handle);
256+
257+ ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS);
258+ return 0;
259+
260+stop_and_cleanup:
251261 ext4_journal_stop(handle);
252− return err ?: err2;
262+cleanup:
263+ /*
264+ * Verity failed to be enabled, so clean up by truncating any verity
265+ * metadata that was written beyond i_size (both from cache and from
266+ * disk), removing the inode from the orphan list (if it wasn't done
267+ * already), and clearing EXT4_STATE_VERITY_IN_PROGRESS.
268+ */
269+ truncate_inode_pages(inode->i_mapping, inode->i_size);
270+ ext4_truncate(inode);
271+ ext4_orphan_del(NULL, inode);
272+ ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS);
273+ return err;
253274 }
254275
255276 static int ext4_get_verity_descriptor_location(struct inode *inode,
fs/ext4/xattr.c+5−1
@@ -1462,6 +1462,9 @@ ext4_xattr_inode_cache_find(struct inode *inode, const void *value, · 1461 unmodified lines
14621462 if (!ce)
14631463 return NULL;
14641464
1465+ WARN_ON_ONCE(ext4_handle_valid(journal_current_handle()) &&
1466+ !(current->flags & PF_MEMALLOC_NOFS));
1467+
14651468 ea_data = kvmalloc(value_len, GFP_KERNEL);
14661469 if (!ea_data) {
14671470 mb_cache_entry_put(ea_inode_cache, ce);
@@ -2327,6 +2330,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, · 859 unmodified lines
23272330 error = -ENOSPC;
23282331 goto cleanup;
23292332 }
2333+ WARN_ON_ONCE(!(current->flags & PF_MEMALLOC_NOFS));
23302334 }
23312335
23322336 error = ext4_reserve_inode_write(handle, inode, &is.iloc);
@@ -2400,7 +2404,7 @@ retry_inode: · 67 unmodified lines
24002404 * external inode if possible.
24012405 */
24022406 if (ext4_has_feature_ea_inode(inode->i_sb) &&
2403− !i.in_inode) {
2407+ i.value_len && !i.in_inode) {
24042408 i.in_inode = 1;
24052409 goto retry_inode;
24062410 }
fs/fuse/dev.c+16−10
@@ -2229,19 +2229,21 @@ static int fuse_device_clone(struct fuse_conn *fc, struct file *new) · 2228 unmodified lines
22292229 static long fuse_dev_ioctl(struct file *file, unsigned int cmd,
22302230 unsigned long arg)
22312231 {
2232− int err = -ENOTTY;
2232+ int res;
2233+ int oldfd;
2234+ struct fuse_dev *fud = NULL;
22332235
2234− if (cmd == FUSE_DEV_IOC_CLONE) {
2235− int oldfd;
2236+ if (_IOC_TYPE(cmd) != FUSE_DEV_IOC_MAGIC)
2237+ return -ENOTTY;
22362238
2237− err = -EFAULT;
2238− if (!get_user(oldfd, (__u32 __user *) arg)) {
2239+ switch (_IOC_NR(cmd)) {
2240+ case _IOC_NR(FUSE_DEV_IOC_CLONE):
2241+ res = -EFAULT;
2242+ if (!get_user(oldfd, (__u32 __user *)arg)) {
22392243 struct file *old = fget(oldfd);
22402244
2241− err = -EINVAL;
2245+ res = -EINVAL;
22422246 if (old) {
2243− struct fuse_dev *fud = NULL;
2244−
22452247 /*
22462248 * Check against file->f_op because CUSE
22472249 * uses the same ioctl handler.
@@ -2252,14 +2254,18 @@ static long fuse_dev_ioctl(struct file *file, unsigned int cmd, · 4 unmodified lines
22522254
22532255 if (fud) {
22542256 mutex_lock(&fuse_mutex);
2255− err = fuse_device_clone(fud->fc, file);
2257+ res = fuse_device_clone(fud->fc, file);
22562258 mutex_unlock(&fuse_mutex);
22572259 }
22582260 fput(old);
22592261 }
22602262 }
2263+ break;
2264+ default:
2265+ res = -ENOTTY;
2266+ break;
22612267 }
2262− return err;
2268+ return res;
22632269 }
22642270
22652271 const struct file_operations fuse_dev_operations = {
fs/fuse/fuse_i.h+1−0
@@ -863,6 +863,7 @@ static inline u64 fuse_get_attr_version(struct fuse_conn *fc) · 862 unmodified lines
863863
864864 static inline void fuse_make_bad(struct inode *inode)
865865 {
866+ remove_inode_hash(inode);
866867 set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state);
867868 }
868869
fs/fuse/virtio_fs.c+8−1
@@ -1324,8 +1324,15 @@ static int virtio_fs_fill_super(struct super_block *sb, struct fs_context *fsc) · 1323 unmodified lines
13241324
13251325 /* virtiofs allocates and installs its own fuse devices */
13261326 ctx->fudptr = NULL;
1327− if (ctx->dax)
1327+ if (ctx->dax) {
1328+ if (!fs->dax_dev) {
1329+ err = -EINVAL;
1330+ pr_err("virtio-fs: dax can't be enabled as filesystem"
1331+ " device does not support it.\n");
1332+ goto err_free_fuse_devs;
1333+ }
13281334 ctx->dax_dev = fs->dax_dev;
1335+ }
13291336 err = fuse_fill_super_common(sb, ctx);
13301337 if (err < 0)
13311338 goto err_free_fuse_devs;
fs/io-wq.c+11−3
@@ -386,13 +386,16 @@ static struct io_wq_work *io_get_next_work(struct io_wqe *wqe) · 385 unmodified lines
386386 return NULL;
387387 }
388388
389−static void io_flush_signals(void)
389+static bool io_flush_signals(void)
390390 {
391391 if (unlikely(test_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL))) {
392+ __set_current_state(TASK_RUNNING);
392393 if (current->task_works)
393394 task_work_run();
394395 clear_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL);
396+ return true;
395397 }
398+ return false;
396399 }
397400
398401 static void io_assign_current_work(struct io_worker *worker,
@@ -488,6 +491,8 @@ static int io_wqe_worker(void *data) · 89 unmodified lines
488491 set_task_comm(current, buf);
489492
490493 while (!test_bit(IO_WQ_BIT_EXIT, &wq->state)) {
494+ long ret;
495+
491496 set_current_state(TASK_INTERRUPTIBLE);
492497 loop:
493498 raw_spin_lock_irq(&wqe->lock);
@@ -497,8 +502,10 @@ loop: · 3 unmodified lines
497502 }
498503 __io_worker_idle(wqe, worker);
499504 raw_spin_unlock_irq(&wqe->lock);
500− io_flush_signals();
501− if (schedule_timeout(WORKER_IDLE_TIMEOUT))
505+ if (io_flush_signals())
506+ continue;
507+ ret = schedule_timeout(WORKER_IDLE_TIMEOUT);
508+ if (try_to_freeze() || ret)
502509 continue;
503510 if (fatal_signal_pending(current))
504511 break;
@@ -709,6 +716,7 @@ static int io_wq_manager(void *data) · 204 unmodified lines
709716 set_current_state(TASK_INTERRUPTIBLE);
710717 io_wq_check_workers(wq);
711718 schedule_timeout(HZ);
719+ try_to_freeze();
712720 if (fatal_signal_pending(current))
713721 set_bit(IO_WQ_BIT_EXIT, &wq->state);
714722 } while (!test_bit(IO_WQ_BIT_EXIT, &wq->state));
fs/io-wq.h+9−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 #define INTERNAL_IO_WQ_H
33
44 #include <linux/refcount.h>
5−#include <linux/io_uring.h>
65
76 struct io_wq;
87
@@ -21,6 +20,15 @@ enum io_wq_cancel { · 12 unmodified lines
2120 IO_WQ_CANCEL_NOTFOUND, /* work not found */
2221 };
2322
23+struct io_wq_work_node {
24+ struct io_wq_work_node *next;
25+};
26+
27+struct io_wq_work_list {
28+ struct io_wq_work_node *first;
29+ struct io_wq_work_node *last;
30+};
31+
2432 static inline void wq_list_add_after(struct io_wq_work_node *node,
2533 struct io_wq_work_node *pos,
2634 struct io_wq_work_list *list)
fs/io_uring.c+147−105
@@ -258,7 +258,8 @@ enum { · 257 unmodified lines
258258
259259 struct io_sq_data {
260260 refcount_t refs;
261− struct rw_semaphore rw_lock;
261+ atomic_t park_pending;
262+ struct mutex lock;
262263
263264 /* ctx's that are using this sqd */
264265 struct list_head ctx_list;
@@ -273,6 +274,7 @@ struct io_sq_data { · 8 unmodified lines
273274
274275 unsigned long state;
275276 struct completion exited;
277+ struct callback_head *park_task_work;
276278 };
277279
278280 #define IO_IOPOLL_BATCH 8
@@ -402,7 +404,7 @@ struct io_ring_ctx { · 123 unmodified lines
402404 struct socket *ring_sock;
403405 #endif
404406
405− struct idr io_buffer_idr;
407+ struct xarray io_buffers;
406408
407409 struct xarray personalities;
408410 u32 pers_next;
@@ -454,6 +456,22 @@ struct io_ring_ctx { · 45 unmodified lines
454456 struct list_head tctx_list;
455457 };
456458
459+struct io_uring_task {
460+ /* submission side */
461+ struct xarray xa;
462+ struct wait_queue_head wait;
463+ const struct io_ring_ctx *last;
464+ struct io_wq *io_wq;
465+ struct percpu_counter inflight;
466+ atomic_t in_idle;
467+ bool sqpoll;
468+
469+ spinlock_t task_lock;
470+ struct io_wq_work_list task_list;
471+ unsigned long task_state;
472+ struct callback_head task_work;
473+};
474+
457475 /*
458476 * First field must be the file pointer in all the
459477 * iocb unions! See also 'struct kiocb' in <linux/fs.h>
@@ -1135,7 +1153,7 @@ static struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p) · 675 unmodified lines
11351153 init_waitqueue_head(&ctx->cq_wait);
11361154 INIT_LIST_HEAD(&ctx->cq_overflow_list);
11371155 init_completion(&ctx->ref_comp);
1138− idr_init(&ctx->io_buffer_idr);
1156+ xa_init_flags(&ctx->io_buffers, XA_FLAGS_ALLOC1);
11391157 xa_init_flags(&ctx->personalities, XA_FLAGS_ALLOC1);
11401158 mutex_init(&ctx->uring_lock);
11411159 init_waitqueue_head(&ctx->wait);
@@ -1550,14 +1568,17 @@ static void io_req_complete_post(struct io_kiocb *req, long res, · 408 unmodified lines
15501568 io_put_task(req->task, 1);
15511569 list_add(&req->compl.list, &cs->locked_free_list);
15521570 cs->locked_free_nr++;
1553− } else
1554− req = NULL;
1571+ } else {
1572+ if (!percpu_ref_tryget(&ctx->refs))
1573+ req = NULL;
1574+ }
15551575 io_commit_cqring(ctx);
15561576 spin_unlock_irqrestore(&ctx->completion_lock, flags);
1557− io_cqring_ev_posted(ctx);
15581577
1559− if (req)
1578+ if (req) {
1579+ io_cqring_ev_posted(ctx);
15601580 percpu_ref_put(&ctx->refs);
1581+ }
15611582 }
15621583
15631584 static void io_req_complete_state(struct io_kiocb *req, long res,
@@ -1925,17 +1946,44 @@ static int io_req_task_work_add(struct io_kiocb *req) · 361 unmodified lines
19251946 return ret;
19261947 }
19271948
1928−static void io_req_task_work_add_fallback(struct io_kiocb *req,
1929− task_work_func_t cb)
1949+static bool io_run_task_work_head(struct callback_head **work_head)
1950+{
1951+ struct callback_head *work, *next;
1952+ bool executed = false;
1953+
1954+ do {
1955+ work = xchg(work_head, NULL);
1956+ if (!work)
1957+ break;
1958+
1959+ do {
1960+ next = work->next;
1961+ work->func(work);
1962+ work = next;
1963+ cond_resched();
1964+ } while (work);
1965+ executed = true;
1966+ } while (1);
1967+
1968+ return executed;
1969+}
1970+
1971+static void io_task_work_add_head(struct callback_head **work_head,
1972+ struct callback_head *task_work)
19301973 {
1931− struct io_ring_ctx *ctx = req->ctx;
19321974 struct callback_head *head;
19331975
1934− init_task_work(&req->task_work, cb);
19351976 do {
1936− head = READ_ONCE(ctx->exit_task_work);
1937− req->task_work.next = head;
1938− } while (cmpxchg(&ctx->exit_task_work, head, &req->task_work) != head);
1977+ head = READ_ONCE(*work_head);
1978+ task_work->next = head;
1979+ } while (cmpxchg(work_head, head, task_work) != head);
1980+}
1981+
1982+static void io_req_task_work_add_fallback(struct io_kiocb *req,
1983+ task_work_func_t cb)
1984+{
1985+ init_task_work(&req->task_work, cb);
1986+ io_task_work_add_head(&req->ctx->exit_task_work, &req->task_work);
19391987 }
19401988
19411989 static void __io_req_task_cancel(struct io_kiocb *req, int error)
@@ -2843,7 +2891,7 @@ static struct io_buffer *io_buffer_select(struct io_kiocb *req, size_t *len, · 901 unmodified lines
28432891
28442892 lockdep_assert_held(&req->ctx->uring_lock);
28452893
2846− head = idr_find(&req->ctx->io_buffer_idr, bgid);
2894+ head = xa_load(&req->ctx->io_buffers, bgid);
28472895 if (head) {
28482896 if (!list_empty(&head->list)) {
28492897 kbuf = list_last_entry(&head->list, struct io_buffer,
@@ -2851,7 +2899,7 @@ static struct io_buffer *io_buffer_select(struct io_kiocb *req, size_t *len, · 1 unmodified line
28512899 list_del(&kbuf->list);
28522900 } else {
28532901 kbuf = head;
2854− idr_remove(&req->ctx->io_buffer_idr, bgid);
2902+ xa_erase(&req->ctx->io_buffers, bgid);
28552903 }
28562904 if (*len > kbuf->len)
28572905 *len = kbuf->len;
@@ -3892,7 +3940,7 @@ static int __io_remove_buffers(struct io_ring_ctx *ctx, struct io_buffer *buf, · 1034 unmodified lines
38923940 }
38933941 i++;
38943942 kfree(buf);
3895− idr_remove(&ctx->io_buffer_idr, bgid);
3943+ xa_erase(&ctx->io_buffers, bgid);
38963944
38973945 return i;
38983946 }
@@ -3910,7 +3958,7 @@ static int io_remove_buffers(struct io_kiocb *req, unsigned int issue_flags) · 11 unmodified lines
39103958 lockdep_assert_held(&ctx->uring_lock);
39113959
39123960 ret = -ENOENT;
3913− head = idr_find(&ctx->io_buffer_idr, p->bgid);
3961+ head = xa_load(&ctx->io_buffers, p->bgid);
39143962 if (head)
39153963 ret = __io_remove_buffers(ctx, head, p->bgid, p->nbufs);
39163964 if (ret < 0)
@@ -3993,21 +4041,14 @@ static int io_provide_buffers(struct io_kiocb *req, unsigned int issue_flags) · 76 unmodified lines
39934041
39944042 lockdep_assert_held(&ctx->uring_lock);
39954043
3996− list = head = idr_find(&ctx->io_buffer_idr, p->bgid);
4044+ list = head = xa_load(&ctx->io_buffers, p->bgid);
39974045
39984046 ret = io_add_buffers(p, &head);
3999− if (ret < 0)
4000− goto out;
4001−
4002− if (!list) {
4003− ret = idr_alloc(&ctx->io_buffer_idr, head, p->bgid, p->bgid + 1,
4004− GFP_KERNEL);
4005− if (ret < 0) {
4047+ if (ret >= 0 && !list) {
4048+ ret = xa_insert(&ctx->io_buffers, p->bgid, head, GFP_KERNEL);
4049+ if (ret < 0)
40064050 __io_remove_buffers(ctx, head, p->bgid, -1U);
4007− goto out;
4008− }
40094051 }
4010−out:
40114052 if (ret < 0)
40124053 req_set_fail_links(req);
40134054
@@ -4345,6 +4386,7 @@ static int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags) · 331 unmodified lines
43454386 struct io_async_msghdr iomsg, *kmsg;
43464387 struct socket *sock;
43474388 unsigned flags;
4389+ int min_ret = 0;
43484390 int ret;
43494391
43504392 sock = sock_from_file(req->file);
@@ -4359,12 +4401,15 @@ static int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags) · 8 unmodified lines
43594401 kmsg = &iomsg;
43604402 }
43614403
4362− flags = req->sr_msg.msg_flags;
4404+ flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
43634405 if (flags & MSG_DONTWAIT)
43644406 req->flags |= REQ_F_NOWAIT;
43654407 else if (issue_flags & IO_URING_F_NONBLOCK)
43664408 flags |= MSG_DONTWAIT;
43674409
4410+ if (flags & MSG_WAITALL)
4411+ min_ret = iov_iter_count(&kmsg->msg.msg_iter);
4412+
43684413 ret = __sys_sendmsg_sock(sock, &kmsg->msg, flags);
43694414 if ((issue_flags & IO_URING_F_NONBLOCK) && ret == -EAGAIN)
43704415 return io_setup_async_msg(req, kmsg);
@@ -4375,7 +4420,7 @@ static int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags) · 4 unmodified lines
43754420 if (kmsg->free_iov)
43764421 kfree(kmsg->free_iov);
43774422 req->flags &= ~REQ_F_NEED_CLEANUP;
4378− if (ret < 0)
4423+ if (ret < min_ret)
43794424 req_set_fail_links(req);
43804425 __io_req_complete(req, issue_flags, ret, 0);
43814426 return 0;
@@ -4388,6 +4433,7 @@ static int io_send(struct io_kiocb *req, unsigned int issue_flags) · 6 unmodified lines
43884433 struct iovec iov;
43894434 struct socket *sock;
43904435 unsigned flags;
4436+ int min_ret = 0;
43914437 int ret;
43924438
43934439 sock = sock_from_file(req->file);
@@ -4403,12 +4449,15 @@ static int io_send(struct io_kiocb *req, unsigned int issue_flags) · 9 unmodified lines
44034449 msg.msg_controllen = 0;
44044450 msg.msg_namelen = 0;
44054451
4406− flags = req->sr_msg.msg_flags;
4452+ flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
44074453 if (flags & MSG_DONTWAIT)
44084454 req->flags |= REQ_F_NOWAIT;
44094455 else if (issue_flags & IO_URING_F_NONBLOCK)
44104456 flags |= MSG_DONTWAIT;
44114457
4458+ if (flags & MSG_WAITALL)
4459+ min_ret = iov_iter_count(&msg.msg_iter);
4460+
44124461 msg.msg_flags = flags;
44134462 ret = sock_sendmsg(sock, &msg);
44144463 if ((issue_flags & IO_URING_F_NONBLOCK) && ret == -EAGAIN)
@@ -4416,7 +4465,7 @@ static int io_send(struct io_kiocb *req, unsigned int issue_flags) · 1 unmodified line
44164465 if (ret == -ERESTARTSYS)
44174466 ret = -EINTR;
44184467
4419− if (ret < 0)
4468+ if (ret < min_ret)
44204469 req_set_fail_links(req);
44214470 __io_req_complete(req, issue_flags, ret, 0);
44224471 return 0;
@@ -4568,6 +4617,7 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) · 145 unmodified lines
45684617 struct socket *sock;
45694618 struct io_buffer *kbuf;
45704619 unsigned flags;
4620+ int min_ret = 0;
45714621 int ret, cflags = 0;
45724622 bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;
45734623
@@ -4593,12 +4643,15 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) · 19 unmodified lines
45934643 1, req->sr_msg.len);
45944644 }
45954645
4596− flags = req->sr_msg.msg_flags;
4646+ flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
45974647 if (flags & MSG_DONTWAIT)
45984648 req->flags |= REQ_F_NOWAIT;
45994649 else if (force_nonblock)
46004650 flags |= MSG_DONTWAIT;
46014651
4652+ if (flags & MSG_WAITALL)
4653+ min_ret = iov_iter_count(&kmsg->msg.msg_iter);
4654+
46024655 ret = __sys_recvmsg_sock(sock, &kmsg->msg, req->sr_msg.umsg,
46034656 kmsg->uaddr, flags);
46044657 if (force_nonblock && ret == -EAGAIN)
@@ -4612,7 +4665,7 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) · 7 unmodified lines
46124665 if (kmsg->free_iov)
46134666 kfree(kmsg->free_iov);
46144667 req->flags &= ~REQ_F_NEED_CLEANUP;
4615− if (ret < 0)
4668+ if (ret < min_ret || ((flags & MSG_WAITALL) && (kmsg->msg.msg_flags & (MSG_TRUNC | MSG_CTRUNC))))
46164669 req_set_fail_links(req);
46174670 __io_req_complete(req, issue_flags, ret, cflags);
46184671 return 0;
@@ -4627,6 +4680,7 @@ static int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 8 unmodified lines
46274680 struct socket *sock;
46284681 struct iovec iov;
46294682 unsigned flags;
4683+ int min_ret = 0;
46304684 int ret, cflags = 0;
46314685 bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;
46324686
@@ -4652,12 +4706,15 @@ static int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 19 unmodified lines
46524706 msg.msg_iocb = NULL;
46534707 msg.msg_flags = 0;
46544708
4655− flags = req->sr_msg.msg_flags;
4709+ flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
46564710 if (flags & MSG_DONTWAIT)
46574711 req->flags |= REQ_F_NOWAIT;
46584712 else if (force_nonblock)
46594713 flags |= MSG_DONTWAIT;
46604714
4715+ if (flags & MSG_WAITALL)
4716+ min_ret = iov_iter_count(&msg.msg_iter);
4717+
46614718 ret = sock_recvmsg(sock, &msg, flags);
46624719 if (force_nonblock && ret == -EAGAIN)
46634720 return -EAGAIN;
@@ -4666,7 +4723,7 @@ static int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 2 unmodified lines
46664723 out_free:
46674724 if (req->flags & REQ_F_BUFFER_SELECTED)
46684725 cflags = io_put_recv_kbuf(req);
4669− if (ret < 0)
4726+ if (ret < min_ret || ((flags & MSG_WAITALL) && (msg.msg_flags & (MSG_TRUNC | MSG_CTRUNC))))
46704727 req_set_fail_links(req);
46714728 __io_req_complete(req, issue_flags, ret, cflags);
46724729 return 0;
@@ -6204,7 +6261,6 @@ static enum hrtimer_restart io_link_timeout_fn(struct hrtimer *timer) · 1531 unmodified lines
62046261 spin_unlock_irqrestore(&ctx->completion_lock, flags);
62056262
62066263 if (prev) {
6207− req_set_fail_links(prev);
62086264 io_async_find_and_cancel(ctx, req, prev->user_data, -ETIME);
62096265 io_put_req_deferred(prev, 1);
62106266 } else {
@@ -6694,17 +6750,17 @@ static int io_sq_thread(void *data) · 483 unmodified lines
66946750 set_cpus_allowed_ptr(current, cpu_online_mask);
66956751 current->flags |= PF_NO_SETAFFINITY;
66966752
6697− down_read(&sqd->rw_lock);
6698−
6753+ mutex_lock(&sqd->lock);
66996754 while (!test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state)) {
67006755 int ret;
67016756 bool cap_entries, sqt_spin, needs_sched;
67026757
67036758 if (test_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state)) {
6704− up_read(&sqd->rw_lock);
6759+ mutex_unlock(&sqd->lock);
67056760 cond_resched();
6706− down_read(&sqd->rw_lock);
6761+ mutex_lock(&sqd->lock);
67076762 io_run_task_work();
6763+ io_run_task_work_head(&sqd->park_task_work);
67086764 timeout = jiffies + sqd->sq_thread_idle;
67096765 continue;
67106766 }
@@ -6750,32 +6806,28 @@ static int io_sq_thread(void *data) · 39 unmodified lines
67506806 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
67516807 io_ring_set_wakeup_flag(ctx);
67526808
6753− up_read(&sqd->rw_lock);
6809+ mutex_unlock(&sqd->lock);
67546810 schedule();
6755− down_read(&sqd->rw_lock);
6811+ try_to_freeze();
6812+ mutex_lock(&sqd->lock);
67566813 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
67576814 io_ring_clear_wakeup_flag(ctx);
67586815 }
67596816
67606817 finish_wait(&sqd->wait, &wait);
6818+ io_run_task_work_head(&sqd->park_task_work);
67616819 timeout = jiffies + sqd->sq_thread_idle;
67626820 }
6763− up_read(&sqd->rw_lock);
6764− down_write(&sqd->rw_lock);
6765− /*
6766− * someone may have parked and added a cancellation task_work, run
6767− * it first because we don't want it in io_uring_cancel_sqpoll()
6768− */
6769− io_run_task_work();
67706821
67716822 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
67726823 io_uring_cancel_sqpoll(ctx);
67736824 sqd->thread = NULL;
67746825 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
67756826 io_ring_set_wakeup_flag(ctx);
6776− up_write(&sqd->rw_lock);
6827+ mutex_unlock(&sqd->lock);
67776828
67786829 io_run_task_work();
6830+ io_run_task_work_head(&sqd->park_task_work);
67796831 complete(&sqd->exited);
67806832 do_exit(0);
67816833 }
@@ -7075,23 +7127,28 @@ static int io_sqe_files_unregister(struct io_ring_ctx *ctx) · 293 unmodified lines
70757127 }
70767128
70777129 static void io_sq_thread_unpark(struct io_sq_data *sqd)
7078− __releases(&sqd->rw_lock)
7130+ __releases(&sqd->lock)
70797131 {
70807132 WARN_ON_ONCE(sqd->thread == current);
70817133
7134+ /*
7135+ * Do the dance but not conditional clear_bit() because it'd race with
7136+ * other threads incrementing park_pending and setting the bit.
7137+ */
70827138 clear_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);
7083− up_write(&sqd->rw_lock);
7139+ if (atomic_dec_return(&sqd->park_pending))
7140+ set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);
7141+ mutex_unlock(&sqd->lock);
70847142 }
70857143
70867144 static void io_sq_thread_park(struct io_sq_data *sqd)
7087− __acquires(&sqd->rw_lock)
7145+ __acquires(&sqd->lock)
70887146 {
70897147 WARN_ON_ONCE(sqd->thread == current);
70907148
7149+ atomic_inc(&sqd->park_pending);
70917150 set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);
7092− down_write(&sqd->rw_lock);
7093− /* set again for consistency, in case concurrent parks are happening */
7094− set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);
7151+ mutex_lock(&sqd->lock);
70957152 if (sqd->thread)
70967153 wake_up_process(sqd->thread);
70977154 }
@@ -7100,17 +7157,19 @@ static void io_sq_thread_stop(struct io_sq_data *sqd) · 2 unmodified lines
71007157 {
71017158 WARN_ON_ONCE(sqd->thread == current);
71027159
7103− down_write(&sqd->rw_lock);
7160+ mutex_lock(&sqd->lock);
71047161 set_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state);
71057162 if (sqd->thread)
71067163 wake_up_process(sqd->thread);
7107− up_write(&sqd->rw_lock);
7164+ mutex_unlock(&sqd->lock);
71087165 wait_for_completion(&sqd->exited);
71097166 }
71107167
71117168 static void io_put_sq_data(struct io_sq_data *sqd)
71127169 {
71137170 if (refcount_dec_and_test(&sqd->refs)) {
7171+ WARN_ON_ONCE(atomic_read(&sqd->park_pending));
7172+
71147173 io_sq_thread_stop(sqd);
71157174 kfree(sqd);
71167175 }
@@ -7184,9 +7243,10 @@ static struct io_sq_data *io_get_sq_data(struct io_uring_params *p, · 67 unmodified lines
71847243 if (!sqd)
71857244 return ERR_PTR(-ENOMEM);
71867245
7246+ atomic_set(&sqd->park_pending, 0);
71877247 refcount_set(&sqd->refs, 1);
71887248 INIT_LIST_HEAD(&sqd->ctx_list);
7189− init_rwsem(&sqd->rw_lock);
7249+ mutex_init(&sqd->lock);
71907250 init_waitqueue_head(&sqd->wait);
71917251 init_completion(&sqd->exited);
71927252 return sqd;
@@ -7866,22 +7926,17 @@ static int io_sq_offload_create(struct io_ring_ctx *ctx, · 673 unmodified lines
78667926
78677927 ret = 0;
78687928 io_sq_thread_park(sqd);
7929+ list_add(&ctx->sqd_list, &sqd->ctx_list);
7930+ io_sqd_update_thread_idle(sqd);
78697931 /* don't attach to a dying SQPOLL thread, would be racy */
7870− if (attached && !sqd->thread) {
7932+ if (attached && !sqd->thread)
78717933 ret = -ENXIO;
7872− } else {
7873− list_add(&ctx->sqd_list, &sqd->ctx_list);
7874− io_sqd_update_thread_idle(sqd);
7875− }
78767934 io_sq_thread_unpark(sqd);
78777935
7878− if (ret < 0) {
7879− io_put_sq_data(sqd);
7880− ctx->sq_data = NULL;
7881− return ret;
7882− } else if (attached) {
7936+ if (ret < 0)
7937+ goto err;
7938+ if (attached)
78837939 return 0;
7884− }
78857940
78867941 if (p->flags & IORING_SETUP_SQ_AFF) {
78877942 int cpu = p->sq_thread_cpu;
@@ -8332,19 +8387,13 @@ static int io_eventfd_unregister(struct io_ring_ctx *ctx) · 444 unmodified lines
83328387 return -ENXIO;
83338388 }
83348389
8335−static int __io_destroy_buffers(int id, void *p, void *data)
8336−{
8337− struct io_ring_ctx *ctx = data;
8338− struct io_buffer *buf = p;
8339−
8340− __io_remove_buffers(ctx, buf, id, -1U);
8341− return 0;
8342−}
8343−
83448390 static void io_destroy_buffers(struct io_ring_ctx *ctx)
83458391 {
8346− idr_for_each(&ctx->io_buffer_idr, __io_destroy_buffers, ctx);
8347− idr_destroy(&ctx->io_buffer_idr);
8392+ struct io_buffer *buf;
8393+ unsigned long index;
8394+
8395+ xa_for_each(&ctx->io_buffers, index, buf)
8396+ __io_remove_buffers(ctx, buf, index, -1U);
83488397 }
83498398
83508399 static void io_req_cache_free(struct list_head *list, struct task_struct *tsk)
@@ -8386,11 +8435,13 @@ static void io_ring_ctx_free(struct io_ring_ctx *ctx) · 35 unmodified lines
83868435 {
83878436 /*
83888437 * Some may use context even when all refs and requests have been put,
8389− * and they are free to do so while still holding uring_lock, see
8390− * __io_req_task_submit(). Wait for them to finish.
8438+ * and they are free to do so while still holding uring_lock or
8439+ * completion_lock, see __io_req_task_submit(). Wait for them to finish.
83918440 */
83928441 mutex_lock(&ctx->uring_lock);
83938442 mutex_unlock(&ctx->uring_lock);
8443+ spin_lock_irq(&ctx->completion_lock);
8444+ spin_unlock_irq(&ctx->completion_lock);
83948445
83958446 io_sq_thread_finish(ctx);
83968447 io_sqe_buffers_unregister(ctx);
@@ -8478,26 +8529,9 @@ static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id) · 81 unmodified lines
84788529 return -EINVAL;
84798530 }
84808531
8481−static bool io_run_ctx_fallback(struct io_ring_ctx *ctx)
8532+static inline bool io_run_ctx_fallback(struct io_ring_ctx *ctx)
84828533 {
8483− struct callback_head *work, *next;
8484− bool executed = false;
8485−
8486− do {
8487− work = xchg(&ctx->exit_task_work, NULL);
8488− if (!work)
8489− break;
8490−
8491− do {
8492− next = work->next;
8493− work->func(work);
8494− work = next;
8495− cond_resched();
8496− } while (work);
8497− executed = true;
8498− } while (1);
8499−
8500− return executed;
8534+ return io_run_task_work_head(&ctx->exit_task_work);
85018535 }
85028536
85038537 struct io_tctx_exit {
@@ -8580,6 +8614,14 @@ static void io_ring_ctx_wait_and_kill(struct io_ring_ctx *ctx) · 76 unmodified lines
85808614 io_unregister_personality(ctx, index);
85818615 mutex_unlock(&ctx->uring_lock);
85828616
8617+ /* prevent SQPOLL from submitting new requests */
8618+ if (ctx->sq_data) {
8619+ io_sq_thread_park(ctx->sq_data);
8620+ list_del_init(&ctx->sqd_list);
8621+ io_sqd_update_thread_idle(ctx->sq_data);
8622+ io_sq_thread_unpark(ctx->sq_data);
8623+ }
8624+
85838625 io_kill_timeouts(ctx, NULL, NULL);
85848626 io_poll_remove_all(ctx, NULL, NULL);
85858627
@@ -8879,7 +8921,7 @@ static void io_sqpoll_cancel_sync(struct io_ring_ctx *ctx) · 293 unmodified lines
88798921 if (task) {
88808922 init_completion(&work.completion);
88818923 init_task_work(&work.task_work, io_sqpoll_cancel_cb);
8882− WARN_ON_ONCE(task_work_add(task, &work.task_work, TWA_SIGNAL));
8924+ io_task_work_add_head(&sqd->park_task_work, &work.task_work);
88838925 wake_up_process(task);
88848926 }
88858927 io_sq_thread_unpark(sqd);
fs/iomap/swapfile.c+10−0
@@ -170,6 +170,16 @@ int iomap_swapfile_activate(struct swap_info_struct *sis, · 169 unmodified lines
170170 return ret;
171171 }
172172
173+ /*
174+ * If this swapfile doesn't contain even a single page-aligned
175+ * contiguous range of blocks, reject this useless swapfile to
176+ * prevent confusion later on.
177+ */
178+ if (isi.nr_pages == 0) {
179+ pr_warn("swapon: Cannot find a single usable page in file.\n");
180+ return -EINVAL;
181+ }
182+
173183 *pagespan = 1 + isi.highest_ppage - isi.lowest_ppage;
174184 sis->max = isi.nr_pages;
175185 sis->pages = isi.nr_pages - 1;
fs/locks.c+0−3
@@ -1808,9 +1808,6 @@ check_conflicting_open(struct file *filp, const long arg, int flags) · 1807 unmodified lines
18081808
18091809 if (flags & FL_LAYOUT)
18101810 return 0;
1811− if (flags & FL_DELEG)
1812− /* We leave these checks to the caller. */
1813− return 0;
18141811
18151812 if (arg == F_RDLCK)
18161813 return inode_is_open_for_write(inode) ? -EAGAIN : 0;
fs/nfsd/Kconfig+1−0
@@ -73,6 +73,7 @@ config NFSD_V4 · 72 unmodified lines
7373 select NFSD_V3
7474 select FS_POSIX_ACL
7575 select SUNRPC_GSS
76+ select CRYPTO
7677 select CRYPTO_MD5
7778 select CRYPTO_SHA256
7879 select GRACE_PERIOD
fs/nfsd/filecache.c+2−0
@@ -898,6 +898,8 @@ nfsd_file_find_locked(struct inode *inode, unsigned int may_flags, · 897 unmodified lines
898898 continue;
899899 if (!nfsd_match_cred(nf->nf_cred, current_cred()))
900900 continue;
901+ if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags))
902+ continue;
901903 if (nfsd_file_get(nf) != NULL)
902904 return nf;
903905 }
fs/nfsd/nfs4callback.c+1−0
@@ -1189,6 +1189,7 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata) · 1188 unmodified lines
11891189 switch (task->tk_status) {
11901190 case -EIO:
11911191 case -ETIMEDOUT:
1192+ case -EACCES:
11921193 nfsd4_mark_cb_down(clp, task->tk_status);
11931194 }
11941195 break;
fs/nfsd/nfs4proc.c+1−1
@@ -1302,7 +1302,7 @@ nfsd4_cleanup_inter_ssc(struct vfsmount *ss_mnt, struct nfsd_file *src, · 1301 unmodified lines
13021302 struct nfsd_file *dst)
13031303 {
13041304 nfs42_ssc_close(src->nf_file);
1305− /* 'src' is freed by nfsd4_do_async_copy */
1305+ fput(src->nf_file);
13061306 nfsd_file_put(dst);
13071307 mntput(ss_mnt);
13081308 }
fs/nfsd/nfs4state.c+15−40
@@ -4940,31 +4940,6 @@ static struct file_lock *nfs4_alloc_init_lease(struct nfs4_delegation *dp, · 4939 unmodified lines
49404940 return fl;
49414941 }
49424942
4943−static int nfsd4_check_conflicting_opens(struct nfs4_client *clp,
4944− struct nfs4_file *fp)
4945−{
4946− struct nfs4_clnt_odstate *co;
4947− struct file *f = fp->fi_deleg_file->nf_file;
4948− struct inode *ino = locks_inode(f);
4949− int writes = atomic_read(&ino->i_writecount);
4950−
4951− if (fp->fi_fds[O_WRONLY])
4952− writes--;
4953− if (fp->fi_fds[O_RDWR])
4954− writes--;
4955− if (writes > 0)
4956− return -EAGAIN;
4957− spin_lock(&fp->fi_lock);
4958− list_for_each_entry(co, &fp->fi_clnt_odstate, co_perfile) {
4959− if (co->co_client != clp) {
4960− spin_unlock(&fp->fi_lock);
4961− return -EAGAIN;
4962− }
4963− }
4964− spin_unlock(&fp->fi_lock);
4965− return 0;
4966−}
4967−
49684943 static struct nfs4_delegation *
49694944 nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
49704945 struct nfs4_file *fp, struct nfs4_clnt_odstate *odstate)
@@ -4984,12 +4959,9 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, · 13 unmodified lines
49844959
49854960 nf = find_readable_file(fp);
49864961 if (!nf) {
4987− /*
4988− * We probably could attempt another open and get a read
4989− * delegation, but for now, don't bother until the
4990− * client actually sends us one.
4991− */
4992− return ERR_PTR(-EAGAIN);
4962+ /* We should always have a readable file here */
4963+ WARN_ON_ONCE(1);
4964+ return ERR_PTR(-EBADF);
49934965 }
49944966 spin_lock(&state_lock);
49954967 spin_lock(&fp->fi_lock);
@@ -5019,19 +4991,11 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, · 23 unmodified lines
50194991 if (!fl)
50204992 goto out_clnt_odstate;
50214993
5022− status = nfsd4_check_conflicting_opens(clp, fp);
5023− if (status) {
5024− locks_free_lock(fl);
5025− goto out_clnt_odstate;
5026− }
50274994 status = vfs_setlease(fp->fi_deleg_file->nf_file, fl->fl_type, &fl, NULL);
50284995 if (fl)
50294996 locks_free_lock(fl);
50304997 if (status)
50314998 goto out_clnt_odstate;
5032− status = nfsd4_check_conflicting_opens(clp, fp);
5033− if (status)
5034− goto out_clnt_odstate;
50354999
50365000 spin_lock(&state_lock);
50375001 spin_lock(&fp->fi_lock);
@@ -5113,6 +5077,17 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, · 75 unmodified lines
51135077 goto out_no_deleg;
51145078 if (!cb_up || !(oo->oo_flags & NFS4_OO_CONFIRMED))
51155079 goto out_no_deleg;
5080+ /*
5081+ * Also, if the file was opened for write or
5082+ * create, there's a good chance the client's
5083+ * about to write to it, resulting in an
5084+ * immediate recall (since we don't support
5085+ * write delegations):
5086+ */
5087+ if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)
5088+ goto out_no_deleg;
5089+ if (open->op_create == NFS4_OPEN_CREATE)
5090+ goto out_no_deleg;
51165091 break;
51175092 default:
51185093 goto out_no_deleg;
@@ -5389,7 +5364,7 @@ nfs4_laundromat(struct nfsd_net *nn) · 270 unmodified lines
53895364 idr_for_each_entry(&nn->s2s_cp_stateids, cps_t, i) {
53905365 cps = container_of(cps_t, struct nfs4_cpntf_state, cp_stateid);
53915366 if (cps->cp_stateid.sc_type == NFS4_COPYNOTIFY_STID &&
5392− cps->cpntf_time > cutoff)
5367+ cps->cpntf_time < cutoff)
53935368 _free_cpntf_state_locked(nn, cps);
53945369 }
53955370 spin_unlock(&nn->s2s_cp_lock);
fs/select.c+4−6
@@ -1055,10 +1055,9 @@ static long do_restart_poll(struct restart_block *restart_block) · 1054 unmodified lines
10551055
10561056 ret = do_sys_poll(ufds, nfds, to);
10571057
1058− if (ret == -ERESTARTNOHAND) {
1059− restart_block->fn = do_restart_poll;
1060− ret = -ERESTART_RESTARTBLOCK;
1061− }
1058+ if (ret == -ERESTARTNOHAND)
1059+ ret = set_restart_fn(restart_block, do_restart_poll);
1060+
10621061 return ret;
10631062 }
10641063
@@ -1080,7 +1079,6 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, · 15 unmodified lines
10801079 struct restart_block *restart_block;
10811080
10821081 restart_block = &current->restart_block;
1083− restart_block->fn = do_restart_poll;
10841082 restart_block->poll.ufds = ufds;
10851083 restart_block->poll.nfds = nfds;
10861084
@@ -1091,7 +1089,7 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, · 4 unmodified lines
10911089 } else
10921090 restart_block->poll.has_timeout = 0;
10931091
1094− ret = -ERESTART_RESTARTBLOCK;
1092+ ret = set_restart_fn(restart_block, do_restart_poll);
10951093 }
10961094 return ret;
10971095 }
fs/xfs/xfs_inode.c+8−6
@@ -1007,9 +1007,10 @@ xfs_create( · 1006 unmodified lines
10071007 /*
10081008 * Make sure that we have allocated dquot(s) on disk.
10091009 */
1010− error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid,
1011− XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
1012− &udqp, &gdqp, &pdqp);
1010+ error = xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns),
1011+ fsgid_into_mnt(mnt_userns), prid,
1012+ XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
1013+ &udqp, &gdqp, &pdqp);
10131014 if (error)
10141015 return error;
10151016
@@ -1157,9 +1158,10 @@ xfs_create_tmpfile( · 141 unmodified lines
11571158 /*
11581159 * Make sure that we have allocated dquot(s) on disk.
11591160 */
1160− error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid,
1161− XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
1162− &udqp, &gdqp, &pdqp);
1161+ error = xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns),
1162+ fsgid_into_mnt(mnt_userns), prid,
1163+ XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
1164+ &udqp, &gdqp, &pdqp);
11631165 if (error)
11641166 return error;
11651167
fs/xfs/xfs_itable.c+6−0
@@ -168,6 +168,12 @@ xfs_bulkstat_one( · 167 unmodified lines
168168 };
169169 int error;
170170
171+ if (breq->mnt_userns != &init_user_ns) {
172+ xfs_warn_ratelimited(breq->mp,
173+ "bulkstat not supported inside of idmapped mounts.");
174+ return -EINVAL;
175+ }
176+
171177 ASSERT(breq->icount == 1);
172178
173179 bc.buf = kmem_zalloc(sizeof(struct xfs_bulkstat),
fs/xfs/xfs_mount.c+44−46
@@ -634,6 +634,47 @@ xfs_check_summary_counts( · 633 unmodified lines
634634 return xfs_initialize_perag_data(mp, mp->m_sb.sb_agcount);
635635 }
636636
637+/*
638+ * Flush and reclaim dirty inodes in preparation for unmount. Inodes and
639+ * internal inode structures can be sitting in the CIL and AIL at this point,
640+ * so we need to unpin them, write them back and/or reclaim them before unmount
641+ * can proceed.
642+ *
643+ * An inode cluster that has been freed can have its buffer still pinned in
644+ * memory because the transaction is still sitting in a iclog. The stale inodes
645+ * on that buffer will be pinned to the buffer until the transaction hits the
646+ * disk and the callbacks run. Pushing the AIL will skip the stale inodes and
647+ * may never see the pinned buffer, so nothing will push out the iclog and
648+ * unpin the buffer.
649+ *
650+ * Hence we need to force the log to unpin everything first. However, log
651+ * forces don't wait for the discards they issue to complete, so we have to
652+ * explicitly wait for them to complete here as well.
653+ *
654+ * Then we can tell the world we are unmounting so that error handling knows
655+ * that the filesystem is going away and we should error out anything that we
656+ * have been retrying in the background. This will prevent never-ending
657+ * retries in AIL pushing from hanging the unmount.
658+ *
659+ * Finally, we can push the AIL to clean all the remaining dirty objects, then
660+ * reclaim the remaining inodes that are still in memory at this point in time.
661+ */
662+static void
663+xfs_unmount_flush_inodes(
664+ struct xfs_mount *mp)
665+{
666+ xfs_log_force(mp, XFS_LOG_SYNC);
667+ xfs_extent_busy_wait_all(mp);
668+ flush_workqueue(xfs_discard_wq);
669+
670+ mp->m_flags |= XFS_MOUNT_UNMOUNTING;
671+
672+ xfs_ail_push_all_sync(mp->m_ail);
673+ cancel_delayed_work_sync(&mp->m_reclaim_work);
674+ xfs_reclaim_inodes(mp);
675+ xfs_health_unmount(mp);
676+}
677+
637678 /*
638679 * This function does the following on an initial mount of a file system:
639680 * - reads the superblock from disk and init the mount struct
@@ -1008,7 +1049,7 @@ xfs_mountfs( · 368 unmodified lines
10081049 /* Clean out dquots that might be in memory after quotacheck. */
10091050 xfs_qm_unmount(mp);
10101051 /*
1011− * Cancel all delayed reclaim work and reclaim the inodes directly.
1052+ * Flush all inode reclamation work and flush the log.
10121053 * We have to do this /after/ rtunmount and qm_unmount because those
10131054 * two will have scheduled delayed reclaim for the rt/quota inodes.
10141055 *
@@ -1018,11 +1059,8 @@ xfs_mountfs( · 3 unmodified lines
10181059 * qm_unmount_quotas and therefore rely on qm_unmount to release the
10191060 * quota inodes.
10201061 */
1021− cancel_delayed_work_sync(&mp->m_reclaim_work);
1022− xfs_reclaim_inodes(mp);
1023− xfs_health_unmount(mp);
1062+ xfs_unmount_flush_inodes(mp);
10241063 out_log_dealloc:
1025− mp->m_flags |= XFS_MOUNT_UNMOUNTING;
10261064 xfs_log_mount_cancel(mp);
10271065 out_fail_wait:
10281066 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp)
@@ -1063,47 +1101,7 @@ xfs_unmountfs( · 34 unmodified lines
10631101 xfs_rtunmount_inodes(mp);
10641102 xfs_irele(mp->m_rootip);
10651103
1066− /*
1067− * We can potentially deadlock here if we have an inode cluster
1068− * that has been freed has its buffer still pinned in memory because
1069− * the transaction is still sitting in a iclog. The stale inodes
1070− * on that buffer will be pinned to the buffer until the
1071− * transaction hits the disk and the callbacks run. Pushing the AIL will
1072− * skip the stale inodes and may never see the pinned buffer, so
1073− * nothing will push out the iclog and unpin the buffer. Hence we
1074− * need to force the log here to ensure all items are flushed into the
1075− * AIL before we go any further.
1076− */
1077− xfs_log_force(mp, XFS_LOG_SYNC);
1078−
1079− /*
1080− * Wait for all busy extents to be freed, including completion of
1081− * any discard operation.
1082− */
1083− xfs_extent_busy_wait_all(mp);
1084− flush_workqueue(xfs_discard_wq);
1085−
1086− /*
1087− * We now need to tell the world we are unmounting. This will allow
1088− * us to detect that the filesystem is going away and we should error
1089− * out anything that we have been retrying in the background. This will
1090− * prevent neverending retries in AIL pushing from hanging the unmount.
1091− */
1092− mp->m_flags |= XFS_MOUNT_UNMOUNTING;
1093−
1094− /*
1095− * Flush all pending changes from the AIL.
1096− */
1097− xfs_ail_push_all_sync(mp->m_ail);
1098−
1099− /*
1100− * Reclaim all inodes. At this point there should be no dirty inodes and
1101− * none should be pinned or locked. Stop background inode reclaim here
1102− * if it is still running.
1103− */
1104− cancel_delayed_work_sync(&mp->m_reclaim_work);
1105− xfs_reclaim_inodes(mp);
1106− xfs_health_unmount(mp);
1104+ xfs_unmount_flush_inodes(mp);
11071105
11081106 xfs_qm_unmount(mp);
11091107
fs/xfs/xfs_symlink.c+2−1
@@ -182,7 +182,8 @@ xfs_symlink( · 181 unmodified lines
182182 /*
183183 * Make sure that we have allocated dquot(s) on disk.
184184 */
185− error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid,
185+ error = xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns),
186+ fsgid_into_mnt(mnt_userns), prid,
186187 XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
187188 &udqp, &gdqp, &pdqp);
188189 if (error)
fs/zonefs/super.c+87−14
@@ -165,6 +165,21 @@ static int zonefs_writepages(struct address_space *mapping, · 164 unmodified lines
165165 return iomap_writepages(mapping, wbc, &wpc, &zonefs_writeback_ops);
166166 }
167167
168+static int zonefs_swap_activate(struct swap_info_struct *sis,
169+ struct file *swap_file, sector_t *span)
170+{
171+ struct inode *inode = file_inode(swap_file);
172+ struct zonefs_inode_info *zi = ZONEFS_I(inode);
173+
174+ if (zi->i_ztype != ZONEFS_ZTYPE_CNV) {
175+ zonefs_err(inode->i_sb,
176+ "swap file: not a conventional zone file\n");
177+ return -EINVAL;
178+ }
179+
180+ return iomap_swapfile_activate(sis, swap_file, span, &zonefs_iomap_ops);
181+}
182+
168183 static const struct address_space_operations zonefs_file_aops = {
169184 .readpage = zonefs_readpage,
170185 .readahead = zonefs_readahead,
@@ -177,6 +192,7 @@ static const struct address_space_operations zonefs_file_aops = { · 6 unmodified lines
177192 .is_partially_uptodate = iomap_is_partially_uptodate,
178193 .error_remove_page = generic_error_remove_page,
179194 .direct_IO = noop_direct_IO,
195+ .swap_activate = zonefs_swap_activate,
180196 };
181197
182198 static void zonefs_update_stats(struct inode *inode, loff_t new_isize)
@@ -727,6 +743,68 @@ out_release: · 544 unmodified lines
727743 return ret;
728744 }
729745
746+/*
747+ * Do not exceed the LFS limits nor the file zone size. If pos is under the
748+ * limit it becomes a short access. If it exceeds the limit, return -EFBIG.
749+ */
750+static loff_t zonefs_write_check_limits(struct file *file, loff_t pos,
751+ loff_t count)
752+{
753+ struct inode *inode = file_inode(file);
754+ struct zonefs_inode_info *zi = ZONEFS_I(inode);
755+ loff_t limit = rlimit(RLIMIT_FSIZE);
756+ loff_t max_size = zi->i_max_size;
757+
758+ if (limit != RLIM_INFINITY) {
759+ if (pos >= limit) {
760+ send_sig(SIGXFSZ, current, 0);
761+ return -EFBIG;
762+ }
763+ count = min(count, limit - pos);
764+ }
765+
766+ if (!(file->f_flags & O_LARGEFILE))
767+ max_size = min_t(loff_t, MAX_NON_LFS, max_size);
768+
769+ if (unlikely(pos >= max_size))
770+ return -EFBIG;
771+
772+ return min(count, max_size - pos);
773+}
774+
775+static ssize_t zonefs_write_checks(struct kiocb *iocb, struct iov_iter *from)
776+{
777+ struct file *file = iocb->ki_filp;
778+ struct inode *inode = file_inode(file);
779+ struct zonefs_inode_info *zi = ZONEFS_I(inode);
780+ loff_t count;
781+
782+ if (IS_SWAPFILE(inode))
783+ return -ETXTBSY;
784+
785+ if (!iov_iter_count(from))
786+ return 0;
787+
788+ if ((iocb->ki_flags & IOCB_NOWAIT) && !(iocb->ki_flags & IOCB_DIRECT))
789+ return -EINVAL;
790+
791+ if (iocb->ki_flags & IOCB_APPEND) {
792+ if (zi->i_ztype != ZONEFS_ZTYPE_SEQ)
793+ return -EINVAL;
794+ mutex_lock(&zi->i_truncate_mutex);
795+ iocb->ki_pos = zi->i_wpoffset;
796+ mutex_unlock(&zi->i_truncate_mutex);
797+ }
798+
799+ count = zonefs_write_check_limits(file, iocb->ki_pos,
800+ iov_iter_count(from));
801+ if (count < 0)
802+ return count;
803+
804+ iov_iter_truncate(from, count);
805+ return iov_iter_count(from);
806+}
807+
730808 /*
731809 * Handle direct writes. For sequential zone files, this is the only possible
732810 * write path. For these files, check that the user is issuing writes
@@ -744,8 +822,7 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) · 11 unmodified lines
744822 struct super_block *sb = inode->i_sb;
745823 bool sync = is_sync_kiocb(iocb);
746824 bool append = false;
747− size_t count;
748− ssize_t ret;
825+ ssize_t ret, count;
749826
750827 /*
751828 * For async direct IOs to sequential zone files, refuse IOCB_NOWAIT
@@ -763,12 +840,11 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) · 11 unmodified lines
763840 inode_lock(inode);
764841 }
765842
766− ret = generic_write_checks(iocb, from);
767− if (ret <= 0)
843+ count = zonefs_write_checks(iocb, from);
844+ if (count <= 0) {
845+ ret = count;
768846 goto inode_unlock;
769−
770− iov_iter_truncate(from, zi->i_max_size - iocb->ki_pos);
771− count = iov_iter_count(from);
847+ }
772848
773849 if ((iocb->ki_pos | count) & (sb->s_blocksize - 1)) {
774850 ret = -EINVAL;
@@ -828,12 +904,10 @@ static ssize_t zonefs_file_buffered_write(struct kiocb *iocb, · 53 unmodified lines
828904 inode_lock(inode);
829905 }
830906
831− ret = generic_write_checks(iocb, from);
907+ ret = zonefs_write_checks(iocb, from);
832908 if (ret <= 0)
833909 goto inode_unlock;
834910
835− iov_iter_truncate(from, zi->i_max_size - iocb->ki_pos);
836−
837911 ret = iomap_file_buffered_write(iocb, from, &zonefs_iomap_ops);
838912 if (ret > 0)
839913 iocb->ki_pos += ret;
@@ -966,9 +1040,7 @@ static int zonefs_open_zone(struct inode *inode) · 126 unmodified lines
9661040
9671041 mutex_lock(&zi->i_truncate_mutex);
9681042
969− zi->i_wr_refcnt++;
970− if (zi->i_wr_refcnt == 1) {
971−
1043+ if (!zi->i_wr_refcnt) {
9721044 if (atomic_inc_return(&sbi->s_open_zones) > sbi->s_max_open_zones) {
9731045 atomic_dec(&sbi->s_open_zones);
9741046 ret = -EBUSY;
@@ -978,7 +1050,6 @@ static int zonefs_open_zone(struct inode *inode) · 3 unmodified lines
9781050 if (i_size_read(inode) < zi->i_max_size) {
9791051 ret = zonefs_zone_mgmt(inode, REQ_OP_ZONE_OPEN);
9801052 if (ret) {
981− zi->i_wr_refcnt--;
9821053 atomic_dec(&sbi->s_open_zones);
9831054 goto unlock;
9841055 }
@@ -986,6 +1057,8 @@ static int zonefs_open_zone(struct inode *inode) · 1 unmodified line
9861057 }
9871058 }
9881059
1060+ zi->i_wr_refcnt++;
1061+
9891062 unlock:
9901063 mutex_unlock(&zi->i_truncate_mutex);
9911064
include/drm/ttm/ttm_bo_api.h+4−2
@@ -612,9 +612,11 @@ static inline void ttm_bo_pin(struct ttm_buffer_object *bo) · 611 unmodified lines
612612 static inline void ttm_bo_unpin(struct ttm_buffer_object *bo)
613613 {
614614 dma_resv_assert_held(bo->base.resv);
615− WARN_ON_ONCE(!bo->pin_count);
616615 WARN_ON_ONCE(!kref_read(&bo->kref));
617− --bo->pin_count;
616+ if (bo->pin_count)
617+ --bo->pin_count;
618+ else
619+ WARN_ON_ONCE(true);
618620 }
619621
620622 int ttm_mem_evict_first(struct ttm_bo_device *bdev,
include/linux/amba/bus.h+11−0
@@ -105,8 +105,19 @@ extern struct bus_type amba_bustype; · 104 unmodified lines
105105 #define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
106106 #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
107107
108+#ifdef CONFIG_ARM_AMBA
108109 int amba_driver_register(struct amba_driver *);
109110 void amba_driver_unregister(struct amba_driver *);
111+#else
112+static inline int amba_driver_register(struct amba_driver *drv)
113+{
114+ return -EINVAL;
115+}
116+static inline void amba_driver_unregister(struct amba_driver *drv)
117+{
118+}
119+#endif
120+
110121 struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t);
111122 void amba_device_put(struct amba_device *);
112123 int amba_device_add(struct amba_device *, struct resource *);
include/linux/efi.h+4−2
@@ -72,8 +72,10 @@ typedef void *efi_handle_t; · 71 unmodified lines
7272 */
7373 typedef guid_t efi_guid_t __aligned(__alignof__(u32));
7474
75−#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
76− GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)
75+#define EFI_GUID(a, b, c, d...) (efi_guid_t){ { \
76+ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
77+ (b) & 0xff, ((b) >> 8) & 0xff, \
78+ (c) & 0xff, ((c) >> 8) & 0xff, d } }
7779
7880 /*
7981 * Generic EFI table header
include/linux/io_uring.h+0−25
@@ -5,31 +5,6 @@ · 4 unmodified lines
55 #include <linux/sched.h>
66 #include <linux/xarray.h>
77
8−struct io_wq_work_node {
9− struct io_wq_work_node *next;
10−};
11−
12−struct io_wq_work_list {
13− struct io_wq_work_node *first;
14− struct io_wq_work_node *last;
15−};
16−
17−struct io_uring_task {
18− /* submission side */
19− struct xarray xa;
20− struct wait_queue_head wait;
21− void *last;
22− void *io_wq;
23− struct percpu_counter inflight;
24− atomic_t in_idle;
25− bool sqpoll;
26−
27− spinlock_t task_lock;
28− struct io_wq_work_list task_list;
29− unsigned long task_state;
30− struct callback_head task_work;
31−};
32−
338 #if defined(CONFIG_IO_URING)
349 struct sock *io_uring_get_socket(struct file *file);
3510 void __io_uring_task_cancel(void);
include/linux/module.h+0−3
@@ -30,9 +30,6 @@ · 29 unmodified lines
3030 #include <linux/percpu.h>
3131 #include <asm/module.h>
3232
33−/* Not Yet Implemented */
34−#define MODULE_SUPPORTED_DEVICE(name)
35−
3633 #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
3734
3835 struct modversion_info {
include/linux/restart_block.h+1−0
@@ -23,6 +23,7 @@ enum timespec_type { · 22 unmodified lines
2323 * System call restart block.
2424 */
2525 struct restart_block {
26+ unsigned long arch_data;
2627 long (*fn)(struct restart_block *);
2728 union {
2829 /* For futex_wait and futex_wait_requeue_pi */
include/linux/sunrpc/svc_rdma.h+0−1
@@ -104,7 +104,6 @@ struct svcxprt_rdma { · 103 unmodified lines
104104
105105 wait_queue_head_t sc_send_wait; /* SQ exhaustion waitlist */
106106 unsigned long sc_flags;
107− u32 sc_pending_recvs;
108107 struct list_head sc_read_complete_q;
109108 struct work_struct sc_work;
110109
include/linux/thread_info.h+13−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/types.h>
1212 #include <linux/bug.h>
1313 #include <linux/restart_block.h>
14+#include <linux/errno.h>
1415
1516 #ifdef CONFIG_THREAD_INFO_IN_TASK
1617 /*
@@ -59,6 +60,18 @@ enum syscall_work_bit { · 42 unmodified lines
5960
6061 #ifdef __KERNEL__
6162
63+#ifndef arch_set_restart_data
64+#define arch_set_restart_data(restart) do { } while (0)
65+#endif
66+
67+static inline long set_restart_fn(struct restart_block *restart,
68+ long (*fn)(struct restart_block *))
69+{
70+ restart->fn = fn;
71+ arch_set_restart_data(restart);
72+ return -ERESTART_RESTARTBLOCK;
73+}
74+
6275 #ifndef THREAD_ALIGN
6376 #define THREAD_ALIGN THREAD_SIZE
6477 #endif
include/linux/usb_usual.h+2−0
@@ -86,6 +86,8 @@ · 85 unmodified lines
8686 /* lies about caching, so always sync */ \
8787 US_FLAG(NO_SAME, 0x40000000) \
8888 /* Cannot handle WRITE_SAME */ \
89+ US_FLAG(SENSE_AFTER_SYNC, 0x80000000) \
90+ /* Do REQUEST_SENSE after SYNCHRONIZE_CACHE */ \
8991
9092 #define US_FLAG(name, value) US_FL_##name = value ,
9193 enum { US_DO_ALL_FLAGS };
include/linux/vdpa.h+5−5
@@ -250,20 +250,20 @@ struct vdpa_config_ops { · 249 unmodified lines
250250
251251 struct vdpa_device *__vdpa_alloc_device(struct device *parent,
252252 const struct vdpa_config_ops *config,
253− int nvqs, size_t size, const char *name);
253+ size_t size, const char *name);
254254
255−#define vdpa_alloc_device(dev_struct, member, parent, config, nvqs, name) \
255+#define vdpa_alloc_device(dev_struct, member, parent, config, name) \
256256 container_of(__vdpa_alloc_device( \
257− parent, config, nvqs, \
257+ parent, config, \
258258 sizeof(dev_struct) + \
259259 BUILD_BUG_ON_ZERO(offsetof( \
260260 dev_struct, member)), name), \
261261 dev_struct, member)
262262
263−int vdpa_register_device(struct vdpa_device *vdev);
263+int vdpa_register_device(struct vdpa_device *vdev, int nvqs);
264264 void vdpa_unregister_device(struct vdpa_device *vdev);
265265
266−int _vdpa_register_device(struct vdpa_device *vdev);
266+int _vdpa_register_device(struct vdpa_device *vdev, int nvqs);
267267 void _vdpa_unregister_device(struct vdpa_device *vdev);
268268
269269 /**
include/linux/virtio.h+0−2
@@ -132,8 +132,6 @@ bool is_virtio_device(struct device *dev); · 131 unmodified lines
132132 void virtio_break_device(struct virtio_device *dev);
133133
134134 void virtio_config_changed(struct virtio_device *dev);
135−void virtio_config_disable(struct virtio_device *dev);
136−void virtio_config_enable(struct virtio_device *dev);
137135 int virtio_finalize_features(struct virtio_device *dev);
138136 #ifdef CONFIG_PM_SLEEP
139137 int virtio_device_freeze(struct virtio_device *dev);
include/linux/ww_mutex.h+3−2
@@ -173,9 +173,10 @@ static inline void ww_acquire_done(struct ww_acquire_ctx *ctx) · 172 unmodified lines
173173 */
174174 static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)
175175 {
176−#ifdef CONFIG_DEBUG_MUTEXES
176+#ifdef CONFIG_DEBUG_LOCK_ALLOC
177177 mutex_release(&ctx->dep_map, _THIS_IP_);
178−
178+#endif
179+#ifdef CONFIG_DEBUG_MUTEXES
179180 DEBUG_LOCKS_WARN_ON(ctx->acquired);
180181 if (!IS_ENABLED(CONFIG_PROVE_LOCKING))
181182 /*
include/trace/events/workqueue.h+3−3
@@ -30,7 +30,7 @@ TRACE_EVENT(workqueue_queue_work, · 29 unmodified lines
3030 TP_STRUCT__entry(
3131 __field( void *, work )
3232 __field( void *, function)
33− __field( const char *, workqueue)
33+ __string( workqueue, pwq->wq->name)
3434 __field( unsigned int, req_cpu )
3535 __field( unsigned int, cpu )
3636 ),
@@ -38,13 +38,13 @@ TRACE_EVENT(workqueue_queue_work, · 1 unmodified line
3838 TP_fast_assign(
3939 __entry->work = work;
4040 __entry->function = work->func;
41− __entry->workqueue = pwq->wq->name;
41+ __assign_str(workqueue, pwq->wq->name);
4242 __entry->req_cpu = req_cpu;
4343 __entry->cpu = pwq->pool->cpu;
4444 ),
4545
4646 TP_printk("work struct=%p function=%ps workqueue=%s req_cpu=%u cpu=%u",
47− __entry->work, __entry->function, __entry->workqueue,
47+ __entry->work, __entry->function, __get_str(workqueue),
4848 __entry->req_cpu, __entry->cpu)
4949 );
5050
include/uapi/linux/fuse.h+2−1
@@ -903,7 +903,8 @@ struct fuse_notify_retrieve_in { · 902 unmodified lines
903903 };
904904
905905 /* Device ioctls: */
906−#define FUSE_DEV_IOC_CLONE _IOR(229, 0, uint32_t)
906+#define FUSE_DEV_IOC_MAGIC 229
907+#define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t)
907908
908909 struct fuse_lseek_in {
909910 uint64_t fh;
kernel/fork.c+0−1
@@ -2444,7 +2444,6 @@ struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node) · 2443 unmodified lines
24442444 if (!IS_ERR(tsk)) {
24452445 sigfillset(&tsk->blocked);
24462446 sigdelsetmask(&tsk->blocked, sigmask(SIGKILL));
2447− tsk->flags |= PF_NOFREEZE;
24482447 }
24492448 return tsk;
24502449 }
kernel/freezer.c+1−1
@@ -134,7 +134,7 @@ bool freeze_task(struct task_struct *p) · 133 unmodified lines
134134 return false;
135135 }
136136
137− if (!(p->flags & PF_KTHREAD))
137+ if (!(p->flags & (PF_KTHREAD | PF_IO_WORKER)))
138138 fake_signal_wake_up(p);
139139 else
140140 wake_up_state(p, TASK_INTERRUPTIBLE);
kernel/futex.c+1−2
@@ -2728,14 +2728,13 @@ retry: · 2727 unmodified lines
27282728 goto out;
27292729
27302730 restart = &current->restart_block;
2731− restart->fn = futex_wait_restart;
27322731 restart->futex.uaddr = uaddr;
27332732 restart->futex.val = val;
27342733 restart->futex.time = *abs_time;
27352734 restart->futex.bitset = bitset;
27362735 restart->futex.flags = flags | FLAGS_HAS_TIMEOUT;
27372736
2738− ret = -ERESTART_RESTARTBLOCK;
2737+ ret = set_restart_fn(restart, futex_wait_restart);
27392738
27402739 out:
27412740 if (to) {
kernel/irq/irq_sim.c+2−2
@@ -159,7 +159,7 @@ static const struct irq_domain_ops irq_sim_domain_ops = { · 158 unmodified lines
159159 * irq_domain_create_sim - Create a new interrupt simulator irq_domain and
160160 * allocate a range of dummy interrupts.
161161 *
162− * @fnode: struct fwnode_handle to be associated with this domain.
162+ * @fwnode: struct fwnode_handle to be associated with this domain.
163163 * @num_irqs: Number of interrupts to allocate.
164164 *
165165 * On success: return a new irq_domain object.
@@ -228,7 +228,7 @@ static void devm_irq_domain_release_sim(struct device *dev, void *res) · 62 unmodified lines
228228 * a managed device.
229229 *
230230 * @dev: Device to initialize the simulator object for.
231− * @fnode: struct fwnode_handle to be associated with this domain.
231+ * @fwnode: struct fwnode_handle to be associated with this domain.
232232 * @num_irqs: Number of interrupts to allocate
233233 *
234234 * On success: return a new irq_domain object.
kernel/irq/manage.c+4−0
@@ -1142,11 +1142,15 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) · 1141 unmodified lines
11421142 irqreturn_t ret;
11431143
11441144 local_bh_disable();
1145+ if (!IS_ENABLED(CONFIG_PREEMPT_RT))
1146+ local_irq_disable();
11451147 ret = action->thread_fn(action->irq, action->dev_id);
11461148 if (ret == IRQ_HANDLED)
11471149 atomic_inc(&desc->threads_handled);
11481150
11491151 irq_finalize_oneshot(desc, action);
1152+ if (!IS_ENABLED(CONFIG_PREEMPT_RT))
1153+ local_irq_enable();
11501154 local_bh_enable();
11511155 return ret;
11521156 }
kernel/jump_label.c+8−0
@@ -407,6 +407,14 @@ static bool jump_label_can_update(struct jump_entry *entry, bool init) · 406 unmodified lines
407407 return false;
408408
409409 if (!kernel_text_address(jump_entry_code(entry))) {
410+ /*
411+ * This skips patching built-in __exit, which
412+ * is part of init_section_contains() but is
413+ * not part of kernel_text_address().
414+ *
415+ * Skipping built-in __exit is fine since it
416+ * will never be executed.
417+ */
410418 WARN_ONCE(!jump_entry_is_init(entry),
411419 "can't patch jump_label at %pS",
412420 (void *)jump_entry_code(entry));
kernel/locking/mutex.c+14−11
@@ -626,7 +626,7 @@ static inline int mutex_can_spin_on_owner(struct mutex *lock) · 625 unmodified lines
626626 */
627627 static __always_inline bool
628628 mutex_optimistic_spin(struct mutex *lock, struct ww_acquire_ctx *ww_ctx,
629− const bool use_ww_ctx, struct mutex_waiter *waiter)
629+ struct mutex_waiter *waiter)
630630 {
631631 if (!waiter) {
632632 /*
@@ -702,7 +702,7 @@ fail: · 69 unmodified lines
702702 #else
703703 static __always_inline bool
704704 mutex_optimistic_spin(struct mutex *lock, struct ww_acquire_ctx *ww_ctx,
705− const bool use_ww_ctx, struct mutex_waiter *waiter)
705+ struct mutex_waiter *waiter)
706706 {
707707 return false;
708708 }
@@ -922,6 +922,9 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 213 unmodified lines
922922 struct ww_mutex *ww;
923923 int ret;
924924
925+ if (!use_ww_ctx)
926+ ww_ctx = NULL;
927+
925928 might_sleep();
926929
927930 #ifdef CONFIG_DEBUG_MUTEXES
@@ -929,7 +932,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 1 unmodified line
929932 #endif
930933
931934 ww = container_of(lock, struct ww_mutex, base);
932− if (use_ww_ctx && ww_ctx) {
935+ if (ww_ctx) {
933936 if (unlikely(ww_ctx == READ_ONCE(ww->ctx)))
934937 return -EALREADY;
935938
@@ -946,10 +949,10 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 10 unmodified lines
946949 mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, ip);
947950
948951 if (__mutex_trylock(lock) ||
949− mutex_optimistic_spin(lock, ww_ctx, use_ww_ctx, NULL)) {
952+ mutex_optimistic_spin(lock, ww_ctx, NULL)) {
950953 /* got the lock, yay! */
951954 lock_acquired(&lock->dep_map, ip);
952− if (use_ww_ctx && ww_ctx)
955+ if (ww_ctx)
953956 ww_mutex_set_context_fastpath(ww, ww_ctx);
954957 preempt_enable();
955958 return 0;
@@ -960,7 +963,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 4 unmodified lines
960963 * After waiting to acquire the wait_lock, try again.
961964 */
962965 if (__mutex_trylock(lock)) {
963− if (use_ww_ctx && ww_ctx)
966+ if (ww_ctx)
964967 __ww_mutex_check_waiters(lock, ww_ctx);
965968
966969 goto skip_wait;
@@ -1013,7 +1016,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 46 unmodified lines
10131016 goto err;
10141017 }
10151018
1016− if (use_ww_ctx && ww_ctx) {
1019+ if (ww_ctx) {
10171020 ret = __ww_mutex_check_kill(lock, &waiter, ww_ctx);
10181021 if (ret)
10191022 goto err;
@@ -1026,7 +1029,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 6 unmodified lines
10261029 * ww_mutex needs to always recheck its position since its waiter
10271030 * list is not FIFO ordered.
10281031 */
1029− if ((use_ww_ctx && ww_ctx) || !first) {
1032+ if (ww_ctx || !first) {
10301033 first = __mutex_waiter_is_first(lock, &waiter);
10311034 if (first)
10321035 __mutex_set_flag(lock, MUTEX_FLAG_HANDOFF);
@@ -1039,7 +1042,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 6 unmodified lines
10391042 * or we must see its unlock and acquire.
10401043 */
10411044 if (__mutex_trylock(lock) ||
1042− (first && mutex_optimistic_spin(lock, ww_ctx, use_ww_ctx, &waiter)))
1045+ (first && mutex_optimistic_spin(lock, ww_ctx, &waiter)))
10431046 break;
10441047
10451048 spin_lock(&lock->wait_lock);
@@ -1048,7 +1051,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 2 unmodified lines
10481051 acquired:
10491052 __set_current_state(TASK_RUNNING);
10501053
1051− if (use_ww_ctx && ww_ctx) {
1054+ if (ww_ctx) {
10521055 /*
10531056 * Wound-Wait; we stole the lock (!first_waiter), check the
10541057 * waiters as anyone might want to wound us.
@@ -1068,7 +1071,7 @@ skip_wait: · 13 unmodified lines
10681071 /* got the lock - cleanup and rejoice! */
10691072 lock_acquired(&lock->dep_map, ip);
10701073
1071− if (use_ww_ctx && ww_ctx)
1074+ if (ww_ctx)
10721075 ww_mutex_lock_acquired(ww, ww_ctx);
10731076
10741077 spin_unlock(&lock->wait_lock);
kernel/reboot.c+0−2
@@ -244,8 +244,6 @@ void migrate_to_reboot_cpu(void) · 243 unmodified lines
244244 void kernel_restart(char *cmd)
245245 {
246246 kernel_restart_prepare(cmd);
247− if (pm_power_off_prepare)
248− pm_power_off_prepare();
249247 migrate_to_reboot_cpu();
250248 syscore_shutdown();
251249 if (!cmd)
kernel/signal.c+5−1
@@ -288,7 +288,8 @@ bool task_set_jobctl_pending(struct task_struct *task, unsigned long mask) · 287 unmodified lines
288288 JOBCTL_STOP_SIGMASK | JOBCTL_TRAPPING));
289289 BUG_ON((mask & JOBCTL_TRAPPING) && !(mask & JOBCTL_PENDING_MASK));
290290
291− if (unlikely(fatal_signal_pending(task) || (task->flags & PF_EXITING)))
291+ if (unlikely(fatal_signal_pending(task) ||
292+ (task->flags & (PF_EXITING | PF_IO_WORKER))))
292293 return false;
293294
294295 if (mask & JOBCTL_STOP_SIGMASK)
@@ -833,6 +834,9 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info, · 538 unmodified lines
833834
834835 if (!valid_signal(sig))
835836 return -EINVAL;
837+ /* PF_IO_WORKER threads don't take any signals */
838+ if (t->flags & PF_IO_WORKER)
839+ return -ESRCH;
836840
837841 if (!si_fromuser(info))
838842 return 0;
kernel/static_call.c+24−18
@@ -35,27 +35,30 @@ static inline void *static_call_addr(struct static_call_site *site) · 34 unmodified lines
3535 return (void *)((long)site->addr + (long)&site->addr);
3636 }
3737
38+static inline unsigned long __static_call_key(const struct static_call_site *site)
39+{
40+ return (long)site->key + (long)&site->key;
41+}
3842
3943 static inline struct static_call_key *static_call_key(const struct static_call_site *site)
4044 {
41− return (struct static_call_key *)
42− (((long)site->key + (long)&site->key) & ~STATIC_CALL_SITE_FLAGS);
45+ return (void *)(__static_call_key(site) & ~STATIC_CALL_SITE_FLAGS);
4346 }
4447
4548 /* These assume the key is word-aligned. */
4649 static inline bool static_call_is_init(struct static_call_site *site)
4750 {
48− return ((long)site->key + (long)&site->key) & STATIC_CALL_SITE_INIT;
51+ return __static_call_key(site) & STATIC_CALL_SITE_INIT;
4952 }
5053
5154 static inline bool static_call_is_tail(struct static_call_site *site)
5255 {
53− return ((long)site->key + (long)&site->key) & STATIC_CALL_SITE_TAIL;
56+ return __static_call_key(site) & STATIC_CALL_SITE_TAIL;
5457 }
5558
5659 static inline void static_call_set_init(struct static_call_site *site)
5760 {
58− site->key = ((long)static_call_key(site) | STATIC_CALL_SITE_INIT) -
61+ site->key = (__static_call_key(site) | STATIC_CALL_SITE_INIT) -
5962 (long)&site->key;
6063 }
6164
@@ -146,6 +149,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) · 84 unmodified lines
146149 };
147150
148151 for (site_mod = &first; site_mod; site_mod = site_mod->next) {
152+ bool init = system_state < SYSTEM_RUNNING;
149153 struct module *mod = site_mod->mod;
150154
151155 if (!site_mod->sites) {
@@ -165,6 +169,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) · 13 unmodified lines
165169 if (mod) {
166170 stop = mod->static_call_sites +
167171 mod->num_static_call_sites;
172+ init = mod->state == MODULE_STATE_COMING;
168173 }
169174 #endif
170175
@@ -172,25 +177,26 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) · 1 unmodified line
172177 site < stop && static_call_key(site) == key; site++) {
173178 void *site_addr = static_call_addr(site);
174179
175− if (static_call_is_init(site)) {
176− /*
177− * Don't write to call sites which were in
178− * initmem and have since been freed.
179− */
180− if (!mod && system_state >= SYSTEM_RUNNING)
181− continue;
182− if (mod && !within_module_init((unsigned long)site_addr, mod))
183− continue;
184− }
180+ if (!init && static_call_is_init(site))
181+ continue;
185182
186183 if (!kernel_text_address((unsigned long)site_addr)) {
187− WARN_ONCE(1, "can't patch static call site at %pS",
184+ /*
185+ * This skips patching built-in __exit, which
186+ * is part of init_section_contains() but is
187+ * not part of kernel_text_address().
188+ *
189+ * Skipping built-in __exit is fine since it
190+ * will never be executed.
191+ */
192+ WARN_ONCE(!static_call_is_init(site),
193+ "can't patch static call site at %pS",
188194 site_addr);
189195 continue;
190196 }
191197
192198 arch_static_call_transform(site_addr, NULL, func,
193− static_call_is_tail(site));
199+ static_call_is_tail(site));
194200 }
195201 }
196202
@@ -349,7 +355,7 @@ static int static_call_add_module(struct module *mod) · 152 unmodified lines
349355 struct static_call_site *site;
350356
351357 for (site = start; site != stop; site++) {
352− unsigned long s_key = (long)site->key + (long)&site->key;
358+ unsigned long s_key = __static_call_key(site);
353359 unsigned long addr = s_key & ~STATIC_CALL_SITE_FLAGS;
354360 unsigned long key;
355361
kernel/time/alarmtimer.c+1−1
@@ -854,9 +854,9 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags, · 853 unmodified lines
854854 if (flags == TIMER_ABSTIME)
855855 return -ERESTARTNOHAND;
856856
857− restart->fn = alarm_timer_nsleep_restart;
858857 restart->nanosleep.clockid = type;
859858 restart->nanosleep.expires = exp;
859+ set_restart_fn(restart, alarm_timer_nsleep_restart);
860860 return ret;
861861 }
862862
kernel/time/hrtimer.c+1−1
@@ -1957,9 +1957,9 @@ long hrtimer_nanosleep(ktime_t rqtp, const enum hrtimer_mode mode, · 1956 unmodified lines
19571957 }
19581958
19591959 restart = &current->restart_block;
1960− restart->fn = hrtimer_nanosleep_restart;
19611960 restart->nanosleep.clockid = t.timer.base->clockid;
19621961 restart->nanosleep.expires = hrtimer_get_expires_tv64(&t.timer);
1962+ set_restart_fn(restart, hrtimer_nanosleep_restart);
19631963 out:
19641964 destroy_hrtimer_on_stack(&t.timer);
19651965 return ret;
kernel/time/posix-cpu-timers.c+1−1
@@ -1480,8 +1480,8 @@ static int posix_cpu_nsleep(const clockid_t which_clock, int flags, · 1479 unmodified lines
14801480 if (flags & TIMER_ABSTIME)
14811481 return -ERESTARTNOHAND;
14821482
1483− restart_block->fn = posix_cpu_nsleep_restart;
14841483 restart_block->nanosleep.clockid = which_clock;
1484+ set_restart_fn(restart_block, posix_cpu_nsleep_restart);
14851485 }
14861486 return error;
14871487 }
net/batman-adv/main.c+0−1
@@ -702,7 +702,6 @@ MODULE_LICENSE("GPL"); · 701 unmodified lines
702702
703703 MODULE_AUTHOR(BATADV_DRIVER_AUTHOR);
704704 MODULE_DESCRIPTION(BATADV_DRIVER_DESC);
705−MODULE_SUPPORTED_DEVICE(BATADV_DRIVER_DEVICE);
706705 MODULE_VERSION(BATADV_SOURCE_VERSION);
707706 MODULE_ALIAS_RTNL_LINK("batadv");
708707 MODULE_ALIAS_GENL_FAMILY(BATADV_NL_NAME);
net/sunrpc/auth_gss/svcauth_gss.c+7−4
@@ -1825,11 +1825,14 @@ static int · 1824 unmodified lines
18251825 svcauth_gss_release(struct svc_rqst *rqstp)
18261826 {
18271827 struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data;
1828− struct rpc_gss_wire_cred *gc = &gsd->clcred;
1828+ struct rpc_gss_wire_cred *gc;
18291829 struct xdr_buf *resbuf = &rqstp->rq_res;
18301830 int stat = -EINVAL;
18311831 struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id);
18321832
1833+ if (!gsd)
1834+ goto out;
1835+ gc = &gsd->clcred;
18331836 if (gc->gc_proc != RPC_GSS_PROC_DATA)
18341837 goto out;
18351838 /* Release can be called twice, but we only wrap once. */
@@ -1870,10 +1873,10 @@ out_err: · 34 unmodified lines
18701873 if (rqstp->rq_cred.cr_group_info)
18711874 put_group_info(rqstp->rq_cred.cr_group_info);
18721875 rqstp->rq_cred.cr_group_info = NULL;
1873− if (gsd->rsci)
1876+ if (gsd && gsd->rsci) {
18741877 cache_put(&gsd->rsci->h, sn->rsc_cache);
1875− gsd->rsci = NULL;
1876−
1878+ gsd->rsci = NULL;
1879+ }
18771880 return stat;
18781881 }
18791882
net/sunrpc/svc.c+4−2
@@ -1413,7 +1413,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) · 1412 unmodified lines
14131413
14141414 sendit:
14151415 if (svc_authorise(rqstp))
1416− goto close;
1416+ goto close_xprt;
14171417 return 1; /* Caller can now send it */
14181418
14191419 release_dropit:
@@ -1425,6 +1425,8 @@ release_dropit: · 5 unmodified lines
14251425 return 0;
14261426
14271427 close:
1428+ svc_authorise(rqstp);
1429+close_xprt:
14281430 if (rqstp->rq_xprt && test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags))
14291431 svc_close_xprt(rqstp->rq_xprt);
14301432 dprintk("svc: svc_process close\n");
@@ -1433,7 +1435,7 @@ release_dropit: · 2 unmodified lines
14331435 err_short_len:
14341436 svc_printk(rqstp, "short len %zd, dropping request\n",
14351437 argv->iov_len);
1436− goto close;
1438+ goto close_xprt;
14371439
14381440 err_bad_rpc:
14391441 serv->sv_stats->rpcbadfmt++;
net/sunrpc/svc_xprt.c+2−2
@@ -1060,7 +1060,7 @@ static int svc_close_list(struct svc_serv *serv, struct list_head *xprt_list, st · 1059 unmodified lines
10601060 struct svc_xprt *xprt;
10611061 int ret = 0;
10621062
1063− spin_lock(&serv->sv_lock);
1063+ spin_lock_bh(&serv->sv_lock);
10641064 list_for_each_entry(xprt, xprt_list, xpt_list) {
10651065 if (xprt->xpt_net != net)
10661066 continue;
@@ -1068,7 +1068,7 @@ static int svc_close_list(struct svc_serv *serv, struct list_head *xprt_list, st · 1 unmodified line
10681068 set_bit(XPT_CLOSE, &xprt->xpt_flags);
10691069 svc_xprt_enqueue(xprt);
10701070 }
1071− spin_unlock(&serv->sv_lock);
1071+ spin_unlock_bh(&serv->sv_lock);
10721072 return ret;
10731073 }
10741074
net/sunrpc/xprtrdma/svc_rdma_backchannel.c+3−3
@@ -252,9 +252,9 @@ xprt_setup_rdma_bc(struct xprt_create *args) · 251 unmodified lines
252252 xprt->timeout = &xprt_rdma_bc_timeout;
253253 xprt_set_bound(xprt);
254254 xprt_set_connected(xprt);
255− xprt->bind_timeout = RPCRDMA_BIND_TO;
256− xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO;
257− xprt->idle_timeout = RPCRDMA_IDLE_DISC_TO;
255+ xprt->bind_timeout = 0;
256+ xprt->reestablish_timeout = 0;
257+ xprt->idle_timeout = 0;
258258
259259 xprt->prot = XPRT_TRANSPORT_BC_RDMA;
260260 xprt->ops = &xprt_rdma_bc_procs;
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c+39−43
@@ -266,46 +266,33 @@ void svc_rdma_release_rqst(struct svc_rqst *rqstp) · 265 unmodified lines
266266 svc_rdma_recv_ctxt_put(rdma, ctxt);
267267 }
268268
269−static bool svc_rdma_refresh_recvs(struct svcxprt_rdma *rdma,
270− unsigned int wanted, bool temp)
269+static int __svc_rdma_post_recv(struct svcxprt_rdma *rdma,
270+ struct svc_rdma_recv_ctxt *ctxt)
271271 {
272− const struct ib_recv_wr *bad_wr = NULL;
273− struct svc_rdma_recv_ctxt *ctxt;
274− struct ib_recv_wr *recv_chain;
275272 int ret;
276273
277− recv_chain = NULL;
278− while (wanted--) {
279− ctxt = svc_rdma_recv_ctxt_get(rdma);
280− if (!ctxt)
281− break;
282−
283− trace_svcrdma_post_recv(ctxt);
284− ctxt->rc_temp = temp;
285− ctxt->rc_recv_wr.next = recv_chain;
286− recv_chain = &ctxt->rc_recv_wr;
287− rdma->sc_pending_recvs++;
288− }
289− if (!recv_chain)
290− return false;
291−
292− ret = ib_post_recv(rdma->sc_qp, recv_chain, &bad_wr);
274+ trace_svcrdma_post_recv(ctxt);
275+ ret = ib_post_recv(rdma->sc_qp, &ctxt->rc_recv_wr, NULL);
293276 if (ret)
294277 goto err_post;
295− return true;
278+ return 0;
296279
297280 err_post:
298− while (bad_wr) {
299− ctxt = container_of(bad_wr, struct svc_rdma_recv_ctxt,
300− rc_recv_wr);
301− bad_wr = bad_wr->next;
302− svc_rdma_recv_ctxt_put(rdma, ctxt);
303− }
304−
305281 trace_svcrdma_rq_post_err(rdma, ret);
306− /* Since we're destroying the xprt, no need to reset
307− * sc_pending_recvs. */
308− return false;
282+ svc_rdma_recv_ctxt_put(rdma, ctxt);
283+ return ret;
284+}
285+
286+static int svc_rdma_post_recv(struct svcxprt_rdma *rdma)
287+{
288+ struct svc_rdma_recv_ctxt *ctxt;
289+
290+ if (test_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags))
291+ return 0;
292+ ctxt = svc_rdma_recv_ctxt_get(rdma);
293+ if (!ctxt)
294+ return -ENOMEM;
295+ return __svc_rdma_post_recv(rdma, ctxt);
309296 }
310297
311298 /**
@@ -316,7 +303,20 @@ err_post: · 4 unmodified lines
316303 */
317304 bool svc_rdma_post_recvs(struct svcxprt_rdma *rdma)
318305 {
319− return svc_rdma_refresh_recvs(rdma, rdma->sc_max_requests, true);
306+ struct svc_rdma_recv_ctxt *ctxt;
307+ unsigned int i;
308+ int ret;
309+
310+ for (i = 0; i < rdma->sc_max_requests; i++) {
311+ ctxt = svc_rdma_recv_ctxt_get(rdma);
312+ if (!ctxt)
313+ return false;
314+ ctxt->rc_temp = true;
315+ ret = __svc_rdma_post_recv(rdma, ctxt);
316+ if (ret)
317+ return false;
318+ }
319+ return true;
320320 }
321321
322322 /**
@@ -324,6 +324,8 @@ bool svc_rdma_post_recvs(struct svcxprt_rdma *rdma) · 1 unmodified line
324324 * @cq: Completion Queue context
325325 * @wc: Work Completion object
326326 *
327+ * NB: The svc_xprt/svcxprt_rdma is pinned whenever it's possible that
328+ * the Receive completion handler could be running.
327329 */
328330 static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc)
329331 {
@@ -331,8 +333,6 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) · 1 unmodified line
331333 struct ib_cqe *cqe = wc->wr_cqe;
332334 struct svc_rdma_recv_ctxt *ctxt;
333335
334− rdma->sc_pending_recvs--;
335−
336336 /* WARNING: Only wc->wr_cqe and wc->status are reliable */
337337 ctxt = container_of(cqe, struct svc_rdma_recv_ctxt, rc_cqe);
338338
@@ -340,6 +340,9 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) · 1 unmodified line
340340 if (wc->status != IB_WC_SUCCESS)
341341 goto flushed;
342342
343+ if (svc_rdma_post_recv(rdma))
344+ goto post_err;
345+
343346 /* All wc fields are now known to be valid */
344347 ctxt->rc_byte_len = wc->byte_len;
345348
@@ -350,18 +353,11 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) · 4 unmodified lines
350353 spin_unlock(&rdma->sc_rq_dto_lock);
351354 if (!test_bit(RDMAXPRT_CONN_PENDING, &rdma->sc_flags))
352355 svc_xprt_enqueue(&rdma->sc_xprt);
353−
354− if (!test_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags) &&
355− rdma->sc_pending_recvs < rdma->sc_max_requests)
356− if (!svc_rdma_refresh_recvs(rdma, RPCRDMA_MAX_RECV_BATCH,
357− false))
358− goto post_err;
359−
360356 return;
361357
362358 flushed:
363− svc_rdma_recv_ctxt_put(rdma, ctxt);
364359 post_err:
360+ svc_rdma_recv_ctxt_put(rdma, ctxt);
365361 set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags);
366362 svc_xprt_enqueue(&rdma->sc_xprt);
367363 }
sound/drivers/aloop.c+0−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
3434 MODULE_DESCRIPTION("A loopback soundcard");
3535 MODULE_LICENSE("GPL");
36−MODULE_SUPPORTED_DEVICE("{{ALSA,Loopback soundcard}}");
3736
3837 #define MAX_PCM_SUBSTREAMS 8
3938
sound/drivers/dummy.c+0−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2626 MODULE_DESCRIPTION("Dummy soundcard (/dev/null)");
2727 MODULE_LICENSE("GPL");
28−MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
2928
3029 #define MAX_PCM_DEVICES 4
3130 #define MAX_PCM_SUBSTREAMS 128
sound/drivers/mtpav.c+0−1
@@ -53,7 +53,6 @@ · 52 unmodified lines
5353 MODULE_AUTHOR("Michael T. Mayers");
5454 MODULE_DESCRIPTION("MOTU MidiTimePiece AV multiport MIDI");
5555 MODULE_LICENSE("GPL");
56−MODULE_SUPPORTED_DEVICE("{{MOTU,MidiTimePiece AV multiport MIDI}}");
5756
5857 // io resources
5958 #define MTPAV_IOBASE 0x378
sound/drivers/mts64.c+0−1
@@ -37,7 +37,6 @@ MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard."); · 36 unmodified lines
3737 MODULE_AUTHOR("Matthias Koenig <mk@phasorlab.de>");
3838 MODULE_DESCRIPTION("ESI Miditerminal 4140");
3939 MODULE_LICENSE("GPL");
40−MODULE_SUPPORTED_DEVICE("{{ESI,Miditerminal 4140}}");
4140
4241 /*********************************************************************
4342 * Chip specific
sound/drivers/pcsp/pcsp.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 MODULE_AUTHOR("Stas Sergeev <stsp@users.sourceforge.net>");
2323 MODULE_DESCRIPTION("PC-Speaker driver");
2424 MODULE_LICENSE("GPL");
25−MODULE_SUPPORTED_DEVICE("{{PC-Speaker, pcsp}}");
2625 MODULE_ALIAS("platform:pcspkr");
2726
2827 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
sound/drivers/portman2x4.c+0−1
@@ -57,7 +57,6 @@ MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard."); · 56 unmodified lines
5757 MODULE_AUTHOR("Levent Guendogdu, Tobias Gehrig, Matthias Koenig");
5858 MODULE_DESCRIPTION("Midiman Portman2x4");
5959 MODULE_LICENSE("GPL");
60−MODULE_SUPPORTED_DEVICE("{{Midiman,Portman2x4}}");
6160
6261 /*********************************************************************
6362 * Chip specific
sound/drivers/serial-u16550.c+0−1
@@ -34,7 +34,6 @@ · 33 unmodified lines
3434
3535 MODULE_DESCRIPTION("MIDI serial u16550");
3636 MODULE_LICENSE("GPL");
37−MODULE_SUPPORTED_DEVICE("{{ALSA, MIDI serial u16550}}");
3837
3938 #define SNDRV_SERIAL_SOUNDCANVAS 0 /* Roland Soundcanvas; F5 NN selects part */
4039 #define SNDRV_SERIAL_MS124T 1 /* Midiator MS-124T */
sound/drivers/virmidi.c+0−1
@@ -43,7 +43,6 @@ · 42 unmodified lines
4343 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
4444 MODULE_DESCRIPTION("Dummy soundcard for virtual rawmidi devices");
4545 MODULE_LICENSE("GPL");
46−MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual rawmidi device}}");
4746
4847 #define MAX_MIDI_DEVICES 4
4948
sound/firewire/dice/dice-stream.c+2−3
@@ -493,11 +493,10 @@ void snd_dice_stream_stop_duplex(struct snd_dice *dice) · 492 unmodified lines
493493 struct reg_params tx_params, rx_params;
494494
495495 if (dice->substreams_counter == 0) {
496− if (get_register_params(dice, &tx_params, &rx_params) >= 0) {
497− amdtp_domain_stop(&dice->domain);
496+ if (get_register_params(dice, &tx_params, &rx_params) >= 0)
498497 finish_session(dice, &tx_params, &rx_params);
499− }
500498
499+ amdtp_domain_stop(&dice->domain);
501500 release_resources(dice);
502501 }
503502 }
sound/isa/ad1816a/ad1816a.c+0−7
@@ -22,13 +22,6 @@ · 21 unmodified lines
2222 MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
2323 MODULE_DESCRIPTION("AD1816A, AD1815");
2424 MODULE_LICENSE("GPL");
25−MODULE_SUPPORTED_DEVICE("{{Highscreen,Sound-Boostar 16 3D},"
26− "{Analog Devices,AD1815},"
27− "{Analog Devices,AD1816A},"
28− "{TerraTec,Base 64},"
29− "{TerraTec,AudioSystem EWS64S},"
30− "{Aztech/Newcom SC-16 3D},"
31− "{Shark Predator ISA}}");
3225
3326 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */
3427 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/ad1848/ad1848.c+0−3
@@ -22,9 +22,6 @@ · 21 unmodified lines
2222 MODULE_DESCRIPTION(CRD_NAME);
2323 MODULE_AUTHOR("Tugrul Galatali <galatalt@stuy.edu>, Jaroslav Kysela <perex@perex.cz>");
2424 MODULE_LICENSE("GPL");
25−MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1848},"
26− "{Analog Devices,AD1847},"
27− "{Crystal Semiconductors,CS4248}}");
2825
2926 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
3027 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/als100.c+0−11
@@ -26,17 +26,6 @@ · 25 unmodified lines
2626 #define PFX "als100: "
2727
2828 MODULE_DESCRIPTION("Avance Logic ALS007/ALS1X0");
29−MODULE_SUPPORTED_DEVICE("{{Diamond Technologies DT-019X},"
30− "{Avance Logic ALS-007}}"
31− "{{Avance Logic,ALS100 - PRO16PNP},"
32− "{Avance Logic,ALS110},"
33− "{Avance Logic,ALS120},"
34− "{Avance Logic,ALS200},"
35− "{3D Melody,MF1000},"
36− "{Digimate,3D Sound},"
37− "{Avance Logic,ALS120},"
38− "{RTL,RTL3000}}");
39−
4029 MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
4130 MODULE_LICENSE("GPL");
4231
sound/isa/azt2320.c+0−5
@@ -35,11 +35,6 @@ · 34 unmodified lines
3535 MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
3636 MODULE_DESCRIPTION("Aztech Systems AZT2320");
3737 MODULE_LICENSE("GPL");
38−MODULE_SUPPORTED_DEVICE("{{Aztech Systems,PRO16V},"
39− "{Aztech Systems,AZT2320},"
40− "{Aztech Systems,AZT3300},"
41− "{Aztech Systems,AZT2320},"
42− "{Aztech Systems,AZT3000}}");
4338
4439 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
4540 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/cmi8330.c+0−1
@@ -51,7 +51,6 @@ · 50 unmodified lines
5151 MODULE_AUTHOR("George Talusan <gstalusan@uwaterloo.ca>");
5252 MODULE_DESCRIPTION("C-Media CMI8330/CMI8329");
5353 MODULE_LICENSE("GPL");
54−MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8330,isapnp:{CMI0001,@@@0001,@X@0001}}}");
5554
5655 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
5756 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/isa/cs423x/cs4231.c+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 MODULE_DESCRIPTION(CRD_NAME);
2424 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2525 MODULE_LICENSE("GPL");
26−MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4231}}");
2726
2827 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
2928 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/cs423x/cs4236.c+0−34
@@ -18,40 +18,6 @@ · 17 unmodified lines
1818 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
1919 MODULE_LICENSE("GPL");
2020 MODULE_DESCRIPTION("Cirrus Logic CS4232-9");
21−MODULE_SUPPORTED_DEVICE("{{Turtle Beach,TBS-2000},"
22− "{Turtle Beach,Tropez Plus},"
23− "{SIC CrystalWave 32},"
24− "{Hewlett Packard,Omnibook 5500},"
25− "{TerraTec,Maestro 32/96},"
26− "{Philips,PCA70PS}},"
27− "{{Crystal Semiconductors,CS4235},"
28− "{Crystal Semiconductors,CS4236},"
29− "{Crystal Semiconductors,CS4237},"
30− "{Crystal Semiconductors,CS4238},"
31− "{Crystal Semiconductors,CS4239},"
32− "{Acer,AW37},"
33− "{Acer,AW35/Pro},"
34− "{Crystal,3D},"
35− "{Crystal Computer,TidalWave128},"
36− "{Dell,Optiplex GX1},"
37− "{Dell,Workstation 400 sound},"
38− "{EliteGroup,P5TX-LA sound},"
39− "{Gallant,SC-70P},"
40− "{Gateway,E1000 Onboard CS4236B},"
41− "{Genius,Sound Maker 3DJ},"
42− "{Hewlett Packard,HP6330 sound},"
43− "{IBM,PC 300PL sound},"
44− "{IBM,Aptiva 2137 E24},"
45− "{IBM,IntelliStation M Pro},"
46− "{Intel,Marlin Spike Mobo CS4235},"
47− "{Intel PR440FX Onboard},"
48− "{Guillemot,MaxiSound 16 PnP},"
49− "{NewClear,3D},"
50− "{TerraTec,AudioSystem EWS64L/XL},"
51− "{Typhoon Soundsystem,CS4236B},"
52− "{Turtle Beach,Malibu},"
53− "{Unknown,Digital PC 5000 Onboard}}");
54−
5521 MODULE_ALIAS("snd_cs4232");
5622
5723 #define IDENT "CS4232+"
sound/isa/es1688/es1688.c+0−5
@@ -26,11 +26,6 @@ · 25 unmodified lines
2626 MODULE_DESCRIPTION(CRD_NAME);
2727 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2828 MODULE_LICENSE("GPL");
29−MODULE_SUPPORTED_DEVICE("{{ESS,ES688 PnP AudioDrive,pnp:ESS0100},"
30− "{ESS,ES1688 PnP AudioDrive,pnp:ESS0102},"
31− "{ESS,ES688 AudioDrive,pnp:ESS6881},"
32− "{ESS,ES1688 AudioDrive,pnp:ESS1681}}");
33−
3429 MODULE_ALIAS("snd_es968");
3530
3631 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
sound/isa/es18xx.c+1−9
@@ -1929,17 +1929,9 @@ static int snd_es18xx_mixer(struct snd_card *card) · 1928 unmodified lines
19291929
19301930 /* Card level */
19311931
1932−MODULE_AUTHOR("Christian Fischbach <fishbach@pool.informatik.rwth-aachen.de>, Abramo Bagnara <abramo@alsa-project.org>");
1932+MODULE_AUTHOR("Christian Fischbach <fishbach@pool.informatik.rwth-aachen.de>, Abramo Bagnara <abramo@alsa-project.org>");
19331933 MODULE_DESCRIPTION("ESS ES18xx AudioDrive");
19341934 MODULE_LICENSE("GPL");
1935−MODULE_SUPPORTED_DEVICE("{{ESS,ES1868 PnP AudioDrive},"
1936− "{ESS,ES1869 PnP AudioDrive},"
1937− "{ESS,ES1878 PnP AudioDrive},"
1938− "{ESS,ES1879 PnP AudioDrive},"
1939− "{ESS,ES1887 PnP AudioDrive},"
1940− "{ESS,ES1888 PnP AudioDrive},"
1941− "{ESS,ES1887 AudioDrive},"
1942− "{ESS,ES1888 AudioDrive}}");
19431935
19441936 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
19451937 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/gus/gusclassic.c+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 MODULE_DESCRIPTION(CRD_NAME);
2424 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2525 MODULE_LICENSE("GPL");
26−MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Classic}}");
2726
2827 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
2928 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/gus/gusextreme.c+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 MODULE_DESCRIPTION(CRD_NAME);
2828 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2929 MODULE_LICENSE("GPL");
30−MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Extreme}}");
3130
3231 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
3332 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/gus/gusmax.c+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2222 MODULE_DESCRIPTION("Gravis UltraSound MAX");
2323 MODULE_LICENSE("GPL");
24−MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound MAX}}");
2524
2625 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
2726 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/gus/interwave.c+0−6
@@ -28,14 +28,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); · 27 unmodified lines
2828 MODULE_LICENSE("GPL");
2929 #ifndef SNDRV_STB
3030 MODULE_DESCRIPTION("AMD InterWave");
31−MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Plug & Play},"
32− "{STB,SoundRage32},"
33− "{MED,MED3210},"
34− "{Dynasonix,Dynasonix Pro},"
35− "{Panasonic,PCA761AW}}");
3631 #else
3732 MODULE_DESCRIPTION("AMD InterWave STB with TEA6330T");
38−MODULE_SUPPORTED_DEVICE("{{AMD,InterWave STB with TEA6330T}}");
3933 #endif
4034
4135 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
sound/isa/opl3sa2.c+0−5
@@ -22,11 +22,6 @@ · 21 unmodified lines
2222 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2323 MODULE_DESCRIPTION("Yamaha OPL3SA2+");
2424 MODULE_LICENSE("GPL");
25−MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF719E-S},"
26− "{Genius,Sound Maker 3DX},"
27− "{Yamaha,OPL3SA3},"
28− "{Intel,AL440LX sound},"
29− "{NeoMagic,MagicWave 3DX}}");
3025
3126 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
3227 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/opti9xx/miro.c+0−3
@@ -33,9 +33,6 @@ · 32 unmodified lines
3333 MODULE_AUTHOR("Martin Langer <martin-langer@gmx.de>");
3434 MODULE_LICENSE("GPL");
3535 MODULE_DESCRIPTION("Miro miroSOUND PCM1 pro, PCM12, PCM20 Radio");
36−MODULE_SUPPORTED_DEVICE("{{Miro,miroSOUND PCM1 pro}, "
37− "{Miro,miroSOUND PCM12}, "
38− "{Miro,miroSOUND PCM20 Radio}}");
3936
4037 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
4138 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/isa/opti9xx/opti92x-ad1848.c+0−6
@@ -36,17 +36,11 @@ MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>"); · 35 unmodified lines
3636 MODULE_LICENSE("GPL");
3737 #ifdef OPTi93X
3838 MODULE_DESCRIPTION("OPTi93X");
39−MODULE_SUPPORTED_DEVICE("{{OPTi,82C931/3}}");
4039 #else /* OPTi93X */
4140 #ifdef CS4231
4241 MODULE_DESCRIPTION("OPTi92X - CS4231");
43−MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (CS4231)},"
44− "{OPTi,82C925 (CS4231)}}");
4542 #else /* CS4231 */
4643 MODULE_DESCRIPTION("OPTi92X - AD1848");
47−MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (AD1848)},"
48− "{OPTi,82C925 (AD1848)},"
49− "{OAK,Mozart}}");
5044 #endif /* CS4231 */
5145 #endif /* OPTi93X */
5246
sound/isa/sb/jazz16.c+0−3
@@ -28,9 +28,6 @@ · 27 unmodified lines
2828 #define PFX "jazz16: "
2929
3030 MODULE_DESCRIPTION("Media Vision Jazz16");
31−MODULE_SUPPORTED_DEVICE("{{Media Vision ??? },"
32− "{RTL,RTL3000}}");
33−
3431 MODULE_AUTHOR("Krzysztof Helt <krzysztof.h1@wp.pl>");
3532 MODULE_LICENSE("GPL");
3633
sound/isa/sb/sb16.c+0−8
@@ -31,16 +31,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); · 30 unmodified lines
3131 MODULE_LICENSE("GPL");
3232 #ifndef SNDRV_SBAWE
3333 MODULE_DESCRIPTION("Sound Blaster 16");
34−MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB 16},"
35− "{Creative Labs,SB Vibra16S},"
36− "{Creative Labs,SB Vibra16C},"
37− "{Creative Labs,SB Vibra16CL},"
38− "{Creative Labs,SB Vibra16X}}");
3934 #else
4035 MODULE_DESCRIPTION("Sound Blaster AWE");
41−MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB AWE 32},"
42− "{Creative Labs,SB AWE 64},"
43− "{Creative Labs,SB AWE 64 Gold}}");
4436 #endif
4537
4638 #if 0
sound/isa/sb/sb8.c+0−1
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
1818 MODULE_DESCRIPTION("Sound Blaster 1.0/2.0/Pro");
1919 MODULE_LICENSE("GPL");
20−MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB 1.0/SB 2.0/SB Pro}}");
2120
2221 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
2322 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/sc6000.c+0−3
@@ -29,9 +29,6 @@ · 28 unmodified lines
2929 MODULE_AUTHOR("Krzysztof Helt");
3030 MODULE_DESCRIPTION("Gallant SC-6000");
3131 MODULE_LICENSE("GPL");
32−MODULE_SUPPORTED_DEVICE("{{Gallant, SC-6000},"
33− "{AudioExcel, Audio Excel DSP 16},"
34− "{Zoltrix, AV302}}");
3532
3633 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
3734 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/wavefront/wavefront.c+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121 MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>");
2222 MODULE_DESCRIPTION("Turtle Beach Wavefront");
2323 MODULE_LICENSE("GPL");
24−MODULE_SUPPORTED_DEVICE("{{Turtle Beach,Maui/Tropez/Tropez+}}");
2524
2625 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
2726 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/mips/sgio2audio.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232 MODULE_AUTHOR("Vivien Chappelier <vivien.chappelier@linux-mips.org>");
3333 MODULE_DESCRIPTION("SGI O2 Audio");
3434 MODULE_LICENSE("GPL");
35−MODULE_SUPPORTED_DEVICE("{{Silicon Graphics, O2 Audio}}");
3635
3736 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
3837 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/ad1889.c+0−1
@@ -43,7 +43,6 @@ · 42 unmodified lines
4343 MODULE_AUTHOR("Kyle McMartin <kyle@parisc-linux.org>, Thibaut Varene <t-bone@parisc-linux.org>");
4444 MODULE_DESCRIPTION("Analog Devices AD1889 ALSA sound driver");
4545 MODULE_LICENSE("GPL");
46−MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1889}}");
4746
4847 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
4948 module_param_array(index, int, NULL, 0444);
sound/pci/ali5451/ali5451.c+0−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929 MODULE_AUTHOR("Matt Wu <Matt_Wu@acersoftech.com.cn>");
3030 MODULE_DESCRIPTION("ALI M5451");
3131 MODULE_LICENSE("GPL");
32−MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}");
3332
3433 static int index = SNDRV_DEFAULT_IDX1; /* Index */
3534 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/als300.c+0−1
@@ -86,7 +86,6 @@ enum {DEVICE_ALS300, DEVICE_ALS300_PLUS}; · 85 unmodified lines
8686 MODULE_AUTHOR("Ash Willis <ashwillis@programmer.net>");
8787 MODULE_DESCRIPTION("Avance Logic ALS300");
8888 MODULE_LICENSE("GPL");
89−MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS300},{Avance Logic,ALS300+}}");
9089
9190 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
9291 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/pci/als4000.c+0−1
@@ -68,7 +68,6 @@ · 67 unmodified lines
6868 MODULE_AUTHOR("Bart Hartgers <bart@etpmod.phys.tue.nl>, Andreas Mohr");
6969 MODULE_DESCRIPTION("Avance Logic ALS4000");
7070 MODULE_LICENSE("GPL");
71−MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS4000}}");
7271
7372 #if IS_REACHABLE(CONFIG_GAMEPORT)
7473 #define SUPPORT_JOYSTICK 1
sound/pci/atiixp.c+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
2424 MODULE_DESCRIPTION("ATI IXP AC97 controller");
2525 MODULE_LICENSE("GPL");
26−MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250/300/400/600}}");
2726
2827 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
2928 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/atiixp_modem.c+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
2424 MODULE_DESCRIPTION("ATI IXP MC97 controller");
2525 MODULE_LICENSE("GPL");
26−MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250}}");
2726
2827 static int index = -2; /* Exclude the first card */
2928 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/au88x0/au88x0.c+0−2
@@ -41,8 +41,6 @@ MODULE_PARM_DESC(pcifix, "Enable VIA-workaround for " CARD_NAME " soundcard."); · 40 unmodified lines
4141
4242 MODULE_DESCRIPTION("Aureal vortex");
4343 MODULE_LICENSE("GPL");
44−MODULE_SUPPORTED_DEVICE("{{Aureal Semiconductor Inc., Aureal Vortex Sound Processor}}");
45−
4644 MODULE_DEVICE_TABLE(pci, snd_vortex_ids);
4745
4846 static void vortex_fix_latency(struct pci_dev *vortex)
sound/pci/azt3328.c+0−1
@@ -196,7 +196,6 @@ · 195 unmodified lines
196196 MODULE_AUTHOR("Andreas Mohr <andi AT lisas.de>");
197197 MODULE_DESCRIPTION("Aztech AZF3328 (PCI168)");
198198 MODULE_LICENSE("GPL");
199−MODULE_SUPPORTED_DEVICE("{{Aztech,AZF3328}}");
200199
201200 #if IS_REACHABLE(CONFIG_GAMEPORT)
202201 #define SUPPORT_GAMEPORT 1
sound/pci/bt87x.c+0−2
@@ -23,8 +23,6 @@ · 22 unmodified lines
2323 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
2424 MODULE_DESCRIPTION("Brooktree Bt87x audio driver");
2525 MODULE_LICENSE("GPL");
26−MODULE_SUPPORTED_DEVICE("{{Brooktree,Bt878},"
27− "{Brooktree,Bt879}}");
2826
2927 static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */
3028 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/ca0106/ca0106_main.c+0−1
@@ -137,7 +137,6 @@ · 136 unmodified lines
137137 MODULE_AUTHOR("James Courtier-Dutton <James@superbug.demon.co.uk>");
138138 MODULE_DESCRIPTION("CA0106");
139139 MODULE_LICENSE("GPL");
140−MODULE_SUPPORTED_DEVICE("{{Creative,SB CA0106 chip}}");
141140
142141 // module parameters (see "Module Parameters")
143142 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
sound/pci/cmipci.c+0−4
@@ -30,10 +30,6 @@ · 29 unmodified lines
3030 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
3131 MODULE_DESCRIPTION("C-Media CMI8x38 PCI");
3232 MODULE_LICENSE("GPL");
33−MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8738},"
34− "{C-Media,CMI8738B},"
35− "{C-Media,CMI8338A},"
36− "{C-Media,CMI8338B}}");
3733
3834 #if IS_REACHABLE(CONFIG_GAMEPORT)
3935 #define SUPPORT_JOYSTICK 1
sound/pci/cs4281.c+0−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2626 MODULE_DESCRIPTION("Cirrus Logic CS4281");
2727 MODULE_LICENSE("GPL");
28−MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,CS4281}}");
2928
3029 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
3130 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/cs46xx/cs46xx.c+0−7
@@ -21,13 +21,6 @@ · 20 unmodified lines
2121 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2222 MODULE_DESCRIPTION("Cirrus Logic Sound Fusion CS46XX");
2323 MODULE_LICENSE("GPL");
24−MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,Sound Fusion (CS4280)},"
25− "{Cirrus Logic,Sound Fusion (CS4610)},"
26− "{Cirrus Logic,Sound Fusion (CS4612)},"
27− "{Cirrus Logic,Sound Fusion (CS4615)},"
28− "{Cirrus Logic,Sound Fusion (CS4622)},"
29− "{Cirrus Logic,Sound Fusion (CS4624)},"
30− "{Cirrus Logic,Sound Fusion (CS4630)}}");
3124
3225 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
3326 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/cs5535audio/cs5535audio.c+0−1
@@ -393,4 +393,3 @@ module_pci_driver(cs5535audio_driver); · 392 unmodified lines
393393 MODULE_AUTHOR("Jaya Kumar");
394394 MODULE_LICENSE("GPL");
395395 MODULE_DESCRIPTION("CS5535 Audio");
396−MODULE_SUPPORTED_DEVICE("CS5535 Audio");
sound/pci/ctxfi/xfi.c+0−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818 MODULE_AUTHOR("Creative Technology Ltd");
1919 MODULE_DESCRIPTION("X-Fi driver version 1.03");
2020 MODULE_LICENSE("GPL v2");
21−MODULE_SUPPORTED_DEVICE("{{Creative Labs, Sound Blaster X-Fi}");
2221
2322 static unsigned int reference_rate = 48000;
2423 static unsigned int multiple = 2;
sound/pci/echoaudio/echoaudio.c+0−1
@@ -10,7 +10,6 @@ · 9 unmodified lines
1010 MODULE_AUTHOR("Giuliano Pochini <pochini@shiny.it>");
1111 MODULE_LICENSE("GPL v2");
1212 MODULE_DESCRIPTION("Echoaudio " ECHOCARD_NAME " soundcards driver");
13−MODULE_SUPPORTED_DEVICE("{{Echoaudio," ECHOCARD_NAME "}}");
1413 MODULE_DEVICE_TABLE(pci, snd_echo_ids);
1514
1615 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
sound/pci/emu10k1/emu10k1.c+0−2
@@ -18,8 +18,6 @@ · 17 unmodified lines
1818 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
1919 MODULE_DESCRIPTION("EMU10K1");
2020 MODULE_LICENSE("GPL");
21−MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB Live!/PCI512/E-mu APS},"
22− "{Creative Labs,SB Audigy}}");
2321
2422 #if IS_ENABLED(CONFIG_SND_SEQUENCER)
2523 #define ENABLE_SYNTH
sound/pci/emu10k1/emu10k1x.c+0−1
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 MODULE_AUTHOR("Francisco Moraes <fmoraes@nc.rr.com>");
3232 MODULE_DESCRIPTION("EMU10K1X");
3333 MODULE_LICENSE("GPL");
34−MODULE_SUPPORTED_DEVICE("{{Dell Creative Labs,SB Live!}");
3534
3635 // module parameters (see "Module Parameters")
3736 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
sound/pci/ens1370.c+0−8
@@ -52,17 +52,9 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Thomas Sailer <sailer@ife.ee.et · 51 unmodified lines
5252 MODULE_LICENSE("GPL");
5353 #ifdef CHIP1370
5454 MODULE_DESCRIPTION("Ensoniq AudioPCI ES1370");
55−MODULE_SUPPORTED_DEVICE("{{Ensoniq,AudioPCI-97 ES1370},"
56− "{Creative Labs,SB PCI64/128 (ES1370)}}");
5755 #endif
5856 #ifdef CHIP1371
5957 MODULE_DESCRIPTION("Ensoniq/Creative AudioPCI ES1371+");
60−MODULE_SUPPORTED_DEVICE("{{Ensoniq,AudioPCI ES1371/73},"
61− "{Ensoniq,AudioPCI ES1373},"
62− "{Creative Labs,Ectiva EV1938},"
63− "{Creative Labs,SB PCI64/128 (ES1371/73)},"
64− "{Creative Labs,Vibra PCI128},"
65− "{Ectiva,EV1938}}");
6658 #endif
6759
6860 #if IS_REACHABLE(CONFIG_GAMEPORT)
sound/pci/es1938.c+0−4
@@ -52,10 +52,6 @@ · 51 unmodified lines
5252 MODULE_AUTHOR("Jaromir Koutek <miri@punknet.cz>");
5353 MODULE_DESCRIPTION("ESS Solo-1");
5454 MODULE_LICENSE("GPL");
55−MODULE_SUPPORTED_DEVICE("{{ESS,ES1938},"
56− "{ESS,ES1946},"
57− "{ESS,ES1969},"
58− "{TerraTec,128i PCI}}");
5955
6056 #if IS_REACHABLE(CONFIG_GAMEPORT)
6157 #define SUPPORT_JOYSTICK 1
sound/pci/es1968.c+0−4
@@ -107,10 +107,6 @@ · 106 unmodified lines
107107
108108 MODULE_DESCRIPTION("ESS Maestro");
109109 MODULE_LICENSE("GPL");
110−MODULE_SUPPORTED_DEVICE("{{ESS,Maestro 2e},"
111− "{ESS,Maestro 2},"
112− "{ESS,Maestro 1},"
113− "{TerraTec,DMX}}");
114110
115111 #if IS_REACHABLE(CONFIG_GAMEPORT)
116112 #define SUPPORT_JOYSTICK 1
sound/pci/fm801.c+0−2
@@ -26,8 +26,6 @@ · 25 unmodified lines
2626 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2727 MODULE_DESCRIPTION("ForteMedia FM801");
2828 MODULE_LICENSE("GPL");
29−MODULE_SUPPORTED_DEVICE("{{ForteMedia,FM801},"
30− "{Genius,SoundMaker Live 5.1}}");
3129
3230 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
3331 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/hda/hda_generic.c+1−1
@@ -4065,7 +4065,7 @@ static int add_micmute_led_hook(struct hda_codec *codec) · 4064 unmodified lines
40654065
40664066 spec->micmute_led.led_mode = MICMUTE_LED_FOLLOW_MUTE;
40674067 spec->micmute_led.capture = 0;
4068− spec->micmute_led.led_value = 0;
4068+ spec->micmute_led.led_value = -1;
40694069 spec->micmute_led.old_hook = spec->cap_sync_hook;
40704070 spec->cap_sync_hook = update_micmute_led;
40714071 if (!snd_hda_gen_add_kctl(spec, NULL, &micmute_led_mode_ctl))
sound/pci/hda/hda_intel.c+0−34
@@ -208,40 +208,6 @@ MODULE_PARM_DESC(snoop, "Enable/disable snooping"); · 207 unmodified lines
208208
209209
210210 MODULE_LICENSE("GPL");
211−MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
212− "{Intel, ICH6M},"
213− "{Intel, ICH7},"
214− "{Intel, ESB2},"
215− "{Intel, ICH8},"
216− "{Intel, ICH9},"
217− "{Intel, ICH10},"
218− "{Intel, PCH},"
219− "{Intel, CPT},"
220− "{Intel, PPT},"
221− "{Intel, LPT},"
222− "{Intel, LPT_LP},"
223− "{Intel, WPT_LP},"
224− "{Intel, SPT},"
225− "{Intel, SPT_LP},"
226− "{Intel, HPT},"
227− "{Intel, PBG},"
228− "{Intel, SCH},"
229− "{ATI, SB450},"
230− "{ATI, SB600},"
231− "{ATI, RS600},"
232− "{ATI, RS690},"
233− "{ATI, RS780},"
234− "{ATI, R600},"
235− "{ATI, RV630},"
236− "{ATI, RV610},"
237− "{ATI, RV670},"
238− "{ATI, RV635},"
239− "{ATI, RV620},"
240− "{ATI, RV770},"
241− "{VIA, VT8251},"
242− "{VIA, VT8237A},"
243− "{SiS, SIS966},"
244− "{ULI, M5461}}");
245211 MODULE_DESCRIPTION("Intel HDA driver");
246212
247213 #if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO)
sound/pci/hda/patch_realtek.c+16−0
@@ -4225,6 +4225,12 @@ static void alc_fixup_hp_gpio_led(struct hda_codec *codec, · 4224 unmodified lines
42254225 }
42264226 }
42274227
4228+static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4229+ const struct hda_fixup *fix, int action)
4230+{
4231+ alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4232+}
4233+
42284234 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
42294235 const struct hda_fixup *fix, int action)
42304236 {
@@ -6381,6 +6387,7 @@ enum { · 2150 unmodified lines
63816387 ALC294_FIXUP_ASUS_GX502_VERBS,
63826388 ALC285_FIXUP_HP_GPIO_LED,
63836389 ALC285_FIXUP_HP_MUTE_LED,
6390+ ALC236_FIXUP_HP_GPIO_LED,
63846391 ALC236_FIXUP_HP_MUTE_LED,
63856392 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
63866393 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
@@ -7616,6 +7623,10 @@ static const struct hda_fixup alc269_fixups[] = { · 1229 unmodified lines
76167623 .type = HDA_FIXUP_FUNC,
76177624 .v.func = alc285_fixup_hp_mute_led,
76187625 },
7626+ [ALC236_FIXUP_HP_GPIO_LED] = {
7627+ .type = HDA_FIXUP_FUNC,
7628+ .v.func = alc236_fixup_hp_gpio_led,
7629+ },
76197630 [ALC236_FIXUP_HP_MUTE_LED] = {
76207631 .type = HDA_FIXUP_FUNC,
76217632 .v.func = alc236_fixup_hp_mute_led,
@@ -8045,9 +8056,12 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 423 unmodified lines
80458056 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
80468057 ALC285_FIXUP_HP_GPIO_AMP_INIT),
80478058 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
8059+ SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
80488060 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
80498061 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
80508062 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8063+ SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8064+ SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
80518065 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
80528066 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
80538067 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
@@ -8242,7 +8256,9 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 188 unmodified lines
82428256 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
82438257 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
82448258 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8259+ SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
82458260 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
8261+ SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
82468262 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
82478263 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
82488264 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
sound/pci/ice1712/ice1712.c+0−6
@@ -60,12 +60,6 @@ · 59 unmodified lines
6060 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
6161 MODULE_DESCRIPTION("ICEnsemble ICE1712 (Envy24)");
6262 MODULE_LICENSE("GPL");
63−MODULE_SUPPORTED_DEVICE("{"
64− HOONTECH_DEVICE_DESC
65− DELTA_DEVICE_DESC
66− EWS_DEVICE_DESC
67− "{ICEnsemble,Generic ICE1712},"
68− "{ICEnsemble,Generic Envy24}}");
6963
7064 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
7165 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/ice1712/ice1724.c+0−19
@@ -44,25 +44,6 @@ · 43 unmodified lines
4444 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
4545 MODULE_DESCRIPTION("VIA ICEnsemble ICE1724/1720 (Envy24HT/PT)");
4646 MODULE_LICENSE("GPL");
47−MODULE_SUPPORTED_DEVICE("{"
48− REVO_DEVICE_DESC
49− AMP_AUDIO2000_DEVICE_DESC
50− AUREON_DEVICE_DESC
51− VT1720_MOBO_DEVICE_DESC
52− PONTIS_DEVICE_DESC
53− PRODIGY192_DEVICE_DESC
54− PRODIGY_HIFI_DEVICE_DESC
55− JULI_DEVICE_DESC
56− MAYA44_DEVICE_DESC
57− PHASE_DEVICE_DESC
58− WTM_DEVICE_DESC
59− SE_DEVICE_DESC
60− QTET_DEVICE_DESC
61− "{VIA,VT1720},"
62− "{VIA,VT1724},"
63− "{ICEnsemble,Generic ICE1724},"
64− "{ICEnsemble,Generic Envy24HT}"
65− "{ICEnsemble,Generic Envy24PT}}");
6647
6748 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
6849 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/intel8x0.c+0−23
@@ -27,29 +27,6 @@ · 26 unmodified lines
2727 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2828 MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7012; Ali 5455");
2929 MODULE_LICENSE("GPL");
30−MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH},"
31− "{Intel,82901AB-ICH0},"
32− "{Intel,82801BA-ICH2},"
33− "{Intel,82801CA-ICH3},"
34− "{Intel,82801DB-ICH4},"
35− "{Intel,ICH5},"
36− "{Intel,ICH6},"
37− "{Intel,ICH7},"
38− "{Intel,6300ESB},"
39− "{Intel,ESB2},"
40− "{Intel,MX440},"
41− "{SiS,SI7012},"
42− "{NVidia,nForce Audio},"
43− "{NVidia,nForce2 Audio},"
44− "{NVidia,nForce3 Audio},"
45− "{NVidia,MCP04},"
46− "{NVidia,MCP501},"
47− "{NVidia,CK804},"
48− "{NVidia,CK8},"
49− "{NVidia,CK8S},"
50− "{AMD,AMD768},"
51− "{AMD,AMD8111},"
52− "{ALI,M5455}}");
5330
5431 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
5532 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/intel8x0m.c+0−15
@@ -25,21 +25,6 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); · 24 unmodified lines
2525 MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; "
2626 "SiS 7013; NVidia MCP/2/2S/3 modems");
2727 MODULE_LICENSE("GPL");
28−MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH},"
29− "{Intel,82901AB-ICH0},"
30− "{Intel,82801BA-ICH2},"
31− "{Intel,82801CA-ICH3},"
32− "{Intel,82801DB-ICH4},"
33− "{Intel,ICH5},"
34− "{Intel,ICH6},"
35− "{Intel,ICH7},"
36− "{Intel,MX440},"
37− "{SiS,7013},"
38− "{NVidia,NForce Modem},"
39− "{NVidia,NForce2 Modem},"
40− "{NVidia,NForce2s Modem},"
41− "{NVidia,NForce3 Modem},"
42− "{AMD,AMD768}}");
4328
4429 static int index = -2; /* Exclude the first card */
4530 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/korg1212/korg1212.c+0−1
@@ -388,7 +388,6 @@ struct snd_korg1212 { · 387 unmodified lines
388388
389389 MODULE_DESCRIPTION("korg1212");
390390 MODULE_LICENSE("GPL");
391−MODULE_SUPPORTED_DEVICE("{{KORG,korg1212}}");
392391 MODULE_FIRMWARE("korg/k1212.dsp");
393392
394393 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
sound/pci/lola/lola.c+0−1
@@ -54,7 +54,6 @@ MODULE_PARM_DESC(sample_rate_min, "Minimal sample rate"); · 53 unmodified lines
5454 */
5555
5656 MODULE_LICENSE("GPL");
57−MODULE_SUPPORTED_DEVICE("{{Digigram, Lola}}");
5857 MODULE_DESCRIPTION("Digigram Lola driver");
5958 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
6059
sound/pci/lx6464es/lx6464es.c+0−2
@@ -21,8 +21,6 @@ · 20 unmodified lines
2121 MODULE_AUTHOR("Tim Blechmann");
2222 MODULE_LICENSE("GPL");
2323 MODULE_DESCRIPTION("digigram lx6464es");
24−MODULE_SUPPORTED_DEVICE("{digigram lx6464es{}}");
25−
2624
2725 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
2826 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/pci/maestro3.c+0−5
@@ -39,11 +39,6 @@ · 38 unmodified lines
3939 MODULE_AUTHOR("Zach Brown <zab@zabbo.net>, Takashi Iwai <tiwai@suse.de>");
4040 MODULE_DESCRIPTION("ESS Maestro3 PCI");
4141 MODULE_LICENSE("GPL");
42−MODULE_SUPPORTED_DEVICE("{{ESS,Maestro3 PCI},"
43− "{ESS,ES1988},"
44− "{ESS,Allegro PCI},"
45− "{ESS,Allegro-1 PCI},"
46− "{ESS,Canyon3D-2/LE PCI}}");
4742 MODULE_FIRMWARE("ess/maestro3_assp_kernel.fw");
4843 MODULE_FIRMWARE("ess/maestro3_assp_minisrc.fw");
4944
sound/pci/mixart/mixart.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232 MODULE_AUTHOR("Digigram <alsa@digigram.com>");
3333 MODULE_DESCRIPTION("Digigram " CARD_NAME);
3434 MODULE_LICENSE("GPL");
35−MODULE_SUPPORTED_DEVICE("{{Digigram," CARD_NAME "}}");
3635
3736 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
3837 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/nm256/nm256.c+0−2
@@ -32,8 +32,6 @@ · 31 unmodified lines
3232 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
3333 MODULE_DESCRIPTION("NeoMagic NM256AV/ZX");
3434 MODULE_LICENSE("GPL");
35−MODULE_SUPPORTED_DEVICE("{{NeoMagic,NM256AV},"
36− "{NeoMagic,NM256ZX}}");
3735
3836 /*
3937 * some compile conditions.
sound/pci/oxygen/oxygen.c+0−3
@@ -56,9 +56,6 @@ · 55 unmodified lines
5656 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
5757 MODULE_DESCRIPTION("C-Media CMI8788 driver");
5858 MODULE_LICENSE("GPL v2");
59−MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8786}"
60− ",{C-Media,CMI8787}"
61− ",{C-Media,CMI8788}}");
6259
6360 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
6461 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/pci/oxygen/se6x.c+0−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
3030 MODULE_DESCRIPTION("Studio Evolution SE6X driver");
3131 MODULE_LICENSE("GPL v2");
32−MODULE_SUPPORTED_DEVICE("{{Studio Evolution,SE6X}}");
3332
3433 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
3534 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/pci/oxygen/virtuoso.c+0−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
1717 MODULE_DESCRIPTION("Asus Virtuoso driver");
1818 MODULE_LICENSE("GPL v2");
19−MODULE_SUPPORTED_DEVICE("{{Asus,AV66},{Asus,AV100},{Asus,AV200}}");
2019
2120 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
2221 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/pci/pcxhr/pcxhr.c+0−1
@@ -35,7 +35,6 @@ MODULE_AUTHOR("Markus Bollinger <bollinger@digigram.com>, " · 34 unmodified lines
3535 "Marc Titinger <titinger@digigram.com>");
3636 MODULE_DESCRIPTION("Digigram " DRIVER_NAME " " PCXHR_DRIVER_VERSION_STRING);
3737 MODULE_LICENSE("GPL");
38−MODULE_SUPPORTED_DEVICE("{{Digigram," DRIVER_NAME "}}");
3938
4039 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
4140 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/riptide/riptide.c+0−1
@@ -103,7 +103,6 @@ · 102 unmodified lines
103103 MODULE_AUTHOR("Peter Gruber <nokos@gmx.net>");
104104 MODULE_DESCRIPTION("riptide");
105105 MODULE_LICENSE("GPL");
106−MODULE_SUPPORTED_DEVICE("{{Conexant,Riptide}}");
107106 MODULE_FIRMWARE("riptide.hex");
108107
109108 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
sound/pci/rme32.c+0−1
@@ -88,7 +88,6 @@ MODULE_PARM_DESC(fullduplex, "Support full-duplex mode."); · 87 unmodified lines
8888 MODULE_AUTHOR("Martin Langer <martin-langer@gmx.de>, Pilo Chambert <pilo.c@wanadoo.fr>");
8989 MODULE_DESCRIPTION("RME Digi32, Digi32/8, Digi32 PRO");
9090 MODULE_LICENSE("GPL");
91−MODULE_SUPPORTED_DEVICE("{{RME,Digi32}," "{RME,Digi32/8}," "{RME,Digi32 PRO}}");
9291
9392 /* Defines for RME Digi32 series */
9493 #define RME32_SPDIF_NCHANNELS 2
sound/pci/rme96.c+0−5
@@ -31,11 +31,6 @@ MODULE_AUTHOR("Anders Torger <torger@ludd.luth.se>"); · 30 unmodified lines
3131 MODULE_DESCRIPTION("RME Digi96, Digi96/8, Digi96/8 PRO, Digi96/8 PST, "
3232 "Digi96/8 PAD");
3333 MODULE_LICENSE("GPL");
34−MODULE_SUPPORTED_DEVICE("{{RME,Digi96},"
35− "{RME,Digi96/8},"
36− "{RME,Digi96/8 PRO},"
37− "{RME,Digi96/8 PST},"
38− "{RME,Digi96/8 PAD}}");
3934
4035 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
4136 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/rme9652/hdsp.c+0−3
@@ -44,9 +44,6 @@ MODULE_PARM_DESC(enable, "Enable/disable specific Hammerfall DSP soundcards."); · 43 unmodified lines
4444 MODULE_AUTHOR("Paul Davis <paul@linuxaudiosystems.com>, Marcus Andersson, Thomas Charbonnel <thomas@undata.org>");
4545 MODULE_DESCRIPTION("RME Hammerfall DSP");
4646 MODULE_LICENSE("GPL");
47−MODULE_SUPPORTED_DEVICE("{{RME Hammerfall-DSP},"
48− "{RME HDSP-9652},"
49− "{RME HDSP-9632}}");
5047 MODULE_FIRMWARE("rpm_firmware.bin");
5148 MODULE_FIRMWARE("multiface_firmware.bin");
5249 MODULE_FIRMWARE("multiface_firmware_rev11.bin");
sound/pci/rme9652/hdspm.c+0−1
@@ -165,7 +165,6 @@ MODULE_AUTHOR · 164 unmodified lines
165165 );
166166 MODULE_DESCRIPTION("RME HDSPM");
167167 MODULE_LICENSE("GPL");
168−MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
169168
170169 /* --- Write registers. ---
171170 These are defined as byte-offsets from the iobase value. */
sound/pci/rme9652/rme9652.c+0−2
@@ -39,8 +39,6 @@ MODULE_PARM_DESC(precise_ptr, "Enable precise pointer (doesn't work reliably).") · 38 unmodified lines
3939 MODULE_AUTHOR("Paul Davis <pbd@op.net>, Winfried Ritsch");
4040 MODULE_DESCRIPTION("RME Digi9652/Digi9636");
4141 MODULE_LICENSE("GPL");
42−MODULE_SUPPORTED_DEVICE("{{RME,Hammerfall},"
43− "{RME,Hammerfall-Light}}");
4442
4543 /* The Hammerfall has two sets of 24 ADAT + 2 S/PDIF channels, one for
4644 capture, one for playback. Both the ADAT and S/PDIF channels appear
sound/pci/sis7019.c+0−1
@@ -24,7 +24,6 @@ · 23 unmodified lines
2424 MODULE_AUTHOR("David Dillow <dave@thedillows.org>");
2525 MODULE_DESCRIPTION("SiS7019");
2626 MODULE_LICENSE("GPL");
27−MODULE_SUPPORTED_DEVICE("{{SiS,SiS7019 Audio Accelerator}}");
2827
2928 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
3029 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/sonicvibes.c+0−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
3030 MODULE_DESCRIPTION("S3 SonicVibes PCI");
3131 MODULE_LICENSE("GPL");
32−MODULE_SUPPORTED_DEVICE("{{S3,SonicVibes PCI}}");
3332
3433 #if IS_REACHABLE(CONFIG_GAMEPORT)
3534 #define SUPPORT_JOYSTICK 1
sound/pci/trident/trident.c+0−12
@@ -17,18 +17,6 @@ · 16 unmodified lines
1717 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, <audio@tridentmicro.com>");
1818 MODULE_DESCRIPTION("Trident 4D-WaveDX/NX & SiS SI7018");
1919 MODULE_LICENSE("GPL");
20−MODULE_SUPPORTED_DEVICE("{{Trident,4DWave DX},"
21− "{Trident,4DWave NX},"
22− "{SiS,SI7018 PCI Audio},"
23− "{Best Union,Miss Melody 4DWave PCI},"
24− "{HIS,4DWave PCI},"
25− "{Warpspeed,ONSpeed 4DWave PCI},"
26− "{Aztech Systems,PCI 64-Q3D},"
27− "{Addonics,SV 750},"
28− "{CHIC,True Sound 4Dwave},"
29− "{Shark,Predator4D-PCI},"
30− "{Jaton,SonicWave 4D},"
31− "{Hoontech,SoundTrack Digital 4DWave NX}}");
3220
3321 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
3422 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/via82xx.c+0−1
@@ -56,7 +56,6 @@ · 55 unmodified lines
5656 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
5757 MODULE_DESCRIPTION("VIA VT82xx audio");
5858 MODULE_LICENSE("GPL");
59−MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C,pci},{VIA,VT8233A/C,8235}}");
6059
6160 #if IS_REACHABLE(CONFIG_GAMEPORT)
6261 #define SUPPORT_JOYSTICK 1
sound/pci/via82xx_modem.c+0−1
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
3939 MODULE_DESCRIPTION("VIA VT82xx modem");
4040 MODULE_LICENSE("GPL");
41−MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C modem,pci}}");
4241
4342 static int index = -2; /* Exclude the first card */
4443 static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/vx222/vx222.c+0−1
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
2121 MODULE_DESCRIPTION("Digigram VX222 V2/Mic");
2222 MODULE_LICENSE("GPL");
23−MODULE_SUPPORTED_DEVICE("{{Digigram," CARD_NAME "}}");
2423
2524 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
2625 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/ymfpci/ymfpci.c+0−6
@@ -17,12 +17,6 @@ · 16 unmodified lines
1717 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
1818 MODULE_DESCRIPTION("Yamaha DS-1 PCI");
1919 MODULE_LICENSE("GPL");
20−MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF724},"
21− "{Yamaha,YMF724F},"
22− "{Yamaha,YMF740},"
23− "{Yamaha,YMF740C},"
24− "{Yamaha,YMF744},"
25− "{Yamaha,YMF754}}");
2620
2721 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
2822 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pcmcia/pdaudiocf/pdaudiocf.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
2323 MODULE_DESCRIPTION("Sound Core " CARD_NAME);
2424 MODULE_LICENSE("GPL");
25−MODULE_SUPPORTED_DEVICE("{{Sound Core," CARD_NAME "}}");
2625
2726 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
2827 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pcmcia/vx/vxpocket.c+0−4
@@ -17,13 +17,9 @@ · 16 unmodified lines
1717 #include <sound/initval.h>
1818 #include <sound/tlv.h>
1919
20−/*
21− */
22−
2320 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
2421 MODULE_DESCRIPTION("Digigram VXPocket");
2522 MODULE_LICENSE("GPL");
26−MODULE_SUPPORTED_DEVICE("{{Digigram,VXPocket},{Digigram,VXPocket440}}");
2723
2824 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
2925 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/ppc/powermac.c+0−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818 #define CHIP_NAME "PMac"
1919
2020 MODULE_DESCRIPTION("PowerMac");
21−MODULE_SUPPORTED_DEVICE("{{Apple,PowerMac}}");
2221 MODULE_LICENSE("GPL");
2322
2423 static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
sound/sh/aica.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232 MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");
3333 MODULE_DESCRIPTION("Dreamcast AICA sound (pcm) driver");
3434 MODULE_LICENSE("GPL");
35−MODULE_SUPPORTED_DEVICE("{{Yamaha/SEGA, AICA}}");
3635 MODULE_FIRMWARE("aica_firmware.bin");
3736
3837 /* module parameters */
sound/sh/sh_dac_audio.c+0−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 MODULE_AUTHOR("Rafael Ignacio Zurita <rizurita@yahoo.com>");
2626 MODULE_DESCRIPTION("SuperH DAC audio driver");
2727 MODULE_LICENSE("GPL");
28−MODULE_SUPPORTED_DEVICE("{{SuperH DAC audio support}}");
2928
3029 /* Module Parameters */
3130 static int index = SNDRV_DEFAULT_IDX1;
sound/soc/codecs/Kconfig+0−5
@@ -186,7 +186,6 @@ config SND_SOC_ALL_CODECS · 185 unmodified lines
186186 imply SND_SOC_SI476X
187187 imply SND_SOC_SIMPLE_AMPLIFIER
188188 imply SND_SOC_SIMPLE_MUX
189− imply SND_SOC_SIRF_AUDIO_CODEC
190189 imply SND_SOC_SPDIF
191190 imply SND_SOC_SSM2305
192191 imply SND_SOC_SSM2518
@@ -1279,10 +1278,6 @@ config SND_SOC_SIMPLE_MUX · 1086 unmodified lines
12791278 tristate "Simple Audio Mux"
12801279 select GPIOLIB
12811280
1282−config SND_SOC_SIRF_AUDIO_CODEC
1283− tristate "SiRF SoC internal audio codec"
1284− select REGMAP_MMIO
1285−
12861281 config SND_SOC_SPDIF
12871282 tristate "S/PDIF CODEC"
12881283
sound/soc/codecs/ak4458.c+1−0
@@ -812,6 +812,7 @@ static const struct of_device_id ak4458_of_match[] = { · 811 unmodified lines
812812 { .compatible = "asahi-kasei,ak4497", .data = &ak4497_drvdata},
813813 { },
814814 };
815+MODULE_DEVICE_TABLE(of, ak4458_of_match);
815816
816817 static struct i2c_driver ak4458_i2c_driver = {
817818 .driver = {
sound/soc/codecs/ak5558.c+1−0
@@ -419,6 +419,7 @@ static const struct of_device_id ak5558_i2c_dt_ids[] __maybe_unused = { · 418 unmodified lines
419419 { .compatible = "asahi-kasei,ak5558"},
420420 { }
421421 };
422+MODULE_DEVICE_TABLE(of, ak5558_i2c_dt_ids);
422423
423424 static struct i2c_driver ak5558_i2c_driver = {
424425 .driver = {
sound/soc/codecs/cs42l42.c+34−78
@@ -401,7 +401,7 @@ static const struct regmap_config cs42l42_regmap = { · 400 unmodified lines
401401 };
402402
403403 static DECLARE_TLV_DB_SCALE(adc_tlv, -9600, 100, false);
404−static DECLARE_TLV_DB_SCALE(mixer_tlv, -6200, 100, false);
404+static DECLARE_TLV_DB_SCALE(mixer_tlv, -6300, 100, true);
405405
406406 static const char * const cs42l42_hpf_freq_text[] = {
407407 "1.86Hz", "120Hz", "235Hz", "466Hz"
@@ -458,7 +458,7 @@ static const struct snd_kcontrol_new cs42l42_snd_controls[] = { · 50 unmodified lines
458458 CS42L42_DAC_HPF_EN_SHIFT, true, false),
459459 SOC_DOUBLE_R_TLV("Mixer Volume", CS42L42_MIXER_CHA_VOL,
460460 CS42L42_MIXER_CHB_VOL, CS42L42_MIXER_CH_VOL_SHIFT,
461− 0x3e, 1, mixer_tlv)
461+ 0x3f, 1, mixer_tlv)
462462 };
463463
464464 static int cs42l42_hpdrv_evt(struct snd_soc_dapm_widget *w,
@@ -511,43 +511,6 @@ static const struct snd_soc_dapm_route cs42l42_audio_map[] = { · 46 unmodified lines
511511 {"HP", NULL, "HPDRV"}
512512 };
513513
514−static int cs42l42_set_bias_level(struct snd_soc_component *component,
515− enum snd_soc_bias_level level)
516−{
517− struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component);
518− int ret;
519−
520− switch (level) {
521− case SND_SOC_BIAS_ON:
522− break;
523− case SND_SOC_BIAS_PREPARE:
524− break;
525− case SND_SOC_BIAS_STANDBY:
526− if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
527− regcache_cache_only(cs42l42->regmap, false);
528− regcache_sync(cs42l42->regmap);
529− ret = regulator_bulk_enable(
530− ARRAY_SIZE(cs42l42->supplies),
531− cs42l42->supplies);
532− if (ret != 0) {
533− dev_err(component->dev,
534− "Failed to enable regulators: %d\n",
535− ret);
536− return ret;
537− }
538− }
539− break;
540− case SND_SOC_BIAS_OFF:
541−
542− regcache_cache_only(cs42l42->regmap, true);
543− regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies),
544− cs42l42->supplies);
545− break;
546− }
547−
548− return 0;
549−}
550−
551514 static int cs42l42_component_probe(struct snd_soc_component *component)
552515 {
553516 struct cs42l42_private *cs42l42 =
@@ -560,7 +523,6 @@ static int cs42l42_component_probe(struct snd_soc_component *component) · 6 unmodified lines
560523
561524 static const struct snd_soc_component_driver soc_component_dev_cs42l42 = {
562525 .probe = cs42l42_component_probe,
563− .set_bias_level = cs42l42_set_bias_level,
564526 .dapm_widgets = cs42l42_dapm_widgets,
565527 .num_dapm_widgets = ARRAY_SIZE(cs42l42_dapm_widgets),
566528 .dapm_routes = cs42l42_audio_map,
@@ -691,24 +653,6 @@ static int cs42l42_pll_config(struct snd_soc_component *component) · 124 unmodified lines
691653 CS42L42_CLK_OASRC_SEL_MASK,
692654 CS42L42_CLK_OASRC_SEL_12 <<
693655 CS42L42_CLK_OASRC_SEL_SHIFT);
694− /* channel 1 on low LRCLK, 32 bit */
695− snd_soc_component_update_bits(component,
696− CS42L42_ASP_RX_DAI0_CH1_AP_RES,
697− CS42L42_ASP_RX_CH_AP_MASK |
698− CS42L42_ASP_RX_CH_RES_MASK,
699− (CS42L42_ASP_RX_CH_AP_LOW <<
700− CS42L42_ASP_RX_CH_AP_SHIFT) |
701− (CS42L42_ASP_RX_CH_RES_32 <<
702− CS42L42_ASP_RX_CH_RES_SHIFT));
703− /* Channel 2 on high LRCLK, 32 bit */
704− snd_soc_component_update_bits(component,
705− CS42L42_ASP_RX_DAI0_CH2_AP_RES,
706− CS42L42_ASP_RX_CH_AP_MASK |
707− CS42L42_ASP_RX_CH_RES_MASK,
708− (CS42L42_ASP_RX_CH_AP_HI <<
709− CS42L42_ASP_RX_CH_AP_SHIFT) |
710− (CS42L42_ASP_RX_CH_RES_32 <<
711− CS42L42_ASP_RX_CH_RES_SHIFT));
712656 if (pll_ratio_table[i].mclk_src_sel == 0) {
713657 /* Pass the clock straight through */
714658 snd_soc_component_update_bits(component,
@@ -797,27 +741,23 @@ static int cs42l42_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) · 82 unmodified lines
797741 /* Bitclock/frame inversion */
798742 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
799743 case SND_SOC_DAIFMT_NB_NF:
744+ asp_cfg_val |= CS42L42_ASP_SCPOL_NOR << CS42L42_ASP_SCPOL_SHIFT;
800745 break;
801746 case SND_SOC_DAIFMT_NB_IF:
802− asp_cfg_val |= CS42L42_ASP_POL_INV <<
803− CS42L42_ASP_LCPOL_IN_SHIFT;
747+ asp_cfg_val |= CS42L42_ASP_SCPOL_NOR << CS42L42_ASP_SCPOL_SHIFT;
748+ asp_cfg_val |= CS42L42_ASP_LCPOL_INV << CS42L42_ASP_LCPOL_SHIFT;
804749 break;
805750 case SND_SOC_DAIFMT_IB_NF:
806− asp_cfg_val |= CS42L42_ASP_POL_INV <<
807− CS42L42_ASP_SCPOL_IN_DAC_SHIFT;
808751 break;
809752 case SND_SOC_DAIFMT_IB_IF:
810− asp_cfg_val |= CS42L42_ASP_POL_INV <<
811− CS42L42_ASP_LCPOL_IN_SHIFT;
812− asp_cfg_val |= CS42L42_ASP_POL_INV <<
813− CS42L42_ASP_SCPOL_IN_DAC_SHIFT;
753+ asp_cfg_val |= CS42L42_ASP_LCPOL_INV << CS42L42_ASP_LCPOL_SHIFT;
814754 break;
815755 }
816756
817− snd_soc_component_update_bits(component, CS42L42_ASP_CLK_CFG,
818− CS42L42_ASP_MODE_MASK |
819− CS42L42_ASP_SCPOL_IN_DAC_MASK |
820− CS42L42_ASP_LCPOL_IN_MASK, asp_cfg_val);
757+ snd_soc_component_update_bits(component, CS42L42_ASP_CLK_CFG, CS42L42_ASP_MODE_MASK |
758+ CS42L42_ASP_SCPOL_MASK |
759+ CS42L42_ASP_LCPOL_MASK,
760+ asp_cfg_val);
821761
822762 return 0;
823763 }
@@ -828,14 +768,29 @@ static int cs42l42_pcm_hw_params(struct snd_pcm_substream *substream, · 4 unmodified lines
828768 {
829769 struct snd_soc_component *component = dai->component;
830770 struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component);
831− int retval;
771+ unsigned int width = (params_width(params) / 8) - 1;
772+ unsigned int val = 0;
832773
833774 cs42l42->srate = params_rate(params);
834− cs42l42->swidth = params_width(params);
835775
836− retval = cs42l42_pll_config(component);
776+ switch(substream->stream) {
777+ case SNDRV_PCM_STREAM_PLAYBACK:
778+ val |= width << CS42L42_ASP_RX_CH_RES_SHIFT;
779+ /* channel 1 on low LRCLK */
780+ snd_soc_component_update_bits(component, CS42L42_ASP_RX_DAI0_CH1_AP_RES,
781+ CS42L42_ASP_RX_CH_AP_MASK |
782+ CS42L42_ASP_RX_CH_RES_MASK, val);
783+ /* Channel 2 on high LRCLK */
784+ val |= CS42L42_ASP_RX_CH_AP_HI << CS42L42_ASP_RX_CH_AP_SHIFT;
785+ snd_soc_component_update_bits(component, CS42L42_ASP_RX_DAI0_CH2_AP_RES,
786+ CS42L42_ASP_RX_CH_AP_MASK |
787+ CS42L42_ASP_RX_CH_RES_MASK, val);
788+ break;
789+ default:
790+ break;
791+ }
837792
838− return retval;
793+ return cs42l42_pll_config(component);
839794 }
840795
841796 static int cs42l42_set_sysclk(struct snd_soc_dai *dai,
@@ -900,9 +855,9 @@ static int cs42l42_mute(struct snd_soc_dai *dai, int mute, int direction) · 58 unmodified lines
900855 return 0;
901856 }
902857
903−#define CS42L42_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE | \
904− SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE | \
905− SNDRV_PCM_FMTBIT_S32_LE)
858+#define CS42L42_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
859+ SNDRV_PCM_FMTBIT_S24_LE |\
860+ SNDRV_PCM_FMTBIT_S32_LE )
906861
907862
908863 static const struct snd_soc_dai_ops cs42l42_ops = {
@@ -1801,7 +1756,7 @@ static int cs42l42_i2c_probe(struct i2c_client *i2c_client, · 892 unmodified lines
18011756 dev_dbg(&i2c_client->dev, "Found reset GPIO\n");
18021757 gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
18031758 }
1804− mdelay(3);
1759+ usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2);
18051760
18061761 /* Request IRQ */
18071762 ret = devm_request_threaded_irq(&i2c_client->dev,
@@ -1926,6 +1881,7 @@ static int cs42l42_runtime_resume(struct device *dev) · 118 unmodified lines
19261881 }
19271882
19281883 gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
1884+ usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2);
19291885
19301886 regcache_cache_only(cs42l42->regmap, false);
19311887 regcache_sync(cs42l42->regmap);
sound/soc/codecs/cs42l42.h+7−6
@@ -258,11 +258,12 @@ · 257 unmodified lines
258258 #define CS42L42_ASP_SLAVE_MODE 0x00
259259 #define CS42L42_ASP_MODE_SHIFT 4
260260 #define CS42L42_ASP_MODE_MASK (1 << CS42L42_ASP_MODE_SHIFT)
261−#define CS42L42_ASP_SCPOL_IN_DAC_SHIFT 2
262−#define CS42L42_ASP_SCPOL_IN_DAC_MASK (1 << CS42L42_ASP_SCPOL_IN_DAC_SHIFT)
263−#define CS42L42_ASP_LCPOL_IN_SHIFT 0
264−#define CS42L42_ASP_LCPOL_IN_MASK (1 << CS42L42_ASP_LCPOL_IN_SHIFT)
265−#define CS42L42_ASP_POL_INV 1
261+#define CS42L42_ASP_SCPOL_SHIFT 2
262+#define CS42L42_ASP_SCPOL_MASK (3 << CS42L42_ASP_SCPOL_SHIFT)
263+#define CS42L42_ASP_SCPOL_NOR 3
264+#define CS42L42_ASP_LCPOL_SHIFT 0
265+#define CS42L42_ASP_LCPOL_MASK (3 << CS42L42_ASP_LCPOL_SHIFT)
266+#define CS42L42_ASP_LCPOL_INV 3
266267
267268 #define CS42L42_ASP_FRM_CFG (CS42L42_PAGE_12 + 0x08)
268269 #define CS42L42_ASP_STP_SHIFT 4
@@ -739,6 +740,7 @@ · 470 unmodified lines
739740 #define CS42L42_FRAC2_VAL(val) (((val) & 0xff0000) >> 16)
740741
741742 #define CS42L42_NUM_SUPPLIES 5
743+#define CS42L42_BOOT_TIME_US 3000
742744
743745 static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] = {
744746 "VA",
@@ -756,7 +758,6 @@ struct cs42l42_private { · 11 unmodified lines
756758 struct completion pdn_done;
757759 u32 sclk;
758760 u32 srate;
759− u32 swidth;
760761 u8 plug_state;
761762 u8 hs_type;
762763 u8 ts_inv;
sound/soc/codecs/es8316.c+2−7
@@ -63,13 +63,8 @@ static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(adc_pga_gain_tlv, · 62 unmodified lines
6363 1, 1, TLV_DB_SCALE_ITEM(0, 0, 0),
6464 2, 2, TLV_DB_SCALE_ITEM(250, 0, 0),
6565 3, 3, TLV_DB_SCALE_ITEM(450, 0, 0),
66− 4, 4, TLV_DB_SCALE_ITEM(700, 0, 0),
67− 5, 5, TLV_DB_SCALE_ITEM(1000, 0, 0),
68− 6, 6, TLV_DB_SCALE_ITEM(1300, 0, 0),
69− 7, 7, TLV_DB_SCALE_ITEM(1600, 0, 0),
70− 8, 8, TLV_DB_SCALE_ITEM(1800, 0, 0),
71− 9, 9, TLV_DB_SCALE_ITEM(2100, 0, 0),
72− 10, 10, TLV_DB_SCALE_ITEM(2400, 0, 0),
66+ 4, 7, TLV_DB_SCALE_ITEM(700, 300, 0),
67+ 8, 10, TLV_DB_SCALE_ITEM(1800, 300, 0),
7368 );
7469
7570 static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(hpout_vol_tlv,
sound/soc/codecs/lpass-rx-macro.c+1−1
@@ -2895,7 +2895,7 @@ static int rx_macro_enable_echo(struct snd_soc_dapm_widget *w, · 2894 unmodified lines
28952895 {
28962896 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
28972897 u16 val, ec_hq_reg;
2898− int ec_tx;
2898+ int ec_tx = -1;
28992899
29002900 val = snd_soc_component_read(component,
29012901 CDC_RX_INP_MUX_RX_MIX_CFG4);
sound/soc/codecs/lpass-va-macro.c+13−15
@@ -189,7 +189,6 @@ struct va_macro { · 188 unmodified lines
189189 struct device *dev;
190190 unsigned long active_ch_mask[VA_MACRO_MAX_DAIS];
191191 unsigned long active_ch_cnt[VA_MACRO_MAX_DAIS];
192− unsigned long active_decimator[VA_MACRO_MAX_DAIS];
193192 u16 dmic_clk_div;
194193
195194 int dec_mode[VA_MACRO_NUM_DECIMATORS];
@@ -549,11 +548,9 @@ static int va_macro_tx_mixer_put(struct snd_kcontrol *kcontrol, · 353 unmodified lines
549548 if (enable) {
550549 set_bit(dec_id, &va->active_ch_mask[dai_id]);
551550 va->active_ch_cnt[dai_id]++;
552− va->active_decimator[dai_id] = dec_id;
553551 } else {
554552 clear_bit(dec_id, &va->active_ch_mask[dai_id]);
555553 va->active_ch_cnt[dai_id]--;
556− va->active_decimator[dai_id] = -1;
557554 }
558555
559556 snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, enable, update);
@@ -880,18 +877,19 @@ static int va_macro_digital_mute(struct snd_soc_dai *dai, int mute, int stream) · 320 unmodified lines
880877 struct va_macro *va = snd_soc_component_get_drvdata(component);
881878 u16 tx_vol_ctl_reg, decimator;
882879
883− decimator = va->active_decimator[dai->id];
884−
885− tx_vol_ctl_reg = CDC_VA_TX0_TX_PATH_CTL +
886− VA_MACRO_TX_PATH_OFFSET * decimator;
887− if (mute)
888− snd_soc_component_update_bits(component, tx_vol_ctl_reg,
889− CDC_VA_TX_PATH_PGA_MUTE_EN_MASK,
890− CDC_VA_TX_PATH_PGA_MUTE_EN);
891− else
892− snd_soc_component_update_bits(component, tx_vol_ctl_reg,
893− CDC_VA_TX_PATH_PGA_MUTE_EN_MASK,
894− CDC_VA_TX_PATH_PGA_MUTE_DISABLE);
880+ for_each_set_bit(decimator, &va->active_ch_mask[dai->id],
881+ VA_MACRO_DEC_MAX) {
882+ tx_vol_ctl_reg = CDC_VA_TX0_TX_PATH_CTL +
883+ VA_MACRO_TX_PATH_OFFSET * decimator;
884+ if (mute)
885+ snd_soc_component_update_bits(component, tx_vol_ctl_reg,
886+ CDC_VA_TX_PATH_PGA_MUTE_EN_MASK,
887+ CDC_VA_TX_PATH_PGA_MUTE_EN);
888+ else
889+ snd_soc_component_update_bits(component, tx_vol_ctl_reg,
890+ CDC_VA_TX_PATH_PGA_MUTE_EN_MASK,
891+ CDC_VA_TX_PATH_PGA_MUTE_DISABLE);
892+ }
895893
896894 return 0;
897895 }
sound/soc/codecs/lpass-wsa-macro.c+11−9
@@ -1211,14 +1211,16 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w, · 1210 unmodified lines
12111211 struct snd_kcontrol *kcontrol, int event)
12121212 {
12131213 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
1214− u16 gain_reg;
1214+ u16 path_reg, gain_reg;
12151215 int val;
12161216
1217− switch (w->reg) {
1218− case CDC_WSA_RX0_RX_PATH_MIX_CTL:
1217+ switch (w->shift) {
1218+ case WSA_MACRO_RX_MIX0:
1219+ path_reg = CDC_WSA_RX0_RX_PATH_MIX_CTL;
12191220 gain_reg = CDC_WSA_RX0_RX_VOL_MIX_CTL;
12201221 break;
1221− case CDC_WSA_RX1_RX_PATH_MIX_CTL:
1222+ case WSA_MACRO_RX_MIX1:
1223+ path_reg = CDC_WSA_RX1_RX_PATH_MIX_CTL;
12221224 gain_reg = CDC_WSA_RX1_RX_VOL_MIX_CTL;
12231225 break;
12241226 default:
@@ -1231,7 +1233,7 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w, · 6 unmodified lines
12311233 snd_soc_component_write(component, gain_reg, val);
12321234 break;
12331235 case SND_SOC_DAPM_POST_PMD:
1234− snd_soc_component_update_bits(component, w->reg,
1236+ snd_soc_component_update_bits(component, path_reg,
12351237 CDC_WSA_RX_PATH_MIX_CLK_EN_MASK,
12361238 CDC_WSA_RX_PATH_MIX_CLK_DISABLE);
12371239 break;
@@ -2068,14 +2070,14 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets[] = { · 830 unmodified lines
20682070 SND_SOC_DAPM_MUX("WSA_RX0 INP0", SND_SOC_NOPM, 0, 0, &rx0_prim_inp0_mux),
20692071 SND_SOC_DAPM_MUX("WSA_RX0 INP1", SND_SOC_NOPM, 0, 0, &rx0_prim_inp1_mux),
20702072 SND_SOC_DAPM_MUX("WSA_RX0 INP2", SND_SOC_NOPM, 0, 0, &rx0_prim_inp2_mux),
2071− SND_SOC_DAPM_MUX_E("WSA_RX0 MIX INP", CDC_WSA_RX0_RX_PATH_MIX_CTL,
2072− 0, 0, &rx0_mix_mux, wsa_macro_enable_mix_path,
2073+ SND_SOC_DAPM_MUX_E("WSA_RX0 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX0,
2074+ 0, &rx0_mix_mux, wsa_macro_enable_mix_path,
20732075 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
20742076 SND_SOC_DAPM_MUX("WSA_RX1 INP0", SND_SOC_NOPM, 0, 0, &rx1_prim_inp0_mux),
20752077 SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux),
20762078 SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux),
2077− SND_SOC_DAPM_MUX_E("WSA_RX1 MIX INP", CDC_WSA_RX1_RX_PATH_MIX_CTL,
2078− 0, 0, &rx1_mix_mux, wsa_macro_enable_mix_path,
2079+ SND_SOC_DAPM_MUX_E("WSA_RX1 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX1,
2080+ 0, &rx1_mix_mux, wsa_macro_enable_mix_path,
20792081 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
20802082
20812083 SND_SOC_DAPM_MIXER_E("WSA_RX INT0 MIX", SND_SOC_NOPM, 0, 0, NULL, 0,
sound/soc/codecs/rt1015.c+2−0
@@ -209,6 +209,7 @@ static bool rt1015_volatile_register(struct device *dev, unsigned int reg) · 208 unmodified lines
209209 case RT1015_VENDOR_ID:
210210 case RT1015_DEVICE_ID:
211211 case RT1015_PRO_ALT:
212+ case RT1015_MAN_I2C:
212213 case RT1015_DAC3:
213214 case RT1015_VBAT_TEST_OUT1:
214215 case RT1015_VBAT_TEST_OUT2:
@@ -513,6 +514,7 @@ static void rt1015_calibrate(struct rt1015_priv *rt1015) · 298 unmodified lines
513514 msleep(300);
514515 regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0008);
515516 regmap_write(regmap, RT1015_SYS_RST1, 0x05F5);
517+ regmap_write(regmap, RT1015_CLK_DET, 0x8000);
516518
517519 regcache_cache_bypass(regmap, false);
518520 regcache_mark_dirty(regmap);
sound/soc/codecs/rt5640.c+2−2
@@ -339,9 +339,9 @@ static bool rt5640_readable_register(struct device *dev, unsigned int reg) · 338 unmodified lines
339339 }
340340
341341 static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
342−static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0);
342+static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0);
343343 static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
344−static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);
344+static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000);
345345 static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
346346
347347 /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
sound/soc/codecs/rt5651.c+2−2
@@ -285,9 +285,9 @@ static bool rt5651_readable_register(struct device *dev, unsigned int reg) · 284 unmodified lines
285285 }
286286
287287 static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
288−static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0);
288+static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0);
289289 static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
290−static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);
290+static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000);
291291 static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
292292
293293 /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
sound/soc/codecs/rt5659.c+5−0
@@ -3426,12 +3426,17 @@ static int rt5659_set_component_sysclk(struct snd_soc_component *component, int · 3425 unmodified lines
34263426 {
34273427 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component);
34283428 unsigned int reg_val = 0;
3429+ int ret;
34293430
34303431 if (freq == rt5659->sysclk && clk_id == rt5659->sysclk_src)
34313432 return 0;
34323433
34333434 switch (clk_id) {
34343435 case RT5659_SCLK_S_MCLK:
3436+ ret = clk_set_rate(rt5659->mclk, freq);
3437+ if (ret)
3438+ return ret;
3439+
34353440 reg_val |= RT5659_SCLK_SRC_MCLK;
34363441 break;
34373442 case RT5659_SCLK_S_PLL1:
sound/soc/codecs/rt5670.c+96−14
@@ -629,21 +629,69 @@ static SOC_ENUM_SINGLE_DECL(rt5670_if2_dac_enum, RT5670_DIG_INF1_DATA, · 628 unmodified lines
629629 static SOC_ENUM_SINGLE_DECL(rt5670_if2_adc_enum, RT5670_DIG_INF1_DATA,
630630 RT5670_IF2_ADC_SEL_SFT, rt5670_data_select);
631631
632+/*
633+ * For reliable output-mute LED control we need a "DAC1 Playback Switch" control.
634+ * We emulate this by only clearing the RT5670_M_DAC1_L/_R AD_DA_MIXER register
635+ * bits when both our emulated DAC1 Playback Switch control and the DAC1 MIXL/R
636+ * DAPM-mixer DAC1 input are enabled.
637+ */
638+static void rt5670_update_ad_da_mixer_dac1_m_bits(struct rt5670_priv *rt5670)
639+{
640+ int val = RT5670_M_DAC1_L | RT5670_M_DAC1_R;
641+
642+ if (rt5670->dac1_mixl_dac1_switch && rt5670->dac1_playback_switch_l)
643+ val &= ~RT5670_M_DAC1_L;
644+
645+ if (rt5670->dac1_mixr_dac1_switch && rt5670->dac1_playback_switch_r)
646+ val &= ~RT5670_M_DAC1_R;
647+
648+ regmap_update_bits(rt5670->regmap, RT5670_AD_DA_MIXER,
649+ RT5670_M_DAC1_L | RT5670_M_DAC1_R, val);
650+}
651+
652+static int rt5670_dac1_playback_switch_get(struct snd_kcontrol *kcontrol,
653+ struct snd_ctl_elem_value *ucontrol)
654+{
655+ struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
656+ struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component);
657+
658+ ucontrol->value.integer.value[0] = rt5670->dac1_playback_switch_l;
659+ ucontrol->value.integer.value[1] = rt5670->dac1_playback_switch_r;
660+
661+ return 0;
662+}
663+
664+static int rt5670_dac1_playback_switch_put(struct snd_kcontrol *kcontrol,
665+ struct snd_ctl_elem_value *ucontrol)
666+{
667+ struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
668+ struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component);
669+
670+ if (rt5670->dac1_playback_switch_l == ucontrol->value.integer.value[0] &&
671+ rt5670->dac1_playback_switch_r == ucontrol->value.integer.value[1])
672+ return 0;
673+
674+ rt5670->dac1_playback_switch_l = ucontrol->value.integer.value[0];
675+ rt5670->dac1_playback_switch_r = ucontrol->value.integer.value[1];
676+
677+ rt5670_update_ad_da_mixer_dac1_m_bits(rt5670);
678+
679+ return 1;
680+}
681+
632682 static const struct snd_kcontrol_new rt5670_snd_controls[] = {
633683 /* Headphone Output Volume */
634− SOC_DOUBLE("HP Playback Switch", RT5670_HP_VOL,
635− RT5670_L_MUTE_SFT, RT5670_R_MUTE_SFT, 1, 1),
636684 SOC_DOUBLE_TLV("HP Playback Volume", RT5670_HP_VOL,
637685 RT5670_L_VOL_SFT, RT5670_R_VOL_SFT,
638686 39, 1, out_vol_tlv),
639687 /* OUTPUT Control */
640− SOC_DOUBLE("OUT Channel Switch", RT5670_LOUT1,
641− RT5670_VOL_L_SFT, RT5670_VOL_R_SFT, 1, 1),
642688 SOC_DOUBLE_TLV("OUT Playback Volume", RT5670_LOUT1,
643689 RT5670_L_VOL_SFT, RT5670_R_VOL_SFT, 39, 1, out_vol_tlv),
644690 /* DAC Digital Volume */
645691 SOC_DOUBLE("DAC2 Playback Switch", RT5670_DAC_CTRL,
646692 RT5670_M_DAC_L2_VOL_SFT, RT5670_M_DAC_R2_VOL_SFT, 1, 1),
693+ SOC_DOUBLE_EXT("DAC1 Playback Switch", SND_SOC_NOPM, 0, 1, 1, 0,
694+ rt5670_dac1_playback_switch_get, rt5670_dac1_playback_switch_put),
647695 SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5670_DAC1_DIG_VOL,
648696 RT5670_L_VOL_SFT, RT5670_R_VOL_SFT,
649697 175, 0, dac_vol_tlv),
@@ -913,18 +961,44 @@ static const struct snd_kcontrol_new rt5670_mono_adc_r_mix[] = { · 263 unmodified lines
913961 RT5670_M_MONO_ADC_R2_SFT, 1, 1),
914962 };
915963
964+/* See comment above rt5670_update_ad_da_mixer_dac1_m_bits() */
965+static int rt5670_put_dac1_mix_dac1_switch(struct snd_kcontrol *kcontrol,
966+ struct snd_ctl_elem_value *ucontrol)
967+{
968+ struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value;
969+ struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol);
970+ struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component);
971+ int ret;
972+
973+ if (mc->shift == 0)
974+ rt5670->dac1_mixl_dac1_switch = ucontrol->value.integer.value[0];
975+ else
976+ rt5670->dac1_mixr_dac1_switch = ucontrol->value.integer.value[0];
977+
978+ /* Apply the update (if any) */
979+ ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol);
980+ if (ret == 0)
981+ return 0;
982+
983+ rt5670_update_ad_da_mixer_dac1_m_bits(rt5670);
984+
985+ return 1;
986+}
987+
988+#define SOC_DAPM_SINGLE_RT5670_DAC1_SW(name, shift) \
989+ SOC_SINGLE_EXT(name, SND_SOC_NOPM, shift, 1, 0, \
990+ snd_soc_dapm_get_volsw, rt5670_put_dac1_mix_dac1_switch)
991+
916992 static const struct snd_kcontrol_new rt5670_dac_l_mix[] = {
917993 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5670_AD_DA_MIXER,
918994 RT5670_M_ADCMIX_L_SFT, 1, 1),
919− SOC_DAPM_SINGLE("DAC1 Switch", RT5670_AD_DA_MIXER,
920− RT5670_M_DAC1_L_SFT, 1, 1),
995+ SOC_DAPM_SINGLE_RT5670_DAC1_SW("DAC1 Switch", 0),
921996 };
922997
923998 static const struct snd_kcontrol_new rt5670_dac_r_mix[] = {
924999 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5670_AD_DA_MIXER,
9251000 RT5670_M_ADCMIX_R_SFT, 1, 1),
926− SOC_DAPM_SINGLE("DAC1 Switch", RT5670_AD_DA_MIXER,
927− RT5670_M_DAC1_R_SFT, 1, 1),
1001+ SOC_DAPM_SINGLE_RT5670_DAC1_SW("DAC1 Switch", 1),
9281002 };
9291003
9301004 static const struct snd_kcontrol_new rt5670_sto_dac_l_mix[] = {
@@ -1656,12 +1730,10 @@ static const struct snd_soc_dapm_widget rt5670_dapm_widgets[] = { · 725 unmodified lines
16561730 RT5670_PWR_ADC_S1F_BIT, 0, NULL, 0),
16571731 SND_SOC_DAPM_SUPPLY("ADC Stereo2 Filter", RT5670_PWR_DIG2,
16581732 RT5670_PWR_ADC_S2F_BIT, 0, NULL, 0),
1659− SND_SOC_DAPM_MIXER("Sto1 ADC MIXL", RT5670_STO1_ADC_DIG_VOL,
1660− RT5670_L_MUTE_SFT, 1, rt5670_sto1_adc_l_mix,
1661− ARRAY_SIZE(rt5670_sto1_adc_l_mix)),
1662− SND_SOC_DAPM_MIXER("Sto1 ADC MIXR", RT5670_STO1_ADC_DIG_VOL,
1663− RT5670_R_MUTE_SFT, 1, rt5670_sto1_adc_r_mix,
1664− ARRAY_SIZE(rt5670_sto1_adc_r_mix)),
1733+ SND_SOC_DAPM_MIXER("Sto1 ADC MIXL", SND_SOC_NOPM, 0, 0,
1734+ rt5670_sto1_adc_l_mix, ARRAY_SIZE(rt5670_sto1_adc_l_mix)),
1735+ SND_SOC_DAPM_MIXER("Sto1 ADC MIXR", SND_SOC_NOPM, 0, 0,
1736+ rt5670_sto1_adc_r_mix, ARRAY_SIZE(rt5670_sto1_adc_r_mix)),
16651737 SND_SOC_DAPM_MIXER("Sto2 ADC MIXL", SND_SOC_NOPM, 0, 0,
16661738 rt5670_sto2_adc_l_mix,
16671739 ARRAY_SIZE(rt5670_sto2_adc_l_mix)),
@@ -2999,6 +3071,16 @@ static int rt5670_i2c_probe(struct i2c_client *i2c, · 1331 unmodified lines
29993071 dev_info(&i2c->dev, "quirk JD mode 3\n");
30003072 }
30013073
3074+ /*
3075+ * Enable the emulated "DAC1 Playback Switch" by default to avoid
3076+ * muting the output with older UCM profiles.
3077+ */
3078+ rt5670->dac1_playback_switch_l = true;
3079+ rt5670->dac1_playback_switch_r = true;
3080+ /* The Power-On-Reset values for the DAC1 mixer have the DAC1 input enabled. */
3081+ rt5670->dac1_mixl_dac1_switch = true;
3082+ rt5670->dac1_mixr_dac1_switch = true;
3083+
30023084 rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap);
30033085 if (IS_ERR(rt5670->regmap)) {
30043086 ret = PTR_ERR(rt5670->regmap);
sound/soc/codecs/rt5670.h+5−4
@@ -212,12 +212,8 @@ · 211 unmodified lines
212212 /* global definition */
213213 #define RT5670_L_MUTE (0x1 << 15)
214214 #define RT5670_L_MUTE_SFT 15
215−#define RT5670_VOL_L_MUTE (0x1 << 14)
216−#define RT5670_VOL_L_SFT 14
217215 #define RT5670_R_MUTE (0x1 << 7)
218216 #define RT5670_R_MUTE_SFT 7
219−#define RT5670_VOL_R_MUTE (0x1 << 6)
220−#define RT5670_VOL_R_SFT 6
221217 #define RT5670_L_VOL_MASK (0x3f << 8)
222218 #define RT5670_L_VOL_SFT 8
223219 #define RT5670_R_VOL_MASK (0x3f)
@@ -2017,6 +2013,11 @@ struct rt5670_priv { · 1793 unmodified lines
20172013 int dsp_rate;
20182014 int jack_type;
20192015 int jack_type_saved;
2016+
2017+ bool dac1_mixl_dac1_switch;
2018+ bool dac1_mixr_dac1_switch;
2019+ bool dac1_playback_switch_l;
2020+ bool dac1_playback_switch_r;
20202021 };
20212022
20222023 void rt5670_jack_suspend(struct snd_soc_component *component);
sound/soc/codecs/rt711.c+8−0
@@ -895,6 +895,13 @@ static int rt711_probe(struct snd_soc_component *component) · 894 unmodified lines
895895 return 0;
896896 }
897897
898+static void rt711_remove(struct snd_soc_component *component)
899+{
900+ struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component);
901+
902+ regcache_cache_only(rt711->regmap, true);
903+}
904+
898905 static const struct snd_soc_component_driver soc_codec_dev_rt711 = {
899906 .probe = rt711_probe,
900907 .set_bias_level = rt711_set_bias_level,
@@ -905,6 +912,7 @@ static const struct snd_soc_component_driver soc_codec_dev_rt711 = { · 4 unmodified lines
905912 .dapm_routes = rt711_audio_map,
906913 .num_dapm_routes = ARRAY_SIZE(rt711_audio_map),
907914 .set_jack = rt711_set_jack_detect,
915+ .remove = rt711_remove,
908916 };
909917
910918 static int rt711_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
sound/soc/codecs/sgtl5000.c+1−1
@@ -71,7 +71,7 @@ static const struct reg_default sgtl5000_reg_defaults[] = { · 70 unmodified lines
7171 { SGTL5000_DAP_EQ_BASS_BAND4, 0x002f },
7272 { SGTL5000_DAP_MAIN_CHAN, 0x8000 },
7373 { SGTL5000_DAP_MIX_CHAN, 0x0000 },
74− { SGTL5000_DAP_AVC_CTRL, 0x0510 },
74+ { SGTL5000_DAP_AVC_CTRL, 0x5100 },
7575 { SGTL5000_DAP_AVC_THRESHOLD, 0x1473 },
7676 { SGTL5000_DAP_AVC_ATTACK, 0x0028 },
7777 { SGTL5000_DAP_AVC_DECAY, 0x0050 },
sound/soc/codecs/sirf-audio-codec.h+0−124
@@ -1,124 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-or-later */
2−/*
3− * SiRF inner codec controllers define
4− *
5− * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
6− */
7−
8−#ifndef _SIRF_AUDIO_CODEC_H
9−#define _SIRF_AUDIO_CODEC_H
10−
11−
12−#define AUDIO_IC_CODEC_PWR (0x00E0)
13−#define AUDIO_IC_CODEC_CTRL0 (0x00E4)
14−#define AUDIO_IC_CODEC_CTRL1 (0x00E8)
15−#define AUDIO_IC_CODEC_CTRL2 (0x00EC)
16−#define AUDIO_IC_CODEC_CTRL3 (0x00F0)
17−
18−#define MICBIASEN (1 << 3)
19−
20−#define IC_RDACEN (1 << 0)
21−#define IC_LDACEN (1 << 1)
22−#define IC_HSREN (1 << 2)
23−#define IC_HSLEN (1 << 3)
24−#define IC_SPEN (1 << 4)
25−#define IC_CPEN (1 << 5)
26−
27−#define IC_HPRSELR (1 << 6)
28−#define IC_HPLSELR (1 << 7)
29−#define IC_HPRSELL (1 << 8)
30−#define IC_HPLSELL (1 << 9)
31−#define IC_SPSELR (1 << 10)
32−#define IC_SPSELL (1 << 11)
33−
34−#define IC_MONOR (1 << 12)
35−#define IC_MONOL (1 << 13)
36−
37−#define IC_RXOSRSEL (1 << 28)
38−#define IC_CPFREQ (1 << 29)
39−#define IC_HSINVEN (1 << 30)
40−
41−#define IC_MICINREN (1 << 0)
42−#define IC_MICINLEN (1 << 1)
43−#define IC_MICIN1SEL (1 << 2)
44−#define IC_MICIN2SEL (1 << 3)
45−#define IC_MICDIFSEL (1 << 4)
46−#define IC_LINEIN1SEL (1 << 5)
47−#define IC_LINEIN2SEL (1 << 6)
48−#define IC_RADCEN (1 << 7)
49−#define IC_LADCEN (1 << 8)
50−#define IC_ALM (1 << 9)
51−
52−#define IC_DIGMICEN (1 << 22)
53−#define IC_DIGMICFREQ (1 << 23)
54−#define IC_ADC14B_12 (1 << 24)
55−#define IC_FIRDAC_HSL_EN (1 << 25)
56−#define IC_FIRDAC_HSR_EN (1 << 26)
57−#define IC_FIRDAC_LOUT_EN (1 << 27)
58−#define IC_POR (1 << 28)
59−#define IC_CODEC_CLK_EN (1 << 29)
60−#define IC_HP_3DB_BOOST (1 << 30)
61−
62−#define IC_ADC_LEFT_GAIN_SHIFT 16
63−#define IC_ADC_RIGHT_GAIN_SHIFT 10
64−#define IC_ADC_GAIN_MASK 0x3F
65−#define IC_MIC_MAX_GAIN 0x39
66−
67−#define IC_RXPGAR_MASK 0x3F
68−#define IC_RXPGAR_SHIFT 14
69−#define IC_RXPGAL_MASK 0x3F
70−#define IC_RXPGAL_SHIFT 21
71−#define IC_RXPGAR 0x7B
72−#define IC_RXPGAL 0x7B
73−
74−#define AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK 0x3F
75−#define AUDIO_PORT_TX_FIFO_SC_OFFSET 0
76−#define AUDIO_PORT_TX_FIFO_LC_OFFSET 10
77−#define AUDIO_PORT_TX_FIFO_HC_OFFSET 20
78−
79−#define TX_FIFO_SC(x) (((x) & AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK) \
80− << AUDIO_PORT_TX_FIFO_SC_OFFSET)
81−#define TX_FIFO_LC(x) (((x) & AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK) \
82− << AUDIO_PORT_TX_FIFO_LC_OFFSET)
83−#define TX_FIFO_HC(x) (((x) & AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK) \
84− << AUDIO_PORT_TX_FIFO_HC_OFFSET)
85−
86−#define AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK 0x0F
87−#define AUDIO_PORT_RX_FIFO_SC_OFFSET 0
88−#define AUDIO_PORT_RX_FIFO_LC_OFFSET 10
89−#define AUDIO_PORT_RX_FIFO_HC_OFFSET 20
90−
91−#define RX_FIFO_SC(x) (((x) & AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK) \
92− << AUDIO_PORT_RX_FIFO_SC_OFFSET)
93−#define RX_FIFO_LC(x) (((x) & AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK) \
94− << AUDIO_PORT_RX_FIFO_LC_OFFSET)
95−#define RX_FIFO_HC(x) (((x) & AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK) \
96− << AUDIO_PORT_RX_FIFO_HC_OFFSET)
97−#define AUDIO_PORT_IC_CODEC_TX_CTRL (0x00F4)
98−#define AUDIO_PORT_IC_CODEC_RX_CTRL (0x00F8)
99−
100−#define AUDIO_PORT_IC_TXFIFO_OP (0x00FC)
101−#define AUDIO_PORT_IC_TXFIFO_LEV_CHK (0x0100)
102−#define AUDIO_PORT_IC_TXFIFO_STS (0x0104)
103−#define AUDIO_PORT_IC_TXFIFO_INT (0x0108)
104−#define AUDIO_PORT_IC_TXFIFO_INT_MSK (0x010C)
105−
106−#define AUDIO_PORT_IC_RXFIFO_OP (0x0110)
107−#define AUDIO_PORT_IC_RXFIFO_LEV_CHK (0x0114)
108−#define AUDIO_PORT_IC_RXFIFO_STS (0x0118)
109−#define AUDIO_PORT_IC_RXFIFO_INT (0x011C)
110−#define AUDIO_PORT_IC_RXFIFO_INT_MSK (0x0120)
111−
112−#define AUDIO_FIFO_START (1 << 0)
113−#define AUDIO_FIFO_RESET (1 << 1)
114−
115−#define AUDIO_FIFO_FULL (1 << 0)
116−#define AUDIO_FIFO_EMPTY (1 << 1)
117−#define AUDIO_FIFO_OFLOW (1 << 2)
118−#define AUDIO_FIFO_UFLOW (1 << 3)
119−
120−#define IC_TX_ENABLE (0x03)
121−#define IC_RX_ENABLE_MONO (0x01)
122−#define IC_RX_ENABLE_STEREO (0x03)
123−
124−#endif /*__SIRF_AUDIO_CODEC_H*/
sound/soc/codecs/wcd934x.c+6−0
@@ -1873,6 +1873,12 @@ static int wcd934x_set_channel_map(struct snd_soc_dai *dai, · 1872 unmodified lines
18731873
18741874 wcd = snd_soc_component_get_drvdata(dai->component);
18751875
1876+ if (tx_num > WCD934X_TX_MAX || rx_num > WCD934X_RX_MAX) {
1877+ dev_err(wcd->dev, "Invalid tx %d or rx %d channel count\n",
1878+ tx_num, rx_num);
1879+ return -EINVAL;
1880+ }
1881+
18761882 if (!tx_slot || !rx_slot) {
18771883 dev_err(wcd->dev, "Invalid tx_slot=%p, rx_slot=%p\n",
18781884 tx_slot, rx_slot);
sound/soc/fsl/fsl_ssi.c+4−2
@@ -878,6 +878,7 @@ static int fsl_ssi_hw_free(struct snd_pcm_substream *substream, · 877 unmodified lines
878878 static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt)
879879 {
880880 u32 strcr = 0, scr = 0, stcr, srcr, mask;
881+ unsigned int slots;
881882
882883 ssi->dai_fmt = fmt;
883884
@@ -909,10 +910,11 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt) · 25 unmodified lines
909910 return -EINVAL;
910911 }
911912
913+ slots = ssi->slots ? : 2;
912914 regmap_update_bits(ssi->regs, REG_SSI_STCCR,
913− SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(2));
915+ SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots));
914916 regmap_update_bits(ssi->regs, REG_SSI_SRCCR,
915− SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(2));
917+ SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots));
916918
917919 /* Data on rising edge of bclk, frame low, 1clk before data */
918920 strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP | SSI_STCR_TEFS;
sound/soc/generic/simple-card-utils.c+7−6
@@ -172,15 +172,16 @@ int asoc_simple_parse_clk(struct device *dev, · 171 unmodified lines
172172 * or device's module clock.
173173 */
174174 clk = devm_get_clk_from_child(dev, node, NULL);
175− if (IS_ERR(clk))
176− clk = devm_get_clk_from_child(dev, dlc->of_node, NULL);
177−
178175 if (!IS_ERR(clk)) {
179− simple_dai->clk = clk;
180176 simple_dai->sysclk = clk_get_rate(clk);
181− } else if (!of_property_read_u32(node, "system-clock-frequency",
182− &val)) {
177+
178+ simple_dai->clk = clk;
179+ } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
183180 simple_dai->sysclk = val;
181+ } else {
182+ clk = devm_get_clk_from_child(dev, dlc->of_node, NULL);
183+ if (!IS_ERR(clk))
184+ simple_dai->sysclk = clk_get_rate(clk);
184185 }
185186
186187 if (of_property_read_bool(node, "system-clock-direction-out"))
sound/soc/intel/boards/bytcr_rt5640.c+1−1
@@ -581,7 +581,7 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { · 580 unmodified lines
581581 },
582582 .driver_data = (void *)(BYT_RT5640_DMIC1_MAP |
583583 BYT_RT5640_JD_SRC_JD1_IN4P |
584− BYT_RT5640_OVCD_TH_1500UA |
584+ BYT_RT5640_OVCD_TH_2000UA |
585585 BYT_RT5640_OVCD_SF_0P75 |
586586 BYT_RT5640_MCLK_EN),
587587 },
sound/soc/mediatek/mt8192/mt8192-dai-tdm.c+3−1
@@ -555,7 +555,9 @@ static int mtk_dai_tdm_hw_params(struct snd_pcm_substream *substream, · 554 unmodified lines
555555
556556 /* set tdm */
557557 if (tdm_priv->bck_invert)
558− tdm_con |= 1 << BCK_INVERSE_SFT;
558+ regmap_update_bits(afe->regmap, AUDIO_TOP_CON3,
559+ BCK_INVERSE_MASK_SFT,
560+ 0x1 << BCK_INVERSE_SFT);
559561
560562 if (tdm_priv->lck_invert)
561563 tdm_con |= 1 << LRCK_INVERSE_SFT;
sound/soc/mediatek/mt8192/mt8192-reg.h+5−3
@@ -21,6 +21,11 @@ enum { · 20 unmodified lines
2121 /*****************************************************************************
2222 * R E G I S T E R D E F I N I T I O N
2323 *****************************************************************************/
24+/* AUDIO_TOP_CON3 */
25+#define BCK_INVERSE_SFT 3
26+#define BCK_INVERSE_MASK 0x1
27+#define BCK_INVERSE_MASK_SFT (0x1 << 3)
28+
2429 /* AFE_DAC_CON0 */
2530 #define VUL12_ON_SFT 31
2631 #define VUL12_ON_MASK 0x1
@@ -2079,9 +2084,6 @@ enum { · 2052 unmodified lines
20792084 #define TDM_EN_SFT 0
20802085 #define TDM_EN_MASK 0x1
20812086 #define TDM_EN_MASK_SFT (0x1 << 0)
2082−#define BCK_INVERSE_SFT 1
2083−#define BCK_INVERSE_MASK 0x1
2084−#define BCK_INVERSE_MASK_SFT (0x1 << 1)
20852087 #define LRCK_INVERSE_SFT 2
20862088 #define LRCK_INVERSE_MASK 0x1
20872089 #define LRCK_INVERSE_MASK_SFT (0x1 << 2)
sound/soc/qcom/lpass-cpu.c+1−1
@@ -739,7 +739,7 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev, · 738 unmodified lines
739739
740740 for_each_child_of_node(dev->of_node, node) {
741741 ret = of_property_read_u32(node, "reg", &id);
742− if (ret || id < 0 || id >= data->variant->num_dai) {
742+ if (ret || id < 0) {
743743 dev_err(dev, "valid dai id not found: %d\n", ret);
744744 continue;
745745 }
sound/soc/qcom/sdm845.c+3−3
@@ -27,18 +27,18 @@ · 26 unmodified lines
2727 #define SPK_TDM_RX_MASK 0x03
2828 #define NUM_TDM_SLOTS 8
2929 #define SLIM_MAX_TX_PORTS 16
30−#define SLIM_MAX_RX_PORTS 16
30+#define SLIM_MAX_RX_PORTS 13
3131 #define WCD934X_DEFAULT_MCLK_RATE 9600000
3232
3333 struct sdm845_snd_data {
3434 struct snd_soc_jack jack;
3535 bool jack_setup;
36− bool stream_prepared[SLIM_MAX_RX_PORTS];
36+ bool stream_prepared[AFE_PORT_MAX];
3737 struct snd_soc_card *card;
3838 uint32_t pri_mi2s_clk_count;
3939 uint32_t sec_mi2s_clk_count;
4040 uint32_t quat_tdm_clk_count;
41− struct sdw_stream_runtime *sruntime[SLIM_MAX_RX_PORTS];
41+ struct sdw_stream_runtime *sruntime[AFE_PORT_MAX];
4242 };
4343
4444 static unsigned int tdm_slot_offset[8] = {0, 4, 8, 12, 16, 20, 24, 28};
sound/soc/soc-core.c+4−0
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 #include <linux/of.h>
3232 #include <linux/of_graph.h>
3333 #include <linux/dmi.h>
34+#include <linux/acpi.h>
3435 #include <sound/core.h>
3536 #include <sound/pcm.h>
3637 #include <sound/pcm_params.h>
@@ -1573,6 +1574,9 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) · 1536 unmodified lines
15731574 if (card->long_name)
15741575 return 0; /* long name already set by driver or from DMI */
15751576
1577+ if (!is_acpi_device_node(card->dev->fwnode))
1578+ return 0;
1579+
15761580 /* make up dmi long name as: vendor-product-version-board */
15771581 vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
15781582 if (!vendor || !is_dmi_valid(vendor)) {
sound/soc/sof/intel/hda-dsp.c+1−1
@@ -207,7 +207,7 @@ int hda_dsp_core_power_down(struct snd_sof_dev *sdev, unsigned int core_mask) · 206 unmodified lines
207207
208208 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR,
209209 HDA_DSP_REG_ADSPCS, adspcs,
210− !(adspcs & HDA_DSP_ADSPCS_SPA_MASK(core_mask)),
210+ !(adspcs & HDA_DSP_ADSPCS_CPA_MASK(core_mask)),
211211 HDA_DSP_REG_POLL_INTERVAL_US,
212212 HDA_DSP_PD_TIMEOUT * USEC_PER_MSEC);
213213 if (ret < 0)
sound/soc/sof/intel/hda.c+1−0
@@ -897,6 +897,7 @@ free_streams: · 896 unmodified lines
897897 /* dsp_unmap: not currently used */
898898 iounmap(sdev->bar[HDA_DSP_BAR]);
899899 hdac_bus_unmap:
900+ platform_device_unregister(hdev->dmic_dev);
900901 iounmap(bus->remap_addr);
901902 hda_codec_i915_exit(sdev);
902903 err:
sound/sparc/amd7930.c+0−1
@@ -62,7 +62,6 @@ MODULE_PARM_DESC(enable, "Enable Sun AMD7930 soundcard."); · 61 unmodified lines
6262 MODULE_AUTHOR("Thomas K. Dyas and David S. Miller");
6363 MODULE_DESCRIPTION("Sun AMD7930");
6464 MODULE_LICENSE("GPL");
65−MODULE_SUPPORTED_DEVICE("{{Sun,AMD7930}}");
6665
6766 /* Device register layout. */
6867
sound/sparc/cs4231.c+0−1
@@ -52,7 +52,6 @@ MODULE_PARM_DESC(enable, "Enable Sun CS4231 soundcard."); · 51 unmodified lines
5252 MODULE_AUTHOR("Jaroslav Kysela, Derrick J. Brashear and David S. Miller");
5353 MODULE_DESCRIPTION("Sun CS4231");
5454 MODULE_LICENSE("GPL");
55−MODULE_SUPPORTED_DEVICE("{{Sun,CS4231}}");
5655
5756 #ifdef SBUS_SUPPORT
5857 struct sbus_dma_info {
sound/sparc/dbri.c+0−1
@@ -76,7 +76,6 @@ · 75 unmodified lines
7676 MODULE_AUTHOR("Rudolf Koenig, Brent Baccala and Martin Habets");
7777 MODULE_DESCRIPTION("Sun DBRI");
7878 MODULE_LICENSE("GPL");
79−MODULE_SUPPORTED_DEVICE("{{Sun,DBRI}}");
8079
8180 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
8281 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/usb/6fire/chip.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 MODULE_AUTHOR("Torsten Schenk <torsten.schenk@zoho.com>");
2727 MODULE_DESCRIPTION("TerraTec DMX 6Fire USB audio driver");
2828 MODULE_LICENSE("GPL v2");
29−MODULE_SUPPORTED_DEVICE("{{TerraTec,DMX 6Fire USB}}");
3029
3130 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
3231 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */
sound/usb/caiaq/device.c+0−14
@@ -26,20 +26,6 @@ · 25 unmodified lines
2626 MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
2727 MODULE_DESCRIPTION("caiaq USB audio");
2828 MODULE_LICENSE("GPL");
29−MODULE_SUPPORTED_DEVICE("{{Native Instruments,RigKontrol2},"
30− "{Native Instruments,RigKontrol3},"
31− "{Native Instruments,Kore Controller},"
32− "{Native Instruments,Kore Controller 2},"
33− "{Native Instruments,Audio Kontrol 1},"
34− "{Native Instruments,Audio 2 DJ},"
35− "{Native Instruments,Audio 4 DJ},"
36− "{Native Instruments,Audio 8 DJ},"
37− "{Native Instruments,Traktor Audio 2},"
38− "{Native Instruments,Session I/O},"
39− "{Native Instruments,GuitarRig mobile},"
40− "{Native Instruments,Traktor Kontrol X1},"
41− "{Native Instruments,Traktor Kontrol S4},"
42− "{Native Instruments,Maschine Controller}}");
4329
4430 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
4531 static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */
sound/usb/card.c+0−2
@@ -58,8 +58,6 @@ · 57 unmodified lines
5858 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
5959 MODULE_DESCRIPTION("USB Audio");
6060 MODULE_LICENSE("GPL");
61−MODULE_SUPPORTED_DEVICE("{{Generic,USB Audio}}");
62−
6361
6462 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
6563 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/usb/hiface/chip.c+0−17
@@ -21,23 +21,6 @@ MODULE_AUTHOR("Michael Trimarchi <michael@amarulasolutions.com>"); · 20 unmodified lines
2121 MODULE_AUTHOR("Antonio Ospite <ao2@amarulasolutions.com>");
2222 MODULE_DESCRIPTION("M2Tech hiFace USB-SPDIF audio driver");
2323 MODULE_LICENSE("GPL v2");
24−MODULE_SUPPORTED_DEVICE("{{M2Tech,Young},"
25− "{M2Tech,hiFace},"
26− "{M2Tech,North Star},"
27− "{M2Tech,W4S Young},"
28− "{M2Tech,Corrson},"
29− "{M2Tech,AUDIA},"
30− "{M2Tech,SL Audio},"
31− "{M2Tech,Empirical},"
32− "{M2Tech,Rockna},"
33− "{M2Tech,Pathos},"
34− "{M2Tech,Metronome},"
35− "{M2Tech,CAD},"
36− "{M2Tech,Audio Esclusive},"
37− "{M2Tech,Rotel},"
38− "{M2Tech,Eeaudio},"
39− "{The Chord Company,CHORD},"
40− "{AVA Group A/S,Vitus}}");
4124
4225 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
4326 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */
sound/usb/misc/ua101.c+0−1
@@ -19,7 +19,6 @@ · 18 unmodified lines
1919 MODULE_DESCRIPTION("Edirol UA-101/1000 driver");
2020 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
2121 MODULE_LICENSE("GPL v2");
22−MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}");
2322
2423 /*
2524 * Should not be lower than the minimum scheduling delay of the host
sound/usb/mixer_quirks.c+2−2
@@ -2883,7 +2883,7 @@ static int snd_djm_controls_put(struct snd_kcontrol *kctl, struct snd_ctl_elem_v · 2882 unmodified lines
28832883 u8 group = (private_value & SND_DJM_GROUP_MASK) >> SND_DJM_GROUP_SHIFT;
28842884 u16 value = elem->value.enumerated.item[0];
28852885
2886− kctl->private_value = ((device << SND_DJM_DEVICE_SHIFT) |
2886+ kctl->private_value = (((unsigned long)device << SND_DJM_DEVICE_SHIFT) |
28872887 (group << SND_DJM_GROUP_SHIFT) |
28882888 value);
28892889
@@ -2921,7 +2921,7 @@ static int snd_djm_controls_create(struct usb_mixer_interface *mixer, · 31 unmodified lines
29212921 value = device->controls[i].default_value;
29222922 knew.name = device->controls[i].name;
29232923 knew.private_value = (
2924− (device_idx << SND_DJM_DEVICE_SHIFT) |
2924+ ((unsigned long)device_idx << SND_DJM_DEVICE_SHIFT) |
29252925 (i << SND_DJM_GROUP_SHIFT) |
29262926 value);
29272927 err = snd_djm_controls_update(mixer, device_idx, i, value);
sound/usb/usx2y/usbusx2y.c+0−1
@@ -137,7 +137,6 @@ · 136 unmodified lines
137137 MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>");
138138 MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.2");
139139 MODULE_LICENSE("GPL");
140−MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604),"NAME_ALLCAPS"(0x8001)(0x8005)(0x8007)}}");
141140
142141 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
143142 static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */
sound/x86/intel_hdmi_audio.c+0−1
@@ -1887,4 +1887,3 @@ MODULE_AUTHOR("Vaibhav Agarwal <vaibhav.agarwal@intel.com>"); · 1886 unmodified lines
18871887 MODULE_AUTHOR("Jerome Anand <jerome.anand@intel.com>");
18881888 MODULE_DESCRIPTION("Intel HDMI Audio driver");
18891889 MODULE_LICENSE("GPL v2");
1890−MODULE_SUPPORTED_DEVICE("{Intel,Intel_HAD}");
sound/xen/xen_snd_front.c+0−1
@@ -391,4 +391,3 @@ module_exit(xen_drv_fini); · 390 unmodified lines
391391 MODULE_DESCRIPTION("Xen virtual sound device frontend");
392392 MODULE_LICENSE("GPL");
393393 MODULE_ALIAS("xen:" XENSND_DRIVER_NAME);
394−MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual soundcard}}");
tools/testing/selftests/kvm/.gitignore+3−0
@@ -8,10 +8,13 @@ · 7 unmodified lines
88 /x86_64/debug_regs
99 /x86_64/evmcs_test
1010 /x86_64/get_cpuid_test
11+/x86_64/get_msr_index_features
1112 /x86_64/kvm_pv_test
13+/x86_64/hyperv_clock
1214 /x86_64/hyperv_cpuid
1315 /x86_64/mmio_warning_test
1416 /x86_64/platform_info_test
17+/x86_64/set_boot_cpu_id
1518 /x86_64/set_sregs_test
1619 /x86_64/smm_test
1720 /x86_64/state_test
tools/testing/selftests/kvm/Makefile+3−0
@@ -39,12 +39,15 @@ LIBKVM_aarch64 = lib/aarch64/processor.c lib/aarch64/ucall.c · 38 unmodified lines
3939 LIBKVM_s390x = lib/s390x/processor.c lib/s390x/ucall.c lib/s390x/diag318_test_handler.c
4040
4141 TEST_GEN_PROGS_x86_64 = x86_64/cr4_cpuid_sync_test
42+TEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features
4243 TEST_GEN_PROGS_x86_64 += x86_64/evmcs_test
4344 TEST_GEN_PROGS_x86_64 += x86_64/get_cpuid_test
45+TEST_GEN_PROGS_x86_64 += x86_64/hyperv_clock
4446 TEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid
4547 TEST_GEN_PROGS_x86_64 += x86_64/kvm_pv_test
4648 TEST_GEN_PROGS_x86_64 += x86_64/mmio_warning_test
4749 TEST_GEN_PROGS_x86_64 += x86_64/platform_info_test
50+TEST_GEN_PROGS_x86_64 += x86_64/set_boot_cpu_id
4851 TEST_GEN_PROGS_x86_64 += x86_64/set_sregs_test
4952 TEST_GEN_PROGS_x86_64 += x86_64/smm_test
5053 TEST_GEN_PROGS_x86_64 += x86_64/state_test
tools/testing/selftests/kvm/include/kvm_util.h+2−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616
1717 #include "sparsebit.h"
1818
19+#define KVM_DEV_PATH "/dev/kvm"
1920 #define KVM_MAX_VCPUS 512
2021
2122 /*
@@ -133,6 +134,7 @@ void vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl, · 111 unmodified lines
133134 int _vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl,
134135 void *arg);
135136 void vm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);
137+int _vm_ioctl(struct kvm_vm *vm, unsigned long cmd, void *arg);
136138 void kvm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);
137139 int _kvm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);
138140 void vm_mem_region_set_flags(struct kvm_vm *vm, uint32_t slot, uint32_t flags);
tools/testing/selftests/kvm/lib/kvm_util.c+6−1
@@ -1697,11 +1697,16 @@ void vm_ioctl(struct kvm_vm *vm, unsigned long cmd, void *arg) · 1696 unmodified lines
16971697 {
16981698 int ret;
16991699
1700− ret = ioctl(vm->fd, cmd, arg);
1700+ ret = _vm_ioctl(vm, cmd, arg);
17011701 TEST_ASSERT(ret == 0, "vm ioctl %lu failed, rc: %i errno: %i (%s)",
17021702 cmd, ret, errno, strerror(errno));
17031703 }
17041704
1705+int _vm_ioctl(struct kvm_vm *vm, unsigned long cmd, void *arg)
1706+{
1707+ return ioctl(vm->fd, cmd, arg);
1708+}
1709+
17051710 /*
17061711 * KVM system ioctl
17071712 *
tools/testing/selftests/kvm/lib/kvm_util_internal.h+0−2
@@ -10,8 +10,6 @@ · 9 unmodified lines
1010
1111 #include "sparsebit.h"
1212
13−#define KVM_DEV_PATH "/dev/kvm"
14−
1513 struct userspace_mem_region {
1614 struct kvm_userspace_memory_region region;
1715 struct sparsebit *unused_phy_pages;
tools/testing/selftests/kvm/x86_64/get_msr_index_features.c+134−0
@@ -0,0 +1,134 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Test that KVM_GET_MSR_INDEX_LIST and
4+ * KVM_GET_MSR_FEATURE_INDEX_LIST work as intended
5+ *
6+ * Copyright (C) 2020, Red Hat, Inc.
7+ */
8+#include <fcntl.h>
9+#include <stdio.h>
10+#include <stdlib.h>
11+#include <string.h>
12+#include <sys/ioctl.h>
13+
14+#include "test_util.h"
15+#include "kvm_util.h"
16+#include "processor.h"
17+
18+static int kvm_num_index_msrs(int kvm_fd, int nmsrs)
19+{
20+ struct kvm_msr_list *list;
21+ int r;
22+
23+ list = malloc(sizeof(*list) + nmsrs * sizeof(list->indices[0]));
24+ list->nmsrs = nmsrs;
25+ r = ioctl(kvm_fd, KVM_GET_MSR_INDEX_LIST, list);
26+ TEST_ASSERT(r == -1 && errno == E2BIG,
27+ "Unexpected result from KVM_GET_MSR_INDEX_LIST probe, r: %i",
28+ r);
29+
30+ r = list->nmsrs;
31+ free(list);
32+ return r;
33+}
34+
35+static void test_get_msr_index(void)
36+{
37+ int old_res, res, kvm_fd, r;
38+ struct kvm_msr_list *list;
39+
40+ kvm_fd = open(KVM_DEV_PATH, O_RDONLY);
41+ if (kvm_fd < 0)
42+ exit(KSFT_SKIP);
43+
44+ old_res = kvm_num_index_msrs(kvm_fd, 0);
45+ TEST_ASSERT(old_res != 0, "Expecting nmsrs to be > 0");
46+
47+ if (old_res != 1) {
48+ res = kvm_num_index_msrs(kvm_fd, 1);
49+ TEST_ASSERT(res > 1, "Expecting nmsrs to be > 1");
50+ TEST_ASSERT(res == old_res, "Expecting nmsrs to be identical");
51+ }
52+
53+ list = malloc(sizeof(*list) + old_res * sizeof(list->indices[0]));
54+ list->nmsrs = old_res;
55+ r = ioctl(kvm_fd, KVM_GET_MSR_INDEX_LIST, list);
56+
57+ TEST_ASSERT(r == 0,
58+ "Unexpected result from KVM_GET_MSR_FEATURE_INDEX_LIST, r: %i",
59+ r);
60+ TEST_ASSERT(list->nmsrs == old_res, "Expecting nmsrs to be identical");
61+ free(list);
62+
63+ close(kvm_fd);
64+}
65+
66+static int kvm_num_feature_msrs(int kvm_fd, int nmsrs)
67+{
68+ struct kvm_msr_list *list;
69+ int r;
70+
71+ list = malloc(sizeof(*list) + nmsrs * sizeof(list->indices[0]));
72+ list->nmsrs = nmsrs;
73+ r = ioctl(kvm_fd, KVM_GET_MSR_FEATURE_INDEX_LIST, list);
74+ TEST_ASSERT(r == -1 && errno == E2BIG,
75+ "Unexpected result from KVM_GET_MSR_FEATURE_INDEX_LIST probe, r: %i",
76+ r);
77+
78+ r = list->nmsrs;
79+ free(list);
80+ return r;
81+}
82+
83+struct kvm_msr_list *kvm_get_msr_feature_list(int kvm_fd, int nmsrs)
84+{
85+ struct kvm_msr_list *list;
86+ int r;
87+
88+ list = malloc(sizeof(*list) + nmsrs * sizeof(list->indices[0]));
89+ list->nmsrs = nmsrs;
90+ r = ioctl(kvm_fd, KVM_GET_MSR_FEATURE_INDEX_LIST, list);
91+
92+ TEST_ASSERT(r == 0,
93+ "Unexpected result from KVM_GET_MSR_FEATURE_INDEX_LIST, r: %i",
94+ r);
95+
96+ return list;
97+}
98+
99+static void test_get_msr_feature(void)
100+{
101+ int res, old_res, i, kvm_fd;
102+ struct kvm_msr_list *feature_list;
103+
104+ kvm_fd = open(KVM_DEV_PATH, O_RDONLY);
105+ if (kvm_fd < 0)
106+ exit(KSFT_SKIP);
107+
108+ old_res = kvm_num_feature_msrs(kvm_fd, 0);
109+ TEST_ASSERT(old_res != 0, "Expecting nmsrs to be > 0");
110+
111+ if (old_res != 1) {
112+ res = kvm_num_feature_msrs(kvm_fd, 1);
113+ TEST_ASSERT(res > 1, "Expecting nmsrs to be > 1");
114+ TEST_ASSERT(res == old_res, "Expecting nmsrs to be identical");
115+ }
116+
117+ feature_list = kvm_get_msr_feature_list(kvm_fd, old_res);
118+ TEST_ASSERT(old_res == feature_list->nmsrs,
119+ "Unmatching number of msr indexes");
120+
121+ for (i = 0; i < feature_list->nmsrs; i++)
122+ kvm_get_feature_msr(feature_list->indices[i]);
123+
124+ free(feature_list);
125+ close(kvm_fd);
126+}
127+
128+int main(int argc, char *argv[])
129+{
130+ if (kvm_check_cap(KVM_CAP_GET_MSR_FEATURES))
131+ test_get_msr_feature();
132+
133+ test_get_msr_index();
134+}
tools/testing/selftests/kvm/x86_64/hyperv_clock.c+260−0
@@ -0,0 +1,260 @@
1+// SPDX-License-Identifier: GPL-2.0-only
2+/*
3+ * Copyright (C) 2021, Red Hat, Inc.
4+ *
5+ * Tests for Hyper-V clocksources
6+ */
7+#include "test_util.h"
8+#include "kvm_util.h"
9+#include "processor.h"
10+
11+struct ms_hyperv_tsc_page {
12+ volatile u32 tsc_sequence;
13+ u32 reserved1;
14+ volatile u64 tsc_scale;
15+ volatile s64 tsc_offset;
16+} __packed;
17+
18+#define HV_X64_MSR_GUEST_OS_ID 0x40000000
19+#define HV_X64_MSR_TIME_REF_COUNT 0x40000020
20+#define HV_X64_MSR_REFERENCE_TSC 0x40000021
21+#define HV_X64_MSR_TSC_FREQUENCY 0x40000022
22+#define HV_X64_MSR_REENLIGHTENMENT_CONTROL 0x40000106
23+#define HV_X64_MSR_TSC_EMULATION_CONTROL 0x40000107
24+
25+/* Simplified mul_u64_u64_shr() */
26+static inline u64 mul_u64_u64_shr64(u64 a, u64 b)
27+{
28+ union {
29+ u64 ll;
30+ struct {
31+ u32 low, high;
32+ } l;
33+ } rm, rn, rh, a0, b0;
34+ u64 c;
35+
36+ a0.ll = a;
37+ b0.ll = b;
38+
39+ rm.ll = (u64)a0.l.low * b0.l.high;
40+ rn.ll = (u64)a0.l.high * b0.l.low;
41+ rh.ll = (u64)a0.l.high * b0.l.high;
42+
43+ rh.l.low = c = rm.l.high + rn.l.high + rh.l.low;
44+ rh.l.high = (c >> 32) + rh.l.high;
45+
46+ return rh.ll;
47+}
48+
49+static inline void nop_loop(void)
50+{
51+ int i;
52+
53+ for (i = 0; i < 1000000; i++)
54+ asm volatile("nop");
55+}
56+
57+static inline void check_tsc_msr_rdtsc(void)
58+{
59+ u64 tsc_freq, r1, r2, t1, t2;
60+ s64 delta_ns;
61+
62+ tsc_freq = rdmsr(HV_X64_MSR_TSC_FREQUENCY);
63+ GUEST_ASSERT(tsc_freq > 0);
64+
65+ /* First, check MSR-based clocksource */
66+ r1 = rdtsc();
67+ t1 = rdmsr(HV_X64_MSR_TIME_REF_COUNT);
68+ nop_loop();
69+ r2 = rdtsc();
70+ t2 = rdmsr(HV_X64_MSR_TIME_REF_COUNT);
71+
72+ GUEST_ASSERT(r2 > r1 && t2 > t1);
73+
74+ /* HV_X64_MSR_TIME_REF_COUNT is in 100ns */
75+ delta_ns = ((t2 - t1) * 100) - ((r2 - r1) * 1000000000 / tsc_freq);
76+ if (delta_ns < 0)
77+ delta_ns = -delta_ns;
78+
79+ /* 1% tolerance */
80+ GUEST_ASSERT(delta_ns * 100 < (t2 - t1) * 100);
81+}
82+
83+static inline void check_tsc_msr_tsc_page(struct ms_hyperv_tsc_page *tsc_page)
84+{
85+ u64 r1, r2, t1, t2;
86+
87+ /* Compare TSC page clocksource with HV_X64_MSR_TIME_REF_COUNT */
88+ t1 = mul_u64_u64_shr64(rdtsc(), tsc_page->tsc_scale) + tsc_page->tsc_offset;
89+ r1 = rdmsr(HV_X64_MSR_TIME_REF_COUNT);
90+
91+ /* 10 ms tolerance */
92+ GUEST_ASSERT(r1 >= t1 && r1 - t1 < 100000);
93+ nop_loop();
94+
95+ t2 = mul_u64_u64_shr64(rdtsc(), tsc_page->tsc_scale) + tsc_page->tsc_offset;
96+ r2 = rdmsr(HV_X64_MSR_TIME_REF_COUNT);
97+ GUEST_ASSERT(r2 >= t1 && r2 - t2 < 100000);
98+}
99+
100+static void guest_main(struct ms_hyperv_tsc_page *tsc_page, vm_paddr_t tsc_page_gpa)
101+{
102+ u64 tsc_scale, tsc_offset;
103+
104+ /* Set Guest OS id to enable Hyper-V emulation */
105+ GUEST_SYNC(1);
106+ wrmsr(HV_X64_MSR_GUEST_OS_ID, (u64)0x8100 << 48);
107+ GUEST_SYNC(2);
108+
109+ check_tsc_msr_rdtsc();
110+
111+ GUEST_SYNC(3);
112+
113+ /* Set up TSC page is disabled state, check that it's clean */
114+ wrmsr(HV_X64_MSR_REFERENCE_TSC, tsc_page_gpa);
115+ GUEST_ASSERT(tsc_page->tsc_sequence == 0);
116+ GUEST_ASSERT(tsc_page->tsc_scale == 0);
117+ GUEST_ASSERT(tsc_page->tsc_offset == 0);
118+
119+ GUEST_SYNC(4);
120+
121+ /* Set up TSC page is enabled state */
122+ wrmsr(HV_X64_MSR_REFERENCE_TSC, tsc_page_gpa | 0x1);
123+ GUEST_ASSERT(tsc_page->tsc_sequence != 0);
124+
125+ GUEST_SYNC(5);
126+
127+ check_tsc_msr_tsc_page(tsc_page);
128+
129+ GUEST_SYNC(6);
130+
131+ tsc_offset = tsc_page->tsc_offset;
132+ /* Call KVM_SET_CLOCK from userspace, check that TSC page was updated */
133+ GUEST_SYNC(7);
134+ GUEST_ASSERT(tsc_page->tsc_offset != tsc_offset);
135+
136+ nop_loop();
137+
138+ /*
139+ * Enable Re-enlightenment and check that TSC page stays constant across
140+ * KVM_SET_CLOCK.
141+ */
142+ wrmsr(HV_X64_MSR_REENLIGHTENMENT_CONTROL, 0x1 << 16 | 0xff);
143+ wrmsr(HV_X64_MSR_TSC_EMULATION_CONTROL, 0x1);
144+ tsc_offset = tsc_page->tsc_offset;
145+ tsc_scale = tsc_page->tsc_scale;
146+ GUEST_SYNC(8);
147+ GUEST_ASSERT(tsc_page->tsc_offset == tsc_offset);
148+ GUEST_ASSERT(tsc_page->tsc_scale == tsc_scale);
149+
150+ GUEST_SYNC(9);
151+
152+ check_tsc_msr_tsc_page(tsc_page);
153+
154+ /*
155+ * Disable re-enlightenment and TSC page, check that KVM doesn't update
156+ * it anymore.
157+ */
158+ wrmsr(HV_X64_MSR_REENLIGHTENMENT_CONTROL, 0);
159+ wrmsr(HV_X64_MSR_TSC_EMULATION_CONTROL, 0);
160+ wrmsr(HV_X64_MSR_REFERENCE_TSC, 0);
161+ memset(tsc_page, 0, sizeof(*tsc_page));
162+
163+ GUEST_SYNC(10);
164+ GUEST_ASSERT(tsc_page->tsc_sequence == 0);
165+ GUEST_ASSERT(tsc_page->tsc_offset == 0);
166+ GUEST_ASSERT(tsc_page->tsc_scale == 0);
167+
168+ GUEST_DONE();
169+}
170+
171+#define VCPU_ID 0
172+
173+static void host_check_tsc_msr_rdtsc(struct kvm_vm *vm)
174+{
175+ u64 tsc_freq, r1, r2, t1, t2;
176+ s64 delta_ns;
177+
178+ tsc_freq = vcpu_get_msr(vm, VCPU_ID, HV_X64_MSR_TSC_FREQUENCY);
179+ TEST_ASSERT(tsc_freq > 0, "TSC frequency must be nonzero");
180+
181+ /* First, check MSR-based clocksource */
182+ r1 = rdtsc();
183+ t1 = vcpu_get_msr(vm, VCPU_ID, HV_X64_MSR_TIME_REF_COUNT);
184+ nop_loop();
185+ r2 = rdtsc();
186+ t2 = vcpu_get_msr(vm, VCPU_ID, HV_X64_MSR_TIME_REF_COUNT);
187+
188+ TEST_ASSERT(t2 > t1, "Time reference MSR is not monotonic (%ld <= %ld)", t1, t2);
189+
190+ /* HV_X64_MSR_TIME_REF_COUNT is in 100ns */
191+ delta_ns = ((t2 - t1) * 100) - ((r2 - r1) * 1000000000 / tsc_freq);
192+ if (delta_ns < 0)
193+ delta_ns = -delta_ns;
194+
195+ /* 1% tolerance */
196+ TEST_ASSERT(delta_ns * 100 < (t2 - t1) * 100,
197+ "Elapsed time does not match (MSR=%ld, TSC=%ld)",
198+ (t2 - t1) * 100, (r2 - r1) * 1000000000 / tsc_freq);
199+}
200+
201+int main(void)
202+{
203+ struct kvm_vm *vm;
204+ struct kvm_run *run;
205+ struct ucall uc;
206+ vm_vaddr_t tsc_page_gva;
207+ int stage;
208+
209+ vm = vm_create_default(VCPU_ID, 0, guest_main);
210+ run = vcpu_state(vm, VCPU_ID);
211+
212+ vcpu_set_hv_cpuid(vm, VCPU_ID);
213+
214+ tsc_page_gva = vm_vaddr_alloc(vm, getpagesize(), 0x10000, 0, 0);
215+ memset(addr_gpa2hva(vm, tsc_page_gva), 0x0, getpagesize());
216+ TEST_ASSERT((addr_gva2gpa(vm, tsc_page_gva) & (getpagesize() - 1)) == 0,
217+ "TSC page has to be page aligned\n");
218+ vcpu_args_set(vm, VCPU_ID, 2, tsc_page_gva, addr_gva2gpa(vm, tsc_page_gva));
219+
220+ host_check_tsc_msr_rdtsc(vm);
221+
222+ for (stage = 1;; stage++) {
223+ _vcpu_run(vm, VCPU_ID);
224+ TEST_ASSERT(run->exit_reason == KVM_EXIT_IO,
225+ "Stage %d: unexpected exit reason: %u (%s),\n",
226+ stage, run->exit_reason,
227+ exit_reason_str(run->exit_reason));
228+
229+ switch (get_ucall(vm, VCPU_ID, &uc)) {
230+ case UCALL_ABORT:
231+ TEST_FAIL("%s at %s:%ld", (const char *)uc.args[0],
232+ __FILE__, uc.args[1]);
233+ /* NOT REACHED */
234+ case UCALL_SYNC:
235+ break;
236+ case UCALL_DONE:
237+ /* Keep in sync with guest_main() */
238+ TEST_ASSERT(stage == 11, "Testing ended prematurely, stage %d\n",
239+ stage);
240+ goto out;
241+ default:
242+ TEST_FAIL("Unknown ucall %lu", uc.cmd);
243+ }
244+
245+ TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
246+ uc.args[1] == stage,
247+ "Stage %d: Unexpected register values vmexit, got %lx",
248+ stage, (ulong)uc.args[1]);
249+
250+ /* Reset kvmclock triggering TSC page update */
251+ if (stage == 7 || stage == 8 || stage == 10) {
252+ struct kvm_clock_data clock = {0};
253+
254+ vm_ioctl(vm, KVM_SET_CLOCK, &clock);
255+ }
256+ }
257+
258+out:
259+ kvm_vm_free(vm);
260+}
tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c+166−0
@@ -0,0 +1,166 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Test that KVM_SET_BOOT_CPU_ID works as intended
4+ *
5+ * Copyright (C) 2020, Red Hat, Inc.
6+ */
7+#define _GNU_SOURCE /* for program_invocation_name */
8+#include <fcntl.h>
9+#include <stdio.h>
10+#include <stdlib.h>
11+#include <string.h>
12+#include <sys/ioctl.h>
13+
14+#include "test_util.h"
15+#include "kvm_util.h"
16+#include "processor.h"
17+
18+#define N_VCPU 2
19+#define VCPU_ID0 0
20+#define VCPU_ID1 1
21+
22+static uint32_t get_bsp_flag(void)
23+{
24+ return rdmsr(MSR_IA32_APICBASE) & MSR_IA32_APICBASE_BSP;
25+}
26+
27+static void guest_bsp_vcpu(void *arg)
28+{
29+ GUEST_SYNC(1);
30+
31+ GUEST_ASSERT(get_bsp_flag() != 0);
32+
33+ GUEST_DONE();
34+}
35+
36+static void guest_not_bsp_vcpu(void *arg)
37+{
38+ GUEST_SYNC(1);
39+
40+ GUEST_ASSERT(get_bsp_flag() == 0);
41+
42+ GUEST_DONE();
43+}
44+
45+static void test_set_boot_busy(struct kvm_vm *vm)
46+{
47+ int res;
48+
49+ res = _vm_ioctl(vm, KVM_SET_BOOT_CPU_ID, (void *) VCPU_ID0);
50+ TEST_ASSERT(res == -1 && errno == EBUSY,
51+ "KVM_SET_BOOT_CPU_ID set while running vm");
52+}
53+
54+static void run_vcpu(struct kvm_vm *vm, uint32_t vcpuid)
55+{
56+ struct ucall uc;
57+ int stage;
58+
59+ for (stage = 0; stage < 2; stage++) {
60+
61+ vcpu_run(vm, vcpuid);
62+
63+ switch (get_ucall(vm, vcpuid, &uc)) {
64+ case UCALL_SYNC:
65+ TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
66+ uc.args[1] == stage + 1,
67+ "Stage %d: Unexpected register values vmexit, got %lx",
68+ stage + 1, (ulong)uc.args[1]);
69+ test_set_boot_busy(vm);
70+ break;
71+ case UCALL_DONE:
72+ TEST_ASSERT(stage == 1,
73+ "Expected GUEST_DONE in stage 2, got stage %d",
74+ stage);
75+ break;
76+ case UCALL_ABORT:
77+ TEST_ASSERT(false, "%s at %s:%ld\n\tvalues: %#lx, %#lx",
78+ (const char *)uc.args[0], __FILE__,
79+ uc.args[1], uc.args[2], uc.args[3]);
80+ default:
81+ TEST_ASSERT(false, "Unexpected exit: %s",
82+ exit_reason_str(vcpu_state(vm, vcpuid)->exit_reason));
83+ }
84+ }
85+}
86+
87+static struct kvm_vm *create_vm(void)
88+{
89+ struct kvm_vm *vm;
90+ uint64_t vcpu_pages = (DEFAULT_STACK_PGS) * 2;
91+ uint64_t extra_pg_pages = vcpu_pages / PTES_PER_MIN_PAGE * N_VCPU;
92+ uint64_t pages = DEFAULT_GUEST_PHY_PAGES + vcpu_pages + extra_pg_pages;
93+
94+ pages = vm_adjust_num_guest_pages(VM_MODE_DEFAULT, pages);
95+ vm = vm_create(VM_MODE_DEFAULT, pages, O_RDWR);
96+
97+ kvm_vm_elf_load(vm, program_invocation_name, 0, 0);
98+ vm_create_irqchip(vm);
99+
100+ return vm;
101+}
102+
103+static void add_x86_vcpu(struct kvm_vm *vm, uint32_t vcpuid, bool bsp_code)
104+{
105+ if (bsp_code)
106+ vm_vcpu_add_default(vm, vcpuid, guest_bsp_vcpu);
107+ else
108+ vm_vcpu_add_default(vm, vcpuid, guest_not_bsp_vcpu);
109+
110+ vcpu_set_cpuid(vm, vcpuid, kvm_get_supported_cpuid());
111+}
112+
113+static void run_vm_bsp(uint32_t bsp_vcpu)
114+{
115+ struct kvm_vm *vm;
116+ bool is_bsp_vcpu1 = bsp_vcpu == VCPU_ID1;
117+
118+ vm = create_vm();
119+
120+ if (is_bsp_vcpu1)
121+ vm_ioctl(vm, KVM_SET_BOOT_CPU_ID, (void *) VCPU_ID1);
122+
123+ add_x86_vcpu(vm, VCPU_ID0, !is_bsp_vcpu1);
124+ add_x86_vcpu(vm, VCPU_ID1, is_bsp_vcpu1);
125+
126+ run_vcpu(vm, VCPU_ID0);
127+ run_vcpu(vm, VCPU_ID1);
128+
129+ kvm_vm_free(vm);
130+}
131+
132+static void check_set_bsp_busy(void)
133+{
134+ struct kvm_vm *vm;
135+ int res;
136+
137+ vm = create_vm();
138+
139+ add_x86_vcpu(vm, VCPU_ID0, true);
140+ add_x86_vcpu(vm, VCPU_ID1, false);
141+
142+ res = _vm_ioctl(vm, KVM_SET_BOOT_CPU_ID, (void *) VCPU_ID1);
143+ TEST_ASSERT(res == -1 && errno == EBUSY, "KVM_SET_BOOT_CPU_ID set after adding vcpu");
144+
145+ run_vcpu(vm, VCPU_ID0);
146+ run_vcpu(vm, VCPU_ID1);
147+
148+ res = _vm_ioctl(vm, KVM_SET_BOOT_CPU_ID, (void *) VCPU_ID1);
149+ TEST_ASSERT(res == -1 && errno == EBUSY, "KVM_SET_BOOT_CPU_ID set to a terminated vcpu");
150+
151+ kvm_vm_free(vm);
152+}
153+
154+int main(int argc, char *argv[])
155+{
156+ if (!kvm_check_cap(KVM_CAP_SET_BOOT_CPU_ID)) {
157+ print_skip("set_boot_cpu_id not available");
158+ return 0;
159+ }
160+
161+ run_vm_bsp(VCPU_ID0);
162+ run_vm_bsp(VCPU_ID1);
163+ run_vm_bsp(VCPU_ID0);
164+
165+ check_set_bsp_busy();
166+}