From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-renesas-soc@vger.kernel.org
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Frank Li <Frank.Li@nxp.com>, Vinod Koul <vkoul@kernel.org>,
Frank Li <Frank.Li@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
dmaengine@vger.kernel.org
Subject: [PATCH v2 2/4] dmaengine: sh: rcar-dmac: SMMU doesn't need IPMMU workaround
Date: Wed, 9 Sep 2026 11:40:11 +0200 [thread overview]
Message-ID: <20260909094009.2167-8-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20260909094009.2167-6-wsa+renesas@sang-engineering.com>
R-Car Gen5 doesn't use an IPMMU anymore, but a SMMU. So, the workaround
for the IPMMU becomes optional. Add a flag to distinguish. No functional
change.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---
Changes since v1:
* tags added (Thanks Frank)
* renamed the flag-variable (Thanks Geert)
* added a comment that Gen4 might not be affected
drivers/dma/sh/rcar-dmac.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index cf07c17847d0..4eca52aeec02 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -219,10 +219,12 @@ struct rcar_dmac {
* struct rcar_dmac_of_data - This driver's OF data
* @chan_offset_base: DMAC channels base offset
* @chan_offset_stride: DMAC channels offset stride
+ * @broken_ipmmu_microTLB0: flag if the connected IPMMU has microTLB0 issues
*/
struct rcar_dmac_of_data {
u32 chan_offset_base;
u32 chan_offset_stride;
+ unsigned int broken_ipmmu_microTLB0:1;
};
/* -----------------------------------------------------------------------------
@@ -1877,8 +1879,9 @@ static int rcar_dmac_probe(struct platform_device *pdev)
* can't use it with the IPMMU. As the IOMMU API operates at the device
* level we can't disable it selectively, so ignore channel 0 for now if
* the device is part of an IOMMU group.
+ * Not applicable if system uses something else than IPMMU like SMMU.
*/
- if (device_iommu_mapped(&pdev->dev))
+ if (data->broken_ipmmu_microTLB0 && device_iommu_mapped(&pdev->dev))
dmac->channels_mask &= ~BIT(0);
dmac->channels = devm_kcalloc(&pdev->dev, dmac->n_channels,
@@ -2000,11 +2003,14 @@ static void rcar_dmac_shutdown(struct platform_device *pdev)
static const struct rcar_dmac_of_data rcar_dmac_data = {
.chan_offset_base = 0x8000,
.chan_offset_stride = 0x80,
+ .broken_ipmmu_microTLB0 = 1,
};
static const struct rcar_dmac_of_data rcar_gen4_dmac_data = {
.chan_offset_base = 0x0,
.chan_offset_stride = 0x1000,
+ /* Set to play safe. Needs testing if Gen4 is really affected */
+ .broken_ipmmu_microTLB0 = 1,
};
static const struct of_device_id rcar_dmac_of_ids[] = {
--
2.53.0
next prev parent reply other threads:[~2026-09-09 9:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 9:40 [PATCH v2 0/4] dmaengine: sh: rcar-dmac: add R-Car Gen5 X5H support Wolfram Sang
2026-09-09 9:40 ` [PATCH v2 1/4] dmaengine: sh: rcar-dmac: fix style in struct initialization Wolfram Sang
2026-09-09 9:40 ` Wolfram Sang [this message]
2026-09-09 13:02 ` [PATCH v2 2/4] dmaengine: sh: rcar-dmac: SMMU doesn't need IPMMU workaround Geert Uytterhoeven
2026-09-09 9:40 ` [PATCH v2 3/4] dt-bindings: renesas,rcar-dmac: Add support for R-Car X5H SoC Wolfram Sang
2026-09-09 9:40 ` [PATCH v2 4/4] dmaengine: sh: rcar-dmac: Add support for R-Car Gen5 SoCs Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260909094009.2167-8-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=Frank.Li@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=dmaengine@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox