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: 807138 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="EPbaCeiX"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xhWvL2LYnz9sR9 for ; Wed, 30 Aug 2017 00:57:18 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754685AbdH2O5P (ORCPT ); Tue, 29 Aug 2017 10:57:15 -0400 Received: from mail-lf0-f53.google.com ([209.85.215.53]:37832 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754656AbdH2O5O (ORCPT ); Tue, 29 Aug 2017 10:57:14 -0400 Received: by mail-lf0-f53.google.com with SMTP id y128so8738659lfd.4 for ; Tue, 29 Aug 2017 07:57:13 -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=bxaK60jyAME4kviqy28uq+24kdXNs+mJacm4T+P6xNljTeGALIz28Dl6xmbKQiCekc EP0IrAgPYqYVlUzPYdpVcZVsJVQheLIqlqS/fNMfSOvtMepdLGHRoOmV/By9GEH4YxPX ugZltg5g87ZZJ3SSH3TA9hok9MM31/NaO5KS00Mg94CEsn96VlWcbLDL9JvexiV8W8nU CG4D71eChFpnrU1d4iUPslOxLYM3xHZ2/80uhxdkz168Gc1TP47OYDjhVFoPBK3vTM3a Foow4teMag3k3e7VAlc4omCvUYbkM8vD8CBEW/hgdfDGBM2FylD210QE91to8quEbLhG JYoQ== X-Gm-Message-State: AHYfb5hwSo1ZNMsP6bwqI6+SL0eBx10d180GWJ9/RK4J77vGdAvJKNZ6 5cdQTcJlQ3dryhAW X-Received: by 10.25.145.70 with SMTP id y6mr120016lfj.99.1504018632653; Tue, 29 Aug 2017 07:57:12 -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 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> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.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(-) 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,