From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D7482C433F5 for ; Sat, 27 Nov 2021 02:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:MIME-Version:References:Subject:Cc :To:From:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: List-Owner; bh=GZOomRxTiln95ab2gWsna+i+2hegZjhf3VNGFr0LzZw=; b=vnNLnsP0c2/9Qy FSyn1FmDffN4j1fMumCGNuXblFNthnPgfIg3F6OBCal3PSqPXf1W0sod+WLxzSimT5Bxty15+L4W5 hIiXc7O5JC/ihQDThi8eOckcts7PpZtO6IGDzBd4DuVzd2lJGHIlSp0uQAIm4Gouku4mZgo5L3qjo dy5hM+xSXwhAhOCviOPT/dusklCTjPMeQ5lEB2HslZQESc8BPeR4/gD+DmQDRZhbhucddAUNzT/cd wRkTqVT3mvb+3uuNjlJ6ko3RnMTtIzZyDuq8bO4b3pa26KCfYLOHN7gI5AOr4NQAeqhRUzYSyW/Ds 6gTANkQAk7yvcvEdTmew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqnH8-00CZAt-Fm; Sat, 27 Nov 2021 02:17:14 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqmPi-00CB9b-5n for linux-arm-kernel@lists.infradead.org; Sat, 27 Nov 2021 01:22:06 +0000 Message-ID: <20211126230525.548258086@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1637976120; 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=wJMUpNJgyC/5WRXAWU3ClvJ2/7JlSux0SjtaYWx+PkY=; b=KQsa8LeGEIc57Zd72m+GDIhPhh9BEWKrWT9ndfo4FnxNx6PgLPBEwnJHQuA2z1bZWZZD55 JBVlXSyvJvd8nN+OqteD7p3iGqg6vrfZ/MMhG0V12X0SoW2ATWmXKwWUlOnCYkwnZ4AJ9U YoCwu9PiBRYGbYpkTu9q/FktsXn0gGArcxZIOKE4g8laR+yjUZMxizsSXF1hqWQ7QotPTQ QatZbkDn2u8nxM6JDymH30x5c7tqyCRgzvX5xHeiZ/IJlcWH0K3GpdtZ8vietOUQIjsHWk 7mdt0a3422lv7plj4XYvor02IIjLBIszdSdEk1yTygqlBL4DuMz3Z28AMAqW2g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1637976120; 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=wJMUpNJgyC/5WRXAWU3ClvJ2/7JlSux0SjtaYWx+PkY=; b=wrK2XP1liHb3vRlxhPoxTVijz8zP9SFoLxf1mYgefbvDCuYqen1QbPjKa6eoz8vzzoP044 kqqRCttaEHnmYABQ== 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, Greg Kroah-Hartman , Santosh Shilimkar , iommu@lists.linux-foundation.org, dmaengine@vger.kernel.org, Stuart Yoder , Laurentiu Tudor , Nishanth Menon , Tero Kristo , linux-arm-kernel@lists.infradead.org, x86@kernel.org, Vinod Koul , Mark Rutland , Will Deacon , Sinan Kaya Subject: [patch 27/37] powerpc/pseries/msi: Let core code check for contiguous entries References: <20211126224100.303046749@linutronix.de> MIME-Version: 1.0 Date: Sat, 27 Nov 2021 02:22:00 +0100 (CET) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211126_172202_425121_ED3966CC X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Message-ID: <20211127012200.WNm5vLadi8Lo2oZe01a7PdCIJDBnMZ5uJopRHaLHZzQ@z> Set the domain info flag and remove the check. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/pseries/msi.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c @@ -321,27 +321,6 @@ static int msi_quota_for_device(struct p return request; } -static int check_msix_entries(struct pci_dev *pdev) -{ - struct msi_desc *entry; - int expected; - - /* There's no way for us to express to firmware that we want - * a discontiguous, or non-zero based, range of MSI-X entries. - * So we must reject such requests. */ - - expected = 0; - for_each_pci_msi_entry(entry, pdev) { - if (entry->msi_index != expected) { - pr_debug("rtas_msi: bad MSI-X entries.\n"); - return -EINVAL; - } - expected++; - } - - return 0; -} - static void rtas_hack_32bit_msi_gen2(struct pci_dev *pdev) { u32 addr_hi, addr_lo; @@ -380,7 +359,7 @@ static int rtas_prepare_msi_irqs(struct if (quota && quota < nvec) return quota; - if (type == PCI_CAP_ID_MSIX && check_msix_entries(pdev)) + if (type == PCI_CAP_ID_MSIX) return -EINVAL; /* @@ -530,9 +509,16 @@ static struct irq_chip pseries_pci_msi_i .irq_write_msi_msg = pseries_msi_write_msg, }; + +/* + * Set MSI_FLAG_MSIX_CONTIGUOUS as there is no way to express to + * firmware to request a discontiguous or non-zero based range of + * MSI-X entries. Core code will reject such setup attempts. + */ static struct msi_domain_info pseries_msi_domain_info = { .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | - MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX), + MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX | + MSI_FLAG_MSIX_CONTIGUOUS), .ops = &pseries_pci_msi_domain_ops, .chip = &pseries_pci_msi_irq_chip, }; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel