[lkml]   [2018]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 16/22] mmc: tmio: fix never-detected card insertion bug
Hi Wolfram,

2018-01-03 2:13 GMT+09:00 Wolfram Sang <>:
>> > The TMIO mmc cannot detect the card insertion in native_hotplug mode
>> > if the driver is probed without a card inserted.
>> Hmm, it works for me without your patch just fine. Iam currently
>> researching it...
> It really doesn't work for you?

Does not work.

> mmc_add_host -> mmc_start_host -> _mmc_detect_change ->
> mmc_schedule_delayed_work -> mmc_rescan -> mmc_start_request

Correct except "-> mmc_start_request".

If a card is not inserted, the power will go down. [1]
So, mmc_start_request will not happen.

BTW, did you understand my git-log?

I am talking about the card detection
by the IP-builtin circuit.

I am trying to support it by the following patch:

TMIO MMC calls mmc_detect_change() [2],
but please note this _never_ detects the card event.
It just re-schedules mmc_rescan. [3]

To detect the card insertion/removal, .get_cd hook must be implemented,
but, it is fixed to mmc_gpio_get_cd. [4]

Unless you had already migrated your boards to built-in CD
based on my patch, GPIO is the only way to detect card events.

If so, you are testing unrelated things.

It is really hard to understand what is going on Renesas side,
but I imagined some possibilities:
- Poll the GPIO for card events -> out of interest of this patch
- Use interrupt from GPIO irqchip -> ditto
- The media is non-removable like eMMC -> ditto
- GPIO is not set up -> mmc_gpio_get_cd() returns -ENOSYS

The last case is treated as "inserted", but the card removal will not
be detected.


Best Regards
Masahiro Yamada

 \ /
  Last update: 2018-01-05 16:59    [W:0.141 / U:1.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site