* [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101
@ 2025-10-06 16:43 André Draszik
2025-10-06 16:43 ` [PATCH 01/10] dt-bindings: power: samsung: add google,gs101-pd André Draszik
` (9 more replies)
0 siblings, 10 replies; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
Hi,
This series adds support for the power domains on Google GS101. It's
fairly similar to SoCs already supported by this driver, except that
register acces does not work via plain ioremap() / readl() / writel().
Instead, the regmap created by the PMU driver must be used (which uses
Arm SMCC calls under the hood).
The DT update to add the new required properties on gs101 will be
posted separately.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
André Draszik (10):
dt-bindings: power: samsung: add google,gs101-pd
dt-bindings: soc: samsung: exynos-pmu: allow power domains as child on g101
pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling
pmdomain: samsung: convert to using regmap
pmdomain: samsung: convert to regmap_read_poll_timeout()
pmdomain: samsung: don't hardcode offset for registers to 0 and 4
pmdomain: samsung: selectively handle enforced sync_state
pmdomain: samsung: try to get PMU (syscon) regmap
pmdomain: samsung: use dev_err() instead of pr_err()
pmdomain: samsung: add support for google,gs101-pd
.../devicetree/bindings/power/pd-samsung.yaml | 1 +
.../bindings/soc/samsung/exynos-pmu.yaml | 53 ++++++++-
drivers/pmdomain/samsung/exynos-pm-domains.c | 126 +++++++++++++++------
3 files changed, 145 insertions(+), 35 deletions(-)
---
base-commit: a5f97c90e75f09f24ece2dca34168722b140a798
change-id: 20251001-gs101-pd-d4dc97d70a84
Best regards,
--
André Draszik <andre.draszik@linaro.org>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 01/10] dt-bindings: power: samsung: add google,gs101-pd
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-07 20:46 ` Peter Griffin
2025-10-06 16:43 ` [PATCH 02/10] dt-bindings: soc: samsung: exynos-pmu: allow power domains as child on g101 André Draszik
` (8 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
Add support for the Google gs101 version of the Exynos power domains. A
new compatible is needed because register fields have changed.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
Documentation/devicetree/bindings/power/pd-samsung.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/power/pd-samsung.yaml b/Documentation/devicetree/bindings/power/pd-samsung.yaml
index 9c2c51133457112ca0098c043e123f0a02fa1291..c35c9cb0115d79e5c36142da2c2a5dd30cd2ad47 100644
--- a/Documentation/devicetree/bindings/power/pd-samsung.yaml
+++ b/Documentation/devicetree/bindings/power/pd-samsung.yaml
@@ -19,6 +19,7 @@ allOf:
properties:
compatible:
enum:
+ - google,gs101-pd
- samsung,exynos4210-pd
- samsung,exynos5433-pd
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 02/10] dt-bindings: soc: samsung: exynos-pmu: allow power domains as child on g101
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
2025-10-06 16:43 ` [PATCH 01/10] dt-bindings: power: samsung: add google,gs101-pd André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-09 0:09 ` Krzysztof Kozlowski
2025-10-06 16:43 ` [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling André Draszik
` (7 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
The power domains are a property of / implemented in the PMU. As such,
they should be modelled as child nodes of the PMU.
Update the example while at it.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
Note: Ideally, the newly added properties (ranges, etc.) should only be
'required' if "^power-domain@[0-9a-f]+$" exists as a patternProperty,
as they're needed only in that case. As-is, this patch now causes
warnings for existing DTs as they don't specify the new properties (and
they shouldn't need to). Only if DTs are updated to include
power-domains, such an update should also add the new properties.
I've not been able to come up with the correct schema syntax to achieve
that. dependencies, dependentRequired, and dependentSchemas don't seem
to support patterns. Similarly,
- if:
required:
- ...
then:
required:
- ...
doesn't allow patterns in the 'if' block (or I didn't get the syntax
right).
---
.../bindings/soc/samsung/exynos-pmu.yaml | 53 +++++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml
index f0fb24156da9b8980dcfd5339ae75f12a71cf6d6..c2db1cbb969a9a6fea5208dc2990f2144fa480e6 100644
--- a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml
+++ b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml
@@ -93,6 +93,14 @@ properties:
minItems: 1
maxItems: 32
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 1
+
+ ranges: true
+
dp-phy:
$ref: /schemas/phy/samsung,dp-video-phy.yaml
unevaluatedProperties: false
@@ -138,7 +146,7 @@ required:
- compatible
- reg
-additionalProperties: false
+unevaluatedProperties: false
allOf:
- if:
@@ -201,10 +209,27 @@ allOf:
enum:
- google,gs101-pmu
then:
+ patternProperties:
+ "^power-domain@[0-9a-f]+$":
+ type: object
+ description: Child node describing one power domain within the PMU
+
+ additionalProperties: true
+
+ properties:
+ compatible:
+ const: google,gs101-pd
+
required:
+ - '#address-cells'
+ - '#size-cells'
+ - ranges
- google,pmu-intr-gen-syscon
else:
properties:
+ '#address-cells': false
+ '#size-cells': false
+ ranges: false
google,pmu-intr-gen-syscon: false
examples:
@@ -231,3 +256,29 @@ examples:
#phy-cells = <1>;
};
};
+
+ - |
+ system-controller@17460000 {
+ compatible = "google,gs101-pmu", "syscon";
+ reg = <0x17460000 0x10000>;
+ ranges;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ google,pmu-intr-gen-syscon = <&pmu_intr_gen>;
+
+ pd_g3d: power-domain@1e00 {
+ compatible = "google,gs101-pd";
+ reg = <0x1e00 0x80>;
+ #power-domain-cells = <0>;
+ label = "g3d";
+ };
+
+ power-domain@2000 {
+ compatible = "google,gs101-pd";
+ reg = <0x2000 0x80>;
+ #power-domain-cells = <0>;
+ power-domains = <&pd_g3d>;
+ label = "embedded_g3d";
+ };
+ };
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
2025-10-06 16:43 ` [PATCH 01/10] dt-bindings: power: samsung: add google,gs101-pd André Draszik
2025-10-06 16:43 ` [PATCH 02/10] dt-bindings: soc: samsung: exynos-pmu: allow power domains as child on g101 André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-07 20:53 ` Peter Griffin
2025-10-09 0:13 ` Krzysztof Kozlowski
2025-10-06 16:43 ` [PATCH 04/10] pmdomain: samsung: convert to using regmap André Draszik
` (6 subsequent siblings)
9 siblings, 2 replies; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
Convert to using devm_kstrdup_const() so as to simplify cleanup during
error handling.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/pmdomain/samsung/exynos-pm-domains.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
index 5d478bb37ad68afc7aed7c6ae19b5fefc94a9035..f53e1bd2479807988f969774b4b7b4c5739c1aba 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -92,13 +92,14 @@ static const struct of_device_id exynos_pm_domain_of_match[] = {
{ },
};
-static const char *exynos_get_domain_name(struct device_node *node)
+static const char *exynos_get_domain_name(struct device *dev,
+ struct device_node *node)
{
const char *name;
if (of_property_read_string(node, "label", &name) < 0)
name = kbasename(node->full_name);
- return kstrdup_const(name, GFP_KERNEL);
+ return devm_kstrdup_const(dev, name, GFP_KERNEL);
}
static int exynos_pd_probe(struct platform_device *pdev)
@@ -115,15 +116,13 @@ static int exynos_pd_probe(struct platform_device *pdev)
if (!pd)
return -ENOMEM;
- pd->pd.name = exynos_get_domain_name(np);
+ pd->pd.name = exynos_get_domain_name(dev, np);
if (!pd->pd.name)
return -ENOMEM;
pd->base = of_iomap(np, 0);
- if (!pd->base) {
- kfree_const(pd->pd.name);
+ if (!pd->base)
return -ENODEV;
- }
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 04/10] pmdomain: samsung: convert to using regmap
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
` (2 preceding siblings ...)
2025-10-06 16:43 ` [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-06 16:43 ` [PATCH 05/10] pmdomain: samsung: convert to regmap_read_poll_timeout() André Draszik
` (5 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
On platforms such as Google gs101, direct mmio register access to the
PMU registers doesn't necessarily work and access must happen via a
(syscon) regmap created by the PMU driver instead.
In preparation for supporting such SoCs convert the existing mmio
accesses to using a regmap wrapper.
With this change in place, a follow-up patch can update the driver to
optionally acquire the PMU-created regmap without having to change the
rest of the code.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
There is one checkpatch warning, relating to the non-const
regmap_config. It can a) not be made const without resorting to having
two copies and copying, and b) will go away in a follow-up patch
anyway.
---
drivers/pmdomain/samsung/exynos-pm-domains.c | 78 ++++++++++++++++++++--------
1 file changed, 57 insertions(+), 21 deletions(-)
diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
index f53e1bd2479807988f969774b4b7b4c5739c1aba..383126245811cb8e4dbae3b99ced3f06d3093f35 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -9,15 +9,14 @@
// conjunction with runtime-pm. Support for both device-tree and non-device-tree
// based power domain support is included.
-#include <linux/io.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/pm_domain.h>
#include <linux/delay.h>
#include <linux/of.h>
-#include <linux/of_address.h>
#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
struct exynos_pm_domain_config {
/* Value for LOCAL_PWR_CFG and STATUS fields for each domain */
@@ -28,7 +27,7 @@ struct exynos_pm_domain_config {
* Exynos specific wrapper around the generic power domain
*/
struct exynos_pm_domain {
- void __iomem *base;
+ struct regmap *regmap;
struct generic_pm_domain pd;
u32 local_pwr_cfg;
};
@@ -36,31 +35,37 @@ struct exynos_pm_domain {
static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
{
struct exynos_pm_domain *pd;
- void __iomem *base;
u32 timeout, pwr;
- char *op;
+ int err;
pd = container_of(domain, struct exynos_pm_domain, pd);
- base = pd->base;
pwr = power_on ? pd->local_pwr_cfg : 0;
- writel_relaxed(pwr, base);
+ err = regmap_write(pd->regmap, 0, pwr);
+ if (err)
+ return err;
/* Wait max 1ms */
timeout = 10;
-
- while ((readl_relaxed(base + 0x4) & pd->local_pwr_cfg) != pwr) {
- if (!timeout) {
- op = (power_on) ? "enable" : "disable";
- pr_err("Power domain %s %s failed\n", domain->name, op);
- return -ETIMEDOUT;
+ while (timeout-- > 0) {
+ unsigned int val;
+
+ err = regmap_read(pd->regmap, 0x4, &val);
+ if (err || ((val & pd->local_pwr_cfg) != pwr)) {
+ cpu_relax();
+ usleep_range(80, 100);
+ continue;
}
- timeout--;
- cpu_relax();
- usleep_range(80, 100);
+
+ return 0;
}
- return 0;
+ if (!err)
+ err = -ETIMEDOUT;
+ pr_err("Power domain %s %sable failed: %d\n", domain->name,
+ power_on ? "en" : "dis", err);
+
+ return err;
}
static int exynos_pd_power_on(struct generic_pm_domain *domain)
@@ -109,8 +114,18 @@ static int exynos_pd_probe(struct platform_device *pdev)
struct device_node *np = dev->of_node;
struct of_phandle_args child, parent;
struct exynos_pm_domain *pd;
+ struct resource *res;
+ void __iomem *base;
+ unsigned int val;
int on, ret;
+ struct regmap_config reg_config = {
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+ .use_relaxed_mmio = true,
+ };
+
pm_domain_cfg = of_device_get_match_data(dev);
pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
if (!pd)
@@ -120,15 +135,36 @@ static int exynos_pd_probe(struct platform_device *pdev)
if (!pd->pd.name)
return -ENOMEM;
- pd->base = of_iomap(np, 0);
- if (!pd->base)
- return -ENODEV;
+ /*
+ * The resource typically points into the address space of the PMU.
+ * Therefore, avoid using devm_platform_get_and_ioremap_resource() and
+ * instead use platform_get_resource() and devm_ioremap() to avoid
+ * conflicts due to address space overlap.
+ */
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
+ return dev_err_probe(dev, -ENXIO, "missing IO resources");
+
+ base = devm_ioremap(dev, res->start, resource_size(res));
+ if (!base)
+ return dev_err_probe(dev, -ENOMEM,
+ "failed to ioremap PMU registers");
+
+ reg_config.max_register = resource_size(res) - reg_config.reg_stride;
+ pd->regmap = devm_regmap_init_mmio(dev, base, ®_config);
+ if (IS_ERR(pd->regmap))
+ return dev_err_probe(dev, PTR_ERR(base),
+ "failed to init regmap");
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg;
- on = readl_relaxed(pd->base + 0x4) & pd->local_pwr_cfg;
+ ret = regmap_read(pd->regmap, 0x4, &val);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to read status");
+
+ on = val & pd->local_pwr_cfg;
pm_genpd_init(&pd->pd, NULL, !on);
ret = of_genpd_add_provider_simple(np, &pd->pd);
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 05/10] pmdomain: samsung: convert to regmap_read_poll_timeout()
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
` (3 preceding siblings ...)
2025-10-06 16:43 ` [PATCH 04/10] pmdomain: samsung: convert to using regmap André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-06 16:43 ` [PATCH 06/10] pmdomain: samsung: don't hardcode offset for registers to 0 and 4 André Draszik
` (4 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
Replace the open-coded PD status polling with
regmap_read_poll_timeout(). This change simplifies the code without
altering functionality.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/pmdomain/samsung/exynos-pm-domains.c | 29 ++++++++--------------------
1 file changed, 8 insertions(+), 21 deletions(-)
diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
index 383126245811cb8e4dbae3b99ced3f06d3093f35..431548ad9a7e40c0a77ac6672081b600c90ddd4e 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -13,7 +13,6 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/pm_domain.h>
-#include <linux/delay.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
@@ -35,7 +34,8 @@ struct exynos_pm_domain {
static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
{
struct exynos_pm_domain *pd;
- u32 timeout, pwr;
+ unsigned int val;
+ u32 pwr;
int err;
pd = container_of(domain, struct exynos_pm_domain, pd);
@@ -45,25 +45,12 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
if (err)
return err;
- /* Wait max 1ms */
- timeout = 10;
- while (timeout-- > 0) {
- unsigned int val;
-
- err = regmap_read(pd->regmap, 0x4, &val);
- if (err || ((val & pd->local_pwr_cfg) != pwr)) {
- cpu_relax();
- usleep_range(80, 100);
- continue;
- }
-
- return 0;
- }
-
- if (!err)
- err = -ETIMEDOUT;
- pr_err("Power domain %s %sable failed: %d\n", domain->name,
- power_on ? "en" : "dis", err);
+ err = regmap_read_poll_timeout(pd->regmap, 0x4, val,
+ (val & pd->local_pwr_cfg) == pwr,
+ 100, 1 * USEC_PER_MSEC);
+ if (err)
+ pr_err("Power domain %s %sable failed: %d (%#.2x)\n",
+ domain->name, power_on ? "en" : "dis", err, val);
return err;
}
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 06/10] pmdomain: samsung: don't hardcode offset for registers to 0 and 4
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
` (4 preceding siblings ...)
2025-10-06 16:43 ` [PATCH 05/10] pmdomain: samsung: convert to regmap_read_poll_timeout() André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-06 16:43 ` [PATCH 07/10] pmdomain: samsung: selectively handle enforced sync_state André Draszik
` (3 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
On platforms such as Google gs101, direct mmio register access to the
PMU registers doesn't necessarily work and access must happen via a
(syscon) regmap created by the PMU driver instead.
When such a regmap is used it will cover the complete PMU memory region
rather than individual power domains. This means the register offsets
for the configuration and status registers will have to take the power
domain offsets into account, rather than unconditionally hardcoding 0
and 4 respectively.
Update the code to allow that.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/pmdomain/samsung/exynos-pm-domains.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
index 431548ad9a7e40c0a77ac6672081b600c90ddd4e..638d286b57f716140b2401092415644a6805870e 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -29,6 +29,8 @@ struct exynos_pm_domain {
struct regmap *regmap;
struct generic_pm_domain pd;
u32 local_pwr_cfg;
+ u32 configuration_reg;
+ u32 status_reg;
};
static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
@@ -41,11 +43,11 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
pd = container_of(domain, struct exynos_pm_domain, pd);
pwr = power_on ? pd->local_pwr_cfg : 0;
- err = regmap_write(pd->regmap, 0, pwr);
+ err = regmap_write(pd->regmap, pd->configuration_reg, pwr);
if (err)
return err;
- err = regmap_read_poll_timeout(pd->regmap, 0x4, val,
+ err = regmap_read_poll_timeout(pd->regmap, pd->status_reg, val,
(val & pd->local_pwr_cfg) == pwr,
100, 1 * USEC_PER_MSEC);
if (err)
@@ -146,8 +148,10 @@ static int exynos_pd_probe(struct platform_device *pdev)
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg;
+ pd->configuration_reg += 0;
+ pd->status_reg += 4;
- ret = regmap_read(pd->regmap, 0x4, &val);
+ ret = regmap_read(pd->regmap, pd->status_reg, &val);
if (ret)
return dev_err_probe(dev, ret, "failed to read status");
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 07/10] pmdomain: samsung: selectively handle enforced sync_state
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
` (5 preceding siblings ...)
2025-10-06 16:43 ` [PATCH 06/10] pmdomain: samsung: don't hardcode offset for registers to 0 and 4 André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-09 0:15 ` Krzysztof Kozlowski
2025-10-06 16:43 ` [PATCH 08/10] pmdomain: samsung: try to get PMU (syscon) regmap André Draszik
` (2 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
Unconditionally calling of_genpd_sync_state() causes issues on
platforms with child domains as the parent domain will be turned off
before the child domain was even registered during boot.
This in particular is an issue for the upcoming Google gs101 support -
all operations on child domains registered after the parent domain
misbehave.
Add a flag to the probe data to be able to sync_state conditionally
only, and enable that flag on the two platforms currently supported by
this driver.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/pmdomain/samsung/exynos-pm-domains.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
index 638d286b57f716140b2401092415644a6805870e..5a87802cff394945cb0202d08f2cf6bcbbcc774d 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -20,6 +20,7 @@
struct exynos_pm_domain_config {
/* Value for LOCAL_PWR_CFG and STATUS fields for each domain */
u32 local_pwr_cfg;
+ unsigned int need_early_sync_state:1;
};
/*
@@ -69,10 +70,12 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain)
static const struct exynos_pm_domain_config exynos4210_cfg = {
.local_pwr_cfg = 0x7,
+ .need_early_sync_state = true,
};
static const struct exynos_pm_domain_config exynos5433_cfg = {
.local_pwr_cfg = 0xf,
+ .need_early_sync_state = true,
};
static const struct of_device_id exynos_pm_domain_of_match[] = {
@@ -179,7 +182,7 @@ static int exynos_pd_probe(struct platform_device *pdev)
* reset during boot. As a temporary hack to manage this, let's enforce
* a sync_state.
*/
- if (!ret)
+ if (pm_domain_cfg->need_early_sync_state && !ret)
of_genpd_sync_state(np);
pm_runtime_enable(dev);
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 08/10] pmdomain: samsung: try to get PMU (syscon) regmap
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
` (6 preceding siblings ...)
2025-10-06 16:43 ` [PATCH 07/10] pmdomain: samsung: selectively handle enforced sync_state André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-06 16:43 ` [PATCH 09/10] pmdomain: samsung: use dev_err() instead of pr_err() André Draszik
2025-10-06 16:43 ` [PATCH 10/10] pmdomain: samsung: add support for google,gs101-pd André Draszik
9 siblings, 0 replies; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
On platforms such as Google gs101, direct mmio register access to the
PMU registers doesn't necessarily work and access must happen via a
(syscon) regmap created by the PMU driver instead.
Try to obtain this regmap using the parent node in DT in case this PD
is a child of the PMU and fall back to the traditional direct mmio
regmap otherwise.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/pmdomain/samsung/exynos-pm-domains.c | 58 ++++++++++++++++++----------
1 file changed, 38 insertions(+), 20 deletions(-)
diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
index 5a87802cff394945cb0202d08f2cf6bcbbcc774d..c1b5830b2ad3e8b272dcc8ebc364be49aa7fda7c 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -12,6 +12,7 @@
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
+#include <linux/mfd/syscon.h>
#include <linux/pm_domain.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
@@ -107,17 +108,9 @@ static int exynos_pd_probe(struct platform_device *pdev)
struct of_phandle_args child, parent;
struct exynos_pm_domain *pd;
struct resource *res;
- void __iomem *base;
unsigned int val;
int on, ret;
- struct regmap_config reg_config = {
- .reg_bits = 32,
- .val_bits = 32,
- .reg_stride = 4,
- .use_relaxed_mmio = true,
- };
-
pm_domain_cfg = of_device_get_match_data(dev);
pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
if (!pd)
@@ -128,25 +121,50 @@ static int exynos_pd_probe(struct platform_device *pdev)
return -ENOMEM;
/*
- * The resource typically points into the address space of the PMU.
+ * The resource typically points into the address space of the PMU and
+ * we have to consider two cases:
+ * 1) some implementations require a custom syscon regmap
+ * 2) this driver might map the same addresses as the PMU driver
* Therefore, avoid using devm_platform_get_and_ioremap_resource() and
- * instead use platform_get_resource() and devm_ioremap() to avoid
+ * instead use platform_get_resource() here, and below for case 1) use
+ * syscon_node_to_regmap() while for case 2) use devm_ioremap() to avoid
* conflicts due to address space overlap.
*/
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return dev_err_probe(dev, -ENXIO, "missing IO resources");
- base = devm_ioremap(dev, res->start, resource_size(res));
- if (!base)
- return dev_err_probe(dev, -ENOMEM,
- "failed to ioremap PMU registers");
-
- reg_config.max_register = resource_size(res) - reg_config.reg_stride;
- pd->regmap = devm_regmap_init_mmio(dev, base, ®_config);
- if (IS_ERR(pd->regmap))
- return dev_err_probe(dev, PTR_ERR(base),
- "failed to init regmap");
+ if (dev->parent &&
+ of_device_is_compatible(dev->parent->of_node, "syscon")) {
+ pd->regmap = syscon_node_to_regmap(dev->parent->of_node);
+ if (IS_ERR(pd->regmap))
+ return dev_err_probe(dev, PTR_ERR(pd->regmap),
+ "failed to acquire PMU regmap");
+
+ pd->configuration_reg = res->start;
+ pd->status_reg = res->start;
+ } else {
+ void __iomem *base;
+
+ const struct regmap_config reg_config = {
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+ .use_relaxed_mmio = true,
+ .max_register = (resource_size(res)
+ - reg_config.reg_stride),
+ };
+
+ base = devm_ioremap(dev, res->start, resource_size(res));
+ if (!base)
+ return dev_err_probe(dev, -ENOMEM,
+ "failed to ioremap PMU registers");
+
+ pd->regmap = devm_regmap_init_mmio(dev, base, ®_config);
+ if (IS_ERR(pd->regmap))
+ return dev_err_probe(dev, PTR_ERR(base),
+ "failed to init regmap");
+ }
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 09/10] pmdomain: samsung: use dev_err() instead of pr_err()
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
` (7 preceding siblings ...)
2025-10-06 16:43 ` [PATCH 08/10] pmdomain: samsung: try to get PMU (syscon) regmap André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-09 0:18 ` Krzysztof Kozlowski
2025-10-06 16:43 ` [PATCH 10/10] pmdomain: samsung: add support for google,gs101-pd André Draszik
9 siblings, 1 reply; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
dev_err() gives us more consistent error messages, which include the
device. Switch to using dev_err().
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/pmdomain/samsung/exynos-pm-domains.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
index c1b5830b2ad3e8b272dcc8ebc364be49aa7fda7c..06e1b0eaca18205a549c8e8136ee15279eb3089d 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -29,6 +29,7 @@ struct exynos_pm_domain_config {
*/
struct exynos_pm_domain {
struct regmap *regmap;
+ struct device *dev;
struct generic_pm_domain pd;
u32 local_pwr_cfg;
u32 configuration_reg;
@@ -53,8 +54,9 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
(val & pd->local_pwr_cfg) == pwr,
100, 1 * USEC_PER_MSEC);
if (err)
- pr_err("Power domain %s %sable failed: %d (%#.2x)\n",
- domain->name, power_on ? "en" : "dis", err, val);
+ dev_err(pd->dev,
+ "Power domain %s %sable failed: %d (%#.2x)\n",
+ domain->name, power_on ? "en" : "dis", err, val);
return err;
}
@@ -116,6 +118,8 @@ static int exynos_pd_probe(struct platform_device *pdev)
if (!pd)
return -ENOMEM;
+ pd->dev = dev;
+
pd->pd.name = exynos_get_domain_name(dev, np);
if (!pd->pd.name)
return -ENOMEM;
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 10/10] pmdomain: samsung: add support for google,gs101-pd
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
` (8 preceding siblings ...)
2025-10-06 16:43 ` [PATCH 09/10] pmdomain: samsung: use dev_err() instead of pr_err() André Draszik
@ 2025-10-06 16:43 ` André Draszik
2025-10-09 0:19 ` Krzysztof Kozlowski
9 siblings, 1 reply; 22+ messages in thread
From: André Draszik @ 2025-10-06 16:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, André Draszik
Compared to other previous designs supported by this driver, the status
is just one bit. There is nothing unusual here.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/pmdomain/samsung/exynos-pm-domains.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
index 06e1b0eaca18205a549c8e8136ee15279eb3089d..9e62da2162884fbc1f4b3809cdd89181fb534095 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -81,8 +81,15 @@ static const struct exynos_pm_domain_config exynos5433_cfg = {
.need_early_sync_state = true,
};
+static const struct exynos_pm_domain_config gs101_cfg = {
+ .local_pwr_cfg = BIT(0),
+};
+
static const struct of_device_id exynos_pm_domain_of_match[] = {
{
+ .compatible = "google,gs101-pd",
+ .data = &gs101_cfg,
+ }, {
.compatible = "samsung,exynos4210-pd",
.data = &exynos4210_cfg,
}, {
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 01/10] dt-bindings: power: samsung: add google,gs101-pd
2025-10-06 16:43 ` [PATCH 01/10] dt-bindings: power: samsung: add google,gs101-pd André Draszik
@ 2025-10-07 20:46 ` Peter Griffin
0 siblings, 0 replies; 22+ messages in thread
From: Peter Griffin @ 2025-10-07 20:46 UTC (permalink / raw)
To: André Draszik
Cc: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson, Tudor Ambarus, Will McVicker,
kernel-team, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm
On Mon, 6 Oct 2025 at 17:43, André Draszik <andre.draszik@linaro.org> wrote:
>
> Add support for the Google gs101 version of the Exynos power domains. A
> new compatible is needed because register fields have changed.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling
2025-10-06 16:43 ` [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling André Draszik
@ 2025-10-07 20:53 ` Peter Griffin
2025-10-09 0:13 ` Krzysztof Kozlowski
1 sibling, 0 replies; 22+ messages in thread
From: Peter Griffin @ 2025-10-07 20:53 UTC (permalink / raw)
To: André Draszik
Cc: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson, Tudor Ambarus, Will McVicker,
kernel-team, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm
On Mon, 6 Oct 2025 at 17:43, André Draszik <andre.draszik@linaro.org> wrote:
>
> Convert to using devm_kstrdup_const() so as to simplify cleanup during
> error handling.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 02/10] dt-bindings: soc: samsung: exynos-pmu: allow power domains as child on g101
2025-10-06 16:43 ` [PATCH 02/10] dt-bindings: soc: samsung: exynos-pmu: allow power domains as child on g101 André Draszik
@ 2025-10-09 0:09 ` Krzysztof Kozlowski
0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-09 0:09 UTC (permalink / raw)
To: André Draszik, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm
On 07/10/2025 01:43, André Draszik wrote:
> The power domains are a property of / implemented in the PMU. As such,
> they should be modelled as child nodes of the PMU.
>
> Update the example while at it.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
>
> ---
> Note: Ideally, the newly added properties (ranges, etc.) should only be
> 'required' if "^power-domain@[0-9a-f]+$" exists as a patternProperty,
> as they're needed only in that case. As-is, this patch now causes
> warnings for existing DTs as they don't specify the new properties (and
> they shouldn't need to). Only if DTs are updated to include
> power-domains, such an update should also add the new properties.
>
> I've not been able to come up with the correct schema syntax to achieve
> that. dependencies, dependentRequired, and dependentSchemas don't seem
> to support patterns. Similarly,
> - if:
> required:
> - ...
> then:
> required:
> - ...
>
> doesn't allow patterns in the 'if' block (or I didn't get the syntax
> right).
> ---
> .../bindings/soc/samsung/exynos-pmu.yaml | 53 +++++++++++++++++++++-
> 1 file changed, 52 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml
> index f0fb24156da9b8980dcfd5339ae75f12a71cf6d6..c2db1cbb969a9a6fea5208dc2990f2144fa480e6 100644
> --- a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml
> +++ b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml
> @@ -93,6 +93,14 @@ properties:
> minItems: 1
> maxItems: 32
>
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 1
> +
> + ranges: true
> +
> dp-phy:
> $ref: /schemas/phy/samsung,dp-video-phy.yaml
> unevaluatedProperties: false
> @@ -138,7 +146,7 @@ required:
> - compatible
> - reg
>
> -additionalProperties: false
> +unevaluatedProperties: false
No. Properties must be defined in top level, as explained in writing
schema. If this is getting to complex, GS101 can be moved to its own
binding.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling
2025-10-06 16:43 ` [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling André Draszik
2025-10-07 20:53 ` Peter Griffin
@ 2025-10-09 0:13 ` Krzysztof Kozlowski
2025-10-09 13:31 ` André Draszik
1 sibling, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-09 0:13 UTC (permalink / raw)
To: André Draszik, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm
On 07/10/2025 01:43, André Draszik wrote:
> Convert to using devm_kstrdup_const() so as to simplify cleanup during
> error handling.
This is either a fix (then describe the fixed issue and add Fixed tag)
or you change the logic, not only simplify.
Previously on of_genpd_add_provider_simple() the memory was not
kfree_const. Now it will be.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 07/10] pmdomain: samsung: selectively handle enforced sync_state
2025-10-06 16:43 ` [PATCH 07/10] pmdomain: samsung: selectively handle enforced sync_state André Draszik
@ 2025-10-09 0:15 ` Krzysztof Kozlowski
0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-09 0:15 UTC (permalink / raw)
To: André Draszik, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm
On 07/10/2025 01:43, André Draszik wrote:
> Unconditionally calling of_genpd_sync_state() causes issues on
> platforms with child domains as the parent domain will be turned off
> before the child domain was even registered during boot.
>
> This in particular is an issue for the upcoming Google gs101 support -
> all operations on child domains registered after the parent domain
> misbehave.
>
> Add a flag to the probe data to be able to sync_state conditionally
> only, and enable that flag on the two platforms currently supported by
> this driver.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> drivers/pmdomain/samsung/exynos-pm-domains.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
> index 638d286b57f716140b2401092415644a6805870e..5a87802cff394945cb0202d08f2cf6bcbbcc774d 100644
> --- a/drivers/pmdomain/samsung/exynos-pm-domains.c
> +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
> @@ -20,6 +20,7 @@
> struct exynos_pm_domain_config {
> /* Value for LOCAL_PWR_CFG and STATUS fields for each domain */
> u32 local_pwr_cfg;
> + unsigned int need_early_sync_state:1;
Just bool
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 09/10] pmdomain: samsung: use dev_err() instead of pr_err()
2025-10-06 16:43 ` [PATCH 09/10] pmdomain: samsung: use dev_err() instead of pr_err() André Draszik
@ 2025-10-09 0:18 ` Krzysztof Kozlowski
0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-09 0:18 UTC (permalink / raw)
To: André Draszik, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm
On 07/10/2025 01:43, André Draszik wrote:
> dev_err() gives us more consistent error messages, which include the
> device. Switch to using dev_err().
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 10/10] pmdomain: samsung: add support for google,gs101-pd
2025-10-06 16:43 ` [PATCH 10/10] pmdomain: samsung: add support for google,gs101-pd André Draszik
@ 2025-10-09 0:19 ` Krzysztof Kozlowski
0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-09 0:19 UTC (permalink / raw)
To: André Draszik, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm
On 07/10/2025 01:43, André Draszik wrote:
> Compared to other previous designs supported by this driver, the status
> is just one bit. There is nothing unusual here.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> drivers/pmdomain/samsung/exynos-pm-domains.c | 7 +++++++
This should be squashed with patch #8. There is no point to handle
syscon parent regmap outside of GS.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling
2025-10-09 0:13 ` Krzysztof Kozlowski
@ 2025-10-09 13:31 ` André Draszik
2025-10-09 14:00 ` André Draszik
0 siblings, 1 reply; 22+ messages in thread
From: André Draszik @ 2025-10-09 13:31 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm
On Thu, 2025-10-09 at 09:13 +0900, Krzysztof Kozlowski wrote:
> On 07/10/2025 01:43, André Draszik wrote:
> > Convert to using devm_kstrdup_const() so as to simplify cleanup during
> > error handling.
>
>
> This is either a fix (then describe the fixed issue and add Fixed tag)
> or you change the logic, not only simplify.
>
> Previously on of_genpd_add_provider_simple() the memory was not
> kfree_const. Now it will be.
Indeed it's a fix after all - While the driver doesn't allow unbind,
I added this patch due to the followup patches that add potential error
returns during probe, but somehow missed an already-existing error
return after this call.
Thanks Krzysztof!
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling
2025-10-09 13:31 ` André Draszik
@ 2025-10-09 14:00 ` André Draszik
2025-10-10 0:35 ` Krzysztof Kozlowski
0 siblings, 1 reply; 22+ messages in thread
From: André Draszik @ 2025-10-09 14:00 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm
On Thu, 2025-10-09 at 14:31 +0100, André Draszik wrote:
> On Thu, 2025-10-09 at 09:13 +0900, Krzysztof Kozlowski wrote:
> > On 07/10/2025 01:43, André Draszik wrote:
> > > Convert to using devm_kstrdup_const() so as to simplify cleanup during
> > > error handling.
> >
> >
> > This is either a fix (then describe the fixed issue and add Fixed tag)
> > or you change the logic, not only simplify.
> >
> > Previously on of_genpd_add_provider_simple() the memory was not
> > kfree_const. Now it will be.
>
> Indeed it's a fix after all - While the driver doesn't allow unbind,
Thinking more about it - at this stage, this patch is not a fix. The driver
can not unbind, hence there is no leak to be plugged, hence no fix.
> I added this patch due to the followup patches that add potential error
> returns during probe,
since it makes the error paths in those follow-up patches simpler
> but somehow missed an already-existing error
> return after this call.
Ignore this last part. I forgot that I simplified this error path in this
patch myself :-)
So, I'm not sure how to rephrase, tbh.
Cheers,
A
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling
2025-10-09 14:00 ` André Draszik
@ 2025-10-10 0:35 ` Krzysztof Kozlowski
2025-10-10 5:29 ` André Draszik
0 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-10 0:35 UTC (permalink / raw)
To: André Draszik, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm
On 09/10/2025 23:00, André Draszik wrote:
> On Thu, 2025-10-09 at 14:31 +0100, André Draszik wrote:
>> On Thu, 2025-10-09 at 09:13 +0900, Krzysztof Kozlowski wrote:
>>> On 07/10/2025 01:43, André Draszik wrote:
>>>> Convert to using devm_kstrdup_const() so as to simplify cleanup during
>>>> error handling.
>>>
>>>
>>> This is either a fix (then describe the fixed issue and add Fixed tag)
>>> or you change the logic, not only simplify.
>>>
>>> Previously on of_genpd_add_provider_simple() the memory was not
>>> kfree_const. Now it will be.
>>
>> Indeed it's a fix after all - While the driver doesn't allow unbind,
>
> Thinking more about it - at this stage, this patch is not a fix. The driver
> can not unbind, hence there is no leak to be plugged, hence no fix.
It is about error paths. Driver can fail binding.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling
2025-10-10 0:35 ` Krzysztof Kozlowski
@ 2025-10-10 5:29 ` André Draszik
0 siblings, 0 replies; 22+ messages in thread
From: André Draszik @ 2025-10-10 5:29 UTC (permalink / raw)
To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson
Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm
On Fri, 2025-10-10 at 02:35 +0200, Krzysztof Kozlowski wrote:
> On 09/10/2025 23:00, André Draszik wrote:
> > On Thu, 2025-10-09 at 14:31 +0100, André Draszik wrote:
> > > On Thu, 2025-10-09 at 09:13 +0900, Krzysztof Kozlowski wrote:
> > > > On 07/10/2025 01:43, André Draszik wrote:
> > > > > Convert to using devm_kstrdup_const() so as to simplify cleanup during
> > > > > error handling.
> > > >
> > > >
> > > > This is either a fix (then describe the fixed issue and add Fixed tag)
> > > > or you change the logic, not only simplify.
> > > >
> > > > Previously on of_genpd_add_provider_simple() the memory was not
> > > > kfree_const. Now it will be.
> > >
> > > Indeed it's a fix after all - While the driver doesn't allow unbind,
> >
> > Thinking more about it - at this stage, this patch is not a fix. The driver
> > can not unbind, hence there is no leak to be plugged, hence no fix.
>
> It is about error paths. Driver can fail binding.
Thank you Krzysztof for your patience. Yes, I had overlooked that
of_genpd_add_provider_simple() itself can fail. Sorry for
the noise.
Cheers,
Andre'
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2025-10-10 5:29 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-06 16:43 [PATCH 00/10] pmdomain: samsung: add supoort for Google GS101 André Draszik
2025-10-06 16:43 ` [PATCH 01/10] dt-bindings: power: samsung: add google,gs101-pd André Draszik
2025-10-07 20:46 ` Peter Griffin
2025-10-06 16:43 ` [PATCH 02/10] dt-bindings: soc: samsung: exynos-pmu: allow power domains as child on g101 André Draszik
2025-10-09 0:09 ` Krzysztof Kozlowski
2025-10-06 16:43 ` [PATCH 03/10] pmdomain: samsung: use to devm_kstrdup_const() to simplify error handling André Draszik
2025-10-07 20:53 ` Peter Griffin
2025-10-09 0:13 ` Krzysztof Kozlowski
2025-10-09 13:31 ` André Draszik
2025-10-09 14:00 ` André Draszik
2025-10-10 0:35 ` Krzysztof Kozlowski
2025-10-10 5:29 ` André Draszik
2025-10-06 16:43 ` [PATCH 04/10] pmdomain: samsung: convert to using regmap André Draszik
2025-10-06 16:43 ` [PATCH 05/10] pmdomain: samsung: convert to regmap_read_poll_timeout() André Draszik
2025-10-06 16:43 ` [PATCH 06/10] pmdomain: samsung: don't hardcode offset for registers to 0 and 4 André Draszik
2025-10-06 16:43 ` [PATCH 07/10] pmdomain: samsung: selectively handle enforced sync_state André Draszik
2025-10-09 0:15 ` Krzysztof Kozlowski
2025-10-06 16:43 ` [PATCH 08/10] pmdomain: samsung: try to get PMU (syscon) regmap André Draszik
2025-10-06 16:43 ` [PATCH 09/10] pmdomain: samsung: use dev_err() instead of pr_err() André Draszik
2025-10-09 0:18 ` Krzysztof Kozlowski
2025-10-06 16:43 ` [PATCH 10/10] pmdomain: samsung: add support for google,gs101-pd André Draszik
2025-10-09 0:19 ` Krzysztof Kozlowski
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).