From: Greg Kroah-Hartman Date: Fri, 20 Jun 2025 08:21:00 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v5.4.295~167 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a0aa66ea8add2bfa3228caecf4eb90c07e38234;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: arm-9447-1-arm-memremap-fix-arch_memremap_can_ram_remap.patch ata-pata_via-force-pio-for-atapi-devices-on-vt6415-vt6330.patch bus-fsl-mc-do-not-add-a-device-link-for-the-uapi-used-dpmcp-device.patch --- diff --git a/queue-5.4/arm-9447-1-arm-memremap-fix-arch_memremap_can_ram_remap.patch b/queue-5.4/arm-9447-1-arm-memremap-fix-arch_memremap_can_ram_remap.patch new file mode 100644 index 0000000000..c3ec507a29 --- /dev/null +++ b/queue-5.4/arm-9447-1-arm-memremap-fix-arch_memremap_can_ram_remap.patch @@ -0,0 +1,48 @@ +From 96e0b355883006554a0bee3697da475971d6bba8 Mon Sep 17 00:00:00 2001 +From: Ross Stutterheim +Date: Wed, 16 Apr 2025 14:50:06 +0100 +Subject: ARM: 9447/1: arm/memremap: fix arch_memremap_can_ram_remap() + +From: Ross Stutterheim + +commit 96e0b355883006554a0bee3697da475971d6bba8 upstream. + +arm/memremap: fix arch_memremap_can_ram_remap() + +commit 260364d112bc ("arm[64]/memremap: don't abuse pfn_valid() to ensure +presence of linear map") added the definition of +arch_memremap_can_ram_remap() for arm[64] specific filtering of what pages +can be used from the linear mapping. memblock_is_map_memory() was called +with the pfn of the address given to arch_memremap_can_ram_remap(); +however, memblock_is_map_memory() expects to be given an address for arm, +not a pfn. + +This results in calls to memremap() returning a newly mapped area when +it should return an address in the existing linear mapping. + +Fix this by removing the address to pfn translation and pass the +address directly. + +Fixes: 260364d112bc ("arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map") +Signed-off-by: Ross Stutterheim +Cc: Mike Rapoport +Cc: stable@vger.kernel.org +Reviewed-by: Catalin Marinas +Reviewed-by: Linus Walleij +Signed-off-by: Russell King (Oracle) +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/mm/ioremap.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/arch/arm/mm/ioremap.c ++++ b/arch/arm/mm/ioremap.c +@@ -504,7 +504,5 @@ void __init early_ioremap_init(void) + bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, + unsigned long flags) + { +- unsigned long pfn = PHYS_PFN(offset); +- +- return memblock_is_map_memory(pfn); ++ return memblock_is_map_memory(offset); + } diff --git a/queue-5.4/ata-pata_via-force-pio-for-atapi-devices-on-vt6415-vt6330.patch b/queue-5.4/ata-pata_via-force-pio-for-atapi-devices-on-vt6415-vt6330.patch new file mode 100644 index 0000000000..812b3d4f76 --- /dev/null +++ b/queue-5.4/ata-pata_via-force-pio-for-atapi-devices-on-vt6415-vt6330.patch @@ -0,0 +1,48 @@ +From d29fc02caad7f94b62d56ee1b01c954f9c961ba7 Mon Sep 17 00:00:00 2001 +From: Tasos Sahanidis +Date: Mon, 19 May 2025 11:49:45 +0300 +Subject: ata: pata_via: Force PIO for ATAPI devices on VT6415/VT6330 + +From: Tasos Sahanidis + +commit d29fc02caad7f94b62d56ee1b01c954f9c961ba7 upstream. + +The controller has a hardware bug that can hard hang the system when +doing ATAPI DMAs without any trace of what happened. Depending on the +device attached, it can also prevent the system from booting. + +In this case, the system hangs when reading the ATIP from optical media +with cdrecord -vvv -atip on an _NEC DVD_RW ND-4571A 1-01 and an +Optiarc DVD RW AD-7200A 1.06 attached to an ASRock 990FX Extreme 4, +running at UDMA/33. + +The issue can be reproduced by running the same command with a cygwin +build of cdrecord on WinXP, although it requires more attempts to cause +it. The hang in that case is also resolved by forcing PIO. It doesn't +appear that VIA has produced any drivers for that OS, thus no known +workaround exists. + +HDDs attached to the controller do not suffer from any DMA issues. + +Cc: stable@vger.kernel.org +Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/916677 +Signed-off-by: Tasos Sahanidis +Link: https://lore.kernel.org/r/20250519085508.1398701-1-tasos@tasossah.com +Signed-off-by: Niklas Cassel +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ata/pata_via.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/ata/pata_via.c ++++ b/drivers/ata/pata_via.c +@@ -368,7 +368,8 @@ static unsigned long via_mode_filter(str + } + + if (dev->class == ATA_DEV_ATAPI && +- dmi_check_system(no_atapi_dma_dmi_table)) { ++ (dmi_check_system(no_atapi_dma_dmi_table) || ++ config->id == PCI_DEVICE_ID_VIA_6415)) { + ata_dev_warn(dev, "controller locks up on ATAPI DMA, forcing PIO\n"); + mask &= ATA_MASK_PIO; + } diff --git a/queue-5.4/bus-fsl-mc-do-not-add-a-device-link-for-the-uapi-used-dpmcp-device.patch b/queue-5.4/bus-fsl-mc-do-not-add-a-device-link-for-the-uapi-used-dpmcp-device.patch new file mode 100644 index 0000000000..5fbd1a252d --- /dev/null +++ b/queue-5.4/bus-fsl-mc-do-not-add-a-device-link-for-the-uapi-used-dpmcp-device.patch @@ -0,0 +1,60 @@ +From dd7d8e012b23de158ca0188239c7a1f2a83b4484 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 8 Apr 2025 13:58:10 +0300 +Subject: bus: fsl-mc: do not add a device-link for the UAPI used DPMCP device + +From: Ioana Ciornei + +commit dd7d8e012b23de158ca0188239c7a1f2a83b4484 upstream. + +The fsl-mc bus associated to the root DPRC in a DPAA2 system exports a +device file for userspace access to the MC firmware. In case the DPRC's +local MC portal (DPMCP) is currently in use, a new DPMCP device is +allocated through the fsl_mc_portal_allocate() function. + +In this case, the call to fsl_mc_portal_allocate() will fail with -EINVAL +when trying to add a device link between the root DPRC (consumer) and +the newly allocated DPMCP device (supplier). This is because the DPMCP +is a dependent of the DPRC device (the bus). + +Fix this by not adding a device link in case the DPMCP is allocated for +the root DPRC's usage. + +Fixes: afb77422819f ("bus: fsl-mc: automatically add a device_link on fsl_mc_[portal,object]_allocate") +Signed-off-by: Ioana Ciornei +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20250408105814.2837951-3-ioana.ciornei@nxp.com +Signed-off-by: Christophe Leroy +Signed-off-by: Greg Kroah-Hartman +--- + drivers/bus/fsl-mc/mc-io.c | 19 +++++++++++++------ + 1 file changed, 13 insertions(+), 6 deletions(-) + +--- a/drivers/bus/fsl-mc/mc-io.c ++++ b/drivers/bus/fsl-mc/mc-io.c +@@ -214,12 +214,19 @@ int __must_check fsl_mc_portal_allocate( + if (error < 0) + goto error_cleanup_resource; + +- dpmcp_dev->consumer_link = device_link_add(&mc_dev->dev, +- &dpmcp_dev->dev, +- DL_FLAG_AUTOREMOVE_CONSUMER); +- if (!dpmcp_dev->consumer_link) { +- error = -EINVAL; +- goto error_cleanup_mc_io; ++ /* If the DPRC device itself tries to allocate a portal (usually for ++ * UAPI interaction), don't add a device link between them since the ++ * DPMCP device is an actual child device of the DPRC and a reverse ++ * dependency is not allowed. ++ */ ++ if (mc_dev != mc_bus_dev) { ++ dpmcp_dev->consumer_link = device_link_add(&mc_dev->dev, ++ &dpmcp_dev->dev, ++ DL_FLAG_AUTOREMOVE_CONSUMER); ++ if (!dpmcp_dev->consumer_link) { ++ error = -EINVAL; ++ goto error_cleanup_mc_io; ++ } + } + + *new_mc_io = mc_io; diff --git a/queue-5.4/series b/queue-5.4/series index 0a7a680902..1f1e7c6762 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -106,3 +106,6 @@ nfsd-nfsd4_spo_must_allow-must-check-this-is-a-v4-compound-request.patch wifi-rtlwifi-disable-aspm-for-rtl8723be-with-subsystem-id-11ad-1723.patch media-gspca-add-error-handling-for-stv06xx_read_sensor.patch media-v4l2-dev-fix-error-handling-in-__video_register_device.patch +arm-9447-1-arm-memremap-fix-arch_memremap_can_ram_remap.patch +ata-pata_via-force-pio-for-atapi-devices-on-vt6415-vt6330.patch +bus-fsl-mc-do-not-add-a-device-link-for-the-uapi-used-dpmcp-device.patch