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: 9917505 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 7019160327 for ; Wed, 23 Aug 2017 14:42:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6301F28991 for ; Wed, 23 Aug 2017 14:42:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57C61289B9; Wed, 23 Aug 2017 14:42:34 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B877F289B4 for ; Wed, 23 Aug 2017 14:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754160AbdHWOmb (ORCPT ); Wed, 23 Aug 2017 10:42:31 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:36236 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754132AbdHWOm3 (ORCPT ); Wed, 23 Aug 2017 10:42:29 -0400 Received: by mail-lf0-f42.google.com with SMTP id l137so1428618lfg.3 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=Ds1WfDfblyZdScvCgkp1ZT/7iMb56w33RGRcc7FjdmgidMYkf1qlDzUiHkn/h5j6x1 wuduCNP3PgiR92ASYAP/spzYswzRgUGZghTIDQhF2l/LIxYs7IzHmXfTxMRGwBTmzvzA ZNPk63tzNZY6+b1kXL67rnXASiV1qa3tbWmYFaUNPoiAEyhK5gqwhGncmX8R/Ec0yrPF sx5B816Mxr6IGaLTIKdmbgBIl6PM+jz5PtyokW+XKTbeERxGYk3MHWFrD9K9sSDKOu0B mKTxeDB4BggsNm6eGhkDdwPM2YWUOr2rRX60yRzkA7W47Ga2PEWeyJNMvYPbKR4Koo4O NjdA== X-Gm-Message-State: AHYfb5hAgWLg8NMsC/btMn/H1Lo+zZqJQBvPKlMy2bFO56/o5SaAlb+E YzdcihmXIti2Pao8 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 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> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.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,