mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jeff Chua <jeff.chua.linux@gmail.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>, Greg KH <gregkh@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Broken] PCI: clean up resource alignment management
Date: Wed, 23 Apr 2008 01:40:50 +0400	[thread overview]
Message-ID: <20080422214050.GA1166@jurassic.park.msu.ru> (raw)
In-Reply-To: <alpine.LFD.1.10.0804221020470.2779@woody.linux-foundation.org>

On Tue, Apr 22, 2008 at 10:25:34AM -0700, Linus Torvalds wrote:
> On Wed, 23 Apr 2008, Jeff Chua wrote:
> > yenta_cardbus 0000:15:00.0: device not available because of BAR 7 [100:1ff] collisions
> > yenta_cardbus: probe of 0000:15:00.0 failed with error -16
> 
> I suspect there wasn't a _real_ collision there, but the allocation failed 
> because of the alignment bits not being set up right for cardbus bridges, 
> but I'm not seeing the bug right now.
> 
> Ivan?

Yes, exactly. My fault - I somehow missed the cardbus stuff...

The patch below should fix that.

Ivan.

---
PCI: make resource_alignment() work for cardbus bridges

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
---
 drivers/pci/setup-bus.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index f9b7bdd..dbd80db 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -418,11 +418,11 @@ static void pci_bus_size_cardbus(struct pci_bus *bus)
 	 */
 	b_res[0].start = pci_cardbus_io_size;
 	b_res[0].end = b_res[0].start + pci_cardbus_io_size - 1;
-	b_res[0].flags |= IORESOURCE_IO;
+	b_res[0].flags |= IORESOURCE_IO | IORESOURCE_STARTALIGN;
 
 	b_res[1].start = pci_cardbus_io_size;
 	b_res[1].end = b_res[1].start + pci_cardbus_io_size - 1;
-	b_res[1].flags |= IORESOURCE_IO;
+	b_res[1].flags |= IORESOURCE_IO | IORESOURCE_STARTALIGN;
 
 	/*
 	 * Check whether prefetchable memory is supported
@@ -443,15 +443,16 @@ static void pci_bus_size_cardbus(struct pci_bus *bus)
 	if (ctrl & PCI_CB_BRIDGE_CTL_PREFETCH_MEM0) {
 		b_res[2].start = pci_cardbus_mem_size;
 		b_res[2].end = b_res[2].start + pci_cardbus_mem_size - 1;
-		b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH;
+		b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH |
+				  IORESOURCE_STARTALIGN;
 
 		b_res[3].start = pci_cardbus_mem_size;
 		b_res[3].end = b_res[3].start + pci_cardbus_mem_size - 1;
-		b_res[3].flags |= IORESOURCE_MEM;
+		b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_STARTALIGN;
 	} else {
 		b_res[3].start = pci_cardbus_mem_size * 2;
 		b_res[3].end = b_res[3].start + pci_cardbus_mem_size * 2 - 1;
-		b_res[3].flags |= IORESOURCE_MEM;
+		b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_STARTALIGN;
 	}
 }
 

  reply	other threads:[~2008-04-22 21:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <b6a2187b0804220943l26f7b441sb5a7309dff0e84dc@mail.gmail.com>
2008-04-22 16:44 ` Jeff Chua
2008-04-22 17:25 ` Linus Torvalds
2008-04-22 21:40   ` Ivan Kokshaysky [this message]
2008-04-22 21:59     ` Linus Torvalds
2008-04-22 22:13       ` Linus Torvalds
2008-04-22 22:51         ` Jesse Barnes
2008-04-23  1:06           ` Linus Torvalds
2008-04-23  1:05       ` Jeff Chua
2008-04-23  1:26         ` Linus Torvalds
2008-04-23  1:46           ` Jeff Chua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080422214050.GA1166@jurassic.park.msu.ru \
    --to=ink@jurassic.park.msu.ru \
    --cc=gregkh@suse.de \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jeff.chua.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®