From patchwork Wed Aug 19 10:40:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 247942 Delivered-To: patches@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp348121ils; Wed, 19 Aug 2020 03:41:23 -0700 (PDT) X-Received: by 2002:a19:3d4:: with SMTP id 203mr11893153lfd.183.1597833683405; Wed, 19 Aug 2020 03:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597833683; cv=none; d=google.com; s=arc-20160816; b=FHQiPYN43pT97hfm2l1TUzftstSHmu+AJy32WPnsJb9IWtM4lc69ZutqL5D//8m1E0 xTICEL+VGioRYOmJZDfVMCmf3lAp8rM/9916/FARWQCGYZbKxMcUEKEDu8Xi+mTd8ZKa Og5hkyBwvtjiaemB3oOugr9XkvzBMf4Y+v1c0cb/gL2SdGvk5wKaoMF7L0nxFFefli/w 3RJGOXBMKwfUrEwIFI+n8zKx9tFK22slYT2Na7cQ4xkxVQdZAmBXZDl4aFVALspkB847 isDCv+Ni3IPJHfr0Zb4zV3HPg6oal28e2x31LAsJ/mven/3OwC7m3Cnnxj1xAshwhtJp mOUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=8j9EGJFaSYFS5klbcZOeULgDjTEPoTVPGEbkdeSYqgo=; b=FC7XEzENoL2clUumqfESvELhkV5T/YRZLxjAOxwv4zsuEJPpRh7hgKaSisP8Tl08TK 7+3PnX3Pd5Z0a0FFp5uTfWThf1RTnrjq4QXH5LcDrPns1YjWwNRAlV45+RjXqgSIZ3aY p+fBEUOThNGzvkL4g43LIG+xCkScD2E3kkJnnORpomNjEPi2r62y5eyssDj1Q6hxJZ1R 2Boa9z15pAkqSJnMnLcPTJCb5VMXM0/8ybbldwCzO2Nl+NGjISZ3ujg4k2hCEDCssm/7 ChPX+NcVihMJtazv+kyBwtv0w7arBerJFy5dc84kvIwxn0FKST13RY8mjKV+MWnZ8ORT ySpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dIjzW/35"; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 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-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z21sor10557434lji.52.2020.08.19.03.41.23 for (Google Transport Security); Wed, 19 Aug 2020 03:41:23 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dIjzW/35"; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8j9EGJFaSYFS5klbcZOeULgDjTEPoTVPGEbkdeSYqgo=; b=dIjzW/35yhnRnkFxvUPgMbWqfhAzruk/AqhRBDa2WxPDWwQYDGxGYfUp2HwEpekPS1 AWp6OT3mGiEZP3SLGhcpZOn+gwIUn/+8mk6dvxeY0+8kgMiReWklihQ24BZ52YeU3VI2 /jCyxxG4I/hzppae2+GHiGmr2UOufLHObk28gPDj/9K1PDpoDcIqzV4IvQNEZ34YAAmD ENyVMVvQcsyDxMyjbag4fRSqtylR5Mtr6Db4A8KHpI5lXo5QUcWMf2AyX8cV7wLvAhoi ro0wlCUEntEQgslF8gruZw3+mCQHccuTouSq7ivN9mFwWQhzVDuhLg8Rf1UggKLqrRz8 Cy0A== 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:mime-version :content-transfer-encoding; bh=8j9EGJFaSYFS5klbcZOeULgDjTEPoTVPGEbkdeSYqgo=; b=Dsl8DJwoMHQbYPmgnj8voPr8uFAX0IpJkMlin5BROMl8V/QKSotnAyW/x7zEzdDtBT Rk6LzMUhnk+Ez6y1/9kZniczsSWY/Up3YwnUDwLVCV1BHDKckLzKUwGH6Zt/0wUodwe6 mhWeICWHLnJWwlWKIRrXm4ovtBPaZ3kFObTpq3sMHZknElNKKit1CfJai9J2dErAWdWj +Tt9RiC/7Y3fUzfiYZ2WoP/7Fn0rb0QVK9CAUC1Ih+yCJG+Jn8FVApIlLb1d26WxisWw 7WMyqywCe5IQpfNSgx0s27VQQysJ4I+MdNCeWVx2W3rcr8Std/KofdfwZhWz8KHsMyXy A/iA== X-Gm-Message-State: AOAM533BILhtqi8UHWtbvF7fUpOPIA30vzt6KV9M9TLy4hX4FwSiSf3q QPqllX+rJMPHyj3i+0ujRcTLa6h6 X-Google-Smtp-Source: ABdhPJz2zqhf1rESCZqK5+UPE9Oyn+XjrrpI/jbRrqtY1rurHAv9YpsIlk7mPhkhznOPTWag/G+Fag== X-Received: by 2002:a2e:898d:: with SMTP id c13mr10887217lji.236.1597833682965; Wed, 19 Aug 2020 03:41:22 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-98-128-180-79.NA.cust.bahnhof.se. [98.128.180.79]) by smtp.gmail.com with ESMTPSA id y13sm6534822ljd.19.2020.08.19.03.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 03:41:21 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Kevin Hilman , linux-pm@vger.kernel.org Cc: Sudeep Holla , Lorenzo Pieralisi , Daniel Lezcano , Lina Iyer , Lukasz Luba , Vincent Guittot , Stephen Boyd , Bjorn Andersson , Benjamin Gaignard , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] PM / Domains: Add power on/off notifiers for genpd Date: Wed, 19 Aug 2020 12:40:54 +0200 Message-Id: <20200819104057.318230-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 A device may have specific HW constraints that must be obeyed to, before its corresponding PM domain (genpd) can be powered off - and vice verse at power on. These constraints can't be managed through the regular runtime PM based deployment for a device, because the access pattern for it, isn't always request based. In other words, using the runtime PM callbacks to deal with the constraints doesn't work for these cases. For these reasons, this series introduces a power on/off notification mechanism to genpd. To add/remove a notifier for a device, the device must already have been attached to the genpd, which also means that it needs to be a part of the PM domain topology. The intent is to allow these genpd power on/off notifiers to replace the need for the existing CPU_CLUSTER_PM_ENTER|EXIT notifiers. For example, those would otherwise be needed in psci_pd_power_off() in cpuidle-psci-domain.c, when powering off the CPU cluster. Another series that enables drivers/soc/qcom/rpmh-rsc.c to make use of the new genpd on/off notifiers, are soon to be posted. However, I would appreciate any feedback on the approach taken, even before that series hits LKML. Kind regards Ulf Hansson Ulf Hansson (3): PM / Domains: Rename power state enums for genpd PM / Domains: Allow to abort power off when no ->power_off() callback PM / Domains: Add support for PM domain on/off notifiers for genpd drivers/base/power/domain.c | 178 +++++++++++++++++++++++++++++------- include/linux/pm_domain.h | 19 +++- 2 files changed, 162 insertions(+), 35 deletions(-) -- 2.25.1