linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	David Airlie <airlied@linux.ie>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Maxime Ripard <mripard@kernel.org>, Emma Anholt <emma@anholt.net>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Phil Elwell <phil@raspberrypi.com>,
	Tim Gover <tim.gover@raspberrypi.com>,
	Dom Cobley <dom@raspberrypi.com>,
	linux-rpi-kernel@lists.infradead.org,
	Nicolas Saenz Julienne <nsaenz@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	LKML <linux-kernel@vger.kernel.org>,
	bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH v2 1/5] drm/vc4: hdmi: Make sure the controller is powered up during bind
Date: Wed, 28 Jul 2021 14:50:03 +0100	[thread overview]
Message-ID: <CAPY8ntDdjtB5Hs=XiwWg5Nng5UOrrHxV_A5vALhvLtfv=uphaQ@mail.gmail.com> (raw)
In-Reply-To: <20210707092257.1465109-2-maxime@cerno.tech>

Hi Maxime

On Wed, 7 Jul 2021 at 10:23, Maxime Ripard <maxime@cerno.tech> wrote:
>
> In the bind hook, we actually need the device to have the HSM clock
> running during the final part of the display initialisation where we
> reset the controller and initialise the CEC component.
>
> Failing to do so will result in a complete, silent, hang of the CPU.
>
> Fixes: 411efa18e4b0 ("drm/vc4: hdmi: Move the HSM clock enable to runtime_pm")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>  drivers/gpu/drm/vc4/vc4_hdmi.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> index aab1b36ceb3c..dac47b100b8b 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -2176,6 +2176,18 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
>                         vc4_hdmi->disable_4kp60 = true;
>         }
>
> +       /*
> +        * We need to have the device powered up at this point to call
> +        * our reset hook and for the CEC init.
> +        */
> +       ret = vc4_hdmi_runtime_resume(dev);

vc4_hdmi_runtime_resume is within a #ifdef CONFIG_PM block, so
potentially isn't defined.
Admittedly we "select PM" in Kconfig so it should always be enabled,
so perhaps it's better to just remove the #ifdef CONFIG_PM around the
resume and suspend functions.

That's possibly a separate issue to the issue that this patch is
addressing, but may explain the test bot's failure. Otherwise
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

> +       if (ret)
> +               goto err_put_ddc;
> +
> +       pm_runtime_get_noresume(dev);
> +       pm_runtime_set_active(dev);
> +       pm_runtime_enable(dev);
> +
>         if (vc4_hdmi->variant->reset)
>                 vc4_hdmi->variant->reset(vc4_hdmi);
>
> @@ -2187,8 +2199,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
>                 clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
>         }
>
> -       pm_runtime_enable(dev);
> -
>         drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
>         drm_encoder_helper_add(encoder, &vc4_hdmi_encoder_helper_funcs);
>
> @@ -2208,6 +2218,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
>                              vc4_hdmi_debugfs_regs,
>                              vc4_hdmi);
>
> +       pm_runtime_put_sync(dev);
> +
>         return 0;
>
>  err_free_cec:
> @@ -2216,6 +2228,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
>         vc4_hdmi_connector_destroy(&vc4_hdmi->connector);
>  err_destroy_encoder:
>         drm_encoder_cleanup(encoder);
> +       pm_runtime_put_sync(dev);
>         pm_runtime_disable(dev);
>  err_put_ddc:
>         put_device(&vc4_hdmi->ddc->dev);
> --
> 2.31.1
>

  reply	other threads:[~2021-07-28 13:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  9:22 [PATCH v2 0/5] drm/vc4: hdmi: Fix CEC access while disabled Maxime Ripard
2021-07-07  9:22 ` [PATCH v2 1/5] drm/vc4: hdmi: Make sure the controller is powered up during bind Maxime Ripard
2021-07-28 13:50   ` Dave Stevenson [this message]
2021-07-07  9:22 ` [PATCH v2 2/5] drm/vc4: hdmi: Rework the pre_crtc_configure error handling Maxime Ripard
2021-07-07  9:22 ` [PATCH v2 3/5] drm/vc4: hdmi: Split the CEC disable / enable functions in two Maxime Ripard
2021-07-07  9:22 ` [PATCH v2 4/5] drm/vc4: hdmi: Make sure the device is powered with CEC Maxime Ripard
2021-07-07  9:22 ` [PATCH v2 5/5] drm/vc4: hdmi: Warn if we access the controller while disabled Maxime Ripard
2021-07-28 13:52 ` [PATCH v2 0/5] drm/vc4: hdmi: Fix CEC access " Dave Stevenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPY8ntDdjtB5Hs=XiwWg5Nng5UOrrHxV_A5vALhvLtfv=uphaQ@mail.gmail.com' \
    --to=dave.stevenson@raspberrypi.com \
    --cc=airlied@linux.ie \
    --cc=bbrezillon@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=daniel.vetter@intel.com \
    --cc=dom@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emma@anholt.net \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime@cerno.tech \
    --cc=mripard@kernel.org \
    --cc=nsaenz@kernel.org \
    --cc=phil@raspberrypi.com \
    --cc=tim.gover@raspberrypi.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).