All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Harry Song <jundongsong1@gmail.com>,
	tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irqchip/gic-v3-its: remove the shareability of ITS
Date: Fri, 09 Dec 2022 11:27:41 +0000	[thread overview]
Message-ID: <86edt8rf4i.wl-maz@kernel.org> (raw)
In-Reply-To: <20221208165820.5maej4we3mfdeprm@mercury.elektranox.org>

On Thu, 08 Dec 2022 16:58:20 +0000,
Sebastian Reichel <sebastian.reichel@collabora.com> wrote:
> 
> [1  <text/plain; us-ascii (quoted-printable)>]
> Hi,
> 
> On Thu, Dec 08, 2022 at 10:28:29AM +0800, Harry Song wrote:
> > On Wed, Dec 7, 2022 at 11:19 PM Marc Zyngier <maz@kernel.org> wrote:
> > >
> > > On Wed, 07 Dec 2022 13:52:23 +0000,
> > > Harry Song <jundongsong1@gmail.com> wrote:
> > > >
> > > > I know this is a very wrong patch, but my platform
> > > > has an abnormal ITS problem caused by data consistency:
> > > > My chip does not support Cache Coherent Interconnect (CCI).
> > >
> > > That doesn't mean much. Nothing mandates to have a CCI, and plenty of
> > > systems have other ways to maintain coherency.
> > >
> > > > By default, ITS driver is the inner memory attribute.
> > > > gits_write_cbaser() is used to write the inner memory
> > > > attribute. But hw doesn't return the hardware's non-shareable
> > > > property,so I don't think reading GITS_CBASER and GICR_PROPBASER
> > > > here will get the real property of the current hardware: inner
> > > > or outer shareable is not supported, so I would like to know
> > > > whether ITS driver cannot be used on chips without CCI, or
> > > > what method can be used to use ITS driver on chips without CCI?
> > >
> > > It's not about CCI or not CCI. It is about which shareability domain
> > > your ITS is in.
> > >
> > > And it doesn't only affect the ITS. It also affects the
> > > redistributors, and anything that accesses memory.
> > >
> > 
> > Yes, my current chip is Rockchip platform (rk3588), so is it because the chip
> > is not designed as a proper shared domain for ITS, so the exception of
> > ITS is caused?
> > 
> > > >
> > > > The current patch is designed to make ITS think that the current
> > > > chip has no inner or outer memory properties, and then use
> > > > its by flushing dcache.
> > > >
> > > > This is the log for bug reports without patches:
> > > >
> > > > [    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000003460000
> > > > [    0.000000] ITS [mem 0x03440000-0x0345ffff]
> > > > [    0.000000] ITS@0x0000000003440000: allocated 8192 Devices @41850000 (indirect, esz 8, psz 64K, shr 0)
> > > > [    0.000000] ITS@0x0000000003440000: allocated 32768 Interrupt Collections @41860000 (flat, esz 2, psz 64K, shr 0)
> > > > [    0.000000] GICv3: using LPI property table @0x0000000041870000
> > > > [    0.000000] GICv3: CPU0: using allocated LPI pending table @0x0000000041880000
> > > > [    0.000000] ITS queue timeout (64 1)
> > > > [    0.000000] ITS cmd its_build_mapc_cmd failed
> > > > [    0.000000] ITS queue timeout (128 1)
> > > > [    0.000000] ITS cmd its_build_invall_cmd failed
> > >
> > > Ah, this suspiciously looks like a Rockchip machine...
> > >
> > > >
> > > > Signed-off-by: Harry Song <jundongsong1@gmail.com>
> > > > ---
> > > >
> > > > I am very sorry to bother you. This problem has been bothering me
> > > > for several weeks.  I am looking forward to your reply.
> > >
> > > If you have such issue, this needs to be handled as per-platform
> > > quirk. I'm not putting such generic hacks in the driver.
> > >
> > >         M.
> > >
> > > --
> > > Without deviation from the norm, progress is not possible.
> > 
> > Are there currently other chip platforms that have this problem, and then ITS
> > is already compatible with the problem? Please tell me how to submit
> > hacks patch for rk3588 platform?
> > 
> > If the hacks patch cannot be submitted, please tell me whether it
> > requires the next generation
> > chip to have any design requirements for ITS?
> > 
> > Design ITS and CPU to be the same inner memory property?
> 
> Previous rockchip generation has the same bug and it got discussed
> here:
> 
> https://lore.kernel.org/lkml/871rbdt4tu.wl-maz@kernel.org/T/#m5dbc70ff308d81e98dd0d797e23d3fbf9c353245
> 
> You can use this DT as base with mainline to avoid ITS:
> 
> https://lore.kernel.org/all/20221205172350.75234-1-sebastian.reichel@collabora.com/

Using the MBI region really isn't the same thing. You're limited to a
handful of MSI instead of 64k, and you don't get any device isolation.

Also, your usage of the GIC binding is pretty broken. A single PPI
partition covering all the CPUs, the two PMU having the same PPI and
#interrupt-calls=3, that's all completely wrong.

	M.

-- 
Without deviation from the norm, progress is not possible.

  parent reply	other threads:[~2022-12-09 11:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 13:52 [PATCH] irqchip/gic-v3-its: remove the shareability of ITS Harry Song
2022-12-07 15:19 ` Marc Zyngier
2022-12-08  2:28   ` Harry Song
2022-12-08 16:58     ` Sebastian Reichel
2022-12-09  3:34       ` Harry Song
2022-12-09 11:13         ` Marc Zyngier
2022-12-09 13:37           ` Harry Song
2023-02-13  7:30             ` Harry Song
2023-02-13  8:35               ` Marc Zyngier
2022-12-09 11:27       ` Marc Zyngier [this message]
2022-12-09 11:10     ` Marc Zyngier

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=86edt8rf4i.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=jundongsong1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.