From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-kernel@vger.kernel.org, eric@anholt.net,
Matthew Wilcox <willy@linux.intel.com>
Subject: Re: [PATCH 2/3] PCI: Handle 64-bit resources better on 32-bit machines
Date: Mon, 28 Jul 2008 14:30:20 -0700 [thread overview]
Message-ID: <200807281430.20687.jbarnes@virtuousgeek.org> (raw)
In-Reply-To: <1217266741-26519-3-git-send-email-matthew@wil.cx>
On Monday, July 28, 2008 10:39 am Matthew Wilcox wrote:
> 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);
Both this and 1/3 look good, I've applied them to my for-linus tree. I'll
push them out after a little testing.
3/3 also looks nice; is there any in-tree code that could be converted over to
using it? If not, we can just push it as part of Eric's stuff.
Thanks,
Jesse
next prev parent reply other threads:[~2008-07-28 21:30 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 ` [PATCH 2/3] PCI: Handle 64-bit resources better on 32-bit machines Matthew Wilcox
2008-07-28 21:30 ` Jesse Barnes [this message]
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=200807281430.20687.jbarnes@virtuousgeek.org \
--to=jbarnes@virtuousgeek.org \
--cc=eric@anholt.net \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--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;
as well as URLs for NNTP newsgroup(s).