Received: by 2002:a17:90a:37a3:0:0:0:0 with SMTP id v32csp4127037pjb; Mon, 10 Jun 2019 10:53:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoOhOEx4yf1xFEbJCtxaLnRvx/wsQSLv+pUHQg5Fe0fY0Untp+Dr/Q1cHzTHQF6MimrMZQ X-Received: by 2002:a63:6685:: with SMTP id a127mr16481673pgc.22.1560189205102; Mon, 10 Jun 2019 10:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560189205; cv=none; d=google.com; s=arc-20160816; b=e+yzTEOTWGlSbampRzA+7zyaRcXCQyNLy8+ypAA4Zb9ZAqKPI6nvGx5CUiSn2NeJ8O MM5F5c6xQJxdHPGOr2KAhfB4YaAlu8546BHUmv3vOQOZRJYJSZj4loKMbvrvqbdd49U0 jNHpxcqa9TwFjU3sAWFsVGq/+B2NbPIiKBsyCmzO/TgBf98CToa+ImwQGcZwOldeKXsE kUw/b4rf9Iwissyn8vlswH1XGv4fD3C0JQIpFAwYh6Tk9rBkuXbckkMuzsAeaIRUJQ/U 4WZp1bsHBVdCUaopWVygTM9CXHYFXE94alKwqkrdoWGEjl6+hq44U7JCmKh3zIH47+Vi P0xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=e+j33U/KoRlNgTFzxm2+JBRTgicwoY0lYBd07TSgrA8=; b=EWgn8ngwiWelN0TQsLVIcM8oeYYHn3P9Zv6ioCilS3PlVJ67ZdNIDv3RorugJVGf6J blyEReowY2c6ZaL5BzTV53EzYsoX9mOu6LQOlBWAT4L1V2fJrYmUzVBmtbGjcNpyxpEW PjjdJNEj1Nyl4KLL8pjVMr21zNTpf+dykHEZRmpe0L1gUkHH7lyOTsOodWWXQt157VIj GxUlNZ7dN3xSnYNiVYq+zKpiL0yJIncS5LIt4Gl9jIq878QVoXtSoVrd7koU8Onb1pdM QYYpK1uxkGEvDgM6K5xBpR1WeRt9aYxmqsIezVOgTcGKnzKliqba7HbAh5CWVjB3AfNr sK1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cxF1nMuo; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si10833345pfi.23.2019.06.10.10.53.09; Mon, 10 Jun 2019 10:53:25 -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=@chromium.org header.s=google header.b=cxF1nMuo; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388380AbfFJRwu (ORCPT + 99 others); Mon, 10 Jun 2019 13:52:50 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46090 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388108AbfFJRwt (ORCPT ); Mon, 10 Jun 2019 13:52:49 -0400 Received: by mail-pf1-f194.google.com with SMTP id 81so5713589pfy.13 for ; Mon, 10 Jun 2019 10:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=e+j33U/KoRlNgTFzxm2+JBRTgicwoY0lYBd07TSgrA8=; b=cxF1nMuo6dYPyZe7IW550Tuvt/62sqAH3zxqkBDBP60Zvf09/H9NyJ84Hes67AMcs+ FT0mKqC866kkF5lMJa9TjElrohQWwc7L7NecmxSE5p/88FgBlI315lwC72hDmcLD12FS La1s9o0nVajzrUxY6540kLZ1wY50dWzDdtCIg= 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=e+j33U/KoRlNgTFzxm2+JBRTgicwoY0lYBd07TSgrA8=; b=SME/1in9dkzPcAYhOZXYt7+XuOnsZ37WfRG2mBGVpScuMzxHUpd2bpDXcgyuS75fWL cfTu5ZDosLXavWiX9JFkmWqYAKiwxNfgcwG1WDCfnlKGkRt6apfVDHPhRlocifsPrdfd BfdQ8Hnot+vKpJpKFMP9Z/fU1mxMuYj2DEyYO29w2Gk9lZwn5YQDFMZW5GHqR9CuUK9i r0EI/fs2CgtxLex8eHppue5CiWQg24zSokolJhp9UnOeMHCU3oxBtDSqqZSleuJ6Q6Ix W0mZAX+kvQOqigyhxuYrtzEDGF/FmImXY9QmYRTzLdWwuT1r+fxG0mG1WrdA4NNb/vYB f0Aw== X-Gm-Message-State: APjAAAXtqAz3dpnkgPBTIgIDQhdMb49vF5Hxlf/8ex5zfZyWcOLwm/Tu tKPQ68YRxirw/pKXcOM9F1WMUQ== X-Received: by 2002:a17:90a:e397:: with SMTP id b23mr22154592pjz.140.1560189169114; Mon, 10 Jun 2019 10:52:49 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id o192sm12247158pgo.74.2019.06.10.10.52.48 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 10:52:48 -0700 (PDT) From: Douglas Anderson To: Sean Paul Cc: linux-rockchip@lists.infradead.org, Erico Nunes , heiko@sntech.de, Douglas Anderson , David Airlie , Andrzej Hajda , Jonas Karlman , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sam Ravnborg , Neil Armstrong , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Thomas Gleixner , Laurent Pinchart , Daniel Vetter Subject: [PATCH] drm/bridge/synopsys: dw-hdmi: Fix unwedge crash when no pinctrl entries Date: Mon, 10 Jun 2019 10:52:34 -0700 Message-Id: <20190610175234.196844-1-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In commit 50f9495efe30 ("drm/bridge/synopsys: dw-hdmi: Add "unwedge" for ddc bus") I stupidly used IS_ERR() to check for whether we have an "unwedge" pinctrl state even though on most flows through the driver the unwedge state will just be NULL. Fix it so that we consistently use NULL for no unwedge state. Fixes: 50f9495efe30 ("drm/bridge/synopsys: dw-hdmi: Add "unwedge" for ddc bus") Reported-by: Erico Nunes Signed-off-by: Douglas Anderson --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index f25e091b93c5..5e4e9408d00f 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -251,7 +251,7 @@ static void dw_hdmi_i2c_init(struct dw_hdmi *hdmi) static bool dw_hdmi_i2c_unwedge(struct dw_hdmi *hdmi) { /* If no unwedge state then give up */ - if (IS_ERR(hdmi->unwedge_state)) + if (!hdmi->unwedge_state) return false; dev_info(hdmi->dev, "Attempting to unwedge stuck i2c bus\n"); @@ -2686,11 +2686,13 @@ __dw_hdmi_probe(struct platform_device *pdev, hdmi->default_state = pinctrl_lookup_state(hdmi->pinctrl, "default"); - if (IS_ERR(hdmi->default_state) && - !IS_ERR(hdmi->unwedge_state)) { - dev_warn(dev, - "Unwedge requires default pinctrl\n"); - hdmi->unwedge_state = ERR_PTR(-ENODEV); + if (IS_ERR(hdmi->default_state) || + IS_ERR(hdmi->unwedge_state)) { + if (!IS_ERR(hdmi->unwedge_state)) + dev_warn(dev, + "Unwedge requires default pinctrl\n"); + hdmi->default_state = NULL; + hdmi->unwedge_state = NULL; } } -- 2.22.0.rc2.383.gf4fbbf30c2-goog