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] [thread-next>] [day] [month] [year] [list]
Message-ID: <514f9861-9d16-4c62-a7a0-5c9182a44927@redhat.com>
Date: Thu, 17 Apr 2025 18:29:01 +0200
From: Ivan Vecera <ivecera@...hat.com>
To: Andy Shevchenko <andy@...nel.org>
Cc: Andrew Lunn <andrew@...n.ch>, netdev@...r.kernel.org,
 Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
 Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>,
 Jiri Pirko <jiri@...nulli.us>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Prathosh Satish <Prathosh.Satish@...rochip.com>,
 Lee Jones <lee@...nel.org>, Kees Cook <kees@...nel.org>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Michal Schmidt <mschmidt@...hat.com>, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v3 net-next 3/8] mfd: Add Microchip ZL3073x support

On 17. 04. 25 5:42 odp., Andy Shevchenko wrote:
>>> Would it be acceptable for you something like this:
> V4L2 (or media subsystem) solve the problem by providing a common helpers for
> reading and writing tons of different registers in cameras. See the commit
> 613cbb91e9ce ("media: Add MIPI CCI register access helper functions").
> 
> Dunno if it helps here, though.

Bingo, this approach looks very good.

I can use unsigned int (32bit) to encode everything necessary:
Bits  0..15 - register address (virtual range offset, page, offset)
Bits 16..21 - size in bits (enough for max 48)
Bits 22..26 - max items (32 values - enough for any indexed register)
Bits 27..31 - stride between (up to 32 - enough per datasheet)

Only thing I don't like is that MIPI CCI API uses for calls u64 as value:

int cci_read(struct regmap *map, u32 reg, u64 *val, ...);

This forces a caller to use u64 for every register read. I rather to use
'void *val' the same way as regmap_read().

Ivan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ