Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp703943pxb; Thu, 25 Feb 2021 12:54:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+0YEGtSWkVKGIG7mUil/6M9a7HvvZ/NBnte18E6C8r4ZdG7Vh2MCIBvLTQxowZ3W/+cRi X-Received: by 2002:a17:906:15cc:: with SMTP id l12mr4602692ejd.280.1614286467183; Thu, 25 Feb 2021 12:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614286467; cv=none; d=google.com; s=arc-20160816; b=FX+t0aCIjusj0jswm17GK6VbQpkSs3MFIWm3JBgMPqe+dzY8qTwm6PCUhuIHlBjhCj LUFMiQ42nxlBCiNlG2SaBrcmiwpUhyRL+vHGVhLDU2VOApK6TertYNowBEj31FA57uLa 5Epwtvb+Xgk4YO2nriLEEQw5CjJ3PF3ahSN5m+ErB5IM5K9uLPE+Rnbnga3JrevSuzyW DwqujHoJjjPbKEEyNDHZCUhhj3CU/huKfjijeqZQ3xRB+KI3cCLAGOyo4eL12H7h61Y9 MMKMENvvqeL01bxOtwOgq3LKFHlbQRp1OmVYafwec1g2HeUDT34oU5G/xQN1b32iA0K7 E/qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rHXyDtHziGzaUQkCoKSeHk0dhXhxFPrOV3Zw+wNZyc0=; b=XfSNPTImr0o0mad9w39iV/hN7Qmn2hley/7S+9At15kmqMkxbq5AmxBK2vq6XzYAv/ 5K3fLMn3BhRvnrD5y3Y0vaAuZI0Xce2JULbAIujAjPKJiL5BrIEINmEGz2dl+O7cgN6o WA4NTIhQGJaUw60gBzpyB8qcBFxkdlbSwujES200c+s9mw4vv43saeZ3uHRnyrVmPx5T 12/1mCcpcZZcCHmwR0fxcMHNcTe5wt2l3GuV0ILVw/VnI1mhy1iRKLR5hj6CQL/zD19u E5lFeyACpSJU3WnQCtP2ZKpAMMvXHxETMOYWRVZ9eXFNsASFTke2+Zn6BUYlq2uKfmkh HpCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=pOW8XAtz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si4128734ejn.116.2021.02.25.12.54.03; Thu, 25 Feb 2021 12:54:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=pOW8XAtz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233956AbhBYUto (ORCPT + 99 others); Thu, 25 Feb 2021 15:49:44 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39896 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233637AbhBYUtQ (ORCPT ); Thu, 25 Feb 2021 15:49:16 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11PKYqB3088524; Thu, 25 Feb 2021 15:48:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=rHXyDtHziGzaUQkCoKSeHk0dhXhxFPrOV3Zw+wNZyc0=; b=pOW8XAtzGoyzLTnKDqc9N/+o8tbdOpOQvXF14k4M8bcJUvvbUPWlggmjWuWGjZrNwYgw sDnlvefp2FJHSFU5h6dzCATR2TPCC64DZHTM98KhkPPW518WCl7eXtupl9LlDIdwkbxX Htj2pUJvyYF6irBgHLdWgBhBj6yP/jja8M+iEOAOlEheNMfJrvtOCVVeq93V+KGXrp33 z/fE8+6tRWHXy1apDCPj+qwTqAPORJBZKw0drHbuiaMbMQwrY7i/sKi6e/CvfCFJmKri Vterd8It7P2eRiadsNTHp75FHqcddoglyLgK0wsevi/uJVzszVJg2TVuVQVe9iZ5eRC+ Gw== Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 36xjs0rtj6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 15:48:31 -0500 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 11PKkwIL029463; Thu, 25 Feb 2021 20:48:30 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma02dal.us.ibm.com with ESMTP id 36tt2akwck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 20:48:30 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11PKmSHq26280332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Feb 2021 20:48:28 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B1A1D6E050; Thu, 25 Feb 2021 20:48:28 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6503A6E054; Thu, 25 Feb 2021 20:48:28 +0000 (GMT) Received: from vios4361.aus.stglabs.ibm.com (unknown [9.3.43.61]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 25 Feb 2021 20:48:28 +0000 (GMT) From: Tyrel Datwyler To: james.bottomley@hansenpartnership.com Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, brking@linux.ibm.com, Tyrel Datwyler Subject: [PATCH v2 5/5] ibmvfc: reinitialize sub-CRQs and perform channel enquiry after LPM Date: Thu, 25 Feb 2021 14:48:24 -0600 Message-Id: <20210225204824.14570-6-tyreld@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210225204824.14570-1-tyreld@linux.ibm.com> References: <20210225204824.14570-1-tyreld@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-02-25_11:2021-02-24,2021-02-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 adultscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102250158 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A live partition migration (LPM) results in a CRQ disconnect similar to a hard reset. In this LPM case the hypervisor moslty perserves the CRQ transport such that it simply needs to be reenabled. However, the capabilities may have changed such as fewer channels, or no channels at all. Further, its possible that there may be sub-CRQ support, but no channel support. The CRQ reenable path currently doesn't take any of this into consideration. For simpilicty release and reinitialize sub-CRQs during reenable, and set do_enquiry and using_channels with the appropriate values to trigger channel renegotiation. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 4ac2c442e1e2..9ae6be56e375 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -903,6 +903,9 @@ static int ibmvfc_reenable_crq_queue(struct ibmvfc_host *vhost) { int rc = 0; struct vio_dev *vdev = to_vio_dev(vhost->dev); + unsigned long flags; + + ibmvfc_release_sub_crqs(vhost); /* Re-enable the CRQ */ do { @@ -914,6 +917,16 @@ static int ibmvfc_reenable_crq_queue(struct ibmvfc_host *vhost) if (rc) dev_err(vhost->dev, "Error enabling adapter (rc=%d)\n", rc); + spin_lock_irqsave(vhost->host->host_lock, flags); + spin_lock(vhost->crq.q_lock); + vhost->do_enquiry = 1; + vhost->using_channels = 0; + + ibmvfc_init_sub_crqs(vhost); + + spin_unlock(vhost->crq.q_lock); + spin_unlock_irqrestore(vhost->host->host_lock, flags); + return rc; } -- 2.27.0