Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp268518imu; Thu, 3 Jan 2019 19:24:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN4HRwG9cJxGJvmDVr1vF/ubfhTWKhjT0/c5YTF+s85AqPoKzsyPdJ/4vB04e2onj+ERTguI X-Received: by 2002:a17:902:3f81:: with SMTP id a1mr48785900pld.258.1546572255919; Thu, 03 Jan 2019 19:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546572255; cv=none; d=google.com; s=arc-20160816; b=ufcS7Eqn4w1MCR83rIQrXWek1ahDc1QTG2li8r29n6SDTowQNsnpI7m9XZZM64ujWl +ATt3l2pvscA4Xzkqnm+Hi8Enpzlgu11OUEJ0/fJQ1Vy5NBlZ5abAPIxAQtlxsWkwaWi B5lniKQLbQ82L7aswlzsyO7HQKzS5UZjFqXKv9kAJK/h9B9gC3mXlyfSAL3o3nLIJCJj qd/CpLRu1rTbUDGwPRlUKN870DL27A58L77N8otIxsV2pq0mK+EUHL6gLCugU2GVSer+ ceEpDonZti8A5RP2ORnaqAFkAWByAyUSq3h+7UP7f3ZEka8jma5Nz3fzJTVhv3rpf35F xbVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QANzhaPy2nInN5aENUoqLEJcdEF1QIInnXqWfKquhOc=; b=CW31/2cLKADvzsdgWPNKvfvc79+cnKGMSD4A92vYDQTNqwbynIZA093l9peCF25LKX dpi/xwLjA0KteOayak4lZQvt3SEWVXYCPrqCvDgCnukTBNeiOf+MKshTM6eg2RqkY2vW l6PiNQjEmm3ovk6Z2SOgEV23Ht2HAHs6yTLV1uSBWfM8xQn8nNnl2PcrcMZ8NmeXIpy6 /0y/LlJkN4BnpuwdY7f6VwTOAIhrjjbaZWoPxOT0JOIAN5fHsO/ojNJ67hYpb2o+12wF 9KO6ec8YoJpvm97f4Sp2lDnj8nFtnakESpvlR0niWgepPmXDo4TmqikUYYF4lewh05qi qkeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hbd1jrD7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12si17442271pgh.395.2019.01.03.19.24.01; Thu, 03 Jan 2019 19:24:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hbd1jrD7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728304AbfACWGM (ORCPT + 99 others); Thu, 3 Jan 2019 17:06:12 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:46573 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728287AbfACWGM (ORCPT ); Thu, 3 Jan 2019 17:06:12 -0500 Received: by mail-lf1-f65.google.com with SMTP id y14so5234951lfg.13 for ; Thu, 03 Jan 2019 14:06:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QANzhaPy2nInN5aENUoqLEJcdEF1QIInnXqWfKquhOc=; b=Hbd1jrD7A+vhILx94F/SWpVdty2SiC8QhLzF2aEBsuBUeqzp2oNXvc/PVHmpDewDC3 SB68Nyh5j5/V+hKR7sawydxDYHMd/WQjC5uTkiQVHUlz3ghpiReKLvexEpHLg3j91Owy 8+yLJ2xMs+JzwcJ5Z76kdmNmH4o0IV5gzrNuo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QANzhaPy2nInN5aENUoqLEJcdEF1QIInnXqWfKquhOc=; b=FnueDTfV144hZY1Qk4NRe7TOpCsxQ2nv6utCK3bmEgaygy0uTOiGAXi2I+d6dvPF+2 POmfRtkfQ9MLDLYJwOw6t1SkaYT+ydX8rZJPUoBrBluzGyIU2ZckDChpW3Yc4fpXHg/6 UkT3n2QtswG0EP+i9r/73OBgTqa9qGdtyTi2x5O12BoYkS/PXRMJftBx8Jg/q6CINTOT CMfzWs/6YPN4c+NUxENNG7aJzE67HeICSimRrOXUbiW9EWWN3timZCxpi5cHTxRHuFUN wfZaHylMX65jNzqM/+QTVgKtnAe/RnmNT92XmgXD6kMwHbIVRbLj4Oi41IZkrH98V1En Wn+Q== X-Gm-Message-State: AA+aEWayK0T6NyAkm8y6r/2hZIuPQGFDH2M6VPYuvr9yv+TZFegzHpw3 aOBRj9sx44xbaDcEvMgZ48OjT5sJ+t5PkwxmX7bMIg== X-Received: by 2002:a19:41c4:: with SMTP id o187mr25749042lfa.32.1546553170201; Thu, 03 Jan 2019 14:06:10 -0800 (PST) MIME-Version: 1.0 References: <20190101194414.24766-1-martin.blumenstingl@googlemail.com> <20190101194414.24766-2-martin.blumenstingl@googlemail.com> In-Reply-To: <20190101194414.24766-2-martin.blumenstingl@googlemail.com> From: Linus Walleij Date: Thu, 3 Jan 2019 23:05:57 +0100 Message-ID: Subject: Re: [PATCH 1/1] mmc: core: don't override the CD GPIO level when "cd-inverted" is set To: Martin Blumenstingl Cc: "open list:GPIO SUBSYSTEM" , linux-mmc , Guenter Roeck , Bartosz Golaszewski , Ulf Hansson , "open list:ARM/Amlogic Meson..." , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 1, 2019 at 8:44 PM Martin Blumenstingl 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 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 Yours, Linus Walleij