Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1427458
| From | Yongji Xie <xyjxie@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RESEND PATCH v2 1/4] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set\\ |
| Date | 2016-06-21 10:40 +0200 |
| Message-ID | <rMpnY-3mT-41@gated-at.bofh.it> (permalink) |
| References | <rFtPI-1W8-7@gated-at.bofh.it> <rFtZn-2eE-17@gated-at.bofh.it> <rMiZb-7y9-21@gated-at.bofh.it> <rMlNn-12h-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 2016/6/21 10:16, Yongji Xie wrote:
> On 2016/6/21 9:43, Bjorn Helgaas wrote:
>
>> On Thu, Jun 02, 2016 at 01:46:48PM +0800, Yongji Xie wrote:
>>> The resource_alignment will releases memory resources allocated
>>> by firmware so that kernel can reassign new resources later on.
>>> But this will cause the problem that no resources can be
>>> allocated by kernel if PCI_PROBE_ONLY was set, e.g. on pSeries
>>> platform because PCI_PROBE_ONLY force kernel to use firmware
>>> setup and not to reassign any resources.
>>>
>>> To solve this problem, this patch ignores resource_alignment
>>> if PCI_PROBE_ONLY was set.
>>>
>>> Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
>>> ---
>>> drivers/pci/pci.c | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>>
>>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>>> index c8b4dbd..a259394 100644
>>> --- a/drivers/pci/pci.c
>>> +++ b/drivers/pci/pci.c
>>> @@ -4761,6 +4761,12 @@ static resource_size_t
>>> pci_specified_resource_alignment(struct pci_dev *dev)
>>> spin_lock(&resource_alignment_lock);
>>> p = resource_alignment_param;
>>> while (*p) {
>>> + if (pci_has_flag(PCI_PROBE_ONLY)) {
>>> + printk(KERN_ERR "PCI: Ignore resource_alignment
>>> parameter: %s with PCI_PROBE_ONLY set\n",
>>> + p);
>>> + *p = 0;
>>> + break;
>> Wouldn't it be simpler to make pci_set_resource_alignment_param() fail
>> if PCI_PROBE_ONLY is set?
>
> I add the check here because I want to print some logs so that users
> could know the reason why resource_alignment doesn't work when
> they add this parameter.
>
> Thanks,
> Yongji
>
Sorry, please ignore the previous reply. I didn't add this check in
pci_set_resource_alignment_param() because PCI_PROBE_ONLY
may be set after we parse "resource_alignment".
And it seems that printk_once() may be better here so that
we don't need to set *p = 0.
Thanks,
Yongji
>>> + }
>>> count = 0;
>>> if (sscanf(p, "%d%n", &align_order, &count) == 1 &&
>>> p[count] == '@') {
>>> --
>>> 1.7.9.5
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [RESEND PATCH v2 1/4] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set\\ Bjorn Helgaas <helgaas@kernel.org> - 2016-06-21 03:50 +0200
Re: [RESEND PATCH v2 1/4] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set\\ Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-06-21 06:50 +0200
Re: [RESEND PATCH v2 1/4] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set\\ Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-06-21 10:40 +0200
csiph-web