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: <65607fde-d0e9-0f08-3042-f6a58b760896@baylibre.com>
Date:   Wed, 9 May 2018 13:49:21 +0200
From:   Jorge Ramirez-Ortiz <jramirez@...libre.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [RFC] regmap: allow volatile register writes with cached only
 read maps

On 05/09/2018 10:39 AM, Mark Brown wrote:
> On Wed, May 09, 2018 at 12:06:09AM +0200, Jorge Ramirez-Ortiz wrote:
>> Regmap only allows volatile access to registers when the client
>> supports both reads and writes.
>>
>> This commit bypasses that limitation and enables volatile writes to
>> selected registers while maintaining cached accesses on all reads. For
>> this, the client does not need to configure the reg_read callback.
> I don't understand what voltile access means for write only devices.
> Volatile means that we don't read the cache but go direct to the
> hardware so if we can't read the hardware that's pretty redundant, a
> volatile read that goes to the cache is just a default read.

oops, sorry will try to be a bit more clear with an example.

This patch tries to support a map that provides:

1. only cached reads: (as a consequence every regmap write must succeed).
2. cached writes: do not access the hardware unless the value differs 
from what is in the cache already or (3) applies.
3. support for selectable volatile writes: those that will always access 
the device no matter what the cache holds.

Something like this:

static const struct regmap_config foo_regmap = {
     .reg_write        = foo_write_reg,

     .reg_bits        = 32,
     .val_bits        = 32,
     .reg_stride        = 1,

     .volatile_reg        = foo_volatile_reg,

     .max_register        = CODEC_ENABLE_DEBUG_CTRL_REG,
     .reg_defaults        = foo_reg_defaults,
     .num_reg_defaults    = ARRAY_SIZE(foo_reg_defaults),
     .cache_type        = REGCACHE_RBTREE,
};


I dont think - I could be wrong- that this is something that we can 
support today since the current code seems to require that the regmap is 
readable (ie, that it implements reg_read).
But it could also be that I am missing something in my config? This is 
why I sent an RFC instead of a PATCH, because I am not 100% sure that I 
am not missing something.




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ