Commit graph

1014066 commits

Author SHA1 Message Date
Jan Beulich
c81d3d2460 xen-pciback: reconfigure also from backend watch handler
When multiple PCI devices get assigned to a guest right at boot, libxl
incrementally populates the backend tree. The writes for the first of
the devices trigger the backend watch. In turn xen_pcibk_setup_backend()
will set the XenBus state to Initialised, at which point no further
reconfigures would happen unless a device got hotplugged. Arrange for
reconfigure to also get triggered from the backend watch handler.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/2337cbd6-94b9-4187-9862-c03ea12e0c61@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
2021-05-21 09:55:16 +02:00
Jan Beulich
4ba50e7c42 xen-pciback: redo VF placement in the virtual topology
The commit referenced below was incomplete: It merely affected what
would get written to the vdev-<N> xenstore node. The guest would still
find the function at the original function number as long as
__xen_pcibk_get_pci_dev() wouldn't be in sync. The same goes for AER wrt
__xen_pcibk_get_pcifront_dev().

Undo overriding the function to zero and instead make sure that VFs at
function zero remain alone in their slot. This has the added benefit of
improving overall capacity, considering that there's only a total of 32
slots available right now (PCI segment and bus can both only ever be
zero at present).

Fixes: 8a5248fe10 ("xen PV passthru: assign SR-IOV virtual functions to separate virtual slots")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/8def783b-404c-3452-196d-3f3fd4d72c9e@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
2021-05-21 09:55:13 +02:00
Jan Beulich
ae897fda4f x86/Xen: swap NX determination and GDT setup on BSP
xen_setup_gdt(), via xen_load_gdt_boot(), wants to adjust page tables.
For this to work when NX is not available, x86_configure_nx() needs to
be called first.

[jgross] Note that this is a revert of 36104cb901 ("x86/xen:
Delay get_cpu_cap until stack canary is established"), which is possible
now that we no longer support running as PV guest in 32-bit mode.

Cc: <stable.vger.kernel.org> # 5.9
Fixes: 36104cb901 ("x86/xen: Delay get_cpu_cap until stack canary is established")
Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>

Link: https://lore.kernel.org/r/12a866b0-9e89-59f7-ebeb-a2a6cec0987a@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
2021-05-21 09:53:52 +02:00
Linus Torvalds
79a106fc65 drm fixes for 5.13-rc3
dma-buf:
 - WARN fix
 
 amdgpu:
 - Fix downscaling ratio on DCN3.x
 - Fix for non-4K pages
 - PCO/RV compute hang fix
 - Dongle fix
 - Aldebaran codec query support
 - Refcount leak fix
 - Use after free fix
 - Navi12 golden settings updates
 - GPU reset fixes
 
 radeon:
 - Fix for imported BO handling
 
 i915:
 - Pin the L-shape quirked object as unshrinkable to fix crashes
 - Disable HiZ Raw Stall Optimization on broken gen7 to fix glitches, gfx corruption
 - GVT: Move mdev attribute groups into kvmgt module to fix kconfig deps issue
 
 exynos:
 - Correct kerneldoc of fimd_shadow_protect_win function.
 - Drop redundant error messages.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEEKbZHaGwW9KfbeusDHTzWXnEhr4FAmCnNz0ACgkQDHTzWXnE
 hr5oCw//Ux2+zc7aBvEdotgJo6GW17ymvrIpJSJ2sdUAq3xxvYgMOpSaWJPXW1RF
 wLtbdxbXOGEbGI59uBMPNrCJ4ukJbAiL7J4LIa/531y1DA0Kwfz0bzz3G2uqRzCG
 hbxLrLG8pUZ4GbzStjrfRCRDlNywShGtuDxznnouF30FitBgQUsjeLxM7/oKfZZj
 kq3kJkEBbDw+nQ5RVAjm1KdUqa8AGnAKLH+7GkzPiy/ZuwZpEqAlZfVFLnxANaz4
 Vij/IYUDPBBeeQTtPwHJUSZgwFiJTex/vDXopSu0zt7GKmh7WguKhx0E5ccQAZdb
 6k8BobLno4yTDwQXWFTvos4lHm2MKPNYa1cops7cgGcB+sLtMfG7BSJ7GsxSSUYh
 2q+POHDym75M2SvFq4B+r0RPYNWj4W3FCvVFX4bhuwtRv2OfTw+enYnTrcBVodPF
 1K6447IDSvMrYUo2e6rRn/OTldaOsIQEIk5k5xj1a+AOVMIUt2SUTOwIhwGCEeaY
 HVfwbkkqcfjPFX6wqqO7+TTlK5x+aj8G2h4ZJFIiftnsfhdw5DLsiOthjypxlb/l
 zQjl0mGi7QaIYnhS1FTby5YDW7mmFKKoPaA7gFIzgrALG7zDoomxzbRbrFEwGanS
 ufLA5JXY2/1iff6O4IxmeWLuBwXbcColgLU5L/0bCI6DtsaGl9M=
 =EJFf
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2021-05-21-1' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Usual collection, mostly amdgpu and some i915 regression fixes. I
  nearly managed to hose my build/sign machine this week, but I
  recovered it just in time, and I even got clang12 built.

  dma-buf:
   - WARN fix

  amdgpu:
   - Fix downscaling ratio on DCN3.x
   - Fix for non-4K pages
   - PCO/RV compute hang fix
   - Dongle fix
   - Aldebaran codec query support
   - Refcount leak fix
   - Use after free fix
   - Navi12 golden settings updates
   - GPU reset fixes

  radeon:
   - Fix for imported BO handling

  i915:
   - Pin the L-shape quirked object as unshrinkable to fix crashes
   - Disable HiZ Raw Stall Optimization on broken gen7 to fix glitches,
     gfx corruption
   - GVT: Move mdev attribute groups into kvmgt module to fix kconfig
     deps issue

  exynos:
   - Correct kerneldoc of fimd_shadow_protect_win function
   - Drop redundant error messages"

* tag 'drm-fixes-2021-05-21-1' of git://anongit.freedesktop.org/drm/drm:
  dma-buf: fix unintended pin/unpin warnings
  drm/amdgpu: stop touching sched.ready in the backend
  drm/amd/amdgpu: fix a potential deadlock in gpu reset
  drm/amdgpu: update sdma golden setting for Navi12
  drm/amdgpu: update gc golden setting for Navi12
  drm/amdgpu: Fix a use-after-free
  drm/amdgpu: add video_codecs query support for aldebaran
  drm/amd/amdgpu: fix refcount leak
  drm/amd/display: Disconnect non-DP with no EDID
  drm/amdgpu: disable 3DCGCG on picasso/raven1 to avoid compute hang
  drm/amdgpu: Fix GPU TLB update error when PAGE_SIZE > AMDGPU_PAGE_SIZE
  drm/radeon: use the dummy page for GART if needed
  drm/amd/display: Use the correct max downscaling value for DCN3.x family
  drm/i915/gt: Disable HiZ Raw Stall Optimization on broken gen7
  drm/i915/gem: Pin the L-shape quirked object as unshrinkable
  drm/exynos/decon5433: Remove redundant error printing in exynos5433_decon_probe()
  drm/exynos: Remove redundant error printing in exynos_dsi_probe()
  drm/exynos: correct exynos_drm_fimd kerneldoc
  drm/i915/gvt: Move mdev attribute groups into kvmgt module
2021-05-20 20:15:43 -10:00
Dave Airlie
dd6ad0516e Merge tag 'amd-drm-fixes-5.13-2021-05-19' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-5.13-2021-05-19:

amdgpu:
- Fix downscaling ratio on DCN3.x
- Fix for non-4K pages
- PCO/RV compute hang fix
- Dongle fix
- Aldebaran codec query support
- Refcount leak fix
- Use after free fix
- Navi12 golden settings updates
- GPU reset fixes

radeon:
- Fix for imported BO handling

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210520022500.4023-1-alexander.deucher@amd.com
2021-05-21 14:08:04 +10:00
Dave Airlie
4996c342b2 Merge tag 'drm-intel-fixes-2021-05-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
drm/i915 fixes for v5.13-rc3:
- Pin the L-shape quirked object as unshrinkable to fix crashes
- Disable HiZ Raw Stall Optimization on broken gen7 to fix glitches, gfx corruption
- GVT: Move mdev attribute groups into kvmgt module to fix kconfig deps issue

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87a6opehx6.fsf@intel.com
2021-05-21 13:41:42 +10:00
Dave Airlie
af8d80bf7c Just a single fix for a dma-buf related WARN
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYKZtLwAKCRDj7w1vZxhR
 xdTOAP4sm8KGSzFdER+jSqVMcDe+F4CvWtlNbe908Ld7/4OiSgEA2DibI30TF1QZ
 M7ISBAdNREZ0ZhEmt87bfLugOytlCA4=
 =68hL
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2021-05-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

Just a single fix for a dma-buf related WARN

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20210520140808.ds6bk6i3oarmiea6@gilmour
2021-05-21 11:10:15 +10:00
Dave Airlie
7544f3ee01 Fixup
- Correct kerneldoc of fimd_shadow_protect_win function.
 
 Cleanup
 - Drop redundant error messages.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEENRKOoF7NhdPGpscnVzg0iQxDErgFAmCiWcMACgkQVzg0iQxD
 ErgKfBAAgweFKYyUTgyDjY3nd9fOXPzoIC0J8FY/JaQW4xjAnlSGJobl6mw0EIBC
 +lEgGbo1rjojp8S8A0FO16T+Q8wjPGFnIyZVrb3LYTKzZCpnt2PH3PdrX4mPgUhx
 epsvd3c8iIQ/YTLFU8fINAnHCcRYo4TR8c1E6tdmOstO3ObNlk4fj7ghFp1T3odu
 ipRqnBZ2aXeHXvlIozfVekQ+a+4J3bztQppa2RtHLTn4kbLTL8hdeuX4wsqwkStp
 TOmVyBCEeDvmwTEW5sYhK6xDdV48LgKihlkaFRXkw0rQSMv5XA/ldE/JbAt+Lp/p
 WQtYqGCyf4wommdy7dwGw4XO0ZvHEf214TVN6HMSkMToNZbWABH5jd4QoDqZCyoa
 G6cO/hD8fHPo4zRydmn/6vkn3HibGxSbXbommt+w9ZYQO1WPkGKjKEmB15PRJfPm
 tI5wZBKcYqzpAT19KDf82ma5RXQALIMRbg4Bz7pL2pVfQXmJ4dnebjv0a4zgSLtb
 S2ShxYVZRvGCb12M8ofQ4x3RCibpsyzxB49mDfOoAdkdi3p7JmDJFgiH5F+WXrsx
 wFcVqz7+OOwUXx5dI0aCwb63pnsiTH1C4lfhR7ExfSs9cKMQCICldoAhHM1mVmQL
 7D3mZP9ePL8sEmdaR9hrRc7c8oWPM9rRLBZD/tE6AdQ0GQ/ybYk=
 =EoYu
 -----END PGP SIGNATURE-----

Merge tag 'exynos-drm-fixes-for-v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes

Fixup
- Correct kerneldoc of fimd_shadow_protect_win function.

Cleanup
- Drop redundant error messages.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Inki Dae <inki.dae@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210520034747.257687-1-inki.dae@samsung.com
2021-05-21 11:02:28 +10:00
Linus Torvalds
ba816d3c26 ARM: SoC fixes for 5.13
Only a small number of fixes so far, including some that I had applied
 during the merge window, so this is based on the original merge of the
 other branches.
 
  - The largest change is a fix for a reference counting bug in
    the AMD TEE driver.
 
  - Neil Armstrong now co-maintains Amlogic SoC support
 
  - Two build warning fixes for renesas device tree files
 
  - A sign expansion bug for optee
 
  - A DT binding fix for a mismerge
 
 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmCmyQUACgkQmmx57+YA
 GNlhmg/+PK3LoQLrGqkI9dwBZI/s94TMdc0R0lOFAUQ6m7U5OaqcVcqTX3wMN+nd
 YPjYWCZKOfZI4ZriLYeIqYJg9VTZyB+E3gsb0ynXHHI0vFKDxZudQaMGJ1DJx5pR
 wZcG/e2xwdDm1qKyAWq6RpMpxAn5lWqaXiLyZH0rl9VHRY2DKroVIt3JH0RmAx17
 UnC2PibBhqEze4K5kbwR+euZEVdpS55SljeH437uh8xR4Lk3No/FrgKI+xdXbOeU
 66eb7EDQ66hNVvk2BRUYg9Bnn/pA66OCWsJRXsZVkYXcvoug+jv2/N/QBwHXap1F
 LZS3lgm5rNVD6i52gwSK/RjpD4JmQ882UXQNutecSLTKLIBtoVzryMPYAeT01G8i
 ZRkTgba/GmtSIpqW+rgmX3TEPeV8wKcjp22a30PQK8JkbslzHToRPBDZ555HPcE/
 QQPD/IyLenzHUKKnx4AnE0z80Kk+mTrra20aRp/5wUvirAfGLql3jwn/wWtnCouD
 3bIqVhozsGl0MpculVtX1eAw3T62bHfzbW++oftHkIT/fAogSyPQihTenkzdeswB
 QQ3FjjwPkYryCJivdXvuTQIh0WbhJJzQjGxPXUAGQzI1KTe4sYZx4pqdBS3A7n9D
 GHykHr6AI5LXosE3IvyHSImnMPLOH0J9Bzva/8WDLJzkb5Ujod4=
 =w6Zu
 -----END PGP SIGNATURE-----

Merge tag 'arm-soc-fixes-5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC fixes from Arnd Bergmann:
 "Only a small number of fixes so far, including some that I had applied
  during the merge window, so this is based on the original merge of the
  other branches.

   - The largest change is a fix for a reference counting bug in the AMD
     TEE driver.

   - Neil Armstrong now co-maintains Amlogic SoC support

   - Two build warning fixes for renesas device tree files

   - A sign expansion bug for optee

   - A DT binding fix for a mismerge"

* tag 'arm-soc-fixes-5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
  ARM: npcm: wpcm450: select interrupt controller driver
  MAINTAINERS: ARM/Amlogic SoCs: add Neil as primary maintainer
  tee: amdtee: unload TA only when its refcount becomes 0
  dt-bindings: nvmem: mediatek: remove duplicate mt8192 line
  firmware: arm_scmi: Remove duplicate declaration of struct scmi_protocol_handle
  firmware: arm_scpi: Prevent the ternary sign expansion bug
  arm64: dts: renesas: Add port@0 node for all CSI-2 nodes to dtsi
  arm64: dts: renesas: aistarvision-mipi-adapter-2.1: Fix CSI40 ports
2021-05-20 14:46:26 -10:00
Linus Torvalds
921dd23597 Merge branch 'urgent.2021.05.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
Pull kcsan fix from Paul McKenney:
 "Fix for a regression introduced in this merge window by commit
  e36299efe7 ("kcsan, debugfs: Move debugfs file creation out of early
  init").

  The regression is not easy to trigger, requiring a KCSAN build using
  clang with CONFIG_LTO_CLANG=y. The fix is to simply make the
  kcsan_debugfs_init() function's type initcall-compatible. This has
  been posted to the relevant mailing lists:"

* 'urgent.2021.05.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu:
  kcsan: Fix debugfs initcall return type
2021-05-20 14:43:33 -10:00
Linus Torvalds
a0d8b0eda3 SCSI fixes on 20210520
8 small fixes, all in drivers.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCYKbXoCYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishUpRAQDBm6al
 eIw0PTxDE9YrlbjkjBAkbiV88D9/v69NlIpmdQD/fx0+6WK4CexzRoj+tiW5XaCz
 3L2zPdTGrNVDwfqHV+s=
 =GAee
 -----END PGP SIGNATURE-----

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "Eight small fixes, all in drivers"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: pm80xx: Fix drives missing during rmmod/insmod loop
  scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword()
  scsi: qedf: Add pointer checks in qedf_update_link_speed()
  scsi: ufs: core: Increase the usable queue depth
  scsi: BusLogic: Fix 64-bit system enumeration error for Buslogic
  scsi: ufs: ufs-mediatek: Fix power down spec violation
2021-05-20 14:41:35 -10:00
Linus Torvalds
a0eb553b6f - Fix a couple DM snapshot target crashes exposed by user-error.
- Fix DM integrity target to not use discard optimization, introduced
   during 5.13 merge, when recalulating.
 
 - Fix some sparse warnings in DM integrity target.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEJfWUX4UqZ4x1O2wixSPxCi2dA1oFAmCmu68ACgkQxSPxCi2d
 A1qlXwf/W8l0T+2/NBggl4Hhld7+4+3u7B2UrSpXQ5TbnPEUyfplG80MukbtM7KN
 uwQAgOLWMEfqcRyFbbj3nUaUU216lEA00ooCt5YnLdDMPi+oNa1BL/YksUqC0gka
 X8dYA/Uz1q6R+XMlCpJVFda+lkiR2eLLvo1URaKYwWhe3IsEgSvtW3qG+WRrSKs5
 H7J7Gu5qh0L7LYyQswgpvzQIKdIStWQ6cN7HGPOmNesV8lX/XrnPC+IkWCgzhDJx
 ZpcoR47ViIgTEd7giume1n8Ky8Jnu8WbiAHMQBuvtc2IGg8Jdw0Co6ll3ezsFprf
 0YFivO8yUujdUrmQ0Hzi5S5826tQ7A==
 =lKDE
 -----END PGP SIGNATURE-----

Merge tag 'for-5.13/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device mapper fixes from Mike Snitzer:

 - Fix a couple DM snapshot target crashes exposed by user-error.

 - Fix DM integrity target to not use discard optimization, introduced
   during 5.13 merge, when recalulating.

 - Fix some sparse warnings in DM integrity target.

* tag 'for-5.13/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm integrity: fix sparse warnings
  dm integrity: revert to not using discard filler when recalulating
  dm snapshot: fix crash with transient storage and zero chunk size
  dm snapshot: fix a crash when an origin has no snapshots
2021-05-20 14:36:21 -10:00
Rohith Surabattula
9687c85dfb Fix KASAN identified use-after-free issue.
[  612.157429] ==================================================================
[  612.158275] BUG: KASAN: use-after-free in process_one_work+0x90/0x9b0
[  612.158801] Read of size 8 at addr ffff88810a31ca60 by task kworker/2:9/2382

[  612.159611] CPU: 2 PID: 2382 Comm: kworker/2:9 Tainted: G
OE     5.13.0-rc2+ #98
[  612.159623] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS 1.14.0-1.fc33 04/01/2014
[  612.159640] Workqueue:  0x0 (deferredclose)
[  612.159669] Call Trace:
[  612.159685]  dump_stack+0xbb/0x107
[  612.159711]  print_address_description.constprop.0+0x18/0x140
[  612.159733]  ? process_one_work+0x90/0x9b0
[  612.159743]  ? process_one_work+0x90/0x9b0
[  612.159754]  kasan_report.cold+0x7c/0xd8
[  612.159778]  ? lock_is_held_type+0x80/0x130
[  612.159789]  ? process_one_work+0x90/0x9b0
[  612.159812]  kasan_check_range+0x145/0x1a0
[  612.159834]  process_one_work+0x90/0x9b0
[  612.159877]  ? pwq_dec_nr_in_flight+0x110/0x110
[  612.159914]  ? spin_bug+0x90/0x90
[  612.159967]  worker_thread+0x3b6/0x6c0
[  612.160023]  ? process_one_work+0x9b0/0x9b0
[  612.160038]  kthread+0x1dc/0x200
[  612.160051]  ? kthread_create_worker_on_cpu+0xd0/0xd0
[  612.160092]  ret_from_fork+0x1f/0x30

[  612.160399] Allocated by task 2358:
[  612.160757]  kasan_save_stack+0x1b/0x40
[  612.160768]  __kasan_kmalloc+0x9b/0xd0
[  612.160778]  cifs_new_fileinfo+0xb0/0x960 [cifs]
[  612.161170]  cifs_open+0xadf/0xf20 [cifs]
[  612.161421]  do_dentry_open+0x2aa/0x6b0
[  612.161432]  path_openat+0xbd9/0xfa0
[  612.161441]  do_filp_open+0x11d/0x230
[  612.161450]  do_sys_openat2+0x115/0x240
[  612.161460]  __x64_sys_openat+0xce/0x140

When mod_delayed_work is called to modify the delay of pending work,
it might return false and queue a new work when pending work is
already scheduled or when try to grab pending work failed.

So, Increase the reference count when new work is scheduled to
avoid use-after-free.

Signed-off-by: Rohith Surabattula <rohiths@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-05-20 12:20:42 -05:00
Linus Torvalds
f01da525b3 RDMA first v5.13 rc Pull Request
A mixture of small bug fixes, most for longer standing problems:
 
 - NULL pointer crash in siw
 
 - Various error unwind bugs in siw, rxe, cm
 
 - User triggerable errors in uverbs
 
 - Minor bugs in mlx5 and rxe drivers
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEfB7FMLh+8QxL+6i3OG33FX4gmxoFAmCmawgACgkQOG33FX4g
 mxp1HRAAh/y1AGM9CnegxxH87YnXlmqJUAE64WAChM99exWPKLoKKibDHlMkkXsb
 eFvSZ294gsnGhEmZuVX3MeCFmkvTQC1cIFm5Z5xWLVU3NZ8oAGu2AmiqwEYMIMSI
 iXf5dENJDRmseZVFTCPlkPzrr8r1LjK+eeY5I9CX+ZbPkjC6iNKA7xsc1xXbW8WY
 aRGC8LYEUTpujmoGQtw4ET8R2szY2L5jX3XqofUraCT0nAjqoe/6uH09wbqHrLOs
 O27ZEYQIG4Ji+oHFfMthwYM+Ofo1SllkbO4IN784TxW7cj53clXsnZqh66829mdC
 qF+tuNGGw6GrJm7XbVkhZYb+P4EPYLFEeDPN3XJFsSc148Snwv5b7+/gRdNf3j8j
 pL/2c//6xueRfHuU+crFDE4hOgkb1JO466QN3krAI+kpqdz82W2CCKxoihCUZJKO
 jkXeOckek7siU95J4KKGN1PfbgKQpaQdV0ZV+1G/CpLDnuoiaIIPOQjnYmEexwAz
 5zTBto5O9Dj/VozQ6msrMgORDVjCjEzkhRKL+/R9LrT5gOQzVvjp5E9vVEMjmupc
 6Vhc7AKXy+En8sAgm2KFUO4IeT83uRhd5TpcD/tlZURb2RNh3Qyc7s3veIqanQYe
 33ELd/YEyV9j7ftrF/Krebc3JavV1kjl1/vIf8hkVv4/q/C8yWs=
 =c71x
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Pull rdma fixes from Jason Gunthorpe:
 "A mixture of small bug fixes, most for longer standing problems:

   - NULL pointer crash in siw

   - Various error unwind bugs in siw, rxe, cm

   - User triggerable errors in uverbs

   - Minor bugs in mlx5 and rxe drivers"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  RDMA/uverbs: Fix a NULL vs IS_ERR() bug
  RDMA/mlx5: Fix query DCT via DEVX
  RDMA/core: Don't access cm_id after its destruction
  RDMA/rxe: Return CQE error if invalid lkey was supplied
  RDMA/mlx5: Recover from fatal event in dual port mode
  RDMA/mlx5: Verify that DM operation is reasonable
  RDMA/rxe: Clear all QP fields if creation failed
  RDMA/core: Prevent divide-by-zero error triggered by the user
  RDMA/siw: Release xarray entry
  RDMA/siw: Properly check send and receive CQ pointers
2021-05-20 06:44:04 -10:00
Linus Torvalds
6aa37a53ff sound fixes for 5.13-rc3
All small device-specific fixes here: a series of FireWire audio
 fixes, UAF and other fixes in USB-audio and co spotted by fuzzer,
 and a few HD-audio quirks as usual.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmCmWVMOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9m2w//YxOAOvTyko8PF+bHFJ2na2biWmyBZKrFxBj4
 w6eLLVJMFXHmJaljWaXRU4SLTAEZaI1Ow9sT02a43l+4vgqws4KL5byDxlQ0VR9K
 LTd6/Amxc15MQu6JkDZNB/LncWYmqj+0/snjuKNqre3oaRgPOWaXhjz6i9eZ6g+0
 juFcBICx+GaT530Hr2lvyxzGWVMgAF2P568G0JWa2kulyeWDzGwhYGT8ru/40inK
 HcYAszWF9mWk02zqT1e08Em7PB0V8k2/AUiGa4Rtz9HBKeUa+dhq1gkLFVRwsPrk
 wR6b839f6NePv6jiVhej3lMnBDcIkVBPR3N2U6akhOrijv4Zt6dAhd23M3JG4/he
 2EUGkjWBz+zT3G1Kf2raOwIDGoZXvRsav/z/Klw6Jjo+peLbEwzSshmBmO82rUKI
 bValqIML56to1BGRso0gkrUYRpSEq4o9GpKIQaH2hrMCSEAb+D9TqOMKpv1Mt95o
 jGSXpNOpbgCaQB9V8j04NztodJbGhCYUWClqXs4xPmc8Elenthbcpfsec0G//b9W
 I8xx1qu5OHvu/yFgSRL/HGoyDrJm+5xvRyTswXWUKdawsOdK3mybVI66nCUjrtiT
 G+YMFo1h9XaT6coIbdeIWJmVAjDIkfVB/4QLEQwPtmFC88Bkm4Y2auw0Bm2vJMx6
 nx6JznM=
 =N3Xy
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "All small device-specific fixes here: a series of FireWire audio
  fixes, UAF and other fixes in USB-audio and co spotted by fuzzer,
  and a few HD-audio quirks as usual"

* tag 'sound-5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: line6: Fix racy initialization of LINE6 MIDI
  ALSA: dice: fix stream format for TC Electronic Konnekt Live at high sampling transfer frequency
  ALSA: dice: disable double_pcm_frames mode for M-Audio Profire 610, 2626 and Avid M-Box 3 Pro
  ALSA: intel8x0: Don't update period unless prepared
  ALSA: hda/realtek: Add some CLOVE SSIDs of ALC293
  ALSA: firewire-lib: fix amdtp_packet tracepoints event for packet_index field
  ALSA: firewire-lib: fix calculation for size of IR context payload
  ALSA: firewire-lib: fix check for the size of isochronous packet payload
  ALSA: bebob/oxfw: fix Kconfig entry for Mackie d.2 Pro
  ALSA: dice: fix stream format at middle sampling rate for Alesis iO 26
  ALSA: hda/realtek: Add fixup for HP Spectre x360 15-df0xxx
  ALSA: usb-audio: Fix potential out-of-bounce access in MIDI EP parser
  ALSA: usb-audio: Validate MS endpoint descriptors
  ALSA: hda: fixup headset for ASUS GU502 laptop
  ALSA: hda/realtek: reset eapd coeff to default value for alc287
2021-05-20 06:42:21 -10:00
Linus Torvalds
9ebd811816 platform-drivers-x86 for v5.13-2
Assorted pdx86 bug-fixes and model-specific quirks for 5.13.
 
 The following is an automated git shortlog grouped by driver:
 
 dell-smbios-wmi:
  -  Fix oops on rmmod dell_smbios
 
 gigabyte-wmi:
  -  add support for B550 Aorus Elite
  -  add support for X570 UD
  -  streamline dmi matching
 
 hp-wireless:
  -  add AMD's hardware id to the supported list
 
 hp_accel:
  -  Avoid invoking _INI to speed up resume
 
 ideapad-laptop:
  -  fix method name typo
  -  fix a NULL pointer dereference
 
 intel_int0002_vgpio:
  -  Only call enable_irq_wake() when using s2idle
 
 intel_punit_ipc:
  -  Append MODULE_DEVICE_TABLE for ACPI
 
 platform/mellanox:
  -  mlxbf-tmfifo: Fix a memory barrier issue
 
 platform/surface:
  -  dtx: Fix poll function
  -  aggregator: Add platform-drivers-x86 list to MAINTAINERS entry
  -  aggregator: avoid clang -Wconstant-conversion warning
  -  aggregator: Do not mark interrupt as shared
 
 touchscreen_dmi:
  -  Add info for the Chuwi Hi10 Pro (CWI529) tablet
  -  Add info for the Mediacom Winpad 7.0 W700 tablet
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmCmV18UHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9zSIQf7BKTfLK4dw15XpDk4Tie5FruysEYB
 HpS0tk5OoCiTIAT4J4DO+nbqx4+sGkyt/50uCptT4TI6CoZMgn1VqOCLF1cx0Q4T
 ilKWt+63IqtxG7/EYYp0lbleb15ea/A8XEFyayWgO/z1Xgng6+j2NyiMpwdxV2WD
 yGoO4E6VLmtxja7GaVK21s3M5z9iznul4G7pIo1yEkegxxSADUXjlqGkTEbM+eO7
 EloIGjGSCVXyl0yzStJTzKY5kkI6MXlHwicQBlGiyZN+Dzcax+kTiViGUCd9bw2X
 Sp9uSJ3DvVsKPWzjwwEXEz1wBAs1t3p0Y6WqwROjANKPgyishNCIzakkew==
 =DK1K
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:
 "Assorted pdx86 bug-fixes and model-specific quirks for 5.13"

* tag 'platform-drivers-x86-v5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: touchscreen_dmi: Add info for the Chuwi Hi10 Pro (CWI529) tablet
  platform/x86: touchscreen_dmi: Add info for the Mediacom Winpad 7.0 W700 tablet
  platform/x86: intel_punit_ipc: Append MODULE_DEVICE_TABLE for ACPI
  platform/x86: dell-smbios-wmi: Fix oops on rmmod dell_smbios
  platform/x86: hp-wireless: add AMD's hardware id to the supported list
  platform/x86: intel_int0002_vgpio: Only call enable_irq_wake() when using s2idle
  platform/x86: gigabyte-wmi: add support for B550 Aorus Elite
  platform/x86: gigabyte-wmi: add support for X570 UD
  platform/x86: gigabyte-wmi: streamline dmi matching
  platform/mellanox: mlxbf-tmfifo: Fix a memory barrier issue
  platform/surface: dtx: Fix poll function
  platform/surface: aggregator: Add platform-drivers-x86 list to MAINTAINERS entry
  platform/surface: aggregator: avoid clang -Wconstant-conversion warning
  platform/surface: aggregator: Do not mark interrupt as shared
  platform/x86: hp_accel: Avoid invoking _INI to speed up resume
  platform/x86: ideapad-laptop: fix method name typo
  platform/x86: ideapad-laptop: fix a NULL pointer dereference
2021-05-20 06:40:20 -10:00
Linus Torvalds
50f09a3dd5 Char/misc driver fixes for 5.13-rc3
Here is a big set of char/misc/other driver fixes for 5.13-rc3.
 
 The majority here is the fallout of the umn.edu re-review of all prior
 submissions.  That resulted in a bunch of reverts along with the
 "correct" changes made, such that there is no regression of any of the
 potential fixes that were made by those individuals.  I would like to
 thank the over 80 different developers who helped with the review and
 fixes for this mess.
 
 Other than that, there's a few habanna driver fixes for reported issues,
 and some dyndbg fixes for reported problems.
 
 All of these have been in linux-next for a while with no reported
 problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYKZCBg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynhRQCdGk6ri4oluyn/Z/2KAjvXDOmTmvgAn12VP42d
 S1Zmh4qRH2OWaLOBg7c2
 =qtxj
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
 "Here is a big set of char/misc/other driver fixes for 5.13-rc3.

  The majority here is the fallout of the umn.edu re-review of all prior
  submissions. That resulted in a bunch of reverts along with the
  "correct" changes made, such that there is no regression of any of the
  potential fixes that were made by those individuals. I would like to
  thank the over 80 different developers who helped with the review and
  fixes for this mess.

  Other than that, there's a few habanna driver fixes for reported
  issues, and some dyndbg fixes for reported problems.

  All of these have been in linux-next for a while with no reported
  problems"

* tag 'char-misc-5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (82 commits)
  misc: eeprom: at24: check suspend status before disable regulator
  uio_hv_generic: Fix another memory leak in error handling paths
  uio_hv_generic: Fix a memory leak in error handling paths
  uio/uio_pci_generic: fix return value changed in refactoring
  Revert "Revert "ALSA: usx2y: Fix potential NULL pointer dereference""
  dyndbg: drop uninformative vpr_info
  dyndbg: avoid calling dyndbg_emit_prefix when it has no work
  binder: Return EFAULT if we fail BINDER_ENABLE_ONEWAY_SPAM_DETECTION
  cdrom: gdrom: initialize global variable at init time
  brcmfmac: properly check for bus register errors
  Revert "brcmfmac: add a check for the status of usb_register"
  video: imsttfb: check for ioremap() failures
  Revert "video: imsttfb: fix potential NULL pointer dereferences"
  net: liquidio: Add missing null pointer checks
  Revert "net: liquidio: fix a NULL pointer dereference"
  media: gspca: properly check for errors in po1030_probe()
  Revert "media: gspca: Check the return value of write_bridge for timeout"
  media: gspca: mt9m111: Check write_bridge for timeout
  Revert "media: gspca: mt9m111: Check write_bridge for timeout"
  media: dvb: Add check on sp8870_readreg return
  ...
2021-05-20 06:31:52 -10:00
Linus Torvalds
7ac177143c \n
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEq1nRK9aeMoq1VSgcnJ2qBz9kQNkFAmCmN9AACgkQnJ2qBz9k
 QNn5ZwgAwnLdgBuILDqJwPaYpXOzvMhjjG8AwBDzhMYhhpt+OOCUevoRm7mDU7J2
 t/DlwWGMhpp80ku+x+AURR/ltOfFvw4QAHeIXPWjkoieFKcLOEvAjWWZP6oIFC12
 5e/QVXqK58fuRJwveYp4jZ+AXvDMoHJrDXsoTFezjBDIQQgzlIlrMzPavS/6UzUN
 mAF2sapE9lcQoRMfU8kktBWPVM/GpFkus2Q48EYFCZ1rp3aRyw/aahTVuvSUZCV0
 XiY6f2F7qgFLtomK6UurlxTc7rPsrG+UmNvGWuXf3R81UawegmKQeG5zcaMGrZs1
 kHyJQcP9nGYPLDXt/4kW9cY0s8oOKg==
 =RbOE
 -----END PGP SIGNATURE-----

Merge tag 'quota_for_v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull quota fixes from Jan Kara:
 "The most important part in the pull is disablement of the new syscall
  quotactl_path() which was added in rc1.

  The reason is some people at LWN discussion pointed out dirfd would be
  useful for this path based syscall and Christian Brauner agreed.

  Without dirfd it may be indeed problematic for containers. So let's
  just disable the syscall for now when it doesn't have users yet so
  that we have more time to mull over how to best specify the filesystem
  we want to work on"

* tag 'quota_for_v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  quota: Disable quotactl_path syscall
  quota: Use 'hlist_for_each_entry' to simplify code
2021-05-20 06:20:15 -10:00
Darrick J. Wong
e3c2b04747 xfs: restore old ioctl definitions
These ioctl definitions in xfs_fs.h are part of the userspace ABI and
were mistakenly removed during the 5.13 merge window.

Fixes: 9fefd5db08 ("xfs: convert to fileattr")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2021-05-20 08:31:22 -07:00
Darrick J. Wong
16c9de54dc xfs: fix deadlock retry tracepoint arguments
sc->ip is the inode that's being scrubbed, which means that it's not set
for scrub types that don't involve inodes.  If one of those scrubbers
(e.g. inode btrees) returns EDEADLOCK, we'll trip over the null pointer.
Fix that by reporting either the file being examined or the file that
was used to call scrub.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
2021-05-20 08:31:22 -07:00
Darrick J. Wong
676a659b60 xfs: retry allocations when locality-based search fails
If a realtime allocation fails because we can't find a sufficiently
large free extent satisfying locality rules, relax the locality rules
and try again.  This reduces the occurrence of short writes to realtime
files when the write size is large and the free space is fragmented.

This was originally discovered by running generic/186 with the realtime
reflink patchset and a 128k cow extent size hint, but the short write
symptoms can manifest with a 128k extent size hint and no reflink, so
apply the fix now.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
2021-05-20 08:28:34 -07:00
Nicholas Piggin
d72500f992 powerpc/64s/syscall: Fix ptrace syscall info with scv syscalls
The scv implementation missed updating syscall return value and error
value get/set functions to deal with the changed register ABI. This
broke ptrace PTRACE_GET_SYSCALL_INFO as well as some kernel auditing
and tracing functions.

Fix. tools/testing/selftests/ptrace/get_syscall_info now passes when
scv is used.

Fixes: 7fa95f9ada ("powerpc/64s: system call support for scv/rfscv instructions")
Cc: stable@vger.kernel.org # v5.9+
Reported-by: "Dmitry V. Levin" <ldv@altlinux.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210520111931.2597127-2-npiggin@gmail.com
2021-05-21 00:58:56 +10:00
Nicholas Piggin
5665bc35c1 powerpc/64s/syscall: Use pt_regs.trap to distinguish syscall ABI difference between sc and scv syscalls
The sc and scv 0 system calls have different ABI conventions, and
ptracers need to know which system call type is being used if they want
to look at the syscall registers.

Document that pt_regs.trap can be used for this, and fix one in-tree user
to work with scv 0 syscalls.

Fixes: 7fa95f9ada ("powerpc/64s: system call support for scv/rfscv instructions")
Cc: stable@vger.kernel.org # v5.9+
Reported-by: "Dmitry V. Levin" <ldv@altlinux.org>
Suggested-by: "Dmitry V. Levin" <ldv@altlinux.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210520111931.2597127-1-npiggin@gmail.com
2021-05-21 00:58:03 +10:00
Gulam Mohamed
bc6a385132 block: fix a race between del_gendisk and BLKRRPART
When BLKRRPART is called concurrently with del_gendisk, the partitions
rescan can create a stale partition that will never be be cleaned up.

Fix this by checking the the disk is up before rescanning partitions
while under bd_mutex.

Signed-off-by: Gulam Mohamed <gulam.mohamed@oracle.com>
[hch: split from a larger patch]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20210514131842.1600568-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-05-20 07:59:35 -06:00
Christoph Hellwig
6c60ff048c block: prevent block device lookups at the beginning of del_gendisk
As an artifact of how gendisk lookup used to work in earlier kernels,
GENHD_FL_UP is only cleared very late in del_gendisk, and a global lock
is used to prevent opens from succeeding while del_gendisk is tearing
down the gendisk.  Switch to clearing the flag early and under bd_mutex
so that callers can use bd_mutex to stabilize the flag, which removes
the need for the global mutex.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20210514131842.1600568-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-05-20 07:59:35 -06:00
Jens Axboe
9a66e6bd7e nvme fixes for Linux 5.13:
- nvme-tcp corruption and timeout fixes (Sagi Grimberg, Keith Busch)
  - nvme-fc teardown fix (James Smart)
  - nvmet/nvme-loop memory leak fixes (Wu Bo)
 -----BEGIN PGP SIGNATURE-----
 
 iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAmCmFWoLHGhjaEBsc3Qu
 ZGUACgkQD55TZVIEUYNgIRAAvUYu3mC5Kac7a9hn8RHUF4eAROkHHtZvR7CLkZEx
 99k1XFG1oBUwmFfHZti/L5qONwSCmSyK4cUKzXFzXGCJvDaXSI0bxzRL9AxearP4
 Z2sJv4gxuVw2U60cWUfpd9cuhFJNA0+HsR4WIQfMyh4ZWp/6n+SipV1nyKfKplD7
 QfEvncI/rohUED6QQfXKkFbqilH/LPb7Zqb7h5IvhcN1sZlGnnwPU7sMDgK7pNjW
 v5dJCBv/xWlXr1RZ0LSEZYwgX7kvU+Yqmv2jjaVbyaBGKlSbHICbDnhOiTp+lMfa
 ChJA3R6xVNaeMTjikDcpcAwIjze6JJWnnmXysKkcT367w0lSpvpYr2DK/podDkrL
 xVMKH1TXvUzBWRGWLSBg9wVbTLpjNIT9nZNzVor6juAehvDIUWGCYUnaqi1ypZK4
 EPKCEyGH67fHv5dYXAWfc9SQCwygkIi1A5R5rPiSjT7WbK0Io+oCWrhmabjA7Da8
 G895M1XW7y8AmEsDvjVg0UebIbpUNdRTXHIHe4zs2r1FuvT1L0lNlQcxYBiA+brh
 kTdfPniAMKKkPlZNlm6e+Mg0q+nedqxOBxjMRyVbt1MHxCeo/2rstCyirL8tnY0s
 p5QiV3S8gXqHRikm7S7aPuza3Saku1cgp6z0iev+/73dPnYtEGlnGss0ZveXH9sL
 KP8=
 =wLa9
 -----END PGP SIGNATURE-----

Merge tag 'nvme-5.13-2021-05-20' of git://git.infradead.org/nvme into block-5.13

Pull NVMe fixes from Christoph:

"nvme fixes for Linux 5.13:

 - nvme-tcp corruption and timeout fixes (Sagi Grimberg, Keith Busch)
 - nvme-fc teardown fix (James Smart)
 - nvmet/nvme-loop memory leak fixes (Wu Bo)"

* tag 'nvme-5.13-2021-05-20' of git://git.infradead.org/nvme:
  nvme-fc: clear q_live at beginning of association teardown
  nvme-tcp: rerun io_work if req_list is not empty
  nvme-tcp: fix possible use-after-completion
  nvme-loop: fix memory leak in nvme_loop_create_ctrl()
  nvmet: fix memory leak in nvmet_alloc_ctrl()
2021-05-20 07:54:49 -06:00
Johannes Thumshirn
764c7c9a46 btrfs: zoned: fix parallel compressed writes
When multiple processes write data to the same block group on a
compressed zoned filesystem, the underlying device could report I/O
errors and data corruption is possible.

This happens because on a zoned file system, compressed data writes
where sent to the device via a REQ_OP_WRITE instead of a
REQ_OP_ZONE_APPEND operation. But with REQ_OP_WRITE and parallel
submission it cannot be guaranteed that the data is always submitted
aligned to the underlying zone's write pointer.

The change to using REQ_OP_ZONE_APPEND instead of REQ_OP_WRITE on a
zoned filesystem is non intrusive on a regular file system or when
submitting to a conventional zone on a zoned filesystem, as it is
guarded by btrfs_use_zone_append.

Reported-by: David Sterba <dsterba@suse.com>
Fixes: 9d294a685f ("btrfs: zoned: enable to mount ZONED incompat flag")
CC: stable@vger.kernel.org # 5.12.x: e380adfc21: btrfs: zoned: pass start block to btrfs_use_zone_append
CC: stable@vger.kernel.org # 5.12.x
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-05-20 15:51:07 +02:00
Johannes Thumshirn
e380adfc21 btrfs: zoned: pass start block to btrfs_use_zone_append
btrfs_use_zone_append only needs the passed in extent_map's block_start
member, so there's no need to pass in the full extent map.

This also enables the use of btrfs_use_zone_append in places where we only
have a start byte but no extent_map.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-05-20 15:50:49 +02:00
Pavel Begunkov
ba5ef6dc8a io_uring: fortify tctx/io_wq cleanup
We don't want anyone poking into tctx->io_wq awhile it's being destroyed
by io_wq_put_and_exit(), and even though it shouldn't even happen, if
buggy would be preferable to get a NULL-deref instead of subtle delayed
failure or UAF.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/827b021de17926fd807610b3e53a5a5fa8530856.1621513214.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-05-20 07:29:11 -06:00
Hans de Goede
e68671e9e1 platform/x86: touchscreen_dmi: Add info for the Chuwi Hi10 Pro (CWI529) tablet
Add touchscreen info for the Chuwi Hi10 Pro (CWI529) tablet. This includes
info for getting the firmware directly from the UEFI, so that the user does
not need to manually install the firmware in /lib/firmware/silead.

This change will make the touchscreen on these devices work OOTB,
without requiring any manual setup.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210520093228.7439-1-hdegoede@redhat.com
2021-05-20 14:11:03 +02:00
Christian König
7e008b0255 dma-buf: fix unintended pin/unpin warnings
DMA-buf internal users call the pin/unpin functions without having a
dynamic attachment. Avoid the warning and backtrace in the logs.

Signed-off-by: Christian König <christian.koenig@amd.com>
Bugs: https://gitlab.freedesktop.org/drm/intel/-/issues/3481
Fixes: c545781e1c ("dma-buf: doc polish for pin/unpin")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
CC: stable@kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20210517115705.2141-1-christian.koenig@amd.com
2021-05-20 14:02:27 +02:00
Alexey Kardashevskiy
e2f5efd0f0 powerpc: Fix early setup to make early_ioremap() work
The immediate problem is that after commit
0bd3f9e953 ("powerpc/legacy_serial: Use early_ioremap()") the kernel
silently reboots on some systems.

The reason is that early_ioremap() returns broken addresses as it uses
slot_virt[] array which initialized with offsets from FIXADDR_TOP ==
IOREMAP_END+FIXADDR_SIZE == KERN_IO_END - FIXADDR_SIZ + FIXADDR_SIZE ==
__kernel_io_end which is 0 when early_ioremap_setup() is called.
__kernel_io_end is initialized little bit later in early_init_mmu().

This fixes the initialization by swapping early_ioremap_setup() and
early_init_mmu().

Fixes: 265c3491c4 ("powerpc: Add support for GENERIC_EARLY_IOREMAP")
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
[mpe: Drop unrelated cleanup & cleanup change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210520032919.358935-1-aik@ozlabs.ru
2021-05-20 16:43:26 +10:00
Rohith Surabattula
0ab95c2510 Defer close only when lease is enabled.
When smb2 lease parameter is disabled on server. Server grants
batch oplock instead of RHW lease by default on open, inode page cache
needs to be zapped immediatley upon close as cache is not valid.

Signed-off-by: Rohith Surabattula <rohiths@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-05-19 21:11:28 -05:00
Rohith Surabattula
860b69a9d7 Fix kernel oops when CONFIG_DEBUG_ATOMIC_SLEEP is enabled.
Removed oplock_break_received flag which was added to achieve
synchronization between oplock handler and open handler by earlier commit.

It is not needed because there is an existing lock open_file_lock to achieve
the same. find_readable_file takes open_file_lock and then traverses the
openFileList. Similarly, cifs_oplock_break while closing the deferred
handle (i.e cifsFileInfo_put) takes open_file_lock and then sends close
to the server.

Added comments for better readability.

Signed-off-by: Rohith Surabattula <rohiths@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-05-19 21:11:26 -05:00
Jiapeng Chong
e83aa3528a cifs: Fix inconsistent indenting
Eliminate the follow smatch warning:

fs/cifs/fs_context.c:1148 smb3_fs_context_parse_param() warn:
inconsistent indenting.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-05-19 21:11:09 -05:00
Ronnie Sahlberg
d201d7631c cifs: fix memory leak in smb2_copychunk_range
When using smb2_copychunk_range() for large ranges we will
run through several iterations of a loop calling SMB2_ioctl()
but never actually free the returned buffer except for the final
iteration.
This leads to memory leaks everytime a large copychunk is requested.

Fixes: 9bf0c9cd43 ("CIFS: Fix SMB2/SMB3 Copy offload support (refcopy) for large files")
Cc: <stable@vger.kernel.org>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-05-19 19:19:20 -05:00
Christian König
a2b4785f01 drm/amdgpu: stop touching sched.ready in the backend
This unfortunately comes up in regular intervals and breaks
GPU reset for the engine in question.

The sched.ready flag controls if an engine can't get working
during hw_init, but should never be set to false during hw_fini.

v2: squash in unused variable fix (Alex)

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-05-19 18:07:43 -04:00
Lang Yu
9c2876d56f drm/amd/amdgpu: fix a potential deadlock in gpu reset
When amdgpu_ib_ring_tests failed, the reset logic called
amdgpu_device_ip_suspend twice, then deadlock occurred.
Deadlock log:

[  805.655192] amdgpu 0000:04:00.0: amdgpu: ib ring test failed (-110).
[  806.290952] [drm] free PSP TMR buffer

[  806.319406] ============================================
[  806.320315] WARNING: possible recursive locking detected
[  806.321225] 5.11.0-custom #1 Tainted: G        W  OEL
[  806.322135] --------------------------------------------
[  806.323043] cat/2593 is trying to acquire lock:
[  806.323825] ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
[  806.325668]
               but task is already holding lock:
[  806.326664] ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
[  806.328430]
               other info that might help us debug this:
[  806.329539]  Possible unsafe locking scenario:

[  806.330549]        CPU0
[  806.330983]        ----
[  806.331416]   lock(&adev->dm.dc_lock);
[  806.332086]   lock(&adev->dm.dc_lock);
[  806.332738]
                *** DEADLOCK ***

[  806.333747]  May be due to missing lock nesting notation

[  806.334899] 3 locks held by cat/2593:
[  806.335537]  #0: ffff888100d3f1b8 (&attr->mutex){+.+.}-{3:3}, at: simple_attr_read+0x4e/0x110
[  806.337009]  #1: ffff888136b1fd78 (&adev->reset_sem){++++}-{3:3}, at: amdgpu_device_lock_adev+0x42/0x94 [amdgpu]
[  806.339018]  #2: ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
[  806.340869]
               stack backtrace:
[  806.341621] CPU: 6 PID: 2593 Comm: cat Tainted: G        W  OEL    5.11.0-custom #1
[  806.342921] Hardware name: AMD Celadon-CZN/Celadon-CZN, BIOS WLD0C23N_Weekly_20_12_2 12/23/2020
[  806.344413] Call Trace:
[  806.344849]  dump_stack+0x93/0xbd
[  806.345435]  __lock_acquire.cold+0x18a/0x2cf
[  806.346179]  lock_acquire+0xca/0x390
[  806.346807]  ? dm_suspend+0xb8/0x1d0 [amdgpu]
[  806.347813]  __mutex_lock+0x9b/0x930
[  806.348454]  ? dm_suspend+0xb8/0x1d0 [amdgpu]
[  806.349434]  ? amdgpu_device_indirect_rreg+0x58/0x70 [amdgpu]
[  806.350581]  ? _raw_spin_unlock_irqrestore+0x47/0x50
[  806.351437]  ? dm_suspend+0xb8/0x1d0 [amdgpu]
[  806.352437]  ? rcu_read_lock_sched_held+0x4f/0x80
[  806.353252]  ? rcu_read_lock_sched_held+0x4f/0x80
[  806.354064]  mutex_lock_nested+0x1b/0x20
[  806.354747]  ? mutex_lock_nested+0x1b/0x20
[  806.355457]  dm_suspend+0xb8/0x1d0 [amdgpu]
[  806.356427]  ? soc15_common_set_clockgating_state+0x17d/0x19 [amdgpu]
[  806.357736]  amdgpu_device_ip_suspend_phase1+0x78/0xd0 [amdgpu]
[  806.360394]  amdgpu_device_ip_suspend+0x21/0x70 [amdgpu]
[  806.362926]  amdgpu_device_pre_asic_reset+0xb3/0x270 [amdgpu]
[  806.365560]  amdgpu_device_gpu_recover.cold+0x679/0x8eb [amdgpu]

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Acked-by: Christian KÃnig <christian.koenig@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-05-19 18:07:23 -04:00
Guchun Chen
77194d8642 drm/amdgpu: update sdma golden setting for Navi12
Current golden setting is out of date.

Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2021-05-19 18:07:00 -04:00
Guchun Chen
99c45ba579 drm/amdgpu: update gc golden setting for Navi12
Current golden setting is out of date.

Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2021-05-19 18:06:45 -04:00
xinhui pan
1e5c373850 drm/amdgpu: Fix a use-after-free
looks like we forget to set ttm->sg to NULL.
Hit panic below

[ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: 0000 [#1] SMP DEBUG_PAGEALLOC NOPTI
[ 1235.989074] Call Trace:
[ 1235.991751]  sg_free_table+0x17/0x20
[ 1235.995667]  amdgpu_ttm_backend_unbind.cold+0x4d/0xf7 [amdgpu]
[ 1236.002288]  amdgpu_ttm_backend_destroy+0x29/0x130 [amdgpu]
[ 1236.008464]  ttm_tt_destroy+0x1e/0x30 [ttm]
[ 1236.013066]  ttm_bo_cleanup_memtype_use+0x51/0xa0 [ttm]
[ 1236.018783]  ttm_bo_release+0x262/0xa50 [ttm]
[ 1236.023547]  ttm_bo_put+0x82/0xd0 [ttm]
[ 1236.027766]  amdgpu_bo_unref+0x26/0x50 [amdgpu]
[ 1236.032809]  amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu+0x7aa/0xd90 [amdgpu]
[ 1236.040400]  kfd_ioctl_alloc_memory_of_gpu+0xe2/0x330 [amdgpu]
[ 1236.046912]  kfd_ioctl+0x463/0x690 [amdgpu]

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-05-19 18:06:29 -04:00
James Zhu
ab95cb3e1b drm/amdgpu: add video_codecs query support for aldebaran
Add video_codecs query support for aldebaran.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-05-19 18:05:50 -04:00
Jingwen Chen
fa7e6abc75 drm/amd/amdgpu: fix refcount leak
[Why]
the gem object rfb->base.obj[0] is get according to num_planes
in amdgpufb_create, but is not put according to num_planes

[How]
put rfb->base.obj[0] in amdgpu_fbdev_destroy according to num_planes

Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-05-19 18:04:44 -04:00
Chris Park
080039273b drm/amd/display: Disconnect non-DP with no EDID
[Why]
Active DP dongles return no EDID when dongle
is connected, but VGA display is taken out.
Current driver behavior does not remove the
active display when this happens, and this is
a gap between dongle DTP and dongle behavior.

[How]
For active DP dongles and non-DP scenario,
disconnect sink on detection when no EDID
is read due to timeout.

Signed-off-by: Chris Park <Chris.Park@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-05-19 18:03:30 -04:00
Changfeng
dbd1003d12 drm/amdgpu: disable 3DCGCG on picasso/raven1 to avoid compute hang
There is problem with 3DCGCG firmware and it will cause compute test
hang on picasso/raven1. It needs to disable 3DCGCG in driver to avoid
compute hang.

Signed-off-by: Changfeng <Changfeng.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2021-05-19 18:02:27 -04:00
Yi Li
d537515683 drm/amdgpu: Fix GPU TLB update error when PAGE_SIZE > AMDGPU_PAGE_SIZE
When PAGE_SIZE is larger than AMDGPU_PAGE_SIZE, the number of GPU TLB
entries which need to update in amdgpu_map_buffer() should be multiplied
by AMDGPU_GPU_PAGES_IN_CPU_PAGE (PAGE_SIZE / AMDGPU_PAGE_SIZE).

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Yi Li <liyi@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2021-05-19 18:01:51 -04:00
Christian König
0c8df343c2 drm/radeon: use the dummy page for GART if needed
Imported BOs don't have a pagelist any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Fixes: 0575ff3d33 ("drm/radeon: stop using pages with drm_prime_sg_to_page_addr_arrays v2")
CC: stable@vger.kernel.org # 5.12
2021-05-19 18:00:48 -04:00
Nikola Cornij
84c63d0409 drm/amd/display: Use the correct max downscaling value for DCN3.x family
[why]
As per spec, DCN3.x can do 6:1 downscaling and DCN2.x can do 4:1. The
max downscaling limit value for DCN2.x is 250, which means it's
calculated as 1000 / 4 = 250. For DCN3.x this then gives 1000 / 6 = 167.

[how]
Set maximum downscaling limit to 167 for DCN3.x

Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Acked-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2021-05-19 17:59:06 -04:00
Dan Carpenter
463a3f6647 RDMA/uverbs: Fix a NULL vs IS_ERR() bug
The uapi_get_object() function returns error pointers, it never returns
NULL.

Fixes: 149d3845f4 ("RDMA/uverbs: Add a method to introspect handles in a context")
Link: https://lore.kernel.org/r/YJ6Got+U7lz+3n9a@mwanda
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-05-19 15:32:07 -03:00
Joerg Roedel
4954f5b8ef x86/sev-es: Use __put_user()/__get_user() for data accesses
The put_user() and get_user() functions do checks on the address which is
passed to them. They check whether the address is actually a user-space
address and whether its fine to access it. They also call might_fault()
to indicate that they could fault and possibly sleep.

All of these checks are neither wanted nor needed in the #VC exception
handler, which can be invoked from almost any context and also for MMIO
instructions from kernel space on kernel memory. All the #VC handler
wants to know is whether a fault happened when the access was tried.

This is provided by __put_user()/__get_user(), which just do the access
no matter what. Also add comments explaining why __get_user() and
__put_user() are the best choice here and why it is safe to use them
in this context. Also explain why copy_to/from_user can't be used.

In addition, also revert commit

  7024f60d65 ("x86/sev-es: Handle string port IO to kernel memory properly")

because using __get_user()/__put_user() fixes the same problem while
the above commit introduced several problems:

  1) It uses access_ok() which is only allowed in task context.

  2) It uses memcpy() which has no fault handling at all and is
     thus unsafe to use here.

  [ bp: Fix up commit ID of the reverted commit above. ]

Fixes: f980f9c31a ("x86/sev-es: Compile early handler code into kernel image")
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org # v5.10+
Link: https://lkml.kernel.org/r/20210519135251.30093-4-joro@8bytes.org
2021-05-19 18:45:37 +02:00