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: 45179 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9C5D320674 for ; Thu, 26 Feb 2015 13:57:27 +0000 (UTC) Received: by labgm9 with SMTP id gm9sf8299841lab.2 for ; Thu, 26 Feb 2015 05:57:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:message-id:date:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=6WFgxrRJehV3OkF8HtyjSM5A2BayV4SmrpCJf4FB/+o=; b=Nqo5Kd/DBsv34lxnxhNEJTYloDqNN2nYjkpsybvcacMu2HwnlG5HQKRnjPOOGsgAbL niNh/jtPfRkj41vdIHmefqLfeESb7bnQbzKIfowzw9qLhzkQFtft5q7ZkoP0TgP4MIFx ncea/uv7ne05zx3SABycn/7jgVcSabssFM+gcNKH/kZcEG4mgEZZVYHzgTl0UjnefjBz jN35HvvLkCucpTiV0VnzFwCTikjwK3g3EBMj0N+XoDESRC4lDAYWenRRU3rnCaFvXB26 0SIMx+HGrEShi5srneWx89nysvGj3+Y7JysErWIIAhiHjkipS3ZLCDgGCuRkjBunHuvN VjMw== X-Gm-Message-State: ALoCoQkW1j/lICets09PS/YViC6EYemGef1PWepuz96NjmMG1Ns0MwUgxvveQhsT2wVZxoBl1gbd X-Received: by 10.194.142.174 with SMTP id rx14mr1318902wjb.4.1424959046611; Thu, 26 Feb 2015 05:57:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.165 with SMTP id g5ls30689lae.68.gmail; Thu, 26 Feb 2015 05:57:26 -0800 (PST) X-Received: by 10.112.166.170 with SMTP id zh10mr7708121lbb.62.1424959046450; Thu, 26 Feb 2015 05:57:26 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id yr7si701621lbb.26.2015.02.26.05.57.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 05:57:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbiw7 with SMTP id w7so10901659lbi.10 for ; Thu, 26 Feb 2015 05:57:26 -0800 (PST) X-Received: by 10.152.203.194 with SMTP id ks2mr7659653lac.88.1424959046357; Thu, 26 Feb 2015 05:57:26 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp3314871lbj; Thu, 26 Feb 2015 05:57:25 -0800 (PST) X-Received: by 10.68.69.109 with SMTP id d13mr14899754pbu.152.1424959044732; Thu, 26 Feb 2015 05:57:24 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qg3si1217884pbb.112.2015.02.26.05.57.23; Thu, 26 Feb 2015 05:57:24 -0800 (PST) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753864AbbBZN5X (ORCPT + 5 others); 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-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" 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: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grygorii.strashko@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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,