From: Pawel Moll <pawel.moll@arm.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: "devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/5] ARM: vexpress: Add DT support in v2m
Date: Fri, 18 Nov 2011 12:20:50 +0000 [thread overview]
Message-ID: <1321618850.24216.325.camel@hornet.cambridge.arm.com> (raw)
In-Reply-To: <20111117160536.GU9581@n2100.arm.linux.org.uk>
On Thu, 2011-11-17 at 16:05 +0000, Russell King - ARM Linux wrote:
> On Fri, Nov 11, 2011 at 06:27:04PM +0000, Pawel Moll wrote:
> > +#if defined(CONFIG_ARCH_VEXPRESS_DT)
> > + int err;
> > + const char *path;
> > + struct device_node *node;
> > +
> > + node = of_find_compatible_node(NULL, NULL, "arm,sp810");
> > + BUG_ON(!node);
> > + sysctl_base = of_iomap(node, 0);
> > + BUG_ON(!sysctl_base);
> > +
> > + err = of_property_read_string(of_aliases, "timer", &path);
> > + BUG_ON(err);
> > + node = of_find_node_by_path(path);
> > + BUG_ON(!node);
> > + timer01_base = of_iomap(node, 0);
> > + BUG_ON(!timer01_base);
> > + timer01_irq = irq_of_parse_and_map(node, 0);
>
> Are you sure you have enough BUG_ON()s there?
Yes, just enough, thank you.
> It's well worth reading
> Linus' various messages on the use of BUG(), which can be found:
>
> http://yarchive.net/comp/linux/BUG.html
It was worth reading indeed. I will adapt to the policy.
> The lack of the timer and sysctl registers are really a 'report and maybe
> we could get a message out' kind of scenario rather than a 'oops, kill
> the machine'.
>
> > +#endif
> > + } else {
> > sysctl_base = ioremap(V2M_SYSCTL, SZ_4K);
> > BUG_ON(!sysctl_base);
> > timer01_base = ioremap(V2M_TIMER01, SZ_4K);
> > BUG_ON(!timer01_base);
> > timer01_irq = IRQ_V2M_TIMER0;
> > + }
>
> And in any case, both these paths have a common set of BUG_ON()s:
> BUG_ON(!sysctl_base);
> BUG_ON(!timer01_base);
>
> So do we really need them having this independently?
No, you are right.
> > @@ -383,11 +412,18 @@ static struct clk_lookup v2m_lookups[] = {
> > },
> > };
> >
> > +static void __init v2m_system_id(void)
> > +{
> > + if (!system_rev)
> > + system_rev = readl(v2m_sysreg_base + V2M_SYS_ID);
>
> You do understand that system_rev is for the system _revision_ not for
> some kind of system ID. For example, it's to identify whether we're on
> a revision 4, 5 or 6 system.
SYS_ID encodes the motherboard revision (SYS_ID >> 28) and the FPGA
build (SYS_ID & 0xf) - those two together constitute the system
revision. As as 4 < 5 < 6, SYS_IDs of Rev A < Rev B < Rev C. I should
have masked out the non-relevant bits.
> However, with DT the differences in system revision should be encoded
> into the DT itself, and the kernel should not be making choices about
> the hardware off this.
This change had nothing to do DT or making choices - I was simply asked
to expose this information to the userspace for testing purposes and the
system_rev, available via /proc/cpuinfo seemed the best choice.
But as this change has nothing to do with DT it shouldn't be included in
this patch in the first place. I will split it out.
All comments appreciated as always, thanks!
Pawel
next prev parent reply other threads:[~2011-11-18 12:20 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 18:27 [PATCH 0/5] Versatile Express DT support, take 2 Pawel Moll
2011-11-11 18:27 ` [PATCH 1/5] ARM: vexpress: Get rid of MMIO_P2V Pawel Moll
[not found] ` <1321036026-23411-2-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2011-11-16 15:35 ` Dave Martin
2011-11-16 16:16 ` Pawel Moll
[not found] ` <1321460205.3137.352.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-16 17:28 ` Dave Martin
2011-11-16 17:30 ` Pawel Moll
2011-11-17 7:02 ` Ryan Harkin
2011-11-17 15:43 ` Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll
[not found] ` <1321618848.24216.322.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-18 17:44 ` Russell King - ARM Linux
2011-11-11 18:27 ` [PATCH 2/5] ARM: vexpress: Remove platform SMP functions from ct_desc Pawel Moll
[not found] ` <1321036026-23411-3-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2011-11-17 15:31 ` Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll
2011-11-11 18:27 ` [PATCH 3/5] ARM: vexpress: Add DT support in v2m Pawel Moll
[not found] ` <1321036026-23411-4-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2011-11-16 15:44 ` Dave Martin
[not found] ` <20111116154402.GE2073-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2011-11-16 16:26 ` Rob Herring
2011-11-16 16:37 ` Pawel Moll
[not found] ` <1321461458.3137.374.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-16 16:59 ` Rob Herring
2011-11-16 17:07 ` Pawel Moll
2011-11-16 17:37 ` Pawel Moll
[not found] ` <1321465054.3137.386.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-16 19:14 ` Dave Martin
[not found] ` <1321463271.3137.380.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-16 17:39 ` Dave Martin
[not found] ` <20111116173945.GG2073-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2011-11-16 17:50 ` Dave Martin
2011-11-16 17:55 ` Pawel Moll
2011-11-17 15:53 ` Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll
[not found] ` <1321618849.24216.323.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-18 17:49 ` Russell King - ARM Linux
2011-11-16 16:35 ` Pawel Moll
[not found] ` <1321461315.3137.371.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-16 17:57 ` Dave Martin
2011-11-17 13:50 ` Pawel Moll
[not found] ` <1321537813.3137.475.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-17 14:41 ` Dave Martin
2011-11-17 16:05 ` Russell King - ARM Linux
[not found] ` <20111117160536.GU9581-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2011-11-17 18:37 ` Dave Martin
[not found] ` <20111117183726.GE3044-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2011-11-18 17:52 ` Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll [this message]
2011-11-11 18:27 ` [PATCH 4/5] ARM: vexpress: Initial RS1 memory map support Pawel Moll
[not found] ` <1321036026-23411-5-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2011-11-16 15:42 ` Dave Martin
2011-11-16 16:28 ` Pawel Moll
[not found] ` <1321460897.3137.364.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-16 18:03 ` Dave Martin
2011-11-17 15:36 ` Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll
[not found] ` <1321618850.24216.324.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-18 17:56 ` Russell King - ARM Linux
2011-11-11 18:27 ` [PATCH 5/5] ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4 Pawel Moll
[not found] ` <1321036026-23411-6-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2011-11-11 22:30 ` Rob Herring
2011-11-11 22:54 ` Pawel Moll
2011-11-16 15:36 ` Dave Martin
2011-11-16 16:22 ` Pawel Moll
[not found] ` <1321460559.3137.358.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-11-16 18:17 ` Dave Martin
[not found] ` <1321036026-23411-1-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2011-11-16 15:33 ` [PATCH 0/5] Versatile Express DT support, take 2 Dave Martin
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=1321618850.24216.325.camel@hornet.cambridge.arm.com \
--to=pawel.moll@arm.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@arm.linux.org.uk \
/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