From: Sam Ravnborg <sam@ravnborg.org>
To: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: alexandre.belloni@bootlin.com, bbrezillon@kernel.org,
airlied@linux.ie, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com,
daniel@ffwll.ch, lee.jones@linaro.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/5] drm: atmel-hlcdc: enable clock before configuring timing engine
Date: Tue, 10 Dec 2019 21:18:45 +0100 [thread overview]
Message-ID: <20191210201845.GA24756@ravnborg.org> (raw)
In-Reply-To: <1575984287-26787-3-git-send-email-claudiu.beznea@microchip.com>
Hi Claudiu.
On Tue, Dec 10, 2019 at 03:24:44PM +0200, Claudiu Beznea wrote:
> Changing pixel clock source without having this clock source enabled
> will block the timing engine and the next operations after (in this case
> setting ATMEL_HLCDC_CFG(5) settings in atmel_hlcdc_crtc_mode_set_nofb()
> will fail). It is recomended (although in datasheet this is not present)
> to actually enabled pixel clock source before doing any changes on timing
> enginge (only SAM9X60 datasheet specifies that the peripheral clock and
> pixel clock must be enabled before using LCD controller).
>
> Fixes: 1a396789f65a ("drm: add Atmel HLCDC Display Controller support")
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
We already had a remotely similar fix.
See 262d67e73f9a920a20bd75278761400404a82de0
("drm: atmel-hlcdc: enable sys_clk during initalization.")
In this patch sys_clk is only enabled if we have a fixed_clk.
Maybe we should do this unconditionally in
atmel_hlcdc_dc_load()?
Then we do not need this enable(disable in the mode_set_nofb
implementation.
Have you considered this way to fix it?
Sam
> ---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index 5040ed8d0871..721fa88bf71d 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -73,7 +73,11 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c)
> unsigned long prate;
> unsigned int mask = ATMEL_HLCDC_CLKDIV_MASK | ATMEL_HLCDC_CLKPOL;
> unsigned int cfg = 0;
> - int div;
> + int div, ret;
> +
> + ret = clk_prepare_enable(crtc->dc->hlcdc->sys_clk);
> + if (ret)
> + return;
>
> vm.vfront_porch = adj->crtc_vsync_start - adj->crtc_vdisplay;
> vm.vback_porch = adj->crtc_vtotal - adj->crtc_vsync_end;
> @@ -147,6 +151,8 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c)
> ATMEL_HLCDC_VSPSU | ATMEL_HLCDC_VSPHO |
> ATMEL_HLCDC_GUARDTIME_MASK | ATMEL_HLCDC_MODE_MASK,
> cfg);
> +
> + clk_disable_unprepare(crtc->dc->hlcdc->sys_clk);
> }
>
> static enum drm_mode_status
> --
> 2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-12-10 20:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 13:24 [PATCH 0/5] fixes for atmel-hlcdc Claudiu Beznea
2019-12-10 13:24 ` [PATCH 1/5] drm: atmel-hlcdc: use double rate for pixel clock only if supported Claudiu Beznea
2019-12-10 13:24 ` [PATCH 2/5] drm: atmel-hlcdc: enable clock before configuring timing engine Claudiu Beznea
2019-12-10 20:18 ` Sam Ravnborg [this message]
2019-12-10 13:24 ` [PATCH 3/5] mfd: atmel-hlcdc: return in case of error Claudiu Beznea
2019-12-10 20:37 ` Sam Ravnborg
2019-12-11 12:07 ` Claudiu.Beznea
2019-12-10 13:24 ` [PATCH 4/5] Revert "drm/atmel-hlcdc: allow selecting a higher pixel-clock than requested" Claudiu Beznea
2019-12-10 14:11 ` Peter Rosin
2019-12-10 14:59 ` Claudiu.Beznea
2019-12-10 17:22 ` Peter Rosin
2019-12-11 11:45 ` Claudiu.Beznea
2019-12-11 13:28 ` Peter Rosin
2019-12-13 9:28 ` Claudiu.Beznea
2019-12-13 9:30 ` Peter Rosin
2019-12-10 13:24 ` [PATCH 5/5] Revert "drm: atmel-hlcdc: enable sys_clk during initalization." Claudiu Beznea
2019-12-10 20:34 ` Sam Ravnborg
2019-12-11 11:55 ` Claudiu.Beznea
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=20191210201845.GA24756@ravnborg.org \
--to=sam@ravnborg.org \
--cc=airlied@linux.ie \
--cc=alexandre.belloni@bootlin.com \
--cc=bbrezillon@kernel.org \
--cc=claudiu.beznea@microchip.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
/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).