From: Roger Quadros <rogerq@kernel.org>
To: "A. Sverdlin" <alexander.sverdlin@siemens.com>, u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>,
Ramon Fried <rfried.dev@gmail.com>,
Siddharth Vadapalli <s-vadapalli@ti.com>,
Nishanth Menon <nm@ti.com>,
Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
Suman Anna <s-anna@ti.com>, Keerthy <j-keerthy@ti.com>,
Grygorii Strashko <grygorii.strashko@ti.com>
Subject: Re: [PATCH] net: ti: am65-cpsw-nuss: don't touch DMA after stop
Date: Fri, 10 May 2024 12:11:16 +0300 [thread overview]
Message-ID: <98ffe161-33d0-479b-972e-92f9e8b8c2ff@kernel.org> (raw)
In-Reply-To: <20240508183605.955341-1-alexander.sverdlin@siemens.com>
Hi Alexander,
On 08/05/2024 21:36, A. Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>
> Contrary to doc/develop/driver-model/ethernet.rst contract, eth_ops
> .free_pkt can be called after .stop, there are several error paths in TFTP,
> for instance:
Doesn't this mean we need to fix TFTP instead of patching the Ethernet
driver? I'm sure the issue is present for all Ethernet drivers as none
of them are checking if Ethernet is stopped. Just that most of them
don't print any error message so it goes unnoticed.
>
> eth_halt() <= tftp_handler() <= net_process_received_packet() <= eth_rx()
> ...
> am65_cpsw_free_pkt() <= eth_rx()>
> Which results in (deliberately "tftpboot"ing non-existing file):
>
> TFTP error: 'File not found' (1)
> Not retrying...
> am65_cpsw_nuss_port ethernet@8000000port@1: RX dma free_pkt failed -22
>
> Avoid the error message by checking that the interface is still not stopped
> in am65_cpsw_free_pkt().
>
> Fixes: 9d0dca1199d1 ("net: ethernet: ti: Introduce am654 gigabit eth switch subsystem driver")
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> ---
> drivers/net/ti/am65-cpsw-nuss.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ti/am65-cpsw-nuss.c b/drivers/net/ti/am65-cpsw-nuss.c
> index 65ade1afd05..646f618afcf 100644
> --- a/drivers/net/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ti/am65-cpsw-nuss.c
> @@ -523,6 +523,9 @@ static int am65_cpsw_free_pkt(struct udevice *dev, uchar *packet, int length)
> struct am65_cpsw_common *common = priv->cpsw_common;
> int ret;
>
> + if (!common->started)
> + return -ENETDOWN;
> +
> if (length > 0) {
> u32 pkt = common->rx_next % UDMA_RX_DESC_NUM;
>
--
cheers,
-roger
next prev parent reply other threads:[~2024-05-10 9:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 18:36 [PATCH] net: ti: am65-cpsw-nuss: don't touch DMA after stop A. Sverdlin
2024-05-10 9:11 ` Roger Quadros [this message]
2024-05-10 19:40 ` Sverdlin, Alexander
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=98ffe161-33d0-479b-972e-92f9e8b8c2ff@kernel.org \
--to=rogerq@kernel.org \
--cc=alexander.sverdlin@siemens.com \
--cc=grygorii.strashko@ti.com \
--cc=j-keerthy@ti.com \
--cc=joe.hershberger@ni.com \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=nm@ti.com \
--cc=rfried.dev@gmail.com \
--cc=s-anna@ti.com \
--cc=s-vadapalli@ti.com \
--cc=u-boot@lists.denx.de \
/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