From: Stefan Wahren <stefan.wahren@i2se.com>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Stefan Wahren <stefan.wahren@i2se.com>
Subject: [PATCH 1/3 net-next] net: qca_spi: Avoid reading signature three times in a row
Date: Sat, 8 May 2021 14:36:33 +0200 [thread overview]
Message-ID: <1620477395-12740-2-git-send-email-stefan.wahren@i2se.com> (raw)
In-Reply-To: <1620477395-12740-1-git-send-email-stefan.wahren@i2se.com>
There is no need to read the signature three times. So bail out
in case the second check failed.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
drivers/net/ethernet/qualcomm/qca_spi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index ab9b025..3e2a54c 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -506,6 +506,7 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event)
if (signature != QCASPI_GOOD_SIGNATURE) {
qca->sync = QCASPI_SYNC_UNKNOWN;
netdev_dbg(qca->net_dev, "sync: got CPU on, but signature was invalid, restart\n");
+ return;
} else {
/* ensure that the WRBUF is empty */
qcaspi_read_register(qca, SPI_REG_WRBUF_SPC_AVA,
--
2.7.4
next prev parent reply other threads:[~2021-05-08 12:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-08 12:36 [PATCH 0/3 net-next] net: qca_spi: Improve sync handling Stefan Wahren
2021-05-08 12:36 ` Stefan Wahren [this message]
2021-05-08 12:36 ` [PATCH 2/3 net-next] net: qca_spi: Avoid re-sync for single signature error Stefan Wahren
2021-05-08 12:36 ` [PATCH 3/3 net-next] net: qca_spi: Introduce stat about bad signature Stefan Wahren
2021-05-10 21:40 ` [PATCH 0/3 net-next] net: qca_spi: Improve sync handling 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=1620477395-12740-2-git-send-email-stefan.wahren@i2se.com \
--to=stefan.wahren@i2se.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).