On 01/10/2020 22:49, Evan Green wrote:
Oh no, I realized this isn't nearly as beautiful when I try to move it into the core. The low level read/write interface between the nvmem core and the driver is a range. So to move this into the core I'd have to implement all the overlap computation logic to potentially break up a read into several small reads in cases where there are many little keepout ranges. It was much simpler when I could just check each byte offset individually, and because I was doing it in this one rarely-used driver I could make that performance tradeoff without much penalty. I could do all range/overlap handling if you want, but it'll be a bigger change, and I worry my driver would be the only one to end up using it. What do you think?
I still think this should go in to core. core should be able to avoid checking by the presence of any restricted range, so it should not be a overhead for other non-users. regmap has similar feature we can take some inspiration from that code!!
--srini
-Evan