Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] pinctrl: sunxi: Fix H5 MMC access
@ 2017-11-25 12:01 Andre Przywara
  2017-11-25 12:01 ` [PATCH 1/2] arm64: dts: allwinner: H5: remove redundant MMC0 card detect pin Andre Przywara
  2017-11-25 12:02 ` [PATCH 2/2] pinctrl: sunxi: Disable strict mode for H5 driver Andre Przywara
  0 siblings, 2 replies; 8+ messages in thread
From: Andre Przywara @ 2017-11-25 12:01 UTC (permalink / raw)
  To: linux-arm-kernel

Commit 1396007286b1 ("pinctrl: sunxi: Enforce the strict mode by default")
enabled the strict mode for the H5 pin controller driver, so that it denies
multiple requests for a single pin.
However the existing DTs for the Allwinner H5 boards reference the CD pin
for the micro SD card (MMC0) *twice* in their node, so that the driver
stumbles upon the new strict mode and refuses to load:

...
sun50i-h5-pinctrl 1c20800.pinctrl: pin PF6 already requested by 1c0f000.mmc; cannot claim for 1c20800.pinctrl:166
sun50i-h5-pinctrl 1c20800.pinctrl: pin-166 (1c20800.pinctrl:166) status -22
sunxi-mmc: probe of 1c0f000.mmc failed with error -22
...

This prevents booting (from SD cards) on H5 boards.
This can be rather easily fixed by removing the redundant CD pin reference
from the pinctrl-0 property of the MMC0 node, which patch 1/2 actually does.

However this now prevents existing DTs to boot with newer kernels (current
Linus' HEAD, for instance), so we have to disable strict mode for the H5
as well (as we do with other SoCs already, including the H3).

Tested on the OrangePi PC2:
- current 4.15-rc0 boots with fixed DT (patch 1/2), but fails with older DTs
- 4.14 (and older) kernels boot with both older and this fixed DT
- 4.15-rc0 with patch 2/2 applied boots with both older and this fixed DTs

Thanks to Chris Obbard for reporting this.

Cheers,
Andre.

P.S. I was wondering if we should teach the MMC driver to cope with failing
CD pin requests or let it detect the redundancy and avoid the second GPIO
request instead. AFAICT this would allow to enable strict mode for the H5
again?

Andre Przywara (2):
  arm64: dts: allwinner: H5: remove redundant MMC0 card detect pin
  pinctrl: sunxi: Disable strict mode for H5 driver

 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts    | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts         | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts        | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts      | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts | 2 +-
 drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c                       | 6 ++++--
 6 files changed, 9 insertions(+), 7 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-12-12  8:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-25 12:01 [PATCH 0/2] pinctrl: sunxi: Fix H5 MMC access Andre Przywara
2017-11-25 12:01 ` [PATCH 1/2] arm64: dts: allwinner: H5: remove redundant MMC0 card detect pin Andre Przywara
2017-11-27  8:23   ` Maxime Ripard
2017-11-25 12:02 ` [PATCH 2/2] pinctrl: sunxi: Disable strict mode for H5 driver Andre Przywara
2017-11-27  8:22   ` Maxime Ripard
2017-11-30 15:51   ` Linus Walleij
2017-11-30 16:07     ` Andre Przywara
2017-12-12  8:52       ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox