From patchwork Thu Jun 8 10:25:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13271932 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 285CDC7EE43 for ; Thu, 8 Jun 2023 10:37:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234388AbjFHKhv (ORCPT ); Thu, 8 Jun 2023 06:37:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235253AbjFHKhu (ORCPT ); Thu, 8 Jun 2023 06:37:50 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6897230C7 for ; Thu, 8 Jun 2023 03:37:35 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1b02d0942caso1640995ad.1 for ; Thu, 08 Jun 2023 03:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686220655; x=1688812655; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=xXNBUhvWKZ2gdj45Hr9XWCQfaApid+t7wJQiKNdg72k=; b=DT7H4ZQUQ91L8b+kxRceq/1nDNJSpo7Xz/fx6Jxef6XuS0Fm3VUYG3xQ7HyNou51HZ z9dk99Z8/tgsKxivNvw/oU07paz+hJDrp77RYBXLCeEiR1UvOowlA3IaWUdUdmWsHGhZ nkOv5sdjkHNyuCCefIqgZQSc1GRA62zz/JBSc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686220655; x=1688812655; 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=xXNBUhvWKZ2gdj45Hr9XWCQfaApid+t7wJQiKNdg72k=; b=LdGkBBcrKk43n74H70g9O1BCVBkM3zUv9U21Motsm1pPxKg3F6+F8BsXi8tgGp8jkw c8a6eEhFPFzIlqny6zqFzxU0fQEq1zmj+AJEX9gUHQv64iDiauSzsAa0/jwzh+2W8Hk7 Mm9K2KsziHYJ9qnX174b68tWdtrLp6XDkmnWBQ2zkz+7yC0OjNs05lyjVTIKjs7K6aFx 3mNpXLg289QJBG79gWPlB91QbOky9DM8P9uUqLJaU9mWs7gPziQEehGjHbwllR5E+8hX 6Zg5CCqIk1Ed4oxs3s1+6RZaQFscRROU4gdzOUsdEu3T1tz6QsbnGd0gp2NFPVt5JJug Hy+A== X-Gm-Message-State: AC+VfDzQQ8cNImpyU1cJK1NOYTw0r/xKMy2b8VU18dY6Yxfj75I68Kyq GBxOoeTUIb9H93gYc32yKLxp6A== X-Google-Smtp-Source: ACHHUZ7/MYkTRGCtv6fSgl+ZnFotHIIHiQ1f59049iM/1h58l9sxSgbJ522KwIty36YC8DJQENhuyw== X-Received: by 2002:a17:903:1251:b0:1b0:4527:3716 with SMTP id u17-20020a170903125100b001b045273716mr4905441plh.15.1686220654813; Thu, 08 Jun 2023 03:37:34 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id jj11-20020a170903048b00b001a980a23802sm1128510plb.111.2023.06.08.03.37.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2023 03:37:34 -0700 (PDT) From: Selvin Xavier To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, Kashyap Desai , Selvin Xavier Subject: [PATCH for-next 14/17] RDMA/bnxt_re: cancel all control path command waiters upon error. Date: Thu, 8 Jun 2023 03:25:05 -0700 Message-Id: <1686219908-11181-15-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1686219908-11181-1-git-send-email-selvin.xavier@broadcom.com> References: <1686219908-11181-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 | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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 3461e3b..4f36644 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c @@ -118,7 +118,8 @@ static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie, u8 opcode) /* Non zero means command completed */ ret = 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));