From: Marc Zyngier <maz@kernel.org>
To: Dragan Simic <dsimic@manjaro.org>
Cc: FUKAUMI Naoki <naoki@radxa.com>,
heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, tglx@linutronix.de, jonas@kwiboo.se,
macromorgan@hotmail.com, andyshrk@163.com,
liujianfeng1994@gmail.com, dmt.yashin@gmail.com,
tim@feathertop.org, marcin.juszkiewicz@linaro.org,
michael.riesch@wolfvision.net, alchark@gmail.com,
sebastian.reichel@collabora.com, jbx6244@gmail.com,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org
Subject: Re: [PATCH 1/3] irqchip/gic-v3: Enable Rockchip 3588001 erratum workaround for RK3582
Date: Sun, 22 Dec 2024 23:16:30 +0000 [thread overview]
Message-ID: <8734ifs3zl.wl-maz@kernel.org> (raw)
In-Reply-To: <f93b3bfb5151e4b617b1c99c91b4956f@manjaro.org>
Dragan,
On Sun, 22 Dec 2024 18:25:02 +0000,
Dragan Simic <dsimic@manjaro.org> wrote:
>
> Hello Marc,
>
> On 2024-12-22 10:04, Marc Zyngier wrote:
> > On Sun, 22 Dec 2024 03:03:53 +0000,
> > FUKAUMI Naoki <naoki@radxa.com> wrote:
> >>
> >> Rockchip RK3582 is a scaled down version of Rockchip RK3588(S). Apply
> >> Rockchip 3588001 erratum workaround to RK3582.
> >>
> >> Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
> >> ---
> >> drivers/irqchip/irq-gic-v3-its.c | 3 ++-
> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/irqchip/irq-gic-v3-its.c
> >> b/drivers/irqchip/irq-gic-v3-its.c
> >> index 92244cfa0464..c59ce9332dc0 100644
> >> --- a/drivers/irqchip/irq-gic-v3-its.c
> >> +++ b/drivers/irqchip/irq-gic-v3-its.c
> >> @@ -4861,7 +4861,8 @@ static bool __maybe_unused
> >> its_enable_rk3588001(void *data)
> >> {
> >> struct its_node *its = data;
> >>
> >> - if (!of_machine_is_compatible("rockchip,rk3588") &&
> >> + if (!of_machine_is_compatible("rockchip,rk3582") &&
> >> + !of_machine_is_compatible("rockchip,rk3588") &&
> >> !of_machine_is_compatible("rockchip,rk3588s"))
> >> return false;
> >>
> >
> > Please use the relevant property for that purpose ("dma-noncoherent")
> > at the distributor and ITS levels. We're not adding extra compatibles
> > for this anymore, and you might as well fix the core dtsi to expose
> > such property.
>
> Thanks for your response.
>
> After a more detailed look into drivers/irqchip/irq-gic-v3-its.c,
> it seems that relying on the "dma-noncoherent" DT property may not
> be equivalent to adding another compatible check.
It is. My email makes it plain what needs doing.
> Here are a few
> quotations from irq-gic-v3-its.c, to illustrate this better:
>
> 4746 static bool __maybe_unused its_enable_rk3588001(void *data)
> 4747 {
> 4748 struct its_node *its = data;
> 4749
> 4750 if (!of_machine_is_compatible("rockchip,rk3588") &&
> 4751 !of_machine_is_compatible("rockchip,rk3588s"))
> 4752 return false;
> 4753
> 4754 its->flags |= ITS_FLAGS_FORCE_NON_SHAREABLE;
> 4755 gic_rdists->flags |= RDIST_FLAGS_FORCE_NON_SHAREABLE;
> 4756
> 4757 return true;
> 4758 }
> 4759
> 4760 static bool its_set_non_coherent(void *data)
> 4761 {
> 4762 struct its_node *its = data;
> 4763
> 4764 its->flags |= ITS_FLAGS_FORCE_NON_SHAREABLE;
> 4765 return true;
> 4766 }
>
> 4814 #ifdef CONFIG_ROCKCHIP_ERRATUM_3588001
> 4815 {
> 4816 .desc = "ITS: Rockchip erratum RK3588001",
> 4817 .iidr = 0x0201743b,
> 4818 .mask = 0xffffffff,
> 4819 .init = its_enable_rk3588001,
> 4820 },
> 4821 #endif
> 4822 {
> 4823 .desc = "ITS: non-coherent attribute",
> 4824 .property = "dma-noncoherent",
> 4825 .init = its_set_non_coherent,
> 4826 },
Nothing tickles me more than having my own work being thrown back at
me.
>
> As visible above, using the "dma-noncoherent" DT property results
> in not setting the RDIST_FLAGS_FORCE_NON_SHAREABLE flag, which the
> its_enable_rk3588001() function does. In other words, it doesn't
> seem that "dma-noncoherent" is a "drop-in" replacement for adding
> yet another compatible for the RK3582.
You clearly haven't read what I wrote. Or rather, you read what you
wanted to read, and ignored half of it.
>
> Modifying the current behavior of the "dma-noncoherent" DT property
> doesn't seem like an option, because it's already used in a couple
> of board dts(i) files. Should we introduce another DT property,
> perhaps "dma-noncoherent-rdist" or something similar?
No. We have everything we need. Believe it or not, I actually know
what I'm talking about. I know, this is surprising. I surprise myself
sometimes.
> Could you, please, advise on how to move forward with this? I'm
I already have.
> willing to implement the required patches, but I'd prefer to reduce
> the possible back-and-forth on them, to save everyone's time.
May I suggest that you read my email again? How about grepping through
the upstream DT collection and (shock, horror) look at the imx95.dtsi
file, which suffers from the same braindead behaviour as the RK stuff?
For clarity, let me paste it here again, and add some emphasis for
extra clarity:
> > Please use the relevant property for that purpose ("dma-noncoherent")
> > at the distributor and ITS levels. We're not adding extra compatibles
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Now, please go look at the code for real this time, appreciate how the
"dma-noncoherent" property placed at the distributor *AND* ITS levels
combine to give you the effects the hardware requires.
To sum it up: the standard properties and the Rockchip hacks are
strictly equivalent, there is no need for anything extra, and I stand
by my NAK on this very patch.
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2024-12-22 23:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-22 3:03 [PATCH 0/3] rockchip: Add support for RK3582 FUKAUMI Naoki
2024-12-22 3:03 ` [PATCH 1/3] irqchip/gic-v3: Enable Rockchip 3588001 erratum workaround " FUKAUMI Naoki
2024-12-22 9:04 ` Marc Zyngier
2024-12-22 12:10 ` FUKAUMI Naoki
2024-12-22 18:25 ` Dragan Simic
2024-12-22 23:16 ` Marc Zyngier [this message]
2024-12-23 6:10 ` Dragan Simic
2024-12-23 9:29 ` Marc Zyngier
2024-12-23 10:11 ` Dragan Simic
2024-12-27 15:47 ` Dragan Simic
2024-12-22 3:03 ` [PATCH 2/3] dt-bindings: arm: rockchip: Add Radxa E52C FUKAUMI Naoki
2024-12-22 13:11 ` Conor Dooley
2024-12-23 2:13 ` FUKAUMI Naoki
2024-12-22 3:03 ` [PATCH 3/3] arm64: dts: " FUKAUMI Naoki
2024-12-22 3:58 ` FUKAUMI Naoki
2024-12-23 9:39 ` Marc Zyngier
2024-12-23 10:16 ` FUKAUMI Naoki
2024-12-27 10:27 ` Marc Zyngier
2024-12-23 10:17 ` Dragan Simic
2024-12-23 12:52 ` [PATCH 0/3] rockchip: Add support for RK3582 Rob Herring (Arm)
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=8734ifs3zl.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=alchark@gmail.com \
--cc=andyshrk@163.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmt.yashin@gmail.com \
--cc=dsimic@manjaro.org \
--cc=heiko@sntech.de \
--cc=jbx6244@gmail.com \
--cc=jonas@kwiboo.se \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=liujianfeng1994@gmail.com \
--cc=macromorgan@hotmail.com \
--cc=marcin.juszkiewicz@linaro.org \
--cc=michael.riesch@wolfvision.net \
--cc=naoki@radxa.com \
--cc=robh@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=tglx@linutronix.de \
--cc=tim@feathertop.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;
as well as URLs for NNTP newsgroup(s).