Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hwmon: (it87) request only Environment Controller ports

The IT8705F and related parts are Super I/O controllers that contain
many separate devices.

Some BIOSes describe IT8705F I/O port usage under a motherboard device
(PNP0C02) with overlapping regions, e.g., 0x290-0x29f and 0x290-0x294.

The it87 driver supports only the Environment Controller, which requires
only two ISA ports, but it used to request an eight-port range. If that
range exceeds a range reported by the BIOS, as 0x290-0x297 would, the
request fails, and the it87 driver cannot claim the device.

This patch makes the it87 driver request only the two ports used for the
Environment Controller device.

Systems where this problem has been reported:
Gigabyte GA-K8N Ultra 9
Gigabyte M56S-S3
Gigabyte GA-965G-DS3

Kernel bug reports:
http://bugzilla.kernel.org/show_bug.cgi?id=9514
http://lkml.org/lkml/2007/12/4/466

Related change:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a7839e960675b549f06209d18283d5cee2ce9261

The patch above increases the number of PNP port resources we support.
Prior to this patch, we ignored some port resources, which masked the
it87 problem.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>

authored by

Bjorn Helgaas and committed by
Mark M. Hoffman
87b4b663 d384e35a

+23 -9
+23 -9
drivers/hwmon/it87.c
··· 2 2 it87.c - Part of lm_sensors, Linux kernel modules for hardware 3 3 monitoring. 4 4 5 + The IT8705F is an LPC-based Super I/O part that contains UARTs, a 6 + parallel port, an IR port, a MIDI port, a floppy controller, etc., in 7 + addition to an Environment Controller (Enhanced Hardware Monitor and 8 + Fan Controller) 9 + 10 + This driver supports only the Environment Controller in the IT8705F and 11 + similar parts. The other devices are supported by different drivers. 12 + 5 13 Supports: IT8705F Super I/O chip w/LPC interface 6 14 IT8712F Super I/O chip w/LPC interface 7 15 IT8716F Super I/O chip w/LPC interface ··· 126 118 /* Length of ISA address segment */ 127 119 #define IT87_EXTENT 8 128 120 129 - /* Where are the ISA address/data registers relative to the base address */ 130 - #define IT87_ADDR_REG_OFFSET 5 131 - #define IT87_DATA_REG_OFFSET 6 121 + /* Length of ISA address segment for Environmental Controller */ 122 + #define IT87_EC_EXTENT 2 123 + 124 + /* Offset of EC registers from ISA base address */ 125 + #define IT87_EC_OFFSET 5 126 + 127 + /* Where are the ISA address/data registers relative to the EC base address */ 128 + #define IT87_ADDR_REG_OFFSET 0 129 + #define IT87_DATA_REG_OFFSET 1 132 130 133 131 /*----- The IT87 registers -----*/ 134 132 ··· 982 968 }; 983 969 984 970 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 985 - if (!request_region(res->start, IT87_EXTENT, DRVNAME)) { 971 + if (!request_region(res->start, IT87_EC_EXTENT, DRVNAME)) { 986 972 dev_err(dev, "Failed to request region 0x%lx-0x%lx\n", 987 973 (unsigned long)res->start, 988 - (unsigned long)(res->start + IT87_EXTENT - 1)); 974 + (unsigned long)(res->start + IT87_EC_EXTENT - 1)); 989 975 err = -EBUSY; 990 976 goto ERROR0; 991 977 } ··· 1138 1124 platform_set_drvdata(pdev, NULL); 1139 1125 kfree(data); 1140 1126 ERROR1: 1141 - release_region(res->start, IT87_EXTENT); 1127 + release_region(res->start, IT87_EC_EXTENT); 1142 1128 ERROR0: 1143 1129 return err; 1144 1130 } ··· 1151 1137 sysfs_remove_group(&pdev->dev.kobj, &it87_group); 1152 1138 sysfs_remove_group(&pdev->dev.kobj, &it87_group_opt); 1153 1139 1154 - release_region(data->addr, IT87_EXTENT); 1140 + release_region(data->addr, IT87_EC_EXTENT); 1155 1141 platform_set_drvdata(pdev, NULL); 1156 1142 kfree(data); 1157 1143 ··· 1416 1402 const struct it87_sio_data *sio_data) 1417 1403 { 1418 1404 struct resource res = { 1419 - .start = address , 1420 - .end = address + IT87_EXTENT - 1, 1405 + .start = address + IT87_EC_OFFSET, 1406 + .end = address + IT87_EC_OFFSET + IT87_EC_EXTENT - 1, 1421 1407 .name = DRVNAME, 1422 1408 .flags = IORESOURCE_IO, 1423 1409 };