2024-02-20 17:04:46

by Abel Vesa

[permalink] [raw]
Subject: [PATCH] arm64: dts: qcom: sm8[56]50: Fix SPMI channels size

The actual size of the channels registers region is 4MB, according to the
documentation. This issue was not caught until now because the driver was
supposed to allow same regions being mapped multiple times for supporting
multiple buses. Thie driver is using platform_get_resource_byname() and
devm_ioremap() towards that purpose, which intentionally avoids
devm_request_mem_region() altogether.

Signed-off-by: Abel Vesa <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sm8650.dtsi | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
index 7474cddf7ad3..3904348075f6 100644
--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
@@ -3318,7 +3318,7 @@ sram@c3f0000 {
spmi_bus: spmi@c400000 {
compatible = "qcom,spmi-pmic-arb";
reg = <0 0x0c400000 0 0x3000>,
- <0 0x0c500000 0 0x4000000>,
+ <0 0x0c500000 0 0x400000>,
<0 0x0c440000 0 0x80000>,
<0 0x0c4c0000 0 0x20000>,
<0 0x0c42d000 0 0x4000>;
diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi
index d488b3b3265e..260eda81b743 100644
--- a/arch/arm64/boot/dts/qcom/sm8650.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi
@@ -3747,7 +3747,7 @@ sram@c3f0000 {
spmi_bus: spmi@c400000 {
compatible = "qcom,spmi-pmic-arb";
reg = <0 0x0c400000 0 0x3000>,
- <0 0x0c500000 0 0x4000000>,
+ <0 0x0c500000 0 0x400000>,
<0 0x0c440000 0 0x80000>,
<0 0x0c4c0000 0 0x20000>,
<0 0x0c42d000 0 0x4000>;

---
base-commit: 2d5c7b7eb345249cb34d42cbc2b97b4c57ea944e
change-id: 20240220-dts-qcom-sm8550-fix-spmi-chnls-size-b8e6323fecc0

Best regards,
--
Abel Vesa <[email protected]>



2024-02-21 12:52:56

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: qcom: sm8[56]50: Fix SPMI channels size

Hi,

On 20/02/2024 18:04, Abel Vesa wrote:
> The actual size of the channels registers region is 4MB, according to the
> documentation. This issue was not caught until now because the driver was
> supposed to allow same regions being mapped multiple times for supporting
> multiple buses. Thie driver is using platform_get_resource_byname() and
> devm_ioremap() towards that purpose, which intentionally avoids
> devm_request_mem_region() altogether.
>
> Signed-off-by: Abel Vesa <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +-
> arch/arm64/boot/dts/qcom/sm8650.dtsi | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
> index 7474cddf7ad3..3904348075f6 100644
> --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
> @@ -3318,7 +3318,7 @@ sram@c3f0000 {
> spmi_bus: spmi@c400000 {
> compatible = "qcom,spmi-pmic-arb";
> reg = <0 0x0c400000 0 0x3000>,
> - <0 0x0c500000 0 0x4000000>,
> + <0 0x0c500000 0 0x400000>,
> <0 0x0c440000 0 0x80000>,
> <0 0x0c4c0000 0 0x20000>,
> <0 0x0c42d000 0 0x4000>;
> diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi
> index d488b3b3265e..260eda81b743 100644
> --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi
> @@ -3747,7 +3747,7 @@ sram@c3f0000 {
> spmi_bus: spmi@c400000 {
> compatible = "qcom,spmi-pmic-arb";
> reg = <0 0x0c400000 0 0x3000>,
> - <0 0x0c500000 0 0x4000000>,
> + <0 0x0c500000 0 0x400000>,
> <0 0x0c440000 0 0x80000>,
> <0 0x0c4c0000 0 0x20000>,
> <0 0x0c42d000 0 0x4000>;
>
> ---
> base-commit: 2d5c7b7eb345249cb34d42cbc2b97b4c57ea944e
> change-id: 20240220-dts-qcom-sm8550-fix-spmi-chnls-size-b8e6323fecc0
>
> Best regards,

I confirm the value, but I think you should split it in 2 and add Fixes tags

Take my:
Reviewed-by: Neil Armstrong <[email protected]>
if you re-spin.

Neil

2024-02-21 12:54:59

by Abel Vesa

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: qcom: sm8[56]50: Fix SPMI channels size

On 24-02-21 13:52:12, [email protected] wrote:
> Hi,
>
> On 20/02/2024 18:04, Abel Vesa wrote:
> > The actual size of the channels registers region is 4MB, according to the
> > documentation. This issue was not caught until now because the driver was
> > supposed to allow same regions being mapped multiple times for supporting
> > multiple buses. Thie driver is using platform_get_resource_byname() and
> > devm_ioremap() towards that purpose, which intentionally avoids
> > devm_request_mem_region() altogether.
> >
> > Signed-off-by: Abel Vesa <[email protected]>
> > ---
> > arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +-
> > arch/arm64/boot/dts/qcom/sm8650.dtsi | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
> > index 7474cddf7ad3..3904348075f6 100644
> > --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
> > @@ -3318,7 +3318,7 @@ sram@c3f0000 {
> > spmi_bus: spmi@c400000 {
> > compatible = "qcom,spmi-pmic-arb";
> > reg = <0 0x0c400000 0 0x3000>,
> > - <0 0x0c500000 0 0x4000000>,
> > + <0 0x0c500000 0 0x400000>,
> > <0 0x0c440000 0 0x80000>,
> > <0 0x0c4c0000 0 0x20000>,
> > <0 0x0c42d000 0 0x4000>;
> > diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi
> > index d488b3b3265e..260eda81b743 100644
> > --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi
> > @@ -3747,7 +3747,7 @@ sram@c3f0000 {
> > spmi_bus: spmi@c400000 {
> > compatible = "qcom,spmi-pmic-arb";
> > reg = <0 0x0c400000 0 0x3000>,
> > - <0 0x0c500000 0 0x4000000>,
> > + <0 0x0c500000 0 0x400000>,
> > <0 0x0c440000 0 0x80000>,
> > <0 0x0c4c0000 0 0x20000>,
> > <0 0x0c42d000 0 0x4000>;
> >
> > ---
> > base-commit: 2d5c7b7eb345249cb34d42cbc2b97b4c57ea944e
> > change-id: 20240220-dts-qcom-sm8550-fix-spmi-chnls-size-b8e6323fecc0
> >
> > Best regards,
>
> I confirm the value, but I think you should split it in 2 and add Fixes tags
>

Will split and re-send.

> Take my:
> Reviewed-by: Neil Armstrong <[email protected]>
> if you re-spin.

Thanks.

>
> Neil