/[linux-patches]/genpatches-2.6/trunk/2.6.14/2720_dell-rbu-hang.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/2720_dell-rbu-hang.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (hide annotations) (download) (as text)
Tue Mar 14 13:34:17 2006 UTC (14 years, 8 months ago) by johnm
File MIME type: text/x-diff
File size: 3750 byte(s)
2.6.14-11, rebase against local tree
1 johnm 328 Re-diffed for 2.6.14.7 by Kerin Millar <kerframi@gmail.com>:
2    
3     From: Abhay Salunke <Abhay_Salunke@dell.com>
4     Date: Sat, 14 Jan 2006 21:21:14 +0000 (-0800)
5     Subject: [PATCH] dell_rbu: fix Bug 5854
6     X-Git-Tag: v2.6.16-rc1
7     X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2c5608404e66047bbcd9b7788e7f3ee2555c8639
8    
9     [PATCH] dell_rbu: fix Bug 5854
10    
11     This fixes http://bugzilla.kernel.org/show_bug.cgi?id=5854
12    
13     Root cause:
14    
15     The dell_rbu driver creates entries in /sys/class/firmware/dell_rbu/ by
16     calling request_firmware_nowait (without hotplug ) this function inturn
17     starts a kernel thread which creates the entries in
18     /sys/class/firmware/dell_rbu/loading , data and the thread waits on the
19     user action to return control back to the callback fucntion of dell_rbu.
20     The thread calls wait_on_completion which puts it in a D state until the
21     user action happens. If there is no user action happening the load average
22     goes up as the thread D state is taken in to account. Also after
23     downloading the BIOS image the enrties go away momentarily but they are
24     recreated from the callback function in dell_rbu. This causes the thread
25     to get recreated causing the load average to permenently stay around 1.
26    
27     Fix:
28    
29     The dell_rbu also creates the entry
30     /sys/devices/platform/dell_rbu/image_type at driver load time. The image
31     type by default is mono if required the user can echo packet to image_type
32     to make the BIOS update mechanism using packets. Also by echoing init in
33     to image_type the /sys/class/firmware/dell_rbu entries can be created.
34    
35     The driver code was changed to not create /sys/class/firmware/dell_rbu
36     entries during load time, and also to not create the above entries from the
37     callback function. The entries are only created by echoing init to
38     /sys/devices/platform/dell_rbu/image_type The user now needs to create the
39     entries to download the image monolithic or packet. This fixes the issue
40     since the kernel thread only is created when ever the user is ready to
41     download the BIOS image; this minimizes the life span of the kernel thread
42     and the load average goes back to normal.
43    
44     Signed off by Abhay Salunke <abhay_salunke@dell.com>
45    
46     Signed-off-by: Andrew Morton <akpm@osdl.org>
47     Signed-off-by: Linus Torvalds <torvalds@osdl.org>
48     ---
49    
50     --- linux-2.6.14.7.orig/drivers/firmware/dell_rbu.c 2005-10-27 19:02:08.000000000 -0500
51     +++ linux-2.6.14.7/drivers/firmware/dell_rbu.c 2006-03-08 04:02:44.000000000 -0500
52     @@ -499,12 +499,10 @@ static ssize_t read_rbu_data(struct kobj
53    
54     static void callbackfn_rbu(const struct firmware *fw, void *context)
55     {
56     - int rc = 0;
57     + rbu_data.entry_created = 0;
58    
59     - if (!fw || !fw->size) {
60     - rbu_data.entry_created = 0;
61     + if (!fw || !fw->size)
62     return;
63     - }
64    
65     spin_lock(&rbu_data.lock);
66     if (!strcmp(image_type, "mono")) {
67     @@ -527,15 +525,6 @@ static void callbackfn_rbu(const struct
68     } else
69     pr_debug("invalid image type specified.\n");
70     spin_unlock(&rbu_data.lock);
71     -
72     - rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG,
73     - "dell_rbu", &rbu_device->dev, &context, callbackfn_rbu);
74     - if (rc)
75     - printk(KERN_ERR
76     - "dell_rbu:%s request_firmware_nowait failed"
77     - " %d\n", __FUNCTION__, rc);
78     - else
79     - rbu_data.entry_created = 1;
80     }
81    
82     static ssize_t read_rbu_image_type(struct kobject *kobj, char *buffer,
83     @@ -670,14 +659,7 @@ static int __init dcdrbu_init(void)
84     sysfs_create_bin_file(&rbu_device->dev.kobj,
85     &rbu_packet_size_attr);
86    
87     - rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG,
88     - "dell_rbu", &rbu_device->dev, &context, callbackfn_rbu);
89     - if (rc)
90     - printk(KERN_ERR "dell_rbu:%s:request_firmware_nowait"
91     - " failed %d\n", __FUNCTION__, rc);
92     - else
93     - rbu_data.entry_created = 1;
94     -
95     + rbu_data.entry_created = 0;
96     return rc;
97    
98     }

  ViewVC Help
Powered by ViewVC 1.1.20