pandora-kernel.git
16 years ago[POWERPC] 85xxCDS: Delay 8259 cascade hookup.
Randy Vinson [Thu, 14 Jun 2007 18:02:54 +0000 (11:02 -0700)]
[POWERPC] 85xxCDS: Delay 8259 cascade hookup.

The interrupts of an E100 card inserted in PCI slot 4 may be on at bootup.
The resulting interrupt flood interacts with the 8259 cascade handler and
prevents proper boot up. There is a quirk for the E100 that will disable
the E100's interrupts but to use it, the 8259 cascade hookup must be
delayed until after the quirk has run. This patch delays the 8259 cascade
hookup by registering a device_initcall() which runs after the PCI quirk
for the E100.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoACPI: Remove references to ACPI_STATE_S2 from acpi_pm_enter
Rafael J. Wysocki [Tue, 24 Jul 2007 09:58:39 +0000 (11:58 +0200)]
ACPI: Remove references to ACPI_STATE_S2 from acpi_pm_enter

Remove references to ACPI_STATE_S2, introduced by
acpi-implement-the-set_target-callback-from-pm_ops.patch, from acpi_pm_enter().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years ago[MIPS] Fix marge error due to conflict in arch/mips/kernel/head.S
Atsushi Nemoto [Sun, 22 Jul 2007 15:07:34 +0000 (00:07 +0900)]
[MIPS] Fix marge error due to conflict in arch/mips/kernel/head.S

__INIT directive just before kernel_entry was ignored for most platforms.
This patch fixes it and get rid of this warning:

WARNING: vmlinux.o(.text+0x478): Section mismatch: reference to .init.text:start_kernel (between '_stext' and 'run_init_process')

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] ARC: Remove unused arch/mips/arc/console.c
Yoichi Yuasa [Tue, 24 Jul 2007 07:38:04 +0000 (16:38 +0900)]
[MIPS] ARC: Remove unused arch/mips/arc/console.c

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] SNI: sniprom
Thomas Bogendoerfer [Tue, 24 Jul 2007 01:49:27 +0000 (03:49 +0200)]
[MIPS] SNI: sniprom

- fix compile error due to missing #include
- fix section mismatch warning

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Jazz: remove unneeded reset functions
Yoichi Yuasa [Sun, 22 Jul 2007 04:06:49 +0000 (13:06 +0900)]
[MIPS] Jazz: remove unneeded reset functions

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Whitespace cleanup.
Ralf Baechle [Tue, 24 Jul 2007 15:02:47 +0000 (16:02 +0100)]
[MIPS] Whitespace cleanup.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Make resources for ds1742 "static __initdata"
Atsushi Nemoto [Mon, 30 Apr 2007 16:49:20 +0000 (01:49 +0900)]
[MIPS] Make resources for ds1742 "static __initdata"

We can make resources for platform_device_register_simple() "static
__initdata".

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Replace __attribute_used__ with __used
David Rientjes [Sun, 22 Jul 2007 08:01:39 +0000 (01:01 -0700)]
[MIPS] Replace __attribute_used__ with __used

Replaces the deprecated __attribute_used__ with __used.  Also makes some
style adjustments to abide by the kernel coding conventions.

Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Jazz: Remove unused arch/mips/jazz/io.c
Yoichi Yuasa [Sun, 22 Jul 2007 04:03:37 +0000 (13:03 +0900)]
[MIPS] Jazz: Remove unused arch/mips/jazz/io.c

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Mark prom_free_prom_memory as __init_refok
Atsushi Nemoto [Sun, 22 Jul 2007 14:44:20 +0000 (23:44 +0900)]
[MIPS] Mark prom_free_prom_memory as __init_refok

> WARNING: vmlinux.o(.text+0xbf20): Section mismatch: reference to
> .init.text:prom_free_prom_memory (between 'free_initmem' and 'copy_from_user_page')

prom_free_prom_memory() is called _before_ freeing init sections, so
it is false positive.  __init_refok can be used for such cases.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] MIPSsim: Fix cflags
Yoichi Yuasa [Fri, 13 Jul 2007 07:36:57 +0000 (16:36 +0900)]
[MIPS] MIPSsim: Fix cflags

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[BLOCK] Add request_queue_t and mark it deprecated
Jens Axboe [Tue, 24 Jul 2007 08:29:42 +0000 (10:29 +0200)]
[BLOCK] Add request_queue_t and mark it deprecated

Andrew thinks I should be nice and allow outside code to at least just
compile, so add the request_queue_t typedef back and mark it deprecated.
It'll warn people that this type is going away soonish.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years ago[BLOCK] Get rid of request_queue_t typedef
Jens Axboe [Tue, 24 Jul 2007 07:28:11 +0000 (09:28 +0200)]
[BLOCK] Get rid of request_queue_t typedef

Some of the code has been gradually transitioned to using the proper
struct request_queue, but there's lots left. So do a full sweet of
the kernel and get rid of this typedef and replace its uses with
the proper type.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoACPI: Kconfig: always enable CONFIG_ACPI_SLEEP on X86
Len Brown [Tue, 24 Jul 2007 06:25:03 +0000 (02:25 -0400)]
ACPI: Kconfig: always enable CONFIG_ACPI_SLEEP on X86

The SMP dependency on HOTPLUG_CPU and SUSPEND_SMP
caused more harm than good -- making ACPI sleep
support vanish for configs missing those options.
So simply select them on the (ACPI && SMP && X86) systems
that need them.

Also, remove the prompt for ACPI_SLEEP,
virtually nobody (intentionally) enables ACPI without it.

Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: Kconfig: fold /proc/acpi/sleep under CONFIG_ACPI_PROCFS
Len Brown [Tue, 24 Jul 2007 06:16:50 +0000 (02:16 -0400)]
ACPI: Kconfig: fold /proc/acpi/sleep under CONFIG_ACPI_PROCFS

/proc/acpi/sleep has had its own "default n" option,
ACPI_SLEEP_PROC_SLEEP, for many months.
Time to delete ACPI_SLEEP_PROC_SLEEP.

Users that still need /proc/acpi/sleep can still get it
along with the other deprecated /proc/acpi files
by enabling CONFIG_ACPI_PROCFS.

Also delete ACPI_SLEEP_PROC_FS, which was an umbrella
for /proc/acpi/sleep, wakeup, alarm, because it was
effectively just a synonym for ACPI_SLEEP.

Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: Kconfig: CONFIG_ACPI_PROCFS now defaults to N
Len Brown [Tue, 24 Jul 2007 05:50:46 +0000 (01:50 -0400)]
ACPI: Kconfig: CONFIG_ACPI_PROCFS now defaults to N

delete "default y" from CONFIG_ACPI_PROCFS
(effectively making the default 'N')

List exactly what /proc files this option controls,
and clarify that it doesn't change non-deprecated files.

Signed-off-by: Len Brown <len.brown@intel.com>
16 years ago[POWERPC] 85xxCDS: Make sure restart resets the PCI bus.
Randy Vinson [Fri, 23 Mar 2007 22:43:37 +0000 (15:43 -0700)]
[POWERPC] 85xxCDS: Make sure restart resets the PCI bus.

The current 85xxCDS restart code fails to reset the PCI bus which can
lead to odd behavior after the restart. This patch uses the VIA Super
Southbridge to perform a PCI reset which will reset the entire system.
NOTE: Since the VIA chip is behind a PCI-to-PCI bridge which can be
disabled with a switch setting, it may not be possible to perform the
PCI bus reset. In this case, the code defaults to the previous restart
mechanism.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line.
Randy Vinson [Wed, 6 Jun 2007 23:26:15 +0000 (16:26 -0700)]
[POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line.

The Freescale MPC8555CDS and MPC8548CDS reference hardware has a legacy
8259 interrupt controller pair contained within a VIA VT82C686B Southbridge
on the main carrier board. The processor complex plugs into the carrier
card using a PCI slot which limits the available interrupts to the
INTA-INTD PCI interrupts. The output of the 8259 cascade pair is routed
through a gate array and connected to the PCI INTA interrupt line.
The normal interrupt chaining hook (set_irq_chained_handler) does
not allow sharing of the chained interrupt which prevents the
use of PCI INTA by PCI devices. This patch allows the 8259 cascade
pair to share their interrupt line with PCI devices.

NOTE: The addition of the .end routine for the MPIC is not strictly
necessary for this patch. It's there so this code will run from within
the threaded interrupt context used by the Real Time patch.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] FSL: Add support for PCI-X controllers
Kumar Gala [Fri, 20 Jul 2007 21:29:09 +0000 (16:29 -0500)]
[POWERPC] FSL: Add support for PCI-X controllers

Some set of 85xx platforms have PCI-X controllers.  The old arch/ppc
code setup these controllers and we haven't moved it over to arch/powerpc.

We use the PCI-X Capabilties to know if we are in PCI-X mode instead
of the Global Utilities PORDEVSR.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Make sure virtual P2P bridge registers are setup on PCIe PHB
Kumar Gala [Fri, 20 Jul 2007 18:49:29 +0000 (13:49 -0500)]
[POWERPC] Make sure virtual P2P bridge registers are setup on PCIe PHB

For the Freescale PCIe PHBs Not all firmwares setup the virtual P2P
bridge registers properly.  Make sure they get setup based on what
the struct pci_controller got from the device tree.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Provide ability to setup P2P bridge registers from struct resource
Kumar Gala [Fri, 20 Jul 2007 18:35:34 +0000 (13:35 -0500)]
[POWERPC] Provide ability to setup P2P bridge registers from struct resource

We need the ability to set P2P bridge registers to properly setup the virtual
P2P bridges that exist in PCIe controllers for some of the embedded setups.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Add basic PCI/PCI Express support for 8544DS board
Roy Zang [Fri, 13 Jul 2007 10:05:08 +0000 (18:05 +0800)]
[POWERPC] Add basic PCI/PCI Express support for 8544DS board

Add basic support for the PCIe PHB and enable the ULI bridge.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Make endianess of cfg_addr for indirect pci ops runtime
Kumar Gala [Thu, 19 Jul 2007 21:07:35 +0000 (16:07 -0500)]
[POWERPC] Make endianess of cfg_addr for indirect pci ops runtime

Make it so we do a runtime check to know if we need to write cfg_addr
as big or little endian.  This is needed if we want to allow 86xx support
to co-exist in the same kernel as other 6xx PPCs.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers
Thomas Renninger [Mon, 23 Jul 2007 12:44:41 +0000 (14:44 +0200)]
ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers

modpost is going to use these to create e.g. acpi:ACPI0001
in modules.alias.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: autoload modules - Create ACPI alias interface
Thomas Renninger [Mon, 23 Jul 2007 12:43:51 +0000 (14:43 +0200)]
ACPI: autoload modules - Create ACPI alias interface

Modify modpost (file2alias.c) to add acpi*:XYZ0001: alias in modules.alias
like:
grep acpi /lib/modules/2.6.22-rc4-default/modules.alias
alias acpi*:SNY5001:* sony_laptop
alias acpi*:SNY6001:* sony_laptop
for e.g. the sony_laptop module.
This module matches against all ACPI devices with a HID or CID of SNY5001
or SNY6001

Export an uevent and modalias sysfs file containing the string:
[MODALIAS=]acpi:PNP0C0C:
additional CIDs are concatenated at the end.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: autoload modules - ACPICA modifications
Thomas Renninger [Mon, 23 Jul 2007 12:43:32 +0000 (14:43 +0200)]
ACPI: autoload modules - ACPICA modifications

Define standardized HIDs - Rename current acpi_device_id to acpica_device_id

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: asus-laptop: Fix failure exits
Al Viro [Mon, 23 Jul 2007 10:21:34 +0000 (11:21 +0100)]
ACPI: asus-laptop: Fix failure exits

> Subject         : drivers/misc/asus-laptop.c:*: error: 'struct led_classdev' has no member named 'class_dev'
> References      : http://lkml.org/lkml/2007/7/22/299
> Submitter       : Gabriel C <nix.or.die@googlemail.com>

Fallout from f8a7c6fe14f556ca8eeddce258cb21392d0c3a2f.  However, looking
at it shows that checks done in ASUS_LED_UNREGISTER() can't trigger
at all (we never get to asus_led_exit() if registration fails) and
if that registration fails, we actually leak stuff.  IOW, it's worse
than just replacing class_dev with dev in there - the tests themselves
had been papering over the lousy cleanup logics.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: fix oops due to typo in new throttling code
Luming Yu [Mon, 23 Jul 2007 16:39:28 +0000 (12:39 -0400)]
ACPI: fix oops due to typo in new throttling code

Signed-off-by: Luming Yu <luming.yu@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years ago[POWERPC] Removed setup_indirect_pci_nomap
Kumar Gala [Thu, 19 Jul 2007 20:44:52 +0000 (15:44 -0500)]
[POWERPC] Removed setup_indirect_pci_nomap

We don't use setup_indirect_pci_nomap in arch/powerpc and it appears
the users that needed it from arch/ppc are now using setup_indirect_pci.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 85xx: Add quirk to ignore bogus FPGA on CDS
Kumar Gala [Thu, 19 Jul 2007 20:39:24 +0000 (15:39 -0500)]
[POWERPC] 85xx: Add quirk to ignore bogus FPGA on CDS

The newer Arcadia boards for CDS have an FPGA that shows up on PCI
however isn't a real PCI device.  Add a quirk to just ignore the
FPGA.

This is based on the following patch from Andy & York:

http://ozlabs.org/pipermail/linuxppc-dev/2007-February/032042.html

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 85xx: Added 8568 PCIe support
Kumar Gala [Mon, 16 Jul 2007 15:45:07 +0000 (10:45 -0500)]
[POWERPC] 85xx: Added 8568 PCIe support

Added the PCIe device node to the 8568 dts and the needed quirk entries.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Fixup resources on pci_bus for PCIe PHB when no device is connected
Kumar Gala [Thu, 19 Jul 2007 20:29:53 +0000 (15:29 -0500)]
[POWERPC] Fixup resources on pci_bus for PCIe PHB when no device is connected

On the 85xx/86xx PCIe controllers if there is no device connected to the
PHB we will still allocate a pci_bus for downstream bus of the virtual
P2P bridge. However the resources allocated to the downstream bus are not
correct and so we just mimic the resources from the upstream pci_bus.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Add basic PCI node for mpc8568mds board
Roy Zang [Tue, 10 Jul 2007 10:47:52 +0000 (18:47 +0800)]
[POWERPC] Add basic PCI node for mpc8568mds board

Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Ebony Zhu <ebony.zhu@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Use Freescale pci/pcie common code for 85xx boards
Roy Zang [Tue, 10 Jul 2007 10:47:06 +0000 (18:47 +0800)]
[POWERPC] Use Freescale pci/pcie common code for 85xx boards

Switch the 85xx platform over to using the FSL generic PCI code.  This
gets ups PCIe support in addition to base PCI support.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Update PCI nodes in the 83xx/85xx boards device tree
Roy Zang [Tue, 10 Jul 2007 10:47:21 +0000 (18:47 +0800)]
[POWERPC] Update PCI nodes in the 83xx/85xx boards device tree

Updated the 83xx & 85xx device tree PCI related compartible property.

Used the following compatible properties:
PCI     "fsl,mpc8349-pci"
PCI     "fsl,mpc8540-pci"
PCI-X:  "fsl,mpc8540-pcix"
PCIe:   "fsl,mpc8548-pcie"

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Add 8548 CDS PCI express controller node and PCI-X device node
Roy Zang [Tue, 10 Jul 2007 10:46:47 +0000 (18:46 +0800)]
[POWERPC] Add 8548 CDS PCI express controller node and PCI-X device node

Add 8548 CDS PCI express controller node and PCI-X device node. The current
dts file is suitable for 8548 Rev 2.0 board with Arcadia 3.1.

This kind of board combination is the most popular.

Used the following compatible properties:
PCI "fsl,mpc8540-pci"
PCI-X: "fsl,mpc8540-pcix"
PCIe: "fsl,mpc8548-pcie"

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] FSL: Cleanup how we detect if we are a PCIe controller
Kumar Gala [Wed, 11 Jul 2007 18:31:58 +0000 (13:31 -0500)]
[POWERPC] FSL: Cleanup how we detect if we are a PCIe controller

Use the PCI capabilities to determine if we are PCIe PHB.  Also use
PPC_INDIRECT_TYPE_NO_PCIE_LINK since the Freescale PCIe controllers
will lock the system if they don't have link and you try to do a config
access to anything but the PHB.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Added indirect quirk to handle PCIe PHB that have issue w/no link
Kumar Gala [Wed, 11 Jul 2007 18:22:41 +0000 (13:22 -0500)]
[POWERPC] Added indirect quirk to handle PCIe PHB that have issue w/no link

Added PPC_INDIRECT_TYPE_NO_PCIE_LINK flag to the indirect pci handling
code to ensure that we don't talk to any device other than the PHB
if we don't have PCIe link.  Some controllers will lockup if they try
to do a config cycle to any device on the bus except the PHB.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Add the ability to find PCI capabilities early on
Kumar Gala [Wed, 11 Jul 2007 04:37:45 +0000 (23:37 -0500)]
[POWERPC] Add the ability to find PCI capabilities early on

Added early_find_capability that wraps pci_bus_find_capability and uses
fake_pci_bus() to allow us to call it before we've fully setup the
pci_controller.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Rewrite Freescale PCI/PCIe support for 8{3,5,6}xx
Zang Roy-r61911 [Tue, 10 Jul 2007 10:46:35 +0000 (18:46 +0800)]
[POWERPC] Rewrite Freescale PCI/PCIe support for 8{3,5,6}xx

Rewrite the Freescale PCI code to support PCI on 83xx/85xx/86xx and
PCIe on 85xx/86xx.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Create common fsl pci/e files based on 86xx platforms
Roy Zang [Tue, 10 Jul 2007 10:44:34 +0000 (18:44 +0800)]
[POWERPC] Create common fsl pci/e files based on 86xx platforms

Move
arch/powerpc/platforms/86xx/pci.c -> arch/powerpc/sysdev/fsl_pci.c
arch/powerpc/sysdev/fsl_pcie.h -> arch/powerpc/sysdev/fsl_pci.h
as the base to unify 83xx/85xx/86xx pci and pcie.

Add CONFIG_FSL_PCI to build fsl_pci.c for Freescale pci and pcie option.
The code still works for 86xx platforms.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoSELinux: fix memory leak in security_netlbl_cache_add()
Jesper Juhl [Fri, 20 Jul 2007 22:12:44 +0000 (00:12 +0200)]
SELinux: fix memory leak in security_netlbl_cache_add()

Fix memory leak in security_netlbl_cache_add()
Note: The Coverity checker gets credit for spotting this one.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
16 years agoLinux 2.6.23-rc1 v2.6.23-rc1
Linus Torvalds [Sun, 22 Jul 2007 20:41:00 +0000 (13:41 -0700)]
Linux 2.6.23-rc1

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86_64: Rename CF Makefile variable in vdso
Andi Kleen [Sun, 22 Jul 2007 19:13:11 +0000 (21:13 +0200)]
x86_64: Rename CF Makefile variable in vdso

This avoids a conflict with sparse builds.

Reported by Alexey Dobriyan, fix suggested by Al Viro

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago9p: Don't use binary sysctl numbers.
Eric W. Biederman [Sat, 21 Jul 2007 18:53:19 +0000 (12:53 -0600)]
9p: Don't use binary sysctl numbers.

The recent 9p commit: bd238fb431f31989898423c8b6496bc8c4204a86 that
supposedly only moved files also introduced a new 9p sysctl interface
that did not properly register it's sysctl binary numbers.

And since it was only for debugging clearly did not need a binary fast
path in any case.  So this patch just remove the binary numbers.

See Documentation/sysctl/ctl_unnumbered.txt for more details.

While I was at it I cleaned up the sysctl initializers a little as
well so there is less to read.

Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoDocumentation: Fix a mispelt "probably" in SubmittingPatches.
Linus Nilsson [Sat, 21 Jul 2007 15:49:06 +0000 (17:49 +0200)]
Documentation: Fix a mispelt "probably" in SubmittingPatches.

Fix a typo in SubmittingPatches where "probably" was spelt "probabally".

Signed-off-by: Linus Nilsson <lajnold@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoDocBook: Change a headline in kernel-locking to list all three main types of locking.
Linus Nilsson [Sat, 21 Jul 2007 15:25:34 +0000 (17:25 +0200)]
DocBook: Change a headline in kernel-locking to list all three main types of locking.

Change a headline to reflect that there are three main types of kernel
locking, not two.

Signed-off-by: Linus Nilsson <lajnold@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Sun, 22 Jul 2007 18:45:17 +0000 (11:45 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/ehca: Support small QP queues
  IB/ehca: Make internal_create/destroy_qp() static
  IB/ehca: Move ehca2ib_return_code() out of line
  IB/ehca: Generate async event when SRQ limit reached
  IB/ehca: Support large page MRs
  IB/mlx4: Fix error path in create_qp_common()
  mlx4_core: Change command token on timeout
  IB/mthca: Change command token on timeout
  IB/ipath: Remove ipath_layer dead code
  IB/mlx4: Fix leaks in __mlx4_ib_modify_qp

16 years agotake declarations of enable_irq() et.al. to linux/interrupt.h
Al Viro [Sat, 21 Jul 2007 22:29:12 +0000 (23:29 +0100)]
take declarations of enable_irq() et.al. to linux/interrupt.h

Now that the last inlined instances are gone, all that is left to do
is turning disable_irq_nosync on arm26 and m68k from defines to aliases
and we are all set - we can make these externs in linux/interrupt.h
uncoditional and kill remaining instances in asm/irq.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Linus Torvalds [Sun, 22 Jul 2007 18:36:49 +0000 (11:36 -0700)]
Merge /pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (60 commits)
  [SCSI] libsas: make ATA functions selectable by a config option
  [SCSI] bsg: unexport sg v3 helper functions
  [SCSI] bsg: fix bsg_unregister_queue
  [SCSI] bsg: make class backlinks
  [SCSI] 3w-9xxx: add support for 9690SA
  [SCSI] bsg: fix bsg_register_queue error path
  [SCSI] ESP: Increase ESP_BUS_TIMEOUT to 275.
  [SCSI] libsas: fix scr_read/write users and update the libata documentation
  [SCSI] mpt fusion: update Kconfig help
  [SCSI] scsi_transport_sas: add destructor for bsg
  [SCSI] iscsi_tcp: buggered kmalloc()
  [SCSI] qla2xxx: Update version number to 8.02.00-k2.
  [SCSI] qla2xxx: Add ISP25XX support.
  [SCSI] qla2xxx: Use pci_try_set_mwi().
  [SCSI] qla2xxx: Use PCI-X/PCI-Express read control interfaces.
  [SCSI] qla2xxx: Re-factor isp_operations to static structures.
  [SCSI] qla2xxx: Validate mid-layer 'underflow' during check-condition handling.
  [SCSI] qla2xxx: Correct setting of 'current' and 'supported' speeds during FDMI registration.
  [SCSI] qla2xxx: Generalize iIDMA support.
  [SCSI] qla2xxx: Generalize FW-Interface-2 support.
  ...

16 years ago[SCSI] libsas: make ATA functions selectable by a config option
James Bottomley [Sun, 22 Jul 2007 18:15:55 +0000 (13:15 -0500)]
[SCSI] libsas: make ATA functions selectable by a config option

Not everyone wants libsas automatically to pull in libata.  This patch
makes the behaviour configurable, so you can build libsas with or
without ATA support.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16 years agoMerge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Sun, 22 Jul 2007 18:22:59 +0000 (11:22 -0700)]
Merge branch 'devel' of /home/rmk/linux-2.6-arm

* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (60 commits)
  [ARM] 4524/1: S3C: Move register out of include/asm-arm/arch-s3c2410
  [ARM] 4523/1: S3C: Remove FIFO_MAX from uncompression headers
  [ARM] 4522/1: S3C: split include/asm-arm/arch/memory.h
  [ARM] 4521/2: S3C: Reorganise VA mapping headers
  [ARM] 4520/1: S3C: Remove old VA values from static map
  [ARM] 4519/1: S3C: split S3C2400 values out of S3C24XX map.h
  [ARM] 4518/1: S3C: Rename watchdog configuration options
  [ARM] 4517/1: S3C: Fix debug macros for ARM926 output
  [ARM] 4516/1: S3C: Fix uncompressor serial output for ARM926
  [ARM] 4515/1: S3C: Move uncompress code to plat-s3c
  [ARM] 4514/1: S3C: Rename DEBUG_S3C2410_PORT and DEBUG_S3C_UART
  [ARM] 4513/1: S3C: Rename CONFIG_S3C2410_LOWLEVEL_UART_PORT
  [ARM] 4512/1: S3C: rename the debug macros for per-cpu updates
  [ARM] 4511/1: S3C: updated LLSERIAL Kconfig defines for CPU support
  [ARM] 4510/1: S3C: split debug-macro support into plat-s3c
  [ARM] 4509/1: S3C: Create initial arch/arm/plat-s3c
  [ARM] 4508/1: S3C: Move items to include/asm-arm/plat-s3c
  [ARM] 4461/1: MXC platform and i.MX31ADS core support
  [ARM] 4507/1: pxa2xx clock_event_device
  [ARM] 4497/1: Only allow safe cache configurations on ARMv6 and later
  ...

16 years agoMerge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
Linus Torvalds [Sun, 22 Jul 2007 18:22:01 +0000 (11:22 -0700)]
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds

* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
  leds: Convert from struct class_device to struct device
  leds: leds-gpio for ngw100
  leds: Add warning printks in error paths
  leds: Fix trigger unregister_simple if register_simple fails
  leds: Use menuconfig objects II - LED
  leds: Teach leds-gpio to handle timer-unsafe GPIOs
  leds: Add generic GPIO LED driver

16 years agoMerge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
Linus Torvalds [Sun, 22 Jul 2007 18:19:46 +0000 (11:19 -0700)]
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight

* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight:
  leds: cr_bllcd.c: build fix
  backlight: Convert from struct class_device to struct device
  backlight: Fix order of Kconfig entries

16 years agoMerge branch 'audit.b39' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
Linus Torvalds [Sun, 22 Jul 2007 18:18:20 +0000 (11:18 -0700)]
Merge branch 'audit.b39' of git://git./linux/kernel/git/viro/audit-current

* 'audit.b39' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current:
  [PATCH] get rid of AVC_PATH postponed treatment
  [PATCH] allow audit filtering on bit & operations
  [PATCH] audit: fix broken class-based syscall audit
  [PATCH] Make IPC mode consistent

16 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Linus Torvalds [Sun, 22 Jul 2007 18:17:35 +0000 (11:17 -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:
  [POWERPC] Clean up duplicate includes in drivers/macintosh/
  [POWERPC] Quiet section mismatch warning on pcibios_setup
  [POWERPC] init and exit markings for hvc_iseries
  [POWERPC] Quiet section mismatch in hvc_rtas.c
  [POWERPC] Constify of_platform_driver match_table
  [POWERPC] hvcs: Make some things static and const
  [POWERPC] Constify of_platform_driver name
  [POWERPC] MPIC protected sources
  [POWERPC] of_detach_node()'s device node argument cannot be const
  [POWERPC] Fix ARCH=ppc builds
  [POWERPC] mv64x60: Use mutex instead of semaphore
  [POWERPC] Allow smp_call_function_single() to current cpu
  [POWERPC] Allow exec faults on readable areas on classic 32-bit PowerPC
  [POWERPC] Fix future firmware feature fixups function failure
  [POWERPC] fix showing xmon help
  [POWERPC] Make xmon_write accept a const buffer
  [POWERPC] Fix misspelled "CONFIG_CHECK_CACHE_COHERENCY" Kconfig option.
  [POWERPC] cell: CONFIG_SPE_BASE is a typo

16 years agox86_64: Fix xen section warnings
Andi Kleen [Sun, 22 Jul 2007 11:21:42 +0000 (13:21 +0200)]
x86_64: Fix xen section warnings

Fix

WARNING: vmlinux.o(.data+0x99): Section mismatch: reference to .init.text:xen_start_kernel (between 'startup_xen' and 'boot_gdt_descr')

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86_64: Fix paravirt compilation
Andi Kleen [Sun, 22 Jul 2007 11:21:41 +0000 (13:21 +0200)]
x86_64: Fix paravirt compilation

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofix broken handling of port=... in NFS option parsing
Al Viro [Sun, 22 Jul 2007 09:59:06 +0000 (10:59 +0100)]
fix broken handling of port=... in NFS option parsing

Obviously broken on little-endian; fortunately, the option is not
frequently used...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[ Hey, sparse is wonderful, but even better than sparse is having people
  like Al that actually _run_ it and fix bugs using it.    - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoKVM: Require CONFIG_ANON_INODES
Avi Kivity [Sun, 22 Jul 2007 09:40:30 +0000 (12:40 +0300)]
KVM: Require CONFIG_ANON_INODES

Found by Sebastian Siewior and randconfig.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Sun, 22 Jul 2007 18:04:11 +0000 (11:04 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (77 commits)
  ACPI: Populate /sys/firmware/acpi/tables/
  ACPI: create CONFIG_ACPI_DEBUG_FUNC_TRACE
  ACPI: update ACPI proc I/F removal schedule
  ACPI: update feature-removal-schedule.txt, /sys/firmware/acpi/namespace is gone
  ACPI: export ACPI events via acpi_mc_group multicast group
  ACPI: fix empty macros found by -Wextra
  ACPI: drivers/acpi/pci_link.c: lower printk severity
  sony-laptop: Fix event reading in sony-laptop
  sony-laptop: Add Vaio FE to the special init sequence
  sony-laptop: Make the driver use MSC_SCAN and a setkeycode and getkeycode key table.
  sony-laptop: Invoke _INI for SNC devices that provide it
  sony-laptop: Add support for recent Vaios Fn keys (C series for now)
  sony-laptop: map wireless switch events to KEY_WLAN
  sony-laptop: add new SNC handlers
  ACPI: thinkpad-acpi: add locking to brightness subdriver
  ACPI: thinkpad-acpi: bump up version to 0.15
  ACPI: thinkpad-acpi: make EC-based thermal readings non-experimental
  ACPI: thinkpad-acpi: make sure DSDT TMPx readings don't return +128
  ACPI: thinkpad-acpi: react to Lenovo ThinkPad differences in hot key
  ACPI: thinkpad-acpi: allow use of CMOS NVRAM for brightness control
  ...

16 years agox86_64: Share msidef.h and hypertransport.h includes with i386
Andi Kleen [Sun, 22 Jul 2007 09:12:47 +0000 (11:12 +0200)]
x86_64: Share msidef.h and hypertransport.h includes with i386

They are identical

Indirectly pointed out by Thomas Gleixner

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86_64: Remove outdated comment in boot decompressor Makefile
Andi Kleen [Sun, 22 Jul 2007 09:12:46 +0000 (11:12 +0200)]
x86_64: Remove outdated comment in boot decompressor Makefile

64bit code in there now since some time.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86_64: Squash initial_code modpost warnings
Andi Kleen [Sun, 22 Jul 2007 09:12:45 +0000 (11:12 +0200)]
x86_64: Squash initial_code modpost warnings

Get rid of warnings like

WARNING: vmlinux.o(.bootstrap.text+0x1a8): Section mismatch: reference to .init.text:x86_64_start_kernel (between 'initial_code' and 'init_rsp')

- Move initialization code into .text.head like i386 because modpost knows about this already
- Mark initial_code .initdata

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86_64: fix section mismatch warning in init.c
Sam Ravnborg [Sun, 22 Jul 2007 09:12:44 +0000 (11:12 +0200)]
x86_64: fix section mismatch warning in init.c

Fix following warning:
WARNING: vmlinux.o(.text+0x188ea): Section mismatch: reference to .init.text:__alloc_bootmem_core (between 'alloc_bootmem_high_node' and 'get_gate_vma')

alloc_bootmem_high_node() is only used from __init scope so declare it __init.
And in addition declare the weak variant __init too.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86_64: fix section mismatch warning in hpet.c
Sam Ravnborg [Sun, 22 Jul 2007 09:12:42 +0000 (11:12 +0200)]
x86_64: fix section mismatch warning in hpet.c

Fix following warnings:
WARNING: vmlinux.o(.text+0x945e): Section mismatch: reference to .init.text:__set_fixmap (between 'hpet_arch_init' and 'hpet_mask_rtc_irq_bit')
WARNING: vmlinux.o(.text+0x9474): Section mismatch: reference to .init.text:__set_fixmap (between 'hpet_arch_init' and 'hpet_mask_rtc_irq_bit')

hpet_arch_init is only used from __init context so mark it __init.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoi386: Fix the K7 NMI watchdog checkbit
Björn Steinbrink [Sun, 22 Jul 2007 09:12:41 +0000 (11:12 +0200)]
i386: Fix the K7 NMI watchdog checkbit

The performance counters on K7 are only 48 bits wide, so using bit 63 to
check if the counter overflowed is wrong. Let's use bit 47 instead.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Cc: Don Zickus <dzickus@redhat.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoi386: Use patchable lock prefix in set_64bit
Andi Kleen [Sun, 22 Jul 2007 09:12:40 +0000 (11:12 +0200)]
i386: Use patchable lock prefix in set_64bit

Previously lock was unconditionally used, but shouldn't be needed on
UP systems.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoi386: Handle P6s without performance counters in nmi watchdog
Andi Kleen [Sun, 22 Jul 2007 09:12:39 +0000 (11:12 +0200)]
i386: Handle P6s without performance counters in nmi watchdog

I got an oops while booting a 32bit kernel on KVM because it doesn't
implement performance counters used by the NMI watchdog. Handle this
case.

Cc: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86: Replace NSC/Cyrix specific chipset access macros by inlined functions.
Juergen Beisert [Sun, 22 Jul 2007 09:12:38 +0000 (11:12 +0200)]
x86: Replace NSC/Cyrix specific chipset access macros by inlined functions.

Due to index register access ordering problems, when using macros a line
like this fails (and does nothing):

setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);

With inlined functions this line will work as expected.

Note about a side effect: Seems on Geode GX1 based systems the
"suspend on halt power saving feature" was never enabled due to this
wrong macro expansion. With inlined functions it will be enabled, but
this will stop the TSC when the CPU runs into a HLT instruction.
Kernel output something like this:
Clocksource tsc unstable (delta = -472746897 ns)

This is the 3rd version of this patch.

 - Adding missed arch/i386/kernel/cpu/mtrr/state.c
Thanks to Andres Salomon
 - Adding some big fat comments into the new header file
  Suggested by Andi Kleen

AK: fixed x86-64 compilation

Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86_64: x86_64 - Use non locked version for local_cmpxchg()
Mathieu Desnoyers [Sun, 22 Jul 2007 09:12:37 +0000 (11:12 +0200)]
x86_64: x86_64 - Use non locked version for local_cmpxchg()

local_cmpxchg() should not use any LOCK prefix.  This change probably
got lost in the move to cmpxchg.h.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoi386: Do not include other cpus' interrupt 0 in nmi_watchdog
Keith Owens [Sun, 22 Jul 2007 09:12:36 +0000 (11:12 +0200)]
i386: Do not include other cpus' interrupt 0 in nmi_watchdog

kstat_irqs(0) includes the count of interrupt 0 from all cpus, not just
the current cpu.  The updated interrupt 0 on other cpus can stop the
nmi_watchdog from tripping, so only include the current cpu's int 0.

Signed-off-by: Keith Owens <kaos@ocs.com.au>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoi386: Tune AMD Fam10h/11h like K8
Andi Kleen [Sun, 22 Jul 2007 09:12:35 +0000 (11:12 +0200)]
i386: Tune AMD Fam10h/11h like K8

This mainly changes the nops for alternative, so not very revolutionary.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86_64: Set K8 CPUID flag for K8/Fam10h/Fam11h
Andi Kleen [Sun, 22 Jul 2007 09:12:34 +0000 (11:12 +0200)]
x86_64: Set K8 CPUID flag for K8/Fam10h/Fam11h

Previously this flag was only used on 32bit, but some shared code can use
it now.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoi386: Fix cpu_llc_id section mismatch warning
Andi Kleen [Sun, 22 Jul 2007 09:12:33 +0000 (11:12 +0200)]
i386: Fix cpu_llc_id section mismatch warning

Fix

WARNING: arch/i386/kernel/built-in.o(.text+0xdd0d): Section mismatch: reference to .init.data:cpu_llc_id (between 'set_cpu_sibling_map' and 'initialize_secondary')
WARNING: arch/i386/kernel/built-in.o(.text+0xdd1b): Section mismatch: reference to .init.data:cpu_llc_id (between 'set_cpu_sibling_map' and 'initialize_secondary')

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86: Stop MCEs and NMIs during code patching
Andi Kleen [Sun, 22 Jul 2007 09:12:32 +0000 (11:12 +0200)]
x86: Stop MCEs and NMIs during code patching

When a machine check or NMI occurs while multiple byte code is patched
the CPU could theoretically see an inconsistent instruction and crash.
Prevent this by temporarily disabling MCEs and returning early in the
NMI handler.

Based on discussion with Mathieu Desnoyers.

Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86: Fix alternatives and kprobes to remap write-protected kernel text
Andi Kleen [Sun, 22 Jul 2007 09:12:31 +0000 (11:12 +0200)]
x86: Fix alternatives and kprobes to remap write-protected kernel text

Reenable kprobes and alternative patching when the kernel text is write
protected by DEBUG_RODATA

Add a general utility function to change write protected text.  The new
function remaps the code using vmap to write it and takes care of CPU
synchronization.  It also does CLFLUSH to make icache recovery faster.

There are some limitations on when the function can be used, see the
comment.

This is a newer version that also changes the paravirt_ops code.
text_poke also supports multi byte patching now.

Contains bug fixes from Zach Amsden and suggestions from Mathieu
Desnoyers.

Cc: Jan Beulich <jbeulich@novell.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Zach Amsden <zach@vmware.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86_64: Use read and write crX in .c files
Glauber de Oliveira Costa [Sun, 22 Jul 2007 09:12:29 +0000 (11:12 +0200)]
x86_64: Use read and write crX in .c files

This patch uses the read and write functions provided at system.h
for control registers instead of writting raw assembly over and
over again in .c files. Functions to manipulate cr2 and cr8 were
provided, as they were lacking.

Also, removed some extra space after closing brackets

Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86: i386-show-unhandled-signals-v3
Masoud Asgharifard Sharbiani [Sun, 22 Jul 2007 09:12:28 +0000 (11:12 +0200)]
x86: i386-show-unhandled-signals-v3

This patch makes the i386 behave the same way that x86_64 does when a
segfault happens.  A line gets printed to the kernel log so that tools
that need to check for failures can behave more uniformly between
debug.show_unhandled_signals sysctl variable to 0 (or by doing echo 0 >
/proc/sys/debug/exception-trace)

Also, all of the lines being printed are now using printk_ratelimit() to
deny the ability of DoS from a local user with a program like the
following:

main()
{
       while (1)
               if (!fork()) *(int *)0 = 0;
}

This new revision also includes the fix that Andrew did which got rid of
new sysctl that was added to the system in earlier versions of this.
Also, 'show-unhandled-signals' sysctl has been renamed back to the old
'exception-trace' to avoid breakage of people's scripts.

AK: Enabling by default for i386 will be likely controversal, but let's see what happens
AK: Really folks, before complaining just fix your segfaults
AK: I bet this will find a lot of silent issues

Signed-off-by: Masoud Sharbiani <masouds@google.com>
Signed-off-by: Andi Kleen <ak@suse.de>
[ Personally, I've found the complaints useful on x86-64, so I'm all for
  this. That said, I wonder if we could do it more prettily..   -Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoFix ppc64 mismerge
Al Viro [Sun, 22 Jul 2007 07:10:35 +0000 (08:10 +0100)]
Fix ppc64 mismerge

Fix a mismerge in commit 8b6f50ef1d5cc86b278eb42bc91630fad455fb10:
"spufs: make signal-notification files readonly for NOSCHED contexts",
where structs got duplicated.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branches 'at91', 'imx', 'iop', 'ixp', 'ks8695', 'misc', 'ns9xxx', 'pxa' and...
Russell King [Sun, 22 Jul 2007 16:09:17 +0000 (17:09 +0100)]
Merge branches 'at91', 'imx', 'iop', 'ixp', 'ks8695', 'misc', 'ns9xxx', 'pxa' and 's3c' into devel

16 years ago[ARM] 4524/1: S3C: Move register out of include/asm-arm/arch-s3c2410
Ben Dooks [Sun, 22 Jul 2007 15:23:02 +0000 (16:23 +0100)]
[ARM] 4524/1: S3C: Move register out of include/asm-arm/arch-s3c2410

Move register and other definitions out of the
include/asm-arm/arch-s3c2410 into the the arch
directories of include/asm-arm/plat-s3c24xx and
include/asm-arm/plat-s3c.

This move is in preperation of the merging of
s3c2400 and s3c6400.

The following git mv commands are needed before
this patch can be applied:

git mv include/asm-arm/arch-s3c2410/regs-ac97.h include/asm-arm/plat-s3c/regs-ac97.h
git mv include/asm-arm/arch-s3c2410/regs-adc.h include/asm-arm/plat-s3c/regs-adc.h
git mv include/asm-arm/arch-s3c2410/regs-iis.h include/asm-arm/plat-s3c24xx/regs-iis.h
git mv include/asm-arm/arch-s3c2410/regs-spi.h include/asm-arm/plat-s3c24xx/regs-spi.h
git mv include/asm-arm/arch-s3c2410/regs-udc.h include/asm-arm/plat-s3c24xx/regs-udc.h
git mv include/asm-arm/arch-s3c2410/udc.h include/asm-arm/plat-s3c24xx/udc.h

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4523/1: S3C: Remove FIFO_MAX from uncompression headers
Ben Dooks [Sun, 22 Jul 2007 15:22:06 +0000 (16:22 +0100)]
[ARM] 4523/1: S3C: Remove FIFO_MAX from uncompression headers

We've fixed up a number of faults with the uncompressors
so remove the now unused FIFO_MAX as it is not needed.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4522/1: S3C: split include/asm-arm/arch/memory.h
Ben Dooks [Sun, 22 Jul 2007 15:21:21 +0000 (16:21 +0100)]
[ARM] 4522/1: S3C: split include/asm-arm/arch/memory.h

Split the S3C2400 out of S3C2410 memory.h files
ready for S3C2400 support to be added.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4521/2: S3C: Reorganise VA mapping headers
Ben Dooks [Sun, 22 Jul 2007 15:59:44 +0000 (16:59 +0100)]
[ARM] 4521/2: S3C: Reorganise VA mapping headers

Reorganise the definition of the virtual addresses
used into a common header and update the users to
rename S3C2410 items into a more common S3C defined
macros.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4520/1: S3C: Remove old VA values from static map
Ben Dooks [Sun, 22 Jul 2007 15:20:04 +0000 (16:20 +0100)]
[ARM] 4520/1: S3C: Remove old VA values from static map

Remove the static maps for the LCD and USB devices.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4519/1: S3C: split S3C2400 values out of S3C24XX map.h
Ben Dooks [Sun, 22 Jul 2007 15:18:22 +0000 (16:18 +0100)]
[ARM] 4519/1: S3C: split S3C2400 values out of S3C24XX map.h

Move the S3C2400 values to their own include directory
series in include/asm-arm/arch-s3c2400 as the support
for the S3C2400 is best placed in its own arch directory.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4518/1: S3C: Rename watchdog configuration options
Ben Dooks [Sun, 22 Jul 2007 15:16:51 +0000 (16:16 +0100)]
[ARM] 4518/1: S3C: Rename watchdog configuration options

Rename the S3C24XX configuration options for the watchdog
boot controls for moving to the arch/arm/plat-s3c moves.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4517/1: S3C: Fix debug macros for ARM926 output
Ben Dooks [Sun, 22 Jul 2007 15:15:44 +0000 (16:15 +0100)]
[ARM] 4517/1: S3C: Fix debug macros for ARM926 output

Check for ARM926 based S3C24XX based devices as these
only have 64 byte FIFOs, and do not have the model
detection refisters in the same place as the ARM920
based CPUs

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4516/1: S3C: Fix uncompressor serial output for ARM926
Ben Dooks [Sun, 22 Jul 2007 15:14:02 +0000 (16:14 +0100)]
[ARM] 4516/1: S3C: Fix uncompressor serial output for ARM926

Ensure we check for ARM926 in the uncompressor, as all current
ARM926s do not have an ID register and all have S3C2440 style
UARTs.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4515/1: S3C: Move uncompress code to plat-s3c
Ben Dooks [Sun, 22 Jul 2007 15:13:29 +0000 (16:13 +0100)]
[ARM] 4515/1: S3C: Move uncompress code to plat-s3c

Move the uncompress.h to plat-s3c

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4514/1: S3C: Rename DEBUG_S3C2410_PORT and DEBUG_S3C_UART
Ben Dooks [Sun, 22 Jul 2007 15:12:04 +0000 (16:12 +0100)]
[ARM] 4514/1: S3C: Rename DEBUG_S3C2410_PORT and DEBUG_S3C_UART

Rename DEBUG_S3C2410_PORT to DEBUG_S3C_PORT as well as
DEBUG_S3C2410_UART to DEBUG_S3C_UART as part of the updates
to moving to plat-s3c for S3C base support.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4513/1: S3C: Rename CONFIG_S3C2410_LOWLEVEL_UART_PORT
Ben Dooks [Sun, 22 Jul 2007 15:11:20 +0000 (16:11 +0100)]
[ARM] 4513/1: S3C: Rename CONFIG_S3C2410_LOWLEVEL_UART_PORT

Rename CONFIG_S3C2410_LOWLEVEL_UART_PORT to be
CONFIG_S3C_LOWLEVEL_UART_PORT as we move to using
plat-s3c for base of S3C operations.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4512/1: S3C: rename the debug macros for per-cpu updates
Ben Dooks [Sun, 22 Jul 2007 15:10:23 +0000 (16:10 +0100)]
[ARM] 4512/1: S3C: rename the debug macros for per-cpu updates

Update the debug macros for use with the new per-cpu
configuration and usage.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4511/1: S3C: updated LLSERIAL Kconfig defines for CPU support
Ben Dooks [Sun, 22 Jul 2007 15:09:44 +0000 (16:09 +0100)]
[ARM] 4511/1: S3C: updated LLSERIAL Kconfig defines for CPU support

Update the Kconfig to create configuration options based on which
CPUs are supported for the low level serial code. This means that
the debug macros can be optimised for the type(s) of CPU that are
being used.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4510/1: S3C: split debug-macro support into plat-s3c
Ben Dooks [Sun, 22 Jul 2007 15:08:48 +0000 (16:08 +0100)]
[ARM] 4510/1: S3C: split debug-macro support into plat-s3c

Move the common parts of the debug macros into include/asm-arm/plat-s3c
ready to be used for the common S3C support.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4509/1: S3C: Create initial arch/arm/plat-s3c
Ben Dooks [Sun, 22 Jul 2007 15:07:09 +0000 (16:07 +0100)]
[ARM] 4509/1: S3C: Create initial arch/arm/plat-s3c

Create the initial arch/arm/plat-s3c directory and start
linking it into the arch/arm build heirarchy ready to
receive the generic parts of the S3C24XX support to be
used when adding S3C6400 devices.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4508/1: S3C: Move items to include/asm-arm/plat-s3c
Ben Dooks [Sun, 22 Jul 2007 15:05:25 +0000 (16:05 +0100)]
[ARM] 4508/1: S3C: Move items to include/asm-arm/plat-s3c

This patch moves items of the s3c24xx support into
a new plat-s3c directory for items that use the
s3c24xx support but are not directly s3c24xx
compatible, such as the s3c2400 and s3c6400.

git mv commands:
git mv include/asm-arm/arch-s3c2410/iic.h include/asm-arm/plat-s3c/iic.h
git mv include/asm-arm/arch-s3c2410/nand.h include/asm-arm/plat-s3c/nand.h
git mv include/asm-arm/arch-s3c2410/regs-iic.h include/asm-arm/plat-s3c/regs-iic.h
git mv include/asm-arm/arch-s3c2410/regs-nand.h include/asm-arm/plat-s3c/regs-nand.h
git mv include/asm-arm/arch-s3c2410/regs-rtc.h include/asm-arm/plat-s3c/regs-rtc.h
git mv include/asm-arm/arch-s3c2410/regs-serial.h include/asm-arm/plat-s3c/regs-serial.h
git mv include/asm-arm/arch-s3c2410/regs-timer.h include/asm-arm/plat-s3c/regs-timer.h
git mv include/asm-arm/arch-s3c2410/regs-watchdog.h include/asm-arm/plat-s3c/regs-watchdog.h

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4461/1: MXC platform and i.MX31ADS core support
Quinn Jensen [Mon, 9 Jul 2007 21:06:53 +0000 (22:06 +0100)]
[ARM] 4461/1: MXC platform and i.MX31ADS core support

This patch adds the foundation pieces for
the Freescale MXC platforms, including
i.MX2 and i.MX3 based systems.

The bare-bones MX31 support in this patch
boots to the rootdev panic with 8250 serial
console configured "console=ttyS0,115200".
It assumes that Redboot is the boot loader.

Signed-off-by: Quinn Jensen <quinn.jensen@freescale.com>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>