From patchwork Tue May 8 16:58:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 157749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8B811B6FA4 for ; Wed, 9 May 2012 02:58:25 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757336Ab2EHQ6Y (ORCPT ); Tue, 8 May 2012 12:58:24 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:41590 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756625Ab2EHQ6X (ORCPT ); Tue, 8 May 2012 12:58:23 -0400 Received: by pbbrp8 with SMTP id rp8so8263954pbb.19 for ; Tue, 08 May 2012 09:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=F9PC6vi3nFerJT4CESRzgefVpXcsiHcxkpISNHFWRYQ=; b=ejb83B0cLPomGZqHBNdiasEv309T6at5GXFGM6tkwotuRWnfBYFmCxRFR1hXmAsQ8k RLxXhlm2hIUgNuHDq9XuX9UXxE12T7Jmco3TO9mTEVRUybs/aRaZrdxdidt0Z6i5+imc kMoVKdckYSc3SqZ+J/vTx5X9S8LR0805T0INf4tymQfO/hA2XRXTnVP6fk20Uy2QNXlL YfYCP3p0Z0OX0c/HYtBEjNbIQ3XsENG70PMyOAxbg4dcsPePpxbuR6n164kBi+05sC/o OkaGVci32wlOSeEnotpVrgdaJNDx1q9yiQ96KErUiAnbqAJ5TIgdBjbPiMye0HtGUWNF mB4Q== Received: by 10.68.213.167 with SMTP id nt7mr2595388pbc.100.1336496303344; Tue, 08 May 2012 09:58:23 -0700 (PDT) Received: from [192.168.1.31] ([120.199.50.210]) by mx.google.com with ESMTPS id uf6sm9800pbc.75.2012.05.08.09.58.19 (version=SSLv3 cipher=OTHER); Tue, 08 May 2012 09:58:22 -0700 (PDT) Message-ID: <4FA950A5.6040106@gmail.com> Date: Wed, 09 May 2012 00:58:13 +0800 From: Jiang Liu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Taku Izumi CC: Bjorn Helgaas , Yinghai Lu , Kenji Kaneshige , Don Dutile , Keping Chen , linux-pci@vger.kernel.org Subject: Re: [PATCH v5 0/6] PCI, x86: update MMCFG information when hot-plugging PCI host bridges References: <1336186830-10765-1-git-send-email-jiang.liu@huawei.com> <20120508172153.b67a8cc6.izumi.taku@jp.fujitsu.com> In-Reply-To: <20120508172153.b67a8cc6.izumi.taku@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Hi Taku, Thanks for testing. Could you please help to try the patch below? On 05/08/2012 04:21 PM, Taku Izumi wrote: > > Hi Jiang, > > I tested this pachset. > (to be honest, as I used Bjorn tree, I changed a little of Patch6/6 > to apply to his tree.) > > My machine failed to boot after applied your patchset. > The reason is: > My machine's MCFG table shows that End bus number is 0x13. > > [000h 0000 4] Signature : "MCFG" /* Memory Mapped Configuration table */ > [004h 0004 4] Table Length : 00000040 > [008h 0008 1] Revision : 01 > [009h 0009 1] Checksum : 3E > [00Ah 0010 6] Oem ID : "PTLTD " > [010h 0016 8] Oem Table ID : " MCFG " > [018h 0024 4] Oem Revision : 06040001 > [01Ch 0028 4] Asl Compiler ID : " LTP" > [020h 0032 4] Asl Compiler Revision : 00000000 > > [024h 0036 8] Reserved : 0000000000000000 > > [02Ch 0044 8] Base Address : 00000000F0000000 > [034h 0052 2] Segment Group Number : 0000 > [036h 0054 1] Start Bus Number : 00 > [037h 0055 1] End Bus Number : 13 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > [038h 0056 4] Reserved : 00000000 > > But CRS shows bus range is 0x00 - 0xff. So arch_acpi_pci_root_add() failed > because pci_mmconfig_insert() returns not -EEXIST but -EINVAL. > > [ 0.094236] PCI: MMCONFIG for domain 0000 [bus 00-ff] conflicts with domain 0000 [bus 00-13] > > int __devinit pci_mmconfig_insert(int segment, int start, int end, u64 addr) > { > .. > (snip) > ... > mutex_lock(&pci_mmcfg_lock); > cfg = pci_mmconfig_lookup(segment, start); > if (cfg) { > if (cfg->start_bus <= start && cfg->end_bus >= end) { > rc = -EEXIST; > } else { > printk(KERN_WARNING PREFIX > "MMCONFIG for domain %04x [bus %02x-%02x] " > "conflicts with domain %04x [bus %02x-%02x]\n", > segment, start, end, > cfg->segment, cfg->start_bus, cfg->end_bus); > } > goto out; > > > My impression is my machine's firmware is broken. > Howerver my machine boots well without your patchset. So I report as a problem. > > > Best regards, > Taku Izumi > --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index a8da5d4..2551586 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c @@ -708,6 +708,13 @@ int __devinit pci_mmconfig_insert(int segment, int start, int end if (cfg) { if (cfg->start_bus <= start && cfg->end_bus >= end) { rc = -EEXIST; + } else if (!addr) { + /* + * With some legacy BIOSes, the MCFG table only + * partially covers bus ranges returned by + * root bridges' _CRS method. + */ + rc = -EEXIST; } else { printk(KERN_WARNING PREFIX "MMCONFIG for domain %04x [bus %02x-%02x] "