Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100
@ 2025-01-26 16:45 Sasha Levin
  2025-01-26 16:45 ` [PATCH AUTOSEL 6.13 3/8] firmware: qcom: scm: smc: Handle missing SCM device Sasha Levin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sasha Levin @ 2025-01-26 16:45 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Konrad Dybcio, Dmitry Baryshkov, Bjorn Andersson, Sasha Levin,
	konradybcio, linux-arm-msm

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

[ Upstream commit e7282bf8a0e9bb8a4cb1be406674ff7bb7b264f2 ]

X1P42100 is a cousin of X1E80100, and hence can make use of the
latter's configuration. Do so.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20241221-topic-x1p4_soc-v1-3-55347831d73c@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soc/qcom/qcom_pd_mapper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/qcom/qcom_pd_mapper.c b/drivers/soc/qcom/qcom_pd_mapper.c
index 6e30f08761aa4..50aa54996901f 100644
--- a/drivers/soc/qcom/qcom_pd_mapper.c
+++ b/drivers/soc/qcom/qcom_pd_mapper.c
@@ -561,6 +561,7 @@ static const struct of_device_id qcom_pdm_domains[] __maybe_unused = {
 	{ .compatible = "qcom,sm8550", .data = sm8550_domains, },
 	{ .compatible = "qcom,sm8650", .data = sm8550_domains, },
 	{ .compatible = "qcom,x1e80100", .data = x1e80100_domains, },
+	{ .compatible = "qcom,x1p42100", .data = x1e80100_domains, },
 	{},
 };
 
-- 
2.39.5


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

* [PATCH AUTOSEL 6.13 3/8] firmware: qcom: scm: smc: Handle missing SCM device
  2025-01-26 16:45 [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100 Sasha Levin
@ 2025-01-26 16:45 ` Sasha Levin
  2025-01-26 16:45 ` [PATCH AUTOSEL 6.13 4/8] soc: qcom: llcc: Update configuration data for IPQ5424 Sasha Levin
  2025-02-04 10:21 ` [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100 Johan Hovold
  2 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2025-01-26 16:45 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Krzysztof Kozlowski, Bartosz Golaszewski, Bjorn Andersson,
	Sasha Levin, konradybcio, linux-arm-msm

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

[ Upstream commit 94f48ecf0a538019ca2025e0b0da391f8e7cc58c ]

Commit ca61d6836e6f ("firmware: qcom: scm: fix a NULL-pointer
dereference") makes it explicit that qcom_scm_get_tzmem_pool() can
return NULL, therefore its users should handle this.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20241209-qcom-scm-missing-barriers-and-all-sort-of-srap-v2-5-9061013c8d92@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/firmware/qcom/qcom_scm-smc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/firmware/qcom/qcom_scm-smc.c b/drivers/firmware/qcom/qcom_scm-smc.c
index 2b4c2826f5725..3f10b23ec941b 100644
--- a/drivers/firmware/qcom/qcom_scm-smc.c
+++ b/drivers/firmware/qcom/qcom_scm-smc.c
@@ -173,6 +173,9 @@ int __scm_smc_call(struct device *dev, const struct qcom_scm_desc *desc,
 		smc.args[i + SCM_SMC_FIRST_REG_IDX] = desc->args[i];
 
 	if (unlikely(arglen > SCM_SMC_N_REG_ARGS)) {
+		if (!mempool)
+			return -EINVAL;
+
 		args_virt = qcom_tzmem_alloc(mempool,
 					     SCM_SMC_N_EXT_ARGS * sizeof(u64),
 					     flag);
-- 
2.39.5


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

* [PATCH AUTOSEL 6.13 4/8] soc: qcom: llcc: Update configuration data for IPQ5424
  2025-01-26 16:45 [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100 Sasha Levin
  2025-01-26 16:45 ` [PATCH AUTOSEL 6.13 3/8] firmware: qcom: scm: smc: Handle missing SCM device Sasha Levin
@ 2025-01-26 16:45 ` Sasha Levin
  2025-02-04 10:21 ` [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100 Johan Hovold
  2 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2025-01-26 16:45 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Varadarajan Narayanan, Dmitry Baryshkov, Konrad Dybcio,
	Bjorn Andersson, Sasha Levin, konradybcio, linux-arm-msm

From: Varadarajan Narayanan <quic_varada@quicinc.com>

[ Upstream commit c88c323b610a6048b87c5d9fff69659678f69924 ]

The 'broadcast' register space is present only in chipsets that
have multiple instances of LLCC IP. Since IPQ5424 has only one
instance, both the LLCC and LLCC_BROADCAST points to the same
register space.

Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20241121051935.1055222-3-quic_varada@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soc/qcom/llcc-qcom.c | 57 ++++++++++++++++++++++++++++++++++--
 1 file changed, 55 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index 32c3bc887cefb..2b832b730be72 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -142,6 +142,7 @@ struct qcom_llcc_config {
 	bool skip_llcc_cfg;
 	bool no_edac;
 	bool irq_configured;
+	bool no_broadcast_register;
 };
 
 struct qcom_sct_config {
@@ -154,6 +155,38 @@ enum llcc_reg_offset {
 	LLCC_COMMON_STATUS0,
 };
 
+static const struct llcc_slice_config ipq5424_data[] =  {
+	{
+		.usecase_id = LLCC_CPUSS,
+		.slice_id = 1,
+		.max_cap = 768,
+		.priority = 1,
+		.bonus_ways = 0xFFFF,
+		.retain_on_pc = true,
+		.activate_on_init = true,
+		.write_scid_cacheable_en = true,
+		.stale_en = true,
+		.stale_cap_en = true,
+		.alloc_oneway_en = true,
+		.ovcap_en = true,
+		.ovcap_prio = true,
+		.vict_prio = true,
+	},
+	{
+		.usecase_id = LLCC_VIDSC0,
+		.slice_id = 2,
+		.max_cap = 256,
+		.priority = 2,
+		.fixed_size = true,
+		.bonus_ways = 0xF000,
+		.retain_on_pc = true,
+		.activate_on_init = true,
+		.write_scid_cacheable_en = true,
+		.stale_en = true,
+		.stale_cap_en = true,
+	},
+};
+
 static const struct llcc_slice_config sa8775p_data[] =  {
 	{
 		.usecase_id = LLCC_CPUSS,
@@ -3185,6 +3218,16 @@ static const struct qcom_llcc_config qdu1000_cfg[] = {
 	},
 };
 
+static const struct qcom_llcc_config ipq5424_cfg[] = {
+	{
+		.sct_data       = ipq5424_data,
+		.size           = ARRAY_SIZE(ipq5424_data),
+		.reg_offset     = llcc_v2_1_reg_offset,
+		.edac_reg_offset = &llcc_v2_1_edac_reg_offset,
+		.no_broadcast_register = true,
+	},
+};
+
 static const struct qcom_llcc_config sa8775p_cfg[] = {
 	{
 		.sct_data	= sa8775p_data,
@@ -3360,6 +3403,11 @@ static const struct qcom_sct_config qdu1000_cfgs = {
 	.num_config	= ARRAY_SIZE(qdu1000_cfg),
 };
 
+static const struct qcom_sct_config ipq5424_cfgs = {
+	.llcc_config	= ipq5424_cfg,
+	.num_config	= ARRAY_SIZE(ipq5424_cfg),
+};
+
 static const struct qcom_sct_config sa8775p_cfgs = {
 	.llcc_config	= sa8775p_cfg,
 	.num_config	= ARRAY_SIZE(sa8775p_cfg),
@@ -3957,8 +4005,12 @@ static int qcom_llcc_probe(struct platform_device *pdev)
 
 	drv_data->bcast_regmap = qcom_llcc_init_mmio(pdev, i, "llcc_broadcast_base");
 	if (IS_ERR(drv_data->bcast_regmap)) {
-		ret = PTR_ERR(drv_data->bcast_regmap);
-		goto err;
+		if (cfg->no_broadcast_register) {
+			drv_data->bcast_regmap = regmap;
+		} else {
+			ret = PTR_ERR(drv_data->bcast_regmap);
+			goto err;
+		}
 	}
 
 	/* Extract version of the IP */
@@ -4029,6 +4081,7 @@ static int qcom_llcc_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id qcom_llcc_of_match[] = {
+	{ .compatible = "qcom,ipq5424-llcc", .data = &ipq5424_cfgs},
 	{ .compatible = "qcom,qcs615-llcc", .data = &qcs615_cfgs},
 	{ .compatible = "qcom,qcs8300-llcc", .data = &qcs8300_cfgs},
 	{ .compatible = "qcom,qdu1000-llcc", .data = &qdu1000_cfgs},
-- 
2.39.5


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

* Re: [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100
  2025-01-26 16:45 [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100 Sasha Levin
  2025-01-26 16:45 ` [PATCH AUTOSEL 6.13 3/8] firmware: qcom: scm: smc: Handle missing SCM device Sasha Levin
  2025-01-26 16:45 ` [PATCH AUTOSEL 6.13 4/8] soc: qcom: llcc: Update configuration data for IPQ5424 Sasha Levin
@ 2025-02-04 10:21 ` Johan Hovold
  2025-02-04 20:17   ` Sasha Levin
  2 siblings, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2025-02-04 10:21 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Konrad Dybcio, Dmitry Baryshkov,
	Bjorn Andersson, konradybcio, linux-arm-msm

On Sun, Jan 26, 2025 at 11:45:16AM -0500, Sasha Levin wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> [ Upstream commit e7282bf8a0e9bb8a4cb1be406674ff7bb7b264f2 ]
> 
> X1P42100 is a cousin of X1E80100, and hence can make use of the
> latter's configuration. Do so.

This patch does not have a stable tag and makes no sense to backport as
support for this platform is not yet even in 6.14-rc1.

So please drop from all stable queues (if it's not too late for that
now).
 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Link: https://lore.kernel.org/r/20241221-topic-x1p4_soc-v1-3-55347831d73c@oss.qualcomm.com
> Signed-off-by: Bjorn Andersson <andersson@kernel.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  drivers/soc/qcom/qcom_pd_mapper.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/soc/qcom/qcom_pd_mapper.c b/drivers/soc/qcom/qcom_pd_mapper.c
> index 6e30f08761aa4..50aa54996901f 100644
> --- a/drivers/soc/qcom/qcom_pd_mapper.c
> +++ b/drivers/soc/qcom/qcom_pd_mapper.c
> @@ -561,6 +561,7 @@ static const struct of_device_id qcom_pdm_domains[] __maybe_unused = {
>  	{ .compatible = "qcom,sm8550", .data = sm8550_domains, },
>  	{ .compatible = "qcom,sm8650", .data = sm8550_domains, },
>  	{ .compatible = "qcom,x1e80100", .data = x1e80100_domains, },
> +	{ .compatible = "qcom,x1p42100", .data = x1e80100_domains, },
>  	{},
>  };

Johan

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

* Re: [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100
  2025-02-04 10:21 ` [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100 Johan Hovold
@ 2025-02-04 20:17   ` Sasha Levin
  0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2025-02-04 20:17 UTC (permalink / raw)
  To: Johan Hovold
  Cc: linux-kernel, stable, Konrad Dybcio, Dmitry Baryshkov,
	Bjorn Andersson, konradybcio, linux-arm-msm

On Tue, Feb 04, 2025 at 11:21:42AM +0100, Johan Hovold wrote:
>On Sun, Jan 26, 2025 at 11:45:16AM -0500, Sasha Levin wrote:
>> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>>
>> [ Upstream commit e7282bf8a0e9bb8a4cb1be406674ff7bb7b264f2 ]
>>
>> X1P42100 is a cousin of X1E80100, and hence can make use of the
>> latter's configuration. Do so.
>
>This patch does not have a stable tag and makes no sense to backport as
>support for this platform is not yet even in 6.14-rc1.
>
>So please drop from all stable queues (if it's not too late for that
>now).

Definitely not too late - patches without a stable tag sit for a while
in case anyone points out they shouldn't be included :)

I'll drop it, thank you!

-- 
Thanks,
Sasha

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

end of thread, other threads:[~2025-02-04 20:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-26 16:45 [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100 Sasha Levin
2025-01-26 16:45 ` [PATCH AUTOSEL 6.13 3/8] firmware: qcom: scm: smc: Handle missing SCM device Sasha Levin
2025-01-26 16:45 ` [PATCH AUTOSEL 6.13 4/8] soc: qcom: llcc: Update configuration data for IPQ5424 Sasha Levin
2025-02-04 10:21 ` [PATCH AUTOSEL 6.13 1/8] soc: qcom: pd-mapper: Add X1P42100 Johan Hovold
2025-02-04 20:17   ` Sasha Levin

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