Skip to contentSkip to conversation

[Fwd: Re: How to get rid of unused data in LKM]

Fwd: Re: How to get rid of unused data in LKM Dan Taylor 2 participants 2 messages Jul 25, 2002

lore
Share & tools
lore

Dan Taylor

author
#0 lore raw

-------- Original Message --------
Subject: Re: How to get rid of unused data in LKM
Date: Thu, 25 Jul 2002 02:04:53 -0700
From: Dan Taylor <[email protected]>
Reply-To: [email protected]
To: Matthias Fuchs <[email protected]>
References: <[email protected]> <[email protected]>

Couldn't you do a kernel file open during module_init, store the PCI device code and close the file?

Regards,

Dan

Quoted 19 lines · Matthias Fuchs

Hi Wolfgang,

Quoted 4 lines

Why don't you load the firmware using some ioctl() _after_ loading the module?

Of course this is a good and definetly the default solution. But our application requires
that everything is done by the init function of the module. Life would be boring and mailing list obsolete, if we can always use the default solutions :-)

Quoted 5 lines
Quoted 4 lines

But after doing so, the firmware data is still wasting kernel memory on the host system
and is not used anymore.
How can I free that memory ? Is there a better way to handle that data ?

Quoted 12 lines
Quoted 2 lines

If you really think you must link the data with the module: Declare it using "__initdata" ?

I think that John is right. __initdata only makes sense, when the module is compiled into
the kernel. But I will check it again, just to be sure.

Matthias

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw

Hi Dan,

that's a better idea. I think I will do that if there is no way to free the firmware data from my module.

I found a little code snippet to do kernel file access. It does not seem to be that complicated.

Thanks
Matthias

Quoted 6 lines

Couldn't you do a kernel file open during module_init, store the PCI device code and close the file?

Regards,

Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/