2014-04-28 00:27:49

by Matt Porter

[permalink] [raw]
Subject: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

l2x0_of_init() is executed unconditionally within the sirfsoc_l2x0_init()
early initcall. In a multi v7 kernel this causes bcm281xx and bcm21664
platform to fail boot since they have their own pre l2x0 init sequence
that is required. Fix this by checking that a matching OF ID is present
before calling l2x0_of_init().

Reported-by: Kevin Hilman <[email protected]>
Signed-off-by: Matt Porter <[email protected]>
---
Applies against next-20140424 to fix the issue introduced in
50655e6 ARM: l2c: prima2: remove cache size override

arch/arm/mach-prima2/l2x0.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-prima2/l2x0.c b/arch/arm/mach-prima2/l2x0.c
index 09f68f0..1c2ed15 100644
--- a/arch/arm/mach-prima2/l2x0.c
+++ b/arch/arm/mach-prima2/l2x0.c
@@ -8,10 +8,24 @@

#include <linux/init.h>
#include <linux/kernel.h>
+#include <linux/of.h>
#include <asm/hardware/cache-l2x0.h>

+static const struct of_device_id sirf_l2x0_ids[] __initconst = {
+ { .compatible = "sirf,prima2-pl310-cache" },
+ { .compatible = "sirf,marco-pl310-cache" },
+ {},
+};
+
static int __init sirfsoc_l2x0_init(void)
{
- return l2x0_of_init(0, ~0);
+ struct device_node *np;
+ int ret = -EINVAL;
+
+ np = of_find_matching_node(NULL, sirf_l2x0_ids);
+ if (np)
+ ret = l2x0_of_init(0, ~0);
+
+ return ret;
}
early_initcall(sirfsoc_l2x0_init);
--
1.8.3.2


2014-04-28 09:16:33

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

On Sun, Apr 27, 2014 at 08:27:40PM -0400, Matt Porter wrote:
> l2x0_of_init() is executed unconditionally within the sirfsoc_l2x0_init()
> early initcall. In a multi v7 kernel this causes bcm281xx and bcm21664
> platform to fail boot since they have their own pre l2x0 init sequence
> that is required. Fix this by checking that a matching OF ID is present
> before calling l2x0_of_init().
>
> Reported-by: Kevin Hilman <[email protected]>
> Signed-off-by: Matt Porter <[email protected]>
> ---
> Applies against next-20140424 to fix the issue introduced in
> 50655e6 ARM: l2c: prima2: remove cache size override

Err, this only "fixes" it because it effectively disables the L2 cache
_entirely_ - in the above commit, I kill your private compatible strings.

This doesn't make sense. If the cache is already enabled, then the L2C
code won't try to enable it again.

--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

2014-04-28 13:40:58

by Matt Porter

[permalink] [raw]
Subject: Re: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

On Mon, Apr 28, 2014 at 10:15:33AM +0100, Russell King wrote:
> On Sun, Apr 27, 2014 at 08:27:40PM -0400, Matt Porter wrote:
> > l2x0_of_init() is executed unconditionally within the sirfsoc_l2x0_init()
> > early initcall. In a multi v7 kernel this causes bcm281xx and bcm21664
> > platform to fail boot since they have their own pre l2x0 init sequence
> > that is required. Fix this by checking that a matching OF ID is present
> > before calling l2x0_of_init().
> >
> > Reported-by: Kevin Hilman <[email protected]>
> > Signed-off-by: Matt Porter <[email protected]>
> > ---
> > Applies against next-20140424 to fix the issue introduced in
> > 50655e6 ARM: l2c: prima2: remove cache size override
>
> Err, this only "fixes" it because it effectively disables the L2 cache
> _entirely_ - in the above commit, I kill your private compatible strings.
>
> This doesn't make sense. If the cache is already enabled, then the L2C
> code won't try to enable it again.

Ok, please suggest an alternative. You merged this commit..it looks like
it had no ack from the platform maintainer..and I don't have hardware.
The commit is wrong, we can't have every platform executing sirfsoc's
l2x0_of_init() call/parameters by having this stuff in an early initcall
like that.

It would be pretty straightforward to add those private compatibles
back so the approach works. If not, we need to move this to
.init_machine where it's guaranteed to only run on sirfsoc.

-Matt

2014-04-28 14:30:35

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

On Sun, Apr 27, 2014 at 08:27:40PM -0400, Matt Porter wrote:
> l2x0_of_init() is executed unconditionally within the sirfsoc_l2x0_init()
> early initcall. In a multi v7 kernel this causes bcm281xx and bcm21664
> platform to fail boot since they have their own pre l2x0 init sequence
> that is required. Fix this by checking that a matching OF ID is present
> before calling l2x0_of_init().
>
> Reported-by: Kevin Hilman <[email protected]>
> Signed-off-by: Matt Porter <[email protected]>
> ---
> Applies against next-20140424 to fix the issue introduced in
> 50655e6 ARM: l2c: prima2: remove cache size override
>
> arch/arm/mach-prima2/l2x0.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-prima2/l2x0.c b/arch/arm/mach-prima2/l2x0.c
> index 09f68f0..1c2ed15 100644
> --- a/arch/arm/mach-prima2/l2x0.c
> +++ b/arch/arm/mach-prima2/l2x0.c
> @@ -8,10 +8,24 @@
>
> #include <linux/init.h>
> #include <linux/kernel.h>
> +#include <linux/of.h>
> #include <asm/hardware/cache-l2x0.h>
>
> +static const struct of_device_id sirf_l2x0_ids[] __initconst = {
> + { .compatible = "sirf,prima2-pl310-cache" },
> + { .compatible = "sirf,marco-pl310-cache" },

that same commit removed these two from DTS, did you test with old DTS,
btw any chance ?

--
balbi


Attachments:
(No filename) (1.29 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-04-28 14:37:17

by Matt Porter

[permalink] [raw]
Subject: Re: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

On Mon, Apr 28, 2014 at 09:29:51AM -0500, Felipe Balbi wrote:
> On Sun, Apr 27, 2014 at 08:27:40PM -0400, Matt Porter wrote:
> > l2x0_of_init() is executed unconditionally within the sirfsoc_l2x0_init()
> > early initcall. In a multi v7 kernel this causes bcm281xx and bcm21664
> > platform to fail boot since they have their own pre l2x0 init sequence
> > that is required. Fix this by checking that a matching OF ID is present
> > before calling l2x0_of_init().
> >
> > Reported-by: Kevin Hilman <[email protected]>
> > Signed-off-by: Matt Porter <[email protected]>
> > ---
> > Applies against next-20140424 to fix the issue introduced in
> > 50655e6 ARM: l2c: prima2: remove cache size override
> >
> > arch/arm/mach-prima2/l2x0.c | 16 +++++++++++++++-
> > 1 file changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/mach-prima2/l2x0.c b/arch/arm/mach-prima2/l2x0.c
> > index 09f68f0..1c2ed15 100644
> > --- a/arch/arm/mach-prima2/l2x0.c
> > +++ b/arch/arm/mach-prima2/l2x0.c
> > @@ -8,10 +8,24 @@
> >
> > #include <linux/init.h>
> > #include <linux/kernel.h>
> > +#include <linux/of.h>
> > #include <asm/hardware/cache-l2x0.h>
> >
> > +static const struct of_device_id sirf_l2x0_ids[] __initconst = {
> > + { .compatible = "sirf,prima2-pl310-cache" },
> > + { .compatible = "sirf,marco-pl310-cache" },
>
> that same commit removed these two from DTS, did you test with old DTS,
> btw any chance ?

The "fix" is tested against bcm281xx and bcm21664 as that is what the
l2c cleanup breaks in -next. As mentioned, I don't have the sirfsoc h/w
so this first attempt at a fix also breaks their platform. It can be
addressed by adding those platform specific compatibles back to the dts,
of course.

I'd much prefer that the sirfsoc folks fix this...it's going to break
other platforms in a multi v7 build.

-Matt


Attachments:
(No filename) (1.80 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-04-28 14:53:25

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

On Mon, Apr 28, 2014 at 10:37:09AM -0400, Matt Porter wrote:
> The "fix" is tested against bcm281xx and bcm21664 as that is what the
> l2c cleanup breaks in -next. As mentioned, I don't have the sirfsoc h/w
> so this first attempt at a fix also breaks their platform. It can be
> addressed by adding those platform specific compatibles back to the dts,
> of course.
>
> I'd much prefer that the sirfsoc folks fix this...it's going to break
> other platforms in a multi v7 build.

Well, it's about time we got rid of this from platform specific code
anyway, taking it away from platform maintainers to mess around with.
So that's what I'm doing.

It's worth noting that if you build a single zImage with exynos also
enabled, then you also end up with an unconditional call from that
code to l2x0_of_init() with it's own magic numbers - and that applies
before my changes.

So let's fix this properly and yank this crap from platform maintainers
fingers.

--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

2014-04-29 15:05:32

by Barry Song

[permalink] [raw]
Subject: Re: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

2014-04-28 22:52 GMT+08:00 Russell King - ARM Linux <[email protected]>:
> On Mon, Apr 28, 2014 at 10:37:09AM -0400, Matt Porter wrote:
>> The "fix" is tested against bcm281xx and bcm21664 as that is what the
>> l2c cleanup breaks in -next. As mentioned, I don't have the sirfsoc h/w
>> so this first attempt at a fix also breaks their platform. It can be
>> addressed by adding those platform specific compatibles back to the dts,
>> of course.
>>
>> I'd much prefer that the sirfsoc folks fix this...it's going to break
>> other platforms in a multi v7 build.
>
> Well, it's about time we got rid of this from platform specific code
> anyway, taking it away from platform maintainers to mess around with.
> So that's what I'm doing.
>
> It's worth noting that if you build a single zImage with exynos also
> enabled, then you also end up with an unconditional call from that
> code to l2x0_of_init() with it's own magic numbers - and that applies
> before my changes.
>
> So let's fix this properly and yank this crap from platform maintainers
> fingers.

i mentioned dropping specific dts compatible prop will break non-csr
platforms in the mail thread "ARM: prima2: remove L2 cache size
override" and i said i was going to send v2. you said you need it
before rc6. now it has been sent, but i am sorry it is not against
next-20140424.

>
> --
> FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
> improving, and getting towards what was expected from it.

-barry

2014-04-29 15:11:24

by Barry Song

[permalink] [raw]
Subject: Re: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

2014-04-28 21:40 GMT+08:00 Matt Porter <[email protected]>:
> On Mon, Apr 28, 2014 at 10:15:33AM +0100, Russell King wrote:
>> On Sun, Apr 27, 2014 at 08:27:40PM -0400, Matt Porter wrote:
>> > l2x0_of_init() is executed unconditionally within the sirfsoc_l2x0_init()
>> > early initcall. In a multi v7 kernel this causes bcm281xx and bcm21664
>> > platform to fail boot since they have their own pre l2x0 init sequence
>> > that is required. Fix this by checking that a matching OF ID is present
>> > before calling l2x0_of_init().
>> >
>> > Reported-by: Kevin Hilman <[email protected]>
>> > Signed-off-by: Matt Porter <[email protected]>
>> > ---
>> > Applies against next-20140424 to fix the issue introduced in
>> > 50655e6 ARM: l2c: prima2: remove cache size override
>>
>> Err, this only "fixes" it because it effectively disables the L2 cache
>> _entirely_ - in the above commit, I kill your private compatible strings.
>>
>> This doesn't make sense. If the cache is already enabled, then the L2C
>> code won't try to enable it again.
>
> Ok, please suggest an alternative. You merged this commit..it looks like
> it had no ack from the platform maintainer..and I don't have hardware.
> The commit is wrong, we can't have every platform executing sirfsoc's
> l2x0_of_init() call/parameters by having this stuff in an early initcall
> like that.
>
> It would be pretty straightforward to add those private compatibles
> back so the approach works. If not, we need to move this to
> .init_machine where it's guaranteed to only run on sirfsoc.

these has been one V1 patch at
http://permalink.gmane.org/gmane.linux.ports.arm.kernel/316312
my v2 has moved to init_irq() as Russell's suggestion.

>
> -Matt

-barry

2014-04-29 15:15:34

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

On Tue, Apr 29, 2014 at 11:05:06PM +0800, Barry Song wrote:
> 2014-04-28 22:52 GMT+08:00 Russell King - ARM Linux <[email protected]>:
> > On Mon, Apr 28, 2014 at 10:37:09AM -0400, Matt Porter wrote:
> >> The "fix" is tested against bcm281xx and bcm21664 as that is what the
> >> l2c cleanup breaks in -next. As mentioned, I don't have the sirfsoc h/w
> >> so this first attempt at a fix also breaks their platform. It can be
> >> addressed by adding those platform specific compatibles back to the dts,
> >> of course.
> >>
> >> I'd much prefer that the sirfsoc folks fix this...it's going to break
> >> other platforms in a multi v7 build.
> >
> > Well, it's about time we got rid of this from platform specific code
> > anyway, taking it away from platform maintainers to mess around with.
> > So that's what I'm doing.
> >
> > It's worth noting that if you build a single zImage with exynos also
> > enabled, then you also end up with an unconditional call from that
> > code to l2x0_of_init() with it's own magic numbers - and that applies
> > before my changes.
> >
> > So let's fix this properly and yank this crap from platform maintainers
> > fingers.
>
> i mentioned dropping specific dts compatible prop will break non-csr
> platforms in the mail thread "ARM: prima2: remove L2 cache size
> override" and i said i was going to send v2. you said you need it
> before rc6. now it has been sent, but i am sorry it is not against
> next-20140424.

FFS. IT HASN'T BEEN SENT. All that I did was drop it into linux-next
so that more people would get off their fat backsides and test this
fscking patch set - something which hasn't happened because no one
pays attention to emails sent to mailing lists.

I also told you that this was what I was going to do. But... is it
really on to hold up such a large patch set which impacts virtually
everyone because _you_ don't have time to sort out your small special
requirements - no it is not, that's just fscking selfish.

Anyway, I've had it with dealing with platform maintainers, I've yanked
this patch set, and I'm no longer planning to do anything with it -
platform maintainers have destroyed my will to get any of this series
into the kernel.

So, the L2 cache code is going to remain in its current state, and it's
going to rot because it's _FAR_ too much effort dealing with slow people
like yourselves, or people who want the series split up, or people who
whinge that there aren't any acks there (WELL GET OFF YOUR FAT BACKSIDES
AND SEND ME SOME IF YOU CARE ABOUT THIS - no, don't, I'm no longer pushing
this series.)

This is the last time I'm going to ever try cleaning up any core ARM code.
Core ARM maintanence is impossible in this environment with arm-soc split
from core ARM stuff, because core ARM stuff /always/ impacts on SoC
specific code. You can't get away from that.

My position in this community has been made impossible and obsolete by
Linaro. I'm at the point of walking away from this crap.

--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

2014-04-29 15:41:04

by Barry Song

[permalink] [raw]
Subject: Re: [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes

2014-04-29 23:14 GMT+08:00 Russell King - ARM Linux <[email protected]>:
> On Tue, Apr 29, 2014 at 11:05:06PM +0800, Barry Song wrote:
>> 2014-04-28 22:52 GMT+08:00 Russell King - ARM Linux <[email protected]>:
>> > On Mon, Apr 28, 2014 at 10:37:09AM -0400, Matt Porter wrote:
>> >> The "fix" is tested against bcm281xx and bcm21664 as that is what the
>> >> l2c cleanup breaks in -next. As mentioned, I don't have the sirfsoc h/w
>> >> so this first attempt at a fix also breaks their platform. It can be
>> >> addressed by adding those platform specific compatibles back to the dts,
>> >> of course.
>> >>
>> >> I'd much prefer that the sirfsoc folks fix this...it's going to break
>> >> other platforms in a multi v7 build.
>> >
>> > Well, it's about time we got rid of this from platform specific code
>> > anyway, taking it away from platform maintainers to mess around with.
>> > So that's what I'm doing.
>> >
>> > It's worth noting that if you build a single zImage with exynos also
>> > enabled, then you also end up with an unconditional call from that
>> > code to l2x0_of_init() with it's own magic numbers - and that applies
>> > before my changes.
>> >
>> > So let's fix this properly and yank this crap from platform maintainers
>> > fingers.
>>
>> i mentioned dropping specific dts compatible prop will break non-csr
>> platforms in the mail thread "ARM: prima2: remove L2 cache size
>> override" and i said i was going to send v2. you said you need it
>> before rc6. now it has been sent, but i am sorry it is not against
>> next-20140424.
>
> FFS. IT HASN'T BEEN SENT. All that I did was drop it into linux-next
> so that more people would get off their fat backsides and test this
> fscking patch set - something which hasn't happened because no one
> pays attention to emails sent to mailing lists.

so your point is people don't pay attention to your mails? or you are
ignored? i think that is 100% not real. i think your opinions and
mails are always respected as you are the chief arm linux expert.

>
> I also told you that this was what I was going to do. But... is it
> really on to hold up such a large patch set which impacts virtually
> everyone because _you_ don't have time to sort out your small special
> requirements - no it is not, that's just fscking selfish.
>
> Anyway, I've had it with dealing with platform maintainers, I've yanked
> this patch set, and I'm no longer planning to do anything with it -
> platform maintainers have destroyed my will to get any of this series
> into the kernel.

no, i am trying to follow your suggestion to make patch set merged and
l2 codes cleaned.
i have been trying to follow your will until now, and from the beginning.

>
> So, the L2 cache code is going to remain in its current state, and it's
> going to rot because it's _FAR_ too much effort dealing with slow people
> like yourselves, or people who want the series split up, or people who
> whinge that there aren't any acks there (WELL GET OFF YOUR FAT BACKSIDES
> AND SEND ME SOME IF YOU CARE ABOUT THIS - no, don't, I'm no longer pushing
> this series.)

people might be "selfish", but people might have some reasons to
response slowly, like holiday or family issue.
how about taking it easy? it doesn't prove you are not respected by
platform maintainers.

>
> This is the last time I'm going to ever try cleaning up any core ARM code.
> Core ARM maintanence is impossible in this environment with arm-soc split
> from core ARM stuff, because core ARM stuff /always/ impacts on SoC
> specific code. You can't get away from that.
>
> My position in this community has been made impossible and obsolete by
> Linaro. I'm at the point of walking away from this crap.

just fix the relationship and communication, that is good enough. you
have done things so well, there is no reason to give up.

>
> --
> FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
> improving, and getting towards what was expected from it.

-barry