From patchwork Tue Aug 29 14:56:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 111225 Delivered-To: patches@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1457658qge; Tue, 29 Aug 2017 07:57:13 -0700 (PDT) X-Received: by 10.25.56.22 with SMTP id f22mr174273lfa.92.1504018633060; Tue, 29 Aug 2017 07:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504018633; cv=none; d=google.com; s=arc-20160816; b=w5fIrqNX0OrXwDAR0ELd7ldFNwfPPSGdSW9BoGnhcworZJ3e28qMfi6N0WsTI8bPWL 0hWVJqcjFAR6kuYHU6RfMNaKNS8HHGRL56uiIojDJki6fxvPKtEZMnLMUAeSy2ss7dgw lJdbSdH7j07aOSR57Vjk7TJtfArnvxs5eE0zo8B/8ALKyS+NNoBOmArSCtDPIXaaMvOy QQ3TIqaGj8xeVcY0mfEY+omyGSnUTFgrLHWvI8czQkzHVtvhqs4Sy/qFmCmipJe0nSy2 rispulRZoCYqnCX1QnMQAG+2vA3sK0soSK4p3/52dDXt8B2P/HFu2eW1uRMfOAGLEwlc h71g== 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=fMV4lip5F1xWDoteHgqSSVCG4o5V6Vtcqr29AzWTpyQ=; b=BkyXtEa9rmXwxilWjpzz1TVZAq/1T+nyAtY70/B/S8au8i5r16noOS3YWU8E2GH+lL Wzwtl4J5GJIalUh6q6XJYAi1yhK0jEGnzLZCYx42o+wYR4vBtnXUa/NKK04cgvZUmbPz 4nurItGhxitGR98MB/Y3sQmwiaczH6hmAT6xEIOH+tZFVU1aQkCcUV8HxmSjNBMaErwK Ou9nd/frUW3KWMYpPymtJv7L9weEP9IYbvT5KLMMm/f6gM1ZRLSTkSBgX3GPWJEN3eRh Om8/tsiOigh7lUY4TqETk35Omur3oLkXdAZNmdDFCx2FyBprmPdL+uS7eFSJ6R4s1Ngp bZVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EPbaCeiX; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::234 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-x234.google.com (mail-lf0-x234.google.com. [2a00:1450:4010:c07::234]) by mx.google.com with ESMTPS id n9si1287298lfg.413.2017.08.29.07.57.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Aug 2017 07:57:13 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::234 as permitted sender) client-ip=2a00:1450:4010:c07::234; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EPbaCeiX; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::234 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-x234.google.com with SMTP id z12so14371227lfd.3 for ; Tue, 29 Aug 2017 07:57:12 -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=fMV4lip5F1xWDoteHgqSSVCG4o5V6Vtcqr29AzWTpyQ=; b=EPbaCeiXzQeazS8pSBCnrk4aSeNE3XXcTr8KkNsLGxH79pYpHk0fZEFbihDu9Vnz7O cTjSl453zDO+Q0Zn3+q4Dkmhqligq1/7ytZLaprMxowRBzfspE4hMzOYNv2KIZ7dni8E fmFdJqgvzkFO733LwDZCsHHs7rvGT0iI+ZlrQ= 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=fMV4lip5F1xWDoteHgqSSVCG4o5V6Vtcqr29AzWTpyQ=; b=nM/vXjRfLMKlgljOxkycKDGgN9zRL7tYIWRw/Qqs3YoVC1flxmetbEn+abVgxwsOXf PWudyXf5u7zPdlZuLhuXBKnEnXa+UBQ8fvlN830UgWFecIo45KgSySQl9Icb+AWeq6Iy 9XjEVsxH4wjXKhRuB+iAfE601+f3JvJW+uSaUfSOt/+0526z7IAamLJ7tMzTPGcB8QEa 8qbkUnkyZlDvTGAfKkQPjodHcWZpSZCEDCICfYe/7qPNG1yNK/LwfIcN7OI69+raOPzn f8xbFbLH0BO8GpXQ2KTk0bB4TGPQH5Lp1hGIiwnbhRgQ7Rqqj4G0SpEbhK/evYoNNtGH PrAg== X-Gm-Message-State: AHYfb5gCM3ueskFDsFXlmZNHE0ljC2fOy+7PftD7EnNJsModYHjG2Fj9 cmF3P0hqpDCPZnZvCYc= X-Received: by 10.25.145.70 with SMTP id y6mr120016lfj.99.1504018632653; Tue, 29 Aug 2017 07:57:12 -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 y23sm652454ljd.19.2017.08.29.07.57.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Aug 2017 07:57:11 -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 , Johannes Stezenbach , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, Ulf Hansson Subject: [PATCH v3 7/8] i2c: designware: Don't resume device in the ->complete() callback Date: Tue, 29 Aug 2017 16:56:49 +0200 Message-Id: <1504018610-10822-8-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504018610-10822-1-git-send-email-ulf.hansson@linaro.org> References: <1504018610-10822-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 v3: - None. --- 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 57248bc..38121c9 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -417,15 +417,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 @@ -461,7 +454,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,