Skip to content

Commit 319134f

Browse files
committed
tgupdate: merge t/DO-NOT-MERGE-mptcp-enabled-by-default base into t/DO-NOT-MERGE-mptcp-enabled-by-default
2 parents 691dba0 + 5b56a4f commit 319134f

File tree

18 files changed

+149
-129
lines changed

18 files changed

+149
-129
lines changed

drivers/net/ethernet/mellanox/mlx5/core/health.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ static int mlx5_health_get_rfr(u8 rfr_severity)
9696
return rfr_severity >> MLX5_RFR_BIT_OFFSET;
9797
}
9898

99+
static int mlx5_health_get_crr(u8 rfr_severity)
100+
{
101+
return (rfr_severity >> MLX5_CRR_BIT_OFFSET) & 0x01;
102+
}
103+
99104
static bool sensor_fw_synd_rfr(struct mlx5_core_dev *dev)
100105
{
101106
struct mlx5_core_health *health = &dev->priv.health;
@@ -375,6 +380,8 @@ static const char *hsynd_str(u8 synd)
375380
return "High temperature";
376381
case MLX5_INITIAL_SEG_HEALTH_SYNDROME_ICM_PCI_POISONED_ERR:
377382
return "ICM fetch PCI data poisoned error";
383+
case MLX5_INITIAL_SEG_HEALTH_SYNDROME_TRUST_LOCKDOWN_ERR:
384+
return "Trust lockdown error";
378385
default:
379386
return "unrecognized error";
380387
}
@@ -442,12 +449,15 @@ static void print_health_info(struct mlx5_core_dev *dev)
442449
mlx5_log(dev, severity, "time %u\n", ioread32be(&h->time));
443450
mlx5_log(dev, severity, "hw_id 0x%08x\n", ioread32be(&h->hw_id));
444451
mlx5_log(dev, severity, "rfr %d\n", mlx5_health_get_rfr(rfr_severity));
452+
mlx5_log(dev, severity, "crr %d\n", mlx5_health_get_crr(rfr_severity));
445453
mlx5_log(dev, severity, "severity %d (%s)\n", severity, mlx5_loglevel_str(severity));
446454
mlx5_log(dev, severity, "irisc_index %d\n", ioread8(&h->irisc_index));
447455
mlx5_log(dev, severity, "synd 0x%x: %s\n", ioread8(&h->synd),
448456
hsynd_str(ioread8(&h->synd)));
449457
mlx5_log(dev, severity, "ext_synd 0x%04x\n", ioread16be(&h->ext_synd));
450458
mlx5_log(dev, severity, "raw fw_ver 0x%08x\n", ioread32be(&h->fw_ver));
459+
if (mlx5_health_get_crr(rfr_severity))
460+
mlx5_core_warn(dev, "Cold reset is required\n");
451461
}
452462

453463
static int
@@ -799,14 +809,17 @@ static void poll_health(struct timer_list *t)
799809
health->prev = count;
800810
if (health->miss_counter == MAX_MISSES) {
801811
mlx5_core_err(dev, "device's health compromised - reached miss count\n");
812+
health->synd = ioread8(&h->synd);
802813
print_health_info(dev);
803814
queue_work(health->wq, &health->report_work);
804815
}
805816

806817
prev_synd = health->synd;
807818
health->synd = ioread8(&h->synd);
808-
if (health->synd && health->synd != prev_synd)
819+
if (health->synd && health->synd != prev_synd) {
820+
print_health_info(dev);
809821
queue_work(health->wq, &health->report_work);
822+
}
810823

811824
out:
812825
mod_timer(&health->timer, get_next_poll_jiffies(dev));

drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ struct tegra_eqos {
3030

3131
struct reset_control *rst;
3232
struct clk *clk_slave;
33-
struct clk *clk_tx;
3433

3534
struct gpio_desc *reset;
3635
};
@@ -150,7 +149,6 @@ static void tegra_eqos_fix_speed(void *priv, int speed, unsigned int mode)
150149
{
151150
struct tegra_eqos *eqos = priv;
152151
bool needs_calibration = false;
153-
long rate = 125000000;
154152
u32 value;
155153
int err;
156154

@@ -161,7 +159,6 @@ static void tegra_eqos_fix_speed(void *priv, int speed, unsigned int mode)
161159
fallthrough;
162160

163161
case SPEED_10:
164-
rate = rgmii_clock(speed);
165162
break;
166163

167164
default:
@@ -208,10 +205,6 @@ static void tegra_eqos_fix_speed(void *priv, int speed, unsigned int mode)
208205
value &= ~AUTO_CAL_CONFIG_ENABLE;
209206
writel(value, eqos->regs + AUTO_CAL_CONFIG);
210207
}
211-
212-
err = clk_set_rate(eqos->clk_tx, rate);
213-
if (err < 0)
214-
dev_err(eqos->dev, "failed to set TX rate: %d\n", err);
215208
}
216209

217210
static int tegra_eqos_init(struct platform_device *pdev, void *priv)
@@ -247,7 +240,7 @@ static int tegra_eqos_probe(struct platform_device *pdev,
247240
if (!is_of_node(dev->fwnode))
248241
goto bypass_clk_reset_gpio;
249242

250-
eqos->clk_tx = dwc_eth_find_clk(plat_dat, "tx");
243+
plat_dat->clk_tx_i = dwc_eth_find_clk(plat_dat, "tx");
251244

252245
eqos->reset = devm_gpiod_get(&pdev->dev, "phy-reset", GPIOD_OUT_HIGH);
253246
if (IS_ERR(eqos->reset)) {
@@ -281,6 +274,7 @@ static int tegra_eqos_probe(struct platform_device *pdev,
281274

282275
bypass_clk_reset_gpio:
283276
plat_dat->fix_mac_speed = tegra_eqos_fix_speed;
277+
plat_dat->set_clk_tx_rate = stmmac_set_clk_tx_rate;
284278
plat_dat->init = tegra_eqos_init;
285279
plat_dat->bsp_priv = eqos;
286280
plat_dat->flags |= STMMAC_FLAG_SPH_DISABLE;

drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,19 @@ static void imx_dwmac_exit(struct platform_device *pdev, void *priv)
192192
/* nothing to do now */
193193
}
194194

195+
static int imx_dwmac_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
196+
phy_interface_t interface, int speed)
197+
{
198+
struct imx_priv_data *dwmac = bsp_priv;
199+
200+
interface = dwmac->plat_dat->mac_interface;
201+
if (interface == PHY_INTERFACE_MODE_RMII ||
202+
interface == PHY_INTERFACE_MODE_MII)
203+
return 0;
204+
205+
return stmmac_set_clk_tx_rate(bsp_priv, clk_tx_i, interface, speed);
206+
}
207+
195208
static void imx_dwmac_fix_speed(void *priv, int speed, unsigned int mode)
196209
{
197210
struct plat_stmmacenet_data *plat_dat;
@@ -358,7 +371,6 @@ static int imx_dwmac_probe(struct platform_device *pdev)
358371
plat_dat->init = imx_dwmac_init;
359372
plat_dat->exit = imx_dwmac_exit;
360373
plat_dat->clks_config = imx_dwmac_clks_config;
361-
plat_dat->fix_mac_speed = imx_dwmac_fix_speed;
362374
plat_dat->bsp_priv = dwmac;
363375
dwmac->plat_dat = plat_dat;
364376
dwmac->base_addr = stmmac_res.addr;
@@ -371,8 +383,13 @@ static int imx_dwmac_probe(struct platform_device *pdev)
371383
if (ret)
372384
goto err_dwmac_init;
373385

374-
if (dwmac->ops->fix_mac_speed)
386+
if (dwmac->ops->fix_mac_speed) {
375387
plat_dat->fix_mac_speed = dwmac->ops->fix_mac_speed;
388+
} else if (!dwmac->ops->mac_rgmii_txclk_auto_adj) {
389+
plat_dat->clk_tx_i = dwmac->clk_tx;
390+
plat_dat->set_clk_tx_rate = imx_dwmac_set_clk_tx_rate;
391+
}
392+
376393
dwmac->plat_dat->fix_soc_reset = dwmac->ops->fix_soc_reset;
377394

378395
ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);

drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,12 @@ struct intel_dwmac {
2222
};
2323

2424
struct intel_dwmac_data {
25-
void (*fix_mac_speed)(void *priv, int speed, unsigned int mode);
2625
unsigned long ptp_ref_clk_rate;
2726
unsigned long tx_clk_rate;
2827
bool tx_clk_en;
2928
};
3029

31-
static void kmb_eth_fix_mac_speed(void *priv, int speed, unsigned int mode)
32-
{
33-
struct intel_dwmac *dwmac = priv;
34-
long rate;
35-
int ret;
36-
37-
rate = rgmii_clock(speed);
38-
if (rate < 0) {
39-
dev_err(dwmac->dev, "Invalid speed\n");
40-
return;
41-
}
42-
43-
ret = clk_set_rate(dwmac->tx_clk, rate);
44-
if (ret)
45-
dev_err(dwmac->dev, "Failed to configure tx clock rate\n");
46-
}
47-
4830
static const struct intel_dwmac_data kmb_data = {
49-
.fix_mac_speed = kmb_eth_fix_mac_speed,
5031
.ptp_ref_clk_rate = 200000000,
5132
.tx_clk_rate = 125000000,
5233
.tx_clk_en = true,
@@ -89,8 +70,6 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
8970
* platform_match().
9071
*/
9172
dwmac->data = device_get_match_data(&pdev->dev);
92-
if (dwmac->data->fix_mac_speed)
93-
plat_dat->fix_mac_speed = dwmac->data->fix_mac_speed;
9473

9574
/* Enable TX clock */
9675
if (dwmac->data->tx_clk_en) {
@@ -132,6 +111,9 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
132111
}
133112
}
134113

114+
plat_dat->clk_tx_i = dwmac->tx_clk;
115+
plat_dat->set_clk_tx_rate = stmmac_set_clk_tx_rate;
116+
135117
plat_dat->bsp_priv = dwmac;
136118
plat_dat->eee_usecs_rate = plat_dat->clk_ptp_rate;
137119

drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,12 @@ static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac)
260260
return PTR_ERR_OR_ZERO(gmac->qsgmii_csr);
261261
}
262262

263-
static void ipq806x_gmac_fix_mac_speed(void *priv, int speed, unsigned int mode)
263+
static int ipq806x_gmac_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
264+
phy_interface_t interface, int speed)
264265
{
265-
struct ipq806x_gmac *gmac = priv;
266+
struct ipq806x_gmac *gmac = bsp_priv;
266267

267-
ipq806x_gmac_set_speed(gmac, speed);
268+
return ipq806x_gmac_set_speed(gmac, speed);
268269
}
269270

270271
static int
@@ -478,7 +479,7 @@ static int ipq806x_gmac_probe(struct platform_device *pdev)
478479

479480
plat_dat->has_gmac = true;
480481
plat_dat->bsp_priv = gmac;
481-
plat_dat->fix_mac_speed = ipq806x_gmac_fix_mac_speed;
482+
plat_dat->set_clk_tx_rate = ipq806x_gmac_set_clk_tx_rate;
482483
plat_dat->multicast_filter_bins = 0;
483484
plat_dat->tx_fifo_size = 8192;
484485
plat_dat->rx_fifo_size = 8192;

drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ struct meson_dwmac {
2222
void __iomem *reg;
2323
};
2424

25-
static void meson6_dwmac_fix_mac_speed(void *priv, int speed, unsigned int mode)
25+
static int meson6_dwmac_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
26+
phy_interface_t interface, int speed)
2627
{
27-
struct meson_dwmac *dwmac = priv;
28+
struct meson_dwmac *dwmac = bsp_priv;
2829
unsigned int val;
2930

3031
val = readl(dwmac->reg);
@@ -39,6 +40,8 @@ static void meson6_dwmac_fix_mac_speed(void *priv, int speed, unsigned int mode)
3940
}
4041

4142
writel(val, dwmac->reg);
43+
44+
return 0;
4245
}
4346

4447
static int meson6_dwmac_probe(struct platform_device *pdev)
@@ -65,7 +68,7 @@ static int meson6_dwmac_probe(struct platform_device *pdev)
6568
return PTR_ERR(dwmac->reg);
6669

6770
plat_dat->bsp_priv = dwmac;
68-
plat_dat->fix_mac_speed = meson6_dwmac_fix_mac_speed;
71+
plat_dat->set_clk_tx_rate = meson6_dwmac_set_clk_tx_rate;
6972

7073
return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
7174
}

drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,9 +1920,10 @@ static void rk_gmac_powerdown(struct rk_priv_data *gmac)
19201920
gmac_clk_enable(gmac, false);
19211921
}
19221922

1923-
static void rk_fix_speed(void *priv, int speed, unsigned int mode)
1923+
static int rk_set_clk_tx_rate(void *bsp_priv_, struct clk *clk_tx_i,
1924+
phy_interface_t interface, int speed)
19241925
{
1925-
struct rk_priv_data *bsp_priv = priv;
1926+
struct rk_priv_data *bsp_priv = bsp_priv_;
19261927
struct device *dev = &bsp_priv->pdev->dev;
19271928

19281929
switch (bsp_priv->phy_iface) {
@@ -1940,6 +1941,8 @@ static void rk_fix_speed(void *priv, int speed, unsigned int mode)
19401941
default:
19411942
dev_err(dev, "unsupported interface %d", bsp_priv->phy_iface);
19421943
}
1944+
1945+
return 0;
19431946
}
19441947

19451948
static int rk_gmac_probe(struct platform_device *pdev)
@@ -1968,7 +1971,8 @@ static int rk_gmac_probe(struct platform_device *pdev)
19681971
*/
19691972
if (!plat_dat->has_gmac4)
19701973
plat_dat->has_gmac = true;
1971-
plat_dat->fix_mac_speed = rk_fix_speed;
1974+
1975+
plat_dat->set_clk_tx_rate = rk_set_clk_tx_rate;
19721976

19731977
plat_dat->bsp_priv = rk_gmac_setup(pdev, plat_dat, data);
19741978
if (IS_ERR(plat_dat->bsp_priv))

drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,24 +100,6 @@ static void s32_gmac_exit(struct platform_device *pdev, void *priv)
100100
clk_disable_unprepare(gmac->rx_clk);
101101
}
102102

103-
static void s32_fix_mac_speed(void *priv, int speed, unsigned int mode)
104-
{
105-
struct s32_priv_data *gmac = priv;
106-
long tx_clk_rate;
107-
int ret;
108-
109-
tx_clk_rate = rgmii_clock(speed);
110-
if (tx_clk_rate < 0) {
111-
dev_err(gmac->dev, "Unsupported/Invalid speed: %d\n", speed);
112-
return;
113-
}
114-
115-
dev_dbg(gmac->dev, "Set tx clock to %ld Hz\n", tx_clk_rate);
116-
ret = clk_set_rate(gmac->tx_clk, tx_clk_rate);
117-
if (ret)
118-
dev_err(gmac->dev, "Can't set tx clock\n");
119-
}
120-
121103
static int s32_dwmac_probe(struct platform_device *pdev)
122104
{
123105
struct plat_stmmacenet_data *plat;
@@ -172,7 +154,9 @@ static int s32_dwmac_probe(struct platform_device *pdev)
172154

173155
plat->init = s32_gmac_init;
174156
plat->exit = s32_gmac_exit;
175-
plat->fix_mac_speed = s32_fix_mac_speed;
157+
158+
plat->clk_tx_i = gmac->tx_clk;
159+
plat->set_clk_tx_rate = stmmac_set_clk_tx_rate;
176160

177161
plat->bsp_priv = gmac;
178162

drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,9 @@ struct starfive_dwmac_data {
2727

2828
struct starfive_dwmac {
2929
struct device *dev;
30-
struct clk *clk_tx;
3130
const struct starfive_dwmac_data *data;
3231
};
3332

34-
static void starfive_dwmac_fix_mac_speed(void *priv, int speed, unsigned int mode)
35-
{
36-
struct starfive_dwmac *dwmac = priv;
37-
long rate;
38-
int err;
39-
40-
rate = rgmii_clock(speed);
41-
if (rate < 0) {
42-
dev_err(dwmac->dev, "invalid speed %d\n", speed);
43-
return;
44-
}
45-
46-
err = clk_set_rate(dwmac->clk_tx, rate);
47-
if (err)
48-
dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
49-
}
50-
5133
static int starfive_dwmac_set_mode(struct plat_stmmacenet_data *plat_dat)
5234
{
5335
struct starfive_dwmac *dwmac = plat_dat->bsp_priv;
@@ -122,9 +104,9 @@ static int starfive_dwmac_probe(struct platform_device *pdev)
122104

123105
dwmac->data = device_get_match_data(&pdev->dev);
124106

125-
dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
126-
if (IS_ERR(dwmac->clk_tx))
127-
return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
107+
plat_dat->clk_tx_i = devm_clk_get_enabled(&pdev->dev, "tx");
108+
if (IS_ERR(plat_dat->clk_tx_i))
109+
return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat->clk_tx_i),
128110
"error getting tx clock\n");
129111

130112
clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
@@ -139,7 +121,7 @@ static int starfive_dwmac_probe(struct platform_device *pdev)
139121
* internally, because rgmii_rxin will be adaptively adjusted.
140122
*/
141123
if (!device_property_read_bool(&pdev->dev, "starfive,tx-use-rgmii-clk"))
142-
plat_dat->fix_mac_speed = starfive_dwmac_fix_mac_speed;
124+
plat_dat->set_clk_tx_rate = stmmac_set_clk_tx_rate;
143125

144126
dwmac->dev = &pdev->dev;
145127
plat_dat->bsp_priv = dwmac;

0 commit comments

Comments
 (0)