Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp984259ybx; Wed, 30 Oct 2019 08:11:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtEAIRRAapD11CXKcXIb7PCHEbn2LoFgEw+fm0MZhE6qyFBVDZK6/RIOO1djouLlDppdUK X-Received: by 2002:a17:906:79cf:: with SMTP id m15mr9272184ejo.79.1572448296644; Wed, 30 Oct 2019 08:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572448296; cv=none; d=google.com; s=arc-20160816; b=LBvOb5h+7QUjsg5f3b60yAxgaB4SEzxtS9tIFBNsWQEI8Ze6cmUUAvac1fEP1cn9Ga nTihU3Sy6dQS7gkDlVDbX6XwyX+YJVeo3imYDfEB68n6dULDCquUyulQuxbWLHCoeuNg MzsKiSygXvvdsblslzr9cCVTF2bIxxL/kD9EZSJi4OwMR4BxAX5T2lQ7CfoP0sADocHe QK5vMuyCnt+aZHbAHLbQzIkGGQgvWYiCvNMH78TyhYKv6I964cfr3p8cV7dpL+JIZeHs R3yItrQm24GbqnN6ubBdL9yHAXa8f2+kjN0ogLaqkV6Wvdl90rg1956Wu/U35z0uR55x Y0wQ== 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=vWPvK2c6OyfVAzdkhOXR9vFmByKTbx2YLS3Y29+afB4=; b=z0AYoCxaj4WMQGIsBnCMj4mV1Yc+YjOYD0myB7dT+yeX/mXb6aDGLF7qlxqyYce7er B4dSi131E0QANydXnfBgKaqJ2YIhRU4ZdxYzADMT4KcYnM5mjFic00RjCvmSU2Y4C3i7 iOax6kp0VQW21EEbiydOpcYs+gVdSpIVwPTfH4IPZ4j/bI1pEU6shkkf/U8kBWtUrzKD qscK7VB+uoU2UrAnLkvZiNBwrY1awBSmFsUIsqcE6ETGBIdXe1RZE9FViNid7mWrQw1S kAfxWzVvsV6J/W0HOyWr3L7U8uk43D17px3IdMTE+hCzL+S/sVcuUyLQob1GU9eQGAWZ PN8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zuiLR9ai; 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 nn22si1444657ejb.258.2019.10.30.08.11.12; Wed, 30 Oct 2019 08:11:36 -0700 (PDT) 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=zuiLR9ai; 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 S1726925AbfJ3PKh (ORCPT + 99 others); Wed, 30 Oct 2019 11:10:37 -0400 Received: from mail-ua1-f65.google.com ([209.85.222.65]:39959 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbfJ3PKh (ORCPT ); Wed, 30 Oct 2019 11:10:37 -0400 Received: by mail-ua1-f65.google.com with SMTP id i13so791481uaq.7 for ; Wed, 30 Oct 2019 08:10:35 -0700 (PDT) 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=vWPvK2c6OyfVAzdkhOXR9vFmByKTbx2YLS3Y29+afB4=; b=zuiLR9ai+hclT9+gwgqH0OqEi9Pd7dVRwQNDKVvY0EhBOLUCH3P0UiTqHUEXd/9bIo 39mGEcFR2pZf/6vm/H0RoPat1+r9ropVskZU0VeM1tCVTdr42PL11wLJI3CqL2Kt6QPu gXzi32Ty2JjjIO4GfAI92xHtepkfGZDvbzKaUBKQRPHVf59P26N4e52n+zE7KWKSLIgn TFkUagCeRZ8edR9CeWUh+J8THTj1gPBvPskSsZ+G6OB8wi2ou+hUAhhCemNyAzTOavI0 z+IPXYh39UsJVpMLXvwfulPJZvgMQm4bM5oFq62630edcJ+K2gHYvtou+ijEa7+co3lG QimA== 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=vWPvK2c6OyfVAzdkhOXR9vFmByKTbx2YLS3Y29+afB4=; b=NCDNRzqqGEVKIfBpKmif2rJ8A/rK7oKjxib83g/a+6M/EjW1iSJq32WD5CYmaj+pFs lFErthD+EylpGpLxqhHJVrr1POpQvufyLr4V90885Kwrg9kFglFzsQoOxKwDzKF9bePW cpGvkw8XIZFFpX3UblOV5ZD0T1X6YSHyzbpNwulf8DnSEqbQHPb1Dl1u1XqM7uAo2FFw Fla1yvqpcMnj15SEVB1lAAgPwaXT50AhwKknDyxIyr+oGJCegP0VnyICRFKbIj3PvTxD MtzuG9IojBLO8TGnxVpRhsdG10ATX4To5xlNnYvSzx4HzuxVA8eVRcuqVYB0tOeexpyG 31aA== X-Gm-Message-State: APjAAAUhLwuv8dBqtpbHBy7WhZxq2IfUCAG+dheNd8AreXXbHrbyZITa GTLvw9+nzKvVPAWNsvEVbMzEYXlttoTgomPg/M3i2A== X-Received: by 2002:ab0:2258:: with SMTP id z24mr75332uan.100.1572448234841; Wed, 30 Oct 2019 08:10:34 -0700 (PDT) MIME-Version: 1.0 References: <20191018131338.11713-1-hslester96@gmail.com> <20191023153313.GB5153@kunai> In-Reply-To: <20191023153313.GB5153@kunai> From: Ulf Hansson Date: Wed, 30 Oct 2019 16:09:58 +0100 Message-ID: Subject: Re: [PATCH] mmc: renesas_sdhi: add checks for pinctrl_lookup_state To: Wolfram Sang Cc: Chuhong Yuan , Wolfram Sang , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List 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 Wed, 23 Oct 2019 at 17:33, Wolfram Sang wrote: > > On Mon, Oct 21, 2019 at 04:32:49PM +0200, Ulf Hansson wrote: > > On Fri, 18 Oct 2019 at 15:13, Chuhong Yuan wrote: > > > > > > renesas_sdhi_probe misses checks for pinctrl_lookup_state and may miss > > > failures. > > > Add checks for them to fix the problem. > > > > > > Signed-off-by: Chuhong Yuan > > > --- > > > drivers/mmc/host/renesas_sdhi_core.c | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c > > > index d4ada5cca2d1..dc5ad6632df3 100644 > > > --- a/drivers/mmc/host/renesas_sdhi_core.c > > > +++ b/drivers/mmc/host/renesas_sdhi_core.c > > > @@ -694,8 +694,13 @@ int renesas_sdhi_probe(struct platform_device *pdev, > > > if (!IS_ERR(priv->pinctrl)) { > > > priv->pins_default = pinctrl_lookup_state(priv->pinctrl, > > > PINCTRL_STATE_DEFAULT); > > > + if (IS_ERR(priv->pins_default)) > > > + return PTR_ERR(priv->pins_default); > > > + > > > priv->pins_uhs = pinctrl_lookup_state(priv->pinctrl, > > > "state_uhs"); > > > + if (IS_ERR(priv->pins_uhs)) > > > + return PTR_ERR(priv->pins_uhs); > > > } > > > > This looks correct to me, as I guess if there is a pinctrl specified > > for device node of the controller, it means that it should be used!? > > > > I understand that this is only used for those variants that supports > > UHS-I via the renesas_sdhi_start_signal_voltage_switch(). Wolfram, is > > this fine you think? > > Well, I don't like to bail out because this error is not fatal for basic > operations. How about releasing priv->pinctrl again with an additional > warning that pinctrl settings are broken and will prevent 1.8v modes? > > Opinions? Hmm, from a mmc driver probe point of view, I don't quite share this approach. I would rather fail as it forces the DTB to be corrected immediately, rather than trusting some developer to look at a warning in a log. The point is, in such a case it may never get fixed, if the product is shipped with the wrong DTB. My concern at this point is rather to break existing DTBs, but it seems that should not be an issue, right? Kind regards Uffe