linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()
@ 2023-10-10  8:21 Hanjun Guo
  2023-10-10  8:50 ` Sudeep Holla
  2023-10-10 18:11 ` D Scott Phillips
  0 siblings, 2 replies; 7+ messages in thread
From: Hanjun Guo @ 2023-10-10  8:21 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Sudeep Holla, Rafael J . Wysocki, Robin Murphy
  Cc: linux-acpi, linux-arm-kernel, Hanjun Guo, D Scott Phillips

acpi_agdi_init() in acpi_arm_init() will register a SDEI event, so
it needs the SDEI subsystem to be initialized (which is done in
acpi_ghes_init()) before the AGDI driver probing.

In commit fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific
initialisation into acpi_arm_init()"), the acpi_agdi_init() was
called before acpi_ghes_init() and it causes following failure:

| [    0.515864] sdei: Failed to create event 1073741825: -5
| [    0.515866] agdi agdi.0: Failed to register for SDEI event 1073741825
| [    0.515867] agdi: probe of agdi.0 failed with error -5
| ...
| [    0.516022] sdei: SDEIv1.0 (0x0) detected in firmware.

Fix it by moving acpi_arm_init() to the place of after
acpi_ghes_init().

Fixes: fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()")
Reported-by: D Scott Phillips <scott@os.amperecomputing.com>
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---

I did a test on a ARM server and I didn't see regressions, but
I don't have a AGDI table firmware, so Scott please give a 
test to see if it fixes your issue.

 drivers/acpi/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index f41dda2d3493..a4aa53b7e2bb 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1410,10 +1410,10 @@ static int __init acpi_init(void)
 	acpi_init_ffh();
 
 	pci_mmcfg_late_init();
-	acpi_arm_init();
 	acpi_viot_early_init();
 	acpi_hest_init();
 	acpi_ghes_init();
+	acpi_arm_init();
 	acpi_scan_init();
 	acpi_ec_init();
 	acpi_debugfs_init();
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()
  2023-10-10  8:21 [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init() Hanjun Guo
@ 2023-10-10  8:50 ` Sudeep Holla
  2023-10-10  9:30   ` Robin Murphy
  2023-10-10 18:11 ` D Scott Phillips
  1 sibling, 1 reply; 7+ messages in thread
From: Sudeep Holla @ 2023-10-10  8:50 UTC (permalink / raw)
  To: Hanjun Guo, Jean-Philippe Brucker, Robin Murphy
  Cc: Lorenzo Pieralisi, Rafael J . Wysocki, linux-acpi,
	linux-arm-kernel, D Scott Phillips

On Tue, Oct 10, 2023 at 04:21:23PM +0800, Hanjun Guo wrote:
> acpi_agdi_init() in acpi_arm_init() will register a SDEI event, so
> it needs the SDEI subsystem to be initialized (which is done in
> acpi_ghes_init()) before the AGDI driver probing.
> 
> In commit fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific
> initialisation into acpi_arm_init()"), the acpi_agdi_init() was
> called before acpi_ghes_init() and it causes following failure:
> 
> | [    0.515864] sdei: Failed to create event 1073741825: -5
> | [    0.515866] agdi agdi.0: Failed to register for SDEI event 1073741825
> | [    0.515867] agdi: probe of agdi.0 failed with error -5
> | ...
> | [    0.516022] sdei: SDEIv1.0 (0x0) detected in firmware.
> 
> Fix it by moving acpi_arm_init() to the place of after
> acpi_ghes_init().
> 
> Fixes: fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()")
> Reported-by: D Scott Phillips <scott@os.amperecomputing.com>
> Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
> ---
> 
> I did a test on a ARM server and I didn't see regressions, but
> I don't have a AGDI table firmware, so Scott please give a 
> test to see if it fixes your issue.
> 
>  drivers/acpi/bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index f41dda2d3493..a4aa53b7e2bb 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -1410,10 +1410,10 @@ static int __init acpi_init(void)
>  	acpi_init_ffh();
>
>  	pci_mmcfg_late_init();
> -	acpi_arm_init();
>  	acpi_viot_early_init();
>  	acpi_hest_init();
>  	acpi_ghes_init();
> +	acpi_arm_init();

I am fine with the change, but just wanted to check with Robin/Jean-Philippe
if there are any dependency on IORT initialisation for VIOT ? IIUC IORT was
always initialised before VIOT but that changes after this change.

If it turns how to have dependency, then does moving GHES and HEST
initialisation before acpi_arm_init() work ?

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()
  2023-10-10  8:50 ` Sudeep Holla
@ 2023-10-10  9:30   ` Robin Murphy
  2023-10-10  9:44     ` Sudeep Holla
  2023-10-10 14:10     ` Jean-Philippe Brucker
  0 siblings, 2 replies; 7+ messages in thread
From: Robin Murphy @ 2023-10-10  9:30 UTC (permalink / raw)
  To: Sudeep Holla, Hanjun Guo, Jean-Philippe Brucker
  Cc: Lorenzo Pieralisi, Rafael J . Wysocki, linux-acpi,
	linux-arm-kernel, D Scott Phillips

On 2023-10-10 09:50, Sudeep Holla wrote:
> On Tue, Oct 10, 2023 at 04:21:23PM +0800, Hanjun Guo wrote:
>> acpi_agdi_init() in acpi_arm_init() will register a SDEI event, so
>> it needs the SDEI subsystem to be initialized (which is done in
>> acpi_ghes_init()) before the AGDI driver probing.
>>
>> In commit fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific
>> initialisation into acpi_arm_init()"), the acpi_agdi_init() was
>> called before acpi_ghes_init() and it causes following failure:
>>
>> | [    0.515864] sdei: Failed to create event 1073741825: -5
>> | [    0.515866] agdi agdi.0: Failed to register for SDEI event 1073741825
>> | [    0.515867] agdi: probe of agdi.0 failed with error -5
>> | ...
>> | [    0.516022] sdei: SDEIv1.0 (0x0) detected in firmware.
>>
>> Fix it by moving acpi_arm_init() to the place of after
>> acpi_ghes_init().
>>
>> Fixes: fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()")
>> Reported-by: D Scott Phillips <scott@os.amperecomputing.com>
>> Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
>> ---
>>
>> I did a test on a ARM server and I didn't see regressions, but
>> I don't have a AGDI table firmware, so Scott please give a
>> test to see if it fixes your issue.
>>
>>   drivers/acpi/bus.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
>> index f41dda2d3493..a4aa53b7e2bb 100644
>> --- a/drivers/acpi/bus.c
>> +++ b/drivers/acpi/bus.c
>> @@ -1410,10 +1410,10 @@ static int __init acpi_init(void)
>>   	acpi_init_ffh();
>>
>>   	pci_mmcfg_late_init();
>> -	acpi_arm_init();
>>   	acpi_viot_early_init();
>>   	acpi_hest_init();
>>   	acpi_ghes_init();
>> +	acpi_arm_init();
> 
> I am fine with the change, but just wanted to check with Robin/Jean-Philippe
> if there are any dependency on IORT initialisation for VIOT ? IIUC IORT was
> always initialised before VIOT but that changes after this change.

They should be independent, and typically we'd only expect to see one or 
the other anyway (although strictly a VMM *could* provide virtio-iommu 
for some devices while also emulating an SMMU for others if it really 
really wanted to).

Cheers,
Robin.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()
  2023-10-10  9:30   ` Robin Murphy
@ 2023-10-10  9:44     ` Sudeep Holla
  2023-10-10 14:10     ` Jean-Philippe Brucker
  1 sibling, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2023-10-10  9:44 UTC (permalink / raw)
  To: Robin Murphy, Hanjun Guo, Rafael J . Wysocki
  Cc: Jean-Philippe Brucker, Lorenzo Pieralisi, linux-acpi,
	linux-arm-kernel, D Scott Phillips

On Tue, Oct 10, 2023 at 10:30:56AM +0100, Robin Murphy wrote:
> On 2023-10-10 09:50, Sudeep Holla wrote:
> > On Tue, Oct 10, 2023 at 04:21:23PM +0800, Hanjun Guo wrote:
> > > acpi_agdi_init() in acpi_arm_init() will register a SDEI event, so
> > > it needs the SDEI subsystem to be initialized (which is done in
> > > acpi_ghes_init()) before the AGDI driver probing.
> > > 
> > > In commit fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific
> > > initialisation into acpi_arm_init()"), the acpi_agdi_init() was
> > > called before acpi_ghes_init() and it causes following failure:
> > > 
> > > | [    0.515864] sdei: Failed to create event 1073741825: -5
> > > | [    0.515866] agdi agdi.0: Failed to register for SDEI event 1073741825
> > > | [    0.515867] agdi: probe of agdi.0 failed with error -5
> > > | ...
> > > | [    0.516022] sdei: SDEIv1.0 (0x0) detected in firmware.
> > > 
> > > Fix it by moving acpi_arm_init() to the place of after
> > > acpi_ghes_init().
> > > 
> > > Fixes: fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()")
> > > Reported-by: D Scott Phillips <scott@os.amperecomputing.com>
> > > Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
> > > ---
> > > 
> > > I did a test on a ARM server and I didn't see regressions, but
> > > I don't have a AGDI table firmware, so Scott please give a
> > > test to see if it fixes your issue.
> > > 
> > >   drivers/acpi/bus.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> > > index f41dda2d3493..a4aa53b7e2bb 100644
> > > --- a/drivers/acpi/bus.c
> > > +++ b/drivers/acpi/bus.c
> > > @@ -1410,10 +1410,10 @@ static int __init acpi_init(void)
> > >   	acpi_init_ffh();
> > > 
> > >   	pci_mmcfg_late_init();
> > > -	acpi_arm_init();
> > >   	acpi_viot_early_init();
> > >   	acpi_hest_init();
> > >   	acpi_ghes_init();
> > > +	acpi_arm_init();
> > 
> > I am fine with the change, but just wanted to check with Robin/Jean-Philippe
> > if there are any dependency on IORT initialisation for VIOT ? IIUC IORT was
> > always initialised before VIOT but that changes after this change.
> 
> They should be independent, and typically we'd only expect to see one or the
> other anyway (although strictly a VMM *could* provide virtio-iommu for some
> devices while also emulating an SMMU for others if it really really wanted
> to).
>

Thanks Robin for the explanation, that helped me to understand the usage
better.

Hanjun,

In that case,
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

Rafael,

Can you please pick this up as fix for v6.6 if possible ?

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()
  2023-10-10  9:30   ` Robin Murphy
  2023-10-10  9:44     ` Sudeep Holla
@ 2023-10-10 14:10     ` Jean-Philippe Brucker
  1 sibling, 0 replies; 7+ messages in thread
From: Jean-Philippe Brucker @ 2023-10-10 14:10 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Sudeep Holla, Hanjun Guo, Lorenzo Pieralisi, Rafael J . Wysocki,
	linux-acpi, linux-arm-kernel, D Scott Phillips

On Tue, Oct 10, 2023 at 10:30:56AM +0100, Robin Murphy wrote:
> On 2023-10-10 09:50, Sudeep Holla wrote:
> > On Tue, Oct 10, 2023 at 04:21:23PM +0800, Hanjun Guo wrote:
> > > acpi_agdi_init() in acpi_arm_init() will register a SDEI event, so
> > > it needs the SDEI subsystem to be initialized (which is done in
> > > acpi_ghes_init()) before the AGDI driver probing.
> > > 
> > > In commit fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific
> > > initialisation into acpi_arm_init()"), the acpi_agdi_init() was
> > > called before acpi_ghes_init() and it causes following failure:
> > > 
> > > | [    0.515864] sdei: Failed to create event 1073741825: -5
> > > | [    0.515866] agdi agdi.0: Failed to register for SDEI event 1073741825
> > > | [    0.515867] agdi: probe of agdi.0 failed with error -5
> > > | ...
> > > | [    0.516022] sdei: SDEIv1.0 (0x0) detected in firmware.
> > > 
> > > Fix it by moving acpi_arm_init() to the place of after
> > > acpi_ghes_init().
> > > 
> > > Fixes: fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()")
> > > Reported-by: D Scott Phillips <scott@os.amperecomputing.com>
> > > Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
> > > ---
> > > 
> > > I did a test on a ARM server and I didn't see regressions, but
> > > I don't have a AGDI table firmware, so Scott please give a
> > > test to see if it fixes your issue.
> > > 
> > >   drivers/acpi/bus.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> > > index f41dda2d3493..a4aa53b7e2bb 100644
> > > --- a/drivers/acpi/bus.c
> > > +++ b/drivers/acpi/bus.c
> > > @@ -1410,10 +1410,10 @@ static int __init acpi_init(void)
> > >   	acpi_init_ffh();
> > > 
> > >   	pci_mmcfg_late_init();
> > > -	acpi_arm_init();
> > >   	acpi_viot_early_init();
> > >   	acpi_hest_init();
> > >   	acpi_ghes_init();
> > > +	acpi_arm_init();
> > 
> > I am fine with the change, but just wanted to check with Robin/Jean-Philippe
> > if there are any dependency on IORT initialisation for VIOT ? IIUC IORT was
> > always initialised before VIOT but that changes after this change.
> 
> They should be independent, and typically we'd only expect to see one or the
> other anyway (although strictly a VMM *could* provide virtio-iommu for some
> devices while also emulating an SMMU for others if it really really wanted
> to).

IORT also describes the GIC ITS topology, so QEMU (and likely
cloud-hypervisor) do present both tables to a guest. But I don't think the
order matters in any case, and QEMU still boots fine with this patch.

Thanks,
Jean


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()
  2023-10-10  8:21 [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init() Hanjun Guo
  2023-10-10  8:50 ` Sudeep Holla
@ 2023-10-10 18:11 ` D Scott Phillips
  2023-10-18 11:30   ` Rafael J. Wysocki
  1 sibling, 1 reply; 7+ messages in thread
From: D Scott Phillips @ 2023-10-10 18:11 UTC (permalink / raw)
  To: Hanjun Guo, Lorenzo Pieralisi, Sudeep Holla, Rafael J . Wysocki,
	Robin Murphy
  Cc: linux-acpi, linux-arm-kernel, Hanjun Guo

Hanjun Guo <guohanjun@huawei.com> writes:

> acpi_agdi_init() in acpi_arm_init() will register a SDEI event, so
> it needs the SDEI subsystem to be initialized (which is done in
> acpi_ghes_init()) before the AGDI driver probing.
>
> In commit fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific
> initialisation into acpi_arm_init()"), the acpi_agdi_init() was
> called before acpi_ghes_init() and it causes following failure:
>
> | [    0.515864] sdei: Failed to create event 1073741825: -5
> | [    0.515866] agdi agdi.0: Failed to register for SDEI event 1073741825
> | [    0.515867] agdi: probe of agdi.0 failed with error -5
> | ...
> | [    0.516022] sdei: SDEIv1.0 (0x0) detected in firmware.
>
> Fix it by moving acpi_arm_init() to the place of after
> acpi_ghes_init().
>
> Fixes: fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()")
> Reported-by: D Scott Phillips <scott@os.amperecomputing.com>
> Signed-off-by: Hanjun Guo <guohanjun@huawei.com>

Tested-by: D Scott Phillips <scott@os.amperecomputing.com>

Thanks Hanjun and Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()
  2023-10-10 18:11 ` D Scott Phillips
@ 2023-10-18 11:30   ` Rafael J. Wysocki
  0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2023-10-18 11:30 UTC (permalink / raw)
  To: D Scott Phillips, Hanjun Guo
  Cc: Lorenzo Pieralisi, Sudeep Holla, Robin Murphy, linux-acpi,
	linux-arm-kernel

On Tue, Oct 10, 2023 at 8:11 PM D Scott Phillips
<scott@os.amperecomputing.com> wrote:
>
> Hanjun Guo <guohanjun@huawei.com> writes:
>
> > acpi_agdi_init() in acpi_arm_init() will register a SDEI event, so
> > it needs the SDEI subsystem to be initialized (which is done in
> > acpi_ghes_init()) before the AGDI driver probing.
> >
> > In commit fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific
> > initialisation into acpi_arm_init()"), the acpi_agdi_init() was
> > called before acpi_ghes_init() and it causes following failure:
> >
> > | [    0.515864] sdei: Failed to create event 1073741825: -5
> > | [    0.515866] agdi agdi.0: Failed to register for SDEI event 1073741825
> > | [    0.515867] agdi: probe of agdi.0 failed with error -5
> > | ...
> > | [    0.516022] sdei: SDEIv1.0 (0x0) detected in firmware.
> >
> > Fix it by moving acpi_arm_init() to the place of after
> > acpi_ghes_init().
> >
> > Fixes: fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()")
> > Reported-by: D Scott Phillips <scott@os.amperecomputing.com>
> > Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
>
> Tested-by: D Scott Phillips <scott@os.amperecomputing.com>
>
> Thanks Hanjun and Sudeep

Applied as 6.6-rc material, thanks!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-10-18 11:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-10  8:21 [PATCH] ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init() Hanjun Guo
2023-10-10  8:50 ` Sudeep Holla
2023-10-10  9:30   ` Robin Murphy
2023-10-10  9:44     ` Sudeep Holla
2023-10-10 14:10     ` Jean-Philippe Brucker
2023-10-10 18:11 ` D Scott Phillips
2023-10-18 11:30   ` Rafael J. Wysocki

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).