linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: ti: k3-j721s2: fix overlapping GICD memory region
@ 2022-06-16 10:51 Matt Ranostay
  2022-06-16 12:07 ` Robin Murphy
  2022-06-17 13:05 ` Nishanth Menon
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Ranostay @ 2022-06-16 10:51 UTC (permalink / raw)
  To: devicetree, linux-kernel
  Cc: Matt Ranostay, Marc Zyngier, Robin Murphy, Nishanth Menon

GICD region was overlapping with GICR causing the latter to not map
successfully, and in turn the gic-v3 driver would fail to initialize.

This issue was hidden till commit 2b2cd74a06c3 ("irqchip/gic-v3: Claim iomem resources")
replaced of_iomap() calls with of_io_request_and_map() that internally
called request_mem_region().

Respective console output before this patchset:

[    0.000000] GICv3: /bus@100000/interrupt-controller@1800000: couldn't map region 0

Cc: Marc Zyngier <maz@kernel.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Nishanth Menon <nm@ti.com>
Signed-off-by: Matt Ranostay <mranostay@ti.com>
---
 arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi b/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
index be7f39299894..19966f72c5b3 100644
--- a/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
@@ -33,7 +33,7 @@ gic500: interrupt-controller@1800000 {
 		ranges;
 		#interrupt-cells = <3>;
 		interrupt-controller;
-		reg = <0x00 0x01800000 0x00 0x200000>, /* GICD */
+		reg = <0x00 0x01800000 0x00 0x100000>, /* GICD */
 		      <0x00 0x01900000 0x00 0x100000>, /* GICR */
 		      <0x00 0x6f000000 0x00 0x2000>,   /* GICC */
 		      <0x00 0x6f010000 0x00 0x1000>,   /* GICH */
-- 
2.36.1


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

* Re: [PATCH] arm64: dts: ti: k3-j721s2: fix overlapping GICD memory region
  2022-06-16 10:51 [PATCH] arm64: dts: ti: k3-j721s2: fix overlapping GICD memory region Matt Ranostay
@ 2022-06-16 12:07 ` Robin Murphy
  2022-06-16 12:13   ` Marc Zyngier
  2022-06-17 13:05 ` Nishanth Menon
  1 sibling, 1 reply; 5+ messages in thread
From: Robin Murphy @ 2022-06-16 12:07 UTC (permalink / raw)
  To: Matt Ranostay, Marc Zyngier; +Cc: Nishanth Menon, devicetree, linux-kernel

On 2022-06-16 11:51, Matt Ranostay wrote:
> GICD region was overlapping with GICR causing the latter to not map
> successfully, and in turn the gic-v3 driver would fail to initialize.
> 
> This issue was hidden till commit 2b2cd74a06c3 ("irqchip/gic-v3: Claim iomem resources")
> replaced of_iomap() calls with of_io_request_and_map() that internally
> called request_mem_region().
> 
> Respective console output before this patchset:
> 
> [    0.000000] GICv3: /bus@100000/interrupt-controller@1800000: couldn't map region 0

Oh, it's nice that this finds bugs, but it seems I hadn't fully 
considered that making the simple easy change in the DT paths results in 
different behaviour from ACPI.

Marc, would you like a fix for this to remain non-fatal even in the face 
of a dodgy DT, or are you happy with being a bit stricter now?

Thanks,
Robin.

> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Nishanth Menon <nm@ti.com>
> Signed-off-by: Matt Ranostay <mranostay@ti.com>
> ---
>   arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi b/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
> index be7f39299894..19966f72c5b3 100644
> --- a/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
> @@ -33,7 +33,7 @@ gic500: interrupt-controller@1800000 {
>   		ranges;
>   		#interrupt-cells = <3>;
>   		interrupt-controller;
> -		reg = <0x00 0x01800000 0x00 0x200000>, /* GICD */
> +		reg = <0x00 0x01800000 0x00 0x100000>, /* GICD */
>   		      <0x00 0x01900000 0x00 0x100000>, /* GICR */
>   		      <0x00 0x6f000000 0x00 0x2000>,   /* GICC */
>   		      <0x00 0x6f010000 0x00 0x1000>,   /* GICH */

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

* Re: [PATCH] arm64: dts: ti: k3-j721s2: fix overlapping GICD memory region
  2022-06-16 12:07 ` Robin Murphy
@ 2022-06-16 12:13   ` Marc Zyngier
  2022-06-16 12:19     ` Robin Murphy
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2022-06-16 12:13 UTC (permalink / raw)
  To: Robin Murphy; +Cc: Matt Ranostay, Nishanth Menon, devicetree, linux-kernel

On Thu, 16 Jun 2022 13:07:23 +0100,
Robin Murphy <robin.murphy@arm.com> wrote:
> 
> On 2022-06-16 11:51, Matt Ranostay wrote:
> > GICD region was overlapping with GICR causing the latter to not map
> > successfully, and in turn the gic-v3 driver would fail to initialize.
> > 
> > This issue was hidden till commit 2b2cd74a06c3 ("irqchip/gic-v3: Claim iomem resources")
> > replaced of_iomap() calls with of_io_request_and_map() that internally
> > called request_mem_region().
> > 
> > Respective console output before this patchset:
> > 
> > [    0.000000] GICv3: /bus@100000/interrupt-controller@1800000: couldn't map region 0
> 
> Oh, it's nice that this finds bugs, but it seems I hadn't fully
> considered that making the simple easy change in the DT paths results
> in different behaviour from ACPI.
> 
> Marc, would you like a fix for this to remain non-fatal even in the
> face of a dodgy DT, or are you happy with being a bit stricter now?

I'd rather we work around it. I shout at people for breaking existing
DTs, so this should apply to the GIC as well. A nice WARN_ON_ONCE()
should do, if you don't mind writing the patch.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

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

* Re: [PATCH] arm64: dts: ti: k3-j721s2: fix overlapping GICD memory region
  2022-06-16 12:13   ` Marc Zyngier
@ 2022-06-16 12:19     ` Robin Murphy
  0 siblings, 0 replies; 5+ messages in thread
From: Robin Murphy @ 2022-06-16 12:19 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Matt Ranostay, Nishanth Menon, devicetree, linux-kernel

On 2022-06-16 13:13, Marc Zyngier wrote:
> On Thu, 16 Jun 2022 13:07:23 +0100,
> Robin Murphy <robin.murphy@arm.com> wrote:
>>
>> On 2022-06-16 11:51, Matt Ranostay wrote:
>>> GICD region was overlapping with GICR causing the latter to not map
>>> successfully, and in turn the gic-v3 driver would fail to initialize.
>>>
>>> This issue was hidden till commit 2b2cd74a06c3 ("irqchip/gic-v3: Claim iomem resources")
>>> replaced of_iomap() calls with of_io_request_and_map() that internally
>>> called request_mem_region().
>>>
>>> Respective console output before this patchset:
>>>
>>> [    0.000000] GICv3: /bus@100000/interrupt-controller@1800000: couldn't map region 0
>>
>> Oh, it's nice that this finds bugs, but it seems I hadn't fully
>> considered that making the simple easy change in the DT paths results
>> in different behaviour from ACPI.
>>
>> Marc, would you like a fix for this to remain non-fatal even in the
>> face of a dodgy DT, or are you happy with being a bit stricter now?
> 
> I'd rather we work around it. I shout at people for breaking existing
> DTs, so this should apply to the GIC as well. A nice WARN_ON_ONCE()
> should do, if you don't mind writing the patch.

Indeed, I think that would be my default preference as well - apologies 
for the oversight! I'll spin the patch shortly (and make the warning 
consistent for the ACPI side too).

Cheers,
Robin.

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

* Re: [PATCH] arm64: dts: ti: k3-j721s2: fix overlapping GICD memory region
  2022-06-16 10:51 [PATCH] arm64: dts: ti: k3-j721s2: fix overlapping GICD memory region Matt Ranostay
  2022-06-16 12:07 ` Robin Murphy
@ 2022-06-17 13:05 ` Nishanth Menon
  1 sibling, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2022-06-17 13:05 UTC (permalink / raw)
  To: Matt Ranostay; +Cc: devicetree, linux-kernel, Marc Zyngier, Robin Murphy

Matt,

	please cc linux-arm-kernel mailing list as well

On 03:51-20220616, Matt Ranostay wrote:
> GICD region was overlapping with GICR causing the latter to not map
> successfully, and in turn the gic-v3 driver would fail to initialize.
> 
> This issue was hidden till commit 2b2cd74a06c3 ("irqchip/gic-v3: Claim iomem resources")
> replaced of_iomap() calls with of_io_request_and_map() that internally
> called request_mem_region().
> 
> Respective console output before this patchset:
> 
> [    0.000000] GICv3: /bus@100000/interrupt-controller@1800000: couldn't map region 0
> 
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Nishanth Menon <nm@ti.com>
> Signed-off-by: Matt Ranostay <mranostay@ti.com>

Thank you for root causing the bug, BUT, please add a Fixes: tag as
well. this needs to go into stable as well.

> ---
>  arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi b/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
> index be7f39299894..19966f72c5b3 100644
> --- a/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
> @@ -33,7 +33,7 @@ gic500: interrupt-controller@1800000 {
>  		ranges;
>  		#interrupt-cells = <3>;
>  		interrupt-controller;
> -		reg = <0x00 0x01800000 0x00 0x200000>, /* GICD */
> +		reg = <0x00 0x01800000 0x00 0x100000>, /* GICD */
>  		      <0x00 0x01900000 0x00 0x100000>, /* GICR */
>  		      <0x00 0x6f000000 0x00 0x2000>,   /* GICC */
>  		      <0x00 0x6f010000 0x00 0x1000>,   /* GICH */
> -- 
> 2.36.1
> 

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

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

end of thread, other threads:[~2022-06-17 13:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 10:51 [PATCH] arm64: dts: ti: k3-j721s2: fix overlapping GICD memory region Matt Ranostay
2022-06-16 12:07 ` Robin Murphy
2022-06-16 12:13   ` Marc Zyngier
2022-06-16 12:19     ` Robin Murphy
2022-06-17 13:05 ` Nishanth Menon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).