Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp450791lqb; Fri, 24 May 2024 03:41:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0WfH3DR6tj1CpAbcyH7RDxhdneYy4FzJFXXuYiOr+aTsAji/0B9T8STMHX6R6oyIghkltaD4j/GtwSXBhHL3zvBlE0yw2E31Ycm5z3g== X-Google-Smtp-Source: AGHT+IHz1DxznxthvC8KDWdrieBhAFD2syV9ZWcr27TAKAhnuc5B1VS1lxfAoFpmuQpoP4ryzQT/ X-Received: by 2002:a05:620a:8507:b0:792:e3d3:2bad with SMTP id af79cd13be357-794ab083e53mr172135185a.22.1716547311037; Fri, 24 May 2024 03:41:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716547311; cv=pass; d=google.com; s=arc-20160816; b=AMPdOHYFxso3SVXLUjl++ivqCM5nUSNsn0f2rQXOLpw158Q/tl8yYEKsrvyVN4929m 0ppkAJwHLP64m8QcLu3YF7PwV0NVpCD7ohKA8NO90L+VzNnGwXt2ofcCIlFtj9QKBTj5 HAWI8+ojyho9Ya+VBjP5PGCK+NDUNWlsIAKN3jW2yCorSziD22gtkiS6WZ5kkwYwLEyo v33ZGAHLKD+ggmlLsZ+ZjGm71bOiSTNu2XpwruDnRDxjiruJV+gxXJn2GD4fsr/8hhr0 pEj5US3RPahadUdoCutjyZwMUSltxkNp1SOrQezQ8G85t2+EqIwRVDVZsB6vC+1v3PUV 5low== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=wXTrajnU7to/8Kkx0kFyODWqZ7ULlok1jwgmE99WXAc=; fh=eRWL0RMJ7Ukk4OtM73yrujK2TbDEwER8q6Pac3Tw+2M=; b=NWOxBWkzQ5Qtmn2mHC2E0Jn868opnQ41jwUARyPv6qGmPLTWfrCC6jY9TGq78MBu/4 gIdycnsRxlIon/Rrz+4WoJXOTuXuzsKdzeBdpqFQRKPg+hm4p34sB2GDzU0aKSj18y66 J6+PP8vw+KJR5ttV3Wqtl3NT8gf71THlTJ/OApbyQQtn03cQCWDNL+Y1iXxe8erIb2q0 E/5nvC0gLkvrJ2oD5BoVJVmSR5H8ajrNc0V7JhbuqxbZ/0muwt9JlJEG6P550uIAkh2B 1m62QNpdu9+HsuiM23e77NKbSsFXwmof/VWWrFNwOdvRJJ+dezBA3+txW30ISjx5gaEq BZPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SR+NtTzG; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-188614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188614-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abcc611esi123862785a.216.2024.05.24.03.41.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 03:41:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SR+NtTzG; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-188614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188614-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B11DA1C21341 for ; Fri, 24 May 2024 10:41:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D37AB85948; Fri, 24 May 2024 10:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SR+NtTzG" Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 455E384FDC for ; Fri, 24 May 2024 10:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716547301; cv=none; b=HsH1zRwJ0tHaHN+Fyx+BtpQEnChhnzH58oT1H1zi24f6CmkFbvfHGNhCqx+hF9T7GiSO3uXyWS/PJAzHYG/DlfCNvfwIt6J0zS25K54ywAGKywDyHnttZPRaGZauJIBnQddGdcb4KnOPfjPf/KOiUAs25mUTvUbSKbZHTOxr7Us= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716547301; c=relaxed/simple; bh=Ka9cmTCSiwlHXYTApKkxtTxZ6kn3mKj/2waCvaYF9Qk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Oadicu1EQbGa19kh+g0VPtnqkURWgvbPRel3TXoX0k/OQYjc5ZIVzqXpfNnZplS43WpvBL+ZV3njMhhyVeeUr76Qu36dsqin6pfgK1A0N78+OLjx5fEi65LYG81dJtCVere093s+inYSWSx1oK2N+bXIGQaZlmyS+mbFe/G1IDA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SR+NtTzG; arc=none smtp.client-ip=209.85.219.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-df4e7763603so2613522276.1 for ; Fri, 24 May 2024 03:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716547299; x=1717152099; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wXTrajnU7to/8Kkx0kFyODWqZ7ULlok1jwgmE99WXAc=; b=SR+NtTzGoAsNbf65Wp3JmHK4B6WAoi5OkqAPaGpmACESpSOSI6yuguZqhrcKS+xDlY zGKPTL1c+rKUAA6KRKdrdwkiYutR/OyLRO/rYNKPAT2gGk64Fe/nlmd8W3iye7KA6ZIM W7rD0UKFEP68mEwY+U39iqh2tUDAfLB4Wa1u2EQjuClpGrtPniak0wuPmLRDwumCfyKh 4bpq5M0Z9Ge8zn1qLWzQLp990Ma+/9F8ub67Y1FuIlSY6NnQ472iEch3/73sxqSd2VIl tChseCAcZtMeIpHepaamLiPTgSsBGuTE6+1eBdK+tZ/F5GWt+nekkFr0jR4727PaKIc3 KSxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716547299; x=1717152099; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wXTrajnU7to/8Kkx0kFyODWqZ7ULlok1jwgmE99WXAc=; b=N7IOvdJPBSVDKsFAjcrO+klFv0NiOKSeJtgQU1OSITbgydKv4YbvyPLIOdSGVYTmSi eDD8CR76uZgybETBFjPp7Oc6jyOSdZyG03wcsHBKDTILQAmcvwNheEwruKfbHzCxzeW4 mFpBUxYbRgs8RSMsK08PV79tmNq5NVHcEgXLVL1hR9KwZtvSt9KyFynHGMxE4kUnvBOo H4mURj8ni5nbdSNDe6pNnO2NUWtyNY/wCP9AJ89Pb+7DhcPmA5YY9cmmTZ1u0J77EzRP TObnMDJYJoUcuNGbUlpwKyWLFGfk/OCgpQjzlyEXMEmFXPSnkW56BG3vlrqTsDECNluH oVtQ== X-Forwarded-Encrypted: i=1; AJvYcCVnMA1QRbpBqkToo/538e0RPR+F32kzVehOIhz+HOvSMBxhI3TsGRaK4YwvFuLdF65rW/TJS+s7NjWmWmffXaPVNvm/ba4m6A7+UCrX X-Gm-Message-State: AOJu0Yw+A0FBOsloMbqcGPptKW45FTFIPEguu8klm3Wd1LBx30YljKHT 2njgOQAuJxoDbayeSyeSyugeoJtKClYixqnD2KWi5hEp3wrtyjI3uajxaqoVysMf50wlXgzHvJQ oDzgpl8K8iI/ZEirTlYcZgv0Qr42oPGC3z55CSQ== X-Received: by 2002:a05:6902:c0d:b0:df4:8ab4:d8bf with SMTP id 3f1490d57ef6-df7721a50b6mr1984616276.33.1716547299257; Fri, 24 May 2024 03:41:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240226065113.1690534-1-nick.hu@sifive.com> In-Reply-To: From: Ulf Hansson Date: Fri, 24 May 2024 12:41:03 +0200 Message-ID: Subject: Re: [PATCH] cpuidle: riscv-sbi: Add cluster_pm_enter()/exit() To: Anup Patel , Nick Hu Cc: Anup Patel , palmer@dabbelt.com, rafael@kernel.org, daniel.lezcano@linaro.org, paul.walmsley@sifive.com, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, zong.li@sifive.com, Cyan Yang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 17 May 2024 at 06:39, Anup Patel wrote: > > On Thu, May 16, 2024 at 9:40=E2=80=AFAM Nick Hu wrot= e: > > > > Hi Anup > > > > On Wed, May 15, 2024 at 9:46=E2=80=AFPM Anup Patel wrote: > > > > > > Hi Nick, > > > > > > On Wed, May 15, 2024 at 5:45=E2=80=AFPM Nick Hu = wrote: > > > > > > > > Hi Anup, > > > > > > > > Thank you for your guidance. > > > > After enabling the debug message, we found a way to solve the probl= em > > > > by the following steps: > > > > 1. Add a compatible string in 'power-domains' node otherwise it won= 't > > > > be the supplier of the consumers. (See of_link_to_phandle()) > > > > > > Hmm, requiring a compatible string is odd. Where should we document > > > this compatible string ? > > > > > Sorry, this is my fault. I didn't include some updates in > > of_link_to_phandle(). This led some misunderstandings here. > > You are right, we don't need it. > > The supplier will be linked to the CLUSTER_PD node. > > > > > > 2. Move the 'power-domains' node outside the 'cpus' node otherwise = it > > > > won't be added to the device hierarchy by device_add(). > > > > 3. Update the cpuidle-riscv-sbi driver to get the pds_node from > > > > '/power-domains'. > > > > > > By adding a compatible string and moving the "power-domains" node > > > outside, you are simply forcing the OF framework to populate devices. > > > > > > How about manually creating platform_device for each power-domain > > > DT node using of_platform_device_create() in sbi_pd_init() ? > > > > > Thanks for the suggestion! We have test the solution and it could work. > > We was wondering if it's feasible for us to relocate the > > 'power-domains' node outside of the /cpus? The CLUSTER_PD might > > encompass not only the CPUs but also other components within the > > cluster. > > The cpuidle-riscv-sbi driver expects "power-domains" DT node > under "/cpus" DT node because this driver only deals with power > domains related to CPU cluster or CPU cache-hierarchy. It does > make sense to define L2/L3 power domains under > "/cpus/power-domain" since these are related to CPUs. > > Moving the CPU "power-domains" DT node directly under "/" or > somewhere else would mean that it covers system-wide power > domains which is not true. I understand your point, but I am not convinced that the power-domains need to belong to the "cpus" node. Ideally, the power-domain describes the power-rail and the interface to manage the CPUs, this can surely be described outside the "cpus" node - even if there are only CPUs that are using it. Moreover, moving forward, one should not be surprised if it turns out that a platform has other devices than the CPUs, sharing the same power-rail as the CPU cluster. At least, we have that for arm/psci [1]. > > I suggest we continue using "/cpus/power-domains" DT node > only for power domains related to CPU clusters or CPU > cache-hierarchy. > > For system wide power domains of SoC devices, we can either: > 1) Use device power domains through the SBI MPXY extension > via different driver > 2) Use a platform specific driver > > > > > We also look at cpuidle_psci_domain driver and it seems Arm doesn't > > create the devices for each subnode of psci domain. > > Is there any reason that they don't need it? We don't need it for arm as we have a separate node for PSCI and its power-domains [2]. Moreover, we have a separate driver that manages the power-domain (cpuidle-psci-domain). [...] [1] arch/arm64/boot/dts/qcom/sc7280.dtsi (search for "CLUSTER_PD") [2] Documentation/devicetree/bindings/arm/psci.yaml Kind regards Uffe