Re: [PATCH] pinctrl: cy8c95x0: Cache muxed registers

From: Patrick Rudolph
Date: Thu May 16 2024 - 13:04:15 EST


Hi Mark,
I tried to convert the cy8c95x0 driver to use the regmap ranges, but
had a few problems:
- I removed the regmap lock since the driver has it's own mutex to
protect all regmap accesses.
That disabled the regmap debugfs, which wasn't obvious to me and
took some time to figure out.
- I verified that the regmap range works as expected, but the debugfs
showed that the regcache has invalid defaults.
The defaults are read from HW using by setting "num_reg_defaults_raw".
From what I understand regmap_raw_read() called by
regcache_hw_init() ignores the ranges
and doesn't use the page selector at all. Since it's not using
paging the contents will be invalid.
I had to apply the workaround in the config ".use_single_read =
true" to fix the cache init, but
that might reduce performance when initializing the cache.

Is this a bug or a known limitation of the regcache?
It looks like none of the other drivers use num_reg_defaults_raw +
ranges at the same time.

Regards,
Patrick