summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
11 daysarm64: dts: imx8ulp-evk: Enable LPUART7Sherry Sun
The i.MX 8ULP EVK proto1B revision routes LPUART7 TX/RX to the FT4232 PortD connector (J25/J26 pins 2-3). Enable the port by default so the additional serial console is available out of the box. Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: imx8ulp-evk: Enable LPUART6 for BluetoothSherry Sun
Enable lpuart6 with RTS/CTS flow control on the i.MX 8ULP EVK board and add an NXP 88W8987 Bluetooth companion node to pair the UART transport with the wireless chip. i.MX8ULP 9X9 EVK use different lpuart6 pins which used for M.2 bluetooth, also use the sai6 instead of sai5 for PCM interface on M.2, so need to update the pin setting in dts. Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: imx8ulp-evk: Add gpio-keys node for power buttonPeng Fan
Add a gpio-keys node for the power-on button, report it as KEY_POWER to user space. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: imx8ulp: Add assigned clock properties for LPUART nodesPeng Fan
Add assigned-clocks, assigned-clock-parents and assigned-clock-rates properties to lpuart4 through lpuart7, so the LPUART input clock is configured automatically by the clock framework during probe. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: imx8ulp: Correct SRAM node address and size to cover full SSRAM P2Peng Fan
The SSRAM P2 partition starts at 0x22010000 with a size of 64 KB. The previous node only mapped the last 4 KB (0x2201f000, 0x1000) which was used for the SCMI shared memory buffer. Update the base address and size to cover the full P2 region so it can also serve as a general purpose SRAM pool. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: imx8ulp: Add I3C2 controller nodePeng Fan
Add the I3C2 (i3c-master@29360000) node to the imx8ulp device tree using the Silvaco I3C master IP. Configure PCC3-gated clock with SOSC DIV2 as parent at 24 MHz for pclk and fast_clk. slow_clk uses a dummy clock. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: imx8ulp: Add DMA channel properties and use eDMA flag macrosPeng Fan
Add DMA channel (dmas/dma-names) properties to peripheral nodes that were missing them: - LPI2C: lpi2c4, lpi2c5, lpi2c6, lpi2c7 - LPUART: lpuart4, lpuart5, lpuart6, lpuart7 - LPSPI: lpspi4, lpspi5 Also replace hardcoded numeric DMA direction flags with the proper FSL_EDMA_RX and FSL_EDMA_MULTI_FIFO macros for SAI (sai4, sai5, sai6, sai7) and SPDIF nodes. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysMerge tag 'erofs-for-7.2-rc6-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fixes from Gao Xiang: "Fix a regression in page cache sharing which can cause a NULL pointer dereference, and limit LZMA stream memory usage on systems with many CPUs. - Keep a valid f_path for page cache sharing to fix a recent mincore() NULL pointer dereference - Limit LZMA stream pool size when too many processors are available - Sync up with Hongbo Li's latest email address" * tag 'erofs-for-7.2-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: cap LZMA stream pool size erofs: ensure valid f_path for page cache sharing MAINTAINERS: update Hongbo Li's email address
11 daysARM: dts: BCM5301X: R8000 add NVRAM with MAC address for WAN portRosen Penev
The R8000 stores the WAN MAC address at a fixed offset in NVRAM. Define the NVRAM region and attach nvmem-cells to the WAN port so the MAC is assigned automatically by the DSA framework. Assisted-by: opencode:big-pickle Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://lore.kernel.org/r/20260725215634.9181-1-rosenp@gmail.com Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
11 daysARM: dts: BCM5301X: EA6300: fix USB3Rosen Penev
USB3 needs to have a GPIO pulled HIGH in order to function. Add vcc-gpio to do so. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://lore.kernel.org/r/20260725215809.9464-1-rosenp@gmail.com Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
11 daysPCI/pwrctrl: tc9563: Power off only the external ports in ↵Manivannan Sadhasivam
tc9563_pwrctrl_disable_port() TC9563 supports powering off only the external facing ports like DSP1 and DSP2. It is not recommended to power off USP and DSP3 as they have fixed ports/endpoint connected. Fix tc9563_pwrctrl_disable_port() to power off only DSP1 and DSP2. Fixes: 4c9c7be47310 ("PCI: pwrctrl: Add power control driver for TC9563") Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Alex Elder <elder@riscstar.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Link: https://patch.msgid.link/20260725-tc9563-fix-v1-3-ec4286e31331@oss.qualcomm.com
11 daysPCI/pwrctrl: tc9563: Fix parsing the integrated Ethernet MAC Endpoint nodeManivannan Sadhasivam
DSP3 has an integrated Ethernet MAC Endpoint which has its own set of config registers for configuring settings such as ASPM. The Endpoint device has two physical functions and those two functions share the same settings. Parse the Endpoint node under DSP3 instead of parsing both functions. The existing parsing logic also has one OOB issue as parsing both functions will result in accessing past the tc9563_pwrctrl->cfg array. Fixes: 4c9c7be47310 ("PCI: pwrctrl: Add power control driver for TC9563") Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Alex Elder <elder@riscstar.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Link: https://patch.msgid.link/20260725-tc9563-fix-v1-2-ec4286e31331@oss.qualcomm.com
11 daysarm64: dts: s32g: Add GPR syscon regionDan Carpenter
Add the GPR syscon region for the s32 chipset. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> [jkangas@redhat.com: GPR syscon resized from 0x3000 to 0x100] Signed-off-by: Jared Kangas <jkangas@redhat.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysdt-bindings: PCI: toshiba,tc9563: Restrict Tx Amplitude, DFE and N_FTS to ↵Manivannan Sadhasivam
USP, DSP1 and DSP2 TC9563 switch allows configuring Tx Amplitude, DFE and N_FTS settings only to USP, DSP1 and DSP2 ports. These settings don't apply to DSP3 or the integrated Ethernet MAC Endpoint. Restrict these properties and move 'toshiba,tx-amplitude-microvolt' to DSP2 in the example to conform to the binding. Fixes: 26f3ac884835 ("dt-bindings: PCI: Add binding for Toshiba TC9563 PCIe switch") Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Alex Elder <elder@riscstar.com> Link: https://patch.msgid.link/20260725-tc9563-fix-v1-1-ec4286e31331@oss.qualcomm.com
11 daysmmc: omap_hsmmc: use platform_get_irq_optional for wake IRQRosen Penev
Replace irq_of_parse_and_map() with platform_get_irq_optional() to get the wake IRQ. This is a more portable approach that works with both DT and non-DT platforms, and follows the modern platform API conventions for optional IRQ resources. The wake IRQ is now fetched earlier in the probe function alongside the main IRQ, and the -EPROBE_DEFER case is handled properly before the deferred probe can be triggered. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
11 daysmmc: via-sdmmc: cancel card-detect work on removeFan Wu
Disabling the device interrupt and freeing the IRQ prevents new card-detect work from being queued, but carddet_work already queued by the handler can still run after via_sd_remove() returns. via_sdc_card_detect() recovers the host through container_of() and dereferences its MMIO base; once remove() returns the host can be freed, so that work would touch freed memory. Cancel carddet_work after freeing the IRQ and before cancelling finish_bh_work, which the card-detect handler can also queue. carddet_work can re-enable the interrupt through via_reset_pcictrl(); mask it again afterwards. This issue was found by an in-house static analysis tool and confirmed by manual code review. Fixes: f0bf7f61b840 ("mmc: Add new via-sdmmc host controller driver") Cc: stable@vger.kernel.org Assisted-by: Codex:gpt-5.6 Signed-off-by: Fan Wu <fanwu01@zju.edu.cn> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
11 daysmmc: via-sdmmc: stop card-detect handling on probe failureFan Wu
request_irq() registers the SD card-detect interrupt and the probe enables it before mmc_add_host() runs. If mmc_add_host() fails, the error path only unmaps the registers and returns: the interrupt stays registered, so the handler keeps running against the host once it is freed. via_sdc_isr() dereferences sdhost and its MMIO base and schedules carddet_work, which via_sdc_card_detect() also runs against freed memory through its container_of() dereference. Add a probe-error path that disables and frees the interrupt and cancels carddet_work before unmapping. carddet_work can re-enable the device interrupt via via_reset_pcictrl(), which restores PCIINTCTRL, so mask it again after cancelling the work. This issue was found by an in-house static analysis tool and confirmed by manual code review. Fixes: e4e46fb61e3b ("mmc: via-sdmmc: fix return value check of mmc_add_host()") Cc: stable@vger.kernel.org Assisted-by: Codex:gpt-5.6 Signed-off-by: Fan Wu <fanwu01@zju.edu.cn> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
11 daysBluetooth: ISO: fix race of kfree vs kref_get_unless_zeroPauli Virtanen
hci_conn::iso_data is accessed and modified without lock or RCU. This leads to a race [Task hdev->workqueue] [Task 2] iso_recv iso_conn_put(conn) conn = LOAD hcon->iso_data iso_conn_free(conn) iso_conn_hold_unless_zero(conn) hcon->iso_data = NULL kfree(conn) kref_get_unless_zero(&conn->ref) /* UAF */ and also to races in iso_conn_add() vs. iso_conn_free(). Fix by adding spinlock hci_conn::proto_lock and using it to guard hci_conn::iso_data. Fixes: dc26097bdb86 ("Bluetooth: ISO: Use kref to track lifetime of iso_conn") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysBluetooth: ISO: fix refcounting of iso_connPauli Virtanen
iso_conn_del() and iso_chan_del() have a race that results to double-put of iso_conn: [Task hdev->workqueue] [Task 2] iso_conn_del iso_chan_del iso_conn_hold_unless_zero iso_conn_lock iso_conn_lock conn->sk = NULL iso_conn_unlock sk = iso_sock_hold(conn) <---------´ if (!sk) iso_conn_put iso_conn_put iso_conn_put /* UAF */ The extra put for !sk in iso_conn_del() is currently required since failing iso_chan_add() may leave iso_conn not associated with any sk. Fix by having iso_pi(sk)->conn own refcount when non-NULL, so iso_conn_del does not need to put it. Adjust the iso_conn_add() refcounting so that conn is put if it does not get associated with an sk. Fixes: dc26097bdb86 ("Bluetooth: ISO: Use kref to track lifetime of iso_conn") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysBluetooth: ISO: ensure no dangling hcon references in iso_connPauli Virtanen
After iso_conn_del(), ISO sockets should not dereference the hcon any more. Currently, clearing iso_conn::hcon relies on iso_conn_del() releasing the last reference to the iso_conn. Simplify this by explicitly clearing conn->hcon in iso_conn_del(), to avoid more complex reasoning on races about who holds the last reference. Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysBluetooth: ISO: avoid deadlocks in iso_sock_timeoutPauli Virtanen
iso_sock_timeout() takes lock_sock, so sync disabling the timer while holding that lock may deadlock. iso_sock_timeout() may also run concurrently with iso_conn_del(), which leads to UAF [Task 1] [Task hdev->workqueue] iso_sock_timeout iso_conn_del iso_conn_hold_unless_zero iso_chan_del `------------> iso_conn_put caller frees hcon iso_conn_put iso_conn_free conn->hcon->iso_data = NULL; /* UAF */ Fix the deadlock by removing the disable from the lock_sock sections. Move the timer from iso_conn to iso_pinfo to decouple it from iso_conn which may need to be freed in lock_sock section. Convert some of the clear_timer to disable_timer. Fixes: dc26097bdb86 ("Bluetooth: ISO: Use kref to track lifetime of iso_conn") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysBluetooth: ISO: fix leaking sk after socket releasePauli Virtanen
iso_sock_kill() tests !sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket || sock_flag(sk, SOCK_DEAD) for early return, but this is always true since sock_orphan(sk) sets SOCK_DEAD, so the sk reference released by socket always leaks, iso_sock_destruct is never called. The socket reference also leaks when __iso_sock_close() does not set SOCK_ZAPPED, since iso_conn_del() does not call iso_sock_kill() after zapping. Fix by replacing SOCK_DEAD by BT_SK_KILLED flag that is not used for something else, and lock_sock to ensure iso_sock_kill() puts sk only after socket release only once. Release and iso_conn_del may run concurrently. Call iso_sock_kill() from iso_conn_del() to clean sk up after zapping. Remove call to iso_sock_kill() from iso_sock_close(), as it's generally no-op there. Fixes: ccf74f2390d6 ("Bluetooth: Add BTPROTO_ISO socket type") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysMerge udf 32-bit i_lenExtents truncation fix.Jan Kara
11 daysBluetooth: ISO: hold sk properly in iso_conn_readyPauli Virtanen
sk deref in iso_conn_ready must be done either under conn->lock, or holding a refcount, to avoid concurrent close. conn->sk is currently accessed without either: [Task 1] [Task 2] iso_sock_release iso_conn_ready sk = conn->sk lock_sock(sk) conn->sk = NULL lock_sock(sk) release_sock(sk) iso_sock_kill(sk) UAF on sk deref Fix possible UAF by holding sk refcount in iso_conn_ready(). Also recheck after lock_sock that the socket is still valid. Adjust locking so conn->sk is cleared only under lock_sock. Fixes: 27c24fda62b60 ("Bluetooth: switch to lock_sock in SCO") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysBluetooth: ISO: validate sockaddr_iso first in iso_sock_rebind_bis()Pauli Virtanen
iso_sock_rebind_bis() updates socket iso_pi(sk)->bc_num_bis before validating the BIS values, so it's possible to end up with bc_num_bis inconsistent. Assign to iso_pi(sk)->bc_num_bis only after validation. Fixes: 80837140c1f2 ("Bluetooth: ISO: Allow binding a PA sync socket") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysBluetooth: ISO: fix timeout vs sync_timeout typo in check_bcast_qosPauli Virtanen
In iso.c check_bcast_qos(), missing bcast.timeout is not set to its default value, and appears typoed as bcast.sync_timeout. Fix the typo. Fixes: b37cab587aa3 ("Bluetooth: ISO: Don't reject BT_ISO_QOS if parameters are unset") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysBluetooth: ISO: lock sk in iso_connect_indPauli Virtanen
Accessing iso_pi(sk)->conn requires lock_sock, which is not taken in the "ev3" part of iso_connect_ind. It may also be NULL if socket has transitioned away from the LISTEN/CONNECT states before locking. Fix by adding lock/release. Recheck hcon is valid after lock acquire where needed. Fixes: 168d9bf9c7f0 ("Bluetooth: ISO: Reassemble PA data for bcast sink") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysBluetooth: ISO: lock sk in iso_sock_getnamePauli Virtanen
Accessing iso_pi(sk)->conn requires lock_sock, which is not held here. Fix by adding the lock/release. Fixes: 2df108c227b2 ("Bluetooth: ISO: Fix using BT_SK_PA_SYNC to detect BIS sockets") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysBluetooth: ISO: fix CONNECTED -> CLOSED transition on shutdown/releasePauli Virtanen
Commit e824c0bbe0ec ("Bluetooth: ISO: clear iso_data always when detaching conn from hcon") merged a version of the UAF fix that breaks releasing connected ISO sockets. Since hci_conn::iso_data is set to NULL, iso_chan_del() won't be called when the hci_conn disconnects, and the ISO socket does not emit POLLHUP correctly. Fix by retaining full hci_conn <-> iso_conn association while in BT_DISCONNECT state, so that local disconnect via shutdown() follows similar ISO socket code path as remote disconnect. Use a separate flag to track whether hci_conn_drop() is needed, instead of setting iso_conn::hcon = NULL In iso_sock_ready(), disallow disconnecting socket going BT_CONNECTED, in case hcon connects while its drop is pending. Fixes: e824c0bbe0ec ("Bluetooth: ISO: clear iso_data always when detaching conn from hcon") Fixes: fbdc4bc47268 ("Bluetooth: ISO: Use defer setup to separate PA sync and BIG sync") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
11 daysudf: Fix i_lenExtents truncation on 32-bit kernelsZhan Xusheng
In udf_do_extend_file() the total extent length is rounded up to a block boundary with: iinfo->i_lenExtents = (iinfo->i_lenExtents + sb->s_blocksize - 1) & ~(sb->s_blocksize - 1); i_lenExtents is a __u64, but sb->s_blocksize is unsigned long. On 32-bit kernels unsigned long is 32-bit, so ~(sb->s_blocksize - 1) is a 32-bit value (e.g. 0xfffff800 for a 2 KiB block) that is zero-extended in the AND, clearing the upper 32 bits of i_lenExtents. For UDF files whose total extent length exceeds 4 GiB this truncates i_lenExtents when the file is extended, corrupting the tracked extent length. Cast the block size to 64-bit before forming the mask. 64-bit kernels are unaffected. Fixes: 48d6d8ff7dca ("udf: cache struct udf_inode_info") Cc: stable@vger.kernel.org Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com> Link: https://patch.msgid.link/20260722082425.213311-1-zhanxusheng@xiaomi.com Signed-off-by: Jan Kara <jack@suse.cz>
11 daysarm64: dts: ls1088a: describe the Lynx 10G SerDes blocksIoana Ciornei
Describe the two Lynx 10G SerDes blocks and their associated lanes found on the LS1088A SoC. The nodes are left disabled at the SoC level; board DTs will enable them once there are consumers. Note that the SerDes block #2 is non-networking, meaning that it will not get probed by the Lynx10G SerDes PHY driver and it's only added for a complete hardware description. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: ls208xa: describe the Lynx 10G SerDes blocksVladimir Oltean
Describe the two Lynx 10G SerDes blocks and their associated lanes found on the LS208xA SoC. The nodes are left disabled at the SoC level; board DTs will enable them once there are consumers. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: ls1046a: describe the Lynx 10G SerDes blocksVladimir Oltean
Describe the two Lynx 10G SerDes blocks and their associated lanes found on the LS1046A SoC. The nodes are left disabled at the SoC level; board DTs will be expected to enable them once the consumer Ethernet nodes appear. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: ls1028a: describe the Lynx 10G SerDesVladimir Oltean
Describe the Lynx 10G SerDes block and its 4 SerDes lanes found on the LS1028A SoC. The node is left disabled at the SoC level; board DTs will be expected to enable it once the consumer Ethernet nodes use it. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: lx2162a: transition to device-specific SerDes compatible stringsIoana Ciornei
Align to the modern fsl,lynx-28g.yaml binding for the LX2162A SoC, where the SoC and SerDes instance is present in the compatible string, to allow reliable per-lane capability detection and per-lane customization of electrical properties. Since one of the major differences between LX2162A and LX2160A is the SerDes, add the necessary nodes to its own fsl-lx2162a-serdes.dtsi file. Also mark the serdes_1 node as disabled by default since any dts using it enables it explicitly now. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: lx2160a: transition to device-specific SerDes compatible stringsIoana Ciornei
Align to the modern fsl,lynx-28g.yaml binding, where the SoC and SerDes instance is present in the compatible string, to allow reliable per-lane capability detection and per-lane customization of electrical properties. The modern bindings are backward-incompatible with old kernels, due to the consumer phandles being either in one form or in another, as explained here: https://lore.kernel.org/lkml/20250930140735.mvo3jii7wgmzh2bs@skbuf/ Also mark the serdes_1 node as disabled by default since any dts using it enables it explicitly now. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: lx2160a: split the dtsi to avoid delete-propertyIoana Ciornei
Reorganize the LX216XA related dts/dtsi files with the intent to avoid any delete-property usage. Taken into consideration the differences between the LX2160A Rev1, LX2160A Rev2 and LX2162A SoCs, the following structure is created: fsl-lx216x.dtsi ---> fsl-lx2160a-rev1.dtsi (PCIe gen4, 3 SerDes blocks) (no PCIe, no SerDes) ---> fsl-lx2160a-rev2.dtsi (PCIe gen3, 3 SerDes blocks) ---> fsl-lx2162a.dtsi (PCIe gen3, 2 SerDes blocks) Each PCIe integration or SerDes block instantiation has its own dtsi file which gets to be included only by the necessary SoC level dtsi file. The dtsi file describing the PCIe controllers found on LX2160A Rev2 is also changed so that it does not work on a already defined node but rather it describes it entirely. In order to decouple the LX2162A from LX2160A, a new dtsi fsl-lx2162a-serdes.dtsi file is added which, for the moment, only duplicates the SerDes related nodes found already for LX2160A. Any dts which previously included fsl-lx2160a.dtsi now includes the -rev1 version and any dts which is clearly intended for LX2162A based board now includes the fsl-lx2162a.dtsi. No changes for the final dtbs. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: lx2160a: extract the PCIe from LX2160A Rev2 into a separate fileIoana Ciornei
The LX2160A Rev2 SoC changed the PCIe controllers used. This difference is reflected in the fsl-lx2160a-rev2.dtsi file which modifies the relevant dt nodes so that they match the actual HW. Extract these modifications into a separate dtsi file as a first step into a complete overhaul of the LX216xA related dts files with the intent to not use delete-node or delete-property. No final dtb changes are expected with this patch. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysPCI/AER: Support Advisory Non-Fatal ErrorsLukas Wunner
Per PCIe r7.0 sec 6.2.4.3, certain Non-Fatal Errors may be signaled using ERR_COR instead of ERR_NONFATAL. These "Advisory Non-Fatal Errors" are listed in sec 6.2.7 and explained in detail in sec 6.2.3.2.4. Advisory Non-Fatal Errors set bits in the Uncorrectable Error Status Register as well as one bit in the Correctable Error Status Register (Advisory Non-Fatal Error Status, bit 13). The latter is masked by default, hence these errors are currently not signaled at all (except on non-compliant products which choose to unmask the bit). Unmask Advisory Non-Fatal Errors on device enumeration. Some Non-Fatal Errors are always Advisory, others may be Advisory at the discretion of the detecting agent. If multiple errors occur, the agent may qualify a portion as non-Advisory and signal ERR_NONFATAL in addition to ERR_COR. In this case, there's no way to determine which Non-Fatal Error was Advisory. Assume none is to ensure that the Uncorrectable Error code path is taken to recover from the errors. Introduce aer_compute_anfe_status() to compute Advisory Non-Fatal Error bits from AER registers, based on this policy. Use it for Firmware First error handling in pci_print_aer(), which receives an AER register dump from the platform (UEFI r2.11 sec N.2.7). Introduce aer_get_anfe_status() to read AER registers from a device and feed them to aer_compute_anfe_status(). Use it for native error handling in aer_get_device_error_info(), which gathers registers from the device and caches the computed Advisory Non-Fatal Error bits in a new anfe_status field in struct aer_err_info. Regardless whether error handling is native or Firmware First, the AER driver needs to increment error counters, signal a trace event and log each error. When Advisory Non-Fatal Errors occur, these steps must be performed for Correctable Errors and for Uncorrectable Errors. Achieve this through a recursive invocation of aer_print_error() (for native error handling) and pci_print_aer() (for Firmware First error handling). The recursive invocation reports the (Advisory) Uncorrectable Errors after reporting the Correctable Errors. Note that the First Error Pointer and TLP Prefix Log is only meaningful for Uncorrectable Errors, but when Advisory Non-Fatal Errors occur, aer_get_device_error_info() has to populate the first_error and tlp_header_valid fields in struct aer_err_info for a Correctable Error. Avoid incorrectly logging those fields for Correctable Errors by amending __aer_print_error() and aer_print_error() with conditionals. Sample log output for an Advisory Unsupported Request Error: pcieport 0001:00:00.4: AER: Multiple Correctable Error messages received, first one from 0001:0e:00.0 idxd 0001:0e:00.0: PCIe Bus Error: severity=Correctable idxd 0001:0e:00.0: device [8086:1216] error status/mask=00002000/00000000 idxd 0001:0e:00.0: [13] NonFatalErr | | idxd 0001:0e:00.0: PCIe Bus Error: severity=Uncorrectable (Non-Fatal) idxd 0001:0e:00.0: device [8086:1216] error status/mask=00100000/00000000 idxd 0001:0e:00.0: [20] UnsupReq | Receiver | Transaction Layer (First) idxd 0001:0e:00.0: AER: TLP Header (Flit): 0x01000104 0x00000000 0x0000080e 0x0f800001 This commit takes inspiration (but differs significantly) from an earlier submission by Zhenzhong Duan, which in turn was based on a submission by Qingshun Wang: https://lore.kernel.org/r/20240620025857.206647-1-zhenzhong.duan@intel.com/ Prior attempts at supporting Advisory Non-Fatal Errors were submitted by Yicong Yang and Dio Sun: https://lore.kernel.org/r/1614689994-10925-1-git-send-email-yangyicong@hisilicon.com/ https://lore.kernel.org/r/BJXPR01MB0614C01A9523786117B1F1CBCEC8A@BJXPR01MB0614.CHNPR01.prod.partner.outlook.cn/ Signed-off-by: Lukas Wunner <lukas@wunner.de> [bhelgaas: fold in https://lore.kernel.org/all/amdnMg_J6T3Sys45@wunner.de] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://lore.kernel.org/r/20240620025857.206647-1-zhenzhong.duan@intel.com/ Link: https://lore.kernel.org/r/1614689994-10925-1-git-send-email-yangyicong@hisilicon.com/ Link: https://lore.kernel.org/r/BJXPR01MB0614C01A9523786117B1F1CBCEC8A@BJXPR01MB0614.CHNPR01.prod.partner.outlook.cn/ Link: https://patch.msgid.link/1b62915ffe06ee5b08e846531c42392e5f244337.1784905909.git.lukas@wunner.de
11 daysMerge tag 'pinctrl-v7.2-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "The most interesting commit is the S4 fix for AMD, which probably is helpful to a whole bunch of important machines. - Wakeup nits on the Qualcomm SC8280XP - Double-free issues on the device tree parsing error path - Fixup of the S4 sleep state handling on AMD pin control - Missing Kconfig select REGMAP_MMIO for the Microchip driver leading to compile stalls - Missing Kconfig select GENERIC_PINCONF for the Bitmain BM1880 leading to compile stalls" * tag 'pinctrl-v7.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: bm1880: add missing select GENERIC_PINCONF pinctrl-amd: Don't clear S4 wake bits at probe pinctrl: microchip-sgpio: add missing select REGMAP_MMIO pinctrl: devicetree: don't free uninitialized dev_name on error path pinctrl: qcom: sc8280xp: Add missing wakeup entries for GPIO143/151 pinctrl: qcom: Unconditionally mark gpio as wakeup enable
11 daysarm64: dts: lx2160a: extract the SerDes nodes into a separate dtsiIoana Ciornei
In terms of its SerDes blocks, the LX2162A is not properly described since it just inherits the LX2160A SerDes nodes, which is not correct. In order to fix this but also avoid the usage of delete-node, extract the SerDes nodes currently found in fsl-lx2160a.dtsi into a separate dtsi. No any actual changes in the final dtb files, only a dt node move. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: lx2160a: extract the PCIe nodes into a separate dtsiIoana Ciornei
One of the major differences between LX2160A Rev1 and Rev2 is the PCIe controller used. With the final goal of removing any usage of delete-node or delete-property from the current LX2160A related dts files, move the PCIe nodes found on the LX2160A Rev1 into a separate dtsi file. This will make it easier to include the appropriate dtsi file describing the PCIe controller depending on the SoC revision in a follow-up patch. No actual change in the DT nodes found in the final DTBs is intended. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysarm64: dts: lx2160a: explicitly enable serdes_1 nodeIoana Ciornei
Explicitly enable the serdes_1 node in all board DT files. This is needed in order to be able to change the default status of the node to "disabled" from the SoC DT file. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
11 daysdrm/vmwgfx: validate external BO copy bounds for both stride pathsZack Rusin
vmw_external_bo_copy() trusts caller-supplied offsets, strides, and heights and operates on imported dma-buf vmaps: - The equal-stride memcpy() bound was clamped after subtracting the offsets from dst_size and src_size; an offset larger than the BO size wraps the unsigned subtraction to a huge value and the resulting memcpy() runs off the end of the vmap. dst_stride * height is also a u32 multiplication that can overflow. - The non-equal-stride row-by-row path had no bound at all. The loop touches bytes through offset + (height - 1) * stride + width_in_bytes, with only a WARN_ON(dst_stride < width_in_bytes), and could likewise step past the end of either mapping. The offsets and strides are derived from STDU/SOU plane state, so a configured CRTC submitting a crafted atomic commit on an imported framebuffer can reach this path. Validate the exact row-copy endpoint against each BO's size up front using check_mul_overflow() and check_add_overflow(). Use the bulk memcpy() path only when width_in_bytes covers the whole stride; otherwise copy one row at a time so partial-row updates near the bottom of a framebuffer remain valid. Also reject zero strides and stride < width_in_bytes, both of which the row-by-row path cannot represent safely. Fixes: 50f119925091 ("drm/vmwgfx: Fix prime with external buffers") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4.7 Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Ian Forbes <ian.forbes@broadcom.com> Link: https://patch.msgid.link/20260505222728.519626-13-zack.rusin@broadcom.com
11 daysdrm/vmwgfx: use check_add_overflow for shader size+offset boundZack Rusin
vmw_shader_define() validates the user-supplied shader window against its backing buffer with (u64)buffer->tbo.base.size < (u64)size + (u64)offset drm_vmw_shader_create_arg::offset is __u64 in the uapi; when it is near U64_MAX the unsigned addition wraps and the resulting tiny value passes the check. The unbounded offset is then stored in res->guest_memory_offset and forwarded to host SVGA shader-create commands. Use check_add_overflow() to detect the wrap and compare the resulting endpoint against the buffer size. Fixes: 668b206601c5 ("drm/vmwgfx: Stop using raw ttm_buffer_object's") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4.7 Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Ian Forbes <ian.forbes@broadcom.com> Link: https://patch.msgid.link/20260505222728.519626-12-zack.rusin@broadcom.com
11 daysdrm/vmwgfx: skip hash_del_rcu when validation context has no hash tableZack Rusin
vmw_validation_add_resource() calls hash_add_rcu() only when ctx->sw_context is non-NULL, but the doomed-resource error path calls hash_del_rcu() unconditionally. The validation contexts declared with DECLARE_VAL_CONTEXT(_, NULL, 0) in vmwgfx_kms.c, vmwgfx_scrn.c, vmwgfx_stdu.c and vmwgfx_execbuf.c consequently reach a delete for a node that was never added to any hash chain. That is harmless today, but only incidentally so. hash_del_rcu() is hlist_del_init_rcu(), which is guarded by hlist_unhashed(), and vmw_validation_mem_alloc() hands out memory from __GFP_ZERO pages that are never recycled within a context's lifetime, so node->hash.head.pprev is always NULL and the delete does nothing. Neither property is apparent at the call site, and the asymmetry with the add side invites a real bug the first time either one changes. Mirror the condition from the add side so the node is only unlinked when it was actually linked. No functional change. Assisted-by: Claude:claude-opus-4.7 Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Ian Forbes <ian.forbes@broadcom.com> Link: https://patch.msgid.link/20260505222728.519626-11-zack.rusin@broadcom.com
11 daysdrm/vmwgfx: enforce cursor size limits for MOB cursorsZack Rusin
vmw_cursor_plane_atomic_check() bounds cursor width and height only on the legacy update path; the SVGA_CAP2_CURSOR_MOB path -- the default on modern hosts -- accepts any size. When the requested size exceeds SVGA_REG_CURSOR_MAX_DIMENSION or SVGA_REG_MOB_MAX_SIZE, vmw_cursor_mob_get() returns -EINVAL and leaves vps->cursor.mob NULL. Its return value is then discarded in vmw_cursor_plane_prepare_fb(), so the subsequent vmw_cursor_update_mob() calls vmw_bo_map_and_cache(NULL) and oopses inside vmw_bo_map_and_cache_size() on the tbo.base.size load. Reachable from any DRM master via DRM_IOCTL_MODE_CURSOR2 with a sufficiently large width or height (e.g. cursor_max_dim + 1). Reject oversized cursors in atomic_check for both MOB-backed cursor update types. The MOB byte-size limit only applies to the SVGA_CAP2_CURSOR_MOB path (vmw_cursor_mob_size() returns 0 for GB_ONLY); compute the required MOB size in 64-bit to avoid overflow when very large dimensions are requested. In prepare_fb only call vmw_cursor_mob_get()/_map() for VMW_CURSOR_UPDATE_MOB -- the GB_ONLY path uses bo->map.virtual directly and would otherwise be silently downgraded to NONE on hosts without SVGA_CAP2_CURSOR_MOB (where vmw_cursor_mob_get() always returns -EINVAL). Degrade the update to NONE if vmw_cursor_mob_get() or vmw_cursor_mob_map() fails so the update path does not run with a NULL backing MOB. Fixes: 965544150d1c ("drm/vmwgfx: Refactor cursor handling") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4.7 Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Ian Forbes <ian.forbes@broadcom.com> Link: https://patch.msgid.link/20260505222728.519626-10-zack.rusin@broadcom.com
11 daysdrm/vmwgfx: avoid destroy_workqueue(NULL) on vkms init failureZack Rusin
Two paths through vmw_vkms_init() can leave vmw->crc_workq NULL while still leaving the rest of the driver in a state that calls vmw_vkms_cleanup() at module unload: 1. vmw_host_get_guestinfo(GUESTINFO_VBLANK, ...) failing or returning an oversized buffer -- the common case on hosts without a VBLANK guestinfo entry -- early-returned before the workqueue allocation. 2. alloc_ordered_workqueue() returning NULL on memory pressure. vmw_vkms_cleanup() then calls destroy_workqueue(NULL), which dereferences wq->name and panics. Fix the first case by removing the early return: vmw->vkms_enabled is already false on the rpci-failure path so no work will ever be queued, and allocating the workqueue unconditionally keeps the control flow simple. Fix the second case by guarding the cleanup with a NULL check, since alloc_ordered_workqueue() can still fail under low memory. Fixes: 7b0062036c3b ("drm/vmwgfx: Implement virtual crc generation") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4.7 Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Ian Forbes <ian.forbes@broadcom.com> Link: https://patch.msgid.link/20260505222728.519626-9-zack.rusin@broadcom.com
11 daysdrm/vmwgfx: bound DMA command body size against suffix pointerZack Rusin
vmw_cmd_dma() locates the DMA suffix at (unsigned long) &cmd->body + header->size - sizeof(*suffix) without checking that header->size is large enough to contain both cmd->body and the suffix. An undersized header makes the suffix pointer underflow back into the previous command in the bounce buffer. The verifier later writes suffix->maximumOffset, clobbering verified fields of an already-relocated earlier command -- a TOCTOU on the device-visible command stream that lets one command rewrite another's GMR id, surface id, or other authenticated fields. Reject the command if the body is too small for the suffix to fit. Fixes: 4e4ddd477743 ("drm/vmwgfx: Fix queries if no dma buffer thrashing is occuring.") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4.7 Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Ian Forbes <ian.forbes@broadcom.com> Link: https://patch.msgid.link/20260505222728.519626-8-zack.rusin@broadcom.com
11 daysdrm/vmwgfx: validate DRAW_PRIMITIVES header size before divisionZack Rusin
vmw_cmd_draw() computes maxnum = (header->size - sizeof(cmd->body)) / sizeof(*decl); where header->size is u32 and is taken straight from the user-supplied command stream. When header->size is less than sizeof(cmd->body) the unsigned subtraction wraps to nearly 4 GiB, producing a huge maxnum. Any user-controlled cmd->body.numVertexDecls then passes the bound and the loop dereferences decl[i] far past the end of the kernel command bounce buffer, producing an out-of-bounds read of kernel memory. Reject undersized headers up front. Fixes: 7a73ba7469cb ("drm/vmwgfx: Use TTM handles instead of SIDs as user-space surface handles.") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4.7 Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Ian Forbes <ian.forbes@broadcom.com> Link: https://patch.msgid.link/20260505222728.519626-7-zack.rusin@broadcom.com