All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: shmobile: r8a73a4: Move pfc node to work around probe ordering bug
Date: Mon, 09 Feb 2015 18:29:19 +0000	[thread overview]
Message-ID: <20150209182918.GA2531@atomide.com> (raw)
In-Reply-To: <CAMuHMdXsbmcgRacg9CT9N7+KjOrog2F8mmGfORu31P3xyoVviA@mail.gmail.com>

* Geert Uytterhoeven <geert@linux-m68k.org> [150209 09:17]:
> On Mon, Feb 9, 2015 at 5:24 PM, Tony Lindgren <tony@atomide.com> wrote:
> > * Geert Uytterhoeven <geert+renesas@glider.be> [150206 12:26]:
> >> Notes:
> >>   - It seems several people tried to solve this in the core OF probing
> >>     code before, but the final solution never went in?
> >>   - This can be reproduced on other SoCs (e.g. sh73a0 and r8a7740) by
> >>     moving their pfc nodes before their interrupt controller nodes.
> >>   - This patch is against my working tree, so it doesn't apply to
> >>     Simon's repository, but you get the idea....
> >
> > No issues with the patch, but here are few comments on the core
> > reasons (without looking at the code in this case) that might help
> > fix similar issues.
> >
> > In all the cases I've seen these errors are caused by non-standard
> > custom initcall levels for drivers like i2c bus. The real solution
> > is to initialize drivers later with standard module_init, and stop
> > the race to the bottom with custom initcall levels.
> >
> > If there is legacy board specific platofrm init code that needs
> > i2c gpios early, that code can probably be moved to initialize
> > later on.
> 
> In this case no i2c is involved. The drivers for both pinctrl
> (renesas,pfc-r8a73a4) and irqchip (renesas,irqc) are registered
> at the same level:
>   - postcore_initcall(sh_pfc_init);
>   - postcore_initcall(irqc_init);
> Hence the system uses the "natural" order from within the DTS,
> and decided to instantiate the pfc before the irqchip.

OK
 
> > Also, there should not be any need for custom driver initcall
> > levels from Linux generic framework point of view as for example
> > irqchip implementing drivers work just fine as a loadable module.
> 
> As long as no other device that's instantiated earlier references that
> irqchip?

Right :) And deferred probe won't still remove the warning in
that case. From what I remember, that's a valid warning from irq
framework point of view.

Regards,

Tony

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: shmobile: r8a73a4: Move pfc node to work around probe ordering bug
Date: Mon, 9 Feb 2015 10:29:19 -0800	[thread overview]
Message-ID: <20150209182918.GA2531@atomide.com> (raw)
In-Reply-To: <CAMuHMdXsbmcgRacg9CT9N7+KjOrog2F8mmGfORu31P3xyoVviA@mail.gmail.com>

* Geert Uytterhoeven <geert@linux-m68k.org> [150209 09:17]:
> On Mon, Feb 9, 2015 at 5:24 PM, Tony Lindgren <tony@atomide.com> wrote:
> > * Geert Uytterhoeven <geert+renesas@glider.be> [150206 12:26]:
> >> Notes:
> >>   - It seems several people tried to solve this in the core OF probing
> >>     code before, but the final solution never went in?
> >>   - This can be reproduced on other SoCs (e.g. sh73a0 and r8a7740) by
> >>     moving their pfc nodes before their interrupt controller nodes.
> >>   - This patch is against my working tree, so it doesn't apply to
> >>     Simon's repository, but you get the idea....
> >
> > No issues with the patch, but here are few comments on the core
> > reasons (without looking at the code in this case) that might help
> > fix similar issues.
> >
> > In all the cases I've seen these errors are caused by non-standard
> > custom initcall levels for drivers like i2c bus. The real solution
> > is to initialize drivers later with standard module_init, and stop
> > the race to the bottom with custom initcall levels.
> >
> > If there is legacy board specific platofrm init code that needs
> > i2c gpios early, that code can probably be moved to initialize
> > later on.
> 
> In this case no i2c is involved. The drivers for both pinctrl
> (renesas,pfc-r8a73a4) and irqchip (renesas,irqc) are registered
> at the same level:
>   - postcore_initcall(sh_pfc_init);
>   - postcore_initcall(irqc_init);
> Hence the system uses the "natural" order from within the DTS,
> and decided to instantiate the pfc before the irqchip.

OK
 
> > Also, there should not be any need for custom driver initcall
> > levels from Linux generic framework point of view as for example
> > irqchip implementing drivers work just fine as a loadable module.
> 
> As long as no other device that's instantiated earlier references that
> irqchip?

Right :) And deferred probe won't still remove the warning in
that case. From what I remember, that's a valid warning from irq
framework point of view.

Regards,

Tony

WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Grant Likely <grant.likely@linaro.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: shmobile: r8a73a4: Move pfc node to work around probe ordering bug
Date: Mon, 9 Feb 2015 10:29:19 -0800	[thread overview]
Message-ID: <20150209182918.GA2531@atomide.com> (raw)
In-Reply-To: <CAMuHMdXsbmcgRacg9CT9N7+KjOrog2F8mmGfORu31P3xyoVviA@mail.gmail.com>

* Geert Uytterhoeven <geert@linux-m68k.org> [150209 09:17]:
> On Mon, Feb 9, 2015 at 5:24 PM, Tony Lindgren <tony@atomide.com> wrote:
> > * Geert Uytterhoeven <geert+renesas@glider.be> [150206 12:26]:
> >> Notes:
> >>   - It seems several people tried to solve this in the core OF probing
> >>     code before, but the final solution never went in?
> >>   - This can be reproduced on other SoCs (e.g. sh73a0 and r8a7740) by
> >>     moving their pfc nodes before their interrupt controller nodes.
> >>   - This patch is against my working tree, so it doesn't apply to
> >>     Simon's repository, but you get the idea....
> >
> > No issues with the patch, but here are few comments on the core
> > reasons (without looking at the code in this case) that might help
> > fix similar issues.
> >
> > In all the cases I've seen these errors are caused by non-standard
> > custom initcall levels for drivers like i2c bus. The real solution
> > is to initialize drivers later with standard module_init, and stop
> > the race to the bottom with custom initcall levels.
> >
> > If there is legacy board specific platofrm init code that needs
> > i2c gpios early, that code can probably be moved to initialize
> > later on.
> 
> In this case no i2c is involved. The drivers for both pinctrl
> (renesas,pfc-r8a73a4) and irqchip (renesas,irqc) are registered
> at the same level:
>   - postcore_initcall(sh_pfc_init);
>   - postcore_initcall(irqc_init);
> Hence the system uses the "natural" order from within the DTS,
> and decided to instantiate the pfc before the irqchip.

OK
 
> > Also, there should not be any need for custom driver initcall
> > levels from Linux generic framework point of view as for example
> > irqchip implementing drivers work just fine as a loadable module.
> 
> As long as no other device that's instantiated earlier references that
> irqchip?

Right :) And deferred probe won't still remove the warning in
that case. From what I remember, that's a valid warning from irq
framework point of view.

Regards,

Tony

  reply	other threads:[~2015-02-09 18:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 20:22 [PATCH] ARM: shmobile: r8a73a4: Move pfc node to work around probe ordering bug Geert Uytterhoeven
2015-02-06 20:22 ` Geert Uytterhoeven
2015-02-06 20:22 ` Geert Uytterhoeven
2015-02-09 16:24 ` Tony Lindgren
2015-02-09 16:24   ` Tony Lindgren
2015-02-09 16:24   ` Tony Lindgren
2015-02-09 17:14   ` Geert Uytterhoeven
2015-02-09 17:14     ` Geert Uytterhoeven
2015-02-09 17:14     ` Geert Uytterhoeven
2015-02-09 18:29     ` Tony Lindgren [this message]
2015-02-09 18:29       ` Tony Lindgren
2015-02-09 18:29       ` Tony Lindgren
2015-02-10 10:19       ` Geert Uytterhoeven
2015-02-10 10:19         ` Geert Uytterhoeven
2015-02-10 10:19         ` Geert Uytterhoeven
2015-02-10 18:53         ` Laurent Pinchart
2015-02-10 18:53           ` Laurent Pinchart
2015-02-10 18:53           ` Laurent Pinchart

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=20150209182918.GA2531@atomide.com \
    --to=tony@atomide.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.