Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp913586imu; Fri, 11 Jan 2019 11:18:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN6oifSqVOo0ad/ZE3x/S70m5A+OB6mWobNlmU/32Fn1CsPIKvcIHba77M04qgInKDx8XFCI X-Received: by 2002:a62:160d:: with SMTP id 13mr15639673pfw.203.1547234329321; Fri, 11 Jan 2019 11:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547234329; cv=none; d=google.com; s=arc-20160816; b=FAAgHcwiXFgPCbgIKcsWXT6HAxqcINMVLt673xJ69ERTDykIjVA6FMn9S0d+W86sey Q7PhcIblxUexyx9vI26HfC1SaUh7eqlnsl+/xn2gbULbgxCk3HltFmnqymFql3fYvN4X 8zt8ljrbzSoxml6iLYwbj9f2TZUKmWKKGg5a/rjKWmpZYZo6YBCxcjzJyXE9Y4lgOaJr nerY4FndHAJjLj4HHgrVdxBL1mS99/3SAg9+0yR1MlUB7G5XNcPhzn8J/I9dh9NC2Ft0 JOM2Z7zTBhDrRYa7B7BWrlMZWsrOXZLncQe5Jt/dascrE4KfKd++MCtcoqG6ov4GoYYo 9fng== 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=a68uOIb5ZDVt/3oFh0J5AJJs418dr+JmnW1hZ4ubUw4=; b=RVds0sR8jWI3EvNh/jJJsFcc1O2l30bGvP56ABlwJkSp1/4oM2sPUeQ9RXJOq0UVG2 LU7BqkGDrNh9d9S+UmRepRx+7iw1vQqH5QmT/Tdj4/V7oa7pHfr6jZBybUQjY8/JfN+Z mqprOgosQ3hABj+YFyK09uvdWX5i70OCpHQWo0VmNBzXoQV8KsxJ/3GMWBTeVeIcHE/a USgqZQnQbxvmA+kYY04fYD6jzBUrAJuT2Njt/IwDS+bG1CGxEZSKeiLKXx1YJRMPeU3e yLes+ONZWRwV2lCS1Gxu4EGqCKgdheUo0iK99epiJ0smpZrHOxLf9EY7lJxMrmMYfq7e XzBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f3xk4iLQ; 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 33si38164745plg.62.2019.01.11.11.18.32; Fri, 11 Jan 2019 11:18:49 -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=f3xk4iLQ; 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 S2388632AbfAKO3B (ORCPT + 99 others); Fri, 11 Jan 2019 09:29:01 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:33978 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388615AbfAKO26 (ORCPT ); Fri, 11 Jan 2019 09:28:58 -0500 Received: by mail-lf1-f65.google.com with SMTP id p6so10955669lfc.1 for ; Fri, 11 Jan 2019 06:28:56 -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=a68uOIb5ZDVt/3oFh0J5AJJs418dr+JmnW1hZ4ubUw4=; b=f3xk4iLQIbRtksZiPsGNWVpN2YF29MeyhjoPA7WsereW42MwDsyL2g1Ytp0E3vsNKm hIX7/zDnYD3A6256FUcucP2sY2xhhoRmKreDCQVpoLwEyGV4niu26sDcpcdlQxsuaUUw pO1M7u5DUxZRPIx5f/Lsp3DJzZLVwfV5253Kg= 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=a68uOIb5ZDVt/3oFh0J5AJJs418dr+JmnW1hZ4ubUw4=; b=kTF0RnULSaxF+nashesJDpEoKzEDB+bCzq21Kyv0a1EjjRvkkzCjS+Lk04Jc+HpFJT iNB8oi6MdhrLboBDvbV01cY1F+SIra+Ua3yJi9p7NilhHXFovMMEnrIEaedOpyWr/tLT z+pw3mHt6PKH4uKnSL5wfYTrKPdCqwhZzJhN8QafpthNcfjjTniSPRCuLx6AGfU6GxDG CtLOqSFMwfgIeMGFr6aHtPXD7ERdIHHrvj5wpBciRYgrK2fewiqTyaSgOG5HvO+498QH o3X4Aaw7FU/X4BVGHOA/VyjS8kXW9s9V8uVOz68khpV1mkwg3TD0qXMcZGt+QTQf5dd7 pkwg== X-Gm-Message-State: AJcUukcN4jd1K7X+OonP8XsNuKlWx64Tw1NfBMFbuQWAFwSFMxNZhvtU ZZhBU/65gTjg2YybpfmLaoTTwg4rK5Zj1e/a6oatTg== X-Received: by 2002:a19:f813:: with SMTP id a19mr7894964lff.67.1547216935938; Fri, 11 Jan 2019 06:28:55 -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: Fri, 11 Jan 2019 15:28:44 +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 I applied this to the GPIO fixes with the ACKs. Ulf is on vacation but I managed to get his ACK over chat, so I will try to get this upstream ASAP. Yours, Linus Walleij