From: Jakub Kicinski <kuba@kernel.org>
To: Leon Romanovsky <leon@kernel.org>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, lorenzo.bianconi@redhat.com, nbd@nbd.name,
john@phrozen.org, sean.wang@mediatek.com,
Mark-MC.Lee@mediatek.com, sujuan.chen@mediatek.com,
daniel@makrotopia.org
Subject: Re: [PATCH v3 net-next 3/5] net: ethernet: mtk_eth_soc: align reset procedure to vendor sdk
Date: Mon, 9 Jan 2023 16:28:00 -0800 [thread overview]
Message-ID: <20230109162800.391f7ec8@kernel.org> (raw)
In-Reply-To: <Y7rIqUhWdX1yoaKO@unreal>
On Sun, 8 Jan 2023 15:44:09 +0200 Leon Romanovsky wrote:
> On Sat, Jan 07, 2023 at 03:50:52PM +0100, Lorenzo Bianconi wrote:
> > Avoid to power-down the ethernet chip during hw reset and align reset
> > procedure to vendor sdk.
> >
> > Tested-by: Daniel Golle <daniel@makrotopia.org>
> > Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
> > Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > drivers/net/ethernet/mediatek/mtk_eth_soc.c | 94 +++++++++++++++-----
> > drivers/net/ethernet/mediatek/mtk_eth_soc.h | 12 +++
> > drivers/net/ethernet/mediatek/mtk_ppe.c | 27 ++++++
> > drivers/net/ethernet/mediatek/mtk_ppe.h | 1 +
> > drivers/net/ethernet/mediatek/mtk_ppe_regs.h | 6 ++
> > 5 files changed, 116 insertions(+), 24 deletions(-)
>
> mdelay is macro wrapper around udelay, to account for possible overflow when
> passing large arguments to udelay. In general, use of mdelay is discouraged
> and code should be refactored to allow for the use of msleep.
>
> https://www.kernel.org/doc/html/latest/timers/timers-howto.html#delays-information-on-the-various-kern
>
> It is not your case as you are passing small numbers and can use udelay instead.
Good point, there's one:
mdelay(100)
in the series which is a lot of time to be spinning blocking a core :S
In this particular patch you basically:
rtnl_lock();
mdelay(10);
..
mdelay(15);
which seems odd. If you can take rtnl you can sleep, so perhaps this is
trying to be competence-compatible with the vendor driver unnecessarily?
next prev parent reply other threads:[~2023-01-10 0:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-07 14:50 [PATCH v3 net-next 0/5] net: ethernet: mtk_wed: introduce reset support Lorenzo Bianconi
2023-01-07 14:50 ` [PATCH v3 net-next 1/5] net: ethernet: mtk_eth_soc: introduce mtk_hw_reset utility routine Lorenzo Bianconi
2023-01-08 13:38 ` Leon Romanovsky
2023-01-07 14:50 ` [PATCH v3 net-next 2/5] net: ethernet: mtk_eth_soc: introduce mtk_hw_warm_reset support Lorenzo Bianconi
2023-01-08 13:41 ` Leon Romanovsky
2023-01-07 14:50 ` [PATCH v3 net-next 3/5] net: ethernet: mtk_eth_soc: align reset procedure to vendor sdk Lorenzo Bianconi
2023-01-08 13:44 ` Leon Romanovsky
2023-01-10 0:28 ` Jakub Kicinski [this message]
2023-01-07 14:50 ` [PATCH v3 net-next 4/5] net: ethernet: mtk_eth_soc: add dma checks to mtk_hw_reset_check Lorenzo Bianconi
2023-01-08 13:45 ` Leon Romanovsky
2023-01-07 14:50 ` [PATCH v3 net-next 5/5] net: ethernet: mtk_wed: add reset/reset_complete callbacks Lorenzo Bianconi
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=20230109162800.391f7ec8@kernel.org \
--to=kuba@kernel.org \
--cc=Mark-MC.Lee@mediatek.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=john@phrozen.org \
--cc=leon@kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.wang@mediatek.com \
--cc=sujuan.chen@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;
as well as URLs for NNTP newsgroup(s).