From: Yinghai Lu <yinghai@kernel.org>
To: Matthew Wilcox <matthew@wil.cx>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
grundler@parisc-linux.org, mingo@elte.hu, tglx@linutronix.de,
hpa@zytor.com, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH] pci: print out DMA mask info
Date: Fri, 10 Oct 2008 09:46:33 -0700 [thread overview]
Message-ID: <48EF86E9.8030408@kernel.org> (raw)
In-Reply-To: <20081010163350.GF25780@parisc-linux.org>
Matthew Wilcox wrote:
>
> By the way, commit 8f286c33f1e838d631f4a3260b33efce4bc5973c is a really
> bad idea. It is very helpful to see which bitmasks are used by real
> devices, and which ones aren't. It should be reverted, IMO.
>
why? did you point to wrong commit?
commit 8f286c33f1e838d631f4a3260b33efce4bc5973c
Author: Andrew Morton <akpm@linux-foundation.org>
Date: Thu Oct 18 03:05:07 2007 -0700
stop using DMA_xxBIT_MASK
Now that we have DMA_BIT_MASK(), these macros are pointless.
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 29b0285..101a2d4 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -13,9 +13,15 @@ enum dma_data_direction {
DMA_NONE = 3,
};
-#define DMA_BIT_MASK(n) ((1ULL<<(n))-1)
+#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
-#define DMA_64BIT_MASK (~0ULL)
+/*
+ * NOTE: do not use the below macros in new code and do not add new definitions
+ * here.
+ *
+ * Instead, just open-code DMA_BIT_MASK(n) within your driver
+ */
+#define DMA_64BIT_MASK DMA_BIT_MASK(64)
#define DMA_48BIT_MASK DMA_BIT_MASK(48)
#define DMA_47BIT_MASK DMA_BIT_MASK(47)
#define DMA_40BIT_MASK DMA_BIT_MASK(40)
next prev parent reply other threads:[~2008-10-10 16:48 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 23:02 [PATCH] pci: print out DMA mask info Yinghai Lu
2008-10-09 21:18 ` Grant Grundler
2008-10-09 21:27 ` Yinghai Lu
2008-10-09 21:35 ` Matthew Wilcox
2008-10-09 21:51 ` Yinghai Lu
2008-10-09 22:55 ` Grant Grundler
2008-10-09 23:05 ` Yinghai Lu
2008-10-10 2:40 ` FUJITA Tomonori
2008-10-10 4:56 ` Yinghai Lu
2008-10-10 6:08 ` FUJITA Tomonori
2008-10-10 6:32 ` Yinghai Lu
2008-10-10 7:32 ` FUJITA Tomonori
2008-10-12 7:16 ` Grant Grundler
2008-10-10 22:45 ` Grant Grundler
2008-10-14 6:50 ` FUJITA Tomonori
2008-10-12 7:11 ` Grant Grundler
2008-10-23 1:45 ` [PATCH] pci: show dma_mask bits in /sys Yinghai Lu
2008-10-23 3:28 ` Matthew Wilcox
2008-10-23 4:19 ` Yinghai Lu
2008-10-23 6:44 ` Grant Grundler
2008-10-23 8:38 ` Rolf Eike Beer
2008-10-23 15:39 ` Greg KH
2008-10-23 18:37 ` H. Peter Anvin
2008-10-23 19:36 ` Grant Grundler
2008-10-23 19:49 ` Greg KH
2008-10-24 10:50 ` Andi Kleen
2008-11-01 17:10 ` Grant Grundler
2008-10-23 6:48 ` Grant Grundler
2008-10-23 6:51 ` Yinghai Lu
2008-10-23 19:28 ` Grant Grundler
2008-10-10 2:40 ` [PATCH] pci: print out DMA mask info FUJITA Tomonori
2008-10-10 2:59 ` FUJITA Tomonori
2008-10-10 2:40 ` FUJITA Tomonori
2008-10-10 15:48 ` Jesse Barnes
2008-10-10 16:19 ` Yinghai Lu
2008-10-10 16:28 ` Jesse Barnes
2008-10-10 16:33 ` Matthew Wilcox
2008-10-10 16:46 ` Yinghai Lu [this message]
2008-10-10 17:12 ` Matthew Wilcox
2008-10-10 17:18 ` Roland Dreier
2008-10-12 7:38 ` Grant Grundler
2008-10-12 7:20 ` Grant Grundler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48EF86E9.8030408@kernel.org \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=grundler@parisc-linux.org \
--cc=hpa@zytor.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox