linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, Ioana Ciornei <ioana.ciornei@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 04/12] net: dpaa2-mac: remove defensive check in dpaa2_mac_disconnect()
Date: Tue, 29 Nov 2022 19:51:46 +0100	[thread overview]
Message-ID: <Y4ZUwlGPZZCEDUp9@lunn.ch> (raw)
In-Reply-To: <20221129141221.872653-5-vladimir.oltean@nxp.com>

On Tue, Nov 29, 2022 at 04:12:13PM +0200, Vladimir Oltean wrote:
> dpaa2_mac_disconnect() will only be called with a NULL mac->phylink if
> dpaa2_mac_connect() failed, or was never called.
> 
> The callers are these:
> 
> dpaa2_eth_disconnect_mac():
> 
> 	if (dpaa2_eth_is_type_phy(priv))
> 		dpaa2_mac_disconnect(priv->mac);
> 
> dpaa2_switch_port_disconnect_mac():
> 
> 	if (dpaa2_switch_port_is_type_phy(port_priv))
> 		dpaa2_mac_disconnect(port_priv->mac);
> 
> priv->mac can be NULL, but in that case, dpaa2_eth_is_type_phy() returns
> false, and dpaa2_mac_disconnect() is never called. Similar for
> dpaa2-switch.
> 
> When priv->mac is non-NULL, it means that dpaa2_mac_connect() returned
> zero (success), and therefore, priv->mac->phylink is also a valid
> pointer.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  reply	other threads:[~2022-11-29 18:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 14:12 [PATCH net-next 00/12] Fix rtnl_mutex deadlock with DPAA2 and SFP modules Vladimir Oltean
2022-11-29 14:12 ` [PATCH net-next 01/12] net: dpaa2-eth: don't use -ENOTSUPP error code Vladimir Oltean
2022-11-29 18:48   ` Andrew Lunn
2022-11-29 14:12 ` [PATCH net-next 02/12] net: dpaa2: replace dpaa2_mac_is_type_fixed() with dpaa2_mac_is_type_phy() Vladimir Oltean
2022-11-29 18:50   ` Andrew Lunn
2022-11-29 14:12 ` [PATCH net-next 03/12] net: dpaa2-mac: absorb phylink_start() call into dpaa2_mac_start() Vladimir Oltean
2022-11-29 18:51   ` Andrew Lunn
2022-11-29 14:12 ` [PATCH net-next 04/12] net: dpaa2-mac: remove defensive check in dpaa2_mac_disconnect() Vladimir Oltean
2022-11-29 18:51   ` Andrew Lunn [this message]
2022-11-29 14:12 ` [PATCH net-next 05/12] net: dpaa2-eth: assign priv->mac after dpaa2_mac_connect() call Vladimir Oltean
2022-11-29 14:12 ` [PATCH net-next 06/12] net: dpaa2-switch: assign port_priv->mac " Vladimir Oltean
2022-11-29 14:12 ` [PATCH net-next 07/12] net: dpaa2: publish MAC stringset to ethtool -S even if MAC is missing Vladimir Oltean
2022-11-29 18:54   ` Andrew Lunn
2022-11-29 14:12 ` [PATCH net-next 08/12] net: dpaa2-switch replace direct MAC access with dpaa2_switch_port_has_mac() Vladimir Oltean
2022-11-29 18:55   ` Andrew Lunn
2022-11-29 14:12 ` [PATCH net-next 09/12] net: dpaa2-eth: connect to MAC before requesting the "endpoint changed" IRQ Vladimir Oltean
2022-11-29 14:12 ` [PATCH net-next 10/12] net: dpaa2-eth: serialize changes to priv->mac with a mutex Vladimir Oltean
2022-11-29 14:12 ` [PATCH net-next 11/12] net: dpaa2-switch: " Vladimir Oltean
2022-11-29 14:12 ` [PATCH net-next 12/12] net: dpaa2-mac: move rtnl_lock() only around phylink_{,dis}connect_phy() Vladimir Oltean
2022-11-30 16:30 ` [PATCH net-next 00/12] Fix rtnl_mutex deadlock with DPAA2 and SFP modules Ioana Ciornei
2022-12-01 12:50 ` patchwork-bot+netdevbpf

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=Y4ZUwlGPZZCEDUp9@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vladimir.oltean@nxp.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;
as well as URLs for NNTP newsgroup(s).