mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] soc: qcom: ocmem: let the driver work again
@ 2026-03-23 23:07 Dmitry Baryshkov
  2026-03-23 23:07 ` [PATCH v2 1/3] soc: qcom: ocmem: make the core clock optional Dmitry Baryshkov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2026-03-23 23:07 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Stephen Boyd, Georgi Djakov,
	Rob Clark, Brian Masney
  Cc: linux-arm-msm, linux-kernel, Konrad Dybcio, Brian Masney

Commit d6edc31f3a68 ("clk: qcom: smd-rpm: Separate out interconnect bus
clocks") moved control over several RPM resources from the clk-smd-rpm
driver to the icc-rpm.c interconnect helpers. However it was unnoticed
that the OCMEM device also uses that clock. The clock is not required as
all OCMEM users (currently only the GPU) will vote on the OCMEM NOC,
bringing up the clock. Make it optional (and also apply several other
small fixes).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Changes in v2:
- Switched to dev_err_ptr_probe() (Konrad)
- Link to v1: https://lore.kernel.org/r/20260323-ocmem-v1-0-ad9bcae44763@oss.qualcomm.com

---
Dmitry Baryshkov (3):
      soc: qcom: ocmem: make the core clock optional
      soc: qcom: ocmem: register reasons for probe deferrals
      soc: qcom: ocmem: return -EPROBE_DEFER is ocmem is not available

 drivers/soc/qcom/ocmem.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
---
base-commit: 8e5a478b6d6a5bb0a3d52147862b15e4d826af19
change-id: 20260323-ocmem-dfe2d207d0e9

Best regards,
--  
With best wishes
Dmitry


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

* [PATCH v2 1/3] soc: qcom: ocmem: make the core clock optional
  2026-03-23 23:07 [PATCH v2 0/3] soc: qcom: ocmem: let the driver work again Dmitry Baryshkov
@ 2026-03-23 23:07 ` Dmitry Baryshkov
  2026-03-23 23:07 ` [PATCH v2 2/3] soc: qcom: ocmem: register reasons for probe deferrals Dmitry Baryshkov
  2026-03-23 23:07 ` [PATCH v2 3/3] soc: qcom: ocmem: return -EPROBE_DEFER is ocmem is not available Dmitry Baryshkov
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2026-03-23 23:07 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Stephen Boyd, Georgi Djakov,
	Rob Clark, Brian Masney
  Cc: linux-arm-msm, linux-kernel, Konrad Dybcio

OCMEM's core clock (aka RPM bus 2 clock) is being handled internally by
the interconnect driver. Corresponding clock has been dropped from the
SMD RPM clock driver. The users of the ocmem will vote on the ocmemnoc
interconnect paths, making sure that ocmem is on. Make the clock
optional, keeping it for compatibility with older DT.

Fixes: d6edc31f3a68 ("clk: qcom: smd-rpm: Separate out interconnect bus clocks")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/soc/qcom/ocmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
index 6a23f18b0281..dd46bb14b7be 100644
--- a/drivers/soc/qcom/ocmem.c
+++ b/drivers/soc/qcom/ocmem.c
@@ -308,7 +308,7 @@ static int ocmem_dev_probe(struct platform_device *pdev)
 	ocmem->dev = dev;
 	ocmem->config = device_get_match_data(dev);
 
-	ocmem->core_clk = devm_clk_get(dev, "core");
+	ocmem->core_clk = devm_clk_get_optional(dev, "core");
 	if (IS_ERR(ocmem->core_clk))
 		return dev_err_probe(dev, PTR_ERR(ocmem->core_clk),
 				     "Unable to get core clock\n");

-- 
2.47.3


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

* [PATCH v2 2/3] soc: qcom: ocmem: register reasons for probe deferrals
  2026-03-23 23:07 [PATCH v2 0/3] soc: qcom: ocmem: let the driver work again Dmitry Baryshkov
  2026-03-23 23:07 ` [PATCH v2 1/3] soc: qcom: ocmem: make the core clock optional Dmitry Baryshkov
@ 2026-03-23 23:07 ` Dmitry Baryshkov
  2026-03-23 23:07 ` [PATCH v2 3/3] soc: qcom: ocmem: return -EPROBE_DEFER is ocmem is not available Dmitry Baryshkov
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2026-03-23 23:07 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Stephen Boyd, Georgi Djakov,
	Rob Clark, Brian Masney
  Cc: linux-arm-msm, linux-kernel, Brian Masney, Konrad Dybcio

Instead of printing messages to the dmesg, let the message be recorded
as a reason for the OCMEM client deferral.

Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
Reviewed-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/soc/qcom/ocmem.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
index dd46bb14b7be..d47ce5707fd8 100644
--- a/drivers/soc/qcom/ocmem.c
+++ b/drivers/soc/qcom/ocmem.c
@@ -196,10 +196,10 @@ struct ocmem *of_get_ocmem(struct device *dev)
 	}
 
 	pdev = of_find_device_by_node(devnode->parent);
-	if (!pdev) {
-		dev_err(dev, "Cannot find device node %s\n", devnode->name);
-		return ERR_PTR(-EPROBE_DEFER);
-	}
+	if (!pdev)
+		return dev_err_ptr_probe(dev, -EPROBE_DEFER,
+					 "Cannot find device node %s\n",
+					 devnode->name);
 
 	ocmem = platform_get_drvdata(pdev);
 	put_device(&pdev->dev);

-- 
2.47.3


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

* [PATCH v2 3/3] soc: qcom: ocmem: return -EPROBE_DEFER is ocmem is not available
  2026-03-23 23:07 [PATCH v2 0/3] soc: qcom: ocmem: let the driver work again Dmitry Baryshkov
  2026-03-23 23:07 ` [PATCH v2 1/3] soc: qcom: ocmem: make the core clock optional Dmitry Baryshkov
  2026-03-23 23:07 ` [PATCH v2 2/3] soc: qcom: ocmem: register reasons for probe deferrals Dmitry Baryshkov
@ 2026-03-23 23:07 ` Dmitry Baryshkov
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2026-03-23 23:07 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Stephen Boyd, Georgi Djakov,
	Rob Clark, Brian Masney
  Cc: linux-arm-msm, linux-kernel, Konrad Dybcio

If OCMEM is declared in DT, it is expected that it is present and
handled by the driver. The GPU driver will ignore -ENODEV error, which
typically means that OCMEM isn't defined in DT. Let ocmem return
-EPROBE_DEFER if it supposed to be used, but it is not probed (yet).

Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/soc/qcom/ocmem.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
index d47ce5707fd8..96ca0b87bfc4 100644
--- a/drivers/soc/qcom/ocmem.c
+++ b/drivers/soc/qcom/ocmem.c
@@ -203,10 +203,9 @@ struct ocmem *of_get_ocmem(struct device *dev)
 
 	ocmem = platform_get_drvdata(pdev);
 	put_device(&pdev->dev);
-	if (!ocmem) {
-		dev_err(dev, "Cannot get ocmem\n");
-		return ERR_PTR(-ENODEV);
-	}
+	if (!ocmem)
+		return dev_err_ptr_probe(dev, -EPROBE_DEFER, "Cannot get ocmem\n");
+
 	return ocmem;
 }
 EXPORT_SYMBOL_GPL(of_get_ocmem);

-- 
2.47.3


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

end of thread, other threads:[~2026-03-23 23:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-23 23:07 [PATCH v2 0/3] soc: qcom: ocmem: let the driver work again Dmitry Baryshkov
2026-03-23 23:07 ` [PATCH v2 1/3] soc: qcom: ocmem: make the core clock optional Dmitry Baryshkov
2026-03-23 23:07 ` [PATCH v2 2/3] soc: qcom: ocmem: register reasons for probe deferrals Dmitry Baryshkov
2026-03-23 23:07 ` [PATCH v2 3/3] soc: qcom: ocmem: return -EPROBE_DEFER is ocmem is not available Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®