Re: [PATCH v2 16/22] mmc: tmio: fix never-detected card insertion bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram,


2018-01-03 2:13 GMT+09:00 Wolfram Sang <wsa@xxxxxxxxxxxxx>:
>
>> > 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:
https://patchwork.kernel.org/patch/10074255/

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.


[1] http://elixir.free-electrons.com/linux/v4.15-rc6/source/drivers/mmc/core/core.c#L2818
[2] http://elixir.free-electrons.com/linux/v4.15-rc6/source/drivers/mmc/host/tmio_mmc_core.c#L656
[3] http://elixir.free-electrons.com/linux/v4.15-rc6/source/drivers/mmc/core/core.c#L1995
[4] http://elixir.free-electrons.com/linux/v4.15-rc6/source/drivers/mmc/host/tmio_mmc_core.c#L1105

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



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux