Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH iwl-next v1 0/3] support FW Recovery Mode
@ 2024-10-23 10:07 Konrad Knitter
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update Konrad Knitter
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Konrad Knitter @ 2024-10-23 10:07 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: jacob.e.keller, netdev, jiri, davem, edumazet, kuba, pabeni,
	linux-kernel, anthony.l.nguyen, przemyslaw.kitszel,
	Konrad Knitter

Enable update of card in FW Recovery Mode

Konrad Knitter (3):
  pldmfw: selected component update
  devlink: add devl guard
  ice: support FW Recovery Mode

 .../net/ethernet/intel/ice/devlink/devlink.c  |  8 ++-
 .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  1 +
 .../net/ethernet/intel/ice/ice_fw_update.c    | 14 ++++-
 drivers/net/ethernet/intel/ice/ice_lib.c      |  6 +++
 drivers/net/ethernet/intel/ice/ice_lib.h      |  1 +
 drivers/net/ethernet/intel/ice/ice_main.c     | 53 +++++++++++++++++++
 include/linux/pldmfw.h                        |  8 +++
 include/net/devlink.h                         |  1 +
 lib/pldmfw/pldmfw.c                           |  8 +++
 9 files changed, 97 insertions(+), 3 deletions(-)

-- 
2.38.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update
  2024-10-23 10:07 [Intel-wired-lan] [PATCH iwl-next v1 0/3] support FW Recovery Mode Konrad Knitter
@ 2024-10-23 10:07 ` Konrad Knitter
  2024-10-23 10:07   ` Paul Menzel
                     ` (2 more replies)
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 2/3] devlink: add devl guard Konrad Knitter
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 3/3] ice: support FW Recovery Mode Konrad Knitter
  2 siblings, 3 replies; 10+ messages in thread
From: Konrad Knitter @ 2024-10-23 10:07 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: jacob.e.keller, netdev, jiri, davem, edumazet, kuba, pabeni,
	linux-kernel, anthony.l.nguyen, przemyslaw.kitszel,
	Konrad Knitter, Marcin Szycik

Enable update of a selected component.

Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Konrad Knitter <konrad.knitter@intel.com>
---
 include/linux/pldmfw.h | 8 ++++++++
 lib/pldmfw/pldmfw.c    | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/linux/pldmfw.h b/include/linux/pldmfw.h
index 0fc831338226..f5047983004f 100644
--- a/include/linux/pldmfw.h
+++ b/include/linux/pldmfw.h
@@ -125,9 +125,17 @@ struct pldmfw_ops;
  * a pointer to their own data, used to implement the device specific
  * operations.
  */
+
+enum pldmfw_update_mode {
+	PLDMFW_UPDATE_MODE_FULL,
+	PLDMFW_UPDATE_MODE_SINGLE_COMPONENT,
+};
+
 struct pldmfw {
 	const struct pldmfw_ops *ops;
 	struct device *dev;
+	u16 component_identifier;
+	enum pldmfw_update_mode mode;
 };
 
 bool pldmfw_op_pci_match_record(struct pldmfw *context, struct pldmfw_record *record);
diff --git a/lib/pldmfw/pldmfw.c b/lib/pldmfw/pldmfw.c
index 6e1581b9a616..6264e2013f25 100644
--- a/lib/pldmfw/pldmfw.c
+++ b/lib/pldmfw/pldmfw.c
@@ -481,9 +481,17 @@ static int pldm_parse_components(struct pldmfw_priv *data)
 		component->component_data = data->fw->data + offset;
 		component->component_size = size;
 
+		if (data->context->mode == PLDMFW_UPDATE_MODE_SINGLE_COMPONENT &&
+		    data->context->component_identifier != component->identifier)
+			continue;
+
 		list_add_tail(&component->entry, &data->components);
 	}
 
+	if (data->context->mode == PLDMFW_UPDATE_MODE_SINGLE_COMPONENT &&
+	    list_empty(&data->components))
+		return -ENOENT;
+
 	header_crc_ptr = data->fw->data + data->offset;
 
 	err = pldm_move_fw_offset(data, sizeof(data->header_crc));
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Intel-wired-lan] [PATCH iwl-next v1 2/3] devlink: add devl guard
  2024-10-23 10:07 [Intel-wired-lan] [PATCH iwl-next v1 0/3] support FW Recovery Mode Konrad Knitter
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update Konrad Knitter
@ 2024-10-23 10:07 ` Konrad Knitter
  2024-11-05 12:57   ` Pucha, HimasekharX Reddy
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 3/3] ice: support FW Recovery Mode Konrad Knitter
  2 siblings, 1 reply; 10+ messages in thread
From: Konrad Knitter @ 2024-10-23 10:07 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: jacob.e.keller, netdev, jiri, davem, edumazet, kuba, pabeni,
	linux-kernel, anthony.l.nguyen, przemyslaw.kitszel,
	Konrad Knitter

Add devl guard for scoped_guard().

Example usage:

scoped_guard(devl, priv_to_devlink(pf)) {
	err = init_devlink(pf);
	if (err)
		return err;
}

Co-developed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Konrad Knitter <konrad.knitter@intel.com>
---
 include/net/devlink.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/net/devlink.h b/include/net/devlink.h
index 7f5b36554778..6fa46ed3345f 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -1534,6 +1534,7 @@ int devl_trylock(struct devlink *devlink);
 void devl_unlock(struct devlink *devlink);
 void devl_assert_locked(struct devlink *devlink);
 bool devl_lock_is_held(struct devlink *devlink);
+DEFINE_GUARD(devl, struct devlink *, devl_lock(_T), devl_unlock(_T));
 
 struct ib_device;
 
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Intel-wired-lan] [PATCH iwl-next v1 3/3] ice: support FW Recovery Mode
  2024-10-23 10:07 [Intel-wired-lan] [PATCH iwl-next v1 0/3] support FW Recovery Mode Konrad Knitter
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update Konrad Knitter
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 2/3] devlink: add devl guard Konrad Knitter
@ 2024-10-23 10:07 ` Konrad Knitter
  2024-11-05 12:54   ` Pucha, HimasekharX Reddy
  2 siblings, 1 reply; 10+ messages in thread
From: Konrad Knitter @ 2024-10-23 10:07 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: jacob.e.keller, netdev, jiri, davem, edumazet, kuba, pabeni,
	linux-kernel, anthony.l.nguyen, przemyslaw.kitszel,
	Konrad Knitter

Recovery Mode is intended to recover from a fatal failure scenario in
which the device is not accessible to the host, meaning the firmware is
non-responsive.

The purpose of the Firmware Recovery Mode is to enable software tools to
update firmware and/or device configuration so the fatal error can be
resolved.

Recovery Mode Firmware supports a limited set of admin commands required
for NVM update.
Recovery Firmware does not support hardware interrupts so a polling mode
is used.

The driver will expose only the minimum set of devlink commands required
for the recovery of the adapter.

Using an appropriate NVM image, the user can recover the adapter using
the devlink flash API.

Prior to 4.20 E810 Adapter Recovery Firmware supports only the update
and erase of the "fw.mgmt" component.

E810 Adapter Recovery Firmware doesn't support selected preservation of
cards settings or identifiers.

The following command can be used to recover the adapter:

$ devlink dev flash <pci-address> <update-image.bin> component fw.mgmt
  overwrite settings overwrite identifier

Newer FW versions (4.20 or newer) supports update of "fw.undi" and
"fw.netlist" components.

$ devlink dev flash <pci-address> <update-image.bin>

Tested on Intel Corporation Ethernet Controller E810-C for SFP
FW revision 3.20 and 4.30.

Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Konrad Knitter <konrad.knitter@intel.com>
---
 .../net/ethernet/intel/ice/devlink/devlink.c  |  8 ++-
 .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  1 +
 .../net/ethernet/intel/ice/ice_fw_update.c    | 14 ++++-
 drivers/net/ethernet/intel/ice/ice_lib.c      |  6 +++
 drivers/net/ethernet/intel/ice/ice_lib.h      |  1 +
 drivers/net/ethernet/intel/ice/ice_main.c     | 53 +++++++++++++++++++
 6 files changed, 80 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c
index d1b9ccec5e05..d116e2b10bce 100644
--- a/drivers/net/ethernet/intel/ice/devlink/devlink.c
+++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c
@@ -368,14 +368,18 @@ static int ice_devlink_info_get(struct devlink *devlink,
 			}
 			break;
 		case ICE_VERSION_RUNNING:
-			err = devlink_info_version_running_put(req, key, ctx->buf);
+			err = devlink_info_version_running_put_ext(req, key,
+								   ctx->buf,
+								   DEVLINK_INFO_VERSION_TYPE_COMPONENT);
 			if (err) {
 				NL_SET_ERR_MSG_MOD(extack, "Unable to set running version");
 				goto out_free_ctx;
 			}
 			break;
 		case ICE_VERSION_STORED:
-			err = devlink_info_version_stored_put(req, key, ctx->buf);
+			err = devlink_info_version_stored_put_ext(req, key,
+								  ctx->buf,
+								  DEVLINK_INFO_VERSION_TYPE_COMPONENT);
 			if (err) {
 				NL_SET_ERR_MSG_MOD(extack, "Unable to set stored version");
 				goto out_free_ctx;
diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
index 1489a8ceec51..b026478fd98d 100644
--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
@@ -1807,6 +1807,7 @@ struct ice_aqc_nvm_pass_comp_tbl {
 #define ICE_AQ_NVM_PASS_COMP_CAN_BE_UPDATED		0x0
 #define ICE_AQ_NVM_PASS_COMP_CAN_MAY_BE_UPDATEABLE	0x1
 #define ICE_AQ_NVM_PASS_COMP_CAN_NOT_BE_UPDATED		0x2
+#define ICE_AQ_NVM_PASS_COMP_PARTIAL_CHECK		0x3
 	u8 component_response_code; /* Response only */
 #define ICE_AQ_NVM_PASS_COMP_CAN_BE_UPDATED_CODE	0x0
 #define ICE_AQ_NVM_PASS_COMP_STAMP_IDENTICAL_CODE	0x1
diff --git a/drivers/net/ethernet/intel/ice/ice_fw_update.c b/drivers/net/ethernet/intel/ice/ice_fw_update.c
index 2702a0da5c3e..70c201f569ce 100644
--- a/drivers/net/ethernet/intel/ice/ice_fw_update.c
+++ b/drivers/net/ethernet/intel/ice/ice_fw_update.c
@@ -6,6 +6,7 @@
 #include <linux/crc32.h>
 #include <linux/pldmfw.h>
 #include "ice.h"
+#include "ice_lib.h"
 #include "ice_fw_update.h"
 
 struct ice_fwu_priv {
@@ -125,6 +126,10 @@ ice_check_component_response(struct ice_pf *pf, u16 id, u8 response, u8 code,
 	case ICE_AQ_NVM_PASS_COMP_CAN_NOT_BE_UPDATED:
 		dev_info(dev, "firmware has rejected updating %s\n", component);
 		break;
+	case ICE_AQ_NVM_PASS_COMP_PARTIAL_CHECK:
+		if (ice_is_recovery_mode(&pf->hw))
+			return 0;
+		break;
 	}
 
 	switch (code) {
@@ -1004,13 +1009,20 @@ int ice_devlink_flash_update(struct devlink *devlink,
 		return -EOPNOTSUPP;
 	}
 
-	if (!hw->dev_caps.common_cap.nvm_unified_update) {
+	if (!hw->dev_caps.common_cap.nvm_unified_update && !ice_is_recovery_mode(hw)) {
 		NL_SET_ERR_MSG_MOD(extack, "Current firmware does not support unified update");
 		return -EOPNOTSUPP;
 	}
 
 	memset(&priv, 0, sizeof(priv));
 
+	if (params->component && strcmp(params->component, "fw.mgmt") == 0) {
+		priv.context.mode = PLDMFW_UPDATE_MODE_SINGLE_COMPONENT;
+		priv.context.component_identifier = NVM_COMP_ID_NVM;
+	} else if (params->component) {
+		return -EOPNOTSUPP;
+	}
+
 	/* the E822 device needs a slightly different ops */
 	if (hw->mac_type == ICE_MAC_GENERIC)
 		priv.context.ops = &ice_fwu_ops_e822;
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 01220e21cc81..0cb7137d17d3 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -1708,6 +1708,12 @@ bool ice_pf_state_is_nominal(struct ice_pf *pf)
 	return true;
 }
 
+#define ICE_FW_MODE_REC_M BIT(1)
+bool ice_is_recovery_mode(struct ice_hw *hw)
+{
+	return rd32(hw, GL_MNG_FWSM) & ICE_FW_MODE_REC_M;
+}
+
 /**
  * ice_update_eth_stats - Update VSI-specific ethernet statistics counters
  * @vsi: the VSI to be updated
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h
index 10d6fc479a32..eabb35834a24 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.h
+++ b/drivers/net/ethernet/intel/ice/ice_lib.h
@@ -90,6 +90,7 @@ void ice_set_q_vector_intrl(struct ice_q_vector *q_vector);
 
 bool ice_is_safe_mode(struct ice_pf *pf);
 bool ice_is_rdma_ena(struct ice_pf *pf);
+bool ice_is_recovery_mode(struct ice_hw *hw);
 bool ice_is_dflt_vsi_in_use(struct ice_port_info *pi);
 bool ice_is_vsi_dflt_vsi(struct ice_vsi *vsi);
 int ice_set_dflt_vsi(struct ice_vsi *vsi);
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index f3dd300a7dad..41f0d0933c2b 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -2361,6 +2361,18 @@ static void ice_check_media_subtask(struct ice_pf *pf)
 	}
 }
 
+static void ice_service_task_recovery_mode(struct work_struct *work)
+{
+	struct ice_pf *pf = container_of(work, struct ice_pf, serv_task);
+
+	set_bit(ICE_ADMINQ_EVENT_PENDING, pf->state);
+	ice_clean_adminq_subtask(pf);
+
+	ice_service_task_complete(pf);
+
+	mod_timer(&pf->serv_tmr, jiffies + msecs_to_jiffies(100));
+}
+
 /**
  * ice_service_task - manage and run subtasks
  * @work: pointer to work_struct contained by the PF struct
@@ -5211,6 +5223,36 @@ void ice_unload(struct ice_pf *pf)
 	ice_decfg_netdev(vsi);
 }
 
+static int ice_probe_recovery_mode(struct ice_pf *pf)
+{
+	struct device *dev = ice_pf_to_dev(pf);
+	int err;
+
+	dev_err(dev, "Firmware recovery mode detected. Limiting functionality. Refer to the Intel(R) Ethernet Adapters and Devices User Guide for details on firmware recovery mode\n");
+
+	INIT_HLIST_HEAD(&pf->aq_wait_list);
+	spin_lock_init(&pf->aq_wait_lock);
+	init_waitqueue_head(&pf->aq_wait_queue);
+
+	timer_setup(&pf->serv_tmr, ice_service_timer, 0);
+	pf->serv_tmr_period = HZ;
+	INIT_WORK(&pf->serv_task, ice_service_task_recovery_mode);
+	clear_bit(ICE_SERVICE_SCHED, pf->state);
+	err = ice_create_all_ctrlq(&pf->hw);
+	if (err)
+		return err;
+
+	scoped_guard(devl, priv_to_devlink(pf)) {
+		err = ice_init_devlink(pf);
+		if (err)
+			return err;
+	}
+
+	ice_service_task_restart(pf);
+
+	return 0;
+}
+
 /**
  * ice_probe - Device initialization routine
  * @pdev: PCI device information struct
@@ -5302,6 +5344,9 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
 		hw->debug_mask = debug;
 #endif
 
+	if (ice_is_recovery_mode(hw))
+		return ice_probe_recovery_mode(pf);
+
 	err = ice_init_hw(hw);
 	if (err) {
 		dev_err(dev, "ice_init_hw failed: %d\n", err);
@@ -5419,6 +5464,14 @@ static void ice_remove(struct pci_dev *pdev)
 		msleep(100);
 	}
 
+	if (ice_is_recovery_mode(&pf->hw)) {
+		ice_service_task_stop(pf);
+		scoped_guard(devl, priv_to_devlink(pf)) {
+			ice_deinit_devlink(pf);
+		}
+		return;
+	}
+
 	if (test_bit(ICE_FLAG_SRIOV_ENA, pf->flags)) {
 		set_bit(ICE_VF_RESETS_DISABLED, pf->state);
 		ice_free_vfs(pf);
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update Konrad Knitter
@ 2024-10-23 10:07   ` Paul Menzel
  2024-10-23 10:46     ` Knitter, Konrad
  2024-10-23 21:26   ` Keller, Jacob E
  2024-11-05 13:01   ` Pucha, HimasekharX Reddy
  2 siblings, 1 reply; 10+ messages in thread
From: Paul Menzel @ 2024-10-23 10:07 UTC (permalink / raw)
  To: Konrad Knitter
  Cc: intel-wired-lan, jacob.e.keller, netdev, jiri, davem, edumazet,
	kuba, pabeni, linux-kernel, anthony.l.nguyen, przemyslaw.kitszel,
	Marcin Szycik

Dear Konrad,


Thank you for your patch.

Am 23.10.24 um 12:07 schrieb Konrad Knitter:
> Enable update of a selected component.

It’d be great if you used that for the summary/title to make it a 
statement (by adding a verb in imperative mood).

It’d be great, if you elaborated, what that feature is, and included the 
documentation used for the implementation. Also, how can it be tested?

> Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Konrad Knitter <konrad.knitter@intel.com>
> ---
>   include/linux/pldmfw.h | 8 ++++++++
>   lib/pldmfw/pldmfw.c    | 8 ++++++++
>   2 files changed, 16 insertions(+)
> 
> diff --git a/include/linux/pldmfw.h b/include/linux/pldmfw.h
> index 0fc831338226..f5047983004f 100644
> --- a/include/linux/pldmfw.h
> +++ b/include/linux/pldmfw.h
> @@ -125,9 +125,17 @@ struct pldmfw_ops;
>    * a pointer to their own data, used to implement the device specific
>    * operations.
>    */
> +
> +enum pldmfw_update_mode {
> +	PLDMFW_UPDATE_MODE_FULL,
> +	PLDMFW_UPDATE_MODE_SINGLE_COMPONENT,
> +};
> +
>   struct pldmfw {
>   	const struct pldmfw_ops *ops;
>   	struct device *dev;
> +	u16 component_identifier;
> +	enum pldmfw_update_mode mode;
>   };
>   
>   bool pldmfw_op_pci_match_record(struct pldmfw *context, struct pldmfw_record *record);
> diff --git a/lib/pldmfw/pldmfw.c b/lib/pldmfw/pldmfw.c
> index 6e1581b9a616..6264e2013f25 100644
> --- a/lib/pldmfw/pldmfw.c
> +++ b/lib/pldmfw/pldmfw.c
> @@ -481,9 +481,17 @@ static int pldm_parse_components(struct pldmfw_priv *data)
>   		component->component_data = data->fw->data + offset;
>   		component->component_size = size;
>   
> +		if (data->context->mode == PLDMFW_UPDATE_MODE_SINGLE_COMPONENT &&
> +		    data->context->component_identifier != component->identifier)
> +			continue;
> +
>   		list_add_tail(&component->entry, &data->components);
>   	}
>   
> +	if (data->context->mode == PLDMFW_UPDATE_MODE_SINGLE_COMPONENT &&
> +	    list_empty(&data->components))
> +		return -ENOENT;
> +
>   	header_crc_ptr = data->fw->data + data->offset;
>   
>   	err = pldm_move_fw_offset(data, sizeof(data->header_crc));


Kind regards,

Paul

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update
  2024-10-23 10:07   ` Paul Menzel
@ 2024-10-23 10:46     ` Knitter, Konrad
  0 siblings, 0 replies; 10+ messages in thread
From: Knitter, Konrad @ 2024-10-23 10:46 UTC (permalink / raw)
  To: Paul Menzel
  Cc: intel-wired-lan@lists.osuosl.org, Keller, Jacob E,
	netdev@vger.kernel.org, jiri@resnulli.us, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	linux-kernel@vger.kernel.org, Nguyen, Anthony L,
	Kitszel, Przemyslaw, Marcin Szycik

> -----Original Message-----
> From: Paul Menzel <pmenzel@molgen.mpg.de>
> Sent: Wednesday, October 23, 2024 12:07 PM
> To: Knitter, Konrad <konrad.knitter@intel.com>
> Cc: intel-wired-lan@lists.osuosl.org; Keller, Jacob E
> <jacob.e.keller@intel.com>; netdev@vger.kernel.org; jiri@resnulli.us;
> davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com; linux-kernel@vger.kernel.org; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Marcin Szycik
> <marcin.szycik@linux.intel.com>
> Subject: Re: [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected
> component update
> 
> Dear Konrad,
> 
> 
> Thank you for your patch.
> 
> Am 23.10.24 um 12:07 schrieb Konrad Knitter:
> > Enable update of a selected component.
> 
> It’d be great if you used that for the summary/title to make it a
> statement (by adding a verb in imperative mood).
> 
> It’d be great, if you elaborated, what that feature is, and included the
> documentation used for the implementation. 
> 

Please comment if this would be enough:

This patch enables to update a selected component from PLDM image containing multiple components.

Example usage:

struct pldmfw;
data.mode = PLDMFW_UPDATE_MODE_SINGLE_COMPONENT;
data.compontent_identifier = DRIVER_FW_MGMT_COMPONENT_ID;

>> Also, how can it be tested?

This is enabler for ice patch, where on legacy FW versions where only "fw.mgmt" component can is 
allowed to be flashed in recovery mode.

There are no dedicated images for recovery.
Usual image contains multiple components.

This patch can be then tested together with other patches in series on Intel E810 NIC - where you can 
now execute update full card or just "fw.mgmt" component.

> > Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> > Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> > Signed-off-by: Konrad Knitter <konrad.knitter@intel.com>
> > ---
> >   include/linux/pldmfw.h | 8 ++++++++
> >   lib/pldmfw/pldmfw.c    | 8 ++++++++
> >   2 files changed, 16 insertions(+)
> >
> > diff --git a/include/linux/pldmfw.h b/include/linux/pldmfw.h
> > index 0fc831338226..f5047983004f 100644
> > --- a/include/linux/pldmfw.h
> > +++ b/include/linux/pldmfw.h
> > @@ -125,9 +125,17 @@ struct pldmfw_ops;
> >    * a pointer to their own data, used to implement the device specific
> >    * operations.
> >    */
> > +
> > +enum pldmfw_update_mode {
> > +	PLDMFW_UPDATE_MODE_FULL,
> > +	PLDMFW_UPDATE_MODE_SINGLE_COMPONENT,
> > +};
> > +
> >   struct pldmfw {
> >   	const struct pldmfw_ops *ops;
> >   	struct device *dev;
> > +	u16 component_identifier;
> > +	enum pldmfw_update_mode mode;
> >   };
> >
> >   bool pldmfw_op_pci_match_record(struct pldmfw *context, struct
> pldmfw_record *record);
> > diff --git a/lib/pldmfw/pldmfw.c b/lib/pldmfw/pldmfw.c
> > index 6e1581b9a616..6264e2013f25 100644
> > --- a/lib/pldmfw/pldmfw.c
> > +++ b/lib/pldmfw/pldmfw.c
> > @@ -481,9 +481,17 @@ static int pldm_parse_components(struct
> pldmfw_priv *data)
> >   		component->component_data = data->fw->data + offset;
> >   		component->component_size = size;
> >
> > +		if (data->context->mode ==
> PLDMFW_UPDATE_MODE_SINGLE_COMPONENT &&
> > +		    data->context->component_identifier != component-
> >identifier)
> > +			continue;
> > +
> >   		list_add_tail(&component->entry, &data->components);
> >   	}
> >
> > +	if (data->context->mode ==
> PLDMFW_UPDATE_MODE_SINGLE_COMPONENT &&
> > +	    list_empty(&data->components))
> > +		return -ENOENT;
> > +
> >   	header_crc_ptr = data->fw->data + data->offset;
> >
> >   	err = pldm_move_fw_offset(data, sizeof(data->header_crc));
> 
> 
> Kind regards,
> 
> Paul

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update Konrad Knitter
  2024-10-23 10:07   ` Paul Menzel
@ 2024-10-23 21:26   ` Keller, Jacob E
  2024-11-05 13:01   ` Pucha, HimasekharX Reddy
  2 siblings, 0 replies; 10+ messages in thread
From: Keller, Jacob E @ 2024-10-23 21:26 UTC (permalink / raw)
  To: Knitter, Konrad, intel-wired-lan@lists.osuosl.org
  Cc: netdev@vger.kernel.org, jiri@resnulli.us, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	linux-kernel@vger.kernel.org, Nguyen, Anthony L,
	Kitszel, Przemyslaw, Marcin Szycik



> -----Original Message-----
> From: Knitter, Konrad <konrad.knitter@intel.com>
> Sent: Wednesday, October 23, 2024 3:07 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Keller, Jacob E <jacob.e.keller@intel.com>; netdev@vger.kernel.org;
> jiri@resnulli.us; davem@davemloft.net; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com; linux-kernel@vger.kernel.org; Nguyen,
> Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Knitter, Konrad <konrad.knitter@intel.com>;
> Marcin Szycik <marcin.szycik@linux.intel.com>
> Subject: [PATCH iwl-next v1 1/3] pldmfw: selected component update
> 
> Enable update of a selected component.
> 
> Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Konrad Knitter <konrad.knitter@intel.com>

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

Thanks for the PLDM improvement!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-next v1 3/3] ice: support FW Recovery Mode
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 3/3] ice: support FW Recovery Mode Konrad Knitter
@ 2024-11-05 12:54   ` Pucha, HimasekharX Reddy
  0 siblings, 0 replies; 10+ messages in thread
From: Pucha, HimasekharX Reddy @ 2024-11-05 12:54 UTC (permalink / raw)
  To: Knitter, Konrad, intel-wired-lan@lists.osuosl.org
  Cc: Keller, Jacob E, netdev@vger.kernel.org, jiri@resnulli.us,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, linux-kernel@vger.kernel.org,
	Nguyen, Anthony L, Kitszel, Przemyslaw, Knitter, Konrad

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Konrad Knitter
> Sent: 23 October 2024 15:37
> To: intel-wired-lan@lists.osuosl.org
> Cc: Keller, Jacob E <jacob.e.keller@intel.com>; netdev@vger.kernel.org; jiri@resnulli.us; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; linux-kernel@vger.kernel.org; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Knitter, Konrad <konrad.knitter@intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v1 3/3] ice: support FW Recovery Mode
>
> Recovery Mode is intended to recover from a fatal failure scenario in which the device is not accessible to the host, meaning the firmware is non-responsive.
>
> The purpose of the Firmware Recovery Mode is to enable software tools to update firmware and/or device configuration so the fatal error can be resolved.
>
> Recovery Mode Firmware supports a limited set of admin commands required for NVM update.
> Recovery Firmware does not support hardware interrupts so a polling mode is used.
>
> The driver will expose only the minimum set of devlink commands required for the recovery of the adapter.
>
> Using an appropriate NVM image, the user can recover the adapter using the devlink flash API.
>
> Prior to 4.20 E810 Adapter Recovery Firmware supports only the update and erase of the "fw.mgmt" component.
>
> E810 Adapter Recovery Firmware doesn't support selected preservation of cards settings or identifiers.
>
> The following command can be used to recover the adapter:
>
> $ devlink dev flash <pci-address> <update-image.bin> component fw.mgmt
>   overwrite settings overwrite identifier
>
> Newer FW versions (4.20 or newer) supports update of "fw.undi" and "fw.netlist" components.
>
> $ devlink dev flash <pci-address> <update-image.bin>
>
> Tested on Intel Corporation Ethernet Controller E810-C for SFP FW revision 3.20 and 4.30.
>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Konrad Knitter <konrad.knitter@intel.com>
> ---
>  .../net/ethernet/intel/ice/devlink/devlink.c  |  8 ++-
>  .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  1 +
>  .../net/ethernet/intel/ice/ice_fw_update.c    | 14 ++++-
>  drivers/net/ethernet/intel/ice/ice_lib.c      |  6 +++
>  drivers/net/ethernet/intel/ice/ice_lib.h      |  1 +
>  drivers/net/ethernet/intel/ice/ice_main.c     | 53 +++++++++++++++++++
>  6 files changed, 80 insertions(+), 3 deletions(-)
>

Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-next v1 2/3] devlink: add devl guard
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 2/3] devlink: add devl guard Konrad Knitter
@ 2024-11-05 12:57   ` Pucha, HimasekharX Reddy
  0 siblings, 0 replies; 10+ messages in thread
From: Pucha, HimasekharX Reddy @ 2024-11-05 12:57 UTC (permalink / raw)
  To: Knitter, Konrad, intel-wired-lan@lists.osuosl.org
  Cc: Keller, Jacob E, netdev@vger.kernel.org, jiri@resnulli.us,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, linux-kernel@vger.kernel.org,
	Nguyen, Anthony L, Kitszel, Przemyslaw, Knitter, Konrad

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Konrad Knitter
> Sent: 23 October 2024 15:37
> To: intel-wired-lan@lists.osuosl.org
> Cc: Keller, Jacob E <jacob.e.keller@intel.com>; netdev@vger.kernel.org; jiri@resnulli.us; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; linux-kernel@vger.kernel.org; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Knitter, Konrad <konrad.knitter@intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v1 2/3] devlink: add devl guard
>
> Add devl guard for scoped_guard().
>
> Example usage:
>
> scoped_guard(devl, priv_to_devlink(pf)) {
> err = init_devlink(pf);
> 	if (err)
> 		return err;
> }
>
> Co-developed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Konrad Knitter <konrad.knitter@intel.com>
> ---
>  include/net/devlink.h | 1 +
>  1 file changed, 1 insertion(+)
>

Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update
  2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update Konrad Knitter
  2024-10-23 10:07   ` Paul Menzel
  2024-10-23 21:26   ` Keller, Jacob E
@ 2024-11-05 13:01   ` Pucha, HimasekharX Reddy
  2 siblings, 0 replies; 10+ messages in thread
From: Pucha, HimasekharX Reddy @ 2024-11-05 13:01 UTC (permalink / raw)
  To: Knitter, Konrad, intel-wired-lan@lists.osuosl.org
  Cc: Keller, Jacob E, netdev@vger.kernel.org, jiri@resnulli.us,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, linux-kernel@vger.kernel.org,
	Nguyen, Anthony L, Kitszel, Przemyslaw, Knitter, Konrad,
	Marcin Szycik

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Konrad Knitter
> Sent: 23 October 2024 15:37
> To: intel-wired-lan@lists.osuosl.org
> Cc: Keller, Jacob E <jacob.e.keller@intel.com>; netdev@vger.kernel.org; jiri@resnulli.us; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; linux-kernel@vger.kernel.org; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Knitter, Konrad <konrad.knitter@intel.com>; Marcin Szycik <marcin.szycik@linux.intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update
>
> Enable update of a selected component.
>
> Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Konrad Knitter <konrad.knitter@intel.com>
> ---
>  include/linux/pldmfw.h | 8 ++++++++
>  lib/pldmfw/pldmfw.c    | 8 ++++++++
>  2 files changed, 16 insertions(+)
>

Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-11-05 13:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 10:07 [Intel-wired-lan] [PATCH iwl-next v1 0/3] support FW Recovery Mode Konrad Knitter
2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 1/3] pldmfw: selected component update Konrad Knitter
2024-10-23 10:07   ` Paul Menzel
2024-10-23 10:46     ` Knitter, Konrad
2024-10-23 21:26   ` Keller, Jacob E
2024-11-05 13:01   ` Pucha, HimasekharX Reddy
2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 2/3] devlink: add devl guard Konrad Knitter
2024-11-05 12:57   ` Pucha, HimasekharX Reddy
2024-10-23 10:07 ` [Intel-wired-lan] [PATCH iwl-next v1 3/3] ice: support FW Recovery Mode Konrad Knitter
2024-11-05 12:54   ` Pucha, HimasekharX Reddy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox