From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Sam Creasey <sammy@sammy.net>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH 2/2] m68k/sun3: Dynamically allocate the table to track IOMMU use
Date: Tue, 25 Jun 2013 21:42:06 +0200 [thread overview]
Message-ID: <1372189326-12230-2-git-send-email-geert@linux-m68k.org> (raw)
In-Reply-To: <1372189326-12230-1-git-send-email-geert@linux-m68k.org>
As Sun 3 kernels cannot be multi-platform due to the different Sun 3 MMU
type, it made sense to statically allocate the table to track IOMMU use.
However, Sun 3x kernels can be multi-platform. Furthermore, Sun 3x uses
a larger table than Sun 3 (8192 bytes instead of 512 bytes).
Hence switch to dynamic allocation of this table to avoid wasting 8192
bytes when not running on a Sun 3x.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Untested due to lack of hardware
arch/m68k/sun3/sun3dvma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index ca57966..e0a3d36 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -6,6 +6,7 @@
* Contains common routines for sun3/sun3x DVMA management.
*/
+#include <linux/bootmem.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -31,7 +32,7 @@ static inline void dvma_unmap_iommu(unsigned long a, int b)
extern void sun3_dvma_init(void);
#endif
-static unsigned long iommu_use[IOMMU_TOTAL_ENTRIES];
+static unsigned long *iommu_use;
#define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT)
@@ -266,6 +267,7 @@ void __init dvma_init(void)
list_add(&(hole->list), &hole_list);
+ iommu_use = alloc_bootmem(IOMMU_TOTAL_ENTRIES * sizeof(unsigned long));
memset(iommu_use, 0, sizeof(iommu_use));
dvma_unmap_iommu(DVMA_START, DVMA_SIZE);
--
1.7.9.5
next prev parent reply other threads:[~2013-06-25 19:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 19:42 [PATCH 1/2] m68k: Mark functions only called from setup_arch() __init Geert Uytterhoeven
2013-06-25 19:42 ` Geert Uytterhoeven [this message]
2013-06-26 15:00 ` [PATCH 2/2] m68k/sun3: Dynamically allocate the table to track IOMMU use Geert Uytterhoeven
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=1372189326-12230-2-git-send-email-geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=sammy@sammy.net \
--cc=tsbogend@alpha.franken.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