Skip to content

Commit 3b3a91a

Browse files
author
NipaLocal
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Signed-off-by: NipaLocal <nipa@local>
2 parents 9dd15d5 + 5b5f724 commit 3b3a91a

File tree

25 files changed

+241
-121
lines changed

25 files changed

+241
-121
lines changed

.mailmap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ Alexei Starovoitov <[email protected]> <[email protected]>
3838
Alexei Starovoitov <[email protected]> <[email protected]>
3939
Alexei Starovoitov <[email protected]> <[email protected]>
4040
41+
Alex Elder <[email protected]>
42+
43+
44+
45+
46+
47+
48+
49+
50+
4151
4252
4353

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7829,9 +7829,8 @@ W: http://aeschi.ch.eu.org/efs/
78297829
F: fs/efs/
78307830

78317831
EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER
7832-
M: Douglas Miller <[email protected]>
78337832
7834-
S: Maintained
7833+
S: Orphan
78357834
F: drivers/net/ethernet/ibm/ehea/
78367835

78377836
ELM327 CAN NETWORK DRIVER

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,61 @@ static void mv88e6xxx_translate_cmode(u8 cmode, unsigned long *supported)
566566
phy_interface_set_rgmii(supported);
567567
}
568568

569-
static void mv88e6250_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
570-
struct phylink_config *config)
569+
static void
570+
mv88e6250_setup_supported_interfaces(struct mv88e6xxx_chip *chip, int port,
571+
struct phylink_config *config)
571572
{
572573
unsigned long *supported = config->supported_interfaces;
574+
int err;
575+
u16 reg;
573576

574-
/* Translate the default cmode */
575-
mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported);
577+
err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, &reg);
578+
if (err) {
579+
dev_err(chip->dev, "p%d: failed to read port status\n", port);
580+
return;
581+
}
582+
583+
switch (reg & MV88E6250_PORT_STS_PORTMODE_MASK) {
584+
case MV88E6250_PORT_STS_PORTMODE_MII_10_HALF_PHY:
585+
case MV88E6250_PORT_STS_PORTMODE_MII_100_HALF_PHY:
586+
case MV88E6250_PORT_STS_PORTMODE_MII_10_FULL_PHY:
587+
case MV88E6250_PORT_STS_PORTMODE_MII_100_FULL_PHY:
588+
__set_bit(PHY_INTERFACE_MODE_REVMII, supported);
589+
break;
590+
591+
case MV88E6250_PORT_STS_PORTMODE_MII_HALF:
592+
case MV88E6250_PORT_STS_PORTMODE_MII_FULL:
593+
__set_bit(PHY_INTERFACE_MODE_MII, supported);
594+
break;
595+
596+
case MV88E6250_PORT_STS_PORTMODE_MII_DUAL_100_RMII_FULL_PHY:
597+
case MV88E6250_PORT_STS_PORTMODE_MII_200_RMII_FULL_PHY:
598+
case MV88E6250_PORT_STS_PORTMODE_MII_10_100_RMII_HALF_PHY:
599+
case MV88E6250_PORT_STS_PORTMODE_MII_10_100_RMII_FULL_PHY:
600+
__set_bit(PHY_INTERFACE_MODE_REVRMII, supported);
601+
break;
602+
603+
case MV88E6250_PORT_STS_PORTMODE_MII_DUAL_100_RMII_FULL:
604+
case MV88E6250_PORT_STS_PORTMODE_MII_10_100_RMII_FULL:
605+
__set_bit(PHY_INTERFACE_MODE_RMII, supported);
606+
break;
607+
608+
case MV88E6250_PORT_STS_PORTMODE_MII_100_RGMII:
609+
__set_bit(PHY_INTERFACE_MODE_RGMII, supported);
610+
break;
611+
612+
default:
613+
dev_err(chip->dev,
614+
"p%d: invalid port mode in status register: %04x\n",
615+
port, reg);
616+
}
617+
}
618+
619+
static void mv88e6250_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
620+
struct phylink_config *config)
621+
{
622+
if (!mv88e6xxx_phy_is_internal(chip, port))
623+
mv88e6250_setup_supported_interfaces(chip, port, config);
576624

577625
config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100;
578626
}

drivers/net/dsa/mv88e6xxx/port.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,25 @@
2525
#define MV88E6250_PORT_STS_PORTMODE_PHY_100_HALF 0x0900
2626
#define MV88E6250_PORT_STS_PORTMODE_PHY_10_FULL 0x0a00
2727
#define MV88E6250_PORT_STS_PORTMODE_PHY_100_FULL 0x0b00
28-
#define MV88E6250_PORT_STS_PORTMODE_MII_10_HALF 0x0c00
29-
#define MV88E6250_PORT_STS_PORTMODE_MII_100_HALF 0x0d00
30-
#define MV88E6250_PORT_STS_PORTMODE_MII_10_FULL 0x0e00
31-
#define MV88E6250_PORT_STS_PORTMODE_MII_100_FULL 0x0f00
28+
/* - Modes with PHY suffix use output instead of input clock
29+
* - Modes without RMII or RGMII use MII
30+
* - Modes without speed do not have a fixed speed specified in the manual
31+
* ("DC to x MHz" - variable clock support?)
32+
*/
33+
#define MV88E6250_PORT_STS_PORTMODE_MII_DISABLED 0x0000
34+
#define MV88E6250_PORT_STS_PORTMODE_MII_100_RGMII 0x0100
35+
#define MV88E6250_PORT_STS_PORTMODE_MII_DUAL_100_RMII_FULL_PHY 0x0200
36+
#define MV88E6250_PORT_STS_PORTMODE_MII_200_RMII_FULL_PHY 0x0400
37+
#define MV88E6250_PORT_STS_PORTMODE_MII_DUAL_100_RMII_FULL 0x0600
38+
#define MV88E6250_PORT_STS_PORTMODE_MII_10_100_RMII_FULL 0x0700
39+
#define MV88E6250_PORT_STS_PORTMODE_MII_HALF 0x0800
40+
#define MV88E6250_PORT_STS_PORTMODE_MII_10_100_RMII_HALF_PHY 0x0900
41+
#define MV88E6250_PORT_STS_PORTMODE_MII_FULL 0x0a00
42+
#define MV88E6250_PORT_STS_PORTMODE_MII_10_100_RMII_FULL_PHY 0x0b00
43+
#define MV88E6250_PORT_STS_PORTMODE_MII_10_HALF_PHY 0x0c00
44+
#define MV88E6250_PORT_STS_PORTMODE_MII_100_HALF_PHY 0x0d00
45+
#define MV88E6250_PORT_STS_PORTMODE_MII_10_FULL_PHY 0x0e00
46+
#define MV88E6250_PORT_STS_PORTMODE_MII_100_FULL_PHY 0x0f00
3247
#define MV88E6XXX_PORT_STS_LINK 0x0800
3348
#define MV88E6XXX_PORT_STS_DUPLEX 0x0400
3449
#define MV88E6XXX_PORT_STS_SPEED_MASK 0x0300

drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,8 @@ static void umac_init(struct bcmasp_intf *intf)
436436
umac_wl(intf, 0x800, UMC_RX_MAX_PKT_SZ);
437437
}
438438

439-
static int bcmasp_tx_poll(struct napi_struct *napi, int budget)
439+
static int bcmasp_tx_reclaim(struct bcmasp_intf *intf)
440440
{
441-
struct bcmasp_intf *intf =
442-
container_of(napi, struct bcmasp_intf, tx_napi);
443441
struct bcmasp_intf_stats64 *stats = &intf->stats64;
444442
struct device *kdev = &intf->parent->pdev->dev;
445443
unsigned long read, released = 0;
@@ -482,10 +480,16 @@ static int bcmasp_tx_poll(struct napi_struct *napi, int budget)
482480
DESC_RING_COUNT);
483481
}
484482

485-
/* Ensure all descriptors have been written to DRAM for the hardware
486-
* to see updated contents.
487-
*/
488-
wmb();
483+
return released;
484+
}
485+
486+
static int bcmasp_tx_poll(struct napi_struct *napi, int budget)
487+
{
488+
struct bcmasp_intf *intf =
489+
container_of(napi, struct bcmasp_intf, tx_napi);
490+
int released = 0;
491+
492+
released = bcmasp_tx_reclaim(intf);
489493

490494
napi_complete(&intf->tx_napi);
491495

@@ -797,6 +801,7 @@ static void bcmasp_init_tx(struct bcmasp_intf *intf)
797801
intf->tx_spb_dma_read = intf->tx_spb_dma_addr;
798802
intf->tx_spb_index = 0;
799803
intf->tx_spb_clean_index = 0;
804+
memset(intf->tx_cbs, 0, sizeof(struct bcmasp_tx_cb) * DESC_RING_COUNT);
800805

801806
/* Make sure channels are disabled */
802807
tx_spb_ctrl_wl(intf, 0x0, TX_SPB_CTRL_ENABLE);
@@ -885,6 +890,8 @@ static void bcmasp_netif_deinit(struct net_device *dev)
885890
} while (timeout-- > 0);
886891
tx_spb_dma_wl(intf, 0x0, TX_SPB_DMA_FIFO_CTRL);
887892

893+
bcmasp_tx_reclaim(intf);
894+
888895
umac_enable_set(intf, UMC_CMD_TX_EN, 0);
889896

890897
phy_stop(dev->phydev);

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9165,7 +9165,7 @@ static void bnxt_try_map_fw_health_reg(struct bnxt *bp)
91659165
BNXT_FW_HEALTH_WIN_BASE +
91669166
BNXT_GRC_REG_CHIP_NUM);
91679167
}
9168-
if (!BNXT_CHIP_P5(bp))
9168+
if (!BNXT_CHIP_P5_PLUS(bp))
91699169
return;
91709170

91719171
status_loc = BNXT_GRC_REG_STATUS_P5 |
@@ -13267,6 +13267,16 @@ static void bnxt_rx_ring_reset(struct bnxt *bp)
1326713267
bnxt_rtnl_unlock_sp(bp);
1326813268
}
1326913269

13270+
static void bnxt_fw_fatal_close(struct bnxt *bp)
13271+
{
13272+
bnxt_tx_disable(bp);
13273+
bnxt_disable_napi(bp);
13274+
bnxt_disable_int_sync(bp);
13275+
bnxt_free_irq(bp);
13276+
bnxt_clear_int_mode(bp);
13277+
pci_disable_device(bp->pdev);
13278+
}
13279+
1327013280
static void bnxt_fw_reset_close(struct bnxt *bp)
1327113281
{
1327213282
bnxt_ulp_stop(bp);
@@ -13280,12 +13290,7 @@ static void bnxt_fw_reset_close(struct bnxt *bp)
1328013290
pci_read_config_word(bp->pdev, PCI_SUBSYSTEM_ID, &val);
1328113291
if (val == 0xffff)
1328213292
bp->fw_reset_min_dsecs = 0;
13283-
bnxt_tx_disable(bp);
13284-
bnxt_disable_napi(bp);
13285-
bnxt_disable_int_sync(bp);
13286-
bnxt_free_irq(bp);
13287-
bnxt_clear_int_mode(bp);
13288-
pci_disable_device(bp->pdev);
13293+
bnxt_fw_fatal_close(bp);
1328913294
}
1329013295
__bnxt_close_nic(bp, true, false);
1329113296
bnxt_vf_reps_free(bp);
@@ -15623,6 +15628,7 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev,
1562315628
{
1562415629
struct net_device *netdev = pci_get_drvdata(pdev);
1562515630
struct bnxt *bp = netdev_priv(netdev);
15631+
bool abort = false;
1562615632

1562715633
netdev_info(netdev, "PCI I/O error detected\n");
1562815634

@@ -15631,16 +15637,27 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev,
1563115637

1563215638
bnxt_ulp_stop(bp);
1563315639

15634-
if (state == pci_channel_io_perm_failure) {
15640+
if (test_and_set_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) {
15641+
netdev_err(bp->dev, "Firmware reset already in progress\n");
15642+
abort = true;
15643+
}
15644+
15645+
if (abort || state == pci_channel_io_perm_failure) {
1563515646
rtnl_unlock();
1563615647
return PCI_ERS_RESULT_DISCONNECT;
1563715648
}
1563815649

15639-
if (state == pci_channel_io_frozen)
15650+
/* Link is not reliable anymore if state is pci_channel_io_frozen
15651+
* so we disable bus master to prevent any potential bad DMAs before
15652+
* freeing kernel memory.
15653+
*/
15654+
if (state == pci_channel_io_frozen) {
1564015655
set_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state);
15656+
bnxt_fw_fatal_close(bp);
15657+
}
1564115658

1564215659
if (netif_running(netdev))
15643-
bnxt_close(netdev);
15660+
__bnxt_close_nic(bp, true, true);
1564415661

1564515662
if (pci_is_enabled(pdev))
1564615663
pci_disable_device(pdev);
@@ -15728,6 +15745,7 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
1572815745
}
1572915746

1573015747
reset_exit:
15748+
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
1573115749
bnxt_clear_reservations(bp, true);
1573215750
rtnl_unlock();
1573315751

drivers/net/ethernet/mellanox/mlxsw/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ static void mlxsw_emad_rx_listener_func(struct sk_buff *skb, u16 local_port,
849849

850850
static const struct mlxsw_listener mlxsw_emad_rx_listener =
851851
MLXSW_RXL(mlxsw_emad_rx_listener_func, ETHEMAD, TRAP_TO_CPU, false,
852-
EMAD, DISCARD);
852+
EMAD, FORWARD);
853853

854854
static int mlxsw_emad_tlv_enable(struct mlxsw_core *mlxsw_core)
855855
{

drivers/net/ethernet/mellanox/mlxsw/core_env.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,24 +1357,20 @@ static struct mlxsw_linecards_event_ops mlxsw_env_event_ops = {
13571357
.got_inactive = mlxsw_env_got_inactive,
13581358
};
13591359

1360-
static int mlxsw_env_max_module_eeprom_len_query(struct mlxsw_env *mlxsw_env)
1360+
static void mlxsw_env_max_module_eeprom_len_query(struct mlxsw_env *mlxsw_env)
13611361
{
13621362
char mcam_pl[MLXSW_REG_MCAM_LEN];
1363-
bool mcia_128b_supported;
1363+
bool mcia_128b_supported = false;
13641364
int err;
13651365

13661366
mlxsw_reg_mcam_pack(mcam_pl,
13671367
MLXSW_REG_MCAM_FEATURE_GROUP_ENHANCED_FEATURES);
13681368
err = mlxsw_reg_query(mlxsw_env->core, MLXSW_REG(mcam), mcam_pl);
1369-
if (err)
1370-
return err;
1371-
1372-
mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_MCIA_128B,
1373-
&mcia_128b_supported);
1369+
if (!err)
1370+
mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_MCIA_128B,
1371+
&mcia_128b_supported);
13741372

13751373
mlxsw_env->max_eeprom_len = mcia_128b_supported ? 128 : 48;
1376-
1377-
return 0;
13781374
}
13791375

13801376
int mlxsw_env_init(struct mlxsw_core *mlxsw_core,
@@ -1445,15 +1441,11 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core,
14451441
if (err)
14461442
goto err_type_set;
14471443

1448-
err = mlxsw_env_max_module_eeprom_len_query(env);
1449-
if (err)
1450-
goto err_eeprom_len_query;
1451-
1444+
mlxsw_env_max_module_eeprom_len_query(env);
14521445
env->line_cards[0]->active = true;
14531446

14541447
return 0;
14551448

1456-
err_eeprom_len_query:
14571449
err_type_set:
14581450
mlxsw_env_module_event_disable(env, 0);
14591451
err_mlxsw_env_module_event_enable:

drivers/net/ethernet/mellanox/mlxsw/pci.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id)
15451545
{
15461546
struct pci_dev *pdev = mlxsw_pci->pdev;
15471547
char mcam_pl[MLXSW_REG_MCAM_LEN];
1548-
bool pci_reset_supported;
1548+
bool pci_reset_supported = false;
15491549
u32 sys_status;
15501550
int err;
15511551

@@ -1563,11 +1563,9 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id)
15631563
mlxsw_reg_mcam_pack(mcam_pl,
15641564
MLXSW_REG_MCAM_FEATURE_GROUP_ENHANCED_FEATURES);
15651565
err = mlxsw_reg_query(mlxsw_pci->core, MLXSW_REG(mcam), mcam_pl);
1566-
if (err)
1567-
return err;
1568-
1569-
mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_PCI_RESET,
1570-
&pci_reset_supported);
1566+
if (!err)
1567+
mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_PCI_RESET,
1568+
&pci_reset_supported);
15711569

15721570
if (pci_reset_supported) {
15731571
pci_dbg(pdev, "Starting PCI reset flow\n");

drivers/net/ethernet/wangxun/libwx/wx_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ static void wx_set_num_queues(struct wx *wx)
15981598
*/
15991599
static int wx_acquire_msix_vectors(struct wx *wx)
16001600
{
1601-
struct irq_affinity affd = {0, };
1601+
struct irq_affinity affd = { .pre_vectors = 1 };
16021602
int nvecs, i;
16031603

16041604
/* We start by asking for one vector per queue pair */

drivers/net/gtp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,11 +1098,12 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev,
10981098
static void gtp_dellink(struct net_device *dev, struct list_head *head)
10991099
{
11001100
struct gtp_dev *gtp = netdev_priv(dev);
1101+
struct hlist_node *next;
11011102
struct pdp_ctx *pctx;
11021103
int i;
11031104

11041105
for (i = 0; i < gtp->hash_size; i++)
1105-
hlist_for_each_entry_rcu(pctx, &gtp->tid_hash[i], hlist_tid)
1106+
hlist_for_each_entry_safe(pctx, next, &gtp->tid_hash[i], hlist_tid)
11061107
pdp_context_delete(pctx);
11071108

11081109
list_del_rcu(&gtp->list);

0 commit comments

Comments
 (0)