[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0805061317120.10091@anakin>
Date: Tue, 6 May 2008 13:17:59 +0200 (CEST)
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Michal Simek <monstr@...nam.cz>
cc: John Williams <john.williams@...alogix.com>,
linux-kernel@...r.kernel.org, arnd@...db.de,
linux-arch@...r.kernel.org, stephen.neuendorffer@...inx.com,
John.Linn@...inx.com, matthew@....cx, will.newton@...il.com,
drepper@...hat.com, microblaze-uclinux@...e.uq.edu.au,
grant.likely@...retlab.ca, Michal Simek <monstr@...str.eu>
Subject: Re: [PATCH 36/56] microblaze_v2: dma support
On Tue, 6 May 2008, Michal Simek wrote:
> > On Tue, 6 May 2008, Michal Simek wrote:
> >>> On Mon, 5 May 2008, John Williams wrote:
> >>>>> +++ b/include/asm-microblaze/scatterlist.h
> >>>>> @@ -0,0 +1,21 @@
> >>>>> +/*
> >>>>> + * include/asm-microblaze/scatterlist.h
> >>>>> + *
> >>>>> + * This file is subject to the terms and conditions of the GNU General Public
> >>>>> + * License. See the file "COPYING" in the main directory of this archive
> >>>>> + * for more details.
> >>>>> + *
> >>>>> + * Copyright (C) 2006 Atmark Techno, Inc.
> >>>>> + */
> >>>>> +
> >>>>> +#ifndef _ASM_MICROBLAZE_SCATTERLIST_H
> >>>>> +#define _ASM_MICROBLAZE_SCATTERLIST_H
> >>>>> +
> >>>>> +struct scatterlist {
> >>>>> + unsigned long page_link;
> >>>>> + unsigned int offset;
> >>>>> + dma_addr_t dma_address;
> >>>>> + unsigned int length;
> >>>>> +};
> >>>>> +
> >>>>> +#endif /* _ASM_MICROBLAZE_SCATTERLIST_H */
> >>>> Is this worthy of promotion to asm-generic/scatterlist.h?
> >>> after moving dma_address one position up in the structure, as dma_addr_t may be
> >>> 64-bit?
> >> dma_addr_t is defined in types.h. If your arch want to use 64bit addr, you can
> >> define it in types.h.
> >
> > Sorry for not making myself clear: If unsigned long and dma_addr_t are 64-bit,
> > there may be a hole in between offset and dma_address, due to alignment
> > restrictions. So it's better to move dma_address up.
> >
> > As dma_addr_t may be 64-bit even on 32-bit architectures, it may be best
> > to move it even to the start of the structure.
>
> yes, only move length is enough.
No it's not.
> struct scatterlist {
> unsigned long page_link;
> unsigned int offset;
> unsigned int length;
> dma_addr_t dma_address;
> };
If unsigned long is 32-bit but dma_addr_t is 64-bit, there may be a gap
between length and dma_address.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists