Skip to content

Commit 186d32b

Browse files
committed
Merge tag 'net-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from bluetooth, and ipsec. Current release - regressions: - Bluetooth: fix unbalanced unlock in set_device_flags() - Bluetooth: fix not processing all entries on cmd_sync_work, make connect with qualcomm and intel adapters reliable - Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0" - xdp: xdp_mem_allocator can be NULL in trace_mem_connect() - eth: ice: fix race condition and deadlock during interface enslave Current release - new code bugs: - tipc: fix incorrect order of state message data sanity check Previous releases - regressions: - esp: fix possible buffer overflow in ESP transformation - dsa: unlock the rtnl_mutex when dsa_master_setup() fails - phy: meson-gxl: fix interrupt handling in forced mode - smsc95xx: ignore -ENODEV errors when device is unplugged Previous releases - always broken: - xfrm: fix tunnel mode fragmentation behavior - esp: fix inter address family tunneling on GSO - tipc: fix null-deref due to race when enabling bearer - sctp: fix kernel-infoleak for SCTP sockets - eth: macb: fix lost RX packet wakeup race in NAPI receive - eth: intel stop disabling VFs due to PF error responses - eth: bcmgenet: don't claim WOL when its not available" * tag 'net-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (50 commits) xdp: xdp_mem_allocator can be NULL in trace_mem_connect(). ice: Fix race condition during interface enslave net: phy: meson-gxl: improve link-up behavior net: bcmgenet: Don't claim WOL when its not available net: arc_emac: Fix use after free in arc_mdio_probe() sctp: fix kernel-infoleak for SCTP sockets net: phy: correct spelling error of media in documentation net: phy: DP83822: clear MISR2 register to disable interrupts gianfar: ethtool: Fix refcount leak in gfar_get_ts_info selftests: pmtu.sh: Kill nettest processes launched in subshell. selftests: pmtu.sh: Kill tcpdump processes launched by subshell. NFC: port100: fix use-after-free in port100_send_complete net/mlx5e: SHAMPO, reduce TIR indication net/mlx5e: Lag, Only handle events from highest priority multipath entry net/mlx5: Fix offloading with ESWITCH_IPV4_TTL_MODIFY_ENABLE net/mlx5: Fix a race on command flush flow net/mlx5: Fix size field in bufferx_reg struct ax25: Fix NULL pointer dereference in ax25_kill_by_device net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr net: ethernet: lpc_eth: Handle error for clk_enable ...
2 parents 3bcb645 + e0ae713 commit 186d32b

57 files changed

Lines changed: 383 additions & 244 deletions

Some content is hidden

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

drivers/isdn/hardware/mISDN/hfcpci.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,11 @@ setup_hw(struct hfc_pci *hc)
20052005
}
20062006
/* Allocate memory for FIFOS */
20072007
/* the memory needs to be on a 32k boundary within the first 4G */
2008-
dma_set_mask(&hc->pdev->dev, 0xFFFF8000);
2008+
if (dma_set_mask(&hc->pdev->dev, 0xFFFF8000)) {
2009+
printk(KERN_WARNING
2010+
"HFC-PCI: No usable DMA configuration!\n");
2011+
return -EIO;
2012+
}
20092013
buffer = dma_alloc_coherent(&hc->pdev->dev, 0x8000, &hc->hw.dmahandle,
20102014
GFP_KERNEL);
20112015
/* We silently assume the address is okay if nonzero */

drivers/isdn/mISDN/dsp_pipeline.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void dsp_pipeline_destroy(struct dsp_pipeline *pipeline)
192192
int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)
193193
{
194194
int found = 0;
195-
char *dup, *tok, *name, *args;
195+
char *dup, *next, *tok, *name, *args;
196196
struct dsp_element_entry *entry, *n;
197197
struct dsp_pipeline_entry *pipeline_entry;
198198
struct mISDN_dsp_element *elem;
@@ -203,10 +203,10 @@ int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)
203203
if (!list_empty(&pipeline->list))
204204
_dsp_pipeline_destroy(pipeline);
205205

206-
dup = kstrdup(cfg, GFP_ATOMIC);
206+
dup = next = kstrdup(cfg, GFP_ATOMIC);
207207
if (!dup)
208208
return 0;
209-
while ((tok = strsep(&dup, "|"))) {
209+
while ((tok = strsep(&next, "|"))) {
210210
if (!strlen(tok))
211211
continue;
212212
name = strsep(&tok, "(");

drivers/net/dsa/mt7530.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,7 @@ mt753x_phylink_validate(struct dsa_switch *ds, int port,
29362936

29372937
phylink_set_port_modes(mask);
29382938

2939-
if (state->interface != PHY_INTERFACE_MODE_TRGMII ||
2939+
if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
29402940
!phy_interface_mode_is_8023z(state->interface)) {
29412941
phylink_set(mask, 10baseT_Half);
29422942
phylink_set(mask, 10baseT_Full);

drivers/net/ethernet/8390/mcf8390.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,12 @@ static int mcf8390_init(struct net_device *dev)
405405
static int mcf8390_probe(struct platform_device *pdev)
406406
{
407407
struct net_device *dev;
408-
struct resource *mem, *irq;
408+
struct resource *mem;
409409
resource_size_t msize;
410-
int ret;
410+
int ret, irq;
411411

412-
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
413-
if (irq == NULL) {
412+
irq = platform_get_irq(pdev, 0);
413+
if (irq < 0) {
414414
dev_err(&pdev->dev, "no IRQ specified?\n");
415415
return -ENXIO;
416416
}
@@ -433,7 +433,7 @@ static int mcf8390_probe(struct platform_device *pdev)
433433
SET_NETDEV_DEV(dev, &pdev->dev);
434434
platform_set_drvdata(pdev, dev);
435435

436-
dev->irq = irq->start;
436+
dev->irq = irq;
437437
dev->base_addr = mem->start;
438438

439439
ret = mcf8390_init(dev);

drivers/net/ethernet/arc/emac_mdio.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
132132
{
133133
struct arc_emac_mdio_bus_data *data = &priv->bus_data;
134134
struct device_node *np = priv->dev->of_node;
135+
const char *name = "Synopsys MII Bus";
135136
struct mii_bus *bus;
136137
int error;
137138

@@ -142,7 +143,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
142143
priv->bus = bus;
143144
bus->priv = priv;
144145
bus->parent = priv->dev;
145-
bus->name = "Synopsys MII Bus";
146+
bus->name = name;
146147
bus->read = &arc_mdio_read;
147148
bus->write = &arc_mdio_write;
148149
bus->reset = &arc_mdio_reset;
@@ -167,7 +168,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
167168
if (error) {
168169
mdiobus_free(bus);
169170
return dev_err_probe(priv->dev, error,
170-
"cannot register MDIO bus %s\n", bus->name);
171+
"cannot register MDIO bus %s\n", name);
171172
}
172173

173174
return 0;

drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
4141
{
4242
struct bcmgenet_priv *priv = netdev_priv(dev);
43+
struct device *kdev = &priv->pdev->dev;
44+
45+
if (!device_can_wakeup(kdev)) {
46+
wol->supported = 0;
47+
wol->wolopts = 0;
48+
return;
49+
}
4350

4451
wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER;
4552
wol->wolopts = priv->wolopts;

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,14 +1573,37 @@ static int macb_poll(struct napi_struct *napi, int budget)
15731573
if (work_done < budget) {
15741574
napi_complete_done(napi, work_done);
15751575

1576-
/* Packets received while interrupts were disabled */
1576+
/* RSR bits only seem to propagate to raise interrupts when
1577+
* interrupts are enabled at the time, so if bits are already
1578+
* set due to packets received while interrupts were disabled,
1579+
* they will not cause another interrupt to be generated when
1580+
* interrupts are re-enabled.
1581+
* Check for this case here. This has been seen to happen
1582+
* around 30% of the time under heavy network load.
1583+
*/
15771584
status = macb_readl(bp, RSR);
15781585
if (status) {
15791586
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
15801587
queue_writel(queue, ISR, MACB_BIT(RCOMP));
15811588
napi_reschedule(napi);
15821589
} else {
15831590
queue_writel(queue, IER, bp->rx_intr_mask);
1591+
1592+
/* In rare cases, packets could have been received in
1593+
* the window between the check above and re-enabling
1594+
* interrupts. Therefore, a double-check is required
1595+
* to avoid losing a wakeup. This can potentially race
1596+
* with the interrupt handler doing the same actions
1597+
* if an interrupt is raised just after enabling them,
1598+
* but this should be harmless.
1599+
*/
1600+
status = macb_readl(bp, RSR);
1601+
if (unlikely(status)) {
1602+
queue_writel(queue, IDR, bp->rx_intr_mask);
1603+
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
1604+
queue_writel(queue, ISR, MACB_BIT(RCOMP));
1605+
napi_schedule(napi);
1606+
}
15841607
}
15851608
}
15861609

drivers/net/ethernet/freescale/gianfar_ethtool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,7 @@ static int gfar_get_ts_info(struct net_device *dev,
14641464
ptp_node = of_find_compatible_node(NULL, NULL, "fsl,etsec-ptp");
14651465
if (ptp_node) {
14661466
ptp_dev = of_find_device_by_node(ptp_node);
1467+
of_node_put(ptp_node);
14671468
if (ptp_dev)
14681469
ptp = platform_get_drvdata(ptp_dev);
14691470
}

drivers/net/ethernet/intel/i40e/i40e_debugfs.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,8 @@ static void i40e_dbg_dump_vf(struct i40e_pf *pf, int vf_id)
742742
vsi = pf->vsi[vf->lan_vsi_idx];
743743
dev_info(&pf->pdev->dev, "vf %2d: VSI id=%d, seid=%d, qps=%d\n",
744744
vf_id, vf->lan_vsi_id, vsi->seid, vf->num_queue_pairs);
745-
dev_info(&pf->pdev->dev, " num MDD=%lld, invalid msg=%lld, valid msg=%lld\n",
746-
vf->num_mdd_events,
747-
vf->num_invalid_msgs,
748-
vf->num_valid_msgs);
745+
dev_info(&pf->pdev->dev, " num MDD=%lld\n",
746+
vf->num_mdd_events);
749747
} else {
750748
dev_info(&pf->pdev->dev, "invalid VF id %d\n", vf_id);
751749
}

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,19 +1917,17 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
19171917
/***********************virtual channel routines******************/
19181918

19191919
/**
1920-
* i40e_vc_send_msg_to_vf_ex
1920+
* i40e_vc_send_msg_to_vf
19211921
* @vf: pointer to the VF info
19221922
* @v_opcode: virtual channel opcode
19231923
* @v_retval: virtual channel return value
19241924
* @msg: pointer to the msg buffer
19251925
* @msglen: msg length
1926-
* @is_quiet: true for not printing unsuccessful return values, false otherwise
19271926
*
19281927
* send msg to VF
19291928
**/
1930-
static int i40e_vc_send_msg_to_vf_ex(struct i40e_vf *vf, u32 v_opcode,
1931-
u32 v_retval, u8 *msg, u16 msglen,
1932-
bool is_quiet)
1929+
static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
1930+
u32 v_retval, u8 *msg, u16 msglen)
19331931
{
19341932
struct i40e_pf *pf;
19351933
struct i40e_hw *hw;
@@ -1944,25 +1942,6 @@ static int i40e_vc_send_msg_to_vf_ex(struct i40e_vf *vf, u32 v_opcode,
19441942
hw = &pf->hw;
19451943
abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id;
19461944

1947-
/* single place to detect unsuccessful return values */
1948-
if (v_retval && !is_quiet) {
1949-
vf->num_invalid_msgs++;
1950-
dev_info(&pf->pdev->dev, "VF %d failed opcode %d, retval: %d\n",
1951-
vf->vf_id, v_opcode, v_retval);
1952-
if (vf->num_invalid_msgs >
1953-
I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED) {
1954-
dev_err(&pf->pdev->dev,
1955-
"Number of invalid messages exceeded for VF %d\n",
1956-
vf->vf_id);
1957-
dev_err(&pf->pdev->dev, "Use PF Control I/F to enable the VF\n");
1958-
set_bit(I40E_VF_STATE_DISABLED, &vf->vf_states);
1959-
}
1960-
} else {
1961-
vf->num_valid_msgs++;
1962-
/* reset the invalid counter, if a valid message is received. */
1963-
vf->num_invalid_msgs = 0;
1964-
}
1965-
19661945
aq_ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, v_opcode, v_retval,
19671946
msg, msglen, NULL);
19681947
if (aq_ret) {
@@ -1975,23 +1954,6 @@ static int i40e_vc_send_msg_to_vf_ex(struct i40e_vf *vf, u32 v_opcode,
19751954
return 0;
19761955
}
19771956

1978-
/**
1979-
* i40e_vc_send_msg_to_vf
1980-
* @vf: pointer to the VF info
1981-
* @v_opcode: virtual channel opcode
1982-
* @v_retval: virtual channel return value
1983-
* @msg: pointer to the msg buffer
1984-
* @msglen: msg length
1985-
*
1986-
* send msg to VF
1987-
**/
1988-
static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
1989-
u32 v_retval, u8 *msg, u16 msglen)
1990-
{
1991-
return i40e_vc_send_msg_to_vf_ex(vf, v_opcode, v_retval,
1992-
msg, msglen, false);
1993-
}
1994-
19951957
/**
19961958
* i40e_vc_send_resp_to_vf
19971959
* @vf: pointer to the VF info
@@ -2822,7 +2784,6 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg)
28222784
* i40e_check_vf_permission
28232785
* @vf: pointer to the VF info
28242786
* @al: MAC address list from virtchnl
2825-
* @is_quiet: set true for printing msg without opcode info, false otherwise
28262787
*
28272788
* Check that the given list of MAC addresses is allowed. Will return -EPERM
28282789
* if any address in the list is not valid. Checks the following conditions:
@@ -2837,16 +2798,14 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg)
28372798
* addresses might not be accurate.
28382799
**/
28392800
static inline int i40e_check_vf_permission(struct i40e_vf *vf,
2840-
struct virtchnl_ether_addr_list *al,
2841-
bool *is_quiet)
2801+
struct virtchnl_ether_addr_list *al)
28422802
{
28432803
struct i40e_pf *pf = vf->pf;
28442804
struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx];
28452805
struct i40e_hw *hw = &pf->hw;
28462806
int mac2add_cnt = 0;
28472807
int i;
28482808

2849-
*is_quiet = false;
28502809
for (i = 0; i < al->num_elements; i++) {
28512810
struct i40e_mac_filter *f;
28522811
u8 *addr = al->list[i].addr;
@@ -2870,7 +2829,6 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf,
28702829
!ether_addr_equal(addr, vf->default_lan_addr.addr)) {
28712830
dev_err(&pf->pdev->dev,
28722831
"VF attempting to override administratively set MAC address, bring down and up the VF interface to resume normal operation\n");
2873-
*is_quiet = true;
28742832
return -EPERM;
28752833
}
28762834

@@ -2921,7 +2879,6 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
29212879
(struct virtchnl_ether_addr_list *)msg;
29222880
struct i40e_pf *pf = vf->pf;
29232881
struct i40e_vsi *vsi = NULL;
2924-
bool is_quiet = false;
29252882
i40e_status ret = 0;
29262883
int i;
29272884

@@ -2938,7 +2895,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
29382895
*/
29392896
spin_lock_bh(&vsi->mac_filter_hash_lock);
29402897

2941-
ret = i40e_check_vf_permission(vf, al, &is_quiet);
2898+
ret = i40e_check_vf_permission(vf, al);
29422899
if (ret) {
29432900
spin_unlock_bh(&vsi->mac_filter_hash_lock);
29442901
goto error_param;
@@ -2976,8 +2933,8 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
29762933

29772934
error_param:
29782935
/* send the response to the VF */
2979-
return i40e_vc_send_msg_to_vf_ex(vf, VIRTCHNL_OP_ADD_ETH_ADDR,
2980-
ret, NULL, 0, is_quiet);
2936+
return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_ETH_ADDR,
2937+
ret, NULL, 0);
29812938
}
29822939

29832940
/**

0 commit comments

Comments
 (0)