lkml.org 
[lkml]   [2022]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH RFC 1/2] regmap: add option to disable debugfs
Date
> From: Mark Brown <broonie@kernel.org>
> Sent: Monday, June 20, 2022 11:50 PM
>
> On Mon, Jun 20, 2022 at 03:47:05PM +0000, Aisheng Dong wrote:
>
> > > As indicated in the message you're linking to here if the device
> > > can't be accessed it should be being put in cache only mode which
> > > will ensure that nothing can do any physical accesses.
>
> > I wonder that's not a stable solution assuming there're possible volatile
> registers.
> > Isn't that?
>
> The driver is going to need to power the device back up to access the volatile
> registers so it can take the device out of cache only mode when it's doing that
> can't it?

Sorry, I didn't quite get it.
There's no problem in driver to access volatile registers as it usually will power up
device first by rpm.
But for debugfs, from what I saw in code, if there's a volatile register, _regmap_read()
will bypass cache and try to read the register value from HW.
Then system may hang as no one powered up the device before.
Anything I missed?

static int _regmap_read(struct regmap *map, unsigned int reg,
unsigned int *val)
{
int ret;
void *context = _regmap_map_get_context(map);

if (!map->cache_bypass) {
ret = regcache_read(map, reg, val);
if (ret == 0)
return 0;
}

ret = map->reg_read(context, reg, val);
...
}

Or you mean simply forgetting about volatile registers and let debugfs
to read the stale value from cache?

Regards
Aisheng
\
 
 \ /
  Last update: 2022-06-20 18:16    [W:0.065 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site