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: <b7e223bd-d43b-4cdd-9d48-4a1f80a482e8@redhat.com>
Date: Fri, 11 Apr 2025 13:19:39 +0200
From: Ivan Vecera <ivecera@...hat.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: 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>,
 Andy Shevchenko <andy@...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 v2 07/14] mfd: zl3073x: Add components versions register
 defs



On 10. 04. 25 7:50 odp., Andy Shevchenko wrote:
> On Wed, Apr 9, 2025 at 5:43 PM Ivan Vecera <ivecera@...hat.com> wrote:
>>
>> Add register definitions for components versions and report them
>> during probe.
> 
> JFYI: disabling regmap lock (independently of having an additional one
> or not) is not recommended. With that you actually disable the useful
> debugging feature of regmap, your device will not be present in the
> (regmap) debugfs after that.
> 

I will follow Andrew's recommendation:

1st regmap for direct registers (pages 0-9) with config like:

regmap_config {
	...
	.lock = mutex_lock,
	.unlock = mutex_unlock,
	.lock_arg = &zl3073x_dev->lock
	...
};

2nd regmap for indirect registers (mailboxes) (pages 10-15) with 
disabled locking:

regmap_config {
	...
	.disable_lock = true,
	...
};

For direct registers the lock will be handled automatically by regmap 1.
For indirect registers the lock will be managed explicitly by the driver 
to ensure atomic access to mailbox.

The range for regmap 1: (registers 0x000-0x4FF)
regmap_range_cfg {
	.range_min = 0,
	.range_max = 10 * 128 - 1, /* 10 pages, 128 registers each */
	.selector_reg = 0x7f,      /* page selector at each page */
	.selector_shift = 0,       /* no shift in page selector */
	.selector_mask = GENMASK(3, 0),	/* 4 bits for page sel */
	.window_start = 0,         /* 128 regs from 0x00-0x7f */
	.window_len = 128,
};

The range for regmap 2: (registers 0x500-0x77F)
regmap_range_cfg {
	.range_min = 10 * 128,
	.range_max = 15 * 128 - 1, /* 5 pages, 128 registers each */
	.selector_reg = 0x7f,      /* page selector at each page */
	.selector_shift = 0,       /* no shift in page selector */
	.selector_mask = GENMASK(3, 0),	/* 4 bits for page sel */
	.window_start = 0,         /* 128 regs from 0x00-0x7f */
	.window_len = 128,
};

Is it now OK?

Thanks,
Ivan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ