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: <ed9cf02b-6f6e-46b5-a583-4fd32fa31a91@uclouvain.be>
Date: Wed, 4 Dec 2024 09:49:55 +0100
From: Thomas Antoine <t.antoine@...ouvain.be>
To: André Draszik <andre.draszik@...aro.org>,
 Sebastian Reichel <sre@...nel.org>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Dimitri Fedrau <dima.fedrau@...il.com>,
 Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
 Peter Griffin <peter.griffin@...aro.org>,
 Alim Akhtar <alim.akhtar@...sung.com>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
 devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH 1/4] power: supply: add support for max77759 fuel gauge

On 12/3/24 12:06, André Draszik wrote:
> On Tue, 2024-12-03 at 11:30 +0100, Thomas Antoine wrote:
>> Should I explicitly deny their use in the code for the max77759 or is it
>> just for information?
> I'd probably do something like this, which will indeed deny their reading
> and/or writing, both via debugfs, and also normal driver access via
> readmap_read()/write() etc:
> 
> static const struct regmap_range max77759_registers[] = {
> 	regmap_reg_range(0x00, 0x4f),
> 	regmap_reg_range(0xb0, 0xbf),
> 	regmap_reg_range(0xd0, 0xd0),
> 	regmap_reg_range(0xdc, 0xdf),
> 	regmap_reg_range(0xfb, 0xfb),
> 	regmap_reg_range(0xff, 0xff),
> };
> 
> static const struct regmap_range max77759_ro_registers[] = {
> 	regmap_reg_range(0x3d, 0x3d),
> 	regmap_reg_range(0xfb, 0xfb),
> 	regmap_reg_range(0xff, 0xff),
> };
> 
> static const struct regmap_access_table max77759_write_table = {
> 	.yes_ranges = max77759_registers,
> 	.n_yes_ranges = ARRAY_SIZE(max77759_registers),
> 	.no_ranges = max77759_ro_registers,
> 	.n_no_ranges = ARRAY_SIZE(max77759_ro_registers),
> };
> 
> static const struct regmap_access_table max77759_rd_table = {
> 	.yes_ranges = max77759_registers,
> 	.n_yes_ranges = ARRAY_SIZE(max77759_registers),
> };
> 
> static const struct regmap_config max77759_regmap_config = {
> 	.reg_bits = 8,
> 	.val_bits = 8,
> 	.max_register = 0xff,
> 	.wr_table = &max77759_write_table,
> 	.rd_table = &max77759_rd_table,
> 	.cache_type = REGCACHE_NONE,
> };
> 
> And maybe without cache for now. Most are probably not cacheable anyway.

Thank you very much, I'll try this out.

Best regards,
Thomas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ