From: Kyle Switch <kyle.switch@motor-comm.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: olteanv@gmail.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, mmyangfl@gmail.com,
horms@kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ming.xu@motor-comm.com,
xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com
Subject: Re: [PATCH v3 net-next 2/2] net: dsa: Add support for Motorcomm YT922x
Date: Thu, 27 Aug 2026 20:00:04 +0800 [thread overview]
Message-ID: <0c8024bc-c444-42ea-83fc-88446c8c560e@motor-comm.com> (raw)
In-Reply-To: <55523ac4-023b-4ed8-8519-293c778044a4@lunn.ch>
On 8/26/26 20:43, Andrew Lunn wrote:
> On Wed, Aug 26, 2026 at 05:08:02PM +0800, Kyle Switch wrote:
>> Motorcomm YT922x is a series of ethernet switches including:
>>
>> - YT9224: 4 * 2.5G UTPs and 2 serdes interface
>>
>> This patch just add basic func for a working DSA switch.
> I asked you to break this patch up. I want to see lots of little
> patches, each with a good commit messages, each obviously correct.
>
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
>
> says you can have a patch series of up to 15 patches.
>
>> static int yt921x_mbus_int_read(struct mii_bus *mbus, int port, int reg)
>> {
>> struct yt921x_priv *priv = mbus->priv;
>> + int max_ports;
>> u16 val;
>> int res;
>>
>> - if (port >= YT921X_PORT_NUM)
>> + max_ports = priv->series_info->ports;
>> + if (port >= max_ports)
>> return U16_MAX;
> What did i say about this in my last review? This would make a good,
> simple patch, changing all YT921X_PORT_NUM to priv->series_info->ports.
>
> You first need a simple patch which adds struct yt92xx_series and
> yt92xx_series_table[] with very minimal contents, only mode and name,
> for the existing device. And add the code to do the lookup and
> associate it to priv.
>
> Then you can have a patch which adds .ports, and changes all
> YT921X_PORT_NUM to priv->series_info->ports.
>
> Then you can add .num_lag_ids and change all those references.
>
> Then you can add .ageing_time_FOO and change all those references.
>
> Slowly make the existing code more generic by adding to struct
> yt92xx_series.
>
> Andrew
Ans: We intend to split this patch into smaller functional pieces and submit
them as separate commits.
I would also like to seek your advice on a design question.
For the yt92xx_series_info table, the maveall reference design invokes
chip_detect() inside probe() to perform the matching lookup.
However, in the existing yt921x DSA driver, chip_detect() is called within
dsa_setup() instead.
We are considering two possible approaches:
1. Keep the code as-is and relocate the initialization of certain
dsa_switch structure parameters into dsa_setup().
2. Refactor by moving chip_detect() into probe() to align with
the reference design.
Which of these two approaches would you lean toward,
and what are your considerations?
> ---
> pw-bot: cr
next prev parent reply other threads:[~2026-08-27 12:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 6:16 [PATCH v3 net-next 0/2] net: dsa: yt922x: Add support for Motorcomm YT922x Kyle Switch
2026-08-25 6:16 ` [PATCH v3 net-next 1/2] net: dsa: tag_yt922x: add support for Motorcomm YT922x tags Kyle Switch
2026-08-26 9:08 ` [PATCH v3 net-next 2/2] net: dsa: Add support for Motorcomm YT922x Kyle Switch
2026-08-26 12:43 ` Andrew Lunn
2026-08-27 12:00 ` Kyle Switch [this message]
2026-08-27 15:58 ` Andrew Lunn
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=0c8024bc-c444-42ea-83fc-88446c8c560e@motor-comm.com \
--to=kyle.switch@motor-comm.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jianmin.wang@motor-comm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=ming.xu@motor-comm.com \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=xiaolin.xu@motor-comm.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