* [PATCH] iio: adc: Nothing in ADC should be a bool CONFIG
@ 2014-04-22 0:03 Doug Anderson
2014-04-23 20:54 ` Jonathan Cameron
2014-04-26 10:30 ` Jonathan Cameron
0 siblings, 2 replies; 5+ messages in thread
From: Doug Anderson @ 2014-04-22 0:03 UTC (permalink / raw)
To: Jonathan Cameron, Lars-Peter Clausen
Cc: Milo.Kim, Naveen Krishna Chatradhi, Doug Anderson, lee.jones,
gregkh, Russ.Dill, alexandre.belloni, oleksandr.kozaruk, B38611,
johannes.thumshirn, sre, sachin.kamat, linux-iio, linux-kernel
The whole IIO subsystem can be moved to a module. If you make it a
module then stuff marked as "Y" in the adc directory simply won't be
linked in properly.
The two configs that were wrong were EXYNOS_ADC and LP8788_ADC. I
know for a fact that EXYNOS_ADC will work as a module (though it
appears to crash when you unload it--that needs to be addressed
separately). I assume LP8788_ADC will also be fine..
Signed-off-by: Doug Anderson <dianders@chromium.org>
---
drivers/iio/adc/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index d86196c..24c28e3 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -106,7 +106,7 @@ config AT91_ADC
Say yes here to build support for Atmel AT91 ADC.
config EXYNOS_ADC
- bool "Exynos ADC driver support"
+ tristate "Exynos ADC driver support"
depends on OF
help
Core support for the ADC block found in the Samsung EXYNOS series
@@ -114,7 +114,7 @@ config EXYNOS_ADC
this resource.
config LP8788_ADC
- bool "LP8788 ADC driver"
+ tristate "LP8788 ADC driver"
depends on MFD_LP8788
help
Say yes here to build support for TI LP8788 ADC.
--
1.9.1.423.g4596e3a
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: adc: Nothing in ADC should be a bool CONFIG
2014-04-22 0:03 [PATCH] iio: adc: Nothing in ADC should be a bool CONFIG Doug Anderson
@ 2014-04-23 20:54 ` Jonathan Cameron
2014-04-23 21:54 ` Doug Anderson
2014-04-26 10:30 ` Jonathan Cameron
1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2014-04-23 20:54 UTC (permalink / raw)
To: Doug Anderson, Lars-Peter Clausen
Cc: Milo.Kim, Naveen Krishna Chatradhi, lee.jones, gregkh, Russ.Dill,
alexandre.belloni, oleksandr.kozaruk, B38611, johannes.thumshirn,
sre, sachin.kamat, linux-iio, linux-kernel
On 22/04/14 01:03, Doug Anderson wrote:
> The whole IIO subsystem can be moved to a module. If you make it a
> module then stuff marked as "Y" in the adc directory simply won't be
> linked in properly.
>
> The two configs that were wrong were EXYNOS_ADC and LP8788_ADC. I
> know for a fact that EXYNOS_ADC will work as a module (though it
> appears to crash when you unload it--that needs to be addressed
> separately).
I'd really like to see this pinned down before taking this patch.
I can see you argument that the current approach is clearly wrong,
but swapping one issue for another is not an approach I'd particularly
like to take...
I can't immediately spot the cause of the crash, but there are certainly
some interesting order issues in this driver. Not enabling the vdd
regulator until after the userspace interfaces are exposed (by the
iio_device_register call) is interesting for a start.
The remove doesn't run in the reverse of the probe order (see clocks
vs regulators for example.)
Gah, my reviewing for one clearly missed some things in this driver.
> I assume LP8788_ADC will also be fine..
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
> drivers/iio/adc/Kconfig | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index d86196c..24c28e3 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -106,7 +106,7 @@ config AT91_ADC
> Say yes here to build support for Atmel AT91 ADC.
>
> config EXYNOS_ADC
> - bool "Exynos ADC driver support"
> + tristate "Exynos ADC driver support"
> depends on OF
> help
> Core support for the ADC block found in the Samsung EXYNOS series
> @@ -114,7 +114,7 @@ config EXYNOS_ADC
> this resource.
>
> config LP8788_ADC
> - bool "LP8788 ADC driver"
> + tristate "LP8788 ADC driver"
> depends on MFD_LP8788
> help
> Say yes here to build support for TI LP8788 ADC.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: adc: Nothing in ADC should be a bool CONFIG
2014-04-23 20:54 ` Jonathan Cameron
@ 2014-04-23 21:54 ` Doug Anderson
[not found] ` <5358951A.3080507@kernel.org>
0 siblings, 1 reply; 5+ messages in thread
From: Doug Anderson @ 2014-04-23 21:54 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Milo.Kim, Naveen Krishna Chatradhi, Lee Jones,
Greg Kroah-Hartman, Russ.Dill, alexandre.belloni,
oleksandr.kozaruk, B38611, johannes.thumshirn, sre, Sachin Kamat,
linux-iio, linux-kernel@vger.kernel.org
Jonathan,
On Wed, Apr 23, 2014 at 1:54 PM, Jonathan Cameron <jic23@kernel.org> wrote:
> On 22/04/14 01:03, Doug Anderson wrote:
>>
>> The whole IIO subsystem can be moved to a module. If you make it a
>> module then stuff marked as "Y" in the adc directory simply won't be
>> linked in properly.
>>
>> The two configs that were wrong were EXYNOS_ADC and LP8788_ADC. I
>> know for a fact that EXYNOS_ADC will work as a module (though it
>> appears to crash when you unload it--that needs to be addressed
>> separately).
>
> I'd really like to see this pinned down before taking this patch.
> I can see you argument that the current approach is clearly wrong,
> but swapping one issue for another is not an approach I'd particularly
> like to take...
>
> I can't immediately spot the cause of the crash, but there are certainly
> some interesting order issues in this driver. Not enabling the vdd
> regulator until after the userspace interfaces are exposed (by the
> iio_device_register call) is interesting for a start.
>
> The remove doesn't run in the reverse of the probe order (see clocks
> vs regulators for example.)
>
> Gah, my reviewing for one clearly missed some things in this driver.
OK, fair enough. I took a quick look and couldn't spot anything
either. I've requested that Samsung dig into these problems. If they
are unable to I will take a crack at it as time permits. ;)
Thanks!
-Doug
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: adc: Nothing in ADC should be a bool CONFIG
[not found] ` <5358951A.3080507@kernel.org>
@ 2014-04-24 20:23 ` Doug Anderson
0 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-04-24 20:23 UTC (permalink / raw)
To: Jonathan Cameron, Naveen Krishna Chatradhi
Cc: Lars-Peter Clausen, Milo.Kim, Lee Jones, Greg Kroah-Hartman,
Russ.Dill, alexandre.belloni, oleksandr.kozaruk, B38611,
johannes.thumshirn, sre, Sachin Kamat, linux-iio,
linux-kernel@vger.kernel.org
Jonathan / Naveen,
On Wed, Apr 23, 2014 at 9:37 PM, Jonathan Cameron <jic23@kernel.org> wrote:
> On 23/04/14 22:54, Doug Anderson wrote:
>>
>> Jonathan,
>>
>> On Wed, Apr 23, 2014 at 1:54 PM, Jonathan Cameron <jic23@kernel.org>
>> wrote:
>>>
>>> On 22/04/14 01:03, Doug Anderson wrote:
>>>>
>>>>
>>>> The whole IIO subsystem can be moved to a module. If you make it a
>>>> module then stuff marked as "Y" in the adc directory simply won't be
>>>> linked in properly.
>>>>
>>>> The two configs that were wrong were EXYNOS_ADC and LP8788_ADC. I
>>>> know for a fact that EXYNOS_ADC will work as a module (though it
>>>> appears to crash when you unload it--that needs to be addressed
>>>> separately).
>>>
>>>
>>> I'd really like to see this pinned down before taking this patch.
>>> I can see you argument that the current approach is clearly wrong,
>>> but swapping one issue for another is not an approach I'd particularly
>>> like to take...
>>>
>>> I can't immediately spot the cause of the crash, but there are certainly
>>> some interesting order issues in this driver. Not enabling the vdd
>>> regulator until after the userspace interfaces are exposed (by the
>>> iio_device_register call) is interesting for a start.
>>>
>>> The remove doesn't run in the reverse of the probe order (see clocks
>>> vs regulators for example.)
>>>
>>> Gah, my reviewing for one clearly missed some things in this driver.
>>
>>
>> OK, fair enough. I took a quick look and couldn't spot anything
>> either. I've requested that Samsung dig into these problems. If they
>> are unable to I will take a crack at it as time permits. ;)
>>
> Cool and good luck (either way ;)
Ah ha! Naveen pointed out that it was the "device_for_each_child"
that was the source of the crash. ...and here's the problem... I
think this is what we want:
- ret = of_platform_populate(np, exynos_adc_match, NULL, &pdev->dev);
+ ret = of_platform_populate(np, exynos_adc_match, NULL, &indio_dev->dev);
- device_for_each_child(&pdev->dev, NULL,
+ device_for_each_child(&indio_dev->dev, NULL,
Naveen has been volunteered to send the patch up. ;) Naveen:
hopefully you can address Jonathan's other concerns as well. ;)
-Doug
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: adc: Nothing in ADC should be a bool CONFIG
2014-04-22 0:03 [PATCH] iio: adc: Nothing in ADC should be a bool CONFIG Doug Anderson
2014-04-23 20:54 ` Jonathan Cameron
@ 2014-04-26 10:30 ` Jonathan Cameron
1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2014-04-26 10:30 UTC (permalink / raw)
To: Doug Anderson, Lars-Peter Clausen
Cc: Milo.Kim, Naveen Krishna Chatradhi, lee.jones, gregkh, Russ.Dill,
alexandre.belloni, oleksandr.kozaruk, B38611, johannes.thumshirn,
sre, sachin.kamat, linux-iio, linux-kernel
On 22/04/14 01:03, Doug Anderson wrote:
> The whole IIO subsystem can be moved to a module. If you make it a
> module then stuff marked as "Y" in the adc directory simply won't be
> linked in properly.
>
> The two configs that were wrong were EXYNOS_ADC and LP8788_ADC. I
> know for a fact that EXYNOS_ADC will work as a module (though it
> appears to crash when you unload it--that needs to be addressed
> separately). I assume LP8788_ADC will also be fine..
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
Now the fix is in for the Exynos crash, I've applied this (with
some description editing to reflect that the crash isn't there
any more) to the fixes-togreg branch of iio.git.
We may get some functional breakage on Lp8788 if someone did
build this as a module as it provides some services to the
charger driver. The right dependencies are there though so
may be fine and as you point out, it is definitely bad right now.
Thanks,
J
> ---
> drivers/iio/adc/Kconfig | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index d86196c..24c28e3 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -106,7 +106,7 @@ config AT91_ADC
> Say yes here to build support for Atmel AT91 ADC.
>
> config EXYNOS_ADC
> - bool "Exynos ADC driver support"
> + tristate "Exynos ADC driver support"
> depends on OF
> help
> Core support for the ADC block found in the Samsung EXYNOS series
> @@ -114,7 +114,7 @@ config EXYNOS_ADC
> this resource.
>
> config LP8788_ADC
> - bool "LP8788 ADC driver"
> + tristate "LP8788 ADC driver"
> depends on MFD_LP8788
> help
> Say yes here to build support for TI LP8788 ADC.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-04-26 10:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-22 0:03 [PATCH] iio: adc: Nothing in ADC should be a bool CONFIG Doug Anderson
2014-04-23 20:54 ` Jonathan Cameron
2014-04-23 21:54 ` Doug Anderson
[not found] ` <5358951A.3080507@kernel.org>
2014-04-24 20:23 ` Doug Anderson
2014-04-26 10:30 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).