From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Arto Merilainen <amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
mkulkarni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCHv3 2/4] drm/tegra: Add runtime pm support for gr2d
Date: Tue, 01 Oct 2013 12:14:08 -0600 [thread overview]
Message-ID: <524B10F0.7000301@wwwdotorg.org> (raw)
In-Reply-To: <1380024325-18280-3-git-send-email-amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
On 09/24/2013 06:05 AM, Arto Merilainen wrote:
> From: Mayuresh Kulkarni <mkulkarni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> This far we have enabled gr2d clock on device probe and disabled
> it on device deinitialisation. This patch adds runtime pm support
> for the hardware unit allowing dynamic power management. If pm
> runtime is not enabled, gr2d clock is enabled in device probe and
> diff --git a/drivers/gpu/host1x/drm/gr2d.c b/drivers/gpu/host1x/drm/gr2d.c
> @@ -327,11 +336,48 @@ static int __exit gr2d_remove(struct platform_device *pdev)
> host1x_syncpt_free(gr2d->client.syncpts[i]);
>
> host1x_channel_free(gr2d->channel);
> +
> + if (pm_runtime_enabled(&pdev->dev))
> + pm_runtime_disable(&pdev->dev);
> + else
> + gr2d_runtime_suspend(&pdev->dev);
This code is slightly different to the code in e.g.
sound/soc/tegra/tegra20_i2s.c:remove(), whereas the code in probe() is
identical. I'm not sure whether there's some advantage in this version?
If so, perhaps the sound drivers should be updated to be consistent. If
not, perhaps this driver should do the same thing as the I2S driver, so
we keep the drivers consistent, and provide the same "example" code
everywhere.
> +static int gr2d_runtime_suspend(struct device *dev)
> +{
> + struct gr2d *gr2d;
> +
> + gr2d = dev_get_drvdata(dev);
> + if (!gr2d)
> + return -EINVAL;
Presumably, gr2d will never be NULL here, unless there's some chronic
bug. Can't we re-write those last 5 lines as simply:
struct gr2d *grd2 = dev_get_drvdata(dev);
If that's not valid, we should probably update the audio drivers (and
perhaps others) too.
next prev parent reply other threads:[~2013-10-01 18:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-24 12:05 [PATCHv3 0/4] gpu: host1x: Add runtime pm support Arto Merilainen
[not found] ` <1380024325-18280-1-git-send-email-amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-09-24 12:05 ` [PATCHv3 1/4] gpu: host1x: shuffle job APIs Arto Merilainen
2013-09-24 12:05 ` [PATCHv3 2/4] drm/tegra: Add runtime pm support for gr2d Arto Merilainen
[not found] ` <1380024325-18280-3-git-send-email-amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-10-01 18:14 ` Stephen Warren [this message]
[not found] ` <524B10F0.7000301-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-10-02 5:40 ` Arto Merilainen
2013-09-24 12:05 ` [PATCHv3 3/4] drm/tegra: Add runtime pm support for dc Arto Merilainen
2013-09-24 12:05 ` [PATCHv3 4/4] gpu: host1x: Add runtime pm support for host1x Arto Merilainen
[not found] ` <1380024325-18280-5-git-send-email-amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-10-01 18:17 ` Stephen Warren
[not found] ` <524B11AA.30400-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-10-02 5:40 ` Arto Merilainen
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=524B10F0.7000301@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mkulkarni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=treding-DDmLM1+adcrQT0dZR+AlfA@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 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).