Re: [Devel] 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
by Zheng, Lv
Hi, Imre
> From: Deak, Imre
> Subject: Re: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
>
> On Fri, 2016-10-21 at 22:46 +0300, Zheng, Lv wrote:
> > [...]
> > I checked the code, only found one issue.
> > And I'm not sure if it is related.
> > Please send me the full dmesg containing the errors and the acpidump
> > output.
>
> I attached the dmesg containing the error during boot (happened 1 out
> of 200 boots), during reboot (20 out of 200 reboots), during suspend
> (happened all the time).
I just checked the error and the related code.
1. What the error is
The error message is generated by an old method auto-serial mechanism.
However this mechanism should have been disabled by new auto-serial approach.
See: the error is generated by the code in drivers/acpi/acpica/psparse.c:
if ((status == AE_ALREADY_EXISTS) &&
(!(walk_state->method_desc->method.
info_flags & ACPI_METHOD_SERIALIZED))) {
/*
* Method is not serialized and tried to create an object
* twice. The probable cause is that the method cannot
* handle reentrancy. Mark as "pending serialized" now, and
* then mark "serialized" when the last thread exits.
*/
walk_state->method_desc->method.info_flags |=
ACPI_METHOD_SERIALIZED_PENDING;
}
It can only happen when ACPI_METHOD_SERIALIZED flag is not set.
However, in the upstream kernel, this flag is set by the code in drivers/acpi/acpica/dsinit.c:
if (obj_desc->method.info_flags & ACPI_METHOD_SERIALIZED) {
info->serial_method_count++;
break;
}
if (acpi_gbl_auto_serialize_methods) {
/* Parse/scan method and serialize it if necessary */
acpi_ds_auto_serialize_method(node, obj_desc);
if (obj_desc->method.
info_flags & ACPI_METHOD_SERIALIZED) {
/* Method was just converted to Serialized */
info->serial_method_count++;
info->serialized_method_count++;
break;
}
}
Which is invoked by acpi_ds_initialize_objects(), always invoked in acpi_ns_load_table().
Unless acpi_gbl_auto_serialize_methods = false or acpi_ns_parse_table() failed, the flag won't be remained unset.
The error message is generated by old auto-serialize implementation.
And acpi_gbl_auto_serialize_methods is meant to mute the warnings.
Both mechanism should work, thus this error message is not fatal.
It just makes ACPICA to fall back to use old auto-serial method.
So the issue is not urgent.
2. Why the error message is caused
I couldn't see whether the bisected commit can be related to this feature.
It seems we need your help to debug what the problem is.
First, please try the mentioned branch here:
https://github.com/zetalog/linux
acpica-lock branch.
As I may need to ask for several debugging steps, let me file a kernel Bugzilla bug for this.
So that we can communicate there in order not to bother others:
https://bugzilla.kernel.org/show_bug.cgi?id=180111
Thanks and best regards
Lv
>
> I attached the acpidump output.
>
> > Please give the fix a try (see attachment).
>
> The patch didn't apply on 4.9-rc1 or Linus' master, please see the
> attached patch for my attempt to resolve the conflicts. With the patch
> applied I could still trigger the same problem during suspend.
>
> --Imre
>
> > I'm sorry for sending fix patch using attachment.
> > It's not convenient for me due to my current working environment.
> >
> > Thanks and best regards
> > Lv
5 years, 8 months
Re: [Devel] 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
by Zheng, Lv
Hi, Imre
> From: Deak, Imre
> Subject: Re: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
>
> On ti, 2016-10-25 at 04:14 +0300, Zheng, Lv wrote:
> > Hi, Imre
> >
> > I think this is the root cause fix:
> > https://github.com/zetalog/linux/commit/108009d0
> > Which seems to be an old trap triggered by the good fix.
> >
> > Could you give the fix commit a try?
> > It’s better to use this branch, where more improvements are included:
> > git clone linux-acpica https://github.com/zetalog/linux
> > git branch acpica-lock linux-acpica/acpica-lock
> > git checkout acpica-lock
>
> Yes, with the above branch I couldn't reproduce the problem during
> suspend/resume while reverting 108009d0 made the problem reappear.
Thanks for the bug report.
I've sent the patches to the ACPI mailinglist.
Best regards
Lv
5 years, 8 months
Re: [Devel] 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
by Zheng, Lv
Hi, Imre
I think this is the root cause fix:
https://github.com/zetalog/linux/commit/108009d0
Which seems to be an old trap triggered by the good fix.
Could you give the fix commit a try?
It’s better to use this branch, where more improvements are included:
git clone linux-acpica https://github.com/zetalog/linux
git branch acpica-lock linux-acpica/acpica-lock
git checkout acpica-lock
Thanks in advance.
Best regards
Lv
> From: Zheng, Lv
> Subject: RE: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
>
> Hi, Imre
>
> > From: Deak, Imre
> > Subject: Re: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
> >
> > On Fri, 2016-10-21 at 22:46 +0300, Zheng, Lv wrote:
> > > [...]
> > > I checked the code, only found one issue.
> > > And I'm not sure if it is related.
> > > Please send me the full dmesg containing the errors and the acpidump
> > > output.
> >
> > I attached the dmesg containing the error during boot (happened 1 out
> > of 200 boots), during reboot (20 out of 200 reboots), during suspend
> > (happened all the time).
>
> I just checked the error and the related code.
>
> 1. What the error is
> The error message is generated by an old method auto-serial mechanism.
> However this mechanism should have been disabled by new auto-serial approach.
>
> See: the error is generated by the code in drivers/acpi/acpica/psparse.c:
> if ((status == AE_ALREADY_EXISTS) &&
> (!(walk_state->method_desc->method.
> info_flags & ACPI_METHOD_SERIALIZED))) {
> /*
> * Method is not serialized and tried to create an object
> * twice. The probable cause is that the method cannot
> * handle reentrancy. Mark as "pending serialized" now, and
> * then mark "serialized" when the last thread exits.
> */
> walk_state->method_desc->method.info_flags |=
> ACPI_METHOD_SERIALIZED_PENDING;
> }
> It can only happen when ACPI_METHOD_SERIALIZED flag is not set.
> However, in the upstream kernel, this flag is set by the code in drivers/acpi/acpica/dsinit.c:
> if (obj_desc->method.info_flags & ACPI_METHOD_SERIALIZED) {
> info->serial_method_count++;
> break;
> }
>
> if (acpi_gbl_auto_serialize_methods) {
>
> /* Parse/scan method and serialize it if necessary */
>
> acpi_ds_auto_serialize_method(node, obj_desc);
> if (obj_desc->method.
> info_flags & ACPI_METHOD_SERIALIZED) {
>
> /* Method was just converted to Serialized */
>
> info->serial_method_count++;
> info->serialized_method_count++;
> break;
> }
> }
> Which is invoked by acpi_ds_initialize_objects(), always invoked in acpi_ns_load_table().
> Unless acpi_gbl_auto_serialize_methods = false or acpi_ns_parse_table() failed, the flag won't be
> remained unset.
>
> The error message is generated by old auto-serialize implementation.
> And acpi_gbl_auto_serialize_methods is meant to mute the warnings.
>
> Both mechanism should work, thus this error message is not fatal.
> It just makes ACPICA to fall back to use old auto-serial method.
> So the issue is not urgent.
>
> 2. Why the error message is caused
> I couldn't see whether the bisected commit can be related to this feature.
> It seems we need your help to debug what the problem is.
>
> First, please try the mentioned branch here:
> https://github.com/zetalog/linux
> acpica-lock branch.
>
> As I may need to ask for several debugging steps, let me file a kernel Bugzilla bug for this.
> So that we can communicate there in order not to bother others:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=180111
>
> Thanks and best regards
> Lv
>
>
> >
> > I attached the acpidump output.
> >
> > > Please give the fix a try (see attachment).
> >
> > The patch didn't apply on 4.9-rc1 or Linus' master, please see the
> > attached patch for my attempt to resolve the conflicts. With the patch
> > applied I could still trigger the same problem during suspend.
> >
> > --Imre
> >
> > > I'm sorry for sending fix patch using attachment.
> > > It's not convenient for me due to my current working environment.
> > >
> > > Thanks and best regards
> > > Lv
5 years, 8 months
Re: [Devel] [PATCH] ACPICA: arm64: fix compile apci tools fail for arm64
by Zheng, Lv
Hi
> From: linux-acpi-owner(a)vger.kernel.org [mailto:[email protected]] On Behalf Of Yisheng
> Xie
> Subject: Re: [PATCH] ACPICA: arm64: fix compile apci tools fail for arm64
>
>
>
> On 2016/10/22 3:40, Zheng, Lv wrote:
> > Hi,
> >
> > I generated a solution with tools/power/acpi makefiles.
> > Please give it a try.
> Hi Lv,
> Your patch also works.
Thanks for the test.
I'll send it to the community for review.
Best regards
Lv
>
> > Sorry for the hackish build includes.
> >
> > Thanks and best regards
> > Lv
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo(a)vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
5 years, 8 months
Re: [Devel] 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
by Zheng, Lv
Hi, Imre
> From: Deak, Imre
> Subject: Re: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
>
> On Fri, 2016-10-21 at 22:46 +0300, Zheng, Lv wrote:
> > [...]
> > I checked the code, only found one issue.
> > And I'm not sure if it is related.
> > Please send me the full dmesg containing the errors and the acpidump
> > output.
>
> I attached the dmesg containing the error during boot (happened 1 out
> of 200 boots), during reboot (20 out of 200 reboots), during suspend
> (happened all the time).
>
> I attached the acpidump output.
Thanks for the information.
>
> > Please give the fix a try (see attachment).
>
> The patch didn't apply on 4.9-rc1 or Linus' master, please see the
> attached patch for my attempt to resolve the conflicts. With the patch
> applied I could still trigger the same problem during suspend.
Could you pull this branch directly and try again:
https://github.com/zetalog/linux
Branch: acpica-lock
I've pushed the fix commit there.
Thanks in advance.
Best regards
Lv
>
> --Imre
>
> > I'm sorry for sending fix patch using attachment.
> > It's not convenient for me due to my current working environment.
> >
> > Thanks and best regards
> > Lv
5 years, 8 months
Re: [Devel] 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
by Zheng, Lv
Hi, Imre
> From: Deak, Imre
> Subject: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
>
> Hi,
>
> after upgrading to 4.9-rc1 I get the following errors occasionally
> during boot and suspend-to-ram on an APL system:
>
> [ 59.513434] ACPI Error: [TMP_] Namespace lookup failure, AE_ALREADY_EXISTS (20160831/dswload2-330)
> [ 59.513446] ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20160831/psobject-227)
> [ 59.513469] ACPI Error: Method parse/execution failed [\_SB.PCI0.SCPG] (Node ffff8802770b7bb8),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [ 59.515415] ACPI Error: Method parse/execution failed [\_SB.PCI0.SDHA._PS3] (Node ffff8802770b7dc0),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [ 59.517118] ACPI: Marking method _PS3 as Serialized because of AE_ALREADY_EXISTS error
>
> Other than these error messages, booting and suspend/resume seems to work ok.
> Bisecting points to
> commit 74f51b80a0c4ff84fbeb7f12ea43ce66934d29aa
> Author: Lv Zheng <lv.zheng(a)intel.com>
> Date: Wed Sep 7 14:07:10 2016 +0800
>
> ACPICA: Namespace: Fix dynamic table loading issues
>
> Reverting this on top of 4.9-rc1 gets rid of the error messages.
I checked the code, only found one issue.
And I'm not sure if it is related.
Please send me the full dmesg containing the errors and the acpidump output.
Please give the fix a try (see attachment).
I'm sorry for sending fix patch using attachment.
It's not convenient for me due to my current working environment.
Thanks and best regards
Lv
5 years, 8 months
Re: [Devel] [PATCH] ACPICA: arm64: fix compile apci tools fail for arm64
by Zheng, Lv
Hi,
> From: linux-acpi-owner(a)vger.kernel.org [mailto:[email protected]] On Behalf Of Yisheng
> Xie
> Subject: Re: [PATCH] ACPICA: arm64: fix compile apci tools fail for arm64
>
> Hi,
>
> On 2016/10/19 6:07, Zheng, Lv wrote:
> > Hi,
> >
> > I'm not sure what you mean.
> > I mean you need ACPI_USE_SYSTEM_INTTYPES in case s64 has already been defined in that environment.
> > Are you sure s64 should be defined for your environment?
> >
> s64 is not defined in my build environment but in kernel code.
Yes, in-kernel ACPICA applications trickily reused this to get it compiled in kernel source tree with minimal porting effort.
And it is working on x86.
>
> > IMO, s64 is kernel space specific, while you are compiling user space tools.
> > It looks to me like there is something wrong with ARM kernel's asm/types.h.
> >
> >> I listed in change log. And I also have tried that way.
> >> However, it still have many other errors.(I am sorry to not have listed all of them.)
> >>
> >> From the following log, you can see, all of the conflict type is from signal.h.
> >> And maybe this patch is a better way to fix these compile error, without too much
> >> change of code.
> >>
> >> Are you sure that it will cause order problem when build ACPICA on other build
> >> environment, for it only effect aarch64.
> >
> > I'm not sure what this is.
> > How did you get this?
> > Were you compiling kernel acpi tools or compiling the kernel itself?
> >
> It's about compiling kernel acpi tools.
>
> > For tool compilation, are you sure you have correctly configured your cross-compilation environment?
> Maybe it is not my cross-compilation environment problem, for your also can reproduce it,
> as your said in another email, right?
Yes, I reproduced it.
By commenting out <signal.h> inclusion from acenv.h.
Tools can be built by aarch64-linux-gnu tool chain downloaded from linaro.
However this is still not the root cause, IMO.
Thanks
Lv
>
> > Will you see problems in compiling ACPICA applications from:
> > https://github.com/acpica/acpica
> >
>
> > Thanks
> > Lv
> >
> > .
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo(a)vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
5 years, 8 months
Re: [Devel] 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
by Zheng, Lv
Hi, Rafael
> From: rjwysocki(a)gmail.com [mailto:[email protected]] On Behalf Of Rafael J. Wysocki
> Subject: Re: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
>
> On Thu, Oct 20, 2016 at 8:44 PM, Zheng, Lv <lv.zheng(a)intel.com> wrote:
> > Hi,
> >
> >> From: Deak, Imre
> >> Subject: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
> >>
> >> Hi,
> >>
> >> after upgrading to 4.9-rc1 I get the following errors occasionally
> >> during boot and suspend-to-ram on an APL system:
> >>
> >> [ 59.513434] ACPI Error: [TMP_] Namespace lookup failure, AE_ALREADY_EXISTS (20160831/dswload2-
> 330)
> >> [ 59.513446] ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20160831/psobject-227)
> >> [ 59.513469] ACPI Error: Method parse/execution failed [\_SB.PCI0.SCPG] (Node ffff8802770b7bb8),
> >> AE_ALREADY_EXISTS (20160831/psparse-543)
> >> [ 59.515415] ACPI Error: Method parse/execution failed [\_SB.PCI0.SDHA._PS3] (Node
> ffff8802770b7dc0),
> >> AE_ALREADY_EXISTS (20160831/psparse-543)
> >> [ 59.517118] ACPI: Marking method _PS3 as Serialized because of AE_ALREADY_EXISTS error
> >>
> >> Other than these error messages, booting and suspend/resume seems to work ok.
> >> Bisecting points to
> >> commit 74f51b80a0c4ff84fbeb7f12ea43ce66934d29aa
> >> Author: Lv Zheng <lv.zheng(a)intel.com>
> >> Date: Wed Sep 7 14:07:10 2016 +0800
> >>
> >> ACPICA: Namespace: Fix dynamic table loading issues
> >>
> >> Reverting this on top of 4.9-rc1 gets rid of the error messages.
> >
> > The commit in question only modified code to make locks unlocked/locked.
> > Which should be transparent to the functional stuffs.
>
> It might change the relative timing of thigs (which might result in
> ordering changes).
Yes, I'll check that with the acpidump.
To see if this is caused by wrong reduced lock affection scope.
>
> > I'm not sure how it can lead to such error in the single-threading boot environment.
>
> Why do you think it's single-threaded? At least suspend/resume isn't
> in general.
I just say that because it is also reported as "occasionally during boot".
Thanks and best regards
Lv
5 years, 8 months
Re: [Devel] 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
by Zheng, Lv
Hi,
> From: Deak, Imre
> Subject: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
>
> Hi,
>
> after upgrading to 4.9-rc1 I get the following errors occasionally
> during boot and suspend-to-ram on an APL system:
>
> [ 59.513434] ACPI Error: [TMP_] Namespace lookup failure, AE_ALREADY_EXISTS (20160831/dswload2-330)
> [ 59.513446] ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20160831/psobject-227)
> [ 59.513469] ACPI Error: Method parse/execution failed [\_SB.PCI0.SCPG] (Node ffff8802770b7bb8),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [ 59.515415] ACPI Error: Method parse/execution failed [\_SB.PCI0.SDHA._PS3] (Node ffff8802770b7dc0),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [ 59.517118] ACPI: Marking method _PS3 as Serialized because of AE_ALREADY_EXISTS error
>
> Other than these error messages, booting and suspend/resume seems to work ok.
> Bisecting points to
> commit 74f51b80a0c4ff84fbeb7f12ea43ce66934d29aa
> Author: Lv Zheng <lv.zheng(a)intel.com>
> Date: Wed Sep 7 14:07:10 2016 +0800
>
> ACPICA: Namespace: Fix dynamic table loading issues
>
> Reverting this on top of 4.9-rc1 gets rid of the error messages.
The commit in question only modified code to make locks unlocked/locked.
Which should be transparent to the functional stuffs.
I'm not sure how it can lead to such error in the single-threading boot environment.
Please provide the acpidump output for further investigation.
Thanks and best regards
Lv
5 years, 8 months
Re: [Devel] 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
by Zheng, Lv
Hi, Imre
> From: Deak, Imre
> Subject: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
>
> Hi,
>
> after upgrading to 4.9-rc1 I get the following errors occasionally
> during boot and suspend-to-ram on an APL system:
>
> [ 59.513434] ACPI Error: [TMP_] Namespace lookup failure, AE_ALREADY_EXISTS (20160831/dswload2-330)
> [ 59.513446] ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20160831/psobject-227)
> [ 59.513469] ACPI Error: Method parse/execution failed [\_SB.PCI0.SCPG] (Node ffff8802770b7bb8),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [ 59.515415] ACPI Error: Method parse/execution failed [\_SB.PCI0.SDHA._PS3] (Node ffff8802770b7dc0),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [ 59.517118] ACPI: Marking method _PS3 as Serialized because of AE_ALREADY_EXISTS error
Could you send me acpidump output?
>
> Other than these error messages, booting and suspend/resume seems to work ok.
> Bisecting points to
> commit 74f51b80a0c4ff84fbeb7f12ea43ce66934d29aa
> Author: Lv Zheng <lv.zheng(a)intel.com>
> Date: Wed Sep 7 14:07:10 2016 +0800
>
> ACPICA: Namespace: Fix dynamic table loading issues
>
> Reverting this on top of 4.9-rc1 gets rid of the error messages.
This fix is essential.
Without this, all of other ACPICA fixes can easily fall into dead locks.
So we won't simply revert it just because of non-functional-failure error messages.
Instead, we will improve it.
Thanks and best regards
Lv
5 years, 8 months