Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp209632pxu; Wed, 25 Nov 2020 17:51:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRHB3LB+Wpr8CXrTeocW3LcdfNagDfd6p+OfSTSuquzfSOb7JrRWmibwaQ9vQ+Z8xZUhyn X-Received: by 2002:aa7:d717:: with SMTP id t23mr451736edq.286.1606355492136; Wed, 25 Nov 2020 17:51:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606355492; cv=none; d=google.com; s=arc-20160816; b=DpDDKsaK/nU1aH8D50RG1vA/aTtI9T9RVr+36FSu+212Z3tcNSWFUZTH0W2iNkobz8 nZtb+KcH3ORhIdZKM9amAAIZWyPzNlSBAD0wSvcBqI7eQQucj1lwIyZOeF7ob1Xf6XcK YhX1tPOUTjf3a8NsMQ/DrvZzGbYS3vAgQIBb+3/wifkPf0ZfnWeGO9XdpJu1ycAEMzvB 5vTjEs9ZDuC0XSMvy5fuso8zd3T3vhAmyE6mpY8tgKyUDIhIAFO9W2ArxrcuGmMhTiMm W8nUarFIWZdiouLt3wEanCbQ++R08xHAyidIMWBW4cd3lorMDOCSj5CpzOdxzw/y/8kg GNHg== 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=+riWgeXyh3cyuXjhvDZjAteH+npxy0F0qRQx/ifLUrw=; b=mGXV52mWF2VW62+4elNmv2VmIeMQvN6VatHoDXfjn+34/f1+z6Y7uVYO53QnByRqTq 0F8aj7JXySLO/+OD+QwRF81NOnV84KXQBHlWYO7GeOCb/JNNsaQIkeFBo9S/40qpOtpd IjyZDDgxqyZ0ro8KTknfR7vqRUj22Oru0GPHO4vtA3pCVFnAX0OuVswOXB39zGi1TPSf Y9OdYQCa7PUizWZZ464OxyxMyK4DxR0ds/on3SleNk1XbSibuuddoRiB4jvG6sRktFAq ZQRJLVEe7Cq0SmZ8oTRLTXWLEcXwUYVwjypOWWoOG0prd/mEDZ1B1C4aARP2ejLk0XXM PalA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=hycgn9S7; 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 d7si2234615ejk.78.2020.11.25.17.51.10; Wed, 25 Nov 2020 17:51:32 -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=hycgn9S7; 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 S1732317AbgKZBsp (ORCPT + 99 others); Wed, 25 Nov 2020 20:48:45 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57936 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731649AbgKZBsm (ORCPT ); Wed, 25 Nov 2020 20:48:42 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AQ1VGCj003569; Wed, 25 Nov 2020 20:48:35 -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=+riWgeXyh3cyuXjhvDZjAteH+npxy0F0qRQx/ifLUrw=; b=hycgn9S76vaaOqZNFmBMKx0WVM2j/BNd6x7BUfz7DqS1veYinA0Qv3MAXxVRaV+MnWhP giDLl4KXvJe+TtCqAILrIY7g6disc9mP+RV4eHU431gmNTGfBIX6NlfiZQeEHhHlUvmq ++cPsxtIfSHIxp3+TkDgwSR8/ut5mqrx1HcwikM9KoQ1qFSOunaSGSmxI/f59aa1l4Cd GZ+myG1M7s2BVJUmLhFtph6VQSjgBJKxtSA2IT1uQfmzlqLpEggC69ha/TKesRlJF/8l JLvCatV85wnMRLl2gyv8bWS2+X9dsEu9m+VY06Vn88ijNqOubWoNj1dSNAw3YFgxZcaH AQ== Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 3522q40aqa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Nov 2020 20:48:35 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0AQ1lcGu008424; Thu, 26 Nov 2020 01:48:34 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma01dal.us.ibm.com with ESMTP id 34xth9n0tp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Nov 2020 01:48:34 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0AQ1mQoL38535512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Nov 2020 01:48:26 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB32A6E053; Thu, 26 Nov 2020 01:48:32 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72F936E04E; Thu, 26 Nov 2020 01:48:32 +0000 (GMT) Received: from vios4361.aus.stglabs.ibm.com (unknown [9.3.43.61]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 26 Nov 2020 01:48:32 +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 08/13] ibmvfc: map/request irq and register Sub-CRQ interrupt handler Date: Wed, 25 Nov 2020 19:48:19 -0600 Message-Id: <20201126014824.123831-9-tyreld@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201126014824.123831-1-tyreld@linux.ibm.com> References: <20201126014824.123831-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.312,18.0.737 definitions=2020-11-25_14:2020-11-25,2020-11-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 mlxscore=0 malwarescore=0 phishscore=0 mlxlogscore=993 bulkscore=0 impostorscore=0 priorityscore=1501 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011260001 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Create an irq mapping for the hw_irq number provided from phyp firmware. Request an irq assigned our Sub-CRQ interrupt handler. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 4fb782fa2c66..53db6da20923 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -5119,12 +5119,34 @@ static int ibmvfc_register_scsi_channel(struct ibmvfc_host *vhost, goto reg_failed; } + scrq->irq = irq_create_mapping(NULL, scrq->hw_irq); + + if (!scrq->irq) { + rc = -EINVAL; + dev_err(dev, "Error mapping sub-crq[%d] irq\n", index); + goto irq_failed; + } + + snprintf(scrq->name, sizeof(scrq->name), "ibmvfc-%x-scsi%d", + vdev->unit_address, index); + rc = request_irq(scrq->irq, ibmvfc_interrupt_scsi, 0, scrq->name, scrq); + + if (rc) { + dev_err(dev, "Couldn't register sub-crq[%d] irq\n", index); + irq_dispose_mapping(scrq->irq); + goto irq_failed; + } + scrq->hwq_id = index; scrq->vhost = vhost; LEAVE; return 0; +irq_failed: + do { + plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq->cookie); + } while (rc == H_BUSY || H_IS_LONG_BUSY(rc)); reg_failed: dma_unmap_single(dev, scrq->msg_token, PAGE_SIZE, DMA_BIDIRECTIONAL); dma_map_failed: -- 2.27.0