diff mbox

[RFC,v4,3/7] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set

Message ID 1457336918-3893-4-git-send-email-xyjxie@linux.vnet.ibm.com
State Not Applicable
Headers show

Commit Message

Yongji Xie March 7, 2016, 7:48 a.m. UTC
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>
---
 Documentation/kernel-parameters.txt |    2 ++
 drivers/pci/probe.c                 |    3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Alex Williamson March 16, 2016, 4:31 p.m. UTC | #1
On Mon,  7 Mar 2016 15:48:34 +0800
Yongji Xie <xyjxie@linux.vnet.ibm.com> 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>
> ---
>  Documentation/kernel-parameters.txt |    2 ++
>  drivers/pci/probe.c                 |    3 ++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index d8b29ab..8028631 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -2922,6 +2922,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  				windows need to be expanded.
>  				noresize: Don't change the resources' sizes when
>  				reassigning alignment.
> +				Note that this option will not work if
> +				PCI_PROBE_ONLY is set.

How would a user have any idea if this is set?

>  		ecrc=		Enable/disable PCIe ECRC (transaction layer
>  				end-to-end CRC checking).
>  				bios: Use BIOS/firmware settings. This is the
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 6d7ab9b..bc31cad 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -1719,7 +1719,8 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
>  	pci_fixup_device(pci_fixup_header, dev);
>  
>  	/* moved out from quirk header fixup code */
> -	pci_reassigndev_resource_alignment(dev);
> +	if (!pci_has_flag(PCI_PROBE_ONLY))
> +		pci_reassigndev_resource_alignment(dev);
>  
>  	/* Clear the state_saved flag. */
>  	dev->state_saved = false;

--
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
Yongji Xie March 17, 2016, 11:35 a.m. UTC | #2
On 2016/3/17 0:31, Alex Williamson wrote:
> On Mon,  7 Mar 2016 15:48:34 +0800
> Yongji Xie <xyjxie@linux.vnet.ibm.com> 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>
>> ---
>>   Documentation/kernel-parameters.txt |    2 ++
>>   drivers/pci/probe.c                 |    3 ++-
>>   2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>> index d8b29ab..8028631 100644
>> --- a/Documentation/kernel-parameters.txt
>> +++ b/Documentation/kernel-parameters.txt
>> @@ -2922,6 +2922,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>>   				windows need to be expanded.
>>   				noresize: Don't change the resources' sizes when
>>   				reassigning alignment.
>> +				Note that this option will not work if
>> +				PCI_PROBE_ONLY is set.
> How would a user have any idea if this is set?

I found the PCI_PROBE_ONLY is set on pSeries, maple and
arm with "firmware" kernel parameter enabled.

So can we say: Note that this option will not work on pSeries,
maple and arm with "firmware" kernel parameter enabled?
Or do you have any suggestion?

Thanks,
Yongji Xie

--
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
diff mbox

Patch

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index d8b29ab..8028631 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2922,6 +2922,8 @@  bytes respectively. Such letter suffixes can also be entirely omitted.
 				windows need to be expanded.
 				noresize: Don't change the resources' sizes when
 				reassigning alignment.
+				Note that this option will not work if
+				PCI_PROBE_ONLY is set.
 		ecrc=		Enable/disable PCIe ECRC (transaction layer
 				end-to-end CRC checking).
 				bios: Use BIOS/firmware settings. This is the
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 6d7ab9b..bc31cad 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1719,7 +1719,8 @@  void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
 	pci_fixup_device(pci_fixup_header, dev);
 
 	/* moved out from quirk header fixup code */
-	pci_reassigndev_resource_alignment(dev);
+	if (!pci_has_flag(PCI_PROBE_ONLY))
+		pci_reassigndev_resource_alignment(dev);
 
 	/* Clear the state_saved flag. */
 	dev->state_saved = false;