From patchwork Sat Mar 10 02:58:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongdong Liu X-Patchwork-Id: 10272901 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 919C46016D for ; Sat, 10 Mar 2018 02:26:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 758422A0D0 for ; Sat, 10 Mar 2018 02:26:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67A5B2A0D2; Sat, 10 Mar 2018 02:26:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBBA42A0D0 for ; Sat, 10 Mar 2018 02:26:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751349AbeCJC0V (ORCPT ); Fri, 9 Mar 2018 21:26:21 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6186 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751275AbeCJC0V (ORCPT ); Fri, 9 Mar 2018 21:26:21 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 59B5A101470CE; Sat, 10 Mar 2018 10:26:08 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Sat, 10 Mar 2018 10:26:03 +0800 From: Dongdong Liu To: , CC: , , , Dongdong Liu Subject: [RFC PATCH] ARM64/PCI: Set dev->irq=0 before calling acpi_pci_irq_enable() Date: Sat, 10 Mar 2018 10:58:12 +0800 Message-ID: <1520650692-62705-1-git-send-email-liudongdong3@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The init value of dev->irq is from PCI_INTERRUPT_LINE register.The default value of dev->irq usually is 255 before calling acpi_pci_irq_enable(). This will cause a problem When the platform does not support INTx well. For example, we do not config _PRT on our HIP07 platform, we met irq 255 confilict. The error message is as below. snd_hda_intel 000d:33:00.1: PCI INT B: no GSI snd_hda_intel 000d:33:00.1: enabling device (0000 -> 0002) snd_hda_intel 000d:33:00.1: Force to snoop mode by module option snd_hda_intel 000d:33:00.1: Device has broken 64-bit MSI but arch tried to assign one above 4G genirq: Flags mismatch irq 255. 00000001 (enahisic2i0-tx1) vs. 00000081 (snd_hda_intel:card0) hns-nic HISI00C2:00 enahisic2i0: request irq(255) fail enahisic2i0-tx1: this device is a platform device. snd_hda_intel:card0: this device is a PCI device. Signed-off-by: Dongdong Liu --- arch/arm64/kernel/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 0e2ea1c..6a77bef 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -28,8 +28,11 @@ */ int pcibios_alloc_irq(struct pci_dev *dev) { - if (!acpi_disabled) + if (!acpi_disabled) { + dev->irq = 0; acpi_pci_irq_enable(dev); + } + return 0; }