From: Ramon Fried <rfried.dev@gmail.com>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
U-Boot Mailing List <u-boot@lists.denx.de>,
Stefano Babic <sbabic@denx.de>,
Fabio Estevam <festevam@gmail.com>,
"NXP i . MX U-Boot Team" <uboot-imx@nxp.com>
Subject: Re: [PATCH 2/6] net: dsa: move cpu port probe to dsa_post_probe
Date: Fri, 1 Apr 2022 22:40:39 +0300 [thread overview]
Message-ID: <CAGi-RUL18TB23uiLqdvGcfh8Hr95mvzOAtseTz_m2ax2GNHjog@mail.gmail.com> (raw)
In-Reply-To: <20220329225240.1416-3-tharvey@gateworks.com>
On Wed, Mar 30, 2022 at 1:52 AM Tim Harvey <tharvey@gateworks.com> wrote:
>
> In order to ensure that a DSA driver probe gets called before
> dsa_ops->port_probe move the port_probe of the cpu_port to
> a post-probe function.
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
> net/dsa-uclass.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/net/dsa-uclass.c b/net/dsa-uclass.c
> index 9ff55a02fb23..07edc584daf3 100644
> --- a/net/dsa-uclass.c
> +++ b/net/dsa-uclass.c
> @@ -466,8 +466,6 @@ static int dsa_pre_probe(struct udevice *dev)
> {
> struct dsa_pdata *pdata = dev_get_uclass_plat(dev);
> struct dsa_priv *priv = dev_get_uclass_priv(dev);
> - struct dsa_ops *ops = dsa_get_ops(dev);
> - int err;
>
> priv->num_ports = pdata->num_ports;
> priv->cpu_port = pdata->cpu_port;
> @@ -480,6 +478,15 @@ static int dsa_pre_probe(struct udevice *dev)
> uclass_find_device_by_ofnode(UCLASS_ETH, pdata->master_node,
> &priv->master_dev);
>
> + return 0;
> +}
> +
> +static int dsa_post_probe(struct udevice *dev)
> +{
> + struct dsa_priv *priv = dev_get_uclass_priv(dev);
> + struct dsa_ops *ops = dsa_get_ops(dev);
> + int err;
> +
> /* Simulate a probing event for the CPU port */
> if (ops->port_probe) {
> err = ops->port_probe(dev, priv->cpu_port,
> @@ -489,13 +496,14 @@ static int dsa_pre_probe(struct udevice *dev)
> }
>
> return 0;
> -}
> +};
>
> UCLASS_DRIVER(dsa) = {
> .id = UCLASS_DSA,
> .name = "dsa",
> .post_bind = dsa_post_bind,
> .pre_probe = dsa_pre_probe,
> + .post_probe = dsa_post_probe,
> .per_device_auto = sizeof(struct dsa_priv),
> .per_device_plat_auto = sizeof(struct dsa_pdata),
> .per_child_plat_auto = sizeof(struct dsa_port_pdata),
> --
> 2.17.1
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
next prev parent reply other threads:[~2022-04-01 19:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-29 22:52 [PATCH 0/6] Add MV88E61xx DSA driver and use on gwventana Tim Harvey
2022-03-29 22:52 ` [PATCH 1/6] net: mdio-uclass: scan for dm mdio children on post-bind Tim Harvey
2022-04-01 19:40 ` Ramon Fried
2022-03-29 22:52 ` [PATCH 2/6] net: dsa: move cpu port probe to dsa_post_probe Tim Harvey
2022-04-01 19:40 ` Ramon Fried [this message]
2022-03-29 22:52 ` [PATCH 3/6] net: mdio-uclass: add wrappers for read/write/reset operations Tim Harvey
2022-03-29 22:52 ` [PATCH 4/6] net: fec: add support for DM_MDIO Tim Harvey
2022-03-31 17:01 ` Vladimir Oltean
2022-03-31 17:48 ` Tim Harvey
2022-03-31 19:36 ` Vladimir Oltean
2022-04-01 17:53 ` Tim Harvey
2022-04-01 19:14 ` Vladimir Oltean
2022-03-29 22:52 ` [PATCH 5/6] net: add MV88E61xx DSA driver Tim Harvey
2022-03-29 23:22 ` Marek Behún
2022-03-30 15:46 ` Tim Harvey
2022-03-31 10:30 ` Marek Behún
2022-04-01 20:24 ` Tim Harvey
2022-04-02 23:17 ` Vladimir Oltean
2022-04-07 20:33 ` Tim Harvey
2022-04-07 21:31 ` Vladimir Oltean
2022-04-07 23:03 ` Tim Harvey
2022-04-08 0:26 ` Marek Behún
2022-04-12 14:13 ` Vladimir Oltean
2022-04-14 21:30 ` Tim Harvey
2022-03-29 22:52 ` [PATCH 6/6] board: gw_ventana: enable MV88E61XX DSA support Tim Harvey
2022-03-30 16:01 ` [PATCH 0/6] Add MV88E61xx DSA driver and use on gwventana Tim Harvey
2022-03-31 20:47 ` Chris Packham
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=CAGi-RUL18TB23uiLqdvGcfh8Hr95mvzOAtseTz_m2ax2GNHjog@mail.gmail.com \
--to=rfried.dev@gmail.com \
--cc=festevam@gmail.com \
--cc=joe.hershberger@ni.com \
--cc=sbabic@denx.de \
--cc=tharvey@gateworks.com \
--cc=u-boot@lists.denx.de \
--cc=uboot-imx@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.