Skip to content

Commit 433ab34

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Here are some bug fixes that have piled up during ksummit/linuxcon. 1) Fix endian problems in ibmveth, from Anton Blanchard. 2) IPV6 routing code does GFP_KERNEL allocation in atomic, fix from Benjamin Block. 3) SCTP association fixes from Daniel Borkmann. 4) When multiple VLAN headers are present we have to make sure the second and subsequent ones are pullable in the SKB otherwise we blindly dereference garbage. From Jiri Benc. 5) The argument adjustment of the signature of hlist_add_after*() introduced a regression in the batman-adv code, fix from Sven Eckelmann. 6) Fix TX hang handling to avoid a panic in i40e, from Anjali Singhai Jain. 7) PTP flag test is inverted in i40e driver, from Jesse Brandeburg. 8) ATM LEC driver needs to hold RTNL mutex over MTU changes, from Chas Williams. 9) Truncate packets larger then the TPACKET_V3 format configured buffers, otherwise we overwrite past the end of said buffers. From Eric Dumazet. 10) Fix endianness bugs in qlcnic firmware handling, from Rajesh Borundia and Shahed Shaikh. 11) CXGB4 sometimes doesn't get all of the TX completion events it should resulting in SKBs getting stuck in the TX queue, from Hariprasad Shenai. 12) When the FEC chip's PTP clock is disabled, you can't access the register. Add necessary checks to avoid the resulting hang, from Fugang Duan" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (37 commits) drivers: isdn: eicon: xdi_msg.h: Fix typo in #ifndef net: sctp: fix suboptimal edge-case on non-active active/retrans path selection net: sctp: spare unnecessary comparison in sctp_trans_elect_best net: ethernet: broadcom: bnx2x: Remove redundant #ifdef ibmveth: Fix endian issues with rx_no_buffer statistic net: xgene: fix possible NULL dereference in xgene_enet_free_desc_rings() openvswitch: fix panic with multiple vlan headers net: ipv6: fib: don't sleep inside atomic lock net: fec: ptp: avoid register access when ipg clock is disabled cxgb4: Free completed tx skbs promptly cxgb4: Fix race condition in cleanup sctp: not send SCTP_PEER_ADDR_CHANGE notifications with failed probe bnx2x: Revert UNDI flushing mechanism qlcnic: Fix endianess issue in firmware load from file operation qlcnic: Fix endianess issue in FW dump template header qlcnic: Fix flash access interface to application MAINTAINERS: Add section for MRF24J40 IEEE 802.15.4 radio driver macvlan: Allow setting multicast filter on all macvlan types packet: handle too big packets for PACKET_V3 MAINTAINERS: add entry for ec_bhf driver ...
2 parents 26d189b + faaa552 commit 433ab34

File tree

38 files changed

+413
-261
lines changed

38 files changed

+413
-261
lines changed

MAINTAINERS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,12 @@ S: Orphan
18431843
F: Documentation/filesystems/befs.txt
18441844
F: fs/befs/
18451845

1846+
BECKHOFF CX5020 ETHERCAT MASTER DRIVER
1847+
M: Dariusz Marcinkiewicz <[email protected]>
1848+
1849+
S: Maintained
1850+
F: drivers/net/ethernet/ec_bhf.c
1851+
18461852
BFS FILE SYSTEM
18471853
M: "Tigran A. Aivazian" <[email protected]>
18481854
S: Maintained
@@ -5982,6 +5988,12 @@ T: git git://linuxtv.org/media_tree.git
59825988
S: Maintained
59835989
F: drivers/media/radio/radio-mr800.c
59845990

5991+
MRF24J40 IEEE 802.15.4 RADIO DRIVER
5992+
M: Alan Ott <[email protected]>
5993+
5994+
S: Maintained
5995+
F: drivers/net/ieee802154/mrf24j40.c
5996+
59855997
MSI LAPTOP SUPPORT
59865998
M: "Lee, Chun-Yi" <[email protected]>
59875999

drivers/isdn/hardware/eicon/xdi_msg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* $Id: xdi_msg.h,v 1.1.2.2 2001/02/16 08:40:36 armin Exp $ */
22

3-
#ifndef __DIVA_XDI_UM_CFG_MESSSGE_H__
3+
#ifndef __DIVA_XDI_UM_CFG_MESSAGE_H__
44
#define __DIVA_XDI_UM_CFG_MESSAGE_H__
55

66
/*

drivers/net/can/c_can/c_can_platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
280280

281281
priv->raminit_ctrlreg = devm_ioremap(&pdev->dev, res->start,
282282
resource_size(res));
283-
if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
283+
if (!priv->raminit_ctrlreg || priv->instance < 0)
284284
dev_info(&pdev->dev, "control memory is not used for raminit\n");
285285
else
286286
priv->raminit = c_can_hw_raminit_ti;

drivers/net/can/flexcan.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,13 @@ static void do_state(struct net_device *dev,
549549

550550
/* process state changes depending on the new state */
551551
switch (new_state) {
552+
case CAN_STATE_ERROR_WARNING:
553+
netdev_dbg(dev, "Error Warning\n");
554+
cf->can_id |= CAN_ERR_CRTL;
555+
cf->data[1] = (bec.txerr > bec.rxerr) ?
556+
CAN_ERR_CRTL_TX_WARNING :
557+
CAN_ERR_CRTL_RX_WARNING;
558+
break;
552559
case CAN_STATE_ERROR_ACTIVE:
553560
netdev_dbg(dev, "Error Active\n");
554561
cf->can_id |= CAN_ERR_PROT;
@@ -852,6 +859,8 @@ static int flexcan_chip_start(struct net_device *dev)
852859
if (priv->devtype_data->features & FLEXCAN_HAS_BROKEN_ERR_STATE ||
853860
priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)
854861
reg_ctrl |= FLEXCAN_CTRL_ERR_MSK;
862+
else
863+
reg_ctrl &= ~FLEXCAN_CTRL_ERR_MSK;
855864

856865
/* save for later use */
857866
priv->reg_ctrl_default = reg_ctrl;

drivers/net/can/sja1000/sja1000.c

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,35 @@ static void set_normal_mode(struct net_device *dev)
172172
netdev_err(dev, "setting SJA1000 into normal mode failed!\n");
173173
}
174174

175+
/*
176+
* initialize SJA1000 chip:
177+
* - reset chip
178+
* - set output mode
179+
* - set baudrate
180+
* - enable interrupts
181+
* - start operating mode
182+
*/
183+
static void chipset_init(struct net_device *dev)
184+
{
185+
struct sja1000_priv *priv = netdev_priv(dev);
186+
187+
/* set clock divider and output control register */
188+
priv->write_reg(priv, SJA1000_CDR, priv->cdr | CDR_PELICAN);
189+
190+
/* set acceptance filter (accept all) */
191+
priv->write_reg(priv, SJA1000_ACCC0, 0x00);
192+
priv->write_reg(priv, SJA1000_ACCC1, 0x00);
193+
priv->write_reg(priv, SJA1000_ACCC2, 0x00);
194+
priv->write_reg(priv, SJA1000_ACCC3, 0x00);
195+
196+
priv->write_reg(priv, SJA1000_ACCM0, 0xFF);
197+
priv->write_reg(priv, SJA1000_ACCM1, 0xFF);
198+
priv->write_reg(priv, SJA1000_ACCM2, 0xFF);
199+
priv->write_reg(priv, SJA1000_ACCM3, 0xFF);
200+
201+
priv->write_reg(priv, SJA1000_OCR, priv->ocr | OCR_MODE_NORMAL);
202+
}
203+
175204
static void sja1000_start(struct net_device *dev)
176205
{
177206
struct sja1000_priv *priv = netdev_priv(dev);
@@ -180,6 +209,10 @@ static void sja1000_start(struct net_device *dev)
180209
if (priv->can.state != CAN_STATE_STOPPED)
181210
set_reset_mode(dev);
182211

212+
/* Initialize chip if uninitialized at this stage */
213+
if (!(priv->read_reg(priv, SJA1000_CDR) & CDR_PELICAN))
214+
chipset_init(dev);
215+
183216
/* Clear error counters and error code capture */
184217
priv->write_reg(priv, SJA1000_TXERR, 0x0);
185218
priv->write_reg(priv, SJA1000_RXERR, 0x0);
@@ -236,35 +269,6 @@ static int sja1000_get_berr_counter(const struct net_device *dev,
236269
return 0;
237270
}
238271

239-
/*
240-
* initialize SJA1000 chip:
241-
* - reset chip
242-
* - set output mode
243-
* - set baudrate
244-
* - enable interrupts
245-
* - start operating mode
246-
*/
247-
static void chipset_init(struct net_device *dev)
248-
{
249-
struct sja1000_priv *priv = netdev_priv(dev);
250-
251-
/* set clock divider and output control register */
252-
priv->write_reg(priv, SJA1000_CDR, priv->cdr | CDR_PELICAN);
253-
254-
/* set acceptance filter (accept all) */
255-
priv->write_reg(priv, SJA1000_ACCC0, 0x00);
256-
priv->write_reg(priv, SJA1000_ACCC1, 0x00);
257-
priv->write_reg(priv, SJA1000_ACCC2, 0x00);
258-
priv->write_reg(priv, SJA1000_ACCC3, 0x00);
259-
260-
priv->write_reg(priv, SJA1000_ACCM0, 0xFF);
261-
priv->write_reg(priv, SJA1000_ACCM1, 0xFF);
262-
priv->write_reg(priv, SJA1000_ACCM2, 0xFF);
263-
priv->write_reg(priv, SJA1000_ACCM3, 0xFF);
264-
265-
priv->write_reg(priv, SJA1000_OCR, priv->ocr | OCR_MODE_NORMAL);
266-
}
267-
268272
/*
269273
* transmit a CAN message
270274
* message layout in the sk_buff should be like this:

drivers/net/ethernet/apm/xgene/xgene_enet_main.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,15 +563,21 @@ static void xgene_enet_free_desc_rings(struct xgene_enet_pdata *pdata)
563563
struct xgene_enet_desc_ring *ring;
564564

565565
ring = pdata->tx_ring;
566-
if (ring && ring->cp_ring && ring->cp_ring->cp_skb)
567-
devm_kfree(dev, ring->cp_ring->cp_skb);
568-
xgene_enet_free_desc_ring(ring);
566+
if (ring) {
567+
if (ring->cp_ring && ring->cp_ring->cp_skb)
568+
devm_kfree(dev, ring->cp_ring->cp_skb);
569+
xgene_enet_free_desc_ring(ring);
570+
}
569571

570572
ring = pdata->rx_ring;
571-
if (ring && ring->buf_pool && ring->buf_pool->rx_skb)
572-
devm_kfree(dev, ring->buf_pool->rx_skb);
573-
xgene_enet_free_desc_ring(ring->buf_pool);
574-
xgene_enet_free_desc_ring(ring);
573+
if (ring) {
574+
if (ring->buf_pool) {
575+
if (ring->buf_pool->rx_skb)
576+
devm_kfree(dev, ring->buf_pool->rx_skb);
577+
xgene_enet_free_desc_ring(ring->buf_pool);
578+
}
579+
xgene_enet_free_desc_ring(ring);
580+
}
575581
}
576582

577583
static struct xgene_enet_desc_ring *xgene_enet_create_desc_ring(

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,7 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue,
483483

484484
#ifdef BNX2X_STOP_ON_ERROR
485485
fp->tpa_queue_used |= (1 << queue);
486-
#ifdef _ASM_GENERIC_INT_L64_H
487-
DP(NETIF_MSG_RX_STATUS, "fp->tpa_queue_used = 0x%lx\n",
488-
#else
489486
DP(NETIF_MSG_RX_STATUS, "fp->tpa_queue_used = 0x%llx\n",
490-
#endif
491487
fp->tpa_queue_used);
492488
#endif
493489
}

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 17 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -10052,15 +10052,15 @@ static void bnx2x_prev_unload_close_mac(struct bnx2x *bp,
1005210052
}
1005310053

1005410054
#define BNX2X_PREV_UNDI_PROD_ADDR(p) (BAR_TSTRORM_INTMEM + 0x1508 + ((p) << 4))
10055+
#define BNX2X_PREV_UNDI_PROD_ADDR_H(f) (BAR_TSTRORM_INTMEM + \
10056+
0x1848 + ((f) << 4))
1005510057
#define BNX2X_PREV_UNDI_RCQ(val) ((val) & 0xffff)
1005610058
#define BNX2X_PREV_UNDI_BD(val) ((val) >> 16 & 0xffff)
1005710059
#define BNX2X_PREV_UNDI_PROD(rcq, bd) ((bd) << 16 | (rcq))
1005810060

1005910061
#define BCM_5710_UNDI_FW_MF_MAJOR (0x07)
1006010062
#define BCM_5710_UNDI_FW_MF_MINOR (0x08)
1006110063
#define BCM_5710_UNDI_FW_MF_VERS (0x05)
10062-
#define BNX2X_PREV_UNDI_MF_PORT(p) (BAR_TSTRORM_INTMEM + 0x150c + ((p) << 4))
10063-
#define BNX2X_PREV_UNDI_MF_FUNC(f) (BAR_TSTRORM_INTMEM + 0x184c + ((f) << 4))
1006410064

1006510065
static bool bnx2x_prev_is_after_undi(struct bnx2x *bp)
1006610066
{
@@ -10079,72 +10079,25 @@ static bool bnx2x_prev_is_after_undi(struct bnx2x *bp)
1007910079
return false;
1008010080
}
1008110081

10082-
static bool bnx2x_prev_unload_undi_fw_supports_mf(struct bnx2x *bp)
10083-
{
10084-
u8 major, minor, version;
10085-
u32 fw;
10086-
10087-
/* Must check that FW is loaded */
10088-
if (!(REG_RD(bp, MISC_REG_RESET_REG_1) &
10089-
MISC_REGISTERS_RESET_REG_1_RST_XSEM)) {
10090-
BNX2X_DEV_INFO("XSEM is reset - UNDI MF FW is not loaded\n");
10091-
return false;
10092-
}
10093-
10094-
/* Read Currently loaded FW version */
10095-
fw = REG_RD(bp, XSEM_REG_PRAM);
10096-
major = fw & 0xff;
10097-
minor = (fw >> 0x8) & 0xff;
10098-
version = (fw >> 0x10) & 0xff;
10099-
BNX2X_DEV_INFO("Loaded FW: 0x%08x: Major 0x%02x Minor 0x%02x Version 0x%02x\n",
10100-
fw, major, minor, version);
10101-
10102-
if (major > BCM_5710_UNDI_FW_MF_MAJOR)
10103-
return true;
10104-
10105-
if ((major == BCM_5710_UNDI_FW_MF_MAJOR) &&
10106-
(minor > BCM_5710_UNDI_FW_MF_MINOR))
10107-
return true;
10108-
10109-
if ((major == BCM_5710_UNDI_FW_MF_MAJOR) &&
10110-
(minor == BCM_5710_UNDI_FW_MF_MINOR) &&
10111-
(version >= BCM_5710_UNDI_FW_MF_VERS))
10112-
return true;
10113-
10114-
return false;
10115-
}
10116-
10117-
static void bnx2x_prev_unload_undi_mf(struct bnx2x *bp)
10118-
{
10119-
int i;
10120-
10121-
/* Due to legacy (FW) code, the first function on each engine has a
10122-
* different offset macro from the rest of the functions.
10123-
* Setting this for all 8 functions is harmless regardless of whether
10124-
* this is actually a multi-function device.
10125-
*/
10126-
for (i = 0; i < 2; i++)
10127-
REG_WR(bp, BNX2X_PREV_UNDI_MF_PORT(i), 1);
10128-
10129-
for (i = 2; i < 8; i++)
10130-
REG_WR(bp, BNX2X_PREV_UNDI_MF_FUNC(i - 2), 1);
10131-
10132-
BNX2X_DEV_INFO("UNDI FW (MF) set to discard\n");
10133-
}
10134-
10135-
static void bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 port, u8 inc)
10082+
static void bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 inc)
1013610083
{
1013710084
u16 rcq, bd;
10138-
u32 tmp_reg = REG_RD(bp, BNX2X_PREV_UNDI_PROD_ADDR(port));
10085+
u32 addr, tmp_reg;
1013910086

10087+
if (BP_FUNC(bp) < 2)
10088+
addr = BNX2X_PREV_UNDI_PROD_ADDR(BP_PORT(bp));
10089+
else
10090+
addr = BNX2X_PREV_UNDI_PROD_ADDR_H(BP_FUNC(bp) - 2);
10091+
10092+
tmp_reg = REG_RD(bp, addr);
1014010093
rcq = BNX2X_PREV_UNDI_RCQ(tmp_reg) + inc;
1014110094
bd = BNX2X_PREV_UNDI_BD(tmp_reg) + inc;
1014210095

1014310096
tmp_reg = BNX2X_PREV_UNDI_PROD(rcq, bd);
10144-
REG_WR(bp, BNX2X_PREV_UNDI_PROD_ADDR(port), tmp_reg);
10097+
REG_WR(bp, addr, tmp_reg);
1014510098

10146-
BNX2X_DEV_INFO("UNDI producer [%d] rings bd -> 0x%04x, rcq -> 0x%04x\n",
10147-
port, bd, rcq);
10099+
BNX2X_DEV_INFO("UNDI producer [%d/%d][%08x] rings bd -> 0x%04x, rcq -> 0x%04x\n",
10100+
BP_PORT(bp), BP_FUNC(bp), addr, bd, rcq);
1014810101
}
1014910102

1015010103
static int bnx2x_prev_mcp_done(struct bnx2x *bp)
@@ -10383,7 +10336,6 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
1038310336
/* Reset should be performed after BRB is emptied */
1038410337
if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_BRB1) {
1038510338
u32 timer_count = 1000;
10386-
bool need_write = true;
1038710339

1038810340
/* Close the MAC Rx to prevent BRB from filling up */
1038910341
bnx2x_prev_unload_close_mac(bp, &mac_vals);
@@ -10420,20 +10372,10 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
1042010372
else
1042110373
timer_count--;
1042210374

10423-
/* New UNDI FW supports MF and contains better
10424-
* cleaning methods - might be redundant but harmless.
10425-
*/
10426-
if (bnx2x_prev_unload_undi_fw_supports_mf(bp)) {
10427-
if (need_write) {
10428-
bnx2x_prev_unload_undi_mf(bp);
10429-
need_write = false;
10430-
}
10431-
} else if (prev_undi) {
10432-
/* If UNDI resides in memory,
10433-
* manually increment it
10434-
*/
10435-
bnx2x_prev_unload_undi_inc(bp, BP_PORT(bp), 1);
10436-
}
10375+
/* If UNDI resides in memory, manually increment it */
10376+
if (prev_undi)
10377+
bnx2x_prev_unload_undi_inc(bp, 1);
10378+
1043710379
udelay(10);
1043810380
}
1043910381

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ struct adapter {
652652
struct tid_info tids;
653653
void **tid_release_head;
654654
spinlock_t tid_release_lock;
655+
struct workqueue_struct *workq;
655656
struct work_struct tid_release_task;
656657
struct work_struct db_full_task;
657658
struct work_struct db_drop_task;

0 commit comments

Comments
 (0)