linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: linux-pm@vger.kernel.org
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Will Deacon <will@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	LKML <linux-kernel@vger.kernel.org>,
	LAKML <linux-arm-kernel@lists.infradead.org>
Subject: [PATCH v2 0/8] ARM: psci: cpuidle: PSCI CPUidle rework
Date: Fri,  9 Aug 2019 12:03:06 +0100	[thread overview]
Message-ID: <cover.1565348376.git.lorenzo.pieralisi@arm.com> (raw)
In-Reply-To: <20190722153745.32446-1-lorenzo.pieralisi@arm.com>

v2 of a previous posting:

v1: https://lore.kernel.org/linux-pm/20190722153745.32446-1-lorenzo.pieralisi@arm.com/

v1->v2:

- Split config files updates into separate patches
- Fixed minor memory leaks/bisectability issues

Original cover letter
---

Current PSCI CPUidle driver is built on top of the generic ARM
CPUidle infrastructure that relies on the architectural back-end
idle operations to initialize and enter idle states.

On ARM64 systems, PSCI is the only interface the kernel ever uses
to enter idle states, so, having to rely on a generic ARM CPUidle
driver when there is and there will always be only one method
for entering idle states proved to be overkill, more so given
that on ARM 32-bit systems (that can also enable the generic
ARM CPUidle driver) only one additional idle back-end was
ever added:

drivers/soc/qcom/spm.c

and it can be easily converted to a full-fledged CPUidle driver
without requiring the generic ARM CPUidle framework.

Furthermore, the generic ARM CPUidle infrastructure forces the
PSCI firmware layer to keep CPUidle specific information in it,
which does not really fit its purpose that should be kernel
control/data structure agnostic.

Lastly, the interface between the generic ARM CPUidle driver and
the arch back-end requires an idle state index to be passed to
suspend operations, with idle states back-end internals (such
as idle state parameters) hidden in architectural back-ends and
not available to the generic ARM CPUidle driver.

To improve the above mentioned shortcomings, implement a stand
alone PSCI CPUidle driver; this improves the current kernel
code from several perspective:

- Move CPUidle internal knowledge into CPUidle driver out of
  the PSCI firmware interface
- Give the PSCI CPUidle driver control over power state parameters,
  in particular in preparation for PSCI OSI support
- Remove generic CPUidle operations infrastructure from the kernel

This patchset does not go as far as removing the generic ARM CPUidle
infrastructure in order to collect feedback on the new approach
before completing the removal from the kernel, the generic and PSCI
CPUidle driver are left to co-exist.

Tested on Juno platform with both DT and ACPI boot firmwares.

Cc: Will Deacon <will@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>

Lorenzo Pieralisi (8):
  ARM: cpuidle: Remove useless header include
  ARM: cpuidle: Remove overzealous error logging
  drivers: firmware: psci: Decouple checker from generic ARM CPUidle
  ARM: psci: cpuidle: Introduce PSCI CPUidle driver
  ARM: psci: cpuidle: Enable PSCI CPUidle driver
  PSCI: cpuidle: Refactor CPU suspend power_state parameter handling
  arm64: defconfig: Enable the PSCI CPUidle driver
  ARM: imx_v6_v7_defconfig: Enable the PSCI CPUidle driver

 MAINTAINERS                          |   8 +
 arch/arm/configs/imx_v6_v7_defconfig |   1 +
 arch/arm64/configs/defconfig         |   1 +
 arch/arm64/kernel/cpuidle.c          |  50 +++++-
 arch/arm64/kernel/psci.c             |   4 -
 drivers/cpuidle/Kconfig.arm          |  10 ++
 drivers/cpuidle/Makefile             |   1 +
 drivers/cpuidle/cpuidle-arm.c        |  13 +-
 drivers/cpuidle/cpuidle-psci.c       | 236 +++++++++++++++++++++++++++
 drivers/firmware/psci/psci.c         | 167 +------------------
 drivers/firmware/psci/psci_checker.c |  16 +-
 include/linux/cpuidle.h              |  17 +-
 include/linux/psci.h                 |   4 +-
 13 files changed, 342 insertions(+), 186 deletions(-)
 create mode 100644 drivers/cpuidle/cpuidle-psci.c

-- 
2.21.0


  parent reply	other threads:[~2019-08-09 11:03 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 15:37 [PATCH 0/6] ARM: psci: cpuidle: PSCI CPUidle rework Lorenzo Pieralisi
2019-07-22 15:37 ` [PATCH 1/6] ARM: cpuidle: Remove useless header include Lorenzo Pieralisi
2019-08-06 15:51   ` Sudeep Holla
2019-08-07  8:19   ` Daniel Lezcano
2019-07-22 15:37 ` [PATCH 2/6] ARM: cpuidle: Remove overzealous error logging Lorenzo Pieralisi
2019-08-06 15:51   ` Sudeep Holla
2019-08-07  8:20   ` Daniel Lezcano
2019-07-22 15:37 ` [PATCH 3/6] drivers: firmware: psci: Decouple checker from generic ARM CPUidle Lorenzo Pieralisi
2019-08-06 15:54   ` Sudeep Holla
2019-08-07 14:09   ` Daniel Lezcano
2019-07-22 15:37 ` [PATCH 4/6] ARM: psci: cpuidle: Introduce PSCI CPUidle driver Lorenzo Pieralisi
2019-07-23 11:46   ` Ulf Hansson
2019-07-23 14:15     ` Lorenzo Pieralisi
2019-08-06 16:10   ` Sudeep Holla
2019-08-06 16:34     ` Lorenzo Pieralisi
2019-08-07 16:30   ` Daniel Lezcano
2019-07-22 15:37 ` [PATCH 5/6] ARM: psci: cpuidle: Enable " Lorenzo Pieralisi
2019-08-06 16:16   ` Sudeep Holla
2019-08-06 16:40     ` Lorenzo Pieralisi
2019-07-22 15:37 ` [PATCH 6/6] PSCI: cpuidle: Refactor CPU suspend power_state parameter handling Lorenzo Pieralisi
2019-07-23 11:47   ` Ulf Hansson
2019-08-07 18:09   ` Daniel Lezcano
2019-08-08 12:55   ` Sudeep Holla
2019-08-08 15:29     ` Ulf Hansson
2019-08-08 16:04       ` Sudeep Holla
2019-07-23 11:49 ` [PATCH 0/6] ARM: psci: cpuidle: PSCI CPUidle rework Ulf Hansson
2019-07-23 14:19   ` Lorenzo Pieralisi
2019-08-09 11:03 ` Lorenzo Pieralisi [this message]
2019-08-09 11:03   ` [PATCH v2 1/8] ARM: cpuidle: Remove useless header include Lorenzo Pieralisi
2019-08-09 11:03   ` [PATCH v2 2/8] ARM: cpuidle: Remove overzealous error logging Lorenzo Pieralisi
2019-08-09 11:03   ` [PATCH v2 3/8] drivers: firmware: psci: Decouple checker from generic ARM CPUidle Lorenzo Pieralisi
2019-08-09 11:03   ` [PATCH v2 4/8] ARM: psci: cpuidle: Introduce PSCI CPUidle driver Lorenzo Pieralisi
2019-08-09 11:03   ` [PATCH v2 5/8] ARM: psci: cpuidle: Enable " Lorenzo Pieralisi
2019-08-09 11:03   ` [PATCH v2 6/8] PSCI: cpuidle: Refactor CPU suspend power_state parameter handling Lorenzo Pieralisi
2019-08-09 11:03   ` [PATCH v2 7/8] arm64: defconfig: Enable the PSCI CPUidle driver Lorenzo Pieralisi
2019-08-09 16:53     ` Will Deacon
2019-08-09 11:03   ` [PATCH v2 8/8] ARM: imx_v6_v7_defconfig: " Lorenzo Pieralisi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1565348376.git.lorenzo.pieralisi@arm.com \
    --to=lorenzo.pieralisi@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=shawnguo@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=ulf.hansson@linaro.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).