netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org,
	Potin Lai <potin.lai@quantatw.com>,
	Potin Lai <potin.lai.pt@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	sam@mendozajonas.com, fr0st61te@gmail.com, fercerpav@gmail.com
Subject: [PATCH net v2] Revert "net/ncsi: change from ndo_set_mac_address to dev_set_mac_address"
Date: Wed,  8 Jan 2025 11:23:46 -0800	[thread overview]
Message-ID: <20250108192346.2646627-1-kuba@kernel.org> (raw)

From: Potin Lai <potin.lai@quantatw.com>

This reverts commit 790071347a0a1a89e618eedcd51c687ea783aeb3.

We are seeing kernel panic when enabling two NCSI interfaces at same
time. It looks like mutex lock is being used in softirq caused the
issue.

Kernel panic log:

  8021q: adding VLAN 0 to HW filter on device eth0
  ftgmac100 1e670000.ethernet eth0: NCSI: Handler for packet type 0x82 returned -19
  BUG: scheduling while atomic: systemd-network/697/0x00000100
  Modules linked in:
  8021q: adding VLAN 0 to HW filter on device eth1
  CPU: 0 PID: 697 Comm: systemd-network Tainted: G        W          6.6.62-8ea1fc6-dirty-cbd80d0-gcbd80d04d13c #1
  Hardware name: Generic DT based system
   unwind_backtrace from show_stack+0x18/0x1c
   show_stack from dump_stack_lvl+0x40/0x4c
   dump_stack_lvl from __schedule_bug+0x5c/0x70
   __schedule_bug from __schedule+0x884/0x968
   __schedule from schedule+0x58/0xa8
   schedule from schedule_preempt_disabled+0x14/0x18
   schedule_preempt_disabled from __mutex_lock.constprop.0+0x350/0x76c
   __mutex_lock.constprop.0 from ncsi_rsp_handler_oem_gma+0x104/0x1a0
   ncsi_rsp_handler_oem_gma from ncsi_rcv_rsp+0x120/0x2cc
   ncsi_rcv_rsp from __netif_receive_skb_one_core+0x60/0x84
   __netif_receive_skb_one_core from netif_receive_skb+0x38/0x148
   netif_receive_skb from ftgmac100_poll+0x358/0x444
   ftgmac100_poll from __napi_poll.constprop.0+0x34/0x1d0
   __napi_poll.constprop.0 from net_rx_action+0x350/0x43c
   net_rx_action from handle_softirqs+0x114/0x32c
   handle_softirqs from irq_exit+0x88/0xb8
   irq_exit from call_with_stack+0x18/0x20
   call_with_stack from __irq_usr+0x78/0xa0
  Exception stack(0xe075dfb0 to 0xe075dff8)
  dfa0:                                     00000000 00000000 00000000 00000020
  dfc0: 00000069 aefde3e0 00000000 00000000 00000000 00000000 00000000 aefde4e4
  dfe0: 01010101 aefddf20 a6b4331c a6b43618 600f0010 ffffffff

Fixes: 790071347a0a ("net/ncsi: change from ndo_set_mac_address to dev_set_mac_address")
Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
Looks like we're not making any progress on this one, so let's
go with the revert for 6.13.

Original posting by Potin Lai:
  https://lore.kernel.org/20241129-potin-revert-ncsi-set-mac-addr-v1-1-94ea2cb596af@gmail.com

I added the Fixes tag and trimmed the kernel log.

CC: sam@mendozajonas.com
CC: fr0st61te@gmail.com
CC: fercerpav@gmail.com
---
 net/ncsi/ncsi-rsp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c
index e28be33bdf2c..0cd7b916d3f8 100644
--- a/net/ncsi/ncsi-rsp.c
+++ b/net/ncsi/ncsi-rsp.c
@@ -629,6 +629,7 @@ static int ncsi_rsp_handler_oem_gma(struct ncsi_request *nr, int mfr_id)
 {
 	struct ncsi_dev_priv *ndp = nr->ndp;
 	struct net_device *ndev = ndp->ndev.dev;
+	const struct net_device_ops *ops = ndev->netdev_ops;
 	struct ncsi_rsp_oem_pkt *rsp;
 	struct sockaddr saddr;
 	u32 mac_addr_off = 0;
@@ -655,9 +656,7 @@ static int ncsi_rsp_handler_oem_gma(struct ncsi_request *nr, int mfr_id)
 	/* Set the flag for GMA command which should only be called once */
 	ndp->gma_flag = 1;
 
-	rtnl_lock();
-	ret = dev_set_mac_address(ndev, &saddr, NULL);
-	rtnl_unlock();
+	ret = ops->ndo_set_mac_address(ndev, &saddr);
 	if (ret < 0)
 		netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n");
 
-- 
2.47.1


             reply	other threads:[~2025-01-08 19:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08 19:23 Jakub Kicinski [this message]
2025-01-08 20:23 ` [PATCH net v2] Revert "net/ncsi: change from ndo_set_mac_address to dev_set_mac_address" Paul Fertser
2025-01-08 21:44   ` Jakub Kicinski
2025-01-08 21:48   ` Ivan Mikhaylov
2025-01-09  3:16     ` Jakub Kicinski
2025-01-09 14:50 ` [PATCH] net/ncsi: fix locking in Get MAC Address handling Paul Fertser
2025-01-09 16:33   ` Jakub Kicinski
     [not found]     ` <TYSPR04MB7868EA6003981521C1B2FDAB8E1C2@TYSPR04MB7868.apcprd04.prod.outlook.com>
2025-01-11  2:18       ` 回覆: [External] " Jakub Kicinski
2025-01-11 11:12         ` Potin Lai
2025-01-13 21:19           ` Jakub Kicinski
2025-01-14  1:56             ` Potin Lai
2025-01-14  3:04               ` Jakub Kicinski
2025-01-14  3:10   ` patchwork-bot+netdevbpf

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=20250108192346.2646627-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fercerpav@gmail.com \
    --cc=fr0st61te@gmail.com \
    --cc=horms@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=potin.lai.pt@gmail.com \
    --cc=potin.lai@quantatw.com \
    --cc=sam@mendozajonas.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;
as well as URLs for NNTP newsgroup(s).