From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CF6BA0561; Thu, 4 Mar 2021 09:45:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A96B122A2D2; Thu, 4 Mar 2021 09:45:15 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (lpdvacalvio01.broadcom.com [192.19.229.182]) by mails.dpdk.org (Postfix) with ESMTP id 81EBB40F35 for ; Thu, 4 Mar 2021 09:45:14 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id C7C917A51; Thu, 4 Mar 2021 00:45:12 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com C7C917A51 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1614847513; bh=cRbM6uvSenuQHDRFFHJkinInAfvJvt3l5Uju0l1HbJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oTRJkHtlRruwQP8+j8it6ePckmuHrExesnCVQOxnJHUQ2iRxEu2MSJWNCJQ1Wqvik l9Y/sOcMNWE3LSJ0ohrYYXniJJivw+bFTvZZ5th3/aoonbJZTexYse57oENXd5DQiH fuQOxFmYtiQQt6qWVararM6kM/+XbbFnNS1iitAI= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Thu, 4 Mar 2021 14:37:27 +0530 Message-Id: <20210304090728.26166-3-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20210304090728.26166-1-kalesh-anakkur.purayil@broadcom.com> References: <20210304090728.26166-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 2/3] net/bnxt: fix ver get HWRM command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP Fix HWRM_VER_GET command to handle DEV_NOT_RDY state. Driver should fail probe if the device is not ready. Conversely, the HWRM_VER_GET poll after reset can safely retry until the existing timeout is exceeded. Fixes: 804e746c7b73 ("net/bnxt: add hardware resource manager init code") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Randy Schacher Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 02b0a21..5ef0845 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1217,6 +1217,11 @@ int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout) else HWRM_CHECK_RESULT(); + if (resp->flags & HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY) { + rc = -EAGAIN; + goto error; + } + PMD_DRV_LOG(INFO, "%d.%d.%d:%d.%d.%d.%d\n", resp->hwrm_intf_maj_8b, resp->hwrm_intf_min_8b, resp->hwrm_intf_upd_8b, resp->hwrm_fw_maj_8b, @@ -6045,6 +6050,10 @@ int bnxt_hwrm_poll_ver_get(struct bnxt *bp) rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); HWRM_CHECK_RESULT_SILENT(); + + if (resp->flags & HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY) + rc = -EAGAIN; + HWRM_UNLOCK(); return rc; -- 2.10.1