ibmvnic: init init_done_rc earlier
authorSukadev Bhattiprolu <sukadev@linux.ibm.com>
Fri, 25 Feb 2022 06:23:56 +0000 (22:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jul 2022 14:34:56 +0000 (16:34 +0200)
commit4fe1439ef2e0ff762baf9d5af547cdc1c76bcdea
treec3cf184baf8d631e76eb0dc34398db5bb766fc37
parenta29c71f3a4b17ce49feacc6e610e953ef70d7dfc
ibmvnic: init init_done_rc earlier

[ Upstream commit ae16bf15374d8b055e040ac6f3f1147ab1c9bb7d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/ibm/ibmvnic.c