linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v1] drm/msm: add shutdown support for display platform_driver
@ 2020-05-28  8:38 Krishna Manikandan
  2020-05-28  8:58 ` Sai Prakash Ranjan
  2020-05-28 22:20 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Krishna Manikandan @ 2020-05-28  8:38 UTC (permalink / raw)
  To: dri-devel, linux-arm-msm, freedreno, devicetree
  Cc: Krishna Manikandan, linux-kernel, robdclark, seanpaul, hoegsberg,
	kalyan_t, nganji, mka

Define shutdown callback for display drm driver,
so as to disable all the CRTCS when shutdown
notification is received by the driver.

Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
---
 drivers/gpu/drm/msm/msm_drv.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index e4b750b..7a8953f 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -1322,6 +1322,18 @@ static int msm_pdev_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static void msm_pdev_shutdown(struct platform_device *pdev)
+{
+	struct drm_device *drm = platform_get_drvdata(pdev);
+
+	if (!drm) {
+		DRM_ERROR("Invalid drm device node\n");
+		return;
+	}
+
+	drm_atomic_helper_shutdown(drm);
+}
+
 static const struct of_device_id dt_match[] = {
 	{ .compatible = "qcom,mdp4", .data = (void *)KMS_MDP4 },
 	{ .compatible = "qcom,mdss", .data = (void *)KMS_MDP5 },
@@ -1334,6 +1346,7 @@ static int msm_pdev_remove(struct platform_device *pdev)
 static struct platform_driver msm_platform_driver = {
 	.probe      = msm_pdev_probe,
 	.remove     = msm_pdev_remove,
+	.shutdown   = msm_pdev_shutdown,
 	.driver     = {
 		.name   = "msm",
 		.of_match_table = dt_match,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [v1] drm/msm: add shutdown support for display platform_driver
  2020-05-28  8:38 [v1] drm/msm: add shutdown support for display platform_driver Krishna Manikandan
@ 2020-05-28  8:58 ` Sai Prakash Ranjan
  2020-05-28 22:20 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Sai Prakash Ranjan @ 2020-05-28  8:58 UTC (permalink / raw)
  To: Krishna Manikandan
  Cc: dri-devel, linux-arm-msm, freedreno, devicetree, linux-kernel,
	robdclark, seanpaul, hoegsberg, kalyan_t, nganji, mka,
	devicetree-owner, robin.murphy

Hi Krishna,

On 2020-05-28 14:08, Krishna Manikandan wrote:
> Define shutdown callback for display drm driver,
> so as to disable all the CRTCS when shutdown
> notification is received by the driver.
> 

Would be nice to add some more context for adding this shutdown callback
something like below:

If the hardware is still accessing memory after SMMU translation is 
disabled
as part of smmu shutdown callback,  then the IOVAs(I/O virtual address) 
which
it was using will go on the bus as the physical addresses which will 
result
in unknown crashes (NoC/interconnect errors on QCOM SoCs).

PS: Credits for description: Robin Murphy

Thanks,
Sai

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a 
member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [v1] drm/msm: add shutdown support for display platform_driver
  2020-05-28  8:38 [v1] drm/msm: add shutdown support for display platform_driver Krishna Manikandan
  2020-05-28  8:58 ` Sai Prakash Ranjan
@ 2020-05-28 22:20 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2020-05-28 22:20 UTC (permalink / raw)
  To: Krishna Manikandan, devicetree, dri-devel, freedreno, linux-arm-msm
  Cc: Krishna Manikandan, linux-kernel, robdclark, seanpaul, hoegsberg,
	kalyan_t, nganji, mka

Quoting Krishna Manikandan (2020-05-28 01:38:23)
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index e4b750b..7a8953f 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -1322,6 +1322,18 @@ static int msm_pdev_remove(struct platform_device *pdev)
>         return 0;
>  }
>  
> +static void msm_pdev_shutdown(struct platform_device *pdev)
> +{
> +       struct drm_device *drm = platform_get_drvdata(pdev);
> +
> +       if (!drm) {
> +               DRM_ERROR("Invalid drm device node\n");
> +               return;
> +       }

When would this ever happen? Please drop this useless check.

> +
> +       drm_atomic_helper_shutdown(drm);
> +}
> +
>  static const struct of_device_id dt_match[] = {
>         { .compatible = "qcom,mdp4", .data = (void *)KMS_MDP4 },
>         { .compatible = "qcom,mdss", .data = (void *)KMS_MDP5 },

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-28 22:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28  8:38 [v1] drm/msm: add shutdown support for display platform_driver Krishna Manikandan
2020-05-28  8:58 ` Sai Prakash Ranjan
2020-05-28 22:20 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).