Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v6 2/3] net: ethernet: renesas: Add support for "Ethernet Switch"
Date: Sat, 29 Oct 2022 20:05:08 +0200	[thread overview]
Message-ID: <Y11rVIKtUDf1i5xP@lunn.ch> (raw)
In-Reply-To: <20221028065458.2417293-3-yoshihiro.shimoda.uh@renesas.com>

> +	for (i = 0; i < RSWITCH_NUM_PORTS; i++) {
> +		err = register_netdev(priv->rdev[i]->ndev);
> +		if (err) {
> +			for (i--; i >= 0; i--)
> +				unregister_netdev(priv->rdev[i]->ndev);
> +			goto err_register_netdev;
> +		}
> +	}
> +
> +	err = rswitch_ether_port_init_all(priv);
> +	if (err)
> +		goto err_ether_port_init_all;

As soon as you call register_netdev() the devices are active, and can
be in use. E.G. NFS root can start mounting the filesystem before
register_netdev() even returns. Is it safe to call driver operations
before rswitch_ether_port_init_all().

	Andrew

  reply	other threads:[~2022-10-29 18:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28  6:54 [PATCH v6 0/3] net: ethernet: renesas: Add support for "Ethernet Switch" Yoshihiro Shimoda
2022-10-28  6:54 ` [PATCH v6 1/3] dt-bindings: net: renesas: Document Renesas Ethernet Switch Yoshihiro Shimoda
2022-10-28 21:54   ` Krzysztof Kozlowski
2022-10-28  6:54 ` [PATCH v6 2/3] net: ethernet: renesas: Add support for "Ethernet Switch" Yoshihiro Shimoda
2022-10-29 18:05   ` Andrew Lunn [this message]
2022-10-31  8:21     ` Yoshihiro Shimoda
2022-10-28  6:54 ` [PATCH v6 3/3] net: ethernet: renesas: rswitch: Add R-Car Gen4 gPTP support Yoshihiro Shimoda

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=Y11rVIKtUDf1i5xP@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.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