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

Commit ab4ed677 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Kill off stray HAVE_FTRACE_SYSCALLS reference.
  sh: Remove BKL from landisk gio.
  sh: disabled cache handling fix.
  sh: Fix up single page flushing to use PAGE_SIZE.
parents 4fe71dba f875295c
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -37,7 +37,6 @@ config SUPERH32
	select HAVE_FTRACE_MCOUNT_RECORD
	select HAVE_FTRACE_MCOUNT_RECORD
	select HAVE_DYNAMIC_FTRACE
	select HAVE_DYNAMIC_FTRACE
	select HAVE_FUNCTION_TRACE_MCOUNT_TEST
	select HAVE_FUNCTION_TRACE_MCOUNT_TEST
	select HAVE_FTRACE_SYSCALLS
	select HAVE_FUNCTION_GRAPH_TRACER
	select HAVE_FUNCTION_GRAPH_TRACER
	select HAVE_ARCH_KGDB
	select HAVE_ARCH_KGDB
	select ARCH_HIBERNATION_POSSIBLE if MMU
	select ARCH_HIBERNATION_POSSIBLE if MMU
+4 −6
Original line number Original line Diff line number Diff line
@@ -14,7 +14,6 @@
 */
 */
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/kdev_t.h>
#include <linux/kdev_t.h>
#include <linux/cdev.h>
#include <linux/cdev.h>
#include <linux/fs.h>
#include <linux/fs.h>
@@ -35,7 +34,7 @@ static int gio_open(struct inode *inode, struct file *filp)
	int minor;
	int minor;
	int ret = -ENOENT;
	int ret = -ENOENT;


	lock_kernel();
	preempt_disable();
	minor = MINOR(inode->i_rdev);
	minor = MINOR(inode->i_rdev);
	if (minor < DEVCOUNT) {
	if (minor < DEVCOUNT) {
		if (openCnt > 0) {
		if (openCnt > 0) {
@@ -45,7 +44,7 @@ static int gio_open(struct inode *inode, struct file *filp)
			ret = 0;
			ret = 0;
		}
		}
	}
	}
	unlock_kernel();
	preempt_enable();
	return ret;
	return ret;
}
}


@@ -60,8 +59,7 @@ static int gio_close(struct inode *inode, struct file *filp)
	return 0;
	return 0;
}
}


static int gio_ioctl(struct inode *inode, struct file *filp,
static long gio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
			     unsigned int cmd, unsigned long arg)
{
{
	unsigned int data;
	unsigned int data;
	static unsigned int addr = 0;
	static unsigned int addr = 0;
@@ -129,7 +127,7 @@ static const struct file_operations gio_fops = {
	.owner = THIS_MODULE,
	.owner = THIS_MODULE,
	.open = gio_open,	/* open */
	.open = gio_open,	/* open */
	.release = gio_close,	/* release */
	.release = gio_close,	/* release */
	.ioctl = gio_ioctl,	/* ioctl */
	.unlocked_ioctl = gio_ioctl,
};
};


static int __init gio_init(void)
static int __init gio_init(void)
+10 −12
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@
#define MAX_DCACHE_PAGES	64	/* XXX: Tune for ways */
#define MAX_DCACHE_PAGES	64	/* XXX: Tune for ways */
#define MAX_ICACHE_PAGES	32
#define MAX_ICACHE_PAGES	32


static void __flush_cache_4096(unsigned long addr, unsigned long phys,
static void __flush_cache_one(unsigned long addr, unsigned long phys,
			       unsigned long exec_offset);
			       unsigned long exec_offset);


/*
/*
@@ -89,8 +89,7 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args)
	local_irq_restore(flags);
	local_irq_restore(flags);
}
}


static inline void flush_cache_4096(unsigned long start,
static inline void flush_cache_one(unsigned long start, unsigned long phys)
				    unsigned long phys)
{
{
	unsigned long flags, exec_offset = 0;
	unsigned long flags, exec_offset = 0;


@@ -103,8 +102,7 @@ static inline void flush_cache_4096(unsigned long start,
		exec_offset = 0x20000000;
		exec_offset = 0x20000000;


	local_irq_save(flags);
	local_irq_save(flags);
	__flush_cache_4096(start | SH_CACHE_ASSOC,
	__flush_cache_one(start | SH_CACHE_ASSOC, P1SEGADDR(phys), exec_offset);
			   P1SEGADDR(phys), exec_offset);
	local_irq_restore(flags);
	local_irq_restore(flags);
}
}


@@ -129,8 +127,8 @@ static void sh4_flush_dcache_page(void *arg)


		/* Loop all the D-cache */
		/* Loop all the D-cache */
		n = boot_cpu_data.dcache.n_aliases;
		n = boot_cpu_data.dcache.n_aliases;
		for (i = 0; i < n; i++, addr += 4096)
		for (i = 0; i < n; i++, addr += PAGE_SIZE)
			flush_cache_4096(addr, phys);
			flush_cache_one(addr, phys);
	}
	}


	wmb();
	wmb();
@@ -318,11 +316,11 @@ static void sh4_flush_cache_page(void *args)
	/* We only need to flush D-cache when we have alias */
	/* We only need to flush D-cache when we have alias */
	if ((address^phys) & alias_mask) {
	if ((address^phys) & alias_mask) {
		/* Loop 4K of the D-cache */
		/* Loop 4K of the D-cache */
		flush_cache_4096(
		flush_cache_one(
			CACHE_OC_ADDRESS_ARRAY | (address & alias_mask),
			CACHE_OC_ADDRESS_ARRAY | (address & alias_mask),
			phys);
			phys);
		/* Loop another 4K of the D-cache */
		/* Loop another 4K of the D-cache */
		flush_cache_4096(
		flush_cache_one(
			CACHE_OC_ADDRESS_ARRAY | (phys & alias_mask),
			CACHE_OC_ADDRESS_ARRAY | (phys & alias_mask),
			phys);
			phys);
	}
	}
@@ -337,7 +335,7 @@ static void sh4_flush_cache_page(void *args)
		 * kernel has never executed the code through its identity
		 * kernel has never executed the code through its identity
		 * translation.
		 * translation.
		 */
		 */
		flush_cache_4096(
		flush_cache_one(
			CACHE_IC_ADDRESS_ARRAY | (address & alias_mask),
			CACHE_IC_ADDRESS_ARRAY | (address & alias_mask),
			phys);
			phys);
	}
	}
@@ -393,7 +391,7 @@ static void sh4_flush_cache_range(void *args)
}
}


/**
/**
 * __flush_cache_4096
 * __flush_cache_one
 *
 *
 * @addr:  address in memory mapped cache array
 * @addr:  address in memory mapped cache array
 * @phys:  P1 address to flush (has to match tags if addr has 'A' bit
 * @phys:  P1 address to flush (has to match tags if addr has 'A' bit
@@ -406,7 +404,7 @@ static void sh4_flush_cache_range(void *args)
 * operation (purge/write-back) is selected by the lower 2 bits of
 * operation (purge/write-back) is selected by the lower 2 bits of
 * 'phys'.
 * 'phys'.
 */
 */
static void __flush_cache_4096(unsigned long addr, unsigned long phys,
static void __flush_cache_one(unsigned long addr, unsigned long phys,
			       unsigned long exec_offset)
			       unsigned long exec_offset)
{
{
	int way_count;
	int way_count;
+10 −0
Original line number Original line Diff line number Diff line
@@ -265,6 +265,8 @@ static void __init emit_cache_params(void)


void __init cpu_cache_init(void)
void __init cpu_cache_init(void)
{
{
	unsigned int cache_disabled = !(__raw_readl(CCR) & CCR_CACHE_ENABLE);

	compute_alias(&boot_cpu_data.icache);
	compute_alias(&boot_cpu_data.icache);
	compute_alias(&boot_cpu_data.dcache);
	compute_alias(&boot_cpu_data.dcache);
	compute_alias(&boot_cpu_data.scache);
	compute_alias(&boot_cpu_data.scache);
@@ -273,6 +275,13 @@ void __init cpu_cache_init(void)
	__flush_purge_region		= noop__flush_region;
	__flush_purge_region		= noop__flush_region;
	__flush_invalidate_region	= noop__flush_region;
	__flush_invalidate_region	= noop__flush_region;


	/*
	 * No flushing is necessary in the disabled cache case so we can
	 * just keep the noop functions in local_flush_..() and __flush_..()
	 */
	if (unlikely(cache_disabled))
		goto skip;

	if (boot_cpu_data.family == CPU_FAMILY_SH2) {
	if (boot_cpu_data.family == CPU_FAMILY_SH2) {
		extern void __weak sh2_cache_init(void);
		extern void __weak sh2_cache_init(void);


@@ -312,5 +321,6 @@ void __init cpu_cache_init(void)
		sh5_cache_init();
		sh5_cache_init();
	}
	}


skip:
	emit_cache_params();
	emit_cache_params();
}
}