Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp796091pxb; Fri, 14 Jan 2022 17:02:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxI8NeePBERym70Mi9FM7ApfQ7Px0Le5YJ3JRskVz7hHHZYjCfOZKKTSzi+Msmy76ZuhI2d X-Received: by 2002:a17:903:228b:b0:14a:8379:bb8b with SMTP id b11-20020a170903228b00b0014a8379bb8bmr8730878plh.110.1642208548349; Fri, 14 Jan 2022 17:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642208548; cv=none; d=google.com; s=arc-20160816; b=PNqi+wYyh+M3KYZrCjeX6hzisGLQO28CecsQ77WjeBI/2e4iSd9dE/3qT8mbgQqcZ+ UnKwtyjAdTGUFOX+c4p3Djh4izN/tLuyjiKNLpCd+bpctokDeXvx7dai4kSrg2rIfCqE o9t9EulsrcvJAKbo4K7XhTdbBQAGPN36GkmhsfTgg59O3aQxE95fb70CD7KyDABOv++0 dzV31RgdFK4wlu+xwCUhB0Ue+p1Ni3R+GaOuWNDLJ9OIQ7n1ECemICgNeKTF5ize2vCN QP8gue40NvWpJm31V/qDPoF8FajhQRjRE7hE0DhrYajQCC/58zZTq5k/n/ChPPMZR0Vn Tmkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:user-agent:from:references:in-reply-to:mime-version :dkim-signature; bh=qDCNZk+YHFKWNX9eKzf4zq71PK1bylZW31lIPLOmEsY=; b=vCFrPcNUuIgLT1EEsro+TUyjdoLNwspRABhsA383Q07qRD6pYFIz/CKBIYlfdGzUGi AK0Dx6l8SuBW+3+NILoy4exQn2kgtXSGp8COAwRxyGiGwJbPfJHkR6pEmON7HIrCMS8H 4b4Yqtts0yeF6ollaLNMmbJI9QsrJYTtxrsARwRu0bInpDPIaz5wbfgvURWO5KLzsm9g SgJnbaQNj5Dej5W7Hc6/NNZma69VMIramS8nKcnZBSia5NmgHNGbVLy9faB4c/AOsMJb X5IzEVaJ/Rs4gLcjgbnsmhO53rcvZ4ZMXCoXKEDXPpeT7+kuIuMfbCoKw5e9qKVyZjUe 4pfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=H5NbI8kg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id z10si4026962pfe.114.2022.01.14.17.02.15; Fri, 14 Jan 2022 17:02:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=H5NbI8kg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229845AbiANXXk (ORCPT + 99 others); Fri, 14 Jan 2022 18:23:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiANXXi (ORCPT ); Fri, 14 Jan 2022 18:23:38 -0500 Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3584C061574 for ; Fri, 14 Jan 2022 15:23:38 -0800 (PST) Received: by mail-oo1-xc2b.google.com with SMTP id b15-20020a4a878f000000b002dccc412166so3029579ooi.11 for ; Fri, 14 Jan 2022 15:23:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc:content-transfer-encoding; bh=qDCNZk+YHFKWNX9eKzf4zq71PK1bylZW31lIPLOmEsY=; b=H5NbI8kgzCbCfyozFmjg6/uEr7qn6iL5p8UFPpWfMcQpmR/nlKJXRlkUC3bOQSTyQ6 ySatRAtQEd3zeyO96nkLxISch3EU1dCm8OHaWlMnsurOn9Jc747u7wReSr+lN5aGSpvG KI3N8xrb6MvXpomk7+A3w0lc3EIXsXm8vJ+KE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc:content-transfer-encoding; bh=qDCNZk+YHFKWNX9eKzf4zq71PK1bylZW31lIPLOmEsY=; b=RMM6xHCUz1JZLsQK20wKCZGHGuk2OAyUkIGiNQ1iV4EAMl+606JfCsN3b+ImPsxdiC rfEbBA/3gJqKEQsX4RGMPcAsIkAsbdpfh6ZLPT65oL9uCtzlfKEa2vyszDq/bNTElRkk p0c7lqhZ7ul4L25ZOeiRYK7jYNPQ4SL5ycBZX0LnHkuzPY5mBW2jLwqfDl0KExVU+BJ5 hr3WJKPcoPdct/pTL0LP7iJlpqpdxwlAPDa1xqFTEcv2j4Vpc0wyW+y4ztgovbRg9nqU jnW9DFmvMkMukAbQLElmyncPtWawQNfOuooCA216HWmVB6AUJO5QMflSpaB2uylTBM2W oMwA== X-Gm-Message-State: AOAM532BHs94F8sQTD03LJy0lpfDcrcmCu8i3Ht0RiB7xdkp6jN31cmU HaCFeJK1dbE44evEeMFPoW0kXdqFmBzIBN/HRRpRtg== X-Received: by 2002:a4a:d818:: with SMTP id f24mr8003573oov.25.1642202617985; Fri, 14 Jan 2022 15:23:37 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 14 Jan 2022 17:23:37 -0600 MIME-Version: 1.0 In-Reply-To: References: <1642194710-2512-1-git-send-email-quic_khsieh@quicinc.com> <1642194710-2512-2-git-send-email-quic_khsieh@quicinc.com> From: Stephen Boyd User-Agent: alot/0.10 Date: Fri, 14 Jan 2022 17:23:37 -0600 Message-ID: Subject: Re: [PATCH v15 1/4] drm/msm/dp: do not initialize phy until plugin interrupt received To: Kuogee Hsieh , agross@kernel.org, airlied@linux.ie, bjorn.andersson@linaro.org, daniel@ffwll.ch, dmitry.baryshkov@linaro.org, dri-devel@lists.freedesktop.org, robdclark@gmail.com, sean@poorly.run, vkoul@kernel.org Cc: quic_abhinavk@quicinc.com, aravindh@codeaurora.org, quic_sbillaka@quicinc.com, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Kuogee Hsieh (2022-01-14 14:28:52) > > On 1/14/2022 1:41 PM, Stephen Boyd wrote: > > Quoting Kuogee Hsieh (2022-01-14 13:11:47) > >> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm= /dp/dp_display.c > >> index 7cc4d21..7cd6222 100644 > >> --- a/drivers/gpu/drm/msm/dp/dp_display.c > >> +++ b/drivers/gpu/drm/msm/dp/dp_display.c > >> @@ -696,12 +699,9 @@ static int dp_irq_hpd_handle(struct dp_display_pr= ivate *dp, u32 data) > >> * dp core (ahb/aux clks) must be initialized before > >> * irq_hpd be handled > >> */ > >> - if (dp->core_initialized) { > >> - ret =3D dp_display_usbpd_attention_cb(&dp->pdev->dev); > >> - if (ret =3D=3D -ECONNRESET) { /* cable unplugged */ > >> - dp->core_initialized =3D false; > >> - } > >> - } > >> + if (dp->core_initialized) > > When is this condition false? The irq isn't unmasked until the core has > > been initialized. On the resume path I suppose the irq is enabled in > > dp_display_host_init() calling dp_ctrl_reset_irq_ctrl(), and then we > > could immediately get the interrupt but it will block on the event_mute= x > > lock. > > This is left over form Lazor. > > I remember that there is an extreme case that several irq_hpd interrupts > happen right after dongle plug in=C2=A0 (happen at resume too) and someti= me > cause system crash at dpcd read due to AHB clock is not enabled yet. It > took some time to debug it. > > From looking into code, it does not look likely it will happen. But it > did happen at real world. How does it happen after this patch is applied? I remember the duplicate irq_hpd problem but that should have been solved by de-duplicating the irq in the hardware by leaving it pending until it was handled. Note, I'm not suggesting we remove the enabling of the core, just the check that the core is initialized. Now that the check for core_initialized is removed from the init function we have to make sure we only call the function one time to match what was there before. > > So that I would like to keep this condition checking. I'd rather not leave around dead code in this driver. The sharp edges are what we need to smooth out.