[Top] [All Lists]

Re: c17a6554 broke 64BIT_PHYS_ADDR for 32 bit systems

To: Thomas Lange <>
Subject: Re: c17a6554 broke 64BIT_PHYS_ADDR for 32 bit systems
From: Geert Uytterhoeven <>
Date: Tue, 23 Apr 2013 17:14:16 +0200
Cc: Ralf Baechle <>, Linux MIPS Mailing List <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=zMlRVKNQAuIJFAdRndSyw3mQT5SUX82fq8Ft4GR3U6I=; b=vMsRZ5clA+BEBjs8RVtEpXqQWklJ9gtU/uuaBsqF32IOF18N8Y0jOnB5QNS2JYWLAK eJ7Fidcg6e8e6z3ZCnGxx27TzjPIgVtQDiwnDNHJ0MMbGeLngbElNCNi3zzriECqWtWi wkYbrnEiuF0lQvKuW6EgmiaBSOZEaBcSs19Hlo2QRRipv8gkBSwYmdzirYOGwXV6Af8v d6Ujq913aZR2F6o9bDYzeFuysKfiHchXGjjk2YdLiFJy4yjucc/a54NfChUztuojmxmU dp7tUs6Taz3iva/3N11tYnp8ciUZ++QiXJKSkzohxRxjHC9yqxELJxl6cveFyS2QF1tv M2LQ==
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <>
On Wed, Apr 17, 2013 at 8:11 PM, Thomas Lange <> wrote:
> commit c17a6554 unintentionally(?) modified the PAGE_MASK type
> from (int) to (long unsigned int).
> This breaks ioremap (and possibly more) when using 64BIT_PHYS_ADDR on
> 32 bit systems.
> Example of failing code from ioremap.c:
>         phys_addr &= PAGE_MASK;
> Since phys_addr is 64 bit (unsigned long long) when 64BIT_PHYS_ADDR and
> PAGE_MASK is 32bit (long unsigned int), the upper 32 bits will always
> be zeroed which is not what we want/expect.
> The code above works if PAGE_MASK is a _signed_ 32bit int though.
> Some possible fixes:
> A) Simply revert the commit. Makes ioremap work again, but then PAGE_MASK
>    is a signed int. Do we really want a mask that is 'signed'?

Already fixed, cfr.



Geert Uytterhoeven -- There's lots of Linux beyond ia32 --

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

<Prev in Thread] Current Thread [Next in Thread>