From patchwork Wed Aug 23 14:42:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 9917561 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AEB63603FF for ; Wed, 23 Aug 2017 14:55:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A074C28984 for ; Wed, 23 Aug 2017 14:55:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94DF028987; Wed, 23 Aug 2017 14:55:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C8B85289A9 for ; Wed, 23 Aug 2017 14:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=3JZgg0u36WpO7X4FBctChW1SZN2QOgkSqCtMGcHyPxY=; b=BHK3Zdp6k8KE5I/4vxpAjmE8MS Ez753kBYxR4AnKyF3Jf2VdR950ShKMVCil9+w4Gx2NSua8BhM1m6yreJMf6cLr4JRHVUXfeLbUweJ LdxopqIMTd2ODau37UUY0EqRlAFY1jiseJro3vjWBAkAUguQGZPLam4kU9hRppff3oj1Y47LhWzR2 OhR4Ca6tC4Y7wVXiyShDPa0kmdZf06x3bw3uRxhGk7rO467ywOVvLKcqRysLWOLkiv6FfTN3RAQty ItBp6B/WYFaUuSFJUgqhBI7YjSjS5mj4mnJFQMOdfLzNME4FxyLWHjvnhH5dnoQUbdZHifsDUNBUu nOq1/HMw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dkX3j-0002Wp-8O; Wed, 23 Aug 2017 14:55:07 +0000 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkWrq-0001fG-Dl for linux-arm-kernel@lists.infradead.org; Wed, 23 Aug 2017 14:43:04 +0000 Received: by mail-lf0-x230.google.com with SMTP id d17so1566271lfe.0 for ; Wed, 23 Aug 2017 07:42:29 -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:in-reply-to:references; bh=OVyzB8N1P8QR0uR6qN7uOx0wtf9amaEOf3rrA1CA1zw=; b=D3pti5MjCzB25Uw4O9Du55Nck4nkOulWaFXDLmfaPXTfZj0A6TVUr10zmj6CL71p3K 3KM62TE2zpTJSmvVOjeJ9Q+P2vf6evsC6I16+Ea+GsQW6i4ena5Yfzlbb+LPlP+Un9nZ IiXwkawXlvXGYgroLOnTlcbJi5Jdo8aQxC7yg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OVyzB8N1P8QR0uR6qN7uOx0wtf9amaEOf3rrA1CA1zw=; b=fxa+LN5YeahwH+TCJWGGwL+eEBoW4NPKuGoJHKqaCltH+ohC7vcGq0fvmA0DMfFHRs +8+oIQYJ+U9epwesgFCo79vJ7bIAAMdGw78lzY0e9LW6Fh81hcYvIkDWFNuQm86kKwOr I3J5rZtulU46R7nrioGiB9ldH3dKKspzudosda7IZuk0MlDeFfmGFP3AuTkpA9MdJfPM kFzCYnispaCHsS+3xF8BoMtP/2TF/G4rsFNkLYDs36p6efxRA3OoNg3jty+2+gCPtJJl g599P8RZyaBv6PRsalwL4ImvlBRL1Sl/zcd/DKz1rAglIQOSweYbR7NchnOffRTOYOfI 8GzA== X-Gm-Message-State: AHYfb5jVu96NfAivzwu97FdLBgCJy7vs8YdX7EiuDepEX9TreGukYuGN PSc6S7P2WSynkeID X-Received: by 10.25.160.81 with SMTP id j78mr1143956lfe.192.1503499348358; Wed, 23 Aug 2017 07:42:28 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-67.NA.cust.bahnhof.se. [158.174.22.67]) by smtp.gmail.com with ESMTPSA id c89sm287593lfb.78.2017.08.23.07.42.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Aug 2017 07:42:27 -0700 (PDT) From: Ulf Hansson To: Wolfram Sang , "Rafael J . Wysocki" , Len Brown , linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v2 8/9] i2c: designware: Don't resume device in the ->complete() callback Date: Wed, 23 Aug 2017 16:42:08 +0200 Message-Id: <1503499329-28834-9-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503499329-28834-1-git-send-email-ulf.hansson@linaro.org> References: <1503499329-28834-1-git-send-email-ulf.hansson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170823_074251_204244_D602193A X-CRM114-Status: GOOD ( 13.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jisheng Zhang , Ulf Hansson , Guodong Xu , Kevin Hilman , Jarkko Nikula , Haojian Zhuang , John Stultz , Andy Shevchenko , Mika Westerberg , Sumit Semwal , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In case the PM core is able to use the direct_complete path during system sleep for the i2c device, the device is runtime resumed in the ->complete() callback. For ACPI platforms this is needed to synchronize the power state of the device, while for non-ACPI platforms this is a waste. To better deal with this, let's drop the ->complete() callback from the i2c-dw-plat driver altogether, thus avoiding the runtime resume of the device. This change still plays well for the ACPI case, because the ACPI PM domain's ->complete() callback, assigned to acpi_subsys_complete(), already deals with runtime resuming the device in case it's needed. Signed-off-by: Ulf Hansson --- Changes in v2: - New patch. --- drivers/i2c/busses/i2c-designware-platdrv.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 441afc7..fc6b99f 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -418,15 +418,8 @@ static int dw_i2c_plat_prepare(struct device *dev) { return pm_runtime_suspended(dev); } - -static void dw_i2c_plat_complete(struct device *dev) -{ - if (dev->power.direct_complete) - pm_request_resume(dev); -} #else #define dw_i2c_plat_prepare NULL -#define dw_i2c_plat_complete NULL #endif #ifdef CONFIG_PM @@ -462,7 +455,6 @@ static int dw_i2c_plat_suspend(struct device *dev) static const struct dev_pm_ops dw_i2c_dev_pm_ops = { .prepare = dw_i2c_plat_prepare, - .complete = dw_i2c_plat_complete, SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) SET_RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, dw_i2c_plat_resume,