[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4FD611A5.6070208@redhat.com>
Date: Mon, 11 Jun 2012 12:41:25 -0300
From: Mauro Carvalho Chehab <mchehab@...hat.com>
To: Chris Metcalf <cmetcalf@...era.com>
CC: Doug Thompson <dougthompson@...ssion.com>,
linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] edac: Do alignment logic properly in edac_align_ptr()
Em 11-06-2012 12:35, Chris Metcalf escreveu:
> On 6/6/2012 1:24 PM, Chris Metcalf wrote:
>> The logic was checking the sizeof the structure being allocated to
>> determine whether an alignment fixup was required. This isn't right;
>> what we actually care about is the alignment of the actual pointer that's
>> about to be returned. This became an issue recently because struct
>> edac_mc_layer has a size that is not zero modulo eight, so we were
>> taking the correctly-aligned pointer and forcing it to be misaligned.
>> On Tile this caused an alignment exception.
>>
>> Signed-off-by: Chris Metcalf <cmetcalf@...era.com>
>> ---
>> Mauro, I assume you will push this through your tree? I am also happy
>> to push it through the tile tree. Let me know!
>
> Ping - I see this didn't make it into 3.5-rc2. I'm happy to push the change
> through the tile tree if that's helpful (and someone wants to give their
> Acked-by).
Sorry, I took some days off to rest. I'll be applying it today on my -next tree
and likely tomorrow upstream, together with a few other EDAC fixes.
Regards,
Mauro
>
>>
>> drivers/edac/edac_mc.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
>> index 10f3750..de5ba86 100644
>> --- a/drivers/edac/edac_mc.c
>> +++ b/drivers/edac/edac_mc.c
>> @@ -164,7 +164,7 @@ void *edac_align_ptr(void **p, unsigned size, int n_elems)
>> else
>> return (char *)ptr;
>>
>> - r = size % align;
>> + r = (unsigned long)p % align;
>>
>> if (r == 0)
>> return (char *)ptr;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists