| Message ID | 20241024094930.3221729-1-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path:
<linux-amarula+bncBCQ4XFG47UFRBOVQ5C4AMGQEIXMEWVI@amarulasolutions.com>
X-Original-To: linux-amarula@patchwork.amarulasolutions.com
Delivered-To: linux-amarula@patchwork.amarulasolutions.com
Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com
[209.85.208.72])
by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5782C3F9F7
for <linux-amarula@patchwork.amarulasolutions.com>;
Thu, 24 Oct 2024 11:49:47 +0200 (CEST)
Received: by mail-ed1-f72.google.com with SMTP id
4fb4d7f45d1cf-5c947d9afc9sf478266a12.1
for <linux-amarula@patchwork.amarulasolutions.com>;
Thu, 24 Oct 2024 02:49:47 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1729763387; cv=pass;
d=google.com; s=arc-20240605;
b=Der0f23mSRT5pV5JHnWNXQDVUO1mK7uO9BRsbfdQ1fSH0Tg6bIC78R5PE6FDLrAtak
ca6pfboMU34uLWWb9UOxgpeYXwTocsnKwHa9k2uGdb5G1wuPkgPL+L1eWg43+Sr2ZW2s
GWjfC/IYX0tVdsLX73g5hcKipOizz3McojcScAY+hMRjPXFIO/ASQL6kCbBHlBgEHH5/
JeZ5QabXuQxdKIwISUPpdMyErtsGN82xMTJTyFw/4sNBJaNQ8b8mvZ222ThcGyBlJNUO
dH4wkUVETgN+DDASOaLF3eA1WBAXXnS/5wuh3F1Befwm/Nosv1VakMc6K93/FrIA/gqY
B9pQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:mime-version:message-id:date:subject:cc:to
:from:dkim-signature;
bh=4/ooKW9YpOv8gjnj5ktsFp8+p1N15xps+Ov89Loatzk=;
fh=vz79EV3yaifGASrvYkJPC8BOqj2eN1vELRjQPpZWHcw=;
b=gQAnJyHPuSWC8q3Zg9kobdiXe75EZpgSXm9BqPE0QD/jTQ00mdc9BhHtFMnDLW6119
Egt+NG7zyKleGbOXCAw0pkrWZz1j58H49CS7eacsGR9WpboWoT36JU5xb7H1XCDaJ/Ag
BcQN38b/ox2+mXEtlymE1Yi1p4+lMe7pVKHnYdw1u7gOahQAMYwj2f8f5G9i60Fq0uyo
daZXBhxBatrkxyMcwSecyUto1CGJq5pShVEaIAvOov1HNa4XJrylgf+8QGuz1PSC1cGt
rgrUeClmfcD69yPyFL8PMGp1BrO5M9SgO2Rin6syxhCDURY6lMGat23lsMzN527i34BA
/zhg==;
darn=patchwork.amarulasolutions.com
ARC-Authentication-Results: i=2; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=CG628dlQ;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=amarulasolutions.com; s=google; t=1729763387; x=1730368187;
darn=patchwork.amarulasolutions.com;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:x-original-authentication-results
:x-original-sender:mime-version:message-id:date:subject:cc:to:from
:from:to:cc:subject:date:message-id:reply-to;
bh=4/ooKW9YpOv8gjnj5ktsFp8+p1N15xps+Ov89Loatzk=;
b=muT388SIoauE9s2Dvb5sZJ5diLFm89VtWHIew+LhyT1yzTE+S4ls3h3AHjXQWaOnT6
Xv35UKKgCUQ6RaSatKZc20ZF2mMMcuoFEfRdGobwr1xaq6hB6LwdBh1T4DKyAen5TTXy
ze57eY76CjW9hw4wCyhzzbvql+e6qjKPePSHk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1729763387; x=1730368187;
h=list-unsubscribe:list-archive:list-help:list-post
:x-spam-checked-in-group:list-id:mailing-list:precedence
:x-original-authentication-results:x-original-sender:mime-version
:message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=4/ooKW9YpOv8gjnj5ktsFp8+p1N15xps+Ov89Loatzk=;
b=UD3a3lHxWRGhSVtKgYq3yYnxvQQVM40X1n5UNlv9oIHE5XeryvY/RHF9hgEXhpxutx
3tDd2vSSiITlnkEq41oYg6SoHYkcgnh6gD3As1EurMil5ioXvQC5VozpnMHjax8EzolA
V9FriV67rLleUPqc682O2Qms89JkRJEM9Cso7d6yjIbJzyQlDGSEgSmfQvq6YFKEriFg
DRS5gpzrCSI4vOiqc0oIRHz1fjs2chj2cyzsfAZWZgba9HY3OdUuIXRuXhZ/qYrMwdYB
c/ip3XxRz+vO9gfA3HUoq81P/he4MDMBnhr0Bo8oSBXloe6GhADkC6x+uELSVItHIaan
jyTA==
X-Forwarded-Encrypted: i=2;
AJvYcCVBPBocNI2MHWQI3TRenRK3ifz/n1K8S6EVXyWyi35PEkZQCwnGgLdspJtOwNAgOKhvYfaEo1q3UDHFLIK6@patchwork.amarulasolutions.com
X-Gm-Message-State: AOJu0Yxm3IfWTWOgxZ1Fb82vt6sVavWGU6/Bumx+QzbC5gDiHqcQ/YAH
sKSqMntria1ApMPB1UhVljCwuEW42Zo+airHa0hPohQTnEnc1ftHq0GbYIGrm/nLQg==
X-Google-Smtp-Source:
AGHT+IGUIjCrdPYQ8MC28Fly8IygJMMZrdaBsSC6RzCBDAnq8E08ZpVMMIL/8ydmtETAheuzeHFCJw==
X-Received: by 2002:a05:6402:3888:b0:5c9:6f20:4cf1 with SMTP id
4fb4d7f45d1cf-5cb8af7228amr4813884a12.27.1729763386547;
Thu, 24 Oct 2024 02:49:46 -0700 (PDT)
X-BeenThere: linux-amarula@amarulasolutions.com
Received: by 2002:a05:6402:524d:b0:5cb:73a6:e040 with SMTP id
4fb4d7f45d1cf-5cb9987a675ls521894a12.0.-pod-prod-03-eu; Thu, 24 Oct 2024
02:49:45 -0700 (PDT)
X-Received: by 2002:a17:907:3faa:b0:a9a:f0e:cd4 with SMTP id
a640c23a62f3a-a9abf964edemr587712366b.55.1729763384872;
Thu, 24 Oct 2024 02:49:44 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1729763384; cv=none;
d=google.com; s=arc-20240605;
b=YK1Q1KYA0dhQmjTGdEjBsGvlK56kmAXZCjf8+H5v9wDPSzEoyB4OC16Rsak1HSeyP4
KnPzOuLB+fV+ykW4hEJlskjkRhcF2CXXNOcP3ia/FUJiV0DEKuZhv8Z9037Jt+eXtgaS
cXSwo1vaqpufJleG7MVsfwtX1bVg2lHjCqB26h0COjAvA9+SsA0klrdCEyeGhmr52I2E
NrfTSMXZSOeCY9+a9zPLXQBDPOL8NFLqbnDxujXR7MUY0FgYoIvhCKzPACjpzaR0hdyf
1WoMm+xavcU7eI8myb1GOIx+bsiTBcuYMJAFm6ll+YySbz8w7na3qPcfGAKVVJ9GcZgW
nhmg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:dkim-signature;
bh=/FW13s10cjrJ6xBnvvtPrQKRLAFq+b81IIrkXP7L0g0=;
fh=BD1xuhwhFE/UCujL2sjsFOzfGPlv1p1Aao50IepD1IM=;
b=JFbXm6lA5H8aXlf/w1VDVrWXQj7/icCqeMjnH8XV5GHaeCU374GdTNHbEOC06ClJon
PeIBfk8MG0ribCqLrpkRqv8s4lkU4yHad6E25mlA1P0hVPacYRPY6EnpN3Hv0ESv0bzt
aAvSjFOjXVjVx1xu4Ww7zOEISaTjhB1GYIF1UWYbG2v9H7hoserW8/zxFMAorc1EbO7B
1zwKNW1pKIzCXagZFVKFSoDg3liAJ/OhPOyTb6N6fvlJStnT53vAyUVP6jMDQr1CaBa1
EYO7gbc7BY8sBgeUhBUo6v1/vbU+G6qfIHbICnNvm2XEdubiCvcpHKmEK8u03ZLD4A4S
qiag==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=CG628dlQ;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com.
[209.85.220.41])
by mx.google.com with SMTPS id
a640c23a62f3a-a9a91334f40sor336646766b.21.2024.10.24.02.49.44
for <linux-amarula@amarulasolutions.com>
(Google Transport Security);
Thu, 24 Oct 2024 02:49:44 -0700 (PDT)
Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a17:907:9494:b0:a9a:f82:7712 with SMTP id
a640c23a62f3a-a9abf92f3e4mr515408066b.52.1729763384359;
Thu, 24 Oct 2024 02:49:44 -0700 (PDT)
Received: from localhost.localdomain
([2001:b07:6474:ebbf:f79d:49dd:b804:3f48])
by smtp.gmail.com with ESMTPSA id
a640c23a62f3a-a9a912d6360sm593159066b.29.2024.10.24.02.49.43
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 24 Oct 2024 02:49:44 -0700 (PDT)
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: linux-amarula@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Michael Trimarchi <michael@amarulasolutions.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-pm@vger.kernel.org
Subject: [PATCH] pmdomain: core: fix "sd_count" field setting
Date: Thu, 24 Oct 2024 11:49:18 +0200
Message-ID: <20241024094930.3221729-1-dario.binacchi@amarulasolutions.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
X-Original-Sender: dario.binacchi@amarulasolutions.com
X-Original-Authentication-Results: mx.google.com; dkim=pass
header.i=@amarulasolutions.com header.s=google header.b=CG628dlQ;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
Content-Type: text/plain; charset="UTF-8"
Precedence: list
Mailing-list: list linux-amarula@amarulasolutions.com;
contact linux-amarula+owners@amarulasolutions.com
List-ID: <linux-amarula.amarulasolutions.com>
X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com
X-Google-Group-Id: 476853432473
List-Post:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>,
<mailto:linux-amarula@amarulasolutions.com>
List-Help:
<https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>,
<mailto:linux-amarula+help@amarulasolutions.com>
List-Archive:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/>
List-Unsubscribe:
<mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>,
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe>
|
| Series |
pmdomain: core: fix "sd_count" field setting
|
|
Commit Message
Dario Binacchi
Oct. 24, 2024, 9:49 a.m. UTC
The "sd_count" field keeps track of the number of subdomains with power "on," so if pm_genpd_init() is called with the "is_off" parameter set to false, it means that the power domain is already on, and therefore its "sd_count" must be 1. Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- drivers/pmdomain/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, 24 Oct 2024 at 11:49, Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > > The "sd_count" field keeps track of the number of subdomains with power > "on," so if pm_genpd_init() is called with the "is_off" parameter set to > false, it means that the power domain is already on, and therefore its > "sd_count" must be 1. genpd_sd_counter_inc() is being called when adding subdomains. Doesn't that work correctly for you? > > Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > Kind regards Uffe > --- > > drivers/pmdomain/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c > index 5ede0f7eda09..2df6dda98021 100644 > --- a/drivers/pmdomain/core.c > +++ b/drivers/pmdomain/core.c > @@ -2221,7 +2221,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd, > genpd_lock_init(genpd); > genpd->gov = gov; > INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn); > - atomic_set(&genpd->sd_count, 0); > + atomic_set(&genpd->sd_count, is_off ? 0 : 1); > genpd->status = is_off ? GENPD_STATE_OFF : GENPD_STATE_ON; > genpd->device_count = 0; > genpd->provider = NULL; > -- > 2.43.0 > To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Mon, Oct 28, 2024 at 2:34 PM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > On Thu, 24 Oct 2024 at 11:49, Dario Binacchi > <dario.binacchi@amarulasolutions.com> wrote: > > > > The "sd_count" field keeps track of the number of subdomains with power > > "on," so if pm_genpd_init() is called with the "is_off" parameter set to > > false, it means that the power domain is already on, and therefore its > > "sd_count" must be 1. > > genpd_sd_counter_inc() is being called when adding subdomains. Doesn't > that work correctly for you? In my use case the genpd_add_subdomain() is not called. I am working on : drivers/pmdomain/imx/gpcv2.c drivers/pmdomain/imx/imx8m-blk-ctrl.c Thanks and regards, Dario > > > > > Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com> > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > > Kind regards > Uffe > > > --- > > > > drivers/pmdomain/core.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c > > index 5ede0f7eda09..2df6dda98021 100644 > > --- a/drivers/pmdomain/core.c > > +++ b/drivers/pmdomain/core.c > > @@ -2221,7 +2221,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd, > > genpd_lock_init(genpd); > > genpd->gov = gov; > > INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn); > > - atomic_set(&genpd->sd_count, 0); > > + atomic_set(&genpd->sd_count, is_off ? 0 : 1); > > genpd->status = is_off ? GENPD_STATE_OFF : GENPD_STATE_ON; > > genpd->device_count = 0; > > genpd->provider = NULL; > > -- > > 2.43.0 > >
On Mon, 28 Oct 2024 at 16:07, Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > > On Mon, Oct 28, 2024 at 2:34 PM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > > > On Thu, 24 Oct 2024 at 11:49, Dario Binacchi > > <dario.binacchi@amarulasolutions.com> wrote: > > > > > > The "sd_count" field keeps track of the number of subdomains with power > > > "on," so if pm_genpd_init() is called with the "is_off" parameter set to > > > false, it means that the power domain is already on, and therefore its > > > "sd_count" must be 1. > > > > genpd_sd_counter_inc() is being called when adding subdomains. Doesn't > > that work correctly for you? > > In my use case the genpd_add_subdomain() is not called. > I am working on : > drivers/pmdomain/imx/gpcv2.c > drivers/pmdomain/imx/imx8m-blk-ctrl.c In that case you don't have a child-domain (subdomain), which means the sd_count should be 0. [...] Kind regards Uffe To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 5ede0f7eda09..2df6dda98021 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -2221,7 +2221,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd, genpd_lock_init(genpd); genpd->gov = gov; INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn); - atomic_set(&genpd->sd_count, 0); + atomic_set(&genpd->sd_count, is_off ? 0 : 1); genpd->status = is_off ? GENPD_STATE_OFF : GENPD_STATE_ON; genpd->device_count = 0; genpd->provider = NULL;