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
This commit is contained in:
commit
62fd985717
@ -2111,11 +2111,18 @@ F: drivers/edac/i5000_edac.c
|
|||||||
|
|
||||||
EDAC-I5400
|
EDAC-I5400
|
||||||
M: Mauro Carvalho Chehab <mchehab@redhat.com>
|
M: Mauro Carvalho Chehab <mchehab@redhat.com>
|
||||||
L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
|
L: linux-edac@vger.kernel.org
|
||||||
W: bluesmoke.sourceforge.net
|
W: bluesmoke.sourceforge.net
|
||||||
S: Maintained
|
S: Maintained
|
||||||
F: drivers/edac/i5400_edac.c
|
F: drivers/edac/i5400_edac.c
|
||||||
|
|
||||||
|
EDAC-I7CORE
|
||||||
|
M: Mauro Carvalho Chehab <mchehab@redhat.com>
|
||||||
|
L: linux-edac@vger.kernel.org
|
||||||
|
W: bluesmoke.sourceforge.net
|
||||||
|
S: Maintained
|
||||||
|
F: drivers/edac/i7core_edac.c linux/edac_mce.h drivers/edac/edac_mce.c
|
||||||
|
|
||||||
EDAC-I82975X
|
EDAC-I82975X
|
||||||
M: Ranganathan Desikan <ravi@jetztechnologies.com>
|
M: Ranganathan Desikan <ravi@jetztechnologies.com>
|
||||||
M: "Arvind R." <arvind@jetztechnologies.com>
|
M: "Arvind R." <arvind@jetztechnologies.com>
|
||||||
|
@ -1233,10 +1233,28 @@ static void __init i7core_xeon_pci_fixup(struct pci_id_table *table)
|
|||||||
for (i = 0; i < MAX_SOCKET_BUSES; i++)
|
for (i = 0; i < MAX_SOCKET_BUSES; i++)
|
||||||
pcibios_scan_specific_bus(255-i);
|
pcibios_scan_specific_bus(255-i);
|
||||||
}
|
}
|
||||||
|
pci_dev_put(pdev);
|
||||||
table++;
|
table++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned i7core_pci_lastbus(void)
|
||||||
|
{
|
||||||
|
int last_bus = 0, bus;
|
||||||
|
struct pci_bus *b = NULL;
|
||||||
|
|
||||||
|
while ((b = pci_find_next_bus(b)) != NULL) {
|
||||||
|
bus = b->number;
|
||||||
|
debugf0("Found bus %d\n", bus);
|
||||||
|
if (bus > last_bus)
|
||||||
|
last_bus = bus;
|
||||||
|
}
|
||||||
|
|
||||||
|
debugf0("Last bus %d\n", last_bus);
|
||||||
|
|
||||||
|
return last_bus;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* i7core_get_devices Find and perform 'get' operation on the MCH's
|
* i7core_get_devices Find and perform 'get' operation on the MCH's
|
||||||
* device/functions we want to reference for this driver
|
* device/functions we want to reference for this driver
|
||||||
@ -1244,7 +1262,8 @@ static void __init i7core_xeon_pci_fixup(struct pci_id_table *table)
|
|||||||
* Need to 'get' device 16 func 1 and func 2
|
* Need to 'get' device 16 func 1 and func 2
|
||||||
*/
|
*/
|
||||||
int i7core_get_onedevice(struct pci_dev **prev, int devno,
|
int i7core_get_onedevice(struct pci_dev **prev, int devno,
|
||||||
struct pci_id_descr *dev_descr, unsigned n_devs)
|
struct pci_id_descr *dev_descr, unsigned n_devs,
|
||||||
|
unsigned last_bus)
|
||||||
{
|
{
|
||||||
struct i7core_dev *i7core_dev;
|
struct i7core_dev *i7core_dev;
|
||||||
|
|
||||||
@ -1291,10 +1310,7 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno,
|
|||||||
}
|
}
|
||||||
bus = pdev->bus->number;
|
bus = pdev->bus->number;
|
||||||
|
|
||||||
if (bus == 0x3f)
|
socket = last_bus - bus;
|
||||||
socket = 0;
|
|
||||||
else
|
|
||||||
socket = 255 - bus;
|
|
||||||
|
|
||||||
i7core_dev = get_i7core_dev(socket);
|
i7core_dev = get_i7core_dev(socket);
|
||||||
if (!i7core_dev) {
|
if (!i7core_dev) {
|
||||||
@ -1358,17 +1374,21 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno,
|
|||||||
|
|
||||||
static int i7core_get_devices(struct pci_id_table *table)
|
static int i7core_get_devices(struct pci_id_table *table)
|
||||||
{
|
{
|
||||||
int i, rc;
|
int i, rc, last_bus;
|
||||||
struct pci_dev *pdev = NULL;
|
struct pci_dev *pdev = NULL;
|
||||||
struct pci_id_descr *dev_descr;
|
struct pci_id_descr *dev_descr;
|
||||||
|
|
||||||
|
last_bus = i7core_pci_lastbus();
|
||||||
|
|
||||||
while (table && table->descr) {
|
while (table && table->descr) {
|
||||||
dev_descr = table->descr;
|
dev_descr = table->descr;
|
||||||
for (i = 0; i < table->n_devs; i++) {
|
for (i = 0; i < table->n_devs; i++) {
|
||||||
pdev = NULL;
|
pdev = NULL;
|
||||||
do {
|
do {
|
||||||
rc = i7core_get_onedevice(&pdev, i, &dev_descr[i],
|
rc = i7core_get_onedevice(&pdev, i,
|
||||||
table->n_devs);
|
&dev_descr[i],
|
||||||
|
table->n_devs,
|
||||||
|
last_bus);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
i = table->n_devs;
|
i = table->n_devs;
|
||||||
@ -1927,21 +1947,26 @@ fail:
|
|||||||
* 0 for FOUND a device
|
* 0 for FOUND a device
|
||||||
* < 0 for error code
|
* < 0 for error code
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static int probed = 0;
|
||||||
|
|
||||||
static int __devinit i7core_probe(struct pci_dev *pdev,
|
static int __devinit i7core_probe(struct pci_dev *pdev,
|
||||||
const struct pci_device_id *id)
|
const struct pci_device_id *id)
|
||||||
{
|
{
|
||||||
int dev_idx = id->driver_data;
|
|
||||||
int rc;
|
int rc;
|
||||||
struct i7core_dev *i7core_dev;
|
struct i7core_dev *i7core_dev;
|
||||||
|
|
||||||
|
/* get the pci devices we want to reserve for our use */
|
||||||
|
mutex_lock(&i7core_edac_lock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* All memory controllers are allocated at the first pass.
|
* All memory controllers are allocated at the first pass.
|
||||||
*/
|
*/
|
||||||
if (unlikely(dev_idx >= 1))
|
if (unlikely(probed >= 1)) {
|
||||||
|
mutex_unlock(&i7core_edac_lock);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
/* get the pci devices we want to reserve for our use */
|
probed++;
|
||||||
mutex_lock(&i7core_edac_lock);
|
|
||||||
|
|
||||||
rc = i7core_get_devices(pci_dev_table);
|
rc = i7core_get_devices(pci_dev_table);
|
||||||
if (unlikely(rc < 0))
|
if (unlikely(rc < 0))
|
||||||
@ -2013,6 +2038,8 @@ static void __devexit i7core_remove(struct pci_dev *pdev)
|
|||||||
i7core_dev->socket);
|
i7core_dev->socket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
probed--;
|
||||||
|
|
||||||
mutex_unlock(&i7core_edac_lock);
|
mutex_unlock(&i7core_edac_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user