public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Parvathi Pudi <parvathi@couthit.com>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, danishanwar@ti.com, rogerq@kernel.org,
	pmohan@couthit.com, basharath@couthit.com, afd@ti.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, alok.a.tiwari@oracle.com,
	horms@kernel.org, pratheesh@ti.com, j-rameshbabu@ti.com,
	vigneshr@ti.com, praneeth@ti.com, srk@ti.com, rogerq@ti.com,
	krishna@couthit.com, mohan@couthit.com
Subject: Re: [PATCH net-next v11 3/3] net: ti: icssm-prueth: Add support for ICSSM RSTP switch
Date: Thu, 8 Jan 2026 12:28:59 +0100	[thread overview]
Message-ID: <a1341a4b-3ad0-43dd-adff-66d7d90be471@redhat.com> (raw)
In-Reply-To: <20260105122549.1808390-4-parvathi@couthit.com>

On 1/5/26 1:23 PM, Parvathi Pudi wrote:
> +static int icssm_prueth_ndev_port_link(struct net_device *ndev,
> +				       struct net_device *br_ndev)
> +{
> +	struct prueth_emac *emac = netdev_priv(ndev);
> +	struct prueth *prueth = emac->prueth;
> +	unsigned long flags;
> +	int ret = 0;
> +
> +	dev_dbg(prueth->dev, "%s: br_mbrs=0x%x %s\n",
> +		__func__, prueth->br_members, ndev->name);
> +
> +	spin_lock_irqsave(&emac->addr_lock, flags);
> +
> +	if (!prueth->br_members) {
> +		prueth->hw_bridge_dev = br_ndev;
> +	} else {
> +		/* This is adding the port to a second bridge,
> +		 * this is unsupported
> +		 */
> +		if (prueth->hw_bridge_dev != br_ndev) {
> +			spin_unlock_irqrestore(&emac->addr_lock, flags);
> +			return -EOPNOTSUPP;
> +		}
> +	}
> +
> +	prueth->br_members |= BIT(emac->port_id);
> +
> +	ret = icssm_prueth_port_offload_fwd_mark_update(prueth);

More AI generated feedback here that still looks valid to me:

"""
ndo_stop() can sleep (e.g., via rproc_shutdown()). This function appears
to be called while holding a spinlock via the call chain:

  icssm_prueth_ndev_port_link()
    -> spin_lock_irqsave(&emac->addr_lock)
      -> icssm_prueth_port_offload_fwd_mark_update()
        -> icssm_prueth_change_mode()
          -> ndo_stop() / ndo_open()

Is this intentional? The ndo_open() path also calls
icssm_prueth_sw_init_fdb_table() which does kmalloc(GFP_KERNEL) and
rproc_boot(), both of which may sleep.
"""

There are other similar cases; for the full report see:

https://netdev-ai.bots.linux.dev/ai-review.html?id=ce23f731-f25b-4082-a5d0-c1261ab829ed

/P


  reply	other threads:[~2026-01-08 11:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 12:23 [PATCH net-next v11 0/3] STP/RSTP SWITCH support for PRU-ICSSM Ethernet driver Parvathi Pudi
2026-01-05 12:23 ` [PATCH net-next v11 1/3] net: ti: icssm-prueth: Add helper functions to configure and maintain FDB Parvathi Pudi
2026-01-08 11:16   ` Paolo Abeni
2026-01-09 13:36     ` Parvathi Pudi
2026-01-05 12:23 ` [PATCH net-next v11 2/3] net: ti: icssm-prueth: Add switchdev support for icssm_prueth driver Parvathi Pudi
2026-01-05 12:23 ` [PATCH net-next v11 3/3] net: ti: icssm-prueth: Add support for ICSSM RSTP switch Parvathi Pudi
2026-01-08 11:28   ` Paolo Abeni [this message]
2026-01-09 13:38     ` Parvathi Pudi

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=a1341a4b-3ad0-43dd-adff-66d7d90be471@redhat.com \
    --to=pabeni@redhat.com \
    --cc=afd@ti.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=basharath@couthit.com \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=j-rameshbabu@ti.com \
    --cc=krishna@couthit.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mohan@couthit.com \
    --cc=netdev@vger.kernel.org \
    --cc=parvathi@couthit.com \
    --cc=pmohan@couthit.com \
    --cc=praneeth@ti.com \
    --cc=pratheesh@ti.com \
    --cc=rogerq@kernel.org \
    --cc=rogerq@ti.com \
    --cc=srk@ti.com \
    --cc=vigneshr@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