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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL_JsqJ0cXB4bz+DAUq25V5suS0D-CHnujh0UyxA66UjajJO-g@mail.gmail.com>
Date: Thu, 28 Aug 2025 15:44:14 -0500
From: Rob Herring <robh@...nel.org>
To: Hans Zhang <18255117159@....com>
Cc: lpieralisi@...nel.org, bhelgaas@...gle.com, mani@...nel.org, 
	kwilczynski@...nel.org, jingoohan1@...il.com, cassel@...nel.org, 
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Hans Zhang <hans.zhang@...tech.com>
Subject: Re: [PATCH v5 00/13] PCI: dwc: Refactor register access with
 dw_pcie_*_dword helper

On Thu, Aug 28, 2025 at 9:00 AM Hans Zhang <18255117159@....com> wrote:
>
> From: Hans Zhang <hans.zhang@...tech.com>
>
> Register bit manipulation in DesignWare PCIe controllers currently
> uses repetitive read-modify-write sequences across multiple drivers.
> This pattern leads to code duplication and increases maintenance
> complexity as each driver implements similar logic with minor variations.
>
> This series introduces dw_pcie_*_dword() to centralize atomic
> register modification. The helper performs read-clear-set-write operations
> in a single function, replacing open-coded implementations. Subsequent
> patches refactor individual drivers to use this helper, eliminating
> redundant code and ensuring consistent bit handling.
>
> The change reduces overall code size by ~350 lines while improving
> maintainability. Each controller driver is updated in a separate
> patch to preserve bisectability and simplify review.

If RMW functions are an improvement, then they should go in io.h. I
don't think they are because they obfuscate the exact register
modifications and the possible need for locking. With common API,
anyone that understands kernel APIs will know what's going on. With a
driver specific API, then you have to go lookup what the API does
exactly. So I don't think this is an improvement.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ