From: Christian Zigotzky <chzigotzky@xenosoft.de>
To: Darren Stevens <darren@stevens-zone.net>,
madalin.bacur@nxp.com, netdev@vger.kernel.org,
mad skateman <madskateman@gmail.com>
Cc: oss@buserror.net, "contact@a-eon.com" <contact@a-eon.com>,
linuxppc-dev@lists.ozlabs.org, "R.T.Dickinson" <rtd2@xtra.co.nz>
Subject: Re: [RFC PATCH dpss_eth] Don't initialise ports with no PHY
Date: Wed, 29 Apr 2020 10:26:33 +0200 [thread overview]
Message-ID: <ca95a1b2-1b16-008c-18ba-2cbd79f240e6@xenosoft.de> (raw)
In-Reply-To: <20200424232938.1a85d353@Cyrus.lan>
[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]
Hi Darren,
Thanks a lot for your patch!
I tested it with the RC3 today.
Unfortunately it doesn't compile because a bracket is missing in the
following line:
+ if (prop && !strncmp(prop, "disabled", 8) {
And a semicolon is missing in the following line:
+ goto _return
I added the bracket and the semicolon and after that it compiled without
any problems. (New patch attached)
Unfortunately I see more than 2 ethernet ports with the RC3 and your
patch on my Cyrus P5040. Maybe Skateman has an other result on his Cyrus
P5020.
Maybe we have to modify the dtb file.
Thanks,
Christian
On 25 April 2020 at 00:29 am, Darren Stevens wrote:
> Since cbb961ca271e ("Use random MAC address when none is given")
> Varisys Cyrus P5020 boards have been listing 5 ethernet ports instead of
> the 2 the board has.This is because we were preventing the adding of the
> unused ports by not suppling them a MAC address, which this patch now
> supplies.
>
> Prevent them from appearing in the net devices list by checking for a
> 'status="disabled"' entry during probe and skipping the port if we find
> it.
>
> Signed-off-by: Darren Stevens <Darren@stevens-zone.net>
>
> ---
>
> drivers/net/ethernet/freescale/fman/mac.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
> index 43427c5..c9ed411 100644
> --- a/drivers/net/ethernet/freescale/fman/mac.c
> +++ b/drivers/net/ethernet/freescale/fman/mac.c
> @@ -606,6 +606,7 @@ static int mac_probe(struct platform_device *_of_dev)
> struct resource res;
> struct mac_priv_s *priv;
> const u8 *mac_addr;
> + const char *prop;
> u32 val;
> u8 fman_id;
> phy_interface_t phy_if;
> @@ -628,6 +629,16 @@ static int mac_probe(struct platform_device *_of_dev)
> mac_dev->priv = priv;
> priv->dev = dev;
>
> + /* check for disabled devices and skip them, as now a missing
> + * MAC address will be replaced with a Random one rather than
> + * disabling the port
> + */
> + prop = of_get_property(mac_node, "status", NULL);
> + if (prop && !strncmp(prop, "disabled", 8) {
> + err = -ENODEV;
> + goto _return
> + }
> +
> if (of_device_is_compatible(mac_node, "fsl,fman-dtsec")) {
> setup_dtsec(mac_dev);
> priv->internal_phy_node = of_parse_phandle(mac_node,
[-- Attachment #2: dpss_eth.patch --]
[-- Type: text/x-patch, Size: 1021 bytes --]
diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
index 43427c5..c9ed411 100644
--- a/drivers/net/ethernet/freescale/fman/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac.c
@@ -606,6 +606,7 @@ static int mac_probe(struct platform_device *_of_dev)
struct resource res;
struct mac_priv_s *priv;
const u8 *mac_addr;
+ const char *prop;
u32 val;
u8 fman_id;
phy_interface_t phy_if;
@@ -628,6 +629,16 @@ static int mac_probe(struct platform_device *_of_dev)
mac_dev->priv = priv;
priv->dev = dev;
+ /* check for disabled devices and skip them, as now a missing
+ * MAC address will be replaced with a Random one rather than
+ * disabling the port
+ */
+ prop = of_get_property(mac_node, "status", NULL);
+ if (prop && !strncmp(prop, "disabled", 8)) {
+ err = -ENODEV;
+ goto _return;
+ }
+
if (of_device_is_compatible(mac_node, "fsl,fman-dtsec")) {
setup_dtsec(mac_dev);
priv->internal_phy_node = of_parse_phandle(mac_node,
next prev parent reply other threads:[~2020-04-29 8:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 22:29 [RFC PATCH dpss_eth] Don't initialise ports with no PHY Darren Stevens
2020-04-24 22:50 ` Florian Fainelli
2020-04-25 0:10 ` Andrew Lunn
2020-04-30 20:45 ` Darren Stevens
2020-04-29 8:26 ` Christian Zigotzky [this message]
2020-04-29 13:12 ` [RFC PATCH dpss_eth] " Andrew Lunn
2020-04-29 13:55 ` Christian Zigotzky
2020-04-29 15:22 ` Andrew Lunn
2020-04-29 15:42 ` Christian Zigotzky
2020-04-30 21:32 ` Darren Stevens
2020-05-01 5:35 ` Christian Zigotzky
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=ca95a1b2-1b16-008c-18ba-2cbd79f240e6@xenosoft.de \
--to=chzigotzky@xenosoft.de \
--cc=contact@a-eon.com \
--cc=darren@stevens-zone.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=madalin.bacur@nxp.com \
--cc=madskateman@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=oss@buserror.net \
--cc=rtd2@xtra.co.nz \
/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).