From patchwork Mon Oct 20 18:23:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 5106991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64A60C11AC for ; Mon, 20 Oct 2014 18:28:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92894200E8 for ; Mon, 20 Oct 2014 18:28:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8158A200E0 for ; Mon, 20 Oct 2014 18:28:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XgHeR-0007yV-VK; Mon, 20 Oct 2014 18:25:51 +0000 Received: from mail-wi0-f176.google.com ([209.85.212.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XgHeO-0007wC-Um for linux-arm-kernel@lists.infradead.org; Mon, 20 Oct 2014 18:25:50 +0000 Received: by mail-wi0-f176.google.com with SMTP id hi2so7950971wib.3 for ; Mon, 20 Oct 2014 11:25:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EyiYizitcm2bOrfCF1qJHQcQTvWjk5FoOlVndi+yXN0=; b=M2ba+N1Bbsam6r5rlBqBjAMlKhGwLjiMm8BDQa5mLj48IdsqpolToDVwpcYl9MZAGS YGd73qB6pbHII4e53GUv4Div7DXb9ZT46nLNy2wGqk891bRB9WJkzN7wgFdUCqcHOBvN kA9KzEHRFBMOIQvQdqBRbH0iAFS6onRU3itVsFKL+R10njphfLHsTBr+xCEFi/zyxm8l OVtFDnk6bu/IacjnWj/IS+n+IVs9KjC5hwWRMP9QwZebG6Qkqovh8xzxJxkwxPi5kPcL 7nJVfosX8Jxm/rpMLRYLexy7+qZhlfG16nsvF/HXC9qulhvm+JCD/i9L9xUS5/hhFdLJ WI4w== X-Gm-Message-State: ALoCoQmAb7vKYToz06D0D2ClHSUAgHzkLebW7YJ8W34qMQ+coVMFuNDaCoh+1R0+3lDNFrc3X4Ac X-Received: by 10.180.36.48 with SMTP id n16mr22986249wij.6.1413829525780; Mon, 20 Oct 2014 11:25:25 -0700 (PDT) Received: from arch.hh.imgtec.org ([190.2.108.156]) by mx.google.com with ESMTPSA id lm9sm12713083wjc.45.2014.10.20.11.25.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Oct 2014 11:25:24 -0700 (PDT) From: Ezequiel Garcia To: Russell King , Eric Miao , "Rafael J. Wysocki" , Wolfram Sang Subject: [RESEND/PATCH] i2c: pxa: Use suspend() and resume() instead of the _noirq hooks Date: Mon, 20 Oct 2014 15:23:52 -0300 Message-Id: <1413829432-7815-1-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141020_112549_175174_05942C92 X-CRM114-Status: GOOD ( 13.15 ) X-Spam-Score: -0.7 (/) Cc: James Hogan , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ezequiel Garcia X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 The _noirq were previously chosen to make sure all the users of the adapter were suspended by the time the adapter itself enters the suspended state. The {suspend,resume}_noirq usage was converted from an earlier implementation based on suspend_late and resume_early on this commit: commit 57f4d4f1b72983f8c76e2f232e064730aeffe599 Author: Magnus Damm Date: Wed Jul 8 13:22:39 2009 +0200 I2C: Rework i2c-pxa suspend_late()/resume_early() However, all the I2C devices are probed as children of its I2C adapter, and hence the device model guarantees they are suspended before its parent, and resumed after it. In other words, there's no need to use the _noirq hooks to get a suspend/resume device/adapter order. This commit changes this by using the suspend/resume PM hooks in the I2C adapter. Signed-off-by: Ezequiel Garcia --- Tested on a PXA CM-X300 board with a vendor-provided patch to make suspend/resume work properly. Now that the merge window is closed, I'm resending this rebased on v3.18-rc1. drivers/i2c/busses/i2c-pxa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index be671f7..3be19b36 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -1292,7 +1292,7 @@ static int i2c_pxa_remove(struct platform_device *dev) } #ifdef CONFIG_PM -static int i2c_pxa_suspend_noirq(struct device *dev) +static int i2c_pxa_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct pxa_i2c *i2c = platform_get_drvdata(pdev); @@ -1302,7 +1302,7 @@ static int i2c_pxa_suspend_noirq(struct device *dev) return 0; } -static int i2c_pxa_resume_noirq(struct device *dev) +static int i2c_pxa_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct pxa_i2c *i2c = platform_get_drvdata(pdev); @@ -1314,8 +1314,8 @@ static int i2c_pxa_resume_noirq(struct device *dev) } static const struct dev_pm_ops i2c_pxa_dev_pm_ops = { - .suspend_noirq = i2c_pxa_suspend_noirq, - .resume_noirq = i2c_pxa_resume_noirq, + .suspend = i2c_pxa_suspend, + .resume = i2c_pxa_resume, }; #define I2C_PXA_DEV_PM_OPS (&i2c_pxa_dev_pm_ops)