From patchwork Thu Feb 26 13:57:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Grygorii.Strashko@linaro.org" X-Patchwork-Id: 5893071 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5BF599F373 for ; Thu, 26 Feb 2015 13:57:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E17E8203A5 for ; Thu, 26 Feb 2015 13:57:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5B6420398 for ; Thu, 26 Feb 2015 13:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753864AbbBZN5X (ORCPT ); Thu, 26 Feb 2015 08:57:23 -0500 Received: from mail-lb0-f177.google.com ([209.85.217.177]:45400 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751216AbbBZN5W (ORCPT ); Thu, 26 Feb 2015 08:57:22 -0500 Received: by lbjb6 with SMTP id b6so10882185lbj.12 for ; Thu, 26 Feb 2015 05:57:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Ko8lvB061eEkfl6cERG7BzX3cjRYTXY/oc9OqA3n30Y=; b=RtMY9OGv1M80n04eZ8kSKEdxeCSY6WisL8ER/hXyNuZG0+jwkAfXBPQhvnARWBB6Ru 91n9fEKGtuK73mWpeG+T8CJpPBia2ixB16MN1Xo+NjD4/NEwYY2Td+G2ki8hkUQ84ioK VhqGcuMKtxbgNaLQKpkD3l9bU8pn3foI2lC0Z6oyLma8icR8SWOVZ2f2v+eYgHKJzPi7 3dJD73S3EoembyuYzzf6I0y40WS029ui4w+OdP9CH7Xmcd8AnUtJKs72VIc9aKrMJ89K MIHXGXIuexE4W/fqf5OkU5laNoDqd5GFPSZEBtf3WzmBAyl82Gur0CWeavbXHsPyZVOs pZjA== X-Gm-Message-State: ALoCoQkT70nqnlijLr3NWCDvQJul04zCbLK6PyilABwKN+51+6Nwi6vbU1zyYOAkArsQBLmW23Gv X-Received: by 10.112.13.38 with SMTP id e6mr7681603lbc.31.1424959041096; Thu, 26 Feb 2015 05:57:21 -0800 (PST) Received: from [172.22.39.17] ([195.238.92.128]) by mx.google.com with ESMTPSA id ba1sm207035lab.34.2015.02.26.05.57.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 05:57:20 -0800 (PST) From: "Grygorii.Strashko@linaro.org" X-Google-Original-From: "Grygorii.Strashko@linaro.org" Message-ID: <54EF263D.5050904@linaro.org> Date: Thu, 26 Feb 2015 15:57:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Tomi Valkeinen , Laurent Pinchart , dri-devel@lists.freedesktop.org CC: linux-omap@vger.kernel.org, Rob Clark Subject: Re: [PATCH 14/21] drm/omap: stop connector polling during suspend References: <1424956829-22892-1-git-send-email-tomi.valkeinen@ti.com> <1424956829-22892-15-git-send-email-tomi.valkeinen@ti.com> In-Reply-To: <1424956829-22892-15-git-send-email-tomi.valkeinen@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 > --- > 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 -- 1.9.1 === 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 --- 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,