Devicetree
 help / color / mirror / Atom feed
From: "Gupta, Suraj" <suraj.gupta2@amd.com>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v3 3/6] net: xilinx: axienet: Add 10G/25G (XXV) ethernet support
Date: Mon, 7 Sep 2026 01:11:48 +0530	[thread overview]
Message-ID: <6841b0e9-00d9-4ad4-bdaf-ed40aa696dad@amd.com> (raw)
In-Reply-To: <20260901150908.D57951F000E9@smtp.kernel.org>



On 9/1/2026 8:39 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
> - [High] Missing mac_link_up callback for XXV MAC causes runtime-switchable speeds and flow control to never be programmed.
> - [High] Legacy DMA descriptors and SKBs are leaked if mac_init() fails in axienet_device_reset().
> - [High] Failure of axienet_xxv_mac_init() is ignored in the DMA error handler, proceeding with uninitialized hardware state.
> --
> 
> commit 0e020a3d14a024a203937c2f29cbb4fde9c6c31b
> Author: Suraj Gupta <suraj.gupta2@amd.com>
> 
> net: xilinx: axienet: Add 10G/25G (XXV) ethernet support
> 
> This commit adds support for the Xilinx XXV Ethernet IP, introducing a new
> axienet_10g25g_config structure and associated callbacks. It also propagates
> axienet_device_reset() failures in axienet_open().
> 
>> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>> index a4963da53b306..222c82a1de914 100644
>> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> [ ... ]
>> @@ -2818,6 +2819,9 @@ static void axienet_dma_err_handler(struct work_struct *work)
>>   
>>   	axienet_dma_start(lp);
>>   
>> +	/* This error handler runs only for the legacy embedded-DMA (1G) path,
>> +	 * whose mac_init() cannot fail, so its return value is not checked.
>> +	 */
>>   	lp->axienet_config->mac_init(ndev);
> 
> [Severity: High]
> If the XXV MAC falls back to legacy DMA due to a missing device tree property,
> couldn't this error handler run for the XXV MAC as well?
> 
> If axienet_xxv_mac_init() fails here (e.g., from a timeout), does the driver
> proceed to configure hardware options and re-enable packet reception on an
> uninitialized or failed MAC?
> 



We don't support legacy DMA for XXV ethernet & fail probe if dmaengine 
properties are missing. So this is a false issue.
> [ ... ]
>> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_xxv.c b/drivers/net/ethernet/xilinx/xilinx_axienet_xxv.c
>> new file mode 100644
>> index 0000000000000..46b48a773c15a
>> --- /dev/null
>> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_xxv.c
> [ ... ]
>> +static int axienet_xxv_mac_init(struct net_device *ndev)
>> +{
>> +	struct axienet_local *lp = netdev_priv(ndev);
>> +	int ret;
>> +
>> +	ret = axienet_xxv_poll_link_ready(ndev);
>> +	if (ret)
>> +		return ret;
> 
> [Severity: High]
> If this function returns an error, are the legacy DMA descriptors leaked?
> 
> Looking at axienet_device_reset(), which calls this function when using
> legacy DMA:
> 
> axienet_device_reset()
>      ...
>      if (!lp->use_dmaengine) {
>          ret = axienet_dma_bd_init(ndev);
>          if (ret)
>              return ret;
>      }
>      ...
>      ret = lp->axienet_config->mac_init(ndev);
>      if (ret)
>          return ret;
> 
> When mac_init() fails, it returns early without calling
> axienet_dma_bd_release(ndev). Can this cause a memory leak of the TX/RX
> rings and their associated SKBs?
> 


Same here, XXV ethernet driver supports dmaengine flow only. Probe will 
fail if dmanegine properties are missing in XXV DT. So this condition 
won't occur and is false positive issue.

> [ ... ]
>> +const struct axienet_config axienet_10g25g_config = {
>> +	.sw_padding = true,
>> +	.internal_pcs = true,
>> +	.regs_n = XXV_REGS_N,
>> +	.clk_init = axienet_10g25g_clk_init,
>> +	.setoptions = axienet_xxv_setoptions,
>> +	.probe_init = axienet_xxv_probe_init,
>> +	.gt_reset = axienet_xxv_gt_reset,
>> +	.mac_init = axienet_xxv_mac_init,
>> +	.get_regs = axienet_xxv_get_regs,
>> +	.phylink_set_caps = axienet_xxv_phylink_set_capabilities,
>> +	.pcs_ops = &axienet_xxv_pcs_ops,
>> +};
> 
> [Severity: High]
> Since axienet_xxv_phylink_set_capabilities() advertises runtime-switchable
> speeds (10G and 25G), shouldn't there be a mac_link_up callback here to
> program the negotiated speed and pause settings to the hardware?
> 
> Without a mac_link_up callback, when phylink resolves to a non-default speed
> or enables pause frames, will the hardware remain unconfigured, potentially
> causing the datapath to silently fail?
> 


As mentioned in cover-letter, due to phylink limitations, we aren't able 
to advertise both 10G and 25G base-r interfaces and are open to 
suggestions to handle it.

Regards,
Suraj

  reply	other threads:[~2026-09-06 19:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 15:08 [PATCH net-next v3 0/6] net: xilinx: axienet: Add 10G/25G (XXV) ethernet support Suraj Gupta
2026-08-31 15:08 ` [PATCH net-next v3 1/6] net: xilinx: axienet: Introduce axienet_config for MAC-specific ops Suraj Gupta
2026-09-01 15:09   ` sashiko-bot
2026-09-06 19:24     ` Gupta, Suraj
2026-08-31 15:08 ` [PATCH net-next v3 2/6] dt-bindings: net: xlnx,xxv-ethernet: Add Xilinx XXV 10G/25G Ethernet Suraj Gupta
2026-09-01  2:27   ` Andrew Lunn
2026-09-01  3:18     ` Gupta, Suraj
2026-09-01 14:31       ` Andrew Lunn
2026-09-01 17:01         ` Gupta, Suraj
2026-08-31 15:08 ` [PATCH net-next v3 3/6] net: xilinx: axienet: Add 10G/25G (XXV) ethernet support Suraj Gupta
2026-09-01  2:52   ` Andrew Lunn
2026-09-01  3:27     ` Gupta, Suraj
2026-09-01 15:09   ` sashiko-bot
2026-09-06 19:41     ` Gupta, Suraj [this message]
2026-08-31 15:08 ` [PATCH net-next v3 4/6] net: xilinx: axienet: Make axienet_rmon_ranges non-static for reuse Suraj Gupta
2026-08-31 15:08 ` [PATCH net-next v3 5/6] net: xilinx: axienet: Dispatch statistics through axienet_config ops Suraj Gupta
2026-09-01 15:09   ` sashiko-bot
2026-09-06 19:25     ` Gupta, Suraj
2026-08-31 15:08 ` [PATCH net-next v3 6/6] net: xilinx: axienet: Add statistics support for XXV ethernet Suraj Gupta

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=6841b0e9-00d9-4ad4-bdaf-ed40aa696dad@amd.com \
    --to=suraj.gupta2@amd.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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