diff options
author | David S. Miller <davem@davemloft.net> | 2016-01-29 23:33:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-29 23:33:57 -0500 |
commit | ae9d723e9fbe9fb28213b7df26475791428bf76a (patch) | |
tree | 6e94790bc109bd4867b580ec9199443b106875f8 | |
parent | 84922d8cd49c505dc0912f57f4ab1f8f33c7e118 (diff) | |
parent | e434e04110704eb91acfecbd0fb8ca8e2da9c29b (diff) |
Merge branch 'arnd-net-driver-fixes'
Arnd Bergmann says:
====================
network driver fixes
This is an updated series of fixes for the network device drivers
that showed warnings in ARM randconfig.
Changes since v1 are:
dropped "net: macb: avoid uninitialized variables", already fixed in net-next
dropped "net: fddi/defxx: avoid warning about uninitialized variable
use", already fixed in net-next
added missing barriers in "net: moxart: use correct accessors for
DMA memory"
clarified "net: bgmac: clarify CONFIG_BCMA dependency" changelog
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/aurora/nb8800.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/Kconfig | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/hp/hp100.c | 18 | ||||
-rw-r--r-- | drivers/net/ethernet/neterion/vxge/vxge-main.c | 31 | ||||
-rw-r--r-- | drivers/net/ethernet/ti/davinci_cpdma.c | 12 |
6 files changed, 25 insertions, 47 deletions
diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index ecc4a334c507..f71ab2647a3b 100644 --- a/drivers/net/ethernet/aurora/nb8800.c +++ b/drivers/net/ethernet/aurora/nb8800.c | |||
@@ -302,7 +302,7 @@ static int nb8800_poll(struct napi_struct *napi, int budget) | |||
302 | nb8800_tx_done(dev); | 302 | nb8800_tx_done(dev); |
303 | 303 | ||
304 | again: | 304 | again: |
305 | while (work < budget) { | 305 | do { |
306 | struct nb8800_rx_buf *rxb; | 306 | struct nb8800_rx_buf *rxb; |
307 | unsigned int len; | 307 | unsigned int len; |
308 | 308 | ||
@@ -330,7 +330,7 @@ again: | |||
330 | rxd->report = 0; | 330 | rxd->report = 0; |
331 | last = next; | 331 | last = next; |
332 | work++; | 332 | work++; |
333 | } | 333 | } while (work < budget); |
334 | 334 | ||
335 | if (work) { | 335 | if (work) { |
336 | priv->rx_descs[last].desc.config |= DESC_EOC; | 336 | priv->rx_descs[last].desc.config |= DESC_EOC; |
diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig index 8550df189ceb..19f7cd02e085 100644 --- a/drivers/net/ethernet/broadcom/Kconfig +++ b/drivers/net/ethernet/broadcom/Kconfig | |||
@@ -151,8 +151,11 @@ config BNX2X_VXLAN | |||
151 | 151 | ||
152 | config BGMAC | 152 | config BGMAC |
153 | tristate "BCMA bus GBit core support" | 153 | tristate "BCMA bus GBit core support" |
154 | depends on BCMA_HOST_SOC && HAS_DMA && (BCM47XX || ARCH_BCM_5301X) | 154 | depends on BCMA && BCMA_HOST_SOC |
155 | depends on HAS_DMA | ||
156 | depends on BCM47XX || ARCH_BCM_5301X || COMPILE_TEST | ||
155 | select PHYLIB | 157 | select PHYLIB |
158 | select FIXED_PHY | ||
156 | ---help--- | 159 | ---help--- |
157 | This driver supports GBit MAC and BCM4706 GBit MAC cores on BCMA bus. | 160 | This driver supports GBit MAC and BCM4706 GBit MAC cores on BCMA bus. |
158 | They can be found on BCM47xx SoCs and provide gigabit ethernet. | 161 | They can be found on BCM47xx SoCs and provide gigabit ethernet. |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 9293675df7ba..49eea8981332 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -12016,7 +12016,7 @@ static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, | |||
12016 | int ret; | 12016 | int ret; |
12017 | u32 offset, len, b_offset, odd_len; | 12017 | u32 offset, len, b_offset, odd_len; |
12018 | u8 *buf; | 12018 | u8 *buf; |
12019 | __be32 start, end; | 12019 | __be32 start = 0, end; |
12020 | 12020 | ||
12021 | if (tg3_flag(tp, NO_NVRAM) || | 12021 | if (tg3_flag(tp, NO_NVRAM) || |
12022 | eeprom->magic != TG3_EEPROM_MAGIC) | 12022 | eeprom->magic != TG3_EEPROM_MAGIC) |
diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c index 1d5c3e16d8f4..3daf2d4a7ca0 100644 --- a/drivers/net/ethernet/hp/hp100.c +++ b/drivers/net/ethernet/hp/hp100.c | |||
@@ -194,7 +194,6 @@ static const char *hp100_isa_tbl[] = { | |||
194 | }; | 194 | }; |
195 | #endif | 195 | #endif |
196 | 196 | ||
197 | #ifdef CONFIG_EISA | ||
198 | static struct eisa_device_id hp100_eisa_tbl[] = { | 197 | static struct eisa_device_id hp100_eisa_tbl[] = { |
199 | { "HWPF180" }, /* HP J2577 rev A */ | 198 | { "HWPF180" }, /* HP J2577 rev A */ |
200 | { "HWP1920" }, /* HP 27248B */ | 199 | { "HWP1920" }, /* HP 27248B */ |
@@ -205,9 +204,7 @@ static struct eisa_device_id hp100_eisa_tbl[] = { | |||
205 | { "" } /* Mandatory final entry ! */ | 204 | { "" } /* Mandatory final entry ! */ |
206 | }; | 205 | }; |
207 | MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl); | 206 | MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl); |
208 | #endif | ||
209 | 207 | ||
210 | #ifdef CONFIG_PCI | ||
211 | static const struct pci_device_id hp100_pci_tbl[] = { | 208 | static const struct pci_device_id hp100_pci_tbl[] = { |
212 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,}, | 209 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,}, |
213 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,}, | 210 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,}, |
@@ -219,7 +216,6 @@ static const struct pci_device_id hp100_pci_tbl[] = { | |||
219 | {} /* Terminating entry */ | 216 | {} /* Terminating entry */ |
220 | }; | 217 | }; |
221 | MODULE_DEVICE_TABLE(pci, hp100_pci_tbl); | 218 | MODULE_DEVICE_TABLE(pci, hp100_pci_tbl); |
222 | #endif | ||
223 | 219 | ||
224 | static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO; | 220 | static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO; |
225 | static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX; | 221 | static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX; |
@@ -2842,7 +2838,6 @@ static void cleanup_dev(struct net_device *d) | |||
2842 | free_netdev(d); | 2838 | free_netdev(d); |
2843 | } | 2839 | } |
2844 | 2840 | ||
2845 | #ifdef CONFIG_EISA | ||
2846 | static int hp100_eisa_probe(struct device *gendev) | 2841 | static int hp100_eisa_probe(struct device *gendev) |
2847 | { | 2842 | { |
2848 | struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); | 2843 | struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); |
@@ -2884,9 +2879,7 @@ static struct eisa_driver hp100_eisa_driver = { | |||
2884 | .remove = hp100_eisa_remove, | 2879 | .remove = hp100_eisa_remove, |
2885 | } | 2880 | } |
2886 | }; | 2881 | }; |
2887 | #endif | ||
2888 | 2882 | ||
2889 | #ifdef CONFIG_PCI | ||
2890 | static int hp100_pci_probe(struct pci_dev *pdev, | 2883 | static int hp100_pci_probe(struct pci_dev *pdev, |
2891 | const struct pci_device_id *ent) | 2884 | const struct pci_device_id *ent) |
2892 | { | 2885 | { |
@@ -2955,7 +2948,6 @@ static struct pci_driver hp100_pci_driver = { | |||
2955 | .probe = hp100_pci_probe, | 2948 | .probe = hp100_pci_probe, |
2956 | .remove = hp100_pci_remove, | 2949 | .remove = hp100_pci_remove, |
2957 | }; | 2950 | }; |
2958 | #endif | ||
2959 | 2951 | ||
2960 | /* | 2952 | /* |
2961 | * module section | 2953 | * module section |
@@ -3032,23 +3024,17 @@ static int __init hp100_module_init(void) | |||
3032 | err = hp100_isa_init(); | 3024 | err = hp100_isa_init(); |
3033 | if (err && err != -ENODEV) | 3025 | if (err && err != -ENODEV) |
3034 | goto out; | 3026 | goto out; |
3035 | #ifdef CONFIG_EISA | ||
3036 | err = eisa_driver_register(&hp100_eisa_driver); | 3027 | err = eisa_driver_register(&hp100_eisa_driver); |
3037 | if (err && err != -ENODEV) | 3028 | if (err && err != -ENODEV) |
3038 | goto out2; | 3029 | goto out2; |
3039 | #endif | ||
3040 | #ifdef CONFIG_PCI | ||
3041 | err = pci_register_driver(&hp100_pci_driver); | 3030 | err = pci_register_driver(&hp100_pci_driver); |
3042 | if (err && err != -ENODEV) | 3031 | if (err && err != -ENODEV) |
3043 | goto out3; | 3032 | goto out3; |
3044 | #endif | ||
3045 | out: | 3033 | out: |
3046 | return err; | 3034 | return err; |
3047 | out3: | 3035 | out3: |
3048 | #ifdef CONFIG_EISA | ||
3049 | eisa_driver_unregister (&hp100_eisa_driver); | 3036 | eisa_driver_unregister (&hp100_eisa_driver); |
3050 | out2: | 3037 | out2: |
3051 | #endif | ||
3052 | hp100_isa_cleanup(); | 3038 | hp100_isa_cleanup(); |
3053 | goto out; | 3039 | goto out; |
3054 | } | 3040 | } |
@@ -3057,12 +3043,8 @@ static int __init hp100_module_init(void) | |||
3057 | static void __exit hp100_module_exit(void) | 3043 | static void __exit hp100_module_exit(void) |
3058 | { | 3044 | { |
3059 | hp100_isa_cleanup(); | 3045 | hp100_isa_cleanup(); |
3060 | #ifdef CONFIG_EISA | ||
3061 | eisa_driver_unregister (&hp100_eisa_driver); | 3046 | eisa_driver_unregister (&hp100_eisa_driver); |
3062 | #endif | ||
3063 | #ifdef CONFIG_PCI | ||
3064 | pci_unregister_driver (&hp100_pci_driver); | 3047 | pci_unregister_driver (&hp100_pci_driver); |
3065 | #endif | ||
3066 | } | 3048 | } |
3067 | 3049 | ||
3068 | module_init(hp100_module_init) | 3050 | module_init(hp100_module_init) |
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c index 50d5604833ed..e0993eba5df3 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c | |||
@@ -2223,8 +2223,6 @@ static irqreturn_t vxge_isr_napi(int irq, void *dev_id) | |||
2223 | return IRQ_NONE; | 2223 | return IRQ_NONE; |
2224 | } | 2224 | } |
2225 | 2225 | ||
2226 | #ifdef CONFIG_PCI_MSI | ||
2227 | |||
2228 | static irqreturn_t vxge_tx_msix_handle(int irq, void *dev_id) | 2226 | static irqreturn_t vxge_tx_msix_handle(int irq, void *dev_id) |
2229 | { | 2227 | { |
2230 | struct vxge_fifo *fifo = (struct vxge_fifo *)dev_id; | 2228 | struct vxge_fifo *fifo = (struct vxge_fifo *)dev_id; |
@@ -2442,16 +2440,13 @@ static void vxge_rem_msix_isr(struct vxgedev *vdev) | |||
2442 | if (vdev->config.intr_type == MSI_X) | 2440 | if (vdev->config.intr_type == MSI_X) |
2443 | pci_disable_msix(vdev->pdev); | 2441 | pci_disable_msix(vdev->pdev); |
2444 | } | 2442 | } |
2445 | #endif | ||
2446 | 2443 | ||
2447 | static void vxge_rem_isr(struct vxgedev *vdev) | 2444 | static void vxge_rem_isr(struct vxgedev *vdev) |
2448 | { | 2445 | { |
2449 | #ifdef CONFIG_PCI_MSI | 2446 | if (IS_ENABLED(CONFIG_PCI_MSI) && |
2450 | if (vdev->config.intr_type == MSI_X) { | 2447 | vdev->config.intr_type == MSI_X) { |
2451 | vxge_rem_msix_isr(vdev); | 2448 | vxge_rem_msix_isr(vdev); |
2452 | } else | 2449 | } else if (vdev->config.intr_type == INTA) { |
2453 | #endif | ||
2454 | if (vdev->config.intr_type == INTA) { | ||
2455 | synchronize_irq(vdev->pdev->irq); | 2450 | synchronize_irq(vdev->pdev->irq); |
2456 | free_irq(vdev->pdev->irq, vdev); | 2451 | free_irq(vdev->pdev->irq, vdev); |
2457 | } | 2452 | } |
@@ -2460,11 +2455,10 @@ static void vxge_rem_isr(struct vxgedev *vdev) | |||
2460 | static int vxge_add_isr(struct vxgedev *vdev) | 2455 | static int vxge_add_isr(struct vxgedev *vdev) |
2461 | { | 2456 | { |
2462 | int ret = 0; | 2457 | int ret = 0; |
2463 | #ifdef CONFIG_PCI_MSI | ||
2464 | int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0; | 2458 | int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0; |
2465 | int pci_fun = PCI_FUNC(vdev->pdev->devfn); | 2459 | int pci_fun = PCI_FUNC(vdev->pdev->devfn); |
2466 | 2460 | ||
2467 | if (vdev->config.intr_type == MSI_X) | 2461 | if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) |
2468 | ret = vxge_enable_msix(vdev); | 2462 | ret = vxge_enable_msix(vdev); |
2469 | 2463 | ||
2470 | if (ret) { | 2464 | if (ret) { |
@@ -2475,7 +2469,7 @@ static int vxge_add_isr(struct vxgedev *vdev) | |||
2475 | vdev->config.intr_type = INTA; | 2469 | vdev->config.intr_type = INTA; |
2476 | } | 2470 | } |
2477 | 2471 | ||
2478 | if (vdev->config.intr_type == MSI_X) { | 2472 | if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) { |
2479 | for (intr_idx = 0; | 2473 | for (intr_idx = 0; |
2480 | intr_idx < (vdev->no_of_vpath * | 2474 | intr_idx < (vdev->no_of_vpath * |
2481 | VXGE_HW_VPATH_MSIX_ACTIVE); intr_idx++) { | 2475 | VXGE_HW_VPATH_MSIX_ACTIVE); intr_idx++) { |
@@ -2576,9 +2570,8 @@ static int vxge_add_isr(struct vxgedev *vdev) | |||
2576 | vdev->vxge_entries[intr_cnt].in_use = 1; | 2570 | vdev->vxge_entries[intr_cnt].in_use = 1; |
2577 | vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0]; | 2571 | vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0]; |
2578 | } | 2572 | } |
2579 | INTA_MODE: | ||
2580 | #endif | ||
2581 | 2573 | ||
2574 | INTA_MODE: | ||
2582 | if (vdev->config.intr_type == INTA) { | 2575 | if (vdev->config.intr_type == INTA) { |
2583 | snprintf(vdev->desc[0], VXGE_INTR_STRLEN, | 2576 | snprintf(vdev->desc[0], VXGE_INTR_STRLEN, |
2584 | "%s:vxge:INTA", vdev->ndev->name); | 2577 | "%s:vxge:INTA", vdev->ndev->name); |
@@ -3889,12 +3882,12 @@ static void vxge_device_config_init(struct vxge_hw_device_config *device_config, | |||
3889 | if (max_mac_vpath > VXGE_MAX_MAC_ADDR_COUNT) | 3882 | if (max_mac_vpath > VXGE_MAX_MAC_ADDR_COUNT) |
3890 | max_mac_vpath = VXGE_MAX_MAC_ADDR_COUNT; | 3883 | max_mac_vpath = VXGE_MAX_MAC_ADDR_COUNT; |
3891 | 3884 | ||
3892 | #ifndef CONFIG_PCI_MSI | 3885 | if (!IS_ENABLED(CONFIG_PCI_MSI)) { |
3893 | vxge_debug_init(VXGE_ERR, | 3886 | vxge_debug_init(VXGE_ERR, |
3894 | "%s: This Kernel does not support " | 3887 | "%s: This Kernel does not support " |
3895 | "MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME); | 3888 | "MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME); |
3896 | *intr_type = INTA; | 3889 | *intr_type = INTA; |
3897 | #endif | 3890 | } |
3898 | 3891 | ||
3899 | /* Configure whether MSI-X or IRQL. */ | 3892 | /* Configure whether MSI-X or IRQL. */ |
3900 | switch (*intr_type) { | 3893 | switch (*intr_type) { |
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c index 657b65bf5cac..18bf3a8fdc50 100644 --- a/drivers/net/ethernet/ti/davinci_cpdma.c +++ b/drivers/net/ethernet/ti/davinci_cpdma.c | |||
@@ -82,7 +82,7 @@ struct cpdma_desc { | |||
82 | 82 | ||
83 | struct cpdma_desc_pool { | 83 | struct cpdma_desc_pool { |
84 | phys_addr_t phys; | 84 | phys_addr_t phys; |
85 | u32 hw_addr; | 85 | dma_addr_t hw_addr; |
86 | void __iomem *iomap; /* ioremap map */ | 86 | void __iomem *iomap; /* ioremap map */ |
87 | void *cpumap; /* dma_alloc map */ | 87 | void *cpumap; /* dma_alloc map */ |
88 | int desc_size, mem_size; | 88 | int desc_size, mem_size; |
@@ -152,7 +152,7 @@ struct cpdma_chan { | |||
152 | * abstract out these details | 152 | * abstract out these details |
153 | */ | 153 | */ |
154 | static struct cpdma_desc_pool * | 154 | static struct cpdma_desc_pool * |
155 | cpdma_desc_pool_create(struct device *dev, u32 phys, u32 hw_addr, | 155 | cpdma_desc_pool_create(struct device *dev, u32 phys, dma_addr_t hw_addr, |
156 | int size, int align) | 156 | int size, int align) |
157 | { | 157 | { |
158 | int bitmap_size; | 158 | int bitmap_size; |
@@ -176,13 +176,13 @@ cpdma_desc_pool_create(struct device *dev, u32 phys, u32 hw_addr, | |||
176 | 176 | ||
177 | if (phys) { | 177 | if (phys) { |
178 | pool->phys = phys; | 178 | pool->phys = phys; |
179 | pool->iomap = ioremap(phys, size); | 179 | pool->iomap = ioremap(phys, size); /* should be memremap? */ |
180 | pool->hw_addr = hw_addr; | 180 | pool->hw_addr = hw_addr; |
181 | } else { | 181 | } else { |
182 | pool->cpumap = dma_alloc_coherent(dev, size, &pool->phys, | 182 | pool->cpumap = dma_alloc_coherent(dev, size, &pool->hw_addr, |
183 | GFP_KERNEL); | 183 | GFP_KERNEL); |
184 | pool->iomap = pool->cpumap; | 184 | pool->iomap = (void __iomem __force *)pool->cpumap; |
185 | pool->hw_addr = pool->phys; | 185 | pool->phys = pool->hw_addr; /* assumes no IOMMU, don't use this value */ |
186 | } | 186 | } |
187 | 187 | ||
188 | if (pool->iomap) | 188 | if (pool->iomap) |