linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Greg Kroah-Hartman <greg@kroah.com>,
	linuxppc-dev@ozlabs.org, linux-pci@atrey.karlin.mff.cuni.cz,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pci: Fix bus resource assignment on 32 bits with 64b resources
Date: Tue, 4 Dec 2007 13:39:47 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.62.0712041337530.12181@pademelon.sonytel.be> (raw)
In-Reply-To: <20071204060911.EA82BDDE19@ozlabs.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2306 bytes --]

On Tue, 4 Dec 2007, Benjamin Herrenschmidt wrote:
> The current pci_assign_unassigned_resources() code doesn't work properly
> on 32 bits platforms with 64 bits resources. The main reason is the use
> of unsigned long in various places instead of resource_size_t.
> 
> This fixes it, along with some tricks to avoid casting to 64 bits on
> platforms that don't need it in every printk around.
> 
> This is a pre-requisite for making powerpc use the generic code instead of
> its own half-useful implementation.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> 
>  drivers/pci/pci.h       |   11 +++++++++++
>  drivers/pci/setup-bus.c |   32 +++++++++++++++++---------------
>  drivers/pci/setup-res.c |    5 ++---
>  include/linux/pci.h     |    4 ++--
>  4 files changed, 32 insertions(+), 20 deletions(-)
> 
> Index: linux-work/drivers/pci/pci.h
> ===================================================================
> --- linux-work.orig/drivers/pci/pci.h	2007-12-04 17:00:43.000000000 +1100
> +++ linux-work/drivers/pci/pci.h	2007-12-04 17:02:11.000000000 +1100
> @@ -91,3 +91,14 @@ pci_match_one_device(const struct pci_de
>  }
>  
>  struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev);
> +
> +#ifdef CONFIG_RESOURCES_64BIT
> +#define RESOURCE_ORDER(order)	(1ULL << (order))
> +#define RES_PR			"%016llx"
> +#else
> +#define RESOURCE_ORDER(order)	(1UL << (order))
> +#define RES_PR			"%08lx"
> +#endif
> +
> +#define RANGE_PR		RES_PR "-" RES_PR

Can we please have them in <linux/ioport.h>? They look very useful to me
elsewhere (other bus drivers, device drivers), too.

What about naming the printf format specifier macros more like in C99, e.g.
PRI*?

With kind regards,
 
Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
 
Phone:    +32 (0)2 700 8453	
Fax:      +32 (0)2 700 8622	
E-mail:   Geert.Uytterhoeven@sonycom.com	
Internet: http://www.sony-europe.com/
 	
Sony Network and Software Technology Center Europe	
A division of Sony Service Centre (Europe) N.V.	
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium	
VAT BE 0413.825.160 · RPR Brussels	
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619

  reply	other threads:[~2007-12-04 12:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-04  6:08 [PATCH] pci: Fix bus resource assignment on 32 bits with 64b resources Benjamin Herrenschmidt
2007-12-04 12:39 ` Geert Uytterhoeven [this message]
2007-12-04 19:57   ` Benjamin Herrenschmidt
2007-12-05  2:37 ` Benjamin Herrenschmidt
2007-12-05  6:40 Benjamin Herrenschmidt
2007-12-06  3:22 ` Benjamin Herrenschmidt
2007-12-06  6:39   ` Greg KH
2007-12-06  7:58     ` Benjamin Herrenschmidt
2007-12-06  8:13       ` Geert Uytterhoeven
2007-12-06  8:16       ` Matthew Wilcox
2007-12-06 13:24         ` Kumar Gala
2007-12-06 13:35           ` Andreas Schwab
2007-12-06 22:37         ` Benjamin Herrenschmidt
2007-12-07  1:00       ` Greg KH
2007-12-09  7:16         ` Benjamin Herrenschmidt
2007-12-10  6:15 Benjamin Herrenschmidt
2007-12-10  6:19 ` Benjamin Herrenschmidt

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=Pine.LNX.4.62.0712041337530.12181@pademelon.sonytel.be \
    --to=geert.uytterhoeven@sonycom.com \
    --cc=benh@kernel.crashing.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).