Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3418643pxb; Tue, 12 Jan 2021 14:18:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJUTUlP0NzzlC6nBe+OfJLAmVGiNkRKI92dTIsmNbuXq+BSFgx2rkaogWsqtHAOSQ9+ez4 X-Received: by 2002:a17:906:518a:: with SMTP id y10mr662648ejk.323.1610489904782; Tue, 12 Jan 2021 14:18:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610489904; cv=none; d=google.com; s=arc-20160816; b=GAcvgeY7zhoJuJWRpIhrk8CYcR8cvIw81o9tuAozQEOx8dwKVghY5Vp3M4G5cqQczk ijInaT7qWLAlVQDP77Ar0hXX9+pB5QdFh0JdUT5U3BTRafjH/rP52tBR1jXyYXu7/kSC HbfMKCjSV5/b71pIoFwEMQc5iufnEJWzuaS4+SOQ7+7c0l2t4lwGPNWq7B3pZL/IffdY 3ujhH+ZH0TUdPcLwY4Vz6PKQTCxy9gmyLOPh1vXgG3zT7hzI0Vw/Oa5yBXtkc/WFo0ly VQyZzPbSRMGZTDWmnFaBXzVLkxDJDbAcJRgDkBcjc38El8bgkolI1dVSLDlTn5YhYzg8 WYgw== 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=hZeV9JzufbxYww9v6JS4tA3P/nR0IZfx3kmIVf3DC8U=; b=sqZY0wOujs70vjYqwtITXSiXwWphVK/LSoegcZCblB9nS6I+Bi5tLU5i/sNCtUpcOe pr1EzH2yTXw2tXNWfDOqfnaktu8rtwfAC+ca0a297FUJpTVS8SrKhbd/rRIz2U6hirN/ CI0JrjMffqrvUoEhhiz1He/iDva7/XA+O/LJbNTgdIhGWrZAt7Dk4jV0H0YywHZ6gSSY MWuRleGSygnQegn6AXkN0ywt5ay7Url8R69LIrbWMyZIXeIDz6yEI0zpYe74+egN5qrZ XD5pWFSMDoQzbE0vWxFkEpvDcuAi0ly6lZVg+pmt1oFMOweBxDHgWPFCxKl13GkiRfLq y3RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=VG7ab5Uo; 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 j24si36627ejs.60.2021.01.12.14.18.01; Tue, 12 Jan 2021 14:18:24 -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=VG7ab5Uo; 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 S2404674AbhALAY6 (ORCPT + 99 others); Mon, 11 Jan 2021 19:24:58 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40414 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403937AbhAKXOn (ORCPT ); Mon, 11 Jan 2021 18:14:43 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 10BN1fA7094032; Mon, 11 Jan 2021 18:12:37 -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=hZeV9JzufbxYww9v6JS4tA3P/nR0IZfx3kmIVf3DC8U=; b=VG7ab5UoE+/4X3JX3wTBQQ9+8yiSJOF8x5fPEPsd/A5u/hTKq0NTKjw8JtOZbyC23g+X a6FvlAjM5ijiSWyxqCmjVNo7pSobH2Jm8J8Q+EFZ/2WwoHuzU1VRCk/6UkGg3AWLYDHG rzIW08lfFo9/Dm5Xzpn6AmiZG3lO5Qi4r8+O2Uf2yRInql+x0BS1J1IhC2Tgyhfd7lIW kbW2HLZRJxHhl7H0luCT3Nr/THj9EUeJ/J6VTiz5OHPf6FqAKs0FWj36J6ciUIru8v8m G8YFdeWWsffaG7emJUf6L61bCCTBho6pNM19RK15uVY69wRTZMQgjMW9RARd4piedt9S 7g== Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com with ESMTP id 360yexs1dp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Jan 2021 18:12:37 -0500 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 10BN7PLV010308; Mon, 11 Jan 2021 23:12:36 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma01wdc.us.ibm.com with ESMTP id 35y448sys9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Jan 2021 23:12:36 +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 10BNCXVm37159268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Jan 2021 23:12:33 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 32ACF78064; Mon, 11 Jan 2021 23:12:33 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C573D78067; Mon, 11 Jan 2021 23:12:32 +0000 (GMT) Received: from vios4361.aus.stglabs.ibm.com (unknown [9.3.43.61]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 11 Jan 2021 23:12: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 v4 11/21] ibmvfc: map/request irq and register Sub-CRQ interrupt handler Date: Mon, 11 Jan 2021 17:12:15 -0600 Message-Id: <20210111231225.105347-12-tyreld@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210111231225.105347-1-tyreld@linux.ibm.com> References: <20210111231225.105347-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.343,18.0.737 definitions=2021-01-11_32:2021-01-11,2021-01-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 priorityscore=1501 mlxscore=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101110126 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. Unmap these irqs at Sub-CRQ teardown. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 51bcafad9490..d3d7c6b53d4f 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -5292,12 +5292,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: ibmvfc_free_queue(vhost, scrq); LEAVE; @@ -5313,6 +5335,9 @@ static void ibmvfc_deregister_scsi_channel(struct ibmvfc_host *vhost, int index) ENTER; + free_irq(scrq->irq, scrq); + irq_dispose_mapping(scrq->irq); + do { rc = plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq->cookie); -- 2.27.0