From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C1FA4A5C54; Wed, 16 Sep 2026 21:11:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.3 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593086; cv=pass; b=TJip+8eYuRk4K/UZjXASx4ScXbI2en+N/oFhlihvcd+CBzjRkpCEklkDpyyO6X+q045q7VahFTV6JCMip+D9lU0naMDhvsspRK7raIgXTpjj15PqGq/L5hMh6htg3xzPcHQyKPQBupWgE2OmAtig0Zl7+ltCsKWfgV/f2vr7aOo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593086; c=relaxed/simple; bh=GA43VkbHqER01zDTwAx5YQK+oTAg4fjkEJYtZq+Av3o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AvF2xjqbCMD5PfubBtVR783/8y6veiH4FDcDpM23avKvMzEQkg/CG7PaLE9L2Qt3byoOTYaJS3PaHhkVKlMOHRyvwq5uz2lWWUMkMcw8Sy3MHP3Yy94JoF+lRz0BVpQnnDBy9QPRG1lInY8PuXR0hqvop+CPHsZyzLn/z5k6PtE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=yBJJeQKv; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=DF7q3DU5; arc=pass smtp.client-ip=185.56.87.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="yBJJeQKv"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="DF7q3DU5" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; s=arckey; t=1789593081; b=pvuUzST8JBmXhxsWxQUGQeFwXD7o2WmRc+nvN63QdApENLzxLnUSyrrVp/OZNRjgqfCXWfH9Rq aP8WOJHZEh50GnJI54yGrJIgePLHXSMvCZXKgUozlcL+WyksxIev/5AYRiRZ4oEw3uFATAfTrW Vr1OQkJo8RlHW4NdC83+0lDEaql+92Jn000XB5DKdjNpUZvQsYJTq/FJv/dh+I/YKg3/T+e4Cy SNkk3nuhWMXN6StB+5MCKVwvakSwxVkVytCaRC0WW37zu8IDq6Ju30cthheHI5iL4cNmbw889i htAN4rJmdPDP+iqlVygomyqg8dAVcng7eooGzZE62qMb7Q==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; s=arckey; t=1789593081; bh=GA43VkbHqER01zDTwAx5YQK+oTAg4fjkEJYtZq+Av3o=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=18jQPi6ztQwu/kalmJ+8sk0vZNUbl8PFlDE3O5dfYi3hfV2bEAhNV6fKqE9ZjoDT6d2mvFlQq7 FiuXM+Jk0k5oN5UZZCC8Ls1oET0JbAQFtwpbYz5r5uOf617o35j8qHQgSGXU/QZ5XIVy3lOset dPe3KYqVr7NycZhWQiR3pByU/NP6kj5trM2qJGsH/fPnnV8MbNMeS/bb4YZ0u7wTo5BOFt+yDb tHF1Eh8UvzRYw3g2BbQlSJHOqAcIVjvCi8YN626kXvXfdHdJFCrwzk93z98TM2cPRtOEN9Fvzn 01Vcb9y/CZUcr7hqSNmAVVE/ca11huaJrANfbLrbZXIuzg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=0bfi//4iBWflpifsqQu1VKkBu2tJTFizXLg4sdBHJQ0=; b=yBJJeQKv0OjJrRtQktoRbRcIkx 6ja3RP8GhJZFL4+5r8g4wg7d1hk7SHAWEfzdnrxzZ7OrDRsw1/F4QHzDtcHUHfZqkrAUBFZ6/swZk W8cAZ/+JX5cuKB3kxTll/vW9nAdxyBRaYbfYlygODQaIsGnSnttUj9ubdWEw9r7AqMVc=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-f940.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuK-00000002DM4-0DWY; Wed, 16 Sep 2026 21:11:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=0bfi//4iBWflpifsqQu1VKkBu2tJTFizXLg4sdBHJQ0=; b=DF7q3DU5LJeHMMSDvxyO4rrxqW qWIJk0NYo14ZmYU2P9BItxIUY8RzG74/+He5UXGD5TLl4ACrA4C3gPumz/6Qd6OkYzpZxux31EAJe okiQCQ9cLa0eBFsEHDNyLCqWbqjF4gWzSGpfws9bJfsQIO6WsoEy8oSyY0Od73o7Ovyk=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuE-0000000058P-3bHV; Wed, 16 Sep 2026 21:11:02 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:46 +0200 Subject: [PATCH RFC 01/12] remoteproc: virtio: cleanup rproc_add_virtio_dev error path Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-1-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2153; i=francesco@valla.it; h=from:subject:message-id; bh=GA43VkbHqER01zDTwAx5YQK+oTAg4fjkEJYtZq+Av3o=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWR8ft9qsOP/6zc0mqevMn+124n6Yp8jQ/WWyXeyha 9Zb9s481FHKwiDGxSArpsgSsu7GvT1zzb+lbWB8BDOHlQlkCAMXpwBMxCCAkWGuxe+LPYcj5DpF F9gUGx7g2BFwMZmnVvqU2R2Nr1cusr9k+F9vfUM6/Nec806yHg8PmRe/Wqz192+OE3te+WPJ61v zNjIAAA== X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 89108c4e8dbae417962750fde4f5f287 X-AntiAbuse: ID - 89108c4e8dbae417962750fde4f5f287 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6wuK-00000002DM4-0DWY-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none There is no cleanup to perform in case an error occurs inside rproc_add_virtio_dev, so remove the goto label and just return in such cases. Signed-off-by: Francesco Valla --- drivers/remoteproc/remoteproc_virtio.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/re= moteproc_virtio.c index d5e9ff045a28..096bcba527c1 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -376,9 +376,8 @@ static int rproc_add_virtio_dev(struct rproc_vdev *rvde= v, int id) int ret; =20 if (rproc->ops->kick =3D=3D NULL) { - ret =3D -EINVAL; dev_err(dev, ".kick method not defined for %s\n", rproc->name); - goto out; + return -EINVAL; } =20 /* Try to find dedicated vdev buffer carveout */ @@ -394,7 +393,7 @@ static int rproc_add_virtio_dev(struct rproc_vdev *rvde= v, int id) mem->of_resm_idx); if (ret) { dev_err(dev, "Can't associate reserved memory\n"); - goto out; + return ret; } } else { if (mem->va) { @@ -412,7 +411,7 @@ static int rproc_add_virtio_dev(struct rproc_vdev *rvde= v, int id) mem->len); if (ret < 0) { dev_err(dev, "Failed to associate buffer\n"); - goto out; + return ret; } } } else { @@ -431,11 +430,10 @@ static int rproc_add_virtio_dev(struct rproc_vdev *rv= dev, int id) =20 /* Allocate virtio device */ vdev =3D kzalloc_obj(*vdev); - if (!vdev) { - ret =3D -ENOMEM; - goto out; - } - vdev->id.device =3D id, + if (!vdev) + return -ENOMEM; + + vdev->id.device =3D id, vdev->config =3D &rproc_virtio_config_ops, vdev->dev.parent =3D dev; vdev->dev.release =3D rproc_virtio_dev_release; @@ -447,13 +445,12 @@ static int rproc_add_virtio_dev(struct rproc_vdev *rv= dev, int id) if (ret) { put_device(&vdev->dev); dev_err(dev, "failed to register vdev: %d\n", ret); - goto out; + return ret; } =20 dev_info(dev, "registered %s (type %d)\n", dev_name(&vdev->dev), id); =20 -out: - return ret; + return 0; } =20 /** --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AAA74E1C9E; Wed, 16 Sep 2026 21:11:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.9 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593098; cv=pass; b=RxB/CN2O/FoFx8syYWYLP6KzuyRdxfJUz33U2qWc0eHdc6DXy0LMRDALhvmt9+iu3pdFzR7tgV47Upb40IFx1Y5lQ0+pnslgcszIYywJSnEBJxC4S9oTYlYEGKHrmyaMIgtYz9yzzjwYI/AQH0Db/NGXbzWaMlQDxli89Ae72Hc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593098; c=relaxed/simple; bh=4K/BQ7Jjv90QPg7ueeHHowYL8JOzF3baJD8cfzWYIS8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HPZEJN9SmDjZuw+FY1adhB4LsbC1mAzax3J37P9h63A5G4kjTZYsfTSF04IhL1Q0ZEP6iY9p0s5aWm9sBB9tyTFwxqkopJmixYLg8u6NzIwMOdtzXGMaVkzX63+0ku3m2UMdJV1yrYb6AELSNu6bkT3nojARIOufjV1Jfq5UXrs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=ulbYDMpg; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=c4PgO7sr; arc=pass smtp.client-ip=185.56.87.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="ulbYDMpg"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="c4PgO7sr" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; s=arckey; t=1789593083; b=XOCeX2ovEEY/W6Ckm3codtTCi2zsswKAsirV6mDYreHxZftIXJ+yiL/U2JWd3fqWVsuCHoWQg8 YSDUFM/Gt6lhJ7a+TDtDadgUPXhfCconwUfdNV75fCnf90YZMGU6MJia/E/SPdMWAccWedCAaC lEpwiVRnWZcXf3ThvrjhhG9KIq4yCnf1pK/j3MivtRO/85sF2apntwjqPcr9GAMq6snWFuX+iB DR2VK5qvsHNdGf2RGgd2s09tw2O/cRX1pWB+299B5HuTOkC094GBC3/xYt81HnT7F1KCZ7jBw2 jVWaPJk7HYjEtGME4aj51aD2afWDhwYU/IRruaGUGg2scA==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; s=arckey; t=1789593083; bh=4K/BQ7Jjv90QPg7ueeHHowYL8JOzF3baJD8cfzWYIS8=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=Cqy5Q2UGLgReN7SgJY4SnE6CQmd/6lFj0NaZ7xvnCR8GFuHfFNTnldNqx3dsxOvC+VcI2WihYz ueDHiTpNBCPmSy89HQHGEhU/l6nE+23NiGJTEdR8Dg+kRkIh6JsV88X7N10JJMX9sq1MzbTfHx NPMth0L3JtUQLc90f5XT2XM5WO634SgJOGp0RvZ+Ggb8CLK6vMWHOZN2zJz4sWnQzFxeg3TqzI r3HHJcBooa2Sg8GtVV/mIOjPLKgIJVL9VwBM6yAelCX1f8Qoi9YIc7iEqWZOxN/8z5/56tPbVb rHATipXPXMz/Fj03KoIcHR5mWLXhxz1tLgL1yynM/iAAdQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=JyasnvLYTK4E6U/h+Yqi9jiKL9ObrEvgOlp1gRjyPL8=; b=ulbYDMpgOlYGm+WXUJfu0lrUTU u8CfrRGXw+KSF81ZhODISHK1S2ZcnBUVtKL4YVKJpQ9ZBnOex9Olyjpx8FsW4a1uih7h4oytsfb8z ctDeH+XoV22yqLfQpT42snGDlEMnkGpBbERwzobtyNLS/gFqjmqM0yBd84qW9U1v+lF4=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuL-0000000BhgR-0qSD; Wed, 16 Sep 2026 21:11:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=JyasnvLYTK4E6U/h+Yqi9jiKL9ObrEvgOlp1gRjyPL8=; b=c4PgO7sraeZ6twB3Jr8Upwq0PK B2/pfEbBD85NwmHY2I4Upi28D1wuDMVDanGe/epoqjgEnx47pUUTnYLPnMR2byLBKXDyQY5S6LD+j DFBlfJPm0j00PG/wuV7P+OSnCFRfyeP1kB/PWJvKlaoyWgjOPjc5ii+zcjml9SWXgCEI=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuG-0000000058P-19pe; Wed, 16 Sep 2026 21:11:04 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:47 +0200 Subject: [PATCH RFC 02/12] remoteproc: virtio: replace commas with semicolons Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-2-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=899; i=francesco@valla.it; h=from:subject:message-id; bh=4K/BQ7Jjv90QPg7ueeHHowYL8JOzF3baJD8cfzWYIS8=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWR/rnMl8vO3aGtb6y/OEn2rxdJzzM7exMKm6tXLxC bm+JRlhHaUsDGJcDLJiiiwh627c2zPX/FvaBsZHMHNYmUCGMHBxCsBErhQz/E/gOxz30inzhpvu q8gfmlN569/ayrydfez+gmuS1/9uYD/H8L/+VLqCLMOmo7ota6dJelz//NBa0FQqtCDXx/c869Y 9NzkB X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 94914b4df39ecb6c3d772bb91eb71bc3 X-AntiAbuse: ID - 94914b4df39ecb6c3d772bb91eb71bc3 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6wuL-0000000BhgR-0qSD-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none While not technically wrong, the comma at the end of an assignment directive can lead to nasty bugs. Just replace the two occurrences with semicolons. Signed-off-by: Francesco Valla --- drivers/remoteproc/remoteproc_virtio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/re= moteproc_virtio.c index 096bcba527c1..4dacd93bf238 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -433,8 +433,8 @@ static int rproc_add_virtio_dev(struct rproc_vdev *rvde= v, int id) if (!vdev) return -ENOMEM; =20 - vdev->id.device =3D id, - vdev->config =3D &rproc_virtio_config_ops, + vdev->id.device =3D id; + vdev->config =3D &rproc_virtio_config_ops; vdev->dev.parent =3D dev; vdev->dev.release =3D rproc_virtio_dev_release; =20 --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CE7B4E2F27; Wed, 16 Sep 2026 21:11:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593087; cv=pass; b=C5xpn1eQz3i5y5tyVwEKyz2adfa9iiAnMM5uhchIKUWIwb+HIkjGGmTC9CF5yCETUmU5UAmAsGXlsrhkJrquZx/99j64dsOuQBFCGX7WxxLqzXOcHLoztMC+M5MXBNn8U4iBE0Rer/pPdrOxCV1Oz4QwBMvYW+X/GW+Dknghy/8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593087; c=relaxed/simple; bh=fnFloY2yfdzMxpk0tNVPh+UipC6nyWvGoOUQ3l9T4yA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YNvLuaFCeTqDIoKUM7su06spvHZBf/5zR0eL+dXWWy+prEM4z3nXvEim6LCmfpQ5kZrqVjpSutCewixIZisnkEwegKQBYmrPD4dMECGfpb7bkWc0Rnu+JS1BSzn9tR/p/wZgnhtAQy61TrdXI9GzepG9asP2T61AfEN5+n34m10= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=DZ25Pt/A; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=KY/vlcqN; arc=pass smtp.client-ip=185.56.87.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="DZ25Pt/A"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="KY/vlcqN" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; s=arckey; t=1789593083; b=NvA4A0KVjjTBPWLFobsIqZhSjn8ZD1aG2RozPCj31CCwd3zq8ZE4x7W1Iu+OTJur0lY0eHKTO+ bpAvY2RDfH4l0qLlZlLjgq1FiBy5Gz7bwF3KO1RqPNxNVWZfe4IEORLuthWLN7AVj2Rlf9SNBg R2+O2NrNmNxHOXzBIwcldCJn/LFtS2TA1wZgNdduS/JZQRT1fOnGISq7BRIHtF8YpXftSaH2dl 26i01VjVoRXYR8mHD2r0YC0D1LJKQNjM+zMkIUhzmg+M/WhSEa8spHSJSzHpYVGHWcrhWfE1Pv yTpQ3QEcOU7fc5K8bQp08OTAq/99mLh1QQ7TCa/kYjEehg==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; s=arckey; t=1789593083; bh=fnFloY2yfdzMxpk0tNVPh+UipC6nyWvGoOUQ3l9T4yA=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=xr5r5N+fDO4Zr5QFaSBjyYBjjvAR4y3PECGfZYSws9EpBpp01xQwN/GB89PftG8BWz/zK6Dl6s zA538iS8feWNa+QmZ0poW/il1XtVZRXxoUOk63FI+V27G7cNwJxlWRLdjvvkI2XvHcX4HjRBO5 HDXksIni6qnyad+mxh06HnwFSMvBzs2MycY9pySiEAkJ+lkzoRGHbvzBG2/kAe4JQe86HGMEl2 evSDLkfZ8reKe+lrgEz1f6YYXez2Vs4AUCmbBappfcXnwP2mkQH5JqEjyDoa9EAdWGADl3VEsu ONAXZUiAMPQUY9dGDQwf1lJOxQLmTX5Ugajfye2i2rSasg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=GCEMx2gqALfiJ0dobbqXt450/zYKugDTTzi6P0ffmes=; b=DZ25Pt/AV+mI1ygSglg1oEUkR6 iK4mcIprJnv8siPOMFg8zjDwK/8SUWC+cewh2JvSXpWX5HPPvWfFzjrgsVZHHEYfejENV7xAwweeo 5KsFiwv/U47nVbcNbe2evMQ8vu468hZMMPSRKqdM1seRmVGF8IdKsHn4SIixJbFxqj/k=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuM-0000000Bhha-3coM; Wed, 16 Sep 2026 21:11:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=GCEMx2gqALfiJ0dobbqXt450/zYKugDTTzi6P0ffmes=; b=KY/vlcqNr5opulrkCK+q2x0Hl8 YCHCWK8ha7HDUHo/1vbTpZUhoG/7lJqyafCnnhol0f4i+IyQmJrsaKFo39vdxSL9zBE5DrOru8daR xy2kKyzhyciyp9se4X+yTnnkVti/XP5BMb2nVe1+cKrHExO2lJm/eVvGe+hLUEjyHV5M=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuH-0000000058P-2R0w; Wed, 16 Sep 2026 21:11:05 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:48 +0200 Subject: [PATCH RFC 03/12] remoteproc: virtio: support dynamic number of vrings Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-3-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=6080; i=francesco@valla.it; h=from:subject:message-id; bh=fnFloY2yfdzMxpk0tNVPh+UipC6nyWvGoOUQ3l9T4yA=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWR9ziFdNYVv6fsv5j1tuHp1Rc/CT4qvVArMX/Ljy8 b3ex1MRsh2lLAxiXAyyYoosIetu3Nsz1/xb2gbGRzBzWJlAhjBwcQrARE5xMfyVkdqmpjx1f0yj XHDlt6W3/+ZEetkJds7byHSq4ENt5Uwrhr/ietOsC32PPVe8flZ+IQ/v7Udlub+03yrvzvvEfND s6yYmAA== X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 5f95bf34393ae7fee80966784b52de0e X-AntiAbuse: ID - 5f95bf34393ae7fee80966784b52de0e AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6wuM-0000000Bhha-3coM-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none The number of vrings for each vdev has been fixed to 2 since the introduction of multi-vdev support [1]; this is completely fine for the rpmsg usecase, but can conflict with other virtio devices (CAN for example requires 3 virtqueues, entropy only 1, network a variable number and so on). Remove the static vring allocation, transforming it to a flex array that is allocated at vdev probe time; for the existent usecases (i.e.: mainly rpmsg) this leads to no functional change, except the additional memory used for the counter associated to the new array. The maximum number of virtqueues is limited to 256 due to the uint8_t value used inside the resource table to indicate the number of vring to allocate; for this reason, no additional plausibility check is performed on the number of vrings indicated by the resource table. As a side effect, this also fixes the single virtqueue usecase, which was apparently supported also before but for which the remove action caused an error (because the remove action was trying to unmap also the second vring, which was in fact not mapped). [1] https://lore.kernel.org/all/1330589497-4139-5-git-send-email-ohad@wizer= y.com/ Signed-off-by: Francesco Valla --- drivers/remoteproc/remoteproc_core.c | 7 ------- drivers/remoteproc/remoteproc_virtio.c | 21 +++++++++++++-------- include/linux/remoteproc.h | 10 ++++------ 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remo= teproc_core.c index 1ed406714849..b7d9957534bf 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -473,7 +473,6 @@ static int rproc_handle_vdev(struct rproc *rproc, void = *ptr, { struct fw_rsc_vdev *rsc =3D ptr; struct device *dev =3D &rproc->dev; - struct rproc_vdev *rvdev; size_t rsc_size; struct rproc_vdev_data rvdev_data; struct platform_device *pdev; @@ -494,12 +493,6 @@ static int rproc_handle_vdev(struct rproc *rproc, void= *ptr, dev_dbg(dev, "vdev rsc: id %d, dfeatures 0x%x, cfg len %d, %d vrings\n", rsc->id, rsc->dfeatures, rsc->config_len, rsc->num_of_vrings); =20 - /* we currently support only two vrings per rvdev */ - if (rsc->num_of_vrings > ARRAY_SIZE(rvdev->vring)) { - dev_err(dev, "too many vrings: %d\n", rsc->num_of_vrings); - return -EINVAL; - } - rvdev_data.id =3D rsc->id; rvdev_data.index =3D rproc->nb_vdev++; rvdev_data.rsc_offset =3D offset; diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/re= moteproc_virtio.c index 4dacd93bf238..74e0da970f1d 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -115,8 +115,7 @@ static struct virtqueue *rp_find_vq(struct virtio_devic= e *vdev, void *addr; int num, size; =20 - /* we're temporarily limited to two virtqueues per rvdev */ - if (id >=3D ARRAY_SIZE(rvdev->vring)) + if (id >=3D rvdev->num_vrings) return ERR_PTR(-EINVAL); =20 if (!name) @@ -500,17 +499,20 @@ static int rproc_virtio_probe(struct platform_device = *pdev) if (!rvdev_data) return -EINVAL; =20 - rvdev =3D devm_kzalloc(dev, sizeof(*rvdev), GFP_KERNEL); + rsc =3D rvdev_data->rsc; + + rvdev =3D kzalloc_flex(*rvdev, vring, rsc->num_of_vrings); if (!rvdev) return -ENOMEM; =20 rvdev->id =3D rvdev_data->id; rvdev->rproc =3D rproc; rvdev->index =3D rvdev_data->index; + rvdev->num_vrings =3D rsc->num_of_vrings; =20 ret =3D copy_dma_range_map(dev, rproc->dev.parent); if (ret) - return ret; + goto free_rvdev; =20 /* Make device dma capable by inheriting from parent's capabilities */ set_dma_ops(dev, get_dma_ops(rproc->dev.parent)); @@ -524,13 +526,11 @@ static int rproc_virtio_probe(struct platform_device = *pdev) platform_set_drvdata(pdev, rvdev); rvdev->pdev =3D pdev; =20 - rsc =3D rvdev_data->rsc; - /* parse the vrings */ for (i =3D 0; i < rsc->num_of_vrings; i++) { ret =3D rproc_parse_vring(rvdev, rsc, i); if (ret) - return ret; + goto free_rvdev; } =20 /* remember the resource offset*/ @@ -566,6 +566,9 @@ static int rproc_virtio_probe(struct platform_device *p= dev) for (i--; i >=3D 0; i--) rproc_free_vring(&rvdev->vring[i]); =20 +free_rvdev: + kfree(rvdev); + return ret; } =20 @@ -576,7 +579,7 @@ static void rproc_virtio_remove(struct platform_device = *pdev) struct rproc_vring *rvring; int id; =20 - for (id =3D 0; id < ARRAY_SIZE(rvdev->vring); id++) { + for (id =3D 0; id < rvdev->num_vrings; id++) { rvring =3D &rvdev->vring[id]; rproc_free_vring(rvring); } @@ -585,6 +588,8 @@ static void rproc_virtio_remove(struct platform_device = *pdev) rproc_remove_rvdev(rvdev); =20 put_device(&rproc->dev); + + kfree(rvdev); } =20 /* Platform driver */ diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index a44368737b39..c3ba51fe9e54 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -319,10 +319,6 @@ struct rproc_subdev { void (*unprepare)(struct rproc_subdev *subdev); }; =20 -/* we currently support only two vrings per rvdev */ - -#define RVDEV_NUM_VRINGS 2 - /** * struct rproc_vring - remoteproc vring state * @va: virtual address @@ -350,9 +346,10 @@ struct rproc_vring { * @id: virtio device id (as in virtio_ids.h) * @node: list node * @rproc: the rproc handle - * @vring: the vrings for this vdev * @rsc_offset: offset of the vdev's resource entry * @index: vdev position versus other vdev declared in resource table + * @num_vrings: the number of vrings for this vdev + * @vring: the vrings for this vdev */ struct rproc_vdev { struct rproc_subdev subdev; @@ -361,9 +358,10 @@ struct rproc_vdev { unsigned int id; struct list_head node; struct rproc *rproc; - struct rproc_vring vring[RVDEV_NUM_VRINGS]; u32 rsc_offset; u32 index; + unsigned int num_vrings; + struct rproc_vring vring[] __counted_by(num_vrings); }; =20 struct rproc *rproc_get_by_phandle(phandle phandle); --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8CFD4EC674; Wed, 16 Sep 2026 21:11:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.6 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593111; cv=pass; b=OZ6VX/XZiCcVCcf9V7OPp1zPUgoTgVhMFZAVi5eaEZAChDsRyqH4DZB598NWHHroYCIhEfTDPesKdNDhnEaiJhu0cTrSyoc+QGVfJ/tJIHb7IV4/OOcP2pvEpN+w15cMkY4NEmniQUak/3qPV2SC4raKBXoIr7VoXXb7x6jsc0U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593111; c=relaxed/simple; bh=K0aajd5pS48LBp4SgsLFJE8s+5HK9UUUoA1f8WnnLLQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JIqRnKqxKfUiawzpTMbJ7uHMTvvGwpLhDQBUNd1phe4xE1I5T9lORkjdvwgMhSt9jTECOSgMzX75AcMpb/itO1i85x/4wpWr+F91e5mP6S43eyiWZdDbWF60j5T9uyFFb874pPwsQxySd6EpOmlinaMFdR7cmjch4OCQ8nf3n0Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=BY5ZbPg+; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=lImYJULP; arc=pass smtp.client-ip=185.56.87.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="BY5ZbPg+"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="lImYJULP" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com; s=arckey; t=1789593098; b=feb2YylhCxflxfHL4zJUPGWsAuqITYc8PQFrzmRVCZo42htZgc2JM2+RAg8XlDUvDWJ0oHI9b+ DvKsPjuFtxhXvfNfAphLPXo1KTh7lWqkpoPIGnd2l6EAJAxZfMKFhuUqOJmgZb61AvPBE4ibRN Cb80g3UV4G7Vfj8MnXyoYz/O2St9P6gcyXvP0j5TXwUh3zw9qlQuUWWmin9JKBlD6lFWtadvL5 3zzrqM6u8wMlLuzxZGkvC+Jo2qdPIVBL30jKI3cy3jWnHrxFlRHAw2lpApey5ADfCXrER6joJs zBniqql88qacNPON2ZszZuj6JLntiXye/ys/wbC4h/YL5A==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com; s=arckey; t=1789593098; bh=K0aajd5pS48LBp4SgsLFJE8s+5HK9UUUoA1f8WnnLLQ=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=K/PiTzZtGab0XhCJ1LJm+KVRrX2KFNJWkCrn7dbsz11dWQK00SJupoHZA3vt2scYFmyl/Ta/en yZd1jj0ent7zaQECO63O1h8LlDa50BewhbdfDhZJATnQj0EwKTdeAA5iVvTpYwUQ3KYD7LZnXB DS5wVPG6rFLk8RTm16+L2cNh1F33vq5ADoeFFqo/NkshSkGG9YLNkDSdeCzGmgoUc0uKjWN+3R O1eA5C1Ypz2s9rdrlr/og3bbilkQwvdxUzZBKiEyYaYdnq+LNSZNkTvEwvCUTBkIrPaDJZ7lh1 oC+/SNXGwxUjc6oXlUBFfnob0K0cVCVAHueSgpuNwUxddA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=O4gn2eTg00df8U5IdZkWMPepVAvVYYSdUxbjRaptMcA=; b=BY5ZbPg+N+UZ5lsM6FO/0lhCxC fARMu0iAtscpSTEBhsa9zSnUkxrbrk890SbCLDAruhDP1oqt1wA2Ne5RT/bFMZyxwUSu7hvbuFqSf 30upfBs+mjt3W53iEqRelOKW/uFN0xt1dO5poBkOtfdBnttshy8IQbzNro2JsE4D9Qns=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuP-00000003Kvc-00EC; Wed, 16 Sep 2026 21:11:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=O4gn2eTg00df8U5IdZkWMPepVAvVYYSdUxbjRaptMcA=; b=lImYJULP606lAusNp0RIZVHM1H X+2IhcV4MWT1bJsGzKtI6WJJNy9MnK5IlHFu4gvLWCNpMW7byY+jYFgfU/ypI9MVic7iE/igZni1E Jy/VMKdw1Y4sewlhk9/OeFOlhmtjCVAYNM4k9l/e4pj2JKzUS//mokZnbxTh81JlMFoU=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuJ-0000000058P-1cbZ; Wed, 16 Sep 2026 21:11:07 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:49 +0200 Subject: [PATCH RFC 04/12] dma-coherent: add base and size APIs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-4-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=3008; i=francesco@valla.it; h=from:subject:message-id; bh=K0aajd5pS48LBp4SgsLFJE8s+5HK9UUUoA1f8WnnLLQ=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWR+3z9Go39bW/vGDvNcGNdnFXRt/XjNkVr17dU37w 8NRCW+NOkpZGMS4GGTFFFlC1t24t2eu+be0DYyPYOawMoEMYeDiFICJvOFk+CvPM9lq7Raf75ci 0k5+zblju7Lzf0v+/oi3C5ts/SekLqxl+CuzM//dPn65SDWJBx+kt8RvlDYztNkjHfP0fE9q2jf 53zwA X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: e82391f0703d67c533c19bc641d73329 X-AntiAbuse: ID - e82391f0703d67c533c19bc641d73329 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6wuP-00000003Kvc-00EC-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none Add two new APIs for the dma coherent memory to get the base and size of the pool associated to a device. Signed-off-by: Francesco Valla --- include/linux/dma-map-ops.h | 10 ++++++++++ kernel/dma/coherent.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h index 8fae2b7deb20..580b69321d56 100644 --- a/include/linux/dma-map-ops.h +++ b/include/linux/dma-map-ops.h @@ -156,6 +156,8 @@ int dma_alloc_from_dev_coherent(struct device *dev, ssi= ze_t size, int dma_release_from_dev_coherent(struct device *dev, int order, void *vad= dr); int dma_mmap_from_dev_coherent(struct device *dev, struct vm_area_struct *= vma, void *cpu_addr, size_t size, int *ret); +size_t dma_dev_coherent_size(struct device *dev); +dma_addr_t dma_dev_coherent_base(struct device *dev); #else static inline int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, dma_addr_t device_addr, size_t size) @@ -167,6 +169,14 @@ static inline int dma_declare_coherent_memory(struct d= evice *dev, #define dma_release_from_dev_coherent(dev, order, vaddr) (0) #define dma_mmap_from_dev_coherent(dev, vma, vaddr, order, ret) (0) static inline void dma_release_coherent_memory(struct device *dev) { } +static inline size_t dma_dev_coherent_size(struct device *dev) +{ + return 0; +} +static inline dma_addr_t dma_dev_coherent_base(struct device *dev) +{ + return DMA_MAPPING_ERROR; +} #endif /* CONFIG_DMA_DECLARE_COHERENT */ =20 #ifdef CONFIG_DMA_GLOBAL_POOL diff --git a/kernel/dma/coherent.c b/kernel/dma/coherent.c index 45bbae947f4b..f4aa5813604b 100644 --- a/kernel/dma/coherent.c +++ b/kernel/dma/coherent.c @@ -277,6 +277,40 @@ int dma_mmap_from_dev_coherent(struct device *dev, str= uct vm_area_struct *vma, return __dma_mmap_from_coherent(mem, vma, vaddr, size, ret); } =20 +/** + * dma_dev_coherent_size() - total size of the device coherent pool + * @dev: device from which we allocate memory + * + * Returns the total size of the coherent memory pool associated to the gi= ven + * device, or 0 in case of no pool. + */ +size_t dma_dev_coherent_size(struct device *dev) +{ + struct dma_coherent_mem *mem =3D dev_get_coherent_memory(dev); + + if (!mem) + return 0; + + return (mem->size << PAGE_SHIFT); +} + +/** + * dma_dev_coherent_base() - base address of the device coherent pool + * @dev: device from which we allocate memory + * + * Returns the base address of the coherent memory pool associated with the + * device, or DMA_MAPPING_ERROR in case of no pool. + */ +dma_addr_t dma_dev_coherent_base(struct device *dev) +{ + struct dma_coherent_mem *mem =3D dev_get_coherent_memory(dev); + + if (!mem) + return DMA_MAPPING_ERROR; + + return dma_get_device_base(dev, mem); +} + #ifdef CONFIG_DMA_GLOBAL_POOL static struct dma_coherent_mem *dma_coherent_default_memory __ro_after_ini= t; =20 --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 889B04E2F1F; Wed, 16 Sep 2026 21:11:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.10 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593110; cv=pass; b=SynXiVP/WS8OPjsCDok2lPS/P6IVmtACSqLiZXEPZZgVoBK8NfMwI6NRLvn1ydsLH3IexukipcreiFQeX65tn4ylcHdppVdjWwXfygwEmsNnWKv5DaRtGrml4qYHxmxWviENtBmAvpuNrf3k86CTxKPkcpM7d4rR6in/0KoM49k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593110; c=relaxed/simple; bh=gf3EQAJ4VfBmxjFUqtfvGealL0LGSZYcwzq8jUweQJY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JNHRGt7TePdwT0NX10tEOPhboi+ckS9Goh/nxi683Eh3t0vXGIEtekPcNg/bKOAHS1hCgf6H7k5FHIvwwPhPjM0UeO+QioHTiXXv9rVsNvHr6c7ujKKX3h/4MdnQssRGWyOXiMcKpbSxETiLkv0Yqka9IZpPUKM1eD28Buveijo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=1uQLTHJz; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=UX2aPUx3; arc=pass smtp.client-ip=185.56.87.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="1uQLTHJz"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="UX2aPUx3" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; s=arckey; t=1789593085; b=Koh/wwVzubK6BglrKnQEkbowfe9OJqFsJp900ogpZ+X5Kn/TML/CRrtnTmv3krbzgayaD1aE42 IoPfTYCNXD87WnK+vqhGWyJvpoIZBibhr7HympOGih4SWnPHDqstrXmiXr4BlYy8obk7M8QDvW lR+ZRknvdd6kUh/tYUCfOKJWalFbQPm+xjKm9U9w1Lqb9mSkEAAUKwaNaNG+/VR7Z4+Ys6PUhq DI9P06EsC5B3XJiQgq10crHXQjZ7hJziyzmoC5x/TIqJTn79A67ERKQuYTpbbBhnsAI46Xsaef kEQlBGVNEHwVjO8XWCFzSUwhqwvLr4StCRXKd4+5elugGQ==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; s=arckey; t=1789593085; bh=gf3EQAJ4VfBmxjFUqtfvGealL0LGSZYcwzq8jUweQJY=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=qzuaK7F8TVHSbc9j/AKMWV/amq4l1yvopQ65wDdTTwT2yldIau/nzbFmNlZO+KeYoyvUt5WHE5 W3V8yFFiiNmLVTk+WHwhNepdekClSgVuIrOsW0YXRfm1QhbNK5HF6RgUgS5vuduMcIgQfVmQtd w1W7QN4U72pFKWljY4u4YiUIbKw0rWjqqZLUkR6j3WOssVyHh/O3THdMiwRH7iWaCnBmQjHQj/ 1nGuGRHPxp+efx3aJ80QWXihAE5wuZLV3ylFM5SpdlbGr1TGybNryowOlmn9TdopbI6iECzxKS rpWSu970NvOuFapoOgHxwEOX3vm6fyGSHXT9eDN+bUpu2w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=4v98lwch7T5H/ou+qD354RhYPj13iFINK/7BGkYYthQ=; b=1uQLTHJzSOIPYTTeHKJgbmfaQf d9vnc2tABwSCEdbIHHa1FJnAP/CNdC3NsqMG3fMCVo4dgCUFSp0PxCK8apYx03FjcH8P5q/Jg7ZgE yMVWX3PWcdsaSqze79G9W7pUqur564Qd+79pyRfvtM+lKRts2BnfvnLun7TIprwIdL48=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuQ-00000009s6g-0N09; Wed, 16 Sep 2026 21:11:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=4v98lwch7T5H/ou+qD354RhYPj13iFINK/7BGkYYthQ=; b=UX2aPUx3q6a3d2PqiqvbhB34cD pFGpJtQIvSaG8lyEhGEYFH9jVXavg9I1QynXUN8Hyv9l/V9G16u/Z7vn1i9YWxlNfYy29qFL2PT6u YK7I9EVRr0FheZTAU97Rgq6ghBm9M2U0K4y3DJQVC+cYBmomxoO8stx84dVqSjJdSL7I=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuL-0000000058P-08T9; Wed, 16 Sep 2026 21:11:09 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:50 +0200 Subject: [PATCH RFC 05/12] remoteproc: always report VIRTIO_F_VERSION_1 feature Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-5-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1768; i=francesco@valla.it; h=from:subject:message-id; bh=gf3EQAJ4VfBmxjFUqtfvGealL0LGSZYcwzq8jUweQJY=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWR/vWa6u3bL7gcDtjYayjBmN07c8S/E4NHeLvPJpJ 12xa08WdZSyMIhxMciKKbKErLtxb89c829pGxgfwcxhZQIZwsDFKQATuXiF4X+Yd+yHlK5n0pk3 v3/ZdKJo0srTy+MP2Kbbu5jfMky40vmT4b+H2LI6W1nn9IMd3nyP1oeV7d0S2/loR0IJ25zwmWc +evMBAA== X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: c1541583f6963a518eab82dd16ef49b9 X-AntiAbuse: ID - c1541583f6963a518eab82dd16ef49b9 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6wuQ-00000009s6g-0N09-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none There is currently no way to report the VIRTIO_F_VERSION_1 using the resource table alone, as the per-vdev feature array is limited to 32 bits. Considering that the VirtIO 1.0 specification is now ~10 years old, always report the VIRTIO_F_VERSION_1 feature, as some drivers depend on it. Signed-off-by: Francesco Valla --- drivers/remoteproc/remoteproc_virtio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/re= moteproc_virtio.c index 74e0da970f1d..cfd66d9d1c9e 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -249,7 +249,7 @@ static u64 rproc_virtio_get_features(struct virtio_devi= ce *vdev) =20 rsc =3D (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset; =20 - return rsc->dfeatures; + return rsc->dfeatures | (1ULL << VIRTIO_F_VERSION_1); } =20 static void rproc_transport_features(struct virtio_device *vdev) @@ -275,14 +275,16 @@ static int rproc_virtio_finalize_features(struct virt= io_device *vdev) /* Give virtio_rproc a chance to accept features. */ rproc_transport_features(vdev); =20 - /* Make sure we don't have any features > 32 bits! */ - BUG_ON((u32)vdev->features !=3D vdev->features); + /* Make sure we don't have any features > 32 bits except VIRTIO_F_VERSION= _1 */ + if (WARN_ON_ONCE((u32)vdev->features !=3D + (vdev->features & ~(1ULL << VIRTIO_F_VERSION_1)))) + return -1; =20 /* * Remember the finalized features of our vdev, and provide it * to the remote processor once it is powered on. */ - rsc->gfeatures =3D vdev->features; + rsc->gfeatures =3D vdev->features & ~(1ULL << VIRTIO_F_VERSION_1); =20 return 0; } --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 168A52248A5; Wed, 16 Sep 2026 21:11:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.5 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593106; cv=pass; b=mG+j/hdAstDIIKLazxPc9kzbhpwzeFJ/bHdabDpp1m/+hDDRQmh9n1T/ZWMjZqELGl/MEZgYHjFJgXJ4z83RkkMYjkkJkeO7AUQMWrYLpSuaL+gGc5KBYViJ4QRSJ0y7sn4qFWda/qbktzbopXO4LLCph89P6IxYHmE6rDt4+k0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593106; c=relaxed/simple; bh=EM4cT5DF36wycIZJ99PdoUjz8wtAbUGcA4G0bW53vug=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sKI+uNbuGCoVnXgVe4H7DQiOJ+ykR0YzfhYvZpbGzEpUo3MhVkVXxUYe7A0kjyeGZokwtL1mxu2e25RKnqa1Q2o0jP7a1PZsb3bMQw18HqwjNxk89A+lICV+hMa2K0I5A7R0ENJTDklhErXFj+oDxcH0a2G1N5M6D23eM0qD9hA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=1z6Td2Lv; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=kYT+VEN/; arc=pass smtp.client-ip=185.56.87.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="1z6Td2Lv"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="kYT+VEN/" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; s=arckey; t=1789593100; b=PFCvM9qC1ufZkHdmpZYb8tRXNFS1nYnvht1Zig1t8n1CHoygQJuRTlBgDkorcDab0pyyet0Jly OvCqqY2NNhVqerEOCjWGsjBx7fCnJH5w4dTk55x0Hjy7xFMI7DR3/iPCFkWF62uvxHBVkg1EhT BA3u6LFq6DXX1ShkVFJgy/QJ+as+VKFy5DxLvhNzirbmHwNRSPVl7ynjNUul2yxjc0nj3RISoJ 0SrtrBccFlj5yeFTtTNVGC33jK/ngOyILYjs56QuHKIeppACjOBUeUgFbIfh7q1l+jrTGE4Olt 5HRg1OeXf0i0L3TGjjZF1VPm74tC1LVNggojpZemHgQVpQ==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; s=arckey; t=1789593100; bh=EM4cT5DF36wycIZJ99PdoUjz8wtAbUGcA4G0bW53vug=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=Zv+EgTUOTXW1IgvD99FR7+3MS0G+0K5qZYuFF6DnlnPoFZ6zv7DhO24rImhPQHLVb5MGmWWlPW Fgxc683AiSZ+66mBeiCn3lwAheM8Vmr04Inkjfh5L3v8TL7XfyvNCHlvSlFe1COIQxNi46bWs5 VYCJQSQ3f9Ab04NWqRBWPsRTH3zys063Wt7w1E+enlO73PsVfE+N4FonFUsDI/wDA6KcGlElMu tAZiqfQnKa2m4zK4uJSUXL14bpdaGsvnftD7K0M5MwigM5GjF3R7KGMO6JJPgQgjTvmG4TLjCv 8K4CbRDnbzJMJHQb+XHIKcOmDp9GnPRX0tdMi4PD+LJtmA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=56iSjO7FRXuM+w7Fs70EXqmyAa954nz93o1jUYoMU2o=; b=1z6Td2LvoYEGLSiImeX9RCWQxg /xFWVH9eDXbJO/wkIdMNTjUiVKcoXFn6yTdrw/YYFLSwwypDdRiXvK9fRT8JVDyqFLt/pPRAxeAHD QupXPLdloAji1RTxO4heYCicrjwH2SboqU9MmZUs25C2BHKsArCcPeCR6eFFuLtHNi+E=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuR-0000000Bhli-2mLA; Wed, 16 Sep 2026 21:11:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=56iSjO7FRXuM+w7Fs70EXqmyAa954nz93o1jUYoMU2o=; b=kYT+VEN/4dxyq6uhh/D+wBnDGu eKblrwstxuw51BXNgrbDMo3IZOFp7F93C/GpxEXToL0ykKtlIWQ3kKoxqeNga1GgNRg1SshuCAiEg 2UknAcyr10AHBEzqBsqH387OYyzVfs4gRPGpzBDHdqy008sMN3x2vDyxyKeA7AONvgWo=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuM-0000000058P-1hov; Wed, 16 Sep 2026 21:11:10 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:51 +0200 Subject: [PATCH RFC 06/12] remoteproc: virtio: add bounce buffering for data buffers Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-6-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=10534; i=francesco@valla.it; h=from:subject:message-id; bh=EM4cT5DF36wycIZJ99PdoUjz8wtAbUGcA4G0bW53vug=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWZ80fxX1OfHdb/rc5atC+b4/2dRvX244b1ZUklvQo fdxa1pkO0pZGMS4GGTFFFlC1t24t2eu+be0DYyPYOawMoEMYeDiFICJ6L1mZOiv+8da+2pdae+H 840f8u0No2/PX/dx4eu31wufzV4vaHWLkeHE9evbHXq77szWtblybzbHLs+b8sdLxCPZ+w+KvDi 5s4ADAA== X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 3cf50df16a578e64bc863f63e073fcfd X-AntiAbuse: ID - 3cf50df16a578e64bc863f63e073fcfd AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6wuR-0000000Bhli-2mLA-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-h0bm.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none Depending on the driver originating them, data buffers used for virtio communication can either: - already be allocated from the coherent memory area that is accessible by the remote processor; this is the case of rpmsg and the rproc flavor of virtio-console; - be allocated from generic kmem, and thus not accessible directly by the remote processor. Exploiting the map operations, which are used by the virtio framework when VIRTIO_F_ACCESS_PLATFORM is part of a vdev's feature flags, add bounce buffering for the second case: when the map() callback is called for a buffer, one or more pages of coherent memory are allocated and data is copied to them, then they are exposed to the remote processor; the data is then bounced back on unmap(). The first case is not impacted, since buffers already suitable for remote transmission are passed through. With the bounce buffering in place, any kind of virtio device can be supported through the remoteproc-virtio transport, at least from a data exchange standpoint. Signed-off-by: Francesco Valla --- drivers/remoteproc/remoteproc_virtio.c | 182 +++++++++++++++++++++++++++++= ++-- include/linux/remoteproc.h | 14 +++ 2 files changed, 190 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/re= moteproc_virtio.c index cfd66d9d1c9e..d21b3b8044df 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -241,7 +241,14 @@ static void rproc_virtio_reset(struct virtio_device *v= dev) dev_dbg(&vdev->dev, "reset !\n"); } =20 -/* provide the vdev features as retrieved from the firmware */ +/* Provide the vdev features as retrieved from the firmware, plus the foll= owing + * additional ones: + * - VIRTIO_F_VERSION_1 that is required by some non-rpmsg virtio devices + * - VIRTIO_F_ACCESS_PLATFORM to force usage of the map operations + */ +#define RPROC_VIRTIO_STATIC_FEATURES \ + ((1ULL << VIRTIO_F_VERSION_1) | (1ULL << VIRTIO_F_ACCESS_PLATFORM)) + static u64 rproc_virtio_get_features(struct virtio_device *vdev) { struct rproc_vdev *rvdev =3D vdev_to_rvdev(vdev); @@ -249,7 +256,7 @@ static u64 rproc_virtio_get_features(struct virtio_devi= ce *vdev) =20 rsc =3D (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset; =20 - return rsc->dfeatures | (1ULL << VIRTIO_F_VERSION_1); + return rsc->dfeatures | RPROC_VIRTIO_STATIC_FEATURES; } =20 static void rproc_transport_features(struct virtio_device *vdev) @@ -275,16 +282,16 @@ static int rproc_virtio_finalize_features(struct virt= io_device *vdev) /* Give virtio_rproc a chance to accept features. */ rproc_transport_features(vdev); =20 - /* Make sure we don't have any features > 32 bits except VIRTIO_F_VERSION= _1 */ + /* Make sure we don't have any features > 32 bits */ if (WARN_ON_ONCE((u32)vdev->features !=3D - (vdev->features & ~(1ULL << VIRTIO_F_VERSION_1)))) + (vdev->features & ~RPROC_VIRTIO_STATIC_FEATURES))) return -1; =20 /* * Remember the finalized features of our vdev, and provide it * to the remote processor once it is powered on. */ - rsc->gfeatures =3D vdev->features & ~(1ULL << VIRTIO_F_VERSION_1); + rsc->gfeatures =3D vdev->features & ~RPROC_VIRTIO_STATIC_FEATURES; =20 return 0; } @@ -337,6 +344,151 @@ static const struct virtio_config_ops rproc_virtio_co= nfig_ops =3D { .set =3D rproc_virtio_set, }; =20 +static inline unsigned int rproc_virtio_bounce_slot(struct device *dma_dev, + dma_addr_t dma_handle) +{ + const dma_addr_t dma_base =3D dma_dev_coherent_base(dma_dev); + + return (dma_handle - dma_base) >> PAGE_SHIFT; +} + +static dma_addr_t rproc_virtio_map_page(union virtio_map map, struct page = *page, + unsigned long offset, size_t size, + enum dma_data_direction dir, + unsigned long attrs) +{ + struct device *dev =3D map.dma_dev; + struct rproc_vdev *rvdev =3D dev_get_drvdata(dev); + dma_addr_t dma_base =3D dma_dev_coherent_base(dev); + size_t dma_size =3D dma_dev_coherent_size(dev); + phys_addr_t paddr =3D page_to_phys(page) + offset; + void *vaddr =3D page_to_virt(page) + offset; + struct rproc_map_record *record; + dma_addr_t map_handle; + void *bounce; + + // No need to allocate a bounce buffer if the memory to map is already + // part of the device's coherent pool. + if (paddr >=3D dma_base && paddr < (dma_base + dma_size)) { + // The allocation details will be recorded also in this case, + // indicating that no bounce buffer was allocated. + map_handle =3D (dma_addr_t)paddr; + bounce =3D NULL; + } else { + // Allocate bounce buffer from device coherent memory + bounce =3D dma_alloc_coherent(dev, size, &map_handle, GFP_KERNEL | __GFP= _ZERO); + if (!bounce) + return DMA_MAPPING_ERROR; + + // Copy data to bounce buffer + memcpy(bounce, vaddr, size); + } + + // Save bounce details + record =3D &rvdev->map_records[rproc_virtio_bounce_slot(dev, map_handle)]; + + record->original =3D vaddr; + record->size =3D size; + record->bounce =3D bounce; + + return map_handle; +} + +static void rproc_virtio_unmap_page(union virtio_map map, dma_addr_t map_h= andle, + size_t size, enum dma_data_direction dir, + unsigned long attrs) +{ + struct device *dev =3D map.dma_dev; + struct rproc_vdev *rvdev =3D dev_get_drvdata(dev); + unsigned int slot =3D rproc_virtio_bounce_slot(dev, map_handle); + struct rproc_map_record *record =3D &rvdev->map_records[slot]; + + WARN_ON(size !=3D record->size); + + // If a bounce buffer was used, copy data back to original one + if (record->bounce) { + memcpy(record->original, record->bounce, record->size); + + dma_free_coherent(dev, record->size, record->bounce, map_handle); + } + + record->original =3D NULL; + record->size =3D 0; + record->bounce =3D NULL; +} + +static void rproc_virtio_sync_single_for_cpu(union virtio_map map, + dma_addr_t map_handle, + size_t size, + enum dma_data_direction dir) +{ + struct device *dev =3D map.dma_dev; + + dma_sync_single_range_for_cpu(dev, (map_handle & PAGE_MASK), + offset_in_page(map_handle), size, dir); +} + +static void rproc_virtio_sync_single_for_device(union virtio_map map, + dma_addr_t map_handle, + size_t size, + enum dma_data_direction dir) +{ + struct device *dev =3D map.dma_dev; + + dma_sync_single_range_for_device(dev, (map_handle & PAGE_MASK), + offset_in_page(map_handle), size, dir); +} + +static void *rproc_virtio_alloc(union virtio_map map, size_t size, + dma_addr_t *map_handle, gfp_t gfp) +{ + struct device *dev =3D map.dma_dev; + + return dma_alloc_coherent(dev, size, map_handle, gfp); +} + +static void rproc_virtio_free(union virtio_map map, size_t size, void *vad= dr, + dma_addr_t map_handle, unsigned long attrs) +{ + struct device *dev =3D map.dma_dev; + + dma_free_coherent(dev, size, vaddr, map_handle); +} + +static bool rproc_virtio_need_sync(union virtio_map map, dma_addr_t map_ha= ndle) +{ + struct device *dev =3D map.dma_dev; + + return dma_need_sync(dev, map_handle); +} + +static int rproc_virtio_mapping_error(union virtio_map map, dma_addr_t map= _handle) +{ + if (unlikely(map_handle =3D=3D DMA_MAPPING_ERROR)) + return -ENOMEM; + + return 0; +} + +static inline size_t rproc_virtio_max_mapping_size(union virtio_map map) +{ + struct device *dev =3D map.dma_dev; + + return dma_dev_coherent_size(dev); +} + +static const struct virtio_map_ops rproc_virtio_map_ops =3D { + .map_page =3D rproc_virtio_map_page, + .unmap_page =3D rproc_virtio_unmap_page, + .sync_single_for_cpu =3D rproc_virtio_sync_single_for_cpu, + .sync_single_for_device =3D rproc_virtio_sync_single_for_device, + .alloc =3D rproc_virtio_alloc, + .free =3D rproc_virtio_free, + .need_sync =3D rproc_virtio_need_sync, + .mapping_error =3D rproc_virtio_mapping_error, + .max_mapping_size =3D rproc_virtio_max_mapping_size, +}; + /* * This function is called whenever vdev is released, and is responsible * to decrement the remote processor's refcount which was taken when vdev = was @@ -355,6 +507,8 @@ static void rproc_virtio_dev_release(struct device *dev) of_reserved_mem_device_release(&rvdev->pdev->dev); dma_release_coherent_memory(&rvdev->pdev->dev); =20 + kvfree(rvdev->map_records); + put_device(&rvdev->pdev->dev); } =20 @@ -429,13 +583,29 @@ static int rproc_add_virtio_dev(struct rproc_vdev *rv= dev, int id) of_reserved_mem_device_init_by_idx(dev, np, 0); } =20 + /* Allocate one tracking record for each page of the device reserved + * memory. Contiguous memory is not required for this array, which can + * also be quite big (depending on the size of the coherent memory), so + * let's use vmalloc for this allocation. + */ + rvdev->map_records =3D kvcalloc(dma_dev_coherent_size(dev) >> PAGE_SHIFT, + sizeof(*rvdev->map_records), + GFP_KERNEL); + if (!rvdev->map_records) { + dev_err(dev, "failed to allocate memory for map records\n"); + return -ENOMEM; + } + /* Allocate virtio device */ vdev =3D kzalloc_obj(*vdev); - if (!vdev) + if (!vdev) { + kvfree(rvdev->map_records); return -ENOMEM; + } =20 vdev->id.device =3D id; vdev->config =3D &rproc_virtio_config_ops; + vdev->map =3D &rproc_virtio_map_ops; vdev->dev.parent =3D dev; vdev->dev.release =3D rproc_virtio_dev_release; =20 diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index c3ba51fe9e54..2ff48b505ac0 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -339,10 +339,23 @@ struct rproc_vring { struct virtqueue *vq; }; =20 +/** + * struct rproc_map_record - remoteproc map record + * @original: original virtual address + * @num: allocation size + * @bounce: bounce buffer virtual address (NULL if not used) + */ +struct rproc_map_record { + void *original; + size_t size; + void *bounce; +}; + /** * struct rproc_vdev - remoteproc state for a supported virtio device * @subdev: handle for registering the vdev as a rproc subdevice * @pdev: remoteproc virtio platform device + * @map_records: array of map records * @id: virtio device id (as in virtio_ids.h) * @node: list node * @rproc: the rproc handle @@ -358,6 +371,7 @@ struct rproc_vdev { unsigned int id; struct list_head node; struct rproc *rproc; + struct rproc_map_record *map_records; u32 rsc_offset; u32 index; unsigned int num_vrings; --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6136E489888; Wed, 16 Sep 2026 21:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789594397; cv=pass; b=g/yr+0BEcHSGyVulBP9NPiO0lnxX3xpOwhv6mIXtrIiJoYpjbHr1KtdjQXBc5b3fEdbP++ewhtyF/W9t8Tvu+qkFDdg/Fsb/mPtqAW8fdtoikczHjnsLNvFO43Z+L0HcEXtCJ1zwt+RRqu6HWtmHqMs/qi0B1A8u0p5VQ2pnXLw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789594397; c=relaxed/simple; bh=NrG1vMi7mjuK8rU8iFoqlOm+G1UagPSfu8bXcOD9Q8U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hfgpPqVTHBuJwh5DmlwuxusubdgcWPJ9L+7TId0qMdU27xlmpojyj5yykYPEalpuEkrK44kTfYaCXsvpu+fUTujmXQsbh8alBzgT5JNmMKWwSU0SRT4d7hU9uv4NC6vcweRw+VuMeX1pYwyZp/HgZPfZCw1yDxMpaOagipdixhs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=la0A2q3V; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=plO3sSjs; arc=pass smtp.client-ip=185.56.87.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="la0A2q3V"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="plO3sSjs" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; s=arckey; t=1789594383; b=mCBYpDIFJlr787F5SLgeo+3Deq0N4oOKTw5NfZz0zU6yP8ooab5g5Hc0kSIIEhKGC0cL6ehPmX jJX+m7LsCWH/lfedRNr3AZ+iuElV/TFeYrZfW8tsX06MAFsJMStNzEh6InX7CURxm4b2PPQn5O bDrHOyycE2NP0ByFk0XltyhwsUY0ZBpHwFQj0XgpPqnkFzeK9aCNn6IxThPuxKRcn7IvYRVMeu NJ38WuavUgENW3JeYrJxlqrSy3H0xNOQAsKItT9VFUqO6FpY3PqKwEdk7OGlKCGJKq0/2jpcFB NRX5Qufneq2KHSxlC4mTkZWfO/bnwFWtVJTUnUYO8onDAw==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; s=arckey; t=1789594383; bh=NrG1vMi7mjuK8rU8iFoqlOm+G1UagPSfu8bXcOD9Q8U=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=ZponwEU/ZyKF8cl64XvdNC+ay6xttY3qIrmwIiRcujQrlbYXMKdzat3Cd7dcqcmDJE8Fx70rsY hTkWuYm8Sers9R7qy4yX95Qg60amXp3hfCRGX0qmWlsuYVDHAKGY6sZ8M/p6Stri4nbqkZ3d7s 1fELK+wYImRSuHgS/0upjUiGg0HPgFrtMq4pGcNBWglPOam5HnjA6uH3s4UL1xebkwEm4YE3sL V4NCjOosbRqrkdxbDAKpXDpyJ0/sqYnm5znrxU6CS7vYlrlFpxmqFynVBscbU0hjzlQ6u95Ye/ 4NPJxijzjo/nWFAZPrJXs6qTSmgVvM8qU/5x0tnhi89c2g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=dtdxP9SpG3f91lH58tgZH/LmN4+UT+dL4jUVq/KII8w=; b=la0A2q3VHBntmHzNwV6PZVKjIJ 9xu+0+20By417s3JbKTw36cBBD6kzrZHt86Ood5qAtrxRLD9viv2osZeMTs71bmlbMobkKgTKhKHO dQEoEJ3HQXUjJcLJZJfPn4Fjtasppfbr7vHT2Ir2kbCie+7/LpIgMYrj185GyMrzUDys=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuT-00000009s9Y-0aFt; Wed, 16 Sep 2026 21:11:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=dtdxP9SpG3f91lH58tgZH/LmN4+UT+dL4jUVq/KII8w=; b=plO3sSjsWcGLFhdB7DYHKt2QdW 6D5bmj/HOJeqC0VyeoZAt+2yYVUe5UPXvu7h5filkOqLeK6nJQ8rBExiC+QoS88XRauPLiT3I4Qkm xUBIqXaq1DN3RgpzHn/5hl5/RV5htN/BpfqfezSrMEDt0xOjGTLIqpOPtlZN77F6t84g=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuO-0000000058P-1JHw; Wed, 16 Sep 2026 21:11:12 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:52 +0200 Subject: [PATCH RFC 07/12] dt-bindings: spi: add bindings for spi-virtio Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-7-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1663; i=francesco@valla.it; h=from:subject:message-id; bh=NrG1vMi7mjuK8rU8iFoqlOm+G1UagPSfu8bXcOD9Q8U=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWZ98//l5341Ys0W3+DuPHQl5fmvt/v83e24Xz1okc UGp67lQW0cpC4MYF4OsmCJLyLob9/bMNf+WtoHxEcwcViaQIQxcnAIwkfh0hv+Jb7Z5Xfs0kft/ 1QTGr69cMp//j8k9sJhPnzPJZ/+Ecg9dRobl3truXMKyTPUWuWHnsr4839h8Ku3tpwzdF6rTLkt 0xHADAA== X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: ec756a4dc66af5ca0d376dea324da852 X-AntiAbuse: ID - ec756a4dc66af5ca0d376dea324da852 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6wuT-00000009s9Y-0aFt-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none Add bindings for spi-virtio, based on virtio-device. Signed-off-by: Francesco Valla --- .../devicetree/bindings/spi/spi-virtio.yaml | 52 ++++++++++++++++++= ++++ 1 file changed, 52 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/spi-virtio.yaml b/Docume= ntation/devicetree/bindings/spi/spi-virtio.yaml new file mode 100644 index 000000000000..1a0a0763bd2f --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi-virtio.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/i2c-virtio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Virtio SPI Controller + +maintainers: + - Francesco Valla + +allOf: + - $ref: /schemas/spi/spi-controller.yaml# + - $ref: /schemas/virtio/virtio-device.yaml# + +description: + Virtio SPI device, see /schemas/virtio/virtio-device.yaml for more detai= ls. + +properties: + $nodename: + const: spi + + compatible: + const: virtio,device2d + +required: + - compatible + +unevaluatedProperties: false + +examples: + - | + virtio@3000 { + compatible =3D "virtio,mmio"; + reg =3D <0x3000 0x100>; + interrupts =3D <41>; + + spi { + compatible =3D "virtio,device2d"; + + #address-cells =3D <1>; + #size-cells =3D <0>; + + sram@0 { + compatible =3D "microchip,mchp23k256"; + reg =3D <0>; + spi-max-frequency =3D <20000000>; + }; + }; + }; + +... --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15E25489883; Wed, 16 Sep 2026 21:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.7 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789594060; cv=pass; b=sxe84kyQuEaQbkI3eiCoNKkOkoE50euKcD6b+ZQ3WPXWOrxrM6XElUSJwmdHpOZQDwqZE4iIfVrv+zDW5Ul1Egi2IKEXovS+GV6GGNVXNBUyz++XMnr/qBTo4f19PSiBVXG3Q9Pf4cSvom1CRiYraJ6Kln3K/IIyPUb+NII8ikQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789594060; c=relaxed/simple; bh=sBSOz5pgMUqgONr4Fz29dN7NUC6uaTXwlSKgC8vciFU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BXQAlguKSMvHWOccFx0475uJsZrwNV6ixPhmC9i7Nf3gT2O4E7s8gRi7FtwYtAGHO9pCX0Y3Sx1GdV3iQNCtcpp6FJMaJb+5FIzzVsVxf+x9NOUoN2aHHq/aQjyl9pSVuY79qgZnnpshEXYmO2pjEUFSR68sxJmaNMasElgoTZk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=wN8jN+O8; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=aGmaix6g; arc=pass smtp.client-ip=185.56.87.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="wN8jN+O8"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="aGmaix6g" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; s=arckey; t=1789594049; b=Lnt6R13smeeLiU/36dboG0mh8mVRrzUFJlGQRaY35vP2Nj0rq3JtN5j30w5xRrjEm1NX2t+Cyb OxtcIE+Zh0u7U8ZyS500vnTkvnvWCEpAp4pOVEXb4qb29aEgOw/RAVLoJ3GbKr5Zuk2kghZYGc huREMQ9kugB+Wc+9BMksUqFkFf6ZCBAqFCK/bnKBtH0QQHMJsidJTAPB04fUSfVEfckgDsxTAe XYAkB66v4FYkPWqj8uZXYFCk6CN57SL0xGm/FGuHvJJ2TgOu5YmfLqBNfcekro7xO8hjUwT0p2 I/CGn4QBgGWPX7WsW74ffD3LcZJPw9R+d8hkpkJNdSFbsA==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; s=arckey; t=1789594049; bh=sBSOz5pgMUqgONr4Fz29dN7NUC6uaTXwlSKgC8vciFU=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=NBdYieMVKp2V1ZwdVT9UlHD3v+UKb81p7MHdwP/YsaldKsqy1309PMmC0ND8FUWXbR25C3KfdB 5sHxuM/uyofoD1bFKaIKzLf+mHJeN2dEZ61ILI/ZZE44wA7qxHM3AdNZibJGGIolKPuhBKc+tw aDp0rHSQIZvxwqegSAwIwRMyQSUB9jUEIciemZ+wS/VbePjiYFxJalXIXgQ/kR3jVCdxeQD2OW 4BzJN5ld4hD4KHPZCdkM6fiCTAPV+FUS3LwpIijn9xMhjydnHdtydOt+/AeSKmhPNT0zchJZds DkBeGHlivODdoNQXW4AWxI5lPChhbqKU/bw7KkMFXaPRMQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=ozCv4HPZuc40czIPmQ+cRqdAb8c6IBZGMNNibW9zglE=; b=wN8jN+O8flsnThcHZrdsvV0WsU GpB27b+UgNTwIVnKQbFKLsZAKzf+1AoWENutMfMgh67qv/4BLTeLjJ4aOO7Y5FWuHEAgznj27I+PB xq0WdGl0sH2HpcwAv2/zSaplTcd19aDnKaH6qNXJemuT+5TK58Gs4GCP9yDS+2I2oa6c=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuU-00000009sAO-12G2; Wed, 16 Sep 2026 21:11:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=ozCv4HPZuc40czIPmQ+cRqdAb8c6IBZGMNNibW9zglE=; b=aGmaix6gZAAhGub8lf8EsCeKgz aJZqRVZw1R2ekRS/uRy12L6rk6A0JPfqMNBFKIQ2WKi05+rEjDr+Ltwh/QrTrrxW4kZwTeGxh0aqx iav5m65OiYJT84NLRuoOJidr7Oja+qxAsWHMQVObM0wr4jF/Uqrn7Z9Ht9+FP0WZud1g=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuP-0000000058P-1pIJ; Wed, 16 Sep 2026 21:11:13 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:53 +0200 Subject: [PATCH RFC 08/12] dt-bindings: remoteproc: add remoteproc-virtio Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-8-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=3369; i=francesco@valla.it; h=from:subject:message-id; bh=sBSOz5pgMUqgONr4Fz29dN7NUC6uaTXwlSKgC8vciFU=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWZ9sbJhwKelLrNxuv0dpux/sEX7ya6cD08fllWceq Uz8v4FjbkcpC4MYF4OsmCJLyLob9/bMNf+WtoHxEcwcViaQIQxcnAIwEcvJDH9Fkr0c7UySpbR1 cqJP2PrsWXG1MK7NWdjms1Lt/7ZJRTcZGT7Xn9pQNelF0752nzt7UnhCNr5uLowpVojIXx7qfdd Bmx8A X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: e08f13cb19b1ceb3d794b2616535f634 X-AntiAbuse: ID - e08f13cb19b1ceb3d794b2616535f634 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6wuU-00000009sAO-12G2-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none Add a new binding to describe remoteproc-provided virtio devices; while these are discovered through a resource table parsed by the remoteproc infrastructure at runtime, their description can be needed to probe non-discoverable buses (such as I2C) or to link consumers and suppliers. Each vdev is described by a dedicated "group" node, which then includes a virtio-device node, which binding is already existent and used by virtio-mmio. Each vdev shall be stattically linked to a "group" node using its index inside the resource table as the reg property of the node; this permits to have multiple instances of the same type of device. The binding is intended to be generic and adopted by any remoteproc provider. Signed-off-by: Francesco Valla --- .../bindings/remoteproc/remoteproc-virtio.yaml | 89 ++++++++++++++++++= ++++ 1 file changed, 89 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/remoteproc-virtio= .yaml b/Documentation/devicetree/bindings/remoteproc/remoteproc-virtio.yaml new file mode 100644 index 000000000000..c4a0d84b1460 --- /dev/null +++ b/Documentation/devicetree/bindings/remoteproc/remoteproc-virtio.yaml @@ -0,0 +1,89 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/remoteproc/remoteproc-virtio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Virtio devices over remoteproc + +description: | + Virtio devices ("vdevs") can be exposed using the remoteproc infrastruct= ure + and its resource table. For some of them, a device tree node might be ne= eded + to describe remote undiscoverable hardware and/or connect consumers and + providers. + +maintainers: + - Francesco Valla + +properties: + virtio: + description: Contains a group of Virtio devices exposed by the remotep= roc. + + properties: + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + patternProperties: + "^vdev@[0-9a-f]+$": + type: object + + properties: + reg: + description: Virtio device index inside the resource table. + maxItems: 1 + + additionalProperties: + type: object + $ref: /schemas/virtio/virtio-device.yaml + maxItems: 1 + + required: + - reg + + additionalProperties: false + + required: + - '#address-cells' + - '#size-cells' + +additionalProperties: true + +examples: + - | + remoteproc-cm33 { + virtio { + #address-cells =3D <1>; + #size-cells =3D <0>; + + vdev@0 { + reg =3D <0>; + + gpio { + compatible =3D "virtio,device29"; + + gpio-controller; + #gpio-cells =3D <2>; + }; + }; + + vdev@1 { + reg =3D <1>; + + i2c { + compatible =3D "virtio,device22"; + + #address-cells =3D <1>; + #size-cells =3D <0>; + + eeprom@50 { + compatible =3D "atmel,24c1025"; + reg =3D <0x50>; + }; + }; + }; + }; + }; +... --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A04AA4FDE77; Wed, 16 Sep 2026 21:11:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.5 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593123; cv=pass; b=Da1NzjKe9dX+bqfN0Jzlv2n9Pr8JQAPWsTy9PaOuO1g+ExfSYJP+W5xthpl/XzX8Cga79BDd7TMZaWcevLpYW/6beBAgbhKVEhAXt83mg3XtZEmTF1AunmU/PnGUghmm8dbyJxMQHfuugKTTYoG5QxuLnFSvoha+J06n0Z41ecc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789593123; c=relaxed/simple; bh=UuqIVsdecwPwN8w0AomaFDbkgOyPw7g1ZVINhxzOqUI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Dt4UP8TbvLq6NJ0dZFnuxJ+SjWUnW0GMtRqB8hITlWyRocl9KH1NeouJt+Na78Ch5OauE7Fds4RSmbDJ3ndTNfkmwoI/z1rcdaEbsWZQ+nS3OmcpuFu+BxdwR3PH8DJhczrQXwhyr/3yE9Fl+ZiulSA8vq12zVAd54vKjaXqXUA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=KxL2DBzz; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=quUe1ey5; arc=pass smtp.client-ip=185.56.87.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="KxL2DBzz"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="quUe1ey5" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; s=arckey; t=1789593107; b=h3i6/p9FDWUTkOLwQ+Npa1bpvXm9CvH1YX0vSTpinaiPk28g3NtvIdeAqDYxlcFMx8hFqxZdP1 MY3NVfGJJsojCZmYdMhwg6TVEZFjWz7aYgujBX4Sq66C3I+nOjGKjec4WMJMl+Gicbkw9PDIYv Z9eJjWEf7zAxxmhVUSx24eUUSo1F2mRiT8irfgguPpNrhlBYnSqX/rBsUEkNwY4cv7iqRzsywb ZZ0Jj/0yMcPg+uHEk7MqtHiZDZ1lMGs+IW3LBBHEo+nSvNVTR8fg5bCz98RMaevMeMWcWVGvHS kDxzagy/nQgRJ9/J1rA5R8mo7+o+2nVDkyxF+lIFBdMv7g==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; s=arckey; t=1789593107; bh=UuqIVsdecwPwN8w0AomaFDbkgOyPw7g1ZVINhxzOqUI=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=KyGm8dkmgEsU+Zk8gf7cFnX5YIK2PwxdysyTI73my6hr5teBkExF69Cg6sUgNzYByYxCIE4JNn 7trPlWwrmk/WNnKPlHgEf2ogqLHPcklBqDkElZS/Kd4qcTrSVX5mPVOJQrABr57RZq5kMbkxbX m9RG/h5ANdntoWrIahS7pY9ERO0hTl7cAAthY8Gfg+qhIT0/xz5JlvNfJBvjTgxOJlya9QuEQs V4kvWE2//eMFvPbfpMKbXYARnGAVgh9ezBZsGYIRLiSMWza9bYT2y+41KgqeOuR8hLHwLDvz5d 9IKpZyRjlb+BwFgRKcCnkvHeCyQEVtYEIXGjNJcDSZyGHg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=+OJJf0zimOPJzB7R6o40fNU2QqeDCYrBYo23IsRVzJQ=; b=KxL2DBzzXk2RcFSO9+/eIbm0f6 WTqtnXYE1FTK5+8YzyyRJlESoPEvtUcnv8Kp0Ru96gSAv3FAit3PsIJweHsaR1U+pkUYglSZ0oGYU cTldph2fEn2npeN9zkFzpi5emF0xbFMvkOSlrDdxt/RX4lI3Zh13n63NSL1vZp8EnCnQ=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuV-00000009sBU-3SPa; Wed, 16 Sep 2026 21:11:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=+OJJf0zimOPJzB7R6o40fNU2QqeDCYrBYo23IsRVzJQ=; b=quUe1ey5u2pIYbtCFwfrE8myz5 fnBxgNazPAjyLjs+WOdXYs5ld4gTIlY3Y5Vf7xwwvgkKd9QrrPJQjD5RaanYKGGr2J9KJqDVmWl99 OXuwmh/5JQRAx5848Azec4sMkfDTUd0j71riHaq6CsJQkzmA+1ZqOyS1LdtV3Wbf8iho=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuQ-0000000058P-2gXw; Wed, 16 Sep 2026 21:11:14 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:54 +0200 Subject: [PATCH RFC 09/12] remoteproc: search for a fwnode during vdev registration Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-9-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2406; i=francesco@valla.it; h=from:subject:message-id; bh=UuqIVsdecwPwN8w0AomaFDbkgOyPw7g1ZVINhxzOqUI=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWZ9wxq3y7C77Wf/CNGGixZsHl/4lKDL+/cVsXn5An l0ucfWajlIWBjEuBlkxRZaQdTfu7Zlr/i1tA+MjmDmsTCBDGLg4BWAimy4yMhw67+EqF3HU6tj1 9vXbfx2YV8Xx2fugMu9iq6jP5x6cP8PDyLDn1bXwOtvIsmtxix8eWfTqX+JPNo2ChSqTr58LNJc 0MWQHAA== X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 38727b3654ee60d1c78c3d34062cead4 X-AntiAbuse: ID - 38727b3654ee60d1c78c3d34062cead4 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6wuV-00000009sBU-3SPa-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-3zv2.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none The virtio subsystem already supports a fwnode describing a vdev; search for a specific node during vdev registration and supply it to the platform device that is being registered. Signed-off-by: Francesco Valla --- drivers/remoteproc/remoteproc_core.c | 36 ++++++++++++++++++++++++++++++++= ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remo= teproc_core.c index b7d9957534bf..e3ecc61cc1de 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -440,6 +440,29 @@ void rproc_remove_rvdev(struct rproc_vdev *rvdev) if (rvdev) list_del(&rvdev->node); } + +static struct fwnode_handle *rproc_get_vdev_fwnode(struct device *dev, int= idx) +{ + struct fwnode_handle *group, *child; + u32 reg; + int ret; + + group =3D device_get_named_child_node(dev, "virtio"); + + fwnode_for_each_child_node(group, child) { + ret =3D fwnode_property_read_u32(child, "reg", ®); + if (ret) + continue; + + if (idx =3D=3D reg) + break; + } + + fwnode_handle_put(group); + + return child; +} + /** * rproc_handle_vdev() - handle a vdev fw resource * @rproc: the remote processor @@ -475,6 +498,7 @@ static int rproc_handle_vdev(struct rproc *rproc, void = *ptr, struct device *dev =3D &rproc->dev; size_t rsc_size; struct rproc_vdev_data rvdev_data; + struct platform_device_info pdev_info; struct platform_device *pdev; =20 /* make sure resource isn't truncated */ @@ -504,8 +528,16 @@ static int rproc_handle_vdev(struct rproc *rproc, void= *ptr, * as device id, then we get duplication in sysfs, so need to use * PLATFORM_DEVID_AUTO to auto select device id. */ - pdev =3D platform_device_register_data(dev, "rproc-virtio", PLATFORM_DEVI= D_AUTO, &rvdev_data, - sizeof(rvdev_data)); + memset(&pdev_info, 0, sizeof(pdev_info)); + pdev_info.parent =3D dev; + pdev_info.fwnode =3D rproc_get_vdev_fwnode(dev->parent, rvdev_data.index); + pdev_info.of_node_reused =3D true; + pdev_info.name =3D "rproc-virtio"; + pdev_info.id =3D PLATFORM_DEVID_AUTO; + pdev_info.data =3D &rvdev_data; + pdev_info.size_data =3D sizeof(rvdev_data); + + pdev =3D platform_device_register_full(&pdev_info); if (IS_ERR(pdev)) { dev_err(dev, "failed to create rproc-virtio device\n"); return PTR_ERR(pdev); --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FD14456286; Wed, 16 Sep 2026 21:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.0 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789595326; cv=pass; b=GcjkB5dta94NsCk2rrCS4bTrw86RYNY7v/kFLStnIRXlf3iKamgWu9bUqAbcG2hfJjbCY32MspMiHnolbhRspxMcxFUvUctTkI1rckgXlq4ETMD5RpjOtLeinxdZDmsTtq/JngRi3DJv5/UqdMih2NX/BlFH+RcAduT/FHJh66Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789595326; c=relaxed/simple; bh=5RpInneuPFremFn6IGVocs0wamQaJJ0xuph/2qEoWFA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WNxGUVDDYHDTYTBmK8DW/WVoz7vwFx6yVOdnjymPoXISTZiVdnLEglsDNfXXvC7DBvrzcRYh6tLtHW2WNTwp9gABMV/hHleWPN7wXHhLw+qOWrF5zHGVSwa9wpoG847cUdndjlXHoh1Qp2WKDQ1dPpNiy39l0TSEYtyj4urCcIU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=neZsQSh6; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=MHHs7zTH; arc=pass smtp.client-ip=185.56.87.0 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="neZsQSh6"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="MHHs7zTH" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com; s=arckey; t=1789595309; b=LDGPUswdl9gNB3KdJlnSI70l5nrUe7GetenlsR1LU9SdwtgFyS263dLaasshJfJsSQXaiTr/vv LhZAp3tGCa8XWORYHrCCs1G5U9T1GVKv6IONVjVHKkl7W8Hj+f+gRE4brlUmu2JvgWOaoC5Nde BqSyADf69affnSUueF7ZSvfrXG6r03NsDVhpciKh2rJNlT8wJHfU48sIb1HmBNCMKzPiOZR/Kk rR3kSVgd1X7E6JRe6myaAx3SqX9Iz56or5UBmteT9O3QNIu2917GYEdHLkYqxtluk70+UC3RZG 7ZmldXpKJXs0xr/MiupcQgRhwiVNogLtXL+ZMjiQEWp/tA==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com; s=arckey; t=1789595309; bh=5RpInneuPFremFn6IGVocs0wamQaJJ0xuph/2qEoWFA=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=2jtSCVvQVebUbDN0yztK8tsDWtn4xji+GbBuueJOeAkIof746OuFpEvReidx+ULzTbZD0rUU3C K7LYFMsogvIYyXv4DdTOAsbCytoXQudAvCl5NbW3AbPTrlnYHLd++MO4BJfgjLMc99S7JgoW0C K/GB+z2TIqvNQvdKNNpc+CtoUoEgKmhGxJGf7jcuXcScBVV80UWGSCVQVEQvSsAnlfFih8hTZG f7wUGbmy5hiDkWlQd6/gb38YE9jeNcbuLVOUBRBQplFbDb/l4IVRXhykPutviI1HtBX4/w3HL7 xe4/919hWYS0g5Thg/D7Qv/ys77dIsrnOJjjLdb3rKtMMg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=VQVoOO/zbpaeb/l4qLVnNDj9e2y11NOFxhc+SjTbWPc=; b=neZsQSh63xo28iOfbXP/yq0mHn DW1TVqHE+12QbqFJDddwNty3ZIPQUqoc83IqoQN4eRVyPrvZh4/hGV/gnYC1Fld8/A2MD3j39cxwS SXfU1WvYtSUXPpONb1KYaE5pgG3JIH8Z9GMYdxwXAOR0ElqX71p63qP0nP20TdAF/2pY=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6xUI-00000003nWX-26tj; Wed, 16 Sep 2026 21:48:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=VQVoOO/zbpaeb/l4qLVnNDj9e2y11NOFxhc+SjTbWPc=; b=MHHs7zTH3GK9FTI1K2dcbUyBIT q8tRhi/NJvR6+MO+3GGTVwn4LCZW5XbeJmxYe9D9Lq8vxF5M/fOBQwiVxhs8TsYaaesL89Nn5n5cq JUnxSR/3+Oi+RGCv9er5Z/iFdQTYODXlOtZj2ds900oDRlRCqFN78TDGDtb/7iyCPubM=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuR-0000000058P-2urL; Wed, 16 Sep 2026 21:11:15 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:55 +0200 Subject: [PATCH RFC 10/12] remoteproc: imx_rproc: always use non-blocking mailboxes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-10-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=5141; i=francesco@valla.it; h=from:subject:message-id; bh=5RpInneuPFremFn6IGVocs0wamQaJJ0xuph/2qEoWFA=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWZ8wVjamH5pQ1v6rb3vpIv/4BI25fgUp/3Tvq67S2 lLyqsWlo5SFQYyLQVZMkSVk3Y17e+aaf0vbwPgIZg4rE8gQBi5OAZjIDn5GhhsL14SeifMKn6y0 OHlJ0cy5U06pTpv6Q+yg5L5tIpvvSbsz/HfesCfDI8aMLb7s/dFPPNty3pi8nsi6e+nqVWtrf6V zPWEGAA== X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 34e675cb71f7906ad68cefa10a742871 X-AntiAbuse: ID - 34e675cb71f7906ad68cefa10a742871 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6xUI-00000003nWX-26tj-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-xhtg.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none Blocking mailboxes may lead to sleep during the kick operation, which conflicts with some virtio devices (e.g.: virtio-can) that kicks their virtqueues with spinlock(s) held. Align to the behavior of all the other remoteproc drivers that use a mailbox to perform the kick (i.e.: omap, st, stm32, ti_k3_*, xlnx_r5) and move to a non-blocking mailbox here as well. As a side effect of this modification, remove the close-reopen action on the mailboxes during restart and shutdown. Signed-off-by: Francesco Valla --- drivers/remoteproc/imx_rproc.c | 49 ++++++--------------------------------= ---- drivers/remoteproc/imx_rproc.h | 1 - 2 files changed, 6 insertions(+), 44 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 745ce52cd822..100440328f92 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -97,7 +97,7 @@ struct imx_rproc_mem { /* Linux has permission to handle the Logical Machine of remote cores */ #define IMX_RPROC_FLAGS_SM_LMM_CTRL BIT(0) =20 -static int imx_rproc_xtr_mbox_init(struct rproc *rproc, bool tx_block); +static int imx_rproc_xtr_mbox_init(struct rproc *rproc); static void imx_rproc_free_mbox(void *data); =20 /* Forward declarations for platform operations */ @@ -444,7 +444,7 @@ static int imx_rproc_start(struct rproc *rproc) struct device *dev =3D priv->dev; int ret; =20 - ret =3D imx_rproc_xtr_mbox_init(rproc, true); + ret =3D imx_rproc_xtr_mbox_init(rproc); if (ret) return ret; =20 @@ -712,7 +712,7 @@ static void imx_rproc_kick(struct rproc *rproc, int vqi= d) =20 static int imx_rproc_attach(struct rproc *rproc) { - return imx_rproc_xtr_mbox_init(rproc, true); + return imx_rproc_xtr_mbox_init(rproc); } =20 static int imx_rproc_scu_api_detach(struct rproc *rproc) @@ -877,7 +877,7 @@ static void imx_rproc_rx_callback(struct mbox_client *c= l, void *msg) queue_work(priv->workqueue, &priv->rproc_work); } =20 -static int imx_rproc_xtr_mbox_init(struct rproc *rproc, bool tx_block) +static int imx_rproc_xtr_mbox_init(struct rproc *rproc) { struct imx_rproc *priv =3D rproc->priv; struct device *dev =3D priv->dev; @@ -900,7 +900,7 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc,= bool tx_block) =20 cl =3D &priv->cl; cl->dev =3D dev; - cl->tx_block =3D tx_block; + cl->tx_block =3D false; cl->tx_tout =3D 100; cl->knows_txdone =3D false; cl->rx_callback =3D imx_rproc_rx_callback; @@ -1223,22 +1223,6 @@ static int imx_rproc_detect_mode(struct imx_rproc *p= riv) return priv->ops->detect_mode(priv->rproc); } =20 -static int imx_rproc_sys_off_handler(struct sys_off_data *data) -{ - struct rproc *rproc =3D data->cb_data; - int ret; - - imx_rproc_free_mbox(rproc); - - ret =3D imx_rproc_xtr_mbox_init(rproc, false); - if (ret) { - dev_err(&rproc->dev, "Failed to request non-blocking mbox\n"); - return NOTIFY_BAD; - } - - return NOTIFY_DONE; -} - static void imx_rproc_destroy_workqueue(void *data) { struct workqueue_struct *workqueue =3D data; @@ -1285,7 +1269,7 @@ static int imx_rproc_probe(struct platform_device *pd= ev) =20 INIT_WORK(&priv->rproc_work, imx_rproc_vq_work); =20 - ret =3D imx_rproc_xtr_mbox_init(rproc, true); + ret =3D imx_rproc_xtr_mbox_init(rproc); if (ret) return ret; =20 @@ -1315,26 +1299,6 @@ static int imx_rproc_probe(struct platform_device *p= dev) if (rproc->state !=3D RPROC_DETACHED) rproc->auto_boot =3D of_property_read_bool(np, "fsl,auto-boot"); =20 - if (dcfg->flags & IMX_RPROC_NEED_SYSTEM_OFF) { - /* - * setup mailbox to non-blocking mode in - * [SYS_OFF_MODE_POWER_OFF_PREPARE, SYS_OFF_MODE_RESTART_PREPARE] - * phase before invoking [SYS_OFF_MODE_POWER_OFF, SYS_OFF_MODE_RESTART] - * atomic chain, see kernel/reboot.c. - */ - ret =3D devm_register_sys_off_handler(dev, SYS_OFF_MODE_POWER_OFF_PREPAR= E, - SYS_OFF_PRIO_DEFAULT, - imx_rproc_sys_off_handler, rproc); - if (ret) - return dev_err_probe(dev, ret, "register power off handler failure\n"); - - ret =3D devm_register_sys_off_handler(dev, SYS_OFF_MODE_RESTART_PREPARE, - SYS_OFF_PRIO_DEFAULT, - imx_rproc_sys_off_handler, rproc); - if (ret) - return dev_err_probe(dev, ret, "register restart handler failure\n"); - } - pm_runtime_enable(dev); ret =3D pm_runtime_resume_and_get(dev); if (ret) @@ -1447,7 +1411,6 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8= ulp =3D { static const struct imx_rproc_dcfg imx_rproc_cfg_imx7ulp =3D { .att =3D imx_rproc_att_imx7ulp, .att_size =3D ARRAY_SIZE(imx_rproc_att_imx7ulp), - .flags =3D IMX_RPROC_NEED_SYSTEM_OFF, }; =20 static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d =3D { diff --git a/drivers/remoteproc/imx_rproc.h b/drivers/remoteproc/imx_rproc.h index 0d7d48352a10..9a1400d0d081 100644 --- a/drivers/remoteproc/imx_rproc.h +++ b/drivers/remoteproc/imx_rproc.h @@ -16,7 +16,6 @@ struct imx_rproc_att { }; =20 /* dcfg flags */ -#define IMX_RPROC_NEED_SYSTEM_OFF BIT(0) #define IMX_RPROC_NEED_CLKS BIT(1) =20 struct imx_rproc_plat_ops { --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85381494835; Wed, 16 Sep 2026 21:49:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.0 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789595361; cv=pass; b=afv3w8CGGF0VUGs9reTGRPgVcdpGZcGJo/7lVnlR7bPwTOfMhd0EUc3MvSjlmxgaxfQKJbai/PSg+8ygDJ+42FbmM2Z2HdMFdWn4/7R5X/TRljVJCrbBbx4pCGyaCUXhe9AeOae1dxYOxNJYKgssRgFQL51FQ9wIKmOaLQeFdE8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789595361; c=relaxed/simple; bh=SArq2+UwtiAN8KF2iej4IW97HFnrOvv94ZfX1GMeV2c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GpBTOR1EbnqrwgYrpR2BElgCtR2tX9j27JMiCiWuLGtfqFS4m0qlc83TTiX/wBtTwMSQhmWXIYE2zfSBeyMsEiNzNiaWMGrpDc0Jw+x3Zo1avlsazAbfFQTac4sSIXiNfScvQeUUTMErZCmymnaaR6+4am+6D8ofcomHEX5YK/M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=FtW+62q/; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=akkfbjnQ; arc=pass smtp.client-ip=185.56.87.0 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="FtW+62q/"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="akkfbjnQ" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; s=arckey; t=1789595358; b=4qPrUuBZOHBy1+0H704Tk75qpSSNygqYWbv1cHjwpF3oCtS45HVaPDMuis8RdIvYt+ee3gw1P/ 3AO7jGnySz5fxnnA6Abm9gXF9YgkxYlvQE9pnEj8AnjIQ/g60zz4I77MnY3PE2mPMV2zuAjmu5 vVeANLbKNy9az2YgolSghr6SACrwMNBU0ME6nASAJpsyDfN8oIGAejon/tDHF4le6qpBzOQnen LBCe5ft1Iie6/1nBhkmMhTPBhVf9m2rROF74MCnjyyQvVkP5KVBow9UD9VNTbQ6OAfsDuQAn0O jE7/JzEfY1ja1UblClvfEEOvCgPyvkLxm9PZ9YnhrUk9ww==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; s=arckey; t=1789595358; bh=SArq2+UwtiAN8KF2iej4IW97HFnrOvv94ZfX1GMeV2c=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=SGqwUWTeaXXS61b6eto7qlXVhhSFH1lSPpItnEi9rcjQD/aQL/3/Ay23WVKHKkcKKDGAPMN1Nk J2/2HioGhw4DZkKn9Fds9LVpsmcW7/EXLPXPgsomiPEkmBqCLWFPq2n6TIY75l2rCy52Cou6So Tiag41Ap/bhx/D5Wm4erhWT32Pc0d0qqZknr3UBWzhNBlmZKXLS//FsElcOmRjoBpNo7B4z0Pu /ymJlKtW67j/cIHIZYsMmGX/Z0cvQn+MwEXOflksppfoZ+qkM0zJd/k/Kod45baAYCx0SreQ4C MbGTidZhj+H144L4uleSCgWsnO5J/MjHsIIbSWgtcmVJEQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=/1xXAR7sHjfiShKLvtMcClqJDZUo+C9C2NEO/Y0JRUM=; b=FtW+62q/B07MpuKFw3cIUWNIZh ERM5Bat0OPR9wxXUcUGw3R0dGsgPWOezfexrnyBceyYbMh6E7NqqNqpY3lpLKld9FjhjVbQCJSo19 4LvOUp/BbeTapAN84RFpyZxXgCnEI6xjOXWGjRKkv3EOTyhtcMtOxUvQBPRsls7eq+1Q=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-f940.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6xV9-00000002cjz-1kKn; Wed, 16 Sep 2026 21:49:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=/1xXAR7sHjfiShKLvtMcClqJDZUo+C9C2NEO/Y0JRUM=; b=akkfbjnQKAX39GctHP0syTEnII DLYHpi+xCRoGyRpbvM7sB13vwPQrXehzIp2YtpSBCHtIOIu+7xVLEfyYX80mTiU+GUeDYw7PabRsr KtMW8JOZbi4InQ9KtQj//etRtThJILkS16sOkj3jS8Sia8fkYxykfu5iqGFUs7yjKpp4=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuS-0000000058P-3B0Q; Wed, 16 Sep 2026 21:11:16 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:56 +0200 Subject: [PATCH RFC 11/12] dt-bindings: remoteproc: imx-rproc: support virtio Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-11-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=884; i=francesco@valla.it; h=from:subject:message-id; bh=SArq2+UwtiAN8KF2iej4IW97HFnrOvv94ZfX1GMeV2c=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWZ/MSVkl8zrTvFOW0TZozZQTHX5Tr3Okt99Tdb57f s0JnZ2fO0pZGMS4GGTFFFlC1t24t2eu+be0DYyPYOawMoEMYeDiFICJxC9hZFigZPTpgLCvUXRH WHH7rYUSvwtd5q7ZWCf876rHPkMdPjFGht13JldxuRXvP3L6YLFt1pQvnkZZRUwBkqFH/v9mejv RgQkA X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 3d122d4309c718f4dc86ed172affefd7 X-AntiAbuse: ID - 3d122d4309c718f4dc86ed172affefd7 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6xV9-00000002cjz-1kKn-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none Add support for virtio devices description. Signed-off-by: Francesco Valla --- Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yam= l b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml index c18f71b64889..32fc415c7028 100644 --- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml @@ -92,6 +92,7 @@ required: - compatible =20 allOf: + - $ref: remoteproc-virtio.yaml# - if: properties: compatible: @@ -118,7 +119,7 @@ allOf: properties: power-domains: false =20 -additionalProperties: false +unevaluatedProperties: false =20 examples: - | --=20 2.55.0 From nobody Fri Sep 25 04:09:38 2026 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C9D24DE709; Wed, 16 Sep 2026 22:00:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.9 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789596049; cv=pass; b=a1QsvkOR1a6ADmINmlWArXjOoF0zey5wusqSWHqB1Yy1jF5Sa6t7AzUEg/I4dXhQOMI4YdHCC5j+Wr+8md4Z3Nzdi3R9gW7ln8eDHjO5GYB9w1qUkU5e0xrVn8mudEqHlCX+4ZQD2fUFqvNFPidS9y+tjlYiTmUzCuppshuaiAY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789596049; c=relaxed/simple; bh=d39hVW/1aGsXzSQ8/+ghN24LusZ3o8IHDAoTyfwdSng=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hzAFZ1DLwYn1+sC2fRmE9mQkxTo8LH+qj3diCbIqhyu9CDQ9+NnG1ljMpJte602lrY7DyZTDXvu4palCmgd+0YaFIEbyqTrpW1If3TjwsxfyaRAjyeGobAo/LSoJhTYByMoxHJbV9PkNkntJ1Ply0/Ki68J0SvuiCRS30zQf3N8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=JBngK7ml; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=SCKDfRlf; arc=pass smtp.client-ip=185.56.87.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="JBngK7ml"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="SCKDfRlf" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; s=arckey; t=1789596040; b=2d8CSG1va66bOXjzzBJxuv4Y8qiY69tYktFqzwF2suwp2qehOPmH7IVqU3LHIeinPPZHaR9qi9 wdbqCKSItaHHLwErSLmhP4wiaoadlIQJm0eGBiHBScJ4CmwPs58q3cInHCkWWYHZf20DVe0ACp S7x25M/JBhq11LCu8N1ybEc5B7BXR68/2cOXgeaY0clth1yLt39UgijCoDa041zzVbfILjtAXc vIcihK7yUasyshaVTWdErf3hUB1L69q3YBdI4vq223zqri6oH5TNJKQmsTs+u4uchAD10L44Ja upZY6oto/Afz2oh475ibbzNJzIXulN+gYIW/2zYeXinsIw==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; s=arckey; t=1789596040; bh=d39hVW/1aGsXzSQ8/+ghN24LusZ3o8IHDAoTyfwdSng=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=BhyziAwBV02AGqL+YXKYNV6dz64DLqUMZU6omTjlpILL2O6iQDaA3/bQN0/58LukXuwuqaTzML Il9unTeGhcOo7RUkcHZdPdORVhitQ4ybBxJUe/j7w9xfJHfMpuivNIcoiog7h9f+4GwI9AZg6Q rcXxsUOi9ttAuWqqnBuSqP1663ZyZyC/OPxRIN/LRIq/d0GG2uGj1H2VtdBwX9Jzo/CjTYfboU /IuJWNuUuLjCu6ouONX5r54Yu0KrWI+K6w95gDLuzoyOoniNMJXEbvPOV88nESeC/alZKwoUfa c7KBgg7YDeVrg9VMmB+2qhlbG1w6XmwTfnU1GTebh8SwuA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=Afy2Ioh1Q8MmCQHDm5oT2HBS/WsmsNSsYcd/Fb2zqP8=; b=JBngK7mlxGX2KCs7GdKAWbdFCD 1ZRX0MHc8IwSY/oF6PGvqFf42TVgc8zj0PXDQN8v6h4fv8Sgo22r4mw1u5SpfxgQZp37rqSjUYFTG QB8QN/WUTiJv2nIWhVpno7N12yZ3PitxqcE5IkgY3wODxmxpeG0WLI/AyBbohJ/MiE1Y=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-f940.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6xVa-00000002d1j-0K9V; Wed, 16 Sep 2026 21:49:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=Afy2Ioh1Q8MmCQHDm5oT2HBS/WsmsNSsYcd/Fb2zqP8=; b=SCKDfRlfpwVmyCn+wFZ78jXjaM JcGjP4XensB8YRLwEPVSQdCv1Ht86LoYxrmAF1lLBrp2dCdOnicBOAb8vEY/D2F4x/r6wZFf8HXz/ nGDOhr91JAoYEwfb5AG6HvYWDIRWvBg/LlQXkof2xbwt8cizF5CBH40ea1lI/8Kh5pDk=; Received: from [95.233.221.121] (port=62880 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1x6wuT-0000000058P-3LOW; Wed, 16 Sep 2026 21:11:17 +0000 From: Francesco Valla Date: Wed, 16 Sep 2026 23:10:57 +0200 Subject: [PATCH RFC 12/12] PoC: arm64: dts: imx93-11x11-frdm: add multiple vdevs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260916-remoteproc_virtio_map-v1-12-dac8c5eb4aa9@valla.it> References: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> In-Reply-To: <20260916-remoteproc_virtio_map-v1-0-dac8c5eb4aa9@valla.it> To: Bjorn Andersson , Mathieu Poirier , Kees Cook , "Gustavo A. R. Silva" , Marek Szyprowski , Robin Murphy , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Peng Fan , Sascha Hauer Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, imx@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Francesco Valla X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=4023; i=francesco@valla.it; h=from:subject:message-id; bh=d39hVW/1aGsXzSQ8/+ghN24LusZ3o8IHDAoTyfwdSng=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDFmrWZ+sLG1o+nracmtWSe33Ny3VK8OF0rQftTPl7Aw7m Vv7xV+3o5SFQYyLQVZMkSVk3Y17e+aaf0vbwPgIZg4rE8gQBi5OAZiIbhzDf+fWp83X7c5X/u96 sps55sqef1w3ex493f3j8a/PEROynS4w/OGIVdb8s+TZaoEjJvZvVhxVZ5jyxuMhf9+m8xunbmp WOMgJAA== X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 126b925e8038527d93e52dea20fe7f80 X-AntiAbuse: ID - 126b925e8038527d93e52dea20fe7f80 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1x6xVa-00000002d1j-0K9V-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-f940.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none Add rings for multiple vdevs, as well as the required virtio nodes for I2C, SPI and GPIO functionalities. On top of that, add example peripherals using all of them. NOTE: this is a Proof-Of-Concept, not meant to be integrated! Signed-off-by: Francesco Valla --- arch/arm64/boot/dts/freescale/imx93-11x11-frdm.dts | 128 +++++++++++++++++= ++-- 1 file changed, 119 insertions(+), 9 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx93-11x11-frdm.dts b/arch/arm6= 4/boot/dts/freescale/imx93-11x11-frdm.dts index bd14ba28690c..dfa3b122ac5f 100644 --- a/arch/arm64/boot/dts/freescale/imx93-11x11-frdm.dts +++ b/arch/arm64/boot/dts/freescale/imx93-11x11-frdm.dts @@ -53,6 +53,32 @@ button-k3 { }; }; =20 + gpio-keys-virtio { + compatible =3D "gpio-keys-polled"; + poll-interval =3D <100>; + + button-v1 { + label =3D "Button V1"; + linux,code =3D ; + gpios =3D <&v_gpio 23 GPIO_ACTIVE_LOW>; + }; + + button-v2 { + label =3D "Button V2"; + linux,code =3D ; + gpios =3D <&v_gpio 24 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible =3D "gpio-leds"; + + led { + gpios =3D <&v_gpio 18 GPIO_ACTIVE_HIGH>; + label =3D "LED V"; + }; + }; + reg_usdhc2_vmmc: regulator-usdhc2 { compatible =3D "regulator-fixed"; off-on-delay-us =3D <12000>; @@ -89,11 +115,6 @@ linux,cma { linux,cma-default; }; =20 - rsc_table: rsc-table@2021e000 { - reg =3D <0 0x2021e000 0 0x1000>; - no-map; - }; - vdev0vring0: vdev0vring0@a4000000 { reg =3D <0 0xa4000000 0 0x8000>; no-map; @@ -105,12 +126,42 @@ vdev0vring1: vdev0vring1@a4008000 { }; =20 vdev1vring0: vdev1vring0@a4010000 { - reg =3D <0 0xa4010000 0 0x8000>; + reg =3D <0 0xa4010000 0 0x1000>; + no-map; + }; + + vdev2vring0: vdev2vring0@a4011000 { + reg =3D <0 0xa4011000 0 0x2000>; + no-map; + }; + + vdev2vring1: vdev2vring1@a4013000 { + reg =3D <0 0xa4013000 0 0x2000>; + no-map; + }; + + vdev3vring0: vdev3vring0@a4015000 { + reg =3D <0 0xa4015000 0 0x2000>; + no-map; + }; + + vdev4vring0: vdev4vring0@a4017000 { + reg =3D <0 0xa4017000 0 0x4000>; + no-map; + }; + + vdev5vring0: vdev5vring0@a401B000 { + reg =3D <0 0xa401B000 0 0x2000>; + no-map; + }; + + vdev5vring1: vdev5vring1@a401D000 { + reg =3D <0 0xa401D000 0 0x2000>; no-map; }; =20 - vdev1vring1: vdev1vring1@a4018000 { - reg =3D <0 0xa4018000 0 0x8000>; + vdev5vring2: vdev5vring2@a401F000 { + reg =3D <0 0xa401F000 0 0x1000>; no-map; }; =20 @@ -149,8 +200,67 @@ &cm33 { <&mu1 3 1>; mbox-names =3D "tx", "rx", "rxdb"; memory-region =3D <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, - <&vdev1vring0>, <&vdev1vring1>, <&rsc_table>; + <&vdev1vring0>, <&vdev2vring0>, <&vdev2vring1>, + <&vdev3vring0>, <&vdev4vring0>, + <&vdev5vring0>, <&vdev5vring1>, <&vdev5vring2>; status =3D "okay"; + + virtio { + #address-cells =3D <1>; + #size-cells =3D <0>; + + vdev@2 { + reg =3D <2>; + + v_gpio: gpio { + compatible =3D "virtio,device29"; + gpio-controller; + #gpio-cells =3D <2>; + interrupt-controller; + #interrupt-cells =3D <2>; + }; + }; + + vdev@3 { + reg =3D <3>; + + i2c { + compatible =3D "virtio,device22"; + #address-cells =3D <1>; + #size-cells =3D <0>; + + eeprom@50 { + compatible =3D "atmel,24c1025"; + reg =3D <0x50>; + }; + }; + }; + + vdev@4 { + reg =3D <4>; + + spi { + compatible =3D "virtio,device2d"; + #address-cells =3D <1>; + #size-cells =3D <0>; + + sram@0 { + compatible =3D "microchip,mchp23k256"; + reg =3D <0>; + spi-max-frequency =3D <20000000>; + }; + + lcd@1 { + compatible =3D "adafruit,yx240qv29", "ilitek,ili9341"; + reg =3D <1>; + spi-max-frequency =3D <10000000>; + dc-gpios =3D <&v_gpio 21 GPIO_ACTIVE_HIGH>; + reset-gpios =3D <&v_gpio 20 GPIO_ACTIVE_HIGH>; + rotation =3D <90>; + }; + }; + }; + }; }; =20 &eqos { --=20 2.55.0