drm/panfrost: Rework runtime PM initialization
authorRob Herring <robh@kernel.org>
Mon, 26 Aug 2019 22:33:10 +0000 (17:33 -0500)
committerRob Herring <robh@kernel.org>
Fri, 30 Aug 2019 14:51:41 +0000 (09:51 -0500)
commit635430797d3fccb958e929d3911e39cb9c1ea641
treef5f8156075372e2a59e4967d188ef2eeeecf29dd
parent55b9a0549e4303ca43481f9ba2cdfa305277d97d
drm/panfrost: Rework runtime PM initialization

There's a few issues with the runtime PM initialization.

The documentation states pm_runtime_set_active() should be called before
pm_runtime_enable(). The pm_runtime_put_autosuspend() could suspend the GPU
before panfrost_perfcnt_init() is called which touches the h/w. The
autosuspend delay keeps things from breaking. There's no need explicitly
power off the GPU only to wake back up with pm_runtime_get_sync(). Just
delaying pm_runtime_enable to the end of probe is sufficient.

Lets move all the runtime PM calls into the probe() function so they are
all in one place and are done after all initialization.

Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Steven Price <steven.price@arm.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190826223317.28509-2-robh@kernel.org
drivers/gpu/drm/panfrost/panfrost_device.c
drivers/gpu/drm/panfrost/panfrost_drv.c