Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4637482iob; Sun, 8 May 2022 20:09:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvhjceOsjNCU60knxmkaL8K8FahQa536uvwOEz//2F7TSsEj0V5Hfj+L8xGDdtcngyq64l X-Received: by 2002:a63:653:0:b0:3c6:3a11:c1a9 with SMTP id 80-20020a630653000000b003c63a11c1a9mr11476922pgg.440.1652065741225; Sun, 08 May 2022 20:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652065741; cv=none; d=google.com; s=arc-20160816; b=Jzd3897eXkEVDwpO4qC+eNK1w0be63us08nXtDuoiITnCOiozqHwDV222U/cygV2Pj QQIC2yfb9iOKXZSWLRw3zsiYPe2jLBk+9XiO+FNxEjVLWqoB8uxZTYPwYHvK0DbMR0kq r5pGczV19jebhV73IxpQ/paxBA2oKtIt0qe81sT1/JHbnDW1VGTXe9HrzoKzkkiVnfbL wxdV+8BPFtXz+zzaxd+LxuIlNhsy7cAODZJOmlG/9mdhL5DCUbY3lc+8Ob0St6kGMrlG e1mywKHyUBPEBpJLyBcySo+xkN/vasuJWC0eNql6Lh/nuhgaEHhPJN9UxVbSdjea7Ny/ f+Vg== 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=V8DN7hiINArvmBql69X4bcswhXZFwV1qi/fjI8rUQNQ=; b=GKspNjodcS5fuDNUvGm3FqyBbRusI2I6gW+rQHoqY7Y35uUCLEJmExPE9rGNZfyXKA kAOIpy6M6oYi7WcJBXnNi0BbEs6/vukRCA60QXo6MEzHOAPzBtxOglD9oYEQwm6RmMze CiwOG/7rB21VmibiyzQqYxVQufTemANAxyOYoi4CXIbMyEGvACtRZWTwfgWArslLCrcp zT5Fv7ZQhO1hapdip9xS+4/+o0LSMO1mZN20cuA59OPXifNqKew+lH4KoAdOtcMN8MCj ycDQhGC5mpAl5zhjBb8Mc5QAwVWOQ43SOIQbIeiEOv4/f3Geiwsvmufs/bYfh8A6jpUw c3GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=SvrCIYoK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p6-20020a170902bd0600b00158b603b0aesi9427658pls.589.2022.05.08.20.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:09:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=SvrCIYoK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CEFB08CDA4; Sun, 8 May 2022 20:08:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241196AbiEDXro (ORCPT + 99 others); Wed, 4 May 2022 19:47:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232869AbiEDXhO (ORCPT ); Wed, 4 May 2022 19:37:14 -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 87C681150; Wed, 4 May 2022 16:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651707217; x=1683243217; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=V8DN7hiINArvmBql69X4bcswhXZFwV1qi/fjI8rUQNQ=; b=SvrCIYoKI1/1BGAe3BpPK4D02Ea+sy2q/Rt1wmH+stlX5azw49asXnta jyF5VI5Omtwmc93Mx45Vbxcj8ocv8M+ASYVvrDm0V0ErzMst4p9VPRFtr zUyPGIkQ4Y+VPFPSo/DIWPyKxob5Vfr04lIYjZ3rimdaIs1b0FsJoJJJi s=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 04 May 2022 16:33:37 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 16:33:36 -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:33:36 -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:33:32 -0700 Message-ID: <24844933-5711-87de-fe1c-21c8279d86e0@quicinc.com> Date: Wed, 4 May 2022 16:33:30 -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: Dmitry Baryshkov CC: , David Airlie , , Lv Ruyi , "Douglas Anderson" , , "Bjorn Andersson" , Xu Wang , AngeloGioacchino Del Regno , Stephen Boyd , Sean Paul , "Vinod Polimera" , References: <20220504154909.1.Iaebd35e60160fc0f2a50fac3a0bf3b298c0637c8@changeid> <62426006-b5a1-cbe7-9c3a-16f94334208f@quicinc.com> From: Abhinav Kumar In-Reply-To: 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=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 4:30 PM, Dmitry Baryshkov wrote: > On Thu, 5 May 2022 at 02:29, Abhinav Kumar wrote: >> >> >> >> 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? > > No need to. msm-mdss driver doesn't really need to be shutdown. It > doesn't setup DMA, it doesn't setup video pipes, etc. Alright, Reviewed-by: Abhinav Kumar > >> >>> .driver = { >>> .name = "msm-mdss", >>> .of_match_table = mdss_dt_match, > > >