From patchwork Wed Sep 20 22:31:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 816537 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 (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="GdfSLPvM"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xyDyX6KS2z9sBZ for ; Thu, 21 Sep 2017 08:32:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751680AbdITWcI (ORCPT ); Wed, 20 Sep 2017 18:32:08 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:55047 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751635AbdITWcH (ORCPT ); Wed, 20 Sep 2017 18:32:07 -0400 Received: by mail-pf0-f176.google.com with SMTP id d187so2226320pfg.11 for ; Wed, 20 Sep 2017 15:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=HQh9Gz/eJFBZH43xZboGEEARfEEHvYhLW5huw3a8Lro=; b=GdfSLPvMmCNymtk+gLy50Jh1BmZAezZ8I/ftUuWnUgpzQZhboX2I4/ABDzU/WfPuL3 yDZZLK4Q81dwoDI6cJoVykwkJY/oPO5/qucT9iSwkwsLP1UlXHcBMraE/mMyDNJa5EWj ZyLSVQ9ZTB5+PtSsHJRvvjuwLJztq4l8Oi9R9PMam9VWPgzz2vSYI9EJ2C/QqGg7Tn5s jjlaGClMc/OJd6jyrj1LBwZ0Oi0VRm/rtT7jCnkzgTrLsx49S8ps/+XqJv9htoVwUIBD B//BxILF+tWTDhuuWm6ukS+P6hQPJqAijNfOZWXcfQlEstIBXviZc5884EvhZg45IthX /PZQ== 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; bh=HQh9Gz/eJFBZH43xZboGEEARfEEHvYhLW5huw3a8Lro=; b=ffzBBqoZNDzJdywtSQA/0E7hKLcVYnSR7vf0+PYkswvkuVVGRN3hLWxeYlTBFC1TPd kBliLUHrQlGrmJzxMINfsI/uN55Rsg8LS0K6DcvcMBvcjEeEEOW1xEitlgUl2eyUt20b 0p9HPra9ommO2p4u1aPmUbTjAML1jUisMrpFy9H5TXbHAmF4++cAxDOTd6kytNhxmdip dSZbAOLPIXDZJHKtDOlhVjsUXUAYkv8xfmD/tafLwBXpwEYrvX1rHYioq9/MFKK3zVPT BT99Btg/ea0gUHAXQlQan0J52ymZKs/ZpRO+THLBAcmBtsyvownSJNCdd82hm9u5bBI9 RGaw== X-Gm-Message-State: AHPjjUh7YNdbRwJD36MxZ6Qn/BMbshMpk9W8uZlEPqKxoMOdC9IyHEXK xpFqHRJO9/vau6+30bOONmzqmg== X-Google-Smtp-Source: AOwi7QBKS/Wmyy5Ubc4DMBnpEG7fBu2+6Nxtz2XZHMljl9N0GyHYRBoymNynnWAQCa224eSPuahSWA== X-Received: by 10.101.69.8 with SMTP id n8mr3615920pgq.167.1505946726604; Wed, 20 Sep 2017 15:32:06 -0700 (PDT) Received: from rajat.mtv.corp.google.com ([172.22.112.48]) by smtp.gmail.com with ESMTPSA id k78sm10871733pfb.157.2017.09.20.15.32.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 15:32:05 -0700 (PDT) From: Rajat Jain To: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Lee Jones , "Wysocki, Rafael J" , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Len Brown , furquan@google.com, rajatxjain@gmail.com Cc: Rajat Jain Subject: [PATCH 1/2] i2c: designware: switch to suspend_late/resume_early Date: Wed, 20 Sep 2017 15:31:51 -0700 Message-Id: <20170920223152.100641-1-rajatja@google.com> X-Mailer: git-send-email 2.14.1.821.g8fa685d3b7-goog Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Ref: https://lkml.org/lkml/2017/9/19/649 The bus controllers should suspend the bus operations only after all of the devices on the bus have suspended their device completely. Since the i2c_client drivers could be talking to their devices in their suspend_late() calls, lets ensure that the bus is alive by that time. Thus moving the controller suspend logic to suspend_late(). Signed-off-by: Rajat Jain Tested-by: Rajat Jain --- drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 0e65b97842b4..66dd7f844c40 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -468,7 +468,7 @@ 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_LATE_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, NULL) From patchwork Wed Sep 20 22:31:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 816536 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 (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="SdO7heMa"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xyDyC6vzkz9sNr for ; Thu, 21 Sep 2017 08:32:19 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751813AbdITWcR (ORCPT ); Wed, 20 Sep 2017 18:32:17 -0400 Received: from mail-pg0-f45.google.com ([74.125.83.45]:54217 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810AbdITWcO (ORCPT ); Wed, 20 Sep 2017 18:32:14 -0400 Received: by mail-pg0-f45.google.com with SMTP id j70so2462053pgc.10 for ; Wed, 20 Sep 2017 15:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IS1SxGRRw1XaFXwIuO+q4K4bSJdlxYkHEA+HPMgXnCc=; b=SdO7heMaJg0e/92m5+OHsK9kkYeZ96DpHpQFx+rvgp+dBoVUZwlWjEySDOb7sOLJbV lBKWIG42Oi09mAe+gtNz14P0hEFSr6FA+n6Be7rDOWrAyXq5vE3kgUUGjYFixx2v2K2D PmrEhmNXFGkcMuH5xn5wjCKodB4N14bfsnh5yR8PZFbtsgUX1CMawP2MuwuzWcfEcffC Kcf8AL3d5Tbyx//htGqW9E5bJQmh1ggeF/mY6PgCL8P03ZMh/XQZ7d3yxutI46R+ZR6r SjiRYwjnfTUyKpDZV+SljYE3+UVNYmnf/8QB5863rSgqqgckl+Ow1p2ACgxH++0YUiUD d5cg== 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=IS1SxGRRw1XaFXwIuO+q4K4bSJdlxYkHEA+HPMgXnCc=; b=A/dBSmZZAGiwyq9XAmtOUnB0SeEz7B4EhvunhZNHMrwwaHYzzDftRKv+AgdqgIl7sW SCrHtz421BsL0oBZsuh8EfxTp/Rq0nK6oF91ThEmfONvMf1ZQbrBtEOoAAhJDcR06yUy q7GZCisF1tTeXTIBKAI+dwWJsCVAnK+SRvHWRVTEYvJ4FLmK8ryVaK3Jwnv0Lym8VrGX RVucMNFm9QXze7Tu46urdPUbYLSJMw9jmgNL+FCaLmIf5QhWpvTdo8JnbtP8YDYtxeGa nWptH9QbLz524SyaiMjpoT7GJQnze4a2AFkxte4N/03Ns0kIDnarMGvRoepUfEfvXoyf B40g== X-Gm-Message-State: AHPjjUjtkHj+6d3QCXdw96mYfpGztHwKQQPkPGOHRxW2Ad3FTbOKEB49 CExLeBOl/4zvh9Hpu+SE28c3bg== X-Google-Smtp-Source: AOwi7QCbDU45zC5Xm4jOAxxDibMOB5h3SbiOuZD8GcGMoPkM8EB6bhcXuTdJ22DLsni8uoMcsjALyw== X-Received: by 10.84.129.193 with SMTP id b59mr3485982plb.147.1505946733263; Wed, 20 Sep 2017 15:32:13 -0700 (PDT) Received: from rajat.mtv.corp.google.com ([172.22.112.48]) by smtp.gmail.com with ESMTPSA id k78sm10871733pfb.157.2017.09.20.15.32.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 15:32:12 -0700 (PDT) From: Rajat Jain To: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Lee Jones , "Wysocki, Rafael J" , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Len Brown , furquan@google.com, rajatxjain@gmail.com Cc: Rajat Jain Subject: [PATCH 2/2] mfd: intel-lpss: switch to suspend_late()/resume_early() Date: Wed, 20 Sep 2017 15:31:52 -0700 Message-Id: <20170920223152.100641-2-rajatja@google.com> X-Mailer: git-send-email 2.14.1.821.g8fa685d3b7-goog In-Reply-To: <20170920223152.100641-1-rajatja@google.com> References: <20170920223152.100641-1-rajatja@google.com> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Ref: https://lkml.org/lkml/2017/9/19/649 The intel-lpss hosts the designware i2c controller device, which needs to be up and running until all its i2c child devices have suspended (child devices need to be accessible over i2c until suspend_late() has been called for all those devices). So lets delay the resetting of the controller until suspend_late(). I thought of renaming function to say *_late / *_early but that might cause confusion since the same function is also used for runtime suspend/resume. Fixes: 0b471aaa0e1a ("Put I2C and SPI controllers into reset state on suspend") Signed-off-by: Rajat Jain --- drivers/mfd/intel-lpss.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h index 694116630ffa..865bbeaaf00c 100644 --- a/drivers/mfd/intel-lpss.h +++ b/drivers/mfd/intel-lpss.h @@ -38,12 +38,7 @@ int intel_lpss_resume(struct device *dev); #ifdef CONFIG_PM_SLEEP #define INTEL_LPSS_SLEEP_PM_OPS \ .prepare = intel_lpss_prepare, \ - .suspend = intel_lpss_suspend, \ - .resume = intel_lpss_resume, \ - .freeze = intel_lpss_suspend, \ - .thaw = intel_lpss_resume, \ - .poweroff = intel_lpss_suspend, \ - .restore = intel_lpss_resume, + SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume) #else #define INTEL_LPSS_SLEEP_PM_OPS #endif