From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Roger Quadros <rogerq@kernel.org>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, s-vadapalli@ti.com, r-gunasekaran@ti.com,
srk@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/3] net: ethernet: am65-cpsw: Error out if Enable TX/RX channel fails
Date: Tue, 14 Nov 2023 14:07:58 +0200 [thread overview]
Message-ID: <20231114120758.kz5n3x4fawhcegqi@skbuf> (raw)
In-Reply-To: <20231113110708.137379-4-rogerq@kernel.org>
On Mon, Nov 13, 2023 at 01:07:08PM +0200, Roger Quadros wrote:
> k3_udma_glue_enable_rx/tx_chn returns error code on failure.
> Bail out on error while enabling TX/RX channel.
>
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 33 +++++++++++++++++++-----
> 1 file changed, 26 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> index 7c440899c93c..340f25bf33b1 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> @@ -372,7 +372,7 @@ static void am65_cpsw_init_port_emac_ale(struct am65_cpsw_port *port);
> static int am65_cpsw_nuss_common_open(struct am65_cpsw_common *common)
> {
> struct am65_cpsw_host *host_p = am65_common_get_host(common);
> - int port_idx, i, ret;
> + int port_idx, i, ret, tx;
> struct sk_buff *skb;
> u32 val, port_mask;
>
> @@ -453,13 +453,22 @@ static int am65_cpsw_nuss_common_open(struct am65_cpsw_common *common)
> }
> kmemleak_not_leak(skb);
> }
> - k3_udma_glue_enable_rx_chn(common->rx_chns.rx_chn);
>
> - for (i = 0; i < common->tx_ch_num; i++) {
> - ret = k3_udma_glue_enable_tx_chn(common->tx_chns[i].tx_chn);
> - if (ret)
> - return ret;
Can you comment on the kmemleak_not_leak(skb) call above, and its
relationship to the pre-existing error handling path in am65_cpsw_nuss_common_open()?
I see that the dev_kfree_skb_any() call is being made from am65_cpsw_nuss_rx_cleanup(),
which is only called from am65_cpsw_nuss_common_stop().
So if there are errors during am65_cpsw_nuss_common_open() and
descriptors have already been added to the RX DMA channel, they will not
be removed either from hardware or from software. How does that work?
next prev parent reply other threads:[~2023-11-14 12:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 11:07 [PATCH net-next 0/3] net: ethernet: am65-cpsw: Add ethtool standard MAC stats Roger Quadros
2023-11-13 11:07 ` [PATCH net-next 1/3] net: ethernet: am65-cpsw: Add standard Ethernet MAC stats to ethtool Roger Quadros
2023-11-13 13:26 ` Andrew Lunn
2023-11-13 16:42 ` Simon Horman
2023-11-14 12:06 ` Roger Quadros
2023-11-13 11:07 ` [PATCH net-next 2/3] net: ethernet: am65-cpsw: Set default TX channels to maximum Roger Quadros
2023-11-13 13:26 ` Andrew Lunn
2023-11-14 12:13 ` Vladimir Oltean
2023-11-14 20:16 ` Roger Quadros
2023-11-13 11:07 ` [PATCH net-next 3/3] net: ethernet: am65-cpsw: Error out if Enable TX/RX channel fails Roger Quadros
2023-11-13 13:27 ` Andrew Lunn
2023-11-14 12:07 ` Vladimir Oltean [this message]
2023-11-14 19:53 ` Roger Quadros
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=20231114120758.kz5n3x4fawhcegqi@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=r-gunasekaran@ti.com \
--cc=rogerq@kernel.org \
--cc=s-vadapalli@ti.com \
--cc=srk@ti.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
all inboxes | Powered by JetHome®