lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <cover.1756855069.git.daniel@makrotopia.org>
Date: Wed, 3 Sep 2025 00:35:16 +0100
From: Daniel Golle <daniel@...rotopia.org>
To: Hauke Mehrtens <hauke@...ke-m.de>, Andrew Lunn <andrew@...n.ch>,
	Vladimir Oltean <olteanv@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Andreas Schirm <andreas.schirm@...mens.com>,
	Lukas Stockmann <lukas.stockmann@...mens.com>,
	Alexander Sverdlin <alexander.sverdlin@...mens.com>,
	Peter Christen <peter.christen@...mens.com>,
	Avinash Jayaraman <ajayaraman@...linear.com>,
	Bing tao Xu <bxu@...linear.com>, Liang Xu <lxu@...linear.com>,
	Juraj Povazanec <jpovazanec@...linear.com>,
	"Fanni (Fang-Yi) Chan" <fchan@...linear.com>,
	"Benny (Ying-Tsan) Weng" <yweng@...linear.com>,
	"Livia M. Rosu" <lrosu@...linear.com>,
	John Crispin <john@...ozen.org>
Subject: [RFC PATCH net-next 0/6] net: dsa: lantiq_gswip: convert to use
 regmap

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ