From: Yongji Xie <elohimes@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Li Zhong <zhong@linux.vnet.ibm.com>,
Alexey Kardashevskiy <aik@ozlabs.ru>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
Gavin Shan <gwshan@linux.vnet.ibm.com>,
Alex Williamson <alex.williamson@redhat.com>,
Paul Mackerras <paulus@samba.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v11 4/7] powerpc/powernv: Override pcibios_default_alignment() to force PCI devices to be page aligned
Date: Wed, 19 Apr 2017 10:12:07 +0800 [thread overview]
Message-ID: <CAONzpcaGfO5bcSdjpX4NC=Ui9oTWORaj-v1vTDUTckPC5WWjqQ@mail.gmail.com> (raw)
In-Reply-To: <87bmrt6udc.fsf@concordia.ellerman.id.au>
On 19 April 2017 at 09:47, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Bjorn Helgaas <bhelgaas@google.com> writes:
>
>> On Mon, Apr 17, 2017 at 4:36 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>>> From: Yongji Xie <elohimes@gmail.com>
>>> 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
next prev parent reply other threads:[~2017-04-19 2:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-17 21:36 [PATCH v11 0/7] PCI: Introduce a way to enforce all MMIO BARs not to share PAGE_SIZE Bjorn Helgaas
2017-04-17 21:36 ` [PATCH v11 1/7] PCI: Ignore requested alignment for IOV BARs Bjorn Helgaas
2017-04-17 21:36 ` [PATCH v11 2/7] PCI: A fix for caculating bridge window's size and alignment Bjorn Helgaas
2017-04-17 21:45 ` Yinghai Lu
2017-04-18 2:16 ` Yongji Xie
2017-04-17 21:36 ` [PATCH v11 3/7] PCI: Add pcibios_default_alignment() for arch-specific alignment control Bjorn Helgaas
2017-04-17 21:36 ` [PATCH v11 4/7] powerpc/powernv: Override pcibios_default_alignment() to force PCI devices to be page aligned Bjorn Helgaas
2017-04-18 5:30 ` Michael Ellerman
2017-04-18 13:53 ` Bjorn Helgaas
2017-04-19 1:47 ` Michael Ellerman
2017-04-19 2:12 ` Yongji Xie [this message]
2017-04-19 17:53 ` Bjorn Helgaas
2017-04-17 21:37 ` [PATCH v11 5/7] PCI: Factor pci_reassigndev_resource_alignment() Bjorn Helgaas
2017-04-17 21:37 ` [PATCH v11 6/7] PCI: Don't reassign resources that are already aligned Bjorn Helgaas
2017-04-17 21:37 ` [PATCH v11 7/7] PCI: Don't resize resources when realigning all devices in system Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAONzpcaGfO5bcSdjpX4NC=Ui9oTWORaj-v1vTDUTckPC5WWjqQ@mail.gmail.com' \
--to=elohimes@gmail.com \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=gwshan@linux.vnet.ibm.com \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=zhong@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).