89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device tree")

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

 



Hi Linus,

(I have also documented this issue in my series "ARM: dts: meson: fix
SD card cd-gpio (pre v4.21-rc)" which you can find at [0])

Today I noticed that my Odroid-C1 doesn't see it's SD card anymore.
My board is not the only one, Odroid-C1 on Kernel CI suffers from the
same problem:
v4.20-6428-g00c569b567c7 still sees the SD card (mmc0): [1]
v4.20-8955-g903b77c63167 doesn't see the SD card (mmc0) anymore: [2]

Other affected boards:
- Meson8b EC-100 (which I own)
- Odroid-C2 on Kernel CI, see [3] and [4] (compared to Odroid-C1 it's
mmc1 instead of mmc0. mmc0 on Odroid-C1 is the eMMC)
- (I believe that all boards using "cd-inverted" are affected)

My series from [0] is meant as an additional improvement for the
32-bit Amlogic Meson .dts files. We still need a fix for all other
boards.

I'm not sure how the MMC core / GPIO subsystems are supposed to handle
"cd-inverted" since I believe this property is now evaluated twice:
- first in of_gpio_flags_quirks
- but also in mmc_gpio_get_cd (using ctx->override_cd_active_level)
doesn't this essentially make "cd-inverted" a no-op?

If you want I can work on a patch which tries to bring everything back
into a "working" state. My understanding is that the old behavior was:
- mmc_gpiod_request_cd / mmc_gpiod_request_ro used
devm_gpiod_get_index which takes the polarity into account
- check for "active low" != cd-inverted in drivers/mmc/core/host.c
together with mmc_gpio_get_cd:
-- active low, no cd-inverted: low means card is detected
-- active low, cd-inverted: high means card is detected
-- active high, no cd-inverted: low means card is detected
-- active high, cd-inverted: high means card is detected
- ACPI and OF based systems were treated the same

My initial idea would was to remove the cd-inverted handling from the
MMC core. But I'm not sure whether this would break ACPI based systems
(which "somehow" set cd-inverted).
My second idea is to revert the following two commits, but I'm not
sure if that would break another case:
- 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device tree")
- 81c85ec15a1946 ("gpio: OF: Parse MMC-specific CD and WP properties")


Regards
Martin


[0] https://patchwork.kernel.org/cover/10744839/
[1] https://kernelci.org/boot/id/5c25a73d59b51464fb6edd2c/
[2] https://kernelci.org/boot/id/5c27306159b514268f6edd2e/
[3] https://kernelci.org/boot/id/5c25a6cf59b51464bf6edd32/
[4] https://kernelci.org/boot/id/5c27301959b514266c6edd2b/



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux