linux-2.6
18 years agosh: __addr_ok() and other misc nommu fixups.
Yoshinori Sato [Wed, 27 Sep 2006 08:25:07 +0000 (17:25 +0900)] 
sh: __addr_ok() and other misc nommu fixups.

A few more outstanding nommu fixups..

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: __NR_restart_syscall support.
Paul Mundt [Wed, 27 Sep 2006 08:22:49 +0000 (17:22 +0900)] 
sh: __NR_restart_syscall support.

This implements support for __NR_restart_syscall.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Various nommu fixes.
Yoshinori Sato [Wed, 27 Sep 2006 08:21:02 +0000 (17:21 +0900)] 
sh: Various nommu fixes.

This fixes up some of the various outstanding nommu bugs on
SH.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Make PAGE_OFFSET configurable.
Paul Mundt [Wed, 27 Sep 2006 08:19:13 +0000 (17:19 +0900)] 
sh: Make PAGE_OFFSET configurable.

nommu needs to be able to shift PAGE_OFFSET, so we switch it to a
non-user-visible CONFIG_PAGE_OFFSET and use that in the few places
where it matters.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Move voyagergx_reg.h to a more sensible place.
Paul Mundt [Wed, 27 Sep 2006 08:17:27 +0000 (17:17 +0900)] 
sh: Move voyagergx_reg.h to a more sensible place.

Other boards require this as well, so move it out of the
rts7751r2d directory.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: math-emu support
Takashi YOSHII [Wed, 27 Sep 2006 08:15:32 +0000 (17:15 +0900)] 
sh: math-emu support

This implements initial math-emu support, aimed primarily at SH-3.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agortc: New RTC driver for SuperH On-Chip RTC.
Paul Mundt [Wed, 27 Sep 2006 08:13:19 +0000 (17:13 +0900)] 
rtc: New RTC driver for SuperH On-Chip RTC.

This replaces the old SH RTC driver, and allows us to
clean quite a lot of things up on the board-specific
side.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Rename rtc_get/set_time() to avoid RTC_CLASS conflict.
Paul Mundt [Wed, 27 Sep 2006 08:11:32 +0000 (17:11 +0900)] 
sh: Rename rtc_get/set_time() to avoid RTC_CLASS conflict.

We have a clash with RTC_CLASS over these names, so we
change them..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fixup __strnlen_user() behaviour.
Paul Mundt [Wed, 27 Sep 2006 08:07:07 +0000 (17:07 +0900)] 
sh: Fixup __strnlen_user() behaviour.

Drop TIF_USERSPACE and add addr_limit to the thread_info struct.
Subsequently, use that for address checking in strnlen_user() to
ward off bogus -EFAULTs.

Make __strnlen_user() return 0 on exception, rather than -EFAULT.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: More cosmetic cleanups and trivial fixes.
Paul Mundt [Wed, 27 Sep 2006 08:03:56 +0000 (17:03 +0900)] 
sh: More cosmetic cleanups and trivial fixes.

Nothing exciting here, just trivial fixes..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fixup TEI IRQ requests in request_dma().
Paul Mundt [Wed, 27 Sep 2006 07:55:24 +0000 (16:55 +0900)] 
sh: Fixup TEI IRQ requests in request_dma().

If a channel is not TEI capable, don't try to request_irq()..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: G2 DMA IRQ and residue sampling.
Paul Mundt [Wed, 27 Sep 2006 07:53:40 +0000 (16:53 +0900)] 
sh: G2 DMA IRQ and residue sampling.

This fixes a long-standing FIXME for G2 DMA, where we finally
wire up the IRQ handler and allow for sampling remaining bytes
while in-flight.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: VoyagerGX cleanups and 8250 UART support.
Paul Mundt [Wed, 27 Sep 2006 07:48:46 +0000 (16:48 +0900)] 
sh: VoyagerGX cleanups and 8250 UART support.

This adds the VoyagerGX UART to the RTS7751R2D setup
code, and cleans up a few build issues.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Inhibit mapping PCI apertures through page tables.
Paul Mundt [Wed, 27 Sep 2006 07:45:22 +0000 (16:45 +0900)] 
sh: Inhibit mapping PCI apertures through page tables.

Inhibit mapping through page tables in __ioremap() for PCI memory
apertures on SH7751 and SH7780-style PCI controllers, translation is
not possible for these areas. For other users that map a small window
in P1/P2 space, ioremap() traps that already, and should never make
it to __ioremap().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Consolidated SH7751/SH7780 PCI support.
Paul Mundt [Wed, 27 Sep 2006 07:43:28 +0000 (16:43 +0900)] 
sh: Consolidated SH7751/SH7780 PCI support.

This cleans up quite a lot of the PCI mess that we
currently have, and attempts to consolidate the
duplication in the SH7780 and SH7751 PCI controllers.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agoserial: Rework sh-sci for driver model.
Paul Mundt [Wed, 27 Sep 2006 07:32:13 +0000 (16:32 +0900)] 
serial: Rework sh-sci for driver model.

sh-sci was turning in to an unmaintainable mess, especially with
regards to the port list. This cleans it up quite a bit, and
switches over to a platform device model where subtypes will
register their port list individually in their setup code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: kgdb stub cleanups.
Paul Mundt [Wed, 27 Sep 2006 07:24:55 +0000 (16:24 +0900)] 
sh: kgdb stub cleanups.

Some kgdb cleanup. Move hexchars/highhex/lowhex to the header, so it can
be reused by sh-sci. Also drop silly ctrl_inl/outl() overloading being
done by the kgdb stub.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Use generic CONFIG_FRAME_POINTER.
Paul Mundt [Wed, 27 Sep 2006 07:22:33 +0000 (16:22 +0900)] 
sh: Use generic CONFIG_FRAME_POINTER.

We had our own version, which serves no purpose. Simply
hook SH in to the generic one.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: APM/PM support.
Andriy Skulysh [Wed, 27 Sep 2006 07:20:22 +0000 (16:20 +0900)] 
sh: APM/PM support.

This adds some simple PM stubs and the basic APM interfaces,
primarily for use by hp6xx, where the existing userland
expects it.

Signed-off-by: Andriy Skulysh <askulysh@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Free up some and document PTEL flags.
Paul Mundt [Wed, 27 Sep 2006 07:17:17 +0000 (16:17 +0900)] 
sh: Free up some and document PTEL flags.

Drop _PAGE_SHARED/_PAGE_U0_SHARED and document Linux PTE encodings in
the PTEL value. Preserve the swap cache entry encoding semantics for
now, though it will need rework to free up _PAGE_WT from _PAGE_FILE.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Update new-machine.txt so it's more accurate.
Paul Mundt [Wed, 27 Sep 2006 07:15:48 +0000 (16:15 +0900)] 
sh: Update new-machine.txt so it's more accurate.

This fell behind a bit, get it updated so the documentation
has something in common with reality.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: SE73180 updates for IRQ changes.
Paul Mundt [Wed, 27 Sep 2006 07:14:54 +0000 (16:14 +0900)] 
sh: SE73180 updates for IRQ changes.

SE73180 can use the generic support, we just need to
wire up the IRQ demuxing.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agovideo: Update header location in hp680_bl.
Andriy Skulysh [Wed, 27 Sep 2006 07:09:59 +0000 (16:09 +0900)] 
video: Update header location in hp680_bl.

Trivial build fix.

Signed-off-by: Andriy Skulysh <askulysh@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Make O= builds work again.
Paul Mundt [Wed, 27 Sep 2006 07:08:24 +0000 (16:08 +0900)] 
sh: Make O= builds work again.

Some of the paths were a bit broken, fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: xchg()/__xchg() always_inline fixes for gcc4.
Paul Mundt [Wed, 27 Sep 2006 07:05:56 +0000 (16:05 +0900)] 
sh: xchg()/__xchg() always_inline fixes for gcc4.

Make __xchg() a macro, so that gcc 4.0 doesn't blow up thanks to
always_inline..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Drop incdir rule for SE7751.
Paul Mundt [Wed, 27 Sep 2006 07:04:51 +0000 (16:04 +0900)] 
sh: Drop incdir rule for SE7751.

No longer needed..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agovideo: Update pvr2fb for sq API changes.
Paul Mundt [Wed, 27 Sep 2006 07:03:25 +0000 (16:03 +0900)] 
video: Update pvr2fb for sq API changes.

With the store queue API rework, we need to change the in-kernel
users too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Cleanup and document register bank usage.
Paul Mundt [Wed, 27 Sep 2006 07:01:12 +0000 (16:01 +0900)] 
sh: Cleanup and document register bank usage.

Initial register bank cleanup. Make SR.RB configurable, and add some
preliminary documentation on register bank usage within the kernel.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Add support for R7780RP and R7780MP boards.
Paul Mundt [Wed, 27 Sep 2006 06:59:17 +0000 (15:59 +0900)] 
sh: Add support for R7780RP and R7780MP boards.

This adds support for the Renesas SH7780 development boards,
R7780RP and R7780MP.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Store Queue API rework.
Paul Mundt [Wed, 27 Sep 2006 06:49:57 +0000 (15:49 +0900)] 
sh: Store Queue API rework.

Rewrite the store queue API for a per-cpu interface in the driver
model. The old miscdevice is dropped, due to TASK_SIZE limitations,
and no one was using it anyways.

Carve up and allocate store queue space with a bitmap, back sq
mapping objects with a slab cache, and let userspace worry about
its own prefetching.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Board updates for I/O routine rework.
Paul Mundt [Wed, 27 Sep 2006 06:41:24 +0000 (15:41 +0900)] 
sh: Board updates for I/O routine rework.

This updates the various boards for some of the recent I/O routine
updates.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fix split ptlock for user mappings in __do_page_fault().
Paul Mundt [Wed, 27 Sep 2006 06:30:24 +0000 (15:30 +0900)] 
sh: Fix split ptlock for user mappings in __do_page_fault().

There was a bug that got introduced when the split ptlock changes
went in where mm could be unintialized for user mappings, this
fixes it up..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fixup SHMLBA definition for SH7705.
Paul Mundt [Wed, 27 Sep 2006 06:29:18 +0000 (15:29 +0900)] 
sh: Fixup SHMLBA definition for SH7705.

We need this set to something sensible anywhere were we have
an aliasing dcache..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: ioremap() overhaul.
Paul Mundt [Wed, 27 Sep 2006 06:16:42 +0000 (15:16 +0900)] 
sh: ioremap() overhaul.

ioremap() overhaul. Add support for transparent PMB mapping, get rid of
p3_ioremap(), etc. Also drop ioremap() and iounmap() routines from the
machvec, as everyone can use the generic ioremap() API instead. For PCI
memory apertures and other special cases, use the pci_iomap() API, as
boards are already required to get the mapping right there.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: page table alloc cleanups and page fault optimizations.
Paul Mundt [Wed, 27 Sep 2006 06:13:36 +0000 (15:13 +0900)] 
sh: page table alloc cleanups and page fault optimizations.

Cleanup of page table allocators, using generic folded PMD and PUD
helpers. TLB flushing operations are moved to a more sensible spot.

The page fault handler is also optimized slightly, we no longer waste
cycles on IRQ disabling for flushing of the page from the ITLB, since
we're already under CLI protection by the initial exception handler.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: export clear_user_page() for the modules that need it.
Paul Mundt [Wed, 27 Sep 2006 06:09:48 +0000 (15:09 +0900)] 
sh: export clear_user_page() for the modules that need it.

Some modules seem to need this, so we export it..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: SH-4A Privileged Space Mapping Buffer (PMB) support.
Paul Mundt [Wed, 27 Sep 2006 06:08:07 +0000 (15:08 +0900)] 
sh: SH-4A Privileged Space Mapping Buffer (PMB) support.

Add support for 32-bit physical addressing through the SH-4A
Privileged Space Mapping Buffer (PMB).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Titan board support.
Jamie Lenehan [Wed, 27 Sep 2006 06:05:39 +0000 (15:05 +0900)] 
sh: Titan board support.

Add support for the titan board.

Signed-off-by: Jamie Lenehan <lenehan@twibble.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: BSS init bugfix and barrier in entry point.
Paul Mundt [Wed, 27 Sep 2006 06:00:04 +0000 (15:00 +0900)] 
sh: BSS init bugfix and barrier in entry point.

A synco is needed before we jump to start_kernel().

While we're at it, also move the sh_cpu_init() jump until after
we've zeroed BSS, as this has caused some undesirable results
in sh_cpu_init().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Add control register barriers.
Paul Mundt [Wed, 27 Sep 2006 05:57:44 +0000 (14:57 +0900)] 
sh: Add control register barriers.

Currently when making changes to control registers, we
typically need some time for changes to take effect (8
nops, generally).  However, for sh4a we simply need to
do an icbi..

This is a simple patch for implementing a general purpose
ctrl_barrier() which functions as a control register write
barrier. There's some additional documentation in the patch
itself, but it's pretty self explanatory.

There were also some places where we were not doing the
barrier, which didn't seem to have any adverse effects on
legacy parts, but certainly did on sh4a. It's safer to have
the barrier in place for legacy parts as well in these cases,
though this does make flush_tlb_all() more expensive (by an
order of 8 nops).  We can ifdef around the flush_tlb_all()
case for now if it's clear that all legacy parts won't have
a problem with this.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Add flag for MMU PTEA capability.
Paul Mundt [Wed, 27 Sep 2006 05:55:41 +0000 (14:55 +0900)] 
sh: Add flag for MMU PTEA capability.

Add CPU_HAS_PTEA, refactor some of the cpu flag settings.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: landisk board support.
kogiidena [Wed, 27 Sep 2006 05:53:35 +0000 (14:53 +0900)] 
sh: landisk board support.

This adds support for the I-O DATA Landisk.

Signed-off-by: kogiidena <kogiidena@eggplant.ddo.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fix libata build.
Paul Mundt [Wed, 27 Sep 2006 05:48:09 +0000 (14:48 +0900)] 
sh: Fix libata build.

Drop virt_to_bus() from sg_dma_address() so libata builds.
While we're at it, move sg_dma_address() and sg_dma_len()
from pci.h to scatterlist.h.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fix TCP payload csum bug in csum_partial_copy_generic().
Ollie Wild [Wed, 27 Sep 2006 05:46:24 +0000 (14:46 +0900)] 
sh: Fix TCP payload csum bug in csum_partial_copy_generic().

There's a bug in the Hitachi SuperH csum_partial_copy_generic()
implementation.  If the supplied length is 1 (and several alignment
conditions are met), the function immediately branches to label 4.
However, the assembly at label 4 expects the length to be stored in
register r2.  Since this has not occurred, subsequent behavior is
undefined.

This can cause bad payload checksums in TCP connections.

I've fixed the problem by initializing register r2 prior to the branch
instruction.

Signed-off-by: Ollie Wild <aaw@rincewind.tv>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fix fatal oops in copy_user_page() on sh4a (SH7780).
Paul Mundt [Wed, 27 Sep 2006 05:38:02 +0000 (14:38 +0900)] 
sh: Fix fatal oops in copy_user_page() on sh4a (SH7780).

We had a pretty interesting oops happening, where copy_user_page()
was down()'ing p3map_sem[] with a bogus offset (particularly, an
offset that hadn't been initialized with sema_init(), due to the
mismatch between cpu_data->dcache.n_aliases and what was assumed
based off of the old CACHE_ALIAS value).

Luckily, spinlock debugging caught this for us, and so we drop
the old hardcoded CACHE_ALIAS for sh4 completely and rely on the
run-time probed cpu_data->dcache.alias_mask. This in turn gets
the p3map_sem[] index right, and everything works again.

While we're at it, also convert to 4-level page tables..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Wire up new syscalls.
Paul Mundt [Wed, 27 Sep 2006 05:36:44 +0000 (14:36 +0900)] 
sh: Wire up new syscalls.

The syscall table has lagged behind a bit, wire up the new ones..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: remove cpu_online() definition from <asm/smp.h>
Alexey Dobriyan [Wed, 27 Sep 2006 05:32:57 +0000 (14:32 +0900)] 
sh: remove cpu_online() definition from <asm/smp.h>

It's defined in <linux/cpumask.h> and log is horribly flooded by
"redefined" messages.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Support for SH7770/SH7780 CPU subtypes.
Paul Mundt [Wed, 27 Sep 2006 05:31:40 +0000 (14:31 +0900)] 
sh: Support for SH7770/SH7780 CPU subtypes.

Merge support for SH7770 and SH7780 SH-4A subtypes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Add SH7750S/SH7091 rules for SH7750 oprofile driver.
Paul Mundt [Wed, 27 Sep 2006 05:30:11 +0000 (14:30 +0900)] 
sh: Add SH7750S/SH7091 rules for SH7750 oprofile driver.

Update oprofile build rules for additional subtypes,
particularly SH7750S/SH7091.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: earlyprintk= support and cleanups.
Paul Mundt [Wed, 27 Sep 2006 05:26:53 +0000 (14:26 +0900)] 
sh: earlyprintk= support and cleanups.

Allow multiple early printk consoles via earlyprintk=.

With this change earlyprintk is no longer enabled by default,
it must be specified on the kernel command line. Optionally
with ,keep to prevent unreg by tty_io.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: prefetch()/prefetchw() support.
Paul Mundt [Wed, 27 Sep 2006 05:20:54 +0000 (14:20 +0900)] 
sh: prefetch()/prefetchw() support.

SH-2/3/4 are able to prefetch, add support for it..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fix a sign extension bug in memset().
Toshinobu Sugioka [Wed, 27 Sep 2006 05:13:14 +0000 (14:13 +0900)] 
sh: Fix a sign extension bug in memset().

Minor sign-extension bug in SH-specific memset()..

Signed-off-by: Toshinobu Sugioka <sugioka@itonet.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Refactor PRR masking to catch newer SH7760 cuts.
Paul Mundt [Wed, 27 Sep 2006 05:11:33 +0000 (14:11 +0900)] 
sh: Refactor PRR masking to catch newer SH7760 cuts.

Newer SH7760 cuts have a range of acceptable PRR values..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Optimized cache handling for SH-4/SH-4A caches.
Richard Curnow [Wed, 27 Sep 2006 05:09:26 +0000 (14:09 +0900)] 
sh: Optimized cache handling for SH-4/SH-4A caches.

This reworks some of the SH-4 cache handling code to more easily
accomodate newer-style caches (particularly for the > direct-mapped
case), as well as optimizing some of the old code.

Signed-off-by: Richard Curnow <richard.curnow@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Support for SH-4A memory barriers.
Paul Mundt [Wed, 27 Sep 2006 05:05:52 +0000 (14:05 +0900)] 
sh: Support for SH-4A memory barriers.

SH-4A supports 'synco' as a barrier, sprinkle it around
the cache ops as necessary..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: RTS7751R2D board updates.
Paul Mundt [Wed, 27 Sep 2006 05:02:09 +0000 (14:02 +0900)] 
sh: RTS7751R2D board updates.

More of the same, trivial cleanups, and moving options to their
own board-specific Kconfig.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: HS7751RVoIP board updates.
Paul Mundt [Wed, 27 Sep 2006 04:56:28 +0000 (13:56 +0900)] 
sh: HS7751RVoIP board updates.

Various cleanups for HS7751RVoIP. Mostly just getting
rid of the old mach.c and splitting codec configuration
in to its own Kconfig.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosound: SH DAC audio driver updates.
Andriy Skulysh [Wed, 27 Sep 2006 04:48:32 +0000 (13:48 +0900)] 
sound: SH DAC audio driver updates.

Update the SH DAC audio driver for the clock framework.

Signed-off-by: Andriy Skulysh <askulysh@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agovideo: hitfb suspend/resume and updates.
Andriy Skulysh [Wed, 27 Sep 2006 04:47:22 +0000 (13:47 +0900)] 
video: hitfb suspend/resume and updates.

suspend/resume support for hitfb, as well as some other
minor cleanups.

Signed-off-by: Andriy Skulysh <askulysh@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Move hd64461.h to a more sensible location.
Paul Mundt [Wed, 27 Sep 2006 04:42:57 +0000 (13:42 +0900)] 
sh: Move hd64461.h to a more sensible location.

With the I/O rework for hd64461 we're down to a single header,
so move it by itself and get rid of the directory.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fixup TMU_TOCR definition for SH7300.
Paul Mundt [Wed, 27 Sep 2006 04:30:08 +0000 (13:30 +0900)] 
sh: Fixup TMU_TOCR definition for SH7300.

SH7300 has a different TMU_TOCR, make the TMU code work again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Kill off dead code for SE and SystemH boards.
Paul Mundt [Wed, 27 Sep 2006 04:28:23 +0000 (13:28 +0900)] 
sh: Kill off dead code for SE and SystemH boards.

Some of these have suffered some bitrot, and so there is
some degree of dead code that has been left sitting around,
clean it up..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agovideo: Disable vgacon for SuperH.
Paul Mundt [Wed, 27 Sep 2006 04:20:22 +0000 (13:20 +0900)] 
video: Disable vgacon for SuperH.

We don't support this on SH, so just disable it..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: hugetlb updates.
Paul Mundt [Wed, 27 Sep 2006 04:11:57 +0000 (13:11 +0900)] 
sh: hugetlb updates.

For some of the larger sizes we permitted spanning pages
across several PTEs, but this turned out to not be generally
useful. This reverts the sh hugetlbpage interface to something
more sensible using huge pages at single PTE granularity.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: hp6xx mach-type cleanups.
Andriy Skulysh [Wed, 27 Sep 2006 04:07:38 +0000 (13:07 +0900)] 
sh: hp6xx mach-type cleanups.

Some minor cleanups for the updated consolidated hp6xx
mach-type.

Signed-off-by: Andriy Skulysh <askulysh@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Various cosmetic cleanups.
Paul Mundt [Wed, 27 Sep 2006 03:31:01 +0000 (12:31 +0900)] 
sh: Various cosmetic cleanups.

We had quite a bit of whitespace damage, clean most of it up..

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Arthur Othieno <a.othieno@bluewin.ch>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Make hs7751rvoip/rts7751r2d use pm_power_off.
Paul Mundt [Wed, 27 Sep 2006 02:43:24 +0000 (11:43 +0900)] 
sh: Make hs7751rvoip/rts7751r2d use pm_power_off.

These were previously sprinkled in machine_power_off(),
though missed being updated when the rest of the boards
switched over.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Kill off the .stack section.
Paul Mundt [Wed, 27 Sep 2006 02:40:05 +0000 (11:40 +0900)] 
sh: Kill off the .stack section.

We had a special .stack section in the ld script that
was being used to position r15 initially. This is
nonsensical, as we can just use a THREAD_SIZE offset
from the init_thread_union instead (as every other arch
does).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fix kGDB NMI handling.
Paul Mundt [Wed, 27 Sep 2006 02:37:33 +0000 (11:37 +0900)] 
sh: Fix kGDB NMI handling.

in_nmi shifted down a few labels, so we were inadvertently
clearing the lower byte of do_syscall_trace, badness ensues.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Move syscall table in to syscall.S.
Paul Mundt [Wed, 27 Sep 2006 02:36:10 +0000 (11:36 +0900)] 
sh: Move syscall table in to syscall.S.

Move the syscall table in to its own file, as per sh64. The entry.S
bits will end up being considerably different in the sh2/sh2a cases,
so this lets us keep things in sync somewhat..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Fixup some uninitialized spinlocks.
Paul Mundt [Wed, 27 Sep 2006 02:31:32 +0000 (11:31 +0900)] 
sh: Fixup some uninitialized spinlocks.

Fix use of uninitialized spinlocks, caught with spinlock debugging..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: flush_cache_range() cleanup and optimizations.
Paul Mundt [Wed, 27 Sep 2006 02:29:55 +0000 (11:29 +0900)] 
sh: flush_cache_range() cleanup and optimizations.

flush_cache_range() wasn't page aligning the end of the range,
we can't assume that it will always be page aligned, and we
ended up getting unaligned faults in some rare call paths.

Additionally, we add a small optimization to just purge the
dcache entirely if the range is large enough that the page
table walking will take longer. We use an arbitrary value of
64 pages for the large range size, as per sh64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Add a simple cmpxchg().
Tom Rini [Wed, 27 Sep 2006 02:28:20 +0000 (11:28 +0900)] 
sh: Add a simple cmpxchg().

We didn't have one of these before, a simple implementation
borrowed from MIPS as well as the __HAVE_ARCH_CMPXCHG bits.

Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agosh: Move smc37c93x.h for SystemH board use.
Paul Mundt [Wed, 27 Sep 2006 02:16:20 +0000 (11:16 +0900)] 
sh: Move smc37c93x.h for SystemH board use.

SystemH needs this header as well, not just 770x SE.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
18 years agoMerge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
Linus Torvalds [Tue, 26 Sep 2006 20:07:55 +0000 (13:07 -0700)] 
Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6

* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (225 commits)
  [PATCH] Don't set calgary iommu as default y
  [PATCH] i386/x86-64: New Intel feature flags
  [PATCH] x86: Add a cumulative thermal throttle event counter.
  [PATCH] i386: Make the jiffies compares use the 64bit safe macros.
  [PATCH] x86: Refactor thermal throttle processing
  [PATCH] Add 64bit jiffies compares (for use with get_jiffies_64)
  [PATCH] Fix unwinder warning in traps.c
  [PATCH] x86: Allow disabling early pci scans with pci=noearly or disallowing conf1
  [PATCH] x86: Move direct PCI scanning functions out of line
  [PATCH] i386/x86-64: Make all early PCI scans dependent on CONFIG_PCI
  [PATCH] Don't leak NT bit into next task
  [PATCH] i386/x86-64: Work around gcc bug with noreturn functions in unwinder
  [PATCH] Fix some broken white space in ia32_signal.c
  [PATCH] Initialize argument registers for 32bit signal handlers.
  [PATCH] Remove all traces of signal number conversion
  [PATCH] Don't synchronize time reading on single core AMD systems
  [PATCH] Remove outdated comment in x86-64 mmconfig code
  [PATCH] Use string instructions for Core2 copy/clear
  [PATCH] x86: - restore i8259A eoi status on resume
  [PATCH] i386: Split multi-line printk in oops output.
  ...

18 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
Linus Torvalds [Tue, 26 Sep 2006 18:49:46 +0000 (11:49 -0700)] 
Merge /pub/scm/linux/kernel/git/gregkh/driver-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (47 commits)
  Driver core: Don't call put methods while holding a spinlock
  Driver core: Remove unneeded routines from driver core
  Driver core: Fix potential deadlock in driver core
  PCI: enable driver multi-threaded probe
  Driver Core: add ability for drivers to do a threaded probe
  sysfs: add proper sysfs_init() prototype
  drivers/base: check errors
  drivers/base: Platform notify needs to occur before drivers attach to the device
  v4l-dev2: handle __must_check
  add CONFIG_ENABLE_MUST_CHECK
  add __must_check to device management code
  Driver core: fixed add_bind_files() definition
  Driver core: fix comments in drivers/base/power/resume.c
  sysfs_remove_bin_file: no return value, dump_stack on error
  kobject: must_check fixes
  Driver core: add ability for devices to create and remove bin files
  Class: add support for class interfaces for devices
  Driver core: create devices/virtual/ tree
  Driver core: add device_rename function
  Driver core: add ability for classes to handle devices properly
  ...

18 years ago[PATCH] s390: fix cmm kernel thread handling
Heiko Carstens [Tue, 26 Sep 2006 06:33:11 +0000 (23:33 -0700)] 
[PATCH] s390: fix cmm kernel thread handling

Convert cmm's usage of kernel_thread to kthread_run.  Also create the
cmmthread at module load time, so it is possible to check if creation of
the thread fails.

In addition the cmmthread now gets terminated when the module gets unloaded
instead of leaving a stale kernel thread.  Also check the return values of
other registration functions at module load and handle their return values
appropriately.

Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Make UML use ptrace-abi.h
Jeff Dike [Tue, 26 Sep 2006 06:33:10 +0000 (23:33 -0700)] 
[PATCH] Make UML use ptrace-abi.h

Include the host architecture's ptrace-abi.h instead of ptrace.h.

There was some cpp mangling of names around the ptrace.h include to avoid
symbol clashes between UML and the host architecture.  Most of these can go
away.  The exception is struct pt_regs, which is convenient to have in
userspace, but must be renamed in order that UML can define its own.

ptrace-x86_64.h needed to have some now-obsolete cpp cruft and a declaration
removed.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Split i386 and x86_64 ptrace.h
Jeff Dike [Tue, 26 Sep 2006 06:33:09 +0000 (23:33 -0700)] 
[PATCH] Split i386 and x86_64 ptrace.h

The use of SEGMENT_RPL_MASK in the i386 ptrace.h introduced by
x86-allow-a-kernel-to-not-be-in-ring-0.patch broke the UML build, as UML
includes the underlying architecture's ptrace.h, but has no easy access to the
x86 segment definitions.

Rather than kludging around this, as in the past, this patch splits the
userspace-usable parts, which are the bits that UML needs, of ptrace.h into
ptrace-abi.h, which is included back into ptrace.h.  Thus, there is no net
effect on i386.

As a side-effect, this creates a ptrace header which is close to being usable
in /usr/include.

x86_64 is also treated in this way for consistency.  There was some trailing
whitespace there, which is cleaned up.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] UML: tty locking
Alan Cox [Tue, 26 Sep 2006 06:33:08 +0000 (23:33 -0700)] 
[PATCH] UML: tty locking

Ensure current->signal->tty doesn't get freed during log_exec().

Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: stack usage reduction
Jeff Dike [Tue, 26 Sep 2006 06:33:08 +0000 (23:33 -0700)] 
[PATCH] uml: stack usage reduction

The KSTK_* macros used an inordinate amount of stack.  In order to overcome
an impedance mismatch between their interface, which just returns a single
register value, and the interface of get_thread_regs, which took a full
pt_regs, the implementation created an on-stack pt_regs, filled it in, and
returned one field.  do_task_stat calls KSTK_* twice, resulting in two
local pt_regs, blowing out the stack.

This patch changes the interface (and name) of get_thread_regs to just
return a single register from a jmp_buf.

The include of archsetjmp.h" in registers.h to get the definition of
jmp_buf exposed a bogus include of <setjmp.h> in start_up.c.  <setjmp.h>
shouldn't be used anywhere any more since UML uses the klibc
setjmp/longjmp.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: clean our set_ether_mac
Paolo 'Blaisorblade' Giarrusso [Tue, 26 Sep 2006 06:33:07 +0000 (23:33 -0700)] 
[PATCH] uml: clean our set_ether_mac

Clean set_ether_mac usage.  Maybe could also be removed, but surely it can't
be a global function taking a void* argument.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: Jeff Dike <jdike@addtoit.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: Remove unused variable
Jeff Dike [Tue, 26 Sep 2006 06:33:06 +0000 (23:33 -0700)] 
[PATCH] uml: Remove unused variable

timer_irq_inited was useless, so it is removed.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: timer cleanups
Jeff Dike [Tue, 26 Sep 2006 06:33:05 +0000 (23:33 -0700)] 
[PATCH] uml: timer cleanups

set_interval returns an error instead of panicing if setitimer fails.  Some of
its callers now check the return.

enable_timer is largely tt-mode-specific, so it is marked as such, and the
only skas-mode caller is made to call set-interval instead.

user_time_init was a no-value-added wrapper around set_interval, so it is
gone.

Since set_interval is now called from kernel code, callers no longer pass
ITIMER_* to it.  Instead, they pass a flag which is converted into ITIMER_REAL
or ITIMER_VIRTUAL.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: Move signal handlers to arch code
Jeff Dike [Tue, 26 Sep 2006 06:33:04 +0000 (23:33 -0700)] 
[PATCH] uml: Move signal handlers to arch code

Have most signals go through an arch-provided handler which recovers the
sigcontext and then calls a generic handler.  This replaces the
ARCH_GET_SIGCONTEXT macro, which was somewhat fragile.  On x86_64, recovering
%rdx (which holds the sigcontext pointer) must be the first thing that
happens.  sig_handler duly invokes that first, but there is no guarantee that
I can see that instructions won't be reordered such that %rdx is used before
that.  Having the arch provide the handler seems much more robust.

Some signals in some parts of UML require their own handlers - these places
don't call set_handler any more.  They call sigaction or signal themselves.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: SIGIO cleanups
Jeff Dike [Tue, 26 Sep 2006 06:33:04 +0000 (23:33 -0700)] 
[PATCH] uml: SIGIO cleanups

- Various cleanups in the sigio code.

- Removed explicit zero-initializations of a few structures.

- Improved some error messages.

- An API change - there was an asymmetry between reactivate_fd calling
  maybe_sigio_broken, which goes through all the machinery of figuring out if
  a file descriptor supports SIGIO and applying the workaround to it if not,
  and deactivate_fd, which just turns off the descriptor.

  This is changed so that only activate_fd calls maybe_sigio_broken, when
  the descriptor is first seen.  reactivate_fd now calls add_sigio_fd, which
  is symmetric with ignore_sigio_fd.

  This removes a recursion which makes a critical section look more critical
  than it really was, obsoleting a big comment to that effect.  This requires
  keeping track of all descriptors which are getting the SIGIO treatment, not
  just the ones being polled at any given moment, so that reactivate_fd,
  through add_sigio_fd, doesn't try to tell the SIGIO thread about descriptors
  it doesn't care about.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: Improve SIGBUS diagnostics
Jeff Dike [Tue, 26 Sep 2006 06:33:03 +0000 (23:33 -0700)] 
[PATCH] uml: Improve SIGBUS diagnostics

UML can get a SIGBUS anywhere if the tmpfs mount being used for its memory
runs out of space.  This patch adds a printk before the panic to provide a
clue as to what likely went wrong.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: Fix handling of failed execs of helpers
Jeff Dike [Tue, 26 Sep 2006 06:33:02 +0000 (23:33 -0700)] 
[PATCH] uml: Fix handling of failed execs of helpers

There were some bugs in handling failures to exec helper programs.  errno was
passed back from the child with the wrong sign.  It was also ignored.  In the
case where it mattered, the errno from the (successful) read in the parent was
used instead.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: Whitespace fixes
Jeff Dike [Tue, 26 Sep 2006 06:33:01 +0000 (23:33 -0700)] 
[PATCH] uml: Whitespace fixes

arch/um/kernel/tlb.c had some pretty serious whitespace problems.  I also
fixed some returns.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: Fix stack alignment
Jeff Dike [Tue, 26 Sep 2006 06:33:01 +0000 (23:33 -0700)] 
[PATCH] uml: Fix stack alignment

Stack randomization needs to be conditional on the personality allowing it.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: Use ARRAY_SIZE more assiduously
Jeff Dike [Tue, 26 Sep 2006 06:33:00 +0000 (23:33 -0700)] 
[PATCH] uml: Use ARRAY_SIZE more assiduously

There were a bunch of missed ARRAY_SIZE opportunities.

Also, some formatting fixes in the affected areas of code.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] uml: Use klibc setjmp/longjmp
Jeff Dike [Tue, 26 Sep 2006 06:32:59 +0000 (23:32 -0700)] 
[PATCH] uml: Use klibc setjmp/longjmp

This patch adds an implementation of setjmp and longjmp to UML, allowing
access to the inside of a jmpbuf without needing the access macros formerly
provided by libc.

The implementation is stolen from klibc.  I copy the relevant files into
arch/um.  I have another patch which avoids the copying, but requires klibc be
in the tree.

setjmp and longjmp users required some tweaking.  Includes of <setjmp.h> were
removed and includes of the UML longjmp.h were added where necessary.  There
are also replacements of siglongjmp with UML_LONGJMP which I somehow missed
earlier.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] PM: Add pm_trace switch
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:58 +0000 (23:32 -0700)] 
[PATCH] PM: Add pm_trace switch

Add the pm_trace attribute in /sys/power which has to be explicitly set to
one to really enable the "PM tracing" code compiled in when CONFIG_PM_TRACE
is set (which modifies the machine's CMOS clock in unpredictable ways).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] i386: Detect clock skew during suspend
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:57 +0000 (23:32 -0700)] 
[PATCH] i386: Detect clock skew during suspend

Detect the situations in which the time after a resume from disk would be
earlier than the time before the suspend and prevent them from happening on
i386.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: John Stultz <johnstul@us.ibm.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] suspend: make it possible to disable serial console suspend
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:57 +0000 (23:32 -0700)] 
[PATCH] suspend: make it possible to disable serial console suspend

Hack uart_suspend_port() and uart_resume_port() so that serial console
ports are not suspended if CONFIG_DISABLE_CONSOLE_SUSPEND is set.

This makes it possible to debug the suspend and resume routines of all
device drivers as well as the lowest-level swsusp code with the help of the
serial console.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] PM: make it possible to disable console suspending
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:56 +0000 (23:32 -0700)] 
[PATCH] PM: make it possible to disable console suspending

Change suspend_console() so that it waits for all consoles to flush the
remaining messages and make it possible to switch the console suspending off
with the help of a Kconfig option.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Stefan Seyfried <seife@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] swsusp: Use memory bitmaps during resume
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:55 +0000 (23:32 -0700)] 
[PATCH] swsusp: Use memory bitmaps during resume

Make swsusp use memory bitmaps to store its internal information during the
resume phase of the suspend-resume cycle.

If the pfns of saveable pages are saved during the suspend phase instead of
the kernel virtual addresses of these pages, we can use them during the resume
phase directly to set the corresponding bits in a memory bitmap.  Then, this
bitmap is used to mark the page frames corresponding to the pages that were
saveable before the suspend (aka "unsafe" page frames).

Next, we allocate as many page frames as needed to store the entire suspend
image and make sure that there will be some extra free "safe" page frames for
the list of PBEs constructed later.  Subsequently, the image is loaded and, if
possible, the data loaded from it are written into their "original" page
frames (ie.  the ones they had occupied before the suspend).

The image data that cannot be written into their "original" page frames are
loaded into "safe" page frames and their "original" kernel virtual addresses,
as well as the addresses of the "safe" pages containing their copies, are
stored in a list of PBEs.  Finally, the list of PBEs is used to copy the
remaining image data into their "original" page frames (this is done
atomically, by the architecture-dependent parts of swsusp).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] swsusp: Introduce memory bitmaps
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:54 +0000 (23:32 -0700)] 
[PATCH] swsusp: Introduce memory bitmaps

Introduce the memory bitmap data structure and make swsusp use in the suspend
phase.

The current swsusp's internal data structure is not very efficient from the
memory usage point of view, so it seems reasonable to replace it with a data
structure that will require less memory, such as a pair of bitmaps.

The idea is to use bitmaps that may be allocated as sets of individual pages,
so that we can avoid making allocations of order greater than 0.  For this
reason the memory bitmap structure consists of several linked lists of objects
that contain pointers to memory pages with the actual bitmap data.  Still, for
a typical system all of these lists fit in a single page, so it's reasonable
to introduce an additional mechanism allowing us to allocate all of them
efficiently without sacrificing the generality of the design.  This is done
with the help of the chain_allocator structure and associated functions.

We need to use two memory bitmaps during the suspend phase of the
suspend-resume cycle.  One of them is necessary for marking the saveable
pages, and the second is used to mark the pages in which to store the copies
of them (aka image pages).

First, the bitmaps are created and we allocate as many image pages as needed
(the corresponding bits in the second bitmap are set as soon as the pages are
allocated).  Second, the bits corresponding to the saveable pages are set in
the first bitmap and the saveable pages are copied to the image pages.
Finally, the first bitmap is used to save the kernel virtual addresses of the
saveable pages and the second one is used to save the contents of the image
pages.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] swsusp: Introduce some helpful constants
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:52 +0000 (23:32 -0700)] 
[PATCH] swsusp: Introduce some helpful constants

Introduce some constants that hopefully will help improve the readability of
code in kernel/power/snapshot.c.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Change the name of pagedir_nosave
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:52 +0000 (23:32 -0700)] 
[PATCH] Change the name of pagedir_nosave

The name of the pagedir_nosave variable does not make sense any more, so it
seems reasonable to change it to something more meaningful.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>