From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f177.google.com ([209.85.128.177]:33829 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968773AbdDSRyQ (ORCPT ); Wed, 19 Apr 2017 13:54:16 -0400 Received: by mail-wr0-f177.google.com with SMTP id z109so20680607wrb.1 for ; Wed, 19 Apr 2017 10:54:15 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: 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: Bjorn Helgaas Date: Wed, 19 Apr 2017 12:53:54 -0500 Message-ID: Subject: Re: [PATCH v11 4/7] powerpc/powernv: Override pcibios_default_alignment() to force PCI devices to be page aligned To: Yongji Xie Cc: Michael Ellerman , 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 Tue, Apr 18, 2017 at 9:12 PM, Yongji Xie wrote: > 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. I made this change (removing the pci_dev parameter) on my pci/resource branch. Bjorn