* [PATCH]
@ 2007-11-15 22:03 Roel Kluin
2007-11-15 22:32 ` [PATCH with title] priority fix in acpi_map_lsapic() arch/ia64/kernel/acpi.c Roel Kluin
0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2007-11-15 22:03 UTC (permalink / raw)
To: tony.luck, len.brown; +Cc: linux-ia64, linux-acpi
I have sent this patch before to lkml, but it appears it wasn't picked up. Also
I have to admit this isn't tested. This is a patch against linus' tree.
ACPI_MADT_ENABLED is defined 1 (include/acpi/actbl1.h 501)
lapic_flags: an u32 of struct acpi_madt_local_sapic (include/acpi/actbl1.h 467)
--
'!' has a higher priority than '&', so as was
this won't test the first bit, but rather evaluates to false for any non-zero
lsapic->lapic_flags.
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 3d45d24..7d78d22 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -858,7 +858,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;
if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) ||
- (!lsapic->lapic_flags & ACPI_MADT_ENABLED)) {
+ (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))) {
kfree(buffer.pointer);
return -EINVAL;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH with title] priority fix in acpi_map_lsapic() arch/ia64/kernel/acpi.c
2007-11-15 22:03 [PATCH] Roel Kluin
@ 2007-11-15 22:32 ` Roel Kluin
2007-11-20 6:51 ` Simon Horman
0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2007-11-15 22:32 UTC (permalink / raw)
To: tony.luck, len.brown; +Cc: linux-ia64, linux-acpi
As above should have been its title.
Roel Kluin wrote:
> I have sent this patch before to lkml, but it appears it wasn't picked up. Also
> I have to admit this isn't tested. This is a patch against linus' tree.
>
> ACPI_MADT_ENABLED is defined 1 (include/acpi/actbl1.h 501)
> lapic_flags: an u32 of struct acpi_madt_local_sapic (include/acpi/actbl1.h 467)
> --
> '!' has a higher priority than '&', so as was
> this won't test the first bit, but rather evaluates to false for any non-zero
> lsapic->lapic_flags.
>
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
> ---
> diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
> index 3d45d24..7d78d22 100644
> --- a/arch/ia64/kernel/acpi.c
> +++ b/arch/ia64/kernel/acpi.c
> @@ -858,7 +858,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
> lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;
>
> if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) ||
> - (!lsapic->lapic_flags & ACPI_MADT_ENABLED)) {
> + (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))) {
> kfree(buffer.pointer);
> return -EINVAL;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH with title] priority fix in acpi_map_lsapic() arch/ia64/kernel/acpi.c
2007-11-15 22:32 ` [PATCH with title] priority fix in acpi_map_lsapic() arch/ia64/kernel/acpi.c Roel Kluin
@ 2007-11-20 6:51 ` Simon Horman
2007-12-04 6:22 ` Len Brown
0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2007-11-20 6:51 UTC (permalink / raw)
To: Roel Kluin; +Cc: tony.luck, len.brown, linux-ia64, linux-acpi
On Thu, Nov 15, 2007 at 11:32:39PM +0100, Roel Kluin wrote:
> As above should have been its title.
>
> Roel Kluin wrote:
> > I have sent this patch before to lkml, but it appears it wasn't picked up. Also
> > I have to admit this isn't tested. This is a patch against linus' tree.
> >
> > ACPI_MADT_ENABLED is defined 1 (include/acpi/actbl1.h 501)
> > lapic_flags: an u32 of struct acpi_madt_local_sapic (include/acpi/actbl1.h 467)
> > --
> > '!' has a higher priority than '&', so as was
> > this won't test the first bit, but rather evaluates to false for any non-zero
> > lsapic->lapic_flags.
> >
> > Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
This looks correct to me, though I was curious to know why
the problem wasn't manifesting in a bug. I investigated
a bit and found that it seems that the only values
lapic_flags currently takes are 0 and ACPI_MADT_ENABLED,
so it turns out that the bogus logic actually gives the correct result
(by chance).
Acked-by: Simon Horman <horms@verge.net.au>
> > ---
> > diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
> > index 3d45d24..7d78d22 100644
> > --- a/arch/ia64/kernel/acpi.c
> > +++ b/arch/ia64/kernel/acpi.c
> > @@ -858,7 +858,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
> > lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;
> >
> > if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) ||
> > - (!lsapic->lapic_flags & ACPI_MADT_ENABLED)) {
> > + (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))) {
> > kfree(buffer.pointer);
> > return -EINVAL;
> > }
> >
--
Horms
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH with title] priority fix in acpi_map_lsapic() arch/ia64/kernel/acpi.c
2007-11-20 6:51 ` Simon Horman
@ 2007-12-04 6:22 ` Len Brown
0 siblings, 0 replies; 4+ messages in thread
From: Len Brown @ 2007-12-04 6:22 UTC (permalink / raw)
To: Simon Horman; +Cc: Roel Kluin, tony.luck, linux-ia64, linux-acpi
Applied.
thanks,
-Len
On Tuesday 20 November 2007 01:51, Simon Horman wrote:
> On Thu, Nov 15, 2007 at 11:32:39PM +0100, Roel Kluin wrote:
> > As above should have been its title.
> >
> > Roel Kluin wrote:
> > > I have sent this patch before to lkml, but it appears it wasn't picked up. Also
> > > I have to admit this isn't tested. This is a patch against linus' tree.
> > >
> > > ACPI_MADT_ENABLED is defined 1 (include/acpi/actbl1.h 501)
> > > lapic_flags: an u32 of struct acpi_madt_local_sapic (include/acpi/actbl1.h 467)
> > > --
> > > '!' has a higher priority than '&', so as was
> > > this won't test the first bit, but rather evaluates to false for any non-zero
> > > lsapic->lapic_flags.
> > >
> > > Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
>
> This looks correct to me, though I was curious to know why
> the problem wasn't manifesting in a bug. I investigated
> a bit and found that it seems that the only values
> lapic_flags currently takes are 0 and ACPI_MADT_ENABLED,
> so it turns out that the bogus logic actually gives the correct result
> (by chance).
>
> Acked-by: Simon Horman <horms@verge.net.au>
>
> > > ---
> > > diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
> > > index 3d45d24..7d78d22 100644
> > > --- a/arch/ia64/kernel/acpi.c
> > > +++ b/arch/ia64/kernel/acpi.c
> > > @@ -858,7 +858,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
> > > lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;
> > >
> > > if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) ||
> > > - (!lsapic->lapic_flags & ACPI_MADT_ENABLED)) {
> > > + (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))) {
> > > kfree(buffer.pointer);
> > > return -EINVAL;
> > > }
> > >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-12-04 6:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-15 22:03 [PATCH] Roel Kluin
2007-11-15 22:32 ` [PATCH with title] priority fix in acpi_map_lsapic() arch/ia64/kernel/acpi.c Roel Kluin
2007-11-20 6:51 ` Simon Horman
2007-12-04 6:22 ` Len Brown
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).