From: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Tomeu Vizoso
<tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: "Thierry Reding"
<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Terje Bergström"
<tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
"David Airlie" <airlied-cv59FeDIM0c@public.gmane.org>,
"Stephen Warren"
<swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
"Alexandre Courbot"
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] drm/tegra: Reset the SOR during initialization
Date: Thu, 26 Mar 2015 12:24:25 +0300 [thread overview]
Message-ID: <5513D049.4080700@gmail.com> (raw)
In-Reply-To: <1427273979-394-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
25.03.2015 11:59, Tomeu Vizoso пишет:
> As there isn't a way for the firmware on the Nyan chromebooks to hand
> over the display to the kernel, and the kernel isn't redoing the whole
> configuration at present.
>
> With this patch, the SOR is brought to a known state and we get correct
> display on every boot.
>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
>
> ---
>
> v7: * Move the reset to the host1x_client_ops.init callback as
> suggested by Thierry
> * Reduced the time during which the reset line is asserted from
> 20ms to 2ms
> ---
> drivers/gpu/drm/tegra/sor.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
> index 2afe478..027a25d22 100644
> --- a/drivers/gpu/drm/tegra/sor.c
> +++ b/drivers/gpu/drm/tegra/sor.c
> @@ -1354,12 +1354,30 @@ static int tegra_sor_init(struct host1x_client *client)
> }
> }
>
> + /*
> + * XXX: Remove this reset once proper hand-over from firmware to
> + * kernel is possible.
> + */
> + err = reset_control_assert(sor->rst);
> + if (err < 0) {
> + dev_err(sor->dev, "failed to assert SOR reset: %d\n", err);
> + return err;
> + }
> +
> err = clk_prepare_enable(sor->clk);
> if (err < 0) {
> dev_err(sor->dev, "failed to enable clock: %d\n", err);
> return err;
> }
>
> + msleep(2);
> +
> + err = reset_control_deassert(sor->rst);
> + if (err < 0) {
> + dev_err(sor->dev, "failed to deassert SOR reset: %d\n", err);
> + return err;
> + }
> +
> err = clk_prepare_enable(sor->clk_safe);
> if (err < 0)
> return err;
>
According to kernel doc, you should use usleep_range() instead of msleep().
https://www.kernel.org/doc/Documentation/timers/timers-howto.txt
--
Dmitry
WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Osipenko <digetx@gmail.com>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>, linux-tegra@vger.kernel.org
Cc: "Thierry Reding" <thierry.reding@gmail.com>,
"Terje Bergström" <tbergstrom@nvidia.com>,
"David Airlie" <airlied@linux.ie>,
"Stephen Warren" <swarren@wwwdotorg.org>,
"Alexandre Courbot" <gnurou@gmail.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/tegra: Reset the SOR during initialization
Date: Thu, 26 Mar 2015 12:24:25 +0300 [thread overview]
Message-ID: <5513D049.4080700@gmail.com> (raw)
In-Reply-To: <1427273979-394-1-git-send-email-tomeu.vizoso@collabora.com>
25.03.2015 11:59, Tomeu Vizoso пишет:
> As there isn't a way for the firmware on the Nyan chromebooks to hand
> over the display to the kernel, and the kernel isn't redoing the whole
> configuration at present.
>
> With this patch, the SOR is brought to a known state and we get correct
> display on every boot.
>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>
> ---
>
> v7: * Move the reset to the host1x_client_ops.init callback as
> suggested by Thierry
> * Reduced the time during which the reset line is asserted from
> 20ms to 2ms
> ---
> drivers/gpu/drm/tegra/sor.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
> index 2afe478..027a25d22 100644
> --- a/drivers/gpu/drm/tegra/sor.c
> +++ b/drivers/gpu/drm/tegra/sor.c
> @@ -1354,12 +1354,30 @@ static int tegra_sor_init(struct host1x_client *client)
> }
> }
>
> + /*
> + * XXX: Remove this reset once proper hand-over from firmware to
> + * kernel is possible.
> + */
> + err = reset_control_assert(sor->rst);
> + if (err < 0) {
> + dev_err(sor->dev, "failed to assert SOR reset: %d\n", err);
> + return err;
> + }
> +
> err = clk_prepare_enable(sor->clk);
> if (err < 0) {
> dev_err(sor->dev, "failed to enable clock: %d\n", err);
> return err;
> }
>
> + msleep(2);
> +
> + err = reset_control_deassert(sor->rst);
> + if (err < 0) {
> + dev_err(sor->dev, "failed to deassert SOR reset: %d\n", err);
> + return err;
> + }
> +
> err = clk_prepare_enable(sor->clk_safe);
> if (err < 0)
> return err;
>
According to kernel doc, you should use usleep_range() instead of msleep().
https://www.kernel.org/doc/Documentation/timers/timers-howto.txt
--
Dmitry
next prev parent reply other threads:[~2015-03-26 9:24 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 9:52 [PATCH v6 00/12] Improvements to Tegra-based Chromebook support Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` [PATCH v6 01/12] ARM: tegra: Change model of sound card in Nyan Big Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` [PATCH v6 02/12] ARM: tegra: Move out nyan-generic parts out from the nyan-big DT Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` [PATCH v6 03/12] drm/panel: add support for Samsung LTN140AT29 panel Tomeu Vizoso
2015-03-24 10:27 ` Thierry Reding
2015-03-18 9:52 ` [PATCH v6 04/12] ARM: tegra: Add DTS for the nyan-blaze board Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` [PATCH v6 05/12] ARM: tegra: Add node for trackpad in Nyan boards Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` [PATCH v6 06/12] ARM: tegra: Use pwrseq-simple for the wifi in Nyan Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
[not found] ` <1426672363-30667-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-03-18 9:52 ` [PATCH v6 07/12] ARM: tegra: Use the generated pinmux data Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` [PATCH v6 08/12] ARM: tegra: Set spi-max-frequency property to flash node Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` [PATCH v6 09/12] drm/tegra: Reset the SOR on probe Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
[not found] ` <1426672363-30667-10-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-03-24 10:24 ` Thierry Reding
2015-03-24 10:24 ` Thierry Reding
[not found] ` <20150324102447.GA18115-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-03-25 8:59 ` [PATCH] drm/tegra: Reset the SOR during initialization Tomeu Vizoso
2015-03-25 8:59 ` Tomeu Vizoso
[not found] ` <1427273979-394-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-03-26 9:24 ` Dmitry Osipenko [this message]
2015-03-26 9:24 ` Dmitry Osipenko
2015-03-24 10:28 ` [PATCH v6 00/12] Improvements to Tegra-based Chromebook support Thierry Reding
2015-03-24 10:28 ` Thierry Reding
2015-03-24 10:28 ` Thierry Reding
2015-03-18 9:52 ` [PATCH v6 10/12] soc/tegra: pmc: move to using a restart handler Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-24 10:26 ` Thierry Reding
2015-03-24 10:26 ` Thierry Reding
2015-03-18 9:52 ` [PATCH v6 11/12] ARM: tegra: Add gpio-restart node Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` [PATCH v6 12/12] ARM: tegra: The WiFi card is kept powered during suspend Tomeu Vizoso
2015-03-18 9:52 ` Tomeu Vizoso
2015-03-18 9:52 ` [PATCH v6 13/13] HACK: Hide RPMB partitions Tomeu Vizoso
[not found] ` <1426672363-30667-14-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-03-18 9:55 ` Tomeu Vizoso
2015-03-18 9:55 ` Tomeu Vizoso
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=5513D049.4080700@gmail.com \
--to=digetx-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.