Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2906200iog; Mon, 27 Jun 2022 05:30:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6d1hkeSPfKZ2yONZfrZmum1iPrNj5qPE/RsWBKoiq9qOVyZbxnCowjpIpudMerl2DVfzk X-Received: by 2002:a05:6a00:1908:b0:525:5dad:cb1c with SMTP id y8-20020a056a00190800b005255dadcb1cmr14600419pfi.47.1656333044482; Mon, 27 Jun 2022 05:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333044; cv=none; d=google.com; s=arc-20160816; b=DItzzYHwTnCwpKvwawVjfeNG9tST1B768OiYmYb9NyS+eANeHaBFppH4RfCKCdPFh0 689QdZODTJXPtvRJgi9Wk4rRqkjGhsXMAVin0FBcgVWHbUWHKJY4yOHSWiA4uSFDuoK9 8xOn7hTRu8yCdKGGjQnrLbaIadgSiWxit8P8EK7RIvA/vbHekGRn67b5oEiAmse7wqAu Kovqc4l0tL2qWnWfWU4NR1qf4eGPJwLc+9TzNxVvk+xAxh56HbMiNbWSENiXU+CURsLC 2IjyfvBGk1bRjqCH0t5bQhbwPvdvboWbjKcXfD80jyJKm80Ovc1rey/YrJ3VyKFq/vKe pfOQ== 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=2g68ink9Zc2HVkhbD0ohhyAceWBPbl/YoPfNa96vsaQ=; b=pYy07hDEwb7kNpJxb7anmZSPj8A9u/0EyggVVkiWkcRJ/b4ZNYi0+y0nSB64DGycl4 yA2qbPtZ3lWq8PiKDnRVBAw3RKseu7EZkJ6UiyuKIixrs6mMXh8V3JtMMp62/g+mpJGF a+iJiSQXUjf+JBGVak4YEPprbduSDs44Y8bxjap8hHB/E1o4Zi0FqOW1vx9Z3++dAkX1 d6FEzo6wJWGPTNV4QxGH3hEDDBz7bTdxTcJWw34NfdFYNC5Q+Yoi1OS3goiGsgJQAjzm UAABOJ5pvmuCzXvF/abNLu+OfF0VfmoB65YWMbNg7YBGrWl19b/GyjDh0CEKNAQhuQFK tF0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aYkOo8Ue; 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 j187-20020a638bc4000000b0040cb763766fsi12344421pge.588.2022.06.27.05.30.32; Mon, 27 Jun 2022 05:30:44 -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=aYkOo8Ue; 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 S234761AbiF0LYo (ORCPT + 99 others); Mon, 27 Jun 2022 07:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234702AbiF0LY2 (ORCPT ); Mon, 27 Jun 2022 07:24:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 711A7656D; Mon, 27 Jun 2022 04:24:27 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2BD82B81123; Mon, 27 Jun 2022 11:24:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 837B5C341C8; Mon, 27 Jun 2022 11:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329064; bh=NOyy/dtXYTY8dGXlloy+KHbFwq/CK32Uh4q32B604/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aYkOo8Uec9bUfwYVTSmSRTsH93FoJiiAZopWi/aNf0ZsgcuRO+wQnmX6I3RZLQ3zP mvS+B3TfvpkyC9hfAwi3y9hK5qjTmhbh/mT0F9V8ex5IDIR3KUjU8j6QvG5TnSqYUF hXrSyNI+saTC161kF8dziqlo5yhlpF9lJfKj4L8g= 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.10 037/102] drm/msm/dp: check core_initialized before disable interrupts at dp_display_unbind() Date: Mon, 27 Jun 2022 13:20:48 +0200 Message-Id: <20220627111934.564232490@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@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 ebd05678a27b..47bdddb860e5 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -268,7 +268,8 @@ static void dp_display_unbind(struct device *dev, struct device *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