Re: [PATCH] aic7xxx large integer

From: H. Peter Anvin
Date: Mon Dec 06 2004 - 16:36:55 EST


Followup to: <1102208526.6052.87.camel@localhost>
By author: Robert Love <rml@xxxxxxxxxx>
In newsgroup: linux.dev.kernel
>
> On Sun, 2004-12-05 at 00:16 +0100, Miguel Angel Flores wrote:
>
> > I post the patch very quickly :(. The original code finally seems OK. My
> > controller is not working with 39 bit addressing, although I can't find
> > why the compiler warns. Maybe the length of dma_addr_t type, in the
> > 2.6.9 the type of the mask_39bit variable is bus_addr_t.
>
> The compiler warns because you are putting a 64-bit value (an unsigned
> long long) in a 32-bit value (a u32).
>
> There is definitely a problem on non-highmem compiled kernels, there is
> no doubt of that. The concern was that your suggested fix is not right.
>
> Assuming that a 39-bit value is really wanted, the type either needs to
> be changed to a dma64_addr_t or the value needs to change at
> compile-time to a suitable 32-bit variant when !CONFIG_HIGHMEM64G.
>
> Without knowing what the driver is doing, I have no idea.
>

I suspect that what the driver wants is a mask that is a valid DMA
address no wider than 39 bits (because that's all the hardware can
do.)

If so, I would assume (dma_addr_t)0x7FFFFFFFFFULL is probably the
right thing; it will be truncated to a 32-bit mask if only 32-bit
addressing is available.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/