Netdev List
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, hkallweit1@gmail.com, linux@armlinux.org.uk,
	shaojijie@huawei.com, horms@kernel.org, runyu.xiao@seu.edu.cn,
	mmyangfl@gmail.com, hvr@gnu.org, jeff@garzik.org,
	danny.kukawka@bisect.de, mugunthanvnm@ti.com,
	sebastian.hesselbarth@gmail.com, linux-kernel@vger.kernel.org,
	manuel.lauss@gmail.com
Subject: Re: [PATCH net v2 07/12] net: au1000: fix buffer descriptor free list insertion
Date: Tue, 17 Nov 2026 11:13:37 -0800	[thread overview]
Message-ID: <fe73ee96-3ef2-4ec6-acb0-8e6794615ca1@gmail.com> (raw)
In-Reply-To: <179483704622.3136.16694282680991633445@kernel.org>

On 11/16/26 05:50, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
> 
> Low priority / nit picks for your consideration:
> 
> - [Low] The commit message for "net: au1000: fix buffer descriptor free
>    list insertion" says the old au1000_ReleaseDB() "loses free…
> 
> --
> 
> net: au1000: fix buffer descriptor free list insertion
> 
> This patch changes au1000_ReleaseDB() so the returned descriptor's pnext
> points to the old free list head before it becomes the new head. Before
> this, the old head's pnext was set to the returned descriptor. The new
> code matches au1000_GetFreeDB() and how the list is set up in probe.
> 
>> ReleaseDB links the old head to the returned descriptor and makes the
>> returned descriptor the new head without updating its stale next
>> pointer. This loses free descriptors and can create cycles. Link the
>> returned descriptor to the old head instead, matching GetFreeDB and the
>> list initialization.
>>
>> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> 
> [Severity: Low]
> The code change looks correct. Should the commit message say that the old
> behaviour had no runtime effect, though?
> 
> au1000_ReleaseDB() is only called on teardown paths: the err_out unwind
> in au1000_probe() and au1000_remove(). In both cases the descriptor
> buffers and aup are freed right afterwards:
> 
> drivers/net/ethernet/amd/au1000_eth.c:au1000_remove() {
>      ...
> 	for (i = 0; i < NUM_RX_DMA; i++)
> 		if (aup->rx_db_inuse[i])
> 			au1000_ReleaseDB(aup, aup->rx_db_inuse[i]);
> 
> 	for (i = 0; i < NUM_TX_DMA; i++)
> 		if (aup->tx_db_inuse[i])
> 			au1000_ReleaseDB(aup, aup->tx_db_inuse[i]);
> 
> 	dma_free_coherent(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
> 			  aup->vaddr, aup->dma_addr);
>      ...
> 	free_netdev(dev);
> }
> 
> The err_out path in au1000_probe() also falls through to
> dma_free_coherent() and free_netdev().
> 
> au1000_GetFreeDB() is only called from au1000_probe(), before any
> au1000_ReleaseDB() call, and no RX or TX path walks aup->pDBfree. Also,
> NUM_RX_BUFFS equals NUM_RX_DMA and NUM_TX_BUFFS equals NUM_TX_DMA, so
> the free list is already empty after a successful probe.
> 
> So the lost entries or cycles only ever exist in a list that is about to
> be freed and is never read again. With the Fixes: tag, stable tooling
> could pick this up as a user-visible fix.
> 
> Could the message say the bug is latent with no functional impact, and
> either drop the Fixes: tag or explain why it is needed?
> 

Yes I dropped it from the fixes since it has no functional impact.

pw-bot: not applicable
-- 
Florian

  reply	other threads:[~2026-11-17 19:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  4:52 [PATCH net v2 00/12] net: au1000: Bug fixes Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 01/12] net: au1000: recycle RX descriptors on allocation failure Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 02/12] net: au1000: clear all-multicast mode when restoring hash filtering Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 03/12] net: au1000: disconnect the PHY before freeing the MDIO bus Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 04/12] net: au1000: report MDIO transaction timeouts Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-17 19:09     ` Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 05/12] net: au1000: serialize TX completion with packet submission Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 06/12] net: au1000: assign a valid MAC address without platform data Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-17 19:11     ` Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 07/12] net: au1000: fix buffer descriptor free list insertion Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-17 19:13     ` Florian Fainelli [this message]
2026-11-12  4:52 ` [PATCH net v2 08/12] net: au1000: restore receive filtering before enabling RX Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 09/12] net: au1000: restore RX buffer addresses when restarting the MAC Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 10/12] net: phy: smsc: wait for LAN83C183 power-down recovery Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-17 19:15     ` Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 11/12] net: au1000: keep the MAC stopped until the PHY link is ready Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-17 19:18     ` Florian Fainelli
2026-11-12  4:52 ` [PATCH net v2 12/12] net: au1000: reject frames larger than the TX bounce buffer Florian Fainelli
2026-11-16 13:50   ` netdev-bot+sashiko
2026-11-17 19:19     ` Florian Fainelli

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=fe73ee96-3ef2-4ec6-acb0-8e6794615ca1@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=danny.kukawka@bisect.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=hvr@gnu.org \
    --cc=jeff@garzik.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=manuel.lauss@gmail.com \
    --cc=mmyangfl@gmail.com \
    --cc=mugunthanvnm@ti.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=runyu.xiao@seu.edu.cn \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=shaojijie@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