Skip to content

Commit e970206

Browse files
committed
tgupdate: merge t/upstream base into t/upstream
2 parents 3cadae8 + e25bfe2 commit e970206

File tree

8 files changed

+65
-44
lines changed

8 files changed

+65
-44
lines changed

Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ properties:
3838

3939
managed: true
4040

41+
phys:
42+
description: A reference to the SerDes lane(s)
43+
maxItems: 1
44+
4145
required:
4246
- reg
4347

drivers/atm/idt77252.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,8 +1118,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
11181118
rpp->len += skb->len;
11191119

11201120
if (stat & SAR_RSQE_EPDU) {
1121+
unsigned int len, truesize;
11211122
unsigned char *l1l2;
1122-
unsigned int len;
11231123

11241124
l1l2 = (unsigned char *) ((unsigned long) skb->data + skb->len - 6);
11251125

@@ -1189,14 +1189,15 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
11891189
ATM_SKB(skb)->vcc = vcc;
11901190
__net_timestamp(skb);
11911191

1192+
truesize = skb->truesize;
11921193
vcc->push(vcc, skb);
11931194
atomic_inc(&vcc->stats->rx);
11941195

1195-
if (skb->truesize > SAR_FB_SIZE_3)
1196+
if (truesize > SAR_FB_SIZE_3)
11961197
add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
1197-
else if (skb->truesize > SAR_FB_SIZE_2)
1198+
else if (truesize > SAR_FB_SIZE_2)
11981199
add_rx_skb(card, 2, SAR_FB_SIZE_2, 1);
1199-
else if (skb->truesize > SAR_FB_SIZE_1)
1200+
else if (truesize > SAR_FB_SIZE_1)
12001201
add_rx_skb(card, 1, SAR_FB_SIZE_1, 1);
12011202
else
12021203
add_rx_skb(card, 0, SAR_FB_SIZE_0, 1);

drivers/net/dsa/vitesse-vsc73xx-core.c

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@
248248
#define VSC73XX_MII_MPRES_PRESCALEVAL GENMASK(5, 0)
249249
#define VSC73XX_MII_PRESCALEVAL_MIN 3 /* min allowed mdio clock prescaler */
250250

251+
#define VSC73XX_MII_STAT_BUSY BIT(3)
252+
251253
/* Arbiter block 5 registers */
252254
#define VSC73XX_ARBEMPTY 0x0c
253255
#define VSC73XX_ARBDISC 0x0e
@@ -322,6 +324,7 @@
322324
#define IS_739X(a) (IS_7395(a) || IS_7398(a))
323325

324326
#define VSC73XX_POLL_SLEEP_US 1000
327+
#define VSC73XX_MDIO_POLL_SLEEP_US 5
325328
#define VSC73XX_POLL_TIMEOUT_US 10000
326329

327330
struct vsc73xx_counter {
@@ -550,13 +553,33 @@ static int vsc73xx_detect(struct vsc73xx *vsc)
550553
return 0;
551554
}
552555

556+
static int vsc73xx_mdio_busy_check(struct vsc73xx *vsc)
557+
{
558+
int ret, err;
559+
u32 val;
560+
561+
ret = read_poll_timeout(vsc73xx_read, err,
562+
err < 0 || !(val & VSC73XX_MII_STAT_BUSY),
563+
VSC73XX_MDIO_POLL_SLEEP_US,
564+
VSC73XX_POLL_TIMEOUT_US, false, vsc,
565+
VSC73XX_BLOCK_MII, VSC73XX_BLOCK_MII_INTERNAL,
566+
VSC73XX_MII_STAT, &val);
567+
if (ret)
568+
return ret;
569+
return err;
570+
}
571+
553572
static int vsc73xx_phy_read(struct dsa_switch *ds, int phy, int regnum)
554573
{
555574
struct vsc73xx *vsc = ds->priv;
556575
u32 cmd;
557576
u32 val;
558577
int ret;
559578

579+
ret = vsc73xx_mdio_busy_check(vsc);
580+
if (ret)
581+
return ret;
582+
560583
/* Setting bit 26 means "read" */
561584
cmd = VSC73XX_MII_CMD_OPERATION |
562585
FIELD_PREP(VSC73XX_MII_CMD_PHY_ADDR, phy) |
@@ -565,7 +588,11 @@ static int vsc73xx_phy_read(struct dsa_switch *ds, int phy, int regnum)
565588
VSC73XX_MII_CMD, cmd);
566589
if (ret)
567590
return ret;
568-
msleep(2);
591+
592+
ret = vsc73xx_mdio_busy_check(vsc);
593+
if (ret)
594+
return ret;
595+
569596
ret = vsc73xx_read(vsc, VSC73XX_BLOCK_MII, VSC73XX_BLOCK_MII_INTERNAL,
570597
VSC73XX_MII_DATA, &val);
571598
if (ret)
@@ -590,19 +617,12 @@ static int vsc73xx_phy_write(struct dsa_switch *ds, int phy, int regnum,
590617
u32 cmd;
591618
int ret;
592619

593-
/* It was found through tedious experiments that this router
594-
* chip really hates to have it's PHYs reset. They
595-
* never recover if that happens: autonegotiation stops
596-
* working after a reset. Just filter out this command.
597-
* (Resetting the whole chip is OK.)
598-
*/
599-
if (regnum == 0 && (val & BIT(15))) {
600-
dev_info(vsc->dev, "reset PHY - disallowed\n");
601-
return 0;
602-
}
620+
ret = vsc73xx_mdio_busy_check(vsc);
621+
if (ret)
622+
return ret;
603623

604624
cmd = FIELD_PREP(VSC73XX_MII_CMD_PHY_ADDR, phy) |
605-
FIELD_PREP(VSC73XX_MII_CMD_PHY_REG, regnum);
625+
FIELD_PREP(VSC73XX_MII_CMD_PHY_REG, regnum) | val;
606626
ret = vsc73xx_write(vsc, VSC73XX_BLOCK_MII, VSC73XX_BLOCK_MII_INTERNAL,
607627
VSC73XX_MII_CMD, cmd);
608628
if (ret)
@@ -1057,6 +1077,11 @@ static void vsc73xx_mac_link_up(struct phylink_config *config,
10571077

10581078
if (duplex == DUPLEX_FULL)
10591079
val |= VSC73XX_MAC_CFG_FDX;
1080+
else
1081+
/* In datasheet description ("Port Mode Procedure" in 5.6.2)
1082+
* this bit is configured only for half duplex.
1083+
*/
1084+
val |= VSC73XX_MAC_CFG_WEXC_DIS;
10601085

10611086
/* This routine is described in the datasheet (below ARBDISC register
10621087
* description)
@@ -1067,7 +1092,6 @@ static void vsc73xx_mac_link_up(struct phylink_config *config,
10671092
get_random_bytes(&seed, 1);
10681093
val |= seed << VSC73XX_MAC_CFG_SEED_OFFSET;
10691094
val |= VSC73XX_MAC_CFG_SEED_LOAD;
1070-
val |= VSC73XX_MAC_CFG_WEXC_DIS;
10711095

10721096
/* Those bits are responsible for MTU only. Kernel takes care about MTU,
10731097
* let's enable +8 bytes frame length unconditionally.

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5250,8 +5250,8 @@ static int __maybe_unused macb_suspend(struct device *dev)
52505250
if (bp->wol & MACB_WOL_ENABLED) {
52515251
/* Check for IP address in WOL ARP mode */
52525252
idev = __in_dev_get_rcu(bp->dev);
5253-
if (idev && idev->ifa_list)
5254-
ifa = rcu_access_pointer(idev->ifa_list);
5253+
if (idev)
5254+
ifa = rcu_dereference(idev->ifa_list);
52555255
if ((bp->wolopts & WAKE_ARP) && !ifa) {
52565256
netdev_err(netdev, "IP address not assigned as required by WoL walk ARP\n");
52575257
return -EOPNOTSUPP;

drivers/net/ethernet/mediatek/mtk_wed.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,14 +2666,15 @@ mtk_wed_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_pri
26662666
{
26672667
struct mtk_wed_flow_block_priv *priv = cb_priv;
26682668
struct flow_cls_offload *cls = type_data;
2669-
struct mtk_wed_hw *hw = priv->hw;
2669+
struct mtk_wed_hw *hw = NULL;
26702670

2671-
if (!tc_can_offload(priv->dev))
2671+
if (!priv || !tc_can_offload(priv->dev))
26722672
return -EOPNOTSUPP;
26732673

26742674
if (type != TC_SETUP_CLSFLOWER)
26752675
return -EOPNOTSUPP;
26762676

2677+
hw = priv->hw;
26772678
return mtk_flow_offload_cmd(hw->eth, cls, hw->index);
26782679
}
26792680

@@ -2729,6 +2730,7 @@ mtk_wed_setup_tc_block(struct mtk_wed_hw *hw, struct net_device *dev,
27292730
flow_block_cb_remove(block_cb, f);
27302731
list_del(&block_cb->driver_list);
27312732
kfree(block_cb->cb_priv);
2733+
block_cb->cb_priv = NULL;
27322734
}
27332735
return 0;
27342736
default:

drivers/net/ethernet/microsoft/mana/mana_en.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,11 @@ static void mana_get_rxbuf_cfg(int mtu, u32 *datasize, u32 *alloc_size,
599599
else
600600
*headroom = XDP_PACKET_HEADROOM;
601601

602-
*alloc_size = mtu + MANA_RXBUF_PAD + *headroom;
602+
*alloc_size = SKB_DATA_ALIGN(mtu + MANA_RXBUF_PAD + *headroom);
603+
604+
/* Using page pool in this case, so alloc_size is PAGE_SIZE */
605+
if (*alloc_size < PAGE_SIZE)
606+
*alloc_size = PAGE_SIZE;
603607

604608
*datasize = mtu + ETH_HLEN;
605609
}

drivers/net/ethernet/xilinx/xilinx_axienet.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,16 @@
160160
#define XAE_RCW1_OFFSET 0x00000404 /* Rx Configuration Word 1 */
161161
#define XAE_TC_OFFSET 0x00000408 /* Tx Configuration */
162162
#define XAE_FCC_OFFSET 0x0000040C /* Flow Control Configuration */
163-
#define XAE_EMMC_OFFSET 0x00000410 /* EMAC mode configuration */
164-
#define XAE_PHYC_OFFSET 0x00000414 /* RGMII/SGMII configuration */
163+
#define XAE_EMMC_OFFSET 0x00000410 /* MAC speed configuration */
164+
#define XAE_PHYC_OFFSET 0x00000414 /* RX Max Frame Configuration */
165165
#define XAE_ID_OFFSET 0x000004F8 /* Identification register */
166-
#define XAE_MDIO_MC_OFFSET 0x00000500 /* MII Management Config */
167-
#define XAE_MDIO_MCR_OFFSET 0x00000504 /* MII Management Control */
168-
#define XAE_MDIO_MWD_OFFSET 0x00000508 /* MII Management Write Data */
169-
#define XAE_MDIO_MRD_OFFSET 0x0000050C /* MII Management Read Data */
166+
#define XAE_MDIO_MC_OFFSET 0x00000500 /* MDIO Setup */
167+
#define XAE_MDIO_MCR_OFFSET 0x00000504 /* MDIO Control */
168+
#define XAE_MDIO_MWD_OFFSET 0x00000508 /* MDIO Write Data */
169+
#define XAE_MDIO_MRD_OFFSET 0x0000050C /* MDIO Read Data */
170170
#define XAE_UAW0_OFFSET 0x00000700 /* Unicast address word 0 */
171171
#define XAE_UAW1_OFFSET 0x00000704 /* Unicast address word 1 */
172-
#define XAE_FMI_OFFSET 0x00000708 /* Filter Mask Index */
172+
#define XAE_FMI_OFFSET 0x00000708 /* Frame Filter Control */
173173
#define XAE_AF0_OFFSET 0x00000710 /* Address Filter 0 */
174174
#define XAE_AF1_OFFSET 0x00000714 /* Address Filter 1 */
175175

@@ -308,7 +308,7 @@
308308
*/
309309
#define XAE_UAW1_UNICASTADDR_MASK 0x0000FFFF
310310

311-
/* Bit masks for Axi Ethernet FMI register */
311+
/* Bit masks for Axi Ethernet FMC register */
312312
#define XAE_FMI_PM_MASK 0x80000000 /* Promis. mode enable */
313313
#define XAE_FMI_IND_MASK 0x00000003 /* Index Mask */
314314

drivers/net/phy/vitesse.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,6 @@ static int vsc739x_config_init(struct phy_device *phydev)
319319
return 0;
320320
}
321321

322-
static int vsc73xx_config_aneg(struct phy_device *phydev)
323-
{
324-
/* The VSC73xx switches does not like to be instructed to
325-
* do autonegotiation in any way, it prefers that you just go
326-
* with the power-on/reset defaults. Writing some registers will
327-
* just make autonegotiation permanently fail.
328-
*/
329-
return 0;
330-
}
331-
332322
/* This adds a skew for both TX and RX clocks, so the skew should only be
333323
* applied to "rgmii-id" interfaces. It may not work as expected
334324
* on "rgmii-txid", "rgmii-rxid" or "rgmii" interfaces.
@@ -526,7 +516,6 @@ static struct phy_driver vsc82xx_driver[] = {
526516
.phy_id_mask = 0x000ffff0,
527517
/* PHY_GBIT_FEATURES */
528518
.config_init = vsc738x_config_init,
529-
.config_aneg = vsc73xx_config_aneg,
530519
.read_page = vsc73xx_read_page,
531520
.write_page = vsc73xx_write_page,
532521
.get_tunable = vsc73xx_get_tunable,
@@ -537,7 +526,6 @@ static struct phy_driver vsc82xx_driver[] = {
537526
.phy_id_mask = 0x000ffff0,
538527
/* PHY_GBIT_FEATURES */
539528
.config_init = vsc738x_config_init,
540-
.config_aneg = vsc73xx_config_aneg,
541529
.read_page = vsc73xx_read_page,
542530
.write_page = vsc73xx_write_page,
543531
.get_tunable = vsc73xx_get_tunable,
@@ -548,7 +536,6 @@ static struct phy_driver vsc82xx_driver[] = {
548536
.phy_id_mask = 0x000ffff0,
549537
/* PHY_GBIT_FEATURES */
550538
.config_init = vsc739x_config_init,
551-
.config_aneg = vsc73xx_config_aneg,
552539
.read_page = vsc73xx_read_page,
553540
.write_page = vsc73xx_write_page,
554541
.get_tunable = vsc73xx_get_tunable,
@@ -559,7 +546,6 @@ static struct phy_driver vsc82xx_driver[] = {
559546
.phy_id_mask = 0x000ffff0,
560547
/* PHY_GBIT_FEATURES */
561548
.config_init = vsc739x_config_init,
562-
.config_aneg = vsc73xx_config_aneg,
563549
.read_page = vsc73xx_read_page,
564550
.write_page = vsc73xx_write_page,
565551
.get_tunable = vsc73xx_get_tunable,

0 commit comments

Comments
 (0)