From patchwork Sat Nov 27 01:20:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 12641915 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77B7CC4332F for ; Sat, 27 Nov 2021 01:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347672AbhK0B1z (ORCPT ); Fri, 26 Nov 2021 20:27:55 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:37158 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344848AbhK0BZy (ORCPT ); Fri, 26 Nov 2021 20:25:54 -0500 Message-ID: <20211126230525.315266344@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1637976044; 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=mgACjNybAkVsWjwjzkFX6HgLmpYiDt2Y2zyU/5gje7g=; b=iP27cgXidL5SLaulOXvp3cm7WgLUDh/d2/3RVGMWhEH8iyeN9TUZVAksT0NL4RhJev2i53 OLkkgEkTsJEqlOG2NXpaHuApkLe/S81+ELPfC/i0bdD/E75c9Hb5Pru4FxIvpOyk/iNrSm tfseRoetLanHz61s/4Ye9jxxWwhI7NatJfWDEUiBXwAHqSqxv8KbYzHcUUlqYe6x8DwMNi ZIVwu8ZO0VeUEliHiVPzWl/Fv9RUxyHMpe/TmzCwxQUK5ifSedBNr3GQ6wYrbJJi0nfOo6 GLUdTIrnEoYZcsmqJMYdKU5/XUJvUNYwB135GZJwzGUPU2qUXnnpQ1AslNfU7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1637976044; 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=mgACjNybAkVsWjwjzkFX6HgLmpYiDt2Y2zyU/5gje7g=; b=xKPmNFPcGh3tszti3AasucXkI+se6p1kxMe76wgvqlQQ5D6zBqdFZYctozRU4F7+sEhBjb /av6nqPxzuVz9sCg== 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 , x86@kernel.org, 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, Vinod Koul , Mark Rutland , Will Deacon , Sinan Kaya Subject: [patch 23/37] genirq/msi: Use device MSI properties References: <20211126224100.303046749@linutronix.de> MIME-Version: 1.0 Date: Sat, 27 Nov 2021 02:20:43 +0100 (CET) Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Cc: x86@kernel.org --- kernel/irq/msi.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -114,21 +114,8 @@ int msi_setup_device_data(struct device static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct msi_desc *entry; - bool is_msix = false; - unsigned long irq; - int retval; - - retval = kstrtoul(attr->attr.name, 10, &irq); - if (retval) - return retval; - - entry = irq_get_msi_desc(irq); - if (!entry) - return -ENODEV; - - if (dev_is_pci(dev)) - is_msix = entry->pci.msi_attrib.is_msix; + /* MSI vs. MSIX is per device not per interrupt */ + bool is_msix = msi_device_has_property(dev, MSI_PROP_PCI_MSIX); return sysfs_emit(buf, "%s\n", is_msix ? "msix" : "msi"); }