mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-07 01:53:34 +08:00
kernel: bump to 5.4.241
Removed upstreamed patches: - generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch - mvebu/patches-5.4/008-net-mvneta-make-tx-buffer-array-agnostic.patch Refreshed all patches. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
14f80a8449
commit
5c1af46f28
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.4 = .238
|
||||
LINUX_KERNEL_HASH-5.4.238 = 70a2b2da85598eba6a73cdc0749e441cbdf3011d9babcb7028a46aa8d98aa91f
|
||||
LINUX_VERSION-5.4 = .241
|
||||
LINUX_KERNEL_HASH-5.4.241 = ffc0e0ad6f47f8b7b05148d815cbab27f44fa433f3a8ed0e372d4b8647bcea7c
|
||||
|
@ -23,7 +23,7 @@ produce a noisy warning.
|
||||
xhci->quirks |= XHCI_RESET_ON_RESUME;
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -427,10 +427,14 @@ static int xhci_try_enable_msi(struct us
|
||||
@@ -431,10 +431,14 @@ static int xhci_try_enable_msi(struct us
|
||||
free_irq(hcd->irq, hcd);
|
||||
hcd->irq = 0;
|
||||
|
||||
|
@ -25,7 +25,7 @@ Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
|
||||
static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
|
||||
u32 *data, int in_pm)
|
||||
{
|
||||
@@ -1964,7 +1968,8 @@ static int smsc95xx_rx_fixup(struct usbn
|
||||
@@ -1970,7 +1974,8 @@ static int smsc95xx_rx_fixup(struct usbn
|
||||
if (dev->net->features & NETIF_F_RXCSUM)
|
||||
smsc95xx_rx_csum_offload(skb);
|
||||
skb_trim(skb, skb->len - 4); /* remove fcs */
|
||||
@ -35,7 +35,7 @@ Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1982,7 +1987,8 @@ static int smsc95xx_rx_fixup(struct usbn
|
||||
@@ -1988,7 +1993,8 @@ static int smsc95xx_rx_fixup(struct usbn
|
||||
if (dev->net->features & NETIF_F_RXCSUM)
|
||||
smsc95xx_rx_csum_offload(ax_skb);
|
||||
skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */
|
||||
|
@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -1487,6 +1487,103 @@ command_cleanup:
|
||||
@@ -1491,6 +1491,103 @@ command_cleanup:
|
||||
}
|
||||
|
||||
/*
|
||||
@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
* non-error returns are a promise to giveback() the urb later
|
||||
* we drop ownership so next owner (or urb unlink) can get it
|
||||
*/
|
||||
@@ -5402,6 +5499,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
@@ -5406,6 +5503,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
.endpoint_reset = xhci_endpoint_reset,
|
||||
.check_bandwidth = xhci_check_bandwidth,
|
||||
.reset_bandwidth = xhci_reset_bandwidth,
|
||||
|
@ -40,7 +40,7 @@ it on BCM4708 family.
|
||||
/* called during probe() after chip reset completes */
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -158,6 +158,49 @@ int xhci_start(struct xhci_hcd *xhci)
|
||||
@@ -159,6 +159,49 @@ int xhci_start(struct xhci_hcd *xhci)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ it on BCM4708 family.
|
||||
/*
|
||||
* Reset a halted HC.
|
||||
*
|
||||
@@ -608,10 +651,20 @@ static int xhci_init(struct usb_hcd *hcd
|
||||
@@ -612,10 +655,20 @@ static int xhci_init(struct usb_hcd *hcd
|
||||
|
||||
static int xhci_run_finished(struct xhci_hcd *xhci)
|
||||
{
|
||||
@ -114,7 +114,7 @@ it on BCM4708 family.
|
||||
xhci->shared_hcd->state = HC_STATE_RUNNING;
|
||||
xhci->cmd_ring_state = CMD_RING_STATE_RUNNING;
|
||||
|
||||
@@ -621,6 +674,10 @@ static int xhci_run_finished(struct xhci
|
||||
@@ -625,6 +678,10 @@ static int xhci_run_finished(struct xhci
|
||||
xhci_dbg_trace(xhci, trace_xhci_dbg_init,
|
||||
"Finished xhci_run for USB3 roothub");
|
||||
return 0;
|
||||
|
@ -232,7 +232,7 @@ Tested-by: Yu Zhao <yuzhao@chromium.org>
|
||||
SetPageWorkingset(new_page);
|
||||
--- a/mm/swapfile.c
|
||||
+++ b/mm/swapfile.c
|
||||
@@ -715,6 +715,7 @@ static void add_to_avail_list(struct swa
|
||||
@@ -716,6 +716,7 @@ static void add_to_avail_list(struct swa
|
||||
static void swap_range_free(struct swap_info_struct *si, unsigned long offset,
|
||||
unsigned int nr_entries)
|
||||
{
|
||||
@ -240,7 +240,7 @@ Tested-by: Yu Zhao <yuzhao@chromium.org>
|
||||
unsigned long end = offset + nr_entries - 1;
|
||||
void (*swap_slot_free_notify)(struct block_device *, unsigned long);
|
||||
|
||||
@@ -740,6 +741,7 @@ static void swap_range_free(struct swap_
|
||||
@@ -741,6 +742,7 @@ static void swap_range_free(struct swap_
|
||||
swap_slot_free_notify(si->bdev, offset);
|
||||
offset++;
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ Commit-Queue: Yu Zhao <yuzhao@chromium.org>
|
||||
#if defined(CONFIG_NUMA_BALANCING) && !defined(LAST_CPUPID_NOT_IN_PAGE_FLAGS)
|
||||
--- a/mm/swapfile.c
|
||||
+++ b/mm/swapfile.c
|
||||
@@ -2702,6 +2702,8 @@ SYSCALL_DEFINE1(swapoff, const char __us
|
||||
@@ -2703,6 +2703,8 @@ SYSCALL_DEFINE1(swapoff, const char __us
|
||||
err = 0;
|
||||
atomic_inc(&proc_poll_event);
|
||||
wake_up_interruptible(&proc_poll_wait);
|
||||
@ -579,7 +579,7 @@ Commit-Queue: Yu Zhao <yuzhao@chromium.org>
|
||||
|
||||
out_dput:
|
||||
filp_close(victim, NULL);
|
||||
@@ -3328,6 +3330,8 @@ SYSCALL_DEFINE2(swapon, const char __use
|
||||
@@ -3329,6 +3331,8 @@ SYSCALL_DEFINE2(swapon, const char __use
|
||||
mutex_unlock(&swapon_mutex);
|
||||
atomic_inc(&proc_poll_event);
|
||||
wake_up_interruptible(&proc_poll_wait);
|
||||
|
@ -260,7 +260,7 @@ Commit-Queue: Yu Zhao <yuzhao@chromium.org>
|
||||
/* forking complete and child started to run, tell ptracer */
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -3468,6 +3468,7 @@ context_switch(struct rq *rq, struct tas
|
||||
@@ -3471,6 +3471,7 @@ context_switch(struct rq *rq, struct tas
|
||||
* finish_task_switch()'s mmdrop().
|
||||
*/
|
||||
switch_mm_irqs_off(prev->active_mm, next->mm, next);
|
||||
@ -268,7 +268,7 @@ Commit-Queue: Yu Zhao <yuzhao@chromium.org>
|
||||
|
||||
if (!prev->mm) { // from kernel
|
||||
/* will mmdrop() in finish_task_switch(). */
|
||||
@@ -6283,6 +6284,7 @@ void idle_task_exit(void)
|
||||
@@ -6286,6 +6287,7 @@ void idle_task_exit(void)
|
||||
|
||||
if (mm != &init_mm) {
|
||||
switch_mm(mm, &init_mm, current);
|
||||
|
@ -1,69 +0,0 @@
|
||||
From 1e020e1b96afdecd20680b5b5be2a6ffc3d27628 Mon Sep 17 00:00:00 2001
|
||||
From: Zhihao Cheng <chengzhihao1@huawei.com>
|
||||
Date: Mon, 6 Mar 2023 09:33:08 +0800
|
||||
Subject: [PATCH] ubi: Fix failure attaching when vid_hdr offset equals to
|
||||
(sub)page size
|
||||
|
||||
Following process will make ubi attaching failed since commit
|
||||
1b42b1a36fc946 ("ubi: ensure that VID header offset ... size"):
|
||||
|
||||
ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB
|
||||
modprobe nandsim id_bytes=$ID
|
||||
flash_eraseall /dev/mtd0
|
||||
modprobe ubi mtd="0,2048" # set vid_hdr offset as 2048 (one page)
|
||||
(dmesg):
|
||||
ubi0 error: ubi_attach_mtd_dev [ubi]: VID header offset 2048 too large.
|
||||
UBI error: cannot attach mtd0
|
||||
UBI error: cannot initialize UBI, error -22
|
||||
|
||||
Rework original solution, the key point is making sure
|
||||
'vid_hdr_shift + UBI_VID_HDR_SIZE < ubi->vid_hdr_alsize',
|
||||
so we should check vid_hdr_shift rather not vid_hdr_offset.
|
||||
Then, ubi still support (sub)page aligined VID header offset.
|
||||
|
||||
Fixes: 1b42b1a36fc946 ("ubi: ensure that VID header offset ... size")
|
||||
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
|
||||
Tested-by: Nicolas Schichan <nschichan@freebox.fr>
|
||||
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com> # v5.10, v4.19
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
drivers/mtd/ubi/build.c | 21 +++++++++++++++------
|
||||
1 file changed, 15 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/ubi/build.c
|
||||
+++ b/drivers/mtd/ubi/build.c
|
||||
@@ -644,12 +644,6 @@ static int io_init(struct ubi_device *ub
|
||||
ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size);
|
||||
ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size);
|
||||
|
||||
- if (ubi->vid_hdr_offset && ((ubi->vid_hdr_offset + UBI_VID_HDR_SIZE) >
|
||||
- ubi->vid_hdr_alsize)) {
|
||||
- ubi_err(ubi, "VID header offset %d too large.", ubi->vid_hdr_offset);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
dbg_gen("min_io_size %d", ubi->min_io_size);
|
||||
dbg_gen("max_write_size %d", ubi->max_write_size);
|
||||
dbg_gen("hdrs_min_io_size %d", ubi->hdrs_min_io_size);
|
||||
@@ -667,6 +661,21 @@ static int io_init(struct ubi_device *ub
|
||||
ubi->vid_hdr_aloffset;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * Memory allocation for VID header is ubi->vid_hdr_alsize
|
||||
+ * which is described in comments in io.c.
|
||||
+ * Make sure VID header shift + UBI_VID_HDR_SIZE not exceeds
|
||||
+ * ubi->vid_hdr_alsize, so that all vid header operations
|
||||
+ * won't access memory out of bounds.
|
||||
+ */
|
||||
+ if ((ubi->vid_hdr_shift + UBI_VID_HDR_SIZE) > ubi->vid_hdr_alsize) {
|
||||
+ ubi_err(ubi, "Invalid VID header offset %d, VID header shift(%d)"
|
||||
+ " + VID header size(%zu) > VID header aligned size(%d).",
|
||||
+ ubi->vid_hdr_offset, ubi->vid_hdr_shift,
|
||||
+ UBI_VID_HDR_SIZE, ubi->vid_hdr_alsize);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
/* Similar for the data offset */
|
||||
ubi->leb_start = ubi->vid_hdr_offset + UBI_VID_HDR_SIZE;
|
||||
ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size);
|
@ -202,7 +202,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
}
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -4878,7 +4878,8 @@ static struct mv88e6xxx_chip *mv88e6xxx_
|
||||
@@ -4883,7 +4883,8 @@ static struct mv88e6xxx_chip *mv88e6xxx_
|
||||
}
|
||||
|
||||
static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds,
|
||||
|
@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -4929,6 +4929,80 @@ static int mv88e6xxx_port_mdb_del(struct
|
||||
@@ -4934,6 +4934,80 @@ static int mv88e6xxx_port_mdb_del(struct
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port,
|
||||
bool unicast, bool multicast)
|
||||
{
|
||||
@@ -4983,6 +5057,8 @@ static const struct dsa_switch_ops mv88e
|
||||
@@ -4988,6 +5062,8 @@ static const struct dsa_switch_ops mv88e
|
||||
.port_mdb_prepare = mv88e6xxx_port_mdb_prepare,
|
||||
.port_mdb_add = mv88e6xxx_port_mdb_add,
|
||||
.port_mdb_del = mv88e6xxx_port_mdb_del,
|
||||
|
@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -4996,7 +4996,7 @@ static void mv88e6xxx_port_mirror_del(st
|
||||
@@ -5001,7 +5001,7 @@ static void mv88e6xxx_port_mirror_del(st
|
||||
if (chip->info->ops->set_egress_port(chip,
|
||||
direction,
|
||||
dsa_upstream_port(ds,
|
||||
|
@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
device, it has to decide which ones to send first, which ones to
|
||||
--- a/net/sched/sch_api.c
|
||||
+++ b/net/sched/sch_api.c
|
||||
@@ -2283,7 +2283,7 @@ static int __init pktsched_init(void)
|
||||
@@ -2286,7 +2286,7 @@ static int __init pktsched_init(void)
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -2492,6 +2492,9 @@ static int mv88e6xxx_setup_port(struct m
|
||||
@@ -2497,6 +2497,9 @@ static int mv88e6xxx_setup_port(struct m
|
||||
if (dsa_is_cpu_port(ds, port))
|
||||
reg = 0;
|
||||
|
||||
|
@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+MODULE_LICENSE("GPL");
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -2770,6 +2770,7 @@ int wake_up_state(struct task_struct *p,
|
||||
@@ -2773,6 +2773,7 @@ int wake_up_state(struct task_struct *p,
|
||||
{
|
||||
return try_to_wake_up(p, state, 0);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/usb/qmi_wwan.c
|
||||
+++ b/drivers/net/usb/qmi_wwan.c
|
||||
@@ -1366,6 +1366,7 @@ static const struct usb_device_id produc
|
||||
@@ -1367,6 +1367,7 @@ static const struct usb_device_id produc
|
||||
{QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */
|
||||
{QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
|
||||
{QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: DENG Qingfang <dqfext@gmail.com>
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -2663,6 +2663,7 @@ static int mv88e6xxx_setup(struct dsa_sw
|
||||
@@ -2668,6 +2668,7 @@ static int mv88e6xxx_setup(struct dsa_sw
|
||||
|
||||
chip->ds = ds;
|
||||
ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip);
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -5083,6 +5083,7 @@ static int mv88e6xxx_register_switch(str
|
||||
@@ -5088,6 +5088,7 @@ static int mv88e6xxx_register_switch(str
|
||||
ds->ops = &mv88e6xxx_switch_ops;
|
||||
ds->ageing_time_min = chip->info->age_time_coeff;
|
||||
ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX;
|
||||
|
@ -27,7 +27,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
#include <linux/serial_core.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/tty_flip.h>
|
||||
@@ -2420,6 +2422,54 @@ static struct uart_driver lpuart_reg = {
|
||||
@@ -2426,6 +2428,54 @@ static struct uart_driver lpuart_reg = {
|
||||
.cons = LPUART_CONSOLE,
|
||||
};
|
||||
|
||||
@ -82,7 +82,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
static int lpuart_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct of_device_id *of_id = of_match_device(lpuart_dt_ids,
|
||||
@@ -2457,6 +2507,10 @@ static int lpuart_probe(struct platform_
|
||||
@@ -2463,6 +2513,10 @@ static int lpuart_probe(struct platform_
|
||||
|
||||
sport->port.rs485_config = lpuart_config_rs485;
|
||||
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
#include <linux/serial_core.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/tty_flip.h>
|
||||
@@ -1572,8 +1573,17 @@ static void lpuart32_configure(struct lp
|
||||
@@ -1578,8 +1579,17 @@ static void lpuart32_configure(struct lp
|
||||
static int lpuart32_startup(struct uart_port *port)
|
||||
{
|
||||
struct lpuart_port *sport = container_of(port, struct lpuart_port, port);
|
||||
|
@ -12,7 +12,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
--- a/drivers/tty/serial/fsl_lpuart.c
|
||||
+++ b/drivers/tty/serial/fsl_lpuart.c
|
||||
@@ -928,7 +928,12 @@ static void lpuart32_rxint(struct lpuart
|
||||
@@ -934,7 +934,12 @@ static void lpuart32_rxint(struct lpuart
|
||||
*/
|
||||
sr = lpuart32_read(&sport->port, UARTSTAT);
|
||||
rx = lpuart32_read(&sport->port, UARTDATA);
|
||||
|
@ -124,7 +124,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
static inline bool is_layerscape_lpuart(struct lpuart_port *sport)
|
||||
{
|
||||
@@ -1008,19 +1031,15 @@ static irqreturn_t lpuart32_int(int irq,
|
||||
@@ -1014,19 +1037,15 @@ static irqreturn_t lpuart32_int(int irq,
|
||||
if ((sts & UARTSTAT_TDRE) && !sport->lpuart_dma_tx_use)
|
||||
lpuart32_txint(sport);
|
||||
|
||||
@ -148,7 +148,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
if (lpuart_is_32(sport)) {
|
||||
unsigned long sr = lpuart32_read(&sport->port, UARTSTAT);
|
||||
|
||||
@@ -1072,8 +1091,21 @@ static void lpuart_copy_rx_to_tty(struct
|
||||
@@ -1078,8 +1097,21 @@ static void lpuart_copy_rx_to_tty(struct
|
||||
writeb(cr2, sport->port.membase + UARTCR2);
|
||||
}
|
||||
}
|
||||
@ -171,7 +171,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
spin_lock_irqsave(&sport->port.lock, flags);
|
||||
|
||||
@@ -1136,7 +1168,33 @@ static void lpuart_copy_rx_to_tty(struct
|
||||
@@ -1142,7 +1174,33 @@ static void lpuart_copy_rx_to_tty(struct
|
||||
spin_unlock_irqrestore(&sport->port.lock, flags);
|
||||
|
||||
tty_flip_buffer_push(port);
|
||||
@ -206,7 +206,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
}
|
||||
|
||||
static void lpuart_dma_rx_complete(void *arg)
|
||||
@@ -1144,6 +1202,8 @@ static void lpuart_dma_rx_complete(void
|
||||
@@ -1150,6 +1208,8 @@ static void lpuart_dma_rx_complete(void
|
||||
struct lpuart_port *sport = arg;
|
||||
|
||||
lpuart_copy_rx_to_tty(sport);
|
||||
@ -215,7 +215,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
}
|
||||
|
||||
static void lpuart_timer_func(struct timer_list *t)
|
||||
@@ -1151,13 +1211,78 @@ static void lpuart_timer_func(struct tim
|
||||
@@ -1157,13 +1217,78 @@ static void lpuart_timer_func(struct tim
|
||||
struct lpuart_port *sport = from_timer(sport, t, lpuart_timer);
|
||||
|
||||
lpuart_copy_rx_to_tty(sport);
|
||||
@ -298,7 +298,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
int bits, baud;
|
||||
struct tty_port *port = &sport->port.state->port;
|
||||
struct tty_struct *tty = port->tty;
|
||||
@@ -1177,6 +1302,18 @@ static inline int lpuart_start_rx_dma(st
|
||||
@@ -1183,6 +1308,18 @@ static inline int lpuart_start_rx_dma(st
|
||||
sport->rx_dma_rng_buf_len = (1 << (fls(sport->rx_dma_rng_buf_len) - 1));
|
||||
if (sport->rx_dma_rng_buf_len < 16)
|
||||
sport->rx_dma_rng_buf_len = 16;
|
||||
@ -317,7 +317,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
ring->buf = kzalloc(sport->rx_dma_rng_buf_len, GFP_ATOMIC);
|
||||
if (!ring->buf)
|
||||
@@ -1202,32 +1339,7 @@ static inline int lpuart_start_rx_dma(st
|
||||
@@ -1208,32 +1345,7 @@ static inline int lpuart_start_rx_dma(st
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
}
|
||||
|
||||
static void lpuart_dma_rx_free(struct uart_port *port)
|
||||
@@ -1433,8 +1545,10 @@ static void lpuart_setup_watermark(struc
|
||||
@@ -1439,8 +1551,10 @@ static void lpuart_setup_watermark(struc
|
||||
writeb(UARTSFIFO_RXUF, sport->port.membase + UARTSFIFO);
|
||||
}
|
||||
|
||||
@ -363,7 +363,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
/* Restore cr2 */
|
||||
writeb(cr2_saved, sport->port.membase + UARTCR2);
|
||||
@@ -1455,6 +1569,7 @@ static void lpuart32_setup_watermark(str
|
||||
@@ -1461,6 +1575,7 @@ static void lpuart32_setup_watermark(str
|
||||
{
|
||||
unsigned long val, ctrl;
|
||||
unsigned long ctrl_saved;
|
||||
@ -371,7 +371,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
ctrl = lpuart32_read(&sport->port, UARTCTRL);
|
||||
ctrl_saved = ctrl;
|
||||
@@ -1466,12 +1581,26 @@ static void lpuart32_setup_watermark(str
|
||||
@@ -1472,12 +1587,26 @@ static void lpuart32_setup_watermark(str
|
||||
val = lpuart32_read(&sport->port, UARTFIFO);
|
||||
val |= UARTFIFO_TXFE | UARTFIFO_RXFE;
|
||||
val |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH;
|
||||
@ -399,7 +399,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
/* Restore cr2 */
|
||||
lpuart32_write(&sport->port, ctrl_saved, UARTCTRL);
|
||||
}
|
||||
@@ -1483,17 +1612,29 @@ static void lpuart32_setup_watermark_ena
|
||||
@@ -1489,17 +1618,29 @@ static void lpuart32_setup_watermark_ena
|
||||
lpuart32_setup_watermark(sport);
|
||||
|
||||
temp = lpuart32_read(&sport->port, UARTCTRL);
|
||||
@ -430,7 +430,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
static void lpuart_tx_dma_startup(struct lpuart_port *sport)
|
||||
{
|
||||
u32 uartbaud;
|
||||
@@ -1557,19 +1698,23 @@ static int lpuart_startup(struct uart_po
|
||||
@@ -1563,19 +1704,23 @@ static int lpuart_startup(struct uart_po
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -461,7 +461,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
if (!sport->lpuart_dma_tx_use)
|
||||
temp |= UARTCTRL_TIE;
|
||||
lpuart32_write(&sport->port, temp, UARTCTRL);
|
||||
@@ -1613,12 +1758,12 @@ static int lpuart32_startup(struct uart_
|
||||
@@ -1619,12 +1764,12 @@ static int lpuart32_startup(struct uart_
|
||||
|
||||
spin_lock_irqsave(&sport->port.lock, flags);
|
||||
|
||||
@ -476,7 +476,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
lpuart32_configure(sport);
|
||||
|
||||
spin_unlock_irqrestore(&sport->port.lock, flags);
|
||||
@@ -1628,7 +1773,7 @@ static int lpuart32_startup(struct uart_
|
||||
@@ -1634,7 +1779,7 @@ static int lpuart32_startup(struct uart_
|
||||
static void lpuart_dma_shutdown(struct lpuart_port *sport)
|
||||
{
|
||||
if (sport->lpuart_dma_rx_use) {
|
||||
@ -485,7 +485,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
lpuart_dma_rx_free(&sport->port);
|
||||
sport->lpuart_dma_rx_use = false;
|
||||
}
|
||||
@@ -1671,11 +1816,22 @@ static void lpuart32_shutdown(struct uar
|
||||
@@ -1677,11 +1822,22 @@ static void lpuart32_shutdown(struct uar
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
|
||||
@ -510,7 +510,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
|
||||
@@ -1772,10 +1928,10 @@ lpuart_set_termios(struct uart_port *por
|
||||
@@ -1778,10 +1934,10 @@ lpuart_set_termios(struct uart_port *por
|
||||
* baud rate and restart Rx DMA path.
|
||||
*
|
||||
* Since timer function acqures sport->port.lock, need to stop before
|
||||
@ -523,7 +523,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
lpuart_dma_rx_free(&sport->port);
|
||||
}
|
||||
|
||||
@@ -1987,10 +2143,10 @@ lpuart32_set_termios(struct uart_port *p
|
||||
@@ -1993,10 +2149,10 @@ lpuart32_set_termios(struct uart_port *p
|
||||
* baud rate and restart Rx DMA path.
|
||||
*
|
||||
* Since timer function acqures sport->port.lock, need to stop before
|
||||
@ -536,7 +536,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
lpuart_dma_rx_free(&sport->port);
|
||||
}
|
||||
|
||||
@@ -2509,6 +2665,10 @@ static int lpuart_probe(struct platform_
|
||||
@@ -2515,6 +2671,10 @@ static int lpuart_probe(struct platform_
|
||||
sport->port.dev = &pdev->dev;
|
||||
sport->port.type = PORT_LPUART;
|
||||
sport->devtype = sdata->devtype;
|
||||
@ -547,7 +547,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
ret = platform_get_irq(pdev, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -2659,7 +2819,7 @@ static int lpuart_suspend(struct device
|
||||
@@ -2665,7 +2825,7 @@ static int lpuart_suspend(struct device
|
||||
* Rx DMA path before suspend and start Rx DMA path on resume.
|
||||
*/
|
||||
if (irq_wake) {
|
||||
|
@ -12,7 +12,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
--- a/drivers/tty/serial/fsl_lpuart.c
|
||||
+++ b/drivers/tty/serial/fsl_lpuart.c
|
||||
@@ -1474,6 +1474,14 @@ static void lpuart32_set_mctrl(struct ua
|
||||
@@ -1480,6 +1480,14 @@ static void lpuart32_set_mctrl(struct ua
|
||||
temp |= UARTMODIR_TXCTSE;
|
||||
|
||||
lpuart32_write(port, temp, UARTMODIR);
|
||||
|
@ -105,7 +105,7 @@ Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
|
||||
static void lpuart_stop_tx(struct uart_port *port)
|
||||
{
|
||||
unsigned char temp;
|
||||
@@ -2752,6 +2794,10 @@ static int lpuart_probe(struct platform_
|
||||
@@ -2758,6 +2800,10 @@ static int lpuart_probe(struct platform_
|
||||
if (ret)
|
||||
goto failed_attach_port;
|
||||
|
||||
@ -116,7 +116,7 @@ Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
|
||||
uart_get_rs485_mode(&pdev->dev, &sport->port.rs485);
|
||||
|
||||
if (sport->port.rs485.flags & SER_RS485_RX_DURING_TX)
|
||||
@@ -2775,6 +2821,8 @@ static int lpuart_probe(struct platform_
|
||||
@@ -2781,6 +2827,8 @@ static int lpuart_probe(struct platform_
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -43,7 +43,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
/* return TIOCSER_TEMT when transmitter is not busy */
|
||||
static unsigned int lpuart_tx_empty(struct uart_port *port)
|
||||
{
|
||||
@@ -2309,6 +2324,7 @@ static const struct uart_ops lpuart_pops
|
||||
@@ -2315,6 +2330,7 @@ static const struct uart_ops lpuart_pops
|
||||
.break_ctl = lpuart_break_ctl,
|
||||
.startup = lpuart_startup,
|
||||
.shutdown = lpuart_shutdown,
|
||||
@ -51,7 +51,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
.set_termios = lpuart_set_termios,
|
||||
.type = lpuart_type,
|
||||
.request_port = lpuart_request_port,
|
||||
@@ -2333,6 +2349,7 @@ static const struct uart_ops lpuart32_po
|
||||
@@ -2339,6 +2355,7 @@ static const struct uart_ops lpuart32_po
|
||||
.break_ctl = lpuart32_break_ctl,
|
||||
.startup = lpuart32_startup,
|
||||
.shutdown = lpuart32_shutdown,
|
||||
@ -59,7 +59,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
.set_termios = lpuart32_set_termios,
|
||||
.type = lpuart_type,
|
||||
.request_port = lpuart_request_port,
|
||||
@@ -2790,6 +2807,11 @@ static int lpuart_probe(struct platform_
|
||||
@@ -2796,6 +2813,11 @@ static int lpuart_probe(struct platform_
|
||||
if (ret)
|
||||
goto failed_irq_request;
|
||||
|
||||
@ -71,7 +71,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
ret = uart_add_one_port(&lpuart_reg, &sport->port);
|
||||
if (ret)
|
||||
goto failed_attach_port;
|
||||
@@ -2824,6 +2846,9 @@ static int lpuart_probe(struct platform_
|
||||
@@ -2830,6 +2852,9 @@ static int lpuart_probe(struct platform_
|
||||
failed_reset:
|
||||
uart_remove_one_port(&lpuart_reg, &sport->port);
|
||||
failed_attach_port:
|
||||
@ -81,7 +81,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
failed_irq_request:
|
||||
lpuart_disable_clks(sport);
|
||||
return ret;
|
||||
@@ -2843,15 +2868,41 @@ static int lpuart_remove(struct platform
|
||||
@@ -2849,15 +2874,41 @@ static int lpuart_remove(struct platform
|
||||
if (sport->dma_rx_chan)
|
||||
dma_release_channel(sport->dma_rx_chan);
|
||||
|
||||
@ -123,7 +123,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
|
||||
if (lpuart_is_32(sport)) {
|
||||
/* disable Rx/Tx and interrupts */
|
||||
@@ -2865,10 +2916,14 @@ static int lpuart_suspend(struct device
|
||||
@@ -2871,10 +2922,14 @@ static int lpuart_suspend(struct device
|
||||
writeb(temp, sport->port.membase + UARTCR2);
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
|
||||
if (sport->lpuart_dma_rx_use) {
|
||||
/*
|
||||
@@ -2899,9 +2954,6 @@ static int lpuart_suspend(struct device
|
||||
@@ -2905,9 +2960,6 @@ static int lpuart_suspend(struct device
|
||||
dmaengine_terminate_all(sport->dma_tx_chan);
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2909,9 +2961,11 @@ static int lpuart_resume(struct device *
|
||||
@@ -2915,9 +2967,11 @@ static int lpuart_resume(struct device *
|
||||
{
|
||||
struct lpuart_port *sport = dev_get_drvdata(dev);
|
||||
bool irq_wake = irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq));
|
||||
@ -162,7 +162,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
|
||||
if (lpuart_is_32(sport))
|
||||
lpuart32_setup_watermark_enable(sport);
|
||||
@@ -2932,13 +2986,23 @@ static int lpuart_resume(struct device *
|
||||
@@ -2938,13 +2992,23 @@ static int lpuart_resume(struct device *
|
||||
if (lpuart_is_32(sport))
|
||||
lpuart32_configure(sport);
|
||||
|
||||
@ -188,7 +188,7 @@ Reviewed-by: Robin Gong <yibin.gong@nxp.com>
|
||||
|
||||
static struct platform_driver lpuart_driver = {
|
||||
.probe = lpuart_probe,
|
||||
@@ -2946,7 +3010,7 @@ static struct platform_driver lpuart_dri
|
||||
@@ -2952,7 +3016,7 @@ static struct platform_driver lpuart_dri
|
||||
.driver = {
|
||||
.name = "fsl-lpuart",
|
||||
.of_match_table = lpuart_dt_ids,
|
||||
|
@ -28,7 +28,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
#include <linux/pm_domain.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/reset.h>
|
||||
@@ -1739,10 +1740,23 @@ static void lpuart_rx_dma_startup(struct
|
||||
@@ -1745,10 +1746,23 @@ static void lpuart_rx_dma_startup(struct
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
unsigned char temp;
|
||||
|
||||
/* determine FIFO size and enable FIFO mode */
|
||||
@@ -1755,14 +1769,7 @@ static int lpuart_startup(struct uart_po
|
||||
@@ -1761,14 +1775,7 @@ static int lpuart_startup(struct uart_po
|
||||
sport->rxfifo_size = UARTFIFO_DEPTH((temp >> UARTPFIFO_RXSIZE_OFF) &
|
||||
UARTPFIFO_FIFOSIZE_MASK);
|
||||
|
||||
@ -69,7 +69,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1789,11 +1796,27 @@ static void lpuart32_configure(struct lp
|
||||
@@ -1795,11 +1802,27 @@ static void lpuart32_configure(struct lp
|
||||
lpuart32_write(&sport->port, temp, UARTCTRL);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
unsigned long temp;
|
||||
int ret;
|
||||
|
||||
@@ -1825,17 +1848,8 @@ static int lpuart32_startup(struct uart_
|
||||
@@ -1831,17 +1854,8 @@ static int lpuart32_startup(struct uart_
|
||||
sport->port.fifosize = sport->txfifo_size;
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2893,108 +2907,205 @@ static int lpuart_runtime_resume(struct
|
||||
@@ -2899,108 +2913,205 @@ static int lpuart_runtime_resume(struct
|
||||
return lpuart_enable_clks(sport);
|
||||
};
|
||||
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
--- a/drivers/tty/serial/fsl_lpuart.c
|
||||
+++ b/drivers/tty/serial/fsl_lpuart.c
|
||||
@@ -2154,11 +2154,12 @@ lpuart32_set_termios(struct uart_port *p
|
||||
@@ -2160,11 +2160,12 @@ lpuart32_set_termios(struct uart_port *p
|
||||
{
|
||||
struct lpuart_port *sport = container_of(port, struct lpuart_port, port);
|
||||
unsigned long flags;
|
||||
@ -28,7 +28,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
modem = lpuart32_read(&sport->port, UARTMODIR);
|
||||
/*
|
||||
* only support CS8 and CS7, and for CS7 must enable PE.
|
||||
@@ -2195,7 +2196,9 @@ lpuart32_set_termios(struct uart_port *p
|
||||
@@ -2201,7 +2202,9 @@ lpuart32_set_termios(struct uart_port *p
|
||||
}
|
||||
|
||||
if (termios->c_cflag & CSTOPB)
|
||||
@ -39,7 +39,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
||||
|
||||
/* parity must be enabled when CS7 to match 8-bits format */
|
||||
if ((termios->c_cflag & CSIZE) == CS7)
|
||||
@@ -2272,6 +2275,7 @@ lpuart32_set_termios(struct uart_port *p
|
||||
@@ -2278,6 +2281,7 @@ lpuart32_set_termios(struct uart_port *p
|
||||
lpuart32_write(&sport->port, old_ctrl & ~(UARTCTRL_TE | UARTCTRL_RE),
|
||||
UARTCTRL);
|
||||
|
||||
|
@ -24,7 +24,7 @@ Signed-off-by: Peng Fan <peng.fan@nxp.com>
|
||||
|
||||
--- a/drivers/tty/serial/fsl_lpuart.c
|
||||
+++ b/drivers/tty/serial/fsl_lpuart.c
|
||||
@@ -2643,7 +2643,9 @@ static int __init lpuart32_early_console
|
||||
@@ -2649,7 +2649,9 @@ static int __init lpuart32_early_console
|
||||
if (!device->port.membase)
|
||||
return -ENODEV;
|
||||
|
||||
|
@ -174,7 +174,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com>
|
||||
* bursts that are required to move all packets in this TD. Only SuperSpeed
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -5430,6 +5430,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
@@ -5434,6 +5434,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
.disable_usb3_lpm_timeout = xhci_disable_usb3_lpm_timeout,
|
||||
.find_raw_port_number = xhci_find_raw_port_number,
|
||||
.clear_tt_buffer_complete = xhci_clear_tt_buffer_complete,
|
||||
|
@ -21,7 +21,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com>
|
||||
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -195,7 +195,7 @@ int xhci_reset(struct xhci_hcd *xhci, u6
|
||||
@@ -196,7 +196,7 @@ int xhci_reset(struct xhci_hcd *xhci, u6
|
||||
* Without this delay, the subsequent HC register access,
|
||||
* may result in a system hang very rarely.
|
||||
*/
|
||||
|
@ -24,7 +24,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com>
|
||||
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -5453,6 +5453,8 @@ void xhci_init_driver(struct hc_driver *
|
||||
@@ -5457,6 +5457,8 @@ void xhci_init_driver(struct hc_driver *
|
||||
drv->reset_bandwidth = over->reset_bandwidth;
|
||||
if (over->update_hub_device)
|
||||
drv->update_hub_device = over->update_hub_device;
|
||||
|
@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
when making changes to the MAC configuration. This means the
|
||||
--- a/drivers/net/ethernet/marvell/mvneta.c
|
||||
+++ b/drivers/net/ethernet/marvell/mvneta.c
|
||||
@@ -3655,9 +3655,11 @@ static void mvneta_mac_link_down(struct
|
||||
@@ -3675,9 +3675,11 @@ static void mvneta_mac_link_down(struct
|
||||
mvneta_set_eee(pp, false);
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/marvell/mvneta.c
|
||||
+++ b/drivers/net/ethernet/marvell/mvneta.c
|
||||
@@ -1913,6 +1913,23 @@ static void mvneta_rxq_drop_pkts(struct
|
||||
@@ -1925,6 +1925,23 @@ static void mvneta_rxq_drop_pkts(struct
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static inline
|
||||
int mvneta_rx_refill_queue(struct mvneta_port *pp, struct mvneta_rx_queue *rxq)
|
||||
{
|
||||
@@ -2093,14 +2110,8 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
@@ -2105,14 +2122,8 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
rxq->left_size = 0;
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
/* return some buffers to hardware queue, one at a time is too slow */
|
||||
refill = mvneta_rx_refill_queue(pp, rxq);
|
||||
@@ -2223,14 +2234,8 @@ err_drop_frame:
|
||||
@@ -2235,14 +2246,8 @@ err_drop_frame:
|
||||
napi_gro_receive(napi, skb);
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
/* Update rxq management counters */
|
||||
mvneta_rxq_desc_num_update(pp, rxq, rx_done, rx_done);
|
||||
@@ -2476,7 +2481,6 @@ static netdev_tx_t mvneta_tx(struct sk_b
|
||||
@@ -2497,7 +2502,6 @@ static netdev_tx_t mvneta_tx(struct sk_b
|
||||
|
||||
out:
|
||||
if (frags > 0) {
|
||||
@ -81,7 +81,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id);
|
||||
|
||||
netdev_tx_sent_queue(nq, len);
|
||||
@@ -2491,10 +2495,7 @@ out:
|
||||
@@ -2512,10 +2516,7 @@ out:
|
||||
else
|
||||
txq->pending += frags;
|
||||
|
||||
|
@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
/* Registers */
|
||||
#define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2))
|
||||
@@ -607,6 +608,10 @@ struct mvneta_rx_queue {
|
||||
@@ -621,6 +622,10 @@ struct mvneta_rx_queue {
|
||||
u32 pkts_coal;
|
||||
u32 time_coal;
|
||||
|
||||
@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
/* Virtual address of the RX buffer */
|
||||
void **buf_virt_addr;
|
||||
|
||||
@@ -1825,23 +1830,21 @@ static int mvneta_rx_refill(struct mvnet
|
||||
@@ -1837,23 +1842,21 @@ static int mvneta_rx_refill(struct mvnet
|
||||
struct mvneta_rx_queue *rxq,
|
||||
gfp_t gfp_mask)
|
||||
{
|
||||
@ -86,7 +86,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1907,10 +1910,12 @@ static void mvneta_rxq_drop_pkts(struct
|
||||
@@ -1919,10 +1922,12 @@ static void mvneta_rxq_drop_pkts(struct
|
||||
if (!data || !(rx_desc->buf_phys_addr))
|
||||
continue;
|
||||
|
||||
@ -102,7 +102,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2047,8 +2052,7 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
@@ -2059,8 +2064,7 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
skb_add_rx_frag(rxq->skb, frag_num, page,
|
||||
frag_offset, frag_size,
|
||||
PAGE_SIZE);
|
||||
@ -112,7 +112,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
rxq->left_size -= frag_size;
|
||||
}
|
||||
} else {
|
||||
@@ -2078,9 +2082,7 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
@@ -2090,9 +2094,7 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
frag_offset, frag_size,
|
||||
PAGE_SIZE);
|
||||
|
||||
@ -123,7 +123,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
rxq->left_size -= frag_size;
|
||||
}
|
||||
} /* Middle or Last descriptor */
|
||||
@@ -2847,11 +2849,54 @@ static int mvneta_poll(struct napi_struc
|
||||
@@ -2868,11 +2870,54 @@ static int mvneta_poll(struct napi_struc
|
||||
return rx_done;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
#define IS_TSO_HEADER(txq, addr) \
|
||||
((addr >= txq->tso_hdrs_phys) && \
|
||||
(addr < txq->tso_hdrs_phys + txq->size * TSO_HEADER_SIZE))
|
||||
@@ -650,7 +655,6 @@ static int txq_number = 8;
|
||||
@@ -664,7 +669,6 @@ static int txq_number = 8;
|
||||
static int rxq_def;
|
||||
|
||||
static int rx_copybreak __read_mostly = 256;
|
||||
@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
/* HW BM need that each port be identify by a unique ID */
|
||||
static int global_port_id;
|
||||
@@ -1842,7 +1846,7 @@ static int mvneta_rx_refill(struct mvnet
|
||||
@@ -1854,7 +1858,7 @@ static int mvneta_rx_refill(struct mvnet
|
||||
phys_addr = page_pool_get_dma_addr(page) + pp->rx_offset_correction;
|
||||
dma_dir = page_pool_get_dma_dir(rxq->page_pool);
|
||||
dma_sync_single_for_device(pp->dev->dev.parent, phys_addr,
|
||||
@ -56,7 +56,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
mvneta_rx_desc_fill(rx_desc, phys_addr, page, rxq);
|
||||
|
||||
return 0;
|
||||
@@ -1960,30 +1964,102 @@ int mvneta_rx_refill_queue(struct mvneta
|
||||
@@ -1972,30 +1976,102 @@ int mvneta_rx_refill_queue(struct mvneta
|
||||
return i;
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
index = rx_desc - rxq->descs;
|
||||
page = (struct page *)rxq->buf_virt_addr[index];
|
||||
@@ -1991,100 +2067,30 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
@@ -2003,100 +2079,30 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
/* Prefetch header */
|
||||
prefetch(data);
|
||||
|
||||
@ -275,7 +275,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
} /* Middle or Last descriptor */
|
||||
|
||||
if (!(rx_status & MVNETA_RXD_LAST_DESC))
|
||||
@@ -2109,7 +2115,6 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
@@ -2121,7 +2127,6 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
|
||||
/* clean uncomplete skb pointer in queue */
|
||||
rxq->skb = NULL;
|
||||
@ -283,7 +283,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
}
|
||||
|
||||
if (rcvd_pkts)
|
||||
@@ -2970,7 +2975,7 @@ static void mvneta_rxq_hw_init(struct mv
|
||||
@@ -2991,7 +2996,7 @@ static void mvneta_rxq_hw_init(struct mv
|
||||
/* Set Offset */
|
||||
mvneta_rxq_offset_set(pp, rxq, 0);
|
||||
mvneta_rxq_buf_size_set(pp, rxq, PAGE_SIZE < SZ_64K ?
|
||||
@ -292,7 +292,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
MVNETA_RX_BUF_SIZE(pp->pkt_size));
|
||||
mvneta_rxq_bm_disable(pp, rxq);
|
||||
mvneta_rxq_fill(pp, rxq, rxq->size);
|
||||
@@ -4715,7 +4720,7 @@ static int mvneta_probe(struct platform_
|
||||
@@ -4735,7 +4740,7 @@ static int mvneta_probe(struct platform_
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
|
||||
pp->id = global_port_id++;
|
||||
|
@ -75,7 +75,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
/* Core clock */
|
||||
struct clk *clk;
|
||||
/* AXI clock */
|
||||
@@ -1965,10 +1975,50 @@ int mvneta_rx_refill_queue(struct mvneta
|
||||
@@ -1977,10 +1987,50 @@ int mvneta_rx_refill_queue(struct mvneta
|
||||
}
|
||||
|
||||
static int
|
||||
@ -127,7 +127,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
{
|
||||
unsigned char *data = page_address(page);
|
||||
int data_len = -MVNETA_MH_SIZE, len;
|
||||
@@ -1988,7 +2038,26 @@ mvneta_swbm_rx_frame(struct mvneta_port
|
||||
@@ -2000,7 +2050,26 @@ mvneta_swbm_rx_frame(struct mvneta_port
|
||||
rx_desc->buf_phys_addr,
|
||||
len, dma_dir);
|
||||
|
||||
@ -155,7 +155,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if (unlikely(!rxq->skb)) {
|
||||
netdev_err(dev,
|
||||
"Can't allocate skb on queue %d\n",
|
||||
@@ -1999,8 +2068,9 @@ mvneta_swbm_rx_frame(struct mvneta_port
|
||||
@@ -2011,8 +2080,9 @@ mvneta_swbm_rx_frame(struct mvneta_port
|
||||
}
|
||||
page_pool_release_page(rxq->page_pool, page);
|
||||
|
||||
@ -167,7 +167,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
mvneta_rx_csum(pp, rx_desc->status, rxq->skb);
|
||||
|
||||
rxq->left_size = rx_desc->data_size - len;
|
||||
@@ -2034,7 +2104,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet
|
||||
@@ -2046,7 +2116,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet
|
||||
/* refill descriptor with new buffer later */
|
||||
skb_add_rx_frag(rxq->skb,
|
||||
skb_shinfo(rxq->skb)->nr_frags,
|
||||
@ -176,7 +176,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
PAGE_SIZE);
|
||||
}
|
||||
page_pool_release_page(rxq->page_pool, page);
|
||||
@@ -2049,11 +2119,18 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
@@ -2061,11 +2131,18 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
{
|
||||
int rcvd_pkts = 0, rcvd_bytes = 0, rx_proc = 0;
|
||||
struct net_device *dev = pp->dev;
|
||||
@ -195,7 +195,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
/* Fairness NAPI loop */
|
||||
while (rx_proc < budget && rx_proc < rx_todo) {
|
||||
struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
|
||||
@@ -2081,7 +2158,8 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
@@ -2093,7 +2170,8 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if (err)
|
||||
continue;
|
||||
} else {
|
||||
@@ -2116,6 +2194,10 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
@@ -2128,6 +2206,10 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
/* clean uncomplete skb pointer in queue */
|
||||
rxq->skb = NULL;
|
||||
}
|
||||
@ -216,7 +216,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
if (rcvd_pkts)
|
||||
mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false);
|
||||
@@ -2857,13 +2939,14 @@ static int mvneta_poll(struct napi_struc
|
||||
@@ -2878,13 +2960,14 @@ static int mvneta_poll(struct napi_struc
|
||||
static int mvneta_create_page_pool(struct mvneta_port *pp,
|
||||
struct mvneta_rx_queue *rxq, int size)
|
||||
{
|
||||
@ -232,7 +232,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
int err;
|
||||
|
||||
@@ -3366,6 +3449,11 @@ static int mvneta_change_mtu(struct net_
|
||||
@@ -3386,6 +3469,11 @@ static int mvneta_change_mtu(struct net_
|
||||
mtu = ALIGN(MVNETA_RX_PKT_SIZE(mtu), 8);
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
dev->mtu = mtu;
|
||||
|
||||
if (!netif_running(dev)) {
|
||||
@@ -4036,6 +4124,47 @@ static int mvneta_ioctl(struct net_devic
|
||||
@@ -4056,6 +4144,47 @@ static int mvneta_ioctl(struct net_devic
|
||||
return phylink_mii_ioctl(pp->phylink, ifr, cmd);
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
/* Ethtool methods */
|
||||
|
||||
/* Set link ksettings (phy address, speed) for ethtools */
|
||||
@@ -4432,6 +4561,7 @@ static const struct net_device_ops mvnet
|
||||
@@ -4452,6 +4581,7 @@ static const struct net_device_ops mvnet
|
||||
.ndo_fix_features = mvneta_fix_features,
|
||||
.ndo_get_stats64 = mvneta_get_stats64,
|
||||
.ndo_do_ioctl = mvneta_ioctl,
|
||||
@ -300,7 +300,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
};
|
||||
|
||||
static const struct ethtool_ops mvneta_eth_tool_ops = {
|
||||
@@ -4720,7 +4850,7 @@ static int mvneta_probe(struct platform_
|
||||
@@ -4740,7 +4870,7 @@ static int mvneta_probe(struct platform_
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
|
||||
pp->id = global_port_id++;
|
||||
|
@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/marvell/mvneta.c
|
||||
+++ b/drivers/net/ethernet/marvell/mvneta.c
|
||||
@@ -2038,6 +2038,9 @@ mvneta_swbm_rx_frame(struct mvneta_port
|
||||
@@ -2050,6 +2050,9 @@ mvneta_swbm_rx_frame(struct mvneta_port
|
||||
rx_desc->buf_phys_addr,
|
||||
len, dma_dir);
|
||||
|
||||
@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
xdp->data_hard_start = data;
|
||||
xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE;
|
||||
xdp->data_end = xdp->data + data_len;
|
||||
@@ -2135,14 +2138,10 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
@@ -2147,14 +2150,10 @@ static int mvneta_rx_swbm(struct napi_st
|
||||
while (rx_proc < budget && rx_proc < rx_todo) {
|
||||
struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
|
||||
u32 rx_status, index;
|
||||
|
@ -1,210 +0,0 @@
|
||||
From 9e58c8b410650b5a6eb5b8fad8474bd8425a4023 Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Sat, 19 Oct 2019 10:13:26 +0200
|
||||
Subject: [PATCH 6/7] net: mvneta: make tx buffer array agnostic
|
||||
|
||||
Allow tx buffer array to contain both skb and xdp buffers in order to
|
||||
enable xdp frame recycling adding XDP_TX verdict support
|
||||
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/marvell/mvneta.c | 66 +++++++++++++++++----------
|
||||
1 file changed, 43 insertions(+), 23 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/marvell/mvneta.c
|
||||
+++ b/drivers/net/ethernet/marvell/mvneta.c
|
||||
@@ -565,6 +565,20 @@ struct mvneta_rx_desc {
|
||||
};
|
||||
#endif
|
||||
|
||||
+enum mvneta_tx_buf_type {
|
||||
+ MVNETA_TYPE_SKB,
|
||||
+ MVNETA_TYPE_XDP_TX,
|
||||
+ MVNETA_TYPE_XDP_NDO,
|
||||
+};
|
||||
+
|
||||
+struct mvneta_tx_buf {
|
||||
+ enum mvneta_tx_buf_type type;
|
||||
+ union {
|
||||
+ struct xdp_frame *xdpf;
|
||||
+ struct sk_buff *skb;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
struct mvneta_tx_queue {
|
||||
/* Number of this TX queue, in the range 0-7 */
|
||||
u8 id;
|
||||
@@ -580,8 +594,8 @@ struct mvneta_tx_queue {
|
||||
int tx_stop_threshold;
|
||||
int tx_wake_threshold;
|
||||
|
||||
- /* Array of transmitted skb */
|
||||
- struct sk_buff **tx_skb;
|
||||
+ /* Array of transmitted buffers */
|
||||
+ struct mvneta_tx_buf *buf;
|
||||
|
||||
/* Index of last TX DMA descriptor that was inserted */
|
||||
int txq_put_index;
|
||||
@@ -1793,14 +1807,9 @@ static void mvneta_txq_bufs_free(struct
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_get_index];
|
||||
struct mvneta_tx_desc *tx_desc = txq->descs +
|
||||
txq->txq_get_index;
|
||||
- struct sk_buff *skb = txq->tx_skb[txq->txq_get_index];
|
||||
-
|
||||
- if (skb) {
|
||||
- bytes_compl += skb->len;
|
||||
- pkts_compl++;
|
||||
- }
|
||||
|
||||
mvneta_txq_inc_get(txq);
|
||||
|
||||
@@ -1808,9 +1817,12 @@ static void mvneta_txq_bufs_free(struct
|
||||
dma_unmap_single(pp->dev->dev.parent,
|
||||
tx_desc->buf_phys_addr,
|
||||
tx_desc->data_size, DMA_TO_DEVICE);
|
||||
- if (!skb)
|
||||
+ if (!buf->skb)
|
||||
continue;
|
||||
- dev_kfree_skb_any(skb);
|
||||
+
|
||||
+ bytes_compl += buf->skb->len;
|
||||
+ pkts_compl++;
|
||||
+ dev_kfree_skb_any(buf->skb);
|
||||
}
|
||||
|
||||
netdev_tx_completed_queue(nq, pkts_compl, bytes_compl);
|
||||
@@ -2335,16 +2347,19 @@ static inline void
|
||||
mvneta_tso_put_hdr(struct sk_buff *skb,
|
||||
struct mvneta_port *pp, struct mvneta_tx_queue *txq)
|
||||
{
|
||||
- struct mvneta_tx_desc *tx_desc;
|
||||
int hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
|
||||
+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index];
|
||||
+ struct mvneta_tx_desc *tx_desc;
|
||||
|
||||
- txq->tx_skb[txq->txq_put_index] = NULL;
|
||||
tx_desc = mvneta_txq_next_desc_get(txq);
|
||||
tx_desc->data_size = hdr_len;
|
||||
tx_desc->command = mvneta_skb_tx_csum(pp, skb);
|
||||
tx_desc->command |= MVNETA_TXD_F_DESC;
|
||||
tx_desc->buf_phys_addr = txq->tso_hdrs_phys +
|
||||
txq->txq_put_index * TSO_HEADER_SIZE;
|
||||
+ buf->type = MVNETA_TYPE_SKB;
|
||||
+ buf->skb = NULL;
|
||||
+
|
||||
mvneta_txq_inc_put(txq);
|
||||
}
|
||||
|
||||
@@ -2353,6 +2368,7 @@ mvneta_tso_put_data(struct net_device *d
|
||||
struct sk_buff *skb, char *data, int size,
|
||||
bool last_tcp, bool is_last)
|
||||
{
|
||||
+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index];
|
||||
struct mvneta_tx_desc *tx_desc;
|
||||
|
||||
tx_desc = mvneta_txq_next_desc_get(txq);
|
||||
@@ -2366,7 +2382,8 @@ mvneta_tso_put_data(struct net_device *d
|
||||
}
|
||||
|
||||
tx_desc->command = 0;
|
||||
- txq->tx_skb[txq->txq_put_index] = NULL;
|
||||
+ buf->type = MVNETA_TYPE_SKB;
|
||||
+ buf->skb = NULL;
|
||||
|
||||
if (last_tcp) {
|
||||
/* last descriptor in the TCP packet */
|
||||
@@ -2374,7 +2391,7 @@ mvneta_tso_put_data(struct net_device *d
|
||||
|
||||
/* last descriptor in SKB */
|
||||
if (is_last)
|
||||
- txq->tx_skb[txq->txq_put_index] = skb;
|
||||
+ buf->skb = skb;
|
||||
}
|
||||
mvneta_txq_inc_put(txq);
|
||||
return 0;
|
||||
@@ -2459,6 +2476,7 @@ static int mvneta_tx_frag_process(struct
|
||||
int i, nr_frags = skb_shinfo(skb)->nr_frags;
|
||||
|
||||
for (i = 0; i < nr_frags; i++) {
|
||||
+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index];
|
||||
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
|
||||
void *addr = skb_frag_address(frag);
|
||||
|
||||
@@ -2478,12 +2496,13 @@ static int mvneta_tx_frag_process(struct
|
||||
if (i == nr_frags - 1) {
|
||||
/* Last descriptor */
|
||||
tx_desc->command = MVNETA_TXD_L_DESC | MVNETA_TXD_Z_PAD;
|
||||
- txq->tx_skb[txq->txq_put_index] = skb;
|
||||
+ buf->skb = skb;
|
||||
} else {
|
||||
/* Descriptor in the middle: Not First, Not Last */
|
||||
tx_desc->command = 0;
|
||||
- txq->tx_skb[txq->txq_put_index] = NULL;
|
||||
+ buf->skb = NULL;
|
||||
}
|
||||
+ buf->type = MVNETA_TYPE_SKB;
|
||||
mvneta_txq_inc_put(txq);
|
||||
}
|
||||
|
||||
@@ -2511,6 +2530,7 @@ static netdev_tx_t mvneta_tx(struct sk_b
|
||||
struct mvneta_port *pp = netdev_priv(dev);
|
||||
u16 txq_id = skb_get_queue_mapping(skb);
|
||||
struct mvneta_tx_queue *txq = &pp->txqs[txq_id];
|
||||
+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index];
|
||||
struct mvneta_tx_desc *tx_desc;
|
||||
int len = skb->len;
|
||||
int frags = 0;
|
||||
@@ -2543,16 +2563,17 @@ static netdev_tx_t mvneta_tx(struct sk_b
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ buf->type = MVNETA_TYPE_SKB;
|
||||
if (frags == 1) {
|
||||
/* First and Last descriptor */
|
||||
tx_cmd |= MVNETA_TXD_FLZ_DESC;
|
||||
tx_desc->command = tx_cmd;
|
||||
- txq->tx_skb[txq->txq_put_index] = skb;
|
||||
+ buf->skb = skb;
|
||||
mvneta_txq_inc_put(txq);
|
||||
} else {
|
||||
/* First but not Last */
|
||||
tx_cmd |= MVNETA_TXD_F_DESC;
|
||||
- txq->tx_skb[txq->txq_put_index] = NULL;
|
||||
+ buf->skb = NULL;
|
||||
mvneta_txq_inc_put(txq);
|
||||
tx_desc->command = tx_cmd;
|
||||
/* Continue with other skb fragments */
|
||||
@@ -3138,9 +3159,8 @@ static int mvneta_txq_sw_init(struct mvn
|
||||
|
||||
txq->last_desc = txq->size - 1;
|
||||
|
||||
- txq->tx_skb = kmalloc_array(txq->size, sizeof(*txq->tx_skb),
|
||||
- GFP_KERNEL);
|
||||
- if (!txq->tx_skb) {
|
||||
+ txq->buf = kmalloc_array(txq->size, sizeof(*txq->buf), GFP_KERNEL);
|
||||
+ if (!txq->buf) {
|
||||
dma_free_coherent(pp->dev->dev.parent,
|
||||
txq->size * MVNETA_DESC_ALIGNED_SIZE,
|
||||
txq->descs, txq->descs_phys);
|
||||
@@ -3152,7 +3172,7 @@ static int mvneta_txq_sw_init(struct mvn
|
||||
txq->size * TSO_HEADER_SIZE,
|
||||
&txq->tso_hdrs_phys, GFP_KERNEL);
|
||||
if (!txq->tso_hdrs) {
|
||||
- kfree(txq->tx_skb);
|
||||
+ kfree(txq->buf);
|
||||
dma_free_coherent(pp->dev->dev.parent,
|
||||
txq->size * MVNETA_DESC_ALIGNED_SIZE,
|
||||
txq->descs, txq->descs_phys);
|
||||
@@ -3207,7 +3227,7 @@ static void mvneta_txq_sw_deinit(struct
|
||||
{
|
||||
struct netdev_queue *nq = netdev_get_tx_queue(pp->dev, txq->id);
|
||||
|
||||
- kfree(txq->tx_skb);
|
||||
+ kfree(txq->buf);
|
||||
|
||||
if (txq->tso_hdrs)
|
||||
dma_free_coherent(pp->dev->dev.parent,
|
Loading…
x
Reference in New Issue
Block a user