5.17.6-rc1 review
Subsystems (8)
Greg Kroah-Hartman
maintainercover 5.17.6-rc1 review
This is the start of the stable review cycle for the 5.17.6 release. There are 225 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, 06 May 2022 15:25:19 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.17.6-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-5.17.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.17.6-rc1
Alexey Kardashevskiy <[email protected]>
powerpc/64: Add UADDR64 relocation support
Peter Zijlstra <[email protected]>
objtool: Fix type of reloc::addend
Peter Zijlstra <[email protected]>
objtool: Fix code relocs vs weak symbols
Daniel Starke <[email protected]>
tty: n_gsm: fix sometimes uninitialized warning in gsm_dlci_modem_output()
Daniel Starke <[email protected]>
tty: n_gsm: fix software flow control handling
Daniel Starke <[email protected]>
tty: n_gsm: fix invalid use of MSC in advanced option
Daniel Starke <[email protected]>
tty: n_gsm: fix broken virtual tty handling
Daniel Starke <[email protected]>
tty: n_gsm: fix missing update of modem controls after DLCI open
Daniel Starke <[email protected]>
tty: n_gsm: fix incorrect UA handling
Daniel Starke <[email protected]>
tty: n_gsm: fix reset fifo race condition
Daniel Starke <[email protected]>
tty: n_gsm: fix missing tty wakeup in convergence layer type 2
Daniel Starke <[email protected]>
tty: n_gsm: fix wrong signal octets encoding in MSC
Daniel Starke <[email protected]>
tty: n_gsm: fix wrong command frame length field encoding
Daniel Starke <[email protected]>
tty: n_gsm: fix wrong command retry handling
Daniel Starke <[email protected]>
tty: n_gsm: fix missing explicit ldisc flush
Daniel Starke <[email protected]>
tty: n_gsm: fix wrong DLCI release order
Daniel Starke <[email protected]>
tty: n_gsm: fix insufficient txframe size
Florian Westphal <[email protected]>
netfilter: nft_socket: only do sk lookups when indev is available
Daniel Starke <[email protected]>
tty: n_gsm: fix malformed counter for out of frame data
Daniel Starke <[email protected]>
tty: n_gsm: fix frame reception handling
Daniel Starke <[email protected]>
tty: n_gsm: fix wrong signal octet encoding in convergence layer type 2
Daniel Starke <[email protected]>
tty: n_gsm: fix mux cleanup after unregister tty device
Daniel Starke <[email protected]>
tty: n_gsm: fix decoupled mux resource
Daniel Starke <[email protected]>
tty: n_gsm: fix restart handling via CLD command
Daniel Starke <[email protected]>
tty: n_gsm: fix missing mux reset on config change at responder
Namhyung Kim <[email protected]>
perf symbol: Remove arch__symbols__fixup_end()
Namhyung Kim <[email protected]>
perf symbol: Update symbols__fixup_end()
Namhyung Kim <[email protected]>
perf symbol: Pass is_kallsyms to symbols__fixup_end()
Tim Harvey <[email protected]>
ARM: dts: imx8mm-venice-gw{71xx,72xx,73xx}: fix OTG controller OC mode
Eugen Hristev <[email protected]>
ARM: dts: at91: sama7g5ek: enable pull-up on flexcom3 console lines
Filipe Manana <[email protected]>
btrfs: fix assertion failure during scrub due to block group reallocation
Naohiro Aota <[email protected]>
btrfs: zoned: use dedicated lock for data relocation
Filipe Manana <[email protected]>
btrfs: fix leaked plug after failure syncing log on zoned filesystems
Christoph Hellwig <[email protected]>
btrfs: fix direct I/O writes for split bios on zoned devices
Christoph Hellwig <[email protected]>
btrfs: fix direct I/O read repair for split bios
Kees Cook <[email protected]>
thermal: int340x: Fix attr.show callback prototype
Ville Syrjälä <[email protected]>
ACPI: processor: idle: Avoid falling back to C3 type C-states
Dinh Nguyen <[email protected]>
net: ethernet: stmmac: fix write to sgmii_adapter_base
Imre Deak <[email protected]>
drm/i915: Fix SEL_FETCH_PLANE_*(PIPE_B+) register addresses
Jouni Högander <[email protected]>
drm/i915: Check EDID for HDR static metadata when choosing blc
Alex Deucher <[email protected]>
drm/amdgpu: don't runtime suspend if there are displays attached (v3)
Martin Willi <[email protected]>
netfilter: Update ip6_route_me_harder to consider L3 domain
Md Sadre Alam <[email protected]>
mtd: rawnand: qcom: fix memory corruption that causes panic
Zqiang <[email protected]>
kasan: prevent cpu_quarantine corruption when CPU offline and cache shrink occur at same time
Damien Le Moal <[email protected]>
zonefs: Clear inode information flags on inode creation
Damien Le Moal <[email protected]>
zonefs: Fix management of open zones
Tejun Heo <[email protected]>
Revert "block: inherit request start time from bio for BLK_CGROUP"
Ville Syrjälä <[email protected]>
Revert "ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40"
Jan Kara <[email protected]>
bfq: Fix warning in bfqq_request_over_limit()
Sidhartha Kumar <[email protected]>
selftest/vm: verify remap destination address in mremap_test
Sidhartha Kumar <[email protected]>
selftest/vm: verify mmap addr in mremap_test
Gongjun Song <[email protected]>
ALSA: hda: intel-dsp-config: Add RaptorLake PCI IDs
Alexey Kardashevskiy <[email protected]>
powerpc/perf: Fix 32bit compile
Duoming Zhou <[email protected]>
drivers: net: hippi: Fix deadlock in rr_close()
Ronnie Sahlberg <[email protected]>
cifs: destage any unwritten data to the server before calling copychunk_write
Mikulas Patocka <[email protected]>
x86: __memcpy_flushcache: fix wrong alignment if size > 2^32
suresh kumar <[email protected]>
bonding: do not discard lowest hash bit for non layer3+4 hashing
Hongyu Jin <[email protected]>
erofs: fix use-after-free of on-stack io[]
Namjae Jeon <[email protected]>
ksmbd: set fixed sector size to FS_SECTOR_SIZE_INFORMATION
Namjae Jeon <[email protected]>
ksmbd: increment reference count of parent fp
Duoming Zhou <[email protected]>
arch: xtensa: platforms: Fix deadlock in rs_close()
Ye Bin <[email protected]>
ext4: fix bug_on in start_this_handle during umount filesystem
Zheyu Ma <[email protected]>
Input: cypress-sf - register a callback to disable the regulators
Mauro Carvalho Chehab <[email protected]>
ASoC: Intel: sof_es8336: Add a quirk for Huawei Matebook D15
Zheyu Ma <[email protected]>
ASoC: wm8731: Disable the regulator when probing fails
Chao Song <[email protected]>
ASoC: Intel: soc-acpi: correct device endpoints for max98373
Pierre-Louis Bossart <[email protected]>
ASoC: rt711/5682: check if bus is active before deferred jack detection
Hui Wang <[email protected]>
ASoC: cs35l41: Fix a shift-out-of-bounds warning found by UBSAN
Christophe JAILLET <[email protected]>
ASoC: soc-pcm: use GFP_KERNEL when the code is sleepable
Joseph Ravichandran <[email protected]>
io_uring: fix uninitialized field in rw io_kiocb
Pengcheng Yang <[email protected]>
tcp: fix F-RTO may not work correctly when receiving DSACK
Dany Madden <[email protected]>
Revert "ibmvnic: Add ethtool private flag for driver-defined queue limits"
Vladimir Oltean <[email protected]>
net: enetc: allow tc-etf offload even with NETIF_F_CSUM_MASK
Leon Romanovsky <[email protected]>
ixgbe: ensure IPsec VF<->PF compatibility
Timothy Hayes <[email protected]>
perf arm-spe: Fix addresses of synthesized SPE events
Andreas Gruenbacher <[email protected]>
gfs2: No short reads or writes upon glock contention
Andreas Gruenbacher <[email protected]>
gfs2: Make sure not to return short direct writes
Andreas Gruenbacher <[email protected]>
gfs2: Minor retry logic cleanup
Yang Yingliang <[email protected]>
net: fec: add missing of_node_put() in fec_enet_init_stop_mode()
Manish Chopra <[email protected]>
bnx2x: fix napi API usage sequence
Maxim Mikityanskiy <[email protected]>
tls: Skip tls_append_frag on zero copy size
Miaoqian Lin <[email protected]>
drm/amd/display: Fix memory leak in dcn21_clock_source_create
David Yat Sin <[email protected]>
drm/amdkfd: Fix GWS queue count
Hans de Goede <[email protected]>
platform/x86: asus-wmi: Fix driver not binding when fan curve control probe fails
Dan Carpenter <[email protected]>
platform/x86: asus-wmi: Potential buffer overflow in asus_wmi_evaluate_method_buf()
Volodymyr Mytnyk <[email protected]>
netfilter: conntrack: fix udp offload timeout sysctl
Florian Westphal <[email protected]>
netfilter: nf_conntrack_tcp: re-init for syn packets only
Jens Axboe <[email protected]>
io_uring: check reserved fields for recv/recvmsg
Jens Axboe <[email protected]>
io_uring: check reserved fields for send/sendmsg
Martin Blumenstingl <[email protected]>
net: dsa: lantiq_gswip: Don't set GSWIP_MII_CFG_RMII_CLK
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_event: Fix checking for invalid handle on error status
Petr Oros <[email protected]>
ice: wait 5 s for EMP reset after firmware flash
Samuel Holland <[email protected]>
drm/sun4i: Remove obsolete references to PHYS_OFFSET
Nathan Rossi <[email protected]>
net: dsa: mv88e6xxx: Fix port_hidden_wait to account for port_base_addr
Baruch Siach <[email protected]>
net: phy: marvell10g: fix return value on error
Jonathan Lemon <[email protected]>
net: bcmgenet: hide status block before TX timestamping
Lin Ma <[email protected]>
mctp: defer the kfree of object mdev->addrs
Vladimir Zapolskiy <[email protected]>
cpufreq: qcom-cpufreq-hw: Clear dcvs interrupts
Yang Yingliang <[email protected]>
clk: sunxi: sun9i-mmc: check return value after calling platform_get_resource()
Christophe JAILLET <[email protected]>
bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create()
Eric Dumazet <[email protected]>
tcp: make sure treq->af_specific is initialized
Eric Dumazet <[email protected]>
tcp: fix potential xmit stalls caused by TCP_NOTSENT_LOWAT
Peilin Ye <[email protected]>
ip_gre, ip6_gre: Fix race condition on o_seqno in collect_md mode
Peilin Ye <[email protected]>
ip6_gre: Make o_seqno start from 0 in native mode
Peilin Ye <[email protected]>
ip_gre: Make o_seqno start from 0 in native mode
Dan Carpenter <[email protected]>
net: lan966x: fix a couple off by one bugs
liuyacan <[email protected]>
net/smc: sync err code when tcp connection was refused
Jian Shen <[email protected]>
net: hns3: add return value for mailbox handling in PF
Jian Shen <[email protected]>
net: hns3: add validity check for message data length
Jie Wang <[email protected]>
net: hns3: modify the return code of hclge_get_ring_chain_from_mbx
Peng Li <[email protected]>
net: hns3: fix error log of tx/rx tqps stats
Jian Shen <[email protected]>
net: hns3: clear inited state and stop client after failed to register netdev
Xiaobing Luo <[email protected]>
cpufreq: fix memory leak in sun50i_cpufreq_nvmem_probe
Lv Ruyi <[email protected]>
pinctrl: pistachio: fix use of irq_of_parse_and_map()
Fabio Estevam <[email protected]>
arm64: dts: imx8mn-ddr4-evk: Describe the 32.768 kHz PMIC clock
Max Krummenacher <[email protected]>
ARM: dts: imx6ull-colibri: fix vqmmc regulator
Xin Long <[email protected]>
sctp: check asoc strreset_chunk in sctp_generate_reconf_event
Nikolay Aleksandrov <[email protected]>
wireguard: device: check for metadata_dst with skb_valid_dst()
Pengcheng Yang <[email protected]>
tcp: ensure to use the most recently sent skb when filling the rate sample
Marek Vasut <[email protected]>
pinctrl: stm32: Keep pinctrl block clock enabled when LEVEL IRQ requested
Francesco Ruggeri <[email protected]>
tcp: md5: incorrect tcp_header_len for incoming connections
Luca Ceresoli <[email protected]>
pinctrl: rockchip: fix RK3308 pinmux bits
Eyal Birger <[email protected]>
bpf, lwt: Fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit lwt hook
Pablo Neira Ayuso <[email protected]>
netfilter: nft_set_rbtree: overlap detection with element re-addition after deletion
Miaoqian Lin <[email protected]>
net: dsa: Add missing of_node_put() in dsa_port_link_register_of
Geert Uytterhoeven <[email protected]>
memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual Mode
Marek Vasut <[email protected]>
pinctrl: stm32: Do not call stm32_gpio_get() for edge triggered IRQs in EOI
Oleksandr Ocheretnyi <[email protected]>
mtd: fix 'part' field data corruption in mtd_info
Miaoqian Lin <[email protected]>
mtd: rawnand: Fix return value check of wait_for_completion_timeout
YueHaibing <[email protected]>
pinctrl: mediatek: moore: Fix build error
Heiner Kallweit <[email protected]>
phy: amlogic: fix error path in phy_g12a_usb3_pcie_probe()
Pengcheng Yang <[email protected]>
ipvs: correctly print the memory size of ip_vs_conn_tab
Luca Weiss <[email protected]>
pinctrl: qcom: sm6350: fix order of UFS & SDC pins
Adam Ford <[email protected]>
ARM: dts: logicpd-som-lv: Fix wrong pinmuxing on OMAP35
Adam Ford <[email protected]>
ARM: dts: am3517-evm: Fix misc pinmuxing
Miquel Raynal <[email protected]>
ARM: dts: am33xx-l4: Add missing touchscreen clock properties
H. Nikolaus Schaller <[email protected]>
ARM: dts: Fix mmc order for omap3-gta04
Stephen Boyd <[email protected]>
interconnect: qcom: sdx55: Drop IP0 interconnects
Stephen Boyd <[email protected]>
interconnect: qcom: sc7180: Drop IP0 interconnects
Miaoqian Lin <[email protected]>
phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe
Miaoqian Lin <[email protected]>
phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe
Claudiu Beznea <[email protected]>
ARM: dts: at91: fix pinctrl phandles
Claudiu Beznea <[email protected]>
ARM: dts: at91: sama5d4_xplained: fix pinctrl phandle name
Mark Brown <[email protected]>
ARM: dts: at91: Map MCLK for wm8731 on at91sam9g20ek
Miaoqian Lin <[email protected]>
phy: ti: omap-usb2: Fix error handling in omap_usb2_enable_clocks
Tony Lindgren <[email protected]>
ARM: dts: dra7: Fix suspend warning for vpe powerdomain
Tony Lindgren <[email protected]>
bus: ti-sysc: Make omap3 gpt12 quirk handling SoC specific
Miaoqian Lin <[email protected]>
ARM: OMAP2+: Fix refcount leak in omap_gic_of_init
Krzysztof Kozlowski <[email protected]>
phy: samsung: exynos5250-sata: fix missing device put in probe error paths
Miaoqian Lin <[email protected]>
phy: samsung: Fix missing of_node_put() in exynos_sata_phy_probe
Guillaume Giraudon <[email protected]>
arm64: dts: meson-sm1-bananapi-m5: fix wrong GPIO pin labeling for CON1
Marek Vasut <[email protected]>
arm64: dts: imx8mn: Fix SAI nodes
Alexander Stein <[email protected]>
arm64: dts: imx8mq-tqma8mq: change the spi-nor tx
Dan Carpenter <[email protected]>
iio:dac:ad3552r: Fix an IS_ERR() vs NULL check
Fabio Estevam <[email protected]>
ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue
Adam Ford <[email protected]>
soc: imx: imx8m-blk-ctrl: Fix IMX8MN_DISPBLK_PD_ISI hang
Weitao Wang <[email protected]>
USB: Fix xhci event ring dequeue pointer ERDP update issue
Liu Ying <[email protected]>
arm64: dts: imx8qm: Correct SCU clock controller's compatible property
Maciej Fijalkowski <[email protected]>
xsk: Fix l2fwd for copy mode + busy poll combo
Dongliang Mu <[email protected]>
tee: optee: add missing mutext_destroy in optee_ffa_probe
Chuanhong Guo <[email protected]>
mtd: rawnand: fix ecc parameters for mt7622
Wang ShaoBo <[email protected]>
iio:filter:admv8818: select REGMAP_SPI for ADMV8818
Tong Zhang <[email protected]>
iio:imu:bmi160: disable regulator in error path
Dan Carpenter <[email protected]>
iio: dac: ad3552r: fix signedness bug in ad3552r_reset()
Christian Hewitt <[email protected]>
arm64: dts: meson: remove CPU opps below 1GHz for SM1 boards
Christian Hewitt <[email protected]>
arm64: dts: meson: remove CPU opps below 1GHz for G12B boards
Pavel Skripkin <[email protected]>
video: fbdev: udlfb: properly check endpoint type
Vladimir Zapolskiy <[email protected]>
cpufreq: qcom-cpufreq-hw: Fix throttle frequency value on EPSS platforms
Dmitry Baryshkov <[email protected]>
cpufreq: qcom-hw: fix the opp entries refcounting
Dmitry Baryshkov <[email protected]>
cpufreq: qcom-hw: fix the race between LMH worker and cpuhp
Dmitry Baryshkov <[email protected]>
cpufreq: qcom-hw: drop affinity hint before freeing the IRQ
Nikolay Aleksandrov <[email protected]>
virtio_net: fix wrong buf address calculation when using xdp
Tejun Heo <[email protected]>
iocost: don't reset the inuse weight of under-weighted debtors
Thomas Gleixner <[email protected]>
x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests
Borislav Petkov <[email protected]>
x86/cpu: Load microcode during restore_processor_state()
Guo Ren <[email protected]>
riscv: patch_text: Fixup last cpu should be master
Shin'ichiro Kawasaki <[email protected]>
bus: fsl-mc-msi: Fix MSI descriptor mutex lock for msi_first_desc()
Mikulas Patocka <[email protected]>
hex2bin: fix access beyond string end
Mikulas Patocka <[email protected]>
hex2bin: make the function hex_to_bin constant-time
Jaegeuk Kim <[email protected]>
f2fs: should not truncate blocks during roll-forward recovery
Krzysztof Kozlowski <[email protected]>
pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
Johan Hovold <[email protected]>
arm64: dts: imx8mm-venice: fix spi2 pin configuration
Manivannan Sadhasivam <[email protected]>
bus: mhi: host: pci_generic: Flush recovery worker during freeze
Manivannan Sadhasivam <[email protected]>
bus: mhi: host: pci_generic: Add missing poweroff() PM callback
Xiubo Li <[email protected]>
ceph: fix possible NULL pointer dereference for req->r_session
Darren Hart <[email protected]>
topology: make core_mask include at least cluster_siblings
Wang Qing <[email protected]>
arch_topology: Do not set llc_sibling if llc_id is invalid
Christophe Leroy <[email protected]>
eeprom: at25: Use DMA safe buffers
Maciej W. Rozycki <[email protected]>
serial: 8250: Correct the clock for EndRun PTP/1588 PCIe device
Maciej W. Rozycki <[email protected]>
serial: 8250: Also set sticky MCR bits in console restoration
Lino Sanfilippo <[email protected]>
serial: amba-pl011: do not time out prematurely when draining tx fifo
Johan Hovold <[email protected]>
serial: imx: fix overrun interrupts in DMA mode
Alessandro Astone <[email protected]>
binder: Address corner cases in deferred copy and fixup
Alessandro Astone <[email protected]>
binder: Gracefully handle BINDER_TYPE_FDA objects with num_fds=0
Minchan Kim <[email protected]>
kernfs: fix NULL dereferencing in kernfs_remove
Sean Anderson <[email protected]>
usb: phy: generic: Get the vbus supply
Pawel Laszczak <[email protected]>
usb: cdns3: Fix issue for clear halt endpoint
Heikki Krogerus <[email protected]>
usb: dwc3: pci: add support for the Intel Meteor Lake-P
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Return proper request status
Thinh Nguyen <[email protected]>
usb: dwc3: core: Only handle soft-reset in DCTL
Thinh Nguyen <[email protected]>
usb: dwc3: core: Fix tx/rx threshold settings
Sven Peter <[email protected]>
usb: dwc3: Try usb-role-switch first in dwc3_drd_init
Vijayavardhan Vennapusa <[email protected]>
usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind()
Dan Vacura <[email protected]>
usb: gadget: uvc: Fix crash when encoding data for usb request
Heikki Krogerus <[email protected]>
usb: typec: ucsi: Fix role swapping
Heikki Krogerus <[email protected]>
usb: typec: ucsi: Fix reuse of completion structure
Tasos Sahanidis <[email protected]>
usb: core: Don't hold the device lock while sleeping in do_proc_control()
Hangyu Hua <[email protected]>
usb: misc: fix improper handling of refcount in uss720_probe()
Fawzi Khaber <[email protected]>
iio: imu: inv_icm42600: Fix I2C init possible nack
Zheyu Ma <[email protected]>
iio: magnetometer: ak8975: Fix the error handling in ak8975_power_on()
Michael Hennerich <[email protected]>
iio: dac: ad5446: Fix read_raw not returning set value
Tom Rix <[email protected]>
iio: scd4x: check return of scd4x_write_and_fetch
Zizhuang Deng <[email protected]>
iio: dac: ad5592r: Fix the missing return value.
Mathias Nyman <[email protected]>
xhci: increase usb U3 -> U0 link resume timeout from 100ms to 500ms
Henry Lin <[email protected]>
xhci: stop polling roothubs after shutdown
Evan Green <[email protected]>
xhci: Enable runtime PM on second Alderlake controller
zhangqilong <[email protected]>
usb: xhci: tegra:Fix PM usage reference leak of tegra_xusb_unpowergate_partitions
Daniele Palmas <[email protected]>
USB: serial: option: add Telit 0x1057, 0x1058, 0x1075 compositions
Slark Xiao <[email protected]>
USB: serial: option: add support for Cinterion MV32-WA/MV32-WB
Bruno Thomsen <[email protected]>
USB: serial: cp210x: add PIDs for Kamstrup USB Meter Reader
Kees Cook <[email protected]>
USB: serial: whiteheat: fix heap overflow in WHITEHEAT_GET_DTR_RTS
Oliver Neukum <[email protected]>
USB: quirks: add STRING quirk for VCOM device
Oliver Neukum <[email protected]>
USB: quirks: add a Realtek card reader
Willy Tarreau <[email protected]>
floppy: disable FDRAWCMD by default
Macpaul Lin <[email protected]>
usb: mtu3: fix USB 3.0 dual-role-switch from device to host
-------------
Diffstat:
Makefile | 4 +- arch/arm/boot/dts/am33xx-l4.dtsi | 2 + arch/arm/boot/dts/am3517-evm.dts | 45 +- arch/arm/boot/dts/am3517-som.dtsi | 9 + arch/arm/boot/dts/at91-sama5d3_xplained.dts | 8 +- arch/arm/boot/dts/at91-sama5d4_xplained.dts | 6 +- arch/arm/boot/dts/at91-sama7g5ek.dts | 2 +- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 6 + arch/arm/boot/dts/dra7-l4.dtsi | 4 +- arch/arm/boot/dts/imx6qdl-apalis.dtsi | 10 +- arch/arm/boot/dts/imx6ull-colibri.dtsi | 2 +- arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts | 15 + arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts | 15 + arch/arm/boot/dts/logicpd-som-lv.dtsi | 15 - arch/arm/boot/dts/omap3-gta04.dtsi | 2 + arch/arm/mach-exynos/Kconfig | 1 - arch/arm/mach-omap2/omap4-common.c | 2 + arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi | 40 -- arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi | 40 -- .../boot/dts/amlogic/meson-sm1-bananapi-m5.dts | 1 + arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 20 - .../boot/dts/freescale/imx8mm-venice-gw71xx.dtsi | 4 +- .../boot/dts/freescale/imx8mm-venice-gw72xx.dtsi | 4 +- .../boot/dts/freescale/imx8mm-venice-gw73xx.dtsi | 4 +- arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts | 4 + arch/arm64/boot/dts/freescale/imx8mn.dtsi | 10 +- arch/arm64/boot/dts/freescale/imx8mq-tqma8mq.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8qm.dtsi | 2 +- arch/powerpc/kernel/reloc_64.S | 67 ++- arch/powerpc/kernel/vmlinux.lds.S | 2 - arch/powerpc/perf/Makefile | 4 +- arch/powerpc/tools/relocs_check.sh | 7 +- arch/riscv/kernel/patch.c | 2 +- arch/x86/include/asm/microcode.h | 2 + arch/x86/kernel/cpu/microcode/core.c | 6 +- arch/x86/lib/usercopy_64.c | 2 +- arch/x86/pci/xen.c | 6 +- arch/x86/power/cpu.c | 10 +- arch/xtensa/platforms/iss/console.c | 8 - block/bfq-iosched.c | 12 +- block/blk-iocost.c | 12 +- block/blk-mq.c | 9 +- drivers/acpi/processor_idle.c | 8 +- drivers/android/binder.c | 10 +- drivers/base/arch_topology.c | 11 +- drivers/block/Kconfig | 16 + drivers/block/floppy.c | 43 +- drivers/bus/fsl-mc/fsl-mc-msi.c | 6 +- drivers/bus/mhi/pci_generic.c | 2 + drivers/bus/sunxi-rsb.c | 2 + drivers/bus/ti-sysc.c | 16 +- drivers/clk/sunxi/clk-sun9i-mmc.c | 2 + drivers/cpufreq/qcom-cpufreq-hw.c | 42 +- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 105 +++-- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 83 ++-- .../gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 1 + .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 34 +- drivers/gpu/drm/i915/i915_reg.h | 2 +- drivers/gpu/drm/sun4i/sun4i_frontend.c | 3 - drivers/iio/chemical/scd4x.c | 5 +- drivers/iio/dac/ad3552r.c | 6 +- drivers/iio/dac/ad5446.c | 2 +- drivers/iio/dac/ad5592r-base.c | 2 +- drivers/iio/filter/Kconfig | 1 + drivers/iio/imu/bmi160/bmi160_core.c | 20 +- drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 15 +- drivers/iio/magnetometer/ak8975.c | 1 + drivers/input/keyboard/cypress-sf.c | 14 + drivers/interconnect/qcom/sc7180.c | 21 - drivers/interconnect/qcom/sdx55.c | 21 - drivers/memory/renesas-rpc-if.c | 60 ++- drivers/misc/eeprom/at25.c | 19 +- drivers/mtd/nand/raw/mtk_ecc.c | 12 +- drivers/mtd/nand/raw/qcom_nandc.c | 24 +- drivers/mtd/nand/raw/sh_flctl.c | 14 +- drivers/net/bonding/bond_main.c | 13 +- drivers/net/dsa/lantiq_gswip.c | 3 - drivers/net/dsa/mv88e6xxx/port_hidden.c | 5 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 9 +- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 7 + drivers/net/ethernet/freescale/enetc/enetc_qos.c | 4 - drivers/net/ethernet/freescale/fec_main.c | 2 +- .../hns3/hns3_common/hclge_comm_tqp_stats.c | 4 +- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 9 + .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 31 +- drivers/net/ethernet/ibm/ibmvnic.c | 129 ++---- drivers/net/ethernet/ibm/ibmvnic.h | 6 - drivers/net/ethernet/intel/ice/ice_main.c | 3 + drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 3 +- .../net/ethernet/microchip/lan966x/lan966x_mac.c | 4 +- .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 12 +- drivers/net/hippi/rrunner.c | 2 + drivers/net/phy/marvell10g.c | 2 +- drivers/net/virtio_net.c | 20 +- drivers/net/wireguard/device.c | 3 +- drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c | 20 +- drivers/phy/motorola/phy-mapphone-mdm6600.c | 3 +- drivers/phy/samsung/phy-exynos5250-sata.c | 21 +- drivers/phy/ti/phy-am654-serdes.c | 2 +- drivers/phy/ti/phy-omap-usb2.c | 2 +- drivers/pinctrl/mediatek/Kconfig | 1 + drivers/pinctrl/pinctrl-pistachio.c | 6 +- drivers/pinctrl/pinctrl-rockchip.c | 45 +- drivers/pinctrl/qcom/pinctrl-sm6350.c | 16 +- drivers/pinctrl/samsung/Kconfig | 11 +- drivers/pinctrl/stm32/pinctrl-stm32.c | 23 +- drivers/platform/x86/asus-wmi.c | 15 +- drivers/soc/imx/imx8m-blk-ctrl.c | 2 +- drivers/tee/optee/ffa_abi.c | 1 + .../intel/int340x_thermal/int3400_thermal.c | 4 +- drivers/tty/n_gsm.c | 477 ++++++++++++--------- drivers/tty/serial/8250/8250_pci.c | 8 +- drivers/tty/serial/8250/8250_port.c | 2 +- drivers/tty/serial/amba-pl011.c | 9 +- drivers/tty/serial/imx.c | 2 +- drivers/usb/cdns3/cdns3-gadget.c | 7 +- drivers/usb/core/devio.c | 14 +- drivers/usb/core/quirks.c | 6 + drivers/usb/dwc3/core.c | 11 +- drivers/usb/dwc3/drd.c | 11 +- drivers/usb/dwc3/dwc3-pci.c | 8 + drivers/usb/dwc3/gadget.c | 31 +- drivers/usb/gadget/configfs.c | 2 + drivers/usb/gadget/function/uvc_queue.c | 2 + drivers/usb/host/xhci-hub.c | 2 +- drivers/usb/host/xhci-pci.c | 4 +- drivers/usb/host/xhci-ring.c | 1 + drivers/usb/host/xhci-tegra.c | 4 +- drivers/usb/host/xhci.c | 11 + drivers/usb/misc/uss720.c | 3 +- drivers/usb/mtu3/mtu3_dr.c | 6 +- drivers/usb/phy/phy-generic.c | 7 + drivers/usb/serial/cp210x.c | 2 + drivers/usb/serial/option.c | 12 + drivers/usb/serial/whiteheat.c | 5 +- drivers/usb/typec/ucsi/ucsi.c | 24 +- drivers/video/fbdev/udlfb.c | 14 +- fs/btrfs/ctree.h | 1 + fs/btrfs/dev-replace.c | 7 +- fs/btrfs/disk-io.c | 1 + fs/btrfs/extent_io.c | 1 + fs/btrfs/inode.c | 18 +- fs/btrfs/scrub.c | 26 +- fs/btrfs/tree-log.c | 1 + fs/btrfs/volumes.h | 3 + fs/btrfs/zoned.h | 4 +- fs/ceph/caps.c | 4 + fs/cifs/smb2ops.c | 8 + fs/erofs/zdata.c | 12 +- fs/erofs/zdata.h | 2 +- fs/ext4/super.c | 19 +- fs/f2fs/inode.c | 3 +- fs/gfs2/file.c | 30 +- fs/io_uring.c | 5 + fs/kernfs/dir.c | 7 +- fs/ksmbd/smb2pdu.c | 13 +- fs/ksmbd/vfs_cache.c | 1 + fs/zonefs/super.c | 46 +- include/linux/kernel.h | 2 +- include/linux/mtd/mtd.h | 6 +- include/memory/renesas-rpc-if.h | 1 + include/net/bluetooth/hci.h | 1 + include/net/ip6_tunnel.h | 2 +- include/net/ip_tunnels.h | 2 +- include/net/tcp.h | 8 + lib/hexdump.c | 41 +- mm/kasan/quarantine.c | 7 + net/bluetooth/hci_event.c | 65 +-- net/core/lwt_bpf.c | 7 +- net/dsa/port.c | 2 + net/ipv4/ip_gre.c | 12 +- net/ipv4/syncookies.c | 8 +- net/ipv4/tcp_input.c | 15 +- net/ipv4/tcp_minisocks.c | 2 +- net/ipv4/tcp_output.c | 1 + net/ipv4/tcp_rate.c | 11 +- net/ipv6/ip6_gre.c | 16 +- net/ipv6/netfilter.c | 10 +- net/ipv6/syncookies.c | 3 +- net/mctp/device.c | 2 +- net/netfilter/ipvs/ip_vs_conn.c | 2 +- net/netfilter/nf_conntrack_proto_tcp.c | 21 +- net/netfilter/nf_conntrack_standalone.c | 2 +- net/netfilter/nft_set_rbtree.c | 6 +- net/netfilter/nft_socket.c | 52 ++- net/sctp/sm_sideeffect.c | 4 + net/smc/af_smc.c | 2 + net/tls/tls_device.c | 12 +- net/xdp/xsk.c | 2 +- sound/hda/intel-dsp-config.c | 9 + sound/soc/codecs/cs35l41-lib.c | 6 +- sound/soc/codecs/rt5682.c | 9 + sound/soc/codecs/rt711.c | 7 + sound/soc/codecs/wm8731.c | 19 +- sound/soc/intel/boards/sof_es8336.c | 9 + sound/soc/intel/common/soc-acpi-intel-tgl-match.c | 4 +- sound/soc/soc-pcm.c | 2 +- tools/objtool/check.c | 8 +- tools/objtool/elf.c | 189 +++++++- tools/objtool/include/objtool/elf.h | 4 +- tools/perf/arch/arm64/util/machine.c | 21 - tools/perf/arch/powerpc/util/Build | 1 - tools/perf/arch/powerpc/util/machine.c | 25 -- tools/perf/arch/s390/util/machine.c | 16 - tools/perf/util/arm-spe.c | 2 +- tools/perf/util/symbol-elf.c | 2 +- tools/perf/util/symbol.c | 37 +- tools/perf/util/symbol.h | 3 +- tools/testing/selftests/vm/mremap_test.c | 83 +++- 210 files changed, 1998 insertions(+), 1180 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/225 usb: mtu3: fix USB 3.0 dual-role-switch from device to host
From: Macpaul Lin <[email protected]>
commit 456244aeecd54249096362a173dfe06b82a5cafa upstream.
Issue description:
When an OTG port has been switched to device role and then switch back to host role again, the USB 3.0 Host (XHCI) will not be able to detect "plug in event of a connected USB 2.0/1.0 ((Highspeed and Fullspeed) devices until system reboot.
Root cause and Solution:
There is a condition checking flag "ssusb->otg_switch.is_u3_drd" in toggle_opstate(). At the end of role switch procedure, toggle_opstate() will be called to set DC_SESSION and SOFT_CONN bit. If "is_u3_drd" was set and switched the role to USB host 3.0, bit DC_SESSION and SOFT_CONN will be skipped hence caused the port cannot detect connected USB 2.0 (Highspeed and Fullspeed) devices. Simply remove the condition check to solve this issue.
--- drivers/usb/mtu3/mtu3_dr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/usb/mtu3/mtu3_dr.c +2 -4
@@ -21,10 +21,8 @@ static inline struct ssusb_mtk *otg_sx_to_ssusb(struct otg_switch_mtk *otg_sx)static void toggle_opstate (struct ssusb_mtk *ssusb) { -if (!ssusb->otg_switch.is_u3_drd) { -mtu3_setbits (ssusb->mac_base,U3D_DEVICE_CONTROL ,DC_SESSION ); -mtu3_setbits (ssusb->mac_base,U3D_POWER_MANAGEMENT ,SOFT_CONN ); - } +mtu3_setbits (ssusb->mac_base,U3D_DEVICE_CONTROL ,DC_SESSION ); +mtu3_setbits (ssusb->mac_base,U3D_POWER_MANAGEMENT ,SOFT_CONN ); }/* only port0 supports dual-role mode */
Signature · 1 line
2.36.0
Greg Kroah-Hartman
maintainerPATCH 2/225 floppy: disable FDRAWCMD by default
In reply to Greg Kroah-HartmanFrom: Willy Tarreau <[email protected]>
commit 233087ca063686964a53c829d547c7571e3f67bf upstream.
Minh Yuan reported a concurrency use-after-free issue in the floppy code between raw_cmd_ioctl and seek_interrupt.
[ It turns out this has been around, and that others have reported the
KASAN splats over the years, but Minh Yuan had a reproducer for it and
so gets primary credit for reporting it for this fix - Linus ]
The problem is, this driver tends to break very easily and nowadays, nobody is expected to use FDRAWCMD anyway since it was used to manipulate non-standard formats. The risk of breaking the driver is higher than the risk presented by this race, and accessing the device requires privileges anyway.
Let's just add a config option to completely disable this ioctl and leave it disabled by default. Distros shouldn't use it, and only those running on antique hardware might need to enable it.
--- drivers/block/Kconfig | 16 ++++++++++++++++ drivers/block/floppy.c | 43 ++++++++++++++++++++++++++++++++----------- 2 files changed, 48 insertions(+), 11 deletions(-)
drivers/block/Kconfig +16 -0
@@ -33,6 +33,22 @@ config BLK_DEV_FD To compile this driver as a module, choose M here: the module will be called floppy. +config BLK_DEV_FD_RAWCMD + bool "Support for raw floppy disk commands (DEPRECATED)" + depends on BLK_DEV_FD + help + If you want to use actual physical floppies and expect to do + special low-level hardware accesses to them (access and use + non-standard formats, for example), then enable this. + + Note that the code enabled by this option is rarely used and + might be unstable or insecure, and distros should not enable it. + + Note: FDRAWCMD is deprecated and will be removed from the kernel + in the near future. + + If unsure, say N. + config AMIGA_FLOPPY tristate "Amiga floppy support" depends on AMIGA
drivers/block/floppy.c +32 -11
67 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 3/225 USB: quirks: add a Realtek card reader
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit 2a7ccf6bb6f147f64c025ad68f4255d8e1e0ce6d upstream.
This device is reported to stall when enummerated.
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -404,6 +404,9 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x0b05, 0x17e0), .driver_info = USB_QUIRK_IGNORE_REMOTE_WAKEUP }, + /* Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)*/ + { USB_DEVICE(0x0bda, 0x0151), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, + /* Realtek hub in Dell WD19 (Type-C) */ { USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM },
Greg Kroah-Hartman
maintainerPATCH 4/225 USB: quirks: add STRING quirk for VCOM device
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit ec547af8a9ea6441864bad34172676b5652ceb96 upstream.
This has been reported to stall if queried
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -510,6 +510,9 @@ static const struct usb_device_id usb_qu/* DJI CineSSD */ { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, + /* VCOM device */ + { USB_DEVICE(0x4296, 0x7570), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, + /* INTEL VALUE SSD */ { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
Greg Kroah-Hartman
maintainerPATCH 5/225 USB: serial: whiteheat: fix heap overflow in WHITEHEAT_GET_DTR_RTS
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
commit e23e50e7acc8d8f16498e9c129db33e6a00e80eb upstream.
The sizeof(struct whitehat_dr_info) can be 4 bytes under CONFIG_AEABI=n due to "-mabi=apcs-gnu", even though it has a single u8:
whiteheat_private {
__u8 mcr; /* 0 1 */
/* size: 4, cachelines: 1, members: 1 */
/* padding: 3 */
/* last cacheline: 4 bytes */
};The result is technically harmless, as both the source and the destinations are currently the same allocation size (4 bytes) and don't use their padding, but if anything were to ever be added after the "mcr" member in "struct whiteheat_private", it would be overwritten. The structs both have a single u8 "mcr" member, but are 4 bytes in padded size. The memcpy() destination was explicitly targeting the u8 member (size 1) with the length of the whole structure (size 4), triggering the memcpy buffer overflow warning:
In file included from include/linux/string.h:253,
from include/linux/bitmap.h:11,
from include/linux/cpumask.h:12,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:62,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from drivers/usb/serial/whiteheat.c:17:
In function 'fortify_memcpy_chk',
inlined from 'firm_send_command' at drivers/usb/serial/whiteheat.c:587:4:include/linux/fortify-string.h:328:25: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
328 | __write_overflow_field(p_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Instead, just assign the one byte directly.
--- drivers/usb/serial/whiteheat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/serial/whiteheat.c +2 -3
@@ -584,9 +584,8 @@ static int firm_send_command(struct usb_switch (command) {case WHITEHEAT_GET_DTR_RTS : info =usb_get_serial_port_data (port); -memcpy (&info->mcr, command_info->result_buffer, -sizeof (struct whiteheat_dr_info )); -break ; + info->mcr = command_info->result_buffer[0 ]; +break ; } } exit:
Greg Kroah-Hartman
maintainerPATCH 6/225 USB: serial: cp210x: add PIDs for Kamstrup USB Meter Reader
In reply to Greg Kroah-HartmanFrom: Bruno Thomsen <[email protected]>
commit 35a923a0b329c343e9e81d79518e2937eba06fcd upstream.
Wireless reading of water and heat meters using 868 MHz wM-Bus mode C1.
The two different product IDs allow detection of dongle antenna solution:
- Internal antenna
- External antenna using SMA connector
https://www.kamstrup.com/en-en/water-solutions/water-meter-reading/usb-meter-reader
--- drivers/usb/serial/cp210x.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/cp210x.c +2 -0
@@ -194,6 +194,8 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */ { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */ + { USB_DEVICE(0x17A8, 0x0101) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Int Ant) */ + { USB_DEVICE(0x17A8, 0x0102) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Ext Ant) */ { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
Greg Kroah-Hartman
maintainerPATCH 7/225 USB: serial: option: add support for Cinterion MV32-WA/MV32-WB
In reply to Greg Kroah-HartmanFrom: Slark Xiao <[email protected]>
commit b4a64ed6e7b857317070fcb9d87ff5d4a73be3e8 upstream.
Add support for Cinterion device MV32-WA/MV32-WB. MV32-WA PID is 0x00F1, and MV32-WB PID is 0x00F2.
Test evidence as below:
T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=1e2d ProdID=00f1 Rev=05.04 S: Manufacturer=Cinterion S: Product=Cinterion PID 0x00F1 USB Mobile Broadband S: SerialNumber=78ada8c4 C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option I: If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=1e2d ProdID=00f2 Rev=05.04 S: Manufacturer=Cinterion S: Product=Cinterion PID 0x00F2 USB Mobile Broadband S: SerialNumber=cdd06a78 C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option I: If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
Interface 0&1: MBIM, 2:Modem, 3: GNSS, 4: NMEA, 5: Diag GNSS port don't use serial driver.
--- drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/option.c +6 -0
@@ -432,6 +432,8 @@ static void option_instat_callback(struc#define CINTERION_PRODUCT_CLS8 0x00b0#define CINTERION_PRODUCT_MV31_MBIM 0x00b3#define CINTERION_PRODUCT_MV31_RMNET 0x00b7 +#define CINTERION_PRODUCT_MV32_WA 0x00f1 +#define CINTERION_PRODUCT_MV32_WB 0x00f2/* Olivetti products */ #define OLIVETTI_VENDOR_ID 0x0b3c
@@ -1969,6 +1971,10 @@ static const struct usb_device_id option .driver_info = RSVD(3)}, { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff), .driver_info = RSVD(0)}, + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA, 0xff), + .driver_info = RSVD(3)}, + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB, 0xff), + .driver_info = RSVD(3)}, { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100), .driver_info = RSVD(4) }, { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
Greg Kroah-Hartman
maintainerPATCH 8/225 USB: serial: option: add Telit 0x1057, 0x1058, 0x1075 compositions
In reply to Greg Kroah-HartmanFrom: Daniele Palmas <[email protected]>
commit f32c5a0423400e01f4d7c607949fa3a1f006e8fa upstream.
Add support for the following Telit FN980 and FN990 compositions:
0x1057: tty, adb, rmnet, tty, tty, tty, tty, tty0x1058: tty, adb, tty, tty, tty, tty, tty0x1075: adb, tty
--- drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/option.c +6 -0
@@ -1219,6 +1219,10 @@ static const struct usb_device_id option .driver_info = NCTRL(0) | RSVD(1) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1056, 0xff), /* Telit FD980 */ .driver_info = NCTRL(2) | RSVD(3) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1057, 0xff), /* Telit FN980 */ + .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1058, 0xff), /* Telit FN980 (PCIe) */ + .driver_info = NCTRL(0) | RSVD(1) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1060, 0xff), /* Telit LN920 (rmnet) */ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1061, 0xff), /* Telit LN920 (MBIM) */
@@ -1235,6 +1239,8 @@ static const struct usb_device_id option .driver_info = NCTRL(2) | RSVD(3) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990 (ECM) */ .driver_info = NCTRL(0) | RSVD(1) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990 (PCIe) */ + .driver_info = RSVD(0) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
Greg Kroah-Hartman
maintainerPATCH 9/225 usb: xhci: tegra:Fix PM usage reference leak of tegra_xusb_unpowergate_partitions
In reply to Greg Kroah-HartmanFrom: zhangqilong <[email protected]>
commit 8771039482d965bdc8cefd972bcabac2b76944a8 upstream.
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced.
--- drivers/usb/host/xhci-tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/xhci-tegra.c +2 -2
@@ -1034,13 +1034,13 @@ static int tegra_xusb_unpowergate_partitint rc;if (tegra->use_genpd) { - rc =pm_runtime_get_sync (tegra->genpd_dev_ss); + rc =pm_runtime_resume_and_get (tegra->genpd_dev_ss);if (rc <0 ) {dev_err (dev,"failed to enable XUSB SS partition\n" );return rc; } - rc =pm_runtime_get_sync (tegra->genpd_dev_host); + rc =pm_runtime_resume_and_get (tegra->genpd_dev_host);if (rc <0 ) {dev_err (dev,"failed to enable XUSB Host partition\n" );pm_runtime_put_sync (tegra->genpd_dev_ss);
Greg Kroah-Hartman
maintainerPATCH 10/225 xhci: Enable runtime PM on second Alderlake controller
In reply to Greg Kroah-HartmanFrom: Evan Green <[email protected]>
commit d8bfe5091d6cc4b8b8395e4666979ae72a6069ca upstream.
Alderlake has two XHCI controllers with PCI IDs 0x461e and 0x51ed. We had previously added the quirk to default enable runtime PM for 0x461e, now add it for 0x51ed as well.
--- drivers/usb/host/xhci-pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-pci.c +3 -1
@@ -59,6 +59,7 @@#define PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI 0x9a13#define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI 0x1138#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI 0x461e +#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed#define PCI_DEVICE_ID_AMD_RENOIR_XHCI 0x1639#define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9
@@ -266,7 +267,8 @@ static void xhci_pci_quirks(struct devic pdev->device ==PCI_DEVICE_ID_INTEL_ICE_LAKE_XHCI || pdev->device ==PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI || pdev->device ==PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI || - pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI)) + pdev->device ==PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI || + pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI)) xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
Greg Kroah-Hartman
maintainerPATCH 11/225 xhci: stop polling roothubs after shutdown
In reply to Greg Kroah-HartmanFrom: Henry Lin <[email protected]>
commit dc92944a014cd6a6f6c94299aaa36164dd2c238a upstream.
While rebooting, XHCI controller and its bus device will be shut down in order by .shutdown callback. Stopping roothubs polling in xhci_shutdown() can prevent XHCI driver from accessing port status after its bus device shutdown.
Take PCIe XHCI controller as example, if XHCI driver doesn't stop roothubs polling, XHCI driver may access PCIe BAR register for port status after parent PCIe root port driver is shutdown and cause PCIe bus error.
[check shared hcd exist before stopping its roothub polling -Mathias]
--- drivers/usb/host/xhci.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/usb/host/xhci.c +11 -0
@@ -778,6 +778,17 @@ void xhci_shutdown(struct usb_hcd *hcd)if (xhci->quirks &XHCI_SPURIOUS_REBOOT )usb_disable_xhci_ports (to_pci_dev (hcd->self.sysdev)); +/* Don't poll the roothubs after shutdown. */ +xhci_dbg (xhci,"%s: stopping usb%d port polling.\n" , + __func__, hcd->self.busnum); +clear_bit (HCD_FLAG_POLL_RH , &hcd->flags); +del_timer_sync (&hcd->rh_timer); + +if (xhci->shared_hcd) { +clear_bit (HCD_FLAG_POLL_RH , &xhci->shared_hcd->flags); +del_timer_sync (&xhci->shared_hcd->rh_timer); + } +spin_lock_irq (&xhci->lock);xhci_halt (xhci);/* Workaround for spurious wakeups at shutdown with HSW */
Greg Kroah-Hartman
maintainerPATCH 12/225 xhci: increase usb U3 -> U0 link resume timeout from 100ms to 500ms
In reply to Greg Kroah-HartmanFrom: Mathias Nyman <[email protected]>
commit 33597f0c48be0836854d43c577e35c8f8a765a7d upstream.
The first U3 wake signal by the host may be lost if the USB 3 connection is tunneled over USB4, with a runtime suspended USB4 host, and firmware implemented connection manager.
Specs state the host must wait 100ms (tU3WakeupRetryDelay) before resending a U3 wake signal if device doesn't respond, leading to U3 -> U0 link transition times around 270ms in the tunneled case.
--- drivers/usb/host/xhci-hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-hub.c +1 -1
@@ -1434,7 +1434,7 @@ int xhci_hub_control(struct usb_hcd *hcd }spin_unlock_irqrestore (&xhci->lock, flags);if (!wait_for_completion_timeout (&bus_state->u3exit_done[wIndex], -msecs_to_jiffies (100 ))) +msecs_to_jiffies (500 )))xhci_dbg (xhci,"missing U0 port change event for port %d-%d\n" , hcd->self.busnum, wIndex +1 );spin_lock_irqsave (&xhci->lock, flags);
Greg Kroah-Hartman
maintainerPATCH 13/225 iio: dac: ad5592r: Fix the missing return value.
In reply to Greg Kroah-HartmanFrom: Zizhuang Deng <[email protected]>
commit b55b38f7cc12da3b9ef36e7a3b7f8f96737df4d5 upstream.
The third call to fwnode_property_read_u32 did not record the return value, resulting in channel_offstate possibly being assigned the wrong value.
--- drivers/iio/dac/ad5592r-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5592r-base.c +1 -1
@@ -523,7 +523,7 @@ static int ad5592r_alloc_channels(structif (!ret) st->channel_modes[reg] = tmp; -fwnode_property_read_u32 (child,"adi,off-state" , &tmp); + ret =fwnode_property_read_u32 (child,"adi,off-state" , &tmp);if (!ret) st->channel_offstate[reg] = tmp; }
Greg Kroah-Hartman
maintainerPATCH 14/225 iio: scd4x: check return of scd4x_write_and_fetch
In reply to Greg Kroah-HartmanFrom: Tom Rix <[email protected]>
commit f50232193e61cf89a73130b5e843fef30763c428 upstream.
Clang static analysis reports this problem scd4x.c:474:10: warning: The left operand of '==' is a
garbage value
if (val == 0xff) {
~~~ ^val is only set from a successful call to scd4x_write_and_fetch() So check it's return.
--- drivers/iio/chemical/scd4x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/iio/chemical/scd4x.c +4 -1
@@ -471,12 +471,15 @@ static ssize_t calibration_forced_value_store(struct device *dev, ret =scd4x_write_and_fetch (state,CMD_FRC , arg, &val,sizeof (val));mutex_unlock (&state->lock); +if (ret) +return ret; +if (val ==0xff ) {dev_err (dev,"forced calibration has failed" );return -EINVAL ; } -return ret ?: len; +return len; } static IIO_DEVICE_ATTR_RW(calibration_auto_enable, 0);
Signature · 1 line
2.36.0
Greg Kroah-Hartman
maintainerPATCH 15/225 iio: dac: ad5446: Fix read_raw not returning set value
In reply to Greg Kroah-HartmanFrom: Michael Hennerich <[email protected]>
commit 89a01cd688d3c0ac983ef0b0e5f40018ab768317 upstream.
read_raw should return the un-scaled value.
--- drivers/iio/dac/ad5446.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5446.c +1 -1
@@ -178,7 +178,7 @@ static int ad5446_read_raw(struct iio_deswitch (m) {case IIO_CHAN_INFO_RAW : - *val = st->cached_val; + *val = st->cached_val >> chan->scan_type.shift;return IIO_VAL_INT ;case IIO_CHAN_INFO_SCALE : *val = st->vref_mv;
Greg Kroah-Hartman
maintainerPATCH 16/225 iio: magnetometer: ak8975: Fix the error handling in ak8975_power_on()
In reply to Greg Kroah-HartmanFrom: Zheyu Ma <[email protected]>
commit 3a26787dacf04257a68b16315c984eb2c340bc5e upstream.
When the driver fails to enable the regulator 'vid', we will get the following splat:
[ 79.955610] WARNING: CPU: 5 PID: 441 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0 [ 79.959641] RIP: 0010:_regulator_put+0x3ec/0x4e0 [ 79.967570] Call Trace: [ 79.967773] <TASK> [ 79.967951] regulator_put+0x1f/0x30 [ 79.968254] devres_release_group+0x319/0x3d0 [ 79.968608] i2c_device_probe+0x766/0x940
Fix this by disabling the 'vdd' regulator when failing to enable 'vid' regulator.
--- drivers/iio/magnetometer/ak8975.c | 1 + 1 file changed, 1 insertion(+)
drivers/iio/magnetometer/ak8975.c +1 -0
@@ -416,6 +416,7 @@ static int ak8975_power_on(const structif (ret) {dev_warn (&data->client->dev,"Failed to enable specified Vid supply\n" ); +regulator_disable (data->vdd);return ret; }
Greg Kroah-Hartman
maintainerPATCH 17/225 iio: imu: inv_icm42600: Fix I2C init possible nack
In reply to Greg Kroah-HartmanFrom: Fawzi Khaber <[email protected]>
commit b5d6ba09b10d2ccb865ed9bc45941db0a41c6756 upstream.
This register write to REG_INTF_CONFIG6 enables a spike filter that is impacting the line and can prevent the I2C ACK to be seen by the controller. So we don't test the return value.
--- drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +9 -6
@@ -18,12 +18,15 @@ static int inv_icm42600_i2c_bus_setup(stunsigned int mask, val;int ret; -/* setup interface registers */ - ret =regmap_update_bits (st->map,INV_ICM42600_REG_INTF_CONFIG6 , -INV_ICM42600_INTF_CONFIG6_MASK , -INV_ICM42600_INTF_CONFIG6_I3C_EN ); -if (ret) -return ret; +/* +* setup interface registers +* This register write to REG_INTF_CONFIG6 enables a spike filter that +* is impacting the line and can prevent the I2C ACK to be seen by the +* controller. So we don't test the return value. +*/ +regmap_update_bits (st->map,INV_ICM42600_REG_INTF_CONFIG6 , +INV_ICM42600_INTF_CONFIG6_MASK , +INV_ICM42600_INTF_CONFIG6_I3C_EN ); ret =regmap_update_bits (st->map,INV_ICM42600_REG_INTF_CONFIG4 ,INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY ,0 );
Greg Kroah-Hartman
maintainerPATCH 18/225 usb: misc: fix improper handling of refcount in uss720_probe()
In reply to Greg Kroah-HartmanFrom: Hangyu Hua <[email protected]>
commit 0a96fa640dc928da9eaa46a22c46521b037b78ad upstream.
usb_put_dev shouldn't be called when uss720_probe succeeds because of priv->usbdev. At the same time, priv->usbdev shouldn't be set to NULL before destroy_priv in uss720_disconnect because usb_put_dev is in destroy_priv.
Fix this by moving priv->usbdev = NULL after usb_put_dev.
--- drivers/usb/misc/uss720.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/misc/uss720.c +1 -2
@@ -71,6 +71,7 @@ static void destroy_priv(struct kref *krdev_dbg (&priv->usbdev->dev,"destroying priv datastructure\n" );usb_put_dev (priv->usbdev); + priv->usbdev =NULL ;kfree (priv); }
@@ -736,7 +737,6 @@ static int uss720_probe(struct usb_interparport_announce_port (pp);usb_set_intfdata (intf, pp); -usb_put_dev (usbdev);return 0 ; probe_abort:
@@ -754,7 +754,6 @@ static void uss720_disconnect(struct usbusb_set_intfdata (intf,NULL );if (pp) { priv = pp->private_data; - priv->usbdev =NULL ; priv->pp =NULL ;dev_dbg (&intf->dev,"parport_remove_port\n" );parport_remove_port (pp);
Greg Kroah-Hartman
maintainerPATCH 19/225 usb: core: Dont hold the device lock while sleeping in do_proc_control()
In reply to Greg Kroah-HartmanFrom: Tasos Sahanidis <[email protected]>
commit 0543e4e8852ef5ff1809ae62f1ea963e2ab23b66 upstream.
Since commit ae8709b296d8 ("USB: core: Make do_proc_control() and do_proc_bulk() killable") if a device has the USB_QUIRK_DELAY_CTRL_MSG quirk set, it will temporarily block all other URBs (e.g. interrupts) while sleeping due to a control.
This results in noticeable delays when, for example, a userspace usbfs application is sending URB interrupts at a high rate to a keyboard and simultaneously updates the lock indicators using controls. Interrupts with direction set to IN are also affected by this, meaning that delivery of HID reports (containing scancodes) to the usbfs application is delayed as well.
This patch fixes the regression by calling msleep() while the device mutex is unlocked, as was the case originally with usb_control_msg().
--- drivers/usb/core/devio.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/usb/core/devio.c +9 -5
@@ -1197,12 +1197,16 @@ static int do_proc_control(struct usb_deusb_unlock_device (dev); i =usbfs_start_wait_urb (urb, tmo, &actlen); + +/* Linger a bit, prior to the next control message. */ +if (dev->quirks &USB_QUIRK_DELAY_CTRL_MSG ) +msleep (200 );usb_lock_device (dev);snoop_urb (dev,NULL , pipe, actlen, i,COMPLETE , tbuf, actlen);if (!i && actlen) {if (copy_to_user (ctrl->data, tbuf, actlen)) { ret = -EFAULT ; - goto recv_fault; + goto done; } } }else {
@@ -1219,6 +1223,10 @@ static int do_proc_control(struct usb_deusb_unlock_device (dev); i =usbfs_start_wait_urb (urb, tmo, &actlen); + +/* Linger a bit, prior to the next control message. */ +if (dev->quirks &USB_QUIRK_DELAY_CTRL_MSG ) +msleep (200 );usb_lock_device (dev);snoop_urb (dev,NULL , pipe, actlen, i,COMPLETE ,NULL ,0 ); }
@@ -1230,10 +1238,6 @@ static int do_proc_control(struct usb_de } ret = (i <0 ? i : actlen); - recv_fault: -/* Linger a bit, prior to the next control message. */ -if (dev->quirks &USB_QUIRK_DELAY_CTRL_MSG ) -msleep (200 ); done:kfree (dr);usb_free_urb (urb);
Greg Kroah-Hartman
maintainerPATCH 20/225 usb: typec: ucsi: Fix reuse of completion structure
In reply to Greg Kroah-HartmanFrom: Heikki Krogerus <[email protected]>
commit e25adcca917d7e4cdc1dc6444d0692ffda7594bf upstream.
The role swapping completion variable is reused, so it needs to be reinitialised every time. Otherwise it will be marked as done after the first time it's used and completing immediately.
--- drivers/usb/typec/ucsi/ucsi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/typec/ucsi/ucsi.c +4 -0
@@ -949,6 +949,8 @@ static int ucsi_dr_swap(struct typec_por role == TYPEC_HOST)) goto out_unlock; +reinit_completion (&con->complete); + command =UCSI_SET_UOR |UCSI_CONNECTOR_NUMBER (con->num); command |=UCSI_SET_UOR_ROLE (role); command |=UCSI_SET_UOR_ACCEPT_ROLE_SWAPS ;
@@ -985,6 +987,8 @@ static int ucsi_pr_swap(struct typec_porif (cur_role == role) goto out_unlock; +reinit_completion (&con->complete); + command =UCSI_SET_PDR |UCSI_CONNECTOR_NUMBER (con->num); command |=UCSI_SET_PDR_ROLE (role); command |=UCSI_SET_PDR_ACCEPT_ROLE_SWAPS ;
Greg Kroah-Hartman
maintainerPATCH 21/225 usb: typec: ucsi: Fix role swapping
In reply to Greg Kroah-HartmanFrom: Heikki Krogerus <[email protected]>
commit eb5d7ff3cf0d55093c619b5ad107cd5c05ce8134 upstream.
All attempts to swap the roles timed out because the completion was done without releasing the port lock. Fixing that by releasing the lock before starting to wait for the completion.
--- drivers/usb/typec/ucsi/ucsi.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
drivers/usb/typec/ucsi/ucsi.c +13 -7
@@ -958,14 +958,18 @@ static int ucsi_dr_swap(struct typec_porif (ret <0 ) goto out_unlock; +mutex_unlock (&con->lock); +if (!wait_for_completion_timeout (&con->complete, -msecs_to_jiffies (UCSI_SWAP_TIMEOUT_MS ))) - ret = -ETIMEDOUT ; +msecs_to_jiffies (UCSI_SWAP_TIMEOUT_MS ))) +return -ETIMEDOUT ; + +return 0 ; out_unlock:mutex_unlock (&con->lock); -return ret <0 ? ret :0 ; +return ret; }static int ucsi_pr_swap (struct typec_port *port,enum typec_role role)
@@ -996,11 +1000,13 @@ static int ucsi_pr_swap(struct typec_porif (ret <0 ) goto out_unlock; +mutex_unlock (&con->lock); +if (!wait_for_completion_timeout (&con->complete, -msecs_to_jiffies (UCSI_SWAP_TIMEOUT_MS ))) { - ret = -ETIMEDOUT ; - goto out_unlock; - } +msecs_to_jiffies (UCSI_SWAP_TIMEOUT_MS ))) +return -ETIMEDOUT ; + +mutex_lock (&con->lock);/* Something has gone wrong while swapping the role */ if (UCSI_CONSTAT_PWR_OPMODE(con->status.flags) !=
Greg Kroah-Hartman
maintainerPATCH 22/225 usb: gadget: uvc: Fix crash when encoding data for usb request
In reply to Greg Kroah-HartmanFrom: Dan Vacura <[email protected]>
commit 71d471e3faf90c9674cadc7605ac719e82cb7fac upstream.
During the uvcg_video_pump() process, if an error occurs and uvcg_queue_cancel() is called, the buffer queue will be cleared out, but the current marker (queue->buf_used) of the active buffer (no longer active) is not reset. On the next iteration of uvcg_video_pump() the stale buf_used count will be used and the logic of min((unsigned int)len, buf->bytesused - queue->buf_used) may incorrectly calculate a nbytes size, causing an invalid memory access.
[80802.185460][ T315] configfs-gadget gadget: uvc: VS request completed with status -18. [80802.185519][ T315] configfs-gadget gadget: uvc: VS request completed
with status -18.
...uvcg_queue_cancel() is called and the queue is cleared out, but the marker queue->buf_used is not reset.
...
[80802.262328][ T8682] Unable to handle kernel paging request at virtual address ffffffc03af9f000 ... ... [80802.263138][ T8682] Call trace: [80802.263146][ T8682] __memcpy+0x12c/0x180 [80802.263155][ T8682] uvcg_video_pump+0xcc/0x1e0 [80802.263165][ T8682] process_one_work+0x2cc/0x568 [80802.263173][ T8682] worker_thread+0x28c/0x518 [80802.263181][ T8682] kthread+0x160/0x170 [80802.263188][ T8682] ret_from_fork+0x10/0x18 [80802.263198][ T8682] Code: a8c12829 a88130cb a8c130
--- drivers/usb/gadget/function/uvc_queue.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/gadget/function/uvc_queue.c +2 -0
@@ -264,6 +264,8 @@ void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect) buf->state =UVC_BUF_STATE_ERROR ;vb2_buffer_done (&buf->buf.vb2_buf,VB2_BUF_STATE_ERROR ); } + queue->buf_used =0 ; +/* This must be protected by the irqlock spinlock to avoid race * conditions between uvc_queue_buffer and the disconnection event that * could result in an interruptible wait in uvc_dequeue_buffer. Do not
Signature · 1 line
2.36.0
Greg Kroah-Hartman
maintainerPATCH 23/225 usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind()
In reply to Greg Kroah-HartmanFrom: Vijayavardhan Vennapusa <[email protected]>
commit bf95c4d4630c7a2c16e7b424fdea5177d9ce0864 upstream.
If any function like UVC is deactivating gadget as part of composition switch which results in not calling pullup enablement, it is not getting enabled after switch to new composition due to this deactivation flag not cleared. This results in USB enumeration not happening after switch to new USB composition. Hence clear deactivation flag inside gadget structure in configfs_composite_unbind() before switch to new USB composition.
--- drivers/usb/gadget/configfs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/gadget/configfs.c +2 -0
@@ -1434,6 +1434,8 @@ static void configfs_composite_unbind(stusb_ep_autoconfig_reset (cdev->gadget);spin_lock_irqsave (&gi->spinlock, flags); cdev->gadget =NULL ; + cdev->deactivations =0 ; + gadget->deactivated = false;set_gadget_data (gadget,NULL );spin_unlock_irqrestore (&gi->spinlock, flags); }
Greg Kroah-Hartman
maintainerPATCH 24/225 usb: dwc3: Try usb-role-switch first in dwc3_drd_init
In reply to Greg Kroah-HartmanFrom: Sven Peter <[email protected]>
commit ab7aa2866d295438dc60522f85c5421c6b4f1507 upstream.
If the PHY controller node has a "port" dwc3 tries to find an extcon device even when "usb-role-switch" is present. This happens because dwc3_get_extcon() sees that "port" node and then calls extcon_find_edev_by_node() which will always return EPROBE_DEFER in that case.
On the other hand, even if an extcon was present and dwc3_get_extcon() was successful it would still be ignored in favor of "usb-role-switch".
Let's just first check if "usb-role-switch" is configured in the device tree and directly use it instead and only try to look for an extcon device otherwise.
--- drivers/usb/dwc3/drd.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/usb/dwc3/drd.c +5 -6
@@ -571,16 +571,15 @@ int dwc3_drd_init(struct dwc3 *dwc) {int ret, irq; +if (ROLE_SWITCH && +device_property_read_bool (dwc->dev,"usb-role-switch" )) +return dwc3_setup_role_switch (dwc); + dwc->edev =dwc3_get_extcon (dwc);if (IS_ERR (dwc->edev))return PTR_ERR (dwc->edev); -if (ROLE_SWITCH && -device_property_read_bool (dwc->dev,"usb-role-switch" )) { - ret =dwc3_setup_role_switch (dwc); -if (ret <0 ) -return ret; - }else if (dwc->edev) { +if (dwc->edev) { dwc->edev_nb.notifier_call = dwc3_drd_notifier; ret =extcon_register_notifier (dwc->edev,EXTCON_USB_HOST , &dwc->edev_nb);
Greg Kroah-Hartman
maintainerPATCH 25/225 usb: dwc3: core: Fix tx/rx threshold settings
In reply to Greg Kroah-HartmanFrom: Thinh Nguyen <[email protected]>
commit f28ad9069363dec7deb88032b70612755eed9ee6 upstream.
The current driver logic checks against 0 to determine whether the periodic tx/rx threshold settings are set, but we may get bogus values from uninitialized variables if no device property is set. Properly default these variables to 0.
--- drivers/usb/dwc3/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/dwc3/core.c +4 -4
@@ -1295,10 +1295,10 @@ static void dwc3_get_properties(struct du8 lpm_nyet_threshold;u8 tx_de_emphasis;u8 hird_threshold; -u8 rx_thr_num_pkt_prd; -u8 rx_max_burst_prd; -u8 tx_thr_num_pkt_prd; -u8 tx_max_burst_prd; +u8 rx_thr_num_pkt_prd =0 ; +u8 rx_max_burst_prd =0 ; +u8 tx_thr_num_pkt_prd =0 ; +u8 tx_max_burst_prd =0 ;u8 tx_fifo_resize_max_num;const char *usb_psy_name;int ret;
Greg Kroah-Hartman
maintainerPATCH 26/225 usb: dwc3: core: Only handle soft-reset in DCTL
In reply to Greg Kroah-HartmanFrom: Thinh Nguyen <[email protected]>
commit f4fd84ae0765a80494b28c43b756a95100351a94 upstream.
Make sure not to set run_stop bit or link state change request while initiating soft-reset. Register read-modify-write operation may unintentionally start the controller before the initialization completes with its previous DCTL value, which can cause initialization failure.
--- drivers/usb/dwc3/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/dwc3/core.c +2 -1
@@ -276,7 +276,8 @@ static int dwc3_core_soft_reset(struct d reg =dwc3_readl (dwc->regs,DWC3_DCTL ); reg |=DWC3_DCTL_CSFTRST ; -dwc3_writel (dwc->regs,DWC3_DCTL , reg); + reg &= ~DWC3_DCTL_RUN_STOP ; +dwc3_gadget_dctl_write_safe (dwc, reg);/* * For DWC_usb31 controller 1.90a and later, the DCTL.CSFRST bit
Greg Kroah-Hartman
maintainerPATCH 27/225 usb: dwc3: gadget: Return proper request status
In reply to Greg Kroah-HartmanFrom: Thinh Nguyen <[email protected]>
commit c7428dbddcf4ea1919e1c8e15f715b94ca359268 upstream.
If the user sets the usb_request's no_interrupt, then there will be no completion event for the request. Currently the driver incorrectly uses the event status of a different request to report the status for a request with no_interrupt. The dwc3 driver needs to check the TRB status associated with the request when reporting its status.
Note: this is only applicable to missed_isoc TRB completion status, but the other status are also listed for completeness/documentation.
--- drivers/usb/dwc3/gadget.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
drivers/usb/dwc3/gadget.c +30 -1
@@ -3229,6 +3229,7 @@ static int dwc3_gadget_ep_cleanup_compleconst struct dwc3_event_depevt *event, struct dwc3_request *req, int status) { + int request_status;int ret;if (req->request.num_mapped_sgs)
@@ -3249,7 +3250,35 @@ static int dwc3_gadget_ep_cleanup_comple req->needs_extra_trb = false; } -dwc3_gadget_giveback (dep, req, status); +/* +* The event status only reflects the status of the TRB with IOC set. +* For the requests that don't set interrupt on completion, the driver +* needs to check and return the status of the completed TRBs associated +* with the request. Use the status of the last TRB of the request. +*/ +if (req->request.no_interrupt) { +struct dwc3_trb *trb; + + trb =dwc3_ep_prev_trb (dep, dep->trb_dequeue); +switch (DWC3_TRB_SIZE_TRBSTS (trb->size)) { +case DWC3_TRBSTS_MISSED_ISOC : +/* Isoc endpoint only */ + request_status = -EXDEV ; +break ; +case DWC3_TRB_STS_XFER_IN_PROG : +/* Applicable when End Transfer with ForceRM=0 */ +case DWC3_TRBSTS_SETUP_PENDING : +/* Control endpoint only */ +case DWC3_TRBSTS_OK : +default : + request_status =0 ; +break ; + } + }else { + request_status = status; + } + +dwc3_gadget_giveback (dep, req, request_status); out:return ret;
Greg Kroah-Hartman
maintainerPATCH 28/225 usb: dwc3: pci: add support for the Intel Meteor Lake-P
In reply to Greg Kroah-HartmanFrom: Heikki Krogerus <[email protected]>
commit 973e0f7a847ef13ade840d4c30729ce329a66895 upstream.
This patch adds the necessary PCI IDs for Intel Meteor Lake-P devices.
--- drivers/usb/dwc3/dwc3-pci.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/usb/dwc3/dwc3-pci.c +8 -0
@@ -44,6 +44,8 @@#define PCI_DEVICE_ID_INTEL_ADLM 0x54ee#define PCI_DEVICE_ID_INTEL_ADLS 0x7ae1#define PCI_DEVICE_ID_INTEL_RPLS 0x7a61 +#define PCI_DEVICE_ID_INTEL_MTLP 0x7ec1 +#define PCI_DEVICE_ID_INTEL_MTL 0x7e7e#define PCI_DEVICE_ID_INTEL_TGL 0x9a15#define PCI_DEVICE_ID_AMD_MR 0x163a
@@ -421,6 +423,12 @@ static const struct pci_device_id dwc3_p {PCI_VDEVICE (INTEL ,PCI_DEVICE_ID_INTEL_RPLS ), (kernel_ulong_t) &dwc3_pci_intel_swnode, }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MTLP), + (kernel_ulong_t) &dwc3_pci_intel_swnode, }, + + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MTL), + (kernel_ulong_t) &dwc3_pci_intel_swnode, }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_TGL), (kernel_ulong_t) &dwc3_pci_intel_swnode, },
Greg Kroah-Hartman
maintainerPATCH 29/225 usb: cdns3: Fix issue for clear halt endpoint
In reply to Greg Kroah-HartmanFrom: Pawel Laszczak <[email protected]>
commit b3fa25de31fb7e9afebe9599b8ff32eda13d7c94 upstream.
Path fixes bug which occurs during resetting endpoint in __cdns3_gadget_ep_clear_halt function. During resetting endpoint controller will change HW/DMA owned TRB. It set Abort flag in trb->control and will change trb->length field. If driver want to use the aborted trb it must update the changed field in TRB.
--- drivers/usb/cdns3/cdns3-gadget.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/usb/cdns3/cdns3-gadget.c +5 -2
@@ -2684,6 +2684,7 @@ int __cdns3_gadget_ep_clear_halt(structstruct usb_request *request;struct cdns3_request *priv_req;struct cdns3_trb *trb =NULL ; +struct cdns3_trb trb_tmp;int ret;int val;
@@ -2693,8 +2694,10 @@ int __cdns3_gadget_ep_clear_halt(structif (request) { priv_req =to_cdns3_request (request); trb = priv_req->trb; -if (trb) +if (trb) { + trb_tmp = *trb; trb->control = trb->control ^cpu_to_le32 (TRB_CYCLE ); + } }writel (EP_CMD_CSTALL |EP_CMD_EPRST , &priv_dev->regs->ep_cmd);
@@ -2709,7 +2712,7 @@ int __cdns3_gadget_ep_clear_halt(structif (request) {if (trb) - trb->control = trb->control ^cpu_to_le32 (TRB_CYCLE ); + *trb = trb_tmp;cdns3_rearm_transfer (priv_ep,1 ); }
Greg Kroah-Hartman
maintainerPATCH 30/225 usb: phy: generic: Get the vbus supply
In reply to Greg Kroah-HartmanFrom: Sean Anderson <[email protected]>
commit 03e607cbb2931374db1825f371e9c7f28526d3f4 upstream.
While support for working with a vbus was added, the regulator was never actually gotten (despite what was documented). Fix this by actually getting the supply from the device tree.
--- drivers/usb/phy/phy-generic.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/phy/phy-generic.c +7 -0
@@ -268,6 +268,13 @@ int usb_phy_gen_create_phy(struct devicereturn -EPROBE_DEFER ; } + nop->vbus_draw =devm_regulator_get_exclusive (dev,"vbus" ); +if (PTR_ERR (nop->vbus_draw) == -ENODEV ) + nop->vbus_draw =NULL ; +if (IS_ERR (nop->vbus_draw)) +return dev_err_probe (dev,PTR_ERR (nop->vbus_draw), +"could not get vbus regulator\n" ); + nop->dev = dev; nop->phy.dev = nop->dev; nop->phy.label ="nop-xceiv" ;
Greg Kroah-Hartman
maintainerPATCH 31/225 kernfs: fix NULL dereferencing in kernfs_remove
In reply to Greg Kroah-HartmanFrom: Minchan Kim <[email protected]>
commit ad8d869343ae4a07a2038a4ca923f699308c8323 upstream.
kernfs_remove supported NULL kernfs_node param to bail out but revent per-fs lock change introduced regression that dereferencing the param without NULL check so kernel goes crash.
This patch checks the NULL kernfs_node in kernfs_remove and if so, just return.
Quote from bug report by Jirka
``` The bug is triggered by running NAS Parallel benchmark suite on SuperMicro servers with 2x Xeon(R) Gold 6126 CPU. Here is the error log: [ 247.035564] BUG: kernel NULL pointer dereference, address: 0000000000000008 [ 247.036009] #PF: supervisor read access in kernel mode [ 247.036009] #PF: error_code(0x0000) - not-present page [ 247.036009] PGD 0 P4D 0 [ 247.036009] Oops: 0000 [#1] PREEMPT SMP PTI [ 247.058060] CPU: 1 PID: 6546 Comm: umount Not tainted 5.16.0393c3714081a53795bbff0e985d24146def6f57f+ #16 [ 247.058060] Hardware name: Supermicro Super Server/X11DDW-L, BIOS 2.0b 03/07/2018 [ 247.058060] RIP: 0010:kernfs_remove+0x8/0x50 [ 247.058060] Code: 4c 89 e0 5b 5d 41 5c 41 5d 41 5e c3 49 c7 c4 f4 ff ff ff eb b2 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f 1f 44 00 00 41 54 55 <48> 8b 47 08 48 89 fd 48 85 c0 48 0f 44 c7 4c 8b 60 50 49 83 c4 60 [ 247.058060] RSP: 0018:ffffbbfa48a27e48 EFLAGS: 00010246 [ 247.058060] RAX: 0000000000000001 RBX: ffffffff89e31f98 RCX: 0000000080200018 [ 247.058060] RDX: 0000000080200019 RSI: fffff6760786c900 RDI: 0000000000000000 [ 247.058060] RBP: ffffffff89e31f98 R08: ffff926b61b24d00 R09: 0000000080200018 [ 247.122048] R10: ffff926b61b24d00 R11: ffff926a8040c000 R12: ffff927bd09a2000 [ 247.122048] R13: ffffffff89e31fa0 R14: dead000000000122 R15: dead000000000100 [ 247.122048] FS: 00007f01be0a8c40(0000) GS:ffff926fa8e40000(0000) knlGS:0000000000000000 [ 247.122048] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 247.122048] CR2: 0000000000000008 CR3: 00000001145c6003 CR4: 00000000007706e0 [ 247.122048] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 247.122048] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 247.122048] PKRU: 55555554 [ 247.122048] Call Trace: [ 247.122048] <TASK> [ 247.122048] rdt_kill_sb+0x29d/0x350 [ 247.122048] deactivate_locked_super+0x36/0xa0 [ 247.122048] cleanup_mnt+0x131/0x190 [ 247.122048] task_work_run+0x5c/0x90 [ 247.122048] exit_to_user_mode_prepare+0x229/0x230 [ 247.122048] syscall_exit_to_user_mode+0x18/0x40 [ 247.122048] do_syscall_64+0x48/0x90 [ 247.122048] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 247.122048] RIP: 0033:0x7f01be2d735b ```
--- fs/kernfs/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/kernfs/dir.c +6 -1
@@ -1397,7 +1397,12 @@ static void __kernfs_remove(struct kernf*/ void kernfs_remove (struct kernfs_node *kn) { -struct kernfs_root *root =kernfs_root (kn); +struct kernfs_root *root; + +if (!kn) +return ; + + root =kernfs_root (kn);down_write (&root->kernfs_rwsem);__kernfs_remove (kn);
Greg Kroah-Hartman
maintainerPATCH 32/225 binder: Gracefully handle BINDER_TYPE_FDA objects with num_fds=0
In reply to Greg Kroah-HartmanFrom: Alessandro Astone <[email protected]>
commit ef38de9217a04c9077629a24652689d8fdb4c6c6 upstream.
Some android userspace is sending BINDER_TYPE_FDA objects with num_fds=0. Like the previous patch, this is reproducible when playing a video.
Before commit 09184ae9b575 BINDER_TYPE_FDA objects with num_fds=0 were 'correctly handled', as in no fixup was performed.
After commit 09184ae9b575 we aggregate fixup and skip regions in binder_ptr_fixup structs and distinguish between the two by using the skip_size field: if it's 0, then it's a fixup, otherwise skip. When processing BINDER_TYPE_FDA objects with num_fds=0 we add a skip region of skip_size=0, and this causes issues because now binder_do_deferred_txn_copies will think this was a fixup region.
To address that, return early from binder_translate_fd_array to avoid adding an empty skip region.
--- drivers/android/binder.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/android/binder.c +3 -0
@@ -2486,6 +2486,9 @@ static int binder_translate_fd_array(strstruct binder_proc *proc = thread->proc;int ret; +if (fda->num_fds ==0 ) +return 0 ; + fd_buf_size =sizeof (u32) * fda->num_fds;if (fda->num_fds >=SIZE_MAX /sizeof (u32)) { binder_user_error("%d:%d got transaction with invalid number of fds (%lld)\n",
Greg Kroah-Hartman
maintainerPATCH 33/225 binder: Address corner cases in deferred copy and fixup
In reply to Greg Kroah-HartmanFrom: Alessandro Astone <[email protected]>
commit 2d1746e3fda0c3612143d7c06f8e1d1830c13e23 upstream.
When handling BINDER_TYPE_FDA object we are pushing a parent fixup with a certain skip_size but no scatter-gather copy object, since the copy is handled standalone.
If BINDER_TYPE_FDA is the last children the scatter-gather copy loop will never stop to skip it, thus we are left with an item in the parent fixup list. This will trigger the BUG_ON().
This is reproducible in android when playing a video. We receive a transaction that looks like this:
obj[0] BINDER_TYPE_PTR, parent
obj[1] BINDER_TYPE_PTR, child
obj[2] BINDER_TYPE_PTR, child
obj[3] BINDER_TYPE_FDA, child
--- drivers/android/binder.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/android/binder.c +6 -1
@@ -2295,6 +2295,7 @@ static int binder_do_deferred_txn_copies {int ret =0 ;struct binder_sg_copy *sgc, *tmpsgc; +struct binder_ptr_fixup *tmppf;struct binder_ptr_fixup *pf = list_first_entry_or_null(pf_head, struct binder_ptr_fixup, node);
@@ -2349,7 +2350,11 @@ static int binder_do_deferred_txn_copieslist_del (&sgc->node);kfree (sgc); } -BUG_ON (!list_empty (pf_head)); +list_for_each_entry_safe (pf, tmppf, pf_head, node) { +BUG_ON (pf->skip_size ==0 ); +list_del (&pf->node); +kfree (pf); + }BUG_ON (!list_empty (sgc_head));return ret >0 ? -EINVAL : ret;
Greg Kroah-Hartman
maintainerPATCH 34/225 serial: imx: fix overrun interrupts in DMA mode
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 3ee82c6e41f3d2212647ce0bc5a05a0f69097824 upstream.
Commit 76821e222c18 ("serial: imx: ensure that RX irqs are off if RX is off") accidentally enabled overrun interrupts unconditionally when deferring DMA enable until after the receiver has been enabled during startup.
Fix this by using the DMA-initialised instead of DMA-enabled flag to determine whether overrun interrupts should be enabled.
Note that overrun interrupts are already accounted for in imx_uart_clear_rx_errors() when using DMA since commit 41d98b5da92f ("serial: imx-serial - update RX error counters when DMA is used").
--- drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/imx.c +1 -1
@@ -1438,7 +1438,7 @@ static int imx_uart_startup(struct uart_imx_uart_writel (sport, ucr1,UCR1 ); ucr4 =imx_uart_readl (sport,UCR4 ) & ~(UCR4_OREN |UCR4_INVR ); -if (!sport->dma_is_enabled) +if (!dma_is_inited) ucr4 |=UCR4_OREN ;if (sport->inverted_rx) ucr4 |=UCR4_INVR ;
Greg Kroah-Hartman
maintainerPATCH 35/225 serial: amba-pl011: do not time out prematurely when draining tx fifo
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
commit 0e4deb56b0c625efdb70c94f150429e2f2a16fa1 upstream.
The current timeout for draining the tx fifo in RS485 mode is calculated by multiplying the time it takes to transmit one character (with the given baud rate) with the maximal number of characters in the tx queue.
This timeout is too short for two reasons:
First when calculating the time to transmit one character integer division is used which may round down the result in case of a remainder of the division.
Fix this by rounding up the division result.
Second the hardware may need additional time (e.g for first putting the characters from the fifo into the shift register) before the characters are actually put onto the wire.
To be on the safe side double the current maximum number of iterations that are used to wait for the queue draining.
--- drivers/tty/serial/amba-pl011.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/tty/serial/amba-pl011.c +7 -2
@@ -1255,13 +1255,18 @@ static inline bool pl011_dma_rx_running(static void pl011_rs485_tx_stop (struct uart_amba_port *uap) { +/* +* To be on the safe side only time out after twice as many iterations +* as fifo size. +*/ +const int MAX_TX_DRAIN_ITERS = uap->port.fifosize *2 ;struct uart_port *port = &uap->port;int i =0 ;u32 cr;/* Wait until hardware tx queue is empty */ while (!pl011_tx_empty (port)) { -if (i == port->fifosize) { +if (i >MAX_TX_DRAIN_ITERS ) {dev_warn (port->dev,"timeout while draining hardware tx queue\n" );break ;
@@ -2052,7 +2057,7 @@ pl011_set_termios(struct uart_port *port* with the given baud rate. We use this as the poll interval when we * wait for the tx queue to empty. */ - uap->rs485_tx_drain_interval = (bits *1000 *1000 ) / baud; + uap->rs485_tx_drain_interval =DIV_ROUND_UP (bits *1000 *1000 , baud);pl011_setup_status_masks (port, termios);
Greg Kroah-Hartman
maintainerPATCH 36/225 serial: 8250: Also set sticky MCR bits in console restoration
In reply to Greg Kroah-HartmanFrom: Maciej W. Rozycki <[email protected]>
commit 6e6eebdf5e2455f089ccd000754a0deaeb79af82 upstream.
Sticky MCR bits are lost in console restoration if console suspending has been disabled. This currently affects the AFE bit, which works in combination with RTS which we set, so we want to make sure the UART retains control of its FIFO where previously requested. Also specific drivers may need other bits in the future.
--- drivers/tty/serial/8250/8250_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_port.c +1 -1
@@ -3340,7 +3340,7 @@ static void serial8250_console_restore(sserial8250_set_divisor (port, baud, quot, frac);serial_port_out (port,UART_LCR , up->lcr); -serial8250_out_MCR (up,UART_MCR_DTR |UART_MCR_RTS ); +serial8250_out_MCR (up, up->mcr |UART_MCR_DTR |UART_MCR_RTS ); }/*
Greg Kroah-Hartman
maintainerPATCH 37/225 serial: 8250: Correct the clock for EndRun PTP/1588 PCIe device
In reply to Greg Kroah-HartmanFrom: Maciej W. Rozycki <[email protected]>
commit 637674fa40059cddcc3ad2212728965072f62ea3 upstream.
The EndRun PTP/1588 dual serial port device is based on the Oxford Semiconductor OXPCIe952 UART device with the PCI vendor:device ID set for EndRun Technologies and is therefore driven by a fixed 62.5MHz clock input derived from the 100MHz PCI Express clock. The clock rate is divided by the oversampling rate of 16 as it is supplied to the baud rate generator, yielding the baud base of 3906250.
Replace the incorrect baud base of 4000000 with the right value of 3906250 then, complementing commit 6cbe45d8ac93 ("serial: 8250: Correct the clock for OxSemi PCIe devices").
--- drivers/tty/serial/8250/8250_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/serial/8250/8250_pci.c +4 -4
@@ -2667,7 +2667,7 @@ enum pci_board_num_t { pbn_panacom2, pbn_panacom4, pbn_plx_romulus, - pbn_endrun_2_4000000, + pbn_endrun_2_3906250, pbn_oxsemi, pbn_oxsemi_1_3906250, pbn_oxsemi_2_3906250,
@@ -3195,10 +3195,10 @@ static struct pciserial_board pci_boards* signal now many ports are available * 2 port 952 Uart support */ - [pbn_endrun_2_4000000] = { + [pbn_endrun_2_3906250] = { .flags = FL_BASE0, .num_ports = 2, - .base_baud = 4000000, + .base_baud = 3906250, .uart_offset = 0x200, .first_offset = 0x1000, },
@@ -4115,7 +4115,7 @@ static const struct pci_device_id serial*/ {PCI_VENDOR_ID_ENDRUN ,PCI_DEVICE_ID_ENDRUN_1588 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , - pbn_endrun_2_4000000 }, + pbn_endrun_2_3906250 },/* * Quatech cards. These actually have configurable clocks but for * now we just use the default.
Greg Kroah-Hartman
maintainerPATCH 38/225 eeprom: at25: Use DMA safe buffers
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit 5b47b751b760ee1c74a51660fd096aa148a362cd upstream.
Reading EEPROM fails with following warning:
[ 16.357496] ------------[ cut here ]------------ [ 16.357529] fsl_spi b01004c0.spi: rejecting DMA map of vmalloc memory [ 16.357698] WARNING: CPU: 0 PID: 371 at include/linux/dma-mapping.h:326 fsl_spi_cpm_bufs+0x2a0/0x2d8 [ 16.357775] CPU: 0 PID: 371 Comm: od Not tainted 5.16.11-s3k-dev-01743-g19beecbfe9d6-dirty #109 [ 16.357806] NIP: c03fbc9c LR: c03fbc9c CTR: 00000000 [ 16.357825] REGS: e68d9b20 TRAP: 0700 Not tainted (5.16.11-s3k-dev-01743-g19beecbfe9d6-dirty) [ 16.357849] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 24002282 XER: 00000000 [ 16.357931] [ 16.357931] GPR00: c03fbc9c e68d9be0 c26d06a0 00000039 00000001 c0d36364 c0e96428 00000027 [ 16.357931] GPR08: 00000001 00000000 00000023 3fffc000 24002282 100d3dd6 100a2ffc 00000000 [ 16.357931] GPR16: 100cd280 100b0000 00000000 aff54f7e 100d0000 100d0000 00000001 100cf328 [ 16.357931] GPR24: 100cf328 00000000 00000003 e68d9e30 c156b410 e67ab4c0 e68d9d38 c24ab278 [ 16.358253] NIP [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8 [ 16.358292] LR [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8 [ 16.358325] Call Trace: [ 16.358336] [e68d9be0] [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8 (unreliable) [ 16.358388] [e68d9c00] [c03fcb44] fsl_spi_bufs.isra.0+0x94/0x1a0 [ 16.358436] [e68d9c20] [c03fd970] fsl_spi_do_one_msg+0x254/0x3dc [ 16.358483] [e68d9cb0] [c03f7e50] __spi_pump_messages+0x274/0x8a4 [ 16.358529] [e68d9ce0] [c03f9d30] __spi_sync+0x344/0x378 [ 16.358573] [e68d9d20] [c03fb52c] spi_sync+0x34/0x60 [ 16.358616] [e68d9d30] [c03b4dec] at25_ee_read+0x138/0x1a8 [ 16.358667] [e68d9e50] [c04a8fb8] bin_attr_nvmem_read+0x98/0x110 [ 16.358725] [e68d9e60] [c0204b14] kernfs_fop_read_iter+0xc0/0x1fc [ 16.358774] [e68d9e80] [c0168660] vfs_read+0x284/0x410 [ 16.358821] [e68d9f00] [c016925c] ksys_read+0x6c/0x11c [ 16.358863] [e68d9f30] [c00160e0] ret_from_syscall+0x0/0x28 ... [ 16.359608] ---[ end trace a4ce3e34afef0cb5 ]--- [ 16.359638] fsl_spi b01004c0.spi: unable to map tx dma
This is due to the AT25 driver using buffers on stack, which is not possible with CONFIG_VMAP_STACK.
As mentionned in kernel Documentation (Documentation/spi/spi-summary.rst):
- Follow standard kernel rules, and provide DMA-safe buffers in your messages. That way controller drivers using DMA aren't forced to make extra copies unless the hardware requires it (e.g. working around hardware errata that force the use of bounce buffering).
Modify the driver to use a buffer located in the at25 device structure which is allocated via kmalloc during probe.
Protect writes in this new buffer with the driver's mutex.
--- drivers/misc/eeprom/at25.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/misc/eeprom/at25.c +11 -8
@@ -31,6 +31,8 @@*/ #define FM25_SN_LEN 8/* serial number length */ +#define EE_MAXADDRLEN 3/* 24 bit addresses, up to 2 MBytes */ +struct at25_data {struct spi_eeprom chip;struct spi_device *spi;
@@ -39,6 +41,7 @@ struct at25_data {struct nvmem_config nvmem_config;struct nvmem_device *nvmem;u8 sernum[FM25_SN_LEN ]; +u8 command[EE_MAXADDRLEN +1 ]; };#define AT25_WREN 0x06/* latch the write enable */
@@ -61,8 +64,6 @@ struct at25_data {#define FM25_ID_LEN 9/* ID length */ -#define EE_MAXADDRLEN 3/* 24 bit addresses, up to 2 MBytes */ -/* * Specs often allow 5ms for a page write, sometimes 20ms; * it's important to recover from write timeouts.
@@ -78,7 +79,6 @@ static int at25_ee_read(void *priv, unsi {struct at25_data *at25 = priv;char *buf = val; -u8 command[EE_MAXADDRLEN +1 ];u8 *cp;ssize_t status;struct spi_transfer t[2 ];
@@ -92,12 +92,15 @@ static int at25_ee_read(void *priv, unsiif (unlikely (!count))return -EINVAL ; - cp = command; + cp = at25->command; instr =AT25_READ ;if (at25->chip.flags &EE_INSTR_BIT3_IS_ADDR )if (offset >=BIT (at25->addrlen *8 )) instr |=AT25_INSTR_BIT3 ; + +mutex_lock (&at25->lock); + *cp++ = instr;/* 8/16/24-bit address is written MSB first */
@@ -116,7 +119,7 @@ static int at25_ee_read(void *priv, unsispi_message_init (&m);memset (t,0 ,sizeof (t)); - t[0 ].tx_buf = command; + t[0 ].tx_buf = at25->command; t[0 ].len = at25->addrlen +1 ;spi_message_add_tail (&t[0 ], &m);
@@ -124,8 +127,6 @@ static int at25_ee_read(void *priv, unsi t[1 ].len = count;spi_message_add_tail (&t[1 ], &m); -mutex_lock (&at25->lock); -/* * Read it all at once. *
@@ -152,7 +153,7 @@ static int fm25_aux_read(struct at25_datspi_message_init (&m);memset (t,0 ,sizeof (t)); - t[0 ].tx_buf = &command; + t[0 ].tx_buf = at25->command; t[0 ].len =1 ;spi_message_add_tail (&t[0 ], &m);
@@ -162,6 +163,8 @@ static int fm25_aux_read(struct at25_datmutex_lock (&at25->lock); + at25->command[0 ] = command; + status =spi_sync (at25->spi, &m);dev_dbg (&at25->spi->dev,"read %d aux bytes --> %d\n" , len, status);
Greg Kroah-Hartman
maintainerPATCH 39/225 arch_topology: Do not set llc_sibling if llc_id is invalid
In reply to Greg Kroah-HartmanFrom: Wang Qing <[email protected]>
commit 1dc9f1a66e1718479e1c4f95514e1750602a3cb9 upstream.
When ACPI is not enabled, cpuid_topo->llc_id = cpu_topo->llc_id = -1, which will set llc_sibling 0xff(...), this is misleading.
Don't set llc_sibling(default 0) if we don't know the cache topology.
--- drivers/base/arch_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/arch_topology.c +1 -1
@@ -645,7 +645,7 @@ void update_siblings_masks(unsigned intfor_each_online_cpu (cpu) { cpu_topo = &cpu_topology[cpu]; -if (cpuid_topo->llc_id == cpu_topo->llc_id) { +if (cpu_topo->llc_id !=-1 && cpuid_topo->llc_id == cpu_topo->llc_id) {cpumask_set_cpu (cpu, &cpuid_topo->llc_sibling);cpumask_set_cpu (cpuid, &cpu_topo->llc_sibling); }
Greg Kroah-Hartman
maintainerPATCH 40/225 topology: make core_mask include at least cluster_siblings
In reply to Greg Kroah-HartmanFrom: Darren Hart <[email protected]>
commit db1e59483dfd8d4e956575302520bb8f7e20c79b upstream.
Ampere Altra defines CPU clusters in the ACPI PPTT. They share a Snoop Control Unit, but have no shared CPU-side last level cache.
cpu_coregroup_mask() will return a cpumask with weight 1, while cpu_clustergroup_mask() will return a cpumask with weight 2.
As a result, build_sched_domain() will BUG() once per CPU with:
BUG: arch topology borken
the CLS domain not a subset of the MC domain
The MC level cpumask is then extended to that of the CLS child, and is later removed entirely as redundant. This sched domain topology is an improvement over previous topologies, or those built without SCHED_CLUSTER, particularly for certain latency sensitive workloads. With the current scheduler model and heuristics, this is a desirable default topology for Ampere Altra and Altra Max system.
Rather than create a custom sched domains topology structure and introduce new logic in arch/arm64 to detect these systems, update the core_mask so coregroup is never a subset of clustergroup, extending it to cluster_siblings if necessary. Only do this if CONFIG_SCHED_CLUSTER is enabled to avoid also changing the topology (MC) when CONFIG_SCHED_CLUSTER is disabled.
This has the added benefit over a custom topology of working for both symmetric and asymmetric topologies. It does not address systems where the CLUSTER topology is above a populated MC topology, but these are not considered today and can be addressed separately if and when they appear.
The final sched domain topology for a 2 socket Ampere Altra system is unchanged with or without CONFIG_SCHED_CLUSTER, and the BUG is avoided:
For CPU0:
CONFIG_SCHED_CLUSTER=y
CLS [0-1]
DIE [0-79]
NUMA [0-159]
CONFIG_SCHED_CLUSTER is not set
DIE [0-79]
NUMA [0-159]
--- drivers/base/arch_topology.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/base/arch_topology.c +9 -0
@@ -628,6 +628,15 @@ const struct cpumask *cpu_coregroup_mask core_mask = &cpu_topology[cpu].llc_sibling; } +/* +* For systems with no shared cpu-side LLC but with clusters defined, +* extend core_mask to cluster_siblings. The sched domain builder will +* then remove MC as redundant with CLS if SCHED_CLUSTER is enabled. +*/ +if (IS_ENABLED (CONFIG_SCHED_CLUSTER ) && +cpumask_subset (core_mask, &cpu_topology[cpu].cluster_sibling)) + core_mask = &cpu_topology[cpu].cluster_sibling; +return core_mask; }
Greg Kroah-Hartman
maintainerPATCH 41/225 ceph: fix possible NULL pointer dereference for req->r_session
In reply to Greg Kroah-HartmanFrom: Xiubo Li <[email protected]>
commit 7acae6183cf37c48b8da48bbbdb78820fb3913f3 upstream.
The request will be inserted into the ci->i_unsafe_dirops before assigning the req->r_session, so it's possible that we will hit NULL pointer dereference bug here.
Cc: [email protected]
URL: https://tracker.ceph.com/issues/55327
--- fs/ceph/caps.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ceph/caps.c +4 -0
@@ -2267,6 +2267,8 @@ retry:list_for_each_entry (req, &ci->i_unsafe_dirops, r_unsafe_dir_item) { s = req->r_session; +if (!s) +continue ;if (unlikely (s->s_mds >= max_sessions)) {spin_unlock (&ci->i_unsafe_lock);for (i =0 ; i < max_sessions; i++) {
@@ -2287,6 +2289,8 @@ retry:list_for_each_entry (req, &ci->i_unsafe_iops, r_unsafe_target_item) { s = req->r_session; +if (!s) +continue ;if (unlikely (s->s_mds >= max_sessions)) {spin_unlock (&ci->i_unsafe_lock);for (i =0 ; i < max_sessions; i++) {
Greg Kroah-Hartman
maintainerPATCH 42/225 bus: mhi: host: pci_generic: Add missing poweroff() PM callback
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
commit e64d5fa5044f225ac87d96a7e4be11389999c4c6 upstream.
During hibernation process, once thaw() stage completes, the MHI endpoint devices will be in M0 state post recovery. After that, the devices will be powered down so that the system can enter the target sleep state. During this stage, the PCI core will put the devices in D3hot. But this transition is allowed by the MHI spec. The devices can only enter D3hot when it is in M3 state.
So for fixing this issue, let's add the poweroff() callback that will get executed before putting the system in target sleep state during hibernation. This callback will power down the device properly so that it could be restored during restore() or thaw() stage.
--- drivers/bus/mhi/pci_generic.c | 1 + 1 file changed, 1 insertion(+)
drivers/bus/mhi/pci_generic.c +1 -0
@@ -1085,6 +1085,7 @@ static const struct dev_pm_ops mhi_pci_p .resume = mhi_pci_resume, .freeze = mhi_pci_freeze, .thaw = mhi_pci_restore, + .poweroff = mhi_pci_freeze, .restore = mhi_pci_restore,#endif };
Greg Kroah-Hartman
maintainerPATCH 43/225 bus: mhi: host: pci_generic: Flush recovery worker during freeze
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
commit c38f83bae4037023827c85e045841d0421f85034 upstream.
It is possible that the recovery work might be running while the freeze gets executed (during hibernation etc.,). Currently, we don't powerdown the stack if it is not up but if the recovery work completes after freeze, then the device will be up afterwards. This will not be a sane situation.
So let's flush the recovery worker before trying to powerdown the device.
--- drivers/bus/mhi/pci_generic.c | 1 + 1 file changed, 1 insertion(+)
drivers/bus/mhi/pci_generic.c +1 -0
@@ -1060,6 +1060,7 @@ static int __maybe_unused mhi_pci_freeze* the intermediate restore kernel reinitializes MHI device with new * context. */ +flush_work (&mhi_pdev->recovery_work);if (test_and_clear_bit (MHI_PCI_DEV_STARTED , &mhi_pdev->status)) {mhi_power_down (mhi_cntrl, true);mhi_unprepare_after_power_down (mhi_cntrl);
Greg Kroah-Hartman
maintainerPATCH 44/225 arm64: dts: imx8mm-venice: fix spi2 pin configuration
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit dc900431337f5f861e3cc47ec5be5a69db40ee34 upstream.
Due to what looks like a copy-paste error, the ECSPI2_MISO pad is not muxed for SPI mode and causes reads from a slave-device connected to the SPI header to always return zero.
Configure the ECSPI2_MISO pad for SPI mode on the gw71xx, gw72xx and gw73xx families of boards that got this wrong.
--- arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi +1 -1
@@ -166,7 +166,7 @@ fsl,pins = < MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6 MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0xd6 - MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6 + MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0xd6 MX8MM_IOMUXC_ECSPI2_SS0_GPIO5_IO13 0xd6 >; };
arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi +1 -1
@@ -231,7 +231,7 @@ fsl,pins = < MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6 MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0xd6 - MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6 + MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0xd6 MX8MM_IOMUXC_ECSPI2_SS0_GPIO5_IO13 0xd6 >; };
arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi +1 -1
@@ -280,7 +280,7 @@ fsl,pins = < MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6 MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0xd6 - MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6 + MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0xd6 MX8MM_IOMUXC_ECSPI2_SS0_GPIO5_IO13 0xd6 >; };
Greg Kroah-Hartman
maintainerPATCH 45/225 pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit ac875df4d854ab13d9c4af682a1837a1214fecec upstream.
The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB. ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8 Exynos selects only the latter leading to possible wrong configuration on ARMv8 build:
WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS
Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y]) Selected by [y]:
- ARCH_EXYNOS [=y]
Always select the GPIOLIB from the Samsung pinctrl drivers to fix the issue. This requires removing of OF_GPIO dependency (to avoid recursive dependency), so add dependency on OF for COMPILE_TEST cases.
--- arch/arm/mach-exynos/Kconfig | 1 - drivers/pinctrl/samsung/Kconfig | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-)
arch/arm/mach-exynos/Kconfig +0 -1
@@ -17,7 +17,6 @@ menuconfig ARCH_EXYNOS select EXYNOS_PMU select EXYNOS_SROM select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS - select GPIOLIB select HAVE_ARM_ARCH_TIMER if ARCH_EXYNOS5 select HAVE_ARM_SCU if SMP select PINCTRL
drivers/pinctrl/samsung/Kconfig +4 -7
@@ -4,14 +4,13 @@ # config PINCTRL_SAMSUNG bool - depends on OF_GPIO + select GPIOLIB select PINMUX select PINCONF config PINCTRL_EXYNOS bool "Pinctrl common driver part for Samsung Exynos SoCs" - depends on OF_GPIO - depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST + depends on ARCH_EXYNOS || ARCH_S5PV210 || (COMPILE_TEST && OF) select PINCTRL_SAMSUNG select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210) select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS
@@ -26,12 +25,10 @@ config PINCTRL_EXYNOS_ARM64 config PINCTRL_S3C24XX bool "Samsung S3C24XX SoC pinctrl driver" - depends on OF_GPIO - depends on ARCH_S3C24XX || COMPILE_TEST + depends on ARCH_S3C24XX || (COMPILE_TEST && OF) select PINCTRL_SAMSUNG config PINCTRL_S3C64XX bool "Samsung S3C64XX SoC pinctrl driver" - depends on OF_GPIO - depends on ARCH_S3C64XX || COMPILE_TEST + depends on ARCH_S3C64XX || (COMPILE_TEST && OF) select PINCTRL_SAMSUNG
Greg Kroah-Hartman
maintainerPATCH 46/225 f2fs: should not truncate blocks during roll-forward recovery
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
commit 4d8ec91208196e0e19195f1e7d6be9de5873f242 upstream.
If the file preallocated blocks and fsync'ed, we should not truncate them during roll-forward recovery which will recover i_size correctly back.
--- fs/f2fs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/inode.c +2 -1
@@ -550,7 +550,8 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino) }f2fs_set_inode_flags (inode); -if (file_should_truncate (inode)) { +if (file_should_truncate (inode) && + !is_sbi_flag_set (sbi,SBI_POR_DOING )) { ret =f2fs_truncate (inode);if (ret) goto bad_inode;
Signature · 1 line
2.36.0
Greg Kroah-Hartman
maintainerPATCH 47/225 hex2bin: make the function hex_to_bin constant-time
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
commit e5be15767e7e284351853cbaba80cde8620341fb upstream.
The function hex2bin is used to load cryptographic keys into device mapper targets dm-crypt and dm-integrity. It should take constant time independent on the processed data, so that concurrently running unprivileged code can't infer any information about the keys via microarchitectural convert channels.
This patch changes the function hex_to_bin so that it contains no branches and no memory accesses.
Note that this shouldn't cause performance degradation because the size of the new function is the same as the size of the old function (on x86-64) - and the new function causes no branch misprediction penalties.
I compile-tested this function with gcc on aarch64 alpha arm hppa hppa64 i386 ia64 m68k mips32 mips64 powerpc powerpc64 riscv sh4 s390x sparc32 sparc64 x86_64 and with clang on aarch64 arm hexagon i386 mips32 mips64 powerpc powerpc64 s390x sparc32 sparc64 x86_64 to verify that there are no branches in the generated code.
--- include/linux/kernel.h | 2 +- lib/hexdump.c | 32 +++++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-)
include/linux/kernel.h +1 -1
@@ -280,7 +280,7 @@ static inline char *hex_byte_pack_upper(return buf; } -extern int hex_to_bin (char ch); +extern int hex_to_bin (unsigned char ch);extern int __must_check hex2bin (u8 *dst,const char *src,size_t count);extern char *bin2hex (char *dst,const void *src,size_t count);
lib/hexdump.c +25 -7
@@ -22,15 +22,33 @@ EXPORT_SYMBOL(hex_asc_upper);* * hex_to_bin() converts one hex digit to its actual value or -1 in case of bad * input. +* +* This function is used to load cryptographic keys, so it is coded in such a +* way that there are no conditions or memory accesses that depend on data. +* +* Explanation of the logic: +* (ch - '9' - 1) is negative if ch <= '9' +* ('0' - 1 - ch) is negative if ch >= '0' +* we "and" these two values, so the result is negative if ch is in the range +* '0' ... '9' +* we are only interested in the sign, so we do a shift ">> 8"; note that right +* shift of a negative value is implementation-defined, so we cast the +* value to (unsigned) before the shift --- we have 0xffffff if ch is in +* the range '0' ... '9', 0 otherwise +* we "and" this value with (ch - '0' + 1) --- we have a value 1 ... 10 if ch is +* in the range '0' ... '9', 0 otherwise +* we add this value to -1 --- we have a value 0 ... 9 if ch is in the range '0' +* ... '9', -1 otherwise +* the next line is similar to the previous one, but we need to decode both +* uppercase and lowercase letters, so we use (ch & 0xdf), which converts +* lowercase to uppercase */ -int hex_to_bin (char ch) +int hex_to_bin (unsigned char ch) { -if ((ch >='0' ) && (ch <='9' )) -return ch -'0' ; - ch =tolower (ch); -if ((ch >='a' ) && (ch <='f' )) -return ch -'a' +10 ; -return -1 ; +unsigned char cu = ch &0xdf ; +return -1 + + ((ch -'0' +1 ) & (unsigned )((ch -'9' -1 ) & ('0' -1 - ch)) >>8 ) + + ((cu -'A' +11 ) & (unsigned )((cu -'F' -1 ) & ('A' -1 - cu)) >>8 ); }EXPORT_SYMBOL (hex_to_bin);
Greg Kroah-Hartman
maintainerPATCH 48/225 hex2bin: fix access beyond string end
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
commit e4d8a29997731b3bb14059024b24df9f784288d0 upstream.
If we pass too short string to "hex2bin" (and the string size without the terminating NUL character is even), "hex2bin" reads one byte after the terminating NUL character. This patch fixes it.
Note that hex_to_bin returns -1 on error and hex2bin return -EINVAL on error - so we can't just return the variable "hi" or "lo" on error. This inconsistency may be fixed in the next merge window, but for the purpose of fixing this bug, we just preserve the existing behavior and return -1 and -EINVAL.
--- lib/hexdump.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
lib/hexdump.c +6 -3
@@ -63,10 +63,13 @@ EXPORT_SYMBOL(hex_to_bin);int hex2bin (u8 *dst,const char *src,size_t count) {while (count--) { -int hi =hex_to_bin (*src++); -int lo =hex_to_bin (*src++); +int hi, lo; -if ((hi <0 ) || (lo <0 )) + hi =hex_to_bin (*src++); +if (unlikely (hi <0 )) +return -EINVAL ; + lo =hex_to_bin (*src++); +if (unlikely (lo <0 ))return -EINVAL ; *dst++ = (hi <<4 ) | lo;
Greg Kroah-Hartman
maintainerPATCH 49/225 bus: fsl-mc-msi: Fix MSI descriptor mutex lock for msi_first_desc()
In reply to Greg Kroah-HartmanFrom: Shin'ichiro Kawasaki <[email protected]>
commit c7d2f89fea26c84d5accc55d9976dd7e5305e63a upstream.
Commit e8604b1447b4 introduced a call to the helper function msi_first_desc(), which needs MSI descriptor mutex lock before call. However, the required mutex lock was not added. This results in lockdep assertion:
WARNING: CPU: 4 PID: 119 at kernel/irq/msi.c:274 msi_first_desc+0xd0/0x10c msi_first_desc+0xd0/0x10c fsl_mc_msi_domain_alloc_irqs+0x7c/0xc0 fsl_mc_populate_irq_pool+0x80/0x3cc
Fix this by adding the mutex lock and unlock around the function call.
--- drivers/bus/fsl-mc/fsl-mc-msi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/bus/fsl-mc/fsl-mc-msi.c +5 -1
@@ -224,8 +224,12 @@ int fsl_mc_msi_domain_alloc_irqs(struct device *dev, unsigned int irq_count)if (error)return error; +msi_lock_descs (dev);if (msi_first_desc (dev,MSI_DESC_ALL )) -return -EINVAL ; + error = -EINVAL ; +msi_unlock_descs (dev); +if (error) +return error;/* * NOTE: Calling this function will trigger the invocation of the
Signature · 1 line
2.36.0
Greg Kroah-Hartman
maintainerPATCH 50/225 riscv: patch_text: Fixup last cpu should be master
In reply to Greg Kroah-HartmanFrom: Guo Ren <[email protected]>
commit 8ec1442953c66a1d8462cccd8c20b7ba561f5915 upstream.
These patch_text implementations are using stop_machine_cpuslocked infrastructure with atomic cpu_count. The original idea: When the master CPU patch_text, the others should wait for it. But current implementation is using the first CPU as master, which couldn't guarantee the remaining CPUs are waiting. This patch changes the last CPU as the master to solve the potential risk.
--- arch/riscv/kernel/patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/patch.c +1 -1
@@ -104,7 +104,7 @@ static int patch_text_cb(void *data)struct patch_insn *patch = data;int ret =0 ; -if (atomic_inc_return (&patch->cpu_count) ==1 ) { +if (atomic_inc_return (&patch->cpu_count) ==num_online_cpus ()) { ret =patch_text_nosync (patch->addr, &patch->insn,GET_INSN_LENGTH (patch->insn));
Greg Kroah-Hartman
maintainerPATCH 51/225 x86/cpu: Load microcode during restore_processor_state()
In reply to Greg Kroah-HartmanFrom: Borislav Petkov <[email protected]>
commit f9e14dbbd454581061c736bf70bf5cbb15ac927c upstream.
When resuming from system sleep state, restore_processor_state() restores the boot CPU MSRs. These MSRs could be emulated by microcode. If microcode is not loaded yet, writing to emulated MSRs leads to unchecked MSR access error:
...
PM: Calling lapic_suspend+0x0/0x210
unchecked MSR access error: WRMSR to 0x10f (tried to write 0x0...0) at rIP: ... (native_write_msr)
Call Trace:
<TASK>
? restore_processor_state
x86_acpi_suspend_lowlevel
acpi_suspend_enter
suspend_devices_and_enter
pm_suspend.cold
state_store
kobj_attr_store
sysfs_kf_write
kernfs_fop_write_iter
new_sync_write
vfs_write
ksys_write
__x64_sys_write
do_syscall_64
entry_SYSCALL_64_after_hwframe
RIP: 0033:0x7fda13c260a7To ensure microcode emulated MSRs are available for restoration, load the microcode on the boot CPU before restoring these MSRs.
[ Pawan: write commit message and productize it. ]
--- arch/x86/include/asm/microcode.h | 2 ++ arch/x86/kernel/cpu/microcode/core.c | 6 +++--- arch/x86/power/cpu.c | 10 +++++++++- 3 files changed, 14 insertions(+), 4 deletions(-)
arch/x86/include/asm/microcode.h +2 -0
@@ -131,10 +131,12 @@ extern void __init load_ucode_bsp(void);extern void load_ucode_ap (void );void reload_early_microcode (void );extern bool initrd_gone; +void microcode_bsp_resume (void );#else static inline void __init load_ucode_bsp (void ) { }static inline void load_ucode_ap (void ) { }static inline void reload_early_microcode (void ) { } +static inline void microcode_bsp_resume (void ) { }#endif #endif /* _ASM_X86_MICROCODE_H */
arch/x86/kernel/cpu/microcode/core.c +3 -3
@@ -758,9 +758,9 @@ static struct subsys_interface mc_cpu_in };/** -* mc_bp_resume - Update boot CPU microcode during resume. +* microcode_bsp_resume - Update boot CPU microcode during resume. */ -static void mc_bp_resume (void ) +void microcode_bsp_resume (void ) {int cpu =smp_processor_id ();struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
@@ -772,7 +772,7 @@ static void mc_bp_resume(void) }static struct syscore_ops mc_syscore_ops = { - .resume = mc_bp_resume, + .resume = microcode_bsp_resume, };static int mc_cpu_starting (unsigned int cpu)
arch/x86/power/cpu.c +9 -1
@@ -25,6 +25,7 @@#include <asm/cpu.h> #include <asm/mmu_context.h> #include <asm/cpu_device_id.h> +#include <asm/microcode.h> #ifdef CONFIG_X86_32 __visible unsigned long saved_context_ebx;
@@ -262,11 +263,18 @@ static void notrace __restore_processor_ x86_platform.restore_sched_clock_state ();mtrr_bp_restore ();perf_restore_debug_store (); -msr_restore_context (ctxt); c = &cpu_data (smp_processor_id ());if (cpu_has (c,X86_FEATURE_MSR_IA32_FEAT_CTL ))init_ia32_feat_ctl (c); + +microcode_bsp_resume (); + +/* +* This needs to happen after the microcode has been updated upon resume +* because some of the MSRs are "emulated" in microcode. +*/ +msr_restore_context (ctxt); }/* Needed by apm.c */
Greg Kroah-Hartman
maintainerPATCH 52/225 x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests
In reply to Greg Kroah-HartmanFrom: Thomas Gleixner <[email protected]>
commit 7e0815b3e09986d2fe651199363e135b9358132a upstream.
When a XEN_HVM guest uses the XEN PIRQ/Eventchannel mechanism, then PCI/MSI[-X] masking is solely controlled by the hypervisor, but contrary to XEN_PV guests this does not disable PCI/MSI[-X] masking in the PCI/MSI layer.
This can lead to a situation where the PCI/MSI layer masks an MSI[-X] interrupt and the hypervisor grants the write despite the fact that it already requested the interrupt. As a consequence interrupt delivery on the affected device is not happening ever.
Set pci_msi_ignore_mask to prevent that like it's done for XEN_PV guests already.
--- arch/x86/pci/xen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/x86/pci/xen.c +5 -1
@@ -467,7 +467,6 @@ static __init void xen_setup_pci_msi(voielse xen_msi_ops.setup_msi_irqs = xen_setup_msi_irqs; xen_msi_ops.teardown_msi_irqs = xen_pv_teardown_msi_irqs; - pci_msi_ignore_mask =1 ; }else if (xen_hvm_domain ()) { xen_msi_ops.setup_msi_irqs = xen_hvm_setup_msi_irqs; xen_msi_ops.teardown_msi_irqs = xen_teardown_msi_irqs;
@@ -481,6 +480,11 @@ static __init void xen_setup_pci_msi(voi* in allocating the native domain and never use it. */ x86_init.irqs.create_pci_msi_domain = xen_create_pci_msi_domain; +/* +* With XEN PIRQ/Eventchannels in use PCI/MSI[-X] masking is solely +* controlled by the hypervisor. +*/ + pci_msi_ignore_mask = 1; }#else /* CONFIG_PCI_MSI */
Greg Kroah-Hartman
maintainerPATCH 53/225 iocost: dont reset the inuse weight of under-weighted debtors
In reply to Greg Kroah-HartmanFrom: Tejun Heo <[email protected]>
commit 8c936f9ea11ec4e35e288810a7503b5c841a355f upstream.
When an iocg is in debt, its inuse weight is owned by debt handling and should stay at 1. This invariant was broken when determining the amount of surpluses at the beginning of donation calculation - when an iocg's hierarchical weight is too low, the iocg is excluded from donation calculation and its inuse is reset to its active regardless of its indebtedness, triggering warnings like the following:
WARNING: CPU: 5 PID: 0 at block/blk-iocost.c:1416 iocg_kick_waitq+0x392/0x3a0 ... RIP: 0010:iocg_kick_waitq+0x392/0x3a0 Code: 00 00 be ff ff ff ff 48 89 4d a8 e8 98 b2 70 00 48 8b 4d a8 85 c0 0f 85 4a fe ff ff 0f 0b e9 43 fe ff ff 0f 0b e9 4d fe ff ff <0f> 0b e9 50 fe ff ff e8 a2 ae 70 00 66 90 0f 1f 44 00 00 55 48 89 RSP: 0018:ffffc90000200d08 EFLAGS: 00010016 ... <IRQ> ioc_timer_fn+0x2e0/0x1470 call_timer_fn+0xa1/0x2c0 ...
As this happens only when an iocg's hierarchical weight is negligible, its impact likely is limited to triggering the warnings. Fix it by skipping resetting inuse of under-weighted debtors.
--- block/blk-iocost.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
block/blk-iocost.c +11 -1
@@ -2322,7 +2322,17 @@ static void ioc_timer_fn(struct timer_li iocg->hweight_donating = hwa; iocg->hweight_after_donation = new_hwi;list_add (&iocg->surplus_list, &surpluses); - }else { + }else if (!iocg->abs_vdebt) { +/* +* @iocg doesn't have enough to donate. Reset +* its inuse to active. +* +* Don't reset debtors as their inuse's are +* owned by debt handling. This shouldn't affect +* donation calculuation in any meaningful way +* as @iocg doesn't have a meaningful amount of +* share anyway. +*/ TRACE_IOCG_PATH (inuse_shortage, iocg, &now, iocg->inuse, iocg->active, iocg->hweight_inuse, new_hwi);
Greg Kroah-Hartman
maintainerPATCH 54/225 virtio_net: fix wrong buf address calculation when using xdp
In reply to Greg Kroah-HartmanFrom: Nikolay Aleksandrov <[email protected]>
commit acb16b395c3f3d7502443e0c799c2b42df645642 upstream.
We received a report[1] of kernel crashes when Cilium is used in XDP mode with virtio_net after updating to newer kernels. After investigating the reason it turned out that when using mergeable bufs with an XDP program which adjusts xdp.data or xdp.data_meta page_to_buf() calculates the build_skb address wrong because the offset can become less than the headroom so it gets the address of the previous page (-X bytes depending on how lower offset is):
page_to_skb: page addr ffff9eb2923e2000 buf ffff9eb2923e1ffc offset 252 headroom 256
This is a pr_err() I added in the beginning of page_to_skb which clearly shows offset that is less than headroom by adding 4 bytes of metadata via an xdp prog. The calculations done are:
receive_mergeable():
headroom = VIRTIO_XDP_HEADROOM; // VIRTIO_XDP_HEADROOM == 256 bytes offset = xdp.data - page_address(xdp_page) -
vi->hdr_len - metasize;
page_to_skb():
p = page_address(page) + offset;
...
buf = p - headroom;
Now buf goes -4 bytes from the page's starting address as can be seen above which is set as skb->head and skb->data by build_skb later. Depending on what's done with the skb (when it's freed most often) we get all kinds of corruptions and BUG_ON() triggers in mm[2]. We have to recalculate the new headroom after the xdp program has run, similar to how offset and len are recalculated. Headroom is directly related to data_hard_start, data and data_meta, so we use them to get the new size. The result is correct (similar pr_err() in page_to_skb, one case of xdp_page and one case of virtnet buf):
a) Case with 4 bytes of metadata
[ 115.949641] page_to_skb: page addr ffff8b4dcfad2000 offset 252 headroom 252 [ 121.084105] page_to_skb: page addr ffff8b4dcf018000 offset 20732 headroom 252 b) Case of pushing data +32 bytes [ 153.181401] page_to_skb: page addr ffff8b4dd0c4d000 offset 288 headroom 288 [ 158.480421] page_to_skb: page addr ffff8b4dd00b0000 offset 24864 headroom 288 c) Case of pushing data -33 bytes [ 835.906830] page_to_skb: page addr ffff8b4dd3270000 offset 223 headroom 223 [ 840.839910] page_to_skb: page addr ffff8b4dcdd68000 offset 12511 headroom 223
Offset and headroom are equal because offset points to the start of reserved bytes for the virtio_net header which are at buf start + headroom, while data points at buf start + vnet hdr size + headroom so when data or data_meta are adjusted by the xdp prog both the headroom size and the offset change equally. We can use data_hard_start to compute the new headroom after the xdp prog (linearized / page start case, the virtnet buf case is similar just with bigger base offset):
xdp.data_hard_start = page_address + vnet_hdr
xdp.data = page_address + vnet_hdr + headroom
new headroom after xdp prog = xdp.data - xdp.data_hard_start - metasize
An example reproducer xdp prog[3] is below.
[1] https://github.com/cilium/cilium/issues/19453
[2] Two of the many traces:
[ 40.437400] BUG: Bad page state in process swapper/0 pfn:14940 [ 40.916726] BUG: Bad page state in process systemd-resolve pfn:053b7 [ 41.300891] kernel BUG at include/linux/mm.h:720! [ 41.301801] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 41.302784] CPU: 1 PID: 1181 Comm: kubelet Kdump: loaded Tainted: G B W 5.18.0-rc1+ #37 [ 41.304458] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1.fc35 04/01/2014 [ 41.306018] RIP: 0010:page_frag_free+0x79/0xe0 [ 41.306836] Code: 00 00 75 ea 48 8b 07 a9 00 00 01 00 74 e0 48 8b 47 48 48 8d 50 ff a8 01 48 0f 45 fa eb d0 48 c7 c6 18 b8 30 a6 e8 d7 f8 fc ff <0f> 0b 48 8d 78 ff eb bc 48 8b 07 a9 00 00 01 00 74 3a 66 90 0f b6 [ 41.310235] RSP: 0018:ffffac05c2a6bc78 EFLAGS: 00010292 [ 41.311201] RAX: 000000000000003e RBX: 0000000000000000 RCX: 0000000000000000 [ 41.312502] RDX: 0000000000000001 RSI: ffffffffa6423004 RDI: 00000000ffffffff [ 41.313794] RBP: ffff993c98823600 R08: 0000000000000000 R09: 00000000ffffdfff [ 41.315089] R10: ffffac05c2a6ba68 R11: ffffffffa698ca28 R12: ffff993c98823600 [ 41.316398] R13: ffff993c86311ebc R14: 0000000000000000 R15: 000000000000005c [ 41.317700] FS: 00007fe13fc56740(0000) GS:ffff993cdd900000(0000) knlGS:0000000000000000 [ 41.319150] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 41.320152] CR2: 000000c00008a000 CR3: 0000000014908000 CR4: 0000000000350ee0 [ 41.321387] Call Trace: [ 41.321819] <TASK> [ 41.322193] skb_release_data+0x13f/0x1c0 [ 41.322902] __kfree_skb+0x20/0x30 [ 41.343870] tcp_recvmsg_locked+0x671/0x880 [ 41.363764] tcp_recvmsg+0x5e/0x1c0 [ 41.384102] inet_recvmsg+0x42/0x100 [ 41.406783] ? sock_recvmsg+0x1d/0x70 [ 41.428201] sock_read_iter+0x84/0xd0 [ 41.445592] ? 0xffffffffa3000000 [ 41.462442] new_sync_read+0x148/0x160 [ 41.479314] ? 0xffffffffa3000000 [ 41.496937] vfs_read+0x138/0x190 [ 41.517198] ksys_read+0x87/0xc0 [ 41.535336] do_syscall_64+0x3b/0x90 [ 41.551637] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 41.568050] RIP: 0033:0x48765b [ 41.583955] Code: e8 4a 35 fe ff eb 88 cc cc cc cc cc cc cc cc e8 fb 7a fe ff 48 8b 7c 24 10 48 8b 74 24 18 48 8b 54 24 20 48 8b 44 24 08 0f 05 <48> 3d 01 f0 ff ff 76 20 48 c7 44 24 28 ff ff ff ff 48 c7 44 24 30 [ 41.632818] RSP: 002b:000000c000a2f5b8 EFLAGS: 00000212 ORIG_RAX: 0000000000000000 [ 41.664588] RAX: ffffffffffffffda RBX: 000000c000062000 RCX: 000000000048765b [ 41.681205] RDX: 0000000000005e54 RSI: 000000c000e66000 RDI: 0000000000000016 [ 41.697164] RBP: 000000c000a2f608 R08: 0000000000000001 R09: 00000000000001b4 [ 41.713034] R10: 00000000000000b6 R11: 0000000000000212 R12: 00000000000000e9 [ 41.728755] R13: 0000000000000001 R14: 000000c000a92000 R15: ffffffffffffffff [ 41.744254] </TASK> [ 41.758585] Modules linked in: br_netfilter bridge veth netconsole virtio_net
and
[ 33.524802] BUG: Bad page state in process systemd-network pfn:11e60 [ 33.528617] page ffffe05dc0147b00 ffffe05dc04e7a00 ffff8ae9851ec000 (1) len 82 offset 252 metasize 4 hroom 0 hdr_len 12 data ffff8ae9851ec10c data_meta ffff8ae9851ec108 data_end ffff8ae9851ec14e [ 33.529764] page:000000003792b5ba refcount:0 mapcount:-512 mapping:0000000000000000 index:0x0 pfn:0x11e60 [ 33.532463] flags: 0xfffffc0000000(node=0|zone=1|lastcpupid=0x1fffff) [ 33.532468] raw: 000fffffc0000000 0000000000000000 dead000000000122 0000000000000000 [ 33.532470] raw: 0000000000000000 0000000000000000 00000000fffffdff 0000000000000000 [ 33.532471] page dumped because: nonzero mapcount [ 33.532472] Modules linked in: br_netfilter bridge veth netconsole virtio_net [ 33.532479] CPU: 0 PID: 791 Comm: systemd-network Kdump: loaded Not tainted 5.18.0-rc1+ #37 [ 33.532482] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1.fc35 04/01/2014 [ 33.532484] Call Trace: [ 33.532496] <TASK> [ 33.532500] dump_stack_lvl+0x45/0x5a [ 33.532506] bad_page.cold+0x63/0x94 [ 33.532510] free_pcp_prepare+0x290/0x420 [ 33.532515] free_unref_page+0x1b/0x100 [ 33.532518] skb_release_data+0x13f/0x1c0 [ 33.532524] kfree_skb_reason+0x3e/0xc0 [ 33.532527] ip6_mc_input+0x23c/0x2b0 [ 33.532531] ip6_sublist_rcv_finish+0x83/0x90 [ 33.532534] ip6_sublist_rcv+0x22b/0x2b0
[3] XDP program to reproduce(xdp_pass.c):
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
SEC("xdp_pass")
int xdp_pkt_pass(struct xdp_md *ctx)
{
bpf_xdp_adjust_head(ctx, -(int)32);
return XDP_PASS;}
char _license[] SEC("license") = "GPL";
compile: clang -O2 -g -Wall -target bpf -c xdp_pass.c -o xdp_pass.o load on virtio_net: ip link set enp1s0 xdpdrv obj xdp_pass.o sec xdp_pass
--- drivers/net/virtio_net.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/net/virtio_net.c +19 -1
@@ -978,6 +978,24 @@ static struct sk_buff *receive_mergeable* xdp.data_meta were adjusted */ len = xdp.data_end - xdp.data + vi->hdr_len + metasize; + +/* recalculate headroom if xdp.data or xdp_data_meta +* were adjusted, note that offset should always point +* to the start of the reserved bytes for virtio_net +* header which are followed by xdp.data, that means +* that offset is equal to the headroom (when buf is +* starting at the beginning of the page, otherwise +* there is a base offset inside the page) but it's used +* with a different starting point (buf start) than +* xdp.data (buf start + vnet hdr size). If xdp.data or +* data_meta were adjusted by the xdp prog then the +* headroom size has changed and so has the offset, we +* can use data_hard_start, which points at buf start + +* vnet hdr size, to calculate the new headroom and use +* it later to compute buf start in page_to_skb() +*/ + headroom = xdp.data - xdp.data_hard_start - metasize; +/* We can only create skb based on xdp_page. */ if (unlikely (xdp_page != page)) {rcu_read_unlock ();
@@ -985,7 +1003,7 @@ static struct sk_buff *receive_mergeable head_skb =page_to_skb (vi, rq, xdp_page, offset, len,PAGE_SIZE , false, metasize, -VIRTIO_XDP_HEADROOM ); + headroom);return head_skb; }break ;
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Greg Kroah-Hartman
maintainerPATCH 55/225 cpufreq: qcom-hw: drop affinity hint before freeing the IRQ
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit be5985b3dbce5ba2af3c8b0f2b7df235c93907e6 ]
Drop affinity hint before freeing the throttling IRQ to fix the following trace:
[ 185.114773] ------------[ cut here ]------------ [ 185.119517] WARNING: CPU: 7 PID: 43 at kernel/irq/manage.c:1887 free_irq+0x3a4/0x3dc [ 185.127474] Modules linked in: [ 185.130618] CPU: 7 PID: 43 Comm: cpuhp/7 Tainted: G S W 5.17.0-rc6-00386-g67382a5b705d-dirty #690 [ 185.147125] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 185.154269] pc : free_irq+0x3a4/0x3dc [ 185.158031] lr : free_irq+0x33c/0x3dc [ 185.161792] sp : ffff80000841bc90 [ 185.165195] x29: ffff80000841bc90 x28: ffffa6edc5c3d000 x27: ffff6d93729e5908 [ 185.172515] x26: 0000000000000000 x25: ffff6d910109fc00 x24: ffff6d91011490e0 [ 185.179838] x23: ffff6d9101149218 x22: 0000000000000080 x21: 0000000000000000 [ 185.187163] x20: ffff6d9101149000 x19: ffff6d910ab61500 x18: ffffffffffffffff [ 185.194487] x17: 2e35202020202020 x16: 2020202020202020 x15: ffff80008841b9a7 [ 185.201805] x14: 00000000000003c9 x13: 0000000000000001 x12: 0000000000000040 [ 185.209135] x11: ffff6d91005aab58 x10: ffff6d91005aab5a x9 : ffffc6a5ad1c5408 [ 185.216455] x8 : ffff6d91005adb88 x7 : 0000000000000000 x6 : ffffc6a5ab5a91f4 [ 185.223776] x5 : 0000000000000000 x4 : ffff6d91011490a8 x3 : ffffc6a5ad266108 [ 185.231098] x2 : 0000000013033204 x1 : ffff6d9101149000 x0 : ffff6d910a9cc000 [ 185.238421] Call trace: [ 185.240932] free_irq+0x3a4/0x3dc [ 185.244334] qcom_cpufreq_hw_cpu_exit+0x78/0xcc [ 185.248985] cpufreq_offline.isra.0+0x228/0x270 [ 185.253639] cpuhp_cpufreq_offline+0x10/0x20 [ 185.258027] cpuhp_invoke_callback+0x16c/0x2b0 [ 185.262592] cpuhp_thread_fun+0x190/0x250 [ 185.266710] smpboot_thread_fn+0x12c/0x230 [ 185.270914] kthread+0xfc/0x100 [ 185.274145] ret_from_fork+0x10/0x20 [ 185.277820] irq event stamp: 212 [ 185.281136] hardirqs last enabled at (211): [<ffffc6a5ac57973c>] _raw_spin_unlock_irqrestore+0x8c/0xa0 [ 185.290775] hardirqs last disabled at (212): [<ffffc6a5ac572100>] __schedule+0x710/0xa10 [ 185.299081] softirqs last enabled at (0): [<ffffc6a5ab50f7b0>] copy_process+0x7d0/0x1a14 [ 185.307475] softirqs last disabled at (0): [<0000000000000000>] 0x0
--- drivers/cpufreq/qcom-cpufreq-hw.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/qcom-cpufreq-hw.c +1 -0
@@ -412,6 +412,7 @@ static void qcom_cpufreq_hw_lmh_exit(struct qcom_cpufreq_data *data)mutex_unlock (&data->throttle_lock);cancel_delayed_work_sync (&data->throttle_work); +irq_set_affinity_hint (data->throttle_irq,NULL );free_irq (data->throttle_irq, data); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 56/225 cpufreq: qcom-hw: fix the race between LMH worker and cpuhp
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 5e4f009da6be563984ba4db4ef4f32529e9aeb90 ]
The driver would disable the worker when cpu is being put offline, but it happens closer to the end of cpufreq_offline(). The function qcom_lmh_dcvs_poll() can be running in parallel with this, when policy->cpus already has been updated. Read policy->related_cpus instead.
[ 37.122433] ------------[ cut here ]------------ [ 37.127225] WARNING: CPU: 0 PID: 187 at drivers/base/arch_topology.c:180 topology_update_thermal_pressure+0xec/0x100 [ 37.138098] Modules linked in: [ 37.141279] CPU: 0 PID: 187 Comm: kworker/0:3 Tainted: G S 5.17.0-rc6-00389-g37c83d0b8710-dirty #713 [ 37.158306] Workqueue: events qcom_lmh_dcvs_poll [ 37.163095] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 37.170278] pc : topology_update_thermal_pressure+0xec/0x100 [ 37.176131] lr : topology_update_thermal_pressure+0x20/0x100 [ 37.181977] sp : ffff800009b6bce0 [ 37.185402] x29: ffff800009b6bce0 x28: ffffd87abe92b000 x27: ffff04bd7292e205 [ 37.192792] x26: ffffd87abe930af8 x25: ffffd87abe94e4c8 x24: 0000000000000000 [ 37.200180] x23: ffff04bb01177018 x22: ffff04bb011770c0 x21: ffff04bb01177000 [ 37.207567] x20: ffff04bb0a419000 x19: 00000000000c4e00 x18: 0000000000000000 [ 37.214954] x17: 000000040044ffff x16: 004000b2b5503510 x15: 0000006aaa1326d2 [ 37.222333] x14: 0000000000000232 x13: 0000000000000001 x12: 0000000000000040 [ 37.229718] x11: ffff04bb00400000 x10: 968f57bd39f701c8 x9 : ffff04bb0acc8674 [ 37.237095] x8 : fefefefefefefeff x7 : 0000000000000018 x6 : ffffd87abd90092c [ 37.244478] x5 : 0000000000000016 x4 : 0000000000000000 x3 : 0000000000000100 [ 37.251852] x2 : ffff04bb0a419020 x1 : 0000000000000100 x0 : 0000000000000100 [ 37.259235] Call trace: [ 37.261771] topology_update_thermal_pressure+0xec/0x100 [ 37.267266] qcom_lmh_dcvs_poll+0xbc/0x154 [ 37.271505] process_one_work+0x288/0x69c [ 37.275654] worker_thread+0x74/0x470 [ 37.279450] kthread+0xfc/0x100 [ 37.282712] ret_from_fork+0x10/0x20 [ 37.286417] irq event stamp: 74 [ 37.289664] hardirqs last enabled at (73): [<ffffd87abdd78af4>] _raw_spin_unlock_irq+0x44/0x80 [ 37.298632] hardirqs last disabled at (74): [<ffffd87abdd71fc0>] __schedule+0x710/0xa10 [ 37.306885] softirqs last enabled at (58): [<ffffd87abcc90410>] _stext+0x410/0x588 [ 37.314778] softirqs last disabled at (51): [<ffffd87abcd1bf68>] __irq_exit_rcu+0x158/0x174 [ 37.323386] ---[ end trace 0000000000000000 ]---
--- drivers/cpufreq/qcom-cpufreq-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/qcom-cpufreq-hw.c +1 -1
@@ -277,7 +277,7 @@ static unsigned int qcom_lmh_get_throttle_freq(struct qcom_cpufreq_data *data)static void qcom_lmh_dcvs_notify (struct qcom_cpufreq_data *data) {struct cpufreq_policy *policy = data->policy; -int cpu =cpumask_first (policy->cpus); +int cpu =cpumask_first (policy->related_cpus);struct device *dev =get_cpu_device (cpu);unsigned long freq_hz, throttled_freq;struct dev_pm_opp *opp;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 57/225 cpufreq: qcom-hw: fix the opp entries refcounting
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 6240aaad75e1a623872a830d13393d7aabf1052c ]
The qcom_lmh_dcvs_notify() will get the dev_pm_opp instance for throttling, but will not put it, ending up with leaking a reference count and the following backtrace when putting the CPU offline.
Correctly put the reference count of the returned opp instance.
[ 84.418025] ------------[ cut here ]------------ [ 84.422770] WARNING: CPU: 7 PID: 43 at drivers/opp/core.c:1396 _opp_table_kref_release+0x188/0x190 [ 84.431966] Modules linked in: [ 84.435106] CPU: 7 PID: 43 Comm: cpuhp/7 Tainted: G S 5.17.0-rc6-00388-g7cf3c0d89c44-dirty #721 [ 84.451631] pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) [ 84.458781] pc : _opp_table_kref_release+0x188/0x190 [ 84.463878] lr : _opp_table_kref_release+0x78/0x190 [ 84.468885] sp : ffff80000841bc70 [ 84.472294] x29: ffff80000841bc70 x28: ffff6664afe3d000 x27: ffff1db6729e5908 [ 84.479621] x26: 0000000000000000 x25: 0000000000000000 x24: ffff1db6729e58e0 [ 84.486946] x23: ffff8000080a5000 x22: ffff1db40aad80e0 x21: ffff1db4002fec80 [ 84.494277] x20: ffff1db40aad8000 x19: ffffb751c3186300 x18: ffffffffffffffff [ 84.501603] x17: 5300326563697665 x16: 645f676e696c6f6f x15: 00001186c1df5448 [ 84.508928] x14: 00000000000002e9 x13: 0000000000000000 x12: 0000000000000000 [ 84.516256] x11: ffffb751c3186368 x10: ffffb751c39a2a70 x9 : 0000000000000000 [ 84.523585] x8 : ffff1db4008edf00 x7 : ffffb751c328c000 x6 : 0000000000000001 [ 84.530916] x5 : 0000000000040000 x4 : 0000000000000001 x3 : ffff1db4008edf00 [ 84.538247] x2 : 0000000000000000 x1 : ffff1db400aa6100 x0 : ffff1db40aad80d0 [ 84.545579] Call trace: [ 84.548101] _opp_table_kref_release+0x188/0x190 [ 84.552842] dev_pm_opp_remove_all_dynamic+0x8c/0xc0 [ 84.557949] qcom_cpufreq_hw_cpu_exit+0x30/0xdc [ 84.562608] cpufreq_offline.isra.0+0x1b4/0x1d8 [ 84.567270] cpuhp_cpufreq_offline+0x10/0x6c [ 84.571663] cpuhp_invoke_callback+0x16c/0x2b0 [ 84.576231] cpuhp_thread_fun+0x190/0x250 [ 84.580353] smpboot_thread_fn+0x12c/0x230 [ 84.584568] kthread+0xfc/0x100 [ 84.587810] ret_from_fork+0x10/0x20 [ 84.591490] irq event stamp: 3482 [ 84.594901] hardirqs last enabled at (3481): [<ffffb751c13c3db0>] call_rcu+0x39c/0x50c [ 84.603119] hardirqs last disabled at (3482): [<ffffb751c236b518>] el1_dbg+0x24/0x8c [ 84.611074] softirqs last enabled at (310): [<ffffb751c1290410>] _stext+0x410/0x588 [ 84.619028] softirqs last disabled at (305): [<ffffb751c131bf68>] __irq_exit_rcu+0x158/0x174 [ 84.627691] ---[ end trace 0000000000000000 ]---
--- drivers/cpufreq/qcom-cpufreq-hw.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/cpufreq/qcom-cpufreq-hw.c +10 -4
@@ -292,12 +292,18 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data) opp =dev_pm_opp_find_freq_floor (dev, &freq_hz);if (IS_ERR (opp) &&PTR_ERR (opp) == -ERANGE ) -dev_pm_opp_find_freq_ceil (dev, &freq_hz); + opp =dev_pm_opp_find_freq_ceil (dev, &freq_hz); - throttled_freq = freq_hz /HZ_PER_KHZ ; +if (IS_ERR (opp)) { +dev_warn (dev,"Can't find the OPP for throttling: %pe!\n" , opp); + }else { + throttled_freq = freq_hz /HZ_PER_KHZ ; + +/* Update thermal pressure (the boost frequencies are accepted) */ +arch_update_thermal_pressure (policy->related_cpus, throttled_freq); -/* Update thermal pressure (the boost frequencies are accepted) */ -arch_update_thermal_pressure (policy->related_cpus, throttled_freq); +dev_pm_opp_put (opp); + }/* * In the unlikely case policy is unregistered do not enable
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 58/225 cpufreq: qcom-cpufreq-hw: Fix throttle frequency value on EPSS platforms
In reply to Greg Kroah-HartmanFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit f84ccad5f5660f86a642a3d7e2bfdc4e7a8a2d49 ]
On QCOM platforms with EPSS flavour of cpufreq IP a throttled frequency is obtained from another register REG_DOMAIN_STATE, thus the helper function qcom_lmh_get_throttle_freq() should be modified accordingly, as for now it returns gibberish since .reg_current_vote is unset for EPSS hardware.
To exclude a hardcoded magic number 19200 it is replaced by "xo" clock rate in KHz.
--- drivers/cpufreq/qcom-cpufreq-hw.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
drivers/cpufreq/qcom-cpufreq-hw.c +11 -6
@@ -28,6 +28,7 @@struct qcom_cpufreq_soc_data {u32 reg_enable; +u32 reg_domain_state;u32 reg_freq_lut;u32 reg_volt_lut;u32 reg_current_vote;
@@ -267,11 +268,16 @@ static void qcom_get_related_cpus(int index, struct cpumask *m) } } -static unsigned int qcom_lmh_get_throttle_freq (struct qcom_cpufreq_data *data) +static unsigned long qcom_lmh_get_throttle_freq (struct qcom_cpufreq_data *data) { -unsigned int val =readl_relaxed (data->base + data->soc_data->reg_current_vote); +unsigned int lval; -return (val &0x3FF ) *19200 ; +if (data->soc_data->reg_current_vote) + lval =readl_relaxed (data->base + data->soc_data->reg_current_vote) &0x3ff ; +else + lval =readl_relaxed (data->base + data->soc_data->reg_domain_state) &0xff ; + +return lval * xo_rate; }static void qcom_lmh_dcvs_notify (struct qcom_cpufreq_data *data)
@@ -281,14 +287,12 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)struct device *dev =get_cpu_device (cpu);unsigned long freq_hz, throttled_freq;struct dev_pm_opp *opp; -unsigned int freq;/* * Get the h/w throttled frequency, normalize it using the * registered opp table and use it to calculate thermal pressure. */ - freq =qcom_lmh_get_throttle_freq (data); - freq_hz = freq *HZ_PER_KHZ ; + freq_hz =qcom_lmh_get_throttle_freq (data); opp =dev_pm_opp_find_freq_floor (dev, &freq_hz);if (IS_ERR (opp) &&PTR_ERR (opp) == -ERANGE )
@@ -357,6 +361,7 @@ static const struct qcom_cpufreq_soc_data qcom_soc_data = {static const struct qcom_cpufreq_soc_data epss_soc_data = { .reg_enable =0x0 , + .reg_domain_state =0x20 , .reg_freq_lut =0x100 , .reg_volt_lut =0x200 , .reg_perf_state =0x320 ,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 59/225 video: fbdev: udlfb: properly check endpoint type
In reply to Greg Kroah-HartmanFrom: Pavel Skripkin <[email protected]>
[ Upstream commit aaf7dbe07385e0b8deb7237eca2a79926bbc7091 ]
syzbot reported warning in usb_submit_urb, which is caused by wrong endpoint type.
This driver uses out bulk endpoint for communication, so let's check if this endpoint is present and bail out early if not.
Fail log:
usb 1-1: BOGUS urb xfer, pipe 3 != type 1
WARNING: CPU: 0 PID: 4822 at drivers/usb/core/urb.c:493 usb_submit_urb+0xd27/0x1540 drivers/usb/core/urb.c:493 Modules linked in: CPU: 0 PID: 4822 Comm: kworker/0:3 Tainted: G W 5.13.0-syzkaller #0 ... Workqueue: usb_hub_wq hub_event RIP: 0010:usb_submit_urb+0xd27/0x1540 drivers/usb/core/urb.c:493 ... Call Trace: dlfb_submit_urb+0x89/0x160 drivers/video/fbdev/udlfb.c:1969 dlfb_set_video_mode+0x21f0/0x2950 drivers/video/fbdev/udlfb.c:315 dlfb_ops_set_par+0x2a3/0x840 drivers/video/fbdev/udlfb.c:1110 dlfb_usb_probe.cold+0x113e/0x1f4a drivers/video/fbdev/udlfb.c:1732 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396
--- drivers/video/fbdev/udlfb.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/video/fbdev/udlfb.c +12 -2
@@ -1649,8 +1649,9 @@ static int dlfb_usb_probe(struct usb_interface *intf,const struct device_attribute *attr;struct dlfb_data *dlfb;struct fb_info *info; -int retval = -ENOMEM ; +int retval;struct usb_device *usbdev =interface_to_usbdev (intf); +struct usb_endpoint_descriptor *out;/* usb initialization */ dlfb =kzalloc (sizeof (*dlfb),GFP_KERNEL );
@@ -1664,6 +1665,12 @@ static int dlfb_usb_probe(struct usb_interface *intf, dlfb->udev =usb_get_dev (usbdev);usb_set_intfdata (intf, dlfb); + retval =usb_find_common_endpoints (intf->cur_altsetting,NULL , &out,NULL ,NULL ); +if (retval) { +dev_err (&intf->dev,"Device should have at lease 1 bulk endpoint!\n" ); + goto error; + } +dev_dbg (&intf->dev,"console enable=%d\n" , console);dev_dbg (&intf->dev,"fb_defio enable=%d\n" , fb_defio);dev_dbg (&intf->dev,"shadow enable=%d\n" , shadow);
@@ -1673,6 +1680,7 @@ static int dlfb_usb_probe(struct usb_interface *intf,if (!dlfb_parse_vendor_descriptor (dlfb, intf)) {dev_err (&intf->dev,"firmware not recognized, incompatible device?\n" ); + retval = -ENODEV ; goto error; }
@@ -1686,8 +1694,10 @@ static int dlfb_usb_probe(struct usb_interface *intf,/* allocates framebuffer driver structure, not framebuffer memory */ info =framebuffer_alloc (0 , &dlfb->udev->dev); -if (!info) +if (!info) { + retval = -ENOMEM ; goto error; + } dlfb->info = info; info->par = dlfb;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 60/225 arm64: dts: meson: remove CPU opps below 1GHz for G12B boards
In reply to Greg Kroah-HartmanFrom: Christian Hewitt <[email protected]>
[ Upstream commit 6c4d636bc00dc17c63ffb2a73a0da850240e26e3 ]
Amlogic G12B devices experience CPU stalls and random board wedges when the system idles and CPU cores clock down to lower opp points. Recent vendor kernels include a change to remove 100-250MHz and other distro sources also remove the 500/667MHz points. Unless all 100-667Mhz opps are removed or the CPU governor forced to performance stalls are still observed, so let's remove them to improve stability and uptime.
--- .../boot/dts/amlogic/meson-g12b-a311d.dtsi | 40 ------------------- .../boot/dts/amlogic/meson-g12b-s922x.dtsi | 40 ------------------- 2 files changed, 80 deletions(-)
arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi +0 -40
@@ -11,26 +11,6 @@ cpu_opp_table_0: opp-table-0 { compatible = "operating-points-v2"; opp-shared; - opp-100000000 { - opp-hz = /bits/ 64 <100000000>; - opp-microvolt = <731000>; - }; - - opp-250000000 { - opp-hz = /bits/ 64 <250000000>; - opp-microvolt = <731000>; - }; - - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <731000>; - }; - - opp-667000000 { - opp-hz = /bits/ 64 <667000000>; - opp-microvolt = <731000>; - }; - opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <761000>;
@@ -71,26 +51,6 @@ cpub_opp_table_1: opp-table-1 { compatible = "operating-points-v2"; opp-shared; - opp-100000000 { - opp-hz = /bits/ 64 <100000000>; - opp-microvolt = <731000>; - }; - - opp-250000000 { - opp-hz = /bits/ 64 <250000000>; - opp-microvolt = <731000>; - }; - - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <731000>; - }; - - opp-667000000 { - opp-hz = /bits/ 64 <667000000>; - opp-microvolt = <731000>; - }; - opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <731000>;
arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi +0 -40
@@ -11,26 +11,6 @@ cpu_opp_table_0: opp-table-0 { compatible = "operating-points-v2"; opp-shared; - opp-100000000 { - opp-hz = /bits/ 64 <100000000>; - opp-microvolt = <731000>; - }; - - opp-250000000 { - opp-hz = /bits/ 64 <250000000>; - opp-microvolt = <731000>; - }; - - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <731000>; - }; - - opp-667000000 { - opp-hz = /bits/ 64 <667000000>; - opp-microvolt = <731000>; - }; - opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <731000>;
@@ -76,26 +56,6 @@ cpub_opp_table_1: opp-table-1 { compatible = "operating-points-v2"; opp-shared; - opp-100000000 { - opp-hz = /bits/ 64 <100000000>; - opp-microvolt = <751000>; - }; - - opp-250000000 { - opp-hz = /bits/ 64 <250000000>; - opp-microvolt = <751000>; - }; - - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <751000>; - }; - - opp-667000000 { - opp-hz = /bits/ 64 <667000000>; - opp-microvolt = <751000>; - }; - opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <771000>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 61/225 arm64: dts: meson: remove CPU opps below 1GHz for SM1 boards
In reply to Greg Kroah-HartmanFrom: Christian Hewitt <[email protected]>
[ Upstream commit fd86d85401c2049f652293877c0f7e6e5afc3bbc ]
Amlogic SM1 devices experience CPU stalls and random board wedges when the system idles and CPU cores clock down to lower opp points. Recent vendor kernels include a change to remove 100-250MHz and other distro sources also remove the 500/667MHz points. Unless all 100-667Mhz opps are removed or the CPU governor forced to performance stalls are still observed, so let's remove them to improve stability and uptime.
--- arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 20 -------------------- 1 file changed, 20 deletions(-)
arch/arm64/boot/dts/amlogic/meson-sm1.dtsi +0 -20
@@ -95,26 +95,6 @@ cpu_opp_table: opp-table { compatible = "operating-points-v2"; opp-shared; - opp-100000000 { - opp-hz = /bits/ 64 <100000000>; - opp-microvolt = <730000>; - }; - - opp-250000000 { - opp-hz = /bits/ 64 <250000000>; - opp-microvolt = <730000>; - }; - - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <730000>; - }; - - opp-667000000 { - opp-hz = /bits/ 64 <666666666>; - opp-microvolt = <750000>; - }; - opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <770000>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 62/225 iio: dac: ad3552r: fix signedness bug in ad3552r_reset()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 460bfa65b0de72f4d8a808bc7cfb1cb591a95b18 ]
The "val" variable is used to store either negative error codes from ad3552r_read_reg_wrapper() or positive u16 values on success. It needs to be signed for the error handling to work correctly.
--- drivers/iio/dac/ad3552r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad3552r.c +1 -1
@@ -656,7 +656,7 @@ static int ad3552r_reset(struct ad3552r_desc *dac) {struct reg_addr_pool addr;int ret; -u16 val; +int val; dac->gpio_reset =devm_gpiod_get_optional (&dac->spi->dev,"reset" ,GPIOD_OUT_LOW );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 63/225 iio:imu:bmi160: disable regulator in error path
In reply to Greg Kroah-HartmanFrom: Tong Zhang <[email protected]>
[ Upstream commit d926054d5565d3cfa2c7c3f7a48e79bcc10453ed ]
Regulator should be disabled in error path as mentioned in _regulator_put(). Also disable accel if gyro cannot be enabled.
[ 16.233604] WARNING: CPU: 0 PID: 2177 at drivers/regulator/core.c:2257 _regulator_put [ 16.240453] Call Trace: [ 16.240572] <TASK> [ 16.240676] regulator_put+0x26/0x40 [ 16.240853] regulator_bulk_free+0x26/0x50 [ 16.241050] release_nodes+0x3f/0x70 [ 16.241225] devres_release_group+0x147/0x1c0 [ 16.241441] ? bmi160_core_probe+0x175/0x3a0 [bmi160_core]
--- drivers/iio/imu/bmi160/bmi160_core.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/iio/imu/bmi160/bmi160_core.c +14 -6
@@ -730,7 +730,7 @@ static int bmi160_chip_init(struct bmi160_data *data, bool use_spi) ret =regmap_write (data->regmap,BMI160_REG_CMD ,BMI160_CMD_SOFTRESET );if (ret) -return ret; + goto disable_regulator;usleep_range (BMI160_SOFTRESET_USLEEP ,BMI160_SOFTRESET_USLEEP +1 );
@@ -741,29 +741,37 @@ static int bmi160_chip_init(struct bmi160_data *data, bool use_spi)if (use_spi) { ret =regmap_read (data->regmap,BMI160_REG_DUMMY , &val);if (ret) -return ret; + goto disable_regulator; } ret =regmap_read (data->regmap,BMI160_REG_CHIP_ID , &val);if (ret) {dev_err (dev,"Error reading chip id\n" ); -return ret; + goto disable_regulator; }if (val !=BMI160_CHIP_ID_VAL ) {dev_err (dev,"Wrong chip id, got %x expected %x\n" , val,BMI160_CHIP_ID_VAL ); -return -ENODEV ; + ret = -ENODEV ; + goto disable_regulator; } ret =bmi160_set_mode (data,BMI160_ACCEL , true);if (ret) -return ret; + goto disable_regulator; ret =bmi160_set_mode (data,BMI160_GYRO , true);if (ret) -return ret; + goto disable_accel;return 0 ; + +disable_accel: +bmi160_set_mode (data,BMI160_ACCEL , false); + +disable_regulator: +regulator_bulk_disable (ARRAY_SIZE (data->supplies), data->supplies); +return ret; } static int bmi160_data_rdy_trigger_set_state(struct iio_trigger *trig,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 64/225 iio:filter:admv8818: select REGMAP_SPI for ADMV8818
In reply to Greg Kroah-HartmanFrom: Wang ShaoBo <[email protected]>
[ Upstream commit d85cce86a86746354fffb688dd134609c8277adc ]
admv8818 driver needs __devm_regmap_init_spi() which is defined when CONFIG_REGMAP_SPI is set and struct regmap_config when CONFIG_REGMAP is set, so automatically select CONFIG_REGMAP_SPI which also sets CONFIG_REGMAP.
--- drivers/iio/filter/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/iio/filter/Kconfig +1 -0
@@ -8,6 +8,7 @@ menu "Filters" config ADMV8818 tristate "Analog Devices ADMV8818 High-Pass and Low-Pass Filter" depends on SPI && COMMON_CLK && 64BIT + select REGMAP_SPI help Say yes here to build support for Analog Devices ADMV8818 2 GHz to 18 GHz, Digitally Tunable, High-Pass and Low-Pass Filter.
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 65/225 mtd: rawnand: fix ecc parameters for mt7622
In reply to Greg Kroah-HartmanFrom: Chuanhong Guo <[email protected]>
[ Upstream commit 9fe4e0d3cbfe90152137963cc024ecb63db6e8e6 ]
According to the datasheet, mt7622 only has 5 ECC capabilities instead of 7, and the decoding error register is arranged as follows:
+------+---------+---------+---------+---------+ | Bits | 19:15 | 14:10 | 9:5 | 4:0 | +------+---------+---------+---------+---------+ | Name | ERRNUM3 | ERRNUM2 | ERRNUM1 | ERRNUM0 | +------+---------+---------+---------+---------+
This means err_mask should be 0x1f instead of 0x3f and the number of bits shifted in mtk_ecc_get_stats should be 5 instead of 8.
This commit introduces err_shift for the difference in this register and fix other existing parameters.
Public MT7622 reference manual can be found on [0] and the info this commit is based on is from page 656 and page 660.
[0]: https://wiki.banana-pi.org/Banana_Pi_BPI-R64#Documents
--- drivers/mtd/nand/raw/mtk_ecc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/mtd/nand/raw/mtk_ecc.c +8 -4
@@ -43,6 +43,7 @@struct mtk_ecc_caps {u32 err_mask; +u32 err_shift;const u8 *ecc_strength;const u32 *ecc_regs;u8 num_ecc_strength;
@@ -76,7 +77,7 @@ static const u8 ecc_strength_mt2712[] = { };static const u8 ecc_strength_mt7622[] = { -4 ,6 ,8 ,10 ,12 ,14 ,16 +4 ,6 ,8 ,10 ,12 };enum mtk_ecc_regs {
@@ -221,7 +222,7 @@ void mtk_ecc_get_stats(struct mtk_ecc *ecc, struct mtk_ecc_stats *stats,for (i =0 ; i < sectors; i++) { offset = (i >>2 ) <<2 ; err =readl (ecc->regs +ECC_DECENUM0 + offset); - err = err >> ((i %4 ) *8 ); + err = err >> ((i %4 ) * ecc->caps->err_shift); err &= ecc->caps->err_mask;if (err == ecc->caps->err_mask) {/* uncorrectable errors */
@@ -449,6 +450,7 @@ EXPORT_SYMBOL(mtk_ecc_get_parity_bits);static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = { .err_mask =0x3f , + .err_shift =8 , .ecc_strength = ecc_strength_mt2701, .ecc_regs = mt2701_ecc_regs, .num_ecc_strength =20 ,
@@ -459,6 +461,7 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = {static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = { .err_mask =0x7f , + .err_shift =8 , .ecc_strength = ecc_strength_mt2712, .ecc_regs = mt2712_ecc_regs, .num_ecc_strength =23 ,
@@ -468,10 +471,11 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = { };static const struct mtk_ecc_caps mtk_ecc_caps_mt7622 = { - .err_mask =0x3f , + .err_mask =0x1f , + .err_shift =5 , .ecc_strength = ecc_strength_mt7622, .ecc_regs = mt7622_ecc_regs, - .num_ecc_strength =7 , + .num_ecc_strength =5 , .ecc_mode_shift =4 , .parity_bits =13 , .pg_irq_sel =0 ,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 66/225 tee: optee: add missing mutext_destroy in optee_ffa_probe
In reply to Greg Kroah-HartmanFrom: Dongliang Mu <[email protected]>
[ Upstream commit b5e22886839ae466fcf03295150094516c0fd8eb ]
The error handling code of optee_ffa_probe misses the mutex_destroy of ffa.mutex when mutext_init succeeds.
Fix this by adding mutex_destory of ffa.mutex at the error handling part
--- drivers/tee/optee/ffa_abi.c | 1 + 1 file changed, 1 insertion(+)
drivers/tee/optee/ffa_abi.c +1 -0
@@ -894,6 +894,7 @@ static int optee_ffa_probe(struct ffa_device *ffa_dev)rhashtable_free_and_destroy (&optee->ffa.global_ids, rh_free_fn,NULL );optee_supp_uninit (&optee->supp);mutex_destroy (&optee->call_queue.mutex); +mutex_destroy (&optee->ffa.mutex); err_unreg_supp_teedev:tee_device_unregister (optee->supp_teedev); err_unreg_teedev:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 67/225 xsk: Fix l2fwd for copy mode + busy poll combo
In reply to Greg Kroah-HartmanFrom: Maciej Fijalkowski <[email protected]>
[ Upstream commit 8de8b71b787f38983d414d2dba169a3bfefa668a ]
While checking AF_XDP copy mode combined with busy poll, strange results were observed. rxdrop and txonly scenarios worked fine, but l2fwd broke immediately.
After a deeper look, it turned out that for l2fwd, Tx side was exiting early due to xsk_no_wakeup() returning true and in the end xsk_generic_xmit() was never called. Note that AF_XDP Tx in copy mode is syscall steered, so the current behavior is broken.
Txonly scenario only worked due to the fact that sk_mark_napi_id_once_xdp() was never called - since Rx side is not in the picture for this case and mentioned function is called in xsk_rcv_check(), sk::sk_napi_id was never set, which in turn meant that xsk_no_wakeup() was returning false (see the sk->sk_napi_id >= MIN_NAPI_ID check in there).
To fix this, prefer busy poll in xsk_sendmsg() only when zero copy is enabled on a given AF_XDP socket. By doing so, busy poll in copy mode would not exit early on Tx side and eventually xsk_generic_xmit() will be called.
--- net/xdp/xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/xdp/xsk.c +1 -1
@@ -640,7 +640,7 @@ static int __xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_lenif (sk_can_busy_loop (sk))sk_busy_loop (sk,1 );/* only support non-blocking sockets */ -if (xsk_no_wakeup (sk)) +if (xs->zc &&xsk_no_wakeup (sk))return 0 ; pool = xs->pool;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 68/225 arm64: dts: imx8qm: Correct SCU clock controllers compatible property
In reply to Greg Kroah-HartmanFrom: Liu Ying <[email protected]>
[ Upstream commit dd2737fab4a6ce9ba4eb84842bedbd87d55241a6 ]
The fsl,scu.txt dt-binding documentation explicitly mentions that the compatible string should be either "fsl,imx8qm-clock" or "fsl,imx8qxp-clock", followed by "fsl,scu-clk". Also, i.MX8qm SCU clocks and i.MX8qxp SCU clocks are really not the same, so we have to set the compatible property according to SoC name. Let's correct the i.MX8qm clock controller's compatible property from
"fsl,imx8qxp-clk", "fsl,scu-clk"
to
"fsl,imx8qm-clk", "fsl,scu-clk" .
--- arch/arm64/boot/dts/freescale/imx8qm.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8qm.dtsi +1 -1
@@ -193,7 +193,7 @@ pd: imx8qx-pd { }; clk: clock-controller { - compatible = "fsl,imx8qxp-clk", "fsl,scu-clk"; + compatible = "fsl,imx8qm-clk", "fsl,scu-clk"; #clock-cells = <2>; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 69/225 USB: Fix xhci event ring dequeue pointer ERDP update issue
In reply to Greg Kroah-HartmanFrom: Weitao Wang <[email protected]>
[ Upstream commit e91ac20889d1a26d077cc511365cd7ff4346a6f3 ]
In some situations software handles TRB events slower than adding TRBs. If the number of TRB events to be processed in a given interrupt is exactly the same as the event ring size 256, then the local variable "event_ring_deq" that holds the initial dequeue position is equal to software_dequeue after handling all 256 interrupts.
It will cause driver to not update ERDP to hardware,
Software dequeue pointer is out of sync with ERDP on interrupt exit. On the next interrupt, the event ring may full but driver will not update ERDP as software_dequeue is equal to ERDP.
[ 536.377115] xhci_hcd 0000:00:12.0: ERROR unknown event type 37 [ 566.933173] sd 8:0:0:0: [sdb] tag#27 uas_eh_abort_handler 0 uas-tag 7 inflight: CMD OUT [ 566.933181] sd 8:0:0:0: [sdb] tag#27 CDB: Write(10) 2a 00 17 71 e6 78 00 00 08 00 [ 572.041186] xhci_hcd On some situataions,the0000:00:12.0: xHCI host not responding to stop endpoint command. [ 572.057193] xhci_hcd 0000:00:12.0: Host halt failed, -110 [ 572.057196] xhci_hcd 0000:00:12.0: xHCI host controller not responding, assume dead [ 572.057236] sd 8:0:0:0: [sdb] tag#26 uas_eh_abort_handler 0 uas-tag 6 inflight: CMD [ 572.057240] sd 8:0:0:0: [sdb] tag#26 CDB: Write(10) 2a 00 38 eb cc d8 00 00 08 00 [ 572.057244] sd 8:0:0:0: [sdb] tag#25 uas_eh_abort_handler 0 uas-tag 5 inflight: CMD
Hardware ERDP is updated mid event handling if there are more than 128 events in an interrupt (half of ring size).
Fix this by updating the software local variable at the same time as hardware ERDP.
[commit message rewording -Mathias]
--- drivers/usb/host/xhci-ring.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/xhci-ring.c +1 -0
@@ -3141,6 +3141,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)if (event_loop++ <TRBS_PER_SEGMENT /2 )continue ;xhci_update_erst_dequeue (xhci, event_ring_deq); + event_ring_deq = xhci->event_ring->dequeue;/* ring is half-full, force isoc trbs to interrupt more often */ if (xhci->isoc_bei_interval >AVOID_BEI_INTERVAL_MIN )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 70/225 soc: imx: imx8m-blk-ctrl: Fix IMX8MN_DISPBLK_PD_ISI hang
In reply to Greg Kroah-HartmanFrom: Adam Ford <[email protected]>
[ Upstream commit e2aa165cd0163cef83cb295eb572aa9fb1604cf4 ]
The imx8mn clock list for the ISI lists four clocks, but DOMAIN_MAX_CLKS was set to 3. Because of this, attempts to enable the fourth clock failed, threw some splat, and ultimately hung.
--- drivers/soc/imx/imx8m-blk-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/imx/imx8m-blk-ctrl.c +1 -1
@@ -49,7 +49,7 @@ struct imx8m_blk_ctrl_domain_data {u32 mipi_phy_rst_mask; }; -#define DOMAIN_MAX_CLKS 3 +#define DOMAIN_MAX_CLKS 4struct imx8m_blk_ctrl_domain {struct generic_pm_domain genpd;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 71/225 ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue
In reply to Greg Kroah-HartmanFrom: Fabio Estevam <[email protected]>
[ Upstream commit fa51e1dc4b91375bc18349663a52395ad585bd3c ]
On a custom carrier board with a i.MX6Q Apalis SoM, the sgtl5000 codec on the SoM is often not detected and the following error message is seen when the sgtl5000 driver tries to read the ID register:
sgtl5000 1-000a: Error reading chip id -6
The reason for the error is that the MCLK clock is not provided early enough.
Fix the problem by describing the MCLK pinctrl inside the codec node instead of placing it inside the audmux pinctrl group.
With this change applied the sgtl5000 is always detected on every boot.
--- arch/arm/boot/dts/imx6qdl-apalis.dtsi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
arch/arm/boot/dts/imx6qdl-apalis.dtsi +8 -2
@@ -286,6 +286,8 @@ vgen6_reg: vgen6 { codec: sgtl5000@a { compatible = "fsl,sgtl5000"; reg = <0x0a>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sgtl5000>; clocks = <&clks IMX6QDL_CLK_CKO>; VDDA-supply = <®_module_3v3_audio>; VDDIO-supply = <®_module_3v3>;
@@ -517,8 +519,6 @@ MX6QDL_PAD_DISP0_DAT20__AUD4_TXC 0x130b0 MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0 MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0 MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0 - /* SGTL5000 sys_mclk */ - MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0 >; };
@@ -811,6 +811,12 @@ MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x000b0 >; }; + pinctrl_sgtl5000: sgtl5000grp { + fsl,pins = < + MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0 + >; + }; + pinctrl_spdif: spdifgrp { fsl,pins = < MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 72/225 iio:dac:ad3552r: Fix an IS_ERR() vs NULL check
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit de3b9fe9609a05d3c354c6718ca657962d11d9fe ]
The fwnode_get_named_child_node() function does not return error pointers. It returns NULL. Update the check accordingly.
--- drivers/iio/dac/ad3552r.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad3552r.c +2 -2
@@ -809,10 +809,10 @@ static int ad3552r_configure_custom_gain(struct ad3552r_desc *dac, gain_child =fwnode_get_named_child_node (child,"custom-output-range-config" ); -if (IS_ERR (gain_child)) { +if (!gain_child) {dev_err (dev,"mandatory custom-output-range-config property missing\n" ); -return PTR_ERR (gain_child); +return -EINVAL ; } dac->ch_data[ch].range_override =1 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 73/225 arm64: dts: imx8mq-tqma8mq: change the spi-nor tx
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit c7b45c79fb279e539346919a5c196e417925719e ]
This fixes the qspi read command by importing the changes from commit 04aa946d57b2 ("arm64: dts: imx8: change the spi-nor tx").
--- arch/arm64/boot/dts/freescale/imx8mq-tqma8mq.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mq-tqma8mq.dtsi +1 -1
@@ -253,7 +253,7 @@ flash0: flash@0 { #address-cells = <1>; #size-cells = <1>; spi-max-frequency = <84000000>; - spi-tx-bus-width = <4>; + spi-tx-bus-width = <1>; spi-rx-bus-width = <4>; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 74/225 arm64: dts: imx8mn: Fix SAI nodes
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 574518b7ccbaef74cb89eb1a1a0da88afa1e0113 ]
The most specific compatible string element should be "fsl,imx8mn-sai" on i.MX8M Nano, fix it from current "fsl,imx8mm-sai" (two Ms, likely due to copy-paste error from i.MX8M Mini).
--- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/freescale/imx8mn.dtsi +5 -5
@@ -291,7 +291,7 @@ spba2: spba-bus@30000000 { ranges; sai2: sai@30020000 { - compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai"; + compatible = "fsl,imx8mn-sai", "fsl,imx8mq-sai"; reg = <0x30020000 0x10000>; interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk IMX8MN_CLK_SAI2_IPG>,
@@ -305,7 +305,7 @@ sai2: sai@30020000 { }; sai3: sai@30030000 { - compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai"; + compatible = "fsl,imx8mn-sai", "fsl,imx8mq-sai"; reg = <0x30030000 0x10000>; interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk IMX8MN_CLK_SAI3_IPG>,
@@ -319,7 +319,7 @@ sai3: sai@30030000 { }; sai5: sai@30050000 { - compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai"; + compatible = "fsl,imx8mn-sai", "fsl,imx8mq-sai"; reg = <0x30050000 0x10000>; interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk IMX8MN_CLK_SAI5_IPG>,
@@ -335,7 +335,7 @@ sai5: sai@30050000 { }; sai6: sai@30060000 { - compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai"; + compatible = "fsl,imx8mn-sai", "fsl,imx8mq-sai"; reg = <0x30060000 0x10000>; interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk IMX8MN_CLK_SAI6_IPG>,
@@ -392,7 +392,7 @@ spdif1: spdif@30090000 { }; sai7: sai@300b0000 { - compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai"; + compatible = "fsl,imx8mn-sai", "fsl,imx8mq-sai"; reg = <0x300b0000 0x10000>; interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk IMX8MN_CLK_SAI7_IPG>,
Signature · 9 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Greg Kroah-Hartman
maintainerPATCH 75/225 arm64: dts: meson-sm1-bananapi-m5: fix wrong GPIO pin labeling for CON1
In reply to Greg Kroah-HartmanFrom: Guillaume Giraudon <[email protected]>
[ Upstream commit 962dd65e575dde950ef0844568edc37cfb39f302 ]
The labels for lines 61 through 84 on the periphs-banks were offset by 2. 2 lines are missing in the BOOT GPIO lines (contains 14, should be 16) Added 2 empty entries in BOOT to realigned the rest of GPIO labels to match the Banana Pi M5 schematics.
(Thanks to Neil Armstrong for the heads up on the position of the missing pins)
--- arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts +1 -0
@@ -437,6 +437,7 @@ &gpio { "", "eMMC_RST#", /* BOOT_12 */ "eMMC_DS", /* BOOT_13 */ + "", "", /* GPIOC */ "SD_D0_B", /* GPIOC_0 */ "SD_D1_B", /* GPIOC_1 */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 76/225 phy: samsung: Fix missing of_node_put() in exynos_sata_phy_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 388ec8f079f2f20d5cd183c3bc6f33cbc3ffd3ef ]
The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done.
--- drivers/phy/samsung/phy-exynos5250-sata.c | 1 + 1 file changed, 1 insertion(+)
drivers/phy/samsung/phy-exynos5250-sata.c +1 -0
@@ -187,6 +187,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)return -EINVAL ; sata_phy->client =of_find_i2c_device_by_node (node); +of_node_put (node);if (!sata_phy->client)return -EPROBE_DEFER ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 77/225 phy: samsung: exynos5250-sata: fix missing device put in probe error paths
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 5c8402c4db45dd55c2c93c8d730f5dfa7c78a702 ]
The actions of of_find_i2c_device_by_node() in probe function should be reversed in error paths by putting the reference to obtained device.
--- drivers/phy/samsung/phy-exynos5250-sata.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/phy/samsung/phy-exynos5250-sata.c +14 -6
@@ -196,20 +196,21 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) sata_phy->phyclk =devm_clk_get (dev,"sata_phyctrl" );if (IS_ERR (sata_phy->phyclk)) {dev_err (dev,"failed to get clk for PHY\n" ); -return PTR_ERR (sata_phy->phyclk); + ret =PTR_ERR (sata_phy->phyclk); + goto put_dev; } ret =clk_prepare_enable (sata_phy->phyclk);if (ret <0 ) {dev_err (dev,"failed to enable source clk\n" ); -return ret; + goto put_dev; } sata_phy->phy =devm_phy_create (dev,NULL , &exynos_sata_phy_ops);if (IS_ERR (sata_phy->phy)) { -clk_disable_unprepare (sata_phy->phyclk);dev_err (dev,"failed to create PHY\n" ); -return PTR_ERR (sata_phy->phy); + ret =PTR_ERR (sata_phy->phy); + goto clk_disable; }phy_set_drvdata (sata_phy->phy, sata_phy);
@@ -217,11 +218,18 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) phy_provider =devm_of_phy_provider_register (dev, of_phy_simple_xlate);if (IS_ERR (phy_provider)) { -clk_disable_unprepare (sata_phy->phyclk); -return PTR_ERR (phy_provider); + ret =PTR_ERR (phy_provider); + goto clk_disable; }return 0 ; + +clk_disable: +clk_disable_unprepare (sata_phy->phyclk); +put_dev: +put_device (&sata_phy->client->dev); + +return ret; }static const struct of_device_id exynos_sata_phy_of_match[] = {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 78/225 ARM: OMAP2+: Fix refcount leak in omap_gic_of_init
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 0f83e6b4161617014017a694888dd8743f46f071 ]
The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount.
Message-Id: <[email protected]>
--- arch/arm/mach-omap2/omap4-common.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-omap2/omap4-common.c +2 -0
@@ -314,10 +314,12 @@ void __init omap_gic_of_init(void) np =of_find_compatible_node (NULL ,NULL ,"arm,cortex-a9-gic" ); gic_dist_base_addr =of_iomap (np,0 ); +of_node_put (np);WARN_ON (!gic_dist_base_addr); np =of_find_compatible_node (NULL ,NULL ,"arm,cortex-a9-twd-timer" ); twd_base =of_iomap (np,0 ); +of_node_put (np);WARN_ON (!twd_base); skip_errata_init:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 79/225 bus: ti-sysc: Make omap3 gpt12 quirk handling SoC specific
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit a12315d6d27093392b6c634e1d35a59f1d1f7a59 ]
On beagleboard revisions A to B4 we need to use gpt12 as the system timer. However, the quirk handling added for gpt12 caused a regression for system suspend for am335x as the PM coprocessor needs the timers idled for suspend.
Let's make the gpt12 quirk specific to omap34xx, other SoCs don't need it. Beagleboard revisions C and later no longer need to use the gpt12 related quirk. Then at some point, if we decide to drop support for the old beagleboard revisions A to B4, we can also drop the gpt12 related quirks completely.
--- drivers/bus/ti-sysc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/bus/ti-sysc.c +15 -1
@@ -3232,13 +3232,27 @@ static int sysc_check_disabled_devices(struct sysc *ddata)*/ static int sysc_check_active_timer (struct sysc *ddata) { +int error; +if (ddata->cap->type !=TI_SYSC_OMAP2_TIMER && ddata->cap->type !=TI_SYSC_OMAP4_TIMER )return 0 ; +/* +* Quirk for omap3 beagleboard revision A to B4 to use gpt12. +* Revision C and later are fixed with commit 23885389dbbb ("ARM: +* dts: Fix timer regression for beagleboard revision c"). This all +* can be dropped if we stop supporting old beagleboard revisions +* A to B4 at some point. +*/ +if (sysc_soc->soc ==SOC_3430 ) + error = -ENXIO ; +else + error = -EBUSY ; +if ((ddata->cfg.quirks &SYSC_QUIRK_NO_RESET_ON_INIT ) && (ddata->cfg.quirks &SYSC_QUIRK_NO_IDLE )) -return -ENXIO ; +return error;return 0 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 80/225 ARM: dts: dra7: Fix suspend warning for vpe powerdomain
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 8d2453d9a307c2eafd21242dd73f35f05fb7ce74 ]
We currently are getting the following warning after a system suspend:
Powerdomain (vpe_pwrdm) didn't enter target state 0
Looks like this is because the STANDBYMODE bit for SMART_IDLE should not be used. The TRM "Table 12-348. VPE_SYSCONFIG" says that the value for SMART_IDLE is "0x2: Same behavior as bit-field value of 0x1". But if the SMART_IDLE value is used, PM_VPE_PWRSTST LASTPOWERSTATEENTERED bits always show value of 3.
Let's fix the issue by dropping SMART_IDLE for vpe. And let's also add the missing the powerdomain for vpe.
--- arch/arm/boot/dts/dra7-l4.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/dra7-l4.dtsi +2 -2
@@ -4188,11 +4188,11 @@ target-module@1d0010 { /* 0x489d0000, ap 27 30.0 */ reg = <0x1d0010 0x4>; reg-names = "sysc"; ti,sysc-midle = <SYSC_IDLE_FORCE>, - <SYSC_IDLE_NO>, - <SYSC_IDLE_SMART>; + <SYSC_IDLE_NO>; ti,sysc-sidle = <SYSC_IDLE_FORCE>, <SYSC_IDLE_NO>, <SYSC_IDLE_SMART>; + power-domains = <&prm_vpe>; clocks = <&vpe_clkctrl DRA7_VPE_VPE_CLKCTRL 0>; clock-names = "fck"; #address-cells = <1>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 81/225 phy: ti: omap-usb2: Fix error handling in omap_usb2_enable_clocks
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 3588060befff75ff39fab7122b94c6fb3148fcda ]
The corresponding API for clk_prepare_enable is clk_disable_unprepare. Make sure that the clock is unprepared on exit by changing clk_disable to clk_disable_unprepare.
--- drivers/phy/ti/phy-omap-usb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/ti/phy-omap-usb2.c +1 -1
@@ -215,7 +215,7 @@ static int omap_usb2_enable_clocks(struct omap_usb *phy)return 0 ; err1: -clk_disable (phy->wkupclk); +clk_disable_unprepare (phy->wkupclk); err0:return ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 82/225 ARM: dts: at91: Map MCLK for wm8731 on at91sam9g20ek
In reply to Greg Kroah-HartmanFrom: Mark Brown <[email protected]>
[ Upstream commit 0e486fe341fabd8e583f3d601a874cd394979c45 ]
The MCLK of the WM8731 on the AT91SAM9G20-EK board is connected to the PCK0 output of the SoC and is expected to be set to 12MHz. Previously this was mapped using pre-common clock API calls in the audio machine driver but the conversion to the common clock framework broke that so describe things in the DT instead.
--- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/at91sam9g20ek_common.dtsi +6 -0
@@ -219,6 +219,12 @@ i2c-gpio-0 { wm8731: wm8731@1b { compatible = "wm8731"; reg = <0x1b>; + + /* PCK0 at 12MHz */ + clocks = <&pmc PMC_TYPE_SYSTEM 8>; + clock-names = "mclk"; + assigned-clocks = <&pmc PMC_TYPE_SYSTEM 8>; + assigned-clock-rates = <12000000>; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 83/225 ARM: dts: at91: sama5d4_xplained: fix pinctrl phandle name
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit 5c8b49852910caffeebb1ce541fdd264ffc691b8 ]
Pinctrl phandle is for spi1 so rename it to reflect this.
--- arch/arm/boot/dts/at91-sama5d4_xplained.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/at91-sama5d4_xplained.dts +2 -2
@@ -82,7 +82,7 @@ usart4: serial@fc010000 { spi1: spi@fc018000 { pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_spi0_cs>; + pinctrl-0 = <&pinctrl_spi1_cs>; cs-gpios = <&pioB 21 0>; status = "okay"; };
@@ -140,7 +140,7 @@ pinctrl_macb0_phy_irq: macb0_phy_irq_0 { atmel,pins = <AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; }; - pinctrl_spi0_cs: spi0_cs_default { + pinctrl_spi1_cs: spi1_cs_default { atmel,pins = <AT91_PIOB 21 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 84/225 ARM: dts: at91: fix pinctrl phandles
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit 0c640d9544d0109da3889d71ae77301e556db977 ]
Commit bf781869e5cf ("ARM: dts: at91: add pinctrl-{names, 0} for all gpios") introduces pinctrl phandles for pins used by individual controllers to avoid failures due to commit 2ab73c6d8323 ("gpio:
Support GPIO controllers without pin-ranges"). For SPI controllers available on SAMA5D4 and SAMA5D3 some of the pins are defined in SoC specific dtsi on behalf of pinctrl-0. Adding extra pinctrl phandles on board specific dts also on behalf of pinctrl-0 overwrite the pinctrl-0 phandle specified in SoC specific dtsi. Thus add the board specific pinctrl to pinctrl-1.
Depends-on: 5c8b49852910 ("ARM: dts: at91: sama5d4_xplained: fix pinctrl phandle name")
--- arch/arm/boot/dts/at91-sama5d3_xplained.dts | 8 ++++---- arch/arm/boot/dts/at91-sama5d4_xplained.dts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/at91-sama5d3_xplained.dts +4 -4
@@ -57,8 +57,8 @@ slot@0 { }; spi0: spi@f0004000 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_spi0_cs>; + pinctrl-names = "default", "cs"; + pinctrl-1 = <&pinctrl_spi0_cs>; cs-gpios = <&pioD 13 0>, <0>, <0>, <&pioD 16 0>; status = "okay"; };
@@ -171,8 +171,8 @@ slot@0 { }; spi1: spi@f8008000 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_spi1_cs>; + pinctrl-names = "default", "cs"; + pinctrl-1 = <&pinctrl_spi1_cs>; cs-gpios = <&pioC 25 0>; status = "okay"; };
arch/arm/boot/dts/at91-sama5d4_xplained.dts +2 -2
@@ -81,8 +81,8 @@ usart4: serial@fc010000 { }; spi1: spi@fc018000 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_spi1_cs>; + pinctrl-names = "default", "cs"; + pinctrl-1 = <&pinctrl_spi1_cs>; cs-gpios = <&pioB 21 0>; status = "okay"; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 85/225 phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit d644e0d79829b1b9a14beedbdb0dc1256fc3677d ]
The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). And use pm_runtime_dont_use_autosuspend() to undo pm_runtime_use_autosuspend()
In the PM Runtime docs:
Drivers in ->remove() callback should undo the runtime PM changes done
in ->probe(). Usually this means calling pm_runtime_disable(),
pm_runtime_dont_use_autosuspend() etc.We should do this in error handling.
--- drivers/phy/motorola/phy-mapphone-mdm6600.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/phy/motorola/phy-mapphone-mdm6600.c +2 -1
@@ -629,7 +629,8 @@ static int phy_mdm6600_probe(struct platform_device *pdev) cleanup:if (error <0 )phy_mdm6600_device_power_off (ddata); - +pm_runtime_disable (ddata->dev); +pm_runtime_dont_use_autosuspend (ddata->dev);return error; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 86/225 phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit ce88613e5bd579478653a028291098143f2a5bdf ]
The pm_runtime_enable() will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable().
Add missing pm_runtime_disable() for serdes_am654_probe().
--- drivers/phy/ti/phy-am654-serdes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/ti/phy-am654-serdes.c +1 -1
@@ -838,7 +838,7 @@ static int serdes_am654_probe(struct platform_device *pdev) clk_err:of_clk_del_provider (node); - +pm_runtime_disable (dev);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 87/225 interconnect: qcom: sc7180: Drop IP0 interconnects
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit 2f3724930eb4bba74f7d10bc3bef5bb22dd323df ]
The IPA BCM resource ("IP0") on sc7180 was moved to the clk-rpmh driver in commit bcd63d222b60 ("clk: qcom: rpmh: Add IPA clock for SC7180") and modeled as a clk, but this interconnect driver still had it modeled as an interconnect. This was mostly OK because nobody used the interconnect definition, until the interconnect framework started dropping bandwidth requests on interconnects that aren't used via the sync_state callback in commit 7d3b0b0d8184 ("interconnect: qcom: Use icc_sync_state"). Once that patch was applied the IP0 resource was going to be controlled from two places, the clk framework and the interconnect framework.
Even then, things were probably going to be OK, because commit b95b668eaaa2 ("interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate") was needed to actually drop bandwidth requests on unused interconnects, of which the IPA was one of the interconnect that wasn't getting dropped to zero. Combining the three commits together leads to bad behavior where the interconnect framework is disabling the IP0 resource because it has no users while the clk framework thinks the IP0 resource is on because the only user, the IPA driver, has turned it on via clk_prepare_enable(). Depending on when sync_state is called, we can get into a situation like below:
IPA driver probes
IPA driver gets notified modem started
runtime PM get()
IPA clk enabled -> IP0 resource is ON
sync_state runs
interconnect zeroes out the IP0 resource -> IP0 resource is off
IPA driver tries to access a register and blows up
The crash is an unclocked access that manifest as an SError.
SError Interrupt on CPU0, code 0xbe000011 -- SError
CPU: 0 PID: 3595 Comm: mmdata_mgr Not tainted 5.17.1+ #166 Hardware name: Google Lazor (rev1 - 2) with LTE (DT) pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : mutex_lock+0x4c/0x80 lr : mutex_lock+0x30/0x80 sp : ffffffc00da9b9c0 x29: ffffffc00da9b9c0 x28: 0000000000000000 x27: 0000000000000000 x26: ffffffc00da9bc90 x25: ffffff80c2024010 x24: ffffff80c2024000 x23: ffffff8083100000 x22: ffffff80831000d0 x21: ffffff80831000a8 x20: ffffff80831000a8 x19: ffffff8083100070 x18: 00000000ffff0a00 x17: 000000002f7254f1 x16: 0000000000000100 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 000000000001f0b8 x10: ffffffc00931f0b8 x9 : 0000000000000000 x8 : 0000000000000000 x7 : fefefefefeff2f60 x6 : 0000808080808080 x5 : 0000000000000000 x4 : 8080808080800000 x3 : ffffff80d2d4ee28 x2 : ffffff808c1d6e40 x1 : 0000000000000000 x0 : ffffff8083100070 Kernel panic - not syncing: Asynchronous SError Interrupt CPU: 0 PID: 3595 Comm: mmdata_mgr Not tainted 5.17.1+ #166 Hardware name: Google Lazor (rev1 - 2) with LTE (DT) Call trace: dump_backtrace+0xf4/0x114 show_stack+0x24/0x30 dump_stack_lvl+0x64/0x7c dump_stack+0x18/0x38 panic+0x150/0x38c nmi_panic+0x88/0xa0 arm64_serror_panic+0x74/0x80 do_serror+0x0/0x80 do_serror+0x58/0x80 el1h_64_error_handler+0x34/0x4c el1h_64_error+0x78/0x7c mutex_lock+0x4c/0x80 __gsi_channel_start+0x50/0x17c gsi_channel_start+0x54/0x90 ipa_endpoint_enable_one+0x34/0xc0 ipa_open+0x4c/0x120
Remove all IP0 resource management from the interconnect driver so that clk-rpmh is the sole owner. This fixes the issue by preventing the interconnect driver from overwriting the IP0 resource data that the clk-rpmh driver wrote.
--- drivers/interconnect/qcom/sc7180.c | 21 --------------------- 1 file changed, 21 deletions(-)
drivers/interconnect/qcom/sc7180.c +0 -21
@@ -47,7 +47,6 @@ DEFINE_QNODE(qnm_mnoc_sf, SC7180_MASTER_MNOC_SF_MEM_NOC, 1, 32, SC7180_SLAVE_GEMDEFINE_QNODE (qnm_snoc_gc,SC7180_MASTER_SNOC_GC_MEM_NOC ,1 ,8 ,SC7180_SLAVE_LLCC );DEFINE_QNODE (qnm_snoc_sf,SC7180_MASTER_SNOC_SF_MEM_NOC ,1 ,16 ,SC7180_SLAVE_LLCC );DEFINE_QNODE (qxm_gpu,SC7180_MASTER_GFX3D ,2 ,32 ,SC7180_SLAVE_GEM_NOC_SNOC ,SC7180_SLAVE_LLCC ); -DEFINE_QNODE (ipa_core_master,SC7180_MASTER_IPA_CORE ,1 ,8 ,SC7180_SLAVE_IPA_CORE );DEFINE_QNODE (llcc_mc,SC7180_MASTER_LLCC ,2 ,4 ,SC7180_SLAVE_EBI1 );DEFINE_QNODE (qhm_mnoc_cfg,SC7180_MASTER_CNOC_MNOC_CFG ,1 ,4 ,SC7180_SLAVE_SERVICE_MNOC );DEFINE_QNODE (qxm_camnoc_hf0,SC7180_MASTER_CAMNOC_HF0 ,2 ,32 ,SC7180_SLAVE_MNOC_HF_MEM_NOC );
@@ -129,7 +128,6 @@ DEFINE_QNODE(qhs_mdsp_ms_mpu_cfg, SC7180_SLAVE_MSS_PROC_MS_MPU_CFG, 1, 4);DEFINE_QNODE (qns_gem_noc_snoc,SC7180_SLAVE_GEM_NOC_SNOC ,1 ,8 ,SC7180_MASTER_GEM_NOC_SNOC );DEFINE_QNODE (qns_llcc,SC7180_SLAVE_LLCC ,1 ,16 ,SC7180_MASTER_LLCC );DEFINE_QNODE (srvc_gemnoc,SC7180_SLAVE_SERVICE_GEM_NOC ,1 ,4 ); -DEFINE_QNODE (ipa_core_slave,SC7180_SLAVE_IPA_CORE ,1 ,8 );DEFINE_QNODE (ebi,SC7180_SLAVE_EBI1 ,2 ,4 );DEFINE_QNODE (qns_mem_noc_hf,SC7180_SLAVE_MNOC_HF_MEM_NOC ,1 ,32 ,SC7180_MASTER_MNOC_HF_MEM_NOC );DEFINE_QNODE (qns_mem_noc_sf,SC7180_SLAVE_MNOC_SF_MEM_NOC ,1 ,32 ,SC7180_MASTER_MNOC_SF_MEM_NOC );
@@ -160,7 +158,6 @@ DEFINE_QBCM(bcm_mc0, "MC0", true, &ebi);DEFINE_QBCM (bcm_sh0,"SH0" , true, &qns_llcc);DEFINE_QBCM (bcm_mm0,"MM0" , false, &qns_mem_noc_hf);DEFINE_QBCM (bcm_ce0,"CE0" , false, &qxm_crypto); -DEFINE_QBCM (bcm_ip0,"IP0" , false, &ipa_core_slave);DEFINE_QBCM (bcm_cn0,"CN0" , true, &qnm_snoc, &xm_qdss_dap, &qhs_a1_noc_cfg, &qhs_a2_noc_cfg, &qhs_ahb2phy0, &qhs_aop, &qhs_aoss, &qhs_boot_rom, &qhs_camera_cfg, &qhs_camera_nrt_throttle_cfg, &qhs_camera_rt_throttle_cfg, &qhs_clk_ctl, &qhs_cpr_cx, &qhs_cpr_mx, &qhs_crypto0_cfg, &qhs_dcc_cfg, &qhs_ddrss_cfg, &qhs_display_cfg, &qhs_display_rt_throttle_cfg, &qhs_display_throttle_cfg, &qhs_glm, &qhs_gpuss_cfg, &qhs_imem_cfg, &qhs_ipa, &qhs_mnoc_cfg, &qhs_mss_cfg, &qhs_npu_cfg, &qhs_npu_dma_throttle_cfg, &qhs_npu_dsp_throttle_cfg, &qhs_pimem_cfg, &qhs_prng, &qhs_qdss_cfg, &qhs_qm_cfg, &qhs_qm_mpu_cfg, &qhs_qup0, &qhs_qup1, &qhs_security, &qhs_snoc_cfg, &qhs_tcsr, &qhs_tlmm_1, &qhs_tlmm_2, &qhs_tlmm_3, &qhs_ufs_mem_cfg, &qhs_usb3, &qhs_venus_cfg, &qhs_venus_throttle_cfg, &qhs_vsense_ctrl_cfg, &srvc_cnoc);DEFINE_QBCM (bcm_mm1,"MM1" , false, &qxm_camnoc_hf0_uncomp, &qxm_camnoc_hf1_uncomp, &qxm_camnoc_sf_uncomp, &qhm_mnoc_cfg, &qxm_mdp0, &qxm_rot, &qxm_venus0, &qxm_venus_arm9);DEFINE_QBCM (bcm_sh2,"SH2" , false, &acm_sys_tcu);
@@ -372,22 +369,6 @@ static struct qcom_icc_desc sc7180_gem_noc = { .num_bcms = ARRAY_SIZE(gem_noc_bcms), }; -static struct qcom_icc_bcm *ipa_virt_bcms[] = { - &bcm_ip0, -}; - -static struct qcom_icc_node *ipa_virt_nodes[] = { - [MASTER_IPA_CORE ] = &ipa_core_master, - [SLAVE_IPA_CORE ] = &ipa_core_slave, -}; - -static struct qcom_icc_desc sc7180_ipa_virt = { - .nodes = ipa_virt_nodes, - .num_nodes =ARRAY_SIZE (ipa_virt_nodes), - .bcms = ipa_virt_bcms, - .num_bcms =ARRAY_SIZE (ipa_virt_bcms), -}; -static struct qcom_icc_bcm *mc_virt_bcms[] = { &bcm_acv, &bcm_mc0,
@@ -519,8 +500,6 @@ static const struct of_device_id qnoc_of_match[] = { .data = &sc7180_dc_noc}, { .compatible = "qcom,sc7180-gem-noc", .data = &sc7180_gem_noc}, - { .compatible = "qcom,sc7180-ipa-virt", - .data = &sc7180_ipa_virt}, { .compatible = "qcom,sc7180-mc-virt", .data = &sc7180_mc_virt}, { .compatible = "qcom,sc7180-mmss-noc",
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 88/225 interconnect: qcom: sdx55: Drop IP0 interconnects
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit 2fb251c265608636fc961b7d38e1a03937e57371 ]
Similar to the sc7180 commit, let's drop the IP0 interconnects here because the IP0 resource is also used in the clk-rpmh driver on sdx55. It's bad to have the clk framework and interconnect framework control the same RPMh resource without any coordination. The rpmh driver in the kernel doesn't aggregate resources between clients either, so leaving control to clk-rpmh avoids any issues with unused interconnects turning off IP0 behind the back of the clk framework.
--- drivers/interconnect/qcom/sdx55.c | 21 --------------------- 1 file changed, 21 deletions(-)
drivers/interconnect/qcom/sdx55.c +0 -21
@@ -18,7 +18,6 @@#include "icc-rpmh.h" #include "sdx55.h" -DEFINE_QNODE (ipa_core_master,SDX55_MASTER_IPA_CORE ,1 ,8 ,SDX55_SLAVE_IPA_CORE );DEFINE_QNODE (llcc_mc,SDX55_MASTER_LLCC ,4 ,4 ,SDX55_SLAVE_EBI_CH0 );DEFINE_QNODE (acm_tcu,SDX55_MASTER_TCU_0 ,1 ,8 ,SDX55_SLAVE_LLCC ,SDX55_SLAVE_MEM_NOC_SNOC ,SDX55_SLAVE_MEM_NOC_PCIE_SNOC );DEFINE_QNODE (qnm_snoc_gc,SDX55_MASTER_SNOC_GC_MEM_NOC ,1 ,8 ,SDX55_SLAVE_LLCC );
@@ -40,7 +39,6 @@ DEFINE_QNODE(xm_pcie, SDX55_MASTER_PCIE, 1, 8, SDX55_SLAVE_ANOC_SNOC);DEFINE_QNODE (xm_qdss_etr,SDX55_MASTER_QDSS_ETR ,1 ,8 ,SDX55_SLAVE_SNOC_CFG ,SDX55_SLAVE_EMAC_CFG ,SDX55_SLAVE_USB3 ,SDX55_SLAVE_AOSS ,SDX55_SLAVE_SPMI_FETCHER ,SDX55_SLAVE_QDSS_CFG ,SDX55_SLAVE_PDM ,SDX55_SLAVE_SNOC_MEM_NOC_GC ,SDX55_SLAVE_TCSR ,SDX55_SLAVE_CNOC_DDRSS ,SDX55_SLAVE_SPMI_VGI_COEX ,SDX55_SLAVE_QPIC ,SDX55_SLAVE_OCIMEM ,SDX55_SLAVE_IPA_CFG ,SDX55_SLAVE_USB3_PHY_CFG ,SDX55_SLAVE_AOP ,SDX55_SLAVE_BLSP_1 ,SDX55_SLAVE_SDCC_1 ,SDX55_SLAVE_CNOC_MSS ,SDX55_SLAVE_PCIE_PARF ,SDX55_SLAVE_ECC_CFG ,SDX55_SLAVE_AUDIO ,SDX55_SLAVE_AOSS ,SDX55_SLAVE_PRNG ,SDX55_SLAVE_CRYPTO_0_CFG ,SDX55_SLAVE_TCU ,SDX55_SLAVE_CLK_CTL ,SDX55_SLAVE_IMEM_CFG );DEFINE_QNODE (xm_sdc1,SDX55_MASTER_SDCC_1 ,1 ,8 ,SDX55_SLAVE_AOSS ,SDX55_SLAVE_IPA_CFG ,SDX55_SLAVE_ANOC_SNOC ,SDX55_SLAVE_AOP ,SDX55_SLAVE_AUDIO );DEFINE_QNODE (xm_usb3,SDX55_MASTER_USB3 ,1 ,8 ,SDX55_SLAVE_ANOC_SNOC ); -DEFINE_QNODE (ipa_core_slave,SDX55_SLAVE_IPA_CORE ,1 ,8 );DEFINE_QNODE (ebi,SDX55_SLAVE_EBI_CH0 ,1 ,4 );DEFINE_QNODE (qns_llcc,SDX55_SLAVE_LLCC ,1 ,16 ,SDX55_SLAVE_EBI_CH0 );DEFINE_QNODE (qns_memnoc_snoc,SDX55_SLAVE_MEM_NOC_SNOC ,1 ,8 ,SDX55_MASTER_MEM_NOC_SNOC );
@@ -82,7 +80,6 @@ DEFINE_QNODE(xs_sys_tcu_cfg, SDX55_SLAVE_TCU, 1, 8);DEFINE_QBCM (bcm_mc0,"MC0" , true, &ebi);DEFINE_QBCM (bcm_sh0,"SH0" , true, &qns_llcc);DEFINE_QBCM (bcm_ce0,"CE0" , false, &qxm_crypto); -DEFINE_QBCM (bcm_ip0,"IP0" , false, &ipa_core_slave);DEFINE_QBCM (bcm_pn0,"PN0" , false, &qhm_snoc_cfg);DEFINE_QBCM (bcm_sh3,"SH3" , false, &xm_apps_rdwr);DEFINE_QBCM (bcm_sh4,"SH4" , false, &qns_memnoc_snoc, &qns_sys_pcie);
@@ -219,22 +216,6 @@ static const struct qcom_icc_desc sdx55_system_noc = { .num_bcms = ARRAY_SIZE(system_noc_bcms), }; -static struct qcom_icc_bcm *ipa_virt_bcms[] = { - &bcm_ip0, -}; - -static struct qcom_icc_node *ipa_virt_nodes[] = { - [MASTER_IPA_CORE ] = &ipa_core_master, - [SLAVE_IPA_CORE ] = &ipa_core_slave, -}; - -static const struct qcom_icc_desc sdx55_ipa_virt = { - .nodes = ipa_virt_nodes, - .num_nodes =ARRAY_SIZE (ipa_virt_nodes), - .bcms = ipa_virt_bcms, - .num_bcms =ARRAY_SIZE (ipa_virt_bcms), -}; -static const struct of_device_id qnoc_of_match[] = { { .compatible ="qcom,sdx55-mc-virt" , .data = &sdx55_mc_virt},
@@ -242,8 +223,6 @@ static const struct of_device_id qnoc_of_match[] = { .data = &sdx55_mem_noc}, { .compatible = "qcom,sdx55-system-noc", .data = &sdx55_system_noc}, - { .compatible = "qcom,sdx55-ipa-virt", - .data = &sdx55_ipa_virt}, { } };MODULE_DEVICE_TABLE (of, qnoc_of_match);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 89/225 ARM: dts: Fix mmc order for omap3-gta04
In reply to Greg Kroah-HartmanFrom: H. Nikolaus Schaller <[email protected]>
[ Upstream commit 09269dd050094593fc747f2a5853d189fefcb6b5 ]
Commit a1ebdb374199 ("ARM: dts: Fix swapped mmc order for omap3") introduces general mmc aliases. Let's tailor them to the need of the GTA04 board which does not make use of mmc2 and mmc3 interfaces.
Message-Id: <dc9173ee3d391d9e92b7ab8ed4f84b29f0a21c83.1646744420.git.hns@goldelico.com>
--- arch/arm/boot/dts/omap3-gta04.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/omap3-gta04.dtsi +2 -0
@@ -31,6 +31,8 @@ chosen { aliases { display0 = &lcd; display1 = &tv0; + /delete-property/ mmc2; + /delete-property/ mmc3; }; ldo_3v3: fixedregulator {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 90/225 ARM: dts: am33xx-l4: Add missing touchscreen clock properties
In reply to Greg Kroah-HartmanFrom: Miquel Raynal <[email protected]>
[ Upstream commit c21a7434d6cc216a910dd35632617850f1751f4c ]
When adding support for TI magadc (Magnetic Stripe Reader and ADC), the MFD driver common to the touchscreen and the ADC got updated to ease the insertion of a new DT node for the ADC, with its own compatible, clocks, etc. Commit 235a96e92c16 ("mfd: ti_am335x_tscadc: Don't search the tree for our clock") removed one compatible specific information which was the clock name, because the clock was looked up from scratch in the DT while this hardware block was only fed by a single clock, already defined and properly filled in the DT.
Problem is, this change was only validated with an am437x-based board, where the clocks are effectively correctly defined and referenced. But on am33xx, the ADC clock is also correctly defined but is not referenced with a clock phandle as it ought to be.
The touchscreen bindings clearly state that the clocks/clock-names properties are mandatory, but they have been forgotten in one DTSI. This was probably not noticed in the first place because of the clock actually existing and the clk_get() call going through all the tree anyway.
Add the missing clock phandles in the am33xx touchscreen description.
Message-Id: <[email protected]>
--- arch/arm/boot/dts/am33xx-l4.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/am33xx-l4.dtsi +2 -0
@@ -263,6 +263,8 @@ tscadc: tscadc@0 { compatible = "ti,am3359-tscadc"; reg = <0x0 0x1000>; interrupts = <16>; + clocks = <&adc_tsc_fck>; + clock-names = "fck"; status = "disabled"; dmas = <&edma 53 0>, <&edma 57 0>; dma-names = "fifo0", "fifo1";
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 91/225 ARM: dts: am3517-evm: Fix misc pinmuxing
In reply to Greg Kroah-HartmanFrom: Adam Ford <[email protected]>
[ Upstream commit 942da3af32b2288e674736eb159d1fc676261691 ]
The bootloader for the AM3517 has previously done much of the pin muxing, but as the bootloader is moving more and more to a model based on the device tree, it may no longer automatically mux the pins, so it is necessary to add the pinmuxing to the Linux device trees so the respective peripherals can remain functional.
Message-Id: <[email protected]>
--- arch/arm/boot/dts/am3517-evm.dts | 45 +++++++++++++++++++++++++++---- arch/arm/boot/dts/am3517-som.dtsi | 9 +++++++ 2 files changed, 49 insertions(+), 5 deletions(-)
arch/arm/boot/dts/am3517-evm.dts +40 -5
@@ -161,6 +161,8 @@ pwm11: dmtimer-pwm@11 { /* HS USB Host PHY on PORT 1 */ hsusb1_phy: hsusb1_phy { + pinctrl-names = "default"; + pinctrl-0 = <&hsusb1_rst_pins>; compatible = "usb-nop-xceiv"; reset-gpios = <&gpio2 25 GPIO_ACTIVE_LOW>; /* gpio_57 */ #phy-cells = <0>;
@@ -168,7 +170,9 @@ hsusb1_phy: hsusb1_phy { }; &davinci_emac { - status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <ðernet_pins>; + status = "okay"; }; &davinci_mdio {
@@ -193,6 +197,8 @@ dpi_out: endpoint { }; &i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; clock-frequency = <400000>; /* User DIP swithes [1:8] / User LEDS [1:2] */ tca6416: gpio@21 {
@@ -205,6 +211,8 @@ tca6416: gpio@21 { }; &i2c3 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c3_pins>; clock-frequency = <400000>; };
@@ -223,6 +231,8 @@ &mmc3 { }; &usbhshost { + pinctrl-names = "default"; + pinctrl-0 = <&hsusb1_pins>; port1-mode = "ehci-phy"; };
@@ -231,8 +241,35 @@ &usbhsehci { }; &omap3_pmx_core { - pinctrl-names = "default"; - pinctrl-0 = <&hsusb1_rst_pins>; + + ethernet_pins: pinmux_ethernet_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x21fe, PIN_INPUT | MUX_MODE0) /* rmii_mdio_data */ + OMAP3_CORE1_IOPAD(0x2200, MUX_MODE0) /* rmii_mdio_clk */ + OMAP3_CORE1_IOPAD(0x2202, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_rxd0 */ + OMAP3_CORE1_IOPAD(0x2204, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_rxd1 */ + OMAP3_CORE1_IOPAD(0x2206, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_crs_dv */ + OMAP3_CORE1_IOPAD(0x2208, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* rmii_rxer */ + OMAP3_CORE1_IOPAD(0x220a, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* rmii_txd0 */ + OMAP3_CORE1_IOPAD(0x220c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* rmii_txd1 */ + OMAP3_CORE1_IOPAD(0x220e, PIN_OUTPUT_PULLDOWN |MUX_MODE0) /* rmii_txen */ + OMAP3_CORE1_IOPAD(0x2210, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_50mhz_clk */ + >; + }; + + i2c2_pins: pinmux_i2c2_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x21be, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c2_scl */ + OMAP3_CORE1_IOPAD(0x21c0, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c2_sda */ + >; + }; + + i2c3_pins: pinmux_i2c3_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x21c2, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_scl */ + OMAP3_CORE1_IOPAD(0x21c4, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_sda */ + >; + }; leds_pins: pinmux_leds_pins { pinctrl-single,pins = <
@@ -300,8 +337,6 @@ OMAP3_CORE1_IOPAD(0x20ba, PIN_OUTPUT | MUX_MODE4) /* gpmc_ncs6.gpio_57 */ }; &omap3_pmx_core2 { - pinctrl-names = "default"; - pinctrl-0 = <&hsusb1_pins>; hsusb1_pins: pinmux_hsusb1_pins { pinctrl-single,pins = <
arch/arm/boot/dts/am3517-som.dtsi +9 -0
@@ -69,6 +69,8 @@ nand@0,0 { }; &i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; clock-frequency = <400000>; s35390a: s35390a@30 {
@@ -179,6 +181,13 @@ bluetooth { &omap3_pmx_core { + i2c1_pins: pinmux_i2c1_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x21ba, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_scl */ + OMAP3_CORE1_IOPAD(0x21bc, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_sda */ + >; + }; + wl12xx_buffer_pins: pinmux_wl12xx_buffer_pins { pinctrl-single,pins = < OMAP3_CORE1_IOPAD(0x2156, PIN_OUTPUT | MUX_MODE4) /* mmc1_dat7.gpio_129 */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 92/225 ARM: dts: logicpd-som-lv: Fix wrong pinmuxing on OMAP35
In reply to Greg Kroah-HartmanFrom: Adam Ford <[email protected]>
[ Upstream commit 46ff3df87215ff42c0cd2c4bdb7d74540384a69c ]
The pinout of the OMAP35 and DM37 variants of the SOM-LV are the same, but the macros which define the pinmuxing are different between OMAP3530 and DM3730. The pinmuxing was correct for for the DM3730, but wrong for the OMAP3530. Since the boot loader was correctly pin-muxing the pins, this was not obvious. As the bootloader not guaranteed to pinmux all the pins any more, this causes an issue, so the pinmux needs to be moved from a common file to their respective board files.
Message-Id: <[email protected]>
--- arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts | 15 +++++++++++++++ arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts | 15 +++++++++++++++ arch/arm/boot/dts/logicpd-som-lv.dtsi | 15 --------------- 3 files changed, 30 insertions(+), 15 deletions(-)
arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts +15 -0
@@ -11,3 +11,18 @@ / { model = "LogicPD Zoom OMAP35xx SOM-LV Development Kit"; compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3430", "ti,omap3"; }; + +&omap3_pmx_core2 { + pinctrl-names = "default"; + pinctrl-0 = <&hsusb2_2_pins>; + hsusb2_2_pins: pinmux_hsusb2_2_pins { + pinctrl-single,pins = < + OMAP3430_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ + OMAP3430_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ + OMAP3430_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ + OMAP3430_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ + OMAP3430_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ + OMAP3430_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ + >; + }; +};
arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts +15 -0
@@ -11,3 +11,18 @@ / { model = "LogicPD Zoom DM3730 SOM-LV Development Kit"; compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3630", "ti,omap3"; }; + +&omap3_pmx_core2 { + pinctrl-names = "default"; + pinctrl-0 = <&hsusb2_2_pins>; + hsusb2_2_pins: pinmux_hsusb2_2_pins { + pinctrl-single,pins = < + OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ + OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ + OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ + OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ + OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ + OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ + >; + }; +};
arch/arm/boot/dts/logicpd-som-lv.dtsi +0 -15
@@ -265,21 +265,6 @@ OMAP3_WKUP_IOPAD(0x2a0c, PIN_OUTPUT | MUX_MODE4) /* sys_boot1.gpio_3 */ }; }; -&omap3_pmx_core2 { - pinctrl-names = "default"; - pinctrl-0 = <&hsusb2_2_pins>; - hsusb2_2_pins: pinmux_hsusb2_2_pins { - pinctrl-single,pins = < - OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ - OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ - OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ - OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ - OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ - OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ - >; - }; -}; - &uart2 { interrupts-extended = <&intc 73 &omap3_pmx_core OMAP3_UART2_RX>; pinctrl-names = "default";
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 93/225 pinctrl: qcom: sm6350: fix order of UFS & SDC pins
In reply to Greg Kroah-HartmanFrom: Luca Weiss <[email protected]>
[ Upstream commit ef0beba1a5fb0c693ddf7d31246bd96c925ffd00 ]
In other places the SDC and UFS pins have been swapped but this was missed in the PINCTRL_PIN definitions. Fix that.
--- drivers/pinctrl/qcom/pinctrl-sm6350.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/pinctrl/qcom/pinctrl-sm6350.c +8 -8
@@ -264,14 +264,14 @@ static const struct pinctrl_pin_desc sm6350_pins[] = {PINCTRL_PIN (153 ,"GPIO_153" ),PINCTRL_PIN (154 ,"GPIO_154" ),PINCTRL_PIN (155 ,"GPIO_155" ), -PINCTRL_PIN (156 ,"SDC1_RCLK" ), -PINCTRL_PIN (157 ,"SDC1_CLK" ), -PINCTRL_PIN (158 ,"SDC1_CMD" ), -PINCTRL_PIN (159 ,"SDC1_DATA" ), -PINCTRL_PIN (160 ,"SDC2_CLK" ), -PINCTRL_PIN (161 ,"SDC2_CMD" ), -PINCTRL_PIN (162 ,"SDC2_DATA" ), - PINCTRL_PIN(163, "UFS_RESET"), +PINCTRL_PIN (156 ,"UFS_RESET" ), +PINCTRL_PIN (157 ,"SDC1_RCLK" ), +PINCTRL_PIN (158 ,"SDC1_CLK" ), +PINCTRL_PIN (159 ,"SDC1_CMD" ), +PINCTRL_PIN (160 ,"SDC1_DATA" ), +PINCTRL_PIN (161 ,"SDC2_CLK" ), +PINCTRL_PIN (162 ,"SDC2_CMD" ), + PINCTRL_PIN(163, "SDC2_DATA"), };#define DECLARE_MSM_GPIO_PINS (pin) \
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 94/225 ipvs: correctly print the memory size of ip_vs_conn_tab
In reply to Greg Kroah-HartmanFrom: Pengcheng Yang <[email protected]>
[ Upstream commit eba1a872cb73314280d5448d934935b23e30b7ca ]
The memory size of ip_vs_conn_tab changed after we use hlist instead of list.
--- net/netfilter/ipvs/ip_vs_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_conn.c +1 -1
@@ -1495,7 +1495,7 @@ int __init ip_vs_conn_init(void)pr_info ("Connection hash table configured " "(size=%d, memory=%ldKbytes)\n" , ip_vs_conn_tab_size, - (long )(ip_vs_conn_tab_size*sizeof (struct list_head ))/1024 ); + (long )(ip_vs_conn_tab_size*sizeof (*ip_vs_conn_tab))/1024 );IP_VS_DBG (0 ,"Each connection entry needs %zd bytes at least\n" ,sizeof (struct ip_vs_conn ));
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 95/225 phy: amlogic: fix error path in phy_g12a_usb3_pcie_probe()
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
[ Upstream commit 2c8045d48dee703ad8eab2be7d6547765a89c069 ]
If clk_prepare_enable() fails we call clk_disable_unprepare() in the error path what results in a warning that the clock is disabled and unprepared already.
And if we fail later in phy_g12a_usb3_pcie_probe() then we bail out w/o calling clk_disable_unprepare().
This patch fixes both errors.
--- .../phy/amlogic/phy-meson-g12a-usb3-pcie.c | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c +12 -8
@@ -414,19 +414,19 @@ static int phy_g12a_usb3_pcie_probe(struct platform_device *pdev) ret =clk_prepare_enable (priv->clk_ref);if (ret) - goto err_disable_clk_ref; +return ret; priv->reset =devm_reset_control_array_get_exclusive (dev); -if (IS_ERR (priv->reset)) -return PTR_ERR (priv->reset); +if (IS_ERR (priv->reset)) { + ret =PTR_ERR (priv->reset); + goto err_disable_clk_ref; + } priv->phy =devm_phy_create (dev, np, &phy_g12a_usb3_pcie_ops);if (IS_ERR (priv->phy)) { ret =PTR_ERR (priv->phy); -if (ret != -EPROBE_DEFER ) -dev_err (dev,"failed to create PHY\n" ); - -return ret; +dev_err_probe (dev, ret,"failed to create PHY\n" ); + goto err_disable_clk_ref; }phy_set_drvdata (priv->phy, priv);
@@ -434,8 +434,12 @@ static int phy_g12a_usb3_pcie_probe(struct platform_device *pdev) phy_provider =devm_of_phy_provider_register (dev, phy_g12a_usb3_pcie_xlate); +if (IS_ERR (phy_provider)) { + ret =PTR_ERR (phy_provider); + goto err_disable_clk_ref; + } -return PTR_ERR_OR_ZERO (phy_provider); +return 0 ; err_disable_clk_ref:clk_disable_unprepare (priv->clk_ref);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 96/225 pinctrl: mediatek: moore: Fix build error
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
[ Upstream commit 87950929e2ff2236207bdbe14bff8230558b541b ]
If EINT_MTK is m and PINCTRL_MTK_V2 is y, build fails:
drivers/pinctrl/mediatek/pinctrl-moore.o: In function `mtk_gpio_set_config':
pinctrl-moore.c:(.text+0xa6c): undefined reference to mtk_eint_set_debounce' drivers/pinctrl/mediatek/pinctrl-moore.o: In function mtk_gpio_to_irq':
pinctrl-moore.c:(.text+0xacc): undefined reference to `mtk_eint_find_irq'
Select EINT_MTK for PINCTRL_MTK_V2 to fix this.
--- drivers/pinctrl/mediatek/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/pinctrl/mediatek/Kconfig +1 -0
@@ -30,6 +30,7 @@ config PINCTRL_MTK_MOORE select GENERIC_PINMUX_FUNCTIONS select GPIOLIB select OF_GPIO + select EINT_MTK select PINCTRL_MTK_V2 config PINCTRL_MTK_PARIS
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 97/225 mtd: rawnand: Fix return value check of wait_for_completion_timeout
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 084c16ab423a8890121b902b405823bfec5b4365 ]
wait_for_completion_timeout() returns unsigned long not int. It returns 0 if timed out, and positive if completed. The check for <= 0 is ambiguous and should be == 0 here indicating timeout which is the only error case.
--- drivers/mtd/nand/raw/sh_flctl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/mtd/nand/raw/sh_flctl.c +8 -6
@@ -384,7 +384,8 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,dma_addr_t dma_addr;dma_cookie_t cookie;uint32_t reg; -int ret; +int ret =0 ; +unsigned long time_left;if (dir ==DMA_FROM_DEVICE ) { chan = flctl->chan_fifo0_rx;
@@ -425,13 +426,14 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, goto out; } - ret = + time_left =wait_for_completion_timeout (&flctl->dma_complete,msecs_to_jiffies (3000 )); -if (ret <=0 ) { +if (time_left ==0 ) {dmaengine_terminate_all (chan);dev_err (&flctl->pdev->dev,"wait_for_completion_timeout\n" ); + ret = -ETIMEDOUT ; } out:
@@ -441,7 +443,7 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,dma_unmap_single (chan->device->dev, dma_addr, len, dir); -/* ret > 0 is success */ +/* ret == 0 is success */ return ret; }
@@ -465,7 +467,7 @@ static void read_fiforeg(struct sh_flctl *flctl, int rlen, int offset)/* initiate DMA transfer */ if (flctl->chan_fifo0_rx && rlen >=32 && -flctl_dma_fifo0_transfer (flctl, buf, rlen,DMA_FROM_DEVICE ) >0 ) + !flctl_dma_fifo0_transfer (flctl, buf, rlen,DMA_FROM_DEVICE )) goto convert;/* DMA success */ /* do polling transfer */
@@ -524,7 +526,7 @@ static void write_ec_fiforeg(struct sh_flctl *flctl, int rlen,/* initiate DMA transfer */ if (flctl->chan_fifo0_tx && rlen >=32 && -flctl_dma_fifo0_transfer (flctl, buf, rlen,DMA_TO_DEVICE ) >0 ) + !flctl_dma_fifo0_transfer (flctl, buf, rlen,DMA_TO_DEVICE ))return ;/* DMA success */ /* do polling transfer */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 98/225 mtd: fix part field data corruption in mtd_info
In reply to Greg Kroah-HartmanFrom: Oleksandr Ocheretnyi <[email protected]>
[ Upstream commit 37c5f9e80e015d0df17d0c377c18523002986851 ]
Commit 46b5889cc2c5 ("mtd: implement proper partition handling") started using "mtd_get_master_ofs()" in mtd callbacks to determine memory offsets by means of 'part' field from mtd_info, what previously was smashed accessing 'master' field in the mtd_set_dev_defaults() method. That provides wrong offset what causes hardware access errors.
Just make 'part', 'master' as separate fields, rather than using union type to avoid 'part' data corruption when mtd_set_dev_defaults() is called.
--- include/linux/mtd/mtd.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
include/linux/mtd/mtd.h +2 -4
@@ -392,10 +392,8 @@ struct mtd_info {/* List of partitions attached to this MTD device */ struct list_head partitions; -union { -struct mtd_part part; -struct mtd_master master; - }; +struct mtd_part part; +struct mtd_master master; };static inline struct mtd_info *mtd_get_master (struct mtd_info *mtd)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 99/225 pinctrl: stm32: Do not call stm32_gpio_get() for edge triggered IRQs in EOI
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit e74200ebf7c4f6a7a7d1be9f63833ddba251effa ]
The stm32_gpio_get() should only be called for LEVEL triggered interrupts, skip calling it for EDGE triggered interrupts altogether to avoid wasting CPU cycles in EOI handler. On this platform, EDGE triggered interrupts are the majority and LEVEL triggered interrupts are the exception no less, and the CPU cycles are not abundant.
--- drivers/pinctrl/stm32/pinctrl-stm32.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/pinctrl/stm32/pinctrl-stm32.c +4 -0
@@ -311,6 +311,10 @@ static void stm32_gpio_irq_trigger(struct irq_data *d)struct stm32_gpio_bank *bank = d->domain->host_data;int level; +/* Do not access the GPIO if this is not LEVEL triggered IRQ. */ +if (!(bank->irq_type[d->hwirq] &IRQ_TYPE_LEVEL_MASK )) +return ; +/* If level interrupt type then retrig */ level =stm32_gpio_get (&bank->gpio_chip, d->hwirq); if ((level == 0 && bank->irq_type[d->hwirq] == IRQ_TYPE_LEVEL_LOW) ||
Signature · 9 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Greg Kroah-Hartman
maintainerPATCH 100/225 memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual Mode
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 7e842d70fe599bc13594b650b2144c4b6e6d6bf1 ]
HyperFlash devices fail to probe:
rpc-if-hyperflash rpc-if-hyperflash: probing of hyperbus device failed
In HyperFlash or Octal-SPI Flash mode, the Transfer Data Enable bits (SPIDE) in the Manual Mode Enable Setting Register (SMENR) are derived from half of the transfer size, cfr. the rpcif_bits_set() helper function. However, rpcif_reg_{read,write}() does not take the bus size into account, and does not double all Manual Mode Data Register access sizes when communicating with a HyperFlash or Octal-SPI Flash device.
Fix this, and avoid the back-and-forth conversion between transfer size and Transfer Data Enable bits, by explicitly storing the transfer size in struct rpcif, and using that value to determine access size in rpcif_reg_{read,write}().
Enforce that the "high" Manual Mode Read/Write Data Registers (SM[RW]DR1) are only used for 8-byte data accesses. While at it, forbid writing to the Manual Mode Read Data Registers, as they are read-only.
--- drivers/memory/renesas-rpc-if.c | 60 +++++++++++++++++++++++++-------- include/memory/renesas-rpc-if.h | 1 + 2 files changed, 47 insertions(+), 14 deletions(-)
drivers/memory/renesas-rpc-if.c +46 -14
@@ -164,25 +164,39 @@ static const struct regmap_access_table rpcif_volatile_table = {/* -* Custom accessor functions to ensure SMRDR0 and SMWDR0 are always accessed -* with proper width. Requires SMENR_SPIDE to be correctly set before! +* Custom accessor functions to ensure SM[RW]DR[01] are always accessed with +* proper width. Requires rpcif.xfer_size to be correctly set before! */ static int rpcif_reg_read (void *context,unsigned int reg,unsigned int *val) {struct rpcif *rpc = context; -if (reg ==RPCIF_SMRDR0 || reg ==RPCIF_SMWDR0 ) { -u32 spide =readl (rpc->base +RPCIF_SMENR ) &RPCIF_SMENR_SPIDE (0xF ); - -if (spide ==0x8 ) { +switch (reg) { +case RPCIF_SMRDR0 : +case RPCIF_SMWDR0 : +switch (rpc->xfer_size) { +case 1 : *val =readb (rpc->base + reg);return 0 ; - }else if (spide ==0xC ) { + +case 2 : *val =readw (rpc->base + reg);return 0 ; - }else if (spide !=0xF ) { + +case 4 : +case 8 : + *val =readl (rpc->base + reg); +return 0 ; + +default :return -EILSEQ ; } + +case RPCIF_SMRDR1 : +case RPCIF_SMWDR1 : +if (rpc->xfer_size !=8 ) +return -EILSEQ ; +break ; } *val =readl (rpc->base + reg);
@@ -193,18 +207,34 @@ static int rpcif_reg_write(void *context, unsigned int reg, unsigned int val) {struct rpcif *rpc = context; -if (reg ==RPCIF_SMRDR0 || reg ==RPCIF_SMWDR0 ) { -u32 spide =readl (rpc->base +RPCIF_SMENR ) &RPCIF_SMENR_SPIDE (0xF ); - -if (spide ==0x8 ) { +switch (reg) { +case RPCIF_SMWDR0 : +switch (rpc->xfer_size) { +case 1 :writeb (val, rpc->base + reg);return 0 ; - }else if (spide ==0xC ) { + +case 2 :writew (val, rpc->base + reg);return 0 ; - }else if (spide !=0xF ) { + +case 4 : +case 8 : +writel (val, rpc->base + reg); +return 0 ; + +default :return -EILSEQ ; } + +case RPCIF_SMWDR1 : +if (rpc->xfer_size !=8 ) +return -EILSEQ ; +break ; + +case RPCIF_SMRDR0 : +case RPCIF_SMRDR1 : +return -EPERM ; }writel (val, rpc->base + reg);
@@ -469,6 +499,7 @@ int rpcif_manual_xfer(struct rpcif *rpc) smenr |=RPCIF_SMENR_SPIDE (rpcif_bits_set (rpc, nbytes));regmap_write (rpc->regmap,RPCIF_SMENR , smenr); + rpc->xfer_size = nbytes;memcpy (data, rpc->buffer + pos, nbytes);if (nbytes ==8 ) {
@@ -533,6 +564,7 @@ int rpcif_manual_xfer(struct rpcif *rpc)regmap_write (rpc->regmap,RPCIF_SMENR , smenr);regmap_write (rpc->regmap,RPCIF_SMCR , rpc->smcr |RPCIF_SMCR_SPIE ); + rpc->xfer_size = nbytes; ret =wait_msg_xfer_end (rpc);if (ret) goto err_out;
include/memory/renesas-rpc-if.h +1 -0
@@ -72,6 +72,7 @@ struct rpcif {enum rpcif_type type;enum rpcif_data_dir dir;u8 bus_size; +u8 xfer_size;void *buffer;u32 xferlen;u32 smcr;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 101/225 net: dsa: Add missing of_node_put() in dsa_port_link_register_of
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit fc06b2867f4cea543505acfb194c2be4ebf0c7d3 ]
The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. of_node_put() will check for NULL value.
--- net/dsa/port.c | 2 ++ 1 file changed, 2 insertions(+)
net/dsa/port.c +2 -0
@@ -1240,8 +1240,10 @@ int dsa_port_link_register_of(struct dsa_port *dp)if (ds->ops->phylink_mac_link_down) ds->ops->phylink_mac_link_down (ds, port,MLO_AN_FIXED ,PHY_INTERFACE_MODE_NA ); +of_node_put (phy_np);return dsa_port_phylink_register (dp); } +of_node_put (phy_np);return 0 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 102/225 netfilter: nft_set_rbtree: overlap detection with element re-addition after deletion
In reply to Greg Kroah-HartmanFrom: Pablo Neira Ayuso <[email protected]>
[ Upstream commit babc3dc9524f0bcb5a0ec61f3c3639b11508fad6 ]
This patch fixes spurious EEXIST errors.
Extend d2df92e98a34 ("netfilter: nft_set_rbtree: handle element re-addition after deletion") to deal with elements with same end flags in the same transation.
Reset the overlap flag as described by 7c84d41416d8 ("netfilter:nft_set_rbtree: Detect partial overlaps on insertion").
--- net/netfilter/nft_set_rbtree.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/netfilter/nft_set_rbtree.c +5 -1
@@ -349,7 +349,11 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set, *ext = &rbe->ext;return -EEXIST ; }else { - p = &parent->rb_left; + overlap = false; +if (nft_rbtree_interval_end (rbe)) + p = &parent->rb_left; +else + p = &parent->rb_right; } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 103/225 bpf, lwt: Fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit lwt hook
In reply to Greg Kroah-HartmanFrom: Eyal Birger <[email protected]>
[ Upstream commit b02d196c44ead1a5949729be9ff08fe781c3e48a ]
xmit_check_hhlen() observes the dst for getting the device hard header length to make sure a modified packet can fit. When a helper which changes the dst - such as bpf_skb_set_tunnel_key() - is called as part of the xmit program the accessed dst is no longer valid.
This leads to the following splat:
BUG: kernel NULL pointer dereference, address: 00000000000000de #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 798 Comm: ping Not tainted 5.18.0-rc2+ #103 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 RIP: 0010:bpf_xmit+0xfb/0x17f Code: c6 c0 4d cd 8e 48 c7 c7 7d 33 f0 8e e8 42 09 fb ff 48 8b 45 58 48 8b 95 c8 00 00 00 48 2b 95 c0 00 00 00 48 83 e0 fe 48 8b 00 <0f> b7 80 de 00 00 00 39 c2 73 22 29 d0 b9 20 0a 00 00 31 d2 48 89 RSP: 0018:ffffb148c0bc7b98 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000240008 RCX: 0000000000000000 RDX: 0000000000000010 RSI: 00000000ffffffea RDI: 00000000ffffffff RBP: ffff922a828a4e00 R08: ffffffff8f1350e8 R09: 00000000ffffdfff R10: ffffffff8f055100 R11: ffffffff8f105100 R12: 0000000000000000 R13: ffff922a828a4e00 R14: 0000000000000040 R15: 0000000000000000 FS: 00007f414e8f0080(0000) GS:ffff922afdc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000de CR3: 0000000002d80006 CR4: 0000000000370ef0 Call Trace: <TASK> lwtunnel_xmit.cold+0x71/0xc8 ip_finish_output2+0x279/0x520 ? __ip_finish_output.part.0+0x21/0x130
Fix by fetching the device hard header length before running the BPF code.
--- net/core/lwt_bpf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
net/core/lwt_bpf.c +3 -4
@@ -159,10 +159,8 @@ static int bpf_output(struct net *net, struct sock *sk, struct sk_buff *skb)return dst->lwtstate->orig_output (net, sk, skb); } -static int xmit_check_hhlen (struct sk_buff *skb) +static int xmit_check_hhlen (struct sk_buff *skb,int hh_len) { -int hh_len =skb_dst (skb)->dev->hard_header_len; -if (skb_headroom (skb) < hh_len) {int nhead =HH_DATA_ALIGN (hh_len -skb_headroom (skb));
@@ -274,6 +272,7 @@ static int bpf_xmit(struct sk_buff *skb) bpf =bpf_lwt_lwtunnel (dst->lwtstate);if (bpf->xmit.prog) { +int hh_len = dst->dev->hard_header_len;__be16 proto = skb->protocol;int ret;
@@ -291,7 +290,7 @@ static int bpf_xmit(struct sk_buff *skb)/* If the header was expanded, headroom might be too * small for L2 header to come, expand as needed. */ - ret =xmit_check_hhlen (skb); + ret =xmit_check_hhlen (skb, hh_len);if (unlikely (ret))return ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 104/225 pinctrl: rockchip: fix RK3308 pinmux bits
In reply to Greg Kroah-HartmanFrom: Luca Ceresoli <[email protected]>
[ Upstream commit 1f3e25a068832f8892a5ff71467622d012f5bc9f ]
Some of the pinmuxing bits described in rk3308_mux_recalced_data are wrong, pointing to non-existing registers.
Fix the entire table.
Also add a comment in front of each entry with the same string that appears in the datasheet to make the table easier to compare with the docs.
This fix has been tested on real hardware for the gpio3b3_sel entry.
--- drivers/pinctrl/pinctrl-rockchip.c | 45 ++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 15 deletions(-)
drivers/pinctrl/pinctrl-rockchip.c +30 -15
@@ -457,95 +457,110 @@ static struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = {static struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = { { +/* gpio1b6_sel */ .num =1 , .pin =14 , .reg =0x28 , .bit =12 , .mask =0xf }, { +/* gpio1b7_sel */ .num =1 , .pin =15 , .reg =0x2c , .bit =0 , .mask =0x3 }, { +/* gpio1c2_sel */ .num =1 , .pin =18 , .reg =0x30 , .bit =4 , .mask =0xf }, { +/* gpio1c3_sel */ .num =1 , .pin =19 , .reg =0x30 , .bit =8 , .mask =0xf }, { +/* gpio1c4_sel */ .num =1 , .pin =20 , .reg =0x30 , .bit =12 , .mask =0xf }, { +/* gpio1c5_sel */ .num =1 , .pin =21 , .reg =0x34 , .bit =0 , .mask =0xf }, { +/* gpio1c6_sel */ .num =1 , .pin =22 , .reg =0x34 , .bit =4 , .mask =0xf }, { +/* gpio1c7_sel */ .num =1 , .pin =23 , .reg =0x34 , .bit =8 , .mask =0xf }, { +/* gpio3b4_sel */ .num =3 , .pin =12 , .reg =0x68 , .bit =8 , .mask =0xf }, { +/* gpio3b5_sel */ .num =3 , .pin =13 , .reg =0x68 , .bit =12 , .mask =0xf }, { +/* gpio2a2_sel */ .num =2 , .pin =2 , - .reg =0x608 , - .bit =0 , - .mask =0x7 + .reg =0x40 , + .bit =4 , + .mask =0x3 }, { +/* gpio2a3_sel */ .num =2 , .pin =3 , - .reg =0x608 , - .bit =4 , - .mask =0x7 + .reg =0x40 , + .bit =6 , + .mask =0x3 }, { +/* gpio2c0_sel */ .num =2 , .pin =16 , - .reg =0x610 , - .bit =8 , - .mask =0x7 + .reg =0x50 , + .bit =0 , + .mask =0x3 }, { +/* gpio3b2_sel */ .num =3 , .pin =10 , - .reg =0x610 , - .bit =0 , - .mask =0x7 + .reg =0x68 , + .bit =4 , + .mask =0x3 }, { +/* gpio3b3_sel */ .num =3 , .pin =11 , - .reg =0x610 , - .bit =4 , - .mask =0x7 + .reg =0x68 , + .bit =6 , + .mask =0x3 }, };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 105/225 tcp: md5: incorrect tcp_header_len for incoming connections
In reply to Greg Kroah-HartmanFrom: Francesco Ruggeri <[email protected]>
[ Upstream commit 5b0b9e4c2c895227c8852488b3f09839233bba54 ]
In tcp_create_openreq_child we adjust tcp_header_len for md5 using the remote address in newsk. But that address is still 0 in newsk at this point, and it is only set later by the callers (tcp_v[46]_syn_recv_sock). Use the address from the request socket instead.
--- net/ipv4/tcp_minisocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_minisocks.c +1 -1
@@ -531,7 +531,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newtp->tsoffset = treq->ts_off;#ifdef CONFIG_TCP_MD5SIG newtp->md5sig_info =NULL ;/*XXX*/ -if (newtp->af_specific->md5_lookup (sk, newsk)) +if (treq->af_specific->req_md5_lookup (sk,req_to_sk (req))) newtp->tcp_header_len +=TCPOLEN_MD5SIG_ALIGNED ;#endif if (skb->len >=TCP_MSS_DEFAULT + newtp->tcp_header_len)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 106/225 pinctrl: stm32: Keep pinctrl block clock enabled when LEVEL IRQ requested
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 05d8af449d93e04547b4c6b328e39c890bc803f4 ]
The current EOI handler for LEVEL triggered interrupts calls clk_enable(), register IO, clk_disable(). The clock manipulation requires locking which happens with IRQs disabled in clk_enable_lock(). Instead of turning the clock on and off all the time, enable the clock in case LEVEL interrupt is requested and keep the clock enabled until all LEVEL interrupts are freed. The LEVEL interrupts are an exception on this platform and seldom used, so this does not affect the common case.
This simplifies the LEVEL interrupt handling considerably and also fixes the following splat found when using preempt-rt:
------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at kernel/locking/rtmutex.c:2040 __rt_mutex_trylock+0x37/0x62 Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.10.109-rt65-stable-standard-00068-g6a5afc4b1217 #85 Hardware name: STM32 (Device Tree Support) [<c010a45d>] (unwind_backtrace) from [<c010766f>] (show_stack+0xb/0xc) [<c010766f>] (show_stack) from [<c06353ab>] (dump_stack+0x6f/0x84) [<c06353ab>] (dump_stack) from [<c01145e3>] (__warn+0x7f/0xa4) [<c01145e3>] (__warn) from [<c063386f>] (warn_slowpath_fmt+0x3b/0x74) [<c063386f>] (warn_slowpath_fmt) from [<c063b43d>] (__rt_mutex_trylock+0x37/0x62) [<c063b43d>] (__rt_mutex_trylock) from [<c063c053>] (rt_spin_trylock+0x7/0x16) [<c063c053>] (rt_spin_trylock) from [<c036a2f3>] (clk_enable_lock+0xb/0x80) [<c036a2f3>] (clk_enable_lock) from [<c036ba69>] (clk_core_enable_lock+0x9/0x18) [<c036ba69>] (clk_core_enable_lock) from [<c034e9f3>] (stm32_gpio_get+0x11/0x24) [<c034e9f3>] (stm32_gpio_get) from [<c034ef43>] (stm32_gpio_irq_trigger+0x1f/0x48) [<c034ef43>] (stm32_gpio_irq_trigger) from [<c014aa53>] (handle_fasteoi_irq+0x71/0xa8) [<c014aa53>] (handle_fasteoi_irq) from [<c0147111>] (generic_handle_irq+0x19/0x22) [<c0147111>] (generic_handle_irq) from [<c014752d>] (__handle_domain_irq+0x55/0x64) [<c014752d>] (__handle_domain_irq) from [<c0346f13>] (gic_handle_irq+0x53/0x64) [<c0346f13>] (gic_handle_irq) from [<c0100ba5>] (__irq_svc+0x65/0xc0) Exception stack(0xc0e01f18 to 0xc0e01f60) 1f00: 0000300c 00000000 1f20: 0000300c c010ff01 00000000 00000000 c0e00000 c0e07714 00000001 c0e01f78 1f40: c0e07758 00000000 ef7cd0ff c0e01f68 c010554b c0105542 40000033 ffffffff [<c0100ba5>] (__irq_svc) from [<c0105542>] (arch_cpu_idle+0xc/0x1e) [<c0105542>] (arch_cpu_idle) from [<c063be95>] (default_idle_call+0x21/0x3c) [<c063be95>] (default_idle_call) from [<c01324f7>] (do_idle+0xe3/0x1e4) [<c01324f7>] (do_idle) from [<c01327b3>] (cpu_startup_entry+0x13/0x14) [<c01327b3>] (cpu_startup_entry) from [<c0a00c13>] (start_kernel+0x397/0x3d4) [<c0a00c13>] (start_kernel) from [<00000000>] (0x0) ---[ end trace 0000000000000002 ]---
Power consumption measured on STM32MP157C DHCOM SoM is not increased or is below noise threshold.
--- drivers/pinctrl/stm32/pinctrl-stm32.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
drivers/pinctrl/stm32/pinctrl-stm32.c +17 -2
@@ -225,6 +225,13 @@ static void stm32_gpio_free(struct gpio_chip *chip, unsigned offset)pinctrl_gpio_free (chip->base + offset); } +static int stm32_gpio_get_noclk (struct gpio_chip *chip,unsigned int offset) +{ +struct stm32_gpio_bank *bank =gpiochip_get_data (chip); + +return !!(readl_relaxed (bank->base +STM32_GPIO_IDR ) &BIT (offset)); +} +static int stm32_gpio_get (struct gpio_chip *chip,unsigned offset) {struct stm32_gpio_bank *bank =gpiochip_get_data (chip);
@@ -232,7 +239,7 @@ static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset)clk_enable (bank->clk); - ret = !!(readl_relaxed (bank->base +STM32_GPIO_IDR ) &BIT (offset)); + ret =stm32_gpio_get_noclk (chip, offset);clk_disable (bank->clk);
@@ -316,7 +323,7 @@ static void stm32_gpio_irq_trigger(struct irq_data *d)return ;/* If level interrupt type then retrig */ - level =stm32_gpio_get (&bank->gpio_chip, d->hwirq); + level =stm32_gpio_get_noclk (&bank->gpio_chip, d->hwirq);if ((level ==0 && bank->irq_type[d->hwirq] ==IRQ_TYPE_LEVEL_LOW ) || (level ==1 && bank->irq_type[d->hwirq] ==IRQ_TYPE_LEVEL_HIGH ))irq_chip_retrigger_hierarchy (d);
@@ -358,6 +365,7 @@ static int stm32_gpio_irq_request_resources(struct irq_data *irq_data) {struct stm32_gpio_bank *bank = irq_data->domain->host_data;struct stm32_pinctrl *pctl =dev_get_drvdata (bank->gpio_chip.parent); +unsigned long flags;int ret; ret =stm32_gpio_direction_input (&bank->gpio_chip, irq_data->hwirq);
@@ -371,6 +379,10 @@ static int stm32_gpio_irq_request_resources(struct irq_data *irq_data)return ret; } + flags =irqd_get_trigger_type (irq_data); +if (flags &IRQ_TYPE_LEVEL_MASK ) +clk_enable (bank->clk); +return 0 ; }
@@ -378,6 +390,9 @@ static void stm32_gpio_irq_release_resources(struct irq_data *irq_data) {struct stm32_gpio_bank *bank = irq_data->domain->host_data; +if (bank->irq_type[irq_data->hwirq] &IRQ_TYPE_LEVEL_MASK ) +clk_disable (bank->clk); +gpiochip_unlock_as_irq (&bank->gpio_chip, irq_data->hwirq); }
Signature · 9 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Greg Kroah-Hartman
maintainerPATCH 107/225 tcp: ensure to use the most recently sent skb when filling the rate sample
In reply to Greg Kroah-HartmanFrom: Pengcheng Yang <[email protected]>
[ Upstream commit b253a0680ceadc5d7b4acca7aa2d870326cad8ad ]
If an ACK (s)acks multiple skbs, we favor the information from the most recently sent skb by choosing the skb with the highest prior_delivered count. But in the interval between receiving ACKs, we send multiple skbs with the same prior_delivered, because the tp->delivered only changes when we receive an ACK.
We used RACK's solution, copying tcp_rack_sent_after() as tcp_skb_sent_after() helper to determine "which packet was sent last?". Later, we will use tcp_skb_sent_after() instead in RACK.
--- include/net/tcp.h | 6 ++++++ net/ipv4/tcp_rate.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
include/net/tcp.h +6 -0
@@ -1042,6 +1042,7 @@ struct rate_sample {int losses;/* number of packets marked lost upon ACK */ u32 acked_sacked;/* number of packets newly (S)ACKed upon ACK */ u32 prior_in_flight;/* in flight before this ACK */ +u32 last_end_seq;/* end_seq of most recently ACKed packet */ bool is_app_limited;/* is sample from packet with bubble in pipe? */ bool is_retrans;/* is sample from retransmission? */ bool is_ack_delayed;/* is this (likely) a delayed ACK? */
@@ -1164,6 +1165,11 @@ void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost, bool is_sack_reneg, struct rate_sample *rs);void tcp_rate_check_app_limited (struct sock *sk); +static inline bool tcp_skb_sent_after (u64 t1,u64 t2,u32 seq1,u32 seq2) +{ +return t1 > t2 || (t1 == t2 &&after (seq1, seq2)); +} +/* These functions determine how the current flow behaves in respect of SACK * handling. SACK is negotiated with the peer, and therefore it can vary * between different flows.
net/ipv4/tcp_rate.c +8 -3
@@ -74,27 +74,32 @@ void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb)* * If an ACK (s)acks multiple skbs (e.g., stretched-acks), this function is * called multiple times. We favor the information from the most recently -* sent skb, i.e., the skb with the highest prior_delivered count. +* sent skb, i.e., the skb with the most recently sent time and the highest +* sequence. */ void tcp_rate_skb_delivered (struct sock *sk,struct sk_buff *skb,struct rate_sample *rs) {struct tcp_sock *tp =tcp_sk (sk);struct tcp_skb_cb *scb =TCP_SKB_CB (skb); +u64 tx_tstamp;if (!scb->tx.delivered_mstamp)return ; + tx_tstamp =tcp_skb_timestamp_us (skb);if (!rs->prior_delivered || -after (scb->tx.delivered, rs->prior_delivered)) { +tcp_skb_sent_after (tx_tstamp, tp->first_tx_mstamp, + scb->end_seq, rs->last_end_seq)) { rs->prior_delivered_ce = scb->tx.delivered_ce; rs->prior_delivered = scb->tx.delivered; rs->prior_mstamp = scb->tx.delivered_mstamp; rs->is_app_limited = scb->tx.is_app_limited; rs->is_retrans = scb->sacked &TCPCB_RETRANS ; + rs->last_end_seq = scb->end_seq;/* Record send time of most recently ACKed packet: */ - tp->first_tx_mstamp =tcp_skb_timestamp_us (skb); + tp->first_tx_mstamp = tx_tstamp;/* Find the duration of the "send phase" of this window: */ rs->interval_us =tcp_stamp_us_delta (tp->first_tx_mstamp, scb->tx.first_tx_mstamp);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 108/225 wireguard: device: check for metadata_dst with skb_valid_dst()
In reply to Greg Kroah-HartmanFrom: Nikolay Aleksandrov <[email protected]>
[ Upstream commit 45ac774c33d834fe9d4de06ab5f1022fe8cd2071 ]
When we try to transmit an skb with md_dst attached through wireguard we hit a null pointer dereference in wg_xmit() due to the use of dst_mtu() which calls into dst_blackhole_mtu() which in turn tries to dereference dst->dev.
Since wireguard doesn't use md_dsts we should use skb_valid_dst(), which checks for DST_METADATA flag, and if it's set, then falls back to wireguard's device mtu. That gives us the best chance of transmitting the packet; otherwise if the blackhole netdev is used we'd get ETH_MIN_MTU.
[ 263.693506] BUG: kernel NULL pointer dereference, address: 00000000000000e0 [ 263.693908] #PF: supervisor read access in kernel mode [ 263.694174] #PF: error_code(0x0000) - not-present page [ 263.694424] PGD 0 P4D 0 [ 263.694653] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 263.694876] CPU: 5 PID: 951 Comm: mausezahn Kdump: loaded Not tainted 5.18.0-rc1+ #522 [ 263.695190] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1.fc35 04/01/2014 [ 263.695529] RIP: 0010:dst_blackhole_mtu+0x17/0x20 [ 263.695770] Code: 00 00 00 0f 1f 44 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 8b 47 10 48 83 e0 fc 8b 40 04 85 c0 75 09 48 8b 07 <8b> 80 e0 00 00 00 c3 66 90 0f 1f 44 00 00 48 89 d7 be 01 00 00 00 [ 263.696339] RSP: 0018:ffffa4a4422fbb28 EFLAGS: 00010246 [ 263.696600] RAX: 0000000000000000 RBX: ffff8ac9c3553000 RCX: 0000000000000000 [ 263.696891] RDX: 0000000000000401 RSI: 00000000fffffe01 RDI: ffffc4a43fb48900 [ 263.697178] RBP: ffffa4a4422fbb90 R08: ffffffff9622635e R09: 0000000000000002 [ 263.697469] R10: ffffffff9b69a6c0 R11: ffffa4a4422fbd0c R12: ffff8ac9d18b1a00 [ 263.697766] R13: ffff8ac9d0ce1840 R14: ffff8ac9d18b1a00 R15: ffff8ac9c3553000 [ 263.698054] FS: 00007f3704c337c0(0000) GS:ffff8acaebf40000(0000) knlGS:0000000000000000 [ 263.698470] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 263.698826] CR2: 00000000000000e0 CR3: 0000000117a5c000 CR4: 00000000000006e0 [ 263.699214] Call Trace: [ 263.699505] <TASK> [ 263.699759] wg_xmit+0x411/0x450 [ 263.700059] ? bpf_skb_set_tunnel_key+0x46/0x2d0 [ 263.700382] ? dev_queue_xmit_nit+0x31/0x2b0 [ 263.700719] dev_hard_start_xmit+0xd9/0x220 [ 263.701047] __dev_queue_xmit+0x8b9/0xd30 [ 263.701344] __bpf_redirect+0x1a4/0x380 [ 263.701664] __dev_queue_xmit+0x83b/0xd30 [ 263.701961] ? packet_parse_headers+0xb4/0xf0 [ 263.702275] packet_sendmsg+0x9a8/0x16a0 [ 263.702596] ? _raw_spin_unlock_irqrestore+0x23/0x40 [ 263.702933] sock_sendmsg+0x5e/0x60 [ 263.703239] __sys_sendto+0xf0/0x160 [ 263.703549] __x64_sys_sendto+0x20/0x30 [ 263.703853] do_syscall_64+0x3b/0x90 [ 263.704162] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 263.704494] RIP: 0033:0x7f3704d50506 [ 263.704789] Code: 48 c7 c0 ff ff ff ff eb b7 66 2e 0f 1f 84 00 00 00 00 00 90 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 11 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 72 c3 90 55 48 83 ec 30 44 89 4c 24 2c 4c 89 [ 263.705652] RSP: 002b:00007ffe954b0b88 EFLAGS: 00000246 ORIG_RAX: 000000000000002c [ 263.706141] RAX: ffffffffffffffda RBX: 0000558bb259b490 RCX: 00007f3704d50506 [ 263.706544] RDX: 000000000000004a RSI: 0000558bb259b7b2 RDI: 0000000000000003 [ 263.706952] RBP: 0000000000000000 R08: 00007ffe954b0b90 R09: 0000000000000014 [ 263.707339] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe954b0b90 [ 263.707735] R13: 000000000000004a R14: 0000558bb259b7b2 R15: 0000000000000001 [ 263.708132] </TASK> [ 263.708398] Modules linked in: bridge netconsole bonding [last unloaded: bridge] [ 263.708942] CR2: 00000000000000e0
--- drivers/net/wireguard/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireguard/device.c +2 -1
@@ -19,6 +19,7 @@#include <linux/if_arp.h> #include <linux/icmp.h> #include <linux/suspend.h> +#include <net/dst_metadata.h> #include <net/icmp.h> #include <net/rtnetlink.h> #include <net/ip_tunnels.h>
@@ -152,7 +153,7 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev) goto err_peer; } - mtu =skb_dst (skb) ?dst_mtu (skb_dst (skb)) : dev->mtu; + mtu =skb_valid_dst (skb) ?dst_mtu (skb_dst (skb)) : dev->mtu;__skb_queue_head_init (&packets);if (!skb_is_gso (skb)) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 109/225 sctp: check asoc strreset_chunk in sctp_generate_reconf_event
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit 165e3e17fe8fe6a8aab319bc6e631a2e23b9a857 ]
A null pointer reference issue can be triggered when the response of a stream reconf request arrives after the timer is triggered, such as:
send Incoming SSN Reset Request --->
CPU0:
reconf timer is triggered,
go to the handler code before hold sk lock
<--- reply with Outgoing SSN Reset Request
CPU1:
process Outgoing SSN Reset Request,
and set asoc->strreset_chunk to NULL
CPU0:
continue the handler code, hold sk lock,
and try to hold asoc->strreset_chunk, crash!
In Ying Xu's testing, the call trace is:
[ ] BUG: kernel NULL pointer dereference, address: 0000000000000010 [ ] RIP: 0010:sctp_chunk_hold+0xe/0x40 [sctp]
[ ] Call Trace:
[ ] <IRQ> [ ] sctp_sf_send_reconf+0x2c/0x100 [sctp] [ ] sctp_do_sm+0xa4/0x220 [sctp] [ ] sctp_generate_reconf_event+0xbd/0xe0 [sctp] [ ] call_timer_fn+0x26/0x130
This patch is to fix it by returning from the timer handler if asoc strreset_chunk is already set to NULL.
--- net/sctp/sm_sideeffect.c | 4 ++++ 1 file changed, 4 insertions(+)
net/sctp/sm_sideeffect.c +4 -0
@@ -458,6 +458,10 @@ void sctp_generate_reconf_event(struct timer_list *t) goto out_unlock; } +/* This happens when the response arrives after the timer is triggered. */ +if (!asoc->strreset_chunk) + goto out_unlock; + error = sctp_do_sm(net, SCTP_EVENT_T_TIMEOUT, SCTP_ST_TIMEOUT(SCTP_EVENT_TIMEOUT_RECONF), asoc->state, asoc->ep, asoc,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 110/225 ARM: dts: imx6ull-colibri: fix vqmmc regulator
In reply to Greg Kroah-HartmanFrom: Max Krummenacher <[email protected]>
[ Upstream commit 45974e4276a8d6653394f66666fc57d8ffa6de9a ]
The correct spelling for the property is gpios. Otherwise, the regulator will neither reserve nor control any GPIOs. Thus, any SD/MMC card which can use UHS-I modes will fail.
--- arch/arm/boot/dts/imx6ull-colibri.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx6ull-colibri.dtsi +1 -1
@@ -37,7 +37,7 @@ reg_module_3v3_avdd: regulator-module-3v3-avdd { reg_sd1_vmmc: regulator-sd1-vmmc { compatible = "regulator-gpio"; - gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpio5 9 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_snvs_reg_sd>; regulator-always-on;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 111/225 arm64: dts: imx8mn-ddr4-evk: Describe the 32.768 kHz PMIC clock
In reply to Greg Kroah-HartmanFrom: Fabio Estevam <[email protected]>
[ Upstream commit 0310b5aa0656a94102344f1e9ae2892e342a665d ]
The ROHM BD71847 PMIC has a 32.768 kHz clock.
Describe the PMIC clock to fix the following boot errors:
bd718xx-clk bd71847-clk.1.auto: No parent clk found
bd718xx-clk: probe of bd71847-clk.1.auto failed with error -22
Based on the same fix done for imx8mm-evk as per commit a6a355ede574 ("arm64: dts: imx8mm-evk: Add 32.768 kHz clock to PMIC")
--- arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts +4 -0
@@ -59,6 +59,10 @@ pmic@4b { interrupts = <3 IRQ_TYPE_LEVEL_LOW>; rohm,reset-snvs-powered; + #clock-cells = <0>; + clocks = <&osc_32k 0>; + clock-output-names = "clk-32k-out"; + regulators { buck1_reg: BUCK1 { regulator-name = "buck1";
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 112/225 pinctrl: pistachio: fix use of irq_of_parse_and_map()
In reply to Greg Kroah-HartmanFrom: Lv Ruyi <[email protected]>
[ Upstream commit 0c9843a74a85224a89daa81fa66891dae2f930e1 ]
The irq_of_parse_and_map() function returns 0 on failure, and does not return an negative value.
--- drivers/pinctrl/pinctrl-pistachio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pinctrl/pinctrl-pistachio.c +3 -3
@@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) } irq =irq_of_parse_and_map (child,0 ); -if (irq <0 ) { -dev_err (pctl->dev,"No IRQ for bank %u: %d\n" , i, irq); +if (!irq) { +dev_err (pctl->dev,"No IRQ for bank %u\n" , i);of_node_put (child); - ret = irq; + ret = -EINVAL ; goto err; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 113/225 cpufreq: fix memory leak in sun50i_cpufreq_nvmem_probe
In reply to Greg Kroah-HartmanFrom: Xiaobing Luo <[email protected]>
[ Upstream commit 1aa24a8f3b5133dae4bc1e57427e345445f3e902 ]
--------------------------------------------
unreferenced object 0xffff000010742a00 (size 128):
comm "swapper/0", pid 1, jiffies 4294902015 (age 1187.652s) hex dump (first 32 bytes):
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 00 ................
backtrace:
[<00000000b4dfebaa>] __kmalloc+0x338/0x474
[<00000000d6e716db>] sun50i_cpufreq_nvmem_probe+0xc4/0x36c
[<000000007d6082a0>] platform_probe+0x98/0x11c
[<00000000c990f549>] really_probe+0x234/0x5a0
[<000000002d9fecc6>] __driver_probe_device+0x194/0x224
[<00000000cf0b94fa>] driver_probe_device+0x64/0x13c
[<00000000f238e4cf>] __device_attach_driver+0xf8/0x180
[<000000006720e418>] bus_for_each_drv+0xf8/0x160
[<00000000df4f14f6>] __device_attach+0x174/0x29c
[<00000000782002fb>] device_initial_probe+0x20/0x30
[<00000000c2681b06>] bus_probe_device+0xfc/0x110
[<00000000964cf3bd>] device_add+0x5f0/0xcd0
[<000000004b9264e3>] platform_device_add+0x198/0x390
[<00000000fa82a9d0>] platform_device_register_full+0x178/0x210
[<000000009a5daf13>] sun50i_cpufreq_init+0xf8/0x168
[<000000000377cc7c>] do_one_initcall+0xe4/0x570
--------------------------------------------if sun50i_cpufreq_get_efuse failed, then opp_tables leak.
--- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/cpufreq/sun50i-cpufreq-nvmem.c +3 -1
@@ -98,8 +98,10 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev)return -ENOMEM ; ret =sun50i_cpufreq_get_efuse (&speed); -if (ret) +if (ret) { +kfree (opp_tables);return ret; + }snprintf (name,MAX_NAME_LEN ,"speed%d" , speed);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 114/225 net: hns3: clear inited state and stop client after failed to register netdev
In reply to Greg Kroah-HartmanFrom: Jian Shen <[email protected]>
[ Upstream commit e98365afc1e94ea1609268866a44112b3572c58b ]
If failed to register netdev, it needs to clear INITED state and stop client in case of cause problem when concurrency with uninitialized process of driver.
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +9 -0
@@ -5132,6 +5132,13 @@ static void hns3_state_init(struct hnae3_handle *handle)set_bit (HNS3_NIC_STATE_RXD_ADV_LAYOUT_ENABLE , &priv->state); } +static void hns3_state_uninit (struct hnae3_handle *handle) +{ +struct hns3_nic_priv *priv = handle->priv; + +clear_bit (HNS3_NIC_STATE_INITED , &priv->state); +} +static int hns3_client_init (struct hnae3_handle *handle) {struct pci_dev *pdev = handle->pdev;
@@ -5249,7 +5256,9 @@ static int hns3_client_init(struct hnae3_handle *handle)return ret; out_reg_netdev_fail: +hns3_state_uninit (handle);hns3_dbg_uninit (handle); +hns3_client_stop (handle); out_client_start:hns3_free_rx_cpu_rmap (netdev);hns3_nic_uninit_irq (priv);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 115/225 net: hns3: fix error log of tx/rx tqps stats
In reply to Greg Kroah-HartmanFrom: Peng Li <[email protected]>
[ Upstream commit 123521b6b260d901937d3fb598ab88d260c857a6 ]
The comments in function hclge_comm_tqps_update_stats is not right, so fix it.
--- .../hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c +2 -2
@@ -75,7 +75,7 @@ int hclge_comm_tqps_update_stats(struct hnae3_handle *handle, ret =hclge_comm_cmd_send (hw, &desc,1 );if (ret) {dev_err (&hw->cmq.csq.pdev->dev, -"failed to get tqp stat, ret = %d, tx = %u.\n" , +"failed to get tqp stat, ret = %d, rx = %u.\n" , ret, i);return ret; }
@@ -89,7 +89,7 @@ int hclge_comm_tqps_update_stats(struct hnae3_handle *handle, ret =hclge_comm_cmd_send (hw, &desc,1 );if (ret) {dev_err (&hw->cmq.csq.pdev->dev, -"failed to get tqp stat, ret = %d, rx = %u.\n" , +"failed to get tqp stat, ret = %d, tx = %u.\n" , ret, i);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 116/225 net: hns3: modify the return code of hclge_get_ring_chain_from_mbx
In reply to Greg Kroah-HartmanFrom: Jie Wang <[email protected]>
[ Upstream commit 48009e9972974c52a5f649f761862dd67bce3d13 ]
Currently, function hclge_get_ring_chain_from_mbx will return -ENOMEM if ring_num is bigger than HCLGE_MBX_MAX_RING_CHAIN_PARAM_NUM. It is better to return -EINVAL for the invalid parameter case.
So this patch fixes it by return -EINVAL in this abnormal branch.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +1 -1
@@ -176,7 +176,7 @@ static int hclge_get_ring_chain_from_mbx( ring_num = req->msg.ring_num;if (ring_num >HCLGE_MBX_MAX_RING_CHAIN_PARAM_NUM ) -return -ENOMEM ; +return -EINVAL ;for (i =0 ; i < ring_num; i++) {if (req->msg.param[i].tqp_index >= vport->nic.kinfo.rss_size) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 117/225 net: hns3: add validity check for message data length
In reply to Greg Kroah-HartmanFrom: Jian Shen <[email protected]>
[ Upstream commit 7d413735cb18ff73aaba3457b16b08332e8d3cc4 ]
Add validity check for message data length in function hclge_send_mbx_msg(), avoid unexpected overflow.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +7 -0
@@ -94,6 +94,13 @@ static int hclge_send_mbx_msg(struct hclge_vport *vport, u8 *msg, u16 msg_len,enum hclge_comm_cmd_status status;struct hclge_desc desc; +if (msg_len >HCLGE_MBX_MAX_MSG_SIZE ) { +dev_err (&hdev->pdev->dev, +"msg data length(=%u) exceeds maximum(=%u)\n" , + msg_len,HCLGE_MBX_MAX_MSG_SIZE ); +return -EMSGSIZE ; + } + resp_pf_to_vf = (struct hclge_mbx_pf_to_vf_cmd *)desc.data;hclge_cmd_setup_basic_desc (&desc,HCLGEVF_OPC_MBX_PF_TO_VF , false);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 118/225 net: hns3: add return value for mailbox handling in PF
In reply to Greg Kroah-HartmanFrom: Jian Shen <[email protected]>
[ Upstream commit c59d606296842409a6e5a4828235b0bd46b12bc4 ]
Currently, there are some querying mailboxes sent from VF to PF, and VF will wait the PF's handling result. For mailbox HCLGE_MBX_GET_QID_IN_PF and HCLGE_MBX_GET_RSS_KEY, it may fail when the input parameter is invalid, but the prototype of their handler function is void. In this case, PF always return success to VF, which may cause the VF get incorrect result.
Fixes it by adding return value for these function.
--- .../hisilicon/hns3/hns3pf/hclge_mbx.c | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +12 -10
@@ -594,9 +594,9 @@ static int hclge_set_vf_mtu(struct hclge_vport *vport,return hclge_set_vport_mtu (vport, mtu); } -static void hclge_get_queue_id_in_pf (struct hclge_vport *vport, -struct hclge_mbx_vf_to_pf_cmd *mbx_req, -struct hclge_respond_to_vf_msg *resp_msg) +static int hclge_get_queue_id_in_pf (struct hclge_vport *vport, +struct hclge_mbx_vf_to_pf_cmd *mbx_req, +struct hclge_respond_to_vf_msg *resp_msg) {struct hnae3_handle *handle = &vport->nic;struct hclge_dev *hdev = vport->back;
@@ -606,17 +606,18 @@ static void hclge_get_queue_id_in_pf(struct hclge_vport *vport,if (queue_id >= handle->kinfo.num_tqps) {dev_err (&hdev->pdev->dev,"Invalid queue id(%u) from VF %u\n" , queue_id, mbx_req->mbx_src_vfid); -return ; +return -EINVAL ; } qid_in_pf =hclge_covert_handle_qid_global (&vport->nic, queue_id);memcpy (resp_msg->data, &qid_in_pf,sizeof (qid_in_pf)); resp_msg->len =sizeof (qid_in_pf); +return 0 ; } -static void hclge_get_rss_key (struct hclge_vport *vport, -struct hclge_mbx_vf_to_pf_cmd *mbx_req, -struct hclge_respond_to_vf_msg *resp_msg) +static int hclge_get_rss_key (struct hclge_vport *vport, +struct hclge_mbx_vf_to_pf_cmd *mbx_req, +struct hclge_respond_to_vf_msg *resp_msg) {#define HCLGE_RSS_MBX_RESP_LEN 8struct hclge_dev *hdev = vport->back;
@@ -634,13 +635,14 @@ static void hclge_get_rss_key(struct hclge_vport *vport,dev_warn (&hdev->pdev->dev,"failed to get the rss hash key, the index(%u) invalid !\n" , index); -return ; +return -EINVAL ; }memcpy (resp_msg->data, &rss_cfg->rss_hash_key[index *HCLGE_RSS_MBX_RESP_LEN ],HCLGE_RSS_MBX_RESP_LEN ); resp_msg->len =HCLGE_RSS_MBX_RESP_LEN ; +return 0 ; }static void hclge_link_fail_parse (struct hclge_dev *hdev,u8 link_fail_code)
@@ -816,10 +818,10 @@ void hclge_mbx_handler(struct hclge_dev *hdev) "VF fail(%d) to set mtu\n", ret);break ;case HCLGE_MBX_GET_QID_IN_PF : -hclge_get_queue_id_in_pf (vport, req, &resp_msg); + ret =hclge_get_queue_id_in_pf (vport, req, &resp_msg);break ;case HCLGE_MBX_GET_RSS_KEY : -hclge_get_rss_key (vport, req, &resp_msg); + ret =hclge_get_rss_key (vport, req, &resp_msg);break ;case HCLGE_MBX_GET_LINK_MODE :hclge_get_link_mode (vport, req);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 119/225 net/smc: sync err code when tcp connection was refused
In reply to Greg Kroah-HartmanFrom: liuyacan <[email protected]>
[ Upstream commit 4e2e65e2e56c6ceb4ea1719360080c0af083229e ]
In the current implementation, when TCP initiates a connection to an unavailable [ip,port], ECONNREFUSED will be stored in the TCP socket, but SMC will not. However, some apps (like curl) use getsockopt(,,SO_ERROR,,) to get the error information, which makes them miss the error message and behave strangely.
--- net/smc/af_smc.c | 2 ++ 1 file changed, 2 insertions(+)
net/smc/af_smc.c +2 -0
@@ -1357,6 +1357,8 @@ static void smc_connect_work(struct work_struct *work) smc->sk.sk_state =SMC_CLOSED ;if (rc == -EPIPE || rc == -EAGAIN ) smc->sk.sk_err =EPIPE ; +else if (rc == -ECONNREFUSED ) + smc->sk.sk_err =ECONNREFUSED ;else if (signal_pending (current)) smc->sk.sk_err = -sock_intr_errno (timeo);sock_put (&smc->sk);/* passive closing */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 120/225 net: lan966x: fix a couple off by one bugs
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 9810c58c7051ae83e7ac326fca3daa823da6b778 ]
The lan966x->ports[] array has lan966x->num_phys_ports elements. These are assigned in lan966x_probe(). That means the > comparison should be changed to >=.
The first off by one check is harmless but the second one could lead to an out of bounds access and a crash.
--- drivers/net/ethernet/microchip/lan966x/lan966x_mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/microchip/lan966x/lan966x_mac.c +2 -2
@@ -346,7 +346,7 @@ static void lan966x_mac_irq_process(struct lan966x *lan966x, u32 row,lan966x_mac_process_raw_entry (&raw_entries[column], mac, &vid, &dest_idx); -if (WARN_ON (dest_idx > lan966x->num_phys_ports)) +if (WARN_ON (dest_idx >= lan966x->num_phys_ports))continue ;/* If the entry in SW is found, then there is nothing
@@ -393,7 +393,7 @@ static void lan966x_mac_irq_process(struct lan966x *lan966x, u32 row,lan966x_mac_process_raw_entry (&raw_entries[column], mac, &vid, &dest_idx); -if (WARN_ON (dest_idx > lan966x->num_phys_ports)) +if (WARN_ON (dest_idx >= lan966x->num_phys_ports))continue ; mac_entry =lan966x_mac_alloc_entry (mac, vid, dest_idx);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 121/225 ip_gre: Make o_seqno start from 0 in native mode
In reply to Greg Kroah-HartmanFrom: Peilin Ye <[email protected]>
[ Upstream commit ff827beb706ed719c766acf36449801ded0c17fc ]
For GRE and GRETAP devices, currently o_seqno starts from 1 in native mode. According to RFC 2890 2.2., "The first datagram is sent with a sequence number of 0." Fix it.
It is worth mentioning that o_seqno already starts from 0 in collect_md mode, see gre_fb_xmit(), where tunnel->o_seqno is passed to gre_build_header() before getting incremented.
--- net/ipv4/ip_gre.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
net/ipv4/ip_gre.c +3 -5
@@ -459,14 +459,12 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev, __be16 proto) {struct ip_tunnel *tunnel =netdev_priv (dev); - -if (tunnel->parms.o_flags &TUNNEL_SEQ ) - tunnel->o_seqno++; +__be16 flags = tunnel->parms.o_flags;/* Push GRE header. */ gre_build_header (skb, tunnel->tun_hlen, - tunnel->parms.o_flags, proto, tunnel->parms.o_key, -htonl (tunnel->o_seqno)); + flags, proto, tunnel->parms.o_key, + (flags &TUNNEL_SEQ ) ?htonl (tunnel->o_seqno++) :0 );ip_tunnel_xmit (skb, dev, tnl_params, tnl_params->protocol); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 122/225 ip6_gre: Make o_seqno start from 0 in native mode
In reply to Greg Kroah-HartmanFrom: Peilin Ye <[email protected]>
[ Upstream commit fde98ae91f79cab4e020f40c35ed23cbdc59661c ]
For IP6GRE and IP6GRETAP devices, currently o_seqno starts from 1 in native mode. According to RFC 2890 2.2., "The first datagram is sent with a sequence number of 0." Fix it.
It is worth mentioning that o_seqno already starts from 0 in collect_md mode, see the "if (tunnel->parms.collect_md)" clause in __gre6_xmit(), where tunnel->o_seqno is passed to gre_build_header() before getting incremented.
--- net/ipv6/ip6_gre.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
net/ipv6/ip6_gre.c +5 -6
@@ -724,6 +724,7 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, {struct ip6_tnl *tunnel =netdev_priv (dev);__be16 protocol; +__be16 flags;if (dev->type ==ARPHRD_ETHER )IPCB (skb)->flags =0 ;
@@ -739,7 +740,6 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,if (tunnel->parms.collect_md) {struct ip_tunnel_info *tun_info;const struct ip_tunnel_key *key; -__be16 flags;int tun_hlen; tun_info =skb_tunnel_info_txcheck (skb);
@@ -770,15 +770,14 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, : 0); }else { -if (tunnel->parms.o_flags &TUNNEL_SEQ ) - tunnel->o_seqno++; -if (skb_cow_head (skb, dev->needed_headroom ?: tunnel->hlen))return -ENOMEM ; -gre_build_header (skb, tunnel->tun_hlen, tunnel->parms.o_flags, + flags = tunnel->parms.o_flags; + +gre_build_header (skb, tunnel->tun_hlen, flags, protocol, tunnel->parms.o_key, -htonl (tunnel->o_seqno)); + (flags &TUNNEL_SEQ ) ?htonl (tunnel->o_seqno++) :0 ); } return ip6_tnl_xmit(skb, dev, dsfield, fl6, encap_limit, pmtu,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 123/225 ip_gre, ip6_gre: Fix race condition on o_seqno in collect_md mode
In reply to Greg Kroah-HartmanFrom: Peilin Ye <[email protected]>
[ Upstream commit 31c417c948d7f6909cb63f0ac3298f3c38f8ce20 ]
As pointed out by Jakub Kicinski, currently using TUNNEL_SEQ in collect_md mode is racy for [IP6]GRE[TAP] devices. Consider the following sequence of events:
1. An [IP6]GRE[TAP] device is created in collect_md mode using "ip link add ... external". "ip" ignores "[o]seq" if "external" is specified, so TUNNEL_SEQ is off, and the device is marked as NETIF_F_LLTX (i.e. it uses lockless TX);
2. Someone sets TUNNEL_SEQ on outgoing skb's, using e.g. bpf_skb_set_tunnel_key() in an eBPF program attached to this device;
3. gre_fb_xmit() or __gre6_xmit() processes these skb's:
gre_build_header(skb, tun_hlen, flags, protocol, tunnel_id_to_key32(tun_info->key.tun_id), (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) : 0); ^^^^^^^^^^^^^^^^^
Since we are not using the TX lock (&txq->_xmit_lock), multiple CPUs may try to do this tunnel->o_seqno++ in parallel, which is racy. Fix it by making o_seqno atomic_t.
As mentioned by Eric Dumazet in commit b790e01aee74 ("ip_gre: lockless xmit"), making o_seqno atomic_t increases "chance for packets being out of order at receiver" when NETIF_F_LLTX is on.
Maybe a better fix would be:
1. Do not ignore "oseq" in external mode. Users MUST specify "oseq" if they want the kernel to allow sequencing of outgoing packets;
2. Reject all outgoing TUNNEL_SEQ packets if the device was not created with "oseq".
Unfortunately, that would break userspace.
We could now make [IP6]GRE[TAP] devices always NETIF_F_LLTX, but let us do it in separate patches to keep this fix minimal.
--- include/net/ip6_tunnel.h | 2 +- include/net/ip_tunnels.h | 2 +- net/ipv4/ip_gre.c | 6 +++--- net/ipv6/ip6_gre.c | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-)
include/net/ip6_tunnel.h +1 -1
@@ -58,7 +58,7 @@ struct ip6_tnl {/* These fields used only by GRE */ __u32 i_seqno;/* The last seen seqno */ -__u32 o_seqno;/* The last output seqno */ +atomic_t o_seqno;/* The last output seqno */ int hlen;/* tun_hlen + encap_hlen */ int tun_hlen;/* Precalculated header length */ int encap_hlen;/* Encap header length (FOU,GUE) */
include/net/ip_tunnels.h +1 -1
@@ -116,7 +116,7 @@ struct ip_tunnel {/* These four fields used only by GRE */ u32 i_seqno;/* The last seen seqno */ -u32 o_seqno;/* The last output seqno */ +atomic_t o_seqno;/* The last output seqno */ int tun_hlen;/* Precalculated header length */ /* These four fields used only by ERSPAN */
net/ipv4/ip_gre.c +3 -3
@@ -464,7 +464,7 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev,/* Push GRE header. */ gre_build_header (skb, tunnel->tun_hlen, flags, proto, tunnel->parms.o_key, - (flags &TUNNEL_SEQ ) ?htonl (tunnel->o_seqno++) :0 ); + (flags &TUNNEL_SEQ ) ?htonl (atomic_fetch_inc (&tunnel->o_seqno)) :0 );ip_tunnel_xmit (skb, dev, tnl_params, tnl_params->protocol); }
@@ -502,7 +502,7 @@ static void gre_fb_xmit(struct sk_buff *skb, struct net_device *dev, (TUNNEL_CSUM |TUNNEL_KEY |TUNNEL_SEQ );gre_build_header (skb, tunnel_hlen, flags, proto,tunnel_id_to_key32 (tun_info->key.tun_id), - (flags &TUNNEL_SEQ ) ?htonl (tunnel->o_seqno++) :0 ); + (flags &TUNNEL_SEQ ) ?htonl (atomic_fetch_inc (&tunnel->o_seqno)) :0 );ip_md_tunnel_xmit (skb, dev,IPPROTO_GRE , tunnel_hlen);
@@ -579,7 +579,7 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev) }gre_build_header (skb,8 ,TUNNEL_SEQ , - proto,0 ,htonl (tunnel->o_seqno++)); + proto,0 ,htonl (atomic_fetch_inc (&tunnel->o_seqno)));ip_md_tunnel_xmit (skb, dev,IPPROTO_GRE , tunnel_hlen);
net/ipv6/ip6_gre.c +4 -3
@@ -766,7 +766,7 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,gre_build_header (skb, tun_hlen, flags, protocol,tunnel_id_to_key32 (tun_info->key.tun_id), - (flags &TUNNEL_SEQ ) ?htonl (tunnel->o_seqno++) + (flags &TUNNEL_SEQ ) ?htonl (atomic_fetch_inc (&tunnel->o_seqno)) :0 ); }else {
@@ -777,7 +777,8 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,gre_build_header (skb, tunnel->tun_hlen, flags, protocol, tunnel->parms.o_key, - (flags &TUNNEL_SEQ ) ?htonl (tunnel->o_seqno++) :0 ); + (flags &TUNNEL_SEQ ) ?htonl (atomic_fetch_inc (&tunnel->o_seqno)) + :0 ); } return ip6_tnl_xmit(skb, dev, dsfield, fl6, encap_limit, pmtu,
@@ -1055,7 +1056,7 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,/* Push GRE header. */ proto = (t->parms.erspan_ver ==1 ) ?htons (ETH_P_ERSPAN ) :htons (ETH_P_ERSPAN2 ); -gre_build_header (skb,8 ,TUNNEL_SEQ , proto,0 ,htonl (t->o_seqno++)); +gre_build_header (skb,8 ,TUNNEL_SEQ , proto,0 ,htonl (atomic_fetch_inc (&t->o_seqno)));/* TooBig packet may have updated dst->dev's mtu */ if (!t->parms.collect_md && dst &&dst_mtu (dst) > dst->dev->mtu)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 124/225 tcp: fix potential xmit stalls caused by TCP_NOTSENT_LOWAT
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 4bfe744ff1644fbc0a991a2677dc874475dd6776 ]
I had this bug sitting for too long in my pile, it is time to fix it.
Thanks to Doug Porter for reminding me of it!
We had various attempts in the past, including commit 0cbe6a8f089e ("tcp: remove SOCK_QUEUE_SHRUNK"), but the issue is that TCP stack currently only generates EPOLLOUT from input path, when tp->snd_una has advanced and skb(s) cleaned from rtx queue.
If a flow has a big RTT, and/or receives SACKs, it is possible that the notsent part (tp->write_seq - tp->snd_nxt) reaches 0 and no more data can be sent until tp->snd_una finally advances.
What is needed is to also check if POLLOUT needs to be generated whenever tp->snd_nxt is advanced, from output path.
This bug triggers more often after an idle period, as we do not receive ACK for at least one RTT. tcp_notsent_lowat could be a fraction of what CWND and pacing rate would allow to send during this RTT.
In a followup patch, I will remove the bogus call to tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED) from tcp_check_space(). Fact that we have decided to generate an EPOLLOUT does not mean the application has immediately refilled the transmit queue. This optimistic call might have been the reason the bug seemed not too serious.
Tested:
200 ms rtt, 1% packet loss, 32 MB tcp_rmem[2] and tcp_wmem[2]
$ echo 500000 >/proc/sys/net/ipv4/tcp_notsent_lowat
$ cat bench_rr.sh
SUM=0
for i in {1..10}
do
V=`netperf -H remote_host -l30 -t TCP_RR -- -r 10000000,10000 -o LOCAL_BYTES_SENT | egrep -v "MIGRATED|Bytes"`
echo $V
SUM=$(($SUM + $V))
done
echo SUM=$SUMBefore patch:
$ bench_rr.sh 130000000 80000000 140000000 140000000 140000000 140000000 130000000 40000000 90000000 110000000 SUM=1140000000
After patch:
$ bench_rr.sh 430000000 590000000 530000000 450000000 450000000 350000000 450000000 490000000 480000000 460000000 SUM=4680000000 # This is 410 % of the value before patch.
--- include/net/tcp.h | 1 + net/ipv4/tcp_input.c | 12 +++++++++++- net/ipv4/tcp_output.c | 1 + 3 files changed, 13 insertions(+), 1 deletion(-)
include/net/tcp.h +1 -0
@@ -620,6 +620,7 @@ void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req);void tcp_reset (struct sock *sk,struct sk_buff *skb);void tcp_skb_mark_lost_uncond_verify (struct tcp_sock *tp,struct sk_buff *skb);void tcp_fin (struct sock *sk); +void tcp_check_space (struct sock *sk);/* tcp_timer.c */ void tcp_init_xmit_timers (struct sock *);
net/ipv4/tcp_input.c +11 -1
@@ -5437,7 +5437,17 @@ static void tcp_new_space(struct sock *sk)INDIRECT_CALL_1 (sk->sk_write_space, sk_stream_write_space, sk); } -static void tcp_check_space (struct sock *sk) +/* Caller made space either from: +* 1) Freeing skbs in rtx queues (after tp->snd_una has advanced) +* 2) Sent skbs from output queue (and thus advancing tp->snd_nxt) +* +* We might be able to generate EPOLLOUT to the application if: +* 1) Space consumed in output/rtx queues is below sk->sk_sndbuf/2 +* 2) notsent amount (tp->write_seq - tp->snd_nxt) became +* small enough that tcp_stream_memory_free() decides it +* is time to generate EPOLLOUT. +*/ +void tcp_check_space (struct sock *sk) {/* pairs with tcp_poll() */ smp_mb ();
net/ipv4/tcp_output.c +1 -0
@@ -82,6 +82,7 @@ static void tcp_event_new_data_sent(struct sock *sk, struct sk_buff *skb)NET_ADD_STATS (sock_net (sk),LINUX_MIB_TCPORIGDATASENT ,tcp_skb_pcount (skb)); +tcp_check_space (sk); }/* SND.NXT, if window was not shrunk or the amount of shrunk was less than one
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 125/225 tcp: make sure treq->af_specific is initialized
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit ba5a4fdd63ae0c575707030db0b634b160baddd7 ]
syzbot complained about a recent change in TCP stack, hitting a NULL pointer [1]
tcp request sockets have an af_specific pointer, which was used before the blamed change only for SYNACK generation in non SYNCOOKIE mode.
tcp requests sockets momentarily created when third packet coming from client in SYNCOOKIE mode were not using treq->af_specific.
Make sure this field is populated, in the same way normal TCP requests sockets do in tcp_conn_request().
[1]
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters.
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] CPU: 1 PID: 3695 Comm: syz-executor864 Not tainted 5.18.0-rc3-syzkaller-00224-g5fd1fe4807f9 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:tcp_create_openreq_child+0xe16/0x16b0 net/ipv4/tcp_minisocks.c:534 Code: 48 c1 ea 03 80 3c 02 00 0f 85 e5 07 00 00 4c 8b b3 28 01 00 00 48 b8 00 00 00 00 00 fc ff df 49 8d 7e 08 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 c9 07 00 00 48 8b 3c 24 48 89 de 41 ff 56 08 48 RSP: 0018:ffffc90000de0588 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff888076490330 RCX: 0000000000000100 RDX: 0000000000000001 RSI: ffffffff87d67ff0 RDI: 0000000000000008 RBP: ffff88806ee1c7f8 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff87d67f00 R11: 0000000000000000 R12: ffff88806ee1bfc0 R13: ffff88801b0e0368 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f517fe58700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffcead76960 CR3: 000000006f97b000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <IRQ> tcp_v6_syn_recv_sock+0x199/0x23b0 net/ipv6/tcp_ipv6.c:1267 tcp_get_cookie_sock+0xc9/0x850 net/ipv4/syncookies.c:207 cookie_v6_check+0x15c3/0x2340 net/ipv6/syncookies.c:258 tcp_v6_cookie_check net/ipv6/tcp_ipv6.c:1131 [inline] tcp_v6_do_rcv+0x1148/0x13b0 net/ipv6/tcp_ipv6.c:1486 tcp_v6_rcv+0x3305/0x3840 net/ipv6/tcp_ipv6.c:1725 ip6_protocol_deliver_rcu+0x2e9/0x1900 net/ipv6/ip6_input.c:422 ip6_input_finish+0x14c/0x2c0 net/ipv6/ip6_input.c:464 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:473 dst_input include/net/dst.h:461 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ipv6_rcv+0x27f/0x3b0 net/ipv6/ip6_input.c:297 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5405 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5519 process_backlog+0x3a0/0x7c0 net/core/dev.c:5847 __napi_poll+0xb3/0x6e0 net/core/dev.c:6413 napi_poll net/core/dev.c:6480 [inline] net_rx_action+0x8ec/0xc60 net/core/dev.c:6567 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097
--- include/net/tcp.h | 1 + net/ipv4/syncookies.c | 8 +++++++- net/ipv6/syncookies.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-)
include/net/tcp.h +1 -0
@@ -480,6 +480,7 @@ int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th, u32 cookie);struct sock *cookie_v4_check (struct sock *sk,struct sk_buff *skb);struct request_sock *cookie_tcp_reqsk_alloc (const struct request_sock_ops *ops, +const struct tcp_request_sock_ops *af_ops,struct sock *sk,struct sk_buff *skb);#ifdef CONFIG_SYN_COOKIES
net/ipv4/syncookies.c +7 -1
@@ -281,6 +281,7 @@ bool cookie_ecn_ok(const struct tcp_options_received *tcp_opt,EXPORT_SYMBOL (cookie_ecn_ok);struct request_sock *cookie_tcp_reqsk_alloc (const struct request_sock_ops *ops, +const struct tcp_request_sock_ops *af_ops,struct sock *sk,struct sk_buff *skb) {
@@ -297,6 +298,10 @@ struct request_sock *cookie_tcp_reqsk_alloc(const struct request_sock_ops *ops,return NULL ; treq =tcp_rsk (req); + +/* treq->af_specific might be used to perform TCP_MD5 lookup */ + treq->af_specific = af_ops; + treq->syn_tos =TCP_SKB_CB (skb)->ip_dsfield;#if IS_ENABLED (CONFIG_MPTCP ) treq->is_mptcp =sk_is_mptcp (sk);
@@ -364,7 +369,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) goto out; ret =NULL ; - req =cookie_tcp_reqsk_alloc (&tcp_request_sock_ops, sk, skb); + req =cookie_tcp_reqsk_alloc (&tcp_request_sock_ops, + &tcp_request_sock_ipv4_ops, sk, skb);if (!req) goto out;
net/ipv6/syncookies.c +2 -1
@@ -170,7 +170,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) goto out; ret =NULL ; - req =cookie_tcp_reqsk_alloc (&tcp6_request_sock_ops, sk, skb); + req =cookie_tcp_reqsk_alloc (&tcp6_request_sock_ops, + &tcp_request_sock_ipv6_ops, sk, skb);if (!req) goto out;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 126/225 bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit fff8c10368e64e7f8960f149375c12ca5f3b30af ]
This code is really spurious.
It always returns an ERR_PTR, even when err is known to be 0 and calls put_device() after a successful device_register() call.
It is likely that the return statement in the normal path is missing. Add 'return rdev;' to fix it.
--- drivers/bus/sunxi-rsb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bus/sunxi-rsb.c +2 -0
@@ -227,6 +227,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb,dev_dbg (&rdev->dev,"device %s registered\n" ,dev_name (&rdev->dev)); +return rdev; + err_device_add:put_device (&rdev->dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 127/225 clk: sunxi: sun9i-mmc: check return value after calling platform_get_resource()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit f58ca215cda1975f77b2b762903684a3c101bec9 ]
It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value.
--- drivers/clk/sunxi/clk-sun9i-mmc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/sunxi/clk-sun9i-mmc.c +2 -0
@@ -109,6 +109,8 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)spin_lock_init (&data->lock); r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!r) +return -EINVAL ;/* one clock/reset pair per word */ count =DIV_ROUND_UP ((resource_size (r)),SUN9I_MMC_WIDTH ); data->membase =devm_ioremap_resource (&pdev->dev, r);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 128/225 cpufreq: qcom-cpufreq-hw: Clear dcvs interrupts
In reply to Greg Kroah-HartmanFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit e4e6448638a01905faeda9bf96aa9df7c8ef463c ]
It's noted that dcvs interrupts are not self-clearing, thus an interrupt handler runs constantly, which leads to a severe regression in runtime. To fix the problem an explicit write to clear interrupt register is required, note that on OSM platforms the register may not be present.
--- drivers/cpufreq/qcom-cpufreq-hw.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/cpufreq/qcom-cpufreq-hw.c +8 -0
@@ -24,6 +24,8 @@#define CLK_HW_DIV 2#define LUT_TURBO_IND 1 +#define GT_IRQ_STATUS BIT(2) +#define HZ_PER_KHZ 1000struct qcom_cpufreq_soc_data {
@@ -31,6 +33,7 @@ struct qcom_cpufreq_soc_data {u32 reg_domain_state;u32 reg_freq_lut;u32 reg_volt_lut; +u32 reg_intr_clr;u32 reg_current_vote;u32 reg_perf_state;u8 lut_row_size;
@@ -347,6 +350,10 @@ static irqreturn_t qcom_lmh_dcvs_handle_irq(int irq, void *data)disable_irq_nosync (c_data->throttle_irq);schedule_delayed_work (&c_data->throttle_work,0 ); +if (c_data->soc_data->reg_intr_clr) +writel_relaxed (GT_IRQ_STATUS , + c_data->base + c_data->soc_data->reg_intr_clr); +return IRQ_HANDLED ; }
@@ -364,6 +371,7 @@ static const struct qcom_cpufreq_soc_data epss_soc_data = { .reg_domain_state = 0x20, .reg_freq_lut = 0x100, .reg_volt_lut = 0x200, + .reg_intr_clr = 0x308, .reg_perf_state = 0x320, .lut_row_size = 4, };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 129/225 mctp: defer the kfree of object mdev->addrs
In reply to Greg Kroah-HartmanFrom: Lin Ma <[email protected]>
[ Upstream commit b561275d633bcd8e0e8055ab86f1a13df75a0269 ]
The function mctp_unregister() reclaims the device's relevant resource when a netcard detaches. However, a running routine may be unaware of this and cause the use-after-free of the mdev->addrs object.
The race condition can be demonstrated below
cleanup thread another thread
|
unregister_netdev() | mctp_sendmsg()
... | ...
mctp_unregister() | rt = mctp_route_lookup()
... | mctl_local_output()
kfree(mdev->addrs) | ...
| saddr = rt->dev->addrs[0];
|An attacker can adopt the (recent provided) mtcpserial driver with pty to fake the device detaching and use the userfaultfd to increase the race success chance (in mctp_sendmsg). The KASan report for such a POC is shown below:
[ 86.051955] ================================================================== [ 86.051955] BUG: KASAN: use-after-free in mctp_local_output+0x4e9/0xb7d [ 86.051955] Read of size 1 at addr ffff888005f298c0 by task poc/295 [ 86.051955] [ 86.051955] Call Trace: [ 86.051955] <TASK> [ 86.051955] dump_stack_lvl+0x33/0x42 [ 86.051955] print_report.cold.13+0xb2/0x6b3 [ 86.051955] ? preempt_schedule_irq+0x57/0x80 [ 86.051955] ? mctp_local_output+0x4e9/0xb7d [ 86.051955] kasan_report+0xa5/0x120 [ 86.051955] ? mctp_local_output+0x4e9/0xb7d [ 86.051955] mctp_local_output+0x4e9/0xb7d [ 86.051955] ? mctp_dev_set_key+0x79/0x79 [ 86.051955] ? copyin+0x38/0x50 [ 86.051955] ? _copy_from_iter+0x1b6/0xf20 [ 86.051955] ? sysvec_apic_timer_interrupt+0x97/0xb0 [ 86.051955] ? asm_sysvec_apic_timer_interrupt+0x12/0x20 [ 86.051955] ? mctp_local_output+0x1/0xb7d [ 86.051955] mctp_sendmsg+0x64d/0xdb0 [ 86.051955] ? mctp_sk_close+0x20/0x20 [ 86.051955] ? __fget_light+0x2fd/0x4f0 [ 86.051955] ? mctp_sk_close+0x20/0x20 [ 86.051955] sock_sendmsg+0xdd/0x110 [ 86.051955] __sys_sendto+0x1cc/0x2a0 [ 86.051955] ? __ia32_sys_getpeername+0xa0/0xa0 [ 86.051955] ? new_sync_write+0x335/0x550 [ 86.051955] ? alloc_file+0x22f/0x500 [ 86.051955] ? __ip_do_redirect+0x820/0x1820 [ 86.051955] ? vfs_write+0x44d/0x7b0 [ 86.051955] ? vfs_write+0x44d/0x7b0 [ 86.051955] ? fput_many+0x15/0x120 [ 86.051955] ? ksys_write+0x155/0x1b0 [ 86.051955] ? __ia32_sys_read+0xa0/0xa0 [ 86.051955] __x64_sys_sendto+0xd8/0x1b0 [ 86.051955] ? exit_to_user_mode_prepare+0x2f/0x120 [ 86.051955] ? syscall_exit_to_user_mode+0x12/0x20 [ 86.051955] do_syscall_64+0x3a/0x80 [ 86.051955] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 86.051955] RIP: 0033:0x7f82118a56b3 [ 86.051955] RSP: 002b:00007ffdb154b110 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 86.051955] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f82118a56b3 [ 86.051955] RDX: 0000000000000010 RSI: 00007f8211cd4000 RDI: 0000000000000007 [ 86.051955] RBP: 00007ffdb154c1d0 R08: 00007ffdb154b164 R09: 000000000000000c [ 86.051955] R10: 0000000000000000 R11: 0000000000000293 R12: 000055d779800db0 [ 86.051955] R13: 00007ffdb154c2b0 R14: 0000000000000000 R15: 0000000000000000 [ 86.051955] </TASK> [ 86.051955] [ 86.051955] Allocated by task 295: [ 86.051955] kasan_save_stack+0x1c/0x40 [ 86.051955] __kasan_kmalloc+0x84/0xa0 [ 86.051955] mctp_rtm_newaddr+0x242/0x610 [ 86.051955] rtnetlink_rcv_msg+0x2fd/0x8b0 [ 86.051955] netlink_rcv_skb+0x11c/0x340 [ 86.051955] netlink_unicast+0x439/0x630 [ 86.051955] netlink_sendmsg+0x752/0xc00 [ 86.051955] sock_sendmsg+0xdd/0x110 [ 86.051955] __sys_sendto+0x1cc/0x2a0 [ 86.051955] __x64_sys_sendto+0xd8/0x1b0 [ 86.051955] do_syscall_64+0x3a/0x80 [ 86.051955] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 86.051955] [ 86.051955] Freed by task 301: [ 86.051955] kasan_save_stack+0x1c/0x40 [ 86.051955] kasan_set_track+0x21/0x30 [ 86.051955] kasan_set_free_info+0x20/0x30 [ 86.051955] __kasan_slab_free+0x104/0x170 [ 86.051955] kfree+0x8c/0x290 [ 86.051955] mctp_dev_notify+0x161/0x2c0 [ 86.051955] raw_notifier_call_chain+0x8b/0xc0 [ 86.051955] unregister_netdevice_many+0x299/0x1180 [ 86.051955] unregister_netdevice_queue+0x210/0x2f0 [ 86.051955] unregister_netdev+0x13/0x20 [ 86.051955] mctp_serial_close+0x6d/0xa0 [ 86.051955] tty_ldisc_kill+0x31/0xa0 [ 86.051955] tty_ldisc_hangup+0x24f/0x560 [ 86.051955] __tty_hangup.part.28+0x2ce/0x6b0 [ 86.051955] tty_release+0x327/0xc70 [ 86.051955] __fput+0x1df/0x8b0 [ 86.051955] task_work_run+0xca/0x150 [ 86.051955] exit_to_user_mode_prepare+0x114/0x120 [ 86.051955] syscall_exit_to_user_mode+0x12/0x20 [ 86.051955] do_syscall_64+0x46/0x80 [ 86.051955] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 86.051955] [ 86.051955] The buggy address belongs to the object at ffff888005f298c0 [ 86.051955] which belongs to the cache kmalloc-8 of size 8 [ 86.051955] The buggy address is located 0 bytes inside of [ 86.051955] 8-byte region [ffff888005f298c0, ffff888005f298c8) [ 86.051955] [ 86.051955] The buggy address belongs to the physical page: [ 86.051955] flags: 0x100000000000200(slab|node=0|zone=1) [ 86.051955] raw: 0100000000000200 dead000000000100 dead000000000122 ffff888005c42280 [ 86.051955] raw: 0000000000000000 0000000080660066 00000001ffffffff 0000000000000000 [ 86.051955] page dumped because: kasan: bad access detected [ 86.051955] [ 86.051955] Memory state around the buggy address: [ 86.051955] ffff888005f29780: 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 [ 86.051955] ffff888005f29800: fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc [ 86.051955] >ffff888005f29880: fc fc fc fb fc fc fc fc fa fc fc fc fc fa fc fc [ 86.051955] ^ [ 86.051955] ffff888005f29900: fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc [ 86.051955] ffff888005f29980: fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc [ 86.051955] ==================================================================
To this end, just like the commit e04480920d1e ("Bluetooth: defer cleanup of resources in hci_unregister_dev()") this patch defers the destructive kfree(mdev->addrs) in mctp_unregister to the mctp_dev_put, where the refcount of mdev is zero and the entire device is reclaimed. This prevents the use-after-free because the sendmsg thread holds the reference of mdev in the mctp_route object.
--- net/mctp/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mctp/device.c +1 -1
@@ -312,6 +312,7 @@ void mctp_dev_hold(struct mctp_dev *mdev)void mctp_dev_put (struct mctp_dev *mdev) {if (mdev &&refcount_dec_and_test (&mdev->refs)) { +kfree (mdev->addrs);dev_put (mdev->dev);kfree_rcu (mdev, rcu); }
@@ -440,7 +441,6 @@ static void mctp_unregister(struct net_device *dev)mctp_route_remove_dev (mdev);mctp_neigh_remove_dev (mdev); -kfree (mdev->addrs);mctp_dev_put (mdev); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 130/225 net: bcmgenet: hide status block before TX timestamping
In reply to Greg Kroah-HartmanFrom: Jonathan Lemon <[email protected]>
[ Upstream commit acac0541d1d65e81e599ec399d34d184d2424401 ]
The hardware checksum offloading requires use of a transmit status block inserted before the outgoing frame data, this was updated in '9a9ba2a4aaaa ("net: bcmgenet: always enable status blocks")'
However, skb_tx_timestamp() assumes that it is passed a raw frame and PTP parsing chokes on this status block.
Fix this by calling __skb_pull(), which hides the TSB before calling skb_tx_timestamp(), so an outgoing PTP packet is parsed correctly.
As the data in the skb has already been set up for DMA, and the dma_unmap_* calls use a separately stored address, there is no no effective change in the data transmission.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +7 -0
@@ -2035,6 +2035,11 @@ static struct sk_buff *bcmgenet_add_tsb(struct net_device *dev,return skb; } +static void bcmgenet_hide_tsb (struct sk_buff *skb) +{ +__skb_pull (skb,sizeof (struct status_64 )); +} +static netdev_tx_t bcmgenet_xmit (struct sk_buff *skb,struct net_device *dev) {struct bcmgenet_priv *priv =netdev_priv (dev);
@@ -2141,6 +2146,8 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) }GENET_CB (skb)->last_cb = tx_cb_ptr; + +bcmgenet_hide_tsb (skb);skb_tx_timestamp (skb);/* Decrement total BD count and advance our write pointer */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 131/225 net: phy: marvell10g: fix return value on error
In reply to Greg Kroah-HartmanFrom: Baruch Siach <[email protected]>
[ Upstream commit 0ed9704b660b259b54743cad8a84a11148f60f0a ]
Return back the error value that we get from phy_read_mmd().
--- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/marvell10g.c +1 -1
@@ -880,7 +880,7 @@ static int mv3310_read_status_copper(struct phy_device *phydev) cssr1 =phy_read_mmd (phydev,MDIO_MMD_PCS ,MV_PCS_CSSR1 );if (cssr1 <0 ) -return val; +return cssr1;/* If the link settings are not resolved, mark the link down */ if (!(cssr1 &MV_PCS_CSSR1_RESOLVED )) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 132/225 net: dsa: mv88e6xxx: Fix port_hidden_wait to account for port_base_addr
In reply to Greg Kroah-HartmanFrom: Nathan Rossi <[email protected]>
[ Upstream commit 24cbdb910bb62b5be3865275e5682be1a7708c0f ]
The other port_hidden functions rely on the port_read/port_write functions to access the hidden control port. These functions apply the offset for port_base_addr where applicable. Update port_hidden_wait to use the port_wait_bit so that port_base_addr offsets are accounted for when waiting for the busy bit to change.
Without the offset the port_hidden_wait function would timeout on devices that have a non-zero port_base_addr (e.g. MV88E6141), however devices that have a zero port_base_addr would operate correctly (e.g. MV88E6390).
--- drivers/net/dsa/mv88e6xxx/port_hidden.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/dsa/mv88e6xxx/port_hidden.c +3 -2
@@ -40,8 +40,9 @@ int mv88e6xxx_port_hidden_wait(struct mv88e6xxx_chip *chip) {int bit =__bf_shf (MV88E6XXX_PORT_RESERVED_1A_BUSY ); -return mv88e6xxx_wait_bit (chip,MV88E6XXX_PORT_RESERVED_1A_CTRL_PORT , -MV88E6XXX_PORT_RESERVED_1A , bit,0 ); +return mv88e6xxx_port_wait_bit (chip, +MV88E6XXX_PORT_RESERVED_1A_CTRL_PORT , +MV88E6XXX_PORT_RESERVED_1A , bit,0 ); } int mv88e6xxx_port_hidden_read(struct mv88e6xxx_chip *chip, int block, int port,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 133/225 drm/sun4i: Remove obsolete references to PHYS_OFFSET
In reply to Greg Kroah-HartmanFrom: Samuel Holland <[email protected]>
[ Upstream commit dc3ae06c5f2170d879ff58696f629d8c3868aec3 ]
commit b4bdc4fbf8d0 ("soc: sunxi: Deal with the MBUS DMA offsets in a central place") added a platform device notifier that sets the DMA offset for all of the display engine frontend and backend devices.
The code applying the offset to DMA buffer physical addresses was then removed from the backend driver in commit 756668ba682e ("drm/sun4i:
backend: Remove the MBUS quirks"), but the code subtracting PHYS_OFFSET was left in the frontend driver.
As a result, the offset was applied twice in the frontend driver. This likely went unnoticed because it only affects specific configurations (scaling or certain pixel formats) where the frontend is used, on boards with both one of these older SoCs and more than 1 GB of DRAM.
In addition, the references to PHYS_OFFSET prevent compiling the driver on architectures where PHYS_OFFSET is not defined.
--- drivers/gpu/drm/sun4i/sun4i_frontend.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/sun4i/sun4i_frontend.c +0 -3
@@ -222,13 +222,11 @@ void sun4i_frontend_update_buffer(struct sun4i_frontend *frontend,/* Set the physical address of the buffer in memory */ paddr =drm_fb_cma_get_gem_addr (fb, state,0 ); - paddr -=PHYS_OFFSET ;DRM_DEBUG_DRIVER ("Setting buffer #0 address to %pad\n" , &paddr);regmap_write (frontend->regs,SUN4I_FRONTEND_BUF_ADDR0_REG , paddr);if (fb->format->num_planes >1 ) { paddr =drm_fb_cma_get_gem_addr (fb, state, swap ?2 :1 ); - paddr -=PHYS_OFFSET ;DRM_DEBUG_DRIVER ("Setting buffer #1 address to %pad\n" , &paddr);regmap_write (frontend->regs,SUN4I_FRONTEND_BUF_ADDR1_REG , paddr);
@@ -236,7 +234,6 @@ void sun4i_frontend_update_buffer(struct sun4i_frontend *frontend,if (fb->format->num_planes >2 ) { paddr =drm_fb_cma_get_gem_addr (fb, state, swap ?1 :2 ); - paddr -=PHYS_OFFSET ;DRM_DEBUG_DRIVER ("Setting buffer #2 address to %pad\n" , &paddr);regmap_write (frontend->regs,SUN4I_FRONTEND_BUF_ADDR2_REG , paddr);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 134/225 ice: wait 5 s for EMP reset after firmware flash
In reply to Greg Kroah-HartmanFrom: Petr Oros <[email protected]>
[ Upstream commit b537752e6cbf0e4475c165178ca02241b53ff6ef ]
We need to wait 5 s for EMP reset after firmware flash. Code was extracted from OOT driver (ice v1.8.3 downloaded from sourceforge). Without this wait, fw_activate let card in inconsistent state and recoverable only by second flash/activate. Flash was tested on these fw's:
Quoted 1 line
From -> To
3.00 -> 3.10/3.20
3.10 -> 3.00/3.20
3.20 -> 3.00/3.10
Reproducer:
[root@host ~]# devlink dev flash pci/0000:ca:00.0 file E810_XXVDA4_FH_O_SEC_FW_1p6p1p9_NVM_3p10_PLDMoMCTP_0.11_8000AD7B.bin Preparing to flash
[fw.mgmt] Erasing
[fw.mgmt] Erasing done
[fw.mgmt] Flashing 100%
[fw.mgmt] Flashing done 100%
[fw.undi] Erasing
[fw.undi] Erasing done
[fw.undi] Flashing 100%
[fw.undi] Flashing done 100%
[fw.netlist] Erasing
[fw.netlist] Erasing done
[fw.netlist] Flashing 100%
[fw.netlist] Flashing done 100%
Activate new firmware by devlink reload
[root@host ~]# devlink dev reload pci/0000:ca:00.0 action fw_activatereload_actions_performed:
fw_activate
[root@host ~]# ip link show ens7f0
71: ens7f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether b4:96:91:dc:72:e0 brd ff:ff:ff:ff:ff:ff
altname enp202s0f0dmesg after flash:
[ 55.120788] ice: Copyright (c) 2018, Intel Corporation. [ 55.274734] ice 0000:ca:00.0: Get PHY capabilities failed status = -5, continuing anyway [ 55.569797] ice 0000:ca:00.0: The DDP package was successfully loaded: ICE OS Default Package version 1.3.28.0 [ 55.603629] ice 0000:ca:00.0: Get PHY capability failed. [ 55.608951] ice 0000:ca:00.0: ice_init_nvm_phy_type failed: -5 [ 55.647348] ice 0000:ca:00.0: PTP init successful [ 55.675536] ice 0000:ca:00.0: DCB is enabled in the hardware, max number of TCs supported on this port are 8 [ 55.685365] ice 0000:ca:00.0: FW LLDP is disabled, DCBx/LLDP in SW mode. [ 55.692179] ice 0000:ca:00.0: Commit DCB Configuration to the hardware [ 55.701382] ice 0000:ca:00.0: 126.024 Gb/s available PCIe bandwidth, limited by 16.0 GT/s PCIe x8 link at 0000:c9:02.0 (capable of 252.048 Gb/s with 16.0 GT/s PCIe x16 link)
Reboot doesn’t help, only second flash/activate with OOT or patched driver put card back in consistent state.
After patch:
[root@host ~]# devlink dev flash pci/0000:ca:00.0 file E810_XXVDA4_FH_O_SEC_FW_1p6p1p9_NVM_3p10_PLDMoMCTP_0.11_8000AD7B.bin Preparing to flash
[fw.mgmt] Erasing
[fw.mgmt] Erasing done
[fw.mgmt] Flashing 100%
[fw.mgmt] Flashing done 100%
[fw.undi] Erasing
[fw.undi] Erasing done
[fw.undi] Flashing 100%
[fw.undi] Flashing done 100%
[fw.netlist] Erasing
[fw.netlist] Erasing done
[fw.netlist] Flashing 100%
[fw.netlist] Flashing done 100%
Activate new firmware by devlink reload
[root@host ~]# devlink dev reload pci/0000:ca:00.0 action fw_activatereload_actions_performed:
fw_activate
[root@host ~]# ip link show ens7f0
19: ens7f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether b4:96:91:dc:72:e0 brd ff:ff:ff:ff:ff:ff
altname enp202s0f0--- drivers/net/ethernet/intel/ice/ice_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +3 -0
@@ -6662,12 +6662,15 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)dev_dbg (dev,"rebuilding PF after reset_type=%d\n" , reset_type); +#define ICE_EMP_RESET_SLEEP_MS 5000if (reset_type ==ICE_RESET_EMPR ) {/* If an EMP reset has occurred, any previously pending flash * update will have completed. We no longer know whether or * not the NVM update EMP reset is restricted. */ pf->fw_emp_reset_disabled = false; + +msleep (ICE_EMP_RESET_SLEEP_MS ); } err =ice_init_all_ctrlq (hw);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 135/225 Bluetooth: hci_event: Fix checking for invalid handle on error status
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit c86cc5a3ec70f5644f1fa21610b943d0441bc1f7 ]
Commit d5ebaa7c5f6f6 introduces checks for handle range (e.g HCI_CONN_HANDLE_MAX) but controllers like Intel AX200 don't seem to respect the valid range int case of error status:
Quoted 1 line
HCI Event: Connect Complete (
0x03) plen 11
Status: Page Timeout (0x04)
Handle: 65535
Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment&
Sound Products Inc)
Link type: ACL (0x01)
Encryption: Disabled (0x00)
[1644965.827560] Bluetooth: hci0: Ignoring HCI_Connection_Complete for invalid handleBecause of it is impossible to cleanup the connections properly since the stack would attempt to cancel the connection which is no longer in progress causing the following trace:
< HCI Command: Create Connection Cancel (0x01|0x0008) plen 6
Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment& Sound Products Inc)
= bluetoothd: src/profile.c:record_cb() Unable to get Hands-Free Voice
gateway SDP record: Connection timed out
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 10
Create Connection Cancel (0x01|0x0008) ncmd 1
Status: Unknown Connection Identifier (0x02)
Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment& Sound Products Inc)
< HCI Command: Create Connection Cancel (0x01|0x0008) plen 6
Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment& Sound Products Inc)
--- include/net/bluetooth/hci.h | 1 + net/bluetooth/hci_event.c | 65 ++++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 29 deletions(-)
include/net/bluetooth/hci.h +1 -0
@@ -578,6 +578,7 @@ enum {#define HCI_ERROR_CONNECTION_TIMEOUT 0x08#define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d#define HCI_ERROR_REJ_BAD_ADDR 0x0f +#define HCI_ERROR_INVALID_PARAMETERS 0x12#define HCI_ERROR_REMOTE_USER_TERM 0x13#define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14#define HCI_ERROR_REMOTE_POWER_OFF 0x15
net/bluetooth/hci_event.c +36 -29
134 lines not on this page · raw message
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 136/225 net: dsa: lantiq_gswip: Dont set GSWIP_MII_CFG_RMII_CLK
In reply to Greg Kroah-HartmanFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit 71cffebf6358a7f5031f5b208bbdc1cb4db6e539 ]
Commit 4b5923249b8fa4 ("net: dsa: lantiq_gswip: Configure all remaining GSWIP_MII_CFG bits") added all known bits in the GSWIP_MII_CFGp register. It helped bring this register into a well-defined state so the driver has to rely less on the bootloader to do things right. Unfortunately it also sets the GSWIP_MII_CFG_RMII_CLK bit without any possibility to configure it. Upon further testing it turns out that all boards which are supported by the GSWIP driver in OpenWrt which use an RMII PHY have a dedicated oscillator on the board which provides the 50MHz RMII reference clock.
Don't set the GSWIP_MII_CFG_RMII_CLK bit (but keep the code which always clears it) to fix support for the Fritz!Box 7362 SL in OpenWrt. This is a board with two Atheros AR8030 RMII PHYs. With the "RMII clock" bit set the MAC also generates the RMII reference clock whose signal then conflicts with the signal from the oscillator on the board. This results in a constant cycle of the PHY detecting link up/down (and as a result of that: the two ports using the AR8030 PHYs are not working).
At the time of writing this patch there's no known board where the MAC (GSWIP) has to generate the RMII reference clock. If needed this can be implemented in future by providing a device-tree flag so the GSWIP_MII_CFG_RMII_CLK bit can be toggled per port.
--- drivers/net/dsa/lantiq_gswip.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/dsa/lantiq_gswip.c +0 -3
@@ -1637,9 +1637,6 @@ static void gswip_phylink_mac_config(struct dsa_switch *ds, int port,break ;case PHY_INTERFACE_MODE_RMII : miicfg |=GSWIP_MII_CFG_MODE_RMIIM ; - -/* Configure the RMII clock as output: */ - miicfg |=GSWIP_MII_CFG_RMII_CLK ;break ;case PHY_INTERFACE_MODE_RGMII :case PHY_INTERFACE_MODE_RGMII_ID :
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 137/225 io_uring: check reserved fields for send/sendmsg
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
[ Upstream commit 588faa1ea5eecb351100ee5d187b9be99210f70d ]
We should check unused fields for non-zero and -EINVAL if they are set, making it consistent with other opcodes.
--- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+)
fs/io_uring.c +2 -0
@@ -4890,6 +4890,8 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)if (unlikely (req->ctx->flags &IORING_SETUP_IOPOLL ))return -EINVAL ; +if (unlikely (sqe->addr2 || sqe->file_index)) +return -EINVAL ; sr->umsg =u64_to_user_ptr (READ_ONCE (sqe->addr)); sr->len =READ_ONCE (sqe->len);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 138/225 io_uring: check reserved fields for recv/recvmsg
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
[ Upstream commit 5a1e99b61b0c81388cde0c808b3e4173907df19f ]
We should check unused fields for non-zero and -EINVAL if they are set, making it consistent with other opcodes.
--- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+)
fs/io_uring.c +2 -0
@@ -5103,6 +5103,8 @@ static int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)if (unlikely (req->ctx->flags &IORING_SETUP_IOPOLL ))return -EINVAL ; +if (unlikely (sqe->addr2 || sqe->file_index)) +return -EINVAL ; sr->umsg =u64_to_user_ptr (READ_ONCE (sqe->addr)); sr->len =READ_ONCE (sqe->len);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 139/225 netfilter: nf_conntrack_tcp: re-init for syn packets only
In reply to Greg Kroah-HartmanFrom: Florian Westphal <[email protected]>
[ Upstream commit c7aab4f17021b636a0ee75bcf28e06fb7c94ab48 ]
Jaco Kroon reported tcp problems that Eric Dumazet and Neal Cardwell pinpointed to nf_conntrack tcp_in_window() bug.
tcp trace shows following sequence:
I > R Flags [S], seq 3451342529, win 62580, options [.. tfo [|tcp]> R > I Flags [S.], seq 2699962254, ack 3451342530, win 65535, options [..] R > I Flags [P.], seq 1:89, ack 1, [..]
Note 3rd ACK is from responder to initiator so following branch is taken:
} else if (((state->state == TCP_CONNTRACK_SYN_SENT
&& dir == IP_CT_DIR_ORIGINAL)
|| (state->state == TCP_CONNTRACK_SYN_RECV
&& dir == IP_CT_DIR_REPLY))
&& after(end, sender->td_end)) {... because state == TCP_CONNTRACK_SYN_RECV and dir is REPLY. This causes the scaling factor to be reset to 0: window scale option is only present in syn(ack) packets. This in turn makes nf_conntrack mark valid packets as out-of-window.
This was always broken, it exists even in original commit where window tracking was added to ip_conntrack (nf_conntrack predecessor) in 2.6.9-rc1 kernel.
Restrict to 'tcph->syn', just like the 3rd condtional added in
commit 82b72cb94666 ("netfilter: conntrack: re-init state for retransmitted syn-ack").
Upon closer look, those conditionals/branches can be merged:
Because earlier checks prevent syn-ack from showing up in original direction, the 'dir' checks in the conditional quoted above are redundant, remove them. Return early for pure syn retransmitted in reply direction (simultaneous open).
--- net/netfilter/nf_conntrack_proto_tcp.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-)
net/netfilter/nf_conntrack_proto_tcp.c +6 -15
@@ -556,24 +556,14 @@ static bool tcp_in_window(struct nf_conn *ct, } } - }else if (((state->state ==TCP_CONNTRACK_SYN_SENT - && dir ==IP_CT_DIR_ORIGINAL ) - || (state->state ==TCP_CONNTRACK_SYN_RECV - && dir ==IP_CT_DIR_REPLY )) - &&after (end, sender->td_end)) { + }else if (tcph->syn && +after (end, sender->td_end) && + (state->state ==TCP_CONNTRACK_SYN_SENT || + state->state ==TCP_CONNTRACK_SYN_RECV )) {/* * RFC 793: "if a TCP is reinitialized ... then it need * not wait at all; it must only be sure to use sequence * numbers larger than those recently used." -*/ - sender->td_end = - sender->td_maxend = end; - sender->td_maxwin = (win ==0 ?1 : win); - -tcp_options (skb, dataoff, tcph, sender); - }else if (tcph->syn && dir ==IP_CT_DIR_REPLY && - state->state ==TCP_CONNTRACK_SYN_SENT ) { -/* Retransmitted syn-ack, or syn (simultaneous open). * * Re-init state for this direction, just like for the first * syn(-ack) reply, it might differ in seq, ack or tcp options.
@@ -581,7 +571,8 @@ static bool tcp_in_window(struct nf_conn *ct,tcp_init_sender (sender, receiver, skb, dataoff, tcph, end, win); -if (!tcph->ack) + +if (dir ==IP_CT_DIR_REPLY && !tcph->ack)return true; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 140/225 netfilter: conntrack: fix udp offload timeout sysctl
In reply to Greg Kroah-HartmanFrom: Volodymyr Mytnyk <[email protected]>
[ Upstream commit 626873c446f7559d5af8b48cefad903ffd85cf4e ]
nf_flowtable_udp_timeout sysctl option is available only if CONFIG_NFT_FLOW_OFFLOAD enabled. But infra for this flow offload UDP timeout was added under CONFIG_NF_FLOW_TABLE config option. So, if you have CONFIG_NFT_FLOW_OFFLOAD disabled and CONFIG_NF_FLOW_TABLE enabled, the nf_flowtable_udp_timeout is not present in sysfs. Please note, that TCP flow offload timeout sysctl option is present even CONFIG_NFT_FLOW_OFFLOAD is disabled.
I suppose it was a typo in commit that adds UDP flow offload timeout and CONFIG_NF_FLOW_TABLE should be used instead.
--- net/netfilter/nf_conntrack_standalone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conntrack_standalone.c +1 -1
@@ -823,7 +823,7 @@ static struct ctl_table nf_ct_sysctl_table[] = { .mode = 0644, .proc_handler = proc_dointvec_jiffies, }, -#if IS_ENABLED (CONFIG_NFT_FLOW_OFFLOAD ) +#if IS_ENABLED (CONFIG_NF_FLOW_TABLE ) [NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD] = { .procname = "nf_flowtable_udp_timeout", .maxlen = sizeof(unsigned int),
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 141/225 platform/x86: asus-wmi: Potential buffer overflow in asus_wmi_evaluate_method_buf()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 4345ece8f0bcc682f1fb3b648922c9be5f7dbe6c ]
This code tests for if the obj->buffer.length is larger than the buffer but then it just does the memcpy() anyway.
--- drivers/platform/x86/asus-wmi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/platform/x86/asus-wmi.c +6 -2
@@ -371,10 +371,14 @@ static int asus_wmi_evaluate_method_buf(u32 method_id,switch (obj->type) {case ACPI_TYPE_BUFFER : -if (obj->buffer.length > size) +if (obj->buffer.length > size) { err = -ENOSPC ; -if (obj->buffer.length ==0 ) +break ; + } +if (obj->buffer.length ==0 ) { err = -ENODATA ; +break ; + }memcpy (ret_buffer, obj->buffer.pointer, obj->buffer.length);break ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 142/225 platform/x86: asus-wmi: Fix driver not binding when fan curve control probe fails
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 9fe1bb29ea0ab231aa916dad4bcf0c435beb5869 ]
Before this commit fan_curve_check_present() was trying to not cause the probe to fail on devices without fan curve control by testing for known error codes returned by asus_wmi_evaluate_method_buf().
Checking for ENODATA or ENODEV, with the latter being returned by this function when an ACPI integer with a value of ASUS_WMI_UNSUPPORTED_METHOD is returned. But for other ACPI integer returns this function just returns them as is, including the ASUS_WMI_DSTS_UNKNOWN_BIT value of 2.
On the Asus U36SD ASUS_WMI_DSTS_UNKNOWN_BIT gets returned, leading to:
asus-nb-wmi: probe of asus-nb-wmi failed with error 2
Instead of playing whack a mole with error codes here, simply treat all errors as there not being any fan curves, fixing the driver no longer loading on the Asus U36SD laptop.
--- drivers/platform/x86/asus-wmi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/platform/x86/asus-wmi.c +4 -3
@@ -2227,9 +2227,10 @@ static int fan_curve_check_present(struct asus_wmi *asus, bool *available, err =fan_curve_get_factory_default (asus, fan_dev);if (err) { -if (err == -ENODEV || err == -ENODATA ) -return 0 ; -return err; +pr_debug ("fan_curve_get_factory_default(0x%08x) failed: %d\n" , + fan_dev, err); +/* Don't cause probe to fail on devices without fan-curves */ +return 0 ; } *available = true;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 143/225 drm/amdkfd: Fix GWS queue count
In reply to Greg Kroah-HartmanFrom: David Yat Sin <[email protected]>
[ Upstream commit 7c6b6e18c890f30965b0589b0a57645e1dbccfde ]
dqm->gws_queue_count and pdd->qpd.mapped_gws_queue need to be updated each time the queue gets evicted.
--- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 83 +++++++++---------- 1 file changed, 37 insertions(+), 46 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +37 -46
@@ -129,19 +129,33 @@ void program_sh_mem_settings(struct device_queue_manager *dqm, }static void increment_queue_count (struct device_queue_manager *dqm, -enum kfd_queue_type type) +struct qcm_process_device *qpd, +struct queue *q) { dqm->active_queue_count++; -if (type ==KFD_QUEUE_TYPE_COMPUTE || type ==KFD_QUEUE_TYPE_DIQ ) +if (q->properties.type ==KFD_QUEUE_TYPE_COMPUTE || + q->properties.type ==KFD_QUEUE_TYPE_DIQ ) dqm->active_cp_queue_count++; + +if (q->properties.is_gws) { + dqm->gws_queue_count++; + qpd->mapped_gws_queue = true; + } }static void decrement_queue_count (struct device_queue_manager *dqm, -enum kfd_queue_type type) +struct qcm_process_device *qpd, +struct queue *q) { dqm->active_queue_count--; -if (type ==KFD_QUEUE_TYPE_COMPUTE || type ==KFD_QUEUE_TYPE_DIQ ) +if (q->properties.type ==KFD_QUEUE_TYPE_COMPUTE || + q->properties.type ==KFD_QUEUE_TYPE_DIQ ) dqm->active_cp_queue_count--; + +if (q->properties.is_gws) { + dqm->gws_queue_count--; + qpd->mapped_gws_queue = false; + } }static int allocate_doorbell (struct qcm_process_device *qpd,struct queue *q)
@@ -380,7 +394,7 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,list_add (&q->list, &qpd->queues_list); qpd->queue_count++;if (q->properties.is_active) -increment_queue_count (dqm, q->properties.type); +increment_queue_count (dqm, qpd, q);/* * Unconditionally increment this counter, regardless of the queue's
@@ -505,13 +519,8 @@ static int destroy_queue_nocpsch_locked(struct device_queue_manager *dqm,deallocate_vmid (dqm, qpd, q); } qpd->queue_count--; -if (q->properties.is_active) { -decrement_queue_count (dqm, q->properties.type); -if (q->properties.is_gws) { - dqm->gws_queue_count--; - qpd->mapped_gws_queue = false; - } - } +if (q->properties.is_active) +decrement_queue_count (dqm, qpd, q);return retval; }
@@ -604,12 +613,11 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q,* dqm->active_queue_count to determine whether a new runlist must be * uploaded. */ -if (q->properties.is_active && !prev_active) -increment_queue_count (dqm, q->properties.type); -else if (!q->properties.is_active && prev_active) -decrement_queue_count (dqm, q->properties.type); - -if (q->gws && !q->properties.is_gws) { +if (q->properties.is_active && !prev_active) { +increment_queue_count (dqm, &pdd->qpd, q); + }else if (!q->properties.is_active && prev_active) { +decrement_queue_count (dqm, &pdd->qpd, q); + }else if (q->gws && !q->properties.is_gws) {if (q->properties.is_active) { dqm->gws_queue_count++; pdd->qpd.mapped_gws_queue = true;
@@ -671,11 +679,7 @@ static int evict_process_queues_nocpsch(struct device_queue_manager *dqm, mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type ( q->properties.type)]; q->properties.is_active = false; -decrement_queue_count (dqm, q->properties.type); -if (q->properties.is_gws) { - dqm->gws_queue_count--; - qpd->mapped_gws_queue = false; - } +decrement_queue_count (dqm, qpd, q);if (WARN_ONCE (!dqm->sched_running,"Evict when stopped\n" ))continue ;
@@ -721,7 +725,7 @@ static int evict_process_queues_cpsch(struct device_queue_manager *dqm,continue ; q->properties.is_active = false; -decrement_queue_count (dqm, q->properties.type); +decrement_queue_count (dqm, qpd, q); } pdd->last_evict_timestamp =get_jiffies_64 (); retval = execute_queues_cpsch(dqm,
@@ -792,11 +796,7 @@ static int restore_process_queues_nocpsch(struct device_queue_manager *dqm, mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type ( q->properties.type)]; q->properties.is_active = true; -increment_queue_count (dqm, q->properties.type); -if (q->properties.is_gws) { - dqm->gws_queue_count++; - qpd->mapped_gws_queue = true; - } +increment_queue_count (dqm, qpd, q);if (WARN_ONCE (!dqm->sched_running,"Restore when stopped\n" ))continue ;
@@ -854,7 +854,7 @@ static int restore_process_queues_cpsch(struct device_queue_manager *dqm,continue ; q->properties.is_active = true; -increment_queue_count (dqm, q->properties.type); +increment_queue_count (dqm, &pdd->qpd, q); } retval =execute_queues_cpsch (dqm,KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES ,0 );
@@ -1260,7 +1260,7 @@ static int create_kernel_queue_cpsch(struct device_queue_manager *dqm, dqm->total_queue_count);list_add (&kq->list, &qpd->priv_queue_list); -increment_queue_count (dqm, kq->queue->properties.type); +increment_queue_count (dqm, qpd, kq->queue); qpd->is_debug = true;execute_queues_cpsch (dqm,KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES ,0 );dqm_unlock (dqm);
@@ -1274,7 +1274,7 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm, {dqm_lock (dqm);list_del (&kq->list); -decrement_queue_count (dqm, kq->queue->properties.type); +decrement_queue_count (dqm, qpd, kq->queue); qpd->is_debug = false;execute_queues_cpsch (dqm,KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES ,0 );/*
@@ -1341,7 +1341,7 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q, qpd->queue_count++;if (q->properties.is_active) { -increment_queue_count (dqm, q->properties.type); +increment_queue_count (dqm, qpd, q);execute_queues_cpsch (dqm,KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES ,0 );
@@ -1558,15 +1558,11 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm,list_del (&q->list); qpd->queue_count--;if (q->properties.is_active) { -decrement_queue_count (dqm, q->properties.type); +decrement_queue_count (dqm, qpd, q); retval =execute_queues_cpsch (dqm,KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES ,0 );if (retval == -ETIME ) qpd->reset_wavefronts = true; -if (q->properties.is_gws) { - dqm->gws_queue_count--; - qpd->mapped_gws_queue = false; - } }/*
@@ -1757,7 +1753,7 @@ static int process_termination_cpsch(struct device_queue_manager *dqm,/* Clean all kernel queues */ list_for_each_entry_safe (kq, kq_next, &qpd->priv_queue_list, list) {list_del (&kq->list); -decrement_queue_count (dqm, kq->queue->properties.type); +decrement_queue_count (dqm, qpd, kq->queue); qpd->is_debug = false; dqm->total_queue_count--; filter =KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES ;
@@ -1770,13 +1766,8 @@ static int process_termination_cpsch(struct device_queue_manager *dqm,else if (q->properties.type ==KFD_QUEUE_TYPE_SDMA_XGMI )deallocate_sdma_queue (dqm, q); -if (q->properties.is_active) { -decrement_queue_count (dqm, q->properties.type); -if (q->properties.is_gws) { - dqm->gws_queue_count--; - qpd->mapped_gws_queue = false; - } - } +if (q->properties.is_active) +decrement_queue_count (dqm, qpd, q); dqm->total_queue_count--; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 144/225 drm/amd/display: Fix memory leak in dcn21_clock_source_create
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 65e54987508b6f0771f56bdfa3ee1926d52785ae ]
When dcn20_clk_src_construct() fails, we need to release clk_src.
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -0
@@ -1427,6 +1427,7 @@ static struct clock_source *dcn21_clock_source_create(return &clk_src->base; } +kfree (clk_src);BREAK_TO_DEBUGGER ();return NULL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 145/225 tls: Skip tls_append_frag on zero copy size
In reply to Greg Kroah-HartmanFrom: Maxim Mikityanskiy <[email protected]>
[ Upstream commit a0df71948e9548de819a6f1da68f5f1742258a52 ]
Calling tls_append_frag when max_open_record_len == record->len might add an empty fragment to the TLS record if the call happens to be on the page boundary. Normally tls_append_frag coalesces the zero-sized fragment to the previous one, but not if it's on page boundary.
If a resync happens then, the mlx5 driver posts dump WQEs in tx_post_resync_dump, and the empty fragment may become a data segment with byte_count == 0, which will confuse the NIC and lead to a CQE error.
This commit fixes the described issue by skipping tls_append_frag on zero size to avoid adding empty fragments. The fix is not in the driver, because an empty fragment is hardly the desired behavior.
--- net/tls/tls_device.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
net/tls/tls_device.c +7 -5
@@ -483,11 +483,13 @@ static int tls_push_data(struct sock *sk, copy =min_t (size_t, size, (pfrag->size - pfrag->offset)); copy =min_t (size_t, copy, (max_open_record_len - record->len)); - rc =tls_device_copy_data (page_address (pfrag->page) + - pfrag->offset, copy, msg_iter); -if (rc) - goto handle_error; -tls_append_frag (record, pfrag, copy); +if (copy) { + rc =tls_device_copy_data (page_address (pfrag->page) + + pfrag->offset, copy, msg_iter); +if (rc) + goto handle_error; +tls_append_frag (record, pfrag, copy); + } size -= copy;if (!size) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 146/225 bnx2x: fix napi API usage sequence
In reply to Greg Kroah-HartmanFrom: Manish Chopra <[email protected]>
[ Upstream commit af68656d66eda219b7f55ce8313a1da0312c79e1 ]
While handling PCI errors (AER flow) driver tries to disable NAPI [napi_disable()] after NAPI is deleted [__netif_napi_del()] which causes unexpected system hang/crash.
System message log shows the following:
=======================================
[ 3222.537510] EEH: Detected PCI bus error on PHB#384-PE#800000 [ 3222.537511] EEH: This PCI device has failed 2 times in the last hour and will be permanently disabled after 5 failures. [ 3222.537512] EEH: Notify device drivers to shutdown [ 3222.537513] EEH: Beginning: 'error_detected(IO frozen)' [ 3222.537514] EEH: PE#800000 (PCI 0384:80:00.0): Invoking bnx2x->error_detected(IO frozen) [ 3222.537516] bnx2x: [bnx2x_io_error_detected:14236(eth14)]IO error detected [ 3222.537650] EEH: PE#800000 (PCI 0384:80:00.0): bnx2x driver reports: 'need reset' [ 3222.537651] EEH: PE#800000 (PCI 0384:80:00.1): Invoking bnx2x->error_detected(IO frozen) [ 3222.537651] bnx2x: [bnx2x_io_error_detected:14236(eth13)]IO error detected [ 3222.537729] EEH: PE#800000 (PCI 0384:80:00.1): bnx2x driver reports: 'need reset' [ 3222.537729] EEH: Finished:'error_detected(IO frozen)' with aggregate recovery state:'need reset' [ 3222.537890] EEH: Collect temporary log [ 3222.583481] EEH: of node=0384:80:00.0 [ 3222.583519] EEH: PCI device/vendor: 168e14e4 [ 3222.583557] EEH: PCI cmd/status register: 00100140 [ 3222.583557] EEH: PCI-E capabilities and status follow: [ 3222.583744] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.583892] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.583893] EEH: PCI-E 20: 00000000 [ 3222.583893] EEH: PCI-E AER capability register set follows: [ 3222.584079] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.584230] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.584378] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.584416] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.584416] EEH: of node=0384:80:00.1 [ 3222.584454] EEH: PCI device/vendor: 168e14e4 [ 3222.584491] EEH: PCI cmd/status register: 00100140 [ 3222.584492] EEH: PCI-E capabilities and status follow: [ 3222.584677] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.584825] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.584826] EEH: PCI-E 20: 00000000 [ 3222.584826] EEH: PCI-E AER capability register set follows: [ 3222.585011] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.585160] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.585309] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.585347] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.586872] RTAS: event: 5, Type: Platform Error (224), Severity: 2 [ 3222.586873] EEH: Reset without hotplug activity [ 3224.762767] EEH: Beginning: 'slot_reset' [ 3224.762770] EEH: PE#800000 (PCI 0384:80:00.0): Invoking bnx2x->slot_reset() [ 3224.762771] bnx2x: [bnx2x_io_slot_reset:14271(eth14)]IO slot reset initializing... [ 3224.762887] bnx2x 0384:80:00.0: enabling device (0140 -> 0142) [ 3224.768157] bnx2x: [bnx2x_io_slot_reset:14287(eth14)]IO slot reset
--> driver unload
Uninterruptible tasks
=====================
crash> ps | grep UN
213 2 11 c000000004c89e00 UN 0.0 0 0 [eehd]
215 2 0 c000000004c80000 UN 0.0 0 0
[kworker/0:2]
2196 1 28 c000000004504f00 UN 0.1 15936 11136 wickedd
4287 1 9 c00000020d076800 UN 0.0 4032 3008 agetty
4289 1 20 c00000020d056680 UN 0.0 7232 3840 agetty
32423 2 26 c00000020038c580 UN 0.0 0 0
[kworker/26:3]
32871 4241 27 c0000002609ddd00 UN 0.1 18624 11648 sshd
32920 10130 16 c00000027284a100 UN 0.1 48512 12608 sendmail
33092 32987 0 c000000205218b00 UN 0.1 48512 12608 sendmail
33154 4567 16 c000000260e51780 UN 0.1 48832 12864 pickup
33209 4241 36 c000000270cb6500 UN 0.1 18624 11712 sshd
33473 33283 0 c000000205211480 UN 0.1 48512 12672 sendmail
33531 4241 37 c00000023c902780 UN 0.1 18624 11648 sshdEEH handler hung while bnx2x sleeping and holding RTNL lock
===========================================================
crash> bt 213
PID: 213 TASK: c000000004c89e00 CPU: 11 COMMAND: "eehd"
#0 [c000000004d477e0] __schedule at c000000000c70808 #1 [c000000004d478b0] schedule at c000000000c70ee0 #2 [c000000004d478e0] schedule_timeout at c000000000c76dec #3 [c000000004d479c0] msleep at c0000000002120cc #4 [c000000004d479f0] napi_disable at c000000000a06448
^^^^^^^^^^^^^^^^
#5 [c000000004d47a30] bnx2x_netif_stop at c0080000018dba94 [bnx2x] #6 [c000000004d47a60] bnx2x_io_slot_reset at c0080000018a551c [bnx2x] #7 [c000000004d47b20] eeh_report_reset at c00000000004c9bc #8 [c000000004d47b90] eeh_pe_report at c00000000004d1a8
#9 [c000000004d47c40] eeh_handle_normal_event at c00000000004da64
And the sleeping source code
============================
crash> dis -ls c000000000a06448
FILE: ../net/core/dev.c
LINE: 6702
6697 {
6698 might_sleep();
6699 set_bit(NAPI_STATE_DISABLE, &n->state);
6700
6701 while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
* 6702 msleep(1);
6703 while (test_and_set_bit(NAPI_STATE_NPSVC, &n->state))
6704 msleep(1);
6705
6706 hrtimer_cancel(&n->timer);
6707
6708 clear_bit(NAPI_STATE_DISABLE, &n->state);
6709 }
EEH calls into bnx2x twice based on the system log above, first through bnx2x_io_error_detected() and then bnx2x_io_slot_reset(), and executes the following call chains:
bnx2x_io_error_detected()
+-> bnx2x_eeh_nic_unload()
+-> bnx2x_del_all_napi()
+-> __netif_napi_del()bnx2x_io_slot_reset()
+-> bnx2x_netif_stop()
+-> bnx2x_napi_disable()
+->napi_disable()Fix this by correcting the sequence of NAPI APIs usage, that is delete the NAPI after disabling it.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +5 -4
@@ -14153,10 +14153,6 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp)/* Stop Tx */ bnx2x_tx_disable (bp); -/* Delete all NAPI objects */ -bnx2x_del_all_napi (bp); -if (CNIC_LOADED (bp)) -bnx2x_del_all_napi_cnic (bp);netdev_reset_tc (bp->dev);del_timer_sync (&bp->timer);
@@ -14261,6 +14257,11 @@ static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev)bnx2x_drain_tx_queues (bp);bnx2x_send_unload_req (bp,UNLOAD_RECOVERY );bnx2x_netif_stop (bp,1 ); +bnx2x_del_all_napi (bp); + +if (CNIC_LOADED (bp)) +bnx2x_del_all_napi_cnic (bp); +bnx2x_free_irq (bp);/* Report UNLOAD_DONE to MCP */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 147/225 net: fec: add missing of_node_put() in fec_enet_init_stop_mode()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit d2b52ec056d5bddb055c8f21d7489a23548d0838 ]
Put device node in error path in fec_enet_init_stop_mode().
--- drivers/net/ethernet/freescale/fec_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/fec_main.c +1 -1
@@ -3731,7 +3731,7 @@ static int fec_enet_init_stop_mode(struct fec_enet_private *fep, ARRAY_SIZE(out_val));if (ret) {dev_dbg (&fep->pdev->dev,"no stop mode property\n" ); -return ret; + goto out; } fep->stop_gpr.gpr =syscon_node_to_regmap (gpr_np);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 148/225 gfs2: Minor retry logic cleanup
In reply to Greg Kroah-HartmanFrom: Andreas Gruenbacher <[email protected]>
[ Upstream commit 124c458a401a2497f796e4f2d6cafac6edbea8e9 ]
Clean up the retry logic in the read and write functions somewhat.
--- fs/gfs2/file.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-)
fs/gfs2/file.c +16 -18
@@ -851,9 +851,9 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to, leftover =fault_in_iov_iter_writeable (to, window_size);gfs2_holder_disallow_demote (gh);if (leftover != window_size) { -if (!gfs2_holder_queued (gh)) - goto retry; - goto retry_under_glock; +if (gfs2_holder_queued (gh)) + goto retry_under_glock; + goto retry; } }if (gfs2_holder_queued (gh))
@@ -920,9 +920,9 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from, leftover =fault_in_iov_iter_readable (from, window_size);gfs2_holder_disallow_demote (gh);if (leftover != window_size) { -if (!gfs2_holder_queued (gh)) - goto retry; - goto retry_under_glock; +if (gfs2_holder_queued (gh)) + goto retry_under_glock; + goto retry; } } out:
@@ -989,12 +989,11 @@ static ssize_t gfs2_file_read_iter(struct kiocb *iocb, struct iov_iter *to) leftover =fault_in_iov_iter_writeable (to, window_size);gfs2_holder_disallow_demote (&gh);if (leftover != window_size) { -if (!gfs2_holder_queued (&gh)) { -if (written) - goto out_uninit; - goto retry; - } - goto retry_under_glock; +if (gfs2_holder_queued (&gh)) + goto retry_under_glock; +if (written) + goto out_uninit; + goto retry; } }if (gfs2_holder_queued (&gh))
@@ -1068,12 +1067,11 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,gfs2_holder_disallow_demote (gh);if (leftover != window_size) { from->count =min (from->count, window_size - leftover); -if (!gfs2_holder_queued (gh)) { -if (read) - goto out_uninit; - goto retry; - } - goto retry_under_glock; +if (gfs2_holder_queued (gh)) + goto retry_under_glock; +if (read) + goto out_uninit; + goto retry; } } out_unlock:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 149/225 gfs2: Make sure not to return short direct writes
In reply to Greg Kroah-HartmanFrom: Andreas Gruenbacher <[email protected]>
[ Upstream commit 3bde4c48586074202044456285a97ccdf9048988 ]
When direct writes fail with -ENOTBLK because we're writing into a hole (gfs2_iomap_begin()) or because of a page invalidation failure (iomap_dio_rw()), we're falling back to buffered writes. In that case, when we lose the inode glock in gfs2_file_buffered_write(), we want to re-acquire it instead of returning a short write.
--- fs/gfs2/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/file.c +1 -1
@@ -1069,7 +1069,7 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb, from->count =min (from->count, window_size - leftover);if (gfs2_holder_queued (gh)) goto retry_under_glock; -if (read) +if (read && !(iocb->ki_flags &IOCB_DIRECT )) goto out_uninit; goto retry; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 150/225 gfs2: No short reads or writes upon glock contention
In reply to Greg Kroah-HartmanFrom: Andreas Gruenbacher <[email protected]>
[ Upstream commit 296abc0d91d8b65d42224dd33452ace14491ad08 ]
Commit 00bfe02f4796 ("gfs2: Fix mmap + page fault deadlocks for buffered I/O") changed gfs2_file_read_iter() and gfs2_file_buffered_write() to allow dropping the inode glock while faulting in user buffers. When the lock was dropped, a short result was returned to indicate that the operation was interrupted.
As pointed out by Linus (see the link below), this behavior is broken and the operations should always re-acquire the inode glock and resume the operation instead.
--- fs/gfs2/file.c | 4 ---- 1 file changed, 4 deletions(-)
fs/gfs2/file.c +0 -4
@@ -991,8 +991,6 @@ static ssize_t gfs2_file_read_iter(struct kiocb *iocb, struct iov_iter *to)if (leftover != window_size) {if (gfs2_holder_queued (&gh)) goto retry_under_glock; -if (written) - goto out_uninit; goto retry; } }
@@ -1069,8 +1067,6 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb, from->count =min (from->count, window_size - leftover);if (gfs2_holder_queued (gh)) goto retry_under_glock; -if (read && !(iocb->ki_flags &IOCB_DIRECT )) - goto out_uninit; goto retry; } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 151/225 perf arm-spe: Fix addresses of synthesized SPE events
In reply to Greg Kroah-HartmanFrom: Timothy Hayes <[email protected]>
[ Upstream commit 4e13f6706d5aee1a6b835a44f6cf4971a921dcb8 ]
This patch corrects a bug whereby synthesized events from SPE samples are missing virtual addresses.
--- tools/perf/util/arm-spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/arm-spe.c +1 -1
@@ -1036,7 +1036,7 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session) attr.sample_type = evsel->core.attr.sample_type &PERF_SAMPLE_MASK ; attr.sample_type |=PERF_SAMPLE_IP |PERF_SAMPLE_TID |PERF_SAMPLE_PERIOD |PERF_SAMPLE_DATA_SRC | -PERF_SAMPLE_WEIGHT ; +PERF_SAMPLE_WEIGHT |PERF_SAMPLE_ADDR ;if (spe->timeless_decoding) attr.sample_type &= ~(u64 )PERF_SAMPLE_TIME ;else
Signature · 9 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Greg Kroah-Hartman
maintainerPATCH 152/225 ixgbe: ensure IPsec VF<->PF compatibility
In reply to Greg Kroah-HartmanFrom: Leon Romanovsky <[email protected]>
[ Upstream commit f049efc7f7cd2f3c419f55040928eaefb13b3636 ]
The VF driver can forward any IPsec flags and such makes the function is not extendable and prone to backward/forward incompatibility.
If new software runs on VF, it won't know that PF configured something completely different as it "knows" only XFRM_OFFLOAD_INBOUND flag.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +2 -1
@@ -903,7 +903,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)/* Tx IPsec offload doesn't seem to work on this * device, so block these requests for now. */ -if (!(sam->flags &XFRM_OFFLOAD_INBOUND )) { + sam->flags = sam->flags & ~XFRM_OFFLOAD_IPV6 ; +if (sam->flags !=XFRM_OFFLOAD_INBOUND ) { err = -EOPNOTSUPP ; goto err_out; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 153/225 net: enetc: allow tc-etf offload even with NETIF_F_CSUM_MASK
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
[ Upstream commit 66a2f5ef68faaf950746747d790a0c95f7ec96d2 ]
The Time-Specified Departure feature is indeed mutually exclusive with TX IP checksumming in ENETC, but TX checksumming in itself is broken and was removed from this driver in commit 82728b91f124 ("enetc: Remove Tx checksumming offload code").
The blamed commit declared NETIF_F_HW_CSUM in dev->features to comply with software TSO's expectations, and still did the checksumming in software by calling skb_checksum_help(). So there isn't any restriction for the Time-Specified Departure feature.
However, enetc_setup_tc_txtime() doesn't understand that, and blindly looks for NETIF_F_CSUM_MASK.
Instead of checking for things which can literally never happen in the current code base, just remove the check and let the driver offload tc-etf qdiscs.
--- drivers/net/ethernet/freescale/enetc/enetc_qos.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc_qos.c +0 -4
@@ -308,10 +308,6 @@ int enetc_setup_tc_txtime(struct net_device *ndev, void *type_data)if (tc <0 || tc >= priv->num_tx_rings)return -EINVAL ; -/* Do not support TXSTART and TX CSUM offload simutaniously */ -if (ndev->features &NETIF_F_CSUM_MASK ) -return -EBUSY ; -/* TSD and Qbv are mutually exclusive in hardware */ if (enetc_rd (&priv->si->hw,ENETC_QBV_PTGCR_OFFSET ) &ENETC_QBV_TGE )return -EBUSY ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 154/225 Revert "ibmvnic: Add ethtool private flag for driver-defined queue limits"
In reply to Greg Kroah-HartmanFrom: Dany Madden <[email protected]>
[ Upstream commit aeaf59b78712c7a1827c76f086acff4f586e072f ]
This reverts commit 723ad916134784b317b72f3f6cf0f7ba774e5dae
When client requests channel or ring size larger than what the server can support the server will cap the request to the supported max. So, the client would not be able to successfully request resources that exceed the server limit.
--- drivers/net/ethernet/ibm/ibmvnic.c | 129 ++++++++--------------------- drivers/net/ethernet/ibm/ibmvnic.h | 6 -- 2 files changed, 35 insertions(+), 100 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +35 -94
@@ -3209,13 +3209,8 @@ static void ibmvnic_get_ringparam(struct net_device *netdev, {struct ibmvnic_adapter *adapter =netdev_priv (netdev); -if (adapter->priv_flags &IBMVNIC_USE_SERVER_MAXES ) { - ring->rx_max_pending = adapter->max_rx_add_entries_per_subcrq; - ring->tx_max_pending = adapter->max_tx_entries_per_subcrq; - }else { - ring->rx_max_pending =IBMVNIC_MAX_QUEUE_SZ ; - ring->tx_max_pending =IBMVNIC_MAX_QUEUE_SZ ; - } + ring->rx_max_pending = adapter->max_rx_add_entries_per_subcrq; + ring->tx_max_pending = adapter->max_tx_entries_per_subcrq; ring->rx_mini_max_pending =0 ; ring->rx_jumbo_max_pending =0 ; ring->rx_pending = adapter->req_rx_add_entries_per_subcrq;
@@ -3230,23 +3225,21 @@ static int ibmvnic_set_ringparam(struct net_device *netdev, struct netlink_ext_ack *extack) {struct ibmvnic_adapter *adapter =netdev_priv (netdev); -int ret; - ret =0 ; +if (ring->rx_pending > adapter->max_rx_add_entries_per_subcrq || + ring->tx_pending > adapter->max_tx_entries_per_subcrq) { +netdev_err (netdev,"Invalid request.\n" ); +netdev_err (netdev,"Max tx buffers = %llu\n" , + adapter->max_rx_add_entries_per_subcrq); +netdev_err (netdev,"Max rx buffers = %llu\n" , + adapter->max_tx_entries_per_subcrq); +return -EINVAL ; + } + adapter->desired.rx_entries = ring->rx_pending; adapter->desired.tx_entries = ring->tx_pending; - ret =wait_for_reset (adapter); - -if (!ret && - (adapter->req_rx_add_entries_per_subcrq != ring->rx_pending || - adapter->req_tx_entries_per_subcrq != ring->tx_pending)) -netdev_info (netdev, -"Could not match full ringsize request. Requested: RX %d, TX %d; Allowed: RX %llu, TX %llu\n" , - ring->rx_pending, ring->tx_pending, - adapter->req_rx_add_entries_per_subcrq, - adapter->req_tx_entries_per_subcrq); -return ret; +return wait_for_reset (adapter); } static void ibmvnic_get_channels(struct net_device *netdev,
@@ -3254,14 +3247,8 @@ static void ibmvnic_get_channels(struct net_device *netdev, {struct ibmvnic_adapter *adapter =netdev_priv (netdev); -if (adapter->priv_flags &IBMVNIC_USE_SERVER_MAXES ) { - channels->max_rx = adapter->max_rx_queues; - channels->max_tx = adapter->max_tx_queues; - }else { - channels->max_rx =IBMVNIC_MAX_QUEUES ; - channels->max_tx =IBMVNIC_MAX_QUEUES ; - } - + channels->max_rx = adapter->max_rx_queues; + channels->max_tx = adapter->max_tx_queues; channels->max_other =0 ; channels->max_combined =0 ; channels->rx_count = adapter->req_rx_queues;
@@ -3274,22 +3261,11 @@ static int ibmvnic_set_channels(struct net_device *netdev, struct ethtool_channels *channels) {struct ibmvnic_adapter *adapter =netdev_priv (netdev); -int ret; - ret =0 ; adapter->desired.rx_queues = channels->rx_count; adapter->desired.tx_queues = channels->tx_count; - ret =wait_for_reset (adapter); - -if (!ret && - (adapter->req_rx_queues != channels->rx_count || - adapter->req_tx_queues != channels->tx_count)) -netdev_info (netdev, -"Could not match full channels request. Requested: RX %d, TX %d; Allowed: RX %llu, TX %llu\n" , - channels->rx_count, channels->tx_count, - adapter->req_rx_queues, adapter->req_tx_queues); -return ret; +return wait_for_reset (adapter); }static void ibmvnic_get_strings (struct net_device *dev,u32 stringset,u8 *data)
@@ -3297,43 +3273,32 @@ static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data)struct ibmvnic_adapter *adapter =netdev_priv (dev);int i; -switch (stringset) { -case ETH_SS_STATS : -for (i =0 ; i <ARRAY_SIZE (ibmvnic_stats); - i++, data +=ETH_GSTRING_LEN ) -memcpy (data, ibmvnic_stats[i].name,ETH_GSTRING_LEN ); +if (stringset !=ETH_SS_STATS ) +return ; -for (i =0 ; i < adapter->req_tx_queues; i++) { -snprintf (data,ETH_GSTRING_LEN ,"tx%d_packets" , i); - data +=ETH_GSTRING_LEN ; +for (i =0 ; i <ARRAY_SIZE (ibmvnic_stats); i++, data +=ETH_GSTRING_LEN ) +memcpy (data, ibmvnic_stats[i].name,ETH_GSTRING_LEN ); -snprintf (data,ETH_GSTRING_LEN ,"tx%d_bytes" , i); - data +=ETH_GSTRING_LEN ; +for (i =0 ; i < adapter->req_tx_queues; i++) { +snprintf (data,ETH_GSTRING_LEN ,"tx%d_packets" , i); + data +=ETH_GSTRING_LEN ; -snprintf (data,ETH_GSTRING_LEN , -"tx%d_dropped_packets" , i); - data +=ETH_GSTRING_LEN ; - } +snprintf (data,ETH_GSTRING_LEN ,"tx%d_bytes" , i); + data +=ETH_GSTRING_LEN ; -for (i =0 ; i < adapter->req_rx_queues; i++) { -snprintf (data,ETH_GSTRING_LEN ,"rx%d_packets" , i); - data +=ETH_GSTRING_LEN ; +snprintf (data,ETH_GSTRING_LEN ,"tx%d_dropped_packets" , i); + data +=ETH_GSTRING_LEN ; + } -snprintf (data,ETH_GSTRING_LEN ,"rx%d_bytes" , i); - data +=ETH_GSTRING_LEN ; +for (i =0 ; i < adapter->req_rx_queues; i++) { +snprintf (data,ETH_GSTRING_LEN ,"rx%d_packets" , i); + data +=ETH_GSTRING_LEN ; -snprintf (data,ETH_GSTRING_LEN ,"rx%d_interrupts" , i); - data +=ETH_GSTRING_LEN ; - } -break ; +snprintf (data,ETH_GSTRING_LEN ,"rx%d_bytes" , i); + data +=ETH_GSTRING_LEN ; -case ETH_SS_PRIV_FLAGS : -for (i =0 ; i <ARRAY_SIZE (ibmvnic_priv_flags); i++) -strcpy (data + i *ETH_GSTRING_LEN , - ibmvnic_priv_flags[i]); -break ; -default : -return ; +snprintf (data,ETH_GSTRING_LEN ,"rx%d_interrupts" , i); + data +=ETH_GSTRING_LEN ; } }
@@ -3346,8 +3311,6 @@ static int ibmvnic_get_sset_count(struct net_device *dev, int sset)return ARRAY_SIZE (ibmvnic_stats) + adapter->req_tx_queues *NUM_TX_STATS + adapter->req_rx_queues *NUM_RX_STATS ; -case ETH_SS_PRIV_FLAGS : -return ARRAY_SIZE (ibmvnic_priv_flags);default :return -EOPNOTSUPP ; }
@@ -3400,26 +3363,6 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev, } } -static u32 ibmvnic_get_priv_flags (struct net_device *netdev) -{ -struct ibmvnic_adapter *adapter =netdev_priv (netdev); - -return adapter->priv_flags; -} - -static int ibmvnic_set_priv_flags (struct net_device *netdev,u32 flags) -{ -struct ibmvnic_adapter *adapter =netdev_priv (netdev); -bool which_maxes = !!(flags &IBMVNIC_USE_SERVER_MAXES ); - -if (which_maxes) - adapter->priv_flags |=IBMVNIC_USE_SERVER_MAXES ; -else - adapter->priv_flags &= ~IBMVNIC_USE_SERVER_MAXES ; - -return 0 ; -} -static const struct ethtool_ops ibmvnic_ethtool_ops = { .get_drvinfo = ibmvnic_get_drvinfo, .get_msglevel = ibmvnic_get_msglevel,
@@ -3433,8 +3376,6 @@ static const struct ethtool_ops ibmvnic_ethtool_ops = { .get_sset_count = ibmvnic_get_sset_count, .get_ethtool_stats = ibmvnic_get_ethtool_stats, .get_link_ksettings = ibmvnic_get_link_ksettings, - .get_priv_flags = ibmvnic_get_priv_flags, - .set_priv_flags = ibmvnic_set_priv_flags, };/* Routines for managing CRQs/sCRQs */
drivers/net/ethernet/ibm/ibmvnic.h +0 -6
@@ -41,11 +41,6 @@#define IBMVNIC_RESET_DELAY 100 -static const char ibmvnic_priv_flags[][ETH_GSTRING_LEN ] = { -#define IBMVNIC_USE_SERVER_MAXES 0x1 -"use-server-maxes" -}; -struct ibmvnic_login_buffer {__be32 len;__be32 version;
@@ -883,7 +878,6 @@ struct ibmvnic_adapter {struct ibmvnic_control_ip_offload_buffer ip_offload_ctrl;dma_addr_t ip_offload_ctrl_tok;u32 msg_enable; -u32 priv_flags;/* Vital Product Data (VPD) */ struct ibmvnic_vpd *vpd;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 155/225 tcp: fix F-RTO may not work correctly when receiving DSACK
In reply to Greg Kroah-HartmanFrom: Pengcheng Yang <[email protected]>
[ Upstream commit d9157f6806d1499e173770df1f1b234763de5c79 ]
Currently DSACK is regarded as a dupack, which may cause F-RTO to incorrectly enter "loss was real" when receiving DSACK.
Packetdrill to demonstrate:
// Enable F-RTO and TLP
0 `sysctl -q net.ipv4.tcp_frto=2`
0 `sysctl -q net.ipv4.tcp_early_retrans=3`
0 `sysctl -q net.ipv4.tcp_congestion_control=cubic`// Establish a connection
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0
// RTT 10ms, RTO 210ms
+.1 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7>
+0 > S. 0:0(0) ack 1 <...>
+.01 < . 1:1(0) ack 1 win 257
+0 accept(3, ..., ...) = 4
// Send 2 data segments
+0 write(4, ..., 2000) = 2000
+0 > P. 1:2001(2000) ack 1
// TLP
+.022 > P. 1001:2001(1000) ack 1
// Continue to send 8 data segments
+0 write(4, ..., 10000) = 10000
+0 > P. 2001:10001(8000) ack 1
// RTO
+.188 > . 1:1001(1000) ack 1
// The original data is acked and new data is sent(F-RTO step 2.b)
+0 < . 1:1(0) ack 2001 win 257
+0 > P. 10001:12001(2000) ack 1
// D-SACK caused by TLP is regarded as a dupack, this results in // the incorrect judgment of "loss was real"(F-RTO step 3.a) +.022 < . 1:1(0) ack 2001 win 257 <sack 1001:2001,nop,nop>
// Never-retransmitted data(3001:4001) are acked and // expect to switch to open state(F-RTO step 3.b)
+0 < . 1:1(0) ack 4001 win 257
+0 %{ assert tcpi_ca_state == 0, tcpi_ca_state }%
--- net/ipv4/tcp_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/tcp_input.c +2 -1
@@ -3867,7 +3867,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)tcp_process_tlp_ack (sk, ack, flag);if (tcp_ack_is_dubious (sk, flag)) { -if (!(flag & (FLAG_SND_UNA_ADVANCED |FLAG_NOT_DUP ))) { +if (!(flag & (FLAG_SND_UNA_ADVANCED | +FLAG_NOT_DUP |FLAG_DSACKING_ACK ))) { num_dupack =1 ;/* Consider if pure acks were aggregated in tcp_add_backlog() */ if (!(flag &FLAG_DATA ))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 156/225 io_uring: fix uninitialized field in rw io_kiocb
In reply to Greg Kroah-HartmanFrom: Joseph Ravichandran <[email protected]>
[ Upstream commit 32452a3eb8b64e01e2be717f518c0be046975b9d ]
io_rw_init_file does not initialize kiocb->private, so when iocb_bio_iopoll reads kiocb->private it can contain uninitialized data.
--- fs/io_uring.c | 1 + 1 file changed, 1 insertion(+)
fs/io_uring.c +1 -0
@@ -3584,6 +3584,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode)if (!(kiocb->ki_flags &IOCB_DIRECT ) || !file->f_op->iopoll)return -EOPNOTSUPP ; + kiocb->private =NULL ; kiocb->ki_flags |=IOCB_HIPRI |IOCB_ALLOC_CACHE ; kiocb->ki_complete = io_complete_rw_iopoll; req->iopoll_completed =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 157/225 ASoC: soc-pcm: use GFP_KERNEL when the code is sleepable
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit fb6d679fee95d272c0a94912c4e534146823ee89 ]
At the kzalloc() call in dpcm_be_connect(), there is no spin lock involved. It's merely protected by card->pcm_mutex, instead. The spinlock is applied at the later call with snd_soc_pcm_stream_lock_irq() only for the list manipulations. (See it's *_irq(), not *_irqsave(); that means the context being sleepable at that point.) So, we can use GFP_KERNEL safely there.
This patch revert commit d8a9c6e1f676 ("ASoC: soc-pcm: use GFP_ATOMIC for dpcm structure") which is no longer needed since commit b7898396f4bb ("ASoC: soc-pcm: Fix and cleanup DPCM locking").
--- sound/soc/soc-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-pcm.c +1 -1
@@ -1214,7 +1214,7 @@ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe, be_substream->pcm->nonatomic =1 ; } - dpcm =kzalloc (sizeof (struct snd_soc_dpcm ),GFP_ATOMIC ); + dpcm =kzalloc (sizeof (struct snd_soc_dpcm ),GFP_KERNEL );if (!dpcm)return -ENOMEM ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 158/225 ASoC: cs35l41: Fix a shift-out-of-bounds warning found by UBSAN
In reply to Greg Kroah-HartmanFrom: Hui Wang <[email protected]>
[ Upstream commit 0b3d5d2e358ca6772fc3662fca27acb12a682fbf ]
We enabled UBSAN in the ubuntu kernel, and the cs35l41 driver triggers a warning calltrace like below:
cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: bitoffset= 8, word_offset=23, bit_sum mod 32=0, otp_map[i].size = 24 cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: bitoffset= 0, word_offset=24, bit_sum mod 32=24, otp_map[i].size = 0
================================================================================
UBSAN: shift-out-of-bounds in linux-kernel-src/sound/soc/codecs/cs35l41-lib.c:836:8 shift exponent 64 is too large for 64-bit type 'long unsigned int' CPU: 10 PID: 595 Comm: systemd-udevd Not tainted 5.15.0-23-generic #23 Hardware name: LENOVO \x02MFG_IN_GO/\x02MFG_IN_GO, BIOS N3GET19W (1.00 ) 03/11/2022 Call Trace: <TASK> show_stack+0x52/0x58 dump_stack_lvl+0x4a/0x5f dump_stack+0x10/0x12 ubsan_epilogue+0x9/0x45 __ubsan_handle_shift_out_of_bounds.cold+0x61/0xef ? regmap_unlock_mutex+0xe/0x10 cs35l41_otp_unpack.cold+0x1c6/0x2b2 [snd_soc_cs35l41_lib] cs35l41_hda_probe+0x24f/0x33a [snd_hda_scodec_cs35l41] cs35l41_hda_i2c_probe+0x65/0x90 [snd_hda_scodec_cs35l41_i2c]
When both bitoffset and otp_map[i].size are 0, the line 836 will result in GENMASK(-1, 0), this triggers the shift-out-of-bounds calltrace.
Here add a checking, if both bitoffset and otp_map[i].size are 0, do not run GENMASK() and directly set otp_val to 0, this will not bring any function change on the driver but could avoid the calltrace.
--- sound/soc/codecs/cs35l41-lib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/cs35l41-lib.c +4 -2
@@ -831,12 +831,14 @@ int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap) GENMASK(bit_offset + otp_map[i].size - 33, 0)) << (32 - bit_offset); bit_offset += otp_map[i].size -32 ; - }else { + }else if (bit_offset + otp_map[i].size -1 >=0 ) { otp_val = (otp_mem[word_offset] &GENMASK (bit_offset + otp_map[i].size -1 , bit_offset) ) >> bit_offset; bit_offset += otp_map[i].size; - } + }else /* both bit_offset and otp_map[i].size are 0 */ + otp_val =0 ; + bit_sum += otp_map[i].size;if (bit_offset ==32 ) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 159/225 ASoC: rt711/5682: check if bus is active before deferred jack detection
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 770f3d992a3f7330f801dfeee98429b2885c9fdb ]
This patch takes a defensive programming and paranoid approach in case the parent device (SoundWire) is pm_runtime resumed but the rt711 device is not. In that case, during the attachment and initialization, a jack detection workqueue can be scheduled. Since the pm_runtime suspend routines will not be invoked, the sequence to cancel all deferred work is not executed, and the jack detection could happen after the bus stops operating, leading to a timeout.
This patch applies the same solution to rt5682, based on the similarities between codec drivers. The race condition with rt5682 was not detected experimentally though.
--- sound/soc/codecs/rt5682.c | 9 +++++++++ sound/soc/codecs/rt711.c | 7 +++++++ 2 files changed, 16 insertions(+)
sound/soc/codecs/rt5682.c +9 -0
@@ -1100,6 +1100,15 @@ void rt5682_jack_detect_handler(struct work_struct *work)return ; } +if (rt5682->is_sdw) { +if (pm_runtime_status_suspended (rt5682->slave->dev.parent)) { +dev_dbg (&rt5682->slave->dev, +"%s: parent device is pm_runtime_status_suspended, skipping jack detection\n" , + __func__); +return ; + } + } + dapm =snd_soc_component_get_dapm (rt5682->component);snd_soc_dapm_mutex_lock (dapm);
sound/soc/codecs/rt711.c +7 -0
@@ -245,6 +245,13 @@ static void rt711_jack_detect_handler(struct work_struct *work)if (!rt711->component->card->instantiated)return ; +if (pm_runtime_status_suspended (rt711->slave->dev.parent)) { +dev_dbg (&rt711->slave->dev, +"%s: parent device is pm_runtime_status_suspended, skipping jack detection\n" , + __func__); +return ; + } + reg =RT711_VERB_GET_PIN_SENSE |RT711_HP_OUT ; ret =regmap_read (rt711->regmap, reg, &jack_status);if (ret <0 )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 160/225 ASoC: Intel: soc-acpi: correct device endpoints for max98373
In reply to Greg Kroah-HartmanFrom: Chao Song <[email protected]>
[ Upstream commit 97326be14df7bacc6ba5c62c0556298c27ea0432 ]
The left speaker of max98373 uses spk_r_endpoint, and right speaker uses spk_l_endpoint, this is obviously wrong.
This patch corrects the endpoints for max98373 codec.
--- sound/soc/intel/common/soc-acpi-intel-tgl-match.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/intel/common/soc-acpi-intel-tgl-match.c +2 -2
@@ -132,13 +132,13 @@ static const struct snd_soc_acpi_adr_device mx8373_1_adr[] = { { .adr = 0x000123019F837300ull, .num_endpoints = 1, - .endpoints = &spk_l_endpoint, + .endpoints = &spk_r_endpoint, .name_prefix = "Right" }, { .adr = 0x000127019F837300ull, .num_endpoints = 1, - .endpoints = &spk_r_endpoint, + .endpoints = &spk_l_endpoint, .name_prefix = "Left" } };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 161/225 ASoC: wm8731: Disable the regulator when probing fails
In reply to Greg Kroah-HartmanFrom: Zheyu Ma <[email protected]>
[ Upstream commit 92ccbf17eeacf510cf1eed9c252d9332ca24f02d ]
When the driver fails during probing, the driver should disable the regulator, not just handle it in wm8731_hw_init().
The following log reveals it:
[ 17.812483] WARNING: CPU: 1 PID: 364 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0 [ 17.815958] RIP: 0010:_regulator_put+0x3ec/0x4e0 [ 17.824467] Call Trace: [ 17.824774] <TASK> [ 17.825040] regulator_bulk_free+0x82/0xe0 [ 17.825514] devres_release_group+0x319/0x3d0 [ 17.825882] i2c_device_probe+0x766/0x940 [ 17.829198] i2c_register_driver+0xb5/0x130
--- sound/soc/codecs/wm8731.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
sound/soc/codecs/wm8731.c +11 -8
@@ -602,7 +602,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) ret =wm8731_reset (wm8731->regmap);if (ret <0 ) {dev_err (dev,"Failed to issue reset: %d\n" , ret); - goto err_regulator_enable; + goto err; }/* Clear POWEROFF, keep everything else disabled */
@@ -619,10 +619,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731)regcache_mark_dirty (wm8731->regmap); -err_regulator_enable: -/* Regulators will be enabled by bias management */ -regulator_bulk_disable (ARRAY_SIZE (wm8731->supplies), wm8731->supplies); - +err:return ret; }
@@ -760,21 +757,27 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, ret =PTR_ERR (wm8731->regmap);dev_err (&i2c->dev,"Failed to allocate register map: %d\n" , ret); -return ret; + goto err_regulator_enable; } ret =wm8731_hw_init (&i2c->dev, wm8731);if (ret !=0 ) -return ret; + goto err_regulator_enable; ret =devm_snd_soc_register_component (&i2c->dev, &soc_component_dev_wm8731, &wm8731_dai,1 );if (ret !=0 ) {dev_err (&i2c->dev,"Failed to register CODEC: %d\n" , ret); -return ret; + goto err_regulator_enable; }return 0 ; + +err_regulator_enable: +/* Regulators will be enabled by bias management */ +regulator_bulk_disable (ARRAY_SIZE (wm8731->supplies), wm8731->supplies); + +return ret; }static int wm8731_i2c_remove (struct i2c_client *client)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 162/225 ASoC: Intel: sof_es8336: Add a quirk for Huawei Matebook D15
In reply to Greg Kroah-HartmanFrom: Mauro Carvalho Chehab <[email protected]>
[ Upstream commit c7cb4717f641db68e8117635bfcf62a9c27dc8d3 ]
Based on experimental tests, Huawei Matebook D15 actually uses both gpio0 and gpio1: the first one controls the speaker, while the other one controls the headphone.
Also, the headset is mapped as MIC1, instead of MIC2.
So, add a quirk for it.
--- sound/soc/intel/boards/sof_es8336.c | 9 +++++++++ 1 file changed, 9 insertions(+)
sound/soc/intel/boards/sof_es8336.c +9 -0
@@ -252,6 +252,15 @@ static const struct dmi_system_id sof_es8336_quirk_table[] = { SOF_ES8336_TGL_GPIO_QUIRK | SOF_ES8336_ENABLE_DMIC) }, + { + .callback = sof_es8336_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "HUAWEI"), + DMI_MATCH(DMI_BOARD_NAME, "BOHB-WAX9-PCB-B2"), + }, + .driver_data = (void *)(SOF_ES8336_HEADPHONE_GPIO | + SOC_ES8336_HEADSET_MIC1) + }, {} };
Signature · 1 line
2.35.1
Re: [PATCH 5.17 162/225] ASoC: Intel: sof_es8336: Add a quirk for Huawei Matebook D15
Quoted 10 lines · Greg Kroah-Hartman
From: Mauro Carvalho Chehab <[email protected]>
[ Upstream commit
c7cb4717f641db68e8117635bfcf62a9c27dc8d3]Based on experimental tests, Huawei Matebook D15 actually uses both gpio0 and gpio1: the first one controls the speaker, while the other one controls the headphone.
Also, the headset is mapped as MIC1, instead of MIC2.
Quoted 8 lines
So, add a quirk for it.
Signed-off-by Mauro Carvalho Chehab <[email protected]>Link https://lore.kernel.org/r/d678aef9fc9a07aced611aa7cb8c9b800c649e5a.1649357263.git.mchehab@kernel.org open hereSigned-off-by Mark Brown <[email protected]>Signed-off-by Sasha Levin <[email protected]>---
This patch is missing some dependencies and fails to build:
sound/soc/intel/boards/sof_es8336.c:261:41: error: 'SOF_ES8336_HEADPHONE_GPIO' undeclared here (not in a function)
261 | .driver_data = (void *)(SOF_ES8336_HEADPHONE_GPIO |
SOF_ES8336_HEADPHONE_GPIO was defined in upstream commit:6e1ff1459e008 ASoC: Intel: sof_es8336: support a separate gpio to control headphone which appeared with 5.18-rc4
sound/soc/intel/boards/sof_es8336.c:262:41: error: 'SOC_ES8336_HEADSET_MIC1' undeclared here (not in a function)
262 | SOC_ES8336_HEADSET_MIC1)
SOC_ES8336_HEADSET_MIC1 was defined in upstream commit:7c7bb2a059b22 ASoC: Intel: sof_es8336: add a quirk for headset at mic1 port which also appeared with 5.18-rc4
We either need to bring in these 2 commits or drop this one from the stable queue.
Justin
Quoted 28 lines
sound/soc/intel/boards/sof_es8336.c | 9 +++++++++ 1 file changed, 9 insertions(+)sound/soc/intel/boards/sof_es8336.c +9
-0@@ -252,6 +252,15 @@ static const struct dmi_system_id sof_es8336_quirk_table[] = { SOF_ES8336_TGL_GPIO_QUIRK | SOF_ES8336_ENABLE_DMIC) }, + { + .callback = sof_es8336_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "HUAWEI"), + DMI_MATCH(DMI_BOARD_NAME, "BOHB-WAX9-PCB-B2"), + }, + .driver_data = (void *)(SOF_ES8336_HEADPHONE_GPIO | + SOC_ES8336_HEADSET_MIC1) + }, {} };Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerRe: [PATCH 5.17 162/225] ASoC: Intel: sof_es8336: Add a quirk for Huawei Matebook D15
Quoted 32 lines · Justin Forbes
Quoted 10 lines · Greg Kroah-Hartman
From: Mauro Carvalho Chehab <[email protected]>
[ Upstream commit
c7cb4717f641db68e8117635bfcf62a9c27dc8d3]Based on experimental tests, Huawei Matebook D15 actually uses both gpio0 and gpio1: the first one controls the speaker, while the other one controls the headphone.
Also, the headset is mapped as MIC1, instead of MIC2.
Quoted 8 lines
So, add a quirk for it.
Signed-off-by Mauro Carvalho Chehab <[email protected]>Link https://lore.kernel.org/r/d678aef9fc9a07aced611aa7cb8c9b800c649e5a.1649357263.git.mchehab@kernel.org open hereSigned-off-by Mark Brown <[email protected]>Signed-off-by Sasha Levin <[email protected]>---
This patch is missing some dependencies and fails to build:
sound/soc/intel/boards/sof_es8336.c:261:41: error: 'SOF_ES8336_HEADPHONE_GPIO' undeclared here (not in a function)
261 | .driver_data = (void *)(SOF_ES8336_HEADPHONE_GPIO |
SOF_ES8336_HEADPHONE_GPIOwas defined in upstream commit:6e1ff1459e008ASoC: Intel:sof_es8336: support a separate gpio to control headphone which appeared with 5.18-rc4
sound/soc/intel/boards/sof_es8336.c:262:41: error: 'SOC_ES8336_HEADSET_MIC1' undeclared here (not in a function)
262 |SOC_ES8336_HEADSET_MIC1)
Quoted 6 lines
SOC_ES8336_HEADSET_MIC1was defined in upstream commit:7c7bb2a059b22ASoC: Intel:sof_es8336: add a quirk for headset at mic1 port which also appeared with 5.18-rc4We either need to bring in these 2 commits or drop this one from the stable queue.
I've dropped this one now, thanks.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 163/225 Input: cypress-sf - register a callback to disable the regulators
In reply to Greg Kroah-HartmanFrom: Zheyu Ma <[email protected]>
[ Upstream commit fd0a4b39870d49ff15f6966470185409e261f20f ]
When the driver fails to probe, we will get the following splat:
[ 19.311970] ------------[ cut here ]------------ [ 19.312566] WARNING: CPU: 3 PID: 375 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0 [ 19.317591] RIP: 0010:_regulator_put+0x3ec/0x4e0 [ 19.328831] Call Trace: [ 19.329112] <TASK> [ 19.329369] regulator_bulk_free+0x82/0xe0 [ 19.329860] devres_release_group+0x319/0x3d0 [ 19.330357] i2c_device_probe+0x766/0x940
Fix this by adding a callback that will deal with the disabling when the driver fails to probe.
--- drivers/input/keyboard/cypress-sf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/input/keyboard/cypress-sf.c +14 -0
@@ -61,6 +61,14 @@ static irqreturn_t cypress_sf_irq_handler(int irq, void *devid)return IRQ_HANDLED ; } +static void cypress_sf_disable_regulators (void *arg) +{ +struct cypress_sf_data *touchkey = arg; + +regulator_bulk_disable (ARRAY_SIZE (touchkey->regulators), + touchkey->regulators); +} +static int cypress_sf_probe (struct i2c_client *client) {struct cypress_sf_data *touchkey;
@@ -121,6 +129,12 @@ static int cypress_sf_probe(struct i2c_client *client)return error; } + error =devm_add_action_or_reset (&client->dev, + cypress_sf_disable_regulators, + touchkey); +if (error) +return error; + touchkey->input_dev =devm_input_allocate_device (&client->dev);if (!touchkey->input_dev) {dev_err (&client->dev,"Failed to allocate input device\n" );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 164/225 ext4: fix bug_on in start_this_handle during umount filesystem
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
[ Upstream commit b98535d091795a79336f520b0708457aacf55c67 ]
We got issue as follows:
------------[ cut here ]------------ kernel BUG at fs/jbd2/transaction.c:389! invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 9 PID: 131 Comm: kworker/9:1 Not tainted 5.17.0-862.14.0.6.x86_64-00001-g23f87daf7d74-dirty #197 Workqueue: events flush_stashed_error_work RIP: 0010:start_this_handle+0x41c/0x1160 RSP: 0018:ffff888106b47c20 EFLAGS: 00010202 RAX: ffffed10251b8400 RBX: ffff888128dc204c RCX: ffffffffb52972ac RDX: 0000000000000200 RSI: 0000000000000004 RDI: ffff888128dc2050 RBP: 0000000000000039 R08: 0000000000000001 R09: ffffed10251b840a R10: ffff888128dc204f R11: ffffed10251b8409 R12: ffff888116d78000 R13: 0000000000000000 R14: dffffc0000000000 R15: ffff888128dc2000 FS: 0000000000000000(0000) GS:ffff88839d680000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000001620068 CR3: 0000000376c0e000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> jbd2__journal_start+0x38a/0x790 jbd2_journal_start+0x19/0x20 flush_stashed_error_work+0x110/0x2b3 process_one_work+0x688/0x1080 worker_thread+0x8b/0xc50 kthread+0x26f/0x310 ret_from_fork+0x22/0x30 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]---
Above issue may happen as follows:
umount read procfs error_workext4_put_super
flush_work(&sbi->s_error_work);
ext4_mb_seq_groups_show ext4_mb_load_buddy_gfp ext4_mb_init_group ext4_mb_init_cache ext4_read_block_bitmap_nowait ext4_validate_block_bitmap ext4_error ext4_handle_error schedule_work(&EXT4_SB(sb)->s_error_work);
ext4_unregister_sysfs(sb);
jbd2_journal_destroy(sbi->s_journal);
journal_kill_thread
journal->j_flags |= JBD2_UNMOUNT;flush_stashed_error_work jbd2_journal_start start_this_handle BUG_ON(journal->j_flags & JBD2_UNMOUNT);
To solve this issue, we call 'ext4_unregister_sysfs() before flushing s_error_work in ext4_put_super().
--- fs/ext4/super.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
fs/ext4/super.c +12 -7
@@ -1199,20 +1199,25 @@ static void ext4_put_super(struct super_block *sb)int aborted =0 ;int i, err; -ext4_unregister_li_request (sb); -ext4_quota_off_umount (sb); - -flush_work (&sbi->s_error_work); -destroy_workqueue (sbi->rsv_conversion_wq); -ext4_release_orphan_info (sb); -/* * Unregister sysfs before destroying jbd2 journal. * Since we could still access attr_journal_task attribute via sysfs * path which could have sbi->s_journal->j_task as NULL +* Unregister sysfs before flush sbi->s_error_work. +* Since user may read /proc/fs/ext4/xx/mb_groups during umount, If +* read metadata verify failed then will queue error work. +* flush_stashed_error_work will call start_this_handle may trigger +* BUG_ON. */ ext4_unregister_sysfs (sb); +ext4_unregister_li_request (sb); +ext4_quota_off_umount (sb); + +flush_work (&sbi->s_error_work); +destroy_workqueue (sbi->rsv_conversion_wq); +ext4_release_orphan_info (sb); +if (sbi->s_journal) { aborted =is_journal_aborted (sbi->s_journal); err =jbd2_journal_destroy (sbi->s_journal);
Signature · 1 line
2.35.1