Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1489534rdb; Wed, 6 Dec 2023 23:50:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVycfv1LxZkzOi2fhY8gAvtaRFU06e6F2SWhd7Pv4rgppREJcrflP3KbON9OU51Zqiy7rI X-Received: by 2002:a05:6870:3326:b0:1fb:21ed:83ca with SMTP id x38-20020a056870332600b001fb21ed83camr1960674oae.55.1701935408244; Wed, 06 Dec 2023 23:50:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701935408; cv=none; d=google.com; s=arc-20160816; b=VDNxf2dkPe+X3CNLx+kD2XeIA3264E14EtbTwpNOqyH3OrJw3s22sxhKOewrj+gqpQ NNoSEM/200IaHpqjSz4tvnWoZpkSCy8S3RX8JjDqo0wEdSjQ08Z5HZQnqefh160e1HUp C+Y0zcHl+LhDoidClmxBjjZnonwL5fx8brL4uE+C6RzuT9RY4BA9H8nbA4KIqlX1cHTF xNRxhnwyQOIiI/+0A8HC8eZzvy0ormVQkbhoDSrZrgs2ZSpdEP8eQhJxbGgGlQOihTDv IE7eE/gGRwm4WrXKuX77uyCUTpjJbM7QdIxyZOZhB8YOiiHgS0kb+Utu5H2dlVIhGKvv kA7Q== 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=IMsCjRPKHSS3qe8aDrsdKaGB8Jnu3d6HBJjxEXEh3zQ=; fh=i1DgICAwQFEjLOp0MV20/A09no61tqe7QehK1VN1Y8U=; b=b9vzDAHkB456Fx9SFwh4Kcf+aDm9Do53UXdIhG1Ma5GrwqofD9SDGkfyCNyxXL8H5z xb7gk3GZLR0bzeNoST3OI6IXgUVJH6jMqAJZHVmH/RI+bjwtAdejZ/6ucxtSTJQHk3js txqGL3W9Pqfh8kXWXISkEO1fbJG+ZQmTBMQqS7go2D0cN5bReW2h7/F1/qomI21G3L1l GJLE2rGpjfF5dK7NrxKoUsdqTrT4LzfCtgB+8ndQ/JJnbptiIrKd79mu93lRc14yuUf+ PO7MyuiA/7E4igujPfQkpEPOzHGUgM9IA0dYKok0Df1rnVGVA1nPYORbx14avvkoTHI7 yfdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=OMcMEIdZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id o14-20020a63e34e000000b005bd66bfc253si766664pgj.148.2023.12.06.23.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 23:50:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=OMcMEIdZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id AE1B8832A053; Wed, 6 Dec 2023 23:50:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378044AbjLGHtw (ORCPT + 99 others); Thu, 7 Dec 2023 02:49:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377955AbjLGHtv (ORCPT ); Thu, 7 Dec 2023 02:49:51 -0500 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8B6A10D; Wed, 6 Dec 2023 23:49:57 -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 3B6JIedq026191; Wed, 6 Dec 2023 23:49:45 -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=IMsCjRPKHSS3qe8aDrsdKaGB8Jnu3d6HBJjxEXEh3zQ=; b=OMcMEIdZrzN443HVzCb2oL7rlSBAac/m6XzIaMGgB2U2Wa9XHjSNCZ2Sv5elIL0g4PWg 6ngsV+1BE9ENGPwuJ9HGmYLxpKxnYDHMAaSWWTGg9l21l6KMnQev2YAsooM65+wxskR7 a+E3UWj1NqxHAS4zqfujc+W0vVlsdrlXCFBlew3K6uUpnawA/nTZg09/vtssPCMXaye0 7M4mohfxJznYMm+qJNEMdLd7A+V/ZaBS2sFeT6oIQMPu3YIjyvGO+HSp0ZY40mCUk6zl GTnMTXxQHAgwU1cyQcMqmPymCKqN9q+BiMiAenn1Ribmph46GWRpzqsG/OCKckmI+0hu LA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uty0jj5g6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 06 Dec 2023 23:49:44 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 6 Dec 2023 23:49:39 -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; Wed, 6 Dec 2023 23:49:38 -0800 Received: from ubuntu-PowerEdge-T110-II.sclab.marvell.com (unknown [10.106.27.86]) by maili.marvell.com (Postfix) with ESMTP id 6CBC43F70AA; Wed, 6 Dec 2023 23:49:38 -0800 (PST) From: Shinas Rasheed To: , CC: , , , , , , , , , , Shinas Rasheed , "Veerasenareddy Burru" , Sathesh Edara , Eric Dumazet , Abhijit Ayarekar , "Satananda Burla" Subject: [PATCH net v2] octeon_ep: explicitly test for firmware ready value Date: Wed, 6 Dec 2023 23:49:36 -0800 Message-ID: <20231207074936.2597889-1-srasheed@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: 1kHbwibEP1979Fc0s6JeMBLX0u551Upm X-Proofpoint-ORIG-GUID: 1kHbwibEP1979Fc0s6JeMBLX0u551Upm 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-07_05,2023-12-06_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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 06 Dec 2023 23:50:05 -0800 (PST) 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 --- V2: - 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; } -- 2.25.1