public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation
@ 2023-07-16  2:28 Christian Marangi
  2023-07-19  3:21 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Marangi @ 2023-07-16  2:28 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ohad Ben-Cohen,
	Baolin Wang, Krzysztof Kozlowski, linux-arm-msm, linux-remoteproc,
	linux-kernel
  Cc: Christian Marangi, stable

Commit 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older
SoCs") introduced and made regmap_config mandatory in the of_data struct
but didn't add the regmap_config for sfpb based devices.

SFPB based devices can both use the legacy syscon way to probe or the
new MMIO way and currently device that use the MMIO way are broken as
they lack the definition of the now required regmap_config and always
return -EINVAL (and indirectly makes fail probing everything that
depends on it, smem, nandc with smem-parser...)

Fix this by correctly adding the missing regmap_config and restore
function of hwspinlock on SFPB based devices with MMIO implementation.

Cc: stable@vger.kernel.org
Fixes: 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older SoCs")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/hwspinlock/qcom_hwspinlock.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c
index 9cf186362ae2..3f08cd4a5c28 100644
--- a/drivers/hwspinlock/qcom_hwspinlock.c
+++ b/drivers/hwspinlock/qcom_hwspinlock.c
@@ -69,9 +69,18 @@ static const struct hwspinlock_ops qcom_hwspinlock_ops = {
 	.unlock		= qcom_hwspinlock_unlock,
 };
 
+static const struct regmap_config sfpb_mutex_config = {
+	.reg_bits		= 32,
+	.reg_stride		= 4,
+	.val_bits		= 32,
+	.max_register		= 0x100,
+	.fast_io		= true,
+};
+
 static const struct qcom_hwspinlock_of_data of_sfpb_mutex = {
 	.offset = 0x4,
 	.stride = 0x4,
+	.regmap_config = &sfpb_mutex_config,
 };
 
 static const struct regmap_config tcsr_msm8226_mutex_config = {
-- 
2.40.1


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

* Re: [PATCH] hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation
  2023-07-16  2:28 [PATCH] hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation Christian Marangi
@ 2023-07-19  3:21 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2023-07-19  3:21 UTC (permalink / raw)
  To: Andy Gross, Konrad Dybcio, Ohad Ben-Cohen, Baolin Wang,
	Krzysztof Kozlowski, linux-arm-msm, linux-remoteproc,
	linux-kernel, Christian Marangi
  Cc: stable


On Sun, 16 Jul 2023 04:28:04 +0200, Christian Marangi wrote:
> Commit 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older
> SoCs") introduced and made regmap_config mandatory in the of_data struct
> but didn't add the regmap_config for sfpb based devices.
> 
> SFPB based devices can both use the legacy syscon way to probe or the
> new MMIO way and currently device that use the MMIO way are broken as
> they lack the definition of the now required regmap_config and always
> return -EINVAL (and indirectly makes fail probing everything that
> depends on it, smem, nandc with smem-parser...)
> 
> [...]

Applied, thanks!

[1/1] hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation
      commit: 23316be8a9d450f33a21f1efe7d89570becbec58

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

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

end of thread, other threads:[~2023-07-19  3:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-16  2:28 [PATCH] hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation Christian Marangi
2023-07-19  3:21 ` Bjorn Andersson

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