kernel: bump 5.15 to 5.15.196

Removed because they are upstream:
   bcm27xx/patches-5.15/950-0119-media-tc358743-Increase-FIFO-level-to-374.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=aef1b717d4a27e72f9c1d1ebe32c6d841a7e69fc

   bcm27xx/patches-5.15/950-0122-media-tc358743-Check-I2C-succeeded-during-probe.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=a6ccbe037734ef20016bc57869a90abc4406ea7e

   bcm27xx/patches-5.15/950-0128-media-tc358743-Return-an-appropriate-colorspace-from.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=21ba26a8e3477998df9f52a519169b4c6764c0b2

   bcm27xx/patches-5.15/950-0278-media-i2c-tc358743-Only-allow-supported-pixel-fmts-i.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=21ba26a8e3477998df9f52a519169b4c6764c0b2

   generic/backport-5.15/895-v6.15-0001-sch_htb-make-htb_qlen_notify-idempotent.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=967955c9e57f8eebfccc298037d4aaf3d42bc1c9

   generic/backport-5.15/895-v6.15-0002-sch_drr-make-drr_qlen_notify-idempotent.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=db568d2151cd20a1e516b0454eda8a11a948e72a

   generic/backport-5.15/895-v6.15-0003-sch_hfsc-make-hfsc_qlen_notify-idempotent.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=a5efc95a33bd4fcb879250852828cc58c7862970

   generic/backport-5.15/895-v6.15-0004-sch_qfq-make-qfq_qlen_notify-idempotent.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=44e2f93f9820a54929ab8cfc6d322a18279bb79b

   generic/backport-5.15/895-v6.15-0005-sch_htb-make-htb_deactivate-idempotent.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=c2d25fddd867ce20a266806634eeeb5c30cb520c

   mediatek/patches-5.15/821-v5.16-pinctrl-mediatek-moore-check-if-pin_desc-is-valid-be.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=4b5022b649abbceb564253fafa9d2c7914d29ee4

Manually adapted:
   bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
   upstream changes to the xhci_free_virt_device():
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=c78c8e5048b7069b6655613ab4e9795a901dbbee
   Fix taken from commit efd444537d. Thanks to Goetz Goerisch.

   generic/backport-5.15/882-v5.19-rndis_host-limit-scope-of-bogus-MAC-address-detectio.patch
   upstream changes to generic_rndis_bind():
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=a6b33d9edf2600bc9647e4f0420714beae6eb329

   lantiq/patches-5.15/0152-lantiq-VPE.patch
   upstream changes to arch/mips/include/asm/vpe.h:
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=90c1295da0a78f3ed00388bb5f569d843b18c03d

Adapt kernel configuration for newly added option
   generic: add CONFIG_RESET_BRCMSTB is not set
   upstream changes to drivers/reset/Kconfig:
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=345df19a971a506813d7a33106e35aac31489e78

   x86: add CONFIG_MITIGATION_VMSCAPE=y
   upstream changes to arch/x86/Kconfig:
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=2f4f2f8f860cb4c3336a7435ebe8dcfded0c9c6e
   (cherry picked from commit 6af8e20b45)

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Link: https://github.com/openwrt/openwrt/pull/21040
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Martin Schiller
2025-12-04 10:23:28 +01:00
committed by Hauke Mehrtens
parent d36411269c
commit 8166bba3fe
205 changed files with 711 additions and 1363 deletions

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .189
LINUX_KERNEL_HASH-5.15.189 = e3d0025b87278e14733cb326700f17c7cceb54d920622b0d5fcd58a88c6850c3
LINUX_VERSION-5.15 = .196
LINUX_KERNEL_HASH-5.15.196 = 83157953598b026fb721c906c60dfdfd8e986f25ecb9910f3504f690e2770e05

View File

@@ -630,7 +630,7 @@ Signed-off-by: Stephen Boyd <sboyd@kernel.org>
static void clk_sam9x5_peripheral_disable(struct clk_hw *hw)
{
struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw);
@@ -393,6 +401,23 @@ static int clk_sam9x5_peripheral_set_rat
@@ -396,6 +404,23 @@ static int clk_sam9x5_peripheral_set_rat
return -EINVAL;
}
@@ -654,7 +654,7 @@ Signed-off-by: Stephen Boyd <sboyd@kernel.org>
static const struct clk_ops sam9x5_peripheral_ops = {
.enable = clk_sam9x5_peripheral_enable,
.disable = clk_sam9x5_peripheral_disable,
@@ -400,6 +425,8 @@ static const struct clk_ops sam9x5_perip
@@ -403,6 +428,8 @@ static const struct clk_ops sam9x5_perip
.recalc_rate = clk_sam9x5_peripheral_recalc_rate,
.round_rate = clk_sam9x5_peripheral_round_rate,
.set_rate = clk_sam9x5_peripheral_set_rate,
@@ -663,7 +663,7 @@ Signed-off-by: Stephen Boyd <sboyd@kernel.org>
};
static const struct clk_ops sam9x5_peripheral_chg_ops = {
@@ -409,6 +436,8 @@ static const struct clk_ops sam9x5_perip
@@ -412,6 +439,8 @@ static const struct clk_ops sam9x5_perip
.recalc_rate = clk_sam9x5_peripheral_recalc_rate,
.determine_rate = clk_sam9x5_peripheral_determine_rate,
.set_rate = clk_sam9x5_peripheral_set_rate,
@@ -672,7 +672,7 @@ Signed-off-by: Stephen Boyd <sboyd@kernel.org>
};
struct clk_hw * __init
@@ -460,7 +489,6 @@ at91_clk_register_sam9x5_peripheral(stru
@@ -463,7 +492,6 @@ at91_clk_register_sam9x5_peripheral(stru
hw = ERR_PTR(ret);
} else {
clk_sam9x5_peripheral_autodiv(periph);

View File

@@ -579,7 +579,7 @@ SVN-Revision: 35130
goto next_ht;
--- a/net/ipv6/ip6_offload.c
+++ b/net/ipv6/ip6_offload.c
@@ -240,7 +240,7 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
@@ -242,7 +242,7 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
continue;
iph2 = (struct ipv6hdr *)(p->data + off);

View File

@@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5889,6 +5889,9 @@ int __init cgroup_init_early(void)
@@ -5912,6 +5912,9 @@ int __init cgroup_init_early(void)
return 0;
}
@@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/**
* cgroup_init - cgroup initialization
*
@@ -5927,6 +5930,12 @@ int __init cgroup_init(void)
@@ -5950,6 +5953,12 @@ int __init cgroup_init(void)
mutex_unlock(&cgroup_mutex);
@@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
for_each_subsys(ss, ssid) {
if (ss->early_init) {
struct cgroup_subsys_state *css =
@@ -6527,6 +6536,10 @@ static int __init cgroup_disable(char *s
@@ -6556,6 +6565,10 @@ static int __init cgroup_disable(char *s
strcmp(token, ss->legacy_name))
continue;
@@ -51,7 +51,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
static_branch_disable(cgroup_subsys_enabled_key[i]);
pr_info("Disabling %s control group subsystem\n",
ss->name);
@@ -6545,6 +6558,31 @@ static int __init cgroup_disable(char *s
@@ -6574,6 +6587,31 @@ static int __init cgroup_disable(char *s
}
__setup("cgroup_disable=", cgroup_disable);

View File

@@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1017,7 +1017,7 @@ int snd_soc_add_pcm_runtime(struct snd_s
@@ -1020,7 +1020,7 @@ int snd_soc_add_pcm_runtime(struct snd_s
for_each_link_cpus(dai_link, i, cpu) {
asoc_rtd_to_cpu(rtd, i) = snd_soc_find_dai(cpu);
if (!asoc_rtd_to_cpu(rtd, i)) {
@@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
cpu->dai_name);
goto _err_defer;
}
@@ -1028,7 +1028,7 @@ int snd_soc_add_pcm_runtime(struct snd_s
@@ -1031,7 +1031,7 @@ int snd_soc_add_pcm_runtime(struct snd_s
for_each_link_codecs(dai_link, i, codec) {
asoc_rtd_to_codec(rtd, i) = snd_soc_find_dai(codec);
if (!asoc_rtd_to_codec(rtd, i)) {

View File

@@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2692,6 +2692,11 @@ static int lan78xx_reset(struct lan78xx_
@@ -2710,6 +2710,11 @@ static int lan78xx_reset(struct lan78xx_
int ret;
u32 buf;
u8 sig;
@@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
ret = lan78xx_read_reg(dev, HW_CFG, &buf);
if (ret < 0)
@@ -2773,6 +2778,10 @@ static int lan78xx_reset(struct lan78xx_
@@ -2793,6 +2798,10 @@ static int lan78xx_reset(struct lan78xx_
buf |= HW_CFG_MEF_;
@@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
ret = lan78xx_write_reg(dev, HW_CFG, buf);
if (ret < 0)
return ret;
@@ -2872,6 +2881,9 @@ static int lan78xx_reset(struct lan78xx_
@@ -2892,6 +2901,9 @@ static int lan78xx_reset(struct lan78xx_
buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_;
}
}

View File

@@ -1123,7 +1123,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
}
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5689,7 +5689,7 @@ static void port_event(struct usb_hub *h
@@ -5721,7 +5721,7 @@ static void port_event(struct usb_hub *h
port_dev->over_current_count++;
port_over_current_notify(port_dev);

View File

@@ -244,7 +244,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
static int bcm2708_fb_register(struct bcm2708_fb *fb)
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -1099,6 +1099,30 @@ fb_blank(struct fb_info *info, int blank
@@ -1098,6 +1098,30 @@ fb_blank(struct fb_info *info, int blank
}
EXPORT_SYMBOL(fb_blank);
@@ -275,7 +275,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{
@@ -1107,6 +1131,7 @@ static long do_fb_ioctl(struct fb_info *
@@ -1106,6 +1130,7 @@ static long do_fb_ioctl(struct fb_info *
struct fb_fix_screeninfo fix;
struct fb_cmap cmap_from;
struct fb_cmap_user cmap;
@@ -283,7 +283,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
void __user *argp = (void __user *)arg;
long ret = 0;
@@ -1186,6 +1211,15 @@ static long do_fb_ioctl(struct fb_info *
@@ -1185,6 +1210,15 @@ static long do_fb_ioctl(struct fb_info *
unlock_fb_info(info);
console_unlock();
break;
@@ -299,7 +299,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
default:
lock_fb_info(info);
fb = info->fbops;
@@ -1325,6 +1359,7 @@ static long fb_compat_ioctl(struct file
@@ -1324,6 +1358,7 @@ static long fb_compat_ioctl(struct file
case FBIOPAN_DISPLAY:
case FBIOGET_CON2FBMAP:
case FBIOPUT_CON2FBMAP:

View File

@@ -16797,7 +16797,7 @@ Signed-off-by: Joerg Schambacher <joerg@hifiberry.com>
+#endif /* _TAS5713_H */
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1234,7 +1234,7 @@ found:
@@ -1237,7 +1237,7 @@ found:
* Returns 0 on success, otherwise a negative error code.
*/
int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
@@ -16806,7 +16806,7 @@ Signed-off-by: Joerg Schambacher <joerg@hifiberry.com>
{
struct snd_soc_dai *cpu_dai;
struct snd_soc_dai *codec_dai;
@@ -1243,7 +1243,15 @@ int snd_soc_runtime_set_dai_fmt(struct s
@@ -1246,7 +1246,15 @@ int snd_soc_runtime_set_dai_fmt(struct s
int ret;
for_each_rtd_codec_dais(rtd, i, codec_dai) {
@@ -16823,7 +16823,7 @@ Signed-off-by: Joerg Schambacher <joerg@hifiberry.com>
if (ret != 0 && ret != -ENOTSUPP)
return ret;
}
@@ -1252,8 +1260,21 @@ int snd_soc_runtime_set_dai_fmt(struct s
@@ -1255,8 +1263,21 @@ int snd_soc_runtime_set_dai_fmt(struct s
* Flip the polarity for the "CPU" end of a CODEC<->CODEC link
* the component which has non_legacy_dai_naming is Codec
*/

View File

@@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2937,6 +2937,22 @@ static int lan78xx_open(struct net_devic
@@ -2957,6 +2957,22 @@ static int lan78xx_open(struct net_devic
netif_dbg(dev, ifup, dev->net, "phy initialised successfully");

View File

@@ -37,7 +37,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data)
{
u32 *buf;
@@ -3266,8 +3275,14 @@ static int lan78xx_bind(struct lan78xx_n
@@ -3286,8 +3295,14 @@ static int lan78xx_bind(struct lan78xx_n
if (DEFAULT_RX_CSUM_ENABLE)
dev->net->features |= NETIF_F_RXCSUM;

View File

@@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2253,6 +2253,22 @@ static int lan78xx_phy_init(struct lan78
@@ -2271,6 +2271,22 @@ static int lan78xx_phy_init(struct lan78
mii_adv_to_linkmode_adv_t(fc, mii_adv);
linkmode_or(phydev->advertising, fc, phydev->advertising);
@@ -39,7 +39,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
if (phydev->mdio.dev.of_node) {
u32 reg;
int len;
@@ -2946,22 +2962,6 @@ static int lan78xx_open(struct net_devic
@@ -2966,22 +2982,6 @@ static int lan78xx_open(struct net_devic
netif_dbg(dev, ifup, dev->net, "phy initialised successfully");

View File

@@ -28,7 +28,7 @@ See: https://github.com/raspberrypi/linux/issues/2447
static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data)
{
u32 *buf;
@@ -4128,7 +4133,13 @@ static int lan78xx_probe(struct usb_inte
@@ -4148,7 +4153,13 @@ static int lan78xx_probe(struct usb_inte
netdev->max_mtu = MAX_SINGLE_PACKET_SIZE;
netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER);

View File

@@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2258,7 +2258,7 @@ static int lan78xx_phy_init(struct lan78
@@ -2276,7 +2276,7 @@ static int lan78xx_phy_init(struct lan78
mii_adv_to_linkmode_adv_t(fc, mii_adv);
linkmode_or(phydev->advertising, fc, phydev->advertising);

View File

@@ -12,7 +12,7 @@ in both dwc_otg and in ipv6 processing.
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -3505,7 +3505,7 @@ static int rx_submit(struct lan78xx_net
@@ -3525,7 +3525,7 @@ static int rx_submit(struct lan78xx_net
size_t size = dev->rx_urb_size;
int ret = 0;

View File

@@ -1,31 +0,0 @@
From dc5f634e99c4d31ce4b43f42ce789ebb943c38a5 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Wed, 31 Oct 2018 14:56:59 +0000
Subject: [PATCH] media: tc358743: Increase FIFO level to 374.
The existing fixed value of 16 worked for UYVY 720P60 over
2 lanes at 594MHz, or UYVY 1080P60 over 4 lanes. (RGB888
1080P60 needs 6 lanes at 594MHz).
It doesn't allow for lower resolutions to work as the FIFO
underflows.
374 is required for 1080P24-30 UYVY over 2 lanes @ 972Mbit/s, but
>374 means that the FIFO underflows on 1080P50 UYVY over 2 lanes
@ 972Mbit/s.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
drivers/media/i2c/tc358743.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1954,7 +1954,7 @@ static int tc358743_probe_of(struct tc35
state->pdata.ddc5v_delay = DDC5V_DELAY_100_MS;
state->pdata.enable_hdcp = false;
/* A FIFO level of 16 should be enough for 2-lane 720p60 at 594 MHz. */
- state->pdata.fifo_level = 16;
+ state->pdata.fifo_level = 374;
/*
* The PLL input clock is obtained by dividing refclk by pll_prd.
* It must be between 6 MHz and 40 MHz, lower frequency is better.

View File

@@ -24,7 +24,7 @@ Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1613,11 +1613,20 @@ static int tc358743_get_mbus_config(stru
@@ -1630,11 +1630,20 @@ static int tc358743_get_mbus_config(stru
struct v4l2_mbus_config *cfg)
{
struct tc358743_state *state = to_state(sd);
@@ -47,7 +47,7 @@ Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
switch (state->csi_lanes_in_use) {
case 1:
@@ -2060,6 +2069,7 @@ static int tc358743_probe(struct i2c_cli
@@ -2079,6 +2088,7 @@ static int tc358743_probe(struct i2c_cli
if (pdata) {
state->pdata = *pdata;
state->bus.flags = V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;

View File

@@ -13,7 +13,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1983,6 +1983,7 @@ static int tc358743_probe_of(struct tc35
@@ -2001,6 +2001,7 @@ static int tc358743_probe_of(struct tc35
/*
* The CSI bps per lane must be between 62.5 Mbps and 1 Gbps.
* The default is 594 Mbps for 4-lane 1080p60 or 2-lane 720p60.
@@ -21,7 +21,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
*/
bps_pr_lane = 2 * endpoint.link_frequencies[0];
if (bps_pr_lane < 62500000U || bps_pr_lane > 1000000000U) {
@@ -1996,23 +1997,41 @@ static int tc358743_probe_of(struct tc35
@@ -2014,23 +2015,41 @@ static int tc358743_probe_of(struct tc35
state->pdata.refclk_hz * state->pdata.pll_prd;
/*

View File

@@ -1,98 +0,0 @@
From 6e37652fbafcec197fb7de4ec25e5073b261551b Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Wed, 31 Oct 2018 14:57:34 +0000
Subject: [PATCH] media: tc358743: Check I2C succeeded during probe.
The probe for the TC358743 reads the CHIPID register from
the device and compares it to the expected value of 0.
If the I2C request fails then that also returns 0, so
the driver loads thinking that the device is there.
Generally I2C communications are reliable so there is
limited need to check the return value on every transfer,
therefore only amend the one read during probe to check
for I2C errors.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
drivers/media/i2c/tc358743.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -110,7 +110,7 @@ static inline struct tc358743_state *to_
/* --------------- I2C --------------- */
-static void i2c_rd(struct v4l2_subdev *sd, u16 reg, u8 *values, u32 n)
+static int i2c_rd(struct v4l2_subdev *sd, u16 reg, u8 *values, u32 n)
{
struct tc358743_state *state = to_state(sd);
struct i2c_client *client = state->i2c_client;
@@ -136,6 +136,7 @@ static void i2c_rd(struct v4l2_subdev *s
v4l2_err(sd, "%s: reading register 0x%x from 0x%x failed\n",
__func__, reg, client->addr);
}
+ return err != ARRAY_SIZE(msgs);
}
static void i2c_wr(struct v4l2_subdev *sd, u16 reg, u8 *values, u32 n)
@@ -192,15 +193,24 @@ static void i2c_wr(struct v4l2_subdev *s
}
}
-static noinline u32 i2c_rdreg(struct v4l2_subdev *sd, u16 reg, u32 n)
+static noinline u32 i2c_rdreg_err(struct v4l2_subdev *sd, u16 reg, u32 n,
+ int *err)
{
+ int error;
__le32 val = 0;
- i2c_rd(sd, reg, (u8 __force *)&val, n);
+ error = i2c_rd(sd, reg, (u8 __force *)&val, n);
+ if (err)
+ *err = error;
return le32_to_cpu(val);
}
+static inline u32 i2c_rdreg(struct v4l2_subdev *sd, u16 reg, u32 n)
+{
+ return i2c_rdreg_err(sd, reg, n, NULL);
+}
+
static noinline void i2c_wrreg(struct v4l2_subdev *sd, u16 reg, u32 val, u32 n)
{
__le32 raw = cpu_to_le32(val);
@@ -229,6 +239,13 @@ static u16 i2c_rd16(struct v4l2_subdev *
return i2c_rdreg(sd, reg, 2);
}
+static int i2c_rd16_err(struct v4l2_subdev *sd, u16 reg, u16 *value)
+{
+ int err;
+ *value = i2c_rdreg_err(sd, reg, 2, &err);
+ return err;
+}
+
static void i2c_wr16(struct v4l2_subdev *sd, u16 reg, u16 val)
{
i2c_wrreg(sd, reg, val, 2);
@@ -2070,6 +2087,7 @@ static int tc358743_probe(struct i2c_cli
struct tc358743_platform_data *pdata = client->dev.platform_data;
struct v4l2_subdev *sd;
u16 irq_mask = MASK_HDMI_MSK | MASK_CSI_MSK;
+ u16 chipid;
int err;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
@@ -2102,7 +2120,8 @@ static int tc358743_probe(struct i2c_cli
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
/* i2c access */
- if ((i2c_rd16(sd, CHIPID) & MASK_CHIPID) != 0) {
+ if (i2c_rd16_err(sd, CHIPID, &chipid) ||
+ (chipid & MASK_CHIPID) != 0) {
v4l2_info(sd, "not a TC358743 on address 0x%x\n",
client->addr << 1);
return -ENODEV;

View File

@@ -1,98 +0,0 @@
From 15d83e43c7eae44c48cdd3b2cd239c9ff2f74b2f Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Thu, 22 Nov 2018 17:31:06 +0000
Subject: [PATCH] media: tc358743: Return an appropriate colorspace
from tc358743_set_fmt
When calling tc358743_set_fmt, the code was calling tc358743_get_fmt
to choose a valid format. However that sets the colorspace
based on what was read back from the chip. When you set the format,
then the driver would choose and program the colorspace based
on the format code.
The result was that if you called try or set format for UYVY
when the current format was RGB3 then you would get told sRGB,
and try RGB3 when current was UYVY and you would get told
SMPTE170M.
The value programmed into the chip is determined by this driver,
therefore there is no need to read back the value. Return the
colorspace based on the format set/tried instead.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
drivers/media/i2c/tc358743.c | 40 +++++++++++++-----------------------
1 file changed, 14 insertions(+), 26 deletions(-)
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1695,12 +1695,23 @@ static int tc358743_enum_mbus_code(struc
return 0;
}
+static u32 tc358743_g_colorspace(u32 code)
+{
+ switch (code) {
+ case MEDIA_BUS_FMT_RGB888_1X24:
+ return V4L2_COLORSPACE_SRGB;
+ case MEDIA_BUS_FMT_UYVY8_1X16:
+ return V4L2_COLORSPACE_SMPTE170M;
+ default:
+ return 0;
+ }
+}
+
static int tc358743_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format)
{
struct tc358743_state *state = to_state(sd);
- u8 vi_rep = i2c_rd8(sd, VI_REP);
if (format->pad != 0)
return -EINVAL;
@@ -1710,23 +1721,7 @@ static int tc358743_get_fmt(struct v4l2_
format->format.height = state->timings.bt.height;
format->format.field = V4L2_FIELD_NONE;
- switch (vi_rep & MASK_VOUT_COLOR_SEL) {
- case MASK_VOUT_COLOR_RGB_FULL:
- case MASK_VOUT_COLOR_RGB_LIMITED:
- format->format.colorspace = V4L2_COLORSPACE_SRGB;
- break;
- case MASK_VOUT_COLOR_601_YCBCR_LIMITED:
- case MASK_VOUT_COLOR_601_YCBCR_FULL:
- format->format.colorspace = V4L2_COLORSPACE_SMPTE170M;
- break;
- case MASK_VOUT_COLOR_709_YCBCR_FULL:
- case MASK_VOUT_COLOR_709_YCBCR_LIMITED:
- format->format.colorspace = V4L2_COLORSPACE_REC709;
- break;
- default:
- format->format.colorspace = 0;
- break;
- }
+ format->format.colorspace = tc358743_g_colorspace(format->format.code);
return 0;
}
@@ -1741,18 +1736,11 @@ static int tc358743_set_fmt(struct v4l2_
int ret = tc358743_get_fmt(sd, sd_state, format);
format->format.code = code;
+ format->format.colorspace = tc358743_g_colorspace(code);
if (ret)
return ret;
- switch (code) {
- case MEDIA_BUS_FMT_RGB888_1X24:
- case MEDIA_BUS_FMT_UYVY8_1X16:
- break;
- default:
- return -EINVAL;
- }
-
if (format->which == V4L2_SUBDEV_FORMAT_TRY)
return 0;

View File

@@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1643,6 +1643,109 @@ command_cleanup:
@@ -1645,6 +1645,109 @@ command_cleanup:
}
/*
@@ -125,7 +125,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
*/
@@ -5510,6 +5613,7 @@ static const struct hc_driver xhci_hc_dr
@@ -5520,6 +5623,7 @@ static const struct hc_driver xhci_hc_dr
.endpoint_reset = xhci_endpoint_reset,
.check_bandwidth = xhci_check_bandwidth,
.reset_bandwidth = xhci_reset_bandwidth,

View File

@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -2282,6 +2282,7 @@ xhci_alloc_interrupter(struct xhci_hcd *
@@ -2284,6 +2284,7 @@ xhci_alloc_interrupter(struct xhci_hcd *
{
struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
struct xhci_interrupter *ir;
@@ -30,7 +30,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
u64 erst_base;
u32 erst_size;
int ret;
@@ -2302,7 +2303,11 @@ xhci_alloc_interrupter(struct xhci_hcd *
@@ -2304,7 +2305,11 @@ xhci_alloc_interrupter(struct xhci_hcd *
return NULL;
ir->ir_set = &xhci->run_regs->ir_set[intr_num];
@@ -43,7 +43,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
0, flags);
if (!ir->event_ring) {
xhci_warn(xhci, "Failed to allocate interrupter %d event ring\n", intr_num);
@@ -2318,7 +2323,7 @@ xhci_alloc_interrupter(struct xhci_hcd *
@@ -2320,7 +2325,7 @@ xhci_alloc_interrupter(struct xhci_hcd *
/* set ERST count with the number of entries in the segment table */
erst_size = readl(&ir->ir_set->erst_size);
erst_size &= ERST_SIZE_MASK;

View File

@@ -10,7 +10,7 @@ Signed-off-by: Jacko Dirks <jdirks.linuxdev@gmail.com>
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -2010,6 +2010,7 @@ static int tc358743_probe_of(struct tc35
@@ -2023,6 +2023,7 @@ static int tc358743_probe_of(struct tc35
switch (bps_pr_lane) {
default:
dev_warn(dev, "untested bps per lane: %u bps\n", bps_pr_lane);

View File

@@ -1,30 +0,0 @@
From fcdf09ccef256160d3d87a49a900fabff20286a4 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Fri, 10 Jul 2020 12:40:50 +0100
Subject: [PATCH] media: i2c: tc358743: Only allow supported pixel fmts
in set_fmt
Fix commit "media: tc358743: Return an appropriate colorspace from
tc358743_set_fmt" to ensure that the format passed in to set_fmt
is checked to be valid, and reset to the current format if not.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/i2c/tc358743.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1735,8 +1735,10 @@ static int tc358743_set_fmt(struct v4l2_
u32 code = format->format.code; /* is overwritten by get_fmt */
int ret = tc358743_get_fmt(sd, sd_state, format);
- format->format.code = code;
- format->format.colorspace = tc358743_g_colorspace(code);
+ if (code == MEDIA_BUS_FMT_RGB888_1X24 ||
+ code == MEDIA_BUS_FMT_UYVY8_1X16)
+ format->format.code = code;
+ format->format.colorspace = tc358743_g_colorspace(format->format.code);
if (ret)
return ret;

View File

@@ -95,7 +95,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
#include <video/mipi_display.h>
@@ -1186,6 +1188,7 @@ static struct fbtft_platform_data *fbtft
@@ -1187,6 +1189,7 @@ static struct fbtft_platform_data *fbtft
* @display: Display properties
* @sdev: SPI device
* @pdev: Platform device
@@ -103,7 +103,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
*
* Allocates, initializes and registers a framebuffer
*
@@ -1195,12 +1198,15 @@ static struct fbtft_platform_data *fbtft
@@ -1196,12 +1199,15 @@ static struct fbtft_platform_data *fbtft
*/
int fbtft_probe_common(struct fbtft_display *display,
struct spi_device *sdev,
@@ -120,7 +120,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
int ret;
if (sdev)
@@ -1216,6 +1222,14 @@ int fbtft_probe_common(struct fbtft_disp
@@ -1217,6 +1223,14 @@ int fbtft_probe_common(struct fbtft_disp
pdata = fbtft_properties_read(dev);
if (IS_ERR(pdata))
return PTR_ERR(pdata);

View File

@@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -2012,7 +2012,7 @@ static int tc358743_probe_of(struct tc35
@@ -2023,7 +2023,7 @@ static int tc358743_probe_of(struct tc35
switch (bps_pr_lane) {
default:
dev_warn(dev, "untested bps per lane: %u bps\n", bps_pr_lane);

View File

@@ -26,7 +26,7 @@ Signed-off-by: John Cox <jc@kynesim.co.uk>
case V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS:
p_hevc_decode_params = p;
@@ -1250,6 +1253,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
@@ -1249,6 +1252,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
case V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS:
elem_size = sizeof(struct v4l2_ctrl_hevc_slice_params);
break;

View File

@@ -401,7 +401,7 @@ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
kvfree(ctrl);
}
kvfree(hdl->buckets);
@@ -1105,7 +1187,7 @@ int handler_new_ref(struct v4l2_ctrl_han
@@ -1104,7 +1186,7 @@ int handler_new_ref(struct v4l2_ctrl_han
if (hdl->error)
return hdl->error;
@@ -410,7 +410,7 @@ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
size_extra_req = ctrl->elems * ctrl->elem_size;
new_ref = kzalloc(sizeof(*new_ref) + size_extra_req, GFP_KERNEL);
if (!new_ref)
@@ -1273,7 +1355,6 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
@@ -1272,7 +1354,6 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
elem_size = sizeof(s32);
break;
}
@@ -418,7 +418,7 @@ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
/* Sanity checks */
if (id == 0 || name == NULL || !elem_size ||
@@ -1294,17 +1375,33 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
@@ -1293,17 +1374,33 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
handler_set_err(hdl, -EINVAL);
return NULL;
}
@@ -456,7 +456,7 @@ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
sz_extra += 2 * tot_ctrl_size;
if (type >= V4L2_CTRL_COMPOUND_TYPES && p_def.p_const)
@@ -1333,7 +1430,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
@@ -1332,7 +1429,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
ctrl->is_ptr = is_array || type >= V4L2_CTRL_COMPOUND_TYPES || ctrl->is_string;
ctrl->is_int = !ctrl->is_ptr && type != V4L2_CTRL_TYPE_INTEGER64;
ctrl->is_array = is_array;
@@ -466,7 +466,7 @@ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
ctrl->nr_of_dims = nr_of_dims;
if (nr_of_dims)
memcpy(ctrl->dims, dims, nr_of_dims * sizeof(dims[0]));
@@ -1346,6 +1445,16 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
@@ -1345,6 +1444,16 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
ctrl->cur.val = ctrl->val = def;
data = &ctrl[1];
@@ -483,7 +483,7 @@ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
if (!ctrl->is_int) {
ctrl->p_new.p = data;
ctrl->p_cur.p = data + tot_ctrl_size;
@@ -1355,7 +1464,10 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
@@ -1354,7 +1463,10 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
}
if (type >= V4L2_CTRL_COMPOUND_TYPES && p_def.p_const) {
@@ -495,7 +495,7 @@ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
memcpy(ctrl->p_def.p, p_def.p_const, elem_size);
}
@@ -1365,6 +1477,7 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
@@ -1364,6 +1476,7 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
}
if (handler_new_ref(hdl, ctrl, NULL, false, false)) {
@@ -503,7 +503,7 @@ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
kvfree(ctrl);
return NULL;
}
@@ -1702,6 +1815,9 @@ static int cluster_changed(struct v4l2_c
@@ -1701,6 +1814,9 @@ static int cluster_changed(struct v4l2_c
continue;
}

View File

@@ -19,7 +19,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -862,8 +862,14 @@ static int usb_audio_probe(struct usb_in
@@ -868,8 +868,14 @@ static int usb_audio_probe(struct usb_in
if (ignore_ctl_error)
chip->quirk_flags |= QUIRK_FLAG_IGNORE_CTL_ERROR;

View File

@@ -145,7 +145,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (ret)
return -ENOMEM;
@@ -1826,7 +1830,7 @@ int xhci_alloc_erst(struct xhci_hcd *xhc
@@ -1828,7 +1832,7 @@ int xhci_alloc_erst(struct xhci_hcd *xhc
for (val = 0; val < evt_ring->num_segs; val++) {
entry = &erst->entries[val];
entry->seg_addr = cpu_to_le64(seg->dma);
@@ -205,7 +205,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
xhci_err(xhci, "Tried to move enqueue past ring segment\n");
return;
}
@@ -3319,7 +3322,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd
@@ -3324,7 +3327,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd
* that clears the EHB.
*/
while (xhci_handle_event(xhci, ir) > 0) {
@@ -214,7 +214,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
continue;
xhci_update_erst_dequeue(xhci, ir, event_ring_deq);
event_ring_deq = ir->event_ring->dequeue;
@@ -3461,7 +3464,8 @@ static int prepare_ring(struct xhci_hcd
@@ -3466,7 +3469,8 @@ static int prepare_ring(struct xhci_hcd
}
}
@@ -226,7 +226,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
}
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -899,8 +899,8 @@ static void xhci_clear_command_ring(stru
@@ -901,8 +901,8 @@ static void xhci_clear_command_ring(stru
seg = ring->deq_seg;
do {
memset(seg->trbs, 0,
@@ -237,7 +237,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
cpu_to_le32(~TRB_CYCLE);
seg = seg->next;
} while (seg != ring->deq_seg);
@@ -911,7 +911,7 @@ static void xhci_clear_command_ring(stru
@@ -913,7 +913,7 @@ static void xhci_clear_command_ring(stru
ring->enq_seg = ring->deq_seg;
ring->enqueue = ring->dequeue;

View File

@@ -17,4 +17,4 @@ Subject: [PATCH] Patching lan78xx for SOF_TIMESTAMPING_TX_SOFTWARE
+ .get_ts_info = ethtool_op_get_ts_info,
};
static void lan78xx_init_mac_address(struct lan78xx_net *dev)
static int lan78xx_init_mac_address(struct lan78xx_net *dev)

View File

@@ -36,7 +36,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3774,14 +3774,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3779,14 +3779,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
unsigned int num_trbs;
unsigned int start_cycle, num_sgs = 0;
unsigned int enqd_len, block_len, trb_buff_len, full_len;
@@ -54,7 +54,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
full_len = urb->transfer_buffer_length;
/* If we have scatter/gather list, we use it. */
if (urb->num_sgs && !(urb->transfer_flags & URB_DMA_MAP_SINGLE)) {
@@ -3818,6 +3819,17 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3823,6 +3824,17 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
start_cycle = ring->cycle_state;
send_addr = addr;
@@ -72,7 +72,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/* Queue the TRBs, even if they are zero-length */
for (enqd_len = 0; first_trb || enqd_len < full_len;
enqd_len += trb_buff_len) {
@@ -3830,6 +3842,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3835,6 +3847,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
if (enqd_len + trb_buff_len > full_len)
trb_buff_len = full_len - enqd_len;

View File

@@ -13,7 +13,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3774,7 +3774,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3779,7 +3779,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
unsigned int num_trbs;
unsigned int start_cycle, num_sgs = 0;
unsigned int enqd_len, block_len, trb_buff_len, full_len;
@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
u32 field, length_field, remainder, maxpacket;
u64 addr, send_addr;
@@ -3820,14 +3820,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3825,14 +3825,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
send_addr = addr;
if (xhci->quirks & XHCI_VLI_SS_BULK_OUT_BUG &&
@@ -40,7 +40,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
}
/* Queue the TRBs, even if they are zero-length */
@@ -3842,7 +3837,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3847,7 +3842,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
if (enqd_len + trb_buff_len > full_len)
trb_buff_len = full_len - enqd_len;

View File

@@ -11,7 +11,7 @@ This reverts commit 2388f826cdc9af2651991adc0feb79de9bdf2232.
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -1637,14 +1637,7 @@ static void do_remove_conflicting_frameb
@@ -1636,14 +1636,7 @@ static void do_remove_conflicting_frameb
* If it's not a platform device, at least print a warning. A
* fix would add code to remove the device from the system.
*/

View File

@@ -12,7 +12,7 @@ This reverts commit c894ac44786cfed383a6c6b20c1bfb12eb96018a.
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -26,7 +26,6 @@
@@ -25,7 +25,6 @@
#include <linux/init.h>
#include <linux/linux_logo.h>
#include <linux/proc_fs.h>
@@ -20,7 +20,7 @@ This reverts commit c894ac44786cfed383a6c6b20c1bfb12eb96018a.
#include <linux/seq_file.h>
#include <linux/console.h>
#include <linux/kmod.h>
@@ -1614,36 +1613,18 @@ static void do_remove_conflicting_frameb
@@ -1613,36 +1612,18 @@ static void do_remove_conflicting_frameb
/* check all firmware fbs and kick off if the base addr overlaps */
for_each_registered_fb(i) {
struct apertures_struct *gen_aper;
@@ -58,7 +58,7 @@ This reverts commit c894ac44786cfed383a6c6b20c1bfb12eb96018a.
}
}
}
@@ -1981,13 +1962,9 @@ EXPORT_SYMBOL(register_framebuffer);
@@ -1969,13 +1950,9 @@ EXPORT_SYMBOL(register_framebuffer);
void
unregister_framebuffer(struct fb_info *fb_info)
{

View File

@@ -23,7 +23,7 @@ it on BCM4708 family.
static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
{
struct xhci_plat_priv *priv = xhci_to_priv(xhci);
+ struct platform_device*pdev = to_platform_device(dev);
+ struct platform_device *pdev = to_platform_device(dev);
+ struct device_node *node = pdev->dev.of_node;
/*
@@ -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
@@ -159,6 +159,49 @@ int xhci_start(struct xhci_hcd *xhci)
@@ -160,6 +160,49 @@ int xhci_start(struct xhci_hcd *xhci)
return ret;
}
@@ -78,7 +78,7 @@ it on BCM4708 family.
+ }
+
+ /* Free virt device */
+ xhci_free_virt_device(xhci, slot_id);
+ xhci_free_virt_device(xhci, xhci->devs[slot_id], slot_id);
+
+ /* We're done if controller is already running */
+ if (readl(&xhci->op_regs->command) & CMD_RUN)
@@ -90,7 +90,7 @@ it on BCM4708 family.
/*
* Reset a halted HC.
*
@@ -636,6 +679,16 @@ static int xhci_run_finished(struct xhci
@@ -638,6 +681,16 @@ static int xhci_run_finished(struct xhci
spin_unlock_irqrestore(&xhci->lock, flags);
return -ENODEV;
}

View File

@@ -21,7 +21,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -429,6 +429,7 @@ config PINCTRL_KEEMBAY
@@ -430,6 +430,7 @@ config PINCTRL_KEEMBAY
source "drivers/pinctrl/actions/Kconfig"
source "drivers/pinctrl/aspeed/Kconfig"
source "drivers/pinctrl/bcm/Kconfig"

View File

@@ -329,7 +329,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -1006,23 +1006,13 @@ static inline void update_mmu_cache(stru
@@ -1007,23 +1007,13 @@ static inline void update_mmu_cache(stru
* page after fork() + CoW for pfn mappings. We don't always have a
* hardware-managed access flag on arm64.
*/

View File

@@ -138,7 +138,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
}
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1093,6 +1093,8 @@ vm_fault_t finish_mkwrite_fault(struct v
@@ -1104,6 +1104,8 @@ vm_fault_t finish_mkwrite_fault(struct v
#define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH)
#define LAST_CPUPID_PGOFF (ZONES_PGOFF - LAST_CPUPID_WIDTH)
#define KASAN_TAG_PGOFF (LAST_CPUPID_PGOFF - KASAN_TAG_WIDTH)

View File

@@ -414,7 +414,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
/* forking complete and child started to run, tell ptracer */
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5014,6 +5014,7 @@ context_switch(struct rq *rq, struct tas
@@ -5033,6 +5033,7 @@ context_switch(struct rq *rq, struct tas
* finish_task_switch()'s mmdrop().
*/
switch_mm_irqs_off(prev->active_mm, next->mm, next);

View File

@@ -354,7 +354,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
static void mem_cgroup_css_free(struct cgroup_subsys_state *css)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7714,6 +7714,7 @@ static void __init free_area_init_node(i
@@ -7727,6 +7727,7 @@ static void __init free_area_init_node(i
pgdat_set_deferred_range(pgdat);
free_area_init_core(pgdat);

View File

@@ -34,7 +34,7 @@ Link: https://lore.kernel.org/linux-mtd/20220418132803.664103-1-felix@matouschek
obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -902,6 +902,7 @@ static const struct spinand_manufacturer
@@ -905,6 +905,7 @@ static const struct spinand_manufacturer
&paragon_spinand_manufacturer,
&toshiba_spinand_manufacturer,
&winbond_spinand_manufacturer,

View File

@@ -37,7 +37,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8);
map->format.buf_size = DIV_ROUND_UP(config->reg_bits +
config->val_bits + config->pad_bits, 8);
@@ -1762,6 +1763,7 @@ static int _regmap_raw_write_impl(struct
@@ -1764,6 +1765,7 @@ static int _regmap_raw_write_impl(struct
return ret;
}
@@ -45,7 +45,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.format_reg(map->work_buf, reg, map->reg_shift);
regmap_set_work_buf_flag_mask(map, map->format.reg_bytes,
map->write_flag_mask);
@@ -1932,6 +1934,7 @@ static int _regmap_bus_formatted_write(v
@@ -1934,6 +1936,7 @@ static int _regmap_bus_formatted_write(v
return ret;
}
@@ -53,7 +53,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.format_write(map, reg, val);
trace_regmap_hw_write_start(map, reg, 1);
@@ -2372,6 +2375,7 @@ static int _regmap_raw_multi_reg_write(s
@@ -2374,6 +2377,7 @@ static int _regmap_raw_multi_reg_write(s
unsigned int reg = regs[i].reg;
unsigned int val = regs[i].def;
trace_regmap_hw_write_start(map, reg, 1);
@@ -61,7 +61,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.format_reg(u8, reg, map->reg_shift);
u8 += reg_bytes + pad_bytes;
map->format.format_val(u8, val, 0);
@@ -2697,6 +2701,7 @@ static int _regmap_raw_read(struct regma
@@ -2699,6 +2703,7 @@ static int _regmap_raw_read(struct regma
return ret;
}

View File

@@ -42,7 +42,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.reg_bytes = DIV_ROUND_UP(config->reg_bits, 8);
map->format.pad_bytes = config->pad_bits / 8;
map->format.reg_downshift = config->reg_downshift;
@@ -1763,6 +1765,7 @@ static int _regmap_raw_write_impl(struct
@@ -1765,6 +1767,7 @@ static int _regmap_raw_write_impl(struct
return ret;
}
@@ -50,7 +50,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
reg >>= map->format.reg_downshift;
map->format.format_reg(map->work_buf, reg, map->reg_shift);
regmap_set_work_buf_flag_mask(map, map->format.reg_bytes,
@@ -1934,6 +1937,7 @@ static int _regmap_bus_formatted_write(v
@@ -1936,6 +1939,7 @@ static int _regmap_bus_formatted_write(v
return ret;
}
@@ -58,7 +58,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
reg >>= map->format.reg_downshift;
map->format.format_write(map, reg, val);
@@ -2375,6 +2379,7 @@ static int _regmap_raw_multi_reg_write(s
@@ -2377,6 +2381,7 @@ static int _regmap_raw_multi_reg_write(s
unsigned int reg = regs[i].reg;
unsigned int val = regs[i].def;
trace_regmap_hw_write_start(map, reg, 1);
@@ -66,7 +66,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
reg >>= map->format.reg_downshift;
map->format.format_reg(u8, reg, map->reg_shift);
u8 += reg_bytes + pad_bytes;
@@ -2701,6 +2706,7 @@ static int _regmap_raw_read(struct regma
@@ -2703,6 +2708,7 @@ static int _regmap_raw_read(struct regma
return ret;
}

View File

@@ -28,7 +28,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1955,6 +1955,8 @@ static int _regmap_bus_reg_write(void *c
@@ -1957,6 +1957,8 @@ static int _regmap_bus_reg_write(void *c
{
struct regmap *map = context;
@@ -37,7 +37,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
return map->bus->reg_write(map->bus_context, reg, val);
}
@@ -2727,6 +2729,8 @@ static int _regmap_bus_reg_read(void *co
@@ -2729,6 +2731,8 @@ static int _regmap_bus_reg_read(void *co
{
struct regmap *map = context;
@@ -46,7 +46,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
return map->bus->reg_read(map->bus_context, reg, val);
}
@@ -3096,6 +3100,8 @@ static int _regmap_update_bits(struct re
@@ -3098,6 +3102,8 @@ static int _regmap_update_bits(struct re
*change = false;
if (regmap_volatile(map, reg) && map->reg_update_bits) {

View File

@@ -128,7 +128,7 @@ Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-4-kernel@kempniu.pl
}
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -629,6 +629,7 @@ static int spinand_mtd_read(struct mtd_i
@@ -632,6 +632,7 @@ static int spinand_mtd_read(struct mtd_i
{
struct spinand_device *spinand = mtd_to_spinand(mtd);
struct nand_device *nand = mtd_to_nanddev(mtd);
@@ -136,7 +136,7 @@ Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-4-kernel@kempniu.pl
unsigned int max_bitflips = 0;
struct nand_io_iter iter;
bool disable_ecc = false;
@@ -640,6 +641,8 @@ static int spinand_mtd_read(struct mtd_i
@@ -643,6 +644,8 @@ static int spinand_mtd_read(struct mtd_i
mutex_lock(&spinand->lock);
@@ -145,7 +145,7 @@ Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-4-kernel@kempniu.pl
nanddev_io_for_each_page(nand, NAND_PAGE_READ, from, ops, &iter) {
if (disable_ecc)
iter.req.mode = MTD_OPS_RAW;
@@ -662,6 +665,13 @@ static int spinand_mtd_read(struct mtd_i
@@ -665,6 +668,13 @@ static int spinand_mtd_read(struct mtd_i
ops->oobretlen += iter.req.ooblen;
}

View File

@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto err_dma;
if (i == nr_frags - 1 &&
@@ -1341,18 +1342,18 @@ static int mtk_poll_rx(struct napi_struc
@@ -1349,18 +1350,18 @@ static int mtk_poll_rx(struct napi_struc
netdev->stats.rx_dropped++;
goto release_desc;
}
@@ -120,7 +120,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->buf_size, DMA_FROM_DEVICE);
/* receive data */
@@ -1625,7 +1626,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1633,7 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth *
if (!ring->buf)
goto no_tx_mem;
@@ -129,7 +129,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
&ring->phys, GFP_ATOMIC);
if (!ring->dma)
goto no_tx_mem;
@@ -1643,7 +1644,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1651,7 +1652,7 @@ static int mtk_tx_alloc(struct mtk_eth *
* descriptors in ring->dma_pdma.
*/
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
@@ -138,7 +138,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
&ring->phys_pdma,
GFP_ATOMIC);
if (!ring->dma_pdma)
@@ -1702,7 +1703,7 @@ static void mtk_tx_clean(struct mtk_eth
@@ -1710,7 +1711,7 @@ static void mtk_tx_clean(struct mtk_eth
}
if (ring->dma) {
@@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MTK_DMA_SIZE * sizeof(*ring->dma),
ring->dma,
ring->phys);
@@ -1710,7 +1711,7 @@ static void mtk_tx_clean(struct mtk_eth
@@ -1718,7 +1719,7 @@ static void mtk_tx_clean(struct mtk_eth
}
if (ring->dma_pdma) {
@@ -156,7 +156,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MTK_DMA_SIZE * sizeof(*ring->dma_pdma),
ring->dma_pdma,
ring->phys_pdma);
@@ -1758,18 +1759,18 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1766,18 +1767,18 @@ static int mtk_rx_alloc(struct mtk_eth *
return -ENOMEM;
}
@@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return -ENOMEM;
ring->dma[i].rxd1 = (unsigned int)dma_addr;
@@ -1805,7 +1806,7 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1813,7 +1814,7 @@ static void mtk_rx_clean(struct mtk_eth
continue;
if (!ring->dma[i].rxd1)
continue;
@@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->dma[i].rxd1,
ring->buf_size,
DMA_FROM_DEVICE);
@@ -1816,7 +1817,7 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1824,7 +1825,7 @@ static void mtk_rx_clean(struct mtk_eth
}
if (ring->dma) {
@@ -196,7 +196,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->dma_size * sizeof(*ring->dma),
ring->dma,
ring->phys);
@@ -2175,7 +2176,7 @@ static void mtk_dma_free(struct mtk_eth
@@ -2183,7 +2184,7 @@ static void mtk_dma_free(struct mtk_eth
if (eth->netdev[i])
netdev_reset_queue(eth->netdev[i]);
if (eth->scratch_ring) {
@@ -205,7 +205,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MTK_DMA_SIZE * sizeof(struct mtk_tx_dma),
eth->scratch_ring,
eth->phy_scratch_ring);
@@ -2527,6 +2528,8 @@ static void mtk_dim_tx(struct work_struc
@@ -2535,6 +2536,8 @@ static void mtk_dim_tx(struct work_struc
static int mtk_hw_init(struct mtk_eth *eth)
{
@@ -214,7 +214,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
int i, val, ret;
if (test_and_set_bit(MTK_HW_INIT, &eth->state))
@@ -2539,6 +2542,10 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2547,6 +2550,10 @@ static int mtk_hw_init(struct mtk_eth *e
if (ret)
goto err_disable_pm;
@@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
ret = device_reset(eth->dev);
if (ret) {
@@ -3085,6 +3092,35 @@ free_netdev:
@@ -3093,6 +3100,35 @@ free_netdev:
return err;
}
@@ -261,7 +261,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int mtk_probe(struct platform_device *pdev)
{
struct device_node *mac_np;
@@ -3098,6 +3134,7 @@ static int mtk_probe(struct platform_dev
@@ -3106,6 +3142,7 @@ static int mtk_probe(struct platform_dev
eth->soc = of_device_get_match_data(&pdev->dev);
eth->dev = &pdev->dev;
@@ -269,7 +269,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
eth->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(eth->base))
return PTR_ERR(eth->base);
@@ -3146,6 +3183,16 @@ static int mtk_probe(struct platform_dev
@@ -3154,6 +3191,16 @@ static int mtk_probe(struct platform_dev
}
}

View File

@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int mtk_msg_level = -1;
module_param_named(msg_level, mtk_msg_level, int, 0);
@@ -3215,6 +3216,22 @@ static int mtk_probe(struct platform_dev
@@ -3223,6 +3224,22 @@ static int mtk_probe(struct platform_dev
}
}

View File

@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2348,7 +2348,7 @@ static int mtk_open(struct net_device *d
@@ -2356,7 +2356,7 @@ static int mtk_open(struct net_device *d
return err;
}
@@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
gdm_config = MTK_GDMA_TO_PPE;
mtk_gdm_config(eth, gdm_config);
@@ -2422,7 +2422,7 @@ static int mtk_stop(struct net_device *d
@@ -2430,7 +2430,7 @@ static int mtk_stop(struct net_device *d
mtk_dma_free(eth);
if (eth->soc->offload_version)
@@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return 0;
}
@@ -3307,10 +3307,11 @@ static int mtk_probe(struct platform_dev
@@ -3315,10 +3315,11 @@ static int mtk_probe(struct platform_dev
}
if (eth->soc->offload_version) {

View File

@@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <net/dsa.h>
#include "mtk_eth_soc.h"
@@ -1303,7 +1304,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1311,7 +1312,7 @@ static int mtk_poll_rx(struct napi_struc
struct net_device *netdev;
unsigned int pktlen;
dma_addr_t dma_addr;
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
int mac;
ring = mtk_get_rx_ring(eth);
@@ -1382,6 +1383,11 @@ static int mtk_poll_rx(struct napi_struc
@@ -1390,6 +1391,11 @@ static int mtk_poll_rx(struct napi_struc
skb_set_hash(skb, hash, PKT_HASH_TYPE_L4);
}
@@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX &&
(trxd.rxd2 & RX_DMA_VTAG))
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
@@ -3307,7 +3313,7 @@ static int mtk_probe(struct platform_dev
@@ -3315,7 +3321,7 @@ static int mtk_probe(struct platform_dev
}
if (eth->soc->offload_version) {

View File

@@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mediatek,hifsys = <&hifsys>;
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3194,7 +3194,7 @@ static int mtk_probe(struct platform_dev
@@ -3202,7 +3202,7 @@ static int mtk_probe(struct platform_dev
struct regmap *cci;
cci = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,

View File

@@ -22,7 +22,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(!eth->scratch_ring))
return -ENOMEM;
@@ -1634,7 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1642,7 +1642,7 @@ static int mtk_tx_alloc(struct mtk_eth *
goto no_tx_mem;
ring->dma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
@@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!ring->dma)
goto no_tx_mem;
@@ -1652,8 +1652,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1660,8 +1660,7 @@ static int mtk_tx_alloc(struct mtk_eth *
*/
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
ring->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
@@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!ring->dma_pdma)
goto no_tx_mem;
@@ -1768,7 +1767,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1776,7 +1775,7 @@ static int mtk_rx_alloc(struct mtk_eth *
ring->dma = dma_alloc_coherent(eth->dma_dev,
rx_dma_size * sizeof(*ring->dma),

View File

@@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
mtk_w32(eth, eth->phy_scratch_ring, MTK_QDMA_FQ_HEAD);
@@ -2183,6 +2186,7 @@ static int mtk_dma_init(struct mtk_eth *
@@ -2191,6 +2194,7 @@ static int mtk_dma_init(struct mtk_eth *
static void mtk_dma_free(struct mtk_eth *eth)
{
@@ -73,7 +73,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int i;
for (i = 0; i < MTK_MAC_COUNT; i++)
@@ -2190,9 +2194,8 @@ static void mtk_dma_free(struct mtk_eth
@@ -2198,9 +2202,8 @@ static void mtk_dma_free(struct mtk_eth
netdev_reset_queue(eth->netdev[i]);
if (eth->scratch_ring) {
dma_free_coherent(eth->dma_dev,
@@ -85,7 +85,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
eth->scratch_ring = NULL;
eth->phy_scratch_ring = 0;
}
@@ -3397,6 +3400,9 @@ static const struct mtk_soc_data mt2701_
@@ -3405,6 +3408,9 @@ static const struct mtk_soc_data mt2701_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
@@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data mt7621_data = {
@@ -3405,6 +3411,9 @@ static const struct mtk_soc_data mt7621_
@@ -3413,6 +3419,9 @@ static const struct mtk_soc_data mt7621_
.required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false,
.offload_version = 2,
@@ -105,7 +105,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data mt7622_data = {
@@ -3414,6 +3423,9 @@ static const struct mtk_soc_data mt7622_
@@ -3422,6 +3431,9 @@ static const struct mtk_soc_data mt7622_
.required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false,
.offload_version = 2,
@@ -115,7 +115,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data mt7623_data = {
@@ -3422,6 +3434,9 @@ static const struct mtk_soc_data mt7623_
@@ -3430,6 +3442,9 @@ static const struct mtk_soc_data mt7623_
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.offload_version = 2,
@@ -125,7 +125,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data mt7629_data = {
@@ -3430,6 +3445,9 @@ static const struct mtk_soc_data mt7629_
@@ -3438,6 +3453,9 @@ static const struct mtk_soc_data mt7629_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7629_CLKS_BITMAP,
.required_pctl = false,
@@ -135,7 +135,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data rt5350_data = {
@@ -3437,6 +3455,9 @@ static const struct mtk_soc_data rt5350_
@@ -3445,6 +3463,9 @@ static const struct mtk_soc_data rt5350_
.hw_features = MTK_HW_FEATURES_MT7628,
.required_clks = MT7628_CLKS_BITMAP,
.required_pctl = false,

View File

@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1635,8 +1635,10 @@ static int mtk_napi_rx(struct napi_struc
@@ -1643,8 +1643,10 @@ static int mtk_napi_rx(struct napi_struc
static int mtk_tx_alloc(struct mtk_eth *eth)
{
@@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->buf = kcalloc(MTK_DMA_SIZE, sizeof(*ring->buf),
GFP_KERNEL);
@@ -1652,8 +1654,10 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1660,8 +1662,10 @@ static int mtk_tx_alloc(struct mtk_eth *
int next = (i + 1) % MTK_DMA_SIZE;
u32 next_ptr = ring->phys + next * sz;
@@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
/* On MT7688 (PDMA only) this driver uses the ring->dma structs
@@ -1675,7 +1679,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1683,7 +1687,7 @@ static int mtk_tx_alloc(struct mtk_eth *
ring->dma_size = MTK_DMA_SIZE;
atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
ring->next_free = &ring->dma[0];
@@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz));
ring->thresh = MAX_SKB_FRAGS;
@@ -1708,6 +1712,7 @@ no_tx_mem:
@@ -1716,6 +1720,7 @@ no_tx_mem:
static void mtk_tx_clean(struct mtk_eth *eth)
{
@@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_ring *ring = &eth->tx_ring;
int i;
@@ -1720,17 +1725,15 @@ static void mtk_tx_clean(struct mtk_eth
@@ -1728,17 +1733,15 @@ static void mtk_tx_clean(struct mtk_eth
if (ring->dma) {
dma_free_coherent(eth->dma_dev,

View File

@@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
itxd_pdma->txd2 = TX_DMA_DESP2_DEF;
itxd = mtk_qdma_phys_to_virt(ring, itxd->txd2);
@@ -1460,7 +1463,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1468,7 +1471,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
if ((desc->txd3 & TX_DMA_OWNER_CPU) == 0)
break;

View File

@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1786,7 +1786,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1794,7 +1794,7 @@ static int mtk_rx_alloc(struct mtk_eth *
}
ring->dma = dma_alloc_coherent(eth->dma_dev,
@@ -22,7 +22,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
&ring->phys, GFP_KERNEL);
if (!ring->dma)
return -ENOMEM;
@@ -1844,9 +1844,8 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1852,9 +1852,8 @@ static void mtk_rx_clean(struct mtk_eth
if (ring->dma) {
dma_free_coherent(eth->dma_dev,
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->dma = NULL;
}
}
@@ -3412,6 +3411,7 @@ static const struct mtk_soc_data mt2701_
@@ -3420,6 +3419,7 @@ static const struct mtk_soc_data mt2701_
.required_pctl = true,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3423,6 +3423,7 @@ static const struct mtk_soc_data mt7621_
@@ -3431,6 +3431,7 @@ static const struct mtk_soc_data mt7621_
.offload_version = 2,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@@ -50,7 +50,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3435,6 +3436,7 @@ static const struct mtk_soc_data mt7622_
@@ -3443,6 +3444,7 @@ static const struct mtk_soc_data mt7622_
.offload_version = 2,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3446,6 +3448,7 @@ static const struct mtk_soc_data mt7623_
@@ -3454,6 +3456,7 @@ static const struct mtk_soc_data mt7623_
.offload_version = 2,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3457,6 +3460,7 @@ static const struct mtk_soc_data mt7629_
@@ -3465,6 +3468,7 @@ static const struct mtk_soc_data mt7629_
.required_pctl = false,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@@ -74,7 +74,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3467,6 +3471,7 @@ static const struct mtk_soc_data rt5350_
@@ -3475,6 +3479,7 @@ static const struct mtk_soc_data rt5350_
.required_pctl = false,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),

View File

@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1275,9 +1275,12 @@ static struct mtk_rx_ring *mtk_get_rx_ri
@@ -1283,9 +1283,12 @@ static struct mtk_rx_ring *mtk_get_rx_ri
return &eth->rx_ring[0];
for (i = 0; i < MTK_MAX_RX_RING_NUM; i++) {
@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->calc_idx_update = true;
return ring;
}
@@ -1328,7 +1331,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1336,7 +1339,7 @@ static int mtk_poll_rx(struct napi_struc
goto rx_done;
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
data = ring->data[idx];
if (!mtk_rx_get_desc(&trxd, rxd))
@@ -1520,7 +1523,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1528,7 +1531,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
mtk_tx_unmap(eth, tx_buf, true);

View File

@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1795,18 +1795,25 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1803,18 +1803,25 @@ static int mtk_rx_alloc(struct mtk_eth *
return -ENOMEM;
for (i = 0; i < rx_dma_size; i++) {
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
ring->dma_size = rx_dma_size;
ring->calc_idx_update = false;
@@ -1831,14 +1838,17 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1839,14 +1846,17 @@ static void mtk_rx_clean(struct mtk_eth
if (ring->data && ring->dma) {
for (i = 0; i < ring->dma_size; i++) {

View File

@@ -196,7 +196,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else {
int next_idx;
@@ -1450,6 +1503,7 @@ rx_done:
@@ -1458,6 +1511,7 @@ rx_done:
static int mtk_poll_tx_qdma(struct mtk_eth *eth, int budget,
unsigned int *done, unsigned int *bytes)
{
@@ -204,7 +204,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_ring *ring = &eth->tx_ring;
struct mtk_tx_dma *desc;
struct sk_buff *skb;
@@ -1457,7 +1511,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1465,7 +1519,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
u32 cpu, dma;
cpu = ring->last_free_ptr;
@@ -213,7 +213,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
desc = mtk_qdma_phys_to_virt(ring, cpu);
@@ -1492,7 +1546,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1500,7 +1554,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
}
ring->last_free_ptr = cpu;
@@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return budget;
}
@@ -1585,24 +1639,25 @@ static void mtk_handle_status_irq(struct
@@ -1593,24 +1647,25 @@ static void mtk_handle_status_irq(struct
static int mtk_napi_tx(struct napi_struct *napi, int budget)
{
struct mtk_eth *eth = container_of(napi, struct mtk_eth, tx_napi);
@@ -252,7 +252,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return budget;
if (napi_complete_done(napi, tx_done))
@@ -1614,6 +1669,7 @@ static int mtk_napi_tx(struct napi_struc
@@ -1622,6 +1677,7 @@ static int mtk_napi_tx(struct napi_struc
static int mtk_napi_rx(struct napi_struct *napi, int budget)
{
struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi);
@@ -260,7 +260,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int rx_done_total = 0;
mtk_handle_status_irq(eth);
@@ -1621,21 +1677,21 @@ static int mtk_napi_rx(struct napi_struc
@@ -1629,21 +1685,21 @@ static int mtk_napi_rx(struct napi_struc
do {
int rx_done;
@@ -286,7 +286,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (napi_complete_done(napi, rx_done_total))
mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
@@ -1698,20 +1754,20 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1706,20 +1762,20 @@ static int mtk_tx_alloc(struct mtk_eth *
*/
wmb();
@@ -314,7 +314,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
return 0;
@@ -1750,6 +1806,7 @@ static void mtk_tx_clean(struct mtk_eth
@@ -1758,6 +1814,7 @@ static void mtk_tx_clean(struct mtk_eth
static int mtk_rx_alloc(struct mtk_eth *eth, int ring_no, int rx_flag)
{
@@ -322,7 +322,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_rx_ring *ring;
int rx_data_len, rx_dma_size;
int i;
@@ -1818,16 +1875,18 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1826,16 +1883,18 @@ static int mtk_rx_alloc(struct mtk_eth *
ring->dma_size = rx_dma_size;
ring->calc_idx_update = false;
ring->calc_idx = rx_dma_size - 1;
@@ -345,7 +345,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
}
@@ -2139,9 +2198,9 @@ static int mtk_dma_busy_wait(struct mtk_
@@ -2147,9 +2206,9 @@ static int mtk_dma_busy_wait(struct mtk_
u32 val;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
@@ -357,7 +357,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ret = readx_poll_timeout_atomic(__raw_readl, eth->base + reg, val,
!(val & (MTK_RX_DMA_BUSY | MTK_TX_DMA_BUSY)),
@@ -2199,8 +2258,8 @@ static int mtk_dma_init(struct mtk_eth *
@@ -2207,8 +2266,8 @@ static int mtk_dma_init(struct mtk_eth *
* automatically
*/
mtk_w32(eth, FC_THRES_DROP_MODE | FC_THRES_DROP_EN |
@@ -368,7 +368,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
return 0;
@@ -2274,13 +2333,14 @@ static irqreturn_t mtk_handle_irq_tx(int
@@ -2282,13 +2341,14 @@ static irqreturn_t mtk_handle_irq_tx(int
static irqreturn_t mtk_handle_irq(int irq, void *_eth)
{
struct mtk_eth *eth = _eth;
@@ -387,7 +387,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_handle_irq_tx(irq, _eth);
}
@@ -2304,6 +2364,7 @@ static void mtk_poll_controller(struct n
@@ -2312,6 +2372,7 @@ static void mtk_poll_controller(struct n
static int mtk_start_dma(struct mtk_eth *eth)
{
u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0;
@@ -395,7 +395,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int err;
err = mtk_dma_init(eth);
@@ -2318,16 +2379,15 @@ static int mtk_start_dma(struct mtk_eth
@@ -2326,16 +2387,15 @@ static int mtk_start_dma(struct mtk_eth
MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO |
MTK_RX_DMA_EN | MTK_RX_2B_OFFSET |
MTK_RX_BT_32DWORDS,
@@ -415,7 +415,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
return 0;
@@ -2453,8 +2513,8 @@ static int mtk_stop(struct net_device *d
@@ -2461,8 +2521,8 @@ static int mtk_stop(struct net_device *d
cancel_work_sync(&eth->tx_dim.work);
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
@@ -426,7 +426,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_dma_free(eth);
@@ -2508,6 +2568,7 @@ static void mtk_dim_rx(struct work_struc
@@ -2516,6 +2576,7 @@ static void mtk_dim_rx(struct work_struc
{
struct dim *dim = container_of(work, struct dim, work);
struct mtk_eth *eth = container_of(dim, struct mtk_eth, rx_dim);
@@ -434,7 +434,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct dim_cq_moder cur_profile;
u32 val, cur;
@@ -2515,7 +2576,7 @@ static void mtk_dim_rx(struct work_struc
@@ -2523,7 +2584,7 @@ static void mtk_dim_rx(struct work_struc
dim->profile_ix);
spin_lock_bh(&eth->dim_lock);
@@ -443,7 +443,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
val &= MTK_PDMA_DELAY_TX_MASK;
val |= MTK_PDMA_DELAY_RX_EN;
@@ -2525,9 +2586,9 @@ static void mtk_dim_rx(struct work_struc
@@ -2533,9 +2594,9 @@ static void mtk_dim_rx(struct work_struc
cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK);
val |= cur << MTK_PDMA_DELAY_RX_PINT_SHIFT;
@@ -455,7 +455,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_bh(&eth->dim_lock);
@@ -2538,6 +2599,7 @@ static void mtk_dim_tx(struct work_struc
@@ -2546,6 +2607,7 @@ static void mtk_dim_tx(struct work_struc
{
struct dim *dim = container_of(work, struct dim, work);
struct mtk_eth *eth = container_of(dim, struct mtk_eth, tx_dim);
@@ -463,7 +463,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct dim_cq_moder cur_profile;
u32 val, cur;
@@ -2545,7 +2607,7 @@ static void mtk_dim_tx(struct work_struc
@@ -2553,7 +2615,7 @@ static void mtk_dim_tx(struct work_struc
dim->profile_ix);
spin_lock_bh(&eth->dim_lock);
@@ -472,7 +472,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
val &= MTK_PDMA_DELAY_RX_MASK;
val |= MTK_PDMA_DELAY_TX_EN;
@@ -2555,9 +2617,9 @@ static void mtk_dim_tx(struct work_struc
@@ -2563,9 +2625,9 @@ static void mtk_dim_tx(struct work_struc
cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK);
val |= cur << MTK_PDMA_DELAY_TX_PINT_SHIFT;
@@ -484,7 +484,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_bh(&eth->dim_lock);
@@ -2568,6 +2630,7 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2576,6 +2638,7 @@ static int mtk_hw_init(struct mtk_eth *e
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
ETHSYS_DMA_AG_MAP_PPE;
@@ -492,7 +492,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int i, val, ret;
if (test_and_set_bit(MTK_HW_INIT, &eth->state))
@@ -2642,10 +2705,10 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2650,10 +2713,10 @@ static int mtk_hw_init(struct mtk_eth *e
mtk_rx_irq_disable(eth, ~0);
/* FE int grouping */
@@ -507,7 +507,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
return 0;
@@ -3177,14 +3240,6 @@ static int mtk_probe(struct platform_dev
@@ -3185,14 +3248,6 @@ static int mtk_probe(struct platform_dev
if (IS_ERR(eth->base))
return PTR_ERR(eth->base);
@@ -522,7 +522,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
eth->rx_dma_l4_valid = RX_DMA_L4_VALID_PDMA;
eth->ip_align = NET_IP_ALIGN;
@@ -3418,6 +3473,7 @@ static int mtk_remove(struct platform_de
@@ -3426,6 +3481,7 @@ static int mtk_remove(struct platform_de
}
static const struct mtk_soc_data mt2701_data = {
@@ -530,7 +530,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.caps = MT7623_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP,
@@ -3429,6 +3485,7 @@ static const struct mtk_soc_data mt2701_
@@ -3437,6 +3493,7 @@ static const struct mtk_soc_data mt2701_
};
static const struct mtk_soc_data mt7621_data = {
@@ -538,7 +538,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.caps = MT7621_CAPS,
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7621_CLKS_BITMAP,
@@ -3441,6 +3498,7 @@ static const struct mtk_soc_data mt7621_
@@ -3449,6 +3506,7 @@ static const struct mtk_soc_data mt7621_
};
static const struct mtk_soc_data mt7622_data = {
@@ -546,7 +546,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.ana_rgc3 = 0x2028,
.caps = MT7622_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES,
@@ -3454,6 +3512,7 @@ static const struct mtk_soc_data mt7622_
@@ -3462,6 +3520,7 @@ static const struct mtk_soc_data mt7622_
};
static const struct mtk_soc_data mt7623_data = {
@@ -554,7 +554,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.caps = MT7623_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP,
@@ -3466,6 +3525,7 @@ static const struct mtk_soc_data mt7623_
@@ -3474,6 +3533,7 @@ static const struct mtk_soc_data mt7623_
};
static const struct mtk_soc_data mt7629_data = {
@@ -562,7 +562,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.ana_rgc3 = 0x128,
.caps = MT7629_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES,
@@ -3478,6 +3538,7 @@ static const struct mtk_soc_data mt7629_
@@ -3486,6 +3546,7 @@ static const struct mtk_soc_data mt7629_
};
static const struct mtk_soc_data rt5350_data = {

View File

@@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
} else {
nfrags += skb_shinfo(skb)->nr_frags;
@@ -1277,7 +1344,7 @@ static netdev_tx_t mtk_start_xmit(struct
@@ -1284,7 +1351,7 @@ static netdev_tx_t mtk_start_xmit(struct
if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
goto drop;
@@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
netif_stop_queue(dev);
netif_err(eth, tx_queued, dev,
@@ -1369,7 +1436,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1377,7 +1444,7 @@ static int mtk_poll_rx(struct napi_struc
int idx;
struct sk_buff *skb;
u8 *data, *new_data;
@@ -190,7 +190,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int done = 0, bytes = 0;
while (done < budget) {
@@ -1377,7 +1444,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1385,7 +1452,7 @@ static int mtk_poll_rx(struct napi_struc
unsigned int pktlen;
dma_addr_t dma_addr;
u32 hash, reason;
@@ -199,7 +199,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring = mtk_get_rx_ring(eth);
if (unlikely(!ring))
@@ -1387,16 +1454,15 @@ static int mtk_poll_rx(struct napi_struc
@@ -1395,16 +1462,15 @@ static int mtk_poll_rx(struct napi_struc
rxd = (void *)ring->dma + idx * eth->soc->txrx.rxd_size;
data = ring->data[idx];
@@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
!eth->netdev[mac]))
@@ -1442,7 +1508,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1450,7 +1516,7 @@ static int mtk_poll_rx(struct napi_struc
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
skb->dev = netdev;
skb_put(skb, pktlen);
@@ -231,7 +231,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb_checksum_none_assert(skb);
@@ -1460,10 +1526,25 @@ static int mtk_poll_rx(struct napi_struc
@@ -1468,10 +1534,25 @@ static int mtk_poll_rx(struct napi_struc
mtk_ppe_check_skb(eth->ppe, skb,
trxd.rxd4 & MTK_RXD4_FOE_ENTRY);
@@ -261,7 +261,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
skb_record_rx_queue(skb, 0);
napi_gro_receive(napi, skb);
@@ -1475,7 +1556,7 @@ release_desc:
@@ -1483,7 +1564,7 @@ release_desc:
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO;
else
@@ -270,7 +270,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->calc_idx = idx;
@@ -1677,7 +1758,8 @@ static int mtk_napi_rx(struct napi_struc
@@ -1685,7 +1766,8 @@ static int mtk_napi_rx(struct napi_struc
do {
int rx_done;
@@ -280,7 +280,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rx_done = mtk_poll_rx(napi, budget - rx_done_total, eth);
rx_done_total += rx_done;
@@ -1691,10 +1773,11 @@ static int mtk_napi_rx(struct napi_struc
@@ -1699,10 +1781,11 @@ static int mtk_napi_rx(struct napi_struc
if (rx_done_total == budget)
return budget;
@@ -294,7 +294,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return rx_done_total;
}
@@ -1704,7 +1787,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1712,7 +1795,7 @@ static int mtk_tx_alloc(struct mtk_eth *
const struct mtk_soc_data *soc = eth->soc;
struct mtk_tx_ring *ring = &eth->tx_ring;
int i, sz = soc->txrx.txd_size;
@@ -303,7 +303,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->buf = kcalloc(MTK_DMA_SIZE, sizeof(*ring->buf),
GFP_KERNEL);
@@ -1724,13 +1807,19 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1732,13 +1815,19 @@ static int mtk_tx_alloc(struct mtk_eth *
txd->txd2 = next_ptr;
txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
txd->txd4 = 0;
@@ -324,7 +324,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
&ring->phys_pdma, GFP_KERNEL);
if (!ring->dma_pdma)
@@ -1810,13 +1899,11 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1818,13 +1907,11 @@ static int mtk_rx_alloc(struct mtk_eth *
struct mtk_rx_ring *ring;
int rx_data_len, rx_dma_size;
int i;
@@ -338,7 +338,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else {
ring = &eth->rx_ring[ring_no];
}
@@ -1852,7 +1939,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1860,7 +1947,7 @@ static int mtk_rx_alloc(struct mtk_eth *
return -ENOMEM;
for (i = 0; i < rx_dma_size; i++) {
@@ -347,7 +347,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dma_addr_t dma_addr = dma_map_single(eth->dma_dev,
ring->data[i] + NET_SKB_PAD + eth->ip_align,
@@ -1867,26 +1954,47 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1875,26 +1962,47 @@ static int mtk_rx_alloc(struct mtk_eth *
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO;
else
@@ -403,7 +403,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
}
@@ -2311,7 +2419,7 @@ static irqreturn_t mtk_handle_irq_rx(int
@@ -2319,7 +2427,7 @@ static irqreturn_t mtk_handle_irq_rx(int
eth->rx_events++;
if (likely(napi_schedule_prep(&eth->rx_napi))) {
__napi_schedule(&eth->rx_napi);
@@ -412,7 +412,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
return IRQ_HANDLED;
@@ -2335,8 +2443,10 @@ static irqreturn_t mtk_handle_irq(int ir
@@ -2343,8 +2451,10 @@ static irqreturn_t mtk_handle_irq(int ir
struct mtk_eth *eth = _eth;
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
@@ -425,7 +425,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_handle_irq_rx(irq, _eth);
}
if (mtk_r32(eth, reg_map->tx_irq_mask) & MTK_TX_DONE_INT) {
@@ -2354,16 +2464,16 @@ static void mtk_poll_controller(struct n
@@ -2362,16 +2472,16 @@ static void mtk_poll_controller(struct n
struct mtk_eth *eth = mac->hw;
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
@@ -445,7 +445,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
int err;
@@ -2374,12 +2484,19 @@ static int mtk_start_dma(struct mtk_eth
@@ -2382,12 +2492,19 @@ static int mtk_start_dma(struct mtk_eth
}
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
@@ -471,7 +471,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_w32(eth,
MTK_RX_DMA_EN | rx_2b_offset |
MTK_RX_BT_32DWORDS | MTK_MULTI_EN,
@@ -2453,7 +2570,7 @@ static int mtk_open(struct net_device *d
@@ -2461,7 +2578,7 @@ static int mtk_open(struct net_device *d
napi_enable(&eth->tx_napi);
napi_enable(&eth->rx_napi);
mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
@@ -480,7 +480,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
refcount_set(&eth->dma_refcnt, 1);
}
else
@@ -2505,7 +2622,7 @@ static int mtk_stop(struct net_device *d
@@ -2513,7 +2630,7 @@ static int mtk_stop(struct net_device *d
mtk_gdm_config(eth, MTK_GDMA_DROP_ALL);
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
@@ -489,7 +489,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
napi_disable(&eth->tx_napi);
napi_disable(&eth->rx_napi);
@@ -2665,9 +2782,25 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2673,9 +2790,25 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
}
@@ -518,7 +518,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (eth->pctl) {
/* Set GE2 driving and slew rate */
@@ -2706,11 +2839,47 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2714,11 +2847,47 @@ static int mtk_hw_init(struct mtk_eth *e
/* FE int grouping */
mtk_w32(eth, MTK_TX_DONE_INT, reg_map->pdma.int_grp);
@@ -568,7 +568,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
err_disable_pm:
@@ -3240,12 +3409,8 @@ static int mtk_probe(struct platform_dev
@@ -3248,12 +3417,8 @@ static int mtk_probe(struct platform_dev
if (IS_ERR(eth->base))
return PTR_ERR(eth->base);
@@ -582,7 +582,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_lock_init(&eth->page_lock);
spin_lock_init(&eth->tx_irq_lock);
@@ -3481,6 +3646,10 @@ static const struct mtk_soc_data mt2701_
@@ -3489,6 +3654,10 @@ static const struct mtk_soc_data mt2701_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -593,7 +593,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3494,6 +3663,10 @@ static const struct mtk_soc_data mt7621_
@@ -3502,6 +3671,10 @@ static const struct mtk_soc_data mt7621_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -604,7 +604,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3508,6 +3681,10 @@ static const struct mtk_soc_data mt7622_
@@ -3516,6 +3689,10 @@ static const struct mtk_soc_data mt7622_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -615,7 +615,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3521,6 +3698,10 @@ static const struct mtk_soc_data mt7623_
@@ -3529,6 +3706,10 @@ static const struct mtk_soc_data mt7623_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -626,7 +626,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3534,6 +3715,10 @@ static const struct mtk_soc_data mt7629_
@@ -3542,6 +3723,10 @@ static const struct mtk_soc_data mt7629_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -637,7 +637,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3546,6 +3731,10 @@ static const struct mtk_soc_data rt5350_
@@ -3554,6 +3739,10 @@ static const struct mtk_soc_data rt5350_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),

View File

@@ -50,7 +50,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
@@ -1399,7 +1395,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
@@ -1407,7 +1403,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
ring = &eth->rx_ring[i];
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@@ -59,7 +59,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (rxd->rxd2 & RX_DMA_DONE) {
ring->calc_idx_update = true;
return ring;
@@ -1451,7 +1447,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1459,7 +1455,7 @@ static int mtk_poll_rx(struct napi_struc
goto rx_done;
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
data = ring->data[idx];
if (!mtk_rx_get_desc(eth, &trxd, rxd))
@@ -1658,7 +1654,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1666,7 +1662,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
mtk_tx_unmap(eth, tx_buf, true);
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->last_free = desc;
atomic_inc(&ring->free_count);
@@ -1803,7 +1799,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1811,7 +1807,7 @@ static int mtk_tx_alloc(struct mtk_eth *
int next = (i + 1) % MTK_DMA_SIZE;
u32 next_ptr = ring->phys + next * sz;
@@ -86,7 +86,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd->txd2 = next_ptr;
txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
txd->txd4 = 0;
@@ -1833,7 +1829,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1841,7 +1837,7 @@ static int mtk_tx_alloc(struct mtk_eth *
ring->dma_size = MTK_DMA_SIZE;
atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
@@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->last_free = (void *)txd;
ring->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz));
ring->thresh = MAX_SKB_FRAGS;
@@ -1948,7 +1944,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1956,7 +1952,7 @@ static int mtk_rx_alloc(struct mtk_eth *
if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr)))
return -ENOMEM;
@@ -104,7 +104,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rxd->rxd1 = (unsigned int)dma_addr;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
@@ -2010,7 +2006,7 @@ static void mtk_rx_clean(struct mtk_eth
@@ -2018,7 +2014,7 @@ static void mtk_rx_clean(struct mtk_eth
if (!ring->data[i])
continue;

View File

@@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg)
@@ -3718,6 +3755,21 @@ static const struct mtk_soc_data mt7629_
@@ -3726,6 +3763,21 @@ static const struct mtk_soc_data mt7629_
},
};
@@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static const struct mtk_soc_data rt5350_data = {
.reg_map = &mt7628_reg_map,
.caps = MT7628_CAPS,
@@ -3740,6 +3792,7 @@ const struct of_device_id of_mtk_match[]
@@ -3748,6 +3800,7 @@ const struct of_device_id of_mtk_match[]
{ .compatible = "mediatek,mt7622-eth", .data = &mt7622_data},
{ .compatible = "mediatek,mt7623-eth", .data = &mt7623_data},
{ .compatible = "mediatek,mt7629-eth", .data = &mt7629_data},

View File

@@ -12,7 +12,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1473,8 +1473,8 @@ static int mtk_poll_rx(struct napi_struc
@@ -1481,8 +1481,8 @@ static int mtk_poll_rx(struct napi_struc
int done = 0, bytes = 0;
while (done < budget) {
@@ -22,7 +22,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
dma_addr_t dma_addr;
u32 hash, reason;
int mac = 0;
@@ -1541,7 +1541,13 @@ static int mtk_poll_rx(struct napi_struc
@@ -1549,7 +1549,13 @@ static int mtk_poll_rx(struct napi_struc
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
skb->dev = netdev;
skb_put(skb, pktlen);
@@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb_checksum_none_assert(skb);
@@ -3765,6 +3771,7 @@ static const struct mtk_soc_data mt7986_
@@ -3773,6 +3779,7 @@ static const struct mtk_soc_data mt7986_
.txd_size = sizeof(struct mtk_tx_dma_v2),
.rxd_size = sizeof(struct mtk_rx_dma_v2),
.rx_irq_done_mask = MTK_RX_DONE_INT_V2,

View File

@@ -289,7 +289,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1365,10 +1365,8 @@ void b53_phylink_validate(struct dsa_swi
@@ -1390,10 +1390,8 @@ void b53_phylink_validate(struct dsa_swi
phylink_set(mask, 100baseT_Full);
}
@@ -343,7 +343,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int
--- a/drivers/net/dsa/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq_gswip.c
@@ -1452,10 +1452,8 @@ static void gswip_phylink_set_capab(unsi
@@ -1454,10 +1454,8 @@ static void gswip_phylink_set_capab(unsi
phylink_set(mask, 100baseT_Half);
phylink_set(mask, 100baseT_Full);
@@ -356,7 +356,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void gswip_xrx200_phylink_validate(struct dsa_switch *ds, int port,
@@ -1483,7 +1481,7 @@ static void gswip_xrx200_phylink_validat
@@ -1485,7 +1483,7 @@ static void gswip_xrx200_phylink_validat
goto unsupported;
break;
default:
@@ -365,7 +365,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dev_err(ds->dev, "Unsupported port: %i\n", port);
return;
}
@@ -1493,7 +1491,7 @@ static void gswip_xrx200_phylink_validat
@@ -1495,7 +1493,7 @@ static void gswip_xrx200_phylink_validat
return;
unsupported:
@@ -374,7 +374,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dev_err(ds->dev, "Unsupported interface '%s' for port %d\n",
phy_modes(state->interface), port);
}
@@ -1523,7 +1521,7 @@ static void gswip_xrx300_phylink_validat
@@ -1525,7 +1523,7 @@ static void gswip_xrx300_phylink_validat
goto unsupported;
break;
default:
@@ -383,7 +383,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dev_err(ds->dev, "Unsupported port: %i\n", port);
return;
}
@@ -1533,7 +1531,7 @@ static void gswip_xrx300_phylink_validat
@@ -1535,7 +1533,7 @@ static void gswip_xrx300_phylink_validat
return;
unsupported:

View File

@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3361,6 +3361,26 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3369,6 +3369,26 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV;

View File

@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.mac_pcs_get_state = mtk_mac_pcs_get_state,
.mac_an_restart = mtk_mac_an_restart,
.mac_config = mtk_mac_config,
@@ -3323,6 +3275,9 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3331,6 +3283,9 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV;

View File

@@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3275,6 +3275,10 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3283,6 +3283,10 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV;

View File

@@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3574,9 +3574,9 @@ static int mtk_probe(struct platform_dev
@@ -3582,9 +3582,9 @@ static int mtk_probe(struct platform_dev
*/
init_dummy_netdev(&eth->dummy_dev);
netif_napi_add(&eth->dummy_dev, &eth->tx_napi, mtk_napi_tx,

View File

@@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3270,7 +3270,6 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3278,7 +3278,6 @@ static int mtk_add_mac(struct mtk_eth *e
/* mac config is not set */
mac->interface = PHY_INTERFACE_MODE_NA;

View File

@@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 |
MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC |
MAC_MCR_FORCE_RX_FC);
@@ -3274,9 +3284,7 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3282,9 +3292,7 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV;

View File

@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
MediaTek SoC family.
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1388,6 +1388,68 @@ static void mtk_update_rx_cpu_idx(struct
@@ -1396,6 +1396,68 @@ static void mtk_update_rx_cpu_idx(struct
}
}
@@ -96,7 +96,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_poll_rx(struct napi_struct *napi, int budget,
struct mtk_eth *eth)
{
@@ -1401,9 +1463,9 @@ static int mtk_poll_rx(struct napi_struc
@@ -1409,9 +1471,9 @@ static int mtk_poll_rx(struct napi_struc
while (done < budget) {
unsigned int pktlen, *rxdcsum;
@@ -107,7 +107,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int mac = 0;
ring = mtk_get_rx_ring(eth);
@@ -1434,36 +1496,54 @@ static int mtk_poll_rx(struct napi_struc
@@ -1442,36 +1504,54 @@ static int mtk_poll_rx(struct napi_struc
goto release_desc;
/* alloc new buffer */
@@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
skb->dev = netdev;
@@ -1517,7 +1597,6 @@ static int mtk_poll_rx(struct napi_struc
@@ -1525,7 +1605,6 @@ static int mtk_poll_rx(struct napi_struc
skip_rx:
ring->data[idx] = new_data;
rxd->rxd1 = (unsigned int)dma_addr;
@@ -192,7 +192,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
release_desc:
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO;
@@ -1525,7 +1604,6 @@ release_desc:
@@ -1533,7 +1612,6 @@ release_desc:
rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
ring->calc_idx = idx;
@@ -200,7 +200,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
done++;
}
@@ -1889,13 +1967,15 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1897,13 +1975,15 @@ static int mtk_rx_alloc(struct mtk_eth *
if (!ring->data)
return -ENOMEM;
@@ -223,7 +223,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
ring->dma = dma_alloc_coherent(eth->dma_dev,
@@ -1906,16 +1986,33 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1914,16 +1994,33 @@ static int mtk_rx_alloc(struct mtk_eth *
for (i = 0; i < rx_dma_size; i++) {
struct mtk_rx_dma_v2 *rxd;
@@ -264,7 +264,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO;
@@ -1931,6 +2028,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1939,6 +2036,7 @@ static int mtk_rx_alloc(struct mtk_eth *
rxd->rxd8 = 0;
}
}
@@ -272,7 +272,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->dma_size = rx_dma_size;
ring->calc_idx_update = false;
ring->calc_idx = rx_dma_size - 1;
@@ -1982,7 +2080,7 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1990,7 +2088,7 @@ static void mtk_rx_clean(struct mtk_eth
dma_unmap_single(eth->dma_dev, rxd->rxd1,
ring->buf_size, DMA_FROM_DEVICE);
@@ -281,7 +281,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
kfree(ring->data);
ring->data = NULL;
@@ -1994,6 +2092,13 @@ static void mtk_rx_clean(struct mtk_eth
@@ -2002,6 +2100,13 @@ static void mtk_rx_clean(struct mtk_eth
ring->dma, ring->phys);
ring->dma = NULL;
}

View File

@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1388,6 +1388,11 @@ static void mtk_update_rx_cpu_idx(struct
@@ -1396,6 +1396,11 @@ static void mtk_update_rx_cpu_idx(struct
}
}
@@ -30,7 +30,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static struct page_pool *mtk_create_page_pool(struct mtk_eth *eth,
struct xdp_rxq_info *xdp_q,
int id, int size)
@@ -1450,11 +1455,52 @@ static void mtk_rx_put_buff(struct mtk_r
@@ -1458,11 +1463,52 @@ static void mtk_rx_put_buff(struct mtk_r
skb_free_frag(data);
}
@@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int idx;
struct sk_buff *skb;
u8 *data, *new_data;
@@ -1463,9 +1509,9 @@ static int mtk_poll_rx(struct napi_struc
@@ -1471,9 +1517,9 @@ static int mtk_poll_rx(struct napi_struc
while (done < budget) {
unsigned int pktlen, *rxdcsum;
@@ -94,7 +94,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int mac = 0;
ring = mtk_get_rx_ring(eth);
@@ -1495,8 +1541,14 @@ static int mtk_poll_rx(struct napi_struc
@@ -1503,8 +1549,14 @@ static int mtk_poll_rx(struct napi_struc
if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
goto release_desc;
@@ -109,7 +109,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
new_data = mtk_page_pool_get_buff(ring->page_pool,
&dma_addr,
GFP_ATOMIC);
@@ -1504,6 +1556,34 @@ static int mtk_poll_rx(struct napi_struc
@@ -1512,6 +1564,34 @@ static int mtk_poll_rx(struct napi_struc
netdev->stats.rx_dropped++;
goto release_desc;
}
@@ -144,7 +144,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else {
if (ring->frag_size <= PAGE_SIZE)
new_data = napi_alloc_frag(ring->frag_size);
@@ -1527,27 +1607,20 @@ static int mtk_poll_rx(struct napi_struc
@@ -1535,27 +1615,20 @@ static int mtk_poll_rx(struct napi_struc
dma_unmap_single(eth->dma_dev, trxd.rxd1,
ring->buf_size, DMA_FROM_DEVICE);
@@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
rxdcsum = &trxd.rxd3;
@@ -1559,7 +1632,6 @@ static int mtk_poll_rx(struct napi_struc
@@ -1567,7 +1640,6 @@ static int mtk_poll_rx(struct napi_struc
else
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev);
@@ -189,7 +189,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
hash = trxd.rxd4 & MTK_RXD4_FOE_ENTRY;
if (hash != MTK_RXD4_FOE_ENTRY) {
@@ -1622,6 +1694,9 @@ rx_done:
@@ -1630,6 +1702,9 @@ rx_done:
&dim_sample);
net_dim(&eth->rx_dim, dim_sample);
@@ -199,7 +199,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return done;
}
@@ -1967,7 +2042,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1975,7 +2050,7 @@ static int mtk_rx_alloc(struct mtk_eth *
if (!ring->data)
return -ENOMEM;
@@ -208,7 +208,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct page_pool *pp;
pp = mtk_create_page_pool(eth, &ring->xdp_q, ring_no,
@@ -2712,6 +2787,48 @@ static int mtk_stop(struct net_device *d
@@ -2720,6 +2795,48 @@ static int mtk_stop(struct net_device *d
return 0;
}
@@ -257,7 +257,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void ethsys_reset(struct mtk_eth *eth, u32 reset_bits)
{
regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL,
@@ -2990,6 +3107,12 @@ static int mtk_change_mtu(struct net_dev
@@ -2998,6 +3115,12 @@ static int mtk_change_mtu(struct net_dev
struct mtk_eth *eth = mac->hw;
u32 mcr_cur, mcr_new;
@@ -270,7 +270,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK;
@@ -3316,6 +3439,7 @@ static const struct net_device_ops mtk_n
@@ -3324,6 +3447,7 @@ static const struct net_device_ops mtk_n
.ndo_poll_controller = mtk_poll_controller,
#endif
.ndo_setup_tc = mtk_eth_setup_tc,

View File

@@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const char * const mtk_clks_source_name[] = {
@@ -1458,6 +1469,9 @@ static void mtk_rx_put_buff(struct mtk_r
@@ -1466,6 +1477,9 @@ static void mtk_rx_put_buff(struct mtk_r
static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
struct xdp_buff *xdp, struct net_device *dev)
{
@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct bpf_prog *prog;
u32 act = XDP_PASS;
@@ -1470,13 +1484,16 @@ static u32 mtk_xdp_run(struct mtk_eth *e
@@ -1478,13 +1492,16 @@ static u32 mtk_xdp_run(struct mtk_eth *e
act = bpf_prog_run_xdp(prog, xdp);
switch (act) {
case XDP_PASS:
@@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
@@ -1489,6 +1506,11 @@ static u32 mtk_xdp_run(struct mtk_eth *e
@@ -1497,6 +1514,11 @@ static u32 mtk_xdp_run(struct mtk_eth *e
page_pool_put_full_page(ring->page_pool,
virt_to_head_page(xdp->data), true);

View File

@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
if (k & 0x1)
@@ -1414,13 +1426,14 @@ static struct page_pool *mtk_create_page
@@ -1422,13 +1434,14 @@ static struct page_pool *mtk_create_page
.pool_size = size,
.nid = NUMA_NO_NODE,
.dev = eth->dma_dev,
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
pp = page_pool_create(&pp_params);
if (IS_ERR(pp))
return pp;
@@ -1466,6 +1479,122 @@ static void mtk_rx_put_buff(struct mtk_r
@@ -1474,6 +1487,122 @@ static void mtk_rx_put_buff(struct mtk_r
skb_free_frag(data);
}
@@ -216,7 +216,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
struct xdp_buff *xdp, struct net_device *dev)
{
@@ -1494,6 +1623,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e
@@ -1502,6 +1631,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e
count = &hw_stats->xdp_stats.rx_xdp_redirect;
goto update_stats;
@@ -235,7 +235,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
@@ -1727,9 +1868,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1735,9 +1876,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
{
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -246,7 +246,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 cpu, dma;
cpu = ring->last_free_ptr;
@@ -1750,15 +1890,21 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1758,15 +1898,21 @@ static int mtk_poll_tx_qdma(struct mtk_e
if (tx_buf->flags & MTK_TX_FLAGS_FPORT1)
mac = 1;
@@ -271,7 +271,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_tx_unmap(eth, tx_buf, true);
ring->last_free = desc;
@@ -1777,9 +1923,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1785,9 +1931,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
unsigned int *done, unsigned int *bytes)
{
struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -282,7 +282,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 cpu, dma;
cpu = ring->cpu_idx;
@@ -1787,14 +1932,18 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1795,14 +1940,18 @@ static int mtk_poll_tx_pdma(struct mtk_e
while ((cpu != dma) && budget) {
tx_buf = &ring->buf[cpu];
@@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
mtk_tx_unmap(eth, tx_buf, true);
@@ -3462,6 +3611,7 @@ static const struct net_device_ops mtk_n
@@ -3470,6 +3619,7 @@ static const struct net_device_ops mtk_n
#endif
.ndo_setup_tc = mtk_eth_setup_tc,
.ndo_bpf = mtk_xdp,

View File

@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
MediaTek SoC family.
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3473,11 +3473,18 @@ static void mtk_get_strings(struct net_d
@@ -3481,11 +3481,18 @@ static void mtk_get_strings(struct net_d
int i;
switch (stringset) {
@@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
}
}
@@ -3485,13 +3492,35 @@ static void mtk_get_strings(struct net_d
@@ -3493,13 +3500,35 @@ static void mtk_get_strings(struct net_d
static int mtk_get_sset_count(struct net_device *dev, int sset)
{
switch (sset) {
@@ -84,7 +84,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void mtk_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
@@ -3519,6 +3548,8 @@ static void mtk_get_ethtool_stats(struct
@@ -3527,6 +3556,8 @@ static void mtk_get_ethtool_stats(struct
for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++)
*data_dst++ = *(data_src + mtk_ethtool_stats[i].offset);

View File

@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1479,6 +1479,41 @@ static void mtk_rx_put_buff(struct mtk_r
@@ -1487,6 +1487,41 @@ static void mtk_rx_put_buff(struct mtk_r
skb_free_frag(data);
}
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_xdp_submit_frame(struct mtk_eth *eth, struct xdp_frame *xdpf,
struct net_device *dev, bool dma_map)
{
@@ -1489,9 +1524,8 @@ static int mtk_xdp_submit_frame(struct m
@@ -1497,9 +1532,8 @@ static int mtk_xdp_submit_frame(struct m
.first = true,
.last = true,
};
@@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_buf *tx_buf;
if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
@@ -1511,36 +1545,18 @@ static int mtk_xdp_submit_frame(struct m
@@ -1519,36 +1553,18 @@ static int mtk_xdp_submit_frame(struct m
tx_buf = mtk_desc_to_tx_buf(ring, txd, soc->txrx.txd_size);
memset(tx_buf, 0, sizeof(*tx_buf));

View File

@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
tx_buf->flags = 0;
tx_buf->data = NULL;
@@ -1506,6 +1505,8 @@ static int mtk_xdp_frame_map(struct mtk_
@@ -1514,6 +1513,8 @@ static int mtk_xdp_frame_map(struct mtk_
mtk_tx_set_dma_desc(dev, txd, txd_info);
tx_buf->flags |= !mac->id ? MTK_TX_FLAGS_FPORT0 : MTK_TX_FLAGS_FPORT1;
@@ -56,7 +56,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd_pdma = qdma_to_pdma(ring, txd);
setup_tx_buf(eth, tx_buf, txd_pdma, txd_info->addr, txd_info->size,
@@ -1517,43 +1518,69 @@ static int mtk_xdp_frame_map(struct mtk_
@@ -1525,43 +1526,69 @@ static int mtk_xdp_frame_map(struct mtk_
static int mtk_xdp_submit_frame(struct mtk_eth *eth, struct xdp_frame *xdpf,
struct net_device *dev, bool dma_map)
{
@@ -140,7 +140,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
txd_pdma = qdma_to_pdma(ring, txd);
@@ -1580,7 +1607,24 @@ static int mtk_xdp_submit_frame(struct m
@@ -1588,7 +1615,24 @@ static int mtk_xdp_submit_frame(struct m
mtk_w32(eth, NEXT_DESP_IDX(idx, ring->dma_size),
MT7628_TX_CTX_IDX0);
}
@@ -166,7 +166,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock(&eth->page_lock);
return err;
@@ -1909,18 +1953,15 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1917,18 +1961,15 @@ static int mtk_poll_tx_qdma(struct mtk_e
if (!tx_buf->data)
break;
@@ -191,7 +191,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_tx_unmap(eth, tx_buf, true);
ring->last_free = desc;
@@ -1951,17 +1992,15 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1959,17 +2000,15 @@ static int mtk_poll_tx_pdma(struct mtk_e
if (!tx_buf->data)
break;

View File

@@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1845,10 +1845,19 @@ static int mtk_poll_rx(struct napi_struc
@@ -1853,10 +1853,19 @@ static int mtk_poll_rx(struct napi_struc
skb->dev = netdev;
bytes += skb->len;
@@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (*rxdcsum & eth->soc->txrx.rx_dma_l4_valid)
skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -1856,16 +1865,9 @@ static int mtk_poll_rx(struct napi_struc
@@ -1864,16 +1873,9 @@ static int mtk_poll_rx(struct napi_struc
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev);

View File

@@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1412,7 +1412,7 @@ static void mtk_update_rx_cpu_idx(struct
@@ -1420,7 +1420,7 @@ static void mtk_update_rx_cpu_idx(struct
static bool mtk_page_pool_enabled(struct mtk_eth *eth)
{

View File

@@ -57,7 +57,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
};
/* strings used by ethtool */
@@ -2927,6 +2931,7 @@ static int mtk_open(struct net_device *d
@@ -2935,6 +2939,7 @@ static int mtk_open(struct net_device *d
/* we run 2 netdevs on the same dma ring so we only bring it up once */
if (!refcount_read(&eth->dma_refcnt)) {
@@ -65,7 +65,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
u32 gdm_config = MTK_GDMA_TO_PDMA;
int err;
@@ -2936,15 +2941,15 @@ static int mtk_open(struct net_device *d
@@ -2944,15 +2949,15 @@ static int mtk_open(struct net_device *d
return err;
}
@@ -84,7 +84,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
refcount_set(&eth->dma_refcnt, 1);
}
else
@@ -4043,7 +4048,9 @@ static int mtk_probe(struct platform_dev
@@ -4051,7 +4056,9 @@ static int mtk_probe(struct platform_dev
}
if (eth->soc->offload_version) {

View File

@@ -44,7 +44,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4146,6 +4146,7 @@ static const struct mtk_soc_data mt7621_
@@ -4154,6 +4154,7 @@ static const struct mtk_soc_data mt7621_
.required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false,
.offload_version = 2,
@@ -52,7 +52,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4164,6 +4165,7 @@ static const struct mtk_soc_data mt7622_
@@ -4172,6 +4173,7 @@ static const struct mtk_soc_data mt7622_
.required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false,
.offload_version = 2,
@@ -60,7 +60,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4181,6 +4183,7 @@ static const struct mtk_soc_data mt7623_
@@ -4189,6 +4191,7 @@ static const struct mtk_soc_data mt7623_
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.offload_version = 2,
@@ -68,7 +68,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4214,6 +4217,7 @@ static const struct mtk_soc_data mt7986_
@@ -4222,6 +4225,7 @@ static const struct mtk_soc_data mt7986_
.caps = MT7986_CAPS,
.required_clks = MT7986_CLKS_BITMAP,
.required_pctl = false,

View File

@@ -48,7 +48,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1871,7 +1871,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1879,7 +1879,7 @@ static int mtk_poll_rx(struct napi_struc
reason = FIELD_GET(MTK_RXD4_PPE_CPU_REASON, trxd.rxd4);
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
@@ -57,7 +57,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
@@ -2932,7 +2932,8 @@ static int mtk_open(struct net_device *d
@@ -2940,7 +2940,8 @@ static int mtk_open(struct net_device *d
/* we run 2 netdevs on the same dma ring so we only bring it up once */
if (!refcount_read(&eth->dma_refcnt)) {
const struct mtk_soc_data *soc = eth->soc;
@@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
int err;
err = mtk_start_dma(eth);
@@ -2941,8 +2942,11 @@ static int mtk_open(struct net_device *d
@@ -2949,8 +2950,11 @@ static int mtk_open(struct net_device *d
return err;
}
@@ -81,7 +81,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
mtk_gdm_config(eth, gdm_config);
@@ -2987,6 +2991,7 @@ static int mtk_stop(struct net_device *d
@@ -2995,6 +2999,7 @@ static int mtk_stop(struct net_device *d
{
struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw;
@@ -89,7 +89,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
phylink_stop(mac->phylink);
@@ -3014,8 +3019,8 @@ static int mtk_stop(struct net_device *d
@@ -3022,8 +3027,8 @@ static int mtk_stop(struct net_device *d
mtk_dma_free(eth);
@@ -100,7 +100,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
return 0;
}
@@ -4048,12 +4053,19 @@ static int mtk_probe(struct platform_dev
@@ -4056,12 +4061,19 @@ static int mtk_probe(struct platform_dev
}
if (eth->soc->offload_version) {

View File

@@ -39,7 +39,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
};
/* strings used by ethtool */
@@ -3965,16 +3973,12 @@ static int mtk_probe(struct platform_dev
@@ -3973,16 +3981,12 @@ static int mtk_probe(struct platform_dev
for (i = 0;; i++) {
struct device_node *np = of_parse_phandle(pdev->dev.of_node,
"mediatek,wed", i);

View File

@@ -21,7 +21,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4163,6 +4163,7 @@ static const struct mtk_soc_data mt7621_
@@ -4171,6 +4171,7 @@ static const struct mtk_soc_data mt7621_
.required_pctl = false,
.offload_version = 2,
.hash_offset = 2,
@@ -29,7 +29,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4182,6 +4183,7 @@ static const struct mtk_soc_data mt7622_
@@ -4190,6 +4191,7 @@ static const struct mtk_soc_data mt7622_
.required_pctl = false,
.offload_version = 2,
.hash_offset = 2,
@@ -37,7 +37,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4200,6 +4202,7 @@ static const struct mtk_soc_data mt7623_
@@ -4208,6 +4210,7 @@ static const struct mtk_soc_data mt7623_
.required_pctl = true,
.offload_version = 2,
.hash_offset = 2,

View File

@@ -26,7 +26,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3890,6 +3890,7 @@ void mtk_eth_set_dma_device(struct mtk_e
@@ -3898,6 +3898,7 @@ void mtk_eth_set_dma_device(struct mtk_e
static int mtk_probe(struct platform_device *pdev)
{
@@ -34,7 +34,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
struct device_node *mac_np;
struct mtk_eth *eth;
int err, i;
@@ -3970,16 +3971,31 @@ static int mtk_probe(struct platform_dev
@@ -3978,16 +3979,31 @@ static int mtk_probe(struct platform_dev
}
}

View File

@@ -26,7 +26,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1858,12 +1858,14 @@ static int mtk_poll_rx(struct napi_struc
@@ -1866,12 +1866,14 @@ static int mtk_poll_rx(struct napi_struc
bytes += skb->len;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
@@ -41,7 +41,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
hash = trxd.rxd4 & MTK_RXD4_FOE_ENTRY;
if (hash != MTK_RXD4_FOE_ENTRY)
skb_set_hash(skb, jhash_1word(hash, 0),
@@ -1877,7 +1879,6 @@ static int mtk_poll_rx(struct napi_struc
@@ -1885,7 +1887,6 @@ static int mtk_poll_rx(struct napi_struc
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev);
@@ -49,7 +49,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
mtk_ppe_check_skb(eth->ppe[0], skb, hash);
@@ -4179,7 +4180,7 @@ static const struct mtk_soc_data mt7621_
@@ -4187,7 +4188,7 @@ static const struct mtk_soc_data mt7621_
.required_pctl = false,
.offload_version = 2,
.hash_offset = 2,
@@ -58,7 +58,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4199,7 +4200,7 @@ static const struct mtk_soc_data mt7622_
@@ -4207,7 +4208,7 @@ static const struct mtk_soc_data mt7622_
.required_pctl = false,
.offload_version = 2,
.hash_offset = 2,
@@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4218,7 +4219,7 @@ static const struct mtk_soc_data mt7623_
@@ -4226,7 +4227,7 @@ static const struct mtk_soc_data mt7623_
.required_pctl = true,
.offload_version = 2,
.hash_offset = 2,
@@ -76,7 +76,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4250,9 +4251,11 @@ static const struct mtk_soc_data mt7986_
@@ -4258,9 +4259,11 @@ static const struct mtk_soc_data mt7986_
.reg_map = &mt7986_reg_map,
.ana_rgc3 = 0x128,
.caps = MT7986_CAPS,

View File

@@ -16,7 +16,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4254,6 +4254,7 @@ static const struct mtk_soc_data mt7986_
@@ -4262,6 +4262,7 @@ static const struct mtk_soc_data mt7986_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7986_CLKS_BITMAP,
.required_pctl = false,

View File

@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4006,19 +4006,23 @@ static int mtk_probe(struct platform_dev
@@ -4014,19 +4014,23 @@ static int mtk_probe(struct platform_dev
eth->irq[i] = platform_get_irq(pdev, i);
if (eth->irq[i] < 0) {
dev_err(&pdev->dev, "no IRQ%d resource found\n", i);
@@ -45,7 +45,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
eth->clks[i] = NULL;
}
@@ -4029,7 +4033,7 @@ static int mtk_probe(struct platform_dev
@@ -4037,7 +4041,7 @@ static int mtk_probe(struct platform_dev
err = mtk_hw_init(eth);
if (err)
@@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
eth->hwlro = MTK_HAS_CAPS(eth->soc->caps, MTK_HWLRO);
@@ -4127,6 +4131,8 @@ err_free_dev:
@@ -4135,6 +4139,8 @@ err_free_dev:
mtk_free_dev(eth);
err_deinit_hw:
mtk_hw_deinit(eth);
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return err;
}
@@ -4146,6 +4152,7 @@ static int mtk_remove(struct platform_de
@@ -4154,6 +4160,7 @@ static int mtk_remove(struct platform_de
phylink_disconnect_phy(mac->phylink);
}

View File

@@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4089,13 +4089,13 @@ static int mtk_probe(struct platform_dev
@@ -4097,13 +4097,13 @@ static int mtk_probe(struct platform_dev
eth->soc->offload_version, i);
if (!eth->ppe[i]) {
err = -ENOMEM;

View File

@@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4089,13 +4089,13 @@ static int mtk_probe(struct platform_dev
@@ -4097,13 +4097,13 @@ static int mtk_probe(struct platform_dev
eth->soc->offload_version, i);
if (!eth->ppe[i]) {
err = -ENOMEM;
@@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
for (i = 0; i < MTK_MAX_DEVS; i++) {
@@ -4105,7 +4105,7 @@ static int mtk_probe(struct platform_dev
@@ -4113,7 +4113,7 @@ static int mtk_probe(struct platform_dev
err = register_netdev(eth->netdev[i]);
if (err) {
dev_err(eth->dev, "error bringing up device\n");
@@ -46,7 +46,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
} else
netif_info(eth, probe, eth->netdev[i],
"mediatek frame engine at 0x%08lx, irq %d\n",
@@ -4125,7 +4125,8 @@ static int mtk_probe(struct platform_dev
@@ -4133,7 +4133,8 @@ static int mtk_probe(struct platform_dev
return 0;

View File

@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3178,6 +3178,30 @@ static void mtk_dim_tx(struct work_struc
@@ -3186,6 +3186,30 @@ static void mtk_dim_tx(struct work_struc
dim->state = DIM_START_MEASURE;
}
@@ -45,7 +45,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_hw_init(struct mtk_eth *eth)
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
@@ -3252,8 +3276,16 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3260,8 +3284,16 @@ static int mtk_hw_init(struct mtk_eth *e
* up with the more appropriate value when mtk_mac_config call is being
* invoked.
*/
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Indicates CDM to parse the MTK special tag from CPU
* which also is working out for untag packets.
@@ -3352,7 +3384,6 @@ static int mtk_change_mtu(struct net_dev
@@ -3360,7 +3392,6 @@ static int mtk_change_mtu(struct net_dev
int length = new_mtu + MTK_RX_ETH_HLEN;
struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw;
@@ -71,7 +71,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (rcu_access_pointer(eth->prog) &&
length > MTK_PP_MAX_BUF_SIZE) {
@@ -3360,23 +3391,7 @@ static int mtk_change_mtu(struct net_dev
@@ -3368,23 +3399,7 @@ static int mtk_change_mtu(struct net_dev
return -EINVAL;
}

View File

@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3422,11 +3422,8 @@ static void mtk_pending_work(struct work
@@ -3430,11 +3430,8 @@ static void mtk_pending_work(struct work
rtnl_lock();
dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
@@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* stop all devices to make sure that dma is properly shut down */
for (i = 0; i < MTK_MAC_COUNT; i++) {
if (!eth->netdev[i])
@@ -3460,7 +3457,7 @@ static void mtk_pending_work(struct work
@@ -3468,7 +3465,7 @@ static void mtk_pending_work(struct work
dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);

View File

@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3241,16 +3241,17 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3249,16 +3249,17 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
}

View File

@@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3202,6 +3202,27 @@ static void mtk_set_mcr_max_rx(struct mt
@@ -3210,6 +3210,27 @@ static void mtk_set_mcr_max_rx(struct mt
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
}
@@ -44,7 +44,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static int mtk_hw_init(struct mtk_eth *eth)
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
@@ -3241,22 +3262,9 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3249,22 +3270,9 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
}

View File

@@ -17,7 +17,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3223,7 +3223,54 @@ static void mtk_hw_reset(struct mtk_eth
@@ -3231,7 +3231,54 @@ static void mtk_hw_reset(struct mtk_eth
0x3ffffff);
}
@@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
ETHSYS_DMA_AG_MAP_PPE;
@@ -3262,7 +3309,12 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3270,7 +3317,12 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
}
@@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
/* Set FE to PDMAv2 if necessary */
@@ -3450,7 +3502,7 @@ static void mtk_pending_work(struct work
@@ -3458,7 +3510,7 @@ static void mtk_pending_work(struct work
if (eth->dev->pins)
pinctrl_select_state(eth->dev->pins->p,
eth->dev->pins->default_state);
@@ -96,7 +96,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* restart DMA and enable IRQs */
for (i = 0; i < MTK_MAC_COUNT; i++) {
@@ -4052,7 +4104,7 @@ static int mtk_probe(struct platform_dev
@@ -4060,7 +4112,7 @@ static int mtk_probe(struct platform_dev
eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE);
INIT_WORK(&eth->pending_work, mtk_pending_work);

View File

@@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2788,14 +2788,29 @@ static void mtk_dma_free(struct mtk_eth
@@ -2796,14 +2796,29 @@ static void mtk_dma_free(struct mtk_eth
kfree(eth->scratch_head);
}
@@ -48,7 +48,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
schedule_work(&eth->pending_work);
}
@@ -3277,15 +3292,17 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3285,15 +3300,17 @@ static int mtk_hw_init(struct mtk_eth *e
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
int i, val, ret;
@@ -72,7 +72,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (eth->ethsys)
regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, dma_mask,
@@ -3411,8 +3428,10 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3419,8 +3436,10 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
err_disable_pm:
@@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return ret;
}
@@ -3474,30 +3493,53 @@ static int mtk_do_ioctl(struct net_devic
@@ -3482,30 +3501,53 @@ static int mtk_do_ioctl(struct net_devic
return -EOPNOTSUPP;
}
@@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (eth->dev->pins)
pinctrl_select_state(eth->dev->pins->p,
@@ -3508,15 +3550,19 @@ static void mtk_pending_work(struct work
@@ -3516,15 +3558,19 @@ static void mtk_pending_work(struct work
for (i = 0; i < MTK_MAC_COUNT; i++) {
if (!test_bit(i, &restart))
continue;

View File

@@ -49,7 +49,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
};
/* strings used by ethtool */
@@ -3285,6 +3291,102 @@ static void mtk_hw_warm_reset(struct mtk
@@ -3293,6 +3299,102 @@ static void mtk_hw_warm_reset(struct mtk
val, rst_mask);
}
@@ -152,7 +152,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static int mtk_hw_init(struct mtk_eth *eth, bool reset)
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
@@ -3600,6 +3702,7 @@ static int mtk_cleanup(struct mtk_eth *e
@@ -3608,6 +3710,7 @@ static int mtk_cleanup(struct mtk_eth *e
mtk_unreg_dev(eth);
mtk_free_dev(eth);
cancel_work_sync(&eth->pending_work);
@@ -160,7 +160,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return 0;
}
@@ -4037,6 +4140,7 @@ static int mtk_probe(struct platform_dev
@@ -4045,6 +4148,7 @@ static int mtk_probe(struct platform_dev
eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
INIT_WORK(&eth->rx_dim.work, mtk_dim_rx);
@@ -168,7 +168,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
INIT_WORK(&eth->tx_dim.work, mtk_dim_tx);
@@ -4241,6 +4345,8 @@ static int mtk_probe(struct platform_dev
@@ -4249,6 +4353,8 @@ static int mtk_probe(struct platform_dev
NAPI_POLL_WEIGHT);
platform_set_drvdata(pdev, eth);

View File

@@ -14,7 +14,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3631,6 +3631,11 @@ static void mtk_pending_work(struct work
@@ -3639,6 +3639,11 @@ static void mtk_pending_work(struct work
set_bit(MTK_RESETTING, &eth->state);
mtk_prepare_for_reset(eth);
@@ -26,7 +26,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* stop all devices to make sure that dma is properly shut down */
for (i = 0; i < MTK_MAC_COUNT; i++) {
@@ -3668,6 +3673,8 @@ static void mtk_pending_work(struct work
@@ -3676,6 +3681,8 @@ static void mtk_pending_work(struct work
clear_bit(MTK_RESETTING, &eth->state);

View File

@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
dma_addr_t dma_addr;
int i;
@@ -2154,19 +2154,25 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -2162,19 +2162,25 @@ static int mtk_tx_alloc(struct mtk_eth *
struct mtk_tx_ring *ring = &eth->tx_ring;
int i, sz = soc->txrx.txd_size;
struct mtk_tx_dma_v2 *txd;
@@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
u32 next_ptr = ring->phys + next * sz;
txd = ring->dma + i * sz;
@@ -2186,22 +2192,22 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -2194,22 +2200,22 @@ static int mtk_tx_alloc(struct mtk_eth *
* descriptors in ring->dma_pdma.
*/
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
@@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->thresh = MAX_SKB_FRAGS;
/* make sure that all changes to the dma ring are flushed before we
@@ -2213,14 +2219,14 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -2221,14 +2227,14 @@ static int mtk_tx_alloc(struct mtk_eth *
mtk_w32(eth, ring->phys, soc->reg_map->qdma.ctx_ptr);
mtk_w32(eth, ring->phys, soc->reg_map->qdma.dtx_ptr);
mtk_w32(eth,
@@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
mtk_w32(eth, 0, MT7628_TX_CTX_IDX0);
mtk_w32(eth, MT7628_PST_DTX_IDX0, soc->reg_map->pdma.rst_idx);
}
@@ -2238,7 +2244,7 @@ static void mtk_tx_clean(struct mtk_eth
@@ -2246,7 +2252,7 @@ static void mtk_tx_clean(struct mtk_eth
int i;
if (ring->buf) {
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
mtk_tx_unmap(eth, &ring->buf[i], false);
kfree(ring->buf);
ring->buf = NULL;
@@ -2246,14 +2252,14 @@ static void mtk_tx_clean(struct mtk_eth
@@ -2254,14 +2260,14 @@ static void mtk_tx_clean(struct mtk_eth
if (ring->dma) {
dma_free_coherent(eth->dma_dev,
@@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->dma_pdma, ring->phys_pdma);
ring->dma_pdma = NULL;
}
@@ -2776,7 +2782,7 @@ static void mtk_dma_free(struct mtk_eth
@@ -2784,7 +2790,7 @@ static void mtk_dma_free(struct mtk_eth
netdev_reset_queue(eth->netdev[i]);
if (eth->scratch_ring) {
dma_free_coherent(eth->dma_dev,

View File

@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4424,7 +4424,7 @@ static const struct mtk_soc_data mt7621_
@@ -4432,7 +4432,7 @@ static const struct mtk_soc_data mt7621_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false,
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
.hash_offset = 2,
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
.txrx = {
@@ -4463,7 +4463,7 @@ static const struct mtk_soc_data mt7623_
@@ -4471,7 +4471,7 @@ static const struct mtk_soc_data mt7623_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,

Some files were not shown because too many files have changed in this diff Show More