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: 110854 Delivered-To: patches@linaro.org Received: by 10.37.128.210 with SMTP id c18csp7031585ybm; Wed, 23 Aug 2017 07:42:28 -0700 (PDT) X-Received: by 10.46.20.88 with SMTP id 24mr1024114lju.51.1503499348772; Wed, 23 Aug 2017 07:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503499348; cv=none; d=google.com; s=arc-20160816; b=tv9+EMCMj0APqlajTZzkkc8XPUOK8V67wE9rZa+jO5+CH95FcLH7hk/jYmuU9HReUt l9b2fTl9PuHRDRWoKmhmSkxykAgOXvLcl9/DhqT2UaYMVkGzUfrDXWHT4InIQt/r7/tJ Eu+0qp666BOcxse2DGV7K/TuD26GleHkJyV52ehKvTuewvW7c0r81U023FS3f9iNVS53 mVHkIAqa0KO8kIh4kdBkA5960KszdNHo8pAaGFk9d6gDpQbM4N5LXe9PkiTGQypx85H7 QqN/417ZF16VU3J21vOHJwVHL1N4KCluSfSM31LAo/eeDRN1ho9BEWa7ru3bViNx20K3 tZrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=OVyzB8N1P8QR0uR6qN7uOx0wtf9amaEOf3rrA1CA1zw=; b=Gxq+Y/p5B94zm+kTnHP+fsQLE4XPS8h4KIbwu6K0AlkhATlpqcWwn533vqFnFqiuhH Z2W+xZfy59/xfHrO8iBfduv/kCoB/wOQ9mSrAHjDOW9BXb3LlnXBe/A1eIab68UZdVUk ecIrCd3i5CEjELXFTcqmyedUWWR0e3qFOo03SjqQosisQykbCbVmfXYKEjHk4Nlac0dD CZyprC+3iJ6qLgqheYLF9Inj7HMmBnwAlOZtjwVRg0F+Foe6SiAxmUE39kQrFeC1YZoG ZAES8eQMp49UL+zySANBxHUrc+j7uUrzHRPD/0CgHx5oRJVpVMSVB6leA7mP4fTu/Ih8 VsuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D3pti5Mj; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22c as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com. [2a00:1450:4010:c07::22c]) by mx.google.com with ESMTPS id s20si753148ljd.478.2017.08.23.07.42.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 07:42:28 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22c as permitted sender) client-ip=2a00:1450:4010:c07::22c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D3pti5Mj; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22c as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22c.google.com with SMTP id l137so1428620lfg.3 for ; Wed, 23 Aug 2017 07:42:28 -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=ck4Slgh/22YXBJGWBaHD0EdzAsXTsOKjZPwTGkW9YJO7eKya3OLUSMnWSZ/FRgEwkW /iaoJ+Ml6U6T55YLxsOXJYX/yQ04h6xnV6AoKq/bqbZvxT4ZDWvgn7uoStbyJlbtYvEQ XfNJ1hqRuKSn/LQCbDyhqr9qgTBvmnJHJVd316Rg1ASgO8Vk0cPrasKP1A7ah1/pcMJ0 Py4U5tqm7CXdwmrDgaSud/OiRBoKPEmvNNoZ80dqABthQ8YPnvs/YbVPsY1o2V15t5Nt eyVA+GfbcvDXVT7GSbLZCm3PAfmbQ5cynDxludjsZEV0d3G8W8cgesr88KSCWfhpnvg9 yeeA== X-Gm-Message-State: AHYfb5jot3fUUcTbAW1tydDdorx0YW2Txbu3zlqJv200+J3jWk2JkkMN j2TQx6Ni7N3Qn2H/8CY= X-Received: by 10.25.160.81 with SMTP id j78mr1143956lfe.192.1503499348358; Wed, 23 Aug 2017 07:42:28 -0700 (PDT) Return-Path: 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 Cc: Kevin Hilman , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jisheng Zhang , John Stultz , Guodong Xu , Sumit Semwal , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, Ulf Hansson 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> 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(-) -- 2.7.4 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,