pandora-kernel.git
15 years agoserial: sh-sci: Handle the general UPF_IOREMAP case.
Paul Mundt [Wed, 1 Oct 2008 06:46:58 +0000 (15:46 +0900)]
serial: sh-sci: Handle the general UPF_IOREMAP case.

Presently we don't do much with UPF_IOREMAP other than special case it
for SH-5's onchip_remap() on the early console. Tie this in generically
for platforms that need the remap.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Use __raw_xxx() I/O accessors for INTC and IPR.
Paul Mundt [Wed, 1 Oct 2008 06:19:10 +0000 (15:19 +0900)]
sh: Use __raw_xxx() I/O accessors for INTC and IPR.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up the __raw_read/writeX() definitions.
Paul Mundt [Wed, 1 Oct 2008 06:12:27 +0000 (15:12 +0900)]
sh: Fix up the __raw_read/writeX() definitions.

These were doing largely bogus things and using the wrong typing for
the address. Bring these in line with the ARM definitions.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Use clk fwk for preset lpj on sh64, too.
Paul Mundt [Mon, 29 Sep 2008 11:14:44 +0000 (20:14 +0900)]
sh: Use clk fwk for preset lpj on sh64, too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: SH-5 clk fwk support.
Paul Mundt [Mon, 29 Sep 2008 11:09:17 +0000 (20:09 +0900)]
sh: SH-5 clk fwk support.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: sh_ksyms_64 needs __strncpy_from_user() definition.
Paul Mundt [Mon, 29 Sep 2008 10:45:16 +0000 (19:45 +0900)]
sh: sh_ksyms_64 needs __strncpy_from_user() definition.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up signal_64 cast warnings.
Paul Mundt [Mon, 29 Sep 2008 10:44:40 +0000 (19:44 +0900)]
sh: Fix up signal_64 cast warnings.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up uaccess_64 put/get_user() cast warnings.
Paul Mundt [Mon, 29 Sep 2008 10:43:44 +0000 (19:43 +0900)]
sh: Fix up uaccess_64 put/get_user() cast warnings.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Force pending restarted system calls to return -EINTR.
Paul Mundt [Wed, 24 Sep 2008 05:37:35 +0000 (14:37 +0900)]
sh: Force pending restarted system calls to return -EINTR.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: ap325rxa: create CPLD data area in mtd
Nobuhiro Iwamatsu [Wed, 24 Sep 2008 02:46:48 +0000 (11:46 +0900)]
sh: ap325rxa: create CPLD data area in mtd

AP320 and AP325RXA has CPLD data in NOR Flash.
If this area erased, this board can not boot.
This patch create CPLD data area and set writeable mask bit.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add FPU registers to regset interface.
Paul Mundt [Sun, 21 Sep 2008 10:04:55 +0000 (19:04 +0900)]
sh: Add FPU registers to regset interface.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add missing asm/ftrace.h.
Paul Mundt [Sun, 21 Sep 2008 08:17:53 +0000 (17:17 +0900)]
sh: Add missing asm/ftrace.h.

This was missed with the ftrace support commit.. check it in now.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agodoc: Add remaining SH parameters to kernel-parameters.txt.
Paul Mundt [Sun, 21 Sep 2008 08:14:42 +0000 (17:14 +0900)]
doc: Add remaining SH parameters to kernel-parameters.txt.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: ftrace support.
Paul Mundt [Sun, 21 Sep 2008 07:43:45 +0000 (16:43 +0900)]
sh: ftrace support.

This adds support for ftrace to SH. This only includes CONFIG_FTRACE,
and does not handle dynamic ftrace presently.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Trivial trace_mark() instrumentation for core events.
Paul Mundt [Sun, 21 Sep 2008 04:56:39 +0000 (13:56 +0900)]
sh: Trivial trace_mark() instrumentation for core events.

This implements a few trace points across events that are deemed
interesting. This implements a number of trace points:

- The page fault handler / TLB miss
- IPC calls
- Kernel thread creation

The original LTTng patch had the slow-path instrumented, which
fails to account for the vast majority of events. In general
placing this in the fast-path is not a huge performance hit, as
we don't take page faults for kernel addresses.

The other bits of interest are some of the other trap handlers, as
well as the syscall entry/exit (which is better off being handled
through the tracehook API). Most of the other trap handlers are corner
cases where alternate means of notification exist, so there is little
value in placing extra trace points in these locations.

Based on top of the points provided both by the LTTng instrumentation
patch as well as the patch shipping in the ST-Linux tree, albeit in a
stripped down form.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Kill off duplicate page fault notifiers in slow path.
Paul Mundt [Sun, 21 Sep 2008 03:11:25 +0000 (12:11 +0900)]
sh: Kill off duplicate page fault notifiers in slow path.

We already have hooks in place in the __do_page_fault() fast-path,
so kill them off in the slow path.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Look up the trap vector for the page fault notifier.
Paul Mundt [Sun, 21 Sep 2008 03:06:43 +0000 (12:06 +0900)]
sh: Look up the trap vector for the page fault notifier.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Move lookup_exception_vector() out to asm/system_32.h.
Paul Mundt [Sun, 21 Sep 2008 03:00:23 +0000 (12:00 +0900)]
sh: Move lookup_exception_vector() out to asm/system_32.h.

There are other places where we want to have access to the trap/exception
number, so move out the lookup_exception_vector() helper. While we're at
it, refactor it slightly to return the vector instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: edosk7760: Correct size of bootloader flash partition.
Luca Santini [Sun, 21 Sep 2008 01:32:29 +0000 (10:32 +0900)]
sh: edosk7760: Correct size of bootloader flash partition.

This is 256K instead of 1M.

[ Converted to use asm/sizes.h. -- PFM ]

Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add a few more definitions to asm/sizes.h.
Paul Mundt [Sun, 21 Sep 2008 01:31:57 +0000 (10:31 +0900)]
sh: Add a few more definitions to asm/sizes.h.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Copy in asm/sizes.h helper from ARM.
Paul Mundt [Sun, 21 Sep 2008 01:24:18 +0000 (10:24 +0900)]
sh: Copy in asm/sizes.h helper from ARM.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Support kernel stacks smaller than a page.
Paul Mundt [Sat, 20 Sep 2008 11:21:33 +0000 (20:21 +0900)]
sh: Support kernel stacks smaller than a page.

This follows the powerpc commit f6a616800e68b61807d0f7bb0d5dc70665ef8046
'[POWERPC] Fix kernel stack allocation alignment'.

SH has traditionally forced the thread order to be relative to the page
size, so there were never any situations where the same bug was
triggered by slub. Regardless, the usage of > 8kB stacks for the larger
page sizes is overkill, so we switch to using slab allocations there,
as per the powerpc change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Disable 4kB stacks when using PAGE_SIZE_64KB.
Paul Mundt [Sat, 20 Sep 2008 11:16:35 +0000 (20:16 +0900)]
sh: Disable 4kB stacks when using PAGE_SIZE_64KB.

This combination triggers a divide by zero in kernel/fork.c when
calculating the initial max_threads value:

max_threads = mempages / (8 * THREAD_SIZE / PAGE_SIZE);

Simply disable 4K stacks on 64kB PAGE_SIZE to work around this,
as it's not a terribly useful combination to begin with.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: HAVE_IOREMAP_PROT depends on MMU.
Paul Mundt [Wed, 17 Sep 2008 14:26:44 +0000 (23:26 +0900)]
sh: HAVE_IOREMAP_PROT depends on MMU.

HAVE_IOREMAP_PROT enables an unconditional reference to
generic_access_phys(), which remains undefined in the nommu case.
As there's no point in supporting this there anyways, simply fix
up the dependency.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up headers_check regression.
Paul Mundt [Wed, 17 Sep 2008 14:24:59 +0000 (23:24 +0900)]
sh: Fix up headers_check regression.

linux/mmzone.h isn't exported, kill it off from asm/setup.h and simply
deal with it in the places that have a dependency instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Consolidate struct sh_cpuinfo definitions across _32/_64 split.
Paul Mundt [Wed, 17 Sep 2008 14:24:02 +0000 (23:24 +0900)]
sh: Consolidate struct sh_cpuinfo definitions across _32/_64 split.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up signal_64 conflicting handle_signal() definition.
Paul Mundt [Wed, 17 Sep 2008 14:14:36 +0000 (23:14 +0900)]
sh: Fix up signal_64 conflicting handle_signal() definition.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Make memory hot-add and hot-remove depend on MMU.
Paul Mundt [Wed, 17 Sep 2008 14:13:27 +0000 (23:13 +0900)]
sh: Make memory hot-add and hot-remove depend on MMU.

Cleans up link numerous build issues with page migration and so on when
enabled on nommu builds.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up fpu emu build.
Paul Mundt [Wed, 17 Sep 2008 14:12:11 +0000 (23:12 +0900)]
sh: Fix up fpu emu build.

The addition of the kprobes code pushed down a variable declaration,
clean it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: latencytop support.
Paul Mundt [Fri, 12 Sep 2008 16:44:03 +0000 (01:44 +0900)]
sh: latencytop support.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Tidy up ELF core dumps.
Paul Mundt [Fri, 12 Sep 2008 14:27:46 +0000 (23:27 +0900)]
sh: Tidy up ELF core dumps.

These have been using overrides for ELF_CORE_COPY_TASK_REGS and
ELF_CORE_COPY_FPREGS while the generic versions can be used instead.
Presently the pt_regs are also duplicated across elf_core_copy_regs()
and elf_core_copy_task_regs(), this switches to simply copying out
through elf_core_copy_regs() instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Check SR.DSP bit for DSP regset validity.
Paul Mundt [Fri, 12 Sep 2008 13:56:35 +0000 (22:56 +0900)]
sh: Check SR.DSP bit for DSP regset validity.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add missing task_user_regset_view() definition.
Paul Mundt [Fri, 12 Sep 2008 13:42:43 +0000 (22:42 +0900)]
sh: Add missing task_user_regset_view() definition.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add DSP registers to regset interface.
Paul Mundt [Fri, 12 Sep 2008 13:42:10 +0000 (22:42 +0900)]
sh: Add DSP registers to regset interface.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up NUMA build error with se7722_defconfig.
Paul Mundt [Fri, 12 Sep 2008 13:41:30 +0000 (22:41 +0900)]
sh: Fix up NUMA build error with se7722_defconfig.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Enable HAVE_ARCH_TRACEHOOK.
Paul Mundt [Fri, 12 Sep 2008 13:13:36 +0000 (22:13 +0900)]
sh: Enable HAVE_ARCH_TRACEHOOK.

Now that the rest of the support requirements are out of the way, finally
enable support for tracehook.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Provide the asm/syscall.h interface, needed by tracehook.
Paul Mundt [Fri, 12 Sep 2008 13:13:13 +0000 (22:13 +0900)]
sh: Provide the asm/syscall.h interface, needed by tracehook.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: provide user_stack_pointer(), needed for tracehook support.
Paul Mundt [Fri, 12 Sep 2008 13:11:36 +0000 (22:11 +0900)]
sh: provide user_stack_pointer(), needed for tracehook support.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Flag T-bit for syscall restart.
Paul Mundt [Fri, 12 Sep 2008 13:08:20 +0000 (22:08 +0900)]
sh: Flag T-bit for syscall restart.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: ioremap_prot support.
Paul Mundt [Fri, 12 Sep 2008 11:41:05 +0000 (20:41 +0900)]
sh: ioremap_prot support.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: ptrace: Introduce user_regset interface for gp regs.
Paul Mundt [Fri, 12 Sep 2008 10:52:36 +0000 (19:52 +0900)]
sh: ptrace: Introduce user_regset interface for gp regs.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Provide a fixed UTS_MACHINE definition for sh64.
Paul Mundt [Fri, 12 Sep 2008 09:58:28 +0000 (18:58 +0900)]
sh: Provide a fixed UTS_MACHINE definition for sh64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: update edosk7760 defconfig for physmap-flash.
Luca Santini [Fri, 12 Sep 2008 09:08:01 +0000 (18:08 +0900)]
sh: update edosk7760 defconfig for physmap-flash.

Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: edosk7760 physmap-flash support.
Luca Santini [Fri, 12 Sep 2008 09:07:16 +0000 (18:07 +0900)]
sh: edosk7760 physmap-flash support.

Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agortc-sh: Unsigned rtc->{periodic,carry,alarm}_irq cannot be negative
roel kluin [Wed, 10 Sep 2008 17:34:44 +0000 (19:34 +0200)]
rtc-sh: Unsigned rtc->{periodic,carry,alarm}_irq cannot be negative

possibly since commit b420b1a7a17ea88531d0e12b2f2679a0c8365803

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh_eth: unsigned ndev->irq cannot be negative
roel kluin [Wed, 10 Sep 2008 17:22:44 +0000 (19:22 +0200)]
sh_eth: unsigned ndev->irq cannot be negative

unsigned ndev->irq cannot be negative

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: intc_prio_data() test before subtraction on unsigned
roel kluin [Tue, 9 Sep 2008 21:02:43 +0000 (23:02 +0200)]
sh: intc_prio_data() test before subtraction on unsigned

bit is unsigned, so test before subtraction

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: kprobes: kretprobe_trampoline needs to be global.
Paul Mundt [Mon, 8 Sep 2008 23:13:28 +0000 (08:13 +0900)]
sh: kprobes: kretprobe_trampoline needs to be global.

Needed by CONFIG_TRACING.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add R2D+ defconfig for qemu system emulator.
Paul Mundt [Mon, 8 Sep 2008 21:15:47 +0000 (06:15 +0900)]
sh: Add R2D+ defconfig for qemu system emulator.

This adds a defconfig for the R2D+ target in the qemu system emulator.
Eventually it will be possible to simply use the r2d+ defconfig as it is.

Provided by Shin-ichiro KAWASAKI.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Derive calibrate_delay lpj from clk fwk.
Paul Mundt [Mon, 8 Sep 2008 11:47:42 +0000 (20:47 +0900)]
sh: Derive calibrate_delay lpj from clk fwk.

All CPUs must have a sensible cpu_clk definition these days, which we can
safely use for deriving the preset loops_per_jiffy. The only odd one out
is SH-5, which hasn't been hammered in to the framework yet.

Based on the ST patch.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Carl Shaw <carl.shaw@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: kprobes: __kprobes annotations and formatting cleanups.
Paul Mundt [Mon, 8 Sep 2008 09:22:47 +0000 (18:22 +0900)]
sh: kprobes: __kprobes annotations and formatting cleanups.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: kprobes: Fix up race against probe point removal.
Paul Mundt [Mon, 8 Sep 2008 09:15:55 +0000 (18:15 +0900)]
sh: kprobes: Fix up race against probe point removal.

Handle a corner case where another CPU or debugger removes the probe
point from underneath us.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: kprobes: Fix up a preemption imbalance on jprobe return.
Paul Mundt [Mon, 8 Sep 2008 09:14:50 +0000 (18:14 +0900)]
sh: kprobes: Fix up a preemption imbalance on jprobe return.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: kprobes: Default to NOTIFY_DONE for unhandled debug traps.
Paul Mundt [Mon, 8 Sep 2008 09:12:33 +0000 (18:12 +0900)]
sh: kprobes: Default to NOTIFY_DONE for unhandled debug traps.

Presently this is doing a force_sig() SIGTRAP, which is already taken
care of in the generic code if no one asserts NOTIFY_STOP. Switch the
default return to NOTIFY_DONE in the case of unhandled traps, so that
the same trap may pass through to other users on the same die chain.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: kprobes: Use trapa #0x3a for breakpoint trap.
Paul Mundt [Mon, 8 Sep 2008 09:10:10 +0000 (18:10 +0900)]
sh: kprobes: Use trapa #0x3a for breakpoint trap.

Not all parts support trapa #0xff, so use something within the debug trap
range that's accessible on all parts.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: kprobes: Hook up kprobe_fault_handler() in the page fault path.
Paul Mundt [Mon, 8 Sep 2008 03:22:47 +0000 (12:22 +0900)]
sh: kprobes: Hook up kprobe_fault_handler() in the page fault path.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Disable seccomp support by default.
Paul Mundt [Mon, 8 Sep 2008 03:10:35 +0000 (12:10 +0900)]
sh: Disable seccomp support by default.

This was initially checked in with a stupid default of y, while most
everyone is going to want to have this disabled anyways.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Mark kretprobe_trampoline_holder static and __used.
Paul Mundt [Mon, 8 Sep 2008 03:02:17 +0000 (12:02 +0900)]
sh: Mark kretprobe_trampoline_holder static and __used.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add EDOSK7760 mach type.
Paul Mundt [Mon, 8 Sep 2008 03:01:55 +0000 (12:01 +0900)]
sh: Add EDOSK7760 mach type.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add Renesas EDOSK7760 board support.
Luca Santini [Mon, 8 Sep 2008 03:01:15 +0000 (12:01 +0900)]
sh: Add Renesas EDOSK7760 board support.

This adds support for the Renesas (RTE) EDOSK7760 board. Currently
supported devices are:

 - ramdisk support
 - ethernet support
 - nfs support
 - ext2/ext3 support
 - i2c support
 - fb support (M)

Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Enable IRLM mode for SH7760 IRQ_MODE_IRQ.
Luca Santini [Mon, 8 Sep 2008 02:54:56 +0000 (11:54 +0900)]
sh: Enable IRLM mode for SH7760 IRQ_MODE_IRQ.

Follows the same setting as SH7750.

Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: uninline flush_icache_all().
Paul Mundt [Fri, 5 Sep 2008 09:00:29 +0000 (18:00 +0900)]
sh: uninline flush_icache_all().

This uses jump_to_uncached() which is now given the noinline attribute
due to the special section mapping. Kill off the inline attribute to
fix up compilation failure.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add the rest of the boot targets to arch/sh/boot/.gitignore.
Paul Mundt [Fri, 5 Sep 2008 08:27:37 +0000 (17:27 +0900)]
sh: Add the rest of the boot targets to arch/sh/boot/.gitignore.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add kprobes support.
Chris Smith [Fri, 5 Sep 2008 08:15:39 +0000 (17:15 +0900)]
sh: Add kprobes support.

Initial support for kprobes/kretprobes for 32-bit SH platforms.

[ General cleanup and some rework for the kretprobe hash lock. -- PFM ]

Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: remove unnecessary memset after alloc_bootmem_low_pages
Marek Skuczynski [Fri, 5 Sep 2008 07:42:58 +0000 (16:42 +0900)]
sh: remove unnecessary memset after alloc_bootmem_low_pages

Because alloc_bootmem functions return the allocated memory always
zeroed, an additional call of memset on allocated memory is
unnecessary.

Signed-off-by: Marek Skuczynski <M.Skuczynski@adbglobal.com>
Signed-off-by: Carl Shaw <carl.shaw@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: fix the TMU code to allow a fully running NO_HZ system
Francesco Virlinzi [Fri, 5 Sep 2008 07:40:22 +0000 (16:40 +0900)]
sh: fix the TMU code to allow a fully running NO_HZ system

This patch fixes the TMU code to allow NO_HZ to work on sh

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Subnormal double to float conversion
Carl Shaw [Fri, 5 Sep 2008 07:36:19 +0000 (16:36 +0900)]
sh: Subnormal double to float conversion

This patch adds support for the SH4 to convert a subnormal double
into a float by catching the FPE and implementing the FCNVDS
instruction in software.

Signed-off-by: Carl Shaw <carl.shaw@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix an unusual memory initialisation error.
Stuart Menefy [Fri, 5 Sep 2008 07:29:40 +0000 (16:29 +0900)]
sh: Fix an unusual memory initialisation error.

This fixes a problems with the set up of Linux memory:

 - When reserving memory at boot time, the code previously reserved
   the bottom page of memory, and then from one page up to the end of
   the bootmap. This had the desired effect, but was strictly speaking
   wrong, as the one page was actually whatever CONFIG_ZERO_PAGE_OFFSET
   had been set to.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix uImage load address in 32-bit mode.
Chris Smith [Fri, 5 Sep 2008 07:24:13 +0000 (16:24 +0900)]
sh: Fix uImage load address in 32-bit mode.

Fix "make uImage" load and entry addresses in 32-bit mode.

Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: vmalloc pgtable sync fix.
Stuart Menefy [Fri, 5 Sep 2008 07:17:15 +0000 (16:17 +0900)]
sh: vmalloc pgtable sync fix.

This fixes a problem in the code which copies the vmalloc portion of the
kernel's page table into the current user space page table. The addition
of the four level page table code breaks on folded page tables, because
the pud level is always present (although folded). This updates the code
to use the same style of updates for the pud as is used for the pgd
level.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up broken 32-bit initrd support.
Stuart Menefy [Fri, 5 Sep 2008 07:14:17 +0000 (16:14 +0900)]
sh: Fix up broken 32-bit initrd support.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: early cached_to_uncached initialization.
Stuart Menefy [Fri, 5 Sep 2008 07:06:42 +0000 (16:06 +0900)]
sh: early cached_to_uncached initialization.

statically initialise the cached_to_uncached offset, so that we can use
it immediatly.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add support for memory hot-remove.
Paul Mundt [Fri, 5 Sep 2008 06:39:12 +0000 (15:39 +0900)]
sh: Add support for memory hot-remove.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Don't enable clockevents broadcasting on UP SH-X3 builds.
Paul Mundt [Fri, 5 Sep 2008 06:36:39 +0000 (15:36 +0900)]
sh: Don't enable clockevents broadcasting on UP SH-X3 builds.

Fixes up compile errors with missing timer definitions. It's pointless to
have this enabled anyways if CONFIG_SMP=n.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: fixup many sparse errors.
Paul Mundt [Thu, 4 Sep 2008 09:53:58 +0000 (18:53 +0900)]
sh: fixup many sparse errors.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Display CPU information in show_regs().
Paul Mundt [Thu, 7 Aug 2008 16:23:34 +0000 (01:23 +0900)]
sh: Display CPU information in show_regs().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Early dummy clockevent registration on boot CPU.
Paul Mundt [Thu, 7 Aug 2008 16:18:48 +0000 (01:18 +0900)]
sh: Early dummy clockevent registration on boot CPU.

The dummy timer needs to be registered on the boot CPU before the
system timer clockevent is registered, or broadcasting doesn't work
as advertized.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: smp: shove a cpu_relax() in the plat_start_cpu() busy loop.
Paul Mundt [Wed, 6 Aug 2008 09:39:32 +0000 (18:39 +0900)]
sh: smp: shove a cpu_relax() in the plat_start_cpu() busy loop.

Without this, certain versions of GCC will happily optimize the entire
loop out.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: generic clockevent broadcast support.
Paul Mundt [Wed, 6 Aug 2008 09:37:07 +0000 (18:37 +0900)]
sh: generic clockevent broadcast support.

This hooks up GENERIC_CLOCKEVENTS_BROADCAST and a dummy local timer,
which we call in to from the timer IPI when no other local timer is
provided.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: smp: Hook up a timer IPI stub.
Paul Mundt [Wed, 6 Aug 2008 09:21:03 +0000 (18:21 +0900)]
sh: smp: Hook up a timer IPI stub.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: smp: Hook in to the generic IPI handler for SH-X3 SMP.
Paul Mundt [Wed, 6 Aug 2008 09:05:09 +0000 (18:05 +0900)]
sh: smp: Hook in to the generic IPI handler for SH-X3 SMP.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: smp: Provide a generic IPI handler.
Paul Mundt [Wed, 6 Aug 2008 09:02:48 +0000 (18:02 +0900)]
sh: smp: Provide a generic IPI handler.

This provides a generic smp_message_recv() routine (based on the PPC
one), that IPI IRQs can wrap in to.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Kill off unused defines from asm/smp.h.
Paul Mundt [Wed, 6 Aug 2008 08:29:14 +0000 (17:29 +0900)]
sh: Kill off unused defines from asm/smp.h.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Provide movli.l/movco.l-based cmpxchg.
Paul Mundt [Thu, 7 Aug 2008 09:01:43 +0000 (18:01 +0900)]
sh: Provide movli.l/movco.l-based cmpxchg.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Provide movli.l/movco.l-based bitops.
Paul Mundt [Thu, 7 Aug 2008 08:36:12 +0000 (17:36 +0900)]
sh: Provide movli.l/movco.l-based bitops.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Sun, 7 Sep 2008 04:47:30 +0000 (21:47 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: i8042 - make Lenovo 3000 N100 blacklist entry more specific
  Input: bcm5974 - add BTN_TOUCH event for mousedev benefit
  Input: bcm5974 - improve finger tracking and counting
  Input: bcm5974 - small formatting cleanup
  Input: bcm5974 - add maintainer entry

15 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 7 Sep 2008 02:36:23 +0000 (19:36 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: cpu_init(): fix memory leak when using CPU hotplug
  x86: pda_init(): fix memory leak when using CPU hotplug
  x86, xen: Use native_pte_flags instead of native_pte_val for .pte_flags
  x86: move mtrr cpu cap setting early in early_init_xxxx
  x86: delay early cpu initialization until cpuid is done
  x86: use X86_FEATURE_NOPL in alternatives
  x86: add NOPL as a synthetic CPU feature bit
  x86: boot: stub out unimplemented CPU feature words

15 years agoMerge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 7 Sep 2008 02:33:26 +0000 (19:33 -0700)]
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  clocksource, acpi_pm.c: check for monotonicity
  clocksource, acpi_pm.c: use proper read function also in errata mode
  ntp: fix calculation of the next jiffie to trigger RTC sync
  x86: HPET: read back compare register before reading counter
  x86: HPET fix moronic 32/64bit thinko
  clockevents: broadcast fixup possible waiters
  HPET: make minimum reprogramming delta useful
  clockevents: prevent endless loop lockup
  clockevents: prevent multiple init/shutdown
  clockevents: enforce reprogram in oneshot setup
  clockevents: prevent endless loop in periodic broadcast handler
  clockevents: prevent clockevent event_handler ending up handler_noop

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Sun, 7 Sep 2008 02:33:10 +0000 (19:33 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  Fix CONFIG_AC97_BUS dependency

15 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Sun, 7 Sep 2008 02:32:21 +0000 (19:32 -0700)]
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Probe initrd header only if explicitly specified
  [MIPS] TX39xx: Add missing local_flush_icache_range initialization
  [MIPS] TXx9: Fix txx9_pcode initialization
  [MIPS] Fix WARNING: at kernel/smp.c:290
  [MIPS] Fix data bus error recovery

15 years agox86: cpu_init(): fix memory leak when using CPU hotplug
Andreas Herrmann [Wed, 6 Aug 2008 08:29:37 +0000 (10:29 +0200)]
x86: cpu_init(): fix memory leak when using CPU hotplug

Exception stacks are allocated each time a CPU is set online.
But the allocated space is never freed. Thus with one CPU hotplug
offline/online cycle there is a memory leak of 24K (6 pages) for
a CPU.

Fix is to allocate exception stacks only once -- when the CPU is
set online for the first time.

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: akpm@linux-foundation.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: pda_init(): fix memory leak when using CPU hotplug
Andreas Herrmann [Wed, 6 Aug 2008 08:27:30 +0000 (10:27 +0200)]
x86: pda_init(): fix memory leak when using CPU hotplug

pda->irqstackptr is allocated whenever a CPU is set online.
But it is never freed. This results in a memory leak of 16K
for each CPU offline/online cycle.

Fix is to allocate pda->irqstackptr only once.

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: akpm@linux-foundation.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, xen: Use native_pte_flags instead of native_pte_val for .pte_flags
Eduardo Habkost [Thu, 24 Jul 2008 15:15:45 +0000 (12:15 -0300)]
x86, xen: Use native_pte_flags instead of native_pte_val for .pte_flags

Using native_pte_val triggers the BUG_ON() in the paravirt_ops
version of pte_flags().

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: move mtrr cpu cap setting early in early_init_xxxx
Yinghai Lu [Thu, 4 Sep 2008 19:09:43 +0000 (21:09 +0200)]
x86: move mtrr cpu cap setting early in early_init_xxxx

Krzysztof Helt found MTRR is not detected on k6-2

root cause:
we moved mtrr_bp_init() early for mtrr trimming,
and in early_detect we only read the CPU capability from cpuid,
so some cpu doesn't have that bit in cpuid.

So we need to add early_init_xxxx to preset those bit before mtrr_bp_init
for those earlier cpus.

this patch is for v2.6.27

Reported-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: delay early cpu initialization until cpuid is done
Krzysztof Helt [Thu, 4 Sep 2008 19:09:43 +0000 (21:09 +0200)]
x86: delay early cpu initialization until cpuid is done

Move early cpu initialization after cpu early get cap so the
early cpu initialization can fix up cpu caps.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoclocksource, acpi_pm.c: check for monotonicity
Dominik Brodowski [Fri, 5 Sep 2008 21:05:35 +0000 (14:05 -0700)]
clocksource, acpi_pm.c: check for monotonicity

The current check for monotonicity is way too weak: Andreas Mohr reports (
http://lkml.org/lkml/2008/8/10/77 ) that on one of his test systems the
current check only triggers in 50% of all cases, leading to catastrophic
timer behaviour.  To fix this issue, expand the check for monotonicity by
doing ten consecutive tests instead of one.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoclocksource, acpi_pm.c: use proper read function also in errata mode
Dominik Brodowski [Fri, 5 Sep 2008 21:05:33 +0000 (14:05 -0700)]
clocksource, acpi_pm.c: use proper read function also in errata mode

On all hardware (some Intel ICH4, PIIX4 and PIIX4E chipsets) affected by a
hardware errata there's about a 4.2% chance that initialization of the
ACPI PMTMR fails.  On those chipsets, we need to read out the timer value
at least three times to get a correct result, for every once in a while
(i.e.  within a 3 ns window every 69.8 ns) the read returns a bogus
result.  During normal operation we work around this issue, but during
initialization reading a bogus value may lead to -EINVAL even though the
hardware is usable.

Thanks to Andreas Mohr for spotting this issue.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agontp: fix calculation of the next jiffie to trigger RTC sync
Maciej W. Rozycki [Fri, 5 Sep 2008 21:05:31 +0000 (14:05 -0700)]
ntp: fix calculation of the next jiffie to trigger RTC sync

We have a bug in the calculation of the next jiffie to trigger the RTC
synchronisation.  The aim here is to run sync_cmos_clock() as close as
possible to the middle of a second.  Which means we want this function to
be called less than or equal to half a jiffie away from when now.tv_nsec
equals 5e8 (500000000).

If this is not the case for a given call to the function, for this purpose
instead of updating the RTC we calculate the offset in nanoseconds to the
next point in time where now.tv_nsec will be equal 5e8.  The calculated
offset is then converted to jiffies as these are the unit used by the
timer.

Hovewer timespec_to_jiffies() used here uses a ceil()-type rounding mode,
where the resulting value is rounded up.  As a result the range of
now.tv_nsec when the timer will trigger is from 5e8 to 5e8 + TICK_NSEC
rather than the desired 5e8 - TICK_NSEC / 2 to 5e8 + TICK_NSEC / 2.

As a result if for example sync_cmos_clock() happens to be called at the
time when now.tv_nsec is between 5e8 + TICK_NSEC / 2 and 5e8 to 5e8 +
TICK_NSEC, it will simply be rescheduled HZ jiffies later, falling in the
same range of now.tv_nsec again.  Similarly for cases offsetted by an
integer multiple of TICK_NSEC.

This change addresses the problem by subtracting TICK_NSEC / 2 from the
nanosecond offset to the next point in time where now.tv_nsec will be
equal 5e8, effectively shifting the following rounding in
timespec_to_jiffies() so that it produces a rounded-to-nearest result.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoFix CONFIG_AC97_BUS dependency
Takashi Iwai [Sat, 6 Sep 2008 09:43:41 +0000 (11:43 +0200)]
Fix CONFIG_AC97_BUS dependency

CONFIG_AC97_BUS is used from both sound and ucb1400 drivers.
The recent change in Kconfig introduced the exclusive dependency on
CONFIG_SOUND, and disabled the ucb1400 build without sound.
This patch makes CONFIG_AC97_BUS independent.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
15 years agox86: HPET: read back compare register before reading counter
Thomas Gleixner [Sat, 6 Sep 2008 01:06:08 +0000 (03:06 +0200)]
x86: HPET: read back compare register before reading counter

After fixing the u32 thinko I sill had occasional hickups on ATI chipsets
with small deltas. There seems to be a delay between writing the compare
register and the transffer to the internal register which triggers the
interrupt. Reading back the value makes sure, that it hit the internal
match register befor we compare against the counter value.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>