linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc)
@ 2018-12-29 12:57 Martin Blumenstingl
  2018-12-29 12:57 ` [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low Martin Blumenstingl
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Martin Blumenstingl @ 2018-12-29 12:57 UTC (permalink / raw)
  To: linux-amlogic, khilman, linus.walleij
  Cc: linus.luessing, bgolaszewski, balbes-150, linux-mmc, linux-gpio,
	linux-arm-kernel, Martin Blumenstingl, linux

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 KernelCI suffers from the
same problem:
v4.20-6428-g00c569b567c7 still sees the SD card (mmc0): [0]
v4.20-8955-g903b77c63167 doesn't see the SD card (mmc0) anymore: [1]

My Endless Mini (EC-100) is also affected by this issue.

a git bisect run points to this commit:
89a5e15bcba87df5120d4656e0ff33d4f7cd6152 ("gpio/mmc/of: Respect polarity
in the device tree")

and indeed, reverting it makes my Odroid-C1 and EC-100 see the SD card
again.

However, while reviewing the .dts files for the 32-bit Amlogic Meson
boards I found that the cd-gpios are specified incorrectly in the .dts.
Documentation/devicetree/bindings/mmc/mmc.txt states: "[...] using the
"cd-inverted" property means, that the CD line is active high, i.e. it
is high, when a card is inserted".
This is not the case on all currently supported 32-bit Meson boards, so
this switches the cd-gpios
- from GPIO_ACTIVE_HIGH with the "cd-inverted" property being set
- to GPIO_ACTIVE_LOW with the "cd-inverted" property being absent

This fix also works even if the following two commits are reverted:
- 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device tree")
- 81c85ec15a1946 ("gpio: OF: Parse MMC-specific CD and WP properties")

Linus, I have seen that there was some fallout that commit
89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device tree") is
supposed to fix. In commit 81c85ec15a1946 ("gpio: OF: Parse
MMC-specific CD and WP properties") you mentioned "the [MMC]  core will
use the MMC_CAP2_CD_ACTIVE_HIGH [...] I plan to clean this up at a later
point passing the handling of inversion semantics over to gpiolib". I'm
not sure how the MMC core / GPIO subsystem is supposed to handle the
"cd-inverted" case 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?
(attention: this series only fixes three 32-bit Meson boards, but I
believe that this issue is not limited to the 32-bit Meson boards)


[0] https://kernelci.org/boot/id/5c25a73d59b51464fb6edd2c/
[1] https://kernelci.org/boot/id/5c27306159b514268f6edd2e/


Martin Blumenstingl (3):
  ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO
    active-low
  ARM: dts: meson8b: ec100: mark the SD card detection GPIO active-low
  ARM: dts: meson8m2: mxiii-plus: mark the SD card detection GPIO
    active-low

 arch/arm/boot/dts/meson8b-ec100.dts       | 3 +--
 arch/arm/boot/dts/meson8b-odroidc1.dts    | 3 +--
 arch/arm/boot/dts/meson8m2-mxiii-plus.dts | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low
  2018-12-29 12:57 [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
@ 2018-12-29 12:57 ` Martin Blumenstingl
  2018-12-30 19:54   ` Linus Walleij
  2019-01-07  8:51   ` Anand Moon
  2018-12-29 12:57 ` [PATCH 2/3] ARM: dts: meson8b: ec100: " Martin Blumenstingl
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: Martin Blumenstingl @ 2018-12-29 12:57 UTC (permalink / raw)
  To: linux-amlogic, khilman, linus.walleij
  Cc: linus.luessing, bgolaszewski, balbes-150, linux-mmc, linux-gpio,
	linux-arm-kernel, Martin Blumenstingl, linux

After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
tree") SD cards are not detected anymore.

The CD GPIO is "active low" on Odroid-C1. The MMC dt-bindings specify:
"[...] using the "cd-inverted" property means, that the CD line is active
high, i.e. it is high, when a card is inserted".

Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
drop the "cd-inverted" property. This makes the definition consistent
with the existing dt-bindings and fixes the check whether an SD card is
inserted.

Fixes: e03efbce6bebf5 ("ARM: dts: meson8b-odroidc1: add microSD support")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson8b-odroidc1.dts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
index 58669abda259..070d69889f3e 100644
--- a/arch/arm/boot/dts/meson8b-odroidc1.dts
+++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
@@ -273,8 +273,7 @@
 		cap-sd-highspeed;
 		disable-wp;
 
-		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
-		cd-inverted;
+		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
 
 		vmmc-supply = <&tflash_vdd>;
 		vqmmc-supply = <&tf_io>;
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH 2/3] ARM: dts: meson8b: ec100: mark the SD card detection GPIO active-low
  2018-12-29 12:57 [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
  2018-12-29 12:57 ` [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low Martin Blumenstingl
@ 2018-12-29 12:57 ` Martin Blumenstingl
  2018-12-30 19:54   ` Linus Walleij
  2018-12-29 12:57 ` [PATCH 3/3] ARM: dts: meson8m2: mxiii-plus: " Martin Blumenstingl
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Martin Blumenstingl @ 2018-12-29 12:57 UTC (permalink / raw)
  To: linux-amlogic, khilman, linus.walleij
  Cc: linus.luessing, bgolaszewski, balbes-150, linux-mmc, linux-gpio,
	linux-arm-kernel, Martin Blumenstingl, linux

After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
tree") SD cards are not detected anymore.

The CD GPIO is "active low" on the EC-100. The MMC dt-bindings specify:
"[...] using the "cd-inverted" property means, that the CD line is active
high, i.e. it is high, when a card is inserted".

Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
drop the "cd-inverted" property. This makes the definition consistent
with the existing dt-bindings and fixes the check whether an SD card is
inserted.

Fixes: bbedc1f1d90e33 ("ARM: dts: meson8b: Add support for the Endless Mini (EC-100)")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson8b-ec100.dts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/meson8b-ec100.dts b/arch/arm/boot/dts/meson8b-ec100.dts
index 0872f6e3abf5..d50fc2f60fa3 100644
--- a/arch/arm/boot/dts/meson8b-ec100.dts
+++ b/arch/arm/boot/dts/meson8b-ec100.dts
@@ -205,8 +205,7 @@
 		cap-sd-highspeed;
 		disable-wp;
 
-		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
-		cd-inverted;
+		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
 
 		vmmc-supply = <&vcc_3v3>;
 	};
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH 3/3] ARM: dts: meson8m2: mxiii-plus: mark the SD card detection GPIO active-low
  2018-12-29 12:57 [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
  2018-12-29 12:57 ` [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low Martin Blumenstingl
  2018-12-29 12:57 ` [PATCH 2/3] ARM: dts: meson8b: ec100: " Martin Blumenstingl
@ 2018-12-29 12:57 ` Martin Blumenstingl
  2018-12-30 19:54   ` Linus Walleij
  2018-12-29 14:29 ` [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
  2018-12-30 19:57 ` Linus Walleij
  4 siblings, 1 reply; 13+ messages in thread
From: Martin Blumenstingl @ 2018-12-29 12:57 UTC (permalink / raw)
  To: linux-amlogic, khilman, linus.walleij
  Cc: linus.luessing, bgolaszewski, balbes-150, linux-mmc, linux-gpio,
	linux-arm-kernel, Martin Blumenstingl, linux

After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
tree") SD cards are not detected anymore.

The CD GPIO is "active low" on the MXIII-Plus. The MMC dt-bindings
specify: "[...] using the "cd-inverted" property means, that the CD line
is active high, i.e. it is high, when a card is inserted".

Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
drop the "cd-inverted" property. This makes the definition consistent
with the existing dt-bindings and fixes the check whether an SD card is
inserted.

Fixes: 35ee52bea66c74 ("ARM: dts: meson8m2: add support for the Tronsmart MXIII Plus")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson8m2-mxiii-plus.dts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/meson8m2-mxiii-plus.dts b/arch/arm/boot/dts/meson8m2-mxiii-plus.dts
index f5853610b20b..6ac02beb5fa7 100644
--- a/arch/arm/boot/dts/meson8m2-mxiii-plus.dts
+++ b/arch/arm/boot/dts/meson8m2-mxiii-plus.dts
@@ -206,8 +206,7 @@
 		cap-sd-highspeed;
 		disable-wp;
 
-		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
-		cd-inverted;
+		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
 
 		vmmc-supply = <&vcc_3v3>;
 	};
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc)
  2018-12-29 12:57 [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
                   ` (2 preceding siblings ...)
  2018-12-29 12:57 ` [PATCH 3/3] ARM: dts: meson8m2: mxiii-plus: " Martin Blumenstingl
@ 2018-12-29 14:29 ` Martin Blumenstingl
  2019-01-11  1:18   ` Kevin Hilman
  2018-12-30 19:57 ` Linus Walleij
  4 siblings, 1 reply; 13+ messages in thread
From: Martin Blumenstingl @ 2018-12-29 14:29 UTC (permalink / raw)
  To: linux-amlogic, khilman, linus.walleij
  Cc: linus.luessing, bgolaszewski, balbes-150, linux-mmc, linux-gpio,
	linux-arm-kernel, linux

On Sat, Dec 29, 2018 at 1:57 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> 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 KernelCI suffers from the
> same problem:
> v4.20-6428-g00c569b567c7 still sees the SD card (mmc0): [0]
> v4.20-8955-g903b77c63167 doesn't see the SD card (mmc0) anymore: [1]
>
> My Endless Mini (EC-100) is also affected by this issue.
>
> a git bisect run points to this commit:
> 89a5e15bcba87df5120d4656e0ff33d4f7cd6152 ("gpio/mmc/of: Respect polarity
> in the device tree")
>
> and indeed, reverting it makes my Odroid-C1 and EC-100 see the SD card
> again.
I started a separate discussion for that topic on the linux-mmc and
linux-gpio mailing list for this topic: [0]

comments regarding this series are still welcome!


Regards
Martin


[0] https://marc.info/?l=linux-mmc&m=154609359306732&w=3

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low
  2018-12-29 12:57 ` [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low Martin Blumenstingl
@ 2018-12-30 19:54   ` Linus Walleij
  2019-01-07  8:51   ` Anand Moon
  1 sibling, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2018-12-30 19:54 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: linus.luessing, Bartosz Golaszewski, balbes-150, Kevin Hilman,
	linux-mmc, open list:GPIO SUBSYSTEM, Guenter Roeck,
	open list:ARM/Amlogic Meson...,
	Linux ARM

On Sat, Dec 29, 2018 at 1:57 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:

> After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
> tree") SD cards are not detected anymore.
>
> The CD GPIO is "active low" on Odroid-C1. The MMC dt-bindings specify:
> "[...] using the "cd-inverted" property means, that the CD line is active
> high, i.e. it is high, when a card is inserted".
>
> Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
> drop the "cd-inverted" property. This makes the definition consistent
> with the existing dt-bindings and fixes the check whether an SD card is
> inserted.
>
> Fixes: e03efbce6bebf5 ("ARM: dts: meson8b-odroidc1: add microSD support")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

This is definately a better way to do it (we should insert some text into the
nindings about doing it this way).

We also need to fix it for existing device trees using "cd-inverted"
though.

Yours,
Linus Walleij

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 2/3] ARM: dts: meson8b: ec100: mark the SD card detection GPIO active-low
  2018-12-29 12:57 ` [PATCH 2/3] ARM: dts: meson8b: ec100: " Martin Blumenstingl
@ 2018-12-30 19:54   ` Linus Walleij
  0 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2018-12-30 19:54 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: linus.luessing, Bartosz Golaszewski, balbes-150, Kevin Hilman,
	linux-mmc, open list:GPIO SUBSYSTEM, Guenter Roeck,
	open list:ARM/Amlogic Meson...,
	Linux ARM

On Sat, Dec 29, 2018 at 1:57 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:

> After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
> tree") SD cards are not detected anymore.
>
> The CD GPIO is "active low" on the EC-100. The MMC dt-bindings specify:
> "[...] using the "cd-inverted" property means, that the CD line is active
> high, i.e. it is high, when a card is inserted".
>
> Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
> drop the "cd-inverted" property. This makes the definition consistent
> with the existing dt-bindings and fixes the check whether an SD card is
> inserted.
>
> Fixes: bbedc1f1d90e33 ("ARM: dts: meson8b: Add support for the Endless Mini (EC-100)")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 3/3] ARM: dts: meson8m2: mxiii-plus: mark the SD card detection GPIO active-low
  2018-12-29 12:57 ` [PATCH 3/3] ARM: dts: meson8m2: mxiii-plus: " Martin Blumenstingl
@ 2018-12-30 19:54   ` Linus Walleij
  0 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2018-12-30 19:54 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: linus.luessing, Bartosz Golaszewski, balbes-150, Kevin Hilman,
	linux-mmc, open list:GPIO SUBSYSTEM, Guenter Roeck,
	open list:ARM/Amlogic Meson...,
	Linux ARM

On Sat, Dec 29, 2018 at 1:57 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:

> After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
> tree") SD cards are not detected anymore.
>
> The CD GPIO is "active low" on the MXIII-Plus. The MMC dt-bindings
> specify: "[...] using the "cd-inverted" property means, that the CD line
> is active high, i.e. it is high, when a card is inserted".
>
> Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
> drop the "cd-inverted" property. This makes the definition consistent
> with the existing dt-bindings and fixes the check whether an SD card is
> inserted.
>
> Fixes: 35ee52bea66c74 ("ARM: dts: meson8m2: add support for the Tronsmart MXIII Plus")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc)
  2018-12-29 12:57 [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
                   ` (3 preceding siblings ...)
  2018-12-29 14:29 ` [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
@ 2018-12-30 19:57 ` Linus Walleij
  2018-12-31 11:03   ` Martin Blumenstingl
  4 siblings, 1 reply; 13+ messages in thread
From: Linus Walleij @ 2018-12-30 19:57 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: linus.luessing, Bartosz Golaszewski, balbes-150, Kevin Hilman,
	linux-mmc, open list:GPIO SUBSYSTEM, Guenter Roeck,
	open list:ARM/Amlogic Meson...,
	Linux ARM

On Sat, Dec 29, 2018 at 1:57 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:

> However, while reviewing the .dts files for the 32-bit Amlogic Meson
> boards I found that the cd-gpios are specified incorrectly in the .dts.
> Documentation/devicetree/bindings/mmc/mmc.txt states: "[...] using the
> "cd-inverted" property means, that the CD line is active high, i.e. it
> is high, when a card is inserted".
> This is not the case on all currently supported 32-bit Meson boards, so
> this switches the cd-gpios
> - from GPIO_ACTIVE_HIGH with the "cd-inverted" property being set
> - to GPIO_ACTIVE_LOW with the "cd-inverted" property being absent
>
> This fix also works even if the following two commits are reverted:
> - 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device tree")
> - 81c85ec15a1946 ("gpio: OF: Parse MMC-specific CD and WP properties")

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks for looking into this, I think fixing the device trees is
orthogonal to fixing the issue I created, let's fix both!

Yours,
Linus Walleij

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc)
  2018-12-30 19:57 ` Linus Walleij
@ 2018-12-31 11:03   ` Martin Blumenstingl
  0 siblings, 0 replies; 13+ messages in thread
From: Martin Blumenstingl @ 2018-12-31 11:03 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linus.luessing, Bartosz Golaszewski, balbes-150, Kevin Hilman,
	linux-mmc, open list:GPIO SUBSYSTEM, Guenter Roeck,
	open list:ARM/Amlogic Meson...,
	Linux ARM

Hi Linus,

On Sun, Dec 30, 2018 at 8:57 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Sat, Dec 29, 2018 at 1:57 PM Martin Blumenstingl
> <martin.blumenstingl@googlemail.com> wrote:
>
> > However, while reviewing the .dts files for the 32-bit Amlogic Meson
> > boards I found that the cd-gpios are specified incorrectly in the .dts.
> > Documentation/devicetree/bindings/mmc/mmc.txt states: "[...] using the
> > "cd-inverted" property means, that the CD line is active high, i.e. it
> > is high, when a card is inserted".
> > This is not the case on all currently supported 32-bit Meson boards, so
> > this switches the cd-gpios
> > - from GPIO_ACTIVE_HIGH with the "cd-inverted" property being set
> > - to GPIO_ACTIVE_LOW with the "cd-inverted" property being absent
> >
> > This fix also works even if the following two commits are reverted:
> > - 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device tree")
> > - 81c85ec15a1946 ("gpio: OF: Parse MMC-specific CD and WP properties")
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
thank you for reviewing my series!

> Thanks for looking into this, I think fixing the device trees is
> orthogonal to fixing the issue I created, let's fix both!
I fully agree. if I still have time I'll look into a patch for the MMC
core later today, otherwise I'll try to do it tomorrow


Regards
Martin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low
  2018-12-29 12:57 ` [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low Martin Blumenstingl
  2018-12-30 19:54   ` Linus Walleij
@ 2019-01-07  8:51   ` Anand Moon
  2019-01-08 22:02     ` Martin Blumenstingl
  1 sibling, 1 reply; 13+ messages in thread
From: Anand Moon @ 2019-01-07  8:51 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: Linus Lüssing, linux-gpio, balbes-150, Kevin Hilman,
	Linus Walleij, linux-mmc, bgolaszewski, Guenter Roeck,
	linux-amlogic, linux-arm-kernel

Hi Martin,

On Sat, 29 Dec 2018 at 18:28, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
> tree") SD cards are not detected anymore.
>
> The CD GPIO is "active low" on Odroid-C1. The MMC dt-bindings specify:
> "[...] using the "cd-inverted" property means, that the CD line is active
> high, i.e. it is high, when a card is inserted".
>
> Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
> drop the "cd-inverted" property. This makes the definition consistent
> with the existing dt-bindings and fixes the check whether an SD card is
> inserted.
>
> Fixes: e03efbce6bebf5 ("ARM: dts: meson8b-odroidc1: add microSD support")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  arch/arm/boot/dts/meson8b-odroidc1.dts | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
> index 58669abda259..070d69889f3e 100644
> --- a/arch/arm/boot/dts/meson8b-odroidc1.dts
> +++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
> @@ -273,8 +273,7 @@
>                 cap-sd-highspeed;
>                 disable-wp;
>
> -               cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
> -               cd-inverted;
> +               cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
>
>                 vmmc-supply = <&tflash_vdd>;
>                 vqmmc-supply = <&tf_io>;
> --
> 2.20.1
>

Please add my on my Odroid c1+

Tested-by: Anand Moon <linux.amoon@gmail.com>

My Odroid C2 is also fails to bootup with out these changes.
Can you send patch to fix them as well.

Best Regards

-Anand

>
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low
  2019-01-07  8:51   ` Anand Moon
@ 2019-01-08 22:02     ` Martin Blumenstingl
  0 siblings, 0 replies; 13+ messages in thread
From: Martin Blumenstingl @ 2019-01-08 22:02 UTC (permalink / raw)
  To: Anand Moon
  Cc: Linus Lüssing, linux-gpio, balbes-150, Kevin Hilman,
	Linus Walleij, linux-mmc, bgolaszewski, Guenter Roeck,
	linux-amlogic, linux-arm-kernel

Hi Anand,

On Mon, Jan 7, 2019 at 9:51 AM Anand Moon <linux.amoon@gmail.com> wrote:
>
> Hi Martin,
>
> On Sat, 29 Dec 2018 at 18:28, Martin Blumenstingl
> <martin.blumenstingl@googlemail.com> wrote:
> >
> > After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
> > tree") SD cards are not detected anymore.
> >
> > The CD GPIO is "active low" on Odroid-C1. The MMC dt-bindings specify:
> > "[...] using the "cd-inverted" property means, that the CD line is active
> > high, i.e. it is high, when a card is inserted".
> >
> > Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
> > drop the "cd-inverted" property. This makes the definition consistent
> > with the existing dt-bindings and fixes the check whether an SD card is
> > inserted.
> >
> > Fixes: e03efbce6bebf5 ("ARM: dts: meson8b-odroidc1: add microSD support")
> > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> > ---
> >  arch/arm/boot/dts/meson8b-odroidc1.dts | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
> > index 58669abda259..070d69889f3e 100644
> > --- a/arch/arm/boot/dts/meson8b-odroidc1.dts
> > +++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
> > @@ -273,8 +273,7 @@
> >                 cap-sd-highspeed;
> >                 disable-wp;
> >
> > -               cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
> > -               cd-inverted;
> > +               cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
> >
> >                 vmmc-supply = <&tflash_vdd>;
> >                 vqmmc-supply = <&tf_io>;
> > --
> > 2.20.1
> >
>
> Please add my on my Odroid c1+
>
> Tested-by: Anand Moon <linux.amoon@gmail.com>
thank you for testing this!

> My Odroid C2 is also fails to bootup with out these changes.
> Can you send patch to fix them as well.
I sent a more generic patch (after a discussion with Linus) which will
fix all boards with the "cd-inverted" property even if we don't fix
the .dts files: [0]
(that doesn't mean that this patch is obsolete, but it means that we
restore compatibility with .dts which use the "cd-inverted" property)

it would be great if you could test that on your Odroid-C2 and give
your Tested-by on that as well!


Regards
Martin


[0] https://patchwork.kernel.org/patch/10745961/

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc)
  2018-12-29 14:29 ` [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
@ 2019-01-11  1:18   ` Kevin Hilman
  0 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2019-01-11  1:18 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic, linus.walleij
  Cc: linus.luessing, bgolaszewski, balbes-150, linux-mmc, linux-gpio,
	linux-arm-kernel, linux

Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:

> On Sat, Dec 29, 2018 at 1:57 PM Martin Blumenstingl
> <martin.blumenstingl@googlemail.com> wrote:
>>
>> 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 KernelCI suffers from the
>> same problem:
>> v4.20-6428-g00c569b567c7 still sees the SD card (mmc0): [0]
>> v4.20-8955-g903b77c63167 doesn't see the SD card (mmc0) anymore: [1]
>>
>> My Endless Mini (EC-100) is also affected by this issue.
>>
>> a git bisect run points to this commit:
>> 89a5e15bcba87df5120d4656e0ff33d4f7cd6152 ("gpio/mmc/of: Respect polarity
>> in the device tree")
>>
>> and indeed, reverting it makes my Odroid-C1 and EC-100 see the SD card
>> again.
> I started a separate discussion for that topic on the linux-mmc and
> linux-gpio mailing list for this topic: [0]
>
> comments regarding this series are still welcome!

Like Linus mentioned, fixing the DTs is still important, so queuing as
fixes for v5.0-rc (branch v4.21/fixes)

Kevin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2019-01-11  1:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29 12:57 [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
2018-12-29 12:57 ` [PATCH 1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low Martin Blumenstingl
2018-12-30 19:54   ` Linus Walleij
2019-01-07  8:51   ` Anand Moon
2019-01-08 22:02     ` Martin Blumenstingl
2018-12-29 12:57 ` [PATCH 2/3] ARM: dts: meson8b: ec100: " Martin Blumenstingl
2018-12-30 19:54   ` Linus Walleij
2018-12-29 12:57 ` [PATCH 3/3] ARM: dts: meson8m2: mxiii-plus: " Martin Blumenstingl
2018-12-30 19:54   ` Linus Walleij
2018-12-29 14:29 ` [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Martin Blumenstingl
2019-01-11  1:18   ` Kevin Hilman
2018-12-30 19:57 ` Linus Walleij
2018-12-31 11:03   ` Martin Blumenstingl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).