Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1296792 > unrolled thread
| Started by | Daniel Kurtz <djkurtz@chromium.org> |
|---|---|
| First post | 2015-12-22 14:50 +0100 |
| Last post | 2016-01-01 18:30 +0100 |
| Articles | 8 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH] pinctrl: mediatek: convert to arch_initcall Daniel Kurtz <djkurtz@chromium.org> - 2015-12-22 14:50 +0100
Re: [PATCH] pinctrl: mediatek: convert to arch_initcall Linus Walleij <linus.walleij@linaro.org> - 2015-12-22 16:20 +0100
Re: [PATCH] pinctrl: mediatek: convert to arch_initcall Mark Brown <broonie@kernel.org> - 2015-12-30 18:30 +0100
Re: [PATCH] pinctrl: mediatek: convert to arch_initcall Daniel Kurtz <djkurtz@chromium.org> - 2015-12-31 14:50 +0100
Re: [PATCH] pinctrl: mediatek: convert to arch_initcall Mark Brown <broonie@kernel.org> - 2015-12-31 23:10 +0100
Re: [PATCH] pinctrl: mediatek: convert to arch_initcall Daniel Kurtz <djkurtz@chromium.org> - 2016-01-01 03:00 +0100
Re: [PATCH] pinctrl: mediatek: convert to arch_initcall Matthias Brugger <matthias.bgg@gmail.com> - 2016-01-01 15:30 +0100
Re: [PATCH] pinctrl: mediatek: convert to arch_initcall Linus Walleij <linus.walleij@linaro.org> - 2016-01-01 18:30 +0100
| From | Daniel Kurtz <djkurtz@chromium.org> |
|---|---|
| Date | 2015-12-22 14:50 +0100 |
| Subject | [PATCH] pinctrl: mediatek: convert to arch_initcall |
| Message-ID | <qIvua-4Bu-11@gated-at.bofh.it> |
Move pinctrl initialization earlier in boot so that real devices can find
their pctldev without probe deferring.
Note: We don't change mt6397 probe order in this patch, since MT6397 is mfd
PMIC, which depends on pwrap on main AP to work. Since pmic-wrap itself
is module_platform_driver, we keep it as module_init. A later patch
will convert both pmic-wrap, and all functions of the MT6397 mfd to
arch_initcall.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
---
drivers/pinctrl/mediatek/pinctrl-mt8127.c | 2 +-
drivers/pinctrl/mediatek/pinctrl-mt8135.c | 2 +-
drivers/pinctrl/mediatek/pinctrl-mt8173.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8127.c b/drivers/pinctrl/mediatek/pinctrl-mt8127.c
index b317b0b..98e0beb 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt8127.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt8127.c
@@ -351,7 +351,7 @@ static int __init mtk_pinctrl_init(void)
return platform_driver_register(&mtk_pinctrl_driver);
}
-module_init(mtk_pinctrl_init);
+arch_initcall(mtk_pinctrl_init);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("MediaTek MT8127 Pinctrl Driver");
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8135.c b/drivers/pinctrl/mediatek/pinctrl-mt8135.c
index 404f117..1c153b8 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt8135.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt8135.c
@@ -366,7 +366,7 @@ static int __init mtk_pinctrl_init(void)
return platform_driver_register(&mtk_pinctrl_driver);
}
-module_init(mtk_pinctrl_init);
+arch_initcall(mtk_pinctrl_init);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("MediaTek Pinctrl Driver");
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8173.c b/drivers/pinctrl/mediatek/pinctrl-mt8173.c
index ad27184..a62514e 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt8173.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt8173.c
@@ -394,7 +394,7 @@ static int __init mtk_pinctrl_init(void)
return platform_driver_register(&mtk_pinctrl_driver);
}
-module_init(mtk_pinctrl_init);
+arch_initcall(mtk_pinctrl_init);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("MediaTek Pinctrl Driver");
--
2.6.0.rc2.230.g3dd15c0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2015-12-22 16:20 +0100 |
| Message-ID | <qIwTg-5Bi-1@gated-at.bofh.it> |
| In reply to | #1296792 |
On Tue, Dec 22, 2015 at 2:46 PM, Daniel Kurtz <djkurtz@chromium.org> wrote: > Move pinctrl initialization earlier in boot so that real devices can find > their pctldev without probe deferring. (...) > -module_init(mtk_pinctrl_init); > +arch_initcall(mtk_pinctrl_init); So I see why you're doing this (because of wanting to avoid nasty boot probe deferrals, right?) and I'm going to apply it, because the work with probe ordering is still in the works, but I'd like some general ARM people to come in with opinions. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2015-12-30 18:30 +0100 |
| Message-ID | <qLsJs-15B-11@gated-at.bofh.it> |
| In reply to | #1296824 |
[Multipart message — attachments visible in raw view] — view raw
On Tue, Dec 22, 2015 at 04:11:47PM +0100, Linus Walleij wrote: > On Tue, Dec 22, 2015 at 2:46 PM, Daniel Kurtz <djkurtz@chromium.org> wrote: > > Move pinctrl initialization earlier in boot so that real devices can find > > their pctldev without probe deferring. > (...) > > -module_init(mtk_pinctrl_init); > > +arch_initcall(mtk_pinctrl_init); > So I see why you're doing this (because of wanting to avoid nasty boot > probe deferrals, right?) and I'm going to apply it, because the work > with probe ordering is still in the works, but I'd like some general > ARM people to come in with opinions. I really don't think we should be applying this sort of stuff unless things are actively broken right now. It's a bit of a rabbit hole we could spend a long time going down tweaking things for different systems in the same way that tweaking the link order can be and it masks the underlying issues.
[toc] | [prev] | [next] | [standalone]
| From | Daniel Kurtz <djkurtz@chromium.org> |
|---|---|
| Date | 2015-12-31 14:50 +0100 |
| Message-ID | <qLLM5-53V-11@gated-at.bofh.it> |
| In reply to | #1299432 |
On Thu, Dec 31, 2015 at 1:22 AM, Mark Brown <broonie@kernel.org> wrote: > > On Tue, Dec 22, 2015 at 04:11:47PM +0100, Linus Walleij wrote: > > On Tue, Dec 22, 2015 at 2:46 PM, Daniel Kurtz <djkurtz@chromium.org> wrote: > > > > Move pinctrl initialization earlier in boot so that real devices can find > > > their pctldev without probe deferring. > > (...) > > > -module_init(mtk_pinctrl_init); > > > +arch_initcall(mtk_pinctrl_init); > > > So I see why you're doing this (because of wanting to avoid nasty boot > > probe deferrals, right?) and I'm going to apply it, because the work > > with probe ordering is still in the works, but I'd like some general > > ARM people to come in with opinions. > > I really don't think we should be applying this sort of stuff unless > things are actively broken right now. It's a bit of a rabbit hole we > could spend a long time going down tweaking things for different > systems in the same way that tweaking the link order can be and it masks > the underlying issues. Things are actively broken right now, in the sense that there are many needless probe deferrals on boot. These are pinctrl drivers, which are required to load before every other driver that requests a gpio. AFAICT, the pinctrl is part of the platform "architecture", hence why I suggest we move this to arch_initcall(). arch_initcall() is also consistent with 39 other pinctrl drivers in drivers/pinctrl. 19 others use subsys_initcall(), core_initcall() or postcore_initcall(), any of which would also work. -Dan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2015-12-31 23:10 +0100 |
| Message-ID | <qLTzX-1Jf-1@gated-at.bofh.it> |
| In reply to | #1299669 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Dec 31, 2015 at 09:45:51PM +0800, Daniel Kurtz wrote: > On Thu, Dec 31, 2015 at 1:22 AM, Mark Brown <broonie@kernel.org> wrote: > > I really don't think we should be applying this sort of stuff unless > > things are actively broken right now. It's a bit of a rabbit hole we > > could spend a long time going down tweaking things for different > > systems in the same way that tweaking the link order can be and it masks > > the underlying issues. > Things are actively broken right now, in the sense that there are many > needless probe deferrals on boot. That's just noisy, everything does end up loading OK. If the noise is a problem working on fixing the underlying problem with not being able to figure out dependencies seems like a better thing. When we discussed this on the kernel summit list it wasn't clear everyone was convinced this was even a problem (I think it is since it obscures real information). Actual breakage to me is something that never sorts itself out. > These are pinctrl drivers, which are required to load before every > other driver that requests a gpio. > AFAICT, the pinctrl is part of the platform "architecture", hence why > I suggest we move this to arch_initcall(). This is exactly the sort of hacking that leads to problems - you can also make the same argument for a bunch of other things like regulators but then you find there's circular dependencies or extra devices with different requirements on some systems that cause further issues and need more special casing, or you find that some other device gets pushed earlier so you have to go round tweaking everything it uses. It's not that the device is magic, it's that we don't understand how to handle dependencies well enough. Raphael did say he was going to work on something for this, I'm not sure where it got to though. > arch_initcall() is also consistent with 39 other pinctrl drivers in > drivers/pinctrl. > 19 others use subsys_initcall(), core_initcall() or > postcore_initcall(), any of which would also work. It's fairly clear that there's at least a case for simplifying the existing practice here, for example by moving everything into a single (perhaps aliased) initcall rather than by randomly picking a level per system or by actually fiddling with the link ordering if the case is sufficiently clear that pinctrl in general ought to load earlier than it does.
[toc] | [prev] | [next] | [standalone]
| From | Daniel Kurtz <djkurtz@chromium.org> |
|---|---|
| Date | 2016-01-01 03:00 +0100 |
| Message-ID | <qLXay-3Jy-1@gated-at.bofh.it> |
| In reply to | #1299785 |
Hi Mark, Thanks for responding. On Fri, Jan 1, 2016 at 6:07 AM, Mark Brown <broonie@kernel.org> wrote: > On Thu, Dec 31, 2015 at 09:45:51PM +0800, Daniel Kurtz wrote: >> On Thu, Dec 31, 2015 at 1:22 AM, Mark Brown <broonie@kernel.org> wrote: > >> > I really don't think we should be applying this sort of stuff unless >> > things are actively broken right now. It's a bit of a rabbit hole we >> > could spend a long time going down tweaking things for different >> > systems in the same way that tweaking the link order can be and it masks >> > the underlying issues. > >> Things are actively broken right now, in the sense that there are many >> needless probe deferrals on boot. > > That's just noisy, everything does end up loading OK. It's not just noisy, it also adds to boot time. > If the noise is a > problem working on fixing the underlying problem with not being able to > figure out dependencies seems like a better thing. When we discussed > this on the kernel summit list it wasn't clear everyone was convinced > this was even a problem (I think it is since it obscures real > information). Actual breakage to me is something that never sorts > itself out. > >> These are pinctrl drivers, which are required to load before every >> other driver that requests a gpio. >> AFAICT, the pinctrl is part of the platform "architecture", hence why >> I suggest we move this to arch_initcall(). > > This is exactly the sort of hacking that leads to problems What problems? More patches as people adjust / tune / optimize boot time, or something else? > you can > also make the same argument for a bunch of other things like regulators > but then you find there's circular dependencies or extra devices with > different requirements on some systems that cause further issues and > need more special casing, or you find that some other device gets pushed > earlier so you have to go round tweaking everything it uses. For regulators, I think things are a bit more subtle. Most regulators are external components that can be used on different boards for different purposes, so I can see an argument for treating them in a more generic way by using a later device_initcall. The exception being architecture specific PMICs that only make sense when paired with a specific small set of CPUs - and if you look, there are many PMIC regulator drivers that are at earlier initcall levels, presumably because they are required by cpufreq drivers, and/or their initcall level is set as the same as the rest of the functions exposed by the same PMIC MFD. > It's not > that the device is magic, it's that we don't understand how to handle > dependencies well enough. Raphael did say he was going to work on > something for this, I'm not sure where it got to though. Glad to hear it is a well recognized problem, and that people plan to look into a fix. >> arch_initcall() is also consistent with 39 other pinctrl drivers in >> drivers/pinctrl. >> 19 others use subsys_initcall(), core_initcall() or >> postcore_initcall(), any of which would also work. > > It's fairly clear that there's at least a case for simplifying the > existing practice here, for example by moving everything into a single > (perhaps aliased) initcall rather than by randomly picking a level per > system or by actually fiddling with the link ordering if the case is > sufficiently clear that pinctrl in general ought to load earlier than it > does. Nothing above sounds like a reason not to merge this patch, however. Why should we block useful patches that use existing tools to fix real architecture-specific issues until new infrastructure is merged that solves general problems? -Dan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Matthias Brugger <matthias.bgg@gmail.com> |
|---|---|
| Date | 2016-01-01 15:30 +0100 |
| Message-ID | <qM8Sn-3z5-17@gated-at.bofh.it> |
| In reply to | #1299817 |
On January 1, 2016 3:56:01 AM EET, Daniel Kurtz <djkurtz@chromium.org> wrote: >Hi Mark, > >Thanks for responding. > >On Fri, Jan 1, 2016 at 6:07 AM, Mark Brown <broonie@kernel.org> wrote: >> On Thu, Dec 31, 2015 at 09:45:51PM +0800, Daniel Kurtz wrote: >>> On Thu, Dec 31, 2015 at 1:22 AM, Mark Brown <broonie@kernel.org> >wrote: >> >>> > I really don't think we should be applying this sort of stuff >unless >>> > things are actively broken right now. It's a bit of a rabbit hole >we >>> > could spend a long time going down tweaking things for different >>> > systems in the same way that tweaking the link order can be and it >masks >>> > the underlying issues. >> >>> Things are actively broken right now, in the sense that there are >many >>> needless probe deferrals on boot. >> >> That's just noisy, everything does end up loading OK. > >It's not just noisy, it also adds to boot time. > >> If the noise is a >> problem working on fixing the underlying problem with not being able >to >> figure out dependencies seems like a better thing. When we discussed >> this on the kernel summit list it wasn't clear everyone was convinced >> this was even a problem (I think it is since it obscures real >> information). Actual breakage to me is something that never sorts >> itself out. >> >>> These are pinctrl drivers, which are required to load before every >>> other driver that requests a gpio. >>> AFAICT, the pinctrl is part of the platform "architecture", hence >why >>> I suggest we move this to arch_initcall(). >> >> This is exactly the sort of hacking that leads to problems > >What problems? >More patches as people adjust / tune / optimize boot time, or something >else? > >> you can >> also make the same argument for a bunch of other things like >regulators >> but then you find there's circular dependencies or extra devices with >> different requirements on some systems that cause further issues and >> need more special casing, or you find that some other device gets >pushed >> earlier so you have to go round tweaking everything it uses. > >For regulators, I think things are a bit more subtle. Most regulators >are external components that can be used on different boards for >different purposes, so I can see an argument for treating them in a >more generic way by using a later device_initcall. The exception >being architecture specific PMICs that only make sense when paired >with a specific small set of CPUs - and if you look, there are many >PMIC regulator drivers that are at earlier initcall levels, presumably >because they are required by cpufreq drivers, and/or their initcall >level is set as the same as the rest of the functions exposed by the >same PMIC MFD. > >> It's not >> that the device is magic, it's that we don't understand how to handle >> dependencies well enough. Raphael did say he was going to work on >> something for this, I'm not sure where it got to though. > >Glad to hear it is a well recognized problem, and that people plan to >look into a fix. > >>> arch_initcall() is also consistent with 39 other pinctrl drivers in >>> drivers/pinctrl. >>> 19 others use subsys_initcall(), core_initcall() or >>> postcore_initcall(), any of which would also work. >> >> It's fairly clear that there's at least a case for simplifying the >> existing practice here, for example by moving everything into a >single >> (perhaps aliased) initcall rather than by randomly picking a level >per >> system or by actually fiddling with the link ordering if the case is >> sufficiently clear that pinctrl in general ought to load earlier than >it >> does. > >Nothing above sounds like a reason not to merge this patch, however. >Why should we block useful patches that use existing tools to fix real >architecture-specific issues until new infrastructure is merged that >solves general problems? > I think what Mark means is, that we define some pinctrl_initcall which is a macro to subsys_initcall (or arch_initcall or similar). We apply this to all pinctrl drivers including the one from Mediatek. This way at least we have a common method and changing the behaviour in the future is easier to handle. Regards, Matthias -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2016-01-01 18:30 +0100 |
| Message-ID | <qMbGz-5lD-27@gated-at.bofh.it> |
| In reply to | #1299929 |
On Fri, Jan 1, 2016 at 3:27 PM, Matthias Brugger <matthias.bgg@gmail.com> wrote: > On January 1, 2016 3:56:01 AM EET, Daniel Kurtz <djkurtz@chromium.org> wrote: >>> It's fairly clear that there's at least a case for simplifying the >>> existing practice here, for example by moving everything into a >>single >>> (perhaps aliased) initcall rather than by randomly picking a level >>per >>> system or by actually fiddling with the link ordering if the case is >>> sufficiently clear that pinctrl in general ought to load earlier than >>it >>> does. >> >>Nothing above sounds like a reason not to merge this patch, however. >>Why should we block useful patches that use existing tools to fix real >>architecture-specific issues until new infrastructure is merged that >>solves general problems? > > I think what Mark means is, that we define some pinctrl_initcall which > is a macro to subsys_initcall (or arch_initcall or similar). We apply this > to all pinctrl drivers including the one from Mediatek. This way at least > we have a common method and changing the behaviour in the future is > easier to handle. That would be pinctrl_soc_initcall() in that case. Just pinctrl_initcall() would assume it's for all drivers and there is a bunch of them that are just fine with simple device_initcall()s. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web