Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp338538imu; Thu, 20 Dec 2018 23:31:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN5640LV1CIkbEcAKxMfczsG2143/WKXWEczCFDvTommsLsG7L/FKuKVqcilXhvVl79EH2ff X-Received: by 2002:a63:1c61:: with SMTP id c33mr1322056pgm.354.1545377482413; Thu, 20 Dec 2018 23:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545377482; cv=none; d=google.com; s=arc-20160816; b=kcA26O7VLBNV/pjPoDPT4PYROghIlynKEXP6EdeuFCz+wEaGsUhN0lpayNpOMPRgYt 4ExFPoXo/fcrRLA20xtR7pIRMVZRMlM+wRQ2pr+pMQ4PuxTJJYJAC0vM/MSqS7FXM71n 88FR5t7QRQpTmEaRXzfQ3iMqfO7jll5n2YxX+dDLykmUIi0GIaVAB5l20nWgbn5E+Q8Q P1P71qLgCRT2biu3F0aFYDUMrB6PWEgCgpmQtDQFiXA2/Wx7xQ/IPHuT0QbDhDcywkhG b43JvB8Y8Kk9OG2HFWR79kB+LweZzZCiZUE7wMkzf3IpP0j9PYSqJFKIbZbJyfELy9g/ C+8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=cUq9TBBK9t1BgxHFuMyVN3iuBzPgKImOP2CXu8v7xh8=; b=sADgHTzRywv90rDsE7t2qUsGjHxAQYUOP4ngLIK/HkxHm4opJZYAlsqIZJ+rGIRTLf ytcW3Aa7qEhSFmtGoADNw/qINvWlL1GaMh35/VIk5SrJuyPa+yryyeDap7+GdP+37qtj sVsGLqZ1rgL0xKsgJDsnSji1kOaCZvVXlQ0HDgHqOYLQkfnPR2/BN9gSj1KtHZsaacgi Rct3WptEiv4YdeKHGHNZz1FKGeXF+YPT8niw9rkvM84xIcLpwrckiPmsxTvb0N27XoMe bb+shAtT31J4nEFIw884AHVQfk8Hd4Un/B1RZJixnnTNDfqAReJ5B3hZTpEbFZfJ0yXd +VFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QlSGMD2r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si20723578pgi.66.2018.12.20.23.31.06; Thu, 20 Dec 2018 23:31:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QlSGMD2r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389858AbeLTVKh (ORCPT + 99 others); Thu, 20 Dec 2018 16:10:37 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:43092 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729941AbeLTVKg (ORCPT ); Thu, 20 Dec 2018 16:10:36 -0500 Received: by mail-vs1-f67.google.com with SMTP id x1so1967245vsc.10 for ; Thu, 20 Dec 2018 13:10:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cUq9TBBK9t1BgxHFuMyVN3iuBzPgKImOP2CXu8v7xh8=; b=QlSGMD2rj7s0+DheMQQSufYJhmCo8Zle1mdgAVDYkipVq9GdMLYYBayBErQLSXE0hW +H0GlKGcO9QpP4zNSaApPqF3zcNTQj43G+is0wmxB47MzLVrYxOejTXILZ+on5ecNTHl uRwemciysky7AeB34k431kNOLWV7tk3wynLXY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cUq9TBBK9t1BgxHFuMyVN3iuBzPgKImOP2CXu8v7xh8=; b=UEAxwHbh3zENRZRe3kD0RxZaQc6kX5zd+lyHMopOeOMtaCJM72IUOHM6wPxTxFRvE+ DVN2pRKN2CD+JSucaaqLVAV78zd6SSaC24otZQd9rHBHSZPGv6g7FzBkbtDBpPOJImV5 S/YwmeWmSmczQsFiF2ug4Fquzv2qPE6KV/PtwMh00sI9/CL7ztx75GaHn4NzuJemhC94 WV6CFnDmIJJIe+7qcGh3CWCH3cS0vOlKP/AhrH0SLQm8U9dAcfJfJJGC6wiPwxKFHEu8 vBBaz1mRVhFRiODngajCrB7Y3F6XQvZihPnAAVHrO4ghemzbuXPM1KCsd/ltZMc2QPaJ AJ3w== X-Gm-Message-State: AA+aEWYG65fMpZacYeQe5dTZpxNvDGD1JIT594zbQ8Qye/MGoanhkEml ykMyIFowUY8xJiNd5zpd800B/S/THkN5Twnd158SkQ== X-Received: by 2002:a67:7685:: with SMTP id r127mr12790733vsc.35.1545340235233; Thu, 20 Dec 2018 13:10:35 -0800 (PST) MIME-Version: 1.0 References: <20181129174700.16585-1-ulf.hansson@linaro.org> <20181129174700.16585-19-ulf.hansson@linaro.org> In-Reply-To: From: Ulf Hansson Date: Thu, 20 Dec 2018 22:09:58 +0100 Message-ID: Subject: Re: [PATCH v10 18/27] drivers: firmware: psci: Add support for PM domains using genpd To: Daniel Lezcano Cc: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , Linux PM , "Raju P . L . S . S . S . N" , Stephen Boyd , Tony Lindgren , Kevin Hilman , Lina Iyer , Viresh Kumar , Vincent Guittot , Geert Uytterhoeven , Linux ARM , linux-arm-msm , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [...] > > -obj-$(CONFIG_ARM_PSCI_FW) += psci.o > > +obj-$(CONFIG_ARM_PSCI_FW) += psci.o psci_pm_domain.o > > Same comment as 17/27. > > +obj-$(CONFIG_PSCI_IDLE) += psci_pm_domain.o Let's discuss that in patch 17 to agree on the way forward. [...] > > +static int psci_pd_power_off(struct generic_pm_domain *pd) > > +{ > > + struct genpd_power_state *state = &pd->states[pd->state_idx]; > > + u32 *pd_state; > > + u32 composite_pd_state; > > + > > + /* If we have failed to enable OSI mode, then abort power off. */ > > + if (psci_has_osi_support() && !osi_mode_enabled) > > + return -EBUSY; > > I'm not sure EBUSY is the best error code to describe this situation. > May be ENOTSUP ? I see your point. However, -EBUSY is the correct code for this case as it tells genpd that the PM domain could not power off, but needs to stay powered on. To be clear, genpd treat -EBUSY, in a bit special way. > > However, how possible is it to pass in this function if the OSI mode was > not enabled ? If we fail to enable OSI mode, we keep having the CPUs attached to PSCI PM PM domains. Although, as we are then running in platform coordinated mode, there is no point allowing a cluster idle state. The option would be to convert to the flattened model in case we fail to enable OSI mode, but that error path is going to be rather complicated (we need to detach CPUs, unregister domains and providers, etc). Instead the assumption is that it simply shouldn't fail when we decide to try. If it does, it's likely something need to be fixed anyways. > > > + if (!state->data) > > + return 0; > > + > > + /* When OSI mode is enabled, set the corresponding domain state. */ > > + pd_state = state->data; > > + composite_pd_state = *pd_state | psci_get_domain_state(); > > + psci_set_domain_state(composite_pd_state); > > + > > + return 0; > > +} > > + > > +static int psci_pd_parse_state_nodes(struct genpd_power_state *states, > > + int state_count) > > __init ? Yes, probably. I will check and see if/where it could makes sense. Thanks for pointing it out! [...] Kind regards Uffe