Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1623785 > unrolled thread
| Started by | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| First post | 2017-04-14 19:10 +0200 |
| Last post | 2017-04-17 19:30 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/5] libnvdimm: acpi updates and a revert Dan Williams <dan.j.williams@intel.com> - 2017-04-14 19:10 +0200
[PATCH 5/5] acpi, nfit: limit ->flush_probe() to initialization work Dan Williams <dan.j.williams@intel.com> - 2017-04-14 19:10 +0200
Re: [PATCH 5/5] acpi, nfit: limit ->flush_probe() to initialization work Dan Williams <dan.j.williams@intel.com> - 2017-04-14 19:40 +0200
[PATCH 2/5] acpi, nfit: add support for acpi 6.1 dimm state flags Dan Williams <dan.j.williams@intel.com> - 2017-04-14 19:10 +0200
Re: [PATCH 2/5] acpi, nfit: add support for acpi 6.1 dimm state flags "Kani, Toshimitsu" <toshi.kani@hpe.com> - 2017-04-17 19:30 +0200
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2017-04-14 19:10 +0200 |
| Subject | [PATCH 0/5] libnvdimm: acpi updates and a revert |
| Message-ID | <twcTn-3LV-3@gated-at.bofh.it> |
With Dave's recent fix [1], we can restore error clearing for btt i/o in
4.12.
ACPI 6.1 introduced new health state flags. Beyond reflecting them in
the dimmX/flags sysfs attribute we also need to handle the deeper
implications of the ACPI_NFIT_MEM_MAP_FAILED flag which changes
assumptions on how the driver discovers dimms. In the "map failed" case
there may missing or no SPA entries associated with a dimm. Those dimms
should still be registered with libnvdimm so that the error state can be
communicated and recovery attempted.
[1]: https://patchwork.kernel.org/patch/9680035/
---
Dan Williams (5):
Revert "libnvdimm: band aid btt vs clear poison locking"
acpi, nfit: add support for acpi 6.1 dimm state flags
tools/testing/nvdimm: test acpi 6.1 health state flags
acpi, nfit: support "map failed" dimms
acpi, nfit: limit ->flush_probe() to initialization work
drivers/acpi/nfit/core.c | 61 +++++++++++++++++++++++++++++++-------
drivers/acpi/nfit/nfit.h | 1 +
drivers/nvdimm/claim.c | 10 +-----
tools/testing/nvdimm/test/nfit.c | 40 +++++++++++++++++++++++--
4 files changed, 88 insertions(+), 24 deletions(-)
[toc] | [next] | [standalone]
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2017-04-14 19:10 +0200 |
| Subject | [PATCH 5/5] acpi, nfit: limit ->flush_probe() to initialization work |
| Message-ID | <twcTn-3LV-9@gated-at.bofh.it> |
| In reply to | #1623785 |
The nvdimm probe flushing mechanism gives userspace a sync point where
it knows all asynchronous driver probe sequences have completed.
However, it need not wait for other asynchronous actions, like
on-demand address-range-scrub. Track the init work separately from other
work in the workqueue, and only flush the former.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/acpi/nfit/core.c | 13 ++++++++++---
drivers/acpi/nfit/nfit.h | 1 +
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 06738df477db..17cac9d369e0 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -738,7 +738,7 @@ static void nfit_mem_init_bdw(struct acpi_nfit_desc *acpi_desc,
}
}
-static int nfit_mem_dcr_init(struct acpi_nfit_desc *acpi_desc,
+static int __nfit_mem_init(struct acpi_nfit_desc *acpi_desc,
struct acpi_nfit_system_address *spa)
{
struct nfit_mem *nfit_mem, *found;
@@ -898,7 +898,7 @@ static int nfit_mem_init(struct acpi_nfit_desc *acpi_desc)
* BDWs are optional.
*/
list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
- rc = nfit_mem_dcr_init(acpi_desc, nfit_spa->spa);
+ rc = __nfit_mem_init(acpi_desc, nfit_spa->spa);
if (rc)
return rc;
}
@@ -908,7 +908,7 @@ static int nfit_mem_init(struct acpi_nfit_desc *acpi_desc)
* SPA entries above. Find and register all the unmapped DIMMs
* for reporting and recovery purposes.
*/
- rc = nfit_mem_dcr_init(acpi_desc, NULL);
+ rc = __nfit_mem_init(acpi_desc, NULL);
if (rc)
return rc;
@@ -2568,6 +2568,7 @@ static void acpi_nfit_scrub(struct work_struct *work)
acpi_nfit_register_region(acpi_desc, nfit_spa);
}
}
+ acpi_desc->init_complete = 1;
list_for_each_entry(nfit_spa, &acpi_desc->spas, list)
acpi_nfit_async_scrub(acpi_desc, nfit_spa);
@@ -2771,6 +2772,12 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc)
device_lock(dev);
device_unlock(dev);
+ /* bounce the init_mutex to make init_complete valid */
+ mutex_lock(&acpi_desc->init_mutex);
+ mutex_unlock(&acpi_desc->init_mutex);
+ if (acpi_desc->init_complete)
+ return 0;
+
/*
* Scrub work could take 10s of seconds, userspace may give up so we
* need to be interruptible while waiting.
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h
index fc29c2e9832e..256829597585 100644
--- a/drivers/acpi/nfit/nfit.h
+++ b/drivers/acpi/nfit/nfit.h
@@ -163,6 +163,7 @@ struct acpi_nfit_desc {
unsigned int scrub_count;
unsigned int scrub_mode;
unsigned int cancel:1;
+ unsigned int init_complete:1;
unsigned long dimm_cmd_force_en;
unsigned long bus_cmd_force_en;
int (*blk_do_io)(struct nd_blk_region *ndbr, resource_size_t dpa,
[toc] | [prev] | [next] | [standalone]
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2017-04-14 19:40 +0200 |
| Subject | Re: [PATCH 5/5] acpi, nfit: limit ->flush_probe() to initialization work |
| Message-ID | <twdmq-3Wz-11@gated-at.bofh.it> |
| In reply to | #1623786 |
On Fri, Apr 14, 2017 at 9:58 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> The nvdimm probe flushing mechanism gives userspace a sync point where
> it knows all asynchronous driver probe sequences have completed.
> However, it need not wait for other asynchronous actions, like
> on-demand address-range-scrub. Track the init work separately from other
> work in the workqueue, and only flush the former.
>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> drivers/acpi/nfit/core.c | 13 ++++++++++---
> drivers/acpi/nfit/nfit.h | 1 +
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 06738df477db..17cac9d369e0 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -738,7 +738,7 @@ static void nfit_mem_init_bdw(struct acpi_nfit_desc *acpi_desc,
> }
> }
>
> -static int nfit_mem_dcr_init(struct acpi_nfit_desc *acpi_desc,
> +static int __nfit_mem_init(struct acpi_nfit_desc *acpi_desc,
> struct acpi_nfit_system_address *spa)
> {
> struct nfit_mem *nfit_mem, *found;
> @@ -898,7 +898,7 @@ static int nfit_mem_init(struct acpi_nfit_desc *acpi_desc)
> * BDWs are optional.
> */
> list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
> - rc = nfit_mem_dcr_init(acpi_desc, nfit_spa->spa);
> + rc = __nfit_mem_init(acpi_desc, nfit_spa->spa);
Whoops, this function rename should have been folded into the previous patch.
[toc] | [prev] | [next] | [standalone]
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2017-04-14 19:10 +0200 |
| Subject | [PATCH 2/5] acpi, nfit: add support for acpi 6.1 dimm state flags |
| Message-ID | <twcTo-3LV-19@gated-at.bofh.it> |
| In reply to | #1623785 |
Add support for the ACPI_NFIT_MEM_MAP_FAILED ("map_fail") and
ACPI_NFIT_MEM_HEALTH_ENABLED ("smart_notify") health state flags. The
"map_fail" flag identifies DIMMs that were not mapped into one or more
physical address ranges. The "health_notify" flag indicates whether
platform firmware will send notifications when there is new SMART health
data to consume.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/acpi/nfit/core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 53943d6f4214..05829de43b1d 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1246,12 +1246,14 @@ static ssize_t flags_show(struct device *dev,
{
u16 flags = to_nfit_memdev(dev)->flags;
- return sprintf(buf, "%s%s%s%s%s\n",
+ return sprintf(buf, "%s%s%s%s%s%s%s\n",
flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save_fail " : "",
flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore_fail " : "",
flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush_fail " : "",
flags & ACPI_NFIT_MEM_NOT_ARMED ? "not_armed " : "",
- flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart_event " : "");
+ flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart_event " : "",
+ flags & ACPI_NFIT_MEM_MAP_FAILED ? "map_fail " : "",
+ flags & ACPI_NFIT_MEM_HEALTH_ENABLED ? "smart_notify " : "");
}
static DEVICE_ATTR_RO(flags);
[toc] | [prev] | [next] | [standalone]
| From | "Kani, Toshimitsu" <toshi.kani@hpe.com> |
|---|---|
| Date | 2017-04-17 19:30 +0200 |
| Subject | Re: [PATCH 2/5] acpi, nfit: add support for acpi 6.1 dimm state flags |
| Message-ID | <txiDn-3sK-11@gated-at.bofh.it> |
| In reply to | #1623787 |
On Fri, 2017-04-14 at 09:58 -0700, Dan Williams wrote:
> Add support for the ACPI_NFIT_MEM_MAP_FAILED ("map_fail") and
> ACPI_NFIT_MEM_HEALTH_ENABLED ("smart_notify") health state flags. The
> "map_fail" flag identifies DIMMs that were not mapped into one or
> more physical address ranges. The "health_notify" flag indicates
> whether platform firmware will send notifications when there is new
> SMART health data to consume.
>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> drivers/acpi/nfit/core.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 53943d6f4214..05829de43b1d 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -1246,12 +1246,14 @@ static ssize_t flags_show(struct device *dev,
> {
> u16 flags = to_nfit_memdev(dev)->flags;
>
> - return sprintf(buf, "%s%s%s%s%s\n",
> + return sprintf(buf, "%s%s%s%s%s%s%s\n",
> flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save_fail " :
> "",
> flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore_fail
> " : "",
> flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush_fail " :
> "",
> flags & ACPI_NFIT_MEM_NOT_ARMED ? "not_armed " : "",
> - flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart_event
> " : "");
> + flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart_event
> " : "",
> + flags & ACPI_NFIT_MEM_MAP_FAILED ? "map_fail " : "",
> + flags & ACPI_NFIT_MEM_HEALTH_ENABLED ? "smart_notify
> " : "");
Thanks for the update! The above change looks good, but we will also
need to make the same changes to the dev_info() in
acpi_nfit_register_dimms().
-Toshi
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web