From patchwork Mon May 23 12:59:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 68374 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp69667qge; Mon, 23 May 2016 05:59:30 -0700 (PDT) X-Received: by 10.66.1.99 with SMTP id 3mr26428831pal.26.1464008370099; Mon, 23 May 2016 05:59:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id or6si16243648pac.233.2016.05.23.05.59.29; Mon, 23 May 2016 05:59:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753539AbcEWM72 (ORCPT + 1 other); Mon, 23 May 2016 08:59:28 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:33789 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753412AbcEWM72 (ORCPT ); Mon, 23 May 2016 08:59:28 -0400 Received: by mail-lb0-f171.google.com with SMTP id k7so34303086lbm.0 for ; Mon, 23 May 2016 05:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=7ORwo5wsOZDUS/ulE/ecAFX1QhNtD3TOT5ukzFxdRHQ=; b=dmqP5/dAV2UmbVHks+XpmJ2ReZ8Iy2qST0pbMj1KY5FNg++ozq426pdNt4BGBFzWNl bddPLYApnWNgvpq4zc4yFv3a3Z9xdFUdJr0C3/I93WmTc2nTMFBhDWatM8o6EZ8fwaKr aW8UlztjAvfsSK/b2g+9PlEMfbQnG6JbzG9Is= 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=7ORwo5wsOZDUS/ulE/ecAFX1QhNtD3TOT5ukzFxdRHQ=; b=huVryJj3D3XmLktZ0voFBrN7uh7wCYAiNslDM+dJr/16ftGiHATAVGZgLKKA5nc5Qo DyZXXDtYkXTk9oBl5VLTDLIRlh+5UrrAhxP+A8e37URR6xEKhwt0EzMjQwcB80dIBhsN yg91DZ77NXVhz4DQnl6aeator7ppmI95OnwRitOnZ0x91Y9VIVCHN7aI8ZOBWDg4a9wa UWW77svPAcEJE6ko2CMLMj3brrlc8a81BSyBB6AvzpNGYJ01W7xVRMp8F2gVWcceu+A1 qH6yKKGYJB0Pxxp4J1mMJGAQs4zEgW2gzpMZwCSu4d2mOhNmURd5AolngcdrWz0JEWAS XQVg== X-Gm-Message-State: ALyK8tI+imtPfg5aTjXCX/zeyWw5FgwKx+v6xxPSap2WMpBoJxVi/KJH5nUugVB3DJnOvOFU X-Received: by 10.112.150.98 with SMTP id uh2mr3790246lbb.21.1464008363921; Mon, 23 May 2016 05:59:23 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id h18sm3614035lbb.8.2016.05.23.05.59.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 May 2016 05:59:21 -0700 (PDT) From: Linus Walleij To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: Linus Walleij , Ulf Hansson Subject: [PATCH] i2c: nomadik: move runtime suspend of hw to _noirq Date: Mon, 23 May 2016 14:59:16 +0200 Message-Id: <1464008356-21162-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.11 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org The runtime suspend of the hardware (declocking and pin control resting) needs to happen in the *_noirq callbacks after all hardware interrupts are disabled and we know there will be no more I2C traffic in the system. Cc: Ulf Hansson Signed-off-by: Linus Walleij --- drivers/i2c/busses/i2c-nomadik.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.4.11 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index bcd17e8cbcb4..c96a3e331bed 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -877,7 +877,7 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg) } #ifdef CONFIG_PM_SLEEP -static int nmk_i2c_suspend_late(struct device *dev) +static int nmk_i2c_suspend_noirq(struct device *dev) { int ret; @@ -889,7 +889,7 @@ static int nmk_i2c_suspend_late(struct device *dev) return 0; } -static int nmk_i2c_resume_early(struct device *dev) +static int nmk_i2c_resume_noirq(struct device *dev) { return pm_runtime_force_resume(dev); } @@ -931,7 +931,8 @@ static int nmk_i2c_runtime_resume(struct device *dev) #endif static const struct dev_pm_ops nmk_i2c_pm = { - SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early) + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_noirq, + nmk_i2c_resume_noirq) SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend, nmk_i2c_runtime_resume, NULL)