aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/claim.c
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2017-05-10 15:01:30 -0600
committerDan Williams <dan.j.williams@intel.com>2017-05-10 21:46:22 -0700
commit3ae3d67ba705c754a3c91ac009f9ce73a0e7286a (patch)
tree0163a4ca204ab5f9601f12ee3c6fcfdb45a16459 /drivers/nvdimm/claim.c
parentx86, pmem: Fix cache flushing for iovec write < 8 bytes (diff)
downloadlinux-dev-3ae3d67ba705c754a3c91ac009f9ce73a0e7286a.tar.xz
linux-dev-3ae3d67ba705c754a3c91ac009f9ce73a0e7286a.zip
libnvdimm: add an atomic vs process context flag to rw_bytes
nsio_rw_bytes can clear media errors, but this cannot be done while we are in an atomic context due to locking within ACPI. From the BTT, ->rw_bytes may be called either from atomic or process context depending on whether the calls happen during initialization or during IO. During init, we want to ensure error clearing happens, and the flag marking process context allows nsio_rw_bytes to do that. When called during IO, we're in atomic context, and error clearing can be skipped. Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/claim.c')
-rw-r--r--drivers/nvdimm/claim.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index 93d128da1c92..7ceb5fa4f2a1 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -228,7 +228,8 @@ u64 nd_sb_checksum(struct nd_gen_sb *nd_gen_sb)
EXPORT_SYMBOL(nd_sb_checksum);
static int nsio_rw_bytes(struct nd_namespace_common *ndns,
- resource_size_t offset, void *buf, size_t size, int rw)
+ resource_size_t offset, void *buf, size_t size, int rw,
+ unsigned long flags)
{
struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev);
unsigned int sz_align = ALIGN(size + (offset & (512 - 1)), 512);
@@ -259,7 +260,8 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
* work around this collision.
*/
if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)
- && (!ndns->claim || !is_nd_btt(ndns->claim))) {
+ && !(flags & NVDIMM_IO_ATOMIC)
+ && !ndns->claim) {
long cleared;
cleared = nvdimm_clear_poison(&ndns->dev,