* [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