From patchwork Fri Dec 10 22:19:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 12671215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 51675C433F5 for ; Fri, 10 Dec 2021 22:28:00 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.244446.422994 (Exim 4.92) (envelope-from ) id 1mvoMn-00005S-Qc; Fri, 10 Dec 2021 22:27:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 244446.422994; Fri, 10 Dec 2021 22:27:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mvoMn-00005H-Lx; Fri, 10 Dec 2021 22:27:49 +0000 Received: by outflank-mailman (input) for mailman id 244446; Fri, 10 Dec 2021 22:27:48 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mvoEm-0005LR-P3 for xen-devel@lists.xenproject.org; Fri, 10 Dec 2021 22:19:32 +0000 Received: from galois.linutronix.de (galois.linutronix.de [193.142.43.55]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3fa12211-5a07-11ec-ad7a-b7ef48004f0a; Fri, 10 Dec 2021 23:19:32 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3fa12211-5a07-11ec-ad7a-b7ef48004f0a Message-ID: <20211210221815.089008198@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639174771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=1PKR2Prd+1Li94AkrvejzHYXvOdiS0rHF3AWjJOJ+hY=; b=EXT6ZJHiL9WrQC63pWNeqEY7SfF3jIeVCos8i7xIZwHprSzmRcoSNiXrPRfeBGlX/4efFg GKBzvkr1hfP/TIvTDbw4CCeW2qNJNT1Mrz8mlT8JOpccmtfR+od0ZQ9AQUNq6SHiF7UA3t gC95XdhE8YJZ9o2I7sAZvmGtCHXLa+d9dwdc4G0asxf97pWkhPvcdF3TvGUziuRsuYw+ql n5cM46TBOVor1arusxIXF8fp7Wzk5TqiI9gjuel4qNwYdCdafKWtXUXZHfuM6B8FoM+RnC Gr+GIxVCgZ+BZGSsHPWLRtVqrhQbLaB0ZKkw3F8DrRN180qyN2lempVXeHraIQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639174771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=1PKR2Prd+1Li94AkrvejzHYXvOdiS0rHF3AWjJOJ+hY=; b=Q87ZFBVcPUXRgAfqqpqy/zVPxQ4IgjxdQfabAhW5+cvr8SXGLARh4lgGWZYcuCireCH7xW qehr/nAEfvi/OQDg== From: Thomas Gleixner To: LKML Cc: Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , linux-pci@vger.kernel.org, Cedric Le Goater , Robin Murphy , Greg Kroah-Hartman , Will Deacon , Joerg Roedel , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, Juergen Gross , xen-devel@lists.xenproject.org, Arnd Bergmann , Michael Ellerman , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, Bjorn Helgaas , Stuart Yoder , Laurentiu Tudor , Nishanth Menon , Tero Kristo , Santosh Shilimkar , Vinod Koul , dmaengine@vger.kernel.org, Mark Rutland , Jassi Brar , Peter Ujfalusi , Sinan Kaya Subject: [patch V3 31/35] iommu/arm-smmu-v3: Use msi_get_virq() References: <20211210221642.869015045@linutronix.de> MIME-Version: 1.0 Date: Fri, 10 Dec 2021 23:19:31 +0100 (CET) From: Thomas Gleixner Let the core code fiddle with the MSI descriptor retrieval. Signed-off-by: Thomas Gleixner Tested-by: Robin Murphy Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Will Deacon Cc: Joerg Roedel Cc: linux-arm-kernel@lists.infradead.org Cc: iommu@lists.linux-foundation.org --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3154,7 +3154,6 @@ static void arm_smmu_write_msi_msg(struc static void arm_smmu_setup_msis(struct arm_smmu_device *smmu) { - struct msi_desc *desc; int ret, nvec = ARM_SMMU_MAX_MSIS; struct device *dev = smmu->dev; @@ -3182,21 +3181,9 @@ static void arm_smmu_setup_msis(struct a return; } - for_each_msi_entry(desc, dev) { - switch (desc->msi_index) { - case EVTQ_MSI_INDEX: - smmu->evtq.q.irq = desc->irq; - break; - case GERROR_MSI_INDEX: - smmu->gerr_irq = desc->irq; - break; - case PRIQ_MSI_INDEX: - smmu->priq.q.irq = desc->irq; - break; - default: /* Unknown */ - continue; - } - } + smmu->evtq.q.irq = msi_get_virq(dev, EVTQ_MSI_INDEX); + smmu->gerr_irq = msi_get_virq(dev, GERROR_MSI_INDEX); + smmu->priq.q.irq = msi_get_virq(dev, PRIQ_MSI_INDEX); /* Add callback to free MSIs on teardown */ devm_add_action(dev, arm_smmu_free_msis, dev);