diff --git a/[refs] b/[refs] index 28498ab5cefd..07b9b7457a88 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 34750bb15687fa03ba95a0ccb1307b0727bc308b +refs/heads/master: ef6051a90e2ad1af636e99d1d4603fdcf2adfcbe diff --git a/trunk/Documentation/BUG-HUNTING b/trunk/Documentation/BUG-HUNTING index 35f5bd243336..65b97e1dbf70 100644 --- a/trunk/Documentation/BUG-HUNTING +++ b/trunk/Documentation/BUG-HUNTING @@ -191,30 +191,6 @@ e.g. crash dump output as shown by Dave Miller. > mov 0x8(%ebp), %ebx ! %ebx = skb->sk > mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt -In addition, you can use GDB to figure out the exact file and line -number of the OOPS from the vmlinux file. If you have -CONFIG_DEBUG_INFO enabled, you can simply copy the EIP value from the -OOPS: - - EIP: 0060:[] Not tainted VLI - -And use GDB to translate that to human-readable form: - - gdb vmlinux - (gdb) l *0xc021e50e - -If you don't have CONFIG_DEBUG_INFO enabled, you use the function -offset from the OOPS: - - EIP is at vt_ioctl+0xda8/0x1482 - -And recompile the kernel with CONFIG_DEBUG_INFO enabled: - - make vmlinux - gdb vmlinux - (gdb) p vt_ioctl - (gdb) l *(0x
+ 0xda8) - Another very useful option of the Kernel Hacking section in menuconfig is Debug memory allocations. This will help you see whether data has been initialised and not set before use etc. To see the values that get assigned diff --git a/trunk/Documentation/SubmitChecklist b/trunk/Documentation/SubmitChecklist index 6ebffb57e3db..3af3e65cf43b 100644 --- a/trunk/Documentation/SubmitChecklist +++ b/trunk/Documentation/SubmitChecklist @@ -84,9 +84,3 @@ kernel patches. 24: Avoid whitespace damage such as indenting with spaces or whitespace at the end of lines. You can test this by feeding the patch to "git apply --check --whitespace=error-all" - -25: Check your patch for general style as detailed in - Documentation/CodingStyle. Check for trivial violations with the - patch style checker prior to submission (scripts/checkpatch.pl). - You should be able to justify all violations that remain in - your patch. diff --git a/trunk/Documentation/SubmittingPatches b/trunk/Documentation/SubmittingPatches index d91125ab6f49..a417b25fb1aa 100644 --- a/trunk/Documentation/SubmittingPatches +++ b/trunk/Documentation/SubmittingPatches @@ -118,20 +118,7 @@ then only post say 15 or so at a time and wait for review and integration. -4) Style check your changes. - -Check your patch for basic style violations, details of which can be -found in Documentation/CodingStyle. Failure to do so simply wastes -the reviewers time and will get your patch rejected, probabally -without even being read. - -At a minimum you should check your patches with the patch style -checker prior to submission (scripts/patchcheck.pl). You should -be able to justify all violations that remain in your patch. - - - -5) Select e-mail destination. +4) Select e-mail destination. Look through the MAINTAINERS file and the source code, and determine if your change applies to a specific subsystem of the kernel, with @@ -159,7 +146,7 @@ discussed should the patch then be submitted to Linus. -6) Select your CC (e-mail carbon copy) list. +5) Select your CC (e-mail carbon copy) list. Unless you have a reason NOT to do so, CC linux-kernel@vger.kernel.org. @@ -200,7 +187,8 @@ URL: -7) No MIME, no links, no compression, no attachments. Just plain text. + +6) No MIME, no links, no compression, no attachments. Just plain text. Linus and other kernel developers need to be able to read and comment on the changes you are submitting. It is important for a kernel @@ -235,9 +223,9 @@ pref("mailnews.display.disable_format_flowed_support", true); -8) E-mail size. +7) E-mail size. -When sending patches to Linus, always follow step #7. +When sending patches to Linus, always follow step #6. Large changes are not appropriate for mailing lists, and some maintainers. If your patch, uncompressed, exceeds 40 kB in size, @@ -246,7 +234,7 @@ server, and provide instead a URL (link) pointing to your patch. -9) Name your kernel version. +8) Name your kernel version. It is important to note, either in the subject line or in the patch description, the kernel version to which this patch applies. @@ -256,7 +244,7 @@ Linus will not apply it. -10) Don't get discouraged. Re-submit. +9) Don't get discouraged. Re-submit. After you have submitted your change, be patient and wait. If Linus likes your change and applies it, it will appear in the next version @@ -282,7 +270,7 @@ When in doubt, solicit comments on linux-kernel mailing list. -11) Include PATCH in the subject +10) Include PATCH in the subject Due to high e-mail traffic to Linus, and to linux-kernel, it is common convention to prefix your subject line with [PATCH]. This lets Linus @@ -291,7 +279,7 @@ e-mail discussions. -12) Sign your work +11) Sign your work To improve tracking of who did what, especially with patches that can percolate to their final resting place in the kernel through several @@ -340,8 +328,7 @@ now, but you can do this to mark internal company procedures or just point out some special detail about the sign-off. - -13) The canonical patch format +12) The canonical patch format The canonical patch subject line is: @@ -440,10 +427,6 @@ section Linus Computer Science 101. Nuff said. If your code deviates too much from this, it is likely to be rejected without further review, and without comment. -Check your patches with the patch style checker prior to submission -(scripts/checkpatch.pl). You should be able to justify all -violations that remain in your patch. - 2) #ifdefs are ugly diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index 49ae1ea9e868..2d7ea85075ba 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -70,7 +70,6 @@ Who: David Miller What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. When: December 2006 -Files: include/linux/video_decoder.h Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 series. The old API have lots of drawbacks and don't provide enough means to work with all video and audio standards. The newer API is diff --git a/trunk/Documentation/hrtimer/timer_stats.txt b/trunk/Documentation/hrtimer/timer_stats.txt index 22b0814d0ad0..27f782e3593f 100644 --- a/trunk/Documentation/hrtimer/timer_stats.txt +++ b/trunk/Documentation/hrtimer/timer_stats.txt @@ -2,10 +2,9 @@ timer_stats - timer usage statistics ------------------------------------ timer_stats is a debugging facility to make the timer (ab)usage in a Linux -system visible to kernel and userspace developers. If enabled in the config -but not used it has almost zero runtime overhead, and a relatively small -data structure overhead. Even if collection is enabled runtime all the -locking is per-CPU and lookup is hashed. +system visible to kernel and userspace developers. It is not intended for +production usage as it adds significant overhead to the (hr)timer code and the +(hr)timer data structures. timer_stats should be used by kernel and userspace developers to verify that their code does not make unduly use of timers. This helps to avoid unnecessary diff --git a/trunk/Documentation/ia64/aliasing-test.c b/trunk/Documentation/ia64/aliasing-test.c index d485256ee1ce..3153167b41c3 100644 --- a/trunk/Documentation/ia64/aliasing-test.c +++ b/trunk/Documentation/ia64/aliasing-test.c @@ -197,7 +197,7 @@ int scan_rom(char *path, char *file) return rc; } -int main() +main() { int rc; diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index 5d0283cd3a81..aae2282600ca 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -170,10 +170,7 @@ and is between 256 and 4096 characters. It is defined in the file acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS Format: To spoof as Windows 98: ="Microsoft Windows" - acpi_osi= [HW,ACPI] Modify list of supported OS interface strings - acpi_osi="string1" # add string1 -- only one string - acpi_osi="!string2" # remove built-in string2 - acpi_osi= # disable all strings + acpi_osi= [HW,ACPI] empty param disables _OSI acpi_serialize [HW,ACPI] force serialization of AML methods @@ -1135,9 +1132,9 @@ and is between 256 and 4096 characters. It is defined in the file when set. Format: - noaliencache [MM, NUMA, SLAB] Disables the allocation of alien - caches in the slab allocator. Saves per-node memory, - but will impact performance. + noaliencache [MM, NUMA] Disables the allcoation of alien caches in + the slab allocator. Saves per-node memory, but will + impact performance on real NUMA hardware. noalign [KNL,ARM] @@ -1616,37 +1613,6 @@ and is between 256 and 4096 characters. It is defined in the file slram= [HW,MTD] - slub_debug [MM, SLUB] - Enabling slub_debug allows one to determine the culprit - if slab objects become corrupted. Enabling slub_debug - creates guard zones around objects and poisons objects - when not in use. Also tracks the last alloc / free. - For more information see Documentation/vm/slub.txt. - - slub_max_order= [MM, SLUB] - Determines the maximum allowed order for slabs. Setting - this too high may cause fragmentation. - For more information see Documentation/vm/slub.txt. - - slub_min_objects= [MM, SLUB] - The minimum objects per slab. SLUB will increase the - slab order up to slub_max_order to generate a - sufficiently big slab to satisfy the number of objects. - The higher the number of objects the smaller the overhead - of tracking slabs. - For more information see Documentation/vm/slub.txt. - - slub_min_order= [MM, SLUB] - Determines the mininum page order for slabs. Must be - lower than slub_max_order - For more information see Documentation/vm/slub.txt. - - slub_nomerge [MM, SLUB] - Disable merging of slabs of similar size. May be - necessary if there is some reason to distinguish - allocs to different slabs. - For more information see Documentation/vm/slub.txt. - smart2= [HW] Format: [,[,...,]] diff --git a/trunk/Documentation/networking/xfrm_sysctl.txt b/trunk/Documentation/networking/xfrm_sysctl.txt deleted file mode 100644 index 5bbd16792fe1..000000000000 --- a/trunk/Documentation/networking/xfrm_sysctl.txt +++ /dev/null @@ -1,4 +0,0 @@ -/proc/sys/net/core/xfrm_* Variables: - -xfrm_acq_expires - INTEGER - default 30 - hard timeout in seconds for acquire requests diff --git a/trunk/Documentation/powerpc/booting-without-of.txt b/trunk/Documentation/powerpc/booting-without-of.txt index d42d98107d49..b49ce169a63a 100644 --- a/trunk/Documentation/powerpc/booting-without-of.txt +++ b/trunk/Documentation/powerpc/booting-without-of.txt @@ -1,6 +1,7 @@ Booting the Linux/ppc kernel without Open Firmware -------------------------------------------------- + (c) 2005 Benjamin Herrenschmidt , IBM Corp. (c) 2005 Becky Bruce , @@ -8,62 +9,6 @@ (c) 2006 MontaVista Software, Inc. Flash chip node definition -Table of Contents -================= - - I - Introduction - 1) Entry point for arch/powerpc - 2) Board support - - II - The DT block format - 1) Header - 2) Device tree generalities - 3) Device tree "structure" block - 4) Device tree "strings" block - - III - Required content of the device tree - 1) Note about cells and address representation - 2) Note about "compatible" properties - 3) Note about "name" properties - 4) Note about node and property names and character set - 5) Required nodes and properties - a) The root node - b) The /cpus node - c) The /cpus/* nodes - d) the /memory node(s) - e) The /chosen node - f) the /soc node - - IV - "dtc", the device tree compiler - - V - Recommendations for a bootloader - - VI - System-on-a-chip devices and nodes - 1) Defining child nodes of an SOC - 2) Representing devices without a current OF specification - a) MDIO IO device - c) PHY nodes - b) Gianfar-compatible ethernet nodes - d) Interrupt controllers - e) I2C - f) Freescale SOC USB controllers - g) Freescale SOC SEC Security Engines - h) Board Control and Status (BCSR) - i) Freescale QUICC Engine module (QE) - g) Flash chip nodes - - VII - Specifying interrupt information for devices - 1) interrupts property - 2) interrupt-parent property - 3) OpenPIC Interrupt Controllers - 4) ISA Interrupt Controllers - - Appendix A - Sample SOC node for MPC8540 - - -Revision Information -==================== - May 18, 2005: Rev 0.1 - Initial draft, no chapter III yet. May 19, 2005: Rev 0.2 - Add chapter III and bits & pieces here or @@ -1742,7 +1687,7 @@ platforms are moved over to use the flattened-device-tree model. }; }; - j) Flash chip nodes + g) Flash chip nodes Flash chips (Memory Technology Devices) are often used for solid state file systems on embedded devices. diff --git a/trunk/Documentation/sound/alsa/ALSA-Configuration.txt b/trunk/Documentation/sound/alsa/ALSA-Configuration.txt index 355ff0a2bb7c..57b878cc393c 100644 --- a/trunk/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/trunk/Documentation/sound/alsa/ALSA-Configuration.txt @@ -917,7 +917,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. ref Reference board, base config m2-2 Some Gateway MX series laptops m6 Some Gateway NX series laptops - pa6 Gateway NX860 series STAC9227/9228/9229/927x ref Reference board diff --git a/trunk/Documentation/thinkpad-acpi.txt b/trunk/Documentation/thinkpad-acpi.txt index 9e6b94face4b..2d4803359a04 100644 --- a/trunk/Documentation/thinkpad-acpi.txt +++ b/trunk/Documentation/thinkpad-acpi.txt @@ -138,7 +138,7 @@ Hot keys -------- procfs: /proc/acpi/ibm/hotkey -sysfs device attribute: hotkey_* +sysfs device attribute: hotkey/* Without this driver, only the Fn-F4 key (sleep button) generates an ACPI event. With the driver loaded, the hotkey feature enabled and the @@ -196,7 +196,10 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file: sysfs notes: - hotkey_bios_enabled: + The hot keys attributes are in a hotkey/ subdirectory off the + thinkpad device. + + bios_enabled: Returns the status of the hot keys feature when thinkpad-acpi was loaded. Upon module unload, the hot key feature status will be restored to this value. @@ -204,19 +207,19 @@ sysfs notes: 0: hot keys were disabled 1: hot keys were enabled - hotkey_bios_mask: + bios_mask: Returns the hot keys mask when thinkpad-acpi was loaded. Upon module unload, the hot keys mask will be restored to this value. - hotkey_enable: + enable: Enables/disables the hot keys feature, and reports current status of the hot keys feature. 0: disables the hot keys feature / feature disabled 1: enables the hot keys feature / feature enabled - hotkey_mask: + mask: bit mask to enable ACPI event generation for each hot key (see above). Returns the current status of the hot keys mask, and allows one to modify it. @@ -226,7 +229,7 @@ Bluetooth --------- procfs: /proc/acpi/ibm/bluetooth -sysfs device attribute: bluetooth_enable +sysfs device attribute: bluetooth/enable This feature shows the presence and current state of a ThinkPad Bluetooth device in the internal ThinkPad CDC slot. @@ -241,7 +244,7 @@ If Bluetooth is installed, the following commands can be used: Sysfs notes: If the Bluetooth CDC card is installed, it can be enabled / - disabled through the "bluetooth_enable" thinkpad-acpi device + disabled through the "bluetooth/enable" thinkpad-acpi device attribute, and its current status can also be queried. enable: @@ -249,7 +252,7 @@ Sysfs notes: 1: enables Bluetooth / Bluetooth is enabled. Note: this interface will be probably be superseeded by the - generic rfkill class, so it is NOT to be considered stable yet. + generic rfkill class. Video output control -- /proc/acpi/ibm/video -------------------------------------------- @@ -895,7 +898,7 @@ EXPERIMENTAL: WAN ----------------- procfs: /proc/acpi/ibm/wan -sysfs device attribute: wwan_enable +sysfs device attribute: wwan/enable This feature is marked EXPERIMENTAL because the implementation directly accesses hardware registers and may not work as expected. USE @@ -918,7 +921,7 @@ If the W-WAN card is installed, the following commands can be used: Sysfs notes: If the W-WAN card is installed, it can be enabled / - disabled through the "wwan_enable" thinkpad-acpi device + disabled through the "wwan/enable" thinkpad-acpi device attribute, and its current status can also be queried. enable: @@ -926,7 +929,7 @@ Sysfs notes: 1: enables WWAN card / WWAN card is enabled. Note: this interface will be probably be superseeded by the - generic rfkill class, so it is NOT to be considered stable yet. + generic rfkill class. Multiple Commands, Module Parameters ------------------------------------ diff --git a/trunk/Documentation/vm/slub.txt b/trunk/Documentation/vm/slub.txt index 1523320abd87..727c8d81aeaf 100644 --- a/trunk/Documentation/vm/slub.txt +++ b/trunk/Documentation/vm/slub.txt @@ -1,9 +1,13 @@ Short users guide for SLUB -------------------------- +First of all slub should transparently replace SLAB. If you enable +SLUB then everything should work the same (Note the word "should". +There is likely not much value in that word at this point). + The basic philosophy of SLUB is very different from SLAB. SLAB requires rebuilding the kernel to activate debug options for all -slab caches. SLUB always includes full debugging but it is off by default. +SLABS. SLUB always includes full debugging but its off by default. SLUB can enable debugging only for selected slabs in order to avoid an impact on overall system performance which may make a bug more difficult to find. @@ -72,28 +76,13 @@ of objects. Careful with tracing: It may spew out lots of information and never stop if used on the wrong slab. -Slab merging +SLAB Merging ------------ -If no debug options are specified then SLUB may merge similar slabs together +If no debugging is specified then SLUB may merge similar slabs together in order to reduce overhead and increase cache hotness of objects. slabinfo -a displays which slabs were merged together. -Slab validation ---------------- - -SLUB can validate all object if the kernel was booted with slub_debug. In -order to do so you must have the slabinfo tool. Then you can do - -slabinfo -v - -which will test all objects. Output will be generated to the syslog. - -This also works in a more limited way if boot was without slab debug. -In that case slabinfo -v simply tests all reachable objects. Usually -these are in the cpu slabs and the partial slabs. Full slabs are not -tracked by SLUB in a non debug situation. - Getting more performance ------------------------ @@ -102,9 +91,9 @@ list_lock once in a while to deal with partial slabs. That overhead is governed by the order of the allocation for each slab. The allocations can be influenced by kernel parameters: -slub_min_objects=x (default 4) +slub_min_objects=x (default 8) slub_min_order=x (default 0) -slub_max_order=x (default 1) +slub_max_order=x (default 4) slub_min_objects allows to specify how many objects must at least fit into one slab in order for the allocation order to be acceptable. @@ -120,107 +109,5 @@ longer be checked. This is useful to avoid SLUB trying to generate super large order pages to fit slub_min_objects of a slab cache with large object sizes into one high order page. -SLUB Debug output ------------------ - -Here is a sample of slub debug output: - -*** SLUB kmalloc-8: Redzone Active@0xc90f6d20 slab 0xc528c530 offset=3360 flags=0x400000c3 inuse=61 freelist=0xc90f6d58 - Bytes b4 0xc90f6d10: 00 00 00 00 00 00 00 00 5a 5a 5a 5a 5a 5a 5a 5a ........ZZZZZZZZ - Object 0xc90f6d20: 31 30 31 39 2e 30 30 35 1019.005 - Redzone 0xc90f6d28: 00 cc cc cc . -FreePointer 0xc90f6d2c -> 0xc90f6d58 -Last alloc: get_modalias+0x61/0xf5 jiffies_ago=53 cpu=1 pid=554 -Filler 0xc90f6d50: 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZ - [] dump_trace+0x63/0x1eb - [] show_trace_log_lvl+0x1a/0x2f - [] show_trace+0x12/0x14 - [] dump_stack+0x16/0x18 - [] object_err+0x143/0x14b - [] check_object+0x66/0x234 - [] __slab_free+0x239/0x384 - [] kfree+0xa6/0xc6 - [] get_modalias+0xb9/0xf5 - [] dmi_dev_uevent+0x27/0x3c - [] dev_uevent+0x1ad/0x1da - [] kobject_uevent_env+0x20a/0x45b - [] kobject_uevent+0xa/0xf - [] store_uevent+0x4f/0x58 - [] dev_attr_store+0x29/0x2f - [] sysfs_write_file+0x16e/0x19c - [] vfs_write+0xd1/0x15a - [] sys_write+0x3d/0x72 - [] sysenter_past_esp+0x5f/0x99 - [] 0xb7f7b410 - ======================= -@@@ SLUB kmalloc-8: Restoring redzone (0xcc) from 0xc90f6d28-0xc90f6d2b - - - -If SLUB encounters a corrupted object then it will perform the following -actions: - -1. Isolation and report of the issue - -This will be a message in the system log starting with - -*** SLUB : @ -offset= flags= -inuse= freelist= - -2. Report on how the problem was dealt with in order to ensure the continued -operation of the system. - -These are messages in the system log beginning with - -@@@ SLUB : - - -In the above sample SLUB found that the Redzone of an active object has -been overwritten. Here a string of 8 characters was written into a slab that -has the length of 8 characters. However, a 8 character string needs a -terminating 0. That zero has overwritten the first byte of the Redzone field. -After reporting the details of the issue encountered the @@@ SLUB message -tell us that SLUB has restored the redzone to its proper value and then -system operations continue. - -Various types of lines can follow the @@@ SLUB line: - -Bytes b4
: - Show a few bytes before the object where the problem was detected. - Can be useful if the corruption does not stop with the start of the - object. - -Object
: - The bytes of the object. If the object is inactive then the bytes - typically contain poisoning values. Any non-poison value shows a - corruption by a write after free. - -Redzone
: - The redzone following the object. The redzone is used to detect - writes after the object. All bytes should always have the same - value. If there is any deviation then it is due to a write after - the object boundary. - -Freepointer - The pointer to the next free object in the slab. May become - corrupted if overwriting continues after the red zone. - -Last alloc: -Last free: - Shows the address from which the object was allocated/freed last. - We note the pid, the time and the CPU that did so. This is usually - the most useful information to figure out where things went wrong. - Here get_modalias() did an kmalloc(8) instead of a kmalloc(9). - -Filler
: - Unused data to fill up the space in order to get the next object - properly aligned. In the debug case we make sure that there are - at least 4 bytes of filler. This allow for the detection of writes - before the object. - -Following the filler will be a stackdump. That stackdump describes the -location where the error was detected. The cause of the corruption is more -likely to be found by looking at the information about the last alloc / free. - -Christoph Lameter, , May 23, 2007 + +Christoph Lameter, , April 10, 2007 diff --git a/trunk/Documentation/watchdog/pcwd-watchdog.txt b/trunk/Documentation/watchdog/pcwd-watchdog.txt index 4f68052395c0..d9ee6336c1d4 100644 --- a/trunk/Documentation/watchdog/pcwd-watchdog.txt +++ b/trunk/Documentation/watchdog/pcwd-watchdog.txt @@ -1,5 +1,3 @@ -Last reviewed: 10/05/2007 - Berkshire Products PC Watchdog Card Support for ISA Cards Revision A and C Documentation and Driver by Ken Hollis @@ -16,8 +14,8 @@ Last reviewed: 10/05/2007 The Watchdog Driver will automatically find your watchdog card, and will attach a running driver for use with that card. After the watchdog - drivers have initialized, you can then talk to the card using a PC - Watchdog program. + drivers have initialized, you can then talk to the card using the PC + Watchdog program, available from http://ftp.bitgate.com/pcwd/. I suggest putting a "watchdog -d" before the beginning of an fsck, and a "watchdog -e -t 1" immediately after the end of an fsck. (Remember @@ -64,3 +62,5 @@ Last reviewed: 10/05/2007 -- Ken Hollis (kenji@bitgate.com) +(This documentation may be out of date. Check + http://ftp.bitgate.com/pcwd/ for the absolute latest additions.) diff --git a/trunk/Documentation/watchdog/watchdog-api.txt b/trunk/Documentation/watchdog/watchdog-api.txt index bb7cb1d31ec7..8d16f6f3c4ec 100644 --- a/trunk/Documentation/watchdog/watchdog-api.txt +++ b/trunk/Documentation/watchdog/watchdog-api.txt @@ -1,6 +1,3 @@ -Last reviewed: 10/05/2007 - - The Linux Watchdog driver API. Copyright 2002 Christer Weingel @@ -25,7 +22,7 @@ the system. If userspace fails (RAM error, kernel bug, whatever), the notifications cease to occur, and the hardware watchdog will reset the system (causing a reboot) after the timeout occurs. -The Linux watchdog API is a rather ad-hoc construction and different +The Linux watchdog API is a rather AD hoc construction and different drivers implement different, and sometimes incompatible, parts of it. This file is an attempt to document the existing usage and allow future driver writers to use it as a reference. @@ -49,16 +46,14 @@ some of the drivers support the configuration option "Disable watchdog shutdown on close", CONFIG_WATCHDOG_NOWAYOUT. If it is set to Y when compiling the kernel, there is no way of disabling the watchdog once it has been started. So, if the watchdog daemon crashes, the system -will reboot after the timeout has passed. Watchdog devices also usually -support the nowayout module parameter so that this option can be controlled -at runtime. +will reboot after the timeout has passed. -Drivers will not disable the watchdog, unless a specific magic character 'V' -has been sent /dev/watchdog just before closing the file. If the userspace -daemon closes the file without sending this special character, the driver -will assume that the daemon (and userspace in general) died, and will stop -pinging the watchdog without disabling it first. This will then cause a -reboot if the watchdog is not re-opened in sufficient time. +Some other drivers will not disable the watchdog, unless a specific +magic character 'V' has been sent /dev/watchdog just before closing +the file. If the userspace daemon closes the file without sending +this special character, the driver will assume that the daemon (and +userspace in general) died, and will stop pinging the watchdog without +disabling it first. This will then cause a reboot. The ioctl API: @@ -232,3 +227,218 @@ The following options are available: [FIXME -- better explanations] +Implementations in the current drivers in the kernel tree: + +Here I have tried to summarize what the different drivers support and +where they do strange things compared to the other drivers. + +acquirewdt.c -- Acquire Single Board Computer + + This driver has a hardcoded timeout of 1 minute + + Supports CONFIG_WATCHDOG_NOWAYOUT + + GETSUPPORT returns KEEPALIVEPING. GETSTATUS will return 1 if + the device is open, 0 if not. [FIXME -- isn't this rather + silly? To be able to use the ioctl, the device must be open + and so GETSTATUS will always return 1]. + +advantechwdt.c -- Advantech Single Board Computer + + Timeout that defaults to 60 seconds, supports SETTIMEOUT. + + Supports CONFIG_WATCHDOG_NOWAYOUT + + GETSUPPORT returns WDIOF_KEEPALIVEPING and WDIOF_SETTIMEOUT. + The GETSTATUS call returns if the device is open or not. + [FIXME -- silliness again?] + +booke_wdt.c -- PowerPC BookE Watchdog Timer + + Timeout default varies according to frequency, supports + SETTIMEOUT + + Watchdog cannot be turned off, CONFIG_WATCHDOG_NOWAYOUT + does not make sense + + GETSUPPORT returns the watchdog_info struct, and + GETSTATUS returns the supported options. GETBOOTSTATUS + returns a 1 if the last reset was caused by the + watchdog and a 0 otherwise. This watchdog cannot be + disabled once it has been started. The wdt_period kernel + parameter selects which bit of the time base changing + from 0->1 will trigger the watchdog exception. Changing + the timeout from the ioctl calls will change the + wdt_period as defined above. Finally if you would like to + replace the default Watchdog Handler you can implement the + WatchdogHandler() function in your own code. + +eurotechwdt.c -- Eurotech CPU-1220/1410 + + The timeout can be set using the SETTIMEOUT ioctl and defaults + to 60 seconds. + + Also has a module parameter "ev", event type which controls + what should happen on a timeout, the string "int" or anything + else that causes a reboot. [FIXME -- better description] + + Supports CONFIG_WATCHDOG_NOWAYOUT + + GETSUPPORT returns CARDRESET and WDIOF_SETTIMEOUT but + GETSTATUS is not supported and GETBOOTSTATUS just returns 0. + +i810-tco.c -- Intel 810 chipset + + Also has support for a lot of other i8x0 stuff, but the + watchdog is one of the things. + + The timeout is set using the module parameter "i810_margin", + which is in steps of 0.6 seconds where 2 + + Custom Linux Driver And Program Development + + +The following watchdog drivers are currently implemented: + + ICS WDT501-P + ICS WDT501-P (no fan tachometer) + ICS WDT500-P + Software Only + SA1100 Internal Watchdog + Berkshire Products PC Watchdog Revision A & C (by Ken Hollis) + + +All six interfaces provide /dev/watchdog, which when open must be written +to within a timeout or the machine will reboot. Each write delays the reboot +time another timeout. In the case of the software watchdog the ability to +reboot will depend on the state of the machines and interrupts. The hardware +boards physically pull the machine down off their own onboard timers and +will reboot from almost anything. + +A second temperature monitoring interface is available on the WDT501P cards +and some Berkshire cards. This provides /dev/temperature. This is the machine +internal temperature in degrees Fahrenheit. Each read returns a single byte +giving the temperature. + +The third interface logs kernel messages on additional alert events. + +Both software and hardware watchdog drivers are available in the standard +kernel. If you are using the software watchdog, you probably also want +to use "panic=60" as a boot argument as well. + +The wdt card cannot be safely probed for. Instead you need to pass +wdt=ioaddr,irq as a boot parameter - eg "wdt=0x240,11". + +The SA1100 watchdog module can be configured with the "sa1100_margin" +commandline argument which specifies timeout value in seconds. + +The i810 TCO watchdog modules can be configured with the "i810_margin" +commandline argument which specifies the counter initial value. The counter +is decremented every 0.6 seconds and default to 50 (30 seconds). Values can +range between 3 and 63. + +The i810 TCO watchdog driver also implements the WDIOC_GETSTATUS and +WDIOC_GETBOOTSTATUS ioctl()s. WDIOC_GETSTATUS returns the actual counter value +and WDIOC_GETBOOTSTATUS returns the value of TCO2 Status Register (see Intel's +documentation for the 82801AA and 82801AB datasheet). + +Features +-------- + WDT501P WDT500P Software Berkshire i810 TCO SA1100WD +Reboot Timer X X X X X X +External Reboot X X o o o X +I/O Port Monitor o o o X o o +Temperature X o o X o o +Fan Speed X o o o o o +Power Under X o o o o o +Power Over X o o o o o +Overheat X o o o o o + +The external event interfaces on the WDT boards are not currently supported. +Minor numbers are however allocated for it. + + +Example Watchdog Driver: see Documentation/watchdog/src/watchdog-simple.c + + +Contact Information + +People keep asking about the WDT watchdog timer hardware: The phone contacts +for Industrial Computer Source are: + +Industrial Computer Source +http://www.indcompsrc.com +ICS Advent, San Diego +6260 Sequence Dr. +San Diego, CA 92121-4371 +Phone (858) 677-0877 +FAX: (858) 677-0895 +> +ICS Advent Europe, UK +Oving Road +Chichester, +West Sussex, +PO19 4ET, UK +Phone: 00.44.1243.533900 + + +and please mention Linux when enquiring. + +For full information about the PCWD cards see the pcwd-watchdog.txt document. diff --git a/trunk/Documentation/watchdog/wdt.txt b/trunk/Documentation/watchdog/wdt.txt deleted file mode 100644 index 03fd756d976d..000000000000 --- a/trunk/Documentation/watchdog/wdt.txt +++ /dev/null @@ -1,43 +0,0 @@ -Last Reviewed: 10/05/2007 - - WDT Watchdog Timer Interfaces For The Linux Operating System - Alan Cox - - ICS WDT501-P - ICS WDT501-P (no fan tachometer) - ICS WDT500-P - -All the interfaces provide /dev/watchdog, which when open must be written -to within a timeout or the machine will reboot. Each write delays the reboot -time another timeout. In the case of the software watchdog the ability to -reboot will depend on the state of the machines and interrupts. The hardware -boards physically pull the machine down off their own onboard timers and -will reboot from almost anything. - -A second temperature monitoring interface is available on the WDT501P cards -This provides /dev/temperature. This is the machine internal temperature in -degrees Fahrenheit. Each read returns a single byte giving the temperature. - -The third interface logs kernel messages on additional alert events. - -The wdt card cannot be safely probed for. Instead you need to pass -wdt=ioaddr,irq as a boot parameter - eg "wdt=0x240,11". - -Features --------- - WDT501P WDT500P -Reboot Timer X X -External Reboot X X -I/O Port Monitor o o -Temperature X o -Fan Speed X o -Power Under X o -Power Over X o -Overheat X o - -The external event interfaces on the WDT boards are not currently supported. -Minor numbers are however allocated for it. - - -Example Watchdog Driver: see Documentation/watchdog/src/watchdog-simple.c - diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index f3b5a391e074..4cc17b993b6a 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -30,11 +30,8 @@ trivial patch so apply some common sense. job the maintainers (and especially Linus) do is to keep things looking the same. Sometimes this means that the clever hack in your driver to get around a problem actually needs to become a - generalized kernel feature ready for next time. - - PLEASE check your patch with the automated style checker - (scripts/checkpatch.pl) to catch trival style violations. - See Documentation/CodingStyle for guidance here. + generalized kernel feature ready for next time. See + Documentation/CodingStyle for guidance here. PLEASE try to include any credit lines you want added with the patch. It avoids people being missed off by mistake and makes @@ -975,15 +972,6 @@ M: johannes@sipsolutions.net L: linux-wireless@vger.kernel.org S: Maintained -CHECKPATCH -P: Andy Whitcroft -M: apw@shadowen.org -P: Randy Dunlap -M: rdunlap@xenotime.net -P: Joel Schopp -M: jschopp@austin.ibm.com -S: Supported - COMMON INTERNET FILE SYSTEM (CIFS) P: Steve French M: sfrench@samba.org @@ -1487,13 +1475,6 @@ L: linux-usb-devel@lists.sourceforge.net L: linuxppc-embedded@ozlabs.org S: Maintained -FREESCALE QUICC ENGINE UCC ETHERNET DRIVER -P: Li Yang -M: leoli@freescale.com -L: netdev@vger.kernel.org -L: linuxppc-embedded@ozlabs.org -S: Maintained - FILE LOCKING (flock() and fcntl()/lockf()) P: Matthew Wilcox M: matthew@wil.cx @@ -1505,14 +1486,6 @@ P: Alexander Viro M: viro@zeniv.linux.org.uk S: Maintained -FIREWIRE SUBSYSTEM -P: Kristian Hoegsberg, Stefan Richter -M: krh@redhat.com, stefanr@s5r6.in-berlin.de -L: linux1394-devel@lists.sourceforge.net -W: http://www.linux1394.org/ -T: git kernel.org:/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git -S: Maintained - FIRMWARE LOADER (request_firmware) L: linux-kernel@vger.kernel.org S: Orphan @@ -2907,8 +2880,8 @@ W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel S: Supported PRISM54 WIRELESS DRIVER -P: Luis R. Rodriguez -M: mcgrof@gmail.com +P: Prism54 Development Team +M: developers@islsm.org L: linux-wireless@vger.kernel.org W: http://prism54.org S: Maintained @@ -3552,7 +3525,7 @@ S: Maintained TULIP NETWORK DRIVER P: Valerie Henson -M: val@nmt.edu +M: val_henson@linux.intel.com L: tulip-users@lists.sourceforge.net W: http://sourceforge.net/projects/tulip/ S: Maintained diff --git a/trunk/Makefile b/trunk/Makefile index 30d685b629a4..562a90902cf6 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 22 -EXTRAVERSION = -rc4 +EXTRAVERSION = -rc3 NAME = Jeff Thinks I Should Change This, But To What? # *DOCUMENTATION* diff --git a/trunk/arch/alpha/Kconfig b/trunk/arch/alpha/Kconfig index 79c6e5a24456..770f717bd250 100644 --- a/trunk/arch/alpha/Kconfig +++ b/trunk/arch/alpha/Kconfig @@ -83,20 +83,22 @@ choice check out the Linux/Alpha FAQ, accessible on the WWW from . In summary: - Alcor/Alpha-XLT AS 600, AS 500, XL-300, XL-366 + Alcor/Alpha-XLT AS 600 Alpha-XL XL-233, XL-266 AlphaBook1 Alpha laptop Avanti AS 200, AS 205, AS 250, AS 255, AS 300, AS 400 Cabriolet AlphaPC64, AlphaPCI64 - DP264 DP264 / DS20 / ES40 / DS10 / DS10L + DP264 DP264 EB164 EB164 21164 evaluation board EB64+ EB64+ 21064 evaluation board EB66 EB66 21066 evaluation board EB66+ EB66+ 21066 evaluation board - Jensen DECpc 150, DEC 2000 models 300, 500 + Jensen DECpc 150, DEC 2000 model 300, + DEC 2000 model 500 LX164 AlphaPC164-LX Lynx AS 2100A - Miata Personal Workstation 433/500/600 a/au + Miata Personal Workstation 433a, 433au, 500a, + 500au, 600a, or 600au Marvel AlphaServer ES47 / ES80 / GS1280 Mikasa AS 1000 Noname AXPpci33, UDB (Multia) @@ -106,9 +108,9 @@ choice Ruffian RPX164-2, AlphaPC164-UX, AlphaPC164-BX SX164 AlphaPC164-SX Sable AS 2000, AS 2100 - Shark DS 20L - Takara Takara (OEM) - Titan AlphaServer ES45 / DS25 / DS15 + Shark DS 20L + Takara Takara + Titan AlphaServer ES45 / DS25 Wildfire AlphaServer GS 40/80/160/320 If you don't know what to do, choose "generic". @@ -479,15 +481,6 @@ config ALPHA_BROKEN_IRQ_MASK depends on ALPHA_GENERIC || ALPHA_PC164 default y -config VGA_HOSE - bool - depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL || ALPHA_TSUNAMI - default y - help - Support VGA on an arbitrary hose; needed for several platforms - which always have multiple hoses, and whose consoles support it. - - config ALPHA_SRM bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME default y if ALPHA_JENSEN || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_DP264 || ALPHA_RAWHIDE || ALPHA_EIGER || ALPHA_WILDFIRE || ALPHA_TITAN || ALPHA_SHARK || ALPHA_MARVEL @@ -544,14 +537,10 @@ config HAVE_DEC_LOCK default y config NR_CPUS - int "Maximum number of CPUs (2-32)" - range 2 32 + int "Maximum number of CPUs (2-64)" + range 2 64 depends on SMP - default "32" if ALPHA_GENERIC || ALPHA_MARVEL - default "4" if !ALPHA_GENERIC && !ALPHA_MARVEL - help - MARVEL support can handle a maximum of 32 CPUs, all the others - with working support have a maximum of 4 CPUs. + default "64" config ARCH_DISCONTIGMEM_ENABLE bool "Discontiguous Memory Support (EXPERIMENTAL)" @@ -655,13 +644,6 @@ source "arch/alpha/oprofile/Kconfig" source "arch/alpha/Kconfig.debug" -# DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig -# but we also need it if VGA_HOSE is set -config DUMMY_CONSOLE - bool - depends on VGA_HOSE - default y - source "security/Kconfig" source "crypto/Kconfig" diff --git a/trunk/arch/alpha/boot/tools/mkbb.c b/trunk/arch/alpha/boot/tools/mkbb.c index 632a7fd6d7dc..23c7190b047c 100644 --- a/trunk/arch/alpha/boot/tools/mkbb.c +++ b/trunk/arch/alpha/boot/tools/mkbb.c @@ -81,7 +81,7 @@ typedef union __bootblock { #define bootblock_label __u1.__label #define bootblock_checksum __u2.__checksum -int main(int argc, char ** argv) +main(int argc, char ** argv) { bootblock bootblock_from_disk; bootblock bootloader_image; diff --git a/trunk/arch/alpha/kernel/console.c b/trunk/arch/alpha/kernel/console.c index da711e37fc97..f313b34939bb 100644 --- a/trunk/arch/alpha/kernel/console.c +++ b/trunk/arch/alpha/kernel/console.c @@ -9,20 +9,16 @@ #include #include #include -#include #include #include -#include "pci_impl.h" - #ifdef CONFIG_VGA_HOSE -struct pci_controller *pci_vga_hose; -static struct resource alpha_vga = { - .name = "alpha-vga+", - .start = 0x3C0, - .end = 0x3DF -}; +/* + * Externally-visible vga hose bases + */ +unsigned long __vga_hose_io_base = 0; /* base for default hose */ +unsigned long __vga_hose_mem_base = 0; /* base for default hose */ static struct pci_controller * __init default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2) @@ -33,59 +29,37 @@ default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2) return h1; } +void __init +set_vga_hose(struct pci_controller *hose) +{ + if (hose) { + __vga_hose_io_base = hose->io_space->start; + __vga_hose_mem_base = hose->mem_space->start; + } +} + void __init locate_and_init_vga(void *(*sel_func)(void *, void *)) { struct pci_controller *hose = NULL; struct pci_dev *dev = NULL; - /* Default the select function */ if (!sel_func) sel_func = (void *)default_vga_hose_select; - /* Find the console VGA device */ for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) { - if (!hose) - hose = dev->sysdata; - else - hose = sel_func(hose, dev->sysdata); + if (!hose) hose = dev->sysdata; + else hose = sel_func(hose, dev->sysdata); } - /* Did we already initialize the correct one? Is there one? */ - if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose)) + /* Did we already inititialize the correct one? */ + if (conswitchp == &vga_con && + __vga_hose_io_base == hose->io_space->start && + __vga_hose_mem_base == hose->mem_space->start) return; - /* Create a new VGA ioport resource WRT the hose it is on. */ - alpha_vga.start += hose->io_space->start; - alpha_vga.end += hose->io_space->start; - request_resource(hose->io_space, &alpha_vga); - - /* Set the VGA hose and init the new console. */ - pci_vga_hose = hose; + /* Set the VGA hose and init the new console */ + set_vga_hose(hose); take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1); } -void __init -find_console_vga_hose(void) -{ - u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset); - - if (pu64[7] == 3) { /* TERM_TYPE == graphics */ - struct pci_controller *hose; - int h = (pu64[30] >> 24) & 0xff; /* console hose # */ - - /* - * Our hose numbering DOES match the console's, so find - * the right one... - */ - for (hose = hose_head; hose; hose = hose->next) { - if (hose->index == h) break; - } - - if (hose) { - printk("Console graphics on hose %d\n", h); - pci_vga_hose = hose; - } - } -} - #endif diff --git a/trunk/arch/alpha/kernel/core_marvel.c b/trunk/arch/alpha/kernel/core_marvel.c index f10d2eddd2c3..7f6a98455e74 100644 --- a/trunk/arch/alpha/kernel/core_marvel.c +++ b/trunk/arch/alpha/kernel/core_marvel.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "proto.h" #include "pci_impl.h" @@ -368,8 +367,9 @@ marvel_io7_present(gct6_node *node) } static void __init -marvel_find_console_vga_hose(void) +marvel_init_vga_hose(void) { +#ifdef CONFIG_VGA_HOSE u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset); if (pu64[7] == 3) { /* TERM_TYPE == graphics */ @@ -403,6 +403,7 @@ marvel_find_console_vga_hose(void) pci_vga_hose = hose; } } +#endif /* CONFIG_VGA_HOSE */ } gct6_search_struct gct_wanted_node_list[] = { @@ -458,7 +459,7 @@ marvel_init_arch(void) marvel_init_io7(io7); /* Check for graphic console location (if any). */ - marvel_find_console_vga_hose(); + marvel_init_vga_hose(); } void @@ -683,6 +684,9 @@ __marvel_rtc_io(u8 b, unsigned long addr, int write) /* * IO map support. */ + +#define __marvel_is_mem_vga(a) (((a) >= 0xa0000) && ((a) <= 0xc0000)) + void __iomem * marvel_ioremap(unsigned long addr, unsigned long size) { @@ -694,9 +698,13 @@ marvel_ioremap(unsigned long addr, unsigned long size) unsigned long pfn; /* - * Adjust the address. + * Adjust the addr. */ - FIXUP_MEMADDR_VGA(addr); +#ifdef CONFIG_VGA_HOSE + if (pci_vga_hose && __marvel_is_mem_vga(addr)) { + addr += pci_vga_hose->mem_space->start; + } +#endif /* * Find the hose. @@ -773,9 +781,7 @@ marvel_ioremap(unsigned long addr, unsigned long size) return (void __iomem *) vaddr; } - /* Assume it was already a reasonable address */ - vaddr = baddr + hose->mem_space->start; - return (void __iomem *) vaddr; + return NULL; } void @@ -797,12 +803,21 @@ marvel_is_mmio(const volatile void __iomem *xaddr) return (addr & 0xFF000000UL) == 0; } +#define __marvel_is_port_vga(a) \ + (((a) >= 0x3b0) && ((a) < 0x3e0) && ((a) != 0x3b3) && ((a) != 0x3d3)) #define __marvel_is_port_kbd(a) (((a) == 0x60) || ((a) == 0x64)) #define __marvel_is_port_rtc(a) (((a) == 0x70) || ((a) == 0x71)) void __iomem *marvel_ioportmap (unsigned long addr) { - FIXUP_IOADDR_VGA(addr); + if (__marvel_is_port_rtc (addr) || __marvel_is_port_kbd(addr)) + ; +#ifdef CONFIG_VGA_HOSE + else if (__marvel_is_port_vga (addr) && pci_vga_hose) + addr += pci_vga_hose->io_space->start; +#endif + else + return NULL; return (void __iomem *)addr; } @@ -814,14 +829,8 @@ marvel_ioread8(void __iomem *xaddr) return 0; else if (__marvel_is_port_rtc(addr)) return __marvel_rtc_io(0, addr, 0); - else if (marvel_is_ioaddr(addr)) - return __kernel_ldbu(*(vucp)addr); else - /* this should catch other legacy addresses - that would normally fail on MARVEL, - because there really is nothing there... - */ - return ~0; + return __kernel_ldbu(*(vucp)addr); } void @@ -832,7 +841,7 @@ marvel_iowrite8(u8 b, void __iomem *xaddr) return; else if (__marvel_is_port_rtc(addr)) __marvel_rtc_io(b, addr, 1); - else if (marvel_is_ioaddr(addr)) + else __kernel_stb(b, *(vucp)addr); } diff --git a/trunk/arch/alpha/kernel/core_titan.c b/trunk/arch/alpha/kernel/core_titan.c index 819326627b96..3662fef7db9a 100644 --- a/trunk/arch/alpha/kernel/core_titan.c +++ b/trunk/arch/alpha/kernel/core_titan.c @@ -21,7 +21,6 @@ #include #include #include -#include #include "proto.h" #include "pci_impl.h" @@ -35,11 +34,6 @@ struct unsigned long tba[4]; } saved_config[4] __attribute__((common)); -/* - * Is PChip 1 present? No need to query it more than once. - */ -static int titan_pchip1_present; - /* * BIOS32-style PCI interface: */ @@ -350,17 +344,43 @@ titan_init_one_pachip_port(titan_pachip_port *port, int index) static void __init titan_init_pachips(titan_pachip *pachip0, titan_pachip *pachip1) { - titan_pchip1_present = TITAN_cchip->csc.csr & 1L<<14; + int pchip1_present = TITAN_cchip->csc.csr & 1L<<14; /* Init the ports in hose order... */ titan_init_one_pachip_port(&pachip0->g_port, 0); /* hose 0 */ - if (titan_pchip1_present) + if (pchip1_present) titan_init_one_pachip_port(&pachip1->g_port, 1);/* hose 1 */ titan_init_one_pachip_port(&pachip0->a_port, 2); /* hose 2 */ - if (titan_pchip1_present) + if (pchip1_present) titan_init_one_pachip_port(&pachip1->a_port, 3);/* hose 3 */ } +static void __init +titan_init_vga_hose(void) +{ +#ifdef CONFIG_VGA_HOSE + u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset); + + if (pu64[7] == 3) { /* TERM_TYPE == graphics */ + struct pci_controller *hose; + int h = (pu64[30] >> 24) & 0xff; /* console hose # */ + + /* + * Our hose numbering matches the console's, so just find + * the right one... + */ + for (hose = hose_head; hose; hose = hose->next) { + if (hose->index == h) break; + } + + if (hose) { + printk("Console graphics on hose %d\n", hose->index); + pci_vga_hose = hose; + } + } +#endif /* CONFIG_VGA_HOSE */ +} + void __init titan_init_arch(void) { @@ -386,7 +406,6 @@ titan_init_arch(void) /* With multiple PCI busses, we play with I/O as physical addrs. */ ioport_resource.end = ~0UL; - iomem_resource.end = ~0UL; /* PCI DMA Direct Mapping is 1GB at 2GB. */ __direct_map_base = 0x80000000; @@ -396,7 +415,7 @@ titan_init_arch(void) titan_init_pachips(TITAN_pachip0, TITAN_pachip1); /* Check for graphic console location (if any). */ - find_console_vga_hose(); + titan_init_vga_hose(); } static void @@ -422,7 +441,9 @@ titan_kill_one_pachip_port(titan_pachip_port *port, int index) static void titan_kill_pachips(titan_pachip *pachip0, titan_pachip *pachip1) { - if (titan_pchip1_present) { + int pchip1_present = TITAN_cchip->csc.csr & 1L<<14; + + if (pchip1_present) { titan_kill_one_pachip_port(&pachip1->g_port, 1); titan_kill_one_pachip_port(&pachip1->a_port, 3); } @@ -441,14 +462,6 @@ titan_kill_arch(int mode) * IO map support. */ -void __iomem * -titan_ioportmap(unsigned long addr) -{ - FIXUP_IOADDR_VGA(addr); - return (void __iomem *)(addr + TITAN_IO_BIAS); -} - - void __iomem * titan_ioremap(unsigned long addr, unsigned long size) { @@ -462,12 +475,14 @@ titan_ioremap(unsigned long addr, unsigned long size) unsigned long pfn; /* - * Adjust the address and hose, if necessary. + * Adjust the addr. */ - if (pci_vga_hose && __is_mem_vga(addr)) { +#ifdef CONFIG_VGA_HOSE + if (pci_vga_hose && __titan_is_mem_vga(addr)) { h = pci_vga_hose->index; addr += pci_vga_hose->mem_space->start; } +#endif /* * Find the hose. @@ -506,10 +521,8 @@ titan_ioremap(unsigned long addr, unsigned long size) * Map it */ area = get_vm_area(size, VM_IOREMAP); - if (!area) { - printk("ioremap failed... no vm_area...\n"); + if (!area) return NULL; - } ptes = hose->sg_pci->ptes; for (vaddr = (unsigned long)area->addr; @@ -526,7 +539,7 @@ titan_ioremap(unsigned long addr, unsigned long size) if (__alpha_remap_area_pages(vaddr, pfn << PAGE_SHIFT, PAGE_SIZE, 0)) { - printk("FAILED to remap_area_pages...\n"); + printk("FAILED to map...\n"); vfree(area->addr); return NULL; } @@ -538,8 +551,7 @@ titan_ioremap(unsigned long addr, unsigned long size) return (void __iomem *) vaddr; } - /* Assume a legacy (read: VGA) address, and return appropriately. */ - return (void __iomem *)(addr + TITAN_MEM_BIAS); + return NULL; } void @@ -562,7 +574,6 @@ titan_is_mmio(const volatile void __iomem *xaddr) } #ifndef CONFIG_ALPHA_GENERIC -EXPORT_SYMBOL(titan_ioportmap); EXPORT_SYMBOL(titan_ioremap); EXPORT_SYMBOL(titan_iounmap); EXPORT_SYMBOL(titan_is_mmio); @@ -739,7 +750,6 @@ titan_agp_info(void) if (titan_query_agp(port)) hosenum = 2; if (hosenum < 0 && - titan_pchip1_present && titan_query_agp(port = &TITAN_pachip1->a_port)) hosenum = 3; diff --git a/trunk/arch/alpha/kernel/core_tsunami.c b/trunk/arch/alpha/kernel/core_tsunami.c index ef91e09590d4..ce623c6e55e1 100644 --- a/trunk/arch/alpha/kernel/core_tsunami.c +++ b/trunk/arch/alpha/kernel/core_tsunami.c @@ -19,7 +19,6 @@ #include #include -#include #include "proto.h" #include "pci_impl.h" @@ -350,26 +349,6 @@ tsunami_init_one_pchip(tsunami_pchip *pchip, int index) tsunami_pci_tbi(hose, 0, -1); } - -void __iomem * -tsunami_ioportmap(unsigned long addr) -{ - FIXUP_IOADDR_VGA(addr); - return (void __iomem *)(addr + TSUNAMI_IO_BIAS); -} - -void __iomem * -tsunami_ioremap(unsigned long addr, unsigned long size) -{ - FIXUP_MEMADDR_VGA(addr); - return (void __iomem *)(addr + TSUNAMI_MEM_BIAS); -} - -#ifndef CONFIG_ALPHA_GENERIC -EXPORT_SYMBOL(tsunami_ioportmap); -EXPORT_SYMBOL(tsunami_ioremap); -#endif - void __init tsunami_init_arch(void) { @@ -414,9 +393,6 @@ tsunami_init_arch(void) tsunami_init_one_pchip(TSUNAMI_pchip0, 0); if (TSUNAMI_cchip->csc.csr & 1L<<14) tsunami_init_one_pchip(TSUNAMI_pchip1, 1); - - /* Check for graphic console location (if any). */ - find_console_vga_hose(); } static void diff --git a/trunk/arch/alpha/kernel/proto.h b/trunk/arch/alpha/kernel/proto.h index 708d5ca87782..95912ecc65e1 100644 --- a/trunk/arch/alpha/kernel/proto.h +++ b/trunk/arch/alpha/kernel/proto.h @@ -108,15 +108,6 @@ extern int wildfire_cpuid_to_nid(int); extern unsigned long wildfire_node_mem_start(int); extern unsigned long wildfire_node_mem_size(int); -/* console.c */ -#ifdef CONFIG_VGA_HOSE -extern void find_console_vga_hose(void); -extern void locate_and_init_vga(void *(*)(void *, void *)); -#else -static inline void find_console_vga_hose(void) { } -static inline void locate_and_init_vga(void *(*sel_func)(void *, void *)) { } -#endif - /* setup.c */ extern unsigned long srm_hae; extern int boot_cpuid; diff --git a/trunk/arch/alpha/kernel/sys_dp264.c b/trunk/arch/alpha/kernel/sys_dp264.c index c71b0fd7a61f..85d2f933dd07 100644 --- a/trunk/arch/alpha/kernel/sys_dp264.c +++ b/trunk/arch/alpha/kernel/sys_dp264.c @@ -543,7 +543,6 @@ dp264_init_pci(void) { common_init_pci(); SMC669_Init(0); - locate_and_init_vga(NULL); } static void __init @@ -552,14 +551,6 @@ monet_init_pci(void) common_init_pci(); SMC669_Init(1); es1888_init(); - locate_and_init_vga(NULL); -} - -static void __init -clipper_init_pci(void) -{ - common_init_pci(); - locate_and_init_vga(NULL); } static void __init @@ -664,7 +655,7 @@ struct alpha_machine_vector clipper_mv __initmv = { .init_arch = tsunami_init_arch, .init_irq = clipper_init_irq, .init_rtc = common_init_rtc, - .init_pci = clipper_init_pci, + .init_pci = common_init_pci, .kill_arch = tsunami_kill_arch, .pci_map_irq = clipper_map_irq, .pci_swizzle = common_swizzle, diff --git a/trunk/arch/alpha/kernel/sys_marvel.c b/trunk/arch/alpha/kernel/sys_marvel.c index 0bcb968cb60a..e349f03b830e 100644 --- a/trunk/arch/alpha/kernel/sys_marvel.c +++ b/trunk/arch/alpha/kernel/sys_marvel.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "proto.h" #include "err_impl.h" @@ -413,7 +412,10 @@ marvel_init_pci(void) pci_probe_only = 1; common_init_pci(); + +#ifdef CONFIG_VGA_HOSE locate_and_init_vga(NULL); +#endif /* Clear any io7 errors. */ for (io7 = NULL; (io7 = marvel_next_io7(io7)) != NULL; ) diff --git a/trunk/arch/alpha/kernel/sys_titan.c b/trunk/arch/alpha/kernel/sys_titan.c index 1d3c1398c428..f009b7bc0943 100644 --- a/trunk/arch/alpha/kernel/sys_titan.c +++ b/trunk/arch/alpha/kernel/sys_titan.c @@ -331,7 +331,9 @@ titan_init_pci(void) pci_probe_only = 1; common_init_pci(); SMC669_Init(0); +#ifdef CONFIG_VGA_HOSE locate_and_init_vga(NULL); +#endif } diff --git a/trunk/arch/arm/boot/compressed/head.S b/trunk/arch/arm/boot/compressed/head.S index 23348e9561b9..2568d311be21 100644 --- a/trunk/arch/arm/boot/compressed/head.S +++ b/trunk/arch/arm/boot/compressed/head.S @@ -247,7 +247,7 @@ not_relocated: mov r0, #0 mov r3, r7 bl decompress_kernel - add r0, r0, #127 + 128 @ alignment + stack + add r0, r0, #127 bic r0, r0, #127 @ align the kernel length /* * r0 = decompressed kernel length @@ -269,7 +269,6 @@ not_relocated: mov r0, #0 stmia r1!, {r9 - r14} cmp r2, r3 blo 1b - add sp, r1, #128 @ relocate the stack bl cache_clean_flush add pc, r5, r0 @ call relocation code @@ -477,7 +476,6 @@ __common_mmu_cache_on: */ .align 5 reloc_start: add r9, r5, r0 - sub r9, r9, #128 @ do not copy the stack debug_reloc_start mov r1, r4 1: @@ -488,7 +486,6 @@ reloc_start: add r9, r5, r0 cmp r5, r9 blo 1b - add sp, r1, #128 @ relocate the stack debug_reloc_end call_kernel: bl cache_clean_flush diff --git a/trunk/arch/arm/mach-at91/clock.c b/trunk/arch/arm/mach-at91/clock.c index 848efb2a4ebf..06c9a0507d0d 100644 --- a/trunk/arch/arm/mach-at91/clock.c +++ b/trunk/arch/arm/mach-at91/clock.c @@ -364,14 +364,19 @@ static int at91_clk_show(struct seq_file *s, void *unused) { u32 scsr, pcsr, sr; struct clk *clk; + unsigned i; seq_printf(s, "SCSR = %8x\n", scsr = at91_sys_read(AT91_PMC_SCSR)); seq_printf(s, "PCSR = %8x\n", pcsr = at91_sys_read(AT91_PMC_PCSR)); + seq_printf(s, "MOR = %8x\n", at91_sys_read(AT91_CKGR_MOR)); seq_printf(s, "MCFR = %8x\n", at91_sys_read(AT91_CKGR_MCFR)); seq_printf(s, "PLLA = %8x\n", at91_sys_read(AT91_CKGR_PLLAR)); seq_printf(s, "PLLB = %8x\n", at91_sys_read(AT91_CKGR_PLLBR)); + seq_printf(s, "MCKR = %8x\n", at91_sys_read(AT91_PMC_MCKR)); + for (i = 0; i < 4; i++) + seq_printf(s, "PCK%d = %8x\n", i, at91_sys_read(AT91_PMC_PCKR(i))); seq_printf(s, "SR = %8x\n", sr = at91_sys_read(AT91_PMC_SR)); seq_printf(s, "\n"); diff --git a/trunk/arch/arm/mach-at91/pm.c b/trunk/arch/arm/mach-at91/pm.c index 47ff676aca5f..ff8db29e989e 100644 --- a/trunk/arch/arm/mach-at91/pm.c +++ b/trunk/arch/arm/mach-at91/pm.c @@ -76,11 +76,12 @@ static int at91_pm_verify_clocks(void) pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); return 0; } - } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263()) { - if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) { - pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); - return 0; - } + } else if (cpu_is_at91sam9260()) { +#warning "Check SAM9260 USB clocks" + } else if (cpu_is_at91sam9261()) { +#warning "Check SAM9261 USB clocks" + } else if (cpu_is_at91sam9263()) { +#warning "Check SAM9263 USB clocks" } #ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS diff --git a/trunk/arch/arm/mm/alignment.c b/trunk/arch/arm/mm/alignment.c index 074b7cb07743..36440c899583 100644 --- a/trunk/arch/arm/mm/alignment.c +++ b/trunk/arch/arm/mm/alignment.c @@ -630,7 +630,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) fs = get_fs(); set_fs(KERNEL_DS); - if (thumb_mode(regs)) { + if thumb_mode(regs) { fault = __get_user(tinstr, (u16 *)(instrptr & ~1)); if (!(fault)) instr = thumb2arm(tinstr); diff --git a/trunk/arch/arm/oprofile/op_model_mpcore.c b/trunk/arch/arm/oprofile/op_model_mpcore.c index 75bae067922d..7791da791f5f 100644 --- a/trunk/arch/arm/oprofile/op_model_mpcore.c +++ b/trunk/arch/arm/oprofile/op_model_mpcore.c @@ -200,10 +200,8 @@ static int em_call_function(int (*fn)(void)) data.fn = fn; data.ret = 0; - preempt_disable(); smp_call_function(em_func, &data, 1, 1); em_func(&data); - preempt_enable(); return data.ret; } diff --git a/trunk/arch/h8300/kernel/sys_h8300.c b/trunk/arch/h8300/kernel/sys_h8300.c index de7688cfd573..11ba75a05220 100644 --- a/trunk/arch/h8300/kernel/sys_h8300.c +++ b/trunk/arch/h8300/kernel/sys_h8300.c @@ -288,9 +288,9 @@ asmlinkage void syscall_print(void *dummy,...) int kernel_execve(const char *filename, char *const argv[], char *const envp[]) { register long res __asm__("er0"); - register char *const *_c __asm__("er3") = envp; - register char *const *_b __asm__("er2") = argv; register const char * _a __asm__("er1") = filename; + register void *_b __asm__("er2") = argv; + register void *_c __asm__("er3") = envp; __asm__ __volatile__ ("mov.l %1,er0\n\t" "trapa #0\n\t" : "=r" (res) diff --git a/trunk/arch/h8300/kernel/traps.c b/trunk/arch/h8300/kernel/traps.c index f97183011c2c..300e3279ca5a 100644 --- a/trunk/arch/h8300/kernel/traps.c +++ b/trunk/arch/h8300/kernel/traps.c @@ -136,7 +136,7 @@ void show_stack(struct task_struct *task, unsigned long *esp) printk("\nCall Trace:"); i = 0; stack = esp; - while (((unsigned long)stack & (THREAD_SIZE - 1)) != 0) { + while (((unsigned long)stack & (THREAD_SIZE - 1)) == 0) { addr = *stack++; /* * If the address is either in the text segment of the diff --git a/trunk/arch/i386/kernel/cpu/mtrr/main.c b/trunk/arch/i386/kernel/cpu/mtrr/main.c index 7202b98aac4f..1cf466df330a 100644 --- a/trunk/arch/i386/kernel/cpu/mtrr/main.c +++ b/trunk/arch/i386/kernel/cpu/mtrr/main.c @@ -734,13 +734,10 @@ void mtrr_ap_init(void) */ void mtrr_save_state(void) { - int cpu = get_cpu(); - - if (cpu == 0) + if (smp_processor_id() == 0) mtrr_save_fixed_ranges(NULL); else smp_call_function_single(0, mtrr_save_fixed_ranges, NULL, 1, 1); - put_cpu(); } static int __init mtrr_init_finialize(void) diff --git a/trunk/arch/i386/kernel/microcode.c b/trunk/arch/i386/kernel/microcode.c index d865d041bea1..83f825f2e2d7 100644 --- a/trunk/arch/i386/kernel/microcode.c +++ b/trunk/arch/i386/kernel/microcode.c @@ -478,7 +478,7 @@ static int __init microcode_dev_init (void) return 0; } -static void microcode_dev_exit (void) +static void __exit microcode_dev_exit (void) { misc_deregister(µcode_dev); } diff --git a/trunk/arch/i386/kernel/reboot.c b/trunk/arch/i386/kernel/reboot.c index 5513f8d5b5be..50dfc65319cd 100644 --- a/trunk/arch/i386/kernel/reboot.c +++ b/trunk/arch/i386/kernel/reboot.c @@ -89,14 +89,6 @@ static int __init set_bios_reboot(struct dmi_system_id *d) } static struct dmi_system_id __initdata reboot_dmi_table[] = { - { /* Handle problems with rebooting on Dell E520's */ - .callback = set_bios_reboot, - .ident = "Dell E520", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"), - }, - }, { /* Handle problems with rebooting on Dell 1300's */ .callback = set_bios_reboot, .ident = "Dell PowerEdge 1300", diff --git a/trunk/arch/i386/kernel/smpboot.c b/trunk/arch/i386/kernel/smpboot.c index 88baed1e7e83..08f07a74a9d3 100644 --- a/trunk/arch/i386/kernel/smpboot.c +++ b/trunk/arch/i386/kernel/smpboot.c @@ -943,9 +943,10 @@ static int __cpuinit __smp_prepare_cpu(int cpu) static void smp_tune_scheduling(void) { + unsigned long cachesize; /* kB */ + if (cpu_khz) { - /* cache size in kB */ - long cachesize = boot_cpu_data.x86_cache_size; + cachesize = boot_cpu_data.x86_cache_size; if (cachesize > 0) max_cache_size = cachesize * 1024; diff --git a/trunk/arch/i386/kernel/vmi.c b/trunk/arch/i386/kernel/vmi.c index c12720d7cbc5..c8726c424b35 100644 --- a/trunk/arch/i386/kernel/vmi.c +++ b/trunk/arch/i386/kernel/vmi.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/arch/i386/mm/fault.c b/trunk/arch/i386/mm/fault.c index 1ecb3e43b523..29d7d61543a1 100644 --- a/trunk/arch/i386/mm/fault.c +++ b/trunk/arch/i386/mm/fault.c @@ -458,11 +458,6 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs, bad_area_nosemaphore: /* User mode accesses just cause a SIGSEGV */ if (error_code & 4) { - /* - * It's possible to have interrupts off here. - */ - local_irq_enable(); - /* * Valid to do another page fault here because this one came * from user space. diff --git a/trunk/arch/i386/oprofile/nmi_int.c b/trunk/arch/i386/oprofile/nmi_int.c index 11b7a51566a8..a7c0783b269a 100644 --- a/trunk/arch/i386/oprofile/nmi_int.c +++ b/trunk/arch/i386/oprofile/nmi_int.c @@ -154,7 +154,7 @@ static int allocate_msrs(void) size_t counters_size = sizeof(struct op_msr) * model->num_counters; int i; - for_each_possible_cpu(i) { + for_each_online_cpu(i) { cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); if (!cpu_msrs[i].counters) { success = 0; @@ -211,14 +211,8 @@ static int nmi_setup(void) /* Assume saved/restored counters are the same on all CPUs */ model->fill_in_addresses(&cpu_msrs[0]); for_each_possible_cpu (cpu) { - if (cpu != 0) { - memcpy(cpu_msrs[cpu].counters, cpu_msrs[0].counters, - sizeof(struct op_msr) * model->num_counters); - - memcpy(cpu_msrs[cpu].controls, cpu_msrs[0].controls, - sizeof(struct op_msr) * model->num_controls); - } - + if (cpu != 0) + cpu_msrs[cpu] = cpu_msrs[0]; } on_each_cpu(nmi_save_registers, NULL, 0, 1); on_each_cpu(nmi_cpu_setup, NULL, 0, 1); diff --git a/trunk/arch/i386/pci/fixup.c b/trunk/arch/i386/pci/fixup.c index b95b42950ed4..b62eafb997bc 100644 --- a/trunk/arch/i386/pci/fixup.c +++ b/trunk/arch/i386/pci/fixup.c @@ -436,14 +436,3 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, pci_early_fixup_cyrix_5530); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, pci_early_fixup_cyrix_5530); - -/* - * Siemens Nixdorf AG FSC Multiprocessor Interrupt Controller: - * prevent update of the BAR0, which doesn't look like a normal BAR. - */ -static void __devinit pci_siemens_interrupt_controller(struct pci_dev *dev) -{ - dev->resource[0].flags |= IORESOURCE_PCI_FIXED; -} -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SIEMENS, 0x0015, - pci_siemens_interrupt_controller); diff --git a/trunk/arch/m68k/Kconfig b/trunk/arch/m68k/Kconfig index 85cdd23b0447..b8536c7c0877 100644 --- a/trunk/arch/m68k/Kconfig +++ b/trunk/arch/m68k/Kconfig @@ -355,9 +355,8 @@ config RMW_INSNS adventurous. config SINGLE_MEMORY_CHUNK - bool "Use one physical chunk of memory only" if ADVANCED && !SUN3 - default y if SUN3 - select NEED_MULTIPLE_NODES + bool "Use one physical chunk of memory only" + depends on ADVANCED && !SUN3 help Ignore all but the first contiguous chunk of physical memory for VM purposes. This will save a few bytes kernel size and may speed up @@ -378,14 +377,6 @@ config 060_WRITETHROUGH is hardwired on. The 53c710 SCSI driver is known to suffer from this problem. -config ARCH_DISCONTIGMEM_ENABLE - def_bool !SINGLE_MEMORY_CHUNK - -config NODES_SHIFT - int - default "3" - depends on !SINGLE_MEMORY_CHUNK - source "mm/Kconfig" endmenu diff --git a/trunk/arch/m68k/Makefile b/trunk/arch/m68k/Makefile index aa383a5ea7ac..c20831a7e1a9 100644 --- a/trunk/arch/m68k/Makefile +++ b/trunk/arch/m68k/Makefile @@ -19,7 +19,6 @@ COMPILE_ARCH = $(shell uname -m) # override top level makefile AS += -m68020 LDFLAGS := -m m68kelf -LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds ifneq ($(COMPILE_ARCH),$(ARCH)) # prefix for cross-compiling binaries CROSS_COMPILE = m68k-linux-gnu- diff --git a/trunk/arch/m68k/kernel/Makefile b/trunk/arch/m68k/kernel/Makefile index a806208c7fb5..0b68ab8d63d1 100644 --- a/trunk/arch/m68k/kernel/Makefile +++ b/trunk/arch/m68k/kernel/Makefile @@ -9,12 +9,13 @@ else endif extra-y += vmlinux.lds -obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o module.o \ +obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o devres.o devres-y = ../../../kernel/irq/devres.o obj-$(CONFIG_PCI) += bios32.o +obj-$(CONFIG_MODULES) += module.o obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo EXTRA_AFLAGS := -traditional diff --git a/trunk/arch/m68k/kernel/module.c b/trunk/arch/m68k/kernel/module.c index 774862bc6977..3b1a2ff61ddc 100644 --- a/trunk/arch/m68k/kernel/module.c +++ b/trunk/arch/m68k/kernel/module.c @@ -1,9 +1,3 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - */ - #include #include #include @@ -17,8 +11,6 @@ #define DEBUGP(fmt...) #endif -#ifdef CONFIG_MODULES - void *module_alloc(unsigned long size) { if (size == 0) @@ -126,32 +118,11 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, - struct module *mod) + struct module *me) { - module_fixup(mod, mod->arch.fixup_start, mod->arch.fixup_end); - return 0; } void module_arch_cleanup(struct module *mod) { } - -#endif /* CONFIG_MODULES */ - -void module_fixup(struct module *mod, struct m68k_fixup_info *start, - struct m68k_fixup_info *end) -{ - struct m68k_fixup_info *fixup; - - for (fixup = start; fixup < end; fixup++) { - switch (fixup->type) { - case m68k_fixup_memoffset: - *(u32 *)fixup->addr = m68k_memoffset; - break; - case m68k_fixup_vnode_shift: - *(u16 *)fixup->addr += m68k_virt_to_node_shift; - break; - } - } -} diff --git a/trunk/arch/m68k/kernel/module.lds b/trunk/arch/m68k/kernel/module.lds deleted file mode 100644 index fda94fa38243..000000000000 --- a/trunk/arch/m68k/kernel/module.lds +++ /dev/null @@ -1,7 +0,0 @@ -SECTIONS { - .m68k_fixup : { - __start_fixup = .; - *(.m68k_fixup) - __stop_fixup = .; - } -} diff --git a/trunk/arch/m68k/kernel/setup.c b/trunk/arch/m68k/kernel/setup.c index 215c7bd43924..610319356691 100644 --- a/trunk/arch/m68k/kernel/setup.c +++ b/trunk/arch/m68k/kernel/setup.c @@ -60,12 +60,14 @@ extern unsigned long availmem; int m68k_num_memory; int m68k_realnum_memory; EXPORT_SYMBOL(m68k_realnum_memory); +#ifdef CONFIG_SINGLE_MEMORY_CHUNK unsigned long m68k_memoffset; EXPORT_SYMBOL(m68k_memoffset); +#endif struct mem_info m68k_memory[NUM_MEMINFO]; EXPORT_SYMBOL(m68k_memory); -struct mem_info m68k_ramdisk; +static struct mem_info m68k_ramdisk; static char m68k_command_line[CL_SIZE]; @@ -206,6 +208,9 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record) void __init setup_arch(char **cmdline_p) { extern int _etext, _edata, _end; +#ifndef CONFIG_SUN3 + unsigned long endmem, startmem; +#endif int i; /* The bootinfo is located right after the kernel bss */ @@ -315,16 +320,30 @@ void __init setup_arch(char **cmdline_p) panic("No configuration setup"); } - paging_init(); - #ifndef CONFIG_SUN3 - for (i = 1; i < m68k_num_memory; i++) - free_bootmem_node(NODE_DATA(i), m68k_memory[i].addr, - m68k_memory[i].size); + startmem= m68k_memory[0].addr; + endmem = startmem + m68k_memory[0].size; + high_memory = (void *)PAGE_OFFSET; + for (i = 0; i < m68k_num_memory; i++) { + m68k_memory[i].size &= MASK_256K; + if (m68k_memory[i].addr < startmem) + startmem = m68k_memory[i].addr; + if (m68k_memory[i].addr+m68k_memory[i].size > endmem) + endmem = m68k_memory[i].addr+m68k_memory[i].size; + high_memory += m68k_memory[i].size; + } + + availmem += init_bootmem_node(NODE_DATA(0), availmem >> PAGE_SHIFT, + startmem >> PAGE_SHIFT, endmem >> PAGE_SHIFT); + + for (i = 0; i < m68k_num_memory; i++) + free_bootmem(m68k_memory[i].addr, m68k_memory[i].size); + + reserve_bootmem(m68k_memory[0].addr, availmem - m68k_memory[0].addr); + #ifdef CONFIG_BLK_DEV_INITRD if (m68k_ramdisk.size) { - reserve_bootmem_node(__virt_to_node(phys_to_virt(m68k_ramdisk.addr)), - m68k_ramdisk.addr, m68k_ramdisk.size); + reserve_bootmem(m68k_ramdisk.addr, m68k_ramdisk.size); initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr); initrd_end = initrd_start + m68k_ramdisk.size; printk("initrd: %08lx - %08lx\n", initrd_start, initrd_end); @@ -343,6 +362,8 @@ void __init setup_arch(char **cmdline_p) #endif /* !CONFIG_SUN3 */ + paging_init(); + /* set ISA defs early as possible */ #if defined(CONFIG_ISA) && defined(MULTI_ISA) #if defined(CONFIG_Q40) diff --git a/trunk/arch/m68k/kernel/vmlinux-std.lds b/trunk/arch/m68k/kernel/vmlinux-std.lds index 40f02b128f22..78f139226a1b 100644 --- a/trunk/arch/m68k/kernel/vmlinux-std.lds +++ b/trunk/arch/m68k/kernel/vmlinux-std.lds @@ -60,11 +60,6 @@ SECTIONS __con_initcall_start = .; .con_initcall.init : { *(.con_initcall.init) } __con_initcall_end = .; - .m68k_fixup : { - __start_fixup = .; - *(.m68k_fixup) - __stop_fixup = .; - } SECURITY_INIT #ifdef CONFIG_BLK_DEV_INITRD . = ALIGN(8192); diff --git a/trunk/arch/m68k/kernel/vmlinux-sun3.lds b/trunk/arch/m68k/kernel/vmlinux-sun3.lds index f06425b6d206..c8999b2db23b 100644 --- a/trunk/arch/m68k/kernel/vmlinux-sun3.lds +++ b/trunk/arch/m68k/kernel/vmlinux-sun3.lds @@ -54,11 +54,6 @@ __init_begin = .; __con_initcall_start = .; .con_initcall.init : { *(.con_initcall.init) } __con_initcall_end = .; - .m68k_fixup : { - __start_fixup = .; - *(.m68k_fixup) - __stop_fixup = .; - } SECURITY_INIT #ifdef CONFIG_BLK_DEV_INITRD . = ALIGN(8192); diff --git a/trunk/arch/m68k/mac/debug.c b/trunk/arch/m68k/mac/debug.c index e8a57138b4a6..7a5bed5bdc57 100644 --- a/trunk/arch/m68k/mac/debug.c +++ b/trunk/arch/m68k/mac/debug.c @@ -71,7 +71,7 @@ void mac_debugging_short(int pos, short num) /* calculate current offset */ pengoffset = (unsigned char *)mac_videobase + - (150+line*2) * mac_rowbytes + 80 * peng; + (150+line*2) * mac_rowbytes) + 80 * peng; pptr = pengoffset; diff --git a/trunk/arch/m68k/mm/init.c b/trunk/arch/m68k/mm/init.c index f1de19e1dde6..ab90213e5c54 100644 --- a/trunk/arch/m68k/mm/init.c +++ b/trunk/arch/m68k/mm/init.c @@ -7,7 +7,6 @@ * to motorola.c and sun3mmu.c */ -#include #include #include #include @@ -32,37 +31,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); -static bootmem_data_t __initdata bootmem_data[MAX_NUMNODES]; - -pg_data_t pg_data_map[MAX_NUMNODES]; -EXPORT_SYMBOL(pg_data_map); - -int m68k_virt_to_node_shift; - -#ifndef CONFIG_SINGLE_MEMORY_CHUNK -pg_data_t *pg_data_table[65]; -EXPORT_SYMBOL(pg_data_table); -#endif - -void m68k_setup_node(int node) -{ -#ifndef CONFIG_SINGLE_MEMORY_CHUNK - struct mem_info *info = m68k_memory + node; - int i, end; - - i = (unsigned long)phys_to_virt(info->addr) >> __virt_to_node_shift(); - end = (unsigned long)phys_to_virt(info->addr + info->size - 1) >> __virt_to_node_shift(); - for (; i <= end; i++) { - if (pg_data_table[i]) - printk("overlap at %u for chunk %u\n", i, node); - pg_data_table[i] = pg_data_map + node; - } -#endif - pg_data_map[node].bdata = bootmem_data + node; - node_set_online(node); -} - - /* * ZERO_PAGE is a special page that is used for zero-initialized * data and COW. @@ -72,51 +40,52 @@ void *empty_zero_page; void show_mem(void) { - pg_data_t *pgdat; - int free = 0, total = 0, reserved = 0, shared = 0; - int cached = 0; - int i; - - printk("\nMem-info:\n"); - show_free_areas(); - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); - for_each_online_pgdat(pgdat) { - for (i = 0; i < pgdat->node_spanned_pages; i++) { - struct page *page = pgdat->node_mem_map + i; - total++; - if (PageReserved(page)) - reserved++; - else if (PageSwapCache(page)) - cached++; - else if (!page_count(page)) - free++; - else - shared += page_count(page) - 1; - } - } - printk("%d pages of RAM\n",total); - printk("%d free pages\n",free); - printk("%d reserved pages\n",reserved); - printk("%d pages shared\n",shared); - printk("%d pages swap cached\n",cached); + unsigned long i; + int free = 0, total = 0, reserved = 0, shared = 0; + int cached = 0; + + printk("\nMem-info:\n"); + show_free_areas(); + printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); + i = max_mapnr; + while (i-- > 0) { + total++; + if (PageReserved(mem_map+i)) + reserved++; + else if (PageSwapCache(mem_map+i)) + cached++; + else if (!page_count(mem_map+i)) + free++; + else + shared += page_count(mem_map+i) - 1; + } + printk("%d pages of RAM\n",total); + printk("%d free pages\n",free); + printk("%d reserved pages\n",reserved); + printk("%d pages shared\n",shared); + printk("%d pages swap cached\n",cached); } extern void init_pointer_table(unsigned long ptable); /* References to section boundaries */ -extern char _text[], _etext[]; -extern char __init_begin[], __init_end[]; +extern char _text, _etext, _edata, __bss_start, _end; +extern char __init_begin, __init_end; extern pmd_t *zero_pgtable; void __init mem_init(void) { - pg_data_t *pgdat; int codepages = 0; int datapages = 0; int initpages = 0; + unsigned long tmp; +#ifndef CONFIG_SUN3 int i; +#endif + + max_mapnr = num_physpages = (((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT); #ifdef CONFIG_ATARI if (MACH_IS_ATARI) @@ -124,25 +93,19 @@ void __init mem_init(void) #endif /* this will put all memory onto the freelists */ - totalram_pages = num_physpages = 0; - for_each_online_pgdat(pgdat) { - num_physpages += pgdat->node_present_pages; - - totalram_pages += free_all_bootmem_node(pgdat); - for (i = 0; i < pgdat->node_spanned_pages; i++) { - struct page *page = pgdat->node_mem_map + i; - char *addr = page_to_virt(page); - - if (!PageReserved(page)) - continue; - if (addr >= _text && - addr < _etext) + totalram_pages = free_all_bootmem(); + + for (tmp = PAGE_OFFSET ; tmp < (unsigned long)high_memory; tmp += PAGE_SIZE) { + if (PageReserved(virt_to_page(tmp))) { + if (tmp >= (unsigned long)&_text + && tmp < (unsigned long)&_etext) codepages++; - else if (addr >= __init_begin && - addr < __init_end) + else if (tmp >= (unsigned long) &__init_begin + && tmp < (unsigned long) &__init_end) initpages++; else datapages++; + continue; } } @@ -161,7 +124,7 @@ void __init mem_init(void) printk("Memory: %luk/%luk available (%dk kernel code, %dk data, %dk init)\n", (unsigned long)nr_free_pages() << (PAGE_SHIFT-10), - totalram_pages << (PAGE_SHIFT-10), + max_mapnr << (PAGE_SHIFT-10), codepages << (PAGE_SHIFT-10), datapages << (PAGE_SHIFT-10), initpages << (PAGE_SHIFT-10)); diff --git a/trunk/arch/m68k/mm/memory.c b/trunk/arch/m68k/mm/memory.c index b7473525b431..13c0b4ad01eb 100644 --- a/trunk/arch/m68k/mm/memory.c +++ b/trunk/arch/m68k/mm/memory.c @@ -127,6 +127,67 @@ int free_pointer_table (pmd_t *ptable) return 0; } +#ifdef DEBUG_INVALID_PTOV +int mm_inv_cnt = 5; +#endif + +#ifndef CONFIG_SINGLE_MEMORY_CHUNK +/* + * The following two routines map from a physical address to a kernel + * virtual address and vice versa. + */ +unsigned long mm_vtop(unsigned long vaddr) +{ + int i=0; + unsigned long voff = (unsigned long)vaddr - PAGE_OFFSET; + + do { + if (voff < m68k_memory[i].size) { +#ifdef DEBUGPV + printk ("VTOP(%p)=%lx\n", vaddr, + m68k_memory[i].addr + voff); +#endif + return m68k_memory[i].addr + voff; + } + voff -= m68k_memory[i].size; + } while (++i < m68k_num_memory); + + /* As a special case allow `__pa(high_memory)'. */ + if (voff == 0) + return m68k_memory[i-1].addr + m68k_memory[i-1].size; + + return -1; +} +EXPORT_SYMBOL(mm_vtop); + +unsigned long mm_ptov (unsigned long paddr) +{ + int i = 0; + unsigned long poff, voff = PAGE_OFFSET; + + do { + poff = paddr - m68k_memory[i].addr; + if (poff < m68k_memory[i].size) { +#ifdef DEBUGPV + printk ("PTOV(%lx)=%lx\n", paddr, poff + voff); +#endif + return poff + voff; + } + voff += m68k_memory[i].size; + } while (++i < m68k_num_memory); + +#ifdef DEBUG_INVALID_PTOV + if (mm_inv_cnt > 0) { + mm_inv_cnt--; + printk("Invalid use of phys_to_virt(0x%lx) at 0x%p!\n", + paddr, __builtin_return_address(0)); + } +#endif + return -1; +} +EXPORT_SYMBOL(mm_ptov); +#endif + /* invalidate page in both caches */ static inline void clear040(unsigned long paddr) { @@ -293,3 +354,15 @@ void cache_push (unsigned long paddr, int len) } EXPORT_SYMBOL(cache_push); +#ifndef CONFIG_SINGLE_MEMORY_CHUNK +int mm_end_of_chunk (unsigned long addr, int len) +{ + int i; + + for (i = 0; i < m68k_num_memory; i++) + if (m68k_memory[i].addr + m68k_memory[i].size == addr + len) + return 1; + return 0; +} +EXPORT_SYMBOL(mm_end_of_chunk); +#endif diff --git a/trunk/arch/m68k/mm/motorola.c b/trunk/arch/m68k/mm/motorola.c index 7d571a2b44dd..afcccdc6ad45 100644 --- a/trunk/arch/m68k/mm/motorola.c +++ b/trunk/arch/m68k/mm/motorola.c @@ -43,11 +43,6 @@ unsigned long mm_cachebits; EXPORT_SYMBOL(mm_cachebits); #endif -/* size of memory already mapped in head.S */ -#define INIT_MAPPED_SIZE (4UL<<20) - -extern unsigned long availmem; - static pte_t * __init kernel_page_table(void) { pte_t *ptablep; @@ -103,20 +98,19 @@ static pmd_t * __init kernel_ptr_table(void) return last_pgtable; } -static void __init map_node(int node) +static unsigned long __init +map_chunk (unsigned long addr, long size) { #define PTRTREESIZE (256*1024) #define ROOTTREESIZE (32*1024*1024) - unsigned long physaddr, virtaddr, size; + static unsigned long virtaddr = PAGE_OFFSET; + unsigned long physaddr; pgd_t *pgd_dir; pmd_t *pmd_dir; pte_t *pte_dir; - size = m68k_memory[node].size; - physaddr = m68k_memory[node].addr; - virtaddr = (unsigned long)phys_to_virt(physaddr); - physaddr |= m68k_supervisor_cachemode | - _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY; + physaddr = (addr | m68k_supervisor_cachemode | + _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY); if (CPU_IS_040_OR_060) physaddr |= _PAGE_GLOBAL040; @@ -196,6 +190,8 @@ static void __init map_node(int node) #ifdef DEBUG printk("\n"); #endif + + return virtaddr; } /* @@ -204,16 +200,15 @@ static void __init map_node(int node) */ void __init paging_init(void) { + int chunk; + unsigned long mem_avail = 0; unsigned long zones_size[MAX_NR_ZONES] = { 0, }; - unsigned long min_addr, max_addr; - unsigned long addr, size, end; - int i; #ifdef DEBUG { extern unsigned long availmem; - printk ("start of paging_init (%p, %lx)\n", - kernel_pg_dir, availmem); + printk ("start of paging_init (%p, %lx, %lx, %lx)\n", + kernel_pg_dir, availmem, start_mem, end_mem); } #endif @@ -227,62 +222,24 @@ void __init paging_init(void) pgprot_val(protection_map[i]) |= _PAGE_CACHE040; } - min_addr = m68k_memory[0].addr; - max_addr = min_addr + m68k_memory[0].size; - for (i = 1; i < m68k_num_memory;) { - if (m68k_memory[i].addr < min_addr) { - printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n", - m68k_memory[i].addr, m68k_memory[i].size); - printk("Fix your bootloader or use a memfile to make use of this area!\n"); - m68k_num_memory--; - memmove(m68k_memory + i, m68k_memory + i + 1, - (m68k_num_memory - i) * sizeof(struct mem_info)); - continue; - } - addr = m68k_memory[i].addr + m68k_memory[i].size; - if (addr > max_addr) - max_addr = addr; - i++; - } - m68k_memoffset = min_addr - PAGE_OFFSET; - m68k_virt_to_node_shift = fls(max_addr - min_addr - 1) - 6; - - module_fixup(NULL, __start_fixup, __stop_fixup); - flush_icache(); - - high_memory = phys_to_virt(max_addr); - - min_low_pfn = availmem >> PAGE_SHIFT; - max_low_pfn = max_addr >> PAGE_SHIFT; - - for (i = 0; i < m68k_num_memory; i++) { - addr = m68k_memory[i].addr; - end = addr + m68k_memory[i].size; - m68k_setup_node(i); - availmem = PAGE_ALIGN(availmem); - availmem += init_bootmem_node(NODE_DATA(i), - availmem >> PAGE_SHIFT, - addr >> PAGE_SHIFT, - end >> PAGE_SHIFT); - } - /* * Map the physical memory available into the kernel virtual - * address space. First initialize the bootmem allocator with - * the memory we already mapped, so map_node() has something - * to allocate. + * address space. It may allocate some memory for page + * tables and thus modify availmem. */ - addr = m68k_memory[0].addr; - size = m68k_memory[0].size; - free_bootmem_node(NODE_DATA(0), availmem, min(INIT_MAPPED_SIZE, size) - (availmem - addr)); - map_node(0); - if (size > INIT_MAPPED_SIZE) - free_bootmem_node(NODE_DATA(0), addr + INIT_MAPPED_SIZE, size - INIT_MAPPED_SIZE); - for (i = 1; i < m68k_num_memory; i++) - map_node(i); + for (chunk = 0; chunk < m68k_num_memory; chunk++) { + mem_avail = map_chunk (m68k_memory[chunk].addr, + m68k_memory[chunk].size); + + } flush_tlb_all(); +#ifdef DEBUG + printk ("memory available is %ldKB\n", mem_avail >> 10); + printk ("start_mem is %#lx\nvirtual_end is %#lx\n", + start_mem, end_mem); +#endif /* * initialize the bad page table and bad page to point @@ -299,11 +256,14 @@ void __init paging_init(void) #ifdef DEBUG printk ("before free_area_init\n"); #endif - for (i = 0; i < m68k_num_memory; i++) { - zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT; - free_area_init_node(i, pg_data_map + i, zones_size, - m68k_memory[i].addr >> PAGE_SHIFT, NULL); - } + zones_size[ZONE_DMA] = (mach_max_dma_address < (unsigned long)high_memory ? + (mach_max_dma_address+1) : (unsigned long)high_memory); + zones_size[ZONE_NORMAL] = (unsigned long)high_memory - zones_size[0]; + + zones_size[ZONE_DMA] = (zones_size[ZONE_DMA] - PAGE_OFFSET) >> PAGE_SHIFT; + zones_size[ZONE_NORMAL] >>= PAGE_SHIFT; + + free_area_init(zones_size); } extern char __init_begin, __init_end; diff --git a/trunk/arch/m68k/sun3/config.c b/trunk/arch/m68k/sun3/config.c index c0fbd278fbb1..4851b8437a87 100644 --- a/trunk/arch/m68k/sun3/config.c +++ b/trunk/arch/m68k/sun3/config.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -128,7 +127,6 @@ void __init sun3_bootmem_alloc(unsigned long memory_start, unsigned long memory_ high_memory = (void *)memory_end; availmem = memory_start; - m68k_setup_node(0); availmem += init_bootmem_node(NODE_DATA(0), start_page, 0, num_pages); availmem = (availmem + (PAGE_SIZE-1)) & PAGE_MASK; diff --git a/trunk/arch/mips/Kconfig b/trunk/arch/mips/Kconfig index 9528ee90640a..0f09412e1b7f 100644 --- a/trunk/arch/mips/Kconfig +++ b/trunk/arch/mips/Kconfig @@ -747,9 +747,9 @@ config EARLY_PRINTK to print messages very early in the bootup process. This is useful for kernel debugging when your machine crashes very - early before the console code is initialized. For normal operation, - it is not recommended because it looks ugly on some machines and - doesn't cooperate with an X server. You should normally say N here, + early before the console code is initialized. For normal operation + it is not recommended because it looks on some machines ugly and + oesn't cooperate with an X server. You should normally N here, unless you want to debug such a crash. config SYS_HAS_EARLY_PRINTK diff --git a/trunk/arch/mips/emma2rh/markeins/setup.c b/trunk/arch/mips/emma2rh/markeins/setup.c index 2f060e1ed36c..b29a44739230 100644 --- a/trunk/arch/mips/emma2rh/markeins/setup.c +++ b/trunk/arch/mips/emma2rh/markeins/setup.c @@ -115,6 +115,30 @@ extern void markeins_irq_setup(void); static void inline __init markeins_sio_setup(void) { +#ifdef CONFIG_KGDB_8250 + struct uart_port emma_port; + + memset(&emma_port, 0, sizeof(emma_port)); + + emma_port.flags = + UPF_BOOT_AUTOCONF | UPF_SKIP_TEST; + emma_port.iotype = UPIO_MEM; + emma_port.regshift = 4; /* I/O addresses are every 8 bytes */ + emma_port.uartclk = 18544000; /* Clock rate of the chip */ + + emma_port.line = 0; + emma_port.mapbase = KSEG1ADDR(EMMA2RH_PFUR0_BASE + 3); + emma_port.membase = (u8*)emma_port.mapbase; + early_serial_setup(&emma_port); + + emma_port.line = 1; + emma_port.mapbase = KSEG1ADDR(EMMA2RH_PFUR1_BASE + 3); + emma_port.membase = (u8*)emma_port.mapbase; + early_serial_setup(&emma_port); + + emma_port.irq = EMMA2RH_IRQ_PFUR1; + kgdb8250_add_port(1, &emma_port); +#endif } void __init plat_mem_setup(void) diff --git a/trunk/arch/mips/jmr3927/rbhma3100/kgdb_io.c b/trunk/arch/mips/jmr3927/rbhma3100/kgdb_io.c index 342579cfdc01..2604f2c9a96e 100644 --- a/trunk/arch/mips/jmr3927/rbhma3100/kgdb_io.c +++ b/trunk/arch/mips/jmr3927/rbhma3100/kgdb_io.c @@ -36,7 +36,7 @@ #define TIMEOUT 0xffffff static int remoteDebugInitialized = 0; -static void debugInit(int baud); +static void debugInit(int baud) int putDebugChar(unsigned char c) { diff --git a/trunk/arch/mips/kernel/linux32.c b/trunk/arch/mips/kernel/linux32.c index 06e04da211d5..37849edd0645 100644 --- a/trunk/arch/mips/kernel/linux32.c +++ b/trunk/arch/mips/kernel/linux32.c @@ -556,16 +556,6 @@ asmlinkage long sys32_sync_file_range(int fd, int __pad, flags); } -asmlinkage long sys32_fadvise64_64(int fd, int __pad, - unsigned long a2, unsigned long a3, - unsigned long a4, unsigned long a5, - int flags) -{ - return sys_fadvise64_64(fd, - merge_64(a2, a3), merge_64(a4, a5), - flags); -} - save_static_function(sys32_clone); __attribute_used__ noinline static int _sys32_clone(nabi_no_regargs struct pt_regs regs) diff --git a/trunk/arch/mips/kernel/r4k_switch.S b/trunk/arch/mips/kernel/r4k_switch.S index 06729596812f..cc566cf12246 100644 --- a/trunk/arch/mips/kernel/r4k_switch.S +++ b/trunk/arch/mips/kernel/r4k_switch.S @@ -174,7 +174,7 @@ LEAF(_init_fpu) or t0, t1 mtc0 t0, CP0_STATUS #endif /* CONFIG_MIPS_MT_SMTC */ - enable_fpu_hazard + fpu_enable_hazard li t1, FPU_DEFAULT ctc1 t1, fcr31 diff --git a/trunk/arch/mips/kernel/scall64-n32.S b/trunk/arch/mips/kernel/scall64-n32.S index 1631035ffc24..6eac28337423 100644 --- a/trunk/arch/mips/kernel/scall64-n32.S +++ b/trunk/arch/mips/kernel/scall64-n32.S @@ -299,7 +299,7 @@ EXPORT(sysn32_call_table) PTR sys_ni_syscall /* res. for afs_syscall */ PTR sys_ni_syscall /* res. for security */ PTR sys_gettid - PTR sys_readahead + PTR sys32_readahead PTR sys_setxattr /* 6180 */ PTR sys_lsetxattr PTR sys_fsetxattr diff --git a/trunk/arch/mips/kernel/scall64-o32.S b/trunk/arch/mips/kernel/scall64-o32.S index 2aa99426ac1c..7e74b412a782 100644 --- a/trunk/arch/mips/kernel/scall64-o32.S +++ b/trunk/arch/mips/kernel/scall64-o32.S @@ -459,7 +459,7 @@ sys_call_table: PTR sys_remap_file_pages PTR sys_set_tid_address PTR sys_restart_syscall - PTR sys32_fadvise64_64 + PTR sys_fadvise64_64 PTR compat_sys_statfs64 /* 4255 */ PTR compat_sys_fstatfs64 PTR compat_sys_timer_create diff --git a/trunk/arch/mips/kernel/traps.c b/trunk/arch/mips/kernel/traps.c index 3f58b6ac1358..200de027f354 100644 --- a/trunk/arch/mips/kernel/traps.c +++ b/trunk/arch/mips/kernel/traps.c @@ -927,6 +927,12 @@ asmlinkage void do_reserved(struct pt_regs *regs) (regs->cp0_cause & 0x7f) >> 2); } +static asmlinkage void do_default_vi(void) +{ + show_regs(get_irq_regs()); + panic("Caught unexpected vectored interrupt."); +} + /* * Some MIPS CPUs can enable/disable for cache parity detection, but do * it different ways. @@ -1122,12 +1128,6 @@ void mips_srs_free(int set) clear_bit(set, &sr->sr_allocated); } -static asmlinkage void do_default_vi(void) -{ - show_regs(get_irq_regs()); - panic("Caught unexpected vectored interrupt."); -} - static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) { unsigned long handler; diff --git a/trunk/arch/mips/mips-boards/atlas/atlas_setup.c b/trunk/arch/mips/mips-boards/atlas/atlas_setup.c index 1cc6ebbedfdd..0c6b0ce15028 100644 --- a/trunk/arch/mips/mips-boards/atlas/atlas_setup.c +++ b/trunk/arch/mips/mips-boards/atlas/atlas_setup.c @@ -48,8 +48,6 @@ const char *get_system_type(void) return "MIPS Atlas"; } -const char display_string[] = " LINUX ON ATLAS "; - void __init plat_mem_setup(void) { mips_pcibios_init(); diff --git a/trunk/arch/mips/mips-boards/generic/display.c b/trunk/arch/mips/mips-boards/generic/display.c index 5d600054090a..548dbe5ce7c8 100644 --- a/trunk/arch/mips/mips-boards/generic/display.c +++ b/trunk/arch/mips/mips-boards/generic/display.c @@ -19,14 +19,9 @@ */ #include -#include #include #include -extern const char display_string[]; -static unsigned int display_count; -static unsigned int max_display_count; - void mips_display_message(const char *str) { static unsigned int __iomem *display = NULL; @@ -42,22 +37,3 @@ void mips_display_message(const char *str) writel(' ', display + i); } } - -static void scroll_display_message(unsigned long data); -static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0); - -static void scroll_display_message(unsigned long data) -{ - mips_display_message(&display_string[display_count++]); - if (display_count == max_display_count) - display_count = 0; - - mod_timer(&mips_scroll_timer, jiffies + HZ); -} - -void mips_scroll_message(void) -{ - del_timer_sync(&mips_scroll_timer); - max_display_count = strlen(display_string) + 1 - 8; - mod_timer(&mips_scroll_timer, jiffies + 1); -} diff --git a/trunk/arch/mips/mips-boards/generic/time.c b/trunk/arch/mips/mips-boards/generic/time.c index 37735bfc3afd..df2a2bd3aa5d 100644 --- a/trunk/arch/mips/mips-boards/generic/time.c +++ b/trunk/arch/mips/mips-boards/generic/time.c @@ -53,11 +53,37 @@ unsigned long cpu_khz; +#if defined(CONFIG_MIPS_ATLAS) +static char display_string[] = " LINUX ON ATLAS "; +#endif +#if defined(CONFIG_MIPS_MALTA) +#if defined(CONFIG_MIPS_MT_SMTC) +static char display_string[] = " SMTC LINUX ON MALTA "; +#else +static char display_string[] = " LINUX ON MALTA "; +#endif /* CONFIG_MIPS_MT_SMTC */ +#endif +#if defined(CONFIG_MIPS_SEAD) +static char display_string[] = " LINUX ON SEAD "; +#endif +static unsigned int display_count; +#define MAX_DISPLAY_COUNT (sizeof(display_string) - 8) + #define CPUCTR_IMASKBIT (0x100 << MIPSCPU_INT_CPUCTR) +static unsigned int timer_tick_count; static int mips_cpu_timer_irq; extern void smtc_timer_broadcast(int); +static inline void scroll_display_message(void) +{ + if ((timer_tick_count++ % HZ) == 0) { + mips_display_message(&display_string[display_count++]); + if (display_count == MAX_DISPLAY_COUNT) + display_count = 0; + } +} + static void mips_timer_dispatch(void) { do_IRQ(mips_cpu_timer_irq); @@ -117,6 +143,7 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id) if (cpu_data[cpu].vpe_id == 0) { timer_interrupt(irq, NULL); smtc_timer_broadcast(cpu_data[cpu].vpe_id); + scroll_display_message(); } else { write_c0_compare(read_c0_count() + (mips_hpt_frequency/HZ)); @@ -140,6 +167,8 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id) /* we keep interrupt disabled all the time */ if (!r2 || (read_c0_cause() & (1 << 30))) timer_interrupt(irq, NULL); + + scroll_display_message(); } else { /* Everyone else needs to reset the timer int here as ll_local_timer_interrupt doesn't */ @@ -233,8 +262,6 @@ void __init mips_time_init(void) (est_freq%1000000)*100/1000000); cpu_khz = est_freq / 1000; - - mips_scroll_message(); } void __init plat_timer_setup(struct irqaction *irq) diff --git a/trunk/arch/mips/mips-boards/malta/malta_setup.c b/trunk/arch/mips/mips-boards/malta/malta_setup.c index c14b7bf89950..7873932532a1 100644 --- a/trunk/arch/mips/mips-boards/malta/malta_setup.c +++ b/trunk/arch/mips/mips-boards/malta/malta_setup.c @@ -56,12 +56,6 @@ const char *get_system_type(void) return "MIPS Malta"; } -#if defined(CONFIG_MIPS_MT_SMTC) -const char display_string[] = " SMTC LINUX ON MALTA "; -#else -const char display_string[] = " LINUX ON MALTA "; -#endif /* CONFIG_MIPS_MT_SMTC */ - #ifdef CONFIG_BLK_DEV_FD void __init fd_activate(void) { diff --git a/trunk/arch/mips/mips-boards/sead/sead_setup.c b/trunk/arch/mips/mips-boards/sead/sead_setup.c index 811aba100605..a189dec7c7bc 100644 --- a/trunk/arch/mips/mips-boards/sead/sead_setup.c +++ b/trunk/arch/mips/mips-boards/sead/sead_setup.c @@ -43,8 +43,6 @@ const char *get_system_type(void) return "MIPS SEAD"; } -const char display_string[] = " LINUX ON SEAD "; - void __init plat_mem_setup(void) { ioport_resource.end = 0x7fffffff; diff --git a/trunk/arch/mips/mm/dma-default.c b/trunk/arch/mips/mm/dma-default.c index 76903c727647..f0eb29917d9a 100644 --- a/trunk/arch/mips/mm/dma-default.c +++ b/trunk/arch/mips/mm/dma-default.c @@ -168,9 +168,8 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, addr = (unsigned long) page_address(sg->page); if (!plat_device_is_coherent(dev) && addr) __dma_sync(addr + sg->offset, sg->length, direction); - sg->dma_address = plat_map_dma_mem(dev, - (void *)(addr + sg->offset), - sg->length); + sg->dma_address = plat_map_dma_mem_page(dev, sg->page) + + sg->offset; } return nents; diff --git a/trunk/arch/mips/pci/pci-ocelot.c b/trunk/arch/mips/pci/pci-ocelot.c index 1421d34535ef..7f94f26d35ae 100644 --- a/trunk/arch/mips/pci/pci-ocelot.c +++ b/trunk/arch/mips/pci/pci-ocelot.c @@ -71,19 +71,19 @@ static inline void pci0WriteConfigReg(unsigned int offset, unsigned int data) } static struct resource ocelot_mem_resource = { - .start = GT_PCI_MEM_BASE, - .end = GT_PCI_MEM_BASE + GT_PCI_MEM_BASE - 1, + start = GT_PCI_MEM_BASE; + end = GT_PCI_MEM_BASE + GT_PCI_MEM_BASE - 1; }; static struct resource ocelot_io_resource = { - .start = GT_PCI_IO_BASE, - .end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1, + start = GT_PCI_IO_BASE; + end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1; }; static struct pci_controller ocelot_pci_controller = { - .pci_ops = gt64xxx_pci0_ops, - .mem_resource = &ocelot_mem_resource, - .io_resource = &ocelot_io_resource, + .pci_ops = gt64xxx_pci0_ops; + .mem_resource = &ocelot_mem_resource; + .io_resource = &ocelot_io_resource; }; static int __init ocelot_pcibios_init(void) diff --git a/trunk/arch/mips/qemu/q-irq.c b/trunk/arch/mips/qemu/q-irq.c index 89891e984b3b..f5ea2fe10f14 100644 --- a/trunk/arch/mips/qemu/q-irq.c +++ b/trunk/arch/mips/qemu/q-irq.c @@ -7,6 +7,8 @@ #include #include +extern asmlinkage void qemu_handle_int(void); + asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); diff --git a/trunk/arch/mips/sni/pcimt.c b/trunk/arch/mips/sni/pcimt.c index 97b234361b4d..9ee208daa8b1 100644 --- a/trunk/arch/mips/sni/pcimt.c +++ b/trunk/arch/mips/sni/pcimt.c @@ -6,7 +6,7 @@ * for more details. * * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org) - * Copyright (C) 2006,2007 Thomas Bogendoerfer (tsbogend@alpha.franken.de) + * Copyright (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) */ #include @@ -131,19 +131,6 @@ static struct resource pcimt_io_resources[] = { } }; -static struct resource pcimt_mem_resources[] = { - { - /* - * this region should only be 4 bytes long, - * but it's 16MB on all RM300C I've checked - */ - .start = 0x1a000000, - .end = 0x1affffff, - .name = "PCI INT ACK", - .flags = IORESOURCE_BUSY - } -}; - static struct resource sni_mem_resource = { .start = 0x18000000UL, .end = 0x1fbfffffUL, @@ -158,9 +145,6 @@ static void __init sni_pcimt_resource_init(void) /* request I/O space for devices used on all i[345]86 PCs */ for (i = 0; i < ARRAY_SIZE(pcimt_io_resources); i++) request_resource(&sni_io_resource, pcimt_io_resources + i); - /* request MEM space for devices used on all i[345]86 PCs */ - for (i = 0; i < ARRAY_SIZE(pcimt_mem_resources); i++) - request_resource(&sni_mem_resource, pcimt_mem_resources + i); } extern struct pci_ops sni_pcimt_ops; diff --git a/trunk/arch/mips/sni/setup.c b/trunk/arch/mips/sni/setup.c index 4fedfbda0c79..68d7cf609b4f 100644 --- a/trunk/arch/mips/sni/setup.c +++ b/trunk/arch/mips/sni/setup.c @@ -6,7 +6,7 @@ * for more details. * * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org) - * Copyright (C) 2006,2007 Thomas Bogendoerfer (tsbogend@alpha.franken.de) + * Copyright (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) */ #include #include @@ -92,34 +92,3 @@ void __init plat_mem_setup(void) sni_display_setup(); } - -#if CONFIG_PCI - -#include -#include