Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1332527 > unrolled thread
| Started by | Javier Martinez Canillas <javier@osg.samsung.com> |
|---|---|
| First post | 2016-02-12 05:40 +0100 |
| Last post | 2016-02-17 10:40 +0100 |
| Articles | 10 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Javier Martinez Canillas <javier@osg.samsung.com> - 2016-02-12 05:40 +0100
Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-02-15 08:00 +0100
Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Lee Jones <lee.jones@linaro.org> - 2016-02-15 09:30 +0100
Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Javier Martinez Canillas <javier@osg.samsung.com> - 2016-02-15 16:30 +0100
Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-02-16 00:30 +0100
Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Javier Martinez Canillas <javier@osg.samsung.com> - 2016-02-16 21:50 +0100
Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-02-17 08:50 +0100
Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Javier Martinez Canillas <javier@osg.samsung.com> - 2016-02-17 19:40 +0100
Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Marek Szyprowski <m.szyprowski@samsung.com> - 2016-02-17 10:30 +0100
Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-02-17 10:40 +0100
| From | Javier Martinez Canillas <javier@osg.samsung.com> |
|---|---|
| Date | 2016-02-12 05:40 +0100 |
| Subject | [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r1dGq-1XX-7@gated-at.bofh.it> |
The driver's init and exit function don't do anything besides adding and
deleting the I2C driver so the module_i2c_driver() macro could be used.
Currently is not being used because the driver is initialized at subsys
initcall level, claiming that this is done to allow consumers devices to
use the resources provided by this driver. But dependencies should be in
the DT and consumers drivers should not rely in the registration order.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/mfd/max77686.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index 1f30c97d6d4e..2f563d0f83cc 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -400,18 +400,7 @@ static struct i2c_driver max77686_i2c_driver = {
.id_table = max77686_i2c_id,
};
-static int __init max77686_i2c_init(void)
-{
- return i2c_add_driver(&max77686_i2c_driver);
-}
-/* init early so consumer devices can complete system boot */
-subsys_initcall(max77686_i2c_init);
-
-static void __exit max77686_i2c_exit(void)
-{
- i2c_del_driver(&max77686_i2c_driver);
-}
-module_exit(max77686_i2c_exit);
+module_i2c_driver(max77686_i2c_driver);
MODULE_DESCRIPTION("MAXIM 77686/802 multi-function core driver");
MODULE_AUTHOR("Chiwoong Byun <woong.byun@samsung.com>");
--
2.5.0
[toc] | [next] | [standalone]
| From | Krzysztof Kozlowski <k.kozlowski@samsung.com> |
|---|---|
| Date | 2016-02-15 08:00 +0100 |
| Subject | Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r2liy-5Ku-1@gated-at.bofh.it> |
| In reply to | #1332527 |
On 12.02.2016 13:30, Javier Martinez Canillas wrote: > The driver's init and exit function don't do anything besides adding and > deleting the I2C driver so the module_i2c_driver() macro could be used. > > Currently is not being used because the driver is initialized at subsys > initcall level, claiming that this is done to allow consumers devices to > use the resources provided by this driver. But dependencies should be in > the DT and consumers drivers should not rely in the registration order. > > Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> > --- > > drivers/mfd/max77686.c | 13 +------------ > 1 file changed, 1 insertion(+), 12 deletions(-) > In the past not all dependencies supported deferred probing so such ordering was required. I don't like the "dependencies should be in DT" reason for the change... because it is kind of wishful thinking. Yeah, the dependencies should be in DT, but are they? Instead *please check it* and write: "Dependencies are in DT so manual ordering of init calls is not necessary any more". My fast tests of this patch shown that it works good... but some more thorough tests should be done. Best regards, Krzysztof
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-02-15 09:30 +0100 |
| Subject | Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r2mHF-6N6-23@gated-at.bofh.it> |
| In reply to | #1334190 |
On Mon, 15 Feb 2016, Krzysztof Kozlowski wrote: > On 12.02.2016 13:30, Javier Martinez Canillas wrote: > > The driver's init and exit function don't do anything besides adding and > > deleting the I2C driver so the module_i2c_driver() macro could be used. > > > > Currently is not being used because the driver is initialized at subsys > > initcall level, claiming that this is done to allow consumers devices to > > use the resources provided by this driver. But dependencies should be in > > the DT and consumers drivers should not rely in the registration order. > > > > Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> > > --- > > > > drivers/mfd/max77686.c | 13 +------------ > > 1 file changed, 1 insertion(+), 12 deletions(-) > > > > In the past not all dependencies supported deferred probing so such > ordering was required. > > I don't like the "dependencies should be in DT" reason for the change... > because it is kind of wishful thinking. Yeah, the dependencies should be > in DT, but are they? > > Instead *please check it* and write: > "Dependencies are in DT so manual ordering of init calls is not > necessary any more". > > My fast tests of this patch shown that it works good... but some more > thorough tests should be done. See to all of this, collect the Acks you've received and re-submit please. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
[toc] | [prev] | [next] | [standalone]
| From | Javier Martinez Canillas <javier@osg.samsung.com> |
|---|---|
| Date | 2016-02-15 16:30 +0100 |
| Subject | Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r2tg6-2PB-27@gated-at.bofh.it> |
| In reply to | #1334190 |
Hello Krzysztof, On 02/15/2016 03:54 AM, Krzysztof Kozlowski wrote: > On 12.02.2016 13:30, Javier Martinez Canillas wrote: >> The driver's init and exit function don't do anything besides adding and >> deleting the I2C driver so the module_i2c_driver() macro could be used. >> >> Currently is not being used because the driver is initialized at subsys >> initcall level, claiming that this is done to allow consumers devices to >> use the resources provided by this driver. But dependencies should be in >> the DT and consumers drivers should not rely in the registration order. >> >> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> >> --- >> >> drivers/mfd/max77686.c | 13 +------------ >> 1 file changed, 1 insertion(+), 12 deletions(-) >> > > In the past not all dependencies supported deferred probing so such > ordering was required. > > I don't like the "dependencies should be in DT" reason for the change... > because it is kind of wishful thinking. Yeah, the dependencies should be > in DT, but are they? > > Instead *please check it* and write: > "Dependencies are in DT so manual ordering of init calls is not > necessary any more". > For the max77802 I know that's the case since the only two DTS in mainline that use it are the Peach Pit and Pi and I'm very familiar with those two. But I wonder how can I check that this is the case for the max77686. Most DTS in mainline have nodes that use some clocks and regulators provided by the PMIC, only arch/arm/boot/dts/exynos5250-smdk5250.dts doesn't have one of the regulators as input supply or clock consumer defined. For the clock, I guess the RTC is just broken since it's using the s3c6410 controller that requires a source clock and this is not defined. Now the question is if it doesn't really need the regulators or is that the DTS isn't correctly defined and some drivers were relying on the MFD and regulator drivers to be registered at subsys initcall level? > My fast tests of this patch shown that it works good... but some more > thorough tests should be done. > What do you suggest? The drivers now support deferred probing but as said, I don't know how I can be sure that drivers aren't missing input supplies and relying in regulators being registered early and marked as always-on. > Best regards, > Krzysztof > Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America
[toc] | [prev] | [next] | [standalone]
| From | Krzysztof Kozlowski <k.kozlowski@samsung.com> |
|---|---|
| Date | 2016-02-16 00:30 +0100 |
| Subject | Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r2AKC-7Tu-1@gated-at.bofh.it> |
| In reply to | #1334521 |
On 16.02.2016 00:21, Javier Martinez Canillas wrote: > Hello Krzysztof, > > On 02/15/2016 03:54 AM, Krzysztof Kozlowski wrote: >> On 12.02.2016 13:30, Javier Martinez Canillas wrote: >>> The driver's init and exit function don't do anything besides adding and >>> deleting the I2C driver so the module_i2c_driver() macro could be used. >>> >>> Currently is not being used because the driver is initialized at subsys >>> initcall level, claiming that this is done to allow consumers devices to >>> use the resources provided by this driver. But dependencies should be in >>> the DT and consumers drivers should not rely in the registration order. >>> >>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> >>> --- >>> >>> drivers/mfd/max77686.c | 13 +------------ >>> 1 file changed, 1 insertion(+), 12 deletions(-) >>> >> >> In the past not all dependencies supported deferred probing so such >> ordering was required. >> >> I don't like the "dependencies should be in DT" reason for the change... >> because it is kind of wishful thinking. Yeah, the dependencies should be >> in DT, but are they? >> >> Instead *please check it* and write: >> "Dependencies are in DT so manual ordering of init calls is not >> necessary any more". >> > > For the max77802 I know that's the case since the only two DTS in mainline > that use it are the Peach Pit and Pi and I'm very familiar with those two. > > But I wonder how can I check that this is the case for the max77686. Most > DTS in mainline have nodes that use some clocks and regulators provided by > the PMIC, only arch/arm/boot/dts/exynos5250-smdk5250.dts doesn't have one > of the regulators as input supply or clock consumer defined. +Cc Marek Szyprowski, who may know a lot more about dependencies between these. I wouldn't care for drivers not taking references to regulators/clocks. Most of necessary regulators and clocks are turned on by bootloader or by default values in PMIC. This means that later probing of PMIC shouldn't influence drivers which are not using it. The remaining problem was unsupported deferred probing by some of the drivers using regulators/clocks (drivers being consumers of regulators or clocks). AFAIR one of example was USB OTG. By "please check" in this case I mean - look if every regulator/clock consumer using stuff exposed by PMIC, supports properly deferred probing. > For the clock, I guess the RTC is just broken since it's using the s3c6410 > controller that requires a source clock and this is not defined. > > Now the question is if it doesn't really need the regulators or is that > the DTS isn't correctly defined and some drivers were relying on the MFD > and regulator drivers to be registered at subsys initcall level? I suspect the consumers are not defined in DTS. However I wouldn't care about such issue. If there is no consumer, then probe order shouldn't matter... > >> My fast tests of this patch shown that it works good... but some more >> thorough tests should be done. >> > > What do you suggest? The drivers now support deferred probing but as said, > I don't know how I can be sure that drivers aren't missing input supplies > and relying in regulators being registered early and marked as always-on. So test it... You are posting a small improvement without any important benefit but in the same time it might broke existing platforms. Perfect is the enemy of the good (or if it ain't broken, don't touch it), so please be sure that max77686 still works. :) Best regards, Krzysztof
[toc] | [prev] | [next] | [standalone]
| From | Javier Martinez Canillas <javier@osg.samsung.com> |
|---|---|
| Date | 2016-02-16 21:50 +0100 |
| Subject | Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r2UJj-4va-19@gated-at.bofh.it> |
| In reply to | #1334873 |
Hello Krzysztof, On 02/15/2016 08:20 PM, Krzysztof Kozlowski wrote: > On 16.02.2016 00:21, Javier Martinez Canillas wrote: >> Hello Krzysztof, >> >> On 02/15/2016 03:54 AM, Krzysztof Kozlowski wrote: >>> On 12.02.2016 13:30, Javier Martinez Canillas wrote: >>>> The driver's init and exit function don't do anything besides adding and >>>> deleting the I2C driver so the module_i2c_driver() macro could be used. >>>> >>>> Currently is not being used because the driver is initialized at subsys >>>> initcall level, claiming that this is done to allow consumers devices to >>>> use the resources provided by this driver. But dependencies should be in >>>> the DT and consumers drivers should not rely in the registration order. >>>> >>>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> >>>> --- >>>> >>>> drivers/mfd/max77686.c | 13 +------------ >>>> 1 file changed, 1 insertion(+), 12 deletions(-) >>>> >>> >>> In the past not all dependencies supported deferred probing so such >>> ordering was required. >>> >>> I don't like the "dependencies should be in DT" reason for the change... >>> because it is kind of wishful thinking. Yeah, the dependencies should be >>> in DT, but are they? >>> >>> Instead *please check it* and write: >>> "Dependencies are in DT so manual ordering of init calls is not >>> necessary any more". >>> >> >> For the max77802 I know that's the case since the only two DTS in mainline >> that use it are the Peach Pit and Pi and I'm very familiar with those two. >> >> But I wonder how can I check that this is the case for the max77686. Most >> DTS in mainline have nodes that use some clocks and regulators provided by >> the PMIC, only arch/arm/boot/dts/exynos5250-smdk5250.dts doesn't have one >> of the regulators as input supply or clock consumer defined. > > +Cc Marek Szyprowski, who may know a lot more about dependencies between > these. > > I wouldn't care for drivers not taking references to regulators/clocks. > Most of necessary regulators and clocks are turned on by bootloader or > by default values in PMIC. This means that later probing of PMIC > shouldn't influence drivers which are not using it. > > The remaining problem was unsupported deferred probing by some of the > drivers using regulators/clocks (drivers being consumers of regulators > or clocks). AFAIR one of example was USB OTG. > > By "please check" in this case I mean - look if every regulator/clock > consumer using stuff exposed by PMIC, supports properly deferred probing. > Got it, I checked and all but one consumer driver that use resources provided by the max77686 defer probe when this is not found AFAICT. Clocks: drivers/mmc/core/pwrseq_simple.c drivers/rtc/rtc-s3c.c Regulators: drivers/cpufreq/cpufreq-dt.c drivers/gpu/drm/exynos/exynos_drm_dsi.c drivers/gpu/drm/exynos/exynos_hdmi.c drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c drivers/iio/adc/exynos_adc.c drivers/input/misc/max77693-haptic.c drivers/input/touchscreen/mms114.c drivers/media/i2c/s5c73m3/s5c73m3-core.c drivers/media/i2c/s5k6a3.c drivers/media/platform/exynos4-is/mipi-csis.c drivers/mfd/wm8994-core.c drivers/mmc/host/dw_mmc.c drivers/mmc/host/sdhci.c drivers/usb/dwc2/platform.c The only driver that does not defer probe when an input supply isn't found is drivers/thermal/samsung/exynos_tmu.c (vtmu-supply). So that should be handled before this series are merged. >> For the clock, I guess the RTC is just broken since it's using the s3c6410 >> controller that requires a source clock and this is not defined. >> >> Now the question is if it doesn't really need the regulators or is that >> the DTS isn't correctly defined and some drivers were relying on the MFD >> and regulator drivers to be registered at subsys initcall level? > > I suspect the consumers are not defined in DTS. However I wouldn't care > about such issue. If there is no consumer, then probe order shouldn't > matter... > Ok. >> >>> My fast tests of this patch shown that it works good... but some more >>> thorough tests should be done. >>> >> >> What do you suggest? The drivers now support deferred probing but as said, >> I don't know how I can be sure that drivers aren't missing input supplies >> and relying in regulators being registered early and marked as always-on. > > So test it... You are posting a small improvement without any important Yes, problem is that I don't have access to boards with a max77686, and that's why I asked for help to test the series on those :) > benefit but in the same time it might broke existing platforms. Perfect > is the enemy of the good (or if it ain't broken, don't touch it), so > please be sure that max77686 still works. :) Agreed, I never said that adding regressions was justified. I just wanted to get rid of the initcall levels ordering hack but of course only after the patches have been tested and found to not cause regressions. But feel free to nack the series if you consider this to be too risky. > > Best regards, > Krzysztof > Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America
[toc] | [prev] | [next] | [standalone]
| From | Krzysztof Kozlowski <k.kozlowski@samsung.com> |
|---|---|
| Date | 2016-02-17 08:50 +0100 |
| Subject | Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r3522-3dd-11@gated-at.bofh.it> |
| In reply to | #1335823 |
On 17.02.2016 05:45, Javier Martinez Canillas wrote: > Hello Krzysztof, > > On 02/15/2016 08:20 PM, Krzysztof Kozlowski wrote: >> On 16.02.2016 00:21, Javier Martinez Canillas wrote: >>> Hello Krzysztof, >>> >>> On 02/15/2016 03:54 AM, Krzysztof Kozlowski wrote: >>>> On 12.02.2016 13:30, Javier Martinez Canillas wrote: >>>>> The driver's init and exit function don't do anything besides >>>>> adding and >>>>> deleting the I2C driver so the module_i2c_driver() macro could be >>>>> used. >>>>> >>>>> Currently is not being used because the driver is initialized at >>>>> subsys >>>>> initcall level, claiming that this is done to allow consumers >>>>> devices to >>>>> use the resources provided by this driver. But dependencies should >>>>> be in >>>>> the DT and consumers drivers should not rely in the registration >>>>> order. >>>>> >>>>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> >>>>> --- >>>>> >>>>> drivers/mfd/max77686.c | 13 +------------ >>>>> 1 file changed, 1 insertion(+), 12 deletions(-) >>>>> >>>> >>>> In the past not all dependencies supported deferred probing so such >>>> ordering was required. >>>> >>>> I don't like the "dependencies should be in DT" reason for the >>>> change... >>>> because it is kind of wishful thinking. Yeah, the dependencies >>>> should be >>>> in DT, but are they? >>>> >>>> Instead *please check it* and write: >>>> "Dependencies are in DT so manual ordering of init calls is not >>>> necessary any more". >>>> >>> >>> For the max77802 I know that's the case since the only two DTS in >>> mainline >>> that use it are the Peach Pit and Pi and I'm very familiar with those >>> two. >>> >>> But I wonder how can I check that this is the case for the max77686. >>> Most >>> DTS in mainline have nodes that use some clocks and regulators >>> provided by >>> the PMIC, only arch/arm/boot/dts/exynos5250-smdk5250.dts doesn't have >>> one >>> of the regulators as input supply or clock consumer defined. >> >> +Cc Marek Szyprowski, who may know a lot more about dependencies between >> these. >> >> I wouldn't care for drivers not taking references to regulators/clocks. >> Most of necessary regulators and clocks are turned on by bootloader or >> by default values in PMIC. This means that later probing of PMIC >> shouldn't influence drivers which are not using it. >> >> The remaining problem was unsupported deferred probing by some of the >> drivers using regulators/clocks (drivers being consumers of regulators >> or clocks). AFAIR one of example was USB OTG. >> >> By "please check" in this case I mean - look if every regulator/clock >> consumer using stuff exposed by PMIC, supports properly deferred probing. >> > > Got it, I checked and all but one consumer driver that use resources > provided by the max77686 defer probe when this is not found AFAICT. > > Clocks: > > drivers/mmc/core/pwrseq_simple.c > drivers/rtc/rtc-s3c.c > > Regulators: > > drivers/cpufreq/cpufreq-dt.c > drivers/gpu/drm/exynos/exynos_drm_dsi.c > drivers/gpu/drm/exynos/exynos_hdmi.c > drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c > drivers/iio/adc/exynos_adc.c > drivers/input/misc/max77693-haptic.c > drivers/input/touchscreen/mms114.c > drivers/media/i2c/s5c73m3/s5c73m3-core.c > drivers/media/i2c/s5k6a3.c > drivers/media/platform/exynos4-is/mipi-csis.c > drivers/mfd/wm8994-core.c > drivers/mmc/host/dw_mmc.c > drivers/mmc/host/sdhci.c > drivers/usb/dwc2/platform.c > > The only driver that does not defer probe when an input supply > isn't found is drivers/thermal/samsung/exynos_tmu.c (vtmu-supply). > > So that should be handled before this series are merged. Thanks for the analysis. Indeed the exynos_tmu does not support probe deferral. Instead it just ignores the error and skips the regulator. It would be good to fix this before applying this patch. Rest looks indeed good so I don't have objections (beside tmu case). Best regards, Krzysztof
[toc] | [prev] | [next] | [standalone]
| From | Javier Martinez Canillas <javier@osg.samsung.com> |
|---|---|
| Date | 2016-02-17 19:40 +0100 |
| Subject | Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r3fb5-1S3-43@gated-at.bofh.it> |
| In reply to | #1336113 |
Hello Krzysztof, On 02/17/2016 04:49 AM, Krzysztof Kozlowski wrote: > On 17.02.2016 05:45, Javier Martinez Canillas wrote: [snip] >>> >>> By "please check" in this case I mean - look if every regulator/clock >>> consumer using stuff exposed by PMIC, supports properly deferred probing. >>> >> >> Got it, I checked and all but one consumer driver that use resources >> provided by the max77686 defer probe when this is not found AFAICT. >> >> Clocks: >> >> drivers/mmc/core/pwrseq_simple.c >> drivers/rtc/rtc-s3c.c >> >> Regulators: >> >> drivers/cpufreq/cpufreq-dt.c >> drivers/gpu/drm/exynos/exynos_drm_dsi.c >> drivers/gpu/drm/exynos/exynos_hdmi.c >> drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c >> drivers/iio/adc/exynos_adc.c >> drivers/input/misc/max77693-haptic.c >> drivers/input/touchscreen/mms114.c >> drivers/media/i2c/s5c73m3/s5c73m3-core.c >> drivers/media/i2c/s5k6a3.c >> drivers/media/platform/exynos4-is/mipi-csis.c >> drivers/mfd/wm8994-core.c >> drivers/mmc/host/dw_mmc.c >> drivers/mmc/host/sdhci.c >> drivers/usb/dwc2/platform.c >> >> The only driver that does not defer probe when an input supply >> isn't found is drivers/thermal/samsung/exynos_tmu.c (vtmu-supply). >> >> So that should be handled before this series are merged. > > Thanks for the analysis. Indeed the exynos_tmu does not support probe > deferral. Instead it just ignores the error and skips the regulator. It > would be good to fix this before applying this patch. > Ok. I'll take care of that, probably tomorrow. > Rest looks indeed good so I don't have objections (beside tmu case). > Thanks a lot for your feedback and suggestions. > Best regards, > Krzysztof > -- Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America
[toc] | [prev] | [next] | [standalone]
| From | Marek Szyprowski <m.szyprowski@samsung.com> |
|---|---|
| Date | 2016-02-17 10:30 +0100 |
| Subject | Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r36AO-4lp-3@gated-at.bofh.it> |
| In reply to | #1334873 |
Hello,
On 2016-02-16 00:20, Krzysztof Kozlowski wrote:
> On 16.02.2016 00:21, Javier Martinez Canillas wrote:
>> Hello Krzysztof,
>>
>> On 02/15/2016 03:54 AM, Krzysztof Kozlowski wrote:
>>> On 12.02.2016 13:30, Javier Martinez Canillas wrote:
>>>> The driver's init and exit function don't do anything besides adding and
>>>> deleting the I2C driver so the module_i2c_driver() macro could be used.
>>>>
>>>> Currently is not being used because the driver is initialized at subsys
>>>> initcall level, claiming that this is done to allow consumers devices to
>>>> use the resources provided by this driver. But dependencies should be in
>>>> the DT and consumers drivers should not rely in the registration order.
>>>>
>>>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>>>> ---
>>>>
>>>> drivers/mfd/max77686.c | 13 +------------
>>>> 1 file changed, 1 insertion(+), 12 deletions(-)
>>>>
>>> In the past not all dependencies supported deferred probing so such
>>> ordering was required.
>>>
>>> I don't like the "dependencies should be in DT" reason for the change...
>>> because it is kind of wishful thinking. Yeah, the dependencies should be
>>> in DT, but are they?
>>>
>>> Instead *please check it* and write:
>>> "Dependencies are in DT so manual ordering of init calls is not
>>> necessary any more".
>>>
>> For the max77802 I know that's the case since the only two DTS in mainline
>> that use it are the Peach Pit and Pi and I'm very familiar with those two.
>>
>> But I wonder how can I check that this is the case for the max77686. Most
>> DTS in mainline have nodes that use some clocks and regulators provided by
>> the PMIC, only arch/arm/boot/dts/exynos5250-smdk5250.dts doesn't have one
>> of the regulators as input supply or clock consumer defined.
> +Cc Marek Szyprowski, who may know a lot more about dependencies between
> these.
>
> I wouldn't care for drivers not taking references to regulators/clocks.
> Most of necessary regulators and clocks are turned on by bootloader or
> by default values in PMIC. This means that later probing of PMIC
> shouldn't influence drivers which are not using it.
>
> The remaining problem was unsupported deferred probing by some of the
> drivers using regulators/clocks (drivers being consumers of regulators
> or clocks). AFAIR one of example was USB OTG.
USB OTG has been recently fixed to finally support deferred probing, see
commit 855ed04a3758b205e84b269f92d26ab36ed8e2f7 ("usb: gadget: udc-core:
independent registration of gadgets and gadget drivers").
> By "please check" in this case I mean - look if every regulator/clock
> consumer using stuff exposed by PMIC, supports properly deferred probing.
>
>> For the clock, I guess the RTC is just broken since it's using the s3c6410
>> controller that requires a source clock and this is not defined.
>>
>> Now the question is if it doesn't really need the regulators or is that
>> the DTS isn't correctly defined and some drivers were relying on the MFD
>> and regulator drivers to be registered at subsys initcall level?
> I suspect the consumers are not defined in DTS. However I wouldn't care
> about such issue. If there is no consumer, then probe order shouldn't
> matter...
>
>>> My fast tests of this patch shown that it works good... but some more
>>> thorough tests should be done.
>>>
>> What do you suggest? The drivers now support deferred probing but as said,
>> I don't know how I can be sure that drivers aren't missing input supplies
>> and relying in regulators being registered early and marked as always-on.
> So test it... You are posting a small improvement without any important
> benefit but in the same time it might broke existing platforms. Perfect
> is the enemy of the good (or if it ain't broken, don't touch it), so
> please be sure that max77686 still works. :)
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
[toc] | [prev] | [next] | [standalone]
| From | Krzysztof Kozlowski <k.kozlowski@samsung.com> |
|---|---|
| Date | 2016-02-17 10:40 +0100 |
| Subject | Re: [PATCH 2/4] mfd: max77686: Use module_i2c_driver() instead of subsys initcall |
| Message-ID | <r36Kt-4qr-3@gated-at.bofh.it> |
| In reply to | #1336159 |
On 17.02.2016 18:27, Marek Szyprowski wrote:
> Hello,
>
> On 2016-02-16 00:20, Krzysztof Kozlowski wrote:
>> On 16.02.2016 00:21, Javier Martinez Canillas wrote:
>>> Hello Krzysztof,
>>>
>>> On 02/15/2016 03:54 AM, Krzysztof Kozlowski wrote:
>>>> On 12.02.2016 13:30, Javier Martinez Canillas wrote:
>>>>> The driver's init and exit function don't do anything besides
>>>>> adding and
>>>>> deleting the I2C driver so the module_i2c_driver() macro could be
>>>>> used.
>>>>>
>>>>> Currently is not being used because the driver is initialized at
>>>>> subsys
>>>>> initcall level, claiming that this is done to allow consumers
>>>>> devices to
>>>>> use the resources provided by this driver. But dependencies should
>>>>> be in
>>>>> the DT and consumers drivers should not rely in the registration
>>>>> order.
>>>>>
>>>>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>>>>> ---
>>>>>
>>>>> drivers/mfd/max77686.c | 13 +------------
>>>>> 1 file changed, 1 insertion(+), 12 deletions(-)
>>>>>
>>>> In the past not all dependencies supported deferred probing so such
>>>> ordering was required.
>>>>
>>>> I don't like the "dependencies should be in DT" reason for the
>>>> change...
>>>> because it is kind of wishful thinking. Yeah, the dependencies
>>>> should be
>>>> in DT, but are they?
>>>>
>>>> Instead *please check it* and write:
>>>> "Dependencies are in DT so manual ordering of init calls is not
>>>> necessary any more".
>>>>
>>> For the max77802 I know that's the case since the only two DTS in
>>> mainline
>>> that use it are the Peach Pit and Pi and I'm very familiar with those
>>> two.
>>>
>>> But I wonder how can I check that this is the case for the max77686.
>>> Most
>>> DTS in mainline have nodes that use some clocks and regulators
>>> provided by
>>> the PMIC, only arch/arm/boot/dts/exynos5250-smdk5250.dts doesn't have
>>> one
>>> of the regulators as input supply or clock consumer defined.
>> +Cc Marek Szyprowski, who may know a lot more about dependencies between
>> these.
>>
>> I wouldn't care for drivers not taking references to regulators/clocks.
>> Most of necessary regulators and clocks are turned on by bootloader or
>> by default values in PMIC. This means that later probing of PMIC
>> shouldn't influence drivers which are not using it.
>>
>> The remaining problem was unsupported deferred probing by some of the
>> drivers using regulators/clocks (drivers being consumers of regulators
>> or clocks). AFAIR one of example was USB OTG.
>
> USB OTG has been recently fixed to finally support deferred probing, see
> commit 855ed04a3758b205e84b269f92d26ab36ed8e2f7 ("usb: gadget: udc-core:
> independent registration of gadgets and gadget drivers").
Thanks for the confirmation!
Best regards,
Krzysztof
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web