From patchwork Sat Dec 29 12:57:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10744831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE27F13BF for ; Sat, 29 Dec 2018 12:57:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6721289EA for ; Sat, 29 Dec 2018 12:57:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A316128AB6; Sat, 29 Dec 2018 12:57:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B85D289EA for ; Sat, 29 Dec 2018 12:57:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726035AbeL2M5f (ORCPT ); Sat, 29 Dec 2018 07:57:35 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34917 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726031AbeL2M5f (ORCPT ); Sat, 29 Dec 2018 07:57:35 -0500 Received: by mail-wr1-f67.google.com with SMTP id 96so23087445wrb.2; Sat, 29 Dec 2018 04:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nErJpKAwV6v3cNENjeI9CDTkclquEZvVeh0G8X/uw04=; b=fP1kLUwipjo7o1AqmxrKUs+2djifqLaZq7ixEd5WR2bwQNpe+MxQGxRo5utxAxCII3 JIBrbENkC71sIdgqJE09HU97vnmUmlCZ+ZNsJgGbEJuS3W5ByTXxgQ6kQmxpBJ6UlqMh fHMsVbLYOHbJBP4RcO0Bv9ngO+EJUTgmusktd/whH3lL+5SHCtvbfSYs/dXfUNNItck0 pceYtHZRFP8cEg/LgW7TWw0VUSxkik6s1fkqpsxu793FSZkQoeOkAsIsCQQuMrlYot0x p1Vf9lfg6XUOQkB1nOorC7GyEqoqJiPb51gVk0uStIalXnncFX2WX+Bzc+x+cz5LfGSd Fylg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nErJpKAwV6v3cNENjeI9CDTkclquEZvVeh0G8X/uw04=; b=Hi7T5C5nMI48ebBLdgaPnCKVjmfPUx/4+keAshO6fgfQWw0ZMpz/v+6mPDMyf6Tmvg b02lEYRVp3w8o03UzJp5BRml3FeYYJtbWZsPZSTLIOM6vKUcnIwfAtuJnp0OSqeJi6fm X3h4/xJvYyiqHBGFiq7ahJI1jQLkIaSpfEO5+bZ7FvjxHFyg+o7LpEdarKjfcGadEVWv i/X2i3EHCjd7TOC1lJtOL36CFfjiTB5qBVZTH2Nf70XxtUGK0hw6I2BNaQRUBrkQgcv8 lmWqfmAvDmn0dv1AK42y39pElsGldiErR9HPnuz8T8KBXfUJXigqgWVv8tXf2JZgZ7s2 fnrQ== X-Gm-Message-State: AJcUukfHwToY9ldkGCyHBRAkLdXUTOT7fGhgFju1wSiouxEFzcOSKpWr qm6IodZPT+1s6fMLN7+l2TY= X-Google-Smtp-Source: ALg8bN4fyuA4pZj7UtJ0m0t5JRJztB1zmBIcdw+CwAo3wQgD6BECjRbGyBfOFc+P5eHHqvHYX4wegw== X-Received: by 2002:adf:a28d:: with SMTP id s13mr29769487wra.100.1546088253189; Sat, 29 Dec 2018 04:57:33 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD7294600914F24DE1716D3FC.dip0.t-ipconnect.de. [2003:dc:d729:4600:914f:24de:1716:d3fc]) by smtp.googlemail.com with ESMTPSA id h17sm31987059wrt.59.2018.12.29.04.57.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Dec 2018 04:57:32 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, khilman@baylibre.com, linus.walleij@linaro.org Cc: linux-mmc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.luessing@c0d3.blue, balbes-150@yandex.ru, linux@roeck-us.net, bgolaszewski@baylibre.com, Martin Blumenstingl Subject: [PATCH 0/3] ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) Date: Sat, 29 Dec 2018 13:57:08 +0100 Message-Id: <20181229125711.5205-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) Reviewed-by: Linus Walleij