Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Robert P. J. Day <rpjday@...>
Cc: Adrian Bunk <bunk@...>, Sam Ravnborg <sam@...>, Haavard Skinnemoen <hskinnemoen@...>, Linus Torvalds <torvalds@...>, Linux Kernel <linux-kernel@...>
Date: Wednesday, October 24, 2007 - 8:58 am

On Wed, Oct 24 2007, Robert P. J. Day wrote:

Completely disagree, it's well defined. The asm/ header adds the arch
private stuff, like the actual structure definition. That absolutely has
to reside there. The linux/ header adds manipulation headers for that
structure. You'd want to put that in all the asm/ headers? I didn't
think so.

So I'll repeat - arch code may use the asm/ header, if they just need
the structure definition. Drivers should use the linux/ header, since
they should also use the accessor functions. Right now there's still a
lot of open coding of

        for (i = 0; i < sg_nents; i++)
                sg_table[i] ...

usage which should go away eventually and use a

        sg = sg_table;
        do {
                ...
        } while ((sg = sg_next(sg)) != NULL);

construct, in which case there's no way around using the linux/ header.
arch IOMMU code will want to be using the linux/ header as well, since
they will be browsing the list also. That switch should happen when the
driver actually needs it, not needlessly. The problems seen in the last
few days have been code that actually use sg accessors AND don't use the
linux/ header, and that problem only showing up on archs where
linux/scatterlist.h doesn't get magically included from some other file.
That is of course a bug, you should include the header with the
functions that you use. It has nothing to do with asm/ vs linux/ include
messiness.

-- 
Jens Axboe

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Haavard Skinnemoen, (Wed Oct 24, 7:22 am)
Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Jens Axboe, (Wed Oct 24, 7:24 am)
Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Sam Ravnborg, (Wed Oct 24, 7:29 am)
Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Robert P. J. Day, (Wed Oct 24, 8:15 am)
Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Jens Axboe, (Wed Oct 24, 8:21 am)
Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Adrian Bunk, (Wed Oct 24, 8:41 am)
Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Robert P. J. Day, (Wed Oct 24, 8:44 am)
Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Jens Axboe, (Wed Oct 24, 8:58 am)
Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Jens Axboe, (Wed Oct 24, 8:45 am)
Re: [GIT PATCH] Fix asm-avr32/dma-mapping.h breakage, Jens Axboe, (Wed Oct 24, 7:58 am)