diff options
author | Jon Mason <mason@myri.com> | 2011-06-27 01:05:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-29 09:02:04 -0400 |
commit | 7539a613c646f9e870bbedfa753a54cf13b98d22 (patch) | |
tree | e0d0433cde6ea1fa58550b8011eeab97b7719c43 /drivers | |
parent | 3b20b2dc5f713aa7eca20a8ff942292974a1cc94 (diff) |
myri10ge: Mask PCI Surprise Link Down Events
A SRAM parity error can cause a surprise link down. Since We can
recover from SRAM parity errors, mask PCI surprise down events.
Signed-off-by: Jon Mason <mason@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index a8ae641d0bd1..0f0f83d50ddc 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -3327,6 +3327,26 @@ static void myri10ge_select_firmware(struct myri10ge_priv *mgp) | |||
3327 | mgp->fw_name); | 3327 | mgp->fw_name); |
3328 | } | 3328 | } |
3329 | 3329 | ||
3330 | static void myri10ge_mask_surprise_down(struct pci_dev *pdev) | ||
3331 | { | ||
3332 | struct pci_dev *bridge = pdev->bus->self; | ||
3333 | int cap; | ||
3334 | u32 mask; | ||
3335 | |||
3336 | if (bridge == NULL) | ||
3337 | return; | ||
3338 | |||
3339 | cap = pci_find_ext_capability(bridge, PCI_EXT_CAP_ID_ERR); | ||
3340 | if (cap) { | ||
3341 | /* a sram parity error can cause a surprise link | ||
3342 | * down; since we expect and can recover from sram | ||
3343 | * parity errors, mask surprise link down events */ | ||
3344 | pci_read_config_dword(bridge, cap + PCI_ERR_UNCOR_MASK, &mask); | ||
3345 | mask |= 0x20; | ||
3346 | pci_write_config_dword(bridge, cap + PCI_ERR_UNCOR_MASK, mask); | ||
3347 | } | ||
3348 | } | ||
3349 | |||
3330 | #ifdef CONFIG_PM | 3350 | #ifdef CONFIG_PM |
3331 | static int myri10ge_suspend(struct pci_dev *pdev, pm_message_t state) | 3351 | static int myri10ge_suspend(struct pci_dev *pdev, pm_message_t state) |
3332 | { | 3352 | { |
@@ -3845,6 +3865,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3845 | goto abort_with_enabled; | 3865 | goto abort_with_enabled; |
3846 | } | 3866 | } |
3847 | 3867 | ||
3868 | myri10ge_mask_surprise_down(pdev); | ||
3848 | pci_set_master(pdev); | 3869 | pci_set_master(pdev); |
3849 | dac_enabled = 1; | 3870 | dac_enabled = 1; |
3850 | status = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); | 3871 | status = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); |