pandora-kernel.git
17 years ago[POWERPC] spufs: split the Cell BE support into generic and platform dependant parts
Geoff Levand [Mon, 19 Jun 2006 18:33:28 +0000 (20:33 +0200)]
[POWERPC] spufs: split the Cell BE support into generic and platform dependant parts

Creates new config variables PPC_CELL_NATIVE and PPC_IBM_CELL_BLADE.
The existing CONFIG_PPC_CELL is now used to denote the generic
Cell processor support.

PPC_CELL = make descends into platforms/cell
PPC_CELL_NATIVE = add bare metal support
PPC_IBM_CELL_BLADE = add blade device drivers, etc.

Also renames spu_priv1.c to spu_priv1_mmio.c.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] spufs: dont try to access SPE channel 1 count
arnd@arndb.de [Mon, 19 Jun 2006 18:33:27 +0000 (20:33 +0200)]
[POWERPC] spufs: dont try to access SPE channel 1 count

The save/restore sequence for SPE contexts currently attempts to save
and restore the channel count for SPE channel 1 (the SPU_WriteEventMask
channel.  But the CBE architecture (section 9.11.2) clearly states
that this channel does not have an associated count.  Hardware simply
ignores the attempt to write this count, but the simulator generates
a warning message.

WARNING: 279721590: SPE7: Attempt to write channel count for CH 1 with
no associated count is ignored.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] spufs: use kzalloc in create_spu
Jeremy Kerr [Mon, 19 Jun 2006 18:33:26 +0000 (20:33 +0200)]
[POWERPC] spufs: use kzalloc in create_spu

Clean up create_spu() a little by using kzalloc instead of kmalloc +
assignments.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] spufs: fix initial state of wbox file
arnd@arndb.de [Mon, 19 Jun 2006 18:33:25 +0000 (20:33 +0200)]
[POWERPC] spufs: fix initial state of wbox file

The wbox channel count of an spu is now initialized
to four for the saved context. This makes it possible
to write to the mailbox right away without waiting
for the SPE to become scheduled first.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] spufs: add a phys-id attribute to each SPU context
arnd@arndb.de [Mon, 19 Jun 2006 18:33:24 +0000 (20:33 +0200)]
[POWERPC] spufs: add a phys-id attribute to each SPU context

For performance analysis, it is often interesting to know
which physical SPE a thread is currently running on, and,
more importantly, if it is running at all.

This patch adds a simple attribute to each SPU directory
with that information.
The attribute is read-only and called 'phys-id'. It contains
an ascii string with the number of the physical SPU (e.g.
"0x5"), or alternatively the string "0xffffffff" (32 bit -1)
when it is not running at all at the time that the file
is read.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] spufs: set up correct SLB entries for 64k pages
arnd@arndb.de [Mon, 19 Jun 2006 18:33:23 +0000 (20:33 +0200)]
[POWERPC] spufs: set up correct SLB entries for 64k pages

spufs currently knows only 4k pages and 16M hugetlb
pages. Make it use the regular methods for deciding on
the SLB bits.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] spufs: fix deadlock in spu_create error path
Michael Ellerman [Mon, 19 Jun 2006 18:33:22 +0000 (20:33 +0200)]
[POWERPC] spufs: fix deadlock in spu_create error path

spufs_rmdir tries to acquire the spufs root
i_mutex, which is already held by spufs_create_thread.

This was tracked as Bug #H9512.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] spufs: restore mapping of mssync register
arnd@arndb.de [Mon, 19 Jun 2006 18:33:21 +0000 (20:33 +0200)]
[POWERPC] spufs: restore mapping of mssync register

A recent change to the way that the mfc file gets mapped made it
impossible to map the SPE Multi-Source Synchronization register
into user space, but that may be needed by some applications.

This restores the missing functionality.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] cell: always build spu base into the kernel
arnd@arndb.de [Mon, 19 Jun 2006 18:33:20 +0000 (20:33 +0200)]
[POWERPC] cell: always build spu base into the kernel

The spu_base module is rather deeply intermixed with the
core kernel, so it makes sense to have that built-in.
This will let us extend the base in the future without
having to export more core symbols just for it.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] cell: register SPUs as sysdevs
Jeremy Kerr [Mon, 19 Jun 2006 18:33:19 +0000 (20:33 +0200)]
[POWERPC] cell: register SPUs as sysdevs

SPUs are registered as system devices, exposing attributes through
sysfs. Since the sysdev includes a kref, we can remove the one in
struct spu (it isn't used at the moment anyway).

Currently only the interrupt source and numa node attributes are added.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] cell: update defconfig
arnd@arndb.de [Mon, 19 Jun 2006 18:33:18 +0000 (20:33 +0200)]
[POWERPC] cell: update defconfig

Enable some of the most requested features in defconfig
and refresh with the latest powerpc.git Kconfig files.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] cell: fix interrupt priority handling
arnd@arndb.de [Mon, 19 Jun 2006 18:33:17 +0000 (20:33 +0200)]
[POWERPC] cell: fix interrupt priority handling

Checking the priority field to test for irq validity is
completely bogus and breaks with future external interrupt
controllers.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] cell: add RAS support
Benjamin Herrenschmidt [Mon, 19 Jun 2006 18:33:16 +0000 (20:33 +0200)]
[POWERPC] cell: add RAS support

This is a first version of support for the Cell BE "Reliability,
Availability and Serviceability" features.

It doesn't yet handle some of the RAS interrupts (the ones described in
iic_is/iic_irr), I'm still working on a proper way to expose these. They
are essentially a cascaded controller by themselves (sic !) though I may
just handle them locally to the iic driver. I need also to sync with
David Erb on the way he hooked in the performance monitor interrupt.

So that's all for 2.6.17 and I'll do more work on that with my rework of
the powerpc interrupt layer that I'm hacking on at the moment.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add Vitesse 8244 PHY for MPC8641 HPCN platform.
Jon Loeliger [Sat, 17 Jun 2006 22:52:55 +0000 (17:52 -0500)]
[POWERPC] Add Vitesse 8244 PHY for MPC8641 HPCN platform.

Signed-off-by: Kriston Carson <KristonCarson@freescale.com>
Signed-off-by: Xianghua Xiao <x.xiao@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Document I2C_MPC option for 86xx too.
Jon Loeliger [Sat, 17 Jun 2006 22:52:54 +0000 (17:52 -0500)]
[POWERPC] Document I2C_MPC option for 86xx too.

The same I2C driver found on 85xx, etc., can be used for 86xx too.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add 8641 Register space and IRQ definitions.
Jon Loeliger [Sat, 17 Jun 2006 22:52:51 +0000 (17:52 -0500)]
[POWERPC] Add 8641 Register space and IRQ definitions.

Signed-off-by: Jeff Brown <Jeff.Brown@freescale.com>
Signed-off-by: Xianghua Xiao <x.xiao@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add mpc8641hpcn PCI/PCI-Express platform files.
Jon Loeliger [Sat, 17 Jun 2006 22:52:48 +0000 (17:52 -0500)]
[POWERPC] Add mpc8641hpcn PCI/PCI-Express platform files.

Signed-off-by: Xianghua Xiao <x.xiao@freescale.com>
Signed-off-by: Wei Zhang <Wei.Zhang@freescale.com>
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add the MPC8641 HPCN platform files.
Jon Loeliger [Sat, 17 Jun 2006 22:52:45 +0000 (17:52 -0500)]
[POWERPC] Add the MPC8641 HPCN platform files.

Signed-off-by: Xianghua Xiao <x.xiao@freescale.com>
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Wei Zhang <Wei.Zhang@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add starting of secondary 86xx CPUs.
Jon Loeliger [Sat, 17 Jun 2006 22:52:44 +0000 (17:52 -0500)]
[POWERPC] Add starting of secondary 86xx CPUs.

Clear the high BATS during load_up_mmu if FTR_HAS_HIGH_BATS.
Allow just a bit more time for secondary CPUs to phone home.

Signed-off-by: Wei Zhang <Wei.Zhang@freescale.com>
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add 8641 CPU table entry.
Jon Loeliger [Sat, 17 Jun 2006 22:52:40 +0000 (17:52 -0500)]
[POWERPC] Add 8641 CPU table entry.

Signed-off-by: Wei Zhang <Wei.Zhang@freescale.com>
Signed-off-by: Xianghua Xiao <x.xiao@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add mpc8641_hpcn_defconfig config file.
Jon Loeliger [Sat, 17 Jun 2006 22:52:37 +0000 (17:52 -0500)]
[POWERPC] Add mpc8641_hpcn_defconfig config file.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add the mpc8641 hpcn Kconfig and Makefiles.
Jon Loeliger [Sat, 17 Jun 2006 22:52:35 +0000 (17:52 -0500)]
[POWERPC] Add the mpc8641 hpcn Kconfig and Makefiles.

Signed-off-by: Xianghua Xiao <x.xiao@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Prevent duplicate lmb reservations for Device Tree blob.
Jon Loeliger [Sat, 17 Jun 2006 22:51:09 +0000 (17:51 -0500)]
[POWERPC] Prevent duplicate lmb reservations for Device Tree blob.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Guard L3CR references with CPU_FTR_L3CR.
Jon Loeliger [Sat, 17 Jun 2006 22:49:42 +0000 (17:49 -0500)]
[POWERPC] Guard L3CR references with CPU_FTR_L3CR.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] RTAS delay, fix module build breaks
John Rose [Thu, 15 Jun 2006 22:32:15 +0000 (17:32 -0500)]
[POWERPC] RTAS delay, fix module build breaks

Export both news RTAS delay functions, and change the scanlog module to
use the new delay functions.

Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] ppc32: fix CPCI405 board support
Matthias Fuchs [Wed, 14 Jun 2006 13:35:05 +0000 (15:35 +0200)]
[POWERPC] ppc32: fix CPCI405 board support

Hi,

this patch brings the CPCI405 board support up to date and fixes several
outstanding issues:

       -add bios_fixup()
       -enable RTC only when CONFIG_GEN_RTC defined
       -corrected CompactPCI interrupt map
       -added cpci405_early_serial_map for correct UART clocking
       -removed unused code

Matthias

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] make pmf irq_client functions safe against pmf interrupts coming in
Johannes Berg [Tue, 13 Jun 2006 15:43:42 +0000 (17:43 +0200)]
[POWERPC] make pmf irq_client functions safe against pmf interrupts coming in

This fixes the pmf irq_client functions to be safe against pmf interrupts coming
in while a client is registered/unregistered.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] check firmware state before suspending
Dave C Boutcher [Tue, 13 Jun 2006 00:49:20 +0000 (19:49 -0500)]
[POWERPC] check firmware state before suspending

Currently the kernel blindly halts all the processors and calls the
ibm,suspend-me rtas call.  If the firmware is not in the correct
state, we then re-start all the processors and return.  It is much
smarter to first check the firmware state, and only if it is waiting,
call the ibm,suspend-me call.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Fix builtin command line interaction with firmware
Amos Waterland [Tue, 13 Jun 2006 03:45:02 +0000 (23:45 -0400)]
[POWERPC] Fix builtin command line interaction with firmware

It seems that prom_init's early_cmdline_parse is broken on at least
Apple 970 xserves and IBM JS20 blades with SLOF.  The firmware of these
machines returns -1 and 1 respectively when getprop is called for the
bootargs property of /chosen, causing Linux to ignore its builtin
command line in favor of a null string.  This patch makes Linux use its
builtin command line if getprop returns an error or a null string.

Signed-off-by: Amos Waterland <apw@us.ibm.com>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] update pmac32_defconfig
Anton Blanchard [Sun, 11 Jun 2006 01:40:43 +0000 (11:40 +1000)]
[POWERPC] update pmac32_defconfig

Some updates to the pmac32_defconfig to make it more useful:

- Enable LSF (large single files) since we enable LBD (large block devices)
- Enable IPSEC related options
- Enable remaining raid/dm options as modules
- Disable eth1394, I doubt any has that hardware and it has a nasty habit of
  auto loading first and skewing network device numbering
- Enable dummy and tun as modules, always useful to have them around
- Enable EHCI, no wonder my usb2 disk was so slow
- Enable USB storage
- Enable ext3 acls
- Disable autofs and enable autofsv4 instead
- Enable nfs v3/v4 client and server. Dont want to be left in the dark ages
  of pre v3
- Enable all crypto as modules, things like cryptsetup want some of them

I havent enabled the BCM43xx, perhaps we should now?

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] system call micro optimisation
Anton Blanchard [Sat, 10 Jun 2006 15:15:55 +0000 (01:15 +1000)]
[POWERPC] system call micro optimisation

In the syscall path we currently have:

       crclr   so
       mfcr    r9

If we shift the crclr up we can avoid a stall on some CPUs.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Fix HV bit handling on non partitioned machines
Anton Blanchard [Sat, 10 Jun 2006 13:14:51 +0000 (23:14 +1000)]
[POWERPC] Fix HV bit handling on non partitioned machines

On non partitioned machines we currently set the HV bit in kernel space
only. It turns out we are supposed to maintain the HV bit in both user
and kernel space.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] cleanup dma_mapping_ops
Anton Blanchard [Sat, 10 Jun 2006 13:04:39 +0000 (23:04 +1000)]
[POWERPC] cleanup dma_mapping_ops

For pseries IOMMU bypass I want to be able to fall back to the regular
IOMMU ops. Do this by creating a dma_mapping_ops struct, and convert
the others while at it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] node local IOMMU tables
Anton Blanchard [Sat, 10 Jun 2006 10:58:08 +0000 (20:58 +1000)]
[POWERPC] node local IOMMU tables

Allocate IOMMU tables local to the relevant node.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] pcibus_to_node fixes
Anton Blanchard [Sat, 10 Jun 2006 10:53:06 +0000 (20:53 +1000)]
[POWERPC] pcibus_to_node fixes

of_node_to_nid returns -1 if the associativity cannot be found. This
means pcibus_to_cpumask has to be careful not to pass a negative index into
node_to_cpumask.

Since pcibus_to_node could be used a lot, and of_node_to_nid is slow (it
walks a list doing strcmps), lets also cache the node in the
pci_controller struct.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Update pseries defconfig
Anton Blanchard [Sat, 10 Jun 2006 10:37:24 +0000 (20:37 +1000)]
[POWERPC] Update pseries defconfig

pseries defconfig updates:

- Enable jsm and re-enable qlogic FC drivers as modules.
- Enable ocfs2, autofs4 and fuse filesystems as modules.
- Enable Kprobes.
- Enable ebus, binfmt_misc, sas attrs, md5 reshape, hvc rtas backend and
  some infiniband options.
- Finally disable debug options: DEBUG_MUTEXES and DEBUG_STACK_USAGE.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Remove stale 64bit on 32bit kernel code
Anton Blanchard [Sat, 10 Jun 2006 10:32:01 +0000 (20:32 +1000)]
[POWERPC] Remove stale 64bit on 32bit kernel code

Remove some stale POWER3/POWER4/970 on 32bit kernel support.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Optimise some TOC usage
Anton Blanchard [Sat, 10 Jun 2006 10:23:54 +0000 (20:23 +1000)]
[POWERPC] Optimise some TOC usage

Micro-optimisation - add no-minimal-toc to some more arch/powerpc Makefiles.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] 64bit FPSCR support
Anton Blanchard [Sat, 10 Jun 2006 10:18:39 +0000 (20:18 +1000)]
[POWERPC] 64bit FPSCR support

Forthcoming machines will extend the FPSCR to 64 bits.  We already
had a 64-bit save area for the FPSCR, but we need to use a new form
of the mtfsf instruction.  Fortunately this new form is decoded as
an ordinary mtfsf by existing 64-bit processors.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Editable kernel command-line in zImage binary.
mostrows@watson.ibm.com [Fri, 9 Jun 2006 13:06:12 +0000 (09:06 -0400)]
[POWERPC] Editable kernel command-line in zImage binary.

zImage will set /chosen/bootargs (if it is otherwise empty) with the
contents of a buffer in the section "__builtin_cmdline".  This permits
tools to edit zImage binaries to set the command-line eventually
processed by vmlinux.

--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] MSI abstraction
Jake Moilanen [Wed, 7 Jun 2006 21:15:10 +0000 (16:15 -0500)]
[POWERPC] MSI abstraction

Instead of trying to make PPC64 MSI fit in a Intel-centric MSI layer, a
simple short-term solution is to hook the pci_{en/dis}able_msi() calls
and make a machdep call.

The rest of the MSI functions are superfluous for what is needed at this
time.  Many of which can have machdep calls added as needed.

Ben and Michael Ellerman are looking into rewrite the MSI layer to be
more generic.  However, in the meantime this works as a interim
solution.

Signed-off-by: Jake Moilanen <moilanen@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add support for PCI-Express nodes in the device tree
Jake Moilanen [Wed, 7 Jun 2006 21:05:46 +0000 (16:05 -0500)]
[POWERPC] Add support for PCI-Express nodes in the device tree

This adds support to recognize the PCIe device_type "pciex" and made
the portdrv buildable.

Signed-off-by: Jake Moilanen <moilanen@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agopowerpc: Simplify push_end definition in pci_32.c
Paul Mackerras [Thu, 15 Jun 2006 08:03:32 +0000 (18:03 +1000)]
powerpc: Simplify push_end definition in pci_32.c

The push_end macro in arch/powerpc/kernel/pci_32.c uses integer
division and multiplication to achieve the effect of rounding a
resource end address up and then advancing it to the end of a
power-of-2 sized region.  This changes it to an equivalent computation
that only needs an integer add and OR.  This is partly based on an
earlier patch by Mel Gorman.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agopowerpc: Use 64k pages without needing cache-inhibited large pages
Paul Mackerras [Thu, 15 Jun 2006 00:45:18 +0000 (10:45 +1000)]
powerpc: Use 64k pages without needing cache-inhibited large pages

Some POWER5+ machines can do 64k hardware pages for normal memory but
not for cache-inhibited pages.  This patch lets us use 64k hardware
pages for most user processes on such machines (assuming the kernel
has been configured with CONFIG_PPC_64K_PAGES=y).  User processes
start out using 64k pages and get switched to 4k pages if they use any
non-cacheable mappings.

With this, we use 64k pages for the vmalloc region and 4k pages for
the imalloc region.  If anything creates a non-cacheable mapping in
the vmalloc region, the vmalloc region will get switched to 4k pages.
I don't know of any driver other than the DRM that would do this,
though, and these machines don't have AGP.

When a region gets switched from 64k pages to 4k pages, we do not have
to clear out all the 64k HPTEs from the hash table immediately.  We
use the _PAGE_COMBO bit in the Linux PTE to indicate whether the page
was hashed in as a 64k page or a set of 4k pages.  If hash_page is
trying to insert a 4k page for a Linux PTE and it sees that it has
already been inserted as a 64k page, it first invalidates the 64k HPTE
before inserting the 4k HPTE.  The hash invalidation routines also use
the _PAGE_COMBO bit, to determine whether to look for a 64k HPTE or a
set of 4k HPTEs to remove.  With those two changes, we can tolerate a
mix of 4k and 64k HPTEs in the hash table, and they will all get
removed when the address space is torn down.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agopowerpc: Fix some missed ppc32 mm->context.id conversions
Paul Mackerras [Tue, 13 Jun 2006 03:43:00 +0000 (13:43 +1000)]
powerpc: Fix some missed ppc32 mm->context.id conversions

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agopowerpc: Remove unused paca->pgdir field
Paul Mackerras [Mon, 12 Jun 2006 08:38:21 +0000 (18:38 +1000)]
powerpc: Remove unused paca->pgdir field

The pgdir field in the paca was a leftover from the dynamic VSIDs
patch, and is not used in the current kernel code.  This removes it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agoMerge branch 'merge'
Paul Mackerras [Mon, 12 Jun 2006 07:53:34 +0000 (17:53 +1000)]
Merge branch 'merge'

17 years ago[PATCH] Fix for the PPTP hangs that have been reported
Paul Mackerras [Mon, 12 Jun 2006 02:16:26 +0000 (12:16 +1000)]
[PATCH] Fix for the PPTP hangs that have been reported

People have been reporting that PPP connections over ptys, such as
used with PPTP, will hang randomly when transferring large amounts of
data, for instance in http://bugzilla.kernel.org/show_bug.cgi?id=6530.
I have managed to reproduce the problem, and the patch below fixes the
actual cause.

The problem is not in fact in ppp_async.c but in n_tty.c.  What
happens is that when pptp reads from the pty, we call read_chan() in
drivers/char/n_tty.c on the master side of the pty.  That copies all
the characters out of its buffer to userspace and then calls
check_unthrottle(), which calls the pty unthrottle routine, which
calls tty_wakeup on the slave side, which calls ppp_asynctty_wakeup,
which calls tasklet_schedule.  So far so good.  Since we are in
process context, the tasklet runs immediately and calls
ppp_async_process(), which calls ppp_async_push, which calls the
tty->driver->write function to send some more output.

However, tty->driver->write() returns zero, because the master
tty->receive_room is still zero.  We haven't returned from
check_unthrottle() yet, and read_chan() only updates tty->receive_room
_after_ calling check_unthrottle.  That means that the driver->write
call in ppp_async_process() returns 0.  That would be fine if we were
going to get a subsequent wakeup call, but we aren't (we just had it,
and the buffer is now empty).

The solution is for n_tty.c to update tty->receive_room _before_
calling the driver unthrottle routine.  The patch below does this.
With this patch I was able to transfer a 900MB file over a PPTP
connection (taking about 25 minutes), whereas without the patch the
connection would always stall in under a minute.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
Linus Torvalds [Sun, 11 Jun 2006 22:28:04 +0000 (15:28 -0700)]
Merge /pub/scm/linux/kernel/git/gregkh/pci-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6:
  [PATCH] PCI: reverse pci config space restore order
  [PATCH] PCI: Improve PCI config space writeback
  [PATCH] PCI: Error handling on PCI device resume
  [PATCH] PCI: fix pciehp compile issue when CONFIG_ACPI is not enabled

17 years ago[PATCH] typo in vmscan.c
Christoph Lameter [Sun, 11 Jun 2006 22:22:26 +0000 (15:22 -0700)]
[PATCH] typo in vmscan.c

From: Christoph Lameter <clameter@sgi.com>

Looks like a comma was left from the conversion from a struct to an
assignment.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] PCI: reverse pci config space restore order
Yu, Luming [Tue, 25 Apr 2006 07:00:34 +0000 (00:00 -0700)]
[PATCH] PCI: reverse pci config space restore order

According to Intel ICH spec, there are several rules that Base Address
should be programmed before IOSE  (PCICMD register ) enabled.

For example ICH7:

12.1.3  SATA : the base address register for the bus master register
               should be programmed before this bit is set.

11.1.3:  PCICMD (USB): The base address register for USB should be
                       programmed before this bit is set.
....

To make sure kernel code follow this rule , and prevent unnecessary
confusion. I proposal this patch.

Signed-off-by: Luming Yu <luming.yu@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years ago[PATCH] PCI: Improve PCI config space writeback
Dave Jones [Wed, 19 Apr 2006 04:06:51 +0000 (21:06 -0700)]
[PATCH] PCI: Improve PCI config space writeback

At least one laptop blew up on resume from suspend with a black screen due
to a lack of this patch.  By only writing back config space that is
different, we minimise the possibility of accidents like this.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years ago[PATCH] PCI: Error handling on PCI device resume
Jean Delvare [Tue, 18 Apr 2006 12:49:56 +0000 (14:49 +0200)]
[PATCH] PCI: Error handling on PCI device resume

We currently don't handle errors properly when resuming a PCI device:
* In pci_default_resume() we capture the error code returned by
  pci_enable_device() but don't pass it up to the caller.
  Introduced by commit 95a629657dbe28e44a312c47815b3dc3f1ce0970
* In pci_resume_device(), the errors possibly returned by the driver's
  .resume method or by the generic pci_default_resume() function are
  ignored.

This patch fixes both issues.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years ago[PATCH] PCI: fix pciehp compile issue when CONFIG_ACPI is not enabled
akpm@osdl.org [Sat, 13 May 2006 15:30:52 +0000 (08:30 -0700)]
[PATCH] PCI: fix pciehp compile issue when CONFIG_ACPI is not enabled

Fix build error when CONFIG_ACPI not defined

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years ago[SPARC]: Migration cost tune up in sparc smp.
Krzysztof Helt [Sun, 11 Jun 2006 05:03:43 +0000 (22:03 -0700)]
[SPARC]: Migration cost tune up in sparc smp.

This patch sets the max_cache_size value required to tune up
scheduler in SMP systems. Otherwise, the calculated
migration_cost is too high and task scheduling may lock up.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SPARC64]: Set appropriate max_cache_size.
David S. Miller [Sun, 11 Jun 2006 05:02:17 +0000 (22:02 -0700)]
[SPARC64]: Set appropriate max_cache_size.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agopowerpc: add context.vdso_base for 32-bit too
Paul Mackerras [Sun, 11 Jun 2006 04:15:17 +0000 (14:15 +1000)]
powerpc: add context.vdso_base for 32-bit too

This adds a vdso_base element to the mm_context_t for 32-bit compiles
(both for ARCH=powerpc and ARCH=ppc).  This fixes the compile errors
that have been reported in arch/powerpc/kernel/signal_32.c.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Sat, 10 Jun 2006 18:03:51 +0000 (11:03 -0700)]
Merge /pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Avoid JBUS errors on some Niagara systems.
  [FUSION]: Fix mptspi.c build with CONFIG_PM not set.
  [TG3]: Handle Sun onboard tg3 chips more correctly.
  [SPARC64]: Dump local cpu registers in sun4v_log_error()

17 years ago[PATCH] powerpc: console_initcall ordering issues
Milton Miller [Sat, 10 Jun 2006 16:54:16 +0000 (09:54 -0700)]
[PATCH] powerpc: console_initcall ordering issues

From: Milton Miller <miltonm@bga.com>

The add_preferred_console call in rtas_console.c was not causing the
console to be selected.  It turns out that the add_preferred_console was
being called after the hvc_console driver was registered.  It only works
when it is called before the console driver is registered.

Reorder hvc_console.o after the hvc_console drivers to allow the selection
during console_initcall processing.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] I2O: Bugfixes to get I2O working again
Markus Lidel [Sat, 10 Jun 2006 16:54:14 +0000 (09:54 -0700)]
[PATCH] I2O: Bugfixes to get I2O working again

From: Markus Lidel <Markus.Lidel@shadowconnect.com>

- Fixed locking of struct i2o_exec_wait in Executive-OSM

- Removed LCT Notify in i2o_exec_probe() which caused freeing memory and
  accessing freed memory during first enumeration of I2O devices

- Added missing locking in i2o_exec_lct_notify()

- removed put_device() of I2O controller in i2o_iop_remove() which caused
  the controller structure get freed to early

- Fixed size of mempool in i2o_iop_alloc()

- Fixed access to freed memory in i2o_msg_get()

See http://bugzilla.kernel.org/show_bug.cgi?id=6561

Signed-off-by: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] powernow-k8 crash workaround
Andrew Morton [Sat, 10 Jun 2006 16:54:13 +0000 (09:54 -0700)]
[PATCH] powernow-k8 crash workaround

From: Andrew Morton <akpm@osdl.org>

Work around the oops reported in
http://bugzilla.kernel.org/show_bug.cgi?id=6478.

Thanks to Ralf Hildebrandt <ralf.hildebrandt@charite.de> for testing and
reporting.

Acked-by: Dave Jones <davej@codemonkey.org.uk>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Further alterations for memory barrier document
David Howells [Sat, 10 Jun 2006 16:54:12 +0000 (09:54 -0700)]
[PATCH] Further alterations for memory barrier document

From: David Howells <dhowells@redhat.com>

Apply some alterations to the memory barrier document that I worked out
with Paul McKenney of IBM, plus some of the alterations suggested by Alan
Stern.

The following changes were made:

 (*) One of the examples given for what can happen with overlapping memory
     barriers was wrong.

 (*) The description of general memory barriers said that a general barrier is
     a combination of a read barrier and a write barrier.  This isn't entirely
     true: it implies both, but is more than a combination of both.

 (*) The first example in the "SMP Barrier Pairing" section was wrong: the
     loads around the read barrier need to touch the memory locations in the
     opposite order to the stores around the write barrier.

 (*) Added a note to make explicit that the loads should be in reverse order to
     the stores.

 (*) Adjusted the diagrams in the "Examples Of Memory Barrier Sequences"
     section to make them clearer.  Added a couple of diagrams to make it more
     clear as to how it could go wrong without the barrier.

 (*) Added a section on memory speculation.

 (*) Dropped any references to memory allocation routines doing memory
     barriers.  They may do sometimes, but it can't be relied on.  This may be
     worthy of further documentation later.

 (*) Made the fact that a LOCK followed by an UNLOCK should not be considered a
     full memory barrier more explicit and gave an example.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Paul E. McKenney <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Linus Torvalds [Sat, 10 Jun 2006 17:59:39 +0000 (10:59 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [PATCH] powerpc: Fix cell blade detection
  [PATCH] powerpc: Fix call to ibm,client-architecture-support
  powerpc: Fix machine check problem on 32-bit kernels

17 years agopowerpc: Fix bug in iommu_alloc_coherent causing hang during boot
Paul Mackerras [Sat, 10 Jun 2006 08:17:35 +0000 (18:17 +1000)]
powerpc: Fix bug in iommu_alloc_coherent causing hang during boot

In commit 8eb6c6e3b9c8bfed3d75536ab142d7694627c2e5, Christoph Hellwig
made iommu_alloc_coherent able to do node-local allocations, but
unfortunately got the order of the arguments to alloc_pages_node
wrong.  This fixes it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[SPARC64]: Avoid JBUS errors on some Niagara systems.
David S. Miller [Sat, 10 Jun 2006 08:06:25 +0000 (01:06 -0700)]
[SPARC64]: Avoid JBUS errors on some Niagara systems.

Doing PCI config space accesses to non-present PCI slots
can result in fatal JBUS errors if the PCI config access
hypervisor call is performed on cpus other than the boot
cpu.

PCI config space accesses to present PCI slots works just
fine.

Recursively traverse the OBP device tree under the PCI
controller node and record all present device IDs into
a small hash table.

Avoid the hypervisor call for any PCI config space access
attempt for a device not recorded in the hash table.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[FUSION]: Fix mptspi.c build with CONFIG_PM not set.
Tom "spot" Callaway [Sat, 10 Jun 2006 00:01:48 +0000 (17:01 -0700)]
[FUSION]: Fix mptspi.c build with CONFIG_PM not set.

Signed-off-by: Tom "spot" Callaway <tcallawa@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TG3]: Handle Sun onboard tg3 chips more correctly.
David S. Miller [Fri, 9 Jun 2006 18:58:36 +0000 (11:58 -0700)]
[TG3]: Handle Sun onboard tg3 chips more correctly.

Get rid of all the SUN_570X logic and instead:

1) Make sure MEMARB_ENABLE is set when we probe the SRAM
   for config information.  If that is off we will get
   timeouts.

2) Always try to sync with the firmware, if there is no
   firmware running do not treat it as an error and instead
   just report it the first time we notice this condition.

3) If there is no valid SRAM signature, assume the device
   is onboard by setting TG3_FLAG_EEPROM_WRITE_PROT.

Update driver version and release date.

With help from Michael Chan and Fabio Massimo Di Nitto.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SPARC64]: Dump local cpu registers in sun4v_log_error()
David S. Miller [Wed, 7 Jun 2006 00:37:41 +0000 (17:37 -0700)]
[SPARC64]: Dump local cpu registers in sun4v_log_error()

This makes the debugging information more usable.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[PATCH] powerpc: Cleanup hvc_rtas.c a little
Michael Ellerman [Wed, 7 Jun 2006 07:10:09 +0000 (17:10 +1000)]
[PATCH] powerpc: Cleanup hvc_rtas.c a little

A few cleanups in hvc_rtas.c:
 1. Remove unused RTASCONS_PUT_ATTEMPTS
 2. Remove unused rtascons_put_delay.
 3. Use i as a loop counter like everyone else on earth.
 4. Remove pointless variables, eg. x = foo; if (x) return something_else;
 5. Whitespace cleanups and formatting.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: Make rtas console _much_ faster
Michael Ellerman [Wed, 7 Jun 2006 07:10:03 +0000 (17:10 +1000)]
[PATCH] powerpc: Make rtas console _much_ faster

Currently the hvc_rtas driver is painfully slow to use. Our "benchmark" is
ls -R /etc, which spits out about 27866 characters. The theoretical maximum
speed would be about 2.2 seconds, the current code takes ~50 seconds.

The core of the problem is that sometimes when the tty layer asks us to push
characters the firmware isn't able to handle some or all of them, and so
returns an error. The current code sees this and just returns to the tty code
with the buffer half sent.

The khvcd thread will eventually wake up and try to push more characters, which
will usually work because by then the firmware's had time to make room. But
the khvcd thread only wakes up every 10 milliseconds, which isn't fast enough.

So change the khvcd thread logic so that if there's an incomplete write we
yield() and then immediately try writing again. Doing so makes POLL_QUICK and
POLL_WRITE synonymous, so remove POLL_QUICK.

With this patch our "benchmark" takes ~2.8 seconds.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: Implement PR_[GS]ET_UNALIGN prctls for powerpc
Paul Mackerras [Wed, 7 Jun 2006 06:15:39 +0000 (16:15 +1000)]
[PATCH] powerpc: Implement PR_[GS]ET_UNALIGN prctls for powerpc

This gives the ability to control whether alignment exceptions get
fixed up or reported to the process as a SIGBUS, using the existing
PR_SET_UNALIGN and PR_GET_UNALIGN prctls.  We do not implement the
option of logging a message on alignment exceptions.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: Implement support for setting little-endian mode via prctl
Paul Mackerras [Wed, 7 Jun 2006 06:14:40 +0000 (16:14 +1000)]
[PATCH] powerpc: Implement support for setting little-endian mode via prctl

This adds the PowerPC part of the code to allow processes to change
their endian mode via prctl.

This also extends the alignment exception handler to be able to fix up
alignment exceptions that occur in little-endian mode, both for
"PowerPC" little-endian and true little-endian.

We always enter signal handlers in big-endian mode -- the support for
little-endian mode does not amount to the creation of a little-endian
user/kernel ABI.  If the signal handler returns, the endian mode is
restored to what it was when the signal was delivered.

We have two new kernel CPU feature bits, one for PPC little-endian and
one for true little-endian.  Most of the classic 32-bit processors
support PPC little-endian, and this is reflected in the CPU feature
table.  There are two corresponding feature bits reported to userland
in the AT_HWCAP aux vector entry.

This is based on an earlier patch by Anton Blanchard.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] Add a prctl to change the endianness of a process.
Anton Blanchard [Wed, 7 Jun 2006 06:10:19 +0000 (16:10 +1000)]
[PATCH] Add a prctl to change the endianness of a process.

This new prctl is intended for changing the execution mode of the
processor, on processors that support both a little-endian mode and a
big-endian mode.  It is intended for use by programs such as
instruction set emulators (for example an x86 emulator on PowerPC),
which may find it convenient to use the processor in an alternate
endianness mode when executing translated instructions.

Note that this does not imply the existence of a fully-fledged ABI for
both endiannesses, or of compatibility code for converting system
calls done in the non-native endianness mode.  The program is expected
to arrange for all of its system call arguments to be presented in the
native endianness.

Switching between big and little-endian mode will require some care in
constructing the instruction sequence for the switch.  Generally the
instructions up to the instruction that invokes the prctl system call
will have to be in the old endianness, and subsequent instructions
will have to be in the new endianness.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: Add udbg-immortal kernel option
Benjamin Herrenschmidt [Wed, 7 Jun 2006 02:06:20 +0000 (12:06 +1000)]
[PATCH] powerpc: Add udbg-immortal kernel option

When debugging early kernel crashes that happen after console_init() and
before a proper console driver takes over, we often have to go hack into
udbg.c to prevent it from unregistering so we can "see" what is
happening. This patch adds a kernel command line option "udbg-immortal"
instead to avoid having to modify the kernel.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: oprofile support for POWER6
Michael Neuling [Thu, 8 Jun 2006 04:42:34 +0000 (14:42 +1000)]
[PATCH] powerpc: oprofile support for POWER6

POWER6 moves some of the MMCRA bits and also requires some bits to be
cleared each PMU interrupt.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Acked-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: node-aware dma allocations
Christoph Hellwig [Tue, 6 Jun 2006 14:11:35 +0000 (16:11 +0200)]
[PATCH] powerpc: node-aware dma allocations

Make sure dma_alloc_coherent allocates memory from the local node.  This
is important on Cell where we avoid going through the slow cpu
interconnect.

Note:  I could only test this patch on Cell, it should be verified on
some pseries machine by those that have the hardware.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: implement pcibus_to_node and pcibus_to_cpumask
Christoph Hellwig [Tue, 6 Jun 2006 14:09:39 +0000 (16:09 +0200)]
[PATCH] powerpc: implement pcibus_to_node and pcibus_to_cpumask

On 64bit powerpc we can find out what node a pci bus hangs off, so
implement the topology.h macros that export this information.

For 32bit this seems a little more difficult, but I don't know of 32bit
powerpc NUMA machines either, so let's leave it out for now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: reorg RTAS delay code
John Rose [Mon, 5 Jun 2006 21:31:48 +0000 (16:31 -0500)]
[PATCH] powerpc: reorg RTAS delay code

This patch attempts to handle RTAS "busy" return codes in a more simple
and consistent manner.  Typical callers of RTAS shouldn't have to
manage wait times and delay calls.

This patch also changes the kernel to use msleep() rather than udelay()
when a runtime delay is necessary.  This will avoid CPU soft lockups
for extended delay conditions.

Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc kbuild warning fix
Andrew Morton [Fri, 2 Jun 2006 03:36:04 +0000 (20:36 -0700)]
[PATCH] powerpc kbuild warning fix

From: Andrew Morton <akpm@osdl.org>

arch/powerpc/Kconfig:339:warning: leading whitespace ignored
arch/powerpc/Kconfig:347:warning: leading whitespace ignored
arch/powerpc/Kconfig:357:warning: leading whitespace ignored
arch/powerpc/Kconfig:373:warning: leading whitespace ignored
arch/powerpc/Kconfig:382:warning: leading whitespace ignored
arch/powerpc/Kconfig:394:warning: leading whitespace ignored
arch/powerpc/Kconfig:842:warning: leading whitespace ignored
arch/powerpc/Kconfig:847:warning: leading whitespace ignored

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: add num_pmcs to 970MP cputable entry
Anton Blanchard [Thu, 4 May 2006 19:44:26 +0000 (05:44 +1000)]
[PATCH] powerpc: add num_pmcs to 970MP cputable entry

The 970MP cputable entry needs a num_pmcs entry for oprofile to work.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: fix of_parse_dma_window
Will Schmidt [Tue, 30 May 2006 18:38:40 +0000 (13:38 -0500)]
[PATCH] powerpc: fix of_parse_dma_window

My js20 appears to lack the ibm,#dma- properties, and boot fails with a
"Kernel panic - not syncing: iommu_init_table: Can't allocate 0 bytes"
message.

This adds a fallback to the "#address-cells" property in case the
"#ibm,dma-address-cells" property is missing.   Tested on js20 and
power5 lpar.

Unless there is a more elegant solution... :-)

Signed-off-by: Will Schmidt <willschm@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: Fix buglet with MMU hash management
Benjamin Herrenschmidt [Tue, 30 May 2006 04:14:19 +0000 (14:14 +1000)]
[PATCH] powerpc: Fix buglet with MMU hash management

Our MMU hash management code would not set the "C" bit (changed bit) in
the hardware PTE when updating a RO PTE into a RW PTE. That would cause
the hardware to possibly to a write back to the hash table to set it on
the first store access, which in addition to being a performance issue,
might also hit a bug when running with native hash management (non-HV)
as our code is specifically optimized for the case where no write back
happens.

Thus there is a very small therocial window were a hash PTE can become
corrupted if that HPTE has just been upgraded to read write, a store
access happens on it, and that races with another processor evicting
that same slot. Since eviction (caused by an almost full hash) is
extremely rare, the bug is very unlikely to happen fortunately.

This fixes by allowing the updating of the protection bits in the native
hash handling to also set (but not clear) the "C" bit, and, in order to
also improve performances in the general case, by always setting that
bit on newly inserted hash PTE so that writeback really never happens.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc vdso updates
Benjamin Herrenschmidt [Tue, 30 May 2006 03:51:37 +0000 (13:51 +1000)]
[PATCH] powerpc vdso updates

This patch cleans up some locking & error handling in the ppc vdso and
moves the vdso base pointer from the thread struct to the mm context
where it more logically belongs. It brings the powerpc implementation
closer to Ingo's new x86 one and also adds an arch_vma_name() function
allowing to print [vsdo] in /proc/<pid>/maps if Ingo's x86 vdso patch is
also applied.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: enable PPC_PTRACE_[GS]ETREGS on ppc32
Renzo Davoli [Sun, 21 May 2006 18:06:58 +0000 (20:06 +0200)]
[PATCH] powerpc: enable PPC_PTRACE_[GS]ETREGS on ppc32

I have tested PPC_PTRACE_GETREGS and PPC_PTRACE_SETREGS on umview.

I do not understand why historically these tags has been defined as
PPC_PTRACE_GETREGS and PPC_PTRACE_SETREGS instead of simply
PTRACE_[GS]ETREGS. The other "originality" is that the address must be
put into the "addr" field instead of the "data" field as stated in the
manual.

Signed-off-by: renzo davoli <renzo@cs.unibo.it>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: Fix cell blade detection
Arnd Bergmann [Wed, 7 Jun 2006 02:04:18 +0000 (12:04 +1000)]
[PATCH] powerpc: Fix cell blade detection

The IBM Cell blade firmware might confuse the kernel to think it's a
pSeries machine. This fixes it for now. With a bit of luck, the firmware
will be updated to avoid that in the future but currently that patch is
needed.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] powerpc: Fix call to ibm,client-architecture-support
Benjamin Herrenschmidt [Wed, 7 Jun 2006 02:01:32 +0000 (12:01 +1000)]
[PATCH] powerpc: Fix call to ibm,client-architecture-support

The code in prom_init.c calling the firmware
ibm,client-architecture-support method on pSeries has a bug where it
fails to properly pass the instance handle of the firmware object when
trying to call a method. Result ranges from the call doing nothing to
the firmware crashing. (Found by Segher, thanks !)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agopowerpc: Fix machine check problem on 32-bit kernels
Paul Mackerras [Fri, 9 Jun 2006 03:02:59 +0000 (13:02 +1000)]
powerpc: Fix machine check problem on 32-bit kernels

This fixes a bug found by Dave Jones that means that it is possible
for userspace to provoke a machine check on 32-bit kernels.  This
also fixes a couple of other places where I found similar problems
by inspection.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agoMerge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Thu, 8 Jun 2006 22:16:35 +0000 (15:16 -0700)]
Merge branch 'upstream-fixes' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  e1000: remove risky prefetch on next_skb->data
  e1000: fix ethtool test irq alloc as "probe"
  [PATCH] bcm43xx: add DMA rx poll workaround to DMA4

17 years ago[PATCH] s390: fix in-user atomic futex operation.
Martin Schwidefsky [Thu, 8 Jun 2006 08:36:20 +0000 (01:36 -0700)]
[PATCH] s390: fix in-user atomic futex operation.

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

__futex_atomic_op needs to do an atomic operation in the user address space,
not the kernel address space.  Add the missing sacf 256/sacf 0 to switch to
the secondary mode before doing the compare-and-swap.  In addition add
another fixup for catch specification exceptions if the compare-and-swap
address is not aligned.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] debugfs inode leak
Jens Axboe [Thu, 8 Jun 2006 08:26:39 +0000 (10:26 +0200)]
[PATCH] debugfs inode leak

Looking at the reiser4 crash, I found a leak in debugfs. In
debugfs_mknod(), we create the inode before checking if the dentry
already has one attached. We don't free it if that is the case.

These bugs happen quite often, I'm starting to think we should disallow
such coding in CodingStyle.

Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] elevator switching race
Jens Axboe [Thu, 8 Jun 2006 06:49:06 +0000 (08:49 +0200)]
[PATCH] elevator switching race

There's a race between shutting down one io scheduler and firing up the
next, in which a new io could enter and cause the io scheduler to be
invoked with bad or NULL data.

To fix this, we need to maintain the queue lock for a bit longer.
Unfortunately we cannot do that, since the elevator init requires to be
run without the lock held.  This isn't easily fixable, without also
changing the mempool API.  So split the initialization into two parts,
and alloc-init operation and an attach operation.  Then we can
preallocate the io scheduler and related structures, and run the attach
inside the lock after we detach the old one.

This patch has survived 30 minutes of 1 second io scheduler switching
with a very busy io load.

Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] fbcon: fix limited scroll in SCROLL_PAN_REDRAW mode
Malcom Parsons [Thu, 8 Jun 2006 07:43:42 +0000 (00:43 -0700)]
[PATCH] fbcon: fix limited scroll in SCROLL_PAN_REDRAW mode

From: Malcom Parsons <malcolm.parsons@gmail.com>

When scrolling up in SCROLL_PAN_REDRAW mode with a large limited scroll
region, the bottom few lines have to be redrawn.  Without this patch, the
wrong text is drawn into these lines, corrupting the display.

Observed in 2.6.14 when running an IRC client in the Nintendo DS linux
port.

I haven't tested if scrolling down has the same problem.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Fix mempolicy.h build error
Ralf Baechle [Thu, 8 Jun 2006 07:43:41 +0000 (00:43 -0700)]
[PATCH] Fix mempolicy.h build error

From: Ralf Baechle <ralf@linux-mips.org>

<linux/mempolicy.h> uses struct mm_struct and relies on a definition or
declaration somehow magically being dragged in which may result in a
build:

[...]
  CC      mm/mempolicy.o
In file included from mm/mempolicy.c:69:
include/linux/mempolicy.h:150: warning: â\80\98struct mm_structâ\80\99 declared inside parameter list
include/linux/mempolicy.h:150: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/mempolicy.h:175: warning: â\80\98struct mm_structâ\80\99 declared inside parameter list
mm/mempolicy.c:622: error: conflicting types for â\80\98do_migrate_pagesâ\80\99
include/linux/mempolicy.h:175: error: previous declaration of â\80\98do_migrate_pagesâ\80\99 was here
mm/mempolicy.c:1661: error: conflicting types for â\80\98mpol_rebind_mmâ\80\99
include/linux/mempolicy.h:150: error: previous declaration of â\80\98mpol_rebind_mmâ\80\99 was here
make[1]: *** [mm/mempolicy.o] Error 1
make: *** [mm] Error 2
[ralf@denk linux-ip35]$

Including <linux/sched.h> is a step into direction of include hell so
fixed by adding a forward declaration of struct mm_struct instead.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] ep93xx build fix
Lennert Buytenhek [Thu, 8 Jun 2006 07:43:40 +0000 (00:43 -0700)]
[PATCH] ep93xx build fix

From: Lennert Buytenhek <buytenh@wantstofly.org>

The recent renaming of m48t86's ->readb() and ->writeb() platform driver
methods (2d7b20c1884777e66009be1a533641c19c4705f6) to ->readbyte() and
->writebyte() to fix the ia64 build broke the build of the cirrus ep93xx
ARM platform.  This patch fixes it up.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Fix HPET operation on 64-bit NVIDIA platforms
Andy Currid [Thu, 8 Jun 2006 07:43:39 +0000 (00:43 -0700)]
[PATCH] Fix HPET operation on 64-bit NVIDIA platforms

From: "Andy Currid" <ACurrid@nvidia.com>

This patch fixes a kernel panic during boot that occurs on NVIDIA platforms
that have HPET enabled.

When HPET is enabled, the standard timer IRQ is routed to IOAPIC pin 2 and is
advertised as such in the ACPI APIC table - but an earlier workaround in the
kernel was ignoring this override.  The fix is to honor timer IRQ overrides
from ACPI when HPET is detected on an NVIDIA platform.

Signed-off-by: Andy Currid <acurrid@nvidia.com>
Cc: "Brown, Len" <len.brown@intel.com>
Cc: "Yu, Luming" <luming.yu@intel.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Fix HPET operation on 32-bit NVIDIA platforms
Andy Currid [Thu, 8 Jun 2006 07:43:38 +0000 (00:43 -0700)]
[PATCH] Fix HPET operation on 32-bit NVIDIA platforms

From: "Andy Currid" <ACurrid@nvidia.com>

This patch fixes a kernel panic during boot that occurs on NVIDIA platforms
that have HPET enabled.

When HPET is enabled, the standard timer IRQ is routed to IOAPIC pin 2 and is
advertised as such in the ACPI APIC table - but an earlier workaround in the
kernel was ignoring this override.  The fix is to honor timer IRQ overrides
from ACPI when HPET is detected on an NVIDIA platform.

Signed-off-by: Andy Currid <acurrid@nvidia.com>
Cc: "Brown, Len" <len.brown@intel.com>
Cc: "Yu, Luming" <luming.yu@intel.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years agoMerge branch 'upstream-fixes' of git://lost.foo-projects.org/~ahkok/git/netdev-2...
Jeff Garzik [Thu, 8 Jun 2006 19:49:36 +0000 (15:49 -0400)]
Merge branch 'upstream-fixes' of git://lost.foo-projects.org/~ahkok/git/netdev-2.6 into upstream-fixes

17 years agoMerge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil...
Jeff Garzik [Thu, 8 Jun 2006 19:46:27 +0000 (15:46 -0400)]
Merge branch 'upstream-fixes' of git://git./linux/kernel/git/linville/wireless-2.6 into upstream-fixes

17 years agoe1000: remove risky prefetch on next_skb->data
Auke Kok [Thu, 8 Jun 2006 16:28:47 +0000 (09:28 -0700)]
e1000: remove risky prefetch on next_skb->data

It was brought to our attention that the prefetches break e1000 traffic
on xscale/arm architectures.  Remove them for now.  We'll let them
stay in mm for a while, or find a better solution to enable.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
17 years agoe1000: fix ethtool test irq alloc as "probe"
Auke Kok [Thu, 8 Jun 2006 16:28:38 +0000 (09:28 -0700)]
e1000: fix ethtool test irq alloc as "probe"

New code added in 2.6.17 caused setup_irq to print a warning when
running ethtool -t eth0 offline.

This test marks the request_irq call made by this test as a "probe"
to see if the interrupt is shared or not.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>