Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359969
b: refs/heads/master
c: 52608ba
h: refs/heads/master
i:
  359967: 5ff8a76
v: v3
  • Loading branch information
Niklas Söderlund authored and Mauro Carvalho Chehab committed Feb 21, 2013
1 parent bfe5ec2 commit ae5c626
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7100478fa894c45ae33321b5721b5a8f956b814
refs/heads/master: 52608ba20546139dc76cca8a46c1d901455d5450
28 changes: 27 additions & 1 deletion trunk/drivers/edac/i5100_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ struct i5100_priv {
unsigned ranksperchan; /* number of ranks per channel */

struct pci_dev *mc; /* device 16 func 1 */
struct pci_dev *einj; /* device 19 func 0 */
struct pci_dev *ch0mm; /* device 21 func 0 */
struct pci_dev *ch1mm; /* device 22 func 0 */

Expand Down Expand Up @@ -869,7 +870,7 @@ static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
struct mem_ctl_info *mci;
struct edac_mc_layer layers[2];
struct i5100_priv *priv;
struct pci_dev *ch0mm, *ch1mm;
struct pci_dev *ch0mm, *ch1mm, *einj;
int ret = 0;
u32 dw;
int ranksperch;
Expand Down Expand Up @@ -941,13 +942,30 @@ static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
goto bail_disable_ch1;
}


/* device 19, func 0, Error injection */
einj = pci_get_device_func(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_5100_19, 0);
if (!einj) {
ret = -ENODEV;
goto bail_einj;
}

rc = pci_enable_device(einj);
if (rc < 0) {
ret = rc;
goto bail_disable_einj;
}


mci->pdev = &pdev->dev;

priv = mci->pvt_info;
priv->ranksperchan = ranksperch;
priv->mc = pdev;
priv->ch0mm = ch0mm;
priv->ch1mm = ch1mm;
priv->einj = einj;

INIT_DELAYED_WORK(&(priv->i5100_scrubbing), i5100_refresh_scrubbing);

Expand Down Expand Up @@ -999,6 +1017,12 @@ static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
cancel_delayed_work_sync(&(priv->i5100_scrubbing));
edac_mc_free(mci);

bail_disable_einj:
pci_disable_device(einj);

bail_einj:
pci_dev_put(einj);

bail_disable_ch1:
pci_disable_device(ch1mm);

Expand Down Expand Up @@ -1036,8 +1060,10 @@ static void i5100_remove_one(struct pci_dev *pdev)
pci_disable_device(pdev);
pci_disable_device(priv->ch0mm);
pci_disable_device(priv->ch1mm);
pci_disable_device(priv->einj);
pci_dev_put(priv->ch0mm);
pci_dev_put(priv->ch1mm);
pci_dev_put(priv->einj);

edac_mc_free(mci);
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/pci_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,7 @@
#define PCI_DEVICE_ID_INTEL_JAKETOWN_UBOX 0x3ce0
#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0
#define PCI_DEVICE_ID_INTEL_5100_19 0x65f3
#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5
#define PCI_DEVICE_ID_INTEL_5100_22 0x65f6
#define PCI_DEVICE_ID_INTEL_5400_ERR 0x4030
Expand Down

0 comments on commit ae5c626

Please sign in to comment.