From patchwork Mon Oct 13 16:44:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 5076971 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AB1A49F295 for ; Mon, 13 Oct 2014 16:48:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDCC3201B9 for ; Mon, 13 Oct 2014 16:48:55 +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 A776920176 for ; Mon, 13 Oct 2014 16:48:54 +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 1XdilP-00076r-S9; Mon, 13 Oct 2014 16:46:27 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XdilN-00073B-Nu for linux-arm-kernel@lists.infradead.org; Mon, 13 Oct 2014 16:46:26 +0000 Received: by mail-wi0-f171.google.com with SMTP id em10so7913284wid.10 for ; Mon, 13 Oct 2014 09:46:01 -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=/Cs9TAuUVPVR7FI62LmXOCWzyfSxRGXY88dA2HCIxk4=; b=Tm0ZrvyvgK4UZ9QIRCTUfphvH+f7/qy4p+IfjcTXCAXEDJ66i6nxz/Z+YollvVETGE RqvhR4kZZQwvhUD/+ugoYTF7cy0A/OU/+mlpuB8/Z9Wb0aA0SMCFjUnDlcz2r13JPkpe PRIFJdlEwNjX/NviQ148EMjCbcxKprcDPp/u42qUKC2wEcyg1ZhPIuvL1l3Coq914GMh wtEqyfTH2h1ovxUwde+SSwmKNHkVzPAVB3mBRWnCLBpN+xTsn71Zyagh5ltAYGSKKImY xCmyGPpJ2L9nUu9uYPT8nniZ6hjtB66tQkR/fSiHIADyoUXA75NpqxW7HF7KW1n5iZb5 jAYA== X-Gm-Message-State: ALoCoQmV21c8Ho6MSqZ1loT7PE/7d6TQnNCuvTUGVYxRlsFKzmLNhCXDqGLnXRtZXCbglW5noNPn X-Received: by 10.194.58.229 with SMTP id u5mr2985158wjq.133.1413218761594; Mon, 13 Oct 2014 09:46:01 -0700 (PDT) Received: from arch.hh.imgtec.org ([190.2.108.156]) by mx.google.com with ESMTPSA id cs2sm12775181wib.2.2014.10.13.09.45.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Oct 2014 09:46:00 -0700 (PDT) From: Ezequiel Garcia To: Russell King , Eric Miao , "Rafael J. Wysocki" , Wolfram Sang , James Hogan Subject: [RFC/PATCH] i2c: pxa: Use suspend() and resume() instead of the _noirq hooks Date: Mon, 13 Oct 2014 13:44:23 -0300 Message-Id: <1413218663-2847-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-20141013_094625_988122_387E5615 X-CRM114-Status: GOOD ( 12.81 ) X-Spam-Score: -0.7 (/) Cc: 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 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: 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 get 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 --- 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)