Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1688015iob; Thu, 5 May 2022 06:31:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3wTpL1i1F+MMvcERQOmbcGj9Quf5sC7M1WyIYFgK85V8SbUvPL5HvmVFaB8ZYWpBoBWHY X-Received: by 2002:a17:907:2da2:b0:6f4:7395:568b with SMTP id gt34-20020a1709072da200b006f47395568bmr15720619ejc.766.1651757500111; Thu, 05 May 2022 06:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651757500; cv=none; d=google.com; s=arc-20160816; b=IZcQAVdNGQtm969E6RkU/31884D1s5bJt58wUPWFBrRhlMMicbDS9+IhCLkcGaO0/e p4I+/MZHvhy6UvGioORJIwccBcN3EJgUCeFI5tMZ4F8nJjidIXQnSVTFCIKQJdl7Oezt ck4bxhWoYVvjHGM9wHDLx9f+Kb5iDGVkkfjc68j8Tb1WZz+BtKJeUixkBdrvR9TTOEPo i1dK3X5og/KUTIpOhTIABaE0K+IYK9VPHMIM3/uwasYrav5nl9+88B7uw36R57M7RLIa ETvkJ526DU2jli9+o67sbQ2aedYlLrdpZhWe4KAh87quK8ABIvTxrjPaPFkMtqsktDZa opIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VqX+L5cVy9yuijOOGbq7nlWB+gmtg3F+IWXWN44DMBE=; b=pBTr/zVH75map+wiw09c132sON0mjbcpL6qqsmSm+HY/EZby7tWAmCNBLDt/qIQxPN zzMB1j0TBCJ2UjMFlWxBpA3XkS/W4rPL0YKhAjLU5nv9ZiYOLXv2sKsX15HgLtyw50tW YgjfqlZgb8aAiVgexL1hC1jmYTUh1WMs9dOIvi8+cY0+IZv72Qw0IEhLZCf3beH/VkFH n4jbbcrh7XaD1Jly7Xq1aF+5AwYx++m3H9x0bAYaeU0kYpS5gdeuzBSBaBGjIJL/62k+ n56VQLlMVntYj8hjGTlLmGcBhVyP9BW9oMvjdo1mR+nk7+XOGxjZs7MUPgA3xNRe89kI 84cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QsvQ5T9I; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc37-20020a1709071c2500b006f4568123b1si2763630ejc.962.2022.05.05.06.31.15; Thu, 05 May 2022 06:31:40 -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=@linaro.org header.s=google header.b=QsvQ5T9I; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382426AbiEDXs4 (ORCPT + 99 others); Wed, 4 May 2022 19:48:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380985AbiEDXdB (ORCPT ); Wed, 4 May 2022 19:33:01 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEAF84EA0A for ; Wed, 4 May 2022 16:29:23 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id s30so4986086ybi.8 for ; Wed, 04 May 2022 16:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VqX+L5cVy9yuijOOGbq7nlWB+gmtg3F+IWXWN44DMBE=; b=QsvQ5T9IwqqH17femP+peY5sAMty2MPUZRAw/FLwMCzKzi7C0jhCBphfokWbOeiHnc dl8jszpvhrnPwuF0BWqovYx/GrhaeL4vE807HEsC56BVp68TRsa3ZNILYAl71f7GbDJH 7nBCrpxtmhjlcc2/J7wVUULquRxvoN3KRr7Nz774xzdz0f0OWHdDqgfSBcwNKdFyXWMV 4zP8jOr7/ppH4N0JKI5dwLRkJo9mTy6rnRZzcvM661wwPckNhaYTXz1DePts+/Rq3WKr UU1knId8aEnkIr1vSO33NLwk45xH3GGyzthL4/JkHzfvj05kWApqJmF7nwjX8FyjWd+q ckUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VqX+L5cVy9yuijOOGbq7nlWB+gmtg3F+IWXWN44DMBE=; b=WaYVmh9bZgcs2WQnjFhanaQJcFDBoCVJGvEUXZDxQh2BUECpcL+z0m+/We6sxQGWAl gMjKQAilECQNArd+YqbMdn8eY9Z+qpisEYIR4e6lMpCR82HSF20iVteSzD4sCNvzlA/K LoEzf7K8U+tqKtYyJ2sxLQccpDjXZI36fzUCFBbx/m4vmUXYZ4Vb3BPN4NnWXkcJTbFx zWZSKsW6RxZ6KkX6ZA7AFfrowDsBPwKz1L982xZfK32aM3CB7q7kkJjbfx+imuYS4fcu DHyyvkWOj0XqPh0OQyUihpLkSy6HNwX7Y18ycWTv3mr91B1b9faKLRaP/13FJbpbfu7k CpuA== X-Gm-Message-State: AOAM530L+Id1tvuCNJJkSNWLkyqO9Gdb5VYKAdXkul69PBlVQIyh0TOr QdEVtpT769kDk1D7trylUIVONym5AVHZVoYfFgmMZg== X-Received: by 2002:a25:b1a5:0:b0:648:e230:aef with SMTP id h37-20020a25b1a5000000b00648e2300aefmr20592121ybj.175.1651706963203; Wed, 04 May 2022 16:29:23 -0700 (PDT) MIME-Version: 1.0 References: <20220504154909.1.Iaebd35e60160fc0f2a50fac3a0bf3b298c0637c8@changeid> In-Reply-To: <20220504154909.1.Iaebd35e60160fc0f2a50fac3a0bf3b298c0637c8@changeid> From: Dmitry Baryshkov Date: Thu, 5 May 2022 02:29:12 +0300 Message-ID: Subject: Re: [PATCH] drm/msm: Fix shutdown To: Douglas Anderson Cc: Rob Clark , Abhinav Kumar , Stephen Boyd , AngeloGioacchino Del Regno , Bjorn Andersson , Daniel Vetter , David Airlie , Lv Ruyi , Sean Paul , Vinod Polimera , Xu Wang , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Thu, 5 May 2022 at 01:49, 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") More likely: Fixes: 6874f48bb8b0 ("drm/msm: make mdp5/dpu devices master components") With that fixed: Reviewed-by: Dmitry Baryshkov > Signed-off-by: Douglas Anderson > --- > > 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, > .driver = { > .name = "msm-mdss", > .of_match_table = mdss_dt_match, > -- > 2.36.0.464.gb9c8b46e94-goog > -- With best wishes Dmitry