]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Michael Reed <mdr@sgi.com> |
2 | Subject: ioc4 request module | |
3 | Patch-mainline: ? | |
4 | References: bnc#429215 | |
5 | ||
6 | It modifies ioc4.c to call request_module() for each of the two modules | |
7 | which support the hardware. | |
8 | ||
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. | |
12 | ||
13 | Mike | |
14 | ||
15 | Acked-by: Raymund Will <rw@suse.de> | |
16 | ||
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; | |
21 | } | |
22 | ||
23 | +static void | |
24 | +ioc4_load_modules(struct work_struct *work) | |
25 | +{ | |
26 | + /* arg just has to be freed */ | |
27 | + | |
28 | + request_module("sgiioc4"); | |
29 | + request_module("ioc4_serial"); | |
30 | + | |
31 | + kfree(work); | |
32 | +} | |
33 | + | |
34 | /* Adds a new instance of an IOC4 card */ | |
35 | static int | |
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 | |
38 | } | |
39 | mutex_unlock(&ioc4_mutex); | |
40 | ||
41 | + if (idd->idd_variant != IOC4_VARIANT_PCI_RT) { | |
42 | + struct work_struct *work; | |
43 | + work = kzalloc(sizeof(struct work_struct), GFP_KERNEL); | |
44 | + if (!work) { | |
45 | + printk(KERN_WARNING | |
46 | + "%s: IOC4 unable to allocate memory for " | |
47 | + "load of sub-modules.\n", | |
48 | + __FUNCTION__); | |
49 | + } | |
50 | + else { | |
51 | + printk(KERN_INFO "IOC4 loading ioc4 submodule\n"); | |
52 | + INIT_WORK(work, ioc4_load_modules); | |
53 | + schedule_work(work); | |
54 | + } | |
55 | + } | |
56 | + | |
57 | return 0; | |
58 | ||
59 | out_misc_region: |