From patchwork Wed Jan 27 06:08:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Fan X-Patchwork-Id: 8130651 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 898CB9F38B for ; Wed, 27 Jan 2016 06:14:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91E0520274 for ; Wed, 27 Jan 2016 06:14:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC33E2025A for ; Wed, 27 Jan 2016 06:14:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753587AbcA0GNk (ORCPT ); Wed, 27 Jan 2016 01:13:40 -0500 Received: from cn.fujitsu.com ([59.151.112.132]:44611 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753527AbcA0GNh (ORCPT ); Wed, 27 Jan 2016 01:13:37 -0500 X-IronPort-AV: E=Sophos;i="5.20,346,1444665600"; d="scan'208";a="3017067" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 27 Jan 2016 14:13:36 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id BDA2D418AD44; Wed, 27 Jan 2016 14:12:56 +0800 (CST) Received: from G08FNSTD131468.g08.fujitsu.local (10.167.226.78) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Wed, 27 Jan 2016 14:17:19 +0800 From: Chen Fan To: CC: , , , , , , , , , , , , , , Subject: [PATCH v3 1/2] pci: add an irq_invalid flag to specify the IRQ is not connected Date: Wed, 27 Jan 2016 14:08:43 +0800 Message-ID: X-Mailer: git-send-email 1.9.3 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.167.226.78] X-yoursite-MailScanner-ID: BDA2D418AD44.A7E16 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: chen.fan.fnst@cn.fujitsu.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Quoting the PCI3.0 SPEC on page 223: "For x86 based PCs, the values in this register correspond to IRQ numbers (0-15) of the standard dual 8259 configuration. The value 255 is defined as meaning "unknown" or "no connection" to the interrupt controller. Values between 15 and 254 are reserved." So we add an irq_invalid flag to tell driver that the device wire is not connected. then the driver could know whether it should call request_irq(). Signed-off-by: Chen Fan --- drivers/acpi/pci_irq.c | 10 ++++++++++ include/linux/pci.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index d30184c..bb78376 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -436,6 +436,16 @@ int acpi_pci_irq_enable(struct pci_dev *dev) * driver reported one, then use it. Exit in any case. */ if (gsi < 0) { +#ifdef CONFIG_X86 + /* + * For X86 architecture, The Interrupt Line value of 0xff is + * defined to mean "unknown" or "no connection" (PCI 3.0, + * Section 6.2.4, footnote on page 223). we flag the IRQ + * as INVALID. + */ + if (dev->irq == 0xff) + dev->irq_invalid = 1; +#endif if (acpi_isa_register_gsi(dev)) dev_warn(&dev->dev, "PCI INT %c: no GSI\n", pin_name(pin)); diff --git a/include/linux/pci.h b/include/linux/pci.h index d86378c..06f137e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -359,6 +359,7 @@ struct pci_dev { unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */ unsigned int irq_managed:1; unsigned int has_secondary_link:1; + unsigned int irq_invalid:1; pci_dev_flags_t dev_flags; atomic_t enable_cnt; /* pci_enable_device has been called */