All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO
@ 2022-09-09  9:20 Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 01/15] dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs Krzysztof Kozlowski
                   ` (16 more replies)
  0 siblings, 17 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Hi,

Switch older Qualcomm SoCs to use MMIO-based method instead of syscon.

Not tested on hardware. Please kindly provide tests.

Changes since v2
================
1. Rebase on current MFD changes.
2. Add Rb tag.
3. Split MFD patch to separate patchset:
https://lore.kernel.org/linux-devicetree/20220909091056.128949-1-krzysztof.kozlowski@linaro.org/T/#u

Changes since v1
================
1. Use existing qcom,tcsr-msm8974 compatible.
2. Fix few other TCSR syscon compatibles (new patches: ipq6018, msm8953,
   qcs404, msm8996).
3. New patch: dt-bindings: mfd: qcom,tcsr: drop simple-mfd from IPQ6018
4. New patch: dt-bindings: mfd: qcom,tcsr: add QCS404

Dependencies
============
1. DT bindings and driver patches can go via hwlock. DTS via Bjorn/Qualcomm.

2. The last five DTS commits (ARM and arm64) named "switch TCSR mutex to MMIO"
   depend on driver support. The changes are not bisectable, just like
   previously such changes were not bisectable:
   https://lore.kernel.org/all/20200622075956.171058-5-bjorn.andersson@linaro.org/
   Therefore these changes could wait for next release.

Best regards,
Krzysztof

Krzysztof Kozlowski (15):
  dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older
    SoCs
  dt-bindings: hwlock: qcom-hwspinlock: correct example indentation
  hwspinlock: qcom: correct MMIO max register for newer SoCs
  hwspinlock: qcom: add support for MMIO on older SoCs
  arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible
  arm64: dts: qcom: msm8953: add missing TCSR syscon compatible
  arm64: dts: qcom: qcs404: add missing TCSR syscon compatible
  arm64: dts: qcom: msm8996: add missing TCSR syscon compatible
  ARM: dts: qcom: msm8974: add missing TCSR syscon compatible
  ARM: dts: qcom: msm8974: split TCSR halt regs out of mutex
  arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO
  arm64: dts: qcom: msm8994: switch TCSR mutex to MMIO
  ARM: dts: qcom: msm8974: switch TCSR mutex to MMIO
  ARM: dts: qcom: apq8084: switch TCSR mutex to MMIO
  ARM: dts: qcom: msm8226: switch TCSR mutex to MMIO

 .../bindings/hwlock/qcom-hwspinlock.yaml      | 25 +++++++----
 .../arm/boot/dts/qcom-apq8074-dragonboard.dts |  2 +-
 arch/arm/boot/dts/qcom-apq8084.dtsi           | 11 ++---
 arch/arm/boot/dts/qcom-msm8226.dtsi           | 14 ++-----
 .../qcom-msm8974-lge-nexus5-hammerhead.dts    |  2 +-
 .../dts/qcom-msm8974-sony-xperia-rhine.dtsi   |  2 +-
 arch/arm/boot/dts/qcom-msm8974.dtsi           | 25 ++++++-----
 .../dts/qcom-msm8974pro-fairphone-fp2.dts     |  2 +-
 .../boot/dts/qcom-msm8974pro-samsung-klte.dts |  2 +-
 ...-msm8974pro-sony-xperia-shinano-castor.dts |  2 +-
 arch/arm64/boot/dts/qcom/ipq6018.dtsi         | 15 +++----
 arch/arm64/boot/dts/qcom/msm8953.dtsi         |  2 +-
 arch/arm64/boot/dts/qcom/msm8994.dtsi         | 13 ++----
 arch/arm64/boot/dts/qcom/msm8996.dtsi         |  2 +-
 arch/arm64/boot/dts/qcom/qcs404.dtsi          |  2 +-
 drivers/hwspinlock/qcom_hwspinlock.c          | 42 ++++++++++++++-----
 16 files changed, 86 insertions(+), 77 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v3 01/15] dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-13 12:50   ` Rob Herring
  2022-09-09  9:20 ` [PATCH v3 02/15] dt-bindings: hwlock: qcom-hwspinlock: correct example indentation Krzysztof Kozlowski
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Older Qualcomm SoCs have TCSR mutex registers with 0x80 stride, instead
of 0x1000.  Add dedicated compatibles for such case.  Unfortunately the
binding started using a generic "qcom,tcsr-mutex" compatible without
specifying the SoC part, thus it looks now quite inconsistent.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

If anyone ever says "I want a generic compatible because I am sure all
devices are compatible", that's one more argument they are wrong. :)
---
 .../bindings/hwlock/qcom-hwspinlock.yaml          | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml b/Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml
index 1c7149f7d171..de98b961fb38 100644
--- a/Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml
+++ b/Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml
@@ -15,9 +15,18 @@ description:
 
 properties:
   compatible:
-    enum:
-      - qcom,sfpb-mutex
-      - qcom,tcsr-mutex
+    oneOf:
+      - enum:
+          - qcom,sfpb-mutex
+          - qcom,tcsr-mutex
+      - items:
+          - enum:
+              - qcom,apq8084-tcsr-mutex
+              - qcom,ipq6018-tcsr-mutex
+              - qcom,msm8226-tcsr-mutex
+              - qcom,msm8974-tcsr-mutex
+              - qcom,msm8994-tcsr-mutex
+          - const: qcom,tcsr-mutex
 
   reg:
     maxItems: 1
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 02/15] dt-bindings: hwlock: qcom-hwspinlock: correct example indentation
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 01/15] dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-13 12:51   ` Rob Herring
  2022-09-09  9:20 ` [PATCH v3 03/15] hwspinlock: qcom: correct MMIO max register for newer SoCs Krzysztof Kozlowski
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Use some consistent indentation (4-space) for DTS example.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/hwlock/qcom-hwspinlock.yaml    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml b/Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml
index de98b961fb38..1a3adf75934b 100644
--- a/Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml
+++ b/Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml
@@ -43,9 +43,9 @@ additionalProperties: false
 
 examples:
   - |
-        tcsr_mutex: hwlock@1f40000 {
-                compatible = "qcom,tcsr-mutex";
-                reg = <0x01f40000 0x40000>;
-                #hwlock-cells = <1>;
-        };
+    hwlock@1f40000 {
+        compatible = "qcom,tcsr-mutex";
+        reg = <0x01f40000 0x40000>;
+        #hwlock-cells = <1>;
+    };
 ...
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 03/15] hwspinlock: qcom: correct MMIO max register for newer SoCs
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 01/15] dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 02/15] dt-bindings: hwlock: qcom-hwspinlock: correct example indentation Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 04/15] hwspinlock: qcom: add support for MMIO on older SoCs Krzysztof Kozlowski
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Newer ARMv8 Qualcomm SoCs using 0x1000 register stride have maximum
register 0x20000 (32 mutexes * 0x1000).

Fixes: 7a1e6fb1c606 ("hwspinlock: qcom: Allow mmio usage in addition to syscon")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 drivers/hwspinlock/qcom_hwspinlock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c
index 80ea45b3a815..9734e149d981 100644
--- a/drivers/hwspinlock/qcom_hwspinlock.c
+++ b/drivers/hwspinlock/qcom_hwspinlock.c
@@ -121,7 +121,7 @@ static const struct regmap_config tcsr_mutex_config = {
 	.reg_bits		= 32,
 	.reg_stride		= 4,
 	.val_bits		= 32,
-	.max_register		= 0x40000,
+	.max_register		= 0x20000,
 	.fast_io		= true,
 };
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 04/15] hwspinlock: qcom: add support for MMIO on older SoCs
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 03/15] hwspinlock: qcom: correct MMIO max register for newer SoCs Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 05/15] arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible Krzysztof Kozlowski
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Older Qualcomm SoCs have TCSR mutex registers with 0x80 stride, instead
of 0x1000.  Add dedicated compatibles and regmap for such case.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/hwspinlock/qcom_hwspinlock.c | 42 +++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 10 deletions(-)

diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c
index 9734e149d981..9cf186362ae2 100644
--- a/drivers/hwspinlock/qcom_hwspinlock.c
+++ b/drivers/hwspinlock/qcom_hwspinlock.c
@@ -22,6 +22,7 @@
 struct qcom_hwspinlock_of_data {
 	u32 offset;
 	u32 stride;
+	const struct regmap_config *regmap_config;
 };
 
 static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
@@ -73,15 +74,42 @@ static const struct qcom_hwspinlock_of_data of_sfpb_mutex = {
 	.stride = 0x4,
 };
 
-/* All modern platform has offset 0 and stride of 4k */
+static const struct regmap_config tcsr_msm8226_mutex_config = {
+	.reg_bits		= 32,
+	.reg_stride		= 4,
+	.val_bits		= 32,
+	.max_register		= 0x1000,
+	.fast_io		= true,
+};
+
+static const struct qcom_hwspinlock_of_data of_msm8226_tcsr_mutex = {
+	.offset = 0,
+	.stride = 0x80,
+	.regmap_config = &tcsr_msm8226_mutex_config,
+};
+
+static const struct regmap_config tcsr_mutex_config = {
+	.reg_bits		= 32,
+	.reg_stride		= 4,
+	.val_bits		= 32,
+	.max_register		= 0x20000,
+	.fast_io		= true,
+};
+
 static const struct qcom_hwspinlock_of_data of_tcsr_mutex = {
 	.offset = 0,
 	.stride = 0x1000,
+	.regmap_config = &tcsr_mutex_config,
 };
 
 static const struct of_device_id qcom_hwspinlock_of_match[] = {
 	{ .compatible = "qcom,sfpb-mutex", .data = &of_sfpb_mutex },
 	{ .compatible = "qcom,tcsr-mutex", .data = &of_tcsr_mutex },
+	{ .compatible = "qcom,apq8084-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
+	{ .compatible = "qcom,ipq6018-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
+	{ .compatible = "qcom,msm8226-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
+	{ .compatible = "qcom,msm8974-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
+	{ .compatible = "qcom,msm8994-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, qcom_hwspinlock_of_match);
@@ -117,14 +145,6 @@ static struct regmap *qcom_hwspinlock_probe_syscon(struct platform_device *pdev,
 	return regmap;
 }
 
-static const struct regmap_config tcsr_mutex_config = {
-	.reg_bits		= 32,
-	.reg_stride		= 4,
-	.val_bits		= 32,
-	.max_register		= 0x20000,
-	.fast_io		= true,
-};
-
 static struct regmap *qcom_hwspinlock_probe_mmio(struct platform_device *pdev,
 						 u32 *offset, u32 *stride)
 {
@@ -133,6 +153,8 @@ static struct regmap *qcom_hwspinlock_probe_mmio(struct platform_device *pdev,
 	void __iomem *base;
 
 	data = of_device_get_match_data(dev);
+	if (!data->regmap_config)
+		return ERR_PTR(-EINVAL);
 
 	*offset = data->offset;
 	*stride = data->stride;
@@ -141,7 +163,7 @@ static struct regmap *qcom_hwspinlock_probe_mmio(struct platform_device *pdev,
 	if (IS_ERR(base))
 		return ERR_CAST(base);
 
-	return devm_regmap_init_mmio(dev, base, &tcsr_mutex_config);
+	return devm_regmap_init_mmio(dev, base, data->regmap_config);
 }
 
 static int qcom_hwspinlock_probe(struct platform_device *pdev)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 05/15] arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 04/15] hwspinlock: qcom: add support for MMIO on older SoCs Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 06/15] arm64: dts: qcom: msm8953: " Krzysztof Kozlowski
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

TCSR syscon node should come with dedicated compatible.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

The compatible is documented in separate patchset:
https://lore.kernel.org/linux-devicetree/20220909091056.128949-1-krzysztof.kozlowski@linaro.org/T/#u
---
 arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
index aaad7d9059f6..6b35f03c4862 100644
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -258,7 +258,7 @@ tcsr_mutex_regs: syscon@1905000 {
 		};
 
 		tcsr: syscon@1937000 {
-			compatible = "syscon";
+			compatible = "qcom,tcsr-ipq6018", "syscon";
 			reg = <0x0 0x01937000 0x0 0x21000>;
 		};
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 06/15] arm64: dts: qcom: msm8953: add missing TCSR syscon compatible
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 05/15] arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-13 22:36   ` Bjorn Andersson
  2022-09-09  9:20 ` [PATCH v3 07/15] arm64: dts: qcom: qcs404: " Krzysztof Kozlowski
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

TCSR syscon node should come with dedicated compatible.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/qcom/msm8953.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8953.dtsi b/arch/arm64/boot/dts/qcom/msm8953.dtsi
index 8416a45ca4fd..ed05897d33f1 100644
--- a/arch/arm64/boot/dts/qcom/msm8953.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8953.dtsi
@@ -722,7 +722,7 @@ tcsr: syscon@1937000 {
 		};
 
 		tcsr_phy_clk_scheme_sel: syscon@193f044 {
-			compatible = "syscon";
+			compatible = "qcom,tcsr-msm8953", "syscon";
 			reg = <0x193f044 0x4>;
 		};
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 07/15] arm64: dts: qcom: qcs404: add missing TCSR syscon compatible
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 06/15] arm64: dts: qcom: msm8953: " Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 08/15] arm64: dts: qcom: msm8996: " Krzysztof Kozlowski
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

TCSR syscon node should come with dedicated compatible.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/qcom/qcs404.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi
index 3a94eb2cc448..c79600c28398 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -727,7 +727,7 @@ tcsr_mutex: hwlock@1905000 {
 		};
 
 		tcsr: syscon@1937000 {
-			compatible = "syscon";
+			compatible = "qcom,qcs404-tcsr", "syscon";
 			reg = <0x01937000 0x25000>;
 		};
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 08/15] arm64: dts: qcom: msm8996: add missing TCSR syscon compatible
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (6 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 07/15] arm64: dts: qcom: qcs404: " Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-19 22:13   ` Dmitry Baryshkov
  2022-09-09  9:20 ` [PATCH v3 09/15] ARM: dts: qcom: msm8974: " Krzysztof Kozlowski
                   ` (8 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

TCSR syscon node should come with dedicated compatible.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 166374566a49..5f45d0589265 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -3499,7 +3499,7 @@ frame@98c0000 {
 		};
 
 		saw3: syscon@9a10000 {
-			compatible = "syscon";
+			compatible = "qcom,tcsr-msm8996", "syscon";
 			reg = <0x09a10000 0x1000>;
 		};
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 09/15] ARM: dts: qcom: msm8974: add missing TCSR syscon compatible
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (7 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 08/15] arm64: dts: qcom: msm8996: " Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 10/15] ARM: dts: qcom: msm8974: split TCSR halt regs out of mutex Krzysztof Kozlowski
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

TCSR syscon node should come with dedicated compatible.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-msm8974.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index 8baca2a77717..90a6d4b7605c 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -1234,7 +1234,7 @@ tcsr_mutex_block: syscon@fd484000 {
 		};
 
 		tcsr: syscon@fd4a0000 {
-			compatible = "syscon";
+			compatible = "qcom,tcsr-msm8974", "syscon";
 			reg = <0xfd4a0000 0x10000>;
 		};
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 10/15] ARM: dts: qcom: msm8974: split TCSR halt regs out of mutex
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (8 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 09/15] ARM: dts: qcom: msm8974: " Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-13 22:44   ` Bjorn Andersson
  2022-09-09  9:20 ` [PATCH v3 11/15] arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

The TCSR halt regs are next to TCSR mutex, so before converting the TCSR
mutex into device with address space, we need to split the halt regs to
its own syscon device.  This also describes more accurately the devices
and their IO address space.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-apq8074-dragonboard.dts        |  2 +-
 .../boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts   |  2 +-
 arch/arm/boot/dts/qcom-msm8974-sony-xperia-rhine.dtsi |  2 +-
 arch/arm/boot/dts/qcom-msm8974.dtsi                   | 11 ++++++++---
 arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts   |  2 +-
 arch/arm/boot/dts/qcom-msm8974pro-samsung-klte.dts    |  2 +-
 .../qcom-msm8974pro-sony-xperia-shinano-castor.dts    |  2 +-
 7 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
index 3051a861ff0c..2709a99e5c4c 100644
--- a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
+++ b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
@@ -38,7 +38,7 @@ &otg {
 	status = "okay";
 
 	phys = <&usb_hs2_phy>;
-	phy-select = <&tcsr 0xb000 1>;
+	phy-select = <&tcsr_2 0xb000 1>;
 	extcon = <&smbb>, <&usb_id>;
 	vbus-supply = <&chg_otg>;
 	hnp-disable;
diff --git a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
index ec5d340562b6..5fd94dd6a427 100644
--- a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
+++ b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
@@ -251,7 +251,7 @@ &otg {
 	status = "okay";
 
 	phys = <&usb_hs1_phy>;
-	phy-select = <&tcsr 0xb000 0>;
+	phy-select = <&tcsr_2 0xb000 0>;
 
 	extcon = <&charger>, <&usb_id>;
 	vbus-supply = <&usb_otg_vbus>;
diff --git a/arch/arm/boot/dts/qcom-msm8974-sony-xperia-rhine.dtsi b/arch/arm/boot/dts/qcom-msm8974-sony-xperia-rhine.dtsi
index 5a70683d9103..118b231f3137 100644
--- a/arch/arm/boot/dts/qcom-msm8974-sony-xperia-rhine.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974-sony-xperia-rhine.dtsi
@@ -136,7 +136,7 @@ &otg {
 	status = "okay";
 
 	phys = <&usb_hs1_phy>;
-	phy-select = <&tcsr 0xb000 0>;
+	phy-select = <&tcsr_2 0xb000 0>;
 	extcon = <&smbb>, <&usb_id>;
 	vbus-supply = <&chg_otg>;
 
diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index 90a6d4b7605c..ada232bed2c8 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -1189,7 +1189,7 @@ remoteproc_mss: remoteproc@fc880000 {
 			resets = <&gcc GCC_MSS_RESTART>;
 			reset-names = "mss_restart";
 
-			qcom,halt-regs = <&tcsr_mutex_block 0x1180 0x1200 0x1280>;
+			qcom,halt-regs = <&tcsr_1 0x180 0x200 0x280>;
 
 			qcom,smem-states = <&modem_smp2p_out 0>;
 			qcom,smem-state-names = "stop";
@@ -1230,10 +1230,15 @@ smd-edge {
 
 		tcsr_mutex_block: syscon@fd484000 {
 			compatible = "syscon";
-			reg = <0xfd484000 0x2000>;
+			reg = <0xfd484000 0x1000>;
 		};
 
-		tcsr: syscon@fd4a0000 {
+		tcsr_1: syscon@fd485000 {
+			compatible = "qcom,tcsr-msm8974", "syscon";
+			reg = <0xfd485000 0x1000>;
+		};
+
+		tcsr_2: syscon@fd4a0000 {
 			compatible = "qcom,tcsr-msm8974", "syscon";
 			reg = <0xfd4a0000 0x10000>;
 		};
diff --git a/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts b/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
index ff6e0066768b..c264d17e0953 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
@@ -89,7 +89,7 @@ &otg {
 	status = "okay";
 
 	phys = <&usb_hs1_phy>;
-	phy-select = <&tcsr 0xb000 0>;
+	phy-select = <&tcsr_2 0xb000 0>;
 	extcon = <&smbb>, <&usb_id>;
 	vbus-supply = <&chg_otg>;
 
diff --git a/arch/arm/boot/dts/qcom-msm8974pro-samsung-klte.dts b/arch/arm/boot/dts/qcom-msm8974pro-samsung-klte.dts
index 983e10c3d863..2691a6dbbb8b 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-samsung-klte.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-samsung-klte.dts
@@ -379,7 +379,7 @@ &otg {
 	status = "okay";
 
 	phys = <&usb_hs1_phy>;
-	phy-select = <&tcsr 0xb000 0>;
+	phy-select = <&tcsr_2 0xb000 0>;
 
 	hnp-disable;
 	srp-disable;
diff --git a/arch/arm/boot/dts/qcom-msm8974pro-sony-xperia-shinano-castor.dts b/arch/arm/boot/dts/qcom-msm8974pro-sony-xperia-shinano-castor.dts
index 3f45f5c5d37b..d2bef3896c82 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-sony-xperia-shinano-castor.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-sony-xperia-shinano-castor.dts
@@ -216,7 +216,7 @@ &otg {
 	status = "okay";
 
 	phys = <&usb_hs1_phy>;
-	phy-select = <&tcsr 0xb000 0>;
+	phy-select = <&tcsr_2 0xb000 0>;
 	extcon = <&smbb>, <&usb_id>;
 	vbus-supply = <&chg_otg>;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 11/15] arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (9 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 10/15] ARM: dts: qcom: msm8974: split TCSR halt regs out of mutex Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 12/15] arm64: dts: qcom: msm8994: " Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

The TCSR mutex bindings allow device to be described only with address
space (so it uses MMIO, not syscon regmap).  This seems reasonable as
TCSR mutex is actually a dedicated IO address space and it also fixes DT
schema checks:

  qcom/ipq6018-cp01-c1.dtb: hwlock: 'reg' is a required property
  qcom/ipq6018-cp01-c1.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/qcom/ipq6018.dtsi | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
index 6b35f03c4862..a7c7ca980a71 100644
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -129,12 +129,6 @@ scm {
 		};
 	};
 
-	tcsr_mutex: hwlock {
-		compatible = "qcom,tcsr-mutex";
-		syscon = <&tcsr_mutex_regs 0 0x80>;
-		#hwlock-cells = <1>;
-	};
-
 	pmuv8: pmu {
 		compatible = "arm,cortex-a53-pmu";
 		interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) |
@@ -252,9 +246,10 @@ gcc: gcc@1800000 {
 			#reset-cells = <1>;
 		};
 
-		tcsr_mutex_regs: syscon@1905000 {
-			compatible = "syscon";
-			reg = <0x0 0x01905000 0x0 0x8000>;
+		tcsr_mutex: hwlock@1905000 {
+			compatible = "qcom,ipq6018-tcsr-mutex", "qcom,tcsr-mutex";
+			reg = <0x0 0x01905000 0x0 0x1000>;
+			#hwlock-cells = <1>;
 		};
 
 		tcsr: syscon@1937000 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 12/15] arm64: dts: qcom: msm8994: switch TCSR mutex to MMIO
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (10 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 11/15] arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 13/15] ARM: dts: qcom: msm8974: " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

The TCSR mutex bindings allow device to be described only with address
space (so it uses MMIO, not syscon regmap).  This seems reasonable as
TCSR mutex is actually a dedicated IO address space and it also fixes DT
schema checks:

  qcom/msm8994-sony-xperia-kitakami-suzuran.dtb: hwlock: 'reg' is a required property
  qcom/msm8994-sony-xperia-kitakami-suzuran.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/qcom/msm8994.dtsi | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8994.dtsi b/arch/arm64/boot/dts/qcom/msm8994.dtsi
index 8bc6c070e306..6a9bca6c2c5f 100644
--- a/arch/arm64/boot/dts/qcom/msm8994.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8994.dtsi
@@ -164,12 +164,6 @@ memory@80000000 {
 		reg = <0 0x80000000 0 0>;
 	};
 
-	tcsr_mutex: hwlock {
-		compatible = "qcom,tcsr-mutex";
-		syscon = <&tcsr_mutex_regs 0 0x80>;
-		#hwlock-cells = <1>;
-	};
-
 	pmu {
 		compatible = "arm,cortex-a53-pmu";
 		interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4)| IRQ_TYPE_LEVEL_HIGH)>;
@@ -762,9 +756,10 @@ spmi_bus: spmi@fc4c0000 {
 			#interrupt-cells = <4>;
 		};
 
-		tcsr_mutex_regs: syscon@fd484000 {
-			compatible = "syscon";
-			reg = <0xfd484000 0x2000>;
+		tcsr_mutex: hwlock@fd484000 {
+			compatible = "qcom,msm8994-tcsr-mutex", "qcom,tcsr-mutex";
+			reg = <0xfd484000 0x1000>;
+			#hwlock-cells = <1>;
 		};
 
 		tlmm: pinctrl@fd510000 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 13/15] ARM: dts: qcom: msm8974: switch TCSR mutex to MMIO
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (11 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 12/15] arm64: dts: qcom: msm8994: " Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 14/15] ARM: dts: qcom: apq8084: " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

The TCSR mutex bindings allow device to be described only with address
space (so it uses MMIO, not syscon regmap).  This seems reasonable as
TCSR mutex is actually a dedicated IO address space and it also fixes DT
schema checks:

  qcom-msm8974-sony-xperia-rhine-amami.dtb: tcsr-mutex: 'reg' is a required property
  qcom-msm8974-sony-xperia-rhine-amami.dtb: tcsr-mutex: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-msm8974.dtsi | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index ada232bed2c8..6bb06eaf08fd 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -1228,9 +1228,10 @@ smd-edge {
 			};
 		};
 
-		tcsr_mutex_block: syscon@fd484000 {
-			compatible = "syscon";
+		tcsr_mutex: hwlock@fd484000 {
+			compatible = "qcom,msm8974-tcsr-mutex", "qcom,tcsr-mutex";
 			reg = <0xfd484000 0x1000>;
+			#hwlock-cells = <1>;
 		};
 
 		tcsr_1: syscon@fd485000 {
@@ -1719,13 +1720,6 @@ reboot-mode {
 		};
 	};
 
-	tcsr_mutex: tcsr-mutex {
-		compatible = "qcom,tcsr-mutex";
-		syscon = <&tcsr_mutex_block 0 0x80>;
-
-		#hwlock-cells = <1>;
-	};
-
 	thermal-zones {
 		cpu0-thermal {
 			polling-delay-passive = <250>;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 14/15] ARM: dts: qcom: apq8084: switch TCSR mutex to MMIO
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (12 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 13/15] ARM: dts: qcom: msm8974: " Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-09  9:20 ` [PATCH v3 15/15] ARM: dts: qcom: msm8226: " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

The TCSR mutex bindings allow device to be described only with address
space (so it uses MMIO, not syscon regmap).  This seems reasonable as
TCSR mutex is actually a dedicated IO address space and it also fixes DT
schema checks:

  qcom-apq8084-mtp.dtb: hwlock: 'reg' is a required property
  qcom-apq8084-mtp.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-apq8084.dtsi | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-apq8084.dtsi b/arch/arm/boot/dts/qcom-apq8084.dtsi
index 72f9255855a1..5e07255fe5ea 100644
--- a/arch/arm/boot/dts/qcom-apq8084.dtsi
+++ b/arch/arm/boot/dts/qcom-apq8084.dtsi
@@ -383,14 +383,9 @@ gcc: clock-controller@fc400000 {
 			reg = <0xfc400000 0x4000>;
 		};
 
-		tcsr_mutex_regs: syscon@fd484000 {
-			compatible = "syscon";
-			reg = <0xfd484000 0x2000>;
-		};
-
-		tcsr_mutex: hwlock {
-			compatible = "qcom,tcsr-mutex";
-			syscon = <&tcsr_mutex_regs 0 0x80>;
+		tcsr_mutex: hwlock@fd484000 {
+			compatible = "qcom,apq8084-tcsr-mutex", "qcom,tcsr-mutex";
+			reg = <0xfd484000 0x1000>;
 			#hwlock-cells = <1>;
 		};
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v3 15/15] ARM: dts: qcom: msm8226: switch TCSR mutex to MMIO
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (13 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 14/15] ARM: dts: qcom: apq8084: " Krzysztof Kozlowski
@ 2022-09-09  9:20 ` Krzysztof Kozlowski
  2022-09-13 22:43 ` (subset) [PATCH v3 00/15] ARM/hwlock: qcom: " Bjorn Andersson
  2022-09-13 22:48 ` Bjorn Andersson
  16 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-09  9:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Rob Herring, Krzysztof Kozlowski, Vinod Koul,
	linux-arm-msm, linux-remoteproc, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

The TCSR mutex bindings allow device to be described only with address
space (so it uses MMIO, not syscon regmap).  This seems reasonable as
TCSR mutex is actually a dedicated IO address space and it also fixes DT
schema checks:

  qcom-msm8226-samsung-s3ve3g.dtb: hwlock: 'reg' is a required property
  qcom-msm8226-samsung-s3ve3g.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
index 0b5effdb269a..efb5d1edc3a8 100644
--- a/arch/arm/boot/dts/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
@@ -44,13 +44,6 @@ scm {
 		};
 	};
 
-	tcsr_mutex: hwlock {
-		compatible = "qcom,tcsr-mutex";
-		syscon = <&tcsr_mutex_block 0 0x80>;
-
-		#hwlock-cells = <1>;
-	};
-
 	reserved-memory {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -508,9 +501,10 @@ rpm_msg_ram: memory@fc428000 {
 			reg = <0xfc428000 0x4000>;
 		};
 
-		tcsr_mutex_block: syscon@fd484000 {
-			compatible = "syscon";
-			reg = <0xfd484000 0x2000>;
+		tcsr_mutex: hwlock@fd484000 {
+			compatible = "qcom,msm8226-tcsr-mutex", "qcom,tcsr-mutex";
+			reg = <0xfd484000 0x1000>;
+			#hwlock-cells = <1>;
 		};
 	};
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH v3 01/15] dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs
  2022-09-09  9:20 ` [PATCH v3 01/15] dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs Krzysztof Kozlowski
@ 2022-09-13 12:50   ` Rob Herring
  0 siblings, 0 replies; 29+ messages in thread
From: Rob Herring @ 2022-09-13 12:50 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Baolin Wang, Krzysztof Kozlowski, Vinod Koul, Konrad Dybcio,
	Ohad Ben-Cohen, Bjorn Andersson, Andy Gross, Rob Herring,
	linux-remoteproc, linux-kernel, linux-arm-msm, devicetree

On Fri, 09 Sep 2022 11:20:21 +0200, Krzysztof Kozlowski wrote:
> Older Qualcomm SoCs have TCSR mutex registers with 0x80 stride, instead
> of 0x1000.  Add dedicated compatibles for such case.  Unfortunately the
> binding started using a generic "qcom,tcsr-mutex" compatible without
> specifying the SoC part, thus it looks now quite inconsistent.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> If anyone ever says "I want a generic compatible because I am sure all
> devices are compatible", that's one more argument they are wrong. :)
> ---
>  .../bindings/hwlock/qcom-hwspinlock.yaml          | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v3 02/15] dt-bindings: hwlock: qcom-hwspinlock: correct example indentation
  2022-09-09  9:20 ` [PATCH v3 02/15] dt-bindings: hwlock: qcom-hwspinlock: correct example indentation Krzysztof Kozlowski
@ 2022-09-13 12:51   ` Rob Herring
  0 siblings, 0 replies; 29+ messages in thread
From: Rob Herring @ 2022-09-13 12:51 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Bjorn Andersson, Krzysztof Kozlowski, Rob Herring, Andy Gross,
	linux-remoteproc, devicetree, Konrad Dybcio, Vinod Koul,
	Baolin Wang, Ohad Ben-Cohen, linux-arm-msm, linux-kernel

On Fri, 09 Sep 2022 11:20:22 +0200, Krzysztof Kozlowski wrote:
> Use some consistent indentation (4-space) for DTS example.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../devicetree/bindings/hwlock/qcom-hwspinlock.yaml    | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v3 06/15] arm64: dts: qcom: msm8953: add missing TCSR syscon compatible
  2022-09-09  9:20 ` [PATCH v3 06/15] arm64: dts: qcom: msm8953: " Krzysztof Kozlowski
@ 2022-09-13 22:36   ` Bjorn Andersson
  0 siblings, 0 replies; 29+ messages in thread
From: Bjorn Andersson @ 2022-09-13 22:36 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Konrad Dybcio, Ohad Ben-Cohen, Baolin Wang,
	Rob Herring, Krzysztof Kozlowski, Vinod Koul, linux-arm-msm,
	linux-remoteproc, devicetree, linux-kernel

On Fri, Sep 09, 2022 at 11:20:26AM +0200, Krzysztof Kozlowski wrote:
> TCSR syscon node should come with dedicated compatible.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/msm8953.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8953.dtsi b/arch/arm64/boot/dts/qcom/msm8953.dtsi
> index 8416a45ca4fd..ed05897d33f1 100644
> --- a/arch/arm64/boot/dts/qcom/msm8953.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8953.dtsi
> @@ -722,7 +722,7 @@ tcsr: syscon@1937000 {
>  		};
>  
>  		tcsr_phy_clk_scheme_sel: syscon@193f044 {
> -			compatible = "syscon";
> +			compatible = "qcom,tcsr-msm8953", "syscon";
>  			reg = <0x193f044 0x4>;

I'm okay with the proposed change, but this node is not good.

This exposes a single register from TCSR to the HSUSB driver. We have a
couple of these cases (and have had more popping up in discussions) and
I think that nvmem would be a better abstraction than syscon.

Regards,
Bjorn

>  		};
>  
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: (subset) [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (14 preceding siblings ...)
  2022-09-09  9:20 ` [PATCH v3 15/15] ARM: dts: qcom: msm8226: " Krzysztof Kozlowski
@ 2022-09-13 22:43 ` Bjorn Andersson
  2022-09-13 22:48 ` Bjorn Andersson
  16 siblings, 0 replies; 29+ messages in thread
From: Bjorn Andersson @ 2022-09-13 22:43 UTC (permalink / raw)
  To: krzysztof.kozlowski, krzysztof.kozlowski+dt, linux-remoteproc,
	linux-arm-msm, ohad, agross, robh+dt, devicetree, baolin.wang,
	konrad.dybcio, linux-kernel, vkoul

On Fri, 9 Sep 2022 11:20:20 +0200, Krzysztof Kozlowski wrote:
> Switch older Qualcomm SoCs to use MMIO-based method instead of syscon.
> 
> Not tested on hardware. Please kindly provide tests.
> 
> Changes since v2
> ================
> 1. Rebase on current MFD changes.
> 2. Add Rb tag.
> 3. Split MFD patch to separate patchset:
> https://lore.kernel.org/linux-devicetree/20220909091056.128949-1-krzysztof.kozlowski@linaro.org/T/#u
> 
> [...]

Applied, thanks!

[01/15] dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs
        commit: 6ca53a75c425cb1cb0929ce07f58d9e41094500c
[02/15] dt-bindings: hwlock: qcom-hwspinlock: correct example indentation
        commit: 276a4f1a5fb118bfd6980d42732d530e43f2916a
[03/15] hwspinlock: qcom: correct MMIO max register for newer SoCs
        commit: 90cb380f9ceb811059340d06ff5fd0c0e93ecbe1
[04/15] hwspinlock: qcom: add support for MMIO on older SoCs
        commit: 5d4753f741d824e04e7ba46f46ec016be120f383

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v3 10/15] ARM: dts: qcom: msm8974: split TCSR halt regs out of mutex
  2022-09-09  9:20 ` [PATCH v3 10/15] ARM: dts: qcom: msm8974: split TCSR halt regs out of mutex Krzysztof Kozlowski
@ 2022-09-13 22:44   ` Bjorn Andersson
  2022-09-15 14:49     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 29+ messages in thread
From: Bjorn Andersson @ 2022-09-13 22:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Konrad Dybcio, Ohad Ben-Cohen, Baolin Wang,
	Rob Herring, Krzysztof Kozlowski, Vinod Koul, linux-arm-msm,
	linux-remoteproc, devicetree, linux-kernel

On Fri, Sep 09, 2022 at 11:20:30AM +0200, Krzysztof Kozlowski wrote:
[..]
> diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
> index 90a6d4b7605c..ada232bed2c8 100644
> --- a/arch/arm/boot/dts/qcom-msm8974.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
> @@ -1189,7 +1189,7 @@ remoteproc_mss: remoteproc@fc880000 {
>  			resets = <&gcc GCC_MSS_RESTART>;
>  			reset-names = "mss_restart";
>  
> -			qcom,halt-regs = <&tcsr_mutex_block 0x1180 0x1200 0x1280>;
> +			qcom,halt-regs = <&tcsr_1 0x180 0x200 0x280>;
>  
>  			qcom,smem-states = <&modem_smp2p_out 0>;
>  			qcom,smem-state-names = "stop";
> @@ -1230,10 +1230,15 @@ smd-edge {
>  
>  		tcsr_mutex_block: syscon@fd484000 {
>  			compatible = "syscon";
> -			reg = <0xfd484000 0x2000>;
> +			reg = <0xfd484000 0x1000>;
>  		};
>  
> -		tcsr: syscon@fd4a0000 {
> +		tcsr_1: syscon@fd485000 {

While the accessed registers look general purpose in nature, I would
prefer that we stick with naming it based on the register blocks - and
this is part of what's named "tcsr_mutex".

Is it not possible to claim that this region is a
"qcom,msm8974-tcsr-mutex" and a "syscon"?

> +			compatible = "qcom,tcsr-msm8974", "syscon";
> +			reg = <0xfd485000 0x1000>;
> +		};
> +
> +		tcsr_2: syscon@fd4a0000 {

And I would like to keep this as "tcsr".

Regards,
Bjorn

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: (subset) [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO
  2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
                   ` (15 preceding siblings ...)
  2022-09-13 22:43 ` (subset) [PATCH v3 00/15] ARM/hwlock: qcom: " Bjorn Andersson
@ 2022-09-13 22:48 ` Bjorn Andersson
  2022-09-19 22:14   ` Dmitry Baryshkov
  16 siblings, 1 reply; 29+ messages in thread
From: Bjorn Andersson @ 2022-09-13 22:48 UTC (permalink / raw)
  To: linux-kernel, agross, krzysztof.kozlowski+dt, konrad.dybcio,
	ohad, linux-arm-msm, baolin.wang, linux-remoteproc, robh+dt,
	krzysztof.kozlowski, devicetree, vkoul

On Fri, 9 Sep 2022 11:20:20 +0200, Krzysztof Kozlowski wrote:
> Switch older Qualcomm SoCs to use MMIO-based method instead of syscon.
> 
> Not tested on hardware. Please kindly provide tests.
> 
> Changes since v2
> ================
> 1. Rebase on current MFD changes.
> 2. Add Rb tag.
> 3. Split MFD patch to separate patchset:
> https://lore.kernel.org/linux-devicetree/20220909091056.128949-1-krzysztof.kozlowski@linaro.org/T/#u
> 
> [...]

Applied, thanks!

[05/15] arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible
        commit: d30bcfa4408596e8dd3714dfdd90334d2bdc9856
[06/15] arm64: dts: qcom: msm8953: add missing TCSR syscon compatible
        commit: d07ac9d93ced0f8203230bf1de49b7cc605e1547
[07/15] arm64: dts: qcom: qcs404: add missing TCSR syscon compatible
        commit: 98460385091fc2e86a296f9643105d8a8777ccc2
[08/15] arm64: dts: qcom: msm8996: add missing TCSR syscon compatible
        commit: 8a99e0fc8bd3fa9c8be1fc115a2e38f4fd51ccda
[11/15] arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO
        commit: f5e303aefc06b7508d7a490f9a2d80e4dc134c70
[12/15] arm64: dts: qcom: msm8994: switch TCSR mutex to MMIO
        commit: 9e826e05061c61d84217bbe436b4ef0bedbfe458
[14/15] ARM: dts: qcom: apq8084: switch TCSR mutex to MMIO
        commit: 16ae4e557b2fa9fc7372b4503247aca80a476272
[15/15] ARM: dts: qcom: msm8226: switch TCSR mutex to MMIO
        commit: 18a4af7a598445af54e1e16a66b7f31669578701

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v3 10/15] ARM: dts: qcom: msm8974: split TCSR halt regs out of mutex
  2022-09-13 22:44   ` Bjorn Andersson
@ 2022-09-15 14:49     ` Krzysztof Kozlowski
  2022-09-19 21:01       ` Bjorn Andersson
  0 siblings, 1 reply; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-15 14:49 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, Konrad Dybcio, Ohad Ben-Cohen, Baolin Wang,
	Rob Herring, Krzysztof Kozlowski, Vinod Koul, linux-arm-msm,
	linux-remoteproc, devicetree, linux-kernel

On 13/09/2022 23:44, Bjorn Andersson wrote:
> On Fri, Sep 09, 2022 at 11:20:30AM +0200, Krzysztof Kozlowski wrote:
> [..]
>> diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
>> index 90a6d4b7605c..ada232bed2c8 100644
>> --- a/arch/arm/boot/dts/qcom-msm8974.dtsi
>> +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
>> @@ -1189,7 +1189,7 @@ remoteproc_mss: remoteproc@fc880000 {
>>  			resets = <&gcc GCC_MSS_RESTART>;
>>  			reset-names = "mss_restart";
>>  
>> -			qcom,halt-regs = <&tcsr_mutex_block 0x1180 0x1200 0x1280>;
>> +			qcom,halt-regs = <&tcsr_1 0x180 0x200 0x280>;
>>  
>>  			qcom,smem-states = <&modem_smp2p_out 0>;
>>  			qcom,smem-state-names = "stop";
>> @@ -1230,10 +1230,15 @@ smd-edge {
>>  
>>  		tcsr_mutex_block: syscon@fd484000 {
>>  			compatible = "syscon";
>> -			reg = <0xfd484000 0x2000>;
>> +			reg = <0xfd484000 0x1000>;
>>  		};
>>  
>> -		tcsr: syscon@fd4a0000 {
>> +		tcsr_1: syscon@fd485000 {
> 
> While the accessed registers look general purpose in nature, I would
> prefer that we stick with naming it based on the register blocks - and
> this is part of what's named "tcsr_mutex".

Then everything would be like:

tcsr_mutex_1: syscon@fd484000
tcsr_mutex_2: syscon@fd485000
tcsr: syscon@fd4a0000
?

> 
> Is it not possible to claim that this region is a
> "qcom,msm8974-tcsr-mutex" and a "syscon"?

Hm, yes, that's another approach. We can go this way, but it has one
drawback - you could have two different devices (mutex and syscon user)
poking to the same registers. The regmap makes it safe from concurrency
point of view, but not safe from logic point of view.

Splitting these makes it sure, that no one touches hwlock registers,
except the hwlock driver.

Any preference?

> 
>> +			compatible = "qcom,tcsr-msm8974", "syscon";
>> +			reg = <0xfd485000 0x1000>;
>> +		};
>> +
>> +		tcsr_2: syscon@fd4a0000 {
> 
> And I would like to keep this as "tcsr".



Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v3 10/15] ARM: dts: qcom: msm8974: split TCSR halt regs out of mutex
  2022-09-15 14:49     ` Krzysztof Kozlowski
@ 2022-09-19 21:01       ` Bjorn Andersson
  0 siblings, 0 replies; 29+ messages in thread
From: Bjorn Andersson @ 2022-09-19 21:01 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Konrad Dybcio, Ohad Ben-Cohen, Baolin Wang,
	Rob Herring, Krzysztof Kozlowski, Vinod Koul, linux-arm-msm,
	linux-remoteproc, devicetree, linux-kernel

On Thu, Sep 15, 2022 at 03:49:37PM +0100, Krzysztof Kozlowski wrote:
> On 13/09/2022 23:44, Bjorn Andersson wrote:
> > On Fri, Sep 09, 2022 at 11:20:30AM +0200, Krzysztof Kozlowski wrote:
> > [..]
> >> diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
> >> index 90a6d4b7605c..ada232bed2c8 100644
> >> --- a/arch/arm/boot/dts/qcom-msm8974.dtsi
> >> +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
> >> @@ -1189,7 +1189,7 @@ remoteproc_mss: remoteproc@fc880000 {
> >>  			resets = <&gcc GCC_MSS_RESTART>;
> >>  			reset-names = "mss_restart";
> >>  
> >> -			qcom,halt-regs = <&tcsr_mutex_block 0x1180 0x1200 0x1280>;
> >> +			qcom,halt-regs = <&tcsr_1 0x180 0x200 0x280>;
> >>  
> >>  			qcom,smem-states = <&modem_smp2p_out 0>;
> >>  			qcom,smem-state-names = "stop";
> >> @@ -1230,10 +1230,15 @@ smd-edge {
> >>  
> >>  		tcsr_mutex_block: syscon@fd484000 {
> >>  			compatible = "syscon";
> >> -			reg = <0xfd484000 0x2000>;
> >> +			reg = <0xfd484000 0x1000>;
> >>  		};
> >>  
> >> -		tcsr: syscon@fd4a0000 {
> >> +		tcsr_1: syscon@fd485000 {
> > 
> > While the accessed registers look general purpose in nature, I would
> > prefer that we stick with naming it based on the register blocks - and
> > this is part of what's named "tcsr_mutex".
> 
> Then everything would be like:
> 
> tcsr_mutex_1: syscon@fd484000
> tcsr_mutex_2: syscon@fd485000
> tcsr: syscon@fd4a0000
> ?
> 
> > 
> > Is it not possible to claim that this region is a
> > "qcom,msm8974-tcsr-mutex" and a "syscon"?
> 
> Hm, yes, that's another approach. We can go this way, but it has one
> drawback - you could have two different devices (mutex and syscon user)
> poking to the same registers. The regmap makes it safe from concurrency
> point of view, but not safe from logic point of view.
> 
> Splitting these makes it sure, that no one touches hwlock registers,
> except the hwlock driver.
> 
> Any preference?
> 

Certainly would be interesting if someone grabs the syscon and pokes at
the mutex registers, but I do prefer to have the DT match the register
regions when possible.

So if you're okay with making the whole tcsr mutex a hwlock and syscon
I prefer that.


PS. I picked all non-8974 patches from the series, just in case that
wasn't clear from the ty-letters.

Thanks,
Bjorn

> > 
> >> +			compatible = "qcom,tcsr-msm8974", "syscon";
> >> +			reg = <0xfd485000 0x1000>;
> >> +		};
> >> +
> >> +		tcsr_2: syscon@fd4a0000 {
> > 
> > And I would like to keep this as "tcsr".
> 
> 
> 
> Best regards,
> Krzysztof

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v3 08/15] arm64: dts: qcom: msm8996: add missing TCSR syscon compatible
  2022-09-09  9:20 ` [PATCH v3 08/15] arm64: dts: qcom: msm8996: " Krzysztof Kozlowski
@ 2022-09-19 22:13   ` Dmitry Baryshkov
  2022-09-20 13:04     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 29+ messages in thread
From: Dmitry Baryshkov @ 2022-09-19 22:13 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Ohad Ben-Cohen, Baolin Wang, Rob Herring, Krzysztof Kozlowski,
	Vinod Koul, linux-arm-msm, linux-remoteproc, devicetree,
	linux-kernel

On 09/09/2022 12:20, Krzysztof Kozlowski wrote:
> TCSR syscon node should come with dedicated compatible.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>   arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
> index 166374566a49..5f45d0589265 100644
> --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
> @@ -3499,7 +3499,7 @@ frame@98c0000 {
>   		};
>   
>   		saw3: syscon@9a10000 {
> -			compatible = "syscon";
> +			compatible = "qcom,tcsr-msm8996", "syscon";

No! saw3 is not a TCSR. It is a separate region, which should be managed 
by the SPM driver.

>   			reg = <0x09a10000 0x1000>;
>   		};
>   

-- 
With best wishes
Dmitry


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: (subset) [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO
  2022-09-13 22:48 ` Bjorn Andersson
@ 2022-09-19 22:14   ` Dmitry Baryshkov
  2022-09-27  3:34     ` Bjorn Andersson
  2022-09-27  3:36     ` Bjorn Andersson
  0 siblings, 2 replies; 29+ messages in thread
From: Dmitry Baryshkov @ 2022-09-19 22:14 UTC (permalink / raw)
  To: Bjorn Andersson, linux-kernel, agross, krzysztof.kozlowski+dt,
	konrad.dybcio, ohad, linux-arm-msm, baolin.wang,
	linux-remoteproc, robh+dt, krzysztof.kozlowski, devicetree,
	vkoul

On 14/09/2022 01:48, Bjorn Andersson wrote:
> On Fri, 9 Sep 2022 11:20:20 +0200, Krzysztof Kozlowski wrote:
>> Switch older Qualcomm SoCs to use MMIO-based method instead of syscon.
>>
>> Not tested on hardware. Please kindly provide tests.
>>
>> Changes since v2
>> ================
>> 1. Rebase on current MFD changes.
>> 2. Add Rb tag.
>> 3. Split MFD patch to separate patchset:
>> https://lore.kernel.org/linux-devicetree/20220909091056.128949-1-krzysztof.kozlowski@linaro.org/T/#u
>>
>> [...]
> 
> Applied, thanks!
> 
> [05/15] arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible
>          commit: d30bcfa4408596e8dd3714dfdd90334d2bdc9856
> [06/15] arm64: dts: qcom: msm8953: add missing TCSR syscon compatible
>          commit: d07ac9d93ced0f8203230bf1de49b7cc605e1547
> [07/15] arm64: dts: qcom: qcs404: add missing TCSR syscon compatible
>          commit: 98460385091fc2e86a296f9643105d8a8777ccc2
> [08/15] arm64: dts: qcom: msm8996: add missing TCSR syscon compatible
>          commit: 8a99e0fc8bd3fa9c8be1fc115a2e38f4fd51ccda

Please revert 08/15, it is incorrect.

> [11/15] arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO
>          commit: f5e303aefc06b7508d7a490f9a2d80e4dc134c70
> [12/15] arm64: dts: qcom: msm8994: switch TCSR mutex to MMIO
>          commit: 9e826e05061c61d84217bbe436b4ef0bedbfe458
> [14/15] ARM: dts: qcom: apq8084: switch TCSR mutex to MMIO
>          commit: 16ae4e557b2fa9fc7372b4503247aca80a476272
> [15/15] ARM: dts: qcom: msm8226: switch TCSR mutex to MMIO
>          commit: 18a4af7a598445af54e1e16a66b7f31669578701
> 
> Best regards,

-- 
With best wishes
Dmitry


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v3 08/15] arm64: dts: qcom: msm8996: add missing TCSR syscon compatible
  2022-09-19 22:13   ` Dmitry Baryshkov
@ 2022-09-20 13:04     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-20 13:04 UTC (permalink / raw)
  To: Dmitry Baryshkov, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Ohad Ben-Cohen, Baolin Wang, Rob Herring, Krzysztof Kozlowski,
	Vinod Koul, linux-arm-msm, linux-remoteproc, devicetree,
	linux-kernel

On 20/09/2022 00:13, Dmitry Baryshkov wrote:
> On 09/09/2022 12:20, Krzysztof Kozlowski wrote:
>> TCSR syscon node should come with dedicated compatible.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>   arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
>> index 166374566a49..5f45d0589265 100644
>> --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
>> @@ -3499,7 +3499,7 @@ frame@98c0000 {
>>   		};
>>   
>>   		saw3: syscon@9a10000 {
>> -			compatible = "syscon";
>> +			compatible = "qcom,tcsr-msm8996", "syscon";
> 
> No! saw3 is not a TCSR. It is a separate region, which should be managed 
> by the SPM driver.

Indeed. Thanks for checking this.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: (subset) [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO
  2022-09-19 22:14   ` Dmitry Baryshkov
@ 2022-09-27  3:34     ` Bjorn Andersson
  2022-09-27  3:36     ` Bjorn Andersson
  1 sibling, 0 replies; 29+ messages in thread
From: Bjorn Andersson @ 2022-09-27  3:34 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: linux-kernel, agross, krzysztof.kozlowski+dt, konrad.dybcio,
	ohad, linux-arm-msm, baolin.wang, linux-remoteproc, robh+dt,
	krzysztof.kozlowski, devicetree, vkoul

On Tue, Sep 20, 2022 at 01:14:54AM +0300, Dmitry Baryshkov wrote:
> On 14/09/2022 01:48, Bjorn Andersson wrote:
> > On Fri, 9 Sep 2022 11:20:20 +0200, Krzysztof Kozlowski wrote:
> > > Switch older Qualcomm SoCs to use MMIO-based method instead of syscon.
> > > 
> > > Not tested on hardware. Please kindly provide tests.
> > > 
> > > Changes since v2
> > > ================
> > > 1. Rebase on current MFD changes.
> > > 2. Add Rb tag.
> > > 3. Split MFD patch to separate patchset:
> > > https://lore.kernel.org/linux-devicetree/20220909091056.128949-1-krzysztof.kozlowski@linaro.org/T/#u
> > > 
> > > [...]
> > 
> > Applied, thanks!
> > 
> > [05/15] arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible
> >          commit: d30bcfa4408596e8dd3714dfdd90334d2bdc9856
> > [06/15] arm64: dts: qcom: msm8953: add missing TCSR syscon compatible
> >          commit: d07ac9d93ced0f8203230bf1de49b7cc605e1547
> > [07/15] arm64: dts: qcom: qcs404: add missing TCSR syscon compatible
> >          commit: 98460385091fc2e86a296f9643105d8a8777ccc2
> > [08/15] arm64: dts: qcom: msm8996: add missing TCSR syscon compatible
> >          commit: 8a99e0fc8bd3fa9c8be1fc115a2e38f4fd51ccda
> 
> Please revert 08/15, it is incorrect.
> 

I'm not able to see why it is not correct to claim that the tcsr region
is compatible with qcom,tcsr-msm8996? Please let me know and we can
revert this in -rc.

Regards,
Bjorn

> > [11/15] arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO
> >          commit: f5e303aefc06b7508d7a490f9a2d80e4dc134c70
> > [12/15] arm64: dts: qcom: msm8994: switch TCSR mutex to MMIO
> >          commit: 9e826e05061c61d84217bbe436b4ef0bedbfe458
> > [14/15] ARM: dts: qcom: apq8084: switch TCSR mutex to MMIO
> >          commit: 16ae4e557b2fa9fc7372b4503247aca80a476272
> > [15/15] ARM: dts: qcom: msm8226: switch TCSR mutex to MMIO
> >          commit: 18a4af7a598445af54e1e16a66b7f31669578701
> > 
> > Best regards,
> 
> -- 
> With best wishes
> Dmitry
> 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: (subset) [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO
  2022-09-19 22:14   ` Dmitry Baryshkov
  2022-09-27  3:34     ` Bjorn Andersson
@ 2022-09-27  3:36     ` Bjorn Andersson
  1 sibling, 0 replies; 29+ messages in thread
From: Bjorn Andersson @ 2022-09-27  3:36 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: linux-kernel, agross, krzysztof.kozlowski+dt, konrad.dybcio,
	ohad, linux-arm-msm, baolin.wang, linux-remoteproc, robh+dt,
	krzysztof.kozlowski, devicetree, vkoul

On Tue, Sep 20, 2022 at 01:14:54AM +0300, Dmitry Baryshkov wrote:
> On 14/09/2022 01:48, Bjorn Andersson wrote:
> > On Fri, 9 Sep 2022 11:20:20 +0200, Krzysztof Kozlowski wrote:
> > > Switch older Qualcomm SoCs to use MMIO-based method instead of syscon.
> > > 
> > > Not tested on hardware. Please kindly provide tests.
> > > 
> > > Changes since v2
> > > ================
> > > 1. Rebase on current MFD changes.
> > > 2. Add Rb tag.
> > > 3. Split MFD patch to separate patchset:
> > > https://lore.kernel.org/linux-devicetree/20220909091056.128949-1-krzysztof.kozlowski@linaro.org/T/#u
> > > 
> > > [...]
> > 
> > Applied, thanks!
> > 
> > [05/15] arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible
> >          commit: d30bcfa4408596e8dd3714dfdd90334d2bdc9856
> > [06/15] arm64: dts: qcom: msm8953: add missing TCSR syscon compatible
> >          commit: d07ac9d93ced0f8203230bf1de49b7cc605e1547
> > [07/15] arm64: dts: qcom: qcs404: add missing TCSR syscon compatible
> >          commit: 98460385091fc2e86a296f9643105d8a8777ccc2
> > [08/15] arm64: dts: qcom: msm8996: add missing TCSR syscon compatible
> >          commit: 8a99e0fc8bd3fa9c8be1fc115a2e38f4fd51ccda
> 
> Please revert 08/15, it is incorrect.
> 

Nvm, now I saw what you're saying and I see your revert. Many thanks,
I've picked this for -fixes.

Regards,
Bjorn

> > [11/15] arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO
> >          commit: f5e303aefc06b7508d7a490f9a2d80e4dc134c70
> > [12/15] arm64: dts: qcom: msm8994: switch TCSR mutex to MMIO
> >          commit: 9e826e05061c61d84217bbe436b4ef0bedbfe458
> > [14/15] ARM: dts: qcom: apq8084: switch TCSR mutex to MMIO
> >          commit: 16ae4e557b2fa9fc7372b4503247aca80a476272
> > [15/15] ARM: dts: qcom: msm8226: switch TCSR mutex to MMIO
> >          commit: 18a4af7a598445af54e1e16a66b7f31669578701
> > 
> > Best regards,
> 
> -- 
> With best wishes
> Dmitry
> 

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2022-09-27  3:36 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09  9:20 [PATCH v3 00/15] ARM/hwlock: qcom: switch TCSR mutex to MMIO Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 01/15] dt-bindings: hwlock: qcom-hwspinlock: add support for MMIO on older SoCs Krzysztof Kozlowski
2022-09-13 12:50   ` Rob Herring
2022-09-09  9:20 ` [PATCH v3 02/15] dt-bindings: hwlock: qcom-hwspinlock: correct example indentation Krzysztof Kozlowski
2022-09-13 12:51   ` Rob Herring
2022-09-09  9:20 ` [PATCH v3 03/15] hwspinlock: qcom: correct MMIO max register for newer SoCs Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 04/15] hwspinlock: qcom: add support for MMIO on older SoCs Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 05/15] arm64: dts: qcom: ipq6018: add missing TCSR syscon compatible Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 06/15] arm64: dts: qcom: msm8953: " Krzysztof Kozlowski
2022-09-13 22:36   ` Bjorn Andersson
2022-09-09  9:20 ` [PATCH v3 07/15] arm64: dts: qcom: qcs404: " Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 08/15] arm64: dts: qcom: msm8996: " Krzysztof Kozlowski
2022-09-19 22:13   ` Dmitry Baryshkov
2022-09-20 13:04     ` Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 09/15] ARM: dts: qcom: msm8974: " Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 10/15] ARM: dts: qcom: msm8974: split TCSR halt regs out of mutex Krzysztof Kozlowski
2022-09-13 22:44   ` Bjorn Andersson
2022-09-15 14:49     ` Krzysztof Kozlowski
2022-09-19 21:01       ` Bjorn Andersson
2022-09-09  9:20 ` [PATCH v3 11/15] arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 12/15] arm64: dts: qcom: msm8994: " Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 13/15] ARM: dts: qcom: msm8974: " Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 14/15] ARM: dts: qcom: apq8084: " Krzysztof Kozlowski
2022-09-09  9:20 ` [PATCH v3 15/15] ARM: dts: qcom: msm8226: " Krzysztof Kozlowski
2022-09-13 22:43 ` (subset) [PATCH v3 00/15] ARM/hwlock: qcom: " Bjorn Andersson
2022-09-13 22:48 ` Bjorn Andersson
2022-09-19 22:14   ` Dmitry Baryshkov
2022-09-27  3:34     ` Bjorn Andersson
2022-09-27  3:36     ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.