Skip to content

Commit 83310d6

Browse files
author
Paolo Abeni
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Merge in late fixes in preparation for the net-next PR. Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents 42d1c54 + bf9cf80 commit 83310d6

38 files changed

Lines changed: 317 additions & 118 deletions

File tree

Documentation/netlink/specs/mptcp_pm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ definitions:
1515
type: enum
1616
name: event-type
1717
enum-name: mptcp-event-type
18+
doc: Netlink MPTCP event types
1819
name-prefix: mptcp-event-
1920
entries:
2021
-

drivers/dpll/zl3073x/dpll.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,10 +1018,8 @@ zl3073x_dpll_output_pin_phase_adjust_get(const struct dpll_pin *dpll_pin,
10181018
out_id = zl3073x_output_pin_out_get(pin->id);
10191019
out = zl3073x_out_state_get(zldev, out_id);
10201020

1021-
/* Convert value to ps and reverse two's complement negation applied
1022-
* during 'set'
1023-
*/
1024-
*phase_adjust = -out->phase_comp * pin->phase_gran;
1021+
/* The value in the register is expressed in half synth clock cycles. */
1022+
*phase_adjust = out->phase_comp * pin->phase_gran;
10251023

10261024
return 0;
10271025
}
@@ -1043,10 +1041,8 @@ zl3073x_dpll_output_pin_phase_adjust_set(const struct dpll_pin *dpll_pin,
10431041
out_id = zl3073x_output_pin_out_get(pin->id);
10441042
out = *zl3073x_out_state_get(zldev, out_id);
10451043

1046-
/* The value in the register is stored as two's complement negation
1047-
* of requested value and expressed in half synth clock cycles.
1048-
*/
1049-
out.phase_comp = -phase_adjust / pin->phase_gran;
1044+
/* The value in the register is expressed in half synth clock cycles. */
1045+
out.phase_comp = phase_adjust / pin->phase_gran;
10501046

10511047
/* Update output configuration from mailbox */
10521048
return zl3073x_out_state_set(zldev, out_id, &out);

drivers/net/bonding/bond_main.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -791,26 +791,29 @@ static int bond_update_speed_duplex(struct slave *slave)
791791
struct ethtool_link_ksettings ecmd;
792792
int res;
793793

794-
slave->speed = SPEED_UNKNOWN;
795-
slave->duplex = DUPLEX_UNKNOWN;
796-
797794
res = __ethtool_get_link_ksettings(slave_dev, &ecmd);
798795
if (res < 0)
799-
return 1;
796+
goto speed_duplex_unknown;
800797
if (ecmd.base.speed == 0 || ecmd.base.speed == ((__u32)-1))
801-
return 1;
798+
goto speed_duplex_unknown;
802799
switch (ecmd.base.duplex) {
803800
case DUPLEX_FULL:
804801
case DUPLEX_HALF:
805802
break;
806803
default:
807-
return 1;
804+
goto speed_duplex_unknown;
808805
}
809806

810807
slave->speed = ecmd.base.speed;
811808
slave->duplex = ecmd.base.duplex;
812809

813810
return 0;
811+
812+
speed_duplex_unknown:
813+
slave->speed = SPEED_UNKNOWN;
814+
slave->duplex = DUPLEX_UNKNOWN;
815+
816+
return 1;
814817
}
815818

816819
const char *bond_slave_link_status(s8 link)

drivers/net/caif/caif_serial.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ static void ser_release(struct work_struct *work)
284284
{
285285
struct list_head list;
286286
struct ser_device *ser, *tmp;
287+
struct tty_struct *tty;
287288

288289
spin_lock(&ser_lock);
289290
list_replace_init(&ser_release_list, &list);
@@ -292,9 +293,11 @@ static void ser_release(struct work_struct *work)
292293
if (!list_empty(&list)) {
293294
rtnl_lock();
294295
list_for_each_entry_safe(ser, tmp, &list, node) {
296+
tty = ser->tty;
295297
dev_close(ser->dev);
296298
unregister_netdevice(ser->dev);
297299
debugfs_deinit(ser);
300+
tty_kref_put(tty);
298301
}
299302
rtnl_unlock();
300303
}
@@ -355,8 +358,6 @@ static void ldisc_close(struct tty_struct *tty)
355358
{
356359
struct ser_device *ser = tty->disc_data;
357360

358-
tty_kref_put(ser->tty);
359-
360361
spin_lock(&ser_lock);
361362
list_move(&ser->node, &ser_release_list);
362363
spin_unlock(&ser_lock);

drivers/net/ethernet/amd/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ config AMD_XGBE
165165
select CRC32
166166
select PHYLIB
167167
select AMD_XGBE_HAVE_ECC if X86
168-
select NET_SELFTESTS
168+
imply NET_SELFTESTS
169169
help
170170
This driver supports the AMD 10GbE Ethernet device found on an
171171
AMD SoC.

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,12 @@ static void macb_mac_link_up(struct phylink_config *config,
705705
if (rx_pause)
706706
ctrl |= MACB_BIT(PAE);
707707

708-
/* Initialize rings & buffers as clearing MACB_BIT(TE) in link down
709-
* cleared the pipeline and control registers.
710-
*/
711-
macb_init_buffers(bp);
712-
713-
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
708+
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
709+
queue->tx_head = 0;
710+
queue->tx_tail = 0;
714711
queue_writel(queue, IER,
715712
bp->rx_intr_mask | MACB_TX_INT_FLAGS | MACB_BIT(HRESP));
713+
}
716714
}
717715

718716
macb_or_gem_writel(bp, NCFGR, ctrl);
@@ -2954,6 +2952,7 @@ static int macb_open(struct net_device *dev)
29542952
}
29552953

29562954
bp->macbgem_ops.mog_init_rings(bp);
2955+
macb_init_buffers(bp);
29572956

29582957
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
29592958
napi_enable(&queue->napi_rx);

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,13 +1049,13 @@ static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring)
10491049
int order;
10501050

10511051
if (!alloc_size)
1052-
return;
1052+
goto not_init;
10531053

10541054
order = get_order(alloc_size);
10551055
if (order > MAX_PAGE_ORDER) {
10561056
if (net_ratelimit())
10571057
dev_warn(ring_to_dev(ring), "failed to allocate tx spare buffer, exceed to max order\n");
1058-
return;
1058+
goto not_init;
10591059
}
10601060

10611061
tx_spare = devm_kzalloc(ring_to_dev(ring), sizeof(*tx_spare),
@@ -1093,6 +1093,13 @@ static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring)
10931093
devm_kfree(ring_to_dev(ring), tx_spare);
10941094
devm_kzalloc_error:
10951095
ring->tqp->handle->kinfo.tx_spare_buf_size = 0;
1096+
not_init:
1097+
/* When driver init or reset_init, the ring->tx_spare is always NULL;
1098+
* but when called from hns3_set_ringparam, it's usually not NULL, and
1099+
* will be restored if hns3_init_all_ring() failed. So it's safe to set
1100+
* ring->tx_spare to NULL here.
1101+
*/
1102+
ring->tx_spare = NULL;
10961103
}
10971104

10981105
/* Use hns3_tx_spare_space() to make sure there is enough buffer

drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static void octep_setup_iq_regs_cn93_pf(struct octep_device *oct, int iq_no)
307307
}
308308

309309
/* Setup registers for a hardware Rx Queue */
310-
static void octep_setup_oq_regs_cn93_pf(struct octep_device *oct, int oq_no)
310+
static int octep_setup_oq_regs_cn93_pf(struct octep_device *oct, int oq_no)
311311
{
312312
u64 reg_val;
313313
u64 oq_ctl = 0ULL;
@@ -355,6 +355,7 @@ static void octep_setup_oq_regs_cn93_pf(struct octep_device *oct, int oq_no)
355355
reg_val = ((u64)time_threshold << 32) |
356356
CFG_GET_OQ_INTR_PKT(oct->conf);
357357
octep_write_csr64(oct, CN93_SDP_R_OUT_INT_LEVELS(oq_no), reg_val);
358+
return 0;
358359
}
359360

360361
/* Setup registers for a PF mailbox */
@@ -709,14 +710,26 @@ static void octep_enable_interrupts_cn93_pf(struct octep_device *oct)
709710
/* Disable all interrupts */
710711
static void octep_disable_interrupts_cn93_pf(struct octep_device *oct)
711712
{
712-
u64 intr_mask = 0ULL;
713+
u64 reg_val, intr_mask = 0ULL;
713714
int srn, num_rings, i;
714715

715716
srn = CFG_GET_PORTS_PF_SRN(oct->conf);
716717
num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
717718

718-
for (i = 0; i < num_rings; i++)
719-
intr_mask |= (0x1ULL << (srn + i));
719+
for (i = 0; i < num_rings; i++) {
720+
intr_mask |= BIT_ULL(srn + i);
721+
reg_val = octep_read_csr64(oct,
722+
CN93_SDP_R_IN_INT_LEVELS(srn + i));
723+
reg_val &= ~CN93_INT_ENA_BIT;
724+
octep_write_csr64(oct,
725+
CN93_SDP_R_IN_INT_LEVELS(srn + i), reg_val);
726+
727+
reg_val = octep_read_csr64(oct,
728+
CN93_SDP_R_OUT_INT_LEVELS(srn + i));
729+
reg_val &= ~CN93_INT_ENA_BIT;
730+
octep_write_csr64(oct,
731+
CN93_SDP_R_OUT_INT_LEVELS(srn + i), reg_val);
732+
}
720733

721734
octep_write_csr64(oct, CN93_SDP_EPF_IRERR_RINT_ENA_W1C, intr_mask);
722735
octep_write_csr64(oct, CN93_SDP_EPF_ORERR_RINT_ENA_W1C, intr_mask);

drivers/net/ethernet/marvell/octeon_ep/octep_cnxk_pf.c

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/pci.h>
99
#include <linux/netdevice.h>
1010
#include <linux/etherdevice.h>
11+
#include <linux/jiffies.h>
1112

1213
#include "octep_config.h"
1314
#include "octep_main.h"
@@ -327,12 +328,14 @@ static void octep_setup_iq_regs_cnxk_pf(struct octep_device *oct, int iq_no)
327328
}
328329

329330
/* Setup registers for a hardware Rx Queue */
330-
static void octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
331+
static int octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
331332
{
332-
u64 reg_val;
333-
u64 oq_ctl = 0ULL;
334-
u32 time_threshold = 0;
335333
struct octep_oq *oq = oct->oq[oq_no];
334+
unsigned long t_out_jiffies;
335+
u32 time_threshold = 0;
336+
u64 oq_ctl = 0ULL;
337+
u64 reg_ba_val;
338+
u64 reg_val;
336339

337340
oq_no += CFG_GET_PORTS_PF_SRN(oct->conf);
338341
reg_val = octep_read_csr64(oct, CNXK_SDP_R_OUT_CONTROL(oq_no));
@@ -343,6 +346,36 @@ static void octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
343346
reg_val = octep_read_csr64(oct, CNXK_SDP_R_OUT_CONTROL(oq_no));
344347
} while (!(reg_val & CNXK_R_OUT_CTL_IDLE));
345348
}
349+
octep_write_csr64(oct, CNXK_SDP_R_OUT_WMARK(oq_no), oq->max_count);
350+
/* Wait for WMARK to get applied */
351+
usleep_range(10, 15);
352+
353+
octep_write_csr64(oct, CNXK_SDP_R_OUT_SLIST_BADDR(oq_no),
354+
oq->desc_ring_dma);
355+
octep_write_csr64(oct, CNXK_SDP_R_OUT_SLIST_RSIZE(oq_no),
356+
oq->max_count);
357+
reg_ba_val = octep_read_csr64(oct, CNXK_SDP_R_OUT_SLIST_BADDR(oq_no));
358+
359+
if (reg_ba_val != oq->desc_ring_dma) {
360+
t_out_jiffies = jiffies + 10 * HZ;
361+
do {
362+
if (reg_ba_val == ULLONG_MAX)
363+
return -EFAULT;
364+
octep_write_csr64(oct,
365+
CNXK_SDP_R_OUT_SLIST_BADDR(oq_no),
366+
oq->desc_ring_dma);
367+
octep_write_csr64(oct,
368+
CNXK_SDP_R_OUT_SLIST_RSIZE(oq_no),
369+
oq->max_count);
370+
reg_ba_val =
371+
octep_read_csr64(oct,
372+
CNXK_SDP_R_OUT_SLIST_BADDR(oq_no));
373+
} while ((reg_ba_val != oq->desc_ring_dma) &&
374+
time_before(jiffies, t_out_jiffies));
375+
376+
if (reg_ba_val != oq->desc_ring_dma)
377+
return -EAGAIN;
378+
}
346379

347380
reg_val &= ~(CNXK_R_OUT_CTL_IMODE);
348381
reg_val &= ~(CNXK_R_OUT_CTL_ROR_P);
@@ -356,10 +389,6 @@ static void octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
356389
reg_val |= (CNXK_R_OUT_CTL_ES_P);
357390

358391
octep_write_csr64(oct, CNXK_SDP_R_OUT_CONTROL(oq_no), reg_val);
359-
octep_write_csr64(oct, CNXK_SDP_R_OUT_SLIST_BADDR(oq_no),
360-
oq->desc_ring_dma);
361-
octep_write_csr64(oct, CNXK_SDP_R_OUT_SLIST_RSIZE(oq_no),
362-
oq->max_count);
363392

364393
oq_ctl = octep_read_csr64(oct, CNXK_SDP_R_OUT_CONTROL(oq_no));
365394

@@ -385,6 +414,7 @@ static void octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
385414
reg_val &= ~0xFFFFFFFFULL;
386415
reg_val |= CFG_GET_OQ_WMARK(oct->conf);
387416
octep_write_csr64(oct, CNXK_SDP_R_OUT_WMARK(oq_no), reg_val);
417+
return 0;
388418
}
389419

390420
/* Setup registers for a PF mailbox */
@@ -720,14 +750,26 @@ static void octep_enable_interrupts_cnxk_pf(struct octep_device *oct)
720750
/* Disable all interrupts */
721751
static void octep_disable_interrupts_cnxk_pf(struct octep_device *oct)
722752
{
723-
u64 intr_mask = 0ULL;
753+
u64 reg_val, intr_mask = 0ULL;
724754
int srn, num_rings, i;
725755

726756
srn = CFG_GET_PORTS_PF_SRN(oct->conf);
727757
num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
728758

729-
for (i = 0; i < num_rings; i++)
730-
intr_mask |= (0x1ULL << (srn + i));
759+
for (i = 0; i < num_rings; i++) {
760+
intr_mask |= BIT_ULL(srn + i);
761+
reg_val = octep_read_csr64(oct,
762+
CNXK_SDP_R_IN_INT_LEVELS(srn + i));
763+
reg_val &= ~CNXK_INT_ENA_BIT;
764+
octep_write_csr64(oct,
765+
CNXK_SDP_R_IN_INT_LEVELS(srn + i), reg_val);
766+
767+
reg_val = octep_read_csr64(oct,
768+
CNXK_SDP_R_OUT_INT_LEVELS(srn + i));
769+
reg_val &= ~CNXK_INT_ENA_BIT;
770+
octep_write_csr64(oct,
771+
CNXK_SDP_R_OUT_INT_LEVELS(srn + i), reg_val);
772+
}
731773

732774
octep_write_csr64(oct, CNXK_SDP_EPF_IRERR_RINT_ENA_W1C, intr_mask);
733775
octep_write_csr64(oct, CNXK_SDP_EPF_ORERR_RINT_ENA_W1C, intr_mask);

drivers/net/ethernet/marvell/octeon_ep/octep_main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct octep_pci_win_regs {
7777

7878
struct octep_hw_ops {
7979
void (*setup_iq_regs)(struct octep_device *oct, int q);
80-
void (*setup_oq_regs)(struct octep_device *oct, int q);
80+
int (*setup_oq_regs)(struct octep_device *oct, int q);
8181
void (*setup_mbox_regs)(struct octep_device *oct, int mbox);
8282

8383
irqreturn_t (*mbox_intr_handler)(void *ioq_vector);

0 commit comments

Comments
 (0)