Skip to contentSkip to conversation

drivers/usb/misc/emi*.c have the biggest data objects in the whole tree

DISCUSSION Denys Vlasenko 4 participants 7 messages Sep 14, 2007 – Oct 2, 2007 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi Tapio,

You are the author of these files. Are you still maintaining them? If not, do you know who is the current maintainer?

These two object files hold the biggest data objects in the whole Linux kernel after lockdep:

text data bss dec hex filename

   1258  160516       0  161774   277ee ./drivers/usb/misc/emi26.o
   1504  209296       0  210800   33770 ./drivers/usb/misc/emi62.o

Basically, these are big arrays of the following structures:

typedef struct _INTEL_HEX_RECORD

{
        __u32   length;
        __u32   address;
        __u32   type;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD;

I suggest the following optimizations:

Change structure to

typedef struct _INTEL_HEX_RECORD

{
        __u8   type;
        __u8   length;
        __u16   address;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD __attribute__((__packed__));

Store gzip compressed tables and unpack them at load time.

Declare them const and __initdata.

I can do it if there is no active maintainer.
--
vda

#1 lore raw
Quoted 3 lines · Denys Vlasenko

Hi Tapio,

You are the author of these files. Are you still maintaining them?

His newer email address that I found with Google is dead, too.

Quoted 25 lines

These two object files hold the biggest data objects in the whole Linux kernel

Basically, these are big arrays of the following structures:

typedef struct _INTEL_HEX_RECORD

{
        __u32   length;
        __u32   address;
        __u32   type;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD;

I suggest the following optimizations:

Change structure to

typedef struct _INTEL_HEX_RECORD

{
        __u8   type;
        __u8   length;
        __u16   address;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD __attribute__((__packed__));
Quoted 3 lines

Store gzip compressed tables and unpack them at load time.

Declare them const and __initdata.

I have a patch somewhere that moves the firmware code to userspace and changes the drivers to use request_firmware().

Regards,
Clemens

#2 lore raw
In reply to Denys Vlasenko
Quoted 22 lines · Denys Vlasenko

Hi Tapio,

You are the author of these files. Are you still maintaining them? If not, do you know who is the current maintainer?

These two object files hold the biggest data objects in the whole Linux kernel after lockdep:

   text    data     bss     dec     hex filename
   1258  160516       0  161774   277ee ./drivers/usb/misc/emi26.o
   1504  209296       0  210800   33770 ./drivers/usb/misc/emi62.o

Basically, these are big arrays of the following structures:

typedef struct _INTEL_HEX_RECORD

{
        __u32   length;
        __u32   address;
        __u32   type;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD;
Quoted 3 lines

I suggest the following optimizations:

Change structure to

I suggest moving those out of the kernel entirely and use the firmware loader support to bring it in from userspace like all the *other* firmware blobs.

'INTEL_HEX_RECORD' just *screams* 'microcode' ;)

#3 lore raw
In reply to Denys Vlasenko
Quoted 26 lines · Denys Vlasenko

Hi Tapio,

You are the author of these files. Are you still maintaining them? If not, do you know who is the current maintainer?

These two object files hold the biggest data objects in the whole Linux kernel after lockdep:

   text    data     bss     dec     hex filename
   1258  160516       0  161774   277ee ./drivers/usb/misc/emi26.o
   1504  209296       0  210800   33770 ./drivers/usb/misc/emi62.o

Basically, these are big arrays of the following structures:

typedef struct _INTEL_HEX_RECORD

{
        __u32   length;
        __u32   address;
        __u32   type;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD;

I suggest the following optimizations:

Change structure to

Quoted 7 lines

typedef struct _INTEL_HEX_RECORD

{
        __u8   type;
        __u8   length;
        __u16   address;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD __attribute__((__packed__));

Only if you redo the whole firmware image too :)

What is this really hurting? It's only relevant if you load the specific module, if you have this device type. It's a firmware blob, nothing really interesting at all.

thanks,

greg k-h

#4 lore raw
Quoted 35 lines · Greg KH
Quoted 26 lines · Denys Vlasenko

Hi Tapio,

You are the author of these files. Are you still maintaining them? If not, do you know who is the current maintainer?

These two object files hold the biggest data objects in the whole Linux kernel after lockdep:

   text    data     bss     dec     hex filename
   1258  160516       0  161774   277ee ./drivers/usb/misc/emi26.o
   1504  209296       0  210800   33770 ./drivers/usb/misc/emi62.o

Basically, these are big arrays of the following structures:

typedef struct _INTEL_HEX_RECORD

{
        __u32   length;
        __u32   address;
        __u32   type;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD;

I suggest the following optimizations:

Change structure to

Quoted 7 lines

typedef struct _INTEL_HEX_RECORD

{
        __u8   type;
        __u8   length;
        __u16   address;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD __attribute__((__packed__));
Quoted 1 line

Only if you redo the whole firmware image too :)

I did. It wasn't hard.

Quoted 2 lines

What is this really hurting? It's only relevant if you load the specific module

By this logic, no space wastage in modules is worth fixing. --
vda

#5 lore raw
Quoted 36 lines · Denys Vlasenko
Quoted 35 lines · Greg KH
Quoted 33 lines · Denys Vlasenko

Hi Tapio,

You are the author of these files. Are you still maintaining them? If not, do you know who is the current maintainer?

These two object files hold the biggest data objects in the whole Linux kernel after lockdep:

   text    data     bss     dec     hex filename
   1258  160516       0  161774   277ee ./drivers/usb/misc/emi26.o
   1504  209296       0  210800   33770 ./drivers/usb/misc/emi62.o

Basically, these are big arrays of the following structures:

typedef struct _INTEL_HEX_RECORD

{
        __u32   length;
        __u32   address;
        __u32   type;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD;

I suggest the following optimizations:

Change structure to

typedef struct _INTEL_HEX_RECORD

{
        __u8   type;
        __u8   length;
        __u16   address;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD __attribute__((__packed__));
Quoted 3 lines
Quoted 1 line

Only if you redo the whole firmware image too :)

I did. It wasn't hard.

Great, send me a patch then :)

Quoted 4 lines
Quoted 2 lines

What is this really hurting? It's only relevant if you load the specific module

By this logic, no space wastage in modules is worth fixing.

No, that's not true. Be realistic here please.

thanks,

greg k-h

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

testers needed for drivers/usb/misc/emi*.c

Quoted 23 lines · Greg KH
Quoted 23 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines

I suggest the following optimizations:

Change structure to

typedef struct _INTEL_HEX_RECORD

{
        __u8   type;
        __u8   length;
        __u16   address;
        __u8    data[MAX_INTEL_HEX_RECORD_LENGTH];
} INTEL_HEX_RECORD __attribute__((__packed__));
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Only if you redo the whole firmware image too :)

I did. It wasn't hard.

Great, send me a patch then :)

Here is it. Sending off-list due to size.

emi.code.patch contains changes to firmware loading code. emi.fw.patch.bz2 contains modified firmware images.

Quoted 7 lines
Quoted 3 lines

I don't have this hardware, thus I wrote test programs which mimic firmware loading in userspace (they dump filrmware in hex to stdout). See testing.tar.bz2.

Can you find someone with this hardware to test this patch? I'll not be able to take it until you do as the device might be assuming some of these firmware requirements that you changed.

No, I don't know any users who have this device.

Changing subject and CCing lkml, just in case.
--
vda