List Info

Thread: Re: ACPI patches for 2.6.23-rc1




Re: ACPI patches for 2.6.23-rc1
user name
2007-07-27 18:07:42
On Fri, Jul 27, 2007 at 06:25:12PM +0200, Thomas Renninger
wrote:
> On Fri, 2007-07-27 at 08:26 +0200, Jan Dittmer wrote:
> > Len Brown wrote:
> > > Hi Linus,
> > > 
> > > please pull from: 
> > > 
> > >
git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acp
i-2.6.git release
> > 
> > This seems to break ia64 defconfig:
> > 
> >    Building modules, stage 2.
> >    MODPOST 157 modules
> > FATAL: drivers/acpi/button: sizeof(struct
acpi_device_id)=20 is not a modulo of the size of section
__mod_acpi_device_table=144.
> > Fix definition of struct acpi_device_id in
mod_devicetable.h
> > make[2]: *** [__modpost] Error 1
> > make[1]: *** [modules] Error 2
> > make: *** [_all] Error 2
> > 
> > gcc 3.3.6, binutils 2.15.94
> > 
> > http://l4x.org/k/?d=32569
> 
> This is strange, I just compiled on a IA64 with button
as module
> (defconfig), but with gcc version 4.1.2, all is fine.
> Anyone an idea how to run into that?

I don't have an idea how this happens, but it sounds like an
alignment 
issue:

sizeof(struct acpi_device_id)=20
"struct acpi_device_id button_device_ids[]"
contains 6 elements
144 = 6 * 24 = 6 * (3 * 8)

So it seems on ia64 with gcc 3.3.6 there's some 8 byte
alignment of the 
array members?

Sam and the ia64 maintainers Cc'ed - they might know better
what's going 
on here.

> I won't be able to detailed debug this before Monday,
but be sure I will
> do so then.
> 
> Thanks,
> 
>     Thomas

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan
asked suddenly out
        of the darkness. There had been need of rain for
many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck -
Dragon Seed

-
To unsubscribe from this list: send the line
"unsubscribe linux-ia64" in
the body of a message to majordomovger.kernel.org
More majordomo info at  http://vge
r.kernel.org/majordomo-info.html

Re: ACPI patches for 2.6.23-rc1
country flaguser name
Germany
2007-07-27 18:41:59
Adrian Bunk <bunkstusta.de> writes:

> I don't have an idea how this happens, but it sounds
like an alignment 
> issue:
>
> sizeof(struct acpi_device_id)=20

This is wrong.  The structure has 24 bytes (including 7(!)
bytes of
padding).

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwabsuse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg,
Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5
214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line
"unsubscribe linux-ia64" in
the body of a message to majordomovger.kernel.org
More majordomo info at  http://vge
r.kernel.org/majordomo-info.html

scripts/mod/file2alias.c cross compile problem
user name
2007-07-27 20:39:51
On Fri, Jul 27, 2007 at 04:21:47PM -0700, Luck, Tony wrote:
> > So it seems on ia64 with gcc 3.3.6 there's some 8
byte alignment of the 
> > array members?
> >
> > Sam and the ia64 maintainers Cc'ed - they might
know better what's going 
> > on here.
> 
> This ia64 maintainer is baffled ... but I don't see the
problem here (perhaps
> because my build machine has gcc 3.4.6).


I found what causes this problem, and it only occurs during
cross 
compilation.


The struct is:

#define ACPI_ID_LEN     9

struct acpi_device_id {
	 __u8 id[ACPI_ID_LEN];
	kernel_ulong_t driver_data;
};


When compiling for ia64, this results in:

struct acpi_device_id {
	__u8 id[9];
	uint64_t driver_data;
};


sizeof(struct acpi_device_id) for ia64 is due to different
padding
after id[] 20 bytes on i386 but 24 bytes on ia64.

scripts/mod/file2alias.c is compiled with HOSTCC and ensures
that 
kernel_ulong_t is correct (in this case uint64_t for ia64),
but it can't 
cope with different padding on different architectures.


> -Tony

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan
asked suddenly out
        of the darkness. There had been need of rain for
many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck -
Dragon Seed

-
To unsubscribe from this list: send the line
"unsubscribe linux-ia64" in
the body of a message to majordomovger.kernel.org
More majordomo info at  http://vge
r.kernel.org/majordomo-info.html

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )