[PATCH v3 0/2] Support ACPI 6.1 update in NFIT Control Region Structure
by Toshi Kani
ACPI 6.1, Table 5-133, updates NVDIMM Control Region Structure as
follows.
- Valid Fields, Manufacturing Location, and Manufacturing Date
are added from reserved range. No change in the structure size.
- IDs (SPD values) are stored as arrays of bytes (i.e. big-endian
format). The spec clarifies that they need to be represented
as arrays of bytes as well.
Patch 1 changes the NFIT driver to comply with ACPI 6.1.
Patch 2 adds a new sysfs file "id" to show NVDIMM ID defined in ACPI 6.1.
The patch-set applies on linux-pm.git acpica.
link: http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf
---
v3:
- Need to coordinate with ACPICA update (Bob Moore, Dan Williams)
- Integrate with ACPICA changes in struct acpi_nfit_control_region.
(commit 138a95547ab0)
v2:
- Remove 'mfg_location' and 'mfg_date'. (Dan Williams)
- Rename 'unique_id' to 'id' and make this change as a separate patch.
(Dan Williams)
---
Toshi Kani (3):
1/2 acpi/nfit: Update nfit driver to comply with ACPI 6.1
2/3 acpi/nfit: Add sysfs "id" for NVDIMM ID
---
drivers/acpi/nfit.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
4 years, 1 month
xfs: untangle the direct I/O and DAX path, fix DAX locking
by Christoph Hellwig
The last patch is what started the series: XFS currently uses the
direct I/O locking strategy for DAX because DAX was overloaded onto
the direct I/O path. For XFS this means that we only take a shared
inode lock instead of the normal exclusive one for writes IFF they
are properly aligned. While this is fine for O_DIRECT which requires
explicit opt-in from the application it's not fine for DAX where we'll
suddenly lose expected and required synchronization of the file system
happens to use DAX undeneath.
Patches 1-7 just untangle the code so that we can deal with DAX on
it's own easily.
5 years, 10 months
[PATCH] acpi, nfit: fix acpi_check_dsm() vs zero functions implemented
by Dan Williams
QEMU 2.6 implements nascent support for nvdimm DSMs. Depending on
configuration it may only implement the function0 dsm to indicate that
no other DSMs are available. Commit 31eca76ba2fc "nfit, libnvdimm:
limited/whitelisted dimm command marshaling mechanism" breaks QEMU, but
QEMU is spec compliant. Per the spec the way to indicate that no
functions are supported is:
If Function Index is zero, the return is a buffer containing one bit
for each function index, starting with zero. Bit 0 indicates whether
there is support for any functions other than function 0 for the
specified UUID and Revision ID. If set to zero, no functions are
supported (other than function zero) for the specified UUID and
Revision ID.
Update the nfit driver to determine the family (interface UUID) without
requiring the implementation to define any other functions, i.e.
short-circuit acpi_check_dsm() to succeed per the spec. The nfit driver
appears to be the only user passing funcs==0 to acpi_check_dsm(), so
this behavior change of the common routine should be limited to the
probing done by the nfit driver.
Cc: "Rafael J. Wysocki" <rjw(a)rjwysocki.net>
Cc: Len Brown <lenb(a)kernel.org>
Cc: Jerry Hoemann <jerry.hoemann(a)hpe.com>
Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
Reported-by: Xiao Guangrong <guangrong.xiao(a)linux.intel.com>
Tested-by: Xiao Guangrong <guangrong.xiao(a)linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
drivers/acpi/nfit.c | 6 +++---
drivers/acpi/utils.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 2215fc847fa9..32579a7b71d5 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -1131,11 +1131,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
/*
* Until standardization materializes we need to consider up to 3
- * different command sets. Note, that checking for function0 (bit0)
- * tells us if any commands are reachable through this uuid.
+ * different command sets. Note, that checking for zero functions
+ * tells us if any commands might be reachable through this uuid.
*/
for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
- if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
+ if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 0))
break;
/* limit the supported commands to those that are publicly documented */
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 22c09952e177..b4de130f2d57 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -680,9 +680,6 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs)
u64 mask = 0;
union acpi_object *obj;
- if (funcs == 0)
- return false;
-
obj = acpi_evaluate_dsm(handle, uuid, rev, 0, NULL);
if (!obj)
return false;
@@ -695,6 +692,9 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs)
mask |= (((u64)obj->buffer.pointer[i]) << (i * 8));
ACPI_FREE(obj);
+ if (funcs == 0)
+ return true;
+
/*
* Bit 0 indicates whether there's support for any functions other than
* function 0 for the specified UUID and revision.
6 years
[PATCH] dm stripe: add DAX support
by Toshi Kani
Change dm-stripe to implement direct_access function,
stripe_direct_access(), which maps bdev and sector and
calls direct_access function of its physical target device.
Signed-off-by: Toshi Kani <toshi.kani(a)hpe.com>
Cc: Alasdair Kergon <agk(a)redhat.com>
Cc: Dan Williams <dan.j.williams(a)intel.com>
Cc: Ross Zwisler <ross.zwisler(a)linux.intel.com>
---
drivers/md/dm-stripe.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index 48f1c01..8925f6a 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -308,6 +308,30 @@ static int stripe_map(struct dm_target *ti, struct bio *bio)
return DM_MAPIO_REMAPPED;
}
+static long stripe_direct_access(struct dm_target *ti, sector_t sector,
+ void __pmem **kaddr, pfn_t *pfn, long size)
+{
+ struct stripe_c *sc;
+ struct block_device *bdev;
+ uint32_t stripe;
+ struct blk_dax_ctl dax = {
+ .size = size,
+ };
+ long ret;
+
+ sc = ti->private;
+ stripe_map_sector(sc, sector, &stripe, &dax.sector);
+
+ dax.sector += sc->stripe[stripe].physical_start;
+ bdev = sc->stripe[stripe].dev->bdev;
+
+ ret = bdev_direct_access(bdev, &dax);
+ *kaddr = dax.addr;
+ *pfn = dax.pfn;
+
+ return ret;
+}
+
/*
* Stripe status:
*
@@ -425,6 +449,7 @@ static struct target_type stripe_target = {
.status = stripe_status,
.iterate_devices = stripe_iterate_devices,
.io_hints = stripe_io_hints,
+ .direct_access = stripe_direct_access,
};
int __init dm_stripe_init(void)
6 years
[PATCH v5 0/5] Introduce device_add_disk() to kill gendisk.driverfs_dev
by Dan Williams
Changes since v4 [1]:
1/ Continue to populate ->driverfs_dev until the final removal so that
there are no behavior changes in the middle of the series, for example
in printk_all_partitions(). (Bart)
2/ Use more descriptive 'parent' variable name instead of 'dev' in
ubd_kern.c to indicate the parent device (Bart).
3/ Remove Reported-by tags per Bart's request.
[1]: https://lists.01.org/pipermail/linux-nvdimm/2016-June/006031.html
---
Answer the "// FIXME: remove" include/linux/genhd.h. This should be
functionally equivalent to the previous state. These patches received a
build success notification from the kbuild robot.
---
Dan Williams (5):
block: introduce device_add_disk()
mmc: move 'parent' tracking to mmc_blk_data
um: track 'parent' device in a local variable
block: convert to device_add_disk()
block: remove ->driverfs_dev
arch/powerpc/sysdev/axonram.c | 3 +--
arch/um/drivers/ubd_kern.c | 5 +++--
block/genhd.c | 18 +++++++++---------
drivers/block/cciss.c | 3 +--
drivers/block/floppy.c | 3 +--
drivers/block/mtip32xx/mtip32xx.c | 5 ++---
drivers/block/ps3disk.c | 3 +--
drivers/block/ps3vram.c | 3 +--
drivers/block/rsxx/dev.c | 4 +---
drivers/block/skd_main.c | 8 +++-----
drivers/block/sunvdc.c | 3 +--
drivers/block/virtio_blk.c | 3 +--
drivers/block/xen-blkfront.c | 3 +--
drivers/ide/ide-cd.c | 3 +--
drivers/ide/ide-gd.c | 3 +--
drivers/memstick/core/ms_block.c | 3 +--
drivers/memstick/core/mspro_block.c | 3 +--
drivers/mmc/card/block.c | 5 +++--
drivers/mtd/mtd_blkdevs.c | 4 +---
drivers/nvdimm/blk.c | 3 +--
drivers/nvdimm/btt.c | 3 +--
drivers/nvdimm/bus.c | 2 +-
drivers/nvdimm/pmem.c | 3 +--
drivers/nvme/host/core.c | 3 +--
drivers/s390/block/dasd_genhd.c | 3 +--
drivers/s390/block/dcssblk.c | 3 +--
drivers/s390/block/scm_blk.c | 3 +--
drivers/scsi/sd.c | 3 +--
drivers/scsi/sr.c | 3 +--
include/linux/genhd.h | 8 ++++++--
30 files changed, 50 insertions(+), 72 deletions(-)
6 years
[PATCH v3 0/4] Support DAX for device-mapper linear devices
by Mike Snitzer
Jens, please pick up the first 2 block patches and I'll get the other
2 DM patches staged for 4.8.
v3:
- fixed "warning: context imbalance in 'dm_blk_direct_access' -
different lock contexts for basic block" due to missing
dm_put_live_table in dm_blk_direct_access's dm_get_live_table error
path
- refactored dm-table.c code to centralize checking if all devices in
a DM table support DAX (removed need for target to set
->dax_supported)
- included Yigal Korman's patch to add 'dax' sysfs attribute
Toshi Kani (3):
block: add QUEUE_FLAG_DAX for devices to advertise their DAX support
dm: add infrastructure for DAX support
dm linear: add DAX support
Yigal Korman (1):
block: expose QUEUE_FLAG_DAX in sysfs
block/blk-sysfs.c | 11 +++++++++++
drivers/block/brd.c | 4 +++-
drivers/md/dm-linear.c | 21 ++++++++++++++++++++-
drivers/md/dm-table.c | 44 ++++++++++++++++++++++++++++++++++++++++++-
drivers/md/dm.c | 38 +++++++++++++++++++++++++++++++++++--
drivers/md/dm.h | 1 +
drivers/nvdimm/pmem.c | 1 +
drivers/s390/block/dcssblk.c | 1 +
fs/block_dev.c | 5 +++--
include/linux/blkdev.h | 2 ++
include/linux/device-mapper.h | 10 ++++++++++
include/uapi/linux/dm-ioctl.h | 4 ++--
12 files changed, 133 insertions(+), 9 deletions(-)
--
2.7.4 (Apple Git-66)
6 years, 1 month
[PATCH] libnvdimm: initialize struct blk_integrity with 0
by Johannes Thumshirn
Initialize struct blk_integrity with 0 as blk_integrity_register() takes the
then unitialized struct blk_integrity::flags and ORs it to the resulting block
integrity structure.
Signed-off-by: Johannes Thumshirn <jthumshirn(a)suse.de>
---
drivers/nvdimm/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvdimm/core.c b/drivers/nvdimm/core.c
index be89764..32e4fe2 100644
--- a/drivers/nvdimm/core.c
+++ b/drivers/nvdimm/core.c
@@ -601,7 +601,8 @@ int nd_integrity_init(struct gendisk *disk, unsigned long meta_size)
if (meta_size == 0)
return 0;
- bi.profile = NULL;
+ memset(&bi, 0, sizeof(bi));
+
bi.tuple_size = meta_size;
bi.tag_size = meta_size;
--
2.8.4
6 years, 1 month
[PATCH] acpi, nfit: print command names instead of numbers
by Vishal Verma
For the debug prints in acpi_nfit_ctl(), all the prints except the input
buffer dump printed the command name. Make this also do the same for
better readability.
Cc: Dan Williams <dan.j.williams(a)intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
drivers/acpi/nfit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 2215fc8..d35e3be 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -247,8 +247,8 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
}
if (IS_ENABLED(CONFIG_ACPI_NFIT_DEBUG)) {
- dev_dbg(dev, "%s:%s cmd: %d: func: %d input length: %d\n",
- __func__, dimm_name, cmd, func,
+ dev_dbg(dev, "%s:%s cmd: %s: func: %d input length: %d\n",
+ __func__, dimm_name, cmd_name, func,
in_buf.buffer.length);
print_hex_dump_debug("nvdimm in ", DUMP_PREFIX_OFFSET, 4, 4,
in_buf.buffer.pointer,
--
2.5.5
6 years, 1 month
test suite errors
by Johannes Thumshirn
Hi,
I get the following error when running ndctl's make check:
check_smart: HAVE_NDCTL_SMART disabled, skipping
check_smart_threshold: HAVE_NDCTL_SMART disabled, skipping
check_set_config_data: dimm: 0 read2 data miscompare: 0
check_smart: HAVE_NDCTL_SMART disabled, skipping
check_smart_threshold: HAVE_NDCTL_SMART disabled, skipping
check_set_config_data: dimm: 0x1 read2 data miscompare: 0
check_smart: HAVE_NDCTL_SMART disabled, skipping
check_smart_threshold: HAVE_NDCTL_SMART disabled, skipping
check_set_config_data: dimm: 0x100 read2 data miscompare: 0
check_smart: HAVE_NDCTL_SMART disabled, skipping
check_smart_threshold: HAVE_NDCTL_SMART disabled, skipping
check_set_config_data: dimm: 0x101 read2 data miscompare: 0
check_dax_create: 4
__check_dax_create: dax13.0 align: 1
libdaxctl: daxctl_region_unref: region13 released
__check_dax_create: dax13.1 align: 1073741824
libndctl: ndctl_dax_enable: dax13.1: failed to enable
__check_dax_create: dax13.1 align: 4096
libdaxctl: daxctl_region_unref: region13 released
__check_dax_create: dax13.0 align: 2097152
libndctl: ndctl_dax_enable: dax13.0: failed to enable
dax13.0: expected dax enable success, region13 read-write
namespace13.0: failed to create dax
namespace13.0: failed to configure namespace
ndctl-test0 failed: -6
libkmod: kmod_module_remove_module: could not remove 'nfit_test': Resource temporarily unavailable
libdaxctl: daxctl_unref: context 0xe1b410 released
libndctl: ndctl_unref: context 0xe13290 released
Looking at nfit_test there are indeed some holders left:
linux-te3r:~/ndctl/test # lsmod | grep nfit_test
nfit_test 24576 9
nfit 45056 9 nfit_test
libnvdimm 135168 6 nfit,dax_pmem,nd_pmem,nfit_test,nd_blk,nd_btt
nfit_test_iomap 16384 6 dax,nfit,libnvdimm,dax_pmem,nd_pmem,nfit_test
linux-te3r:~/ndctl/test #
This is with 4.7-rc4
The other tests of the suite are all PASS.
Has anyone else seen this problems?
Thanks,
Johannes
--
Johannes Thumshirn Storage
jthumshirn(a)suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
6 years, 1 month
[PATCH] nfit: fix format interface code byte order
by Dan Williams
Per JEDEC Annex L Release 3 the SPD data is:
Bits 9~5 00 000 = Function Undefined
00 001 = Byte addressable energy backed
00 010 = Block addressed
00 011 = Byte addressable, no energy backed
All other codes reserved
Bits 4~0 0 0000 = Proprietary interface
0 0001 = Standard interface 1
All other codes reserved; see Definitions of Functions
...and per the ACPI 6.1 spec:
byte0: Bits 4~0 (0 or 1)
byte1: Bits 9~5 (1, 2, or 3)
...so a format interface code displayed as 0x301 should be stored in the
nfit as (0x1, 0x3), little-endian.
Cc: Toshi Kani <toshi.kani(a)hpe.com>
Cc: Rafael J. Wysocki <rjw(a)rjwysocki.net>
Cc: Robert Moore <robert.moore(a)intel.com>
Cc: Robert Elliott <elliott(a)hpe.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=121161
Fixes: 30ec5fd464d5 ("nfit: fix format interface code byte order per ACPI6.1")
Fixes: 5ad9a7fde07a ("acpi/nfit: Update nfit driver to comply with ACPI 6.1")
Reported-by: Kristin Jacque <kristin.jacque(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
drivers/acpi/nfit.c | 6 +++---
drivers/acpi/nfit.h | 10 +++++-----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 32579a7b71d5..ac6ddcc080d4 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -928,7 +928,7 @@ static ssize_t format_show(struct device *dev,
{
struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
- return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->code));
+ return sprintf(buf, "0x%04x\n", le16_to_cpu(dcr->code));
}
static DEVICE_ATTR_RO(format);
@@ -961,8 +961,8 @@ static ssize_t format1_show(struct device *dev,
continue;
if (nfit_dcr->dcr->code == dcr->code)
continue;
- rc = sprintf(buf, "%#x\n",
- be16_to_cpu(nfit_dcr->dcr->code));
+ rc = sprintf(buf, "0x%04x\n",
+ le16_to_cpu(nfit_dcr->dcr->code));
break;
}
if (rc != ENXIO)
diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
index 11cb38348aef..02b9ea1e8d2e 100644
--- a/drivers/acpi/nfit.h
+++ b/drivers/acpi/nfit.h
@@ -53,12 +53,12 @@ enum nfit_uuids {
};
/*
- * Region format interface codes are stored as an array of bytes in the
- * NFIT DIMM Control Region structure
+ * Region format interface codes are stored with the interface as the
+ * LSB and the function as the MSB.
*/
-#define NFIT_FIC_BYTE cpu_to_be16(0x101) /* byte-addressable energy backed */
-#define NFIT_FIC_BLK cpu_to_be16(0x201) /* block-addressable non-energy backed */
-#define NFIT_FIC_BYTEN cpu_to_be16(0x301) /* byte-addressable non-energy backed */
+#define NFIT_FIC_BYTE cpu_to_le16(0x101) /* byte-addressable energy backed */
+#define NFIT_FIC_BLK cpu_to_le16(0x201) /* block-addressable non-energy backed */
+#define NFIT_FIC_BYTEN cpu_to_le16(0x301) /* byte-addressable non-energy backed */
enum {
NFIT_BLK_READ_FLUSH = 1,
6 years, 1 month