Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3636559ybi; Mon, 10 Jun 2019 13:52:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrMiz/LxSipX4JSJE4Qd6b88LxljtGCnc/OFnabGKxB08jGy8lt+EWvFNugbZIvaUI4RwO X-Received: by 2002:a17:902:20ec:: with SMTP id v41mr68416619plg.142.1560199973250; Mon, 10 Jun 2019 13:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560199973; cv=none; d=google.com; s=arc-20160816; b=dMHdqIuO53dvFtZxOFfaHlskZljRyl45cUBKgvStOapV2EZMEFY5MunIP8aFl5ak96 GXkvqyOEKycyq4DrLJDGadssQqMe5hiGJMsXymdwNTuWq2hZENtSEH6KGhhGDkQBLadk B7SOPtI2PhJQApV/+U+LlgNNe3OrEnA3j8lasy1/VxfM592TomUEmEK2vlAOvHihUZMA RKCWThqIYOOOgKeurNBzokdTYasRucNEFHIruGv10q+xLptFb49pdUIltC4CH+2ypax9 ru7CsX0gYf0XAn+kPFzA6hG1JOZQUe2zTQOzuh/6VB0530PZRldFTpnF0A+dJIrWPxQ5 4ZcA== 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=eyYkEWRj0YJV5ZLI8Mg19WpHWifRtrV4TMHZVE8qPm8=; b=QKILlGkKmd++H3cOxCWnGHAObtcySbv/+bP1g9xkGFgKAGGpv/ElghXKtIyoeLpZnT 3bwsAaHQYcVuYiiEB7DWxVnZZHiqjpGmuurQITBvRUhD/TmHlOFn2njiBPS493zm1Bo4 9Le5H0siwiWmr+foSeZuYrIZT6MUs8l1F0bWdwmYHfVTSTi2kmIeboZMrn6k1G2T3V1l NTa7MEMzDLkPmURRFpTFViIDD6DbJ4DV63NxtjHAVgqI05u82/r8+aBS63TIAID0dRz6 ZnnefCrPinGVp/CRnv8tsEPxqaytFk7k0+xTQ7KjOLl7PD6K+1jLzq49y67GAnyBOjpj syQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b="NC0Ym/md"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4si10576318pla.358.2019.06.10.13.52.38; Mon, 10 Jun 2019 13:52:53 -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=@poorly.run header.s=google header.b="NC0Ym/md"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728526AbfFJUv1 (ORCPT + 99 others); Mon, 10 Jun 2019 16:51:27 -0400 Received: from mail-vs1-f67.google.com ([209.85.217.67]:45057 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727588AbfFJUv1 (ORCPT ); Mon, 10 Jun 2019 16:51:27 -0400 Received: by mail-vs1-f67.google.com with SMTP id n21so6450115vsp.12 for ; Mon, 10 Jun 2019 13:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eyYkEWRj0YJV5ZLI8Mg19WpHWifRtrV4TMHZVE8qPm8=; b=NC0Ym/mdsDncoZDorvKAM6xnQHqO/QrBZMSByQ87DFOKOY5LektD3i2fXTPFMV5gEb B+jz+3Dd13t7MZNh2lFBrzF3VPLx1KIsiagqMIMYyENWW6PDVua6vokHuxp4iRB7SGBP oFhMiqoPRQF0lp325kHJWPXC+dup4oIV+FxnM24bVaa7URJymXv0UBdm6axvZ/7SXM0V KpHpsjeDDyeZoP+I9UaJoBhGziX7ec09BY4mQMov6WeiEnm+l5+JUFxqG2hd7MI5PM0F 5X61FbBw9ul1y43HMTwi6J7dygh1JPsAue+OITbRaSvfqs4rtsLSqXqhyOol/LAVEb3N Mc1g== 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=eyYkEWRj0YJV5ZLI8Mg19WpHWifRtrV4TMHZVE8qPm8=; b=Ac53C9Q8KFi3/sdW+bAA0EfuWKaDwdfZabVHjdnBOyNZXNtQk+9yZAtwvYea2eiptA XRMEDA3VaG0C0e0mbrOumECP3oPCeNS/doIxLa2iSxa29+Iy7k2I0G+op5fQAmtmY+Qf gPD6ZM9ylaExnzQx+K07eb87serI/xsos5kqL+GXqM5rbMMVv2mB/Fh9zbL3xKPtcoq0 2wzgnFCowwtjv7k5XdjkCHQWqS6szNKiE50b0bX0ikj5P4mYdUpvAV3e3Pk7Ct0wjGMi JliKp5Ca1MuQptBvLAUjqxN6TJklhwlI7NHsC8T0HRHzH5jTP0/HVqjm1I6nB8kJw3jF CayQ== X-Gm-Message-State: APjAAAW8WKnKFCM0nc8zXwSIntuUFzQZRoYrOa6od5xnxH1ucVtoLNei jtPNWaOYt+v3q2JYFlmbidMPH4biFtdQR3o5yLBgpQ== X-Received: by 2002:a67:6b43:: with SMTP id g64mr28426206vsc.183.1560199886317; Mon, 10 Jun 2019 13:51:26 -0700 (PDT) MIME-Version: 1.0 References: <20190610175234.196844-1-dianders@chromium.org> In-Reply-To: <20190610175234.196844-1-dianders@chromium.org> From: Sean Paul Date: Mon, 10 Jun 2019 16:50:50 -0400 Message-ID: Subject: Re: [PATCH] drm/bridge/synopsys: dw-hdmi: Fix unwedge crash when no pinctrl entries To: Douglas Anderson Cc: Sean Paul , "open list:ARM/Rockchip SoC..." , Erico Nunes , Heiko Stuebner , David Airlie , Andrzej Hajda , Jonas Karlman , LKML , dri-devel , Sam Ravnborg , Neil Armstrong , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Thomas Gleixner , Laurent Pinchart , Daniel Vetter 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 Mon, Jun 10, 2019 at 1:52 PM Douglas Anderson wrote: > > 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 Thanks Erico for the report, and Doug for fixing this up quickly, I've applied the patch to drm-misc-next Sean > --- > > 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 >