ibmvnic: init init_done_rc earlier
authorSukadev Bhattiprolu <sukadev@linux.ibm.com>
Fri, 25 Feb 2022 06:23:56 +0000 (22:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Feb 2022 10:57:47 +0000 (10:57 +0000)
commitae16bf15374d8b055e040ac6f3f1147ab1c9bb7d
treeff8e4ffa2a78fcf66f828e321003c42b3d07c7a1
parent570425f8c7c18b14fa8a2a58a0adb431968ad118
ibmvnic: init init_done_rc earlier

We currently initialize the ->init_done completion/return code fields
before issuing a CRQ_INIT command. But if we get a transport event soon
after registering the CRQ the taskslet may already have recorded the
completion and error code. If we initialize here, we might overwrite/
lose that and end up issuing the CRQ_INIT only to timeout later.

If that timeout happens during probe, we will leave the adapter in the
DOWN state rather than retrying to register/init the CRQ.

Initialize the completion before registering the CRQ so we don't lose
the notification.

Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol")
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c