Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp486474pxu; Tue, 1 Dec 2020 16:58:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwN+VgGI8aS4m4cxlFtnx/hH6NZ+8P9cbeAOldBshuQJ8YDFl/sa13DDjaWVbDc7B0x2z/N X-Received: by 2002:aa7:dbca:: with SMTP id v10mr262218edt.219.1606870727979; Tue, 01 Dec 2020 16:58:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606870727; cv=none; d=google.com; s=arc-20160816; b=gR6KWul5xZb79JYywsPfYN8TNQfYSi+anl/AP9lICx2pSfh2G4MY/00Zc6RwDAjOHa BZSiZObjw06VC7GbVCZ9fhfRhvCqpJ3w8Na2Y25cijD7Wn6DO7w0gAQTQkfJoSO2JQC4 /3uf6TQrXoR9afP19DMmc2ZLfA+1sr15H2K8THdZaflhirHDmwrT3FvCyDyrFLcxuBn7 fBiDjvMwvkdPTJNZYTZ6Pwcr3Htf4c5/8HAxo86OoRTWRiNAYlyh401B4M4wX/8/VSQv MECai6Rq+D7wruoFu+ny0xLo6TfX1FrQUPlnU1W/yPzVBQEgM8lXnR3c0ahat3B7aMES zXfQ== 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=u2xYXWvqOEeTwsdRseMpEIlPH49x6TjgdRhxhTmGPI4=; b=zVV0L+9zsYB6KvFbtxG8cqjjs08LLigTXmQKnzE+8ciniMmn7m1HjaV27ffyXNzqXa 9JeNDK/EBVvqF8i3LhO/f5YqzmXQY0yZKxX3nmLcFKcVM75F1l10n8AZobFPvHbvOfCb WvI3ei/Iq4uoxgxP4vQZurPD9oubropXXSuRCvQjCRlm/c7je2Tj3xWYUk5+/e9PAATU 9ngQUEIDf881PrOTL8X1/JSYrjlvvJpwyG1KvuLJ0xUm17mX3O8eYjxGo06r3EKLE2V9 bjnfjYsofH+hj1EJJRTLxdHf6Vr3vuVxLiQj4OtqFWp/BORapo3u9d0DIc+DfBIN358k 0KZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=EIf38CPN; 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 c11si78582edw.311.2020.12.01.16.58.25; Tue, 01 Dec 2020 16:58:47 -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=EIf38CPN; 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 S1727714AbgLBAyc (ORCPT + 99 others); Tue, 1 Dec 2020 19:54:32 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:52150 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727621AbgLBAy3 (ORCPT ); Tue, 1 Dec 2020 19:54:29 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B20WsRo021990; Tue, 1 Dec 2020 19:53:38 -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=u2xYXWvqOEeTwsdRseMpEIlPH49x6TjgdRhxhTmGPI4=; b=EIf38CPN/Bb1Aj3+hLKEvj+x2jasQ1SXByEfotXjr/edjb6gzFl6TUT7/8aZHps1djBk 7gqM0Ec5bp1Tpwh3m+VIkf3GfG1cA64SqNLaHFFoRCtkqkfyqC6joWLMjq7euNlPT5WZ G7EJo/el3vAPEM6cjXONz+BSxzPvsrT7/PW2T2SBTbuUfy3I/hvF0S/BNvtrlgY738jW 9CnOCEw2GC4rVkWuiP9xRIcZ9Y7WIdF/Qkb6sl7q9AuVhPlWayUNYJI5RkyB71F8m/LX FVuEBQG5CznQIY0O2kLWqvygBCWzfZJNQmvugnbbQLS3ZkzFyXZTHABkG+LQPAEvRaaT 8g== 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 355jjp4c33-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Dec 2020 19:53:38 -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 0B20bNRb013472; Wed, 2 Dec 2020 00:53:37 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 353e69ume8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2020 00:53:37 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0B20rZmS51773940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Dec 2020 00:53:35 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77AC17805C; Wed, 2 Dec 2020 00:53:35 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 121017805F; Wed, 2 Dec 2020 00:53:35 +0000 (GMT) Received: from vios4361.aus.stglabs.ibm.com (unknown [9.3.43.61]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 2 Dec 2020 00:53:34 +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 , Brian King Subject: [PATCH v2 08/17] ibmvfc: map/request irq and register Sub-CRQ interrupt handler Date: Tue, 1 Dec 2020 18:53:20 -0600 Message-Id: <20201202005329.4538-9-tyreld@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201202005329.4538-1-tyreld@linux.ibm.com> References: <20201202005329.4538-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-12-01_12:2020-11-30,2020-12-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=3 spamscore=0 bulkscore=0 adultscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 mlxlogscore=999 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012020000 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 Reviewed-by: Brian King --- 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 a3e2d627c1ac..0336833a6950 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -5130,12 +5130,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