From: John Allen <jallen@linux.vnet.ibm.com>
To: netdev@vger.kernel.org
Cc: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>,
Nathan Fontenot <nfont@linux.vnet.ibm.com>,
Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH net-next] ibmvnic: Fix reset return from closed state
Date: Wed, 14 Mar 2018 10:41:29 -0500 [thread overview]
Message-ID: <d5b220af-d4f7-ec43-a601-28c1d4c0692e@linux.vnet.ibm.com> (raw)
The case in which we handle a reset from the state where the device is
closed seems to be bugged for all types of reset. For most types of reset
we currently exit the reset routine correctly, but don't set the state to
indicate that we are back in the "closed" state. For some specific cases,
we don't exit the reset routine at all and resetting will cause a closed
device to be opened.
This patch fixes the problem by unconditionally checking the reset_state
and correctly setting the adapter state before returning.
Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
---
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 7be4b06..b103a7e 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1714,12 +1714,14 @@ static int do_reset(struct ibmvnic_adapter *adapter,
rc = reset_rx_pools(adapter);
if (rc)
return rc;
-
- if (reset_state == VNIC_CLOSED)
- return 0;
}
}
+ adapter->state = VNIC_CLOSED;
+
+ if (reset_state == VNIC_CLOSED)
+ return 0;
+
rc = __ibmvnic_open(netdev);
if (rc) {
if (list_empty(&adapter->rwi_list))
reply other threads:[~2018-03-14 15:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=d5b220af-d4f7-ec43-a601-28c1d4c0692e@linux.vnet.ibm.com \
--to=jallen@linux.vnet.ibm.com \
--cc=andrew@lunn.ch \
--cc=netdev@vger.kernel.org \
--cc=nfont@linux.vnet.ibm.com \
--cc=tlfalcon@linux.vnet.ibm.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