2015-07-24 13:53:29

by Michal Simek

[permalink] [raw]
Subject: [RFC PATCH] mmc: Kconfig: Add dependency on GPIOLIB for Arasan driver

The patch "mmc: sdhci-of-arasan: Call OF parsing for MMC"
(sha1: 16b23787fc709fe60c5d2bd05927b1a3da33d4e9) introduce new
dependency on GPIOLIB which calls mmc_of_parse() ->
mmc_gpiod_request_cd() (slot-gpio.c) which calls devm_gpiod_get_index()
which returns -ENOSYS.

Error log:
sdhci-arasan ff160000.sdhci: parsing dt failed (4294967258)
sdhci-arasan: probe of ff160000.sdhci failed with error -38

Signed-off-by: Michal Simek <[email protected]>
---

This problem is probably in all others drivers.
This is one way how this can be solved.
Maybe better way is to block return value for cd and wp.

---
drivers/mmc/host/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index fd9a58e216a5..4b5854759cfc 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -120,6 +120,7 @@ config MMC_SDHCI_PLTFM
config MMC_SDHCI_OF_ARASAN
tristate "SDHCI OF support for the Arasan SDHCI controllers"
depends on MMC_SDHCI_PLTFM
+ depends on GPIOLIB
depends on OF
help
This selects the Arasan Secure Digital Host Controller Interface
--
2.3.5


2015-07-27 21:55:29

by Scott Branden

[permalink] [raw]
Subject: Re: [RFC PATCH] mmc: Kconfig: Add dependency on GPIOLIB for Arasan driver

Hi Michal,

comment in line

On 15-07-24 06:53 AM, Michal Simek wrote:
> The patch "mmc: sdhci-of-arasan: Call OF parsing for MMC"
> (sha1: 16b23787fc709fe60c5d2bd05927b1a3da33d4e9) introduce new
> dependency on GPIOLIB which calls mmc_of_parse() ->
> mmc_gpiod_request_cd() (slot-gpio.c) which calls devm_gpiod_get_index()
> which returns -ENOSYS.
>
> Error log:
> sdhci-arasan ff160000.sdhci: parsing dt failed (4294967258)
> sdhci-arasan: probe of ff160000.sdhci failed with error -38
>
> Signed-off-by: Michal Simek <[email protected]>
> ---
>
> This problem is probably in all others drivers.
> This is one way how this can be solved.
> Maybe better way is to block return value for cd and wp.

It appears there is gpio code in sdhci.c as well. This uses slot-gpio.

Perhaps a depends on needs to be added to MMC_SDHCI instead?

>
> ---
> drivers/mmc/host/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index fd9a58e216a5..4b5854759cfc 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -120,6 +120,7 @@ config MMC_SDHCI_PLTFM
> config MMC_SDHCI_OF_ARASAN
> tristate "SDHCI OF support for the Arasan SDHCI controllers"
> depends on MMC_SDHCI_PLTFM
> + depends on GPIOLIB
> depends on OF
> help
> This selects the Arasan Secure Digital Host Controller Interface
>

2015-07-28 08:30:38

by Michal Simek

[permalink] [raw]
Subject: Re: [RFC PATCH] mmc: Kconfig: Add dependency on GPIOLIB for Arasan driver

On 07/27/2015 11:55 PM, Scott Branden wrote:
> Hi Michal,
>
> comment in line
>
> On 15-07-24 06:53 AM, Michal Simek wrote:
>> The patch "mmc: sdhci-of-arasan: Call OF parsing for MMC"
>> (sha1: 16b23787fc709fe60c5d2bd05927b1a3da33d4e9) introduce new
>> dependency on GPIOLIB which calls mmc_of_parse() ->
>> mmc_gpiod_request_cd() (slot-gpio.c) which calls devm_gpiod_get_index()
>> which returns -ENOSYS.
>>
>> Error log:
>> sdhci-arasan ff160000.sdhci: parsing dt failed (4294967258)
>> sdhci-arasan: probe of ff160000.sdhci failed with error -38
>>
>> Signed-off-by: Michal Simek <[email protected]>
>> ---
>>
>> This problem is probably in all others drivers.
>> This is one way how this can be solved.
>> Maybe better way is to block return value for cd and wp.
>
> It appears there is gpio code in sdhci.c as well. This uses slot-gpio.
>
> Perhaps a depends on needs to be added to MMC_SDHCI instead?

yes, I know and that's why I did this as RFC. But also not all drivers
calls mmc_of_parse to reach this fault.
Anyway I am happy to send v2 with GPIOLIB dependency for the whole MMC
subsystem.

Thanks,
Michal