]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: mana: Reduce waiting time if HWC not responding
authorHaiyang Zhang <haiyangz@microsoft.com>
Wed, 10 Sep 2025 20:57:21 +0000 (13:57 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sun, 14 Sep 2025 18:54:07 +0000 (11:54 -0700)
If HW Channel (HWC) is not responding, reduce the waiting time, so further
steps will fail quickly.
This will prevent getting stuck for a long time (30 minutes or more), for
example, during unloading while HWC is not responding.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://patch.msgid.link/1757537841-5063-1-git-send-email-haiyangz@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microsoft/mana/hw_channel.c

index ef072e24c46d0af07c3fcc35d2cc4a5d54545492..ada6c78a2bef432f39a3bd4fa29b446c0b48b0aa 100644 (file)
@@ -881,7 +881,12 @@ int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len,
        if (!wait_for_completion_timeout(&ctx->comp_event,
                                         (msecs_to_jiffies(hwc->hwc_timeout)))) {
                if (hwc->hwc_timeout != 0)
-                       dev_err(hwc->dev, "HWC: Request timed out!\n");
+                       dev_err(hwc->dev, "HWC: Request timed out: %u ms\n",
+                               hwc->hwc_timeout);
+
+               /* Reduce further waiting if HWC no response */
+               if (hwc->hwc_timeout > 1)
+                       hwc->hwc_timeout = 1;
 
                err = -ETIMEDOUT;
                goto out;