From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B414E3D79E8 for ; Fri, 22 May 2026 11:20:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779448838; cv=none; b=J8WSdR0eNyivVlN+/adNblAh5Enckve8P4dFsSYEsT1S9NUBad96vQPwuJsfv9bJH7GA0Y27OatxUd4nuQzp3t5lnRZN7R+Uyodji9KOKnoKL2PJjo+AlL7PZ4leGmHy/6EUhaUjGpb6c/rmMfZAsJG+CslU7jdVDstj09pCIfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779448838; c=relaxed/simple; bh=VR+oYjaqTda/ojWwOj+jXMPjefM4/+bZEZNGcaE/kiY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qsypeN+SffWXGymFdwvCNNXDav+X6g+b8erz00CtKLJVBzfdLb9lpLlMwKvQG/rCUFAR+4xbXBJtIbBJamP2eouJuiDyg2pwyu29jPV0wd8wwfE/kbE9UZaq4UvpJk3IunkzD66UJGquPsLVLB2ys/R2ZIoOz8lVKltjF9VBBzA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SlwI+ZZr; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SlwI+ZZr" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-488b0e1b870so99300825e9.2 for ; Fri, 22 May 2026 04:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779448835; x=1780053635; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wzM3FKLrWhS9Bb2TjExjJmxAKhc1IFpSqwHPLv7ULGk=; b=SlwI+ZZr2xCU9EFicwD6pvECxT16cLRDwDgExusWPTvld/LNDnbxng6bs6JW1SefDR c6KkdAww/ze806MSXbtuUivp4rOmwc1DAti2U9eLJ48Jg3qq2ROc8CMj0G/T16ElcFev nkMariuGDfDL/CcW+4Xt6Vt/V9LbAuJlJq22JNSpUEuCn6qoR6LD6cQyj+6QgxC7KQoi Ojz5OgpR2wF5GNZKPRHE0ikUBYs6Ebl2rt3hZMAHb4WUCP1Yy+kYLQF5u0rmWoooPvee 8QHZgKmadNDopMAM4Thr6GBS7MUVoHTR2cDEno984pnmfrnbJkYQyS4EJdRZf0CDyn/3 YPaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779448835; x=1780053635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wzM3FKLrWhS9Bb2TjExjJmxAKhc1IFpSqwHPLv7ULGk=; b=EGaMN27v22DEC5BtbQUJEJ0o3OWoRzWbIQVMmfO4n8R8piAJ7Fzrcia8Nkfsb6X27T n5NG3Xf4hfeGGrx4oa3cwypXydX/5chhzpdik/pyuLu5LjVzNKrqX9BDD07hgJmo2wCJ XjXHVDVjH9RM0RkoeI93gTHwYNIkOWUod0O3u1isW0CTEhpyJPYj7tbq1Xeegp4TJzHv l8QLvGJjHFitck62UhBdQKFtxQ7J3t81b5Y3lGO6SFFPZKeJ93j6W9eOElXB8vviJBc/ 7LibkBFJ+CoqPniA1JfsL5JyqBUkGlqs/mlYtpV2FnyDPb5laUwsn1Y/J9Ae5ct1M1cp LjLQ== X-Forwarded-Encrypted: i=1; AFNElJ+XRjvhrCkUP9hj2P8L8XxCI4BbBCy0utEke9jZbxqRA7Y+xTaehFiYPX+C5LT/wA075ApgtxOVbau+bhQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxY31HXw5zAbP4cpfsTbSh80twdCmRN4ka/rGYh8hzaBnm4GEeU pOYmjN4MDt7pPPTi17CfSR/1cE1LoJwWB6fdmLD/D9tqxp+SHqZf9jgP X-Gm-Gg: Acq92OEE/SzlMdJocpseJ7yCyzoBV1u3cYu999pn1xal8aQcJQd2gD2PwYwUIB7TBX6 sJJRzt2T6tCFhN8joAnz4X6XYeFmdeoq2hx2AfCz2MtxR+bb9AZN5wG5Q1ozxWjJ6XgOiO6Gfeb yl44i9h+s7xAkzNADRCvjoUc68oP0XuMbXkqj0GKBI6fPvXxCxFeJoYmQ/VQHZeVdm8jBxhyO5D h5Vl/iT1b//c6xlg5IbP3QUvsx77VkOtJukvutXoxySxV8IhYwdoO3A68QyjOEU5GuP/p5aqT7g qoQk7QGaPSSoxtkDeC2f31WYdTdFwbpSWHJpmQPIyx9ILdBgaxMHjYt06LhzyDV7Ca+wOkwPX2g gX4rrzFgjrcOmRInsH8hinuJ6cijj30uaM3vxib3sGcQ8ndUSwRhlNTfRzpa2y+HjfDWcFcogYm o+mSkdaUdHbd3RRd4kK4wdA/F3R3iE+8qUEfbQnSV7BdXVT94vLA== X-Received: by 2002:a05:600c:4510:b0:489:1c1f:35df with SMTP id 5b1f17b1804b1-490424a682emr41205515e9.10.1779448835090; Fri, 22 May 2026 04:20:35 -0700 (PDT) Received: from SMW024614.wbi.nxp.com ([128.77.115.157]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4904526ca21sm34388355e9.3.2026.05.22.04.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2026 04:20:34 -0700 (PDT) From: Laurentiu Mihalcea To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Sascha Hauer , Peng Fan , Fabio Estevam Cc: Pengutronix Kernel Team , linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] remoteproc: imx_rpoc: fix carveout name parsing Date: Fri, 22 May 2026 04:18:46 -0700 Message-ID: <20260522111849.783-3-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260522111849.783-1-laurentiumihalcea111@gmail.com> References: <20260522111849.783-1-laurentiumihalcea111@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Laurentiu Mihalcea The imx remoteproc driver assumes that the names of the reserved memory regions reflect their usage (e.g. "vdevbuffer", "vdev0vring0", etc.). This conflicts with the devicetree specification's recommendation, which states that the names of the devicetree nodes should be generic. Therefore, instead of relying on the node names, use the names passed via the "memory-region-names" property if present. Otherwise, keep the old behavior. The definition of imx_rproc_rmem_to_resource() is added to a common place as imx_dsp_rproc.c can also use it given that it suffers from the same aforementioned problem. Signed-off-by: Laurentiu Mihalcea --- drivers/remoteproc/imx_rproc.c | 7 +++++-- drivers/remoteproc/imx_rproc.h | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 7f54322244ac..1ee1c658dcc1 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -672,7 +672,7 @@ static int imx_rproc_prepare(struct rproc *rproc) int err; struct resource res; - err = of_reserved_mem_region_to_resource(np, i++, &res); + err = imx_rproc_rmem_to_resource(np, i++, &res); if (err) break; @@ -850,11 +850,14 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, if (nph <= 0) return 0; + if (!of_property_present(np, "memory-region-names")) + dev_warn(dev, "using node names for carveouts should be avoided\n"); + /* remap optional addresses */ for (a = 0; a < nph; a++) { struct resource res; - err = of_reserved_mem_region_to_resource(np, a, &res); + err = imx_rproc_rmem_to_resource(np, a, &res); if (err) { dev_err(dev, "unable to resolve memory region\n"); return err; diff --git a/drivers/remoteproc/imx_rproc.h b/drivers/remoteproc/imx_rproc.h index 0d7d48352a10..58e9daa41afe 100644 --- a/drivers/remoteproc/imx_rproc.h +++ b/drivers/remoteproc/imx_rproc.h @@ -45,4 +45,23 @@ struct imx_rproc_dcfg { u32 reset_vector_mask; }; +static inline int imx_rproc_rmem_to_resource(struct device_node *np, + int index, + struct resource *res) +{ + int ret; + + ret = of_reserved_mem_region_to_resource(np, index, res); + if (ret) + return ret; + + /* "memory-region-names" is optional */ + ret = of_property_read_string_index(np, "memory-region-names", + index, &res->name); + if (ret == -EINVAL) + return 0; + + return ret; +} + #endif /* _IMX_RPROC_H */ -- 2.43.0