kernel: bump 5.15 to 5.15.153

Removed because they are upstream:
generic/backport-5.15/704-15-v5.19-net-mtk_eth_soc-move-MAC_MCR-setting-to-mac_finish.patch
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=c5c0760adc260d55265c086b9efb350ea6dda38b

generic/pending-5.15/735-net-mediatek-mtk_eth_soc-release-MAC_MCR_FORCE_LINK-.patch
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=448cc8b5f743985f6d1d98aa4efb386fef4c3bf2

generic/pending-5.15/736-net-ethernet-mtk_eth_soc-fix-PPE-hanging-issue.patch
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=9fcadd125044007351905d40c405fadc2d3bb6d6

Add new configuration symbols for tegra target.

Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit fb2c6e9d4d)
This commit is contained in:
Hauke Mehrtens
2024-03-29 23:15:41 +01:00
parent e2f3aefea5
commit 8f8d5decc9
180 changed files with 751 additions and 937 deletions

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .152 LINUX_VERSION-5.15 = .153
LINUX_KERNEL_HASH-5.15.152 = f0805225f4a5b24d0bba9302c2c2f261c04f737ac5dd931da9b112e9f3e4a47e LINUX_KERNEL_HASH-5.15.153 = d7ddb1e144a88773b56a5b4a71baea0b241f3996d446be45290537c6997c84bc

View File

@@ -18,7 +18,7 @@ Signed-off-by: Stephen Boyd <sboyd@kernel.org>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -3142,7 +3142,10 @@ static int clk_rate_get(void *data, u64 @@ -3145,7 +3145,10 @@ static int clk_rate_get(void *data, u64
{ {
struct clk_core *core = data; struct clk_core *core = data;

View File

@@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -1357,6 +1357,8 @@ static int clk_core_determine_round_nolo @@ -1360,6 +1360,8 @@ static int clk_core_determine_round_nolo
if (!core) if (!core)
return 0; return 0;

View File

@@ -18,7 +18,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -2397,11 +2397,7 @@ int clk_set_rate_range(struct clk *clk, @@ -2400,11 +2400,7 @@ int clk_set_rate_range(struct clk *clk,
* this corner case when determining the rate * this corner case when determining the rate
*/ */

View File

@@ -30,7 +30,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -2382,28 +2382,29 @@ int clk_set_rate_range(struct clk *clk, @@ -2385,28 +2385,29 @@ int clk_set_rate_range(struct clk *clk,
goto out; goto out;
} }

View File

@@ -29,7 +29,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -2341,19 +2341,15 @@ int clk_set_rate_exclusive(struct clk *c @@ -2344,19 +2344,15 @@ int clk_set_rate_exclusive(struct clk *c
} }
EXPORT_SYMBOL_GPL(clk_set_rate_exclusive); EXPORT_SYMBOL_GPL(clk_set_rate_exclusive);
@@ -54,7 +54,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
if (!clk) if (!clk)
return 0; return 0;
@@ -2366,8 +2362,6 @@ int clk_set_rate_range(struct clk *clk, @@ -2369,8 +2365,6 @@ int clk_set_rate_range(struct clk *clk,
return -EINVAL; return -EINVAL;
} }
@@ -63,7 +63,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
if (clk->exclusive_count) if (clk->exclusive_count)
clk_core_rate_unprotect(clk->core); clk_core_rate_unprotect(clk->core);
@@ -2411,6 +2405,28 @@ out: @@ -2414,6 +2408,28 @@ out:
if (clk->exclusive_count) if (clk->exclusive_count)
clk_core_rate_protect(clk->core); clk_core_rate_protect(clk->core);
@@ -92,7 +92,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
clk_prepare_unlock(); clk_prepare_unlock();
return ret; return ret;
@@ -4373,9 +4389,10 @@ void __clk_put(struct clk *clk) @@ -4376,9 +4392,10 @@ void __clk_put(struct clk *clk)
} }
hlist_del(&clk->clks_node); hlist_del(&clk->clks_node);

View File

@@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -2376,6 +2376,10 @@ static int clk_set_rate_range_nolock(str @@ -2379,6 +2379,10 @@ static int clk_set_rate_range_nolock(str
goto out; goto out;
} }
@@ -33,7 +33,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
/* /*
* Since the boundaries have been changed, let's give the * Since the boundaries have been changed, let's give the
* opportunity to the provider to adjust the clock rate based on * opportunity to the provider to adjust the clock rate based on
@@ -2393,7 +2397,7 @@ static int clk_set_rate_range_nolock(str @@ -2396,7 +2400,7 @@ static int clk_set_rate_range_nolock(str
* - the determine_rate() callback does not really check for * - the determine_rate() callback does not really check for
* this corner case when determining the rate * this corner case when determining the rate
*/ */

View File

@@ -23,7 +23,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -1768,6 +1768,23 @@ static void clk_core_update_orphan_statu @@ -1771,6 +1771,23 @@ static void clk_core_update_orphan_statu
clk_core_update_orphan_status(child, is_orphan); clk_core_update_orphan_status(child, is_orphan);
} }
@@ -47,7 +47,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
static void clk_reparent(struct clk_core *core, struct clk_core *new_parent) static void clk_reparent(struct clk_core *core, struct clk_core *new_parent)
{ {
bool was_orphan = core->orphan; bool was_orphan = core->orphan;
@@ -1792,6 +1809,7 @@ static void clk_reparent(struct clk_core @@ -1795,6 +1812,7 @@ static void clk_reparent(struct clk_core
} }
core->parent = new_parent; core->parent = new_parent;

View File

@@ -25,7 +25,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -2398,6 +2398,12 @@ static int clk_set_rate_range_nolock(str @@ -2401,6 +2401,12 @@ static int clk_set_rate_range_nolock(str
if (clk->core->flags & CLK_GET_RATE_NOCACHE) if (clk->core->flags & CLK_GET_RATE_NOCACHE)
rate = clk_core_get_rate_recalc(clk->core); rate = clk_core_get_rate_recalc(clk->core);

View File

@@ -26,7 +26,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -1391,6 +1391,8 @@ static void clk_core_init_rate_req(struc @@ -1394,6 +1394,8 @@ static void clk_core_init_rate_req(struc
if (WARN_ON(!core || !req)) if (WARN_ON(!core || !req))
return; return;
@@ -35,7 +35,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
parent = core->parent; parent = core->parent;
if (parent) { if (parent) {
req->best_parent_hw = parent->hw; req->best_parent_hw = parent->hw;
@@ -1465,7 +1467,6 @@ unsigned long clk_hw_round_rate(struct c @@ -1468,7 +1470,6 @@ unsigned long clk_hw_round_rate(struct c
int ret; int ret;
struct clk_rate_request req; struct clk_rate_request req;
@@ -43,7 +43,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
req.rate = rate; req.rate = rate;
ret = clk_core_round_rate_nolock(hw->core, &req); ret = clk_core_round_rate_nolock(hw->core, &req);
@@ -1498,7 +1499,6 @@ long clk_round_rate(struct clk *clk, uns @@ -1501,7 +1502,6 @@ long clk_round_rate(struct clk *clk, uns
if (clk->exclusive_count) if (clk->exclusive_count)
clk_core_rate_unprotect(clk->core); clk_core_rate_unprotect(clk->core);
@@ -51,7 +51,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
req.rate = rate; req.rate = rate;
ret = clk_core_round_rate_nolock(clk->core, &req); ret = clk_core_round_rate_nolock(clk->core, &req);
@@ -2005,8 +2005,6 @@ static struct clk_core *clk_calc_new_rat @@ -2008,8 +2008,6 @@ static struct clk_core *clk_calc_new_rat
struct clk_rate_request req; struct clk_rate_request req;
req.rate = rate; req.rate = rate;

View File

@@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -1384,13 +1384,15 @@ static int clk_core_determine_round_nolo @@ -1387,13 +1387,15 @@ static int clk_core_determine_round_nolo
} }
static void clk_core_init_rate_req(struct clk_core * const core, static void clk_core_init_rate_req(struct clk_core * const core,
@@ -36,7 +36,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
clk_core_get_boundaries(core, &req->min_rate, &req->max_rate); clk_core_get_boundaries(core, &req->min_rate, &req->max_rate);
parent = core->parent; parent = core->parent;
@@ -1418,7 +1420,7 @@ static int clk_core_round_rate_nolock(st @@ -1421,7 +1423,7 @@ static int clk_core_round_rate_nolock(st
return 0; return 0;
} }
@@ -45,7 +45,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
if (clk_core_can_round(core)) if (clk_core_can_round(core))
return clk_core_determine_round_nolock(core, req); return clk_core_determine_round_nolock(core, req);
@@ -2004,9 +2006,7 @@ static struct clk_core *clk_calc_new_rat @@ -2007,9 +2009,7 @@ static struct clk_core *clk_calc_new_rat
if (clk_core_can_round(core)) { if (clk_core_can_round(core)) {
struct clk_rate_request req; struct clk_rate_request req;

View File

@@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -1405,6 +1405,26 @@ static void clk_core_init_rate_req(struc @@ -1408,6 +1408,26 @@ static void clk_core_init_rate_req(struc
} }
} }

View File

@@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -1489,7 +1489,7 @@ unsigned long clk_hw_round_rate(struct c @@ -1492,7 +1492,7 @@ unsigned long clk_hw_round_rate(struct c
int ret; int ret;
struct clk_rate_request req; struct clk_rate_request req;
@@ -28,7 +28,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
ret = clk_core_round_rate_nolock(hw->core, &req); ret = clk_core_round_rate_nolock(hw->core, &req);
if (ret) if (ret)
@@ -1521,7 +1521,7 @@ long clk_round_rate(struct clk *clk, uns @@ -1524,7 +1524,7 @@ long clk_round_rate(struct clk *clk, uns
if (clk->exclusive_count) if (clk->exclusive_count)
clk_core_rate_unprotect(clk->core); clk_core_rate_unprotect(clk->core);
@@ -37,7 +37,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
ret = clk_core_round_rate_nolock(clk->core, &req); ret = clk_core_round_rate_nolock(clk->core, &req);
@@ -2225,8 +2225,7 @@ static unsigned long clk_core_req_round_ @@ -2228,8 +2228,7 @@ static unsigned long clk_core_req_round_
if (cnt < 0) if (cnt < 0)
return cnt; return cnt;

View File

@@ -23,7 +23,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -1440,8 +1440,6 @@ static int clk_core_round_rate_nolock(st @@ -1443,8 +1443,6 @@ static int clk_core_round_rate_nolock(st
return 0; return 0;
} }

View File

@@ -24,7 +24,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -553,6 +553,9 @@ static bool mux_is_better_rate(unsigned @@ -556,6 +556,9 @@ static bool mux_is_better_rate(unsigned
return now <= rate && now > best; return now <= rate && now > best;
} }
@@ -34,7 +34,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
int clk_mux_determine_rate_flags(struct clk_hw *hw, int clk_mux_determine_rate_flags(struct clk_hw *hw,
struct clk_rate_request *req, struct clk_rate_request *req,
unsigned long flags) unsigned long flags)
@@ -566,8 +569,12 @@ int clk_mux_determine_rate_flags(struct @@ -569,8 +572,12 @@ int clk_mux_determine_rate_flags(struct
if (core->flags & CLK_SET_RATE_NO_REPARENT) { if (core->flags & CLK_SET_RATE_NO_REPARENT) {
parent = core->parent; parent = core->parent;
if (core->flags & CLK_SET_RATE_PARENT) { if (core->flags & CLK_SET_RATE_PARENT) {
@@ -49,7 +49,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
if (ret) if (ret)
return ret; return ret;
@@ -590,7 +597,7 @@ int clk_mux_determine_rate_flags(struct @@ -593,7 +600,7 @@ int clk_mux_determine_rate_flags(struct
if (core->flags & CLK_SET_RATE_PARENT) { if (core->flags & CLK_SET_RATE_PARENT) {
parent_req = *req; parent_req = *req;

View File

@@ -20,7 +20,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -556,6 +556,26 @@ static bool mux_is_better_rate(unsigned @@ -559,6 +559,26 @@ static bool mux_is_better_rate(unsigned
static int clk_core_round_rate_nolock(struct clk_core *core, static int clk_core_round_rate_nolock(struct clk_core *core,
struct clk_rate_request *req); struct clk_rate_request *req);
@@ -47,7 +47,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
int clk_mux_determine_rate_flags(struct clk_hw *hw, int clk_mux_determine_rate_flags(struct clk_hw *hw,
struct clk_rate_request *req, struct clk_rate_request *req,
unsigned long flags) unsigned long flags)
@@ -2579,25 +2599,11 @@ void clk_hw_reparent(struct clk_hw *hw, @@ -2582,25 +2602,11 @@ void clk_hw_reparent(struct clk_hw *hw,
*/ */
bool clk_has_parent(struct clk *clk, struct clk *parent) bool clk_has_parent(struct clk *clk, struct clk *parent)
{ {

View File

@@ -35,7 +35,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -553,6 +553,10 @@ static bool mux_is_better_rate(unsigned @@ -556,6 +556,10 @@ static bool mux_is_better_rate(unsigned
return now <= rate && now > best; return now <= rate && now > best;
} }
@@ -46,7 +46,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
static int clk_core_round_rate_nolock(struct clk_core *core, static int clk_core_round_rate_nolock(struct clk_core *core,
struct clk_rate_request *req); struct clk_rate_request *req);
@@ -576,6 +580,24 @@ static bool clk_core_has_parent(struct c @@ -579,6 +583,24 @@ static bool clk_core_has_parent(struct c
return false; return false;
} }
@@ -71,7 +71,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
int clk_mux_determine_rate_flags(struct clk_hw *hw, int clk_mux_determine_rate_flags(struct clk_hw *hw,
struct clk_rate_request *req, struct clk_rate_request *req,
unsigned long flags) unsigned long flags)
@@ -583,17 +605,19 @@ int clk_mux_determine_rate_flags(struct @@ -586,17 +608,19 @@ int clk_mux_determine_rate_flags(struct
struct clk_core *core = hw->core, *parent, *best_parent = NULL; struct clk_core *core = hw->core, *parent, *best_parent = NULL;
int i, num_parents, ret; int i, num_parents, ret;
unsigned long best = 0; unsigned long best = 0;
@@ -92,7 +92,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
ret = clk_core_round_rate_nolock(parent, &parent_req); ret = clk_core_round_rate_nolock(parent, &parent_req);
if (ret) if (ret)
return ret; return ret;
@@ -611,23 +635,29 @@ int clk_mux_determine_rate_flags(struct @@ -614,23 +638,29 @@ int clk_mux_determine_rate_flags(struct
/* find the parent that can provide the fastest rate <= rate */ /* find the parent that can provide the fastest rate <= rate */
num_parents = core->num_parents; num_parents = core->num_parents;
for (i = 0; i < num_parents; i++) { for (i = 0; i < num_parents; i++) {
@@ -126,7 +126,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
} }
} }
@@ -1460,6 +1490,8 @@ static bool clk_core_can_round(struct cl @@ -1463,6 +1493,8 @@ static bool clk_core_can_round(struct cl
static int clk_core_round_rate_nolock(struct clk_core *core, static int clk_core_round_rate_nolock(struct clk_core *core,
struct clk_rate_request *req) struct clk_rate_request *req)
{ {
@@ -135,7 +135,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
lockdep_assert_held(&prepare_lock); lockdep_assert_held(&prepare_lock);
if (!core) { if (!core) {
@@ -1469,8 +1501,20 @@ static int clk_core_round_rate_nolock(st @@ -1472,8 +1504,20 @@ static int clk_core_round_rate_nolock(st
if (clk_core_can_round(core)) if (clk_core_can_round(core))
return clk_core_determine_round_nolock(core, req); return clk_core_determine_round_nolock(core, req);

View File

@@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -1449,6 +1449,8 @@ static void clk_core_init_rate_req(struc @@ -1452,6 +1452,8 @@ static void clk_core_init_rate_req(struc
if (WARN_ON(!core || !req)) if (WARN_ON(!core || !req))
return; return;

View File

@@ -28,7 +28,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -2586,6 +2586,24 @@ int clk_set_max_rate(struct clk *clk, un @@ -2589,6 +2589,24 @@ int clk_set_max_rate(struct clk *clk, un
EXPORT_SYMBOL_GPL(clk_set_max_rate); EXPORT_SYMBOL_GPL(clk_set_max_rate);
/** /**

View File

@@ -13,7 +13,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c --- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -2599,7 +2599,9 @@ void clk_get_rate_range(struct clk *clk, @@ -2602,7 +2602,9 @@ void clk_get_rate_range(struct clk *clk,
if (!clk || !min || !max) if (!clk || !min || !max)
return; return;

View File

@@ -16,7 +16,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
@@ -298,7 +298,7 @@ @@ -295,7 +295,7 @@
status = "okay"; status = "okay";
}; };

View File

@@ -16,7 +16,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
@@ -289,6 +289,141 @@ @@ -286,6 +286,141 @@
gpio-controller; gpio-controller;
}; };

View File

@@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
@@ -278,6 +278,15 @@ @@ -275,6 +275,15 @@
twd: timer-mfd@400 { twd: timer-mfd@400 {
compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon"; compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon";
reg = <0x400 0x4c>; reg = <0x400 0x4c>;

View File

@@ -16,7 +16,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
@@ -458,6 +458,15 @@ @@ -455,6 +455,15 @@
}; };
}; };

View File

@@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
@@ -352,6 +352,61 @@ @@ -349,6 +349,61 @@
groups = "led_9_grp_a"; groups = "led_9_grp_a";
}; };
@@ -79,7 +79,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
pins_led_21_a: led_21-a-pins { pins_led_21_a: led_21-a-pins {
function = "led_21"; function = "led_21";
groups = "led_21_grp_a"; groups = "led_21_grp_a";
@@ -362,6 +417,21 @@ @@ -359,6 +414,21 @@
groups = "led_22_grp_a"; groups = "led_22_grp_a";
}; };
@@ -101,7 +101,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
pins_led_26_a: led_26-a-pins { pins_led_26_a: led_26-a-pins {
function = "led_26"; function = "led_26";
groups = "led_26_grp_a"; groups = "led_26_grp_a";
@@ -387,6 +457,11 @@ @@ -384,6 +454,11 @@
groups = "led_30_grp_a"; groups = "led_30_grp_a";
}; };

View File

@@ -18,7 +18,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
@@ -517,6 +517,14 @@ @@ -514,6 +514,14 @@
status = "okay"; status = "okay";
}; };

View File

@@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
@@ -283,6 +283,11 @@ @@ -280,6 +280,11 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;

View File

@@ -40,7 +40,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
}; };
soc { soc {
@@ -531,6 +537,18 @@ @@ -528,6 +534,18 @@
#size-cells = <0>; #size-cells = <0>;
}; };

View File

@@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
@@ -343,7 +343,7 @@ @@ -340,7 +340,7 @@
gpio0: gpio-controller@500 { gpio0: gpio-controller@500 {
compatible = "brcm,bcm6345-gpio"; compatible = "brcm,bcm6345-gpio";
reg-names = "dirout", "dat"; reg-names = "dirout", "dat";

View File

@@ -20,7 +20,7 @@ Link: https://lore.kernel.org/bpf/d5dc039c3d4123426e7023a488c449181a7bc57f.16469
--- a/drivers/net/veth.c --- a/drivers/net/veth.c
+++ b/drivers/net/veth.c +++ b/drivers/net/veth.c
@@ -1457,9 +1457,14 @@ static int veth_xdp_set(struct net_devic @@ -1455,9 +1455,14 @@ static int veth_xdp_set(struct net_devic
goto err; goto err;
} }

View File

@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <linux/mfd/syscon.h> #include <linux/mfd/syscon.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/clk.h> #include <linux/clk.h>
@@ -840,7 +841,7 @@ static int mtk_init_fq_dma(struct mtk_et @@ -850,7 +851,7 @@ static int mtk_init_fq_dma(struct mtk_et
dma_addr_t dma_addr; dma_addr_t dma_addr;
int i; int i;
@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
cnt * sizeof(struct mtk_tx_dma), cnt * sizeof(struct mtk_tx_dma),
&eth->phy_scratch_ring, &eth->phy_scratch_ring,
GFP_ATOMIC); GFP_ATOMIC);
@@ -852,10 +853,10 @@ static int mtk_init_fq_dma(struct mtk_et @@ -862,10 +863,10 @@ static int mtk_init_fq_dma(struct mtk_et
if (unlikely(!eth->scratch_head)) if (unlikely(!eth->scratch_head))
return -ENOMEM; return -ENOMEM;
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return -ENOMEM; return -ENOMEM;
phy_ring_tail = eth->phy_scratch_ring + phy_ring_tail = eth->phy_scratch_ring +
@@ -909,26 +910,26 @@ static void mtk_tx_unmap(struct mtk_eth @@ -919,26 +920,26 @@ static void mtk_tx_unmap(struct mtk_eth
{ {
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) { if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
@@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
dma_unmap_addr(tx_buf, dma_addr1), dma_unmap_addr(tx_buf, dma_addr1),
dma_unmap_len(tx_buf, dma_len1), dma_unmap_len(tx_buf, dma_len1),
DMA_TO_DEVICE); DMA_TO_DEVICE);
@@ -1006,9 +1007,9 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1016,9 +1017,9 @@ static int mtk_tx_map(struct sk_buff *sk
if (skb_vlan_tag_present(skb)) if (skb_vlan_tag_present(skb))
txd4 |= TX_DMA_INS_VLAN | skb_vlan_tag_get(skb); txd4 |= TX_DMA_INS_VLAN | skb_vlan_tag_get(skb);
@@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return -ENOMEM; return -ENOMEM;
WRITE_ONCE(itxd->txd1, mapped_addr); WRITE_ONCE(itxd->txd1, mapped_addr);
@@ -1047,10 +1048,10 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1057,10 +1058,10 @@ static int mtk_tx_map(struct sk_buff *sk
frag_map_size = min(frag_size, MTK_TX_DMA_BUF_LEN); frag_map_size = min(frag_size, MTK_TX_DMA_BUF_LEN);
@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto err_dma; goto err_dma;
if (i == nr_frags - 1 && if (i == nr_frags - 1 &&
@@ -1331,18 +1332,18 @@ static int mtk_poll_rx(struct napi_struc @@ -1341,18 +1342,18 @@ static int mtk_poll_rx(struct napi_struc
netdev->stats.rx_dropped++; netdev->stats.rx_dropped++;
goto release_desc; goto release_desc;
} }
@@ -120,7 +120,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->buf_size, DMA_FROM_DEVICE); ring->buf_size, DMA_FROM_DEVICE);
/* receive data */ /* receive data */
@@ -1615,7 +1616,7 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1625,7 +1626,7 @@ static int mtk_tx_alloc(struct mtk_eth *
if (!ring->buf) if (!ring->buf)
goto no_tx_mem; goto no_tx_mem;
@@ -129,7 +129,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
&ring->phys, GFP_ATOMIC); &ring->phys, GFP_ATOMIC);
if (!ring->dma) if (!ring->dma)
goto no_tx_mem; goto no_tx_mem;
@@ -1633,7 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1643,7 +1644,7 @@ static int mtk_tx_alloc(struct mtk_eth *
* descriptors in ring->dma_pdma. * descriptors in ring->dma_pdma.
*/ */
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
@@ -138,7 +138,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
&ring->phys_pdma, &ring->phys_pdma,
GFP_ATOMIC); GFP_ATOMIC);
if (!ring->dma_pdma) if (!ring->dma_pdma)
@@ -1692,7 +1693,7 @@ static void mtk_tx_clean(struct mtk_eth @@ -1702,7 +1703,7 @@ static void mtk_tx_clean(struct mtk_eth
} }
if (ring->dma) { if (ring->dma) {
@@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MTK_DMA_SIZE * sizeof(*ring->dma), MTK_DMA_SIZE * sizeof(*ring->dma),
ring->dma, ring->dma,
ring->phys); ring->phys);
@@ -1700,7 +1701,7 @@ static void mtk_tx_clean(struct mtk_eth @@ -1710,7 +1711,7 @@ static void mtk_tx_clean(struct mtk_eth
} }
if (ring->dma_pdma) { if (ring->dma_pdma) {
@@ -156,7 +156,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MTK_DMA_SIZE * sizeof(*ring->dma_pdma), MTK_DMA_SIZE * sizeof(*ring->dma_pdma),
ring->dma_pdma, ring->dma_pdma,
ring->phys_pdma); ring->phys_pdma);
@@ -1748,18 +1749,18 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1758,18 +1759,18 @@ static int mtk_rx_alloc(struct mtk_eth *
return -ENOMEM; return -ENOMEM;
} }
@@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return -ENOMEM; return -ENOMEM;
ring->dma[i].rxd1 = (unsigned int)dma_addr; ring->dma[i].rxd1 = (unsigned int)dma_addr;
@@ -1795,7 +1796,7 @@ static void mtk_rx_clean(struct mtk_eth @@ -1805,7 +1806,7 @@ static void mtk_rx_clean(struct mtk_eth
continue; continue;
if (!ring->dma[i].rxd1) if (!ring->dma[i].rxd1)
continue; continue;
@@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->dma[i].rxd1, ring->dma[i].rxd1,
ring->buf_size, ring->buf_size,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
@@ -1806,7 +1807,7 @@ static void mtk_rx_clean(struct mtk_eth @@ -1816,7 +1817,7 @@ static void mtk_rx_clean(struct mtk_eth
} }
if (ring->dma) { if (ring->dma) {
@@ -196,7 +196,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->dma_size * sizeof(*ring->dma), ring->dma_size * sizeof(*ring->dma),
ring->dma, ring->dma,
ring->phys); ring->phys);
@@ -2165,7 +2166,7 @@ static void mtk_dma_free(struct mtk_eth @@ -2175,7 +2176,7 @@ static void mtk_dma_free(struct mtk_eth
if (eth->netdev[i]) if (eth->netdev[i])
netdev_reset_queue(eth->netdev[i]); netdev_reset_queue(eth->netdev[i]);
if (eth->scratch_ring) { if (eth->scratch_ring) {
@@ -205,7 +205,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MTK_DMA_SIZE * sizeof(struct mtk_tx_dma), MTK_DMA_SIZE * sizeof(struct mtk_tx_dma),
eth->scratch_ring, eth->scratch_ring,
eth->phy_scratch_ring); eth->phy_scratch_ring);
@@ -2517,6 +2518,8 @@ static void mtk_dim_tx(struct work_struc @@ -2527,6 +2528,8 @@ static void mtk_dim_tx(struct work_struc
static int mtk_hw_init(struct mtk_eth *eth) 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; int i, val, ret;
if (test_and_set_bit(MTK_HW_INIT, &eth->state)) if (test_and_set_bit(MTK_HW_INIT, &eth->state))
@@ -2529,6 +2532,10 @@ static int mtk_hw_init(struct mtk_eth *e @@ -2539,6 +2542,10 @@ static int mtk_hw_init(struct mtk_eth *e
if (ret) if (ret)
goto err_disable_pm; 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)) { if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
ret = device_reset(eth->dev); ret = device_reset(eth->dev);
if (ret) { if (ret) {
@@ -3075,6 +3082,35 @@ free_netdev: @@ -3085,6 +3092,35 @@ free_netdev:
return err; return err;
} }
@@ -261,7 +261,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int mtk_probe(struct platform_device *pdev) static int mtk_probe(struct platform_device *pdev)
{ {
struct device_node *mac_np; struct device_node *mac_np;
@@ -3088,6 +3124,7 @@ static int mtk_probe(struct platform_dev @@ -3098,6 +3134,7 @@ static int mtk_probe(struct platform_dev
eth->soc = of_device_get_match_data(&pdev->dev); eth->soc = of_device_get_match_data(&pdev->dev);
eth->dev = &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); eth->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(eth->base)) if (IS_ERR(eth->base))
return PTR_ERR(eth->base); return PTR_ERR(eth->base);
@@ -3136,6 +3173,16 @@ static int mtk_probe(struct platform_dev @@ -3146,6 +3183,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; static int mtk_msg_level = -1;
module_param_named(msg_level, mtk_msg_level, int, 0); module_param_named(msg_level, mtk_msg_level, int, 0);
@@ -3205,6 +3206,22 @@ static int mtk_probe(struct platform_dev @@ -3215,6 +3216,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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2338,7 +2338,7 @@ static int mtk_open(struct net_device *d @@ -2348,7 +2348,7 @@ static int mtk_open(struct net_device *d
return err; return err;
} }
@@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
gdm_config = MTK_GDMA_TO_PPE; gdm_config = MTK_GDMA_TO_PPE;
mtk_gdm_config(eth, gdm_config); mtk_gdm_config(eth, gdm_config);
@@ -2412,7 +2412,7 @@ static int mtk_stop(struct net_device *d @@ -2422,7 +2422,7 @@ static int mtk_stop(struct net_device *d
mtk_dma_free(eth); mtk_dma_free(eth);
if (eth->soc->offload_version) if (eth->soc->offload_version)
@@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return 0; return 0;
} }
@@ -3297,10 +3297,11 @@ static int mtk_probe(struct platform_dev @@ -3307,10 +3307,11 @@ static int mtk_probe(struct platform_dev
} }
if (eth->soc->offload_version) { if (eth->soc->offload_version) {

View File

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

View File

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

View File

@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -846,7 +846,7 @@ static int mtk_init_fq_dma(struct mtk_et @@ -856,7 +856,7 @@ static int mtk_init_fq_dma(struct mtk_et
eth->scratch_ring = dma_alloc_coherent(eth->dma_dev, eth->scratch_ring = dma_alloc_coherent(eth->dma_dev,
cnt * sizeof(struct mtk_tx_dma), cnt * sizeof(struct mtk_tx_dma),
&eth->phy_scratch_ring, &eth->phy_scratch_ring,
@@ -22,7 +22,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(!eth->scratch_ring)) if (unlikely(!eth->scratch_ring))
return -ENOMEM; return -ENOMEM;
@@ -1624,7 +1624,7 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1634,7 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth *
goto no_tx_mem; goto no_tx_mem;
ring->dma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz, 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) if (!ring->dma)
goto no_tx_mem; goto no_tx_mem;
@@ -1642,8 +1642,7 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1652,8 +1652,7 @@ static int mtk_tx_alloc(struct mtk_eth *
*/ */
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
ring->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz, 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) if (!ring->dma_pdma)
goto no_tx_mem; goto no_tx_mem;
@@ -1758,7 +1757,7 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1768,7 +1767,7 @@ static int mtk_rx_alloc(struct mtk_eth *
ring->dma = dma_alloc_coherent(eth->dma_dev, ring->dma = dma_alloc_coherent(eth->dma_dev,
rx_dma_size * sizeof(*ring->dma), rx_dma_size * sizeof(*ring->dma),

View File

@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -972,18 +972,51 @@ static void setup_tx_buf(struct mtk_eth @@ -982,18 +982,51 @@ static void setup_tx_buf(struct mtk_eth
} }
} }
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int k = 0; int k = 0;
itxd = ring->next_free; itxd = ring->next_free;
@@ -991,49 +1024,32 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1001,49 +1034,32 @@ static int mtk_tx_map(struct sk_buff *sk
if (itxd == ring->last_free) if (itxd == ring->last_free)
return -ENOMEM; return -ENOMEM;
@@ -126,7 +126,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
bool new_desc = true; bool new_desc = true;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA) || if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA) ||
@@ -1048,23 +1064,17 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1058,23 +1074,17 @@ static int mtk_tx_map(struct sk_buff *sk
new_desc = false; new_desc = false;
} }
@@ -159,7 +159,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
tx_buf = mtk_desc_to_tx_buf(ring, txd); tx_buf = mtk_desc_to_tx_buf(ring, txd);
if (new_desc) if (new_desc)
@@ -1074,20 +1084,17 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1084,20 +1094,17 @@ static int mtk_tx_map(struct sk_buff *sk
tx_buf->flags |= (!mac->id) ? MTK_TX_FLAGS_FPORT0 : tx_buf->flags |= (!mac->id) ? MTK_TX_FLAGS_FPORT0 :
MTK_TX_FLAGS_FPORT1; MTK_TX_FLAGS_FPORT1;

View File

@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -838,20 +838,20 @@ static void *mtk_max_lro_buf_alloc(gfp_t @@ -848,20 +848,20 @@ static void *mtk_max_lro_buf_alloc(gfp_t
/* the qdma core needs scratch memory to be setup */ /* the qdma core needs scratch memory to be setup */
static int mtk_init_fq_dma(struct mtk_eth *eth) static int mtk_init_fq_dma(struct mtk_eth *eth)
{ {
@@ -38,7 +38,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(!eth->scratch_head)) if (unlikely(!eth->scratch_head))
return -ENOMEM; return -ENOMEM;
@@ -861,16 +861,19 @@ static int mtk_init_fq_dma(struct mtk_et @@ -871,16 +871,19 @@ static int mtk_init_fq_dma(struct mtk_et
if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr))) if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr)))
return -ENOMEM; return -ENOMEM;
@@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
mtk_w32(eth, eth->phy_scratch_ring, MTK_QDMA_FQ_HEAD); mtk_w32(eth, eth->phy_scratch_ring, MTK_QDMA_FQ_HEAD);
@@ -2173,6 +2176,7 @@ static int mtk_dma_init(struct mtk_eth * @@ -2183,6 +2186,7 @@ static int mtk_dma_init(struct mtk_eth *
static void mtk_dma_free(struct mtk_eth *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; int i;
for (i = 0; i < MTK_MAC_COUNT; i++) for (i = 0; i < MTK_MAC_COUNT; i++)
@@ -2180,9 +2184,8 @@ static void mtk_dma_free(struct mtk_eth @@ -2190,9 +2194,8 @@ static void mtk_dma_free(struct mtk_eth
netdev_reset_queue(eth->netdev[i]); netdev_reset_queue(eth->netdev[i]);
if (eth->scratch_ring) { if (eth->scratch_ring) {
dma_free_coherent(eth->dma_dev, dma_free_coherent(eth->dma_dev,
@@ -85,7 +85,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
eth->scratch_ring = NULL; eth->scratch_ring = NULL;
eth->phy_scratch_ring = 0; eth->phy_scratch_ring = 0;
} }
@@ -3387,6 +3390,9 @@ static const struct mtk_soc_data mt2701_ @@ -3397,6 +3400,9 @@ static const struct mtk_soc_data mt2701_
.hw_features = MTK_HW_FEATURES, .hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP, .required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true, .required_pctl = true,
@@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}; };
static const struct mtk_soc_data mt7621_data = { static const struct mtk_soc_data mt7621_data = {
@@ -3395,6 +3401,9 @@ static const struct mtk_soc_data mt7621_ @@ -3405,6 +3411,9 @@ static const struct mtk_soc_data mt7621_
.required_clks = MT7621_CLKS_BITMAP, .required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false, .required_pctl = false,
.offload_version = 2, .offload_version = 2,
@@ -105,7 +105,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}; };
static const struct mtk_soc_data mt7622_data = { static const struct mtk_soc_data mt7622_data = {
@@ -3404,6 +3413,9 @@ static const struct mtk_soc_data mt7622_ @@ -3414,6 +3423,9 @@ static const struct mtk_soc_data mt7622_
.required_clks = MT7622_CLKS_BITMAP, .required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false, .required_pctl = false,
.offload_version = 2, .offload_version = 2,
@@ -115,7 +115,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}; };
static const struct mtk_soc_data mt7623_data = { static const struct mtk_soc_data mt7623_data = {
@@ -3412,6 +3424,9 @@ static const struct mtk_soc_data mt7623_ @@ -3422,6 +3434,9 @@ static const struct mtk_soc_data mt7623_
.required_clks = MT7623_CLKS_BITMAP, .required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true, .required_pctl = true,
.offload_version = 2, .offload_version = 2,
@@ -125,7 +125,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}; };
static const struct mtk_soc_data mt7629_data = { static const struct mtk_soc_data mt7629_data = {
@@ -3420,6 +3435,9 @@ static const struct mtk_soc_data mt7629_ @@ -3430,6 +3445,9 @@ static const struct mtk_soc_data mt7629_
.hw_features = MTK_HW_FEATURES, .hw_features = MTK_HW_FEATURES,
.required_clks = MT7629_CLKS_BITMAP, .required_clks = MT7629_CLKS_BITMAP,
.required_pctl = false, .required_pctl = false,
@@ -135,7 +135,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}; };
static const struct mtk_soc_data rt5350_data = { static const struct mtk_soc_data rt5350_data = {
@@ -3427,6 +3445,9 @@ static const struct mtk_soc_data rt5350_ @@ -3437,6 +3455,9 @@ static const struct mtk_soc_data rt5350_
.hw_features = MTK_HW_FEATURES_MT7628, .hw_features = MTK_HW_FEATURES_MT7628,
.required_clks = MT7628_CLKS_BITMAP, .required_clks = MT7628_CLKS_BITMAP,
.required_pctl = false, .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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1625,8 +1625,10 @@ static int mtk_napi_rx(struct napi_struc @@ -1635,8 +1635,10 @@ static int mtk_napi_rx(struct napi_struc
static int mtk_tx_alloc(struct mtk_eth *eth) 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), ring->buf = kcalloc(MTK_DMA_SIZE, sizeof(*ring->buf),
GFP_KERNEL); GFP_KERNEL);
@@ -1642,8 +1644,10 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1652,8 +1654,10 @@ static int mtk_tx_alloc(struct mtk_eth *
int next = (i + 1) % MTK_DMA_SIZE; int next = (i + 1) % MTK_DMA_SIZE;
u32 next_ptr = ring->phys + next * sz; 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 /* On MT7688 (PDMA only) this driver uses the ring->dma structs
@@ -1665,7 +1669,7 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1675,7 +1679,7 @@ static int mtk_tx_alloc(struct mtk_eth *
ring->dma_size = MTK_DMA_SIZE; ring->dma_size = MTK_DMA_SIZE;
atomic_set(&ring->free_count, MTK_DMA_SIZE - 2); atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
ring->next_free = &ring->dma[0]; 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->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz));
ring->thresh = MAX_SKB_FRAGS; ring->thresh = MAX_SKB_FRAGS;
@@ -1698,6 +1702,7 @@ no_tx_mem: @@ -1708,6 +1712,7 @@ no_tx_mem:
static void mtk_tx_clean(struct mtk_eth *eth) 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; struct mtk_tx_ring *ring = &eth->tx_ring;
int i; int i;
@@ -1710,17 +1715,15 @@ static void mtk_tx_clean(struct mtk_eth @@ -1720,17 +1725,15 @@ static void mtk_tx_clean(struct mtk_eth
if (ring->dma) { if (ring->dma) {
dma_free_coherent(eth->dma_dev, dma_free_coherent(eth->dma_dev,

View File

@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -891,10 +891,11 @@ static inline void *mtk_qdma_phys_to_vir @@ -901,10 +901,11 @@ static inline void *mtk_qdma_phys_to_vir
return ret + (desc - ring->phys); return ret + (desc - ring->phys);
} }
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return &ring->buf[idx]; return &ring->buf[idx];
} }
@@ -1016,6 +1017,7 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1026,6 +1027,7 @@ static int mtk_tx_map(struct sk_buff *sk
}; };
struct mtk_mac *mac = netdev_priv(dev); struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw; struct mtk_eth *eth = mac->hw;
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_dma *itxd, *txd; struct mtk_tx_dma *itxd, *txd;
struct mtk_tx_dma *itxd_pdma, *txd_pdma; struct mtk_tx_dma *itxd_pdma, *txd_pdma;
struct mtk_tx_buf *itx_buf, *tx_buf; struct mtk_tx_buf *itx_buf, *tx_buf;
@@ -1027,7 +1029,7 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1037,7 +1039,7 @@ static int mtk_tx_map(struct sk_buff *sk
if (itxd == ring->last_free) if (itxd == ring->last_free)
return -ENOMEM; return -ENOMEM;
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
memset(itx_buf, 0, sizeof(*itx_buf)); memset(itx_buf, 0, sizeof(*itx_buf));
txd_info.addr = dma_map_single(eth->dma_dev, skb->data, txd_info.size, txd_info.addr = dma_map_single(eth->dma_dev, skb->data, txd_info.size,
@@ -1055,7 +1057,7 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1065,7 +1067,7 @@ static int mtk_tx_map(struct sk_buff *sk
while (frag_size) { while (frag_size) {
bool new_desc = true; bool new_desc = true;
@@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
(i & 0x1)) { (i & 0x1)) {
txd = mtk_qdma_phys_to_virt(ring, txd->txd2); txd = mtk_qdma_phys_to_virt(ring, txd->txd2);
txd_pdma = qdma_to_pdma(ring, txd); txd_pdma = qdma_to_pdma(ring, txd);
@@ -1079,7 +1081,8 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1089,7 +1091,8 @@ static int mtk_tx_map(struct sk_buff *sk
mtk_tx_set_dma_desc(dev, txd, &txd_info); mtk_tx_set_dma_desc(dev, txd, &txd_info);
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (new_desc) if (new_desc)
memset(tx_buf, 0, sizeof(*tx_buf)); memset(tx_buf, 0, sizeof(*tx_buf));
tx_buf->skb = (struct sk_buff *)MTK_DMA_DUMMY_DESC; tx_buf->skb = (struct sk_buff *)MTK_DMA_DUMMY_DESC;
@@ -1098,7 +1101,7 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1108,7 +1111,7 @@ static int mtk_tx_map(struct sk_buff *sk
/* store skb to cleanup */ /* store skb to cleanup */
itx_buf->skb = skb; itx_buf->skb = skb;
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (k & 0x1) if (k & 0x1)
txd_pdma->txd2 |= TX_DMA_LS0; txd_pdma->txd2 |= TX_DMA_LS0;
else else
@@ -1116,7 +1119,7 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1126,7 +1129,7 @@ static int mtk_tx_map(struct sk_buff *sk
*/ */
wmb(); wmb();
@@ -81,7 +81,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (netif_xmit_stopped(netdev_get_tx_queue(dev, 0)) || if (netif_xmit_stopped(netdev_get_tx_queue(dev, 0)) ||
!netdev_xmit_more()) !netdev_xmit_more())
mtk_w32(eth, txd->txd2, MTK_QTX_CTX_PTR); mtk_w32(eth, txd->txd2, MTK_QTX_CTX_PTR);
@@ -1130,13 +1133,13 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1140,13 +1143,13 @@ static int mtk_tx_map(struct sk_buff *sk
err_dma: err_dma:
do { do {
@@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
itxd_pdma->txd2 = TX_DMA_DESP2_DEF; itxd_pdma->txd2 = TX_DMA_DESP2_DEF;
itxd = mtk_qdma_phys_to_virt(ring, itxd->txd2); itxd = mtk_qdma_phys_to_virt(ring, itxd->txd2);
@@ -1450,7 +1453,8 @@ static int mtk_poll_tx_qdma(struct mtk_e @@ -1460,7 +1463,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
if ((desc->txd3 & TX_DMA_OWNER_CPU) == 0) if ((desc->txd3 & TX_DMA_OWNER_CPU) == 0)
break; break;

View File

@@ -11,7 +11,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -906,9 +906,10 @@ static struct mtk_tx_dma *qdma_to_pdma(s @@ -916,9 +916,10 @@ static struct mtk_tx_dma *qdma_to_pdma(s
return ring->dma_pdma - ring->dma + dma; return ring->dma_pdma - ring->dma + dma;
} }
@@ -24,7 +24,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, static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
@@ -1124,8 +1125,10 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1134,8 +1135,10 @@ static int mtk_tx_map(struct sk_buff *sk
!netdev_xmit_more()) !netdev_xmit_more())
mtk_w32(eth, txd->txd2, MTK_QTX_CTX_PTR); mtk_w32(eth, txd->txd2, MTK_QTX_CTX_PTR);
} else { } else {

View File

@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1776,7 +1776,7 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1786,7 +1786,7 @@ static int mtk_rx_alloc(struct mtk_eth *
} }
ring->dma = dma_alloc_coherent(eth->dma_dev, 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); &ring->phys, GFP_KERNEL);
if (!ring->dma) if (!ring->dma)
return -ENOMEM; return -ENOMEM;
@@ -1834,9 +1834,8 @@ static void mtk_rx_clean(struct mtk_eth @@ -1844,9 +1844,8 @@ static void mtk_rx_clean(struct mtk_eth
if (ring->dma) { if (ring->dma) {
dma_free_coherent(eth->dma_dev, dma_free_coherent(eth->dma_dev,
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->dma = NULL; ring->dma = NULL;
} }
} }
@@ -3402,6 +3401,7 @@ static const struct mtk_soc_data mt2701_ @@ -3412,6 +3411,7 @@ static const struct mtk_soc_data mt2701_
.required_pctl = true, .required_pctl = true,
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
@@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3413,6 +3413,7 @@ static const struct mtk_soc_data mt7621_ @@ -3423,6 +3423,7 @@ static const struct mtk_soc_data mt7621_
.offload_version = 2, .offload_version = 2,
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
@@ -50,7 +50,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3425,6 +3426,7 @@ static const struct mtk_soc_data mt7622_ @@ -3435,6 +3436,7 @@ static const struct mtk_soc_data mt7622_
.offload_version = 2, .offload_version = 2,
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
@@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3436,6 +3438,7 @@ static const struct mtk_soc_data mt7623_ @@ -3446,6 +3448,7 @@ static const struct mtk_soc_data mt7623_
.offload_version = 2, .offload_version = 2,
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
@@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3447,6 +3450,7 @@ static const struct mtk_soc_data mt7629_ @@ -3457,6 +3460,7 @@ static const struct mtk_soc_data mt7629_
.required_pctl = false, .required_pctl = false,
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
@@ -74,7 +74,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3457,6 +3461,7 @@ static const struct mtk_soc_data rt5350_ @@ -3467,6 +3471,7 @@ static const struct mtk_soc_data rt5350_
.required_pctl = false, .required_pctl = false,
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1265,9 +1265,12 @@ static struct mtk_rx_ring *mtk_get_rx_ri @@ -1275,9 +1275,12 @@ static struct mtk_rx_ring *mtk_get_rx_ri
return &eth->rx_ring[0]; return &eth->rx_ring[0];
for (i = 0; i < MTK_MAX_RX_RING_NUM; i++) { 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; ring->calc_idx_update = true;
return ring; return ring;
} }
@@ -1318,7 +1321,7 @@ static int mtk_poll_rx(struct napi_struc @@ -1328,7 +1331,7 @@ static int mtk_poll_rx(struct napi_struc
goto rx_done; goto rx_done;
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size); 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]; data = ring->data[idx];
if (!mtk_rx_get_desc(&trxd, rxd)) if (!mtk_rx_get_desc(&trxd, rxd))
@@ -1510,7 +1513,7 @@ static int mtk_poll_tx_pdma(struct mtk_e @@ -1520,7 +1523,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
mtk_tx_unmap(eth, tx_buf, true); 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1785,18 +1785,25 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1795,18 +1795,25 @@ static int mtk_rx_alloc(struct mtk_eth *
return -ENOMEM; return -ENOMEM;
for (i = 0; i < rx_dma_size; i++) { 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->dma_size = rx_dma_size;
ring->calc_idx_update = false; ring->calc_idx_update = false;
@@ -1821,14 +1828,17 @@ static void mtk_rx_clean(struct mtk_eth @@ -1831,14 +1838,17 @@ static void mtk_rx_clean(struct mtk_eth
if (ring->data && ring->dma) { if (ring->data && ring->dma) {
for (i = 0; i < ring->dma_size; i++) { for (i = 0; i < ring->dma_size; i++) {

View File

@@ -73,7 +73,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* strings used by ethtool */ /* strings used by ethtool */
static const struct mtk_ethtool_stats { static const struct mtk_ethtool_stats {
char str[ETH_GSTRING_LEN]; char str[ETH_GSTRING_LEN];
@@ -619,8 +672,8 @@ static inline void mtk_tx_irq_disable(st @@ -629,8 +682,8 @@ static inline void mtk_tx_irq_disable(st
u32 val; u32 val;
spin_lock_irqsave(&eth->tx_irq_lock, flags); spin_lock_irqsave(&eth->tx_irq_lock, flags);
@@ -84,7 +84,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_irqrestore(&eth->tx_irq_lock, flags); spin_unlock_irqrestore(&eth->tx_irq_lock, flags);
} }
@@ -630,8 +683,8 @@ static inline void mtk_tx_irq_enable(str @@ -640,8 +693,8 @@ static inline void mtk_tx_irq_enable(str
u32 val; u32 val;
spin_lock_irqsave(&eth->tx_irq_lock, flags); spin_lock_irqsave(&eth->tx_irq_lock, flags);
@@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_irqrestore(&eth->tx_irq_lock, flags); spin_unlock_irqrestore(&eth->tx_irq_lock, flags);
} }
@@ -641,8 +694,8 @@ static inline void mtk_rx_irq_disable(st @@ -651,8 +704,8 @@ static inline void mtk_rx_irq_disable(st
u32 val; u32 val;
spin_lock_irqsave(&eth->rx_irq_lock, flags); spin_lock_irqsave(&eth->rx_irq_lock, flags);
@@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_irqrestore(&eth->rx_irq_lock, flags); spin_unlock_irqrestore(&eth->rx_irq_lock, flags);
} }
@@ -652,8 +705,8 @@ static inline void mtk_rx_irq_enable(str @@ -662,8 +715,8 @@ static inline void mtk_rx_irq_enable(str
u32 val; u32 val;
spin_lock_irqsave(&eth->rx_irq_lock, flags); spin_lock_irqsave(&eth->rx_irq_lock, flags);
@@ -117,7 +117,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_irqrestore(&eth->rx_irq_lock, flags); spin_unlock_irqrestore(&eth->rx_irq_lock, flags);
} }
@@ -704,39 +757,39 @@ void mtk_stats_update_mac(struct mtk_mac @@ -714,39 +767,39 @@ void mtk_stats_update_mac(struct mtk_mac
hw_stats->rx_checksum_errors += hw_stats->rx_checksum_errors +=
mtk_r32(mac->hw, MT7628_SDM_CS_ERR); mtk_r32(mac->hw, MT7628_SDM_CS_ERR);
} else { } else {
@@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
u64_stats_update_end(&hw_stats->syncp); u64_stats_update_end(&hw_stats->syncp);
@@ -876,10 +929,10 @@ static int mtk_init_fq_dma(struct mtk_et @@ -886,10 +939,10 @@ static int mtk_init_fq_dma(struct mtk_et
txd->txd4 = 0; txd->txd4 = 0;
} }
@@ -187,7 +187,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0; return 0;
} }
@@ -1123,7 +1176,7 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1133,7 +1186,7 @@ static int mtk_tx_map(struct sk_buff *sk
if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) { if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
if (netif_xmit_stopped(netdev_get_tx_queue(dev, 0)) || if (netif_xmit_stopped(netdev_get_tx_queue(dev, 0)) ||
!netdev_xmit_more()) !netdev_xmit_more())
@@ -196,7 +196,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else { } else {
int next_idx; int next_idx;
@@ -1440,6 +1493,7 @@ rx_done: @@ -1450,6 +1503,7 @@ rx_done:
static int mtk_poll_tx_qdma(struct mtk_eth *eth, int budget, static int mtk_poll_tx_qdma(struct mtk_eth *eth, int budget,
unsigned int *done, unsigned int *bytes) 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_ring *ring = &eth->tx_ring;
struct mtk_tx_dma *desc; struct mtk_tx_dma *desc;
struct sk_buff *skb; struct sk_buff *skb;
@@ -1447,7 +1501,7 @@ static int mtk_poll_tx_qdma(struct mtk_e @@ -1457,7 +1511,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
u32 cpu, dma; u32 cpu, dma;
cpu = ring->last_free_ptr; 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); desc = mtk_qdma_phys_to_virt(ring, cpu);
@@ -1482,7 +1536,7 @@ static int mtk_poll_tx_qdma(struct mtk_e @@ -1492,7 +1546,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
} }
ring->last_free_ptr = cpu; ring->last_free_ptr = cpu;
@@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return budget; return budget;
} }
@@ -1575,24 +1629,25 @@ static void mtk_handle_status_irq(struct @@ -1585,24 +1639,25 @@ static void mtk_handle_status_irq(struct
static int mtk_napi_tx(struct napi_struct *napi, int budget) static int mtk_napi_tx(struct napi_struct *napi, int budget)
{ {
struct mtk_eth *eth = container_of(napi, struct mtk_eth, tx_napi); 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; return budget;
if (napi_complete_done(napi, tx_done)) if (napi_complete_done(napi, tx_done))
@@ -1604,6 +1659,7 @@ static int mtk_napi_tx(struct napi_struc @@ -1614,6 +1669,7 @@ static int mtk_napi_tx(struct napi_struc
static int mtk_napi_rx(struct napi_struct *napi, int budget) static int mtk_napi_rx(struct napi_struct *napi, int budget)
{ {
struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi); 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; int rx_done_total = 0;
mtk_handle_status_irq(eth); mtk_handle_status_irq(eth);
@@ -1611,21 +1667,21 @@ static int mtk_napi_rx(struct napi_struc @@ -1621,21 +1677,21 @@ static int mtk_napi_rx(struct napi_struc
do { do {
int rx_done; int rx_done;
@@ -286,7 +286,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (napi_complete_done(napi, rx_done_total)) if (napi_complete_done(napi, rx_done_total))
mtk_rx_irq_enable(eth, MTK_RX_DONE_INT); mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
@@ -1688,20 +1744,20 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1698,20 +1754,20 @@ static int mtk_tx_alloc(struct mtk_eth *
*/ */
wmb(); wmb();
@@ -314,7 +314,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
return 0; return 0;
@@ -1740,6 +1796,7 @@ static void mtk_tx_clean(struct mtk_eth @@ -1750,6 +1806,7 @@ static void mtk_tx_clean(struct mtk_eth
static int mtk_rx_alloc(struct mtk_eth *eth, int ring_no, int rx_flag) 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; struct mtk_rx_ring *ring;
int rx_data_len, rx_dma_size; int rx_data_len, rx_dma_size;
int i; int i;
@@ -1808,16 +1865,18 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1818,16 +1875,18 @@ static int mtk_rx_alloc(struct mtk_eth *
ring->dma_size = rx_dma_size; ring->dma_size = rx_dma_size;
ring->calc_idx_update = false; ring->calc_idx_update = false;
ring->calc_idx = rx_dma_size - 1; ring->calc_idx = rx_dma_size - 1;
@@ -345,7 +345,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0; return 0;
} }
@@ -2129,9 +2188,9 @@ static int mtk_dma_busy_wait(struct mtk_ @@ -2139,9 +2198,9 @@ static int mtk_dma_busy_wait(struct mtk_
u32 val; u32 val;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) 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, ret = readx_poll_timeout_atomic(__raw_readl, eth->base + reg, val,
!(val & (MTK_RX_DMA_BUSY | MTK_TX_DMA_BUSY)), !(val & (MTK_RX_DMA_BUSY | MTK_TX_DMA_BUSY)),
@@ -2189,8 +2248,8 @@ static int mtk_dma_init(struct mtk_eth * @@ -2199,8 +2258,8 @@ static int mtk_dma_init(struct mtk_eth *
* automatically * automatically
*/ */
mtk_w32(eth, FC_THRES_DROP_MODE | FC_THRES_DROP_EN | 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; return 0;
@@ -2264,13 +2323,14 @@ static irqreturn_t mtk_handle_irq_tx(int @@ -2274,13 +2333,14 @@ static irqreturn_t mtk_handle_irq_tx(int
static irqreturn_t mtk_handle_irq(int irq, void *_eth) static irqreturn_t mtk_handle_irq(int irq, void *_eth)
{ {
struct mtk_eth *eth = _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); mtk_handle_irq_tx(irq, _eth);
} }
@@ -2294,6 +2354,7 @@ static void mtk_poll_controller(struct n @@ -2304,6 +2364,7 @@ static void mtk_poll_controller(struct n
static int mtk_start_dma(struct mtk_eth *eth) static int mtk_start_dma(struct mtk_eth *eth)
{ {
u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0; 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; int err;
err = mtk_dma_init(eth); err = mtk_dma_init(eth);
@@ -2308,16 +2369,15 @@ static int mtk_start_dma(struct mtk_eth @@ -2318,16 +2379,15 @@ static int mtk_start_dma(struct mtk_eth
MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO | MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO |
MTK_RX_DMA_EN | MTK_RX_2B_OFFSET | MTK_RX_DMA_EN | MTK_RX_2B_OFFSET |
MTK_RX_BT_32DWORDS, MTK_RX_BT_32DWORDS,
@@ -415,7 +415,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
return 0; return 0;
@@ -2443,8 +2503,8 @@ static int mtk_stop(struct net_device *d @@ -2453,8 +2513,8 @@ static int mtk_stop(struct net_device *d
cancel_work_sync(&eth->tx_dim.work); cancel_work_sync(&eth->tx_dim.work);
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) 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); mtk_dma_free(eth);
@@ -2498,6 +2558,7 @@ static void mtk_dim_rx(struct work_struc @@ -2508,6 +2568,7 @@ static void mtk_dim_rx(struct work_struc
{ {
struct dim *dim = container_of(work, struct dim, work); struct dim *dim = container_of(work, struct dim, work);
struct mtk_eth *eth = container_of(dim, struct mtk_eth, rx_dim); 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; struct dim_cq_moder cur_profile;
u32 val, cur; u32 val, cur;
@@ -2505,7 +2566,7 @@ static void mtk_dim_rx(struct work_struc @@ -2515,7 +2576,7 @@ static void mtk_dim_rx(struct work_struc
dim->profile_ix); dim->profile_ix);
spin_lock_bh(&eth->dim_lock); 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_TX_MASK;
val |= MTK_PDMA_DELAY_RX_EN; val |= MTK_PDMA_DELAY_RX_EN;
@@ -2515,9 +2576,9 @@ static void mtk_dim_rx(struct work_struc @@ -2525,9 +2586,9 @@ static void mtk_dim_rx(struct work_struc
cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK); cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK);
val |= cur << MTK_PDMA_DELAY_RX_PINT_SHIFT; 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); spin_unlock_bh(&eth->dim_lock);
@@ -2528,6 +2589,7 @@ static void mtk_dim_tx(struct work_struc @@ -2538,6 +2599,7 @@ static void mtk_dim_tx(struct work_struc
{ {
struct dim *dim = container_of(work, struct dim, work); struct dim *dim = container_of(work, struct dim, work);
struct mtk_eth *eth = container_of(dim, struct mtk_eth, tx_dim); 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; struct dim_cq_moder cur_profile;
u32 val, cur; u32 val, cur;
@@ -2535,7 +2597,7 @@ static void mtk_dim_tx(struct work_struc @@ -2545,7 +2607,7 @@ static void mtk_dim_tx(struct work_struc
dim->profile_ix); dim->profile_ix);
spin_lock_bh(&eth->dim_lock); 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_RX_MASK;
val |= MTK_PDMA_DELAY_TX_EN; val |= MTK_PDMA_DELAY_TX_EN;
@@ -2545,9 +2607,9 @@ static void mtk_dim_tx(struct work_struc @@ -2555,9 +2617,9 @@ static void mtk_dim_tx(struct work_struc
cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK); cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK);
val |= cur << MTK_PDMA_DELAY_TX_PINT_SHIFT; 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); spin_unlock_bh(&eth->dim_lock);
@@ -2558,6 +2620,7 @@ static int mtk_hw_init(struct mtk_eth *e @@ -2568,6 +2630,7 @@ static int mtk_hw_init(struct mtk_eth *e
{ {
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
ETHSYS_DMA_AG_MAP_PPE; ETHSYS_DMA_AG_MAP_PPE;
@@ -492,7 +492,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int i, val, ret; int i, val, ret;
if (test_and_set_bit(MTK_HW_INIT, &eth->state)) if (test_and_set_bit(MTK_HW_INIT, &eth->state))
@@ -2632,10 +2695,10 @@ static int mtk_hw_init(struct mtk_eth *e @@ -2642,10 +2705,10 @@ static int mtk_hw_init(struct mtk_eth *e
mtk_rx_irq_disable(eth, ~0); mtk_rx_irq_disable(eth, ~0);
/* FE int grouping */ /* FE int grouping */
@@ -507,7 +507,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
return 0; return 0;
@@ -3167,14 +3230,6 @@ static int mtk_probe(struct platform_dev @@ -3177,14 +3240,6 @@ static int mtk_probe(struct platform_dev
if (IS_ERR(eth->base)) if (IS_ERR(eth->base))
return PTR_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)) { if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
eth->rx_dma_l4_valid = RX_DMA_L4_VALID_PDMA; eth->rx_dma_l4_valid = RX_DMA_L4_VALID_PDMA;
eth->ip_align = NET_IP_ALIGN; eth->ip_align = NET_IP_ALIGN;
@@ -3408,6 +3463,7 @@ static int mtk_remove(struct platform_de @@ -3418,6 +3473,7 @@ static int mtk_remove(struct platform_de
} }
static const struct mtk_soc_data mt2701_data = { 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, .caps = MT7623_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES, .hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP, .required_clks = MT7623_CLKS_BITMAP,
@@ -3419,6 +3475,7 @@ static const struct mtk_soc_data mt2701_ @@ -3429,6 +3485,7 @@ static const struct mtk_soc_data mt2701_
}; };
static const struct mtk_soc_data mt7621_data = { static const struct mtk_soc_data mt7621_data = {
@@ -538,7 +538,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.caps = MT7621_CAPS, .caps = MT7621_CAPS,
.hw_features = MTK_HW_FEATURES, .hw_features = MTK_HW_FEATURES,
.required_clks = MT7621_CLKS_BITMAP, .required_clks = MT7621_CLKS_BITMAP,
@@ -3431,6 +3488,7 @@ static const struct mtk_soc_data mt7621_ @@ -3441,6 +3498,7 @@ static const struct mtk_soc_data mt7621_
}; };
static const struct mtk_soc_data mt7622_data = { static const struct mtk_soc_data mt7622_data = {
@@ -546,7 +546,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.ana_rgc3 = 0x2028, .ana_rgc3 = 0x2028,
.caps = MT7622_CAPS | MTK_HWLRO, .caps = MT7622_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES, .hw_features = MTK_HW_FEATURES,
@@ -3444,6 +3502,7 @@ static const struct mtk_soc_data mt7622_ @@ -3454,6 +3512,7 @@ static const struct mtk_soc_data mt7622_
}; };
static const struct mtk_soc_data mt7623_data = { 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, .caps = MT7623_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES, .hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP, .required_clks = MT7623_CLKS_BITMAP,
@@ -3456,6 +3515,7 @@ static const struct mtk_soc_data mt7623_ @@ -3466,6 +3525,7 @@ static const struct mtk_soc_data mt7623_
}; };
static const struct mtk_soc_data mt7629_data = { static const struct mtk_soc_data mt7629_data = {
@@ -562,7 +562,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.ana_rgc3 = 0x128, .ana_rgc3 = 0x128,
.caps = MT7629_CAPS | MTK_HWLRO, .caps = MT7629_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES, .hw_features = MTK_HW_FEATURES,
@@ -3468,6 +3528,7 @@ static const struct mtk_soc_data mt7629_ @@ -3478,6 +3538,7 @@ static const struct mtk_soc_data mt7629_
}; };
static const struct mtk_soc_data rt5350_data = { static const struct mtk_soc_data rt5350_data = {

View File

@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -863,8 +863,8 @@ static inline int mtk_max_buf_size(int f @@ -873,8 +873,8 @@ static inline int mtk_max_buf_size(int f
return buf_size; return buf_size;
} }
@@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
{ {
rxd->rxd2 = READ_ONCE(dma_rxd->rxd2); rxd->rxd2 = READ_ONCE(dma_rxd->rxd2);
if (!(rxd->rxd2 & RX_DMA_DONE)) if (!(rxd->rxd2 & RX_DMA_DONE))
@@ -873,6 +873,10 @@ static inline bool mtk_rx_get_desc(struc @@ -883,6 +883,10 @@ static inline bool mtk_rx_get_desc(struc
rxd->rxd1 = READ_ONCE(dma_rxd->rxd1); rxd->rxd1 = READ_ONCE(dma_rxd->rxd1);
rxd->rxd3 = READ_ONCE(dma_rxd->rxd3); rxd->rxd3 = READ_ONCE(dma_rxd->rxd3);
rxd->rxd4 = READ_ONCE(dma_rxd->rxd4); rxd->rxd4 = READ_ONCE(dma_rxd->rxd4);
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return true; return true;
} }
@@ -917,7 +921,7 @@ static int mtk_init_fq_dma(struct mtk_et @@ -927,7 +931,7 @@ static int mtk_init_fq_dma(struct mtk_et
phy_ring_tail = eth->phy_scratch_ring + soc->txrx.txd_size * (cnt - 1); phy_ring_tail = eth->phy_scratch_ring + soc->txrx.txd_size * (cnt - 1);
for (i = 0; i < cnt; i++) { for (i = 0; i < cnt; i++) {
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd = (void *)eth->scratch_ring + i * soc->txrx.txd_size; txd = (void *)eth->scratch_ring + i * soc->txrx.txd_size;
txd->txd1 = dma_addr + i * MTK_QDMA_PAGE_SIZE; txd->txd1 = dma_addr + i * MTK_QDMA_PAGE_SIZE;
@@ -927,6 +931,12 @@ static int mtk_init_fq_dma(struct mtk_et @@ -937,6 +941,12 @@ static int mtk_init_fq_dma(struct mtk_et
txd->txd3 = TX_DMA_PLEN0(MTK_QDMA_PAGE_SIZE); txd->txd3 = TX_DMA_PLEN0(MTK_QDMA_PAGE_SIZE);
txd->txd4 = 0; txd->txd4 = 0;
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
mtk_w32(eth, eth->phy_scratch_ring, soc->reg_map->qdma.fq_head); mtk_w32(eth, eth->phy_scratch_ring, soc->reg_map->qdma.fq_head);
@@ -1030,10 +1040,12 @@ static void setup_tx_buf(struct mtk_eth @@ -1040,10 +1050,12 @@ static void setup_tx_buf(struct mtk_eth
} }
} }
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 data; u32 data;
WRITE_ONCE(desc->txd1, info->addr); WRITE_ONCE(desc->txd1, info->addr);
@@ -1057,6 +1069,59 @@ static void mtk_tx_set_dma_desc(struct n @@ -1067,6 +1079,59 @@ static void mtk_tx_set_dma_desc(struct n
WRITE_ONCE(desc->txd4, data); WRITE_ONCE(desc->txd4, data);
} }
@@ -132,7 +132,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev,
int tx_num, struct mtk_tx_ring *ring, bool gso) int tx_num, struct mtk_tx_ring *ring, bool gso)
{ {
@@ -1065,6 +1130,7 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1075,6 +1140,7 @@ static int mtk_tx_map(struct sk_buff *sk
.gso = gso, .gso = gso,
.csum = skb->ip_summed == CHECKSUM_PARTIAL, .csum = skb->ip_summed == CHECKSUM_PARTIAL,
.vlan = skb_vlan_tag_present(skb), .vlan = skb_vlan_tag_present(skb),
@@ -140,7 +140,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.vlan_tci = skb_vlan_tag_get(skb), .vlan_tci = skb_vlan_tag_get(skb),
.first = true, .first = true,
.last = !skb_is_nonlinear(skb), .last = !skb_is_nonlinear(skb),
@@ -1124,7 +1190,9 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1134,7 +1200,9 @@ static int mtk_tx_map(struct sk_buff *sk
} }
memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info)); memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
@@ -151,7 +151,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 && txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 &&
!(frag_size - txd_info.size); !(frag_size - txd_info.size);
txd_info.addr = skb_frag_dma_map(eth->dma_dev, frag, txd_info.addr = skb_frag_dma_map(eth->dma_dev, frag,
@@ -1205,17 +1273,16 @@ err_dma: @@ -1215,17 +1283,16 @@ err_dma:
return -ENOMEM; return -ENOMEM;
} }
@@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
} else { } else {
nfrags += skb_shinfo(skb)->nr_frags; nfrags += skb_shinfo(skb)->nr_frags;
@@ -1267,7 +1334,7 @@ static netdev_tx_t mtk_start_xmit(struct @@ -1277,7 +1344,7 @@ static netdev_tx_t mtk_start_xmit(struct
if (unlikely(test_bit(MTK_RESETTING, &eth->state))) if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
goto drop; goto drop;
@@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(atomic_read(&ring->free_count) <= tx_num)) { if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
netif_stop_queue(dev); netif_stop_queue(dev);
netif_err(eth, tx_queued, dev, netif_err(eth, tx_queued, dev,
@@ -1359,7 +1426,7 @@ static int mtk_poll_rx(struct napi_struc @@ -1369,7 +1436,7 @@ static int mtk_poll_rx(struct napi_struc
int idx; int idx;
struct sk_buff *skb; struct sk_buff *skb;
u8 *data, *new_data; u8 *data, *new_data;
@@ -190,7 +190,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int done = 0, bytes = 0; int done = 0, bytes = 0;
while (done < budget) { while (done < budget) {
@@ -1367,7 +1434,7 @@ static int mtk_poll_rx(struct napi_struc @@ -1377,7 +1444,7 @@ static int mtk_poll_rx(struct napi_struc
unsigned int pktlen; unsigned int pktlen;
dma_addr_t dma_addr; dma_addr_t dma_addr;
u32 hash, reason; u32 hash, reason;
@@ -199,7 +199,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring = mtk_get_rx_ring(eth); ring = mtk_get_rx_ring(eth);
if (unlikely(!ring)) if (unlikely(!ring))
@@ -1377,16 +1444,15 @@ static int mtk_poll_rx(struct napi_struc @@ -1387,16 +1454,15 @@ static int mtk_poll_rx(struct napi_struc
rxd = (void *)ring->dma + idx * eth->soc->txrx.rxd_size; rxd = (void *)ring->dma + idx * eth->soc->txrx.rxd_size;
data = ring->data[idx]; 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 || if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
!eth->netdev[mac])) !eth->netdev[mac]))
@@ -1432,7 +1498,7 @@ static int mtk_poll_rx(struct napi_struc @@ -1442,7 +1508,7 @@ static int mtk_poll_rx(struct napi_struc
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2); pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
skb->dev = netdev; skb->dev = netdev;
skb_put(skb, pktlen); skb_put(skb, pktlen);
@@ -231,7 +231,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
else else
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
@@ -1450,10 +1516,25 @@ static int mtk_poll_rx(struct napi_struc @@ -1460,10 +1526,25 @@ static int mtk_poll_rx(struct napi_struc
mtk_ppe_check_skb(eth->ppe, skb, mtk_ppe_check_skb(eth->ppe, skb,
trxd.rxd4 & MTK_RXD4_FOE_ENTRY); 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); skb_record_rx_queue(skb, 0);
napi_gro_receive(napi, skb); napi_gro_receive(napi, skb);
@@ -1465,7 +1546,7 @@ release_desc: @@ -1475,7 +1556,7 @@ release_desc:
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO; rxd->rxd2 = RX_DMA_LSO;
else else
@@ -270,7 +270,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->calc_idx = idx; ring->calc_idx = idx;
@@ -1667,7 +1748,8 @@ static int mtk_napi_rx(struct napi_struc @@ -1677,7 +1758,8 @@ static int mtk_napi_rx(struct napi_struc
do { do {
int rx_done; 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 = mtk_poll_rx(napi, budget - rx_done_total, eth);
rx_done_total += rx_done; rx_done_total += rx_done;
@@ -1681,10 +1763,11 @@ static int mtk_napi_rx(struct napi_struc @@ -1691,10 +1773,11 @@ static int mtk_napi_rx(struct napi_struc
if (rx_done_total == budget) if (rx_done_total == budget)
return budget; return budget;
@@ -294,7 +294,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return rx_done_total; return rx_done_total;
} }
@@ -1694,7 +1777,7 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1704,7 +1787,7 @@ static int mtk_tx_alloc(struct mtk_eth *
const struct mtk_soc_data *soc = eth->soc; const struct mtk_soc_data *soc = eth->soc;
struct mtk_tx_ring *ring = &eth->tx_ring; struct mtk_tx_ring *ring = &eth->tx_ring;
int i, sz = soc->txrx.txd_size; 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), ring->buf = kcalloc(MTK_DMA_SIZE, sizeof(*ring->buf),
GFP_KERNEL); GFP_KERNEL);
@@ -1714,13 +1797,19 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1724,13 +1807,19 @@ static int mtk_tx_alloc(struct mtk_eth *
txd->txd2 = next_ptr; txd->txd2 = next_ptr;
txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU; txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
txd->txd4 = 0; 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->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
&ring->phys_pdma, GFP_KERNEL); &ring->phys_pdma, GFP_KERNEL);
if (!ring->dma_pdma) if (!ring->dma_pdma)
@@ -1800,13 +1889,11 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1810,13 +1899,11 @@ static int mtk_rx_alloc(struct mtk_eth *
struct mtk_rx_ring *ring; struct mtk_rx_ring *ring;
int rx_data_len, rx_dma_size; int rx_data_len, rx_dma_size;
int i; int i;
@@ -338,7 +338,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else { } else {
ring = &eth->rx_ring[ring_no]; ring = &eth->rx_ring[ring_no];
} }
@@ -1842,7 +1929,7 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1852,7 +1939,7 @@ static int mtk_rx_alloc(struct mtk_eth *
return -ENOMEM; return -ENOMEM;
for (i = 0; i < rx_dma_size; i++) { 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, dma_addr_t dma_addr = dma_map_single(eth->dma_dev,
ring->data[i] + NET_SKB_PAD + eth->ip_align, ring->data[i] + NET_SKB_PAD + eth->ip_align,
@@ -1857,26 +1944,47 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1867,26 +1954,47 @@ static int mtk_rx_alloc(struct mtk_eth *
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO; rxd->rxd2 = RX_DMA_LSO;
else else
@@ -403,7 +403,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0; return 0;
} }
@@ -2301,7 +2409,7 @@ static irqreturn_t mtk_handle_irq_rx(int @@ -2311,7 +2419,7 @@ static irqreturn_t mtk_handle_irq_rx(int
eth->rx_events++; eth->rx_events++;
if (likely(napi_schedule_prep(&eth->rx_napi))) { if (likely(napi_schedule_prep(&eth->rx_napi))) {
__napi_schedule(&eth->rx_napi); __napi_schedule(&eth->rx_napi);
@@ -412,7 +412,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
return IRQ_HANDLED; return IRQ_HANDLED;
@@ -2325,8 +2433,10 @@ static irqreturn_t mtk_handle_irq(int ir @@ -2335,8 +2443,10 @@ static irqreturn_t mtk_handle_irq(int ir
struct mtk_eth *eth = _eth; struct mtk_eth *eth = _eth;
const struct mtk_reg_map *reg_map = eth->soc->reg_map; 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); mtk_handle_irq_rx(irq, _eth);
} }
if (mtk_r32(eth, reg_map->tx_irq_mask) & MTK_TX_DONE_INT) { if (mtk_r32(eth, reg_map->tx_irq_mask) & MTK_TX_DONE_INT) {
@@ -2344,16 +2454,16 @@ static void mtk_poll_controller(struct n @@ -2354,16 +2464,16 @@ static void mtk_poll_controller(struct n
struct mtk_eth *eth = mac->hw; struct mtk_eth *eth = mac->hw;
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); 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; const struct mtk_reg_map *reg_map = eth->soc->reg_map;
int err; int err;
@@ -2364,12 +2474,19 @@ static int mtk_start_dma(struct mtk_eth @@ -2374,12 +2484,19 @@ static int mtk_start_dma(struct mtk_eth
} }
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { 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_w32(eth,
MTK_RX_DMA_EN | rx_2b_offset | MTK_RX_DMA_EN | rx_2b_offset |
MTK_RX_BT_32DWORDS | MTK_MULTI_EN, MTK_RX_BT_32DWORDS | MTK_MULTI_EN,
@@ -2443,7 +2560,7 @@ static int mtk_open(struct net_device *d @@ -2453,7 +2570,7 @@ static int mtk_open(struct net_device *d
napi_enable(&eth->tx_napi); napi_enable(&eth->tx_napi);
napi_enable(&eth->rx_napi); napi_enable(&eth->rx_napi);
mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); 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); refcount_set(&eth->dma_refcnt, 1);
} }
else else
@@ -2495,7 +2612,7 @@ static int mtk_stop(struct net_device *d @@ -2505,7 +2622,7 @@ static int mtk_stop(struct net_device *d
mtk_gdm_config(eth, MTK_GDMA_DROP_ALL); mtk_gdm_config(eth, MTK_GDMA_DROP_ALL);
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); 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->tx_napi);
napi_disable(&eth->rx_napi); napi_disable(&eth->rx_napi);
@@ -2655,9 +2772,25 @@ static int mtk_hw_init(struct mtk_eth *e @@ -2665,9 +2782,25 @@ static int mtk_hw_init(struct mtk_eth *e
return 0; return 0;
} }
@@ -518,7 +518,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (eth->pctl) { if (eth->pctl) {
/* Set GE2 driving and slew rate */ /* Set GE2 driving and slew rate */
@@ -2696,11 +2829,47 @@ static int mtk_hw_init(struct mtk_eth *e @@ -2706,11 +2839,47 @@ static int mtk_hw_init(struct mtk_eth *e
/* FE int grouping */ /* FE int grouping */
mtk_w32(eth, MTK_TX_DONE_INT, reg_map->pdma.int_grp); 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; return 0;
err_disable_pm: err_disable_pm:
@@ -3230,12 +3399,8 @@ static int mtk_probe(struct platform_dev @@ -3240,12 +3409,8 @@ static int mtk_probe(struct platform_dev
if (IS_ERR(eth->base)) if (IS_ERR(eth->base))
return PTR_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->page_lock);
spin_lock_init(&eth->tx_irq_lock); spin_lock_init(&eth->tx_irq_lock);
@@ -3471,6 +3636,10 @@ static const struct mtk_soc_data mt2701_ @@ -3481,6 +3646,10 @@ static const struct mtk_soc_data mt2701_
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -593,7 +593,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3484,6 +3653,10 @@ static const struct mtk_soc_data mt7621_ @@ -3494,6 +3663,10 @@ static const struct mtk_soc_data mt7621_
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -604,7 +604,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3498,6 +3671,10 @@ static const struct mtk_soc_data mt7622_ @@ -3508,6 +3681,10 @@ static const struct mtk_soc_data mt7622_
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -615,7 +615,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3511,6 +3688,10 @@ static const struct mtk_soc_data mt7623_ @@ -3521,6 +3698,10 @@ static const struct mtk_soc_data mt7623_
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -626,7 +626,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3524,6 +3705,10 @@ static const struct mtk_soc_data mt7629_ @@ -3534,6 +3715,10 @@ static const struct mtk_soc_data mt7629_
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -637,7 +637,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}, },
}; };
@@ -3536,6 +3721,10 @@ static const struct mtk_soc_data rt5350_ @@ -3546,6 +3731,10 @@ static const struct mtk_soc_data rt5350_
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),

View File

@@ -10,7 +10,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -947,18 +947,15 @@ static int mtk_init_fq_dma(struct mtk_et @@ -957,18 +957,15 @@ static int mtk_init_fq_dma(struct mtk_et
return 0; return 0;
} }
@@ -33,7 +33,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return &ring->buf[idx]; return &ring->buf[idx];
} }
@@ -966,13 +963,12 @@ static struct mtk_tx_buf *mtk_desc_to_tx @@ -976,13 +973,12 @@ static struct mtk_tx_buf *mtk_desc_to_tx
static struct mtk_tx_dma *qdma_to_pdma(struct mtk_tx_ring *ring, static struct mtk_tx_dma *qdma_to_pdma(struct mtk_tx_ring *ring,
struct mtk_tx_dma *dma) struct mtk_tx_dma *dma)
{ {
@@ -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, static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
@@ -1389,7 +1385,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri @@ -1399,7 +1395,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
ring = &eth->rx_ring[i]; ring = &eth->rx_ring[i];
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size); 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) { if (rxd->rxd2 & RX_DMA_DONE) {
ring->calc_idx_update = true; ring->calc_idx_update = true;
return ring; return ring;
@@ -1441,7 +1437,7 @@ static int mtk_poll_rx(struct napi_struc @@ -1451,7 +1447,7 @@ static int mtk_poll_rx(struct napi_struc
goto rx_done; goto rx_done;
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size); 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]; data = ring->data[idx];
if (!mtk_rx_get_desc(eth, &trxd, rxd)) if (!mtk_rx_get_desc(eth, &trxd, rxd))
@@ -1648,7 +1644,7 @@ static int mtk_poll_tx_pdma(struct mtk_e @@ -1658,7 +1654,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
mtk_tx_unmap(eth, tx_buf, true); mtk_tx_unmap(eth, tx_buf, true);
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->last_free = desc; ring->last_free = desc;
atomic_inc(&ring->free_count); atomic_inc(&ring->free_count);
@@ -1793,7 +1789,7 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1803,7 +1799,7 @@ static int mtk_tx_alloc(struct mtk_eth *
int next = (i + 1) % MTK_DMA_SIZE; int next = (i + 1) % MTK_DMA_SIZE;
u32 next_ptr = ring->phys + next * sz; 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->txd2 = next_ptr;
txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU; txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
txd->txd4 = 0; txd->txd4 = 0;
@@ -1823,7 +1819,7 @@ static int mtk_tx_alloc(struct mtk_eth * @@ -1833,7 +1829,7 @@ static int mtk_tx_alloc(struct mtk_eth *
ring->dma_size = MTK_DMA_SIZE; ring->dma_size = MTK_DMA_SIZE;
atomic_set(&ring->free_count, MTK_DMA_SIZE - 2); 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 = (void *)txd;
ring->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz)); ring->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz));
ring->thresh = MAX_SKB_FRAGS; ring->thresh = MAX_SKB_FRAGS;
@@ -1938,7 +1934,7 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1948,7 +1944,7 @@ static int mtk_rx_alloc(struct mtk_eth *
if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr))) if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr)))
return -ENOMEM; return -ENOMEM;
@@ -104,7 +104,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rxd->rxd1 = (unsigned int)dma_addr; rxd->rxd1 = (unsigned int)dma_addr;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
@@ -2000,7 +1996,7 @@ static void mtk_rx_clean(struct mtk_eth @@ -2010,7 +2006,7 @@ static void mtk_rx_clean(struct mtk_eth
if (!ring->data[i]) if (!ring->data[i])
continue; continue;

View File

@@ -11,7 +11,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -923,7 +923,7 @@ static int mtk_init_fq_dma(struct mtk_et @@ -933,7 +933,7 @@ static int mtk_init_fq_dma(struct mtk_et
for (i = 0; i < cnt; i++) { for (i = 0; i < cnt; i++) {
struct mtk_tx_dma_v2 *txd; struct mtk_tx_dma_v2 *txd;

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) void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg)
@@ -3708,6 +3745,21 @@ static const struct mtk_soc_data mt7629_ @@ -3718,6 +3755,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 = { static const struct mtk_soc_data rt5350_data = {
.reg_map = &mt7628_reg_map, .reg_map = &mt7628_reg_map,
.caps = MT7628_CAPS, .caps = MT7628_CAPS,
@@ -3730,6 +3782,7 @@ const struct of_device_id of_mtk_match[] @@ -3740,6 +3792,7 @@ const struct of_device_id of_mtk_match[]
{ .compatible = "mediatek,mt7622-eth", .data = &mt7622_data}, { .compatible = "mediatek,mt7622-eth", .data = &mt7622_data},
{ .compatible = "mediatek,mt7623-eth", .data = &mt7623_data}, { .compatible = "mediatek,mt7623-eth", .data = &mt7623_data},
{ .compatible = "mediatek,mt7629-eth", .data = &mt7629_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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1463,8 +1463,8 @@ static int mtk_poll_rx(struct napi_struc @@ -1473,8 +1473,8 @@ static int mtk_poll_rx(struct napi_struc
int done = 0, bytes = 0; int done = 0, bytes = 0;
while (done < budget) { while (done < budget) {
@@ -22,7 +22,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
dma_addr_t dma_addr; dma_addr_t dma_addr;
u32 hash, reason; u32 hash, reason;
int mac = 0; int mac = 0;
@@ -1531,7 +1531,13 @@ static int mtk_poll_rx(struct napi_struc @@ -1541,7 +1541,13 @@ static int mtk_poll_rx(struct napi_struc
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2); pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
skb->dev = netdev; skb->dev = netdev;
skb_put(skb, pktlen); skb_put(skb, pktlen);
@@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
else else
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
@@ -3755,6 +3761,7 @@ static const struct mtk_soc_data mt7986_ @@ -3765,6 +3771,7 @@ static const struct mtk_soc_data mt7986_
.txd_size = sizeof(struct mtk_tx_dma_v2), .txd_size = sizeof(struct mtk_tx_dma_v2),
.rxd_size = sizeof(struct mtk_rx_dma_v2), .rxd_size = sizeof(struct mtk_rx_dma_v2),
.rx_irq_done_mask = MTK_RX_DONE_INT_V2, .rx_irq_done_mask = MTK_RX_DONE_INT_V2,

View File

@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3351,6 +3351,26 @@ static int mtk_add_mac(struct mtk_eth *e @@ -3361,6 +3361,26 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev; mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV; 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -568,24 +568,8 @@ static void mtk_validate(struct phylink_ @@ -577,24 +577,8 @@ static void mtk_validate(struct phylink_
unsigned long *supported, unsigned long *supported,
struct phylink_link_state *state) struct phylink_link_state *state)
{ {
@@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
phylink_set_port_modes(mask); phylink_set_port_modes(mask);
phylink_set(mask, Autoneg); phylink_set(mask, Autoneg);
@@ -612,7 +596,6 @@ static void mtk_validate(struct phylink_ @@ -621,7 +605,6 @@ static void mtk_validate(struct phylink_
case PHY_INTERFACE_MODE_MII: case PHY_INTERFACE_MODE_MII:
case PHY_INTERFACE_MODE_RMII: case PHY_INTERFACE_MODE_RMII:
case PHY_INTERFACE_MODE_REVMII: case PHY_INTERFACE_MODE_REVMII:
@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default: default:
phylink_set(mask, 10baseT_Half); phylink_set(mask, 10baseT_Half);
phylink_set(mask, 10baseT_Full); phylink_set(mask, 10baseT_Full);
@@ -621,23 +604,6 @@ static void mtk_validate(struct phylink_ @@ -630,23 +613,6 @@ static void mtk_validate(struct phylink_
break; break;
} }

View File

@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -578,8 +578,9 @@ static void mtk_validate(struct phylink_ @@ -587,8 +587,9 @@ static void mtk_validate(struct phylink_
phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseT_Full);
break; break;
case PHY_INTERFACE_MODE_1000BASEX: case PHY_INTERFACE_MODE_1000BASEX:
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
phylink_set(mask, 2500baseX_Full); phylink_set(mask, 2500baseX_Full);
break; break;
case PHY_INTERFACE_MODE_GMII: case PHY_INTERFACE_MODE_GMII:
@@ -609,11 +610,6 @@ static void mtk_validate(struct phylink_ @@ -618,11 +619,6 @@ static void mtk_validate(struct phylink_
linkmode_and(supported, supported, mask); linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask); linkmode_and(state->advertising, state->advertising, mask);

View File

@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -564,56 +564,8 @@ static void mtk_mac_link_up(struct phyli @@ -573,56 +573,8 @@ static void mtk_mac_link_up(struct phyli
mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
} }
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.mac_pcs_get_state = mtk_mac_pcs_get_state, .mac_pcs_get_state = mtk_mac_pcs_get_state,
.mac_an_restart = mtk_mac_an_restart, .mac_an_restart = mtk_mac_an_restart,
.mac_config = mtk_mac_config, .mac_config = mtk_mac_config,
@@ -3313,6 +3265,9 @@ static int mtk_add_mac(struct mtk_eth *e @@ -3323,6 +3275,9 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev; mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV; 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3265,6 +3265,10 @@ static int mtk_add_mac(struct mtk_eth *e @@ -3275,6 +3275,10 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev; mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV; 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3564,9 +3564,9 @@ static int mtk_probe(struct platform_dev @@ -3574,9 +3574,9 @@ static int mtk_probe(struct platform_dev
*/ */
init_dummy_netdev(&eth->dummy_dev); init_dummy_netdev(&eth->dummy_dev);
netif_napi_add(&eth->dummy_dev, &eth->tx_napi, mtk_napi_tx, 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3260,7 +3260,6 @@ static int mtk_add_mac(struct mtk_eth *e @@ -3270,7 +3270,6 @@ static int mtk_add_mac(struct mtk_eth *e
/* mac config is not set */ /* mac config is not set */
mac->interface = PHY_INTERFACE_MODE_NA; mac->interface = PHY_INTERFACE_MODE_NA;

View File

@@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -533,8 +533,18 @@ static void mtk_mac_link_up(struct phyli @@ -542,8 +542,18 @@ static void mtk_mac_link_up(struct phyli
{ {
struct mtk_mac *mac = container_of(config, struct mtk_mac, struct mtk_mac *mac = container_of(config, struct mtk_mac,
phylink_config); phylink_config);
@@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 | mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 |
MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC | MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC |
MAC_MCR_FORCE_RX_FC); MAC_MCR_FORCE_RX_FC);
@@ -3264,9 +3274,7 @@ static int mtk_add_mac(struct mtk_eth *e @@ -3274,9 +3284,7 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev; mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV; mac->phylink_config.type = PHYLINK_NETDEV;

View File

@@ -1,79 +0,0 @@
From 0e37ad71b2ff772009595002da2860999e98e14e Mon Sep 17 00:00:00 2001
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Date: Wed, 18 May 2022 15:55:12 +0100
Subject: [PATCH 09/12] net: mtk_eth_soc: move MAC_MCR setting to mac_finish()
Move the setting of the MTK_MAC_MCR register from the end of mac_config
into the phylink mac_finish() method, to keep it as the very last write
that is done during configuration.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 33 ++++++++++++++-------
1 file changed, 22 insertions(+), 11 deletions(-)
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -316,8 +316,8 @@ static void mtk_mac_config(struct phylin
struct mtk_mac *mac = container_of(config, struct mtk_mac,
phylink_config);
struct mtk_eth *eth = mac->hw;
- u32 mcr_cur, mcr_new, sid, i;
int val, ge_mode, err = 0;
+ u32 sid, i;
/* MT76x8 has no hardware settings between for the MAC */
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
@@ -455,6 +455,25 @@ static void mtk_mac_config(struct phylin
return;
}
+ return;
+
+err_phy:
+ dev_err(eth->dev, "%s: GMAC%d mode %s not supported!\n", __func__,
+ mac->id, phy_modes(state->interface));
+ return;
+
+init_err:
+ dev_err(eth->dev, "%s: GMAC%d mode %s err: %d!\n", __func__,
+ mac->id, phy_modes(state->interface), err);
+}
+
+static int mtk_mac_finish(struct phylink_config *config, unsigned int mode,
+ phy_interface_t interface)
+{
+ struct mtk_mac *mac = container_of(config, struct mtk_mac,
+ phylink_config);
+ u32 mcr_cur, mcr_new;
+
/* Setup gmac */
mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
mcr_new = mcr_cur;
@@ -466,16 +485,7 @@ static void mtk_mac_config(struct phylin
if (mcr_new != mcr_cur)
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
- return;
-
-err_phy:
- dev_err(eth->dev, "%s: GMAC%d mode %s not supported!\n", __func__,
- mac->id, phy_modes(state->interface));
- return;
-
-init_err:
- dev_err(eth->dev, "%s: GMAC%d mode %s err: %d!\n", __func__,
- mac->id, phy_modes(state->interface), err);
+ return 0;
}
static void mtk_mac_pcs_get_state(struct phylink_config *config,
@@ -582,6 +592,7 @@ static const struct phylink_mac_ops mtk_
.mac_pcs_get_state = mtk_mac_pcs_get_state,
.mac_an_restart = mtk_mac_an_restart,
.mac_config = mtk_mac_config,
+ .mac_finish = mtk_mac_finish,
.mac_link_down = mtk_mac_link_down,
.mac_link_up = mtk_mac_link_up,
};

View File

@@ -69,7 +69,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Save the syscfg0 value for mac_finish */ /* Save the syscfg0 value for mac_finish */
mac->syscfg0 = val; mac->syscfg0 = val;
} else if (phylink_autoneg_inband(mode)) { } else if (phylink_autoneg_inband(mode)) {
@@ -527,14 +537,6 @@ static void mtk_mac_pcs_get_state(struct @@ -526,14 +536,6 @@ static void mtk_mac_pcs_get_state(struct
state->pause |= MLO_PAUSE_TX; state->pause |= MLO_PAUSE_TX;
} }
@@ -84,7 +84,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static void mtk_mac_link_down(struct phylink_config *config, unsigned int mode, static void mtk_mac_link_down(struct phylink_config *config, unsigned int mode,
phy_interface_t interface) phy_interface_t interface)
{ {
@@ -555,15 +557,6 @@ static void mtk_mac_link_up(struct phyli @@ -554,15 +556,6 @@ static void mtk_mac_link_up(struct phyli
phylink_config); phylink_config);
u32 mcr; u32 mcr;
@@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id)); mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 | mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 |
MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC | MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC |
@@ -596,8 +589,8 @@ static void mtk_mac_link_up(struct phyli @@ -595,8 +588,8 @@ static void mtk_mac_link_up(struct phyli
static const struct phylink_mac_ops mtk_phylink_ops = { static const struct phylink_mac_ops mtk_phylink_ops = {
.validate = phylink_generic_validate, .validate = phylink_generic_validate,

View File

@@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -1198,27 +1198,31 @@ static int @@ -1243,27 +1243,31 @@ static int
mt7530_port_bridge_join(struct dsa_switch *ds, int port, mt7530_port_bridge_join(struct dsa_switch *ds, int port,
struct net_device *bridge) struct net_device *bridge)
{ {
@@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
} }
/* Add the all other ports to this port matrix. */ /* Add the all other ports to this port matrix. */
@@ -1323,24 +1327,28 @@ static void @@ -1368,24 +1372,28 @@ static void
mt7530_port_bridge_leave(struct dsa_switch *ds, int port, mt7530_port_bridge_leave(struct dsa_switch *ds, int port,
struct net_device *bridge) struct net_device *bridge)
{ {

View File

@@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -2454,6 +2454,32 @@ mt7531_setup(struct dsa_switch *ds) @@ -2499,6 +2499,32 @@ mt7531_setup(struct dsa_switch *ds)
return 0; return 0;
} }
@@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool static bool
mt7530_phy_mode_supported(struct dsa_switch *ds, int port, mt7530_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state) const struct phylink_link_state *state)
@@ -2490,6 +2516,37 @@ static bool mt7531_is_rgmii_port(struct @@ -2535,6 +2561,37 @@ static bool mt7531_is_rgmii_port(struct
return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII); return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
} }
@@ -94,7 +94,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool static bool
mt7531_phy_mode_supported(struct dsa_switch *ds, int port, mt7531_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state) const struct phylink_link_state *state)
@@ -2966,6 +3023,18 @@ mt7531_cpu_port_config(struct dsa_switch @@ -3011,6 +3068,18 @@ mt7531_cpu_port_config(struct dsa_switch
return 0; return 0;
} }
@@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port, mt7530_mac_port_validate(struct dsa_switch *ds, int port,
unsigned long *supported) unsigned long *supported)
@@ -3201,6 +3270,7 @@ static const struct dsa_switch_ops mt753 @@ -3246,6 +3315,7 @@ static const struct dsa_switch_ops mt753
.port_vlan_del = mt7530_port_vlan_del, .port_vlan_del = mt7530_port_vlan_del,
.port_mirror_add = mt753x_port_mirror_add, .port_mirror_add = mt753x_port_mirror_add,
.port_mirror_del = mt753x_port_mirror_del, .port_mirror_del = mt753x_port_mirror_del,
@@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phylink_validate = mt753x_phylink_validate, .phylink_validate = mt753x_phylink_validate,
.phylink_mac_link_state = mt753x_phylink_mac_link_state, .phylink_mac_link_state = mt753x_phylink_mac_link_state,
.phylink_mac_config = mt753x_phylink_mac_config, .phylink_mac_config = mt753x_phylink_mac_config,
@@ -3218,6 +3288,7 @@ static const struct mt753x_info mt753x_t @@ -3263,6 +3333,7 @@ static const struct mt753x_info mt753x_t
.phy_read = mt7530_phy_read, .phy_read = mt7530_phy_read,
.phy_write = mt7530_phy_write, .phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup, .pad_setup = mt7530_pad_clk_setup,
@@ -129,7 +129,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7530_phy_mode_supported, .phy_mode_supported = mt7530_phy_mode_supported,
.mac_port_validate = mt7530_mac_port_validate, .mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_get_state = mt7530_phylink_mac_link_state,
@@ -3229,6 +3300,7 @@ static const struct mt753x_info mt753x_t @@ -3274,6 +3345,7 @@ static const struct mt753x_info mt753x_t
.phy_read = mt7530_phy_read, .phy_read = mt7530_phy_read,
.phy_write = mt7530_phy_write, .phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup, .pad_setup = mt7530_pad_clk_setup,
@@ -137,7 +137,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7530_phy_mode_supported, .phy_mode_supported = mt7530_phy_mode_supported,
.mac_port_validate = mt7530_mac_port_validate, .mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_get_state = mt7530_phylink_mac_link_state,
@@ -3241,6 +3313,7 @@ static const struct mt753x_info mt753x_t @@ -3286,6 +3358,7 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7531_ind_phy_write, .phy_write = mt7531_ind_phy_write,
.pad_setup = mt7531_pad_setup, .pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config, .cpu_port_config = mt7531_cpu_port_config,
@@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7531_phy_mode_supported, .phy_mode_supported = mt7531_phy_mode_supported,
.mac_port_validate = mt7531_mac_port_validate, .mac_port_validate = mt7531_mac_port_validate,
.mac_port_get_state = mt7531_phylink_mac_link_state, .mac_port_get_state = mt7531_phylink_mac_link_state,
@@ -3303,6 +3376,7 @@ mt7530_probe(struct mdio_device *mdiodev @@ -3348,6 +3421,7 @@ mt7530_probe(struct mdio_device *mdiodev
*/ */
if (!priv->info->sw_setup || !priv->info->pad_setup || if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write || !priv->info->phy_read || !priv->info->phy_write ||
@@ -155,7 +155,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
!priv->info->mac_port_get_state || !priv->info->mac_port_config) !priv->info->mac_port_get_state || !priv->info->mac_port_config)
--- a/drivers/net/dsa/mt7530.h --- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h +++ b/drivers/net/dsa/mt7530.h
@@ -769,6 +769,8 @@ struct mt753x_info { @@ -796,6 +796,8 @@ struct mt753x_info {
int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val); int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface); int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface);
int (*cpu_port_config)(struct dsa_switch *ds, int port); int (*cpu_port_config)(struct dsa_switch *ds, int port);

View File

@@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -2480,37 +2480,6 @@ static void mt7530_mac_port_get_caps(str @@ -2525,37 +2525,6 @@ static void mt7530_mac_port_get_caps(str
} }
} }
@@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port) static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port)
{ {
return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII); return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
@@ -2547,44 +2516,6 @@ static void mt7531_mac_port_get_caps(str @@ -2592,44 +2561,6 @@ static void mt7531_mac_port_get_caps(str
} }
} }
@@ -104,7 +104,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static int static int
mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
{ {
@@ -2839,9 +2770,6 @@ mt753x_phylink_mac_config(struct dsa_swi @@ -2884,9 +2815,6 @@ mt753x_phylink_mac_config(struct dsa_swi
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
u32 mcr_cur, mcr_new; u32 mcr_cur, mcr_new;
@@ -114,7 +114,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
switch (port) { switch (port) {
case 0 ... 4: /* Internal phy */ case 0 ... 4: /* Internal phy */
if (state->interface != PHY_INTERFACE_MODE_GMII) if (state->interface != PHY_INTERFACE_MODE_GMII)
@@ -3057,12 +2985,6 @@ mt753x_phylink_validate(struct dsa_switc @@ -3102,12 +3030,6 @@ mt753x_phylink_validate(struct dsa_switc
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
@@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set_port_modes(mask); phylink_set_port_modes(mask);
if (state->interface != PHY_INTERFACE_MODE_TRGMII && if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
@@ -3289,7 +3211,6 @@ static const struct mt753x_info mt753x_t @@ -3334,7 +3256,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write, .phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup, .pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps, .mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -135,7 +135,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7530_mac_port_validate, .mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config, .mac_port_config = mt7530_mac_config,
@@ -3301,7 +3222,6 @@ static const struct mt753x_info mt753x_t @@ -3346,7 +3267,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write, .phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup, .pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps, .mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -143,7 +143,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7530_mac_port_validate, .mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config, .mac_port_config = mt7530_mac_config,
@@ -3314,7 +3234,6 @@ static const struct mt753x_info mt753x_t @@ -3359,7 +3279,6 @@ static const struct mt753x_info mt753x_t
.pad_setup = mt7531_pad_setup, .pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config, .cpu_port_config = mt7531_cpu_port_config,
.mac_port_get_caps = mt7531_mac_port_get_caps, .mac_port_get_caps = mt7531_mac_port_get_caps,
@@ -151,7 +151,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7531_mac_port_validate, .mac_port_validate = mt7531_mac_port_validate,
.mac_port_get_state = mt7531_phylink_mac_link_state, .mac_port_get_state = mt7531_phylink_mac_link_state,
.mac_port_config = mt7531_mac_config, .mac_port_config = mt7531_mac_config,
@@ -3377,7 +3296,6 @@ mt7530_probe(struct mdio_device *mdiodev @@ -3422,7 +3341,6 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup || if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write || !priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps || !priv->info->mac_port_get_caps ||
@@ -161,7 +161,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return -EINVAL; return -EINVAL;
--- a/drivers/net/dsa/mt7530.h --- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h +++ b/drivers/net/dsa/mt7530.h
@@ -771,8 +771,6 @@ struct mt753x_info { @@ -798,8 +798,6 @@ struct mt753x_info {
int (*cpu_port_config)(struct dsa_switch *ds, int port); int (*cpu_port_config)(struct dsa_switch *ds, int port);
void (*mac_port_get_caps)(struct dsa_switch *ds, int port, void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
struct phylink_config *config); struct phylink_config *config);

View File

@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -3009,11 +3009,6 @@ mt753x_phylink_validate(struct dsa_switc @@ -3054,11 +3054,6 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(supported, supported, mask); linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask); linkmode_and(state->advertising, state->advertising, mask);

View File

@@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -2587,12 +2587,13 @@ static int mt7531_rgmii_setup(struct mt7 @@ -2632,12 +2632,13 @@ static int mt7531_rgmii_setup(struct mt7
} }
static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port, static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port,
@@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set(supported, 2500baseX_Full); phylink_set(supported, 2500baseX_Full);
phylink_set(supported, 2500baseT_Full); phylink_set(supported, 2500baseT_Full);
} }
@@ -2965,16 +2966,18 @@ static void mt753x_phylink_get_caps(stru @@ -3010,16 +3011,18 @@ static void mt753x_phylink_get_caps(stru
static void static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port, mt7530_mac_port_validate(struct dsa_switch *ds, int port,
@@ -58,7 +58,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
} }
static void static void
@@ -2997,12 +3000,13 @@ mt753x_phylink_validate(struct dsa_switc @@ -3042,12 +3045,13 @@ mt753x_phylink_validate(struct dsa_switc
} }
/* This switch only supports 1G full-duplex. */ /* This switch only supports 1G full-duplex. */
@@ -76,7 +76,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set(mask, Asym_Pause); phylink_set(mask, Asym_Pause);
--- a/drivers/net/dsa/mt7530.h --- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h +++ b/drivers/net/dsa/mt7530.h
@@ -772,6 +772,7 @@ struct mt753x_info { @@ -799,6 +799,7 @@ struct mt753x_info {
void (*mac_port_get_caps)(struct dsa_switch *ds, int port, void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
struct phylink_config *config); struct phylink_config *config);
void (*mac_port_validate)(struct dsa_switch *ds, int port, void (*mac_port_validate)(struct dsa_switch *ds, int port,

View File

@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -2586,19 +2586,6 @@ static int mt7531_rgmii_setup(struct mt7 @@ -2631,19 +2631,6 @@ static int mt7531_rgmii_setup(struct mt7
return 0; return 0;
} }
@@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void static void
mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port, mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port,
unsigned int mode, phy_interface_t interface, unsigned int mode, phy_interface_t interface,
@@ -2965,51 +2952,21 @@ static void mt753x_phylink_get_caps(stru @@ -3010,51 +2997,21 @@ static void mt753x_phylink_get_caps(stru
} }
static void static void
@@ -97,7 +97,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
linkmode_and(supported, supported, mask); linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask); linkmode_and(state->advertising, state->advertising, mask);
@@ -3210,7 +3167,6 @@ static const struct mt753x_info mt753x_t @@ -3255,7 +3212,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write, .phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup, .pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps, .mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -105,7 +105,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config, .mac_port_config = mt7530_mac_config,
}, },
@@ -3221,7 +3177,6 @@ static const struct mt753x_info mt753x_t @@ -3266,7 +3222,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write, .phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup, .pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps, .mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config, .mac_port_config = mt7530_mac_config,
}, },
@@ -3233,7 +3188,6 @@ static const struct mt753x_info mt753x_t @@ -3278,7 +3233,6 @@ static const struct mt753x_info mt753x_t
.pad_setup = mt7531_pad_setup, .pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config, .cpu_port_config = mt7531_cpu_port_config,
.mac_port_get_caps = mt7531_mac_port_get_caps, .mac_port_get_caps = mt7531_mac_port_get_caps,
@@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7531_phylink_mac_link_state, .mac_port_get_state = mt7531_phylink_mac_link_state,
.mac_port_config = mt7531_mac_config, .mac_port_config = mt7531_mac_config,
.mac_pcs_an_restart = mt7531_sgmii_restart_an, .mac_pcs_an_restart = mt7531_sgmii_restart_an,
@@ -3295,7 +3249,6 @@ mt7530_probe(struct mdio_device *mdiodev @@ -3340,7 +3294,6 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup || if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write || !priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps || !priv->info->mac_port_get_caps ||

View File

@@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -24,6 +24,11 @@ @@ -25,6 +25,11 @@
#include "mt7530.h" #include "mt7530.h"
@@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* String, offset, and register size in bytes if different from 4 bytes */ /* String, offset, and register size in bytes if different from 4 bytes */
static const struct mt7530_mib_desc mt7530_mib[] = { static const struct mt7530_mib_desc mt7530_mib[] = {
MIB_DESC(1, 0x00, "TxDrop"), MIB_DESC(1, 0x00, "TxDrop"),
@@ -2586,12 +2591,11 @@ static int mt7531_rgmii_setup(struct mt7 @@ -2631,12 +2636,11 @@ static int mt7531_rgmii_setup(struct mt7
return 0; return 0;
} }
@@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
unsigned int val; unsigned int val;
/* For adjusting speed and duplex of SGMII force mode. */ /* For adjusting speed and duplex of SGMII force mode. */
@@ -2617,6 +2621,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw @@ -2662,6 +2666,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
/* MT7531 SGMII 1G force mode can only work in full duplex mode, /* MT7531 SGMII 1G force mode can only work in full duplex mode,
* no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not. * no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
@@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
*/ */
if ((speed == SPEED_10 || speed == SPEED_100) && if ((speed == SPEED_10 || speed == SPEED_100) &&
duplex != DUPLEX_FULL) duplex != DUPLEX_FULL)
@@ -2692,9 +2699,10 @@ static int mt7531_sgmii_setup_mode_an(st @@ -2737,9 +2744,10 @@ static int mt7531_sgmii_setup_mode_an(st
return 0; return 0;
} }
@@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 val; u32 val;
/* Only restart AN when AN is enabled */ /* Only restart AN when AN is enabled */
@@ -2751,6 +2759,24 @@ mt753x_mac_config(struct dsa_switch *ds, @@ -2796,6 +2804,24 @@ mt753x_mac_config(struct dsa_switch *ds,
return priv->info->mac_port_config(ds, port, mode, state->interface); return priv->info->mac_port_config(ds, port, mode, state->interface);
} }
@@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void static void
mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
const struct phylink_link_state *state) const struct phylink_link_state *state)
@@ -2812,17 +2838,6 @@ unsupported: @@ -2857,17 +2883,6 @@ unsupported:
mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
} }
@@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port, static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
unsigned int mode, unsigned int mode,
phy_interface_t interface) phy_interface_t interface)
@@ -2832,16 +2847,13 @@ static void mt753x_phylink_mac_link_down @@ -2877,16 +2892,13 @@ static void mt753x_phylink_mac_link_down
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
} }
@@ -139,7 +139,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
} }
static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port, static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
@@ -2854,8 +2866,6 @@ static void mt753x_phylink_mac_link_up(s @@ -2899,8 +2911,6 @@ static void mt753x_phylink_mac_link_up(s
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
u32 mcr; u32 mcr;
@@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK; mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
/* MT753x MAC works in 1G full duplex mode for all up-clocked /* MT753x MAC works in 1G full duplex mode for all up-clocked
@@ -2933,6 +2943,8 @@ mt7531_cpu_port_config(struct dsa_switch @@ -2978,6 +2988,8 @@ mt7531_cpu_port_config(struct dsa_switch
return ret; return ret;
mt7530_write(priv, MT7530_PMCR_P(port), mt7530_write(priv, MT7530_PMCR_P(port),
PMCR_CPU_PORT_SETTING(priv->id)); PMCR_CPU_PORT_SETTING(priv->id));
@@ -157,7 +157,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL, mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
speed, DUPLEX_FULL, true, true); speed, DUPLEX_FULL, true, true);
@@ -2972,16 +2984,13 @@ mt753x_phylink_validate(struct dsa_switc @@ -3017,16 +3029,13 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(state->advertising, state->advertising, mask); linkmode_and(state->advertising, state->advertising, mask);
} }
@@ -178,7 +178,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
pmsr = mt7530_read(priv, MT7530_PMSR_P(port)); pmsr = mt7530_read(priv, MT7530_PMSR_P(port));
state->link = (pmsr & PMSR_LINK); state->link = (pmsr & PMSR_LINK);
@@ -3008,8 +3017,6 @@ mt7530_phylink_mac_link_state(struct dsa @@ -3053,8 +3062,6 @@ mt7530_phylink_mac_link_state(struct dsa
state->pause |= MLO_PAUSE_RX; state->pause |= MLO_PAUSE_RX;
if (pmsr & PMSR_TX_FC) if (pmsr & PMSR_TX_FC)
state->pause |= MLO_PAUSE_TX; state->pause |= MLO_PAUSE_TX;
@@ -187,7 +187,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
} }
static int static int
@@ -3051,32 +3058,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 @@ -3096,32 +3103,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
return 0; return 0;
} }
@@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (ret) if (ret)
return ret; return ret;
@@ -3089,6 +3113,13 @@ mt753x_setup(struct dsa_switch *ds) @@ -3134,6 +3158,13 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq) if (ret && priv->irq)
mt7530_free_irq_common(priv); mt7530_free_irq_common(priv);
@@ -263,7 +263,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return ret; return ret;
} }
@@ -3150,9 +3181,8 @@ static const struct dsa_switch_ops mt753 @@ -3195,9 +3226,8 @@ static const struct dsa_switch_ops mt753
.port_mirror_del = mt753x_port_mirror_del, .port_mirror_del = mt753x_port_mirror_del,
.phylink_get_caps = mt753x_phylink_get_caps, .phylink_get_caps = mt753x_phylink_get_caps,
.phylink_validate = mt753x_phylink_validate, .phylink_validate = mt753x_phylink_validate,
@@ -274,7 +274,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phylink_mac_link_down = mt753x_phylink_mac_link_down, .phylink_mac_link_down = mt753x_phylink_mac_link_down,
.phylink_mac_link_up = mt753x_phylink_mac_link_up, .phylink_mac_link_up = mt753x_phylink_mac_link_up,
.get_mac_eee = mt753x_get_mac_eee, .get_mac_eee = mt753x_get_mac_eee,
@@ -3162,36 +3192,34 @@ static const struct dsa_switch_ops mt753 @@ -3207,36 +3237,34 @@ static const struct dsa_switch_ops mt753
static const struct mt753x_info mt753x_table[] = { static const struct mt753x_info mt753x_table[] = {
[ID_MT7621] = { [ID_MT7621] = {
.id = ID_MT7621, .id = ID_MT7621,
@@ -314,7 +314,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}, },
}; };
@@ -3249,7 +3277,7 @@ mt7530_probe(struct mdio_device *mdiodev @@ -3294,7 +3322,7 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup || if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write || !priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps || !priv->info->mac_port_get_caps ||
@@ -325,7 +325,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
priv->id = priv->info->id; priv->id = priv->info->id;
--- a/drivers/net/dsa/mt7530.h --- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h +++ b/drivers/net/dsa/mt7530.h
@@ -741,6 +741,12 @@ static const char *p5_intf_modes(unsigne @@ -768,6 +768,12 @@ static const char *p5_intf_modes(unsigne
struct mt7530_priv; struct mt7530_priv;
@@ -338,7 +338,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* struct mt753x_info - This is the main data structure for holding the specific /* struct mt753x_info - This is the main data structure for holding the specific
* part for each supported device * part for each supported device
* @sw_setup: Holding the handler to a device initialization * @sw_setup: Holding the handler to a device initialization
@@ -752,18 +758,14 @@ struct mt7530_priv; @@ -779,18 +785,14 @@ struct mt7530_priv;
* port * port
* @mac_port_validate: Holding the way to set addition validate type for a * @mac_port_validate: Holding the way to set addition validate type for a
* certan MAC port * certan MAC port
@@ -359,7 +359,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
int (*sw_setup)(struct dsa_switch *ds); int (*sw_setup)(struct dsa_switch *ds);
int (*phy_read)(struct mt7530_priv *priv, int port, int regnum); int (*phy_read)(struct mt7530_priv *priv, int port, int regnum);
int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val); int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
@@ -774,15 +776,9 @@ struct mt753x_info { @@ -801,15 +803,9 @@ struct mt753x_info {
void (*mac_port_validate)(struct dsa_switch *ds, int port, void (*mac_port_validate)(struct dsa_switch *ds, int port,
phy_interface_t interface, phy_interface_t interface,
unsigned long *supported); unsigned long *supported);
@@ -375,7 +375,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}; };
/* struct mt7530_priv - This is the main data structure for holding the state /* struct mt7530_priv - This is the main data structure for holding the state
@@ -824,6 +820,7 @@ struct mt7530_priv { @@ -851,6 +847,7 @@ struct mt7530_priv {
u8 mirror_tx; u8 mirror_tx;
struct mt7530_port ports[MT7530_NUM_PORTS]; struct mt7530_port ports[MT7530_NUM_PORTS];

View File

@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -2963,25 +2963,16 @@ static void mt753x_phylink_get_caps(stru @@ -3008,25 +3008,16 @@ static void mt753x_phylink_get_caps(stru
priv->info->mac_port_get_caps(ds, port, config); priv->info->mac_port_get_caps(ds, port, config);
} }
@@ -55,7 +55,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
} }
static void mt7530_pcs_get_state(struct phylink_pcs *pcs, static void mt7530_pcs_get_state(struct phylink_pcs *pcs,
@@ -3083,12 +3074,14 @@ static void mt7530_pcs_an_restart(struct @@ -3128,12 +3119,14 @@ static void mt7530_pcs_an_restart(struct
} }
static const struct phylink_pcs_ops mt7530_pcs_ops = { static const struct phylink_pcs_ops mt7530_pcs_ops = {
@@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.pcs_get_state = mt7531_pcs_get_state, .pcs_get_state = mt7531_pcs_get_state,
.pcs_config = mt753x_pcs_config, .pcs_config = mt753x_pcs_config,
.pcs_an_restart = mt7531_pcs_an_restart, .pcs_an_restart = mt7531_pcs_an_restart,
@@ -3180,7 +3173,6 @@ static const struct dsa_switch_ops mt753 @@ -3225,7 +3218,6 @@ static const struct dsa_switch_ops mt753
.port_mirror_add = mt753x_port_mirror_add, .port_mirror_add = mt753x_port_mirror_add,
.port_mirror_del = mt753x_port_mirror_del, .port_mirror_del = mt753x_port_mirror_del,
.phylink_get_caps = mt753x_phylink_get_caps, .phylink_get_caps = mt753x_phylink_get_caps,

View File

@@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -2960,6 +2960,12 @@ static void mt753x_phylink_get_caps(stru @@ -3005,6 +3005,12 @@ static void mt753x_phylink_get_caps(stru
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000FD; MAC_10 | MAC_100 | MAC_1000FD;

View File

@@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -3098,9 +3098,16 @@ static int @@ -3143,9 +3143,16 @@ static int
mt753x_setup(struct dsa_switch *ds) mt753x_setup(struct dsa_switch *ds)
{ {
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
@@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret) if (ret)
return ret; return ret;
@@ -3112,13 +3119,6 @@ mt753x_setup(struct dsa_switch *ds) @@ -3157,13 +3164,6 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq) if (ret && priv->irq)
mt7530_free_irq_common(priv); mt7530_free_irq_common(priv);

View File

@@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -1544,11 +1544,11 @@ static void @@ -1589,11 +1589,11 @@ static void
mt7530_hw_vlan_add(struct mt7530_priv *priv, mt7530_hw_vlan_add(struct mt7530_priv *priv,
struct mt7530_hw_vlan_entry *entry) struct mt7530_hw_vlan_entry *entry)
{ {
@@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Validate the entry with independent learning, create egress tag per /* Validate the entry with independent learning, create egress tag per
* VLAN and joining the port as one of the port members. * VLAN and joining the port as one of the port members.
@@ -1559,22 +1559,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p @@ -1604,22 +1604,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
/* Decide whether adding tag or not for those outgoing packets from the /* Decide whether adding tag or not for those outgoing packets from the
* port inside the VLAN. * port inside the VLAN.
@@ -72,7 +72,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
} }
static void static void
@@ -1593,11 +1591,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p @@ -1638,11 +1636,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
return; return;
} }

View File

@@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c --- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c
@@ -1048,6 +1048,7 @@ static int @@ -1093,6 +1093,7 @@ static int
mt7530_port_enable(struct dsa_switch *ds, int port, mt7530_port_enable(struct dsa_switch *ds, int port,
struct phy_device *phy) struct phy_device *phy)
{ {
@@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex); mutex_lock(&priv->reg_mutex);
@@ -1056,7 +1057,11 @@ mt7530_port_enable(struct dsa_switch *ds @@ -1101,7 +1102,11 @@ mt7530_port_enable(struct dsa_switch *ds
* restore the port matrix if the port is the member of a certain * restore the port matrix if the port is the member of a certain
* bridge. * bridge.
*/ */
@@ -42,7 +42,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
priv->ports[port].enable = true; priv->ports[port].enable = true;
mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
priv->ports[port].pm); priv->ports[port].pm);
@@ -1204,7 +1209,8 @@ mt7530_port_bridge_join(struct dsa_switc @@ -1249,7 +1254,8 @@ mt7530_port_bridge_join(struct dsa_switc
struct net_device *bridge) struct net_device *bridge)
{ {
struct dsa_port *dp = dsa_to_port(ds, port), *other_dp; struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex); mutex_lock(&priv->reg_mutex);
@@ -1281,9 +1287,12 @@ mt7530_port_set_vlan_unaware(struct dsa_ @@ -1326,9 +1332,12 @@ mt7530_port_set_vlan_unaware(struct dsa_
* the CPU port get out of VLAN filtering mode. * the CPU port get out of VLAN filtering mode.
*/ */
if (all_user_ports_removed) { if (all_user_ports_removed) {
@@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT)); | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
} }
} }
@@ -1333,6 +1342,7 @@ mt7530_port_bridge_leave(struct dsa_swit @@ -1378,6 +1387,7 @@ mt7530_port_bridge_leave(struct dsa_swit
struct net_device *bridge) struct net_device *bridge)
{ {
struct dsa_port *dp = dsa_to_port(ds, port), *other_dp; struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex); mutex_lock(&priv->reg_mutex);
@@ -1361,8 +1371,8 @@ mt7530_port_bridge_leave(struct dsa_swit @@ -1406,8 +1416,8 @@ mt7530_port_bridge_leave(struct dsa_swit
*/ */
if (priv->ports[port].enable) if (priv->ports[port].enable)
mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
@@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* When a port is removed from the bridge, the port would be set up /* When a port is removed from the bridge, the port would be set up
* back to the default as is at initial boot which is a VLAN-unaware * back to the default as is at initial boot which is a VLAN-unaware
@@ -1525,6 +1535,9 @@ static int @@ -1570,6 +1580,9 @@ static int
mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering, mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
@@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (vlan_filtering) { if (vlan_filtering) {
/* The port is being kept as VLAN-unaware port when bridge is /* The port is being kept as VLAN-unaware port when bridge is
* set up with vlan_filtering not being set, Otherwise, the * set up with vlan_filtering not being set, Otherwise, the
@@ -1532,7 +1545,7 @@ mt7530_port_vlan_filtering(struct dsa_sw @@ -1577,7 +1590,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
* for becoming a VLAN-aware port. * for becoming a VLAN-aware port.
*/ */
mt7530_port_set_vlan_aware(ds, port); mt7530_port_set_vlan_aware(ds, port);

View File

@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
MediaTek SoC family. MediaTek SoC family.
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1389,6 +1389,68 @@ static void mtk_update_rx_cpu_idx(struct @@ -1388,6 +1388,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, static int mtk_poll_rx(struct napi_struct *napi, int budget,
struct mtk_eth *eth) struct mtk_eth *eth)
{ {
@@ -1402,9 +1464,9 @@ static int mtk_poll_rx(struct napi_struc @@ -1401,9 +1463,9 @@ static int mtk_poll_rx(struct napi_struc
while (done < budget) { while (done < budget) {
unsigned int pktlen, *rxdcsum; unsigned int pktlen, *rxdcsum;
@@ -107,7 +107,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int mac = 0; int mac = 0;
ring = mtk_get_rx_ring(eth); ring = mtk_get_rx_ring(eth);
@@ -1435,36 +1497,54 @@ static int mtk_poll_rx(struct napi_struc @@ -1434,36 +1496,54 @@ static int mtk_poll_rx(struct napi_struc
goto release_desc; goto release_desc;
/* alloc new buffer */ /* alloc new buffer */
@@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2); pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
skb->dev = netdev; skb->dev = netdev;
@@ -1518,7 +1598,6 @@ static int mtk_poll_rx(struct napi_struc @@ -1517,7 +1597,6 @@ static int mtk_poll_rx(struct napi_struc
skip_rx: skip_rx:
ring->data[idx] = new_data; ring->data[idx] = new_data;
rxd->rxd1 = (unsigned int)dma_addr; rxd->rxd1 = (unsigned int)dma_addr;
@@ -192,7 +192,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
release_desc: release_desc:
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO; rxd->rxd2 = RX_DMA_LSO;
@@ -1526,7 +1605,6 @@ release_desc: @@ -1525,7 +1604,6 @@ release_desc:
rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size); rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
ring->calc_idx = idx; ring->calc_idx = idx;
@@ -200,7 +200,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
done++; done++;
} }
@@ -1890,13 +1968,15 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1889,13 +1967,15 @@ static int mtk_rx_alloc(struct mtk_eth *
if (!ring->data) if (!ring->data)
return -ENOMEM; return -ENOMEM;
@@ -223,7 +223,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
ring->dma = dma_alloc_coherent(eth->dma_dev, ring->dma = dma_alloc_coherent(eth->dma_dev,
@@ -1907,16 +1987,33 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1906,16 +1986,33 @@ static int mtk_rx_alloc(struct mtk_eth *
for (i = 0; i < rx_dma_size; i++) { for (i = 0; i < rx_dma_size; i++) {
struct mtk_rx_dma_v2 *rxd; 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)) if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO; rxd->rxd2 = RX_DMA_LSO;
@@ -1932,6 +2029,7 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1931,6 +2028,7 @@ static int mtk_rx_alloc(struct mtk_eth *
rxd->rxd8 = 0; rxd->rxd8 = 0;
} }
} }
@@ -272,7 +272,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->dma_size = rx_dma_size; ring->dma_size = rx_dma_size;
ring->calc_idx_update = false; ring->calc_idx_update = false;
ring->calc_idx = rx_dma_size - 1; ring->calc_idx = rx_dma_size - 1;
@@ -1983,7 +2081,7 @@ static void mtk_rx_clean(struct mtk_eth @@ -1982,7 +2080,7 @@ static void mtk_rx_clean(struct mtk_eth
dma_unmap_single(eth->dma_dev, rxd->rxd1, dma_unmap_single(eth->dma_dev, rxd->rxd1,
ring->buf_size, DMA_FROM_DEVICE); ring->buf_size, DMA_FROM_DEVICE);
@@ -281,7 +281,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
kfree(ring->data); kfree(ring->data);
ring->data = NULL; ring->data = NULL;
@@ -1995,6 +2093,13 @@ static void mtk_rx_clean(struct mtk_eth @@ -1994,6 +2092,13 @@ static void mtk_rx_clean(struct mtk_eth
ring->dma, ring->phys); ring->dma, ring->phys);
ring->dma = NULL; 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1389,6 +1389,11 @@ static void mtk_update_rx_cpu_idx(struct @@ -1388,6 +1388,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, static struct page_pool *mtk_create_page_pool(struct mtk_eth *eth,
struct xdp_rxq_info *xdp_q, struct xdp_rxq_info *xdp_q,
int id, int size) int id, int size)
@@ -1451,11 +1456,52 @@ static void mtk_rx_put_buff(struct mtk_r @@ -1450,11 +1455,52 @@ static void mtk_rx_put_buff(struct mtk_r
skb_free_frag(data); skb_free_frag(data);
} }
@@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int idx; int idx;
struct sk_buff *skb; struct sk_buff *skb;
u8 *data, *new_data; u8 *data, *new_data;
@@ -1464,9 +1510,9 @@ static int mtk_poll_rx(struct napi_struc @@ -1463,9 +1509,9 @@ static int mtk_poll_rx(struct napi_struc
while (done < budget) { while (done < budget) {
unsigned int pktlen, *rxdcsum; unsigned int pktlen, *rxdcsum;
@@ -94,7 +94,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int mac = 0; int mac = 0;
ring = mtk_get_rx_ring(eth); ring = mtk_get_rx_ring(eth);
@@ -1496,8 +1542,14 @@ static int mtk_poll_rx(struct napi_struc @@ -1495,8 +1541,14 @@ static int mtk_poll_rx(struct napi_struc
if (unlikely(test_bit(MTK_RESETTING, &eth->state))) if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
goto release_desc; 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, new_data = mtk_page_pool_get_buff(ring->page_pool,
&dma_addr, &dma_addr,
GFP_ATOMIC); GFP_ATOMIC);
@@ -1505,6 +1557,34 @@ static int mtk_poll_rx(struct napi_struc @@ -1504,6 +1556,34 @@ static int mtk_poll_rx(struct napi_struc
netdev->stats.rx_dropped++; netdev->stats.rx_dropped++;
goto release_desc; goto release_desc;
} }
@@ -144,7 +144,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else { } else {
if (ring->frag_size <= PAGE_SIZE) if (ring->frag_size <= PAGE_SIZE)
new_data = napi_alloc_frag(ring->frag_size); new_data = napi_alloc_frag(ring->frag_size);
@@ -1528,27 +1608,20 @@ static int mtk_poll_rx(struct napi_struc @@ -1527,27 +1607,20 @@ static int mtk_poll_rx(struct napi_struc
dma_unmap_single(eth->dma_dev, trxd.rxd1, dma_unmap_single(eth->dma_dev, trxd.rxd1,
ring->buf_size, DMA_FROM_DEVICE); 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)) if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
rxdcsum = &trxd.rxd3; rxdcsum = &trxd.rxd3;
@@ -1560,7 +1633,6 @@ static int mtk_poll_rx(struct napi_struc @@ -1559,7 +1632,6 @@ static int mtk_poll_rx(struct napi_struc
else else
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev); 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; hash = trxd.rxd4 & MTK_RXD4_FOE_ENTRY;
if (hash != MTK_RXD4_FOE_ENTRY) { if (hash != MTK_RXD4_FOE_ENTRY) {
@@ -1623,6 +1695,9 @@ rx_done: @@ -1622,6 +1694,9 @@ rx_done:
&dim_sample); &dim_sample);
net_dim(&eth->rx_dim, dim_sample); net_dim(&eth->rx_dim, dim_sample);
@@ -199,7 +199,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return done; return done;
} }
@@ -1968,7 +2043,7 @@ static int mtk_rx_alloc(struct mtk_eth * @@ -1967,7 +2042,7 @@ static int mtk_rx_alloc(struct mtk_eth *
if (!ring->data) if (!ring->data)
return -ENOMEM; return -ENOMEM;
@@ -208,7 +208,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct page_pool *pp; struct page_pool *pp;
pp = mtk_create_page_pool(eth, &ring->xdp_q, ring_no, pp = mtk_create_page_pool(eth, &ring->xdp_q, ring_no,
@@ -2713,6 +2788,48 @@ static int mtk_stop(struct net_device *d @@ -2712,6 +2787,48 @@ static int mtk_stop(struct net_device *d
return 0; 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) static void ethsys_reset(struct mtk_eth *eth, u32 reset_bits)
{ {
regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL,
@@ -2991,6 +3108,12 @@ static int mtk_change_mtu(struct net_dev @@ -2990,6 +3107,12 @@ static int mtk_change_mtu(struct net_dev
struct mtk_eth *eth = mac->hw; struct mtk_eth *eth = mac->hw;
u32 mcr_cur, mcr_new; 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)) { if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id)); mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK; mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK;
@@ -3317,6 +3440,7 @@ static const struct net_device_ops mtk_n @@ -3316,6 +3439,7 @@ static const struct net_device_ops mtk_n
.ndo_poll_controller = mtk_poll_controller, .ndo_poll_controller = mtk_poll_controller,
#endif #endif
.ndo_setup_tc = mtk_eth_setup_tc, .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[] = { static const char * const mtk_clks_source_name[] = {
@@ -1459,6 +1470,9 @@ static void mtk_rx_put_buff(struct mtk_r @@ -1458,6 +1469,9 @@ static void mtk_rx_put_buff(struct mtk_r
static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring, static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
struct xdp_buff *xdp, struct net_device *dev) 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; struct bpf_prog *prog;
u32 act = XDP_PASS; u32 act = XDP_PASS;
@@ -1471,13 +1485,16 @@ static u32 mtk_xdp_run(struct mtk_eth *e @@ -1470,13 +1484,16 @@ static u32 mtk_xdp_run(struct mtk_eth *e
act = bpf_prog_run_xdp(prog, xdp); act = bpf_prog_run_xdp(prog, xdp);
switch (act) { switch (act) {
case XDP_PASS: case XDP_PASS:
@@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default: default:
bpf_warn_invalid_xdp_action(act); bpf_warn_invalid_xdp_action(act);
fallthrough; fallthrough;
@@ -1490,6 +1507,11 @@ static u32 mtk_xdp_run(struct mtk_eth *e @@ -1489,6 +1506,11 @@ static u32 mtk_xdp_run(struct mtk_eth *e
page_pool_put_full_page(ring->page_pool, page_pool_put_full_page(ring->page_pool,
virt_to_head_page(xdp->data), true); virt_to_head_page(xdp->data), true);

View File

@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -988,15 +988,26 @@ static void mtk_tx_unmap(struct mtk_eth @@ -987,15 +987,26 @@ static void mtk_tx_unmap(struct mtk_eth
} }
} }
@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
static void setup_tx_buf(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf, static void setup_tx_buf(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
@@ -1013,7 +1024,7 @@ static void setup_tx_buf(struct mtk_eth @@ -1012,7 +1023,7 @@ static void setup_tx_buf(struct mtk_eth
dma_unmap_addr_set(tx_buf, dma_addr1, mapped_addr); dma_unmap_addr_set(tx_buf, dma_addr1, mapped_addr);
dma_unmap_len_set(tx_buf, dma_len1, size); dma_unmap_len_set(tx_buf, dma_len1, size);
} else { } else {
@@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd->txd1 = mapped_addr; txd->txd1 = mapped_addr;
txd->txd2 = TX_DMA_PLEN0(size); txd->txd2 = TX_DMA_PLEN0(size);
dma_unmap_addr_set(tx_buf, dma_addr0, mapped_addr); dma_unmap_addr_set(tx_buf, dma_addr0, mapped_addr);
@@ -1189,7 +1200,7 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1188,7 +1199,7 @@ static int mtk_tx_map(struct sk_buff *sk
soc->txrx.txd_size); soc->txrx.txd_size);
if (new_desc) if (new_desc)
memset(tx_buf, 0, sizeof(*tx_buf)); memset(tx_buf, 0, sizeof(*tx_buf));
@@ -67,7 +67,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
tx_buf->flags |= MTK_TX_FLAGS_PAGE0; tx_buf->flags |= MTK_TX_FLAGS_PAGE0;
tx_buf->flags |= (!mac->id) ? MTK_TX_FLAGS_FPORT0 : tx_buf->flags |= (!mac->id) ? MTK_TX_FLAGS_FPORT0 :
MTK_TX_FLAGS_FPORT1; MTK_TX_FLAGS_FPORT1;
@@ -1203,7 +1214,8 @@ static int mtk_tx_map(struct sk_buff *sk @@ -1202,7 +1213,8 @@ static int mtk_tx_map(struct sk_buff *sk
} }
/* store skb to cleanup */ /* store skb to cleanup */
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) { if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
if (k & 0x1) if (k & 0x1)
@@ -1415,13 +1427,14 @@ static struct page_pool *mtk_create_page @@ -1414,13 +1426,14 @@ static struct page_pool *mtk_create_page
.pool_size = size, .pool_size = size,
.nid = NUMA_NO_NODE, .nid = NUMA_NO_NODE,
.dev = eth->dma_dev, .dev = eth->dma_dev,
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
pp = page_pool_create(&pp_params); pp = page_pool_create(&pp_params);
if (IS_ERR(pp)) if (IS_ERR(pp))
return pp; return pp;
@@ -1467,6 +1480,122 @@ static void mtk_rx_put_buff(struct mtk_r @@ -1466,6 +1479,122 @@ static void mtk_rx_put_buff(struct mtk_r
skb_free_frag(data); 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, static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
struct xdp_buff *xdp, struct net_device *dev) struct xdp_buff *xdp, struct net_device *dev)
{ {
@@ -1495,6 +1624,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e @@ -1494,6 +1623,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e
count = &hw_stats->xdp_stats.rx_xdp_redirect; count = &hw_stats->xdp_stats.rx_xdp_redirect;
goto update_stats; goto update_stats;
@@ -235,7 +235,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default: default:
bpf_warn_invalid_xdp_action(act); bpf_warn_invalid_xdp_action(act);
fallthrough; fallthrough;
@@ -1728,9 +1869,8 @@ static int mtk_poll_tx_qdma(struct mtk_e @@ -1727,9 +1868,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
{ {
const struct mtk_reg_map *reg_map = eth->soc->reg_map; const struct mtk_reg_map *reg_map = eth->soc->reg_map;
struct mtk_tx_ring *ring = &eth->tx_ring; struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -246,7 +246,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 cpu, dma; u32 cpu, dma;
cpu = ring->last_free_ptr; cpu = ring->last_free_ptr;
@@ -1751,15 +1891,21 @@ static int mtk_poll_tx_qdma(struct mtk_e @@ -1750,15 +1890,21 @@ static int mtk_poll_tx_qdma(struct mtk_e
if (tx_buf->flags & MTK_TX_FLAGS_FPORT1) if (tx_buf->flags & MTK_TX_FLAGS_FPORT1)
mac = 1; mac = 1;
@@ -271,7 +271,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_tx_unmap(eth, tx_buf, true); mtk_tx_unmap(eth, tx_buf, true);
ring->last_free = desc; ring->last_free = desc;
@@ -1778,9 +1924,8 @@ static int mtk_poll_tx_pdma(struct mtk_e @@ -1777,9 +1923,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
unsigned int *done, unsigned int *bytes) unsigned int *done, unsigned int *bytes)
{ {
struct mtk_tx_ring *ring = &eth->tx_ring; struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -282,7 +282,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 cpu, dma; u32 cpu, dma;
cpu = ring->cpu_idx; cpu = ring->cpu_idx;
@@ -1788,14 +1933,18 @@ static int mtk_poll_tx_pdma(struct mtk_e @@ -1787,14 +1932,18 @@ static int mtk_poll_tx_pdma(struct mtk_e
while ((cpu != dma) && budget) { while ((cpu != dma) && budget) {
tx_buf = &ring->buf[cpu]; 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); mtk_tx_unmap(eth, tx_buf, true);
@@ -3463,6 +3612,7 @@ static const struct net_device_ops mtk_n @@ -3462,6 +3611,7 @@ static const struct net_device_ops mtk_n
#endif #endif
.ndo_setup_tc = mtk_eth_setup_tc, .ndo_setup_tc = mtk_eth_setup_tc,
.ndo_bpf = mtk_xdp, .ndo_bpf = mtk_xdp,

View File

@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
MediaTek SoC family. MediaTek SoC family.
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3474,11 +3474,18 @@ static void mtk_get_strings(struct net_d @@ -3473,11 +3473,18 @@ static void mtk_get_strings(struct net_d
int i; int i;
switch (stringset) { switch (stringset) {
@@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break; break;
} }
} }
@@ -3486,13 +3493,35 @@ static void mtk_get_strings(struct net_d @@ -3485,13 +3492,35 @@ static void mtk_get_strings(struct net_d
static int mtk_get_sset_count(struct net_device *dev, int sset) static int mtk_get_sset_count(struct net_device *dev, int sset)
{ {
switch (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, static void mtk_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data) struct ethtool_stats *stats, u64 *data)
{ {
@@ -3520,6 +3549,8 @@ static void mtk_get_ethtool_stats(struct @@ -3519,6 +3548,8 @@ static void mtk_get_ethtool_stats(struct
for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++) for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++)
*data_dst++ = *(data_src + mtk_ethtool_stats[i].offset); *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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1480,6 +1480,41 @@ static void mtk_rx_put_buff(struct mtk_r @@ -1479,6 +1479,41 @@ static void mtk_rx_put_buff(struct mtk_r
skb_free_frag(data); 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, static int mtk_xdp_submit_frame(struct mtk_eth *eth, struct xdp_frame *xdpf,
struct net_device *dev, bool dma_map) struct net_device *dev, bool dma_map)
{ {
@@ -1490,9 +1525,8 @@ static int mtk_xdp_submit_frame(struct m @@ -1489,9 +1524,8 @@ static int mtk_xdp_submit_frame(struct m
.first = true, .first = true,
.last = true, .last = true,
}; };
@@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_buf *tx_buf; struct mtk_tx_buf *tx_buf;
if (unlikely(test_bit(MTK_RESETTING, &eth->state))) if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
@@ -1512,36 +1546,18 @@ static int mtk_xdp_submit_frame(struct m @@ -1511,36 +1545,18 @@ static int mtk_xdp_submit_frame(struct m
tx_buf = mtk_desc_to_tx_buf(ring, txd, soc->txrx.txd_size); tx_buf = mtk_desc_to_tx_buf(ring, txd, soc->txrx.txd_size);
memset(tx_buf, 0, sizeof(*tx_buf)); memset(tx_buf, 0, sizeof(*tx_buf));

View File

@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -988,23 +988,22 @@ static void mtk_tx_unmap(struct mtk_eth @@ -987,23 +987,22 @@ static void mtk_tx_unmap(struct mtk_eth
} }
} }
@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} }
tx_buf->flags = 0; tx_buf->flags = 0;
tx_buf->data = NULL; tx_buf->data = NULL;
@@ -1507,6 +1506,8 @@ static int mtk_xdp_frame_map(struct mtk_ @@ -1506,6 +1505,8 @@ static int mtk_xdp_frame_map(struct mtk_
mtk_tx_set_dma_desc(dev, txd, txd_info); mtk_tx_set_dma_desc(dev, txd, txd_info);
tx_buf->flags |= !mac->id ? MTK_TX_FLAGS_FPORT0 : MTK_TX_FLAGS_FPORT1; 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); txd_pdma = qdma_to_pdma(ring, txd);
setup_tx_buf(eth, tx_buf, txd_pdma, txd_info->addr, txd_info->size, setup_tx_buf(eth, tx_buf, txd_pdma, txd_info->addr, txd_info->size,
@@ -1518,43 +1519,69 @@ static int mtk_xdp_frame_map(struct mtk_ @@ -1517,43 +1518,69 @@ static int mtk_xdp_frame_map(struct mtk_
static int mtk_xdp_submit_frame(struct mtk_eth *eth, struct xdp_frame *xdpf, static int mtk_xdp_submit_frame(struct mtk_eth *eth, struct xdp_frame *xdpf,
struct net_device *dev, bool dma_map) 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)) { if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
txd_pdma = qdma_to_pdma(ring, txd); txd_pdma = qdma_to_pdma(ring, txd);
@@ -1581,7 +1608,24 @@ static int mtk_xdp_submit_frame(struct m @@ -1580,7 +1607,24 @@ static int mtk_xdp_submit_frame(struct m
mtk_w32(eth, NEXT_DESP_IDX(idx, ring->dma_size), mtk_w32(eth, NEXT_DESP_IDX(idx, ring->dma_size),
MT7628_TX_CTX_IDX0); MT7628_TX_CTX_IDX0);
} }
@@ -166,7 +166,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock(&eth->page_lock); spin_unlock(&eth->page_lock);
return err; return err;
@@ -1910,18 +1954,15 @@ static int mtk_poll_tx_qdma(struct mtk_e @@ -1909,18 +1953,15 @@ static int mtk_poll_tx_qdma(struct mtk_e
if (!tx_buf->data) if (!tx_buf->data)
break; break;
@@ -191,7 +191,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_tx_unmap(eth, tx_buf, true); mtk_tx_unmap(eth, tx_buf, true);
ring->last_free = desc; ring->last_free = desc;
@@ -1952,17 +1993,15 @@ static int mtk_poll_tx_pdma(struct mtk_e @@ -1951,17 +1992,15 @@ static int mtk_poll_tx_pdma(struct mtk_e
if (!tx_buf->data) if (!tx_buf->data)
break; break;

View File

@@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1846,10 +1846,19 @@ static int mtk_poll_rx(struct napi_struc @@ -1845,10 +1845,19 @@ static int mtk_poll_rx(struct napi_struc
skb->dev = netdev; skb->dev = netdev;
bytes += skb->len; bytes += skb->len;
@@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (*rxdcsum & eth->soc->txrx.rx_dma_l4_valid) if (*rxdcsum & eth->soc->txrx.rx_dma_l4_valid)
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -1857,16 +1866,9 @@ static int mtk_poll_rx(struct napi_struc @@ -1856,16 +1865,9 @@ static int mtk_poll_rx(struct napi_struc
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev); 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1413,7 +1413,7 @@ static void mtk_update_rx_cpu_idx(struct @@ -1412,7 +1412,7 @@ static void mtk_update_rx_cpu_idx(struct
static bool mtk_page_pool_enabled(struct mtk_eth *eth) 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 */ /* strings used by ethtool */
@@ -2928,6 +2932,7 @@ static int mtk_open(struct net_device *d @@ -2927,6 +2931,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 */ /* we run 2 netdevs on the same dma ring so we only bring it up once */
if (!refcount_read(&eth->dma_refcnt)) { 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; u32 gdm_config = MTK_GDMA_TO_PDMA;
int err; int err;
@@ -2937,15 +2942,15 @@ static int mtk_open(struct net_device *d @@ -2936,15 +2941,15 @@ static int mtk_open(struct net_device *d
return err; return err;
} }
@@ -84,7 +84,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
refcount_set(&eth->dma_refcnt, 1); refcount_set(&eth->dma_refcnt, 1);
} }
else else
@@ -4044,7 +4049,9 @@ static int mtk_probe(struct platform_dev @@ -4043,7 +4048,9 @@ static int mtk_probe(struct platform_dev
} }
if (eth->soc->offload_version) { 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4147,6 +4147,7 @@ static const struct mtk_soc_data mt7621_ @@ -4146,6 +4146,7 @@ static const struct mtk_soc_data mt7621_
.required_clks = MT7621_CLKS_BITMAP, .required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false, .required_pctl = false,
.offload_version = 2, .offload_version = 2,
@@ -52,7 +52,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -4165,6 +4166,7 @@ static const struct mtk_soc_data mt7622_ @@ -4164,6 +4165,7 @@ static const struct mtk_soc_data mt7622_
.required_clks = MT7622_CLKS_BITMAP, .required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false, .required_pctl = false,
.offload_version = 2, .offload_version = 2,
@@ -60,7 +60,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -4182,6 +4184,7 @@ static const struct mtk_soc_data mt7623_ @@ -4181,6 +4183,7 @@ static const struct mtk_soc_data mt7623_
.required_clks = MT7623_CLKS_BITMAP, .required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true, .required_pctl = true,
.offload_version = 2, .offload_version = 2,
@@ -68,7 +68,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -4215,6 +4218,7 @@ static const struct mtk_soc_data mt7986_ @@ -4214,6 +4217,7 @@ static const struct mtk_soc_data mt7986_
.caps = MT7986_CAPS, .caps = MT7986_CAPS,
.required_clks = MT7986_CLKS_BITMAP, .required_clks = MT7986_CLKS_BITMAP,
.required_pctl = false, .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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1872,7 +1872,7 @@ static int mtk_poll_rx(struct napi_struc @@ -1871,7 +1871,7 @@ static int mtk_poll_rx(struct napi_struc
reason = FIELD_GET(MTK_RXD4_PPE_CPU_REASON, trxd.rxd4); reason = FIELD_GET(MTK_RXD4_PPE_CPU_REASON, trxd.rxd4);
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) 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 (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
@@ -2933,7 +2933,8 @@ static int mtk_open(struct net_device *d @@ -2932,7 +2932,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 */ /* we run 2 netdevs on the same dma ring so we only bring it up once */
if (!refcount_read(&eth->dma_refcnt)) { if (!refcount_read(&eth->dma_refcnt)) {
const struct mtk_soc_data *soc = eth->soc; const struct mtk_soc_data *soc = eth->soc;
@@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
int err; int err;
err = mtk_start_dma(eth); err = mtk_start_dma(eth);
@@ -2942,8 +2943,11 @@ static int mtk_open(struct net_device *d @@ -2941,8 +2942,11 @@ static int mtk_open(struct net_device *d
return err; return err;
} }
@@ -81,7 +81,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
mtk_gdm_config(eth, gdm_config); mtk_gdm_config(eth, gdm_config);
@@ -2988,6 +2992,7 @@ static int mtk_stop(struct net_device *d @@ -2987,6 +2991,7 @@ static int mtk_stop(struct net_device *d
{ {
struct mtk_mac *mac = netdev_priv(dev); struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw; struct mtk_eth *eth = mac->hw;
@@ -89,7 +89,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
phylink_stop(mac->phylink); phylink_stop(mac->phylink);
@@ -3015,8 +3020,8 @@ static int mtk_stop(struct net_device *d @@ -3014,8 +3019,8 @@ static int mtk_stop(struct net_device *d
mtk_dma_free(eth); mtk_dma_free(eth);
@@ -100,7 +100,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
return 0; return 0;
} }
@@ -4049,12 +4054,19 @@ static int mtk_probe(struct platform_dev @@ -4048,12 +4053,19 @@ static int mtk_probe(struct platform_dev
} }
if (eth->soc->offload_version) { if (eth->soc->offload_version) {

View File

@@ -39,7 +39,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
}; };
/* strings used by ethtool */ /* strings used by ethtool */
@@ -3966,16 +3974,12 @@ static int mtk_probe(struct platform_dev @@ -3965,16 +3973,12 @@ static int mtk_probe(struct platform_dev
for (i = 0;; i++) { for (i = 0;; i++) {
struct device_node *np = of_parse_phandle(pdev->dev.of_node, struct device_node *np = of_parse_phandle(pdev->dev.of_node,
"mediatek,wed", i); "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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4164,6 +4164,7 @@ static const struct mtk_soc_data mt7621_ @@ -4163,6 +4163,7 @@ static const struct mtk_soc_data mt7621_
.required_pctl = false, .required_pctl = false,
.offload_version = 2, .offload_version = 2,
.hash_offset = 2, .hash_offset = 2,
@@ -29,7 +29,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -4183,6 +4184,7 @@ static const struct mtk_soc_data mt7622_ @@ -4182,6 +4183,7 @@ static const struct mtk_soc_data mt7622_
.required_pctl = false, .required_pctl = false,
.offload_version = 2, .offload_version = 2,
.hash_offset = 2, .hash_offset = 2,
@@ -37,7 +37,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -4201,6 +4203,7 @@ static const struct mtk_soc_data mt7623_ @@ -4200,6 +4202,7 @@ static const struct mtk_soc_data mt7623_
.required_pctl = true, .required_pctl = true,
.offload_version = 2, .offload_version = 2,
.hash_offset = 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3891,6 +3891,7 @@ void mtk_eth_set_dma_device(struct mtk_e @@ -3890,6 +3890,7 @@ void mtk_eth_set_dma_device(struct mtk_e
static int mtk_probe(struct platform_device *pdev) 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 device_node *mac_np;
struct mtk_eth *eth; struct mtk_eth *eth;
int err, i; int err, i;
@@ -3971,16 +3972,31 @@ static int mtk_probe(struct platform_dev @@ -3970,16 +3971,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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1859,12 +1859,14 @@ static int mtk_poll_rx(struct napi_struc @@ -1858,12 +1858,14 @@ static int mtk_poll_rx(struct napi_struc
bytes += skb->len; bytes += skb->len;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { 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; hash = trxd.rxd4 & MTK_RXD4_FOE_ENTRY;
if (hash != MTK_RXD4_FOE_ENTRY) if (hash != MTK_RXD4_FOE_ENTRY)
skb_set_hash(skb, jhash_1word(hash, 0), skb_set_hash(skb, jhash_1word(hash, 0),
@@ -1878,7 +1880,6 @@ static int mtk_poll_rx(struct napi_struc @@ -1877,7 +1879,6 @@ static int mtk_poll_rx(struct napi_struc
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev); 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) if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
mtk_ppe_check_skb(eth->ppe[0], skb, hash); mtk_ppe_check_skb(eth->ppe[0], skb, hash);
@@ -4180,7 +4181,7 @@ static const struct mtk_soc_data mt7621_ @@ -4179,7 +4180,7 @@ static const struct mtk_soc_data mt7621_
.required_pctl = false, .required_pctl = false,
.offload_version = 2, .offload_version = 2,
.hash_offset = 2, .hash_offset = 2,
@@ -58,7 +58,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -4200,7 +4201,7 @@ static const struct mtk_soc_data mt7622_ @@ -4199,7 +4200,7 @@ static const struct mtk_soc_data mt7622_
.required_pctl = false, .required_pctl = false,
.offload_version = 2, .offload_version = 2,
.hash_offset = 2, .hash_offset = 2,
@@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -4219,7 +4220,7 @@ static const struct mtk_soc_data mt7623_ @@ -4218,7 +4219,7 @@ static const struct mtk_soc_data mt7623_
.required_pctl = true, .required_pctl = true,
.offload_version = 2, .offload_version = 2,
.hash_offset = 2, .hash_offset = 2,
@@ -76,7 +76,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = { .txrx = {
.txd_size = sizeof(struct mtk_tx_dma), .txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma), .rxd_size = sizeof(struct mtk_rx_dma),
@@ -4251,9 +4252,11 @@ static const struct mtk_soc_data mt7986_ @@ -4250,9 +4251,11 @@ static const struct mtk_soc_data mt7986_
.reg_map = &mt7986_reg_map, .reg_map = &mt7986_reg_map,
.ana_rgc3 = 0x128, .ana_rgc3 = 0x128,
.caps = MT7986_CAPS, .caps = MT7986_CAPS,
@@ -576,7 +576,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
entry->hash = 0xffff; entry->hash = 0xffff;
continue; continue;
@@ -771,6 +805,8 @@ void mtk_ppe_start(struct mtk_ppe *ppe) @@ -771,6 +805,8 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
MTK_PPE_SCAN_MODE_KEEPALIVE_AGE) | MTK_PPE_SCAN_MODE_CHECK_AGE) |
FIELD_PREP(MTK_PPE_TB_CFG_ENTRY_NUM, FIELD_PREP(MTK_PPE_TB_CFG_ENTRY_NUM,
MTK_PPE_ENTRIES_SHIFT); MTK_PPE_ENTRIES_SHIFT);
+ if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2)) + if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2))

View File

@@ -16,7 +16,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4255,6 +4255,7 @@ static const struct mtk_soc_data mt7986_ @@ -4254,6 +4254,7 @@ static const struct mtk_soc_data mt7986_
.hw_features = MTK_HW_FEATURES, .hw_features = MTK_HW_FEATURES,
.required_clks = MT7986_CLKS_BITMAP, .required_clks = MT7986_CLKS_BITMAP,
.required_pctl = false, .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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4007,19 +4007,23 @@ static int mtk_probe(struct platform_dev @@ -4006,19 +4006,23 @@ static int mtk_probe(struct platform_dev
eth->irq[i] = platform_get_irq(pdev, i); eth->irq[i] = platform_get_irq(pdev, i);
if (eth->irq[i] < 0) { if (eth->irq[i] < 0) {
dev_err(&pdev->dev, "no IRQ%d resource found\n", i); 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; eth->clks[i] = NULL;
} }
@@ -4030,7 +4034,7 @@ static int mtk_probe(struct platform_dev @@ -4029,7 +4033,7 @@ static int mtk_probe(struct platform_dev
err = mtk_hw_init(eth); err = mtk_hw_init(eth);
if (err) 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); eth->hwlro = MTK_HAS_CAPS(eth->soc->caps, MTK_HWLRO);
@@ -4128,6 +4132,8 @@ err_free_dev: @@ -4127,6 +4131,8 @@ err_free_dev:
mtk_free_dev(eth); mtk_free_dev(eth);
err_deinit_hw: err_deinit_hw:
mtk_hw_deinit(eth); mtk_hw_deinit(eth);
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return err; return err;
} }
@@ -4147,6 +4153,7 @@ static int mtk_remove(struct platform_de @@ -4146,6 +4152,7 @@ static int mtk_remove(struct platform_de
phylink_disconnect_phy(mac->phylink); 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4090,13 +4090,13 @@ static int mtk_probe(struct platform_dev @@ -4089,13 +4089,13 @@ static int mtk_probe(struct platform_dev
eth->soc->offload_version, i); eth->soc->offload_version, i);
if (!eth->ppe[i]) { if (!eth->ppe[i]) {
err = -ENOMEM; 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4090,13 +4090,13 @@ static int mtk_probe(struct platform_dev @@ -4089,13 +4089,13 @@ static int mtk_probe(struct platform_dev
eth->soc->offload_version, i); eth->soc->offload_version, i);
if (!eth->ppe[i]) { if (!eth->ppe[i]) {
err = -ENOMEM; err = -ENOMEM;
@@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
} }
for (i = 0; i < MTK_MAX_DEVS; i++) { for (i = 0; i < MTK_MAX_DEVS; i++) {
@@ -4106,7 +4106,7 @@ static int mtk_probe(struct platform_dev @@ -4105,7 +4105,7 @@ static int mtk_probe(struct platform_dev
err = register_netdev(eth->netdev[i]); err = register_netdev(eth->netdev[i]);
if (err) { if (err) {
dev_err(eth->dev, "error bringing up device\n"); dev_err(eth->dev, "error bringing up device\n");
@@ -46,7 +46,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
} else } else
netif_info(eth, probe, eth->netdev[i], netif_info(eth, probe, eth->netdev[i],
"mediatek frame engine at 0x%08lx, irq %d\n", "mediatek frame engine at 0x%08lx, irq %d\n",
@@ -4126,7 +4126,8 @@ static int mtk_probe(struct platform_dev @@ -4125,7 +4125,8 @@ static int mtk_probe(struct platform_dev
return 0; 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3179,6 +3179,30 @@ static void mtk_dim_tx(struct work_struc @@ -3178,6 +3178,30 @@ static void mtk_dim_tx(struct work_struc
dim->state = DIM_START_MEASURE; 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) static int mtk_hw_init(struct mtk_eth *eth)
{ {
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
@@ -3253,8 +3277,16 @@ static int mtk_hw_init(struct mtk_eth *e @@ -3252,8 +3276,16 @@ static int mtk_hw_init(struct mtk_eth *e
* up with the more appropriate value when mtk_mac_config call is being * up with the more appropriate value when mtk_mac_config call is being
* invoked. * invoked.
*/ */
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Indicates CDM to parse the MTK special tag from CPU /* Indicates CDM to parse the MTK special tag from CPU
* which also is working out for untag packets. * which also is working out for untag packets.
@@ -3353,7 +3385,6 @@ static int mtk_change_mtu(struct net_dev @@ -3352,7 +3384,6 @@ static int mtk_change_mtu(struct net_dev
int length = new_mtu + MTK_RX_ETH_HLEN; int length = new_mtu + MTK_RX_ETH_HLEN;
struct mtk_mac *mac = netdev_priv(dev); struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw; 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) && if (rcu_access_pointer(eth->prog) &&
length > MTK_PP_MAX_BUF_SIZE) { length > MTK_PP_MAX_BUF_SIZE) {
@@ -3361,23 +3392,7 @@ static int mtk_change_mtu(struct net_dev @@ -3360,23 +3391,7 @@ static int mtk_change_mtu(struct net_dev
return -EINVAL; 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3423,11 +3423,8 @@ static void mtk_pending_work(struct work @@ -3422,11 +3422,8 @@ static void mtk_pending_work(struct work
rtnl_lock(); rtnl_lock();
dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__); 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 */ /* stop all devices to make sure that dma is properly shut down */
for (i = 0; i < MTK_MAC_COUNT; i++) { for (i = 0; i < MTK_MAC_COUNT; i++) {
if (!eth->netdev[i]) if (!eth->netdev[i])
@@ -3461,7 +3458,7 @@ static void mtk_pending_work(struct work @@ -3460,7 +3457,7 @@ static void mtk_pending_work(struct work
dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__); 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3242,16 +3242,17 @@ static int mtk_hw_init(struct mtk_eth *e @@ -3241,16 +3241,17 @@ static int mtk_hw_init(struct mtk_eth *e
return 0; 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3203,6 +3203,27 @@ static void mtk_set_mcr_max_rx(struct mt @@ -3202,6 +3202,27 @@ static void mtk_set_mcr_max_rx(struct mt
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id)); 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) static int mtk_hw_init(struct mtk_eth *eth)
{ {
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
@@ -3242,22 +3263,9 @@ static int mtk_hw_init(struct mtk_eth *e @@ -3241,22 +3262,9 @@ static int mtk_hw_init(struct mtk_eth *e
return 0; 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3224,7 +3224,54 @@ static void mtk_hw_reset(struct mtk_eth @@ -3223,7 +3223,54 @@ static void mtk_hw_reset(struct mtk_eth
0x3ffffff); 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 | u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
ETHSYS_DMA_AG_MAP_PPE; ETHSYS_DMA_AG_MAP_PPE;
@@ -3263,7 +3310,12 @@ static int mtk_hw_init(struct mtk_eth *e @@ -3262,7 +3309,12 @@ static int mtk_hw_init(struct mtk_eth *e
return 0; return 0;
} }
@@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
/* Set FE to PDMAv2 if necessary */ /* Set FE to PDMAv2 if necessary */
@@ -3451,7 +3503,7 @@ static void mtk_pending_work(struct work @@ -3450,7 +3502,7 @@ static void mtk_pending_work(struct work
if (eth->dev->pins) if (eth->dev->pins)
pinctrl_select_state(eth->dev->pins->p, pinctrl_select_state(eth->dev->pins->p,
eth->dev->pins->default_state); eth->dev->pins->default_state);
@@ -96,7 +96,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* restart DMA and enable IRQs */ /* restart DMA and enable IRQs */
for (i = 0; i < MTK_MAC_COUNT; i++) { for (i = 0; i < MTK_MAC_COUNT; i++) {
@@ -4053,7 +4105,7 @@ static int mtk_probe(struct platform_dev @@ -4052,7 +4104,7 @@ static int mtk_probe(struct platform_dev
eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE); eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE);
INIT_WORK(&eth->pending_work, mtk_pending_work); 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2789,14 +2789,29 @@ static void mtk_dma_free(struct mtk_eth @@ -2788,14 +2788,29 @@ static void mtk_dma_free(struct mtk_eth
kfree(eth->scratch_head); kfree(eth->scratch_head);
} }
@@ -48,7 +48,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
schedule_work(&eth->pending_work); schedule_work(&eth->pending_work);
} }
@@ -3278,15 +3293,17 @@ static int mtk_hw_init(struct mtk_eth *e @@ -3277,15 +3292,17 @@ static int mtk_hw_init(struct mtk_eth *e
const struct mtk_reg_map *reg_map = eth->soc->reg_map; const struct mtk_reg_map *reg_map = eth->soc->reg_map;
int i, val, ret; int i, val, ret;
@@ -72,7 +72,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (eth->ethsys) if (eth->ethsys)
regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, dma_mask, regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, dma_mask,
@@ -3412,8 +3429,10 @@ static int mtk_hw_init(struct mtk_eth *e @@ -3411,8 +3428,10 @@ static int mtk_hw_init(struct mtk_eth *e
return 0; return 0;
err_disable_pm: err_disable_pm:
@@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return ret; return ret;
} }
@@ -3475,30 +3494,53 @@ static int mtk_do_ioctl(struct net_devic @@ -3474,30 +3493,53 @@ static int mtk_do_ioctl(struct net_devic
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
@@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (eth->dev->pins) if (eth->dev->pins)
pinctrl_select_state(eth->dev->pins->p, pinctrl_select_state(eth->dev->pins->p,
@@ -3509,15 +3551,19 @@ static void mtk_pending_work(struct work @@ -3508,15 +3550,19 @@ static void mtk_pending_work(struct work
for (i = 0; i < MTK_MAC_COUNT; i++) { for (i = 0; i < MTK_MAC_COUNT; i++) {
if (!test_bit(i, &restart)) if (!test_bit(i, &restart))
continue; continue;

View File

@@ -49,7 +49,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}; };
/* strings used by ethtool */ /* strings used by ethtool */
@@ -3286,6 +3292,102 @@ static void mtk_hw_warm_reset(struct mtk @@ -3285,6 +3291,102 @@ static void mtk_hw_warm_reset(struct mtk
val, rst_mask); 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) static int mtk_hw_init(struct mtk_eth *eth, bool reset)
{ {
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
@@ -3601,6 +3703,7 @@ static int mtk_cleanup(struct mtk_eth *e @@ -3600,6 +3702,7 @@ static int mtk_cleanup(struct mtk_eth *e
mtk_unreg_dev(eth); mtk_unreg_dev(eth);
mtk_free_dev(eth); mtk_free_dev(eth);
cancel_work_sync(&eth->pending_work); cancel_work_sync(&eth->pending_work);
@@ -160,7 +160,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return 0; return 0;
} }
@@ -4038,6 +4141,7 @@ static int mtk_probe(struct platform_dev @@ -4037,6 +4140,7 @@ static int mtk_probe(struct platform_dev
eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE; eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
INIT_WORK(&eth->rx_dim.work, mtk_dim_rx); 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; eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
INIT_WORK(&eth->tx_dim.work, mtk_dim_tx); INIT_WORK(&eth->tx_dim.work, mtk_dim_tx);
@@ -4242,6 +4346,8 @@ static int mtk_probe(struct platform_dev @@ -4241,6 +4345,8 @@ static int mtk_probe(struct platform_dev
NAPI_POLL_WEIGHT); NAPI_POLL_WEIGHT);
platform_set_drvdata(pdev, eth); 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 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3632,6 +3632,11 @@ static void mtk_pending_work(struct work @@ -3631,6 +3631,11 @@ static void mtk_pending_work(struct work
set_bit(MTK_RESETTING, &eth->state); set_bit(MTK_RESETTING, &eth->state);
mtk_prepare_for_reset(eth); 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 */ /* stop all devices to make sure that dma is properly shut down */
for (i = 0; i < MTK_MAC_COUNT; i++) { for (i = 0; i < MTK_MAC_COUNT; i++) {
@@ -3669,6 +3674,8 @@ static void mtk_pending_work(struct work @@ -3668,6 +3673,8 @@ static void mtk_pending_work(struct work
clear_bit(MTK_RESETTING, &eth->state); clear_bit(MTK_RESETTING, &eth->state);

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