Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2909633iog; Mon, 27 Jun 2022 05:34:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tF7LqdVtNt1sHe9w+U5hQUXsESlNKrTPKntp1zoA1VYXKLOOZMYLQvI+Ki30T7ahKdO5ub X-Received: by 2002:a05:6402:348e:b0:435:a912:355f with SMTP id v14-20020a056402348e00b00435a912355fmr15694970edc.326.1656333259671; Mon, 27 Jun 2022 05:34:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333259; cv=none; d=google.com; s=arc-20160816; b=FnH+98/ni7E9oJFMf0RV60Bh1YP2tsQGQs2nPabHRA3VtppO/exkTV1dv2PSSYlGem 6dcOF16Hp/oij/EG1NXWWjOmeaabdniqC8xlF/9Wy4HJtxTl7evsfnFWnx22AZ71aTBt 7c7+YARNKOz7ZPzv1DfE9KKS+oQq3KTHlWu9pmLkTL/oZJEWgq/zJaDhyod3bqurnBE8 WfhWIt7mhl51lWq0wG/EkI0DXuSAkS1YcTHLijiuyAkKvZe9WZFmHpbg4Tc735zwpLq0 fLBy7IF2dOicfV35OciELW7ugOZHjz6SxGrOASbz90PY2Y41/jj7V8q6LiD5drrd4z/Y rxkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6fQMfanEBD/+2AvrAw6gcsItcRkmbHFBF1VmRxCtISg=; b=gw0XgQfgpgB+5a0IMqaExW+Et3a/N438Gy/FS0+2ANkSE8cY+LpN1AVZhnd/w4nUki 0Gvrtrv86O3HPHGRN4eZvE9CH2nMounebrhNOGNniZ86EPkploIZqhDnBJVzKsIDj18R tAwoZJ5B0crRGu1lPxNr+Kmzk/XkhAm+DPPJOGCQBxKCwRBfepeJJtkHmkMAsqXHaMsM GlQq+dM2ATKImJgl802Zue+2DfdSH9qu9Nw0WAzV3amN2QJLYJCtEYhQCWWdBA7138tN awTv4VgeULDrrtPgCsUxiIqJZdlWflA3daENy17TxU76rqP2TUbowlAzSxgSCU1H2RrC F2+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0nhjP71Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho13-20020a1709070e8d00b00722ebd0d050si11285974ejc.990.2022.06.27.05.33.54; Mon, 27 Jun 2022 05:34:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0nhjP71Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238837AbiF0Lx4 (ORCPT + 99 others); Mon, 27 Jun 2022 07:53:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238352AbiF0LsU (ORCPT ); Mon, 27 Jun 2022 07:48:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D868FF5BF; Mon, 27 Jun 2022 04:40:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6E39360C16; Mon, 27 Jun 2022 11:40:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F30EC385A2; Mon, 27 Jun 2022 11:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330051; bh=p43v1QQSS/eYXM1SQvebqgA0WDNJeAksylXwSwz473c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0nhjP71QhUe5H6ZGtL9YQjuHPuN04JnHBUb27I3zV2Q1a4rRhj92CHdjIZypbaqVY j3/HB4M1M6LUmF0vOT7sLnfigD6ZpkRu1Gz0EHhqQNqpc7LYB9uwFeT2Cse3BotCmG Ue3J1JUHutBoJ2q/wkkqnUpU3kFCQHzIC9bYijCc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuogee Hsieh , Stephen Boyd , Rob Clark , Sasha Levin Subject: [PATCH 5.18 067/181] drm/msm/dp: check core_initialized before disable interrupts at dp_display_unbind() Date: Mon, 27 Jun 2022 13:20:40 +0200 Message-Id: <20220627111946.507940123@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kuogee Hsieh [ Upstream commit d80c3ba0ac247791a4ed7a0cd865a64906c8906a ] During msm initialize phase, dp_display_unbind() will be called to undo initializations had been done by dp_display_bind() previously if there is error happen at msm_drm_bind. In this case, core_initialized flag had to be check to make sure clocks is on before update DP controller register to disable HPD interrupts. Otherwise system will crash due to below NOC fatal error. QTISECLIB [01f01a7ad]CNOC2 ERROR: ERRLOG0_LOW = 0x00061007 QTISECLIB [01f01a7ad]GEM_NOC ERROR: ERRLOG0_LOW = 0x00001007 QTISECLIB [01f0371a0]CNOC2 ERROR: ERRLOG0_HIGH = 0x00000003 QTISECLIB [01f055297]GEM_NOC ERROR: ERRLOG0_HIGH = 0x00000003 QTISECLIB [01f072beb]CNOC2 ERROR: ERRLOG1_LOW = 0x00000024 QTISECLIB [01f0914b8]GEM_NOC ERROR: ERRLOG1_LOW = 0x00000042 QTISECLIB [01f0ae639]CNOC2 ERROR: ERRLOG1_HIGH = 0x00004002 QTISECLIB [01f0cc73f]GEM_NOC ERROR: ERRLOG1_HIGH = 0x00004002 QTISECLIB [01f0ea092]CNOC2 ERROR: ERRLOG2_LOW = 0x0009020c QTISECLIB [01f10895f]GEM_NOC ERROR: ERRLOG2_LOW = 0x0ae9020c QTISECLIB [01f125ae1]CNOC2 ERROR: ERRLOG2_HIGH = 0x00000000 QTISECLIB [01f143be7]GEM_NOC ERROR: ERRLOG2_HIGH = 0x00000000 QTISECLIB [01f16153a]CNOC2 ERROR: ERRLOG3_LOW = 0x00000000 QTISECLIB [01f17fe07]GEM_NOC ERROR: ERRLOG3_LOW = 0x00000000 QTISECLIB [01f19cf89]CNOC2 ERROR: ERRLOG3_HIGH = 0x00000000 QTISECLIB [01f1bb08e]GEM_NOC ERROR: ERRLOG3_HIGH = 0x00000000 QTISECLIB [01f1d8a31]CNOC2 ERROR: SBM1 FAULTINSTATUS0_LOW = 0x00000002 QTISECLIB [01f1f72a4]GEM_NOC ERROR: SBM0 FAULTINSTATUS0_LOW = 0x00000001 QTISECLIB [01f21a217]CNOC3 ERROR: ERRLOG0_LOW = 0x00000006 QTISECLIB [01f23dfd3]NOC error fatal changes in v2: -- drop the first patch (drm/msm: enable msm irq after all initializations are done successfully at msm_drm_init()) since the problem had been fixed by other patch Fixes: 570d3e5d28db ("drm/msm/dp: stop event kernel thread when DP unbind") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/488387/ Link: https://lore.kernel.org/r/1654538139-7450-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/dp/dp_display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 8deb92bddfde..d11c81d8a5db 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -308,7 +308,8 @@ static void dp_display_unbind(struct device *dev, struct device *master, struct msm_drm_private *priv = dev_get_drvdata(master); /* disable all HPD interrupts */ - dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_INT_MASK, false); + if (dp->core_initialized) + dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_INT_MASK, false); kthread_stop(dp->ev_tsk); -- 2.35.1