mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Merge branch 'for-4.16/nfit' into libnvdimm-for-next
This commit is contained in:
commit
ee95f4059a
475 changed files with 6107 additions and 1912 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#include "pmem.h"
|
||||
#include "pfn.h"
|
||||
#include "nd.h"
|
||||
#include "nd-core.h"
|
||||
|
||||
static struct device *to_dev(struct pmem_device *pmem)
|
||||
{
|
||||
|
|
@ -334,7 +335,8 @@ static int pmem_attach_disk(struct device *dev,
|
|||
dev_warn(dev, "unable to guarantee persistence of writes\n");
|
||||
fua = 0;
|
||||
}
|
||||
wbc = nvdimm_has_cache(nd_region);
|
||||
wbc = nvdimm_has_cache(nd_region) &&
|
||||
!test_bit(ND_REGION_PERSIST_CACHE, &nd_region->flags);
|
||||
|
||||
if (!devm_request_mem_region(dev, res->start, resource_size(res),
|
||||
dev_name(&ndns->dev))) {
|
||||
|
|
|
|||
|
|
@ -528,6 +528,18 @@ static ssize_t resource_show(struct device *dev,
|
|||
}
|
||||
static DEVICE_ATTR_RO(resource);
|
||||
|
||||
static ssize_t persistence_domain_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct nd_region *nd_region = to_nd_region(dev);
|
||||
unsigned long flags = nd_region->flags;
|
||||
|
||||
return sprintf(buf, "%s%s\n",
|
||||
flags & BIT(ND_REGION_PERSIST_CACHE) ? "cpu_cache " : "",
|
||||
flags & BIT(ND_REGION_PERSIST_MEMCTRL) ? "memory_controller " : "");
|
||||
}
|
||||
static DEVICE_ATTR_RO(persistence_domain);
|
||||
|
||||
static struct attribute *nd_region_attributes[] = {
|
||||
&dev_attr_size.attr,
|
||||
&dev_attr_nstype.attr,
|
||||
|
|
@ -543,6 +555,7 @@ static struct attribute *nd_region_attributes[] = {
|
|||
&dev_attr_init_namespaces.attr,
|
||||
&dev_attr_badblocks.attr,
|
||||
&dev_attr_resource.attr,
|
||||
&dev_attr_persistence_domain.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue