Skip to content

Commit 6d04dfc

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix handling of interrupt status in stmmac driver. Just because we have masked the event from generating interrupts, doesn't mean the bit won't still be set in the interrupt status register. From Alexey Brodkin. 2) Fix DMA API debugging splats in gianfar driver, from Arseny Solokha. 3) Fix off-by-one error in __ip6_append_data(), from Vlad Yasevich. 4) cls_flow does not match on icmpv6 codes properly, from Simon Horman. 5) Initial MAC address can be set incorrectly in some scenerios, from Ivan Vecera. 6) Packet header pointer arithmetic fix in ip6_tnl_parse_tlv_end_lim(), from Dan Carpenter. 7) Fix divide by zero in __tcp_select_window(), from Eric Dumazet. 8) Fix crash in iwlwifi when unregistering thermal zone, from Jens Axboe. 9) Check for DMA mapping errors in starfire driver, from Alexey Khoroshilov. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (31 commits) tcp: fix 0 divide in __tcp_select_window() ipv6: pointer math error in ip6_tnl_parse_tlv_enc_lim() net: fix ndo_features_check/ndo_fix_features comment ordering net/sched: matchall: Fix configuration race be2net: fix initial MAC setting ipv6: fix flow labels when the traffic class is non-0 net: thunderx: avoid dereferencing xcv when NULL net/sched: cls_flower: Correct matching on ICMPv6 code ipv6: Paritially checksum full MTU frames net/mlx4_core: Avoid command timeouts during VF driver device shutdown gianfar: synchronize DMA API usage by free_skb_rx_queue w/ gfar_new_page net: ethtool: add support for 2500BaseT and 5000BaseT link modes can: bcm: fix hrtimer/tasklet termination in bcm op removal net: adaptec: starfire: add checks for dma mapping errors net: phy: micrel: KSZ8795 do not set SUPPORTED_[Asym_]Pause can: Fix kernel panic at security_sock_rcv_skb net: macb: Fix 64 bit addressing support for GEM stmmac: Discard masked flags in interrupt status register net/mlx5e: Check ets capability before ets query FW command net/mlx5e: Fix update of hash function/key via ethtool ...
2 parents 2883aae + 06425c3 commit 6d04dfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+555
-370
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10195,7 +10195,6 @@ F: drivers/media/tuners/qt1010*
1019510195
QUALCOMM ATHEROS ATH9K WIRELESS DRIVER
1019610196
M: QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
1019710197
L: linux-wireless@vger.kernel.org
10198-
L: ath9k-devel@lists.ath9k.org
1019910198
W: http://wireless.kernel.org/en/users/Drivers/ath9k
1020010199
S: Supported
1020110200
F: drivers/net/wireless/ath/ath9k/

drivers/bcma/bcma_private.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ int bcma_sprom_get(struct bcma_bus *bus);
4545
void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
4646
void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
4747
void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
48+
#ifdef CONFIG_BCMA_DRIVER_MIPS
49+
void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
50+
#endif /* CONFIG_BCMA_DRIVER_MIPS */
4851

4952
/* driver_chipcommon_b.c */
5053
int bcma_core_chipcommon_b_init(struct bcma_drv_cc_b *ccb);

drivers/bcma/driver_chipcommon.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include <linux/platform_device.h>
1616
#include <linux/bcma/bcma.h>
1717

18-
static void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
19-
2018
static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
2119
u32 mask, u32 value)
2220
{
@@ -186,9 +184,6 @@ void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
186184
if (cc->capabilities & BCMA_CC_CAP_PMU)
187185
bcma_pmu_early_init(cc);
188186

189-
if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC)
190-
bcma_chipco_serial_init(cc);
191-
192187
if (bus->hosttype == BCMA_HOSTTYPE_SOC)
193188
bcma_core_chipcommon_flash_detect(cc);
194189

@@ -378,9 +373,9 @@ u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value)
378373
return res;
379374
}
380375

381-
static void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
376+
#ifdef CONFIG_BCMA_DRIVER_MIPS
377+
void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
382378
{
383-
#if IS_BUILTIN(CONFIG_BCM47XX)
384379
unsigned int irq;
385380
u32 baud_base;
386381
u32 i;
@@ -422,5 +417,5 @@ static void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
422417
ports[i].baud_base = baud_base;
423418
ports[i].reg_shift = 0;
424419
}
425-
#endif /* CONFIG_BCM47XX */
426420
}
421+
#endif /* CONFIG_BCMA_DRIVER_MIPS */

drivers/bcma/driver_mips.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,12 @@ static void bcma_core_mips_nvram_init(struct bcma_drv_mips *mcore)
278278

279279
void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
280280
{
281+
struct bcma_bus *bus = mcore->core->bus;
282+
281283
if (mcore->early_setup_done)
282284
return;
283285

286+
bcma_chipco_serial_init(&bus->drv_cc);
284287
bcma_core_mips_nvram_init(mcore);
285288

286289
mcore->early_setup_done = true;

drivers/net/ethernet/adaptec/starfire.c

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,12 @@ static void init_ring(struct net_device *dev)
11521152
if (skb == NULL)
11531153
break;
11541154
np->rx_info[i].mapping = pci_map_single(np->pci_dev, skb->data, np->rx_buf_sz, PCI_DMA_FROMDEVICE);
1155+
if (pci_dma_mapping_error(np->pci_dev,
1156+
np->rx_info[i].mapping)) {
1157+
dev_kfree_skb(skb);
1158+
np->rx_info[i].skb = NULL;
1159+
break;
1160+
}
11551161
/* Grrr, we cannot offset to correctly align the IP header. */
11561162
np->rx_ring[i].rxaddr = cpu_to_dma(np->rx_info[i].mapping | RxDescValid);
11571163
}
@@ -1182,8 +1188,9 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
11821188
{
11831189
struct netdev_private *np = netdev_priv(dev);
11841190
unsigned int entry;
1191+
unsigned int prev_tx;
11851192
u32 status;
1186-
int i;
1193+
int i, j;
11871194

11881195
/*
11891196
* be cautious here, wrapping the queue has weird semantics
@@ -1201,6 +1208,7 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
12011208
}
12021209
#endif /* ZEROCOPY && HAS_BROKEN_FIRMWARE */
12031210

1211+
prev_tx = np->cur_tx;
12041212
entry = np->cur_tx % TX_RING_SIZE;
12051213
for (i = 0; i < skb_num_frags(skb); i++) {
12061214
int wrap_ring = 0;
@@ -1234,6 +1242,11 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
12341242
skb_frag_size(this_frag),
12351243
PCI_DMA_TODEVICE);
12361244
}
1245+
if (pci_dma_mapping_error(np->pci_dev,
1246+
np->tx_info[entry].mapping)) {
1247+
dev->stats.tx_dropped++;
1248+
goto err_out;
1249+
}
12371250

12381251
np->tx_ring[entry].addr = cpu_to_dma(np->tx_info[entry].mapping);
12391252
np->tx_ring[entry].status = cpu_to_le32(status);
@@ -1268,8 +1281,30 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
12681281
netif_stop_queue(dev);
12691282

12701283
return NETDEV_TX_OK;
1271-
}
12721284

1285+
err_out:
1286+
entry = prev_tx % TX_RING_SIZE;
1287+
np->tx_info[entry].skb = NULL;
1288+
if (i > 0) {
1289+
pci_unmap_single(np->pci_dev,
1290+
np->tx_info[entry].mapping,
1291+
skb_first_frag_len(skb),
1292+
PCI_DMA_TODEVICE);
1293+
np->tx_info[entry].mapping = 0;
1294+
entry = (entry + np->tx_info[entry].used_slots) % TX_RING_SIZE;
1295+
for (j = 1; j < i; j++) {
1296+
pci_unmap_single(np->pci_dev,
1297+
np->tx_info[entry].mapping,
1298+
skb_frag_size(
1299+
&skb_shinfo(skb)->frags[j-1]),
1300+
PCI_DMA_TODEVICE);
1301+
entry++;
1302+
}
1303+
}
1304+
dev_kfree_skb_any(skb);
1305+
np->cur_tx = prev_tx;
1306+
return NETDEV_TX_OK;
1307+
}
12731308

12741309
/* The interrupt handler does all of the Rx thread work and cleans up
12751310
after the Tx thread. */
@@ -1569,6 +1604,12 @@ static void refill_rx_ring(struct net_device *dev)
15691604
break; /* Better luck next round. */
15701605
np->rx_info[entry].mapping =
15711606
pci_map_single(np->pci_dev, skb->data, np->rx_buf_sz, PCI_DMA_FROMDEVICE);
1607+
if (pci_dma_mapping_error(np->pci_dev,
1608+
np->rx_info[entry].mapping)) {
1609+
dev_kfree_skb(skb);
1610+
np->rx_info[entry].skb = NULL;
1611+
break;
1612+
}
15721613
np->rx_ring[entry].rxaddr =
15731614
cpu_to_dma(np->rx_info[entry].mapping | RxDescValid);
15741615
}

0 commit comments

Comments
 (0)