FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 03-09-2008, 11:34 AM
Jean Delvare
 
Default hwmon: (w83781d) Fix I/O resource conflict with PNP Bug: #242761

Only request I/O ports 0x295-0x296 instead of the full I/O address
range. This solves a conflict with PNP resources on a few motherboards.

Also request the I/O ports in two parts (4 low ports, 4 high ports)
during device detection, otherwise the PNP resource makes the request
(and thus the detection) fail.

This fixes lm-sensors ticket #2306:
http://www.lm-sensors.org/ticket/2306

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
drivers/hwmon/w83781d.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index e0fa752..92c0a7f 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1380,7 +1380,8 @@ w83781d_isa_probe(struct platform_device *pdev)

/* Reserve the ISA region */
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
- if (!request_region(res->start, W83781D_EXTENT, "w83781d")) {
+ if (!request_region(res->start + W83781D_ADDR_REG_OFFSET, 2,
+ "w83781d")) {
err = -EBUSY;
goto exit;
}
@@ -1432,7 +1433,7 @@ w83781d_isa_probe(struct platform_device *pdev)
device_remove_file(&pdev->dev, &dev_attr_name);
kfree(data);
exit_release_region:
- release_region(res->start, W83781D_EXTENT);
+ release_region(res->start + W83781D_ADDR_REG_OFFSET, 2);
exit:
return err;
}
@@ -1446,7 +1447,7 @@ w83781d_isa_remove(struct platform_device *pdev)
sysfs_remove_group(&pdev->dev.kobj, &w83781d_group);
sysfs_remove_group(&pdev->dev.kobj, &w83781d_group_opt);
device_remove_file(&pdev->dev, &dev_attr_name);
- release_region(data->client.addr, W83781D_EXTENT);
+ release_region(data->client.addr + W83781D_ADDR_REG_OFFSET, 2);
kfree(data);

return 0;
@@ -1820,8 +1821,17 @@ w83781d_isa_found(unsigned short address)
{
int val, save, found = 0;

- if (!request_region(address, W83781D_EXTENT, "w83781d"))
+ /* We have to request the region in two parts because some
+ boards declare base+4 to base+7 as a PNP device */
+ if (!request_region(address, 4, "w83781d")) {
+ pr_debug("w83781d: Failed to request low part of region
");
return 0;
+ }
+ if (!request_region(address + 4, 4, "w83781d")) {
+ pr_debug("w83781d: Failed to request high part of region
");
+ release_region(address, 4);
+ return 0;
+ }

#define REALLY_SLOW_IO
/* We need the timeouts for at least some W83781D-like
@@ -1896,7 +1906,8 @@ w83781d_isa_found(unsigned short address)
val == 0x30 ? "W83782D" : "W83781D", (int)address);

release:
- release_region(address, W83781D_EXTENT);
+ release_region(address + 4, 4);
+ release_region(address, 4);
return found;
}

--
1.5.4.3


--------------000309070103050200080009
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team

--------------000309070103050200080009--
 

Thread Tools




All times are GMT. The time now is 09:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org