Re: [PATCH 2/14] firmware update for av7110 dvb driver
From: Michael Hunold
Date: Wed Oct 08 2003 - 10:59:49 EST
Hello Marcel,
... send to Linus only. (You don't want a 150kB bzip2 compressed
firmware blob, don't you? In case you do, drop me a line.)
the request_firmware() framework is part of Linux 2.4 and 2.6 and so for
most drivers the firmware file can be loaded from userspace through proc
or sysfs. Please take a look at it.
Yes, we know. When I looked at it the last time, there were some
problems that kept us from actually finishing the work.
(If you did not use a hotplug agent, then the system was frozen, because
the firmware foo did not use it's own workqueue)
As a follow-up to my post: I just checked what already got in and what's
still missing. I attached the stuff from request_firmwar() that didn't
make it into the kernel yet.
Please note that I did not check if the problem has been solved
otherwise. Perhaps Manuel Estrada Sainz <ranty@xxxxxxxxxx> can tell us
what the current state is?
CU
Michael.
diff -u -r1.3 firmware_class.c
--- linux/drivers/base/firmware_class.c 4 Jul 2003 02:21:18 -0000 1.3
+++ linux/drivers/base/firmware_class.c 26 Jul 2003 08:38:07 -0000
@@ -22,6 +22,8 @@
MODULE_LICENSE("GPL");
static int loading_timeout = 10; /* In seconds */
+static struct workqueue_struct *firmware_wq;
+
struct firmware_priv {
char fw_id[FIRMWARE_NAME_MAX];
@@ -467,7 +469,7 @@
};
INIT_WORK(&fw_work->work, request_firmware_work_func, fw_work);
- schedule_work(&fw_work->work);
+ queue_work(firmware_wq, &fw_work->work);
return 0;
}
@@ -485,12 +487,20 @@
__FUNCTION__);
class_unregister(&firmware_class);
}
+ firmware_wq = create_workqueue("firmware");
+ if (!firmware_wq) {
+ printk(KERN_ERR "%s: create_workqueue failed\n", __FUNCTION__);
+ class_remove_file(&firmware_class, &class_attr_timeout);
+ class_unregister(&firmware_class);
+ error = -EIO;
+ }
return error;
}
static void __exit
firmware_class_exit(void)
{
+ destroy_workqueue(firmware_wq);
class_remove_file(&firmware_class, &class_attr_timeout);
class_unregister(&firmware_class);
}