mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: jbarnes@virtuousgeek.org
Cc: linux-kernel@vger.kernel.org, eric@anholt.net,
	Matthew Wilcox <matthew@wil.cx>,
	Matthew Wilcox <willy@linux.intel.com>
Subject: [PATCH 2/3] PCI: Handle 64-bit resources better on 32-bit machines
Date: Mon, 28 Jul 2008 13:39:00 -0400	[thread overview]
Message-ID: <1217266741-26519-3-git-send-email-matthew@wil.cx> (raw)
In-Reply-To: <1217266741-26519-1-git-send-email-matthew@wil.cx>

If the kernel is configured to support 64-bit resources on a 32-bit
machine, we can support 64-bit BARs properly.  Just change the condition
to check sizeof(resource_size_t) instead of BITS_PER_LONG.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
---
 drivers/pci/probe.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 3b690c3..2036300 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -270,10 +270,10 @@ static int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
 		if (!sz64)
 			goto fail;
 
-		if ((BITS_PER_LONG < 64) && (sz64 > 0x100000000ULL)) {
+		if ((sizeof(resource_size_t) < 8) && (sz64 > 0x100000000ULL)) {
 			dev_err(&dev->dev, "can't handle 64-bit BAR\n");
 			goto fail;
-		} else if ((BITS_PER_LONG < 64) && l) {
+		} else if ((sizeof(resource_size_t) < 8) && l) {
 			/* Address above 32-bit boundary; disable the BAR */
 			pci_write_config_dword(dev, pos, 0);
 			pci_write_config_dword(dev, pos + 4, 0);
-- 
1.5.5.4


  parent reply	other threads:[~2008-07-28 17:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-28 17:38 pci_read_base patch series Matthew Wilcox
2008-07-28 17:38 ` [PATCH 1/3] Rewrite PCI BAR reading code Matthew Wilcox
2008-07-28 17:39 ` Matthew Wilcox [this message]
2008-07-28 21:30   ` [PATCH 2/3] PCI: Handle 64-bit resources better on 32-bit machines Jesse Barnes
2008-07-29  0:46     ` Matthew Wilcox
2008-07-28 17:39 ` [PATCH 3/3] PCI: Add pci_read_base() API Matthew Wilcox
2008-07-29  1:22   ` Zhao, Yu
2008-07-29  1:49     ` Matthew Wilcox
2008-07-29  2:36       ` Zhao, Yu
2008-08-04  6:38   ` Grant Grundler
2008-08-06 14:38     ` Matthew Wilcox
2008-08-10  0:47       ` Grant Grundler
2008-08-10  1:01         ` Matthew Wilcox

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=1217266741-26519-3-git-send-email-matthew@wil.cx \
    --to=matthew@wil.cx \
    --cc=eric@anholt.net \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@linux.intel.com \
    /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®