From patchwork Fri Jan 10 21:34:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 309421 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 C554B2C0089 for ; Sat, 11 Jan 2014 08:34:08 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751658AbaAJVeH (ORCPT ); Fri, 10 Jan 2014 16:34:07 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:37146 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751343AbaAJVeG (ORCPT ); Fri, 10 Jan 2014 16:34:06 -0500 Received: by mail-ie0-f175.google.com with SMTP id x13so5843298ief.34 for ; Fri, 10 Jan 2014 13:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=3AA0Z30BV7oDsB2jBmcd1KJe0Yr3u/L4hMbNjJp59vc=; b=hghLTC/+MAHOY38YfMSNfW8o7k30J8P9sAJHzabS3KhmROdgQPEd+DE3SCFmUmT+MN CFNnLrMutLwoocpFK8W6KHJTQItJq/I35A7NhbXn1neTSeWK2XoCcsYCDr5BGtoz5ZHs ZGPhfhgZNjMayihrcM6mGybLwVxr+1Ode3OpELUIarYvAl3XTG0YxAP+ZzTG7yBjHDmX RFmutHWvvkzShmwvrtrccTNLi8V1eYDaGovMKxbSFFwQ7joe3WWvU7Wy3OsOp5+W5XOi ZNL2j1LtwUs07pK6tVLPjUa7ifYAN62HedAyz/eRGbmi1hlnmjHRsIfsaKJ9ywYom6H+ fsfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=3AA0Z30BV7oDsB2jBmcd1KJe0Yr3u/L4hMbNjJp59vc=; b=kQoL9axs4p4W9B4zNG+nWcat41X5RtHZHPlDqnt7BJT+rn54RNK+lpNuoFpaEhOWY9 MivJ5ggFNEXhqSvmwU9Lp4p26JAREMMKCA7s0ku0ZHgqrSCYA44YCqK7whSnbxbOq3oJ mcWPLQ42F1oNLOo875n9BNyexI12G+cSn1AFpwnzH20Wbwxr5NhxtfsQj+Z+xKNqkx0i wSf/7tT2V8xmJVLdu9wQwIvsyoOuSVZwkph7xcsAMwQ3CO2Axa7mu4ZedJGzHT6Ut21f G3SkgavkxK22B2dQPFDO3hLDjRnVtf4n/9WUf+eX5nKDi39m4YTVNGqHLOqEDnfTEbdP B2CA== X-Gm-Message-State: ALoCoQlM2iW+JOirCaK2v+K52sX+iTOVlGK/nxXgzc9JZuGNJhYaUH7r8VRjLYns39l69CO7UNRH/6PapRMH/40N75RpBjAhrVck1DibqJ4HJR3qud1sWto9XqUgjn0XRLW2OhzZC8vfwDnxFC8TcSvtIN86K0tebx/QS9ejM1U3weCVZ3LYneQh4yumiA1LTQwHb9dFOtQPNREY8PtPnAXgTIcoUHJUmEsH4njqvOxX30MXP3zx3Ac= X-Received: by 10.50.109.132 with SMTP id hs4mr6143212igb.34.1389389645591; Fri, 10 Jan 2014 13:34:05 -0800 (PST) Received: from google.com ([172.29.126.187]) by mx.google.com with ESMTPSA id ni7sm4607263igb.7.2014.01.10.13.34.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 10 Jan 2014 13:34:05 -0800 (PST) Date: Fri, 10 Jan 2014 14:34:02 -0700 From: Bjorn Helgaas To: linux-pci@vger.kernel.org, Daniel Vetter Cc: David Airlie , Yinghai Lu , Guo Chao , linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 00/15] PCI: Allocate 64-bit BARs above 4G when possible Message-ID: <20140110213402.GB25635@google.com> References: <20140107005003.10786.85164.stgit@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140107005003.10786.85164.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Mon, Jan 06, 2014 at 05:55:12PM -0700, Bjorn Helgaas wrote: > This is basically v7 of Yinghai's patch series: > http://lkml.kernel.org/r/1387485843-17403-1-git-send-email-yinghai@kernel.org > > The goal is to try to put 64-bit BARs above 4G so we can preserve the > 32-bit bus address space for 32-bit BARs. I added Daniel's Reviewed-by to the AGP patches (except the trivial PCI_COMMAND change in ati_configure()). I added the incremental patch below to fix these warnings found by Fengguang's autobuilder in the original b1e0e392f5dd commit: drivers/char/agp/amd-k7-agp.c:115:38: warning: 'addr' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/pci/bus.c:105:5: warning: large integer implicitly truncated to unsigned type [-Woverflow] Finally, I merged the pci/resource branch with these changes into my "next" branch, so it should appear in v3.14-rc1. Dave, let me know if you have any issue with these AGP changes going through my tree. Bjorn Acked-by: Dave Airlie --- 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/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index e8c2e9167e89..3661a51e93e2 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c @@ -148,8 +148,8 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge) * used to program the agp master not the cpu */ - agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev, - AGP_APERTURE_BAR); + addr = pci_bus_address(agp_bridge->dev, AGP_APERTURE_BAR); + agp_bridge->gart_bus_addr = addr; /* Calculate the agp offset */ for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 107ad9a5b8aa..86fb8ec5e448 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -99,10 +99,12 @@ void pci_bus_remove_resources(struct pci_bus *bus) } static struct pci_bus_region pci_32_bit = {0, 0xffffffffULL}; +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT static struct pci_bus_region pci_64_bit = {0, - (resource_size_t) 0xffffffffffffffffULL}; -static struct pci_bus_region pci_high = {(resource_size_t) 0x100000000ULL, - (resource_size_t) 0xffffffffffffffffULL}; + (dma_addr_t) 0xffffffffffffffffULL}; +static struct pci_bus_region pci_high = {(dma_addr_t) 0x100000000ULL, + (dma_addr_t) 0xffffffffffffffffULL}; +#endif /* * @res contains CPU addresses. Clip it so the corresponding bus addresses @@ -207,6 +209,7 @@ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, resource_size_t), void *alignf_data) { +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT int rc; if (res->flags & IORESOURCE_MEM_64) { @@ -220,6 +223,7 @@ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, type_mask, alignf, alignf_data, &pci_64_bit); } +#endif return pci_bus_alloc_from_region(bus, res, size, align, min, type_mask, alignf, alignf_data,