1 From: Jean Delvare <jdelvare@suse.de>
2 Subject: Check for ACPI resource conflicts in hwmon drivers.
3 Patch-mainline: 2.6.24-rc3-mm1
5 I've included all Super-I/O and PCI drivers.
7 I've voluntarily left out:
8 * Laptop specific and vendor-specific drivers: if they conflicted
9 on any system, this would pretty much mean that they conflict on all
10 systems, and we would know by now.
11 * Legacy ISA drivers (lm78 and w83781d): they only support chips found
12 on old designs were ACPI either wasn't supported or didn't deal with
14 * Drivers accessing the I/O resources indirectly (e.g. through SMBus):
15 the check will be added where it belongs, i.e. in the bus drivers.
17 Signed-off-by: Jean Delvare <jdelvare@suse.de>
18 Signed-off-by: Thomas Renninger <trenn@suse.de>
19 Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
20 Cc: Len Brown <lenb@kernel.org>
21 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
24 drivers/hwmon/dme1737.c | 5 +++++
25 drivers/hwmon/f71805f.c | 5 +++++
26 drivers/hwmon/f71882fg.c | 5 +++++
27 drivers/hwmon/it87.c | 5 +++++
28 drivers/hwmon/pc87360.c | 6 ++++++
29 drivers/hwmon/pc87427.c | 5 +++++
30 drivers/hwmon/sis5595.c | 5 +++++
31 drivers/hwmon/smsc47b397.c | 5 +++++
32 drivers/hwmon/smsc47m1.c | 5 +++++
33 drivers/hwmon/via686a.c | 5 +++++
34 drivers/hwmon/vt1211.c | 5 +++++
35 drivers/hwmon/vt8231.c | 5 +++++
36 drivers/hwmon/w83627ehf.c | 6 ++++++
37 drivers/hwmon/w83627hf.c | 5 +++++
38 14 files changed, 72 insertions(+)
40 --- a/drivers/hwmon/dme1737.c
41 +++ b/drivers/hwmon/dme1737.c
43 #include <linux/hwmon-vid.h>
44 #include <linux/err.h>
45 #include <linux/mutex.h>
46 +#include <linux/acpi.h>
49 /* ISA device, if found */
50 @@ -2372,6 +2373,10 @@ static int __init dme1737_isa_device_add
54 + err = acpi_check_resource_conflict(&res);
58 if (!(pdev = platform_device_alloc("dme1737", addr))) {
59 printk(KERN_ERR "dme1737: Failed to allocate device.\n");
61 --- a/drivers/hwmon/f71805f.c
62 +++ b/drivers/hwmon/f71805f.c
64 #include <linux/mutex.h>
65 #include <linux/sysfs.h>
66 #include <linux/ioport.h>
67 +#include <linux/acpi.h>
70 static unsigned short force_id;
71 @@ -1455,6 +1456,10 @@ static int __init f71805f_device_add(uns
74 res.name = pdev->name;
75 + err = acpi_check_resource_conflict(&res);
77 + goto exit_device_put;
79 err = platform_device_add_resources(pdev, &res, 1);
81 printk(KERN_ERR DRVNAME ": Device resource addition failed "
82 --- a/drivers/hwmon/f71882fg.c
83 +++ b/drivers/hwmon/f71882fg.c
85 #include <linux/hwmon-sysfs.h>
86 #include <linux/err.h>
87 #include <linux/mutex.h>
88 +#include <linux/acpi.h>
91 #define DRVNAME "f71882fg"
92 @@ -892,6 +893,10 @@ static int __init f71882fg_device_add(un
95 res.name = f71882fg_pdev->name;
96 + err = acpi_check_resource_conflict(&res);
100 err = platform_device_add_resources(f71882fg_pdev, &res, 1);
102 printk(KERN_ERR DRVNAME ": Device resource addition failed\n");
103 --- a/drivers/hwmon/it87.c
104 +++ b/drivers/hwmon/it87.c
106 #include <linux/sysfs.h>
107 #include <linux/string.h>
108 #include <linux/dmi.h>
109 +#include <linux/acpi.h>
112 #define DRVNAME "it87"
113 @@ -1535,6 +1536,10 @@ static int __init it87_device_add(unsign
117 + err = acpi_check_resource_conflict(&res);
121 pdev = platform_device_alloc(DRVNAME, address);
124 --- a/drivers/hwmon/pc87360.c
125 +++ b/drivers/hwmon/pc87360.c
127 #include <linux/hwmon-vid.h>
128 #include <linux/err.h>
129 #include <linux/mutex.h>
130 +#include <linux/acpi.h>
134 @@ -1425,6 +1426,11 @@ static int __init pc87360_device_add(uns
136 res.start = extra_isa[i];
137 res.end = extra_isa[i] + PC87360_EXTENT - 1;
139 + err = acpi_check_resource_conflict(&res);
141 + goto exit_device_put;
143 err = platform_device_add_resources(pdev, &res, 1);
145 printk(KERN_ERR "pc87360: Device resource[%d] "
146 --- a/drivers/hwmon/pc87427.c
147 +++ b/drivers/hwmon/pc87427.c
149 #include <linux/mutex.h>
150 #include <linux/sysfs.h>
151 #include <linux/ioport.h>
152 +#include <linux/acpi.h>
155 static unsigned short force_id;
156 @@ -524,6 +525,10 @@ static int __init pc87427_device_add(uns
160 + err = acpi_check_resource_conflict(&res);
164 pdev = platform_device_alloc(DRVNAME, address);
167 --- a/drivers/hwmon/sis5595.c
168 +++ b/drivers/hwmon/sis5595.c
170 #include <linux/jiffies.h>
171 #include <linux/mutex.h>
172 #include <linux/sysfs.h>
173 +#include <linux/acpi.h>
177 @@ -727,6 +728,10 @@ static int __devinit sis5595_device_add(
181 + err = acpi_check_resource_conflict(&res);
185 pdev = platform_device_alloc("sis5595", address);
188 --- a/drivers/hwmon/smsc47b397.c
189 +++ b/drivers/hwmon/smsc47b397.c
191 #include <linux/err.h>
192 #include <linux/init.h>
193 #include <linux/mutex.h>
194 +#include <linux/acpi.h>
197 static unsigned short force_id;
198 @@ -303,6 +304,10 @@ static int __init smsc47b397_device_add(
202 + err = acpi_check_resource_conflict(&res);
206 pdev = platform_device_alloc(DRVNAME, address);
209 --- a/drivers/hwmon/smsc47m1.c
210 +++ b/drivers/hwmon/smsc47m1.c
212 #include <linux/init.h>
213 #include <linux/mutex.h>
214 #include <linux/sysfs.h>
215 +#include <linux/acpi.h>
218 static unsigned short force_id;
219 @@ -716,6 +717,10 @@ static int __init smsc47m1_device_add(un
223 + err = acpi_check_resource_conflict(&res);
227 pdev = platform_device_alloc(DRVNAME, address);
230 --- a/drivers/hwmon/via686a.c
231 +++ b/drivers/hwmon/via686a.c
233 #include <linux/init.h>
234 #include <linux/mutex.h>
235 #include <linux/sysfs.h>
236 +#include <linux/acpi.h>
240 @@ -783,6 +784,10 @@ static int __devinit via686a_device_add(
244 + err = acpi_check_resource_conflict(&res);
248 pdev = platform_device_alloc("via686a", address);
251 --- a/drivers/hwmon/vt1211.c
252 +++ b/drivers/hwmon/vt1211.c
254 #include <linux/err.h>
255 #include <linux/mutex.h>
256 #include <linux/ioport.h>
257 +#include <linux/acpi.h>
260 static int uch_config = -1;
261 @@ -1259,6 +1260,10 @@ static int __init vt1211_device_add(unsi
264 res.name = pdev->name;
265 + err = acpi_check_resource_conflict(&res);
269 err = platform_device_add_resources(pdev, &res, 1);
271 printk(KERN_ERR DRVNAME ": Device resource addition failed "
272 --- a/drivers/hwmon/vt8231.c
273 +++ b/drivers/hwmon/vt8231.c
275 #include <linux/hwmon-vid.h>
276 #include <linux/err.h>
277 #include <linux/mutex.h>
278 +#include <linux/acpi.h>
281 static int force_addr;
282 @@ -894,6 +895,10 @@ static int __devinit vt8231_device_add(u
286 + err = acpi_check_resource_conflict(&res);
290 pdev = platform_device_alloc("vt8231", address);
293 --- a/drivers/hwmon/w83627ehf.c
294 +++ b/drivers/hwmon/w83627ehf.c
296 #include <linux/hwmon-vid.h>
297 #include <linux/err.h>
298 #include <linux/mutex.h>
299 +#include <linux/acpi.h>
303 @@ -1544,6 +1545,11 @@ static int __init sensors_w83627ehf_init
304 res.start = address + IOREGION_OFFSET;
305 res.end = address + IOREGION_OFFSET + IOREGION_LENGTH - 1;
306 res.flags = IORESOURCE_IO;
308 + err = acpi_check_resource_conflict(&res);
312 err = platform_device_add_resources(pdev, &res, 1);
314 printk(KERN_ERR DRVNAME ": Device resource addition failed "
315 --- a/drivers/hwmon/w83627hf.c
316 +++ b/drivers/hwmon/w83627hf.c
318 #include <linux/err.h>
319 #include <linux/mutex.h>
320 #include <linux/ioport.h>
321 +#include <linux/acpi.h>
325 @@ -1793,6 +1794,10 @@ static int __init w83627hf_device_add(un
329 + err = acpi_check_resource_conflict(&res);
333 pdev = platform_device_alloc(DRVNAME, address);