From patchwork Fri Jun 9 11:01:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13273729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3020C7EE25 for ; Fri, 9 Jun 2023 11:15:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239171AbjFILPZ (ORCPT ); Fri, 9 Jun 2023 07:15:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239078AbjFILPT (ORCPT ); Fri, 9 Jun 2023 07:15:19 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226C22738 for ; Fri, 9 Jun 2023 04:14:52 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1b038064d97so5593625ad.0 for ; Fri, 09 Jun 2023 04:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686309291; x=1688901291; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=d0Mnf/SlG4i5zWqkZLWFOoEQh1fHYO1TMmSJCN8ml0g=; b=F9cHfASG+uIRrWsixIHbc6SianFfL3+8ieRJabv+aVZfqh3YJFvQxv24qfRITeFgVC zfXk9NsCFtUfHzF8mG1wvvlQvWSfnf27sNah1TgW1BEhllwKEeFnkzIhAOEOK11IVkHg jtxGONY28HRDOCFnvQTyt1PJC/jGsIHYcBD4M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686309291; x=1688901291; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d0Mnf/SlG4i5zWqkZLWFOoEQh1fHYO1TMmSJCN8ml0g=; b=HU9g1fdsEYtsAmwTHjd34+nKxb3iOlCDV4TdAgmYBWj5OZoR4zgpDNannFm/TZ9yIc n513azgR+PBZFzqhvmHrtJLvGHGaa6hGFrKvva3upN+e5SxXTrLxgDx6YWpLB0p+M1eZ GYnn0imCwqnsqib8s9ikYOzLjFvVBQ4dTvaAAvcMylU73gGEouX3TK80g+l5OKZUbENM hpDKx2Yz8lYjVxrecOu6HczrA9/ZgzvMUtfcGVWe6F+gi2dFHCmzdURPKFcL92hwCZL1 GES6RZz+U3d37qCKAUwozJyUH+rBek14fsatz4/txN4vG8HUJRcxcYbsJu/2K6zM+W/8 HbKw== X-Gm-Message-State: AC+VfDypfRFZnIhWhIAXbdk4zKCck9wgg+BDIJ8Rx7Y/zgChrtzazhRL pyWgDV8lX5MCJj8ZwqKO7IUC5w== X-Google-Smtp-Source: ACHHUZ7JF70T8KoYDB9SBSDAJ5+AJWlkcYOHyFawCVeoatR8xaNcitJnHbDxEBFBAkeut/lIcd3wTA== X-Received: by 2002:a17:902:fa8f:b0:1b0:3d03:4179 with SMTP id lc15-20020a170902fa8f00b001b03d034179mr1478225plb.6.1686309291542; Fri, 09 Jun 2023 04:14:51 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id q4-20020a170902dac400b001b0142908f7sm2992954plx.291.2023.06.09.04.14.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2023 04:14:50 -0700 (PDT) From: Selvin Xavier To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, kashyap.desai@broadcom.com, Selvin Xavier Subject: [PATCH v2 for-next 14/17] RDMA/bnxt_re: cancel all control path command waiters upon error. Date: Fri, 9 Jun 2023 04:01:51 -0700 Message-Id: <1686308514-11996-15-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1686308514-11996-1-git-send-email-selvin.xavier@broadcom.com> References: <1686308514-11996-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kashyap Desai When an error is detected in FW, wake up all the waiters as the all of them need to be completed with timeout. Add the device error state also as a wait condition. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/main.c | 1 + drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 51372de..8241154 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1495,6 +1495,7 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state) */ set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags); set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags); + wake_up_all(&rdev->rcfw.cmdq.waitq); mutex_unlock(&bnxt_re_mutex); return 0; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c index 8dd8216..8b1b413 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c @@ -116,10 +116,10 @@ static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie, u8 opcode) return -ETIMEDOUT; wait_event_timeout(cmdq->waitq, - !test_bit(cbit, cmdq->cmdq_bitmap), + !test_bit(cbit, cmdq->cmdq_bitmap) || + test_bit(ERR_DEVICE_DETACHED, &cmdq->flags), msecs_to_jiffies(RCFW_FW_STALL_TIMEOUT_SEC * 1000)); - if (!test_bit(cbit, cmdq->cmdq_bitmap)) return 0;