Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795055784; b=lPL1P0hhN7tsNHKwjyKz2qEgcn7yKAS4jVhkhU27DAuGv6Lflhx7VAlC97t0rYzxLPLV 2cESmKvPg58s4frY5OdXYPkzx8XhTyNSRS9PPyX23ZqyuDrr/GYel7tEGnxGam8x8h0h5 kK1gnM6YlImnu1Rf2bVKELIiGwOCifiNsfeNIUqU6g8KlX9/mvrNHxIkZWsAp/Z5Ji4Rn fm7SrdOcO73eCTjQN3qYRPK3n//rXQ13O0+peWjDBaxWtJjxi+1LlxuEzRZ8EjVM9Mk9z Td1BwKsz8lbJQVmB3z5MXaKkNhh0iK/QmUlAIqupEpg/ABUEyvKGKdZ22fOu63ECEXQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795055784; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=1vm08BiFdcdMRGu8jb48jW7jBA6Afp09/+xLYkxYHe8=; b=j9SuenoxFu1KEOYdXn4NheAYjmp3jSdFOaRWRl4imoDurkVbgbATAQmoHCBr0mUNo+6+ 4DmzS/5bXf16mlALjSeP93uAsXipPczu13f4k5Bcji4Esp/YiSOE8Q0YQyFNchCVV+Cqz 3LKzCfki61Fe3Xm01+bCDuSqz+hFBJBadPctdgXlTn65RrthBqd7ir/WCRYg2Ecco1D0J v5S7aXB+JrFH1ECA1wXpf71Sh9yT3AL9NfZbfsP4SCkLd9wyeGl+Lqnm0hDo3kIJZ1mAG rPUcHy9KIIACjuPg8OcnFZ0YbzquFOmy4jtf8yRgE5KWsrn8g50Oqi7ytpQd6Fv+5YA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=NYUCLbWp; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A88E8606A31C; Thu, 19 Nov 2026 02:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=NYUCLbWp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08DC31F000C5; Thu, 19 Nov 2026 02:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795055784; bh=1vm08BiFdcdMRGu8jb48jW7jBA6Afp09/+xLYkxYHe8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NYUCLbWpOnXDZlqmkdbEed/FNZ74CvMZcFJU0lICd9SFKQ6G4TYtPsqeQx+YhBV5l g/q2MOwGCshdcDrg26u4A9nCOCWXecJ7gBvzBM1lOf87u9xarDT8P9ev4qkL/2szXV X84YTz9Qw983WymG0Iv/Wwmh5DIYL6Qh1iTwL3m8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Linus Walleij , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 1754/2214] dmaengine: ste_dma40: Get LCPA SRAM from SRAM node Date: Wed, 18 Nov 2026 15:57:10 +0100 Message-ID: <20261118150121.735271399@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150009.797899913@linuxfoundation.org> References: <20261118150009.797899913@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Walleij [ Upstream commit 5a1a3b9c19ddeddc6b0c2ea1da7fbe6624c04c7e ] Instead of passing the reserved SRAM as a "reg" field look for a phandle to the LCPA SRAM memory so we can use the proper SRAM device tree bindings for the SRAM. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-2-60bfa6785968@linaro.org Signed-off-by: Vinod Koul Stable-dep-of: c6809b381e34 ("dmaengine: ste_dma40: Fix probe runtime PM disable") Signed-off-by: Sasha Levin --- drivers/dma/Kconfig | 1 + drivers/dma/ste_dma40.c | 47 +++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 143fb0f8c07fa..b49a408967371 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -554,6 +554,7 @@ config STE_DMA40 bool "ST-Ericsson DMA40 support" depends on ARCH_U8500 select DMA_ENGINE + select SRAM help Support for ST-Ericsson DMA40 controller diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 52f455262857d..b25225c480fa7 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -3515,9 +3516,11 @@ static int __init d40_probe(struct platform_device *pdev) { struct stedma40_platform_data *plat_data = dev_get_platdata(&pdev->dev); struct device_node *np = pdev->dev.of_node; + struct device_node *np_lcpa; int ret = -ENOENT; struct d40_base *base; struct resource *res; + struct resource res_lcpa; int num_reserved_chans; u32 val; @@ -3544,37 +3547,37 @@ static int __init d40_probe(struct platform_device *pdev) spin_lock_init(&base->interrupt_lock); spin_lock_init(&base->execmd_lock); - /* Get IO for logical channel parameter address */ - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lcpa"); - if (!res) { - ret = -ENOENT; - d40_err(&pdev->dev, "No \"lcpa\" memory resource\n"); - goto destroy_cache; + /* Get IO for logical channel parameter address (LCPA) */ + np_lcpa = of_parse_phandle(np, "sram", 0); + if (!np_lcpa) { + dev_err(&pdev->dev, "no LCPA SRAM node\n"); + goto report_failure; } - base->lcpa_size = resource_size(res); - base->phy_lcpa = res->start; - - if (request_mem_region(res->start, resource_size(res), - D40_NAME " I/O lcpa") == NULL) { - ret = -EBUSY; - d40_err(&pdev->dev, "Failed to request LCPA region %pR\n", res); - goto destroy_cache; + /* This is no device so read the address directly from the node */ + ret = of_address_to_resource(np_lcpa, 0, &res_lcpa); + if (ret) { + dev_err(&pdev->dev, "no LCPA SRAM resource\n"); + goto report_failure; } + base->lcpa_size = resource_size(&res_lcpa); + base->phy_lcpa = res_lcpa.start; + dev_info(&pdev->dev, "found LCPA SRAM at 0x%08x, size 0x%08x\n", + (u32)base->phy_lcpa, base->lcpa_size); /* We make use of ESRAM memory for this. */ val = readl(base->virtbase + D40_DREG_LCPA); - if (res->start != val && val != 0) { + if (base->phy_lcpa != val && val != 0) { dev_warn(&pdev->dev, - "[%s] Mismatch LCPA dma 0x%x, def %pa\n", - __func__, val, &res->start); + "[%s] Mismatch LCPA dma 0x%x, def %08x\n", + __func__, val, (u32)base->phy_lcpa); } else - writel(res->start, base->virtbase + D40_DREG_LCPA); + writel(base->phy_lcpa, base->virtbase + D40_DREG_LCPA); - base->lcpa_base = ioremap(res->start, resource_size(res)); + base->lcpa_base = ioremap(base->phy_lcpa, base->lcpa_size); if (!base->lcpa_base) { ret = -ENOMEM; d40_err(&pdev->dev, "Failed to ioremap LCPA region\n"); - goto destroy_cache; + goto release_base; } /* If lcla has to be located in ESRAM we don't need to allocate */ if (base->plat_data->use_esram_lcla) { @@ -3691,9 +3694,7 @@ static int __init d40_probe(struct platform_device *pdev) if (base->lcpa_base) iounmap(base->lcpa_base); - if (base->phy_lcpa) - release_mem_region(base->phy_lcpa, - base->lcpa_size); +release_base: if (base->phy_start) release_mem_region(base->phy_start, base->phy_size); -- 2.53.0