scsi: ibmvfc: Fix invalid sub-CRQ handles after hard reset
authorTyrel Datwyler <tyreld@linux.ibm.com>
Tue, 2 Mar 2021 23:05:40 +0000 (17:05 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Mar 2021 22:21:07 +0000 (17:21 -0500)
commit5cf529649be20dc27500c1141d58ba57131e2530
tree17973af9ab12379af5fce0a234e4cdf183040236
parent443cc4b45c1be0b25313c9a507b033074334b490
scsi: ibmvfc: Fix invalid sub-CRQ handles after hard reset

A hard reset results in a complete transport disconnect such that the CRQ
connection with the partner VIOS is broken. This has the side effect of
also invalidating the associated sub-CRQs. The current code assumes that
the sub-CRQs are perserved resulting in a protocol violation after trying
to reconnect them with the VIOS. This introduces an infinite loop such that
the VIOS forces a disconnect after each subsequent attempt to re-register
with invalid handles.

Avoid the aforementioned issue by releasing the sub-CRQs prior to CRQ
disconnect, and driving a reinitialization of the sub-CRQs once a new CRQ
is registered with the hypervisor.

Link: https://lore.kernel.org/r/20210302230543.9905-3-tyreld@linux.ibm.com
Fixes: 3034ebe26389 ("scsi: ibmvfc: Add alloc/dealloc routines for SCSI Sub-CRQ Channels")
Reviewed-by: Brian King <brking@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ibmvscsi/ibmvfc.c