From: Daniel Golle <daniel@makrotopia.org>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>, Paolo Abeni <pabeni@redhat.com>,
DENG Qingfang <dqfext@gmail.com>,
netdev@vger.kernel.org, Sean Wang <sean.wang@mediatek.com>,
linux-kernel@vger.kernel.org,
"Chester A. Unal" <chester.a.unal@arinc9.com>,
Eric Dumazet <edumazet@google.com>,
linux-mediatek@lists.infradead.org,
Matthias Brugger <matthias.bgg@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
linux-arm-kernel@lists.infradead.org,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Subject: Re: [net-next PATCH 0/6] net: dsa: mt7530: modernize MIB handling + fix
Date: Fri, 27 Jun 2025 20:31:34 +0100 [thread overview]
Message-ID: <aF7xlqRLXlZu0DZr@makrotopia.org> (raw)
In-Reply-To: <20250410163022.3695-1-ansuelsmth@gmail.com>
Hi Christian,
On Thu, Apr 10, 2025 at 06:30:08PM +0200, Christian Marangi wrote:
> This small series modernize MIB handling for MT7530 and also
> implement .get_stats64.
>
> It was reported that kernel and Switch MIB desync in scenario where
> a packet is forwarded from a port to another. In such case, the
> forwarding is offloaded and the kernel is not aware of the
> transmitted packet. To handle this, read the counter directly
> from Switch registers.
>
> Christian Marangi (6):
> net: dsa: mt7530: generalize read port stats logic
> net: dsa: mt7530: move pkt size and rx err MIB counter to rmon stats
> API
> net: dsa: mt7530: move pause MIB counter to eth_ctrl stats API
> net: dsa: mt7530: move pkt stats and err MIB counter to eth_mac stats
> API
> net: dsa: mt7530: move remaining MIB counter to define
> net: dsa: mt7530: implement .get_stats64
After this series being applied I see lockdep warnings every time
the interface counters are being read on MT7531 connected via MDIO:
[ 234.374708] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:579
[ 234.383200] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3667, name: ifconfig
[ 234.391202] preempt_count: 1, expected: 0
[ 234.395226] INFO: lockdep is turned off.
[ 234.399150] CPU: 3 UID: 0 PID: 3667 Comm: ifconfig Tainted: G W O 6.16.0-rc1+ #0 NONE
[ 234.399158] Tainted: [W]=WARN, [O]=OOT_MODULE
[ 234.399160] Hardware name: Bananapi BPI-R3 (DT)
[ 234.399162] Call trace:
[ 234.399165] show_stack+0x28/0x78 (C)
[ 234.399179] dump_stack_lvl+0x68/0x8c
[ 234.399184] dump_stack+0x14/0x1c
[ 234.399188] __might_resched+0x138/0x250
[ 234.399197] __might_sleep+0x44/0x80
[ 234.399201] __mutex_lock+0x4c/0x934
[ 234.399209] mutex_lock_nested+0x20/0x28
[ 234.399215] mt7530_get_stats64+0x40/0x2ac
[ 234.399222] dsa_user_get_stats64+0x2c/0x40
[ 234.399229] dev_get_stats+0x44/0x1e0
[ 234.399237] dev_seq_printf_stats+0x24/0xe0
[ 234.399244] dev_seq_show+0x14/0x40
[ 234.399248] seq_read_iter+0x368/0x464
[ 234.399257] seq_read+0xd0/0xfc
[ 234.399263] proc_reg_read+0xa8/0xf0
[ 234.399268] vfs_read+0x98/0x2b0
[ 234.399275] ksys_read+0x54/0xdc
[ 234.399280] __arm64_sys_read+0x18/0x20
[ 234.399286] invoke_syscall.constprop.0+0x4c/0xd0
[ 234.399293] do_el0_svc+0x3c/0xd0
[ 234.399298] el0_svc+0x34/0xa0
[ 234.399303] el0t_64_sync_handler+0x104/0x138
[ 234.399308] el0t_64_sync+0x158/0x15c
Note that this only shows with some lock debugging options being set
and may not actually be a problem, but I believe it anyway should be
fixed somehow.
#
# Lock Debugging (spinlocks, mutexes, etc...)
#
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_PROVE_LOCKING=y
CONFIG_PROVE_RAW_LOCK_NESTING=y
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
CONFIG_DEBUG_RWSEMS=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_LOCKDEP=y
CONFIG_LOCKDEP_BITS=15
CONFIG_LOCKDEP_CHAINS_BITS=16
CONFIG_LOCKDEP_STACK_TRACE_BITS=19
CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14
CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=12
# CONFIG_DEBUG_LOCKDEP is not set
CONFIG_DEBUG_ATOMIC_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_LOCK_TORTURE_TEST is not set
# CONFIG_WW_MUTEX_SELFTEST is not set
# CONFIG_SCF_TORTURE_TEST is not set
# CONFIG_CSD_LOCK_WAIT_DEBUG is not set
# end of Lock Debugging (spinlocks, mutexes, etc...)
CONFIG_TRACE_IRQFLAGS=y
CONFIG_TRACE_IRQFLAGS_NMI=y
# CONFIG_DEBUG_IRQFLAGS is not set
CONFIG_STACKTRACE=y
# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set
# CONFIG_DEBUG_KOBJECT is not set
Cheers
Daniel
next prev parent reply other threads:[~2025-06-27 19:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 16:30 [net-next PATCH 0/6] net: dsa: mt7530: modernize MIB handling + fix Christian Marangi
2025-04-10 16:30 ` [net-next PATCH 1/6] net: dsa: mt7530: generalize read port stats logic Christian Marangi
2025-04-10 16:30 ` [net-next PATCH 2/6] net: dsa: mt7530: move pkt size and rx err MIB counter to rmon stats API Christian Marangi
2025-04-10 16:30 ` [net-next PATCH 3/6] net: dsa: mt7530: move pause MIB counter to eth_ctrl " Christian Marangi
2025-04-10 16:30 ` [net-next PATCH 4/6] net: dsa: mt7530: move pkt stats and err MIB counter to eth_mac " Christian Marangi
2025-04-10 16:30 ` [net-next PATCH 5/6] net: dsa: mt7530: move remaining MIB counter to define Christian Marangi
2025-04-10 16:30 ` [net-next PATCH 6/6] net: dsa: mt7530: implement .get_stats64 Christian Marangi
2025-04-15 11:00 ` [net-next PATCH 0/6] net: dsa: mt7530: modernize MIB handling + fix patchwork-bot+netdevbpf
2025-06-27 19:31 ` Daniel Golle [this message]
2025-06-28 0:38 ` Christian Marangi (Ansuel)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aF7xlqRLXlZu0DZr@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=ansuelsmth@gmail.com \
--cc=chester.a.unal@arinc9.com \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=sean.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox