How can LKM store persistent data?
From: Doron Cohen
Date: Mon Oct 03 2011 - 05:52:09 EST
I am handling Digital TV receiver drivers for Siano Mobile Silicon
We would like the driver to have some persistent data which can be saved
from one load to another (explanation why is a bit long so it is written
below and you may skip it.
I know that accessing files from modules is strictly forbidden, but I
couldn't find what the right way to do that is. One way I could think of
is to make a mechanism like request_firmware is using which is making a
device node and have a deamon in userspace fill it in (or write it to a
file) when required. But I am not sure that would be wise for every
module that needs such operation to implement such mechanism on it's
Is there any other way for a module to save some configuration data for
use on the next time the module is loaded?
Now as promised the why:
Our device has some configuration data like DVB standard and operation
mode which is not changes frequently. Currently it can be changed using
module parameters and by ioctl calls. But when the driver is down and up
again (meaning - every restart, sleep, reboot etc.) the module is back
to the default settings unless the config file is changed which is not
done for most users.
Our users asked us to keep this data persistent, if someone is using
ISDBT he would probably use it forever unless traveling to another
region. So the request is once a mode was set, do not change it on the
next reload just work at that mode until instructed otherwise. Therefore
the driver needs to save this data somehow, and read it when it loads
and work according to it.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/