6.0.10-rc1 review
Subsystems (7)
Greg Kroah-Hartman
maintainercover 6.0.10-rc1 review
This is the start of the stable review cycle for the 6.0.10 release. There are 314 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 Fri, 25 Nov 2022 08:45:20 +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.0.10-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.0.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.0.10-rc1
Hawkins Jiawei <[email protected]>
ntfs: check overflow when iterating ATTR_RECORDs
Hawkins Jiawei <[email protected]>
ntfs: fix out-of-bounds read in ntfs_attr_find()
Hawkins Jiawei <[email protected]>
ntfs: fix use-after-free in ntfs_attr_find()
Jiri Olsa <[email protected]>
bpf: Prevent bpf program recursion for raw tracepoint probes
Dominique Martinet <[email protected]>
net/9p: use a dedicated spinlock for trans_fd
Alexander Potapenko <[email protected]>
mm: fs: initialize fsdata passed to write_begin/write_end interface
Mathieu Desnoyers <[email protected]>
rseq: Use pr_warn_once() when deprecated/unknown ABI flags are encountered
Hawkins Jiawei <[email protected]>
wifi: wext: use flex array destination for memcpy()
Kees Cook <[email protected]>
netlink: Bounds-check struct nlmsgerr creation
Tetsuo Handa <[email protected]>
9p/trans_fd: always use O_NONBLOCK read/write
Andreas Gruenbacher <[email protected]>
gfs2: Switch from strlcpy to strscpy
Andrew Price <[email protected]>
gfs2: Check sb_bsize_shift after reading superblock
Dominique Martinet <[email protected]>
9p: trans_fd/p9_conn_cancel: drop client lock earlier
Eiichi Tsukata <[email protected]>
KVM: x86/xen: Fix eventfd error handling in kvm_xen_eventfd_assign()
Eric Dumazet <[email protected]>
kcm: avoid potential race in kcm_tx_work
Eric Dumazet <[email protected]>
tcp: cdg: allow tcp_cdg_release() to be called multiple times
Eric Dumazet <[email protected]>
macvlan: enforce a consistent minimal mtu
Chen Jun <[email protected]>
Input: i8042 - fix leaking of platform device on module removal
Liu Shixin <[email protected]>
arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud
Zheng Yejian <[email protected]>
tracing: Fix potential null-pointer-access of entry in list 'tr->err_log'
Li Huafei <[email protected]>
kprobes: Skip clearing aggrprobe's post_handler in kprobe-on-ftrace case
Yuan Can <[email protected]>
scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper()
Yang Yingliang <[email protected]>
scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus()
Hangbin Liu <[email protected]>
net: use struct_group to copy ip/ipv6 header addresses
Alexandru Tachici <[email protected]>
net: usb: smsc95xx: fix external PHY reset
Aashish Sharma <[email protected]>
tracing: Fix warning on variable 'struct trace_array'
Steven Rostedt (Google) <[email protected]>
ring-buffer: Include dropped pages in counting dirty patches
Ravi Bangoria <[email protected]>
perf/x86/amd: Fix crash due to race between amd_pmu_enable_all, perf NMI and throttling
Jason Gunthorpe <[email protected]>
vfio: Split the register_device ops call into functions
Jason Gunthorpe <[email protected]>
vfio: Rename vfio_ioctl_check_extension()
Marco Elver <[email protected]>
perf: Improve missing SIGTRAP checking
Peter Ujfalusi <[email protected]>
ASoC: SOF: topology: No need to assign core ID if token parsing failed
Keith Busch <[email protected]>
nvme: ensure subsystem reset is single threaded
Keith Busch <[email protected]>
nvme: restrict management ioctls to admin
Adrian Hunter <[email protected]>
perf/x86/intel/pt: Fix sampling using single range output
Sandipan Das <[email protected]>
perf/x86/amd/uncore: Fix memory leak for events array
Mel Gorman <[email protected]>
x86/fpu: Drop fpregs lock before inheriting FPU permissions
Borys Popławski <[email protected]>
x86/sgx: Add overflow check in sgx_validate_offset_length()
Chris Mason <[email protected]>
blk-cgroup: properly pin the parent in blkcg_css_online
Alexander Potapenko <[email protected]>
misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram()
Gerald Schaefer <[email protected]>
s390/dcssblk: fix deadlock when adding a DCSS
Akira Yokosawa <[email protected]>
docs/driver-api/miscellaneous: Remove kernel-doc of serial_core.c
Shuah Khan <[email protected]>
docs: update mediator contact information in CoC doc
Xiongfeng Wang <[email protected]>
mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put()
Chevron Li <[email protected]>
mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout
Yann Gautier <[email protected]>
mmc: core: properly select voltage range without power cycle
Brian Norris <[email protected]>
firmware: coreboot: Register bus in module init
Tina Zhang <[email protected]>
iommu/vt-d: Set SRE bit only when hardware has SRS cap
Tina Zhang <[email protected]>
iommu/vt-d: Preset Access bit for IOVA in FL non-leaf paging entries
Benjamin Block <[email protected]>
scsi: zfcp: Fix double free of FSF request when qdio send fails
Aminuddin Jamaluddin <[email protected]>
net: phy: marvell: add sleep time after enabling the loopback bit
Alban Crequy <[email protected]>
maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault()
Tetsuo Handa <[email protected]>
Input: iforce - invert valid length check when fetching device IDs
Xiubo Li <[email protected]>
ceph: avoid putting the realm twice when decoding snaps fails
Pavel Begunkov <[email protected]>
io_uring: disallow self-propelled ring polling
Pavel Begunkov <[email protected]>
io_uring: fix multishot recv request leaks
Pavel Begunkov <[email protected]>
io_uring: fix multishot accept request leaks
Pavel Begunkov <[email protected]>
io_uring: fix tw losing poll events
Ilpo Järvinen <[email protected]>
serial: 8250_lpss: Use 16B DMA burst with Elkhart Lake
Ilpo Järvinen <[email protected]>
serial: 8250_lpss: Configure DMA also w/o DMA filter
Ilpo Järvinen <[email protected]>
serial: 8250: Flush DMA Rx on RLSI
Ilpo Järvinen <[email protected]>
serial: 8250: Fall back to non-DMA Rx if IIR_RDI occurs
Mikulas Patocka <[email protected]>
dm ioctl: fix misbehavior if list_versions races with module loading
Zhihao Cheng <[email protected]>
dm bufio: Fix missing decrement of no_sleep_enabled if dm_bufio_client_create failed
Mitja Spes <[email protected]>
iio: pressure: ms5611: changed hardcoded SPI speed to value limited
Mitja Spes <[email protected]>
iio: pressure: ms5611: fixed value compensation bug
Saravanan Sekar <[email protected]>
iio: adc: mp2629: fix potential array out of bound access
Saravanan Sekar <[email protected]>
iio: adc: mp2629: fix wrong comparison of channel
Yang Yingliang <[email protected]>
iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init()
Yang Yingliang <[email protected]>
iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger()
Jonathan Cameron <[email protected]>
iio: accel: bma400: Ensure VDDIO is enable defore reading the chip ID.
Sven Peter <[email protected]>
usb: typec: tipd: Prevent uninitialized event{1,2} in IRQ handler
Rajat Khandelwal <[email protected]>
usb: typec: mux: Enter safe mode only when pins need to be reconfigured
Li Jun <[email protected]>
usb: cdns3: host: fix endless superspeed hub port reset
Duoming Zhou <[email protected]>
usb: chipidea: fix deadlock in ci_otg_del_timer
Nicolas Dumazet <[email protected]>
usb: add NO_LPM quirk for Realforce 87U Keyboard
Reinhard Speyerer <[email protected]>
USB: serial: option: add Fibocom FM160 0x0111 composition
Davide Tronchin <[email protected]>
USB: serial: option: add u-blox LARA-L6 modem
Davide Tronchin <[email protected]>
USB: serial: option: add u-blox LARA-R6 00B modem
Davide Tronchin <[email protected]>
USB: serial: option: remove old LARA-R6 PID
Benoît Monin <[email protected]>
USB: serial: option: add Sierra Wireless EM9191
Linus Walleij <[email protected]>
USB: bcma: Make GPIO explicitly optional
Đoàn Trần Công Danh <[email protected]>
speakup: replace utils' u_char with unsigned char
Mushahid Hussain <[email protected]>
speakup: fix a segfault caused by switching consoles
Krzysztof Kozlowski <[email protected]>
slimbus: stream: correct presence rate frequencies
Zheng Bin <[email protected]>
slimbus: qcom-ngd: Fix build error when CONFIG_SLIM_QCOM_NGD_CTRL=y && CONFIG_QCOM_RPROC_COMMON=m
Tiago Dias Ferreira <[email protected]>
nvme-pci: add NVME_QUIRK_BOGUS_NID for Netac NV7000
Bean Huo <[email protected]>
nvme-pci: add NVME_QUIRK_BOGUS_NID for Micron Nitro
Pavel Begunkov <[email protected]>
io_uring: update res mask in io_poll_check_events
Janne Grunau <[email protected]>
usb: dwc3: Do not get extcon device when usb-role-switch is used
Johan Hovold <[email protected]>
Revert "usb: dwc3: disable USB core PHY management"
Takashi Iwai <[email protected]>
ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
Emil Flink <[email protected]>
ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro
Takashi Iwai <[email protected]>
ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open()
Dillon Varone <[email protected]>
drm/amd/display: Fix prefetch calculations for dcn32
Melissa Wen <[email protected]>
drm/amd/display: don't enable DRM CRTC degamma property for DCE
Roman Li <[email protected]>
drm/amd/display: Fix optc2_configure warning on dcn314
George Shen <[email protected]>
drm/amd/display: Support parsing VRAM info v3.0 from VBIOS
Stylon Wang <[email protected]>
drm/amd/display: Fix access timeout to DPIA AUX at boot time
Rodrigo Siqueira <[email protected]>
drm/amd/display: Add HUBP surface flip interrupt handler
Stylon Wang <[email protected]>
drm/amd/display: Fix invalid DPIA AUX reply causing system hang
Simon Rettberg <[email protected]>
drm/display: Don't assume dual mode adaptors support i2c sub-addressing
Evan Quan <[email protected]>
drm/amd/pm: fix SMU13 runpm hang due to unintentional workaround
Evan Quan <[email protected]>
drm/amd/pm: enable runpm support over BACO for SMU13.0.0
Evan Quan <[email protected]>
drm/amd/pm: enable runpm support over BACO for SMU13.0.7
Shyam Sundar S K <[email protected]>
platform/x86/amd: pmc: Add new ACPI ID AMDI0009
Mario Limonciello <[email protected]>
platform/x86/amd: pmc: Remove more CONFIG_DEBUG_FS checks
Yi Yang <[email protected]>
rethook: fix a potential memleak in rethook_alloc()
Shang XiaoJing <[email protected]>
tracing: kprobe: Fix potential null-ptr-deref on trace_array in kprobe_event_gen_test_exit()
Shang XiaoJing <[email protected]>
tracing: kprobe: Fix potential null-ptr-deref on trace_event_file in kprobe_event_gen_test_exit()
Steven Rostedt (Google) <[email protected]>
tracing: Fix race where eprobes can be called before the event
Shang XiaoJing <[email protected]>
tracing: Fix wild-memory-access in register_synth_event()
Shang XiaoJing <[email protected]>
tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event()
Steven Rostedt (Google) <[email protected]>
tracing/ring-buffer: Have polling block on watermark
Wang Yufen <[email protected]>
tracing: Fix memory leak in tracing_read_pipe()
Daniil Tatianin <[email protected]>
ring_buffer: Do not deactivate non-existant pages
Xiu Jianfeng <[email protected]>
ftrace: Fix null pointer dereference in ftrace_add_mod()
Wang Wensheng <[email protected]>
ftrace: Optimize the allocation for mcount entries
Wang Wensheng <[email protected]>
ftrace: Fix the possible incorrect kernel message
Keith Busch <[email protected]>
dm-crypt: provide dma_alignment limit in io_hints
Keith Busch <[email protected]>
block: make dma_alignment a stacking queue_limit
Wang Yufen <[email protected]>
netdevsim: Fix memory leak of nsim_dev->fa_cookie
Anastasia Belova <[email protected]>
cifs: add check for returning value of SMB2_set_info_init
Vasily Gorbik <[email protected]>
s390: avoid using global register for current_stack_pointer
Yuan Can <[email protected]>
net: thunderbolt: Fix error handling in tbnet_init()
Shang XiaoJing <[email protected]>
net: microchip: sparx5: Fix potential null-ptr-deref in sparx_stats_init() and sparx5_start()
Shang XiaoJing <[email protected]>
net: lan966x: Fix potential null-ptr-deref in lan966x_stats_init()
Zhang Xiaoxu <[email protected]>
cifs: Fix wrong return value checking when GETFLAGS
Sagi Grimberg <[email protected]>
nvmet: fix a memory leak in nvmet_auth_set_key
Vladimir Oltean <[email protected]>
net: dsa: don't leak tagger-owned storage on switch driver unbind
Wei Yongjun <[email protected]>
net/x25: Fix skb leak in x25_lapb_receive_frame()
Liu Jian <[email protected]>
net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
Anastasia Belova <[email protected]>
cifs: add check for returning value of SMB2_close_init
David Howells <[email protected]>
netfs: Fix dodgy maths
David Howells <[email protected]>
netfs: Fix missing xas_retry() calls in xarray iteration
Maximilian Luz <[email protected]>
platform/surface: aggregator: Do not check for repeated unsequenced packets
Roger Pau Monné <[email protected]>
platform/x86/intel: pmc: Don't unconditionally attach Intel PMC when virtualized
Dan Carpenter <[email protected]>
drbd: use after free in drbd_create_device()
Ido Schimmel <[email protected]>
bridge: switchdev: Fix memory leaks when changing VLAN protocol
Guangbin Huang <[email protected]>
net: hns3: fix setting incorrect phy link ksettings for firmware in resetting process
Jie Wang <[email protected]>
net: hns3: fix return value check bug of rx copybreak
Jian Shen <[email protected]>
net: hns3: fix incorrect hw rss hash type of rx packet
Yuan Can <[email protected]>
net: ena: Fix error handling in ena_init()
Cong Wang <[email protected]>
kcm: close race conditions on sk_receive_queue
Yuan Can <[email protected]>
net: ionic: Fix error handling in ionic_init_module()
Amit Cohen <[email protected]>
mlxsw: Avoid warnings when not offloaded FDB entry with IPv6 is removed
Jingbo Xu <[email protected]>
erofs: fix missing xas_retry() in fscache mode
Yang Yingliang <[email protected]>
xen/pcpu: fix possible memory leak in register_pcpu()
Vladimir Oltean <[email protected]>
net: dsa: make dsa_master_ioctl() see through port_hwtstamp_get() shims
Wei Yongjun <[email protected]>
net: mhi: Fix memory leak in mhi_net_dellink()
Erico Nunes <[email protected]>
drm/lima: Fix opp clkname setting in case of missing regulator
Ziyang Xuan <[email protected]>
octeon_ep: ensure get mac address successfully before eth_hw_addr_set()
Ziyang Xuan <[email protected]>
octeon_ep: fix potential memory leak in octep_device_setup()
Ziyang Xuan <[email protected]>
octeon_ep: ensure octep_get_link_status() successfully before octep_link_up()
Ziyang Xuan <[email protected]>
octeon_ep: delete unnecessary napi rollback under set_queues_err in octep_open()
Gaosheng Cui <[email protected]>
bnxt_en: Remove debugfs when pci_register_driver failed
Zhengchao Shao <[email protected]>
net: caif: fix double disconnect client in chnl_net_open()
Chuang Wang <[email protected]>
net: macvlan: Use built-in RCU list checking
Wang ShaoBo <[email protected]>
mISDN: fix misuse of put_device() in mISDN_register_device()
Zhengchao Shao <[email protected]>
net: liquidio: release resources when liquidio driver open failed
Xiaolei Wang <[email protected]>
soc: imx8m: Enable OCOTP clock before reading the register
Jeremy Kerr <[email protected]>
mctp i2c: don't count unused / invalid keys for flow release
Mohd Faizal Abdul Rahim <[email protected]>
net: stmmac: ensure tx function is not running in stmmac_xdp_release()
Michael Sit Wei Hong <[email protected]>
net: phy: dp83867: Fix SGMII FIFO depth for non OF devices
Yuan Can <[email protected]>
net: hinic: Fix error handling in hinic_module_init()
Yang Yingliang <[email protected]>
mISDN: fix possible memory leak in mISDN_dsp_element_register()
Wei Yongjun <[email protected]>
net: bgmac: Drop free_netdev() from bgmac_enet_remove()
Niklas Cassel <[email protected]>
ata: libata-core: do not issue non-internal commands once EH is pending
Xu Kuohai <[email protected]>
bpf: Initialize same number of free nodes for each pcpu_freelist
Zhang Xiaoxu <[email protected]>
cifs: Fix connections leak when tlink setup failed
Pavel Begunkov <[email protected]>
io_uring/poll: fix double poll req->flags races
Liao Chang <[email protected]>
MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed
Rongwei Zhang <[email protected]>
MIPS: fix duplicate definitions for exported symbols
Jaco Coetzee <[email protected]>
nfp: change eeprom length to max length enumerators
Yang Yingliang <[email protected]>
ata: libata-transport: fix error handling in ata_tdev_add()
Yang Yingliang <[email protected]>
ata: libata-transport: fix error handling in ata_tlink_add()
Yang Yingliang <[email protected]>
ata: libata-transport: fix error handling in ata_tport_add()
Yang Yingliang <[email protected]>
ata: libata-transport: fix double ata_host_put() in ata_tport_add()
Peng Fan <[email protected]>
arm64: dts: imx93-pinfunc: drop execution permission
Marek Vasut <[email protected]>
arm64: dts: imx8mn: Fix NAND controller size-cells
Jingbo Xu <[email protected]>
erofs: put metabuf in error path in fscache mode
Marek Vasut <[email protected]>
arm64: dts: imx8mm: Fix NAND controller size-cells
Marek Vasut <[email protected]>
ARM: dts: imx7: Fix NAND controller size-cells
Alexander Stein <[email protected]>
arm64: dts: imx8mm-tqma8mqml-mba8mx: Fix USB DR
Shang XiaoJing <[email protected]>
drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker()
Shang XiaoJing <[email protected]>
drm/drv: Fix potential memory leak in drm_dev_init()
Aishwarya Kothari <[email protected]>
drm/panel: simple: set bpc field for logic technologies displays
Gaosheng Cui <[email protected]>
drm/vc4: kms: Fix IS_ERR() vs NULL check for vc4_kms
Zeng Heng <[email protected]>
pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map
Yang Jihong <[email protected]>
selftests/bpf: Fix test_progs compilation failure in 32-bit arch
Pu Lehui <[email protected]>
selftests/bpf: Fix casting error when cross-compiling test_verifier for 32-bit platforms
Maciej W. Rozycki <[email protected]>
parport_pc: Avoid FIFO port location truncation
Yang Yingliang <[email protected]>
siox: fix possible memory leak in siox_device_add()
Sagi Grimberg <[email protected]>
nvmet: fix a memory leak
D Scott Phillips <[email protected]>
arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro
AngeloGioacchino Del Regno <[email protected]>
pinctrl: mediatek: common-v2: Fix bias-disable for PULL_PU_PD_RSEL_TYPE
Dylan Yudaken <[email protected]>
io_uring: calculate CQEs from the user visible value
Wang Yufen <[email protected]>
bpf: Fix memory leaks in __check_func_call
Jeff Layton <[email protected]>
nfsd: put the export reference in nfsd4_verify_deleg_dentry
Serge Semin <[email protected]>
block: sed-opal: kmalloc the cmd/resp buffers
Jingbo Xu <[email protected]>
erofs: get correct count for unmapped range in fscache mode
Jingbo Xu <[email protected]>
erofs: clean up .read_folio() and .readahead() in fscache mode
Xin Long <[email protected]>
sctp: clear out_curr if all frag chunks of current msg are pruned
Xin Long <[email protected]>
sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent
Yang Yingliang <[email protected]>
scsi: scsi_transport_sas: Fix error handling in sas_phy_add()
Krzysztof Kozlowski <[email protected]>
mtd: onenand: omap2: add dependency on GPMC
Quentin Schulz <[email protected]>
pinctrl: rockchip: list all pins in a possible mux route for PX30
Chen Zhongjin <[email protected]>
ASoC: soc-utils: Remove __exit for snd_soc_util_exit()
Vikas Gupta <[email protected]>
bnxt_en: fix the handling of PCIE-AER
Vikas Gupta <[email protected]>
bnxt_en: refactor bnxt_cancel_reservations()
Baisong Zhong <[email protected]>
bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb()
Jason Montleon <[email protected]>
ASoC: rt5677: fix legacy dai naming
Jason Montleon <[email protected]>
ASoC: rt5514: fix legacy dai naming
Duoming Zhou <[email protected]>
tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send
Shawn Guo <[email protected]>
serial: imx: Add missing .thaw_noirq hook
Sherry Sun <[email protected]>
tty: serial: fsl_lpuart: don't break the on-going transfer when global reset
Tony Lindgren <[email protected]>
serial: 8250: omap: Flush PM QOS work on remove
Tony Lindgren <[email protected]>
serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove()
Matthias Schiffer <[email protected]>
serial: 8250_omap: remove wait loop from Errata i202 workaround
Tony Lindgren <[email protected]>
serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl()
Claudiu Beznea <[email protected]>
ARM: at91: pm: avoid soft resetting AC DLL
Martin Povišer <[email protected]>
ASoC: tas2780: Fix set_tdm_slot in case of single slot
Martin Povišer <[email protected]>
ASoC: tas2764: Fix set_tdm_slot in case of single slot
Martin Povišer <[email protected]>
ASoC: tas2770: Fix set_tdm_slot in case of single slot
Ulf Hansson <[email protected]>
arm64: dts: qcom: sm8250: Disable the not yet supported cluster idle state
Maarten Zanders <[email protected]>
ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N
Chen Zhongjin <[email protected]>
ASoC: core: Fix use-after-free in snd_soc_exit()
Mihai Sain <[email protected]>
ARM: dts: at91: sama7g5: fix signal name of pin PB2
Marek Vasut <[email protected]>
spi: stm32: Print summary 'callbacks suppressed' message
Satya Priya <[email protected]>
arm64: dts: qcom: sc7280: Add the reset reg for lpass audiocc on SC7280
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8280xp: fix UFS PHY serdes size
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8280xp: drop broken DP PHY nodes
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8280xp: fix USB PHY PCS registers
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8280xp: fix USB1 PHY RX1 registers
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8280xp: fix USB0 PHY PCS_MISC registers
Brian Masney <[email protected]>
arm64: dts: qcom: sc8280xp: correct ref clock for ufs_mem_phy
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8280xp: fix ufs_card_phy ref clock
Douglas Anderson <[email protected]>
arm64: dts: qcom: sm8350-hdk: Specify which LDO modes are allowed
Douglas Anderson <[email protected]>
arm64: dts: qcom: sm8250-xperia-edo: Specify which LDO modes are allowed
Douglas Anderson <[email protected]>
arm64: dts: qcom: sm8150-xperia-kumano: Specify which LDO modes are allowed
Douglas Anderson <[email protected]>
arm64: dts: qcom: sc8280xp-crd: Specify which LDO modes are allowed
Douglas Anderson <[email protected]>
arm64: dts: qcom: sa8295p-adp: Specify which LDO modes are allowed
Douglas Anderson <[email protected]>
arm64: dts: qcom: sa8155p-adp: Specify which LDO modes are allowed
Robert Marko <[email protected]>
arm64: dts: qcom: ipq8074: correct APCS register space size
Paolo Bonzini <[email protected]>
KVM: SVM: move MSR_IA32_SPEC_CTRL save/restore to assembly
Paolo Bonzini <[email protected]>
KVM: SVM: restore host save area from assembly
Paolo Bonzini <[email protected]>
KVM: SVM: do not allocate struct svm_cpu_data dynamically
Paolo Bonzini <[email protected]>
KVM: SVM: remove dead field from struct svm_cpu_data
James Houghton <[email protected]>
hugetlbfs: don't delete error page from pagecache
Mike Kravetz <[email protected]>
hugetlb: rename remove_huge_page to hugetlb_delete_from_page_cache
Ard Biesheuvel <[email protected]>
arm64: fix rodata=full again
Mike Rapoport <[email protected]>
arm64/mm: fold check for KFENCE into can_set_direct_map()
Colin Ian King <[email protected]>
ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source", "Routee" -> "Route"
Shyam Prasad N <[email protected]>
cifs: always iterate smb sessions using primary channel
Dan Williams <[email protected]>
tools/testing/cxl: Fix some error exits
Tony Luck <[email protected]>
x86/cpu: Add several Intel server CPU model numbers
Yu Zhe <[email protected]>
cxl/pmem: Use size_add() against integer overflow
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm
Nevenko Stupar <[email protected]>
drm/amd/display: Investigate tool reported FCLK P-state deviations
George Shen <[email protected]>
drm/amd/display: Round up DST_after_scaler to nearest int
George Shen <[email protected]>
drm/amd/display: Use forced DSC bpp in DML
George Shen <[email protected]>
drm/amd/display: Fix DCN32 DSC delay calculation
Mario Limonciello <[email protected]>
drm/amd: Fail the suspend if resources can't be evicted
Yifan Zhang <[email protected]>
drm/amdgpu: set fb_modifiers_not_supported in vkms
Alvin Lee <[email protected]>
drm/amd/display: Enable timing sync on DCN32
Fangzhi Zuo <[email protected]>
drm/amd/display: Ignore Cable ID Feature
Filipe Manana <[email protected]>
btrfs: remove pointless and double ulist frees in error paths of qgroup tests
Nathan Huckleberry <[email protected]>
drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid
Nam Cao <[email protected]>
i2c: i801: add lis3lv02d's I2C address for Vostro 5568
Thierry Reding <[email protected]>
i2c: tegra: Allocate DMA memory for DMA engine
Cristian Marussi <[email protected]>
firmware: arm_scmi: Make tx_prepare time out eventually
Cristian Marussi <[email protected]>
firmware: arm_scmi: Cleanup the core driver removal callback
Al Viro <[email protected]>
block: blk_add_rq_to_plug(): clear stale 'last' after flush
Michael Ellerman <[email protected]>
powerpc/64e: Fix amdgpu build on Book3E w/o AltiVec
Li Zhijian <[email protected]>
ksefltests: pidfd: Fix wait_states: Test terminated by timeout
Michael Tretter <[email protected]>
drm/rockchip: vop2: disable planes when disabling the crtc
Michael Tretter <[email protected]>
drm/rockchip: vop2: fix null pointer in plane_atomic_disable
Mario Limonciello <[email protected]>
ACPI: x86: Add another system to quirk list for forcing StorageD3Enable
Chuck Lever <[email protected]>
SUNRPC: Fix crasher in gss_unwrap_resp_integ()
Benjamin Coddington <[email protected]>
NFSv4: Retry LOCK on OLD_STATEID during delegation return
Qu Wenruo <[email protected]>
btrfs: raid56: properly handle the error when unable to find the missing stripe
Michael Margolin <[email protected]>
RDMA/efa: Add EFA 0xefa2 PCI ID
Jonathan Cameron <[email protected]>
cxl/mbox: Add a check on input payload size
Hans de Goede <[email protected]>
ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[]
Christian König <[email protected]>
drm/scheduler: fix fence ref counting
Alvin Lee <[email protected]>
drm/amd/display: Don't return false if no stream
Rodrigo Siqueira <[email protected]>
drm/amd/display: Remove wrong pipe control lock
Gayatri Kammela <[email protected]>
platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core driver
Jelle van der Waa <[email protected]>
platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models
Yiqing Yao <[email protected]>
drm/amdgpu: Adjust MES polling timeout for sriov
Leohearts <[email protected]>
ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table
linkt <[email protected]>
ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo ThinkBook 16 Gen 4+ ARA to the Quirks List
Shuming Fan <[email protected]>
ASoC: rt1308-sdw: add the default value of some registers
Alexandre Belloni <[email protected]>
rtc: cmos: fix build on non-ACPI platforms
Yong Zhi <[email protected]>
ASoC: Intel: sof_rt5682: Add quirk for Rex board
Ricardo Cañuelo <[email protected]>
selftests/kexec: fix build for ARCH=x86_64
Ricardo Cañuelo <[email protected]>
selftests/intel_pstate: fix build for ARCH=x86_64
Ricardo Cañuelo <[email protected]>
selftests/futex: fix build for clang
Pierre-Louis Bossart <[email protected]>
ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15
Siarhei Volkau <[email protected]>
ASoC: codecs: jz4725b: fix capture selector naming
Siarhei Volkau <[email protected]>
ASoC: codecs: jz4725b: use right control for Capture Volume
Siarhei Volkau <[email protected]>
ASoC: codecs: jz4725b: fix reported volume for Master ctl
Siarhei Volkau <[email protected]>
ASoC: codecs: jz4725b: add missed Line In power control bit
Mauro Lima <[email protected]>
spi: intel: Fix the offset to get the 64K erase opcode
Xiaolei Wang <[email protected]>
ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK
Derek Fang <[email protected]>
ASoC: rt1019: Fix the TDM settings
Derek Fang <[email protected]>
ASoC: rt5682s: Fix the TDM Tx settings
Zhang Qilong <[email protected]>
ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe
Zhang Qilong <[email protected]>
ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe"
Zhang Qilong <[email protected]>
ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe"
Zhang Qilong <[email protected]>
ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe"
Krishna Yarlagadda <[email protected]>
spi: tegra210-quad: Fix combined sequence
Akhil P Oommen <[email protected]>
drm/msm/gpu: Fix crash during system suspend after unbind
Christian Marangi <[email protected]>
mtd: rawnand: qcom: handle ret from parse with codeword_fixup
-------------
Diffstat:
Documentation/driver-api/miscellaneous.rst | 5 +- .../process/code-of-conduct-interpretation.rst | 2 +- Makefile | 4 +- arch/arm/boot/dts/imx7s.dtsi | 4 +- arch/arm/boot/dts/sama7g5-pinfunc.h | 2 +- arch/arm/mach-at91/pm_suspend.S | 7 +- .../boot/dts/freescale/imx8mm-tqma8mqml-mba8mx.dts | 32 ++- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 4 +- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx93-pinfunc.h | 0 arch/arm64/boot/dts/qcom/ipq8074.dtsi | 2 +- arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 13 +- arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 12 ++ arch/arm64/boot/dts/qcom/sc7280.dtsi | 3 +- arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 6 + arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 36 +--- .../boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 6 + .../boot/dts/qcom/sm8250-sony-xperia-edo.dtsi | 6 + arch/arm64/boot/dts/qcom/sm8250.dtsi | 1 + arch/arm64/boot/dts/qcom/sm8350-hdk.dts | 12 ++ arch/arm64/include/asm/cputype.h | 2 +- arch/arm64/include/asm/pgtable.h | 4 +- arch/arm64/mm/mmu.c | 8 +- arch/arm64/mm/pageattr.c | 11 +- arch/mips/kernel/relocate_kernel.S | 15 +- arch/mips/loongson64/reset.c | 10 + arch/powerpc/Kconfig | 2 +- arch/s390/include/asm/processor.h | 11 +- arch/x86/events/amd/core.c | 5 +- arch/x86/events/amd/uncore.c | 1 + arch/x86/events/intel/pt.c | 9 + arch/x86/include/asm/intel-family.h | 11 +- arch/x86/kernel/cpu/bugs.c | 13 +- arch/x86/kernel/cpu/sgx/ioctl.c | 3 + arch/x86/kernel/fpu/core.c | 2 +- arch/x86/kvm/kvm-asm-offsets.c | 2 + arch/x86/kvm/svm/sev.c | 4 +- arch/x86/kvm/svm/svm.c | 91 ++++----- arch/x86/kvm/svm/svm.h | 10 +- arch/x86/kvm/svm/svm_ops.h | 5 - arch/x86/kvm/svm/vmenter.S | 136 ++++++++++++- arch/x86/kvm/xen.c | 7 +- block/blk-cgroup.c | 2 +- block/blk-core.c | 1 - block/blk-mq.c | 1 + block/blk-settings.c | 8 +- block/sed-opal.c | 32 ++- drivers/accessibility/speakup/main.c | 2 +- drivers/accessibility/speakup/utils.h | 2 +- drivers/acpi/scan.c | 1 + drivers/acpi/x86/utils.c | 6 + drivers/ata/libata-scsi.c | 10 + drivers/ata/libata-transport.c | 19 +- drivers/block/drbd/drbd_main.c | 4 +- drivers/cxl/core/mbox.c | 2 +- drivers/cxl/pmem.c | 2 +- drivers/firmware/arm_scmi/bus.c | 11 + drivers/firmware/arm_scmi/common.h | 5 +- drivers/firmware/arm_scmi/driver.c | 32 +-- drivers/firmware/arm_scmi/mailbox.c | 2 +- drivers/firmware/arm_scmi/optee.c | 2 +- drivers/firmware/arm_scmi/shmem.c | 31 ++- drivers/firmware/arm_scmi/smc.c | 2 +- drivers/firmware/google/coreboot_table.c | 37 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 + drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 9 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 35 +++- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 6 - .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 10 +- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 30 +++ drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 12 +- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubp.c | 1 + .../gpu/drm/amd/display/dc/dcn314/dcn314_optc.c | 2 +- .../amd/display/dc/dcn32/dcn32_resource_helpers.c | 2 +- .../gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 1 + .../amd/display/dc/dml/dcn32/display_mode_vba_32.c | 7 +- .../dc/dml/dcn32/display_mode_vba_util_32.c | 2 +- .../display/dc/dml/dcn32/display_rq_dlg_calc_32.c | 4 +- .../gpu/drm/amd/display/dc/dml/display_mode_vba.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 23 +-- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 8 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_v11_0.h | 10 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 11 +- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 9 + .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 30 ++- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 30 ++- drivers/gpu/drm/display/drm_dp_dual_mode_helper.c | 51 +++-- drivers/gpu/drm/drm_drv.c | 2 +- drivers/gpu/drm/drm_internal.h | 3 +- drivers/gpu/drm/imx/imx-tve.c | 5 +- drivers/gpu/drm/lima/lima_devfreq.c | 15 +- drivers/gpu/drm/msm/adreno/adreno_device.c | 10 +- drivers/gpu/drm/msm/msm_gpu.c | 2 + drivers/gpu/drm/msm/msm_gpu.h | 4 + drivers/gpu/drm/panel/panel-simple.c | 2 + drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 10 +- drivers/gpu/drm/scheduler/sched_entity.c | 6 +- drivers/gpu/drm/vc4/vc4_kms.c | 8 +- drivers/i2c/busses/i2c-i801.c | 1 + drivers/i2c/busses/i2c-tegra.c | 16 +- drivers/iio/accel/bma400_core.c | 24 +-- drivers/iio/adc/at91_adc.c | 4 +- drivers/iio/adc/mp2629_adc.c | 5 +- drivers/iio/pressure/ms5611.h | 12 +- drivers/iio/pressure/ms5611_core.c | 51 ++--- drivers/iio/pressure/ms5611_spi.c | 2 +- drivers/iio/trigger/iio-trig-sysfs.c | 6 +- drivers/infiniband/hw/efa/efa_main.c | 4 +- drivers/input/joystick/iforce/iforce-main.c | 8 +- drivers/input/serio/i8042.c | 4 - drivers/iommu/intel/iommu.c | 8 +- drivers/iommu/intel/pasid.c | 5 +- drivers/isdn/mISDN/core.c | 2 +- drivers/isdn/mISDN/dsp_pipeline.c | 3 +- drivers/md/dm-bufio.c | 2 + drivers/md/dm-crypt.c | 1 + drivers/md/dm-ioctl.c | 4 +- drivers/misc/vmw_vmci/vmci_queue_pair.c | 2 + drivers/mmc/core/core.c | 8 +- drivers/mmc/host/sdhci-pci-core.c | 2 + drivers/mmc/host/sdhci-pci-o2micro.c | 7 + drivers/mtd/nand/onenand/Kconfig | 1 + drivers/mtd/nand/raw/qcom_nandc.c | 12 +- drivers/net/ethernet/amazon/ena/ena_netdev.c | 8 +- drivers/net/ethernet/atheros/ag71xx.c | 3 +- drivers/net/ethernet/broadcom/bgmac.c | 1 - drivers/net/ethernet/broadcom/bnxt/bnxt.c | 62 +++++- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c | 3 +- drivers/net/ethernet/cavium/liquidio/lio_main.c | 34 +++- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 - .../hisilicon/hns3/hns3_common/hclge_comm_rss.c | 20 -- .../hisilicon/hns3/hns3_common/hclge_comm_rss.h | 2 - drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 167 ++++++++------- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 1 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 11 +- drivers/net/ethernet/huawei/hinic/hinic_main.c | 9 +- .../net/ethernet/marvell/octeon_ep/octep_main.c | 16 +- .../ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 + .../ethernet/microchip/lan966x/lan966x_ethtool.c | 3 + .../net/ethernet/microchip/sparx5/sparx5_ethtool.c | 3 + .../net/ethernet/microchip/sparx5/sparx5_main.c | 3 + .../net/ethernet/netronome/nfp/nfp_net_ethtool.c | 6 +- drivers/net/ethernet/pensando/ionic/ionic_main.c | 8 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 + drivers/net/macvlan.c | 6 +- drivers/net/mctp/mctp-i2c.c | 47 +++-- drivers/net/mhi_net.c | 2 + drivers/net/netdevsim/dev.c | 1 + drivers/net/phy/dp83867.c | 7 + drivers/net/phy/marvell.c | 16 +- drivers/net/thunderbolt.c | 19 +- drivers/net/usb/smsc95xx.c | 46 ++++- drivers/nvme/host/ioctl.c | 6 + drivers/nvme/host/nvme.h | 16 +- drivers/nvme/host/pci.c | 4 + drivers/nvme/target/auth.c | 2 + drivers/nvme/target/configfs.c | 1 + drivers/parport/parport_pc.c | 2 +- drivers/pinctrl/devicetree.c | 2 + drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 3 + drivers/pinctrl/pinctrl-rockchip.c | 40 ++++ .../platform/surface/aggregator/ssh_packet_layer.c | 24 ++- drivers/platform/x86/amd/pmc.c | 3 +- drivers/platform/x86/intel/pmc/core.c | 2 + drivers/platform/x86/intel/pmc/pltdrv.c | 9 + drivers/platform/x86/thinkpad_acpi.c | 4 +- drivers/rtc/rtc-cmos.c | 3 + drivers/s390/block/dcssblk.c | 1 + drivers/s390/scsi/zfcp_fsf.c | 2 +- drivers/scsi/scsi_debug.c | 6 +- drivers/scsi/scsi_transport_sas.c | 13 +- drivers/siox/siox-core.c | 2 + drivers/slimbus/Kconfig | 2 +- drivers/slimbus/stream.c | 8 +- drivers/soc/imx/soc-imx8m.c | 11 + drivers/spi/spi-intel.c | 2 +- drivers/spi/spi-stm32.c | 1 + drivers/spi/spi-tegra210-quad.c | 5 + drivers/target/loopback/tcm_loop.c | 3 +- drivers/tty/n_gsm.c | 2 +- drivers/tty/serial/8250/8250_lpss.c | 17 +- drivers/tty/serial/8250/8250_omap.c | 45 ++-- drivers/tty/serial/8250/8250_port.c | 7 +- drivers/tty/serial/fsl_lpuart.c | 76 ++++--- drivers/tty/serial/imx.c | 1 + drivers/usb/cdns3/host.c | 56 ++--- drivers/usb/chipidea/otg_fsm.c | 2 + drivers/usb/core/quirks.c | 3 + drivers/usb/dwc3/core.c | 10 + drivers/usb/dwc3/host.c | 10 - drivers/usb/host/bcma-hcd.c | 10 +- drivers/usb/serial/option.c | 19 +- drivers/usb/typec/mux/intel_pmc_mux.c | 15 +- drivers/usb/typec/tipd/core.c | 6 +- drivers/vfio/vfio_main.c | 50 +++-- drivers/xen/pcpu.c | 2 +- fs/btrfs/raid56.c | 6 +- fs/btrfs/tests/qgroup-tests.c | 16 +- fs/buffer.c | 4 +- fs/ceph/snap.c | 3 +- fs/cifs/connect.c | 14 +- fs/cifs/ioctl.c | 4 +- fs/cifs/misc.c | 6 +- fs/cifs/smb2misc.c | 12 +- fs/cifs/smb2ops.c | 10 +- fs/cifs/smb2transport.c | 6 +- fs/erofs/fscache.c | 226 +++++++++------------ fs/gfs2/ops_fstype.c | 17 +- fs/hugetlbfs/inode.c | 32 ++- fs/namei.c | 2 +- fs/netfs/buffered_read.c | 20 +- fs/netfs/io.c | 3 + fs/nfs/nfs4proc.c | 6 +- fs/nfsd/nfs4state.c | 1 + fs/ntfs/attrib.c | 28 ++- fs/ntfs/inode.c | 7 + include/linux/blkdev.h | 15 +- include/linux/bpf.h | 5 + include/linux/hugetlb.h | 2 +- include/linux/io_uring.h | 3 + include/linux/ring_buffer.h | 2 +- include/linux/trace.h | 4 +- include/linux/wireless.h | 10 +- include/net/ip.h | 2 +- include/net/ipv6.h | 2 +- include/soc/at91/sama7-ddr.h | 5 +- include/uapi/linux/ip.h | 6 +- include/uapi/linux/ipv6.h | 6 +- io_uring/io_uring.c | 12 +- io_uring/io_uring.h | 4 +- io_uring/net.c | 23 +-- io_uring/poll.c | 41 ++-- kernel/bpf/percpu_freelist.c | 23 +-- kernel/bpf/syscall.c | 11 + kernel/bpf/trampoline.c | 15 +- kernel/bpf/verifier.c | 14 +- kernel/events/core.c | 25 ++- kernel/kprobes.c | 8 +- kernel/rseq.c | 19 +- kernel/trace/bpf_trace.c | 6 + kernel/trace/ftrace.c | 5 +- kernel/trace/kprobe_event_gen_test.c | 48 +++-- kernel/trace/rethook.c | 4 +- kernel/trace/ring_buffer.c | 71 +++++-- kernel/trace/synth_event_gen_test.c | 16 +- kernel/trace/trace.c | 12 +- kernel/trace/trace_eprobe.c | 3 + kernel/trace/trace_events_synth.c | 5 +- mm/filemap.c | 2 +- mm/hugetlb.c | 12 +- mm/maccess.c | 2 +- mm/memory-failure.c | 5 +- net/9p/trans_fd.c | 45 ++-- net/bluetooth/l2cap_core.c | 2 +- net/bpf/test_run.c | 1 + net/bridge/br_vlan.c | 17 +- net/caif/chnl_net.c | 3 - net/dsa/dsa2.c | 10 + net/dsa/dsa_priv.h | 1 + net/dsa/master.c | 3 +- net/dsa/port.c | 16 ++ net/ipv4/tcp_cdg.c | 2 + net/kcm/kcmsock.c | 60 +----- net/netfilter/ipset/ip_set_core.c | 8 +- net/netlink/af_netlink.c | 8 +- net/sctp/outqueue.c | 13 +- net/sunrpc/auth_gss/auth_gss.c | 2 +- net/wireless/wext-core.c | 17 +- net/x25/x25_dev.c | 2 +- sound/pci/hda/patch_realtek.c | 2 + sound/soc/amd/yc/acp6x-mach.c | 21 ++ sound/soc/codecs/jz4725b.c | 34 ++-- sound/soc/codecs/mt6660.c | 8 +- sound/soc/codecs/rt1019.c | 20 +- sound/soc/codecs/rt1019.h | 6 + sound/soc/codecs/rt1308-sdw.h | 2 + sound/soc/codecs/rt5514-spi.c | 15 +- sound/soc/codecs/rt5677-spi.c | 19 +- sound/soc/codecs/rt5682s.c | 15 +- sound/soc/codecs/rt5682s.h | 1 + sound/soc/codecs/tas2764.c | 19 +- sound/soc/codecs/tas2770.c | 20 +- sound/soc/codecs/tas2780.c | 19 +- sound/soc/codecs/wm5102.c | 6 +- sound/soc/codecs/wm5110.c | 6 +- sound/soc/codecs/wm8962.c | 54 ++++- sound/soc/codecs/wm8997.c | 6 +- sound/soc/fsl/fsl_asrc.c | 2 +- sound/soc/fsl/fsl_esai.c | 2 +- sound/soc/fsl/fsl_sai.c | 2 +- sound/soc/intel/boards/sof_rt5682.c | 12 ++ sound/soc/intel/boards/sof_sdw.c | 11 + sound/soc/soc-core.c | 17 +- sound/soc/soc-utils.c | 2 +- sound/soc/sof/topology.c | 20 +- sound/usb/midi.c | 4 +- tools/testing/cxl/test/cxl.c | 4 +- tools/testing/selftests/bpf/test_progs.c | 2 +- tools/testing/selftests/bpf/test_verifier.c | 2 +- tools/testing/selftests/futex/functional/Makefile | 6 +- tools/testing/selftests/intel_pstate/Makefile | 6 +- tools/testing/selftests/kexec/Makefile | 6 +- tools/testing/selftests/pidfd/pidfd_wait.c | 10 + 306 files changed, 2496 insertions(+), 1295 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/314 mtd: rawnand: qcom: handle ret from parse with codeword_fixup
From: Christian Marangi <[email protected]>
commit 7df140e84a75c89962feef659d686303d3ce75e5 upstream.
With use_codeword_fixup enabled, any return from mtd_device_parse_register gets overwritten. Aside from the clear bug, this is also problematic as a parser can EPROBE_DEFER and because this is not correctly handled, the nand is never rescanned later in the bootup process.
An example of this problem is when smem requires additional time to be probed and nandc use qcomsmempart as parser. Parser will return EPROBE_DEFER but in the current code this ret gets overwritten by qcom_nand_host_parse_boot_partitions and qcom_nand_host_init_and_register return 0.
Correctly handle the return code from mtd_device_parse_register so that any error from this function is not ignored.
--- drivers/mtd/nand/raw/qcom_nandc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/mtd/nand/raw/qcom_nandc.c +7 -5
@@ -3167,16 +3167,18 @@ static int qcom_nand_host_init_and_regis ret =mtd_device_parse_register (mtd, probes,NULL ,NULL ,0 );if (ret) -nand_cleanup (chip); + goto err;if (nandc->props->use_codeword_fixup) { ret =qcom_nand_host_parse_boot_partitions (nandc, host, dn); -if (ret) { -nand_cleanup (chip); -return ret; - } +if (ret) + goto err; } +return 0 ; + +err: +nand_cleanup (chip);return ret; }
Greg Kroah-Hartman
maintainerPATCH 2/314 drm/msm/gpu: Fix crash during system suspend after unbind
In reply to Greg Kroah-HartmanFrom: Akhil P Oommen <[email protected]>
[ Upstream commit 76efc2453d0e8e5d6692ef69981b183ad674edea ]
In adreno_unbind, we should clean up gpu device's drvdata to avoid accessing a stale pointer during system suspend. Also, check for NULL ptr in both system suspend/resume callbacks.
Patchwork: https://patchwork.freedesktop.org/patch/505075/
--- drivers/gpu/drm/msm/adreno/adreno_device.c | 10 +++++++++- drivers/gpu/drm/msm/msm_gpu.c | 2 ++ drivers/gpu/drm/msm/msm_gpu.h | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/adreno/adreno_device.c +9 -1
@@ -679,6 +679,9 @@ static int adreno_system_suspend(struct device *dev)struct msm_gpu *gpu =dev_to_gpu (dev);int remaining, ret; +if (!gpu) +return 0 ; +suspend_scheduler (gpu); remaining = wait_event_timeout(gpu->retire_event,
@@ -700,7 +703,12 @@ static int adreno_system_suspend(struct device *dev)static int adreno_system_resume (struct device *dev) { -resume_scheduler (dev_to_gpu (dev)); +struct msm_gpu *gpu =dev_to_gpu (dev); + +if (!gpu) +return 0 ; + +resume_scheduler (gpu);return pm_runtime_force_resume (dev); }
drivers/gpu/drm/msm/msm_gpu.c +2 -0
@@ -993,4 +993,6 @@ void msm_gpu_cleanup(struct msm_gpu *gpu) }msm_devfreq_cleanup (gpu); + +platform_set_drvdata (gpu->pdev,NULL ); }
drivers/gpu/drm/msm/msm_gpu.h +4 -0
@@ -282,6 +282,10 @@ struct msm_gpu {static inline struct msm_gpu *dev_to_gpu (struct device *dev) {struct adreno_smmu_priv *adreno_smmu =dev_get_drvdata (dev); + +if (!adreno_smmu) +return NULL ; + return container_of(adreno_smmu, struct msm_gpu, adreno_smmu); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 3/314 spi: tegra210-quad: Fix combined sequence
In reply to Greg Kroah-HartmanFrom: Krishna Yarlagadda <[email protected]>
[ Upstream commit 8777dd9dff4020bba66654ec92e4b0ab6367ad30 ]
Return value should be updated to zero in combined sequence routine if transfer is completed successfully. Currently it holds timeout value resulting in errors.
--- drivers/spi/spi-tegra210-quad.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/spi/spi-tegra210-quad.c +5 -0
@@ -1157,6 +1157,11 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi, msg->actual_length += xfer->len; transfer_phase++; } +if (!xfer->cs_change) { +tegra_qspi_transfer_end (spi); +spi_transfer_delay_exec (xfer); + } + ret =0 ; exit: msg->status = ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 4/314 ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe"
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit de71d7567e358effd06dfc3e2a154b25f1331c10 ]
This reverts commit fcbb60820cd3008bb44334a0395e5e57ccb77329.
The pm_runtime_disable is redundant when error returns in wm5102_probe, we just revert the old patch to fix it.
--- sound/soc/codecs/wm5102.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/wm5102.c +3 -3
@@ -2099,6 +2099,9 @@ static int wm5102_probe(struct platform_device *pdev)regmap_update_bits (arizona->regmap, wm5102_digital_vu[i],WM5102_DIG_VU ,WM5102_DIG_VU ); +pm_runtime_enable (&pdev->dev); +pm_runtime_idle (&pdev->dev); + ret =arizona_request_irq (arizona,ARIZONA_IRQ_DSP_IRQ1 ,"ADSP2 Compressed IRQ" , wm5102_adsp2_irq, wm5102);
@@ -2131,9 +2134,6 @@ static int wm5102_probe(struct platform_device *pdev) goto err_spk_irqs; } -pm_runtime_enable (&pdev->dev); -pm_runtime_idle (&pdev->dev); -return ret; err_spk_irqs:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 5/314 ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe"
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 7d4e966f4cd73ff69bf06934e8e14a33fb7ef447 ]
This reverts commit 86b46bf1feb83898d89a2b4a8d08d21e9ea277a7.
The pm_runtime_disable is redundant when error returns in wm5110_probe, we just revert the old patch to fix it.
--- sound/soc/codecs/wm5110.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/wm5110.c +3 -3
@@ -2457,6 +2457,9 @@ static int wm5110_probe(struct platform_device *pdev)regmap_update_bits (arizona->regmap, wm5110_digital_vu[i],WM5110_DIG_VU ,WM5110_DIG_VU ); +pm_runtime_enable (&pdev->dev); +pm_runtime_idle (&pdev->dev); + ret =arizona_request_irq (arizona,ARIZONA_IRQ_DSP_IRQ1 ,"ADSP2 Compressed IRQ" , wm5110_adsp2_irq, wm5110);
@@ -2489,9 +2492,6 @@ static int wm5110_probe(struct platform_device *pdev) goto err_spk_irqs; } -pm_runtime_enable (&pdev->dev); -pm_runtime_idle (&pdev->dev); -return ret; err_spk_irqs:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 6/314 ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe"
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 68ce83e3bb26feba0fcdd59667fde942b3a600a1 ]
This reverts commit 41a736ac20602f64773e80f0f5b32cde1830a44a.
The pm_runtime_disable is redundant when error returns in wm8997_probe, we just revert the old patch to fix it.
--- sound/soc/codecs/wm8997.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/wm8997.c +3 -3
@@ -1161,6 +1161,9 @@ static int wm8997_probe(struct platform_device *pdev)regmap_update_bits (arizona->regmap, wm8997_digital_vu[i],WM8997_DIG_VU ,WM8997_DIG_VU ); +pm_runtime_enable (&pdev->dev); +pm_runtime_idle (&pdev->dev); +arizona_init_common (arizona); ret =arizona_init_vol_limit (arizona);
@@ -1179,9 +1182,6 @@ static int wm8997_probe(struct platform_device *pdev) goto err_spk_irqs; } -pm_runtime_enable (&pdev->dev); -pm_runtime_idle (&pdev->dev); -return ret; err_spk_irqs:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 7/314 ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit c4ab29b0f3a6f1e167c5a627f7cd036c1d2b7d65 ]
It would be better to keep the pm_runtime enables before the IRQ and component stuff. Both of those could start triggering PM runtime events.
--- sound/soc/codecs/mt6660.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/codecs/mt6660.c +4 -4
@@ -503,14 +503,14 @@ static int mt6660_i2c_probe(struct i2c_client *client)dev_err (chip->dev,"read chip revision fail\n" ); goto probe_fail; } +pm_runtime_set_active (chip->dev); +pm_runtime_enable (chip->dev); ret =devm_snd_soc_register_component (chip->dev, &mt6660_component_driver, &mt6660_codec_dai,1 ); -if (!ret) { -pm_runtime_set_active (chip->dev); -pm_runtime_enable (chip->dev); - } +if (ret) +pm_runtime_disable (chip->dev);return ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 8/314 ASoC: rt5682s: Fix the TDM Tx settings
In reply to Greg Kroah-HartmanFrom: Derek Fang <[email protected]>
[ Upstream commit d94bf16e920047c9b4ea2b57f7b53b4ff5039d9f ]
Complete the missing and correct the TDM Tx settings.
--- sound/soc/codecs/rt5682s.c | 15 +++++++++++++-- sound/soc/codecs/rt5682s.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-)
sound/soc/codecs/rt5682s.c +13 -2
@@ -1932,7 +1932,7 @@ static int rt5682s_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) { struct snd_soc_component *component = dai->component; -unsigned int cl, val =0 ; +unsigned int cl, val =0 , tx_slotnum; if (tx_mask || rx_mask) snd_soc_component_update_bits(component,
@@ -1941,6 +1941,16 @@ static int rt5682s_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,snd_soc_component_update_bits (component,RT5682S_TDM_ADDA_CTRL_2 ,RT5682S_TDM_EN ,0 ); +/* Tx slot configuration */ + tx_slotnum =hweight_long (tx_mask); +if (tx_slotnum) { +if (tx_slotnum > slots) { +dev_err (component->dev,"Invalid or oversized Tx slots.\n" ); +return -EINVAL ; + } + val |= (tx_slotnum -1 ) <<RT5682S_TDM_ADC_DL_SFT ; + } +switch (slots) {case 4 : val |=RT5682S_TDM_TX_CH_4 ;
@@ -1961,7 +1971,8 @@ static int rt5682s_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, }snd_soc_component_update_bits (component,RT5682S_TDM_CTRL , -RT5682S_TDM_TX_CH_MASK |RT5682S_TDM_RX_CH_MASK , val); +RT5682S_TDM_TX_CH_MASK |RT5682S_TDM_RX_CH_MASK | +RT5682S_TDM_ADC_DL_MASK , val);switch (slot_width) {case 8 :
sound/soc/codecs/rt5682s.h +1 -0
@@ -899,6 +899,7 @@#define RT5682S_TDM_RX_CH_8 (0x3 << 8)#define RT5682S_TDM_ADC_LCA_MASK (0x7 << 4)#define RT5682S_TDM_ADC_LCA_SFT 4 +#define RT5682S_TDM_ADC_DL_MASK (0x3 << 0)#define RT5682S_TDM_ADC_DL_SFT 0/* TDM control 2 (0x007a) */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 9/314 ASoC: rt1019: Fix the TDM settings
In reply to Greg Kroah-HartmanFrom: Derek Fang <[email protected]>
[ Upstream commit f2635d45a750182c6d5de15e2d6b059e0c302d7e ]
Complete the missing and correct the TDM settings.
--- sound/soc/codecs/rt1019.c | 20 +++++++++++--------- sound/soc/codecs/rt1019.h | 6 ++++++ 2 files changed, 17 insertions(+), 9 deletions(-)
sound/soc/codecs/rt1019.c +11 -9
@@ -391,18 +391,18 @@ static int rt1019_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) { struct snd_soc_component *component = dai->component; -unsigned int val =0 , rx_slotnum; +unsigned int cn =0 , cl =0 , rx_slotnum;int ret =0 , first_bit;switch (slots) {case 4 : - val |=RT1019_I2S_TX_4CH ; + cn =RT1019_I2S_TX_4CH ;break ;case 6 : - val |=RT1019_I2S_TX_6CH ; + cn =RT1019_I2S_TX_6CH ;break ;case 8 : - val |=RT1019_I2S_TX_8CH ; + cn =RT1019_I2S_TX_8CH ;break ;case 2 :break ;
@@ -412,16 +412,16 @@ static int rt1019_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,switch (slot_width) {case 20 : - val |=RT1019_I2S_DL_20 ; + cl =RT1019_TDM_CL_20 ;break ;case 24 : - val |=RT1019_I2S_DL_24 ; + cl =RT1019_TDM_CL_24 ;break ;case 32 : - val |=RT1019_I2S_DL_32 ; + cl =RT1019_TDM_CL_32 ;break ;case 8 : - val |=RT1019_I2S_DL_8 ; + cl =RT1019_TDM_CL_8 ;break ;case 16 :break ;
@@ -470,8 +470,10 @@ static int rt1019_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, goto _set_tdm_err_; } +snd_soc_component_update_bits (component,RT1019_TDM_1 , +RT1019_TDM_CL_MASK , cl);snd_soc_component_update_bits (component,RT1019_TDM_2 , -RT1019_I2S_CH_TX_MASK |RT1019_I2S_DF_MASK , val); +RT1019_I2S_CH_TX_MASK , cn); _set_tdm_err_:return ret;
sound/soc/codecs/rt1019.h +6 -0
@@ -95,6 +95,12 @@#define RT1019_TDM_BCLK_MASK (0x1 << 6)#define RT1019_TDM_BCLK_NORM (0x0 << 6)#define RT1019_TDM_BCLK_INV (0x1 << 6) +#define RT1019_TDM_CL_MASK (0x7) +#define RT1019_TDM_CL_8 (0x4) +#define RT1019_TDM_CL_32 (0x3) +#define RT1019_TDM_CL_24 (0x2) +#define RT1019_TDM_CL_20 (0x1) +#define RT1019_TDM_CL_16 (0x0)/* 0x0401 TDM Control-2 */ #define RT1019_I2S_CH_TX_MASK (0x3 << 6)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 10/314 ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK
In reply to Greg Kroah-HartmanFrom: Xiaolei Wang <[email protected]>
[ Upstream commit ee1aa2ae3eaa96e70229fa61deee87ef4528ffdf ]
In wm8962 driver, the WM8962_ADDITIONAL_CONTROL_4 is used as a volatile register, but this register mixes a bunch of volatile status bits and a bunch of non-volatile control bits. The dapm widgets TEMP_HP and TEMP_SPK leverages the control bits in this register. After the wm8962 probe, the regmap will bet set to cache only mode, then a read error like below would be triggered when trying to read the initial power state of the dapm widgets TEMP_HP and TEMP_SPK.
wm8962 0-001a: ASoC: error at soc_component_read_no_lock on wm8962.0-001a: -16
In order to fix this issue, we add event handler to actually power up/down these widgets. With this change, we also need to explicitly power off these widgets in the wm8962 probe since they are enabled by default.
--- sound/soc/codecs/wm8962.c | 54 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8962.c +52 -2
@@ -1840,6 +1840,49 @@ SOC_SINGLE_TLV("SPKOUTR Mixer DACR Volume", WM8962_SPEAKER_MIXER_5, 4, 1, 0, inmix_tlv), }; +static int tp_event (struct snd_soc_dapm_widget *w, +struct snd_kcontrol *kcontrol,int event) +{ +int ret, reg, val, mask; +struct snd_soc_component *component =snd_soc_dapm_to_component (w->dapm); + + ret =pm_runtime_resume_and_get (component->dev); +if (ret <0 ) { +dev_err (component->dev,"Failed to resume device: %d\n" , ret); +return ret; + } + + reg =WM8962_ADDITIONAL_CONTROL_4 ; + +if (!strcmp (w->name,"TEMP_HP" )) { + mask =WM8962_TEMP_ENA_HP_MASK ; + val =WM8962_TEMP_ENA_HP ; + }else if (!strcmp (w->name,"TEMP_SPK" )) { + mask =WM8962_TEMP_ENA_SPK_MASK ; + val =WM8962_TEMP_ENA_SPK ; + }else { +pm_runtime_put (component->dev); +return -EINVAL ; + } + +switch (event) { +case SND_SOC_DAPM_POST_PMD : + val =0 ; + fallthrough; +case SND_SOC_DAPM_POST_PMU : + ret =snd_soc_component_update_bits (component, reg, mask, val); +break ; +default : +WARN (1 ,"Invalid event %d\n" , event); +pm_runtime_put (component->dev); +return -EINVAL ; + } + +pm_runtime_put (component->dev); + +return 0 ; +} +static int cp_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event) {
@@ -2140,8 +2183,10 @@ SND_SOC_DAPM_SUPPLY("TOCLK", WM8962_ADDITIONAL_CONTROL_1, 0, 0, NULL, 0),SND_SOC_DAPM_SUPPLY_S ("DSP2" ,1 ,WM8962_DSP2_POWER_MANAGEMENT ,WM8962_DSP2_ENA_SHIFT ,0 , dsp2_event,SND_SOC_DAPM_POST_PMU |SND_SOC_DAPM_PRE_PMD ), -SND_SOC_DAPM_SUPPLY ("TEMP_HP" ,WM8962_ADDITIONAL_CONTROL_4 ,2 ,0 ,NULL ,0 ), -SND_SOC_DAPM_SUPPLY ("TEMP_SPK" ,WM8962_ADDITIONAL_CONTROL_4 ,1 ,0 ,NULL ,0 ), +SND_SOC_DAPM_SUPPLY ("TEMP_HP" ,SND_SOC_NOPM ,0 ,0 , tp_event, +SND_SOC_DAPM_POST_PMU |SND_SOC_DAPM_POST_PMD ), +SND_SOC_DAPM_SUPPLY ("TEMP_SPK" ,SND_SOC_NOPM ,0 ,0 , tp_event, +SND_SOC_DAPM_POST_PMU |SND_SOC_DAPM_POST_PMD ),SND_SOC_DAPM_MIXER ("INPGAL" ,WM8962_LEFT_INPUT_PGA_CONTROL ,4 ,0 , inpgal, ARRAY_SIZE(inpgal)),
@@ -3763,6 +3808,11 @@ static int wm8962_i2c_probe(struct i2c_client *i2c)if (ret <0 ) goto err_pm_runtime; +regmap_update_bits (wm8962->regmap,WM8962_ADDITIONAL_CONTROL_4 , +WM8962_TEMP_ENA_HP_MASK ,0 ); +regmap_update_bits (wm8962->regmap,WM8962_ADDITIONAL_CONTROL_4 , +WM8962_TEMP_ENA_SPK_MASK ,0 ); +regcache_cache_only (wm8962->regmap, true);/* The drivers should power up as needed */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 11/314 spi: intel: Fix the offset to get the 64K erase opcode
In reply to Greg Kroah-HartmanFrom: Mauro Lima <[email protected]>
[ Upstream commit 6a43cd02ddbc597dc9a1f82c1e433f871a2f6f06 ]
According to documentation, the 64K erase opcode is located in VSCC range [16:23] instead of [8:15].
Use the proper value to shift the mask over the correct range.
--- drivers/spi/spi-intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-intel.c +1 -1
@@ -114,7 +114,7 @@#define ERASE_OPCODE_SHIFT 8#define ERASE_OPCODE_MASK (0xff << ERASE_OPCODE_SHIFT)#define ERASE_64K_OPCODE_SHIFT 16 -#define ERASE_64K_OPCODE_MASK (0xff << ERASE_OPCODE_SHIFT) +#define ERASE_64K_OPCODE_MASK (0xff << ERASE_64K_OPCODE_SHIFT)#define INTEL_SPI_TIMEOUT 5000/* ms */ #define INTEL_SPI_FIFO_SZ 64
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 12/314 ASoC: codecs: jz4725b: add missed Line In power control bit
In reply to Greg Kroah-HartmanFrom: Siarhei Volkau <[email protected]>
[ Upstream commit 1013999b431b4bcdc1f5ae47dd3338122751db31 ]
Line In path stayed powered off during capturing or bypass to mixer.
--- sound/soc/codecs/jz4725b.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/jz4725b.c +2 -1
@@ -236,7 +236,8 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {SND_SOC_DAPM_MIXER ("DAC to Mixer" ,JZ4725B_CODEC_REG_CR1 ,REG_CR1_DACSEL_OFFSET ,0 ,NULL ,0 ), -SND_SOC_DAPM_MIXER ("Line In" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ), +SND_SOC_DAPM_MIXER ("Line In" ,JZ4725B_CODEC_REG_PMR1 , +REG_PMR1_SB_LIN_OFFSET ,1 ,NULL ,0 ),SND_SOC_DAPM_MIXER ("HP Out" ,JZ4725B_CODEC_REG_CR1 , REG_CR1_HP_DIS_OFFSET, 1, NULL, 0),
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 13/314 ASoC: codecs: jz4725b: fix reported volume for Master ctl
In reply to Greg Kroah-HartmanFrom: Siarhei Volkau <[email protected]>
[ Upstream commit 088777bf65b98cfa4b5378119d0a7d49a58ece44 ]
DAC volume control is the Master Playback Volume at the moment and it reports wrong levels in alsamixer and other alsa apps.
The patch fixes that, as stated in manual on the jz4725b SoC (16.6.3.4 Programmable attenuation: GOD) the ctl range varies from -22.5dB to 0dB with 1.5dB step.
--- sound/soc/codecs/jz4725b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/jz4725b.c +1 -1
@@ -142,8 +142,8 @@ struct jz_icdc {struct clk *clk; }; -static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_dac_tlv, -2250, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);static const struct snd_kcontrol_new jz4725b_codec_controls[] = { SOC_DOUBLE_TLV("Master Playback Volume",
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 14/314 ASoC: codecs: jz4725b: use right control for Capture Volume
In reply to Greg Kroah-HartmanFrom: Siarhei Volkau <[email protected]>
[ Upstream commit 1538e2c8c9b7e7a656effcc6e4e7cfe8c1b405fd ]
Line In Bypass control is used as Master Capture at the moment this is completely incorrect.
Current control routed to Mixer instead of ADC, thus can't affect Capture path. ADC control shall be used instead.
ADC volume control parameters are different, so the patch fixes that as well. Manual says (16.6.3.2 Programmable input attenuation amplifier:
PGATM) that gain varies in range 0dB..22.5dB with 1.5dB step.
--- sound/soc/codecs/jz4725b.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
sound/soc/codecs/jz4725b.c +9 -6
@@ -136,13 +136,16 @@ enum {#define REG_CGR3_GO1L_OFFSET 0#define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET) +#define REG_CGR10_GIL_OFFSET 0 +#define REG_CGR10_GIR_OFFSET 4 +struct jz_icdc {struct regmap *regmap;void __iomem *base;struct clk *clk; }; -static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
@@ -151,11 +154,11 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = { REG_CGR1_GODL_OFFSET, REG_CGR1_GODR_OFFSET, 0xf, 1, jz4725b_dac_tlv), -SOC_DOUBLE_R_TLV ("Master Capture Volume" , -JZ4725B_CODEC_REG_CGR3 , -JZ4725B_CODEC_REG_CGR2 , -REG_CGR2_GO1R_OFFSET , -0x1f ,1 , jz4725b_line_tlv), +SOC_DOUBLE_TLV ("Master Capture Volume" , +JZ4725B_CODEC_REG_CGR10 , +REG_CGR10_GIL_OFFSET , +REG_CGR10_GIR_OFFSET , +0xf ,0 , jz4725b_adc_tlv),SOC_SINGLE ("Master Playback Switch" ,JZ4725B_CODEC_REG_CR1 , REG_CR1_DAC_MUTE_OFFSET, 1, 1),
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 15/314 ASoC: codecs: jz4725b: fix capture selector naming
In reply to Greg Kroah-HartmanFrom: Siarhei Volkau <[email protected]>
[ Upstream commit 80852f8268769715db335a22305e81a0c4a38a84 ]
At the moment Capture source selector appears on Playback tab in the alsamixer and has a senseless name.
Let's fix that.
--- sound/soc/codecs/jz4725b.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/soc/codecs/jz4725b.c +7 -7
@@ -183,7 +183,7 @@ static SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum, jz4725b_codec_adc_src_texts, jz4725b_codec_adc_src_values);static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl = -SOC_DAPM_ENUM ("Route" , jz4725b_codec_adc_src_enum); +SOC_DAPM_ENUM ("ADC Source Capture Route" , jz4725b_codec_adc_src_enum);static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = { SOC_DAPM_SINGLE("Line In Bypass", JZ4725B_CODEC_REG_CR1,
@@ -228,7 +228,7 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {SND_SOC_DAPM_ADC ("ADC" ,"Capture" ,JZ4725B_CODEC_REG_PMR1 ,REG_PMR1_SB_ADC_OFFSET ,1 ), -SND_SOC_DAPM_MUX ("ADC Source" ,SND_SOC_NOPM ,0 ,0 , +SND_SOC_DAPM_MUX ("ADC Source Capture Route" ,SND_SOC_NOPM ,0 ,0 , &jz4725b_codec_adc_src_ctrl),/* Mixer */
@@ -287,11 +287,11 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = { {"Mixer", NULL, "DAC to Mixer"}, {"Mixer to ADC", NULL, "Mixer"}, - {"ADC Source", "Mixer", "Mixer to ADC"}, - {"ADC Source", "Line In", "Line In"}, - {"ADC Source", "Mic 1", "Mic 1"}, - {"ADC Source", "Mic 2", "Mic 2"}, - {"ADC", NULL, "ADC Source"}, + {"ADC Source Capture Route", "Mixer", "Mixer to ADC"}, + {"ADC Sourc Capture Routee", "Line In", "Line In"}, + {"ADC Source Capture Route", "Mic 1", "Mic 1"}, + {"ADC Source Capture Route", "Mic 2", "Mic 2"}, + {"ADC", NULL, "ADC Source Capture Route"}, {"Out Stage", NULL, "Mixer"}, {"HP Out", NULL, "Out Stage"},
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 16/314 ASoC: Intel: sof_sdw: add quirk variant for LAPBC710 NUC15
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 41deb2db64997d01110faaf763bd911d490dfde7 ]
Some NUC15 LAPBC710 devices don't expose the same DMI information as the Intel reference, add additional entry in the match table.
--- sound/soc/intel/boards/sof_sdw.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
sound/soc/intel/boards/sof_sdw.c +11 -0
@@ -202,6 +202,17 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {SOF_SDW_PCH_DMIC | RT711_JD1), }, + { +/* NUC15 LAPBC710 skews */ + .callback = sof_sdw_quirk_cb, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Intel Corporation" ), + DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"), + }, + .driver_data = (void *)(SOF_SDW_TGL_HDMI | +SOF_SDW_PCH_DMIC | + RT711_JD1), + }, /* TigerLake-SDCA devices */ { .callback = sof_sdw_quirk_cb,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 17/314 selftests/futex: fix build for clang
In reply to Greg Kroah-HartmanFrom: Ricardo Cañuelo <[email protected]>
[ Upstream commit 03cab65a07e083b6c1010fbc8f9b817e9aca75d9 ]
Don't use the test-specific header files as source files to force a target dependency, as clang will complain if more than one source file is used for a compile command with a single '-o' flag.
Use the proper Makefile variables instead as defined in tools/testing/selftests/lib.mk.
--- tools/testing/selftests/futex/functional/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
tools/testing/selftests/futex/functional/Makefile +2 -4
@@ -3,11 +3,11 @@ INCLUDES := -I../include -I../../ -I../../../../../usr/include/ CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt -HEADERS := \ +LOCAL_HDRS := \ ../include/futextest.h \ ../include/atomic.h \ ../include/logging.h -TEST_GEN_FILES := \ +TEST_GEN_PROGS := \ futex_wait_timeout \ futex_wait_wouldblock \ futex_requeue_pi \
@@ -24,5 +24,3 @@ TEST_PROGS := run.sh top_srcdir = ../../../../.. DEFAULT_INSTALL_HDR_PATH := 1 include ../../lib.mk - -$(TEST_GEN_FILES): $(HEADERS)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 18/314 selftests/intel_pstate: fix build for ARCH=x86_64
In reply to Greg Kroah-HartmanFrom: Ricardo Cañuelo <[email protected]>
[ Upstream commit beb7d862ed4ac6aa14625418970f22a7d55b8615 ]
Handle the scenario where the build is launched with the ARCH envvar defined as x86_64.
--- tools/testing/selftests/intel_pstate/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/intel_pstate/Makefile +3 -3
@@ -2,10 +2,10 @@ CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE LDLIBS += -lm -uname_M := $(shell uname -m 2>/dev/null || echo not) -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) +ARCH ?= $(shell uname -m 2>/dev/null || echo not) +ARCH_PROCESSED := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/) -ifeq (x86,$(ARCH)) +ifeq (x86,$(ARCH_PROCESSED)) TEST_GEN_FILES := msr aperf endif
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 19/314 selftests/kexec: fix build for ARCH=x86_64
In reply to Greg Kroah-HartmanFrom: Ricardo Cañuelo <[email protected]>
[ Upstream commit 2a8e366b23fea29a5308f71ba49555e3c8c664f1 ]
Handle the scenario where the build is launched with the ARCH envvar defined as x86_64.
--- tools/testing/selftests/kexec/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/kexec/Makefile +3 -3
@@ -1,10 +1,10 @@ # SPDX-License-Identifier: GPL-2.0-only # Makefile for kexec tests -uname_M := $(shell uname -m 2>/dev/null || echo not) -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) +ARCH ?= $(shell uname -m 2>/dev/null || echo not) +ARCH_PROCESSED := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/) -ifeq ($(ARCH),$(filter $(ARCH),x86 ppc64le)) +ifeq ($(ARCH_PROCESSED),$(filter $(ARCH_PROCESSED),x86 ppc64le)) TEST_PROGS := test_kexec_load.sh test_kexec_file_load.sh TEST_FILES := kexec_common_lib.sh
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 20/314 ASoC: Intel: sof_rt5682: Add quirk for Rex board
In reply to Greg Kroah-HartmanFrom: Yong Zhi <[email protected]>
[ Upstream commit b4dd2e3758709aa8a2abd1ac34c56bd09b980039 ]
Add mtl_mx98357_rt5682 driver data for Chrome Rex board support.
--- sound/soc/intel/boards/sof_rt5682.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/soc/intel/boards/sof_rt5682.c +12 -0
@@ -225,6 +225,18 @@ static const struct dmi_system_id sof_rt5682_quirk_table[] = {SOF_RT5682_SSP_AMP (2 ) | SOF_RT5682_NUM_HDMIDEV(4)), }, + { + .callback = sof_rt5682_quirk_cb, + .matches = { + DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Rex"), + }, + .driver_data = (void *)(SOF_RT5682_MCLK_EN | +SOF_RT5682_SSP_CODEC (2 ) | +SOF_SPEAKER_AMP_PRESENT | +SOF_RT5682_SSP_AMP (0 ) | +SOF_RT5682_NUM_HDMIDEV (4 ) + ), + }, {} };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 21/314 rtc: cmos: fix build on non-ACPI platforms
In reply to Greg Kroah-HartmanFrom: Alexandre Belloni <[email protected]>
[ Upstream commit db4e955ae333567dea02822624106c0b96a2f84f ]
Now that rtc_wake_setup is called outside of cmos_wake_setup, it also need to be defined on non-ACPI platforms.
--- drivers/rtc/rtc-cmos.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/rtc/rtc-cmos.c +3 -0
@@ -1344,6 +1344,9 @@ static void cmos_check_acpi_rtc_status(struct device *dev, { } +static void rtc_wake_setup (struct device *dev) +{ +}#endif #ifdef CONFIG_PNP
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 22/314 ASoC: rt1308-sdw: add the default value of some registers
In reply to Greg Kroah-HartmanFrom: Shuming Fan <[email protected]>
[ Upstream commit 75d8b1662ca5c20cf8365575222abaef18ff1f50 ]
The driver missed the default value of register 0xc070/0xc360. This patch adds that default value to avoid invalid register access when the device doesn't be enumerated yet.
--- sound/soc/codecs/rt1308-sdw.h | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/codecs/rt1308-sdw.h +2 -0
@@ -139,10 +139,12 @@ static const struct reg_default rt1308_reg_defaults[] = { { 0x3005, 0x23 }, { 0x3008, 0x02 }, { 0x300a, 0x00 }, + { 0xc000 | (RT1308_DATA_PATH << 4), 0x00 }, { 0xc003 | (RT1308_DAC_SET << 4), 0x00 }, { 0xc000 | (RT1308_POWER << 4), 0x00 }, { 0xc001 | (RT1308_POWER << 4), 0x00 }, { 0xc002 | (RT1308_POWER << 4), 0x00 }, + { 0xc000 | (RT1308_POWER_STATUS << 4), 0x00 }, };#define RT1308_SDW_OFFSET 0xc000
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 23/314 ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo ThinkBook 16 Gen 4+ ARA to the Quirks List
In reply to Greg Kroah-HartmanFrom: linkt <[email protected]>
[ Upstream commit a450b5c8739248069e11f72129fca61a56125577 ]
Lenovo ThinkBook 14 Gen 4+ ARA and ThinkBook 16 Gen 4+ ARA
need to be added to the list of quirks for the microphone to work properly.
--- sound/soc/amd/yc/acp6x-mach.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +14 -0
@@ -45,6 +45,20 @@ static struct snd_soc_card acp6x_card = { };static const struct dmi_system_id yc_acp_quirk_table[] = { + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"21D0" ), + } + }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"21D1" ), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 24/314 ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table
In reply to Greg Kroah-HartmanFrom: Leohearts <[email protected]>
[ Upstream commit a75481fa00cc06a8763e1795b93140407948c03a ]
Lenovo Thinkbook 14+ 2022 (ThinkBook 14 G4+ ARA) uses Ryzen 6000 processor, and has the same microphone problem as other ThinkPads with AMD Ryzen 6000 series CPUs, which has been listed in https://bugzilla.kernel.org/show_bug.cgi?id=216267.
Adding 21D0 to quirks table solves this microphone problem for ThinkBook 14 G4+ ARA.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -52,6 +52,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "21D0"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "21D0"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 25/314 drm/amdgpu: Adjust MES polling timeout for sriov
In reply to Greg Kroah-HartmanFrom: Yiqing Yao <[email protected]>
[ Upstream commit 226dcfad349f23f7744d02b24f8ec3bc4f6198ac ]
[why]
MES response time in sriov may be longer than default value due to reset or init in other VF. A timeout value specific to sriov is needed.
[how]
When in sriov, adjust the timeout value to calculated worst case scenario.
--- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +8 -1
@@ -96,7 +96,14 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,struct amdgpu_device *adev = mes->adev;struct amdgpu_ring *ring = &mes->ring;unsigned long flags; +signed long timeout = adev->usec_timeout; +if (amdgpu_emu_mode) { + timeout *=100 ; + }else if (amdgpu_sriov_vf (adev)) { +/* Worst case in sriov where all other 15 VF timeout, each VF needs about 600ms */ + timeout =15 *600 *1000 ; + }BUG_ON (size %4 !=0 );spin_lock_irqsave (&mes->ring_lock, flags);
@@ -116,7 +123,7 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,DRM_DEBUG ("MES msg=%d was emitted\n" , x_pkt->header.opcode); r =amdgpu_fence_wait_polling (ring, ring->fence_drv.sync_seq, - adev->usec_timeout * (amdgpu_emu_mode ?100 :1 )); + timeout);if (r <1 ) {DRM_ERROR ("MES failed to response msg=%d\n" , x_pkt->header.opcode);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 26/314 platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models
In reply to Greg Kroah-HartmanFrom: Jelle van der Waa <[email protected]>
[ Upstream commit a10d50983f7befe85acf95ea7dbf6ba9187c2d70 ]
thinkpad_acpi was reporting 2 fans on a ThinkPad T14s gen 1, even though the laptop has only 1 fan.
The second, not present fan always reads 65535 (-1 in 16 bit signed), ignore fans which report 65535 to avoid reporting the non present fan.
--- drivers/platform/x86/thinkpad_acpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/thinkpad_acpi.c +3 -1
@@ -263,6 +263,8 @@ enum tpacpi_hkey_event_t {#define TPACPI_DBG_BRGHT 0x0020#define TPACPI_DBG_MIXER 0x0040 +#define FAN_NOT_PRESENT 65535 +#define strlencmp (a, b) (strncmp((a), (b), strlen(b)))
@@ -8876,7 +8878,7 @@ static int __init fan_init(struct ibm_init_struct *iibm)/* Try and probe the 2nd fan */ tp_features.second_fan =1 ;/* needed for get_speed to work */ res =fan2_get_speed (&speed); -if (res >=0 ) { +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 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 27/314 platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core driver
In reply to Greg Kroah-HartmanFrom: Gayatri Kammela <[email protected]>
[ Upstream commit 555a68dd681b7437a2708001d465c85f6dfa6955 ]
Add Raptor Lake client parts (both RPL and RPL_S) support to pmc core driver. Raptor Lake client parts reuse all the Alder Lake PCH IPs.
--- drivers/platform/x86/intel/pmc/core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/platform/x86/intel/pmc/core.c +2 -0
@@ -1914,6 +1914,8 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE_N , &tgl_reg_map),X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE , &adl_reg_map),X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE_P , &tgl_reg_map), +X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE , &adl_reg_map), + X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S, &adl_reg_map), {} };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 28/314 drm/amd/display: Remove wrong pipe control lock
In reply to Greg Kroah-HartmanFrom: Rodrigo Siqueira <[email protected]>
[ Upstream commit ca08a1725d0d78efca8d2dbdbce5ea70355da0f2 ]
When using a device based on DCN32/321,
we have an issue where a second
4k@60Hz display does not light up,
and the system becomes unresponsive
for a few minutes. In the debug process,
it was possible to see a hang
in the function dcn20_post_unlock_program_front_end in this part:
for (j = 0; j < TIMEOUT_FOR_PIPE_ENABLE_MS*1000
&& hubp->funcs->hubp_is_flip_pending(hubp); j++) mdelay(1); }
The hubp_is_flip_pending always returns positive for waiting pending flips which is a symptom of pipe hang. Additionally, the dmesg log shows this message after a few minutes:
BUG: soft lockup - CPU#4 stuck for 26s! ... [ +0.000003] dcn20_post_unlock_program_front_end+0x112/0x340 [amdgpu] [ +0.000171] dc_commit_state_no_check+0x63d/0xbf0 [amdgpu] [ +0.000155] ? dc_validate_global_state+0x358/0x3d0 [amdgpu] [ +0.000154] dc_commit_state+0xe2/0xf0 [amdgpu]
This confirmed the hypothesis that we had a pipe hanging somewhere. Next, after checking the ftrace entries, we have the below weird sequence:
[..]
2) | dcn10_lock_all_pipes [amdgpu]() {
2) 0.120 us | optc1_is_tg_enabled [amdgpu]();
2) | dcn20_pipe_control_lock [amdgpu]() {
2) | dc_dmub_srv_clear_inbox0_ack [amdgpu]() {
2) 0.121 us | amdgpu_dm_dmub_reg_write [amdgpu]();
2) 0.551 us | }
2) | dc_dmub_srv_send_inbox0_cmd [amdgpu]() {
2) 0.110 us | amdgpu_dm_dmub_reg_write [amdgpu]();
2) 0.511 us | }
2) | dc_dmub_srv_wait_for_inbox0_ack [amdgpu]() {
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();
2) 0.110 us | amdgpu_dm_dmub_reg_read [amdgpu]();[..]
We are not expected to read from dmub register so many times and for so long. From the trace log, it was possible to identify that the function dcn20_pipe_control_lock was triggering the dmub operation when it was unnecessary and causing the hang issue. This commit drops the unnecessary dmub code and, consequently, fixes the second display not lighting up the issue.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +1 -11
@@ -1262,16 +1262,6 @@ void dcn20_pipe_control_lock( lock, &hw_locks, &inst_flags); - }else if (pipe->stream && pipe->stream->mall_stream_config.type ==SUBVP_MAIN ) { -union dmub_inbox0_cmd_lock_hw hw_lock_cmd = {0 }; - hw_lock_cmd.bits.command_code =DMUB_INBOX0_CMD__HW_LOCK ; - hw_lock_cmd.bits.hw_lock_client =HW_LOCK_CLIENT_DRIVER ; - hw_lock_cmd.bits.lock_pipe =1 ; - hw_lock_cmd.bits.otg_inst = pipe->stream_res.tg->inst; - hw_lock_cmd.bits.lock = lock; -if (!lock) - hw_lock_cmd.bits.should_release =1 ; -dmub_hw_lock_mgr_inbox0_cmd (dc->ctx->dmub_srv, hw_lock_cmd); }else if (pipe->plane_state !=NULL && pipe->plane_state->triplebuffer_flips) {if (lock) pipe->stream_res.tg->funcs->triplebuffer_lock (pipe->stream_res.tg);
@@ -1848,7 +1838,7 @@ void dcn20_post_unlock_program_front_end(for (j =0 ; j <TIMEOUT_FOR_PIPE_ENABLE_MS *1000 && hubp->funcs->hubp_is_flip_pending (hubp); j++) -mdelay (1 ); +udelay (1 ); } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 29/314 drm/amd/display: Dont return false if no stream
In reply to Greg Kroah-HartmanFrom: Alvin Lee <[email protected]>
[ Upstream commit abe4d9f03fae76c9650b0d942faf6990b35c377b ]
pipe_ctx[i] exists even if the pipe is not
in use. If the pipe is not in use it will
always have a null stream, so don't return
false in this case.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +1 -1
@@ -187,7 +187,7 @@ bool dcn32_all_pipes_have_stream_and_plane(struct dc *dc,struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];if (!pipe->stream) -return false; +continue ;if (!pipe->plane_state)return false;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 30/314 drm/scheduler: fix fence ref counting
In reply to Greg Kroah-HartmanFrom: Christian König <[email protected]>
[ Upstream commit b3af84383e7abdc5e63435817bb73a268e7c3637 ]
We leaked dependency fences when processes were beeing killed.
Additional to that grab a reference to the last scheduled fence.
--- drivers/gpu/drm/scheduler/sched_entity.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/scheduler/sched_entity.c +5 -1
@@ -207,6 +207,7 @@ static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f, struct drm_sched_job *job = container_of(cb, struct drm_sched_job, finish_cb); +dma_fence_put (f);INIT_WORK (&job->work, drm_sched_entity_kill_jobs_work);schedule_work (&job->work); }
@@ -234,8 +235,10 @@ static void drm_sched_entity_kill_jobs(struct drm_sched_entity *entity)struct drm_sched_fence *s_fence = job->s_fence;/* Wait for all dependencies to avoid data corruptions */ -while ((f =drm_sched_job_dependency (job, entity))) +while ((f =drm_sched_job_dependency (job, entity))) {dma_fence_wait (f, false); +dma_fence_put (f); + }drm_sched_fence_scheduled (s_fence);dma_fence_set_error (&s_fence->finished, -ESRCH );
@@ -250,6 +253,7 @@ static void drm_sched_entity_kill_jobs(struct drm_sched_entity *entity)continue ; } +dma_fence_get (entity->last_scheduled); r =dma_fence_add_callback (entity->last_scheduled, &job->finish_cb, drm_sched_entity_kill_jobs_cb);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 31/314 ACPI: scan: Add LATT2021 to acpi_ignore_dep_ids[]
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit fa153b7cddce795662d38f78a87612c166c0f692 ]
Some x86/ACPI laptops with MIPI cameras have a LATT2021 ACPI device in the _DEP dependency list of the ACPI devices for the camera-sensors (which have flags.honor_deps set).
The _DDN for the LATT2021 device is "Lattice FW Update Client Driver", suggesting that this is used for firmware updates of something. There is no Linux driver for this and if Linux gets support for updates it will likely be in userspace through fwupd.
For now add the LATT2021 HID to acpi_ignore_dep_ids[] so that acpi_dev_ready_for_enumeration() will return true once the other _DEP dependencies are met.
--- drivers/acpi/scan.c | 1 + 1 file changed, 1 insertion(+)
drivers/acpi/scan.c +1 -0
@@ -796,6 +796,7 @@ static bool acpi_info_matches_ids(struct acpi_device_info *info,static const char *const acpi_ignore_dep_ids[] = {"PNP0D80" ,/* Windows-compatible System Power Management Controller */ "INT33BD" ,/* Intel Baytrail Mailbox Device */ +"LATT2021" ,/* Lattice FW Update Client Driver */ NULL };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 32/314 cxl/mbox: Add a check on input payload size
In reply to Greg Kroah-HartmanFrom: Jonathan Cameron <[email protected]>
[ Upstream commit cf00b33058b196b4db928419dde68993b15a975b ]
A bug in the LSA code resulted in transfers slightly larger than the mailbox size. Let us make it easier to catch similar issues in future by adding a low level check.
--- drivers/cxl/core/mbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/mbox.c +1 -1
@@ -174,7 +174,7 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in, };int rc; -if (out_size > cxlds->payload_size) +if (in_size > cxlds->payload_size || out_size > cxlds->payload_size)return -E2BIG ; rc = cxlds->mbox_send (cxlds, &mbox_cmd);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 33/314 RDMA/efa: Add EFA 0xefa2 PCI ID
In reply to Greg Kroah-HartmanFrom: Michael Margolin <[email protected]>
[ Upstream commit b75927cff13e0b3b652a12da7eb9a012911799e8 ]
Add support for 0xefa2 devices.
--- drivers/infiniband/hw/efa/efa_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/efa/efa_main.c +3 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause /* -* Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All rights reserved. */ #include <linux/module.h>
@@ -14,10 +14,12 @@#define PCI_DEV_ID_EFA0_VF 0xefa0#define PCI_DEV_ID_EFA1_VF 0xefa1 +#define PCI_DEV_ID_EFA2_VF 0xefa2static const struct pci_device_id efa_pci_tbl[] = { {PCI_VDEVICE (AMAZON ,PCI_DEV_ID_EFA0_VF ) }, {PCI_VDEVICE (AMAZON ,PCI_DEV_ID_EFA1_VF ) }, + {PCI_VDEVICE (AMAZON ,PCI_DEV_ID_EFA2_VF ) }, { } };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 34/314 btrfs: raid56: properly handle the error when unable to find the missing stripe
In reply to Greg Kroah-HartmanFrom: Qu Wenruo <[email protected]>
[ Upstream commit f15fb2cd979a07fbfc666e2f04b8b30ec9233b2a ]
In raid56_alloc_missing_rbio(), if we can not determine where the missing device is inside the full stripe, we just BUG_ON().
This is not necessary especially the only caller inside scrub.c is already properly checking the return value, and will treat it as a memory allocation failure.
Fix the error handling by:
- Add an extra warning for the reason
Although personally speaking it may be better to be an ASSERT().
- Properly free the allocated rbio
--- fs/btrfs/raid56.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/btrfs/raid56.c +4 -2
@@ -2767,8 +2767,10 @@ raid56_alloc_missing_rbio(struct bio *bio, struct btrfs_io_context *bioc) rbio->faila =find_logical_bio_stripe (rbio, bio);if (rbio->faila ==-1 ) { -BUG (); -kfree (rbio); +btrfs_warn_rl (fs_info, +"can not determine the failed stripe number for full stripe %llu" , + bioc->raid_map[0 ]); +__free_raid_bio (rbio);return NULL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 35/314 NFSv4: Retry LOCK on OLD_STATEID during delegation return
In reply to Greg Kroah-HartmanFrom: Benjamin Coddington <[email protected]>
[ Upstream commit f5ea16137a3fa2858620dc9084466491c128535f ]
There's a small window where a LOCK sent during a delegation return can race with another OPEN on client, but the open stateid has not yet been updated. In this case, the client doesn't handle the OLD_STATEID error from the server and will lose this lock, emitting:
"NFS: nfs4_handle_delegation_recall_error: unhandled error -10024".
Fix this by sending the task through the nfs4 error handling in nfs4_lock_done() when we may have to reconcile our stateid with what the server believes it to be. For this case, the result is a retry of the LOCK operation with the updated stateid.
--- fs/nfs/nfs4proc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +4 -2
@@ -7137,6 +7137,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata) {struct nfs4_lockdata *data = calldata;struct nfs4_lock_state *lsp = data->lsp; +struct nfs_server *server =NFS_SERVER (d_inode (data->ctx->dentry));if (!nfs4_sequence_done (task, &data->res.seq_res))return ;
@@ -7144,8 +7145,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata) data->rpc_status = task->tk_status;switch (task->tk_status) {case 0 : -renew_lease (NFS_SERVER (d_inode (data->ctx->dentry)), - data->timestamp); +renew_lease (server, data->timestamp);if (data->arg.new_lock && !data->cancelled) { data->fl.fl_flags &= ~(FL_SLEEP |FL_ACCESS );if (locks_lock_inode_wait (lsp->ls_state->inode, &data->fl) <0 )
@@ -7166,6 +7166,8 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)if (!nfs4_stateid_match (&data->arg.open_stateid, &lsp->ls_state->open_stateid)) goto out_restart; +else if (nfs4_async_handle_error (task, server, lsp->ls_state,NULL ) == -EAGAIN ) + goto out_restart; }else if (!nfs4_stateid_match (&data->arg.lock_stateid, &lsp->ls_stateid)) goto out_restart;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 36/314 SUNRPC: Fix crasher in gss_unwrap_resp_integ()
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
[ Upstream commit 8a0fa3ff3b606b55c4edc71ad133e61529b64549 ]
If a zero length is passed to kmalloc() it returns 0x10, which is not a valid address. gss_unwrap_resp_integ() subsequently crashes when it attempts to dereference that pointer.
--- net/sunrpc/auth_gss/auth_gss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/auth_gss/auth_gss.c +1 -1
@@ -1989,7 +1989,7 @@ gss_unwrap_resp_integ(struct rpc_task *task, struct rpc_cred *cred, goto unwrap_failed; mic.len = len; mic.data =kmalloc (len,GFP_KERNEL ); -if (!mic.data) +if (ZERO_OR_NULL_PTR (mic.data)) goto unwrap_failed;if (read_bytes_from_xdr_buf (rcv_buf, offset, mic.data, mic.len)) goto unwrap_failed;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 37/314 ACPI: x86: Add another system to quirk list for forcing StorageD3Enable
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
[ Upstream commit 2124becad797245d49252d2d733aee0322233d7e ]
commit 018d6711c26e4 ("ACPI: x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable") introduced a quirk to allow a system with ambiguous use of _ADR 0 to force StorageD3Enable.
Julius Brockmann reports that Inspiron 16 5625 suffers that same symptoms. Add this other system to the list as well.
--- drivers/acpi/x86/utils.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/acpi/x86/utils.c +6 -0
@@ -219,6 +219,12 @@ static const struct dmi_system_id force_storage_d3_dmi[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 14 7425 2-in-1"), } }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 16 5625"), + } + }, {} };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 38/314 drm/rockchip: vop2: fix null pointer in plane_atomic_disable
In reply to Greg Kroah-HartmanFrom: Michael Tretter <[email protected]>
[ Upstream commit 471bf2406c043491b1a8288e5f04bc278f7d7ca1 ]
If the vop2_plane_atomic_disable function is called with NULL as a state, accessing the old_pstate runs into a null pointer exception. However, the drm_atomic_helper_disable_planes_on_crtc function calls the atomic_disable callback with state NULL.
Allow to disable a plane without passing a plane state by checking the old_pstate only if a state is passed.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +4 -2
@@ -997,13 +997,15 @@ static int vop2_plane_atomic_check(struct drm_plane *plane,static void vop2_plane_atomic_disable (struct drm_plane *plane,struct drm_atomic_state *state) { -struct drm_plane_state *old_pstate =drm_atomic_get_old_plane_state (state, plane); +struct drm_plane_state *old_pstate =NULL ;struct vop2_win *win =to_vop2_win (plane);struct vop2 *vop2 = win->vop2;drm_dbg (vop2->drm,"%s disable\n" , win->data->name); -if (!old_pstate->crtc) +if (state) + old_pstate =drm_atomic_get_old_plane_state (state, plane); +if (old_pstate && !old_pstate->crtc)return ;vop2_win_disable (win);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 39/314 drm/rockchip: vop2: disable planes when disabling the crtc
In reply to Greg Kroah-HartmanFrom: Michael Tretter <[email protected]>
[ Upstream commit 447fb14bf07905b880c9ed1ea92c53d6dd0649d7 ]
The vop2 driver needs to explicitly disable the planes if the crtc is disabled. Unless the planes are explicitly disabled, the address of the last framebuffer is kept in the registers of the VOP2. When re-enabling the encoder after it has been disabled by the driver, the VOP2 will start and read the framebuffer that has been freed but is still pointed to by the register. The iommu will catch these read accesses and print errors.
Explicitly disable the planes when the crtc is disabled to reset the registers.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +4 -0
@@ -878,10 +878,14 @@ static void vop2_crtc_atomic_disable(struct drm_crtc *crtc, {struct vop2_video_port *vp =to_vop2_video_port (crtc);struct vop2 *vop2 = vp->vop2; +struct drm_crtc_state *old_crtc_state;int ret;vop2_lock (vop2); + old_crtc_state =drm_atomic_get_old_crtc_state (state, crtc); +drm_atomic_helper_disable_planes_on_crtc (old_crtc_state, false); +drm_crtc_vblank_off (crtc);/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 40/314 ksefltests: pidfd: Fix wait_states: Test terminated by timeout
In reply to Greg Kroah-HartmanFrom: Li Zhijian <[email protected]>
[ Upstream commit 88e1f16ba58665e9edfce437ea487da2fa759af9 ]
0Day/LKP observed that the kselftest blocks forever since one of the pidfd_wait doesn't terminate in 1 of 30 runs. After digging into the source, we found that it blocks at:ASSERT_EQ(sys_waitid(P_PIDFD, pidfd, &info, WCONTINUED, NULL), 0);
wait_states has below testing flow:
CHILD PARENT
---------------+--------------
1 STOP itself
2 WAIT for CHILD STOPPED
3 SIGNAL CHILD to CONT
4 CONT
5 STOP itself
5' WAIT for CHILD CONT
6 WAIT for CHILD STOPPED
The problem is that the kernel cannot ensure the order of 5 and 5', once 5 goes first, the test will fail.
we can reproduce it by:
$ while true; do make run_tests -C pidfd; done
Introduce a blocking read in child process to make sure the parent can check its WCONTINUED.
--- tools/testing/selftests/pidfd/pidfd_wait.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
tools/testing/selftests/pidfd/pidfd_wait.c +10 -0
@@ -95,20 +95,28 @@ TEST(wait_states) .flags = CLONE_PIDFD | CLONE_PARENT_SETTID, .exit_signal = SIGCHLD, }; +int pfd[2 ];pid_t pid;siginfo_t info = { .si_signo =0 , }; +ASSERT_EQ (pipe (pfd),0 ); pid =sys_clone3 (&args);ASSERT_GE (pid,0 );if (pid ==0 ) { +char buf[2 ]; + +close (pfd[1 ]);kill (getpid (),SIGSTOP ); +ASSERT_EQ (read (pfd[0 ], buf,1 ),1 ); +close (pfd[0 ]);kill (getpid (),SIGSTOP );exit (EXIT_SUCCESS ); } +close (pfd[0 ]);ASSERT_EQ (sys_waitid (P_PIDFD , pidfd, &info,WSTOPPED ,NULL ),0 );ASSERT_EQ (info.si_signo,SIGCHLD );ASSERT_EQ (info.si_code,CLD_STOPPED );
@@ -117,6 +125,8 @@ TEST(wait_states)ASSERT_EQ (sys_pidfd_send_signal (pidfd,SIGCONT ,NULL ,0 ),0 );ASSERT_EQ (sys_waitid (P_PIDFD , pidfd, &info,WCONTINUED ,NULL ),0 ); +ASSERT_EQ (write (pfd[1 ],"C" ,1 ),1 ); +close (pfd[1 ]);ASSERT_EQ (info.si_signo,SIGCHLD );ASSERT_EQ (info.si_code,CLD_CONTINUED );ASSERT_EQ (info.si_pid, parent_tid);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 41/314 powerpc/64e: Fix amdgpu build on Book3E w/o AltiVec
In reply to Greg Kroah-HartmanFrom: Michael Ellerman <[email protected]>
[ Upstream commit 2153fc9623e5465f503d793d4c94ad65e9ec9b5f ]
There's a build failure for Book3E without AltiVec:
Error: cc1: error: AltiVec not supported in this target make[6]: *** [/linux/scripts/Makefile.build:250:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o] Error 1
This happens because the amdgpu build is only gated by PPC_LONG_DOUBLE_128, but that symbol can be enabled even though AltiVec is disabled.
The only user of PPC_LONG_DOUBLE_128 is amdgpu, so just add a dependency on AltiVec to that symbol to fix the build.
--- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/Kconfig +1 -1
@@ -284,7 +284,7 @@ config PPC # config PPC_LONG_DOUBLE_128 - depends on PPC64 + depends on PPC64 && ALTIVEC def_bool $(success,test "$(shell,echo __LONG_DOUBLE_128__ | $(CC) -E -P -)" = 1) config PPC_BARRIER_NOSPEC
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 42/314 block: blk_add_rq_to_plug(): clear stale last after flush
In reply to Greg Kroah-HartmanFrom: Al Viro <[email protected]>
[ Upstream commit 878eb6e48f240d02ed1c9298020a0b6370695f24 ]
blk_mq_flush_plug_list() empties ->mq_list and request we'd peeked there before that call is gone; in any case, we are not dealing with a mix of requests for different queues now - there's no requests left in the plug.
--- block/blk-mq.c | 1 + 1 file changed, 1 insertion(+)
block/blk-mq.c +1 -0
@@ -1183,6 +1183,7 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq) (!blk_queue_nomerges(rq->q) && blk_rq_bytes(last) >= BLK_PLUG_FLUSH_SIZE)) {blk_mq_flush_plug_list (plug, false); + last =NULL ;trace_block_plug (rq->q); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 43/314 firmware: arm_scmi: Cleanup the core driver removal callback
In reply to Greg Kroah-HartmanFrom: Cristian Marussi <[email protected]>
[ Upstream commit 3f4071cbd2063b917486d1047a4da47718215fee ]
Platform drivers .remove callbacks are not supposed to fail and report errors. Such errors are indeed ignored by the core platform drivers and the driver unbind process is anyway completed.
The SCMI core platform driver as it is now, instead, bails out reporting an error in case of an explicit unbind request.
Fix the removal path by adding proper device links between the core SCMI device and the SCMI protocol devices so that a full SCMI stack unbind is triggered when the core driver is removed. The remove process does not bail out anymore on the anomalous conditions triggered by an explicit unbind but the user is still warned.
--- drivers/firmware/arm_scmi/bus.c | 11 +++++++++++ drivers/firmware/arm_scmi/common.h | 1 + drivers/firmware/arm_scmi/driver.c | 31 ++++++++++++++++++------------ 3 files changed, 31 insertions(+), 12 deletions(-)
drivers/firmware/arm_scmi/bus.c +11 -0
@@ -216,9 +216,20 @@ void scmi_device_destroy(struct scmi_device *scmi_dev)device_unregister (&scmi_dev->dev); } +void scmi_device_link_add (struct device *consumer,struct device *supplier) +{ +struct device_link *link; + + link =device_link_add (consumer, supplier,DL_FLAG_AUTOREMOVE_CONSUMER ); + +WARN_ON (!link); +} +void scmi_set_handle (struct scmi_device *scmi_dev) { scmi_dev->handle =scmi_handle_get (&scmi_dev->dev); +if (scmi_dev->handle) +scmi_device_link_add (&scmi_dev->dev, scmi_dev->handle->dev); }int scmi_protocol_register (const struct scmi_protocol *proto)
drivers/firmware/arm_scmi/common.h +1 -0
@@ -97,6 +97,7 @@ static inline void unpack_scmi_header(u32 msg_hdr, struct scmi_msg_hdr *hdr)struct scmi_revision_info *scmi_revision_area_get (const struct scmi_protocol_handle *ph);int scmi_handle_put (const struct scmi_handle *handle); +void scmi_device_link_add (struct device *consumer,struct device *supplier);struct scmi_handle *scmi_handle_get (struct device *dev);void scmi_set_handle (struct scmi_device *scmi_dev); void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph,
drivers/firmware/arm_scmi/driver.c +19 -12
@@ -2277,10 +2277,16 @@ int scmi_protocol_device_request(const struct scmi_device_id *id_table) sdev =scmi_get_protocol_device (child, info, id_table->protocol_id, id_table->name); -/* Set handle if not already set: device existed */ -if (sdev && !sdev->handle) - sdev->handle = -scmi_handle_get_from_info_unlocked (info); +if (sdev) { +/* Set handle if not already set: device existed */ +if (!sdev->handle) + sdev->handle = +scmi_handle_get_from_info_unlocked (info); +/* Relink consumer and suppliers */ +if (sdev->handle) +scmi_device_link_add (&sdev->dev, + sdev->handle->dev); + } }else { dev_err(info->dev, "Failed. SCMI protocol %d not active.\n",
@@ -2479,20 +2485,17 @@ void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id)static int scmi_remove (struct platform_device *pdev) { -int ret =0 , id; +int ret, id;struct scmi_info *info =platform_get_drvdata (pdev);struct device_node *child;mutex_lock (&scmi_list_mutex);if (info->users) - ret = -EBUSY ; -else -list_del (&info->node); +dev_warn (&pdev->dev, +"Still active SCMI users will be forcibly unbound.\n" ); +list_del (&info->node);mutex_unlock (&scmi_list_mutex); -if (ret) -return ret; -scmi_notification_exit (&info->handle);mutex_lock (&info->protocols_mtx);
@@ -2504,7 +2507,11 @@ static int scmi_remove(struct platform_device *pdev)idr_destroy (&info->active_protocols);/* Safe to free channels since no more users */ -return scmi_cleanup_txrx_channels (info); + ret =scmi_cleanup_txrx_channels (info); +if (ret) +dev_warn (&pdev->dev,"Failed to cleanup SCMI channels.\n" ); + +return 0 ; } static ssize_t protocol_version_show(struct device *dev,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 44/314 firmware: arm_scmi: Make tx_prepare time out eventually
In reply to Greg Kroah-HartmanFrom: Cristian Marussi <[email protected]>
[ Upstream commit 59172b212ec0dbb97ceb5671d912e6e61fa802d5 ]
SCMI transports based on shared memory, at start of transmissions, have to wait for the shared Tx channel area to be eventually freed by the SCMI platform before accessing the channel. In fact the channel is owned by the SCMI platform until marked as free by the platform itself and, as such, cannot be used by the agent until relinquished.
As a consequence a badly misbehaving SCMI platform firmware could lock the channel indefinitely and make the kernel side SCMI stack loop forever waiting for such channel to be freed, possibly hanging the whole boot sequence.
Add a timeout to the existent Tx waiting spin-loop so that, when the system ends up in this situation, the SCMI stack can at least bail-out, nosily warn the user, and abort the transmission.
--- drivers/firmware/arm_scmi/common.h | 4 +++- drivers/firmware/arm_scmi/driver.c | 1 + drivers/firmware/arm_scmi/mailbox.c | 2 +- drivers/firmware/arm_scmi/optee.c | 2 +- drivers/firmware/arm_scmi/shmem.c | 31 +++++++++++++++++++++++++---- drivers/firmware/arm_scmi/smc.c | 2 +- 6 files changed, 34 insertions(+), 8 deletions(-)
drivers/firmware/arm_scmi/common.h +3 -1
@@ -118,6 +118,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id);* * @dev: Reference to device in the SCMI hierarchy corresponding to this * channel +* @rx_timeout_ms: The configured RX timeout in milliseconds. * @handle: Pointer to SCMI entity handle * @no_completion_irq: Flag to indicate that this channel has no completion * interrupt mechanism for synchronous commands.
@@ -127,6 +128,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id);*/ struct scmi_chan_info {struct device *dev; +unsigned int rx_timeout_ms;struct scmi_handle *handle;bool no_completion_irq;void *transport_info;
@@ -233,7 +235,7 @@ void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id);struct scmi_shared_mem ;void shmem_tx_prepare (struct scmi_shared_mem __iomem *shmem, -struct scmi_xfer *xfer); +struct scmi_xfer *xfer,struct scmi_chan_info *cinfo);u32 shmem_read_header (struct scmi_shared_mem __iomem *shmem);void shmem_fetch_response (struct scmi_shared_mem __iomem *shmem,struct scmi_xfer *xfer);
drivers/firmware/arm_scmi/driver.c +1 -0
@@ -2013,6 +2013,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct device *dev,return -ENOMEM ; cinfo->dev = dev; + cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms; ret = info->desc->ops->chan_setup (cinfo, info->dev, tx);if (ret)
drivers/firmware/arm_scmi/mailbox.c +1 -1
@@ -36,7 +36,7 @@ static void tx_prepare(struct mbox_client *cl, void *m) {struct scmi_mailbox *smbox =client_to_scmi_mailbox (cl); -shmem_tx_prepare (smbox->shmem, m); +shmem_tx_prepare (smbox->shmem, m, smbox->cinfo); }static void rx_callback (struct mbox_client *cl,void *m)
drivers/firmware/arm_scmi/optee.c +1 -1
@@ -498,7 +498,7 @@ static int scmi_optee_send_message(struct scmi_chan_info *cinfo,msg_tx_prepare (channel->req.msg, xfer); ret =invoke_process_msg_channel (channel,msg_command_size (xfer)); }else { -shmem_tx_prepare (channel->req.shmem, xfer); +shmem_tx_prepare (channel->req.shmem, xfer, cinfo); ret =invoke_process_smt_channel (channel); }
drivers/firmware/arm_scmi/shmem.c +27 -4
@@ -5,10 +5,13 @@* Copyright (C) 2019 ARM Ltd. */ +#include <linux/ktime.h> #include <linux/io.h> #include <linux/processor.h> #include <linux/types.h> +#include <asm-generic/bug.h> +#include "common.h" /*
@@ -30,16 +33,36 @@ struct scmi_shared_mem { };void shmem_tx_prepare (struct scmi_shared_mem __iomem *shmem, -struct scmi_xfer *xfer) +struct scmi_xfer *xfer,struct scmi_chan_info *cinfo) { +ktime_t stop; +/* * Ideally channel must be free by now unless OS timeout last * request and platform continued to process the same, wait * until it releases the shared memory, otherwise we may endup -* overwriting its response with new message payload or vice-versa +* overwriting its response with new message payload or vice-versa. +* Giving up anyway after twice the expected channel timeout so as +* not to bail-out on intermittent issues where the platform is +* occasionally a bit slower to answer. +* +* Note that after a timeout is detected we bail-out and carry on but +* the transport functionality is probably permanently compromised: +* this is just to ease debugging and avoid complete hangs on boot +* due to a misbehaving SCMI firmware. */ -spin_until_cond (ioread32 (&shmem->channel_status) & -SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE ); + stop =ktime_add_ms (ktime_get (),2 * cinfo->rx_timeout_ms); +spin_until_cond ((ioread32 (&shmem->channel_status) & +SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE ) || +ktime_after (ktime_get (), stop)); +if (!(ioread32 (&shmem->channel_status) & +SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE )) { +WARN_ON_ONCE (1 ); +dev_err (cinfo->dev, +"Timeout waiting for a free TX channel !\n" ); +return ; + } +/* Mark channel busy + clear error */ iowrite32 (0x0 , &shmem->channel_status); iowrite32(xfer->hdr.poll_completion ? 0 : SCMI_SHMEM_FLAG_INTR_ENABLED,
drivers/firmware/arm_scmi/smc.c +1 -1
@@ -188,7 +188,7 @@ static int smc_send_message(struct scmi_chan_info *cinfo,*/ smc_channel_lock_acquire (scmi_info, xfer); -shmem_tx_prepare (scmi_info->shmem, xfer); +shmem_tx_prepare (scmi_info->shmem, xfer, cinfo);arm_smccc_1_1_invoke (scmi_info->func_id,0 ,0 ,0 ,0 ,0 ,0 ,0 , &res);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 45/314 i2c: tegra: Allocate DMA memory for DMA engine
In reply to Greg Kroah-HartmanFrom: Thierry Reding <[email protected]>
[ Upstream commit cdbf26251d3b35c4ccaea0c3a6de4318f727d3d2 ]
When the I2C controllers are running in DMA mode, it is the DMA engine that performs the memory accesses rather than the I2C controller. Pass the DMA engine's struct device pointer to the DMA API to make sure the correct DMA operations are used.
This fixes an issue where the DMA engine's SMMU stream ID needs to be misleadingly set for the I2C controllers in device tree.
--- drivers/i2c/busses/i2c-tegra.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/i2c/busses/i2c-tegra.c +10 -6
@@ -284,6 +284,7 @@ struct tegra_i2c_dev {struct dma_chan *tx_dma_chan;struct dma_chan *rx_dma_chan;unsigned int dma_buf_size; +struct device *dma_dev;dma_addr_t dma_phys;void *dma_buf;
@@ -420,7 +421,7 @@ static int tegra_i2c_dma_submit(struct tegra_i2c_dev *i2c_dev, size_t len)static void tegra_i2c_release_dma (struct tegra_i2c_dev *i2c_dev) {if (i2c_dev->dma_buf) { -dma_free_coherent (i2c_dev->dev, i2c_dev->dma_buf_size, +dma_free_coherent (i2c_dev->dma_dev, i2c_dev->dma_buf_size, i2c_dev->dma_buf, i2c_dev->dma_phys); i2c_dev->dma_buf =NULL ; }
@@ -467,10 +468,13 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev) i2c_dev->tx_dma_chan = chan; +WARN_ON (i2c_dev->tx_dma_chan->device != i2c_dev->rx_dma_chan->device); + i2c_dev->dma_dev = chan->device->dev; + i2c_dev->dma_buf_size = i2c_dev->hw->quirks->max_write_len +I2C_PACKET_HEADER_SIZE ; - dma_buf =dma_alloc_coherent (i2c_dev->dev, i2c_dev->dma_buf_size, + dma_buf =dma_alloc_coherent (i2c_dev->dma_dev, i2c_dev->dma_buf_size, &dma_phys,GFP_KERNEL | __GFP_NOWARN);if (!dma_buf) {dev_err (i2c_dev->dev,"failed to allocate DMA buffer\n" );
@@ -1267,7 +1271,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,if (i2c_dev->dma_mode) {if (i2c_dev->msg_read) { -dma_sync_single_for_device (i2c_dev->dev, +dma_sync_single_for_device (i2c_dev->dma_dev, i2c_dev->dma_phys, xfer_size,DMA_FROM_DEVICE );
@@ -1275,7 +1279,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,if (err)return err; }else { -dma_sync_single_for_cpu (i2c_dev->dev, +dma_sync_single_for_cpu (i2c_dev->dma_dev, i2c_dev->dma_phys, xfer_size,DMA_TO_DEVICE ); }
@@ -1288,7 +1292,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,memcpy (i2c_dev->dma_buf +I2C_PACKET_HEADER_SIZE , msg->buf, msg->len); -dma_sync_single_for_device (i2c_dev->dev, +dma_sync_single_for_device (i2c_dev->dma_dev, i2c_dev->dma_phys, xfer_size,DMA_TO_DEVICE );
@@ -1339,7 +1343,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, }if (i2c_dev->msg_read && i2c_dev->msg_err ==I2C_ERR_NONE ) { -dma_sync_single_for_cpu (i2c_dev->dev, +dma_sync_single_for_cpu (i2c_dev->dma_dev, i2c_dev->dma_phys, xfer_size,DMA_FROM_DEVICE );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 46/314 i2c: i801: add lis3lv02ds I2C address for Vostro 5568
In reply to Greg Kroah-HartmanFrom: Nam Cao <[email protected]>
[ Upstream commit d6643d7207c572c1b0305ed505101f15502c6c87 ]
Dell Vostro 5568 laptop has lis3lv02d, but its i2c address is not known to the kernel. Add this address.
Output of "cat /sys/devices/platform/lis3lv02d/position" on Dell Vostro 5568 laptop:
- Horizontal: (-18,0,1044)
- Front elevated: (522,-18,1080)
- Left elevated: (-18,-360,1080)
- Upside down: (36,108,-1134)
--- drivers/i2c/busses/i2c-i801.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-i801.c +1 -0
@@ -1243,6 +1243,7 @@ static const struct {*/ { "Latitude 5480", 0x29 }, { "Vostro V131", 0x1d }, + { "Vostro 5568", 0x29 }, };static void register_dell_lis3lv02d_i2c_device (struct i801_priv *priv)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 47/314 drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid
In reply to Greg Kroah-HartmanFrom: Nathan Huckleberry <[email protected]>
[ Upstream commit fc007fb815ab5395c3962c09b79a1630b0fbed9c ]
The mode_valid field in drm_connector_helper_funcs is expected to be of type:
enum drm_mode_status (* mode_valid) (struct drm_connector *connector,
struct drm_display_mode *mode);
The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition.
The return type of imx_tve_connector_mode_valid should be changed from int to enum drm_mode_status.
--- drivers/gpu/drm/imx/imx-tve.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/imx/imx-tve.c +3 -2
@@ -218,8 +218,9 @@ static int imx_tve_connector_get_modes(struct drm_connector *connector)return ret; } -static int imx_tve_connector_mode_valid (struct drm_connector *connector, -struct drm_display_mode *mode) +static enum drm_mode_status +imx_tve_connector_mode_valid (struct drm_connector *connector, +struct drm_display_mode *mode) {struct imx_tve *tve =con_to_tve (connector);unsigned long rate;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 48/314 btrfs: remove pointless and double ulist frees in error paths of qgroup tests
In reply to Greg Kroah-HartmanFrom: Filipe Manana <[email protected]>
[ Upstream commit d0ea17aec12ea0f7b9d2ed727d8ef8169d1e7699 ]
Several places in the qgroup self tests follow the pattern of freeing the ulist pointer they passed to btrfs_find_all_roots() if the call to that function returned an error. That is pointless because that function always frees the ulist in case it returns an error.
Also In some places like at test_multiple_refs(), after a call to btrfs_qgroup_account_extent() we also leave "old_roots" and "new_roots" pointing to ulists that were freed, because btrfs_qgroup_account_extent() has freed those ulists, and if after that the next call to btrfs_find_all_roots() fails, we call ulist_free() on the "old_roots" ulist again, resulting in a double free.
So remove those calls to reduce the code size and avoid double ulist free in case of an error.
--- fs/btrfs/tests/qgroup-tests.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
fs/btrfs/tests/qgroup-tests.c +4 -12
@@ -225,7 +225,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root,*/ ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -240,7 +239,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -252,17 +250,18 @@ static int test_no_shared_qgroup(struct btrfs_root *root,return ret; } +/* btrfs_qgroup_account_extent() always frees the ulists passed to it. */ + old_roots =NULL ; + new_roots =NULL ; +if (btrfs_verify_qgroup_counts (fs_info,BTRFS_FS_TREE_OBJECTID , nodesize, nodesize)) {test_err ("qgroup counts didn't match expected values" );return -EINVAL ; } - old_roots =NULL ; - new_roots =NULL ; ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -276,7 +275,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -326,7 +324,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -341,7 +338,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -361,7 +357,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -376,7 +371,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -402,7 +396,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -417,7 +410,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 49/314 drm/amd/display: Ignore Cable ID Feature
In reply to Greg Kroah-HartmanFrom: Fangzhi Zuo <[email protected]>
[ Upstream commit 14aed119942f6c2f1286022323139f7404db5d2b ]
Ignore cable ID for DP2 receivers that does not support the feature.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
@@ -1549,6 +1549,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) adev->dm.dc->debug.visual_confirm = amdgpu_dc_visual_confirm; +/* TODO: Remove after DP2 receiver gets proper support of Cable ID feature */ + adev->dm.dc->debug.ignore_cable_id = true; + r =dm_dmub_hw_init (adev);if (r) {DRM_ERROR ("DMUB interface failed to initialize: status=%d\n" , r);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 50/314 drm/amd/display: Enable timing sync on DCN32
In reply to Greg Kroah-HartmanFrom: Alvin Lee <[email protected]>
[ Upstream commit c3d3f35b725bf9c93bec6d3c056f6bb7cfd27403 ]
Missed enabling timing sync on DCN32 because DCN32 has a different DML param.
--- drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +1 -0
@@ -1228,6 +1228,7 @@ int dcn20_populate_dml_pipes_from_context( pipes[pipe_cnt].pipe.src.dcc = false; pipes[pipe_cnt].pipe.src.dcc_rate =1 ; pipes[pipe_cnt].pipe.dest.synchronized_vblank_all_planes = synchronized_vblank; + pipes[pipe_cnt].pipe.dest.synchronize_timings = synchronized_vblank; pipes[pipe_cnt].pipe.dest.hblank_start = timing->h_total - timing->h_front_porch; pipes[pipe_cnt].pipe.dest.hblank_end = pipes[pipe_cnt].pipe.dest.hblank_start - timing->h_addressable
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 51/314 drm/amdgpu: set fb_modifiers_not_supported in vkms
In reply to Greg Kroah-HartmanFrom: Yifan Zhang <[email protected]>
[ Upstream commit 89b3554782e6b65894f0551e9e0a82ad02dac94d ]
This patch to fix the gdm3 start failure with virual display:
/usr/libexec/gdm-x-session[1711]: (II) AMDGPU(0): Setting screen physical size to 270 x 203 /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): Failed to make import prime FD as pixmap: 22 /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): failed to set mode: Invalid argument /usr/libexec/gdm-x-session[1711]: (WW) AMDGPU(0): Failed to set mode on CRTC 0 /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): Failed to enable any CRTC gnome-shell[1840]: Running GNOME Shell (using mutter 42.2) as a X11 window and compositing manager /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): failed to set mode: Invalid argument
vkms doesn't have modifiers support, set fb_modifiers_not_supported to bring the gdm back.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +2 -0
@@ -500,6 +500,8 @@ static int amdgpu_vkms_sw_init(void *handle)adev_to_drm (adev)->mode_config.fb_base = adev->gmc.aper_base; +adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true; + r =amdgpu_display_modeset_create_props (adev);if (r)return r;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 52/314 drm/amd: Fail the suspend if resources cant be evicted
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
[ Upstream commit 8d4de331f1b24a22d18e3c6116aa25228cf54854 ]
If a system does not have swap and memory is under 100% usage, amdgpu will fail to evict resources. Currently the suspend carries on proceeding to reset the GPU:
``` [drm] evicting device resources failed [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block <vcn_v3_0> failed -12 [drm] free PSP TMR buffer [TTM] Failed allocating page table [drm] evicting device resources failed amdgpu 0000:03:00.0: amdgpu: MODE1 reset amdgpu 0000:03:00.0: amdgpu: GPU mode1 reset amdgpu 0000:03:00.0: amdgpu: GPU smu mode1 reset ```
At this point if the suspend actually succeeded I think that amdgpu would have recovered because the GPU would have power cut off and restored. However the kernel fails to continue the suspend from the memory pressure and amdgpu fails to run the "resume" from the aborted suspend.
``` ACPI: PM: Preparing to enter system sleep state S3 SLUB: Unable to allocate memory on node -1, gfp=0xdc0(GFP_KERNEL|__GFP_ZERO) cache: Acpi-State, object size: 80, buffer size: 80, default order: 0, min order: 0 node 0: slabs: 22, objs: 1122, free: 0 ACPI Error: AE_NO_MEMORY, Could not update object reference count (20210730/utdelete-651) [drm:psp_hw_start [amdgpu]] *ERROR* PSP load kdb failed! [drm:psp_resume [amdgpu]] *ERROR* PSP resume failed [drm:amdgpu_device_fw_loading [amdgpu]] *ERROR* resume of IP block <psp> failed -62 amdgpu 0000:03:00.0: amdgpu: amdgpu_device_ip_resume failed (-62). PM: dpm_run_callback(): pci_pm_resume+0x0/0x100 returns -62 amdgpu 0000:03:00.0: PM: failed to resume async: error -62 ```
To avoid this series of unfortunate events, fail amdgpu's suspend when the memory eviction fails. This will let the system gracefully recover and the user can try suspend again when the memory pressure is relieved.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +10 -5
@@ -4055,15 +4055,18 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)* at suspend time. * */ -static void amdgpu_device_evict_resources (struct amdgpu_device *adev) +static int amdgpu_device_evict_resources (struct amdgpu_device *adev) { +int ret; +/* No need to evict vram on APUs for suspend to ram or s2idle */ if ((adev->in_s3 || adev->in_s0ix) && (adev->flags &AMD_IS_APU )) -return ; +return 0 ; -if (amdgpu_ttm_evict_resources (adev,TTM_PL_VRAM )) + ret =amdgpu_ttm_evict_resources (adev,TTM_PL_VRAM ); +if (ret)DRM_WARN ("evicting device resources failed\n" ); - +return ret; }/*
@@ -4113,7 +4116,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)if (!adev->in_s0ix)amdgpu_amdkfd_suspend (adev, adev->in_runpm); -amdgpu_device_evict_resources (adev); + r =amdgpu_device_evict_resources (adev); +if (r) +return r;amdgpu_fence_driver_hw_fini (adev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 53/314 drm/amd/display: Fix DCN32 DSC delay calculation
In reply to Greg Kroah-HartmanFrom: George Shen <[email protected]>
[ Upstream commit bad610c97c08eef3ed1fa769a8b08b94f95b451e ]
[Why]
DCN32 DSC delay calculation had an unintentional integer division, resulting in a mismatch against the DML spreadsheet.
[How]
Cast numerator to double before performing the division.
--- .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +1 -1
@@ -1746,7 +1746,7 @@ unsigned int dml32_DSCDelayRequirement(bool DSCEnabled, } DSCDelayRequirement_val = DSCDelayRequirement_val + (HTotal - HActive) * -dml_ceil (DSCDelayRequirement_val / HActive,1 ); +dml_ceil ((double )DSCDelayRequirement_val / HActive,1 ); DSCDelayRequirement_val = DSCDelayRequirement_val * PixelClock / PixelClockBackEnd;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 54/314 drm/amd/display: Use forced DSC bpp in DML
In reply to Greg Kroah-HartmanFrom: George Shen <[email protected]>
[ Upstream commit ab007e5db5d3b8b8975c7eec69992ff38fe2a46c ]
[Why]
DSC config is calculated separately from DML calculations. DML should use these separately calculated DSC params. The issue is that the calculated bpp is not properly propagated into DML.
[How]
Correctly used forced_bpp value in DML.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +1 -1
@@ -1627,7 +1627,7 @@ static void mode_support_configuration(struct vba_vars_st *v, && !mode_lib->vba.MSOOrODMSplitWithNonDPLink && !mode_lib->vba.NotEnoughLanesForMSO && mode_lib->vba.LinkCapacitySupport[i] == true && !mode_lib->vba.P2IWith420 - && !mode_lib->vba.DSCOnlyIfNecessaryWithBPP +//&& !mode_lib->vba.DSCOnlyIfNecessaryWithBPP && !mode_lib->vba.DSC422NativeNotSupported && !mode_lib->vba.MPCCombineMethodIncompatible && mode_lib->vba.ODMCombine2To1SupportCheckOK[i] == true
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +1 -1
@@ -624,7 +624,7 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) mode_lib->vba.skip_dio_check[mode_lib->vba.NumberOfActivePlanes] = dout->is_virtual; -if (!dout->dsc_enable) +if (dout->dsc_enable) mode_lib->vba.ForcedOutputLinkBPP[mode_lib->vba.NumberOfActivePlanes] = dout->output_bpp;else mode_lib->vba.ForcedOutputLinkBPP[mode_lib->vba.NumberOfActivePlanes] =0.0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 55/314 drm/amd/display: Round up DST_after_scaler to nearest int
In reply to Greg Kroah-HartmanFrom: George Shen <[email protected]>
[ Upstream commit 8dc323133d74518e3b5b07242e2b2f088799ea6e ]
[Why]
The DST_after_scaler value that DML spreadsheet outputs is generally the driver value round up to the nearest int.
--- .../gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c +2 -2
@@ -291,8 +291,8 @@ void dml32_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,dml_print ("DML_DLG: %s: vready_after_vcount0 = %d\n" , __func__, dlg_regs->vready_after_vcount0); - dst_x_after_scaler =get_dst_x_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx); - dst_y_after_scaler =get_dst_y_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx); + dst_x_after_scaler =dml_ceil (get_dst_x_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx),1 ); + dst_y_after_scaler =dml_ceil (get_dst_y_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx),1 );// do some adjustment on the dst_after scaler to account for odm combine mode dml_print ("DML_DLG: %s: input dst_x_after_scaler = %d\n" , __func__, dst_x_after_scaler);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 56/314 drm/amd/display: Investigate tool reported FCLK P-state deviations
In reply to Greg Kroah-HartmanFrom: Nevenko Stupar <[email protected]>
[ Upstream commit 7461016c5706eb8c477752bf69e5c9f5a38f502b ]
[Why]
Fix for some of the tool reported modes for FCLK P-state deviations and UCLK P-state deviations that are coming from DSC terms and/or Scaling terms causing MinActiveFCLKChangeLatencySupported and MaxActiveDRAMClockChangeLatencySupported incorrectly calculated in DML for these configurations.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +2 -1
@@ -364,7 +364,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanfor (k =0 ; k < mode_lib->vba.NumberOfActiveSurfaces; ++k) { v->DSCDelay[k] =dml32_DSCDelayRequirement (mode_lib->vba.DSCEnabled[k], mode_lib->vba.ODMCombineEnabled[k], mode_lib->vba.DSCInputBitPerComponent[k], - mode_lib->vba.OutputBpp[k], mode_lib->vba.HActive[k], mode_lib->vba.HTotal[k], + mode_lib->vba.OutputBppPerState[mode_lib->vba.VoltageLevel][k], + mode_lib->vba.HActive[k], mode_lib->vba.HTotal[k], mode_lib->vba.NumberOfDSCSlices[k], mode_lib->vba.OutputFormat[k], mode_lib->vba.Output[k], mode_lib->vba.PixelClock[k], mode_lib->vba.PixelClockBackEnd[k]);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 57/314 Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit f937b758a188d6fd328a81367087eddbb2fce50f ]
l2cap_global_chan_by_psm shall not return fixed channels as they are not meant to be connected by (S)PSM.
--- net/bluetooth/l2cap_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/l2cap_core.c +1 -1
@@ -1990,7 +1990,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,if (link_type ==LE_LINK && c->src_type ==BDADDR_BREDR )continue ; -if (c->psm == psm) { +if (c->chan_type !=L2CAP_CHAN_FIXED && c->psm == psm) {int src_match, dst_match;int src_any, dst_any;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 58/314 cxl/pmem: Use size_add() against integer overflow
In reply to Greg Kroah-HartmanFrom: Yu Zhe <[email protected]>
[ Upstream commit 4f1aa35f1fb7d51b125487c835982af792697ecb ]
"struct_size() + n" may cause a integer overflow,
use size_add() to handle it.
--- drivers/cxl/pmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/pmem.c +1 -1
@@ -151,7 +151,7 @@ static int cxl_pmem_set_config_data(struct cxl_dev_state *cxlds,return -EINVAL ;/* 4-byte status follows the input data in the payload */ -if (struct_size (cmd, in_buf, cmd->in_length) +4 > buf_len) +if (size_add (struct_size (cmd, in_buf, cmd->in_length),4 ) > buf_len)return -EINVAL ; set_lsa =
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 59/314 x86/cpu: Add several Intel server CPU model numbers
In reply to Greg Kroah-HartmanFrom: Tony Luck <[email protected]>
[ Upstream commit 7beade0dd41d42d797ccb7791b134a77fcebf35b ]
These servers are all on the public versions of the roadmap. The model numbers for Grand Ridge, Granite Rapids, and Sierra Forest were included in the September 2022 edition of the Instruction Set Extensions document.
--- arch/x86/include/asm/intel-family.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
arch/x86/include/asm/intel-family.h +10 -1
@@ -107,6 +107,11 @@#define INTEL_FAM6_SAPPHIRERAPIDS_X 0x8F/* Golden Cove */ +#define INTEL_FAM6_EMERALDRAPIDS_X 0xCF + +#define INTEL_FAM6_GRANITERAPIDS_X 0xAD +#define INTEL_FAM6_GRANITERAPIDS_D 0xAE +#define INTEL_FAM6_ALDERLAKE 0x97/* Golden Cove / Gracemont */ #define INTEL_FAM6_ALDERLAKE_L 0x9A/* Golden Cove / Gracemont */ #define INTEL_FAM6_ALDERLAKE_N 0xBE
@@ -118,7 +123,7 @@#define INTEL_FAM6_METEORLAKE 0xAC#define INTEL_FAM6_METEORLAKE_L 0xAA -/* "Small Core" Processors (Atom) */ +/* "Small Core" Processors (Atom/E-Core) */ #define INTEL_FAM6_ATOM_BONNELL 0x1C/* Diamondville, Pineview */ #define INTEL_FAM6_ATOM_BONNELL_MID 0x26/* Silverthorne, Lincroft */
@@ -145,6 +150,10 @@#define INTEL_FAM6_ATOM_TREMONT 0x96/* Elkhart Lake */ #define INTEL_FAM6_ATOM_TREMONT_L 0x9C/* Jasper Lake */ +#define INTEL_FAM6_SIERRAFOREST_X 0xAF + +#define INTEL_FAM6_GRANDRIDGE 0xB6 +/* Xeon Phi */ #define INTEL_FAM6_XEON_PHI_KNL 0x57/* Knights Landing */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 60/314 tools/testing/cxl: Fix some error exits
In reply to Greg Kroah-HartmanFrom: Dan Williams <[email protected]>
[ Upstream commit 86e86c3cb63325c12ea99fbce2cc5bafba86bb40 ]
Fix a few typos where 'goto err_port' was used rather than the object specific cleanup.
--- tools/testing/cxl/test/cxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/cxl/test/cxl.c +2 -2
@@ -695,7 +695,7 @@ static __init int cxl_test_init(void) pdev =platform_device_alloc ("cxl_switch_uport" , i);if (!pdev) - goto err_port; + goto err_uport; pdev->dev.parent = &root_port->dev; rc =platform_device_add (pdev);
@@ -713,7 +713,7 @@ static __init int cxl_test_init(void) pdev =platform_device_alloc ("cxl_switch_dport" , i);if (!pdev) - goto err_port; + goto err_dport; pdev->dev.parent = &uport->dev; rc =platform_device_add (pdev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 61/314 cifs: always iterate smb sessions using primary channel
In reply to Greg Kroah-HartmanFrom: Shyam Prasad N <[email protected]>
[ Upstream commit 8abcaeaed38109e5ccaf40218e0e9e387f07bfe6 ]
smb sessions and tcons currently hang off primary channel only. Secondary channels have the lists as empty. Whenever there's a need to iterate sessions or tcons, we should use the list in the corresponding primary channel.
--- fs/cifs/misc.c | 6 +++++- fs/cifs/smb2misc.c | 12 ++++++++++-- fs/cifs/smb2ops.c | 6 +++++- fs/cifs/smb2transport.c | 6 +++++- 4 files changed, 25 insertions(+), 5 deletions(-)
fs/cifs/misc.c +5 -1
@@ -400,6 +400,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv) {struct smb_hdr *buf = (struct smb_hdr *)buffer;struct smb_com_lock_req *pSMB = (struct smb_com_lock_req *)buf; +struct TCP_Server_Info *pserver;struct cifs_ses *ses;struct cifs_tcon *tcon;struct cifsInodeInfo *pCifsInode;
@@ -464,9 +465,12 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)if (!(pSMB->LockType &LOCKING_ANDX_OPLOCK_RELEASE ))return false; +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (srv) ? srv->primary_server : srv; +/* look up tcon based on tid & uid */ spin_lock (&cifs_tcp_ses_lock); -list_for_each_entry (ses, &srv->smb_ses_list, smb_ses_list) { +list_for_each_entry (ses, &pserver->smb_ses_list, smb_ses_list) {list_for_each_entry (tcon, &ses->tcon_list, tcon_list) {if (tcon->tid != buf->Tid)continue ;
fs/cifs/smb2misc.c +10 -2
@@ -135,6 +135,7 @@ static __u32 get_neg_ctxt_len(struct smb2_hdr *hdr, __u32 len,int smb2_check_message (char *buf,unsigned int len,struct TCP_Server_Info *server) { +struct TCP_Server_Info *pserver;struct smb2_hdr *shdr = (struct smb2_hdr *)buf;struct smb2_pdu *pdu = (struct smb2_pdu *)shdr;int hdr_size =sizeof (struct smb2_hdr );
@@ -143,6 +144,9 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)__u32 calc_len;/* calculated length */ __u64 mid; +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (server) ? server->primary_server : server; +/* * Add function to do table lookup of StructureSize by command * ie Validate the wct via smb2_struct_sizes table above
@@ -155,7 +159,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)/* decrypt frame now that it is completely read in */ spin_lock (&cifs_tcp_ses_lock); -list_for_each_entry (iter, &server->smb_ses_list, smb_ses_list) { +list_for_each_entry (iter, &pserver->smb_ses_list, smb_ses_list) {if (iter->Suid ==le64_to_cpu (thdr->SessionId)) { ses = iter;break ;
@@ -671,6 +675,7 @@ bool smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server) {struct smb2_oplock_break *rsp = (struct smb2_oplock_break *)buffer; +struct TCP_Server_Info *pserver;struct cifs_ses *ses;struct cifs_tcon *tcon;struct cifsInodeInfo *cinode;
@@ -691,9 +696,12 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)cifs_dbg (FYI ,"oplock level 0x%x\n" , rsp->OplockLevel); +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (server) ? server->primary_server : server; +/* look up tcon based on tid & uid */ spin_lock (&cifs_tcp_ses_lock); -list_for_each_entry (ses, &server->smb_ses_list, smb_ses_list) { +list_for_each_entry (ses, &pserver->smb_ses_list, smb_ses_list) {list_for_each_entry (tcon, &ses->tcon_list, tcon_list) {spin_lock (&tcon->open_file_lock);
fs/cifs/smb2ops.c +5 -1
@@ -2288,14 +2288,18 @@ static void smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server) {struct smb2_hdr *shdr = (struct smb2_hdr *)buf; +struct TCP_Server_Info *pserver;struct cifs_ses *ses;struct cifs_tcon *tcon;if (shdr->Status !=STATUS_NETWORK_NAME_DELETED )return ; +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (server) ? server->primary_server : server; +spin_lock (&cifs_tcp_ses_lock); -list_for_each_entry (ses, &server->smb_ses_list, smb_ses_list) { +list_for_each_entry (ses, &pserver->smb_ses_list, smb_ses_list) {list_for_each_entry (tcon, &ses->tcon_list, tcon_list) {if (tcon->tid ==le32_to_cpu (shdr->Id.SyncId.TreeId)) {spin_lock (&tcon->tc_lock);
fs/cifs/smb2transport.c +5 -1
@@ -140,9 +140,13 @@ int smb2_get_sign_key(__u64 ses_id, struct TCP_Server_Info *server, u8 *key)static struct cifs_ses *smb2_find_smb_ses_unlocked (struct TCP_Server_Info *server,__u64 ses_id) { +struct TCP_Server_Info *pserver;struct cifs_ses *ses; -list_for_each_entry (ses, &server->smb_ses_list, smb_ses_list) { +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (server) ? server->primary_server : server; + +list_for_each_entry (ses, &pserver->smb_ses_list, smb_ses_list) {if (ses->Suid != ses_id)continue ; ++ses->ses_count;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 62/314 ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source", "Routee" -> "Route"
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
[ Upstream commit df496157a5afa1b6d1f4c46ad6549c2c346d1e59 ]
There are two spelling mistakes in codec routing description. Fix it.
--- sound/soc/codecs/jz4725b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/jz4725b.c +1 -1
@@ -288,7 +288,7 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = { {"Mixer to ADC", NULL, "Mixer"}, {"ADC Source Capture Route", "Mixer", "Mixer to ADC"}, - {"ADC Sourc Capture Routee", "Line In", "Line In"}, + {"ADC Source Capture Route", "Line In", "Line In"}, {"ADC Source Capture Route", "Mic 1", "Mic 1"}, {"ADC Source Capture Route", "Mic 2", "Mic 2"}, {"ADC", NULL, "ADC Source Capture Route"},
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 63/314 arm64/mm: fold check for KFENCE into can_set_direct_map()
In reply to Greg Kroah-HartmanFrom: Mike Rapoport <[email protected]>
[ Upstream commit b9dd04a20f81333e4b99662f1bbaf7c9e3a1e137 ]
KFENCE requires linear map to be mapped at page granularity, so that it is possible to protect/unprotect single pages, just like with rodata_full and DEBUG_PAGEALLOC.
Instead of repating
can_set_direct_map() || IS_ENABLED(CONFIG_KFENCE)
make can_set_direct_map() handle the KFENCE case.
This also prevents potential false positives in kernel_page_present() that may return true for non-present page if CONFIG_KFENCE is enabled.
Stable-dep-of: 2081b3bd0c11 ("arm64: fix rodata=full again")
--- arch/arm64/mm/mmu.c | 8 ++------ arch/arm64/mm/pageattr.c | 8 +++++++- 2 files changed, 9 insertions(+), 7 deletions(-)
arch/arm64/mm/mmu.c +2 -6
@@ -539,7 +539,7 @@ static void __init map_mem(pgd_t *pgdp)*/ BUILD_BUG_ON (pgd_index (direct_map_end -1 ) ==pgd_index (direct_map_end)); -if (can_set_direct_map () ||IS_ENABLED (CONFIG_KFENCE )) +if (can_set_direct_map ()) flags |=NO_BLOCK_MAPPINGS |NO_CONT_MAPPINGS ;/*
@@ -1551,11 +1551,7 @@ int arch_add_memory(int nid, u64 start, u64 size,VM_BUG_ON (!mhp_range_allowed (start, size, true)); -/* -* KFENCE requires linear map to be mapped at page granularity, so that -* it is possible to protect/unprotect single pages in the KFENCE pool. -*/ -if (can_set_direct_map () ||IS_ENABLED (CONFIG_KFENCE )) +if (can_set_direct_map ()) flags |=NO_BLOCK_MAPPINGS |NO_CONT_MAPPINGS ; __create_pgd_mapping(swapper_pg_dir, start, __phys_to_virt(start),
arch/arm64/mm/pageattr.c +7 -1
@@ -21,7 +21,13 @@ bool rodata_full __ro_after_init = IS_ENABLED(CONFIG_RODATA_FULL_DEFAULT_ENABLEDbool can_set_direct_map (void ) { -return rodata_full ||debug_pagealloc_enabled (); +/* +* rodata_full, DEBUG_PAGEALLOC and KFENCE require linear map to be +* mapped at page granularity, so that it is possible to +* protect/unprotect single pages. +*/ +return rodata_full ||debug_pagealloc_enabled () || +IS_ENABLED (CONFIG_KFENCE ); }static int change_page_range (pte_t *ptep,unsigned long addr,void *data)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 64/314 arm64: fix rodata=full again
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit 2081b3bd0c11757725dcab9ba5d38e1bddb03459 ]
Commit 2e8cff0a0eee87b2 ("arm64: fix rodata=full") addressed a couple of issues with the rodata= kernel command line option, which is not a simple boolean on arm64, and inadvertently got broken due to changes in the generic bool handling.
Unfortunately, the resulting code never clears the rodata_full boolean variable if it defaults to true and rodata=on or rodata=off is passed, as the generic code is not aware of the existence of this variable.
Given the way this code is plumbed together, clearing rodata_full when returning false from arch_parse_debug_rodata() may result in inconsistencies if the generic code decides that it cannot parse the right hand side, so the best way to deal with this is to only take rodata_full in account if rodata_enabled is also true.
--- arch/arm64/mm/pageattr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/mm/pageattr.c +3 -2
@@ -26,7 +26,7 @@ bool can_set_direct_map(void)* mapped at page granularity, so that it is possible to * protect/unprotect single pages. */ -return rodata_full ||debug_pagealloc_enabled () || +return (rodata_enabled && rodata_full) ||debug_pagealloc_enabled () ||IS_ENABLED (CONFIG_KFENCE ); }
@@ -102,7 +102,8 @@ static int change_memory_common(unsigned long addr, int numpages,* If we are manipulating read-only permissions, apply the same * change to the linear mapping of the pages that back this VM area. */ -if (rodata_full && (pgprot_val (set_mask) ==PTE_RDONLY || +if (rodata_enabled && + rodata_full && (pgprot_val (set_mask) ==PTE_RDONLY ||pgprot_val (clear_mask) ==PTE_RDONLY )) {for (i =0 ; i < area->nr_pages; i++) { __change_memory_common((u64)page_address(area->pages[i]),
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 65/314 hugetlb: rename remove_huge_page to hugetlb_delete_from_page_cache
In reply to Greg Kroah-HartmanFrom: Mike Kravetz <[email protected]>
[ Upstream commit 7e1813d48dd30e6c6f235f6661d1bc108fcab528 ]
remove_huge_page removes a hugetlb page from the page cache. Change to hugetlb_delete_from_page_cache as it is a more descriptive name. huge_add_to_page_cache is global in scope, but only deals with hugetlb pages. For consistency and clarity, rename to hugetlb_add_to_page_cache.
Stable-dep-of: 8625147cafaa ("hugetlbfs: don't delete error page from pagecache")
--- fs/hugetlbfs/inode.c | 21 ++++++++++----------- include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 8 ++++---- 3 files changed, 15 insertions(+), 16 deletions(-)
fs/hugetlbfs/inode.c +10 -11
@@ -364,7 +364,7 @@ static int hugetlbfs_write_end(struct file *file, struct address_space *mapping,return -EINVAL ; } -static void remove_huge_page (struct page *page) +static void hugetlb_delete_from_page_cache (struct page *page) {ClearPageDirty (page);ClearPageUptodate (page);
@@ -487,15 +487,14 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart,folio_lock (folio);/* * We must free the huge page and remove from page -* cache (remove_huge_page) BEFORE removing the -* region/reserve map (hugetlb_unreserve_pages). In -* rare out of memory conditions, removal of the -* region/reserve map could fail. Correspondingly, -* the subpool and global reserve usage count can need -* to be adjusted. +* cache BEFORE removing the region/reserve map +* (hugetlb_unreserve_pages). In rare out of memory +* conditions, removal of the region/reserve map could +* fail. Correspondingly, the subpool and global +* reserve usage count can need to be adjusted. */ VM_BUG_ON (HPageRestoreReserve (&folio->page)); -remove_huge_page (&folio->page); +hugetlb_delete_from_page_cache (&folio->page); freed++;if (!truncate_op) { if (unlikely(hugetlb_unreserve_pages(inode,
@@ -737,7 +736,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, }clear_huge_page (page, addr,pages_per_huge_page (h));__SetPageUptodate (page); - error =huge_add_to_page_cache (page, mapping, index); + error =hugetlb_add_to_page_cache (page, mapping, index);if (unlikely (error)) {restore_reserve_on_error (h, &pseudo_vma, addr, page);put_page (page);
@@ -749,7 +748,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,SetHPageMigratable (page);/* -* unlock_page because locked by huge_add_to_page_cache() +* unlock_page because locked by hugetlb_add_to_page_cache() * put_page() due to reference from alloc_huge_page() */ unlock_page (page);
@@ -994,7 +993,7 @@ static int hugetlbfs_error_remove_page(struct address_space *mapping,struct inode *inode = mapping->host;pgoff_t index = page->index; -remove_huge_page (page); +hugetlb_delete_from_page_cache (page);if (unlikely (hugetlb_unreserve_pages (inode, index, index +1 ,1 )))hugetlb_fix_reserve_counts (inode);
include/linux/hugetlb.h +1 -1
@@ -665,7 +665,7 @@ struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask);struct page *alloc_huge_page_vma (struct hstate *h,struct vm_area_struct *vma,unsigned long address); -int huge_add_to_page_cache (struct page *page,struct address_space *mapping, +int hugetlb_add_to_page_cache (struct page *page,struct address_space *mapping,pgoff_t idx);void restore_reserve_on_error (struct hstate *h,struct vm_area_struct *vma,unsigned long address,struct page *page);
mm/hugetlb.c +4 -4
@@ -5445,7 +5445,7 @@ static bool hugetlbfs_pagecache_present(struct hstate *h,return page !=NULL ; } -int huge_add_to_page_cache (struct page *page,struct address_space *mapping, +int hugetlb_add_to_page_cache (struct page *page,struct address_space *mapping,pgoff_t idx) {struct folio *folio =page_folio (page);
@@ -5583,7 +5583,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, new_page = true;if (vma->vm_flags &VM_MAYSHARE ) { -int err =huge_add_to_page_cache (page, mapping, idx); +int err =hugetlb_add_to_page_cache (page, mapping, idx);if (err) {put_page (page);if (err == -EEXIST )
@@ -6008,11 +6008,11 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,/* * Serialization between remove_inode_hugepages() and -* huge_add_to_page_cache() below happens through the +* hugetlb_add_to_page_cache() below happens through the * hugetlb_fault_mutex_table that here must be hold by * the caller. */ - ret =huge_add_to_page_cache (page, mapping, idx); + ret =hugetlb_add_to_page_cache (page, mapping, idx);if (ret) goto out_release_nounlock; page_in_pagecache = true;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 66/314 hugetlbfs: dont delete error page from pagecache
In reply to Greg Kroah-HartmanFrom: James Houghton <[email protected]>
[ Upstream commit 8625147cafaa9ba74713d682f5185eb62cb2aedb ]
This change is very similar to the change that was made for shmem [1], and it solves the same problem but for HugeTLBFS instead.
Currently, when poison is found in a HugeTLB page, the page is removed from the page cache. That means that attempting to map or read that hugepage in the future will result in a new hugepage being allocated instead of notifying the user that the page was poisoned. As [1] states, this is effectively memory corruption.
The fix is to leave the page in the page cache. If the user attempts to use a poisoned HugeTLB page with a syscall, the syscall will fail with EIO, the same error code that shmem uses. For attempts to map the page, the thread will get a BUS_MCEERR_AR SIGBUS.
[1]: commit a76054266661 ("mm: shmem: don't truncate page if memory failure happens")
--- fs/hugetlbfs/inode.c | 13 ++++++------- mm/hugetlb.c | 4 ++++ mm/memory-failure.c | 5 ++++- 3 files changed, 14 insertions(+), 8 deletions(-)
fs/hugetlbfs/inode.c +6 -7
@@ -328,6 +328,12 @@ static ssize_t hugetlbfs_read_iter(struct kiocb *iocb, struct iov_iter *to) }else {unlock_page (page); +if (PageHWPoison (page)) { +put_page (page); + retval = -EIO ; +break ; + } +/* * We have the page, copy it to user space buffer. */
@@ -990,13 +996,6 @@ static int hugetlbfs_migrate_folio(struct address_space *mapping,static int hugetlbfs_error_remove_page (struct address_space *mapping,struct page *page) { -struct inode *inode = mapping->host; -pgoff_t index = page->index; - -hugetlb_delete_from_page_cache (page); -if (unlikely (hugetlb_unreserve_pages (inode, index, index +1 ,1 ))) -hugetlb_fix_reserve_counts (inode); -return 0 ; }
mm/hugetlb.c +4 -0
@@ -6021,6 +6021,10 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, ptl =huge_pte_lockptr (h, dst_mm, dst_pte);spin_lock (ptl); + ret = -EIO ; +if (PageHWPoison (page)) + goto out_release_unlock; +/* * Recheck the i_size after holding PT lock to make sure not * to leave any page mapped (as page_mapped()) beyond the end
mm/memory-failure.c +4 -1
@@ -1079,6 +1079,7 @@ static int me_huge_page(struct page_state *ps, struct page *p)int res;struct page *hpage =compound_head (p);struct address_space *mapping; +bool extra_pins = false;if (!PageHuge (hpage))return MF_DELAYED ;
@@ -1086,6 +1087,8 @@ static int me_huge_page(struct page_state *ps, struct page *p) mapping =page_mapping (hpage);if (mapping) { res =truncate_error_page (hpage,page_to_pfn (p), mapping); +/* The page is kept in page cache. */ + extra_pins = true;unlock_page (hpage); }else {unlock_page (hpage);
@@ -1103,7 +1106,7 @@ static int me_huge_page(struct page_state *ps, struct page *p) } } -if (has_extra_refcount (ps, p, false)) +if (has_extra_refcount (ps, p, extra_pins)) res =MF_FAILED ;return res;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 67/314 KVM: SVM: remove dead field from struct svm_cpu_data
In reply to Greg Kroah-HartmanFrom: Paolo Bonzini <[email protected]>
[ Upstream commit 181d0fb0bb023e8996b1cf7970e3708d72442b0b ]
The "cpu" field of struct svm_cpu_data has been write-only since commit 4b656b120249 ("KVM: SVM: force new asid on vcpu migration", 2009-08-05). Remove it.
Stable-dep-of: e287bd005ad9 ("KVM: SVM: restore host save area from assembly")
--- arch/x86/kvm/svm/svm.c | 1 - arch/x86/kvm/svm/svm.h | 2 -- 2 files changed, 3 deletions(-)
arch/x86/kvm/svm/svm.c +0 -1
@@ -667,7 +667,6 @@ static int svm_cpu_init(int cpu) sd =kzalloc (sizeof (struct svm_cpu_data ),GFP_KERNEL );if (!sd)return ret; - sd->cpu = cpu; sd->save_area =alloc_page (GFP_KERNEL | __GFP_ZERO);if (!sd->save_area) goto free_cpu_data;
arch/x86/kvm/svm/svm.h +0 -2
@@ -281,8 +281,6 @@ struct vcpu_svm { };struct svm_cpu_data { -int cpu; -u64 asid_generation;u32 max_asid;u32 next_asid;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 68/314 KVM: SVM: do not allocate struct svm_cpu_data dynamically
In reply to Greg Kroah-HartmanFrom: Paolo Bonzini <[email protected]>
[ Upstream commit 73412dfeea724e6bd775ba64d21157ff322eac9a ]
The svm_data percpu variable is a pointer, but it is allocated via svm_hardware_setup() when KVM is loaded. Unlike hardware_enable() this means that it is never NULL for the whole lifetime of KVM, and static allocation does not waste any memory compared to the status quo. It is also more efficient and more easily handled from assembly code, so do it and don't look back.
Stable-dep-of: e287bd005ad9 ("KVM: SVM: restore host save area from assembly")
--- arch/x86/kvm/svm/sev.c | 4 ++-- arch/x86/kvm/svm/svm.c | 41 +++++++++++++++-------------------------- arch/x86/kvm/svm/svm.h | 2 +- 3 files changed, 18 insertions(+), 29 deletions(-)
arch/x86/kvm/svm/sev.c +2 -2
@@ -196,7 +196,7 @@ static void sev_asid_free(struct kvm_sev_info *sev)__set_bit (sev->asid, sev_reclaim_asid_bitmap);for_each_possible_cpu (cpu) { - sd =per_cpu (svm_data, cpu); + sd =per_cpu_ptr (&svm_data, cpu); sd->sev_vmcbs[sev->asid] =NULL ; }
@@ -2600,7 +2600,7 @@ void sev_es_unmap_ghcb(struct vcpu_svm *svm)void pre_sev_run (struct vcpu_svm *svm,int cpu) { -struct svm_cpu_data *sd =per_cpu (svm_data, cpu); +struct svm_cpu_data *sd =per_cpu_ptr (&svm_data, cpu);int asid =sev_get_asid (svm->vcpu.kvm);/* Assign the asid allocated with this SEV guest */
arch/x86/kvm/svm/svm.c +15 -26
117 lines not on this page · raw message
arch/x86/kvm/svm/svm.h +1 -1
@@ -294,7 +294,7 @@ struct svm_cpu_data {struct vmcb **sev_vmcbs; }; -DECLARE_PER_CPU(struct svm_cpu_data *, svm_data); +DECLARE_PER_CPU(struct svm_cpu_data, svm_data);void recalc_intercepts (struct vcpu_svm *svm);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 69/314 KVM: SVM: restore host save area from assembly
In reply to Greg Kroah-HartmanFrom: Paolo Bonzini <[email protected]>
[ Upstream commit e287bd005ad9d85dd6271dd795d3ecfb6bca46ad ]
Allow access to the percpu area via the GS segment base, which is needed in order to access the saved host spec_ctrl value. In linux-next FILL_RETURN_BUFFER also needs to access percpu data.
For simplicity, the physical address of the save area is added to struct svm_cpu_data.
--- arch/x86/kvm/kvm-asm-offsets.c | 1 + arch/x86/kvm/svm/svm.c | 14 ++++++-------- arch/x86/kvm/svm/svm.h | 2 ++ arch/x86/kvm/svm/svm_ops.h | 5 ----- arch/x86/kvm/svm/vmenter.S | 17 +++++++++++++++++ 5 files changed, 26 insertions(+), 13 deletions(-)
arch/x86/kvm/kvm-asm-offsets.c +1 -0
@@ -18,6 +18,7 @@ static void __used common(void)OFFSET (SVM_current_vmcb, vcpu_svm, current_vmcb);OFFSET (SVM_vmcb01, vcpu_svm, vmcb01);OFFSET (KVM_VMCB_pa, kvm_vmcb_info, pa); +OFFSET (SD_save_area_pa, svm_cpu_data, save_area_pa); }if (IS_ENABLED (CONFIG_KVM_INTEL )) {
arch/x86/kvm/svm/svm.c +6 -8
@@ -594,7 +594,7 @@ static int svm_hardware_enable(void)wrmsrl (MSR_EFER , efer |EFER_SVME ); -wrmsrl (MSR_VM_HSAVE_PA ,__sme_page_pa (sd->save_area)); +wrmsrl (MSR_VM_HSAVE_PA , sd->save_area_pa);if (static_cpu_has (X86_FEATURE_TSCRATEMSR )) {/*
@@ -650,6 +650,7 @@ static void svm_cpu_uninit(int cpu)kfree (sd->sev_vmcbs);__free_page (sd->save_area); + sd->save_area_pa =0 ; sd->save_area =NULL ; }
@@ -667,6 +668,7 @@ static int svm_cpu_init(int cpu)if (ret) goto free_save_area; + sd->save_area_pa =__sme_page_pa (sd->save_area);return 0 ; free_save_area:
@@ -1452,7 +1454,7 @@ static void svm_prepare_switch_to_guest(struct kvm_vcpu *vcpu)* Save additional host state that will be restored on VMEXIT (sev-es) * or subsequent vmload of host save area. */ -vmsave (__sme_page_pa (sd->save_area)); +vmsave (sd->save_area_pa);if (sev_es_guest (vcpu->kvm)) {struct sev_es_save_area *hostsa; hostsa = (struct sev_es_save_area *)(page_address (sd->save_area) +0x400 );
@@ -3906,14 +3908,10 @@ static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu)guest_state_enter_irqoff (); -if (sev_es_guest (vcpu->kvm)) { +if (sev_es_guest (vcpu->kvm))__svm_sev_es_vcpu_run (svm); - }else { -struct svm_cpu_data *sd =per_cpu_ptr (&svm_data, vcpu->cpu); - +else __svm_vcpu_run (svm); -vmload (__sme_page_pa (sd->save_area)); - }guest_state_exit_irqoff (); }
arch/x86/kvm/svm/svm.h +2 -0
@@ -288,6 +288,8 @@ struct svm_cpu_data {struct kvm_ldttss_desc *tss_desc;struct page *save_area; +unsigned long save_area_pa; +struct vmcb *current_vmcb;/* index = sev_asid, value = vmcb pointer */
arch/x86/kvm/svm/svm_ops.h +0 -5
@@ -61,9 +61,4 @@ static __always_inline void vmsave(unsigned long pa) svm_asm1(vmsave, "a" (pa), "memory"); } -static __always_inline void vmload(unsigned long pa) -{ -svm_asm1 (vmload,"a" (pa),"memory" ); -} -#endif /* __KVM_X86_SVM_OPS_H */
arch/x86/kvm/svm/vmenter.S +17 -0
@@ -49,6 +49,14 @@ SYM_FUNC_START(__svm_vcpu_run) #endif push %_ASM_BX + /* + * Save variables needed after vmexit on the stack, in inverse + * order compared to when they are needed. + */ + + /* Needed to restore access to percpu variables. */ + __ASM_SIZE(push) PER_CPU_VAR(svm_data + SD_save_area_pa) + /* Save @svm. */ push %_ASM_ARG1
@@ -124,6 +132,11 @@ SYM_FUNC_START(__svm_vcpu_run) 5: vmsave %_ASM_AX 6: + /* Restores GSBASE among other things, allowing access to percpu data. */ + pop %_ASM_AX +7: vmload %_ASM_AX +8: + #ifdef CONFIG_RETPOLINE /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */ FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
@@ -187,10 +200,14 @@ SYM_FUNC_START(__svm_vcpu_run) 50: cmpb $0, kvm_rebooting jne 6b ud2 +70: cmpb $0, kvm_rebooting + jne 8b + ud2 _ASM_EXTABLE(1b, 10b) _ASM_EXTABLE(3b, 30b) _ASM_EXTABLE(5b, 50b) + _ASM_EXTABLE(7b, 70b) SYM_FUNC_END(__svm_vcpu_run)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 70/314 KVM: SVM: move MSR_IA32_SPEC_CTRL save/restore to assembly
In reply to Greg Kroah-HartmanFrom: Paolo Bonzini <[email protected]>
[ Upstream commit 9f2febf3f04daebdaaa5a43cfa20e3844905c0f9 ]
Restoration of the host IA32_SPEC_CTRL value is probably too late with respect to the return thunk training sequence.
With respect to the user/kernel boundary, AMD says, "If software chooses to toggle STIBP (e.g., set STIBP on kernel entry, and clear it on kernel exit), software should set STIBP to 1 before executing the return thunk training sequence." I assume the same requirements apply to the guest/host boundary. The return thunk training sequence is in vmenter.S, quite close to the VM-exit. On hosts without V_SPEC_CTRL, however, the host's IA32_SPEC_CTRL value is not restored until much later.
To avoid this, move the restoration of host SPEC_CTRL to assembly and, for consistency, move the restoration of the guest SPEC_CTRL as well. This is not particularly difficult, apart from some care to cover both 32- and 64-bit, and to share code between SEV-ES and normal vmentry.
--- arch/x86/kernel/cpu/bugs.c | 13 +--- arch/x86/kvm/kvm-asm-offsets.c | 1 + arch/x86/kvm/svm/svm.c | 37 ++++------ arch/x86/kvm/svm/svm.h | 4 +- arch/x86/kvm/svm/vmenter.S | 119 ++++++++++++++++++++++++++++++++- 5 files changed, 136 insertions(+), 38 deletions(-)
arch/x86/kernel/cpu/bugs.c +3 -10
@@ -196,22 +196,15 @@ void __init check_bugs(void) }/* -* NOTE: This function is *only* called for SVM. VMX spec_ctrl handling is -* done in vmenter.S. +* NOTE: This function is *only* called for SVM, since Intel uses +* MSR_IA32_SPEC_CTRL for SSBD. */ void x86_virt_spec_ctrl (u64 guest_spec_ctrl,u64 guest_virt_spec_ctrl,bool setguest) { -u64 msrval, guestval = guest_spec_ctrl, hostval =spec_ctrl_current (); +u64 guestval, hostval;struct thread_info *ti =current_thread_info (); -if (static_cpu_has (X86_FEATURE_MSR_SPEC_CTRL )) { -if (hostval != guestval) { - msrval = setguest ? guestval : hostval; -wrmsrl (MSR_IA32_SPEC_CTRL , msrval); - } - } -/* * If SSBD is not handled in MSR_SPEC_CTRL on AMD, update * MSR_AMD64_L2_CFG or MSR_VIRT_SPEC_CTRL if supported.
arch/x86/kvm/kvm-asm-offsets.c +1 -0
@@ -16,6 +16,7 @@ static void __used common(void)BLANK ();OFFSET (SVM_vcpu_arch_regs, vcpu_svm, vcpu.arch.regs);OFFSET (SVM_current_vmcb, vcpu_svm, current_vmcb); +OFFSET (SVM_spec_ctrl, vcpu_svm, spec_ctrl);OFFSET (SVM_vmcb01, vcpu_svm, vmcb01);OFFSET (KVM_VMCB_pa, kvm_vmcb_info, pa);OFFSET (SD_save_area_pa, svm_cpu_data, save_area_pa);
arch/x86/kvm/svm/svm.c +14 -23
@@ -722,6 +722,15 @@ static bool msr_write_intercepted(struct kvm_vcpu *vcpu, u32 msr)u32 offset;u32 *msrpm; +/* +* For non-nested case: +* If the L01 MSR bitmap does not intercept the MSR, then we need to +* save it. +* +* For nested case: +* If the L02 MSR bitmap does not intercept the MSR, then we need to +* save it. +*/ msrpm =is_guest_mode (vcpu) ?to_svm (vcpu)->nested.msrpm:to_svm (vcpu)->msrpm;
@@ -3902,16 +3911,16 @@ static fastpath_t svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu)return EXIT_FASTPATH_NONE ; } -static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu) +static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu, bool spec_ctrl_intercepted) {struct vcpu_svm *svm =to_svm (vcpu);guest_state_enter_irqoff ();if (sev_es_guest (vcpu->kvm)) -__svm_sev_es_vcpu_run (svm); +__svm_sev_es_vcpu_run (svm, spec_ctrl_intercepted);else -__svm_vcpu_run (svm); +__svm_vcpu_run (svm, spec_ctrl_intercepted);guest_state_exit_irqoff (); }
@@ -3919,6 +3928,7 @@ static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu) static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu) {struct vcpu_svm *svm =to_svm (vcpu); +bool spec_ctrl_intercepted =msr_write_intercepted (vcpu,MSR_IA32_SPEC_CTRL );trace_kvm_entry (vcpu);
@@ -3977,26 +3987,7 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)if (!static_cpu_has (X86_FEATURE_V_SPEC_CTRL ))x86_spec_ctrl_set_guest (svm->spec_ctrl, svm->virt_spec_ctrl); -svm_vcpu_enter_exit (vcpu); - -/* -* We do not use IBRS in the kernel. If this vCPU has used the -* SPEC_CTRL MSR it may have left it on; save the value and -* turn it off. This is much more efficient than blindly adding -* it to the atomic save/restore list. Especially as the former -* (Saving guest MSRs on vmexit) doesn't even exist in KVM. -* -* For non-nested case: -* If the L01 MSR bitmap does not intercept the MSR, then we need to -* save it. -* -* For nested case: -* If the L02 MSR bitmap does not intercept the MSR, then we need to -* save it. -*/ -if (!static_cpu_has (X86_FEATURE_V_SPEC_CTRL ) && -unlikely (!msr_write_intercepted (vcpu,MSR_IA32_SPEC_CTRL ))) - svm->spec_ctrl =native_read_msr (MSR_IA32_SPEC_CTRL ); +svm_vcpu_enter_exit (vcpu, spec_ctrl_intercepted);if (!sev_es_guest (vcpu->kvm))reload_tss (vcpu);
arch/x86/kvm/svm/svm.h +2 -2
@@ -683,7 +683,7 @@ void sev_es_unmap_ghcb(struct vcpu_svm *svm);/* vmenter.S */ -void __svm_sev_es_vcpu_run (struct vcpu_svm *svm); -void __svm_vcpu_run (struct vcpu_svm *svm); +void __svm_sev_es_vcpu_run (struct vcpu_svm *svm,bool spec_ctrl_intercepted); +void __svm_vcpu_run (struct vcpu_svm *svm,bool spec_ctrl_intercepted);#endif
arch/x86/kvm/svm/vmenter.S +116 -3
197 lines not on this page · raw message
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 71/314 arm64: dts: qcom: ipq8074: correct APCS register space size
In reply to Greg Kroah-HartmanFrom: Robert Marko <[email protected]>
[ Upstream commit 40b21d466a86bd5b10d24f59746ed41283a9b3f6 ]
APCS DTS addition that was merged, was not supposed to get merged as it was part of patch series that was superseded by 2 more patch series that resolved issues with this one and greatly simplified things.
Since it already got merged, start by correcting the register space size as APCS will not be providing regmap for PLL and it will conflict with the standalone A53 PLL node.
--- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/ipq8074.dtsi +1 -1
@@ -668,7 +668,7 @@ watchdog: watchdog@b017000 { apcs_glb: mailbox@b111000 { compatible = "qcom,ipq8074-apcs-apps-global"; - reg = <0x0b111000 0x6000>; + reg = <0x0b111000 0x1000>; #clock-cells = <1>; #mbox-cells = <1>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 72/314 arm64: dts: qcom: sa8155p-adp: Specify which LDO modes are allowed
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit bd9f3dcf42d943b53190f99bcdbcfe98a56ac4cd ]
This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes".
Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality.
Let's re-enable the old functionality by fixing the dts.
NOTE: while here, let's also remove the nonsensical "regulator-allow-set-load" on the fixed regulator "vreg_s4a_1p8".
[1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid
--- arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sa8155p-adp.dts +12 -1
@@ -43,7 +43,6 @@ vreg_s4a_1p8: smps4 { regulator-always-on; regulator-boot-on; - regulator-allow-set-load; vin-supply = <&vreg_3p3>; };
@@ -137,6 +136,9 @@ vreg_l5a_0p88: ldo5 { regulator-max-microvolt = <880000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l7a_1p8: ldo7 {
@@ -152,6 +154,9 @@ vreg_l10a_2p96: ldo10 { regulator-max-microvolt = <2960000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l11a_0p8: ldo11 {
@@ -258,6 +263,9 @@ vreg_l5c_1p2: ldo5 { regulator-max-microvolt = <1200000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l7c_1p8: ldo7 {
@@ -273,6 +281,9 @@ vreg_l8c_1p2: ldo8 { regulator-max-microvolt = <1200000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l10c_3p3: ldo10 {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 73/314 arm64: dts: qcom: sa8295p-adp: Specify which LDO modes are allowed
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 09a1710b3e12e7ac8d871506bc395a9e8a0f63d6 ]
This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes".
Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality.
Let's re-enable the old functionality by fixing the dts.
[1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid
--- arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/qcom/sa8295p-adp.dts +12 -0
@@ -83,6 +83,9 @@ vreg_l3c: ldo3 { regulator-max-microvolt = <1200000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l4c: ldo4 {
@@ -98,6 +101,9 @@ vreg_l6c: ldo6 { regulator-max-microvolt = <1200000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l7c: ldo7 {
@@ -113,6 +119,9 @@ vreg_l10c: ldo10 { regulator-max-microvolt = <2504000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l17c: ldo17 {
@@ -121,6 +130,9 @@ vreg_l17c: ldo17 { regulator-max-microvolt = <2504000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 74/314 arm64: dts: qcom: sc8280xp-crd: Specify which LDO modes are allowed
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit a4543e21ae363f4f094fb3c3503d77029e0c5d90 ]
This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes".
Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality.
Let's re-enable the old functionality by fixing the dts.
[1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid
--- arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp-crd.dts +6 -0
@@ -124,6 +124,9 @@ vreg_l7c: ldo7 { regulator-max-microvolt = <2504000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l13c: ldo13 {
@@ -146,6 +149,9 @@ vreg_l3d: ldo3 { regulator-max-microvolt = <1200000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l4d: ldo4 {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 75/314 arm64: dts: qcom: sm8150-xperia-kumano: Specify which LDO modes are allowed
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit aa30e786202e4ed1df980442d305658441f65859 ]
This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes".
Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality.
Let's re-enable the old functionality by fixing the dts.
[1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid
--- arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi +6 -0
@@ -348,6 +348,9 @@ vreg_l6c_2p9: ldo6 { regulator-max-microvolt = <2960000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l7c_3p0: ldo7 {
@@ -367,6 +370,9 @@ vreg_l9c_2p9: ldo9 { regulator-max-microvolt = <2960000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l10c_3p3: ldo10 {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 76/314 arm64: dts: qcom: sm8250-xperia-edo: Specify which LDO modes are allowed
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit b7870d460c05ce31e2311036d91de1e2e0b32cea ]
This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes".
Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality.
Let's re-enable the old functionality by fixing the dts.
[1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid
--- arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi +6 -0
@@ -317,6 +317,9 @@ vreg_l6c_2p9: ldo6 { regulator-max-microvolt = <2960000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l7c_2p85: ldo7 {
@@ -339,6 +342,9 @@ vreg_l9c_2p9: ldo9 { regulator-max-microvolt = <2960000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l10c_3p3: ldo10 {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 77/314 arm64: dts: qcom: sm8350-hdk: Specify which LDO modes are allowed
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 1ce8aaf6abdc35cde555924418b3d4516b4ec871 ]
This board uses RPMH, specifies "regulator-allow-set-load" for LDOs, but doesn't specify any modes with "regulator-allowed-modes".
Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()") the above meant that we were able to set either LPM or HPM mode. After that commit (and fixes [1]) we'll be stuck at the initial mode. Discussion of this has resulted in the decision that the old dts files were wrong and should be fixed to fully restore old functionality.
Let's re-enable the old functionality by fixing the dts.
[1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid
--- arch/arm64/boot/dts/qcom/sm8350-hdk.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/qcom/sm8350-hdk.dts +12 -0
@@ -107,6 +107,9 @@ vreg_l5b_0p88: ldo5 { regulator-max-microvolt = <888000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l6b_1p2: ldo6 {
@@ -115,6 +118,9 @@ vreg_l6b_1p2: ldo6 { regulator-max-microvolt = <1208000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l7b_2p96: ldo7 {
@@ -123,6 +129,9 @@ vreg_l7b_2p96: ldo7 { regulator-max-microvolt = <2504000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; vreg_l9b_1p2: ldo9 {
@@ -131,6 +140,9 @@ vreg_l9b_1p2: ldo9 { regulator-max-microvolt = <1200000>; regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; regulator-allow-set-load; + regulator-allowed-modes = + <RPMH_REGULATOR_MODE_LPM + RPMH_REGULATOR_MODE_HPM>; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 78/314 arm64: dts: qcom: sc8280xp: fix ufs_card_phy ref clock
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit 8d6b458ce6e93286a607e54f787f7a86067f58bd ]
The GCC_UFS_REF_CLKREF_CLK must be enabled or the second UFS controller fails to enumerate on sa8295p-adp.
Note that the vendor kernel enables both GCC_UFS_REF_CLKREF_CLK and GCC_UFS_1_CARD_CLKREF_CLK and it is possible that the former should be modelled as a parent of the latter. The clock driver also has a GCC_UFS_CARD_CLKREF_CLK clock which the firmware appears to enable on the ADP.
The usual lack of documentation for Qualcomm SoCs makes this a highly annoying guessing game, but as the second controller works on the ADP without either card reference clock enabled, only enable GCC_UFS_REF_CLKREF_CLK for now.
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +1 -1
@@ -959,7 +959,7 @@ ufs_card_phy: phy@1da7000 { ranges; clock-names = "ref", "ref_aux"; - clocks = <&gcc GCC_UFS_1_CARD_CLKREF_CLK>, + clocks = <&gcc GCC_UFS_REF_CLKREF_CLK>, <&gcc GCC_UFS_CARD_PHY_AUX_CLK>; resets = <&ufs_card_hc 0>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 79/314 arm64: dts: qcom: sc8280xp: correct ref clock for ufs_mem_phy
In reply to Greg Kroah-HartmanFrom: Brian Masney <[email protected]>
[ Upstream commit f3aa975e230e060c07dcfdf3fe92b59809422c13 ]
The first UFS host controller fails to start on the SA8540P automotive board (QDrive3) due to the following errors:
ufshcd-qcom 1d84000.ufs: ufshcd_query_flag: Sending flag query for idn 18 failed, err = 253 ufshcd-qcom 1d84000.ufs: ufshcd_query_flag: Sending flag query for idn 18 failed, err = 253 ufshcd-qcom 1d84000.ufs: ufshcd_query_flag: Sending flag query for idn 18 failed, err = 253 ufshcd-qcom 1d84000.ufs: ufshcd_query_flag_retry: query attribute, opcode 5, idn 18, failed
with error 253 after 3 retries
The system eventually fails to boot with the warning:
gcc_ufs_phy_axi_clk status stuck at 'off'
This issue can be worked around by adding clk_ignore_unused to the kernel command line since the system firmware sets up this clock for us.
Let's fix this issue by updating the ref clock on ufs_mem_phy. Note that the downstream MSM 5.4 sources list this as ref_clk_parent. With this patch, the SA8540P is able to be booted without clk_ignore_unused.
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +1 -1
@@ -891,7 +891,7 @@ ufs_mem_phy: phy@1d87000 { ranges; clock-names = "ref", "ref_aux"; - clocks = <&rpmhcc RPMH_CXO_CLK>, + clocks = <&gcc GCC_UFS_REF_CLKREF_CLK>, <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; resets = <&ufs_mem_hc 0>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 80/314 arm64: dts: qcom: sc8280xp: fix USB0 PHY PCS_MISC registers
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit 31b3b3059791be536e2ec0c6830767b596af340f ]
The USB0 SS PHY node had the PCS_MISC register block (0x1200) replaced with PCS_USB (0x1700).
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +1 -1
@@ -1184,7 +1184,7 @@ usb_0_ssphy: usb3-phy@88eb400 { <0 0x088ec400 0 0x1f0>, <0 0x088eba00 0 0x100>, <0 0x088ebc00 0 0x3ec>, - <0 0x088ec700 0 0x64>; + <0 0x088ec200 0 0x18>; #phy-cells = <0>; #clock-cells = <0>; clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 81/314 arm64: dts: qcom: sc8280xp: fix USB1 PHY RX1 registers
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit 81cad26c6c3984d01b0612069c70ffd820f62dfa ]
The USB1 SS PHY node had the RX1 register block (0x600) replaced with RX2 (0xc00).
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +1 -1
@@ -1242,7 +1242,7 @@ usb_1_qmpphy: phy-wrapper@8904000 { usb_1_ssphy: usb3-phy@8903400 { reg = <0 0x08903400 0 0x100>, - <0 0x08903c00 0 0x3ec>, + <0 0x08903600 0 0x3ec>, <0 0x08904400 0 0x1f0>, <0 0x08903a00 0 0x100>, <0 0x08903c00 0 0x3ec>,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 82/314 arm64: dts: qcom: sc8280xp: fix USB PHY PCS registers
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit 8723c3f290c7b798c0cbd89998576e6b365bda3a ]
With the current binding, the PCS register block (0x1400) needs to include the PCS_USB registers (0x1700).
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +2 -2
@@ -1181,7 +1181,7 @@ usb_0_qmpphy: phy-wrapper@88ec000 { usb_0_ssphy: usb3-phy@88eb400 { reg = <0 0x088eb400 0 0x100>, <0 0x088eb600 0 0x3ec>, - <0 0x088ec400 0 0x1f0>, + <0 0x088ec400 0 0x364>, <0 0x088eba00 0 0x100>, <0 0x088ebc00 0 0x3ec>, <0 0x088ec200 0 0x18>;
@@ -1243,7 +1243,7 @@ usb_1_qmpphy: phy-wrapper@8904000 { usb_1_ssphy: usb3-phy@8903400 { reg = <0 0x08903400 0 0x100>, <0 0x08903600 0 0x3ec>, - <0 0x08904400 0 0x1f0>, + <0 0x08904400 0 0x364>, <0 0x08903a00 0 0x100>, <0 0x08903c00 0 0x3ec>, <0 0x08904200 0 0x18>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 83/314 arm64: dts: qcom: sc8280xp: drop broken DP PHY nodes
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit 7cdfb7a54ac88f7cb6d830ebb78bdbcbcb44bb4c ]
The DP PHY register layout of the current binding do not apply to the newer USB4/USB3/DP PHY which uses a different register layout entirely.
Drop the DP PHY subnodes until the binding has been updated to prevent the driver from corrupting unrelated registers.
Note that this is also needed in order to not break USB with an upcoming PHY driver change that checks for overlapping register regions.
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 20 -------------------- 1 file changed, 20 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +0 -20
@@ -1191,16 +1191,6 @@ usb_0_ssphy: usb3-phy@88eb400 { clock-names = "pipe0"; clock-output-names = "usb0_phy_pipe_clk_src"; }; - - usb_0_dpphy: dp-phy@88ed200 { - reg = <0 0x088ed200 0 0x200>, - <0 0x088ed400 0 0x200>, - <0 0x088eda00 0 0x200>, - <0 0x088ea600 0 0x200>, - <0 0x088ea800 0 0x200>; - #clock-cells = <1>; - #phy-cells = <0>; - }; }; usb_1_hsphy: phy@8902000 {
@@ -1253,16 +1243,6 @@ usb_1_ssphy: usb3-phy@8903400 { clock-names = "pipe0"; clock-output-names = "usb1_phy_pipe_clk_src"; }; - - usb_1_dpphy: dp-phy@8904200 { - reg = <0 0x08904200 0 0x200>, - <0 0x08904400 0 0x200>, - <0 0x08904a00 0 0x200>, - <0 0x08904600 0 0x200>, - <0 0x08904800 0 0x200>; - #clock-cells = <1>; - #phy-cells = <0>; - }; }; system-cache-controller@9200000 {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 84/314 arm64: dts: qcom: sc8280xp: fix UFS PHY serdes size
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit 8703d55bd5eac642275fe91b34ac62ad0ad312b5 ]
The size of the UFS PHY serdes register region is 0x1c8 and the corresponding 'reg' property should specifically not include the adjacent regions that are defined in the child node (e.g. tx and rx).
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +2 -2
@@ -885,7 +885,7 @@ ufs_mem_hc: ufs@1d84000 { ufs_mem_phy: phy@1d87000 { compatible = "qcom,sc8280xp-qmp-ufs-phy"; - reg = <0 0x01d87000 0 0xe10>; + reg = <0 0x01d87000 0 0x1c8>; #address-cells = <2>; #size-cells = <2>; ranges;
@@ -953,7 +953,7 @@ ufs_card_hc: ufs@1da4000 { ufs_card_phy: phy@1da7000 { compatible = "qcom,sc8280xp-qmp-ufs-phy"; - reg = <0 0x01da7000 0 0xe10>; + reg = <0 0x01da7000 0 0x1c8>; #address-cells = <2>; #size-cells = <2>; ranges;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 85/314 arm64: dts: qcom: sc7280: Add the reset reg for lpass audiocc on SC7280
In reply to Greg Kroah-HartmanFrom: Satya Priya <[email protected]>
[ Upstream commit cb1d0aaa674e99957b85af570cb2730145af01df ]
Add the reset register offset for clock gating.
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7280.dtsi +2 -1
@@ -2177,7 +2177,8 @@ lpasscc: lpasscc@3000000 { lpass_audiocc: clock-controller@3300000 { compatible = "qcom,sc7280-lpassaudiocc"; - reg = <0 0x03300000 0 0x30000>; + reg = <0 0x03300000 0 0x30000>, + <0 0x032a9000 0 0x1000>; clocks = <&rpmhcc RPMH_CXO_CLK>, <&lpass_aon LPASS_AON_CC_MAIN_RCG_CLK_SRC>; clock-names = "bi_tcxo", "lpass_aon_cc_main_rcg_clk_src";
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 86/314 spi: stm32: Print summary callbacks suppressed message
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 195583504be28df5d608a4677dd796117aea875f ]
The original fix "spi: stm32: Rate-limit the 'Communication suspended' message" still leads to "stm32h7_spi_irq_thread: 1696 callbacks suppressed" spew in the kernel log. Since this 'Communication suspended' message is a debug print, add RATELIMIT_MSG_ON_RELEASE flag to inhibit the "callbacks suspended" part during normal operation and only print summary at the end.
--- drivers/spi/spi-stm32.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-stm32.c +1 -0
@@ -886,6 +886,7 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id) static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL * 10, 1); +ratelimit_set_flags (&rs,RATELIMIT_MSG_ON_RELEASE );if (__ratelimit (&rs))dev_dbg_ratelimited (spi->dev,"Communication suspended\n" );if (!spi->cur_usedma && (spi->rx_buf && (spi->rx_len >0 )))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 87/314 ARM: dts: at91: sama7g5: fix signal name of pin PB2
In reply to Greg Kroah-HartmanFrom: Mihai Sain <[email protected]>
[ Upstream commit 2b4337c8409b4e9e5aed15c597e4031dd567bdd8 ]
The signal name of pin PB2 with function F is FLEXCOM11_IO1 as it is defined in the datasheet.
--- arch/arm/boot/dts/sama7g5-pinfunc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/sama7g5-pinfunc.h +1 -1
@@ -261,7 +261,7 @@#define PIN_PB2__FLEXCOM6_IO0 PINMUX_PIN(PIN_PB2, 2, 1)#define PIN_PB2__ADTRG PINMUX_PIN(PIN_PB2, 3, 1)#define PIN_PB2__A20 PINMUX_PIN(PIN_PB2, 4, 1) -#define PIN_PB2__FLEXCOM11_IO0 PINMUX_PIN(PIN_PB2, 6, 3) +#define PIN_PB2__FLEXCOM11_IO1 PINMUX_PIN(PIN_PB2, 6, 3)#define PIN_PB3 35#define PIN_PB3__GPIO PINMUX_PIN(PIN_PB3, 0, 0)#define PIN_PB3__RF1 PINMUX_PIN(PIN_PB3, 1, 1)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 88/314 ASoC: core: Fix use-after-free in snd_soc_exit()
In reply to Greg Kroah-HartmanFrom: Chen Zhongjin <[email protected]>
[ Upstream commit 6ec27c53886c8963729885bcf2dd996eba2767a7 ]
KASAN reports a use-after-free:
BUG: KASAN: use-after-free in device_del+0xb5b/0xc60 Read of size 8 at addr ffff888008655050 by task rmmod/387 CPU: 2 PID: 387 Comm: rmmod Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Call Trace: <TASK> dump_stack_lvl+0x79/0x9a print_report+0x17f/0x47b kasan_report+0xbb/0xf0 device_del+0xb5b/0xc60 platform_device_del.part.0+0x24/0x200 platform_device_unregister+0x2e/0x40 snd_soc_exit+0xa/0x22 [snd_soc_core] __do_sys_delete_module.constprop.0+0x34f/0x5b0 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd ... </TASK>
It's bacause in snd_soc_init(), snd_soc_util_init() is possble to fail, but its ret is ignored, which makes soc_dummy_dev unregistered twice.
snd_soc_init()
snd_soc_util_init()
platform_device_register_simple(soc_dummy_dev) platform_driver_register() # fail platform_device_unregister(soc_dummy_dev)
platform_driver_register() # success
...snd_soc_exit()
snd_soc_util_exit()
# soc_dummy_dev will be unregistered for second time
To fix it, handle error and stop snd_soc_init() when util_init() fail. Also clean debugfs when util_init() or driver_register() fail.
--- sound/soc/soc-core.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
sound/soc/soc-core.c +15 -2
@@ -3472,10 +3472,23 @@ EXPORT_SYMBOL_GPL(snd_soc_of_get_dai_link_cpus);static int __init snd_soc_init (void ) { +int ret; +snd_soc_debugfs_init (); -snd_soc_util_init (); + ret =snd_soc_util_init (); +if (ret) + goto err_util_init; -return platform_driver_register (&soc_driver); + ret =platform_driver_register (&soc_driver); +if (ret) + goto err_register; +return 0 ; + +err_register: +snd_soc_util_exit (); +err_util_init: +snd_soc_debugfs_exit (); +return ret; }module_init (snd_soc_init);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 89/314 ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N
In reply to Greg Kroah-HartmanFrom: Maarten Zanders <[email protected]>
[ Upstream commit 6a564338a23cefcfc29c4a535b98402d13efdda6 ]
When CONFIG_PM=N, pm_runtime_put_sync() returns -ENOSYS which breaks the probe function of these drivers.
Other users of pm_runtime_put_sync() typically don't check the return value. In order to keep the program flow as intended, check for -ENOSYS.
This commit is similar to commit 0434d3f (omap-mailbox.c).
--- sound/soc/fsl/fsl_asrc.c | 2 +- sound/soc/fsl/fsl_esai.c | 2 +- sound/soc/fsl/fsl_sai.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/fsl/fsl_asrc.c +1 -1
@@ -1224,7 +1224,7 @@ static int fsl_asrc_probe(struct platform_device *pdev) } ret =pm_runtime_put_sync (&pdev->dev); -if (ret <0 ) +if (ret <0 && ret != -ENOSYS ) goto err_pm_get_sync; ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component,
sound/soc/fsl/fsl_esai.c +1 -1
@@ -1069,7 +1069,7 @@ static int fsl_esai_probe(struct platform_device *pdev)regmap_write (esai_priv->regmap,REG_ESAI_RSMB ,0 ); ret =pm_runtime_put_sync (&pdev->dev); -if (ret <0 ) +if (ret <0 && ret != -ENOSYS ) goto err_pm_get_sync;/*
sound/soc/fsl/fsl_sai.c +1 -1
@@ -1415,7 +1415,7 @@ static int fsl_sai_probe(struct platform_device *pdev) } ret =pm_runtime_put_sync (dev); -if (ret <0 ) +if (ret <0 && ret != -ENOSYS ) goto err_pm_get_sync;/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 90/314 arm64: dts: qcom: sm8250: Disable the not yet supported cluster idle state
In reply to Greg Kroah-HartmanFrom: Ulf Hansson <[email protected]>
[ Upstream commit cadaa773bcf161184fa428180516bae33a7bc667 ]
To support the deeper cluster idle state for sm8250 platforms, some additional synchronization is needed between the rpmh-rsc device and the CPU cluster PM domain. Until that is supported, let's disable the cluster idle state.
This fixes a problem that has been reported for the Qcom RB5 platform (see below), but most likely other sm8250 platforms suffers from similar issues, so let's make the fix generic for sm8250.
vreg_l11c_3p3: failed to enable: -ETIMEDOUT
qcom-rpmh-regulator 18200000.rsc:pm8150l-rpmh-regulators: ldo11: devm_regulator_register() failed, ret=-110
qcom-rpmh-regulator: probe of 18200000.rsc:pm8150l-rpmh-regulators failed with error -110
--- arch/arm64/boot/dts/qcom/sm8250.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sm8250.dtsi +1 -0
@@ -334,6 +334,7 @@ CLUSTER_SLEEP_0: cluster-sleep-0 { exit-latency-us = <6562>; min-residency-us = <9987>; local-timer-stop; + status = "disabled"; }; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 91/314 ASoC: tas2770: Fix set_tdm_slot in case of single slot
In reply to Greg Kroah-HartmanFrom: Martin Povišer <[email protected]>
[ Upstream commit e59bf547a7dd366f93bfebb7487959580ca6c0ec ]
There's a special branch in the set_tdm_slot op for the case of nslots being 1, but:
(1) That branch can never work (there's a check for tx_mask being non-zero, later there's another check for it *being* zero; one or the other always throws -EINVAL).
(2) The intention of the branch seems to be what the general other branch reduces to in case of nslots being 1.
For those reasons remove the 'nslots being 1' special case.
--- sound/soc/codecs/tas2770.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
sound/soc/codecs/tas2770.c +6 -14
@@ -395,21 +395,13 @@ static int tas2770_set_dai_tdm_slot(struct snd_soc_dai *dai,if (tx_mask ==0 || rx_mask !=0 )return -EINVAL ; -if (slots ==1 ) { -if (tx_mask !=1 ) -return -EINVAL ; - - left_slot =0 ; - right_slot =0 ; + left_slot =__ffs (tx_mask); + tx_mask &= ~(1 << left_slot); +if (tx_mask ==0 ) { + right_slot = left_slot; }else { - left_slot =__ffs (tx_mask); - tx_mask &= ~(1 << left_slot); -if (tx_mask ==0 ) { - right_slot = left_slot; - }else { - right_slot =__ffs (tx_mask); - tx_mask &= ~(1 << right_slot); - } + right_slot =__ffs (tx_mask); + tx_mask &= ~(1 << right_slot); }if (tx_mask !=0 || left_slot >= slots || right_slot >= slots)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 92/314 ASoC: tas2764: Fix set_tdm_slot in case of single slot
In reply to Greg Kroah-HartmanFrom: Martin Povišer <[email protected]>
[ Upstream commit faac764ea1ea6898d93e46c403271fb105c0906e ]
There's a special branch in the set_tdm_slot op for the case of nslots being 1, but:
(1) That branch can never work (there's a check for tx_mask being non-zero, later there's another check for it *being* zero; one or the other always throws -EINVAL).
(2) The intention of the branch seems to be what the general other branch reduces to in case of nslots being 1.
For those reasons remove the 'nslots being 1' special case.
--- sound/soc/codecs/tas2764.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
sound/soc/codecs/tas2764.c +6 -13
@@ -386,20 +386,13 @@ static int tas2764_set_dai_tdm_slot(struct snd_soc_dai *dai,if (tx_mask ==0 || rx_mask !=0 )return -EINVAL ; -if (slots ==1 ) { -if (tx_mask !=1 ) -return -EINVAL ; - left_slot =0 ; - right_slot =0 ; + left_slot =__ffs (tx_mask); + tx_mask &= ~(1 << left_slot); +if (tx_mask ==0 ) { + right_slot = left_slot; }else { - left_slot =__ffs (tx_mask); - tx_mask &= ~(1 << left_slot); -if (tx_mask ==0 ) { - right_slot = left_slot; - }else { - right_slot =__ffs (tx_mask); - tx_mask &= ~(1 << right_slot); - } + right_slot =__ffs (tx_mask); + tx_mask &= ~(1 << right_slot); }if (tx_mask !=0 || left_slot >= slots || right_slot >= slots)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 93/314 ASoC: tas2780: Fix set_tdm_slot in case of single slot
In reply to Greg Kroah-HartmanFrom: Martin Povišer <[email protected]>
[ Upstream commit 6f934afa6a980bb8d3ce73836b1a9922685e50d7 ]
There's a special branch in the set_tdm_slot op for the case of nslots being 1, but:
(1) That branch can never work (there's a check for tx_mask being non-zero, later there's another check for it *being* zero; one or the other always throws -EINVAL).
(2) The intention of the branch seems to be what the general other branch reduces to in case of nslots being 1.
For those reasons remove the 'nslots being 1' special case.
--- sound/soc/codecs/tas2780.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
sound/soc/codecs/tas2780.c +6 -13
@@ -380,20 +380,13 @@ static int tas2780_set_dai_tdm_slot(struct snd_soc_dai *dai,if (tx_mask ==0 || rx_mask !=0 )return -EINVAL ; -if (slots ==1 ) { -if (tx_mask !=1 ) -return -EINVAL ; - left_slot =0 ; - right_slot =0 ; + left_slot =__ffs (tx_mask); + tx_mask &= ~(1 << left_slot); +if (tx_mask ==0 ) { + right_slot = left_slot; }else { - left_slot =__ffs (tx_mask); - tx_mask &= ~(1 << left_slot); -if (tx_mask ==0 ) { - right_slot = left_slot; - }else { - right_slot =__ffs (tx_mask); - tx_mask &= ~(1 << right_slot); - } + right_slot =__ffs (tx_mask); + tx_mask &= ~(1 << right_slot); }if (tx_mask !=0 || left_slot >= slots || right_slot >= slots)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 94/314 ARM: at91: pm: avoid soft resetting AC DLL
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit cef8cdc0d0e7c701fe4dcfba4ed3fd25d28a6020 ]
Do not soft reset AC DLL as controller is buggy and this operation my introduce glitches in the controller leading to undefined behavior.
Depends-on: a02875c4cbd6 ("ARM: at91: pm: fix self-refresh for sama7g5")
--- arch/arm/mach-at91/pm_suspend.S | 7 ++++++- include/soc/at91/sama7-ddr.h | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-)
arch/arm/mach-at91/pm_suspend.S +6 -1
@@ -169,10 +169,15 @@ sr_ena_2: cmp tmp1, #UDDRC_STAT_SELFREF_TYPE_SW bne sr_ena_2 - /* Put DDR PHY's DLL in bypass mode for non-backup modes. */ + /* Disable DX DLLs for non-backup modes. */ cmp r7, #AT91_PM_BACKUP beq sr_ena_3 + /* Do not soft reset the AC DLL. */ + ldr tmp1, [r3, DDR3PHY_ACDLLCR] + bic tmp1, tmp1, DDR3PHY_ACDLLCR_DLLSRST + str tmp1, [r3, DDR3PHY_ACDLLCR] + /* Disable DX DLLs. */ ldr tmp1, [r3, #DDR3PHY_DX0DLLCR] orr tmp1, tmp1, #DDR3PHY_DXDLLCR_DLLDIS
include/soc/at91/sama7-ddr.h +4 -1
@@ -26,7 +26,10 @@#define DDR3PHY_PGSR (0x0C)/* DDR3PHY PHY General Status Register */ #define DDR3PHY_PGSR_IDONE (1 << 0)/* Initialization Done */ -#define DDR3PHY_ACIOCR (0x24)/* DDR3PHY AC I/O Configuration Register */ +#define DDR3PHY_ACDLLCR (0x14)/* DDR3PHY AC DLL Control Register */ +#define DDR3PHY_ACDLLCR_DLLSRST (1 << 30)/* DLL Soft Reset */ + +#define DDR3PHY_ACIOCR (0x24)/* DDR3PHY AC I/O Configuration Register */ #define DDR3PHY_ACIOCR_CSPDD_CS0 (1 << 18)/* CS#[0] Power Down Driver */ #define DDR3PHY_ACIOCR_CKPDD_CK0 (1 << 8)/* CK[0] Power Down Driver */ #define DDR3PHY_ACIORC_ACPDD (1 << 3)/* AC Power Down Driver */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 95/314 serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl()
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 93810191f5d23652c0b8a1a9b3a4a89d6fd5063e ]
There are cases where omap8250_set_mctrl() may get called after the UART has already autoidled causing an asynchronous external abort.
This can happen on ttyport_open():
mem_serial_in from omap8250_set_mctrl+0x38/0xa0 omap8250_set_mctrl from uart_update_mctrl+0x4c/0x58 uart_update_mctrl from uart_dtr_rts+0x60/0xa8 uart_dtr_rts from tty_port_block_til_ready+0xd0/0x2a8 tty_port_block_til_ready from uart_open+0x14/0x1c uart_open from ttyport_open+0x64/0x148
And on ttyport_close():
omap8250_set_mctrl from uart_update_mctrl+0x3c/0x48 uart_update_mctrl from uart_dtr_rts+0x54/0x9c uart_dtr_rts from tty_port_shutdown+0x78/0x9c tty_port_shutdown from tty_port_close+0x3c/0x74 tty_port_close from ttyport_close+0x40/0x58
It can also happen on disassociate_ctty() calling uart_shutdown() that ends up calling omap8250_set_mctrl().
Let's fix the issue by adding missing PM runtime calls to omap8250_set_mctrl(). To do this, we need to add __omap8250_set_mctrl() that can be called from both omap8250_set_mctrl(), and from runtime PM resume path when restoring the registers.
Depends-on: dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
--- drivers/tty/serial/8250/8250_omap.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/tty/serial/8250/8250_omap.c +20 -2
@@ -157,7 +157,11 @@ static u32 uart_read(struct uart_8250_port *up, u32 reg)return readl (up->port.membase + (reg << up->port.regshift)); } -static void omap8250_set_mctrl (struct uart_port *port,unsigned int mctrl) +/* +* Called on runtime PM resume path from omap8250_restore_regs(), and +* omap8250_set_mctrl(). +*/ +static void __omap8250_set_mctrl (struct uart_port *port,unsigned int mctrl) {struct uart_8250_port *up =up_to_u8250p (port);struct omap8250_priv *priv = up->port.private_data;
@@ -181,6 +185,20 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl) } } +static void omap8250_set_mctrl (struct uart_port *port,unsigned int mctrl) +{ +int err; + + err =pm_runtime_resume_and_get (port->dev); +if (err) +return ; + +__omap8250_set_mctrl (port, mctrl); + +pm_runtime_mark_last_busy (port->dev); +pm_runtime_put_autosuspend (port->dev); +} +/* * Work Around for Errata i202 (2430, 3430, 3630, 4430 and 4460) * The access to uart register after MDR1 Access
@@ -341,7 +359,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up)omap8250_update_mdr1 (up, priv); - up->port.ops->set_mctrl (&up->port, up->port.mctrl); +__omap8250_set_mctrl (&up->port, up->port.mctrl);if (up->port.rs485.flags &SER_RS485_ENABLED )serial8250_em485_stop_tx (up);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 96/314 serial: 8250_omap: remove wait loop from Errata i202 workaround
In reply to Greg Kroah-HartmanFrom: Matthias Schiffer <[email protected]>
[ Upstream commit e828e56684d61b17317e0cfdef83791fa61cb76b ]
We were occasionally seeing the "Errata i202: timedout" on an AM335x board when repeatedly opening and closing a UART connected to an active sender. As new input may arrive at any time, it is possible to miss the "RX FIFO empty" condition, forcing the loop to wait until it times out.
Nothing in the i202 Advisory states that such a wait is even necessary; other FIFO clear functions like serial8250_clear_fifos() do not wait either. For this reason, it seems safe to remove the wait, fixing the mentioned issue.
--- drivers/tty/serial/8250/8250_omap.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/tty/serial/8250/8250_omap.c +0 -17
@@ -211,27 +211,10 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)static void omap_8250_mdr1_errataset (struct uart_8250_port *up,struct omap8250_priv *priv) { -u8 timeout =255 ; -serial_out (up,UART_OMAP_MDR1 , priv->mdr1);udelay (2 );serial_out (up,UART_FCR , up->fcr |UART_FCR_CLEAR_XMIT |UART_FCR_CLEAR_RCVR ); -/* -* Wait for FIFO to empty: when empty, RX_FIFO_E bit is 0 and -* TX_FIFO_E bit is 1. -*/ -while (UART_LSR_THRE != (serial_in (up,UART_LSR ) & - (UART_LSR_THRE |UART_LSR_DR ))) { - timeout--; -if (!timeout) { -/* Should *never* happen. we warn and carry on */ -dev_crit (up->port.dev,"Errata i202: timedout %x\n" , -serial_in (up,UART_LSR )); -break ; - } -udelay (1 ); - } } static void omap_8250_get_divisor(struct uart_port *port, unsigned int baud,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 97/314 serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove()
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit e3f0c638f428fd66b5871154b62706772045f91a ]
On remove, we get an error for "Runtime PM usage count underflow!". I guess this driver is mostly built-in, and this issue has gone unnoticed for a while. Somehow I did not catch this issue with my earlier fix done with commit 4e0f5cc65098 ("serial: 8250_omap: Fix probe and remove for PM runtime").
Depends-on: dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
--- drivers/tty/serial/8250/8250_omap.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/tty/serial/8250/8250_omap.c +5 -0
@@ -1461,6 +1461,11 @@ static int omap8250_probe(struct platform_device *pdev)static int omap8250_remove (struct platform_device *pdev) {struct omap8250_priv *priv =platform_get_drvdata (pdev); +int err; + + err =pm_runtime_resume_and_get (&pdev->dev); +if (err) +return err;pm_runtime_dont_use_autosuspend (&pdev->dev);pm_runtime_put_sync (&pdev->dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 98/314 serial: 8250: omap: Flush PM QOS work on remove
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit d0b68629bd2fb61e0171a62f2e8da3db322f5cf6 ]
Rebinding 8250_omap in a loop will at some point produce a warning for kernel/power/qos.c:296 cpu_latency_qos_update_request() with error "cpu_latency_qos_update_request called for unknown object". Let's flush the possibly pending PM QOS work scheduled from omap8250_runtime_suspend() before we disable runtime PM.
--- drivers/tty/serial/8250/8250_omap.c | 1 + 1 file changed, 1 insertion(+)
drivers/tty/serial/8250/8250_omap.c +1 -0
@@ -1469,6 +1469,7 @@ static int omap8250_remove(struct platform_device *pdev)pm_runtime_dont_use_autosuspend (&pdev->dev);pm_runtime_put_sync (&pdev->dev); +flush_work (&priv->qos_work);pm_runtime_disable (&pdev->dev);serial8250_unregister_port (priv->line);cpu_latency_qos_remove_request (&priv->pm_qos_request);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 99/314 tty: serial: fsl_lpuart: dont break the on-going transfer when global reset
In reply to Greg Kroah-HartmanFrom: Sherry Sun <[email protected]>
[ Upstream commit 76bad3f88750f8cc465c489e6846249e0bc3d8f5 ]
lpuart_global_reset() shouldn't break the on-going transmit engine, need to recover the on-going data transfer after reset.
This can help earlycon here, since commit 60f361722ad2 ("serial:fsl_lpuart: Reset prior to registration") moved lpuart_global_reset() before uart_add_one_port(), earlycon is writing during global reset, as global reset will disable the TX and clear the baud rate register, which caused the earlycon cannot work any more after reset, needs to restore the baud rate and re-enable the transmitter to recover the earlycon write.
Also move the lpuart_global_reset() down, then we can reuse the lpuart32_tx_empty() without declaration.
--- drivers/tty/serial/fsl_lpuart.c | 76 +++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 27 deletions(-)
drivers/tty/serial/fsl_lpuart.c +49 -27
@@ -12,6 +12,7 @@#include <linux/dmaengine.h> #include <linux/dmapool.h> #include <linux/io.h> +#include <linux/iopoll.h> #include <linux/irq.h> #include <linux/module.h> #include <linux/of.h>
@@ -404,33 +405,6 @@ static unsigned int lpuart_get_baud_clk_rate(struct lpuart_port *sport)#define lpuart_enable_clks (x) __lpuart_enable_clks(x, true)#define lpuart_disable_clks (x) __lpuart_enable_clks(x, false) -static int lpuart_global_reset (struct lpuart_port *sport) -{ -struct uart_port *port = &sport->port; -void __iomem *global_addr; -int ret; - -if (uart_console (port)) -return 0 ; - - ret =clk_prepare_enable (sport->ipg_clk); -if (ret) { -dev_err (sport->port.dev,"failed to enable uart ipg clk: %d\n" , ret); -return ret; - } - -if (is_imx7ulp_lpuart (sport) ||is_imx8qxp_lpuart (sport)) { - global_addr = port->membase +UART_GLOBAL -IMX_REG_OFF ; -writel (UART_GLOBAL_RST , global_addr); -usleep_range (GLOBAL_RST_MIN_US ,GLOBAL_RST_MAX_US ); -writel (0 , global_addr); -usleep_range (GLOBAL_RST_MIN_US ,GLOBAL_RST_MAX_US ); - } - -clk_disable_unprepare (sport->ipg_clk); -return 0 ; -} -static void lpuart_stop_tx (struct uart_port *port) {unsigned char temp;
@@ -2641,6 +2615,54 @@ static const struct serial_rs485 lpuart_rs485_supported = {/* delay_rts_* and RX_DURING_TX are not supported */ }; +static int lpuart_global_reset (struct lpuart_port *sport) +{ +struct uart_port *port = &sport->port; +void __iomem *global_addr; +unsigned long ctrl, bd; +unsigned int val =0 ; +int ret; + + ret =clk_prepare_enable (sport->ipg_clk); +if (ret) { +dev_err (sport->port.dev,"failed to enable uart ipg clk: %d\n" , ret); +return ret; + } + +if (is_imx7ulp_lpuart (sport) ||is_imx8qxp_lpuart (sport)) { +/* +* If the transmitter is used by earlycon, wait for transmit engine to +* complete and then reset. +*/ + ctrl =lpuart32_read (port,UARTCTRL ); +if (ctrl &UARTCTRL_TE ) { + bd =lpuart32_read (&sport->port,UARTBAUD ); +if (read_poll_timeout (lpuart32_tx_empty, val, val,1 ,100000 , false, + port)) { +dev_warn (sport->port.dev, +"timeout waiting for transmit engine to complete\n" ); +clk_disable_unprepare (sport->ipg_clk); +return 0 ; + } + } + + global_addr = port->membase +UART_GLOBAL -IMX_REG_OFF ; +writel (UART_GLOBAL_RST , global_addr); +usleep_range (GLOBAL_RST_MIN_US ,GLOBAL_RST_MAX_US ); +writel (0 , global_addr); +usleep_range (GLOBAL_RST_MIN_US ,GLOBAL_RST_MAX_US ); + +/* Recover the transmitter for earlycon. */ +if (ctrl &UARTCTRL_TE ) { +lpuart32_write (port, bd,UARTBAUD ); +lpuart32_write (port, ctrl,UARTCTRL ); + } + } + +clk_disable_unprepare (sport->ipg_clk); +return 0 ; +} +static int lpuart_probe (struct platform_device *pdev) {const struct lpuart_soc_data *sdata =of_device_get_match_data (&pdev->dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 100/314 serial: imx: Add missing .thaw_noirq hook
In reply to Greg Kroah-HartmanFrom: Shawn Guo <[email protected]>
[ Upstream commit 4561d8008a467cb05ac632a215391d6b787f40aa ]
The following warning is seen with non-console UART instance when system hibernates.
[ 37.371969] ------------[ cut here ]------------ [ 37.376599] uart3_root_clk already disabled [ 37.380810] WARNING: CPU: 0 PID: 296 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0 ... [ 37.506986] Call trace: [ 37.509432] clk_core_disable+0xa4/0xb0 [ 37.513270] clk_disable+0x34/0x50 [ 37.516672] imx_uart_thaw+0x38/0x5c [ 37.520250] platform_pm_thaw+0x30/0x6c [ 37.524089] dpm_run_callback.constprop.0+0x3c/0xd4 [ 37.528972] device_resume+0x7c/0x160 [ 37.532633] dpm_resume+0xe8/0x230 [ 37.536036] hibernation_snapshot+0x288/0x430 [ 37.540397] hibernate+0x10c/0x2e0 [ 37.543798] state_store+0xc4/0xd0 [ 37.547203] kobj_attr_store+0x1c/0x30 [ 37.550953] sysfs_kf_write+0x48/0x60 [ 37.554619] kernfs_fop_write_iter+0x118/0x1ac [ 37.559063] new_sync_write+0xe8/0x184 [ 37.562812] vfs_write+0x230/0x290 [ 37.566214] ksys_write+0x68/0xf4 [ 37.569529] __arm64_sys_write+0x20/0x2c [ 37.573452] invoke_syscall.constprop.0+0x50/0xf0 [ 37.578156] do_el0_svc+0x11c/0x150 [ 37.581648] el0_svc+0x30/0x140 [ 37.584792] el0t_64_sync_handler+0xe8/0xf0 [ 37.588976] el0t_64_sync+0x1a0/0x1a4 [ 37.592639] ---[ end trace 56e22eec54676d75 ]---
On hibernating, pm core calls into related hooks in sequence like:
.freeze
.freeze_noirq
.thaw_noirq
.thaw
With .thaw_noirq hook being absent, the clock will be disabled in a unbalanced call which results the warning above.
imx_uart_freeze()
clk_prepare_enable()
imx_uart_suspend_noirq()
clk_disable()
imx_uart_thaw
clk_disable_unprepare()
Adding the missing .thaw_noirq hook as imx_uart_resume_noirq() will have the call sequence corrected as below and thus fix the warning.
imx_uart_freeze()
clk_prepare_enable()
imx_uart_suspend_noirq()
clk_disable()
imx_uart_resume_noirq()
clk_enable()
imx_uart_thaw
clk_disable_unprepare()
--- drivers/tty/serial/imx.c | 1 + 1 file changed, 1 insertion(+)
drivers/tty/serial/imx.c +1 -0
@@ -2594,6 +2594,7 @@ static const struct dev_pm_ops imx_uart_pm_ops = { .suspend_noirq = imx_uart_suspend_noirq, .resume_noirq = imx_uart_resume_noirq, .freeze_noirq = imx_uart_suspend_noirq, + .thaw_noirq = imx_uart_resume_noirq, .restore_noirq = imx_uart_resume_noirq, .suspend = imx_uart_suspend, .resume = imx_uart_resume,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 101/314 tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send
In reply to Greg Kroah-HartmanFrom: Duoming Zhou <[email protected]>
[ Upstream commit 7b7dfe4833c70a11cdfa51b38705103bd31eddaa ]
The function gsm_dlci_t1() is a timer handler that runs in an atomic context, but it calls "kzalloc(..., GFP_KERNEL)" that may sleep. As a result, the sleep-in-atomic-context bug will happen. The process is shown below:
gsm_dlci_t1()
gsm_dlci_open()
gsm_modem_update()
gsm_modem_upd_via_msc()
gsm_control_send()
kzalloc(sizeof(.., GFP_KERNEL) //may sleep
This patch changes the gfp_t parameter of kzalloc() from GFP_KERNEL to GFP_ATOMIC in order to mitigate the bug.
--- drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/n_gsm.c +1 -1
@@ -1670,7 +1670,7 @@ static struct gsm_control *gsm_control_send(struct gsm_mux *gsm, unsigned int command, u8 *data, int clen) { struct gsm_control *ctrl = kzalloc(sizeof(struct gsm_control), -GFP_KERNEL ); +GFP_ATOMIC );unsigned long flags;if (ctrl ==NULL )return NULL ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 102/314 ASoC: rt5514: fix legacy dai naming
In reply to Greg Kroah-HartmanFrom: Jason Montleon <[email protected]>
[ Upstream commit 392cc13c5ec72ccd6bbfb1bc2339502cc59dd285 ]
Starting with 6.0-rc1 these messages are logged and the sound card is unavailable. Adding legacy_dai_naming to the rt5514-spi causes it to function properly again.
[ 16.928454] kbl_r5514_5663_max kbl_r5514_5663_max: ASoC: CPU DAI spi-PRP0001:00 not registered [ 16.928561] platform kbl_r5514_5663_max: deferred probe pending
--- sound/soc/codecs/rt5514-spi.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
sound/soc/codecs/rt5514-spi.c +8 -7
@@ -298,13 +298,14 @@ static int rt5514_spi_pcm_new(struct snd_soc_component *component, }static const struct snd_soc_component_driver rt5514_spi_component = { - .name =DRV_NAME , - .probe = rt5514_spi_pcm_probe, - .open = rt5514_spi_pcm_open, - .hw_params = rt5514_spi_hw_params, - .hw_free = rt5514_spi_hw_free, - .pointer = rt5514_spi_pcm_pointer, - .pcm_construct = rt5514_spi_pcm_new, + .name =DRV_NAME , + .probe = rt5514_spi_pcm_probe, + .open = rt5514_spi_pcm_open, + .hw_params = rt5514_spi_hw_params, + .hw_free = rt5514_spi_hw_free, + .pointer = rt5514_spi_pcm_pointer, + .pcm_construct = rt5514_spi_pcm_new, + .legacy_dai_naming =1 , };/**
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 103/314 ASoC: rt5677: fix legacy dai naming
In reply to Greg Kroah-HartmanFrom: Jason Montleon <[email protected]>
[ Upstream commit a1dca8774faf3f77eb34fa0ac6f3e2b82290b1e4 ]
Starting with 6.0-rc1 the CPU DAI is not registered and the sound card is unavailable. Adding legacy_dai_naming causes it to function properly again.
--- sound/soc/codecs/rt5677-spi.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
sound/soc/codecs/rt5677-spi.c +10 -9
@@ -396,15 +396,16 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component) }static const struct snd_soc_component_driver rt5677_spi_dai_component = { - .name =DRV_NAME , - .probe = rt5677_spi_pcm_probe, - .open = rt5677_spi_pcm_open, - .close = rt5677_spi_pcm_close, - .hw_params = rt5677_spi_hw_params, - .hw_free = rt5677_spi_hw_free, - .prepare = rt5677_spi_prepare, - .pointer = rt5677_spi_pcm_pointer, - .pcm_construct = rt5677_spi_pcm_new, + .name =DRV_NAME , + .probe = rt5677_spi_pcm_probe, + .open = rt5677_spi_pcm_open, + .close = rt5677_spi_pcm_close, + .hw_params = rt5677_spi_hw_params, + .hw_free = rt5677_spi_hw_free, + .prepare = rt5677_spi_prepare, + .pointer = rt5677_spi_pcm_pointer, + .pcm_construct = rt5677_spi_pcm_new, + .legacy_dai_naming =1 , };/* Select a suitable transfer command for the next transfer to ensure
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 104/314 bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb()
In reply to Greg Kroah-HartmanFrom: Baisong Zhong <[email protected]>
[ Upstream commit d3fd203f36d46aa29600a72d57a1b61af80e4a25 ]
We got a syzkaller problem because of aarch64 alignment fault if KFENCE enabled. When the size from user bpf program is an odd number, like 399, 407, etc, it will cause the struct skb_shared_info's unaligned access. As seen below:
BUG: KFENCE: use-after-free read in __skb_clone+0x23c/0x2a0 net/core/skbuff.c:1032
Use-after-free read at 0xffff6254fffac077 (in kfence-#213):
__lse_atomic_add arch/arm64/include/asm/atomic_lse.h:26 [inline] arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline] arch_atomic_inc include/linux/atomic-arch-fallback.h:270 [inline] atomic_inc include/asm-generic/atomic-instrumented.h:241 [inline] __skb_clone+0x23c/0x2a0 net/core/skbuff.c:1032 skb_clone+0xf4/0x214 net/core/skbuff.c:1481 ____bpf_clone_redirect net/core/filter.c:2433 [inline] bpf_clone_redirect+0x78/0x1c0 net/core/filter.c:2420 bpf_prog_d3839dd9068ceb51+0x80/0x330 bpf_dispatcher_nop_func include/linux/bpf.h:728 [inline] bpf_test_run+0x3c0/0x6c0 net/bpf/test_run.c:53 bpf_prog_test_run_skb+0x638/0xa7c net/bpf/test_run.c:594 bpf_prog_test_run kernel/bpf/syscall.c:3148 [inline] __do_sys_bpf kernel/bpf/syscall.c:4441 [inline] __se_sys_bpf+0xad0/0x1634 kernel/bpf/syscall.c:4381
kfence-#213: 0xffff6254fffac000-0xffff6254fffac196, size=407, cache=kmalloc-512
allocated by task 15074 on cpu 0 at 1342.585390s:
kmalloc include/linux/slab.h:568 [inline] kzalloc include/linux/slab.h:675 [inline] bpf_test_init.isra.0+0xac/0x290 net/bpf/test_run.c:191 bpf_prog_test_run_skb+0x11c/0xa7c net/bpf/test_run.c:512 bpf_prog_test_run kernel/bpf/syscall.c:3148 [inline] __do_sys_bpf kernel/bpf/syscall.c:4441 [inline] __se_sys_bpf+0xad0/0x1634 kernel/bpf/syscall.c:4381 __arm64_sys_bpf+0x50/0x60 kernel/bpf/syscall.c:4381
To fix the problem, we adjust @size so that (@size + @hearoom) is a multiple of SMP_CACHE_BYTES. So we make sure the struct skb_shared_info is aligned to a cache line.
--- net/bpf/test_run.c | 1 + 1 file changed, 1 insertion(+)
net/bpf/test_run.c +1 -0
@@ -733,6 +733,7 @@ static void *bpf_test_init(const union bpf_attr *kattr, u32 user_size,if (user_size > size)return ERR_PTR (-EMSGSIZE ); + size =SKB_DATA_ALIGN (size); data =kzalloc (size + headroom + tailroom,GFP_USER );if (!data)return ERR_PTR (-ENOMEM );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 105/314 bnxt_en: refactor bnxt_cancel_reservations()
In reply to Greg Kroah-HartmanFrom: Vikas Gupta <[email protected]>
[ Upstream commit b4c66425771ddb910316c7b4cd7fa0614098ec45 ]
Introduce bnxt_clear_reservations() to clear the reserved attributes only. This will be used in the next patch to fix PCI AER handling.
Stable-dep-of: 0cf736a18a1e ("bnxt_en: fix the handling of PCIE-AER")
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +16 -7
@@ -9983,17 +9983,12 @@ static int bnxt_try_recover_fw(struct bnxt *bp)return -ENODEV ; } -int bnxt_cancel_reservations (struct bnxt *bp,bool fw_reset) +static void bnxt_clear_reservations (struct bnxt *bp,bool fw_reset) {struct bnxt_hw_resc *hw_resc = &bp->hw_resc; -int rc;if (!BNXT_NEW_RM (bp)) -return 0 ;/* no resource reservations required */ - - rc =bnxt_hwrm_func_resc_qcaps (bp, true); -if (rc) -netdev_err (bp->dev,"resc_qcaps failed\n" ); +return ;/* no resource reservations required */ hw_resc->resv_cp_rings =0 ; hw_resc->resv_stat_ctxs =0 ;
@@ -10006,6 +10001,20 @@ int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset) bp->tx_nr_rings =0 ; bp->rx_nr_rings =0 ; } +} + +int bnxt_cancel_reservations (struct bnxt *bp,bool fw_reset) +{ +int rc; + +if (!BNXT_NEW_RM (bp)) +return 0 ;/* no resource reservations required */ + + rc =bnxt_hwrm_func_resc_qcaps (bp, true); +if (rc) +netdev_err (bp->dev,"resc_qcaps failed\n" ); + +bnxt_clear_reservations (bp, fw_reset);return rc; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 106/314 bnxt_en: fix the handling of PCIE-AER
In reply to Greg Kroah-HartmanFrom: Vikas Gupta <[email protected]>
[ Upstream commit 0cf736a18a1e804037839bd8df9e36f0efdb8745 ]
Fix the sequence required for PCIE-AER. While slot reset occurs, firmware might not be ready and the driver needs to check for its recovery. We also need to remap the health registers for some chips and clear the resource reservations. The resources will be allocated again during bnxt_io_resume().
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 29 ++++++++++++++++++- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + .../net/ethernet/broadcom/bnxt/bnxt_hwrm.c | 3 +- 3 files changed, 31 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +28 -1
@@ -13922,7 +13922,9 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)pci_ers_result_t result =PCI_ERS_RESULT_DISCONNECT ;struct net_device *netdev =pci_get_drvdata (pdev);struct bnxt *bp =netdev_priv (netdev); -int err =0 , off; +int retry =0 ; +int err =0 ; +int off;netdev_info (bp->dev,"PCI Slot Reset\n" );
@@ -13950,11 +13952,36 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)pci_restore_state (pdev);pci_save_state (pdev); +bnxt_inv_fw_health_reg (bp); +bnxt_try_map_fw_health_reg (bp); + +/* In some PCIe AER scenarios, firmware may take up to +* 10 seconds to become ready in the worst case. +*/ +do { + err =bnxt_try_recover_fw (bp); +if (!err) +break ; + retry++; + }while (retry <BNXT_FW_SLOT_RESET_RETRY ); + +if (err) { +dev_err (&pdev->dev,"Firmware not ready\n" ); + goto reset_exit; + } + err =bnxt_hwrm_func_reset (bp);if (!err) result =PCI_ERS_RESULT_RECOVERED ; + +bnxt_ulp_irq_stop (bp); +bnxt_clear_int_mode (bp); + err =bnxt_init_int_mode (bp); +bnxt_ulp_irq_restart (bp, err); } +reset_exit: +bnxt_clear_reservations (bp, true);rtnl_unlock ();return result;
drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 -0
@@ -1621,6 +1621,7 @@ struct bnxt_fw_health {#define BNXT_FW_RETRY 5#define BNXT_FW_IF_RETRY 10 +#define BNXT_FW_SLOT_RESET_RETRY 4enum board_idx {BCM57301 ,
drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c +2 -1
@@ -476,7 +476,8 @@ static int __hwrm_send(struct bnxt *bp, struct bnxt_hwrm_ctx *ctx)memset (ctx->resp,0 ,PAGE_SIZE ); req_type =le16_to_cpu (ctx->req->req_type); -if (BNXT_NO_FW_ACCESS (bp) && req_type !=HWRM_FUNC_RESET ) { +if (BNXT_NO_FW_ACCESS (bp) && + (req_type !=HWRM_FUNC_RESET && req_type !=HWRM_VER_GET )) {netdev_dbg (bp->dev,"hwrm req_type 0x%x skipped, FW channel down\n" , req_type); goto exit;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 107/314 ASoC: soc-utils: Remove __exit for snd_soc_util_exit()
In reply to Greg Kroah-HartmanFrom: Chen Zhongjin <[email protected]>
[ Upstream commit 314d34fe7f0a5836cb0472950c1f17744b4efde8 ]
snd_soc_util_exit() is called in __init snd_soc_init() for cleanup. Remove the __exit annotation for it to fix the build warning:
WARNING: modpost: sound/soc/snd-soc-core.o: section mismatch in reference: init_module (section: .init.text) -> snd_soc_util_exit (section: .exit.text)
--- sound/soc/soc-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-utils.c +1 -1
@@ -263,7 +263,7 @@ int __init snd_soc_util_init(void)return ret; } -void __exit snd_soc_util_exit(void) +void snd_soc_util_exit (void ) {platform_driver_unregister (&soc_dummy_driver);platform_device_unregister (soc_dummy_dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 108/314 pinctrl: rockchip: list all pins in a possible mux route for PX30
In reply to Greg Kroah-HartmanFrom: Quentin Schulz <[email protected]>
[ Upstream commit bee55f2e7a44e7a7676e264b42f026e34bd244d9 ]
The mux routes are incomplete for the PX30. This was discovered because we had a HW design using cif-clkoutm1 with the correct pinmux in the Device Tree but the clock would still not work.
There are actually two muxing required: the pin muxing (performed by the usual Device Tree pinctrl nodes) and the "function" muxing (m0 vs m1; performed by the mux routing inside the driver). The pin muxing was correct but the function muxing was not.
This adds the missing pins and their configuration for the mux routes that are already specified in the driver.
Note that there are some "conflicts": it is possible *in Device Tree* to (attempt to) mux the pins for e.g. clkoutm1 and clkinm0 at the same time but this is actually not possible in hardware (because both share the same bit for the function muxing). Since it is an impossible hardware design, it is not deemed necessary to prevent the user from attempting to "misconfigure" the pins/functions.
--- drivers/pinctrl/pinctrl-rockchip.c | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
drivers/pinctrl/pinctrl-rockchip.c +40 -0
@@ -632,14 +632,54 @@ static void rockchip_get_recalced_mux(struct rockchip_pin_bank *bank, int pin, }static struct rockchip_mux_route_data px30_mux_route_data[] = { +RK_MUXROUTE_SAME (2 ,RK_PB4 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d0m0 */ +RK_MUXROUTE_SAME (3 ,RK_PA1 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d0m1 */ +RK_MUXROUTE_SAME (2 ,RK_PB6 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d1m0 */ +RK_MUXROUTE_SAME (3 ,RK_PA2 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d1m1 */ RK_MUXROUTE_SAME (2 ,RK_PA0 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d2m0 */ RK_MUXROUTE_SAME (3 ,RK_PA3 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d2m1 */ +RK_MUXROUTE_SAME (2 ,RK_PA1 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d3m0 */ +RK_MUXROUTE_SAME (3 ,RK_PA5 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d3m1 */ +RK_MUXROUTE_SAME (2 ,RK_PA2 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d4m0 */ +RK_MUXROUTE_SAME (3 ,RK_PA7 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d4m1 */ +RK_MUXROUTE_SAME (2 ,RK_PA3 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d5m0 */ +RK_MUXROUTE_SAME (3 ,RK_PB0 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d5m1 */ +RK_MUXROUTE_SAME (2 ,RK_PA4 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d6m0 */ +RK_MUXROUTE_SAME (3 ,RK_PB1 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d6m1 */ +RK_MUXROUTE_SAME (2 ,RK_PA5 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d7m0 */ +RK_MUXROUTE_SAME (3 ,RK_PB4 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d7m1 */ +RK_MUXROUTE_SAME (2 ,RK_PA6 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d8m0 */ +RK_MUXROUTE_SAME (3 ,RK_PB6 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d8m1 */ +RK_MUXROUTE_SAME (2 ,RK_PA7 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d9m0 */ +RK_MUXROUTE_SAME (3 ,RK_PB7 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d9m1 */ +RK_MUXROUTE_SAME (2 ,RK_PB7 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d10m0 */ +RK_MUXROUTE_SAME (3 ,RK_PC6 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d10m1 */ +RK_MUXROUTE_SAME (2 ,RK_PC0 ,1 ,0x184 ,BIT (16 +7 )),/* cif-d11m0 */ +RK_MUXROUTE_SAME (3 ,RK_PC7 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-d11m1 */ +RK_MUXROUTE_SAME (2 ,RK_PB0 ,1 ,0x184 ,BIT (16 +7 )),/* cif-vsyncm0 */ +RK_MUXROUTE_SAME (3 ,RK_PD1 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-vsyncm1 */ +RK_MUXROUTE_SAME (2 ,RK_PB1 ,1 ,0x184 ,BIT (16 +7 )),/* cif-hrefm0 */ +RK_MUXROUTE_SAME (3 ,RK_PD2 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-hrefm1 */ +RK_MUXROUTE_SAME (2 ,RK_PB2 ,1 ,0x184 ,BIT (16 +7 )),/* cif-clkinm0 */ +RK_MUXROUTE_SAME (3 ,RK_PD3 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-clkinm1 */ +RK_MUXROUTE_SAME (2 ,RK_PB3 ,1 ,0x184 ,BIT (16 +7 )),/* cif-clkoutm0 */ +RK_MUXROUTE_SAME (3 ,RK_PD0 ,3 ,0x184 ,BIT (16 +7 ) |BIT (7 )),/* cif-clkoutm1 */ RK_MUXROUTE_SAME (3 ,RK_PC6 ,2 ,0x184 ,BIT (16 +8 )),/* pdm-m0 */ RK_MUXROUTE_SAME (2 ,RK_PC6 ,1 ,0x184 ,BIT (16 +8 ) |BIT (8 )),/* pdm-m1 */ +RK_MUXROUTE_SAME (3 ,RK_PD3 ,2 ,0x184 ,BIT (16 +8 )),/* pdm-sdi0m0 */ +RK_MUXROUTE_SAME (2 ,RK_PC5 ,2 ,0x184 ,BIT (16 +8 ) |BIT (8 )),/* pdm-sdi0m1 */ RK_MUXROUTE_SAME (1 ,RK_PD3 ,2 ,0x184 ,BIT (16 +10 )),/* uart2-rxm0 */ RK_MUXROUTE_SAME (2 ,RK_PB6 ,2 ,0x184 ,BIT (16 +10 ) |BIT (10 )),/* uart2-rxm1 */ +RK_MUXROUTE_SAME (1 ,RK_PD2 ,2 ,0x184 ,BIT (16 +10 )),/* uart2-txm0 */ +RK_MUXROUTE_SAME (2 ,RK_PB4 ,2 ,0x184 ,BIT (16 +10 ) |BIT (10 )),/* uart2-txm1 */ RK_MUXROUTE_SAME (0 ,RK_PC1 ,2 ,0x184 ,BIT (16 +9 )),/* uart3-rxm0 */ RK_MUXROUTE_SAME (1 ,RK_PB7 ,2 ,0x184 ,BIT (16 +9 ) |BIT (9 )),/* uart3-rxm1 */ +RK_MUXROUTE_SAME (0 ,RK_PC0 ,2 ,0x184 ,BIT (16 +9 )),/* uart3-txm0 */ +RK_MUXROUTE_SAME (1 ,RK_PB6 ,2 ,0x184 ,BIT (16 +9 ) |BIT (9 )),/* uart3-txm1 */ +RK_MUXROUTE_SAME (0 ,RK_PC2 ,2 ,0x184 ,BIT (16 +9 )),/* uart3-ctsm0 */ +RK_MUXROUTE_SAME (1 ,RK_PB4 ,2 ,0x184 ,BIT (16 +9 ) |BIT (9 )),/* uart3-ctsm1 */ +RK_MUXROUTE_SAME (0 ,RK_PC3 ,2 ,0x184 ,BIT (16 +9 )),/* uart3-rtsm0 */ +RK_MUXROUTE_SAME (1 ,RK_PB5 ,2 ,0x184 ,BIT (16 +9 ) |BIT (9 )),/* uart3-rtsm1 */ };static struct rockchip_mux_route_data rk3128_mux_route_data[] = {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 109/314 mtd: onenand: omap2: add dependency on GPMC
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit c717b9b7d6de9e024e47f7cd5bbff49f581d3db9 ]
OMAP2 OneNAND driver uses gpmc_omap_onenand_set_timings() provided by OMAP_GPMC driver, so the latter cannot be module if OneNAND driver is built-in:
/usr/bin/arm-linux-gnueabi-ld: drivers/mtd/nand/onenand/onenand_omap2.o: in function `omap2_onenand_probe':
onenand_omap2.c:(.text+0x520): undefined reference to `gpmc_omap_onenand_set_timings'
The OMAP_GPMC is also a runtime dependency.
--- drivers/mtd/nand/onenand/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/onenand/Kconfig +1 -0
@@ -26,6 +26,7 @@ config MTD_ONENAND_OMAP2 tristate "OneNAND on OMAP2/OMAP3 support" depends on ARCH_OMAP2 || ARCH_OMAP3 || (COMPILE_TEST && ARM) depends on OF || COMPILE_TEST + depends on OMAP_GPMC help Support for a OneNAND flash device connected to an OMAP2/OMAP3 SoC via the GPMC memory controller.
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 110/314 scsi: scsi_transport_sas: Fix error handling in sas_phy_add()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 5d7bebf2dfb0dc97aac1fbace0910e557ecdb16f ]
If transport_add_device() fails in sas_phy_add(), the kernel will crash trying to delete the device in transport_remove_device() called from sas_remove_host().
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000108 CPU: 61 PID: 42829 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc1+ #173 pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : device_del+0x54/0x3d0 lr : device_del+0x37c/0x3d0 Call trace: device_del+0x54/0x3d0 attribute_container_class_device_del+0x28/0x38 transport_remove_classdev+0x6c/0x80 attribute_container_device_trigger+0x108/0x110 transport_remove_device+0x28/0x38 sas_phy_delete+0x30/0x60 [scsi_transport_sas] do_sas_phy_delete+0x6c/0x80 [scsi_transport_sas] device_for_each_child+0x68/0xb0 sas_remove_children+0x40/0x50 [scsi_transport_sas] sas_remove_host+0x20/0x38 [scsi_transport_sas] hisi_sas_remove+0x40/0x68 [hisi_sas_main] hisi_sas_v2_remove+0x20/0x30 [hisi_sas_v2_hw] platform_remove+0x2c/0x60
Fix this by checking and handling return value of transport_add_device() in sas_phy_add().
--- drivers/scsi/scsi_transport_sas.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/scsi/scsi_transport_sas.c +9 -4
@@ -722,12 +722,17 @@ int sas_phy_add(struct sas_phy *phy)int error; error =device_add (&phy->dev); -if (!error) { -transport_add_device (&phy->dev); -transport_configure_device (&phy->dev); +if (error) +return error; + + error =transport_add_device (&phy->dev); +if (error) { +device_del (&phy->dev); +return error; } +transport_configure_device (&phy->dev); -return error; +return 0 ; }EXPORT_SYMBOL (sas_phy_add);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 111/314 sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit 9f0b773210c27a8f5d98ddb2fc4ba60a42a3285f ]
Since commit 5bbbbe32a431 ("sctp: introduce stream scheduler foundations"), sctp_stream_outq_migrate() has been called in sctp_stream_init/update to removes those chunks to streams higher than the new max. There is no longer need to do such check in sctp_prsctp_prune_unsent().
Stable-dep-of: 2f201ae14ae0 ("sctp: clear out_curr if all frag chunks of current msg are pruned")
--- net/sctp/outqueue.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
net/sctp/outqueue.c +3 -5
@@ -384,6 +384,7 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc, {struct sctp_outq *q = &asoc->outqueue;struct sctp_chunk *chk, *temp; +struct sctp_stream_out *sout; q->sched->unsched_all (&asoc->stream);
@@ -398,12 +399,9 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,sctp_sched_dequeue_common (q, chk); asoc->sent_cnt_removable--; asoc->abandoned_unsent[SCTP_PR_INDEX (PRIO )]++; -if (chk->sinfo.sinfo_stream < asoc->stream.outcnt) { -struct sctp_stream_out *streamout = -SCTP_SO (&asoc->stream, chk->sinfo.sinfo_stream); - streamout->ext->abandoned_unsent[SCTP_PR_INDEX (PRIO )]++; - } + sout =SCTP_SO (&asoc->stream, chk->sinfo.sinfo_stream); + sout->ext->abandoned_unsent[SCTP_PR_INDEX (PRIO )]++; msg_len -= chk->skb->truesize +sizeof (struct sctp_chunk );sctp_chunk_free (chk);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 112/314 sctp: clear out_curr if all frag chunks of current msg are pruned
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit 2f201ae14ae0f91dbf1cffea7bb1e29e81d4d108 ]
A crash was reported by Zhen Chen:
list_del corruption, ffffa035ddf01c18->next is NULL
WARNING: CPU: 1 PID: 250682 at lib/list_debug.c:49 __list_del_entry_valid+0x59/0xe0 RIP: 0010:__list_del_entry_valid+0x59/0xe0 Call Trace: sctp_sched_dequeue_common+0x17/0x70 [sctp] sctp_sched_fcfs_dequeue+0x37/0x50 [sctp] sctp_outq_flush_data+0x85/0x360 [sctp] sctp_outq_uncork+0x77/0xa0 [sctp] sctp_cmd_interpreter.constprop.0+0x164/0x1450 [sctp] sctp_side_effects+0x37/0xe0 [sctp] sctp_do_sm+0xd0/0x230 [sctp] sctp_primitive_SEND+0x2f/0x40 [sctp] sctp_sendmsg_to_asoc+0x3fa/0x5c0 [sctp] sctp_sendmsg+0x3d5/0x440 [sctp] sock_sendmsg+0x5b/0x70
and in sctp_sched_fcfs_dequeue() it dequeued a chunk from stream out_curr outq while this outq was empty.
Normally stream->out_curr must be set to NULL once all frag chunks of current msg are dequeued, as we can see in sctp_sched_dequeue_done(). However, in sctp_prsctp_prune_unsent() as it is not a proper dequeue, sctp_sched_dequeue_done() is not called to do this.
This patch is to fix it by simply setting out_curr to NULL when the last frag chunk of current msg is dequeued from out_curr stream in sctp_prsctp_prune_unsent().
--- net/sctp/outqueue.c | 5 +++++ 1 file changed, 5 insertions(+)
net/sctp/outqueue.c +5 -0
@@ -403,6 +403,11 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc, sout =SCTP_SO (&asoc->stream, chk->sinfo.sinfo_stream); sout->ext->abandoned_unsent[SCTP_PR_INDEX (PRIO )]++; +/* clear out_curr if all frag chunks are pruned */ +if (asoc->stream.out_curr == sout && +list_is_last (&chk->frag_list, &chk->msg->chunks)) + asoc->stream.out_curr =NULL ; + msg_len -= chk->skb->truesize +sizeof (struct sctp_chunk );sctp_chunk_free (chk);if (msg_len <=0 )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 113/314 erofs: clean up .read_folio() and .readahead() in fscache mode
In reply to Greg Kroah-HartmanFrom: Jingbo Xu <[email protected]>
[ Upstream commit 1ae9470c3e14624b0f4d8741c22b5a94062c0e33 ]
The implementation of these two functions in fscache mode is almost the same. Extract the same part as a generic helper to remove the code duplication.
Stable-dep-of: e6d9f9ba111b ("erofs: get correct count for unmapped range in fscache mode")
--- fs/erofs/fscache.c | 213 ++++++++++++++++++--------------------------- 1 file changed, 83 insertions(+), 130 deletions(-)
fs/erofs/fscache.c +83 -130
@@ -234,113 +234,111 @@ static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio)return ret; } -static int erofs_fscache_read_folio_inline (struct folio *folio, -struct erofs_map_blocks *map) -{ -struct super_block *sb =folio_mapping (folio)->host->i_sb; -struct erofs_buf buf = __EROFS_BUF_INITIALIZER; -erofs_blk_t blknr; -size_t offset, len; -void *src, *dst; - -/* For tail packing layout, the offset may be non-zero. */ - offset =erofs_blkoff (map->m_pa); - blknr =erofs_blknr (map->m_pa); - len = map->m_llen; - - src =erofs_read_metabuf (&buf, sb, blknr,EROFS_KMAP ); -if (IS_ERR (src)) -return PTR_ERR (src); - - dst =kmap_local_folio (folio,0 ); -memcpy (dst, src + offset, len); -memset (dst + len,0 ,PAGE_SIZE - len); -kunmap_local (dst); - -erofs_put_metabuf (&buf); -return 0 ; -} - -static int erofs_fscache_read_folio (struct file *file,struct folio *folio) +/* +* Read into page cache in the range described by (@pos, @len). +* +* On return, the caller is responsible for page unlocking if the output @unlock +* is true, or the callee will take this responsibility through netfs_io_request +* interface. +* +* The return value is the number of bytes successfully handled, or negative +* error code on failure. The only exception is that, the length of the range +* instead of the error code is returned on failure after netfs_io_request is +* allocated, so that .readahead() could advance rac accordingly. +*/ +static int erofs_fscache_data_read (struct address_space *mapping, +loff_t pos,size_t len,bool *unlock) { -struct inode *inode =folio_mapping (folio)->host; +struct inode *inode = mapping->host;struct super_block *sb = inode->i_sb; +struct netfs_io_request *rreq;struct erofs_map_blocks map;struct erofs_map_dev mdev; -struct netfs_io_request *rreq; -erofs_off_t pos; -loff_t pstart; +struct iov_iter iter; +size_t count;int ret; -DBG_BUGON (folio_size (folio) !=EROFS_BLKSIZ ); + *unlock = true; - pos =folio_pos (folio); map.m_la = pos; - ret =erofs_map_blocks (inode, &map,EROFS_GET_BLOCKS_RAW );if (ret) - goto out_unlock; +return ret; -if (!(map.m_flags &EROFS_MAP_MAPPED )) { -folio_zero_range (folio,0 ,folio_size (folio)); - goto out_uptodate; +if (map.m_flags &EROFS_MAP_META ) { +struct erofs_buf buf = __EROFS_BUF_INITIALIZER; +erofs_blk_t blknr; +size_t offset, size; +void *src; + +/* For tail packing layout, the offset may be non-zero. */ + offset =erofs_blkoff (map.m_pa); + blknr =erofs_blknr (map.m_pa); + size = map.m_llen; + + src =erofs_read_metabuf (&buf, sb, blknr,EROFS_KMAP ); +if (IS_ERR (src)) +return PTR_ERR (src); + +iov_iter_xarray (&iter,READ , &mapping->i_pages, pos,PAGE_SIZE ); +if (copy_to_iter (src + offset, size, &iter) != size) +return -EFAULT ; +iov_iter_zero (PAGE_SIZE - size, &iter); +erofs_put_metabuf (&buf); +return PAGE_SIZE ; } -if (map.m_flags &EROFS_MAP_META ) { - ret =erofs_fscache_read_folio_inline (folio, &map); - goto out_uptodate; + count =min_t (size_t, map.m_llen - (pos - map.m_la), len); +DBG_BUGON (!count || count %PAGE_SIZE ); + +if (!(map.m_flags &EROFS_MAP_MAPPED )) { +iov_iter_xarray (&iter,READ , &mapping->i_pages, pos, count); +iov_iter_zero (count, &iter); +return count; } mdev = (struct erofs_map_dev ) { .m_deviceid = map.m_deviceid, .m_pa = map.m_pa, }; - ret =erofs_map_dev (sb, &mdev);if (ret) - goto out_unlock; - - - rreq =erofs_fscache_alloc_request (folio_mapping (folio), -folio_pos (folio),folio_size (folio)); -if (IS_ERR (rreq)) { - ret =PTR_ERR (rreq); - goto out_unlock; - } +return ret; - pstart = mdev.m_pa + (pos - map.m_la); -return erofs_fscache_read_folios_async (mdev.m_fscache->cookie, - rreq, pstart); + rreq =erofs_fscache_alloc_request (mapping, pos, count); +if (IS_ERR (rreq)) +return PTR_ERR (rreq); -out_uptodate: -if (!ret) -folio_mark_uptodate (folio); -out_unlock: -folio_unlock (folio); -return ret; + *unlock = false; +erofs_fscache_read_folios_async (mdev.m_fscache->cookie, + rreq, mdev.m_pa + (pos - map.m_la)); +return count; } -static void erofs_fscache_advance_folios (struct readahead_control *rac, -size_t len,bool unlock) +static int erofs_fscache_read_folio (struct file *file,struct folio *folio) { -while (len) { -struct folio *folio =readahead_folio (rac); - len -=folio_size (folio); -if (unlock) { +bool unlock; +int ret; + +DBG_BUGON (folio_size (folio) !=EROFS_BLKSIZ ); + + ret =erofs_fscache_data_read (folio_mapping (folio),folio_pos (folio), +folio_size (folio), &unlock); +if (unlock) { +if (ret >0 )folio_mark_uptodate (folio); -folio_unlock (folio); - } +folio_unlock (folio); } +return ret <0 ? ret :0 ; }static void erofs_fscache_readahead (struct readahead_control *rac) { -struct inode *inode = rac->mapping->host; -struct super_block *sb = inode->i_sb; -size_t len, count, done =0 ; -erofs_off_t pos; -loff_t start, offset; -int ret; +struct folio *folio; +size_t len, done =0 ; +loff_t start, pos; +bool unlock; +int ret, size;if (!readahead_count (rac))return ;
@@ -349,67 +347,22 @@ static void erofs_fscache_readahead(struct readahead_control *rac) len =readahead_length (rac);do { -struct erofs_map_blocks map; -struct erofs_map_dev mdev; -struct netfs_io_request *rreq; - pos = start + done; - map.m_la = pos; - - ret =erofs_map_blocks (inode, &map,EROFS_GET_BLOCKS_RAW ); -if (ret) + ret =erofs_fscache_data_read (rac->mapping, pos, + len - done, &unlock); +if (ret <=0 )return ; - offset = start + done; - count =min_t (size_t, map.m_llen - (pos - map.m_la), - len - done); - -if (!(map.m_flags &EROFS_MAP_MAPPED )) { -struct iov_iter iter; - -iov_iter_xarray (&iter,READ , &rac->mapping->i_pages, - offset, count); -iov_iter_zero (count, &iter); - -erofs_fscache_advance_folios (rac, count, true); - ret = count; -continue ; - } - -if (map.m_flags &EROFS_MAP_META ) { -struct folio *folio =readahead_folio (rac); - - ret =erofs_fscache_read_folio_inline (folio, &map); -if (!ret) { + size = ret; +while (size) { + folio =readahead_folio (rac); + size -=folio_size (folio); +if (unlock) {folio_mark_uptodate (folio); - ret =folio_size (folio); +folio_unlock (folio); } - -folio_unlock (folio); -continue ; } - - mdev = (struct erofs_map_dev ) { - .m_deviceid = map.m_deviceid, - .m_pa = map.m_pa, - }; - ret =erofs_map_dev (sb, &mdev); -if (ret) -return ; - - rreq =erofs_fscache_alloc_request (rac->mapping, offset, count); -if (IS_ERR (rreq)) -return ; -/* -* Drop the ref of folios here. Unlock them in -* rreq_unlock_folios() when rreq complete. -*/ -erofs_fscache_advance_folios (rac, count, false); - ret =erofs_fscache_read_folios_async (mdev.m_fscache->cookie, - rreq, mdev.m_pa + (pos - map.m_la)); -if (!ret) - ret = count; - }while (ret >0 && ((done += ret) < len)); + }while ((done += ret) < len); }static const struct address_space_operations erofs_fscache_meta_aops = {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 114/314 erofs: get correct count for unmapped range in fscache mode
In reply to Greg Kroah-HartmanFrom: Jingbo Xu <[email protected]>
[ Upstream commit e6d9f9ba111b56154f1b1120252aff269cebd49c ]
For unmapped range, the returned map.m_llen is zero, and thus the calculated count is unexpected zero.
Prior to the refactoring introduced by commit 1ae9470c3e14 ("erofs:
clean up .read_folio() and .readahead() in fscache mode"), only the readahead routine suffers from this. With the refactoring of making .read_folio() and .readahead() calling one common routine, both read_folio and readahead have this issue now.
Fix this by calculating count separately in unmapped condition.
--- fs/erofs/fscache.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/erofs/fscache.c +4 -3
@@ -288,15 +288,16 @@ static int erofs_fscache_data_read(struct address_space *mapping,return PAGE_SIZE ; } - count =min_t (size_t, map.m_llen - (pos - map.m_la), len); -DBG_BUGON (!count || count %PAGE_SIZE ); -if (!(map.m_flags &EROFS_MAP_MAPPED )) { + count = len;iov_iter_xarray (&iter,READ , &mapping->i_pages, pos, count);iov_iter_zero (count, &iter);return count; } + count =min_t (size_t, map.m_llen - (pos - map.m_la), len); +DBG_BUGON (!count || count %PAGE_SIZE ); + mdev = (struct erofs_map_dev ) { .m_deviceid = map.m_deviceid, .m_pa = map.m_pa,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 115/314 block: sed-opal: kmalloc the cmd/resp buffers
In reply to Greg Kroah-HartmanFrom: Serge Semin <[email protected]>
[ Upstream commit f829230dd51974c1f4478900ed30bb77ba530b40 ]
In accordance with [1] the DMA-able memory buffers must be cacheline-aligned otherwise the cache writing-back and invalidation performed during the mapping may cause the adjacent data being lost. It's specifically required for the DMA-noncoherent platforms [2]. Seeing the opal_dev.{cmd,resp} buffers are implicitly used for DMAs in the NVME and SCSI/SD drivers in framework of the nvme_sec_submit() and sd_sec_submit() methods respectively they must be cacheline-aligned to prevent the denoted problem. One of the option to guarantee that is to kmalloc the buffers [2]. Let's explicitly allocate them then instead of embedding into the opal_dev structure instance.
Note this fix was inspired by the commit c94b7f9bab22 ("nvme-hwmon:
kmalloc the NVME SMART log buffer").
[1] Documentation/core-api/dma-api.rst
[2] Documentation/core-api/dma-api-howto.rst
--- block/sed-opal.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)
block/sed-opal.c +28 -4
@@ -88,8 +88,8 @@ struct opal_dev {u64 lowest_lba;size_t pos; -u8 cmd[IO_BUFFER_LENGTH ]; -u8 resp[IO_BUFFER_LENGTH ]; +u8 *cmd; +u8 *resp;struct parsed_resp parsed;size_t prev_d_len;
@@ -2134,6 +2134,8 @@ void free_opal_dev(struct opal_dev *dev)return ;clean_opal_dev (dev); +kfree (dev->resp); +kfree (dev->cmd);kfree (dev); }EXPORT_SYMBOL (free_opal_dev);
@@ -2146,17 +2148,39 @@ struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv)if (!dev)return NULL ; +/* +* Presumably DMA-able buffers must be cache-aligned. Kmalloc makes +* sure the allocated buffer is DMA-safe in that regard. +*/ + dev->cmd =kmalloc (IO_BUFFER_LENGTH ,GFP_KERNEL ); +if (!dev->cmd) + goto err_free_dev; + + dev->resp =kmalloc (IO_BUFFER_LENGTH ,GFP_KERNEL ); +if (!dev->resp) + goto err_free_cmd; +INIT_LIST_HEAD (&dev->unlk_lst);mutex_init (&dev->dev_lock); dev->data = data; dev->send_recv = send_recv;if (check_opal_support (dev) !=0 ) {pr_debug ("Opal is not supported on this device\n" ); -kfree (dev); -return NULL ; + goto err_free_resp; }return dev; + +err_free_resp: +kfree (dev->resp); + +err_free_cmd: +kfree (dev->cmd); + +err_free_dev: +kfree (dev); + +return NULL ; }EXPORT_SYMBOL (init_opal_dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 116/314 nfsd: put the export reference in nfsd4_verify_deleg_dentry
In reply to Greg Kroah-HartmanFrom: Jeff Layton <[email protected]>
[ Upstream commit 50256e4793a5e5ab77703c82a47344ad2e774a59 ]
nfsd_lookup_dentry returns an export reference in addition to the dentry ref. Ensure that we put it too.
--- fs/nfsd/nfs4state.c | 1 + 1 file changed, 1 insertion(+)
fs/nfsd/nfs4state.c +1 -0
@@ -5313,6 +5313,7 @@ nfsd4_verify_deleg_dentry(struct nfsd4_open *open, struct nfs4_file *fp,if (err)return -EAGAIN ; +exp_put (exp);dput (child);if (child !=file_dentry (fp->fi_deleg_file->nf_file))return -EAGAIN ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 117/314 bpf: Fix memory leaks in __check_func_call
In reply to Greg Kroah-HartmanFrom: Wang Yufen <[email protected]>
[ Upstream commit eb86559a691cea5fa63e57a03ec3dc9c31e97955 ]
kmemleak reports this issue:
unreferenced object 0xffff88817139d000 (size 2048):
comm "test_progs", pid 33246, jiffies 4307381979 (age 45851.820s) hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<0000000045f075f0>] kmalloc_trace+0x27/0xa0
[<0000000098b7c90a>] __check_func_call+0x316/0x1230
[<00000000b4c3c403>] check_helper_call+0x172e/0x4700
[<00000000aa3875b7>] do_check+0x21d8/0x45e0
[<000000001147357b>] do_check_common+0x767/0xaf0
[<00000000b5a595b4>] bpf_check+0x43e3/0x5bc0
[<0000000011e391b1>] bpf_prog_load+0xf26/0x1940
[<0000000007f765c0>] __sys_bpf+0xd2c/0x3650
[<00000000839815d6>] __x64_sys_bpf+0x75/0xc0
[<00000000946ee250>] do_syscall_64+0x3b/0x90
[<0000000000506b7f>] entry_SYSCALL_64_after_hwframe+0x63/0xcdThe root case here is: In function prepare_func_exit(), the callee is not released in the abnormal scenario after "state->curframe--;". To fix, move "state->curframe--;" to the very bottom of the function, right when we free callee and reset frame[] pointer to NULL, as Andrii suggested.
In addition, function __check_func_call() has a similar problem. In the abnormal scenario before "state->curframe++;", the callee also should be released by free_func_state().
--- kernel/bpf/verifier.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
kernel/bpf/verifier.c +9 -5
@@ -6674,11 +6674,11 @@ static int __check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insn/* Transfer references to the callee */ err =copy_reference_state (callee, caller);if (err) -return err; + goto err_out; err =set_callee_state_cb (env, caller, callee, *insn_idx);if (err) -return err; + goto err_out;clear_caller_saved_regs (env, caller->regs);
@@ -6695,6 +6695,11 @@ static int __check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insnprint_verifier_state (env, callee, true); }return 0 ; + +err_out: +free_func_state (callee); + state->frame[state->curframe +1 ] =NULL ; +return err; } int map_set_for_each_callback_args(struct bpf_verifier_env *env,
@@ -6880,8 +6885,7 @@ static int prepare_func_exit(struct bpf_verifier_env *env, int *insn_idx)return -EINVAL ; } - state->curframe--; - caller = state->frame[state->curframe]; + caller = state->frame[state->curframe -1 ];if (callee->in_callback_fn) {/* enforce R0 return value range [0, 1]. */ struct tnum range =tnum_range (0 ,1 );
@@ -6920,7 +6924,7 @@ static int prepare_func_exit(struct bpf_verifier_env *env, int *insn_idx) }/* clear everything in the callee */ free_func_state (callee); - state->frame[state->curframe +1 ] =NULL ; + state->frame[state->curframe--] =NULL ;return 0 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 118/314 io_uring: calculate CQEs from the user visible value
In reply to Greg Kroah-HartmanFrom: Dylan Yudaken <[email protected]>
[ Upstream commit 0fc8c2acbfc789a977a50a4a9812a8e4b37958ce ]
io_cqring_wait (and it's wake function io_has_work) used cached_cq_tail in order to calculate the number of CQEs. cached_cq_tail is set strictly before the user visible rings->cq.tail
However as far as userspace is concerned, if io_uring_enter(2) is called with a minimum number of events, they will verify by checking rings->cq.tail.
It is therefore possible for io_uring_enter(2) to return early with fewer events visible to the user.
Instead make the wait functions read from the user visible value, so there will be no discrepency.
This is triggered eventually by the following reproducer:
struct io_uring_sqe *sqe;
struct io_uring_cqe *cqe;
unsigned int cqe_ready;
struct io_uring ring;
int ret, i;
ret = io_uring_queue_init(N, &ring, 0);
assert(!ret);
while(true) {
for (i = 0; i < N; i++) {
sqe = io_uring_get_sqe(&ring);
io_uring_prep_nop(sqe);
sqe->flags |= IOSQE_ASYNC;
}
ret = io_uring_submit(&ring);
assert(ret == N);
do {
ret = io_uring_wait_cqes(&ring, &cqe, N, NULL, NULL);
} while(ret == -EINTR);
cqe_ready = io_uring_cq_ready(&ring);
assert(!ret);
assert(cqe_ready == N);
io_uring_cq_advance(&ring, N);
}--- io_uring/io_uring.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
io_uring/io_uring.c +8 -2
@@ -171,6 +171,11 @@ static inline unsigned int __io_cqring_events(struct io_ring_ctx *ctx)return ctx->cached_cq_tail -READ_ONCE (ctx->rings->cq.head); } +static inline unsigned int __io_cqring_events_user (struct io_ring_ctx *ctx) +{ +return READ_ONCE (ctx->rings->cq.tail) -READ_ONCE (ctx->rings->cq.head); +} +static bool io_match_linked (struct io_kiocb *head) {struct io_kiocb *req;
@@ -2163,7 +2168,7 @@ struct io_wait_queue {static inline bool io_should_wake (struct io_wait_queue *iowq) {struct io_ring_ctx *ctx = iowq->ctx; -int dist = ctx->cached_cq_tail - (int ) iowq->cq_tail; +int dist =READ_ONCE (ctx->rings->cq.tail) - (int ) iowq->cq_tail;/* * Wake up if we have enough events, or if a timeout occurred since we
@@ -2240,7 +2245,8 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, do { io_cqring_overflow_flush(ctx); - if (io_cqring_events(ctx) >= min_events) + /* if user messes with these they will just get an early return */ + if (__io_cqring_events_user(ctx) >= min_events) return 0; if (!io_run_task_work()) break;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 119/314 pinctrl: mediatek: common-v2: Fix bias-disable for PULL_PU_PD_RSEL_TYPE
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit fed74d75277da865da9ba334d3f5d5e3e327971d ]
In pinctrl-paris we're calling the .bias_set_combo() callback when we are asked to set the pin bias to either pull up/down or pull disable.
On newer platforms, this callback is mtk_pinconf_bias_set_combo(), located in pinctrl-mtk-common-v2.c: this will check the "pull type" assigned to the requested pin and in case said pin's pull type is MTK_PULL_PU_PD_RSEL_TYPE, this function will set RSEL first, PUPD last, which is fine.
The issue comes when we're requesting PIN_CONFIG_BIAS_DISABLE, as this does *not* require setting RSEL but only PU_PD: in this case, the arg is MTK_DISABLE (zero), which is not a supported RSEL, due to which function mtk_pinconf_bias_set_rsel() returns a failure; because of that, mtk_pinconf_bias_set_pu_pd() is never called, hence the pin bias is never set to DISABLE.
To fix this issue, add a check to mtk_pinconf_bias_set_rsel(): if we are entering that function with no pullup requested and at the same time the arg is MTK_DISABLE, this means that we're trying to disable pin bias, hence it's safe to return cleanly without ever setting any RSEL register.
This makes mtk_pinconf_bias_set_combo() happy, going on with setting the PU_PD registers, which is the only action to actually take to disable bias on a pin/pingroup.
--- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +3 -0
@@ -709,6 +709,9 @@ static int mtk_pinconf_bias_set_rsel(struct mtk_pinctrl *hw, {int err, rsel_val; +if (!pullup && arg ==MTK_DISABLE ) +return 0 ; +if (hw->rsel_si_unit) {/* find pin rsel_index from pin_rsel array*/ err =mtk_hw_pin_rsel_lookup (hw, desc, pullup, arg, &rsel_val);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 120/314 arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro
In reply to Greg Kroah-HartmanFrom: D Scott Phillips <[email protected]>
[ Upstream commit 8ec8490a1950efeccb00967698cf7cb2fcd25ca7 ]
CONFIG_UBSAN_SHIFT with gcc-5 complains that the shifting of ARM_CPU_IMP_AMPERE (0xC0) into bits [31:24] by MIDR_CPU_MODEL() is undefined behavior. Well, sort of, it actually spells the error as:
arch/arm64/kernel/proton-pack.c: In function 'spectre_bhb_loop_affected':
arch/arm64/include/asm/cputype.h:44:2: error: initializer element is not constant
(((imp) << MIDR_IMPLEMENTOR_SHIFT) | \
^
This isn't an issue for other Implementor codes, as all the other codes have zero in the top bit and so are representable as a signed int.
Cast the implementor code to unsigned in MIDR_CPU_MODEL to remove the undefined behavior.
--- arch/arm64/include/asm/cputype.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/cputype.h +1 -1
@@ -41,7 +41,7 @@ (((midr) & MIDR_IMPLEMENTOR_MASK) >> MIDR_IMPLEMENTOR_SHIFT)#define MIDR_CPU_MODEL (imp, partnum) \ - (((imp) << MIDR_IMPLEMENTOR_SHIFT) | \ + ((_AT(u32, imp) << MIDR_IMPLEMENTOR_SHIFT) | \ (0xf << MIDR_ARCHITECTURE_SHIFT) | \ ((partnum) << MIDR_PARTNUM_SHIFT))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 121/314 nvmet: fix a memory leak
In reply to Greg Kroah-HartmanFrom: Sagi Grimberg <[email protected]>
[ Upstream commit e65fdf530f55c5e387db14470a59a399faa29613 ]
We need to also free the dhchap_ctrl_secret when releasing nvmet_host. kmemleak complaint:
--
unreferenced object 0xffff99b1cbca5140 (size 64):
comm "check", pid 4864, jiffies 4305092436 (age 2913.583s) hex dump (first 32 bytes):
44 48 48 43 2d 31 3a 30 30 3a 65 36 2b 41 63 44 DHHC-1:00:e6+AcD
39 76 47 4d 52 57 59 78 67 54 47 44 51 59 47 78 9vGMRWYxgTGDQYGx
backtrace:
[<00000000c07d369d>] kstrdup+0x2e/0x60
[<000000001372171c>] 0xffffffffc0cceec6
[<0000000010dbf50b>] 0xffffffffc0cc6783
[<000000007465e93c>] configfs_write_iter+0xb1/0x120
[<0000000039c23f62>] vfs_write+0x2be/0x3c0
[<000000002da4351c>] ksys_write+0x5f/0xe0
[<00000000d5011e32>] do_syscall_64+0x38/0x90
[<00000000503870cf>] entry_SYSCALL_64_after_hwframe+0x63/0xcd--- drivers/nvme/target/configfs.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/target/configfs.c +1 -0
@@ -1811,6 +1811,7 @@ static void nvmet_host_release(struct config_item *item)#ifdef CONFIG_NVME_TARGET_AUTH kfree (host->dhchap_secret); +kfree (host->dhchap_ctrl_secret);#endif kfree (host); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 122/314 siox: fix possible memory leak in siox_device_add()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 6e63153db50059fb78b8a8447b132664887d24e3 ]
If device_register() returns error in siox_device_add(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(), and sdevice is freed in siox_device_release(), set it to null in error path.
--- drivers/siox/siox-core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/siox/siox-core.c +2 -0
@@ -839,6 +839,8 @@ static struct siox_device *siox_device_add(struct siox_master *smaster, err_device_register:/* don't care to make the buffer smaller again */ +put_device (&sdevice->dev); + sdevice =NULL ; err_buf_alloc:siox_master_unlock (smaster);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 123/314 parport_pc: Avoid FIFO port location truncation
In reply to Greg Kroah-HartmanFrom: Maciej W. Rozycki <[email protected]>
[ Upstream commit ab126f51c93a15093df604f661c9480854c005a3 ]
Match the data type of a temporary holding a reference to the FIFO port with the type of the original reference coming from `struct parport', avoiding data truncation with LP64 ports such as SPARC64 that refer to PCI port I/O locations via their corresponding MMIO addresses and will therefore have non-zero bits in the high 32-bit part of the reference. And in any case it is cleaner to have the data types matching here.
--- drivers/parport/parport_pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parport/parport_pc.c +1 -1
@@ -468,7 +468,7 @@ static size_t parport_pc_fifo_write_block_pio(struct parport *port,const unsigned char *bufp = buf;size_t left = length;unsigned long expire = jiffies + port->physport->cad->timeout; -const int fifo =FIFO (port); +const unsigned long fifo =FIFO (port);int poll_for =8 ;/* 80 usecs */ const struct parport_pc_private *priv = port->physport->private_data;const int fifo_depth = priv->fifo_depth;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 124/314 selftests/bpf: Fix casting error when cross-compiling test_verifier for 32-bit platforms
In reply to Greg Kroah-HartmanFrom: Pu Lehui <[email protected]>
[ Upstream commit 0811664da064c6d7ca64c02f5579f758a007e52d ]
When cross-compiling test_verifier for 32-bit platforms, the casting error is shown below:
test_verifier.c:1263:27: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
1263 | info.xlated_prog_insns = (__u64)*buf;
| ^
cc1: all warnings being treated as errors
Fix it by adding zero-extension for it.
--- tools/testing/selftests/bpf/test_verifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/test_verifier.c +1 -1
@@ -1260,7 +1260,7 @@ static int get_xlated_program(int fd_prog, struct bpf_insn **buf, int *cnt)bzero (&info,sizeof (info)); info.xlated_prog_len = xlated_prog_len; - info.xlated_prog_insns = (__u64)*buf; + info.xlated_prog_insns = (__u64 )(unsigned long )*buf;if (bpf_obj_get_info_by_fd (fd_prog, &info, &info_len)) {perror ("second bpf_obj_get_info_by_fd failed" ); goto out_free_buf;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 125/314 selftests/bpf: Fix test_progs compilation failure in 32-bit arch
In reply to Greg Kroah-HartmanFrom: Yang Jihong <[email protected]>
[ Upstream commit 5704bc7e8991164b14efb748b5afa0715c25fac3 ]
test_progs fails to be compiled in the 32-bit arch, log is as follows:
test_progs.c:1013:52: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
1013 | sprintf(buf, "MSG_TEST_LOG (cnt: %ld, last: %d)",
| ~~^
| |
| long int
| %d
1014 | strlen(msg->test_log.log_buf),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| size_t {aka unsigned int}Fix it.
--- tools/testing/selftests/bpf/test_progs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/test_progs.c +1 -1
@@ -993,7 +993,7 @@ static inline const char *str_msg(const struct msg *msg, char *buf) msg->subtest_done.have_log);break ;case MSG_TEST_LOG : -sprintf (buf,"MSG_TEST_LOG (cnt: %ld, last: %d)" , +sprintf (buf,"MSG_TEST_LOG (cnt: %zu, last: %d)" ,strlen (msg->test_log.log_buf), msg->test_log.is_last);break ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 126/314 pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map
In reply to Greg Kroah-HartmanFrom: Zeng Heng <[email protected]>
[ Upstream commit 91d5c5060ee24fe8da88cd585bb43b843d2f0dce ]
Here is the BUG report by KASAN about null pointer dereference:
BUG: KASAN: null-ptr-deref in strcmp+0x2e/0x50 Read of size 1 at addr 0000000000000000 by task python3/2640 Call Trace: strcmp __of_find_property of_find_property pinctrl_dt_to_map
kasprintf() would return NULL pointer when kmalloc() fail to allocate. So directly return ENOMEM, if kasprintf() return NULL pointer.
--- drivers/pinctrl/devicetree.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pinctrl/devicetree.c +2 -0
@@ -220,6 +220,8 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev)for (state =0 ; ; state++) {/* Retrieve the pinctrl-* property */ propname =kasprintf (GFP_KERNEL ,"pinctrl-%d" , state); +if (!propname) +return -ENOMEM ; prop =of_find_property (np, propname, &size);kfree (propname);if (!prop) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 127/314 drm/vc4: kms: Fix IS_ERR() vs NULL check for vc4_kms
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
[ Upstream commit dba9e3467425800f9d3a14e8b6a0f85c731c1650 ]
The drm_atomic_get_new_private_obj_state() function returns NULL on error path, drm_atomic_get_old_private_obj_state() function returns NULL on error path, too, they does not return error pointers.
By the way, vc4_hvs_get_new/old_global_state() should return ERR_PTR(-EINVAL), otherwise there will be null-ptr-defer issue, such as follows:
In function vc4_atomic_commit_tail():
|-- old_hvs_state = vc4_hvs_get_old_global_state(state); <-- return NULL |-- if (WARN_ON(IS_ERR(old_hvs_state))) <-- no return |-- unsigned long state_rate = max(old_hvs_state->core_clock_rate, new_hvs_state->core_clock_rate); <-- null-ptr-defer
--- drivers/gpu/drm/vc4/vc4_kms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/vc4/vc4_kms.c +4 -4
@@ -198,8 +198,8 @@ vc4_hvs_get_new_global_state(struct drm_atomic_state *state)struct drm_private_state *priv_state; priv_state =drm_atomic_get_new_private_obj_state (state, &vc4->hvs_channels); -if (IS_ERR (priv_state)) -return ERR_CAST (priv_state); +if (!priv_state) +return ERR_PTR (-EINVAL );return to_vc4_hvs_state (priv_state); }
@@ -211,8 +211,8 @@ vc4_hvs_get_old_global_state(struct drm_atomic_state *state)struct drm_private_state *priv_state; priv_state =drm_atomic_get_old_private_obj_state (state, &vc4->hvs_channels); -if (IS_ERR (priv_state)) -return ERR_CAST (priv_state); +if (!priv_state) +return ERR_PTR (-EINVAL );return to_vc4_hvs_state (priv_state); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 128/314 drm/panel: simple: set bpc field for logic technologies displays
In reply to Greg Kroah-HartmanFrom: Aishwarya Kothari <[email protected]>
[ Upstream commit 876153ab068b2507a19aa3ef481f5b00a2cc780f ]
In case bpc is not set for a panel it then throws a WARN(). Add bpc to the panels logictechno_lt170410_2whc and logictechno_lt161010_2nh.
--- drivers/gpu/drm/panel/panel-simple.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/panel/panel-simple.c +2 -0
@@ -2505,6 +2505,7 @@ static const struct display_timing logictechno_lt161010_2nh_timing = {static const struct panel_desc logictechno_lt161010_2nh = { .timings = &logictechno_lt161010_2nh_timing, .num_timings =1 , + .bpc =6 , .size = { .width =154 , .height =86 ,
@@ -2534,6 +2535,7 @@ static const struct display_timing logictechno_lt170410_2whc_timing = {static const struct panel_desc logictechno_lt170410_2whc = { .timings = &logictechno_lt170410_2whc_timing, .num_timings =1 , + .bpc =8 , .size = { .width =217 , .height =136 ,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 129/314 drm/drv: Fix potential memory leak in drm_dev_init()
In reply to Greg Kroah-HartmanFrom: Shang XiaoJing <[email protected]>
[ Upstream commit ff963634f7b2e0dc011349abb3fb81a0d074f443 ]
drm_dev_init() will add drm_dev_init_release() as a callback. When drmm_add_action() failed, the release function won't be added. As the result, the ref cnt added by device_get() in drm_dev_init() won't be put by drm_dev_init_release(), which leads to the memleak. Use drmm_add_action_or_reset() instead of drmm_add_action() to prevent memleak.
unreferenced object 0xffff88810bc0c800 (size 2048):
comm "modprobe", pid 8322, jiffies 4305809845 (age 15.292s) hex dump (first 32 bytes):
e8 cc c0 0b 81 88 ff ff ff ff ff ff 00 00 00 00 ................
20 24 3c 0c 81 88 ff ff 18 c8 c0 0b 81 88 ff ff $<.............
backtrace:
[<000000007251f72d>] __kmalloc+0x4b/0x1c0
[<0000000045f21f26>] platform_device_alloc+0x2d/0xe0
[<000000004452a479>] platform_device_register_full+0x24/0x1c0
[<0000000089f4ea61>] 0xffffffffa0736051
[<00000000235b2441>] do_one_initcall+0x7a/0x380
[<0000000001a4a177>] do_init_module+0x5c/0x230
[<000000002bf8a8e2>] load_module+0x227d/0x2420
[<00000000637d6d0a>] __do_sys_finit_module+0xd5/0x140
[<00000000c99fc324>] do_syscall_64+0x3f/0x90
[<000000004d85aa77>] entry_SYSCALL_64_after_hwframe+0x63/0xcd--- drivers/gpu/drm/drm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_drv.c +1 -1
@@ -615,7 +615,7 @@ static int drm_dev_init(struct drm_device *dev,mutex_init (&dev->clientlist_mutex);mutex_init (&dev->master_mutex); - ret =drmm_add_action (dev, drm_dev_init_release,NULL ); + ret =drmm_add_action_or_reset (dev, drm_dev_init_release,NULL );if (ret)return ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 130/314 drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker()
In reply to Greg Kroah-HartmanFrom: Shang XiaoJing <[email protected]>
[ Upstream commit 4979524f5a2a8210e87fde2f642b0dc060860821 ]
drm_vblank_init() call drmm_add_action_or_reset() with drm_vblank_init_release() as action. If __drmm_add_action() failed, will directly call drm_vblank_init_release() with the vblank whose worker is NULL. As the resule, a null-ptr-deref will happen in kthread_destroy_worker(). Add the NULL check before calling drm_vblank_destroy_worker().
BUG: null-ptr-deref
KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f]
CPU: 5 PID: 961 Comm: modprobe Not tainted 6.0.0-11331-gd465bff130bf-dirty
RIP: 0010:kthread_destroy_worker+0x25/0xb0
Call Trace:
<TASK>
drm_vblank_init_release+0x124/0x220 [drm]
? drm_crtc_vblank_restore+0x8b0/0x8b0 [drm]
__drmm_add_action_or_reset+0x41/0x50 [drm]
drm_vblank_init+0x282/0x310 [drm]
vkms_init+0x35f/0x1000 [vkms]
? 0xffffffffc4508000
? lock_is_held_type+0xd7/0x130
? __kmem_cache_alloc_node+0x1c2/0x2b0
? lock_is_held_type+0xd7/0x130
? 0xffffffffc4508000
do_one_initcall+0xd0/0x4f0
...
do_syscall_64+0x35/0x80
entry_SYSCALL_64_after_hwframe+0x46/0xb0--- drivers/gpu/drm/drm_internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_internal.h +2 -1
@@ -104,7 +104,8 @@ static inline void drm_vblank_flush_worker(struct drm_vblank_crtc *vblank)static inline void drm_vblank_destroy_worker (struct drm_vblank_crtc *vblank) { -kthread_destroy_worker (vblank->worker); +if (vblank->worker) +kthread_destroy_worker (vblank->worker); }int drm_vblank_worker_init (struct drm_vblank_crtc *vblank);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 131/314 arm64: dts: imx8mm-tqma8mqml-mba8mx: Fix USB DR
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit 63fd9437ec81899fc36bb642d558378bc89aa4f9 ]
Using extcon USB host mode works properly on DR interface, e.g. enabling/disabling VBUS. But USB device mode is not working. Fix this by switching to usb-role-switch instead.
--- .../dts/freescale/imx8mm-tqma8mqml-mba8mx.dts | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx.dts +26 -6
@@ -34,11 +34,25 @@ reg_usdhc2_vmmc: regulator-vmmc { off-on-delay-us = <12000>; }; - extcon_usbotg1: extcon-usbotg1 { - compatible = "linux,extcon-usb-gpio"; + connector { + compatible = "gpio-usb-b-connector", "usb-b-connector"; + type = "micro"; + label = "X19"; pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_usb1_extcon>; - id-gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&pinctrl_usb1_connector>; + id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + usb_dr_connector: endpoint { + remote-endpoint = <&usb1_drd_sw>; + }; + }; + }; }; };
@@ -105,13 +119,19 @@ &usbotg1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usbotg1>; dr_mode = "otg"; - extcon = <&extcon_usbotg1>; srp-disable; hnp-disable; adp-disable; power-active-high; over-current-active-low; + usb-role-switch; status = "okay"; + + port { + usb1_drd_sw: endpoint { + remote-endpoint = <&usb_dr_connector>; + }; + }; }; &usbotg2 {
@@ -231,7 +251,7 @@ pinctrl_usbotg1: usbotg1grp { <MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x84>; }; - pinctrl_usb1_extcon: usb1-extcongrp { + pinctrl_usb1_connector: usb1-connectorgrp { fsl,pins = <MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x1c0>; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 132/314 ARM: dts: imx7: Fix NAND controller size-cells
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 753395ea1e45c724150070b5785900b6a44bd5fb ]
The NAND controller size-cells should be 0 per DT bindings.
Fix the following warning produces by DT bindings check:
"
nand-controller@33002000: #size-cells:0:0: 0 was expected
nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected) "
Fix the missing space in node name too.
--- arch/arm/boot/dts/imx7s.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx7s.dtsi +2 -2
@@ -1270,10 +1270,10 @@ dma_apbh: dma-apbh@33000000 { clocks = <&clks IMX7D_NAND_USDHC_BUS_RAWNAND_CLK>; }; - gpmi: nand-controller@33002000{ + gpmi: nand-controller@33002000 { compatible = "fsl,imx7d-gpmi-nand"; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; reg = <0x33002000 0x2000>, <0x33004000 0x4000>; reg-names = "gpmi-nand", "bch"; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 133/314 arm64: dts: imx8mm: Fix NAND controller size-cells
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 1610233bc2c2cae2dff9e101e6ea5ef69cceb0e9 ]
The NAND controller size-cells should be 0 per DT bindings.
Fix the following warning produces by DT bindings check:
"
nand-controller@33002000: #size-cells:0:0: 0 was expected
nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected) "
Fix the missing space in node name too.
--- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2 -2
@@ -1244,10 +1244,10 @@ dma_apbh: dma-controller@33000000 { clocks = <&clk IMX8MM_CLK_NAND_USDHC_BUS_RAWNAND_CLK>; }; - gpmi: nand-controller@33002000{ + gpmi: nand-controller@33002000 { compatible = "fsl,imx8mm-gpmi-nand", "fsl,imx7d-gpmi-nand"; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; reg = <0x33002000 0x2000>, <0x33004000 0x4000>; reg-names = "gpmi-nand", "bch"; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 134/314 erofs: put metabuf in error path in fscache mode
In reply to Greg Kroah-HartmanFrom: Jingbo Xu <[email protected]>
[ Upstream commit 75e43355cbe4d5948a79bd592f2ffecb9f75f75d ]
For tail packing layout, put metabuf when error is encountered.
--- fs/erofs/fscache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/erofs/fscache.c +3 -1
@@ -281,8 +281,10 @@ static int erofs_fscache_data_read(struct address_space *mapping,return PTR_ERR (src);iov_iter_xarray (&iter,READ , &mapping->i_pages, pos,PAGE_SIZE ); -if (copy_to_iter (src + offset, size, &iter) != size) +if (copy_to_iter (src + offset, size, &iter) != size) { +erofs_put_metabuf (&buf);return -EFAULT ; + }iov_iter_zero (PAGE_SIZE - size, &iter);erofs_put_metabuf (&buf);return PAGE_SIZE ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 135/314 arm64: dts: imx8mn: Fix NAND controller size-cells
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 5468e93b5b1083eaa729f98e59da18c85d9c4126 ]
The NAND controller size-cells should be 0 per DT bindings.
Fix the following warning produces by DT bindings check:
"
nand-controller@33002000: #size-cells:0:0: 0 was expected
nand-controller@33002000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected) "
--- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mn.dtsi +1 -1
@@ -1102,7 +1102,7 @@ dma_apbh: dma-controller@33000000 { gpmi: nand-controller@33002000 { compatible = "fsl,imx8mn-gpmi-nand", "fsl,imx7d-gpmi-nand"; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; reg = <0x33002000 0x2000>, <0x33004000 0x4000>; reg-names = "gpmi-nand", "bch"; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 136/314 arm64: dts: imx93-pinfunc: drop execution permission
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
[ Upstream commit 2db1fdb25d209a88112fd82eb493976d66057d10 ]
Drop the header file execution permission
--- arch/arm64/boot/dts/freescale/imx93-pinfunc.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 arch/arm64/boot/dts/freescale/imx93-pinfunc.h
arch/arm64/boot/dts/freescale/imx93-pinfunc.h +0 -0
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 137/314 ata: libata-transport: fix double ata_host_put() in ata_tport_add()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 8c76310740807ade5ecdab5888f70ecb6d35732e ]
In the error path in ata_tport_add(), when calling put_device(), ata_tport_release() is called, it will put the refcount of 'ap->host'.
And then ata_host_put() is called again, the refcount is decreased to 0, ata_host_release() is called, all ports are freed and set to null.
When unbinding the device after failure, ata_host_stop() is called to release the resources, it leads a null-ptr-deref(), because all the ports all freed and null.
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 CPU: 7 PID: 18671 Comm: modprobe Kdump: loaded Tainted: G E 6.1.0-rc3+ #8 pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : ata_host_stop+0x3c/0x84 [libata] lr : release_nodes+0x64/0xd0 Call trace: ata_host_stop+0x3c/0x84 [libata] release_nodes+0x64/0xd0 devres_release_all+0xbc/0x1b0 device_unbind_cleanup+0x20/0x70 really_probe+0x158/0x320 __driver_probe_device+0x84/0x120 driver_probe_device+0x44/0x120 __driver_attach+0xb4/0x220 bus_for_each_dev+0x78/0xdc driver_attach+0x2c/0x40 bus_add_driver+0x184/0x240 driver_register+0x80/0x13c __pci_register_driver+0x4c/0x60 ahci_pci_driver_init+0x30/0x1000 [ahci]
Fix this by removing redundant ata_host_put() in the error path.
--- drivers/ata/libata-transport.c | 1 - 1 file changed, 1 deletion(-)
drivers/ata/libata-transport.c +0 -1
@@ -317,7 +317,6 @@ int ata_tport_add(struct device *parent, tport_err:transport_destroy_device (dev);put_device (dev); -ata_host_put (ap->host);return error; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 138/314 ata: libata-transport: fix error handling in ata_tport_add()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 3613dbe3909dcc637fe6be00e4dc43b4aa0470ee ]
In ata_tport_add(), the return value of transport_add_device() is not checked. As a result, it causes null-ptr-deref while removing the module, because transport_remove_device() is called to remove the device that was not added.
Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 CPU: 12 PID: 13605 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #8 pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : device_del+0x48/0x39c lr : device_del+0x44/0x39c Call trace: device_del+0x48/0x39c attribute_container_class_device_del+0x28/0x40 transport_remove_classdev+0x60/0x7c attribute_container_device_trigger+0x118/0x120 transport_remove_device+0x20/0x30 ata_tport_delete+0x34/0x60 [libata] ata_port_detach+0x148/0x1b0 [libata] ata_pci_remove_one+0x50/0x80 [libata] ahci_remove_one+0x4c/0x8c [ahci]
Fix this by checking and handling return value of transport_add_device() in ata_tport_add().
--- drivers/ata/libata-transport.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/ata/libata-transport.c +4 -1
@@ -301,7 +301,9 @@ int ata_tport_add(struct device *parent,pm_runtime_enable (dev);pm_runtime_forbid (dev); -transport_add_device (dev); + error =transport_add_device (dev); +if (error) + goto tport_transport_add_err;transport_configure_device (dev); error =ata_tlink_add (&ap->link);
@@ -312,6 +314,7 @@ int ata_tport_add(struct device *parent, tport_link_err:transport_remove_device (dev); + tport_transport_add_err:device_del (dev); tport_err:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 139/314 ata: libata-transport: fix error handling in ata_tlink_add()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit cf0816f6322c5c37ee52655f928e91ecf32da103 ]
In ata_tlink_add(), the return value of transport_add_device() is not checked. As a result, it causes null-ptr-deref while removing the module, because transport_remove_device() is called to remove the device that was not added.
Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 CPU: 33 PID: 13850 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #12 pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : device_del+0x48/0x39c lr : device_del+0x44/0x39c Call trace: device_del+0x48/0x39c attribute_container_class_device_del+0x28/0x40 transport_remove_classdev+0x60/0x7c attribute_container_device_trigger+0x118/0x120 transport_remove_device+0x20/0x30 ata_tlink_delete+0x88/0xb0 [libata] ata_tport_delete+0x2c/0x60 [libata] ata_port_detach+0x148/0x1b0 [libata] ata_pci_remove_one+0x50/0x80 [libata] ahci_remove_one+0x4c/0x8c [ahci]
Fix this by checking and handling return value of transport_add_device() in ata_tlink_add().
--- drivers/ata/libata-transport.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/ata/libata-transport.c +4 -1
@@ -458,7 +458,9 @@ int ata_tlink_add(struct ata_link *link) goto tlink_err; } -transport_add_device (dev); + error =transport_add_device (dev); +if (error) + goto tlink_transport_err;transport_configure_device (dev);ata_for_each_dev (ata_dev, link,ALL ) {
@@ -473,6 +475,7 @@ int ata_tlink_add(struct ata_link *link)ata_tdev_delete (ata_dev); }transport_remove_device (dev); + tlink_transport_err:device_del (dev); tlink_err:transport_destroy_device (dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 140/314 ata: libata-transport: fix error handling in ata_tdev_add()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 1ff36351309e3eadcff297480baf4785e726de9b ]
In ata_tdev_add(), the return value of transport_add_device() is not checked. As a result, it causes null-ptr-deref while removing the module, because transport_remove_device() is called to remove the device that was not added.
Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 CPU: 13 PID: 13603 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #36 pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : device_del+0x48/0x3a0 lr : device_del+0x44/0x3a0 Call trace: device_del+0x48/0x3a0 attribute_container_class_device_del+0x28/0x40 transport_remove_classdev+0x60/0x7c attribute_container_device_trigger+0x118/0x120 transport_remove_device+0x20/0x30 ata_tdev_delete+0x24/0x50 [libata] ata_tlink_delete+0x40/0xa0 [libata] ata_tport_delete+0x2c/0x60 [libata] ata_port_detach+0x148/0x1b0 [libata] ata_pci_remove_one+0x50/0x80 [libata] ahci_remove_one+0x4c/0x8c [ahci]
Fix this by checking and handling return value of transport_add_device() in ata_tdev_add(). In the error path, device_del() is called to delete the device which was added earlier in this function, and ata_tdev_free() is called to free ata_dev.
--- drivers/ata/libata-transport.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ata/libata-transport.c +7 -1
@@ -713,7 +713,13 @@ static int ata_tdev_add(struct ata_device *ata_dev)return error; } -transport_add_device (dev); + error =transport_add_device (dev); +if (error) { +device_del (dev); +ata_tdev_free (ata_dev); +return error; + } +transport_configure_device (dev);return 0 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 141/314 nfp: change eeprom length to max length enumerators
In reply to Greg Kroah-HartmanFrom: Jaco Coetzee <[email protected]>
[ Upstream commit f3a72878a3de720661b7ed0d6b7f7c506ddb8a52 ]
Extend the size of QSFP EEPROM for types SSF8436 and SFF8636 from 256 to 640 bytes in order to expose all the EEPROM pages by ethtool.
For SFF-8636 and SFF-8436 specifications, the driver exposes 256 bytes of EEPROM data for ethtool's get_module_eeprom() callback, resulting in "netlink error: Invalid argument" when an EEPROM read with an offset larger than 256 bytes is attempted.
Changing the length enumerators to the _MAX_LEN variants exposes all 640 bytes of the EEPROM allowing upper pages 1, 2 and 3 to be read.
--- drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +3 -3
@@ -1440,15 +1440,15 @@ nfp_port_get_module_info(struct net_device *netdev,if (data <0x3 ) { modinfo->type =ETH_MODULE_SFF_8436 ; - modinfo->eeprom_len =ETH_MODULE_SFF_8436_LEN ; + modinfo->eeprom_len =ETH_MODULE_SFF_8436_MAX_LEN ; }else { modinfo->type =ETH_MODULE_SFF_8636 ; - modinfo->eeprom_len =ETH_MODULE_SFF_8636_LEN ; + modinfo->eeprom_len =ETH_MODULE_SFF_8636_MAX_LEN ; }break ;case NFP_INTERFACE_QSFP28 : modinfo->type =ETH_MODULE_SFF_8636 ; - modinfo->eeprom_len =ETH_MODULE_SFF_8636_LEN ; + modinfo->eeprom_len =ETH_MODULE_SFF_8636_MAX_LEN ;break ;default : netdev_err(netdev, "Unsupported module 0x%x detected\n",
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 142/314 MIPS: fix duplicate definitions for exported symbols
In reply to Greg Kroah-HartmanFrom: Rongwei Zhang <[email protected]>
[ Upstream commit 612d80784fdc0c2e2ee2e2d901a55ef2f72ebf4b ]
Building with clang-14 fails with:
AS arch/mips/kernel/relocate_kernel.o
<unknown>:0: error: symbol 'kexec_args' is already defined <unknown>:0: error: symbol 'secondary_kexec_args' is already defined <unknown>:0: error: symbol 'kexec_start_address' is already defined <unknown>:0: error: symbol 'kexec_indirection_page' is already defined <unknown>:0: error: symbol 'relocate_new_kernel_size' is already defined
It turns out EXPORT defined in asm/asm.h expands to a symbol definition, so there is no need to define these symbols again. Remove duplicated symbol definitions.
--- arch/mips/kernel/relocate_kernel.S | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
arch/mips/kernel/relocate_kernel.S +5 -10
@@ -145,8 +145,7 @@ LEAF(kexec_smp_wait) * kexec_args[0..3] are used to prepare register values. */ -kexec_args: - EXPORT(kexec_args) +EXPORT(kexec_args) arg0: PTR_WD 0x0 arg1: PTR_WD 0x0 arg2: PTR_WD 0x0
@@ -159,8 +158,7 @@ arg3: PTR_WD 0x0 * their registers a0-a3. secondary_kexec_args[0..3] are used * to prepare register values. */ -secondary_kexec_args: - EXPORT(secondary_kexec_args) +EXPORT(secondary_kexec_args) s_arg0: PTR_WD 0x0 s_arg1: PTR_WD 0x0 s_arg2: PTR_WD 0x0
@@ -171,19 +169,16 @@ kexec_flag: #endif -kexec_start_address: - EXPORT(kexec_start_address) +EXPORT(kexec_start_address) PTR_WD 0x0 .size kexec_start_address, PTRSIZE -kexec_indirection_page: - EXPORT(kexec_indirection_page) +EXPORT(kexec_indirection_page) PTR_WD 0 .size kexec_indirection_page, PTRSIZE relocate_new_kernel_end: -relocate_new_kernel_size: - EXPORT(relocate_new_kernel_size) +EXPORT(relocate_new_kernel_size) PTR_WD relocate_new_kernel_end - relocate_new_kernel .size relocate_new_kernel_size, PTRSIZE
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 143/314 MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed
In reply to Greg Kroah-HartmanFrom: Liao Chang <[email protected]>
[ Upstream commit fa706927f4722a2df723b2a28d139b1904a3e7fa ]
Add WARN_ON on kexec related kmalloc failed, avoid to pass NULL pointer to following memcpy and loongson_kexec_prepare.
--- arch/mips/loongson64/reset.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/mips/loongson64/reset.c +10 -0
@@ -16,6 +16,7 @@#include <asm/bootinfo.h> #include <asm/idle.h> #include <asm/reboot.h> +#include <asm/bug.h> #include <loongson.h> #include <boot_param.h>
@@ -159,8 +160,17 @@ static int __init mips_reboot_setup(void)#ifdef CONFIG_KEXEC kexec_argv =kmalloc (KEXEC_ARGV_SIZE ,GFP_KERNEL ); +if (WARN_ON (!kexec_argv)) +return -ENOMEM ; + kdump_argv =kmalloc (KEXEC_ARGV_SIZE ,GFP_KERNEL ); +if (WARN_ON (!kdump_argv)) +return -ENOMEM ; + kexec_envp =kmalloc (KEXEC_ENVP_SIZE ,GFP_KERNEL ); +if (WARN_ON (!kexec_envp)) +return -ENOMEM ; + fw_arg1 =KEXEC_ARGV_ADDR ;memcpy (kexec_envp, (void *)fw_arg2,KEXEC_ENVP_SIZE );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 144/314 io_uring/poll: fix double poll req->flags races
In reply to Greg Kroah-HartmanFrom: Pavel Begunkov <[email protected]>
[ Upstream commit 30a33669fa21cd3dc7d92a00ba736358059014b7 ]
io_poll_double_prepare() | io_poll_wake()
| poll->head = NULL
smp_load(&poll->head); /* NULL */ |
flags = req->flags; |
| req->flags &= ~SINGLE_POLL;
req->flags = flags | DOUBLE_POLL |The idea behind io_poll_double_prepare() is to serialise with the first poll entry by taking the wq lock. However, it's not safe to assume that io_poll_wake() is not running when we can't grab the lock and so we may race modifying req->flags.
Skip double poll setup if that happens. It's ok because the first poll entry will only be removed when it's definitely completing, e.g. pollfree or oneshot with a valid mask.
--- io_uring/poll.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-)
io_uring/poll.c +17 -12
@@ -394,7 +394,8 @@ static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,return 1 ; } -static void io_poll_double_prepare (struct io_kiocb *req) +/* fails only when polling is already completing by the first entry */ +static bool io_poll_double_prepare (struct io_kiocb *req) {struct wait_queue_head *head;struct io_poll *poll =io_poll_get_single (req);
@@ -403,20 +404,20 @@ static void io_poll_double_prepare(struct io_kiocb *req)rcu_read_lock (); head =smp_load_acquire (&poll->head);/* -* poll arm may not hold ownership and so race with -* io_poll_wake() by modifying req->flags. There is only one -* poll entry queued, serialise with it by taking its head lock. +* poll arm might not hold ownership and so race for req->flags with +* io_poll_wake(). There is only one poll entry queued, serialise with +* it by taking its head lock. As we're still arming the tw hanlder +* is not going to be run, so there are no races with it. */ -if (head) +if (head) {spin_lock_irq (&head->lock); - - req->flags |=REQ_F_DOUBLE_POLL ; -if (req->opcode ==IORING_OP_POLL_ADD ) - req->flags |=REQ_F_ASYNC_DATA ; - -if (head) + req->flags |=REQ_F_DOUBLE_POLL ; +if (req->opcode ==IORING_OP_POLL_ADD ) + req->flags |=REQ_F_ASYNC_DATA ;spin_unlock_irq (&head->lock); + }rcu_read_unlock (); +return !!head; } static void __io_queue_proc(struct io_poll *poll, struct io_poll_table *pt,
@@ -454,7 +455,11 @@ static void __io_queue_proc(struct io_poll *poll, struct io_poll_table *pt,/* mark as double wq entry */ wqe_private |=IO_WQE_F_DOUBLE ;io_init_poll_iocb (poll, first->events, first->wait.func); -io_poll_double_prepare (req); +if (!io_poll_double_prepare (req)) { +/* the request is completing, just back off */ +kfree (poll); +return ; + } *poll_ptr = poll; }else {/* fine to modify, there is no poll queued to race with us */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 145/314 cifs: Fix connections leak when tlink setup failed
In reply to Greg Kroah-HartmanFrom: Zhang Xiaoxu <[email protected]>
[ Upstream commit 1dcdf5f5b2137185cbdd5385f29949ab3da4f00c ]
If the tlink setup failed, lost to put the connections, then the module refcnt leak since the cifsd kthread not exit.
Also leak the fscache info, and for next mount with fsc, it will print the follow errors:
CIFS: Cache volume key already in use (cifs,127.0.0.1:445,TEST)
Let's check the result of tlink setup, and do some cleanup.
--- fs/cifs/connect.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
fs/cifs/connect.c +11 -3
@@ -3846,9 +3846,13 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)uuid_copy (&cifs_sb->dfs_mount_id, &mnt_ctx.mount_id); out: -free_xid (mnt_ctx.xid);cifs_try_adding_channels (cifs_sb, mnt_ctx.ses); -return mount_setup_tlink (cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); + rc =mount_setup_tlink (cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); +if (rc) + goto error; + +free_xid (mnt_ctx.xid); +return rc; error:dfs_cache_put_refsrv_sessions (&mnt_ctx.mount_id);
@@ -3875,8 +3879,12 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx) goto error; } + rc =mount_setup_tlink (cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); +if (rc) + goto error; +free_xid (mnt_ctx.xid); -return mount_setup_tlink (cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); +return rc; error:mount_put_conns (&mnt_ctx);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 146/314 bpf: Initialize same number of free nodes for each pcpu_freelist
In reply to Greg Kroah-HartmanFrom: Xu Kuohai <[email protected]>
[ Upstream commit 4b45cd81f737d79d0fbfc0d320a1e518e7f0bbf0 ]
pcpu_freelist_populate() initializes nr_elems / num_possible_cpus() + 1 free nodes for some CPUs, and then possibly one CPU with fewer nodes, followed by remaining cpus with 0 nodes. For example, when nr_elems == 256 and num_possible_cpus() == 32, CPU 0~27 each gets 9 free nodes, CPU 28 gets 4 free nodes, CPU 29~31 get 0 free nodes, while in fact each CPU should get 8 nodes equally.
This patch initializes nr_elems / num_possible_cpus() free nodes for each CPU firstly, then allocates the remaining free nodes by one for each CPU until no free nodes left.
--- kernel/bpf/percpu_freelist.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
kernel/bpf/percpu_freelist.c +11 -12
@@ -102,22 +102,21 @@ void pcpu_freelist_populate(struct pcpu_freelist *s, void *buf, u32 elem_size, u32 nr_elems) {struct pcpu_freelist_head *head; -int i, cpu, pcpu_entries; +unsigned int cpu, cpu_idx, i, j, n, m; - pcpu_entries = nr_elems /num_possible_cpus () +1 ; - i =0 ; + n = nr_elems /num_possible_cpus (); + m = nr_elems %num_possible_cpus (); + cpu_idx =0 ;for_each_possible_cpu (cpu) { -again: head =per_cpu_ptr (s->freelist, cpu); -/* No locking required as this is not visible yet. */ -pcpu_freelist_push_node (head, buf); - i++; - buf += elem_size; -if (i == nr_elems) -break ; -if (i % pcpu_entries) - goto again; + j = n + (cpu_idx < m ?1 :0 ); +for (i =0 ; i < j; i++) { +/* No locking required as this is not visible yet. */ +pcpu_freelist_push_node (head, buf); + buf += elem_size; + } + cpu_idx++; } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 147/314 ata: libata-core: do not issue non-internal commands once EH is pending
In reply to Greg Kroah-HartmanFrom: Niklas Cassel <[email protected]>
[ Upstream commit e20e81a24a4d58744a29715aac2f795cd1651955 ]
While the ATA specification states that a device should return command aborted for all commands queued after the device has entered error state, since ATA only keeps the sense data for the latest command (in non-NCQ case), we really don't want to send block layer commands to the device after it has entered error state. (Only ATA EH commands should be sent, to read the sense data etc.)
Currently, scsi_queue_rq() will check if scsi_host_in_recovery() (state is SHOST_RECOVERY), and if so, it will _not_ issue a command via:scsi_dispatch_cmd() -> host->hostt->queuecommand() (ata_scsi_queuecmd()) -> __ata_scsi_queuecmd() -> ata_scsi_translate() -> ata_qc_issue()
Before commit e494f6a72839 ("[SCSI] improved eh timeout handler"), when receiving a TFES error IRQ, the call chain looked like this:ahci_error_intr() -> ata_port_abort() -> ata_do_link_abort() -> ata_qc_complete() -> ata_qc_schedule_eh() -> blk_abort_request() -> blk_rq_timed_out() -> q->rq_timed_out_fn() (scsi_times_out()) -> scsi_eh_scmd_add() -> scsi_host_set_state(shost, SHOST_RECOVERY)
Which meant that as soon as an error IRQ was serviced, SHOST_RECOVERY would be set.
However, after commit e494f6a72839 ("[SCSI] improved eh timeout handler"), scsi_times_out() will instead call scsi_abort_command() which will queue delayed work, and the worker function scmd_eh_abort_handler() will call scsi_eh_scmd_add(), which calls scsi_host_set_state(shost, SHOST_RECOVERY).
So now, after the TFES error IRQ has been serviced, we need to wait for the SCSI workqueue to run its work before SHOST_RECOVERY gets set.
It is worth noting that, even before commit e494f6a72839 ("[SCSI] improved eh timeout handler"), we could receive an error IRQ from the time when scsi_queue_rq() checks scsi_host_in_recovery(), to the time when ata_scsi_queuecmd() is actually called.
In order to handle both the delayed setting of SHOST_RECOVERY and the window where we can receive an error IRQ, add a check against ATA_PFLAG_EH_PENDING (which gets set when servicing the error IRQ), inside ata_scsi_queuecmd() itself, while holding the ap->lock. (Since the ap->lock is held while servicing IRQs.)
--- drivers/ata/libata-scsi.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/ata/libata-scsi.c +10 -0
@@ -3966,9 +3966,19 @@ static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)int __ata_scsi_queuecmd (struct scsi_cmnd *scmd,struct ata_device *dev) { +struct ata_port *ap = dev->link->ap;u8 scsi_op = scmd->cmnd[0 ];ata_xlat_func_t xlat_func; +/* +* scsi_queue_rq() will defer commands if scsi_host_in_recovery(). +* However, this check is done without holding the ap->lock (a libata +* specific lock), so we can have received an error irq since then, +* therefore we must check if EH is pending, while holding ap->lock. +*/ +if (ap->pflags & (ATA_PFLAG_EH_PENDING |ATA_PFLAG_EH_IN_PROGRESS )) +return SCSI_MLQUEUE_DEVICE_BUSY ; +if (unlikely (!scmd->cmd_len)) goto bad_cdb_len;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 148/314 net: bgmac: Drop free_netdev() from bgmac_enet_remove()
In reply to Greg Kroah-HartmanFrom: Wei Yongjun <[email protected]>
[ Upstream commit 6f928ab8ee9bfbcb0e631c47ea8a16c3d5116ff1 ]
netdev is allocated in bgmac_alloc() with devm_alloc_etherdev() and will be auto released in ->remove and ->probe failure path. Using free_netdev() in bgmac_enet_remove() leads to double free.
--- drivers/net/ethernet/broadcom/bgmac.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/broadcom/bgmac.c +0 -1
@@ -1568,7 +1568,6 @@ void bgmac_enet_remove(struct bgmac *bgmac)phy_disconnect (bgmac->net_dev->phydev);netif_napi_del (&bgmac->napi);bgmac_dma_free (bgmac); -free_netdev (bgmac->net_dev); }EXPORT_SYMBOL_GPL (bgmac_enet_remove);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 149/314 mISDN: fix possible memory leak in mISDN_dsp_element_register()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 98a2ac1ca8fd6eca6867726fe238d06e75eb1acd ]
Afer commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically, use put_device() to give up the reference, so that the name can be freed in kobject_cleanup() when the refcount is 0.
The 'entry' is going to be freed in mISDN_dsp_dev_release(), so the kfree() is removed. list_del() is called in mISDN_dsp_dev_release(), so it need be initialized.
--- drivers/isdn/mISDN/dsp_pipeline.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/isdn/mISDN/dsp_pipeline.c +2 -1
@@ -77,6 +77,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem)if (!entry)return -ENOMEM ; +INIT_LIST_HEAD (&entry->list); entry->elem = elem; entry->dev.class = elements_class;
@@ -107,7 +108,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem)device_unregister (&entry->dev);return ret; err1: -kfree (entry); +put_device (&entry->dev);return ret; }EXPORT_SYMBOL (mISDN_dsp_element_register);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 150/314 net: hinic: Fix error handling in hinic_module_init()
In reply to Greg Kroah-HartmanFrom: Yuan Can <[email protected]>
[ Upstream commit 8eab9be56cc6b702a445d2b6d0256aa0992316b3 ]
A problem about hinic create debugfs failed is triggered with the following log given:
[ 931.419023] debugfs: Directory 'hinic' with parent '/' already present!
The reason is that hinic_module_init() returns pci_register_driver() directly without checking its return value, if pci_register_driver() failed, it returns without destroy the newly created debugfs, resulting the debugfs of hinic can never be created later.
hinic_module_init()
hinic_dbg_register_debugfs() # create debugfs directory pci_register_driver()
driver_register()
bus_add_driver()
priv = kzalloc(...) # OOM happened
# return without destroy debugfs directory
Fix by removing debugfs when pci_register_driver() returns error.
--- drivers/net/ethernet/huawei/hinic/hinic_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/ethernet/huawei/hinic/hinic_main.c +8 -1
@@ -1478,8 +1478,15 @@ static struct pci_driver hinic_driver = {static int __init hinic_module_init (void ) { +int ret; +hinic_dbg_register_debugfs (HINIC_DRV_NAME ); -return pci_register_driver (&hinic_driver); + + ret =pci_register_driver (&hinic_driver); +if (ret) +hinic_dbg_unregister_debugfs (); + +return ret; } static void __exit hinic_module_exit(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 151/314 net: phy: dp83867: Fix SGMII FIFO depth for non OF devices
In reply to Greg Kroah-HartmanFrom: Michael Sit Wei Hong <[email protected]>
[ Upstream commit e2a54350dc9642e7dfc07335ca355581caa9dbfe ]
Current driver code will read device tree node information, and set default values if there is no info provided.
This is not done in non-OF devices leading to SGMII fifo depths being set to the smallest size.
This patch sets the value to the default value of the PHY as stated in the PHY datasheet.
--- drivers/net/phy/dp83867.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/phy/dp83867.c +7 -0
@@ -682,6 +682,13 @@ static int dp83867_of_init(struct phy_device *phydev)*/ dp83867->io_impedance =DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN /2 ; +/* For non-OF device, the RX and TX FIFO depths are taken from +* default value. So, we init RX & TX FIFO depths here +* so that it is configured correctly later in dp83867_config_init(); +*/ + dp83867->tx_fifo_depth =DP83867_PHYCR_FIFO_DEPTH_4_B_NIB ; + dp83867->rx_fifo_depth =DP83867_PHYCR_FIFO_DEPTH_4_B_NIB ; + return 0; }#endif /* CONFIG_OF_MDIO */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 152/314 net: stmmac: ensure tx function is not running in stmmac_xdp_release()
In reply to Greg Kroah-HartmanFrom: Mohd Faizal Abdul Rahim <[email protected]>
[ Upstream commit 77711683a50477de39757d67ab1a3638220d6860 ]
When stmmac_xdp_release() is called, there is a possibility that tx function is still running on other queues which will lead to tx queue timed out and reset adapter.
This commit ensure that tx function is not running xdp before release flow continue to run.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3 -0
@@ -6564,6 +6564,9 @@ void stmmac_xdp_release(struct net_device *dev)struct stmmac_priv *priv =netdev_priv (dev);u32 chan; +/* Ensure tx function is not running */ +netif_tx_disable (dev); +/* Disable NAPI process */ stmmac_disable_all_queues (priv);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 153/314 mctp i2c: dont count unused / invalid keys for flow release
In reply to Greg Kroah-HartmanFrom: Jeremy Kerr <[email protected]>
[ Upstream commit 9cbd48d5fa14e4c65f8580de16686077f7cea02b ]
We're currently hitting the WARN_ON in mctp_i2c_flow_release:
if (midev->release_count > midev->i2c_lock_count) {
WARN_ONCE(1, "release count overflow");This may be hit if we expire a flow before sending the first packet it contains - as we will not be pairing the increment of release_count (performed on flow release) with the i2c lock operation (only performed on actual TX).
To fix this, only release a flow if we've encountered it previously (ie, dev_flow_state does not indicate NEW), as we will mark the flow as ACTIVE at the same time as accounting for the i2c lock operation. We also need to add an INVALID flow state, to indicate when we've done the release.
--- drivers/net/mctp/mctp-i2c.c | 47 +++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 15 deletions(-)
drivers/net/mctp/mctp-i2c.c +32 -15
@@ -43,6 +43,7 @@enum {MCTP_I2C_FLOW_STATE_NEW =0 ,MCTP_I2C_FLOW_STATE_ACTIVE , +MCTP_I2C_FLOW_STATE_INVALID , };/* List of all struct mctp_i2c_client
@@ -374,12 +375,18 @@ mctp_i2c_get_tx_flow_state(struct mctp_i2c_dev *midev, struct sk_buff *skb)*/ if (!key->valid) { state =MCTP_I2C_TX_FLOW_INVALID ; - - }else if (key->dev_flow_state ==MCTP_I2C_FLOW_STATE_NEW ) { - key->dev_flow_state =MCTP_I2C_FLOW_STATE_ACTIVE ; - state =MCTP_I2C_TX_FLOW_NEW ; }else { - state =MCTP_I2C_TX_FLOW_EXISTING ; +switch (key->dev_flow_state) { +case MCTP_I2C_FLOW_STATE_NEW : + key->dev_flow_state =MCTP_I2C_FLOW_STATE_ACTIVE ; + state =MCTP_I2C_TX_FLOW_NEW ; +break ; +case MCTP_I2C_FLOW_STATE_ACTIVE : + state =MCTP_I2C_TX_FLOW_EXISTING ; +break ; +default : + state =MCTP_I2C_TX_FLOW_INVALID ; + } }spin_unlock_irqrestore (&key->lock, flags);
@@ -617,21 +624,31 @@ static void mctp_i2c_release_flow(struct mctp_dev *mdev, {struct mctp_i2c_dev *midev =netdev_priv (mdev->dev); +bool queue_release = false;unsigned long flags;spin_lock_irqsave (&midev->lock, flags); - midev->release_count++; -spin_unlock_irqrestore (&midev->lock, flags); - -/* Ensure we have a release operation queued, through the fake -* marker skb +/* if we have seen the flow/key previously, we need to pair the +* original lock with a release */ -spin_lock (&midev->tx_queue.lock); -if (!midev->unlock_marker.next) -__skb_queue_tail (&midev->tx_queue, &midev->unlock_marker); -spin_unlock (&midev->tx_queue.lock); +if (key->dev_flow_state ==MCTP_I2C_FLOW_STATE_ACTIVE ) { + midev->release_count++; + queue_release = true; + } + key->dev_flow_state =MCTP_I2C_FLOW_STATE_INVALID ; +spin_unlock_irqrestore (&midev->lock, flags); -wake_up (&midev->tx_wq); +if (queue_release) { +/* Ensure we have a release operation queued, through the fake +* marker skb +*/ +spin_lock (&midev->tx_queue.lock); +if (!midev->unlock_marker.next) +__skb_queue_tail (&midev->tx_queue, + &midev->unlock_marker); +spin_unlock (&midev->tx_queue.lock); +wake_up (&midev->tx_wq); + } }static const struct net_device_ops mctp_i2c_ops = {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 154/314 soc: imx8m: Enable OCOTP clock before reading the register
In reply to Greg Kroah-HartmanFrom: Xiaolei Wang <[email protected]>
[ Upstream commit 836fb30949d9edf91d7de696a884ceeae7e426d2 ]
Commit 7d981405d0fd ("soc: imx8m: change to use platform driver") ever removed the dependency on bootloader for enabling OCOTP clock. It helped to fix a kexec kernel hang issue. But unfortunately it caused a regression on CAAM driver and got reverted.
This is the second try to enable the OCOTP clock by directly calling clock API instead of indirectly enabling the clock via nvmem API.
--- drivers/soc/imx/soc-imx8m.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/soc/imx/soc-imx8m.c +11 -0
@@ -11,6 +11,7 @@#include <linux/platform_device.h> #include <linux/arm-smccc.h> #include <linux/of.h> +#include <linux/clk.h> #define REV_B1 0x21
@@ -56,6 +57,7 @@ static u32 __init imx8mq_soc_revision(void)void __iomem *ocotp_base;u32 magic;u32 rev; +struct clk *clk; np =of_find_compatible_node (NULL ,NULL ,"fsl,imx8mq-ocotp" );if (!np)
@@ -63,6 +65,13 @@ static u32 __init imx8mq_soc_revision(void) ocotp_base =of_iomap (np,0 );WARN_ON (!ocotp_base); + clk =of_clk_get_by_name (np,NULL ); +if (!clk) { +WARN_ON (!clk); +return 0 ; + } + +clk_prepare_enable (clk);/* * SOC revision on older imx8mq is not available in fuses so query
@@ -79,6 +88,8 @@ static u32 __init imx8mq_soc_revision(void) soc_uid <<=32 ; soc_uid |=readl_relaxed (ocotp_base +OCOTP_UID_LOW ); +clk_disable_unprepare (clk); +clk_put (clk);iounmap (ocotp_base);of_node_put (np);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 155/314 net: liquidio: release resources when liquidio driver open failed
In reply to Greg Kroah-HartmanFrom: Zhengchao Shao <[email protected]>
[ Upstream commit 8979f428a4afc215e390006e5ea19fd4e22c7ca9 ]
When liquidio driver open failed, it doesn't release resources. Compile tested only.
--- .../net/ethernet/cavium/liquidio/lio_main.c | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_main.c +26 -8
@@ -1799,13 +1799,10 @@ static int liquidio_open(struct net_device *netdev)ifstate_set (lio,LIO_IFSTATE_RUNNING ); -if (OCTEON_CN23XX_PF (oct)) { -if (!oct->msix_on) -if (setup_tx_poll_fn (netdev)) -return -1 ; - }else { -if (setup_tx_poll_fn (netdev)) -return -1 ; +if (!OCTEON_CN23XX_PF (oct) || (OCTEON_CN23XX_PF (oct) && !oct->msix_on)) { + ret =setup_tx_poll_fn (netdev); +if (ret) + goto err_poll; }netif_tx_start_all_queues (netdev);
@@ -1818,7 +1815,7 @@ static int liquidio_open(struct net_device *netdev)/* tell Octeon to start forwarding packets to host */ ret =send_rx_ctrl_cmd (lio,1 );if (ret) -return ret; + goto err_rx_ctrl;/* start periodical statistics fetch */ INIT_DELAYED_WORK (&lio->stats_wk.work, lio_fetch_stats);
@@ -1829,6 +1826,27 @@ static int liquidio_open(struct net_device *netdev)dev_info (&oct->pci_dev->dev,"%s interface is opened\n" , netdev->name); +return 0 ; + +err_rx_ctrl: +if (!OCTEON_CN23XX_PF (oct) || (OCTEON_CN23XX_PF (oct) && !oct->msix_on)) +cleanup_tx_poll_fn (netdev); +err_poll: +if (lio->ptp_clock) { +ptp_clock_unregister (lio->ptp_clock); + lio->ptp_clock =NULL ; + } + +if (oct->props[lio->ifidx].napi_enabled ==1 ) { +list_for_each_entry_safe (napi, n, &netdev->napi_list, dev_list) +napi_disable (napi); + + oct->props[lio->ifidx].napi_enabled =0 ; + +if (OCTEON_CN23XX_PF (oct)) + oct->droq[0 ]->ops.poll_mode =0 ; + } +return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 156/314 mISDN: fix misuse of put_device() in mISDN_register_device()
In reply to Greg Kroah-HartmanFrom: Wang ShaoBo <[email protected]>
[ Upstream commit 2d25107e111a85c56f601a5470f1780ec054e6ac ]
We should not release reference by put_device() before calling device_initialize().
--- drivers/isdn/mISDN/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/isdn/mISDN/core.c +1 -1
@@ -222,7 +222,7 @@ mISDN_register_device(struct mISDNdevice *dev, err =get_free_devid ();if (err <0 ) - goto error1; +return err; dev->id = err;device_initialize (&dev->dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 157/314 net: macvlan: Use built-in RCU list checking
In reply to Greg Kroah-HartmanFrom: Chuang Wang <[email protected]>
[ Upstream commit 5df1341ea822292275c56744aab9c536d75c33be ]
hlist_for_each_entry_rcu() has built-in RCU and lock checking.
Pass cond argument to hlist_for_each_entry_rcu() to silence false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled.
Execute as follow:
ip link add link eth0 type macvlan mode source macaddr add <MAC-ADDR>
The rtnl_lock is held when macvlan_hash_lookup_source() or macvlan_fill_info_macaddr() are called in the non-RCU read side section. So, pass lockdep_rtnl_is_held() to silence false lockdep warning.
--- drivers/net/macvlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/macvlan.c +2 -2
@@ -141,7 +141,7 @@ static struct macvlan_source_entry *macvlan_hash_lookup_source(u32 idx =macvlan_eth_hash (addr);struct hlist_head *h = &vlan->port->vlan_source_hash[idx]; -hlist_for_each_entry_rcu (entry, h, hlist) { +hlist_for_each_entry_rcu (entry, h, hlist,lockdep_rtnl_is_held ()) {if (ether_addr_equal_64bits (entry->addr, addr) && entry->vlan == vlan)return entry;
@@ -1647,7 +1647,7 @@ static int macvlan_fill_info_macaddr(struct sk_buff *skb,struct hlist_head *h = &vlan->port->vlan_source_hash[i];struct macvlan_source_entry *entry; -hlist_for_each_entry_rcu (entry, h, hlist) { +hlist_for_each_entry_rcu (entry, h, hlist,lockdep_rtnl_is_held ()) {if (entry->vlan != vlan)continue ;if (nla_put (skb,IFLA_MACVLAN_MACADDR ,ETH_ALEN , entry->addr))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 158/314 net: caif: fix double disconnect client in chnl_net_open()
In reply to Greg Kroah-HartmanFrom: Zhengchao Shao <[email protected]>
[ Upstream commit 8fbb53c8bfd8c56ecf1f78dc821778b58f505503 ]
When connecting to client timeout, disconnect client for twice in chnl_net_open(). Remove one. Compile tested only.
--- net/caif/chnl_net.c | 3 --- 1 file changed, 3 deletions(-)
net/caif/chnl_net.c +0 -3
@@ -310,9 +310,6 @@ static int chnl_net_open(struct net_device *dev)if (result ==0 ) {pr_debug ("connect timeout\n" ); -caif_disconnect_client (dev_net (dev), &priv->chnl); - priv->state =CAIF_DISCONNECTED ; -pr_debug ("state disconnected\n" ); result = -ETIMEDOUT ; goto error; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 159/314 bnxt_en: Remove debugfs when pci_register_driver failed
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
[ Upstream commit 991aef4ee4f6eb999924f429b943441a32835c8f ]
When pci_register_driver failed, we need to remove debugfs, which will caused a resource leak, fix it.
Resource leak logs as follows:
[ 52.184456] debugfs: Directory 'bnxt_en' with parent '/' already present!
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +9 -1
@@ -14037,8 +14037,16 @@ static struct pci_driver bnxt_pci_driver = {static int __init bnxt_init (void ) { +int err; +bnxt_debug_init (); -return pci_register_driver (&bnxt_pci_driver); + err =pci_register_driver (&bnxt_pci_driver); +if (err) { +bnxt_debug_exit (); +return err; + } + +return 0 ; } static void __exit bnxt_exit(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 160/314 octeon_ep: delete unnecessary napi rollback under set_queues_err in octep_open()
In reply to Greg Kroah-HartmanFrom: Ziyang Xuan <[email protected]>
[ Upstream commit 298b83e180d53a310f9b47e3bf13b7b583e75e9c ]
octep_napi_add() and octep_napi_enable() are all after netif_set_real_num_{tx,rx}_queues() in octep_open(), so it is unnecessary napi rollback under set_queues_err. Delete them to fix it.
--- drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/marvell/octeon_ep/octep_main.c +0 -2
@@ -527,8 +527,6 @@ static int octep_open(struct net_device *netdev)return 0 ; set_queues_err: -octep_napi_disable (oct); -octep_napi_delete (oct);octep_clean_irqs (oct); setup_irq_err:octep_free_oqs (oct);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 161/314 octeon_ep: ensure octep_get_link_status() successfully before octep_link_up()
In reply to Greg Kroah-HartmanFrom: Ziyang Xuan <[email protected]>
[ Upstream commit 9d3ff7131877fb092185c369fbb14b57ac4e7cec ]
octep_get_link_status() can fail because send mbox message failed, then octep_get_link_status() will return ret less than 0. Excute octep_link_up() as long as ret is not equal to 0 in octep_open() now. That is not correct.
The value type of link.state is enum octep_ctrl_net_state. Positive value represents up. Excute octep_link_up() when ret is bigger than 0.
--- drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeon_ep/octep_main.c +1 -1
@@ -521,7 +521,7 @@ static int octep_open(struct net_device *netdev)octep_oq_dbell_init (oct); ret =octep_get_link_status (oct); -if (ret) +if (ret >0 )octep_link_up (netdev);return 0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 162/314 octeon_ep: fix potential memory leak in octep_device_setup()
In reply to Greg Kroah-HartmanFrom: Ziyang Xuan <[email protected]>
[ Upstream commit e4041be97b15302ebfffda8bbd45f3b2d096048f ]
When occur unsupported_dev and mbox init errors, it did not free oct->conf and iounmap() oct->mmio[i].hw_addr. That would trigger memory leak problem. Add kfree() for oct->conf and iounmap() for oct->mmio[i].hw_addr under unsupported_dev and mbox init errors to fix the problem.
--- drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeon_ep/octep_main.c +5 -1
@@ -956,7 +956,7 @@ int octep_device_setup(struct octep_device *oct) ret =octep_ctrl_mbox_init (ctrl_mbox);if (ret) {dev_err (&pdev->dev,"Failed to initialize control mbox\n" ); -return -1 ; + goto unsupported_dev; } oct->ctrl_mbox_ifstats_offset = OCTEP_CTRL_MBOX_SZ(ctrl_mbox->h2fq.elem_sz, ctrl_mbox->h2fq.elem_cnt,
@@ -966,6 +966,10 @@ int octep_device_setup(struct octep_device *oct)return 0 ; unsupported_dev: +for (i =0 ; i <OCTEP_MMIO_REGIONS ; i++) +iounmap (oct->mmio[i].hw_addr); + +kfree (oct->conf);return -1 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 163/314 octeon_ep: ensure get mac address successfully before eth_hw_addr_set()
In reply to Greg Kroah-HartmanFrom: Ziyang Xuan <[email protected]>
[ Upstream commit 848ffce2f0c93f3481052340a919123a21f808b6 ]
octep_get_mac_addr() can fail because send mbox message failed. If this happens, octep_dev->mac_addr will be zero. It should not continue to initialize. Add exception handling for octep_get_mac_addr() to fix it.
--- drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeon_ep/octep_main.c +5 -1
@@ -1072,7 +1072,11 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent) netdev->max_mtu =OCTEP_MAX_MTU ; netdev->mtu =OCTEP_DEFAULT_MTU ; -octep_get_mac_addr (octep_dev, octep_dev->mac_addr); + err =octep_get_mac_addr (octep_dev, octep_dev->mac_addr); +if (err) { +dev_err (&pdev->dev,"Failed to get mac address\n" ); + goto register_dev_err; + }eth_hw_addr_set (netdev, octep_dev->mac_addr); err =register_netdev (netdev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 164/314 drm/lima: Fix opp clkname setting in case of missing regulator
In reply to Greg Kroah-HartmanFrom: Erico Nunes <[email protected]>
[ Upstream commit e17a025a47c66ca8499ae88d8046c4f0d7c9c057 ]
Commit d8c32d3971e4 ("drm/lima: Migrate to dev_pm_opp_set_config()") introduced a regression as it may undo the clk_names setting in case the optional regulator is missing. This resulted in test and performance regressions with lima.
Restore the old behavior where clk_names is set separately so it is not undone in case of a missing optional regulator.
--- drivers/gpu/drm/lima/lima_devfreq.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/lima/lima_devfreq.c +9 -6
@@ -112,11 +112,6 @@ int lima_devfreq_init(struct lima_device *ldev)unsigned long cur_freq;int ret;const char *regulator_names[] = {"mali" ,NULL }; -const char *clk_names[] = {"core" ,NULL }; -struct dev_pm_opp_config config = { - .regulator_names = regulator_names, - .clk_names = clk_names, - };if (!device_property_present (dev,"operating-points-v2" ))/* Optional, continue without devfreq */
@@ -124,7 +119,15 @@ int lima_devfreq_init(struct lima_device *ldev)spin_lock_init (&ldevfreq->lock); - ret =devm_pm_opp_set_config (dev, &config); +/* +* clkname is set separately so it is not affected by the optional +* regulator setting which may return error. +*/ + ret =devm_pm_opp_set_clkname (dev,"core" ); +if (ret) +return ret; + + ret =devm_pm_opp_set_regulators (dev, regulator_names);if (ret) {/* Continue if the optional regulator is missing */ if (ret != -ENODEV )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 165/314 net: mhi: Fix memory leak in mhi_net_dellink()
In reply to Greg Kroah-HartmanFrom: Wei Yongjun <[email protected]>
[ Upstream commit f7c125bd79f50ec6094761090be81d02726ec6f4 ]
MHI driver registers network device without setting the needs_free_netdev flag, and does NOT call free_netdev() when unregisters network device, which causes a memory leak.
This patch calls free_netdev() to fix it since netdev_priv is used after unregister.
--- drivers/net/mhi_net.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/mhi_net.c +2 -0
@@ -343,6 +343,8 @@ static void mhi_net_dellink(struct mhi_device *mhi_dev, struct net_device *ndev)kfree_skb (mhi_netdev->skbagg_head); +free_netdev (ndev); +dev_set_drvdata (&mhi_dev->dev,NULL ); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 166/314 net: dsa: make dsa_master_ioctl() see through port_hwtstamp_get() shims
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
[ Upstream commit ed1fe1bebe18884b11e5536b5ac42e3a48960835 ]
There are multi-generational drivers like mv88e6xxx which have code like this:
int mv88e6xxx_port_hwtstamp_get(struct dsa_switch *ds, int port,
struct ifreq *ifr)
{
if (!chip->info->ptp_support)
return -EOPNOTSUPP;
...
}DSA wants to deny PTP timestamping on the master if the switch supports timestamping too. However it currently relies on the presence of the port_hwtstamp_get() callback to determine PTP capability, and this clearly does not work in that case (method is present but returns -EOPNOTSUPP).
We should not deny PTP on the DSA master for those switches which truly do not support hardware timestamping.
Create a dsa_port_supports_hwtstamp() method which actually probes for support by calling port_hwtstamp_get() and seeing whether that returned -EOPNOTSUPP or not.
--- net/dsa/dsa_priv.h | 1 + net/dsa/master.c | 3 +-- net/dsa/port.c | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-)
net/dsa/dsa_priv.h +1 -0
@@ -201,6 +201,7 @@ static inline struct net_device *dsa_master_find_slave(struct net_device *dev, }/* port.c */ +bool dsa_port_supports_hwtstamp (struct dsa_port *dp,struct ifreq *ifr);void dsa_port_set_tag_protocol (struct dsa_port *cpu_dp,const struct dsa_device_ops *tag_ops);int dsa_port_set_state (struct dsa_port *dp,u8 state,bool do_fast_age);
net/dsa/master.c +1 -2
@@ -204,8 +204,7 @@ static int dsa_master_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)* switch in the tree that is PTP capable. */ list_for_each_entry (dp, &dst->ports, list) -if (dp->ds->ops->port_hwtstamp_get || - dp->ds->ops->port_hwtstamp_set) +if (dsa_port_supports_hwtstamp (dp, ifr))return -EBUSY ;break ; }
net/dsa/port.c +16 -0
@@ -109,6 +109,22 @@ static bool dsa_port_can_configure_learning(struct dsa_port *dp)return !err; } +bool dsa_port_supports_hwtstamp (struct dsa_port *dp,struct ifreq *ifr) +{ +struct dsa_switch *ds = dp->ds; +int err; + +if (!ds->ops->port_hwtstamp_get || !ds->ops->port_hwtstamp_set) +return false; + +/* "See through" shim implementations of the "get" method. +* This will clobber the ifreq structure, but we will either return an +* error, or the master will overwrite it with proper values. +*/ + err = ds->ops->port_hwtstamp_get (ds, dp->index, ifr); +return err != -EOPNOTSUPP ; +} +int dsa_port_set_state (struct dsa_port *dp,u8 state,bool do_fast_age) {struct dsa_switch *ds = dp->ds;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 167/314 xen/pcpu: fix possible memory leak in register_pcpu()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit da36a2a76b01b210ffaa55cdc2c99bc8783697c5 ]
In device_add(), dev_set_name() is called to allocate name, if it returns error, the name need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup().
--- drivers/xen/pcpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/pcpu.c +1 -1
@@ -228,7 +228,7 @@ static int register_pcpu(struct pcpu *pcpu) err =device_register (dev);if (err) { -pcpu_release (dev); +put_device (dev);return err; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 168/314 erofs: fix missing xas_retry() in fscache mode
In reply to Greg Kroah-HartmanFrom: Jingbo Xu <[email protected]>
[ Upstream commit 37020bbb71d911431e16c2c940b97cf86ae4f2f6 ]
The xarray iteration only holds the RCU read lock and thus may encounter XA_RETRY_ENTRY if there's process modifying the xarray concurrently. This will cause oops when referring to the invalid entry.
Fix this by adding the missing xas_retry(), which will make the iteration wind back to the root node if XA_RETRY_ENTRY is encountered.
--- fs/erofs/fscache.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
fs/erofs/fscache.c +7 -3
@@ -69,11 +69,15 @@ static void erofs_fscache_rreq_unlock_folios(struct netfs_io_request *rreq)rcu_read_lock ();xas_for_each (&xas, folio, last_page) { -unsigned int pgpos = - (folio_index (folio) - start_page) *PAGE_SIZE ; -unsigned int pgend = pgpos +folio_size (folio); +unsigned int pgpos, pgend;bool pg_failed = false; +if (xas_retry (&xas, folio)) +continue ; + + pgpos = (folio_index (folio) - start_page) *PAGE_SIZE ; + pgend = pgpos +folio_size (folio); +for (;;) {if (!subreq) { pg_failed = true;
Signature · 1 line
2.35.1