1 From: Michael Reed <mdr@sgi.com>
2 Subject: ioc4 request module
6 It modifies ioc4.c to call request_module() for each of the two modules
7 which support the hardware.
9 The patch uses a workqueue to prevent a deadlock. It seems to do the right
10 thing on my system, but I don't have a way to install test it. If this works
11 and you find it acceptable, I'll try to get it pushed upstream next week.
15 Acked-by: Raymund Will <rw@suse.de>
17 --- linux-2.6.27-rc6-7.2/drivers/misc/ioc4.c 2008-07-13 16:51:29.000000000 -0500
18 +++ b/drivers/misc/ioc4.c 2008-10-03 15:58:40.225723102 -0500
19 @@ -269,6 +269,17 @@ ioc4_variant(struct ioc4_driver_data *id
20 return IOC4_VARIANT_PCI_RT;
24 +ioc4_load_modules(struct work_struct *work)
26 + /* arg just has to be freed */
28 + request_module("sgiioc4");
29 + request_module("ioc4_serial");
34 /* Adds a new instance of an IOC4 card */
36 ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
37 @@ -378,6 +389,22 @@ ioc4_probe(struct pci_dev *pdev, const s
39 mutex_unlock(&ioc4_mutex);
41 + if (idd->idd_variant != IOC4_VARIANT_PCI_RT) {
42 + struct work_struct *work;
43 + work = kzalloc(sizeof(struct work_struct), GFP_KERNEL);
46 + "%s: IOC4 unable to allocate memory for "
47 + "load of sub-modules.\n",
51 + printk(KERN_INFO "IOC4 loading ioc4 submodule\n");
52 + INIT_WORK(work, ioc4_load_modules);
53 + schedule_work(work);