From: "Grygorii.Strashko@linaro.org" <grygorii.strashko@linaro.org>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
dri-devel@lists.freedesktop.org
Cc: linux-omap@vger.kernel.org, Rob Clark <robdclark@gmail.com>
Subject: Re: [PATCH 14/21] drm/omap: stop connector polling during suspend
Date: Thu, 26 Feb 2015 15:57:17 +0200 [thread overview]
Message-ID: <54EF263D.5050904@linaro.org> (raw)
In-Reply-To: <1424956829-22892-15-git-send-email-tomi.valkeinen@ti.com>
Hi Tomi,
On 02/26/2015 03:20 PM, Tomi Valkeinen wrote:
> When not using proper hotplug detection, DRM polls periodically the
> connectors to find out if a cable is connected. This polling can happen
> at any time, even very late in the suspend process.
>
> This causes a problem with omapdrm, when the poll happens during the
> suspend process after GPIOs have been disabled, leading to a crash in
> gpio_get().
>
> This patch fixes the issue by adding suspend and resume hooks to
> omapdrm, in which we disable and enable, respectively, the polling.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> drivers/gpu/drm/omapdrm/omap_drv.c | 21 ++++++++++++++++++++-
> 1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 0ebd1315fff8..d0b1aece8cc5 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -694,9 +694,28 @@ static int pdev_remove(struct platform_device *device)
> return 0;
> }
>
> +static int omap_drm_suspend(struct device *dev)
> +{
> + struct drm_device *drm_dev = dev_get_drvdata(dev);
> +
> + drm_kms_helper_poll_disable(drm_dev);
> +
> + return 0;
> +}
> +
> +static int omap_drm_resume(struct device *dev)
> +{
> + struct drm_device *drm_dev = dev_get_drvdata(dev);
> +
> + drm_kms_helper_poll_enable(drm_dev);
> +
> + return omap_gem_resume(dev);
> +}
> +
> #ifdef CONFIG_PM
> static const struct dev_pm_ops omapdrm_pm_ops = {
> - .resume = omap_gem_resume,
> + .suspend = omap_drm_suspend,
> + .resume = omap_drm_resume,
> };
> #endif
>
>
Could I ask you to update this patch as below, pls?
Regards,
-grygorii
===
drm/omap: add hibernation callbacks
Setting a dev_pm_ops suspend/resume pair but not a set of
hibernation functions means those pm functions will not be
called upon hibernation.
Fix this by using SET_SYSTEM_SLEEP_PM_OPS, which appropriately
assigns the suspend and hibernation handlers and move
omap_drm_suspend/omap_drm_resume under CONFIG_PM_SLEEP
to avoid build warnings.
Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
---
drivers/gpu/drm/omapdrm/omap_drv.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 7cb1c8f..4a544e4 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -715,6 +715,7 @@ static int pdev_remove(struct platform_device *device)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
static int omap_drm_suspend(struct device *dev)
{
struct drm_device *drm_dev = dev_get_drvdata(dev);
@@ -732,21 +733,15 @@ static int omap_drm_resume(struct device *dev)
return omap_gem_resume(dev);
}
-
-#ifdef CONFIG_PM
-static const struct dev_pm_ops omapdrm_pm_ops = {
- .suspend = omap_drm_suspend,
- .resume = omap_drm_resume,
-};
#endif
+static SIMPLE_DEV_PM_OPS(omapdrm_pm_ops, omap_drm_suspend, omap_drm_resume);
+
static struct platform_driver pdev = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
-#ifdef CONFIG_PM
.pm = &omapdrm_pm_ops,
-#endif
},
.probe = pdev_probe,
.remove = pdev_remove,
-- 1.9.1
--
regards,
-grygorii
next prev parent reply other threads:[~2015-02-26 13:57 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 13:20 [PATCH 00/21] drm/omap: misc fixes/improvements Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 01/21] drm/omap: fix encoder-crtc mapping Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 02/21] drm/omap: page_flip: return -EBUSY if flip pending Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 03/21] drm/omap: clear omap_obj->paddr in omap_gem_put_paddr() Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 04/21] drm/omap: add pin refcounting to omap_framebuffer Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 05/21] drm/omap: add a comment why locking is missing Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 06/21] drm/omap: check CRTC color format earlier Tomi Valkeinen
2015-02-27 12:07 ` Daniel Vetter
2015-03-02 9:55 ` Tomi Valkeinen
2015-03-04 23:41 ` Laurent Pinchart
2015-03-04 23:53 ` Laurent Pinchart
2015-02-26 13:20 ` [PATCH 07/21] drm/omap: fix operation without fbdev Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 08/21] drm/omap: fix error handling in omap_framebuffer_create() Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 09/21] drm/omap: handle mismatching color format and buffer width Tomi Valkeinen
2015-02-27 13:01 ` Daniel Vetter
2015-02-27 14:40 ` Daniel Stone
2015-02-27 15:47 ` Daniel Vetter
2015-03-02 9:50 ` Tomi Valkeinen
2015-03-02 10:22 ` Daniel Stone
2015-03-02 10:32 ` Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 10/21] drm/omap: fix TILER on OMAP5 Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 11/21] drm/omap: fix plane's channel selection Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 12/21] drm/omap: tiler: fix race condition with engine->async Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 13/21] drm/omap: remove dummy PM functions Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 14/21] drm/omap: stop connector polling during suspend Tomi Valkeinen
2015-02-26 13:57 ` Grygorii.Strashko@linaro.org [this message]
2015-03-02 11:03 ` Tomi Valkeinen
2015-03-02 18:35 ` Grygorii Strashko
2015-02-26 13:20 ` [PATCH 15/21] drm/omap: use DRM_ERROR_RATELIMITED() for error irqs Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 16/21] drm/omap: fix race with error_irq Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 17/21] drm/omap: only ignore DIGIT SYNC LOST for TV output Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 18/21] drm/omap: do not use BUG_ON(!spin_is_locked(x)) Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 19/21] drm/omap: fix race condition with dev->obj_list Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 20/21] drm/omap: fix race conditon in DMM Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 21/21] drm/omap: keep ref to old_fb Tomi Valkeinen
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=54EF263D.5050904@linaro.org \
--to=grygorii.strashko@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-omap@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=tomi.valkeinen@ti.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).