Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2476424iob; Fri, 6 May 2022 03:55:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+gsBjcxuQh1MXGFaey9/nw0KcHUYv8Pk6rmIrDUqyxcWvJQ19UH1UuyiKf2v1VUyTiB0n X-Received: by 2002:a17:90a:4d04:b0:1d9:3f18:f4dd with SMTP id c4-20020a17090a4d0400b001d93f18f4ddmr3414964pjg.111.1651834552647; Fri, 06 May 2022 03:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651834552; cv=none; d=google.com; s=arc-20160816; b=LKrMLuXXBjIUFCIuFmOAGavlbqw7BGGJiONSbV4sWgyJ0pkxYYw0rEAPXvvlNoJp/k E8KNuvK90u8s0crwghrByTtEX8d3ALpPvR7LtWvR4bqrltcP98fD8IpXk/UwoGWyPZwV pdI6Ncp4SjBpfsU5dTNJf+3DStA4zQK5Et4aiK1ZRAZlNA3dHNn4RCN9AZsJTd36mQMz 7VZw6iFmfsF3Qpg4UGN4f1f5ZDhsojxtu5MNBN4VD9Q4onqPl/jb4BG0d9wxJLmLQ8Z7 bz4AfLrDcitiC2vPhAj5sRI9r3Xw18Er6vA2Hefz/MyTDbIdipJmx6phb5bhSdEl+0xg QljA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=2EKl1pLEHQIzxhFCcd9eEsheg+eBfByZIiGcnxTBPkI=; b=hF8qZA+GKJXdI4Q3e3cX/TLAth0QooBa4ZoXUp2XkgtSSje9j9GEyV1WW90ag3cPg4 pn8SrCaWwq7Lzuli1eemJrYAFYlbHEc/BeZNEQatqT8Zwq3/KiIv2+3FCMmOIOAtNT2H 4nQUewbrDVqYnWCUQ270asYx746GACL+iT+WQnFuMzdQGPbUr073YRLBQP7NRSMkIqTQ rc92hf8LW8SbWNR+DXZwVTZJAKVkW9hRUUWQWazFo5B1nQ0cMsWllFQPqmU8LkOiC4tg wsIEqZ+rhXHi8euTGfSINtdx6QJfCLDwG1u+p2Oo0hEhEFGiN7KCRS3fDd6CNiZZA9uE i+5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=LlbiymG4; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u24-20020a056a00099800b0050a707536ecsi4419593pfg.299.2022.05.06.03.55.33; Fri, 06 May 2022 03:55:52 -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=@quicinc.com header.s=qcdkim header.b=LlbiymG4; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381444AbiEDXsj (ORCPT + 99 others); Wed, 4 May 2022 19:48:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380748AbiEDXcu (ORCPT ); Wed, 4 May 2022 19:32:50 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0A384EA0A; Wed, 4 May 2022 16:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651706953; x=1683242953; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=2EKl1pLEHQIzxhFCcd9eEsheg+eBfByZIiGcnxTBPkI=; b=LlbiymG4KdKBun/oGJ8TjpqJBzKywHS5jbC1HhXtOrY2V/QJ4HOqsnlM L1AGsX5+Noxgha8vcRNQIah3yE0C+WUc/UUKjRDi2ySXxIYRk8tMyU6oz 7II1J36AbwA1evTCslACAeXPMusgsGqGYpcu6SCG0xmmy6uD7trzB7kPw Y=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 04 May 2022 16:29:13 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 16:29:12 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 4 May 2022 16:29:12 -0700 Received: from [10.38.244.235] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 4 May 2022 16:29:07 -0700 Message-ID: <62426006-b5a1-cbe7-9c3a-16f94334208f@quicinc.com> Date: Wed, 4 May 2022 16:29:05 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH] drm/msm: Fix shutdown Content-Language: en-US To: Douglas Anderson , Rob Clark , Dmitry Baryshkov CC: Stephen Boyd , AngeloGioacchino Del Regno , Bjorn Andersson , Daniel Vetter , David Airlie , Lv Ruyi , Sean Paul , Vinod Polimera , Xu Wang , , , , References: <20220504154909.1.Iaebd35e60160fc0f2a50fac3a0bf3b298c0637c8@changeid> From: Abhinav Kumar In-Reply-To: <20220504154909.1.Iaebd35e60160fc0f2a50fac3a0bf3b298c0637c8@changeid> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 On 5/4/2022 3:49 PM, Douglas Anderson wrote: > When rebooting on my sc7280-herobrine based device, I got a > crash. Upon debugging, I found that I was in msm_drv_shutdown() and my > "pdev" was the one associated with mdss_probe(). > > From source, I found that mdss_probe() has the line: > platform_set_drvdata(pdev, mdss); > ...where "mdss" is of type "struct msm_mdss *". > > Also from source, I saw that in msm_drv_shutdown() we have the line: > struct msm_drm_private *priv = platform_get_drvdata(pdev); > > This is a mismatch and is the root of the problem. > > Further digging made it apparent that msm_drv_shutdown() is only > supposed to be used for parts of the msm display framework that also > call msm_drv_probe() but mdss_probe() doesn't call > msm_drv_probe(). Let's remove the shutdown functon from msm_mdss.c. > > Digging a little further, code inspection found that two drivers that > use msm_drv_probe() weren't calling msm_drv_shutdown(). Let's add it > to them. > > Fixes: ecb23f2e3009 ("drm/msm: split the main platform driver") > Signed-off-by: Douglas Anderson Makes sense to me, and issue should happen everytime we shutdown so not sure how it didnt hit? > --- > > drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 1 + > drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 1 + > drivers/gpu/drm/msm/msm_mdss.c | 1 - > 3 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c > index 143d6643be53..2b9d931474e0 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c > @@ -1350,6 +1350,7 @@ MODULE_DEVICE_TABLE(of, dpu_dt_match); > static struct platform_driver dpu_driver = { > .probe = dpu_dev_probe, > .remove = dpu_dev_remove, > + .shutdown = msm_drv_shutdown, > .driver = { > .name = "msm_dpu", > .of_match_table = dpu_dt_match, > diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c > index 9b7bbc3adb97..3d5621a68f85 100644 > --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c > +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c > @@ -1009,6 +1009,7 @@ MODULE_DEVICE_TABLE(of, mdp5_dt_match); > static struct platform_driver mdp5_driver = { > .probe = mdp5_dev_probe, > .remove = mdp5_dev_remove, > + .shutdown = msm_drv_shutdown, > .driver = { > .name = "msm_mdp", > .of_match_table = mdp5_dt_match, > diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c > index 20f154dda9cf..0454a571adf7 100644 > --- a/drivers/gpu/drm/msm/msm_mdss.c > +++ b/drivers/gpu/drm/msm/msm_mdss.c > @@ -397,7 +397,6 @@ MODULE_DEVICE_TABLE(of, mdss_dt_match); > static struct platform_driver mdss_platform_driver = { > .probe = mdss_probe, > .remove = mdss_remove, > - .shutdown = msm_drv_shutdown, Question to doug/dmitry: Now that we removed msm_drv_shutdown, perhaps we should have a mdss_shutdown instead and call msm_mdss_destroy() internally? > .driver = { > .name = "msm-mdss", > .of_match_table = mdss_dt_match,