aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorfrançois romieu <romieu@fr.zoreil.com>2010-04-26 07:42:06 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-26 18:36:47 -0400
commit87aeec767e1de60d7f76abbb44df5372b0932b7b (patch)
treec6cc319efa9212bdd1b9c843e326bddf6c4d9638 /drivers/net
parent4eb8b9031a0314539605733597b1e30222d4da70 (diff)
r8169: failure to enable mwi should not be fatal
Few (6) network drivers enable mwi explicitly. Fewer worry about a failure. It is not a fix but it should avoid some annoyance like http://bugzilla.kernel.org/show_bug.cgi?id=15454 Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Conrad Kostecki <conikost@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/r8169.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index dbb1f5a1824c..2b54389c8f57 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2759,6 +2759,7 @@ static void rtl8169_release_board(struct pci_dev *pdev, struct net_device *dev,
2759{ 2759{
2760 iounmap(ioaddr); 2760 iounmap(ioaddr);
2761 pci_release_regions(pdev); 2761 pci_release_regions(pdev);
2762 pci_clear_mwi(pdev);
2762 pci_disable_device(pdev); 2763 pci_disable_device(pdev);
2763 free_netdev(dev); 2764 free_netdev(dev);
2764} 2765}
@@ -3014,9 +3015,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3014 goto err_out_free_dev_1; 3015 goto err_out_free_dev_1;
3015 } 3016 }
3016 3017
3017 rc = pci_set_mwi(pdev); 3018 if (pci_set_mwi(pdev) < 0)
3018 if (rc < 0) 3019 netif_info(tp, probe, dev, "Mem-Wr-Inval unavailable\n");
3019 goto err_out_disable_2;
3020 3020
3021 /* make sure PCI base addr 1 is MMIO */ 3021 /* make sure PCI base addr 1 is MMIO */
3022 if (!(pci_resource_flags(pdev, region) & IORESOURCE_MEM)) { 3022 if (!(pci_resource_flags(pdev, region) & IORESOURCE_MEM)) {
@@ -3024,7 +3024,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3024 "region #%d not an MMIO resource, aborting\n", 3024 "region #%d not an MMIO resource, aborting\n",
3025 region); 3025 region);
3026 rc = -ENODEV; 3026 rc = -ENODEV;
3027 goto err_out_mwi_3; 3027 goto err_out_mwi_2;
3028 } 3028 }
3029 3029
3030 /* check for weird/broken PCI region reporting */ 3030 /* check for weird/broken PCI region reporting */
@@ -3032,13 +3032,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3032 netif_err(tp, probe, dev, 3032 netif_err(tp, probe, dev,
3033 "Invalid PCI region size(s), aborting\n"); 3033 "Invalid PCI region size(s), aborting\n");
3034 rc = -ENODEV; 3034 rc = -ENODEV;
3035 goto err_out_mwi_3; 3035 goto err_out_mwi_2;
3036 } 3036 }
3037 3037
3038 rc = pci_request_regions(pdev, MODULENAME); 3038 rc = pci_request_regions(pdev, MODULENAME);
3039 if (rc < 0) { 3039 if (rc < 0) {
3040 netif_err(tp, probe, dev, "could not request regions\n"); 3040 netif_err(tp, probe, dev, "could not request regions\n");
3041 goto err_out_mwi_3; 3041 goto err_out_mwi_2;
3042 } 3042 }
3043 3043
3044 tp->cp_cmd = PCIMulRW | RxChkSum; 3044 tp->cp_cmd = PCIMulRW | RxChkSum;
@@ -3051,7 +3051,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3051 rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); 3051 rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
3052 if (rc < 0) { 3052 if (rc < 0) {
3053 netif_err(tp, probe, dev, "DMA configuration failed\n"); 3053 netif_err(tp, probe, dev, "DMA configuration failed\n");
3054 goto err_out_free_res_4; 3054 goto err_out_free_res_3;
3055 } 3055 }
3056 } 3056 }
3057 3057
@@ -3060,7 +3060,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3060 if (!ioaddr) { 3060 if (!ioaddr) {
3061 netif_err(tp, probe, dev, "cannot remap MMIO, aborting\n"); 3061 netif_err(tp, probe, dev, "cannot remap MMIO, aborting\n");
3062 rc = -EIO; 3062 rc = -EIO;
3063 goto err_out_free_res_4; 3063 goto err_out_free_res_3;
3064 } 3064 }
3065 3065
3066 tp->pcie_cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); 3066 tp->pcie_cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
@@ -3102,7 +3102,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3102 if (i == ARRAY_SIZE(rtl_chip_info)) { 3102 if (i == ARRAY_SIZE(rtl_chip_info)) {
3103 dev_err(&pdev->dev, 3103 dev_err(&pdev->dev,
3104 "driver bug, MAC version not found in rtl_chip_info\n"); 3104 "driver bug, MAC version not found in rtl_chip_info\n");
3105 goto err_out_msi_5; 3105 goto err_out_msi_4;
3106 } 3106 }
3107 tp->chipset = i; 3107 tp->chipset = i;
3108 3108
@@ -3167,7 +3167,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3167 3167
3168 rc = register_netdev(dev); 3168 rc = register_netdev(dev);
3169 if (rc < 0) 3169 if (rc < 0)
3170 goto err_out_msi_5; 3170 goto err_out_msi_4;
3171 3171
3172 pci_set_drvdata(pdev, dev); 3172 pci_set_drvdata(pdev, dev);
3173 3173
@@ -3190,14 +3190,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3190out: 3190out:
3191 return rc; 3191 return rc;
3192 3192
3193err_out_msi_5: 3193err_out_msi_4:
3194 rtl_disable_msi(pdev, tp); 3194 rtl_disable_msi(pdev, tp);
3195 iounmap(ioaddr); 3195 iounmap(ioaddr);
3196err_out_free_res_4: 3196err_out_free_res_3:
3197 pci_release_regions(pdev); 3197 pci_release_regions(pdev);
3198err_out_mwi_3: 3198err_out_mwi_2:
3199 pci_clear_mwi(pdev); 3199 pci_clear_mwi(pdev);
3200err_out_disable_2:
3201 pci_disable_device(pdev); 3200 pci_disable_device(pdev);
3202err_out_free_dev_1: 3201err_out_free_dev_1:
3203 free_netdev(dev); 3202 free_netdev(dev);