From patchwork Wed Jul 18 06:06:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengzhou Liu X-Patchwork-Id: 171601 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id C1DF72C0427 for ; Wed, 18 Jul 2012 16:29:15 +1000 (EST) Received: from am1outboundpool.messaging.microsoft.com (am1ehsobe005.messaging.microsoft.com [213.199.154.208]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 356EC2C0337 for ; Wed, 18 Jul 2012 16:28:50 +1000 (EST) Received: from mail99-am1-R.bigfish.com (10.3.201.253) by AM1EHSOBE003.bigfish.com (10.3.204.23) with Microsoft SMTP Server id 14.1.225.23; Wed, 18 Jul 2012 06:28:44 +0000 Received: from mail99-am1 (localhost [127.0.0.1]) by mail99-am1-R.bigfish.com (Postfix) with ESMTP id 96DAF4E01F3; Wed, 18 Jul 2012 06:28:44 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839he5bhf0ah107ah) Received: from mail99-am1 (localhost.localdomain [127.0.0.1]) by mail99-am1 (MessageSwitch) id 1342592922475649_27460; Wed, 18 Jul 2012 06:28:42 +0000 (UTC) Received: from AM1EHSMHS001.bigfish.com (unknown [10.3.201.236]) by mail99-am1.bigfish.com (Postfix) with ESMTP id 70469240069; Wed, 18 Jul 2012 06:28:42 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS001.bigfish.com (10.3.207.101) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 18 Jul 2012 06:28:42 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.2.298.5; Wed, 18 Jul 2012 01:28:40 -0500 Received: from localhost.localdomain (rock.ap.freescale.net [10.193.20.106]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id q6I6SbXR003475; Tue, 17 Jul 2012 23:28:38 -0700 From: Shengzhou Liu To: , Subject: [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non MSI/INTx interrupt Date: Wed, 18 Jul 2012 14:06:54 +0800 Message-ID: <1342591614-1840-1-git-send-email-Shengzhou.Liu@freescale.com> X-Mailer: git-send-email 1.6.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: linuxppc-dev@lists.ozlabs.org, Shengzhou Liu X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On some platforms, root port has neither MSI/MSI-X nor INTx interrupt generated in RC mode. In this case, we have to use other interrupt(e.g. system shared interrupt) for port service irq to have AER, Hot-plug, etc, services to work. Signed-off-by: Shengzhou Liu --- drivers/pci/pcie/portdrv_core.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 75915b3..49acf72 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -200,10 +200,13 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask) { int i, irq = -1; - /* We have to use INTx if MSI cannot be used for PCIe PME or pciehp. */ + /* + * We have to use INTx or other interrupts(e.g. system shared interrupt) + * if MSI cannot be used for PCIe PME or pciehp. + */ if (((mask & PCIE_PORT_SERVICE_PME) && pcie_pme_no_msi()) || ((mask & PCIE_PORT_SERVICE_HP) && pciehp_no_msi())) { - if (dev->pin) + if (dev->irq) irq = dev->irq; goto no_msi; } @@ -212,8 +215,13 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask) if (!pcie_port_enable_msix(dev, irqs, mask)) return 0; - /* We're not going to use MSI-X, so try MSI and fall back to INTx */ - if (!pci_enable_msi(dev) || dev->pin) + /* + * We're not going to use MSI-X, so try MSI and fall back to INTx. + * If neither MSI/MSI-X nor INTx available, try other interrupt. (On + * some platforms, root port doesn't support generating MSI/MSI-X/INTx + * in RC mode) + */ + if (!pci_enable_msi(dev) || dev->irq) irq = dev->irq; no_msi: