The logic that drives the pad calibration values resides in the
controller reset domain and so the calibration values are only being
captured when the controller is out of reset. However, by clearing the
CYA_TRK_CODE_UPDATE_ON_IDLE bit, the calibration values can be set
while the controller is in reset.
The CYA_TRK_CODE_UPDATE_ON_IDLE bit was previously cleared based on the
trk_hw_mode flag, but this dependency is not necessary. Instead,
introduce a new flag, trk_update_on_idle, to independently control this
bit.
Fixes: d8163a32ca95 ("phy: tegra: xusb: Add Tegra234 support")
Cc: stable(a)vger.kernel.org
Signed-off-by: Wayne Chang <waynec(a)nvidia.com>
---
drivers/phy/tegra/xusb-tegra186.c | 14 ++++++++------
drivers/phy/tegra/xusb.h | 1 +
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c
index fae6242aa730..dd0aaf305e90 100644
--- a/drivers/phy/tegra/xusb-tegra186.c
+++ b/drivers/phy/tegra/xusb-tegra186.c
@@ -650,14 +650,15 @@ static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl)
udelay(100);
}
- if (padctl->soc->trk_hw_mode) {
- value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
- value |= USB2_TRK_HW_MODE;
+ value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
+ if (padctl->soc->trk_update_on_idle)
value &= ~CYA_TRK_CODE_UPDATE_ON_IDLE;
- padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
- } else {
+ if (padctl->soc->trk_hw_mode)
+ value |= USB2_TRK_HW_MODE;
+ padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
+
+ if (!padctl->soc->trk_hw_mode)
clk_disable_unprepare(priv->usb2_trk_clk);
- }
mutex_unlock(&padctl->lock);
}
@@ -1703,6 +1704,7 @@ const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc = {
.supports_gen2 = true,
.poll_trk_completed = true,
.trk_hw_mode = true,
+ .trk_update_on_idle = true,
.supports_lp_cfg_en = true,
};
EXPORT_SYMBOL_GPL(tegra234_xusb_padctl_soc);
diff --git a/drivers/phy/tegra/xusb.h b/drivers/phy/tegra/xusb.h
index 6e45d194c689..d2b5f9565132 100644
--- a/drivers/phy/tegra/xusb.h
+++ b/drivers/phy/tegra/xusb.h
@@ -434,6 +434,7 @@ struct tegra_xusb_padctl_soc {
bool need_fake_usb3_port;
bool poll_trk_completed;
bool trk_hw_mode;
+ bool trk_update_on_idle;
bool supports_lp_cfg_en;
};
--
2.25.1
Hi Greg,
below is a backport for upstream patch
fd87b7783802 ("net: Fix the devmem sock opts and msgs for parisc").
This upstream patch does not apply cleanly against v6.13, and
backporting all intermediate changes are too big, so I created this
trivial standalone patch instead.
Can you please add the patch below to the stable queue for v6.13?
Thanks!
Helge
---
From: Pranjal Shrivastava <praan(a)google.com>
Date: Mon, 24 Mar 2025 07:42:27 +0000
Subject: [PATCH] net: Fix the devmem sock opts and msgs for parisc
The devmem socket options and socket control message definitions
introduced in the TCP devmem series[1] incorrectly continued the socket
definitions for arch/parisc.
The UAPI change seems safe as there are currently no drivers that
declare support for devmem TCP RX via PP_FLAG_ALLOW_UNREADABLE_NETMEM.
Hence, fixing this UAPI should be safe.
Fix the devmem socket options and socket control message definitions to
reflect the series followed by arch/parisc.
[1] https://lore.kernel.org/lkml/20240910171458.219195-10-almasrymina@google.co…
Patch modified for kernel 6.13 by Helge Deller.
Fixes: 8f0b3cc9a4c10 ("tcp: RX path for devmem TCP")
Signed-off-by: Pranjal Shrivastava <praan(a)google.com>
Signed-off-by: Helge Deller <deller(a)gmx.de>
diff --git b/arch/parisc/include/uapi/asm/socket.h a/arch/parisc/include/uapi/asm/socket.h
index d268d69bfcd2..96831c988606 100644
--- b/arch/parisc/include/uapi/asm/socket.h
+++ a/arch/parisc/include/uapi/asm/socket.h
@@ -132,13 +132,15 @@
#define SO_PASSPIDFD 0x404A
#define SO_PEERPIDFD 0x404B
-#define SO_DEVMEM_LINEAR 78
+#define SCM_TS_OPT_ID 0x404C
+
+#define SO_RCVPRIORITY 0x404D
+
+#define SO_DEVMEM_LINEAR 0x404E
#define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR
-#define SO_DEVMEM_DMABUF 79
+#define SO_DEVMEM_DMABUF 0x404F
#define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF
-#define SO_DEVMEM_DONTNEED 80
-
-#define SCM_TS_OPT_ID 0x404C
+#define SO_DEVMEM_DONTNEED 0x4050
#if !defined(__KERNEL__)
This series adds SPI NOR support for STM32MP25 SoCs from STMicroelectronics.
On STM32MP25 SoCs family, an Octo Memory Manager block manages the muxing,
the memory area split, the chip select override and the time constraint
between its 2 Octo SPI children.
Due to these depedencies, this series adds support for:
- Octo Memory Manager driver.
- Octo SPI driver.
- yaml schema for Octo Memory Manager and Octo SPI drivers.
The device tree files adds Octo Memory Manager and its 2 associated Octo
SPI chidren in stm32mp251.dtsi and adds SPI NOR support in stm32mp257f-ev1
board.
Signed-off-by: Patrice Chotard <patrice.chotard(a)foss.st.com>
Changes in v13:
- Make firewall prototypes always exposed.
- Restore STM32_OMM Kconfig dependency from v11.
- Link to v12: https://lore.kernel.org/r/20250506-upstream_ospi_v6-v12-0-e3bb5a0d78fb@foss…
Changes in v12:
- Update Kconfig dependencies.
- Link to v11: https://lore.kernel.org/r/20250428-upstream_ospi_v6-v11-0-1548736fd9d2@foss…
Changes in v11:
- Add stm32_omm_toggle_child_clock(dev, false) in stm32_omm_disable_child() in case of error.
- Check MUXEN bit in stm32_omm_probe() to check if child clock must be disabled.
- Add dev_err_probe() in stm32_omm_probe().
- Link to v10: https://lore.kernel.org/r/20250422-upstream_ospi_v6-v10-0-6f4942a04e10@foss…
Changes in v10:
- Add of_node_put() in stm32_omm_set_amcr().
- Link to v9: https://lore.kernel.org/r/20250410-upstream_ospi_v6-v9-0-cf119508848a@foss.…
Changes in v9:
- split patchset by susbsystem, current one include only OMM related
patches.
- Update SPDX Identifiers to "GPL-2.0-only".
- Add of_node_put)() instm32_omm_set_amcr().
- Rework error path in stm32_omm_toggle_child_clock().
- Make usage of reset_control_acquire/release() in stm32_omm_disable_child()
and move reset_control_get in probe().
- Rename error label in stm32_omm_configure().
- Remove child compatible check in stm32_omm_probe().
- Make usage of devm_of_platform_populate().
- Link to v8: https://lore.kernel.org/r/20250407-upstream_ospi_v6-v8-0-7b7716c1c1f6@foss.…
Changes in v8:
- update OMM's dt-bindings:
- Remove minItems for clocks and resets properties.
- Fix st,syscfg-amcr items declaration.
- move power-domains property before vendor specific properties.
- Update compatible check wrongly introduced during internal tests in
stm32_omm.c.
- Move ommanager's node outside bus@42080000's node in stm32mp251.dtsi.
- Link to v7: https://lore.kernel.org/r/20250401-upstream_ospi_v6-v7-0-0ef28513ed81@foss.…
Changes in v7:
- update OMM's dt-bindings by updating :
- clock-names and reset-names properties.
- spi unit-address node.
- example.
- update stm32mp251.dtsi to match with OMM's bindings update.
- update stm32mp257f-ev1.dts to match with OMM's bindings update.
- Link to v6: https://lore.kernel.org/r/20250321-upstream_ospi_v6-v6-0-37bbcab43439@foss.…
Changes in v6:
- Update MAINTAINERS file.
- Remove previous patch 1/8 and 2/8, merged by Mark Brown in spi git tree.
- Fix Signed-off-by order for patch 3.
- OMM driver:
- Add dev_err_probe() in error path.
- Rename stm32_omm_enable_child_clock() to stm32_omm_toggle_child_clock().
- Reorder initialised/non-initialized variable in stm32_omm_configure()
and stm32_omm_probe().
- Move pm_runtime_disable() calls from stm32_omm_configure() to
stm32_omm_probe().
- Update children's clocks and reset management.
- Use of_platform_populate() to probe children.
- Add missing pm_runtime_disable().
- Remove useless stm32_omm_check_access's first parameter.
- Update OMM's dt-bindings by adding OSPI's clocks and resets.
- Update stm32mp251.dtsi by adding OSPI's clock and reset in OMM's node.
Changes in v5:
- Add Reviewed-by Krzysztof Kozlowski for patch 1 and 3.
Changes in v4:
- Add default value requested by Krzysztof for st,omm-req2ack-ns,
st,omm-cssel-ovr and st,omm-mux properties in st,stm32mp25-omm.yaml
- Remove constraint in free form test for st,omm-mux property.
- Fix drivers/memory/Kconfig by replacing TEST_COMPILE_ by COMPILE_TEST.
- Fix SPDX-License-Identifier for stm32-omm.c.
- Fix Kernel test robot by fixing dev_err() format in stm32-omm.c.
- Add missing pm_runtime_disable() in the error handling path in
stm32-omm.c.
- Replace an int by an unsigned int in stm32-omm.c
- Remove uneeded "," after terminator in stm32-omm.c.
- Update cover letter description to explain dependecies between
Octo Memory Manager and its 2 Octo SPI children.
Changes in v3:
- Squash defconfig patches 8 and 9.
- Update STM32 Octo Memory Manager controller bindings.
- Rename st,stm32-omm.yaml to st,stm32mp25-omm.yaml.
- Update STM32 OSPI controller bindings.
- Reorder DT properties in .dtsi and .dts files.
- Replace devm_reset_control_get_optional() by
devm_reset_control_get_optional_exclusive() in stm32_omm.c.
- Reintroduce region-memory-names management in stm32_omm.c.
- Rename stm32_ospi_tx_poll() and stm32_ospi_tx() to respectively to
stm32_ospi_poll() and stm32_ospi_xfer() in spi-stm32-ospi.c.
- Set SPI_CONTROLLER_HALF_DUPLEX in controller flags in spi-stm32-ospi.c.
Changes in v2:
- Move STM32 Octo Memory Manager controller driver and bindings from
misc to memory-controllers.
- Update STM32 OSPI controller bindings.
- Update STM32 Octo Memory Manager controller bindings.
- Update STM32 Octo Memory Manager driver to match bindings update.
- Update DT to match bindings update.
Signed-off-by: Patrice Chotard <patrice.chotard(a)foss.st.com>
---
Patrice Chotard (4):
firewall: Always expose firewall prototype
dt-bindings: memory-controllers: Add STM32 Octo Memory Manager controller
memory: Add STM32 Octo Memory Manager driver
MAINTAINERS: add entry for STM32 OCTO MEMORY MANAGER driver
.../memory-controllers/st,stm32mp25-omm.yaml | 226 ++++++++++
MAINTAINERS | 6 +
drivers/memory/Kconfig | 17 +
drivers/memory/Makefile | 1 +
drivers/memory/stm32_omm.c | 476 +++++++++++++++++++++
include/linux/bus/stm32_firewall_device.h | 10 +-
6 files changed, 735 insertions(+), 1 deletion(-)
---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250320-upstream_ospi_v6-d432a8172105
Best regards,
--
Patrice Chotard <patrice.chotard(a)foss.st.com>
This patchset backports a series of ublk fixes from upstream to 6.14-stable.
Patch 7 fixes the race that can cause kernel panic when ublk server daemon is exiting.
It depends on patches 1-6 which simplifies & improves IO canceling when ublk server daemon
is exiting as described here:
https://lore.kernel.org/linux-block/20250416035444.99569-1-ming.lei@redhat.…
Ming Lei (5):
ublk: add helper of ublk_need_map_io()
ublk: move device reset into ublk_ch_release()
ublk: remove __ublk_quiesce_dev()
ublk: simplify aborting ublk request
ublk: fix race between io_uring_cmd_complete_in_task and
ublk_cancel_cmd
Uday Shankar (2):
ublk: properly serialize all FETCH_REQs
ublk: improve detection and handling of ublk server exit
drivers/block/ublk_drv.c | 550 +++++++++++++++++++++------------------
1 file changed, 291 insertions(+), 259 deletions(-)
--
2.43.0
Commit fce886a60207 ("KVM: arm64: Plumb the pKVM MMU in KVM") made the
initialization of the local memcache variable in user_mem_abort()
conditional, leaving a codepath where it is used uninitialized via
kvm_pgtable_stage2_map().
This can fail on any path that requires a stage-2 allocation
without transition via a permission fault or dirty logging.
Fix this by making sure that memcache is always valid.
Fixes: fce886a60207 ("KVM: arm64: Plumb the pKVM MMU in KVM")
Signed-off-by: Sebastian Ott <sebott(a)redhat.com>
Reviewed-by: Marc Zyngier <maz(a)kernel.org>
Cc: stable(a)vger.kernel.org
Link: https://lore.kernel.org/kvmarm/3f5db4c7-ccce-fb95-595c-692fa7aad227@redhat.…
---
arch/arm64/kvm/mmu.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index 754f2fe0cc67..eeda92330ade 100644
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -1501,6 +1501,11 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
return -EFAULT;
}
+ if (!is_protected_kvm_enabled())
+ memcache = &vcpu->arch.mmu_page_cache;
+ else
+ memcache = &vcpu->arch.pkvm_memcache;
+
/*
* Permission faults just need to update the existing leaf entry,
* and so normally don't require allocations from the memcache. The
@@ -1510,13 +1515,11 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
if (!fault_is_perm || (logging_active && write_fault)) {
int min_pages = kvm_mmu_cache_min_pages(vcpu->arch.hw_mmu);
- if (!is_protected_kvm_enabled()) {
- memcache = &vcpu->arch.mmu_page_cache;
+ if (!is_protected_kvm_enabled())
ret = kvm_mmu_topup_memory_cache(memcache, min_pages);
- } else {
- memcache = &vcpu->arch.pkvm_memcache;
+ else
ret = topup_hyp_memcache(memcache, min_pages);
- }
+
if (ret)
return ret;
}
base-commit: 92a09c47464d040866cf2b4cd052bc60555185fb
--
2.49.0
Changes since v2 [1]:
* Drop the new x86_platform_op and just use
cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) directly where needed
(Naveen)
* Make the restriction identical to lockdown and stop playing games with
devmem_is_allowed()
* Ensure that CONFIG_IO_STRICT_DEVMEM is enabled to avoid conflicting
mappings for userspace mappings of PCI MMIO.
The original response to Nikolay's report of an SEPT violation triggered
by /dev/mem access to private memory was "let's just turn off /dev/mem".
After some machinations of x86_platform_ops to block a subset of
problematic access, spelunking the history of devmem_is_allowed()
returning "2" to enable some compatibility benefits while blocking
access, and discovering that userspace depends buggy kernel behavior for
mmap(2) of the first 1MB of memory on x86, the proposal has circled back
to "disable /dev/mem".
Require both STRICT_DEVMEM and IO_STRICT_DEVMEM for x86 confidential
guests to close /dev/mem hole while still allowing for userspace
mapping of PCI MMIO as long as the kernel and userspace are not mapping
the range at the same time.
The range_is_allowed() cleanup is not strictly necessary, but might as
well close a 17 year-old "TODO".
---
Dan Williams (2):
x86/devmem: Remove duplicate range_is_allowed() definition
x86/devmem: Drop /dev/mem access for confidential guests
arch/x86/Kconfig | 4 ++++
arch/x86/mm/pat/memtype.c | 31 ++++---------------------------
drivers/char/mem.c | 27 +++++++++------------------
include/linux/io.h | 21 +++++++++++++++++++++
4 files changed, 38 insertions(+), 45 deletions(-)
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
Do not mix class->size and object size during offsets/sizes
calculation in zs_obj_write(). Size classes can merge into
clusters, based on objects-per-zspage and pages-per-zspage
characteristics, so some size classes can store objects
smaller than class->size. This becomes problematic when
object size is much smaller than class->size - we can determine
that object spans two physical pages, because we use a larger
class->size for this, while the actual object is much smaller
and fits one physical page, so there is nothing to write to
the second page and memcpy() size calculation underflows.
We always know the exact size in bytes of the object
that we are about to write (store), so use it instead of
class->size.
Reported-by: Igor Belousov <igor.b(a)beldev.am>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Sergey Senozhatsky <senozhatsky(a)chromium.org>
---
mm/zsmalloc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 70406ac94bbd..999b513c7fdf 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1233,19 +1233,19 @@ void zs_obj_write(struct zs_pool *pool, unsigned long handle,
class = zspage_class(pool, zspage);
off = offset_in_page(class->size * obj_idx);
- if (off + class->size <= PAGE_SIZE) {
+ if (!ZsHugePage(zspage))
+ off += ZS_HANDLE_SIZE;
+
+ if (off + mem_len <= PAGE_SIZE) {
/* this object is contained entirely within a page */
void *dst = kmap_local_zpdesc(zpdesc);
- if (!ZsHugePage(zspage))
- off += ZS_HANDLE_SIZE;
memcpy(dst + off, handle_mem, mem_len);
kunmap_local(dst);
} else {
/* this object spans two pages */
size_t sizes[2];
- off += ZS_HANDLE_SIZE;
sizes[0] = PAGE_SIZE - off;
sizes[1] = mem_len - sizes[0];
--
2.49.0.906.g1f30a19c02-goog
This patch fixes a potential deadlock bug. We observed that in the
mtk-cqdma.c file, most functions like mtk_cqdma_issue_pending() and
mtk_cqdma_free_active_desc() follow the correct locking sequence by
acquiring the pc lock first before taking the vc lock when handling the vc
and pc fields. However, in mtk_cqdma_tx_status(), the function incorrectly
acquires the vc lock first before calling mtk_cqdma_find_active_desc(),
which subsequently acquires the pc lock. This reversed lock acquisition
order (vc → pc) violates the established sequence (pc → vc) and could
potentially trigger deadlock scenarios.
To resolve this issue, we have moved the vc lock acquisition code from
mtk_cqdma_tx_status() into the mtk_cqdma_find_active_desc() function.
This adjustment ensures proper lock ordering while maintaining
functionality. Since mtk_cqdma_find_active_desc() is a static function
with only one call site in mtk_cqdma_tx_status(), this fix effectively
addresses the deadlock risk without introducing unintended side effects
to other components.
This possible bug is found by an experimental static analysis tool
developed by our team. This tool analyzes the locking APIs to extract
function pairs that can be concurrently executed, and then analyzes the
instructions in the paired functions to identify possible concurrency bugs
including data races and atomicity violations.
Fixes: b1f01e48df5a ("dmaengine: mediatek: Add MediaTek Command-Queue DMA controller for MT6765 SoC")
Cc: stable(a)vger.kernel.org
Signed-off-by: Qiu-ji Chen <chenqiuji666(a)gmail.com>
---
drivers/dma/mediatek/mtk-cqdma.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/mediatek/mtk-cqdma.c b/drivers/dma/mediatek/mtk-cqdma.c
index d5ddb4e30e71..656354bccb44 100644
--- a/drivers/dma/mediatek/mtk-cqdma.c
+++ b/drivers/dma/mediatek/mtk-cqdma.c
@@ -423,11 +423,14 @@ static struct virt_dma_desc *mtk_cqdma_find_active_desc(struct dma_chan *c,
unsigned long flags;
spin_lock_irqsave(&cvc->pc->lock, flags);
+ spin_lock_irqsave(&cvc->vc.lock, flags);
list_for_each_entry(vd, &cvc->pc->queue, node)
if (vd->tx.cookie == cookie) {
+ spin_unlock_irqrestore(&cvc->vc.lock, flags);
spin_unlock_irqrestore(&cvc->pc->lock, flags);
return vd;
}
+ spin_unlock_irqrestore(&cvc->vc.lock, flags);
spin_unlock_irqrestore(&cvc->pc->lock, flags);
list_for_each_entry(vd, &cvc->vc.desc_issued, node)
@@ -452,9 +455,7 @@ static enum dma_status mtk_cqdma_tx_status(struct dma_chan *c,
if (ret == DMA_COMPLETE || !txstate)
return ret;
- spin_lock_irqsave(&cvc->vc.lock, flags);
vd = mtk_cqdma_find_active_desc(c, cookie);
- spin_unlock_irqrestore(&cvc->vc.lock, flags);
if (vd) {
cvd = to_cqdma_vdesc(vd);
--
2.34.1