Michal Suchanek 4ef983
From d2df919c8fabebc86c2f8962e724fa0dc39a5368 Mon Sep 17 00:00:00 2001
Michal Suchanek 4ef983
From: Tyrel Datwyler <tyreld@linux.ibm.com>
Michal Suchanek 4ef983
Date: Thu, 11 Feb 2021 12:57:41 -0600
Michal Suchanek 4ef983
Subject: [PATCH 3/4] ibmvfc: treat H_CLOSED as success during sub-CRQ
Michal Suchanek 4ef983
 registration
Michal Suchanek 4ef983
Michal Suchanek 4ef983
References: bsc#1182632 ltc#191222
Michal Suchanek 4ef983
Patch-mainline: submitted https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=229197
Michal Suchanek 4ef983
Michal Suchanek 4ef983
A non-zero return code for H_REG_SUB_CRQ is currently treated as a
Michal Suchanek 4ef983
failure resulting in failing sub-CRQ setup. The case of H_CLOSED should
Michal Suchanek 4ef983
not be treated as a failure. This return code translates to a successful
Michal Suchanek 4ef983
sub-CRQ registration by the hypervisor, and is meant to communicate back
Michal Suchanek 4ef983
that there is currently no partner VIOS CRQ connection established as of
Michal Suchanek 4ef983
yet. This is a common occurrence during a disconnect where the client
Michal Suchanek 4ef983
adapter can possibly come back up prior to the partner adapter.
Michal Suchanek 4ef983
Michal Suchanek 4ef983
For non-zero return code from H_REG_SUB_CRQ treat a H_CLOSED as success
Michal Suchanek 4ef983
so that sub-CRQs are successfully setup.
Michal Suchanek 4ef983
Michal Suchanek 4ef983
Fixes: faacf8c5f1d5 ("ibmvfc: add alloc/dealloc routines for SCSI Sub-CRQ Channels")
Michal Suchanek 4ef983
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Michal Suchanek 4ef983
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
Michal Suchanek 4ef983
Acked-by: Michal Suchanek <msuchanek@suse.de>
Michal Suchanek 4ef983
---
Michal Suchanek 4ef983
 drivers/scsi/ibmvscsi/ibmvfc.c | 3 ++-
Michal Suchanek 4ef983
 1 file changed, 2 insertions(+), 1 deletion(-)
Michal Suchanek 4ef983
Michal Suchanek 4ef983
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
Michal Suchanek 4ef983
index 5030e1e974e7..2e6f3524c6c6 100644
Michal Suchanek 4ef983
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
Michal Suchanek 4ef983
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
Michal Suchanek 4ef983
@@ -5638,7 +5638,8 @@ static int ibmvfc_register_scsi_channel(struct ibmvfc_host *vhost,
Michal Suchanek 4ef983
 	rc = h_reg_sub_crq(vdev->unit_address, scrq->msg_token, PAGE_SIZE,
Michal Suchanek 4ef983
 			   &scrq->cookie, &scrq->hw_irq);
Michal Suchanek 4ef983
 
Michal Suchanek 4ef983
-	if (rc) {
Michal Suchanek 4ef983
+	/* H_CLOSED indicates successful register, but no CRQ partner */
Michal Suchanek 4ef983
+	if (rc && rc != H_CLOSED) {
Michal Suchanek 4ef983
 		dev_warn(dev, "Error registering sub-crq: %d\n", rc);
Michal Suchanek 4ef983
 		if (rc == H_PARAMETER)
Michal Suchanek 4ef983
 			dev_warn_once(dev, "Firmware may not support MQ\n");
Michal Suchanek 4ef983
-- 
Michal Suchanek 4ef983
2.26.2
Michal Suchanek 4ef983