From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qe0-f46.google.com ([209.85.128.46]:33779 "EHLO mail-qe0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756557Ab3HFSCA (ORCPT ); Tue, 6 Aug 2013 14:02:00 -0400 Received: by mail-qe0-f46.google.com with SMTP id i11so405840qej.5 for ; Tue, 06 Aug 2013 11:01:59 -0700 (PDT) Date: Tue, 6 Aug 2013 12:01:55 -0600 From: Bjorn Helgaas To: Wei Yang Cc: "linux-pci@vger.kernel.org" , Ram Pai , Gavin Shan , Yinghai Lu Subject: Re: [PATCH 4/4] PCI: fix the io resource alignment calculation in pbus_size_io() Message-ID: <20130806180155.GB1246@google.com> References: <1375435866-16332-1-git-send-email-weiyang@linux.vnet.ibm.com> <1375435866-16332-5-git-send-email-weiyang@linux.vnet.ibm.com> <20130806061924.GB10876@weiyang.vnet.ibm.com> <20130806134421.GD31970@google.com> <20130806154742.GB10680@weiyang.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20130806154742.GB10680@weiyang.vnet.ibm.com> Sender: linux-pci-owner@vger.kernel.org List-ID: On Tue, Aug 06, 2013 at 11:47:42PM +0800, Wei Yang wrote: > On Tue, Aug 06, 2013 at 07:44:21AM -0600, Bjorn Helgaas wrote: > >On Tue, Aug 06, 2013 at 02:19:24PM +0800, Wei Yang wrote: > >> On Mon, Aug 05, 2013 at 11:58:50AM -0600, Bjorn Helgaas wrote: > >> >[+cc Yinghai] > >> > > >> >On Fri, Aug 2, 2013 at 3:31 AM, Wei Yang wrote: > >> >> In commit 462d9303 ("PCI: Align P2P windows using pcibios_window_alignment()"), > >> >> it introduce a new method to calculate the window alignment of P2P bridge. > >> >> > >> >> When the io_window_1k is set, the calculation for the io resource alignment > >> >> is different from the original one. In the original logic before 462d9303, > >> >> the alignment is no bigger than 4K even the io_window_1k is set. The logic > >> >> introduced in 462d9303 will limit the alignment to 1k in this case. > >> >> > >> >> This patch fix this issue. > >> > > >> >Presumably this fixes a bug, but you don't say what it is. "different > >> >from the original" is not a description of a problem. You need > >> >something like "with the current code, we allocate the wrong window > >> >size in situation X, or we allocate a window with incorrect alignment > >> >in situation Y, etc." > >> > > >> > >> With current code, we allocate the wrong window size when upstream bridge > >> could be 1k aligned and one of the downstream port is 4k aligned. > >> > >> In this case, the "min_align" should be 4k. But the current code set > >> "min_align" to 1k. > > > > Hmm... sorry I should say. > > With current code, we allocate the wrong window size and alignment when upstream > bridge could be 1k aligned and one of the downstream port is 4k aligned. > > In this case, the "min_align" should be 4k. But the current code set > "min_align" to 1k. Actually, I think only the alignment is wrong (not the size). But I do agree that this looks like a problem in the current code. I'll write this up and post the patch soon. Bjorn