6.1.74-rc1 review
Subsystems (4)
Greg Kroah-Hartman
maintainercover 6.1.74-rc1 review
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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, 20 Jan 2024 10:42:49 +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/v6.x/stable-review/patch-6.1.74-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.1.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.1.74-rc1
Carlos Llamas <[email protected]>
scripts/decode_stacktrace.sh: optionally use LLVM utilities
James Clark <[email protected]>
coresight: etm4x: Fix width of CCITMIN field
LeoLiuoc <[email protected]>
PCI: Add ACS quirk for more Zhaoxin Root Ports
Florian Eckert <[email protected]>
leds: ledtrig-tty: Free allocated ttyname buffer on deactivate
Cameron Williams <[email protected]>
parport: parport_serial: Add Brainboxes device IDs and geometry
Cameron Williams <[email protected]>
parport: parport_serial: Add Brainboxes BAR details
Guanghui Feng <[email protected]>
uio: Fix use-after-free in uio_open
Carlos Llamas <[email protected]>
binder: fix comment on binder_alloc_new_buf() return value
Carlos Llamas <[email protected]>
binder: fix trivial typo of binder_free_buf_locked()
Carlos Llamas <[email protected]>
binder: fix use-after-free in shinker's callback
Carlos Llamas <[email protected]>
binder: use EPOLLERR from eventpoll.h
Junxiao Bi <[email protected]>
Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"
Fedor Pchelkin <[email protected]>
ksmbd: free ppace array on error in parse_dacl
Namjae Jeon <[email protected]>
ksmbd: don't allow O_TRUNC open on read-only share
Alan Maguire <[email protected]>
bpf: Add --skip_encoding_btf_inconsistent_proto, --btf_gen_optimized to pahole flags for v1.25
Martin Rodriguez Reboredo <[email protected]>
btf, scripts: Exclude Rust CUs with pahole
Peter Ujfalusi <[email protected]>
ASoC: SOF: Intel: hda-codec: Delay the codec device registration
Hans de Goede <[email protected]>
ACPI: resource: Add another DMI match for the TongFang GMxXGxx
Tom Jason Schwanke <[email protected]>
ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP Envy X360 13-ay0xxx
Jani Nikula <[email protected]>
drm/crtc: fix uninitialized variable use
Stefan Wahren <[email protected]>
ARM: sun9i: smp: fix return code check of of_property_match_string
Sarannya S <[email protected]>
net: qrtr: ns: Return 0 if server port is not present
Stefan Hajnoczi <[email protected]>
virtio_blk: fix snprintf truncation compiler warning
Matthew Wilcox (Oracle) <[email protected]>
ida: Fix crash in ida_free when the bitmap is empty
Patrick Rudolph <[email protected]>
pinctrl: cy8c95x0: Fix get_pincfg
Patrick Rudolph <[email protected]>
pinctrl: cy8c95x0: Fix typo
Charlene Liu <[email protected]>
drm/amd/display: get dprefclk ss info from integration info table
Jensen Huang <[email protected]>
i2c: rk3x: fix potential spinlock recursion on poll
Paulo Alcantara <[email protected]>
smb: client: fix potential OOB in smb2_dump_detail()
Guilherme G. Piccoli <[email protected]>
HID: nintendo: Prevent divide-by-zero on code
Mike Snitzer <[email protected]>
dm audit: fix Kconfig so DM_AUDIT depends on BLK_DEV_DM
Stefan Binding <[email protected]>
ALSA: hda/realtek: Add quirks for ASUS Zenbook 2022 Models
Hans de Goede <[email protected]>
ASoC: Intel: bytcr_rt5640: Add new swapped-speakers quirk
Hans de Goede <[email protected]>
ASoC: Intel: bytcr_rt5640: Add quirk for the Medion Lifetab S10346
Vishnu Sankar <[email protected]>
platform/x86: thinkpad_acpi: fix for incorrect fan reporting on some ThinkPad systems
Ryan McClelland <[email protected]>
HID: nintendo: fix initializer element is not constant error
Ghanshyam Agrawal <[email protected]>
kselftest: alsa: fixed a print formatting warning
Luca Weiss <[email protected]>
Input: xpad - add Razer Wolverine V2 support
Avraham Stern <[email protected]>
wifi: iwlwifi: pcie: avoid a NULL pointer dereference
Vineet Gupta <[email protected]>
ARC: fix spare error
Vineeth Vijayan <[email protected]>
s390/scm: fix virtual vs physical address confusion
Esther Shimanovich <[email protected]>
Input: i8042 - add nomux quirk for Acer P459-G2-M
Hans de Goede <[email protected]>
Input: atkbd - skip ATKBD_CMD_GETID in translated mode
Krzysztof Kozlowski <[email protected]>
reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning
José Pekkarinen <[email protected]>
Input: psmouse - enable Synaptics InterTouch for ThinkPad L14 G1
Steven Rostedt (Google) <[email protected]>
ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI
Zheng Yejian <[email protected]>
tracing: Fix uaf issue when open the hist or hist_debug file
Krzysztof Kozlowski <[email protected]>
MIPS: dts: loongson: drop incorrect dwmac fallback compatible
Krzysztof Kozlowski <[email protected]>
stmmac: dwmac-loongson: drop useless check for compatible fallback
Steven Rostedt (Google) <[email protected]>
tracing: Add size check when printing trace_marker output
Steven Rostedt (Google) <[email protected]>
tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing
Ye Bin <[email protected]>
jbd2: fix soft lockup in journal_finish_inode_data_buffers()
Hans de Goede <[email protected]>
platform/x86: intel-vbtn: Fix missing tablet-mode-switch events
Judy Hsiao <[email protected]>
neighbour: Don't let neigh_forced_gc() disable preemption for long
Ziqi Zhao <[email protected]>
drm/crtc: Fix uninit-value bug in drm_mode_setcrtc
Zhang Yi <[email protected]>
jbd2: increase the journal IO's priority
Zhang Yi <[email protected]>
jbd2: correct the printing of write_flags in jbd2_write_superblock()
Weihao Li <[email protected]>
clk: rockchip: rk3128: Fix HCLK_OTG gate register
Chris Morgan <[email protected]>
clk: rockchip: rk3568: Add PLL rate for 292.5MHz
Hengqi Chen <[email protected]>
LoongArch: Preserve syscall nr across execve()
Armin Wolf <[email protected]>
hwmon: (corsair-psu) Fix probe when built-in
Inki Dae <[email protected]>
drm/exynos: fix a wrong error checking
Xiang Yang <[email protected]>
drm/exynos: fix a potential error pointer dereference
Lijo Lazar <[email protected]>
drm/amdgpu: Add NULL checks for function pointers
Stefan Wiehler <[email protected]>
mips/smp: Call rcutree_report_cpu_starting() earlier
Rob Herring <[email protected]>
arm64: dts: rockchip: Fix PCI node addresses on rk3399-gru
Nitesh Shetty <[email protected]>
nvme: prevent potential spectre v1 gadget
Keith Busch <[email protected]>
nvme: introduce helper function to get ctrl state
Srinivas Kandagatla <[email protected]>
ASoC: ops: add correct range check for limiting volume
David Rau <[email protected]>
ASoC: da7219: Support low DC impedance headset
Thinh Tran <[email protected]>
net/tg3: fix race condition in tg3_reset_task()
Peter Ujfalusi <[email protected]>
ASoC: hdac_hda: Conditionally register dais for HDMI and Analog
Jeremy Soller <[email protected]>
ASoC: amd: yc: Add DMI entry to support System76 Pangolin 13
Dave Airlie <[email protected]>
nouveau/tu102: flush all pdbs on vmm flush
Peter Ujfalusi <[email protected]>
ASoC: Intel: skl_hda_dsp_generic: Drop HDMI routes when HDMI is not available
Shuming Fan <[email protected]>
ASoC: rt5650: add mutex to avoid the jack detection failure
Maciej Strozek <[email protected]>
ASoC: cs43130: Fix incorrect frame delay configuration
Maciej Strozek <[email protected]>
ASoC: cs43130: Fix the position of const qualifier
Kamil Duljas <[email protected]>
ASoC: Intel: Skylake: mem leak in skl register function
David Lin <[email protected]>
ASoC: nau8822: Fix incorrect type in assignment and cast to restricted __be16
Kamil Duljas <[email protected]>
ASoC: Intel: Skylake: Fix mem leak in few functions
Heiko Stuebner <[email protected]>
arm64: dts: rockchip: fix rk356x pcie msg interrupt name
Charles Keepax <[email protected]>
ASoC: wm8974: Correct boost mixer inputs
Yicong Yang <[email protected]>
hwtracing: hisi_ptt: Don't try to attach a task
Yicong Yang <[email protected]>
hwtracing: hisi_ptt: Handle the interrupt in hardirq context
Keith Busch <[email protected]>
nvme-core: check for too small lba shift
Ming Lei <[email protected]>
blk-mq: don't count completed flush data request as inflight in case of quiesce
Dmitry Antipov <[email protected]>
smb: client, common: fix fortify warnings
Lu Yao <[email protected]>
drm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer
Dmytro Laktyushkin <[email protected]>
drm/amd/display: update dcn315 lpddr pstate latency
Maurizio Lombardi <[email protected]>
nvme-core: fix a memory leak in nvme_ns_info_from_identify()
Peter Ujfalusi <[email protected]>
ALSA: hda: intel-nhlt: Ignore vbps when looking for DMIC 32 bps format
Johannes Berg <[email protected]>
debugfs: fix automount d_fsdata usage
Ben Greear <[email protected]>
wifi: mac80211: handle 320 MHz in ieee80211_ht_cap_ie_to_sta_ht_cap
Michael-CY Lee <[email protected]>
wifi: avoid offset calculation on NULL pointer
Johannes Berg <[email protected]>
wifi: cfg80211: lock wiphy mutex for rfkill poll
Edward Adam Davis <[email protected]>
mptcp: fix uninit-value in mptcp_incoming_options
Vasiliy Kovalev <[email protected]>
ALSA: hda - Fix speaker and headset mic pin config for CHUWI CoreBook XPro
Charles Keepax <[email protected]>
pinctrl: lochnagar: Don't build on MIPS
Eric Biggers <[email protected]>
f2fs: explicitly null-terminate the xattr list
-------------
Diffstat:
Makefile | 4 +- arch/arc/kernel/signal.c | 6 +- arch/arm/mach-sunxi/mc_smp.c | 4 +- .../boot/dts/rockchip/rk3399-gru-chromebook.dtsi | 3 +- .../boot/dts/rockchip/rk3399-gru-scarlet-dumo.dts | 4 +- arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 1 + arch/arm64/boot/dts/rockchip/rk356x.dtsi | 2 +- arch/loongarch/include/asm/elf.h | 2 +- arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi | 3 +- arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 3 +- arch/mips/kernel/smp.c | 4 +- block/blk-mq.c | 14 +++- drivers/acpi/resource.c | 7 ++ drivers/android/binder.c | 2 +- drivers/android/binder_alloc.c | 10 ++- drivers/block/virtio_blk.c | 8 +- drivers/clk/rockchip/clk-rk3128.c | 2 +- drivers/clk/rockchip/clk-rk3568.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++ drivers/gpu/drm/amd/amdgpu/soc15.c | 12 ++- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 19 +++-- .../amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 8 +- .../amd/display/include/grph_object_ctrl_defs.h | 2 + drivers/gpu/drm/drm_crtc.c | 8 +- drivers/gpu/drm/exynos/exynos_drm_dma.c | 8 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 + drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c | 2 +- drivers/hid/hid-nintendo.c | 71 +++++++++------- drivers/hwmon/corsair-psu.c | 18 +++- drivers/hwtracing/coresight/coresight-etm4x.h | 2 +- drivers/hwtracing/ptt/hisi_ptt.c | 9 +- drivers/i2c/busses/i2c-rk3x.c | 13 ++- drivers/input/joystick/xpad.c | 1 + drivers/input/keyboard/atkbd.c | 46 +++++++++- drivers/input/mouse/synaptics.c | 1 + drivers/input/serio/i8042-acpipnpio.h | 8 ++ drivers/leds/trigger/ledtrig-tty.c | 4 + drivers/md/Kconfig | 1 + drivers/md/raid5.c | 12 --- drivers/net/ethernet/broadcom/tg3.c | 11 ++- .../net/ethernet/stmicro/stmmac/dwmac-loongson.c | 5 -- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 +- drivers/nvme/host/core.c | 12 ++- drivers/nvme/host/nvme.h | 5 ++ drivers/nvme/target/configfs.c | 3 + drivers/parport/parport_serial.c | 64 ++++++++++++++ drivers/pci/quirks.c | 8 +- drivers/pinctrl/cirrus/Kconfig | 3 +- drivers/pinctrl/pinctrl-cy8c95x0.c | 4 +- drivers/platform/x86/intel/vbtn.c | 19 ++++- drivers/platform/x86/thinkpad_acpi.c | 98 +++++++++++++++++++--- drivers/reset/hisilicon/hi6220_reset.c | 2 +- drivers/s390/block/scm_blk.c | 7 +- drivers/uio/uio.c | 7 +- fs/debugfs/file.c | 8 ++ fs/debugfs/inode.c | 27 ++++-- fs/debugfs/internal.h | 10 ++- fs/f2fs/xattr.c | 6 ++ fs/jbd2/commit.c | 10 ++- fs/jbd2/journal.c | 24 +++--- fs/smb/client/cifspdu.h | 24 +++--- fs/smb/client/cifssmb.c | 6 +- fs/smb/client/smb2misc.c | 30 +++---- fs/smb/client/smb2ops.c | 6 +- fs/smb/client/smb2pdu.c | 8 +- fs/smb/client/smb2pdu.h | 16 ++-- fs/smb/common/smb2pdu.h | 17 ++-- fs/smb/server/smb2pdu.c | 23 ++--- fs/smb/server/smbacl.c | 11 ++- include/linux/ieee80211.h | 4 +- include/linux/jbd2.h | 3 + init/Kconfig | 2 +- kernel/trace/ring_buffer.c | 6 ++ kernel/trace/trace.c | 12 ++- kernel/trace/trace.h | 1 + kernel/trace/trace_events_hist.c | 12 ++- kernel/trace/trace_output.c | 6 +- lib/Kconfig.debug | 9 ++ lib/idr.c | 2 +- lib/test_ida.c | 40 +++++++++ net/core/neighbour.c | 9 +- net/mac80211/ht.c | 1 + net/mptcp/options.c | 1 + net/qrtr/ns.c | 4 +- net/wireless/core.c | 2 + scripts/decode_stacktrace.sh | 19 ++++- scripts/pahole-flags.sh | 7 ++ sound/hda/intel-nhlt.c | 33 +++++++- sound/pci/hda/patch_realtek.c | 16 +++- sound/soc/amd/yc/acp6x-mach.c | 7 ++ sound/soc/codecs/cs43130.c | 6 +- sound/soc/codecs/da7219-aad.c | 2 +- sound/soc/codecs/hdac_hda.c | 23 ++++- sound/soc/codecs/nau8822.c | 9 +- sound/soc/codecs/rt5645.c | 10 ++- sound/soc/codecs/wm8974.c | 6 +- sound/soc/intel/boards/bytcr_rt5640.c | 31 +++++-- sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 + sound/soc/intel/skylake/skl-pcm.c | 9 +- sound/soc/intel/skylake/skl-sst-ipc.c | 4 +- sound/soc/soc-ops.c | 2 +- sound/soc/sof/intel/hda-codec.c | 18 ++-- tools/testing/selftests/alsa/mixer-test.c | 2 +- 103 files changed, 843 insertions(+), 286 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/100 f2fs: explicitly null-terminate the xattr list
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <[email protected]>
commit e26b6d39270f5eab0087453d9b544189a38c8564 upstream.
When setting an xattr, explicitly null-terminate the xattr list. This eliminates the fragile assumption that the unused xattr space is always zeroed.
--- fs/f2fs/xattr.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/xattr.c +6 -0
@@ -754,6 +754,12 @@ retry:memcpy (pval, value, size); last->e_value_size =cpu_to_le16 (size); new_hsize += newsize; +/* +* Explicitly add the null terminator. The unused xattr space +* is supposed to always be zeroed, which would make this +* unnecessary, but don't depend on that. +*/ + *(u32 *)((u8 *)last + newsize) =0 ; } error =write_all_xattrs (inode, new_hsize, base_addr, ipage);
Greg Kroah-Hartman
maintainerPATCH 2/100 pinctrl: lochnagar: Dont build on MIPS
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
[ Upstream commit 6588732445ff19f6183f0fa72ddedf67e5a5be32 ]
MIPS appears to define a RST symbol at a high level, which clashes with some register naming in the driver. Since there is currently no case for running this driver on MIPS devices simply cut off the build of this driver on MIPS.
--- drivers/pinctrl/cirrus/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/cirrus/Kconfig +2 -1
@@ -1,7 +1,8 @@ # SPDX-License-Identifier: GPL-2.0-only config PINCTRL_LOCHNAGAR tristate "Cirrus Logic Lochnagar pinctrl driver" - depends on MFD_LOCHNAGAR + # Avoid clash caused by MIPS defining RST, which is used in the driver + depends on MFD_LOCHNAGAR && !MIPS select GPIOLIB select PINMUX select PINCONF
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 3/100 ALSA: hda - Fix speaker and headset mic pin config for CHUWI CoreBook XPro
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasiliy Kovalev <[email protected]>
[ Upstream commit 7c9caa299335df94ad1c58f70a22f16a540eab60 ]
This patch corrected the speaker and headset mic pin config to the more appropriate values.
--- sound/pci/hda/patch_realtek.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/pci/hda/patch_realtek.c +10 -0
@@ -7108,6 +7108,7 @@ enum {ALC290_FIXUP_SUBWOOFER_HSJACK ,ALC269_FIXUP_THINKPAD_ACPI ,ALC269_FIXUP_DMIC_THINKPAD_ACPI , +ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO ,ALC255_FIXUP_ACER_MIC_NO_PRESENCE ,ALC255_FIXUP_ASUS_MIC_NO_PRESENCE , ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
@@ -7454,6 +7455,14 @@ static const struct hda_fixup alc269_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc269_fixup_pincfg_U7x7_headset_mic, }, + [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl []) { + {0x18 ,0x03a19020 },/* headset mic */ + {0x1b ,0x90170150 },/* speaker */ + { } + }, + }, [ALC269_FIXUP_AMIC] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl []) {
@@ -10032,6 +10041,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1d72 ,0x1901 ,"RedmiBook 14" ,ALC256_FIXUP_ASUS_HEADSET_MIC ),SND_PCI_QUIRK (0x1d72 ,0x1945 ,"Redmi G" ,ALC256_FIXUP_ASUS_HEADSET_MIC ),SND_PCI_QUIRK (0x1d72 ,0x1947 ,"RedmiBook Air" ,ALC255_FIXUP_XIAOMI_HEADSET_MIC ), +SND_PCI_QUIRK (0x2782 ,0x0232 ,"CHUWI CoreBook XPro" ,ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO ),SND_PCI_QUIRK (0x8086 ,0x2074 ,"Intel NUC 8" ,ALC233_FIXUP_INTEL_NUC8_DMIC ),SND_PCI_QUIRK (0x8086 ,0x2080 ,"Intel NUC 8 Rugged" ,ALC256_FIXUP_INTEL_NUC8_RUGGED ), SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 4/100 mptcp: fix uninit-value in mptcp_incoming_options
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Adam Davis <[email protected]>
[ Upstream commit 237ff253f2d4f6307b7b20434d7cbcc67693298b ]
Added initialization use_ack to mptcp_parse_option().
--- net/mptcp/options.c | 1 + 1 file changed, 1 insertion(+)
net/mptcp/options.c +1 -0
@@ -103,6 +103,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, mp_opt->suboptions |=OPTION_MPTCP_DSS ; mp_opt->use_map =1 ; mp_opt->mpc_map =1 ; + mp_opt->use_ack =0 ; mp_opt->data_len =get_unaligned_be16 (ptr); ptr +=2 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 5/100 wifi: cfg80211: lock wiphy mutex for rfkill poll
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 8e2f6f2366219b3304b227bdd2f04b64c92e3e12 ]
We want to guarantee the mutex is held for pretty much all operations, so ensure that here as well.
--- net/wireless/core.c | 2 ++ 1 file changed, 2 insertions(+)
net/wireless/core.c +2 -0
@@ -216,7 +216,9 @@ static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data) {struct cfg80211_registered_device *rdev = data; +wiphy_lock (&rdev->wiphy);rdev_rfkill_poll (rdev); +wiphy_unlock (&rdev->wiphy); } void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 6/100 wifi: avoid offset calculation on NULL pointer
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael-CY Lee <[email protected]>
[ Upstream commit ef5828805842204dd0259ecfc132b5916c8a77ae ]
ieee80211_he_6ghz_oper() can be passed a NULL pointer and checks for that, but already did the calculation to inside of it before. Move it after the check.
--- include/linux/ieee80211.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/ieee80211.h +3 -1
@@ -2658,12 +2658,14 @@ ieee80211_he_oper_size(const u8 *he_oper_ie)static inline const struct ieee80211_he_6ghz_oper *ieee80211_he_6ghz_oper (const struct ieee80211_he_operation *he_oper) { -const u8 *ret = (const void *)&he_oper->optional; +const u8 *ret;u32 he_oper_params;if (!he_oper)return NULL ; + ret = (const void *)&he_oper->optional; + he_oper_params =le32_to_cpu (he_oper->he_oper_params);if (!(he_oper_params &IEEE80211_HE_OPERATION_6GHZ_OP_INFO ))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 7/100 wifi: mac80211: handle 320 MHz in ieee80211_ht_cap_ie_to_sta_ht_cap
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Greear <[email protected]>
[ Upstream commit 00f7d153f3358a7c7e35aef66fcd9ceb95d90430 ]
The new 320 MHz channel width wasn't handled, so connecting a station to a 320 MHz AP would limit the station to 20 MHz (on HT) after a warning, handle 320 MHz to fix that.
--- net/mac80211/ht.c | 1 + 1 file changed, 1 insertion(+)
net/mac80211/ht.c +1 -0
@@ -271,6 +271,7 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,case NL80211_CHAN_WIDTH_80 :case NL80211_CHAN_WIDTH_80P80 :case NL80211_CHAN_WIDTH_160 : +case NL80211_CHAN_WIDTH_320 : bw = ht_cap.cap &IEEE80211_HT_CAP_SUP_WIDTH_20_40 ?IEEE80211_STA_RX_BW_40 :IEEE80211_STA_RX_BW_20 ;break ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 8/100 debugfs: fix automount d_fsdata usage
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 0ed04a1847a10297595ac24dc7d46b35fb35f90a ]
debugfs_create_automount() stores a function pointer in d_fsdata, but since commit 7c8d469877b1 ("debugfs: add support for more elaborate ->d_fsdata") debugfs_release_dentry() will free it, now conditionally on DEBUGFS_FSDATA_IS_REAL_FOPS_BIT, but that's not set for the function pointer in automount. As a result, removing an automount dentry would attempt to free the function pointer. Luckily, the only user of this (tracing) never removes it.
Nevertheless, it's safer if we just handle the fsdata in one way, namely either DEBUGFS_FSDATA_IS_REAL_FOPS_BIT or allocated. Thus, change the automount to allocate it, and use the real_fops in the data to indicate whether or not automount is filled, rather than adding a type tag. At least for now this isn't actually needed, but the next changes will require it.
Also check in debugfs_file_get() that it gets only called on regular files, just to make things clearer.
--- fs/debugfs/file.c | 8 ++++++++ fs/debugfs/inode.c | 27 ++++++++++++++++++++------- fs/debugfs/internal.h | 10 ++++++++-- 3 files changed, 36 insertions(+), 9 deletions(-)
fs/debugfs/file.c +8 -0
@@ -84,6 +84,14 @@ int debugfs_file_get(struct dentry *dentry)struct debugfs_fsdata *fsd;void *d_fsd; +/* +* This could only happen if some debugfs user erroneously calls +* debugfs_file_get() on a dentry that isn't even a file, let +* them know about it. +*/ +if (WARN_ON (!d_is_reg (dentry))) +return -EINVAL ; + d_fsd =READ_ONCE (dentry->d_fsdata);if (!((unsigned long )d_fsd &DEBUGFS_FSDATA_IS_REAL_FOPS_BIT )) { fsd = d_fsd;
fs/debugfs/inode.c +20 -7
@@ -237,17 +237,19 @@ static const struct super_operations debugfs_super_operations = {static void debugfs_release_dentry (struct dentry *dentry) { -void *fsd = dentry->d_fsdata; +struct debugfs_fsdata *fsd = dentry->d_fsdata; -if (!((unsigned long )fsd &DEBUGFS_FSDATA_IS_REAL_FOPS_BIT )) -kfree (dentry->d_fsdata); +if ((unsigned long )fsd &DEBUGFS_FSDATA_IS_REAL_FOPS_BIT ) +return ; + +kfree (fsd); }static struct vfsmount *debugfs_automount (struct path *path) { -debugfs_automount_t f; - f = (debugfs_automount_t )path->dentry->d_fsdata; -return f (path->dentry,d_inode (path->dentry)->i_private); +struct debugfs_fsdata *fsd = path->dentry->d_fsdata; + +return fsd->automount (path->dentry,d_inode (path->dentry)->i_private); }static const struct dentry_operations debugfs_dops = {
@@ -635,13 +637,23 @@ struct dentry *debugfs_create_automount(const char *name, void *data) {struct dentry *dentry =start_creating (name, parent); +struct debugfs_fsdata *fsd;struct inode *inode;if (IS_ERR (dentry))return dentry; + fsd =kzalloc (sizeof (*fsd),GFP_KERNEL ); +if (!fsd) { +failed_creating (dentry); +return ERR_PTR (-ENOMEM ); + } + + fsd->automount = f; +if (!(debugfs_allow &DEBUGFS_ALLOW_API )) {failed_creating (dentry); +kfree (fsd);return ERR_PTR (-EPERM ); }
@@ -649,13 +661,14 @@ struct dentry *debugfs_create_automount(const char *name,if (unlikely (!inode)) {pr_err ("out of free dentries, can not create automount '%s'\n" , name); +kfree (fsd);return failed_creating (dentry); }make_empty_dir_inode (inode); inode->i_flags |=S_AUTOMOUNT ; inode->i_private = data; - dentry->d_fsdata = (void *)f; + dentry->d_fsdata = fsd;/* directory inodes start off with i_nlink == 2 (for "." entry) */ inc_nlink (inode);d_instantiate (dentry, inode);
fs/debugfs/internal.h +8 -2
@@ -17,8 +17,14 @@ extern const struct file_operations debugfs_full_proxy_file_operations;struct debugfs_fsdata {const struct file_operations *real_fops; -refcount_t active_users; -struct completion active_users_drained; +union { +/* automount_fn is used when real_fops is NULL */ +debugfs_automount_t automount; +struct { +refcount_t active_users; +struct completion active_users_drained; + }; + }; };/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 9/100 ALSA: hda: intel-nhlt: Ignore vbps when looking for DMIC 32 bps format
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
[ Upstream commit 7b4c93a50a2ebbbaf656cc4fa6aca74a6166d85b ]
When looking up DMIC blob from the NHLT table and the format is 32 bits, ignore the vbps matching for 32 bps for DMIC since some NHLT table have the vbps as 24, some have it as 32.
The DMIC hardware supports only one type of 32 bit sample size, which is 24 bit sampling on the MSB side and bits[1:0] is used for indicating the channel number.
--- sound/hda/intel-nhlt.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-)
sound/hda/intel-nhlt.c +29 -4
@@ -238,7 +238,7 @@ EXPORT_SYMBOL(intel_nhlt_ssp_mclk_mask);static struct nhlt_specific_cfg *nhlt_get_specific_cfg (struct device *dev,struct nhlt_fmt *fmt,u8 num_ch, -u32 rate,u8 vbps,u8 bps) +u32 rate,u8 vbps,u8 bps,bool ignore_vbps) {struct nhlt_fmt_cfg *cfg = fmt->fmt_config;struct wav_fmt *wfmt;
@@ -255,8 +255,12 @@ nhlt_get_specific_cfg(struct device *dev, struct nhlt_fmt *fmt, u8 num_ch,dev_dbg (dev,"Endpoint format: ch=%d fmt=%d/%d rate=%d\n" , wfmt->channels, _vbps, _bps, wfmt->samples_per_sec); +/* +* When looking for exact match of configuration ignore the vbps +* from NHLT table when ignore_vbps is true +*/ if (wfmt->channels == num_ch && wfmt->samples_per_sec == rate && - vbps == _vbps && bps == _bps) + (ignore_vbps || vbps == _vbps) && bps == _bps)return &cfg->config; cfg = (struct nhlt_fmt_cfg *)(cfg->config.caps + cfg->config.size);
@@ -289,6 +293,7 @@ intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt, {struct nhlt_specific_cfg *cfg;struct nhlt_endpoint *epnt; +bool ignore_vbps = false;struct nhlt_fmt *fmt;int i;
@@ -298,7 +303,26 @@ intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,dev_dbg (dev,"Looking for configuration:\n" );dev_dbg (dev," vbus_id=%d link_type=%d dir=%d, dev_type=%d\n" , bus_id, link_type, dir, dev_type); -dev_dbg (dev," ch=%d fmt=%d/%d rate=%d\n" , num_ch, vbps, bps, rate); +if (link_type ==NHLT_LINK_DMIC && bps ==32 && (vbps ==24 || vbps ==32 )) { +/* +* The DMIC hardware supports only one type of 32 bits sample +* size, which is 24 bit sampling on the MSB side and bits[1:0] +* are used for indicating the channel number. +* It has been observed that some NHLT tables have the vbps +* specified as 32 while some uses 24. +* The format these variations describe are identical, the +* hardware is configured and behaves the same way. +* Note: when the samples assumed to be vbps=32 then the 'noise' +* introduced by the lower two bits (channel number) have no +* real life implication on audio quality. +*/ +dev_dbg (dev, +" ch=%d fmt=%d rate=%d (vbps is ignored for DMIC 32bit format)\n" , + num_ch, bps, rate); + ignore_vbps = true; + }else { +dev_dbg (dev," ch=%d fmt=%d/%d rate=%d\n" , num_ch, vbps, bps, rate); + }dev_dbg (dev,"Endpoint count=%d\n" , nhlt->endpoint_count); epnt = (struct nhlt_endpoint *)nhlt->desc;
@@ -307,7 +331,8 @@ intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,if (nhlt_check_ep_match (dev, epnt, bus_id, link_type, dir, dev_type)) { fmt = (struct nhlt_fmt *)(epnt->config.caps + epnt->config.size); - cfg =nhlt_get_specific_cfg (dev, fmt, num_ch, rate, vbps, bps); + cfg =nhlt_get_specific_cfg (dev, fmt, num_ch, rate, + vbps, bps, ignore_vbps);if (cfg)return cfg; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 10/100 nvme-core: fix a memory leak in nvme_ns_info_from_identify()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maurizio Lombardi <[email protected]>
[ Upstream commit e3139cef8257fcab1725441e2fd5fd0ccb5481b1 ]
In case of error, free the nvme_id_ns structure that was allocated by nvme_identify_ns().
--- drivers/nvme/host/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +5 -2
@@ -1511,7 +1511,8 @@ static int nvme_ns_info_from_identify(struct nvme_ctrl *ctrl,if (id->ncap ==0 ) {/* namespace not allocated or attached */ info->is_removed = true; -return -ENODEV ; + ret = -ENODEV ; + goto error; } info->anagrpid = id->anagrpid;
@@ -1529,8 +1530,10 @@ static int nvme_ns_info_from_identify(struct nvme_ctrl *ctrl, !memchr_inv(ids->nguid, 0, sizeof(ids->nguid)))memcpy (ids->nguid, id->nguid,sizeof (ids->nguid)); } + +error:kfree (id); -return 0 ; +return ret; } static int nvme_ns_info_from_id_cs_indep(struct nvme_ctrl *ctrl,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 11/100 drm/amd/display: update dcn315 lpddr pstate latency
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmytro Laktyushkin <[email protected]>
[ Upstream commit c92da0403d373c03ea5c65c0260c7db6762013b0 ]
[WHY/HOW]
Increase the pstate latency to improve ac/dc transition
--- .../drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +4 -4
@@ -324,7 +324,7 @@ static struct wm_table lpddr5_wm_table = { { .wm_inst = WM_A, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 11.65333, + .pstate_latency_us = 129.0, .sr_exit_time_us = 11.5, .sr_enter_plus_exit_time_us = 14.5, .valid = true,
@@ -332,7 +332,7 @@ static struct wm_table lpddr5_wm_table = { { .wm_inst = WM_B, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 11.65333, + .pstate_latency_us = 129.0, .sr_exit_time_us = 11.5, .sr_enter_plus_exit_time_us = 14.5, .valid = true,
@@ -340,7 +340,7 @@ static struct wm_table lpddr5_wm_table = { { .wm_inst = WM_C, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 11.65333, + .pstate_latency_us = 129.0, .sr_exit_time_us = 11.5, .sr_enter_plus_exit_time_us = 14.5, .valid = true,
@@ -348,7 +348,7 @@ static struct wm_table lpddr5_wm_table = { { .wm_inst = WM_D, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 11.65333, + .pstate_latency_us = 129.0, .sr_exit_time_us = 11.5, .sr_enter_plus_exit_time_us = 14.5, .valid = true,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 12/100 drm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lu Yao <[email protected]>
[ Upstream commit 2161e09cd05a50d80736fe397145340d2e8f6c05 ]
For 'AMDGPU_FAMILY_SI' family cards, in 'si_common_early_init' func, init 'didt_rreg' and 'didt_wreg' to 'NULL'. But in func 'amdgpu_debugfs_regs_didt_read/write', using 'RREG32_DIDT' 'WREG32_DIDT' lacks of relevant judgment. And other 'amdgpu_ip_block_version' that use these two definitions won't be added for 'AMDGPU_FAMILY_SI'.
So, add null pointer judgment before calling.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +6 -0
@@ -479,6 +479,9 @@ static ssize_t amdgpu_debugfs_regs_didt_read(struct file *f, char __user *buf,if (size &0x3 || *pos &0x3 )return -EINVAL ; +if (!adev->didt_rreg) +return -EOPNOTSUPP ; + r =pm_runtime_get_sync (adev_to_drm (adev)->dev);if (r <0 ) {pm_runtime_put_autosuspend (adev_to_drm (adev)->dev);
@@ -535,6 +538,9 @@ static ssize_t amdgpu_debugfs_regs_didt_write(struct file *f, const char __userif (size &0x3 || *pos &0x3 )return -EINVAL ; +if (!adev->didt_wreg) +return -EOPNOTSUPP ; + r =pm_runtime_get_sync (adev_to_drm (adev)->dev);if (r <0 ) {pm_runtime_put_autosuspend (adev_to_drm (adev)->dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 13/100 smb: client, common: fix fortify warnings
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
[ Upstream commit 0015eb6e12384ff1c589928e84deac2ad1ceb236 ]
When compiling with gcc version 14.0.0 20231126 (experimental) and CONFIG_FORTIFY_SOURCE=y, I've noticed the following:
In file included from ./include/linux/string.h:295,
from ./include/linux/bitmap.h:12,
from ./include/linux/cpumask.h:12,
from ./arch/x86/include/asm/paravirt.h:17,
from ./arch/x86/include/asm/cpuid.h:62,
from ./arch/x86/include/asm/processor.h:19,
from ./arch/x86/include/asm/cpufeature.h:5,
from ./arch/x86/include/asm/thread_info.h:53,
from ./include/linux/thread_info.h:60,
from ./arch/x86/include/asm/preempt.h:9,
from ./include/linux/preempt.h:79,
from ./include/linux/spinlock.h:56,
from ./include/linux/wait.h:9,
from ./include/linux/wait_bit.h:8,
from ./include/linux/fs.h:6,
from fs/smb/client/smb2pdu.c:18:
In function 'fortify_memcpy_chk',
inlined from '__SMB2_close' at fs/smb/client/smb2pdu.c:3480:4:
./include/linux/fortify-string.h:588:25: warning: call to '__read_overflow2_field'
declared with attribute warning: detected read beyond size of field (2nd parameter);
maybe use struct_group()? [-Wattribute-warning]
588 | __read_overflow2_field(q_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~and:
In file included from ./include/linux/string.h:295,
from ./include/linux/bitmap.h:12,
from ./include/linux/cpumask.h:12,
from ./arch/x86/include/asm/paravirt.h:17,
from ./arch/x86/include/asm/cpuid.h:62,
from ./arch/x86/include/asm/processor.h:19,
from ./arch/x86/include/asm/cpufeature.h:5,
from ./arch/x86/include/asm/thread_info.h:53,
from ./include/linux/thread_info.h:60,
from ./arch/x86/include/asm/preempt.h:9,
from ./include/linux/preempt.h:79,
from ./include/linux/spinlock.h:56,
from ./include/linux/wait.h:9,
from ./include/linux/wait_bit.h:8,
from ./include/linux/fs.h:6,
from fs/smb/client/cifssmb.c:17:
In function 'fortify_memcpy_chk',
inlined from 'CIFS_open' at fs/smb/client/cifssmb.c:1248:3:
./include/linux/fortify-string.h:588:25: warning: call to '__read_overflow2_field'
declared with attribute warning: detected read beyond size of field (2nd parameter);
maybe use struct_group()? [-Wattribute-warning]
588 | __read_overflow2_field(q_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In both cases, the fortification logic inteprets calls to 'memcpy()' as an attempts to copy an amount of data which exceeds the size of the specified field (i.e. more than 8 bytes from __le64 value) and thus issues an overread warning. Both of these warnings may be silenced by using the convenient 'struct_group()' quirk.
--- fs/smb/client/cifspdu.h | 24 ++++++++++++++---------- fs/smb/client/cifssmb.c | 6 ++++-- fs/smb/client/smb2pdu.c | 8 +++----- fs/smb/client/smb2pdu.h | 16 +++++++++------- fs/smb/common/smb2pdu.h | 17 ++++++++++------- 5 files changed, 40 insertions(+), 31 deletions(-)
fs/smb/client/cifspdu.h +14 -10
@@ -882,11 +882,13 @@ typedef struct smb_com_open_rsp {__u8 OplockLevel;__u16 Fid;__le32 CreateAction; -__le64 CreationTime; -__le64 LastAccessTime; -__le64 LastWriteTime; -__le64 ChangeTime; -__le32 FileAttributes; +struct_group (common_attributes, + __le64 CreationTime; + __le64 LastAccessTime; + __le64 LastWriteTime; + __le64 ChangeTime; + __le32 FileAttributes; + );__le64 AllocationSize;__le64 EndOfFile;__le16 FileType;
@@ -2268,11 +2270,13 @@ typedef struct {/* QueryFileInfo/QueryPathinfo (also for SetPath/SetFile) data buffer formats */ /******************************************************************************/ typedef struct { /* data block encoding of response to level 263 QPathInfo */ - __le64 CreationTime; - __le64 LastAccessTime; - __le64 LastWriteTime; - __le64 ChangeTime; - __le32 Attributes; + struct_group(common_attributes, + __le64 CreationTime; + __le64 LastAccessTime; + __le64 LastWriteTime; + __le64 ChangeTime; + __le32 Attributes; + ); __u32 Pad1; __le64 AllocationSize; __le64 EndOfFile; /* size ie offset to first free byte in file */
fs/smb/client/cifssmb.c +4 -2
@@ -1234,8 +1234,10 @@ CIFS_open(const unsigned int xid, struct cifs_open_parms *oparms, int *oplock, *oplock |=CIFS_CREATE_ACTION ;if (buf) { -/* copy from CreationTime to Attributes */ -memcpy ((char *)buf, (char *)&rsp->CreationTime,36 ); +/* copy commonly used attributes */ +memcpy (&buf->common_attributes, + &rsp->common_attributes, +sizeof (buf->common_attributes));/* the file_info buf is endian converted by caller */ buf->AllocationSize = rsp->AllocationSize; buf->EndOfFile = rsp->EndOfFile;
fs/smb/client/smb2pdu.c +3 -5
@@ -3429,12 +3429,10 @@ __SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, }else {trace_smb3_close_done (xid, persistent_fid, tcon->tid, ses->Suid); -/* -* Note that have to subtract 4 since struct network_open_info -* has a final 4 byte pad that close response does not have -*/ if (pbuf) -memcpy (pbuf, (char *)&rsp->CreationTime,sizeof (*pbuf) -4 ); +memcpy (&pbuf->network_open_info, + &rsp->network_open_info, +sizeof (pbuf->network_open_info)); }atomic_dec (&tcon->num_remote_opens);
fs/smb/client/smb2pdu.h +9 -7
@@ -339,13 +339,15 @@ struct smb2_file_reparse_point_info { } __packed;struct smb2_file_network_open_info { -__le64 CreationTime; -__le64 LastAccessTime; -__le64 LastWriteTime; -__le64 ChangeTime; -__le64 AllocationSize; -__le64 EndOfFile; -__le32 Attributes; + struct_group(network_open_info, + __le64 CreationTime; +__le64 LastAccessTime; +__le64 LastWriteTime; +__le64 ChangeTime; +__le64 AllocationSize; +__le64 EndOfFile; +__le32 Attributes; + );__le32 Reserved; } __packed;/* level 34 Query also similar returned in close rsp and open rsp */
fs/smb/common/smb2pdu.h +10 -7
@@ -699,13 +699,16 @@ struct smb2_close_rsp {__le16 StructureSize;/* 60 */ __le16 Flags;__le32 Reserved; -__le64 CreationTime; -__le64 LastAccessTime; -__le64 LastWriteTime; -__le64 ChangeTime; -__le64 AllocationSize;/* Beginning of FILE_STANDARD_INFO equivalent */ -__le64 EndOfFile; -__le32 Attributes; +struct_group (network_open_info, + __le64 CreationTime; + __le64 LastAccessTime; + __le64 LastWriteTime; + __le64 ChangeTime; +/* Beginning of FILE_STANDARD_INFO equivalent */ + __le64 AllocationSize; + __le64 EndOfFile; + __le32 Attributes; + ); } __packed;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 14/100 blk-mq: dont count completed flush data request as inflight in case of quiesce
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <[email protected]>
[ Upstream commit 0e4237ae8d159e3d28f3cd83146a46f576ffb586 ]
Request queue quiesce may interrupt flush sequence, and the original request may have been marked as COMPLETE, but can't get finished because of queue quiesce.
This way is fine from driver viewpoint, because flush sequence is block layer concept, and it isn't related with driver.
However, driver(such as dm-rq) can call blk_mq_queue_inflight() to count & drain inflight requests, then the wait & drain never gets done because the completed & not-finished flush request is counted as inflight.
Fix this issue by not counting completed flush data request as inflight in case of quiesce.
--- block/blk-mq.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
block/blk-mq.c +13 -1
@@ -1500,14 +1500,26 @@ void blk_mq_delay_kick_requeue_list(struct request_queue *q, }EXPORT_SYMBOL (blk_mq_delay_kick_requeue_list); +static bool blk_is_flush_data_rq (struct request *rq) +{ +return (rq->rq_flags &RQF_FLUSH_SEQ ) && !is_flush_rq (rq); +} +static bool blk_mq_rq_inflight (struct request *rq,void *priv) {/* * If we find a request that isn't idle we know the queue is busy * as it's checked in the iter. * Return false to stop the iteration. +* +* In case of queue quiesce, if one flush data request is completed, +* don't count it as inflight given the flush sequence is suspended, +* and the original flush data request is invisible to driver, just +* like other pending requests because of quiesce */ -if (blk_mq_request_started (rq)) { +if (blk_mq_request_started (rq) && !(blk_queue_quiesced (rq->q) && +blk_is_flush_data_rq (rq) && +blk_mq_request_completed (rq))) {bool *busy = priv; *busy = true;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 15/100 nvme-core: check for too small lba shift
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keith Busch <[email protected]>
[ Upstream commit 74fbc88e161424b3b96a22b23a8e3e1edab9d05c ]
The block layer doesn't support logical block sizes smaller than 512 bytes. The nvme spec doesn't support that small either, but the driver isn't checking to make sure the device responded with usable data. Failing to catch this will result in a kernel bug, either from a division by zero when stacking, or a zero length bio.
--- drivers/nvme/host/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +3 -2
@@ -1925,9 +1925,10 @@ static void nvme_update_disk_info(struct gendisk *disk,/* * The block layer can't support LBA sizes larger than the page size -* yet, so catch this early and don't allow block I/O. +* or smaller than a sector size yet, so catch this early and don't +* allow block I/O. */ -if (ns->lba_shift >PAGE_SHIFT ) { +if (ns->lba_shift >PAGE_SHIFT || ns->lba_shift <SECTOR_SHIFT ) { capacity =0 ; bs = (1 <<9 ); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 16/100 hwtracing: hisi_ptt: Handle the interrupt in hardirq context
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yicong Yang <[email protected]>
[ Upstream commit e0dd27ad8af00f147ac3c9de88e0687986afc3ea ]
Handle the trace interrupt in the hardirq context, make sure the irq core won't threaded it by declaring IRQF_NO_THREAD and userspace won't balance it by declaring IRQF_NOBALANCING. Otherwise we may violate the synchronization requirements of the perf core, referenced to the change of arm-ccn PMU
commit 0811ef7e2f54 ("bus: arm-ccn: fix PMU interrupt flags").
In the interrupt handler we mainly doing 2 things:
- Copy the data from the local DMA buffer to the AUX buffer
- Commit the data in the AUX buffer
--- drivers/hwtracing/ptt/hisi_ptt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/hwtracing/ptt/hisi_ptt.c +3 -3
@@ -342,9 +342,9 @@ static int hisi_ptt_register_irq(struct hisi_ptt *hisi_ptt)return ret; hisi_ptt->trace_irq =pci_irq_vector (pdev,HISI_PTT_TRACE_DMA_IRQ ); - ret =devm_request_threaded_irq (&pdev->dev, hisi_ptt->trace_irq, -NULL , hisi_ptt_isr,0 , -DRV_NAME , hisi_ptt); + ret =devm_request_irq (&pdev->dev, hisi_ptt->trace_irq, hisi_ptt_isr, +IRQF_NOBALANCING |IRQF_NO_THREAD ,DRV_NAME , + hisi_ptt);if (ret) {pci_err (pdev,"failed to request irq %d, ret = %d\n" , hisi_ptt->trace_irq, ret);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 17/100 hwtracing: hisi_ptt: Dont try to attach a task
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yicong Yang <[email protected]>
[ Upstream commit aff787f64ad7cbb54614b51b82c682fe06411ef3 ]
PTT is an uncore PMU and shouldn't be attached to any task. Block the usage in pmu::event_init().
--- drivers/hwtracing/ptt/hisi_ptt.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/hwtracing/ptt/hisi_ptt.c +3 -0
@@ -659,6 +659,9 @@ static int hisi_ptt_pmu_event_init(struct perf_event *event)return -EOPNOTSUPP ; } +if (event->attach_state &PERF_ATTACH_TASK ) +return -EOPNOTSUPP ; +if (event->attr.type != hisi_ptt->hisi_ptt_pmu.type)return -ENOENT ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 18/100 ASoC: wm8974: Correct boost mixer inputs
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
[ Upstream commit 37e6fd0cebf0b9f71afb38fd95b10408799d1f0b ]
Bit 6 of INPPGA (INPPGAMUTE) does not control the Aux path, it controls the input PGA path, as can been seen from Figure 8 Input Boost Stage in the datasheet. Update the naming of things in the driver to match this and update the routing to also reflect this.
--- sound/soc/codecs/wm8974.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/wm8974.c +3 -3
@@ -186,7 +186,7 @@ SOC_DAPM_SINGLE("PCM Playback Switch", WM8974_MONOMIX, 0, 1, 0),/* Boost mixer */ static const struct snd_kcontrol_new wm8974_boost_mixer[] = { -SOC_DAPM_SINGLE ("Aux Switch" ,WM8974_INPPGA ,6 ,1 ,1 ), +SOC_DAPM_SINGLE ("PGA Switch" ,WM8974_INPPGA ,6 ,1 ,1 ), };/* Input PGA */
@@ -246,8 +246,8 @@ static const struct snd_soc_dapm_route wm8974_dapm_routes[] = {/* Boost Mixer */ {"ADC", NULL, "Boost Mixer"}, - {"Boost Mixer", "Aux Switch", "Aux Input"}, - {"Boost Mixer", NULL, "Input PGA"}, + {"Boost Mixer", NULL, "Aux Input"}, + {"Boost Mixer", "PGA Switch", "Input PGA"}, {"Boost Mixer", NULL, "MICP"}, /* Input PGA */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 19/100 arm64: dts: rockchip: fix rk356x pcie msg interrupt name
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Stuebner <[email protected]>
[ Upstream commit 3cee9c635f27d1003d46f624d816f3455698b625 ]
The expected name by the binding at this position is "msg" and the SoC's manual also calls the interrupt in question "msg", so fix the rk356x dtsi to use the correct name.
--- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk356x.dtsi +1 -1
@@ -958,7 +958,7 @@ pcie2x1: pcie@fe260000 { <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "sys", "pmc", "msi", "legacy", "err"; + interrupt-names = "sys", "pmc", "msg", "legacy", "err"; bus-range = <0x0 0xf>; clocks = <&cru ACLK_PCIE20_MST>, <&cru ACLK_PCIE20_SLV>, <&cru ACLK_PCIE20_DBI>, <&cru PCLK_PCIE20>,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 20/100 ASoC: Intel: Skylake: Fix mem leak in few functions
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamil Duljas <[email protected]>
[ Upstream commit d5c65be34df73fa01ed05611aafb73b440d89e29 ]
The resources should be freed when function return error.
--- sound/soc/intel/skylake/skl-pcm.c | 4 +++- sound/soc/intel/skylake/skl-sst-ipc.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +3 -1
@@ -251,8 +251,10 @@ static int skl_pcm_open(struct snd_pcm_substream *substream,snd_pcm_set_sync (substream); mconfig =skl_tplg_fe_get_cpr_module (dai, substream->stream); -if (!mconfig) +if (!mconfig) { +kfree (dma_params);return -EINVAL ; + }skl_tplg_d0i3_get (skl, mconfig->d0i3_caps);
sound/soc/intel/skylake/skl-sst-ipc.c +3 -1
@@ -1003,8 +1003,10 @@ int skl_ipc_get_large_config(struct sst_generic_ipc *ipc, reply.size = (reply.header >>32 ) &IPC_DATA_OFFSET_SZ_MASK ; buf =krealloc (reply.data, reply.size,GFP_KERNEL ); -if (!buf) +if (!buf) { +kfree (reply.data);return -ENOMEM ; + } *payload = buf; *bytes = reply.size;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 21/100 ASoC: nau8822: Fix incorrect type in assignment and cast to restricted __be16
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Lin <[email protected]>
[ Upstream commit c1501f2597dd08601acd42256a4b0a0fc36bf302 ]
This issue is reproduced when W=1 build in compiler gcc-12. The following are sparse warnings:
sound/soc/codecs/nau8822.c:199:25: sparse: sparse: incorrect type in assignment sound/soc/codecs/nau8822.c:199:25: sparse: expected unsigned short sound/soc/codecs/nau8822.c:199:25: sparse: got restricted __be16 sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16 sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16 sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16 sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16
--- sound/soc/codecs/nau8822.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
sound/soc/codecs/nau8822.c +6 -3
@@ -184,6 +184,7 @@ static int nau8822_eq_get(struct snd_kcontrol *kcontrol,struct soc_bytes_ext *params = (void *)kcontrol->private_value;int i, reg;u16 reg_val, *val; +__be16 tmp; val = (u16 *)ucontrol->value.bytes.data; reg =NAU8822_REG_EQ1 ;
@@ -192,8 +193,8 @@ static int nau8822_eq_get(struct snd_kcontrol *kcontrol,/* conversion of 16-bit integers between native CPU format * and big endian format */ - reg_val =cpu_to_be16 (reg_val); -memcpy (val + i, ®_val,sizeof (reg_val)); + tmp =cpu_to_be16 (reg_val); +memcpy (val + i, &tmp,sizeof (tmp)); }return 0 ;
@@ -216,6 +217,7 @@ static int nau8822_eq_put(struct snd_kcontrol *kcontrol,void *data;u16 *val, value;int i, reg, ret; +__be16 *tmp; data =kmemdup (ucontrol->value.bytes.data, params->max,GFP_KERNEL |GFP_DMA );
@@ -228,7 +230,8 @@ static int nau8822_eq_put(struct snd_kcontrol *kcontrol,/* conversion of 16-bit integers between native CPU format * and big endian format */ - value =be16_to_cpu (*(val + i)); + tmp = (__be16 *)(val + i); + value =be16_to_cpup (tmp); ret =snd_soc_component_write (component, reg + i, value);if (ret) { dev_err(component->dev,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 22/100 ASoC: Intel: Skylake: mem leak in skl register function
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamil Duljas <[email protected]>
[ Upstream commit f8ba14b780273fd290ddf7ee0d7d7decb44cc365 ]
skl_platform_register() uses krealloc. When krealloc is fail, then previous memory is not freed. The leak is also when soc component registration failed.
--- sound/soc/intel/skylake/skl-pcm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/intel/skylake/skl-pcm.c +4 -1
@@ -1473,6 +1473,7 @@ int skl_platform_register(struct device *dev) dais =krealloc (skl->dais,sizeof (skl_fe_dai) +sizeof (skl_platform_dai),GFP_KERNEL );if (!dais) { +kfree (skl->dais); ret = -ENOMEM ; goto err; }
@@ -1485,8 +1486,10 @@ int skl_platform_register(struct device *dev) ret =devm_snd_soc_register_component (dev, &skl_component, skl->dais, num_dais); -if (ret) +if (ret) { +kfree (skl->dais);dev_err (dev,"soc component registration failed %d\n" , ret); + } err:return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 23/100 ASoC: cs43130: Fix the position of const qualifier
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Strozek <[email protected]>
[ Upstream commit e7f289a59e76a5890a57bc27b198f69f175f75d9 ]
--- sound/soc/codecs/cs43130.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/cs43130.c +2 -2
@@ -1683,7 +1683,7 @@ static ssize_t hpload_dc_r_show(struct device *dev,return cs43130_show_dc (dev, buf,HP_RIGHT ); } -static u16 const cs43130_ac_freq[CS43130_AC_FREQ ] = { +static const u16 cs43130_ac_freq[CS43130_AC_FREQ ] = {24 ,43 ,93 ,
@@ -2363,7 +2363,7 @@ static const struct regmap_config cs43130_regmap = { .use_single_write = true, }; -static u16 const cs43130_dc_threshold[CS43130_DC_THRESHOLD ] = { +static const u16 cs43130_dc_threshold[CS43130_DC_THRESHOLD ] = {50 ,120 , };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 24/100 ASoC: cs43130: Fix incorrect frame delay configuration
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Strozek <[email protected]>
[ Upstream commit aa7e8e5e4011571022dc06e4d7a2f108feb53d1a ]
--- sound/soc/codecs/cs43130.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cs43130.c +1 -1
@@ -579,7 +579,7 @@ static int cs43130_set_sp_fmt(int dai_id, unsigned int bitwidth_sclk,break ;case SND_SOC_DAIFMT_LEFT_J : hi_size = bitwidth_sclk; - frm_delay =2 ; + frm_delay =0 ; frm_phase =1 ;break ;case SND_SOC_DAIFMT_DSP_A :
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 25/100 ASoC: rt5650: add mutex to avoid the jack detection failure
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuming Fan <[email protected]>
[ Upstream commit cdba4301adda7c60a2064bf808e48fccd352aaa9 ]
This patch adds the jd_mutex to protect the jack detection control flow. And only the headset type could check the button status.
--- sound/soc/codecs/rt5645.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
sound/soc/codecs/rt5645.c +9 -1
@@ -448,6 +448,7 @@ struct rt5645_priv {struct regulator_bulk_data supplies[ARRAY_SIZE (rt5645_supply_names)];struct rt5645_eq_param_s *eq_param;struct timer_list btn_check_timer; +struct mutex jd_mutex;int codec_type;int sysclk;
@@ -3189,6 +3190,8 @@ static int rt5645_jack_detect(struct snd_soc_component *component, int jack_insert5645_enable_push_button_irq (component, true); } }else { +if (rt5645->en_button_func) +rt5645_enable_push_button_irq (component, false);snd_soc_dapm_disable_pin (dapm,"Mic Det Power" );snd_soc_dapm_sync (dapm); rt5645->jack_type =SND_JACK_HEADPHONE ;
@@ -3269,6 +3272,8 @@ static void rt5645_jack_detect_work(struct work_struct *work)if (!rt5645->component)return ; +mutex_lock (&rt5645->jd_mutex); +switch (rt5645->pdata.jd_mode) {case 0 :/* Not using rt5645 JD */ if (rt5645->gpiod_hp_det) {
@@ -3295,7 +3300,7 @@ static void rt5645_jack_detect_work(struct work_struct *work)if (!val && (rt5645->jack_type ==0 )) {/* jack in */ report =rt5645_jack_detect (rt5645->component,1 ); - }else if (!val && rt5645->jack_type !=0 ) { + }else if (!val && rt5645->jack_type ==SND_JACK_HEADSET ) {/* for push button and jack out */ btn_type =0 ;if (snd_soc_component_read (rt5645->component,RT5645_INT_IRQ_ST ) &0x4 ) {
@@ -3351,6 +3356,8 @@ static void rt5645_jack_detect_work(struct work_struct *work)rt5645_jack_detect (rt5645->component,0 ); } +mutex_unlock (&rt5645->jd_mutex); +snd_soc_jack_report (rt5645->hp_jack, report,SND_JACK_HEADPHONE );snd_soc_jack_report (rt5645->mic_jack, report,SND_JACK_MICROPHONE );if (rt5645->en_button_func)
@@ -4119,6 +4126,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c) }timer_setup (&rt5645->btn_check_timer, rt5645_btn_check_callback,0 ); +mutex_init (&rt5645->jd_mutex);INIT_DELAYED_WORK (&rt5645->jack_detect_work, rt5645_jack_detect_work);INIT_DELAYED_WORK (&rt5645->rcclock_work, rt5645_rcclock_work);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 26/100 ASoC: Intel: skl_hda_dsp_generic: Drop HDMI routes when HDMI is not available
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
[ Upstream commit 3d1dc8b1030df8ca0fdfd4905c88ee10db943bf8 ]
When the HDMI is not present due to disabled display support we will use dummy codec and the HDMI routes will refer to non existent DAPM widgets.
Trim the route list from the HDMI routes to be able to probe the card even if the HDMI dais are not registered.
--- sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/intel/boards/skl_hda_dsp_generic.c +2 -0
@@ -157,6 +157,8 @@ static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params) card->dapm_widgets = skl_hda_widgets; card->num_dapm_widgets =ARRAY_SIZE (skl_hda_widgets);if (!ctx->idisp_codec) { + card->dapm_routes = &skl_hda_map[IDISP_ROUTE_COUNT ]; + num_route -=IDISP_ROUTE_COUNT ;for (i =0 ; i <IDISP_DAI_COUNT ; i++) { skl_hda_be_dai_links[i].codecs = dummy_codec; skl_hda_be_dai_links[i].num_codecs =
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 27/100 nouveau/tu102: flush all pdbs on vmm flush
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
[ Upstream commit cb9c919364653eeafb49e7ff5cd32f1ad64063ac ]
This is a hack around a bug exposed with the GSP code, I'm not sure what is happening exactly, but it appears some of our flushes don't result in proper tlb invalidation for out BAR2 and we get a BAR2 fault from GSP and it all dies.
--- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c +1 -1
@@ -31,7 +31,7 @@ tu102_vmm_flush(struct nvkm_vmm *vmm, int depth) type |=0x00000001 ;/* PAGE_ALL */ if (atomic_read (&vmm->engref[NVKM_SUBDEV_BAR ])) - type |=0x00000004 ;/* HUB_ONLY */ + type |=0x00000006 ;/* HUB_ONLY | ALL PDB (hack) */ mutex_lock (&vmm->mmu->mutex);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 28/100 ASoC: amd: yc: Add DMI entry to support System76 Pangolin 13
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeremy Soller <[email protected]>
[ Upstream commit 19650c0f402f53abe48a55a1c49c8ed9576a088c ]
Add pang13 quirk to enable the internal microphone.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -353,6 +353,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_VERSION, "pang12"), } }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "System76"), + DMI_MATCH(DMI_PRODUCT_VERSION, "pang13"), + } + }, {} };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 29/100 ASoC: hdac_hda: Conditionally register dais for HDMI and Analog
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
[ Upstream commit a0575b4add21a243cc3257e75ad913cd5377d5f2 ]
The current driver is registering the same dais for each hdev found in the
system which results duplicated widgets to be registered and the kernel
log contains similar prints:snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Codec Output Pin1 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec Input Pin1 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Analog Codec Playback overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Digital Codec Playback overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt Analog Codec Playback overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Analog Codec Capture overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Digital Codec Capture overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt Analog Codec Capture overwritten
To avoid such issue, split the dai array into HDMI and non HDMI array and register them conditionally:
for HDMI hdev only register the dais needed for HDMI
for non HDMI hdev do not register the HDMI dais.
Depends-on: 3d1dc8b1030d ("ASoC: Intel: skl_hda_dsp_generic: Drop HDMI routes when HDMI is not available")
--- sound/soc/codecs/hdac_hda.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
sound/soc/codecs/hdac_hda.c +20 -3
@@ -124,6 +124,9 @@ static struct snd_soc_dai_driver hdac_hda_dais[] = { .sig_bits = 24, }, }, +}; + +static struct snd_soc_dai_driver hdac_hda_hdmi_dais[] = { { .id =HDAC_HDMI_0_DAI_ID , .name ="intel-hdmi-hifi1" ,
@@ -578,8 +581,16 @@ static const struct snd_soc_component_driver hdac_hda_codec = { .endianness = 1, }; +static const struct snd_soc_component_driver hdac_hda_hdmi_codec = { + .probe = hdac_hda_codec_probe, + .remove = hdac_hda_codec_remove, + .idle_bias_on = false, + .endianness =1 , +}; +static int hdac_hda_dev_probe (struct hdac_device *hdev) { +struct hdac_hda_priv *hda_pvt =dev_get_drvdata (&hdev->dev);struct hdac_ext_link *hlink;int ret;
@@ -592,9 +603,15 @@ static int hdac_hda_dev_probe(struct hdac_device *hdev)snd_hdac_ext_bus_link_get (hdev->bus, hlink);/* ASoC specific initialization */ - ret =devm_snd_soc_register_component (&hdev->dev, - &hdac_hda_codec, hdac_hda_dais, -ARRAY_SIZE (hdac_hda_dais)); +if (hda_pvt->need_display_power) + ret =devm_snd_soc_register_component (&hdev->dev, + &hdac_hda_hdmi_codec, hdac_hda_hdmi_dais, +ARRAY_SIZE (hdac_hda_hdmi_dais)); +else + ret =devm_snd_soc_register_component (&hdev->dev, + &hdac_hda_codec, hdac_hda_dais, +ARRAY_SIZE (hdac_hda_dais)); +if (ret <0 ) {dev_err (&hdev->dev,"failed to register HDA codec %d\n" , ret);return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 30/100 net/tg3: fix race condition in tg3_reset_task()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Tran <[email protected]>
[ Upstream commit 16b55b1f2269962fb6b5154b8bf43f37c9a96637 ]
When an EEH error is encountered by a PCI adapter, the EEH driver modifies the PCI channel's state as shown below:
enum {
/* I/O channel is in normal state */ pci_channel_io_normal = (__force pci_channel_state_t) 1,
/* I/O to channel is blocked */ pci_channel_io_frozen = (__force pci_channel_state_t) 2,
/* PCI card is dead */
pci_channel_io_perm_failure = (__force pci_channel_state_t) 3,
};
If the same EEH error then causes the tg3 driver's transmit timeout logic to execute, the tg3_tx_timeout() function schedules a reset task via tg3_reset_task_schedule(), which may cause a race condition between the tg3 and EEH driver as both attempt to recover the HW via a reset action.
EEH driver gets error event
--> eeh_set_channel_state()
and set device to one of
error state above scheduler: tg3_reset_task() get
returned error from tg3_init_hw()
--> dev_close() shuts down the interfacetg3_io_slot_reset() andtg3_io_resume() fail to
reset/resume the device
To resolve this issue, we avoid the race condition by checking the PCI channel state in the tg3_reset_task() function and skip the tg3 driver initiated reset when the PCI channel is not in the normal state. (The driver has no access to tg3 device registers at this point and cannot even complete the reset task successfully without external assistance.) We'll leave the reset procedure to be managed by the EEH driver which calls the tg3_io_error_detected(), tg3_io_slot_reset() and tg3_io_resume() functions as appropriate.
Adding the same checking in tg3_dump_state() to avoid dumping all device registers when the PCI channel is not in the normal state.
--- drivers/net/ethernet/broadcom/tg3.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.c +10 -1
@@ -6447,6 +6447,14 @@ static void tg3_dump_state(struct tg3 *tp)int i;u32 *regs; +/* If it is a PCI error, all registers will be 0xffff, +* we don't dump them out, just report the error and return +*/ +if (tp->pdev->error_state != pci_channel_io_normal) { +netdev_err (tp->dev,"PCI channel ERROR!\n" ); +return ; + } + regs =kzalloc (TG3_REG_BLK_SIZE ,GFP_ATOMIC );if (!regs)return ;
@@ -11184,7 +11192,8 @@ static void tg3_reset_task(struct work_struct *work)rtnl_lock ();tg3_full_lock (tp,0 ); -if (tp->pcierr_recovery || !netif_running (tp->dev)) { +if (tp->pcierr_recovery || !netif_running (tp->dev) || + tp->pdev->error_state != pci_channel_io_normal) {tg3_flag_clear (tp,RESET_TASK_PENDING );tg3_full_unlock (tp);rtnl_unlock ();
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 31/100 ASoC: da7219: Support low DC impedance headset
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Rau <[email protected]>
[ Upstream commit 5f44de697383fcc9a9a1a78f99e09d1838704b90 ]
Change the default MIC detection impedance threshold to 200ohm to support low mic DC impedance headset.
--- sound/soc/codecs/da7219-aad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/da7219-aad.c +1 -1
@@ -663,7 +663,7 @@ static struct da7219_aad_pdata *da7219_aad_fw_to_pdata(struct device *dev) aad_pdata->mic_det_thr =da7219_aad_fw_mic_det_thr (dev, fw_val32); else - aad_pdata->mic_det_thr = DA7219_AAD_MIC_DET_THR_500_OHMS; + aad_pdata->mic_det_thr = DA7219_AAD_MIC_DET_THR_200_OHMS;if (fwnode_property_read_u32 (aad_np,"dlg,jack-ins-deb" , &fw_val32) >=0 ) aad_pdata->jack_ins_deb =
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 32/100 ASoC: ops: add correct range check for limiting volume
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Kandagatla <[email protected]>
[ Upstream commit fb9ad24485087e0f00d84bee7a5914640b2b9024 ]
Volume can have ranges that start with negative values, ex: -84dB to +40dB. Apply correct range check in snd_soc_limit_volume before setting the platform_max. Without this patch, for example setting a 0dB limit on a volume range of -84dB to +40dB would fail.
--- sound/soc/soc-ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-ops.c +1 -1
@@ -661,7 +661,7 @@ int snd_soc_limit_volume(struct snd_soc_card *card, kctl =snd_soc_card_get_kcontrol (card, name);if (kctl) {struct soc_mixer_control *mc = (struct soc_mixer_control *)kctl->private_value; -if (max <= mc->max) { +if (max <= mc->max - mc->min) { mc->platform_max = max; ret =0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 33/100 nvme: introduce helper function to get ctrl state
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keith Busch <[email protected]>
[ Upstream commit 5c687c287c46fadb14644091823298875a5216aa ]
The controller state is typically written by another CPU, so reading it should ensure no optimizations are taken. This is a repeated pattern in the driver, so start with adding a convenience function that returns the controller state with READ_ONCE().
--- drivers/nvme/host/nvme.h | 5 +++++ 1 file changed, 5 insertions(+)
drivers/nvme/host/nvme.h +5 -0
@@ -382,6 +382,11 @@ struct nvme_ctrl {enum nvme_dctype dctype; }; +static inline enum nvme_ctrl_state nvme_ctrl_state (struct nvme_ctrl *ctrl) +{ +return READ_ONCE (ctrl->state); +} +enum nvme_iopolicy {NVME_IOPOLICY_NUMA ,NVME_IOPOLICY_RR ,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 34/100 nvme: prevent potential spectre v1 gadget
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nitesh Shetty <[email protected]>
[ Upstream commit 20dc66f2d76b4a410df14e4675e373b718babc34 ]
This patch fixes the smatch warning, "nvmet_ns_ana_grpid_store() warn:
potential spectre issue 'nvmet_ana_group_enabled' [w] (local cap)" Prevent the contents of kernel memory from being leaked to user space via speculative execution by using array_index_nospec.
--- drivers/nvme/target/configfs.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/target/configfs.c +3 -0
@@ -16,6 +16,7 @@#endif #include <crypto/hash.h> #include <crypto/kpp.h> +#include <linux/nospec.h> #include "nvmet.h"
@@ -508,6 +509,7 @@ static ssize_t nvmet_ns_ana_grpid_store(struct config_item *item,down_write (&nvmet_ana_sem); oldgrpid = ns->anagrpid; + newgrpid =array_index_nospec (newgrpid,NVMET_MAX_ANAGRPS ); nvmet_ana_group_enabled[newgrpid]++; ns->anagrpid = newgrpid; nvmet_ana_group_enabled[oldgrpid]--;
@@ -1580,6 +1582,7 @@ static struct config_group *nvmet_ana_groups_make_group( grp->grpid = grpid;down_write (&nvmet_ana_sem); + grpid =array_index_nospec (grpid,NVMET_MAX_ANAGRPS ); nvmet_ana_group_enabled[grpid]++;up_write (&nvmet_ana_sem);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 35/100 arm64: dts: rockchip: Fix PCI node addresses on rk3399-gru
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <[email protected]>
[ Upstream commit c13c823a78b77ea0e5f1f73112d910e259911101 ]
The rk3399-gru PCI node addresses are wrong.
In rk3399-gru-scarlet, the bus number in the address should be 0. This is because bus number assignment is dynamic and not known up front. For FDT, the bus number is simply ignored.
In rk3399-gru-chromebook, the addresses are simply invalid. The first "reg" entry must be the configuration space for the device. The entry should be all 0s except for device/slot and function numbers. The existing 64-bit memory space (0x83000000) entries are not valid because they must have the BAR address in the lower byte of the first cell.
Warnings for these are enabled by adding the missing 'device_type = "pci"' for the root port node.
--- arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi | 3 +-- arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet-dumo.dts | 4 ++-- arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 1 + 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi +1 -2
@@ -510,8 +510,7 @@ wacky_spi_audio: spi2@0 { &pci_rootport { mvl_wifi: wifi@0,0 { compatible = "pci1b4b,2b42"; - reg = <0x83010000 0x0 0x00000000 0x0 0x00100000 - 0x83010000 0x0 0x00100000 0x0 0x00100000>; + reg = <0x0000 0x0 0x0 0x0 0x0>; interrupt-parent = <&gpio0>; interrupts = <8 IRQ_TYPE_LEVEL_LOW>; pinctrl-names = "default";
arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet-dumo.dts +2 -2
@@ -34,8 +34,8 @@ &mipi_panel { &pci_rootport { wifi@0,0 { compatible = "qcom,ath10k"; - reg = <0x00010000 0x0 0x00000000 0x0 0x00000000>, - <0x03010010 0x0 0x00000000 0x0 0x00200000>; + reg = <0x00000000 0x0 0x00000000 0x0 0x00000000>, + <0x03000010 0x0 0x00000000 0x0 0x00200000>; qcom,ath10k-calibration-variant = "GO_DUMO"; }; };
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi +1 -0
@@ -489,6 +489,7 @@ pci_rootport: pcie@0,0 { #address-cells = <3>; #size-cells = <2>; ranges; + device_type = "pci"; }; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 36/100 mips/smp: Call rcutree_report_cpu_starting() earlier
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wiehler <[email protected]>
[ Upstream commit 55702ec9603ebeffb15e6f7b113623fe1d8872f4 ]
rcutree_report_cpu_starting() must be called before clockevents_register_device() to avoid the following lockdep splat triggered by calling list_add() when CONFIG_PROVE_RCU_LIST=y:
WARNING: suspicious RCU usage
...
-----------------------------
kernel/locking/lockdep.c:3680 RCU-list traversed in non-reader section!!
other info that might help us debug this:
RCU used illegally from offline CPU!
rcu_scheduler_active = 1, debug_locks = 1
no locks held by swapper/1/0.
...
Call Trace: [<ffffffff8012a434>] show_stack+0x64/0x158 [<ffffffff80a93d98>] dump_stack_lvl+0x90/0xc4 [<ffffffff801c9e9c>] __lock_acquire+0x1404/0x2940 [<ffffffff801cbf3c>] lock_acquire+0x14c/0x448 [<ffffffff80aa4260>] _raw_spin_lock_irqsave+0x50/0x88 [<ffffffff8021e0c8>] clockevents_register_device+0x60/0x1e8 [<ffffffff80130ff0>] r4k_clockevent_init+0x220/0x3a0 [<ffffffff801339d0>] start_secondary+0x50/0x3b8
raw_smp_processor_id() is required in order to avoid calling into lockdep before RCU has declared the CPU to be watched for readers.
See also commit 29368e093921 ("x86/smpboot: Move rcu_cpu_starting() earlier"), commit de5d9dae150c ("s390/smp: move rcu_cpu_starting() earlier") and commit 99f070b62322 ("powerpc/smp: Call rcu_cpu_starting() earlier").
--- arch/mips/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/smp.c +2 -2
@@ -333,10 +333,11 @@ early_initcall(mips_smp_ipi_init);*/ asmlinkage void start_secondary(void) { -unsigned int cpu; +unsigned int cpu =raw_smp_processor_id ();cpu_probe ();per_cpu_trap_init (false); +rcutree_report_cpu_starting (cpu);mips_clockevent_init (); mp_ops->init_secondary ();cpu_report ();
@@ -348,7 +349,6 @@ asmlinkage void start_secondary(void)*/ calibrate_delay (); - cpu =smp_processor_id (); cpu_data[cpu].udelay_val = loops_per_jiffy;set_cpu_sibling_map (cpu);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 37/100 drm/amdgpu: Add NULL checks for function pointers
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
[ Upstream commit 81577503efb49f4ad76af22f9941d72900ef4aab ]
Check if function is implemented before making the call.
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +8 -4
@@ -1411,9 +1411,11 @@ static void soc15_common_get_clockgating_state(void *handle, u64 *flags)if (amdgpu_sriov_vf (adev)) *flags =0 ; - adev->nbio.funcs->get_clockgating_state (adev, flags); +if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state) + adev->nbio.funcs->get_clockgating_state (adev, flags); - adev->hdp.funcs->get_clock_gating_state (adev, flags); +if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state) + adev->hdp.funcs->get_clock_gating_state (adev, flags);if (adev->ip_versions[MP0_HWIP ][0 ] !=IP_VERSION (13 ,0 ,2 )) {
@@ -1429,9 +1431,11 @@ static void soc15_common_get_clockgating_state(void *handle, u64 *flags) }/* AMD_CG_SUPPORT_ROM_MGCG */ - adev->smuio.funcs->get_clock_gating_state (adev, flags); +if (adev->smuio.funcs && adev->smuio.funcs->get_clock_gating_state) + adev->smuio.funcs->get_clock_gating_state (adev, flags); - adev->df.funcs->get_clockgating_state (adev, flags); +if (adev->df.funcs && adev->df.funcs->get_clockgating_state) + adev->df.funcs->get_clockgating_state (adev, flags); } static int soc15_common_set_powergating_state(void *handle,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 38/100 drm/exynos: fix a potential error pointer dereference
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Yang <[email protected]>
[ Upstream commit 73bf1c9ae6c054c53b8e84452c5e46f86dd28246 ]
Smatch reports the warning below:drivers/gpu/drm/exynos/exynos_hdmi.c:1864 hdmi_bind()
error: 'crtc' dereferencing possible ERR_PTR()
The return value of exynos_drm_crtc_get_by_type maybe ERR_PTR(-ENODEV), which can not be used directly. Fix this by checking the return value before using it.
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/exynos/exynos_hdmi.c +2 -0
@@ -1861,6 +1861,8 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)return ret; crtc =exynos_drm_crtc_get_by_type (drm_dev,EXYNOS_DISPLAY_TYPE_HDMI ); +if (IS_ERR (crtc)) +return PTR_ERR (crtc); crtc->pipe_clk = &hdata->phy_clk; ret =hdmi_create_connector (encoder);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 39/100 drm/exynos: fix a wrong error checking
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Inki Dae <[email protected]>
[ Upstream commit 8d1b7809684c688005706125b804e1f9792d2b1b ]
Fix a wrong error checking in exynos_drm_dma.c module.
In the exynos_drm_register_dma function, both arm_iommu_create_mapping() and iommu_get_domain_for_dev() functions are expected to return NULL as an error.
However, the error checking is performed using the statement if(IS_ERR(mapping)), which doesn't provide a suitable error value. So check if 'mapping' is NULL, and if it is, return -ENODEV.
This issue[1] was reported by Dan.
Changelog v1:
- fix build warning.
[1] https://lore.kernel.org/all/[email protected]/
--- drivers/gpu/drm/exynos/exynos_drm_dma.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dma.c +3 -5
@@ -107,18 +107,16 @@ int exynos_drm_register_dma(struct drm_device *drm, struct device *dev,return 0 ;if (!priv->mapping) { -void *mapping; +void *mapping =NULL ;if (IS_ENABLED (CONFIG_ARM_DMA_USE_IOMMU )) mapping =arm_iommu_create_mapping (&platform_bus_type,EXYNOS_DEV_ADDR_START ,EXYNOS_DEV_ADDR_SIZE );else if (IS_ENABLED (CONFIG_IOMMU_DMA )) mapping =iommu_get_domain_for_dev (priv->dma_dev); -else - mapping =ERR_PTR (-ENODEV ); -if (IS_ERR (mapping)) -return PTR_ERR (mapping); +if (!mapping) +return -ENODEV ; priv->mapping = mapping; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 40/100 hwmon: (corsair-psu) Fix probe when built-in
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Armin Wolf <[email protected]>
[ Upstream commit 307004e8b254ad28e150b63f299ab9caa4bc7c3e ]
It seems that when the driver is built-in, the HID bus is initialized after the driver is loaded, which whould cause module_hid_driver() to fail.
Fix this by registering the driver after the HID bus using late_initcall() in accordance with other hwmon HID drivers.
[groeck: Dropped "compile tested" comment; the patch has been tested
but the tester did not provide a Tested-by: tag]
--- drivers/hwmon/corsair-psu.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/hwmon/corsair-psu.c +17 -1
@@ -837,7 +837,23 @@ static struct hid_driver corsairpsu_driver = { .reset_resume = corsairpsu_resume,#endif }; -module_hid_driver (corsairpsu_driver); + +static int __init corsair_init (void ) +{ +return hid_register_driver (&corsairpsu_driver); +} + +static void __exit corsair_exit(void) +{ +hid_unregister_driver (&corsairpsu_driver); +} + +/* +* With module_init() the driver would load before the HID bus when +* built-in, so use late_initcall() instead. +*/ +late_initcall (corsair_init); +module_exit (corsair_exit);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Wilken Gottwalt <[email protected]>" );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 41/100 LoongArch: Preserve syscall nr across execve()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hengqi Chen <[email protected]>
[ Upstream commit d6c5f06e46a836e6a70c7cfd95bb38a67d9252ec ]
Currently, we store syscall nr in pt_regs::regs[11] and syscall execve() accidentally overrides it during its execution:
sys_execve()
-> do_execve()
-> do_execveat_common()
-> bprm_execve()
-> exec_binprm()
-> search_binary_handler()
-> load_elf_binary()
-> ELF_PLAT_INIT()ELF_PLAT_INIT() reset regs[11] to 0, so in syscall_exit_to_user_mode() we later get a wrong syscall nr. This breaks tools like execsnoop since it relies on execve() tracepoints.
Skip pt_regs::regs[11] reset in ELF_PLAT_INIT() to fix the issue.
--- arch/loongarch/include/asm/elf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/include/asm/elf.h +1 -1
@@ -293,7 +293,7 @@ extern const char *__elf_platform; #define ELF_PLAT_INIT(_r, load_addr) do { \ _r->regs[1] = _r->regs[2] = _r->regs[3] = _r->regs[4] = 0; \ _r->regs[5] = _r->regs[6] = _r->regs[7] = _r->regs[8] = 0; \ - _r->regs[9] = _r->regs[10] = _r->regs[11] = _r->regs[12] = 0; \ + _r->regs[9] = _r->regs[10] /* syscall n */ = _r->regs[12] = 0; \ _r->regs[13] = _r->regs[14] = _r->regs[15] = _r->regs[16] = 0; \ _r->regs[17] = _r->regs[18] = _r->regs[19] = _r->regs[20] = 0; \ _r->regs[21] = _r->regs[22] = _r->regs[23] = _r->regs[24] = 0; \
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 42/100 clk: rockchip: rk3568: Add PLL rate for 292.5MHz
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Morgan <[email protected]>
[ Upstream commit 1af27671f62ce919f1fb76082ed81f71cb090989 ]
Add support for a PLL rate of 292.5MHz so that the Powkiddy RGB30 panel can run at a requested 60hz (59.96, close enough).
I have confirmed this rate fits with all the constraints listed in the TRM for the VPLL (as an integer PLL) in Part 1 "Chapter 2 Clock & Reset Unit (CRU)."
--- drivers/clk/rockchip/clk-rk3568.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/rockchip/clk-rk3568.c +1 -0
@@ -72,6 +72,7 @@ static struct rockchip_pll_rate_table rk3568_pll_rates[] = {RK3036_PLL_RATE (408000000 ,1 ,68 ,2 ,2 ,1 ,0 ),RK3036_PLL_RATE (312000000 ,1 ,78 ,6 ,1 ,1 ,0 ),RK3036_PLL_RATE (297000000 ,2 ,99 ,4 ,1 ,1 ,0 ), +RK3036_PLL_RATE (292500000 ,1 ,195 ,4 ,4 ,1 ,0 ),RK3036_PLL_RATE (241500000 ,2 ,161 ,4 ,2 ,1 ,0 ),RK3036_PLL_RATE (216000000 ,1 ,72 ,4 ,2 ,1 ,0 ), RK3036_PLL_RATE(200000000, 1, 100, 3, 4, 1, 0),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 43/100 clk: rockchip: rk3128: Fix HCLK_OTG gate register
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weihao Li <[email protected]>
[ Upstream commit c6c5a5580dcb6631aa6369dabe12ef3ce784d1d2 ]
The HCLK_OTG gate control is in CRU_CLKGATE5_CON, not CRU_CLKGATE3_CON.
--- drivers/clk/rockchip/clk-rk3128.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3128.c +1 -1
@@ -490,7 +490,7 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = {GATE (HCLK_I2S_2CH ,"hclk_i2s_2ch" ,"hclk_peri" ,0 ,RK2928_CLKGATE_CON (7 ),2 ,GFLAGS ),GATE (0 ,"hclk_usb_peri" ,"hclk_peri" ,CLK_IGNORE_UNUSED ,RK2928_CLKGATE_CON (9 ),13 ,GFLAGS ),GATE (HCLK_HOST2 ,"hclk_host2" ,"hclk_peri" ,0 ,RK2928_CLKGATE_CON (7 ),3 ,GFLAGS ), -GATE (HCLK_OTG ,"hclk_otg" ,"hclk_peri" ,0 ,RK2928_CLKGATE_CON (3 ),13 ,GFLAGS ), +GATE (HCLK_OTG ,"hclk_otg" ,"hclk_peri" ,0 ,RK2928_CLKGATE_CON (5 ),13 ,GFLAGS ),GATE (0 ,"hclk_peri_ahb" ,"hclk_peri" ,CLK_IGNORE_UNUSED ,RK2928_CLKGATE_CON (9 ),14 ,GFLAGS ),GATE (HCLK_SPDIF ,"hclk_spdif" ,"hclk_peri" ,0 ,RK2928_CLKGATE_CON (10 ),9 ,GFLAGS ), GATE(HCLK_TSP, "hclk_tsp", "hclk_peri", 0, RK2928_CLKGATE_CON(10), 12, GFLAGS),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 44/100 jbd2: correct the printing of write_flags in jbd2_write_superblock()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Yi <[email protected]>
[ Upstream commit 85559227211020b270728104c3b89918f7af27ac ]
The write_flags print in the trace of jbd2_write_superblock() is not real, so move the modification before the trace.
--- fs/jbd2/journal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/jbd2/journal.c +3 -1
@@ -1620,9 +1620,11 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags)return -EIO ; } -trace_jbd2_write_superblock (journal, write_flags);if (!(journal->j_flags &JBD2_BARRIER )) write_flags &= ~(REQ_FUA |REQ_PREFLUSH ); + +trace_jbd2_write_superblock (journal, write_flags); +if (buffer_write_io_error (bh)) {/* * Oh, dear. A previous attempt to write the journal
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 45/100 jbd2: increase the journal IOs priority
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Yi <[email protected]>
[ Upstream commit 6a3afb6ac6dfab158ebdd4b87941178f58c8939f ]
Current jbd2 only add REQ_SYNC for descriptor block, metadata log buffer, commit buffer and superblock buffer, the submitted IO could be throttled by writeback throttle in block layer, that could lead to priority inversion in some cases. The log IO looks like a kind of high priority metadata IO, so it should not be throttled by WBT like QOS policies in block layer, let's add REQ_SYNC | REQ_IDLE to exempt from writeback throttle, and also add REQ_META together indicates it's a metadata IO.
--- fs/jbd2/commit.c | 9 +++++---- fs/jbd2/journal.c | 20 +++++++++++--------- include/linux/jbd2.h | 3 +++ 3 files changed, 19 insertions(+), 13 deletions(-)
fs/jbd2/commit.c +5 -4
@@ -123,7 +123,7 @@ static int journal_submit_commit_record(journal_t *journal,struct commit_header *tmp;struct buffer_head *bh;struct timespec64 now; -blk_opf_t write_flags =REQ_OP_WRITE |REQ_SYNC ; +blk_opf_t write_flags =REQ_OP_WRITE |JBD2_JOURNAL_REQ_FLAGS ; *cbh =NULL ;
@@ -429,8 +429,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)*/ jbd2_journal_update_sb_log_tail (journal, journal->j_tail_sequence, - journal->j_tail, -REQ_SYNC ); + journal->j_tail,0 );mutex_unlock (&journal->j_checkpoint_mutex); }else {jbd2_debug (3 ,"superblock not updated\n" );
@@ -749,6 +748,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)for (i =0 ; i < bufs; i++) {struct buffer_head *bh = wbuf[i]; +/* * Compute checksum. */
@@ -761,7 +761,8 @@ void jbd2_journal_commit_transaction(journal_t *journal)clear_buffer_dirty (bh);set_buffer_uptodate (bh); bh->b_end_io = journal_end_buffer_io_sync; -submit_bh (REQ_OP_WRITE |REQ_SYNC , bh); +submit_bh (REQ_OP_WRITE |JBD2_JOURNAL_REQ_FLAGS , + bh); }cond_resched ();
fs/jbd2/journal.c +11 -9
@@ -1109,8 +1109,7 @@ int __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block)* space and if we lose sb update during power failure we'd replay * old transaction with possibly newly overwritten data. */ - ret =jbd2_journal_update_sb_log_tail (journal, tid, block, -REQ_SYNC |REQ_FUA ); + ret =jbd2_journal_update_sb_log_tail (journal, tid, block,REQ_FUA );if (ret) goto out;
@@ -1597,8 +1596,7 @@ static int journal_reset(journal_t *journal)*/ jbd2_journal_update_sb_log_tail (journal, journal->j_tail_sequence, - journal->j_tail, -REQ_SYNC |REQ_FUA ); + journal->j_tail,REQ_FUA );mutex_unlock (&journal->j_checkpoint_mutex); }return jbd2_journal_start_thread (journal);
@@ -1620,6 +1618,11 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags)return -EIO ; } +/* +* Always set high priority flags to exempt from block layer's +* QOS policies, e.g. writeback throttle. +*/ + write_flags |=JBD2_JOURNAL_REQ_FLAGS ;if (!(journal->j_flags &JBD2_BARRIER )) write_flags &= ~(REQ_FUA |REQ_PREFLUSH );
@@ -1873,7 +1876,7 @@ void jbd2_journal_update_sb_errno(journal_t *journal)jbd2_debug (1 ,"JBD2: updating superblock error (errno %d)\n" , errcode); sb->s_errno =cpu_to_be32 (errcode); -jbd2_write_superblock (journal,REQ_SYNC |REQ_FUA ); +jbd2_write_superblock (journal,REQ_FUA ); }EXPORT_SYMBOL (jbd2_journal_update_sb_errno);
@@ -2178,8 +2181,7 @@ int jbd2_journal_destroy(journal_t *journal) ++journal->j_transaction_sequence;write_unlock (&journal->j_state_lock); -jbd2_mark_journal_empty (journal, -REQ_SYNC |REQ_PREFLUSH |REQ_FUA ); +jbd2_mark_journal_empty (journal,REQ_PREFLUSH |REQ_FUA );mutex_unlock (&journal->j_checkpoint_mutex); }else err = -EIO ;
@@ -2488,7 +2490,7 @@ int jbd2_journal_flush(journal_t *journal, unsigned int flags)* the magic code for a fully-recovered superblock. Any future * commits of data to the journal will restore the current * s_start value. */ -jbd2_mark_journal_empty (journal,REQ_SYNC |REQ_FUA ); +jbd2_mark_journal_empty (journal,REQ_FUA );if (flags) err =__jbd2_journal_erase (journal, flags);
@@ -2538,7 +2540,7 @@ int jbd2_journal_wipe(journal_t *journal, int write)if (write) {/* Lock to make assertions happy... */ mutex_lock_io (&journal->j_checkpoint_mutex); -jbd2_mark_journal_empty (journal,REQ_SYNC |REQ_FUA ); +jbd2_mark_journal_empty (journal,REQ_FUA );mutex_unlock (&journal->j_checkpoint_mutex); }
include/linux/jbd2.h +3 -0
@@ -1374,6 +1374,9 @@ JBD2_FEATURE_INCOMPAT_FUNCS(csum2, CSUM_V2) JBD2_FEATURE_INCOMPAT_FUNCS(csum3, CSUM_V3)JBD2_FEATURE_INCOMPAT_FUNCS (fast_commit,FAST_COMMIT ) +/* Journal high priority write IO operation flags */ +#define JBD2_JOURNAL_REQ_FLAGS (REQ_META | REQ_SYNC | REQ_IDLE) +/* * Journal flag definitions */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 46/100 drm/crtc: Fix uninit-value bug in drm_mode_setcrtc
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ziqi Zhao <[email protected]>
[ Upstream commit 3823119b9c2b5f9e9b760336f75bc989b805cde6 ]
The connector_set contains uninitialized values when allocated with kmalloc_array. However, in the "out" branch, the logic assumes that any element in connector_set would be equal to NULL if failed to initialize, which causes the bug reported by Syzbot. The fix is to use an extra variable to keep track of how many connectors are initialized indeed, and use that variable to decrease any refcounts in the "out" branch.
--- drivers/gpu/drm/drm_crtc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_crtc.c +5 -4
@@ -715,8 +715,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,struct drm_mode_set set;uint32_t __user *set_connectors_ptr;struct drm_modeset_acquire_ctx ctx; -int ret; -int i; +int ret, i, num_connectors;if (!drm_core_check_feature (dev,DRIVER_MODESET ))return -EOPNOTSUPP ;
@@ -851,6 +850,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, goto out; } + num_connectors =0 ;for (i =0 ; i < crtc_req->count_connectors; i++) { connector_set[i] =NULL ; set_connectors_ptr = (uint32_t __user *)(unsigned long )crtc_req->set_connectors_ptr;
@@ -871,6 +871,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, connector->name); connector_set[i] = connector; + num_connectors++; } }
@@ -879,7 +880,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, set.y = crtc_req->y; set.mode = mode; set.connectors = connector_set; - set.num_connectors = crtc_req->count_connectors; + set.num_connectors = num_connectors; set.fb = fb;if (drm_drv_uses_atomic_modeset (dev))
@@ -892,7 +893,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,drm_framebuffer_put (fb);if (connector_set) { -for (i =0 ; i < crtc_req->count_connectors; i++) { +for (i =0 ; i < num_connectors; i++) {if (connector_set[i])drm_connector_put (connector_set[i]); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 47/100 neighbour: Dont let neigh_forced_gc() disable preemption for long
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Judy Hsiao <[email protected]>
[ Upstream commit e5dc5afff62f3e97e86c3643ec9fcad23de4f2d3 ]
We are seeing cases where neigh_cleanup_and_release() is called by neigh_forced_gc() many times in a row with preemption turned off. When running on a low powered CPU at a low CPU frequency, this has been measured to keep preemption off for ~10 ms. That's not great on a system with HZ=1000 which expects tasks to be able to schedule in with ~1ms latency.
--- net/core/neighbour.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
net/core/neighbour.c +8 -1
@@ -253,9 +253,11 @@ static int neigh_forced_gc(struct neigh_table *tbl) {int max_clean =atomic_read (&tbl->gc_entries) -READ_ONCE (tbl->gc_thresh2); +u64 tmax =ktime_get_ns () +NSEC_PER_MSEC ;unsigned long tref = jiffies -5 *HZ ;struct neighbour *n, *tmp;int shrunk =0 ; +int loop =0 ;NEIGH_CACHE_STAT_INC (tbl, forced_gc_runs);
@@ -278,11 +280,16 @@ static int neigh_forced_gc(struct neigh_table *tbl) shrunk++;if (shrunk >= max_clean)break ; +if (++loop ==16 ) { +if (ktime_get_ns () > tmax) + goto unlock; + loop =0 ; + } } }WRITE_ONCE (tbl->last_flush, jiffies); - +unlock:write_unlock_bh (&tbl->lock);return shrunk;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 48/100 platform/x86: intel-vbtn: Fix missing tablet-mode-switch events
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 14c200b7ca46b9a9f4af9e81d258a58274320b6f ]
2 issues have been reported on the Dell Inspiron 7352:
1. Sometimes the tablet-mode-switch stops reporting tablet-mode change events.
Add a "VBDL" call to notify_handler() to work around this.
2. Sometimes the tablet-mode is incorrect after suspend/resume
Add a detect_tablet_mode() to resume() to fix this.
--- drivers/platform/x86/intel/vbtn.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/platform/x86/intel/vbtn.c +15 -4
@@ -73,10 +73,10 @@ struct intel_vbtn_priv {bool wakeup_mode; }; -static void detect_tablet_mode (struct platform_device *device) +static void detect_tablet_mode (struct device *dev) { -struct intel_vbtn_priv *priv =dev_get_drvdata (&device->dev); -acpi_handle handle =ACPI_HANDLE (&device->dev); +struct intel_vbtn_priv *priv =dev_get_drvdata (dev); +acpi_handle handle =ACPI_HANDLE (dev);unsigned long long vgbs;acpi_status status;int m;
@@ -89,6 +89,8 @@ static void detect_tablet_mode(struct platform_device *device)input_report_switch (priv->switches_dev,SW_TABLET_MODE , m); m = (vgbs &VGBS_DOCK_MODE_FLAG ) ?1 :0 ;input_report_switch (priv->switches_dev,SW_DOCK , m); + +input_sync (priv->switches_dev); }/*
@@ -134,7 +136,7 @@ static int intel_vbtn_input_setup(struct platform_device *device) priv->switches_dev->id.bustype =BUS_HOST ;if (priv->has_switches) { -detect_tablet_mode (device); +detect_tablet_mode (&device->dev); ret =input_register_device (priv->switches_dev);if (ret)
@@ -198,6 +200,9 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) autorelease = val && (!ke_rel || ke_rel->type ==KE_IGNORE );sparse_keymap_report_event (input_dev, event, val, autorelease); + +/* Some devices need this to report further events */ +acpi_evaluate_object (handle,"VBDL" ,NULL ,NULL ); }/*
@@ -358,7 +363,13 @@ static void intel_vbtn_pm_complete(struct device *dev)static int intel_vbtn_pm_resume (struct device *dev) { +struct intel_vbtn_priv *priv =dev_get_drvdata (dev); +intel_vbtn_pm_complete (dev); + +if (priv->has_switches) +detect_tablet_mode (dev); +return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 49/100 jbd2: fix soft lockup in journal_finish_inode_data_buffers()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ye Bin <[email protected]>
[ Upstream commit 6c02757c936063f0631b4e43fe156f8c8f1f351f ]
There's issue when do io test:
WARN: soft lockup - CPU#45 stuck for 11s! [jbd2/dm-2-8:4170]
CPU: 45 PID: 4170 Comm: jbd2/dm-2-8 Kdump: loaded Tainted: G OE Call trace: dump_backtrace+0x0/0x1a0 show_stack+0x24/0x30 dump_stack+0xb0/0x100 watchdog_timer_fn+0x254/0x3f8 __hrtimer_run_queues+0x11c/0x380 hrtimer_interrupt+0xfc/0x2f8 arch_timer_handler_phys+0x38/0x58 handle_percpu_devid_irq+0x90/0x248 generic_handle_irq+0x3c/0x58 __handle_domain_irq+0x68/0xc0 gic_handle_irq+0x90/0x320 el1_irq+0xcc/0x180 queued_spin_lock_slowpath+0x1d8/0x320 jbd2_journal_commit_transaction+0x10f4/0x1c78 [jbd2] kjournald2+0xec/0x2f0 [jbd2] kthread+0x134/0x138 ret_from_fork+0x10/0x18
Analyzed informations from vmcore as follows:
(1) There are about 5k+ jbd2_inode in 'commit_transaction->t_inode_list';
(2) Now is processing the 855th jbd2_inode;
(3) JBD2 task has TIF_NEED_RESCHED flag;
(4) There's no pags in address_space around the 855th jbd2_inode;
(5) There are some process is doing drop caches;
(6) Mounted with 'nodioread_nolock' option;
(7) 128 CPUs;
According to informations from vmcore we know 'journal->j_list_lock' spin lock competition is fierce. So journal_finish_inode_data_buffers() maybe process slowly. Theoretically, there is scheduling point in the filemap_fdatawait_range_keep_errors(). However, if inode's address_space has no pages which taged with PAGECACHE_TAG_WRITEBACK, will not call cond_resched(). So may lead to soft lockup. journal_finish_inode_data_buffers
filemap_fdatawait_range_keep_errors
__filemap_fdatawait_range
while (index <= end)
nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, PAGECACHE_TAG_WRITEBACK);
if (!nr_pages)
break; --> If 'nr_pages' is equal zero will break, then will not call cond_resched()
for (i = 0; i < nr_pages; i++)
wait_on_page_writeback(page);
cond_resched();To solve above issue, add scheduling point in the journal_finish_inode_data_buffers();
--- fs/jbd2/commit.c | 1 + 1 file changed, 1 insertion(+)
fs/jbd2/commit.c +1 -0
@@ -300,6 +300,7 @@ static int journal_finish_inode_data_buffers(journal_t *journal,if (!ret) ret = err; } +cond_resched ();spin_lock (&journal->j_list_lock); jinode->i_flags &= ~JI_COMMIT_RUNNING ;smp_mb ();
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 50/100 tracing: Have large events show up as [LINE TOO BIG] instead of nothing
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt (Google) <[email protected]>
[ Upstream commit b55b0a0d7c4aa2dac3579aa7e6802d1f57445096 ]
If a large event was added to the ring buffer that is larger than what the trace_seq can handle, it just drops the output:
~# cat /sys/kernel/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 2/2 #P:8
#
# _-----=> irqs-off/BH-disabled
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / _-=> migrate-disable
# |||| / delay
# TASK-PID CPU# ||||| TIMESTAMP FUNCTION
# | | | ||||| | |
<...>-859 [001] ..... 141.118951: tracing_mark_write <...>-859 [001] ..... 141.148201: tracing_mark_write: 78901234Instead, catch this case and add some context:
~# cat /sys/kernel/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 2/2 #P:8
#
# _-----=> irqs-off/BH-disabled
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / _-=> migrate-disable
# |||| / delay
# TASK-PID CPU# ||||| TIMESTAMP FUNCTION
# | | | ||||| | |
<...>-852 [001] ..... 121.550551: tracing_mark_write[LINE TOO BIG]
<...>-852 [001] ..... 121.550581: tracing_mark_write: 78901234This now emulates the same output as trace_pipe.
--- kernel/trace/trace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/trace/trace.c +5 -1
@@ -4679,7 +4679,11 @@ static int s_show(struct seq_file *m, void *v) iter->leftover = ret; }else { -print_trace_line (iter); + ret =print_trace_line (iter); +if (ret ==TRACE_TYPE_PARTIAL_LINE ) { + iter->seq.full =0 ; +trace_seq_puts (&iter->seq,"[LINE TOO BIG]\n" ); + } ret =trace_print_seq (m, &iter->seq);/* * If we overflow the seq_file buffer, then it will
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 51/100 tracing: Add size check when printing trace_marker output
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt (Google) <[email protected]>
[ Upstream commit 60be76eeabb3d83858cc6577fc65c7d0f36ffd42 ]
If for some reason the trace_marker write does not have a nul byte for the string, it will overflow the print:
trace_seq_printf(s, ": %s", field->buf);
The field->buf could be missing the nul byte. To prevent overflow, add the max size that the buf can be by using the event size and the field location.
int max = iter->ent_size - offsetof(struct print_entry, buf); trace_seq_printf(s, ": %*.s", max, field->buf);
--- kernel/trace/trace_output.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/trace/trace_output.c +4 -2
@@ -1445,11 +1445,12 @@ static enum print_line_t trace_print_print(struct trace_iterator *iter, {struct print_entry *field;struct trace_seq *s = &iter->seq; +int max = iter->ent_size - offsetof(struct print_entry , buf);trace_assign_type (field, iter->ent);seq_print_ip_sym (s, field->ip, flags); -trace_seq_printf (s,": %s" , field->buf); +trace_seq_printf (s,": %.*s" , max, field->buf);return trace_handle_return (s); }
@@ -1458,10 +1459,11 @@ static enum print_line_t trace_print_raw(struct trace_iterator *iter, int flags, struct trace_event *event) {struct print_entry *field; +int max = iter->ent_size - offsetof(struct print_entry , buf);trace_assign_type (field, iter->ent); -trace_seq_printf (&iter->seq,"# %lx %s" , field->ip, field->buf); +trace_seq_printf (&iter->seq,"# %lx %.*s" , field->ip, max, field->buf);return trace_handle_return (&iter->seq); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 52/100 stmmac: dwmac-loongson: drop useless check for compatible fallback
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 31fea092c6f9f8fb2c40a08137907f5fbeae55dd ]
Device binds to proper PCI ID (LOONGSON, 0x7a03), already listed in DTS, so checking for some other compatible does not make sense. It cannot be bound to unsupported platform.
Drop useless, incorrect (space in between) and undocumented compatible.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +0 -5
@@ -59,11 +59,6 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_idreturn -ENODEV ; } -if (!of_device_is_compatible (np,"loongson, pci-gmac" )) { -pr_info ("dwmac_loongson_pci: Incompatible OF node\n" ); -return -ENODEV ; - } - plat =devm_kzalloc (&pdev->dev,sizeof (*plat),GFP_KERNEL );if (!plat)return -ENOMEM ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 53/100 MIPS: dts: loongson: drop incorrect dwmac fallback compatible
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 4907a3f54b12b8209864572a312cf967befcae80 ]
Device binds to proper PCI ID (LOONGSON, 0x7a03), already listed in DTS, so checking for some other compatible does not make sense. It cannot be bound to unsupported platform.
Drop useless, incorrect (space in between) and undocumented compatible.
--- arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi | 3 +-- arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi +1 -2
@@ -123,8 +123,7 @@ gmac@3,0 { compatible = "pci0014,7a03.0", "pci0014,7a03", "pciclass0c0320", - "pciclass0c03", - "loongson, pci-gmac"; + "pciclass0c03"; reg = <0x1800 0x0 0x0 0x0 0x0>; interrupts = <12 IRQ_TYPE_LEVEL_LOW>,
arch/mips/boot/dts/loongson/ls7a-pch.dtsi +1 -2
@@ -186,8 +186,7 @@ gmac@3,0 { compatible = "pci0014,7a03.0", "pci0014,7a03", "pciclass020000", - "pciclass0200", - "loongson, pci-gmac"; + "pciclass0200"; reg = <0x1800 0x0 0x0 0x0 0x0>; interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 54/100 tracing: Fix uaf issue when open the hist or hist_debug file
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit 1cc111b9cddc71ce161cd388f11f0e9048edffdb ]
KASAN report following issue. The root cause is when opening 'hist' file of an instance and accessing 'trace_event_file' in hist_show(), but 'trace_event_file' has been freed due to the instance being removed. 'hist_debug' file has the same problem. To fix it, call tracing_{open,release}_file_tr() in file_operations callback to have the ref count and avoid 'trace_event_file' being freed.
BUG: KASAN: slab-use-after-free in hist_show+0x11e0/0x1278 Read of size 8 at addr ffff242541e336b8 by task head/190 CPU: 4 PID: 190 Comm: head Not tainted 6.7.0-rc5-g26aff849438c #133 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x98/0xf8 show_stack+0x1c/0x30 dump_stack_lvl+0x44/0x58 print_report+0xf0/0x5a0 kasan_report+0x80/0xc0 __asan_report_load8_noabort+0x1c/0x28 hist_show+0x11e0/0x1278 seq_read_iter+0x344/0xd78 seq_read+0x128/0x1c0 vfs_read+0x198/0x6c8 ksys_read+0xf4/0x1e0 __arm64_sys_read+0x70/0xa8 invoke_syscall+0x70/0x260 el0_svc_common.constprop.0+0xb0/0x280 do_el0_svc+0x44/0x60 el0_svc+0x34/0x68 el0t_64_sync_handler+0xb8/0xc0 el0t_64_sync+0x168/0x170 Allocated by task 188: kasan_save_stack+0x28/0x50 kasan_set_track+0x28/0x38 kasan_save_alloc_info+0x20/0x30 __kasan_slab_alloc+0x6c/0x80 kmem_cache_alloc+0x15c/0x4a8 trace_create_new_event+0x84/0x348 __trace_add_new_event+0x18/0x88 event_trace_add_tracer+0xc4/0x1a0 trace_array_create_dir+0x6c/0x100 trace_array_create+0x2e8/0x568 instance_mkdir+0x48/0x80 tracefs_syscall_mkdir+0x90/0xe8 vfs_mkdir+0x3c4/0x610 do_mkdirat+0x144/0x200 __arm64_sys_mkdirat+0x8c/0xc0 invoke_syscall+0x70/0x260 el0_svc_common.constprop.0+0xb0/0x280 do_el0_svc+0x44/0x60 el0_svc+0x34/0x68 el0t_64_sync_handler+0xb8/0xc0 el0t_64_sync+0x168/0x170 Freed by task 191: kasan_save_stack+0x28/0x50 kasan_set_track+0x28/0x38 kasan_save_free_info+0x34/0x58 __kasan_slab_free+0xe4/0x158 kmem_cache_free+0x19c/0x508 event_file_put+0xa0/0x120 remove_event_file_dir+0x180/0x320 event_trace_del_tracer+0xb0/0x180 __remove_instance+0x224/0x508 instance_rmdir+0x44/0x78 tracefs_syscall_rmdir+0xbc/0x140 vfs_rmdir+0x1cc/0x4c8 do_rmdir+0x220/0x2b8 __arm64_sys_unlinkat+0xc0/0x100 invoke_syscall+0x70/0x260 el0_svc_common.constprop.0+0xb0/0x280 do_el0_svc+0x44/0x60 el0_svc+0x34/0x68 el0t_64_sync_handler+0xb8/0xc0 el0t_64_sync+0x168/0x170
--- kernel/trace/trace.c | 6 ++++++ kernel/trace/trace.h | 1 + kernel/trace/trace_events_hist.c | 12 ++++++++---- 3 files changed, 15 insertions(+), 4 deletions(-)
kernel/trace/trace.c +6 -0
@@ -4916,6 +4916,12 @@ int tracing_release_file_tr(struct inode *inode, struct file *filp)return 0 ; } +int tracing_single_release_file_tr (struct inode *inode,struct file *filp) +{ +tracing_release_file_tr (inode, filp); +return single_release (inode, filp); +} +static int tracing_mark_open (struct inode *inode,struct file *filp) {stream_open (inode, filp);
kernel/trace/trace.h +1 -0
@@ -592,6 +592,7 @@ int tracing_open_generic(struct inode *inode, struct file *filp);int tracing_open_generic_tr (struct inode *inode,struct file *filp);int tracing_open_file_tr (struct inode *inode,struct file *filp);int tracing_release_file_tr (struct inode *inode,struct file *filp); +int tracing_single_release_file_tr (struct inode *inode,struct file *filp);bool tracing_is_disabled (void );bool tracer_tracing_is_on (struct trace_array *tr);void tracer_tracing_on (struct trace_array *tr);
kernel/trace/trace_events_hist.c +8 -4
@@ -5532,10 +5532,12 @@ static int event_hist_open(struct inode *inode, struct file *file) {int ret; - ret =security_locked_down (LOCKDOWN_TRACEFS ); + ret =tracing_open_file_tr (inode, file);if (ret)return ret; +/* Clear private_data to avoid warning in single_open() */ + file->private_data =NULL ;return single_open (file, hist_show, file); }
@@ -5543,7 +5545,7 @@ const struct file_operations event_hist_fops = { .open = event_hist_open, .read = seq_read, .llseek = seq_lseek, - .release = single_release, + .release = tracing_single_release_file_tr, };#ifdef CONFIG_HIST_TRIGGERS_DEBUG
@@ -5809,10 +5811,12 @@ static int event_hist_debug_open(struct inode *inode, struct file *file) {int ret; - ret =security_locked_down (LOCKDOWN_TRACEFS ); + ret =tracing_open_file_tr (inode, file);if (ret)return ret; +/* Clear private_data to avoid warning in single_open() */ + file->private_data =NULL ;return single_open (file, hist_debug_show, file); }
@@ -5820,7 +5824,7 @@ const struct file_operations event_hist_debug_fops = { .open = event_hist_debug_open, .read = seq_read, .llseek = seq_lseek, - .release = single_release, + .release = tracing_single_release_file_tr, };#endif
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 55/100 ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt (Google) <[email protected]>
[ Upstream commit 712292308af2265cd9b126aedfa987f10f452a33 ]
As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI.
--- kernel/trace/ring_buffer.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/trace/ring_buffer.c +6 -0
@@ -3644,6 +3644,12 @@ rb_reserve_next_event(struct trace_buffer *buffer,int nr_loops =0 ;int add_ts_default; +/* ring buffer does cmpxchg, make sure it is safe in NMI context */ +if (!IS_ENABLED (CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG ) && + (unlikely (in_nmi ()))) { +return NULL ; + } +rb_start_commit (cpu_buffer);/* The commit page can not change after this */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 56/100 Input: psmouse - enable Synaptics InterTouch for ThinkPad L14 G1
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: José Pekkarinen <[email protected]>
[ Upstream commit c1f342f35f820b33390571293498c3e2e9bc77ec ]
Observed on dmesg of my laptop I see the following output:
[ 19.898700] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694] [ 19.936057] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..] [ 19.936076] psmouse serio1: synaptics: Your touchpad (PNP: LEN0411 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to [email protected]. [ 20.008901] psmouse serio1: synaptics: Touchpad model: 1, fw: 10.32, id: 0x1e2a1, caps: 0xf014a3/0x940300/0x12e800/0x500000, board id: 3471, fw id: 2909640 [ 20.008925] psmouse serio1: synaptics: serio: Synaptics pass-through port at isa0060/serio1/input0 [ 20.053344] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input7 [ 20.397608] mousedev: PS/2 mouse device common for all mice
This patch will add its pnp id to the smbus list to produce the setup of intertouch for the device.
--- drivers/input/mouse/synaptics.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/synaptics.c +1 -0
@@ -183,6 +183,7 @@ static const char * const smbus_pnp_ids[] = {"LEN009b" ,/* T580 */ "LEN0402" ,/* X1 Extreme Gen 2 / P1 Gen 2 */ "LEN040f" ,/* P1 Gen 3 */ +"LEN0411" ,/* L14 Gen 1 */ "LEN200f" ,/* T450s */ "LEN2044" ,/* L470 */ "LEN2054", /* E480 */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 57/100 reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit b5ec294472794ed9ecba0cb4b8208372842e7e0d ]
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes:
hi6220_reset.c:166:9: error: cast to smaller integer type 'enum hi6220_reset_ctrl_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
--- drivers/reset/hisilicon/hi6220_reset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/reset/hisilicon/hi6220_reset.c +1 -1
@@ -164,7 +164,7 @@ static int hi6220_reset_probe(struct platform_device *pdev)if (!data)return -ENOMEM ; - type = (enum hi6220_reset_ctrl_type )of_device_get_match_data (dev); + type = (uintptr_t )of_device_get_match_data (dev); regmap =syscon_node_to_regmap (np);if (IS_ERR (regmap)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 58/100 Input: atkbd - skip ATKBD_CMD_GETID in translated mode
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 936e4d49ecbc8c404790504386e1422b599dec39 ]
There have been multiple reports of keyboard issues on recent laptop models which can be worked around by setting i8042.dumbkbd, with the downside being this breaks the capslock LED.
It seems that these issues are caused by recent laptops getting confused by ATKBD_CMD_GETID. Rather then adding and endless growing list of quirks for this, just skip ATKBD_CMD_GETID alltogether on laptops in translated mode.
The main goal of sending ATKBD_CMD_GETID is to skip binding to ps/2 mice/touchpads and those are never used in translated mode.
Examples of laptop models which benefit from skipping ATKBD_CMD_GETID:
* "HP Laptop 15s-fq2xxx", "HP laptop 15s-fq4xxx" and "HP Laptop 15-dy2xxx" models the kbd stops working for the first 2 - 5 minutes after boot (waiting for EC watchdog reset?)
* On "HP Spectre x360 13-aw2xxx" atkbd fails to probe the keyboard
* At least 9 different Lenovo models have issues with ATKBD_CMD_GETID, see:
https://github.com/yescallop/atkbd-nogetid
This has been tested on:
1. A MSI B550M PRO-VDH WIFI desktop, where the i8042 controller is not in translated mode when no keyboard is plugged in and with a ps/2 kbd a "AT Translated Set 2 keyboard" /dev/input/event# node shows up
2. A Lenovo ThinkPad X1 Yoga gen 8 (always has a translated set 2 keyboard)
--- drivers/input/keyboard/atkbd.c | 46 +++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-)
drivers/input/keyboard/atkbd.c +42 -4
@@ -746,6 +746,44 @@ static void atkbd_deactivate(struct atkbd *atkbd) ps2dev->serio->phys); } +#ifdef CONFIG_X86 +static bool atkbd_is_portable_device (void ) +{ +static const char *const chassis_types[] = { +"8" ,/* Portable */ +"9" ,/* Laptop */ +"10" ,/* Notebook */ +"14" ,/* Sub-Notebook */ +"31" ,/* Convertible */ +"32" ,/* Detachable */ + }; +int i; + +for (i =0 ; i <ARRAY_SIZE (chassis_types); i++) +if (dmi_match (DMI_CHASSIS_TYPE , chassis_types[i])) +return true; + +return false; +} + +/* +* On many modern laptops ATKBD_CMD_GETID may cause problems, on these laptops +* the controller is always in translated mode. In this mode mice/touchpads will +* not work. So in this case simply assume a keyboard is connected to avoid +* confusing some laptop keyboards. +* +* Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using a fake id is +* ok in translated mode, only atkbd_select_set() checks atkbd->id and in +* translated mode that is a no-op. +*/ +static bool atkbd_skip_getid (struct atkbd *atkbd) +{ +return atkbd->translated &&atkbd_is_portable_device (); +} +#else +static inline bool atkbd_skip_getid (struct atkbd *atkbd) {return false; } +#endif +/* * atkbd_probe() probes for an AT keyboard on a serio port. */
@@ -775,12 +813,12 @@ static int atkbd_probe(struct atkbd *atkbd)*/ param[0 ] = param[1 ] =0xa5 ;/* initialize with invalid values */ -if (ps2_command (ps2dev, param,ATKBD_CMD_GETID )) { +if (atkbd_skip_getid (atkbd) ||ps2_command (ps2dev, param,ATKBD_CMD_GETID )) {/* -* If the get ID command failed, we check if we can at least set the LEDs on -* the keyboard. This should work on every keyboard out there. It also turns -* the LEDs off, which we want anyway. +* If the get ID command was skipped or failed, we check if we can at least set +* the LEDs on the keyboard. This should work on every keyboard out there. +* It also turns the LEDs off, which we want anyway. */ param[0 ] =0 ;if (ps2_command (ps2dev, param,ATKBD_CMD_SETLEDS ))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 59/100 Input: i8042 - add nomux quirk for Acer P459-G2-M
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Esther Shimanovich <[email protected]>
[ Upstream commit 335fe00319e030d481a54d5e0e68d50c5e672c0e ]
After the laptop lid is opened, and the device resumes from S3 deep sleep, if the user presses a keyboard key while the screen is still black, the mouse and keyboard become unusable.
Enabling this quirk prevents this behavior from occurring.
--- drivers/input/serio/i8042-acpipnpio.h | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/input/serio/i8042-acpipnpio.h +8 -0
@@ -360,6 +360,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { }, .driver_data = (void *)(SERIO_QUIRK_DRITEK) }, + { +/* Acer TravelMate P459-G2-M */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate P459-G2-M"), + }, + .driver_data = (void *)(SERIO_QUIRK_NOMUX ) + }, {/* Amoi M636/A737 */ .matches = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 60/100 s390/scm: fix virtual vs physical address confusion
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vineeth Vijayan <[email protected]>
[ Upstream commit b1a6a1a77f0666a5a6dc0893ab6ec8fcae46f24c ]
Fix virtual vs physical address confusion (which currently are the same).
--- drivers/s390/block/scm_blk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/s390/block/scm_blk.c +4 -3
@@ -17,6 +17,7 @@#include <linux/blk-mq.h> #include <linux/slab.h> #include <linux/list.h> +#include <linux/io.h> #include <asm/eadm.h> #include "scm_blk.h"
@@ -130,7 +131,7 @@ static void scm_request_done(struct scm_request *scmrq)for (i =0 ; i < nr_requests_per_io && scmrq->request[i]; i++) { msb = &scmrq->aob->msb[i]; - aidaw = msb->data_addr; + aidaw = (u64 )phys_to_virt (msb->data_addr);if ((msb->flags &MSB_FLAG_IDA ) && aidaw &&IS_ALIGNED (aidaw,PAGE_SIZE ))
@@ -195,12 +196,12 @@ static int scm_request_prepare(struct scm_request *scmrq) msb->scm_addr = scmdev->address + ((u64 )blk_rq_pos (req) <<9 ); msb->oc = (rq_data_dir (req) ==READ ) ?MSB_OC_READ :MSB_OC_WRITE ; msb->flags |=MSB_FLAG_IDA ; - msb->data_addr = (u64 ) aidaw; + msb->data_addr = (u64 )virt_to_phys (aidaw);rq_for_each_segment (bv, req, iter) {WARN_ON (bv.bv_offset); msb->blk_count += bv.bv_len >>12 ; - aidaw->data_addr = (u64 )page_address (bv.bv_page); + aidaw->data_addr =virt_to_phys (page_address (bv.bv_page)); aidaw++; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 61/100 ARC: fix spare error
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vineet Gupta <[email protected]>
[ Upstream commit aca02d933f63ba8bc84258bf35f9ffaf6b664336 ]
--- arch/arc/kernel/signal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arc/kernel/signal.c +3 -3
@@ -61,7 +61,7 @@ struct rt_sigframe {unsigned int sigret_magic; }; -static int save_arcv2_regs (struct sigcontext *mctx,struct pt_regs *regs) +static int save_arcv2_regs (struct sigcontext __user *mctx,struct pt_regs *regs) {int err =0 ;#ifndef CONFIG_ISA_ARCOMPACT
@@ -74,12 +74,12 @@ static int save_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)#else v2abi.r58 = v2abi.r59 =0 ;#endif - err =__copy_to_user (&mctx->v2abi, &v2abi,sizeof (v2abi)); + err =__copy_to_user (&mctx->v2abi, (void const *)&v2abi,sizeof (v2abi));#endif return err; } -static int restore_arcv2_regs (struct sigcontext *mctx,struct pt_regs *regs) +static int restore_arcv2_regs (struct sigcontext __user *mctx,struct pt_regs *regs) {int err =0 ;#ifndef CONFIG_ISA_ARCOMPACT
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 62/100 wifi: iwlwifi: pcie: avoid a NULL pointer dereference
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avraham Stern <[email protected]>
[ Upstream commit ce038edfce43fb345f8dfdca0f7b17f535896701 ]
It possible that while the rx rb is being handled, the transport has been stopped and re-started. In this case the tx queue pointer is not yet initialized, which will lead to a NULL pointer dereference. Fix it.
--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +1 -1
@@ -1381,7 +1381,7 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans,* if it is true then one of the handlers took the page. */ -if (reclaim) { +if (reclaim && txq) {u16 sequence =le16_to_cpu (pkt->hdr.sequence);int index =SEQ_TO_INDEX (sequence);int cmd_index =iwl_txq_get_cmd_index (txq, index);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 63/100 Input: xpad - add Razer Wolverine V2 support
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Weiss <[email protected]>
[ Upstream commit c3d1610345b79cbe29ef6ca04a4780eff0d360c7 ]
Add the VID and PID of Razer Wolverine V2 to xpad_device.
--- drivers/input/joystick/xpad.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/joystick/xpad.c +1 -0
@@ -286,6 +286,7 @@ static const struct xpad_device { { 0x146b, 0x0604, "Bigben Interactive DAIJA Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, { 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, { 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE }, + { 0x1532, 0x0a29, "Razer Wolverine V2", 0, XTYPE_XBOXONE }, { 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 }, { 0x15e4, 0x3f0a, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 }, { 0x15e4, 0x3f10, "Batarang Xbox 360 controller", 0, XTYPE_XBOX360 },
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 64/100 kselftest: alsa: fixed a print formatting warning
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ghanshyam Agrawal <[email protected]>
[ Upstream commit 13d605e32e4cfdedcecdf3d98d21710ffe887708 ]
A statement used %d print formatter where %s should have been used. The same has been fixed in this commit.
--- tools/testing/selftests/alsa/mixer-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/alsa/mixer-test.c +1 -1
@@ -177,7 +177,7 @@ static void find_controls(void) err =snd_ctl_elem_info (card_data->handle, ctl_data->info);if (err <0 ) { -ksft_print_msg ("%s getting info for %d\n" , +ksft_print_msg ("%s getting info for %s\n" ,snd_strerror (err), ctl_data->name); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 65/100 HID: nintendo: fix initializer element is not constant error
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan McClelland <[email protected]>
[ Upstream commit 0b7dd38c1c520b650a889a81919838671b689eb9 ]
With gcc-7 builds, an error happens with the controller button values being defined as const. Change to a define.
--- drivers/hid/hid-nintendo.c | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-)
drivers/hid/hid-nintendo.c +22 -22
@@ -325,28 +325,28 @@ struct joycon_imu_cal {* All the controller's button values are stored in a u32. * They can be accessed with bitwise ANDs. */ -static const u32 JC_BTN_Y =BIT (0 ); -static const u32 JC_BTN_X =BIT (1 ); -static const u32 JC_BTN_B =BIT (2 ); -static const u32 JC_BTN_A =BIT (3 ); -static const u32 JC_BTN_SR_R =BIT (4 ); -static const u32 JC_BTN_SL_R =BIT (5 ); -static const u32 JC_BTN_R =BIT (6 ); -static const u32 JC_BTN_ZR =BIT (7 ); -static const u32 JC_BTN_MINUS =BIT (8 ); -static const u32 JC_BTN_PLUS =BIT (9 ); -static const u32 JC_BTN_RSTICK =BIT (10 ); -static const u32 JC_BTN_LSTICK =BIT (11 ); -static const u32 JC_BTN_HOME =BIT (12 ); -static const u32 JC_BTN_CAP =BIT (13 );/* capture button */ -static const u32 JC_BTN_DOWN =BIT (16 ); -static const u32 JC_BTN_UP =BIT (17 ); -static const u32 JC_BTN_RIGHT =BIT (18 ); -static const u32 JC_BTN_LEFT =BIT (19 ); -static const u32 JC_BTN_SR_L =BIT (20 ); -static const u32 JC_BTN_SL_L =BIT (21 ); -static const u32 JC_BTN_L =BIT (22 ); -static const u32 JC_BTN_ZL =BIT (23 ); +#define JC_BTN_Y BIT(0) +#define JC_BTN_X BIT(1) +#define JC_BTN_B BIT(2) +#define JC_BTN_A BIT(3) +#define JC_BTN_SR_R BIT(4) +#define JC_BTN_SL_R BIT(5) +#define JC_BTN_R BIT(6) +#define JC_BTN_ZR BIT(7) +#define JC_BTN_MINUS BIT(8) +#define JC_BTN_PLUS BIT(9) +#define JC_BTN_RSTICK BIT(10) +#define JC_BTN_LSTICK BIT(11) +#define JC_BTN_HOME BIT(12) +#define JC_BTN_CAP BIT(13)/* capture button */ +#define JC_BTN_DOWN BIT(16) +#define JC_BTN_UP BIT(17) +#define JC_BTN_RIGHT BIT(18) +#define JC_BTN_LEFT BIT(19) +#define JC_BTN_SR_L BIT(20) +#define JC_BTN_SL_L BIT(21) +#define JC_BTN_L BIT(22) +#define JC_BTN_ZL BIT(23)enum joycon_msg_type {JOYCON_MSG_TYPE_NONE ,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 66/100 platform/x86: thinkpad_acpi: fix for incorrect fan reporting on some ThinkPad systems
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishnu Sankar <[email protected]>
[ Upstream commit 66e92e23a72761f5b53f970aeb1badc5fd92fc74 ]
Some ThinkPad systems ECFW use non-standard addresses for fan control and reporting. This patch adds support for such ECFW so that it can report the correct fan values.
Tested on Thinkpads L13 Yoga Gen 2 and X13 Yoga Gen 2.
--- drivers/platform/x86/thinkpad_acpi.c | 98 ++++++++++++++++++++++++---- 1 file changed, 85 insertions(+), 13 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +85 -13
@@ -8149,8 +8149,19 @@ static struct ibm_struct volume_driver_data = {* TPACPI_FAN_WR_TPEC is also available and should be used to * command the fan. The X31/X40/X41 seems to have 8 fan levels, * but the ACPI tables just mention level 7. +* +* TPACPI_FAN_RD_TPEC_NS: +* This mode is used for a few ThinkPads (L13 Yoga Gen2, X13 Yoga Gen2 etc.) +* that are using non-standard EC locations for reporting fan speeds. +* Currently these platforms only provide fan rpm reporting. +* */ +#define FAN_RPM_CAL_CONST 491520/* FAN RPM calculation offset for some non-standard ECFW */ + +#define FAN_NS_CTRL_STATUS BIT(2)/* Bit which determines control is enabled or not */ +#define FAN_NS_CTRL BIT(4)/* Bit which determines control is by host or EC */ +enum {/* Fan control constants */ fan_status_offset =0x2f ,/* EC register 0x2f */ fan_rpm_offset =0x84 ,/* EC register 0x84: LSB, 0x85 MSB (RPM)
@@ -8158,6 +8169,11 @@ enum { /* Fan control constants */ fan_select_offset =0x31 ,/* EC register 0x31 (Firmware 7M) bit 0 selects which fan is active */ + fan_status_offset_ns =0x93 ,/* Special status/control offset for non-standard EC Fan1 */ + fan2_status_offset_ns =0x96 ,/* Special status/control offset for non-standard EC Fan2 */ + fan_rpm_status_ns =0x95 ,/* Special offset for Fan1 RPM status for non-standard EC */ + fan2_rpm_status_ns =0x98 ,/* Special offset for Fan2 RPM status for non-standard EC */ +TP_EC_FAN_FULLSPEED =0x40 ,/* EC fan mode: full speed */ TP_EC_FAN_AUTO = 0x80, /* EC fan mode: auto fan control */
@@ -8168,6 +8184,7 @@ enum fan_status_access_mode {TPACPI_FAN_NONE =0 ,/* No fan status or control */ TPACPI_FAN_RD_ACPI_GFAN ,/* Use ACPI GFAN */ TPACPI_FAN_RD_TPEC ,/* Use ACPI EC regs 0x2f, 0x84-0x85 */ + TPACPI_FAN_RD_TPEC_NS, /* Use non-standard ACPI EC regs (eg: L13 Yoga gen2 etc.) */ }; enum fan_control_access_mode {
@@ -8195,6 +8212,8 @@ static u8 fan_control_desired_level;static u8 fan_control_resume_level;static int fan_watchdog_maxinterval; +static bool fan_with_ns_addr; +static struct mutex fan_mutex;static void fan_watchdog_fire (struct work_struct *ignored);
@@ -8325,6 +8344,15 @@ static int fan_get_status(u8 *status) }break ; +case TPACPI_FAN_RD_TPEC_NS : +/* Default mode is AUTO which means controlled by EC */ +if (!acpi_ec_read (fan_status_offset_ns, &s)) +return -EIO ; + +if (status) + *status = s; + +break ;default :return -ENXIO ;
@@ -8341,7 +8369,8 @@ static int fan_get_status_safe(u8 *status)if (mutex_lock_killable (&fan_mutex))return -ERESTARTSYS ; rc =fan_get_status (&s); -if (!rc) +/* NS EC doesn't have register with level settings */ +if (!rc && !fan_with_ns_addr)fan_update_desired_level (s);mutex_unlock (&fan_mutex);
@@ -8368,7 +8397,13 @@ static int fan_get_speed(unsigned int *speed)if (likely (speed)) *speed = (hi <<8 ) | lo; +break ; +case TPACPI_FAN_RD_TPEC_NS : +if (!acpi_ec_read (fan_rpm_status_ns, &lo)) +return -EIO ; +if (speed) + *speed = lo ?FAN_RPM_CAL_CONST / lo :0 ;break ;default :
@@ -8380,7 +8415,7 @@ static int fan_get_speed(unsigned int *speed)static int fan2_get_speed (unsigned int *speed) { -u8 hi, lo; +u8 hi, lo, status;bool rc;switch (fan_status_access_mode) {
@@ -8396,7 +8431,21 @@ static int fan2_get_speed(unsigned int *speed)if (likely (speed)) *speed = (hi <<8 ) | lo; +break ; +case TPACPI_FAN_RD_TPEC_NS : + rc = !acpi_ec_read (fan2_status_offset_ns, &status); +if (rc) +return -EIO ; +if (!(status &FAN_NS_CTRL_STATUS )) { +pr_info ("secondary fan control not supported\n" ); +return -EIO ; + } + rc = !acpi_ec_read (fan2_rpm_status_ns, &lo); +if (rc) +return -EIO ; +if (speed) + *speed = lo ?FAN_RPM_CAL_CONST / lo :0 ;break ;default :
@@ -8899,6 +8948,7 @@ static const struct attribute_group fan_driver_attr_group = {#define TPACPI_FAN_2FAN 0x0002/* EC 0x31 bit 0 selects fan2 */ #define TPACPI_FAN_2CTL 0x0004/* selects fan2 control */ #define TPACPI_FAN_NOFAN 0x0008/* no fan available */ +#define TPACPI_FAN_NS 0x0010/* For EC with non-Standard register addresses */ static const struct tpacpi_quirk fan_quirk_table[]__initconst = {TPACPI_QEC_IBM ('1' ,'Y' ,TPACPI_FAN_Q1 ),
@@ -8917,6 +8967,8 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {TPACPI_Q_LNV3 ('N' ,'2' ,'O' ,TPACPI_FAN_2CTL ),/* P1 / X1 Extreme (2nd gen) */ TPACPI_Q_LNV3 ('N' ,'3' ,'0' ,TPACPI_FAN_2CTL ),/* P15 (1st gen) / P15v (1st gen) */ TPACPI_Q_LNV3 ('N' ,'3' ,'7' ,TPACPI_FAN_2CTL ),/* T15g (2nd gen) */ +TPACPI_Q_LNV3 ('R' ,'1' ,'F' ,TPACPI_FAN_NS ),/* L13 Yoga Gen 2 */ +TPACPI_Q_LNV3 ('N' ,'2' ,'U' ,TPACPI_FAN_NS ),/* X13 Yoga Gen 2*/ TPACPI_Q_LNV3('N', '1', 'O', TPACPI_FAN_NOFAN), /* X1 Tablet (2nd gen) */ };
@@ -8951,18 +9003,27 @@ static int __init fan_init(struct ibm_init_struct *iibm)return -ENODEV ; } +if (quirks &TPACPI_FAN_NS ) { +pr_info ("ECFW with non-standard fan reg control found\n" ); + fan_with_ns_addr =1 ; +/* Fan ctrl support from host is undefined for now */ + tp_features.fan_ctrl_status_undef =1 ; + } +if (gfan_handle) {/* 570, 600e/x, 770e, 770x */ fan_status_access_mode =TPACPI_FAN_RD_ACPI_GFAN ; }else {/* all other ThinkPads: note that even old-style * ThinkPad ECs supports the fan control register */ -if (likely (acpi_ec_read (fan_status_offset, - &fan_control_initial_status))) { +if (fan_with_ns_addr || +likely (acpi_ec_read (fan_status_offset, &fan_control_initial_status))) {int res;unsigned int speed; - fan_status_access_mode =TPACPI_FAN_RD_TPEC ; + fan_status_access_mode = fan_with_ns_addr ? +TPACPI_FAN_RD_TPEC_NS :TPACPI_FAN_RD_TPEC ; +if (quirks &TPACPI_FAN_Q1 )fan_quirk1_setup ();/* Try and probe the 2nd fan */
@@ -8971,7 +9032,8 @@ static int __init fan_init(struct ibm_init_struct *iibm)if (res >=0 && speed !=FAN_NOT_PRESENT ) {/* It responded - so let's assume it's there */ tp_features.second_fan =1 ; - tp_features.second_fan_ctl =1 ; +/* fan control not currently available for ns ECFW */ + tp_features.second_fan_ctl = !fan_with_ns_addr;pr_info ("secondary fan control detected & enabled\n" ); }else {/* Fan not auto-detected */
@@ -9146,6 +9208,7 @@ static int fan_read(struct seq_file *m) str_enabled_disabled(status), status);break ; +case TPACPI_FAN_RD_TPEC_NS :case TPACPI_FAN_RD_TPEC :/* all except 570, 600e/x, 770e, 770x */ rc =fan_get_status_safe (&status);
@@ -9160,13 +9223,22 @@ static int fan_read(struct seq_file *m)seq_printf (m,"speed:\t\t%d\n" , speed); -if (status &TP_EC_FAN_FULLSPEED ) -/* Disengaged mode takes precedence */ -seq_printf (m,"level:\t\tdisengaged\n" ); -else if (status &TP_EC_FAN_AUTO ) -seq_printf (m,"level:\t\tauto\n" ); -else -seq_printf (m,"level:\t\t%d\n" , status); +if (fan_status_access_mode ==TPACPI_FAN_RD_TPEC_NS ) { +/* +* No full speed bit in NS EC +* EC Auto mode is set by default. +* No other levels settings available +*/ +seq_printf (m,"level:\t\t%s\n" , status &FAN_NS_CTRL ?"unknown" :"auto" ); + }else { +if (status &TP_EC_FAN_FULLSPEED ) +/* Disengaged mode takes precedence */ +seq_printf (m,"level:\t\tdisengaged\n" ); +else if (status &TP_EC_FAN_AUTO ) +seq_printf (m,"level:\t\tauto\n" ); +else +seq_printf (m,"level:\t\t%d\n" , status); + }break ;case TPACPI_FAN_NONE :
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 67/100 ASoC: Intel: bytcr_rt5640: Add quirk for the Medion Lifetab S10346
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 99c7bb44f5749373bc01b73af02b50b69bcbf43d ]
Add a quirk for the Medion Lifetab S10346, this BYTCR tablet has no CHAN package in its ACPI tables and uses SSP0-AIF1 rather then SSP0-AIF2 which is the default for BYTCR devices.
--- sound/soc/intel/boards/bytcr_rt5640.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/soc/intel/boards/bytcr_rt5640.c +12 -0
@@ -884,6 +884,18 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {BYT_RT5640_SSP0_AIF1 | BYT_RT5640_MCLK_EN), }, + { +/* Medion Lifetab S10346 */ + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"AMI Corporation" ), +DMI_MATCH (DMI_BOARD_NAME ,"Aptio CRB" ), +/* Above strings are much too generic, also match on BIOS date */ + DMI_MATCH(DMI_BIOS_DATE, "10/22/2015"), + }, + .driver_data = (void *)(BYTCR_INPUT_DEFAULTS | +BYT_RT5640_SSP0_AIF1 | + BYT_RT5640_MCLK_EN), + }, { /* Mele PCG03 Mini PC */ .matches = { DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Mini PC"),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 68/100 ASoC: Intel: bytcr_rt5640: Add new swapped-speakers quirk
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit b1b6131bca35a55a69fadc39d51577968fa2ee97 ]
Some BYTCR x86 tablets with a rt5640 codec have the left and right channels of their speakers swapped.
Add a new BYT_RT5640_SWAPPED_SPEAKERS quirk for this which sets cfg-spk:swapped in the components string to let userspace know about the swapping so that the UCM profile can configure the mixer to correct this.
Enable this new quirk on the Medion Lifetab S10346 which has its speakers swapped.
--- sound/soc/intel/boards/bytcr_rt5640.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
sound/soc/intel/boards/bytcr_rt5640.c +13 -6
@@ -83,6 +83,7 @@ enum {#define BYT_RT5640_HSMIC2_ON_IN1 BIT(27)#define BYT_RT5640_JD_HP_ELITEP_1000G2 BIT(28)#define BYT_RT5640_USE_AMCR0F28 BIT(29) +#define BYT_RT5640_SWAPPED_SPEAKERS BIT(30)#define BYTCR_INPUT_DEFAULTS \ (BYT_RT5640_IN3_MAP | \
@@ -157,6 +158,8 @@ static void log_quirks(struct device *dev)dev_info (dev,"quirk MONO_SPEAKER enabled\n" );if (byt_rt5640_quirk &BYT_RT5640_NO_SPEAKERS )dev_info (dev,"quirk NO_SPEAKERS enabled\n" ); +if (byt_rt5640_quirk &BYT_RT5640_SWAPPED_SPEAKERS ) +dev_info (dev,"quirk SWAPPED_SPEAKERS enabled\n" );if (byt_rt5640_quirk &BYT_RT5640_LINEOUT )dev_info (dev,"quirk LINEOUT enabled\n" );if (byt_rt5640_quirk &BYT_RT5640_LINEOUT_AS_HP2 )
@@ -893,6 +896,7 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { DMI_MATCH(DMI_BIOS_DATE, "10/22/2015"), }, .driver_data = (void *)(BYTCR_INPUT_DEFAULTS | +BYT_RT5640_SWAPPED_SPEAKERS |BYT_RT5640_SSP0_AIF1 | BYT_RT5640_MCLK_EN), },
@@ -1621,11 +1625,11 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)const char *platform_name;struct acpi_device *adev;struct device *codec_dev; +const char *cfg_spk;bool sof_parent;int ret_val =0 ;int dai_index =0 ; -int i, cfg_spk; -int aif; +int i, aif; is_bytcr = false; priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL );
@@ -1785,13 +1789,16 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) }if (byt_rt5640_quirk &BYT_RT5640_NO_SPEAKERS ) { - cfg_spk =0 ; + cfg_spk ="0" ; spk_type ="none" ; }else if (byt_rt5640_quirk &BYT_RT5640_MONO_SPEAKER ) { - cfg_spk =1 ; + cfg_spk ="1" ; spk_type ="mono" ; + }else if (byt_rt5640_quirk &BYT_RT5640_SWAPPED_SPEAKERS ) { + cfg_spk ="swapped" ; + spk_type ="swapped" ; }else { - cfg_spk =2 ; + cfg_spk ="2" ; spk_type ="stereo" ; }
@@ -1806,7 +1813,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) headset2_string =" cfg-hs2:in1" ;snprintf (byt_rt5640_components,sizeof (byt_rt5640_components), -"cfg-spk:%d cfg-mic:%s aif:%d%s%s" , cfg_spk, +"cfg-spk:%s cfg-mic:%s aif:%d%s%s" , cfg_spk, map_name[BYT_RT5640_MAP (byt_rt5640_quirk)], aif, lineout_string, headset2_string); byt_rt5640_card.components = byt_rt5640_components;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 69/100 ALSA: hda/realtek: Add quirks for ASUS Zenbook 2022 Models
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Binding <[email protected]>
[ Upstream commit 51d976079976c800ef19ed1b542602fcf63f0edb ]
These models use 2xCS35L41amps with HDA using SPI and I2C. Models use internal and external boost.
All models require DSD support to be added inside cs35l41_hda_property.c
--- sound/pci/hda/patch_realtek.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +4 -1
@@ -9779,17 +9779,20 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x1d1f ,"ASUS ROG Strix G17 2023 (G713PV)" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x1d42 ,"ASUS Zephyrus G14 2022" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x1d4e ,"ASUS TM420" ,ALC256_FIXUP_ASUS_HPE ), +SND_PCI_QUIRK (0x1043 ,0x1da2 ,"ASUS UP6502ZA/ZD" ,ALC245_FIXUP_CS35L41_SPI_2 ),SND_PCI_QUIRK (0x1043 ,0x1e02 ,"ASUS UX3402ZA" ,ALC245_FIXUP_CS35L41_SPI_2 ),SND_PCI_QUIRK (0x1043 ,0x16a3 ,"ASUS UX3402VA" ,ALC245_FIXUP_CS35L41_SPI_2 ),SND_PCI_QUIRK (0x1043 ,0x1f62 ,"ASUS UX7602ZM" ,ALC245_FIXUP_CS35L41_SPI_2 ),SND_PCI_QUIRK (0x1043 ,0x1e11 ,"ASUS Zephyrus G15" ,ALC289_FIXUP_ASUS_GA502 ), -SND_PCI_QUIRK (0x1043 ,0x1e12 ,"ASUS UM3402" ,ALC287_FIXUP_CS35L41_I2C_2 ), +SND_PCI_QUIRK (0x1043 ,0x1e12 ,"ASUS UM6702RA/RC" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x1e51 ,"ASUS Zephyrus M15" ,ALC294_FIXUP_ASUS_GU502_PINS ),SND_PCI_QUIRK (0x1043 ,0x1e5e ,"ASUS ROG Strix G513" ,ALC294_FIXUP_ASUS_G513_PINS ),SND_PCI_QUIRK (0x1043 ,0x1e8e ,"ASUS Zephyrus G15" ,ALC289_FIXUP_ASUS_GA401 ), +SND_PCI_QUIRK (0x1043 ,0x1ee2 ,"ASUS UM3402" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x1c52 ,"ASUS Zephyrus G15 2022" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x1f11 ,"ASUS Zephyrus G14" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x1f12 ,"ASUS UM5302" ,ALC287_FIXUP_CS35L41_I2C_2 ), +SND_PCI_QUIRK (0x1043 ,0x1f62 ,"ASUS UX7602ZM" ,ALC245_FIXUP_CS35L41_SPI_2 ),SND_PCI_QUIRK (0x1043 ,0x1f92 ,"ASUS ROG Flow X16" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x3030 ,"ASUS ZN270IE" ,ALC256_FIXUP_ASUS_AIO_GPIO2 ), SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC245_FIXUP_CS35L41_SPI_2),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 70/100 dm audit: fix Kconfig so DM_AUDIT depends on BLK_DEV_DM
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <[email protected]>
[ Upstream commit 6849302fdff126997765d16df355b73231f130d4 ]
--- drivers/md/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/md/Kconfig +1 -0
@@ -650,6 +650,7 @@ config DM_ZONED config DM_AUDIT bool "DM audit events" + depends on BLK_DEV_DM depends on AUDIT help Generate audit events for device-mapper.
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 71/100 HID: nintendo: Prevent divide-by-zero on code
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guilherme G. Piccoli <[email protected]>
[ Upstream commit 6eb04ca8c52e3f8c8ea7102ade81d642eee87f4a ]
It was reported [0] that adding a generic joycon to the system caused a kernel crash on Steam Deck, with the below panic spew:
divide error: 0000 [#1] PREEMPT SMP NOPTI
[...]
Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023 RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo] [...] Call Trace: [...] ? exc_divide_error+0x38/0x50 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo] ? asm_exc_divide_error+0x1a/0x20 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo] hid_input_report+0x143/0x160 hidp_session_run+0x1ce/0x700 [hidp]
Since it's a divide-by-0 error, by tracking the code for potential denominator issues, we've spotted 2 places in which this could happen; so let's guard against the possibility and log in the kernel if the condition happens. This is specially useful since some data that fills some denominators are read from the joycon HW in some cases, increasing the potential for flaws.
[0] https://github.com/ValveSoftware/SteamOS/issues/1070
--- drivers/hid/hid-nintendo.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/hid/hid-nintendo.c +20 -7
@@ -859,14 +859,27 @@ static int joycon_request_calibration(struct joycon_ctlr *ctlr)*/ static void joycon_calc_imu_cal_divisors (struct joycon_ctlr *ctlr) { -int i; +int i, divz =0 ;for (i =0 ; i <3 ; i++) { ctlr->imu_cal_accel_divisor[i] = ctlr->accel_cal.scale[i] - ctlr->accel_cal.offset[i]; ctlr->imu_cal_gyro_divisor[i] = ctlr->gyro_cal.scale[i] - ctlr->gyro_cal.offset[i]; + +if (ctlr->imu_cal_accel_divisor[i] ==0 ) { + ctlr->imu_cal_accel_divisor[i] =1 ; + divz++; + } + +if (ctlr->imu_cal_gyro_divisor[i] ==0 ) { + ctlr->imu_cal_gyro_divisor[i] =1 ; + divz++; + } } + +if (divz) +hid_warn (ctlr->hdev,"inaccurate IMU divisors (%d)\n" , divz); }static const s16 DFLT_ACCEL_OFFSET /*= 0*/ ;
@@ -1095,16 +1108,16 @@ static void joycon_parse_imu_report(struct joycon_ctlr *ctlr, JC_IMU_SAMPLES_PER_DELTA_AVG) { ctlr->imu_avg_delta_ms = ctlr->imu_delta_samples_sum / ctlr->imu_delta_samples_count; -/* don't ever want divide by zero shenanigans */ -if (ctlr->imu_avg_delta_ms ==0 ) { - ctlr->imu_avg_delta_ms =1 ; -hid_warn (ctlr->hdev, -"calculated avg imu delta of 0\n" ); - } ctlr->imu_delta_samples_count =0 ; ctlr->imu_delta_samples_sum =0 ; } +/* don't ever want divide by zero shenanigans */ +if (ctlr->imu_avg_delta_ms ==0 ) { + ctlr->imu_avg_delta_ms =1 ; +hid_warn (ctlr->hdev,"calculated avg imu delta of 0\n" ); + } +/* useful for debugging IMU sample rate */ hid_dbg(ctlr->hdev, "imu_report: ms=%u last_ms=%u delta=%u avg_delta=%u\n",
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 72/100 smb: client: fix potential OOB in smb2_dump_detail()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
[ Upstream commit 567320c46a60a3c39b69aa1df802d753817a3f86 ]
Validate SMB message with ->check_message() before calling ->calc_smb_size().
This fixes CVE-2023-6610.
--- fs/smb/client/smb2misc.c | 30 +++++++++++++++--------------- fs/smb/client/smb2ops.c | 6 ++++-- 2 files changed, 19 insertions(+), 17 deletions(-)
fs/smb/client/smb2misc.c +15 -15
@@ -173,6 +173,21 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server) } mid =le64_to_cpu (shdr->MessageId); +if (check_smb2_hdr (shdr, mid)) +return 1 ; + +if (shdr->StructureSize !=SMB2_HEADER_STRUCTURE_SIZE ) { +cifs_dbg (VFS ,"Invalid structure size %u\n" , +le16_to_cpu (shdr->StructureSize)); +return 1 ; + } + + command =le16_to_cpu (shdr->Command); +if (command >=NUMBER_OF_SMB2_COMMANDS ) { +cifs_dbg (VFS ,"Invalid SMB2 command %d\n" , command); +return 1 ; + } +if (len < pdu_size) {if ((len >= hdr_size) && (shdr->Status !=0 )) {
@@ -193,21 +208,6 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)return 1 ; } -if (check_smb2_hdr (shdr, mid)) -return 1 ; - -if (shdr->StructureSize !=SMB2_HEADER_STRUCTURE_SIZE ) { -cifs_dbg (VFS ,"Invalid structure size %u\n" , -le16_to_cpu (shdr->StructureSize)); -return 1 ; - } - - command =le16_to_cpu (shdr->Command); -if (command >=NUMBER_OF_SMB2_COMMANDS ) { -cifs_dbg (VFS ,"Invalid SMB2 command %d\n" , command); -return 1 ; - } -if (smb2_rsp_struct_sizes[command] != pdu->StructureSize2) {if (command !=SMB2_OPLOCK_BREAK_HE && (shdr->Status ==0 || pdu->StructureSize2 !=SMB2_ERROR_STRUCTURE_SIZE2_LE )) {
fs/smb/client/smb2ops.c +4 -2
@@ -398,8 +398,10 @@ smb2_dump_detail(void *buf, struct TCP_Server_Info *server)cifs_server_dbg (VFS ,"Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d\n" , shdr->Command, shdr->Status, shdr->Flags, shdr->MessageId, shdr->Id.SyncId.ProcessId); -cifs_server_dbg (VFS ,"smb buf %p len %u\n" , buf, - server->ops->calc_smb_size (buf)); +if (!server->ops->check_message (buf, server->total_read, server)) { +cifs_server_dbg (VFS ,"smb buf %p len %u\n" , buf, + server->ops->calc_smb_size (buf)); + }#endif }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 73/100 i2c: rk3x: fix potential spinlock recursion on poll
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jensen Huang <[email protected]>
[ Upstream commit 19cde9c92b8d3b7ee555d0da3bcb0232d3a784f4 ]
Possible deadlock scenario (on reboot):rk3x_i2c_xfer_common(polling)
-> rk3x_i2c_wait_xfer_poll()
-> rk3x_i2c_irq(0, i2c);
--> spin_lock(&i2c->lock);
...
<rk3x i2c interrupt>
-> rk3x_i2c_irq(0, i2c);
--> spin_lock(&i2c->lock); (deadlock here)Store the IRQ number and disable/enable it around the polling transfer. This patch has been tested on NanoPC-T4.
--- drivers/i2c/busses/i2c-rk3x.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +11 -2
@@ -178,6 +178,7 @@ struct rk3x_i2c_soc_data {* @clk: function clk for rk3399 or function & Bus clks for others * @pclk: Bus clk for rk3399 * @clk_rate_nb: i2c clk rate change notify +* @irq: irq number * @t: I2C known timing information * @lock: spinlock for the i2c bus * @wait: the waitqueue to wait for i2c transfer
@@ -200,6 +201,7 @@ struct rk3x_i2c {struct clk *clk;struct clk *pclk;struct notifier_block clk_rate_nb; +int irq;/* Settings */ struct i2c_timings t;
@@ -1087,13 +1089,18 @@ static int rk3x_i2c_xfer_common(struct i2c_adapter *adap,spin_unlock_irqrestore (&i2c->lock, flags); -rk3x_i2c_start (i2c); -if (!polling) { +rk3x_i2c_start (i2c); + timeout =wait_event_timeout (i2c->wait, !i2c->busy,msecs_to_jiffies (WAIT_TIMEOUT )); }else { +disable_irq (i2c->irq); +rk3x_i2c_start (i2c); + timeout =rk3x_i2c_wait_xfer_poll (i2c); + +enable_irq (i2c->irq); }spin_lock_irqsave (&i2c->lock, flags);
@@ -1310,6 +1317,8 @@ static int rk3x_i2c_probe(struct platform_device *pdev)return ret; } + i2c->irq = irq; +platform_set_drvdata (pdev, i2c);if (i2c->soc_data->calc_timings == rk3x_i2c_v0_calc_timings) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 74/100 drm/amd/display: get dprefclk ss info from integration info table
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charlene Liu <[email protected]>
[ Upstream commit 51e7b64690776a9981355428b537af9048308a95 ]
[why & how]
we have two SSC_En:
we get ssc_info from dce_info for MPLL_SSC_EN.
we used to call VBIOS cmdtbl's smu_info's SS persentage for DPRECLK SS info, is used for DP AUDIO and VBIOS' smu_info table was from systemIntegrationInfoTable.
since dcn35 VBIOS removed smu_info, driver need to use integrationInfotable directly.
--- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 19 ++++++++---- drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h | 2 + 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +14 -5
@@ -1018,13 +1018,20 @@ static enum bp_result get_ss_info_v4_5(DC_LOG_BIOS ("AS_SIGNAL_TYPE_HDMI ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;case AS_SIGNAL_TYPE_DISPLAY_PORT : - ss_info->spread_spectrum_percentage = +if (bp->base.integrated_info) { +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , bp->base.integrated_info->gpuclk_ss_percentage); + ss_info->spread_spectrum_percentage = + bp->base.integrated_info->gpuclk_ss_percentage; + ss_info->type.CENTER_MODE = + bp->base.integrated_info->gpuclk_ss_type; + }else { + ss_info->spread_spectrum_percentage = disp_cntl_tbl->dp_ss_percentage; - ss_info->spread_spectrum_range = + ss_info->spread_spectrum_range = disp_cntl_tbl->dp_ss_rate_10hz *10 ; -if (disp_cntl_tbl->dp_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) - ss_info->type.CENTER_MODE = true; - +if (disp_cntl_tbl->dp_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) + ss_info->type.CENTER_MODE = true; + }DC_LOG_BIOS ("AS_SIGNAL_TYPE_DISPLAY_PORT ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;case AS_SIGNAL_TYPE_GPU_PLL :
@@ -2830,6 +2837,8 @@ static enum bp_result get_integrated_inf info->ma_channel_number = info_v2_2->umachannelnumber; info->dp_ss_control =le16_to_cpu (info_v2_2->reserved1); + info->gpuclk_ss_percentage = info_v2_2->gpuclk_ss_percentage; + info->gpuclk_ss_type = info_v2_2->gpuclk_ss_type;for (i =0 ; i <NUMBER_OF_UCHAR_FOR_GUID ; ++i) { info->ext_disp_conn_info.gu_id[i] =
drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +2 -0
@@ -417,6 +417,8 @@ struct integrated_info {/* V2.1 */ struct edp_info edp1_info;struct edp_info edp2_info; +uint32_t gpuclk_ss_percentage; +uint32_t gpuclk_ss_type; };/*
Greg Kroah-Hartman
maintainerPATCH 75/100 pinctrl: cy8c95x0: Fix typo
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrick Rudolph <[email protected]>
[ Upstream commit 47b1fa48116238208c1b1198dba10f56fc1b6eb2 ]
Fix typo to make pinctrl-cy8c95x compile again.
--- drivers/pinctrl/pinctrl-cy8c95x0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-cy8c95x0.c +1 -1
@@ -857,7 +857,7 @@ static int cy8c95x0_setup_gpiochip(struct cy8c95x0_pinctrl *chip) gc->get_direction = cy8c95x0_gpio_get_direction; gc->get_multiple = cy8c95x0_gpio_get_multiple; gc->set_multiple = cy8c95x0_gpio_set_multiple; - gc->set_config = gpiochip_generic_config, + gc->set_config = gpiochip_generic_config; gc->can_sleep = true; gc->add_pin_ranges = cy8c95x0_add_pin_ranges;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 76/100 pinctrl: cy8c95x0: Fix get_pincfg
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrick Rudolph <[email protected]>
[ Upstream commit 94c71705cc49092cef60ece13a28680809096fd4 ]
Invert the register value for PIN_CONFIG_OUTPUT_ENABLE to return the opposite of PIN_CONFIG_INPUT_ENABLE.
--- drivers/pinctrl/pinctrl-cy8c95x0.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pinctrl/pinctrl-cy8c95x0.c +2 -0
@@ -749,6 +749,8 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip, ret =regmap_read (chip->regmap, reg, ®_val);if (reg_val & bit) arg =1 ; +if (param ==PIN_CONFIG_OUTPUT_ENABLE ) + arg = !arg; *config =pinconf_to_config_packed (param, (u16 )arg); out:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 77/100 ida: Fix crash in ida_free when the bitmap is empty
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit af73483f4e8b6f5c68c9aa63257bdd929a9c194a ]
The IDA usually detects double-frees, but that detection failed to consider the case when there are no nearby IDs allocated and so we have a NULL bitmap rather than simply having a clear bit. Add some tests to the test-suite to be sure we don't inadvertently reintroduce this problem. Unfortunately they're quite noisy so include a message to disregard the warnings.
--- lib/idr.c | 2 +- lib/test_ida.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-)
lib/idr.c +1 -1
@@ -508,7 +508,7 @@ void ida_free(struct ida *ida, unsigned int id) goto delete;xas_store (&xas,xa_mk_value (v)); }else { -if (!test_bit (bit, bitmap->bitmap)) +if (!bitmap || !test_bit (bit, bitmap->bitmap)) goto err;__clear_bit (bit, bitmap->bitmap);xas_set_mark (&xas,XA_FREE_MARK );
lib/test_ida.c +40 -0
@@ -150,6 +150,45 @@ static void ida_check_conv(struct ida *ida)IDA_BUG_ON (ida, !ida_is_empty (ida)); } +/* +* Check various situations where we attempt to free an ID we don't own. +*/ +static void ida_check_bad_free (struct ida *ida) +{ +unsigned long i; + +printk ("vvv Ignore \"not allocated\" warnings\n" ); +/* IDA is empty; all of these will fail */ +ida_free (ida,0 ); +for (i =0 ; i <31 ; i++) +ida_free (ida,1 << i); + +/* IDA contains a single value entry */ +IDA_BUG_ON (ida,ida_alloc_min (ida,3 ,GFP_KERNEL ) !=3 ); +ida_free (ida,0 ); +for (i =0 ; i <31 ; i++) +ida_free (ida,1 << i); + +/* IDA contains a single bitmap */ +IDA_BUG_ON (ida,ida_alloc_min (ida,1023 ,GFP_KERNEL ) !=1023 ); +ida_free (ida,0 ); +for (i =0 ; i <31 ; i++) +ida_free (ida,1 << i); + +/* IDA contains a tree */ +IDA_BUG_ON (ida,ida_alloc_min (ida, (1 <<20 ) -1 ,GFP_KERNEL ) != (1 <<20 ) -1 ); +ida_free (ida,0 ); +for (i =0 ; i <31 ; i++) +ida_free (ida,1 << i); +printk ("^^^ \"not allocated\" warnings over\n" ); + +ida_free (ida,3 ); +ida_free (ida,1023 ); +ida_free (ida, (1 <<20 ) -1 ); + +IDA_BUG_ON (ida, !ida_is_empty (ida)); +} +static DEFINE_IDA (ida);static int ida_checks (void )
@@ -162,6 +201,7 @@ static int ida_checks(void)ida_check_leaf (&ida,1024 *64 );ida_check_max (&ida);ida_check_conv (&ida); +ida_check_bad_free (&ida);printk ("IDA: %u of %u tests passed\n" , tests_passed, tests_run);return (tests_run != tests_passed) ?0 : -EINVAL ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 78/100 virtio_blk: fix snprintf truncation compiler warning
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Hajnoczi <[email protected]>
[ Upstream commit b8e0792449928943c15d1af9f63816911d139267 ]
Commit 4e0400525691 ("virtio-blk: support polling I/O") triggers the following gcc 13 W=1 warnings:
drivers/block/virtio_blk.c: In function ‘init_vq’:drivers/block/virtio_blk.c:1077:68: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 7 [-Wformat-truncation=]
1077 | snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i);
| ^~drivers/block/virtio_blk.c:1077:58: note: directive argument in the range [-2147483648, 65534]
1077 | snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i);
| ^~~~~~~~~~~~~drivers/block/virtio_blk.c:1077:17: note: ‘snprintf’ output between 11 and 21 bytes into a destination of size 16
1077 | snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This is a false positive because the lower bound -2147483648 is incorrect. The true range of i is [0, num_vqs - 1] where 0 < num_vqs < 65536.
The code mixes int, unsigned short, and unsigned int types in addition to using "%d" for an unsigned value. Use unsigned short and "%u" consistently to solve the compiler warning.
Message-Id: <[email protected]>
--- drivers/block/virtio_blk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/block/virtio_blk.c +4 -4
@@ -609,12 +609,12 @@ static void virtblk_config_changed(struct virtio_device *vdev)static int init_vq (struct virtio_blk *vblk) {int err; -int i; +unsigned short i;vq_callback_t **callbacks;const char **names;struct virtqueue **vqs;unsigned short num_vqs; -unsigned int num_poll_vqs; +unsigned short num_poll_vqs;struct virtio_device *vdev = vblk->vdev;struct irq_affinity desc = {0 , };
@@ -658,13 +658,13 @@ static int init_vq(struct virtio_blk *vblk)for (i =0 ; i < num_vqs - num_poll_vqs; i++) { callbacks[i] = virtblk_done; -snprintf (vblk->vqs[i].name,VQ_NAME_LEN ,"req.%d" , i); +snprintf (vblk->vqs[i].name,VQ_NAME_LEN ,"req.%u" , i); names[i] = vblk->vqs[i].name; }for (; i < num_vqs; i++) { callbacks[i] =NULL ; -snprintf (vblk->vqs[i].name,VQ_NAME_LEN ,"req_poll.%d" , i); +snprintf (vblk->vqs[i].name,VQ_NAME_LEN ,"req_poll.%u" , i); names[i] = vblk->vqs[i].name; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 79/100 net: qrtr: ns: Return 0 if server port is not present
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarannya S <[email protected]>
[ Upstream commit 9bf2e9165f90dc9f416af53c902be7e33930f728 ]
When a 'DEL_CLIENT' message is received from the remote, the corresponding server port gets deleted. A DEL_SERVER message is then announced for this server. As part of handling the subsequent DEL_SERVER message, the name- server attempts to delete the server port which results in a '-ENOENT' error. The return value from server_del() is then propagated back to qrtr_ns_worker, causing excessive error prints.
To address this, return 0 from control_cmd_del_server() without checking the return value of server_del(), since the above scenario is not an error case and hence server_del() doesn't have any other error return value.
--- net/qrtr/ns.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/qrtr/ns.c +3 -1
@@ -569,7 +569,9 @@ static int ctrl_cmd_del_server(struct sockaddr_qrtr *from,if (!node)return -ENOENT ; -return server_del (node, port, true); +server_del (node, port, true); + +return 0 ; } static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 80/100 ARM: sun9i: smp: fix return code check of of_property_match_string
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <[email protected]>
[ Upstream commit 643fe70e7bcdcc9e2d96952f7fc2bab56385cce5 ]
of_property_match_string returns an int; either an index from 0 or greater if successful or negative on failure. Even it's very unlikely that the DT CPU node contains multiple enable-methods these checks should be fixed.
This patch was inspired by the work of Nick Desaulniers.
--- arch/arm/mach-sunxi/mc_smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-sunxi/mc_smp.c +2 -2
@@ -804,12 +804,12 @@ static int __init sunxi_mc_smp_init(void)for (i =0 ; i <ARRAY_SIZE (sunxi_mc_smp_data); i++) { ret =of_property_match_string (node,"enable-method" , sunxi_mc_smp_data[i].enable_method); -if (!ret) +if (ret >=0 )break ; }of_node_put (node); -if (ret) +if (ret <0 )return -ENODEV ; is_a83t = sunxi_mc_smp_data[i].is_a83t;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 81/100 drm/crtc: fix uninitialized variable use
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
[ Upstream commit 6e455f5dcdd15fa28edf0ffb5b44d3508512dccf ]
Commit 3823119b9c2b ("drm/crtc: Fix uninit-value bug in drm_mode_setcrtc") was supposed to fix use of an uninitialized variable, but introduced another.
num_connectors is only initialized if crtc_req->count_connectors > 0, but it's used regardless. Fix it.
--- drivers/gpu/drm/drm_crtc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/drm_crtc.c +1 -2
@@ -715,7 +715,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,struct drm_mode_set set;uint32_t __user *set_connectors_ptr;struct drm_modeset_acquire_ctx ctx; -int ret, i, num_connectors; +int ret, i, num_connectors =0 ;if (!drm_core_check_feature (dev,DRIVER_MODESET ))return -EOPNOTSUPP ;
@@ -850,7 +850,6 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, goto out; } - num_connectors =0 ;for (i =0 ; i < crtc_req->count_connectors; i++) { connector_set[i] =NULL ; set_connectors_ptr = (uint32_t __user *)(unsigned long )crtc_req->set_connectors_ptr;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 82/100 ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP Envy X360 13-ay0xxx
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tom Jason Schwanke <[email protected]>
commit 6b3d14b7f9b1acaf7303d8499836bf78ee9c470c upstream.
This enables the mute and mic-mute LEDs on the HP Envy X360 13-ay0xxx convertibles.
The quirk 'ALC245_FIXUP_HP_X360_MUTE_LEDS' already exists and is now enabled for this device.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9607,6 +9607,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x103c ,0x8735 ,"HP ProBook 435 G7" ,ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF ),SND_PCI_QUIRK (0x103c ,0x8736 ,"HP" ,ALC285_FIXUP_HP_GPIO_AMP_INIT ),SND_PCI_QUIRK (0x103c ,0x8760 ,"HP" ,ALC285_FIXUP_HP_MUTE_LED ), +SND_PCI_QUIRK (0x103c ,0x876e ,"HP ENVY x360 Convertible 13-ay0xxx" ,ALC245_FIXUP_HP_X360_MUTE_LEDS ),SND_PCI_QUIRK (0x103c ,0x877a ,"HP" ,ALC285_FIXUP_HP_MUTE_LED ),SND_PCI_QUIRK (0x103c ,0x877d ,"HP" ,ALC236_FIXUP_HP_MUTE_LED ), SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
Greg Kroah-Hartman
maintainerPATCH 83/100 ACPI: resource: Add another DMI match for the TongFang GMxXGxx
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit df0cced74159c79e36ce7971f0bf250673296d93 upstream.
The TongFang GMxXGxx, which needs IRQ overriding for the keyboard to work, is also sold as the Eluktronics RP-15 which does not use the standard TongFang GMxXGxx DMI board_name.
Add an entry for this laptop to the irq1_edge_low_force_override[] DMI table to make the internal keyboard functional.
--- drivers/acpi/resource.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/acpi/resource.c +7 -0
@@ -513,6 +513,13 @@ static const struct dmi_system_id mainge }, }, { +/* TongFang GMxXGxx sold as Eluktronics Inc. RP-15 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Eluktronics Inc." ), + DMI_MATCH(DMI_BOARD_NAME, "RP-15"), + }, + }, + {/* TongFang GM6XGxX/TUXEDO Stellaris 16 Gen5 AMD */ .matches = { DMI_MATCH(DMI_BOARD_NAME, "GM6XGxX"),
Greg Kroah-Hartman
maintainerPATCH 84/100 ASoC: SOF: Intel: hda-codec: Delay the codec device registration
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
commit c344ef36dbc2fe920ec7291b68b11fe867a2c8f6 upstream.
The current code flow is:
1. snd_hdac_device_register()
2. set parameters needed by the hdac driver
3. request_codec_module()
the hdac driver is probed at this point
During boot the codec drivers are not loaded when the hdac device is registered, it is going to be probed later when loading the codec module, which point the parameters are set.
On module remove/insert
rmmod snd_sof_pci_intel_tgl
modprobe snd_sof_pci_intel_tgl
The codec module remains loaded and the driver will be probed when the hdac device is created right away, before the parameters for the driver has been configured:
1. snd_hdac_device_register()
the hdac driver is probed at this point
2. set parameters needed by the hdac driver
3. request_codec_module()
will be a NOP as the module is already loaded
Move the snd_hdac_device_register() later, to be done right before requesting the codec module to make sure that the parameters are all set before the device is created:
1. set parameters needed by the hdac driver
2. snd_hdac_device_register()
3. request_codec_module()
This way at the hdac driver probe all parameters will be set in all cases.
--- sound/soc/sof/intel/hda-codec.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
sound/soc/sof/intel/hda-codec.c +9 -9
@@ -54,8 +54,16 @@ static int request_codec_module(struct hstatic int hda_codec_load_module (struct hda_codec *codec) { -int ret =request_codec_module (codec); +int ret; + + ret =snd_hdac_device_register (&codec->core); +if (ret) { +dev_err (&codec->core.dev,"failed to register hdac device\n" ); +put_device (&codec->core.dev); +return ret; + } + ret =request_codec_module (codec);if (ret <=0 ) { codec->probe_id =HDA_CODEC_ID_GENERIC ; ret =request_codec_module (codec);
@@ -112,7 +120,6 @@ EXPORT_SYMBOL_NS(hda_codec_jack_check, Sstatic struct hda_codec *hda_codec_device_init (struct hdac_bus *bus,int addr,int type) {struct hda_codec *codec; -int ret; codec =snd_hda_codec_device_init (to_hda_bus (bus), addr,"ehdaudio%dD%d" , bus->idx, addr);if (IS_ERR (codec)) {
@@ -122,13 +129,6 @@ static struct hda_codec *hda_codec_devic codec->core.type = type; - ret =snd_hdac_device_register (&codec->core); -if (ret) { -dev_err (bus->dev,"failed to register hdac device\n" ); -put_device (&codec->core.dev); -return ERR_PTR (ret); - } -return codec; }
Greg Kroah-Hartman
maintainerPATCH 85/100 btf, scripts: Exclude Rust CUs with pahole
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Rodriguez Reboredo <[email protected]>
commit c1177979af9c616661a126a80dd486ad0543b836 upstream.
Version 1.24 of pahole has the capability to exclude compilation units (CUs) of specific languages [1] [2]. Rust, as of writing, is not currently supported by pahole and if it's used with a build that has BTF debugging enabled it results in malformed kernel and module binaries [3]. So it's better for pahole to exclude Rust CUs until support for it arrives.
--- init/Kconfig | 2 +- lib/Kconfig.debug | 9 +++++++++ scripts/pahole-flags.sh | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-)
init/Kconfig +1 -1
@@ -1914,7 +1914,7 @@ config RUST depends on !MODVERSIONS depends on !GCC_PLUGINS depends on !RANDSTRUCT - depends on !DEBUG_INFO_BTF + depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE select CONSTRUCTORS help Enables Rust support in the kernel.
lib/Kconfig.debug +9 -0
@@ -364,6 +364,15 @@ config PAHOLE_HAS_BTF_TAG btf_decl_tag) or not. Currently only clang compiler implements these attributes, so make the config depend on CC_IS_CLANG. +config PAHOLE_HAS_LANG_EXCLUDE + def_bool PAHOLE_VERSION >= 124 + help + Support for the --lang_exclude flag which makes pahole exclude + compilation units from the supplied language. Used in Kbuild to + omit Rust CUs which are not supported in version 1.24 of pahole, + otherwise it would emit malformed kernel and module binaries when + using DEBUG_INFO_BTF_MODULES. + config DEBUG_INFO_BTF_MODULES def_bool y depends on DEBUG_INFO_BTF && MODULES && PAHOLE_HAS_SPLIT_BTF
scripts/pahole-flags.sh +4 -0
@@ -19,5 +19,9 @@ fi if [ "${pahole_ver}" -ge "122" ]; then extra_paholeopt="${extra_paholeopt} -j" fi +if [ "${pahole_ver}" -ge "124" ]; then + # see PAHOLE_HAS_LANG_EXCLUDE + extra_paholeopt="${extra_paholeopt} --lang_exclude=rust" +fi echo ${extra_paholeopt}
Greg Kroah-Hartman
maintainerPATCH 86/100 bpf: Add --skip_encoding_btf_inconsistent_proto, --btf_gen_optimized to pahole flags for v1.25
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Maguire <[email protected]>
commit 7b99f75942da332e3f4f865e55a10fec95a30d4f upstream.
v1.25 of pahole supports filtering out functions with multiple inconsistent function prototypes or optimized-out parameters from the BTF representation. These present problems because there is no additional info in BTF saying which inconsistent prototype matches which function instance to help guide attachment, and functions with optimized-out parameters can lead to incorrect assumptions about register contents.
So for now, filter out such functions while adding BTF representations for functions that have "."-suffixes (foo.isra.0) but not optimized-out parameters. This patch assumes that below linked changes land in pahole for v1.25.
Issues with pahole filtering being too aggressive in removing functions appear to be resolved now, but CI and further testing will confirm.
--- scripts/pahole-flags.sh | 3 +++ 1 file changed, 3 insertions(+)
scripts/pahole-flags.sh +3 -0
@@ -23,5 +23,8 @@ if [ "${pahole_ver}" -ge "124" ]; then # see PAHOLE_HAS_LANG_EXCLUDE extra_paholeopt="${extra_paholeopt} --lang_exclude=rust" fi +if [ "${pahole_ver}" -ge "125" ]; then + extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_inconsistent_proto --btf_gen_optimized" +fi echo ${extra_paholeopt}
Greg Kroah-Hartman
maintainerPATCH 87/100 ksmbd: dont allow O_TRUNC open on read-only share
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit d592a9158a112d419f341f035d18d02f8d232def upstream.
When file is changed using notepad on read-only share(read_only = yes in ksmbd.conf), There is a problem where existing data is truncated. notepad in windows try to O_TRUNC open(FILE_OVERWRITE_IF) and all data in file is truncated. This patch don't allow O_TRUNC open on read-only share and add KSMBD_TREE_CONN_FLAG_WRITABLE check in smb2_set_info().
--- fs/smb/server/smb2pdu.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
fs/smb/server/smb2pdu.c +9 -14
@@ -2969,7 +2969,7 @@ int smb2_open(struct ksmbd_work *work) &may_flags);if (!test_tree_conn_flag (tcon,KSMBD_TREE_CONN_FLAG_WRITABLE )) { -if (open_flags &O_CREAT ) { +if (open_flags & (O_CREAT |O_TRUNC )) {ksmbd_debug (SMB ,"User does not have write permission\n" ); rc = -EACCES ;
@@ -5941,12 +5941,6 @@ static int smb2_set_info_file(struct ksm }case FILE_RENAME_INFORMATION : { -if (!test_tree_conn_flag (work->tcon,KSMBD_TREE_CONN_FLAG_WRITABLE )) { -ksmbd_debug (SMB , -"User does not have write permission\n" ); -return -EACCES ; - } -if (buf_len <sizeof (struct smb2_file_rename_info ))return -EINVAL ;
@@ -5966,12 +5960,6 @@ static int smb2_set_info_file(struct ksm }case FILE_DISPOSITION_INFORMATION : { -if (!test_tree_conn_flag (work->tcon,KSMBD_TREE_CONN_FLAG_WRITABLE )) { -ksmbd_debug (SMB , -"User does not have write permission\n" ); -return -EACCES ; - } -if (buf_len <sizeof (struct smb2_file_disposition_info ))return -EINVAL ;
@@ -6033,7 +6021,7 @@ int smb2_set_info(struct ksmbd_work *wor {struct smb2_set_info_req *req;struct smb2_set_info_rsp *rsp; -struct ksmbd_file *fp; +struct ksmbd_file *fp =NULL ;int rc =0 ;unsigned int id =KSMBD_NO_FID , pid =KSMBD_NO_FID ;
@@ -6053,6 +6041,13 @@ int smb2_set_info(struct ksmbd_work *wor rsp =smb2_get_msg (work->response_buf); } +if (!test_tree_conn_flag (work->tcon,KSMBD_TREE_CONN_FLAG_WRITABLE )) { +ksmbd_debug (SMB ,"User does not have write permission\n" ); +pr_err ("User does not have write permission\n" ); + rc = -EACCES ; + goto err_out; + } +if (!has_file_id (id)) { id = req->VolatileFileId; pid = req->PersistentFileId;
Greg Kroah-Hartman
maintainerPATCH 88/100 ksmbd: free ppace array on error in parse_dacl
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
commit 8cf9bedfc3c47d24bb0de386f808f925dc52863e upstream.
The ppace array is not freed if one of the init_acl_state() calls inside parse_dacl() fails. At the moment the function may fail only due to the memory allocation errors so it's highly unlikely in this case but nevertheless a fix is needed.
Move ppace allocation after the init_acl_state() calls with proper error handling.
Found by Linux Verification Center (linuxtesting.org).
--- fs/smb/server/smbacl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
fs/smb/server/smbacl.c +7 -4
@@ -401,10 +401,6 @@ static void parse_dacl(struct user_namesif (num_aces >ULONG_MAX /sizeof (struct smb_ace *))return ; - ppace =kmalloc_array (num_aces,sizeof (struct smb_ace *),GFP_KERNEL ); -if (!ppace) -return ; - ret =init_acl_state (&acl_state, num_aces);if (ret)return ;
@@ -413,6 +409,13 @@ static void parse_dacl(struct user_namesfree_acl_state (&acl_state);return ; } + + ppace =kmalloc_array (num_aces,sizeof (struct smb_ace *),GFP_KERNEL ); +if (!ppace) { +free_acl_state (&default_acl_state); +free_acl_state (&acl_state); +return ; + }/* * reset rwx permissions for user/group/other.
Greg Kroah-Hartman
maintainerPATCH 89/100 Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxiao Bi <[email protected]>
commit bed9e27baf52a09b7ba2a3714f1e24e17ced386d upstream.
This reverts commit 5e2cf333b7bd5d3e62595a44d598a254c697cd74.
That commit introduced the following race and can cause system hung.
md_write_start: raid5d:
// mddev->in_sync == 1
set "MD_SB_CHANGE_PENDING"
// running before md_write_start wakeup it
waiting "MD_SB_CHANGE_PENDING" cleared
>>>>>>>>> hung wakeup mddev->thread
...
waiting "MD_SB_CHANGE_PENDING" cleared
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
hung, raid5d should clear this flag
but get hung by same flag.
The issue reverted commit fixing is fixed by last patch in a new way.
--- drivers/md/raid5.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/md/raid5.c +0 -12
@@ -36,7 +36,6 @@*/ #include <linux/blkdev.h> -#include <linux/delay.h> #include <linux/kthread.h> #include <linux/raid/pq.h> #include <linux/async_tx.h>
@@ -6833,18 +6832,7 @@ static void raid5d(struct md_thread *thrspin_unlock_irq (&conf->device_lock);md_check_recovery (mddev);spin_lock_irq (&conf->device_lock); - -/* -* Waiting on MD_SB_CHANGE_PENDING below may deadlock -* seeing md_check_recovery() is needed to clear -* the flag when using mdmon. -*/ -continue ; } - -wait_event_lock_irq (mddev->sb_wait, - !test_bit (MD_SB_CHANGE_PENDING , &mddev->sb_flags), - conf->device_lock); }pr_debug ("%d stripes handled\n" , handled);
Greg Kroah-Hartman
maintainerPATCH 90/100 binder: use EPOLLERR from eventpoll.h
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Llamas <[email protected]>
commit 6ac061db9c58ca5b9270b1b3940d2464fb3ff183 upstream.
Use EPOLLERR instead of POLLERR to make sure it is cast to the correct __poll_t type. This fixes the following sparse issue:
drivers/android/binder.c:5030:24: warning: incorrect type in return expression (different base types)
drivers/android/binder.c:5030:24: expected restricted __poll_t
drivers/android/binder.c:5030:24: got int
--- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder.c +1 -1
@@ -5005,7 +5005,7 @@ static __poll_t binder_poll(struct file thread =binder_get_thread (proc);if (!thread) -return POLLERR ; +return EPOLLERR ;binder_inner_proc_lock (thread->proc); thread->looper |=BINDER_LOOPER_STATE_POLL ;
Greg Kroah-Hartman
maintainerPATCH 91/100 binder: fix use-after-free in shinkers callback
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Llamas <[email protected]>
commit 3f489c2067c5824528212b0fc18b28d51332d906 upstream.
The mmap read lock is used during the shrinker's callback, which means that using alloc->vma pointer isn't safe as it can race with munmap(). As of commit dd2283f2605e ("mm: mmap: zap pages with read mmap_sem in munmap") the mmap lock is downgraded after the vma has been isolated.
I was able to reproduce this issue by manually adding some delays and triggering page reclaiming through the shrinker's debug sysfs. The following KASAN report confirms the UAF:
==================================================================
BUG: KASAN: slab-use-after-free in zap_page_range_single+0x470/0x4b8 Read of size 8 at addr ffff356ed50e50f0 by task bash/478 CPU: 1 PID: 478 Comm: bash Not tainted 6.6.0-rc5-00055-g1c8b86a3799f-dirty #70 Hardware name: linux,dummy-virt (DT) Call trace: zap_page_range_single+0x470/0x4b8 binder_alloc_free_page+0x608/0xadc __list_lru_walk_one+0x130/0x3b0 list_lru_walk_node+0xc4/0x22c binder_shrink_scan+0x108/0x1dc shrinker_debugfs_scan_write+0x2b4/0x500 full_proxy_write+0xd4/0x140 vfs_write+0x1ac/0x758 ksys_write+0xf0/0x1dc __arm64_sys_write+0x6c/0x9c Allocated by task 492: kmem_cache_alloc+0x130/0x368 vm_area_alloc+0x2c/0x190 mmap_region+0x258/0x18bc do_mmap+0x694/0xa60 vm_mmap_pgoff+0x170/0x29c ksys_mmap_pgoff+0x290/0x3a0 __arm64_sys_mmap+0xcc/0x144 Freed by task 491: kmem_cache_free+0x17c/0x3c8 vm_area_free_rcu_cb+0x74/0x98 rcu_core+0xa38/0x26d4 rcu_core_si+0x10/0x1c __do_softirq+0x2fc/0xd24 Last potentially related work creation: __call_rcu_common.constprop.0+0x6c/0xba0 call_rcu+0x10/0x1c vm_area_free+0x18/0x24 remove_vma+0xe4/0x118 do_vmi_align_munmap.isra.0+0x718/0xb5c do_vmi_munmap+0xdc/0x1fc __vm_munmap+0x10c/0x278 __arm64_sys_munmap+0x58/0x7c
Fix this issue by performing instead a vma_lookup() which will fail to find the vma that was isolated before the mmap lock downgrade. Note that this option has better performance than upgrading to a mmap write lock which would increase contention. Plus, mmap_write_trylock() has been recently removed anyway.
--- drivers/android/binder_alloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/android/binder_alloc.c +5 -1
@@ -1005,7 +1005,9 @@ enum lru_status binder_alloc_free_page(s goto err_mmget;if (!mmap_read_trylock (mm)) goto err_mmap_read_lock_failed; - vma =binder_alloc_get_vma (alloc); + vma =vma_lookup (mm, page_addr); +if (vma && vma !=binder_alloc_get_vma (alloc)) + goto err_invalid_vma;list_lru_isolate (lru, item);spin_unlock (lock);
@@ -1031,6 +1033,8 @@ enum lru_status binder_alloc_free_page(smutex_unlock (&alloc->mutex);return LRU_REMOVED_RETRY ; +err_invalid_vma: +mmap_read_unlock (mm); err_mmap_read_lock_failed:mmput_async (mm); err_mmget:
Greg Kroah-Hartman
maintainerPATCH 92/100 binder: fix trivial typo of binder_free_buf_locked()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Llamas <[email protected]>
commit 122a3c1cb0ff304c2b8934584fcfea4edb2fe5e3 upstream.
Fix minor misspelling of the function in the comment section.
No functional changes in this patch.
--- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder_alloc.c +1 -1
@@ -706,7 +706,7 @@ void binder_alloc_free_buf(struct binder/* * We could eliminate the call to binder_alloc_clear_buf() * from binder_alloc_deferred_release() by moving this to -* binder_alloc_free_buf_locked(). However, that could +* binder_free_buf_locked(). However, that could * increase contention for the alloc mutex if clear_on_free * is used frequently for large buffers. The mutex is not * needed for correctness here.
Greg Kroah-Hartman
maintainerPATCH 93/100 binder: fix comment on binder_alloc_new_buf() return value
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Llamas <[email protected]>
commit e1090371e02b601cbfcea175c2a6cc7c955fa830 upstream.
Update the comments of binder_alloc_new_buf() to reflect that the return value of the function is now ERR_PTR(-errno) on failure.
No functional changes in this patch.
--- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder_alloc.c +1 -1
@@ -557,7 +557,7 @@ err_alloc_buf_struct_failed:* is the sum of the three given sizes (each rounded up to * pointer-sized boundary) * -* Return: The allocated buffer or %NULL if error +* Return: The allocated buffer or %ERR_PTR(-errno) if error */ struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc, size_t data_size,
Greg Kroah-Hartman
maintainerPATCH 94/100 uio: Fix use-after-free in uio_open
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guanghui Feng <[email protected]>
commit 0c9ae0b8605078eafc3bea053cc78791e97ba2e2 upstream.
core-1 core-2
-------------------------------------------------------uio_unregister_device uio_open
idev = idr_find()device_unregister(&idev->dev)put_device(&idev->dev)uio_device_release
get_device(&idev->dev) kfree(idev) uio_free_minor(minor) uio_release put_device(&idev->dev) kfree(idev)
-------------------------------------------------------
In the core-1 uio_unregister_device(), the device_unregister will kfree idev when the idev->dev kobject ref is 1. But after core-1 device_unregister, put_device and before doing kfree, the core-2 may get_device. Then:
1. After core-1 kfree idev, the core-2 will do use-after-free for idev.
2. When core-2 do uio_release and put_device, the idev will be double freed.
To address this issue, we can get idev atomic & inc idev reference with minor_lock.
--- drivers/uio/uio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/uio/uio.c +3 -4
@@ -466,13 +466,13 @@ static int uio_open(struct inode *inode,mutex_lock (&minor_lock); idev =idr_find (&uio_idr,iminor (inode)); -mutex_unlock (&minor_lock);if (!idev) { ret = -ENODEV ; +mutex_unlock (&minor_lock); goto out; } -get_device (&idev->dev); +mutex_unlock (&minor_lock);if (!try_module_get (idev->owner)) { ret = -ENODEV ;
@@ -1064,9 +1064,8 @@ void uio_unregister_device(struct uio_inwake_up_interruptible (&idev->wait);kill_fasync (&idev->async_queue,SIGIO ,POLL_HUP ); -device_unregister (&idev->dev); -uio_free_minor (minor); +device_unregister (&idev->dev);return ; }
Greg Kroah-Hartman
maintainerPATCH 95/100 parport: parport_serial: Add Brainboxes BAR details
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cameron Williams <[email protected]>
commit 65fde134b0a4ffe838729f9ee11b459a2f6f2815 upstream.
Add BAR/enum entries for Brainboxes serial/parallel cards.
--- drivers/parport/parport_serial.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/parport/parport_serial.c +8 -0
@@ -65,6 +65,10 @@ enum parport_pc_pci_cards { sunix_5069a, sunix_5079a, sunix_5099a, + brainboxes_uc257, + brainboxes_is300, + brainboxes_uc414, + brainboxes_px263, };/* each element directly indexed from enum list, above */
@@ -158,6 +162,10 @@ static struct parport_pc_pci cards[] = { /* sunix_5069a */ { 1, { { 1, 2 }, } }, /* sunix_5079a */ { 1, { { 1, 2 }, } }, /* sunix_5099a */ { 1, { { 1, 2 }, } }, + /* brainboxes_uc257 */ { 1, { { 3, -1 }, } }, + /* brainboxes_is300 */ { 1, { { 3, -1 }, } }, + /* brainboxes_uc414 */ { 1, { { 3, -1 }, } }, + /* brainboxes_px263 */ { 1, { { 3, -1 }, } }, }; static struct pci_device_id parport_serial_pci_tbl[] = {
Greg Kroah-Hartman
maintainerPATCH 96/100 parport: parport_serial: Add Brainboxes device IDs and geometry
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cameron Williams <[email protected]>
commit 6aa1fc5a8085bbc01687aa708dcf2dbe637a5ee3 upstream.
Add device IDs for the Brainboxes UC-203, UC-257, UC-414, UC-475, IS-300/IS-500 and PX-263/PX-295 and define the relevant "geometry" for the cards.
This patch requires part 1 of this series.
--- drivers/parport/parport_serial.c | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+)
drivers/parport/parport_serial.c +56 -0
@@ -285,6 +285,38 @@ static struct pci_device_id parport_seri {PCI_VENDOR_ID_SUNIX ,PCI_DEVICE_ID_SUNIX_1999 ,PCI_VENDOR_ID_SUNIX , 0x0104, 0, 0, sunix_5099a }, +/* Brainboxes UC-203 */ + { PCI_VENDOR_ID_INTASHIELD, 0x0bc1, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc257 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0bc2, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc257 }, + +/* Brainboxes UC-257 */ + { PCI_VENDOR_ID_INTASHIELD, 0x0861, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc257 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0862, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc257 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0863, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc257 }, + +/* Brainboxes UC-414 */ + { PCI_VENDOR_ID_INTASHIELD, 0x0e61, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc414 }, + +/* Brainboxes UC-475 */ + { PCI_VENDOR_ID_INTASHIELD, 0x0981, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc257 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0982, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc257 }, + +/* Brainboxes IS-300/IS-500 */ + { PCI_VENDOR_ID_INTASHIELD, 0x0da0, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_is300 }, + +/* Brainboxes PX-263/PX-295 */ + { PCI_VENDOR_ID_INTASHIELD, 0x402c, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_px263 }, + { 0, } /* terminate list */ };MODULE_DEVICE_TABLE (pci,parport_serial_pci_tbl);
@@ -550,6 +582,30 @@ static struct pciserial_board pci_parpor .base_baud = 921600, .uart_offset = 0x8, }, + [brainboxes_uc257] = { + .flags = FL_BASE2, + .num_ports = 2, + .base_baud = 115200, + .uart_offset = 8, + }, + [brainboxes_is300] = { + .flags = FL_BASE2, + .num_ports = 1, + .base_baud = 115200, + .uart_offset = 8, + }, + [brainboxes_uc414] = { + .flags = FL_BASE2, + .num_ports = 4, + .base_baud = 115200, + .uart_offset = 8, + }, + [brainboxes_px263] = { + .flags = FL_BASE2, + .num_ports = 4, + .base_baud = 921600, + .uart_offset = 8, + }, };struct parport_serial_private {
Greg Kroah-Hartman
maintainerPATCH 97/100 leds: ledtrig-tty: Free allocated ttyname buffer on deactivate
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Eckert <[email protected]>
commit 25054b232681c286fca9c678854f56494d1352cc upstream.
The ttyname buffer for the ledtrig_tty_data struct is allocated in the sysfs ttyname_store() function. This buffer must be released on trigger deactivation. This was missing and is thus a memory leak.
While we are at it, the TTY handler in the ledtrig_tty_data struct should also be returned in case of the trigger deactivation call.
--- drivers/leds/trigger/ledtrig-tty.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/leds/trigger/ledtrig-tty.c +4 -0
@@ -168,6 +168,10 @@ static void ledtrig_tty_deactivate(struccancel_delayed_work_sync (&trigger_data->dwork); +kfree (trigger_data->ttyname); +tty_kref_put (trigger_data->tty); + trigger_data->tty =NULL ; +kfree (trigger_data); }
Greg Kroah-Hartman
maintainerPATCH 98/100 PCI: Add ACS quirk for more Zhaoxin Root Ports
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: LeoLiuoc <[email protected]>
commit e367e3c765f5477b2e79da0f1399aed49e2d1e37 upstream.
Add more Root Port Device IDs to pci_quirk_zhaoxin_pcie_ports_acs() for some new Zhaoxin platforms.
[bhelgaas: update subject, drop changelog, add Fixes, add stable tag, fix whitespace, wrap code comment]
--- drivers/pci/quirks.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/pci/quirks.c +6 -2
@@ -4602,17 +4602,21 @@ static int pci_quirk_xgene_acs(struct pc* But the implementation could block peer-to-peer transactions between them * and provide ACS-like functionality. */ -static int pci_quirk_zhaoxin_pcie_ports_acs (struct pci_dev *dev,u16 acs_flags) +static int pci_quirk_zhaoxin_pcie_ports_acs (struct pci_dev *dev,u16 acs_flags) {if (!pci_is_pcie (dev) || ((pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) && (pci_pcie_type (dev) !=PCI_EXP_TYPE_DOWNSTREAM )))return -ENOTTY ; +/* +* Future Zhaoxin Root Ports and Switch Downstream Ports will +* implement ACS capability in accordance with the PCIe Spec. +*/ switch (dev->device) { case 0x0710 ... 0x071e:case 0x0721 : - case 0x0723 ... 0x0732: + case 0x0723 ... 0x0752:return pci_acs_ctrl_enabled (acs_flags,PCI_ACS_SV |PCI_ACS_RR |PCI_ACS_CR |PCI_ACS_UF ); }
Greg Kroah-Hartman
maintainerPATCH 99/100 coresight: etm4x: Fix width of CCITMIN field
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Clark <[email protected]>
commit cc0271a339cc70cae914c3ec20edc2a8058407da upstream.
CCITMIN is a 12 bit field and doesn't fit in a u8, so extend it to u16. This probably wasn't an issue previously because values higher than 255 never occurred.
But since commit 4aff040bcc8d ("coresight: etm: Override TRCIDR3.CCITMIN on errata affected cpus"), a comparison with 256 was done to enable the errata, generating the following W=1 build error:
coresight-etm4x-core.c:1188:24: error: result of comparison of constant 256 with expression of type 'u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (drvdata->ccitmin == 256)
--- drivers/hwtracing/coresight/coresight-etm4x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-etm4x.h +1 -1
@@ -1032,7 +1032,7 @@ struct etmv4_drvdata {u8 ctxid_size;u8 vmid_size;u8 ccsize; -u8 ccitmin; +u16 ccitmin;u8 s_ex_level;u8 ns_ex_level;u8 q_support;
Greg Kroah-Hartman
maintainerPATCH 100/100 scripts/decode_stacktrace.sh: optionally use LLVM utilities
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Llamas <[email protected]>
commit efbd6398353315b7018e6943e41fee9ec35e875f upstream.
GNU's addr2line can have problems parsing a vmlinux built with LLVM, particularly when LTO was used. In order to decode the traces correctly this patch adds the ability to switch to LLVM's utilities readelf and addr2line. The same approach is followed by Will in [1].
Before:
$ scripts/decode_stacktrace.sh vmlinux < kernel.log [17716.240635] Call trace: [17716.240646] skb_cow_data (??:?) [17716.240654] esp6_input (ld-temp.o:?) [17716.240666] xfrm_input (ld-temp.o:?) [17716.240674] xfrm6_rcv (??:?) [...]
After:
$ LLVM=1 scripts/decode_stacktrace.sh vmlinux < kernel.log [17716.240635] Call trace: [17716.240646] skb_cow_data (include/linux/skbuff.h:2172 net/core/skbuff.c:4503) [17716.240654] esp6_input (net/ipv6/esp6.c:977) [17716.240666] xfrm_input (net/xfrm/xfrm_input.c:659) [17716.240674] xfrm6_rcv (net/ipv6/xfrm6_input.c:172) [...]
Note that one could set CROSS_COMPILE=llvm- instead to hack around this issue. However, doing so can break the decodecode routine as it will force the selection of other LLVM utilities down the line e.g. llvm-as.
[1] https://lore.kernel.org/all/[email protected]/
--- scripts/decode_stacktrace.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
scripts/decode_stacktrace.sh +17 -2
@@ -16,6 +16,21 @@ elif type c++filt >/dev/null 2>&1 ; then cppfilt_opts=-i fi +UTIL_SUFFIX= +if [[ -z ${LLVM:-} ]]; then + UTIL_PREFIX=${CROSS_COMPILE:-} +else + UTIL_PREFIX=llvm- + if [[ ${LLVM} == */ ]]; then + UTIL_PREFIX=${LLVM}${UTIL_PREFIX} + elif [[ ${LLVM} == -* ]]; then + UTIL_SUFFIX=${LLVM} + fi +fi + +READELF=${UTIL_PREFIX}readelf${UTIL_SUFFIX} +ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX} + if [[ $1 == "-r" ]] ; then vmlinux="" basepath="auto"
@@ -75,7 +90,7 @@ find_module() { if [[ "$modpath" != "" ]] ; then for fn in $(find "$modpath" -name "${module//_/[-_]}.ko*") ; do - if readelf -WS "$fn" | grep -qwF .debug_line ; then + if ${READELF} -WS "$fn" | grep -qwF .debug_line ; then echo $fn return fi
@@ -169,7 +184,7 @@ parse_symbol() { if [[ $aarray_support == true && "${cache[$module,$address]+isset}" == "isset" ]]; then local code=${cache[$module,$address]} else - local code=$(${CROSS_COMPILE}addr2line -i -e "$objfile" "$address" 2>/dev/null) + local code=$(${ADDR2LINE} -i -e "$objfile" "$address" 2>/dev/null) if [[ $aarray_support == true ]]; then cache[$module,$address]=$code fi
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-6.1.y
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Hello,
Quoted 5 lines · On Thu, 18 Jan 2024 11:48:08 +0100 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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.
Quoted 8 lines
Responses should be made by Sat, 20 Jan 2024 10:42:49 +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/v6.x/stable-review/patch-6.1.74-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.
This rc kernel passes DAMON functionality test[1] on my test machine. Attaching the test results summary below. Please note that I retrieved the kernel from linux-stable-rc tree[2].
[1] https://github.com/awslabs/damon-tests/tree/next/corr
[2] 1ffea4b3e361 ("Linux 6.1.74-rc1")
Thanks,
SJ
[...]
---
ok 1 selftests: damon: debugfs_attrs.sh
ok 2 selftests: damon: debugfs_schemes.sh
ok 3 selftests: damon: debugfs_target_ids.sh
ok 4 selftests: damon: debugfs_empty_targets.sh
ok 5 selftests: damon: debugfs_huge_count_read_write.sh
ok 6 selftests: damon: debugfs_duplicate_context_creation.sh
ok 7 selftests: damon: sysfs.sh
ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh
ok 12 selftests: damon-tests: build_m68k.sh
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
[33m
[92mPASS [39m
+Stefan,
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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, 20 Jan 2024 10:42:49 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.74-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
ARM and ARM64 builds worked fine and passed tests, however BMIPS_GENERIC fails to build with:
arch/mips/kernel/smp.c: In function 'start_secondary':arch/mips/kernel/smp.c:340:2: error: implicit declaration of function 'rcutree_report_cpu_starting'; did you mean 'rcu_cpu_starting'? [-Werror=implicit-function-declaration]
rcutree_report_cpu_starting(cpu);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
rcu_cpu_starting
cc1: all warnings being treated as errors
host-make[5]: *** [scripts/Makefile.build:250: arch/mips/kernel/smp.o] Error 1
host-make[4]: *** [scripts/Makefile.build:500: arch/mips/kernel] Error 2
host-make[3]: *** [scripts/Makefile.build:500: arch/mips] Error 2
host-make[3]: *** Waiting for unfinished jobs....
which is caused by 7c20a4cc189eff36d5aeb586008a540d8024fbff ("mips/smp: Call rcutree_report_cpu_starting() earlier").
It looks like rcutree_report_cpu_starting() has been introduced 448e9f34d91d1a4799fdb06a93c2c24b34b6fd9d ("rcu: Standardize explicit CPU-hotplug calls") which is in v6.7.
For MIPS, it would like an adequate fix would be to 's/rcutree_report_cpu_starting/rcu_cpu_starting/' for the 6.1 and 6.6 branches.
Stefan, do you agree?
Signature · 1 line
Florian
Quoted 18 lines · Florian Fainelli
+Stefan,
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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, 20 Jan 2024 10:42:49 +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/v6.x/stable-review/patch-6.1.74-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.
Quoted 6 lines
Quoted 3 lines
thanks,
greg k-h
ARM and ARM64 builds worked fine and passed tests, however
BMIPS_GENERICfails to build with:
Following MIPS builds failed on 6.6.y and 6.1.y but passed 6.7.y and Linux-next and mainline builds.
mips:
* build/clang-17-defconfig
* build/clang-nightly-defconfig
* build/gcc-12-allmodconfig
* build/gcc-12-cavium_octeon_defconfig
* build/gcc-12-defconfig
* build/gcc-12-malta_defconfig
* build/gcc-8-allmodconfig
* build/gcc-8-cavium_octeon_defconfig
* build/gcc-8-defconfig
* build/gcc-8-malta_defconfig
Quoted 10 lines
arch/mips/kernel/smp.c: In function 'start_secondary':arch/mips/kernel/smp.c:340:2: error: implicit declaration of function 'rcutree_report_cpu_starting'; did you mean 'rcu_cpu_starting'? [-Werror=implicit-function-declaration]rcutree_report_cpu_starting(cpu); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ rcu_cpu_startingcc1: all warnings being treated as errors
host-make[5]: *** [scripts/Makefile.build:250:arch/mips/kernel/smp.o]
same here,
Quoted 8 lines
which is caused by
7c20a4cc189eff36d5aeb586008a540d8024fbff("mips/smp:
Callrcutree_report_cpu_starting()earlier").It looks like
rcutree_report_cpu_starting()has been introduced448e9f34d91d1a4799fdb06a93c2c24b34b6fd9d("rcu: Standardize explicit CPU-hotplug calls") which is in v6.7.
Quoted 7 lines
For MIPS, it would like an adequate fix would be to 's/rcutree_report_cpu_starting/rcu_cpu_starting/' for the 6.1 and 6.6 branches.
Stefan, do you agree?
--
Florian
--
Linaro LKFT
https://lkft.linaro.org
Greg Kroah-Hartman
maintainerQuoted 45 lines · Florian Fainelli
+Stefan,
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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, 20 Jan 2024 10:42:49 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.74-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
ARM and ARM64 builds worked fine and passed tests, however
BMIPS_GENERICfails to build with:
arch/mips/kernel/smp.c: In function 'start_secondary':arch/mips/kernel/smp.c:340:2: error: implicit declaration of function 'rcutree_report_cpu_starting'; did you mean 'rcu_cpu_starting'? [-Werror=implicit-function-declaration]
rcutree_report_cpu_starting(cpu);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
rcu_cpu_starting
cc1: all warnings being treated as errors
host-make[5]: *** [scripts/Makefile.build:250:arch/mips/kernel/smp.o] Error 1
host-make[4]: *** [scripts/Makefile.build:500:arch/mips/kernel] Error 2 host-make[3]: *** [scripts/Makefile.build:500:arch/mips] Error 2 host-make[3]: *** Waiting for unfinished jobs....which is caused by
7c20a4cc189eff36d5aeb586008a540d8024fbff("mips/smp: Callrcutree_report_cpu_starting()earlier").It looks like
rcutree_report_cpu_starting()has been introduced448e9f34d91d1a4799fdb06a93c2c24b34b6fd9d("rcu: Standardize explicit CPU-hotplug calls") which is in v6.7.
Quoted 5 lines
For MIPS, it would like an adequate fix would be to 's/rcutree_report_cpu_starting/rcu_cpu_starting/' for the 6.1 and 6.6 branches.
Stefan, do you agree?
The offending commit has been dropped from the queue, sorry, I didn't push out a new -rc yet.
greg k-h
Hi Florian,
Quoted 9 lines
It looks like
rcutree_report_cpu_starting()has been introduced448e9f34d91d1a4799fdb06a93c2c24b34b6fd9d("rcu: Standardize explicit CPU-hotplug calls") which is in v6.7.For MIPS, it would like an adequate fix would be to 's/rcutree_report_cpu_starting/rcu_cpu_starting/' for the 6.1 and 6.6 branches.
Stefan, do you agree?
Yes, I agree, that is also how the patch looks like in our internal branch based on 5.15.
Kind regards,
Stefan
Greg Kroah-Hartman
maintainerQuoted 6 lines · Stefan Wiehler
Hi Florian,
Quoted 4 lines
It looks like
rcutree_report_cpu_starting()has been introduced448e9f34d91d1a4799fdb06a93c2c24b34b6fd9d("rcu: Standardize explicit CPU-hotplug calls") which is in v6.7.
Quoted 8 lines
Quoted 5 lines
For MIPS, it would like an adequate fix would be to 's/rcutree_report_cpu_starting/rcu_cpu_starting/' for the 6.1 and 6.6 branches.
Stefan, do you agree?
Yes, I agree, that is also how the patch looks like in our internal branch based on 5.15.
Great, can someone send a working version of this patch for us to apply for the next round of releases? It's dropped from all queues right now.
thanks,
greg k-h
PATCH 1/1 mips/smp: Call rcu_cpu_starting() earlier
rcu_cpu_starting() must be called before clockevents_register_device() to avoid the following lockdep splat triggered by calling list_add() when CONFIG_PROVE_RCU_LIST=y:
WARNING: suspicious RCU usage
...
-----------------------------
kernel/locking/lockdep.c:3680 RCU-list traversed in non-reader section!!
other info that might help us debug this:
RCU used illegally from offline CPU!
rcu_scheduler_active = 1, debug_locks = 1
no locks held by swapper/1/0.
...
Call Trace: [<ffffffff8012a434>] show_stack+0x64/0x158 [<ffffffff80a93d98>] dump_stack_lvl+0x90/0xc4 [<ffffffff801c9e9c>] __lock_acquire+0x1404/0x2940 [<ffffffff801cbf3c>] lock_acquire+0x14c/0x448 [<ffffffff80aa4260>] _raw_spin_lock_irqsave+0x50/0x88 [<ffffffff8021e0c8>] clockevents_register_device+0x60/0x1e8 [<ffffffff80130ff0>] r4k_clockevent_init+0x220/0x3a0 [<ffffffff801339d0>] start_secondary+0x50/0x3b8
raw_smp_processor_id() is required in order to avoid calling into lockdep before RCU has declared the CPU to be watched for readers.
See also commit 29368e093921 ("x86/smpboot: Move rcu_cpu_starting() earlier"), commit de5d9dae150c ("s390/smp: move rcu_cpu_starting() earlier") and commit 99f070b62322 ("powerpc/smp: Call rcu_cpu_starting() earlier").
--- arch/mips/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/smp.c +2 -2
@@ -351,10 +351,11 @@ early_initcall(mips_smp_ipi_init);*/ asmlinkage void start_secondary(void) { -unsigned int cpu; +unsigned int cpu =raw_smp_processor_id ();cpu_probe ();per_cpu_trap_init (false); +rcu_cpu_starting (cpu);mips_clockevent_init (); mp_ops->init_secondary ();cpu_report ();
@@ -366,7 +367,6 @@ asmlinkage void start_secondary(void)*/ calibrate_delay (); - cpu =smp_processor_id (); cpu_data[cpu].udelay_val = loops_per_jiffy;set_cpu_sibling_map (cpu);
Signature · 1 line
2.42.0
kernel test robot
build botRe: [PATCH] mips/smp: Call rcu_cpu_starting() earlier
FYI: kernel test robot notices the stable kernel rule is not satisfied.
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: [email protected]" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH] mips/smp: Call rcu_cpu_starting() earlier
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Greg Kroah-Hartman
maintainerRe: [PATCH] mips/smp: Call rcu_cpu_starting() earlier
In reply to Stefan WiehlerQuoted 32 lines · Stefan Wiehler
rcu_cpu_starting()must be called beforeclockevents_register_device()to avoid the following lockdep splat triggered by callinglist_add()whenCONFIG_PROVE_RCU_LIST=y:WARNING: suspicious RCU usage
...
-----------------------------
kernel/locking/lockdep.c:3680RCU-list traversed in non-reader section!!other info that might help us debug this:
RCU used illegally from offline CPU!
rcu_scheduler_active= 1,debug_locks= 1
no locks held by swapper/1/0.
...Call Trace: [<ffffffff8012a434>] show_stack+0x64/0x158 [<ffffffff80a93d98>] dump_stack_lvl+0x90/0xc4 [<ffffffff801c9e9c>] __lock_acquire+0x1404/0x2940 [<ffffffff801cbf3c>] lock_acquire+0x14c/0x448 [<ffffffff80aa4260>] _raw_spin_lock_irqsave+0x50/0x88 [<ffffffff8021e0c8>] clockevents_register_device+0x60/0x1e8 [<ffffffff80130ff0>] r4k_clockevent_init+0x220/0x3a0 [<ffffffff801339d0>] start_secondary+0x50/0x3b8
raw_smp_processor_id()is required in order to avoid calling into lockdep before RCU has declared the CPU to be watched for readers.See also commit
29368e093921("x86/smpboot: Movercu_cpu_starting()earlier"), commitde5d9dae150c("s390/smp: movercu_cpu_starting()earlier") and commit99f070b62322("powerpc/smp: Callrcu_cpu_starting()earlier").
Quoted 6 lines
Signed-off-by Stefan Wiehler <[email protected]>Reviewed-by Huacai Chen <[email protected]>Signed-off-by Thomas Bogendoerfer <[email protected]>--- arch/mips/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
What is the git commit id of this change in Linus's tree? What kernel(s) should this be applied to?
thanks,
greg k-h
Re: [PATCH] mips/smp: Call rcu_cpu_starting() earlier
Quoted 40 lines · Greg Kroah-Hartman
Quoted 32 lines · Stefan Wiehler
rcu_cpu_starting()must be called beforeclockevents_register_device()to avoid the following lockdep splat triggered by callinglist_add()whenCONFIG_PROVE_RCU_LIST=y:WARNING: suspicious RCU usage ... ----------------------------- kernel/locking/lockdep.c:3680 RCU-list traversed in non-reader section!! other info that might help us debug this: RCU used illegally from offline CPU! rcu_scheduler_active = 1, debug_locks = 1 no locks held by swapper/1/0. ... Call Trace: [<ffffffff8012a434>] show_stack+0x64/0x158 [<ffffffff80a93d98>] dump_stack_lvl+0x90/0xc4 [<ffffffff801c9e9c>] __lock_acquire+0x1404/0x2940 [<ffffffff801cbf3c>] lock_acquire+0x14c/0x448 [<ffffffff80aa4260>] _raw_spin_lock_irqsave+0x50/0x88 [<ffffffff8021e0c8>] clockevents_register_device+0x60/0x1e8 [<ffffffff80130ff0>] r4k_clockevent_init+0x220/0x3a0 [<ffffffff801339d0>] start_secondary+0x50/0x3b8
raw_smp_processor_id()is required in order to avoid calling into lockdep before RCU has declared the CPU to be watched for readers.See also commit
29368e093921("x86/smpboot: Movercu_cpu_starting()earlier"), commitde5d9dae150c("s390/smp: movercu_cpu_starting()earlier") and commit99f070b62322("powerpc/smp: Callrcu_cpu_starting()earlier").Quoted 6 lines
Signed-off-by Stefan Wiehler <[email protected]>Reviewed-by Huacai Chen <[email protected]>Signed-off-by Thomas Bogendoerfer <[email protected]>--- arch/mips/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 2 lines
What is the git commit id of this change in Linus's tree? What kernel(s) should this be applied to?
The upstream commit is 55702ec9603ebeffb15e6f7b113623fe1d8872f4 ("mips/smp: Call rcutree_report_cpu_starting() earlier") and this change from Stefan should be applied to both the 6.1 stable and 6.6 stable branches. Thanks!
Signature · 1 line
Florian
Greg Kroah-Hartman
maintainerRe: [PATCH] mips/smp: Call rcu_cpu_starting() earlier
Quoted 43 lines · Florian Fainelli
Quoted 40 lines · Greg Kroah-Hartman
Quoted 38 lines · Stefan Wiehler
rcu_cpu_starting()must be called beforeclockevents_register_device()to avoid the following lockdep splat triggered by callinglist_add()whenCONFIG_PROVE_RCU_LIST=y:WARNING: suspicious RCU usage ... ----------------------------- kernel/locking/lockdep.c:3680 RCU-list traversed in non-reader section!! other info that might help us debug this: RCU used illegally from offline CPU! rcu_scheduler_active = 1, debug_locks = 1 no locks held by swapper/1/0. ... Call Trace: [<ffffffff8012a434>] show_stack+0x64/0x158 [<ffffffff80a93d98>] dump_stack_lvl+0x90/0xc4 [<ffffffff801c9e9c>] __lock_acquire+0x1404/0x2940 [<ffffffff801cbf3c>] lock_acquire+0x14c/0x448 [<ffffffff80aa4260>] _raw_spin_lock_irqsave+0x50/0x88 [<ffffffff8021e0c8>] clockevents_register_device+0x60/0x1e8 [<ffffffff80130ff0>] r4k_clockevent_init+0x220/0x3a0 [<ffffffff801339d0>] start_secondary+0x50/0x3b8
raw_smp_processor_id()is required in order to avoid calling into lockdep before RCU has declared the CPU to be watched for readers.See also commit
29368e093921("x86/smpboot: Movercu_cpu_starting()earlier"), commitde5d9dae150c("s390/smp: movercu_cpu_starting()earlier") and commit99f070b62322("powerpc/smp: Callrcu_cpu_starting()earlier").Signed-off-by Stefan Wiehler <[email protected]>Reviewed-by Huacai Chen <[email protected]>Signed-off-by Thomas Bogendoerfer <[email protected]>--- arch/mips/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 2 lines
What is the git commit id of this change in Linus's tree? What kernel(s) should this be applied to?
The upstream commit is
55702ec9603ebeffb15e6f7b113623fe1d8872f4("mips/smp:
Callrcutree_report_cpu_starting()earlier") and this change from Stefan should be applied to both the 6.1 stable and 6.6 stable branches. Thanks!
Thanks, now queued up.
greg k-h
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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.
Builds and works fine for me on x86_64.
Cheers,
Sven
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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, 20 Jan 2024 10:42:49 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.74-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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, 20 Jan 2024 10:42:49 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.74-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my x86_64 and ARM64 test systems. No errors or regressions.
Thanks.
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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, 20 Jan 2024 10:42:49 +0000. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.74-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
I tested 6.1.74-rc1 (1ffea4b3e361) on Kalray kvx arch (not upstream yet), just to let you know everything works in our CI.
It ran on real hw (k200 and k200lp boards), on qemu as well as on our internal instruction set simulator (ISS).
Tests were run on several interfaces/drivers (usb, qsfp ethernet, eMMC, PCIe endpoint+RC, SPI, remoteproc, uart, iommu). LTP and uClibc-ng testsuites are also run without any regression.
Everything looks fine to us.
Thanks a lot!
--
Yann
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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, 20 Jan 2024 10:42:49 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.74-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v6.1:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 116 pass, 0 failLinux version: 6.1.74-rc1-g1ffea4b3e361
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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, 20 Jan 2024 10:42:49 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.74-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.74 release. There are 100 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.
Built and QEMU-booted for Rust:
Including checking that --lang_exclude=rust is passed as expected with a new-enough pahole.
Cheers,
Miguel