All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] efi/fb: Correct PCI_STD_RESOURCE_END usage
@ 2017-05-19 19:58 Bjorn Helgaas
  2017-05-19 19:58 ` [PATCH v1 2/2] PCI: " Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2017-05-19 19:58 UTC (permalink / raw)
  To: linux-pci
  Cc: Douglas Lehr, Milton Miller, Anton Blanchard, linux-kernel,
	Ard Biesheuvel

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: 55d728a40d36 ("efi/fb: Avoid reconfiguration of BAR that covers the framebuffer")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/video/fbdev/efifb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index b827a8113e26..ff01bed7112f 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -408,7 +408,7 @@ static void efifb_fixup_resources(struct pci_dev *dev)
 	if (!base)
 		return;
 
-	for (i = 0; i < PCI_STD_RESOURCE_END; i++) {
+	for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
 		struct resource *res = &dev->resource[i];
 
 		if (!(res->flags & IORESOURCE_MEM))

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v1 2/2] PCI: Correct PCI_STD_RESOURCE_END usage
  2017-05-19 19:58 [PATCH v1 1/2] efi/fb: Correct PCI_STD_RESOURCE_END usage Bjorn Helgaas
@ 2017-05-19 19:58 ` Bjorn Helgaas
  2017-05-24 21:43   ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2017-05-19 19:58 UTC (permalink / raw)
  To: linux-pci
  Cc: Douglas Lehr, Milton Miller, Anton Blanchard, linux-kernel,
	Ard Biesheuvel

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) {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 2/2] PCI: Correct PCI_STD_RESOURCE_END usage
  2017-05-19 19:58 ` [PATCH v1 2/2] PCI: " Bjorn Helgaas
@ 2017-05-24 21:43   ` Bjorn Helgaas
  0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2017-05-24 21:43 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, Douglas Lehr, Milton Miller, Anton Blanchard,
	linux-kernel, Ard Biesheuvel

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) {
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-24 21:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 19:58 [PATCH v1 1/2] efi/fb: Correct PCI_STD_RESOURCE_END usage Bjorn Helgaas
2017-05-19 19:58 ` [PATCH v1 2/2] PCI: " Bjorn Helgaas
2017-05-24 21:43   ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.