From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f66.google.com ([209.85.218.66]:33578 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755867AbdDSCMJ (ORCPT ); Tue, 18 Apr 2017 22:12:09 -0400 Received: by mail-oi0-f66.google.com with SMTP id a189so2104092oib.0 for ; Tue, 18 Apr 2017 19:12:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <87bmrt6udc.fsf@concordia.ellerman.id.au> References: <20170417212705.21092.90222.stgit@bhelgaas-glaptop.roam.corp.google.com> <20170417213653.21092.27784.stgit@bhelgaas-glaptop.roam.corp.google.com> <87bmrt6udc.fsf@concordia.ellerman.id.au> From: Yongji Xie Date: Wed, 19 Apr 2017 10:12:07 +0800 Message-ID: Subject: Re: [PATCH v11 4/7] powerpc/powernv: Override pcibios_default_alignment() to force PCI devices to be page aligned To: Michael Ellerman Cc: Bjorn Helgaas , Li Zhong , Alexey Kardashevskiy , "linux-pci@vger.kernel.org" , Gavin Shan , Alex Williamson , Paul Mackerras , Benjamin Herrenschmidt , linuxppc-dev Content-Type: text/plain; charset=UTF-8 Sender: linux-pci-owner@vger.kernel.org List-ID: On 19 April 2017 at 09:47, Michael Ellerman wrote: > Bjorn Helgaas writes: > >> On Mon, Apr 17, 2017 at 4:36 PM, Bjorn Helgaas wrote: >>> From: Yongji Xie >>> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c >>> index 6901a06da2f9..b724487cbd0f 100644 >>> --- a/arch/powerpc/platforms/powernv/pci-ioda.c >>> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c >>> @@ -3287,6 +3287,11 @@ static void pnv_pci_setup_bridge(struct pci_bus *bus, unsigned long type) >>> } >>> } >>> >>> +static resource_size_t pnv_pci_default_alignment(struct pci_dev *pdev) >>> +{ >>> + return PAGE_SIZE; >>> +} >> >> Is it necessary that pcibios_default_alignment() take a pci_dev >> pointer? > > It's not necessary given the current implementation, obviously. > > But it did strike me as a good idea to pass it in case we ever want to > do anything device specific in future. > >> I'd like this better if it were: >> >> resource_size_t pcibios_default_alignment(void) { ... } >> >> because the last patch relies on the assumption that all resources of >> *all* devices will be realigned to the same alignment. > > But I guess that precludes doing anything device specific, at least > without further changes. So in that case it would be better if the API > didn't include the pci_dev. > > Hopefully Yongji can confirm that there were no plans to use the > pci_dev in future patches. > Yes, seems like pci_dev pointer doesn't match the assumption that all resources will be realigned to the same alignment. It's OK to me to remove it. Thanks, Yongji