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.

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/i7core

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/i7core:
MAINTAINERS: Add an entry for i7core_edac
i7core_edac: Avoid doing multiple probes for the same card
i7core_edac: Properly discover the first QPI device

+48 -14
+8 -1
MAINTAINERS
··· 2111 2111 2112 2112 EDAC-I5400 2113 2113 M: Mauro Carvalho Chehab <mchehab@redhat.com> 2114 - L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 2114 + L: linux-edac@vger.kernel.org 2115 2115 W: bluesmoke.sourceforge.net 2116 2116 S: Maintained 2117 2117 F: drivers/edac/i5400_edac.c 2118 + 2119 + EDAC-I7CORE 2120 + M: Mauro Carvalho Chehab <mchehab@redhat.com> 2121 + L: linux-edac@vger.kernel.org 2122 + W: bluesmoke.sourceforge.net 2123 + S: Maintained 2124 + F: drivers/edac/i7core_edac.c linux/edac_mce.h drivers/edac/edac_mce.c 2118 2125 2119 2126 EDAC-I82975X 2120 2127 M: Ranganathan Desikan <ravi@jetztechnologies.com>
+40 -13
drivers/edac/i7core_edac.c
··· 1233 1233 for (i = 0; i < MAX_SOCKET_BUSES; i++) 1234 1234 pcibios_scan_specific_bus(255-i); 1235 1235 } 1236 + pci_dev_put(pdev); 1236 1237 table++; 1237 1238 } 1239 + } 1240 + 1241 + static unsigned i7core_pci_lastbus(void) 1242 + { 1243 + int last_bus = 0, bus; 1244 + struct pci_bus *b = NULL; 1245 + 1246 + while ((b = pci_find_next_bus(b)) != NULL) { 1247 + bus = b->number; 1248 + debugf0("Found bus %d\n", bus); 1249 + if (bus > last_bus) 1250 + last_bus = bus; 1251 + } 1252 + 1253 + debugf0("Last bus %d\n", last_bus); 1254 + 1255 + return last_bus; 1238 1256 } 1239 1257 1240 1258 /* ··· 1262 1244 * Need to 'get' device 16 func 1 and func 2 1263 1245 */ 1264 1246 int i7core_get_onedevice(struct pci_dev **prev, int devno, 1265 - struct pci_id_descr *dev_descr, unsigned n_devs) 1247 + struct pci_id_descr *dev_descr, unsigned n_devs, 1248 + unsigned last_bus) 1266 1249 { 1267 1250 struct i7core_dev *i7core_dev; 1268 1251 ··· 1310 1291 } 1311 1292 bus = pdev->bus->number; 1312 1293 1313 - if (bus == 0x3f) 1314 - socket = 0; 1315 - else 1316 - socket = 255 - bus; 1294 + socket = last_bus - bus; 1317 1295 1318 1296 i7core_dev = get_i7core_dev(socket); 1319 1297 if (!i7core_dev) { ··· 1374 1358 1375 1359 static int i7core_get_devices(struct pci_id_table *table) 1376 1360 { 1377 - int i, rc; 1361 + int i, rc, last_bus; 1378 1362 struct pci_dev *pdev = NULL; 1379 1363 struct pci_id_descr *dev_descr; 1364 + 1365 + last_bus = i7core_pci_lastbus(); 1380 1366 1381 1367 while (table && table->descr) { 1382 1368 dev_descr = table->descr; 1383 1369 for (i = 0; i < table->n_devs; i++) { 1384 1370 pdev = NULL; 1385 1371 do { 1386 - rc = i7core_get_onedevice(&pdev, i, &dev_descr[i], 1387 - table->n_devs); 1372 + rc = i7core_get_onedevice(&pdev, i, 1373 + &dev_descr[i], 1374 + table->n_devs, 1375 + last_bus); 1388 1376 if (rc < 0) { 1389 1377 if (i == 0) { 1390 1378 i = table->n_devs; ··· 1947 1927 * 0 for FOUND a device 1948 1928 * < 0 for error code 1949 1929 */ 1930 + 1931 + static int probed = 0; 1932 + 1950 1933 static int __devinit i7core_probe(struct pci_dev *pdev, 1951 1934 const struct pci_device_id *id) 1952 1935 { 1953 - int dev_idx = id->driver_data; 1954 1936 int rc; 1955 1937 struct i7core_dev *i7core_dev; 1938 + 1939 + /* get the pci devices we want to reserve for our use */ 1940 + mutex_lock(&i7core_edac_lock); 1956 1941 1957 1942 /* 1958 1943 * All memory controllers are allocated at the first pass. 1959 1944 */ 1960 - if (unlikely(dev_idx >= 1)) 1945 + if (unlikely(probed >= 1)) { 1946 + mutex_unlock(&i7core_edac_lock); 1961 1947 return -EINVAL; 1962 - 1963 - /* get the pci devices we want to reserve for our use */ 1964 - mutex_lock(&i7core_edac_lock); 1948 + } 1949 + probed++; 1965 1950 1966 1951 rc = i7core_get_devices(pci_dev_table); 1967 1952 if (unlikely(rc < 0)) ··· 2038 2013 i7core_dev->socket); 2039 2014 } 2040 2015 } 2016 + probed--; 2017 + 2041 2018 mutex_unlock(&i7core_edac_lock); 2042 2019 } 2043 2020