Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1431583ybb; Thu, 2 Apr 2020 00:11:10 -0700 (PDT) X-Google-Smtp-Source: APiQypKnQoElI04UdpM8IU+CFWnWIQ2Bh7/sISNc5a9cxGwX0Zu/X1dQucQ1p8rBR4lzRA7yOVBS X-Received: by 2002:a05:6830:148c:: with SMTP id s12mr1192636otq.147.1585811470532; Thu, 02 Apr 2020 00:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585811470; cv=none; d=google.com; s=arc-20160816; b=fauLergMIuOkWD9vFhFKYHPcM2qLrQzOQSCL6B7QdJTDdbOUUKoQ9X7xEOfFXOQhSj yC2nTlMv+JWPUD+n66MSdq6C6szn47Iyx9OrIrFq3qhJtDRzI4nb8oAC6pCAFrun3SnA PKwYI5v97H2IRHmHdjG175YvW15EfbYXj30Ne5O63bPIQoWXK1aDcWlF3a5QdlgTcL3X 8nSelCpq+8ruEWH5fJ+HdlPEvDvsfH9BmHiVZNVGw2JK5oNxRA0CdQ/yO99OicmRHaA9 RWMgCs4OqOBvJrs+K8Ueyc9K47jfUAIGZlgGcaITxUxGgEnVEmRsXQCi01bBpGN+IRjC qV1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:cc:to:from:subject; bh=nl3S+u+BQzbz+P+vi70jrTeOWAg0zpruYZEP2aLKXbs=; b=xRvzN6+u2OjJGGtrQec0oGKXeL3C4OVLQnjQ8QmuGxnOcvh3/APL17chi0Sd/9ONpF poGOlVAaZUWrJf+Cse7A0YTft4tCCjBLcMDHd/7gIQ6+pxeuqhQ0v9gPD4w0Vq4rtPcm rwp074oBWSbSqoyOuvfPhkiRNRj7MbPKMu8TZ+e/pxr76Uz7a+6IF1YyiTTej7yn6j4/ /mQ+iXwJh9veMXgeirZLXGL5Xod8Kt1C/OvzyL8RD2HWxqAkaspJ+AkJx8kLHfbPh11P CQ2sVRFFJoT16OtO9RQM4xJbfePNmsH2MJH/427/acWk+D2tHQK6VnHbOFM6VdGy7yav rxCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si1860831oim.179.2020.04.02.00.10.58; Thu, 02 Apr 2020 00:11:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387553AbgDBHKD (ORCPT + 99 others); Thu, 2 Apr 2020 03:10:03 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:32158 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725789AbgDBHKC (ORCPT ); Thu, 2 Apr 2020 03:10:02 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03273VIX148114; Thu, 2 Apr 2020 03:09:14 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3020715x7e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Apr 2020 03:09:14 -0400 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 03274uHX152740; Thu, 2 Apr 2020 03:09:13 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 3020715x75-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Apr 2020 03:09:13 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03276dUl032506; Thu, 2 Apr 2020 07:09:13 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma03dal.us.ibm.com with ESMTP id 301x780s2h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Apr 2020 07:09:13 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03279BvJ58130808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 2 Apr 2020 07:09:11 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9707ABE04F; Thu, 2 Apr 2020 07:09:11 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A119DBE053; Thu, 2 Apr 2020 07:09:10 +0000 (GMT) Received: from [9.70.82.143] (unknown [9.70.82.143]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 2 Apr 2020 07:09:10 +0000 (GMT) Subject: [PATCH v10 01/14] powerpc/xive: Define xive_native_alloc_irq_on_chip() From: Haren Myneni To: mpe@ellerman.id.au Cc: mikey@neuling.org, srikar@linux.vnet.ibm.com, frederic.barrat@fr.ibm.com, ajd@linux.ibm.com, linux-kernel@vger.kernel.org, npiggin@gmail.com, hch@infradead.org, oohall@gmail.com, clg@kaod.org, sukadev@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, herbert@gondor.apana.org.au In-Reply-To: <1585810846.2275.23.camel@hbabu-laptop> References: <1585810846.2275.23.camel@hbabu-laptop> Content-Type: text/plain; charset="UTF-8" Date: Thu, 02 Apr 2020 00:09:09 -0700 Message-ID: <1585811349.2275.33.camel@hbabu-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-01_04:2020-03-31,2020-04-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 spamscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 suspectscore=3 bulkscore=0 phishscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004020060 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function allocates IRQ on a specific chip. VAS needs per chip IRQ allocation and will have IRQ handler per VAS instance. Signed-off-by: Haren Myneni Reviewed-by: Cédric Le Goater --- arch/powerpc/include/asm/xive.h | 9 ++++++++- arch/powerpc/sysdev/xive/native.c | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/xive.h b/arch/powerpc/include/asm/xive.h index 93f982db..d08ea11 100644 --- a/arch/powerpc/include/asm/xive.h +++ b/arch/powerpc/include/asm/xive.h @@ -5,6 +5,8 @@ #ifndef _ASM_POWERPC_XIVE_H #define _ASM_POWERPC_XIVE_H +#include + #define XIVE_INVALID_VP 0xffffffff #ifdef CONFIG_PPC_XIVE @@ -108,7 +110,6 @@ struct xive_q { int xive_native_populate_irq_data(u32 hw_irq, struct xive_irq_data *data); void xive_cleanup_irq_data(struct xive_irq_data *xd); -u32 xive_native_alloc_irq(void); void xive_native_free_irq(u32 irq); int xive_native_configure_irq(u32 hw_irq, u32 target, u8 prio, u32 sw_irq); @@ -137,6 +138,12 @@ int xive_native_set_queue_state(u32 vp_id, uint32_t prio, u32 qtoggle, u32 qindex); int xive_native_get_vp_state(u32 vp_id, u64 *out_state); bool xive_native_has_queue_state_support(void); +extern u32 xive_native_alloc_irq_on_chip(u32 chip_id); + +static inline u32 xive_native_alloc_irq(void) +{ + return xive_native_alloc_irq_on_chip(OPAL_XIVE_ANY_CHIP); +} #else diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c index 0ff6b73..14d4406 100644 --- a/arch/powerpc/sysdev/xive/native.c +++ b/arch/powerpc/sysdev/xive/native.c @@ -279,12 +279,12 @@ static int xive_native_get_ipi(unsigned int cpu, struct xive_cpu *xc) } #endif /* CONFIG_SMP */ -u32 xive_native_alloc_irq(void) +u32 xive_native_alloc_irq_on_chip(u32 chip_id) { s64 rc; for (;;) { - rc = opal_xive_allocate_irq(OPAL_XIVE_ANY_CHIP); + rc = opal_xive_allocate_irq(chip_id); if (rc != OPAL_BUSY) break; msleep(OPAL_BUSY_DELAY_MS); @@ -293,7 +293,7 @@ u32 xive_native_alloc_irq(void) return 0; return rc; } -EXPORT_SYMBOL_GPL(xive_native_alloc_irq); +EXPORT_SYMBOL_GPL(xive_native_alloc_irq_on_chip); void xive_native_free_irq(u32 irq) { -- 1.8.3.1