Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752852Ab0DLTjV (ORCPT ); Mon, 12 Apr 2010 15:39:21 -0400 Received: from acsinet12.oracle.com ([141.146.126.234]:60018 "EHLO acsinet12.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751999Ab0DLTjT (ORCPT ); Mon, 12 Apr 2010 15:39:19 -0400 Message-ID: <4BC375D9.4040503@oracle.com> Date: Mon, 12 Apr 2010 12:34:49 -0700 From: Yinghai User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100228 SUSE/3.0.3-1.1.1 Thunderbird/3.0.3 MIME-Version: 1.0 To: Andy Isaacson CC: guenter.roeck@ericsson.com, "H. Peter Anvin" , Linus Torvalds , Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , "linux-pci@vger.kernel.org" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Thomas Renninger Subject: Re: [PATCH] x86: Reserve legacy VGA MMIO area for x86_64 as well as x86_32 References: <20100409222103.GA11130@hexapodia.org> <4BBFA9BF.60608@oracle.com> <20100409223532.GC11130@hexapodia.org> <4BBFB1D8.6090802@oracle.com> <20100410000030.GE11130@hexapodia.org> <4BBFD019.9040405@oracle.com> <20100410014308.GG11130@hexapodia.org> <4BBFD8EF.6020108@oracle.com> <20100410015711.GH11130@hexapodia.org> <4BBFE66C.2040603@oracle.com> <20100412185416.GA19959@hexapodia.org> In-Reply-To: <20100412185416.GA19959@hexapodia.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Source-IP: acsmt353.oracle.com [141.146.40.153] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090201.4BC37682.0121:SCFMA4539814,ss=1,fgs=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2060 Lines: 58 On 04/12/2010 11:54 AM, Andy Isaacson wrote: > On Fri, Apr 09, 2010 at 07:46:04PM -0700, Yinghai wrote: > [ 5.463672] ahci 0000:00:1f.2: PCI INT C -> GSI 20 (level, low) -> IRQ 20 > [ 5.470633] ahci 0000:00:1f.2: BAR 5: can't reserve [mem 0x000a0000-0x000a07ff] > [ 5.478257] ahci: probe of 0000:00:1f.2 failed with error -16 please check [PATCH] x86,pci, acpi: Inherent BUSY flag when setup_resource for root bus So make pci root resource from _CRS honor the range We reserve in e820 below 1M then will not assign them to unsigned pci BAR -v2: let pci_bus_alloc_resource() honor IORESOURCE_BUSY driver can not use those range, so skip it Signed-off-by: Yinghai Lu --- arch/x86/pci/acpi.c | 4 ++++ drivers/pci/bus.c | 4 ++++ 2 files changed, 8 insertions(+) Index: linux-2.6/arch/x86/pci/acpi.c =================================================================== --- linux-2.6.orig/arch/x86/pci/acpi.c +++ linux-2.6/arch/x86/pci/acpi.c @@ -175,6 +175,10 @@ setup_resource(struct acpi_resource *acp "conflicts with %s %pR\n", res, conflict->name, conflict); } else { + /* In case it falls in big reserved region */ + if (res->parent->flags & IORESOURCE_BUSY) + res->flags |= IORESOURCE_BUSY; + pci_bus_add_resource(info->bus, res, 0); info->res_num++; if (addr.translation_offset) Index: linux-2.6/drivers/pci/bus.c =================================================================== --- linux-2.6.orig/drivers/pci/bus.c +++ linux-2.6/drivers/pci/bus.c @@ -103,6 +103,10 @@ pci_bus_alloc_resource(struct pci_bus *b if (!r) continue; + /* Driver can not reserve it later, so don't use it */ + if (r->flags & IORESOURCE_BUSY) + continue; + /* type_mask must match */ if ((res->flags ^ r->flags) & type_mask) continue; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/