From patchwork Thu May 28 05:21:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 6496011 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 04A379F1CC for ; Thu, 28 May 2015 05:21:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6B982072F for ; Thu, 28 May 2015 05:21:23 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 318402072E for ; Thu, 28 May 2015 05:21:22 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EAEB31827B0; Wed, 27 May 2015 22:21:21 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ml01.01.org (Postfix) with ESMTP id E10A61827AF for ; Wed, 27 May 2015 22:21:19 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 27 May 2015 22:21:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,511,1427785200"; d="scan'208";a="732902371" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by fmsmga002.fm.intel.com with ESMTP; 27 May 2015 22:21:19 -0700 Received: from orsmsx107.amr.corp.intel.com ([169.254.1.103]) by ORSMSX103.amr.corp.intel.com ([169.254.2.200]) with mapi id 14.03.0224.002; Wed, 27 May 2015 22:21:18 -0700 From: "Williams, Dan J" To: "rafael@kernel.org" Subject: Re: [GIT PULL v4 00/21] libnd: non-volatile memory device support Thread-Topic: [GIT PULL v4 00/21] libnd: non-volatile memory device support Thread-Index: AQHQmMxPxzk4GDWqHUy2RRZSdzjCQ52Q3s+AgAAEmICAAAbRgIAAFaCAgAACRQCAAAO/gIAAAZcAgABIi4A= Date: Thu, 28 May 2015 05:21:17 +0000 Message-ID: <1432790477.723.20.camel@intel.com> References: <20150527210155.17965.74864.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.140] Content-ID: <4196D04820EEDE4D91EFAFA1C8325DCC@intel.com> MIME-Version: 1.0 Cc: "neilb@suse.de" , "david@fromorbit.com" , "Zheng, Lv" , "hpa@zytor.com" , "hch@lst.de" , "sfr@canb.auug.org.au" , "linux-nvdimm@lists.01.org" , "Wysocki, Rafael J" , "Moore, Robert" , "mingo@kernel.org" , "linux-acpi@vger.kernel.org" , "axboe@fb.com" , "bp@alien8.de" , "tglx@linutronix.de" , "axboe@kernel.dk" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "luto@amacapital.net" , "akpm@linux-foundation.org" , "torvalds@linux-foundation.org" X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 2015-05-28 at 03:01 +0200, Rafael J. Wysocki wrote: > >> And how much time is it going to take to rebase it, actually? > >> > >> If all is so clean as you're suggesting, a "git rebase" should be > >> sufficient for that really. Is it not the case? > > > > Of course the rebase is trivial, it's the testing that has gone into > > the baseline being forfeited for no good reason that I take issue. > > > >> I do believe that having a clean history in the repository is > >> important, especially for big new and complicated features like this > >> one. > > > > Sure, in the general case, but this is one extra commit for > > autogenerated acpica history. > > > >> For the same reason I don't believe that rushing such features in no > >> matter what is the right approach. > >> > >> If Jens decides to pull it regardless, it's his call, but I wouldn't > >> do that if I were him. > > > > I'm not going to push code around your objection. I understand and > > agree with the general policy, but in this specific case I believe an > > exception is warranted. If you still don't ack the approach I'll > > proceed with the rebase. > > Please do a rebase, then. I don't think it's an unreasonable request. > So, first, the bad news... right on queue the acpica baseline throws me this unrelated to libnd splat: ------------[ cut here ]------------ WARNING: CPU: 26 PID: 1 at kernel/locking/lockdep.c:3002 lockdep_init_map+0x462 DEBUG_LOCKS_WARN_ON(1) Modules linked in: CPU: 26 PID: 1 Comm: swapper/0 Not tainted 4.1.0-rc3+ #34 ffffffff81cb0f60 ffff880360c83bc8 ffffffff818a274f 0000000000002355 ffff880360c83c18 ffff880360c83c08 ffffffff81061d6a ffff8803581141f0 ffff8803511e6908 ffff8803581141f0 0000000000000000 0000000000001000 Call Trace: [] dump_stack+0x4c/0x65 [] warn_slowpath_common+0x8a/0xc0 [] warn_slowpath_fmt+0x46/0x50 [] lockdep_init_map+0x462/0x560 [] ? __kernfs_new_node+0x62/0xe0 [] __kernfs_create_file+0x76/0xd0 [] sysfs_add_file_mode_ns+0x9a/0x1d0 [] internal_create_group+0xee/0x2a0 [] sysfs_create_groups+0x4a/0xa0 [] device_add+0x30d/0x640 [] ? perf_workqueue_init+0x66/0x66 [] pmu_dev_alloc+0x8f/0xd0 [] perf_event_sysfs_init+0x4d/0x95 [] do_one_initcall+0xbc/0x1f0 [] kernel_init_freeable+0x1b1/0x23e [] ? initcall_blacklist+0xb6/0xb6 [] ? rest_init+0x150/0x150 [] kernel_init+0xe/0xf0 [] ret_from_fork+0x42/0x70 [] ? rest_init+0x150/0x150 ---[ end trace 36f5d28ae115ea20 ]--- Luckily that seems to be the only immediate breakage as our unit tests pass, and we already had good lockdep coverage of libnd plus nfit driver on the previous baseline. The good news is that upstream, since our old baseline, has fixed a sysfs bug that we were relying on for our namespace-device size-attribute permission settings (fix below). Also, moving the baseline seems to have shaken another 0day report loose (although this sparse report was equally valid on the old baseline). The changes on top of the rebase are small enough to include inline. I've also posted the latest tree to nvdimm.git/libnd-for-next. Given this is now based on the acpica bits for 4.2 is it still suitable to go through the block tree? === The following changes since commit f3b6ced236259a87829b829e8e542ff53bfb9a4f: ACPICA: Fix for ill-formed GUID strings for NFIT tables. (2015-05-25 23:42:34 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm libnd-for-next for you to fetch changes up to 9872c2c54572cd7e7410b4eac293efb58ace2fc3: libnd: Non-Volatile Devices (2015-05-27 23:36:01 -0400) ---------------------------------------------------------------- Dan Williams (18): e820, efi: add ACPI 6.0 persistent memory types libnd, nfit: initial libnd infrastructure and NFIT support libnd: control character device and libnd bus sysfs attributes libnd, nfit: dimm/memory-devices libnd: control (ioctl) messages for libnd bus and dimm devices libnd, nd_dimm: dimm driver and base libnd device-driver infrastructure libnd, nfit: regions (block-data-window, persistent memory, volatile memory) libnd: support for legacy (non-aliasing) nvdimms libnd, nd_pmem: add libnd support to the pmem driver libnd, nfit: add interleave-set state-tracking infrastructure libnd: namespace indices: read and validate libnd: pmem label sets and namespace instantiation. libnd: blk labels and namespace instantiation libnd: write pmem label set libnd: write blk label set libnd: infrastructure for btt devices nfit-test: manufactured NFITs for interface development libnd: Non-Volatile Devices Ross Zwisler (2): pmem: Dynamically allocate partition numbers libnd, nfit, nd_blk: driver for BLK-mode access persistent memory Vishal Verma (1): nd_btt: atomic sector updates Documentation/blockdev/btt.txt | 273 ++++++ Documentation/blockdev/libnd.txt | 804 ++++++++++++++++++ MAINTAINERS | 39 +- arch/arm64/kernel/efi.c | 1 + arch/ia64/kernel/efi.c | 4 + arch/x86/Kconfig | 4 + arch/x86/boot/compressed/eboot.c | 4 + arch/x86/include/uapi/asm/e820.h | 1 + arch/x86/kernel/e820.c | 28 +- arch/x86/kernel/pmem.c | 92 +- arch/x86/platform/efi/efi.c | 3 + drivers/acpi/Kconfig | 27 + drivers/acpi/Makefile | 1 + drivers/acpi/nfit.c | 1474 ++++++++++++++++++++++++++++++++ drivers/acpi/nfit.h | 160 ++++ drivers/block/Kconfig | 13 +- drivers/block/Makefile | 2 +- drivers/block/nd/Kconfig | 101 +++ drivers/block/nd/Makefile | 29 + drivers/block/nd/blk.c | 252 ++++++ drivers/block/nd/btt.c | 1438 +++++++++++++++++++++++++++++++ drivers/block/nd/btt.h | 186 ++++ drivers/block/nd/btt_devs.c | 443 ++++++++++ drivers/block/nd/bus.c | 770 +++++++++++++++++ drivers/block/nd/core.c | 472 ++++++++++ drivers/block/nd/dimm.c | 115 +++ drivers/block/nd/dimm_devs.c | 516 +++++++++++ drivers/block/nd/label.c | 922 ++++++++++++++++++++ drivers/block/nd/label.h | 143 ++++ drivers/block/nd/namespace_devs.c | 1702 +++++++++++++++++++++++++++++++++++++ drivers/block/nd/nd-private.h | 111 +++ drivers/block/nd/nd.h | 257 ++++++ drivers/block/{ => nd}/pmem.c | 107 ++- drivers/block/nd/region.c | 189 ++++ drivers/block/nd/region_devs.c | 667 +++++++++++++++ drivers/block/nd/test/Makefile | 5 + drivers/block/nd/test/iomap.c | 151 ++++ drivers/block/nd/test/nfit.c | 1171 +++++++++++++++++++++++++ drivers/block/nd/test/nfit_test.h | 28 + include/linux/efi.h | 3 +- include/linux/libnd.h | 129 +++ include/linux/nd.h | 98 +++ include/uapi/linux/Kbuild | 1 + include/uapi/linux/ndctl.h | 199 +++++ 44 files changed, 13046 insertions(+), 89 deletions(-) create mode 100644 Documentation/blockdev/btt.txt create mode 100644 Documentation/blockdev/libnd.txt create mode 100644 drivers/acpi/nfit.c create mode 100644 drivers/acpi/nfit.h create mode 100644 drivers/block/nd/Kconfig create mode 100644 drivers/block/nd/Makefile create mode 100644 drivers/block/nd/blk.c create mode 100644 drivers/block/nd/btt.c create mode 100644 drivers/block/nd/btt.h create mode 100644 drivers/block/nd/btt_devs.c create mode 100644 drivers/block/nd/bus.c create mode 100644 drivers/block/nd/core.c create mode 100644 drivers/block/nd/dimm.c create mode 100644 drivers/block/nd/dimm_devs.c create mode 100644 drivers/block/nd/label.c create mode 100644 drivers/block/nd/label.h create mode 100644 drivers/block/nd/namespace_devs.c create mode 100644 drivers/block/nd/nd-private.h create mode 100644 drivers/block/nd/nd.h rename drivers/block/{ => nd}/pmem.c (70%) create mode 100644 drivers/block/nd/region.c create mode 100644 drivers/block/nd/region_devs.c create mode 100644 drivers/block/nd/test/Makefile create mode 100644 drivers/block/nd/test/iomap.c create mode 100644 drivers/block/nd/test/nfit.c create mode 100644 drivers/block/nd/test/nfit_test.h create mode 100644 include/linux/libnd.h create mode 100644 include/linux/nd.h create mode 100644 include/uapi/linux/ndctl.h diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c index c31d0ae87293..34f879808ada 100644 --- a/drivers/acpi/nfit.c +++ b/drivers/acpi/nfit.c @@ -895,7 +895,7 @@ static u64 to_interleave_offset(u64 offset, struct nfit_blk_mmio *mmio) static u64 read_blk_stat(struct nfit_blk *nfit_blk, unsigned int bw) { - struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR]; + struct nfit_blk_mmio __iomem *mmio = &nfit_blk->mmio[DCR]; u64 offset = nfit_blk->stat_offset + mmio->size * bw; if (mmio->num_lines) @@ -908,7 +908,7 @@ static void write_blk_ctl(struct nfit_blk *nfit_blk, unsigned int bw, resource_size_t dpa, unsigned int len, unsigned int write) { u64 cmd, offset; - struct nfit_blk_mmio *mmio = &nfit_blk->mmio[DCR]; + struct nfit_blk_mmio __iomem *mmio = &nfit_blk->mmio[DCR]; enum { BCW_OFFSET_MASK = (1ULL << 48)-1, @@ -959,9 +959,9 @@ static int acpi_nfit_blk_single_io(struct nfit_blk *nfit_blk, void *iobuf, } if (write) - memcpy(mmio->base + offset, iobuf + copied, c); + memcpy_fromio(mmio->base + offset, iobuf + copied, c); else - memcpy(iobuf + copied, mmio->base + offset, c); + memcpy_toio(iobuf + copied, mmio->base + offset, c); copied += c; len -= c; @@ -1036,7 +1036,7 @@ static void nfit_spa_unmap(struct acpi_nfit_desc *acpi_desc, mutex_unlock(&acpi_desc->spa_map_mutex); } -static void *__nfit_spa_map(struct acpi_nfit_desc *acpi_desc, +static void __iomem *__nfit_spa_map(struct acpi_nfit_desc *acpi_desc, struct acpi_nfit_system_address *spa) { resource_size_t start = spa->address; @@ -1092,16 +1092,16 @@ static void *__nfit_spa_map(struct acpi_nfit_desc *acpi_desc, * when all region devices referencing the same mapping are disabled / * unbound. */ -static void *nfit_spa_map(struct acpi_nfit_desc *acpi_desc, +static void __iomem *nfit_spa_map(struct acpi_nfit_desc *acpi_desc, struct acpi_nfit_system_address *spa) { - struct nfit_spa_mapping *spa_map; + void __iomem *iomem; mutex_lock(&acpi_desc->spa_map_mutex); - spa_map = __nfit_spa_map(acpi_desc, spa); + iomem = __nfit_spa_map(acpi_desc, spa); mutex_unlock(&acpi_desc->spa_map_mutex); - return spa_map; + return iomem; } static int nfit_blk_init_interleave(struct nfit_blk_mmio *mmio, diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h index 880e7b3a9da0..e462214f94cd 100644 --- a/drivers/acpi/nfit.h +++ b/drivers/acpi/nfit.h @@ -115,7 +115,7 @@ enum nd_blk_mmio_selector { struct nfit_blk { struct nfit_blk_mmio { - void *base; + void __iomem *base; u64 size; u64 base_offset; u32 line_size; @@ -135,7 +135,7 @@ struct nfit_spa_mapping { struct acpi_nfit_system_address *spa; struct list_head list; struct kref kref; - void *iomem; + void __iomem *iomem; }; static inline struct nfit_spa_mapping *to_spa_map(struct kref *kref) diff --git a/drivers/block/nd/namespace_devs.c b/drivers/block/nd/namespace_devs.c index 8e75c881bc7b..d3042662f4b6 100644 --- a/drivers/block/nd/namespace_devs.c +++ b/drivers/block/nd/namespace_devs.c @@ -1101,7 +1101,7 @@ static umode_t nd_namespace_attr_visible(struct kobject *kobj, struct attribute if (is_namespace_pmem(dev) || is_namespace_blk(dev)) { if (a == &dev_attr_size.attr) - return S_IWUSR; + return S_IWUSR | S_IRUGO; if (is_namespace_pmem(dev) && a == &dev_attr_sector_size.attr) return 0;