Skip to content

Commit

Permalink
uml: define CONFIG_NO_DMA
Browse files Browse the repository at this point in the history
I think that it's better to detect DMA misuse at build time rather than
calling BUG_ON.  Architectures that can't do DMA need to define
CONFIG_NO_DMA.

Thanks to Sam Ravnborg for explaining how CONFIG_NO_DMA and CONFIG_HAS_DMA
work:

http://marc.info/?l=linux-kernel&m=128359913825550&w=2

HAS_DMA is defined like this:

config HAS_DMA
        boolean
        depends on !NO_DMA
        default y

So to set HAS_DMA to true an arch should do:
1) Do not define NO_DMA
2) Define NO_DMA abd set it to 'n'

Must archs - including um - used principle 1).

In the um case we want to say that we do NOT have any DMA.
This can be done in two ways.
a) define NO_DMA and set it to 'y'
b) redefine HAS_DMA and set it to 'n'.

The patch you provided used principle b) where other archs use principle a).
So I suggest you should use principle a) for um too.

Signed-off-by: FUJITA Tomonori <[email protected]>
Cc: Miklos Szeredi <[email protected]>
Cc: Jeff Dike <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
fujita authored and torvalds committed Oct 26, 2010
1 parent 98c532e commit d911202
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 113 deletions.
3 changes: 3 additions & 0 deletions arch/um/Kconfig.um
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ config KERNEL_STACK_ORDER
This option determines the size of UML kernel stacks. They will
be 1 << order pages. The default is OK unless you're running Valgrind
on UML, in which case, set this to 3.

config NO_DMA
def_bool y
1 change: 0 additions & 1 deletion arch/um/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ CONFIG_CRC32=m
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
CONFIG_PLIST=y
CONFIG_HAS_DMA=y

#
# SCSI device support
Expand Down
112 changes: 0 additions & 112 deletions arch/um/include/asm/dma-mapping.h

This file was deleted.

0 comments on commit d911202

Please sign in to comment.