From: Shinas Rasheed <srasheed@marvell.com>
To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <hgani@marvell.com>, <vimleshk@marvell.com>, <egallen@redhat.com>,
<mschmidt@redhat.com>, <pabeni@redhat.com>, <horms@kernel.org>,
<kuba@kernel.org>, <davem@davemloft.net>, <wizhao@redhat.com>,
<konguyen@redhat.com>, Shinas Rasheed <srasheed@marvell.com>,
"Veerasenareddy Burru" <vburru@marvell.com>,
Sathesh Edara <sedara@marvell.com>,
Eric Dumazet <edumazet@google.com>,
Abhijit Ayarekar <aayarekar@marvell.com>,
"Satananda Burla" <sburla@marvell.com>
Subject: [PATCH net v3] octeon_ep: explicitly test for firmware ready value
Date: Thu, 7 Dec 2023 21:56:46 -0800 [thread overview]
Message-ID: <20231208055646.2602363-1-srasheed@marvell.com> (raw)
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 <srasheed@marvell.com>
---
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;
}
--
2.25.1
next reply other threads:[~2023-12-08 5:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 5:56 Shinas Rasheed [this message]
2023-12-10 11:18 ` Simon Horman
2023-12-11 10:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231208055646.2602363-1-srasheed@marvell.com \
--to=srasheed@marvell.com \
--cc=aayarekar@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=egallen@redhat.com \
--cc=hgani@marvell.com \
--cc=horms@kernel.org \
--cc=konguyen@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sburla@marvell.com \
--cc=sedara@marvell.com \
--cc=vburru@marvell.com \
--cc=vimleshk@marvell.com \
--cc=wizhao@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®