From: Vladimir Oltean <olteanv@gmail.com>
To: George McCollister <george.mccollister@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Rob Herring <robh@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v5 2/3] net: dsa: add Arrow SpeedChips XRS700x driver
Date: Fri, 15 Jan 2021 00:48:43 +0200 [thread overview]
Message-ID: <20210114224843.374dmyzvtszat6m4@skbuf> (raw)
In-Reply-To: <20210114195734.55313-3-george.mccollister@gmail.com>
On Thu, Jan 14, 2021 at 01:57:33PM -0600, George McCollister wrote:
> Add a driver with initial support for the Arrow SpeedChips XRS7000
> series of gigabit Ethernet switch chips which are typically used in
> critical networking applications.
>
> The switches have up to three RGMII ports and one RMII port.
> Management to the switches can be performed over i2c or mdio.
>
> Support for advanced features such as PTP and
> HSR/PRP (IEC 62439-3 Clause 5 & 4) is not included in this patch and
> may be added at a later date.
>
> Signed-off-by: George McCollister <george.mccollister@gmail.com>
> ---
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
This driver is good to go, just one small nitpick below, you can fix it
up afterwards if you want.
> +static void xrs700x_port_stp_state_set(struct dsa_switch *ds, int port,
> + u8 state)
> +{
> + struct xrs700x *priv = ds->priv;
> + unsigned int bpdus = 1;
> + unsigned int val;
> +
> + switch (state) {
> + case BR_STATE_DISABLED:
> + bpdus = 0;
> + fallthrough;
> + case BR_STATE_BLOCKING:
> + case BR_STATE_LISTENING:
> + val = XRS_PORT_DISABLED;
> + break;
> + case BR_STATE_LEARNING:
> + val = XRS_PORT_LEARNING;
> + break;
> + case BR_STATE_FORWARDING:
> + val = XRS_PORT_FORWARDING;
> + break;
> + default:
> + dev_err(ds->dev, "invalid STP state: %d\n", state);
> + return;
> + }
> +
> + regmap_fields_write(priv->ps_forward, port, val);
> +
> + /* Enable/disable inbound policy added by xrs700x_port_add_bpdu_ipf()
> + * which allows BPDU forwarding to the CPU port when the front facing
> + * port is in disabled/learning state.
~~~~~~~~
You probably mean blocking. When the port is in BR_STATE_DISABLED, you
set bpdus = 1, which makes sense.
> + */
> + regmap_update_bits(priv->regmap, XRS_ETH_ADDR_CFG(port, 0), 1, bpdus);
> +
> + dev_dbg_ratelimited(priv->dev, "%s - port: %d, state: %u, val: 0x%x\n",
> + __func__, port, state, val);
> +}
next prev parent reply other threads:[~2021-01-14 22:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-14 19:57 [PATCH net-next v5 0/3] Arrow SpeedChips XRS700x DSA Driver George McCollister
2021-01-14 19:57 ` [PATCH net-next v5 1/3] dsa: add support for Arrow XRS700x tag trailer George McCollister
2021-01-14 21:53 ` Vladimir Oltean
2021-01-14 19:57 ` [PATCH net-next v5 2/3] net: dsa: add Arrow SpeedChips XRS700x driver George McCollister
2021-01-14 22:29 ` Florian Fainelli
2021-01-14 22:44 ` Andrew Lunn
2021-01-14 22:48 ` Vladimir Oltean [this message]
2021-01-15 15:30 ` George McCollister
2021-01-15 18:43 ` Vladimir Oltean
2021-01-14 19:57 ` [PATCH net-next v5 3/3] dt-bindings: net: dsa: add bindings for xrs700x switches George McCollister
2021-01-15 23:42 ` [PATCH net-next v5 0/3] Arrow SpeedChips XRS700x DSA Driver Jakub Kicinski
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=20210114224843.374dmyzvtszat6m4@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=george.mccollister@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=robh@kernel.org \
--cc=vivien.didelot@gmail.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