Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3245753iob; Fri, 6 May 2022 23:49:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsHKcd8GKbyRt4L9QoiiUbpSq1r6Yczgu0AGAL10DG9XDbIfIcNABR4t1lk+z/y68YYdkZ X-Received: by 2002:a17:906:9c85:b0:6f4:e065:4f4b with SMTP id fj5-20020a1709069c8500b006f4e0654f4bmr6276759ejc.92.1651906159202; Fri, 06 May 2022 23:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651906159; cv=none; d=google.com; s=arc-20160816; b=MBCorqdmuhQdnV0+joIXM0ubFdYsehY+pwmL5Dt75FvU8BZsBUupOs/hObw5H/VoEI fQzKatW3KFPmfToqMoeHBp/v0e1AdYKUleF0EOecJhbSA5Lwz+nEaZ1EkoI9RMWErbBr QduRQKUIdNXEvp7OOq6gCrH54LE9FWG6IWNigIjKqW9iXHrjfc+Z5uq7bUUjgc+4EmI8 4Trj/zQXpJ3okknMWQ5J4CvWqbDRU1QJDVOhvFnWx7S7a83La+NP7BSvgW46CLjcPi/D cNBRAUbY5+FEdoaKWx5R3BYV0N7/O3TDMWuXJYtJ3gjtu7yIV6ezd0NnaupogU8aqlAm GwJQ== 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=XlPHrH4AC6yStMEbAlCqpnskyR8Owtsgu3/YV4teEUY=; b=uyl2jXPlkGJFS6+s2UF2W7YUFT5KXBz3+9LeRATiQtOnVNbbgvpNDn93AH3xmpy6xM iBEoUCKqWcl0UYLpYJ3vByj4s6TqlNHdU9ZRP45zs9jMCtdAEt+XMLQ/RBxs1zyLTm6u YCE9ysWI+8OL4SLDGhCfbwRzC6OlRumbdMBBlDPLivq6+lkxGWHzx0Lhwl7ao3zC5x7Y mo0sFa0adAt4xBWM3IgmLyGrkALYoqVs+es9C7jLP7mfbn2aJUGoX7D01+QtVUaOsFeb gEoyMENo3gpbzW6lNg0u4Lw/dFN9IDER3V8rhYHKv9wpaPQE+UMykgbZiNX0TezggL33 eMoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=orHMgA5B; 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 g9-20020a056402090900b00425b91dc0c8si8380373edz.342.2022.05.06.23.48.55; Fri, 06 May 2022 23:49: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=@linaro.org header.s=google header.b=orHMgA5B; 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 S1380788AbiEDXsU (ORCPT + 99 others); Wed, 4 May 2022 19:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381234AbiEDXen (ORCPT ); Wed, 4 May 2022 19:34:43 -0400 Received: from mail-yw1-x112d.google.com (mail-yw1-x112d.google.com [IPv6:2607:f8b0:4864:20::112d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5818C1150 for ; Wed, 4 May 2022 16:31:06 -0700 (PDT) Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-2f7ca2ce255so32297167b3.7 for ; Wed, 04 May 2022 16:31:06 -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=XlPHrH4AC6yStMEbAlCqpnskyR8Owtsgu3/YV4teEUY=; b=orHMgA5BOQmpR/jRiIEwDfh36rnfK1oScGs66gqyt2xzfrP9Bokx0Fcdgdk9xjQWC6 o0aqWRWrPRU/zNVc3puXiKivPqzgnXJpABq0EtmzOI7lvkn0z+Iu6JxZfEyACntmWlrb Y3Fqp9sRdY0THHM0mkotSjGJolZRzgHGNRxOvCwWL+YT6c1j5yb4Pz5pvU8jjEZHuwa9 oeWlLQA0BfxCewuZl0fjC5bkaaOXpzdI0C1q5L0/Jq2okdMO+FUZMgGFonRloybJqDkL LHCBjcp160Al0orGJ73geBtTDKaU5wm2r032c35Bg+S8UGFPtitCQ4gPUq0xSLI85WUM eODA== 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=XlPHrH4AC6yStMEbAlCqpnskyR8Owtsgu3/YV4teEUY=; b=ldbMqIATcWTvP4d17jQzbW4Jk142TBIE3AgPIJKlQbqMu7hGzb2LIqqXPvVWpP6wUa iJe/Yzb3e0Ku6mGDsB83hQ4HUd4e3oyehmnxihdabrolBrKqxRLelPDgLcIgJYFOwaVt x0vMjasSeQ+8o6ffwNw/s9JYXqdC64f6DEnV3jX/UrmIF/1PiyW7Okl+Ju0VIO+8OlH5 wrGXNlO+lo2jeSkpx82p0GvBMy9K/Dc8mAaqQTpt/4ggfr2F6gFsqlclp9boZye4SFXI GKg9aDqs3YmlS85GBvxFmueBeC40bnUGqa5v4eJmdT/bffHrIsTQh4ylcxwup69d7icJ +IPg== X-Gm-Message-State: AOAM533VfpjHqjSQpoDCaorenTBeA4QykssfJLhVAewwMVtxKb3Xdcdj SDOZTZI4fn8y+POo/8eIwvt9RweqShNEiFIVB7VkxA== X-Received: by 2002:a81:492:0:b0:2f7:ce87:c324 with SMTP id 140-20020a810492000000b002f7ce87c324mr22215000ywe.359.1651707065587; Wed, 04 May 2022 16:31:05 -0700 (PDT) MIME-Version: 1.0 References: <20220504154909.1.Iaebd35e60160fc0f2a50fac3a0bf3b298c0637c8@changeid> <62426006-b5a1-cbe7-9c3a-16f94334208f@quicinc.com> In-Reply-To: <62426006-b5a1-cbe7-9c3a-16f94334208f@quicinc.com> From: Dmitry Baryshkov Date: Thu, 5 May 2022 02:30:54 +0300 Message-ID: Subject: Re: [PATCH] drm/msm: Fix shutdown To: Abhinav Kumar Cc: Douglas Anderson , Rob Clark , 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 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. > > > .driver = { > > .name = "msm-mdss", > > .of_match_table = mdss_dt_match, -- With best wishes Dmitry