All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Josua Mayer <josua@solid-run.com>
Cc: Jiri Pirko <jiri@resnulli.us>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: dsa: mv88e6xxx: add warning for truncated mdio bus id
Date: Wed, 20 Mar 2024 19:57:04 +0100	[thread overview]
Message-ID: <793649ff-990c-46f0-9132-bc6e95fcb94f@lunn.ch> (raw)
In-Reply-To: <c76c95af-71cb-4eb6-b3af-846ae318d18d@solid-run.com>

> With separators ('!') we have:
> cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdio
> cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdio-external
> Truncated to MII_BUS_ID_SIZE:
> cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdi
> cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdi

This has been made worse by the DT maintainers wanting
ethernet-switch@4, not switch@4. And i guess config-space was also
something shorter in the past.

I think your idea of cropping from the beginning, not the end, is in
general a good solution. However, is there any danger of

cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdio-external

and

cp1!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdio-external

I assume the two instances of cp have the same peripherals, at the
same address?

Another option would be if the name needs to be truncated, use the
fallback as if there was no np:

                bus->name = "mv88e6xxx SMI";
                snprintf(bus->id, MII_BUS_ID_SIZE, "mv88e6xxx-%d", index++);

That at least gives you unique names.

     Andrew

  parent reply	other threads:[~2024-03-20 18:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 13:48 [PATCH] net: dsa: mv88e6xxx: add warning for truncated mdio bus id Josua Mayer
2024-03-20 14:09 ` Jiri Pirko
2024-03-20 14:33   ` Josua Mayer
2024-03-20 15:13     ` Florian Fainelli
2024-03-20 16:28       ` Josua Mayer
2024-03-20 16:03     ` Jiri Pirko
2024-03-20 16:41       ` Josua Mayer
2024-03-20 18:57     ` Andrew Lunn [this message]
2024-03-21 10:26       ` Josua Mayer
2024-03-21 15:10         ` Andrew Lunn
2024-03-21 15:54           ` Josua Mayer

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=793649ff-990c-46f0-9132-bc6e95fcb94f@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=josua@solid-run.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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.