From: Yu Zhao Subject: Re: [PATCH 9/16 v6] PCI: add boot option to align MMIO resources Date: Wed, 22 Oct 2008 22:52:43 +0800 Message-ID: <48FF3E3B.3050006@uniscape.net> References: <20081022083809.GA3757@yzhao12-linux.sh.intel.com> <20081022084324.GI3773@yzhao12-linux.sh.intel.com> <200810220834.07222.bjorn.helgaas@hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Yu Zhao , "linux-pci@vger.kernel.org" , "achiang@hp.com" , "grundler@parisc-linux.org" , "greg@kroah.com" , "mingo@elte.hu" , "jbarnes@virtuousgeek.org" , "matthew@wil.cx" , "randy.dunlap@oracle.com" , "rdreier@cisco.com" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" To: Bjorn Helgaas Return-path: In-Reply-To: <200810220834.07222.bjorn.helgaas@hp.com> Sender: linux-pci-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Bjorn Helgaas wrote: > On Wednesday 22 October 2008 02:43:24 am Yu Zhao wrote: >> This patch adds boot option to align MMIO resource for a device. >> The alignment is a bigger value between the PAGE_SIZE and the >> resource size. > > It looks like this forces alignment on PAGE_SIZE, not "a bigger > value between the PAGE_SIZE and the resource size." Can you > clarify the changelog to specify exactly what alignment this > option forces? I guess following would explain your question. >> int pci_resource_alignment(struct pci_dev *dev, int resno) >> { >> - resource_size_t align; >> + resource_size_t align, bios_align; >> struct resource *res = dev->resource + resno; >> >> + bios_align = pcibios_resource_alignment(dev, resno); >> + >> align = resource_alignment(res); >> if (align) >> - return align; >> + return align > bios_align ? align : bios_align; >> >> dev_err(&dev->dev, "alignment: invalid resource #%d\n", resno); >> return 0;