Skip to content

pinctrl: sunxi: Fix H5 MMC access

Andre Przywara linux-arm-kernel linux-devicetree linux-gpio 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2arm64: dts: allwinner: H5: remove redundant MMC0 card detect pinarch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts +2 more+5 -51 reply
2/2pinctrl: sunxi: Disable strict mode for H5 driverdrivers/pinctrl/sunxi/pinctrl-sun50i-h5.c+4 -22 replies
2/2pinctrl: sunxi: Disable strict mode for H5 driver+0 -02 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchMaxime Ripard
1/2
2/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] pinctrl: sunxi: Fix H5 MMC access

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(-)
Signature · 1 line
2.14.1