From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbcFUErG (ORCPT ); Tue, 21 Jun 2016 00:47:06 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33917 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751380AbcFUErD (ORCPT ); Tue, 21 Jun 2016 00:47:03 -0400 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: xyjxie@linux.vnet.ibm.com X-IBM-RcptTo: linux-doc@vger.kernel.org;linux-kernel@vger.kernel.org;linux-pci@vger.kernel.org Subject: Re: [RESEND PATCH v2 1/4] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set\\ To: Bjorn Helgaas References: <1464846411-16895-1-git-send-email-xyjxie@linux.vnet.ibm.com> <1464846411-16895-2-git-send-email-xyjxie@linux.vnet.ibm.com> <20160621014346.GA30307@localhost> Cc: nikunj@linux.vnet.ibm.com, zhong@linux.vnet.ibm.com, linux-doc@vger.kernel.org, aik@ozlabs.ru, linux-pci@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org, gwshan@linux.vnet.ibm.com, warrier@linux.vnet.ibm.com, alex.williamson@redhat.com, paulus@samba.org, bhelgaas@google.com, linuxppc-dev@lists.ozlabs.org From: Yongji Xie Date: Tue, 21 Jun 2016 10:16:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160621014346.GA30307@localhost> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062102-0052-0000-0000-000001A4F9F6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062102-0053-0000-0000-0000063AAA8F Message-Id: <6b457696-5cb6-66ba-911a-fec42bb3e0d3@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-21_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606210025 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> --- >> 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 >> + } >> 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