From: Daniel Palmer <daniel@0x0f.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/4] ARM: mstar: Add machine for MStar infinity family SoCs
Date: Thu, 17 Oct 2019 05:32:20 +0900 [thread overview]
Message-ID: <20191016203219.GA5191@shiro> (raw)
In-Reply-To: <CAK8P3a2U7U31eF_POU2=eCU+E1DH-wnR2uHr-VZYWLy25hLjKg@mail.gmail.com>
> > +
> > +static void __init infinity_map_io(void)
> > +{
> > + iotable_init(infinity_io_desc, ARRAY_SIZE(infinity_io_desc));
> > + miu_flush = (void __iomem *)(infinity_io_desc[0].virtual
> > + + INFINITY_L3BRIDGE_FLUSH);
> > + miu_status = (void __iomem *)(infinity_io_desc[0].virtual
> > + + INFINITY_L3BRIDGE_STATUS);
> > +}
>
> If you do this a little later in .init_machine, you can use a simple ioremap()
> rather than picking a hardcoded physical address. It looks like nothing
> uses the mapping before you set soc_mb anyway.
I've moved this into infinity_barriers_init() using ioremap() as suggested.
I'd like to keep the fixed remap address for now as there are some
drivers in the vendor code that might be useful until rewrites are done but
are littered with hard coded addresses.
> > +static DEFINE_SPINLOCK(infinity_mb_lock);
> > +
> > +static void infinity_mb(void)
> > +{
> > + unsigned long flags;
> > +
> > + spin_lock_irqsave(&infinity_mb_lock, flags);
> > + /* toggle the flush miu pipe fire bit */
> > + writel_relaxed(0, miu_flush);
> > + writel_relaxed(INFINITY_L3BRIDGE_FLUSH_TRIGGER, miu_flush);
> > + while (!(readl_relaxed(miu_status) & INFINITY_L3BRIDGE_STATUS_DONE)) {
> > + /* wait for flush to complete */
> > + }
> > + spin_unlock_irqrestore(&infinity_mb_lock, flags);
> > +}
>
> Wow, this is a heavy barrier. From your description it doesn't sound like
> there is anything to be done about it unfortunately.
It's possible there is a better way once I can find out what the L3 bridge
actually is. There is a small amount of documentation for the miu (DDR
controller) that says it has an 8 or 4 operation configurable pipeline but
this flushing bit is in a totally different area that's only documented
by the comment about it in u-boot.
> Two possible issues I see here:
>
> * It looks like it relies on CONFIG_ARM_HEAVY_BARRIER, but your Kconfig
> entry does not select that. In many configurations, CACHE_L2X0 would
> be set, but there is no need for yours on the Cortex-A7.
Fixed.
> Not sure if it matters in practice, as almost nothing uses fiq any more.
> OTOH, maybe the lock is not needed at all? AFAICT if the sequence
> gets interrupted by a handler that also calls mb(), you would still
> continue in the original thread while observing a full l3 barrier. ;-)
I've taken the lock out and tested that the ethernet isn't sending garbage
and everything looks good.
I'm still hoping for some feedback on the other parts of the series.
I'll post a v2 series in a few days.
Thanks!
Daniel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-10-16 20:32 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 6:15 [PATCH 1/4] dt-bindings: arm: Initial MStar vendor prefixes and compatible strings Daniel Palmer
2019-10-14 6:15 ` [PATCH 2/4] ARM: mstar: Add machine for MStar infinity family SoCs Daniel Palmer
2019-10-14 11:19 ` Arnd Bergmann
2019-10-16 20:32 ` Daniel Palmer [this message]
2019-10-17 13:02 ` Arnd Bergmann
2019-10-17 21:15 ` Daniel Palmer
2020-06-10 9:03 ` [PATCH v2 0/5] Initial MStar/Sigmastar ARMv7 SoC support Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 00/12] Initial MStar/Sigmastar Armv7 " Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 01/12] dt-bindings: vendor-prefixes: Add mstar vendor prefix Daniel Palmer
2020-06-16 12:15 ` [PATCH v4 00/12] Initial MStar/Sigmastar ARMv7 SoC support Daniel Palmer
2020-06-16 12:15 ` [PATCH v4 01/12] dt-bindings: vendor-prefixes: Add mstar vendor prefix Daniel Palmer
2020-07-09 23:04 ` Rob Herring
2020-06-16 12:15 ` [PATCH v4 02/12] dt-bindings: vendor-prefixes: Add sstar " Daniel Palmer
2020-07-09 23:04 ` Rob Herring
2020-06-16 12:15 ` [PATCH v4 03/12] dt-bindings: vendor-prefixes: Add 70mai " Daniel Palmer
2020-07-09 23:05 ` Rob Herring
2020-06-16 12:15 ` [PATCH v4 04/12] dt-bindings: vendor-prefixes: Add thingy.jp prefix Daniel Palmer
2020-07-09 23:05 ` Rob Herring
2020-06-16 12:15 ` [PATCH v4 05/12] dt-bindings: arm: Add mstar YAML schema Daniel Palmer
2020-07-09 23:04 ` Rob Herring
2020-06-16 12:15 ` [PATCH v4 06/12] ARM: mstar: Add machine for MStar/Sigmastar Armv7 SoCs Daniel Palmer
2020-06-16 12:15 ` [PATCH v4 07/12] ARM: mstar: Add binding details for mstar,l3bridge Daniel Palmer
2020-07-09 23:06 ` Rob Herring
2020-06-16 12:15 ` [PATCH v4 08/12] ARM: mstar: Add Armv7 base dtsi Daniel Palmer
2020-06-16 12:15 ` [PATCH v4 09/12] ARM: mstar: Add infinity/infinity3 family dtsis Daniel Palmer
2020-06-16 12:15 ` [PATCH v4 10/12] ARM: mstar: Add mercury5 series dtsis Daniel Palmer
2020-06-16 12:15 ` [PATCH v4 11/12] ARM: mstar: Add dts for msc313(e) based BreadBee boards Daniel Palmer
2020-06-16 12:15 ` [PATCH v4 12/12] ARM: mstar: Add dts for 70mai midrive d08 Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 02/12] dt-bindings: vendor-prefixes: Add sstar vendor prefix Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 03/12] dt-bindings: vendor-prefixes: Add 70mai " Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 04/12] dt-bindings: vendor-prefixes: Add thingy.jp prefix Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 05/12] dt-bindings: dt-bindings: arm: Add mstar YAML schema Daniel Palmer
2020-06-12 22:07 ` Rob Herring
2020-06-12 13:00 ` [PATCH v3 06/12] ARM: mstar: Add machine for MStar/Sigmastar Armv7 SoCs Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 07/12] ARM: mstar: Add binding details for mstar,l3bridge Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 08/12] ARM: mstar: Add Armv7 base dtsi Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 09/12] ARM: mstar: Add infinity/infinity3 family dtsis Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 10/12] ARM: mstar: Add mercury5 series dtsis Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 11/12] ARM: mstar: Add dts for msc313(e) based BreadBee boards Daniel Palmer
2020-06-12 13:00 ` [PATCH v3 12/12] ARM: mstar: Add dts for 70mai midrive d08 Daniel Palmer
2020-06-10 9:03 ` [PATCH v2 1/5] dt-bindings: arm: Initial MStar vendor prefixes and compatible strings Daniel Palmer
2020-06-10 9:35 ` Andreas Färber
2020-06-10 10:29 ` Daniel Palmer
2020-06-11 15:00 ` Andreas Färber
2020-06-10 9:04 ` [PATCH v2 2/5] ARM: mstar: Add machine for MStar/Sigmastar infinity/mercury family ARMv7 SoCs Daniel Palmer
2020-06-10 9:43 ` Arnd Bergmann
2020-06-11 12:49 ` Andreas Färber
2020-06-11 13:01 ` Daniel Palmer
2020-06-11 14:27 ` Andreas Färber
2020-06-11 14:58 ` Daniel Palmer
2020-06-11 12:58 ` Andreas Färber
2020-06-11 13:18 ` Daniel Palmer
2020-06-10 9:04 ` [PATCH v2 3/5] ARM: mstar: Add infinity/mercury series dtsi Daniel Palmer
2020-06-10 9:35 ` Marc Zyngier
2020-06-11 13:39 ` Andreas Färber
2020-06-11 14:19 ` Daniel Palmer
2020-06-11 14:39 ` Andreas Färber
2020-06-11 15:07 ` Daniel Palmer
2020-06-10 9:04 ` [PATCH v2 4/5] ARM: mstar: Add dts for msc313(e) based BreadBee boards Daniel Palmer
2020-06-11 13:45 ` Andreas Färber
2020-06-11 14:26 ` Daniel Palmer
2020-06-10 9:04 ` [PATCH v2 5/5] ARM: mstar: Add dts for 70mai midrive d08 Daniel Palmer
2020-06-11 13:54 ` Andreas Färber
2020-06-11 14:38 ` Daniel Palmer
2019-10-14 6:15 ` [PATCH 3/4] ARM: mstar: Add infinity series dtsi Daniel Palmer
2019-10-14 6:15 ` [PATCH 4/4] ARM: mstar: Add dts for msc313e based BreadBee board Daniel Palmer
2019-10-23 20:02 ` [PATCH 1/4] dt-bindings: arm: Initial MStar vendor prefixes and compatible strings Rob Herring
2019-10-23 22:43 ` Daniel Palmer
2019-10-23 23:45 ` Rob Herring
2019-10-24 1:47 ` Daniel Palmer
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=20191016203219.GA5191@shiro \
--to=daniel@0x0f.com \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).