From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82E27CA0EDC for ; Wed, 20 Aug 2025 10:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vlariyUg/2e3sM/3EKHYDRoybrUl8t7Wg/1mNFbV/AA=; b=p3EblzuaWZXic6Ddc2XrxCQ1cR KGgqI/SgG9zogEwEug2Y1jZWW0WRgB4r6wDxAHlALQ4WzvHoYdlpcoMj3X7MsPGoFPrMGP07k3v3H lslMKp/ouQxPsuE/+fhUPnoicA7xN0uRe8+6VxdtTjMUAuug4Zw8LoHrGNuO7jELMrOCrcyGZcB6M apVMjmcrTqzg69Wwz2WggqirSoJMUZaiZBRlGowbyTgvvZ9FkWgXrQjban5Y5JmBvdRMz5dn7Ktrx IXTOfUnu97WWwyFSPrUgR0uGWq5zbr4GyUtw6an8IYN+UuOUda47zqOSa2zqPII7JHFP6lrDirHyX esNfPGRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uofro-0000000D6li-06LE; Wed, 20 Aug 2025 10:16:28 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uofHl-0000000Cy7v-06F2 for linux-arm-kernel@lists.infradead.org; Wed, 20 Aug 2025 09:39:15 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57K9Y2ox000924; Wed, 20 Aug 2025 11:39:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= vlariyUg/2e3sM/3EKHYDRoybrUl8t7Wg/1mNFbV/AA=; b=8QJZqQQOdu73pxWF /8WRjLizsLGRCWdqzd6mc0DDZXQIQF9pNKeVdKEpnR3UBd8645bs3uAi/GOBIsL2 GaABo7FcA1YQDNzmubKpKd2ZLrVG8i638heMKjcO0UdXkEN39LmKJSHUMDMyXrof w7Jy0gPxVBdero2AIz18ReBuzWE/IJ2BPKH77fRYftkM98jOjc00eTL9ps4eFZJA CZDy0+OVHszAdaV4l5nEOpkDESwzRoKXuCtqcLukr8dsTjqbhEZm19rUpU0by2Xc HHpqbY38qmmuB2lHlYISbw2mAHCfH9RGomTFOGXLCZfqlAfopJkV+N9sVWEOcBKC OsLtVQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 48n6uj9dxb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Aug 2025 11:39:02 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 45DDA40044; Wed, 20 Aug 2025 11:37:15 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 623115FE4CD; Wed, 20 Aug 2025 11:35:58 +0200 (CEST) Received: from [10.48.87.62] (10.48.87.62) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 20 Aug 2025 11:35:57 +0200 Message-ID: <72c32584-26a8-41bc-9eb6-1b5c0b25a6b2@foss.st.com> Date: Wed, 20 Aug 2025 11:35:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5] remoteproc: Use of_reserved_mem_region_* functions for "memory-region" To: Daniel Baluta , "Rob Herring (Arm)" CC: Dmitry Baryshkov , Bjorn Andersson , Mathieu Poirier , "Shawn Guo" , Sascha Hauer , "Pengutronix Kernel Team" , Fabio Estevam , Geert Uytterhoeven , Magnus Damm , Maxime Coquelin , Alexandre Torgue , Arnaud Pouliquen , Peng Fan , , , , , , , , Iuliana Prodan , Laurentiu Mihalcea , Aisheng Dong References: <20250819213831.1368296-1-robh@kernel.org> Content-Language: en-US From: Patrice CHOTARD In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.48.87.62] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-20_03,2025-08-20_01,2025-03-28_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250820_023913_658705_B214ACC0 X-CRM114-Status: GOOD ( 18.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 8/20/25 10:21, Daniel Baluta wrote: > Hi Rob, > > This patch will break IMX RPROC support. > > >> --- a/drivers/remoteproc/imx_rproc.c >> +++ b/drivers/remoteproc/imx_rproc.c > > >> static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) > > >> - priv->mem[b].cpu_addr = devm_ioremap_wc(&pdev->dev, res.start, resource_size(&res)); >> + priv->mem[b].cpu_addr = devm_ioremap_resource_wc(&pdev->dev, &res); > > devm_ioremap_resource_wc works only for IORESOURCE_MEM resources: > > lib/devres.c:124 > static void __iomem * > __devm_ioremap_resource(struct device *dev, const struct resource *res, > > » if (!res || resource_type(res) != IORESOURCE_MEM) { > » » ret = dev_err_probe(dev, -EINVAL, "invalid resource > %pR\n", res); > » » return IOMEM_ERR_PTR(ret); > » } > > while the devm_ioremap_wc doesn't care about this. > Hi All, > So we cannot use devm_ioremap_resource_wc here unless you add > IORESOURCE_MEM flags > to of_reserved_mem_region_to_resource as discussed here: Agree with Daniel, IORESOURCE_MEM flags should be set in of_reserved_mem_region_to_resource(). I got a similar issue since commit defe01abfb7f ("spi: stm32-ospi: Use of_reserved_mem_region_to_resource() for "memory-region") resource flags is unset, which causing the following error: [ 11.455387] stm32-ospi 40430000.spi: error -EINVAL: invalid resource [??? 0x60000000-0x6fffffff flags 0x0] Thanks Patrice > > https://lkml.org/lkml/2025/4/28/759 > > The same issue we are already experiencing with Sound Open Firmware > where the change was already merged > and we have a bug already reported. > > How should we fix this: > > 1) Add res->flags = IORESOURCE_MEM; in of_reserved_mem_region_to_resource > > OR > > 2) Use devm_ioremap_wc instead of devm_ioremap_resource_wc. > > thanks, > Daniel. > > > > Daniel.