]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit2f7c470e75e83a3d5749d99178d1b5382d849072
treec3cf184baf8d631e76eb0dc34398db5bb766fc37
parent9f14bddcccb9c30714c1b253b1663d1d75c57d2c
ibmvnic: init init_done_rc earlier

[ Upstream commit 8859399c650546c3aa795056575329ff3cdb997a ]

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: ea6726eed812 ("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