lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFBinCDj-CpaQb2wfreJOCkFVj6ysV7943mqTs3xSvMfhy3yGw@mail.gmail.com>
Date:   Tue, 8 Jan 2019 23:20:11 +0100
From:   Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        linux-mmc <linux-mmc@...r.kernel.org>,
        Guenter Roeck <linux@...ck-us.net>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        "open list:ARM/Amlogic Meson..." <linux-amlogic@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] mmc: core: don't override the CD GPIO level when
 "cd-inverted" is set

Hi Linus,

On Thu, Jan 3, 2019 at 11:06 PM Linus Walleij <linus.walleij@...aro.org> wrote:
>
> On Tue, Jan 1, 2019 at 8:44 PM Martin Blumenstingl
> <martin.blumenstingl@...glemail.com> wrote:
>
> > Since commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
> > tree") gpiolib-of parses the "cd-gpios" property and flips the polarity
> > if "cd-inverted" is also set. This results in the "cd-inverted" property
> > being evaluated twice, which effectively makes it a no-op:
> > - first in drivers/gpio/gpiolib-of.c (of_xlate_and_get_gpiod_flags) when
> >   setting up the CD GPIO
> > - then again in drivers/mmc/core/slot-gpio.c (mmc_gpio_get_cd) when
> >   reading the CD GPIO value at runtime
> >
> > On boards which are using device-tree with the "cd-inverted" property
> > being set any inserted card are not detected anymore. This is due to the
> > MMC core treating the CD GPIO with the wrong polarity.
> >
> > Disable "override_cd_active_level" for the card detection GPIO which is
> > parsed using mmc_of_parse. This fixes SD card detection on the boards
> > which are currently using the "cd-inverted" device-tree property (tested
> > on Meson8b Odroid-C1 and Meson8b EC-100).
> >
> > This does not remove the CD GPIO inversion logic from the MMC core
> > because there's at least one driver (sdhci-pci-core for Intel BayTrail
> > based boards) which still passes "override_cd_active_level = true" to
> > mmc_gpiod_request_cd(). Due to lack of hardware for testing this is left
> > untouched.
> > In the future the GPIO inversion logic for both, card and read-only
> > detection can be removed once no driver is using it anymore.
> >
> > Fixes: 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device tree")
> > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
>
> OK two steps forward, one step back, that's a good fix for now, I
> can fix it properly for v4.22.
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
great, thanks for reviewing this!

feel free to keep me CC'ed on the "cleanup patches". I can review them
if you don't mind that I usually need a few days to do that


Regards
Martin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ