Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645877 > unrolled thread

[PATCH v1 2/2] PCI: Correct PCI_STD_RESOURCE_END usage

Started byBjorn Helgaas <bhelgaas@google.com>
First post2017-05-19 22:00 +0200
Last post2017-05-24 23:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v1 2/2] PCI: Correct PCI_STD_RESOURCE_END usage Bjorn Helgaas <bhelgaas@google.com> - 2017-05-19 22:00 +0200
    Re: [PATCH v1 2/2] PCI: Correct PCI_STD_RESOURCE_END usage Bjorn Helgaas <helgaas@kernel.org> - 2017-05-24 23:50 +0200

#1645877 — [PATCH v1 2/2] PCI: Correct PCI_STD_RESOURCE_END usage

FromBjorn Helgaas <bhelgaas@google.com>
Date2017-05-19 22:00 +0200
Subject[PATCH v1 2/2] PCI: Correct PCI_STD_RESOURCE_END usage
Message-ID<tIWe6-6Zg-13@gated-at.bofh.it>
PCI_STD_RESOURCE_END is (confusingly) the index of the last valid BAR, not
the *number* of BARs.  To iterate through all possible BARs, we need to
include PCI_STD_RESOURCE_END.

Fixes: 9fe373f9997b ("PCI: Increase IBM ipr SAS Crocodile BARs to at least system page size")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/quirks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 085fb787aa9e..16e6cd86ad71 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -304,7 +304,7 @@ static void quirk_extend_bar_to_page(struct pci_dev *dev)
 {
 	int i;
 
-	for (i = 0; i < PCI_STD_RESOURCE_END; i++) {
+	for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
 		struct resource *r = &dev->resource[i];
 
 		if (r->flags & IORESOURCE_MEM && resource_size(r) < PAGE_SIZE) {

[toc] | [next] | [standalone]


#1649973

FromBjorn Helgaas <helgaas@kernel.org>
Date2017-05-24 23:50 +0200
Message-ID<tKMkj-7HS-35@gated-at.bofh.it>
In reply to#1645877
On Fri, May 19, 2017 at 02:58:55PM -0500, Bjorn Helgaas wrote:
> PCI_STD_RESOURCE_END is (confusingly) the index of the last valid BAR, not
> the *number* of BARs.  To iterate through all possible BARs, we need to
> include PCI_STD_RESOURCE_END.
> 
> Fixes: 9fe373f9997b ("PCI: Increase IBM ipr SAS Crocodile BARs to at least system page size")
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

I applied both of these to pci/misc for v4.13.

> ---
>  drivers/pci/quirks.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 085fb787aa9e..16e6cd86ad71 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -304,7 +304,7 @@ static void quirk_extend_bar_to_page(struct pci_dev *dev)
>  {
>  	int i;
>  
> -	for (i = 0; i < PCI_STD_RESOURCE_END; i++) {
> +	for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
>  		struct resource *r = &dev->resource[i];
>  
>  		if (r->flags & IORESOURCE_MEM && resource_size(r) < PAGE_SIZE) {
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web