Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
9a28409897
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.1 = .82
|
||||
LINUX_KERNEL_HASH-6.1.82 = d150d2d9d416877668d8b56f75759f166168d192419eefaa942ed67225cbec06
|
||||
LINUX_VERSION-6.1 = .86
|
||||
LINUX_KERNEL_HASH-6.1.86 = d3d3c8c44f0f0a870a95bd2823f9d91979d1aa6f266da5d8cccd0c4b15e3115b
|
||||
|
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.6 = .25
|
||||
LINUX_KERNEL_HASH-6.6.25 = 99d210be87908233a55b0fadc0dccd3b95926c0651b6b82e37350b2029de1f44
|
||||
LINUX_VERSION-6.6 = .27
|
||||
LINUX_KERNEL_HASH-6.6.27 = 639e50060e3c8f23ed017cb10cfeacc6ba88ff5583812bb76859b4cc6a128291
|
||||
|
@ -0,0 +1,24 @@
|
||||
From 1338da257f299d35b4d954b9fda2cc7e0a54a69d Mon Sep 17 00:00:00 2001
|
||||
From: Christian Lamparter <chunkeey@gmail.com>
|
||||
Date: Sun, 11 Jun 2023 14:37:32 +0200
|
||||
Subject: [PATCH] wifi: ath11k: add support DT ieee80211-freq-limit
|
||||
|
||||
The common DT property can be used to limit the available
|
||||
channels/frequencies. But ath11k has to manually call
|
||||
wiphy_read_of_freq_limits().
|
||||
|
||||
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -9455,6 +9455,7 @@ static int __ath11k_mac_register(struct
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
+ wiphy_read_of_freq_limits(ar->hw->wiphy);
|
||||
ath11k_mac_setup_ht_vht_cap(ar, cap, &ht_cap);
|
||||
ath11k_mac_setup_he_cap(ar, cap);
|
||||
|
@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/mesh.h
|
||||
+++ b/net/mac80211/mesh.h
|
||||
@@ -134,9 +134,33 @@ struct mesh_path {
|
||||
@@ -134,9 +134,38 @@ struct mesh_path {
|
||||
#define MESH_FAST_TX_CACHE_TIMEOUT 8000 /* msecs */
|
||||
|
||||
/**
|
||||
@ -47,13 +47,18 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+ * @MESH_FAST_TX_TYPE_LOCAL: tx from the local vif address as SA
|
||||
+ * @MESH_FAST_TX_TYPE_PROXIED: local tx with a different SA (e.g. bridged)
|
||||
+ * @MESH_FAST_TX_TYPE_FORWARDED: forwarded from a different mesh point
|
||||
+ * @NUM_MESH_FAST_TX_TYPE: number of entry types
|
||||
+ */
|
||||
+enum ieee80211_mesh_fast_tx_type {
|
||||
+ MESH_FAST_TX_TYPE_LOCAL,
|
||||
+ MESH_FAST_TX_TYPE_PROXIED,
|
||||
+ MESH_FAST_TX_TYPE_FORWARDED,
|
||||
+
|
||||
+ /* must be last */
|
||||
+ NUM_MESH_FAST_TX_TYPE
|
||||
+};
|
||||
+
|
||||
+
|
||||
+/**
|
||||
+ * struct ieee80211_mesh_fast_tx_key - cached mesh fast tx entry key
|
||||
+ *
|
||||
@ -62,7 +67,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+ */
|
||||
+struct ieee80211_mesh_fast_tx_key {
|
||||
+ u8 addr[ETH_ALEN] __aligned(2);
|
||||
+ enum ieee80211_mesh_fast_tx_type type;
|
||||
+ u16 type;
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
@ -73,7 +78,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
* @fast_tx: base fast_tx data
|
||||
* @hdr: cached mesh and rfc1042 headers
|
||||
* @hdrlen: length of mesh + rfc1042
|
||||
@@ -147,7 +171,7 @@ struct mesh_path {
|
||||
@@ -147,7 +176,7 @@ struct mesh_path {
|
||||
*/
|
||||
struct ieee80211_mesh_fast_tx {
|
||||
struct rhash_head rhash;
|
||||
@ -82,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
struct ieee80211_fast_tx fast_tx;
|
||||
u8 hdr[sizeof(struct ieee80211s_hdr) + sizeof(rfc1042_header)];
|
||||
@@ -333,7 +357,8 @@ void mesh_path_tx_root_frame(struct ieee
|
||||
@@ -333,7 +362,8 @@ void mesh_path_tx_root_frame(struct ieee
|
||||
|
||||
bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt);
|
||||
struct ieee80211_mesh_fast_tx *
|
||||
@ -178,7 +183,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
- entry = rhashtable_lookup_fast(&cache->rht, addr, fast_tx_rht_params);
|
||||
- if (entry)
|
||||
- mesh_fast_tx_entry_free(cache, entry);
|
||||
+ for (i = MESH_FAST_TX_TYPE_LOCAL; i < MESH_FAST_TX_TYPE_FORWARDED; i++) {
|
||||
+ for (i = 0; i < NUM_MESH_FAST_TX_TYPE; i++) {
|
||||
+ key.type = i;
|
||||
+ entry = rhashtable_lookup_fast(&cache->rht, &key, fast_tx_rht_params);
|
||||
+ if (entry)
|
||||
|
@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/sta_info.c
|
||||
+++ b/net/mac80211/sta_info.c
|
||||
@@ -914,6 +914,7 @@ static int sta_info_insert_finish(struct
|
||||
@@ -918,6 +918,7 @@ static int sta_info_insert_finish(struct
|
||||
|
||||
if (ieee80211_vif_is_mesh(&sdata->vif))
|
||||
mesh_accept_plinks_update(sdata);
|
||||
|
@ -7,12 +7,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=elfutils
|
||||
PKG_VERSION:=0.189
|
||||
PKG_VERSION:=0.191
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
|
||||
PKG_HASH:=39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8
|
||||
PKG_HASH:=df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871
|
||||
|
||||
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
|
@ -7,5 +7,5 @@
|
||||
- libasm debuginfod src po doc tests
|
||||
+ libasm
|
||||
|
||||
EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
|
||||
EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING SECURITY \
|
||||
COPYING COPYING-GPLV2 COPYING-LGPLV3
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 Tony Ambardar <itugrok@yahoo.com>
|
||||
# Copyright (C) 2020-2024 Tony Ambardar <itugrok@yahoo.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@ -8,19 +8,19 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbpf
|
||||
PKG_VERSION:=1.3.0
|
||||
PKG_VERSION:=1.4.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/libbpf/libbpf
|
||||
PKG_MIRROR_HASH:=669d8db696f86f640f86edc358bffa2af8dda656b8e787b095de3578bd8d94ff
|
||||
PKG_MIRROR_HASH:=4c37636699c604de345937bdbdf8f2e6ce69cbf768a4aa669c32b542e5302de6
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=v1.3.0
|
||||
PKG_SOURCE_VERSION:=v1.4.0
|
||||
PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
|
||||
|
||||
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
|
||||
PKG_CPE_ID:=cpe:/a:libbpf_project:libbpf
|
||||
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
PKG_BUILD_FLAGS:=no-mips16 no-gc-sections no-lto
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@ -41,10 +41,6 @@ define Package/libbpf/description
|
||||
libbpf is a library for loading eBPF programs and reading and manipulating eBPF objects from user-space.
|
||||
endef
|
||||
|
||||
MAKE_VARS = \
|
||||
EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
MAKE_FLAGS += \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
|
||||
LIBSUBDIR=lib
|
||||
|
@ -1,10 +0,0 @@
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -34,6 +34,7 @@ ALL_CFLAGS := $(INCLUDES)
|
||||
|
||||
SHARED_CFLAGS += -fPIC -fvisibility=hidden -DSHARED
|
||||
|
||||
+CFLAGS = $(EXTRA_CFLAGS)
|
||||
CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89
|
||||
ALL_CFLAGS += $(CFLAGS) \
|
||||
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
|
@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/cmake.mk
|
||||
define Package/netifd
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox +libudebug
|
||||
DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox +libudebug +ucode +ucode-mod-fs
|
||||
TITLE:=OpenWrt Network Interface Configuration Daemon
|
||||
endef
|
||||
|
||||
|
@ -14,5 +14,10 @@ service_triggers() {
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
/usr/libexec/network/packet-steering.sh
|
||||
packet_steering="$(uci get "network.@globals[0].packet_steering")"
|
||||
if [ -e "/usr/libexec/platform/packet-steering.sh" ]; then
|
||||
/usr/libexec/platform/packet-steering.sh "$packet_steering"
|
||||
else
|
||||
/usr/libexec/network/packet-steering.uc "$packet_steering"
|
||||
fi
|
||||
}
|
||||
|
@ -1,70 +0,0 @@
|
||||
#!/bin/sh
|
||||
NPROCS="$(grep -c "^processor.*:" /proc/cpuinfo)"
|
||||
[ "$NPROCS" -gt 1 ] || exit
|
||||
|
||||
PROC_MASK="$(( (1 << $NPROCS) - 1 ))"
|
||||
|
||||
find_irq_cpu() {
|
||||
local dev="$1"
|
||||
local match="$(grep -m 1 "$dev\$" /proc/interrupts)"
|
||||
local cpu=0
|
||||
|
||||
[ -n "$match" ] && {
|
||||
set -- $match
|
||||
shift
|
||||
for cur in $(seq 1 $NPROCS); do
|
||||
[ "$1" -gt 0 ] && {
|
||||
cpu=$(($cur - 1))
|
||||
break
|
||||
}
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
echo "$cpu"
|
||||
}
|
||||
|
||||
set_hex_val() {
|
||||
local file="$1"
|
||||
local val="$2"
|
||||
val="$(printf %x "$val")"
|
||||
[ -n "$DEBUG" ] && echo "$file = $val"
|
||||
echo "$val" > "$file"
|
||||
}
|
||||
|
||||
packet_steering="$(uci -q get "network.@globals[0].packet_steering")"
|
||||
[ "$packet_steering" != 1 ] && exit 0
|
||||
|
||||
exec 512>/var/lock/smp_tune.lock
|
||||
flock 512 || exit 1
|
||||
|
||||
[ -e "/usr/libexec/platform/packet-steering.sh" ] && {
|
||||
/usr/libexec/platform/packet-steering.sh
|
||||
exit 0
|
||||
}
|
||||
|
||||
for dev in /sys/class/net/*; do
|
||||
[ -d "$dev" ] || continue
|
||||
|
||||
# ignore virtual interfaces
|
||||
[ -n "$(ls "${dev}/" | grep '^lower_')" ] && continue
|
||||
[ -d "${dev}/device" ] || continue
|
||||
|
||||
device="$(readlink "${dev}/device")"
|
||||
device="$(basename "$device")"
|
||||
irq_cpu="$(find_irq_cpu "$device")"
|
||||
irq_cpu_mask="$((1 << $irq_cpu))"
|
||||
|
||||
for q in ${dev}/queues/tx-*; do
|
||||
set_hex_val "$q/xps_cpus" "$PROC_MASK"
|
||||
done
|
||||
|
||||
# ignore dsa slave ports for RPS
|
||||
subsys="$(readlink "${dev}/device/subsystem")"
|
||||
subsys="$(basename "$subsys")"
|
||||
[ "$subsys" = "mdio_bus" ] && continue
|
||||
|
||||
for q in ${dev}/queues/rx-*; do
|
||||
set_hex_val "$q/rps_cpus" "$PROC_MASK"
|
||||
done
|
||||
done
|
205
package/network/config/netifd/files/usr/libexec/network/packet-steering.uc
Executable file
205
package/network/config/netifd/files/usr/libexec/network/packet-steering.uc
Executable file
@ -0,0 +1,205 @@
|
||||
#!/usr/bin/env ucode
|
||||
'use strict';
|
||||
import { glob, basename, dirname, readlink, readfile, realpath, writefile, error, open } from "fs";
|
||||
|
||||
let napi_weight = 1.0;
|
||||
let cpu_thread_weight = 0.75;
|
||||
let rx_weight = 0.75;
|
||||
let eth_bias = 2.0;
|
||||
let debug = 0, do_nothing = 0;
|
||||
let disable;
|
||||
let cpus;
|
||||
|
||||
for (let arg in ARGV) {
|
||||
switch (arg) {
|
||||
case "-d":
|
||||
debug++;
|
||||
break;
|
||||
case "-n":
|
||||
do_nothing++;
|
||||
break;
|
||||
case '0':
|
||||
disable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function task_name(pid)
|
||||
{
|
||||
let stat = open(`/proc/${pid}/status`, "r");
|
||||
if (!stat)
|
||||
return;
|
||||
let line = stat.read("line");
|
||||
stat.close();
|
||||
return trim(split(line, "\t", 2)[1]);
|
||||
}
|
||||
|
||||
function set_task_cpu(pid, cpu) {
|
||||
if (disable)
|
||||
cpu = join(",", map(cpus, (cpu) => cpu.id));
|
||||
let name = task_name(pid);
|
||||
if (!name)
|
||||
return;
|
||||
if (debug || do_nothing)
|
||||
warn(`taskset -p -c ${cpu} ${name}\n`);
|
||||
if (!do_nothing)
|
||||
system(`taskset -p -c ${cpu} ${pid}`);
|
||||
}
|
||||
|
||||
function set_netdev_cpu(dev, cpu) {
|
||||
let queues = glob(`/sys/class/net/${dev}/queues/rx-*/rps_cpus`);
|
||||
let val = sprintf("%x", (1 << int(cpu)));
|
||||
if (disable)
|
||||
val = 0;
|
||||
for (let queue in queues) {
|
||||
if (debug || do_nothing)
|
||||
warn(`echo ${val} > ${queue}\n`);
|
||||
if (!do_nothing)
|
||||
writefile(queue, `${val}`);
|
||||
}
|
||||
}
|
||||
|
||||
function task_device_match(name, device)
|
||||
{
|
||||
let napi_match = match(name, /napi\/([^-+])-\d+/);
|
||||
if (!napi_match)
|
||||
napi_match = match(name, /mt76-tx (phy\d+)/);
|
||||
if (napi_match &&
|
||||
(index(device.phy, napi_match[1]) >= 0 ||
|
||||
index(device.netdev, napi_match[1]) >= 0))
|
||||
return true;
|
||||
|
||||
if (device.driver == "mtk_soc_eth" && match(name, /napi\/mtk_eth-/))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
cpus = map(glob("/sys/bus/cpu/devices/*"), (path) => {
|
||||
return {
|
||||
id: int(match(path, /.*cpu(\d+)/)[1]),
|
||||
core: int(trim(readfile(`${path}/topology/core_id`))),
|
||||
load: 0.0,
|
||||
};
|
||||
});
|
||||
|
||||
cpus = slice(cpus, 0, 64);
|
||||
if (length(cpus) < 2)
|
||||
exit(0);
|
||||
|
||||
function cpu_add_weight(cpu_id, weight)
|
||||
{
|
||||
let cpu = cpus[cpu_id];
|
||||
cpu.load += weight;
|
||||
for (let sibling in cpus) {
|
||||
if (sibling == cpu || sibling.core != cpu.core)
|
||||
continue;
|
||||
sibling.load += weight * cpu_thread_weight;
|
||||
}
|
||||
}
|
||||
|
||||
function get_next_cpu(weight, prev_cpu)
|
||||
{
|
||||
if (disable)
|
||||
return 0;
|
||||
|
||||
let sort_cpus = sort(slice(cpus), (a, b) => a.load - b.load);
|
||||
let idx = 0;
|
||||
|
||||
if (prev_cpu != null && sort_cpus[idx].id == prev_cpu)
|
||||
idx++;
|
||||
|
||||
let cpu = sort_cpus[idx].id;
|
||||
cpu_add_weight(cpu, weight);
|
||||
return cpu;
|
||||
}
|
||||
|
||||
let phys_devs = {};
|
||||
let netdev_phys = {};
|
||||
let netdevs = map(glob("/sys/class/net/*"), (dev) => basename(dev));
|
||||
|
||||
for (let dev in netdevs) {
|
||||
let pdev_path = realpath(`/sys/class/net/${dev}/device`);
|
||||
if (!pdev_path)
|
||||
continue;
|
||||
|
||||
if (length(glob(`/sys/class/net/${dev}/lower_*`)) > 0)
|
||||
continue;
|
||||
|
||||
let pdev = phys_devs[pdev_path];
|
||||
if (!pdev) {
|
||||
pdev = phys_devs[pdev_path] = {
|
||||
path: pdev_path,
|
||||
driver: basename(readlink(`${pdev_path}/driver`)),
|
||||
netdev: [],
|
||||
phy: [],
|
||||
tasks: [],
|
||||
};
|
||||
}
|
||||
|
||||
let phyidx = trim(readfile(`/sys/class/net/${dev}/phy80211/index`));
|
||||
if (phyidx != null) {
|
||||
let phy = `phy${phyidx}`;
|
||||
if (index(pdev.phy, phy) < 0)
|
||||
push(pdev.phy, phy);
|
||||
}
|
||||
|
||||
push(pdev.netdev, dev);
|
||||
netdev_phys[dev] = pdev;
|
||||
}
|
||||
|
||||
for (let path in glob("/proc/*/exe")) {
|
||||
readlink(path);
|
||||
if (error() != "No such file or directory")
|
||||
continue;
|
||||
|
||||
let pid = basename(dirname(path));
|
||||
let name = task_name(pid);
|
||||
for (let devname in phys_devs) {
|
||||
let dev = phys_devs[devname];
|
||||
if (!task_device_match(name, dev))
|
||||
continue;
|
||||
|
||||
push(dev.tasks, pid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function assign_dev_cpu(dev) {
|
||||
if (length(dev.tasks) > 0) {
|
||||
let cpu = dev.napi_cpu = get_next_cpu(napi_weight);
|
||||
for (let task in dev.tasks)
|
||||
set_task_cpu(task, cpu);
|
||||
}
|
||||
|
||||
if (length(dev.netdev) > 0) {
|
||||
let cpu = dev.rx_cpu = get_next_cpu(rx_weight, dev.napi_cpu);
|
||||
for (let netdev in dev.netdev)
|
||||
set_netdev_cpu(netdev, cpu);
|
||||
}
|
||||
}
|
||||
|
||||
// Assign ethernet devices first
|
||||
for (let devname in phys_devs) {
|
||||
let dev = phys_devs[devname];
|
||||
if (!length(dev.phy))
|
||||
assign_dev_cpu(dev);
|
||||
}
|
||||
|
||||
// Add bias to avoid assigning other tasks to CPUs with ethernet NAPI
|
||||
for (let devname in phys_devs) {
|
||||
let dev = phys_devs[devname];
|
||||
if (!length(dev.tasks) || dev.napi_cpu == null)
|
||||
continue;
|
||||
cpu_add_weight(dev.napi_cpu, eth_bias);
|
||||
}
|
||||
|
||||
// Assign WLAN devices
|
||||
for (let devname in phys_devs) {
|
||||
let dev = phys_devs[devname];
|
||||
if (length(dev.phy) > 0)
|
||||
assign_dev_cpu(dev);
|
||||
}
|
||||
|
||||
if (debug > 1)
|
||||
warn(sprintf("devices: %.J\ncpus: %.J\n", phys_devs, cpus));
|
@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=bridger
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://github.com/nbd168/bridger
|
||||
PKG_SOURCE_DATE:=2023-05-12
|
||||
PKG_SOURCE_VERSION:=d0f79a16c749ad310d79e1c31f593860619f99eb
|
||||
PKG_MIRROR_HASH:=dde6613662ad53ba6622e669400560a534426edfa4f42c91d156fbd7ccafd15c
|
||||
PKG_SOURCE_DATE:=2024-04-15
|
||||
PKG_SOURCE_VERSION:=a08e51e679dd7e1eaf70ea7fd6b6433e167d4c2d
|
||||
PKG_MIRROR_HASH:=e80ac0cc3c5b27afb233c03fed3fbcef34a1b3fdbe0d48532ad1d5c3aac4088d
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
@ -1,3 +1,6 @@
|
||||
config defaults
|
||||
# handle bridge local rx/tx
|
||||
option bridge_local 0
|
||||
|
||||
# example for blacklisting individual devices or bridges
|
||||
# list blacklist eth0
|
||||
|
@ -6,25 +6,27 @@ START=19
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bridger
|
||||
|
||||
add_blacklist() {
|
||||
get_defaults() {
|
||||
cfg="$1"
|
||||
|
||||
config_get blacklist "$cfg" blacklist
|
||||
json_add_array blacklist
|
||||
for i in $blacklist; do
|
||||
json_add_string "" "$i"
|
||||
done
|
||||
json_close_array
|
||||
|
||||
config_get_bool bridge_local "$cfg" bridge_local 0
|
||||
json_add_boolean bridge_local "$bridge_local"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
config_load bridger
|
||||
|
||||
json_init
|
||||
json_add_string name "config"
|
||||
json_add_array devices
|
||||
config_foreach add_blacklist defaults
|
||||
json_close_array
|
||||
config_foreach get_defaults defaults
|
||||
|
||||
ubus call bridger set_blacklist "$(json_dump)"
|
||||
ubus call bridger set_config "$(json_dump)"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
@ -51,7 +51,7 @@ hostapd_ucode_update_bss_list(struct hostapd_iface *iface, uc_value_t *if_bss, u
|
||||
int i;
|
||||
|
||||
list = ucv_array_new(vm);
|
||||
for (i = 0; i < iface->num_bss; i++) {
|
||||
for (i = 0; iface->bss && i < iface->num_bss; i++) {
|
||||
struct hostapd_data *hapd = iface->bss[i];
|
||||
uc_value_t *val = hostapd_ucode_bss_get_uval(hapd);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 Tony Ambardar <itugrok@yahoo.com>
|
||||
# Copyright (C) 2020-2024 Tony Ambardar <itugrok@yahoo.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@ -7,18 +7,18 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bpftools
|
||||
PKG_VERSION:=7.3.0
|
||||
PKG_NAME:=bpftool
|
||||
PKG_VERSION:=7.4.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/libbpf/bpftool
|
||||
PKG_MIRROR_HASH:=42030a007714aa075fbd402ccb0196e4892344fb7215b4f51a99b633cc5104fa
|
||||
PKG_MIRROR_HASH:=18e22f72e67ff402b5ecaf314445f25c40bfe23299cb783b5834a496297c51ed
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=v7.3.0
|
||||
PKG_SOURCE_VERSION:=v7.4.0
|
||||
|
||||
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
|
||||
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
PKG_BUILD_FLAGS:=no-mips16 gc-sections lto
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@ -62,19 +62,12 @@ define Package/bpftool-full/description
|
||||
eBPF programs and jited code.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections -flto
|
||||
|
||||
ifeq ($(BUILD_VARIANT),full)
|
||||
full:=1
|
||||
else
|
||||
full:=0
|
||||
endif
|
||||
|
||||
MAKE_VARS = \
|
||||
EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
MAKE_FLAGS += \
|
||||
OUTPUT="$(PKG_BUILD_DIR)/" \
|
||||
prefix="/usr" \
|
||||
|
@ -1,10 +0,0 @@
|
||||
--- a/libbpf/src/Makefile
|
||||
+++ b/libbpf/src/Makefile
|
||||
@@ -34,6 +34,7 @@ ALL_CFLAGS := $(INCLUDES)
|
||||
|
||||
SHARED_CFLAGS += -fPIC -fvisibility=hidden -DSHARED
|
||||
|
||||
+CFLAGS = $(EXTRA_CFLAGS)
|
||||
CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89
|
||||
ALL_CFLAGS += $(CFLAGS) \
|
||||
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
|
@ -1,14 +1,3 @@
|
||||
--- a/libbpf/include/linux/list.h
|
||||
+++ b/libbpf/include/linux/list.h
|
||||
@@ -3,6 +3,8 @@
|
||||
#ifndef __LINUX_LIST_H
|
||||
#define __LINUX_LIST_H
|
||||
|
||||
+#include <linux/types.h>
|
||||
+
|
||||
#define LIST_HEAD_INIT(name) { &(name), &(name) }
|
||||
#define LIST_HEAD(name) \
|
||||
struct list_head name = LIST_HEAD_INIT(name)
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -73,10 +73,10 @@ CFLAGS += -W -Wall -Wextra -Wno-unused-p
|
||||
|
@ -24,7 +24,7 @@ BUNDLER_COMMAND := PATH=$(BUNDLER_PATH) $(XARGS) $(SCRIPT_DIR)/bundle-libraries.
|
||||
|
||||
all: compile
|
||||
|
||||
$(BIN_DIR)/$(IB_NAME).tar.xz: clean
|
||||
$(BIN_DIR)/$(IB_NAME).tar.zst: clean
|
||||
rm -rf $(PKG_BUILD_DIR)
|
||||
mkdir -p $(IB_KDIR) $(IB_LDIR) $(PKG_BUILD_DIR)/staging_dir/host/lib \
|
||||
$(PKG_BUILD_DIR)/target/linux $(PKG_BUILD_DIR)/scripts $(IB_DTSDIR)
|
||||
@ -118,15 +118,16 @@ endif
|
||||
$(BUNDLER_COMMAND))
|
||||
$(CP) $(TOPDIR)/staging_dir/host/lib/libfakeroot* $(PKG_BUILD_DIR)/staging_dir/host/lib
|
||||
STRIP=$(STAGING_DIR_HOST)/bin/sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/
|
||||
|
||||
(cd $(BUILD_DIR); \
|
||||
tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(IB_NAME) \
|
||||
tar -I '$(STAGING_DIR_HOST)/bin/zstd -T0 --ultra -20' -cf $@ $(IB_NAME) \
|
||||
--mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \
|
||||
)
|
||||
|
||||
download:
|
||||
prepare:
|
||||
compile: $(BIN_DIR)/$(IB_NAME).tar.xz
|
||||
compile: $(BIN_DIR)/$(IB_NAME).tar.zst
|
||||
install: compile
|
||||
|
||||
clean: FORCE
|
||||
rm -rf $(PKG_BUILD_DIR) $(BIN_DIR)/$(IB_NAME).tar.xz
|
||||
rm -rf $(PKG_BUILD_DIR) $(BIN_DIR)/$(IB_NAME).tar.zst
|
||||
|
143
target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
Normal file
143
target/linux/ath79/dts/qca9531_comfast_cf-ew71-v2.dts
Normal file
@ -0,0 +1,143 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "qca953x.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
compatible = "comfast,cf-ew71-v2", "qca,qca9531";
|
||||
model = "COMFAST CF-EW71 v2";
|
||||
|
||||
aliases {
|
||||
serial0 = &uart;
|
||||
led-boot = &led_wan;
|
||||
led-failsafe = &led_wan;
|
||||
led-upgrade = &led_wan;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&jtag_disable_pins>;
|
||||
|
||||
lan {
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_wan: wan {
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wlan {
|
||||
function = LED_FUNCTION_WLAN;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "linux,wdt-gpio";
|
||||
|
||||
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
hw_algo = "toggle";
|
||||
hw_margin_ms = <1200>;
|
||||
always-running;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "winbond,w25q128", "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <25000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x000000 0x010000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@10000 {
|
||||
label = "art";
|
||||
reg = <0x010000 0x010000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
compatible = "mac-base";
|
||||
reg = <0x0 0x6>;
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
partition@20000 {
|
||||
compatible = "denx,uimage";
|
||||
label = "firmware";
|
||||
reg = <0x020000 0xfd0000>;
|
||||
};
|
||||
|
||||
partition@ff0000 {
|
||||
label = "nvram";
|
||||
reg = <0xff0000 0x010000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&swphy4>;
|
||||
|
||||
nvmem-cells = <&macaddr_art_0 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
ð1 {
|
||||
nvmem-cells = <&macaddr_art_0 0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
mtd-cal-data = <&art 0x1000>;
|
||||
nvmem-cells = <&macaddr_art_0 3>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
@ -199,6 +199,7 @@ comfast,cf-e560ac)
|
||||
ucidef_set_led_switch "lan3" "LAN3" "blue:lan3" "switch0" "0x08"
|
||||
ucidef_set_led_switch "lan4" "LAN4" "blue:lan4" "switch0" "0x10"
|
||||
;;
|
||||
comfast,cf-ew71-v2|\
|
||||
comfast,cf-ew72|\
|
||||
openmesh,om2p-v2|\
|
||||
openmesh,om2p-hs-v1|\
|
||||
|
@ -828,6 +828,16 @@ define Device/comfast_cf-e560ac
|
||||
endef
|
||||
TARGET_DEVICES += comfast_cf-e560ac
|
||||
|
||||
define Device/comfast_cf-ew71-v2
|
||||
SOC := qca9531
|
||||
DEVICE_VENDOR := COMFAST
|
||||
DEVICE_MODEL := CF-EW71
|
||||
DEVICE_VARIANT := v2
|
||||
DEVICE_PACKAGES := kmod-usb2 -uboot-envtools -swconfig
|
||||
IMAGE_SIZE := 16192k
|
||||
endef
|
||||
TARGET_DEVICES += comfast_cf-ew71-v2
|
||||
|
||||
define Device/comfast_cf-ew72
|
||||
SOC := qca9531
|
||||
DEVICE_VENDOR := COMFAST
|
||||
|
@ -72,7 +72,7 @@ Submitted-by: Christopher Hill <ch6574@gmail.com>
|
||||
obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o
|
||||
--- a/drivers/gpio/Kconfig
|
||||
+++ b/drivers/gpio/Kconfig
|
||||
@@ -1593,6 +1593,12 @@ config GPIO_SODAVILLE
|
||||
@@ -1594,6 +1594,12 @@ config GPIO_SODAVILLE
|
||||
help
|
||||
Say Y here to support Intel Sodaville GPIO.
|
||||
|
||||
|
@ -46,7 +46,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
}
|
||||
EXPORT_SYMBOL(drm_panel_init);
|
||||
|
||||
@@ -289,16 +292,18 @@ int of_drm_get_panel_orientation(const s
|
||||
@@ -294,16 +297,18 @@ int of_drm_get_panel_orientation(const s
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -88,7 +88,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
if (ret)
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -1600,9 +1600,14 @@ struct drm_plane *vc4_plane_init(struct
|
||||
@@ -1597,9 +1597,14 @@ struct drm_plane *vc4_plane_init(struct
|
||||
DRM_COLOR_YCBCR_BT709,
|
||||
DRM_COLOR_YCBCR_LIMITED_RANGE);
|
||||
|
||||
@ -103,7 +103,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
int vc4_plane_create_additional_planes(struct drm_device *drm)
|
||||
{
|
||||
struct drm_plane *cursor_plane;
|
||||
@@ -1618,24 +1623,35 @@ int vc4_plane_create_additional_planes(s
|
||||
@@ -1615,24 +1620,35 @@ int vc4_plane_create_additional_planes(s
|
||||
* modest number of planes to expose, that should hopefully
|
||||
* still cover any sane usecase.
|
||||
*/
|
||||
|
@ -49,7 +49,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
vc4_dlist_write(vc4_state, 0xc0c0c0c0);
|
||||
}
|
||||
|
||||
@@ -1649,6 +1652,8 @@ struct drm_plane *vc4_plane_init(struct
|
||||
@@ -1646,6 +1649,8 @@ struct drm_plane *vc4_plane_init(struct
|
||||
DRM_COLOR_YCBCR_BT709,
|
||||
DRM_COLOR_YCBCR_LIMITED_RANGE);
|
||||
|
||||
|
@ -85,7 +85,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
};
|
||||
|
||||
static const struct hvs_format *vc4_get_hvs_format(u32 drm_format)
|
||||
@@ -1575,6 +1635,16 @@ static bool vc4_format_mod_supported(str
|
||||
@@ -1572,6 +1632,16 @@ static bool vc4_format_mod_supported(str
|
||||
case DRM_FORMAT_BGRX1010102:
|
||||
case DRM_FORMAT_RGBA1010102:
|
||||
case DRM_FORMAT_BGRA1010102:
|
||||
|
@ -1185,7 +1185,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
}
|
||||
--- a/drivers/usb/core/hub.c
|
||||
+++ b/drivers/usb/core/hub.c
|
||||
@@ -5677,7 +5677,7 @@ static void port_event(struct usb_hub *h
|
||||
@@ -5686,7 +5686,7 @@ static void port_event(struct usb_hub *h
|
||||
port_dev->over_current_count++;
|
||||
port_over_current_notify(port_dev);
|
||||
|
||||
|
@ -266,7 +266,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
static inline int mmc_blk_part_switch(struct mmc_card *card,
|
||||
unsigned int part_type);
|
||||
static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
|
||||
@@ -3050,6 +3057,8 @@ static int mmc_blk_probe(struct mmc_card
|
||||
@@ -3052,6 +3059,8 @@ static int mmc_blk_probe(struct mmc_card
|
||||
{
|
||||
struct mmc_blk_data *md;
|
||||
int ret = 0;
|
||||
@ -275,7 +275,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
/*
|
||||
* Check that the card supports the command class(es) we need.
|
||||
@@ -3057,7 +3066,16 @@ static int mmc_blk_probe(struct mmc_card
|
||||
@@ -3059,7 +3068,16 @@ static int mmc_blk_probe(struct mmc_card
|
||||
if (!(card->csd.cmdclass & CCC_BLOCK_READ))
|
||||
return -ENODEV;
|
||||
|
||||
@ -293,7 +293,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
card->complete_wq = alloc_workqueue("mmc_complete",
|
||||
WQ_MEM_RECLAIM | WQ_HIGHPRI, 0);
|
||||
@@ -3072,6 +3090,17 @@ static int mmc_blk_probe(struct mmc_card
|
||||
@@ -3074,6 +3092,17 @@ static int mmc_blk_probe(struct mmc_card
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
|
@ -17578,7 +17578,7 @@ Signed-off-by: Ashish Vara <ashishhvara@gmail.com>
|
||||
+#endif /* _TAS5713_H */
|
||||
--- a/sound/soc/soc-core.c
|
||||
+++ b/sound/soc/soc-core.c
|
||||
@@ -1220,7 +1220,15 @@ int snd_soc_runtime_set_dai_fmt(struct s
|
||||
@@ -1223,7 +1223,15 @@ int snd_soc_runtime_set_dai_fmt(struct s
|
||||
return 0;
|
||||
|
||||
for_each_rtd_codec_dais(rtd, i, codec_dai) {
|
||||
|
@ -13,7 +13,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
|
||||
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
@@ -1773,7 +1773,7 @@ int vchiq_mmal_component_enable(struct v
|
||||
@@ -1774,7 +1774,7 @@ int vchiq_mmal_component_enable(struct v
|
||||
|
||||
ret = enable_component(instance, component);
|
||||
if (ret == 0)
|
||||
|
@ -234,7 +234,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
/* deals with receipt of buffer to host message */
|
||||
static void buffer_to_host_cb(struct vchiq_mmal_instance *instance,
|
||||
struct mmal_msg *msg, u32 msg_len)
|
||||
@@ -1330,6 +1423,7 @@ static int port_disable(struct vchiq_mma
|
||||
@@ -1331,6 +1424,7 @@ static int port_disable(struct vchiq_mma
|
||||
mmalbuf->mmal_flags = 0;
|
||||
mmalbuf->dts = MMAL_TIME_UNKNOWN;
|
||||
mmalbuf->pts = MMAL_TIME_UNKNOWN;
|
||||
@ -242,7 +242,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
port->buffer_cb(instance,
|
||||
port, 0, mmalbuf);
|
||||
}
|
||||
@@ -1631,6 +1725,43 @@ int mmal_vchi_buffer_cleanup(struct mmal
|
||||
@@ -1632,6 +1726,43 @@ int mmal_vchi_buffer_cleanup(struct mmal
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mmal_vchi_buffer_cleanup);
|
||||
|
||||
@ -286,7 +286,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
/* Initialise a mmal component and its ports
|
||||
*
|
||||
*/
|
||||
@@ -1680,6 +1811,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
@@ -1681,6 +1812,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
ret = port_info_get(instance, &component->control);
|
||||
if (ret < 0)
|
||||
goto release_component;
|
||||
@ -294,7 +294,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
|
||||
for (idx = 0; idx < component->inputs; idx++) {
|
||||
component->input[idx].type = MMAL_PORT_TYPE_INPUT;
|
||||
@@ -1690,6 +1822,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
@@ -1691,6 +1823,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
ret = port_info_get(instance, &component->input[idx]);
|
||||
if (ret < 0)
|
||||
goto release_component;
|
||||
@ -302,7 +302,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
}
|
||||
|
||||
for (idx = 0; idx < component->outputs; idx++) {
|
||||
@@ -1701,6 +1834,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
@@ -1702,6 +1835,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
ret = port_info_get(instance, &component->output[idx]);
|
||||
if (ret < 0)
|
||||
goto release_component;
|
||||
@ -310,7 +310,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
}
|
||||
|
||||
for (idx = 0; idx < component->clocks; idx++) {
|
||||
@@ -1712,6 +1846,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
@@ -1713,6 +1847,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
ret = port_info_get(instance, &component->clock[idx]);
|
||||
if (ret < 0)
|
||||
goto release_component;
|
||||
@ -318,7 +318,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
}
|
||||
|
||||
*component_out = component;
|
||||
@@ -1737,7 +1872,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_component_i
|
||||
@@ -1738,7 +1873,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_component_i
|
||||
int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
|
||||
struct vchiq_mmal_component *component)
|
||||
{
|
||||
@ -327,7 +327,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
|
||||
if (mutex_lock_interruptible(&instance->vchiq_mutex))
|
||||
return -EINTR;
|
||||
@@ -1749,6 +1884,13 @@ int vchiq_mmal_component_finalise(struct
|
||||
@@ -1750,6 +1885,13 @@ int vchiq_mmal_component_finalise(struct
|
||||
|
||||
component->in_use = 0;
|
||||
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
|
||||
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
@@ -1899,6 +1899,8 @@ int vchiq_mmal_component_finalise(struct
|
||||
@@ -1900,6 +1900,8 @@ int vchiq_mmal_component_finalise(struct
|
||||
for (idx = 0; idx < component->clocks; idx++)
|
||||
free_event_context(&component->clock[idx]);
|
||||
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
|
||||
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
@@ -1765,9 +1765,26 @@ static void free_event_context(struct vc
|
||||
@@ -1766,9 +1766,26 @@ static void free_event_context(struct vc
|
||||
{
|
||||
struct mmal_msg_context *ctx = port->event_context;
|
||||
|
||||
@ -41,7 +41,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
}
|
||||
|
||||
/* Initialise a mmal component and its ports
|
||||
@@ -1865,6 +1882,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
@@ -1866,6 +1883,7 @@ int vchiq_mmal_component_init(struct vch
|
||||
|
||||
release_component:
|
||||
destroy_component(instance, component);
|
||||
@ -49,7 +49,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
unlock:
|
||||
if (component)
|
||||
component->in_use = 0;
|
||||
@@ -1880,7 +1898,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_component_i
|
||||
@@ -1881,7 +1899,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_component_i
|
||||
int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
|
||||
struct vchiq_mmal_component *component)
|
||||
{
|
||||
@ -58,7 +58,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
|
||||
if (mutex_lock_interruptible(&instance->vchiq_mutex))
|
||||
return -EINTR;
|
||||
@@ -1892,14 +1910,7 @@ int vchiq_mmal_component_finalise(struct
|
||||
@@ -1893,14 +1911,7 @@ int vchiq_mmal_component_finalise(struct
|
||||
|
||||
component->in_use = 0;
|
||||
|
||||
|
@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -1641,6 +1641,109 @@ command_cleanup:
|
||||
@@ -1643,6 +1643,109 @@ command_cleanup:
|
||||
}
|
||||
|
||||
/*
|
||||
@ -125,7 +125,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
* non-error returns are a promise to giveback() the urb later
|
||||
* we drop ownership so next owner (or urb unlink) can get it
|
||||
*/
|
||||
@@ -5469,6 +5572,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
@@ -5471,6 +5574,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
.endpoint_reset = xhci_endpoint_reset,
|
||||
.check_bandwidth = xhci_check_bandwidth,
|
||||
.reset_bandwidth = xhci_reset_bandwidth,
|
||||
|
@ -91,7 +91,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
} else if (msg->u.buffer_from_host.buffer_header.length == 0) {
|
||||
/* empty buffer */
|
||||
if (msg->u.buffer_from_host.buffer_header.flags &
|
||||
@@ -1528,6 +1551,9 @@ int vchiq_mmal_port_parameter_set(struct
|
||||
@@ -1529,6 +1552,9 @@ int vchiq_mmal_port_parameter_set(struct
|
||||
|
||||
mutex_unlock(&instance->vchiq_mutex);
|
||||
|
||||
@ -101,7 +101,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vchiq_mmal_port_parameter_set);
|
||||
@@ -1696,6 +1722,31 @@ int vchiq_mmal_submit_buffer(struct vchi
|
||||
@@ -1697,6 +1723,31 @@ int vchiq_mmal_submit_buffer(struct vchi
|
||||
unsigned long flags = 0;
|
||||
int ret;
|
||||
|
||||
@ -133,7 +133,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
ret = buffer_from_host(instance, port, buffer);
|
||||
if (ret == -EINVAL) {
|
||||
/* Port is disabled. Queue for when it is enabled. */
|
||||
@@ -1729,6 +1780,16 @@ int mmal_vchi_buffer_cleanup(struct mmal
|
||||
@@ -1730,6 +1781,16 @@ int mmal_vchi_buffer_cleanup(struct mmal
|
||||
release_msg_context(msg_context);
|
||||
buf->msg_context = NULL;
|
||||
|
||||
|
@ -63,7 +63,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
--- a/drivers/gpio/Kconfig
|
||||
+++ b/drivers/gpio/Kconfig
|
||||
@@ -1243,6 +1243,15 @@ config HTC_EGPIO
|
||||
@@ -1244,6 +1244,15 @@ config HTC_EGPIO
|
||||
several HTC phones. It provides basic support for input
|
||||
pins, output pins, and IRQs.
|
||||
|
||||
|
@ -172,7 +172,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
vchiq_release_message(instance->vchiq_instance, instance->service_handle, rmsg_handle);
|
||||
|
||||
@@ -1086,9 +1101,9 @@ static int create_component(struct vchiq
|
||||
@@ -1087,9 +1102,9 @@ static int create_component(struct vchiq
|
||||
component->outputs = rmsg->u.component_create_reply.output_num;
|
||||
component->clocks = rmsg->u.component_create_reply.clock_num;
|
||||
|
||||
@ -185,7 +185,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
release_msg:
|
||||
vchiq_release_message(instance->vchiq_instance, instance->service_handle, rmsg_handle);
|
||||
@@ -1257,10 +1272,9 @@ static int port_action_port(struct vchiq
|
||||
@@ -1258,10 +1273,9 @@ static int port_action_port(struct vchiq
|
||||
|
||||
ret = -rmsg->u.port_action_reply.status;
|
||||
|
||||
@ -199,7 +199,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
release_msg:
|
||||
vchiq_release_message(instance->vchiq_instance, instance->service_handle, rmsg_handle);
|
||||
@@ -1304,11 +1318,11 @@ static int port_action_handle(struct vch
|
||||
@@ -1305,11 +1319,11 @@ static int port_action_handle(struct vch
|
||||
|
||||
ret = -rmsg->u.port_action_reply.status;
|
||||
|
||||
@ -216,7 +216,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
release_msg:
|
||||
vchiq_release_message(instance->vchiq_instance, instance->service_handle, rmsg_handle);
|
||||
@@ -1347,9 +1361,9 @@ static int port_parameter_set(struct vch
|
||||
@@ -1348,9 +1362,9 @@ static int port_parameter_set(struct vch
|
||||
|
||||
ret = -rmsg->u.port_parameter_set_reply.status;
|
||||
|
||||
@ -229,7 +229,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
release_msg:
|
||||
vchiq_release_message(instance->vchiq_instance, instance->service_handle, rmsg_handle);
|
||||
@@ -1407,8 +1421,9 @@ static int port_parameter_get(struct vch
|
||||
@@ -1408,8 +1422,9 @@ static int port_parameter_get(struct vch
|
||||
/* Always report the size of the returned parameter to the caller */
|
||||
*value_size = rmsg->u.port_parameter_get_reply.size;
|
||||
|
||||
@ -241,7 +241,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
release_msg:
|
||||
vchiq_release_message(instance->vchiq_instance, instance->service_handle, rmsg_handle);
|
||||
@@ -1665,7 +1680,7 @@ int vchiq_mmal_port_connect_tunnel(struc
|
||||
@@ -1666,7 +1681,7 @@ int vchiq_mmal_port_connect_tunnel(struc
|
||||
if (!dst) {
|
||||
/* do not make new connection */
|
||||
ret = 0;
|
||||
@ -250,7 +250,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
goto release_unlock;
|
||||
}
|
||||
|
||||
@@ -1683,14 +1698,14 @@ int vchiq_mmal_port_connect_tunnel(struc
|
||||
@@ -1684,14 +1699,14 @@ int vchiq_mmal_port_connect_tunnel(struc
|
||||
/* set new format */
|
||||
ret = port_info_set(instance, dst);
|
||||
if (ret) {
|
||||
@ -267,7 +267,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
goto release_unlock;
|
||||
}
|
||||
|
||||
@@ -1699,9 +1714,9 @@ int vchiq_mmal_port_connect_tunnel(struc
|
||||
@@ -1700,9 +1715,9 @@ int vchiq_mmal_port_connect_tunnel(struc
|
||||
MMAL_MSG_PORT_ACTION_TYPE_CONNECT,
|
||||
dst->component->handle, dst->handle);
|
||||
if (ret < 0) {
|
||||
@ -280,7 +280,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
goto release_unlock;
|
||||
}
|
||||
src->connected = dst;
|
||||
@@ -1726,7 +1741,8 @@ int vchiq_mmal_submit_buffer(struct vchi
|
||||
@@ -1727,7 +1742,8 @@ int vchiq_mmal_submit_buffer(struct vchi
|
||||
* videobuf2 won't let us have the dmabuf there.
|
||||
*/
|
||||
if (port->zero_copy && buffer->dma_buf && !buffer->vcsm_handle) {
|
||||
@ -290,7 +290,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
ret = vc_sm_cma_import_dmabuf(buffer->dma_buf,
|
||||
&buffer->vcsm_handle);
|
||||
if (ret) {
|
||||
@@ -1742,8 +1758,8 @@ int vchiq_mmal_submit_buffer(struct vchi
|
||||
@@ -1743,8 +1759,8 @@ int vchiq_mmal_submit_buffer(struct vchi
|
||||
vc_sm_cma_free(buffer->vcsm_handle);
|
||||
return ret;
|
||||
}
|
||||
@ -301,7 +301,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
}
|
||||
|
||||
ret = buffer_from_host(instance, port, buffer);
|
||||
@@ -1782,8 +1798,8 @@ int mmal_vchi_buffer_cleanup(struct mmal
|
||||
@@ -1783,8 +1799,8 @@ int mmal_vchi_buffer_cleanup(struct mmal
|
||||
if (buf->vcsm_handle) {
|
||||
int ret;
|
||||
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
@@ -1500,6 +1500,8 @@ static int port_enable(struct vchiq_mmal
|
||||
@@ -1501,6 +1501,8 @@ static int port_enable(struct vchiq_mmal
|
||||
|
||||
port->enabled = 1;
|
||||
|
||||
|
@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
|
||||
--- a/drivers/mmc/core/block.c
|
||||
+++ b/drivers/mmc/core/block.c
|
||||
@@ -1970,7 +1970,7 @@ static void mmc_blk_mq_rw_recovery(struc
|
||||
@@ -1972,7 +1972,7 @@ static void mmc_blk_mq_rw_recovery(struc
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -1730,7 +1730,7 @@ static void xhci_fixup_endpoint(struct u
|
||||
@@ -1732,7 +1732,7 @@ static void xhci_fixup_endpoint(struct u
|
||||
return;
|
||||
}
|
||||
ctrl_ctx->add_flags = xhci_get_endpoint_flag_from_index(ep_index);
|
||||
|
@ -71,7 +71,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
* hardware interrupt, we use a timer-based system. The original
|
||||
--- a/drivers/tty/serial/8250/8250_port.c
|
||||
+++ b/drivers/tty/serial/8250/8250_port.c
|
||||
@@ -1559,6 +1559,9 @@ static void serial8250_stop_tx(struct ua
|
||||
@@ -1553,6 +1553,9 @@ static void serial8250_stop_tx(struct ua
|
||||
serial_icr_write(up, UART_ACR, up->acr);
|
||||
}
|
||||
serial8250_rpm_put(up);
|
||||
@ -81,7 +81,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
}
|
||||
|
||||
static inline void __start_tx(struct uart_port *port)
|
||||
@@ -1669,6 +1672,9 @@ static void serial8250_start_tx(struct u
|
||||
@@ -1663,6 +1666,9 @@ static void serial8250_start_tx(struct u
|
||||
struct uart_8250_port *up = up_to_u8250p(port);
|
||||
struct uart_8250_em485 *em485 = up->em485;
|
||||
|
||||
@ -91,7 +91,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
if (!port->x_char && uart_circ_empty(&port->state->xmit))
|
||||
return;
|
||||
|
||||
@@ -1889,6 +1895,9 @@ unsigned int serial8250_modem_status(str
|
||||
@@ -1883,6 +1889,9 @@ unsigned int serial8250_modem_status(str
|
||||
uart_handle_cts_change(port, status & UART_MSR_CTS);
|
||||
|
||||
wake_up_interruptible(&port->state->port.delta_msr_wait);
|
||||
|
@ -35,7 +35,7 @@ Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
||||
|
||||
--- a/fs/f2fs/segment.c
|
||||
+++ b/fs/f2fs/segment.c
|
||||
@@ -663,9 +663,7 @@ init_thread:
|
||||
@@ -665,9 +665,7 @@ init_thread:
|
||||
"f2fs_flush-%u:%u", MAJOR(dev), MINOR(dev));
|
||||
if (IS_ERR(fcc->f2fs_issue_flush)) {
|
||||
err = PTR_ERR(fcc->f2fs_issue_flush);
|
||||
@ -46,7 +46,7 @@ Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
||||
}
|
||||
|
||||
return err;
|
||||
@@ -5062,11 +5060,9 @@ int f2fs_build_segment_manager(struct f2
|
||||
@@ -5064,11 +5062,9 @@ int f2fs_build_segment_manager(struct f2
|
||||
|
||||
init_f2fs_rwsem(&sm_info->curseg_lock);
|
||||
|
||||
|
@ -902,7 +902,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
/* Control word */
|
||||
vc4_dlist_write(vc4_state,
|
||||
SCALER_CTL0_VALID |
|
||||
@@ -1717,7 +1717,7 @@ struct drm_plane *vc4_plane_init(struct
|
||||
@@ -1714,7 +1714,7 @@ struct drm_plane *vc4_plane_init(struct
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) {
|
||||
@ -911,7 +911,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
formats[num_formats] = hvs_formats[i].drm;
|
||||
num_formats++;
|
||||
}
|
||||
@@ -1732,7 +1732,7 @@ struct drm_plane *vc4_plane_init(struct
|
||||
@@ -1729,7 +1729,7 @@ struct drm_plane *vc4_plane_init(struct
|
||||
return ERR_CAST(vc4_plane);
|
||||
plane = &vc4_plane->base;
|
||||
|
||||
|
@ -1924,7 +1924,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1716,7 +2345,7 @@ struct drm_plane *vc4_plane_init(struct
|
||||
@@ -1713,7 +2342,7 @@ struct drm_plane *vc4_plane_init(struct
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) {
|
||||
@ -1933,7 +1933,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
formats[num_formats] = hvs_formats[i].drm;
|
||||
num_formats++;
|
||||
}
|
||||
@@ -1731,7 +2360,7 @@ struct drm_plane *vc4_plane_init(struct
|
||||
@@ -1728,7 +2357,7 @@ struct drm_plane *vc4_plane_init(struct
|
||||
return ERR_CAST(vc4_plane);
|
||||
plane = &vc4_plane->base;
|
||||
|
||||
|
@ -1,93 +0,0 @@
|
||||
From 146bbf9627f6c37816939de29538ec8ee9a7be1a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ma=C3=ADra=20Canal?= <mcanal@igalia.com>
|
||||
Date: Fri, 5 Jan 2024 15:07:34 -0300
|
||||
Subject: [PATCH] drm/vc4: don't check if plane->state->fb == state->fb
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Currently, when using non-blocking commits, we can see the following
|
||||
kernel warning:
|
||||
|
||||
[ 110.908514] ------------[ cut here ]------------
|
||||
[ 110.908529] refcount_t: underflow; use-after-free.
|
||||
[ 110.908620] WARNING: CPU: 0 PID: 1866 at lib/refcount.c:87 refcount_dec_not_one+0xb8/0xc0
|
||||
[ 110.908664] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep hid_logitech_hidpp vc4 brcmfmac hci_uart btbcm brcmutil bluetooth snd_soc_hdmi_codec cfg80211 cec drm_display_helper drm_dma_helper drm_kms_helper snd_soc_core snd_compress snd_pcm_dmaengine fb_sys_fops sysimgblt syscopyarea sysfillrect raspberrypi_hwmon ecdh_generic ecc rfkill libaes i2c_bcm2835 binfmt_misc joydev snd_bcm2835(C) bcm2835_codec(C) bcm2835_isp(C) v4l2_mem2mem videobuf2_dma_contig snd_pcm bcm2835_v4l2(C) raspberrypi_gpiomem bcm2835_mmal_vchiq(C) videobuf2_v4l2 snd_timer videobuf2_vmalloc videobuf2_memops videobuf2_common snd videodev vc_sm_cma(C) mc hid_logitech_dj uio_pdrv_genirq uio i2c_dev drm fuse dm_mod drm_panel_orientation_quirks backlight ip_tables x_tables ipv6
|
||||
[ 110.909086] CPU: 0 PID: 1866 Comm: kodi.bin Tainted: G C 6.1.66-v8+ #32
|
||||
[ 110.909104] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
|
||||
[ 110.909114] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
|
||||
[ 110.909132] pc : refcount_dec_not_one+0xb8/0xc0
|
||||
[ 110.909152] lr : refcount_dec_not_one+0xb4/0xc0
|
||||
[ 110.909170] sp : ffffffc00913b9c0
|
||||
[ 110.909177] x29: ffffffc00913b9c0 x28: 000000556969bbb0 x27: 000000556990df60
|
||||
[ 110.909205] x26: 0000000000000002 x25: 0000000000000004 x24: ffffff8004448480
|
||||
[ 110.909230] x23: ffffff800570b500 x22: ffffff802e03a7bc x21: ffffffecfca68c78
|
||||
[ 110.909257] x20: ffffff8002b42000 x19: ffffff802e03a600 x18: 0000000000000000
|
||||
[ 110.909283] x17: 0000000000000011 x16: ffffffffffffffff x15: 0000000000000004
|
||||
[ 110.909308] x14: 0000000000000fff x13: ffffffed577e47e0 x12: 0000000000000003
|
||||
[ 110.909333] x11: 0000000000000000 x10: 0000000000000027 x9 : c912d0d083728c00
|
||||
[ 110.909359] x8 : c912d0d083728c00 x7 : 65646e75203a745f x6 : 746e756f63666572
|
||||
[ 110.909384] x5 : ffffffed579f62ee x4 : ffffffed579eb01e x3 : 0000000000000000
|
||||
[ 110.909409] x2 : 0000000000000000 x1 : ffffffc00913b750 x0 : 0000000000000001
|
||||
[ 110.909434] Call trace:
|
||||
[ 110.909441] refcount_dec_not_one+0xb8/0xc0
|
||||
[ 110.909461] vc4_bo_dec_usecnt+0x4c/0x1b0 [vc4]
|
||||
[ 110.909903] vc4_cleanup_fb+0x44/0x50 [vc4]
|
||||
[ 110.910315] drm_atomic_helper_cleanup_planes+0x88/0xa4 [drm_kms_helper]
|
||||
[ 110.910669] vc4_atomic_commit_tail+0x390/0x9dc [vc4]
|
||||
[ 110.911079] commit_tail+0xb0/0x164 [drm_kms_helper]
|
||||
[ 110.911397] drm_atomic_helper_commit+0x1d0/0x1f0 [drm_kms_helper]
|
||||
[ 110.911716] drm_atomic_commit+0xb0/0xdc [drm]
|
||||
[ 110.912569] drm_mode_atomic_ioctl+0x348/0x4b8 [drm]
|
||||
[ 110.913330] drm_ioctl_kernel+0xec/0x15c [drm]
|
||||
[ 110.914091] drm_ioctl+0x24c/0x3b0 [drm]
|
||||
[ 110.914850] __arm64_sys_ioctl+0x9c/0xd4
|
||||
[ 110.914873] invoke_syscall+0x4c/0x114
|
||||
[ 110.914897] el0_svc_common+0xd0/0x118
|
||||
[ 110.914917] do_el0_svc+0x38/0xd0
|
||||
[ 110.914936] el0_svc+0x30/0x8c
|
||||
[ 110.914958] el0t_64_sync_handler+0x84/0xf0
|
||||
[ 110.914979] el0t_64_sync+0x18c/0x190
|
||||
[ 110.914996] ---[ end trace 0000000000000000 ]---
|
||||
|
||||
This happens because, although `prepare_fb` and `cleanup_fb` are
|
||||
perfectly balanced, we cannot guarantee consistency in the check
|
||||
plane->state->fb == state->fb. This means that sometimes we can increase
|
||||
the refcount in `prepare_fb` and don't decrease it in `cleanup_fb`. The
|
||||
opposite can also be true.
|
||||
|
||||
In fact, the struct drm_plane .state shouldn't be accessed directly
|
||||
but instead, the `drm_atomic_get_new_plane_state()` helper function should
|
||||
be used. So, we could stick to this check, but using
|
||||
`drm_atomic_get_new_plane_state()`. But actually, this check is not really
|
||||
needed. We can increase and decrease the refcount symmetrically without
|
||||
problems.
|
||||
|
||||
This is going to make the code more simple and consistent.
|
||||
|
||||
Signed-off-by: Maíra Canal <mcanal@igalia.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -2225,9 +2225,6 @@ static int vc4_prepare_fb(struct drm_pla
|
||||
|
||||
drm_gem_plane_helper_prepare_fb(plane, state);
|
||||
|
||||
- if (plane->state->fb == state->fb)
|
||||
- return 0;
|
||||
-
|
||||
return vc4_bo_inc_usecnt(bo);
|
||||
}
|
||||
|
||||
@@ -2236,7 +2233,7 @@ static void vc4_cleanup_fb(struct drm_pl
|
||||
{
|
||||
struct vc4_bo *bo;
|
||||
|
||||
- if (plane->state->fb == state->fb || !state->fb)
|
||||
+ if (!state->fb)
|
||||
return;
|
||||
|
||||
bo = to_vc4_bo(&drm_fb_dma_get_gem_obj(state->fb, 0)->base);
|
@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
|
||||
--- a/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>;
|
||||
#size-cells = <1>;
|
||||
|
||||
|
@ -40,7 +40,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
};
|
||||
|
||||
soc {
|
||||
@@ -531,6 +537,18 @@
|
||||
@@ -528,6 +534,18 @@
|
||||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
|
@ -21,7 +21,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi
|
||||
@@ -596,6 +596,7 @@
|
||||
@@ -593,6 +593,7 @@
|
||||
reg-names = "nand", "nand-int-base";
|
||||
interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "nand_ctlrdy";
|
||||
|
@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/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 {
|
||||
compatible = "brcm,bcm6345-gpio";
|
||||
reg-names = "dirout", "dat";
|
||||
|
@ -361,7 +361,7 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
|
||||
static void mem_cgroup_css_free(struct cgroup_subsys_state *css)
|
||||
--- a/mm/page_alloc.c
|
||||
+++ b/mm/page_alloc.c
|
||||
@@ -7943,6 +7943,7 @@ static void __init free_area_init_node(i
|
||||
@@ -7945,6 +7945,7 @@ static void __init free_area_init_node(i
|
||||
pgdat_set_deferred_range(pgdat);
|
||||
|
||||
free_area_init_core(pgdat);
|
||||
|
@ -142,7 +142,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.mac_link_down = prestera_mac_link_down,
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -654,7 +654,6 @@ static void mtk_mac_link_up(struct phyli
|
||||
@@ -653,7 +653,6 @@ static void mtk_mac_link_up(struct phyli
|
||||
}
|
||||
|
||||
static const struct phylink_mac_ops mtk_phylink_ops = {
|
||||
|
@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -4333,6 +4333,7 @@ static const struct mtk_soc_data mt7986_
|
||||
@@ -4332,6 +4332,7 @@ static const struct mtk_soc_data mt7986_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7986_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
|
@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -3480,11 +3480,8 @@ static void mtk_pending_work(struct work
|
||||
@@ -3479,11 +3479,8 @@ static void mtk_pending_work(struct work
|
||||
rtnl_lock();
|
||||
|
||||
dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
|
||||
@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
/* stop all devices to make sure that dma is properly shut down */
|
||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||
if (!eth->netdev[i])
|
||||
@@ -3518,7 +3515,7 @@ static void mtk_pending_work(struct work
|
||||
@@ -3517,7 +3514,7 @@ static void mtk_pending_work(struct work
|
||||
|
||||
dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);
|
||||
|
||||
|
@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -3256,6 +3256,27 @@ static void mtk_set_mcr_max_rx(struct mt
|
||||
@@ -3255,6 +3255,27 @@ static void mtk_set_mcr_max_rx(struct mt
|
||||
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
static int mtk_hw_init(struct mtk_eth *eth)
|
||||
{
|
||||
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
|
||||
@@ -3295,22 +3316,9 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3294,22 +3315,9 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -3277,7 +3277,54 @@ static void mtk_hw_reset(struct mtk_eth
|
||||
@@ -3276,7 +3276,54 @@ static void mtk_hw_reset(struct mtk_eth
|
||||
0x3ffffff);
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
{
|
||||
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
|
||||
ETHSYS_DMA_AG_MAP_PPE;
|
||||
@@ -3316,7 +3363,12 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3315,7 +3362,12 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||
/* Set FE to PDMAv2 if necessary */
|
||||
@@ -3507,7 +3559,7 @@ static void mtk_pending_work(struct work
|
||||
@@ -3506,7 +3558,7 @@ static void mtk_pending_work(struct work
|
||||
if (eth->dev->pins)
|
||||
pinctrl_select_state(eth->dev->pins->p,
|
||||
eth->dev->pins->default_state);
|
||||
@ -96,7 +96,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
/* restart DMA and enable IRQs */
|
||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||
@@ -4109,7 +4161,7 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4108,7 +4160,7 @@ static int mtk_probe(struct platform_dev
|
||||
eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE);
|
||||
INIT_WORK(ð->pending_work, mtk_pending_work);
|
||||
|
||||
|
@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -2844,14 +2844,29 @@ static void mtk_dma_free(struct mtk_eth
|
||||
@@ -2843,14 +2843,29 @@ static void mtk_dma_free(struct mtk_eth
|
||||
kfree(eth->scratch_head);
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
schedule_work(ð->pending_work);
|
||||
}
|
||||
|
||||
@@ -3331,15 +3346,17 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3330,15 +3345,17 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
|
||||
int i, val, ret;
|
||||
|
||||
@ -72,7 +72,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
if (eth->ethsys)
|
||||
regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, dma_mask,
|
||||
@@ -3468,8 +3485,10 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3467,8 +3484,10 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
return 0;
|
||||
|
||||
err_disable_pm:
|
||||
@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -3531,30 +3550,53 @@ static int mtk_do_ioctl(struct net_devic
|
||||
@@ -3530,30 +3549,53 @@ static int mtk_do_ioctl(struct net_devic
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
if (eth->dev->pins)
|
||||
pinctrl_select_state(eth->dev->pins->p,
|
||||
@@ -3565,15 +3607,19 @@ static void mtk_pending_work(struct work
|
||||
@@ -3564,15 +3606,19 @@ static void mtk_pending_work(struct work
|
||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||
if (!test_bit(i, &restart))
|
||||
continue;
|
||||
|
@ -49,7 +49,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
};
|
||||
|
||||
/* strings used by ethtool */
|
||||
@@ -3339,6 +3345,102 @@ static void mtk_hw_warm_reset(struct mtk
|
||||
@@ -3338,6 +3344,102 @@ static void mtk_hw_warm_reset(struct mtk
|
||||
val, rst_mask);
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
static int mtk_hw_init(struct mtk_eth *eth, bool reset)
|
||||
{
|
||||
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
|
||||
@@ -3657,6 +3759,7 @@ static int mtk_cleanup(struct mtk_eth *e
|
||||
@@ -3656,6 +3758,7 @@ static int mtk_cleanup(struct mtk_eth *e
|
||||
mtk_unreg_dev(eth);
|
||||
mtk_free_dev(eth);
|
||||
cancel_work_sync(ð->pending_work);
|
||||
@ -160,7 +160,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -4094,6 +4197,7 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4093,6 +4196,7 @@ static int mtk_probe(struct platform_dev
|
||||
|
||||
eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
|
||||
INIT_WORK(ð->rx_dim.work, mtk_dim_rx);
|
||||
@ -168,7 +168,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
|
||||
INIT_WORK(ð->tx_dim.work, mtk_dim_tx);
|
||||
@@ -4296,6 +4400,8 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4295,6 +4399,8 @@ static int mtk_probe(struct platform_dev
|
||||
netif_napi_add(ð->dummy_dev, ð->rx_napi, mtk_napi_rx);
|
||||
|
||||
platform_set_drvdata(pdev, eth);
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -3688,6 +3688,11 @@ static void mtk_pending_work(struct work
|
||||
@@ -3687,6 +3687,11 @@ static void mtk_pending_work(struct work
|
||||
set_bit(MTK_RESETTING, ð->state);
|
||||
|
||||
mtk_prepare_for_reset(eth);
|
||||
@ -26,7 +26,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
/* stop all devices to make sure that dma is properly shut down */
|
||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||
@@ -3725,6 +3730,8 @@ static void mtk_pending_work(struct work
|
||||
@@ -3724,6 +3729,8 @@ static void mtk_pending_work(struct work
|
||||
|
||||
clear_bit(MTK_RESETTING, ð->state);
|
||||
|
||||
|
@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -944,7 +944,7 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
@@ -943,7 +943,7 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
{
|
||||
const struct mtk_soc_data *soc = eth->soc;
|
||||
dma_addr_t phy_ring_tail;
|
||||
@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
dma_addr_t dma_addr;
|
||||
int i;
|
||||
|
||||
@@ -2208,19 +2208,25 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -2207,19 +2207,25 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||
int i, sz = soc->txrx.txd_size;
|
||||
struct mtk_tx_dma_v2 *txd;
|
||||
@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
u32 next_ptr = ring->phys + next * sz;
|
||||
|
||||
txd = ring->dma + i * sz;
|
||||
@@ -2240,22 +2246,22 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -2239,22 +2245,22 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
* descriptors in ring->dma_pdma.
|
||||
*/
|
||||
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
|
||||
@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ring->thresh = MAX_SKB_FRAGS;
|
||||
|
||||
/* make sure that all changes to the dma ring are flushed before we
|
||||
@@ -2267,14 +2273,14 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -2266,14 +2272,14 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
mtk_w32(eth, ring->phys, soc->reg_map->qdma.ctx_ptr);
|
||||
mtk_w32(eth, ring->phys, soc->reg_map->qdma.dtx_ptr);
|
||||
mtk_w32(eth,
|
||||
@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
mtk_w32(eth, 0, MT7628_TX_CTX_IDX0);
|
||||
mtk_w32(eth, MT7628_PST_DTX_IDX0, soc->reg_map->pdma.rst_idx);
|
||||
}
|
||||
@@ -2292,7 +2298,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
@@ -2291,7 +2297,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
int i;
|
||||
|
||||
if (ring->buf) {
|
||||
@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
mtk_tx_unmap(eth, &ring->buf[i], NULL, false);
|
||||
kfree(ring->buf);
|
||||
ring->buf = NULL;
|
||||
@@ -2300,14 +2306,14 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
@@ -2299,14 +2305,14 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
|
||||
if (ring->dma) {
|
||||
dma_free_coherent(eth->dma_dev,
|
||||
@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ring->dma_pdma, ring->phys_pdma);
|
||||
ring->dma_pdma = NULL;
|
||||
}
|
||||
@@ -2832,7 +2838,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||
@@ -2831,7 +2837,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||
netdev_reset_queue(eth->netdev[i]);
|
||||
if (eth->scratch_ring) {
|
||||
dma_free_coherent(eth->dma_dev,
|
||||
|
@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -4479,7 +4479,7 @@ static const struct mtk_soc_data mt7621_
|
||||
@@ -4478,7 +4478,7 @@ static const struct mtk_soc_data mt7621_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7621_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
.hash_offset = 2,
|
||||
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
||||
.txrx = {
|
||||
@@ -4518,7 +4518,7 @@ static const struct mtk_soc_data mt7623_
|
||||
@@ -4517,7 +4517,7 @@ static const struct mtk_soc_data mt7623_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7623_CLKS_BITMAP,
|
||||
.required_pctl = true,
|
||||
|
@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
},
|
||||
.gdm1_cnt = 0x1c00,
|
||||
.gdma_to_ppe = 0x3333,
|
||||
@@ -620,6 +624,75 @@ static void mtk_mac_link_down(struct phy
|
||||
@@ -619,6 +623,75 @@ static void mtk_mac_link_down(struct phy
|
||||
mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static void mtk_mac_link_up(struct phylink_config *config,
|
||||
struct phy_device *phy,
|
||||
unsigned int mode, phy_interface_t interface,
|
||||
@@ -645,6 +718,8 @@ static void mtk_mac_link_up(struct phyli
|
||||
@@ -644,6 +717,8 @@ static void mtk_mac_link_up(struct phyli
|
||||
break;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
/* Configure duplex */
|
||||
if (duplex == DUPLEX_FULL)
|
||||
mcr |= MAC_MCR_FORCE_DPX;
|
||||
@@ -1105,7 +1180,8 @@ static void mtk_tx_set_dma_desc_v1(struc
|
||||
@@ -1104,7 +1179,8 @@ static void mtk_tx_set_dma_desc_v1(struc
|
||||
|
||||
WRITE_ONCE(desc->txd1, info->addr);
|
||||
|
||||
@ -149,7 +149,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (info->last)
|
||||
data |= TX_DMA_LS0;
|
||||
WRITE_ONCE(desc->txd3, data);
|
||||
@@ -1139,9 +1215,6 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
@@ -1138,9 +1214,6 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
data |= TX_DMA_LS0;
|
||||
WRITE_ONCE(desc->txd3, data);
|
||||
|
||||
@ -159,7 +159,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
data = (mac->id + 1) << TX_DMA_FPORT_SHIFT_V2; /* forward port */
|
||||
data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
|
||||
WRITE_ONCE(desc->txd4, data);
|
||||
@@ -1185,11 +1258,12 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
@@ -1184,11 +1257,12 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
.gso = gso,
|
||||
.csum = skb->ip_summed == CHECKSUM_PARTIAL,
|
||||
.vlan = skb_vlan_tag_present(skb),
|
||||
@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
struct mtk_mac *mac = netdev_priv(dev);
|
||||
struct mtk_eth *eth = mac->hw;
|
||||
const struct mtk_soc_data *soc = eth->soc;
|
||||
@@ -1197,8 +1271,10 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
@@ -1196,8 +1270,10 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
struct mtk_tx_dma *itxd_pdma, *txd_pdma;
|
||||
struct mtk_tx_buf *itx_buf, *tx_buf;
|
||||
int i, n_desc = 1;
|
||||
@ -184,7 +184,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
itxd = ring->next_free;
|
||||
itxd_pdma = qdma_to_pdma(ring, itxd);
|
||||
if (itxd == ring->last_free)
|
||||
@@ -1247,7 +1323,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
@@ -1246,7 +1322,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
|
||||
txd_info.size = min_t(unsigned int, frag_size,
|
||||
soc->txrx.dma_max_len);
|
||||
@ -193,7 +193,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 &&
|
||||
!(frag_size - txd_info.size);
|
||||
txd_info.addr = skb_frag_dma_map(eth->dma_dev, frag,
|
||||
@@ -1286,7 +1362,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
@@ -1285,7 +1361,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
txd_pdma->txd2 |= TX_DMA_LS1;
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
skb_tx_timestamp(skb);
|
||||
|
||||
ring->next_free = mtk_qdma_phys_to_virt(ring, txd->txd2);
|
||||
@@ -1298,8 +1374,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
@@ -1297,8 +1373,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
wmb();
|
||||
|
||||
if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
|
||||
@ -212,7 +212,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
mtk_w32(eth, txd->txd2, soc->reg_map->qdma.ctx_ptr);
|
||||
} else {
|
||||
int next_idx;
|
||||
@@ -1368,7 +1443,7 @@ static void mtk_wake_queue(struct mtk_et
|
||||
@@ -1367,7 +1442,7 @@ static void mtk_wake_queue(struct mtk_et
|
||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||
if (!eth->netdev[i])
|
||||
continue;
|
||||
@ -221,7 +221,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1392,7 +1467,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||
@@ -1391,7 +1466,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||
|
||||
tx_num = mtk_cal_txd_req(eth, skb);
|
||||
if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
|
||||
@ -230,7 +230,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
netif_err(eth, tx_queued, dev,
|
||||
"Tx Ring full when queue awake!\n");
|
||||
spin_unlock(ð->page_lock);
|
||||
@@ -1418,7 +1493,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||
@@ -1417,7 +1492,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||
goto drop;
|
||||
|
||||
if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
|
||||
@ -239,7 +239,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
spin_unlock(ð->page_lock);
|
||||
|
||||
@@ -1585,10 +1660,12 @@ static int mtk_xdp_submit_frame(struct m
|
||||
@@ -1584,10 +1659,12 @@ static int mtk_xdp_submit_frame(struct m
|
||||
struct skb_shared_info *sinfo = xdp_get_shared_info_from_frame(xdpf);
|
||||
const struct mtk_soc_data *soc = eth->soc;
|
||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||
@ -252,7 +252,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
};
|
||||
int err, index = 0, n_desc = 1, nr_frags;
|
||||
struct mtk_tx_buf *htx_buf, *tx_buf;
|
||||
@@ -1638,6 +1715,7 @@ static int mtk_xdp_submit_frame(struct m
|
||||
@@ -1637,6 +1714,7 @@ static int mtk_xdp_submit_frame(struct m
|
||||
memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
|
||||
txd_info.size = skb_frag_size(&sinfo->frags[index]);
|
||||
txd_info.last = index + 1 == nr_frags;
|
||||
@ -260,7 +260,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
data = skb_frag_address(&sinfo->frags[index]);
|
||||
|
||||
index++;
|
||||
@@ -1992,8 +2070,46 @@ rx_done:
|
||||
@@ -1991,8 +2069,46 @@ rx_done:
|
||||
return done;
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
{
|
||||
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
|
||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||
@@ -2025,12 +2141,9 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
@@ -2024,12 +2140,9 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
break;
|
||||
|
||||
if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
|
||||
@ -323,7 +323,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
budget--;
|
||||
}
|
||||
mtk_tx_unmap(eth, tx_buf, &bq, true);
|
||||
@@ -2049,7 +2162,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
@@ -2048,7 +2161,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
}
|
||||
|
||||
static int mtk_poll_tx_pdma(struct mtk_eth *eth, int budget,
|
||||
@ -332,7 +332,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
{
|
||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||
struct mtk_tx_buf *tx_buf;
|
||||
@@ -2067,12 +2180,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
||||
@@ -2066,12 +2179,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
||||
break;
|
||||
|
||||
if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
|
||||
@ -347,7 +347,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
budget--;
|
||||
}
|
||||
mtk_tx_unmap(eth, tx_buf, &bq, true);
|
||||
@@ -2094,26 +2203,15 @@ static int mtk_poll_tx(struct mtk_eth *e
|
||||
@@ -2093,26 +2202,15 @@ static int mtk_poll_tx(struct mtk_eth *e
|
||||
{
|
||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||
struct dim_sample dim_sample = {};
|
||||
@ -379,7 +379,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
dim_update_sample(eth->tx_events, eth->tx_packets, eth->tx_bytes,
|
||||
&dim_sample);
|
||||
@@ -2123,7 +2221,7 @@ static int mtk_poll_tx(struct mtk_eth *e
|
||||
@@ -2122,7 +2220,7 @@ static int mtk_poll_tx(struct mtk_eth *e
|
||||
(atomic_read(&ring->free_count) > ring->thresh))
|
||||
mtk_wake_queue(eth);
|
||||
|
||||
@ -388,7 +388,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
|
||||
static void mtk_handle_status_irq(struct mtk_eth *eth)
|
||||
@@ -2209,6 +2307,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -2208,6 +2306,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
int i, sz = soc->txrx.txd_size;
|
||||
struct mtk_tx_dma_v2 *txd;
|
||||
int ring_size;
|
||||
@ -396,7 +396,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (MTK_HAS_CAPS(soc->caps, MTK_QDMA))
|
||||
ring_size = MTK_QDMA_RING_SIZE;
|
||||
@@ -2276,8 +2375,25 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -2275,8 +2374,25 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
ring->phys + ((ring_size - 1) * sz),
|
||||
soc->reg_map->qdma.crx_ptr);
|
||||
mtk_w32(eth, ring->last_free_ptr, soc->reg_map->qdma.drx_ptr);
|
||||
@ -424,7 +424,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
} else {
|
||||
mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0);
|
||||
mtk_w32(eth, ring_size, MT7628_TX_MAX_CNT0);
|
||||
@@ -2962,7 +3078,7 @@ static int mtk_start_dma(struct mtk_eth
|
||||
@@ -2961,7 +3077,7 @@ static int mtk_start_dma(struct mtk_eth
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
|
||||
val |= MTK_MUTLI_CNT | MTK_RESV_BUF |
|
||||
MTK_WCOMP_EN | MTK_DMAD_WR_WDONE |
|
||||
@ -433,7 +433,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
else
|
||||
val |= MTK_RX_BT_32DWORDS;
|
||||
mtk_w32(eth, val, reg_map->qdma.glo_cfg);
|
||||
@@ -3008,6 +3124,45 @@ static void mtk_gdm_config(struct mtk_et
|
||||
@@ -3007,6 +3123,45 @@ static void mtk_gdm_config(struct mtk_et
|
||||
mtk_w32(eth, 0, MTK_RST_GL);
|
||||
}
|
||||
|
||||
@ -479,7 +479,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static int mtk_open(struct net_device *dev)
|
||||
{
|
||||
struct mtk_mac *mac = netdev_priv(dev);
|
||||
@@ -3050,7 +3205,8 @@ static int mtk_open(struct net_device *d
|
||||
@@ -3049,7 +3204,8 @@ static int mtk_open(struct net_device *d
|
||||
refcount_inc(ð->dma_refcnt);
|
||||
|
||||
phylink_start(mac->phylink);
|
||||
@ -489,7 +489,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3759,8 +3915,12 @@ static int mtk_unreg_dev(struct mtk_eth
|
||||
@@ -3758,8 +3914,12 @@ static int mtk_unreg_dev(struct mtk_eth
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||
@ -502,7 +502,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
unregister_netdev(eth->netdev[i]);
|
||||
}
|
||||
|
||||
@@ -3977,6 +4137,23 @@ static int mtk_set_rxnfc(struct net_devi
|
||||
@@ -3976,6 +4136,23 @@ static int mtk_set_rxnfc(struct net_devi
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -526,7 +526,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static const struct ethtool_ops mtk_ethtool_ops = {
|
||||
.get_link_ksettings = mtk_get_link_ksettings,
|
||||
.set_link_ksettings = mtk_set_link_ksettings,
|
||||
@@ -4011,6 +4188,7 @@ static const struct net_device_ops mtk_n
|
||||
@@ -4010,6 +4187,7 @@ static const struct net_device_ops mtk_n
|
||||
.ndo_setup_tc = mtk_eth_setup_tc,
|
||||
.ndo_bpf = mtk_xdp,
|
||||
.ndo_xdp_xmit = mtk_xdp_xmit,
|
||||
@ -534,7 +534,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
};
|
||||
|
||||
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
|
||||
@@ -4020,6 +4198,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4019,6 +4197,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
struct phylink *phylink;
|
||||
struct mtk_mac *mac;
|
||||
int id, err;
|
||||
@ -542,7 +542,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (!_id) {
|
||||
dev_err(eth->dev, "missing mac id\n");
|
||||
@@ -4037,7 +4216,10 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4036,7 +4215,10 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -554,7 +554,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (!eth->netdev[id]) {
|
||||
dev_err(eth->dev, "alloc_etherdev failed\n");
|
||||
return -ENOMEM;
|
||||
@@ -4145,6 +4327,11 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4144,6 +4326,11 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
else
|
||||
eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN;
|
||||
|
||||
|
@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
#include "mtk_eth_soc.h"
|
||||
#include "mtk_wed.h"
|
||||
@@ -2021,16 +2022,22 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -2020,16 +2021,22 @@ static int mtk_poll_rx(struct napi_struc
|
||||
htons(RX_DMA_VPID(trxd.rxd4)),
|
||||
RX_DMA_VID(trxd.rxd4));
|
||||
} else if (trxd.rxd2 & RX_DMA_VTAG) {
|
||||
@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
|
||||
skb_record_rx_queue(skb, 0);
|
||||
@@ -2858,15 +2865,30 @@ static netdev_features_t mtk_fix_feature
|
||||
@@ -2857,15 +2864,30 @@ static netdev_features_t mtk_fix_feature
|
||||
|
||||
static int mtk_set_features(struct net_device *dev, netdev_features_t features)
|
||||
{
|
||||
@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
|
||||
/* wait for DMA to finish whatever it is doing before we start using it again */
|
||||
@@ -3163,11 +3185,45 @@ found:
|
||||
@@ -3162,11 +3184,45 @@ found:
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
|
||||
if (err) {
|
||||
@@ -3688,6 +3744,10 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3687,6 +3743,10 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
*/
|
||||
val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
|
||||
mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
|
||||
@ -146,7 +146,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
/* Enable RX VLan Offloading */
|
||||
mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
|
||||
@@ -3907,6 +3967,12 @@ static int mtk_free_dev(struct mtk_eth *
|
||||
@@ -3906,6 +3966,12 @@ static int mtk_free_dev(struct mtk_eth *
|
||||
free_netdev(eth->netdev[i]);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -3201,7 +3201,8 @@ static int mtk_open(struct net_device *d
|
||||
@@ -3200,7 +3200,8 @@ static int mtk_open(struct net_device *d
|
||||
struct mtk_eth *eth = mac->hw;
|
||||
int i, err;
|
||||
|
||||
@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) {
|
||||
struct metadata_dst *md_dst = eth->dsa_meta[i];
|
||||
|
||||
@@ -3218,7 +3219,8 @@ static int mtk_open(struct net_device *d
|
||||
@@ -3217,7 +3218,8 @@ static int mtk_open(struct net_device *d
|
||||
}
|
||||
} else {
|
||||
/* Hardware special tag parsing needs to be disabled if at least
|
||||
|
@ -23,7 +23,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -3136,7 +3136,7 @@ static void mtk_gdm_config(struct mtk_et
|
||||
@@ -3135,7 +3135,7 @@ static void mtk_gdm_config(struct mtk_et
|
||||
|
||||
val |= config;
|
||||
|
||||
@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
val |= MTK_GDMA_SPECIAL_TAG;
|
||||
|
||||
mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
|
||||
@@ -3201,8 +3201,7 @@ static int mtk_open(struct net_device *d
|
||||
@@ -3200,8 +3200,7 @@ static int mtk_open(struct net_device *d
|
||||
struct mtk_eth *eth = mac->hw;
|
||||
int i, err;
|
||||
|
||||
@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) {
|
||||
struct metadata_dst *md_dst = eth->dsa_meta[i];
|
||||
|
||||
@@ -3219,8 +3218,7 @@ static int mtk_open(struct net_device *d
|
||||
@@ -3218,8 +3217,7 @@ static int mtk_open(struct net_device *d
|
||||
}
|
||||
} else {
|
||||
/* Hardware special tag parsing needs to be disabled if at least
|
||||
|
@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1877,7 +1877,9 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1876,7 +1876,9 @@ static int mtk_poll_rx(struct napi_struc
|
||||
|
||||
while (done < budget) {
|
||||
unsigned int pktlen, *rxdcsum;
|
||||
@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
dma_addr_t dma_addr;
|
||||
u32 hash, reason;
|
||||
int mac = 0;
|
||||
@@ -2017,27 +2019,29 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -2016,27 +2018,29 @@ static int mtk_poll_rx(struct napi_struc
|
||||
|
||||
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -719,8 +719,6 @@ static void mtk_mac_link_up(struct phyli
|
||||
@@ -718,8 +718,6 @@ static void mtk_mac_link_up(struct phyli
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
mtk_eth_path_name(path), __func__, updated);
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -4803,6 +4803,26 @@ static const struct mtk_soc_data mt7629_
|
||||
@@ -4802,6 +4802,26 @@ static const struct mtk_soc_data mt7629_
|
||||
},
|
||||
};
|
||||
|
||||
@ -84,7 +84,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
static const struct mtk_soc_data mt7986_data = {
|
||||
.reg_map = &mt7986_reg_map,
|
||||
.ana_rgc3 = 0x128,
|
||||
@@ -4845,6 +4865,7 @@ const struct of_device_id of_mtk_match[]
|
||||
@@ -4844,6 +4864,7 @@ const struct of_device_id of_mtk_match[]
|
||||
{ .compatible = "mediatek,mt7622-eth", .data = &mt7622_data},
|
||||
{ .compatible = "mediatek,mt7623-eth", .data = &mt7623_data},
|
||||
{ .compatible = "mediatek,mt7629-eth", .data = &mt7629_data},
|
||||
|
@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -744,8 +744,10 @@ static const struct phylink_mac_ops mtk_
|
||||
@@ -743,8 +743,10 @@ static const struct phylink_mac_ops mtk_
|
||||
|
||||
static int mtk_mdio_init(struct mtk_eth *eth)
|
||||
{
|
||||
@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
mii_np = of_get_child_by_name(eth->dev->of_node, "mdio-bus");
|
||||
if (!mii_np) {
|
||||
@@ -772,6 +774,25 @@ static int mtk_mdio_init(struct mtk_eth
|
||||
@@ -771,6 +773,25 @@ static int mtk_mdio_init(struct mtk_eth
|
||||
eth->mii_bus->parent = eth->dev;
|
||||
|
||||
snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
|
||||
|
@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -4016,8 +4017,17 @@ static int mtk_unreg_dev(struct mtk_eth
|
||||
@@ -4015,8 +4016,17 @@ static int mtk_unreg_dev(struct mtk_eth
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
mtk_unreg_dev(eth);
|
||||
mtk_free_dev(eth);
|
||||
cancel_work_sync(ð->pending_work);
|
||||
@@ -4457,6 +4467,36 @@ void mtk_eth_set_dma_device(struct mtk_e
|
||||
@@ -4456,6 +4466,36 @@ void mtk_eth_set_dma_device(struct mtk_e
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
static int mtk_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res = NULL;
|
||||
@@ -4520,13 +4560,7 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4519,13 +4559,7 @@ static int mtk_probe(struct platform_dev
|
||||
}
|
||||
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SGMII)) {
|
||||
@ -130,7 +130,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
@@ -4537,14 +4571,17 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4536,14 +4570,17 @@ static int mtk_probe(struct platform_dev
|
||||
"mediatek,pctl");
|
||||
if (IS_ERR(eth->pctl)) {
|
||||
dev_err(&pdev->dev, "no pctl regmap found\n");
|
||||
@ -151,7 +151,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
}
|
||||
|
||||
if (eth->soc->offload_version) {
|
||||
@@ -4703,6 +4740,8 @@ err_deinit_hw:
|
||||
@@ -4702,6 +4739,8 @@ err_deinit_hw:
|
||||
mtk_hw_deinit(eth);
|
||||
err_wed_exit:
|
||||
mtk_wed_exit();
|
||||
|
@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -4691,8 +4691,8 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4690,8 +4690,8 @@ static int mtk_probe(struct platform_dev
|
||||
for (i = 0; i < num_ppe; i++) {
|
||||
u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400;
|
||||
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (!eth->ppe[i]) {
|
||||
err = -ENOMEM;
|
||||
goto err_deinit_ppe;
|
||||
@@ -4816,6 +4816,7 @@ static const struct mtk_soc_data mt7622_
|
||||
@@ -4815,6 +4815,7 @@ static const struct mtk_soc_data mt7622_
|
||||
.required_pctl = false,
|
||||
.offload_version = 2,
|
||||
.hash_offset = 2,
|
||||
@ -46,7 +46,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
||||
.txrx = {
|
||||
.txd_size = sizeof(struct mtk_tx_dma),
|
||||
@@ -4853,6 +4854,7 @@ static const struct mtk_soc_data mt7629_
|
||||
@@ -4852,6 +4853,7 @@ static const struct mtk_soc_data mt7629_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7629_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.txrx = {
|
||||
.txd_size = sizeof(struct mtk_tx_dma),
|
||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||
@@ -4873,6 +4875,7 @@ static const struct mtk_soc_data mt7981_
|
||||
@@ -4872,6 +4874,7 @@ static const struct mtk_soc_data mt7981_
|
||||
.offload_version = 2,
|
||||
.hash_offset = 4,
|
||||
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
||||
@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.txrx = {
|
||||
.txd_size = sizeof(struct mtk_tx_dma_v2),
|
||||
.rxd_size = sizeof(struct mtk_rx_dma_v2),
|
||||
@@ -4893,6 +4896,7 @@ static const struct mtk_soc_data mt7986_
|
||||
@@ -4892,6 +4895,7 @@ static const struct mtk_soc_data mt7986_
|
||||
.offload_version = 2,
|
||||
.hash_offset = 4,
|
||||
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1897,9 +1897,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1896,9 +1896,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
|
||||
while (done < budget) {
|
||||
unsigned int pktlen, *rxdcsum;
|
||||
@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
dma_addr_t dma_addr;
|
||||
u32 hash, reason;
|
||||
int mac = 0;
|
||||
@@ -2034,36 +2032,21 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -2033,36 +2031,21 @@ static int mtk_poll_rx(struct napi_struc
|
||||
skb_checksum_none_assert(skb);
|
||||
skb->protocol = eth_type_trans(skb, netdev);
|
||||
|
||||
@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
skb_record_rx_queue(skb, 0);
|
||||
napi_gro_receive(napi, skb);
|
||||
|
||||
@@ -2889,29 +2872,11 @@ static netdev_features_t mtk_fix_feature
|
||||
@@ -2888,29 +2871,11 @@ static netdev_features_t mtk_fix_feature
|
||||
|
||||
static int mtk_set_features(struct net_device *dev, netdev_features_t features)
|
||||
{
|
||||
@ -100,7 +100,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3225,30 +3190,6 @@ static int mtk_open(struct net_device *d
|
||||
@@ -3224,30 +3189,6 @@ static int mtk_open(struct net_device *d
|
||||
struct mtk_eth *eth = mac->hw;
|
||||
int i, err;
|
||||
|
||||
@ -131,7 +131,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
|
||||
if (err) {
|
||||
netdev_err(dev, "%s: could not attach PHY: %d\n", __func__,
|
||||
@@ -3287,6 +3228,35 @@ static int mtk_open(struct net_device *d
|
||||
@@ -3286,6 +3227,35 @@ static int mtk_open(struct net_device *d
|
||||
phylink_start(mac->phylink);
|
||||
netif_tx_start_all_queues(dev);
|
||||
|
||||
@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3771,10 +3741,9 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3770,10 +3740,9 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||
val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
|
||||
mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL);
|
||||
@ -180,7 +180,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
/* set interrupt delays based on current Net DIM sample */
|
||||
mtk_dim_rx(ð->rx_dim.work);
|
||||
@@ -4414,7 +4383,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4413,7 +4382,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
eth->netdev[id]->hw_features |= NETIF_F_LRO;
|
||||
|
||||
eth->netdev[id]->vlan_features = eth->soc->hw_features &
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -4765,7 +4765,7 @@ static const struct mtk_soc_data mt7621_
|
||||
@@ -4764,7 +4764,7 @@ static const struct mtk_soc_data mt7621_
|
||||
.required_pctl = false,
|
||||
.offload_version = 1,
|
||||
.hash_offset = 2,
|
||||
@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
.txrx = {
|
||||
.txd_size = sizeof(struct mtk_tx_dma),
|
||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||
@@ -4786,7 +4786,7 @@ static const struct mtk_soc_data mt7622_
|
||||
@@ -4785,7 +4785,7 @@ static const struct mtk_soc_data mt7622_
|
||||
.offload_version = 2,
|
||||
.hash_offset = 2,
|
||||
.has_accounting = true,
|
||||
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
.txrx = {
|
||||
.txd_size = sizeof(struct mtk_tx_dma),
|
||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||
@@ -4805,7 +4805,7 @@ static const struct mtk_soc_data mt7623_
|
||||
@@ -4804,7 +4804,7 @@ static const struct mtk_soc_data mt7623_
|
||||
.required_pctl = true,
|
||||
.offload_version = 1,
|
||||
.hash_offset = 2,
|
||||
@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
.txrx = {
|
||||
.txd_size = sizeof(struct mtk_tx_dma),
|
||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||
@@ -4843,8 +4843,8 @@ static const struct mtk_soc_data mt7981_
|
||||
@@ -4842,8 +4842,8 @@ static const struct mtk_soc_data mt7981_
|
||||
.required_pctl = false,
|
||||
.offload_version = 2,
|
||||
.hash_offset = 4,
|
||||
@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
.txrx = {
|
||||
.txd_size = sizeof(struct mtk_tx_dma_v2),
|
||||
.rxd_size = sizeof(struct mtk_rx_dma_v2),
|
||||
@@ -4864,8 +4864,8 @@ static const struct mtk_soc_data mt7986_
|
||||
@@ -4863,8 +4863,8 @@ static const struct mtk_soc_data mt7986_
|
||||
.required_pctl = false,
|
||||
.offload_version = 2,
|
||||
.hash_offset = 4,
|
||||
|
@ -95,7 +95,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
/* mt7623_pad_clk_setup */
|
||||
for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
|
||||
@@ -4342,13 +4314,19 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4341,13 +4313,19 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
|
||||
MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD;
|
||||
|
||||
@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_TRGMII) && !mac->id)
|
||||
__set_bit(PHY_INTERFACE_MODE_TRGMII,
|
||||
@@ -4806,6 +4784,7 @@ static const struct mtk_soc_data mt7623_
|
||||
@@ -4805,6 +4783,7 @@ static const struct mtk_soc_data mt7623_
|
||||
.offload_version = 1,
|
||||
.hash_offset = 2,
|
||||
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
|
||||
|
@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -555,38 +555,6 @@ static int mtk_mac_finish(struct phylink
|
||||
@@ -554,38 +554,6 @@ static int mtk_mac_finish(struct phylink
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
static void mtk_mac_link_down(struct phylink_config *config, unsigned int mode,
|
||||
phy_interface_t interface)
|
||||
{
|
||||
@@ -708,7 +676,6 @@ static void mtk_mac_link_up(struct phyli
|
||||
@@ -707,7 +675,6 @@ static void mtk_mac_link_up(struct phyli
|
||||
|
||||
static const struct phylink_mac_ops mtk_phylink_ops = {
|
||||
.mac_select_pcs = mtk_mac_select_pcs,
|
||||
@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
.mac_config = mtk_mac_config,
|
||||
.mac_finish = mtk_mac_finish,
|
||||
.mac_link_down = mtk_mac_link_down,
|
||||
@@ -4309,8 +4276,6 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4308,8 +4275,6 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
|
||||
mac->phylink_config.dev = ð->netdev[id]->dev;
|
||||
mac->phylink_config.type = PHYLINK_NETDEV;
|
||||
|
@ -23,7 +23,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -580,7 +580,7 @@ static void mtk_set_queue_speed(struct m
|
||||
@@ -579,7 +579,7 @@ static void mtk_set_queue_speed(struct m
|
||||
FIELD_PREP(MTK_QTX_SCH_MIN_RATE_MAN, 1) |
|
||||
FIELD_PREP(MTK_QTX_SCH_MIN_RATE_EXP, 4) |
|
||||
MTK_QTX_SCH_LEAKY_BUCKET_SIZE;
|
||||
@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
val |= MTK_QTX_SCH_LEAKY_BUCKET_EN;
|
||||
|
||||
if (IS_ENABLED(CONFIG_SOC_MT7621)) {
|
||||
@@ -955,7 +955,7 @@ static bool mtk_rx_get_desc(struct mtk_e
|
||||
@@ -954,7 +954,7 @@ static bool mtk_rx_get_desc(struct mtk_e
|
||||
rxd->rxd1 = READ_ONCE(dma_rxd->rxd1);
|
||||
rxd->rxd3 = READ_ONCE(dma_rxd->rxd3);
|
||||
rxd->rxd4 = READ_ONCE(dma_rxd->rxd4);
|
||||
@ -41,7 +41,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
rxd->rxd5 = READ_ONCE(dma_rxd->rxd5);
|
||||
rxd->rxd6 = READ_ONCE(dma_rxd->rxd6);
|
||||
}
|
||||
@@ -1013,7 +1013,7 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
@@ -1012,7 +1012,7 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
|
||||
txd->txd3 = TX_DMA_PLEN0(MTK_QDMA_PAGE_SIZE);
|
||||
txd->txd4 = 0;
|
||||
@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
txd->txd5 = 0;
|
||||
txd->txd6 = 0;
|
||||
txd->txd7 = 0;
|
||||
@@ -1204,7 +1204,7 @@ static void mtk_tx_set_dma_desc(struct n
|
||||
@@ -1203,7 +1203,7 @@ static void mtk_tx_set_dma_desc(struct n
|
||||
struct mtk_mac *mac = netdev_priv(dev);
|
||||
struct mtk_eth *eth = mac->hw;
|
||||
|
||||
@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
mtk_tx_set_dma_desc_v2(dev, txd, info);
|
||||
else
|
||||
mtk_tx_set_dma_desc_v1(dev, txd, info);
|
||||
@@ -1511,7 +1511,7 @@ static void mtk_update_rx_cpu_idx(struct
|
||||
@@ -1510,7 +1510,7 @@ static void mtk_update_rx_cpu_idx(struct
|
||||
|
||||
static bool mtk_page_pool_enabled(struct mtk_eth *eth)
|
||||
{
|
||||
@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
}
|
||||
|
||||
static struct page_pool *mtk_create_page_pool(struct mtk_eth *eth,
|
||||
@@ -1853,7 +1853,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1852,7 +1852,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
break;
|
||||
|
||||
/* find out which mac the packet come from. values start at 1 */
|
||||
@ -77,7 +77,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
mac = RX_DMA_GET_SPORT_V2(trxd.rxd5) - 1;
|
||||
else if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
|
||||
!(trxd.rxd4 & RX_DMA_SPECIAL_TAG))
|
||||
@@ -1949,7 +1949,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1948,7 +1948,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
skb->dev = netdev;
|
||||
bytes += skb->len;
|
||||
|
||||
@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
reason = FIELD_GET(MTK_RXD5_PPE_CPU_REASON, trxd.rxd5);
|
||||
hash = trxd.rxd5 & MTK_RXD5_FOE_ENTRY;
|
||||
if (hash != MTK_RXD5_FOE_ENTRY)
|
||||
@@ -1974,8 +1974,8 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1973,8 +1973,8 @@ static int mtk_poll_rx(struct napi_struc
|
||||
/* When using VLAN untagging in combination with DSA, the
|
||||
* hardware treats the MTK special tag as a VLAN and untags it.
|
||||
*/
|
||||
@ -97,7 +97,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
unsigned int port = RX_DMA_VPID(trxd.rxd3) & GENMASK(2, 0);
|
||||
|
||||
if (port < ARRAY_SIZE(eth->dsa_meta) &&
|
||||
@@ -2285,7 +2285,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -2284,7 +2284,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
txd->txd2 = next_ptr;
|
||||
txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
|
||||
txd->txd4 = 0;
|
||||
@ -106,7 +106,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
txd->txd5 = 0;
|
||||
txd->txd6 = 0;
|
||||
txd->txd7 = 0;
|
||||
@@ -2338,14 +2338,14 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -2337,14 +2337,14 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
FIELD_PREP(MTK_QTX_SCH_MIN_RATE_MAN, 1) |
|
||||
FIELD_PREP(MTK_QTX_SCH_MIN_RATE_EXP, 4) |
|
||||
MTK_QTX_SCH_LEAKY_BUCKET_SIZE;
|
||||
@ -123,7 +123,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
mtk_w32(eth, val, soc->reg_map->qdma.tx_sch_rate + 4);
|
||||
} else {
|
||||
mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0);
|
||||
@@ -2474,7 +2474,7 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
@@ -2473,7 +2473,7 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
|
||||
rxd->rxd3 = 0;
|
||||
rxd->rxd4 = 0;
|
||||
@ -132,7 +132,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
rxd->rxd5 = 0;
|
||||
rxd->rxd6 = 0;
|
||||
rxd->rxd7 = 0;
|
||||
@@ -3025,7 +3025,7 @@ static int mtk_start_dma(struct mtk_eth
|
||||
@@ -3024,7 +3024,7 @@ static int mtk_start_dma(struct mtk_eth
|
||||
MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO |
|
||||
MTK_RX_2B_OFFSET | MTK_TX_WB_DDONE;
|
||||
|
||||
@ -141,7 +141,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
val |= MTK_MUTLI_CNT | MTK_RESV_BUF |
|
||||
MTK_WCOMP_EN | MTK_DMAD_WR_WDONE |
|
||||
MTK_CHK_DDONE_EN | MTK_LEAKY_BUCKET_EN;
|
||||
@@ -3167,7 +3167,7 @@ static int mtk_open(struct net_device *d
|
||||
@@ -3166,7 +3166,7 @@ static int mtk_open(struct net_device *d
|
||||
phylink_start(mac->phylink);
|
||||
netif_tx_start_all_queues(dev);
|
||||
|
||||
@ -150,7 +150,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
return 0;
|
||||
|
||||
if (mtk_uses_dsa(dev) && !eth->prog) {
|
||||
@@ -3432,7 +3432,7 @@ static void mtk_hw_reset(struct mtk_eth
|
||||
@@ -3431,7 +3431,7 @@ static void mtk_hw_reset(struct mtk_eth
|
||||
{
|
||||
u32 val;
|
||||
|
||||
@ -159,7 +159,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
|
||||
val = RSTCTRL_PPE0_V2;
|
||||
} else {
|
||||
@@ -3444,7 +3444,7 @@ static void mtk_hw_reset(struct mtk_eth
|
||||
@@ -3443,7 +3443,7 @@ static void mtk_hw_reset(struct mtk_eth
|
||||
|
||||
ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
|
||||
|
||||
@ -168,7 +168,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
|
||||
0x3ffffff);
|
||||
}
|
||||
@@ -3470,7 +3470,7 @@ static void mtk_hw_warm_reset(struct mtk
|
||||
@@ -3469,7 +3469,7 @@ static void mtk_hw_warm_reset(struct mtk
|
||||
return;
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0_V2;
|
||||
else
|
||||
rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0;
|
||||
@@ -3640,7 +3640,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3639,7 +3639,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
else
|
||||
mtk_hw_reset(eth);
|
||||
|
||||
@ -186,7 +186,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
/* Set FE to PDMAv2 if necessary */
|
||||
val = mtk_r32(eth, MTK_FE_GLO_MISC);
|
||||
mtk_w32(eth, val | BIT(4), MTK_FE_GLO_MISC);
|
||||
@@ -3677,7 +3677,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3676,7 +3676,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
*/
|
||||
val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
|
||||
mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
|
||||
@ -195,7 +195,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
|
||||
mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL);
|
||||
|
||||
@@ -3699,7 +3699,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3698,7 +3698,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4);
|
||||
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
|
||||
|
||||
@ -204,7 +204,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
/* PSE should not drop port8 and port9 packets from WDMA Tx */
|
||||
mtk_w32(eth, 0x00000300, PSE_DROP_CFG);
|
||||
|
||||
@@ -4488,7 +4488,7 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4487,7 +4487,7 @@ static int mtk_probe(struct platform_dev
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!res) {
|
||||
err = -EINVAL;
|
||||
@@ -4596,9 +4596,8 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4595,9 +4595,8 @@ static int mtk_probe(struct platform_dev
|
||||
}
|
||||
|
||||
if (eth->soc->offload_version) {
|
||||
@ -224,7 +224,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
num_ppe = min_t(u32, ARRAY_SIZE(eth->ppe), num_ppe);
|
||||
for (i = 0; i < num_ppe; i++) {
|
||||
u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400;
|
||||
@@ -4690,6 +4689,7 @@ static const struct mtk_soc_data mt2701_
|
||||
@@ -4689,6 +4688,7 @@ static const struct mtk_soc_data mt2701_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7623_CLKS_BITMAP,
|
||||
.required_pctl = true,
|
||||
@ -232,7 +232,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.txrx = {
|
||||
.txd_size = sizeof(struct mtk_tx_dma),
|
||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||
@@ -4706,6 +4706,7 @@ static const struct mtk_soc_data mt7621_
|
||||
@@ -4705,6 +4705,7 @@ static const struct mtk_soc_data mt7621_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7621_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.offload_version = 1,
|
||||
.hash_offset = 2,
|
||||
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
|
||||
@@ -4726,6 +4727,7 @@ static const struct mtk_soc_data mt7622_
|
||||
@@ -4725,6 +4726,7 @@ static const struct mtk_soc_data mt7622_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7622_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
@ -248,7 +248,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.offload_version = 2,
|
||||
.hash_offset = 2,
|
||||
.has_accounting = true,
|
||||
@@ -4746,6 +4748,7 @@ static const struct mtk_soc_data mt7623_
|
||||
@@ -4745,6 +4747,7 @@ static const struct mtk_soc_data mt7623_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7623_CLKS_BITMAP,
|
||||
.required_pctl = true,
|
||||
@ -256,7 +256,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.offload_version = 1,
|
||||
.hash_offset = 2,
|
||||
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
|
||||
@@ -4768,6 +4771,7 @@ static const struct mtk_soc_data mt7629_
|
||||
@@ -4767,6 +4770,7 @@ static const struct mtk_soc_data mt7629_
|
||||
.required_clks = MT7629_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
.has_accounting = true,
|
||||
@ -264,7 +264,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.txrx = {
|
||||
.txd_size = sizeof(struct mtk_tx_dma),
|
||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||
@@ -4785,6 +4789,7 @@ static const struct mtk_soc_data mt7981_
|
||||
@@ -4784,6 +4788,7 @@ static const struct mtk_soc_data mt7981_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7981_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
@ -272,7 +272,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.offload_version = 2,
|
||||
.hash_offset = 4,
|
||||
.has_accounting = true,
|
||||
@@ -4806,6 +4811,7 @@ static const struct mtk_soc_data mt7986_
|
||||
@@ -4805,6 +4810,7 @@ static const struct mtk_soc_data mt7986_
|
||||
.hw_features = MTK_HW_FEATURES,
|
||||
.required_clks = MT7986_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
@ -280,7 +280,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
.offload_version = 2,
|
||||
.hash_offset = 4,
|
||||
.has_accounting = true,
|
||||
@@ -4826,6 +4832,7 @@ static const struct mtk_soc_data rt5350_
|
||||
@@ -4825,6 +4831,7 @@ static const struct mtk_soc_data rt5350_
|
||||
.hw_features = MTK_HW_FEATURES_MT7628,
|
||||
.required_clks = MT7628_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
@ -491,7 +491,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
else
|
||||
val = MTK_FOE_IB2_MIB_CNT;
|
||||
@@ -965,7 +965,7 @@ 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,
|
||||
MTK_PPE_ENTRIES_SHIFT);
|
||||
- if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2))
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -881,7 +881,7 @@ static void mtk_stats_update(struct mtk_
|
||||
@@ -880,7 +880,7 @@ static void mtk_stats_update(struct mtk_
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (!eth->mac[i] || !eth->mac[i]->hw_stats)
|
||||
continue;
|
||||
if (spin_trylock(ð->mac[i]->hw_stats->stats_lock)) {
|
||||
@@ -1386,7 +1386,7 @@ static int mtk_queue_stopped(struct mtk_
|
||||
@@ -1385,7 +1385,7 @@ static int mtk_queue_stopped(struct mtk_
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -35,7 +35,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (!eth->netdev[i])
|
||||
continue;
|
||||
if (netif_queue_stopped(eth->netdev[i]))
|
||||
@@ -1400,7 +1400,7 @@ static void mtk_wake_queue(struct mtk_et
|
||||
@@ -1399,7 +1399,7 @@ static void mtk_wake_queue(struct mtk_et
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -44,7 +44,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (!eth->netdev[i])
|
||||
continue;
|
||||
netif_tx_wake_all_queues(eth->netdev[i]);
|
||||
@@ -1859,7 +1859,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1858,7 +1858,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
!(trxd.rxd4 & RX_DMA_SPECIAL_TAG))
|
||||
mac = RX_DMA_GET_SPORT(trxd.rxd4) - 1;
|
||||
|
||||
@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
!eth->netdev[mac]))
|
||||
goto release_desc;
|
||||
|
||||
@@ -2899,7 +2899,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||
@@ -2898,7 +2898,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||
const struct mtk_soc_data *soc = eth->soc;
|
||||
int i;
|
||||
|
||||
@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (eth->netdev[i])
|
||||
netdev_reset_queue(eth->netdev[i]);
|
||||
if (eth->scratch_ring) {
|
||||
@@ -3053,8 +3053,13 @@ static void mtk_gdm_config(struct mtk_et
|
||||
@@ -3052,8 +3052,13 @@ static void mtk_gdm_config(struct mtk_et
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
|
||||
return;
|
||||
|
||||
@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
/* default setup the forward port to send frame to PDMA */
|
||||
val &= ~0xffff;
|
||||
@@ -3064,7 +3069,7 @@ static void mtk_gdm_config(struct mtk_et
|
||||
@@ -3063,7 +3068,7 @@ static void mtk_gdm_config(struct mtk_et
|
||||
|
||||
val |= config;
|
||||
|
||||
@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
val |= MTK_GDMA_SPECIAL_TAG;
|
||||
|
||||
mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
|
||||
@@ -3661,15 +3666,15 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3660,15 +3665,15 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
* up with the more appropriate value when mtk_mac_config call is being
|
||||
* invoked.
|
||||
*/
|
||||
@ -109,7 +109,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
}
|
||||
|
||||
/* Indicates CDM to parse the MTK special tag from CPU
|
||||
@@ -3849,7 +3854,7 @@ static void mtk_pending_work(struct work
|
||||
@@ -3848,7 +3853,7 @@ static void mtk_pending_work(struct work
|
||||
mtk_prepare_for_reset(eth);
|
||||
|
||||
/* stop all devices to make sure that dma is properly shut down */
|
||||
@ -118,7 +118,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (!eth->netdev[i] || !netif_running(eth->netdev[i]))
|
||||
continue;
|
||||
|
||||
@@ -3865,8 +3870,8 @@ static void mtk_pending_work(struct work
|
||||
@@ -3864,8 +3869,8 @@ static void mtk_pending_work(struct work
|
||||
mtk_hw_init(eth, true);
|
||||
|
||||
/* restart DMA and enable IRQs */
|
||||
@ -129,7 +129,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
continue;
|
||||
|
||||
if (mtk_open(eth->netdev[i])) {
|
||||
@@ -3893,7 +3898,7 @@ static int mtk_free_dev(struct mtk_eth *
|
||||
@@ -3892,7 +3897,7 @@ static int mtk_free_dev(struct mtk_eth *
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -138,7 +138,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (!eth->netdev[i])
|
||||
continue;
|
||||
free_netdev(eth->netdev[i]);
|
||||
@@ -3912,7 +3917,7 @@ static int mtk_unreg_dev(struct mtk_eth
|
||||
@@ -3911,7 +3916,7 @@ static int mtk_unreg_dev(struct mtk_eth
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -147,7 +147,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
struct mtk_mac *mac;
|
||||
if (!eth->netdev[i])
|
||||
continue;
|
||||
@@ -4213,7 +4218,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4212,7 +4217,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
}
|
||||
|
||||
id = be32_to_cpup(_id);
|
||||
@ -156,7 +156,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
dev_err(eth->dev, "%d is not a valid mac id\n", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -4358,7 +4363,7 @@ void mtk_eth_set_dma_device(struct mtk_e
|
||||
@@ -4357,7 +4362,7 @@ void mtk_eth_set_dma_device(struct mtk_e
|
||||
|
||||
rtnl_lock();
|
||||
|
||||
@ -165,7 +165,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
dev = eth->netdev[i];
|
||||
|
||||
if (!dev || !(dev->flags & IFF_UP))
|
||||
@@ -4664,7 +4669,7 @@ static int mtk_remove(struct platform_de
|
||||
@@ -4663,7 +4668,7 @@ static int mtk_remove(struct platform_de
|
||||
int i;
|
||||
|
||||
/* stop all devices to make sure that dma is properly shut down */
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -861,17 +861,32 @@ void mtk_stats_update_mac(struct mtk_mac
|
||||
@@ -860,17 +860,32 @@ void mtk_stats_update_mac(struct mtk_mac
|
||||
mtk_r32(mac->hw, reg_map->gdm1_cnt + 0x20 + offs);
|
||||
hw_stats->rx_flow_control_packets +=
|
||||
mtk_r32(mac->hw, reg_map->gdm1_cnt + 0x24 + offs);
|
||||
@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
}
|
||||
|
||||
u64_stats_update_end(&hw_stats->syncp);
|
||||
@@ -1175,7 +1190,10 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
@@ -1174,7 +1189,10 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
data |= TX_DMA_LS0;
|
||||
WRITE_ONCE(desc->txd3, data);
|
||||
|
||||
@ -74,7 +74,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
|
||||
WRITE_ONCE(desc->txd4, data);
|
||||
|
||||
@@ -1186,6 +1204,8 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
@@ -1185,6 +1203,8 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
/* tx checksum offload */
|
||||
if (info->csum)
|
||||
data |= TX_DMA_CHKSUM_V2;
|
||||
@ -83,7 +83,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
}
|
||||
WRITE_ONCE(desc->txd5, data);
|
||||
|
||||
@@ -1251,8 +1271,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
@@ -1250,8 +1270,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
mtk_tx_set_dma_desc(dev, itxd, &txd_info);
|
||||
|
||||
itx_buf->flags |= MTK_TX_FLAGS_SINGLE0;
|
||||
@ -93,7 +93,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
setup_tx_buf(eth, itx_buf, itxd_pdma, txd_info.addr, txd_info.size,
|
||||
k++);
|
||||
|
||||
@@ -1300,8 +1319,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
@@ -1299,8 +1318,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||
memset(tx_buf, 0, sizeof(*tx_buf));
|
||||
tx_buf->data = (void *)MTK_DMA_DUMMY_DESC;
|
||||
tx_buf->flags |= MTK_TX_FLAGS_PAGE0;
|
||||
@ -103,7 +103,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
setup_tx_buf(eth, tx_buf, txd_pdma, txd_info.addr,
|
||||
txd_info.size, k++);
|
||||
@@ -1603,7 +1621,7 @@ static int mtk_xdp_frame_map(struct mtk_
|
||||
@@ -1602,7 +1620,7 @@ static int mtk_xdp_frame_map(struct mtk_
|
||||
}
|
||||
mtk_tx_set_dma_desc(dev, txd, txd_info);
|
||||
|
||||
@ -112,7 +112,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
tx_buf->type = dma_map ? MTK_TYPE_XDP_NDO : MTK_TYPE_XDP_TX;
|
||||
tx_buf->data = (void *)MTK_DMA_DUMMY_DESC;
|
||||
|
||||
@@ -1853,11 +1871,24 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1852,11 +1870,24 @@ static int mtk_poll_rx(struct napi_struc
|
||||
break;
|
||||
|
||||
/* find out which mac the packet come from. values start at 1 */
|
||||
@ -141,7 +141,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
if (unlikely(mac < 0 || mac >= MTK_MAX_DEVS ||
|
||||
!eth->netdev[mac]))
|
||||
@@ -2079,7 +2110,6 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
@@ -2078,7 +2109,6 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
|
||||
while ((cpu != dma) && budget) {
|
||||
u32 next_cpu = desc->txd2;
|
||||
@ -149,7 +149,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
desc = mtk_qdma_phys_to_virt(ring, desc->txd2);
|
||||
if ((desc->txd3 & TX_DMA_OWNER_CPU) == 0)
|
||||
@@ -2087,15 +2117,13 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
@@ -2086,15 +2116,13 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||
|
||||
tx_buf = mtk_desc_to_tx_buf(ring, desc,
|
||||
eth->soc->txrx.txd_size);
|
||||
@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
budget--;
|
||||
}
|
||||
@@ -3704,7 +3732,24 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
@@ -3703,7 +3731,24 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||
mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4);
|
||||
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
|
||||
|
||||
@ -193,7 +193,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
/* PSE should not drop port8 and port9 packets from WDMA Tx */
|
||||
mtk_w32(eth, 0x00000300, PSE_DROP_CFG);
|
||||
|
||||
@@ -4266,7 +4311,11 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4265,7 +4310,11 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
}
|
||||
spin_lock_init(&mac->hw_stats->stats_lock);
|
||||
u64_stats_init(&mac->hw_stats->syncp);
|
||||
|
@ -219,7 +219,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
return;
|
||||
|
||||
err_phy:
|
||||
@@ -725,11 +841,15 @@ static int mtk_mdio_init(struct mtk_eth
|
||||
@@ -724,11 +840,15 @@ static int mtk_mdio_init(struct mtk_eth
|
||||
}
|
||||
divider = min_t(unsigned int, DIV_ROUND_UP(MDC_MAX_FREQ, max_clk), 63);
|
||||
|
||||
@ -239,7 +239,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
dev_dbg(eth->dev, "MDC is running on %d Hz\n", MDC_MAX_FREQ / divider);
|
||||
|
||||
@@ -1190,10 +1310,19 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
@@ -1189,10 +1309,19 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
data |= TX_DMA_LS0;
|
||||
WRITE_ONCE(desc->txd3, data);
|
||||
|
||||
@ -263,7 +263,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
|
||||
WRITE_ONCE(desc->txd4, data);
|
||||
|
||||
@@ -4360,6 +4489,17 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4359,6 +4488,17 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
mac->phylink_config.supported_interfaces);
|
||||
}
|
||||
|
||||
@ -281,7 +281,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
phylink = phylink_create(&mac->phylink_config,
|
||||
of_fwnode_handle(mac->of_node),
|
||||
phy_mode, &mtk_phylink_ops);
|
||||
@@ -4880,6 +5020,24 @@ static const struct mtk_soc_data mt7986_
|
||||
@@ -4879,6 +5019,24 @@ static const struct mtk_soc_data mt7986_
|
||||
},
|
||||
};
|
||||
|
||||
@ -306,7 +306,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
static const struct mtk_soc_data rt5350_data = {
|
||||
.reg_map = &mt7628_reg_map,
|
||||
.caps = MT7628_CAPS,
|
||||
@@ -4898,14 +5056,15 @@ static const struct mtk_soc_data rt5350_
|
||||
@@ -4897,14 +5055,15 @@ static const struct mtk_soc_data rt5350_
|
||||
};
|
||||
|
||||
const struct of_device_id of_mtk_match[] = {
|
||||
|
@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1658,7 +1658,7 @@ static void mtk_update_rx_cpu_idx(struct
|
||||
@@ -1657,7 +1657,7 @@ static void mtk_update_rx_cpu_idx(struct
|
||||
|
||||
static bool mtk_page_pool_enabled(struct mtk_eth *eth)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -5028,6 +5028,9 @@ static const struct mtk_soc_data mt7988_
|
||||
@@ -5027,6 +5027,9 @@ static const struct mtk_soc_data mt7988_
|
||||
.required_clks = MT7988_CLKS_BITMAP,
|
||||
.required_pctl = false,
|
||||
.version = 3,
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -5030,6 +5030,7 @@ static const struct mtk_soc_data mt7988_
|
||||
@@ -5029,6 +5029,7 @@ static const struct mtk_soc_data mt7988_
|
||||
.version = 3,
|
||||
.offload_version = 2,
|
||||
.hash_offset = 4,
|
||||
|
@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -3594,19 +3594,34 @@ static void mtk_hw_reset(struct mtk_eth
|
||||
@@ -3593,19 +3593,34 @@ static void mtk_hw_reset(struct mtk_eth
|
||||
{
|
||||
u32 val;
|
||||
|
||||
@ -56,7 +56,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
|
||||
0x3ffffff);
|
||||
}
|
||||
@@ -3632,13 +3647,21 @@ static void mtk_hw_warm_reset(struct mtk
|
||||
@@ -3631,13 +3646,21 @@ static void mtk_hw_warm_reset(struct mtk
|
||||
return;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, rst_mask, rst_mask);
|
||||
|
||||
@@ -3990,11 +4013,17 @@ static void mtk_prepare_for_reset(struct
|
||||
@@ -3989,11 +4012,17 @@ static void mtk_prepare_for_reset(struct
|
||||
u32 val;
|
||||
int i;
|
||||
|
||||
@ -106,7 +106,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
/* adjust PPE configurations to prepare for reset */
|
||||
for (i = 0; i < ARRAY_SIZE(eth->ppe); i++)
|
||||
@@ -4055,11 +4084,18 @@ static void mtk_pending_work(struct work
|
||||
@@ -4054,11 +4083,18 @@ static void mtk_pending_work(struct work
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1118,10 +1118,13 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
@@ -1117,10 +1117,13 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||
dma_addr_t dma_addr;
|
||||
int i;
|
||||
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (unlikely(!eth->scratch_ring))
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2429,8 +2432,14 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
@@ -2428,8 +2431,14 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||
if (!ring->buf)
|
||||
goto no_tx_mem;
|
||||
|
||||
@ -55,7 +55,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (!ring->dma)
|
||||
goto no_tx_mem;
|
||||
|
||||
@@ -2529,8 +2538,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
@@ -2528,8 +2537,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||
kfree(ring->buf);
|
||||
ring->buf = NULL;
|
||||
}
|
||||
@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
dma_free_coherent(eth->dma_dev,
|
||||
ring->dma_size * soc->txrx.txd_size,
|
||||
ring->dma, ring->phys);
|
||||
@@ -2549,9 +2557,14 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
@@ -2548,9 +2556,14 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
{
|
||||
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
|
||||
struct mtk_rx_ring *ring;
|
||||
@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (rx_flag == MTK_RX_FLAGS_QDMA) {
|
||||
if (ring_no)
|
||||
return -EINVAL;
|
||||
@@ -2586,9 +2599,20 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
@@ -2585,9 +2598,20 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
ring->page_pool = pp;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
if (!ring->dma)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2673,7 +2697,7 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
@@ -2672,7 +2696,7 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2696,7 +2720,7 @@ static void mtk_rx_clean(struct mtk_eth
|
||||
@@ -2695,7 +2719,7 @@ static void mtk_rx_clean(struct mtk_eth
|
||||
ring->data = NULL;
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
dma_free_coherent(eth->dma_dev,
|
||||
ring->dma_size * eth->soc->txrx.rxd_size,
|
||||
ring->dma, ring->phys);
|
||||
@@ -3059,7 +3083,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||
@@ -3058,7 +3082,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||
for (i = 0; i < MTK_MAX_DEVS; i++)
|
||||
if (eth->netdev[i])
|
||||
netdev_reset_queue(eth->netdev[i]);
|
||||
@ -132,7 +132,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
dma_free_coherent(eth->dma_dev,
|
||||
MTK_QDMA_RING_SIZE * soc->txrx.txd_size,
|
||||
eth->scratch_ring, eth->phy_scratch_ring);
|
||||
@@ -3067,13 +3091,13 @@ static void mtk_dma_free(struct mtk_eth
|
||||
@@ -3066,13 +3090,13 @@ static void mtk_dma_free(struct mtk_eth
|
||||
eth->phy_scratch_ring = 0;
|
||||
}
|
||||
mtk_tx_clean(eth);
|
||||
@ -149,7 +149,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
}
|
||||
|
||||
kfree(eth->scratch_head);
|
||||
@@ -4641,7 +4665,7 @@ static int mtk_sgmii_init(struct mtk_eth
|
||||
@@ -4640,7 +4664,7 @@ static int mtk_sgmii_init(struct mtk_eth
|
||||
|
||||
static int mtk_probe(struct platform_device *pdev)
|
||||
{
|
||||
@ -158,7 +158,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
struct device_node *mac_np;
|
||||
struct mtk_eth *eth;
|
||||
int err, i;
|
||||
@@ -4661,6 +4685,20 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4660,6 +4684,20 @@ static int mtk_probe(struct platform_dev
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
|
||||
eth->ip_align = NET_IP_ALIGN;
|
||||
|
||||
@ -179,7 +179,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
spin_lock_init(ð->page_lock);
|
||||
spin_lock_init(ð->tx_irq_lock);
|
||||
spin_lock_init(ð->rx_irq_lock);
|
||||
@@ -4724,6 +4762,18 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4723,6 +4761,18 @@ static int mtk_probe(struct platform_dev
|
||||
err = -EINVAL;
|
||||
goto err_destroy_sgmii;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1311,6 +1311,10 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
@@ -1310,6 +1310,10 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||
data = TX_DMA_PLEN0(info->size);
|
||||
if (info->last)
|
||||
data |= TX_DMA_LS0;
|
||||
@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
WRITE_ONCE(desc->txd3, data);
|
||||
|
||||
/* set forward port */
|
||||
@@ -1980,6 +1984,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1979,6 +1983,7 @@ static int mtk_poll_rx(struct napi_struc
|
||||
bool xdp_flush = false;
|
||||
int idx;
|
||||
struct sk_buff *skb;
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
u8 *data, *new_data;
|
||||
struct mtk_rx_dma_v2 *rxd, trxd;
|
||||
int done = 0, bytes = 0;
|
||||
@@ -2095,7 +2100,10 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -2094,7 +2099,10 @@ static int mtk_poll_rx(struct napi_struc
|
||||
goto release_desc;
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
ring->buf_size, DMA_FROM_DEVICE);
|
||||
|
||||
skb = build_skb(data, ring->frag_size);
|
||||
@@ -2161,6 +2169,9 @@ release_desc:
|
||||
@@ -2160,6 +2168,9 @@ release_desc:
|
||||
else
|
||||
rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
|
||||
|
||||
@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
ring->calc_idx = idx;
|
||||
done++;
|
||||
}
|
||||
@@ -2653,6 +2664,9 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
@@ -2652,6 +2663,9 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
else
|
||||
rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
|
||||
|
||||
@ -70,7 +70,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
rxd->rxd3 = 0;
|
||||
rxd->rxd4 = 0;
|
||||
if (mtk_is_netsys_v2_or_greater(eth)) {
|
||||
@@ -2699,6 +2713,7 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
@@ -2698,6 +2712,7 @@ static int mtk_rx_alloc(struct mtk_eth *
|
||||
|
||||
static void mtk_rx_clean(struct mtk_eth *eth, struct mtk_rx_ring *ring, bool in_sram)
|
||||
{
|
||||
@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
int i;
|
||||
|
||||
if (ring->data && ring->dma) {
|
||||
@@ -2712,7 +2727,10 @@ static void mtk_rx_clean(struct mtk_eth
|
||||
@@ -2711,7 +2726,10 @@ static void mtk_rx_clean(struct mtk_eth
|
||||
if (!rxd->rxd1)
|
||||
continue;
|
||||
|
||||
@ -90,7 +90,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
ring->buf_size, DMA_FROM_DEVICE);
|
||||
mtk_rx_put_buff(ring, ring->data[i], false);
|
||||
}
|
||||
@@ -4699,6 +4717,14 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4698,6 +4716,14 @@ static int mtk_probe(struct platform_dev
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -1988,11 +1988,11 @@ static int mtk_poll_rx(struct napi_struc
|
||||
@@ -1987,11 +1987,11 @@ static int mtk_poll_rx(struct napi_struc
|
||||
u8 *data, *new_data;
|
||||
struct mtk_rx_dma_v2 *rxd, trxd;
|
||||
int done = 0, bytes = 0;
|
||||
@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
u32 hash, reason;
|
||||
int mac = 0;
|
||||
|
||||
@@ -2169,7 +2169,8 @@ release_desc:
|
||||
@@ -2168,7 +2168,8 @@ release_desc:
|
||||
else
|
||||
rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
|
||||
|
||||
|
@ -1,172 +0,0 @@
|
||||
From be4512b9ac6fc53e1ca8daccbda84f643215c547 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
|
||||
Date: Thu, 14 Mar 2024 12:28:35 +0300
|
||||
Subject: [PATCH 1/3] net: dsa: mt7530: prevent possible incorrect XTAL
|
||||
frequency selection
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
[ Upstream commit f490c492e946d8ffbe65ad4efc66de3c5ede30a4 ]
|
||||
|
||||
On MT7530, the HT_XTAL_FSEL field of the HWTRAP register stores a 2-bit
|
||||
value that represents the frequency of the crystal oscillator connected to
|
||||
the switch IC. The field is populated by the state of the ESW_P4_LED_0 and
|
||||
ESW_P4_LED_0 pins, which is done right after reset is deasserted.
|
||||
|
||||
ESW_P4_LED_0 ESW_P3_LED_0 Frequency
|
||||
-----------------------------------------
|
||||
0 0 Reserved
|
||||
0 1 20MHz
|
||||
1 0 40MHz
|
||||
1 1 25MHz
|
||||
|
||||
On MT7531, the XTAL25 bit of the STRAP register stores this. The LAN0LED0
|
||||
pin is used to populate the bit. 25MHz when the pin is high, 40MHz when
|
||||
it's low.
|
||||
|
||||
These pins are also used with LEDs, therefore, their state can be set to
|
||||
something other than the bootstrapping configuration. For example, a link
|
||||
may be established on port 3 before the DSA subdriver takes control of the
|
||||
switch which would set ESW_P3_LED_0 to high.
|
||||
|
||||
Currently on mt7530_setup() and mt7531_setup(), 1000 - 1100 usec delay is
|
||||
described between reset assertion and deassertion. Some switch ICs in real
|
||||
life conditions cannot always have these pins set back to the bootstrapping
|
||||
configuration before reset deassertion in this amount of delay. This causes
|
||||
wrong crystal frequency to be selected which puts the switch in a
|
||||
nonfunctional state after reset deassertion.
|
||||
|
||||
The tests below are conducted on an MT7530 with a 40MHz crystal oscillator
|
||||
by Justin Swartz.
|
||||
|
||||
With a cable from an active peer connected to port 3 before reset, an
|
||||
incorrect crystal frequency (0b11 = 25MHz) is selected:
|
||||
|
||||
[1] [3] [5]
|
||||
: : :
|
||||
_____________________________ __________________
|
||||
ESW_P4_LED_0 |_______|
|
||||
_____________________________
|
||||
ESW_P3_LED_0 |__________________________
|
||||
|
||||
: : : :
|
||||
: : [4]...:
|
||||
: :
|
||||
[2]................:
|
||||
|
||||
[1] Reset is asserted.
|
||||
[2] Period of 1000 - 1100 usec.
|
||||
[3] Reset is deasserted.
|
||||
[4] Period of 315 usec. HWTRAP register is populated with incorrect
|
||||
XTAL frequency.
|
||||
[5] Signals reflect the bootstrapped configuration.
|
||||
|
||||
Increase the delay between reset_control_assert() and
|
||||
reset_control_deassert(), and gpiod_set_value_cansleep(priv->reset, 0) and
|
||||
gpiod_set_value_cansleep(priv->reset, 1) to 5000 - 5100 usec. This amount
|
||||
ensures a higher possibility that the switch IC will have these pins back
|
||||
to the bootstrapping configuration before reset deassertion.
|
||||
|
||||
With a cable from an active peer connected to port 3 before reset, the
|
||||
correct crystal frequency (0b10 = 40MHz) is selected:
|
||||
|
||||
[1] [2-1] [3] [5]
|
||||
: : : :
|
||||
_____________________________ __________________
|
||||
ESW_P4_LED_0 |_______|
|
||||
___________________ _______
|
||||
ESW_P3_LED_0 |_________| |__________________
|
||||
|
||||
: : : : :
|
||||
: [2-2]...: [4]...:
|
||||
[2]................:
|
||||
|
||||
[1] Reset is asserted.
|
||||
[2] Period of 5000 - 5100 usec.
|
||||
[2-1] ESW_P3_LED_0 goes low.
|
||||
[2-2] Remaining period of 5000 - 5100 usec.
|
||||
[3] Reset is deasserted.
|
||||
[4] Period of 310 usec. HWTRAP register is populated with bootstrapped
|
||||
XTAL frequency.
|
||||
[5] Signals reflect the bootstrapped configuration.
|
||||
|
||||
ESW_P3_LED_0 low period before reset deassertion:
|
||||
|
||||
5000 usec
|
||||
- 5100 usec
|
||||
TEST RESET HOLD
|
||||
# (usec)
|
||||
---------------------
|
||||
1 5410
|
||||
2 5440
|
||||
3 4375
|
||||
4 5490
|
||||
5 5475
|
||||
6 4335
|
||||
7 4370
|
||||
8 5435
|
||||
9 4205
|
||||
10 4335
|
||||
11 3750
|
||||
12 3170
|
||||
13 4395
|
||||
14 4375
|
||||
15 3515
|
||||
16 4335
|
||||
17 4220
|
||||
18 4175
|
||||
19 4175
|
||||
20 4350
|
||||
|
||||
Min 3170
|
||||
Max 5490
|
||||
|
||||
Median 4342.500
|
||||
Avg 4466.500
|
||||
|
||||
Revert commit 2920dd92b980 ("net: dsa: mt7530: disable LEDs before reset").
|
||||
Changing the state of pins via reset assertion is simpler and more
|
||||
efficient than doing so by setting the LED controller off.
|
||||
|
||||
Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
|
||||
Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch")
|
||||
Co-developed-by: Justin Swartz <justin.swartz@risingedge.co.za>
|
||||
Signed-off-by: Justin Swartz <justin.swartz@risingedge.co.za>
|
||||
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Sasha Levin <sashal@kernel.org>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -2187,11 +2187,11 @@ mt7530_setup(struct dsa_switch *ds)
|
||||
*/
|
||||
if (priv->mcm) {
|
||||
reset_control_assert(priv->rstc);
|
||||
- usleep_range(1000, 1100);
|
||||
+ usleep_range(5000, 5100);
|
||||
reset_control_deassert(priv->rstc);
|
||||
} else {
|
||||
gpiod_set_value_cansleep(priv->reset, 0);
|
||||
- usleep_range(1000, 1100);
|
||||
+ usleep_range(5000, 5100);
|
||||
gpiod_set_value_cansleep(priv->reset, 1);
|
||||
}
|
||||
|
||||
@@ -2401,11 +2401,11 @@ mt7531_setup(struct dsa_switch *ds)
|
||||
*/
|
||||
if (priv->mcm) {
|
||||
reset_control_assert(priv->rstc);
|
||||
- usleep_range(1000, 1100);
|
||||
+ usleep_range(5000, 5100);
|
||||
reset_control_deassert(priv->rstc);
|
||||
} else {
|
||||
gpiod_set_value_cansleep(priv->reset, 0);
|
||||
- usleep_range(1000, 1100);
|
||||
+ usleep_range(5000, 5100);
|
||||
gpiod_set_value_cansleep(priv->reset, 1);
|
||||
}
|
||||
|
@ -1,173 +0,0 @@
|
||||
From f1fa919ea59655f73cb3972264e157b8831ba546 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
|
||||
Date: Thu, 14 Mar 2024 12:33:41 +0300
|
||||
Subject: [PATCH 2/3] net: dsa: mt7530: fix link-local frames that ingress vlan
|
||||
filtering ports
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
[ Upstream commit e8bf353577f382c7066c661fed41b2adc0fc7c40 ]
|
||||
|
||||
Whether VLAN-aware or not, on every VID VLAN table entry that has the CPU
|
||||
port as a member of it, frames are set to egress the CPU port with the VLAN
|
||||
tag stacked. This is so that VLAN tags can be appended after hardware
|
||||
special tag (called DSA tag in the context of Linux drivers).
|
||||
|
||||
For user ports on a VLAN-unaware bridge, frame ingressing the user port
|
||||
egresses CPU port with only the special tag.
|
||||
|
||||
For user ports on a VLAN-aware bridge, frame ingressing the user port
|
||||
egresses CPU port with the special tag and the VLAN tag.
|
||||
|
||||
This causes issues with link-local frames, specifically BPDUs, because the
|
||||
software expects to receive them VLAN-untagged.
|
||||
|
||||
There are two options to make link-local frames egress untagged. Setting
|
||||
CONSISTENT or UNTAGGED on the EG_TAG bits on the relevant register.
|
||||
CONSISTENT means frames egress exactly as they ingress. That means
|
||||
egressing with the VLAN tag they had at ingress or egressing untagged if
|
||||
they ingressed untagged. Although link-local frames are not supposed to be
|
||||
transmitted VLAN-tagged, if they are done so, when egressing through a CPU
|
||||
port, the special tag field will be broken.
|
||||
|
||||
BPDU egresses CPU port with VLAN tag egressing stacked, received on
|
||||
software:
|
||||
|
||||
00:01:25.104821 AF Unknown (382365846), length 106:
|
||||
| STAG | | VLAN |
|
||||
0x0000: 0000 6c27 614d 4143 0001 0000 8100 0001 ..l'aMAC........
|
||||
0x0010: 0026 4242 0300 0000 0000 0000 6c27 614d .&BB........l'aM
|
||||
0x0020: 4143 0000 0000 0000 6c27 614d 4143 0000 AC......l'aMAC..
|
||||
0x0030: 0000 1400 0200 0f00 0000 0000 0000 0000 ................
|
||||
|
||||
BPDU egresses CPU port with VLAN tag egressing untagged, received on
|
||||
software:
|
||||
|
||||
00:23:56.628708 AF Unknown (25215488), length 64:
|
||||
| STAG |
|
||||
0x0000: 0000 6c27 614d 4143 0001 0000 0026 4242 ..l'aMAC.....&BB
|
||||
0x0010: 0300 0000 0000 0000 6c27 614d 4143 0000 ........l'aMAC..
|
||||
0x0020: 0000 0000 6c27 614d 4143 0000 0000 1400 ....l'aMAC......
|
||||
0x0030: 0200 0f00 0000 0000 0000 0000 ............
|
||||
|
||||
BPDU egresses CPU port with VLAN tag egressing tagged, received on
|
||||
software:
|
||||
|
||||
00:01:34.311963 AF Unknown (25215488), length 64:
|
||||
| Mess |
|
||||
0x0000: 0000 6c27 614d 4143 0001 0001 0026 4242 ..l'aMAC.....&BB
|
||||
0x0010: 0300 0000 0000 0000 6c27 614d 4143 0000 ........l'aMAC..
|
||||
0x0020: 0000 0000 6c27 614d 4143 0000 0000 1400 ....l'aMAC......
|
||||
0x0030: 0200 0f00 0000 0000 0000 0000 ............
|
||||
|
||||
To prevent confusing the software, force the frame to egress UNTAGGED
|
||||
instead of CONSISTENT. This way, frames can't possibly be received TAGGED
|
||||
by software which would have the special tag field broken.
|
||||
|
||||
VLAN Tag Egress Procedure
|
||||
|
||||
For all frames, one of these options set the earliest in this order will
|
||||
apply to the frame:
|
||||
|
||||
- EG_TAG in certain registers for certain frames.
|
||||
This will apply to frame with matching MAC DA or EtherType.
|
||||
|
||||
- EG_TAG in the address table.
|
||||
This will apply to frame at its incoming port.
|
||||
|
||||
- EG_TAG in the PVC register.
|
||||
This will apply to frame at its incoming port.
|
||||
|
||||
- EG_CON and [EG_TAG per port] in the VLAN table.
|
||||
This will apply to frame at its outgoing port.
|
||||
|
||||
- EG_TAG in the PCR register.
|
||||
This will apply to frame at its outgoing port.
|
||||
|
||||
EG_TAG in certain registers for certain frames:
|
||||
|
||||
PPPoE Discovery_ARP/RARP: PPP_EG_TAG and ARP_EG_TAG in the APC register.
|
||||
IGMP_MLD: IGMP_EG_TAG and MLD_EG_TAG in the IMC register.
|
||||
BPDU and PAE: BPDU_EG_TAG and PAE_EG_TAG in the BPC register.
|
||||
REV_01 and REV_02: R01_EG_TAG and R02_EG_TAG in the RGAC1 register.
|
||||
REV_03 and REV_0E: R03_EG_TAG and R0E_EG_TAG in the RGAC2 register.
|
||||
REV_10 and REV_20: R10_EG_TAG and R20_EG_TAG in the RGAC3 register.
|
||||
REV_21 and REV_UN: R21_EG_TAG and RUN_EG_TAG in the RGAC4 register.
|
||||
|
||||
With this change, it can be observed that a bridge interface with stp_state
|
||||
and vlan_filtering enabled will properly block ports now.
|
||||
|
||||
Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
|
||||
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
Signed-off-by: Sasha Levin <sashal@kernel.org>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 23 +++++++++++++++--------
|
||||
drivers/net/dsa/mt7530.h | 9 ++++++++-
|
||||
2 files changed, 23 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -1001,16 +1001,23 @@ unlock_exit:
|
||||
static void
|
||||
mt753x_trap_frames(struct mt7530_priv *priv)
|
||||
{
|
||||
- /* Trap BPDUs to the CPU port(s) */
|
||||
- mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
|
||||
+ /* Trap 802.1X PAE frames and BPDUs to the CPU port(s) and egress them
|
||||
+ * VLAN-untagged.
|
||||
+ */
|
||||
+ mt7530_rmw(priv, MT753X_BPC, MT753X_PAE_EG_TAG_MASK |
|
||||
+ MT753X_PAE_PORT_FW_MASK | MT753X_BPDU_EG_TAG_MASK |
|
||||
+ MT753X_BPDU_PORT_FW_MASK,
|
||||
+ MT753X_PAE_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
|
||||
+ MT753X_PAE_PORT_FW(MT753X_BPDU_CPU_ONLY) |
|
||||
+ MT753X_BPDU_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
|
||||
MT753X_BPDU_CPU_ONLY);
|
||||
|
||||
- /* Trap 802.1X PAE frames to the CPU port(s) */
|
||||
- mt7530_rmw(priv, MT753X_BPC, MT753X_PAE_PORT_FW_MASK,
|
||||
- MT753X_PAE_PORT_FW(MT753X_BPDU_CPU_ONLY));
|
||||
-
|
||||
- /* Trap LLDP frames with :0E MAC DA to the CPU port(s) */
|
||||
- mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_PORT_FW_MASK,
|
||||
+ /* Trap LLDP frames with :0E MAC DA to the CPU port(s) and egress them
|
||||
+ * VLAN-untagged.
|
||||
+ */
|
||||
+ mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_EG_TAG_MASK |
|
||||
+ MT753X_R0E_PORT_FW_MASK,
|
||||
+ MT753X_R0E_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
|
||||
MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY));
|
||||
}
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.h
|
||||
+++ b/drivers/net/dsa/mt7530.h
|
||||
@@ -63,12 +63,18 @@ enum mt753x_id {
|
||||
|
||||
/* Registers for BPDU and PAE frame control*/
|
||||
#define MT753X_BPC 0x24
|
||||
-#define MT753X_BPDU_PORT_FW_MASK GENMASK(2, 0)
|
||||
+#define MT753X_PAE_EG_TAG_MASK GENMASK(24, 22)
|
||||
+#define MT753X_PAE_EG_TAG(x) FIELD_PREP(MT753X_PAE_EG_TAG_MASK, x)
|
||||
#define MT753X_PAE_PORT_FW_MASK GENMASK(18, 16)
|
||||
#define MT753X_PAE_PORT_FW(x) FIELD_PREP(MT753X_PAE_PORT_FW_MASK, x)
|
||||
+#define MT753X_BPDU_EG_TAG_MASK GENMASK(8, 6)
|
||||
+#define MT753X_BPDU_EG_TAG(x) FIELD_PREP(MT753X_BPDU_EG_TAG_MASK, x)
|
||||
+#define MT753X_BPDU_PORT_FW_MASK GENMASK(2, 0)
|
||||
|
||||
/* Register for :03 and :0E MAC DA frame control */
|
||||
#define MT753X_RGAC2 0x2c
|
||||
+#define MT753X_R0E_EG_TAG_MASK GENMASK(24, 22)
|
||||
+#define MT753X_R0E_EG_TAG(x) FIELD_PREP(MT753X_R0E_EG_TAG_MASK, x)
|
||||
#define MT753X_R0E_PORT_FW_MASK GENMASK(18, 16)
|
||||
#define MT753X_R0E_PORT_FW(x) FIELD_PREP(MT753X_R0E_PORT_FW_MASK, x)
|
||||
|
||||
@@ -251,6 +257,7 @@ enum mt7530_port_mode {
|
||||
enum mt7530_vlan_port_eg_tag {
|
||||
MT7530_VLAN_EG_DISABLED = 0,
|
||||
MT7530_VLAN_EG_CONSISTENT = 1,
|
||||
+ MT7530_VLAN_EG_UNTAGGED = 4,
|
||||
};
|
||||
|
||||
enum mt7530_vlan_port_attr {
|
@ -1,133 +0,0 @@
|
||||
From 86c0c154a759f2af9612a04bdf29110f02dce956 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
|
||||
Date: Thu, 14 Mar 2024 12:33:42 +0300
|
||||
Subject: [PATCH 3/3] net: dsa: mt7530: fix handling of all link-local frames
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
[ Upstream commit 69ddba9d170bdaee1dc0eb4ced38d7e4bb7b92af ]
|
||||
|
||||
Currently, the MT753X switches treat frames with :01-0D and :0F MAC DAs as
|
||||
regular multicast frames, therefore flooding them to user ports.
|
||||
|
||||
On page 205, section "8.6.3 Frame filtering" of the active standard, IEEE
|
||||
Std 802.1Q™-2022, it is stated that frames with 01:80:C2:00:00:00-0F as MAC
|
||||
DA must only be propagated to C-VLAN and MAC Bridge components. That means
|
||||
VLAN-aware and VLAN-unaware bridges. On the switch designs with CPU ports,
|
||||
these frames are supposed to be processed by the CPU (software). So we make
|
||||
the switch only forward them to the CPU port. And if received from a CPU
|
||||
port, forward to a single port. The software is responsible of making the
|
||||
switch conform to the latter by setting a single port as destination port
|
||||
on the special tag.
|
||||
|
||||
This switch intellectual property cannot conform to this part of the
|
||||
standard fully. Whilst the REV_UN frame tag covers the remaining :04-0D and
|
||||
:0F MAC DAs, it also includes :22-FF which the scope of propagation is not
|
||||
supposed to be restricted for these MAC DAs.
|
||||
|
||||
Set frames with :01-03 MAC DAs to be trapped to the CPU port(s). Add a
|
||||
comment for the remaining MAC DAs.
|
||||
|
||||
Note that the ingress port must have a PVID assigned to it for the switch
|
||||
to forward untagged frames. A PVID is set by default on VLAN-aware and
|
||||
VLAN-unaware ports. However, when the network interface that pertains to
|
||||
the ingress port is attached to a vlan_filtering enabled bridge, the user
|
||||
can remove the PVID assignment from it which would prevent the link-local
|
||||
frames from being trapped to the CPU port. I am yet to see a way to forward
|
||||
link-local frames while preventing other untagged frames from being
|
||||
forwarded too.
|
||||
|
||||
Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
|
||||
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
Signed-off-by: Sasha Levin <sashal@kernel.org>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 37 +++++++++++++++++++++++++++++++++----
|
||||
drivers/net/dsa/mt7530.h | 13 +++++++++++++
|
||||
2 files changed, 46 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -998,6 +998,21 @@ unlock_exit:
|
||||
mutex_unlock(&priv->reg_mutex);
|
||||
}
|
||||
|
||||
+/* On page 205, section "8.6.3 Frame filtering" of the active standard, IEEE Std
|
||||
+ * 802.1Q™-2022, it is stated that frames with 01:80:C2:00:00:00-0F as MAC DA
|
||||
+ * must only be propagated to C-VLAN and MAC Bridge components. That means
|
||||
+ * VLAN-aware and VLAN-unaware bridges. On the switch designs with CPU ports,
|
||||
+ * these frames are supposed to be processed by the CPU (software). So we make
|
||||
+ * the switch only forward them to the CPU port. And if received from a CPU
|
||||
+ * port, forward to a single port. The software is responsible of making the
|
||||
+ * switch conform to the latter by setting a single port as destination port on
|
||||
+ * the special tag.
|
||||
+ *
|
||||
+ * This switch intellectual property cannot conform to this part of the standard
|
||||
+ * fully. Whilst the REV_UN frame tag covers the remaining :04-0D and :0F MAC
|
||||
+ * DAs, it also includes :22-FF which the scope of propagation is not supposed
|
||||
+ * to be restricted for these MAC DAs.
|
||||
+ */
|
||||
static void
|
||||
mt753x_trap_frames(struct mt7530_priv *priv)
|
||||
{
|
||||
@@ -1012,13 +1027,27 @@ mt753x_trap_frames(struct mt7530_priv *p
|
||||
MT753X_BPDU_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
|
||||
MT753X_BPDU_CPU_ONLY);
|
||||
|
||||
- /* Trap LLDP frames with :0E MAC DA to the CPU port(s) and egress them
|
||||
- * VLAN-untagged.
|
||||
+ /* Trap frames with :01 and :02 MAC DAs to the CPU port(s) and egress
|
||||
+ * them VLAN-untagged.
|
||||
+ */
|
||||
+ mt7530_rmw(priv, MT753X_RGAC1, MT753X_R02_EG_TAG_MASK |
|
||||
+ MT753X_R02_PORT_FW_MASK | MT753X_R01_EG_TAG_MASK |
|
||||
+ MT753X_R01_PORT_FW_MASK,
|
||||
+ MT753X_R02_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
|
||||
+ MT753X_R02_PORT_FW(MT753X_BPDU_CPU_ONLY) |
|
||||
+ MT753X_R01_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
|
||||
+ MT753X_BPDU_CPU_ONLY);
|
||||
+
|
||||
+ /* Trap frames with :03 and :0E MAC DAs to the CPU port(s) and egress
|
||||
+ * them VLAN-untagged.
|
||||
*/
|
||||
mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_EG_TAG_MASK |
|
||||
- MT753X_R0E_PORT_FW_MASK,
|
||||
+ MT753X_R0E_PORT_FW_MASK | MT753X_R03_EG_TAG_MASK |
|
||||
+ MT753X_R03_PORT_FW_MASK,
|
||||
MT753X_R0E_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
|
||||
- MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY));
|
||||
+ MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY) |
|
||||
+ MT753X_R03_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
|
||||
+ MT753X_BPDU_CPU_ONLY);
|
||||
}
|
||||
|
||||
static int
|
||||
--- a/drivers/net/dsa/mt7530.h
|
||||
+++ b/drivers/net/dsa/mt7530.h
|
||||
@@ -71,12 +71,25 @@ enum mt753x_id {
|
||||
#define MT753X_BPDU_EG_TAG(x) FIELD_PREP(MT753X_BPDU_EG_TAG_MASK, x)
|
||||
#define MT753X_BPDU_PORT_FW_MASK GENMASK(2, 0)
|
||||
|
||||
+/* Register for :01 and :02 MAC DA frame control */
|
||||
+#define MT753X_RGAC1 0x28
|
||||
+#define MT753X_R02_EG_TAG_MASK GENMASK(24, 22)
|
||||
+#define MT753X_R02_EG_TAG(x) FIELD_PREP(MT753X_R02_EG_TAG_MASK, x)
|
||||
+#define MT753X_R02_PORT_FW_MASK GENMASK(18, 16)
|
||||
+#define MT753X_R02_PORT_FW(x) FIELD_PREP(MT753X_R02_PORT_FW_MASK, x)
|
||||
+#define MT753X_R01_EG_TAG_MASK GENMASK(8, 6)
|
||||
+#define MT753X_R01_EG_TAG(x) FIELD_PREP(MT753X_R01_EG_TAG_MASK, x)
|
||||
+#define MT753X_R01_PORT_FW_MASK GENMASK(2, 0)
|
||||
+
|
||||
/* Register for :03 and :0E MAC DA frame control */
|
||||
#define MT753X_RGAC2 0x2c
|
||||
#define MT753X_R0E_EG_TAG_MASK GENMASK(24, 22)
|
||||
#define MT753X_R0E_EG_TAG(x) FIELD_PREP(MT753X_R0E_EG_TAG_MASK, x)
|
||||
#define MT753X_R0E_PORT_FW_MASK GENMASK(18, 16)
|
||||
#define MT753X_R0E_PORT_FW(x) FIELD_PREP(MT753X_R0E_PORT_FW_MASK, x)
|
||||
+#define MT753X_R03_EG_TAG_MASK GENMASK(8, 6)
|
||||
+#define MT753X_R03_EG_TAG(x) FIELD_PREP(MT753X_R03_EG_TAG_MASK, x)
|
||||
+#define MT753X_R03_PORT_FW_MASK GENMASK(2, 0)
|
||||
|
||||
enum mt753x_bpdu_port_fw {
|
||||
MT753X_BPDU_FOLLOW_MFC,
|
@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
|
||||
+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
|
||||
@@ -4154,17 +4154,6 @@ void intel_execlists_show_requests(struc
|
||||
@@ -4157,17 +4157,6 @@ void intel_execlists_show_requests(struc
|
||||
spin_unlock_irqrestore(&sched_engine->lock, flags);
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
void intel_execlists_dump_active_requests(struct intel_engine_cs *engine,
|
||||
struct i915_request *hung_rq,
|
||||
struct drm_printer *m)
|
||||
@@ -4175,8 +4164,8 @@ void intel_execlists_dump_active_request
|
||||
@@ -4178,8 +4167,8 @@ void intel_execlists_dump_active_request
|
||||
|
||||
intel_engine_dump_active_requests(&engine->sched_engine->requests, hung_rq, m);
|
||||
|
||||
|
@ -132,7 +132,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
imx_ocotp_nvmem_config.priv = priv;
|
||||
--- a/drivers/nvmem/meson-efuse.c
|
||||
+++ b/drivers/nvmem/meson-efuse.c
|
||||
@@ -93,6 +93,7 @@ static int meson_efuse_probe(struct plat
|
||||
@@ -74,6 +74,7 @@ static int meson_efuse_probe(struct plat
|
||||
|
||||
econfig->dev = dev;
|
||||
econfig->name = dev_name(dev);
|
||||
|
@ -18,7 +18,7 @@ Link: https://lore.kernel.org/r/20230526204802.3081168-4-robimarko@gmail.com
|
||||
|
||||
--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
|
||||
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
|
||||
@@ -31,12 +31,7 @@
|
||||
@@ -30,12 +30,7 @@
|
||||
|
||||
#define MSM_ID_SMEM 137
|
||||
|
||||
@ -32,7 +32,7 @@ Link: https://lore.kernel.org/r/20230526204802.3081168-4-robimarko@gmail.com
|
||||
|
||||
enum _msm8996_version {
|
||||
MSM8996_V3,
|
||||
@@ -154,12 +149,12 @@ static enum _msm8996_version qcom_cpufre
|
||||
@@ -153,12 +148,12 @@ static enum _msm8996_version qcom_cpufre
|
||||
msm_id++;
|
||||
|
||||
switch ((enum _msm_id)*msm_id) {
|
||||
|
@ -19,7 +19,7 @@ Link: https://lore.kernel.org/r/20230526204802.3081168-5-robimarko@gmail.com
|
||||
|
||||
--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
|
||||
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
|
||||
@@ -29,16 +29,8 @@
|
||||
@@ -28,16 +28,8 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/soc/qcom/smem.h>
|
||||
|
||||
@ -36,7 +36,7 @@ Link: https://lore.kernel.org/r/20230526204802.3081168-5-robimarko@gmail.com
|
||||
struct qcom_cpufreq_drv;
|
||||
|
||||
struct qcom_cpufreq_match_data {
|
||||
@@ -135,60 +127,32 @@ static void get_krait_bin_format_b(struc
|
||||
@@ -134,60 +126,32 @@ static void get_krait_bin_format_b(struc
|
||||
dev_dbg(cpu_dev, "PVS version: %d\n", *pvs_ver);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
|
||||
--- a/drivers/bus/mhi/host/init.c
|
||||
+++ b/drivers/bus/mhi/host/init.c
|
||||
@@ -881,6 +881,7 @@ static int parse_config(struct mhi_contr
|
||||
@@ -882,6 +882,7 @@ static int parse_config(struct mhi_contr
|
||||
if (!mhi_cntrl->timeout_ms)
|
||||
mhi_cntrl->timeout_ms = MHI_TIMEOUT_MS;
|
||||
|
||||
@ -33,7 +33,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
if (!mhi_cntrl->buffer_len)
|
||||
--- a/drivers/bus/mhi/host/internal.h
|
||||
+++ b/drivers/bus/mhi/host/internal.h
|
||||
@@ -321,7 +321,7 @@ int __must_check mhi_read_reg_field(stru
|
||||
@@ -324,7 +324,7 @@ int __must_check mhi_read_reg_field(stru
|
||||
u32 *out);
|
||||
int __must_check mhi_poll_reg_field(struct mhi_controller *mhi_cntrl,
|
||||
void __iomem *base, u32 offset, u32 mask,
|
||||
@ -60,7 +60,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
ret = mhi_read_reg_field(mhi_cntrl, base, offset, mask, &out);
|
||||
--- a/drivers/bus/mhi/host/pm.c
|
||||
+++ b/drivers/bus/mhi/host/pm.c
|
||||
@@ -163,6 +163,7 @@ int mhi_ready_state_transition(struct mh
|
||||
@@ -171,6 +171,7 @@ int mhi_ready_state_transition(struct mh
|
||||
enum mhi_pm_state cur_state;
|
||||
struct device *dev = &mhi_cntrl->mhi_dev->dev;
|
||||
u32 interval_us = 25000; /* poll register field every 25 milliseconds */
|
||||
@ -68,7 +68,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
int ret, i;
|
||||
|
||||
/* Check if device entered error state */
|
||||
@@ -173,14 +174,18 @@ int mhi_ready_state_transition(struct mh
|
||||
@@ -181,14 +182,18 @@ int mhi_ready_state_transition(struct mh
|
||||
|
||||
/* Wait for RESET to be cleared and READY bit to be set by the device */
|
||||
ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL,
|
||||
@ -89,7 +89,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
if (ret) {
|
||||
dev_err(dev, "Device failed to enter MHI Ready\n");
|
||||
return ret;
|
||||
@@ -479,7 +484,7 @@ static void mhi_pm_disable_transition(st
|
||||
@@ -487,7 +492,7 @@ static void mhi_pm_disable_transition(st
|
||||
|
||||
/* Wait for the reset bit to be cleared by the device */
|
||||
ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL,
|
||||
@ -98,7 +98,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
if (ret)
|
||||
dev_err(dev, "Device failed to clear MHI Reset\n");
|
||||
|
||||
@@ -492,8 +497,8 @@ static void mhi_pm_disable_transition(st
|
||||
@@ -500,8 +505,8 @@ static void mhi_pm_disable_transition(st
|
||||
if (!MHI_IN_PBL(mhi_get_exec_env(mhi_cntrl))) {
|
||||
/* wait for ready to be set */
|
||||
ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs,
|
||||
@ -109,7 +109,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
if (ret)
|
||||
dev_err(dev, "Device failed to enter READY state\n");
|
||||
}
|
||||
@@ -1111,7 +1116,8 @@ int mhi_async_power_up(struct mhi_contro
|
||||
@@ -1125,7 +1130,8 @@ int mhi_async_power_up(struct mhi_contro
|
||||
if (state == MHI_STATE_SYS_ERR) {
|
||||
mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET);
|
||||
ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL,
|
||||
@ -119,7 +119,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
if (ret) {
|
||||
dev_info(dev, "Failed to reset MHI due to syserr state\n");
|
||||
goto error_exit;
|
||||
@@ -1202,14 +1208,18 @@ EXPORT_SYMBOL_GPL(mhi_power_down);
|
||||
@@ -1216,14 +1222,18 @@ EXPORT_SYMBOL_GPL(mhi_power_down);
|
||||
int mhi_sync_power_up(struct mhi_controller *mhi_cntrl)
|
||||
{
|
||||
int ret = mhi_async_power_up(mhi_cntrl);
|
||||
|
@ -121,7 +121,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
u32 vsc85xx_csr_read(struct phy_device *phydev,
|
||||
--- a/drivers/net/phy/phy_device.c
|
||||
+++ b/drivers/net/phy/phy_device.c
|
||||
@@ -1650,20 +1650,22 @@ EXPORT_SYMBOL_GPL(phy_driver_is_genphy_1
|
||||
@@ -1658,20 +1658,22 @@ EXPORT_SYMBOL_GPL(phy_driver_is_genphy_1
|
||||
/**
|
||||
* phy_package_join - join a common PHY group
|
||||
* @phydev: target phy_device struct
|
||||
@ -151,7 +151,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
*
|
||||
* This will set the shared pointer of the phydev to the shared storage.
|
||||
* If this is the first call for a this cookie the shared storage will be
|
||||
@@ -1673,17 +1675,17 @@ EXPORT_SYMBOL_GPL(phy_driver_is_genphy_1
|
||||
@@ -1681,17 +1683,17 @@ EXPORT_SYMBOL_GPL(phy_driver_is_genphy_1
|
||||
* Returns < 1 on error, 0 on success. Esp. calling phy_package_join()
|
||||
* with the same cookie but a different priv_size is an error.
|
||||
*/
|
||||
@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if (!shared) {
|
||||
ret = -ENOMEM;
|
||||
shared = kzalloc(sizeof(*shared), GFP_KERNEL);
|
||||
@@ -1695,9 +1697,9 @@ int phy_package_join(struct phy_device *
|
||||
@@ -1703,9 +1705,9 @@ int phy_package_join(struct phy_device *
|
||||
goto err_free;
|
||||
shared->priv_size = priv_size;
|
||||
}
|
||||
@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
if (priv_size && priv_size != shared->priv_size)
|
||||
@@ -1735,7 +1737,7 @@ void phy_package_leave(struct phy_device
|
||||
@@ -1743,7 +1745,7 @@ void phy_package_leave(struct phy_device
|
||||
return;
|
||||
|
||||
if (refcount_dec_and_mutex_lock(&shared->refcnt, &bus->shared_lock)) {
|
||||
@ -193,7 +193,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
mutex_unlock(&bus->shared_lock);
|
||||
kfree(shared->priv);
|
||||
kfree(shared);
|
||||
@@ -1754,7 +1756,8 @@ static void devm_phy_package_leave(struc
|
||||
@@ -1762,7 +1764,8 @@ static void devm_phy_package_leave(struc
|
||||
* devm_phy_package_join - resource managed phy_package_join()
|
||||
* @dev: device that is registering this PHY package
|
||||
* @phydev: target phy_device struct
|
||||
@ -203,7 +203,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
* @priv_size: if non-zero allocate this amount of bytes for private data
|
||||
*
|
||||
* Managed phy_package_join(). Shared storage fetched by this function,
|
||||
@@ -1762,7 +1765,7 @@ static void devm_phy_package_leave(struc
|
||||
@@ -1770,7 +1773,7 @@ static void devm_phy_package_leave(struc
|
||||
* phy_package_join() for more information.
|
||||
*/
|
||||
int devm_phy_package_join(struct device *dev, struct phy_device *phydev,
|
||||
@ -212,7 +212,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
{
|
||||
struct phy_device **ptr;
|
||||
int ret;
|
||||
@@ -1772,7 +1775,7 @@ int devm_phy_package_join(struct device
|
||||
@@ -1780,7 +1783,7 @@ int devm_phy_package_join(struct device
|
||||
if (!ptr)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/phy/phy_device.c
|
||||
+++ b/drivers/net/phy/phy_device.c
|
||||
@@ -1698,6 +1698,7 @@ int phy_package_join(struct phy_device *
|
||||
@@ -1706,6 +1706,7 @@ int phy_package_join(struct phy_device *
|
||||
shared->priv_size = priv_size;
|
||||
}
|
||||
shared->base_addr = base_addr;
|
||||
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
refcount_set(&shared->refcnt, 1);
|
||||
bus->shared[base_addr] = shared;
|
||||
} else {
|
||||
@@ -1721,6 +1722,63 @@ err_unlock:
|
||||
@@ -1729,6 +1730,63 @@ err_unlock:
|
||||
EXPORT_SYMBOL_GPL(phy_package_join);
|
||||
|
||||
/**
|
||||
@ -99,7 +99,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
* phy_package_leave - leave a common PHY group
|
||||
* @phydev: target phy_device struct
|
||||
*
|
||||
@@ -1736,6 +1794,10 @@ void phy_package_leave(struct phy_device
|
||||
@@ -1744,6 +1802,10 @@ void phy_package_leave(struct phy_device
|
||||
if (!shared)
|
||||
return;
|
||||
|
||||
@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if (refcount_dec_and_mutex_lock(&shared->refcnt, &bus->shared_lock)) {
|
||||
bus->shared[shared->base_addr] = NULL;
|
||||
mutex_unlock(&bus->shared_lock);
|
||||
@@ -1789,6 +1851,40 @@ int devm_phy_package_join(struct device
|
||||
@@ -1797,6 +1859,40 @@ int devm_phy_package_join(struct device
|
||||
EXPORT_SYMBOL_GPL(devm_phy_package_join);
|
||||
|
||||
/**
|
||||
|
@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/phy/phy_device.c
|
||||
+++ b/drivers/net/phy/phy_device.c
|
||||
@@ -2607,12 +2607,15 @@ EXPORT_SYMBOL(genphy_read_status);
|
||||
@@ -2615,12 +2615,15 @@ EXPORT_SYMBOL(genphy_read_status);
|
||||
/**
|
||||
* genphy_c37_read_status - check the link status and update current link state
|
||||
* @phydev: target phy_device struct
|
||||
@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
{
|
||||
int lpa, err, old_link = phydev->link;
|
||||
|
||||
@@ -2622,9 +2625,13 @@ int genphy_c37_read_status(struct phy_de
|
||||
@@ -2630,9 +2633,13 @@ int genphy_c37_read_status(struct phy_de
|
||||
return err;
|
||||
|
||||
/* why bother the PHY if nothing can have changed */
|
||||
|
@ -28,7 +28,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/drivers/net/phy/phy_device.c
|
||||
+++ b/drivers/net/phy/phy_device.c
|
||||
@@ -3198,6 +3198,7 @@ static int of_phy_led(struct phy_device
|
||||
@@ -3201,6 +3201,7 @@ static int of_phy_led(struct phy_device
|
||||
struct device *dev = &phydev->mdio.dev;
|
||||
struct led_init_data init_data = {};
|
||||
struct led_classdev *cdev;
|
||||
@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
struct phy_led *phyled;
|
||||
u32 index;
|
||||
int err;
|
||||
@@ -3215,6 +3216,21 @@ static int of_phy_led(struct phy_device
|
||||
@@ -3218,6 +3219,21 @@ static int of_phy_led(struct phy_device
|
||||
if (index > U8_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user