netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Hauke Mehrtens <hauke@hauke-m.de>, Andrew Lunn <andrew@lunn.ch>,
	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>,
	Russell King <linux@armlinux.org.uk>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andreas Schirm <andreas.schirm@siemens.com>,
	Lukas Stockmann <lukas.stockmann@siemens.com>,
	Alexander Sverdlin <alexander.sverdlin@siemens.com>,
	Peter Christen <peter.christen@siemens.com>,
	Avinash Jayaraman <ajayaraman@maxlinear.com>,
	Bing tao Xu <bxu@maxlinear.com>, Liang Xu <lxu@maxlinear.com>,
	Juraj Povazanec <jpovazanec@maxlinear.com>,
	"Fanni (Fang-Yi) Chan" <fchan@maxlinear.com>,
	"Benny (Ying-Tsan) Weng" <yweng@maxlinear.com>,
	"Livia M. Rosu" <lrosu@maxlinear.com>,
	John Crispin <john@phrozen.org>
Subject: [RFC PATCH net-next 0/6] net: dsa: lantiq_gswip: convert to use regmap
Date: Wed, 3 Sep 2025 00:35:16 +0100	[thread overview]
Message-ID: <cover.1756855069.git.daniel@makrotopia.org> (raw)

Prepare the lantiq_gswip DSA driver to use transports other than MMIO to
access the switch registers by using regmap.

In order to ease future maintainance and get rid of unneeded indirection
replace the existing accessor functions in favour of using the regmap
API directly.

The biggest part of that conversion is done using easy-to-review
semantic patches (coccinelle), leaving only a few corner cases and some
optimization to be done manually.

Register writes could be further reduced in future by using
regmap_update_bits() instead of regmap_write_bits() in cases which allow
that.

Also note that, just like the current code, there is no error handling
in case register access fails, however, an error message is printed in
such cases at least.

This series is meant to be merged after series

"net: dsa: lantiq_gswip: prepare for supporting MaxLinear GSW1xx"[1]

and also after the series with fixes Vladimir Oltean is currently
preparing; applying a bunch of semantic patches is easy even after code
changes, while on the other hand applying his code changes after the
conversion to regmap would require a rework of all his work).

Hence this is posted as RFC to potentially get some feedback before
both other series mentioned above have been merged.

DSA selftests have been run with this series applied, the results are
unchanged (ie. the expected result).

[1]: https://patchwork.kernel.org/project/netdevbpf/list/?series=997105

Daniel Golle (6):
  net: dsa: lantiq_gswip: convert to use regmap
  net: dsa: lantiq_gswip: convert trivial accessor uses to regmap
  net: dsa: lantiq_gswip: manually convert remaining uses of read
    accessors
  net: dsa: lantiq_gswip: replace *_mask() functions with regmap API
  net: dsa: lantiq_gswip: optimize regmap_write_bits() statements
  net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parameters

 drivers/net/dsa/lantiq/Kconfig        |   1 +
 drivers/net/dsa/lantiq/lantiq_gswip.c | 443 +++++++++++++-------------
 drivers/net/dsa/lantiq/lantiq_gswip.h |   6 +-
 3 files changed, 228 insertions(+), 222 deletions(-)

-- 
2.51.0

             reply	other threads:[~2025-09-02 23:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 23:35 Daniel Golle [this message]
2025-09-02 23:35 ` [RFC PATCH net-next 1/6] net: dsa: lantiq_gswip: convert accessors to use regmap Daniel Golle
2025-09-03  1:14   ` Andrew Lunn
2025-09-02 23:36 ` [RFC PATCH net-next 2/6] net: dsa: lantiq_gswip: convert trivial accessor uses to regmap Daniel Golle
2025-09-02 23:36 ` [RFC PATCH net-next 3/6] net: dsa: lantiq_gswip: manually convert remaining uses of read accessors Daniel Golle
2025-09-02 23:36 ` [RFC PATCH net-next 4/6] net: dsa: lantiq_gswip: replace *_mask() functions with regmap API Daniel Golle
2025-09-02 23:36 ` [RFC PATCH net-next 5/6] net: dsa: lantiq_gswip: optimize regmap_write_bits() statements Daniel Golle
2025-09-02 23:36 ` [RFC PATCH net-next 6/6] net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parameters Daniel Golle

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=cover.1756855069.git.daniel@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=ajayaraman@maxlinear.com \
    --cc=alexander.sverdlin@siemens.com \
    --cc=andreas.schirm@siemens.com \
    --cc=andrew@lunn.ch \
    --cc=bxu@maxlinear.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fchan@maxlinear.com \
    --cc=hauke@hauke-m.de \
    --cc=john@phrozen.org \
    --cc=jpovazanec@maxlinear.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lrosu@maxlinear.com \
    --cc=lukas.stockmann@siemens.com \
    --cc=lxu@maxlinear.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=peter.christen@siemens.com \
    --cc=yweng@maxlinear.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;
as well as URLs for NNTP newsgroup(s).