This is the start of the stable review cycle for the 5.4.281 release.
There are 44 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun, 28 Jul 2024 07:05:34 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.281-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.281-rc2
Si-Wei Liu <si-wei.liu(a)oracle.com>
tap: add missing verification for short frame
Dongli Zhang <dongli.zhang(a)oracle.com>
tun: add missing verification for short frame
Jann Horn <jannh(a)google.com>
filelock: Fix fcntl/close race recovery compat path
Edson Juliano Drosdeck <edson.drosdeck(a)gmail.com>
ALSA: hda/realtek: Enable headset mic on Positivo SU C1400
lei lu <llfamsec(a)gmail.com>
jfs: don't walk off the end of ealist
lei lu <llfamsec(a)gmail.com>
ocfs2: add bounds checking to ocfs2_check_dir_entry()
Paolo Abeni <pabeni(a)redhat.com>
net: relax socket state check at accept time.
Dan Carpenter <dan.carpenter(a)linaro.org>
drm/amdgpu: Fix signedness bug in sdma_v4_0_process_trap_irq()
Kuan-Wei Chiu <visitorckw(a)gmail.com>
ACPI: processor_idle: Fix invalid comparison with insertion sort for latency
Masahiro Yamada <masahiroy(a)kernel.org>
ARM: 9324/1: fix get_user() broken with veneer
Edward Adam Davis <eadavis(a)qq.com>
hfsplus: fix uninit-value in copy_name
John Hubbard <jhubbard(a)nvidia.com>
selftests/vDSO: fix clang build errors and warnings
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
spi: imx: Don't expect DMA for i.MX{25,35,50,51,53} cspi devices
Christian Brauner <brauner(a)kernel.org>
fs: better handle deep ancestor chains in is_subdir()
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
Bluetooth: hci_core: cancel all works upon hci_unregister_dev()
Xingui Yang <yangxingui(a)huawei.com>
scsi: libsas: Fix exp-attached device scan after probe failure scanned in again after probe failed
Ganesh Goudar <ganeshgr(a)linux.ibm.com>
powerpc/eeh: avoid possible crash when edev->pdev changes
Anjali K <anjalik(a)linux.ibm.com>
powerpc/pseries: Whitelist dtl slub object for copying to userspace
Yunshui Jiang <jiangyunshui(a)kylinos.cn>
net: mac802154: Fix racy device stats updates by DEV_STATS_INC() and DEV_STATS_ADD()
Daniele Palmas <dnlplm(a)gmail.com>
net: usb: qmi_wwan: add Telit FN912 compositions
Shengjiu Wang <shengjiu.wang(a)nxp.com>
ALSA: dmaengine_pcm: terminate dmaengine before synchronize
Heiko Carstens <hca(a)linux.ibm.com>
s390/sclp: Fix sclp_init() cleanup on failure
Chen Ni <nichen(a)iscas.ac.cn>
can: kvaser_usb: fix return value for hif_usb_send_regout
Primoz Fiser <primoz.fiser(a)norik.com>
ASoC: ti: omap-hdmi: Fix too long driver name
Jai Luthra <j-luthra(a)ti.com>
ASoC: ti: davinci-mcasp: Set min period size using FIFO config
Thomas GENTY <tomlohave(a)gmail.com>
bytcr_rt5640 : inverse jack detect for Archos 101 cesium
Jonathan Denose <jdenose(a)google.com>
Input: elantech - fix touchpad state on resume for Lenovo N24
Arnd Bergmann <arnd(a)arndb.de>
mips: fix compat_sys_lseek syscall
Kailang Yang <kailang(a)realtek.com>
ALSA: hda/realtek: Add more codec ID to no shutup pins list
Michael Ellerman <mpe(a)ellerman.id.au>
KVM: PPC: Book3S HV: Prevent UAF in kvm_spapr_tce_attach_iommu_group()
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: cfg80211: wext: add extra SIOCSIWSCAN data check
Alexander Usyskin <alexander.usyskin(a)intel.com>
mei: demote client disconnect warning on suspend to debug
Yuntao Wang <yuntao.wang(a)linux.dev>
fs/file: fix the check in find_next_fd()
Masahiro Yamada <masahiroy(a)kernel.org>
kconfig: remove wrong expr_trans_bool()
Masahiro Yamada <masahiroy(a)kernel.org>
kconfig: gconf: give a proper initial state to the Save button
Eric Dumazet <edumazet(a)google.com>
ila: block BH in ila_output()
Hans de Goede <hdegoede(a)redhat.com>
Input: silead - Always support 10 fingers
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: mac80211: fix UBSAN noise in ieee80211_prep_hw_scan()
Nicolas Escande <nico.escande(a)gmail.com>
wifi: mac80211: mesh: init nonpeer_pm to active by default in mesh sdata
Armin Wolf <W_Armin(a)gmx.de>
ACPI: EC: Avoid returning AE_OK on errors in address space handler
Armin Wolf <W_Armin(a)gmx.de>
ACPI: EC: Abort address space access upon error
Saurav Kashyap <skashyap(a)marvell.com>
scsi: qedf: Set qed_slowpath_params to zero before use
Jann Horn <jannh(a)google.com>
filelock: Remove locks reliably when fcntl/close race is detected
Kees Cook <keescook(a)chromium.org>
gcc-plugins: Rename last_stmt() for GCC 14+
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/uaccess.h | 14 +------
arch/mips/kernel/syscalls/syscall_o32.tbl | 2 +-
arch/powerpc/kernel/eeh_pe.c | 7 +++-
arch/powerpc/kvm/book3s_64_vio.c | 18 ++++++---
arch/powerpc/platforms/pseries/setup.c | 4 +-
drivers/acpi/ec.c | 9 ++++-
drivers/acpi/processor_idle.c | 40 ++++++++-----------
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 +-
drivers/input/mouse/elantech.c | 31 +++++++++++++++
drivers/input/touchscreen/silead.c | 19 +++------
drivers/misc/mei/main.c | 2 +-
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 2 +-
drivers/net/tap.c | 5 +++
drivers/net/tun.c | 3 ++
drivers/net/usb/qmi_wwan.c | 2 +
drivers/s390/char/sclp.c | 1 +
drivers/scsi/libsas/sas_internal.h | 14 +++++++
drivers/scsi/qedf/qedf_main.c | 1 +
drivers/spi/spi-imx.c | 2 +-
fs/dcache.c | 31 +++++++--------
fs/file.c | 4 +-
fs/hfsplus/xattr.c | 2 +-
fs/jfs/xattr.c | 23 +++++++++--
fs/locks.c | 18 ++++-----
fs/ocfs2/dir.c | 46 ++++++++++++++--------
net/bluetooth/hci_core.c | 4 ++
net/ipv4/af_inet.c | 4 +-
net/ipv6/ila/ila_lwt.c | 7 +++-
net/mac80211/mesh.c | 1 +
net/mac80211/scan.c | 14 +++++--
net/mac802154/tx.c | 8 ++--
net/wireless/scan.c | 8 +++-
scripts/gcc-plugins/gcc-common.h | 4 ++
scripts/kconfig/expr.c | 29 --------------
scripts/kconfig/expr.h | 1 -
scripts/kconfig/gconf.c | 3 +-
scripts/kconfig/menu.c | 2 -
sound/core/pcm_dmaengine.c | 12 ++++++
sound/pci/hda/patch_realtek.c | 5 +++
sound/soc/intel/boards/bytcr_rt5640.c | 11 ++++++
sound/soc/ti/davinci-mcasp.c | 9 ++++-
sound/soc/ti/omap-hdmi.c | 6 +--
tools/testing/selftests/vDSO/parse_vdso.c | 16 +++++---
.../selftests/vDSO/vdso_standalone_test_x86.c | 18 ++++++++-
45 files changed, 290 insertions(+), 178 deletions(-)
This is the start of the stable review cycle for the 4.19.319 release.
There are 33 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sat, 27 Jul 2024 14:27:16 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.319-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.319-rc1
Jann Horn <jannh(a)google.com>
filelock: Fix fcntl/close race recovery compat path
lei lu <llfamsec(a)gmail.com>
jfs: don't walk off the end of ealist
lei lu <llfamsec(a)gmail.com>
ocfs2: add bounds checking to ocfs2_check_dir_entry()
Paolo Abeni <pabeni(a)redhat.com>
net: relax socket state check at accept time.
Kuan-Wei Chiu <visitorckw(a)gmail.com>
ACPI: processor_idle: Fix invalid comparison with insertion sort for latency
Masahiro Yamada <masahiroy(a)kernel.org>
ARM: 9324/1: fix get_user() broken with veneer
Jann Horn <jannh(a)google.com>
filelock: Remove locks reliably when fcntl/close race is detected
Edward Adam Davis <eadavis(a)qq.com>
hfsplus: fix uninit-value in copy_name
John Hubbard <jhubbard(a)nvidia.com>
selftests/vDSO: fix clang build errors and warnings
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
spi: imx: Don't expect DMA for i.MX{25,35,50,51,53} cspi devices
Christian Brauner <brauner(a)kernel.org>
fs: better handle deep ancestor chains in is_subdir()
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
Bluetooth: hci_core: cancel all works upon hci_unregister_dev()
Yunshui Jiang <jiangyunshui(a)kylinos.cn>
net: mac802154: Fix racy device stats updates by DEV_STATS_INC() and DEV_STATS_ADD()
Daniele Palmas <dnlplm(a)gmail.com>
net: usb: qmi_wwan: add Telit FN912 compositions
Shengjiu Wang <shengjiu.wang(a)nxp.com>
ALSA: dmaengine_pcm: terminate dmaengine before synchronize
Heiko Carstens <hca(a)linux.ibm.com>
s390/sclp: Fix sclp_init() cleanup on failure
Ian Ray <ian.ray(a)gehealthcare.com>
gpio: pca953x: fix pca953x_irq_bus_sync_unlock race
Chen Ni <nichen(a)iscas.ac.cn>
can: kvaser_usb: fix return value for hif_usb_send_regout
Thomas GENTY <tomlohave(a)gmail.com>
bytcr_rt5640 : inverse jack detect for Archos 101 cesium
Jonathan Denose <jdenose(a)google.com>
Input: elantech - fix touchpad state on resume for Lenovo N24
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: cfg80211: wext: add extra SIOCSIWSCAN data check
Alexander Usyskin <alexander.usyskin(a)intel.com>
mei: demote client disconnect warning on suspend to debug
Yuntao Wang <yuntao.wang(a)linux.dev>
fs/file: fix the check in find_next_fd()
Masahiro Yamada <masahiroy(a)kernel.org>
kconfig: remove wrong expr_trans_bool()
Masahiro Yamada <masahiroy(a)kernel.org>
kconfig: gconf: give a proper initial state to the Save button
Eric Dumazet <edumazet(a)google.com>
ila: block BH in ila_output()
Hans de Goede <hdegoede(a)redhat.com>
Input: silead - Always support 10 fingers
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: mac80211: fix UBSAN noise in ieee80211_prep_hw_scan()
Nicolas Escande <nico.escande(a)gmail.com>
wifi: mac80211: mesh: init nonpeer_pm to active by default in mesh sdata
Armin Wolf <W_Armin(a)gmx.de>
ACPI: EC: Avoid returning AE_OK on errors in address space handler
Armin Wolf <W_Armin(a)gmx.de>
ACPI: EC: Abort address space access upon error
Saurav Kashyap <skashyap(a)marvell.com>
scsi: qedf: Set qed_slowpath_params to zero before use
Kees Cook <keescook(a)chromium.org>
gcc-plugins: Rename last_stmt() for GCC 14+
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/uaccess.h | 14 +------
drivers/acpi/ec.c | 9 ++++-
drivers/acpi/processor_idle.c | 40 ++++++++-----------
drivers/gpio/gpio-pca953x.c | 2 +
drivers/input/mouse/elantech.c | 31 +++++++++++++++
drivers/input/touchscreen/silead.c | 19 +++------
drivers/misc/mei/main.c | 2 +-
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 2 +-
drivers/net/usb/qmi_wwan.c | 2 +
drivers/s390/char/sclp.c | 1 +
drivers/scsi/qedf/qedf_main.c | 1 +
drivers/spi/spi-imx.c | 2 +-
fs/dcache.c | 31 +++++++--------
fs/file.c | 4 +-
fs/hfsplus/xattr.c | 2 +-
fs/jfs/xattr.c | 23 +++++++++--
fs/locks.c | 18 ++++-----
fs/ocfs2/dir.c | 46 ++++++++++++++--------
net/bluetooth/hci_core.c | 4 ++
net/ipv4/af_inet.c | 4 +-
net/ipv6/ila/ila_lwt.c | 7 +++-
net/mac80211/mesh.c | 1 +
net/mac80211/scan.c | 14 +++++--
net/mac802154/tx.c | 8 ++--
net/wireless/scan.c | 8 +++-
scripts/gcc-plugins/gcc-common.h | 4 ++
scripts/kconfig/expr.c | 29 --------------
scripts/kconfig/expr.h | 1 -
scripts/kconfig/gconf.c | 3 +-
scripts/kconfig/menu.c | 2 -
sound/core/pcm_dmaengine.c | 12 ++++++
sound/soc/intel/boards/bytcr_rt5640.c | 11 ++++++
tools/testing/selftests/vDSO/parse_vdso.c | 16 +++++---
.../selftests/vDSO/vdso_standalone_test_x86.c | 18 ++++++++-
35 files changed, 235 insertions(+), 160 deletions(-)
This is the start of the stable review cycle for the 5.4.281 release.
There are 43 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sat, 27 Jul 2024 14:27:16 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.281-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.281-rc1
Jann Horn <jannh(a)google.com>
filelock: Fix fcntl/close race recovery compat path
Edson Juliano Drosdeck <edson.drosdeck(a)gmail.com>
ALSA: hda/realtek: Enable headset mic on Positivo SU C1400
lei lu <llfamsec(a)gmail.com>
jfs: don't walk off the end of ealist
lei lu <llfamsec(a)gmail.com>
ocfs2: add bounds checking to ocfs2_check_dir_entry()
Paolo Abeni <pabeni(a)redhat.com>
net: relax socket state check at accept time.
Dan Carpenter <dan.carpenter(a)linaro.org>
drm/amdgpu: Fix signedness bug in sdma_v4_0_process_trap_irq()
Kuan-Wei Chiu <visitorckw(a)gmail.com>
ACPI: processor_idle: Fix invalid comparison with insertion sort for latency
Masahiro Yamada <masahiroy(a)kernel.org>
ARM: 9324/1: fix get_user() broken with veneer
Edward Adam Davis <eadavis(a)qq.com>
hfsplus: fix uninit-value in copy_name
John Hubbard <jhubbard(a)nvidia.com>
selftests/vDSO: fix clang build errors and warnings
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
spi: imx: Don't expect DMA for i.MX{25,35,50,51,53} cspi devices
Christian Brauner <brauner(a)kernel.org>
fs: better handle deep ancestor chains in is_subdir()
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
Bluetooth: hci_core: cancel all works upon hci_unregister_dev()
Xingui Yang <yangxingui(a)huawei.com>
scsi: libsas: Fix exp-attached device scan after probe failure scanned in again after probe failed
Ganesh Goudar <ganeshgr(a)linux.ibm.com>
powerpc/eeh: avoid possible crash when edev->pdev changes
Anjali K <anjalik(a)linux.ibm.com>
powerpc/pseries: Whitelist dtl slub object for copying to userspace
Yunshui Jiang <jiangyunshui(a)kylinos.cn>
net: mac802154: Fix racy device stats updates by DEV_STATS_INC() and DEV_STATS_ADD()
Daniele Palmas <dnlplm(a)gmail.com>
net: usb: qmi_wwan: add Telit FN912 compositions
Shengjiu Wang <shengjiu.wang(a)nxp.com>
ALSA: dmaengine_pcm: terminate dmaengine before synchronize
Heiko Carstens <hca(a)linux.ibm.com>
s390/sclp: Fix sclp_init() cleanup on failure
Ian Ray <ian.ray(a)gehealthcare.com>
gpio: pca953x: fix pca953x_irq_bus_sync_unlock race
Chen Ni <nichen(a)iscas.ac.cn>
can: kvaser_usb: fix return value for hif_usb_send_regout
Primoz Fiser <primoz.fiser(a)norik.com>
ASoC: ti: omap-hdmi: Fix too long driver name
Jai Luthra <j-luthra(a)ti.com>
ASoC: ti: davinci-mcasp: Set min period size using FIFO config
Thomas GENTY <tomlohave(a)gmail.com>
bytcr_rt5640 : inverse jack detect for Archos 101 cesium
Jonathan Denose <jdenose(a)google.com>
Input: elantech - fix touchpad state on resume for Lenovo N24
Arnd Bergmann <arnd(a)arndb.de>
mips: fix compat_sys_lseek syscall
Kailang Yang <kailang(a)realtek.com>
ALSA: hda/realtek: Add more codec ID to no shutup pins list
Michael Ellerman <mpe(a)ellerman.id.au>
KVM: PPC: Book3S HV: Prevent UAF in kvm_spapr_tce_attach_iommu_group()
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: cfg80211: wext: add extra SIOCSIWSCAN data check
Alexander Usyskin <alexander.usyskin(a)intel.com>
mei: demote client disconnect warning on suspend to debug
Yuntao Wang <yuntao.wang(a)linux.dev>
fs/file: fix the check in find_next_fd()
Masahiro Yamada <masahiroy(a)kernel.org>
kconfig: remove wrong expr_trans_bool()
Masahiro Yamada <masahiroy(a)kernel.org>
kconfig: gconf: give a proper initial state to the Save button
Eric Dumazet <edumazet(a)google.com>
ila: block BH in ila_output()
Hans de Goede <hdegoede(a)redhat.com>
Input: silead - Always support 10 fingers
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: mac80211: fix UBSAN noise in ieee80211_prep_hw_scan()
Nicolas Escande <nico.escande(a)gmail.com>
wifi: mac80211: mesh: init nonpeer_pm to active by default in mesh sdata
Armin Wolf <W_Armin(a)gmx.de>
ACPI: EC: Avoid returning AE_OK on errors in address space handler
Armin Wolf <W_Armin(a)gmx.de>
ACPI: EC: Abort address space access upon error
Saurav Kashyap <skashyap(a)marvell.com>
scsi: qedf: Set qed_slowpath_params to zero before use
Jann Horn <jannh(a)google.com>
filelock: Remove locks reliably when fcntl/close race is detected
Kees Cook <keescook(a)chromium.org>
gcc-plugins: Rename last_stmt() for GCC 14+
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/uaccess.h | 14 +------
arch/mips/kernel/syscalls/syscall_o32.tbl | 2 +-
arch/powerpc/kernel/eeh_pe.c | 7 +++-
arch/powerpc/kvm/book3s_64_vio.c | 18 ++++++---
arch/powerpc/platforms/pseries/setup.c | 4 +-
drivers/acpi/ec.c | 9 ++++-
drivers/acpi/processor_idle.c | 40 ++++++++-----------
drivers/gpio/gpio-pca953x.c | 2 +
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 +-
drivers/input/mouse/elantech.c | 31 +++++++++++++++
drivers/input/touchscreen/silead.c | 19 +++------
drivers/misc/mei/main.c | 2 +-
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 2 +-
drivers/net/usb/qmi_wwan.c | 2 +
drivers/s390/char/sclp.c | 1 +
drivers/scsi/libsas/sas_internal.h | 14 +++++++
drivers/scsi/qedf/qedf_main.c | 1 +
drivers/spi/spi-imx.c | 2 +-
fs/dcache.c | 31 +++++++--------
fs/file.c | 4 +-
fs/hfsplus/xattr.c | 2 +-
fs/jfs/xattr.c | 23 +++++++++--
fs/locks.c | 18 ++++-----
fs/ocfs2/dir.c | 46 ++++++++++++++--------
net/bluetooth/hci_core.c | 4 ++
net/ipv4/af_inet.c | 4 +-
net/ipv6/ila/ila_lwt.c | 7 +++-
net/mac80211/mesh.c | 1 +
net/mac80211/scan.c | 14 +++++--
net/mac802154/tx.c | 8 ++--
net/wireless/scan.c | 8 +++-
scripts/gcc-plugins/gcc-common.h | 4 ++
scripts/kconfig/expr.c | 29 --------------
scripts/kconfig/expr.h | 1 -
scripts/kconfig/gconf.c | 3 +-
scripts/kconfig/menu.c | 2 -
sound/core/pcm_dmaengine.c | 12 ++++++
sound/pci/hda/patch_realtek.c | 5 +++
sound/soc/intel/boards/bytcr_rt5640.c | 11 ++++++
sound/soc/ti/davinci-mcasp.c | 9 ++++-
sound/soc/ti/omap-hdmi.c | 6 +--
tools/testing/selftests/vDSO/parse_vdso.c | 16 +++++---
.../selftests/vDSO/vdso_standalone_test_x86.c | 18 ++++++++-
44 files changed, 284 insertions(+), 178 deletions(-)
The check_unaligned_access_emulated() function should have been called
during CPU hotplug to ensure that if all CPUs had emulated unaligned
accesses, the new CPU also does.
This patch adds the call to check_unaligned_access_emulated() in
the hotplug path.
Fixes: 55e0bf49a0d0 ("RISC-V: Probe misaligned access speed in parallel")
Signed-off-by: Jesse Taube <jesse(a)rivosinc.com>
Reviewed-by: Evan Green <evan(a)rivosinc.com>
Cc: stable(a)vger.kernel.org
---
V5 -> V6:
- New patch
V6 -> V7:
- No changes
---
arch/riscv/kernel/unaligned_access_speed.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c
index a9a6bcb02acf..b67db1fc3740 100644
--- a/arch/riscv/kernel/unaligned_access_speed.c
+++ b/arch/riscv/kernel/unaligned_access_speed.c
@@ -191,6 +191,7 @@ static int riscv_online_cpu(unsigned int cpu)
if (per_cpu(misaligned_access_speed, cpu) != RISCV_HWPROBE_MISALIGNED_UNKNOWN)
goto exit;
+ check_unaligned_access_emulated(NULL);
buf = alloc_pages(GFP_KERNEL, MISALIGNED_BUFFER_ORDER);
if (!buf) {
pr_warn("Allocation failure, not measuring misaligned performance\n");
--
2.45.2
It could lead to error happen because the variable res is not updated if
the call to sr_share_read_word returns an error. In this particular case
error code was returned and res stayed uninitialized. Same issue also
applies to sr_read_reg.
This can be avoided by checking the return value of sr_share_read_word
and sr_read_reg, and propagating the error if the read operation failed.
Found by code review.
Cc: stable(a)vger.kernel.org
Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
Signed-off-by: Ma Ke <make24(a)iscas.ac.cn>
---
Changes in v4:
- added a check for sr_read_reg() as suggestions.
Changes in v3:
- added Cc stable line as suggestions.
Changes in v2:
- modified the subject as suggestions.
---
drivers/net/usb/sr9700.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c
index 0a662e42ed96..cb7d2f798fb4 100644
--- a/drivers/net/usb/sr9700.c
+++ b/drivers/net/usb/sr9700.c
@@ -179,6 +179,7 @@ static int sr_mdio_read(struct net_device *netdev, int phy_id, int loc)
struct usbnet *dev = netdev_priv(netdev);
__le16 res;
int rc = 0;
+ int err;
if (phy_id) {
netdev_dbg(netdev, "Only internal phy supported\n");
@@ -189,11 +190,17 @@ static int sr_mdio_read(struct net_device *netdev, int phy_id, int loc)
if (loc == MII_BMSR) {
u8 value;
- sr_read_reg(dev, SR_NSR, &value);
+ err = sr_read_reg(dev, SR_NSR, &value);
+ if (err < 0)
+ return err;
+
if (value & NSR_LINKST)
rc = 1;
}
- sr_share_read_word(dev, 1, loc, &res);
+ err = sr_share_read_word(dev, 1, loc, &res);
+ if (err < 0)
+ return err;
+
if (rc == 1)
res = le16_to_cpu(res) | BMSR_LSTATUS;
else
--
2.25.1
Lima DRM driver uses devfreq to perform DVFS, while using simple_ondemand
devfreq governor by default. This causes driver initialization to fail on
boot when simple_ondemand governor isn't built into the kernel statically,
as a result of the missing module dependency and, consequently, the required
governor module not being included in the initial ramdisk. Thus, let's mark
simple_ondemand governor as a softdep for Lima, to have its kernel module
included in the initial ramdisk.
This is a rather longstanding issue that has forced distributions to build
devfreq governors statically into their kernels, [1][2] or may have forced
some users to introduce unnecessary workarounds.
Having simple_ondemand marked as a softdep for Lima may not resolve this
issue for all Linux distributions. In particular, it will remain unresolved
for the distributions whose utilities for the initial ramdisk generation do
not handle the available softdep information [3] properly yet. However, some
Linux distributions already handle softdeps properly while generating their
initial ramdisks, [4] and this is a prerequisite step in the right direction
for the distributions that don't handle them properly yet.
[1] https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-pinephone/-/blob…
[2] https://gitlab.com/postmarketOS/pmaports/-/blob/7f64e287e7732c9eaa029653e73…
[3] https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/?id=49d8e0…
[4] https://github.com/archlinux/mkinitcpio/commit/97ac4d37aae084a050be512f6d8f…
Cc: Philip Muller <philm(a)manjaro.org>
Cc: Oliver Smith <ollieparanoid(a)postmarketos.org>
Cc: Daniel Smith <danct12(a)disroot.org>
Cc: stable(a)vger.kernel.org
Fixes: 1996970773a3 ("drm/lima: Add optional devfreq and cooling device support")
Signed-off-by: Dragan Simic <dsimic(a)manjaro.org>
---
drivers/gpu/drm/lima/lima_drv.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c
index 739c865b556f..10bce18b7c31 100644
--- a/drivers/gpu/drm/lima/lima_drv.c
+++ b/drivers/gpu/drm/lima/lima_drv.c
@@ -501,3 +501,4 @@ module_platform_driver(lima_platform_driver);
MODULE_AUTHOR("Lima Project Developers");
MODULE_DESCRIPTION("Lima DRM Driver");
MODULE_LICENSE("GPL v2");
+MODULE_SOFTDEP("pre: governor_simpleondemand");
From: Tvrtko Ursulin <tvrtko.ursulin(a)igalia.com>
Long time ago in commit b3ac17667f11 ("drm/scheduler: rework entity
creation") a change was made which prevented priority changes for entities
with only one assigned scheduler.
The commit reduced drm_sched_entity_set_priority() to simply update the
entities priority, but the run queue selection logic in
drm_sched_entity_select_rq() was never able to actually change the
originally assigned run queue.
In practice that only affected amdgpu, being the only driver which can do
dynamic priority changes. And that appears was attempted to be rectified
there in 2316a86bde49 ("drm/amdgpu: change hw sched list on ctx priority
override").
A few unresolved problems however were that this only fixed
drm_sched_entity_set_priority() *if* drm_sched_entity_modify_sched() was
called first. That was not documented anywhere.
Secondly, this only works if drm_sched_entity_modify_sched() is actually
called, which in amdgpu's case today is true only for gfx and compute.
Priority changes for other engines with only one scheduler assigned, such
as jpeg and video decode will still not work.
Note that this was also noticed in 981b04d96856 ("drm/sched: improve docs
around drm_sched_entity").
Completely different set of non-obvious confusion was that whereas
drm_sched_entity_init() was not keeping the passed in list of schedulers
(courtesy of 8c23056bdc7a ("drm/scheduler: do not keep a copy of sched
list")), drm_sched_entity_modify_sched() was disagreeing with that and
would simply assign the single item list.
That incosistency appears to be semi-silently fixed in ac4eb83ab255
("drm/sched: select new rq even if there is only one v3").
What was also not documented is why it was important to not keep the
list of schedulers when there is only one. I suspect it could have
something to do with the fact the passed in array is on stack for many
callers with just one scheduler. With more than one scheduler amdgpu is
the only caller, and there the container is not on the stack. Keeping a
stack backed list in the entity would obviously be undefined behaviour
*if* the list was kept.
Amdgpu however did only stop passing in stack backed container for the more
than one scheduler case in 977f7e1068be ("drm/amdgpu: allocate entities on
demand"). Until then I suspect dereferencing freed stack from
drm_sched_entity_select_rq() was still present.
In order to untangle all that and fix priority changes this patch is
bringing back the entity owned container for storing the passed in
scheduler list. Container is now owned by the entity and the pointers are
owned by the drivers. List of schedulers is always kept including for the
one scheduler case.
The patch can therefore also removes the single scheduler special case,
which means that priority changes should now work (be able to change the
selected run-queue) for all drivers and engines. In other words
drm_sched_entity_set_priority() should now just work for all cases.
To enable maintaining its own container some API calls needed to grow a
capability for returning success/failure, which is a change which
percolates mostly through amdgpu source.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin(a)igalia.com>
Fixes: b3ac17667f11 ("drm/scheduler: rework entity creation")
References: 8c23056bdc7a ("drm/scheduler: do not keep a copy of sched list")
References: 977f7e1068be ("drm/amdgpu: allocate entities on demand")
References: 2316a86bde49 ("drm/amdgpu: change hw sched list on ctx priority override")
References: ac4eb83ab255 ("drm/sched: select new rq even if there is only one v3")
References: 981b04d96856 ("drm/sched: improve docs around drm_sched_entity")
Cc: Christian König <christian.koenig(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: Luben Tuikov <ltuikov89(a)gmail.com>
Cc: Matthew Brost <matthew.brost(a)intel.com>
Cc: Daniel Vetter <daniel.vetter(a)ffwll.ch>
Cc: amd-gfx(a)lists.freedesktop.org
Cc: dri-devel(a)lists.freedesktop.org
Cc: <stable(a)vger.kernel.org> # v5.6+
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 31 +++++---
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 13 +--
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 3 +-
drivers/gpu/drm/scheduler/sched_entity.c | 96 ++++++++++++++++-------
include/drm/gpu_scheduler.h | 16 ++--
6 files changed, 100 insertions(+), 61 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 5cb33ac99f70..387247f8307e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -802,15 +802,15 @@ struct dma_fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx,
return fence;
}
-static void amdgpu_ctx_set_entity_priority(struct amdgpu_ctx *ctx,
- struct amdgpu_ctx_entity *aentity,
- int hw_ip,
- int32_t priority)
+static int amdgpu_ctx_set_entity_priority(struct amdgpu_ctx *ctx,
+ struct amdgpu_ctx_entity *aentity,
+ int hw_ip,
+ int32_t priority)
{
struct amdgpu_device *adev = ctx->mgr->adev;
- unsigned int hw_prio;
struct drm_gpu_scheduler **scheds = NULL;
- unsigned num_scheds;
+ unsigned int hw_prio, num_scheds;
+ int ret = 0;
/* set sw priority */
drm_sched_entity_set_priority(&aentity->entity,
@@ -822,16 +822,18 @@ static void amdgpu_ctx_set_entity_priority(struct amdgpu_ctx *ctx,
hw_prio = array_index_nospec(hw_prio, AMDGPU_RING_PRIO_MAX);
scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;
- drm_sched_entity_modify_sched(&aentity->entity, scheds,
- num_scheds);
+ ret = drm_sched_entity_modify_sched(&aentity->entity, scheds,
+ num_scheds);
}
+
+ return ret;
}
-void amdgpu_ctx_priority_override(struct amdgpu_ctx *ctx,
- int32_t priority)
+int amdgpu_ctx_priority_override(struct amdgpu_ctx *ctx, int32_t priority)
{
int32_t ctx_prio;
unsigned i, j;
+ int ret;
ctx->override_priority = priority;
@@ -842,10 +844,15 @@ void amdgpu_ctx_priority_override(struct amdgpu_ctx *ctx,
if (!ctx->entities[i][j])
continue;
- amdgpu_ctx_set_entity_priority(ctx, ctx->entities[i][j],
- i, ctx_prio);
+ ret = amdgpu_ctx_set_entity_priority(ctx,
+ ctx->entities[i][j],
+ i, ctx_prio);
+ if (ret)
+ return ret;
}
}
+
+ return 0;
}
int amdgpu_ctx_wait_prev_fence(struct amdgpu_ctx *ctx,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
index 85376baaa92f..835661515e33 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
@@ -82,7 +82,7 @@ struct dma_fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx,
struct drm_sched_entity *entity,
uint64_t seq);
bool amdgpu_ctx_priority_is_valid(int32_t ctx_prio);
-void amdgpu_ctx_priority_override(struct amdgpu_ctx *ctx, int32_t ctx_prio);
+int amdgpu_ctx_priority_override(struct amdgpu_ctx *ctx, int32_t ctx_prio);
int amdgpu_ctx_ioctl(struct drm_device *dev, void *data,
struct drm_file *filp);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
index 863b2a34b2d6..944edb7f00a2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
@@ -54,12 +54,15 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
mgr = &fpriv->ctx_mgr;
mutex_lock(&mgr->lock);
- idr_for_each_entry(&mgr->ctx_handles, ctx, id)
- amdgpu_ctx_priority_override(ctx, priority);
+ idr_for_each_entry(&mgr->ctx_handles, ctx, id) {
+ r = amdgpu_ctx_priority_override(ctx, priority);
+ if (r)
+ break;
+ }
mutex_unlock(&mgr->lock);
fdput(f);
- return 0;
+ return r;
}
static int amdgpu_sched_context_priority_override(struct amdgpu_device *adev,
@@ -88,11 +91,11 @@ static int amdgpu_sched_context_priority_override(struct amdgpu_device *adev,
return -EINVAL;
}
- amdgpu_ctx_priority_override(ctx, priority);
+ r = amdgpu_ctx_priority_override(ctx, priority);
amdgpu_ctx_put(ctx);
fdput(f);
- return 0;
+ return r;
}
int amdgpu_sched_ioctl(struct drm_device *dev, void *data,
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
index 81fb99729f37..2453decc73c7 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
@@ -1362,8 +1362,7 @@ static int vcn_v4_0_5_limit_sched(struct amdgpu_cs_parser *p,
scheds = p->adev->gpu_sched[AMDGPU_HW_IP_VCN_ENC]
[AMDGPU_RING_PRIO_0].sched;
- drm_sched_entity_modify_sched(job->base.entity, scheds, 1);
- return 0;
+ return drm_sched_entity_modify_sched(job->base.entity, scheds, 1);
}
static int vcn_v4_0_5_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job,
diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
index 58c8161289fe..cb5cc65f461d 100644
--- a/drivers/gpu/drm/scheduler/sched_entity.c
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
@@ -45,7 +45,12 @@
* @guilty: atomic_t set to 1 when a job on this queue
* is found to be guilty causing a timeout
*
- * Note that the &sched_list must have at least one element to schedule the entity.
+ * Note that the &sched_list must have at least one element to schedule the
+ * entity.
+ *
+ * The individual drm_gpu_scheduler pointers have borrow semantics, ie.
+ * they must remain valid during entities lifetime, while the containing
+ * array can be freed after this call returns.
*
* For changing @priority later on at runtime see
* drm_sched_entity_set_priority(). For changing the set of schedulers
@@ -69,27 +74,24 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
INIT_LIST_HEAD(&entity->list);
entity->rq = NULL;
entity->guilty = guilty;
- entity->num_sched_list = num_sched_list;
entity->priority = priority;
- /*
- * It's perfectly valid to initialize an entity without having a valid
- * scheduler attached. It's just not valid to use the scheduler before it
- * is initialized itself.
- */
- entity->sched_list = num_sched_list > 1 ? sched_list : NULL;
RCU_INIT_POINTER(entity->last_scheduled, NULL);
RB_CLEAR_NODE(&entity->rb_tree_node);
- if (num_sched_list && !sched_list[0]->sched_rq) {
- /* Since every entry covered by num_sched_list
- * should be non-NULL and therefore we warn drivers
- * not to do this and to fix their DRM calling order.
- */
- pr_warn("%s: called with uninitialized scheduler\n", __func__);
- } else if (num_sched_list) {
- /* The "priority" of an entity cannot exceed the number of run-queues of a
- * scheduler. Protect against num_rqs being 0, by converting to signed. Choose
- * the lowest priority available.
+ if (num_sched_list) {
+ int ret;
+
+ ret = drm_sched_entity_modify_sched(entity,
+ sched_list,
+ num_sched_list);
+ if (ret)
+ return ret;
+
+ /*
+ * The "priority" of an entity cannot exceed the number of
+ * run-queues of a scheduler. Protect against num_rqs being 0,
+ * by converting to signed. Choose the lowest priority
+ * available.
*/
if (entity->priority >= sched_list[0]->num_rqs) {
drm_err(sched_list[0], "entity with out-of-bounds priority:%u num_rqs:%u\n",
@@ -122,19 +124,58 @@ EXPORT_SYMBOL(drm_sched_entity_init);
* existing entity->sched_list
* @num_sched_list: number of drm sched in sched_list
*
+ * The individual drm_gpu_scheduler pointers have borrow semantics, ie.
+ * they must remain valid during entities lifetime, while the containing
+ * array can be freed after this call returns.
+ *
* Note that this must be called under the same common lock for @entity as
* drm_sched_job_arm() and drm_sched_entity_push_job(), or the driver needs to
* guarantee through some other means that this is never called while new jobs
* can be pushed to @entity.
+ *
+ * Returns zero on success and a negative error code on failure.
*/
-void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
- struct drm_gpu_scheduler **sched_list,
- unsigned int num_sched_list)
+int drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
+ struct drm_gpu_scheduler **sched_list,
+ unsigned int num_sched_list)
{
- WARN_ON(!num_sched_list || !sched_list);
+ struct drm_gpu_scheduler **new, **old;
+ unsigned int i;
- entity->sched_list = sched_list;
+ if (!(entity && sched_list && (num_sched_list == 0 || sched_list[0])))
+ return -EINVAL;
+
+ /*
+ * It's perfectly valid to initialize an entity without having a valid
+ * scheduler attached. It's just not valid to use the scheduler before
+ * it is initialized itself.
+ *
+ * Since every entry covered by num_sched_list should be non-NULL and
+ * therefore we warn drivers not to do this and to fix their DRM calling
+ * order.
+ */
+ for (i = 0; i < num_sched_list; i++) {
+ if (!sched_list[i]) {
+ pr_warn("%s: called with uninitialized scheduler %u!\n",
+ __func__, i);
+ return -EINVAL;
+ }
+ }
+
+ new = kmemdup_array(sched_list,
+ num_sched_list,
+ sizeof(*sched_list),
+ GFP_KERNEL);
+ if (!new)
+ return -ENOMEM;
+
+ old = entity->sched_list;
+ entity->sched_list = new;
entity->num_sched_list = num_sched_list;
+
+ kfree(old);
+
+ return 0;
}
EXPORT_SYMBOL(drm_sched_entity_modify_sched);
@@ -341,6 +382,8 @@ void drm_sched_entity_fini(struct drm_sched_entity *entity)
dma_fence_put(rcu_dereference_check(entity->last_scheduled, true));
RCU_INIT_POINTER(entity->last_scheduled, NULL);
+
+ kfree(entity->sched_list);
}
EXPORT_SYMBOL(drm_sched_entity_fini);
@@ -531,10 +574,6 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
struct drm_gpu_scheduler *sched;
struct drm_sched_rq *rq;
- /* single possible engine and already selected */
- if (!entity->sched_list)
- return;
-
/* queue non-empty, stay on the same engine */
if (spsc_queue_count(&entity->job_queue))
return;
@@ -561,9 +600,6 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
entity->rq = rq;
}
spin_unlock(&entity->rq_lock);
-
- if (entity->num_sched_list == 1)
- entity->sched_list = NULL;
}
/**
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
index 5acc64954a88..09e1d063a5c0 100644
--- a/include/drm/gpu_scheduler.h
+++ b/include/drm/gpu_scheduler.h
@@ -110,18 +110,12 @@ struct drm_sched_entity {
/**
* @sched_list:
*
- * A list of schedulers (struct drm_gpu_scheduler). Jobs from this entity can
- * be scheduled on any scheduler on this list.
+ * A list of schedulers (struct drm_gpu_scheduler). Jobs from this
+ * entity can be scheduled on any scheduler on this list.
*
* This can be modified by calling drm_sched_entity_modify_sched().
* Locking is entirely up to the driver, see the above function for more
* details.
- *
- * This will be set to NULL if &num_sched_list equals 1 and @rq has been
- * set already.
- *
- * FIXME: This means priority changes through
- * drm_sched_entity_set_priority() will be lost henceforth in this case.
*/
struct drm_gpu_scheduler **sched_list;
@@ -568,9 +562,9 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job,
bool write);
-void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
- struct drm_gpu_scheduler **sched_list,
- unsigned int num_sched_list);
+int drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
+ struct drm_gpu_scheduler **sched_list,
+ unsigned int num_sched_list);
void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched);
void drm_sched_job_cleanup(struct drm_sched_job *job);
--
2.44.0