lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e9c3a7c20705250936n2689c1f3wce8ccb0ee4a22b9e@mail.gmail.com>
Date:	Fri, 25 May 2007 09:36:31 -0700
From:	"Dan Williams" <dan.j.williams@...el.com>
To:	"Heiko Carstens" <heiko.carstens@...ibm.com>
Cc:	"Andrew Morton" <akpm@...ux-foundation.org>,
	"John W. Linville" <linville@...driver.com>,
	"Kyle McMartin" <kyle@...isc-linux.org>,
	linux-kernel@...r.kernel.org, James.Bottomley@...eleye.com,
	"Tejun Heo" <htejun@...il.com>, "Jeff Garzik" <jeff@...zik.org>,
	"Martin Schwidefsky" <schwidefsky@...ibm.com>,
	geert@...ux-m68k.org, zippel@...ux-m68k.org, spyro@....com,
	uclinux-v850@....nec.co.jp, ysato@...rs.sourceforge.jp,
	"Cornelia Huck" <cornelia.huck@...ibm.com>
Subject: Re: [patch] Introduce CONFIG_HAS_DMA.

[ apologies for reviving an old conversation ]

On 2/26/07, Heiko Carstens <heiko.carstens@...ibm.com> wrote:
> From: Heiko Carstens <heiko.carstens@...ibm.com>
>
> Architectures that don't support DMA can say so by adding a
> config NO_DMA to their Kconfig file. This will prevent compilation
> of some dma specific driver code. Also dma-mapping-broken.h isn't
> needed anymore on at least s390.
> This avoids compilation and linking of otherwise dead/broken code.
>

I went back and read the thread leading up to this patch and I am of
the opinion that John's approach (adding more stubs to
dma-mapping-broken.h:
http://marc.info/?l=linux-kernel&m=117219377712232&w=2)  is needed in
_addition_ to this Kconfig option.  In my particular case I have an
API with a DMA and a non-DMA path written in such a way that the DMA
path can be compiled away.  Without dma-mapping-broken.h support the
API is unnecessarily forced to violate point 2 of
Documentation/SubmittingPatches (#ifdefs are ugly).

In other words let CONFIG_HAS_DMA prevent pure DMA code from being
built, but do not preclude "clever" implementations from calling
broken code.

If there are no objections I plan to resubmit John's changes with the
addition below, which allows CONFIG_HAS_DMA=n architectures to delete
their respective dma-mapping.h file.

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 9a663c6..2dc21cb 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -31,7 +31,11 @@ static inline int valid_dma_direction(int dma_direction)
                (dma_direction == DMA_FROM_DEVICE));
 }

+#ifdef CONFIG_HAS_DMA
 #include <asm/dma-mapping.h>
+#else
+#include <asm-generic/dma-mapping-broken.h>
+#endif

 /* Backwards compat, remove in 2.7.x */
 #define dma_sync_single                dma_sync_single_for_cpu
-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ