All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ibmvnic: Set to CLOSED state even on error
@ 2021-02-11  1:41 Sukadev Bhattiprolu
  2021-02-11 22:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Sukadev Bhattiprolu @ 2021-02-11  1:41 UTC (permalink / raw)
  To: netdev; +Cc: Dany Madden, Lijun Pan, Rick Lindsley, abdhalee, sukadev

If set_link_state() fails for any reason, we still cleanup the adapter
state and cannot recover from a partial close anyway. So set the adapter
to CLOSED state. That way if a new soft/hard reset is processed, the
adapter will remain in the CLOSED state until the next ibmvnic_open().

Fixes: 01d9bd792d16 ("ibmvnic: Reorganize device close")
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Reported-by: Abdul Haleem <abdhalee@in.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 96c2b0985484..ce6b1cb0b0f9 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1367,10 +1367,8 @@ static int __ibmvnic_close(struct net_device *netdev)
 
 	adapter->state = VNIC_CLOSING;
 	rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_DN);
-	if (rc)
-		return rc;
 	adapter->state = VNIC_CLOSED;
-	return 0;
+	return rc;
 }
 
 static int ibmvnic_close(struct net_device *netdev)
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] ibmvnic: Set to CLOSED state even on error
  2021-02-11  1:41 [PATCH 1/1] ibmvnic: Set to CLOSED state even on error Sukadev Bhattiprolu
@ 2021-02-11 22:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-11 22:40 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: netdev, drt, ljp, ricklind, abdhalee

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 10 Feb 2021 17:41:43 -0800 you wrote:
> If set_link_state() fails for any reason, we still cleanup the adapter
> state and cannot recover from a partial close anyway. So set the adapter
> to CLOSED state. That way if a new soft/hard reset is processed, the
> adapter will remain in the CLOSED state until the next ibmvnic_open().
> 
> Fixes: 01d9bd792d16 ("ibmvnic: Reorganize device close")
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
> Reported-by: Abdul Haleem <abdhalee@in.ibm.com>
> 
> [...]

Here is the summary with links:
  - [1/1] ibmvnic: Set to CLOSED state even on error
    https://git.kernel.org/netdev/net/c/d4083d3c00f6

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-11 22:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11  1:41 [PATCH 1/1] ibmvnic: Set to CLOSED state even on error Sukadev Bhattiprolu
2021-02-11 22:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.