Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a4b0fc5 authored by Jes Sorensen's avatar Jes Sorensen Committed by Linus Torvalds
Browse files

[PATCH] mspec driver build fix



Fix MSPEC driver to build for non SN2 enabled configs as the driver should
work in cached and uncached modes (no fetchop) on these systems.  In
addition make MSPEC select IA64_UNCACHED_ALLOCATOR, which is required for
it and move it to arch/ia64/Kconfig to avoid warnings on non ia64
architectures running allmodconfig.  Once the Kconfig code is fixed, we can
move it back.

Signed-off-by: default avatarJes Sorensen <jes@sgi.com>
Cc: Fernando Luis Vzquez Cao <fernando@oss.ntt.co.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d67afe5e
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -484,6 +484,15 @@ source "net/Kconfig"


source "drivers/Kconfig"
source "drivers/Kconfig"


config MSPEC
	tristate "Memory special operations driver"
	depends on IA64
	select IA64_UNCACHED_ALLOCATOR
	help
	  If you have an ia64 and you want to enable memory special
	  operations support (formerly known as fetchop), say Y here,
	  otherwise say N.

source "fs/Kconfig"
source "fs/Kconfig"


source "lib/Kconfig"
source "lib/Kconfig"
+0 −8
Original line number Original line Diff line number Diff line
@@ -409,14 +409,6 @@ config SGI_MBCS
         If you have an SGI Altix with an attached SABrick
         If you have an SGI Altix with an attached SABrick
         say Y or M here, otherwise say N.
         say Y or M here, otherwise say N.


config MSPEC
	tristate "Memory special operations driver"
	depends on IA64
	help
	  If you have an ia64 and you want to enable memory special
	  operations support (formerly known as fetchop), say Y here,
	  otherwise say N.

source "drivers/serial/Kconfig"
source "drivers/serial/Kconfig"


config UNIX98_PTYS
config UNIX98_PTYS
+7 −1
Original line number Original line Diff line number Diff line
@@ -72,7 +72,11 @@ enum {
	MSPEC_UNCACHED
	MSPEC_UNCACHED
};
};


#ifdef CONFIG_SGI_SN
static int is_sn2;
static int is_sn2;
#else
#define is_sn2		0
#endif


/*
/*
 * One of these structures is allocated when an mspec region is mmaped. The
 * One of these structures is allocated when an mspec region is mmaped. The
@@ -211,7 +215,7 @@ mspec_nopfn(struct vm_area_struct *vma, unsigned long address)
	if (vdata->type == MSPEC_FETCHOP)
	if (vdata->type == MSPEC_FETCHOP)
		paddr = TO_AMO(maddr);
		paddr = TO_AMO(maddr);
	else
	else
		paddr = __pa(TO_CAC(maddr));
		paddr = maddr & ~__IA64_UNCACHED_OFFSET;


	pfn = paddr >> PAGE_SHIFT;
	pfn = paddr >> PAGE_SHIFT;


@@ -335,6 +339,7 @@ mspec_init(void)
	 * The fetchop device only works on SN2 hardware, uncached and cached
	 * The fetchop device only works on SN2 hardware, uncached and cached
	 * memory drivers should both be valid on all ia64 hardware
	 * memory drivers should both be valid on all ia64 hardware
	 */
	 */
#ifdef CONFIG_SGI_SN
	if (ia64_platform_is("sn2")) {
	if (ia64_platform_is("sn2")) {
		is_sn2 = 1;
		is_sn2 = 1;
		if (is_shub2()) {
		if (is_shub2()) {
@@ -363,6 +368,7 @@ mspec_init(void)
			goto free_scratch_pages;
			goto free_scratch_pages;
		}
		}
	}
	}
#endif
	ret = misc_register(&cached_miscdev);
	ret = misc_register(&cached_miscdev);
	if (ret) {
	if (ret) {
		printk(KERN_ERR "%s: failed to register device %i\n",
		printk(KERN_ERR "%s: failed to register device %i\n",
+5 −1
Original line number Original line Diff line number Diff line
@@ -136,9 +136,13 @@
 */
 */
#define TO_PHYS(x)		(TO_PHYS_MASK & (x))
#define TO_PHYS(x)		(TO_PHYS_MASK & (x))
#define TO_CAC(x)		(CAC_BASE     | TO_PHYS(x))
#define TO_CAC(x)		(CAC_BASE     | TO_PHYS(x))
#ifdef CONFIG_SGI_SN
#define TO_AMO(x)		(AMO_BASE     | TO_PHYS(x))
#define TO_AMO(x)		(AMO_BASE     | TO_PHYS(x))
#define TO_GET(x)		(GET_BASE     | TO_PHYS(x))
#define TO_GET(x)		(GET_BASE     | TO_PHYS(x))

#else
#define TO_AMO(x)		({ BUG(); x; })
#define TO_GET(x)		({ BUG(); x; })
#endif


/*
/*
 * Covert from processor physical address to II/TIO physical address:
 * Covert from processor physical address to II/TIO physical address: