From: Simon Horman <horms@kernel.org>
To: Jijie Shao <shaojijie@huawei.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, andrew+netdev@lunn.ch, shenjian15@huawei.com,
wangpeiyang1@huawei.com, liuyonglong@huawei.com,
chenhao418@huawei.com, jonathan.cameron@huawei.com,
shameerali.kolothum.thodi@huawei.com, salil.mehta@huawei.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 7/7] net: hibmcge: fix multiple phy_stop() issue
Date: Fri, 4 Apr 2025 12:01:45 +0100 [thread overview]
Message-ID: <20250404110145.GF214849@horms.kernel.org> (raw)
In-Reply-To: <20250403135311.545633-8-shaojijie@huawei.com>
On Thu, Apr 03, 2025 at 09:53:11PM +0800, Jijie Shao wrote:
> After detecting the np_link_fail exception,
> the driver attempts to fix the exception by
> using phy_stop() and phy_start() in the scheduled task.
>
> However, hbg_fix_np_link_fail() and .ndo_stop()
> may be concurrently executed. As a result,
> phy_stop() is executed twice, and the following Calltrace occurs:
>
> hibmcge 0000:84:00.2 enp132s0f2: Link is Down
> hibmcge 0000:84:00.2: failed to link between MAC and PHY, try to fix...
> ------------[ cut here ]------------
> called from state HALTED
> WARNING: CPU: 71 PID: 23391 at drivers/net/phy/phy.c:1503 phy_stop...
> ...
> pc : phy_stop+0x138/0x180
> lr : phy_stop+0x138/0x180
> sp : ffff8000c76bbd40
> x29: ffff8000c76bbd40 x28: 0000000000000000 x27: 0000000000000000
> x26: ffff2020047358c0 x25: ffff202004735940 x24: ffff20200000e405
> x23: ffff2020060e5178 x22: ffff2020060e4000 x21: ffff2020060e49c0
> x20: ffff2020060e5170 x19: ffff20202538e000 x18: 0000000000000020
> x17: 0000000000000000 x16: ffffcede02e28f40 x15: ffffffffffffffff
> x14: 0000000000000000 x13: 205d313933333254 x12: 5b5d393430303233
> x11: ffffcede04555958 x10: ffffcede04495918 x9 : ffffcede0274fee0
> x8 : 00000000000bffe8 x7 : c0000000ffff7fff x6 : 0000000000000001
> x5 : 00000000002bffa8 x4 : 0000000000000000 x3 : 0000000000000000
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff20202e429480
> Call trace:
> phy_stop+0x138/0x180
> hbg_fix_np_link_fail+0x4c/0x90 [hibmcge]
> hbg_service_task+0xfc/0x148 [hibmcge]
> process_one_work+0x180/0x398
> worker_thread+0x210/0x328
> kthread+0xe0/0xf0
> ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---
>
> This patch adds the rtnl_lock to hbg_fix_np_link_fail()
> to ensure that other operations are not performed concurrently.
> In addition, np_link_fail exception can be fixed
> only when the PHY is link.
>
> Fixes: e0306637e85d ("net: hibmcge: Add support for mac link exception handling feature")
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
prev parent reply other threads:[~2025-04-04 11:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 13:53 [PATCH net v2 0/7] There are some bugfix for hibmcge driver Jijie Shao
2025-04-03 13:53 ` [PATCH net v2 1/7] net: hibmcge: fix incorrect pause frame statistics issue Jijie Shao
2025-04-04 5:26 ` Michal Swiatkowski
2025-04-04 10:59 ` Simon Horman
2025-04-03 13:53 ` [PATCH net v2 2/7] net: hibmcge: fix incorrect multicast filtering issue Jijie Shao
2025-04-03 13:53 ` [PATCH net v2 3/7] net: hibmcge: fix the share of irq statistics among different network ports issue Jijie Shao
2025-04-03 13:53 ` [PATCH net v2 4/7] net: hibmcge: fix wrong mtu log issue Jijie Shao
2025-04-03 13:53 ` [PATCH net v2 5/7] net: hibmcge: fix the incorrect np_link fail state issue Jijie Shao
2025-04-03 13:53 ` [PATCH net v2 6/7] net: hibmcge: fix not restore rx pause mac addr after reset issue Jijie Shao
2025-04-04 14:58 ` Jakub Kicinski
2025-04-07 1:06 ` Jijie Shao
2025-04-07 17:11 ` Jakub Kicinski
2025-04-10 1:07 ` Jijie Shao
2025-04-03 13:53 ` [PATCH net v2 7/7] net: hibmcge: fix multiple phy_stop() issue Jijie Shao
2025-04-04 11:01 ` Simon Horman [this message]
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=20250404110145.GF214849@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=chenhao418@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jonathan.cameron@huawei.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=salil.mehta@huawei.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=shaojijie@huawei.com \
--cc=shenjian15@huawei.com \
--cc=wangpeiyang1@huawei.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).