On Fri, Dec 15, 2023 at 3:04 AM Yunsheng Lin <linyunsheng@xxxxxxxxxx> wrote: > > On 2023/12/15 10:11, Shakeel Butt wrote: > > On Thu, Dec 14, 2023 at 08:27:55AM -0800, Mina Almasry wrote: > >> On Thu, Dec 14, 2023 at 4:05 AM Yunsheng Lin <linyunsheng@xxxxxxxxxx> wrote: > >>> > > [...] > >>> I perfer the second one personally, as devmem means that it is not > >>> readable from cpu. > >> > >> From my POV it has to be the first one. We want to abstract the memory > >> type from the drivers as much as possible, not introduce N new memory > >> types and ask the driver to implement new code for each of them > >> separately. > > That was my initial thinking too: > https://www.spinics.net/lists/netdev/msg949376.html > > But after discussion, it may make more sense to have two sets of API from the > driver's piont of view if we want a complete safe type protection, so that > compiler can check everything statically and devmem driver API have a clear > semantic: > 1. devmem is not allowed to be called into mm subsystem. > 2. it will not provide a API like page_address(). > I think all of us are on the same page that there will be two sets of APIs here but Mina's point was let's aim to not make that N set of APIs.