mbox series

[0/3] mmc: tmio: fix card detection

Message ID 1510136220-31853-1-git-send-email-yamada.masahiro@socionext.com
Headers show
Series mmc: tmio: fix card detection | expand

Message

Masahiro Yamada Nov. 8, 2017, 10:16 a.m. UTC
Masahiro Yamada (3):
  mmc: tmio: move mmc_gpio_request_cd() before mmc_add_host()
  mmc: tmio: use mmc_can_gpio_cd() instead of checking
    TMIO_MMC_USE_GPIO_CD
  mmc: tmio: support IP-builtin card detection logic

 drivers/mmc/host/tmio_mmc_core.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Wolfram Sang Nov. 19, 2017, 7:45 p.m. UTC | #1
On Wed, Nov 08, 2017 at 07:17:00PM +0900, Masahiro Yamada wrote:
> A card detect GPIO is set up only for platforms with "cd-gpios"

> DT property or TMIO_MMC_USE_GPIO_CD flag.  However, the driver

> core always uses mmc_gpio_get_cd, which just fails with -ENOSYS

> if ctx->cd_gpio is unset.

> 

> The bit 5 of the status register provides the current signal level

> of the CD line.  Allow to use it if the GPIO is unused.


I might be missing something: Why do we need to report something
sensible in this case? The card insert/eject interrupts calling
mmc_detect_change is not enough?
Masahiro Yamada Nov. 20, 2017, 8:03 a.m. UTC | #2
2017-11-20 4:45 GMT+09:00 Wolfram Sang <wsa@the-dreams.de>:
> On Wed, Nov 08, 2017 at 07:17:00PM +0900, Masahiro Yamada wrote:

>> A card detect GPIO is set up only for platforms with "cd-gpios"

>> DT property or TMIO_MMC_USE_GPIO_CD flag.  However, the driver

>> core always uses mmc_gpio_get_cd, which just fails with -ENOSYS

>> if ctx->cd_gpio is unset.

>>

>> The bit 5 of the status register provides the current signal level

>> of the CD line.  Allow to use it if the GPIO is unused.

>

> I might be missing something: Why do we need to report something

> sensible in this case? The card insert/eject interrupts calling

> mmc_detect_change is not enough?

>


Not enough.

mmc_detect_change() just schedules mmc_rescan().

Without correct ->get_cd(), how can mmc_rescan()
know whether a card is inserted or not?




-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html