Re: [Patch net-next v2] net: mana: Handle hardware recovery events when probing the device

From: Paolo Abeni

Date: Thu Nov 20 2025 - 06:11:28 EST


On 11/18/25 2:52 AM, longli@xxxxxxxxxxxxxxxxxxx wrote:
> From: Long Li <longli@xxxxxxxxxxxxx>
>
> When MANA is being probed, it's possible that hardware is in recovery
> mode and the device may get GDMA_EQE_HWC_RESET_REQUEST over HWC in the
> middle of the probe. Detect such condition and go through the recovery
> service procedure.
>
> Fixes: fbe346ce9d62 ("net: mana: Handle Reset Request from MANA NIC")
> Signed-off-by: Long Li <longli@xxxxxxxxxxxxx>

Does not apply cleanly anymore due to commit
934fa943b53795339486cc0026b3ab7ad39dc600, please rebase and repost.

> +static void mana_recovery_delayed_func(struct work_struct *w)
> +{
> + struct mana_dev_recovery_work *work;
> + struct mana_dev_recovery *dev, *tmp;
> + unsigned long flags;
> +
> + work = container_of(w, struct mana_dev_recovery_work, work.work);
> +
> + spin_lock_irqsave(&work->lock, flags);
> +
> + list_for_each_entry_safe(dev, tmp, &work->dev_list, list) {
> + list_del(&dev->list);

Minor nit: here and in similar code below I find sligly more readable
something alike:

while (!list_empty(&work->dev_list)) {
dev = list_first_entry(&work->dev_list);
list_del(dev);
//...

as it's more clear that releasing the lock will not causes races, but no
strong opinion against the current style.

/P

/P