From patchwork Wed Aug 23 14:42:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 110847 Delivered-To: patches@linaro.org Received: by 10.37.128.210 with SMTP id c18csp7031339ybm; Wed, 23 Aug 2017 07:42:16 -0700 (PDT) X-Received: by 10.25.199.74 with SMTP id x71mr723554lff.163.1503499336770; Wed, 23 Aug 2017 07:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503499336; cv=none; d=google.com; s=arc-20160816; b=tZ0LO8svWa4Qdjy9RvaeMNUWlCKGPuEUwu1+fWaqCj2zlgmSWgR43RxhfNakIFSO9F cNfg9attZyRObT04Zy8KnzvZc5IHa2oQvXWOIAO5wa6hWli98F4mGKjX4kO1vEk6/+NN Se4oBhhCrMlDsNSWXuGI9lzZYIESVmC81FlkHqJ5s/XSFVr0Fb2+Mn28xRZdx28uS3JD NwV/0IqkVrJqg8yzOtbhFnXlOsI+G8Q0LaO2Bp522y8nhlxr85ib9Wo7GcTTLs28wt+a SySWwPKgJ8GIfWLq8ccp/myVIB82aOc7CQsfF9tlvokSaqz4A3Nemq9e8nh0eYDT9V2B uyDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ghgWML9opyTKu4zBpwqyrWmWqvDNk4DlwG/zQZp89kU=; b=mcEnYfxwX320rvyk/JJoGb8w6TvRfbngB9fNsEluZ3uXdfFbGtQBjtBGiz8OniMsCf ROutlt85/Gpyb+9dAPG9Ll6senX/rytCLwLfb0WcSk1fqbuGSo0hO0FnUUJ6yprLOzBG to+v9+RtjKBtH+Y0ANgcEq2zpS9IPNGzthnvUaeTCsFci8cP+qbdHd1VRSl2N+WR1oqG 0k+aikjKW9oAAi+3QVyhQD/izsdYUs0SHJD0HcUGAIxY4VFIJwQm/UkPlID5oy//3oz0 aBpYm5dUrAQCQ/JGVYL3W+sMokVZD+iZwIWEcWQeNPXCGZnSBXc3BEA9lWiTCsCNzFqm 4Acg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jD8QMOIo; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22b 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-x22b.google.com (mail-lf0-x22b.google.com. [2a00:1450:4010:c07::22b]) by mx.google.com with ESMTPS id s15si759620ljd.426.2017.08.23.07.42.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 07:42:16 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22b as permitted sender) client-ip=2a00:1450:4010:c07::22b; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jD8QMOIo; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22b 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-x22b.google.com with SMTP id f7so1387129lfg.4 for ; Wed, 23 Aug 2017 07:42:16 -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; bh=ghgWML9opyTKu4zBpwqyrWmWqvDNk4DlwG/zQZp89kU=; b=jD8QMOIodSVhUY4mWT98bdxl+bklM9PHdTwzDhoCQWHR64F6gxtKN6McXk8R16cQIe lHg81Jtkju+215Z2hvHKGTF9vRT8UpWf6/XStrVn72hzPp3ftbchKSWTIglz0Qnwx4b7 5hcS4aipN5nvKzMI8gyU/Tr+ytKqzdtpw+ahU= 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=ghgWML9opyTKu4zBpwqyrWmWqvDNk4DlwG/zQZp89kU=; b=ptPQMvLZTNS3r2eySKCCrrzleYK4sM+sEAc1ptqHUs1fZeu+6YoifkSXAYeVsG7zpc EWeyYMKdFe7pQhuy3xh6aku20sT4VEFKKKswKXsVqU7nVHJbiMivCpVAv/OvwBf7F/eX cnr1YdYzywgDwGwAwtSYwyKs8TB+WucpU6FG4ookOv40w/m1DFDUvfIiS67s24kFoNhv a23FJKwzp0fLORd/WVVE7NhesJlkPSzt/Iyqt3xLyYdr79C9s+S2/gesD2yhdP/hJVzS xUE9jg9HA+EkIzjlxTYnfKLFSrOUhTchEe8vlvxkmZyroRngNZFl5XcJH6G7H0qc8i30 IvUA== X-Gm-Message-State: AHYfb5h1ZE8zRzEJESAzmnD88b5iS82OrlGUsrpCNoSvVLKO7Hda/xb/ u31LFY5YrRSkHW2u2qw= X-Received: by 10.25.0.72 with SMTP id 69mr956279lfa.62.1503499336170; Wed, 23 Aug 2017 07:42:16 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Aug 2017 07:42:15 -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 0/9] PM / ACPI / i2c: Deploy runtime PM centric path for system sleep Date: Wed, 23 Aug 2017 16:42:00 +0200 Message-Id: <1503499329-28834-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 The i2c designware platform driver, drivers/i2c/busses/i2c-designware-platdrv.c, isn't well optimized for system sleep. What makes this driver particularly interesting is because it's a cross-SoC driver, which sometimes means there is an ACPI PM domain attached to the i2c device and sometimes not. The driver is being used on both x86 and ARM. In principle, to optimize the system sleep support in i2c driver, this series enables the proven runtime PM centric path for the i2c driver. However, to do that the ACPI PM domain also have to collaborate and understand this behaviour. Therefore a number of changes, patch 1 to patch 7, makes the needed changes to the ACPI PM domain. In patch8 and patch 9, the i2c driver gets optimized and is converted to the runtime PM centric path for system sleep. It shall be noted, the behaviour of the ACPI PM domain should remain intact, still taking benefit of using the direct_complete path during system sleep, except for those drivers that explicitly request it not to (via a new ACPI API added in this series). This series has been tested on an ARM64 Hikey board, which isn't having the i2c device attached to the ACPI PM domain. This means that the ACPI changes needs to be tested on some relevant Intel SoCs and it's greatly appreciated is someone could help out with this, so is of course review comments. Some news in v2: - The v1 contained a fix for the i2c driver, this has been sent separately [1] and picked up for fixes by Wolfram for v4.13-rcs. However the fix has not yet reached Linus' tree. The changes on i2c driver are based upon that change. - To simplify for testers, I have published a branch [2] based upon Rafael's pm tree and linux-next branch, which also includes the above patch. - Rephrased the coverletter to clarify the intent of this series. - Addressed review comments from v1. [1] http://patchwork.ozlabs.org/patch/799803/ [2] git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git acpi_pm_i2c_rpm_path_v2 Kind regards Ulf Hansson Ulf Hansson (9): PM / ACPI: Restore acpi_subsys_complete() PM / Sleep: Remove pm_complete_with_resume_check() PM / ACPI: Split code validating need for runtime resume in ->prepare() PM / ACPI: Split acpi_lpss_suspend_late|resume_early() PM / ACPI: Provide option to disable direct_complete for ACPI devices PM / ACPI: Enable the runtime PM centric approach for system sleep PM / ACPI: Avoid runtime resuming device in acpi_subsys_suspend|freeze() i2c: designware: Don't resume device in the ->complete() callback i2c: designware: Deploy the runtime PM centric approach for system sleep drivers/acpi/acpi_lpss.c | 81 +++++++++---- drivers/acpi/device_pm.c | 169 ++++++++++++++++++++++++---- drivers/base/power/generic_ops.c | 23 ---- drivers/i2c/busses/i2c-designware-platdrv.c | 35 +----- include/acpi/acpi_bus.h | 1 + include/linux/acpi.h | 4 + include/linux/pm.h | 1 - 7 files changed, 218 insertions(+), 96 deletions(-) -- 2.7.4