All of lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] drivers/bus: Split Arm CCI driver
Date: Thu, 15 Feb 2018 13:01:04 +0000	[thread overview]
Message-ID: <20180215130103.GC16623@arm.com> (raw)
In-Reply-To: <b95c7f25-89af-6a5c-993c-49720c36fd57@arm.com>

On Wed, Feb 14, 2018 at 02:28:15PM +0000, Robin Murphy wrote:
> On 14/02/18 11:51, Will Deacon wrote:
> >On Wed, Feb 07, 2018 at 01:07:53PM +0000, Robin Murphy wrote:
> >>Hi Punit,
> >>
> >>On 07/02/18 12:22, Punit Agrawal wrote:
> >>[...]
> >>>>-static void __iomem *cci_ctrl_base;
> >>>>+void __iomem *cci_ctrl_base __ro_after_init;
> >>>
> >>>Initially I wondered if cci_ctrl_base gets used in the pmu driver before
> >>>it's initialised. But as it gets set in early_initcall() that looks to
> >>>be fine.
> >>
> >>In fact it's even more robust than initcall ordering, since the PMU device
> >>will only be created at all via cci_platform_probe(), thus cci_init() is
> >>guaranteed to have run successfully before the PMU driver probe can ever
> >>touch anything.
> >
> >Could you hijack the platform data at this point by passing an of_dev_auxdata
> >to of_platform_populate and then use that to pass the __iomem address to the
> >PMU driver?
> 
> OK, I've cooked up the patch below (on top of this series), but I'm
> currently somewhat on the fence about how nice it really is :/

Yeah, the ugly part is:

> +const struct of_dev_auxdata arm_cci_auxdata[] = {
> +	OF_DEV_AUXDATA("arm,cci-400-pmu", 0, NULL, &cci_ctrl_base),
> +	OF_DEV_AUXDATA("arm,cci-400-pmu,r0", 0, NULL, &cci_ctrl_base),
> +	OF_DEV_AUXDATA("arm,cci-400-pmu,r1", 0, NULL, &cci_ctrl_base),
> +	OF_DEV_AUXDATA("arm,cci-500-pmu,r0", 0, NULL, &cci_ctrl_base),
> +	OF_DEV_AUXDATA("arm,cci-550-pmu,r0", 0, NULL, &cci_ctrl_base),
> +	{}
> +};

I suppose you could macro-ise this table to hide the redundancy, but it's up
to you.

Will

  reply	other threads:[~2018-02-15 13:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 18:39 [PATCH 0/5] Arm interconnect PMU driver tidyup Robin Murphy
2018-02-05 18:39 ` [PATCH 1/5] drivers/bus: Move Arm CCN PMU driver Robin Murphy
2018-02-05 18:39 ` [PATCH 2/5] drivers/bus: Split Arm CCI driver Robin Murphy
2018-02-07 12:22   ` Punit Agrawal
2018-02-07 13:07     ` Robin Murphy
2018-02-14 11:51       ` Will Deacon
2018-02-14 12:07         ` Robin Murphy
2018-02-14 14:28         ` Robin Murphy
2018-02-15 13:01           ` Will Deacon [this message]
2018-02-15 16:38             ` Robin Murphy
2018-02-05 18:39 ` [PATCH 3/5] perf/arm-cci: Simplify CPU hotplug Robin Murphy
2018-02-05 18:39 ` [PATCH 4/5] bus/arm-cci: Streamline devicetree handling a bit Robin Murphy
2018-02-05 18:39 ` [PATCH 5/5] perf/arm-cci: Clean up model discovery Robin Murphy
2018-02-15 13:00 ` [PATCH 0/5] Arm interconnect PMU driver tidyup Will Deacon

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=20180215130103.GC16623@arm.com \
    --to=will.deacon@arm.com \
    --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 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.