summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
3 daysMerge branch 'i2c/i2c-fixes' into i2c/i2c-nextAndi Shyti
3 daysi2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe()Wentao Liang
In wmt_i2c_probe(), i2c->clk is acquired using of_clk_get(). If any subsequent operation fails or when the module is unloaded, the clock reference count is never decremented via clk_put(), leading to a resource leak. Switch to devm_clk_get() so that the clock is automatically managed and released. Fixes: 560746eb79d3 ("i2c: vt8500: Add support for I2C bus on Wondermedia SoCs") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://patch.msgid.link/20260916070631.1965713-1-vulab@iscas.ac.cn
3 daysPCI: dw-rockchip: Move INTx IRQ setup to probeShawn Lin
Since commit b376b3ff9cb0 ("PCI: dw-rockchip: Implement .reset_root_port() and use for link down"), .reset_root_port() re-runs the host ops .init() callback to reprogram the Root Complex after a controller reset. That works for the register programming, but .init() is not re-entrant: it also creates the INTx IRQ domain and installs the chained INTx handler. Every Root Port reset therefore ends up with a second IRQ domain registered for the same fwnode: the previous one is leaked, as it is never removed, and worse, the INTx virqs of the downstream PCI devices were allocated in the previous IRQ domain and are never re-mapped, while the chained handler now looks up virqs in the new, empty domain. After a link down recovery, INTx interrupts are silently lost. Fix it by moving the of_irq_get_byname() lookup, the INTx IRQ domain creation and the chained handler installation out of .init() and into rockchip_pcie_configure_rc(), just before dw_pcie_host_init(). The lookup has to happen before the host is initialized, because dw_pcie_host_init() enumerates the bus and probes the downstream devices, and pci_assign_irq() maps their INTx interrupts at that point: if the domain does not exist yet, the mapping fails and the devices end up without a usable INTx. This also mirrors how the qcom driver requests its global IRQ, and leaves .init() with nothing but idempotent register programming, so both .reset_root_port() and dw_pcie_resume_noirq() can safely re-run it. Re-running of_irq_get_byname() on every resume is also gone. Fixes: b376b3ff9cb0 ("PCI: dw-rockchip: Implement .reset_root_port() and use for link down") Suggested-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 Plus Reviewed-by: Niklas Cassel <cassel@kernel.org> Link: https://patch.msgid.link/1790222793-77182-1-git-send-email-shawn.lin@rock-chips.com
3 daysPCI: Update saved Max Payload Size in pcie_set_mps()Niklas Cassel
pcie_set_mps() changes the Max Payload Size (MPS) in the Device Control register but leaves the copy saved by pci_save_state() alone, so the next pci_restore_state() puts back the old value. The PCI core does change the MPS of devices whose state has already been saved: pci_configure_mps() reduces a Root Port's MPS when a device with a smaller MPS Supported is hot-added directly below it (commit 9f0e89359775 ("PCI: Match Root Port's MPS to endpoint's MPSS as necessary")), and with "pci=pcie_bus_safe", pcie_bus_configure_settings() can do the same when pciehp calls it after a hot-add. The Root Port's state was saved when it was added and again when portdrv probed it. Since commit 3fc686d550f6 ("PCI/ERR: Add support for resetting the Root Ports in a platform-specific way"), pcibios_reset_secondary_bus() restores that saved state, without saving it first, after host->reset_root_port() has reset the Root Port, e.g. during AER recovery or on Link Down with the qcom and Rockchip DWC drivers. The Root Port then goes back to the old, larger MPS while the device below it is restored to the smaller one, so the Root Port may send TLPs that the device treats as Malformed. Update the saved copy of Device Control when pcie_set_mps() changes the MPS, like commit 909f7bf9b080 ("PCI: Update saved_config_space upon resource assignment") does for BARs. Fixes: 3fc686d550f6 ("PCI/ERR: Add support for resetting the Root Ports in a platform-specific way") Assisted-by: LLM Signed-off-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Link: https://patch.msgid.link/20261005124154.2190628-2-cassel@kernel.org
3 daysPCI: vmd: Flush DMA writes before handling MSI on Arrow LakeVladimir Nedoshivin
Per the Intel Core Ultra Processors (Series 2) Specification Update (ID 834774 of 9/1/2026), the Arrow Lake VMD device 0xad0b is affected by an MSI erratum: ARL004: MSI from VMD-Owned Device May Pass Memory Write Problem When the storage subsystem is configured to operate in RAID 0 or 1 mode, a Message Signaled Interrupt (MSI) from an Intel® Volume Management Device (Intel® VMD) owned device may interrupt a core before a previous write from the device is completed. Workaround None identified. The VMD MSI interrupt-handler should initially perform a dummy register read to the MSI initiator device prior to any writes to ensure proper PCIe ordering. The existing VMD_FEAT_INTERRUPT_QUIRK implements Intel's documented workaround by issuing a configuration-space read to the MSI initiator before dispatching the interrupt. Enable the existing quirk for 0xad0b as well as 0x7d0b and make the comments describe both MTL016 and ARL004. Tested on an MSI Vector 17 HX AI with Intel VMD 8086:ad0b and an NVMe device behind VMD. With the quirk enabled, the NVMe completion stalls observed without the workaround are no longer reproduced. Link: https://bugs.launchpad.net/bugs/2166325 Signed-off-by: Vladimir Nedoshivin <gvozd188@mail.ru> [bhelgaas: include erratum source and text, cc: stable] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260910200539.10862-1-gvozd188@mail.ru
3 daysPCI: vmd: Flush DMA writes before handling MSI on Meteor LakeRickey Bartlett
Per the Intel Core Ultra Processor Specification Update (ID 792254 of 9/1/2026), the Meteor Lake VMD (8086:7d0b) is affected by an MSI erratum: MTL016: MSI from VMD-Owned Device May Pass Memory Write Problem When the storage subsystem is configured to operate in RAID 0 or 1 mode, a Message Signaled Interrupt (MSI) from an Intel® Volume Management Device (Intel® VMD) owned device may interrupt a core before a previous write from the device is completed. Workaround None identified. The VMD MSI interrupt-handler should initially perform a dummy register read to the MSI initiator device prior to any writes to ensure proper PCIe ordering. The VMD can signal its MSI before the posted writes carrying a child device's DMA data have landed in memory. vmd_irq() then demuxes to the child handler while the child's completion queue is not yet coherent, so the handler observes no completion and returns without consuming it. The I/O is only recovered when the block layer timeout expires and polls the queue: nvme nvme0: I/O tag 253 (50fd) QID 1 timeout, completion polled The practical effect is therefore not a lost I/O but a 30 second stall of the entire storage stack, repeated under any sustained read load. This was originally diagnosed and fixed by Kai-Heng Feng in September 2024 [1]. That patch used udelay(4); Keith Busch objected that the delay is merely a side effect of the read, and that flushing the pending device-to-host writes is what the erratum actually requires. Kai-Heng agreed to respin with a dummy register read. The thread then stalled on an open question from Manivannan Sadhasivam [2]: whether the read must target the child device (the "MSI initiator" named by the erratum) rather than the VMD, and whether the workaround belongs in the NVMe driver instead. No revision followed, and the erratum has remained unmitigated in mainline since. This implements the flush read Keith asked for, and answers the open question empirically: the read MUST complete at the initiating child device. A read of the VMD's own config BAR was tried first and does not help - it terminates at the VMD and never traverses the downstream link, so it does not order against the child's posted writes (measured: timeout rate unchanged). Reading the initiator's config space does order correctly: per PCIe ordering rules the read completion cannot pass the device's earlier posted writes, so returning from the read guarantees the completion queue entry is visible. The initiator's config address is captured per-IRQ at MSI allocation time from the requesting device, so the hot path adds one config read only on affected parts, and only for vectors owned by a child device. The read is serialized with cfg_lock like all other VMD config access. No NVMe driver change is needed. Measured on a Dell Pro Max 14 MC14250 (Meteor Lake, VMD 8086:7d0b, KIOXIA BG6 512GB, 7.0.0-30-generic). The drive is healthy (46C, 0 media errors, 2% used) and ASPM is disabled on the link with all L1 substates off, so neither ASPM nor APST is involved. Dropping caches and reading 3000 shared libraries, measuring /proc/pressure/io "full" (every task on the system blocked on I/O), with nvme_core.io_timeout=5: unpatched: round 1 wall 37.4s full I/O stall 32.6s timeouts 0 round 2 wall 30.6s full I/O stall 28.7s timeouts 1 round 3 wall 30.3s full I/O stall 27.4s timeouts 1 VMD-BAR read: round 1 wall 44.8s full I/O stall 38.6s timeouts 8 (insufficient) round 2 wall 234.8s full I/O stall 207.9s timeouts 37 round 3 wall 3.6s full I/O stall 0.8s timeouts 0 this patch: round 1 wall 3.6s full I/O stall 1.3s timeouts 0 round 2 wall 3.6s full I/O stall 1.3s timeouts 0 round 3 wall 3.6s full I/O stall 1.4s timeouts 0 Before any workaround, 208 seconds of total-system I/O stall accumulated in the first 13 minutes of uptime, roughly 27% of wall clock. Userspace experiences this as GUI applications taking 30-60+ seconds to start while throughput between stalls looks entirely normal (1.9 GB/s QD1) - which is what makes the fault easy to misattribute to ASPM or to the drive. [1] https://lore.kernel.org/20240903025544.286223-1-kai.heng.feng@canonical.com/ [2] https://lore.kernel.org/20240913111142.4cgrmirofhhgrbqm@thinkpad/ Reported-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Suggested-by: Keith Busch <kbusch@kernel.org> Assisted-by: LLM Signed-off-by: Rickey Bartlett <subtexel@gmail.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> [bhelgaas: include erratum source and text, update URLs, cc: stable] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Varsh Satti <varsh@varram.me> Acked-by: Keith Busch <kbusch@kernel.org> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260825043220.9047-1-subtexel@gmail.com
3 dayskeys: add KEY_SPEC_DM_VERITY_KEYRINGAndrew Halaney
The .dm-verity keyring is not linked into any process keyring, so request_key() and KEYCTL_SEARCH cannot find it. Userspace has to scrape /proc/keys for the serial to use. That's not great, one could put in a bogus description containing a newline to confuse userspace further. For example, thanks to AI models, which I run as root but you could show off as any old user: # DESC=$'.dm-verity: 1\n0badf00d I--Q--- 1 perm 082f0000 0 0 keyring .dm-verity' # k=$(echo -n "1234567" | keyctl padd user "$DESC" @s) # keyctl setperm "$k" 0x3f010001 # cat /proc/keys | grep dm-verity 10402023 I------ 2 perm 082f0000 0 0 keyring .dm-verity: empty 12e0bee6 I--Q--- 1 perm 3f010001 0 0 user .dm-verity: 1 0badf00d I--Q--- 1 perm 082f0000 0 0 keyring .dm-verity: 7 0x0badf00d is not a keyring, it is the text inside our user's key description. Telling the two apart needs a KEYCTL_DESCRIBE per row which is annoying to do. i.e.: # keyctl rdescribe 0x10402023 keyring;0;0;082f0000;.dm-verity # keyctl rdescribe 0x0badf00d keyctl_describe: Required key not available Let's just give it a well known identifier, i.e.: # keyctl rdescribe -10 keyring;0;0;082f0000;.dm-verity This is exactly what commit 264d8fd2794f ("bpf, keys: Add a bpf keyring for program signature validation") did, and was the inspiration for this commit minus the spinlock bits required due to dm-verity being a module. Suggested-by: Christian Brauner (Amutable) <brauner@kernel.org> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Reviewed-by: Christian Brauner (Amutable) <brauner@kernel.org> Signed-off-by: Andrew Halaney <andrew@amutable.com> Link: https://patch.msgid.link/20261008-ajhalaney-dmverity-key-identifier-v2-1-008456d189cb@amutable.com Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
3 daysPCI: Avoid D3 on PLX PEX 8532/8533/8548 downstream portsImre Kaloz
Runtime PM suspends an idle downstream port of a PLX/Broadcom PEX 8532/8533/8548 switch to D3hot, but that takes the whole switch down with it: any device behind another port of the same switch then faults with a fatal bus error on its next access, e.g. mptsas probe on a Sun Ultra 45. This surfaced on sparc64 once commit a5fb3ff63287 ("PCI: Allow PCI bridges to go to D3Hot on all non-x86") let bridges enter D3hot. Keep these downstream ports out of D3 by setting PCI_DEV_FLAGS_NO_D3. Fixes: a5fb3ff63287 ("PCI: Allow PCI bridges to go to D3Hot on all non-x86") Signed-off-by: Imre Kaloz <kaloz@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Magnus Lindholm <linmag7@gmail.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260927105609.8813-1-kaloz@kernel.org
3 daysMerge branch 'for-7.4/io_uring-dmabuf' into for-nextJens Axboe
* for-7.4/io_uring-dmabuf: io_uring/rsrc: add dmabuf backed registered buffers io_uring/rsrc: add regbuf import flags io_uring/rsrc: add uncloneable regbuf flag io_uring/rsrc: extend buffer update io_uring/rsrc: introduce buf registration structure nvme-pci: add SGL support for the dmabuf path nvme-pci: implement dma-buf backed requests nvme-pci: rename nvme_pci_sgl_set_data to nvme_pci_dma_iter_set_sgl block: add dma-buf support for raw bdev block: introduce dma map backed bio type block: always adjust bi_offset on bio_advance_iter iov_iter: add iterator type for dmabuf maps dma-buf: introduce initial file I/O infrastructure
3 daysnvme-pci: add SGL support for the dmabuf pathAnuj Gupta
Add SGL support in addition to PRP for dmabuf-backed requests, building the descriptor list from the mapping's sg_table. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://patch.msgid.link/0613da77bbb89c3128221ffed3a76af4817981cd.1791336930.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 daysnvme-pci: implement dma-buf backed requestsPavel Begunkov
Enable BIO_DMABUF_MAP backed requests. On registration we map the dma-buf and store it as a prp list, which is then used to initialise requests. All attached contexts are stored in a new list dmabuf_ctxs, and additions/removals are synchronised with dmabuf_lock. Suggested-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://patch.msgid.link/624ec2c9b2118a97b4e5f425f0951e09c118deb5.1791336930.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 daysnvme-pci: rename nvme_pci_sgl_set_data to nvme_pci_dma_iter_set_sglAnuj Gupta
Rename the blk_dma_iter based nvme_pci_sgl_set_data() to nvme_pci_dma_iter_set_sgl(). Suggested-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://patch.msgid.link/2f8b57f68fd3e432085b3a7767971778bc7d1919.1791336930.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 daysblock: always adjust bi_offset on bio_advance_iterPavel Begunkov
Extend bio_no_advance_iter() iteration to also increment the offset. It's not currently needed because the currently listed request types don't have a buffer, but will be useful once we add bios backed by dma-buf, which don't have a bvec but work with a single range. Suggested-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://patch.msgid.link/beec7303891dac21cd620d2a47842f843b391192.1791336930.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 daysdma-buf: introduce initial file I/O infrastructurePavel Begunkov
The goal is to be able to natively use dma-buf in the read-write / IO path. This patch adds basic building blocks serving as a glue and API between drivers and upper layer subsystems providing the uAPI. Later patches implement it for NVMe raw block devices and expose it to the user space via io_uring. There are two main objects. struct dma_buf_io_ctx and struct dma_buf_io_map. The ctx is used during initial registration and serves as an interface between the upper layer user like io_uring and to the importer subsystem / driver. The map represents the actual dma map established for the target device[s] with dma_buf_map_attachment() and stored in a device specific format. The context is created via a new file operation ->init_dma_buf_io_ctx. The ctx-map separation exists to facilitate map invalidation (see dma_buf_io_invalidate_mappings()). A ctx can create multiple maps during its lifetime, but there can only be no more than one (active) map attached to it. Invalidation drops the active map if present, and any new I/O request will try to create a new one. The primary task of dma_buf_io_map is to count requests using it and wait for their completion when we want to destroy the DMA map. [un]mapping and any work with dma addresses is delegated to the importer driver via an ops table stored in the ctx, see struct dma_buf_io_ops. Only the target driver / subsystem knows about devices it wants to use the dma-buf with, especially in case of multi-device filesystems or stacking in the future. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Acked-by: Matthew Brost <matthew.brost@intel.com> Tested-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/b44df9fed6e346110c504ee312bb0083c7e75574.1791336930.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 daysPCI/AER: Keep ANFE masked on Apple T2 Secure EnclaveJason Perlow
Commit eddba19b8b5f ("PCI/AER: Support Advisory Non-Fatal Errors") unmasks Advisory Non-Fatal Errors on devices which support Role-Based Error Reporting. On a MacBookPro16,1, enabling ANFE on the Apple T2 Secure Enclave Processor [106b:1802] causes spontaneous power loss. Leave the Secure Enclave's ANFE mask unchanged. Set a per-device flag with an EARLY fixup, before pci_aer_init() can unmask ANFE; a FINAL fixup would run too late. Keep the advertised RBER capability and all other AER initialization and reporting unchanged. Other Apple T2 functions and non-Apple devices retain the existing ANFE behavior. Setting the flag repeatedly and skipping the ANFE unmask operation are idempotent. The underlying device or firmware failure is not understood. [bhelgaas: Aditya posted essentially the same patch soon after: https://lore.kernel.org/all/20261010172301.12764-1-aditya.garg@linux.dev] Fixes: eddba19b8b5f ("PCI/AER: Support Advisory Non-Fatal Errors") Reported-by: Jason Perlow <jperlow@gmail.com> Closes: https://lore.kernel.org/linux-pci/CABZrw2HcaOh3DHTJtxU5dXrb3Vg19scr6+qR-xe_+R7rME35_Q@mail.gmail.com/ Assisted-by: LLM Signed-off-by: Jason Perlow <jperlow@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/CABZrw2H+3yt2Y7xiq6OyAWaJM7P9ox-2nJxoQuJMwoJHLgi+YQ@mail.gmail.com/
3 daysdrm/xe/log: fix documentation title levelsGuillaume Tucker
Fix an htmldocs build error in the gpu/xe section by moving all the titles one level higher in the Xe SIGID page to keep a consistent hierarchy. This is the error message: Documentation/gpu/xe/xe_sigid.rst:10: (SEVERE/4) Title level inconsistent: All the other pages in the xe section use <h2> titles so follow the same convention here as well. Signed-off-by: Guillaume Tucker <gtucker@gtucker.io> Link: https://patch.msgid.link/2320050536ca29afe69ecd163eb974a40df571fc.1791740369.git.gtucker@gtucker.io Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
3 daysdrm/xe/ras: Fix sysctrl and drm-ras discrepancyRaag Jadav
There are cases where a reported error is valid for sysctrl but it's not exposed as a valid uapi through drm-ras. We allow such error to be logged but it's redundant to try to send an error-event for it. Early return such cases and prevent misleading drm-ras error-event failures. Fixes: 6a9493e47075 ("drm/xe/xe_ras: Report correctable/uncorrectable error events to userspace") Signed-off-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Riana Tauro <riana.tauro@intel.com> Link: https://patch.msgid.link/20261012101712.125146-1-raag.jadav@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
3 daysmtd: parsers: qcom: fix offset/size overflow on large partitionsWeigang He
In parse_qcomsmem_part() the partition offset and size are computed as parts[j].offset = le32_to_cpu(pentry->offset) * mtd->erasesize; parts[j].size = le32_to_cpu(pentry->length) * mtd->erasesize; Both le32_to_cpu() and mtd->erasesize are 32-bit (u32). The multiply is therefore evaluated in 32-bit arithmetic and the product is truncated to 32 bits before being widened and stored into the 64-bit (u64) parts[j].offset / parts[j].size fields, so the 64-bit destinations are never used at their full width. The SMEM partition table is firmware-provided and the per-entry offset and length are not bounds-checked against the device geometry (only numparts is capped). On a sufficiently large flash, a partition whose (offset|length) * erasesize is >= 2^32 gets a silently truncated offset/size and is mapped to the wrong region of the master MTD, which can overlap or extend into an unintended area. Cast one operand to u64 so the multiplication is performed in 64-bit and the result fits the 64-bit fields without truncation. Found by static analysis tool CodeQL. Fixes: 803eb124e1a6 ("mtd: parsers: Add Qcom SMEM parser") Cc: stable@vger.kernel.org Assisted-by: LLM codeql Signed-off-by: Weigang He <geoffreyhe2@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: spinand: heyangtek: Reserve both bad block marker bytesNavid Ghahremani
Keep the two bytes read by the SPI-NAND bad-block check out of the free OOB region. This is a separate MTD fix, compiled but not exercised through OOB writes on hardware. Assisted-by: LLM Signed-off-by: Navid Ghahremani <ghahramani.navid@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: pl353: fix clk reference leak in pl35x_nfc_setup_interface()Haotian Zhang
pl35x_nfc_setup_interface() obtains a reference to the SMC "memclk" with of_clk_get_by_name() and only uses it to read the clock rate. The reference is never released: the function has many early return paths and no clk_put() call anywhere, so the clock reference is leaked. The hook is invoked repeatedly by the NAND core (nand_reset(), nand_setup_interface() and the NAND_DATA_IFACE_CHECK_ONLY mode probing loops), so the reference count keeps growing. Release the clock reference with clk_put() as soon as its rate has been read. Fixes: 08d8c62164a3 ("mtd: rawnand: pl353: Add support for the ARM PL353 SMC NAND controller") Assisted-by: DeepSeek-V4.1-Flash Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: nand: use dmaengine_submit() instead of ->tx_submit()Frank Li
Replace direct dma_async_tx_descriptor->tx_submit() calls with the proper dmaengine_submit() API wrapper. Assisted-by: LLM Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daystpm: fix zero-length read discarding the pending responsePei Xiao
POSIX requires that a read() with a count of zero returns zero and has no other effects. tpm_common_read() treats such a call as a consumed response: it marks the pending response as read and drops it, so the response can never be retrieved; subsequent reads return zero and the next write() is allowed to overwrite the response buffer, silently breaking the command/response pairing of the TPM character devices. Return early when the caller passes a zero count, leaving any pending response untouched for the next read. A zero-length read will not report a deferred asynchronous error; POSIX permits read() to skip error detection for a zero count. Cc: stable@vger.kernel.org Fixes: 9488585b21be ("tpm: add support for partial reads") Assisted-by: GLM-5.3 Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn> Link: https://lore.kernel.org/r/3f15140ab3c26e98b49d6aceaaa826585d56960b.1791015549.git.xiaopei01@kylinos.cn Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
3 daystpm: tpm_nsc: stop using the cleanup callback as dev.releasePei Xiao
tpm_nsc_remove() is called explicitly from cleanup_nsc() and also runs as the platform device release callback on the final platform_device_put(), so the cleanup executes twice on module exit; the second invocation operates on a chip that has already been freed by the devm cleanup, and the I/O region is released twice. Overwriting the release callback installed by platform_device_alloc() also keeps platform_device_release() from running, leaking the platform object allocation. Leave the default release callback in place; the explicit call in cleanup_nsc() remains the single cleanup point. Cc: stable@vger.kernel.org Fixes: 570302a31149 ("[PATCH] tpm: move nsc driver off pci_dev") Assisted-by: GLM-5.3 Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/a6155310e6772f708b47291cc959e02c05b90eb7.1791015549.git.xiaopei01@kylinos.cn Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
3 daystpm: tpm_nsc: fix NULL pointer dereference on init failurePei Xiao
tpm_nsc_remove() is used as the release callback of the hand-created platform device and dereferences the chip drvdata unconditionally. If init fails before tpmm_chip_alloc() (e.g. request_region() cannot claim the ports), the error path drops the last device reference and the release callback runs with chip == NULL, crashing module init. Return early when the chip has not been created yet. Cc: stable@vger.kernel.org Fixes: afb5abc262e9 ("tpm: two-phase chip management functions") Assisted-by: GLM-5.3 Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/d5f0b38d6d6c17c01519c879d26448dbae388b0e.1791015549.git.xiaopei01@kylinos.cn Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
3 daystpm: tpm2_probe: propagate transport errorsAlexander Sverdlin
tpm2_probe() reads the protocol version from the response tag and is documented to return -errno on failure, but it always returns 0. A transport error (tpm_transmit_cmd() < 0) is thus swallowed together with the intentionally ignored TPM response code, leaving TPM_CHIP_FLAG_TPM2 unset. A transient bus failure on the first command then misdetects a TPM 2.0 as a 1.2 and the probe fails on the TPM 1.2 path: tpm_tis_i2c 0-002e: 1.2 TPM (device-id 0x1C, rev-id 22) tpm tpm0: A TPM error (-62) occurred attempting to determine the timeouts Return the transport error instead; rc >= 0 still means a valid header was received and the TPM's own response code is still ignored. Fixes: 94e266ba1fa3 ("tpm: migrate tpm2_probe() to use struct tpm_buf") Cc: stable@vger.kernel.org Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/20261001060114.1582092-1-alexander.sverdlin@siemens.com Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
3 daystpm: reject duplicate PCR banks in tpm2_get_pcr_allocationYuqi Xu
The TPM2_CAP_PCRS response is external input. tpm2_get_pcr_allocation() adds every active selection to allocated_banks, while tpm_sysfs_add_device() has one group slot per distinct hash algorithm. Eight duplicate selections can therefore write past chip->groups[]. The TPM protocol does not allow a hash algorithm to appear twice in this capability response. Treat a duplicate as a broken TPM and return -EIO so the chip is not enabled, instead of silently dropping the extra selection. Fixes: aab73d952402 ("tpm: add sysfs exports for all banks of PCR registers") Cc: stable@vger.kernel.org Reported-by: Vega <vega@nebusec.ai> Closes: https://bugtracker.nebusec.ai/f/675 Assisted-by: LLM Signed-off-by: Yuqi Xu <xuyuqiabc@gmail.com> Reviewed-by: Ren Wei <weir@nebusec.ai> Link: https://lore.kernel.org/r/9d27c4513a3c6fc32f9574ba192cd3bfcb2bac98.1790568982.git.xuyuqiabc@gmail.com Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
3 daysmtd: rawnand: fsl_ifc: allocate shared ctrl with devm_kzallocRosen Penev
Allocate the shared fsl_ifc_nand_ctrl structure against the controller device, which outlives all NAND child devices, so it is freed automatically. This drops the manual kfree() and the broken chip counter that was decremented in remove() but never incremented anywhere, leaking the structure and leaving the freed pointer in ctrl->nand on re-probe. Assisted-by: LLM Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: qcom: fix read location register usage in config_nand_cw_read()Gabor Juhos
On QPIC v2 controllers, when the last codeword is being read, the read location values must be programmed into the READ_LOCATION_LAST_CW_* registers. Prior to commit 8c52932da5e6 ("mtd: rawnand: qcom: cleanup qcom_nandc driver"), the config_nand_cw_read() function did it right, but since then it always writes the read location values to the READ_LOCATION_* registers even if the actual codeword is the last one. Change the function to always configure the registers corresponding to the actual codeword to restore the correct behaviour. Cc: stable@vger.kernel.org Fixes: 8c52932da5e6 ("mtd: rawnand: qcom: cleanup qcom_nandc driver") Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: qcom: move common code to the 'qpic_common' moduleGabor Juhos
The 'qpic_common' module provides some generic functions which are usable by both the 'qcom_nandc' and by the 'spi-qpic-snand' driver. Move more code from the 'qcom_nandc' driver to there in order to allow using those also from the 'spi-qpic-snand' driver. No functional changes. Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: qcom: rename 'nand_stats' structureGabor Juhos
Give 'read_stats' structure a 'qcom_nandc' prefix to indicate that it corresponds to the Qualcomm NAND driver. The definition is going to be moved into a common header this helps to avoid global namespace pollution/collision. No functional changes. This is in preparation of moving the declaration into the 'nand-qpic-common.h' header to allow reusing it from the 'spi-qpic-snand' driver. Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: qcom: make nandc_set_read_loc_last() more genericGabor Juhos
The function gets a 'nand_chip' pointer as a parameter but it is only used to extract a pointer to the nand controller's private structure from that. In order to make the function more generic, change the declaration to get a 'qcom_nandc_controller' pointer directly, and update the callers accordingly. While at it, also change the function name to use a 'qcom_nandc' prefix. No functional changes intended. This is in preparation of moving the function into the 'qpic_common' code to allow reusing it from the 'spi-qpic-snand' driver. Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: qcom: make nandc_set_read_loc_first() more genericGabor Juhos
The function gets a 'nand_chip' pointer as a parameter but it is only used to extract a pointer to the nand controller's private structure from that. In order to make the function more generic, change the declaration to get a 'qcom_nandc_controller' pointer directly, and update the callers accordingly. While at it, also change the function name to use a 'qcom_nandc' prefix. No functional changes intended. This is in preparation of moving the function into the 'qpic_common' code to allow reusing it from the 'spi-qpic-snand' driver. Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: qcom: make config_nand_cw_write() more genericGabor Juhos
The function gets a 'nand_chip' pointer as a parameter but it is only used to extract a pointer to the nand controller's private structure from that. In order to make the function more generic, change the declaration to get a 'qcom_nandc_controller' pointer directly, and update the callers accordingly. While at it, also change the function name to use a 'qcom_nandc' prefix. No functional changes intended. This is in preparation of moving the function into the 'qpic_common' code to allow reusing it from the 'spi-qpic-snand' driver. Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: qcom: make config_nand_page_write() more genericGabor Juhos
The function gets a 'nand_chip' pointer as a parameter but it is only used to extract a pointer to the nand controller's private structure from that. In order to make the function more generic, change the declaration to get a 'qcom_nandc_controller' pointer directly, and update the callers accordingly. While at it, also change the function name to use a 'qcom_nandc' prefix. No functional changes intended. This is in preparation of moving the function into the 'qpic_common' code to allow reusing it from the 'spi-qpic-snand' driver. Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: qcom: make config_nand_page_read() more genericGabor Juhos
The function gets a 'nand_chip' pointer as a parameter but it is only used to extract a pointer to the nand controller's private structure from that. In order to make the function more generic, change the declaration to get a 'qcom_nandc_controller' pointer directly, and update the callers accordingly. While at it, also change the function name to use a 'qcom_nandc' prefix. No functional changes intended. This is in preparation of moving the function into the 'qpic_common' code to allow reusing it from the 'spi-qpic-snand' driver. Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysmtd: rawnand: qcom: make check_flash_errors() more genericGabor Juhos
The function gets a 'qcom_nand_host' pointer as a parameter but it is only used to extract the nand controller's private structure from that. In order to make the function more generic, change the declaration to get a 'qcom_nandc_controller' pointer directly, and update the callers accordingly. While at it, also change the function name to use a 'qcom_nandc' prefix. No functional changes. This is in preparation of moving the function into the 'qpic_common' code to allow reusing it from the 'spi-qpic-snand' driver. Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 daysMerge branch 'for-7.4/io_uring' into for-nextJens Axboe
* for-7.4/io_uring: (21 commits) io_uring/io-wq: don't call try_to_wake_up() twice in io_wq_worker_wake() io_uring: cleanup the io_uring_attr_pi definition io_uring: cleanup __io_prep_rw io_uring/memmap: fix non-compound alloc fallback with memcg accounting io_uring: wait for in-flight requests on ring release io_uring: drop registered files and buffers at release time io_uring: run cancelations synchronously on ring release io_uring/cancel: cancel and wait for all requests on process exit io_uring/notif: count pending zerocopy notifications per ring io_uring/uring_cmd: only cancel requests of the given task io_uring: put request files before posting the completions io_uring/rw: don't reap io-wq IOPOLL completions while io-wq has a reference io_uring: post io-wq completions from the last request reference io_uring/io-wq: put the request file before posting a completion io_uring/io-wq: release raw spinlock before calling wake_up() io_uring/rsrc: fix accounting for cloned buffers with huge pages io_uring: check for room before posting the dummy skip CQE io_uring/fdinfo: ignore IORING_CQE_F_32 in last CQ array slot nvme/ioctl: call io_uring_cmd_set_res32() in ->end_io() io_uring/cmd: split io_uring_cmd_set_res() from io_uring_cmd_done() ...
3 daysMerge branch 'for-7.4/block' into for-nextJens Axboe
* for-7.4/block: (90 commits) block: remove dead metadata handling from the async direct I/O path block: unpin all pages of a bvec in bio_iov_iter_align_down() iomap: reject atomic writes in iomap_file_buffered_write() block: don't fall back to buffered I/O for atomic writes block: fail a short atomic pin in bio_iov_iter_get_pages() block: honor IOCB_NOWAIT in the block device buffered read path block: take i_rwsem for the splice read path block: take i_rwsem for the direct I/O write fallback block: use iomap_dirty_folio for block devices zloop: explicitly mention zone condition when a write fails to it loop: remove support for swapping loop fds selftests: ublk: make the fault_inject delay a pure timeout selftests: ublk: don't keep the fault_inject timespec on the stack aoe: pull in the headers each received packet type reads floppy: return the drive state flags from the 32-bit FDGETDRVSTAT floppy: don't store a stack buffer in timeout_message floppy: annotate data-races around command_status and floppy_work_fn floppy: unregister platform device on add_disk failure floppy: avoid NULL deref in reset_interrupt when cont is cleared floppy: flush pending work before releasing resources on init failure ...
3 daysACPI: video: force native backlight on Dell OptiPlex AIO 7410 35WChitransh Mandhaniya
The Dell OptiPlex AIO 7410 35W (board 01KP8D) declares DELL0501 in its ACPI DSDT (status = 0x0F) even though no UART scalar board is physically present. This causes acpi_video_get_backlight_type() to return acpi_backlight_dell_uart, which makes i915 skip registering intel_backlight. The dell-uart-backlight driver then times out talking to the absent board and the probe fails, leaving the machine with zero backlight control. A BIOS update fixes this on some models (e.g. OptiPlex 7420, board 0914RT) by setting DELL0501 _STA to 0, but Dell has not shipped a corrected BIOS for the 7410 even in the latest release (1.37.0, 2026-05-28). Add a DMI quirk to force native backlight on this model so that i915 registers intel_backlight and brightness control works out of the box. Tested on: - OptiPlex AIO 7410 35W (01KP8D, BIOS 1.37.0) -- confirmed acpi_backlight=native produces working intel_backlight (raw, max=96000), DMI quirk has the same effect. - OptiPlex AIO 7420 35W (0914RT, BIOS 1.27.0) -- DELL0501 absent in updated BIOS, intel_backlight works natively (no regression). Signed-off-by: Chitransh Mandhaniya <Chitransh_Mandhaniya@dell.com> Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Link: https://patch.msgid.link/20261010124830.116750-1-chitranshmandhaniya@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 daysACPI: PM: sleep: Drop unused sleep_no_lps0 defineRiwen Lu
The sleep_no_lps0 stub define in the !CONFIG_ACPI_SLEEP branch of sleep.c has no users left in that file: the LPS0 code consuming it was moved to drivers/acpi/x86/s2idle.c by commit fef98671194b ("ACPI: PM: s2idle: Move x86-specific code to the x86 directory"), which has its own static module parameter of the same name, so the define is no longer used. Drop it. Signed-off-by: Riwen Lu <luriwen@kylinos.cn> Link: https://patch.msgid.link/20261008025152.153073-1-luriwen@kylinos.cn Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 daysACPI: PM: Add unused power resource quirk for Casper Excalibur G900Hakan Abay
On the Casper Excalibur G900, the NVIDIA discrete GPU and the second NVMe device become inaccessible when unused ACPI power resources are turned off during initialization. The failure is similar to the THUNDEROBOT ZERO case addressed by commit cd7ef20ba8c6 ("ACPI: PM: Add unused power resource quirk for THUNDEROBOT ZERO"). Without the quirk, the NVIDIA GPU and the second NVMe device are left inaccessible in D3cold and attempts to transition them back to D0 fail. Add a DMI quirk for the affected Casper Excalibur G900 with NLCC 001 mainboard to leave unused ACPI power resources on. With the quirk applied, the second NVMe device remains accessible. The NVIDIA GPU can enter D3cold while idle and subsequently return to D0 for accelerated rendering. Link: https://bugs.kali.org/view.php?id=9891 Signed-off-by: Hakan Abay <hakan.abay84@gmail.com> Link: https://patch.msgid.link/20261005174939.53873-1-hakan.abay84@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 daysACPI: dock: Retry probing battery docks after hotplugVibhor Goel
On a ThinkPad T480 booted with the removable battery absent, reinserting that battery can leave BAT1 missing from /sys/class/power_supply even after firmware sends an ACPI add notification. The battery dock platform device already exists, but its driver did not bind while the battery was absent. During hotplug, acpi_bus_scan() updates the ACPI device and attempts to attach it on the ACPI bus. acpi_create_platform_device() does not create another platform device because the existing physical node is still associated with the ACPI device. Consequently, the existing platform device remains unbound. Retry probing the battery dock platform device after hotplug_dock_devices() has refreshed the ACPI state. Restrict this to battery docks. If the platform device is already bound, device_initial_probe() leaves that binding in place. Signed-off-by: Vibhor Goel <vibhor1102@gmail.com> [ rjw: Add empty code line after a conditional ] Link: https://patch.msgid.link/20261003164019.11195-1-vibhor1102@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 daysnet: stmmac: add tc mqprio hw queue priority offloadLorenzo Bianconi
Implement the offload of the tc mqprio hw queue priority in the stmmac driver. When the mqprio qdisc is configured in channel mode, the MTL TX scheduler is switched to strict priority, and the PSTQX/PSTC priority bitmask of each TX queue is programmed from the set of frame priorities mapped to the owning traffic class (qopt->prio_tc_map). The channel mode offload requires the DCB hw feature and a 1:1 TC to TX queue mapping, with a single queue per TC. Configurations with AVB queues are rejected, since forcing strict priority conflicts with the CBS algorithm. The CBS offload is refused while the strict-priority scheduler is active, and so is a channel count change that would enable an AVB queue. In the default DCB mode, only the netdev TC map and the FPE preemption class mapping are offloaded, leaving the MTL scheduler and the per-queue priorities to the device-tree configuration. The num_tc bound against ARRAY_SIZE(tc_to_txq) is no longer needed: the check that each TC's offset + count stays within plat->tx_queues_to_use already bounds num_tc, because the TC ranges do not overlap and each one spans at least one queue. Reviewed-by: Davide Caratti <dcaratti@redhat.com> Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20261006-stmmac-mqprio-prio-offload-v5-3-d7da93419784@oss.qualcomm.com Tested-by: Daniel Thompson <daniel@riscstar.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 daysnet: stmmac: align real_num_tx_queues to mqprio configurationLorenzo Bianconi
stmmac_hw_setup() unconditionally sets the number of real TX queues to plat->tx_queues_to_use on every device open. When a tc-mqprio qdisc is offloaded the driver reduces netif_set_real_num_tx_queues() to the number of queues enabled by the offload, but the next device open reverts it to plat->tx_queues_to_use while the netdev TC map is still the one programmed by the qdisc, leaving the two inconsistent. Track the number of TX queues enabled by the current qdisc configuration in the per-qdisc state (priv->xmit_qdisc.num_tx_queues) and use it in stmmac_hw_setup(). The field defaults to plat->tx_queues_to_use at probe time and when the mqprio qdisc is destroyed, meaning no offload is active and the number of real TX queues must match the number of queues the driver allocated, and it is updated to the offloaded queue count on a successful mqprio setup. mqprio only validates the requested queue ranges against dev->real_num_tx_queues, which can be larger than plat->tx_queues_to_use while the interface has not been opened yet. Reject a qopt whose highest referenced queue (offset + count) exceeds plat->tx_queues_to_use, so xmit_qdisc.num_tx_queues can never be larger than the number of TX queues the driver provisions. Otherwise stmmac_hw_setup() would expose TX queues without an allocated DMA ring. Refuse to lower the number of TX queues below the count required by the active mqprio offload in stmmac_reinit_queues(), otherwise netif_set_real_num_tx_queues() would leave real_num_tx_queues inconsistent with the netdev TC map. The issue has been reported by sashiko and the patch has been tested on a Qualcomm RB3-Gen2 board. Fixes: 195e4f409a40 ("net: stmmac: support fp parameter of tc-mqprio") Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20261006-stmmac-mqprio-prio-offload-v5-2-d7da93419784@oss.qualcomm.com Tested-by: Daniel Thompson <daniel@riscstar.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 daysnet: stmmac: set real_num_tx_queues to max(offset + count)Lorenzo Bianconi
tc_setup_dwmac510_mqprio() computes the number of real TX queues as the sum of the per-TC queue counts. mqprio_validate_queue_counts() only rejects out-of-bounds or overlapping ranges, so layouts with gaps or a non-zero first offset are accepted, and in those cases the sum is smaller than the highest queue referenced by the netdev TC map. netif_set_real_num_tx_queues() then passes this too-small count to netif_setup_tc(). However stmmac_set_ndev_tcs() has already zeroed dev->prio_tc_map() through netdev_reset_tc(), so when netif_setup_tc() runs every priority maps to TC0 and only the TC0 range is checked. A layout whose TC0 range fits but where a later TC references a queue beyond the new real_num_tx_queues is left with num_tc set and its TC map pointing at queues that are no longer real, without any warning; only when TC0 itself is out of range is the mapping disabled. The real prio_tc_map is programmed later by the qdisc, after this call, so the driver cannot rely on netif_setup_tc() to catch those cases. Compute num_tx_queues as the maximum of offset[i] + count[i] instead of the sum of the counts, so real_num_tx_queues always covers the highest queue referenced by the TC map. This is a no-op for the contiguous channel-mode layouts where offset[i] == i and count[i] == 1. The issue has been reported by sashiko and the patch has been tested on Qualcomm RB3-Gen2 board. Fixes: 195e4f409a40 ("net: stmmac: support fp parameter of tc-mqprio") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20261006-stmmac-mqprio-prio-offload-v5-1-d7da93419784@oss.qualcomm.com Tested-by: Daniel Thompson <daniel@riscstar.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 dayscxl/core: Enforce partition order/simplify partition callsIra Weiny
Device partitions share one flat DPA space in a fixed order: static volatile capacity at DPA 0, static persistent capacity immediately above it, and dynamic capacity above all static capacity. The static pair is mandated by CXL r4.0 8.2.10.9.2.1 "Get Partition Info", Table 8-310: the device "shall provide this volatile capacity starting at DPA 0" and "shall provide this persistent capacity starting at the DPA immediately following the volatile capacity". Dynamic capacity has no such rule. Table 8-347 only requires the region base to be 256M aligned, so placing it directly above static capacity is a Linux requirement, enforced by cxl_configure_dcd(). DPA 0 end +---------------+---------------+---------------------------+ | ram | pmem | dynamic_ram_1 | +---------------+---------------+---------------------------+ part[0] part[1] part[2] Signed-off-by: Ira Weiny <iweiny@kernel.org> Co-developed-by: Anisa Su <anisa.su@samsung.com> Signed-off-by: Anisa Su <anisa.su@samsung.com> Tested-by: Wonjae Lee <wj28.lee@samsung.com> Tested-by: Junhee Park <jh9934.park@samsung.com> Tested-by: Heesoo Kim <habil.kim@samsung.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Link: https://patch.msgid.link/20261010225852.10727-8-anisa.su@samsung.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
3 dayscxl/mem: Configure dynamic capacity interruptsIra Weiny
Dynamic Capacity Devices (DCD) support extent change notifications through the event log mechanism. The interrupt mailbox commands were extended in CXL 3.1 to support these notifications. Firmware can't configure DCD events to be FW controlled but can retain control of memory events. Configure DCD event log interrupts on devices supporting dynamic capacity. Disable DCD if interrupts are not supported. The DCD event log is not drained here. cxl_event_drain_mask() reports only the logs the driver can service, and the DCD bit is added by the patch introducing DCD event handling. Until then a DCD interrupt wakes the event thread, which finds no log it owns and returns. Care is taken to preserve the interrupt policy set by the FW if FW first has been selected by the BIOS. Based on an original patch by Navneet Singh. Signed-off-by: Ira Weiny <iweiny@kernel.org> Co-developed-by: Anisa Su <anisa.su@samsung.com> Signed-off-by: Anisa Su <anisa.su@samsung.com> Tested-by: Wonjae Lee <wj28.lee@samsung.com> Tested-by: Junhee Park <jh9934.park@samsung.com> Tested-by: Heesoo Kim <habil.kim@samsung.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> Link: https://patch.msgid.link/20261010225852.10727-7-anisa.su@samsung.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
3 dayscxl/pci: Factor out interrupt policy checkIra Weiny
Dynamic Capacity Devices (DCD) require event interrupts to process memory addition or removal. BIOS may have control over non-DCD event processing. DCD interrupt configuration needs to be separate from memory event interrupt configuration. Factor out check for firmware ownership of memory event logs. Link: https://lore.kernel.org/all/663922b475e50_d54d72945b@dwillia2-xfh.jf.intel.com.notmuch/ [1] Suggested-by: Dan Williams <djbw@kernel.org> Signed-off-by: Ira Weiny <iweiny@kernel.org> Signed-off-by: Anisa Su <anisa.su@samsung.com> Tested-by: Wonjae Lee <wj28.lee@samsung.com> Tested-by: Junhee Park <jh9934.park@samsung.com> Tested-by: Heesoo Kim <habil.kim@samsung.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Fan Ni <nifan.cxl@gmail.com> Reviewed-by: Li Ming <ming.li@zohomail.com> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Richard Cheng <icheng@nvidia.com> Tested-by: Alison Schofield <alison.schofield@intel.com> Link: https://patch.msgid.link/20261010225852.10727-6-anisa.su@samsung.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
3 dayscxl/events: Split event msgnum configuration from irq setupIra Weiny
Dynamic Capacity Devices (DCD) require event interrupts to process memory addition or removal. BIOS may have control over non-DCD event processing. DCD interrupt configuration needs to be separate from memory event interrupt configuration. Split cxl_event_config_msgnums() from irq setup in preparation for separate DCD interrupts configuration. Signed-off-by: Ira Weiny <iweiny@kernel.org> Signed-off-by: Anisa Su <anisa.su@samsung.com> Tested-by: Wonjae Lee <wj28.lee@samsung.com> Tested-by: Junhee Park <jh9934.park@samsung.com> Tested-by: Heesoo Kim <habil.kim@samsung.com> Reviewed-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Fan Ni <nifan.cxl@gmail.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Li Ming <ming.li@zohomail.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed-by: Richard Cheng <icheng@nvidia.com> Tested-by: Alison Schofield <alison.schofield@intel.com> Link: https://patch.msgid.link/20261010225852.10727-5-anisa.su@samsung.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
3 dayscxl/cdat: Gather DSMAS data for DCD partitionsIra Weiny
Additional DCD partition (AKA region) information is contained in the DSMAS CDAT tables, including performance, shareable and read-only attributes. Match DCD partitions with DSMAS tables and store the meta data. A DCD shall describe its DC partition in a DSMAS entry (CXL r4.0 9.13.3), so if the CDAT is absent, fails to parse, or has no entry matching the DC partition, disable DCD rather than run with unknown attributes. DSLBIS is optional, but cxl_cdat_endpoint_process() treated zero DSLBIS entries as a parse failure, which would now disable DCD on a device with a valid DSMAS. Accept an empty DSLBIS, and skip DSMAS entries with no DSLBIS coordinates. Signed-off-by: Ira Weiny <iweiny@kernel.org> Co-developed-by: Anisa Su <anisa.su@samsung.com> Signed-off-by: Anisa Su <anisa.su@samsung.com> Tested-by: Wonjae Lee <wj28.lee@samsung.com> Tested-by: Junhee Park <jh9934.park@samsung.com> Tested-by: Heesoo Kim <habil.kim@samsung.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> Link: https://patch.msgid.link/20261010225852.10727-4-anisa.su@samsung.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>