mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] riscv: dts: sophgo: reduce SG2042 MSI count to 16
@ 2026-04-07 16:01 Icenowy Zheng
  2026-04-08  7:04 ` Chen Wang
  2026-06-03  2:10 ` Inochi Amaoto
  0 siblings, 2 replies; 4+ messages in thread
From: Icenowy Zheng @ 2026-04-07 16:01 UTC (permalink / raw)
  To: Thomas Gleixner, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Chen Wang, Inochi Amaoto, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti
  Cc: Han Gao, Zixian Zeng, Manivannan Sadhasivam, devicetree, sophgo,
	linux-riscv, linux-kernel, Icenowy Zheng

The SG2042 MSI controller has one 32-bit doorbell register, and each bit
corresponds to an interrupt. At a glance, it seems that the MSI
controller can support 32 interrupts; however the PCI MSI capability
only supports 16-bit messages, which makes the high 16 interrupts
unusable in such way.

Reduce the MSI count to 16 to prevent producing MSI message values that
cannot fit 16-bit integers.

Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
 arch/riscv/boot/dts/sophgo/sg2042.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/boot/dts/sophgo/sg2042.dtsi b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
index 9fddf3f0b3b99..9f1820a7b5a9f 100644
--- a/arch/riscv/boot/dts/sophgo/sg2042.dtsi
+++ b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
@@ -234,7 +234,7 @@ msi: msi-controller@7030010304 {
 			reg-names = "clr", "doorbell";
 			msi-controller;
 			#msi-cells = <0>;
-			msi-ranges = <&intc 64 IRQ_TYPE_EDGE_RISING 32>;
+			msi-ranges = <&intc 64 IRQ_TYPE_EDGE_RISING 16>;
 		};
 
 		rpgate: clock-controller@7030010368 {
-- 
2.52.0


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

* Re: [PATCH] riscv: dts: sophgo: reduce SG2042 MSI count to 16
  2026-04-07 16:01 [PATCH] riscv: dts: sophgo: reduce SG2042 MSI count to 16 Icenowy Zheng
@ 2026-04-08  7:04 ` Chen Wang
  2026-04-08  7:35   ` Icenowy Zheng
  2026-06-03  2:10 ` Inochi Amaoto
  1 sibling, 1 reply; 4+ messages in thread
From: Chen Wang @ 2026-04-08  7:04 UTC (permalink / raw)
  To: Icenowy Zheng, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti
  Cc: Han Gao, Zixian Zeng, Manivannan Sadhasivam, devicetree, sophgo,
	linux-riscv, linux-kernel


On 4/8/2026 12:01 AM, Icenowy Zheng wrote:
> The SG2042 MSI controller has one 32-bit doorbell register, and each bit
> corresponds to an interrupt. At a glance, it seems that the MSI
> controller can support 32 interrupts; however the PCI MSI capability
> only supports 16-bit messages, which makes the high 16 interrupts
> unusable in such way.
>
> Reduce the MSI count to 16 to prevent producing MSI message values that
> cannot fit 16-bit integers.
>
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ---
>   arch/riscv/boot/dts/sophgo/sg2042.dtsi | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/boot/dts/sophgo/sg2042.dtsi b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> index 9fddf3f0b3b99..9f1820a7b5a9f 100644
> --- a/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> +++ b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> @@ -234,7 +234,7 @@ msi: msi-controller@7030010304 {
>   			reg-names = "clr", "doorbell";
>   			msi-controller;
>   			#msi-cells = <0>;
> -			msi-ranges = <&intc 64 IRQ_TYPE_EDGE_RISING 32>;
> +			msi-ranges = <&intc 64 IRQ_TYPE_EDGE_RISING 16>;
>   		};
>   
>   		rpgate: clock-controller@7030010368 {

LGTM.

Reviewed-by: Chen Wang <unicorn_wang@outlook.com>

Tested-by: Chen Wang <unicorn_wang@outlook.com> on Pioneerbox.

Thanks,

Chen


Hi, Han,

Will you please run some quick test on EVB boards, I have no such 
hardware in hand, thanks.



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

* Re: [PATCH] riscv: dts: sophgo: reduce SG2042 MSI count to 16
  2026-04-08  7:04 ` Chen Wang
@ 2026-04-08  7:35   ` Icenowy Zheng
  0 siblings, 0 replies; 4+ messages in thread
From: Icenowy Zheng @ 2026-04-08  7:35 UTC (permalink / raw)
  To: Chen Wang, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti
  Cc: Han Gao, Zixian Zeng, Manivannan Sadhasivam, devicetree, sophgo,
	linux-riscv, linux-kernel

在 2026-04-08三的 15:04 +0800,Chen Wang写道:
> 
> On 4/8/2026 12:01 AM, Icenowy Zheng wrote:
> > The SG2042 MSI controller has one 32-bit doorbell register, and
> > each bit
> > corresponds to an interrupt. At a glance, it seems that the MSI
> > controller can support 32 interrupts; however the PCI MSI
> > capability
> > only supports 16-bit messages, which makes the high 16 interrupts
> > unusable in such way.
> > 
> > Reduce the MSI count to 16 to prevent producing MSI message values
> > that
> > cannot fit 16-bit integers.
> > 
> > Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> > ---
> >   arch/riscv/boot/dts/sophgo/sg2042.dtsi | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> > b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> > index 9fddf3f0b3b99..9f1820a7b5a9f 100644
> > --- a/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> > +++ b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> > @@ -234,7 +234,7 @@ msi: msi-controller@7030010304 {
> >   			reg-names = "clr", "doorbell";
> >   			msi-controller;
> >   			#msi-cells = <0>;
> > -			msi-ranges = <&intc 64
> > IRQ_TYPE_EDGE_RISING 32>;
> > +			msi-ranges = <&intc 64
> > IRQ_TYPE_EDGE_RISING 16>;
> >   		};
> >   
> >   		rpgate: clock-controller@7030010368 {
> 
> LGTM.
> 
> Reviewed-by: Chen Wang <unicorn_wang@outlook.com>
> 
> Tested-by: Chen Wang <unicorn_wang@outlook.com> on Pioneerbox.
> 
> Thanks,
> 
> Chen
> 
> 
> Hi, Han,
> 
> Will you please run some quick test on EVB boards, I have no such 
> hardware in hand, thanks.

I tested on EVB v1, but I have no access to EVB v2 either.

Thanks,
Icenowy

> 
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv


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

* Re: [PATCH] riscv: dts: sophgo: reduce SG2042 MSI count to 16
  2026-04-07 16:01 [PATCH] riscv: dts: sophgo: reduce SG2042 MSI count to 16 Icenowy Zheng
  2026-04-08  7:04 ` Chen Wang
@ 2026-06-03  2:10 ` Inochi Amaoto
  1 sibling, 0 replies; 4+ messages in thread
From: Inochi Amaoto @ 2026-06-03  2:10 UTC (permalink / raw)
  To: Thomas Gleixner, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Chen Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Icenowy Zheng
  Cc: Inochi Amaoto, Han Gao, Zixian Zeng, Manivannan Sadhasivam,
	devicetree, sophgo, linux-riscv, linux-kernel

On Wed, 08 Apr 2026 00:01:43 +0800, Icenowy Zheng wrote:
> The SG2042 MSI controller has one 32-bit doorbell register, and each bit
> corresponds to an interrupt. At a glance, it seems that the MSI
> controller can support 32 interrupts; however the PCI MSI capability
> only supports 16-bit messages, which makes the high 16 interrupts
> unusable in such way.
> 
> Reduce the MSI count to 16 to prevent producing MSI message values that
> cannot fit 16-bit integers.
> 
> [...]

Applied to for-next, thanks!

[1/1] riscv: dts: sophgo: reduce SG2042 MSI count to 16
      https://github.com/sophgo/linux/commit/903a9364e40563faf4730dc63ad7446246f494ff

Thanks,
Inochi


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

end of thread, other threads:[~2026-06-03  2:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-07 16:01 [PATCH] riscv: dts: sophgo: reduce SG2042 MSI count to 16 Icenowy Zheng
2026-04-08  7:04 ` Chen Wang
2026-04-08  7:35   ` Icenowy Zheng
2026-06-03  2:10 ` Inochi Amaoto

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®