On Fri, 2023-12-08 at 11:13 +0800, Huang, Ying wrote: > Vishal Verma <vishal.l.ve...@intel.com> writes: > [..] > > > > + > > +static ssize_t memmap_on_memory_store(struct device *dev, > > + struct device_attribute *attr, > > + const char *buf, size_t len) > > +{ > > + struct dev_dax *dev_dax = to_dev_dax(dev); > > + struct dax_region *dax_region = dev_dax->region; > > + ssize_t rc; > > + bool val; > > + > > + rc = kstrtobool(buf, &val); > > + if (rc) > > + return rc; > > + > > + if (dev_dax->memmap_on_memory == val) > > + return len; > > + > > + device_lock(dax_region->dev); > > + if (!dax_region->dev->driver) { > > This still doesn't look right. Can we check whether the current driver > is kmem? And only allow change if it's not kmem?
Ah yes I lost track of this todo between revisions when I split this out. Let me fix that for the next revision.