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
33Description:33Description:
34 The current state of the log write grant head. It34 The current state of the log write grant head. It
35 represents the total log reservation of all currently35 represents the total log reservation of all currently
36 oustanding transactions, including regrants due to36 outstanding transactions, including regrants due to
37 rolling transactions. The grant head is exported in37 rolling transactions. The grant head is exported in
38 "cycle:bytes" format.38 "cycle:bytes" format.
39Users: xfstests39Users: xfstests
Documentation/devicetree/bindings/sound/fsl,spdif.yaml+4−0
@@ -21,6 +21,10 @@ properties: · 20 unmodified lines
21 - fsl,vf610-spdif21 - fsl,vf610-spdif
22 - fsl,imx6sx-spdif22 - fsl,imx6sx-spdif
23 - fsl,imx8qm-spdif23 - fsl,imx8qm-spdif
24 - fsl,imx8qxp-spdif
25 - fsl,imx8mq-spdif
26 - fsl,imx8mm-spdif
27 - fsl,imx8mn-spdif
24 28
25 reg:29 reg:
26 maxItems: 130 maxItems: 1
Documentation/virt/kvm/api.rst+6−3
@@ -1495,7 +1495,8 @@ Fails if any VCPU has already been created. · 1494 unmodified lines
1495 1495
1496Define which vcpu is the Bootstrap Processor (BSP). Values are the same1496Define which vcpu is the Bootstrap Processor (BSP). Values are the same
1497as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default1497as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default
1498is vcpu 0.1498is vcpu 0. This ioctl has to be called before vcpu creation,
1499otherwise it will return EBUSY error.
1499 1500
1500 1501
15014.42 KVM_GET_XSAVE15024.42 KVM_GET_XSAVE
@@ -4806,8 +4807,10 @@ If an MSR access is not permitted through the filtering, it generates a · 3304 unmodified lines
4806allows user space to deflect and potentially handle various MSR accesses4807allows user space to deflect and potentially handle various MSR accesses
4807into user space.4808into user space.
4808 4809
4809If a vCPU is in running state while this ioctl is invoked, the vCPU may4810Note, invoking this ioctl with a vCPU is running is inherently racy. However,
4810experience inconsistent filtering behavior on MSR accesses.4811KVM does guarantee that vCPUs will see either the previous filter or the new
4812filter, e.g. MSRs with identical settings in both the old and new filter will
4813have deterministic behavior.
4811 4814
48124.127 KVM_XEN_HVM_SET_ATTR48154.127 KVM_XEN_HVM_SET_ATTR
4813--------------------------4816--------------------------
MAINTAINERS+3−4
@@ -1181,7 +1181,7 @@ M: Joel Fernandes <joel@joelfernandes.org> · 1180 unmodified lines
1181M: Christian Brauner <christian@brauner.io>1181M: Christian Brauner <christian@brauner.io>
1182M: Hridya Valsaraju <hridya@google.com>1182M: Hridya Valsaraju <hridya@google.com>
1183M: Suren Baghdasaryan <surenb@google.com>1183M: Suren Baghdasaryan <surenb@google.com>
1184L: devel@driverdev.osuosl.org1184L: linux-kernel@vger.kernel.org
1185S: Supported1185S: Supported
1186T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git1186T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
1187F: drivers/android/1187F: drivers/android/
@@ -8116,7 +8116,6 @@ F: drivers/crypto/hisilicon/sec2/sec_main.c · 6928 unmodified lines
8116 8116
8117HISILICON STAGING DRIVERS FOR HIKEY 960/9708117HISILICON STAGING DRIVERS FOR HIKEY 960/970
8118M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>8118M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
8119L: devel@driverdev.osuosl.org
8120S: Maintained8119S: Maintained
8121F: drivers/staging/hikey9xx/8120F: drivers/staging/hikey9xx/
8122 8121
@@ -17040,7 +17039,7 @@ F: drivers/staging/vt665?/ · 8917 unmodified lines
17040 17039
17041STAGING SUBSYSTEM17040STAGING SUBSYSTEM
17042M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>17041M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17043L: devel@driverdev.osuosl.org17042L: linux-staging@lists.linux.dev
17044S: Supported17043S: Supported
17045T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git17044T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
17046F: drivers/staging/17045F: drivers/staging/
@@ -19135,7 +19134,7 @@ VME SUBSYSTEM · 2088 unmodified lines
19135M: Martyn Welch <martyn@welchs.me.uk>19134M: Martyn Welch <martyn@welchs.me.uk>
19136M: Manohar Vanga <manohar.vanga@gmail.com>19135M: Manohar Vanga <manohar.vanga@gmail.com>
19137M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>19136M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19138L: devel@driverdev.osuosl.org19137L: linux-kernel@vger.kernel.org
19139S: Maintained19138S: Maintained
19140T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git19139T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
19141F: Documentation/driver-api/vme.rst19140F: Documentation/driver-api/vme.rst
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2VERSION = 52VERSION = 5
3PATCHLEVEL = 123PATCHLEVEL = 12
4SUBLEVEL = 04SUBLEVEL = 0
5EXTRAVERSION = -rc35EXTRAVERSION = -rc4
6NAME = Frozen Wasteland6NAME = Frozen Wasteland
7 7
8# *DOCUMENTATION*8# *DOCUMENTATION*
arch/csky/kernel/probes/ftrace.c+1−1
@@ -9,7 +9,7 @@ int arch_check_ftrace_location(struct kprobe *p) · 8 unmodified lines
9 return 0;9 return 0;
10}10}
11 11
12/* Ftrace callback handler for kprobes -- called under preepmt disabed */12/* Ftrace callback handler for kprobes -- called under preepmt disabled */
13void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,13void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
14 struct ftrace_ops *ops, struct ftrace_regs *fregs)14 struct ftrace_ops *ops, struct ftrace_regs *fregs)
15{15{
arch/mips/kernel/vmlinux.lds.S+1−1
@@ -176,7 +176,7 @@ SECTIONS · 175 unmodified lines
176 .fill : {176 .fill : {
177 FILL(0);177 FILL(0);
178 BYTE(0);178 BYTE(0);
179 . = ALIGN(8);179 STRUCT_ALIGN();
180 }180 }
181 __appended_dtb = .;181 __appended_dtb = .;
182 /* leave space for appended DTB */182 /* leave space for appended DTB */
arch/powerpc/include/asm/cpu_has_feature.h+2−2
@@ -7,7 +7,7 @@ · 6 unmodified lines
7#include <linux/bug.h>7#include <linux/bug.h>
8#include <asm/cputable.h>8#include <asm/cputable.h>
9 9
10static inline bool early_cpu_has_feature(unsigned long feature)10static __always_inline bool early_cpu_has_feature(unsigned long feature)
11{11{
12 return !!((CPU_FTRS_ALWAYS & feature) ||12 return !!((CPU_FTRS_ALWAYS & feature) ||
13 (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature));13 (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
46 return static_branch_likely(&cpu_feature_keys[i]);46 return static_branch_likely(&cpu_feature_keys[i]);
47}47}
48#else48#else
49static inline bool cpu_has_feature(unsigned long feature)49static __always_inline bool cpu_has_feature(unsigned long feature)
50{50{
51 return early_cpu_has_feature(feature);51 return early_cpu_has_feature(feature);
52}52}
arch/powerpc/kernel/vdso32/gettimeofday.S+11−0
@@ -65,3 +65,14 @@ V_FUNCTION_END(__kernel_clock_getres) · 64 unmodified lines
65V_FUNCTION_BEGIN(__kernel_time)65V_FUNCTION_BEGIN(__kernel_time)
66 cvdso_call_time __c_kernel_time66 cvdso_call_time __c_kernel_time
67V_FUNCTION_END(__kernel_time)67V_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
93 select PCI_MSI if PCI93 select PCI_MSI if PCI
94 select RISCV_INTC94 select RISCV_INTC
95 select RISCV_TIMER if RISCV_SBI95 select RISCV_TIMER if RISCV_SBI
96 select SPARSEMEM_STATIC if 32BIT
97 select SPARSE_IRQ96 select SPARSE_IRQ
98 select SYSCTL_EXCEPTION_TRACE97 select SYSCTL_EXCEPTION_TRACE
99 select THREAD_INFO_IN_TASK98 select THREAD_INFO_IN_TASK
@@ -154,7 +153,8 @@ config ARCH_FLATMEM_ENABLE · 54 unmodified lines
154config ARCH_SPARSEMEM_ENABLE153config ARCH_SPARSEMEM_ENABLE
155 def_bool y154 def_bool y
156 depends on MMU155 depends on MMU
157 select SPARSEMEM_VMEMMAP_ENABLE156 select SPARSEMEM_STATIC if 32BIT && SPARSMEM
157 select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
158 158
159config ARCH_SELECT_MEMORY_MODEL159config ARCH_SELECT_MEMORY_MODEL
160 def_bool ARCH_SPARSEMEM_ENABLE160 def_bool ARCH_SPARSEMEM_ENABLE
arch/riscv/Kconfig.socs+2−0
@@ -31,6 +31,8 @@ config SOC_CANAAN · 30 unmodified lines
31 select SIFIVE_PLIC31 select SIFIVE_PLIC
32 select ARCH_HAS_RESET_CONTROLLER32 select ARCH_HAS_RESET_CONTROLLER
33 select PINCTRL33 select PINCTRL
34 select COMMON_CLK
35 select COMMON_CLK_K210
34 help36 help
35 This enables support for Canaan Kendryte K210 SoC platform hardware.37 This enables support for Canaan Kendryte K210 SoC platform hardware.
36 38
arch/riscv/include/asm/asm-prototypes.h+16−0
@@ -9,4 +9,20 @@ long long __lshrti3(long long a, int b); · 8 unmodified lines
9long long __ashrti3(long long a, int b);9long long __ashrti3(long long a, int b);
10long long __ashlti3(long long a, int b);10long long __ashlti3(long long a, int b);
11 11
12
13#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs)
14
15DECLARE_DO_ERROR_INFO(do_trap_unknown);
16DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned);
17DECLARE_DO_ERROR_INFO(do_trap_insn_fault);
18DECLARE_DO_ERROR_INFO(do_trap_insn_illegal);
19DECLARE_DO_ERROR_INFO(do_trap_load_fault);
20DECLARE_DO_ERROR_INFO(do_trap_load_misaligned);
21DECLARE_DO_ERROR_INFO(do_trap_store_misaligned);
22DECLARE_DO_ERROR_INFO(do_trap_store_fault);
23DECLARE_DO_ERROR_INFO(do_trap_ecall_u);
24DECLARE_DO_ERROR_INFO(do_trap_ecall_s);
25DECLARE_DO_ERROR_INFO(do_trap_ecall_m);
26DECLARE_DO_ERROR_INFO(do_trap_break);
27
12#endif /* _ASM_RISCV_PROTOTYPES_H */28#endif /* _ASM_RISCV_PROTOTYPES_H */
arch/riscv/include/asm/irq.h+2−0
@@ -12,4 +12,6 @@ · 11 unmodified lines
12 12
13#include <asm-generic/irq.h>13#include <asm-generic/irq.h>
14 14
15extern void __init init_IRQ(void);
16
15#endif /* _ASM_RISCV_IRQ_H */17#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
71int riscv_of_parent_hartid(struct device_node *node);71int riscv_of_parent_hartid(struct device_node *node);
72 72
73extern void riscv_fill_hwcap(void);73extern void riscv_fill_hwcap(void);
74extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
74 75
75#endif /* __ASSEMBLY__ */76#endif /* __ASSEMBLY__ */
76 77
arch/riscv/include/asm/ptrace.h+5−0
@@ -119,6 +119,11 @@ extern int regs_query_register_offset(const char *name); · 118 unmodified lines
119extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,119extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
120 unsigned int n);120 unsigned int n);
121 121
122void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
123 unsigned long frame_pointer);
124int do_syscall_trace_enter(struct pt_regs *regs);
125void do_syscall_trace_exit(struct pt_regs *regs);
126
122/**127/**
123 * regs_get_register() - get register value from its offset128 * regs_get_register() - get register value from its offset
124 * @regs: pt_regs from which register value is gotten129 * @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
51 SBI_EXT_RFENCE_REMOTE_FENCE_I = 0,51 SBI_EXT_RFENCE_REMOTE_FENCE_I = 0,
52 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,52 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
53 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID,53 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID,
54 SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
55 SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID,54 SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID,
56 SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,55 SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
57 SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID,56 SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID,
57 SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,
58};58};
59 59
60enum sbi_ext_hsm_fid {60enum 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
88 return 0;88 return 0;
89}89}
90 90
91extern void time_init(void);
92
91#endif /* _ASM_RISCV_TIMEX_H */93#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
8CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE)8CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE)
9CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE)9CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE)
10endif10endif
11CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,)
11 12
12extra-y += head.o13extra-y += head.o
13extra-y += vmlinux.lds14extra-y += vmlinux.lds
arch/riscv/kernel/probes/ftrace.c+10−8
@@ -2,39 +2,41 @@ · 1 unmodified line
2 2
3#include <linux/kprobes.h>3#include <linux/kprobes.h>
4 4
5/* Ftrace callback handler for kprobes -- called under preepmt disabed */5/* Ftrace callback handler for kprobes -- called under preepmt disabled */
6void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,6void 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)
8{8{
9 struct kprobe *p;9 struct kprobe *p;
10 struct pt_regs *regs;
10 struct kprobe_ctlblk *kcb;11 struct kprobe_ctlblk *kcb;
11 12
12 p = get_kprobe((kprobe_opcode_t *)ip);13 p = get_kprobe((kprobe_opcode_t *)ip);
13 if (unlikely(!p) || kprobe_disabled(p))14 if (unlikely(!p) || kprobe_disabled(p))
14 return;15 return;
15 16
17 regs = ftrace_get_regs(fregs);
16 kcb = get_kprobe_ctlblk();18 kcb = get_kprobe_ctlblk();
17 if (kprobe_running()) {19 if (kprobe_running()) {
18 kprobes_inc_nmissed_count(p);20 kprobes_inc_nmissed_count(p);
19 } else {21 } else {
20 unsigned long orig_ip = instruction_pointer(&(regs->regs));22 unsigned long orig_ip = instruction_pointer(regs);
21 23
22 instruction_pointer_set(&(regs->regs), ip);24 instruction_pointer_set(regs, ip);
23 25
24 __this_cpu_write(current_kprobe, p);26 __this_cpu_write(current_kprobe, p);
25 kcb->kprobe_status = KPROBE_HIT_ACTIVE;27 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)) {
27 /*29 /*
28 * Emulate singlestep (and also recover regs->pc)30 * Emulate singlestep (and also recover regs->pc)
29 * as if there is a nop31 * as if there is a nop
30 */32 */
31 instruction_pointer_set(&(regs->regs),33 instruction_pointer_set(regs,
32 (unsigned long)p->addr + MCOUNT_INSN_SIZE);34 (unsigned long)p->addr + MCOUNT_INSN_SIZE);
33 if (unlikely(p->post_handler)) {35 if (unlikely(p->post_handler)) {
34 kcb->kprobe_status = KPROBE_HIT_SSDONE;36 kcb->kprobe_status = KPROBE_HIT_SSDONE;
35 p->post_handler(p, &(regs->regs), 0);37 p->post_handler(p, regs, 0);
36 }38 }
37 instruction_pointer_set(&(regs->regs), orig_ip);39 instruction_pointer_set(regs, orig_ip);
38 }40 }
39 41
40 /*42 /*
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
256 * normal page fault.256 * normal page fault.
257 */257 */
258 regs->epc = (unsigned long) cur->addr;258 regs->epc = (unsigned long) cur->addr;
259 if (!instruction_pointer(regs))259 BUG_ON(!instruction_pointer(regs));
260 BUG();
261 260
262 if (kcb->kprobe_status == KPROBE_REENTER)261 if (kcb->kprobe_status == KPROBE_REENTER)
263 restore_previous_kprobe(kcb);262 restore_previous_kprobe(kcb);
arch/riscv/kernel/process.c+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
10#include <linux/cpu.h>10#include <linux/cpu.h>
11#include <linux/kernel.h>11#include <linux/kernel.h>
12#include <linux/sched.h>12#include <linux/sched.h>
13#include <linux/sched/debug.h>
13#include <linux/sched/task_stack.h>14#include <linux/sched/task_stack.h>
14#include <linux/tick.h>15#include <linux/tick.h>
15#include <linux/ptrace.h>16#include <linux/ptrace.h>
arch/riscv/kernel/sbi.c+1−1
@@ -116,7 +116,7 @@ void sbi_clear_ipi(void) · 115 unmodified lines
116EXPORT_SYMBOL(sbi_clear_ipi);116EXPORT_SYMBOL(sbi_clear_ipi);
117 117
118/**118/**
119 * sbi_set_timer_v01() - Program the timer for next timer event.119 * __sbi_set_timer_v01() - Program the timer for next timer event.
120 * @stime_value: The value after which next timer event should fire.120 * @stime_value: The value after which next timer event should fire.
121 *121 *
122 * Return: None122 * Return: None
arch/riscv/kernel/setup.c+2−1
@@ -147,7 +147,8 @@ static void __init init_resources(void) · 146 unmodified lines
147 bss_res.end = __pa_symbol(__bss_stop) - 1;147 bss_res.end = __pa_symbol(__bss_stop) - 1;
148 bss_res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;148 bss_res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
149 149
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);
151 mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES);152 mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES);
152 if (!mem_res)153 if (!mem_res)
153 panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz);154 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
9#include <linux/delay.h>9#include <linux/delay.h>
10#include <asm/sbi.h>10#include <asm/sbi.h>
11#include <asm/processor.h>11#include <asm/processor.h>
12#include <asm/timex.h>
12 13
13unsigned long riscv_timebase;14unsigned long riscv_timebase;
14EXPORT_SYMBOL_GPL(riscv_timebase);15EXPORT_SYMBOL_GPL(riscv_timebase);
arch/riscv/kernel/traps.c+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
17#include <linux/module.h>17#include <linux/module.h>
18#include <linux/irq.h>18#include <linux/irq.h>
19 19
20#include <asm/asm-prototypes.h>
20#include <asm/bug.h>21#include <asm/bug.h>
21#include <asm/processor.h>22#include <asm/processor.h>
22#include <asm/ptrace.h>23#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
155 memset(start, KASAN_SHADOW_INIT, end - start);155 memset(start, KASAN_SHADOW_INIT, end - start);
156}156}
157 157
158void __init kasan_shallow_populate(void *start, void *end)158static void __init kasan_shallow_populate(void *start, void *end)
159{159{
160 unsigned long vaddr = (unsigned long)start & PAGE_MASK;160 unsigned long vaddr = (unsigned long)start & PAGE_MASK;
161 unsigned long vend = PAGE_ALIGN((unsigned long)end);161 unsigned long vend = PAGE_ALIGN((unsigned long)end);
@@ -187,6 +187,8 @@ void __init kasan_shallow_populate(void *start, void *end) · 25 unmodified lines
187 }187 }
188 vaddr += PAGE_SIZE;188 vaddr += PAGE_SIZE;
189 }189 }
190
191 local_flush_tlb_all();
190}192}
191 193
192void __init kasan_init(void)194void __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
202----------------------------------------------------------------------------- */202----------------------------------------------------------------------------- */
203/* Base stuff */203/* Base stuff */
204int zpci_create_device(u32 fid, u32 fh, enum zpci_state state);204int zpci_create_device(u32 fid, u32 fh, enum zpci_state state);
205void zpci_remove_device(struct zpci_dev *zdev);205void zpci_remove_device(struct zpci_dev *zdev, bool set_error);
206int zpci_enable_device(struct zpci_dev *);206int zpci_enable_device(struct zpci_dev *);
207int zpci_disable_device(struct zpci_dev *);207int zpci_disable_device(struct zpci_dev *);
208int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64);208int 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
968 */968 */
969static size_t cf_diag_needspace(unsigned int sets)969static size_t cf_diag_needspace(unsigned int sets)
970{970{
971 struct cpu_cf_events *cpuhw = this_cpu_ptr(&cpu_cf_events);971 struct cpu_cf_events *cpuhw = get_cpu_ptr(&cpu_cf_events);
972 size_t bytes = 0;972 size_t bytes = 0;
973 int i;973 int i;
974 974
@@ -984,6 +984,7 @@ static size_t cf_diag_needspace(unsigned int sets) · 9 unmodified lines
984 sizeof(((struct s390_ctrset_cpudata *)0)->no_sets));984 sizeof(((struct s390_ctrset_cpudata *)0)->no_sets));
985 debug_sprintf_event(cf_diag_dbg, 5, "%s bytes %ld\n", __func__,985 debug_sprintf_event(cf_diag_dbg, 5, "%s bytes %ld\n", __func__,
986 bytes);986 bytes);
987 put_cpu_ptr(&cpu_cf_events);
987 return bytes;988 return bytes;
988}989}
989 990
arch/s390/kernel/vtime.c+1−1
@@ -214,7 +214,7 @@ void vtime_flush(struct task_struct *tsk) · 213 unmodified lines
214 avg_steal = S390_lowcore.avg_steal_timer / 2;214 avg_steal = S390_lowcore.avg_steal_timer / 2;
215 if ((s64) steal > 0) {215 if ((s64) steal > 0) {
216 S390_lowcore.steal_timer = 0;216 S390_lowcore.steal_timer = 0;
217 account_steal_time(steal);217 account_steal_time(cputime_to_nsecs(steal));
218 avg_steal += steal;218 avg_steal += steal;
219 }219 }
220 S390_lowcore.avg_steal_timer = avg_steal;220 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
682}682}
683EXPORT_SYMBOL_GPL(zpci_disable_device);683EXPORT_SYMBOL_GPL(zpci_disable_device);
684 684
685void 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 */
694void zpci_remove_device(struct zpci_dev *zdev, bool set_error)
686{695{
687 struct zpci_bus *zbus = zdev->zbus;696 struct zpci_bus *zbus = zdev->zbus;
688 struct pci_dev *pdev;697 struct pci_dev *pdev;
689 698
699 if (!zdev->zbus->bus)
700 return;
701
690 pdev = pci_get_slot(zbus->bus, zdev->devfn);702 pdev = pci_get_slot(zbus->bus, zdev->devfn);
691 if (pdev) {703 if (pdev) {
692 if (pdev->is_virtfn)704 if (set_error)
693 return zpci_iov_remove_virtfn(pdev, zdev->vfn);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 }
694 pci_stop_and_remove_bus_device_locked(pdev);712 pci_stop_and_remove_bus_device_locked(pdev);
713 /* balance pci_get_slot */
714 pci_dev_put(pdev);
695 }715 }
696}716}
697 717
@@ -765,7 +785,7 @@ void zpci_release_device(struct kref *kref) · 67 unmodified lines
765 struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref);785 struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref);
766 786
767 if (zdev->zbus->bus)787 if (zdev->zbus->bus)
768 zpci_remove_device(zdev);788 zpci_remove_device(zdev, false);
769 789
770 switch (zdev->state) {790 switch (zdev->state) {
771 case ZPCI_FN_STATE_ONLINE:791 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
76static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)76static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
77{77{
78 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);78 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
79 struct pci_dev *pdev = NULL;
80 enum zpci_state state;79 enum zpci_state state;
80 struct pci_dev *pdev;
81 int ret;81 int ret;
82 82
83 if (zdev && zdev->zbus->bus)
84 pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn);
85
86 zpci_err("avail CCDF:\n");83 zpci_err("avail CCDF:\n");
87 zpci_err_hex(ccdf, sizeof(*ccdf));84 zpci_err_hex(ccdf, sizeof(*ccdf));
88 85
@@ -124,8 +121,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 35 unmodified lines
124 case 0x0303: /* Deconfiguration requested */121 case 0x0303: /* Deconfiguration requested */
125 if (!zdev)122 if (!zdev)
126 break;123 break;
127 if (pdev)124 zpci_remove_device(zdev, false);
128 zpci_remove_device(zdev);
129 125
130 ret = zpci_disable_device(zdev);126 ret = zpci_disable_device(zdev);
131 if (ret)127 if (ret)
@@ -140,12 +136,10 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 8 unmodified lines
140 case 0x0304: /* Configured -> Standby|Reserved */136 case 0x0304: /* Configured -> Standby|Reserved */
141 if (!zdev)137 if (!zdev)
142 break;138 break;
143 if (pdev) {139 /* Give the driver a hint that the function is
144 /* Give the driver a hint that the function is140 * already unusable.
145 * already unusable. */141 */
146 pdev->error_state = pci_channel_io_perm_failure;142 zpci_remove_device(zdev, true);
147 zpci_remove_device(zdev);
148 }
149 143
150 zdev->fh = ccdf->fh;144 zdev->fh = ccdf->fh;
151 zpci_disable_device(zdev);145 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
3659 return ret;3659 return ret;
3660 3660
3661 if (event->attr.precise_ip) {3661 if (event->attr.precise_ip) {
3662 if ((event->attr.config & INTEL_ARCH_EVENT_MASK) == INTEL_FIXED_VLBR_EVENT)
3663 return -EINVAL;
3664
3662 if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) {3665 if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) {
3663 event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;3666 event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;
3664 if (!(event->attr.sample_type &3667 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
2010 */2010 */
2011 if (!pebs_status && cpuc->pebs_enabled &&2011 if (!pebs_status && cpuc->pebs_enabled &&
2012 !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1)))2012 !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1)))
2013 pebs_status = cpuc->pebs_enabled;2013 pebs_status = p->status = cpuc->pebs_enabled;
2014 2014
2015 bit = find_first_bit((unsigned long *)&pebs_status,2015 bit = find_first_bit((unsigned long *)&pebs_status,
2016 x86_pmu.max_pebs_events);2016 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
884 u64 options;884 u64 options;
885};885};
886 886
887/* Current state of Hyper-V TSC page clocksource */
888enum 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
887/* Hyper-V emulation context */903/* Hyper-V emulation context */
888struct kvm_hv {904struct kvm_hv {
889 struct mutex hv_lock;905 struct mutex hv_lock;
890 u64 hv_guest_os_id;906 u64 hv_guest_os_id;
891 u64 hv_hypercall;907 u64 hv_hypercall;
892 u64 hv_tsc_page;908 u64 hv_tsc_page;
909 enum hv_tsc_page_status hv_tsc_page_status;
893 910
894 /* Hyper-v based guest crash (NT kernel bugcheck) parameters */911 /* Hyper-v based guest crash (NT kernel bugcheck) parameters */
895 u64 hv_crash_param[HV_X64_MSR_CRASH_PARAMS];912 u64 hv_crash_param[HV_X64_MSR_CRASH_PARAMS];
@@ -931,6 +948,12 @@ enum kvm_irqchip_mode { · 35 unmodified lines
931 KVM_IRQCHIP_SPLIT, /* created with KVM_CAP_SPLIT_IRQCHIP */948 KVM_IRQCHIP_SPLIT, /* created with KVM_CAP_SPLIT_IRQCHIP */
932};949};
933 950
951struct kvm_x86_msr_filter {
952 u8 count;
953 bool default_allow:1;
954 struct msr_bitmap_range ranges[16];
955};
956
934#define APICV_INHIBIT_REASON_DISABLE 0957#define APICV_INHIBIT_REASON_DISABLE 0
935#define APICV_INHIBIT_REASON_HYPERV 1958#define APICV_INHIBIT_REASON_HYPERV 1
936#define APICV_INHIBIT_REASON_NESTED 2959#define APICV_INHIBIT_REASON_NESTED 2
@@ -1025,16 +1048,11 @@ struct kvm_arch { · 88 unmodified lines
1025 bool guest_can_read_msr_platform_info;1048 bool guest_can_read_msr_platform_info;
1026 bool exception_payload_enabled;1049 bool exception_payload_enabled;
1027 1050
1051 bool bus_lock_detection_enabled;
1052
1028 /* Deflect RDMSR and WRMSR to user space when they trigger a #GP */1053 /* Deflect RDMSR and WRMSR to user space when they trigger a #GP */
1029 u32 user_space_msr_mask;1054 u32 user_space_msr_mask;
1030 1055 struct kvm_x86_msr_filter __rcu *msr_filter;
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;
1038 1056
1039 struct kvm_pmu_event_filter __rcu *pmu_event_filter;1057 struct kvm_pmu_event_filter __rcu *pmu_event_filter;
1040 struct task_struct *nx_lpage_recovery_thread;1058 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
551 *size = fpu_kernel_xstate_size;551 *size = fpu_kernel_xstate_size;
552}552}
553 553
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
563static inline void554static inline void
564native_load_sp0(unsigned long sp0)555native_load_sp0(unsigned long sp0)
565{556{
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
205 205
206#endif206#endif
207 207
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__
208#ifdef CONFIG_COMPAT218#ifdef CONFIG_COMPAT
209#define TS_I386_REGS_POKED 0x0004 /* regs poked by 32-bit ptracer */219#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
210#endif224#endif
211#ifndef __ASSEMBLY__
212 225
213#ifdef CONFIG_X86_32226#ifdef CONFIG_X86_32
214#define in_ia32_syscall() true227#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
2342 [0 ... NR_CPUS - 1] = -1,2342 [0 ... NR_CPUS - 1] = -1,
2343};2343};
2344 2344
2345bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
2346{
2347 return phys_id == cpuid_to_apicid[cpu];
2348}
2349
2345#ifdef CONFIG_SMP2350#ifdef CONFIG_SMP
2346/**2351/**
2347 * apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread2352 * 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
1032 if (idx >= 0 && test_bit(mp_irqs[idx].srcbus, mp_bus_not_pci)) {1032 if (idx >= 0 && test_bit(mp_irqs[idx].srcbus, mp_bus_not_pci)) {
1033 irq = mp_irqs[idx].srcbusirq;1033 irq = mp_irqs[idx].srcbusirq;
1034 legacy = mp_is_legacy_irq(irq);1034 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;
1035 }1045 }
1036 1046
1037 mutex_lock(&ioapic_mutex);1047 mutex_lock(&ioapic_mutex);
arch/x86/kernel/kprobes/ftrace.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
12 12
13#include "common.h"13#include "common.h"
14 14
15/* Ftrace callback handler for kprobes -- called under preepmt disabed */15/* Ftrace callback handler for kprobes -- called under preepmt disabled */
16void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,16void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
17 struct ftrace_ops *ops, struct ftrace_regs *fregs)17 struct ftrace_ops *ops, struct ftrace_regs *fregs)
18{18{
arch/x86/kernel/kvm.c+10−13
@@ -836,28 +836,25 @@ static void kvm_kick_cpu(int cpu) · 835 unmodified lines
836 836
837static void kvm_wait(u8 *ptr, u8 val)837static void kvm_wait(u8 *ptr, u8 val)
838{838{
839 unsigned long flags;
840
841 if (in_nmi())839 if (in_nmi())
842 return;840 return;
843 841
844 local_irq_save(flags);
845
846 if (READ_ONCE(*ptr) != val)
847 goto out;
848
849 /*842 /*
850 * halt until it's our turn and kicked. Note that we do safe halt843 * halt until it's our turn and kicked. Note that we do safe halt
851 * for irq enabled case to avoid hang when lock info is overwritten844 * for irq enabled case to avoid hang when lock info is overwritten
852 * in irq spinlock slowpath and no spurious interrupt occur to save us.845 * in irq spinlock slowpath and no spurious interrupt occur to save us.
853 */846 */
854 if (arch_irqs_disabled_flags(flags))847 if (irqs_disabled()) {
855 halt();848 if (READ_ONCE(*ptr) == val)
856 else849 halt();
857 safe_halt();850 } else {
851 local_irq_disable();
858 852
859out:853 if (READ_ONCE(*ptr) == val)
860 local_irq_restore(flags);854 safe_halt();
855
856 local_irq_enable();
857 }
861}858}
862 859
863#ifdef CONFIG_X86_32860#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
766 766
767static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)767static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)
768{768{
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 */
791#ifdef CONFIG_IA32_EMULATION769#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)
793 return __NR_ia32_restart_syscall;771 return __NR_ia32_restart_syscall;
794#endif772#endif
795#ifdef CONFIG_X86_X32_ABI773#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
520 u64 tsc;520 u64 tsc;
521 521
522 /*522 /*
523 * The guest has not set up the TSC page or the clock isn't523 * Fall back to get_kvmclock_ns() when TSC page hasn't been set up,
524 * stable, fall back to get_kvmclock_ns.524 * is broken, disabled or being updated.
525 */525 */
526 if (!hv->tsc_ref.tsc_sequence)526 if (hv->hv_tsc_page_status != HV_TSC_PAGE_SET)
527 return div_u64(get_kvmclock_ns(kvm), 100);527 return div_u64(get_kvmclock_ns(kvm), 100);
528 528
529 vcpu = kvm_get_vcpu(kvm, 0);529 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
1077 return true;1077 return true;
1078}1078}
1079 1079
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 */
1089static 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
1080void kvm_hv_setup_tsc_page(struct kvm *kvm,1095void kvm_hv_setup_tsc_page(struct kvm *kvm,
1081 struct pvclock_vcpu_time_info *hv_clock)1096 struct pvclock_vcpu_time_info *hv_clock)
1082{1097{
@@ -1087,7 +1102,8 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 4 unmodified lines
1087 BUILD_BUG_ON(sizeof(tsc_seq) != sizeof(hv->tsc_ref.tsc_sequence));1102 BUILD_BUG_ON(sizeof(tsc_seq) != sizeof(hv->tsc_ref.tsc_sequence));
1088 BUILD_BUG_ON(offsetof(struct ms_hyperv_tsc_page, tsc_sequence) != 0);1103 BUILD_BUG_ON(offsetof(struct ms_hyperv_tsc_page, tsc_sequence) != 0);
1089 1104
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)
1091 return;1107 return;
1092 1108
1093 mutex_lock(&hv->hv_lock);1109 mutex_lock(&hv->hv_lock);
@@ -1101,7 +1117,15 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 7 unmodified lines
1101 */1117 */
1102 if (unlikely(kvm_read_guest(kvm, gfn_to_gpa(gfn),1118 if (unlikely(kvm_read_guest(kvm, gfn_to_gpa(gfn),
1103 &tsc_seq, sizeof(tsc_seq))))1119 &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;
1104 goto out_unlock;1127 goto out_unlock;
1128 }
1105 1129
1106 /*1130 /*
1107 * While we're computing and writing the parameters, force the1131 * 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
1110 hv->tsc_ref.tsc_sequence = 0;1134 hv->tsc_ref.tsc_sequence = 0;
1111 if (kvm_write_guest(kvm, gfn_to_gpa(gfn),1135 if (kvm_write_guest(kvm, gfn_to_gpa(gfn),
1112 &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence)))1136 &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence)))
1113 goto out_unlock;1137 goto out_err;
1114 1138
1115 if (!compute_tsc_page_parameters(hv_clock, &hv->tsc_ref))1139 if (!compute_tsc_page_parameters(hv_clock, &hv->tsc_ref))
1116 goto out_unlock;1140 goto out_err;
1117 1141
1118 /* Ensure sequence is zero before writing the rest of the struct. */1142 /* Ensure sequence is zero before writing the rest of the struct. */
1119 smp_wmb();1143 smp_wmb();
1120 if (kvm_write_guest(kvm, gfn_to_gpa(gfn), &hv->tsc_ref, sizeof(hv->tsc_ref)))1144 if (kvm_write_guest(kvm, gfn_to_gpa(gfn), &hv->tsc_ref, sizeof(hv->tsc_ref)))
1121 goto out_unlock;1145 goto out_err;
1122 1146
1123 /*1147 /*
1124 * Now switch to the TSC page mechanism by writing the sequence.1148 * 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
1131 smp_wmb();1155 smp_wmb();
1132 1156
1133 hv->tsc_ref.tsc_sequence = tsc_seq;1157 hv->tsc_ref.tsc_sequence = tsc_seq;
1134 kvm_write_guest(kvm, gfn_to_gpa(gfn),1158 if (kvm_write_guest(kvm, gfn_to_gpa(gfn),
1135 &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence));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
1165out_err:
1166 hv->hv_tsc_page_status = HV_TSC_PAGE_BROKEN;
1167out_unlock:
1168 mutex_unlock(&hv->hv_lock);
1169}
1170
1171void 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
1136out_unlock:1197out_unlock:
1137 mutex_unlock(&hv->hv_lock);1198 mutex_unlock(&hv->hv_lock);
1138}1199}
@@ -1193,8 +1254,15 @@ static int kvm_hv_set_msr_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data, · 54 unmodified lines
1193 }1254 }
1194 case HV_X64_MSR_REFERENCE_TSC:1255 case HV_X64_MSR_REFERENCE_TSC:
1195 hv->hv_tsc_page = data;1256 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;
1197 kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);1262 kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);
1263 } else {
1264 hv->hv_tsc_page_status = HV_TSC_PAGE_UNSET;
1265 }
1198 break;1266 break;
1199 case HV_X64_MSR_CRASH_P0 ... HV_X64_MSR_CRASH_P4:1267 case HV_X64_MSR_CRASH_P0 ... HV_X64_MSR_CRASH_P4:
1200 return kvm_hv_msr_set_crash_data(kvm,1268 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
1229 hv->hv_tsc_emulation_control = data;1297 hv->hv_tsc_emulation_control = data;
1230 break;1298 break;
1231 case HV_X64_MSR_TSC_EMULATION_STATUS:1299 case HV_X64_MSR_TSC_EMULATION_STATUS:
1300 if (data && !host)
1301 return 1;
1302
1232 hv->hv_tsc_emulation_status = data;1303 hv->hv_tsc_emulation_status = data;
1233 break;1304 break;
1234 case HV_X64_MSR_TIME_REF_COUNT:1305 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
133 133
134void kvm_hv_setup_tsc_page(struct kvm *kvm,134void kvm_hv_setup_tsc_page(struct kvm *kvm,
135 struct pvclock_vcpu_time_info *hv_clock);135 struct pvclock_vcpu_time_info *hv_clock);
136void kvm_hv_invalidate_tsc_page(struct kvm *kvm);
136 137
137void kvm_hv_init_vm(struct kvm *kvm);138void kvm_hv_init_vm(struct kvm *kvm);
138void kvm_hv_destroy_vm(struct kvm *kvm);139void 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
78 return to_shadow_page(__pa(sptep));78 return to_shadow_page(__pa(sptep));
79}79}
80 80
81static inline int kvm_mmu_page_as_id(struct kvm_mmu_page *sp)
82{
83 return sp->role.smm ? 1 : 0;
84}
85
81static inline bool kvm_vcpu_ad_need_write_protect(struct kvm_vcpu *vcpu)86static inline bool kvm_vcpu_ad_need_write_protect(struct kvm_vcpu *vcpu)
82{87{
83 /*88 /*
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
20 return gfn & -KVM_PAGES_PER_HPAGE(level);20 return gfn & -KVM_PAGES_PER_HPAGE(level);
21}21}
22 22
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 */
27void 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
23/*38/*
24 * Sets a TDP iterator to walk a pre-order traversal of the paging structure39 * Sets a TDP iterator to walk a pre-order traversal of the paging structure
25 * rooted at root_pt, starting with the walk to translate next_last_level_gfn.40 * 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
31 WARN_ON(root_level > PT64_ROOT_MAX_LEVEL);46 WARN_ON(root_level > PT64_ROOT_MAX_LEVEL);
32 47
33 iter->next_last_level_gfn = next_last_level_gfn;48 iter->next_last_level_gfn = next_last_level_gfn;
34 iter->yielded_gfn = iter->next_last_level_gfn;
35 iter->root_level = root_level;49 iter->root_level = root_level;
36 iter->min_level = min_level;50 iter->min_level = min_level;
37 iter->level = root_level;51 iter->pt_path[iter->root_level - 1] = (tdp_ptep_t)root_pt;
38 iter->pt_path[iter->level - 1] = (tdp_ptep_t)root_pt;52 iter->as_id = kvm_mmu_page_as_id(sptep_to_sp(root_pt));
39
40 iter->gfn = round_gfn_for_level(iter->next_last_level_gfn, iter->level);
41 tdp_iter_refresh_sptep(iter);
42 53
43 iter->valid = true;54 tdp_iter_restart(iter);
44}55}
45 56
46/*57/*
@@ -159,8 +170,3 @@ void tdp_iter_next(struct tdp_iter *iter) · 112 unmodified lines
159 iter->valid = false;170 iter->valid = false;
160}171}
161 172
162tdp_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
36 int min_level;36 int min_level;
37 /* The iterator's current level within the paging structure */37 /* The iterator's current level within the paging structure */
38 int level;38 int level;
39 /* The address space ID, i.e. SMM vs. regular. */
40 int as_id;
39 /* A snapshot of the value at sptep */41 /* A snapshot of the value at sptep */
40 u64 old_spte;42 u64 old_spte;
41 /*43 /*
@@ -62,6 +64,6 @@ tdp_ptep_t spte_to_child_pt(u64 pte, int level); · 20 unmodified lines
62void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level,64void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level,
63 int min_level, gfn_t next_last_level_gfn);65 int min_level, gfn_t next_last_level_gfn);
64void tdp_iter_next(struct tdp_iter *iter);66void tdp_iter_next(struct tdp_iter *iter);
65tdp_ptep_t tdp_iter_root_pt(struct tdp_iter *iter);67void tdp_iter_restart(struct tdp_iter *iter);
66 68
67#endif /* __KVM_X86_MMU_TDP_ITER_H */69#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
203 u64 old_spte, u64 new_spte, int level,203 u64 old_spte, u64 new_spte, int level,
204 bool shared);204 bool shared);
205 205
206static int kvm_mmu_page_as_id(struct kvm_mmu_page *sp)
207{
208 return sp->role.smm ? 1 : 0;
209}
210
211static void handle_changed_spte_acc_track(u64 old_spte, u64 new_spte, int level)206static void handle_changed_spte_acc_track(u64 old_spte, u64 new_spte, int level)
212{207{
213 bool pfn_changed = spte_to_pfn(old_spte) != spte_to_pfn(new_spte);208 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
301 *296 *
302 * Given a page table that has been removed from the TDP paging structure,297 * Given a page table that has been removed from the TDP paging structure,
303 * iterates through the page table to clear SPTEs and free child page tables.298 * 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.
304 */304 */
305static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt,305static void handle_removed_tdp_mmu_page(struct kvm *kvm, tdp_ptep_t pt,
306 bool shared)306 bool shared)
307{307{
308 struct kvm_mmu_page *sp = sptep_to_sp(pt);308 struct kvm_mmu_page *sp = sptep_to_sp(rcu_dereference(pt));
309 int level = sp->role.level;309 int level = sp->role.level;
310 gfn_t base_gfn = sp->gfn;310 gfn_t base_gfn = sp->gfn;
311 u64 old_child_spte;311 u64 old_child_spte;
@@ -318,7 +318,7 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt, · 6 unmodified lines
318 tdp_mmu_unlink_page(kvm, sp, shared);318 tdp_mmu_unlink_page(kvm, sp, shared);
319 319
320 for (i = 0; i < PT64_ENT_PER_PAGE; i++) {320 for (i = 0; i < PT64_ENT_PER_PAGE; i++) {
321 sptep = pt + i;321 sptep = rcu_dereference(pt) + i;
322 gfn = base_gfn + (i * KVM_PAGES_PER_HPAGE(level - 1));322 gfn = base_gfn + (i * KVM_PAGES_PER_HPAGE(level - 1));
323 323
324 if (shared) {324 if (shared) {
@@ -492,10 +492,6 @@ static inline bool tdp_mmu_set_spte_atomic(struct kvm *kvm, · 167 unmodified lines
492 struct tdp_iter *iter,492 struct tdp_iter *iter,
493 u64 new_spte)493 u64 new_spte)
494{494{
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
499 lockdep_assert_held_read(&kvm->mmu_lock);495 lockdep_assert_held_read(&kvm->mmu_lock);
500 496
501 /*497 /*
@@ -509,8 +505,8 @@ static inline bool tdp_mmu_set_spte_atomic(struct kvm *kvm, · 7 unmodified lines
509 new_spte) != iter->old_spte)505 new_spte) != iter->old_spte)
510 return false;506 return false;
511 507
512 handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte,508 handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte,
513 iter->level, true);509 new_spte, iter->level, true);
514 510
515 return true;511 return true;
516}512}
@@ -538,7 +534,7 @@ static inline bool tdp_mmu_zap_spte_atomic(struct kvm *kvm, · 21 unmodified lines
538 * here since the SPTE is going from non-present534 * here since the SPTE is going from non-present
539 * to non-present.535 * to non-present.
540 */536 */
541 WRITE_ONCE(*iter->sptep, 0);537 WRITE_ONCE(*rcu_dereference(iter->sptep), 0);
542 538
543 return true;539 return true;
544}540}
@@ -564,10 +560,6 @@ static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter, · 19 unmodified lines
564 u64 new_spte, bool record_acc_track,560 u64 new_spte, bool record_acc_track,
565 bool record_dirty_log)561 bool record_dirty_log)
566{562{
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
571 lockdep_assert_held_write(&kvm->mmu_lock);563 lockdep_assert_held_write(&kvm->mmu_lock);
572 564
573 /*565 /*
@@ -581,13 +573,13 @@ static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter, · 7 unmodified lines
581 573
582 WRITE_ONCE(*rcu_dereference(iter->sptep), new_spte);574 WRITE_ONCE(*rcu_dereference(iter->sptep), new_spte);
583 575
584 __handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte,576 __handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte,
585 iter->level, false);577 new_spte, iter->level, false);
586 if (record_acc_track)578 if (record_acc_track)
587 handle_changed_spte_acc_track(iter->old_spte, new_spte,579 handle_changed_spte_acc_track(iter->old_spte, new_spte,
588 iter->level);580 iter->level);
589 if (record_dirty_log)581 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,
591 iter->old_spte, new_spte,583 iter->old_spte, new_spte,
592 iter->level);584 iter->level);
593}585}
@@ -659,9 +651,7 @@ static inline bool tdp_mmu_iter_cond_resched(struct kvm *kvm, · 65 unmodified lines
659 651
660 WARN_ON(iter->gfn > iter->next_last_level_gfn);652 WARN_ON(iter->gfn > iter->next_last_level_gfn);
661 653
662 tdp_iter_start(iter, iter->pt_path[iter->root_level - 1],654 tdp_iter_restart(iter);
663 iter->root_level, iter->min_level,
664 iter->next_last_level_gfn);
665 655
666 return true;656 return true;
667 }657 }
arch/x86/kvm/x86.c+68−45
@@ -1526,35 +1526,44 @@ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits); · 1525 unmodified lines
1526 1526
1527bool kvm_msr_allowed(struct kvm_vcpu *vcpu, u32 index, u32 type)1527bool kvm_msr_allowed(struct kvm_vcpu *vcpu, u32 index, u32 type)
1528{1528{
1529 struct kvm_x86_msr_filter *msr_filter;
1530 struct msr_bitmap_range *ranges;
1529 struct kvm *kvm = vcpu->kvm;1531 struct kvm *kvm = vcpu->kvm;
1530 struct msr_bitmap_range *ranges = kvm->arch.msr_filter.ranges;1532 bool allowed;
1531 u32 count = kvm->arch.msr_filter.count;
1532 u32 i;
1533 bool r = kvm->arch.msr_filter.default_allow;
1534 int idx;1533 int idx;
1534 u32 i;
1535 1535
1536 /* MSR filtering not set up or x2APIC enabled, allow everything */1536 /* x2APIC MSRs do not support filtering. */
1537 if (!count || (index >= 0x800 && index <= 0x8ff))1537 if (index >= 0x800 && index <= 0x8ff)
1538 return true;1538 return true;
1539 1539
1540 /* Prevent collision with set_msr_filter */
1541 idx = srcu_read_lock(&kvm->srcu);1540 idx = srcu_read_lock(&kvm->srcu);
1542 1541
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++) {
1544 u32 start = ranges[i].base;1552 u32 start = ranges[i].base;
1545 u32 end = start + ranges[i].nmsrs;1553 u32 end = start + ranges[i].nmsrs;
1546 u32 flags = ranges[i].flags;1554 u32 flags = ranges[i].flags;
1547 unsigned long *bitmap = ranges[i].bitmap;1555 unsigned long *bitmap = ranges[i].bitmap;
1548 1556
1549 if ((index >= start) && (index < end) && (flags & type)) {1557 if ((index >= start) && (index < end) && (flags & type)) {
1550 r = !!test_bit(index - start, bitmap);1558 allowed = !!test_bit(index - start, bitmap);
1551 break;1559 break;
1552 }1560 }
1553 }1561 }
1554 1562
1563out:
1555 srcu_read_unlock(&kvm->srcu, idx);1564 srcu_read_unlock(&kvm->srcu, idx);
1556 1565
1557 return r;1566 return allowed;
1558}1567}
1559EXPORT_SYMBOL_GPL(kvm_msr_allowed);1568EXPORT_SYMBOL_GPL(kvm_msr_allowed);
1560 1569
@@ -2551,6 +2560,8 @@ static void kvm_gen_update_masterclock(struct kvm *kvm) · 990 unmodified lines
2551 struct kvm_vcpu *vcpu;2560 struct kvm_vcpu *vcpu;
2552 struct kvm_arch *ka = &kvm->arch;2561 struct kvm_arch *ka = &kvm->arch;
2553 2562
2563 kvm_hv_invalidate_tsc_page(kvm);
2564
2554 spin_lock(&ka->pvclock_gtod_sync_lock);2565 spin_lock(&ka->pvclock_gtod_sync_lock);
2555 kvm_make_mclock_inprogress_request(kvm);2566 kvm_make_mclock_inprogress_request(kvm);
2556 /* no guest entries from this point */2567 /* no guest entries from this point */
@@ -5352,25 +5363,34 @@ split_irqchip_unlock: · 2795 unmodified lines
5352 return r;5363 return r;
5353}5364}
5354 5365
5355static void kvm_clear_msr_filter(struct kvm *kvm)5366static 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
5378static void kvm_free_msr_filter(struct kvm_x86_msr_filter *msr_filter)
5356{5379{
5357 u32 i;5380 u32 i;
5358 u32 count = kvm->arch.msr_filter.count;
5359 struct msr_bitmap_range ranges[16];
5360 5381
5361 mutex_lock(&kvm->lock);5382 if (!msr_filter)
5362 kvm->arch.msr_filter.count = 0;5383 return;
5363 memcpy(ranges, kvm->arch.msr_filter.ranges, count * sizeof(ranges[0]));
5364 mutex_unlock(&kvm->lock);
5365 synchronize_srcu(&kvm->srcu);
5366 5384
5367 for (i = 0; i < count; i++)5385 for (i = 0; i < msr_filter->count; i++)
5368 kfree(ranges[i].bitmap);5386 kfree(msr_filter->ranges[i].bitmap);
5387
5388 kfree(msr_filter);
5369}5389}
5370 5390
5371static int kvm_add_msr_filter(struct kvm *kvm, struct kvm_msr_filter_range *user_range)5391static int kvm_add_msr_filter(struct kvm_x86_msr_filter *msr_filter,
5392 struct kvm_msr_filter_range *user_range)
5372{5393{
5373 struct msr_bitmap_range *ranges = kvm->arch.msr_filter.ranges;
5374 struct msr_bitmap_range range;5394 struct msr_bitmap_range range;
5375 unsigned long *bitmap = NULL;5395 unsigned long *bitmap = NULL;
5376 size_t bitmap_size;5396 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
5404 goto err;5424 goto err;
5405 }5425 }
5406 5426
5407 /* Everything ok, add this range identifier to our global pool */5427 /* Everything ok, add this range identifier. */
5408 ranges[kvm->arch.msr_filter.count] = range;5428 msr_filter->ranges[msr_filter->count] = range;
5409 /* Make sure we filled the array before we tell anyone to walk it */5429 msr_filter->count++;
5410 smp_wmb();
5411 kvm->arch.msr_filter.count++;
5412 5430
5413 return 0;5431 return 0;
5414err:5432err:
@@ -5419,10 +5437,11 @@ err: · 4 unmodified lines
5419static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp)5437static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp)
5420{5438{
5421 struct kvm_msr_filter __user *user_msr_filter = argp;5439 struct kvm_msr_filter __user *user_msr_filter = argp;
5440 struct kvm_x86_msr_filter *new_filter, *old_filter;
5422 struct kvm_msr_filter filter;5441 struct kvm_msr_filter filter;
5423 bool default_allow;5442 bool default_allow;
5424 int r = 0;
5425 bool empty = true;5443 bool empty = true;
5444 int r = 0;
5426 u32 i;5445 u32 i;
5427 5446
5428 if (copy_from_user(&filter, user_msr_filter, sizeof(filter)))5447 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
5435 if (empty && !default_allow)5454 if (empty && !default_allow)
5436 return -EINVAL;5455 return -EINVAL;
5437 5456
5438 kvm_clear_msr_filter(kvm);5457 new_filter = kvm_alloc_msr_filter(default_allow);
5439 5458 if (!new_filter)
5440 kvm->arch.msr_filter.default_allow = default_allow;5459 return -ENOMEM;
5441 5460
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);
5447 for (i = 0; i < ARRAY_SIZE(filter.ranges); i++) {5461 for (i = 0; i < ARRAY_SIZE(filter.ranges); i++) {
5448 r = kvm_add_msr_filter(kvm, &filter.ranges[i]);5462 r = kvm_add_msr_filter(new_filter, &filter.ranges[i]);
5449 if (r)5463 if (r) {
5450 break;5464 kvm_free_msr_filter(new_filter);
5465 return r;
5466 }
5451 }5467 }
5452 5468
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
5453 kvm_make_all_cpus_request(kvm, KVM_REQ_MSR_FILTER_CHANGED);5479 kvm_make_all_cpus_request(kvm, KVM_REQ_MSR_FILTER_CHANGED);
5454 mutex_unlock(&kvm->lock);5480 mutex_unlock(&kvm->lock);
5455 5481
5456 return r;5482 return 0;
5457}5483}
5458 5484
5459long kvm_arch_vm_ioctl(struct file *filp,5485long kvm_arch_vm_ioctl(struct file *filp,
@@ -6603,7 +6629,7 @@ static int kvm_emulate_wbinvd_noskip(struct kvm_vcpu *vcpu) · 1143 unmodified lines
6603 int cpu = get_cpu();6629 int cpu = get_cpu();
6604 6630
6605 cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask);6631 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,
6607 wbinvd_ipi, NULL, 1);6633 wbinvd_ipi, NULL, 1);
6608 put_cpu();6634 put_cpu();
6609 cpumask_clear(vcpu->arch.wbinvd_dirty_mask);6635 cpumask_clear(vcpu->arch.wbinvd_dirty_mask);
@@ -10634,8 +10660,6 @@ void kvm_arch_pre_destroy_vm(struct kvm *kvm) · 4024 unmodified lines
10634 10660
10635void kvm_arch_destroy_vm(struct kvm *kvm)10661void kvm_arch_destroy_vm(struct kvm *kvm)
10636{10662{
10637 u32 i;
10638
10639 if (current->mm == kvm->mm) {10663 if (current->mm == kvm->mm) {
10640 /*10664 /*
10641 * Free memory regions allocated on behalf of userspace,10665 * Free memory regions allocated on behalf of userspace,
@@ -10651,8 +10675,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) · 9 unmodified lines
10651 mutex_unlock(&kvm->slots_lock);10675 mutex_unlock(&kvm->slots_lock);
10652 }10676 }
10653 static_call_cond(kvm_x86_vm_destroy)(kvm);10677 static_call_cond(kvm_x86_vm_destroy)(kvm);
10654 for (i = 0; i < kvm->arch.msr_filter.count; i++)10678 kvm_free_msr_filter(srcu_dereference_check(kvm->arch.msr_filter, &kvm->srcu, 1));
10655 kfree(kvm->arch.msr_filter.ranges[i].bitmap);
10656 kvm_pic_destroy(kvm);10679 kvm_pic_destroy(kvm);
10657 kvm_ioapic_destroy(kvm);10680 kvm_ioapic_destroy(kvm);
10658 kvm_free_vcpus(kvm);10681 kvm_free_vcpus(kvm);
arch/x86/platform/iris/iris.c+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
27MODULE_LICENSE("GPL");27MODULE_LICENSE("GPL");
28MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>");28MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>");
29MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille");29MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille");
30MODULE_SUPPORTED_DEVICE("Eurobraille/Iris");
31 30
32static bool force;31static bool force;
33 32
drivers/atm/fore200e.c+0−2
@@ -100,8 +100,6 @@ static LIST_HEAD(fore200e_boards); · 99 unmodified lines
100 100
101MODULE_AUTHOR("Christophe Lizzi - credits to Uwe Dannowski and Heikki Vatiainen");101MODULE_AUTHOR("Christophe Lizzi - credits to Uwe Dannowski and Heikki Vatiainen");
102MODULE_DESCRIPTION("FORE Systems 200E-series ATM driver - version " FORE200E_VERSION);102MODULE_DESCRIPTION("FORE Systems 200E-series ATM driver - version " FORE200E_VERSION);
103MODULE_SUPPORTED_DEVICE("PCA-200E, SBA-200E");
104
105 103
106static const int fore200e_rx_buf_nbr[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ] = {104static const int fore200e_rx_buf_nbr[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ] = {
107 { BUFFER_S1_NBR, BUFFER_L1_NBR },105 { 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
325static int __rpm_callback(int (*cb)(struct device *), struct device *dev)325static int __rpm_callback(int (*cb)(struct device *), struct device *dev)
326 __releases(&dev->power.lock) __acquires(&dev->power.lock)326 __releases(&dev->power.lock) __acquires(&dev->power.lock)
327{327{
328 bool use_links = dev->power.links_count > 0;
329 bool get = false;
330 int retval, idx;328 int retval, idx;
331 bool put;329 bool use_links = dev->power.links_count > 0;
332 330
333 if (dev->power.irq_safe) {331 if (dev->power.irq_safe) {
334 spin_unlock(&dev->power.lock);332 spin_unlock(&dev->power.lock);
335 } else if (!use_links) {
336 spin_unlock_irq(&dev->power.lock);
337 } else {333 } else {
338 get = dev->power.runtime_status == RPM_RESUMING;
339
340 spin_unlock_irq(&dev->power.lock);334 spin_unlock_irq(&dev->power.lock);
341 335
342 /* Resume suppliers if necessary. */336 /*
343 if (get) {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) {
344 idx = device_links_read_lock();344 idx = device_links_read_lock();
345 345
346 retval = rpm_get_suppliers(dev);346 retval = rpm_get_suppliers(dev);
@@ -355,36 +355,24 @@ static int __rpm_callback(int (*cb)(struct device *), struct device *dev) · 8 unmodified lines
355 355
356 if (dev->power.irq_safe) {356 if (dev->power.irq_safe) {
357 spin_lock(&dev->power.lock);357 spin_lock(&dev->power.lock);
358 return retval;358 } else {
359 }359 /*
360 360 * If the device is suspending and the callback has returned
361 spin_lock_irq(&dev->power.lock);361 * success, drop the usage counters of the suppliers that have
362 362 * been reference counted on its resume.
363 if (!use_links)363 *
364 return retval;364 * Do that if resume fails too.
365 365 */
366 /*366 if (use_links
367 * If the device is suspending and the callback has returned success,367 && ((dev->power.runtime_status == RPM_SUSPENDING && !retval)
368 * drop the usage counters of the suppliers that have been reference368 || (dev->power.runtime_status == RPM_RESUMING && retval))) {
369 * counted on its resume.369 idx = device_links_read_lock();
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();
383 370
384fail:371 fail:
385 rpm_put_suppliers(dev);372 rpm_put_suppliers(dev);
386 373
387 device_links_read_unlock(idx);374 device_links_read_unlock(idx);
375 }
388 376
389 spin_lock_irq(&dev->power.lock);377 spin_lock_irq(&dev->power.lock);
390 }378 }
drivers/block/floppy.c+0−1
@@ -5091,7 +5091,6 @@ module_param(floppy, charp, 0); · 5090 unmodified lines
5091module_param(FLOPPY_IRQ, int, 0);5091module_param(FLOPPY_IRQ, int, 0);
5092module_param(FLOPPY_DMA, int, 0);5092module_param(FLOPPY_DMA, int, 0);
5093MODULE_AUTHOR("Alain L. Knaff");5093MODULE_AUTHOR("Alain L. Knaff");
5094MODULE_SUPPORTED_DEVICE("fd");
5095MODULE_LICENSE("GPL");5094MODULE_LICENSE("GPL");
5096 5095
5097/* This doesn't actually get used other than for module information */5096/* 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
194module_exit(rsi_91x_bt_module_exit);194module_exit(rsi_91x_bt_module_exit);
195MODULE_AUTHOR("Redpine Signals Inc");195MODULE_AUTHOR("Redpine Signals Inc");
196MODULE_DESCRIPTION("RSI BT driver");196MODULE_DESCRIPTION("RSI BT driver");
197MODULE_SUPPORTED_DEVICE("RSI-BT");
198MODULE_LICENSE("Dual BSD/GPL");197MODULE_LICENSE("Dual BSD/GPL");
drivers/char/applicom.c+0−3
@@ -81,9 +81,6 @@ MODULE_DESCRIPTION("Driver for Applicom Profibus card"); · 80 unmodified lines
81MODULE_LICENSE("GPL");81MODULE_LICENSE("GPL");
82MODULE_ALIAS_MISCDEV(AC_MINOR);82MODULE_ALIAS_MISCDEV(AC_MINOR);
83 83
84MODULE_SUPPORTED_DEVICE("ac");
85
86
87static struct applicom_board {84static struct applicom_board {
88 unsigned long PhysIO;85 unsigned long PhysIO;
89 void __iomem *RamIO;86 void __iomem *RamIO;
drivers/char/toshiba.c+0−1
@@ -64,7 +64,6 @@ · 63 unmodified lines
64MODULE_LICENSE("GPL");64MODULE_LICENSE("GPL");
65MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>");65MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>");
66MODULE_DESCRIPTION("Toshiba laptop SMM driver");66MODULE_DESCRIPTION("Toshiba laptop SMM driver");
67MODULE_SUPPORTED_DEVICE("toshiba");
68 67
69static DEFINE_MUTEX(tosh_mutex);68static DEFINE_MUTEX(tosh_mutex);
70static int tosh_fn;69static int tosh_fn;
drivers/counter/stm32-timer-cnt.c+33−22
@@ -31,7 +31,7 @@ struct stm32_timer_cnt { · 30 unmodified lines
31 struct counter_device counter;31 struct counter_device counter;
32 struct regmap *regmap;32 struct regmap *regmap;
33 struct clk *clk;33 struct clk *clk;
34 u32 ceiling;34 u32 max_arr;
35 bool enabled;35 bool enabled;
36 struct stm32_timer_regs bak;36 struct stm32_timer_regs bak;
37};37};
@@ -44,13 +44,14 @@ struct stm32_timer_cnt { · 6 unmodified lines
44 * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges44 * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges
45 */45 */
46enum stm32_count_function {46enum stm32_count_function {
47 STM32_COUNT_SLAVE_MODE_DISABLED = -1,47 STM32_COUNT_SLAVE_MODE_DISABLED,
48 STM32_COUNT_ENCODER_MODE_1,48 STM32_COUNT_ENCODER_MODE_1,
49 STM32_COUNT_ENCODER_MODE_2,49 STM32_COUNT_ENCODER_MODE_2,
50 STM32_COUNT_ENCODER_MODE_3,50 STM32_COUNT_ENCODER_MODE_3,
51};51};
52 52
53static enum counter_count_function stm32_count_functions[] = {53static enum counter_count_function stm32_count_functions[] = {
54 [STM32_COUNT_SLAVE_MODE_DISABLED] = COUNTER_COUNT_FUNCTION_INCREASE,
54 [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A,55 [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A,
55 [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B,56 [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B,
56 [STM32_COUNT_ENCODER_MODE_3] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4,57 [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
73 const unsigned long val)74 const unsigned long val)
74{75{
75 struct stm32_timer_cnt *const priv = counter->priv;76 struct stm32_timer_cnt *const priv = counter->priv;
77 u32 ceiling;
76 78
77 if (val > priv->ceiling)79 regmap_read(priv->regmap, TIM_ARR, &ceiling);
80 if (val > ceiling)
78 return -EINVAL;81 return -EINVAL;
79 82
80 return regmap_write(priv->regmap, TIM_CNT, val);83 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
90 regmap_read(priv->regmap, TIM_SMCR, &smcr);93 regmap_read(priv->regmap, TIM_SMCR, &smcr);
91 94
92 switch (smcr & TIM_SMCR_SMS) {95 switch (smcr & TIM_SMCR_SMS) {
96 case 0:
97 *function = STM32_COUNT_SLAVE_MODE_DISABLED;
98 return 0;
93 case 1:99 case 1:
94 *function = STM32_COUNT_ENCODER_MODE_1;100 *function = STM32_COUNT_ENCODER_MODE_1;
95 return 0;101 return 0;
@@ -99,9 +105,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 3 unmodified lines
99 case 3:105 case 3:
100 *function = STM32_COUNT_ENCODER_MODE_3;106 *function = STM32_COUNT_ENCODER_MODE_3;
101 return 0;107 return 0;
108 default:
109 return -EINVAL;
102 }110 }
103
104 return -EINVAL;
105}111}
106 112
107static int stm32_count_function_set(struct counter_device *counter,113static 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
112 u32 cr1, sms;118 u32 cr1, sms;
113 119
114 switch (function) {120 switch (function) {
121 case STM32_COUNT_SLAVE_MODE_DISABLED:
122 sms = 0;
123 break;
115 case STM32_COUNT_ENCODER_MODE_1:124 case STM32_COUNT_ENCODER_MODE_1:
116 sms = 1;125 sms = 1;
117 break;126 break;
@@ -122,8 +131,7 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines
122 sms = 3;131 sms = 3;
123 break;132 break;
124 default:133 default:
125 sms = 0;134 return -EINVAL;
126 break;
127 }135 }
128 136
129 /* Store enable status */137 /* Store enable status */
@@ -131,10 +139,6 @@ static int stm32_count_function_set(struct counter_device *counter, · 1 unmodified line
131 139
132 regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0);140 regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0);
133 141
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
138 regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms);142 regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms);
139 143
140 /* Make sure that registers are updated */144 /* Make sure that registers are updated */
@@ -185,11 +189,13 @@ static ssize_t stm32_count_ceiling_write(struct counter_device *counter, · 44 unmodified lines
185 if (ret)189 if (ret)
186 return ret;190 return ret;
187 191
192 if (ceiling > priv->max_arr)
193 return -ERANGE;
194
188 /* TIMx_ARR register shouldn't be buffered (ARPE=0) */195 /* TIMx_ARR register shouldn't be buffered (ARPE=0) */
189 regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0);196 regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0);
190 regmap_write(priv->regmap, TIM_ARR, ceiling);197 regmap_write(priv->regmap, TIM_ARR, ceiling);
191 198
192 priv->ceiling = ceiling;
193 return len;199 return len;
194}200}
195 201
@@ -274,31 +280,36 @@ static int stm32_action_get(struct counter_device *counter, · 78 unmodified lines
274 size_t function;280 size_t function;
275 int err;281 int err;
276 282
277 /* Default action mode (e.g. STM32_COUNT_SLAVE_MODE_DISABLED) */
278 *action = STM32_SYNAPSE_ACTION_NONE;
279
280 err = stm32_count_function_get(counter, count, &function);283 err = stm32_count_function_get(counter, count, &function);
281 if (err)284 if (err)
282 return 0;285 return err;
283 286
284 switch (function) {287 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;
285 case STM32_COUNT_ENCODER_MODE_1:292 case STM32_COUNT_ENCODER_MODE_1:
286 /* counts up/down on TI1FP1 edge depending on TI2FP2 level */293 /* counts up/down on TI1FP1 edge depending on TI2FP2 level */
287 if (synapse->signal->id == count->synapses[0].signal->id)294 if (synapse->signal->id == count->synapses[0].signal->id)
288 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;295 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;
289 break;296 else
297 *action = STM32_SYNAPSE_ACTION_NONE;
298 return 0;
290 case STM32_COUNT_ENCODER_MODE_2:299 case STM32_COUNT_ENCODER_MODE_2:
291 /* counts up/down on TI2FP2 edge depending on TI1FP1 level */300 /* counts up/down on TI2FP2 edge depending on TI1FP1 level */
292 if (synapse->signal->id == count->synapses[1].signal->id)301 if (synapse->signal->id == count->synapses[1].signal->id)
293 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;302 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;
294 break;303 else
304 *action = STM32_SYNAPSE_ACTION_NONE;
305 return 0;
295 case STM32_COUNT_ENCODER_MODE_3:306 case STM32_COUNT_ENCODER_MODE_3:
296 /* counts up/down on both TI1FP1 and TI2FP2 edges */307 /* counts up/down on both TI1FP1 and TI2FP2 edges */
297 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;308 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;
298 break;309 return 0;
310 default:
311 return -EINVAL;
299 }312 }
300
301 return 0;
302}313}
303 314
304static const struct counter_ops stm32_timer_cnt_ops = {315static 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
359 370
360 priv->regmap = ddata->regmap;371 priv->regmap = ddata->regmap;
361 priv->clk = ddata->clk;372 priv->clk = ddata->clk;
362 priv->ceiling = ddata->max_arr;373 priv->max_arr = ddata->max_arr;
363 374
364 priv->counter.name = dev_name(dev);375 priv->counter.name = dev_name(dev);
365 priv->counter.parent = dev;376 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
927 }927 }
928 928
929 /* first try to find a slot in an existing linked list entry */929 /* 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; ) {
931 rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB);931 rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB);
932 index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size);932 index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size);
933 if (index < rsv->size) {933 if (index < rsv->size) {
@@ -937,6 +937,7 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size) · 3 unmodified lines
937 memunmap(rsv);937 memunmap(rsv);
938 return efi_mem_reserve_iomem(addr, size);938 return efi_mem_reserve_iomem(addr, size);
939 }939 }
940 prsv = rsv->next;
940 memunmap(rsv);941 memunmap(rsv);
941 }942 }
942 943
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
484 }484 }
485 }485 }
486 486
487 break;
488 case EFI_UNSUPPORTED:
489 err = -EOPNOTSUPP;
490 status = EFI_NOT_FOUND;
487 break;491 break;
488 case EFI_NOT_FOUND:492 case EFI_NOT_FOUND:
489 break;493 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
571 struct lock_class_key *lock_key,571 struct lock_class_key *lock_key,
572 struct lock_class_key *request_key)572 struct lock_class_key *request_key)
573{573{
574 struct fwnode_handle *fwnode = gc->parent ? dev_fwnode(gc->parent) : NULL;
574 unsigned long flags;575 unsigned long flags;
575 int ret = 0;576 int ret = 0;
576 unsigned i;577 unsigned i;
@@ -594,6 +595,12 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 17 unmodified lines
594 595
595 of_gpio_dev_init(gc, gdev);596 of_gpio_dev_init(gc, gdev);
596 597
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
597 gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL);604 gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL);
598 if (gdev->id < 0) {605 if (gdev->id < 0) {
599 ret = gdev->id;606 ret = gdev->id;
@@ -4256,7 +4263,8 @@ static int __init gpiolib_dev_init(void) · 3656 unmodified lines
4256 return ret;4263 return ret;
4257 }4264 }
4258 4265
4259 if (driver_register(&gpio_stub_drv) < 0) {4266 ret = driver_register(&gpio_stub_drv);
4267 if (ret < 0) {
4260 pr_err("gpiolib: could not register GPIO stub driver\n");4268 pr_err("gpiolib: could not register GPIO stub driver\n");
4261 bus_unregister(&gpio_bus_type);4269 bus_unregister(&gpio_bus_type);
4262 return ret;4270 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
1507 if (pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed1507 if (pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed
1508 || pipe_ctx->stream->update_flags.bits.gamut_remap1508 || pipe_ctx->stream->update_flags.bits.gamut_remap
1509 || pipe_ctx->stream->update_flags.bits.out_csc) {1509 || pipe_ctx->stream->update_flags.bits.out_csc) {
1510 struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc;1510 /* dpp/cm gamut remap*/
1511 1511 dc->hwss.program_gamut_remap(pipe_ctx);
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);
1542 1512
1543 /*call the dcn2 method which uses mpc csc*/1513 /*call the dcn2 method which uses mpc csc*/
1544 dc->hwss.program_output_csc(dc,1514 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
1595 dcn2_1_soc.num_chans = bw_params->num_channels;1595 dcn2_1_soc.num_chans = bw_params->num_channels;
1596 1596
1597 ASSERT(clk_table->num_entries);1597 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
1598 for (i = 0; i < clk_table->num_entries; i++) {1603 for (i = 0; i < clk_table->num_entries; i++) {
1599 /* loop backwards*/1604 /* loop backwards*/
1600 for (closest_clk_lvl = 0, j = dcn2_1_soc.num_states - 1; j >= 0; j--) {1605 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
113 struct pwl_result_data *rgb_resulted;113 struct pwl_result_data *rgb_resulted;
114 struct pwl_result_data *rgb;114 struct pwl_result_data *rgb;
115 struct pwl_result_data *rgb_plus_1;115 struct pwl_result_data *rgb_plus_1;
116 struct pwl_result_data *rgb_minus_1;
116 struct fixed31_32 end_value;117 struct fixed31_32 end_value;
117 118
118 int32_t region_start, region_end;119 int32_t region_start, region_end;
@@ -140,7 +141,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 21 unmodified lines
140 region_start = -MAX_LOW_POINT;141 region_start = -MAX_LOW_POINT;
141 region_end = NUMBER_REGIONS - MAX_LOW_POINT;142 region_end = NUMBER_REGIONS - MAX_LOW_POINT;
142 } else {143 } else {
143 /* 10 segments144 /* 11 segments
144 * segment is from 2^-10 to 2^0145 * segment is from 2^-10 to 2^0
145 * There are less than 256 points, for optimization146 * There are less than 256 points, for optimization
146 */147 */
@@ -154,9 +155,10 @@ bool cm3_helper_translate_curve_to_hw_format( · 7 unmodified lines
154 seg_distr[7] = 4;155 seg_distr[7] = 4;
155 seg_distr[8] = 4;156 seg_distr[8] = 4;
156 seg_distr[9] = 4;157 seg_distr[9] = 4;
158 seg_distr[10] = 1;
157 159
158 region_start = -10;160 region_start = -10;
159 region_end = 0;161 region_end = 1;
160 }162 }
161 163
162 for (i = region_end - region_start; i < MAX_REGIONS_NUMBER ; i++)164 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
189 rgb_resulted[hw_points - 1].green = output_tf->tf_pts.green[start_index];191 rgb_resulted[hw_points - 1].green = output_tf->tf_pts.green[start_index];
190 rgb_resulted[hw_points - 1].blue = output_tf->tf_pts.blue[start_index];192 rgb_resulted[hw_points - 1].blue = output_tf->tf_pts.blue[start_index];
191 193
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
192 // All 3 color channels have same x198 // All 3 color channels have same x
193 corner_points[0].red.x = dc_fixpt_pow(dc_fixpt_from_int(2),199 corner_points[0].red.x = dc_fixpt_pow(dc_fixpt_from_int(2),
194 dc_fixpt_from_int(region_start));200 dc_fixpt_from_int(region_start));
@@ -259,15 +265,18 @@ bool cm3_helper_translate_curve_to_hw_format( · 64 unmodified lines
259 265
260 rgb = rgb_resulted;266 rgb = rgb_resulted;
261 rgb_plus_1 = rgb_resulted + 1;267 rgb_plus_1 = rgb_resulted + 1;
268 rgb_minus_1 = rgb;
262 269
263 i = 1;270 i = 1;
264 while (i != hw_points + 1) {271 while (i != hw_points + 1) {
265 if (dc_fixpt_lt(rgb_plus_1->red, rgb->red))272 if (i >= hw_points - 1) {
266 rgb_plus_1->red = rgb->red;273 if (dc_fixpt_lt(rgb_plus_1->red, rgb->red))
267 if (dc_fixpt_lt(rgb_plus_1->green, rgb->green))274 rgb_plus_1->red = dc_fixpt_add(rgb->red, rgb_minus_1->delta_red);
268 rgb_plus_1->green = rgb->green;275 if (dc_fixpt_lt(rgb_plus_1->green, rgb->green))
269 if (dc_fixpt_lt(rgb_plus_1->blue, rgb->blue))276 rgb_plus_1->green = dc_fixpt_add(rgb->green, rgb_minus_1->delta_green);
270 rgb_plus_1->blue = rgb->blue;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 }
271 280
272 rgb->delta_red = dc_fixpt_sub(rgb_plus_1->red, rgb->red);281 rgb->delta_red = dc_fixpt_sub(rgb_plus_1->red, rgb->red);
273 rgb->delta_green = dc_fixpt_sub(rgb_plus_1->green, rgb->green);282 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
283 }292 }
284 293
285 ++rgb_plus_1;294 ++rgb_plus_1;
295 rgb_minus_1 = rgb;
286 ++rgb;296 ++rgb;
287 ++i;297 ++i;
288 }298 }
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
603{603{
604 int report_size = stream->oa_buffer.format_size;604 int report_size = stream->oa_buffer.format_size;
605 struct drm_i915_perf_record_header header;605 struct drm_i915_perf_record_header header;
606 u32 sample_flags = stream->sample_flags;
607 606
608 header.type = DRM_I915_PERF_RECORD_SAMPLE;607 header.type = DRM_I915_PERF_RECORD_SAMPLE;
609 header.pad = 0;608 header.pad = 0;
@@ -617,10 +616,8 @@ static int append_oa_sample(struct i915_perf_stream *stream, · 7 unmodified lines
617 return -EFAULT;616 return -EFAULT;
618 buf += sizeof(header);617 buf += sizeof(header);
619 618
620 if (sample_flags & SAMPLE_OA_REPORT) {619 if (copy_to_user(buf, report, report_size))
621 if (copy_to_user(buf, report, report_size))620 return -EFAULT;
622 return -EFAULT;
623 }
624 621
625 (*offset) += header.size;622 (*offset) += header.size;
626 623
@@ -2682,7 +2679,7 @@ static void i915_oa_stream_enable(struct i915_perf_stream *stream) · 2055 unmodified lines
2682 2679
2683 stream->perf->ops.oa_enable(stream);2680 stream->perf->ops.oa_enable(stream);
2684 2681
2685 if (stream->periodic)2682 if (stream->sample_flags & SAMPLE_OA_REPORT)
2686 hrtimer_start(&stream->poll_check_timer,2683 hrtimer_start(&stream->poll_check_timer,
2687 ns_to_ktime(stream->poll_oa_period),2684 ns_to_ktime(stream->poll_oa_period),
2688 HRTIMER_MODE_REL_PINNED);2685 HRTIMER_MODE_REL_PINNED);
@@ -2745,7 +2742,7 @@ static void i915_oa_stream_disable(struct i915_perf_stream *stream) · 56 unmodified lines
2745{2742{
2746 stream->perf->ops.oa_disable(stream);2743 stream->perf->ops.oa_disable(stream);
2747 2744
2748 if (stream->periodic)2745 if (stream->sample_flags & SAMPLE_OA_REPORT)
2749 hrtimer_cancel(&stream->poll_check_timer);2746 hrtimer_cancel(&stream->poll_check_timer);
2750}2747}
2751 2748
@@ -3028,7 +3025,7 @@ static ssize_t i915_perf_read(struct file *file, · 276 unmodified lines
3028 * disabled stream as an error. In particular it might otherwise lead3025 * disabled stream as an error. In particular it might otherwise lead
3029 * to a deadlock for blocking file descriptors...3026 * to a deadlock for blocking file descriptors...
3030 */3027 */
3031 if (!stream->enabled)3028 if (!stream->enabled || !(stream->sample_flags & SAMPLE_OA_REPORT))
3032 return -EIO;3029 return -EIO;
3033 3030
3034 if (!(file->f_flags & O_NONBLOCK)) {3031 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
3316 3316
3317#define ILK_DISPLAY_CHICKEN1 _MMIO(0x42000)3317#define ILK_DISPLAY_CHICKEN1 _MMIO(0x42000)
3318#define ILK_FBCQ_DIS (1 << 22)3318#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)
3320 3331
3321 3332
3322/*3333/*
@@ -8039,6 +8050,16 @@ enum { · 4716 unmodified lines
8039 8050
8040#define _CHICKEN_PIPESL_1_A 0x420b08051#define _CHICKEN_PIPESL_1_A 0x420b0
8041#define _CHICKEN_PIPESL_1_B 0x420b48052#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)
8042#define HSW_FBCQ_DIS (1 << 22)8063#define HSW_FBCQ_DIS (1 << 22)
8043#define BDW_DPRS_MASK_VBLANK_SRD (1 << 0)8064#define BDW_DPRS_MASK_VBLANK_SRD (1 << 0)
8044#define CHICKEN_PIPESL_1(pipe) _MMIO_PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B)8065#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
7245 intel_uncore_write(&dev_priv->uncore, CHICKEN_PAR1_1,7245 intel_uncore_write(&dev_priv->uncore, CHICKEN_PAR1_1,
7246 intel_uncore_read(&dev_priv->uncore, CHICKEN_PAR1_1) | DPA_MASK_VBLANK_SRD);7246 intel_uncore_read(&dev_priv->uncore, CHICKEN_PAR1_1) | DPA_MASK_VBLANK_SRD);
7247 7247
7248 /* WaPsrDPRSUnmaskVBlankInSRD:bdw */
7249 for_each_pipe(dev_priv, pipe) {7248 for_each_pipe(dev_priv, pipe) {
7249 /* WaPsrDPRSUnmaskVBlankInSRD:bdw */
7250 intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe),7250 intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe),
7251 intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe)) |7251 intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe)) |
7252 BDW_DPRS_MASK_VBLANK_SRD);7252 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);
7253 }7258 }
7254 7259
7255 /* WaVSRefCountFullforceMissDisable:bdw */7260 /* WaVSRefCountFullforceMissDisable:bdw */
@@ -7285,11 +7290,20 @@ static void bdw_init_clock_gating(struct drm_i915_private *dev_priv) · 29 unmodified lines
7285 7290
7286static void hsw_init_clock_gating(struct drm_i915_private *dev_priv)7291static void hsw_init_clock_gating(struct drm_i915_private *dev_priv)
7287{7292{
7293 enum pipe pipe;
7294
7288 /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */7295 /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */
7289 intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A),7296 intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A),
7290 intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A)) |7297 intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A)) |
7291 HSW_FBCQ_DIS);7298 HSW_FBCQ_DIS);
7292 7299
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
7293 /* This is required by WaCatErrorRejectionIssue:hsw */7307 /* This is required by WaCatErrorRejectionIssue:hsw */
7294 intel_uncore_write(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,7308 intel_uncore_write(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
7295 intel_uncore_read(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |7309 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
551 551
552 if (!ttm_dma)552 if (!ttm_dma)
553 return;553 return;
554 if (!ttm_dma->pages) {
555 NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma);
556 return;
557 }
554 558
555 /* Don't waste time looping if the object is coherent */559 /* Don't waste time looping if the object is coherent */
556 if (nvbo->force_coherent)560 if (nvbo->force_coherent)
@@ -583,6 +587,10 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) · 26 unmodified lines
583 587
584 if (!ttm_dma)588 if (!ttm_dma)
585 return;589 return;
590 if (!ttm_dma->pages) {
591 NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma);
592 return;
593 }
586 594
587 /* Don't waste time looping if the object is coherent */595 /* Don't waste time looping if the object is coherent */
588 if (nvbo->force_coherent)596 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
2149 const struct mipi_dsi_msg *msg)2149 const struct mipi_dsi_msg *msg)
2150{2150{
2151 struct mipi_dsi_packet pkt;2151 struct mipi_dsi_packet pkt;
2152 int ret;
2152 u32 r;2153 u32 r;
2153 2154
2154 r = mipi_dsi_create_packet(&pkt, msg);2155 ret = mipi_dsi_create_packet(&pkt, msg);
2155 if (r < 0)2156 if (ret < 0)
2156 return r;2157 return ret;
2157 2158
2158 WARN_ON(!dsi_bus_is_locked(dsi));2159 WARN_ON(!dsi_bus_is_locked(dsi));
2159 2160
drivers/iio/adc/Kconfig+3−0
@@ -266,6 +266,8 @@ config ADI_AXI_ADC · 265 unmodified lines
266 select IIO_BUFFER266 select IIO_BUFFER
267 select IIO_BUFFER_HW_CONSUMER267 select IIO_BUFFER_HW_CONSUMER
268 select IIO_BUFFER_DMAENGINE268 select IIO_BUFFER_DMAENGINE
269 depends on HAS_IOMEM
270 depends on OF
269 help271 help
270 Say yes here to build support for Analog Devices Generic272 Say yes here to build support for Analog Devices Generic
271 AXI ADC IP core. The IP core is used for interfacing with273 AXI ADC IP core. The IP core is used for interfacing with
@@ -923,6 +925,7 @@ config STM32_ADC_CORE · 651 unmodified lines
923 depends on ARCH_STM32 || COMPILE_TEST925 depends on ARCH_STM32 || COMPILE_TEST
924 depends on OF926 depends on OF
925 depends on REGULATOR927 depends on REGULATOR
928 depends on HAS_IOMEM
926 select IIO_BUFFER929 select IIO_BUFFER
927 select MFD_STM32_TIMERS930 select MFD_STM32_TIMERS
928 select IIO_STM32_TIMER_TRIGGER931 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
918 return processed;918 return processed;
919 919
920 /* Return millivolt or milliamps or millicentigrades */920 /* Return millivolt or milliamps or millicentigrades */
921 *val = processed * 1000;921 *val = processed;
922 return IIO_VAL_INT;922 return IIO_VAL_INT;
923 }923 }
924 924
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
91 int ret;91 int ret;
92 int i;92 int i;
93 int bits_per_word = ad7949_adc->resolution;93 int bits_per_word = ad7949_adc->resolution;
94 int mask = GENMASK(ad7949_adc->resolution, 0);94 int mask = GENMASK(ad7949_adc->resolution - 1, 0);
95 struct spi_message msg;95 struct spi_message msg;
96 struct spi_transfer tx[] = {96 struct spi_transfer tx[] = {
97 {97 {
drivers/iio/adc/qcom-spmi-vadc.c+1−1
@@ -597,7 +597,7 @@ static const struct vadc_channels vadc_chans[] = { · 596 unmodified lines
597 VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1)597 VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1)
598 598
599 VADC_CHAN_NO_SCALE(LR_MUX1_BAT_THERM, 0)599 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)
601 VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0)601 VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0)
602 VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0)602 VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0)
603 VADC_CHAN_NO_SCALE(LR_MUX5_AMUX_THM2, 0)603 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
551 MPU3050_FIFO_R,551 MPU3050_FIFO_R,
552 &fifo_values[offset],552 &fifo_values[offset],
553 toread);553 toread);
554 if (ret)
555 goto out_trigger_unlock;
554 556
555 dev_dbg(mpu3050->dev,557 dev_dbg(mpu3050->dev,
556 "%04x %04x %04x %04x %04x\n",558 "%04x %04x %04x %04x %04x\n",
drivers/iio/humidity/hid-sensor-humidity.c+7−5
@@ -15,7 +15,10 @@ · 14 unmodified lines
15struct hid_humidity_state {15struct hid_humidity_state {
16 struct hid_sensor_common common_attributes;16 struct hid_sensor_common common_attributes;
17 struct hid_sensor_hub_attribute_info humidity_attr;17 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;
19 int scale_pre_decml;22 int scale_pre_decml;
20 int scale_post_decml;23 int scale_post_decml;
21 int scale_precision;24 int scale_precision;
@@ -125,9 +128,8 @@ static int humidity_proc_event(struct hid_sensor_hub_device *hsdev, · 103 unmodified lines
125 struct hid_humidity_state *humid_st = iio_priv(indio_dev);128 struct hid_humidity_state *humid_st = iio_priv(indio_dev);
126 129
127 if (atomic_read(&humid_st->common_attributes.data_ready))130 if (atomic_read(&humid_st->common_attributes.data_ready))
128 iio_push_to_buffers_with_timestamp(indio_dev,131 iio_push_to_buffers_with_timestamp(indio_dev, &humid_st->scan,
129 &humid_st->humidity_data,132 iio_get_time_ns(indio_dev));
130 iio_get_time_ns(indio_dev));
131 133
132 return 0;134 return 0;
133}135}
@@ -142,7 +144,7 @@ static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines
142 144
143 switch (usage_id) {145 switch (usage_id) {
144 case HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY:146 case HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY:
145 humid_st->humidity_data = *(s32 *)raw_data;147 humid_st->scan.humidity_data = *(s32 *)raw_data;
146 148
147 return 0;149 return 0;
148 default:150 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
462 if (ret)462 if (ret)
463 goto err_ret;463 goto err_ret;
464 464
465 ret = sscanf(indio_dev->name, "adis%u\n", &device_id);465 if (sscanf(indio_dev->name, "adis%u\n", &device_id) != 1) {
466 if (ret != 1) {
467 ret = -EINVAL;466 ret = -EINVAL;
468 goto err_ret;467 goto err_ret;
469 }468 }
drivers/iio/light/hid-sensor-prox.c+11−2
@@ -23,6 +23,9 @@ struct prox_state { · 22 unmodified lines
23 struct hid_sensor_common common_attributes;23 struct hid_sensor_common common_attributes;
24 struct hid_sensor_hub_attribute_info prox_attr;24 struct hid_sensor_hub_attribute_info prox_attr;
25 u32 human_presence;25 u32 human_presence;
26 int scale_pre_decml;
27 int scale_post_decml;
28 int scale_precision;
26};29};
27 30
28/* Channel definitions */31/* Channel definitions */
@@ -93,8 +96,9 @@ static int prox_read_raw(struct iio_dev *indio_dev, · 64 unmodified lines
93 ret_type = IIO_VAL_INT;96 ret_type = IIO_VAL_INT;
94 break;97 break;
95 case IIO_CHAN_INFO_SCALE:98 case IIO_CHAN_INFO_SCALE:
96 *val = prox_state->prox_attr.units;99 *val = prox_state->scale_pre_decml;
97 ret_type = IIO_VAL_INT;100 *val2 = prox_state->scale_post_decml;
101 ret_type = prox_state->scale_precision;
98 break;102 break;
99 case IIO_CHAN_INFO_OFFSET:103 case IIO_CHAN_INFO_OFFSET:
100 *val = hid_sensor_convert_exponent(104 *val = hid_sensor_convert_exponent(
@@ -234,6 +238,11 @@ static int prox_parse_report(struct platform_device *pdev, · 133 unmodified lines
234 HID_USAGE_SENSOR_HUMAN_PRESENCE,238 HID_USAGE_SENSOR_HUMAN_PRESENCE,
235 &st->common_attributes.sensitivity);239 &st->common_attributes.sensitivity);
236 240
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
237 return ret;246 return ret;
238}247}
239 248
drivers/iio/temperature/hid-sensor-temperature.c+8−6
@@ -15,7 +15,10 @@ · 14 unmodified lines
15struct temperature_state {15struct temperature_state {
16 struct hid_sensor_common common_attributes;16 struct hid_sensor_common common_attributes;
17 struct hid_sensor_hub_attribute_info temperature_attr;17 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;
19 int scale_pre_decml;22 int scale_pre_decml;
20 int scale_post_decml;23 int scale_post_decml;
21 int scale_precision;24 int scale_precision;
@@ -32,7 +35,7 @@ static const struct iio_chan_spec temperature_channels[] = { · 10 unmodified lines
32 BIT(IIO_CHAN_INFO_SAMP_FREQ) |35 BIT(IIO_CHAN_INFO_SAMP_FREQ) |
33 BIT(IIO_CHAN_INFO_HYSTERESIS),36 BIT(IIO_CHAN_INFO_HYSTERESIS),
34 },37 },
35 IIO_CHAN_SOFT_TIMESTAMP(3),38 IIO_CHAN_SOFT_TIMESTAMP(1),
36};39};
37 40
38/* Adjust channel real bits based on report descriptor */41/* 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
123 struct temperature_state *temp_st = iio_priv(indio_dev);126 struct temperature_state *temp_st = iio_priv(indio_dev);
124 127
125 if (atomic_read(&temp_st->common_attributes.data_ready))128 if (atomic_read(&temp_st->common_attributes.data_ready))
126 iio_push_to_buffers_with_timestamp(indio_dev,129 iio_push_to_buffers_with_timestamp(indio_dev, &temp_st->scan,
127 &temp_st->temperature_data,130 iio_get_time_ns(indio_dev));
128 iio_get_time_ns(indio_dev));
129 131
130 return 0;132 return 0;
131}133}
@@ -140,7 +142,7 @@ static int temperature_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines
140 142
141 switch (usage_id) {143 switch (usage_id) {
142 case HID_USAGE_SENSOR_DATA_ENVIRONMENTAL_TEMPERATURE:144 case HID_USAGE_SENSOR_DATA_ENVIRONMENTAL_TEMPERATURE:
143 temp_st->temperature_data = *(s32 *)raw_data;145 temp_st->scan.temperature_data = *(s32 *)raw_data;
144 return 0;146 return 0;
145 default:147 default:
146 return -EINVAL;148 return -EINVAL;
drivers/input/joydev.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
26 26
27MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");27MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
28MODULE_DESCRIPTION("Joystick device interfaces");28MODULE_DESCRIPTION("Joystick device interfaces");
29MODULE_SUPPORTED_DEVICE("input/js");
30MODULE_LICENSE("GPL");29MODULE_LICENSE("GPL");
31 30
32#define JOYDEV_MINOR_BASE 031#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
2714 struct acpi_table_header *ivrs_base;2714 struct acpi_table_header *ivrs_base;
2715 int i, remap_cache_sz, ret;2715 int i, remap_cache_sz, ret;
2716 acpi_status status;2716 acpi_status status;
2717 u32 pci_id;
2718 2717
2719 if (!amd_iommu_detected)2718 if (!amd_iommu_detected)
2720 return -ENODEV;2719 return -ENODEV;
@@ -2804,16 +2803,6 @@ static int __init early_amd_iommu_init(void) · 83 unmodified lines
2804 if (ret)2803 if (ret)
2805 goto out;2804 goto out;
2806 2805
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
2817 /* Disable any previously enabled IOMMUs */2806 /* Disable any previously enabled IOMMUs */
2818 if (!is_kdump_kernel() || amd_iommu_disabled)2807 if (!is_kdump_kernel() || amd_iommu_disabled)
2819 disable_iommus();2808 disable_iommus();
@@ -2880,6 +2869,7 @@ static bool detect_ivrs(void) · 60 unmodified lines
2880{2869{
2881 struct acpi_table_header *ivrs_base;2870 struct acpi_table_header *ivrs_base;
2882 acpi_status status;2871 acpi_status status;
2872 int i;
2883 2873
2884 status = acpi_get_table("IVRS", 0, &ivrs_base);2874 status = acpi_get_table("IVRS", 0, &ivrs_base);
2885 if (status == AE_NOT_FOUND)2875 if (status == AE_NOT_FOUND)
@@ -2892,6 +2882,17 @@ static bool detect_ivrs(void) · 6 unmodified lines
2892 2882
2893 acpi_put_table(ivrs_base);2883 acpi_put_table(ivrs_base);
2894 2884
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
2895 /* Make sure ACS will be enabled during PCI probe */2896 /* Make sure ACS will be enabled during PCI probe */
2896 pci_request_acs();2897 pci_request_acs();
2897 2898
@@ -2918,12 +2919,12 @@ static int __init state_next(void) · 20 unmodified lines
2918 }2919 }
2919 break;2920 break;
2920 case IOMMU_IVRS_DETECTED:2921 case IOMMU_IVRS_DETECTED:
2921 ret = early_amd_iommu_init();2922 if (amd_iommu_disabled) {
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");
2925 init_state = IOMMU_CMDLINE_DISABLED;2923 init_state = IOMMU_CMDLINE_DISABLED;
2926 ret = -EINVAL;2924 ret = -EINVAL;
2925 } else {
2926 ret = early_amd_iommu_init();
2927 init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
2927 }2928 }
2928 break;2929 break;
2929 case IOMMU_ACPI_FINISHED:2930 case IOMMU_ACPI_FINISHED:
@@ -3001,8 +3002,11 @@ int __init amd_iommu_prepare(void) · 71 unmodified lines
3001 amd_iommu_irq_remap = true;3002 amd_iommu_irq_remap = true;
3002 3003
3003 ret = iommu_go_to_state(IOMMU_ACPI_FINISHED);3004 ret = iommu_go_to_state(IOMMU_ACPI_FINISHED);
3004 if (ret)3005 if (ret) {
3006 amd_iommu_irq_remap = false;
3005 return ret;3007 return ret;
3008 }
3009
3006 return amd_iommu_irq_remap ? 0 : -ENODEV;3010 return amd_iommu_irq_remap ? 0 : -ENODEV;
3007}3011}
3008 3012
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
849 smmu = tegra_smmu_find(args.np);849 smmu = tegra_smmu_find(args.np);
850 if (smmu) {850 if (smmu) {
851 err = tegra_smmu_configure(smmu, dev, &args);851 err = tegra_smmu_configure(smmu, dev, &args);
852 of_node_put(args.np);
853 852
854 if (err < 0)853 if (err < 0) {
854 of_node_put(args.np);
855 return ERR_PTR(err);855 return ERR_PTR(err);
856 856 }
857 break;
858 }857 }
859 858
860 of_node_put(args.np);859 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
430MODULE_AUTHOR("Ben Backx <ben@bbackx.com>");430MODULE_AUTHOR("Ben Backx <ben@bbackx.com>");
431MODULE_DESCRIPTION("FireDTV DVB Driver");431MODULE_DESCRIPTION("FireDTV DVB Driver");
432MODULE_LICENSE("GPL");432MODULE_LICENSE("GPL");
433MODULE_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
41 41
42MODULE_AUTHOR("Andy Walls");42MODULE_AUTHOR("Andy Walls");
43MODULE_DESCRIPTION("CX23418 ALSA Interface");43MODULE_DESCRIPTION("CX23418 ALSA Interface");
44MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder");
45MODULE_LICENSE("GPL");44MODULE_LICENSE("GPL");
46 45
47MODULE_VERSION(CX18_VERSION);46MODULE_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
232 232
233MODULE_AUTHOR("Hans Verkuil");233MODULE_AUTHOR("Hans Verkuil");
234MODULE_DESCRIPTION("CX23418 driver");234MODULE_DESCRIPTION("CX23418 driver");
235MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder");
236MODULE_LICENSE("GPL");235MODULE_LICENSE("GPL");
237 236
238MODULE_VERSION(CX18_VERSION);237MODULE_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
104MODULE_DESCRIPTION("ALSA driver module for cx25821 based capture cards");104MODULE_DESCRIPTION("ALSA driver module for cx25821 based capture cards");
105MODULE_AUTHOR("Hiep Huynh");105MODULE_AUTHOR("Hiep Huynh");
106MODULE_LICENSE("GPL");106MODULE_LICENSE("GPL");
107MODULE_SUPPORTED_DEVICE("{{Conexant,25821}"); /* "{{Conexant,23881}," */
108 107
109static unsigned int debug;108static unsigned int debug;
110module_param(debug, int, 0644);109module_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
98MODULE_LICENSE("GPL v2");98MODULE_LICENSE("GPL v2");
99MODULE_VERSION(CX88_VERSION);99MODULE_VERSION(CX88_VERSION);
100 100
101MODULE_SUPPORTED_DEVICE("{{Conexant,23881},{{Conexant,23882},{{Conexant,23883}");
102static unsigned int debug;101static unsigned int debug;
103module_param(debug, int, 0644);102module_param(debug, int, 0644);
104MODULE_PARM_DESC(debug, "enable debug messages");103MODULE_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
38 38
39MODULE_AUTHOR("Andy Walls");39MODULE_AUTHOR("Andy Walls");
40MODULE_DESCRIPTION("CX23415/CX23416 ALSA Interface");40MODULE_DESCRIPTION("CX23415/CX23416 ALSA Interface");
41MODULE_SUPPORTED_DEVICE("CX23415/CX23416 MPEG2 encoder");
42MODULE_LICENSE("GPL");41MODULE_LICENSE("GPL");
43 42
44MODULE_VERSION(IVTV_VERSION);43MODULE_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
275 275
276MODULE_AUTHOR("Kevin Thayer, Chris Kennedy, Hans Verkuil");276MODULE_AUTHOR("Kevin Thayer, Chris Kennedy, Hans Verkuil");
277MODULE_DESCRIPTION("CX23415/CX23416 driver");277MODULE_DESCRIPTION("CX23415/CX23416 driver");
278MODULE_SUPPORTED_DEVICE
279 ("CX23415/CX23416 MPEG2 encoder (WinTV PVR-150/250/350/500,\n"
280 "\t\t\tYuan MPG series and similar)");
281MODULE_LICENSE("GPL");278MODULE_LICENSE("GPL");
282 279
283MODULE_VERSION(IVTV_VERSION);280MODULE_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
1269MODULE_DESCRIPTION("STA2X11 Video Input Port driver");1269MODULE_DESCRIPTION("STA2X11 Video Input Port driver");
1270MODULE_AUTHOR("Wind River");1270MODULE_AUTHOR("Wind River");
1271MODULE_LICENSE("GPL v2");1271MODULE_LICENSE("GPL v2");
1272MODULE_SUPPORTED_DEVICE("sta2x11 video input");
1273MODULE_VERSION(DRV_VERSION);1272MODULE_VERSION(DRV_VERSION);
1274MODULE_DEVICE_TABLE(pci, sta2x11_vip_pci_tbl);1273MODULE_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
1363MODULE_AUTHOR("Josh Wu <josh.wu@atmel.com>");1363MODULE_AUTHOR("Josh Wu <josh.wu@atmel.com>");
1364MODULE_DESCRIPTION("The V4L2 driver for Atmel Linux");1364MODULE_DESCRIPTION("The V4L2 driver for Atmel Linux");
1365MODULE_LICENSE("GPL");1365MODULE_LICENSE("GPL");
1366MODULE_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
330MODULE_AUTHOR("Songjun Wu");330MODULE_AUTHOR("Songjun Wu");
331MODULE_DESCRIPTION("The V4L2 driver for Atmel-ISC");331MODULE_DESCRIPTION("The V4L2 driver for Atmel-ISC");
332MODULE_LICENSE("GPL v2");332MODULE_LICENSE("GPL v2");
333MODULE_SUPPORTED_DEVICE("video");
drivers/media/platform/marvell-ccic/cafe-driver.c+0−4
@@ -44,10 +44,6 @@ · 43 unmodified lines
44MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>");44MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>");
45MODULE_DESCRIPTION("Marvell 88ALP01 CMOS Camera Controller driver");45MODULE_DESCRIPTION("Marvell 88ALP01 CMOS Camera Controller driver");
46MODULE_LICENSE("GPL");46MODULE_LICENSE("GPL");
47MODULE_SUPPORTED_DEVICE("Video");
48
49
50
51 47
52struct cafe_camera {48struct cafe_camera {
53 int registered; /* Fully initialized? */49 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
2149MODULE_AUTHOR("Hugues Fruchet <hugues.fruchet@st.com>");2149MODULE_AUTHOR("Hugues Fruchet <hugues.fruchet@st.com>");
2150MODULE_DESCRIPTION("STMicroelectronics STM32 Digital Camera Memory Interface driver");2150MODULE_DESCRIPTION("STMicroelectronics STM32 Digital Camera Memory Interface driver");
2151MODULE_LICENSE("GPL");2151MODULE_LICENSE("GPL");
2152MODULE_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
56 56
57MODULE_AUTHOR("Steve Miller (STMicroelectronics) <steve.miller@st.com>");57MODULE_AUTHOR("Steve Miller (STMicroelectronics) <steve.miller@st.com>");
58MODULE_DESCRIPTION("V4L-driver for STMicroelectronics CPiA2 based cameras");58MODULE_DESCRIPTION("V4L-driver for STMicroelectronics CPiA2 based cameras");
59MODULE_SUPPORTED_DEVICE("video");
60MODULE_LICENSE("GPL");59MODULE_LICENSE("GPL");
61MODULE_VERSION(CPIA_VERSION);60MODULE_VERSION(CPIA_VERSION);
62 61
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
51MODULE_DESCRIPTION("ALSA driver module for tm5600/tm6000/tm6010 based TV cards");51MODULE_DESCRIPTION("ALSA driver module for tm5600/tm6000/tm6010 based TV cards");
52MODULE_AUTHOR("Mauro Carvalho Chehab");52MODULE_AUTHOR("Mauro Carvalho Chehab");
53MODULE_LICENSE("GPL v2");53MODULE_LICENSE("GPL v2");
54MODULE_SUPPORTED_DEVICE("{{Trident,tm5600},{{Trident,tm6000},{{Trident,tm6010}");
55static unsigned int debug;54static unsigned int debug;
56module_param(debug, int, 0644);55module_param(debug, int, 0644);
57MODULE_PARM_DESC(debug, "enable debug messages");56MODULE_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
23MODULE_AUTHOR("Mauro Carvalho Chehab");23MODULE_AUTHOR("Mauro Carvalho Chehab");
24MODULE_LICENSE("GPL");24MODULE_LICENSE("GPL");
25 25
26MODULE_SUPPORTED_DEVICE("{{Trident, tm5600},{{Trident, tm6000},{{Trident, tm6010}");
27
28static int debug;26static int debug;
29 27
30module_param(debug, int, 0644);28module_param(debug, int, 0644);
drivers/mtd/maps/sun_uflash.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
32 32
33MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");33MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");
34MODULE_DESCRIPTION("User-programmable flash device on Sun Microsystems boardsets");34MODULE_DESCRIPTION("User-programmable flash device on Sun Microsystems boardsets");
35MODULE_SUPPORTED_DEVICE(DRIVER_NAME);
36MODULE_LICENSE("GPL");35MODULE_LICENSE("GPL");
37MODULE_VERSION("2.1");36MODULE_VERSION("2.1");
38 37
drivers/net/can/peak_canfd/peak_pciefd_main.c+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
21 21
22MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");22MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
23MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards");23MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards");
24MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe/M.2 FD CAN cards");
25MODULE_LICENSE("GPL v2");24MODULE_LICENSE("GPL v2");
26 25
27#define PCIEFD_DRV_NAME "peak_pciefd"26#define PCIEFD_DRV_NAME "peak_pciefd"
drivers/net/can/sja1000/ems_pci.c+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
21 21
22MODULE_AUTHOR("Sebastian Haas <haas@ems-wuenche.com>");22MODULE_AUTHOR("Sebastian Haas <haas@ems-wuenche.com>");
23MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-PCI/PCIe/104P CAN cards");23MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-PCI/PCIe/104P CAN cards");
24MODULE_SUPPORTED_DEVICE("EMS CPC-PCI/PCIe/104P CAN card");
25MODULE_LICENSE("GPL v2");24MODULE_LICENSE("GPL v2");
26 25
27#define EMS_PCI_V1_MAX_CHAN 226#define EMS_PCI_V1_MAX_CHAN 2
drivers/net/can/sja1000/ems_pcmcia.c+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
21 21
22MODULE_AUTHOR("Markus Plessing <plessing@ems-wuensche.com>");22MODULE_AUTHOR("Markus Plessing <plessing@ems-wuensche.com>");
23MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-CARD cards");23MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-CARD cards");
24MODULE_SUPPORTED_DEVICE("EMS CPC-CARD CAN card");
25MODULE_LICENSE("GPL v2");24MODULE_LICENSE("GPL v2");
26 25
27#define EMS_PCMCIA_MAX_CHAN 226#define EMS_PCMCIA_MAX_CHAN 2
drivers/net/can/sja1000/kvaser_pci.c+0−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
33 33
34MODULE_AUTHOR("Per Dalen <per.dalen@cnw.se>");34MODULE_AUTHOR("Per Dalen <per.dalen@cnw.se>");
35MODULE_DESCRIPTION("Socket-CAN driver for KVASER PCAN PCI cards");35MODULE_DESCRIPTION("Socket-CAN driver for KVASER PCAN PCI cards");
36MODULE_SUPPORTED_DEVICE("KVASER PCAN PCI CAN card");
37MODULE_LICENSE("GPL v2");36MODULE_LICENSE("GPL v2");
38 37
39#define MAX_NO_OF_CHANNELS 4 /* max no of channels on a single card */38#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
24 24
25MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");25MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
26MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCI family cards");26MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCI family cards");
27MODULE_SUPPORTED_DEVICE("PEAK PCAN PCI/PCIe/PCIeC miniPCI CAN cards");
28MODULE_SUPPORTED_DEVICE("PEAK PCAN miniPCIe/cPCI PC/104+ PCI/104e CAN Cards");
29MODULE_LICENSE("GPL v2");27MODULE_LICENSE("GPL v2");
30 28
31#define DRV_NAME "peak_pci"29#define DRV_NAME "peak_pci"
drivers/net/can/sja1000/peak_pcmcia.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
22MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");22MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
23MODULE_DESCRIPTION("CAN driver for PEAK-System PCAN-PC Cards");23MODULE_DESCRIPTION("CAN driver for PEAK-System PCAN-PC Cards");
24MODULE_LICENSE("GPL v2");24MODULE_LICENSE("GPL v2");
25MODULE_SUPPORTED_DEVICE("PEAK PCAN-PC Card");
26 25
27/* PEAK-System PCMCIA driver name */26/* PEAK-System PCMCIA driver name */
28#define PCC_NAME "peak_pcmcia"27#define PCC_NAME "peak_pcmcia"
drivers/net/can/sja1000/plx_pci.c+0−12
@@ -25,18 +25,6 @@ · 24 unmodified lines
25MODULE_AUTHOR("Pavel Cheblakov <P.B.Cheblakov@inp.nsk.su>");25MODULE_AUTHOR("Pavel Cheblakov <P.B.Cheblakov@inp.nsk.su>");
26MODULE_DESCRIPTION("Socket-CAN driver for PLX90xx PCI-bridge cards with "26MODULE_DESCRIPTION("Socket-CAN driver for PLX90xx PCI-bridge cards with "
27 "the SJA1000 chips");27 "the SJA1000 chips");
28MODULE_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")
40MODULE_LICENSE("GPL v2");28MODULE_LICENSE("GPL v2");
41 29
42#define PLX_PCI_MAX_CHAN 230#define PLX_PCI_MAX_CHAN 2
drivers/net/can/usb/peak_usb/pcan_usb.c+0−2
@@ -18,8 +18,6 @@ · 17 unmodified lines
18 18
19#include "pcan_usb_core.h"19#include "pcan_usb_core.h"
20 20
21MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB adapter");
22
23/* PCAN-USB Endpoints */21/* PCAN-USB Endpoints */
24#define PCAN_USB_EP_CMDOUT 122#define PCAN_USB_EP_CMDOUT 1
25#define PCAN_USB_EP_CMDIN (PCAN_USB_EP_CMDOUT | USB_DIR_IN)23#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
16#include "pcan_usb_core.h"16#include "pcan_usb_core.h"
17#include "pcan_usb_pro.h"17#include "pcan_usb_pro.h"
18 18
19MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB FD adapter");
20MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro FD adapter");
21
22#define PCAN_USBPROFD_CHANNEL_COUNT 219#define PCAN_USBPROFD_CHANNEL_COUNT 2
23#define PCAN_USBFD_CHANNEL_COUNT 120#define PCAN_USBFD_CHANNEL_COUNT 1
24 21
drivers/net/can/usb/peak_usb/pcan_usb_pro.c+0−2
@@ -17,8 +17,6 @@ · 16 unmodified lines
17#include "pcan_usb_core.h"17#include "pcan_usb_core.h"
18#include "pcan_usb_pro.h"18#include "pcan_usb_pro.h"
19 19
20MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro adapter");
21
22#define PCAN_USBPRO_CHANNEL_COUNT 220#define PCAN_USBPRO_CHANNEL_COUNT 2
23 21
24/* PCAN-USB Pro adapter internal clock (MHz) */22/* 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
2167 2167
2168MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>");2168MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>");
2169MODULE_DESCRIPTION("AX.25 Device Driver for Z8530 based HDLC cards");2169MODULE_DESCRIPTION("AX.25 Device Driver for Z8530 based HDLC cards");
2170MODULE_SUPPORTED_DEVICE("Z8530 based SCC cards for Amateur Radio");
2171MODULE_LICENSE("GPL");2170MODULE_LICENSE("GPL");
2172module_init(scc_init_driver);2171module_init(scc_init_driver);
2173module_exit(scc_cleanup_driver);2172module_exit(scc_cleanup_driver);
drivers/net/wireless/admtek/adm8211.c+0−1
@@ -28,7 +28,6 @@ · 27 unmodified lines
28MODULE_AUTHOR("Michael Wu <flamingice@sourmilk.net>");28MODULE_AUTHOR("Michael Wu <flamingice@sourmilk.net>");
29MODULE_AUTHOR("Jouni Malinen <j@w1.fi>");29MODULE_AUTHOR("Jouni Malinen <j@w1.fi>");
30MODULE_DESCRIPTION("Driver for IEEE 802.11b wireless cards based on ADMtek ADM8211");30MODULE_DESCRIPTION("Driver for IEEE 802.11b wireless cards based on ADMtek ADM8211");
31MODULE_SUPPORTED_DEVICE("ADM8211");
32MODULE_LICENSE("GPL");31MODULE_LICENSE("GPL");
33 32
34static unsigned int tx_ring_size __read_mostly = 16;33static 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
90MODULE_AUTHOR("Jiri Slaby");90MODULE_AUTHOR("Jiri Slaby");
91MODULE_AUTHOR("Nick Kossifidis");91MODULE_AUTHOR("Nick Kossifidis");
92MODULE_DESCRIPTION("Support for 5xxx series of Atheros 802.11 wireless LAN cards.");92MODULE_DESCRIPTION("Support for 5xxx series of Atheros 802.11 wireless LAN cards.");
93MODULE_SUPPORTED_DEVICE("Atheros 5xxx WLAN cards");
94MODULE_LICENSE("Dual BSD/GPL");93MODULE_LICENSE("Dual BSD/GPL");
95 94
96static int ath5k_init(struct ieee80211_hw *hw);95static 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
34 34
35MODULE_AUTHOR("Atheros Communications");35MODULE_AUTHOR("Atheros Communications");
36MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");36MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");
37MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards");
38MODULE_LICENSE("Dual BSD/GPL");37MODULE_LICENSE("Dual BSD/GPL");
39 38
40static void ath9k_hw_set_clockrate(struct ath_hw *ah)39static 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
37 37
38MODULE_AUTHOR("Atheros Communications");38MODULE_AUTHOR("Atheros Communications");
39MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");39MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");
40MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards");
41MODULE_LICENSE("Dual BSD/GPL");40MODULE_LICENSE("Dual BSD/GPL");
42 41
43static unsigned int ath9k_debug = ATH_DBG_DEFAULT;42static unsigned int ath9k_debug = ATH_DBG_DEFAULT;
drivers/net/wireless/atmel/atmel.c+0−1
@@ -75,7 +75,6 @@ · 74 unmodified lines
75MODULE_AUTHOR("Simon Kelley");75MODULE_AUTHOR("Simon Kelley");
76MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");76MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
77MODULE_LICENSE("GPL");77MODULE_LICENSE("GPL");
78MODULE_SUPPORTED_DEVICE("Atmel at76c50x wireless cards");
79 78
80/* The name of the firmware file to be loaded79/* The name of the firmware file to be loaded
81 over-rides any automatic selection */80 over-rides any automatic selection */
drivers/net/wireless/atmel/atmel_cs.c+0−1
@@ -57,7 +57,6 @@ · 56 unmodified lines
57MODULE_AUTHOR("Simon Kelley");57MODULE_AUTHOR("Simon Kelley");
58MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");58MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
59MODULE_LICENSE("GPL");59MODULE_LICENSE("GPL");
60MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards");
61 60
62/*====================================================================*/61/*====================================================================*/
63 62
drivers/net/wireless/atmel/atmel_pci.c+0−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
16MODULE_AUTHOR("Simon Kelley");16MODULE_AUTHOR("Simon Kelley");
17MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");17MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
18MODULE_LICENSE("GPL");18MODULE_LICENSE("GPL");
19MODULE_SUPPORTED_DEVICE("Atmel at76c506 PCI wireless cards");
20 19
21static const struct pci_device_id card_ids[] = {20static const struct pci_device_id card_ids[] = {
22 { 0x1114, 0x0506, PCI_ANY_ID, PCI_ANY_ID },21 { 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
87 87
88MODULE_AUTHOR("Broadcom Corporation");88MODULE_AUTHOR("Broadcom Corporation");
89MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver.");89MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver.");
90MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN cards");
91MODULE_LICENSE("Dual BSD/GPL");90MODULE_LICENSE("Dual BSD/GPL");
92/* This needs to be adjusted when brcms_firmwares changes */91/* This needs to be adjusted when brcms_firmwares changes */
93MODULE_FIRMWARE("brcm/bcm43xx-0.fw");92MODULE_FIRMWARE("brcm/bcm43xx-0.fw");
drivers/net/wireless/broadcom/brcm80211/brcmutil/utils.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
12 12
13MODULE_AUTHOR("Broadcom Corporation");13MODULE_AUTHOR("Broadcom Corporation");
14MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver utilities.");14MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver utilities.");
15MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN cards");
16MODULE_LICENSE("Dual BSD/GPL");15MODULE_LICENSE("Dual BSD/GPL");
17 16
18struct sk_buff *brcmu_pkt_buf_get_skb(uint len)17struct 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
251MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet cards. "251MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet cards. "
252 "Direct support for ISA/PCI/MPI cards and support for PCMCIA when used with airo_cs.");252 "Direct support for ISA/PCI/MPI cards and support for PCMCIA when used with airo_cs.");
253MODULE_LICENSE("Dual BSD/GPL");253MODULE_LICENSE("Dual BSD/GPL");
254MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340/350");
255module_param_hw_array(io, int, ioport, NULL, 0);254module_param_hw_array(io, int, ioport, NULL, 0);
256module_param_hw_array(irq, int, irq, NULL, 0);255module_param_hw_array(irq, int, irq, NULL, 0);
257module_param_array(rates, int, NULL, 0);256module_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
47 "cards. This is the module that links the PCMCIA card "47 "cards. This is the module that links the PCMCIA card "
48 "with the airo module.");48 "with the airo module.");
49MODULE_LICENSE("Dual BSD/GPL");49MODULE_LICENSE("Dual BSD/GPL");
50MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340 PCMCIA cards");
51 50
52/*====================================================================*/51/*====================================================================*/
53 52
drivers/net/wireless/intersil/hostap/hostap_cs.c+0−1
@@ -26,7 +26,6 @@ static char *dev_info = "hostap_cs"; · 25 unmodified lines
26MODULE_AUTHOR("Jouni Malinen");26MODULE_AUTHOR("Jouni Malinen");
27MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN "27MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN "
28 "cards (PC Card).");28 "cards (PC Card).");
29MODULE_SUPPORTED_DEVICE("Intersil Prism2-based WLAN cards (PC Card)");
30MODULE_LICENSE("GPL");29MODULE_LICENSE("GPL");
31 30
32 31
drivers/net/wireless/intersil/hostap/hostap_pci.c+0−1
@@ -27,7 +27,6 @@ static char *dev_info = "hostap_pci"; · 26 unmodified lines
27MODULE_AUTHOR("Jouni Malinen");27MODULE_AUTHOR("Jouni Malinen");
28MODULE_DESCRIPTION("Support for Intersil Prism2.5-based 802.11 wireless LAN "28MODULE_DESCRIPTION("Support for Intersil Prism2.5-based 802.11 wireless LAN "
29 "PCI cards.");29 "PCI cards.");
30MODULE_SUPPORTED_DEVICE("Intersil Prism2.5-based WLAN PCI cards");
31MODULE_LICENSE("GPL");30MODULE_LICENSE("GPL");
32 31
33 32
drivers/net/wireless/intersil/hostap/hostap_plx.c+0−1
@@ -30,7 +30,6 @@ static char *dev_info = "hostap_plx"; · 29 unmodified lines
30MODULE_AUTHOR("Jouni Malinen");30MODULE_AUTHOR("Jouni Malinen");
31MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN "31MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN "
32 "cards (PLX).");32 "cards (PLX).");
33MODULE_SUPPORTED_DEVICE("Intersil Prism2-based WLAN cards (PLX)");
34MODULE_LICENSE("GPL");33MODULE_LICENSE("GPL");
35 34
36 35
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
1821MODULE_AUTHOR(DRV_PROJECT);1821MODULE_AUTHOR(DRV_PROJECT);
1822MODULE_VERSION(DRV_VERSION);1822MODULE_VERSION(DRV_VERSION);
1823MODULE_DESCRIPTION("Ralink RT2400 PCI & PCMCIA Wireless LAN driver.");1823MODULE_DESCRIPTION("Ralink RT2400 PCI & PCMCIA Wireless LAN driver.");
1824MODULE_SUPPORTED_DEVICE("Ralink RT2460 PCI & PCMCIA chipset based cards");
1825MODULE_DEVICE_TABLE(pci, rt2400pci_device_table);1824MODULE_DEVICE_TABLE(pci, rt2400pci_device_table);
1826MODULE_LICENSE("GPL");1825MODULE_LICENSE("GPL");
1827 1826
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
2119MODULE_AUTHOR(DRV_PROJECT);2119MODULE_AUTHOR(DRV_PROJECT);
2120MODULE_VERSION(DRV_VERSION);2120MODULE_VERSION(DRV_VERSION);
2121MODULE_DESCRIPTION("Ralink RT2500 PCI & PCMCIA Wireless LAN driver.");2121MODULE_DESCRIPTION("Ralink RT2500 PCI & PCMCIA Wireless LAN driver.");
2122MODULE_SUPPORTED_DEVICE("Ralink RT2560 PCI & PCMCIA chipset based cards");
2123MODULE_DEVICE_TABLE(pci, rt2500pci_device_table);2122MODULE_DEVICE_TABLE(pci, rt2500pci_device_table);
2124MODULE_LICENSE("GPL");2123MODULE_LICENSE("GPL");
2125 2124
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
1956MODULE_AUTHOR(DRV_PROJECT);1956MODULE_AUTHOR(DRV_PROJECT);
1957MODULE_VERSION(DRV_VERSION);1957MODULE_VERSION(DRV_VERSION);
1958MODULE_DESCRIPTION("Ralink RT2500 USB Wireless LAN driver.");1958MODULE_DESCRIPTION("Ralink RT2500 USB Wireless LAN driver.");
1959MODULE_SUPPORTED_DEVICE("Ralink RT2570 USB chipset based cards");
1960MODULE_DEVICE_TABLE(usb, rt2500usb_device_table);1959MODULE_DEVICE_TABLE(usb, rt2500usb_device_table);
1961MODULE_LICENSE("GPL");1960MODULE_LICENSE("GPL");
1962 1961
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
439MODULE_AUTHOR(DRV_PROJECT);439MODULE_AUTHOR(DRV_PROJECT);
440MODULE_VERSION(DRV_VERSION);440MODULE_VERSION(DRV_VERSION);
441MODULE_DESCRIPTION("Ralink RT2800 PCI & PCMCIA Wireless LAN driver.");441MODULE_DESCRIPTION("Ralink RT2800 PCI & PCMCIA Wireless LAN driver.");
442MODULE_SUPPORTED_DEVICE("Ralink RT2860 PCI & PCMCIA chipset based cards");
443MODULE_FIRMWARE(FIRMWARE_RT2860);442MODULE_FIRMWARE(FIRMWARE_RT2860);
444MODULE_DEVICE_TABLE(pci, rt2800pci_device_table);443MODULE_DEVICE_TABLE(pci, rt2800pci_device_table);
445MODULE_LICENSE("GPL");444MODULE_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
1248MODULE_AUTHOR(DRV_PROJECT);1248MODULE_AUTHOR(DRV_PROJECT);
1249MODULE_VERSION(DRV_VERSION);1249MODULE_VERSION(DRV_VERSION);
1250MODULE_DESCRIPTION("Ralink RT2800 USB Wireless LAN driver.");1250MODULE_DESCRIPTION("Ralink RT2800 USB Wireless LAN driver.");
1251MODULE_SUPPORTED_DEVICE("Ralink RT2870 USB chipset based cards");
1252MODULE_DEVICE_TABLE(usb, rt2800usb_device_table);1251MODULE_DEVICE_TABLE(usb, rt2800usb_device_table);
1253MODULE_FIRMWARE(FIRMWARE_RT2870);1252MODULE_FIRMWARE(FIRMWARE_RT2870);
1254MODULE_LICENSE("GPL");1253MODULE_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
2993MODULE_AUTHOR(DRV_PROJECT);2993MODULE_AUTHOR(DRV_PROJECT);
2994MODULE_VERSION(DRV_VERSION);2994MODULE_VERSION(DRV_VERSION);
2995MODULE_DESCRIPTION("Ralink RT61 PCI & PCMCIA Wireless LAN driver.");2995MODULE_DESCRIPTION("Ralink RT61 PCI & PCMCIA Wireless LAN driver.");
2996MODULE_SUPPORTED_DEVICE("Ralink RT2561, RT2561s & RT2661 "
2997 "PCI & PCMCIA chipset based cards");
2998MODULE_DEVICE_TABLE(pci, rt61pci_device_table);2996MODULE_DEVICE_TABLE(pci, rt61pci_device_table);
2999MODULE_FIRMWARE(FIRMWARE_RT2561);2997MODULE_FIRMWARE(FIRMWARE_RT2561);
3000MODULE_FIRMWARE(FIRMWARE_RT2561s);2998MODULE_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
2513MODULE_AUTHOR(DRV_PROJECT);2513MODULE_AUTHOR(DRV_PROJECT);
2514MODULE_VERSION(DRV_VERSION);2514MODULE_VERSION(DRV_VERSION);
2515MODULE_DESCRIPTION("Ralink RT73 USB Wireless LAN driver.");2515MODULE_DESCRIPTION("Ralink RT73 USB Wireless LAN driver.");
2516MODULE_SUPPORTED_DEVICE("Ralink RT2571W & RT2671 USB chipset based cards");
2517MODULE_DEVICE_TABLE(usb, rt73usb_device_table);2516MODULE_DEVICE_TABLE(usb, rt73usb_device_table);
2518MODULE_FIRMWARE(FIRMWARE_RT2571);2517MODULE_FIRMWARE(FIRMWARE_RT2571);
2519MODULE_LICENSE("GPL");2518MODULE_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
441module_exit(rsi_91x_hal_module_exit);441module_exit(rsi_91x_hal_module_exit);
442MODULE_AUTHOR("Redpine Signals Inc");442MODULE_AUTHOR("Redpine Signals Inc");
443MODULE_DESCRIPTION("Station driver for RSI 91x devices");443MODULE_DESCRIPTION("Station driver for RSI 91x devices");
444MODULE_SUPPORTED_DEVICE("RSI-91x");
445MODULE_VERSION("0.1");444MODULE_VERSION("0.1");
446MODULE_LICENSE("Dual BSD/GPL");445MODULE_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
1571 1571
1572MODULE_AUTHOR("Redpine Signals Inc");1572MODULE_AUTHOR("Redpine Signals Inc");
1573MODULE_DESCRIPTION("Common SDIO layer for RSI drivers");1573MODULE_DESCRIPTION("Common SDIO layer for RSI drivers");
1574MODULE_SUPPORTED_DEVICE("RSI-91x");
1575MODULE_DEVICE_TABLE(sdio, rsi_dev_table);1574MODULE_DEVICE_TABLE(sdio, rsi_dev_table);
1576MODULE_FIRMWARE(FIRMWARE_RSI9113);1575MODULE_FIRMWARE(FIRMWARE_RSI9113);
1577MODULE_VERSION("0.1");1576MODULE_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
928 928
929MODULE_AUTHOR("Redpine Signals Inc");929MODULE_AUTHOR("Redpine Signals Inc");
930MODULE_DESCRIPTION("Common USB layer for RSI drivers");930MODULE_DESCRIPTION("Common USB layer for RSI drivers");
931MODULE_SUPPORTED_DEVICE("RSI-91x");
932MODULE_DEVICE_TABLE(usb, rsi_dev_table);931MODULE_DEVICE_TABLE(usb, rsi_dev_table);
933MODULE_FIRMWARE(FIRMWARE_RSI9113);932MODULE_FIRMWARE(FIRMWARE_RSI9113);
934MODULE_VERSION("0.1");933MODULE_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
1226 queue_delayed_work(nvme_wq, &ctrl->ka_work, ctrl->kato * HZ);1226 queue_delayed_work(nvme_wq, &ctrl->ka_work, ctrl->kato * HZ);
1227}1227}
1228 1228
1229static 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
1246static void nvme_keep_alive_work(struct work_struct *work)1229static void nvme_keep_alive_work(struct work_struct *work)
1247{1230{
1248 struct nvme_ctrl *ctrl = container_of(to_delayed_work(work),1231 struct nvme_ctrl *ctrl = container_of(to_delayed_work(work),
1249 struct nvme_ctrl, ka_work);1232 struct nvme_ctrl, ka_work);
1250 bool comp_seen = ctrl->comp_seen;1233 bool comp_seen = ctrl->comp_seen;
1234 struct request *rq;
1251 1235
1252 if ((ctrl->ctratt & NVME_CTRL_ATTR_TBKAS) && comp_seen) {1236 if ((ctrl->ctratt & NVME_CTRL_ATTR_TBKAS) && comp_seen) {
1253 dev_dbg(ctrl->device,1237 dev_dbg(ctrl->device,
@@ -1257,12 +1241,18 @@ static void nvme_keep_alive_work(struct work_struct *work) · 3 unmodified lines
1257 return;1241 return;
1258 }1242 }
1259 1243
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)) {
1261 /* allocation failure, reset the controller */1247 /* 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));
1263 nvme_reset_ctrl(ctrl);1249 nvme_reset_ctrl(ctrl);
1264 return;1250 return;
1265 }1251 }
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);
1266}1256}
1267 1257
1268static void nvme_start_keep_alive(struct nvme_ctrl *ctrl)1258static 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
1964 blk_queue_max_write_zeroes_sectors(queue, UINT_MAX);1954 blk_queue_max_write_zeroes_sectors(queue, UINT_MAX);
1965}1955}
1966 1956
1967static 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 */
1963static void nvme_config_write_zeroes(struct request_queue *q,
1964 struct nvme_ctrl *ctrl)
1968{1965{
1969 u64 max_blocks;1966 if ((ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) &&
1970 1967 !(ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES))
1971 if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) ||1968 blk_queue_max_write_zeroes_sectors(q, ctrl->max_hw_sectors);
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));
1991}1969}
1992 1970
1993static bool nvme_ns_ids_valid(struct nvme_ns_ids *ids)1971static 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
2159 set_capacity_and_notify(disk, capacity);2137 set_capacity_and_notify(disk, capacity);
2160 2138
2161 nvme_config_discard(disk, ns);2139 nvme_config_discard(disk, ns);
2162 nvme_config_write_zeroes(disk, ns);2140 nvme_config_write_zeroes(disk->queue, ns->ctrl);
2163 2141
2164 set_disk_ro(disk, (id->nsattr & NVME_NS_ATTR_RO) ||2142 set_disk_ro(disk, (id->nsattr & NVME_NS_ATTR_RO) ||
2165 test_bit(NVME_NS_FORCE_RO, &ns->flags));2143 test_bit(NVME_NS_FORCE_RO, &ns->flags));
drivers/nvme/host/fabrics.h+7−0
@@ -18,6 +18,13 @@ · 17 unmodified lines
18/* default is -1: the fail fast mechanism is disabled */18/* default is -1: the fail fast mechanism is disabled */
19#define NVMF_DEF_FAIL_FAST_TMO -119#define NVMF_DEF_FAIL_FAST_TMO -1
20 20
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
21/*28/*
22 * Define a host as seen by the target. We allocate one at boot, but also29 * Define a host as seen by the target. We allocate one at boot, but also
23 * allow the override it when creating controllers. This is both to provide30 * 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
2863 memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set));2863 memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set));
2864 ctrl->tag_set.ops = &nvme_fc_mq_ops;2864 ctrl->tag_set.ops = &nvme_fc_mq_ops;
2865 ctrl->tag_set.queue_depth = ctrl->ctrl.opts->queue_size;2865 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;
2867 ctrl->tag_set.numa_node = ctrl->ctrl.numa_node;2867 ctrl->tag_set.numa_node = ctrl->ctrl.numa_node;
2868 ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;2868 ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
2869 ctrl->tag_set.cmd_size =2869 ctrl->tag_set.cmd_size =
@@ -3485,7 +3485,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · 615 unmodified lines
3485 memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set));3485 memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set));
3486 ctrl->admin_tag_set.ops = &nvme_fc_admin_mq_ops;3486 ctrl->admin_tag_set.ops = &nvme_fc_admin_mq_ops;
3487 ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH;3487 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;
3489 ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node;3489 ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node;
3490 ctrl->admin_tag_set.cmd_size =3490 ctrl->admin_tag_set.cmd_size =
3491 struct_size((struct nvme_fcp_op_w_sgl *)NULL, priv,3491 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
736 return ret;736 return ret;
737 737
738 ctrl->ctrl.queue_count = nr_io_queues + 1;738 ctrl->ctrl.queue_count = nr_io_queues + 1;
739 if (ctrl->ctrl.queue_count < 2)739 if (ctrl->ctrl.queue_count < 2) {
740 return 0;740 dev_err(ctrl->ctrl.device,
741 "unable to set any I/O queues\n");
742 return -ENOMEM;
743 }
741 744
742 dev_info(ctrl->ctrl.device,745 dev_info(ctrl->ctrl.device,
743 "creating %d I/O queues.\n", nr_io_queues);746 "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
798 memset(set, 0, sizeof(*set));801 memset(set, 0, sizeof(*set));
799 set->ops = &nvme_rdma_admin_mq_ops;802 set->ops = &nvme_rdma_admin_mq_ops;
800 set->queue_depth = NVME_AQ_MQ_TAG_DEPTH;803 set->queue_depth = NVME_AQ_MQ_TAG_DEPTH;
801 set->reserved_tags = 2; /* connect + keep-alive */804 set->reserved_tags = NVMF_RESERVED_TAGS;
802 set->numa_node = nctrl->numa_node;805 set->numa_node = nctrl->numa_node;
803 set->cmd_size = sizeof(struct nvme_rdma_request) +806 set->cmd_size = sizeof(struct nvme_rdma_request) +
804 NVME_RDMA_DATA_SGL_SIZE;807 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
811 memset(set, 0, sizeof(*set));814 memset(set, 0, sizeof(*set));
812 set->ops = &nvme_rdma_mq_ops;815 set->ops = &nvme_rdma_mq_ops;
813 set->queue_depth = nctrl->sqsize + 1;816 set->queue_depth = nctrl->sqsize + 1;
814 set->reserved_tags = 1; /* fabric connect */817 set->reserved_tags = NVMF_RESERVED_TAGS;
815 set->numa_node = nctrl->numa_node;818 set->numa_node = nctrl->numa_node;
816 set->flags = BLK_MQ_F_SHOULD_MERGE;819 set->flags = BLK_MQ_F_SHOULD_MERGE;
817 set->cmd_size = sizeof(struct nvme_rdma_request) +820 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
287 * directly, otherwise queue io_work. Also, only do that if we287 * directly, otherwise queue io_work. Also, only do that if we
288 * are on the same cpu, so we don't introduce contention.288 * are on the same cpu, so we don't introduce contention.
289 */289 */
290 if (queue->io_cpu == __smp_processor_id() &&290 if (queue->io_cpu == raw_smp_processor_id() &&
291 sync && empty && mutex_trylock(&queue->send_mutex)) {291 sync && empty && mutex_trylock(&queue->send_mutex)) {
292 queue->more_requests = !last;292 queue->more_requests = !last;
293 nvme_tcp_send_all(queue);293 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
568 req->pdu_len = le32_to_cpu(pdu->r2t_length);568 req->pdu_len = le32_to_cpu(pdu->r2t_length);
569 req->pdu_sent = 0;569 req->pdu_sent = 0;
570 570
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
571 if (unlikely(req->data_sent + req->pdu_len > req->data_len)) {578 if (unlikely(req->data_sent + req->pdu_len > req->data_len)) {
572 dev_err(queue->ctrl->ctrl.device,579 dev_err(queue->ctrl->ctrl.device,
573 "req %d r2t len %u exceeded data len %u (%zu sent)\n",580 "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
1575 memset(set, 0, sizeof(*set));1582 memset(set, 0, sizeof(*set));
1576 set->ops = &nvme_tcp_admin_mq_ops;1583 set->ops = &nvme_tcp_admin_mq_ops;
1577 set->queue_depth = NVME_AQ_MQ_TAG_DEPTH;1584 set->queue_depth = NVME_AQ_MQ_TAG_DEPTH;
1578 set->reserved_tags = 2; /* connect + keep-alive */1585 set->reserved_tags = NVMF_RESERVED_TAGS;
1579 set->numa_node = nctrl->numa_node;1586 set->numa_node = nctrl->numa_node;
1580 set->flags = BLK_MQ_F_BLOCKING;1587 set->flags = BLK_MQ_F_BLOCKING;
1581 set->cmd_size = sizeof(struct nvme_tcp_request);1588 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
1587 memset(set, 0, sizeof(*set));1594 memset(set, 0, sizeof(*set));
1588 set->ops = &nvme_tcp_mq_ops;1595 set->ops = &nvme_tcp_mq_ops;
1589 set->queue_depth = nctrl->sqsize + 1;1596 set->queue_depth = nctrl->sqsize + 1;
1590 set->reserved_tags = 1; /* fabric connect */1597 set->reserved_tags = NVMF_RESERVED_TAGS;
1591 set->numa_node = nctrl->numa_node;1598 set->numa_node = nctrl->numa_node;
1592 set->flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING;1599 set->flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING;
1593 set->cmd_size = sizeof(struct nvme_tcp_request);1600 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
1745 return ret;1752 return ret;
1746 1753
1747 ctrl->queue_count = nr_io_queues + 1;1754 ctrl->queue_count = nr_io_queues + 1;
1748 if (ctrl->queue_count < 2)1755 if (ctrl->queue_count < 2) {
1749 return 0;1756 dev_err(ctrl->device,
1757 "unable to set any I/O queues\n");
1758 return -ENOMEM;
1759 }
1750 1760
1751 dev_info(ctrl->device,1761 dev_info(ctrl->device,
1752 "creating %d I/O queues.\n", nr_io_queues);1762 "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
1118{1118{
1119 lockdep_assert_held(&ctrl->lock);1119 lockdep_assert_held(&ctrl->lock);
1120 1120
1121 if (nvmet_cc_iosqes(ctrl->cc) != NVME_NVM_IOSQES ||1121 /*
1122 nvmet_cc_iocqes(ctrl->cc) != NVME_NVM_IOCQES ||1122 * Only I/O controllers should verify iosqes,iocqes.
1123 nvmet_cc_mps(ctrl->cc) != 0 ||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 ||
1124 nvmet_cc_ams(ctrl->cc) != 0 ||1135 nvmet_cc_ams(ctrl->cc) != 0 ||
1125 nvmet_cc_css(ctrl->cc) != 0) {1136 nvmet_cc_css(ctrl->cc) != 0) {
1126 ctrl->csts = NVME_CSTS_CFS;1137 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
349 memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set));349 memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set));
350 ctrl->admin_tag_set.ops = &nvme_loop_admin_mq_ops;350 ctrl->admin_tag_set.ops = &nvme_loop_admin_mq_ops;
351 ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH;351 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;
353 ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node;353 ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node;
354 ctrl->admin_tag_set.cmd_size = sizeof(struct nvme_loop_iod) +354 ctrl->admin_tag_set.cmd_size = sizeof(struct nvme_loop_iod) +
355 NVME_INLINE_SG_CNT * sizeof(struct scatterlist);355 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
520 memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set));520 memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set));
521 ctrl->tag_set.ops = &nvme_loop_mq_ops;521 ctrl->tag_set.ops = &nvme_loop_mq_ops;
522 ctrl->tag_set.queue_depth = ctrl->ctrl.opts->queue_size;522 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;
524 ctrl->tag_set.numa_node = ctrl->ctrl.numa_node;524 ctrl->tag_set.numa_node = ctrl->ctrl.numa_node;
525 ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;525 ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
526 ctrl->tag_set.cmd_size = sizeof(struct nvme_loop_iod) +526 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
1098 cmd->rbytes_done += ret;1098 cmd->rbytes_done += ret;
1099 }1099 }
1100 1100
1101 nvmet_tcp_unmap_pdu_iovec(cmd);
1101 if (queue->data_digest) {1102 if (queue->data_digest) {
1102 nvmet_tcp_prep_recv_ddgst(cmd);1103 nvmet_tcp_prep_recv_ddgst(cmd);
1103 return 0;1104 return 0;
1104 }1105 }
1105 nvmet_tcp_unmap_pdu_iovec(cmd);
1106 1106
1107 if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED) &&1107 if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED) &&
1108 cmd->rbytes_done == cmd->req.transfer_len) {1108 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
241 241
242MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>");242MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>");
243MODULE_DESCRIPTION("Parport Driver for Amiga builtin Port");243MODULE_DESCRIPTION("Parport Driver for Amiga builtin Port");
244MODULE_SUPPORTED_DEVICE("Amiga builtin Parallel Port");
245MODULE_LICENSE("GPL");244MODULE_LICENSE("GPL");
246MODULE_ALIAS("platform:amiga-parallel");245MODULE_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
218 218
219MODULE_AUTHOR("Andreas Schwab");219MODULE_AUTHOR("Andreas Schwab");
220MODULE_DESCRIPTION("Parport Driver for Atari builtin Port");220MODULE_DESCRIPTION("Parport Driver for Atari builtin Port");
221MODULE_SUPPORTED_DEVICE("Atari builtin Parallel Port");
222MODULE_LICENSE("GPL");221MODULE_LICENSE("GPL");
223 222
224module_init(parport_atari_init)223module_init(parport_atari_init)
drivers/parport/parport_gsc.c+0−1
@@ -41,7 +41,6 @@ · 40 unmodified lines
41 41
42MODULE_AUTHOR("Helge Deller <deller@gmx.de>");42MODULE_AUTHOR("Helge Deller <deller@gmx.de>");
43MODULE_DESCRIPTION("HP-PARISC PC-style parallel port driver");43MODULE_DESCRIPTION("HP-PARISC PC-style parallel port driver");
44MODULE_SUPPORTED_DEVICE("integrated PC-style parallel port");
45MODULE_LICENSE("GPL");44MODULE_LICENSE("GPL");
46 45
47 46
drivers/parport/parport_mfc3.c+0−1
@@ -359,7 +359,6 @@ static void __exit parport_mfc3_exit(void) · 358 unmodified lines
359 359
360MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>");360MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>");
361MODULE_DESCRIPTION("Parport Driver for Multiface 3 expansion cards Parallel Port");361MODULE_DESCRIPTION("Parport Driver for Multiface 3 expansion cards Parallel Port");
362MODULE_SUPPORTED_DEVICE("Multiface 3 Parallel Port");
363MODULE_LICENSE("GPL");362MODULE_LICENSE("GPL");
364 363
365module_init(parport_mfc3_init)364module_init(parport_mfc3_init)
drivers/parport/parport_sunbpp.c+0−1
@@ -377,6 +377,5 @@ module_platform_driver(bpp_sbus_driver); · 376 unmodified lines
377 377
378MODULE_AUTHOR("Derrick J Brashear");378MODULE_AUTHOR("Derrick J Brashear");
379MODULE_DESCRIPTION("Parport Driver for Sparc bidirectional Port");379MODULE_DESCRIPTION("Parport Driver for Sparc bidirectional Port");
380MODULE_SUPPORTED_DEVICE("Sparc Bidirectional Parallel Port");
381MODULE_VERSION("2.0");380MODULE_VERSION("2.0");
382MODULE_LICENSE("GPL");381MODULE_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
34 if (nbytes >= MAX_DRC_NAME_LEN)34 if (nbytes >= MAX_DRC_NAME_LEN)
35 return 0;35 return 0;
36 36
37 memcpy(drc_name, buf, nbytes);37 strscpy(drc_name, buf, nbytes + 1);
38 38
39 end = strchr(drc_name, '\n');39 end = strchr(drc_name, '\n');
40 if (!end)40 if (end)
41 end = &drc_name[nbytes];41 *end = '\0';
42 *end = '\0';
43 42
44 rc = dlpar_add_slot(drc_name);43 rc = dlpar_add_slot(drc_name);
45 if (rc)44 if (rc)
@@ -65,12 +64,11 @@ static ssize_t remove_slot_store(struct kobject *kobj, · 19 unmodified lines
65 if (nbytes >= MAX_DRC_NAME_LEN)64 if (nbytes >= MAX_DRC_NAME_LEN)
66 return 0;65 return 0;
67 66
68 memcpy(drc_name, buf, nbytes);67 strscpy(drc_name, buf, nbytes + 1);
69 68
70 end = strchr(drc_name, '\n');69 end = strchr(drc_name, '\n');
71 if (!end)70 if (end)
72 end = &drc_name[nbytes];71 *end = '\0';
73 *end = '\0';
74 72
75 rc = dlpar_remove_slot(drc_name);73 rc = dlpar_remove_slot(drc_name);
76 if (rc)74 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
93 pci_dev_put(pdev);93 pci_dev_put(pdev);
94 return -EBUSY;94 return -EBUSY;
95 }95 }
96 pci_dev_put(pdev);
96 97
97 zpci_remove_device(zdev);98 zpci_remove_device(zdev, false);
98 99
99 rc = zpci_disable_device(zdev);100 rc = zpci_disable_device(zdev);
100 if (rc)101 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
63MODULE_AUTHOR("Holger Smolinski <Holger.Smolinski@de.ibm.com>");63MODULE_AUTHOR("Holger Smolinski <Holger.Smolinski@de.ibm.com>");
64MODULE_DESCRIPTION("Linux on S/390 DASD device driver,"64MODULE_DESCRIPTION("Linux on S/390 DASD device driver,"
65 " Copyright IBM Corp. 2000");65 " Copyright IBM Corp. 2000");
66MODULE_SUPPORTED_DEVICE("dasd");
67MODULE_LICENSE("GPL");66MODULE_LICENSE("GPL");
68 67
69/*68/*
drivers/sbus/char/display7seg.c+0−1
@@ -50,7 +50,6 @@ MODULE_PARM_DESC(sol_compat, · 49 unmodified lines
50MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");50MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");
51MODULE_DESCRIPTION("7-Segment Display driver for Sun Microsystems CP1400/1500");51MODULE_DESCRIPTION("7-Segment Display driver for Sun Microsystems CP1400/1500");
52MODULE_LICENSE("GPL");52MODULE_LICENSE("GPL");
53MODULE_SUPPORTED_DEVICE("d7s");
54 53
55struct d7s {54struct d7s {
56 void __iomem *regs;55 void __iomem *regs;
drivers/scsi/hpsa.c+0−1
@@ -80,7 +80,6 @@ · 79 unmodified lines
80MODULE_AUTHOR("Hewlett-Packard Company");80MODULE_AUTHOR("Hewlett-Packard Company");
81MODULE_DESCRIPTION("Driver for HP Smart Array Controller version " \81MODULE_DESCRIPTION("Driver for HP Smart Array Controller version " \
82 HPSA_DRIVER_VERSION);82 HPSA_DRIVER_VERSION);
83MODULE_SUPPORTED_DEVICE("HP Smart Array Controllers");
84MODULE_VERSION(HPSA_DRIVER_VERSION);83MODULE_VERSION(HPSA_DRIVER_VERSION);
85MODULE_LICENSE("GPL");84MODULE_LICENSE("GPL");
86MODULE_ALIAS("cciss");85MODULE_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
5784 vhost->disc_buf_dma);5784 vhost->disc_buf_dma);
5785 dma_free_coherent(vhost->dev, sizeof(*vhost->login_buf),5785 dma_free_coherent(vhost->dev, sizeof(*vhost->login_buf),
5786 vhost->login_buf, vhost->login_buf_dma);5786 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);
5787 dma_pool_destroy(vhost->sg_pool);5789 dma_pool_destroy(vhost->sg_pool);
5788 ibmvfc_free_queue(vhost, async_q);5790 ibmvfc_free_queue(vhost, async_q);
5789 LEAVE;5791 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
2421 memset(dstbuf, 0, 33);2421 memset(dstbuf, 0, 33);
2422 size = (nbytes < 32) ? nbytes : 32;2422 size = (nbytes < 32) ? nbytes : 32;
2423 if (copy_from_user(dstbuf, buf, size))2423 if (copy_from_user(dstbuf, buf, size))
2424 return 0;2424 return -EFAULT;
2425 2425
2426 if (dent == phba->debug_InjErrLBA) {2426 if (dent == phba->debug_InjErrLBA) {
2427 if ((dstbuf[0] == 'o') && (dstbuf[1] == 'f') &&2427 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
2430 }2430 }
2431 2431
2432 if ((tmp == 0) && (kstrtoull(dstbuf, 0, &tmp)))2432 if ((tmp == 0) && (kstrtoull(dstbuf, 0, &tmp)))
2433 return 0;2433 return -EINVAL;
2434 2434
2435 if (dent == phba->debug_writeGuard)2435 if (dent == phba->debug_writeGuard)
2436 phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp;2436 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
413 * And add this object to port_table_list.413 * And add this object to port_table_list.
414 */414 */
415 if (!ioc->multipath_on_hba) {415 if (!ioc->multipath_on_hba) {
416 port = kzalloc(sizeof(struct hba_port), GFP_KERNEL);416 port = kzalloc(sizeof(struct hba_port), GFP_ATOMIC);
417 if (!port)417 if (!port)
418 return NULL;418 return NULL;
419 419
drivers/scsi/myrs.c+1−1
@@ -2273,12 +2273,12 @@ static void myrs_cleanup(struct myrs_hba *cs) · 2272 unmodified lines
2273 if (cs->mmio_base) {2273 if (cs->mmio_base) {
2274 cs->disable_intr(cs);2274 cs->disable_intr(cs);
2275 iounmap(cs->mmio_base);2275 iounmap(cs->mmio_base);
2276 cs->mmio_base = NULL;
2276 }2277 }
2277 if (cs->irq)2278 if (cs->irq)
2278 free_irq(cs->irq, cs);2279 free_irq(cs->irq, cs);
2279 if (cs->io_addr)2280 if (cs->io_addr)
2280 release_region(cs->io_addr, 0x80);2281 release_region(cs->io_addr, 0x80);
2281 iounmap(cs->mmio_base);
2282 pci_set_drvdata(pdev, NULL);2282 pci_set_drvdata(pdev, NULL);
2283 pci_disable_device(pdev);2283 pci_disable_device(pdev);
2284 scsi_host_put(cs->host);2284 scsi_host_put(cs->host);
drivers/scsi/pcmcia/nsp_cs.c+0−1
@@ -55,7 +55,6 @@ · 54 unmodified lines
55 55
56MODULE_AUTHOR("YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>");56MODULE_AUTHOR("YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>");
57MODULE_DESCRIPTION("WorkBit NinjaSCSI-3 / NinjaSCSI-32Bi(16bit) PCMCIA SCSI host adapter module");57MODULE_DESCRIPTION("WorkBit NinjaSCSI-3 / NinjaSCSI-32Bi(16bit) PCMCIA SCSI host adapter module");
58MODULE_SUPPORTED_DEVICE("sd,sr,sg,st");
59MODULE_LICENSE("GPL");58MODULE_LICENSE("GPL");
60 59
61#include "nsp_io.h"60#include "nsp_io.h"
drivers/scsi/qla2xxx/qla_target.h+1−1
@@ -116,7 +116,6 @@ · 115 unmodified lines
116 (min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \116 (min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \
117 QLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0))117 QLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0))
118#endif118#endif
119#endif
120 119
121#define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha)) \120#define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha)) \
122 ? le16_to_cpu((iocb)->u.isp2x.target.extended) \121 ? le16_to_cpu((iocb)->u.isp2x.target.extended) \
@@ -244,6 +243,7 @@ struct ctio_to_2xxx { · 121 unmodified lines
244#ifndef CTIO_RET_TYPE243#ifndef CTIO_RET_TYPE
245#define CTIO_RET_TYPE 0x17 /* CTIO return entry */244#define CTIO_RET_TYPE 0x17 /* CTIO return entry */
246#define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */245#define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */
246#endif
247 247
248struct fcp_hdr {248struct fcp_hdr {
249 uint8_t r_ctl;249 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
280static void sd_zbc_update_wp_offset_workfn(struct work_struct *work)280static void sd_zbc_update_wp_offset_workfn(struct work_struct *work)
281{281{
282 struct scsi_disk *sdkp;282 struct scsi_disk *sdkp;
283 unsigned long flags;
283 unsigned int zno;284 unsigned int zno;
284 int ret;285 int ret;
285 286
286 sdkp = container_of(work, struct scsi_disk, zone_wp_offset_work);287 sdkp = container_of(work, struct scsi_disk, zone_wp_offset_work);
287 288
288 spin_lock_bh(&sdkp->zones_wp_offset_lock);289 spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags);
289 for (zno = 0; zno < sdkp->nr_zones; zno++) {290 for (zno = 0; zno < sdkp->nr_zones; zno++) {
290 if (sdkp->zones_wp_offset[zno] != SD_ZBC_UPDATING_WP_OFST)291 if (sdkp->zones_wp_offset[zno] != SD_ZBC_UPDATING_WP_OFST)
291 continue;292 continue;
292 293
293 spin_unlock_bh(&sdkp->zones_wp_offset_lock);294 spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags);
294 ret = sd_zbc_do_report_zones(sdkp, sdkp->zone_wp_update_buf,295 ret = sd_zbc_do_report_zones(sdkp, sdkp->zone_wp_update_buf,
295 SD_BUF_SIZE,296 SD_BUF_SIZE,
296 zno * sdkp->zone_blocks, true);297 zno * sdkp->zone_blocks, true);
297 spin_lock_bh(&sdkp->zones_wp_offset_lock);298 spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags);
298 if (!ret)299 if (!ret)
299 sd_zbc_parse_report(sdkp, sdkp->zone_wp_update_buf + 64,300 sd_zbc_parse_report(sdkp, sdkp->zone_wp_update_buf + 64,
300 zno, sd_zbc_update_wp_offset_cb,301 zno, sd_zbc_update_wp_offset_cb,
301 sdkp);302 sdkp);
302 }303 }
303 spin_unlock_bh(&sdkp->zones_wp_offset_lock);304 spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags);
304 305
305 scsi_device_put(sdkp->device);306 scsi_device_put(sdkp->device);
306}307}
@@ -324,6 +325,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba, · 17 unmodified lines
324 struct request *rq = cmd->request;325 struct request *rq = cmd->request;
325 struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);326 struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);
326 unsigned int wp_offset, zno = blk_rq_zone_no(rq);327 unsigned int wp_offset, zno = blk_rq_zone_no(rq);
328 unsigned long flags;
327 blk_status_t ret;329 blk_status_t ret;
328 330
329 ret = sd_zbc_cmnd_checks(cmd);331 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
337 if (!blk_req_zone_write_trylock(rq))339 if (!blk_req_zone_write_trylock(rq))
338 return BLK_STS_ZONE_RESOURCE;340 return BLK_STS_ZONE_RESOURCE;
339 341
340 spin_lock_bh(&sdkp->zones_wp_offset_lock);342 spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags);
341 wp_offset = sdkp->zones_wp_offset[zno];343 wp_offset = sdkp->zones_wp_offset[zno];
342 switch (wp_offset) {344 switch (wp_offset) {
343 case SD_ZBC_INVALID_WP_OFST:345 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
366 368
367 *lba += wp_offset;369 *lba += wp_offset;
368 }370 }
369 spin_unlock_bh(&sdkp->zones_wp_offset_lock);371 spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags);
370 if (ret)372 if (ret)
371 blk_req_zone_write_unlock(rq);373 blk_req_zone_write_unlock(rq);
372 return ret;374 return ret;
@@ -445,6 +447,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, · 72 unmodified lines
445 struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);447 struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);
446 unsigned int zno = blk_rq_zone_no(rq);448 unsigned int zno = blk_rq_zone_no(rq);
447 enum req_opf op = req_op(rq);449 enum req_opf op = req_op(rq);
450 unsigned long flags;
448 451
449 /*452 /*
450 * If we got an error for a command that needs updating the write453 * 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
452 * invalid to force an update from disk the next time a zone append455 * invalid to force an update from disk the next time a zone append
453 * command is issued.456 * command is issued.
454 */457 */
455 spin_lock_bh(&sdkp->zones_wp_offset_lock);458 spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags);
456 459
457 if (result && op != REQ_OP_ZONE_RESET_ALL) {460 if (result && op != REQ_OP_ZONE_RESET_ALL) {
458 if (op == REQ_OP_ZONE_APPEND) {461 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
496 }499 }
497 500
498unlock_wp_offset:501unlock_wp_offset:
499 spin_unlock_bh(&sdkp->zones_wp_offset_lock);502 spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags);
500 503
501 return good_bytes;504 return good_bytes;
502}505}
drivers/scsi/smartpqi/smartpqi_init.c+0−1
@@ -48,7 +48,6 @@ · 47 unmodified lines
48MODULE_AUTHOR("Microsemi");48MODULE_AUTHOR("Microsemi");
49MODULE_DESCRIPTION("Driver for Microsemi Smart Family Controller version "49MODULE_DESCRIPTION("Driver for Microsemi Smart Family Controller version "
50 DRIVER_VERSION);50 DRIVER_VERSION);
51MODULE_SUPPORTED_DEVICE("Microsemi Smart Family Controllers");
52MODULE_VERSION(DRIVER_VERSION);51MODULE_VERSION(DRIVER_VERSION);
53MODULE_LICENSE("GPL");52MODULE_LICENSE("GPL");
54 53
drivers/scsi/st.c+1−1
@@ -1269,8 +1269,8 @@ static int st_open(struct inode *inode, struct file *filp) · 1268 unmodified lines
1269 spin_lock(&st_use_lock);1269 spin_lock(&st_use_lock);
1270 if (STp->in_use) {1270 if (STp->in_use) {
1271 spin_unlock(&st_use_lock);1271 spin_unlock(&st_use_lock);
1272 scsi_tape_put(STp);
1273 DEBC_printk(STp, "Device already in use.\n");1272 DEBC_printk(STp, "Device already in use.\n");
1273 scsi_tape_put(STp);
1274 return (-EBUSY);1274 return (-EBUSY);
1275 }1275 }
1276 1276
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
911 if (!hba->vreg_info.vccq2 || !hba->vreg_info.vcc)911 if (!hba->vreg_info.vccq2 || !hba->vreg_info.vcc)
912 return;912 return;
913 913
914 if (lpm & !hba->vreg_info.vcc->enabled)914 if (lpm && !hba->vreg_info.vcc->enabled)
915 regulator_set_mode(hba->vreg_info.vccq2->reg,915 regulator_set_mode(hba->vreg_info.vccq2->reg,
916 REGULATOR_MODE_IDLE);916 REGULATOR_MODE_IDLE);
917 else if (!lpm)917 else if (!lpm)
drivers/sh/maple/maple.c+0−1
@@ -30,7 +30,6 @@ · 29 unmodified lines
30MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");30MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");
31MODULE_DESCRIPTION("Maple bus driver for Dreamcast");31MODULE_DESCRIPTION("Maple bus driver for Dreamcast");
32MODULE_LICENSE("GPL v2");32MODULE_LICENSE("GPL v2");
33MODULE_SUPPORTED_DEVICE("{{SEGA, Dreamcast/Maple}}");
34 33
35static void maple_dma_handler(struct work_struct *work);34static void maple_dma_handler(struct work_struct *work);
36static void maple_vblank_handler(struct work_struct *work);35static 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
1433 cqspi = spi_master_get_devdata(master);1433 cqspi = spi_master_get_devdata(master);
1434 1434
1435 cqspi->pdev = pdev;1435 cqspi->pdev = pdev;
1436 platform_set_drvdata(pdev, cqspi);
1436 1437
1437 /* Obtain configuration from OF. */1438 /* Obtain configuration from OF. */
1438 ret = cqspi_of_get_pdata(cqspi);1439 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
1281 devpriv->amcc + AMCC_OP_REG_INTCSR);1281 devpriv->amcc + AMCC_OP_REG_INTCSR);
1282 1282
1283 ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED,1283 ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED,
1284 dev->board_name, dev);1284 "cb_pcidas", dev);
1285 if (ret) {1285 if (ret) {
1286 dev_dbg(dev->class_dev, "unable to allocate irq %d\n",1286 dev_dbg(dev->class_dev, "unable to allocate irq %d\n",
1287 pcidev->irq);1287 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
4035 init_stc_registers(dev);4035 init_stc_registers(dev);
4036 4036
4037 retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,4037 retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
4038 dev->board_name, dev);4038 "cb_pcidas64", dev);
4039 if (retval) {4039 if (retval) {
4040 dev_dbg(dev->class_dev, "unable to allocate irq %u\n",4040 dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
4041 pcidev->irq);4041 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
877 877
878MODULE_AUTHOR("Manuel Gebele <forensixs@gmx.de>");878MODULE_AUTHOR("Manuel Gebele <forensixs@gmx.de>");
879MODULE_DESCRIPTION("Velleman USB Board Low-Level Driver");879MODULE_DESCRIPTION("Velleman USB Board Low-Level Driver");
880MODULE_SUPPORTED_DEVICE("K8055/K8061 aka VM110/VM140");
881MODULE_LICENSE("GPL");880MODULE_LICENSE("GPL");
drivers/staging/vt6655/rxtx.h+2−2
@@ -150,7 +150,7 @@ struct vnt_cts { · 149 unmodified lines
150 u16 reserved;150 u16 reserved;
151 struct ieee80211_cts data;151 struct ieee80211_cts data;
152 u16 reserved2;152 u16 reserved2;
153} __packed;153} __packed __aligned(2);
154 154
155struct vnt_cts_fb {155struct vnt_cts_fb {
156 struct vnt_phy_field b;156 struct vnt_phy_field b;
@@ -160,7 +160,7 @@ struct vnt_cts_fb { · 3 unmodified lines
160 __le16 cts_duration_ba_f1;160 __le16 cts_duration_ba_f1;
161 struct ieee80211_cts data;161 struct ieee80211_cts data;
162 u16 reserved2;162 u16 reserved2;
163} __packed;163} __packed __aligned(2);
164 164
165struct vnt_tx_fifo_head {165struct vnt_tx_fifo_head {
166 u8 tx_key[WLAN_KEY_LEN_CCMP];166 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
747 747
748MODULE_AUTHOR("Linaro");748MODULE_AUTHOR("Linaro");
749MODULE_DESCRIPTION("OP-TEE driver");749MODULE_DESCRIPTION("OP-TEE driver");
750MODULE_SUPPORTED_DEVICE("");
751MODULE_VERSION("1.0");750MODULE_VERSION("1.0");
752MODULE_LICENSE("GPL v2");751MODULE_LICENSE("GPL v2");
753MODULE_ALIAS("platform:optee");752MODULE_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
674{674{
675 struct cooling_dev_stats *stats = cdev->stats;675 struct cooling_dev_stats *stats = cdev->stats;
676 676
677 if (!stats)
678 return;
679
677 spin_lock(&stats->lock);680 spin_lock(&stats->lock);
678 681
679 if (stats->state == new_state)682 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
768 768
769 tb_dump_port(port->sw->tb, &port->config);769 tb_dump_port(port->sw->tb, &port->config);
770 770
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
777 INIT_LIST_HEAD(&port->list);771 INIT_LIST_HEAD(&port->list);
778 return 0;772 return 0;
779 773
@@ -1842,10 +1836,8 @@ static void tb_switch_release(struct device *dev) · 1062 unmodified lines
1842 dma_port_free(sw->dma_port);1836 dma_port_free(sw->dma_port);
1843 1837
1844 tb_switch_for_each_port(sw, port) {1838 tb_switch_for_each_port(sw, port) {
1845 if (!port->disabled) {1839 ida_destroy(&port->in_hopids);
1846 ida_destroy(&port->in_hopids);1840 ida_destroy(&port->out_hopids);
1847 ida_destroy(&port->out_hopids);
1848 }
1849 }1841 }
1850 1842
1851 kfree(sw->uuid);1843 kfree(sw->uuid);
@@ -2025,6 +2017,12 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, struct device *parent, · 173 unmodified lines
2025 /* minimum setup for tb_find_cap and tb_drom_read to work */2017 /* minimum setup for tb_find_cap and tb_drom_read to work */
2026 sw->ports[i].sw = sw;2018 sw->ports[i].sw = sw;
2027 sw->ports[i].port = i;2019 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 }
2028 }2026 }
2029 2027
2030 ret = tb_switch_find_vse_cap(sw, TB_VSE_CAP_PLUG_EVENTS);2028 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
138 parent->boot = true;138 parent->boot = true;
139 parent = tb_switch_parent(parent);139 parent = tb_switch_parent(parent);
140 }140 }
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);
141 }145 }
142 146
143 list_add_tail(&tunnel->list, &tcm->tunnel_list);147 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
1639 1639
1640MODULE_AUTHOR("Michael Anderson <mjanders@us.ibm.com>");1640MODULE_AUTHOR("Michael Anderson <mjanders@us.ibm.com>");
1641MODULE_DESCRIPTION("IBM iSeries Serial IOA driver");1641MODULE_DESCRIPTION("IBM iSeries Serial IOA driver");
1642MODULE_SUPPORTED_DEVICE
1643 ("IBM iSeries 2745, 2771, 2772, 2742, 2793 and 2805 Communications adapters");
1644MODULE_LICENSE("GPL");1642MODULE_LICENSE("GPL");
1645MODULE_FIRMWARE("icom_call_setup.bin");1643MODULE_FIRMWARE("icom_call_setup.bin");
1646MODULE_FIRMWARE("icom_res_dce.bin");1644MODULE_FIRMWARE("icom_res_dce.bin");
drivers/tty/serial/jsm/jsm_driver.c+0−1
@@ -19,7 +19,6 @@ · 18 unmodified lines
19MODULE_AUTHOR("Digi International, https://www.digi.com");19MODULE_AUTHOR("Digi International, https://www.digi.com");
20MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI based product line");20MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI based product line");
21MODULE_LICENSE("GPL");21MODULE_LICENSE("GPL");
22MODULE_SUPPORTED_DEVICE("jsm");
23 22
24#define JSM_DRIVER_NAME "jsm"23#define JSM_DRIVER_NAME "jsm"
25#define NR_PORTS 3224#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
2197 * inverted in the first TDs isoc TRB.2197 * inverted in the first TDs isoc TRB.
2198 */2198 */
2199 field = TRB_TYPE(TRB_ISOC) | TRB_TLBPC(last_burst_pkt) |2199 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;
2201 2204
2202 /* Fill the rest of the TRB fields, and remaining normal TRBs. */2205 /* Fill the rest of the TRB fields, and remaining normal TRBs. */
2203 for (i = 0; i < trbs_per_td; i++) {2206 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
783 783
784 trace_dwc3_gadget_ep_disable(dep);784 trace_dwc3_gadget_ep_disable(dep);
785 785
786 dwc3_remove_requests(dwc, dep);
787
788 /* make sure HW endpoint isn't stalled */786 /* make sure HW endpoint isn't stalled */
789 if (dep->flags & DWC3_EP_STALL)787 if (dep->flags & DWC3_EP_STALL)
790 __dwc3_gadget_ep_set_halt(dep, 0, false);788 __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
803 dep->endpoint.desc = NULL;801 dep->endpoint.desc = NULL;
804 }802 }
805 803
804 dwc3_remove_requests(dwc, dep);
805
806 return 0;806 return 0;
807}807}
808 808
@@ -1617,7 +1617,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) · 808 unmodified lines
1617{1617{
1618 struct dwc3 *dwc = dep->dwc;1618 struct dwc3 *dwc = dep->dwc;
1619 1619
1620 if (!dep->endpoint.desc || !dwc->pullups_connected) {1620 if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) {
1621 dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",1621 dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
1622 dep->name);1622 dep->name);
1623 return -ESHUTDOWN;1623 return -ESHUTDOWN;
@@ -2247,6 +2247,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) · 623 unmodified lines
2247 if (!is_on) {2247 if (!is_on) {
2248 u32 count;2248 u32 count;
2249 2249
2250 dwc->connected = false;
2250 /*2251 /*
2251 * In the Synopsis DesignWare Cores USB3 Databook Rev. 3.30a2252 * In the Synopsis DesignWare Cores USB3 Databook Rev. 3.30a
2252 * Section 4.1.8 Table 4-7, it states that for a device-initiated2253 * 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
2271 dwc->ev_buf->lpos = (dwc->ev_buf->lpos + count) %2272 dwc->ev_buf->lpos = (dwc->ev_buf->lpos + count) %
2272 dwc->ev_buf->length;2273 dwc->ev_buf->length;
2273 }2274 }
2274 dwc->connected = false;
2275 } else {2275 } else {
2276 __dwc3_gadget_start(dwc);2276 __dwc3_gadget_start(dwc);
2277 }2277 }
@@ -3329,8 +3329,6 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc) · 1051 unmodified lines
3329{3329{
3330 u32 reg;3330 u32 reg;
3331 3331
3332 dwc->connected = true;
3333
3334 /*3332 /*
3335 * WORKAROUND: DWC3 revisions <1.88a have an issue which3333 * WORKAROUND: DWC3 revisions <1.88a have an issue which
3336 * would cause a missing Disconnect Event if there's a3334 * 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
3370 * transfers."3368 * transfers."
3371 */3369 */
3372 dwc3_stop_active_transfers(dwc);3370 dwc3_stop_active_transfers(dwc);
3371 dwc->connected = true;
3373 3372
3374 reg = dwc3_readl(dwc->regs, DWC3_DCTL);3373 reg = dwc3_readl(dwc->regs, DWC3_DCTL);
3375 reg &= ~DWC3_DCTL_TSTCTRL_MASK;3374 reg &= ~DWC3_DCTL_TSTCTRL_MASK;
drivers/usb/gadget/configfs.c+10−4
@@ -97,6 +97,8 @@ struct gadget_config_name { · 96 unmodified lines
97 struct list_head list;97 struct list_head list;
98};98};
99 99
100#define USB_MAX_STRING_WITH_NULL_LEN (USB_MAX_STRING_LEN+1)
101
100static int usb_string_copy(const char *s, char **s_copy)102static int usb_string_copy(const char *s, char **s_copy)
101{103{
102 int ret;104 int ret;
@@ -106,12 +108,16 @@ static int usb_string_copy(const char *s, char **s_copy) · 3 unmodified lines
106 if (ret > USB_MAX_STRING_LEN)108 if (ret > USB_MAX_STRING_LEN)
107 return -EOVERFLOW;109 return -EOVERFLOW;
108 110
109 str = kstrdup(s, GFP_KERNEL);111 if (copy) {
110 if (!str)112 str = copy;
111 return -ENOMEM;113 } else {
114 str = kmalloc(USB_MAX_STRING_WITH_NULL_LEN, GFP_KERNEL);
115 if (!str)
116 return -ENOMEM;
117 }
118 strcpy(str, s);
112 if (str[ret - 1] == '\n')119 if (str[ret - 1] == '\n')
113 str[ret - 1] = '\0';120 str[ret - 1] = '\0';
114 kfree(copy);
115 *s_copy = str;121 *s_copy = str;
116 return 0;122 return 0;
117}123}
drivers/usb/misc/ldusb.c+0−1
@@ -117,7 +117,6 @@ MODULE_DEVICE_TABLE(usb, ld_usb_table); · 116 unmodified lines
117MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>");117MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>");
118MODULE_DESCRIPTION("LD USB Driver");118MODULE_DESCRIPTION("LD USB Driver");
119MODULE_LICENSE("GPL");119MODULE_LICENSE("GPL");
120MODULE_SUPPORTED_DEVICE("LD USB Devices");
121 120
122/* All interrupt in transfers are collected in a ring buffer to121/* All interrupt in transfers are collected in a ring buffer to
123 * avoid racing conditions and get better performance of the driver.122 * 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
656 need_auto_sense = 1;656 need_auto_sense = 1;
657 }657 }
658 658
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
659 /*666 /*
660 * If we have a failure, we're going to do a REQUEST_SENSE 667 * If we have a failure, we're going to do a REQUEST_SENSE
661 * automatically. Note that we differentiate between a command668 * 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
2211 USB_SC_DEVICE, USB_PR_DEVICE, NULL,2211 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
2212 US_FL_NO_READ_DISC_INFO ),2212 US_FL_NO_READ_DISC_INFO ),
2213 2213
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 */
2220UNUSUAL_DEV( 0x1949, 0x0004, 0x0000, 0x9999,
2221 "Amazon",
2222 "Kindle",
2223 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
2224 US_FL_SENSE_AFTER_SYNC ),
2225
2214/*2226/*
2215 * Reported by Oliver Neukum <oneukum@suse.com>2227 * Reported by Oliver Neukum <oneukum@suse.com>
2216 * This device morphes spontaneously into another device if the access2228 * 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
945 945
946 port->supply_voltage = mv;946 port->supply_voltage = mv;
947 port->current_limit = max_ma;947 port->current_limit = max_ma;
948 power_supply_changed(port->psy);
948 949
949 if (port->tcpc->set_current_limit)950 if (port->tcpc->set_current_limit)
950 ret = port->tcpc->set_current_limit(port->tcpc, max_ma, mv);951 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
2931 2932
2932 port->pps_data.supported = false;2933 port->pps_data.supported = false;
2933 port->usb_type = POWER_SUPPLY_USB_TYPE_PD;2934 port->usb_type = POWER_SUPPLY_USB_TYPE_PD;
2935 power_supply_changed(port->psy);
2934 2936
2935 /*2937 /*
2936 * Select the source PDO providing the most power which has a2938 * 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
2955 port->pps_data.supported = true;2957 port->pps_data.supported = true;
2956 port->usb_type =2958 port->usb_type =
2957 POWER_SUPPLY_USB_TYPE_PD_PPS;2959 POWER_SUPPLY_USB_TYPE_PD_PPS;
2960 power_supply_changed(port->psy);
2958 }2961 }
2959 continue;2962 continue;
2960 default:2963 default:
@@ -3112,6 +3115,7 @@ static unsigned int tcpm_pd_select_pps_apdo(struct tcpm_port *port) · 151 unmodified lines
3112 port->pps_data.out_volt));3115 port->pps_data.out_volt));
3113 port->pps_data.op_curr = min(port->pps_data.max_curr,3116 port->pps_data.op_curr = min(port->pps_data.max_curr,
3114 port->pps_data.op_curr);3117 port->pps_data.op_curr);
3118 power_supply_changed(port->psy);
3115 }3119 }
3116 3120
3117 return src_pdo;3121 return src_pdo;
@@ -3347,6 +3351,7 @@ static int tcpm_set_charge(struct tcpm_port *port, bool charge) · 229 unmodified lines
3347 return ret;3351 return ret;
3348 }3352 }
3349 port->vbus_charge = charge;3353 port->vbus_charge = charge;
3354 power_supply_changed(port->psy);
3350 return 0;3355 return 0;
3351}3356}
3352 3357
@@ -3530,6 +3535,7 @@ static void tcpm_reset_port(struct tcpm_port *port) · 177 unmodified lines
3530 port->try_src_count = 0;3535 port->try_src_count = 0;
3531 port->try_snk_count = 0;3536 port->try_snk_count = 0;
3532 port->usb_type = POWER_SUPPLY_USB_TYPE_C;3537 port->usb_type = POWER_SUPPLY_USB_TYPE_C;
3538 power_supply_changed(port->psy);
3533 port->nr_sink_caps = 0;3539 port->nr_sink_caps = 0;
3534 port->sink_cap_done = false;3540 port->sink_cap_done = false;
3535 if (port->tcpc->enable_frs)3541 if (port->tcpc->enable_frs)
@@ -5219,7 +5225,7 @@ static void tcpm_enable_frs_work(struct kthread_work *work) · 1683 unmodified lines
5219 goto unlock;5225 goto unlock;
5220 5226
5221 /* Send when the state machine is idle */5227 /* 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)
5223 goto resched;5229 goto resched;
5224 5230
5225 port->upcoming_state = GET_SINK_CAP;5231 port->upcoming_state = GET_SINK_CAP;
@@ -5957,7 +5963,7 @@ static int tcpm_psy_set_prop(struct power_supply *psy, · 731 unmodified lines
5957 ret = -EINVAL;5963 ret = -EINVAL;
5958 break;5964 break;
5959 }5965 }
5960 5966 power_supply_changed(port->psy);
5961 return ret;5967 return ret;
5962}5968}
5963 5969
@@ -6110,6 +6116,7 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) · 146 unmodified lines
6110 err = devm_tcpm_psy_register(port);6116 err = devm_tcpm_psy_register(port);
6111 if (err)6117 if (err)
6112 goto out_role_sw_put;6118 goto out_role_sw_put;
6119 power_supply_changed(port->psy);
6113 6120
6114 port->typec_port = typec_register_port(port->dev, &port->typec_caps);6121 port->typec_port = typec_register_port(port->dev, &port->typec_caps);
6115 if (IS_ERR(port->typec_port)) {6122 if (IS_ERR(port->typec_port)) {
drivers/usb/typec/tipd/core.c+0−1
@@ -53,7 +53,6 @@ enum { · 52 unmodified lines
53struct tps6598x_rx_identity_reg {53struct tps6598x_rx_identity_reg {
54 u8 status;54 u8 status;
55 struct usb_pd_identity identity;55 struct usb_pd_identity identity;
56 u32 vdo[3];
57} __packed;56} __packed;
58 57
59/* Standard Task return codes */58/* 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
174 174
175 udc->ud.tcp_socket = socket;175 udc->ud.tcp_socket = socket;
176 udc->ud.tcp_rx = tcp_rx;176 udc->ud.tcp_rx = tcp_rx;
177 udc->ud.tcp_rx = tcp_tx;177 udc->ud.tcp_tx = tcp_tx;
178 udc->ud.status = SDEV_ST_USED;178 udc->ud.status = SDEV_ST_USED;
179 179
180 spin_unlock_irq(&udc->ud.lock);180 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
431 }431 }
432 432
433 adapter = vdpa_alloc_device(struct ifcvf_adapter, vdpa,433 adapter = vdpa_alloc_device(struct ifcvf_adapter, vdpa,
434 dev, &ifc_vdpa_ops,434 dev, &ifc_vdpa_ops, NULL);
435 IFCVF_MAX_QUEUE_PAIRS * 2, NULL);
436 if (adapter == NULL) {435 if (adapter == NULL) {
437 IFCVF_ERR(pdev, "Failed to allocate vDPA structure");436 IFCVF_ERR(pdev, "Failed to allocate vDPA structure");
438 return -ENOMEM;437 return -ENOMEM;
@@ -456,7 +455,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 17 unmodified lines
456 for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++)455 for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++)
457 vf->vring[i].irq = -EINVAL;456 vf->vring[i].irq = -EINVAL;
458 457
459 ret = vdpa_register_device(&adapter->vdpa);458 ret = vdpa_register_device(&adapter->vdpa, IFCVF_MAX_QUEUE_PAIRS * 2);
460 if (ret) {459 if (ret) {
461 IFCVF_ERR(pdev, "Failed to register ifcvf to vdpa bus");460 IFCVF_ERR(pdev, "Failed to register ifcvf to vdpa bus");
462 goto err;461 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
1982 max_vqs = min_t(u32, max_vqs, MLX5_MAX_SUPPORTED_VQS);1982 max_vqs = min_t(u32, max_vqs, MLX5_MAX_SUPPORTED_VQS);
1983 1983
1984 ndev = vdpa_alloc_device(struct mlx5_vdpa_net, mvdev.vdev, mdev->device, &mlx5_vdpa_ops,1984 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);
1986 if (IS_ERR(ndev))1986 if (IS_ERR(ndev))
1987 return PTR_ERR(ndev);1987 return PTR_ERR(ndev);
1988 1988
@@ -2009,7 +2009,7 @@ static int mlx5v_probe(struct auxiliary_device *adev, · 20 unmodified lines
2009 if (err)2009 if (err)
2010 goto err_res;2010 goto err_res;
2011 2011
2012 err = vdpa_register_device(&mvdev->vdev);2012 err = vdpa_register_device(&mvdev->vdev, 2 * mlx5_vdpa_max_qps(max_vqs));
2013 if (err)2013 if (err)
2014 goto err_reg;2014 goto err_reg;
2015 2015
drivers/vdpa/vdpa.c+10−8
@@ -69,7 +69,6 @@ static void vdpa_release_dev(struct device *d) · 68 unmodified lines
69 * initialized but before registered.69 * initialized but before registered.
70 * @parent: the parent device70 * @parent: the parent device
71 * @config: the bus operations that is supported by this device71 * @config: the bus operations that is supported by this device
72 * @nvqs: number of virtqueues supported by this device
73 * @size: size of the parent structure that contains private data72 * @size: size of the parent structure that contains private data
74 * @name: name of the vdpa device; optional.73 * @name: name of the vdpa device; optional.
75 *74 *
@@ -81,7 +80,7 @@ static void vdpa_release_dev(struct device *d) · 5 unmodified lines
81 */80 */
82struct vdpa_device *__vdpa_alloc_device(struct device *parent,81struct vdpa_device *__vdpa_alloc_device(struct device *parent,
83 const struct vdpa_config_ops *config,82 const struct vdpa_config_ops *config,
84 int nvqs, size_t size, const char *name)83 size_t size, const char *name)
85{84{
86 struct vdpa_device *vdev;85 struct vdpa_device *vdev;
87 int err = -EINVAL;86 int err = -EINVAL;
@@ -107,7 +106,6 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent, · 19 unmodified lines
107 vdev->index = err;106 vdev->index = err;
108 vdev->config = config;107 vdev->config = config;
109 vdev->features_valid = false;108 vdev->features_valid = false;
110 vdev->nvqs = nvqs;
111 109
112 if (name)110 if (name)
113 err = dev_set_name(&vdev->dev, "%s", name);111 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
136 return (strcmp(dev_name(&vdev->dev), data) == 0);134 return (strcmp(dev_name(&vdev->dev), data) == 0);
137}135}
138 136
139static int __vdpa_register_device(struct vdpa_device *vdev)137static int __vdpa_register_device(struct vdpa_device *vdev, int nvqs)
140{138{
141 struct device *dev;139 struct device *dev;
142 140
141 vdev->nvqs = nvqs;
142
143 lockdep_assert_held(&vdpa_dev_mutex);143 lockdep_assert_held(&vdpa_dev_mutex);
144 dev = bus_find_device(&vdpa_bus, NULL, dev_name(&vdev->dev), vdpa_name_match);144 dev = bus_find_device(&vdpa_bus, NULL, dev_name(&vdev->dev), vdpa_name_match);
145 if (dev) {145 if (dev) {
@@ -155,15 +155,16 @@ static int __vdpa_register_device(struct vdpa_device *vdev) · 9 unmodified lines
155 * Caller must invoke this routine in the management device dev_add()155 * Caller must invoke this routine in the management device dev_add()
156 * callback after setting up valid mgmtdev for this vdpa device.156 * callback after setting up valid mgmtdev for this vdpa device.
157 * @vdev: the vdpa device to be registered to vDPA bus157 * @vdev: the vdpa device to be registered to vDPA bus
158 * @nvqs: number of virtqueues supported by this device
158 *159 *
159 * Returns an error when fail to add device to vDPA bus160 * Returns an error when fail to add device to vDPA bus
160 */161 */
161int _vdpa_register_device(struct vdpa_device *vdev)162int _vdpa_register_device(struct vdpa_device *vdev, int nvqs)
162{163{
163 if (!vdev->mdev)164 if (!vdev->mdev)
164 return -EINVAL;165 return -EINVAL;
165 166
166 return __vdpa_register_device(vdev);167 return __vdpa_register_device(vdev, nvqs);
167}168}
168EXPORT_SYMBOL_GPL(_vdpa_register_device);169EXPORT_SYMBOL_GPL(_vdpa_register_device);
169 170
@@ -171,15 +172,16 @@ EXPORT_SYMBOL_GPL(_vdpa_register_device); · 1 unmodified line
171 * vdpa_register_device - register a vDPA device172 * vdpa_register_device - register a vDPA device
172 * Callers must have a succeed call of vdpa_alloc_device() before.173 * Callers must have a succeed call of vdpa_alloc_device() before.
173 * @vdev: the vdpa device to be registered to vDPA bus174 * @vdev: the vdpa device to be registered to vDPA bus
175 * @nvqs: number of virtqueues supported by this device
174 *176 *
175 * Returns an error when fail to add to vDPA bus177 * Returns an error when fail to add to vDPA bus
176 */178 */
177int vdpa_register_device(struct vdpa_device *vdev)179int vdpa_register_device(struct vdpa_device *vdev, int nvqs)
178{180{
179 int err;181 int err;
180 182
181 mutex_lock(&vdpa_dev_mutex);183 mutex_lock(&vdpa_dev_mutex);
182 err = __vdpa_register_device(vdev);184 err = __vdpa_register_device(vdev, nvqs);
183 mutex_unlock(&vdpa_dev_mutex);185 mutex_unlock(&vdpa_dev_mutex);
184 return err;186 return err;
185}187}
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
235 ops = &vdpasim_config_ops;235 ops = &vdpasim_config_ops;
236 236
237 vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops,237 vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops,
238 dev_attr->nvqs, dev_attr->name);238 dev_attr->name);
239 if (!vdpasim)239 if (!vdpasim)
240 goto err_alloc;240 goto err_alloc;
241 241
drivers/vdpa/vdpa_sim/vdpa_sim_net.c+2−3
@@ -110,8 +110,7 @@ out: · 109 unmodified lines
110 110
111static void vdpasim_net_get_config(struct vdpasim *vdpasim, void *config)111static void vdpasim_net_get_config(struct vdpasim *vdpasim, void *config)
112{112{
113 struct virtio_net_config *net_config =113 struct virtio_net_config *net_config = config;
114 (struct virtio_net_config *)config;
115 114
116 net_config->mtu = cpu_to_vdpasim16(vdpasim, 1500);115 net_config->mtu = cpu_to_vdpasim16(vdpasim, 1500);
117 net_config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP);116 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
147 if (IS_ERR(simdev))146 if (IS_ERR(simdev))
148 return PTR_ERR(simdev);147 return PTR_ERR(simdev);
149 148
150 ret = _vdpa_register_device(&simdev->vdpa);149 ret = _vdpa_register_device(&simdev->vdpa, VDPASIM_NET_VQ_NUM);
151 if (ret)150 if (ret)
152 goto reg_err;151 goto reg_err;
153 152
drivers/vfio/Kconfig+2−2
@@ -21,8 +21,8 @@ config VFIO_VIRQFD · 20 unmodified lines
21 21
22menuconfig VFIO22menuconfig VFIO
23 tristate "VFIO Non-Privileged userspace driver framework"23 tristate "VFIO Non-Privileged userspace driver framework"
24 depends on IOMMU_API24 select IOMMU_API
25 select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM || ARM64)25 select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
26 help26 help
27 VFIO provides a framework for secure userspace device drivers.27 VFIO provides a framework for secure userspace device drivers.
28 See Documentation/driver-api/vfio.rst for more details.28 See Documentation/driver-api/vfio.rst for more details.
drivers/vfio/platform/Kconfig+2−2
@@ -1,7 +1,7 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2config VFIO_PLATFORM2config VFIO_PLATFORM
3 tristate "VFIO support for platform devices"3 tristate "VFIO support for platform devices"
4 depends on VFIO && EVENTFD && (ARM || ARM64)4 depends on VFIO && EVENTFD && (ARM || ARM64 || COMPILE_TEST)
5 select VFIO_VIRQFD5 select VFIO_VIRQFD
6 help6 help
7 Support for platform devices with VFIO. This is required to make7 Support for platform devices with VFIO. This is required to make
@@ -12,7 +12,7 @@ config VFIO_PLATFORM · 4 unmodified lines
12 12
13config VFIO_AMBA13config VFIO_AMBA
14 tristate "VFIO support for AMBA devices"14 tristate "VFIO support for AMBA devices"
15 depends on VFIO_PLATFORM && ARM_AMBA15 depends on VFIO_PLATFORM && (ARM_AMBA || COMPILE_TEST)
16 help16 help
17 Support for ARM AMBA devices with VFIO. This is required to make17 Support for ARM AMBA devices with VFIO. This is required to make
18 use of ARM AMBA devices present on the system using the VFIO18 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
189}189}
190 190
191static struct rb_node *vfio_find_dma_first_node(struct vfio_iommu *iommu,191static 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)
193{193{
194 struct rb_node *res = NULL;194 struct rb_node *res = NULL;
195 struct rb_node *node = iommu->dma_list.rb_node;195 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
785 return -ENODEV;785 return -ENODEV;
786 786
787 ret = vaddr_get_pfns(mm, vaddr, 1, dma->prot, pfn_base, pages);787 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)) {
789 ret = vfio_lock_acct(dma, 1, true);794 ret = vfio_lock_acct(dma, 1, true);
790 if (ret) {795 if (ret) {
791 put_pfn(*pfn_base, dma->prot);796 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
797 }802 }
798 }803 }
799 804
805out:
800 mmput(mm);806 mmput(mm);
801 return ret;807 return ret;
802}808}
@@ -1288,7 +1294,7 @@ static int vfio_dma_do_unmap(struct vfio_iommu *iommu, · 485 unmodified lines
1288 int ret = -EINVAL, retries = 0;1294 int ret = -EINVAL, retries = 0;
1289 unsigned long pgshift;1295 unsigned long pgshift;
1290 dma_addr_t iova = unmap->iova;1296 dma_addr_t iova = unmap->iova;
1291 unsigned long size = unmap->size;1297 u64 size = unmap->size;
1292 bool unmap_all = unmap->flags & VFIO_DMA_UNMAP_FLAG_ALL;1298 bool unmap_all = unmap->flags & VFIO_DMA_UNMAP_FLAG_ALL;
1293 bool invalidate_vaddr = unmap->flags & VFIO_DMA_UNMAP_FLAG_VADDR;1299 bool invalidate_vaddr = unmap->flags & VFIO_DMA_UNMAP_FLAG_VADDR;
1294 struct rb_node *n, *first_n;1300 struct rb_node *n, *first_n;
@@ -1304,14 +1310,12 @@ static int vfio_dma_do_unmap(struct vfio_iommu *iommu, · 9 unmodified lines
1304 if (unmap_all) {1310 if (unmap_all) {
1305 if (iova || size)1311 if (iova || size)
1306 goto unlock;1312 goto unlock;
1307 size = SIZE_MAX;1313 size = U64_MAX;
1308 } else if (!size || size & (pgsize - 1)) {1314 } else if (!size || size & (pgsize - 1) ||
1315 iova + size - 1 < iova || size > SIZE_MAX) {
1309 goto unlock;1316 goto unlock;
1310 }1317 }
1311 1318
1312 if (iova + size - 1 < iova || size > SIZE_MAX)
1313 goto unlock;
1314
1315 /* When dirty tracking is enabled, allow only min supported pgsize */1319 /* When dirty tracking is enabled, allow only min supported pgsize */
1316 if ((unmap->flags & VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP) &&1320 if ((unmap->flags & VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP) &&
1317 (!iommu->dirty_page_tracking || (bitmap->pgsize != pgsize))) {1321 (!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
308 308
309static void vhost_vdpa_config_put(struct vhost_vdpa *v)309static void vhost_vdpa_config_put(struct vhost_vdpa *v)
310{310{
311 if (v->config_ctx)311 if (v->config_ctx) {
312 eventfd_ctx_put(v->config_ctx);312 eventfd_ctx_put(v->config_ctx);
313 v->config_ctx = NULL;
314 }
313}315}
314 316
315static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)317static 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
329 if (!IS_ERR_OR_NULL(ctx))331 if (!IS_ERR_OR_NULL(ctx))
330 eventfd_ctx_put(ctx);332 eventfd_ctx_put(ctx);
331 333
332 if (IS_ERR(v->config_ctx))334 if (IS_ERR(v->config_ctx)) {
333 return PTR_ERR(v->config_ctx);335 long ret = PTR_ERR(v->config_ctx);
336
337 v->config_ctx = NULL;
338 return ret;
339 }
334 340
335 v->vdpa->config->set_config_cb(v->vdpa, &cb);341 v->vdpa->config->set_config_cb(v->vdpa, &cb);
336 342
@@ -900,14 +906,10 @@ err: · 563 unmodified lines
900 906
901static void vhost_vdpa_clean_irq(struct vhost_vdpa *v)907static void vhost_vdpa_clean_irq(struct vhost_vdpa *v)
902{908{
903 struct vhost_virtqueue *vq;
904 int i;909 int i;
905 910
906 for (i = 0; i < v->nvqs; i++) {911 for (i = 0; i < v->nvqs; i++)
907 vq = &v->vqs[i];912 vhost_vdpa_unsetup_vq_irq(v, i);
908 if (vq->call_ctx.producer.irq)
909 irq_bypass_unregister_producer(&vq->call_ctx.producer);
910 }
911}913}
912 914
913static int vhost_vdpa_release(struct inode *inode, struct file *filep)915static 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
332 vq->error_ctx = NULL;332 vq->error_ctx = NULL;
333 vq->kick = NULL;333 vq->kick = NULL;
334 vq->log_ctx = NULL;334 vq->log_ctx = NULL;
335 vhost_reset_is_le(vq);
336 vhost_disable_cross_endian(vq);335 vhost_disable_cross_endian(vq);
336 vhost_reset_is_le(vq);
337 vq->busyloop_timeout = 0;337 vq->busyloop_timeout = 0;
338 vq->umem = NULL;338 vq->umem = NULL;
339 vq->iotlb = NULL;339 vq->iotlb = NULL;
drivers/virtio/virtio.c+2−4
@@ -141,15 +141,14 @@ void virtio_config_changed(struct virtio_device *dev) · 140 unmodified lines
141}141}
142EXPORT_SYMBOL_GPL(virtio_config_changed);142EXPORT_SYMBOL_GPL(virtio_config_changed);
143 143
144void virtio_config_disable(struct virtio_device *dev)144static void virtio_config_disable(struct virtio_device *dev)
145{145{
146 spin_lock_irq(&dev->config_lock);146 spin_lock_irq(&dev->config_lock);
147 dev->config_enabled = false;147 dev->config_enabled = false;
148 spin_unlock_irq(&dev->config_lock);148 spin_unlock_irq(&dev->config_lock);
149}149}
150EXPORT_SYMBOL_GPL(virtio_config_disable);
151 150
152void virtio_config_enable(struct virtio_device *dev)151static void virtio_config_enable(struct virtio_device *dev)
153{152{
154 spin_lock_irq(&dev->config_lock);153 spin_lock_irq(&dev->config_lock);
155 dev->config_enabled = true;154 dev->config_enabled = true;
@@ -158,7 +157,6 @@ void virtio_config_enable(struct virtio_device *dev) · 2 unmodified lines
158 dev->config_change_pending = false;157 dev->config_change_pending = false;
159 spin_unlock_irq(&dev->config_lock);158 spin_unlock_irq(&dev->config_lock);
160}159}
161EXPORT_SYMBOL_GPL(virtio_config_enable);
162 160
163void virtio_add_status(struct virtio_device *dev, unsigned int status)161void virtio_add_status(struct virtio_device *dev, unsigned int status)
164{162{
drivers/virtio/virtio_mmio.c+1−2
@@ -548,8 +548,7 @@ static void virtio_mmio_release_dev(struct device *_d) · 547 unmodified lines
548{548{
549 struct virtio_device *vdev =549 struct virtio_device *vdev =
550 container_of(_d, struct virtio_device, dev);550 container_of(_d, struct virtio_device, dev);
551 struct virtio_mmio_device *vm_dev =551 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
552 container_of(vdev, struct virtio_mmio_device, vdev);
553 struct platform_device *pdev = vm_dev->pdev;552 struct platform_device *pdev = vm_dev->pdev;
554 553
555 devm_kfree(&pdev->dev, vm_dev);554 devm_kfree(&pdev->dev, vm_dev);
drivers/watchdog/cpu5wdt.c+0−1
@@ -273,7 +273,6 @@ module_exit(cpu5wdt_exit_module); · 272 unmodified lines
273 273
274MODULE_AUTHOR("Heiko Ronsdorf <hero@ihg.uni-duisburg.de>");274MODULE_AUTHOR("Heiko Ronsdorf <hero@ihg.uni-duisburg.de>");
275MODULE_DESCRIPTION("sma cpu5 watchdog driver");275MODULE_DESCRIPTION("sma cpu5 watchdog driver");
276MODULE_SUPPORTED_DEVICE("sma cpu5 watchdog");
277MODULE_LICENSE("GPL");276MODULE_LICENSE("GPL");
278 277
279module_param_hw(port, int, ioport, 0);278module_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
172MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");172MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");
173MODULE_DESCRIPTION("Hardware watchdog driver for Sun Microsystems CP1400/1500");173MODULE_DESCRIPTION("Hardware watchdog driver for Sun Microsystems CP1400/1500");
174MODULE_LICENSE("GPL");174MODULE_LICENSE("GPL");
175MODULE_SUPPORTED_DEVICE("watchdog");
176 175
177static void cpwd_writew(u16 val, void __iomem *addr)176static void cpwd_writew(u16 val, void __iomem *addr)
178{177{
drivers/watchdog/riowd.c+0−1
@@ -46,7 +46,6 @@ · 45 unmodified lines
46 46
47MODULE_AUTHOR("David S. Miller <davem@davemloft.net>");47MODULE_AUTHOR("David S. Miller <davem@davemloft.net>");
48MODULE_DESCRIPTION("Hardware watchdog driver for Sun RIO");48MODULE_DESCRIPTION("Hardware watchdog driver for Sun RIO");
49MODULE_SUPPORTED_DEVICE("watchdog");
50MODULE_LICENSE("GPL");49MODULE_LICENSE("GPL");
51 50
52#define DRIVER_NAME "riowd"51#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
70 .permission = afs_permission,70 .permission = afs_permission,
71 .getattr = afs_getattr,71 .getattr = afs_getattr,
72 .setattr = afs_setattr,72 .setattr = afs_setattr,
73 .listxattr = afs_listxattr,
74};73};
75 74
76const struct address_space_operations afs_dir_aops = {75const 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
43 .getattr = afs_getattr,43 .getattr = afs_getattr,
44 .setattr = afs_setattr,44 .setattr = afs_setattr,
45 .permission = afs_permission,45 .permission = afs_permission,
46 .listxattr = afs_listxattr,
47};46};
48 47
49const struct address_space_operations afs_fs_aops = {48const 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
181 if (test_bit(AFS_SERVER_FL_IS_YFS, &op->server->flags) &&181 if (test_bit(AFS_SERVER_FL_IS_YFS, &op->server->flags) &&
182 op->ops->issue_yfs_rpc)182 op->ops->issue_yfs_rpc)
183 op->ops->issue_yfs_rpc(op);183 op->ops->issue_yfs_rpc(op);
184 else184 else if (op->ops->issue_afs_rpc)
185 op->ops->issue_afs_rpc(op);185 op->ops->issue_afs_rpc(op);
186 else
187 op->ac.error = -ENOTSUPP;
186 188
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);
188 }191 }
189 192
190 switch (op->error) {193 switch (op->error) {
fs/afs/inode.c+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
27 27
28static const struct inode_operations afs_symlink_inode_operations = {28static const struct inode_operations afs_symlink_inode_operations = {
29 .get_link = page_get_link,29 .get_link = page_get_link,
30 .listxattr = afs_listxattr,
31};30};
32 31
33static noinline void dump_vnode(struct afs_vnode *vnode, struct afs_vnode *parent_vnode)32static 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
1509 * xattr.c1509 * xattr.c
1510 */1510 */
1511extern const struct xattr_handler *afs_xattr_handlers[];1511extern const struct xattr_handler *afs_xattr_handlers[];
1512extern ssize_t afs_listxattr(struct dentry *, char *, size_t);
1513 1512
1514/*1513/*
1515 * yfsclient.c1514 * yfsclient.c
fs/afs/mntpt.c+0−1
@@ -32,7 +32,6 @@ const struct inode_operations afs_mntpt_inode_operations = { · 31 unmodified lines
32 .lookup = afs_mntpt_lookup,32 .lookup = afs_mntpt_lookup,
33 .readlink = page_readlink,33 .readlink = page_readlink,
34 .getattr = afs_getattr,34 .getattr = afs_getattr,
35 .listxattr = afs_listxattr,
36};35};
37 36
38const struct inode_operations afs_autocell_inode_operations = {37const struct inode_operations afs_autocell_inode_operations = {
fs/afs/xattr.c+7−24
@@ -11,29 +11,6 @@ · 10 unmodified lines
11#include <linux/xattr.h>11#include <linux/xattr.h>
12#include "internal.h"12#include "internal.h"
13 13
14static 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 */
27ssize_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
37/*14/*
38 * Deal with the result of a successful fetch ACL operation.15 * Deal with the result of a successful fetch ACL operation.
39 */16 */
@@ -231,6 +208,8 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, · 191 unmodified lines
231 else208 else
232 ret = -ERANGE;209 ret = -ERANGE;
233 }210 }
211 } else if (ret == -ENOTSUPP) {
212 ret = -ENODATA;
234 }213 }
235 214
236error_yacl:215error_yacl:
@@ -256,6 +235,7 @@ static int afs_xattr_set_yfs(const struct xattr_handler *handler, · 19 unmodified lines
256{235{
257 struct afs_operation *op;236 struct afs_operation *op;
258 struct afs_vnode *vnode = AFS_FS_I(inode);237 struct afs_vnode *vnode = AFS_FS_I(inode);
238 int ret;
259 239
260 if (flags == XATTR_CREATE ||240 if (flags == XATTR_CREATE ||
261 strcmp(name, "acl") != 0)241 strcmp(name, "acl") != 0)
@@ -270,7 +250,10 @@ static int afs_xattr_set_yfs(const struct xattr_handler *handler, · 8 unmodified lines
270 return afs_put_operation(op);250 return afs_put_operation(op);
271 251
272 op->ops = &yfs_store_opaque_acl2_operation;252 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;
274}257}
275 258
276static const struct xattr_handler afs_xattr_yfs_handler = {259static 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
1365 "failed to read tree block %llu from get_old_root",1365 "failed to read tree block %llu from get_old_root",
1366 logical);1366 logical);
1367 } else {1367 } else {
1368 btrfs_tree_read_lock(old);
1368 eb = btrfs_clone_extent_buffer(old);1369 eb = btrfs_clone_extent_buffer(old);
1370 btrfs_tree_read_unlock(old);
1369 free_extent_buffer(old);1371 free_extent_buffer(old);
1370 }1372 }
1371 } else if (old_root) {1373 } 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
3323 3323
3324 if (last_ref && btrfs_header_generation(buf) == trans->transid) {3324 if (last_ref && btrfs_header_generation(buf) == trans->transid) {
3325 struct btrfs_block_group *cache;3325 struct btrfs_block_group *cache;
3326 bool must_pin = false;
3326 3327
3327 if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) {3328 if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) {
3328 ret = check_ref_cleanup(trans, buf->start);3329 ret = check_ref_cleanup(trans, buf->start);
@@ -3340,7 +3341,27 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans, · 11 unmodified lines
3340 goto out;3341 goto out;
3341 }3342 }
3342 3343
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)) {
3344 btrfs_redirty_list_add(trans->transaction, buf);3365 btrfs_redirty_list_add(trans->transaction, buf);
3345 pin_down_extent(trans, cache, buf->start, buf->len, 1);3366 pin_down_extent(trans, cache, buf->start, buf->len, 1);
3346 btrfs_put_block_group(cache);3367 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
2885 btrfs_subpage_end_reader(fs_info, page, start, len);2885 btrfs_subpage_end_reader(fs_info, page, start, len);
2886}2886}
2887 2887
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 */
2894static 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
2888/*2917/*
2889 * after a readpage IO is done, we need to:2918 * after a readpage IO is done, we need to:
2890 * clear the uptodate bits on error2919 * clear the uptodate bits on error
@@ -2996,7 +3025,7 @@ static void end_bio_extent_readpage(struct bio *bio) · 105 unmodified lines
2996 } else {3025 } else {
2997 struct extent_buffer *eb;3026 struct extent_buffer *eb;
2998 3027
2999 eb = (struct extent_buffer *)page->private;3028 eb = find_extent_buffer_readpage(fs_info, page, start);
3000 set_bit(EXTENT_BUFFER_READ_ERR, &eb->bflags);3029 set_bit(EXTENT_BUFFER_READ_ERR, &eb->bflags);
3001 eb->read_mirror = mirror;3030 eb->read_mirror = mirror;
3002 atomic_dec(&eb->io_pages);3031 atomic_dec(&eb->io_pages);
@@ -3020,7 +3049,7 @@ readpage_ok: · 17 unmodified lines
3020 */3049 */
3021 if (page->index == end_index && i_size <= end) {3050 if (page->index == end_index && i_size <= end) {
3022 u32 zero_start = max(offset_in_page(i_size),3051 u32 zero_start = max(offset_in_page(i_size),
3023 offset_in_page(end));3052 offset_in_page(start));
3024 3053
3025 zero_user_segment(page, zero_start,3054 zero_user_segment(page, zero_start,
3026 offset_in_page(end) + 1);3055 offset_in_page(end) + 1);
fs/btrfs/inode.c+26−11
@@ -9008,7 +9008,7 @@ int __init btrfs_init_cachep(void) · 9007 unmodified lines
9008 9008
9009 btrfs_free_space_bitmap_cachep = kmem_cache_create("btrfs_free_space_bitmap",9009 btrfs_free_space_bitmap_cachep = kmem_cache_create("btrfs_free_space_bitmap",
9010 PAGE_SIZE, PAGE_SIZE,9010 PAGE_SIZE, PAGE_SIZE,
9011 SLAB_RED_ZONE, NULL);9011 SLAB_MEM_SPREAD, NULL);
9012 if (!btrfs_free_space_bitmap_cachep)9012 if (!btrfs_free_space_bitmap_cachep)
9013 goto fail;9013 goto fail;
9014 9014
@@ -9877,6 +9877,7 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent( · 862 unmodified lines
9877 struct btrfs_path *path;9877 struct btrfs_path *path;
9878 u64 start = ins->objectid;9878 u64 start = ins->objectid;
9879 u64 len = ins->offset;9879 u64 len = ins->offset;
9880 int qgroup_released;
9880 int ret;9881 int ret;
9881 9882
9882 memset(&stack_fi, 0, sizeof(stack_fi));9883 memset(&stack_fi, 0, sizeof(stack_fi));
@@ -9889,16 +9890,16 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent( · 6 unmodified lines
9889 btrfs_set_stack_file_extent_compression(&stack_fi, BTRFS_COMPRESS_NONE);9890 btrfs_set_stack_file_extent_compression(&stack_fi, BTRFS_COMPRESS_NONE);
9890 /* Encryption and other encoding is reserved and all 0 */9891 /* Encryption and other encoding is reserved and all 0 */
9891 9892
9892 ret = btrfs_qgroup_release_data(inode, file_offset, len);9893 qgroup_released = btrfs_qgroup_release_data(inode, file_offset, len);
9893 if (ret < 0)9894 if (qgroup_released < 0)
9894 return ERR_PTR(ret);9895 return ERR_PTR(qgroup_released);
9895 9896
9896 if (trans) {9897 if (trans) {
9897 ret = insert_reserved_file_extent(trans, inode,9898 ret = insert_reserved_file_extent(trans, inode,
9898 file_offset, &stack_fi,9899 file_offset, &stack_fi,
9899 true, ret);9900 true, qgroup_released);
9900 if (ret)9901 if (ret)
9901 return ERR_PTR(ret);9902 goto free_qgroup;
9902 return trans;9903 return trans;
9903 }9904 }
9904 9905
@@ -9909,21 +9910,35 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent( · 4 unmodified lines
9909 extent_info.file_offset = file_offset;9910 extent_info.file_offset = file_offset;
9910 extent_info.extent_buf = (char *)&stack_fi;9911 extent_info.extent_buf = (char *)&stack_fi;
9911 extent_info.is_new_extent = true;9912 extent_info.is_new_extent = true;
9912 extent_info.qgroup_reserved = ret;9913 extent_info.qgroup_reserved = qgroup_released;
9913 extent_info.insertions = 0;9914 extent_info.insertions = 0;
9914 9915
9915 path = btrfs_alloc_path();9916 path = btrfs_alloc_path();
9916 if (!path)9917 if (!path) {
9917 return ERR_PTR(-ENOMEM);9918 ret = -ENOMEM;
9919 goto free_qgroup;
9920 }
9918 9921
9919 ret = btrfs_replace_file_extents(&inode->vfs_inode, path, file_offset,9922 ret = btrfs_replace_file_extents(&inode->vfs_inode, path, file_offset,
9920 file_offset + len - 1, &extent_info,9923 file_offset + len - 1, &extent_info,
9921 &trans);9924 &trans);
9922 btrfs_free_path(path);9925 btrfs_free_path(path);
9923 if (ret)9926 if (ret)
9924 return ERR_PTR(ret);9927 goto free_qgroup;
9925
9926 return trans;9928 return trans;
9929
9930free_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);
9927}9942}
9928 9943
9929static int __btrfs_prealloc_file_range(struct inode *inode, int mode,9944static 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
209 /* find extent */209 /* find extent */
210 spin_lock(&fs_info->reada_lock);210 spin_lock(&fs_info->reada_lock);
211 re = radix_tree_lookup(&fs_info->reada_tree,211 re = radix_tree_lookup(&fs_info->reada_tree,
212 eb->start >> PAGE_SHIFT);212 eb->start >> fs_info->sectorsize_bits);
213 if (re)213 if (re)
214 re->refcnt++;214 re->refcnt++;
215 spin_unlock(&fs_info->reada_lock);215 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
240 zone = NULL;240 zone = NULL;
241 spin_lock(&fs_info->reada_lock);241 spin_lock(&fs_info->reada_lock);
242 ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone,242 ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone,
243 logical >> PAGE_SHIFT, 1);243 logical >> fs_info->sectorsize_bits, 1);
244 if (ret == 1 && logical >= zone->start && logical <= zone->end) {244 if (ret == 1 && logical >= zone->start && logical <= zone->end) {
245 kref_get(&zone->refcnt);245 kref_get(&zone->refcnt);
246 spin_unlock(&fs_info->reada_lock);246 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
283 283
284 spin_lock(&fs_info->reada_lock);284 spin_lock(&fs_info->reada_lock);
285 ret = radix_tree_insert(&dev->reada_zones,285 ret = radix_tree_insert(&dev->reada_zones,
286 (unsigned long)(zone->end >> PAGE_SHIFT),286 (unsigned long)(zone->end >> fs_info->sectorsize_bits),
287 zone);287 zone);
288 288
289 if (ret == -EEXIST) {289 if (ret == -EEXIST) {
290 kfree(zone);290 kfree(zone);
291 ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone,291 ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone,
292 logical >> PAGE_SHIFT, 1);292 logical >> fs_info->sectorsize_bits, 1);
293 if (ret == 1 && logical >= zone->start && logical <= zone->end)293 if (ret == 1 && logical >= zone->start && logical <= zone->end)
294 kref_get(&zone->refcnt);294 kref_get(&zone->refcnt);
295 else295 else
@@ -315,7 +315,7 @@ static struct reada_extent *reada_find_extent(struct btrfs_fs_info *fs_info, · 19 unmodified lines
315 u64 length;315 u64 length;
316 int real_stripes;316 int real_stripes;
317 int nzones = 0;317 int nzones = 0;
318 unsigned long index = logical >> PAGE_SHIFT;318 unsigned long index = logical >> fs_info->sectorsize_bits;
319 int dev_replace_is_ongoing;319 int dev_replace_is_ongoing;
320 int have_zone = 0;320 int have_zone = 0;
321 321
@@ -497,7 +497,7 @@ static void reada_extent_put(struct btrfs_fs_info *fs_info, · 175 unmodified lines
497 struct reada_extent *re)497 struct reada_extent *re)
498{498{
499 int i;499 int i;
500 unsigned long index = re->logical >> PAGE_SHIFT;500 unsigned long index = re->logical >> fs_info->sectorsize_bits;
501 501
502 spin_lock(&fs_info->reada_lock);502 spin_lock(&fs_info->reada_lock);
503 if (--re->refcnt) {503 if (--re->refcnt) {
@@ -538,11 +538,12 @@ static void reada_extent_put(struct btrfs_fs_info *fs_info, · 34 unmodified lines
538static void reada_zone_release(struct kref *kref)538static void reada_zone_release(struct kref *kref)
539{539{
540 struct reada_zone *zone = container_of(kref, struct reada_zone, refcnt);540 struct reada_zone *zone = container_of(kref, struct reada_zone, refcnt);
541 struct btrfs_fs_info *fs_info = zone->device->fs_info;
541 542
542 lockdep_assert_held(&zone->device->fs_info->reada_lock);543 lockdep_assert_held(&fs_info->reada_lock);
543 544
544 radix_tree_delete(&zone->device->reada_zones,545 radix_tree_delete(&zone->device->reada_zones,
545 zone->end >> PAGE_SHIFT);546 zone->end >> fs_info->sectorsize_bits);
546 547
547 kfree(zone);548 kfree(zone);
548}549}
@@ -593,7 +594,7 @@ static int reada_add_block(struct reada_control *rc, u64 logical, · 44 unmodified lines
593static void reada_peer_zones_set_lock(struct reada_zone *zone, int lock)594static void reada_peer_zones_set_lock(struct reada_zone *zone, int lock)
594{595{
595 int i;596 int i;
596 unsigned long index = zone->end >> PAGE_SHIFT;597 unsigned long index = zone->end >> zone->device->fs_info->sectorsize_bits;
597 598
598 for (i = 0; i < zone->ndevs; ++i) {599 for (i = 0; i < zone->ndevs; ++i) {
599 struct reada_zone *peer;600 struct reada_zone *peer;
@@ -628,7 +629,7 @@ static int reada_pick_zone(struct btrfs_device *dev) · 28 unmodified lines
628 (void **)&zone, index, 1);629 (void **)&zone, index, 1);
629 if (ret == 0)630 if (ret == 0)
630 break;631 break;
631 index = (zone->end >> PAGE_SHIFT) + 1;632 index = (zone->end >> dev->fs_info->sectorsize_bits) + 1;
632 if (zone->locked) {633 if (zone->locked) {
633 if (zone->elems > top_locked_elems) {634 if (zone->elems > top_locked_elems) {
634 top_locked_elems = zone->elems;635 top_locked_elems = zone->elems;
@@ -709,7 +710,7 @@ static int reada_start_machine_dev(struct btrfs_device *dev) · 74 unmodified lines
709 * plugging to speed things up710 * plugging to speed things up
710 */711 */
711 ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re,712 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);
713 if (ret == 0 || re->logical > dev->reada_curr_zone->end) {714 if (ret == 0 || re->logical > dev->reada_curr_zone->end) {
714 ret = reada_pick_zone(dev);715 ret = reada_pick_zone(dev);
715 if (!ret) {716 if (!ret) {
@@ -718,7 +719,7 @@ static int reada_start_machine_dev(struct btrfs_device *dev) · 2 unmodified lines
718 }719 }
719 re = NULL;720 re = NULL;
720 ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re,721 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);
722 }723 }
723 if (ret == 0) {724 if (ret == 0) {
724 spin_unlock(&fs_info->reada_lock);725 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
885 pr_cont(" curr off %llu",886 pr_cont(" curr off %llu",
886 device->reada_next - zone->start);887 device->reada_next - zone->start);
887 pr_cont("\n");888 pr_cont("\n");
888 index = (zone->end >> PAGE_SHIFT) + 1;889 index = (zone->end >> fs_info->sectorsize_bits) + 1;
889 }890 }
890 cnt = 0;891 cnt = 0;
891 index = 0;892 index = 0;
@@ -910,7 +911,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 18 unmodified lines
910 }911 }
911 }912 }
912 pr_cont("\n");913 pr_cont("\n");
913 index = (re->logical >> PAGE_SHIFT) + 1;914 index = (re->logical >> fs_info->sectorsize_bits) + 1;
914 if (++cnt > 15)915 if (++cnt > 15)
915 break;916 break;
916 }917 }
@@ -926,7 +927,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 9 unmodified lines
926 if (ret == 0)927 if (ret == 0)
927 break;928 break;
928 if (!re->scheduled) {929 if (!re->scheduled) {
929 index = (re->logical >> PAGE_SHIFT) + 1;930 index = (re->logical >> fs_info->sectorsize_bits) + 1;
930 continue;931 continue;
931 }932 }
932 pr_debug("re: logical %llu size %u list empty %d scheduled %d",933 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
942 }943 }
943 }944 }
944 pr_cont("\n");945 pr_cont("\n");
945 index = (re->logical >> PAGE_SHIFT) + 1;946 index = (re->logical >> fs_info->sectorsize_bits) + 1;
946 }947 }
947 spin_unlock(&fs_info->reada_lock);948 spin_unlock(&fs_info->reada_lock);
948}949}
fs/btrfs/tree-log.c+4−4
@@ -3169,10 +3169,6 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, · 3168 unmodified lines
3169 3169
3170 mutex_lock(&log_root_tree->log_mutex);3170 mutex_lock(&log_root_tree->log_mutex);
3171 3171
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
3176 if (btrfs_is_zoned(fs_info)) {3172 if (btrfs_is_zoned(fs_info)) {
3177 if (!log_root_tree->node) {3173 if (!log_root_tree->node) {
3178 ret = btrfs_alloc_log_tree_node(trans, log_root_tree);3174 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
3183 }3179 }
3184 }3180 }
3185 3181
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
3186 /*3186 /*
3187 * Now we are safe to update the log_root_tree because we're under the3187 * Now we are safe to update the log_root_tree because we're under the
3188 * log_mutex, and we're a current writer so we're holding the commit3188 * 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
248 248
249/*249/*
250 * Try to find a matching registration for the tcon's server name and share name.250 * 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.
252 * TODO Try to avoid memory allocations252 * TODO Try to avoid memory allocations
253 */253 */
254static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon)254static 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
1118 /* Retain old ACEs which we can retain */1118 /* Retain old ACEs which we can retain */
1119 for (i = 0; i < src_num_aces; ++i) {1119 for (i = 0; i < src_num_aces; ++i) {
1120 pntace = (struct cifs_ace *) (acl_base + size);1120 pntace = (struct cifs_ace *) (acl_base + size);
1121 pnntace = (struct cifs_ace *) (nacl_base + nsize);
1122 1121
1123 if (!new_aces_set && (pntace->flags & INHERITED_ACE)) {1122 if (!new_aces_set && (pntace->flags & INHERITED_ACE)) {
1124 /* Place the new ACEs in between existing explicit and inherited */1123 /* 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
1131 }1130 }
1132 1131
1133 /* If it's any one of the ACE we're replacing, skip! */1132 /* 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) ||
1135 (compare_sids(&pntace->sid, pownersid) == 0) ||1135 (compare_sids(&pntace->sid, pownersid) == 0) ||
1136 (compare_sids(&pntace->sid, pgrpsid) == 0) ||1136 (compare_sids(&pntace->sid, pgrpsid) == 0) ||
1137 (compare_sids(&pntace->sid, &sid_everyone) == 0) ||1137 (compare_sids(&pntace->sid, &sid_everyone) == 0) ||
1138 (compare_sids(&pntace->sid, &sid_authusers) == 0)) {1138 (compare_sids(&pntace->sid, &sid_authusers) == 0))) {
1139 goto next_ace;1139 goto next_ace;
1140 }1140 }
1141 1141
1142 /* update the pointer to the next ACE to populate*/
1143 pnntace = (struct cifs_ace *) (nacl_base + nsize);
1144
1142 nsize += cifs_copy_ace(pnntace, pntace, NULL);1145 nsize += cifs_copy_ace(pnntace, pntace, NULL);
1143 num_aces++;1146 num_aces++;
1144 1147
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
1196 pr_warn_once("Witness protocol support is experimental\n");1196 pr_warn_once("Witness protocol support is experimental\n");
1197 break;1197 break;
1198 case Opt_rootfs:1198 case Opt_rootfs:
1199#ifdef CONFIG_CIFS_ROOT1199#ifndef CONFIG_CIFS_ROOT
1200 ctx->rootfs = true;1200 cifs_dbg(VFS, "rootfs support requires CONFIG_CIFS_ROOT config option\n");
1201 goto cifs_parse_mount_err;
1201#endif1202#endif
1203 ctx->rootfs = true;
1202 break;1204 break;
1203 case Opt_posixpaths:1205 case Opt_posixpaths:
1204 if (result.negated)1206 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
2395 * We need to be sure that all dirty pages are written and the server2395 * We need to be sure that all dirty pages are written and the server
2396 * has actual ctime, mtime and file length.2396 * has actual ctime, mtime and file length.
2397 */2397 */
2398 if ((request_mask & (STATX_CTIME | STATX_MTIME | STATX_SIZE)) &&2398 if ((request_mask & (STATX_CTIME | STATX_MTIME | STATX_SIZE | STATX_BLOCKS)) &&
2399 !CIFS_CACHE_READ(CIFS_I(inode)) &&2399 !CIFS_CACHE_READ(CIFS_I(inode)) &&
2400 inode->i_mapping && inode->i_mapping->nrpages != 0) {2400 inode->i_mapping && inode->i_mapping->nrpages != 0) {
2401 rc = filemap_fdatawait(inode->i_mapping);2401 rc = filemap_fdatawait(inode->i_mapping);
@@ -2585,6 +2585,14 @@ set_size_out: · 183 unmodified lines
2585 if (rc == 0) {2585 if (rc == 0) {
2586 cifsInode->server_eof = attrs->ia_size;2586 cifsInode->server_eof = attrs->ia_size;
2587 cifs_setsize(inode, attrs->ia_size);2587 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;
2588 2596
2589 /*2597 /*
2590 * The man page of truncate says if the size changed,2598 * 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
1196 /*1196 /*
1197 * Compounding is never used during session establish.1197 * Compounding is never used during session establish.
1198 */1198 */
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);
1200 smb311_update_preauth_hash(ses, rqst[0].rq_iov,1201 smb311_update_preauth_hash(ses, rqst[0].rq_iov,
1201 rqst[0].rq_nvec);1202 rqst[0].rq_nvec);
1203 mutex_unlock(&server->srv_mutex);
1204 }
1202 1205
1203 for (i = 0; i < num_rqst; i++) {1206 for (i = 0; i < num_rqst; i++) {
1204 rc = wait_for_response(server, midQ[i]);1207 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
1266 .iov_base = resp_iov[0].iov_base,1269 .iov_base = resp_iov[0].iov_base,
1267 .iov_len = resp_iov[0].iov_len1270 .iov_len = resp_iov[0].iov_len
1268 };1271 };
1272 mutex_lock(&server->srv_mutex);
1269 smb311_update_preauth_hash(ses, &iov, 1);1273 smb311_update_preauth_hash(ses, &iov, 1);
1274 mutex_unlock(&server->srv_mutex);
1270 }1275 }
1271 1276
1272out:1277out:
fs/ext4/balloc.c+26−12
@@ -626,27 +626,41 @@ int ext4_claim_free_clusters(struct ext4_sb_info *sbi, · 625 unmodified lines
626 626
627/**627/**
628 * ext4_should_retry_alloc() - check if a block allocation should be retried628 * ext4_should_retry_alloc() - check if a block allocation should be retried
629 * @sb: super block629 * @sb: superblock
630 * @retries: number of attemps has been made630 * @retries: number of retry attempts made so far
631 *631 *
632 * ext4_should_retry_alloc() is called when ENOSPC is returned, and if632 * ext4_should_retry_alloc() is called when ENOSPC is returned while
633 * it is profitable to retry the operation, this function will wait633 * attempting to allocate blocks. If there's an indication that a pending
634 * for the current or committing transaction to complete, and then634 * journal transaction might free some space and allow another attempt to
635 * return TRUE. We will only retry once.635 * succeed, this function will wait for the current or committing transaction
636 * to complete and then return TRUE.
636 */637 */
637int ext4_should_retry_alloc(struct super_block *sb, int *retries)638int ext4_should_retry_alloc(struct super_block *sb, int *retries)
638{639{
639 if (!ext4_has_free_clusters(EXT4_SB(sb), 1, 0) ||640 struct ext4_sb_info *sbi = EXT4_SB(sb);
640 (*retries)++ > 1 ||641
641 !EXT4_SB(sb)->s_journal)642 if (!sbi->s_journal)
642 return 0;643 return 0;
643 644
644 smp_mb();645 if (++(*retries) > 3) {
645 if (EXT4_SB(sb)->s_mb_free_pending == 0)646 percpu_counter_inc(&sbi->s_sra_exceeded_retry_limit);
646 return 0;647 return 0;
648 }
647 649
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 */
648 jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);662 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);
650 return 1;664 return 1;
651}665}
652 666
fs/ext4/ext4.h+3−0
@@ -1484,6 +1484,7 @@ struct ext4_sb_info { · 1483 unmodified lines
1484 struct percpu_counter s_freeinodes_counter;1484 struct percpu_counter s_freeinodes_counter;
1485 struct percpu_counter s_dirs_counter;1485 struct percpu_counter s_dirs_counter;
1486 struct percpu_counter s_dirtyclusters_counter;1486 struct percpu_counter s_dirtyclusters_counter;
1487 struct percpu_counter s_sra_exceeded_retry_limit;
1487 struct blockgroup_lock *s_blockgroup_lock;1488 struct blockgroup_lock *s_blockgroup_lock;
1488 struct proc_dir_entry *s_proc;1489 struct proc_dir_entry *s_proc;
1489 struct kobject s_kobj;1490 struct kobject s_kobj;
@@ -2793,6 +2794,8 @@ void __ext4_fc_track_link(handle_t *handle, struct inode *inode, · 1303 unmodified lines
2793 struct dentry *dentry);2794 struct dentry *dentry);
2794void ext4_fc_track_unlink(handle_t *handle, struct dentry *dentry);2795void ext4_fc_track_unlink(handle_t *handle, struct dentry *dentry);
2795void ext4_fc_track_link(handle_t *handle, struct dentry *dentry);2796void ext4_fc_track_link(handle_t *handle, struct dentry *dentry);
2797void __ext4_fc_track_create(handle_t *handle, struct inode *inode,
2798 struct dentry *dentry);
2796void ext4_fc_track_create(handle_t *handle, struct dentry *dentry);2799void ext4_fc_track_create(handle_t *handle, struct dentry *dentry);
2797void ext4_fc_track_inode(handle_t *handle, struct inode *inode);2800void ext4_fc_track_inode(handle_t *handle, struct inode *inode);
2798void ext4_fc_mark_ineligible(struct super_block *sb, int reason);2801void 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
4382{4382{
4383 struct inode *inode = file_inode(file);4383 struct inode *inode = file_inode(file);
4384 handle_t *handle;4384 handle_t *handle;
4385 int ret, ret2 = 0, ret3 = 0;4385 int ret = 0, ret2 = 0, ret3 = 0;
4386 int retries = 0;4386 int retries = 0;
4387 int depth = 0;4387 int depth = 0;
4388 struct ext4_map_blocks map;4388 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
513 __ext4_fc_track_link(handle, d_inode(dentry), dentry);513 __ext4_fc_track_link(handle, d_inode(dentry), dentry);
514}514}
515 515
516void ext4_fc_track_create(handle_t *handle, struct dentry *dentry)516void __ext4_fc_track_create(handle_t *handle, struct inode *inode,
517 struct dentry *dentry)
517{518{
518 struct __track_dentry_update_args args;519 struct __track_dentry_update_args args;
519 struct inode *inode = d_inode(dentry);
520 int ret;520 int ret;
521 521
522 args.dentry = dentry;522 args.dentry = dentry;
@@ -527,6 +527,11 @@ void ext4_fc_track_create(handle_t *handle, struct dentry *dentry) · 4 unmodified lines
527 trace_ext4_fc_track_create(inode, dentry, ret);527 trace_ext4_fc_track_create(inode, dentry, ret);
528}528}
529 529
530void ext4_fc_track_create(handle_t *handle, struct dentry *dentry)
531{
532 __ext4_fc_track_create(handle, d_inode(dentry), dentry);
533}
534
530/* __track_fn for inode tracking */535/* __track_fn for inode tracking */
531static int __track_inode(struct inode *inode, void *arg, bool update)536static int __track_inode(struct inode *inode, void *arg, bool update)
532{537{
fs/ext4/inode.c+10−8
@@ -1938,13 +1938,13 @@ static int __ext4_journalled_writepage(struct page *page, · 1937 unmodified lines
1938 if (!ret)1938 if (!ret)
1939 ret = err;1939 ret = err;
1940 1940
1941 if (!ext4_has_inline_data(inode))
1942 ext4_walk_page_buffers(NULL, page_bufs, 0, len,
1943 NULL, bput_one);
1944 ext4_set_inode_state(inode, EXT4_STATE_JDATA);1941 ext4_set_inode_state(inode, EXT4_STATE_JDATA);
1945out:1942out:
1946 unlock_page(page);1943 unlock_page(page);
1947out_no_pagelock:1944out_no_pagelock:
1945 if (!inline_data && page_bufs)
1946 ext4_walk_page_buffers(NULL, page_bufs, 0, len,
1947 NULL, bput_one);
1948 brelse(inode_bh);1948 brelse(inode_bh);
1949 return ret;1949 return ret;
1950}1950}
@@ -5026,7 +5026,7 @@ static int ext4_do_update_inode(handle_t *handle, · 3075 unmodified lines
5026 struct ext4_inode_info *ei = EXT4_I(inode);5026 struct ext4_inode_info *ei = EXT4_I(inode);
5027 struct buffer_head *bh = iloc->bh;5027 struct buffer_head *bh = iloc->bh;
5028 struct super_block *sb = inode->i_sb;5028 struct super_block *sb = inode->i_sb;
5029 int err = 0, rc, block;5029 int err = 0, block;
5030 int need_datasync = 0, set_large_file = 0;5030 int need_datasync = 0, set_large_file = 0;
5031 uid_t i_uid;5031 uid_t i_uid;
5032 gid_t i_gid;5032 gid_t i_gid;
@@ -5138,9 +5138,9 @@ static int ext4_do_update_inode(handle_t *handle, · 105 unmodified lines
5138 bh->b_data);5138 bh->b_data);
5139 5139
5140 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");5140 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
5141 rc = ext4_handle_dirty_metadata(handle, NULL, bh);5141 err = ext4_handle_dirty_metadata(handle, NULL, bh);
5142 if (!err)5142 if (err)
5143 err = rc;5143 goto out_brelse;
5144 ext4_clear_inode_state(inode, EXT4_STATE_NEW);5144 ext4_clear_inode_state(inode, EXT4_STATE_NEW);
5145 if (set_large_file) {5145 if (set_large_file) {
5146 BUFFER_TRACE(EXT4_SB(sb)->s_sbh, "get write access");5146 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
5387 inode->i_gid = attr->ia_gid;5387 inode->i_gid = attr->ia_gid;
5388 error = ext4_mark_inode_dirty(handle, inode);5388 error = ext4_mark_inode_dirty(handle, inode);
5389 ext4_journal_stop(handle);5389 ext4_journal_stop(handle);
5390 if (unlikely(error))5390 if (unlikely(error)) {
5391 ext4_fc_stop_update(inode);
5391 return error;5392 return error;
5393 }
5392 }5394 }
5393 5395
5394 if (attr->ia_valid & ATTR_SIZE) {5396 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
2709 }2709 }
2710 2710
2711 if (ext4_has_feature_flex_bg(sb)) {2711 if (ext4_has_feature_flex_bg(sb)) {
2712 /* a single flex group is supposed to be read by a single IO */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,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,
2714 BLK_MAX_SEGMENT_SIZE >> (sb->s_blocksize_bits - 9));2721 BLK_MAX_SEGMENT_SIZE >> (sb->s_blocksize_bits - 9));
2715 sbi->s_mb_prefetch *= 8; /* 8 prefetch IOs in flight at most */2722 sbi->s_mb_prefetch *= 8; /* 8 prefetch IOs in flight at most */
2716 } else {2723 } 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
3613 return retval;3613 return retval;
3614}3614}
3615 3615
3616static 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
3616static int ext4_find_delete_entry(handle_t *handle, struct inode *dir,3641static int ext4_find_delete_entry(handle_t *handle, struct inode *dir,
3617 const struct qstr *d_name)3642 const struct qstr *d_name)
3618{3643{
@@ -3774,14 +3799,14 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 155 unmodified lines
3774 */3799 */
3775 retval = -ENOENT;3800 retval = -ENOENT;
3776 if (!old.bh || le32_to_cpu(old.de->inode) != old.inode->i_ino)3801 if (!old.bh || le32_to_cpu(old.de->inode) != old.inode->i_ino)
3777 goto end_rename;3802 goto release_bh;
3778 3803
3779 new.bh = ext4_find_entry(new.dir, &new.dentry->d_name,3804 new.bh = ext4_find_entry(new.dir, &new.dentry->d_name,
3780 &new.de, &new.inlined);3805 &new.de, &new.inlined);
3781 if (IS_ERR(new.bh)) {3806 if (IS_ERR(new.bh)) {
3782 retval = PTR_ERR(new.bh);3807 retval = PTR_ERR(new.bh);
3783 new.bh = NULL;3808 new.bh = NULL;
3784 goto end_rename;3809 goto release_bh;
3785 }3810 }
3786 if (new.bh) {3811 if (new.bh) {
3787 if (!new.inode) {3812 if (!new.inode) {
@@ -3798,15 +3823,13 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 10 unmodified lines
3798 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits);3823 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits);
3799 if (IS_ERR(handle)) {3824 if (IS_ERR(handle)) {
3800 retval = PTR_ERR(handle);3825 retval = PTR_ERR(handle);
3801 handle = NULL;3826 goto release_bh;
3802 goto end_rename;
3803 }3827 }
3804 } else {3828 } else {
3805 whiteout = ext4_whiteout_for_rename(mnt_userns, &old, credits, &handle);3829 whiteout = ext4_whiteout_for_rename(mnt_userns, &old, credits, &handle);
3806 if (IS_ERR(whiteout)) {3830 if (IS_ERR(whiteout)) {
3807 retval = PTR_ERR(whiteout);3831 retval = PTR_ERR(whiteout);
3808 whiteout = NULL;3832 goto release_bh;
3809 goto end_rename;
3810 }3833 }
3811 }3834 }
3812 3835
@@ -3850,6 +3873,7 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 37 unmodified lines
3850 retval = ext4_mark_inode_dirty(handle, whiteout);3873 retval = ext4_mark_inode_dirty(handle, whiteout);
3851 if (unlikely(retval))3874 if (unlikely(retval))
3852 goto end_rename;3875 goto end_rename;
3876
3853 }3877 }
3854 if (!new.bh) {3878 if (!new.bh) {
3855 retval = ext4_add_entry(handle, new.dentry, old.inode);3879 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
3923 ext4_fc_track_unlink(handle, new.dentry);3947 ext4_fc_track_unlink(handle, new.dentry);
3924 __ext4_fc_track_link(handle, old.inode, new.dentry);3948 __ext4_fc_track_link(handle, old.inode, new.dentry);
3925 __ext4_fc_track_unlink(handle, old.inode, old.dentry);3949 __ext4_fc_track_unlink(handle, old.inode, old.dentry);
3950 if (whiteout)
3951 __ext4_fc_track_create(handle, whiteout, old.dentry);
3926 }3952 }
3927 3953
3928 if (new.inode) {3954 if (new.inode) {
@@ -3937,19 +3963,21 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 8 unmodified lines
3937end_rename:3963end_rename:
3938 if (whiteout) {3964 if (whiteout) {
3939 if (retval) {3965 if (retval) {
3940 ext4_setent(handle, &old,3966 ext4_resetent(handle, &old,
3941 old.inode->i_ino, old_file_type);3967 old.inode->i_ino, old_file_type);
3942 drop_nlink(whiteout);3968 drop_nlink(whiteout);
3969 ext4_orphan_add(handle, whiteout);
3943 }3970 }
3944 unlock_new_inode(whiteout);3971 unlock_new_inode(whiteout);
3972 ext4_journal_stop(handle);
3945 iput(whiteout);3973 iput(whiteout);
3946 3974 } else {
3975 ext4_journal_stop(handle);
3947 }3976 }
3977release_bh:
3948 brelse(old.dir_bh);3978 brelse(old.dir_bh);
3949 brelse(old.bh);3979 brelse(old.bh);
3950 brelse(new.bh);3980 brelse(new.bh);
3951 if (handle)
3952 ext4_journal_stop(handle);
3953 return retval;3981 return retval;
3954}3982}
3955 3983
fs/ext4/super.c+6−1
@@ -1210,6 +1210,7 @@ static void ext4_put_super(struct super_block *sb) · 1209 unmodified lines
1210 percpu_counter_destroy(&sbi->s_freeinodes_counter);1210 percpu_counter_destroy(&sbi->s_freeinodes_counter);
1211 percpu_counter_destroy(&sbi->s_dirs_counter);1211 percpu_counter_destroy(&sbi->s_dirs_counter);
1212 percpu_counter_destroy(&sbi->s_dirtyclusters_counter);1212 percpu_counter_destroy(&sbi->s_dirtyclusters_counter);
1213 percpu_counter_destroy(&sbi->s_sra_exceeded_retry_limit);
1213 percpu_free_rwsem(&sbi->s_writepages_rwsem);1214 percpu_free_rwsem(&sbi->s_writepages_rwsem);
1214#ifdef CONFIG_QUOTA1215#ifdef CONFIG_QUOTA
1215 for (i = 0; i < EXT4_MAXQUOTAS; i++)1216 for (i = 0; i < EXT4_MAXQUOTAS; i++)
@@ -5011,6 +5012,9 @@ no_journal: · 3795 unmodified lines
5011 if (!err)5012 if (!err)
5012 err = percpu_counter_init(&sbi->s_dirtyclusters_counter, 0,5013 err = percpu_counter_init(&sbi->s_dirtyclusters_counter, 0,
5013 GFP_KERNEL);5014 GFP_KERNEL);
5015 if (!err)
5016 err = percpu_counter_init(&sbi->s_sra_exceeded_retry_limit, 0,
5017 GFP_KERNEL);
5014 if (!err)5018 if (!err)
5015 err = percpu_init_rwsem(&sbi->s_writepages_rwsem);5019 err = percpu_init_rwsem(&sbi->s_writepages_rwsem);
5016 5020
@@ -5124,6 +5128,7 @@ failed_mount6: · 107 unmodified lines
5124 percpu_counter_destroy(&sbi->s_freeinodes_counter);5128 percpu_counter_destroy(&sbi->s_freeinodes_counter);
5125 percpu_counter_destroy(&sbi->s_dirs_counter);5129 percpu_counter_destroy(&sbi->s_dirs_counter);
5126 percpu_counter_destroy(&sbi->s_dirtyclusters_counter);5130 percpu_counter_destroy(&sbi->s_dirtyclusters_counter);
5131 percpu_counter_destroy(&sbi->s_sra_exceeded_retry_limit);
5127 percpu_free_rwsem(&sbi->s_writepages_rwsem);5132 percpu_free_rwsem(&sbi->s_writepages_rwsem);
5128failed_mount5:5133failed_mount5:
5129 ext4_ext_release(sb);5134 ext4_ext_release(sb);
@@ -5149,8 +5154,8 @@ failed_mount_wq: · 19 unmodified lines
5149failed_mount3a:5154failed_mount3a:
5150 ext4_es_unregister_shrinker(sbi);5155 ext4_es_unregister_shrinker(sbi);
5151failed_mount3:5156failed_mount3:
5152 del_timer_sync(&sbi->s_err_report);
5153 flush_work(&sbi->s_error_work);5157 flush_work(&sbi->s_error_work);
5158 del_timer_sync(&sbi->s_err_report);
5154 if (sbi->s_mmp_tsk)5159 if (sbi->s_mmp_tsk)
5155 kthread_stop(sbi->s_mmp_tsk);5160 kthread_stop(sbi->s_mmp_tsk);
5156failed_mount2:5161failed_mount2:
fs/ext4/sysfs.c+7−0
@@ -24,6 +24,7 @@ typedef enum { · 23 unmodified lines
24 attr_session_write_kbytes,24 attr_session_write_kbytes,
25 attr_lifetime_write_kbytes,25 attr_lifetime_write_kbytes,
26 attr_reserved_clusters,26 attr_reserved_clusters,
27 attr_sra_exceeded_retry_limit,
27 attr_inode_readahead,28 attr_inode_readahead,
28 attr_trigger_test_error,29 attr_trigger_test_error,
29 attr_first_error_time,30 attr_first_error_time,
@@ -202,6 +203,7 @@ EXT4_ATTR_FUNC(delayed_allocation_blocks, 0444); · 172 unmodified lines
202EXT4_ATTR_FUNC(session_write_kbytes, 0444);203EXT4_ATTR_FUNC(session_write_kbytes, 0444);
203EXT4_ATTR_FUNC(lifetime_write_kbytes, 0444);204EXT4_ATTR_FUNC(lifetime_write_kbytes, 0444);
204EXT4_ATTR_FUNC(reserved_clusters, 0644);205EXT4_ATTR_FUNC(reserved_clusters, 0644);
206EXT4_ATTR_FUNC(sra_exceeded_retry_limit, 0444);
205 207
206EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, inode_readahead,208EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, inode_readahead,
207 ext4_sb_info, s_inode_readahead_blks);209 ext4_sb_info, s_inode_readahead_blks);
@@ -251,6 +253,7 @@ static struct attribute *ext4_attrs[] = { · 43 unmodified lines
251 ATTR_LIST(session_write_kbytes),253 ATTR_LIST(session_write_kbytes),
252 ATTR_LIST(lifetime_write_kbytes),254 ATTR_LIST(lifetime_write_kbytes),
253 ATTR_LIST(reserved_clusters),255 ATTR_LIST(reserved_clusters),
256 ATTR_LIST(sra_exceeded_retry_limit),
254 ATTR_LIST(inode_readahead_blks),257 ATTR_LIST(inode_readahead_blks),
255 ATTR_LIST(inode_goal),258 ATTR_LIST(inode_goal),
256 ATTR_LIST(mb_stats),259 ATTR_LIST(mb_stats),
@@ -374,6 +377,10 @@ static ssize_t ext4_attr_show(struct kobject *kobj, · 117 unmodified lines
374 return snprintf(buf, PAGE_SIZE, "%llu\n",377 return snprintf(buf, PAGE_SIZE, "%llu\n",
375 (unsigned long long)378 (unsigned long long)
376 atomic64_read(&sbi->s_resv_clusters));379 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));
377 case attr_inode_readahead:384 case attr_inode_readahead:
378 case attr_pointer_ui:385 case attr_pointer_ui:
379 if (!ptr)386 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
201 struct inode *inode = file_inode(filp);201 struct inode *inode = file_inode(filp);
202 const int credits = 2; /* superblock and inode for ext4_orphan_del() */202 const int credits = 2; /* superblock and inode for ext4_orphan_del() */
203 handle_t *handle;203 handle_t *handle;
204 struct ext4_iloc iloc;
204 int err = 0;205 int err = 0;
205 int err2;
206 206
207 if (desc != NULL) {207 /*
208 /* Succeeded; write the verity descriptor. */208 * If an error already occurred (which fs/verity/ signals by passing
209 err = ext4_write_verity_descriptor(inode, desc, desc_size,209 * desc == NULL), then only clean-up is needed.
210 merkle_tree_size);210 */
211 211 if (desc == NULL)
212 /* Write all pages before clearing VERITY_IN_PROGRESS. */212 goto cleanup;
213 if (!err)
214 err = filemap_write_and_wait(inode->i_mapping);
215 }
216 213
217 /* If we failed, truncate anything we wrote past i_size. */214 /* Append the verity descriptor. */
218 if (desc == NULL || err)215 err = ext4_write_verity_descriptor(inode, desc, desc_size,
219 ext4_truncate(inode);216 merkle_tree_size);
217 if (err)
218 goto cleanup;
220 219
221 /*220 /*
222 * We must always clean up by clearing EXT4_STATE_VERITY_IN_PROGRESS and221 * Write all pages (both data and verity metadata). Note that this must
223 * deleting the inode from the orphan list, even if something failed.222 * happen before clearing EXT4_STATE_VERITY_IN_PROGRESS; otherwise pages
224 * If everything succeeded, we'll also set the verity bit in the same223 * beyond i_size won't be written properly. For crash consistency, this
225 * transaction.224 * also must happen before the verity inode flag gets persisted.
226 */225 */
226 err = filemap_write_and_wait(inode->i_mapping);
227 if (err)
228 goto cleanup;
227 229
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 */
229 234
230 handle = ext4_journal_start(inode, EXT4_HT_INODE, credits);235 handle = ext4_journal_start(inode, EXT4_HT_INODE, credits);
231 if (IS_ERR(handle)) {236 if (IS_ERR(handle)) {
232 ext4_orphan_del(NULL, inode);237 err = PTR_ERR(handle);
233 return PTR_ERR(handle);238 goto cleanup;
234 }239 }
235 240
236 err2 = ext4_orphan_del(handle, inode);241 err = ext4_orphan_del(handle, inode);
237 if (err2)242 if (err)
238 goto out_stop;243 goto stop_and_cleanup;
239 244
240 if (desc != NULL && !err) {245 err = ext4_reserve_inode_write(handle, inode, &iloc);
241 struct ext4_iloc iloc;246 if (err)
247 goto stop_and_cleanup;
242 248
243 err = ext4_reserve_inode_write(handle, inode, &iloc);249 ext4_set_inode_flag(inode, EXT4_INODE_VERITY);
244 if (err)250 ext4_set_inode_flags(inode, false);
245 goto out_stop;251 err = ext4_mark_iloc_dirty(handle, inode, &iloc);
246 ext4_set_inode_flag(inode, EXT4_INODE_VERITY);252 if (err)
247 ext4_set_inode_flags(inode, false);253 goto stop_and_cleanup;
248 err = ext4_mark_iloc_dirty(handle, inode, &iloc);254
249 }255 ext4_journal_stop(handle);
250out_stop:256
257 ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS);
258 return 0;
259
260stop_and_cleanup:
251 ext4_journal_stop(handle);261 ext4_journal_stop(handle);
252 return err ?: err2;262cleanup:
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;
253}274}
254 275
255static int ext4_get_verity_descriptor_location(struct inode *inode,276static 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
1462 if (!ce)1462 if (!ce)
1463 return NULL;1463 return NULL;
1464 1464
1465 WARN_ON_ONCE(ext4_handle_valid(journal_current_handle()) &&
1466 !(current->flags & PF_MEMALLOC_NOFS));
1467
1465 ea_data = kvmalloc(value_len, GFP_KERNEL);1468 ea_data = kvmalloc(value_len, GFP_KERNEL);
1466 if (!ea_data) {1469 if (!ea_data) {
1467 mb_cache_entry_put(ea_inode_cache, ce);1470 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
2327 error = -ENOSPC;2330 error = -ENOSPC;
2328 goto cleanup;2331 goto cleanup;
2329 }2332 }
2333 WARN_ON_ONCE(!(current->flags & PF_MEMALLOC_NOFS));
2330 }2334 }
2331 2335
2332 error = ext4_reserve_inode_write(handle, inode, &is.iloc);2336 error = ext4_reserve_inode_write(handle, inode, &is.iloc);
@@ -2400,7 +2404,7 @@ retry_inode: · 67 unmodified lines
2400 * external inode if possible.2404 * external inode if possible.
2401 */2405 */
2402 if (ext4_has_feature_ea_inode(inode->i_sb) &&2406 if (ext4_has_feature_ea_inode(inode->i_sb) &&
2403 !i.in_inode) {2407 i.value_len && !i.in_inode) {
2404 i.in_inode = 1;2408 i.in_inode = 1;
2405 goto retry_inode;2409 goto retry_inode;
2406 }2410 }
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
2229static long fuse_dev_ioctl(struct file *file, unsigned int cmd,2229static long fuse_dev_ioctl(struct file *file, unsigned int cmd,
2230 unsigned long arg)2230 unsigned long arg)
2231{2231{
2232 int err = -ENOTTY;2232 int res;
2233 int oldfd;
2234 struct fuse_dev *fud = NULL;
2233 2235
2234 if (cmd == FUSE_DEV_IOC_CLONE) {2236 if (_IOC_TYPE(cmd) != FUSE_DEV_IOC_MAGIC)
2235 int oldfd;2237 return -ENOTTY;
2236 2238
2237 err = -EFAULT;2239 switch (_IOC_NR(cmd)) {
2238 if (!get_user(oldfd, (__u32 __user *) arg)) {2240 case _IOC_NR(FUSE_DEV_IOC_CLONE):
2241 res = -EFAULT;
2242 if (!get_user(oldfd, (__u32 __user *)arg)) {
2239 struct file *old = fget(oldfd);2243 struct file *old = fget(oldfd);
2240 2244
2241 err = -EINVAL;2245 res = -EINVAL;
2242 if (old) {2246 if (old) {
2243 struct fuse_dev *fud = NULL;
2244
2245 /*2247 /*
2246 * Check against file->f_op because CUSE2248 * Check against file->f_op because CUSE
2247 * uses the same ioctl handler.2249 * uses the same ioctl handler.
@@ -2252,14 +2254,18 @@ static long fuse_dev_ioctl(struct file *file, unsigned int cmd, · 4 unmodified lines
2252 2254
2253 if (fud) {2255 if (fud) {
2254 mutex_lock(&fuse_mutex);2256 mutex_lock(&fuse_mutex);
2255 err = fuse_device_clone(fud->fc, file);2257 res = fuse_device_clone(fud->fc, file);
2256 mutex_unlock(&fuse_mutex);2258 mutex_unlock(&fuse_mutex);
2257 }2259 }
2258 fput(old);2260 fput(old);
2259 }2261 }
2260 }2262 }
2263 break;
2264 default:
2265 res = -ENOTTY;
2266 break;
2261 }2267 }
2262 return err;2268 return res;
2263}2269}
2264 2270
2265const struct file_operations fuse_dev_operations = {2271const 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
863 863
864static inline void fuse_make_bad(struct inode *inode)864static inline void fuse_make_bad(struct inode *inode)
865{865{
866 remove_inode_hash(inode);
866 set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state);867 set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state);
867}868}
868 869
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
1324 1324
1325 /* virtiofs allocates and installs its own fuse devices */1325 /* virtiofs allocates and installs its own fuse devices */
1326 ctx->fudptr = NULL;1326 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 }
1328 ctx->dax_dev = fs->dax_dev;1334 ctx->dax_dev = fs->dax_dev;
1335 }
1329 err = fuse_fill_super_common(sb, ctx);1336 err = fuse_fill_super_common(sb, ctx);
1330 if (err < 0)1337 if (err < 0)
1331 goto err_free_fuse_devs;1338 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
386 return NULL;386 return NULL;
387}387}
388 388
389static void io_flush_signals(void)389static bool io_flush_signals(void)
390{390{
391 if (unlikely(test_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL))) {391 if (unlikely(test_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL))) {
392 __set_current_state(TASK_RUNNING);
392 if (current->task_works)393 if (current->task_works)
393 task_work_run();394 task_work_run();
394 clear_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL);395 clear_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL);
396 return true;
395 }397 }
398 return false;
396}399}
397 400
398static void io_assign_current_work(struct io_worker *worker,401static void io_assign_current_work(struct io_worker *worker,
@@ -488,6 +491,8 @@ static int io_wqe_worker(void *data) · 89 unmodified lines
488 set_task_comm(current, buf);491 set_task_comm(current, buf);
489 492
490 while (!test_bit(IO_WQ_BIT_EXIT, &wq->state)) {493 while (!test_bit(IO_WQ_BIT_EXIT, &wq->state)) {
494 long ret;
495
491 set_current_state(TASK_INTERRUPTIBLE);496 set_current_state(TASK_INTERRUPTIBLE);
492loop:497loop:
493 raw_spin_lock_irq(&wqe->lock);498 raw_spin_lock_irq(&wqe->lock);
@@ -497,8 +502,10 @@ loop: · 3 unmodified lines
497 }502 }
498 __io_worker_idle(wqe, worker);503 __io_worker_idle(wqe, worker);
499 raw_spin_unlock_irq(&wqe->lock);504 raw_spin_unlock_irq(&wqe->lock);
500 io_flush_signals();505 if (io_flush_signals())
501 if (schedule_timeout(WORKER_IDLE_TIMEOUT))506 continue;
507 ret = schedule_timeout(WORKER_IDLE_TIMEOUT);
508 if (try_to_freeze() || ret)
502 continue;509 continue;
503 if (fatal_signal_pending(current))510 if (fatal_signal_pending(current))
504 break;511 break;
@@ -709,6 +716,7 @@ static int io_wq_manager(void *data) · 204 unmodified lines
709 set_current_state(TASK_INTERRUPTIBLE);716 set_current_state(TASK_INTERRUPTIBLE);
710 io_wq_check_workers(wq);717 io_wq_check_workers(wq);
711 schedule_timeout(HZ);718 schedule_timeout(HZ);
719 try_to_freeze();
712 if (fatal_signal_pending(current))720 if (fatal_signal_pending(current))
713 set_bit(IO_WQ_BIT_EXIT, &wq->state);721 set_bit(IO_WQ_BIT_EXIT, &wq->state);
714 } while (!test_bit(IO_WQ_BIT_EXIT, &wq->state));722 } while (!test_bit(IO_WQ_BIT_EXIT, &wq->state));
fs/io-wq.h+9−1
@@ -2,7 +2,6 @@ · 1 unmodified line
2#define INTERNAL_IO_WQ_H2#define INTERNAL_IO_WQ_H
3 3
4#include <linux/refcount.h>4#include <linux/refcount.h>
5#include <linux/io_uring.h>
6 5
7struct io_wq;6struct io_wq;
8 7
@@ -21,6 +20,15 @@ enum io_wq_cancel { · 12 unmodified lines
21 IO_WQ_CANCEL_NOTFOUND, /* work not found */20 IO_WQ_CANCEL_NOTFOUND, /* work not found */
22};21};
23 22
23struct io_wq_work_node {
24 struct io_wq_work_node *next;
25};
26
27struct io_wq_work_list {
28 struct io_wq_work_node *first;
29 struct io_wq_work_node *last;
30};
31
24static inline void wq_list_add_after(struct io_wq_work_node *node,32static inline void wq_list_add_after(struct io_wq_work_node *node,
25 struct io_wq_work_node *pos,33 struct io_wq_work_node *pos,
26 struct io_wq_work_list *list)34 struct io_wq_work_list *list)
fs/io_uring.c+147−105
@@ -258,7 +258,8 @@ enum { · 257 unmodified lines
258 258
259struct io_sq_data {259struct io_sq_data {
260 refcount_t refs;260 refcount_t refs;
261 struct rw_semaphore rw_lock;261 atomic_t park_pending;
262 struct mutex lock;
262 263
263 /* ctx's that are using this sqd */264 /* ctx's that are using this sqd */
264 struct list_head ctx_list;265 struct list_head ctx_list;
@@ -273,6 +274,7 @@ struct io_sq_data { · 8 unmodified lines
273 274
274 unsigned long state;275 unsigned long state;
275 struct completion exited;276 struct completion exited;
277 struct callback_head *park_task_work;
276};278};
277 279
278#define IO_IOPOLL_BATCH 8280#define IO_IOPOLL_BATCH 8
@@ -402,7 +404,7 @@ struct io_ring_ctx { · 123 unmodified lines
402 struct socket *ring_sock;404 struct socket *ring_sock;
403#endif405#endif
404 406
405 struct idr io_buffer_idr;407 struct xarray io_buffers;
406 408
407 struct xarray personalities;409 struct xarray personalities;
408 u32 pers_next;410 u32 pers_next;
@@ -454,6 +456,22 @@ struct io_ring_ctx { · 45 unmodified lines
454 struct list_head tctx_list;456 struct list_head tctx_list;
455};457};
456 458
459struct 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
457/*475/*
458 * First field must be the file pointer in all the476 * First field must be the file pointer in all the
459 * iocb unions! See also 'struct kiocb' in <linux/fs.h>477 * 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
1135 init_waitqueue_head(&ctx->cq_wait);1153 init_waitqueue_head(&ctx->cq_wait);
1136 INIT_LIST_HEAD(&ctx->cq_overflow_list);1154 INIT_LIST_HEAD(&ctx->cq_overflow_list);
1137 init_completion(&ctx->ref_comp);1155 init_completion(&ctx->ref_comp);
1138 idr_init(&ctx->io_buffer_idr);1156 xa_init_flags(&ctx->io_buffers, XA_FLAGS_ALLOC1);
1139 xa_init_flags(&ctx->personalities, XA_FLAGS_ALLOC1);1157 xa_init_flags(&ctx->personalities, XA_FLAGS_ALLOC1);
1140 mutex_init(&ctx->uring_lock);1158 mutex_init(&ctx->uring_lock);
1141 init_waitqueue_head(&ctx->wait);1159 init_waitqueue_head(&ctx->wait);
@@ -1550,14 +1568,17 @@ static void io_req_complete_post(struct io_kiocb *req, long res, · 408 unmodified lines
1550 io_put_task(req->task, 1);1568 io_put_task(req->task, 1);
1551 list_add(&req->compl.list, &cs->locked_free_list);1569 list_add(&req->compl.list, &cs->locked_free_list);
1552 cs->locked_free_nr++;1570 cs->locked_free_nr++;
1553 } else1571 } else {
1554 req = NULL;1572 if (!percpu_ref_tryget(&ctx->refs))
1573 req = NULL;
1574 }
1555 io_commit_cqring(ctx);1575 io_commit_cqring(ctx);
1556 spin_unlock_irqrestore(&ctx->completion_lock, flags);1576 spin_unlock_irqrestore(&ctx->completion_lock, flags);
1557 io_cqring_ev_posted(ctx);
1558 1577
1559 if (req)1578 if (req) {
1579 io_cqring_ev_posted(ctx);
1560 percpu_ref_put(&ctx->refs);1580 percpu_ref_put(&ctx->refs);
1581 }
1561}1582}
1562 1583
1563static void io_req_complete_state(struct io_kiocb *req, long res,1584static 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
1925 return ret;1946 return ret;
1926}1947}
1927 1948
1928static void io_req_task_work_add_fallback(struct io_kiocb *req,1949static bool io_run_task_work_head(struct callback_head **work_head)
1929 task_work_func_t cb)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
1971static void io_task_work_add_head(struct callback_head **work_head,
1972 struct callback_head *task_work)
1930{1973{
1931 struct io_ring_ctx *ctx = req->ctx;
1932 struct callback_head *head;1974 struct callback_head *head;
1933 1975
1934 init_task_work(&req->task_work, cb);
1935 do {1976 do {
1936 head = READ_ONCE(ctx->exit_task_work);1977 head = READ_ONCE(*work_head);
1937 req->task_work.next = head;1978 task_work->next = head;
1938 } while (cmpxchg(&ctx->exit_task_work, head, &req->task_work) != head);1979 } while (cmpxchg(work_head, head, task_work) != head);
1980}
1981
1982static 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);
1939}1987}
1940 1988
1941static void __io_req_task_cancel(struct io_kiocb *req, int error)1989static 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
2843 2891
2844 lockdep_assert_held(&req->ctx->uring_lock);2892 lockdep_assert_held(&req->ctx->uring_lock);
2845 2893
2846 head = idr_find(&req->ctx->io_buffer_idr, bgid);2894 head = xa_load(&req->ctx->io_buffers, bgid);
2847 if (head) {2895 if (head) {
2848 if (!list_empty(&head->list)) {2896 if (!list_empty(&head->list)) {
2849 kbuf = list_last_entry(&head->list, struct io_buffer,2897 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
2851 list_del(&kbuf->list);2899 list_del(&kbuf->list);
2852 } else {2900 } else {
2853 kbuf = head;2901 kbuf = head;
2854 idr_remove(&req->ctx->io_buffer_idr, bgid);2902 xa_erase(&req->ctx->io_buffers, bgid);
2855 }2903 }
2856 if (*len > kbuf->len)2904 if (*len > kbuf->len)
2857 *len = kbuf->len;2905 *len = kbuf->len;
@@ -3892,7 +3940,7 @@ static int __io_remove_buffers(struct io_ring_ctx *ctx, struct io_buffer *buf, · 1034 unmodified lines
3892 }3940 }
3893 i++;3941 i++;
3894 kfree(buf);3942 kfree(buf);
3895 idr_remove(&ctx->io_buffer_idr, bgid);3943 xa_erase(&ctx->io_buffers, bgid);
3896 3944
3897 return i;3945 return i;
3898}3946}
@@ -3910,7 +3958,7 @@ static int io_remove_buffers(struct io_kiocb *req, unsigned int issue_flags) · 11 unmodified lines
3910 lockdep_assert_held(&ctx->uring_lock);3958 lockdep_assert_held(&ctx->uring_lock);
3911 3959
3912 ret = -ENOENT;3960 ret = -ENOENT;
3913 head = idr_find(&ctx->io_buffer_idr, p->bgid);3961 head = xa_load(&ctx->io_buffers, p->bgid);
3914 if (head)3962 if (head)
3915 ret = __io_remove_buffers(ctx, head, p->bgid, p->nbufs);3963 ret = __io_remove_buffers(ctx, head, p->bgid, p->nbufs);
3916 if (ret < 0)3964 if (ret < 0)
@@ -3993,21 +4041,14 @@ static int io_provide_buffers(struct io_kiocb *req, unsigned int issue_flags) · 76 unmodified lines
3993 4041
3994 lockdep_assert_held(&ctx->uring_lock);4042 lockdep_assert_held(&ctx->uring_lock);
3995 4043
3996 list = head = idr_find(&ctx->io_buffer_idr, p->bgid);4044 list = head = xa_load(&ctx->io_buffers, p->bgid);
3997 4045
3998 ret = io_add_buffers(p, &head);4046 ret = io_add_buffers(p, &head);
3999 if (ret < 0)4047 if (ret >= 0 && !list) {
4000 goto out;4048 ret = xa_insert(&ctx->io_buffers, p->bgid, head, GFP_KERNEL);
4001 4049 if (ret < 0)
4002 if (!list) {
4003 ret = idr_alloc(&ctx->io_buffer_idr, head, p->bgid, p->bgid + 1,
4004 GFP_KERNEL);
4005 if (ret < 0) {
4006 __io_remove_buffers(ctx, head, p->bgid, -1U);4050 __io_remove_buffers(ctx, head, p->bgid, -1U);
4007 goto out;
4008 }
4009 }4051 }
4010out:
4011 if (ret < 0)4052 if (ret < 0)
4012 req_set_fail_links(req);4053 req_set_fail_links(req);
4013 4054
@@ -4345,6 +4386,7 @@ static int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags) · 331 unmodified lines
4345 struct io_async_msghdr iomsg, *kmsg;4386 struct io_async_msghdr iomsg, *kmsg;
4346 struct socket *sock;4387 struct socket *sock;
4347 unsigned flags;4388 unsigned flags;
4389 int min_ret = 0;
4348 int ret;4390 int ret;
4349 4391
4350 sock = sock_from_file(req->file);4392 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
4359 kmsg = &iomsg;4401 kmsg = &iomsg;
4360 }4402 }
4361 4403
4362 flags = req->sr_msg.msg_flags;4404 flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
4363 if (flags & MSG_DONTWAIT)4405 if (flags & MSG_DONTWAIT)
4364 req->flags |= REQ_F_NOWAIT;4406 req->flags |= REQ_F_NOWAIT;
4365 else if (issue_flags & IO_URING_F_NONBLOCK)4407 else if (issue_flags & IO_URING_F_NONBLOCK)
4366 flags |= MSG_DONTWAIT;4408 flags |= MSG_DONTWAIT;
4367 4409
4410 if (flags & MSG_WAITALL)
4411 min_ret = iov_iter_count(&kmsg->msg.msg_iter);
4412
4368 ret = __sys_sendmsg_sock(sock, &kmsg->msg, flags);4413 ret = __sys_sendmsg_sock(sock, &kmsg->msg, flags);
4369 if ((issue_flags & IO_URING_F_NONBLOCK) && ret == -EAGAIN)4414 if ((issue_flags & IO_URING_F_NONBLOCK) && ret == -EAGAIN)
4370 return io_setup_async_msg(req, kmsg);4415 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
4375 if (kmsg->free_iov)4420 if (kmsg->free_iov)
4376 kfree(kmsg->free_iov);4421 kfree(kmsg->free_iov);
4377 req->flags &= ~REQ_F_NEED_CLEANUP;4422 req->flags &= ~REQ_F_NEED_CLEANUP;
4378 if (ret < 0)4423 if (ret < min_ret)
4379 req_set_fail_links(req);4424 req_set_fail_links(req);
4380 __io_req_complete(req, issue_flags, ret, 0);4425 __io_req_complete(req, issue_flags, ret, 0);
4381 return 0;4426 return 0;
@@ -4388,6 +4433,7 @@ static int io_send(struct io_kiocb *req, unsigned int issue_flags) · 6 unmodified lines
4388 struct iovec iov;4433 struct iovec iov;
4389 struct socket *sock;4434 struct socket *sock;
4390 unsigned flags;4435 unsigned flags;
4436 int min_ret = 0;
4391 int ret;4437 int ret;
4392 4438
4393 sock = sock_from_file(req->file);4439 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
4403 msg.msg_controllen = 0;4449 msg.msg_controllen = 0;
4404 msg.msg_namelen = 0;4450 msg.msg_namelen = 0;
4405 4451
4406 flags = req->sr_msg.msg_flags;4452 flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
4407 if (flags & MSG_DONTWAIT)4453 if (flags & MSG_DONTWAIT)
4408 req->flags |= REQ_F_NOWAIT;4454 req->flags |= REQ_F_NOWAIT;
4409 else if (issue_flags & IO_URING_F_NONBLOCK)4455 else if (issue_flags & IO_URING_F_NONBLOCK)
4410 flags |= MSG_DONTWAIT;4456 flags |= MSG_DONTWAIT;
4411 4457
4458 if (flags & MSG_WAITALL)
4459 min_ret = iov_iter_count(&msg.msg_iter);
4460
4412 msg.msg_flags = flags;4461 msg.msg_flags = flags;
4413 ret = sock_sendmsg(sock, &msg);4462 ret = sock_sendmsg(sock, &msg);
4414 if ((issue_flags & IO_URING_F_NONBLOCK) && ret == -EAGAIN)4463 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
4416 if (ret == -ERESTARTSYS)4465 if (ret == -ERESTARTSYS)
4417 ret = -EINTR;4466 ret = -EINTR;
4418 4467
4419 if (ret < 0)4468 if (ret < min_ret)
4420 req_set_fail_links(req);4469 req_set_fail_links(req);
4421 __io_req_complete(req, issue_flags, ret, 0);4470 __io_req_complete(req, issue_flags, ret, 0);
4422 return 0;4471 return 0;
@@ -4568,6 +4617,7 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) · 145 unmodified lines
4568 struct socket *sock;4617 struct socket *sock;
4569 struct io_buffer *kbuf;4618 struct io_buffer *kbuf;
4570 unsigned flags;4619 unsigned flags;
4620 int min_ret = 0;
4571 int ret, cflags = 0;4621 int ret, cflags = 0;
4572 bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;4622 bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;
4573 4623
@@ -4593,12 +4643,15 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) · 19 unmodified lines
4593 1, req->sr_msg.len);4643 1, req->sr_msg.len);
4594 }4644 }
4595 4645
4596 flags = req->sr_msg.msg_flags;4646 flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
4597 if (flags & MSG_DONTWAIT)4647 if (flags & MSG_DONTWAIT)
4598 req->flags |= REQ_F_NOWAIT;4648 req->flags |= REQ_F_NOWAIT;
4599 else if (force_nonblock)4649 else if (force_nonblock)
4600 flags |= MSG_DONTWAIT;4650 flags |= MSG_DONTWAIT;
4601 4651
4652 if (flags & MSG_WAITALL)
4653 min_ret = iov_iter_count(&kmsg->msg.msg_iter);
4654
4602 ret = __sys_recvmsg_sock(sock, &kmsg->msg, req->sr_msg.umsg,4655 ret = __sys_recvmsg_sock(sock, &kmsg->msg, req->sr_msg.umsg,
4603 kmsg->uaddr, flags);4656 kmsg->uaddr, flags);
4604 if (force_nonblock && ret == -EAGAIN)4657 if (force_nonblock && ret == -EAGAIN)
@@ -4612,7 +4665,7 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) · 7 unmodified lines
4612 if (kmsg->free_iov)4665 if (kmsg->free_iov)
4613 kfree(kmsg->free_iov);4666 kfree(kmsg->free_iov);
4614 req->flags &= ~REQ_F_NEED_CLEANUP;4667 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))))
4616 req_set_fail_links(req);4669 req_set_fail_links(req);
4617 __io_req_complete(req, issue_flags, ret, cflags);4670 __io_req_complete(req, issue_flags, ret, cflags);
4618 return 0;4671 return 0;
@@ -4627,6 +4680,7 @@ static int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 8 unmodified lines
4627 struct socket *sock;4680 struct socket *sock;
4628 struct iovec iov;4681 struct iovec iov;
4629 unsigned flags;4682 unsigned flags;
4683 int min_ret = 0;
4630 int ret, cflags = 0;4684 int ret, cflags = 0;
4631 bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;4685 bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;
4632 4686
@@ -4652,12 +4706,15 @@ static int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 19 unmodified lines
4652 msg.msg_iocb = NULL;4706 msg.msg_iocb = NULL;
4653 msg.msg_flags = 0;4707 msg.msg_flags = 0;
4654 4708
4655 flags = req->sr_msg.msg_flags;4709 flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
4656 if (flags & MSG_DONTWAIT)4710 if (flags & MSG_DONTWAIT)
4657 req->flags |= REQ_F_NOWAIT;4711 req->flags |= REQ_F_NOWAIT;
4658 else if (force_nonblock)4712 else if (force_nonblock)
4659 flags |= MSG_DONTWAIT;4713 flags |= MSG_DONTWAIT;
4660 4714
4715 if (flags & MSG_WAITALL)
4716 min_ret = iov_iter_count(&msg.msg_iter);
4717
4661 ret = sock_recvmsg(sock, &msg, flags);4718 ret = sock_recvmsg(sock, &msg, flags);
4662 if (force_nonblock && ret == -EAGAIN)4719 if (force_nonblock && ret == -EAGAIN)
4663 return -EAGAIN;4720 return -EAGAIN;
@@ -4666,7 +4723,7 @@ static int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 2 unmodified lines
4666out_free:4723out_free:
4667 if (req->flags & REQ_F_BUFFER_SELECTED)4724 if (req->flags & REQ_F_BUFFER_SELECTED)
4668 cflags = io_put_recv_kbuf(req);4725 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))))
4670 req_set_fail_links(req);4727 req_set_fail_links(req);
4671 __io_req_complete(req, issue_flags, ret, cflags);4728 __io_req_complete(req, issue_flags, ret, cflags);
4672 return 0;4729 return 0;
@@ -6204,7 +6261,6 @@ static enum hrtimer_restart io_link_timeout_fn(struct hrtimer *timer) · 1531 unmodified lines
6204 spin_unlock_irqrestore(&ctx->completion_lock, flags);6261 spin_unlock_irqrestore(&ctx->completion_lock, flags);
6205 6262
6206 if (prev) {6263 if (prev) {
6207 req_set_fail_links(prev);
6208 io_async_find_and_cancel(ctx, req, prev->user_data, -ETIME);6264 io_async_find_and_cancel(ctx, req, prev->user_data, -ETIME);
6209 io_put_req_deferred(prev, 1);6265 io_put_req_deferred(prev, 1);
6210 } else {6266 } else {
@@ -6694,17 +6750,17 @@ static int io_sq_thread(void *data) · 483 unmodified lines
6694 set_cpus_allowed_ptr(current, cpu_online_mask);6750 set_cpus_allowed_ptr(current, cpu_online_mask);
6695 current->flags |= PF_NO_SETAFFINITY;6751 current->flags |= PF_NO_SETAFFINITY;
6696 6752
6697 down_read(&sqd->rw_lock);6753 mutex_lock(&sqd->lock);
6698
6699 while (!test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state)) {6754 while (!test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state)) {
6700 int ret;6755 int ret;
6701 bool cap_entries, sqt_spin, needs_sched;6756 bool cap_entries, sqt_spin, needs_sched;
6702 6757
6703 if (test_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state)) {6758 if (test_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state)) {
6704 up_read(&sqd->rw_lock);6759 mutex_unlock(&sqd->lock);
6705 cond_resched();6760 cond_resched();
6706 down_read(&sqd->rw_lock);6761 mutex_lock(&sqd->lock);
6707 io_run_task_work();6762 io_run_task_work();
6763 io_run_task_work_head(&sqd->park_task_work);
6708 timeout = jiffies + sqd->sq_thread_idle;6764 timeout = jiffies + sqd->sq_thread_idle;
6709 continue;6765 continue;
6710 }6766 }
@@ -6750,32 +6806,28 @@ static int io_sq_thread(void *data) · 39 unmodified lines
6750 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)6806 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
6751 io_ring_set_wakeup_flag(ctx);6807 io_ring_set_wakeup_flag(ctx);
6752 6808
6753 up_read(&sqd->rw_lock);6809 mutex_unlock(&sqd->lock);
6754 schedule();6810 schedule();
6755 down_read(&sqd->rw_lock);6811 try_to_freeze();
6812 mutex_lock(&sqd->lock);
6756 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)6813 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
6757 io_ring_clear_wakeup_flag(ctx);6814 io_ring_clear_wakeup_flag(ctx);
6758 }6815 }
6759 6816
6760 finish_wait(&sqd->wait, &wait);6817 finish_wait(&sqd->wait, &wait);
6818 io_run_task_work_head(&sqd->park_task_work);
6761 timeout = jiffies + sqd->sq_thread_idle;6819 timeout = jiffies + sqd->sq_thread_idle;
6762 }6820 }
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();
6770 6821
6771 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)6822 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
6772 io_uring_cancel_sqpoll(ctx);6823 io_uring_cancel_sqpoll(ctx);
6773 sqd->thread = NULL;6824 sqd->thread = NULL;
6774 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)6825 list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
6775 io_ring_set_wakeup_flag(ctx);6826 io_ring_set_wakeup_flag(ctx);
6776 up_write(&sqd->rw_lock);6827 mutex_unlock(&sqd->lock);
6777 6828
6778 io_run_task_work();6829 io_run_task_work();
6830 io_run_task_work_head(&sqd->park_task_work);
6779 complete(&sqd->exited);6831 complete(&sqd->exited);
6780 do_exit(0);6832 do_exit(0);
6781}6833}
@@ -7075,23 +7127,28 @@ static int io_sqe_files_unregister(struct io_ring_ctx *ctx) · 293 unmodified lines
7075}7127}
7076 7128
7077static void io_sq_thread_unpark(struct io_sq_data *sqd)7129static void io_sq_thread_unpark(struct io_sq_data *sqd)
7078 __releases(&sqd->rw_lock)7130 __releases(&sqd->lock)
7079{7131{
7080 WARN_ON_ONCE(sqd->thread == current);7132 WARN_ON_ONCE(sqd->thread == current);
7081 7133
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 */
7082 clear_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);7138 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);
7084}7142}
7085 7143
7086static void io_sq_thread_park(struct io_sq_data *sqd)7144static void io_sq_thread_park(struct io_sq_data *sqd)
7087 __acquires(&sqd->rw_lock)7145 __acquires(&sqd->lock)
7088{7146{
7089 WARN_ON_ONCE(sqd->thread == current);7147 WARN_ON_ONCE(sqd->thread == current);
7090 7148
7149 atomic_inc(&sqd->park_pending);
7091 set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);7150 set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);
7092 down_write(&sqd->rw_lock);7151 mutex_lock(&sqd->lock);
7093 /* set again for consistency, in case concurrent parks are happening */
7094 set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);
7095 if (sqd->thread)7152 if (sqd->thread)
7096 wake_up_process(sqd->thread);7153 wake_up_process(sqd->thread);
7097}7154}
@@ -7100,17 +7157,19 @@ static void io_sq_thread_stop(struct io_sq_data *sqd) · 2 unmodified lines
7100{7157{
7101 WARN_ON_ONCE(sqd->thread == current);7158 WARN_ON_ONCE(sqd->thread == current);
7102 7159
7103 down_write(&sqd->rw_lock);7160 mutex_lock(&sqd->lock);
7104 set_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state);7161 set_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state);
7105 if (sqd->thread)7162 if (sqd->thread)
7106 wake_up_process(sqd->thread);7163 wake_up_process(sqd->thread);
7107 up_write(&sqd->rw_lock);7164 mutex_unlock(&sqd->lock);
7108 wait_for_completion(&sqd->exited);7165 wait_for_completion(&sqd->exited);
7109}7166}
7110 7167
7111static void io_put_sq_data(struct io_sq_data *sqd)7168static void io_put_sq_data(struct io_sq_data *sqd)
7112{7169{
7113 if (refcount_dec_and_test(&sqd->refs)) {7170 if (refcount_dec_and_test(&sqd->refs)) {
7171 WARN_ON_ONCE(atomic_read(&sqd->park_pending));
7172
7114 io_sq_thread_stop(sqd);7173 io_sq_thread_stop(sqd);
7115 kfree(sqd);7174 kfree(sqd);
7116 }7175 }
@@ -7184,9 +7243,10 @@ static struct io_sq_data *io_get_sq_data(struct io_uring_params *p, · 67 unmodified lines
7184 if (!sqd)7243 if (!sqd)
7185 return ERR_PTR(-ENOMEM);7244 return ERR_PTR(-ENOMEM);
7186 7245
7246 atomic_set(&sqd->park_pending, 0);
7187 refcount_set(&sqd->refs, 1);7247 refcount_set(&sqd->refs, 1);
7188 INIT_LIST_HEAD(&sqd->ctx_list);7248 INIT_LIST_HEAD(&sqd->ctx_list);
7189 init_rwsem(&sqd->rw_lock);7249 mutex_init(&sqd->lock);
7190 init_waitqueue_head(&sqd->wait);7250 init_waitqueue_head(&sqd->wait);
7191 init_completion(&sqd->exited);7251 init_completion(&sqd->exited);
7192 return sqd;7252 return sqd;
@@ -7866,22 +7926,17 @@ static int io_sq_offload_create(struct io_ring_ctx *ctx, · 673 unmodified lines
7866 7926
7867 ret = 0;7927 ret = 0;
7868 io_sq_thread_park(sqd);7928 io_sq_thread_park(sqd);
7929 list_add(&ctx->sqd_list, &sqd->ctx_list);
7930 io_sqd_update_thread_idle(sqd);
7869 /* don't attach to a dying SQPOLL thread, would be racy */7931 /* don't attach to a dying SQPOLL thread, would be racy */
7870 if (attached && !sqd->thread) {7932 if (attached && !sqd->thread)
7871 ret = -ENXIO;7933 ret = -ENXIO;
7872 } else {
7873 list_add(&ctx->sqd_list, &sqd->ctx_list);
7874 io_sqd_update_thread_idle(sqd);
7875 }
7876 io_sq_thread_unpark(sqd);7934 io_sq_thread_unpark(sqd);
7877 7935
7878 if (ret < 0) {7936 if (ret < 0)
7879 io_put_sq_data(sqd);7937 goto err;
7880 ctx->sq_data = NULL;7938 if (attached)
7881 return ret;
7882 } else if (attached) {
7883 return 0;7939 return 0;
7884 }
7885 7940
7886 if (p->flags & IORING_SETUP_SQ_AFF) {7941 if (p->flags & IORING_SETUP_SQ_AFF) {
7887 int cpu = p->sq_thread_cpu;7942 int cpu = p->sq_thread_cpu;
@@ -8332,19 +8387,13 @@ static int io_eventfd_unregister(struct io_ring_ctx *ctx) · 444 unmodified lines
8332 return -ENXIO;8387 return -ENXIO;
8333}8388}
8334 8389
8335static 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
8344static void io_destroy_buffers(struct io_ring_ctx *ctx)8390static void io_destroy_buffers(struct io_ring_ctx *ctx)
8345{8391{
8346 idr_for_each(&ctx->io_buffer_idr, __io_destroy_buffers, ctx);8392 struct io_buffer *buf;
8347 idr_destroy(&ctx->io_buffer_idr);8393 unsigned long index;
8394
8395 xa_for_each(&ctx->io_buffers, index, buf)
8396 __io_remove_buffers(ctx, buf, index, -1U);
8348}8397}
8349 8398
8350static void io_req_cache_free(struct list_head *list, struct task_struct *tsk)8399static 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
8386{8435{
8387 /*8436 /*
8388 * Some may use context even when all refs and requests have been put,8437 * 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, see8438 * and they are free to do so while still holding uring_lock or
8390 * __io_req_task_submit(). Wait for them to finish.8439 * completion_lock, see __io_req_task_submit(). Wait for them to finish.
8391 */8440 */
8392 mutex_lock(&ctx->uring_lock);8441 mutex_lock(&ctx->uring_lock);
8393 mutex_unlock(&ctx->uring_lock);8442 mutex_unlock(&ctx->uring_lock);
8443 spin_lock_irq(&ctx->completion_lock);
8444 spin_unlock_irq(&ctx->completion_lock);
8394 8445
8395 io_sq_thread_finish(ctx);8446 io_sq_thread_finish(ctx);
8396 io_sqe_buffers_unregister(ctx);8447 io_sqe_buffers_unregister(ctx);
@@ -8478,26 +8529,9 @@ static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id) · 81 unmodified lines
8478 return -EINVAL;8529 return -EINVAL;
8479}8530}
8480 8531
8481static bool io_run_ctx_fallback(struct io_ring_ctx *ctx)8532static inline bool io_run_ctx_fallback(struct io_ring_ctx *ctx)
8482{8533{
8483 struct callback_head *work, *next;8534 return io_run_task_work_head(&ctx->exit_task_work);
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;
8501}8535}
8502 8536
8503struct io_tctx_exit {8537struct io_tctx_exit {
@@ -8580,6 +8614,14 @@ static void io_ring_ctx_wait_and_kill(struct io_ring_ctx *ctx) · 76 unmodified lines
8580 io_unregister_personality(ctx, index);8614 io_unregister_personality(ctx, index);
8581 mutex_unlock(&ctx->uring_lock);8615 mutex_unlock(&ctx->uring_lock);
8582 8616
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
8583 io_kill_timeouts(ctx, NULL, NULL);8625 io_kill_timeouts(ctx, NULL, NULL);
8584 io_poll_remove_all(ctx, NULL, NULL);8626 io_poll_remove_all(ctx, NULL, NULL);
8585 8627
@@ -8879,7 +8921,7 @@ static void io_sqpoll_cancel_sync(struct io_ring_ctx *ctx) · 293 unmodified lines
8879 if (task) {8921 if (task) {
8880 init_completion(&work.completion);8922 init_completion(&work.completion);
8881 init_task_work(&work.task_work, io_sqpoll_cancel_cb);8923 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);
8883 wake_up_process(task);8925 wake_up_process(task);
8884 }8926 }
8885 io_sq_thread_unpark(sqd);8927 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
170 return ret;170 return ret;
171 }171 }
172 172
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
173 *pagespan = 1 + isi.highest_ppage - isi.lowest_ppage;183 *pagespan = 1 + isi.highest_ppage - isi.lowest_ppage;
174 sis->max = isi.nr_pages;184 sis->max = isi.nr_pages;
175 sis->pages = isi.nr_pages - 1;185 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
1808 1808
1809 if (flags & FL_LAYOUT)1809 if (flags & FL_LAYOUT)
1810 return 0;1810 return 0;
1811 if (flags & FL_DELEG)
1812 /* We leave these checks to the caller. */
1813 return 0;
1814 1811
1815 if (arg == F_RDLCK)1812 if (arg == F_RDLCK)
1816 return inode_is_open_for_write(inode) ? -EAGAIN : 0;1813 return inode_is_open_for_write(inode) ? -EAGAIN : 0;
fs/nfsd/Kconfig+1−0
@@ -73,6 +73,7 @@ config NFSD_V4 · 72 unmodified lines
73 select NFSD_V373 select NFSD_V3
74 select FS_POSIX_ACL74 select FS_POSIX_ACL
75 select SUNRPC_GSS75 select SUNRPC_GSS
76 select CRYPTO
76 select CRYPTO_MD577 select CRYPTO_MD5
77 select CRYPTO_SHA25678 select CRYPTO_SHA256
78 select GRACE_PERIOD79 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
898 continue;898 continue;
899 if (!nfsd_match_cred(nf->nf_cred, current_cred()))899 if (!nfsd_match_cred(nf->nf_cred, current_cred()))
900 continue;900 continue;
901 if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags))
902 continue;
901 if (nfsd_file_get(nf) != NULL)903 if (nfsd_file_get(nf) != NULL)
902 return nf;904 return nf;
903 }905 }
fs/nfsd/nfs4callback.c+1−0
@@ -1189,6 +1189,7 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata) · 1188 unmodified lines
1189 switch (task->tk_status) {1189 switch (task->tk_status) {
1190 case -EIO:1190 case -EIO:
1191 case -ETIMEDOUT:1191 case -ETIMEDOUT:
1192 case -EACCES:
1192 nfsd4_mark_cb_down(clp, task->tk_status);1193 nfsd4_mark_cb_down(clp, task->tk_status);
1193 }1194 }
1194 break;1195 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
1302 struct nfsd_file *dst)1302 struct nfsd_file *dst)
1303{1303{
1304 nfs42_ssc_close(src->nf_file);1304 nfs42_ssc_close(src->nf_file);
1305 /* 'src' is freed by nfsd4_do_async_copy */1305 fput(src->nf_file);
1306 nfsd_file_put(dst);1306 nfsd_file_put(dst);
1307 mntput(ss_mnt);1307 mntput(ss_mnt);
1308}1308}
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
4940 return fl;4940 return fl;
4941}4941}
4942 4942
4943static 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
4968static struct nfs4_delegation *4943static struct nfs4_delegation *
4969nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,4944nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
4970 struct nfs4_file *fp, struct nfs4_clnt_odstate *odstate)4945 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
4984 4959
4985 nf = find_readable_file(fp);4960 nf = find_readable_file(fp);
4986 if (!nf) {4961 if (!nf) {
4987 /*4962 /* We should always have a readable file here */
4988 * We probably could attempt another open and get a read4963 WARN_ON_ONCE(1);
4989 * delegation, but for now, don't bother until the4964 return ERR_PTR(-EBADF);
4990 * client actually sends us one.
4991 */
4992 return ERR_PTR(-EAGAIN);
4993 }4965 }
4994 spin_lock(&state_lock);4966 spin_lock(&state_lock);
4995 spin_lock(&fp->fi_lock);4967 spin_lock(&fp->fi_lock);
@@ -5019,19 +4991,11 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, · 23 unmodified lines
5019 if (!fl)4991 if (!fl)
5020 goto out_clnt_odstate;4992 goto out_clnt_odstate;
5021 4993
5022 status = nfsd4_check_conflicting_opens(clp, fp);
5023 if (status) {
5024 locks_free_lock(fl);
5025 goto out_clnt_odstate;
5026 }
5027 status = vfs_setlease(fp->fi_deleg_file->nf_file, fl->fl_type, &fl, NULL);4994 status = vfs_setlease(fp->fi_deleg_file->nf_file, fl->fl_type, &fl, NULL);
5028 if (fl)4995 if (fl)
5029 locks_free_lock(fl);4996 locks_free_lock(fl);
5030 if (status)4997 if (status)
5031 goto out_clnt_odstate;4998 goto out_clnt_odstate;
5032 status = nfsd4_check_conflicting_opens(clp, fp);
5033 if (status)
5034 goto out_clnt_odstate;
5035 4999
5036 spin_lock(&state_lock);5000 spin_lock(&state_lock);
5037 spin_lock(&fp->fi_lock);5001 spin_lock(&fp->fi_lock);
@@ -5113,6 +5077,17 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, · 75 unmodified lines
5113 goto out_no_deleg;5077 goto out_no_deleg;
5114 if (!cb_up || !(oo->oo_flags & NFS4_OO_CONFIRMED))5078 if (!cb_up || !(oo->oo_flags & NFS4_OO_CONFIRMED))
5115 goto out_no_deleg;5079 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;
5116 break;5091 break;
5117 default:5092 default:
5118 goto out_no_deleg;5093 goto out_no_deleg;
@@ -5389,7 +5364,7 @@ nfs4_laundromat(struct nfsd_net *nn) · 270 unmodified lines
5389 idr_for_each_entry(&nn->s2s_cp_stateids, cps_t, i) {5364 idr_for_each_entry(&nn->s2s_cp_stateids, cps_t, i) {
5390 cps = container_of(cps_t, struct nfs4_cpntf_state, cp_stateid);5365 cps = container_of(cps_t, struct nfs4_cpntf_state, cp_stateid);
5391 if (cps->cp_stateid.sc_type == NFS4_COPYNOTIFY_STID &&5366 if (cps->cp_stateid.sc_type == NFS4_COPYNOTIFY_STID &&
5392 cps->cpntf_time > cutoff)5367 cps->cpntf_time < cutoff)
5393 _free_cpntf_state_locked(nn, cps);5368 _free_cpntf_state_locked(nn, cps);
5394 }5369 }
5395 spin_unlock(&nn->s2s_cp_lock);5370 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
1055 1055
1056 ret = do_sys_poll(ufds, nfds, to);1056 ret = do_sys_poll(ufds, nfds, to);
1057 1057
1058 if (ret == -ERESTARTNOHAND) {1058 if (ret == -ERESTARTNOHAND)
1059 restart_block->fn = do_restart_poll;1059 ret = set_restart_fn(restart_block, do_restart_poll);
1060 ret = -ERESTART_RESTARTBLOCK;1060
1061 }
1062 return ret;1061 return ret;
1063}1062}
1064 1063
@@ -1080,7 +1079,6 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, · 15 unmodified lines
1080 struct restart_block *restart_block;1079 struct restart_block *restart_block;
1081 1080
1082 restart_block = &current->restart_block;1081 restart_block = &current->restart_block;
1083 restart_block->fn = do_restart_poll;
1084 restart_block->poll.ufds = ufds;1082 restart_block->poll.ufds = ufds;
1085 restart_block->poll.nfds = nfds;1083 restart_block->poll.nfds = nfds;
1086 1084
@@ -1091,7 +1089,7 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, · 4 unmodified lines
1091 } else1089 } else
1092 restart_block->poll.has_timeout = 0;1090 restart_block->poll.has_timeout = 0;
1093 1091
1094 ret = -ERESTART_RESTARTBLOCK;1092 ret = set_restart_fn(restart_block, do_restart_poll);
1095 }1093 }
1096 return ret;1094 return ret;
1097}1095}
fs/xfs/xfs_inode.c+8−6
@@ -1007,9 +1007,10 @@ xfs_create( · 1006 unmodified lines
1007 /*1007 /*
1008 * Make sure that we have allocated dquot(s) on disk.1008 * Make sure that we have allocated dquot(s) on disk.
1009 */1009 */
1010 error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid,1010 error = xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns),
1011 XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,1011 fsgid_into_mnt(mnt_userns), prid,
1012 &udqp, &gdqp, &pdqp);1012 XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
1013 &udqp, &gdqp, &pdqp);
1013 if (error)1014 if (error)
1014 return error;1015 return error;
1015 1016
@@ -1157,9 +1158,10 @@ xfs_create_tmpfile( · 141 unmodified lines
1157 /*1158 /*
1158 * Make sure that we have allocated dquot(s) on disk.1159 * Make sure that we have allocated dquot(s) on disk.
1159 */1160 */
1160 error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid,1161 error = xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns),
1161 XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,1162 fsgid_into_mnt(mnt_userns), prid,
1162 &udqp, &gdqp, &pdqp);1163 XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
1164 &udqp, &gdqp, &pdqp);
1163 if (error)1165 if (error)
1164 return error;1166 return error;
1165 1167
fs/xfs/xfs_itable.c+6−0
@@ -168,6 +168,12 @@ xfs_bulkstat_one( · 167 unmodified lines
168 };168 };
169 int error;169 int error;
170 170
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
171 ASSERT(breq->icount == 1);177 ASSERT(breq->icount == 1);
172 178
173 bc.buf = kmem_zalloc(sizeof(struct xfs_bulkstat),179 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
634 return xfs_initialize_perag_data(mp, mp->m_sb.sb_agcount);634 return xfs_initialize_perag_data(mp, mp->m_sb.sb_agcount);
635}635}
636 636
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 */
662static void
663xfs_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
637/*678/*
638 * This function does the following on an initial mount of a file system:679 * This function does the following on an initial mount of a file system:
639 * - reads the superblock from disk and init the mount struct680 * - reads the superblock from disk and init the mount struct
@@ -1008,7 +1049,7 @@ xfs_mountfs( · 368 unmodified lines
1008 /* Clean out dquots that might be in memory after quotacheck. */1049 /* Clean out dquots that might be in memory after quotacheck. */
1009 xfs_qm_unmount(mp);1050 xfs_qm_unmount(mp);
1010 /*1051 /*
1011 * Cancel all delayed reclaim work and reclaim the inodes directly.1052 * Flush all inode reclamation work and flush the log.
1012 * We have to do this /after/ rtunmount and qm_unmount because those1053 * We have to do this /after/ rtunmount and qm_unmount because those
1013 * two will have scheduled delayed reclaim for the rt/quota inodes.1054 * two will have scheduled delayed reclaim for the rt/quota inodes.
1014 *1055 *
@@ -1018,11 +1059,8 @@ xfs_mountfs( · 3 unmodified lines
1018 * qm_unmount_quotas and therefore rely on qm_unmount to release the1059 * qm_unmount_quotas and therefore rely on qm_unmount to release the
1019 * quota inodes.1060 * quota inodes.
1020 */1061 */
1021 cancel_delayed_work_sync(&mp->m_reclaim_work);1062 xfs_unmount_flush_inodes(mp);
1022 xfs_reclaim_inodes(mp);
1023 xfs_health_unmount(mp);
1024 out_log_dealloc:1063 out_log_dealloc:
1025 mp->m_flags |= XFS_MOUNT_UNMOUNTING;
1026 xfs_log_mount_cancel(mp);1064 xfs_log_mount_cancel(mp);
1027 out_fail_wait:1065 out_fail_wait:
1028 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp)1066 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp)
@@ -1063,47 +1101,7 @@ xfs_unmountfs( · 34 unmodified lines
1063 xfs_rtunmount_inodes(mp);1101 xfs_rtunmount_inodes(mp);
1064 xfs_irele(mp->m_rootip);1102 xfs_irele(mp->m_rootip);
1065 1103
1066 /*1104 xfs_unmount_flush_inodes(mp);
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);
1107 1105
1108 xfs_qm_unmount(mp);1106 xfs_qm_unmount(mp);
1109 1107
fs/xfs/xfs_symlink.c+2−1
@@ -182,7 +182,8 @@ xfs_symlink( · 181 unmodified lines
182 /*182 /*
183 * Make sure that we have allocated dquot(s) on disk.183 * Make sure that we have allocated dquot(s) on disk.
184 */184 */
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,
186 XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,187 XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
187 &udqp, &gdqp, &pdqp);188 &udqp, &gdqp, &pdqp);
188 if (error)189 if (error)
fs/zonefs/super.c+87−14
@@ -165,6 +165,21 @@ static int zonefs_writepages(struct address_space *mapping, · 164 unmodified lines
165 return iomap_writepages(mapping, wbc, &wpc, &zonefs_writeback_ops);165 return iomap_writepages(mapping, wbc, &wpc, &zonefs_writeback_ops);
166}166}
167 167
168static 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
168static const struct address_space_operations zonefs_file_aops = {183static const struct address_space_operations zonefs_file_aops = {
169 .readpage = zonefs_readpage,184 .readpage = zonefs_readpage,
170 .readahead = zonefs_readahead,185 .readahead = zonefs_readahead,
@@ -177,6 +192,7 @@ static const struct address_space_operations zonefs_file_aops = { · 6 unmodified lines
177 .is_partially_uptodate = iomap_is_partially_uptodate,192 .is_partially_uptodate = iomap_is_partially_uptodate,
178 .error_remove_page = generic_error_remove_page,193 .error_remove_page = generic_error_remove_page,
179 .direct_IO = noop_direct_IO,194 .direct_IO = noop_direct_IO,
195 .swap_activate = zonefs_swap_activate,
180};196};
181 197
182static void zonefs_update_stats(struct inode *inode, loff_t new_isize)198static void zonefs_update_stats(struct inode *inode, loff_t new_isize)
@@ -727,6 +743,68 @@ out_release: · 544 unmodified lines
727 return ret;743 return ret;
728}744}
729 745
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 */
750static 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
775static 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
730/*808/*
731 * Handle direct writes. For sequential zone files, this is the only possible809 * Handle direct writes. For sequential zone files, this is the only possible
732 * write path. For these files, check that the user is issuing writes810 * 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
744 struct super_block *sb = inode->i_sb;822 struct super_block *sb = inode->i_sb;
745 bool sync = is_sync_kiocb(iocb);823 bool sync = is_sync_kiocb(iocb);
746 bool append = false;824 bool append = false;
747 size_t count;825 ssize_t ret, count;
748 ssize_t ret;
749 826
750 /*827 /*
751 * For async direct IOs to sequential zone files, refuse IOCB_NOWAIT828 * 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
763 inode_lock(inode);840 inode_lock(inode);
764 }841 }
765 842
766 ret = generic_write_checks(iocb, from);843 count = zonefs_write_checks(iocb, from);
767 if (ret <= 0)844 if (count <= 0) {
845 ret = count;
768 goto inode_unlock;846 goto inode_unlock;
769 847 }
770 iov_iter_truncate(from, zi->i_max_size - iocb->ki_pos);
771 count = iov_iter_count(from);
772 848
773 if ((iocb->ki_pos | count) & (sb->s_blocksize - 1)) {849 if ((iocb->ki_pos | count) & (sb->s_blocksize - 1)) {
774 ret = -EINVAL;850 ret = -EINVAL;
@@ -828,12 +904,10 @@ static ssize_t zonefs_file_buffered_write(struct kiocb *iocb, · 53 unmodified lines
828 inode_lock(inode);904 inode_lock(inode);
829 }905 }
830 906
831 ret = generic_write_checks(iocb, from);907 ret = zonefs_write_checks(iocb, from);
832 if (ret <= 0)908 if (ret <= 0)
833 goto inode_unlock;909 goto inode_unlock;
834 910
835 iov_iter_truncate(from, zi->i_max_size - iocb->ki_pos);
836
837 ret = iomap_file_buffered_write(iocb, from, &zonefs_iomap_ops);911 ret = iomap_file_buffered_write(iocb, from, &zonefs_iomap_ops);
838 if (ret > 0)912 if (ret > 0)
839 iocb->ki_pos += ret;913 iocb->ki_pos += ret;
@@ -966,9 +1040,7 @@ static int zonefs_open_zone(struct inode *inode) · 126 unmodified lines
966 1040
967 mutex_lock(&zi->i_truncate_mutex);1041 mutex_lock(&zi->i_truncate_mutex);
968 1042
969 zi->i_wr_refcnt++;1043 if (!zi->i_wr_refcnt) {
970 if (zi->i_wr_refcnt == 1) {
971
972 if (atomic_inc_return(&sbi->s_open_zones) > sbi->s_max_open_zones) {1044 if (atomic_inc_return(&sbi->s_open_zones) > sbi->s_max_open_zones) {
973 atomic_dec(&sbi->s_open_zones);1045 atomic_dec(&sbi->s_open_zones);
974 ret = -EBUSY;1046 ret = -EBUSY;
@@ -978,7 +1050,6 @@ static int zonefs_open_zone(struct inode *inode) · 3 unmodified lines
978 if (i_size_read(inode) < zi->i_max_size) {1050 if (i_size_read(inode) < zi->i_max_size) {
979 ret = zonefs_zone_mgmt(inode, REQ_OP_ZONE_OPEN);1051 ret = zonefs_zone_mgmt(inode, REQ_OP_ZONE_OPEN);
980 if (ret) {1052 if (ret) {
981 zi->i_wr_refcnt--;
982 atomic_dec(&sbi->s_open_zones);1053 atomic_dec(&sbi->s_open_zones);
983 goto unlock;1054 goto unlock;
984 }1055 }
@@ -986,6 +1057,8 @@ static int zonefs_open_zone(struct inode *inode) · 1 unmodified line
986 }1057 }
987 }1058 }
988 1059
1060 zi->i_wr_refcnt++;
1061
989unlock:1062unlock:
990 mutex_unlock(&zi->i_truncate_mutex);1063 mutex_unlock(&zi->i_truncate_mutex);
991 1064
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
612static inline void ttm_bo_unpin(struct ttm_buffer_object *bo)612static inline void ttm_bo_unpin(struct ttm_buffer_object *bo)
613{613{
614 dma_resv_assert_held(bo->base.resv);614 dma_resv_assert_held(bo->base.resv);
615 WARN_ON_ONCE(!bo->pin_count);
616 WARN_ON_ONCE(!kref_read(&bo->kref));615 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);
618}620}
619 621
620int ttm_mem_evict_first(struct ttm_bo_device *bdev,622int 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
105#define amba_get_drvdata(d) dev_get_drvdata(&d->dev)105#define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
106#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)106#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
107 107
108#ifdef CONFIG_ARM_AMBA
108int amba_driver_register(struct amba_driver *);109int amba_driver_register(struct amba_driver *);
109void amba_driver_unregister(struct amba_driver *);110void amba_driver_unregister(struct amba_driver *);
111#else
112static inline int amba_driver_register(struct amba_driver *drv)
113{
114 return -EINVAL;
115}
116static inline void amba_driver_unregister(struct amba_driver *drv)
117{
118}
119#endif
120
110struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t);121struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t);
111void amba_device_put(struct amba_device *);122void amba_device_put(struct amba_device *);
112int amba_device_add(struct amba_device *, struct resource *);123int 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
72 */72 */
73typedef guid_t efi_guid_t __aligned(__alignof__(u32));73typedef guid_t efi_guid_t __aligned(__alignof__(u32));
74 74
75#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \75#define EFI_GUID(a, b, c, d...) (efi_guid_t){ { \
76 GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)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 } }
77 79
78/*80/*
79 * Generic EFI table header81 * Generic EFI table header
include/linux/io_uring.h+0−25
@@ -5,31 +5,6 @@ · 4 unmodified lines
5#include <linux/sched.h>5#include <linux/sched.h>
6#include <linux/xarray.h>6#include <linux/xarray.h>
7 7
8struct io_wq_work_node {
9 struct io_wq_work_node *next;
10};
11
12struct io_wq_work_list {
13 struct io_wq_work_node *first;
14 struct io_wq_work_node *last;
15};
16
17struct 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
33#if defined(CONFIG_IO_URING)8#if defined(CONFIG_IO_URING)
34struct sock *io_uring_get_socket(struct file *file);9struct sock *io_uring_get_socket(struct file *file);
35void __io_uring_task_cancel(void);10void __io_uring_task_cancel(void);
include/linux/module.h+0−3
@@ -30,9 +30,6 @@ · 29 unmodified lines
30#include <linux/percpu.h>30#include <linux/percpu.h>
31#include <asm/module.h>31#include <asm/module.h>
32 32
33/* Not Yet Implemented */
34#define MODULE_SUPPORTED_DEVICE(name)
35
36#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN33#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
37 34
38struct modversion_info {35struct modversion_info {
include/linux/restart_block.h+1−0
@@ -23,6 +23,7 @@ enum timespec_type { · 22 unmodified lines
23 * System call restart block.23 * System call restart block.
24 */24 */
25struct restart_block {25struct restart_block {
26 unsigned long arch_data;
26 long (*fn)(struct restart_block *);27 long (*fn)(struct restart_block *);
27 union {28 union {
28 /* For futex_wait and futex_wait_requeue_pi */29 /* 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
104 104
105 wait_queue_head_t sc_send_wait; /* SQ exhaustion waitlist */105 wait_queue_head_t sc_send_wait; /* SQ exhaustion waitlist */
106 unsigned long sc_flags;106 unsigned long sc_flags;
107 u32 sc_pending_recvs;
108 struct list_head sc_read_complete_q;107 struct list_head sc_read_complete_q;
109 struct work_struct sc_work;108 struct work_struct sc_work;
110 109
include/linux/thread_info.h+13−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
11#include <linux/types.h>11#include <linux/types.h>
12#include <linux/bug.h>12#include <linux/bug.h>
13#include <linux/restart_block.h>13#include <linux/restart_block.h>
14#include <linux/errno.h>
14 15
15#ifdef CONFIG_THREAD_INFO_IN_TASK16#ifdef CONFIG_THREAD_INFO_IN_TASK
16/*17/*
@@ -59,6 +60,18 @@ enum syscall_work_bit { · 42 unmodified lines
59 60
60#ifdef __KERNEL__61#ifdef __KERNEL__
61 62
63#ifndef arch_set_restart_data
64#define arch_set_restart_data(restart) do { } while (0)
65#endif
66
67static 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
62#ifndef THREAD_ALIGN75#ifndef THREAD_ALIGN
63#define THREAD_ALIGN THREAD_SIZE76#define THREAD_ALIGN THREAD_SIZE
64#endif77#endif
include/linux/usb_usual.h+2−0
@@ -86,6 +86,8 @@ · 85 unmodified lines
86 /* lies about caching, so always sync */ \86 /* lies about caching, so always sync */ \
87 US_FLAG(NO_SAME, 0x40000000) \87 US_FLAG(NO_SAME, 0x40000000) \
88 /* Cannot handle WRITE_SAME */ \88 /* Cannot handle WRITE_SAME */ \
89 US_FLAG(SENSE_AFTER_SYNC, 0x80000000) \
90 /* Do REQUEST_SENSE after SYNCHRONIZE_CACHE */ \
89 91
90#define US_FLAG(name, value) US_FL_##name = value ,92#define US_FLAG(name, value) US_FL_##name = value ,
91enum { US_DO_ALL_FLAGS };93enum { US_DO_ALL_FLAGS };
include/linux/vdpa.h+5−5
@@ -250,20 +250,20 @@ struct vdpa_config_ops { · 249 unmodified lines
250 250
251struct vdpa_device *__vdpa_alloc_device(struct device *parent,251struct vdpa_device *__vdpa_alloc_device(struct device *parent,
252 const struct vdpa_config_ops *config,252 const struct vdpa_config_ops *config,
253 int nvqs, size_t size, const char *name);253 size_t size, const char *name);
254 254
255#define vdpa_alloc_device(dev_struct, member, parent, config, nvqs, name) \255#define vdpa_alloc_device(dev_struct, member, parent, config, name) \
256 container_of(__vdpa_alloc_device( \256 container_of(__vdpa_alloc_device( \
257 parent, config, nvqs, \257 parent, config, \
258 sizeof(dev_struct) + \258 sizeof(dev_struct) + \
259 BUILD_BUG_ON_ZERO(offsetof( \259 BUILD_BUG_ON_ZERO(offsetof( \
260 dev_struct, member)), name), \260 dev_struct, member)), name), \
261 dev_struct, member)261 dev_struct, member)
262 262
263int vdpa_register_device(struct vdpa_device *vdev);263int vdpa_register_device(struct vdpa_device *vdev, int nvqs);
264void vdpa_unregister_device(struct vdpa_device *vdev);264void vdpa_unregister_device(struct vdpa_device *vdev);
265 265
266int _vdpa_register_device(struct vdpa_device *vdev);266int _vdpa_register_device(struct vdpa_device *vdev, int nvqs);
267void _vdpa_unregister_device(struct vdpa_device *vdev);267void _vdpa_unregister_device(struct vdpa_device *vdev);
268 268
269/**269/**
include/linux/virtio.h+0−2
@@ -132,8 +132,6 @@ bool is_virtio_device(struct device *dev); · 131 unmodified lines
132void virtio_break_device(struct virtio_device *dev);132void virtio_break_device(struct virtio_device *dev);
133 133
134void virtio_config_changed(struct virtio_device *dev);134void virtio_config_changed(struct virtio_device *dev);
135void virtio_config_disable(struct virtio_device *dev);
136void virtio_config_enable(struct virtio_device *dev);
137int virtio_finalize_features(struct virtio_device *dev);135int virtio_finalize_features(struct virtio_device *dev);
138#ifdef CONFIG_PM_SLEEP136#ifdef CONFIG_PM_SLEEP
139int virtio_device_freeze(struct virtio_device *dev);137int 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
173 */173 */
174static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)174static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)
175{175{
176#ifdef CONFIG_DEBUG_MUTEXES176#ifdef CONFIG_DEBUG_LOCK_ALLOC
177 mutex_release(&ctx->dep_map, _THIS_IP_);177 mutex_release(&ctx->dep_map, _THIS_IP_);
178 178#endif
179#ifdef CONFIG_DEBUG_MUTEXES
179 DEBUG_LOCKS_WARN_ON(ctx->acquired);180 DEBUG_LOCKS_WARN_ON(ctx->acquired);
180 if (!IS_ENABLED(CONFIG_PROVE_LOCKING))181 if (!IS_ENABLED(CONFIG_PROVE_LOCKING))
181 /*182 /*
include/trace/events/workqueue.h+3−3
@@ -30,7 +30,7 @@ TRACE_EVENT(workqueue_queue_work, · 29 unmodified lines
30 TP_STRUCT__entry(30 TP_STRUCT__entry(
31 __field( void *, work )31 __field( void *, work )
32 __field( void *, function)32 __field( void *, function)
33 __field( const char *, workqueue)33 __string( workqueue, pwq->wq->name)
34 __field( unsigned int, req_cpu )34 __field( unsigned int, req_cpu )
35 __field( unsigned int, cpu )35 __field( unsigned int, cpu )
36 ),36 ),
@@ -38,13 +38,13 @@ TRACE_EVENT(workqueue_queue_work, · 1 unmodified line
38 TP_fast_assign(38 TP_fast_assign(
39 __entry->work = work;39 __entry->work = work;
40 __entry->function = work->func;40 __entry->function = work->func;
41 __entry->workqueue = pwq->wq->name;41 __assign_str(workqueue, pwq->wq->name);
42 __entry->req_cpu = req_cpu;42 __entry->req_cpu = req_cpu;
43 __entry->cpu = pwq->pool->cpu;43 __entry->cpu = pwq->pool->cpu;
44 ),44 ),
45 45
46 TP_printk("work struct=%p function=%ps workqueue=%s req_cpu=%u cpu=%u",46 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),
48 __entry->req_cpu, __entry->cpu)48 __entry->req_cpu, __entry->cpu)
49);49);
50 50
include/uapi/linux/fuse.h+2−1
@@ -903,7 +903,8 @@ struct fuse_notify_retrieve_in { · 902 unmodified lines
903};903};
904 904
905/* Device ioctls: */905/* 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)
907 908
908struct fuse_lseek_in {909struct fuse_lseek_in {
909 uint64_t fh;910 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
2444 if (!IS_ERR(tsk)) {2444 if (!IS_ERR(tsk)) {
2445 sigfillset(&tsk->blocked);2445 sigfillset(&tsk->blocked);
2446 sigdelsetmask(&tsk->blocked, sigmask(SIGKILL));2446 sigdelsetmask(&tsk->blocked, sigmask(SIGKILL));
2447 tsk->flags |= PF_NOFREEZE;
2448 }2447 }
2449 return tsk;2448 return tsk;
2450}2449}
kernel/freezer.c+1−1
@@ -134,7 +134,7 @@ bool freeze_task(struct task_struct *p) · 133 unmodified lines
134 return false;134 return false;
135 }135 }
136 136
137 if (!(p->flags & PF_KTHREAD))137 if (!(p->flags & (PF_KTHREAD | PF_IO_WORKER)))
138 fake_signal_wake_up(p);138 fake_signal_wake_up(p);
139 else139 else
140 wake_up_state(p, TASK_INTERRUPTIBLE);140 wake_up_state(p, TASK_INTERRUPTIBLE);
kernel/futex.c+1−2
@@ -2728,14 +2728,13 @@ retry: · 2727 unmodified lines
2728 goto out;2728 goto out;
2729 2729
2730 restart = &current->restart_block;2730 restart = &current->restart_block;
2731 restart->fn = futex_wait_restart;
2732 restart->futex.uaddr = uaddr;2731 restart->futex.uaddr = uaddr;
2733 restart->futex.val = val;2732 restart->futex.val = val;
2734 restart->futex.time = *abs_time;2733 restart->futex.time = *abs_time;
2735 restart->futex.bitset = bitset;2734 restart->futex.bitset = bitset;
2736 restart->futex.flags = flags | FLAGS_HAS_TIMEOUT;2735 restart->futex.flags = flags | FLAGS_HAS_TIMEOUT;
2737 2736
2738 ret = -ERESTART_RESTARTBLOCK;2737 ret = set_restart_fn(restart, futex_wait_restart);
2739 2738
2740out:2739out:
2741 if (to) {2740 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
159 * irq_domain_create_sim - Create a new interrupt simulator irq_domain and159 * irq_domain_create_sim - Create a new interrupt simulator irq_domain and
160 * allocate a range of dummy interrupts.160 * allocate a range of dummy interrupts.
161 *161 *
162 * @fnode: struct fwnode_handle to be associated with this domain.162 * @fwnode: struct fwnode_handle to be associated with this domain.
163 * @num_irqs: Number of interrupts to allocate.163 * @num_irqs: Number of interrupts to allocate.
164 *164 *
165 * On success: return a new irq_domain object.165 * 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
228 * a managed device.228 * a managed device.
229 *229 *
230 * @dev: Device to initialize the simulator object for.230 * @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.
232 * @num_irqs: Number of interrupts to allocate232 * @num_irqs: Number of interrupts to allocate
233 *233 *
234 * On success: return a new irq_domain object.234 * 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
1142 irqreturn_t ret;1142 irqreturn_t ret;
1143 1143
1144 local_bh_disable();1144 local_bh_disable();
1145 if (!IS_ENABLED(CONFIG_PREEMPT_RT))
1146 local_irq_disable();
1145 ret = action->thread_fn(action->irq, action->dev_id);1147 ret = action->thread_fn(action->irq, action->dev_id);
1146 if (ret == IRQ_HANDLED)1148 if (ret == IRQ_HANDLED)
1147 atomic_inc(&desc->threads_handled);1149 atomic_inc(&desc->threads_handled);
1148 1150
1149 irq_finalize_oneshot(desc, action);1151 irq_finalize_oneshot(desc, action);
1152 if (!IS_ENABLED(CONFIG_PREEMPT_RT))
1153 local_irq_enable();
1150 local_bh_enable();1154 local_bh_enable();
1151 return ret;1155 return ret;
1152}1156}
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
407 return false;407 return false;
408 408
409 if (!kernel_text_address(jump_entry_code(entry))) {409 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 */
410 WARN_ONCE(!jump_entry_is_init(entry),418 WARN_ONCE(!jump_entry_is_init(entry),
411 "can't patch jump_label at %pS",419 "can't patch jump_label at %pS",
412 (void *)jump_entry_code(entry));420 (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
626 */626 */
627static __always_inline bool627static __always_inline bool
628mutex_optimistic_spin(struct mutex *lock, struct ww_acquire_ctx *ww_ctx,628mutex_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)
630{630{
631 if (!waiter) {631 if (!waiter) {
632 /*632 /*
@@ -702,7 +702,7 @@ fail: · 69 unmodified lines
702#else702#else
703static __always_inline bool703static __always_inline bool
704mutex_optimistic_spin(struct mutex *lock, struct ww_acquire_ctx *ww_ctx,704mutex_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)
706{706{
707 return false;707 return false;
708}708}
@@ -922,6 +922,9 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 213 unmodified lines
922 struct ww_mutex *ww;922 struct ww_mutex *ww;
923 int ret;923 int ret;
924 924
925 if (!use_ww_ctx)
926 ww_ctx = NULL;
927
925 might_sleep();928 might_sleep();
926 929
927#ifdef CONFIG_DEBUG_MUTEXES930#ifdef CONFIG_DEBUG_MUTEXES
@@ -929,7 +932,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 1 unmodified line
929#endif932#endif
930 933
931 ww = container_of(lock, struct ww_mutex, base);934 ww = container_of(lock, struct ww_mutex, base);
932 if (use_ww_ctx && ww_ctx) {935 if (ww_ctx) {
933 if (unlikely(ww_ctx == READ_ONCE(ww->ctx)))936 if (unlikely(ww_ctx == READ_ONCE(ww->ctx)))
934 return -EALREADY;937 return -EALREADY;
935 938
@@ -946,10 +949,10 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 10 unmodified lines
946 mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, ip);949 mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, ip);
947 950
948 if (__mutex_trylock(lock) ||951 if (__mutex_trylock(lock) ||
949 mutex_optimistic_spin(lock, ww_ctx, use_ww_ctx, NULL)) {952 mutex_optimistic_spin(lock, ww_ctx, NULL)) {
950 /* got the lock, yay! */953 /* got the lock, yay! */
951 lock_acquired(&lock->dep_map, ip);954 lock_acquired(&lock->dep_map, ip);
952 if (use_ww_ctx && ww_ctx)955 if (ww_ctx)
953 ww_mutex_set_context_fastpath(ww, ww_ctx);956 ww_mutex_set_context_fastpath(ww, ww_ctx);
954 preempt_enable();957 preempt_enable();
955 return 0;958 return 0;
@@ -960,7 +963,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 4 unmodified lines
960 * After waiting to acquire the wait_lock, try again.963 * After waiting to acquire the wait_lock, try again.
961 */964 */
962 if (__mutex_trylock(lock)) {965 if (__mutex_trylock(lock)) {
963 if (use_ww_ctx && ww_ctx)966 if (ww_ctx)
964 __ww_mutex_check_waiters(lock, ww_ctx);967 __ww_mutex_check_waiters(lock, ww_ctx);
965 968
966 goto skip_wait;969 goto skip_wait;
@@ -1013,7 +1016,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 46 unmodified lines
1013 goto err;1016 goto err;
1014 }1017 }
1015 1018
1016 if (use_ww_ctx && ww_ctx) {1019 if (ww_ctx) {
1017 ret = __ww_mutex_check_kill(lock, &waiter, ww_ctx);1020 ret = __ww_mutex_check_kill(lock, &waiter, ww_ctx);
1018 if (ret)1021 if (ret)
1019 goto err;1022 goto err;
@@ -1026,7 +1029,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 6 unmodified lines
1026 * ww_mutex needs to always recheck its position since its waiter1029 * ww_mutex needs to always recheck its position since its waiter
1027 * list is not FIFO ordered.1030 * list is not FIFO ordered.
1028 */1031 */
1029 if ((use_ww_ctx && ww_ctx) || !first) {1032 if (ww_ctx || !first) {
1030 first = __mutex_waiter_is_first(lock, &waiter);1033 first = __mutex_waiter_is_first(lock, &waiter);
1031 if (first)1034 if (first)
1032 __mutex_set_flag(lock, MUTEX_FLAG_HANDOFF);1035 __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
1039 * or we must see its unlock and acquire.1042 * or we must see its unlock and acquire.
1040 */1043 */
1041 if (__mutex_trylock(lock) ||1044 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)))
1043 break;1046 break;
1044 1047
1045 spin_lock(&lock->wait_lock);1048 spin_lock(&lock->wait_lock);
@@ -1048,7 +1051,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 2 unmodified lines
1048acquired:1051acquired:
1049 __set_current_state(TASK_RUNNING);1052 __set_current_state(TASK_RUNNING);
1050 1053
1051 if (use_ww_ctx && ww_ctx) {1054 if (ww_ctx) {
1052 /*1055 /*
1053 * Wound-Wait; we stole the lock (!first_waiter), check the1056 * Wound-Wait; we stole the lock (!first_waiter), check the
1054 * waiters as anyone might want to wound us.1057 * waiters as anyone might want to wound us.
@@ -1068,7 +1071,7 @@ skip_wait: · 13 unmodified lines
1068 /* got the lock - cleanup and rejoice! */1071 /* got the lock - cleanup and rejoice! */
1069 lock_acquired(&lock->dep_map, ip);1072 lock_acquired(&lock->dep_map, ip);
1070 1073
1071 if (use_ww_ctx && ww_ctx)1074 if (ww_ctx)
1072 ww_mutex_lock_acquired(ww, ww_ctx);1075 ww_mutex_lock_acquired(ww, ww_ctx);
1073 1076
1074 spin_unlock(&lock->wait_lock);1077 spin_unlock(&lock->wait_lock);
kernel/reboot.c+0−2
@@ -244,8 +244,6 @@ void migrate_to_reboot_cpu(void) · 243 unmodified lines
244void kernel_restart(char *cmd)244void kernel_restart(char *cmd)
245{245{
246 kernel_restart_prepare(cmd);246 kernel_restart_prepare(cmd);
247 if (pm_power_off_prepare)
248 pm_power_off_prepare();
249 migrate_to_reboot_cpu();247 migrate_to_reboot_cpu();
250 syscore_shutdown();248 syscore_shutdown();
251 if (!cmd)249 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
288 JOBCTL_STOP_SIGMASK | JOBCTL_TRAPPING));288 JOBCTL_STOP_SIGMASK | JOBCTL_TRAPPING));
289 BUG_ON((mask & JOBCTL_TRAPPING) && !(mask & JOBCTL_PENDING_MASK));289 BUG_ON((mask & JOBCTL_TRAPPING) && !(mask & JOBCTL_PENDING_MASK));
290 290
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))))
292 return false;293 return false;
293 294
294 if (mask & JOBCTL_STOP_SIGMASK)295 if (mask & JOBCTL_STOP_SIGMASK)
@@ -833,6 +834,9 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info, · 538 unmodified lines
833 834
834 if (!valid_signal(sig))835 if (!valid_signal(sig))
835 return -EINVAL;836 return -EINVAL;
837 /* PF_IO_WORKER threads don't take any signals */
838 if (t->flags & PF_IO_WORKER)
839 return -ESRCH;
836 840
837 if (!si_fromuser(info))841 if (!si_fromuser(info))
838 return 0;842 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
35 return (void *)((long)site->addr + (long)&site->addr);35 return (void *)((long)site->addr + (long)&site->addr);
36}36}
37 37
38static inline unsigned long __static_call_key(const struct static_call_site *site)
39{
40 return (long)site->key + (long)&site->key;
41}
38 42
39static inline struct static_call_key *static_call_key(const struct static_call_site *site)43static inline struct static_call_key *static_call_key(const struct static_call_site *site)
40{44{
41 return (struct static_call_key *)45 return (void *)(__static_call_key(site) & ~STATIC_CALL_SITE_FLAGS);
42 (((long)site->key + (long)&site->key) & ~STATIC_CALL_SITE_FLAGS);
43}46}
44 47
45/* These assume the key is word-aligned. */48/* These assume the key is word-aligned. */
46static inline bool static_call_is_init(struct static_call_site *site)49static inline bool static_call_is_init(struct static_call_site *site)
47{50{
48 return ((long)site->key + (long)&site->key) & STATIC_CALL_SITE_INIT;51 return __static_call_key(site) & STATIC_CALL_SITE_INIT;
49}52}
50 53
51static inline bool static_call_is_tail(struct static_call_site *site)54static inline bool static_call_is_tail(struct static_call_site *site)
52{55{
53 return ((long)site->key + (long)&site->key) & STATIC_CALL_SITE_TAIL;56 return __static_call_key(site) & STATIC_CALL_SITE_TAIL;
54}57}
55 58
56static inline void static_call_set_init(struct static_call_site *site)59static inline void static_call_set_init(struct static_call_site *site)
57{60{
58 site->key = ((long)static_call_key(site) | STATIC_CALL_SITE_INIT) -61 site->key = (__static_call_key(site) | STATIC_CALL_SITE_INIT) -
59 (long)&site->key;62 (long)&site->key;
60}63}
61 64
@@ -146,6 +149,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) · 84 unmodified lines
146 };149 };
147 150
148 for (site_mod = &first; site_mod; site_mod = site_mod->next) {151 for (site_mod = &first; site_mod; site_mod = site_mod->next) {
152 bool init = system_state < SYSTEM_RUNNING;
149 struct module *mod = site_mod->mod;153 struct module *mod = site_mod->mod;
150 154
151 if (!site_mod->sites) {155 if (!site_mod->sites) {
@@ -165,6 +169,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) · 13 unmodified lines
165 if (mod) {169 if (mod) {
166 stop = mod->static_call_sites +170 stop = mod->static_call_sites +
167 mod->num_static_call_sites;171 mod->num_static_call_sites;
172 init = mod->state == MODULE_STATE_COMING;
168 }173 }
169#endif174#endif
170 175
@@ -172,25 +177,26 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) · 1 unmodified line
172 site < stop && static_call_key(site) == key; site++) {177 site < stop && static_call_key(site) == key; site++) {
173 void *site_addr = static_call_addr(site);178 void *site_addr = static_call_addr(site);
174 179
175 if (static_call_is_init(site)) {180 if (!init && static_call_is_init(site))
176 /*181 continue;
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 }
185 182
186 if (!kernel_text_address((unsigned long)site_addr)) {183 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",
188 site_addr);194 site_addr);
189 continue;195 continue;
190 }196 }
191 197
192 arch_static_call_transform(site_addr, NULL, func,198 arch_static_call_transform(site_addr, NULL, func,
193 static_call_is_tail(site));199 static_call_is_tail(site));
194 }200 }
195 }201 }
196 202
@@ -349,7 +355,7 @@ static int static_call_add_module(struct module *mod) · 152 unmodified lines
349 struct static_call_site *site;355 struct static_call_site *site;
350 356
351 for (site = start; site != stop; site++) {357 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);
353 unsigned long addr = s_key & ~STATIC_CALL_SITE_FLAGS;359 unsigned long addr = s_key & ~STATIC_CALL_SITE_FLAGS;
354 unsigned long key;360 unsigned long key;
355 361
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
854 if (flags == TIMER_ABSTIME)854 if (flags == TIMER_ABSTIME)
855 return -ERESTARTNOHAND;855 return -ERESTARTNOHAND;
856 856
857 restart->fn = alarm_timer_nsleep_restart;
858 restart->nanosleep.clockid = type;857 restart->nanosleep.clockid = type;
859 restart->nanosleep.expires = exp;858 restart->nanosleep.expires = exp;
859 set_restart_fn(restart, alarm_timer_nsleep_restart);
860 return ret;860 return ret;
861}861}
862 862
kernel/time/hrtimer.c+1−1
@@ -1957,9 +1957,9 @@ long hrtimer_nanosleep(ktime_t rqtp, const enum hrtimer_mode mode, · 1956 unmodified lines
1957 }1957 }
1958 1958
1959 restart = &current->restart_block;1959 restart = &current->restart_block;
1960 restart->fn = hrtimer_nanosleep_restart;
1961 restart->nanosleep.clockid = t.timer.base->clockid;1960 restart->nanosleep.clockid = t.timer.base->clockid;
1962 restart->nanosleep.expires = hrtimer_get_expires_tv64(&t.timer);1961 restart->nanosleep.expires = hrtimer_get_expires_tv64(&t.timer);
1962 set_restart_fn(restart, hrtimer_nanosleep_restart);
1963out:1963out:
1964 destroy_hrtimer_on_stack(&t.timer);1964 destroy_hrtimer_on_stack(&t.timer);
1965 return ret;1965 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
1480 if (flags & TIMER_ABSTIME)1480 if (flags & TIMER_ABSTIME)
1481 return -ERESTARTNOHAND;1481 return -ERESTARTNOHAND;
1482 1482
1483 restart_block->fn = posix_cpu_nsleep_restart;
1484 restart_block->nanosleep.clockid = which_clock;1483 restart_block->nanosleep.clockid = which_clock;
1484 set_restart_fn(restart_block, posix_cpu_nsleep_restart);
1485 }1485 }
1486 return error;1486 return error;
1487}1487}
net/batman-adv/main.c+0−1
@@ -702,7 +702,6 @@ MODULE_LICENSE("GPL"); · 701 unmodified lines
702 702
703MODULE_AUTHOR(BATADV_DRIVER_AUTHOR);703MODULE_AUTHOR(BATADV_DRIVER_AUTHOR);
704MODULE_DESCRIPTION(BATADV_DRIVER_DESC);704MODULE_DESCRIPTION(BATADV_DRIVER_DESC);
705MODULE_SUPPORTED_DEVICE(BATADV_DRIVER_DEVICE);
706MODULE_VERSION(BATADV_SOURCE_VERSION);705MODULE_VERSION(BATADV_SOURCE_VERSION);
707MODULE_ALIAS_RTNL_LINK("batadv");706MODULE_ALIAS_RTNL_LINK("batadv");
708MODULE_ALIAS_GENL_FAMILY(BATADV_NL_NAME);707MODULE_ALIAS_GENL_FAMILY(BATADV_NL_NAME);
net/sunrpc/auth_gss/svcauth_gss.c+7−4
@@ -1825,11 +1825,14 @@ static int · 1824 unmodified lines
1825svcauth_gss_release(struct svc_rqst *rqstp)1825svcauth_gss_release(struct svc_rqst *rqstp)
1826{1826{
1827 struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data;1827 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;
1829 struct xdr_buf *resbuf = &rqstp->rq_res;1829 struct xdr_buf *resbuf = &rqstp->rq_res;
1830 int stat = -EINVAL;1830 int stat = -EINVAL;
1831 struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id);1831 struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id);
1832 1832
1833 if (!gsd)
1834 goto out;
1835 gc = &gsd->clcred;
1833 if (gc->gc_proc != RPC_GSS_PROC_DATA)1836 if (gc->gc_proc != RPC_GSS_PROC_DATA)
1834 goto out;1837 goto out;
1835 /* Release can be called twice, but we only wrap once. */1838 /* Release can be called twice, but we only wrap once. */
@@ -1870,10 +1873,10 @@ out_err: · 34 unmodified lines
1870 if (rqstp->rq_cred.cr_group_info)1873 if (rqstp->rq_cred.cr_group_info)
1871 put_group_info(rqstp->rq_cred.cr_group_info);1874 put_group_info(rqstp->rq_cred.cr_group_info);
1872 rqstp->rq_cred.cr_group_info = NULL;1875 rqstp->rq_cred.cr_group_info = NULL;
1873 if (gsd->rsci)1876 if (gsd && gsd->rsci) {
1874 cache_put(&gsd->rsci->h, sn->rsc_cache);1877 cache_put(&gsd->rsci->h, sn->rsc_cache);
1875 gsd->rsci = NULL;1878 gsd->rsci = NULL;
1876 1879 }
1877 return stat;1880 return stat;
1878}1881}
1879 1882
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
1413 1413
1414 sendit:1414 sendit:
1415 if (svc_authorise(rqstp))1415 if (svc_authorise(rqstp))
1416 goto close;1416 goto close_xprt;
1417 return 1; /* Caller can now send it */1417 return 1; /* Caller can now send it */
1418 1418
1419release_dropit:1419release_dropit:
@@ -1425,6 +1425,8 @@ release_dropit: · 5 unmodified lines
1425 return 0;1425 return 0;
1426 1426
1427 close:1427 close:
1428 svc_authorise(rqstp);
1429close_xprt:
1428 if (rqstp->rq_xprt && test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags))1430 if (rqstp->rq_xprt && test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags))
1429 svc_close_xprt(rqstp->rq_xprt);1431 svc_close_xprt(rqstp->rq_xprt);
1430 dprintk("svc: svc_process close\n");1432 dprintk("svc: svc_process close\n");
@@ -1433,7 +1435,7 @@ release_dropit: · 2 unmodified lines
1433err_short_len:1435err_short_len:
1434 svc_printk(rqstp, "short len %zd, dropping request\n",1436 svc_printk(rqstp, "short len %zd, dropping request\n",
1435 argv->iov_len);1437 argv->iov_len);
1436 goto close;1438 goto close_xprt;
1437 1439
1438err_bad_rpc:1440err_bad_rpc:
1439 serv->sv_stats->rpcbadfmt++;1441 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
1060 struct svc_xprt *xprt;1060 struct svc_xprt *xprt;
1061 int ret = 0;1061 int ret = 0;
1062 1062
1063 spin_lock(&serv->sv_lock);1063 spin_lock_bh(&serv->sv_lock);
1064 list_for_each_entry(xprt, xprt_list, xpt_list) {1064 list_for_each_entry(xprt, xprt_list, xpt_list) {
1065 if (xprt->xpt_net != net)1065 if (xprt->xpt_net != net)
1066 continue;1066 continue;
@@ -1068,7 +1068,7 @@ static int svc_close_list(struct svc_serv *serv, struct list_head *xprt_list, st · 1 unmodified line
1068 set_bit(XPT_CLOSE, &xprt->xpt_flags);1068 set_bit(XPT_CLOSE, &xprt->xpt_flags);
1069 svc_xprt_enqueue(xprt);1069 svc_xprt_enqueue(xprt);
1070 }1070 }
1071 spin_unlock(&serv->sv_lock);1071 spin_unlock_bh(&serv->sv_lock);
1072 return ret;1072 return ret;
1073}1073}
1074 1074
net/sunrpc/xprtrdma/svc_rdma_backchannel.c+3−3
@@ -252,9 +252,9 @@ xprt_setup_rdma_bc(struct xprt_create *args) · 251 unmodified lines
252 xprt->timeout = &xprt_rdma_bc_timeout;252 xprt->timeout = &xprt_rdma_bc_timeout;
253 xprt_set_bound(xprt);253 xprt_set_bound(xprt);
254 xprt_set_connected(xprt);254 xprt_set_connected(xprt);
255 xprt->bind_timeout = RPCRDMA_BIND_TO;255 xprt->bind_timeout = 0;
256 xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO;256 xprt->reestablish_timeout = 0;
257 xprt->idle_timeout = RPCRDMA_IDLE_DISC_TO;257 xprt->idle_timeout = 0;
258 258
259 xprt->prot = XPRT_TRANSPORT_BC_RDMA;259 xprt->prot = XPRT_TRANSPORT_BC_RDMA;
260 xprt->ops = &xprt_rdma_bc_procs;260 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
266 svc_rdma_recv_ctxt_put(rdma, ctxt);266 svc_rdma_recv_ctxt_put(rdma, ctxt);
267}267}
268 268
269static bool svc_rdma_refresh_recvs(struct svcxprt_rdma *rdma,269static int __svc_rdma_post_recv(struct svcxprt_rdma *rdma,
270 unsigned int wanted, bool temp)270 struct svc_rdma_recv_ctxt *ctxt)
271{271{
272 const struct ib_recv_wr *bad_wr = NULL;
273 struct svc_rdma_recv_ctxt *ctxt;
274 struct ib_recv_wr *recv_chain;
275 int ret;272 int ret;
276 273
277 recv_chain = NULL;274 trace_svcrdma_post_recv(ctxt);
278 while (wanted--) {275 ret = ib_post_recv(rdma->sc_qp, &ctxt->rc_recv_wr, NULL);
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);
293 if (ret)276 if (ret)
294 goto err_post;277 goto err_post;
295 return true;278 return 0;
296 279
297err_post:280err_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
305 trace_svcrdma_rq_post_err(rdma, ret);281 trace_svcrdma_rq_post_err(rdma, ret);
306 /* Since we're destroying the xprt, no need to reset282 svc_rdma_recv_ctxt_put(rdma, ctxt);
307 * sc_pending_recvs. */283 return ret;
308 return false;284}
285
286static 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);
309}296}
310 297
311/**298/**
@@ -316,7 +303,20 @@ err_post: · 4 unmodified lines
316 */303 */
317bool svc_rdma_post_recvs(struct svcxprt_rdma *rdma)304bool svc_rdma_post_recvs(struct svcxprt_rdma *rdma)
318{305{
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;
320}320}
321 321
322/**322/**
@@ -324,6 +324,8 @@ bool svc_rdma_post_recvs(struct svcxprt_rdma *rdma) · 1 unmodified line
324 * @cq: Completion Queue context324 * @cq: Completion Queue context
325 * @wc: Work Completion object325 * @wc: Work Completion object
326 *326 *
327 * NB: The svc_xprt/svcxprt_rdma is pinned whenever it's possible that
328 * the Receive completion handler could be running.
327 */329 */
328static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc)330static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc)
329{331{
@@ -331,8 +333,6 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) · 1 unmodified line
331 struct ib_cqe *cqe = wc->wr_cqe;333 struct ib_cqe *cqe = wc->wr_cqe;
332 struct svc_rdma_recv_ctxt *ctxt;334 struct svc_rdma_recv_ctxt *ctxt;
333 335
334 rdma->sc_pending_recvs--;
335
336 /* WARNING: Only wc->wr_cqe and wc->status are reliable */336 /* WARNING: Only wc->wr_cqe and wc->status are reliable */
337 ctxt = container_of(cqe, struct svc_rdma_recv_ctxt, rc_cqe);337 ctxt = container_of(cqe, struct svc_rdma_recv_ctxt, rc_cqe);
338 338
@@ -340,6 +340,9 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) · 1 unmodified line
340 if (wc->status != IB_WC_SUCCESS)340 if (wc->status != IB_WC_SUCCESS)
341 goto flushed;341 goto flushed;
342 342
343 if (svc_rdma_post_recv(rdma))
344 goto post_err;
345
343 /* All wc fields are now known to be valid */346 /* All wc fields are now known to be valid */
344 ctxt->rc_byte_len = wc->byte_len;347 ctxt->rc_byte_len = wc->byte_len;
345 348
@@ -350,18 +353,11 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) · 4 unmodified lines
350 spin_unlock(&rdma->sc_rq_dto_lock);353 spin_unlock(&rdma->sc_rq_dto_lock);
351 if (!test_bit(RDMAXPRT_CONN_PENDING, &rdma->sc_flags))354 if (!test_bit(RDMAXPRT_CONN_PENDING, &rdma->sc_flags))
352 svc_xprt_enqueue(&rdma->sc_xprt);355 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
360 return;356 return;
361 357
362flushed:358flushed:
363 svc_rdma_recv_ctxt_put(rdma, ctxt);
364post_err:359post_err:
360 svc_rdma_recv_ctxt_put(rdma, ctxt);
365 set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags);361 set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags);
366 svc_xprt_enqueue(&rdma->sc_xprt);362 svc_xprt_enqueue(&rdma->sc_xprt);
367}363}
sound/drivers/aloop.c+0−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
33MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");33MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
34MODULE_DESCRIPTION("A loopback soundcard");34MODULE_DESCRIPTION("A loopback soundcard");
35MODULE_LICENSE("GPL");35MODULE_LICENSE("GPL");
36MODULE_SUPPORTED_DEVICE("{{ALSA,Loopback soundcard}}");
37 36
38#define MAX_PCM_SUBSTREAMS 837#define MAX_PCM_SUBSTREAMS 8
39 38
sound/drivers/dummy.c+0−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
25MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");25MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
26MODULE_DESCRIPTION("Dummy soundcard (/dev/null)");26MODULE_DESCRIPTION("Dummy soundcard (/dev/null)");
27MODULE_LICENSE("GPL");27MODULE_LICENSE("GPL");
28MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
29 28
30#define MAX_PCM_DEVICES 429#define MAX_PCM_DEVICES 4
31#define MAX_PCM_SUBSTREAMS 12830#define MAX_PCM_SUBSTREAMS 128
sound/drivers/mtpav.c+0−1
@@ -53,7 +53,6 @@ · 52 unmodified lines
53MODULE_AUTHOR("Michael T. Mayers");53MODULE_AUTHOR("Michael T. Mayers");
54MODULE_DESCRIPTION("MOTU MidiTimePiece AV multiport MIDI");54MODULE_DESCRIPTION("MOTU MidiTimePiece AV multiport MIDI");
55MODULE_LICENSE("GPL");55MODULE_LICENSE("GPL");
56MODULE_SUPPORTED_DEVICE("{{MOTU,MidiTimePiece AV multiport MIDI}}");
57 56
58// io resources57// io resources
59#define MTPAV_IOBASE 0x37858#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
37MODULE_AUTHOR("Matthias Koenig <mk@phasorlab.de>");37MODULE_AUTHOR("Matthias Koenig <mk@phasorlab.de>");
38MODULE_DESCRIPTION("ESI Miditerminal 4140");38MODULE_DESCRIPTION("ESI Miditerminal 4140");
39MODULE_LICENSE("GPL");39MODULE_LICENSE("GPL");
40MODULE_SUPPORTED_DEVICE("{{ESI,Miditerminal 4140}}");
41 40
42/*********************************************************************41/*********************************************************************
43 * Chip specific42 * Chip specific
sound/drivers/pcsp/pcsp.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
22MODULE_AUTHOR("Stas Sergeev <stsp@users.sourceforge.net>");22MODULE_AUTHOR("Stas Sergeev <stsp@users.sourceforge.net>");
23MODULE_DESCRIPTION("PC-Speaker driver");23MODULE_DESCRIPTION("PC-Speaker driver");
24MODULE_LICENSE("GPL");24MODULE_LICENSE("GPL");
25MODULE_SUPPORTED_DEVICE("{{PC-Speaker, pcsp}}");
26MODULE_ALIAS("platform:pcspkr");25MODULE_ALIAS("platform:pcspkr");
27 26
28static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */27static 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
57MODULE_AUTHOR("Levent Guendogdu, Tobias Gehrig, Matthias Koenig");57MODULE_AUTHOR("Levent Guendogdu, Tobias Gehrig, Matthias Koenig");
58MODULE_DESCRIPTION("Midiman Portman2x4");58MODULE_DESCRIPTION("Midiman Portman2x4");
59MODULE_LICENSE("GPL");59MODULE_LICENSE("GPL");
60MODULE_SUPPORTED_DEVICE("{{Midiman,Portman2x4}}");
61 60
62/*********************************************************************61/*********************************************************************
63 * Chip specific62 * Chip specific
sound/drivers/serial-u16550.c+0−1
@@ -34,7 +34,6 @@ · 33 unmodified lines
34 34
35MODULE_DESCRIPTION("MIDI serial u16550");35MODULE_DESCRIPTION("MIDI serial u16550");
36MODULE_LICENSE("GPL");36MODULE_LICENSE("GPL");
37MODULE_SUPPORTED_DEVICE("{{ALSA, MIDI serial u16550}}");
38 37
39#define SNDRV_SERIAL_SOUNDCANVAS 0 /* Roland Soundcanvas; F5 NN selects part */38#define SNDRV_SERIAL_SOUNDCANVAS 0 /* Roland Soundcanvas; F5 NN selects part */
40#define SNDRV_SERIAL_MS124T 1 /* Midiator MS-124T */39#define SNDRV_SERIAL_MS124T 1 /* Midiator MS-124T */
sound/drivers/virmidi.c+0−1
@@ -43,7 +43,6 @@ · 42 unmodified lines
43MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");43MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
44MODULE_DESCRIPTION("Dummy soundcard for virtual rawmidi devices");44MODULE_DESCRIPTION("Dummy soundcard for virtual rawmidi devices");
45MODULE_LICENSE("GPL");45MODULE_LICENSE("GPL");
46MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual rawmidi device}}");
47 46
48#define MAX_MIDI_DEVICES 447#define MAX_MIDI_DEVICES 4
49 48
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
493 struct reg_params tx_params, rx_params;493 struct reg_params tx_params, rx_params;
494 494
495 if (dice->substreams_counter == 0) {495 if (dice->substreams_counter == 0) {
496 if (get_register_params(dice, &tx_params, &rx_params) >= 0) {496 if (get_register_params(dice, &tx_params, &rx_params) >= 0)
497 amdtp_domain_stop(&dice->domain);
498 finish_session(dice, &tx_params, &rx_params);497 finish_session(dice, &tx_params, &rx_params);
499 }
500 498
499 amdtp_domain_stop(&dice->domain);
501 release_resources(dice);500 release_resources(dice);
502 }501 }
503}502}
sound/isa/ad1816a/ad1816a.c+0−7
@@ -22,13 +22,6 @@ · 21 unmodified lines
22MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");22MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
23MODULE_DESCRIPTION("AD1816A, AD1815");23MODULE_DESCRIPTION("AD1816A, AD1815");
24MODULE_LICENSE("GPL");24MODULE_LICENSE("GPL");
25MODULE_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}}");
32 25
33static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */26static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */
34static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */27static 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
22MODULE_DESCRIPTION(CRD_NAME);22MODULE_DESCRIPTION(CRD_NAME);
23MODULE_AUTHOR("Tugrul Galatali <galatalt@stuy.edu>, Jaroslav Kysela <perex@perex.cz>");23MODULE_AUTHOR("Tugrul Galatali <galatalt@stuy.edu>, Jaroslav Kysela <perex@perex.cz>");
24MODULE_LICENSE("GPL");24MODULE_LICENSE("GPL");
25MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1848},"
26 "{Analog Devices,AD1847},"
27 "{Crystal Semiconductors,CS4248}}");
28 25
29static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */26static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
30static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */27static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/als100.c+0−11
@@ -26,17 +26,6 @@ · 25 unmodified lines
26#define PFX "als100: "26#define PFX "als100: "
27 27
28MODULE_DESCRIPTION("Avance Logic ALS007/ALS1X0");28MODULE_DESCRIPTION("Avance Logic ALS007/ALS1X0");
29MODULE_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
40MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");29MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
41MODULE_LICENSE("GPL");30MODULE_LICENSE("GPL");
42 31
sound/isa/azt2320.c+0−5
@@ -35,11 +35,6 @@ · 34 unmodified lines
35MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");35MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
36MODULE_DESCRIPTION("Aztech Systems AZT2320");36MODULE_DESCRIPTION("Aztech Systems AZT2320");
37MODULE_LICENSE("GPL");37MODULE_LICENSE("GPL");
38MODULE_SUPPORTED_DEVICE("{{Aztech Systems,PRO16V},"
39 "{Aztech Systems,AZT2320},"
40 "{Aztech Systems,AZT3300},"
41 "{Aztech Systems,AZT2320},"
42 "{Aztech Systems,AZT3000}}");
43 38
44static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */39static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */40static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/cmi8330.c+0−1
@@ -51,7 +51,6 @@ · 50 unmodified lines
51MODULE_AUTHOR("George Talusan <gstalusan@uwaterloo.ca>");51MODULE_AUTHOR("George Talusan <gstalusan@uwaterloo.ca>");
52MODULE_DESCRIPTION("C-Media CMI8330/CMI8329");52MODULE_DESCRIPTION("C-Media CMI8330/CMI8329");
53MODULE_LICENSE("GPL");53MODULE_LICENSE("GPL");
54MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8330,isapnp:{CMI0001,@@@0001,@X@0001}}}");
55 54
56static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;55static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
57static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;56static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/isa/cs423x/cs4231.c+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
23MODULE_DESCRIPTION(CRD_NAME);23MODULE_DESCRIPTION(CRD_NAME);
24MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");24MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
25MODULE_LICENSE("GPL");25MODULE_LICENSE("GPL");
26MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4231}}");
27 26
28static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */27static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
29static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */28static 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
18MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");18MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
19MODULE_LICENSE("GPL");19MODULE_LICENSE("GPL");
20MODULE_DESCRIPTION("Cirrus Logic CS4232-9");20MODULE_DESCRIPTION("Cirrus Logic CS4232-9");
21MODULE_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
55MODULE_ALIAS("snd_cs4232");21MODULE_ALIAS("snd_cs4232");
56 22
57#define IDENT "CS4232+"23#define IDENT "CS4232+"
sound/isa/es1688/es1688.c+0−5
@@ -26,11 +26,6 @@ · 25 unmodified lines
26MODULE_DESCRIPTION(CRD_NAME);26MODULE_DESCRIPTION(CRD_NAME);
27MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");27MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
28MODULE_LICENSE("GPL");28MODULE_LICENSE("GPL");
29MODULE_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
34MODULE_ALIAS("snd_es968");29MODULE_ALIAS("snd_es968");
35 30
36static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */31static 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
1929 1929
1930/* Card level */1930/* Card level */
1931 1931
1932MODULE_AUTHOR("Christian Fischbach <fishbach@pool.informatik.rwth-aachen.de>, Abramo Bagnara <abramo@alsa-project.org>"); 1932MODULE_AUTHOR("Christian Fischbach <fishbach@pool.informatik.rwth-aachen.de>, Abramo Bagnara <abramo@alsa-project.org>");
1933MODULE_DESCRIPTION("ESS ES18xx AudioDrive");1933MODULE_DESCRIPTION("ESS ES18xx AudioDrive");
1934MODULE_LICENSE("GPL");1934MODULE_LICENSE("GPL");
1935MODULE_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}}");
1943 1935
1944static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */1936static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
1945static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */1937static 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
23MODULE_DESCRIPTION(CRD_NAME);23MODULE_DESCRIPTION(CRD_NAME);
24MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");24MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
25MODULE_LICENSE("GPL");25MODULE_LICENSE("GPL");
26MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Classic}}");
27 26
28static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */27static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
29static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */28static 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
27MODULE_DESCRIPTION(CRD_NAME);27MODULE_DESCRIPTION(CRD_NAME);
28MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");28MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
29MODULE_LICENSE("GPL");29MODULE_LICENSE("GPL");
30MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Extreme}}");
31 30
32static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */31static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
33static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */32static 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
21MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");21MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
22MODULE_DESCRIPTION("Gravis UltraSound MAX");22MODULE_DESCRIPTION("Gravis UltraSound MAX");
23MODULE_LICENSE("GPL");23MODULE_LICENSE("GPL");
24MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound MAX}}");
25 24
26static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */25static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
27static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */26static 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
28MODULE_LICENSE("GPL");28MODULE_LICENSE("GPL");
29#ifndef SNDRV_STB29#ifndef SNDRV_STB
30MODULE_DESCRIPTION("AMD InterWave");30MODULE_DESCRIPTION("AMD InterWave");
31MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Plug & Play},"
32 "{STB,SoundRage32},"
33 "{MED,MED3210},"
34 "{Dynasonix,Dynasonix Pro},"
35 "{Panasonic,PCA761AW}}");
36#else31#else
37MODULE_DESCRIPTION("AMD InterWave STB with TEA6330T");32MODULE_DESCRIPTION("AMD InterWave STB with TEA6330T");
38MODULE_SUPPORTED_DEVICE("{{AMD,InterWave STB with TEA6330T}}");
39#endif33#endif
40 34
41static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */35static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
sound/isa/opl3sa2.c+0−5
@@ -22,11 +22,6 @@ · 21 unmodified lines
22MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");22MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
23MODULE_DESCRIPTION("Yamaha OPL3SA2+");23MODULE_DESCRIPTION("Yamaha OPL3SA2+");
24MODULE_LICENSE("GPL");24MODULE_LICENSE("GPL");
25MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF719E-S},"
26 "{Genius,Sound Maker 3DX},"
27 "{Yamaha,OPL3SA3},"
28 "{Intel,AL440LX sound},"
29 "{NeoMagic,MagicWave 3DX}}");
30 25
31static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */26static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
32static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */27static 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
33MODULE_AUTHOR("Martin Langer <martin-langer@gmx.de>");33MODULE_AUTHOR("Martin Langer <martin-langer@gmx.de>");
34MODULE_LICENSE("GPL");34MODULE_LICENSE("GPL");
35MODULE_DESCRIPTION("Miro miroSOUND PCM1 pro, PCM12, PCM20 Radio");35MODULE_DESCRIPTION("Miro miroSOUND PCM1 pro, PCM12, PCM20 Radio");
36MODULE_SUPPORTED_DEVICE("{{Miro,miroSOUND PCM1 pro}, "
37 "{Miro,miroSOUND PCM12}, "
38 "{Miro,miroSOUND PCM20 Radio}}");
39 36
40static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */37static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
41static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */38static 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
36MODULE_LICENSE("GPL");36MODULE_LICENSE("GPL");
37#ifdef OPTi93X37#ifdef OPTi93X
38MODULE_DESCRIPTION("OPTi93X");38MODULE_DESCRIPTION("OPTi93X");
39MODULE_SUPPORTED_DEVICE("{{OPTi,82C931/3}}");
40#else /* OPTi93X */39#else /* OPTi93X */
41#ifdef CS423140#ifdef CS4231
42MODULE_DESCRIPTION("OPTi92X - CS4231");41MODULE_DESCRIPTION("OPTi92X - CS4231");
43MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (CS4231)},"
44 "{OPTi,82C925 (CS4231)}}");
45#else /* CS4231 */42#else /* CS4231 */
46MODULE_DESCRIPTION("OPTi92X - AD1848");43MODULE_DESCRIPTION("OPTi92X - AD1848");
47MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (AD1848)},"
48 "{OPTi,82C925 (AD1848)},"
49 "{OAK,Mozart}}");
50#endif /* CS4231 */44#endif /* CS4231 */
51#endif /* OPTi93X */45#endif /* OPTi93X */
52 46
sound/isa/sb/jazz16.c+0−3
@@ -28,9 +28,6 @@ · 27 unmodified lines
28#define PFX "jazz16: "28#define PFX "jazz16: "
29 29
30MODULE_DESCRIPTION("Media Vision Jazz16");30MODULE_DESCRIPTION("Media Vision Jazz16");
31MODULE_SUPPORTED_DEVICE("{{Media Vision ??? },"
32 "{RTL,RTL3000}}");
33
34MODULE_AUTHOR("Krzysztof Helt <krzysztof.h1@wp.pl>");31MODULE_AUTHOR("Krzysztof Helt <krzysztof.h1@wp.pl>");
35MODULE_LICENSE("GPL");32MODULE_LICENSE("GPL");
36 33
sound/isa/sb/sb16.c+0−8
@@ -31,16 +31,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); · 30 unmodified lines
31MODULE_LICENSE("GPL");31MODULE_LICENSE("GPL");
32#ifndef SNDRV_SBAWE32#ifndef SNDRV_SBAWE
33MODULE_DESCRIPTION("Sound Blaster 16");33MODULE_DESCRIPTION("Sound Blaster 16");
34MODULE_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}}");
39#else34#else
40MODULE_DESCRIPTION("Sound Blaster AWE");35MODULE_DESCRIPTION("Sound Blaster AWE");
41MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB AWE 32},"
42 "{Creative Labs,SB AWE 64},"
43 "{Creative Labs,SB AWE 64 Gold}}");
44#endif36#endif
45 37
46#if 038#if 0
sound/isa/sb/sb8.c+0−1
@@ -17,7 +17,6 @@ · 16 unmodified lines
17MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");17MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
18MODULE_DESCRIPTION("Sound Blaster 1.0/2.0/Pro");18MODULE_DESCRIPTION("Sound Blaster 1.0/2.0/Pro");
19MODULE_LICENSE("GPL");19MODULE_LICENSE("GPL");
20MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB 1.0/SB 2.0/SB Pro}}");
21 20
22static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */21static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
23static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */22static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/isa/sc6000.c+0−3
@@ -29,9 +29,6 @@ · 28 unmodified lines
29MODULE_AUTHOR("Krzysztof Helt");29MODULE_AUTHOR("Krzysztof Helt");
30MODULE_DESCRIPTION("Gallant SC-6000");30MODULE_DESCRIPTION("Gallant SC-6000");
31MODULE_LICENSE("GPL");31MODULE_LICENSE("GPL");
32MODULE_SUPPORTED_DEVICE("{{Gallant, SC-6000},"
33 "{AudioExcel, Audio Excel DSP 16},"
34 "{Zoltrix, AV302}}");
35 32
36static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */33static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
37static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */34static 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
21MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>");21MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>");
22MODULE_DESCRIPTION("Turtle Beach Wavefront");22MODULE_DESCRIPTION("Turtle Beach Wavefront");
23MODULE_LICENSE("GPL");23MODULE_LICENSE("GPL");
24MODULE_SUPPORTED_DEVICE("{{Turtle Beach,Maui/Tropez/Tropez+}}");
25 24
26static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */25static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
27static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */26static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/mips/sgio2audio.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
32MODULE_AUTHOR("Vivien Chappelier <vivien.chappelier@linux-mips.org>");32MODULE_AUTHOR("Vivien Chappelier <vivien.chappelier@linux-mips.org>");
33MODULE_DESCRIPTION("SGI O2 Audio");33MODULE_DESCRIPTION("SGI O2 Audio");
34MODULE_LICENSE("GPL");34MODULE_LICENSE("GPL");
35MODULE_SUPPORTED_DEVICE("{{Silicon Graphics, O2 Audio}}");
36 35
37static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */36static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
38static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */37static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/ad1889.c+0−1
@@ -43,7 +43,6 @@ · 42 unmodified lines
43MODULE_AUTHOR("Kyle McMartin <kyle@parisc-linux.org>, Thibaut Varene <t-bone@parisc-linux.org>");43MODULE_AUTHOR("Kyle McMartin <kyle@parisc-linux.org>, Thibaut Varene <t-bone@parisc-linux.org>");
44MODULE_DESCRIPTION("Analog Devices AD1889 ALSA sound driver");44MODULE_DESCRIPTION("Analog Devices AD1889 ALSA sound driver");
45MODULE_LICENSE("GPL");45MODULE_LICENSE("GPL");
46MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1889}}");
47 46
48static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;47static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
49module_param_array(index, int, NULL, 0444);48module_param_array(index, int, NULL, 0444);
sound/pci/ali5451/ali5451.c+0−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
29MODULE_AUTHOR("Matt Wu <Matt_Wu@acersoftech.com.cn>");29MODULE_AUTHOR("Matt Wu <Matt_Wu@acersoftech.com.cn>");
30MODULE_DESCRIPTION("ALI M5451");30MODULE_DESCRIPTION("ALI M5451");
31MODULE_LICENSE("GPL");31MODULE_LICENSE("GPL");
32MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}");
33 32
34static int index = SNDRV_DEFAULT_IDX1; /* Index */33static int index = SNDRV_DEFAULT_IDX1; /* Index */
35static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */34static 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
86MODULE_AUTHOR("Ash Willis <ashwillis@programmer.net>");86MODULE_AUTHOR("Ash Willis <ashwillis@programmer.net>");
87MODULE_DESCRIPTION("Avance Logic ALS300");87MODULE_DESCRIPTION("Avance Logic ALS300");
88MODULE_LICENSE("GPL");88MODULE_LICENSE("GPL");
89MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS300},{Avance Logic,ALS300+}}");
90 89
91static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;90static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
92static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;91static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/pci/als4000.c+0−1
@@ -68,7 +68,6 @@ · 67 unmodified lines
68MODULE_AUTHOR("Bart Hartgers <bart@etpmod.phys.tue.nl>, Andreas Mohr");68MODULE_AUTHOR("Bart Hartgers <bart@etpmod.phys.tue.nl>, Andreas Mohr");
69MODULE_DESCRIPTION("Avance Logic ALS4000");69MODULE_DESCRIPTION("Avance Logic ALS4000");
70MODULE_LICENSE("GPL");70MODULE_LICENSE("GPL");
71MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS4000}}");
72 71
73#if IS_REACHABLE(CONFIG_GAMEPORT)72#if IS_REACHABLE(CONFIG_GAMEPORT)
74#define SUPPORT_JOYSTICK 173#define SUPPORT_JOYSTICK 1
sound/pci/atiixp.c+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
23MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");23MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
24MODULE_DESCRIPTION("ATI IXP AC97 controller");24MODULE_DESCRIPTION("ATI IXP AC97 controller");
25MODULE_LICENSE("GPL");25MODULE_LICENSE("GPL");
26MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250/300/400/600}}");
27 26
28static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */27static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
29static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */28static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/atiixp_modem.c+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
23MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");23MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
24MODULE_DESCRIPTION("ATI IXP MC97 controller");24MODULE_DESCRIPTION("ATI IXP MC97 controller");
25MODULE_LICENSE("GPL");25MODULE_LICENSE("GPL");
26MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250}}");
27 26
28static int index = -2; /* Exclude the first card */27static int index = -2; /* Exclude the first card */
29static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */28static 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
41 41
42MODULE_DESCRIPTION("Aureal vortex");42MODULE_DESCRIPTION("Aureal vortex");
43MODULE_LICENSE("GPL");43MODULE_LICENSE("GPL");
44MODULE_SUPPORTED_DEVICE("{{Aureal Semiconductor Inc., Aureal Vortex Sound Processor}}");
45
46MODULE_DEVICE_TABLE(pci, snd_vortex_ids);44MODULE_DEVICE_TABLE(pci, snd_vortex_ids);
47 45
48static void vortex_fix_latency(struct pci_dev *vortex)46static void vortex_fix_latency(struct pci_dev *vortex)
sound/pci/azt3328.c+0−1
@@ -196,7 +196,6 @@ · 195 unmodified lines
196MODULE_AUTHOR("Andreas Mohr <andi AT lisas.de>");196MODULE_AUTHOR("Andreas Mohr <andi AT lisas.de>");
197MODULE_DESCRIPTION("Aztech AZF3328 (PCI168)");197MODULE_DESCRIPTION("Aztech AZF3328 (PCI168)");
198MODULE_LICENSE("GPL");198MODULE_LICENSE("GPL");
199MODULE_SUPPORTED_DEVICE("{{Aztech,AZF3328}}");
200 199
201#if IS_REACHABLE(CONFIG_GAMEPORT)200#if IS_REACHABLE(CONFIG_GAMEPORT)
202#define SUPPORT_GAMEPORT 1201#define SUPPORT_GAMEPORT 1
sound/pci/bt87x.c+0−2
@@ -23,8 +23,6 @@ · 22 unmodified lines
23MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");23MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
24MODULE_DESCRIPTION("Brooktree Bt87x audio driver");24MODULE_DESCRIPTION("Brooktree Bt87x audio driver");
25MODULE_LICENSE("GPL");25MODULE_LICENSE("GPL");
26MODULE_SUPPORTED_DEVICE("{{Brooktree,Bt878},"
27 "{Brooktree,Bt879}}");
28 26
29static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */27static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */
30static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */28static 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
137MODULE_AUTHOR("James Courtier-Dutton <James@superbug.demon.co.uk>");137MODULE_AUTHOR("James Courtier-Dutton <James@superbug.demon.co.uk>");
138MODULE_DESCRIPTION("CA0106");138MODULE_DESCRIPTION("CA0106");
139MODULE_LICENSE("GPL");139MODULE_LICENSE("GPL");
140MODULE_SUPPORTED_DEVICE("{{Creative,SB CA0106 chip}}");
141 140
142// module parameters (see "Module Parameters")141// module parameters (see "Module Parameters")
143static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;142static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
sound/pci/cmipci.c+0−4
@@ -30,10 +30,6 @@ · 29 unmodified lines
30MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");30MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
31MODULE_DESCRIPTION("C-Media CMI8x38 PCI");31MODULE_DESCRIPTION("C-Media CMI8x38 PCI");
32MODULE_LICENSE("GPL");32MODULE_LICENSE("GPL");
33MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8738},"
34 "{C-Media,CMI8738B},"
35 "{C-Media,CMI8338A},"
36 "{C-Media,CMI8338B}}");
37 33
38#if IS_REACHABLE(CONFIG_GAMEPORT)34#if IS_REACHABLE(CONFIG_GAMEPORT)
39#define SUPPORT_JOYSTICK 135#define SUPPORT_JOYSTICK 1
sound/pci/cs4281.c+0−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
25MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");25MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
26MODULE_DESCRIPTION("Cirrus Logic CS4281");26MODULE_DESCRIPTION("Cirrus Logic CS4281");
27MODULE_LICENSE("GPL");27MODULE_LICENSE("GPL");
28MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,CS4281}}");
29 28
30static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */29static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
31static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */30static 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
21MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");21MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
22MODULE_DESCRIPTION("Cirrus Logic Sound Fusion CS46XX");22MODULE_DESCRIPTION("Cirrus Logic Sound Fusion CS46XX");
23MODULE_LICENSE("GPL");23MODULE_LICENSE("GPL");
24MODULE_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)}}");
31 24
32static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */25static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
33static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */26static 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
393MODULE_AUTHOR("Jaya Kumar");393MODULE_AUTHOR("Jaya Kumar");
394MODULE_LICENSE("GPL");394MODULE_LICENSE("GPL");
395MODULE_DESCRIPTION("CS5535 Audio");395MODULE_DESCRIPTION("CS5535 Audio");
396MODULE_SUPPORTED_DEVICE("CS5535 Audio");
sound/pci/ctxfi/xfi.c+0−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
18MODULE_AUTHOR("Creative Technology Ltd");18MODULE_AUTHOR("Creative Technology Ltd");
19MODULE_DESCRIPTION("X-Fi driver version 1.03");19MODULE_DESCRIPTION("X-Fi driver version 1.03");
20MODULE_LICENSE("GPL v2");20MODULE_LICENSE("GPL v2");
21MODULE_SUPPORTED_DEVICE("{{Creative Labs, Sound Blaster X-Fi}");
22 21
23static unsigned int reference_rate = 48000;22static unsigned int reference_rate = 48000;
24static unsigned int multiple = 2;23static unsigned int multiple = 2;
sound/pci/echoaudio/echoaudio.c+0−1
@@ -10,7 +10,6 @@ · 9 unmodified lines
10MODULE_AUTHOR("Giuliano Pochini <pochini@shiny.it>");10MODULE_AUTHOR("Giuliano Pochini <pochini@shiny.it>");
11MODULE_LICENSE("GPL v2");11MODULE_LICENSE("GPL v2");
12MODULE_DESCRIPTION("Echoaudio " ECHOCARD_NAME " soundcards driver");12MODULE_DESCRIPTION("Echoaudio " ECHOCARD_NAME " soundcards driver");
13MODULE_SUPPORTED_DEVICE("{{Echoaudio," ECHOCARD_NAME "}}");
14MODULE_DEVICE_TABLE(pci, snd_echo_ids);13MODULE_DEVICE_TABLE(pci, snd_echo_ids);
15 14
16static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;15static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
sound/pci/emu10k1/emu10k1.c+0−2
@@ -18,8 +18,6 @@ · 17 unmodified lines
18MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");18MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
19MODULE_DESCRIPTION("EMU10K1");19MODULE_DESCRIPTION("EMU10K1");
20MODULE_LICENSE("GPL");20MODULE_LICENSE("GPL");
21MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB Live!/PCI512/E-mu APS},"
22 "{Creative Labs,SB Audigy}}");
23 21
24#if IS_ENABLED(CONFIG_SND_SEQUENCER)22#if IS_ENABLED(CONFIG_SND_SEQUENCER)
25#define ENABLE_SYNTH23#define ENABLE_SYNTH
sound/pci/emu10k1/emu10k1x.c+0−1
@@ -31,7 +31,6 @@ · 30 unmodified lines
31MODULE_AUTHOR("Francisco Moraes <fmoraes@nc.rr.com>");31MODULE_AUTHOR("Francisco Moraes <fmoraes@nc.rr.com>");
32MODULE_DESCRIPTION("EMU10K1X");32MODULE_DESCRIPTION("EMU10K1X");
33MODULE_LICENSE("GPL");33MODULE_LICENSE("GPL");
34MODULE_SUPPORTED_DEVICE("{{Dell Creative Labs,SB Live!}");
35 34
36// module parameters (see "Module Parameters")35// module parameters (see "Module Parameters")
37static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;36static 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
52MODULE_LICENSE("GPL");52MODULE_LICENSE("GPL");
53#ifdef CHIP137053#ifdef CHIP1370
54MODULE_DESCRIPTION("Ensoniq AudioPCI ES1370");54MODULE_DESCRIPTION("Ensoniq AudioPCI ES1370");
55MODULE_SUPPORTED_DEVICE("{{Ensoniq,AudioPCI-97 ES1370},"
56 "{Creative Labs,SB PCI64/128 (ES1370)}}");
57#endif55#endif
58#ifdef CHIP137156#ifdef CHIP1371
59MODULE_DESCRIPTION("Ensoniq/Creative AudioPCI ES1371+");57MODULE_DESCRIPTION("Ensoniq/Creative AudioPCI ES1371+");
60MODULE_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}}");
66#endif58#endif
67 59
68#if IS_REACHABLE(CONFIG_GAMEPORT)60#if IS_REACHABLE(CONFIG_GAMEPORT)
sound/pci/es1938.c+0−4
@@ -52,10 +52,6 @@ · 51 unmodified lines
52MODULE_AUTHOR("Jaromir Koutek <miri@punknet.cz>");52MODULE_AUTHOR("Jaromir Koutek <miri@punknet.cz>");
53MODULE_DESCRIPTION("ESS Solo-1");53MODULE_DESCRIPTION("ESS Solo-1");
54MODULE_LICENSE("GPL");54MODULE_LICENSE("GPL");
55MODULE_SUPPORTED_DEVICE("{{ESS,ES1938},"
56 "{ESS,ES1946},"
57 "{ESS,ES1969},"
58 "{TerraTec,128i PCI}}");
59 55
60#if IS_REACHABLE(CONFIG_GAMEPORT)56#if IS_REACHABLE(CONFIG_GAMEPORT)
61#define SUPPORT_JOYSTICK 157#define SUPPORT_JOYSTICK 1
sound/pci/es1968.c+0−4
@@ -107,10 +107,6 @@ · 106 unmodified lines
107 107
108MODULE_DESCRIPTION("ESS Maestro");108MODULE_DESCRIPTION("ESS Maestro");
109MODULE_LICENSE("GPL");109MODULE_LICENSE("GPL");
110MODULE_SUPPORTED_DEVICE("{{ESS,Maestro 2e},"
111 "{ESS,Maestro 2},"
112 "{ESS,Maestro 1},"
113 "{TerraTec,DMX}}");
114 110
115#if IS_REACHABLE(CONFIG_GAMEPORT)111#if IS_REACHABLE(CONFIG_GAMEPORT)
116#define SUPPORT_JOYSTICK 1112#define SUPPORT_JOYSTICK 1
sound/pci/fm801.c+0−2
@@ -26,8 +26,6 @@ · 25 unmodified lines
26MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");26MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
27MODULE_DESCRIPTION("ForteMedia FM801");27MODULE_DESCRIPTION("ForteMedia FM801");
28MODULE_LICENSE("GPL");28MODULE_LICENSE("GPL");
29MODULE_SUPPORTED_DEVICE("{{ForteMedia,FM801},"
30 "{Genius,SoundMaker Live 5.1}}");
31 29
32static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */30static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
33static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */31static 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
4065 4065
4066 spec->micmute_led.led_mode = MICMUTE_LED_FOLLOW_MUTE;4066 spec->micmute_led.led_mode = MICMUTE_LED_FOLLOW_MUTE;
4067 spec->micmute_led.capture = 0;4067 spec->micmute_led.capture = 0;
4068 spec->micmute_led.led_value = 0;4068 spec->micmute_led.led_value = -1;
4069 spec->micmute_led.old_hook = spec->cap_sync_hook;4069 spec->micmute_led.old_hook = spec->cap_sync_hook;
4070 spec->cap_sync_hook = update_micmute_led;4070 spec->cap_sync_hook = update_micmute_led;
4071 if (!snd_hda_gen_add_kctl(spec, NULL, &micmute_led_mode_ctl))4071 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
208 208
209 209
210MODULE_LICENSE("GPL");210MODULE_LICENSE("GPL");
211MODULE_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}}");
245MODULE_DESCRIPTION("Intel HDA driver");211MODULE_DESCRIPTION("Intel HDA driver");
246 212
247#if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO)213#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
4225 }4225 }
4226}4226}
4227 4227
4228static 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
4228static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,4234static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4229 const struct hda_fixup *fix, int action)4235 const struct hda_fixup *fix, int action)
4230{4236{
@@ -6381,6 +6387,7 @@ enum { · 2150 unmodified lines
6381 ALC294_FIXUP_ASUS_GX502_VERBS,6387 ALC294_FIXUP_ASUS_GX502_VERBS,
6382 ALC285_FIXUP_HP_GPIO_LED,6388 ALC285_FIXUP_HP_GPIO_LED,
6383 ALC285_FIXUP_HP_MUTE_LED,6389 ALC285_FIXUP_HP_MUTE_LED,
6390 ALC236_FIXUP_HP_GPIO_LED,
6384 ALC236_FIXUP_HP_MUTE_LED,6391 ALC236_FIXUP_HP_MUTE_LED,
6385 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,6392 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6386 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,6393 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
@@ -7616,6 +7623,10 @@ static const struct hda_fixup alc269_fixups[] = { · 1229 unmodified lines
7616 .type = HDA_FIXUP_FUNC,7623 .type = HDA_FIXUP_FUNC,
7617 .v.func = alc285_fixup_hp_mute_led,7624 .v.func = alc285_fixup_hp_mute_led,
7618 },7625 },
7626 [ALC236_FIXUP_HP_GPIO_LED] = {
7627 .type = HDA_FIXUP_FUNC,
7628 .v.func = alc236_fixup_hp_gpio_led,
7629 },
7619 [ALC236_FIXUP_HP_MUTE_LED] = {7630 [ALC236_FIXUP_HP_MUTE_LED] = {
7620 .type = HDA_FIXUP_FUNC,7631 .type = HDA_FIXUP_FUNC,
7621 .v.func = alc236_fixup_hp_mute_led,7632 .v.func = alc236_fixup_hp_mute_led,
@@ -8045,9 +8056,12 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 423 unmodified lines
8045 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",8056 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
8046 ALC285_FIXUP_HP_GPIO_AMP_INIT),8057 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8047 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),8058 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),
8048 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),8060 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
8049 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),8061 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
8050 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),8062 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),
8051 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),8065 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8052 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),8066 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
8053 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),8067 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
8242 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),8256 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
8243 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */8257 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
8244 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),8258 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),
8245 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),8260 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),
8246 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),8262 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
8247 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),8263 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
8248 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),8264 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
60MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");60MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
61MODULE_DESCRIPTION("ICEnsemble ICE1712 (Envy24)");61MODULE_DESCRIPTION("ICEnsemble ICE1712 (Envy24)");
62MODULE_LICENSE("GPL");62MODULE_LICENSE("GPL");
63MODULE_SUPPORTED_DEVICE("{"
64 HOONTECH_DEVICE_DESC
65 DELTA_DEVICE_DESC
66 EWS_DEVICE_DESC
67 "{ICEnsemble,Generic ICE1712},"
68 "{ICEnsemble,Generic Envy24}}");
69 63
70static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */64static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
71static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */65static 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
44MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");44MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
45MODULE_DESCRIPTION("VIA ICEnsemble ICE1724/1720 (Envy24HT/PT)");45MODULE_DESCRIPTION("VIA ICEnsemble ICE1724/1720 (Envy24HT/PT)");
46MODULE_LICENSE("GPL");46MODULE_LICENSE("GPL");
47MODULE_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}}");
66 47
67static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */48static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
68static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */49static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/intel8x0.c+0−23
@@ -27,29 +27,6 @@ · 26 unmodified lines
27MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");27MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
28MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7012; Ali 5455");28MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7012; Ali 5455");
29MODULE_LICENSE("GPL");29MODULE_LICENSE("GPL");
30MODULE_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}}");
53 30
54static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */31static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
55static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */32static 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
25MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; "25MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; "
26 "SiS 7013; NVidia MCP/2/2S/3 modems");26 "SiS 7013; NVidia MCP/2/2S/3 modems");
27MODULE_LICENSE("GPL");27MODULE_LICENSE("GPL");
28MODULE_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}}");
43 28
44static int index = -2; /* Exclude the first card */29static int index = -2; /* Exclude the first card */
45static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */30static 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
388 388
389MODULE_DESCRIPTION("korg1212");389MODULE_DESCRIPTION("korg1212");
390MODULE_LICENSE("GPL");390MODULE_LICENSE("GPL");
391MODULE_SUPPORTED_DEVICE("{{KORG,korg1212}}");
392MODULE_FIRMWARE("korg/k1212.dsp");391MODULE_FIRMWARE("korg/k1212.dsp");
393 392
394static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */393static 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
54 */54 */
55 55
56MODULE_LICENSE("GPL");56MODULE_LICENSE("GPL");
57MODULE_SUPPORTED_DEVICE("{{Digigram, Lola}}");
58MODULE_DESCRIPTION("Digigram Lola driver");57MODULE_DESCRIPTION("Digigram Lola driver");
59MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");58MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
60 59
sound/pci/lx6464es/lx6464es.c+0−2
@@ -21,8 +21,6 @@ · 20 unmodified lines
21MODULE_AUTHOR("Tim Blechmann");21MODULE_AUTHOR("Tim Blechmann");
22MODULE_LICENSE("GPL");22MODULE_LICENSE("GPL");
23MODULE_DESCRIPTION("digigram lx6464es");23MODULE_DESCRIPTION("digigram lx6464es");
24MODULE_SUPPORTED_DEVICE("{digigram lx6464es{}}");
25
26 24
27static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;25static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
28static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;26static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/pci/maestro3.c+0−5
@@ -39,11 +39,6 @@ · 38 unmodified lines
39MODULE_AUTHOR("Zach Brown <zab@zabbo.net>, Takashi Iwai <tiwai@suse.de>");39MODULE_AUTHOR("Zach Brown <zab@zabbo.net>, Takashi Iwai <tiwai@suse.de>");
40MODULE_DESCRIPTION("ESS Maestro3 PCI");40MODULE_DESCRIPTION("ESS Maestro3 PCI");
41MODULE_LICENSE("GPL");41MODULE_LICENSE("GPL");
42MODULE_SUPPORTED_DEVICE("{{ESS,Maestro3 PCI},"
43 "{ESS,ES1988},"
44 "{ESS,Allegro PCI},"
45 "{ESS,Allegro-1 PCI},"
46 "{ESS,Canyon3D-2/LE PCI}}");
47MODULE_FIRMWARE("ess/maestro3_assp_kernel.fw");42MODULE_FIRMWARE("ess/maestro3_assp_kernel.fw");
48MODULE_FIRMWARE("ess/maestro3_assp_minisrc.fw");43MODULE_FIRMWARE("ess/maestro3_assp_minisrc.fw");
49 44
sound/pci/mixart/mixart.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
32MODULE_AUTHOR("Digigram <alsa@digigram.com>");32MODULE_AUTHOR("Digigram <alsa@digigram.com>");
33MODULE_DESCRIPTION("Digigram " CARD_NAME);33MODULE_DESCRIPTION("Digigram " CARD_NAME);
34MODULE_LICENSE("GPL");34MODULE_LICENSE("GPL");
35MODULE_SUPPORTED_DEVICE("{{Digigram," CARD_NAME "}}");
36 35
37static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */36static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
38static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */37static 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
32MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");32MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
33MODULE_DESCRIPTION("NeoMagic NM256AV/ZX");33MODULE_DESCRIPTION("NeoMagic NM256AV/ZX");
34MODULE_LICENSE("GPL");34MODULE_LICENSE("GPL");
35MODULE_SUPPORTED_DEVICE("{{NeoMagic,NM256AV},"
36 "{NeoMagic,NM256ZX}}");
37 35
38/*36/*
39 * some compile conditions.37 * some compile conditions.
sound/pci/oxygen/oxygen.c+0−3
@@ -56,9 +56,6 @@ · 55 unmodified lines
56MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");56MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
57MODULE_DESCRIPTION("C-Media CMI8788 driver");57MODULE_DESCRIPTION("C-Media CMI8788 driver");
58MODULE_LICENSE("GPL v2");58MODULE_LICENSE("GPL v2");
59MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8786}"
60 ",{C-Media,CMI8787}"
61 ",{C-Media,CMI8788}}");
62 59
63static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;60static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
64static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;61static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/pci/oxygen/se6x.c+0−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
29MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");29MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
30MODULE_DESCRIPTION("Studio Evolution SE6X driver");30MODULE_DESCRIPTION("Studio Evolution SE6X driver");
31MODULE_LICENSE("GPL v2");31MODULE_LICENSE("GPL v2");
32MODULE_SUPPORTED_DEVICE("{{Studio Evolution,SE6X}}");
33 32
34static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;33static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
35static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;34static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
sound/pci/oxygen/virtuoso.c+0−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
16MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");16MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
17MODULE_DESCRIPTION("Asus Virtuoso driver");17MODULE_DESCRIPTION("Asus Virtuoso driver");
18MODULE_LICENSE("GPL v2");18MODULE_LICENSE("GPL v2");
19MODULE_SUPPORTED_DEVICE("{{Asus,AV66},{Asus,AV100},{Asus,AV200}}");
20 19
21static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;20static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
22static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;21static 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
35 "Marc Titinger <titinger@digigram.com>");35 "Marc Titinger <titinger@digigram.com>");
36MODULE_DESCRIPTION("Digigram " DRIVER_NAME " " PCXHR_DRIVER_VERSION_STRING);36MODULE_DESCRIPTION("Digigram " DRIVER_NAME " " PCXHR_DRIVER_VERSION_STRING);
37MODULE_LICENSE("GPL");37MODULE_LICENSE("GPL");
38MODULE_SUPPORTED_DEVICE("{{Digigram," DRIVER_NAME "}}");
39 38
40static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */39static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
41static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */40static 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
103MODULE_AUTHOR("Peter Gruber <nokos@gmx.net>");103MODULE_AUTHOR("Peter Gruber <nokos@gmx.net>");
104MODULE_DESCRIPTION("riptide");104MODULE_DESCRIPTION("riptide");
105MODULE_LICENSE("GPL");105MODULE_LICENSE("GPL");
106MODULE_SUPPORTED_DEVICE("{{Conexant,Riptide}}");
107MODULE_FIRMWARE("riptide.hex");106MODULE_FIRMWARE("riptide.hex");
108 107
109static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;108static 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
88MODULE_AUTHOR("Martin Langer <martin-langer@gmx.de>, Pilo Chambert <pilo.c@wanadoo.fr>");88MODULE_AUTHOR("Martin Langer <martin-langer@gmx.de>, Pilo Chambert <pilo.c@wanadoo.fr>");
89MODULE_DESCRIPTION("RME Digi32, Digi32/8, Digi32 PRO");89MODULE_DESCRIPTION("RME Digi32, Digi32/8, Digi32 PRO");
90MODULE_LICENSE("GPL");90MODULE_LICENSE("GPL");
91MODULE_SUPPORTED_DEVICE("{{RME,Digi32}," "{RME,Digi32/8}," "{RME,Digi32 PRO}}");
92 91
93/* Defines for RME Digi32 series */92/* Defines for RME Digi32 series */
94#define RME32_SPDIF_NCHANNELS 293#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
31MODULE_DESCRIPTION("RME Digi96, Digi96/8, Digi96/8 PRO, Digi96/8 PST, "31MODULE_DESCRIPTION("RME Digi96, Digi96/8, Digi96/8 PRO, Digi96/8 PST, "
32 "Digi96/8 PAD");32 "Digi96/8 PAD");
33MODULE_LICENSE("GPL");33MODULE_LICENSE("GPL");
34MODULE_SUPPORTED_DEVICE("{{RME,Digi96},"
35 "{RME,Digi96/8},"
36 "{RME,Digi96/8 PRO},"
37 "{RME,Digi96/8 PST},"
38 "{RME,Digi96/8 PAD}}");
39 34
40static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */35static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
41static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */36static 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
44MODULE_AUTHOR("Paul Davis <paul@linuxaudiosystems.com>, Marcus Andersson, Thomas Charbonnel <thomas@undata.org>");44MODULE_AUTHOR("Paul Davis <paul@linuxaudiosystems.com>, Marcus Andersson, Thomas Charbonnel <thomas@undata.org>");
45MODULE_DESCRIPTION("RME Hammerfall DSP");45MODULE_DESCRIPTION("RME Hammerfall DSP");
46MODULE_LICENSE("GPL");46MODULE_LICENSE("GPL");
47MODULE_SUPPORTED_DEVICE("{{RME Hammerfall-DSP},"
48 "{RME HDSP-9652},"
49 "{RME HDSP-9632}}");
50MODULE_FIRMWARE("rpm_firmware.bin");47MODULE_FIRMWARE("rpm_firmware.bin");
51MODULE_FIRMWARE("multiface_firmware.bin");48MODULE_FIRMWARE("multiface_firmware.bin");
52MODULE_FIRMWARE("multiface_firmware_rev11.bin");49MODULE_FIRMWARE("multiface_firmware_rev11.bin");
sound/pci/rme9652/hdspm.c+0−1
@@ -165,7 +165,6 @@ MODULE_AUTHOR · 164 unmodified lines
165);165);
166MODULE_DESCRIPTION("RME HDSPM");166MODULE_DESCRIPTION("RME HDSPM");
167MODULE_LICENSE("GPL");167MODULE_LICENSE("GPL");
168MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
169 168
170/* --- Write registers. ---169/* --- Write registers. ---
171 These are defined as byte-offsets from the iobase value. */170 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
39MODULE_AUTHOR("Paul Davis <pbd@op.net>, Winfried Ritsch");39MODULE_AUTHOR("Paul Davis <pbd@op.net>, Winfried Ritsch");
40MODULE_DESCRIPTION("RME Digi9652/Digi9636");40MODULE_DESCRIPTION("RME Digi9652/Digi9636");
41MODULE_LICENSE("GPL");41MODULE_LICENSE("GPL");
42MODULE_SUPPORTED_DEVICE("{{RME,Hammerfall},"
43 "{RME,Hammerfall-Light}}");
44 42
45/* The Hammerfall has two sets of 24 ADAT + 2 S/PDIF channels, one for43/* The Hammerfall has two sets of 24 ADAT + 2 S/PDIF channels, one for
46 capture, one for playback. Both the ADAT and S/PDIF channels appear44 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
24MODULE_AUTHOR("David Dillow <dave@thedillows.org>");24MODULE_AUTHOR("David Dillow <dave@thedillows.org>");
25MODULE_DESCRIPTION("SiS7019");25MODULE_DESCRIPTION("SiS7019");
26MODULE_LICENSE("GPL");26MODULE_LICENSE("GPL");
27MODULE_SUPPORTED_DEVICE("{{SiS,SiS7019 Audio Accelerator}}");
28 27
29static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */28static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
30static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */29static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/sonicvibes.c+0−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
29MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");29MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
30MODULE_DESCRIPTION("S3 SonicVibes PCI");30MODULE_DESCRIPTION("S3 SonicVibes PCI");
31MODULE_LICENSE("GPL");31MODULE_LICENSE("GPL");
32MODULE_SUPPORTED_DEVICE("{{S3,SonicVibes PCI}}");
33 32
34#if IS_REACHABLE(CONFIG_GAMEPORT)33#if IS_REACHABLE(CONFIG_GAMEPORT)
35#define SUPPORT_JOYSTICK 134#define SUPPORT_JOYSTICK 1
sound/pci/trident/trident.c+0−12
@@ -17,18 +17,6 @@ · 16 unmodified lines
17MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, <audio@tridentmicro.com>");17MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, <audio@tridentmicro.com>");
18MODULE_DESCRIPTION("Trident 4D-WaveDX/NX & SiS SI7018");18MODULE_DESCRIPTION("Trident 4D-WaveDX/NX & SiS SI7018");
19MODULE_LICENSE("GPL");19MODULE_LICENSE("GPL");
20MODULE_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}}");
32 20
33static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */21static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
34static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */22static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/pci/via82xx.c+0−1
@@ -56,7 +56,6 @@ · 55 unmodified lines
56MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");56MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
57MODULE_DESCRIPTION("VIA VT82xx audio");57MODULE_DESCRIPTION("VIA VT82xx audio");
58MODULE_LICENSE("GPL");58MODULE_LICENSE("GPL");
59MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C,pci},{VIA,VT8233A/C,8235}}");
60 59
61#if IS_REACHABLE(CONFIG_GAMEPORT)60#if IS_REACHABLE(CONFIG_GAMEPORT)
62#define SUPPORT_JOYSTICK 161#define SUPPORT_JOYSTICK 1
sound/pci/via82xx_modem.c+0−1
@@ -38,7 +38,6 @@ · 37 unmodified lines
38MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");38MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
39MODULE_DESCRIPTION("VIA VT82xx modem");39MODULE_DESCRIPTION("VIA VT82xx modem");
40MODULE_LICENSE("GPL");40MODULE_LICENSE("GPL");
41MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C modem,pci}}");
42 41
43static int index = -2; /* Exclude the first card */42static int index = -2; /* Exclude the first card */
44static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */43static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
sound/pci/vx222/vx222.c+0−1
@@ -20,7 +20,6 @@ · 19 unmodified lines
20MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");20MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
21MODULE_DESCRIPTION("Digigram VX222 V2/Mic");21MODULE_DESCRIPTION("Digigram VX222 V2/Mic");
22MODULE_LICENSE("GPL");22MODULE_LICENSE("GPL");
23MODULE_SUPPORTED_DEVICE("{{Digigram," CARD_NAME "}}");
24 23
25static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */24static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
26static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */25static 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
17MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");17MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
18MODULE_DESCRIPTION("Yamaha DS-1 PCI");18MODULE_DESCRIPTION("Yamaha DS-1 PCI");
19MODULE_LICENSE("GPL");19MODULE_LICENSE("GPL");
20MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF724},"
21 "{Yamaha,YMF724F},"
22 "{Yamaha,YMF740},"
23 "{Yamaha,YMF740C},"
24 "{Yamaha,YMF744},"
25 "{Yamaha,YMF754}}");
26 20
27static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */21static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
28static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */22static 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
22MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");22MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
23MODULE_DESCRIPTION("Sound Core " CARD_NAME);23MODULE_DESCRIPTION("Sound Core " CARD_NAME);
24MODULE_LICENSE("GPL");24MODULE_LICENSE("GPL");
25MODULE_SUPPORTED_DEVICE("{{Sound Core," CARD_NAME "}}");
26 25
27static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */26static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
28static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */27static 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
17#include <sound/initval.h>17#include <sound/initval.h>
18#include <sound/tlv.h>18#include <sound/tlv.h>
19 19
20/*
21 */
22
23MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");20MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
24MODULE_DESCRIPTION("Digigram VXPocket");21MODULE_DESCRIPTION("Digigram VXPocket");
25MODULE_LICENSE("GPL");22MODULE_LICENSE("GPL");
26MODULE_SUPPORTED_DEVICE("{{Digigram,VXPocket},{Digigram,VXPocket440}}");
27 23
28static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */24static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
29static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */25static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
sound/ppc/powermac.c+0−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
18#define CHIP_NAME "PMac"18#define CHIP_NAME "PMac"
19 19
20MODULE_DESCRIPTION("PowerMac");20MODULE_DESCRIPTION("PowerMac");
21MODULE_SUPPORTED_DEVICE("{{Apple,PowerMac}}");
22MODULE_LICENSE("GPL");21MODULE_LICENSE("GPL");
23 22
24static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */23static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
sound/sh/aica.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
32MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");32MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");
33MODULE_DESCRIPTION("Dreamcast AICA sound (pcm) driver");33MODULE_DESCRIPTION("Dreamcast AICA sound (pcm) driver");
34MODULE_LICENSE("GPL");34MODULE_LICENSE("GPL");
35MODULE_SUPPORTED_DEVICE("{{Yamaha/SEGA, AICA}}");
36MODULE_FIRMWARE("aica_firmware.bin");35MODULE_FIRMWARE("aica_firmware.bin");
37 36
38/* module parameters */37/* module parameters */
sound/sh/sh_dac_audio.c+0−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
25MODULE_AUTHOR("Rafael Ignacio Zurita <rizurita@yahoo.com>");25MODULE_AUTHOR("Rafael Ignacio Zurita <rizurita@yahoo.com>");
26MODULE_DESCRIPTION("SuperH DAC audio driver");26MODULE_DESCRIPTION("SuperH DAC audio driver");
27MODULE_LICENSE("GPL");27MODULE_LICENSE("GPL");
28MODULE_SUPPORTED_DEVICE("{{SuperH DAC audio support}}");
29 28
30/* Module Parameters */29/* Module Parameters */
31static int index = SNDRV_DEFAULT_IDX1;30static int index = SNDRV_DEFAULT_IDX1;
sound/soc/codecs/Kconfig+0−5
@@ -186,7 +186,6 @@ config SND_SOC_ALL_CODECS · 185 unmodified lines
186 imply SND_SOC_SI476X186 imply SND_SOC_SI476X
187 imply SND_SOC_SIMPLE_AMPLIFIER187 imply SND_SOC_SIMPLE_AMPLIFIER
188 imply SND_SOC_SIMPLE_MUX188 imply SND_SOC_SIMPLE_MUX
189 imply SND_SOC_SIRF_AUDIO_CODEC
190 imply SND_SOC_SPDIF189 imply SND_SOC_SPDIF
191 imply SND_SOC_SSM2305190 imply SND_SOC_SSM2305
192 imply SND_SOC_SSM2518191 imply SND_SOC_SSM2518
@@ -1279,10 +1278,6 @@ config SND_SOC_SIMPLE_MUX · 1086 unmodified lines
1279 tristate "Simple Audio Mux"1278 tristate "Simple Audio Mux"
1280 select GPIOLIB1279 select GPIOLIB
1281 1280
1282config SND_SOC_SIRF_AUDIO_CODEC
1283 tristate "SiRF SoC internal audio codec"
1284 select REGMAP_MMIO
1285
1286config SND_SOC_SPDIF1281config SND_SOC_SPDIF
1287 tristate "S/PDIF CODEC"1282 tristate "S/PDIF CODEC"
1288 1283
sound/soc/codecs/ak4458.c+1−0
@@ -812,6 +812,7 @@ static const struct of_device_id ak4458_of_match[] = { · 811 unmodified lines
812 { .compatible = "asahi-kasei,ak4497", .data = &ak4497_drvdata},812 { .compatible = "asahi-kasei,ak4497", .data = &ak4497_drvdata},
813 { },813 { },
814};814};
815MODULE_DEVICE_TABLE(of, ak4458_of_match);
815 816
816static struct i2c_driver ak4458_i2c_driver = {817static struct i2c_driver ak4458_i2c_driver = {
817 .driver = {818 .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
419 { .compatible = "asahi-kasei,ak5558"},419 { .compatible = "asahi-kasei,ak5558"},
420 { }420 { }
421};421};
422MODULE_DEVICE_TABLE(of, ak5558_i2c_dt_ids);
422 423
423static struct i2c_driver ak5558_i2c_driver = {424static struct i2c_driver ak5558_i2c_driver = {
424 .driver = {425 .driver = {
sound/soc/codecs/cs42l42.c+34−78
@@ -401,7 +401,7 @@ static const struct regmap_config cs42l42_regmap = { · 400 unmodified lines
401};401};
402 402
403static DECLARE_TLV_DB_SCALE(adc_tlv, -9600, 100, false);403static DECLARE_TLV_DB_SCALE(adc_tlv, -9600, 100, false);
404static DECLARE_TLV_DB_SCALE(mixer_tlv, -6200, 100, false);404static DECLARE_TLV_DB_SCALE(mixer_tlv, -6300, 100, true);
405 405
406static const char * const cs42l42_hpf_freq_text[] = {406static const char * const cs42l42_hpf_freq_text[] = {
407 "1.86Hz", "120Hz", "235Hz", "466Hz"407 "1.86Hz", "120Hz", "235Hz", "466Hz"
@@ -458,7 +458,7 @@ static const struct snd_kcontrol_new cs42l42_snd_controls[] = { · 50 unmodified lines
458 CS42L42_DAC_HPF_EN_SHIFT, true, false),458 CS42L42_DAC_HPF_EN_SHIFT, true, false),
459 SOC_DOUBLE_R_TLV("Mixer Volume", CS42L42_MIXER_CHA_VOL,459 SOC_DOUBLE_R_TLV("Mixer Volume", CS42L42_MIXER_CHA_VOL,
460 CS42L42_MIXER_CHB_VOL, CS42L42_MIXER_CH_VOL_SHIFT,460 CS42L42_MIXER_CHB_VOL, CS42L42_MIXER_CH_VOL_SHIFT,
461 0x3e, 1, mixer_tlv)461 0x3f, 1, mixer_tlv)
462};462};
463 463
464static int cs42l42_hpdrv_evt(struct snd_soc_dapm_widget *w,464static 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
511 {"HP", NULL, "HPDRV"}511 {"HP", NULL, "HPDRV"}
512};512};
513 513
514static 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
551static int cs42l42_component_probe(struct snd_soc_component *component)514static int cs42l42_component_probe(struct snd_soc_component *component)
552{515{
553 struct cs42l42_private *cs42l42 =516 struct cs42l42_private *cs42l42 =
@@ -560,7 +523,6 @@ static int cs42l42_component_probe(struct snd_soc_component *component) · 6 unmodified lines
560 523
561static const struct snd_soc_component_driver soc_component_dev_cs42l42 = {524static const struct snd_soc_component_driver soc_component_dev_cs42l42 = {
562 .probe = cs42l42_component_probe,525 .probe = cs42l42_component_probe,
563 .set_bias_level = cs42l42_set_bias_level,
564 .dapm_widgets = cs42l42_dapm_widgets,526 .dapm_widgets = cs42l42_dapm_widgets,
565 .num_dapm_widgets = ARRAY_SIZE(cs42l42_dapm_widgets),527 .num_dapm_widgets = ARRAY_SIZE(cs42l42_dapm_widgets),
566 .dapm_routes = cs42l42_audio_map,528 .dapm_routes = cs42l42_audio_map,
@@ -691,24 +653,6 @@ static int cs42l42_pll_config(struct snd_soc_component *component) · 124 unmodified lines
691 CS42L42_CLK_OASRC_SEL_MASK,653 CS42L42_CLK_OASRC_SEL_MASK,
692 CS42L42_CLK_OASRC_SEL_12 <<654 CS42L42_CLK_OASRC_SEL_12 <<
693 CS42L42_CLK_OASRC_SEL_SHIFT);655 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));
712 if (pll_ratio_table[i].mclk_src_sel == 0) {656 if (pll_ratio_table[i].mclk_src_sel == 0) {
713 /* Pass the clock straight through */657 /* Pass the clock straight through */
714 snd_soc_component_update_bits(component,658 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
797 /* Bitclock/frame inversion */741 /* Bitclock/frame inversion */
798 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {742 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
799 case SND_SOC_DAIFMT_NB_NF:743 case SND_SOC_DAIFMT_NB_NF:
744 asp_cfg_val |= CS42L42_ASP_SCPOL_NOR << CS42L42_ASP_SCPOL_SHIFT;
800 break;745 break;
801 case SND_SOC_DAIFMT_NB_IF:746 case SND_SOC_DAIFMT_NB_IF:
802 asp_cfg_val |= CS42L42_ASP_POL_INV <<747 asp_cfg_val |= CS42L42_ASP_SCPOL_NOR << CS42L42_ASP_SCPOL_SHIFT;
803 CS42L42_ASP_LCPOL_IN_SHIFT;748 asp_cfg_val |= CS42L42_ASP_LCPOL_INV << CS42L42_ASP_LCPOL_SHIFT;
804 break;749 break;
805 case SND_SOC_DAIFMT_IB_NF:750 case SND_SOC_DAIFMT_IB_NF:
806 asp_cfg_val |= CS42L42_ASP_POL_INV <<
807 CS42L42_ASP_SCPOL_IN_DAC_SHIFT;
808 break;751 break;
809 case SND_SOC_DAIFMT_IB_IF:752 case SND_SOC_DAIFMT_IB_IF:
810 asp_cfg_val |= CS42L42_ASP_POL_INV <<753 asp_cfg_val |= CS42L42_ASP_LCPOL_INV << CS42L42_ASP_LCPOL_SHIFT;
811 CS42L42_ASP_LCPOL_IN_SHIFT;
812 asp_cfg_val |= CS42L42_ASP_POL_INV <<
813 CS42L42_ASP_SCPOL_IN_DAC_SHIFT;
814 break;754 break;
815 }755 }
816 756
817 snd_soc_component_update_bits(component, CS42L42_ASP_CLK_CFG,757 snd_soc_component_update_bits(component, CS42L42_ASP_CLK_CFG, CS42L42_ASP_MODE_MASK |
818 CS42L42_ASP_MODE_MASK |758 CS42L42_ASP_SCPOL_MASK |
819 CS42L42_ASP_SCPOL_IN_DAC_MASK |759 CS42L42_ASP_LCPOL_MASK,
820 CS42L42_ASP_LCPOL_IN_MASK, asp_cfg_val);760 asp_cfg_val);
821 761
822 return 0;762 return 0;
823}763}
@@ -828,14 +768,29 @@ static int cs42l42_pcm_hw_params(struct snd_pcm_substream *substream, · 4 unmodified lines
828{768{
829 struct snd_soc_component *component = dai->component;769 struct snd_soc_component *component = dai->component;
830 struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component);770 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;
832 773
833 cs42l42->srate = params_rate(params);774 cs42l42->srate = params_rate(params);
834 cs42l42->swidth = params_width(params);
835 775
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 }
837 792
838 return retval;793 return cs42l42_pll_config(component);
839}794}
840 795
841static int cs42l42_set_sysclk(struct snd_soc_dai *dai,796static 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
900 return 0;855 return 0;
901}856}
902 857
903#define CS42L42_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE | \858#define CS42L42_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
904 SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE | \859 SNDRV_PCM_FMTBIT_S24_LE |\
905 SNDRV_PCM_FMTBIT_S32_LE)860 SNDRV_PCM_FMTBIT_S32_LE )
906 861
907 862
908static const struct snd_soc_dai_ops cs42l42_ops = {863static 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
1801 dev_dbg(&i2c_client->dev, "Found reset GPIO\n");1756 dev_dbg(&i2c_client->dev, "Found reset GPIO\n");
1802 gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);1757 gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
1803 }1758 }
1804 mdelay(3);1759 usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2);
1805 1760
1806 /* Request IRQ */1761 /* Request IRQ */
1807 ret = devm_request_threaded_irq(&i2c_client->dev,1762 ret = devm_request_threaded_irq(&i2c_client->dev,
@@ -1926,6 +1881,7 @@ static int cs42l42_runtime_resume(struct device *dev) · 118 unmodified lines
1926 }1881 }
1927 1882
1928 gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);1883 gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
1884 usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2);
1929 1885
1930 regcache_cache_only(cs42l42->regmap, false);1886 regcache_cache_only(cs42l42->regmap, false);
1931 regcache_sync(cs42l42->regmap);1887 regcache_sync(cs42l42->regmap);
sound/soc/codecs/cs42l42.h+7−6
@@ -258,11 +258,12 @@ · 257 unmodified lines
258#define CS42L42_ASP_SLAVE_MODE 0x00258#define CS42L42_ASP_SLAVE_MODE 0x00
259#define CS42L42_ASP_MODE_SHIFT 4259#define CS42L42_ASP_MODE_SHIFT 4
260#define CS42L42_ASP_MODE_MASK (1 << CS42L42_ASP_MODE_SHIFT)260#define CS42L42_ASP_MODE_MASK (1 << CS42L42_ASP_MODE_SHIFT)
261#define CS42L42_ASP_SCPOL_IN_DAC_SHIFT 2261#define CS42L42_ASP_SCPOL_SHIFT 2
262#define CS42L42_ASP_SCPOL_IN_DAC_MASK (1 << CS42L42_ASP_SCPOL_IN_DAC_SHIFT)262#define CS42L42_ASP_SCPOL_MASK (3 << CS42L42_ASP_SCPOL_SHIFT)
263#define CS42L42_ASP_LCPOL_IN_SHIFT 0263#define CS42L42_ASP_SCPOL_NOR 3
264#define CS42L42_ASP_LCPOL_IN_MASK (1 << CS42L42_ASP_LCPOL_IN_SHIFT)264#define CS42L42_ASP_LCPOL_SHIFT 0
265#define CS42L42_ASP_POL_INV 1265#define CS42L42_ASP_LCPOL_MASK (3 << CS42L42_ASP_LCPOL_SHIFT)
266#define CS42L42_ASP_LCPOL_INV 3
266 267
267#define CS42L42_ASP_FRM_CFG (CS42L42_PAGE_12 + 0x08)268#define CS42L42_ASP_FRM_CFG (CS42L42_PAGE_12 + 0x08)
268#define CS42L42_ASP_STP_SHIFT 4269#define CS42L42_ASP_STP_SHIFT 4
@@ -739,6 +740,7 @@ · 470 unmodified lines
739#define CS42L42_FRAC2_VAL(val) (((val) & 0xff0000) >> 16)740#define CS42L42_FRAC2_VAL(val) (((val) & 0xff0000) >> 16)
740 741
741#define CS42L42_NUM_SUPPLIES 5742#define CS42L42_NUM_SUPPLIES 5
743#define CS42L42_BOOT_TIME_US 3000
742 744
743static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] = {745static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] = {
744 "VA",746 "VA",
@@ -756,7 +758,6 @@ struct cs42l42_private { · 11 unmodified lines
756 struct completion pdn_done;758 struct completion pdn_done;
757 u32 sclk;759 u32 sclk;
758 u32 srate;760 u32 srate;
759 u32 swidth;
760 u8 plug_state;761 u8 plug_state;
761 u8 hs_type;762 u8 hs_type;
762 u8 ts_inv;763 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
63 1, 1, TLV_DB_SCALE_ITEM(0, 0, 0),63 1, 1, TLV_DB_SCALE_ITEM(0, 0, 0),
64 2, 2, TLV_DB_SCALE_ITEM(250, 0, 0),64 2, 2, TLV_DB_SCALE_ITEM(250, 0, 0),
65 3, 3, TLV_DB_SCALE_ITEM(450, 0, 0),65 3, 3, TLV_DB_SCALE_ITEM(450, 0, 0),
66 4, 4, TLV_DB_SCALE_ITEM(700, 0, 0),66 4, 7, TLV_DB_SCALE_ITEM(700, 300, 0),
67 5, 5, TLV_DB_SCALE_ITEM(1000, 0, 0),67 8, 10, TLV_DB_SCALE_ITEM(1800, 300, 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),
73);68);
74 69
75static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(hpout_vol_tlv,70static 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
2895{2895{
2896 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);2896 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
2897 u16 val, ec_hq_reg;2897 u16 val, ec_hq_reg;
2898 int ec_tx;2898 int ec_tx = -1;
2899 2899
2900 val = snd_soc_component_read(component,2900 val = snd_soc_component_read(component,
2901 CDC_RX_INP_MUX_RX_MIX_CFG4);2901 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
189 struct device *dev;189 struct device *dev;
190 unsigned long active_ch_mask[VA_MACRO_MAX_DAIS];190 unsigned long active_ch_mask[VA_MACRO_MAX_DAIS];
191 unsigned long active_ch_cnt[VA_MACRO_MAX_DAIS];191 unsigned long active_ch_cnt[VA_MACRO_MAX_DAIS];
192 unsigned long active_decimator[VA_MACRO_MAX_DAIS];
193 u16 dmic_clk_div;192 u16 dmic_clk_div;
194 193
195 int dec_mode[VA_MACRO_NUM_DECIMATORS];194 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
549 if (enable) {548 if (enable) {
550 set_bit(dec_id, &va->active_ch_mask[dai_id]);549 set_bit(dec_id, &va->active_ch_mask[dai_id]);
551 va->active_ch_cnt[dai_id]++;550 va->active_ch_cnt[dai_id]++;
552 va->active_decimator[dai_id] = dec_id;
553 } else {551 } else {
554 clear_bit(dec_id, &va->active_ch_mask[dai_id]);552 clear_bit(dec_id, &va->active_ch_mask[dai_id]);
555 va->active_ch_cnt[dai_id]--;553 va->active_ch_cnt[dai_id]--;
556 va->active_decimator[dai_id] = -1;
557 }554 }
558 555
559 snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, enable, update);556 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
880 struct va_macro *va = snd_soc_component_get_drvdata(component);877 struct va_macro *va = snd_soc_component_get_drvdata(component);
881 u16 tx_vol_ctl_reg, decimator;878 u16 tx_vol_ctl_reg, decimator;
882 879
883 decimator = va->active_decimator[dai->id];880 for_each_set_bit(decimator, &va->active_ch_mask[dai->id],
884 881 VA_MACRO_DEC_MAX) {
885 tx_vol_ctl_reg = CDC_VA_TX0_TX_PATH_CTL +882 tx_vol_ctl_reg = CDC_VA_TX0_TX_PATH_CTL +
886 VA_MACRO_TX_PATH_OFFSET * decimator;883 VA_MACRO_TX_PATH_OFFSET * decimator;
887 if (mute)884 if (mute)
888 snd_soc_component_update_bits(component, tx_vol_ctl_reg,885 snd_soc_component_update_bits(component, tx_vol_ctl_reg,
889 CDC_VA_TX_PATH_PGA_MUTE_EN_MASK,886 CDC_VA_TX_PATH_PGA_MUTE_EN_MASK,
890 CDC_VA_TX_PATH_PGA_MUTE_EN);887 CDC_VA_TX_PATH_PGA_MUTE_EN);
891 else888 else
892 snd_soc_component_update_bits(component, tx_vol_ctl_reg,889 snd_soc_component_update_bits(component, tx_vol_ctl_reg,
893 CDC_VA_TX_PATH_PGA_MUTE_EN_MASK,890 CDC_VA_TX_PATH_PGA_MUTE_EN_MASK,
894 CDC_VA_TX_PATH_PGA_MUTE_DISABLE);891 CDC_VA_TX_PATH_PGA_MUTE_DISABLE);
892 }
895 893
896 return 0;894 return 0;
897}895}
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
1211 struct snd_kcontrol *kcontrol, int event)1211 struct snd_kcontrol *kcontrol, int event)
1212{1212{
1213 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);1213 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
1214 u16 gain_reg;1214 u16 path_reg, gain_reg;
1215 int val;1215 int val;
1216 1216
1217 switch (w->reg) {1217 switch (w->shift) {
1218 case CDC_WSA_RX0_RX_PATH_MIX_CTL:1218 case WSA_MACRO_RX_MIX0:
1219 path_reg = CDC_WSA_RX0_RX_PATH_MIX_CTL;
1219 gain_reg = CDC_WSA_RX0_RX_VOL_MIX_CTL;1220 gain_reg = CDC_WSA_RX0_RX_VOL_MIX_CTL;
1220 break;1221 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;
1222 gain_reg = CDC_WSA_RX1_RX_VOL_MIX_CTL;1224 gain_reg = CDC_WSA_RX1_RX_VOL_MIX_CTL;
1223 break;1225 break;
1224 default:1226 default:
@@ -1231,7 +1233,7 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w, · 6 unmodified lines
1231 snd_soc_component_write(component, gain_reg, val);1233 snd_soc_component_write(component, gain_reg, val);
1232 break;1234 break;
1233 case SND_SOC_DAPM_POST_PMD:1235 case SND_SOC_DAPM_POST_PMD:
1234 snd_soc_component_update_bits(component, w->reg,1236 snd_soc_component_update_bits(component, path_reg,
1235 CDC_WSA_RX_PATH_MIX_CLK_EN_MASK,1237 CDC_WSA_RX_PATH_MIX_CLK_EN_MASK,
1236 CDC_WSA_RX_PATH_MIX_CLK_DISABLE);1238 CDC_WSA_RX_PATH_MIX_CLK_DISABLE);
1237 break;1239 break;
@@ -2068,14 +2070,14 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets[] = { · 830 unmodified lines
2068 SND_SOC_DAPM_MUX("WSA_RX0 INP0", SND_SOC_NOPM, 0, 0, &rx0_prim_inp0_mux),2070 SND_SOC_DAPM_MUX("WSA_RX0 INP0", SND_SOC_NOPM, 0, 0, &rx0_prim_inp0_mux),
2069 SND_SOC_DAPM_MUX("WSA_RX0 INP1", SND_SOC_NOPM, 0, 0, &rx0_prim_inp1_mux),2071 SND_SOC_DAPM_MUX("WSA_RX0 INP1", SND_SOC_NOPM, 0, 0, &rx0_prim_inp1_mux),
2070 SND_SOC_DAPM_MUX("WSA_RX0 INP2", SND_SOC_NOPM, 0, 0, &rx0_prim_inp2_mux),2072 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,2073 SND_SOC_DAPM_MUX_E("WSA_RX0 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX0,
2072 0, 0, &rx0_mix_mux, wsa_macro_enable_mix_path,2074 0, &rx0_mix_mux, wsa_macro_enable_mix_path,
2073 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),2075 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
2074 SND_SOC_DAPM_MUX("WSA_RX1 INP0", SND_SOC_NOPM, 0, 0, &rx1_prim_inp0_mux),2076 SND_SOC_DAPM_MUX("WSA_RX1 INP0", SND_SOC_NOPM, 0, 0, &rx1_prim_inp0_mux),
2075 SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux),2077 SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux),
2076 SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux),2078 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,2079 SND_SOC_DAPM_MUX_E("WSA_RX1 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX1,
2078 0, 0, &rx1_mix_mux, wsa_macro_enable_mix_path,2080 0, &rx1_mix_mux, wsa_macro_enable_mix_path,
2079 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),2081 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
2080 2082
2081 SND_SOC_DAPM_MIXER_E("WSA_RX INT0 MIX", SND_SOC_NOPM, 0, 0, NULL, 0,2083 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
209 case RT1015_VENDOR_ID:209 case RT1015_VENDOR_ID:
210 case RT1015_DEVICE_ID:210 case RT1015_DEVICE_ID:
211 case RT1015_PRO_ALT:211 case RT1015_PRO_ALT:
212 case RT1015_MAN_I2C:
212 case RT1015_DAC3:213 case RT1015_DAC3:
213 case RT1015_VBAT_TEST_OUT1:214 case RT1015_VBAT_TEST_OUT1:
214 case RT1015_VBAT_TEST_OUT2:215 case RT1015_VBAT_TEST_OUT2:
@@ -513,6 +514,7 @@ static void rt1015_calibrate(struct rt1015_priv *rt1015) · 298 unmodified lines
513 msleep(300);514 msleep(300);
514 regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0008);515 regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0008);
515 regmap_write(regmap, RT1015_SYS_RST1, 0x05F5);516 regmap_write(regmap, RT1015_SYS_RST1, 0x05F5);
517 regmap_write(regmap, RT1015_CLK_DET, 0x8000);
516 518
517 regcache_cache_bypass(regmap, false);519 regcache_cache_bypass(regmap, false);
518 regcache_mark_dirty(regmap);520 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
339}339}
340 340
341static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);341static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
342static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0);342static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0);
343static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);343static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
344static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);344static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000);
345static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);345static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
346 346
347/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */347/* {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
285}285}
286 286
287static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);287static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
288static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0);288static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0);
289static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);289static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
290static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);290static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000);
291static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);291static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
292 292
293/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */293/* {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
3426{3426{
3427 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component);3427 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component);
3428 unsigned int reg_val = 0;3428 unsigned int reg_val = 0;
3429 int ret;
3429 3430
3430 if (freq == rt5659->sysclk && clk_id == rt5659->sysclk_src)3431 if (freq == rt5659->sysclk && clk_id == rt5659->sysclk_src)
3431 return 0;3432 return 0;
3432 3433
3433 switch (clk_id) {3434 switch (clk_id) {
3434 case RT5659_SCLK_S_MCLK:3435 case RT5659_SCLK_S_MCLK:
3436 ret = clk_set_rate(rt5659->mclk, freq);
3437 if (ret)
3438 return ret;
3439
3435 reg_val |= RT5659_SCLK_SRC_MCLK;3440 reg_val |= RT5659_SCLK_SRC_MCLK;
3436 break;3441 break;
3437 case RT5659_SCLK_S_PLL1:3442 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
629static SOC_ENUM_SINGLE_DECL(rt5670_if2_adc_enum, RT5670_DIG_INF1_DATA,629static SOC_ENUM_SINGLE_DECL(rt5670_if2_adc_enum, RT5670_DIG_INF1_DATA,
630 RT5670_IF2_ADC_SEL_SFT, rt5670_data_select);630 RT5670_IF2_ADC_SEL_SFT, rt5670_data_select);
631 631
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 */
638static 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
652static 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
664static 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
632static const struct snd_kcontrol_new rt5670_snd_controls[] = {682static const struct snd_kcontrol_new rt5670_snd_controls[] = {
633 /* Headphone Output Volume */683 /* Headphone Output Volume */
634 SOC_DOUBLE("HP Playback Switch", RT5670_HP_VOL,
635 RT5670_L_MUTE_SFT, RT5670_R_MUTE_SFT, 1, 1),
636 SOC_DOUBLE_TLV("HP Playback Volume", RT5670_HP_VOL,684 SOC_DOUBLE_TLV("HP Playback Volume", RT5670_HP_VOL,
637 RT5670_L_VOL_SFT, RT5670_R_VOL_SFT,685 RT5670_L_VOL_SFT, RT5670_R_VOL_SFT,
638 39, 1, out_vol_tlv),686 39, 1, out_vol_tlv),
639 /* OUTPUT Control */687 /* OUTPUT Control */
640 SOC_DOUBLE("OUT Channel Switch", RT5670_LOUT1,
641 RT5670_VOL_L_SFT, RT5670_VOL_R_SFT, 1, 1),
642 SOC_DOUBLE_TLV("OUT Playback Volume", RT5670_LOUT1,688 SOC_DOUBLE_TLV("OUT Playback Volume", RT5670_LOUT1,
643 RT5670_L_VOL_SFT, RT5670_R_VOL_SFT, 39, 1, out_vol_tlv),689 RT5670_L_VOL_SFT, RT5670_R_VOL_SFT, 39, 1, out_vol_tlv),
644 /* DAC Digital Volume */690 /* DAC Digital Volume */
645 SOC_DOUBLE("DAC2 Playback Switch", RT5670_DAC_CTRL,691 SOC_DOUBLE("DAC2 Playback Switch", RT5670_DAC_CTRL,
646 RT5670_M_DAC_L2_VOL_SFT, RT5670_M_DAC_R2_VOL_SFT, 1, 1),692 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),
647 SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5670_DAC1_DIG_VOL,695 SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5670_DAC1_DIG_VOL,
648 RT5670_L_VOL_SFT, RT5670_R_VOL_SFT,696 RT5670_L_VOL_SFT, RT5670_R_VOL_SFT,
649 175, 0, dac_vol_tlv),697 175, 0, dac_vol_tlv),
@@ -913,18 +961,44 @@ static const struct snd_kcontrol_new rt5670_mono_adc_r_mix[] = { · 263 unmodified lines
913 RT5670_M_MONO_ADC_R2_SFT, 1, 1),961 RT5670_M_MONO_ADC_R2_SFT, 1, 1),
914};962};
915 963
964/* See comment above rt5670_update_ad_da_mixer_dac1_m_bits() */
965static 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
916static const struct snd_kcontrol_new rt5670_dac_l_mix[] = {992static const struct snd_kcontrol_new rt5670_dac_l_mix[] = {
917 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5670_AD_DA_MIXER,993 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5670_AD_DA_MIXER,
918 RT5670_M_ADCMIX_L_SFT, 1, 1),994 RT5670_M_ADCMIX_L_SFT, 1, 1),
919 SOC_DAPM_SINGLE("DAC1 Switch", RT5670_AD_DA_MIXER,995 SOC_DAPM_SINGLE_RT5670_DAC1_SW("DAC1 Switch", 0),
920 RT5670_M_DAC1_L_SFT, 1, 1),
921};996};
922 997
923static const struct snd_kcontrol_new rt5670_dac_r_mix[] = {998static const struct snd_kcontrol_new rt5670_dac_r_mix[] = {
924 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5670_AD_DA_MIXER,999 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5670_AD_DA_MIXER,
925 RT5670_M_ADCMIX_R_SFT, 1, 1),1000 RT5670_M_ADCMIX_R_SFT, 1, 1),
926 SOC_DAPM_SINGLE("DAC1 Switch", RT5670_AD_DA_MIXER,1001 SOC_DAPM_SINGLE_RT5670_DAC1_SW("DAC1 Switch", 1),
927 RT5670_M_DAC1_R_SFT, 1, 1),
928};1002};
929 1003
930static const struct snd_kcontrol_new rt5670_sto_dac_l_mix[] = {1004static 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
1656 RT5670_PWR_ADC_S1F_BIT, 0, NULL, 0),1730 RT5670_PWR_ADC_S1F_BIT, 0, NULL, 0),
1657 SND_SOC_DAPM_SUPPLY("ADC Stereo2 Filter", RT5670_PWR_DIG2,1731 SND_SOC_DAPM_SUPPLY("ADC Stereo2 Filter", RT5670_PWR_DIG2,
1658 RT5670_PWR_ADC_S2F_BIT, 0, NULL, 0),1732 RT5670_PWR_ADC_S2F_BIT, 0, NULL, 0),
1659 SND_SOC_DAPM_MIXER("Sto1 ADC MIXL", RT5670_STO1_ADC_DIG_VOL,1733 SND_SOC_DAPM_MIXER("Sto1 ADC MIXL", SND_SOC_NOPM, 0, 0,
1660 RT5670_L_MUTE_SFT, 1, rt5670_sto1_adc_l_mix,1734 rt5670_sto1_adc_l_mix, ARRAY_SIZE(rt5670_sto1_adc_l_mix)),
1661 ARRAY_SIZE(rt5670_sto1_adc_l_mix)),1735 SND_SOC_DAPM_MIXER("Sto1 ADC MIXR", SND_SOC_NOPM, 0, 0,
1662 SND_SOC_DAPM_MIXER("Sto1 ADC MIXR", RT5670_STO1_ADC_DIG_VOL,1736 rt5670_sto1_adc_r_mix, ARRAY_SIZE(rt5670_sto1_adc_r_mix)),
1663 RT5670_R_MUTE_SFT, 1, rt5670_sto1_adc_r_mix,
1664 ARRAY_SIZE(rt5670_sto1_adc_r_mix)),
1665 SND_SOC_DAPM_MIXER("Sto2 ADC MIXL", SND_SOC_NOPM, 0, 0,1737 SND_SOC_DAPM_MIXER("Sto2 ADC MIXL", SND_SOC_NOPM, 0, 0,
1666 rt5670_sto2_adc_l_mix,1738 rt5670_sto2_adc_l_mix,
1667 ARRAY_SIZE(rt5670_sto2_adc_l_mix)),1739 ARRAY_SIZE(rt5670_sto2_adc_l_mix)),
@@ -2999,6 +3071,16 @@ static int rt5670_i2c_probe(struct i2c_client *i2c, · 1331 unmodified lines
2999 dev_info(&i2c->dev, "quirk JD mode 3\n");3071 dev_info(&i2c->dev, "quirk JD mode 3\n");
3000 }3072 }
3001 3073
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
3002 rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap);3084 rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap);
3003 if (IS_ERR(rt5670->regmap)) {3085 if (IS_ERR(rt5670->regmap)) {
3004 ret = PTR_ERR(rt5670->regmap);3086 ret = PTR_ERR(rt5670->regmap);
sound/soc/codecs/rt5670.h+5−4
@@ -212,12 +212,8 @@ · 211 unmodified lines
212/* global definition */212/* global definition */
213#define RT5670_L_MUTE (0x1 << 15)213#define RT5670_L_MUTE (0x1 << 15)
214#define RT5670_L_MUTE_SFT 15214#define RT5670_L_MUTE_SFT 15
215#define RT5670_VOL_L_MUTE (0x1 << 14)
216#define RT5670_VOL_L_SFT 14
217#define RT5670_R_MUTE (0x1 << 7)215#define RT5670_R_MUTE (0x1 << 7)
218#define RT5670_R_MUTE_SFT 7216#define RT5670_R_MUTE_SFT 7
219#define RT5670_VOL_R_MUTE (0x1 << 6)
220#define RT5670_VOL_R_SFT 6
221#define RT5670_L_VOL_MASK (0x3f << 8)217#define RT5670_L_VOL_MASK (0x3f << 8)
222#define RT5670_L_VOL_SFT 8218#define RT5670_L_VOL_SFT 8
223#define RT5670_R_VOL_MASK (0x3f)219#define RT5670_R_VOL_MASK (0x3f)
@@ -2017,6 +2013,11 @@ struct rt5670_priv { · 1793 unmodified lines
2017 int dsp_rate;2013 int dsp_rate;
2018 int jack_type;2014 int jack_type;
2019 int jack_type_saved;2015 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;
2020};2021};
2021 2022
2022void rt5670_jack_suspend(struct snd_soc_component *component);2023void 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
895 return 0;895 return 0;
896}896}
897 897
898static 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
898static const struct snd_soc_component_driver soc_codec_dev_rt711 = {905static const struct snd_soc_component_driver soc_codec_dev_rt711 = {
899 .probe = rt711_probe,906 .probe = rt711_probe,
900 .set_bias_level = rt711_set_bias_level,907 .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
905 .dapm_routes = rt711_audio_map,912 .dapm_routes = rt711_audio_map,
906 .num_dapm_routes = ARRAY_SIZE(rt711_audio_map),913 .num_dapm_routes = ARRAY_SIZE(rt711_audio_map),
907 .set_jack = rt711_set_jack_detect,914 .set_jack = rt711_set_jack_detect,
915 .remove = rt711_remove,
908};916};
909 917
910static int rt711_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,918static 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
71 { SGTL5000_DAP_EQ_BASS_BAND4, 0x002f },71 { SGTL5000_DAP_EQ_BASS_BAND4, 0x002f },
72 { SGTL5000_DAP_MAIN_CHAN, 0x8000 },72 { SGTL5000_DAP_MAIN_CHAN, 0x8000 },
73 { SGTL5000_DAP_MIX_CHAN, 0x0000 },73 { SGTL5000_DAP_MIX_CHAN, 0x0000 },
74 { SGTL5000_DAP_AVC_CTRL, 0x0510 },74 { SGTL5000_DAP_AVC_CTRL, 0x5100 },
75 { SGTL5000_DAP_AVC_THRESHOLD, 0x1473 },75 { SGTL5000_DAP_AVC_THRESHOLD, 0x1473 },
76 { SGTL5000_DAP_AVC_ATTACK, 0x0028 },76 { SGTL5000_DAP_AVC_ATTACK, 0x0028 },
77 { SGTL5000_DAP_AVC_DECAY, 0x0050 },77 { 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
1873 1873
1874 wcd = snd_soc_component_get_drvdata(dai->component);1874 wcd = snd_soc_component_get_drvdata(dai->component);
1875 1875
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
1876 if (!tx_slot || !rx_slot) {1882 if (!tx_slot || !rx_slot) {
1877 dev_err(wcd->dev, "Invalid tx_slot=%p, rx_slot=%p\n",1883 dev_err(wcd->dev, "Invalid tx_slot=%p, rx_slot=%p\n",
1878 tx_slot, rx_slot);1884 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
878static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt)878static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt)
879{879{
880 u32 strcr = 0, scr = 0, stcr, srcr, mask;880 u32 strcr = 0, scr = 0, stcr, srcr, mask;
881 unsigned int slots;
881 882
882 ssi->dai_fmt = fmt;883 ssi->dai_fmt = fmt;
883 884
@@ -909,10 +910,11 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt) · 25 unmodified lines
909 return -EINVAL;910 return -EINVAL;
910 }911 }
911 912
913 slots = ssi->slots ? : 2;
912 regmap_update_bits(ssi->regs, REG_SSI_STCCR,914 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));
914 regmap_update_bits(ssi->regs, REG_SSI_SRCCR,916 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));
916 918
917 /* Data on rising edge of bclk, frame low, 1clk before data */919 /* Data on rising edge of bclk, frame low, 1clk before data */
918 strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP | SSI_STCR_TEFS;920 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
172 * or device's module clock.172 * or device's module clock.
173 */173 */
174 clk = devm_get_clk_from_child(dev, node, NULL);174 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
178 if (!IS_ERR(clk)) {175 if (!IS_ERR(clk)) {
179 simple_dai->clk = clk;
180 simple_dai->sysclk = clk_get_rate(clk);176 simple_dai->sysclk = clk_get_rate(clk);
181 } else if (!of_property_read_u32(node, "system-clock-frequency",177
182 &val)) {178 simple_dai->clk = clk;
179 } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
183 simple_dai->sysclk = val;180 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);
184 }185 }
185 186
186 if (of_property_read_bool(node, "system-clock-direction-out"))187 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
581 },581 },
582 .driver_data = (void *)(BYT_RT5640_DMIC1_MAP |582 .driver_data = (void *)(BYT_RT5640_DMIC1_MAP |
583 BYT_RT5640_JD_SRC_JD1_IN4P |583 BYT_RT5640_JD_SRC_JD1_IN4P |
584 BYT_RT5640_OVCD_TH_1500UA |584 BYT_RT5640_OVCD_TH_2000UA |
585 BYT_RT5640_OVCD_SF_0P75 |585 BYT_RT5640_OVCD_SF_0P75 |
586 BYT_RT5640_MCLK_EN),586 BYT_RT5640_MCLK_EN),
587 },587 },
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
555 555
556 /* set tdm */556 /* set tdm */
557 if (tdm_priv->bck_invert)557 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);
559 561
560 if (tdm_priv->lck_invert)562 if (tdm_priv->lck_invert)
561 tdm_con |= 1 << LRCK_INVERSE_SFT;563 tdm_con |= 1 << LRCK_INVERSE_SFT;
sound/soc/mediatek/mt8192/mt8192-reg.h+5−3
@@ -21,6 +21,11 @@ enum { · 20 unmodified lines
21/*****************************************************************************21/*****************************************************************************
22 * R E G I S T E R D E F I N I T I O N22 * R E G I S T E R D E F I N I T I O N
23 *****************************************************************************/23 *****************************************************************************/
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
24/* AFE_DAC_CON0 */29/* AFE_DAC_CON0 */
25#define VUL12_ON_SFT 3130#define VUL12_ON_SFT 31
26#define VUL12_ON_MASK 0x131#define VUL12_ON_MASK 0x1
@@ -2079,9 +2084,6 @@ enum { · 2052 unmodified lines
2079#define TDM_EN_SFT 02084#define TDM_EN_SFT 0
2080#define TDM_EN_MASK 0x12085#define TDM_EN_MASK 0x1
2081#define TDM_EN_MASK_SFT (0x1 << 0)2086#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)
2085#define LRCK_INVERSE_SFT 22087#define LRCK_INVERSE_SFT 2
2086#define LRCK_INVERSE_MASK 0x12088#define LRCK_INVERSE_MASK 0x1
2087#define LRCK_INVERSE_MASK_SFT (0x1 << 2)2089#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
739 739
740 for_each_child_of_node(dev->of_node, node) {740 for_each_child_of_node(dev->of_node, node) {
741 ret = of_property_read_u32(node, "reg", &id);741 ret = of_property_read_u32(node, "reg", &id);
742 if (ret || id < 0 || id >= data->variant->num_dai) {742 if (ret || id < 0) {
743 dev_err(dev, "valid dai id not found: %d\n", ret);743 dev_err(dev, "valid dai id not found: %d\n", ret);
744 continue;744 continue;
745 }745 }
sound/soc/qcom/sdm845.c+3−3
@@ -27,18 +27,18 @@ · 26 unmodified lines
27#define SPK_TDM_RX_MASK 0x0327#define SPK_TDM_RX_MASK 0x03
28#define NUM_TDM_SLOTS 828#define NUM_TDM_SLOTS 8
29#define SLIM_MAX_TX_PORTS 1629#define SLIM_MAX_TX_PORTS 16
30#define SLIM_MAX_RX_PORTS 1630#define SLIM_MAX_RX_PORTS 13
31#define WCD934X_DEFAULT_MCLK_RATE 960000031#define WCD934X_DEFAULT_MCLK_RATE 9600000
32 32
33struct sdm845_snd_data {33struct sdm845_snd_data {
34 struct snd_soc_jack jack;34 struct snd_soc_jack jack;
35 bool jack_setup;35 bool jack_setup;
36 bool stream_prepared[SLIM_MAX_RX_PORTS];36 bool stream_prepared[AFE_PORT_MAX];
37 struct snd_soc_card *card;37 struct snd_soc_card *card;
38 uint32_t pri_mi2s_clk_count;38 uint32_t pri_mi2s_clk_count;
39 uint32_t sec_mi2s_clk_count;39 uint32_t sec_mi2s_clk_count;
40 uint32_t quat_tdm_clk_count;40 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];
42};42};
43 43
44static unsigned int tdm_slot_offset[8] = {0, 4, 8, 12, 16, 20, 24, 28};44static 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
31#include <linux/of.h>31#include <linux/of.h>
32#include <linux/of_graph.h>32#include <linux/of_graph.h>
33#include <linux/dmi.h>33#include <linux/dmi.h>
34#include <linux/acpi.h>
34#include <sound/core.h>35#include <sound/core.h>
35#include <sound/pcm.h>36#include <sound/pcm.h>
36#include <sound/pcm_params.h>37#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
1573 if (card->long_name)1574 if (card->long_name)
1574 return 0; /* long name already set by driver or from DMI */1575 return 0; /* long name already set by driver or from DMI */
1575 1576
1577 if (!is_acpi_device_node(card->dev->fwnode))
1578 return 0;
1579
1576 /* make up dmi long name as: vendor-product-version-board */1580 /* make up dmi long name as: vendor-product-version-board */
1577 vendor = dmi_get_system_info(DMI_BOARD_VENDOR);1581 vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
1578 if (!vendor || !is_dmi_valid(vendor)) {1582 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
207 207
208 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR,208 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR,
209 HDA_DSP_REG_ADSPCS, adspcs,209 HDA_DSP_REG_ADSPCS, adspcs,
210 !(adspcs & HDA_DSP_ADSPCS_SPA_MASK(core_mask)),210 !(adspcs & HDA_DSP_ADSPCS_CPA_MASK(core_mask)),
211 HDA_DSP_REG_POLL_INTERVAL_US,211 HDA_DSP_REG_POLL_INTERVAL_US,
212 HDA_DSP_PD_TIMEOUT * USEC_PER_MSEC);212 HDA_DSP_PD_TIMEOUT * USEC_PER_MSEC);
213 if (ret < 0)213 if (ret < 0)
sound/soc/sof/intel/hda.c+1−0
@@ -897,6 +897,7 @@ free_streams: · 896 unmodified lines
897/* dsp_unmap: not currently used */897/* dsp_unmap: not currently used */
898 iounmap(sdev->bar[HDA_DSP_BAR]);898 iounmap(sdev->bar[HDA_DSP_BAR]);
899hdac_bus_unmap:899hdac_bus_unmap:
900 platform_device_unregister(hdev->dmic_dev);
900 iounmap(bus->remap_addr);901 iounmap(bus->remap_addr);
901 hda_codec_i915_exit(sdev);902 hda_codec_i915_exit(sdev);
902err:903err:
sound/sparc/amd7930.c+0−1
@@ -62,7 +62,6 @@ MODULE_PARM_DESC(enable, "Enable Sun AMD7930 soundcard."); · 61 unmodified lines
62MODULE_AUTHOR("Thomas K. Dyas and David S. Miller");62MODULE_AUTHOR("Thomas K. Dyas and David S. Miller");
63MODULE_DESCRIPTION("Sun AMD7930");63MODULE_DESCRIPTION("Sun AMD7930");
64MODULE_LICENSE("GPL");64MODULE_LICENSE("GPL");
65MODULE_SUPPORTED_DEVICE("{{Sun,AMD7930}}");
66 65
67/* Device register layout. */66/* Device register layout. */
68 67
sound/sparc/cs4231.c+0−1
@@ -52,7 +52,6 @@ MODULE_PARM_DESC(enable, "Enable Sun CS4231 soundcard."); · 51 unmodified lines
52MODULE_AUTHOR("Jaroslav Kysela, Derrick J. Brashear and David S. Miller");52MODULE_AUTHOR("Jaroslav Kysela, Derrick J. Brashear and David S. Miller");
53MODULE_DESCRIPTION("Sun CS4231");53MODULE_DESCRIPTION("Sun CS4231");
54MODULE_LICENSE("GPL");54MODULE_LICENSE("GPL");
55MODULE_SUPPORTED_DEVICE("{{Sun,CS4231}}");
56 55
57#ifdef SBUS_SUPPORT56#ifdef SBUS_SUPPORT
58struct sbus_dma_info {57struct sbus_dma_info {
sound/sparc/dbri.c+0−1
@@ -76,7 +76,6 @@ · 75 unmodified lines
76MODULE_AUTHOR("Rudolf Koenig, Brent Baccala and Martin Habets");76MODULE_AUTHOR("Rudolf Koenig, Brent Baccala and Martin Habets");
77MODULE_DESCRIPTION("Sun DBRI");77MODULE_DESCRIPTION("Sun DBRI");
78MODULE_LICENSE("GPL");78MODULE_LICENSE("GPL");
79MODULE_SUPPORTED_DEVICE("{{Sun,DBRI}}");
80 79
81static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */80static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
82static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */81static 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
26MODULE_AUTHOR("Torsten Schenk <torsten.schenk@zoho.com>");26MODULE_AUTHOR("Torsten Schenk <torsten.schenk@zoho.com>");
27MODULE_DESCRIPTION("TerraTec DMX 6Fire USB audio driver");27MODULE_DESCRIPTION("TerraTec DMX 6Fire USB audio driver");
28MODULE_LICENSE("GPL v2");28MODULE_LICENSE("GPL v2");
29MODULE_SUPPORTED_DEVICE("{{TerraTec,DMX 6Fire USB}}");
30 29
31static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */30static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
32static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */31static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */
sound/usb/caiaq/device.c+0−14
@@ -26,20 +26,6 @@ · 25 unmodified lines
26MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");26MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
27MODULE_DESCRIPTION("caiaq USB audio");27MODULE_DESCRIPTION("caiaq USB audio");
28MODULE_LICENSE("GPL");28MODULE_LICENSE("GPL");
29MODULE_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}}");
43 29
44static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */30static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
45static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */31static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */
sound/usb/card.c+0−2
@@ -58,8 +58,6 @@ · 57 unmodified lines
58MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");58MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
59MODULE_DESCRIPTION("USB Audio");59MODULE_DESCRIPTION("USB Audio");
60MODULE_LICENSE("GPL");60MODULE_LICENSE("GPL");
61MODULE_SUPPORTED_DEVICE("{{Generic,USB Audio}}");
62
63 61
64static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */62static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
65static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */63static 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
21MODULE_AUTHOR("Antonio Ospite <ao2@amarulasolutions.com>");21MODULE_AUTHOR("Antonio Ospite <ao2@amarulasolutions.com>");
22MODULE_DESCRIPTION("M2Tech hiFace USB-SPDIF audio driver");22MODULE_DESCRIPTION("M2Tech hiFace USB-SPDIF audio driver");
23MODULE_LICENSE("GPL v2");23MODULE_LICENSE("GPL v2");
24MODULE_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}}");
41 24
42static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */25static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
43static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */26static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */
sound/usb/misc/ua101.c+0−1
@@ -19,7 +19,6 @@ · 18 unmodified lines
19MODULE_DESCRIPTION("Edirol UA-101/1000 driver");19MODULE_DESCRIPTION("Edirol UA-101/1000 driver");
20MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");20MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
21MODULE_LICENSE("GPL v2");21MODULE_LICENSE("GPL v2");
22MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}");
23 22
24/*23/*
25 * Should not be lower than the minimum scheduling delay of the host24 * 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
2883 u8 group = (private_value & SND_DJM_GROUP_MASK) >> SND_DJM_GROUP_SHIFT;2883 u8 group = (private_value & SND_DJM_GROUP_MASK) >> SND_DJM_GROUP_SHIFT;
2884 u16 value = elem->value.enumerated.item[0];2884 u16 value = elem->value.enumerated.item[0];
2885 2885
2886 kctl->private_value = ((device << SND_DJM_DEVICE_SHIFT) |2886 kctl->private_value = (((unsigned long)device << SND_DJM_DEVICE_SHIFT) |
2887 (group << SND_DJM_GROUP_SHIFT) |2887 (group << SND_DJM_GROUP_SHIFT) |
2888 value);2888 value);
2889 2889
@@ -2921,7 +2921,7 @@ static int snd_djm_controls_create(struct usb_mixer_interface *mixer, · 31 unmodified lines
2921 value = device->controls[i].default_value;2921 value = device->controls[i].default_value;
2922 knew.name = device->controls[i].name;2922 knew.name = device->controls[i].name;
2923 knew.private_value = (2923 knew.private_value = (
2924 (device_idx << SND_DJM_DEVICE_SHIFT) |2924 ((unsigned long)device_idx << SND_DJM_DEVICE_SHIFT) |
2925 (i << SND_DJM_GROUP_SHIFT) |2925 (i << SND_DJM_GROUP_SHIFT) |
2926 value);2926 value);
2927 err = snd_djm_controls_update(mixer, device_idx, i, value);2927 err = snd_djm_controls_update(mixer, device_idx, i, value);
sound/usb/usx2y/usbusx2y.c+0−1
@@ -137,7 +137,6 @@ · 136 unmodified lines
137MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>");137MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>");
138MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.2");138MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.2");
139MODULE_LICENSE("GPL");139MODULE_LICENSE("GPL");
140MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604),"NAME_ALLCAPS"(0x8001)(0x8005)(0x8007)}}");
141 140
142static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */141static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
143static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */142static 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
1887MODULE_AUTHOR("Jerome Anand <jerome.anand@intel.com>");1887MODULE_AUTHOR("Jerome Anand <jerome.anand@intel.com>");
1888MODULE_DESCRIPTION("Intel HDMI Audio driver");1888MODULE_DESCRIPTION("Intel HDMI Audio driver");
1889MODULE_LICENSE("GPL v2");1889MODULE_LICENSE("GPL v2");
1890MODULE_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
391MODULE_DESCRIPTION("Xen virtual sound device frontend");391MODULE_DESCRIPTION("Xen virtual sound device frontend");
392MODULE_LICENSE("GPL");392MODULE_LICENSE("GPL");
393MODULE_ALIAS("xen:" XENSND_DRIVER_NAME);393MODULE_ALIAS("xen:" XENSND_DRIVER_NAME);
394MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual soundcard}}");
tools/testing/selftests/kvm/.gitignore+3−0
@@ -8,10 +8,13 @@ · 7 unmodified lines
8/x86_64/debug_regs8/x86_64/debug_regs
9/x86_64/evmcs_test9/x86_64/evmcs_test
10/x86_64/get_cpuid_test10/x86_64/get_cpuid_test
11/x86_64/get_msr_index_features
11/x86_64/kvm_pv_test12/x86_64/kvm_pv_test
13/x86_64/hyperv_clock
12/x86_64/hyperv_cpuid14/x86_64/hyperv_cpuid
13/x86_64/mmio_warning_test15/x86_64/mmio_warning_test
14/x86_64/platform_info_test16/x86_64/platform_info_test
17/x86_64/set_boot_cpu_id
15/x86_64/set_sregs_test18/x86_64/set_sregs_test
16/x86_64/smm_test19/x86_64/smm_test
17/x86_64/state_test20/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
39LIBKVM_s390x = lib/s390x/processor.c lib/s390x/ucall.c lib/s390x/diag318_test_handler.c39LIBKVM_s390x = lib/s390x/processor.c lib/s390x/ucall.c lib/s390x/diag318_test_handler.c
40 40
41TEST_GEN_PROGS_x86_64 = x86_64/cr4_cpuid_sync_test41TEST_GEN_PROGS_x86_64 = x86_64/cr4_cpuid_sync_test
42TEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features
42TEST_GEN_PROGS_x86_64 += x86_64/evmcs_test43TEST_GEN_PROGS_x86_64 += x86_64/evmcs_test
43TEST_GEN_PROGS_x86_64 += x86_64/get_cpuid_test44TEST_GEN_PROGS_x86_64 += x86_64/get_cpuid_test
45TEST_GEN_PROGS_x86_64 += x86_64/hyperv_clock
44TEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid46TEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid
45TEST_GEN_PROGS_x86_64 += x86_64/kvm_pv_test47TEST_GEN_PROGS_x86_64 += x86_64/kvm_pv_test
46TEST_GEN_PROGS_x86_64 += x86_64/mmio_warning_test48TEST_GEN_PROGS_x86_64 += x86_64/mmio_warning_test
47TEST_GEN_PROGS_x86_64 += x86_64/platform_info_test49TEST_GEN_PROGS_x86_64 += x86_64/platform_info_test
50TEST_GEN_PROGS_x86_64 += x86_64/set_boot_cpu_id
48TEST_GEN_PROGS_x86_64 += x86_64/set_sregs_test51TEST_GEN_PROGS_x86_64 += x86_64/set_sregs_test
49TEST_GEN_PROGS_x86_64 += x86_64/smm_test52TEST_GEN_PROGS_x86_64 += x86_64/smm_test
50TEST_GEN_PROGS_x86_64 += x86_64/state_test53TEST_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
16 16
17#include "sparsebit.h"17#include "sparsebit.h"
18 18
19#define KVM_DEV_PATH "/dev/kvm"
19#define KVM_MAX_VCPUS 51220#define KVM_MAX_VCPUS 512
20 21
21/*22/*
@@ -133,6 +134,7 @@ void vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl, · 111 unmodified lines
133int _vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl,134int _vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl,
134 void *arg);135 void *arg);
135void vm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);136void vm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);
137int _vm_ioctl(struct kvm_vm *vm, unsigned long cmd, void *arg);
136void kvm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);138void kvm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);
137int _kvm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);139int _kvm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);
138void vm_mem_region_set_flags(struct kvm_vm *vm, uint32_t slot, uint32_t flags);140void 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
1697{1697{
1698 int ret;1698 int ret;
1699 1699
1700 ret = ioctl(vm->fd, cmd, arg);1700 ret = _vm_ioctl(vm, cmd, arg);
1701 TEST_ASSERT(ret == 0, "vm ioctl %lu failed, rc: %i errno: %i (%s)",1701 TEST_ASSERT(ret == 0, "vm ioctl %lu failed, rc: %i errno: %i (%s)",
1702 cmd, ret, errno, strerror(errno));1702 cmd, ret, errno, strerror(errno));
1703}1703}
1704 1704
1705int _vm_ioctl(struct kvm_vm *vm, unsigned long cmd, void *arg)
1706{
1707 return ioctl(vm->fd, cmd, arg);
1708}
1709
1705/*1710/*
1706 * KVM system ioctl1711 * KVM system ioctl
1707 *1712 *
tools/testing/selftests/kvm/lib/kvm_util_internal.h+0−2
@@ -10,8 +10,6 @@ · 9 unmodified lines
10 10
11#include "sparsebit.h"11#include "sparsebit.h"
12 12
13#define KVM_DEV_PATH "/dev/kvm"
14
15struct userspace_mem_region {13struct userspace_mem_region {
16 struct kvm_userspace_memory_region region;14 struct kvm_userspace_memory_region region;
17 struct sparsebit *unused_phy_pages;15 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
18static 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
35static 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
66static 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
83struct 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
99static 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
128int 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
11struct 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() */
26static 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
49static inline void nop_loop(void)
50{
51 int i;
52
53 for (i = 0; i < 1000000; i++)
54 asm volatile("nop");
55}
56
57static 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
83static 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
100static 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
173static 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
201int 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
258out:
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
22static uint32_t get_bsp_flag(void)
23{
24 return rdmsr(MSR_IA32_APICBASE) & MSR_IA32_APICBASE_BSP;
25}
26
27static 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
36static 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
45static 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
54static 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
87static 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
103static 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
113static 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
132static 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
154int 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}