From patchwork Fri Dec 8 05:56:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinas Rasheed X-Patchwork-Id: 175600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5263832vqy; Thu, 7 Dec 2023 21:58:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBt/yg5e0rHkFka68dWFlfLehFA6E5smumQqkMpQgykUBouNnwVa6c22WttZT3vkZqJKQb X-Received: by 2002:a17:90a:e612:b0:286:7471:41e4 with SMTP id j18-20020a17090ae61200b00286747141e4mr525021pjy.0.1702015081496; Thu, 07 Dec 2023 21:58:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702015081; cv=none; d=google.com; s=arc-20160816; b=DmQDCs98KRqm1uiD5GpUzhVKAEaqLC9T6fTQNOlYf8Qy4pcGBopY9EqDHGa1mP3x8Q tKrApQ5cZ6O9lVQBlgO5kA1p2u5UExq5TzN2Chp/iwPgj5UB77Lk40QFSJFTnZiIz8cT NuYSwZGbKbqqk4NXyF6LpQ9JnhQjjCt5Et5wYhqN9DarQG65v/qexZqnlu9OCu7NRVmw 02Ta1LwBYpvHphBB6mEvxDq59z73Z/eXy0DVvidmY3E6kh0uXXMNOo5NzjLKSbtH+60w gJY1Y3Se0DWpQoNBXk5Qy4QZAS3yEKOwid3d/mMLlI5BZ7ukf24MlhXkAg0C2GNH1JTI +w7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HEQnHUIqnjI0rxLDWe/wA9HwPEdz9nqzT9bUL9LwXow=; fh=i1DgICAwQFEjLOp0MV20/A09no61tqe7QehK1VN1Y8U=; b=xiiur9WUpTwBjHRENkatCybEO6429QycSQ+KJMsNTx1/b47swYAqNFxkVqx8E8k1wm 38Xzgq17Uiom0x90PgWcBj10lO30HHX7TNvIiS4s963P9gcVjQ5IlAz5g8Y9KWZAi+xK vbz+mPC8dZiH1eQcK1h4ZLWjnL+IT/kqwPO+Djsn8arJUTwvu5f6+MsrFQ5oXzI/UTuF pglvwrtDLnOE3nllHCRE/Adt0se6KrDYFz9Zp35BJ8BG1DVjC/qqYhGJ8DM8kOUmruHX EgJkvwRwY59UHpzHTP3tg9FheO2xm1NvAzS9o24Eaau/hWt9DyR15rVujD/PalK4BSS1 QrMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=ZoAVrR6X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id c23-20020a17090abf1700b00286b5ae24e3si2351544pjs.114.2023.12.07.21.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 21:58:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=ZoAVrR6X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5FA2580AC446; Thu, 7 Dec 2023 21:57:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573222AbjLHF5r (ORCPT + 99 others); Fri, 8 Dec 2023 00:57:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233276AbjLHF52 (ORCPT ); Fri, 8 Dec 2023 00:57:28 -0500 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D59D19A2; Thu, 7 Dec 2023 21:57:03 -0800 (PST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B81CqNC028994; Thu, 7 Dec 2023 21:56:56 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=HEQnHUIqnjI0rxLDWe/wA9HwPEdz9nqzT9bUL9LwXow=; b=ZoAVrR6XhBhqwm3jZsjRCUX1EwrmtYbO3Jeam3qDhwrQy98Uw3BDTpX68yD6IRrR1Y6b ZKVMUKJhC9UyFjTXbH6xkqndNnfJIIyC5oUF/AkJ6/418qDFOQK5uth7GDSOQTx/OTC4 llhbGZTf/ndsMCpYRh+p01JtniX3eu8kAaC622fwzzW3+CuVD6erGoOoGs+yP7Zm8CAR d7cUE2heN3K87/OmrEIM4sEprbAa81ZlxKBB8iXlsF4e1CpbSfnyUdgUjkkgfxV1kI2l tyB19MrPfCqn9MU+AhCytGDUw2Zn1lAmDlKjT+zbhv1uQta3vBIGf9Zm8ulcgxjGNwtF MQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uubddbuhe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Dec 2023 21:56:55 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 7 Dec 2023 21:56:53 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 7 Dec 2023 21:56:53 -0800 Received: from ubuntu-PowerEdge-T110-II.sclab.marvell.com (unknown [10.106.27.86]) by maili.marvell.com (Postfix) with ESMTP id 573F63F7050; Thu, 7 Dec 2023 21:56:53 -0800 (PST) From: Shinas Rasheed To: , CC: , , , , , , , , , , Shinas Rasheed , "Veerasenareddy Burru" , Sathesh Edara , Eric Dumazet , Abhijit Ayarekar , "Satananda Burla" Subject: [PATCH net v3] octeon_ep: explicitly test for firmware ready value Date: Thu, 7 Dec 2023 21:56:46 -0800 Message-ID: <20231208055646.2602363-1-srasheed@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: ok7DybbzTglDBUek9-Dr2b8mjc3niAau X-Proofpoint-GUID: ok7DybbzTglDBUek9-Dr2b8mjc3niAau X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-08_02,2023-12-07_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 21:57:57 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784692165819840710 X-GMAIL-MSGID: 1784692165819840710 The firmware ready value is 1, and get firmware ready status function should explicitly test for that value. The firmware ready value read will be 2 after driver load, and on unbind till firmware rewrites the firmware ready back to 0, the value seen by driver will be 2, which should be regarded as not ready. Fixes: 10c073e40469 ("octeon_ep: defer probe if firmware not ready") Signed-off-by: Shinas Rasheed Reviewed-by: Simon Horman --- V3: - Removed unnecessary parenthesis around boolean return. V2: https://lore.kernel.org/all/20231207074936.2597889-1-srasheed@marvell.com/ - Fixed redundant logic V1: https://lore.kernel.org/all/20231206063549.2590305-1-srasheed@marvell.com/ drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c index 552970c7dec0..b8ae269f6f97 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c @@ -1258,7 +1258,8 @@ static bool get_fw_ready_status(struct pci_dev *pdev) pci_read_config_byte(pdev, (pos + 8), &status); dev_info(&pdev->dev, "Firmware ready status = %u\n", status); - return status; +#define FW_STATUS_READY 1ULL + return status == FW_STATUS_READY; } return false; }