Skip to content

Commit 1caa6b1

Browse files
committed
tgupdate: merge t/DO-NOT-MERGE-git-markup-end-common-net-net-next into t/DO-NOT-MERGE-git-markup-net-next base
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> # Conflicts: # net/xdp/xsk.c
2 parents 35e2f27 + d68f78f commit 1caa6b1

File tree

14 files changed

+187
-126
lines changed

14 files changed

+187
-126
lines changed

drivers/atm/fore200e.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,9 @@ fore200e_open(struct atm_vcc *vcc)
13741374

13751375
vcc->dev_data = NULL;
13761376

1377+
mutex_lock(&fore200e->rate_mtx);
13771378
fore200e->available_cell_rate += vcc->qos.txtp.max_pcr;
1379+
mutex_unlock(&fore200e->rate_mtx);
13781380

13791381
kfree(fore200e_vcc);
13801382
return -EINVAL;

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,8 +2587,8 @@ static int ksz_irq_phy_setup(struct ksz_device *dev)
25872587

25882588
irq = irq_find_mapping(dev->ports[port].pirq.domain,
25892589
PORT_SRC_PHY_INT);
2590-
if (irq < 0) {
2591-
ret = irq;
2590+
if (!irq) {
2591+
ret = -EINVAL;
25922592
goto out;
25932593
}
25942594
ds->user_mii_bus->irq[phy] = irq;
@@ -2952,8 +2952,8 @@ static int ksz_pirq_setup(struct ksz_device *dev, u8 p)
29522952
snprintf(pirq->name, sizeof(pirq->name), "port_irq-%d", p);
29532953

29542954
pirq->irq_num = irq_find_mapping(dev->girq.domain, p);
2955-
if (pirq->irq_num < 0)
2956-
return pirq->irq_num;
2955+
if (!pirq->irq_num)
2956+
return -EINVAL;
29572957

29582958
return ksz_irq_common_setup(dev, pirq);
29592959
}
@@ -3038,12 +3038,12 @@ static int ksz_setup(struct dsa_switch *ds)
30383038
dsa_switch_for_each_user_port(dp, dev->ds) {
30393039
ret = ksz_pirq_setup(dev, dp->index);
30403040
if (ret)
3041-
goto out_girq;
3041+
goto port_release;
30423042

30433043
if (dev->info->ptp_capable) {
30443044
ret = ksz_ptp_irq_setup(ds, dp->index);
30453045
if (ret)
3046-
goto out_pirq;
3046+
goto pirq_release;
30473047
}
30483048
}
30493049
}
@@ -3053,7 +3053,7 @@ static int ksz_setup(struct dsa_switch *ds)
30533053
if (ret) {
30543054
dev_err(dev->dev, "Failed to register PTP clock: %d\n",
30553055
ret);
3056-
goto out_ptpirq;
3056+
goto port_release;
30573057
}
30583058
}
30593059

@@ -3076,17 +3076,16 @@ static int ksz_setup(struct dsa_switch *ds)
30763076
out_ptp_clock_unregister:
30773077
if (dev->info->ptp_capable)
30783078
ksz_ptp_clock_unregister(ds);
3079-
out_ptpirq:
3080-
if (dev->irq > 0 && dev->info->ptp_capable)
3081-
dsa_switch_for_each_user_port(dp, dev->ds)
3082-
ksz_ptp_irq_free(ds, dp->index);
3083-
out_pirq:
3084-
if (dev->irq > 0)
3085-
dsa_switch_for_each_user_port(dp, dev->ds)
3079+
port_release:
3080+
if (dev->irq > 0) {
3081+
dsa_switch_for_each_user_port_continue_reverse(dp, dev->ds) {
3082+
if (dev->info->ptp_capable)
3083+
ksz_ptp_irq_free(ds, dp->index);
3084+
pirq_release:
30863085
ksz_irq_free(&dev->ports[dp->index].pirq);
3087-
out_girq:
3088-
if (dev->irq > 0)
3086+
}
30893087
ksz_irq_free(&dev->girq);
3088+
}
30903089

30913090
return ret;
30923091
}

drivers/net/dsa/microchip/ksz_ptp.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,19 +1093,19 @@ static int ksz_ptp_msg_irq_setup(struct ksz_port *port, u8 n)
10931093
static const char * const name[] = {"pdresp-msg", "xdreq-msg",
10941094
"sync-msg"};
10951095
const struct ksz_dev_ops *ops = port->ksz_dev->dev_ops;
1096+
struct ksz_irq *ptpirq = &port->ptpirq;
10961097
struct ksz_ptp_irq *ptpmsg_irq;
10971098

10981099
ptpmsg_irq = &port->ptpmsg_irq[n];
1100+
ptpmsg_irq->num = irq_create_mapping(ptpirq->domain, n);
1101+
if (!ptpmsg_irq->num)
1102+
return -EINVAL;
10991103

11001104
ptpmsg_irq->port = port;
11011105
ptpmsg_irq->ts_reg = ops->get_port_addr(port->num, ts_reg[n]);
11021106

11031107
strscpy(ptpmsg_irq->name, name[n]);
11041108

1105-
ptpmsg_irq->num = irq_find_mapping(port->ptpirq.domain, n);
1106-
if (ptpmsg_irq->num < 0)
1107-
return ptpmsg_irq->num;
1108-
11091109
return request_threaded_irq(ptpmsg_irq->num, NULL,
11101110
ksz_ptp_msg_thread_fn, IRQF_ONESHOT,
11111111
ptpmsg_irq->name, ptpmsg_irq);
@@ -1135,12 +1135,9 @@ int ksz_ptp_irq_setup(struct dsa_switch *ds, u8 p)
11351135
if (!ptpirq->domain)
11361136
return -ENOMEM;
11371137

1138-
for (irq = 0; irq < ptpirq->nirqs; irq++)
1139-
irq_create_mapping(ptpirq->domain, irq);
1140-
11411138
ptpirq->irq_num = irq_find_mapping(port->pirq.domain, PORT_SRC_PTP_INT);
1142-
if (ptpirq->irq_num < 0) {
1143-
ret = ptpirq->irq_num;
1139+
if (!ptpirq->irq_num) {
1140+
ret = -EINVAL;
11441141
goto out;
11451142
}
11461143

@@ -1159,12 +1156,11 @@ int ksz_ptp_irq_setup(struct dsa_switch *ds, u8 p)
11591156

11601157
out_ptp_msg:
11611158
free_irq(ptpirq->irq_num, ptpirq);
1162-
while (irq--)
1159+
while (irq--) {
11631160
free_irq(port->ptpmsg_irq[irq].num, &port->ptpmsg_irq[irq]);
1164-
out:
1165-
for (irq = 0; irq < ptpirq->nirqs; irq++)
11661161
irq_dispose_mapping(port->ptpmsg_irq[irq].num);
1167-
1162+
}
1163+
out:
11681164
irq_domain_remove(ptpirq->domain);
11691165

11701166
return ret;

drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "aq_hw.h"
1717
#include "aq_nic.h"
18+
#include "hw_atl/hw_atl_llh.h"
1819

1920
void aq_hw_write_reg_bit(struct aq_hw_s *aq_hw, u32 addr, u32 msk,
2021
u32 shift, u32 val)
@@ -81,6 +82,27 @@ void aq_hw_write_reg64(struct aq_hw_s *hw, u32 reg, u64 value)
8182
lo_hi_writeq(value, hw->mmio + reg);
8283
}
8384

85+
int aq_hw_invalidate_descriptor_cache(struct aq_hw_s *hw)
86+
{
87+
int err;
88+
u32 val;
89+
90+
/* Invalidate Descriptor Cache to prevent writing to the cached
91+
* descriptors and to the data pointer of those descriptors
92+
*/
93+
hw_atl_rdm_rx_dma_desc_cache_init_tgl(hw);
94+
95+
err = aq_hw_err_from_flags(hw);
96+
if (err)
97+
goto err_exit;
98+
99+
readx_poll_timeout_atomic(hw_atl_rdm_rx_dma_desc_cache_init_done_get,
100+
hw, val, val == 1, 1000U, 10000U);
101+
102+
err_exit:
103+
return err;
104+
}
105+
84106
int aq_hw_err_from_flags(struct aq_hw_s *hw)
85107
{
86108
int err = 0;

drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ u32 aq_hw_read_reg(struct aq_hw_s *hw, u32 reg);
3535
void aq_hw_write_reg(struct aq_hw_s *hw, u32 reg, u32 value);
3636
u64 aq_hw_read_reg64(struct aq_hw_s *hw, u32 reg);
3737
void aq_hw_write_reg64(struct aq_hw_s *hw, u32 reg, u64 value);
38+
int aq_hw_invalidate_descriptor_cache(struct aq_hw_s *hw);
3839
int aq_hw_err_from_flags(struct aq_hw_s *hw);
3940
int aq_hw_num_tcs(struct aq_hw_s *hw);
4041
int aq_hw_q_per_tc(struct aq_hw_s *hw);

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,26 +1198,9 @@ static int hw_atl_b0_hw_interrupt_moderation_set(struct aq_hw_s *self)
11981198

11991199
static int hw_atl_b0_hw_stop(struct aq_hw_s *self)
12001200
{
1201-
int err;
1202-
u32 val;
1203-
12041201
hw_atl_b0_hw_irq_disable(self, HW_ATL_B0_INT_MASK);
12051202

1206-
/* Invalidate Descriptor Cache to prevent writing to the cached
1207-
* descriptors and to the data pointer of those descriptors
1208-
*/
1209-
hw_atl_rdm_rx_dma_desc_cache_init_tgl(self);
1210-
1211-
err = aq_hw_err_from_flags(self);
1212-
1213-
if (err)
1214-
goto err_exit;
1215-
1216-
readx_poll_timeout_atomic(hw_atl_rdm_rx_dma_desc_cache_init_done_get,
1217-
self, val, val == 1, 1000U, 10000U);
1218-
1219-
err_exit:
1220-
return err;
1203+
return aq_hw_invalidate_descriptor_cache(self);
12211204
}
12221205

12231206
int hw_atl_b0_hw_ring_tx_stop(struct aq_hw_s *self, struct aq_ring_s *ring)

drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ static int hw_atl2_hw_stop(struct aq_hw_s *self)
759759
{
760760
hw_atl_b0_hw_irq_disable(self, HW_ATL2_INT_MASK);
761761

762-
return 0;
762+
return aq_hw_invalidate_descriptor_cache(self);
763763
}
764764

765765
static struct aq_stats_s *hw_atl2_utils_get_hw_stats(struct aq_hw_s *self)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ static int mlx5e_dcbnl_ieee_setmaxrate(struct net_device *netdev,
627627
MLX5E_100MB);
628628
max_bw_value[i] = max_bw_value[i] ? max_bw_value[i] : 1;
629629
max_bw_unit[i] = MLX5_100_MBPS_UNIT;
630-
} else if (max_bw_value[i] <= upper_limit_gbps) {
630+
} else if (maxrate->tc_maxrate[i] <= upper_limit_gbps) {
631631
max_bw_value[i] = div_u64(maxrate->tc_maxrate[i],
632632
MLX5E_1GB);
633633
max_bw_unit[i] = MLX5_GBPS_UNIT;

drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
// SPDX-License-Identifier: GPL-2.0+
22

33
#include <linux/ptp_classify.h>
4+
#include <linux/units.h>
45

56
#include "lan966x_main.h"
67
#include "vcap_api.h"
78
#include "vcap_api_client.h"
89

10+
#define LAN9X66_CLOCK_RATE 165617754
11+
912
#define LAN966X_MAX_PTP_ID 512
1013

1114
/* Represents 1ppm adjustment in 2^59 format with 6.037735849ns as reference
@@ -1126,5 +1129,5 @@ void lan966x_ptp_rxtstamp(struct lan966x *lan966x, struct sk_buff *skb,
11261129
u32 lan966x_ptp_get_period_ps(void)
11271130
{
11281131
/* This represents the system clock period in picoseconds */
1129-
return 15125;
1132+
return PICO / LAN9X66_CLOCK_RATE;
11301133
}

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,11 +1520,20 @@ static enum rtl_dash_type rtl_get_dash_type(struct rtl8169_private *tp)
15201520

15211521
static void rtl_set_d3_pll_down(struct rtl8169_private *tp, bool enable)
15221522
{
1523-
if (tp->mac_version >= RTL_GIGA_MAC_VER_25 &&
1524-
tp->mac_version != RTL_GIGA_MAC_VER_28 &&
1525-
tp->mac_version != RTL_GIGA_MAC_VER_31 &&
1526-
tp->mac_version != RTL_GIGA_MAC_VER_38)
1527-
r8169_mod_reg8_cond(tp, PMCH, D3_NO_PLL_DOWN, !enable);
1523+
switch (tp->mac_version) {
1524+
case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_24:
1525+
case RTL_GIGA_MAC_VER_28:
1526+
case RTL_GIGA_MAC_VER_31:
1527+
case RTL_GIGA_MAC_VER_38:
1528+
break;
1529+
case RTL_GIGA_MAC_VER_80:
1530+
r8169_mod_reg8_cond(tp, PMCH, D3_NO_PLL_DOWN, true);
1531+
break;
1532+
default:
1533+
r8169_mod_reg8_cond(tp, PMCH, D3HOT_NO_PLL_DOWN, true);
1534+
r8169_mod_reg8_cond(tp, PMCH, D3COLD_NO_PLL_DOWN, !enable);
1535+
break;
1536+
}
15281537
}
15291538

15301539
static void rtl_reset_packet_filter(struct rtl8169_private *tp)

0 commit comments

Comments
 (0)