From: linux@armlinux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/9] arm: cache-l2x0: share l2x0_base
Date: Tue, 19 Dec 2017 23:10:20 +0000 [thread overview]
Message-ID: <20171219231020.GF10595@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20171005164831.GG5235@leverpostej>
On Thu, Oct 05, 2017 at 05:48:32PM +0100, Mark Rutland wrote:
> On Thu, Jul 20, 2017 at 02:29:23AM +0200, Micha? Miros?aw wrote:
> > Share l2x0_base between cache-l2x0 and pmu drivers. They are duplicates.
>
> This is not quite true, and this change introduces bugs.
>
> The l2x0 pmu driver only sets its copy of the base for an l2x0 variant
> it recognises:
>
> > -void __init l2x0_pmu_register(void __iomem *base, u32 part)
> > +void __init l2x0_pmu_register(u32 part)
> > {
> > /*
> > * Determine whether we support the PMU, and choose the name for sysfs.
> > @@ -503,8 +502,7 @@ void __init l2x0_pmu_register(void __iomem *base, u32 part)
> > * supported by this driver.
> > *
> > * We must defer registering the PMU until the perf subsystem is up and
> > - * running, so just stash the name and base, and leave that to another
> > - * initcall.
> > + * running, so just stash the name, and leave that to another initcall.
> > */
> > switch (part & L2X0_CACHE_ID_PART_MASK) {
> > case L2X0_CACHE_ID_PART_L220:
> > @@ -516,8 +514,6 @@ void __init l2x0_pmu_register(void __iomem *base, u32 part)
> > default:
> > return;
> > }
> > -
> > - l2x0_base = base;
>
> ... note that we may return *before* setting l2x0_base.
>
> This (deliberately) prevents us from erroneously registering a PMU for
> l2x0 variants for which we don't know how to drive any IMPLEMENTATION
> DEFINED PMU functionality.
>
> This cahnge breaks that, and will result in l2x0_pmu_init() trying to
> register a PMU with a NULL name.
>
> So NAK to this change.
Also I don't want the virtual base address of the L2 cache exposed to
the world, that's an invitation for people to do what they did years
ago, and throw code left right and centre into the tree that accesses
the L2 cache directly from all sorts of places - the result was very
much a mess that took a big patch series to sort out.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
next prev parent reply other threads:[~2017-12-19 23:10 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-20 0:29 [PATCH 0/9] Bringing Asus TF300T support to mainline Michał Mirosław
2017-07-20 0:29 ` [PATCH 1/9] ARM: enable secure platform-only erratas Michał Mirosław
2017-10-05 15:53 ` Dmitry Osipenko
2017-10-05 18:16 ` Dmitry Osipenko
2017-12-19 23:28 ` Russell King - ARM Linux
2017-12-20 12:49 ` Dmitry Osipenko
2017-07-20 0:29 ` [PATCH 2/9] arm: cache-l2x0: remove duplicate warning Michał Mirosław
2017-07-20 0:29 ` [PATCH 3/9] arm: cache-l2x0: share l2x0_base Michał Mirosław
2017-10-05 16:48 ` Mark Rutland
2017-12-19 23:10 ` Russell King - ARM Linux [this message]
2017-07-20 0:29 ` [PATCH 4/9] ARM: trusted_foundations: enable L2x0 cache via firmware_ops Michał Mirosław
2017-10-05 16:24 ` Dmitry Osipenko
2017-12-19 18:56 ` Dmitry Osipenko
2017-07-20 0:29 ` [PATCH 5/9] ARM: trusted_foundations: announce firmware version Michał Mirosław
2017-07-20 0:29 ` [PATCH 7/9] ARM: tegra: enable cache via TF Michał Mirosław
2017-12-19 19:07 ` Dmitry Osipenko
2017-12-19 23:21 ` Russell King - ARM Linux
2017-07-20 0:29 ` [PATCH 8/9] ARM: tegra: avoid touching Secure registers in reset handler Michał Mirosław
2017-07-20 0:29 ` [PATCH 6/9] ARM: init: update secondary_data register documentation Michał Mirosław
2017-12-19 23:16 ` Russell King - ARM Linux
2017-07-20 0:29 ` [PATCH 9/9] ARM: tegra: fix sleeping while atomic in CPU idle Michał Mirosław
2017-07-20 12:45 ` Jon Hunter
2017-07-20 16:28 ` Michał Mirosław
2017-07-21 8:15 ` Jon Hunter
2017-07-20 7:48 ` [PATCH 0/9] Bringing Asus TF300T support to mainline Mikko Perttunen
2017-07-20 15:07 ` Michał Mirosław
2017-10-04 21:25 ` Michał Mirosław
2017-10-05 15:52 ` Dmitry Osipenko
2017-10-05 16:07 ` Dmitry Osipenko
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=20171219231020.GF10595@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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).