Re: SD card reader only works after a suspend/resume

From: Jakob Alvermark <jakob_at_alvermark.net>
Date: Fri, 7 Sep 2018 16:52:12 +0200
On 9/7/18 12:41 AM, Marius Strobl wrote:
> On Thu, Sep 06, 2018 at 12:33:39PM +0200, Jakob Alvermark wrote:
>> Hi,
>>
>>
>> I discovered this by chance.
>>
>> The SD card reader in my laptop has never worked, but now I noticed it
>> does after suspending and resuming.
>>
>> The controller is probed and attached on boot:
>>
>> sdhci_acpi1: <Intel Bay Trail/Braswell SDXC Controller> iomem
>> 0x90a00000-0x90a00fff irq 47 on acpi0
>>
>> But nothing happens if I put a card in. Unless I suspend and resume:
>>
>> mmc1: <MMC/SD bus> on sdhci_acpi1
>> mmcsd0: 32GB <SDHC SL32G 8.0 SN 19CD02C0 MFG 11/2014 by 3 SD> at mmc1
>> 50.0MHz/4bit/65535-block
>>
>> Then I can remove and replug cards and it seems to work just fine.
> I believe that making SD card insertion/removal with the integrated
> SDHCI controlers of newer Intel SoCs work out-of-the-box requires
> support for ACPI GPE interrupts and ACPI GPIO events respectively to
> be added to FreeBSD. Otherwise insertion/removal interrutps/events
> aren't reported and polling the card present state doesn't generally
> work as a workaround with these controllers either, unfortunately.
> I'm not aware of anyone working on the former, though.
>
> Polling the card present state happens to work one time after SDHCI
> initialization with these controllers which is why a card will be
> attached when inserted as part of a suspend/resume cycle (resume of
> mmc(4) had some bugs until some months ago, which probably explains
> why that procedure hasn't worked as a workaround for you in the past).
> Inserting the card before boot, unloading/loading sdhci_acpi.ko or
> triggering detach/attach of sdhci_acpi(4) via devctl(8) should allow
> to attach a card, too.


If a card is inserted before booting it is not detected.

Removing and inserting card after boot is not detected unless I suspend 
and resume.

After I have suspended and resumed once, cards are detected. Removals 
and insertions are detected as they happen.


Jakob
Received on Fri Sep 07 2018 - 12:52:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:18 UTC