anitazha / rpms / ndctl

Forked from rpms/ndctl a year ago
Clone

Blame SOURCES/0069-ndctl-docs-Clarify-update-firwmware-activation-overf.patch

e0018b
From 475cb041a97d3c7140efd1b0cda820fb22b69d11 Mon Sep 17 00:00:00 2001
e0018b
From: Dan Williams <dan.j.williams@intel.com>
e0018b
Date: Wed, 5 Jan 2022 13:31:44 -0800
e0018b
Subject: [PATCH 069/217] ndctl/docs: Clarify update-firwmware activation
e0018b
 'overflow' conditions
e0018b
e0018b
Give examples and remediation for "overflow" events, i.e. where the
e0018b
estimated time to complete activation exceeds the platform advertised
e0018b
maximum. When that happens forced activation can lead to undefined results.
e0018b
e0018b
Link: https://lore.kernel.org/r/164141830490.3990253.6263569501446070716.stgit@dwillia2-desk3.amr.corp.intel.com
e0018b
Tested-by: Alison Schofield <alison.schofield@intel.com>
e0018b
Tested-by: Vaibhav Jain <vaibhav@linux.ibm.com>
e0018b
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
e0018b
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
e0018b
---
e0018b
 Documentation/ndctl/ndctl-update-firmware.txt | 64 ++++++++++++++++++-
e0018b
 1 file changed, 63 insertions(+), 1 deletion(-)
e0018b
e0018b
diff --git a/Documentation/ndctl/ndctl-update-firmware.txt b/Documentation/ndctl/ndctl-update-firmware.txt
e0018b
index 1080d62..6166457 100644
e0018b
--- a/Documentation/ndctl/ndctl-update-firmware.txt
e0018b
+++ b/Documentation/ndctl/ndctl-update-firmware.txt
e0018b
@@ -58,7 +58,69 @@ include::xable-bus-options.txt[]
e0018b
 	Arm a device for firmware activation. This is enabled by default
e0018b
 	when a firmware image is specified. Specify --no-arm to disable
e0018b
 	this default. Otherwise, without a firmware image, this option can be
e0018b
-	used to manually arm a device for firmware activate.
e0018b
+	used to manually arm a device for firmware activate. When a
e0018b
+	device transitions from unarmed to armed the platform recalculates the
e0018b
+	firmware activation time and compares it against the maximum platform
e0018b
+	supported time. If the activation time would exceed the platform maximum the
e0018b
+	arm attempt is aborted:
e0018b
+
e0018b
+[verse]
e0018b
+ndctl update-firmware --arm --bus=nfit_test.0 all
e0018b
+  Error: update firmware: nmem4: arm aborted, tripped overflow
e0018b
+[
e0018b
+  {
e0018b
+    "dev":"nmem1",
e0018b
+    "id":"cdab-0a-07e0-ffffffff",
e0018b
+    "handle":"0",
e0018b
+    "phys_id":"0",
e0018b
+    "security":"disabled",
e0018b
+    "firmware":{
e0018b
+      "current_version":"0",
e0018b
+      "can_update":true
e0018b
+    }
e0018b
+  },
e0018b
+  {
e0018b
+    "dev":"nmem3",
e0018b
+    "id":"cdab-0a-07e0-fffeffff",
e0018b
+    "handle":"0x100",
e0018b
+    "phys_id":"0x2",
e0018b
+    "security":"disabled",
e0018b
+    "firmware":{
e0018b
+      "current_version":"0",
e0018b
+      "can_update":true
e0018b
+    }
e0018b
+  },
e0018b
+  {
e0018b
+    "dev":"nmem2",
e0018b
+    "id":"cdab-0a-07e0-feffffff",
e0018b
+    "handle":"0x1",
e0018b
+    "phys_id":"0x1",
e0018b
+    "security":"disabled",
e0018b
+    "firmware":{
e0018b
+      "current_version":"0",
e0018b
+      "can_update":true
e0018b
+    }
e0018b
+  }
e0018b
+]
e0018b
+updated 3 nmems.
e0018b
+
e0018b
+	It is possible, but not recommended, to ignore timeout overflows
e0018b
+	with the --force option. At any point to view the 'armed' state of the
e0018b
+	bus do:
e0018b
+
e0018b
+[verse]
e0018b
+ndctl list -BF -b nfit_test.0
e0018b
+[
e0018b
+  {
e0018b
+    "provider":"nfit_test.0",
e0018b
+    "dev":"ndbus2",
e0018b
+    "scrub_state":"idle",
e0018b
+    "firmware":{
e0018b
+      "activate_method":"suspend",
e0018b
+      "activate_state":"overflow"
e0018b
+    }
e0018b
+  }
e0018b
+]
e0018b
 
e0018b
 -D::
e0018b
 --disarm::
e0018b
-- 
e0018b
2.27.0
e0018b