diff --git a/[refs] b/[refs]
index 974232e2c1a9..368620ecf5ce 100644
--- a/[refs]
+++ b/[refs]
@@ -1,2 +1,2 @@
---
-refs/heads/master: 8ac1c101ec73e60635257ed9af1c6ab423c535b4
+refs/heads/master: ddd43b063d16cdeffbc18f00b72c112f246fae78
diff --git a/trunk/Documentation/CodingStyle b/trunk/Documentation/CodingStyle
index b49b92edb396..afc286775891 100644
--- a/trunk/Documentation/CodingStyle
+++ b/trunk/Documentation/CodingStyle
@@ -495,40 +495,29 @@ re-formatting you may want to take a look at the man page. But
remember: "indent" is not a fix for bad programming.
- Chapter 10: Kconfig configuration files
+ Chapter 10: Configuration-files
-For all of the Kconfig* configuration files throughout the source tree,
-the indentation is somewhat different. Lines under a "config" definition
-are indented with one tab, while help text is indented an additional two
-spaces. Example:
+For configuration options (arch/xxx/Kconfig, and all the Kconfig files),
+somewhat different indentation is used.
-config AUDIT
- bool "Auditing support"
- depends on NET
- help
- Enable auditing infrastructure that can be used with another
- kernel subsystem, such as SELinux (which requires this for
- logging of avc messages output). Does not do system-call
- auditing without CONFIG_AUDITSYSCALL.
-
-Features that might still be considered unstable should be defined as
-dependent on "EXPERIMENTAL":
-
-config SLUB
- depends on EXPERIMENTAL && !ARCH_USES_SLAB_PAGE_STRUCT
- bool "SLUB (Unqueued Allocator)"
- ...
+Help text is indented with 2 spaces.
-while seriously dangerous features (such as write support for certain
-filesystems) should advertise this prominently in their prompt string:
-
-config ADFS_FS_RW
- bool "ADFS write support (DANGEROUS)"
- depends on ADFS_FS
- ...
+if CONFIG_EXPERIMENTAL
+ tristate CONFIG_BOOM
+ default n
+ help
+ Apply nitroglycerine inside the keyboard (DANGEROUS)
+ bool CONFIG_CHEER
+ depends on CONFIG_BOOM
+ default y
+ help
+ Output nice messages when you explode
+endif
-For full documentation on the configuration files, see the file
-Documentation/kbuild/kconfig-language.txt.
+Generally, CONFIG_EXPERIMENTAL should surround all options not considered
+stable. All options that are known to trash data (experimental write-
+support for file-systems, for instance) should be denoted (DANGEROUS), other
+experimental options should be denoted (EXPERIMENTAL).
Chapter 11: Data structures
diff --git a/trunk/Documentation/DocBook/gadget.tmpl b/trunk/Documentation/DocBook/gadget.tmpl
index 6996d977bf8f..e7fc96433408 100644
--- a/trunk/Documentation/DocBook/gadget.tmpl
+++ b/trunk/Documentation/DocBook/gadget.tmpl
@@ -52,7 +52,7 @@
-Introduction
+Introduction
This document presents a Linux-USB "Gadget"
kernel mode
diff --git a/trunk/Documentation/DocBook/usb.tmpl b/trunk/Documentation/DocBook/usb.tmpl
index af293606fbe3..a2ebd651b05a 100644
--- a/trunk/Documentation/DocBook/usb.tmpl
+++ b/trunk/Documentation/DocBook/usb.tmpl
@@ -185,7 +185,7 @@
-USB-Standard Types
+USB-Standard Types
In <linux/usb/ch9.h> you will find
the USB data types defined in chapter 9 of the USB specification.
@@ -197,7 +197,7 @@
-Host-Side Data Types and Macros
+Host-Side Data Types and Macros
The host side API exposes several layers to drivers, some of
which are more necessary than others.
@@ -211,7 +211,7 @@
- USB Core APIs
+ USB Core APIs
There are two basic I/O models in the USB API.
The most elemental one is asynchronous: drivers submit requests
@@ -248,7 +248,7 @@
!Edrivers/usb/core/hub.c
- Host Controller APIs
+ Host Controller APIs
These APIs are only for use by host controller drivers,
most of which implement standard register interfaces such as
@@ -285,7 +285,7 @@
!Idrivers/usb/core/buffer.c
-
+
The USB Filesystem (usbfs)
This chapter presents the Linux usbfs .
@@ -317,7 +317,7 @@
not it has a kernel driver.
-
+
What files are in "usbfs"?
Conventionally mounted at
@@ -356,7 +356,7 @@
-
+
Mounting and Access Control
There are a number of mount options for usbfs, which will
@@ -439,7 +439,7 @@
-
+
/proc/bus/usb/devices
This file is handy for status viewing tools in user
@@ -473,7 +473,7 @@ for (;;) {
-
+
/proc/bus/usb/BBB/DDD
Use these files in one of these basic ways:
@@ -510,7 +510,7 @@ for (;;) {
-
+
Life Cycle of User Mode Drivers
Such a driver first needs to find a device file
@@ -565,7 +565,7 @@ for (;;) {
- The ioctl() Requests
+ The ioctl() Requests
To use these ioctls, you need to include the following
headers in your userspace program:
@@ -604,7 +604,7 @@ for (;;) {
-
+
Management/Status Requests
A number of usbfs requests don't deal very directly
@@ -736,7 +736,7 @@ usbdev_ioctl (int fd, int ifno, unsigned request, void *param)
-
+
Synchronous I/O Support
Synchronous requests involve the kernel blocking
@@ -865,7 +865,7 @@ usbdev_ioctl (int fd, int ifno, unsigned request, void *param)
-
+
Asynchronous I/O Support
As mentioned above, there are situations where it may be
diff --git a/trunk/Documentation/HOWTO b/trunk/Documentation/HOWTO
index ced9207bedcf..48123dba5e6a 100644
--- a/trunk/Documentation/HOWTO
+++ b/trunk/Documentation/HOWTO
@@ -396,6 +396,26 @@ bugme-janitor mailing list (every change in the bugzilla is mailed here)
+Managing bug reports
+--------------------
+
+One of the best ways to put into practice your hacking skills is by fixing
+bugs reported by other people. Not only you will help to make the kernel
+more stable, you'll learn to fix real world problems and you will improve
+your skills, and other developers will be aware of your presence. Fixing
+bugs is one of the best ways to get merits among other developers, because
+not many people like wasting time fixing other people's bugs.
+
+To work in the already reported bug reports, go to http://bugzilla.kernel.org.
+If you want to be advised of the future bug reports, you can subscribe to the
+bugme-new mailing list (only new bug reports are mailed here) or to the
+bugme-janitor mailing list (every change in the bugzilla is mailed here)
+
+ http://lists.osdl.org/mailman/listinfo/bugme-new
+ http://lists.osdl.org/mailman/listinfo/bugme-janitors
+
+
+
Mailing lists
-------------
diff --git a/trunk/Documentation/block/capability.txt b/trunk/Documentation/block/capability.txt
deleted file mode 100644
index 2f1729424ef4..000000000000
--- a/trunk/Documentation/block/capability.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Generic Block Device Capability
-===============================================================================
-This file documents the sysfs file block//capability
-
-capability is a hex word indicating which capabilities a specific disk
-supports. For more information on bits not listed here, see
-include/linux/genhd.h
-
-Capability Value
--------------------------------------------------------------------------------
-GENHD_FL_MEDIA_CHANGE_NOTIFY 4
- When this bit is set, the disk supports Asynchronous Notification
- of media change events. These events will be broadcast to user
- space via kernel uevent.
-
diff --git a/trunk/Documentation/dontdiff b/trunk/Documentation/dontdiff
index 595a5ea4c690..64e9f6c4826b 100644
--- a/trunk/Documentation/dontdiff
+++ b/trunk/Documentation/dontdiff
@@ -10,12 +10,10 @@
*.grp
*.gz
*.html
-*.i
*.jpeg
*.ko
*.log
*.lst
-*.moc
*.mod.c
*.o
*.orig
@@ -27,9 +25,6 @@
*.s
*.sgml
*.so
-*.symtypes
-*.tab.c
-*.tab.h
*.tex
*.ver
*.xml
@@ -37,13 +32,9 @@
*_vga16.c
*cscope*
*~
-*.9
-*.9.gz
.*
.cscope
53c700_d.h
-53c7xx_d.h
-53c7xx_u.h
53c8xx_d.h*
BitKeeper
COPYING
@@ -79,11 +70,9 @@ bzImage*
classlist.h*
comp*.log
compile.h*
-conf
config
config-*
config_data.h*
-config_data.gz*
conmakehash
consolemap_deftbl.c*
crc32table.h*
@@ -92,23 +81,18 @@ defkeymap.c*
devlist.h*
docproc
dummy_sym.c*
-elf2ecoff
elfconfig.h*
filelist
fixdep
fore200e_mkfirm
fore200e_pca_fw.c*
-gconf
gen-devlist
gen-kdb_cmds.c*
gen_crc32table
gen_init_cpio
genksyms
gentbl
-*_gray256.c
ikconfig.h*
-initramfs_data.cpio
-initramfs_data.cpio.gz
initramfs_list
kallsyms
kconfig
@@ -116,30 +100,19 @@ kconfig.tk
keywords.c*
ksym.c*
ksym.h*
-kxgettext
-lkc_defs.h
lex.c*
-lex.*.c
-lk201-map.c
logo_*.c
logo_*_clut224.c
logo_*_mono.c
lxdialog
mach-types
mach-types.h
-machtypes.h
make_times_h
map
maui_boot.h
-mconf
-miboot*
mk_elfconfig
-mkboot
-mkbugboot
mkdep
-mkprep
mktables
-mktree
modpost
modversions.h*
offset.h
@@ -147,28 +120,18 @@ offsets.h
oui.c*
parse.c*
parse.h*
-patches*
-pca200e.bin
-pca200e_ecd.bin2
-piggy.gz
-piggyback
pnmtologo
ppc_defs.h*
promcon_tbl.c*
pss_boot.h
-qconf
raid6altivec*.c
raid6int*.c
raid6tables.c
-relocs
-series
setup
sim710_d.h*
-sImage
sm_tbl*
split-include
tags
-tftpboot.img
times.h*
tkparse
trix_boot.h
@@ -176,11 +139,8 @@ utsrelease.h*
version.h*
vmlinux
vmlinux-*
-vmlinux.aout
vmlinux.lds
vsyscall.lds
wanxlfw.inc
uImage
-unifdef
-zImage*
-zconf.hash.c
+zImage
diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt
index 2d7ea85075ba..5c8695a3d139 100644
--- a/trunk/Documentation/feature-removal-schedule.txt
+++ b/trunk/Documentation/feature-removal-schedule.txt
@@ -62,7 +62,7 @@ Who: Dan Dennedy , Stefan Richter
What: old NCR53C9x driver
When: October 2007
Why: Replaced by the much better esp_scsi driver. Actual low-level
- driver can be ported over almost trivially.
+ driver can ported over almost trivially.
Who: David Miller
Christoph Hellwig
diff --git a/trunk/Documentation/filesystems/directory-locking b/trunk/Documentation/filesystems/directory-locking
index ff7b611abf33..d7099a9266fb 100644
--- a/trunk/Documentation/filesystems/directory-locking
+++ b/trunk/Documentation/filesystems/directory-locking
@@ -1,6 +1,5 @@
Locking scheme used for directory operations is based on two
-kinds of locks - per-inode (->i_mutex) and per-filesystem
-(->s_vfs_rename_mutex).
+kinds of locks - per-inode (->i_sem) and per-filesystem (->s_vfs_rename_sem).
For our purposes all operations fall in 5 classes:
@@ -64,7 +63,7 @@ objects - A < B iff A is an ancestor of B.
attempt to acquire some lock and already holds at least one lock. Let's
consider the set of contended locks. First of all, filesystem lock is
not contended, since any process blocked on it is not holding any locks.
-Thus all processes are blocked on ->i_mutex.
+Thus all processes are blocked on ->i_sem.
Non-directory objects are not contended due to (3). Thus link
creation can't be a part of deadlock - it can't be blocked on source
diff --git a/trunk/Documentation/filesystems/porting b/trunk/Documentation/filesystems/porting
index dac45c92d872..5531694059ab 100644
--- a/trunk/Documentation/filesystems/porting
+++ b/trunk/Documentation/filesystems/porting
@@ -107,7 +107,7 @@ free to drop it...
---
[informational]
-->link() callers hold ->i_mutex on the object we are linking to. Some of your
+->link() callers hold ->i_sem on the object we are linking to. Some of your
problems might be over...
---
@@ -130,9 +130,9 @@ went in - and hadn't been documented ;-/). Just remove it from fs_flags
---
[mandatory]
-->setattr() is called without BKL now. Caller _always_ holds ->i_mutex, so
-watch for ->i_mutex-grabbing code that might be used by your ->setattr().
-Callers of notify_change() need ->i_mutex now.
+->setattr() is called without BKL now. Caller _always_ holds ->i_sem, so
+watch for ->i_sem-grabbing code that might be used by your ->setattr().
+Callers of notify_change() need ->i_sem now.
---
[recommended]
diff --git a/trunk/Documentation/i386/boot.txt b/trunk/Documentation/i386/boot.txt
index 35985b34d5a6..66fa67fec2a7 100644
--- a/trunk/Documentation/i386/boot.txt
+++ b/trunk/Documentation/i386/boot.txt
@@ -2,7 +2,7 @@
----------------------------
H. Peter Anvin
- Last update 2007-05-23
+ Last update 2007-05-16
On the i386 platform, the Linux kernel uses a rather complicated boot
convention. This has evolved partially due to historical aspects, as
@@ -202,8 +202,6 @@ All general purpose boot loaders should write the fields marked
nonstandard address should fill in the fields marked (reloc); other
boot loaders can ignore those fields.
-The byte order of all fields is littleendian (this is x86, after all.)
-
Field name: setup_secs
Type: read
Offset/size: 0x1f1/1
@@ -282,16 +280,14 @@ Type: read
Offset/size: 0x206/2
Protocol: 2.00+
- Contains the boot protocol version, in (major << 8)+minor format,
- e.g. 0x0204 for version 2.04, and 0x0a11 for a hypothetical version
- 10.17.
+ Contains the boot protocol version, e.g. 0x0204 for version 2.04.
Field name: readmode_swtch
Type: modify (optional)
Offset/size: 0x208/4
Protocol: 2.00+
- Boot loader hook (see ADVANCED BOOT LOADER HOOKS below.)
+ Boot loader hook (see separate chapter.)
Field name: start_sys
Type: read
@@ -308,17 +304,10 @@ Protocol: 2.00+
If set to a nonzero value, contains a pointer to a NUL-terminated
human-readable kernel version number string, less 0x200. This can
be used to display the kernel version to the user. This value
- should be less than (0x200*setup_sects).
-
- For example, if this value is set to 0x1c00, the kernel version
- number string can be found at offset 0x1e00 in the kernel file.
- This is a valid value if and only if the "setup_sects" field
- contains the value 15 or higher, as:
-
- 0x1c00 < 15*0x200 (= 0x1e00) but
- 0x1c00 >= 14*0x200 (= 0x1c00)
-
- 0x1c00 >> 9 = 14, so the minimum value for setup_secs is 15.
+ should be less than (0x200*setup_sects). For example, if this value
+ is set to 0x1c00, the kernel version number string can be found at
+ offset 0x1e00 in the kernel file. This is a valid value if and only
+ if the "setup_sects" field contains the value 14 or higher.
Field name: type_of_loader
Type: write (obligatory)
@@ -388,7 +377,7 @@ Protocol: 2.00+
This field can be modified for two purposes:
- 1. as a boot loader hook (see ADVANCED BOOT LOADER HOOKS below.)
+ 1. as a boot loader hook (see separate chapter.)
2. if a bootloader which does not install a hook loads a
relocatable kernel at a nonstandard address it will have to modify
@@ -726,7 +715,7 @@ switched off, especially if the loaded kernel has the floppy driver as
a demand-loaded module!
-**** ADVANCED BOOT LOADER HOOKS
+**** ADVANCED BOOT TIME HOOKS
If the boot loader runs in a particularly hostile environment (such as
LOADLIN, which runs under DOS) it may be impossible to follow the
@@ -751,5 +740,4 @@ IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and
set them up to BOOT_DS (0x18) yourself.
After completing your hook, you should jump to the address
- that was in this field before your boot loader overwrote it
- (relocated, if appropriate.)
+ that was in this field before your boot loader overwrote it.
diff --git a/trunk/Documentation/initrd.txt b/trunk/Documentation/initrd.txt
index d3dc505104da..15f1b35deb34 100644
--- a/trunk/Documentation/initrd.txt
+++ b/trunk/Documentation/initrd.txt
@@ -27,20 +27,16 @@ When using initrd, the system typically boots as follows:
1) the boot loader loads the kernel and the initial RAM disk
2) the kernel converts initrd into a "normal" RAM disk and
frees the memory used by initrd
- 3) if the root device is not /dev/ram0, the old (deprecated)
- change_root procedure is followed. see the "Obsolete root change
- mechanism" section below.
- 4) root device is mounted. if it is /dev/ram0, the initrd image is
- then mounted as root
- 5) /sbin/init is executed (this can be any valid executable, including
+ 3) initrd is mounted read-write as root
+ 4) /linuxrc is executed (this can be any valid executable, including
shell scripts; it is run with uid 0 and can do basically everything
- init can do).
- 6) init mounts the "real" root file system
- 7) init places the root file system at the root directory using the
+ init can do)
+ 5) linuxrc mounts the "real" root file system
+ 6) linuxrc places the root file system at the root directory using the
pivot_root system call
- 8) init execs the /sbin/init on the new root filesystem, performing
- the usual boot sequence
- 9) the initrd file system is removed
+ 7) the usual boot sequence (e.g. invocation of /sbin/init) is performed
+ on the root file system
+ 8) the initrd file system is removed
Note that changing the root directory does not involve unmounting it.
It is therefore possible to leave processes running on initrd during that
@@ -74,7 +70,7 @@ initrd adds the following new options:
root=/dev/ram0
initrd is mounted as root, and the normal boot procedure is followed,
- with the RAM disk mounted as root.
+ with the RAM disk still mounted as root.
Compressed cpio images
----------------------
@@ -141,11 +137,11 @@ We'll describe the loopback device method:
# mkdir /mnt/dev
# mknod /mnt/dev/console c 5 1
5) copy all the files that are needed to properly use the initrd
- environment. Don't forget the most important file, /sbin/init
- Note that /sbin/init's permissions must include "x" (execute).
+ environment. Don't forget the most important file, /linuxrc
+ Note that /linuxrc's permissions must include "x" (execute).
6) correct operation the initrd environment can frequently be tested
even without rebooting with the command
- # chroot /mnt /sbin/init
+ # chroot /mnt /linuxrc
This is of course limited to initrds that do not interfere with the
general system state (e.g. by reconfiguring network interfaces,
overwriting mounted devices, trying to start already running demons,
@@ -158,7 +154,7 @@ We'll describe the loopback device method:
# gzip -9 initrd
For experimenting with initrd, you may want to take a rescue floppy and
-only add a symbolic link from /sbin/init to /bin/sh. Alternatively, you
+only add a symbolic link from /linuxrc to /bin/sh. Alternatively, you
can try the experimental newlib environment [2] to create a small
initrd.
@@ -167,14 +163,15 @@ boot loaders support initrd. Since the boot process is still compatible
with an older mechanism, the following boot command line parameters
have to be given:
- root=/dev/ram0 rw
+ root=/dev/ram0 init=/linuxrc rw
(rw is only necessary if writing to the initrd file system.)
With LOADLIN, you simply execute
LOADLIN initrd=
-e.g. LOADLIN C:\LINUX\BZIMAGE initrd=C:\LINUX\INITRD.GZ root=/dev/ram0 rw
+e.g. LOADLIN C:\LINUX\BZIMAGE initrd=C:\LINUX\INITRD.GZ root=/dev/ram0
+ init=/linuxrc rw
With LILO, you add the option INITRD= to either the global section
or to the section of the respective kernel in /etc/lilo.conf, and pass
@@ -182,7 +179,7 @@ the options using APPEND, e.g.
image = /bzImage
initrd = /boot/initrd.gz
- append = "root=/dev/ram0 rw"
+ append = "root=/dev/ram0 init=/linuxrc rw"
and run /sbin/lilo
@@ -194,7 +191,7 @@ Now you can boot and enjoy using initrd.
Changing the root device
------------------------
-When finished with its duties, init typically changes the root device
+When finished with its duties, linuxrc typically changes the root device
and proceeds with starting the Linux system on the "real" root device.
The procedure involves the following steps:
@@ -220,7 +217,7 @@ must exist before calling pivot_root. Example:
# mkdir initrd
# pivot_root . initrd
-Now, the init process may still access the old root via its
+Now, the linuxrc process may still access the old root via its
executable, shared libraries, standard input/output/error, and its
current root directory. All these references are dropped by the
following command:
@@ -252,6 +249,10 @@ disk can be freed:
It is also possible to use initrd with an NFS-mounted root, see the
pivot_root(8) man page for details.
+Note: if linuxrc or any program exec'ed from it terminates for some
+reason, the old change_root mechanism is invoked (see section "Obsolete
+root change mechanism").
+
Usage scenarios
---------------
@@ -263,15 +264,15 @@ as follows:
1) system boots from floppy or other media with a minimal kernel
(e.g. support for RAM disks, initrd, a.out, and the Ext2 FS) and
loads initrd
- 2) /sbin/init determines what is needed to (1) mount the "real" root FS
+ 2) /linuxrc determines what is needed to (1) mount the "real" root FS
(i.e. device type, device drivers, file system) and (2) the
distribution media (e.g. CD-ROM, network, tape, ...). This can be
done by asking the user, by auto-probing, or by using a hybrid
approach.
- 3) /sbin/init loads the necessary kernel modules
- 4) /sbin/init creates and populates the root file system (this doesn't
+ 3) /linuxrc loads the necessary kernel modules
+ 4) /linuxrc creates and populates the root file system (this doesn't
have to be a very usable system yet)
- 5) /sbin/init invokes pivot_root to change the root file system and
+ 5) /linuxrc invokes pivot_root to change the root file system and
execs - via chroot - a program that continues the installation
6) the boot loader is installed
7) the boot loader is configured to load an initrd with the set of
@@ -290,7 +291,7 @@ different hardware configurations in a single administrative domain. In
such cases, it is desirable to generate only a small set of kernels
(ideally only one) and to keep the system-specific part of configuration
information as small as possible. In this case, a common initrd could be
-generated with all the necessary modules. Then, only /sbin/init or a file
+generated with all the necessary modules. Then, only /linuxrc or a file
read by it would have to be different.
A third scenario are more convenient recovery disks, because information
@@ -336,25 +337,6 @@ This old, deprecated mechanism is commonly called "change_root", while
the new, supported mechanism is called "pivot_root".
-Mixed change_root and pivot_root mechanism
-------------------------------------------
-
-In case you did not want to use root=/dev/ram0 to trig the pivot_root mechanism,
-you may create both /linuxrc and /sbin/init in your initrd image.
-
-/linuxrc would contain only the following:
-
-#! /bin/sh
-mount -n -t proc proc /proc
-echo 0x0100 >/proc/sys/kernel/real-root-dev
-umount -n /proc
-
-Once linuxrc exited, the kernel would mount again your initrd as root,
-this time executing /sbin/init. Again, it would be duty of this init
-to build the right environment (maybe using the root= device passed on
-the cmdline) before the final execution of the real /sbin/init.
-
-
Resources
---------
diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt
index ce91560229f5..09220a1e22d9 100644
--- a/trunk/Documentation/kernel-parameters.txt
+++ b/trunk/Documentation/kernel-parameters.txt
@@ -396,26 +396,6 @@ and is between 256 and 4096 characters. It is defined in the file
clocksource is not available, it defaults to PIT.
Format: { pit | tsc | cyclone | pmtmr }
- clocksource= [GENERIC_TIME] Override the default clocksource
- Format:
- Override the default clocksource and use the clocksource
- with the name specified.
- Some clocksource names to choose from, depending on
- the platform:
- [all] jiffies (this is the base, fallback clocksource)
- [ACPI] acpi_pm
- [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2,
- pxa_timer,timer3,32k_counter,timer0_1
- [AVR32] avr32
- [IA-32] pit,hpet,tsc,vmi-timer;
- scx200_hrt on Geode; cyclone on IBM x440
- [MIPS] MIPS
- [PARISC] cr16
- [S390] tod
- [SH] SuperH
- [SPARC64] tick
- [X86-64] hpet,tsc
-
code_bytes [IA32] How many bytes of object code to print in an
oops report.
Range: 0 - 8192
@@ -1132,9 +1112,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]
@@ -1613,37 +1593,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: [,[,...,]]
@@ -1858,6 +1807,10 @@ and is between 256 and 4096 characters. It is defined in the file
time Show timing data prefixed to each printk message line
+ clocksource= [GENERIC_TIME] Override the default clocksource
+ Override the default clocksource and use the clocksource
+ with the name specified.
+
tipar.timeout= [HW,PPT]
Set communications timeout in tenths of a second
(default 15).
diff --git a/trunk/Documentation/memory-barriers.txt b/trunk/Documentation/memory-barriers.txt
index 650657c54733..58408dd023c7 100644
--- a/trunk/Documentation/memory-barriers.txt
+++ b/trunk/Documentation/memory-barriers.txt
@@ -24,7 +24,7 @@ Contents:
(*) Explicit kernel barriers.
- Compiler barrier.
- - CPU memory barriers.
+ - The CPU memory barriers.
- MMIO write barrier.
(*) Implicit kernel memory barriers.
@@ -265,7 +265,7 @@ Memory barriers are such interventions. They impose a perceived partial
ordering over the memory operations on either side of the barrier.
Such enforcement is important because the CPUs and other devices in a system
-can use a variety of tricks to improve performance, including reordering,
+can use a variety of tricks to improve performance - including reordering,
deferral and combination of memory operations; speculative loads; speculative
branch prediction and various types of caching. Memory barriers are used to
override or suppress these tricks, allowing the code to sanely control the
@@ -457,7 +457,7 @@ sequence, Q must be either &A or &B, and that:
(Q == &A) implies (D == 1)
(Q == &B) implies (D == 4)
-But! CPU 2's perception of P may be updated _before_ its perception of B, thus
+But! CPU 2's perception of P may be updated _before_ its perception of B, thus
leading to the following situation:
(Q == &B) and (D == 2) ????
@@ -573,7 +573,7 @@ Basically, the read barrier always has to be there, even though it can be of
the "weaker" type.
[!] Note that the stores before the write barrier would normally be expected to
-match the loads after the read barrier or the data dependency barrier, and vice
+match the loads after the read barrier or data dependency barrier, and vice
versa:
CPU 1 CPU 2
@@ -588,7 +588,7 @@ versa:
EXAMPLES OF MEMORY BARRIER SEQUENCES
------------------------------------
-Firstly, write barriers act as partial orderings on store operations.
+Firstly, write barriers act as a partial orderings on store operations.
Consider the following sequence of events:
CPU 1
@@ -608,15 +608,15 @@ STORE B, STORE C } all occurring before the unordered set of { STORE D, STORE E
+-------+ : :
| | +------+
| |------>| C=3 | } /\
- | | : +------+ }----- \ -----> Events perceptible to
- | | : | A=1 | } \/ the rest of the system
+ | | : +------+ }----- \ -----> Events perceptible
+ | | : | A=1 | } \/ to rest of system
| | : +------+ }
| CPU 1 | : | B=2 | }
| | +------+ }
| | wwwwwwwwwwwwwwww } <--- At this point the write barrier
| | +------+ } requires all stores prior to the
| | : | E=5 | } barrier to be committed before
- | | : +------+ } further stores may take place
+ | | : +------+ } further stores may be take place.
| |------>| D=4 | }
| | +------+
+-------+ : :
@@ -626,7 +626,7 @@ STORE B, STORE C } all occurring before the unordered set of { STORE D, STORE E
V
-Secondly, data dependency barriers act as partial orderings on data-dependent
+Secondly, data dependency barriers act as a partial orderings on data-dependent
loads. Consider the following sequence of events:
CPU 1 CPU 2
@@ -975,7 +975,7 @@ compiler from moving the memory accesses either side of it to the other side:
barrier();
-This is a general barrier - lesser varieties of compiler barrier do not exist.
+This a general barrier - lesser varieties of compiler barrier do not exist.
The compiler barrier has no direct effect on the CPU, which may then reorder
things however it wishes.
@@ -997,7 +997,7 @@ The Linux kernel has eight basic CPU memory barriers:
All CPU memory barriers unconditionally imply compiler barriers.
SMP memory barriers are reduced to compiler barriers on uniprocessor compiled
-systems because it is assumed that a CPU will appear to be self-consistent,
+systems because it is assumed that a CPU will be appear to be self-consistent,
and will order overlapping accesses correctly with respect to itself.
[!] Note that SMP memory barriers _must_ be used to control the ordering of
@@ -1146,9 +1146,9 @@ for each construct. These operations all imply certain barriers:
Therefore, from (1), (2) and (4) an UNLOCK followed by an unconditional LOCK is
equivalent to a full barrier, but a LOCK followed by an UNLOCK is not.
-[!] Note: one of the consequences of LOCKs and UNLOCKs being only one-way
- barriers is that the effects of instructions outside of a critical section
- may seep into the inside of the critical section.
+[!] Note: one of the consequence of LOCKs and UNLOCKs being only one-way
+ barriers is that the effects instructions outside of a critical section may
+ seep into the inside of the critical section.
A LOCK followed by an UNLOCK may not be assumed to be full memory barrier
because it is possible for an access preceding the LOCK to happen after the
@@ -1239,7 +1239,7 @@ three CPUs; then should the following sequence of events occur:
UNLOCK M UNLOCK Q
*D = d; *H = h;
-Then there is no guarantee as to what order CPU 3 will see the accesses to *A
+Then there is no guarantee as to what order CPU #3 will see the accesses to *A
through *H occur in, other than the constraints imposed by the separate locks
on the separate CPUs. It might, for example, see:
@@ -1269,12 +1269,12 @@ However, if the following occurs:
UNLOCK M [2]
*H = h;
-CPU 3 might see:
+CPU #3 might see:
*E, LOCK M [1], *C, *B, *A, UNLOCK M [1],
LOCK M [2], *H, *F, *G, UNLOCK M [2], *D
-But assuming CPU 1 gets the lock first, CPU 3 won't see any of:
+But assuming CPU #1 gets the lock first, it won't see any of:
*B, *C, *D, *F, *G or *H preceding LOCK M [1]
*A, *B or *C following UNLOCK M [1]
@@ -1327,12 +1327,12 @@ spinlock, for example:
mmiowb();
spin_unlock(Q);
-this will ensure that the two stores issued on CPU 1 appear at the PCI bridge
-before either of the stores issued on CPU 2.
+this will ensure that the two stores issued on CPU #1 appear at the PCI bridge
+before either of the stores issued on CPU #2.
-Furthermore, following a store by a load from the same device obviates the need
-for the mmiowb(), because the load forces the store to complete before the load
+Furthermore, following a store by a load to the same device obviates the need
+for an mmiowb(), because the load forces the store to complete before the load
is performed:
CPU 1 CPU 2
@@ -1363,7 +1363,7 @@ circumstances in which reordering definitely _could_ be a problem:
(*) Atomic operations.
- (*) Accessing devices.
+ (*) Accessing devices (I/O).
(*) Interrupts.
@@ -1399,7 +1399,7 @@ To wake up a particular waiter, the up_read() or up_write() functions have to:
(1) read the next pointer from this waiter's record to know as to where the
next waiter record is;
- (2) read the pointer to the waiter's task structure;
+ (4) read the pointer to the waiter's task structure;
(3) clear the task pointer to tell the waiter it has been given the semaphore;
@@ -1407,7 +1407,7 @@ To wake up a particular waiter, the up_read() or up_write() functions have to:
(5) release the reference held on the waiter's task struct.
-In other words, it has to perform this sequence of events:
+In otherwords, it has to perform this sequence of events:
LOAD waiter->list.next;
LOAD waiter->task;
@@ -1502,7 +1502,7 @@ operations and adjusting reference counters towards object destruction, and as
such the implicit memory barrier effects are necessary.
-The following operations are potential problems as they do _not_ imply memory
+The following operation are potential problems as they do _not_ imply memory
barriers, but might be used for implementing such things as UNLOCK-class
operations:
@@ -1517,7 +1517,7 @@ With these the appropriate explicit memory barrier should be used if necessary
The following also do _not_ imply memory barriers, and so may require explicit
memory barriers under some circumstances (smp_mb__before_atomic_dec() for
-instance):
+instance)):
atomic_add();
atomic_sub();
@@ -1641,8 +1641,8 @@ functions:
indeed have special I/O space access cycles and instructions, but many
CPUs don't have such a concept.
- The PCI bus, amongst others, defines an I/O space concept which - on such
- CPUs as i386 and x86_64 - readily maps to the CPU's concept of I/O
+ The PCI bus, amongst others, defines an I/O space concept - which on such
+ CPUs as i386 and x86_64 cpus readily maps to the CPU's concept of I/O
space. However, it may also be mapped as a virtual I/O space in the CPU's
memory map, particularly on those CPUs that don't support alternate I/O
spaces.
@@ -1664,7 +1664,7 @@ functions:
i386 architecture machines, for example, this is controlled by way of the
MTRR registers.
- Ordinarily, these will be guaranteed to be fully ordered and uncombined,
+ Ordinarily, these will be guaranteed to be fully ordered and uncombined,,
provided they're not accessing a prefetchable device.
However, intermediary hardware (such as a PCI bridge) may indulge in
@@ -1689,7 +1689,7 @@ functions:
(*) ioreadX(), iowriteX()
- These will perform appropriately for the type of access they're actually
+ These will perform as appropriate for the type of access they're actually
doing, be it inX()/outX() or readX()/writeX().
@@ -1705,7 +1705,7 @@ of arch-specific code.
This means that it must be considered that the CPU will execute its instruction
stream in any order it feels like - or even in parallel - provided that if an
-instruction in the stream depends on an earlier instruction, then that
+instruction in the stream depends on the an earlier instruction, then that
earlier instruction must be sufficiently complete[*] before the later
instruction may proceed; in other words: provided that the appearance of
causality is maintained.
@@ -1795,8 +1795,8 @@ eventually become visible on all CPUs, there's no guarantee that they will
become apparent in the same order on those other CPUs.
-Consider dealing with a system that has a pair of CPUs (1 & 2), each of which
-has a pair of parallel data caches (CPU 1 has A/B, and CPU 2 has C/D):
+Consider dealing with a system that has pair of CPUs (1 & 2), each of which has
+a pair of parallel data caches (CPU 1 has A/B, and CPU 2 has C/D):
:
: +--------+
@@ -1835,7 +1835,7 @@ Imagine the system has the following properties:
(*) the coherency queue is not flushed by normal loads to lines already
present in the cache, even though the contents of the queue may
- potentially affect those loads.
+ potentially effect those loads.
Imagine, then, that two writes are made on the first CPU, with a write barrier
between them to guarantee that they will appear to reach that CPU's caches in
@@ -1845,7 +1845,7 @@ the requisite order:
=============== =============== =======================================
u == 0, v == 1 and p == &u, q == &u
v = 2;
- smp_wmb(); Make sure change to v is visible before
+ smp_wmb(); Make sure change to v visible before
change to p
v is now in cache A exclusively
p = &v;
@@ -1853,7 +1853,7 @@ the requisite order:
The write memory barrier forces the other CPUs in the system to perceive that
the local CPU's caches have apparently been updated in the correct order. But
-now imagine that the second CPU wants to read those values:
+now imagine that the second CPU that wants to read those values:
CPU 1 CPU 2 COMMENT
=============== =============== =======================================
@@ -1861,7 +1861,7 @@ now imagine that the second CPU wants to read those values:
q = p;
x = *q;
-The above pair of reads may then fail to happen in the expected order, as the
+The above pair of reads may then fail to happen in expected order, as the
cacheline holding p may get updated in one of the second CPU's caches whilst
the update to the cacheline holding v is delayed in the other of the second
CPU's caches by some other cache event:
@@ -1916,7 +1916,7 @@ access depends on a read, not all do, so it may not be relied on.
Other CPUs may also have split caches, but must coordinate between the various
cachelets for normal memory accesses. The semantics of the Alpha removes the
-need for coordination in the absence of memory barriers.
+need for coordination in absence of memory barriers.
CACHE COHERENCY VS DMA
@@ -1931,10 +1931,10 @@ invalidate them as well).
In addition, the data DMA'd to RAM by a device may be overwritten by dirty
cache lines being written back to RAM from a CPU's cache after the device has
-installed its own data, or cache lines present in the CPU's cache may simply
-obscure the fact that RAM has been updated, until at such time as the cacheline
-is discarded from the CPU's cache and reloaded. To deal with this, the
-appropriate part of the kernel must invalidate the overlapping bits of the
+installed its own data, or cache lines simply present in a CPUs cache may
+simply obscure the fact that RAM has been updated, until at such time as the
+cacheline is discarded from the CPU's cache and reloaded. To deal with this,
+the appropriate part of the kernel must invalidate the overlapping bits of the
cache on each CPU.
See Documentation/cachetlb.txt for more information on cache management.
@@ -1944,7 +1944,7 @@ CACHE COHERENCY VS MMIO
-----------------------
Memory mapped I/O usually takes place through memory locations that are part of
-a window in the CPU's memory space that has different properties assigned than
+a window in the CPU's memory space that have different properties assigned than
the usual RAM directed window.
Amongst these properties is usually the fact that such accesses bypass the
@@ -1960,7 +1960,7 @@ THE THINGS CPUS GET UP TO
=========================
A programmer might take it for granted that the CPU will perform memory
-operations in exactly the order specified, so that if the CPU is, for example,
+operations in exactly the order specified, so that if a CPU is, for example,
given the following piece of code to execute:
a = *A;
@@ -1969,7 +1969,7 @@ given the following piece of code to execute:
d = *D;
*E = e;
-they would then expect that the CPU will complete the memory operation for each
+They would then expect that the CPU will complete the memory operation for each
instruction before moving on to the next one, leading to a definite sequence of
operations as seen by external observers in the system:
@@ -1986,8 +1986,8 @@ assumption doesn't hold because:
(*) loads may be done speculatively, and the result discarded should it prove
to have been unnecessary;
- (*) loads may be done speculatively, leading to the result having been fetched
- at the wrong time in the expected sequence of events;
+ (*) loads may be done speculatively, leading to the result having being
+ fetched at the wrong time in the expected sequence of events;
(*) the order of the memory accesses may be rearranged to promote better use
of the CPU buses and caches;
@@ -2069,12 +2069,12 @@ AND THEN THERE'S THE ALPHA
The DEC Alpha CPU is one of the most relaxed CPUs there is. Not only that,
some versions of the Alpha CPU have a split data cache, permitting them to have
-two semantically-related cache lines updated at separate times. This is where
+two semantically related cache lines updating at separate times. This is where
the data dependency barrier really becomes necessary as this synchronises both
caches with the memory coherence system, thus making it seem like pointer
changes vs new data occur in the right order.
-The Alpha defines the Linux kernel's memory barrier model.
+The Alpha defines the Linux's kernel's memory barrier model.
See the subsection on "Cache Coherency" above.
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/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/spi/spi-summary b/trunk/Documentation/spi/spi-summary
index 76ea6c837be5..795fbb48ffa7 100644
--- a/trunk/Documentation/spi/spi-summary
+++ b/trunk/Documentation/spi/spi-summary
@@ -1,30 +1,26 @@
Overview of Linux kernel SPI support
====================================
-21-May-2007
+02-Dec-2005
What is SPI?
------------
The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial
link used to connect microcontrollers to sensors, memory, and peripherals.
-It's a simple "de facto" standard, not complicated enough to acquire a
-standardization body. SPI uses a master/slave configuration.
The three signal wires hold a clock (SCK, often on the order of 10 MHz),
and parallel data lines with "Master Out, Slave In" (MOSI) or "Master In,
Slave Out" (MISO) signals. (Other names are also used.) There are four
clocking modes through which data is exchanged; mode-0 and mode-3 are most
commonly used. Each clock cycle shifts data out and data in; the clock
-doesn't cycle except when there is a data bit to shift. Not all data bits
-are used though; not every protocol uses those full duplex capabilities.
+doesn't cycle except when there is data to shift.
-SPI masters use a fourth "chip select" line to activate a given SPI slave
+SPI masters may use a "chip select" line to activate a given SPI slave
device, so those three signal wires may be connected to several chips
-in parallel. All SPI slaves support chipselects; they are usually active
-low signals, labeled nCSx for slave 'x' (e.g. nCS0). Some devices have
+in parallel. All SPI slaves support chipselects. Some devices have
other signals, often including an interrupt to the master.
-Unlike serial busses like USB or SMBus, even low level protocols for
+Unlike serial busses like USB or SMBUS, even low level protocols for
SPI slave functions are usually not interoperable between vendors
(except for commodities like SPI memory chips).
@@ -37,11 +33,6 @@ SPI slave functions are usually not interoperable between vendors
- Some devices may use eight bit words. Others may different word
lengths, such as streams of 12-bit or 20-bit digital samples.
- - Words are usually sent with their most significant bit (MSB) first,
- but sometimes the least significant bit (LSB) goes first instead.
-
- - Sometimes SPI is used to daisy-chain devices, like shift registers.
-
In the same way, SPI slaves will only rarely support any kind of automatic
discovery/enumeration protocol. The tree of slave devices accessible from
a given SPI master will normally be set up manually, with configuration
@@ -53,14 +44,6 @@ half-duplex SPI, for request/response protocols), SSP ("Synchronous
Serial Protocol"), PSP ("Programmable Serial Protocol"), and other
related protocols.
-Some chips eliminate a signal line by combining MOSI and MISO, and
-limiting themselves to half-duplex at the hardware level. In fact
-some SPI chips have this signal mode as a strapping option. These
-can be accessed using the same programming interface as SPI, but of
-course they won't handle full duplex transfers. You may find such
-chips described as using "three wire" signaling: SCK, data, nCSx.
-(That data line is sometimes called MOMI or SISO.)
-
Microcontrollers often support both master and slave sides of the SPI
protocol. This document (and Linux) currently only supports the master
side of SPI interactions.
@@ -91,32 +74,6 @@ interfaces with SPI modes. Given SPI support, they could use MMC or SD
cards without needing a special purpose MMC/SD/SDIO controller.
-I'm confused. What are these four SPI "clock modes"?
------------------------------------------------------
-It's easy to be confused here, and the vendor documentation you'll
-find isn't necessarily helpful. The four modes combine two mode bits:
-
- - CPOL indicates the initial clock polarity. CPOL=0 means the
- clock starts low, so the first (leading) edge is rising, and
- the second (trailing) edge is falling. CPOL=1 means the clock
- starts high, so the first (leading) edge is falling.
-
- - CPHA indicates the clock phase used to sample data; CPHA=0 says
- sample on the leading edge, CPHA=1 means the trailing edge.
-
- Since the signal needs to stablize before it's sampled, CPHA=0
- implies that its data is written half a clock before the first
- clock edge. The chipselect may have made it become available.
-
-Chip specs won't always say "uses SPI mode X" in as many words,
-but their timing diagrams will make the CPOL and CPHA modes clear.
-
-In the SPI mode number, CPOL is the high order bit and CPHA is the
-low order bit. So when a chip's timing diagram shows the clock
-starting low (CPOL=0) and data stabilized for sampling during the
-trailing clock edge (CPHA=1), that's SPI mode 1.
-
-
How do these driver programming interfaces work?
------------------------------------------------
The header file includes kerneldoc, as does the
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/MAINTAINERS b/trunk/MAINTAINERS
index 4cc17b993b6a..22ab4019972b 100644
--- a/trunk/MAINTAINERS
+++ b/trunk/MAINTAINERS
@@ -332,9 +332,6 @@ L: linux-usb-devel@lists.sourceforge.net
W: http://www.linux-usb.org/SpeedTouch/
S: Maintained
-ALCHEMY AU1XX0 MMC DRIVER
-S: Orphan
-
ALI1563 I2C DRIVER
P: Rudolf Marek
M: r.marek@assembler.cz
@@ -421,12 +418,6 @@ P: Ian Molton
M: spyro@f2s.com
S: Maintained
-ARM PRIMECELL MMCI PL180/1 DRIVER
-P: Russell King
-M: rmk@arm.linux.org.uk
-L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
-S: Maintained
-
ARM/ADI ROADRUNNER MACHINE SUPPORT
P: Lennert Buytenhek
M: kernel@wantstofly.org
@@ -658,9 +649,6 @@ L: linux-atm-general@lists.sourceforge.net (subscribers-only)
W: http://linux-atm.sourceforge.net
S: Maintained
-ATMEL AT91 MCI DRIVER
-S: Orphan
-
ATMEL MACB ETHERNET DRIVER
P: Haavard Skinnemoen
M: hskinnemoen@atmel.com
@@ -2334,7 +2322,7 @@ S: Maintained
MEGARAID SCSI DRIVERS
P: Neela Syam Kolli
-M: megaraidlinux@lsi.com
+M: Neela.Kolli@engenio.com
S: linux-scsi@vger.kernel.org
W: http://megaraid.lsilogic.com
S: Maintained
@@ -2392,13 +2380,6 @@ M: stelian@popies.net
W: http://popies.net/meye/
S: Maintained
-MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER
-P: Pavel Pisa
-M: ppisa@pikron.com
-L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
-W: http://mmc.drzeus.cx/wiki/Controllers/Freescale/SDHC
-S: Maintained
-
MOUSE AND MISC DEVICES [GENERAL]
P: Alessandro Rubini
M: rubini@ipvvis.unipv.it
@@ -2919,9 +2900,6 @@ M: nico@cam.org
L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
S: Maintained
-PXA MMCI DRIVER
-S: Orphan
-
QLOGIC QLA2XXX FC-SCSI DRIVER
P: Andrew Vasquez
M: linux-driver@qlogic.com
@@ -3438,13 +3416,6 @@ P: Alex Dubov
M: oakad@yahoo.com
S: Maintained
-TI OMAP MMC INTERFACE DRIVER
-P: Carlos Aguiar, Anderson Briglia and Syed Khasim
-M: linux-omap-open-source@linux.omap.com
-W: http://linux.omap.com
-W: http://www.muru.com/linux/omap/
-S: Maintained
-
TI OMAP RANDOM NUMBER GENERATOR SUPPORT
P: Deepak Saxena
M: dsaxena@plexity.net
diff --git a/trunk/Makefile b/trunk/Makefile
index 562a90902cf6..34210af91ce2 100644
--- a/trunk/Makefile
+++ b/trunk/Makefile
@@ -1,8 +1,8 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 22
-EXTRAVERSION = -rc3
-NAME = Jeff Thinks I Should Change This, But To What?
+EXTRAVERSION = -rc2
+NAME = Nocturnal Monster Puppy
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
diff --git a/trunk/arch/alpha/kernel/entry.S b/trunk/arch/alpha/kernel/entry.S
index debc8f03886c..c95e95e1ab04 100644
--- a/trunk/arch/alpha/kernel/entry.S
+++ b/trunk/arch/alpha/kernel/entry.S
@@ -391,10 +391,11 @@ $work_resched:
bne $2, $work_resched
$work_notifysig:
- mov $sp, $16
- br $1, do_switch_stack
mov $sp, $17
- mov $5, $18
+ br $1, do_switch_stack
+ mov $5, $21
+ mov $sp, $18
+ mov $31, $16
jsr $26, do_notify_resume
bsr $1, undo_switch_stack
br restore_all
diff --git a/trunk/arch/alpha/kernel/pci_iommu.c b/trunk/arch/alpha/kernel/pci_iommu.c
index 28c84e55feb9..6e7d1fe6e935 100644
--- a/trunk/arch/alpha/kernel/pci_iommu.c
+++ b/trunk/arch/alpha/kernel/pci_iommu.c
@@ -7,7 +7,6 @@
#include
#include
#include
-#include
#include
#include
@@ -54,7 +53,7 @@ size_for_memory(unsigned long max)
{
unsigned long mem = max_low_pfn << PAGE_SHIFT;
if (mem < max)
- max = roundup_pow_of_two(mem);
+ max = 1UL << ceil_log2(mem);
return max;
}
diff --git a/trunk/arch/alpha/kernel/setup.c b/trunk/arch/alpha/kernel/setup.c
index bd5e68cd61e8..915f26345c45 100644
--- a/trunk/arch/alpha/kernel/setup.c
+++ b/trunk/arch/alpha/kernel/setup.c
@@ -43,7 +43,6 @@
#include
#include
#include
-#include
extern struct atomic_notifier_head panic_notifier_list;
static int alpha_panic_event(struct notifier_block *, unsigned long, void *);
@@ -1304,7 +1303,7 @@ external_cache_probe(int minsize, int width)
long size = minsize, maxsize = MAX_BCACHE_SIZE * 2;
if (maxsize > (max_low_pfn + 1) << PAGE_SHIFT)
- maxsize = 1 << (ilog2(max_low_pfn + 1) + PAGE_SHIFT);
+ maxsize = 1 << (floor_log2(max_low_pfn + 1) + PAGE_SHIFT);
/* Get the first block cached. */
read_mem_block(__va(0), stride, size);
diff --git a/trunk/arch/alpha/kernel/signal.c b/trunk/arch/alpha/kernel/signal.c
index 410af4f3140e..7f64aa767d5a 100644
--- a/trunk/arch/alpha/kernel/signal.c
+++ b/trunk/arch/alpha/kernel/signal.c
@@ -32,8 +32,8 @@
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
asmlinkage void ret_from_sys_call(void);
-static void do_signal(struct pt_regs *, struct switch_stack *,
- unsigned long, unsigned long);
+static int do_signal(sigset_t *, struct pt_regs *, struct switch_stack *,
+ unsigned long, unsigned long);
/*
@@ -146,9 +146,11 @@ sys_rt_sigaction(int sig, const struct sigaction __user *act,
asmlinkage int
do_sigsuspend(old_sigset_t mask, struct pt_regs *regs, struct switch_stack *sw)
{
+ sigset_t oldset;
+
mask &= _BLOCKABLE;
spin_lock_irq(¤t->sighand->siglock);
- current->saved_sigmask = current->blocked;
+ oldset = current->blocked;
siginitset(¤t->blocked, mask);
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
@@ -158,17 +160,19 @@ do_sigsuspend(old_sigset_t mask, struct pt_regs *regs, struct switch_stack *sw)
regs->r0 = EINTR;
regs->r19 = 1;
- current->state = TASK_INTERRUPTIBLE;
- schedule();
- set_thread_flag(TIF_RESTORE_SIGMASK);
- return -ERESTARTNOHAND;
+ while (1) {
+ current->state = TASK_INTERRUPTIBLE;
+ schedule();
+ if (do_signal(&oldset, regs, sw, 0, 0))
+ return -EINTR;
+ }
}
asmlinkage int
do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize,
struct pt_regs *regs, struct switch_stack *sw)
{
- sigset_t set;
+ sigset_t oldset, set;
/* XXX: Don't preclude handling different sized sigset_t's. */
if (sigsetsize != sizeof(sigset_t))
@@ -178,7 +182,7 @@ do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize,
sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(¤t->sighand->siglock);
- current->saved_sigmask = current->blocked;
+ oldset = current->blocked;
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
@@ -188,10 +192,12 @@ do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize,
regs->r0 = EINTR;
regs->r19 = 1;
- current->state = TASK_INTERRUPTIBLE;
- schedule();
- set_thread_flag(TIF_RESTORE_SIGMASK);
- return -ERESTARTNOHAND;
+ while (1) {
+ current->state = TASK_INTERRUPTIBLE;
+ schedule();
+ if (do_signal(&oldset, regs, sw, 0, 0))
+ return -EINTR;
+ }
}
asmlinkage int
@@ -430,7 +436,7 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
return err;
}
-static int
+static void
setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
struct pt_regs *regs, struct switch_stack * sw)
{
@@ -475,14 +481,13 @@ setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
current->comm, current->pid, frame, regs->pc, regs->r26);
#endif
- return 0;
+ return;
give_sigsegv:
force_sigsegv(sig, current);
- return -EFAULT;
}
-static int
+static void
setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs, struct switch_stack * sw)
{
@@ -538,38 +543,34 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
current->comm, current->pid, frame, regs->pc, regs->r26);
#endif
- return 0;
+ return;
give_sigsegv:
force_sigsegv(sig, current);
- return -EFAULT;
}
/*
* OK, we're invoking a handler.
*/
-static inline int
+static inline void
handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *oldset, struct pt_regs * regs, struct switch_stack *sw)
{
- int ret;
-
if (ka->sa.sa_flags & SA_SIGINFO)
- ret = setup_rt_frame(sig, ka, info, oldset, regs, sw);
+ setup_rt_frame(sig, ka, info, oldset, regs, sw);
else
- ret = setup_frame(sig, ka, oldset, regs, sw);
+ setup_frame(sig, ka, oldset, regs, sw);
- if (ret == 0) {
- spin_lock_irq(¤t->sighand->siglock);
- sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask);
- if (!(ka->sa.sa_flags & SA_NODEFER))
- sigaddset(¤t->blocked,sig);
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
- }
+ if (ka->sa.sa_flags & SA_RESETHAND)
+ ka->sa.sa_handler = SIG_DFL;
- return ret;
+ spin_lock_irq(¤t->sighand->siglock);
+ sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask);
+ if (!(ka->sa.sa_flags & SA_NODEFER))
+ sigaddset(¤t->blocked,sig);
+ recalc_sigpending();
+ spin_unlock_irq(¤t->sighand->siglock);
}
static inline void
@@ -610,42 +611,30 @@ syscall_restart(unsigned long r0, unsigned long r19,
* restart. "r0" is also used as an indicator whether we can restart at
* all (if we get here from anything but a syscall return, it will be 0)
*/
-static void
-do_signal(struct pt_regs * regs, struct switch_stack * sw,
+static int
+do_signal(sigset_t *oldset, struct pt_regs * regs, struct switch_stack * sw,
unsigned long r0, unsigned long r19)
{
siginfo_t info;
int signr;
unsigned long single_stepping = ptrace_cancel_bpt(current);
struct k_sigaction ka;
- sigset_t *oldset;
- if (test_thread_flag(TIF_RESTORE_SIGMASK))
- oldset = ¤t->saved_sigmask;
- else
+ if (!oldset)
oldset = ¤t->blocked;
/* This lets the debugger run, ... */
signr = get_signal_to_deliver(&info, &ka, regs, NULL);
-
/* ... so re-check the single stepping. */
single_stepping |= ptrace_cancel_bpt(current);
if (signr > 0) {
/* Whee! Actually deliver the signal. */
- if (r0)
- syscall_restart(r0, r19, regs, &ka);
- if (handle_signal(signr, &ka, &info, oldset, regs, sw) == 0) {
- /* A signal was successfully delivered, and the
- saved sigmask was stored on the signal frame,
- and will be restored by sigreturn. So we can
- simply clear the restore sigmask flag. */
- if (test_thread_flag(TIF_RESTORE_SIGMASK))
- clear_thread_flag(TIF_RESTORE_SIGMASK);
- }
+ if (r0) syscall_restart(r0, r19, regs, &ka);
+ handle_signal(signr, &ka, &info, oldset, regs, sw);
if (single_stepping)
ptrace_set_bpt(current); /* re-set bpt */
- return;
+ return 1;
}
if (r0) {
@@ -665,22 +654,17 @@ do_signal(struct pt_regs * regs, struct switch_stack * sw,
break;
}
}
-
- /* If there's no signal to deliver, we just restore the saved mask. */
- if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
- clear_thread_flag(TIF_RESTORE_SIGMASK);
- sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL);
- }
-
if (single_stepping)
ptrace_set_bpt(current); /* re-set breakpoint */
+
+ return 0;
}
void
-do_notify_resume(struct pt_regs *regs, struct switch_stack *sw,
- unsigned long thread_info_flags,
- unsigned long r0, unsigned long r19)
+do_notify_resume(sigset_t *oldset, struct pt_regs *regs,
+ struct switch_stack *sw, unsigned long r0,
+ unsigned long r19, unsigned long thread_info_flags)
{
- if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK))
- do_signal(regs, sw, r0, r19);
+ if (thread_info_flags & _TIF_SIGPENDING)
+ do_signal(oldset, regs, sw, r0, r19);
}
diff --git a/trunk/arch/alpha/kernel/systbls.S b/trunk/arch/alpha/kernel/systbls.S
index 79de99e32c35..f6cfe8ce3f96 100644
--- a/trunk/arch/alpha/kernel/systbls.S
+++ b/trunk/arch/alpha/kernel/systbls.S
@@ -465,38 +465,6 @@ sys_call_table:
.quad sys_inotify_init
.quad sys_inotify_add_watch /* 445 */
.quad sys_inotify_rm_watch
- .quad sys_fdatasync
- .quad sys_kexec_load
- .quad sys_migrate_pages
- .quad sys_openat /* 450 */
- .quad sys_mkdirat
- .quad sys_mknodat
- .quad sys_fchownat
- .quad sys_futimesat
- .quad sys_fstatat64 /* 455 */
- .quad sys_unlinkat
- .quad sys_renameat
- .quad sys_linkat
- .quad sys_symlinkat
- .quad sys_readlinkat /* 460 */
- .quad sys_fchmodat
- .quad sys_faccessat
- .quad sys_pselect6
- .quad sys_ppoll
- .quad sys_unshare /* 465 */
- .quad sys_set_robust_list
- .quad sys_get_robust_list
- .quad sys_splice
- .quad sys_sync_file_range
- .quad sys_tee /* 470 */
- .quad sys_vmsplice
- .quad sys_move_pages
- .quad sys_getcpu
- .quad sys_epoll_pwait
- .quad sys_utimensat /* 475 */
- .quad sys_signalfd
- .quad sys_timerfd
- .quad sys_eventfd
.size sys_call_table, . - sys_call_table
.type sys_call_table, @object
diff --git a/trunk/arch/alpha/lib/Makefile b/trunk/arch/alpha/lib/Makefile
index 266f78e13076..ea098f3b629f 100644
--- a/trunk/arch/alpha/lib/Makefile
+++ b/trunk/arch/alpha/lib/Makefile
@@ -37,8 +37,7 @@ lib-y = __divqu.o __remqu.o __divlu.o __remlu.o \
$(ev6-y)clear_page.o \
$(ev6-y)copy_page.o \
fpreg.o \
- callback_srm.o srm_puts.o srm_printk.o \
- fls.o
+ callback_srm.o srm_puts.o srm_printk.o
lib-$(CONFIG_SMP) += dec_and_lock.o
diff --git a/trunk/arch/alpha/lib/fls.c b/trunk/arch/alpha/lib/fls.c
deleted file mode 100644
index 7ad84ea0acf8..000000000000
--- a/trunk/arch/alpha/lib/fls.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * arch/alpha/lib/fls.c
- */
-
-#include
-#include
-
-/* This is fls(x)-1, except zero is held to zero. This allows most
- efficent input into extbl, plus it allows easy handling of fls(0)=0. */
-
-const unsigned char __flsm1_tab[256] =
-{
- 0,
- 0,
- 1, 1,
- 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-};
-
-EXPORT_SYMBOL(__flsm1_tab);
diff --git a/trunk/arch/arm/kernel/armksyms.c b/trunk/arch/arm/kernel/armksyms.c
index f73d62e8ab60..9179e8220314 100644
--- a/trunk/arch/arm/kernel/armksyms.c
+++ b/trunk/arch/arm/kernel/armksyms.c
@@ -57,7 +57,7 @@ extern void fp_enter(void);
#define EXPORT_SYMBOL_ALIAS(sym,orig) \
EXPORT_CRC_ALIAS(sym) \
static const struct kernel_symbol __ksymtab_##sym \
- __used __attribute__((section("__ksymtab"))) = \
+ __attribute_used__ __attribute__((section("__ksymtab"))) = \
{ (unsigned long)&orig, #sym };
/*
diff --git a/trunk/arch/arm/kernel/stacktrace.c b/trunk/arch/arm/kernel/stacktrace.c
index ae31deb2d065..8b63ad89d0a8 100644
--- a/trunk/arch/arm/kernel/stacktrace.c
+++ b/trunk/arch/arm/kernel/stacktrace.c
@@ -13,7 +13,7 @@ int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high,
/*
* Check current frame pointer is within bounds
*/
- if (fp < (low + 12) || fp + 4 >= high)
+ if ((fp - 12) < low || fp + 4 >= high)
break;
frame = (struct stackframe *)(fp - 12);
diff --git a/trunk/arch/arm/mach-at91/board-dk.c b/trunk/arch/arm/mach-at91/board-dk.c
index af497896a96c..6043c38c0a9e 100644
--- a/trunk/arch/arm/mach-at91/board-dk.c
+++ b/trunk/arch/arm/mach-at91/board-dk.c
@@ -132,7 +132,7 @@ static struct mtd_partition __initdata dk_nand_partition[] = {
},
};
-static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
{
*num_partitions = ARRAY_SIZE(dk_nand_partition);
return dk_nand_partition;
diff --git a/trunk/arch/arm/mach-at91/board-kb9202.c b/trunk/arch/arm/mach-at91/board-kb9202.c
index 7d9b1a278fd6..76f6e1e553ea 100644
--- a/trunk/arch/arm/mach-at91/board-kb9202.c
+++ b/trunk/arch/arm/mach-at91/board-kb9202.c
@@ -96,7 +96,7 @@ static struct mtd_partition __initdata kb9202_nand_partition[] = {
},
};
-static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
{
*num_partitions = ARRAY_SIZE(kb9202_nand_partition);
return kb9202_nand_partition;
diff --git a/trunk/arch/arm/mach-at91/board-sam9261ek.c b/trunk/arch/arm/mach-at91/board-sam9261ek.c
index 26ca8ab3f62a..1f0c8a400b3a 100644
--- a/trunk/arch/arm/mach-at91/board-sam9261ek.c
+++ b/trunk/arch/arm/mach-at91/board-sam9261ek.c
@@ -178,7 +178,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
},
};
-static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
{
*num_partitions = ARRAY_SIZE(ek_nand_partition);
return ek_nand_partition;
diff --git a/trunk/arch/arm/mach-at91/board-sam9263ek.c b/trunk/arch/arm/mach-at91/board-sam9263ek.c
index c164c8e58ae6..f57458559fb6 100644
--- a/trunk/arch/arm/mach-at91/board-sam9263ek.c
+++ b/trunk/arch/arm/mach-at91/board-sam9263ek.c
@@ -180,7 +180,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
},
};
-static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
{
*num_partitions = ARRAY_SIZE(ek_nand_partition);
return ek_nand_partition;
diff --git a/trunk/arch/arm/mach-at91/board-sam9rlek.c b/trunk/arch/arm/mach-at91/board-sam9rlek.c
index 9b61320f295a..30c79aca84d4 100644
--- a/trunk/arch/arm/mach-at91/board-sam9rlek.c
+++ b/trunk/arch/arm/mach-at91/board-sam9rlek.c
@@ -87,7 +87,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
},
};
-static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
{
*num_partitions = ARRAY_SIZE(ek_nand_partition);
return ek_nand_partition;
diff --git a/trunk/arch/arm/mach-footbridge/cats-pci.c b/trunk/arch/arm/mach-footbridge/cats-pci.c
index 35eb232a649a..4f984fde7375 100644
--- a/trunk/arch/arm/mach-footbridge/cats-pci.c
+++ b/trunk/arch/arm/mach-footbridge/cats-pci.c
@@ -45,7 +45,7 @@ static struct hw_pci cats_pci __initdata = {
.postinit = dc21285_postinit,
};
-static int __init cats_pci_init(void)
+static int cats_pci_init(void)
{
if (machine_is_cats())
pci_common_init(&cats_pci);
diff --git a/trunk/arch/arm/mach-imx/generic.c b/trunk/arch/arm/mach-imx/generic.c
index 1c474cf709ca..7a7fa51ec62c 100644
--- a/trunk/arch/arm/mach-imx/generic.c
+++ b/trunk/arch/arm/mach-imx/generic.c
@@ -201,6 +201,7 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
{
imx_mmc_device.dev.platform_data = info;
}
+EXPORT_SYMBOL(imx_set_mmc_info);
static struct imxfb_mach_info imx_fb_info;
diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2400.c b/trunk/arch/arm/mach-ixp2000/ixdp2400.c
index ce7c15c73004..0fdd03ab36e6 100644
--- a/trunk/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/trunk/arch/arm/mach-ixp2000/ixdp2400.c
@@ -164,7 +164,7 @@ int __init ixdp2400_pci_init(void)
subsys_initcall(ixdp2400_pci_init);
-void __init ixdp2400_init_irq(void)
+void ixdp2400_init_irq(void)
{
ixdp2x00_init_irq(IXDP2400_CPLD_INT_STAT, IXDP2400_CPLD_INT_MASK, IXDP2400_NR_IRQS);
}
diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2800.c b/trunk/arch/arm/mach-ixp2000/ixdp2800.c
index 14f09b80ab77..70d247f09a7e 100644
--- a/trunk/arch/arm/mach-ixp2000/ixdp2800.c
+++ b/trunk/arch/arm/mach-ixp2000/ixdp2800.c
@@ -279,7 +279,7 @@ int __init ixdp2800_pci_init(void)
subsys_initcall(ixdp2800_pci_init);
-void __init ixdp2800_init_irq(void)
+void ixdp2800_init_irq(void)
{
ixdp2x00_init_irq(IXDP2800_CPLD_INT_STAT, IXDP2800_CPLD_INT_MASK, IXDP2800_NR_IRQS);
}
diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2x00.c b/trunk/arch/arm/mach-ixp2000/ixdp2x00.c
index 73c651e83d92..011065b967b4 100644
--- a/trunk/arch/arm/mach-ixp2000/ixdp2x00.c
+++ b/trunk/arch/arm/mach-ixp2000/ixdp2x00.c
@@ -145,7 +145,7 @@ static struct irq_chip ixdp2x00_cpld_irq_chip = {
.unmask = ixdp2x00_irq_unmask
};
-void __init ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long *mask_reg, unsigned long nr_irqs)
+void ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long *mask_reg, unsigned long nr_irqs)
{
unsigned int irq;
diff --git a/trunk/arch/arm/mach-ixp23xx/ixdp2351.c b/trunk/arch/arm/mach-ixp23xx/ixdp2351.c
index c41a6b5a0acc..7a86a2516eaa 100644
--- a/trunk/arch/arm/mach-ixp23xx/ixdp2351.c
+++ b/trunk/arch/arm/mach-ixp23xx/ixdp2351.c
@@ -124,7 +124,7 @@ static struct irq_chip ixdp2351_intb_chip = {
.unmask = ixdp2351_intb_unmask
};
-void __init ixdp2351_init_irq(void)
+void ixdp2351_init_irq(void)
{
int irq;
diff --git a/trunk/arch/arm/mach-ixp23xx/pci.c b/trunk/arch/arm/mach-ixp23xx/pci.c
index 227f808dc0ec..ac7d43d23c28 100644
--- a/trunk/arch/arm/mach-ixp23xx/pci.c
+++ b/trunk/arch/arm/mach-ixp23xx/pci.c
@@ -284,7 +284,7 @@ int ixp23xx_pci_setup(int nr, struct pci_sys_data *sys)
return 1;
}
-void __init ixp23xx_pci_slave_init(void)
+void ixp23xx_pci_slave_init(void)
{
ixp23xx_pci_common_init();
}
diff --git a/trunk/arch/arm/mach-ixp23xx/roadrunner.c b/trunk/arch/arm/mach-ixp23xx/roadrunner.c
index e35644961aa4..d06e21b70de5 100644
--- a/trunk/arch/arm/mach-ixp23xx/roadrunner.c
+++ b/trunk/arch/arm/mach-ixp23xx/roadrunner.c
@@ -110,7 +110,7 @@ static int __init roadrunner_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
return NO_IRQ;
}
-static void __init roadrunner_pci_preinit(void)
+static void roadrunner_pci_preinit(void)
{
set_irq_type(IRQ_ROADRUNNER_PCI_INTC, IRQT_LOW);
set_irq_type(IRQ_ROADRUNNER_PCI_INTD, IRQT_LOW);
diff --git a/trunk/arch/arm/mach-ixp4xx/Kconfig b/trunk/arch/arm/mach-ixp4xx/Kconfig
index 060909870b50..9715ef506c24 100644
--- a/trunk/arch/arm/mach-ixp4xx/Kconfig
+++ b/trunk/arch/arm/mach-ixp4xx/Kconfig
@@ -104,6 +104,9 @@ config MACH_DSMG600
DSM-G600 RevA device. For more information on this platform,
see http://www.nslu2-linux.org/wiki/DSMG600/HomePage
+#
+# Avila and IXDP share the same source for now. Will change in future
+#
config ARCH_IXDP4XX
bool
depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
diff --git a/trunk/arch/arm/mach-ixp4xx/common.c b/trunk/arch/arm/mach-ixp4xx/common.c
index 8112f726ffa0..64685da1462d 100644
--- a/trunk/arch/arm/mach-ixp4xx/common.c
+++ b/trunk/arch/arm/mach-ixp4xx/common.c
@@ -283,7 +283,7 @@ static struct irqaction ixp4xx_timer_irq = {
.handler = ixp4xx_timer_interrupt,
};
-void __init ixp4xx_timer_init(void)
+static void __init ixp4xx_timer_init(void)
{
/* Reset/disable counter */
*IXP4XX_OSRT1 = 0;
diff --git a/trunk/arch/arm/mach-ixp4xx/coyote-pci.c b/trunk/arch/arm/mach-ixp4xx/coyote-pci.c
index ad2e5b97966e..7bc94f3def1c 100644
--- a/trunk/arch/arm/mach-ixp4xx/coyote-pci.c
+++ b/trunk/arch/arm/mach-ixp4xx/coyote-pci.c
@@ -25,6 +25,10 @@
#include
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
void __init coyote_pci_preinit(void)
{
set_irq_type(IRQ_COYOTE_PCI_SLOT0, IRQT_LOW);
diff --git a/trunk/arch/arm/mach-ixp4xx/dsmg600-setup.c b/trunk/arch/arm/mach-ixp4xx/dsmg600-setup.c
index 1e75e105c4f7..1caff65e22cc 100644
--- a/trunk/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/trunk/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -18,7 +18,6 @@
#include
#include
#include
-#include
static struct flash_platform_data dsmg600_flash_data = {
.map_name = "cfi_probe",
@@ -129,19 +128,6 @@ static void dsmg600_power_off(void)
gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
}
-static void __init dsmg600_timer_init(void)
-{
- /* The xtal on this machine is non-standard. */
- ixp4xx_timer_freq = DSMG600_FREQ;
-
- /* Call standard timer_init function. */
- ixp4xx_timer_init();
-}
-
-static struct sys_timer dsmg600_timer = {
- .init = dsmg600_timer_init,
-};
-
static void __init dsmg600_init(void)
{
ixp4xx_sys_init();
@@ -169,13 +155,21 @@ static void __init dsmg600_init(void)
#endif
}
+static void __init dsmg600_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ /* The xtal on this machine is non-standard. */
+ ixp4xx_timer_freq = DSMG600_FREQ;
+}
+
MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
/* Maintainer: www.nslu2-linux.org */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
+ .fixup = dsmg600_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
- .timer = &dsmg600_timer,
+ .timer = &ixp4xx_timer,
.init_machine = dsmg600_init,
MACHINE_END
diff --git a/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c b/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c
index d1e75b7dc3b1..509a95a692a4 100644
--- a/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c
+++ b/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c
@@ -23,6 +23,10 @@
#include
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
void __init ixdpg425_pci_preinit(void)
{
set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
diff --git a/trunk/arch/arm/mach-ixp4xx/nas100d-setup.c b/trunk/arch/arm/mach-ixp4xx/nas100d-setup.c
index 78a17413ceca..9a31444d9214 100644
--- a/trunk/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/trunk/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -155,8 +155,7 @@ static void __init nas100d_init(void)
pm_power_off = nas100d_power_off;
- /*
- * This is only useful on a modified machine, but it is valuable
+ /* This is only useful on a modified machine, but it is valuable
* to have it first in order to see debug messages, and so that
* it does *not* get removed if platform_add_devices fails!
*/
diff --git a/trunk/arch/arm/mach-ixp4xx/nslu2-setup.c b/trunk/arch/arm/mach-ixp4xx/nslu2-setup.c
index 9bf8ccbcaccf..162c266e5f8f 100644
--- a/trunk/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/trunk/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -22,7 +22,6 @@
#include
#include
#include
-#include
static struct flash_platform_data nslu2_flash_data = {
.map_name = "cfi_probe",
@@ -50,26 +49,26 @@ static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
static struct resource nslu2_led_resources[] = {
{
.name = "ready", /* green led */
- .start = NSLU2_LED_GRN_GPIO,
- .end = NSLU2_LED_GRN_GPIO,
+ .start = NSLU2_LED_GRN,
+ .end = NSLU2_LED_GRN,
.flags = IXP4XX_GPIO_HIGH,
},
{
.name = "status", /* red led */
- .start = NSLU2_LED_RED_GPIO,
- .end = NSLU2_LED_RED_GPIO,
+ .start = NSLU2_LED_RED,
+ .end = NSLU2_LED_RED,
.flags = IXP4XX_GPIO_HIGH,
},
{
.name = "disk-1",
- .start = NSLU2_LED_DISK1_GPIO,
- .end = NSLU2_LED_DISK1_GPIO,
+ .start = NSLU2_LED_DISK1,
+ .end = NSLU2_LED_DISK1,
.flags = IXP4XX_GPIO_LOW,
},
{
.name = "disk-2",
- .start = NSLU2_LED_DISK2_GPIO,
- .end = NSLU2_LED_DISK2_GPIO,
+ .start = NSLU2_LED_DISK2,
+ .end = NSLU2_LED_DISK2,
.flags = IXP4XX_GPIO_LOW,
},
};
@@ -158,21 +157,10 @@ static void nslu2_power_off(void)
gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH);
}
-static void __init nslu2_timer_init(void)
-{
- /* The xtal on this machine is non-standard. */
- ixp4xx_timer_freq = NSLU2_FREQ;
-
- /* Call standard timer_init function. */
- ixp4xx_timer_init();
-}
-
-static struct sys_timer nslu2_timer = {
- .init = nslu2_timer_init,
-};
-
static void __init nslu2_init(void)
{
+ ixp4xx_timer_freq = NSLU2_FREQ;
+
ixp4xx_sys_init();
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
@@ -181,8 +169,7 @@ static void __init nslu2_init(void)
pm_power_off = nslu2_power_off;
- /*
- * This is only useful on a modified machine, but it is valuable
+ /* This is only useful on a modified machine, but it is valuable
* to have it first in order to see debug messages, and so that
* it does *not* get removed if platform_add_devices fails!
*/
@@ -198,6 +185,6 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
.boot_params = 0x00000100,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
- .timer = &nslu2_timer,
+ .timer = &ixp4xx_timer,
.init_machine = nslu2_init,
MACHINE_END
diff --git a/trunk/arch/arm/mach-s3c2410/bast.h b/trunk/arch/arm/mach-s3c2410/bast.h
new file mode 100644
index 000000000000..e98543742eb9
--- /dev/null
+++ b/trunk/arch/arm/mach-s3c2410/bast.h
@@ -0,0 +1,2 @@
+/* linux/arch/arm/mach-s3c2410/bast.h
+extern void bast_init_irq(void);
diff --git a/trunk/arch/arm/mach-s3c2410/mach-amlm5900.c b/trunk/arch/arm/mach-s3c2410/mach-amlm5900.c
index 435adcce6482..bc308ceb91c3 100644
--- a/trunk/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/trunk/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -160,7 +160,7 @@ static struct platform_device *amlm5900_devices[] __initdata = {
#endif
};
-static void __init amlm5900_map_io(void)
+void __init amlm5900_map_io(void)
{
s3c24xx_init_io(amlm5900_iodesc, ARRAY_SIZE(amlm5900_iodesc));
s3c24xx_init_clocks(0);
diff --git a/trunk/arch/arm/mach-s3c2412/s3c2412.c b/trunk/arch/arm/mach-s3c2412/s3c2412.c
index 782b5814ced2..c602aa39f9c4 100644
--- a/trunk/arch/arm/mach-s3c2412/s3c2412.c
+++ b/trunk/arch/arm/mach-s3c2412/s3c2412.c
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -30,7 +29,6 @@
#include
#include
-#include
#include
#include
@@ -40,7 +38,6 @@
#include
#include
#include
-#include
#include
#include
@@ -109,23 +106,6 @@ static void s3c2412_idle(void)
cpu_do_idle();
}
-static void s3c2412_hard_reset(void)
-{
- /* errata "Watch-dog/Software Reset Problem" specifies that
- * this reset must be done with the SYSCLK sourced from
- * EXTCLK instead of FOUT to avoid a glitch in the reset
- * mechanism.
- *
- * See the watchdog section of the S3C2412 manual for more
- * information on this fix.
- */
-
- __raw_writel(0x00, S3C2412_CLKSRC);
- __raw_writel(S3C2412_SWRST_RESET, S3C2412_SWRST);
-
- mdelay(1);
-}
-
/* s3c2412_map_io
*
* register the standard cpu IO areas, and any passed in from the
@@ -142,10 +122,6 @@ void __init s3c2412_map_io(struct map_desc *mach_desc, int mach_size)
s3c24xx_idle = s3c2412_idle;
- /* set custom reset hook */
-
- s3c24xx_reset_hook = s3c2412_hard_reset;
-
/* register our io-tables */
iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));
diff --git a/trunk/arch/arm/mach-s3c2443/clock.c b/trunk/arch/arm/mach-s3c2443/clock.c
index 58402948c47c..5955efb5de8d 100644
--- a/trunk/arch/arm/mach-s3c2443/clock.c
+++ b/trunk/arch/arm/mach-s3c2443/clock.c
@@ -394,7 +394,7 @@ static int s3c2443_setrate_usbhost(struct clk *clk, unsigned long rate)
return 0;
}
-static struct clk clk_usb_bus_host = {
+struct clk clk_usb_bus_host = {
.name = "usb-bus-host-parent",
.id = -1,
.parent = &clk_esysclk,
@@ -758,6 +758,7 @@ static struct clk init_clocks[] = {
.parent = &clk_h,
.enable = s3c2443_clkcon_enable_h,
.ctrlbit = S3C2443_HCLKCON_CFC,
+ .ctrlbit = S3C2443_HCLKCON_HSMMC,
}, {
.name = "ssmc",
.id = -1,
diff --git a/trunk/arch/arm/mach-sa1100/neponset.c b/trunk/arch/arm/mach-sa1100/neponset.c
index 4cbf9468f654..d7c038a0256b 100644
--- a/trunk/arch/arm/mach-sa1100/neponset.c
+++ b/trunk/arch/arm/mach-sa1100/neponset.c
@@ -139,12 +139,12 @@ static u_int neponset_get_mctrl(struct uart_port *port)
return ret;
}
-static struct sa1100_port_fns neponset_port_fns __devinitdata = {
+static struct sa1100_port_fns neponset_port_fns __initdata = {
.set_mctrl = neponset_set_mctrl,
.get_mctrl = neponset_get_mctrl,
};
-static int __devinit neponset_probe(struct platform_device *dev)
+static int neponset_probe(struct platform_device *dev)
{
sa1100_register_uart_fns(&neponset_port_fns);
diff --git a/trunk/arch/arm/mm/Kconfig b/trunk/arch/arm/mm/Kconfig
index e7904bc92c73..5f472a8b406a 100644
--- a/trunk/arch/arm/mm/Kconfig
+++ b/trunk/arch/arm/mm/Kconfig
@@ -379,7 +379,7 @@ config CPU_V7
select CPU_CP15_MMU
select CPU_HAS_ASID
select CPU_COPY_V6 if MMU
- select CPU_TLB_V7 if MMU
+ select CPU_TLB_V6 if MMU
# Figure out what processor architecture version we should be using.
# This defines the compiler instruction set which depends on the machine type.
@@ -498,9 +498,6 @@ config CPU_TLB_V4WBI
config CPU_TLB_V6
bool
-config CPU_TLB_V7
- bool
-
endif
config CPU_HAS_ASID
diff --git a/trunk/arch/arm/mm/Makefile b/trunk/arch/arm/mm/Makefile
index 762702765fc3..b5bd335ff14a 100644
--- a/trunk/arch/arm/mm/Makefile
+++ b/trunk/arch/arm/mm/Makefile
@@ -46,7 +46,6 @@ obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o
obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o
obj-$(CONFIG_CPU_TLB_V4WBI) += tlb-v4wbi.o
obj-$(CONFIG_CPU_TLB_V6) += tlb-v6.o
-obj-$(CONFIG_CPU_TLB_V7) += tlb-v7.o
obj-$(CONFIG_CPU_ARM610) += proc-arm6_7.o
obj-$(CONFIG_CPU_ARM710) += proc-arm6_7.o
diff --git a/trunk/arch/arm/mm/proc-v7.S b/trunk/arch/arm/mm/proc-v7.S
index 718f4782ee8b..dd823dd4a374 100644
--- a/trunk/arch/arm/mm/proc-v7.S
+++ b/trunk/arch/arm/mm/proc-v7.S
@@ -256,7 +256,7 @@ __v7_proc_info:
.long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
.long cpu_v7_name
.long v7_processor_functions
- .long v7wbi_tlb_fns
+ .long v6wbi_tlb_fns
.long v6_user_fns
.long v7_cache_fns
.size __v7_proc_info, . - __v7_proc_info
diff --git a/trunk/arch/arm/mm/tlb-v7.S b/trunk/arch/arm/mm/tlb-v7.S
deleted file mode 100644
index b56dda8052f7..000000000000
--- a/trunk/arch/arm/mm/tlb-v7.S
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * linux/arch/arm/mm/tlb-v7.S
- *
- * Copyright (C) 1997-2002 Russell King
- * Modified for ARMv7 by Catalin Marinas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * ARM architecture version 6 TLB handling functions.
- * These assume a split I/D TLB.
- */
-#include
-#include
-#include
-#include
-#include "proc-macros.S"
-
-/*
- * v7wbi_flush_user_tlb_range(start, end, vma)
- *
- * Invalidate a range of TLB entries in the specified address space.
- *
- * - start - start address (may not be aligned)
- * - end - end address (exclusive, may not be aligned)
- * - vma - vma_struct describing address range
- *
- * It is assumed that:
- * - the "Invalidate single entry" instruction will invalidate
- * both the I and the D TLBs on Harvard-style TLBs
- */
-ENTRY(v7wbi_flush_user_tlb_range)
- vma_vm_mm r3, r2 @ get vma->vm_mm
- mmid r3, r3 @ get vm_mm->context.id
- dsb
- mov r0, r0, lsr #PAGE_SHIFT @ align address
- mov r1, r1, lsr #PAGE_SHIFT
- asid r3, r3 @ mask ASID
- orr r0, r3, r0, lsl #PAGE_SHIFT @ Create initial MVA
- mov r1, r1, lsl #PAGE_SHIFT
- vma_vm_flags r2, r2 @ get vma->vm_flags
-1:
- mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA (was 1)
- tst r2, #VM_EXEC @ Executable area ?
- mcrne p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA (was 1)
- add r0, r0, #PAGE_SZ
- cmp r0, r1
- blo 1b
- mov ip, #0
- mcr p15, 0, ip, c7, c5, 6 @ flush BTAC/BTB
- dsb
- mov pc, lr
-
-/*
- * v7wbi_flush_kern_tlb_range(start,end)
- *
- * Invalidate a range of kernel TLB entries
- *
- * - start - start address (may not be aligned)
- * - end - end address (exclusive, may not be aligned)
- */
-ENTRY(v7wbi_flush_kern_tlb_range)
- dsb
- mov r0, r0, lsr #PAGE_SHIFT @ align address
- mov r1, r1, lsr #PAGE_SHIFT
- mov r0, r0, lsl #PAGE_SHIFT
- mov r1, r1, lsl #PAGE_SHIFT
-1:
- mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA
- mcr p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA
- add r0, r0, #PAGE_SZ
- cmp r0, r1
- blo 1b
- mov r2, #0
- mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
- dsb
- isb
- mov pc, lr
-
- .section ".text.init", #alloc, #execinstr
-
- .type v7wbi_tlb_fns, #object
-ENTRY(v7wbi_tlb_fns)
- .long v7wbi_flush_user_tlb_range
- .long v7wbi_flush_kern_tlb_range
- .long v6wbi_tlb_flags
- .size v7wbi_tlb_fns, . - v7wbi_tlb_fns
diff --git a/trunk/arch/arm/nwfpe/softfloat.h b/trunk/arch/arm/nwfpe/softfloat.h
index 260fe29d73f5..0a3067452cd2 100644
--- a/trunk/arch/arm/nwfpe/softfloat.h
+++ b/trunk/arch/arm/nwfpe/softfloat.h
@@ -273,7 +273,4 @@ static inline flag float64_lt_nocheck(float64 a, float64 b)
extern flag float32_is_nan( float32 a );
extern flag float64_is_nan( float64 a );
-extern int32 float64_to_uint32( struct roundingData *roundData, float64 a );
-extern int32 float64_to_uint32_round_to_zero( float64 a );
-
#endif
diff --git a/trunk/arch/arm/oprofile/op_model_mpcore.c b/trunk/arch/arm/oprofile/op_model_mpcore.c
index 7791da791f5f..898500718249 100644
--- a/trunk/arch/arm/oprofile/op_model_mpcore.c
+++ b/trunk/arch/arm/oprofile/op_model_mpcore.c
@@ -257,13 +257,8 @@ static void em_stop(void)
*/
static void em_route_irq(int irq, unsigned int cpu)
{
- struct irq_desc *desc = irq_desc + irq;
- cpumask_t mask = cpumask_of_cpu(cpu);
-
- spin_lock_irq(&desc->lock);
- desc->affinity = mask;
- desc->chip->set_affinity(irq, mask);
- spin_unlock_irq(&desc->lock);
+ irq_desc[irq].affinity = cpumask_of_cpu(cpu);
+ irq_desc[irq].chip->set_affinity(irq, cpumask_of_cpu(cpu));
}
static int em_setup(void)
diff --git a/trunk/arch/i386/Kconfig b/trunk/arch/i386/Kconfig
index 8770a5d0b143..c2d54b802232 100644
--- a/trunk/arch/i386/Kconfig
+++ b/trunk/arch/i386/Kconfig
@@ -891,7 +891,7 @@ config PHYSICAL_ALIGN
Don't change this unless you know what you are doing.
config HOTPLUG_CPU
- bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
+ bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER
---help---
Say Y here to experiment with turning CPUs off and on, and to
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/mach-generic/bigsmp.c b/trunk/arch/i386/mach-generic/bigsmp.c
index 58a477baec30..e932d3485ae2 100644
--- a/trunk/arch/i386/mach-generic/bigsmp.c
+++ b/trunk/arch/i386/mach-generic/bigsmp.c
@@ -21,7 +21,7 @@
static int dmi_bigsmp; /* can be set by dmi scanners */
-static int hp_ht_bigsmp(struct dmi_system_id *d)
+static __init int hp_ht_bigsmp(struct dmi_system_id *d)
{
#ifdef CONFIG_X86_GENERICARCH
printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
@@ -31,7 +31,7 @@ static int hp_ht_bigsmp(struct dmi_system_id *d)
}
-static struct dmi_system_id bigsmp_dmi_table[] = {
+static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
{ hp_ht_bigsmp, "HP ProLiant DL760 G2", {
DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
DMI_MATCH(DMI_BIOS_VERSION, "P44-"),
@@ -45,7 +45,7 @@ static struct dmi_system_id bigsmp_dmi_table[] = {
};
-static int probe_bigsmp(void)
+static int __init probe_bigsmp(void)
{
if (def_to_bigsmp)
dmi_bigsmp = 1;
diff --git a/trunk/arch/ia64/kernel/acpi-processor.c b/trunk/arch/ia64/kernel/acpi-processor.c
index 5a216c019924..4d4993a47e55 100644
--- a/trunk/arch/ia64/kernel/acpi-processor.c
+++ b/trunk/arch/ia64/kernel/acpi-processor.c
@@ -44,7 +44,7 @@ static void init_intel_pdc(struct acpi_processor *pr)
buf[0] = ACPI_PDC_REVISION_ID;
buf[1] = 1;
- buf[2] = ACPI_PDC_EST_CAPABILITY_SMP;
+ buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP;
obj->type = ACPI_TYPE_BUFFER;
obj->buffer.length = 12;
diff --git a/trunk/arch/ia64/kernel/acpi.c b/trunk/arch/ia64/kernel/acpi.c
index 103dd8edda71..c4784494970e 100644
--- a/trunk/arch/ia64/kernel/acpi.c
+++ b/trunk/arch/ia64/kernel/acpi.c
@@ -67,8 +67,7 @@ EXPORT_SYMBOL(pm_power_off);
unsigned int acpi_cpei_override;
unsigned int acpi_cpei_phys_cpuid;
-const char __init *
-acpi_get_sysname(void)
+const char *acpi_get_sysname(void)
{
#ifdef CONFIG_IA64_GENERIC
unsigned long rsdp_phys;
diff --git a/trunk/arch/ia64/kernel/smpboot.c b/trunk/arch/ia64/kernel/smpboot.c
index 3c9d8e6089cf..542958079f1b 100644
--- a/trunk/arch/ia64/kernel/smpboot.c
+++ b/trunk/arch/ia64/kernel/smpboot.c
@@ -370,7 +370,7 @@ smp_setup_percpu_timer (void)
{
}
-static void __cpuinit
+static void __devinit
smp_callin (void)
{
int cpuid, phys_id, itc_master;
@@ -456,7 +456,7 @@ smp_callin (void)
/*
* Activate a secondary processor. head.S calls this.
*/
-int __cpuinit
+int __devinit
start_secondary (void *unused)
{
/* Early console may use I/O ports */
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/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/sgi-ip32/Makefile b/trunk/arch/mips/sgi-ip32/Makefile
index 60f0227425e7..7e1416768a60 100644
--- a/trunk/arch/mips/sgi-ip32/Makefile
+++ b/trunk/arch/mips/sgi-ip32/Makefile
@@ -3,5 +3,5 @@
# under Linux.
#
-obj-y += ip32-berr.o ip32-irq.o ip32-platform.o ip32-setup.o ip32-reset.o \
+obj-y += ip32-berr.o ip32-irq.o ip32-setup.o ip32-reset.o \
crime.o ip32-memory.o
diff --git a/trunk/arch/mips/sgi-ip32/ip32-platform.c b/trunk/arch/mips/sgi-ip32/ip32-platform.c
deleted file mode 100644
index 120b15932caf..000000000000
--- a/trunk/arch/mips/sgi-ip32/ip32-platform.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include
-#include
-
-static __init int meth_devinit(void)
-{
- struct platform_device *pd;
- int ret;
-
- pd = platform_device_alloc("meth", -1);
- if (!pd)
- return -ENOMEM;
-
- ret = platform_device_add(pd);
- if (ret)
- platform_device_put(pd);
-
- return ret;
-}
-
-device_initcall(meth_devinit);
diff --git a/trunk/arch/powerpc/Kconfig b/trunk/arch/powerpc/Kconfig
index 5eaeafd30bdf..56d3c0dcd2b8 100644
--- a/trunk/arch/powerpc/Kconfig
+++ b/trunk/arch/powerpc/Kconfig
@@ -118,7 +118,6 @@ config GENERIC_BUG
depends on BUG
config SYS_SUPPORTS_APM_EMULATION
- default y if PMAC_APM_EMU
bool
config DEFAULT_UIMAGE
diff --git a/trunk/arch/powerpc/boot/dts/lite5200.dts b/trunk/arch/powerpc/boot/dts/lite5200.dts
index d29308fe4c24..eae68ab1177f 100644
--- a/trunk/arch/powerpc/boot/dts/lite5200.dts
+++ b/trunk/arch/powerpc/boot/dts/lite5200.dts
@@ -67,7 +67,7 @@
interrupt-controller;
#interrupt-cells = <3>;
device_type = "interrupt-controller";
- compatible = "mpc5200-pic";
+ compatible = "mpc5200_pic";
reg = <500 80>;
built-in;
};
diff --git a/trunk/arch/powerpc/boot/dts/lite5200b.dts b/trunk/arch/powerpc/boot/dts/lite5200b.dts
index f242531f0451..5185625a9419 100644
--- a/trunk/arch/powerpc/boot/dts/lite5200b.dts
+++ b/trunk/arch/powerpc/boot/dts/lite5200b.dts
@@ -67,7 +67,7 @@
interrupt-controller;
#interrupt-cells = <3>;
device_type = "interrupt-controller";
- compatible = "mpc5200b-pic\0mpc5200-pic";
+ compatible = "mpc5200b-pic\0mpc5200_pic";
reg = <500 80>;
built-in;
};
diff --git a/trunk/arch/powerpc/mm/pgtable_32.c b/trunk/arch/powerpc/mm/pgtable_32.c
index f6ae1a57d652..d8232b7a08f7 100644
--- a/trunk/arch/powerpc/mm/pgtable_32.c
+++ b/trunk/arch/powerpc/mm/pgtable_32.c
@@ -93,7 +93,7 @@ void pgd_free(pgd_t *pgd)
free_pages((unsigned long)pgd, PGDIR_ORDER);
}
-__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
+pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
{
pte_t *pte;
extern int mem_init_done;
diff --git a/trunk/arch/powerpc/platforms/chrp/pegasos_eth.c b/trunk/arch/powerpc/platforms/chrp/pegasos_eth.c
index 5bcc58d9a4dd..71045677559a 100644
--- a/trunk/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/trunk/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -169,7 +169,7 @@ static int Enable_SRAM(void)
/***********/
/***********/
-static int __init mv643xx_eth_add_pds(void)
+int mv643xx_eth_add_pds(void)
{
int ret = 0;
static struct pci_device_id pci_marvell_mv64360[] = {
diff --git a/trunk/arch/powerpc/platforms/powermac/setup.c b/trunk/arch/powerpc/platforms/powermac/setup.c
index 07b1c4ec428d..a410bc76a8a8 100644
--- a/trunk/arch/powerpc/platforms/powermac/setup.c
+++ b/trunk/arch/powerpc/platforms/powermac/setup.c
@@ -384,7 +384,7 @@ int boot_part;
static dev_t boot_dev;
#ifdef CONFIG_SCSI
-void note_scsi_host(struct device_node *node, void *host)
+void __init note_scsi_host(struct device_node *node, void *host)
{
int l;
char *p;
diff --git a/trunk/arch/powerpc/sysdev/qe_lib/Kconfig b/trunk/arch/powerpc/sysdev/qe_lib/Kconfig
index f611d344a126..887739f3badc 100644
--- a/trunk/arch/powerpc/sysdev/qe_lib/Kconfig
+++ b/trunk/arch/powerpc/sysdev/qe_lib/Kconfig
@@ -5,13 +5,15 @@
config UCC_SLOW
bool
default n
+ select UCC
help
This option provides qe_lib support to UCC slow
protocols: UART, BISYNC, QMC
config UCC_FAST
bool
- default y if UCC_GETH
+ default n
+ select UCC
help
This option provides qe_lib support to UCC fast
protocols: HDLC, Ethernet, ATM, transparent
diff --git a/trunk/arch/ppc/kernel/entry.S b/trunk/arch/ppc/kernel/entry.S
index fba7ca17a67e..ab64256110bd 100644
--- a/trunk/arch/ppc/kernel/entry.S
+++ b/trunk/arch/ppc/kernel/entry.S
@@ -596,11 +596,7 @@ fast_exception_return:
mr r12,r4 /* restart at exc_exit_restart */
b 2b
- .section .bss
- .align 2
-fee_restarts:
- .space 4
- .previous
+ .comm fee_restarts,4
/* aargh, a nonrecoverable interrupt, panic */
/* aargh, we don't know which trap this is */
@@ -855,11 +851,7 @@ load_dbcr0:
mtspr SPRN_DBSR,r11 /* clear all pending debug events */
blr
- .section .bss
- .align 4
-global_dbcr0:
- .space 8
- .previous
+ .comm global_dbcr0,8
#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
do_work: /* r10 contains MSR_KERNEL here */
@@ -934,8 +926,4 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
/* shouldn't return */
b 4b
- .section .bss
- .align 2
-ee_restarts:
- .space 4
- .previous
+ .comm ee_restarts,4
diff --git a/trunk/arch/ppc/kernel/ppc_ksyms.c b/trunk/arch/ppc/kernel/ppc_ksyms.c
index a4165209ac7c..4ad499605d05 100644
--- a/trunk/arch/ppc/kernel/ppc_ksyms.c
+++ b/trunk/arch/ppc/kernel/ppc_ksyms.c
@@ -40,6 +40,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -92,6 +93,7 @@ EXPORT_SYMBOL(strncpy);
EXPORT_SYMBOL(strcat);
EXPORT_SYMBOL(strlen);
EXPORT_SYMBOL(strcmp);
+EXPORT_SYMBOL(__div64_32);
EXPORT_SYMBOL(csum_partial);
EXPORT_SYMBOL(csum_partial_copy_generic);
diff --git a/trunk/arch/ppc/mm/hashtable.S b/trunk/arch/ppc/mm/hashtable.S
index 5f364dc50154..e756942e65c4 100644
--- a/trunk/arch/ppc/mm/hashtable.S
+++ b/trunk/arch/ppc/mm/hashtable.S
@@ -30,11 +30,7 @@
#include
#ifdef CONFIG_SMP
- .section .bss
- .align 2
- .globl mmu_hash_lock
-mmu_hash_lock:
- .space 4
+ .comm mmu_hash_lock,4
#endif /* CONFIG_SMP */
/*
@@ -465,17 +461,9 @@ found_slot:
sync /* make sure pte updates get to memory */
blr
- .section .bss
- .align 2
-next_slot:
- .space 4
- .globl primary_pteg_full
-primary_pteg_full:
- .space 4
- .globl htab_hash_searches
-htab_hash_searches:
- .space 4
- .previous
+ .comm next_slot,4
+ .comm primary_pteg_full,4
+ .comm htab_hash_searches,4
/*
* Flush the entry for a particular page from the hash table.
diff --git a/trunk/arch/ppc/mm/pgtable.c b/trunk/arch/ppc/mm/pgtable.c
index 35ebb6395ae3..c023b7298809 100644
--- a/trunk/arch/ppc/mm/pgtable.c
+++ b/trunk/arch/ppc/mm/pgtable.c
@@ -92,7 +92,7 @@ void pgd_free(pgd_t *pgd)
free_pages((unsigned long)pgd, PGDIR_ORDER);
}
-__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
+pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
{
pte_t *pte;
extern int mem_init_done;
diff --git a/trunk/arch/sh/kernel/timers/timer.c b/trunk/arch/sh/kernel/timers/timer.c
index a6bcc913d25e..4e7e747d1b69 100644
--- a/trunk/arch/sh/kernel/timers/timer.c
+++ b/trunk/arch/sh/kernel/timers/timer.c
@@ -13,7 +13,7 @@
#include
#include
-static struct sys_timer *sys_timers[] __initdata = {
+static struct sys_timer *sys_timers[] = {
#ifdef CONFIG_SH_TMU
&tmu_timer,
#endif
@@ -26,7 +26,7 @@ static struct sys_timer *sys_timers[] __initdata = {
NULL,
};
-static char timer_override[10] __initdata;
+static char timer_override[10];
static int __init timer_setup(char *str)
{
if (str)
@@ -53,4 +53,3 @@ struct sys_timer *get_sys_timer(void)
return NULL;
}
-
diff --git a/trunk/arch/sparc/Kconfig b/trunk/arch/sparc/Kconfig
index fbcc00c6c06e..bd992c0048f0 100644
--- a/trunk/arch/sparc/Kconfig
+++ b/trunk/arch/sparc/Kconfig
@@ -178,13 +178,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config EMULATED_CMPXCHG
- bool
- default y
- help
- Sparc32 does not have a CAS instruction like sparc64. cmpxchg()
- is emulated, and therefore it is not completely atomic.
-
config SUN_PM
bool
default y
diff --git a/trunk/arch/sparc/kernel/time.c b/trunk/arch/sparc/kernel/time.c
index 7b4612da74a6..f1401b57ccc7 100644
--- a/trunk/arch/sparc/kernel/time.c
+++ b/trunk/arch/sparc/kernel/time.c
@@ -148,7 +148,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
}
/* Kick start a stopped clock (procedure from the Sun NVRAM/hostid FAQ). */
-static void __devinit kick_start_clock(void)
+static void __init kick_start_clock(void)
{
struct mostek48t02 *regs = (struct mostek48t02 *)mstk48t02_regs;
unsigned char sec;
@@ -223,7 +223,7 @@ static __inline__ int has_low_battery(void)
return (data1 == data2); /* Was the write blocked? */
}
-static void __devinit mostek_set_system_time(void)
+static void __init mostek_set_system_time(void)
{
unsigned int year, mon, day, hour, min, sec;
struct mostek48t02 *mregs;
diff --git a/trunk/arch/sparc/lib/atomic32.c b/trunk/arch/sparc/lib/atomic32.c
index cbddeb38ffda..559335f4917d 100644
--- a/trunk/arch/sparc/lib/atomic32.c
+++ b/trunk/arch/sparc/lib/atomic32.c
@@ -2,7 +2,6 @@
* atomic32.c: 32-bit atomic_t implementation
*
* Copyright (C) 2004 Keith M Wesolowski
- * Copyright (C) 2007 Kyle McMartin
*
* Based on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf
*/
@@ -118,17 +117,3 @@ unsigned long ___change_bit(unsigned long *addr, unsigned long mask)
return old & mask;
}
EXPORT_SYMBOL(___change_bit);
-
-unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new)
-{
- unsigned long flags;
- u32 prev;
-
- spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
- if ((prev = *ptr) == old)
- *ptr = new;
- spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
-
- return (unsigned long)prev;
-}
-EXPORT_SYMBOL(__cmpxchg_u32);
diff --git a/trunk/arch/sparc64/Kconfig b/trunk/arch/sparc64/Kconfig
index bd00f89eed1e..831781cab271 100644
--- a/trunk/arch/sparc64/Kconfig
+++ b/trunk/arch/sparc64/Kconfig
@@ -147,10 +147,10 @@ config SMP
If you don't know what to do here, say N.
config NR_CPUS
- int "Maximum number of CPUs (2-1024)"
- range 2 1024
+ int "Maximum number of CPUs (2-64)"
+ range 2 64
depends on SMP
- default "64"
+ default "32"
source "drivers/cpufreq/Kconfig"
diff --git a/trunk/arch/sparc64/kernel/Makefile b/trunk/arch/sparc64/kernel/Makefile
index d8d19093d12f..c749dccacc32 100644
--- a/trunk/arch/sparc64/kernel/Makefile
+++ b/trunk/arch/sparc64/kernel/Makefile
@@ -8,11 +8,11 @@ EXTRA_CFLAGS := -Werror
extra-y := head.o init_task.o vmlinux.lds
obj-y := process.o setup.o cpu.o idprom.o \
- traps.o auxio.o una_asm.o \
+ traps.o devices.o auxio.o una_asm.o \
irq.o ptrace.o time.o sys_sparc.o signal.o \
unaligned.o central.o pci.o starfire.o semaphore.o \
power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
- visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o
+ visemul.o prom.o of_device.o hvapi.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \
diff --git a/trunk/arch/sparc64/kernel/devices.c b/trunk/arch/sparc64/kernel/devices.c
new file mode 100644
index 000000000000..0e03c8e218cd
--- /dev/null
+++ b/trunk/arch/sparc64/kernel/devices.c
@@ -0,0 +1,196 @@
+/* devices.c: Initial scan of the prom device tree for important
+ * Sparc device nodes which we need to find.
+ *
+ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/* Used to synchronize accesses to NatSemi SUPER I/O chip configure
+ * operations in asm/ns87303.h
+ */
+DEFINE_SPINLOCK(ns87303_lock);
+
+extern void cpu_probe(void);
+extern void central_probe(void);
+
+static const char *cpu_mid_prop(void)
+{
+ if (tlb_type == spitfire)
+ return "upa-portid";
+ return "portid";
+}
+
+static int get_cpu_mid(struct device_node *dp)
+{
+ struct property *prop;
+
+ if (tlb_type == hypervisor) {
+ struct linux_prom64_registers *reg;
+ int len;
+
+ prop = of_find_property(dp, "cpuid", &len);
+ if (prop && len == 4)
+ return *(int *) prop->value;
+
+ prop = of_find_property(dp, "reg", NULL);
+ reg = prop->value;
+ return (reg[0].phys_addr >> 32) & 0x0fffffffUL;
+ } else {
+ const char *prop_name = cpu_mid_prop();
+
+ prop = of_find_property(dp, prop_name, NULL);
+ if (prop)
+ return *(int *) prop->value;
+ return 0;
+ }
+}
+
+static int check_cpu_node(struct device_node *dp, int *cur_inst,
+ int (*compare)(struct device_node *, int, void *),
+ void *compare_arg,
+ struct device_node **dev_node, int *mid)
+{
+ if (!compare(dp, *cur_inst, compare_arg)) {
+ if (dev_node)
+ *dev_node = dp;
+ if (mid)
+ *mid = get_cpu_mid(dp);
+ return 0;
+ }
+
+ (*cur_inst)++;
+
+ return -ENODEV;
+}
+
+static int __cpu_find_by(int (*compare)(struct device_node *, int, void *),
+ void *compare_arg,
+ struct device_node **dev_node, int *mid)
+{
+ struct device_node *dp;
+ int cur_inst;
+
+ cur_inst = 0;
+ for_each_node_by_type(dp, "cpu") {
+ int err = check_cpu_node(dp, &cur_inst,
+ compare, compare_arg,
+ dev_node, mid);
+ if (err == 0)
+ return 0;
+ }
+
+ return -ENODEV;
+}
+
+static int cpu_instance_compare(struct device_node *dp, int instance, void *_arg)
+{
+ int desired_instance = (int) (long) _arg;
+
+ if (instance == desired_instance)
+ return 0;
+ return -ENODEV;
+}
+
+int cpu_find_by_instance(int instance, struct device_node **dev_node, int *mid)
+{
+ return __cpu_find_by(cpu_instance_compare, (void *)(long)instance,
+ dev_node, mid);
+}
+
+static int cpu_mid_compare(struct device_node *dp, int instance, void *_arg)
+{
+ int desired_mid = (int) (long) _arg;
+ int this_mid;
+
+ this_mid = get_cpu_mid(dp);
+ if (this_mid == desired_mid)
+ return 0;
+ return -ENODEV;
+}
+
+int cpu_find_by_mid(int mid, struct device_node **dev_node)
+{
+ return __cpu_find_by(cpu_mid_compare, (void *)(long)mid,
+ dev_node, NULL);
+}
+
+void __init device_scan(void)
+{
+ /* FIX ME FAST... -DaveM */
+ ioport_resource.end = 0xffffffffffffffffUL;
+
+ prom_printf("Booting Linux...\n");
+
+#ifndef CONFIG_SMP
+ {
+ struct device_node *dp;
+ int err, def;
+
+ err = cpu_find_by_instance(0, &dp, NULL);
+ if (err) {
+ prom_printf("No cpu nodes, cannot continue\n");
+ prom_halt();
+ }
+ cpu_data(0).clock_tick =
+ of_getintprop_default(dp, "clock-frequency", 0);
+
+ def = ((tlb_type == hypervisor) ?
+ (8 * 1024) :
+ (16 * 1024));
+ cpu_data(0).dcache_size = of_getintprop_default(dp,
+ "dcache-size",
+ def);
+
+ def = 32;
+ cpu_data(0).dcache_line_size =
+ of_getintprop_default(dp, "dcache-line-size", def);
+
+ def = 16 * 1024;
+ cpu_data(0).icache_size = of_getintprop_default(dp,
+ "icache-size",
+ def);
+
+ def = 32;
+ cpu_data(0).icache_line_size =
+ of_getintprop_default(dp, "icache-line-size", def);
+
+ def = ((tlb_type == hypervisor) ?
+ (3 * 1024 * 1024) :
+ (4 * 1024 * 1024));
+ cpu_data(0).ecache_size = of_getintprop_default(dp,
+ "ecache-size",
+ def);
+
+ def = 64;
+ cpu_data(0).ecache_line_size =
+ of_getintprop_default(dp, "ecache-line-size", def);
+ printk("CPU[0]: Caches "
+ "D[sz(%d):line_sz(%d)] "
+ "I[sz(%d):line_sz(%d)] "
+ "E[sz(%d):line_sz(%d)]\n",
+ cpu_data(0).dcache_size, cpu_data(0).dcache_line_size,
+ cpu_data(0).icache_size, cpu_data(0).icache_line_size,
+ cpu_data(0).ecache_size, cpu_data(0).ecache_line_size);
+ }
+#endif
+
+ central_probe();
+
+ cpu_probe();
+}
diff --git a/trunk/arch/sparc64/kernel/entry.S b/trunk/arch/sparc64/kernel/entry.S
index ed712e0b3372..732b77cb71f8 100644
--- a/trunk/arch/sparc64/kernel/entry.S
+++ b/trunk/arch/sparc64/kernel/entry.S
@@ -1725,142 +1725,96 @@ real_hard_smp_processor_id:
* returns %o0: sysino
*/
.globl sun4v_devino_to_sysino
- .type sun4v_devino_to_sysino,#function
sun4v_devino_to_sysino:
mov HV_FAST_INTR_DEVINO2SYSINO, %o5
ta HV_FAST_TRAP
retl
mov %o1, %o0
- .size sun4v_devino_to_sysino, .-sun4v_devino_to_sysino
/* %o0: sysino
*
* returns %o0: intr_enabled (HV_INTR_{DISABLED,ENABLED})
*/
.globl sun4v_intr_getenabled
- .type sun4v_intr_getenabled,#function
sun4v_intr_getenabled:
mov HV_FAST_INTR_GETENABLED, %o5
ta HV_FAST_TRAP
retl
mov %o1, %o0
- .size sun4v_intr_getenabled, .-sun4v_intr_getenabled
/* %o0: sysino
* %o1: intr_enabled (HV_INTR_{DISABLED,ENABLED})
*/
.globl sun4v_intr_setenabled
- .type sun4v_intr_setenabled,#function
sun4v_intr_setenabled:
mov HV_FAST_INTR_SETENABLED, %o5
ta HV_FAST_TRAP
retl
nop
- .size sun4v_intr_setenabled, .-sun4v_intr_setenabled
/* %o0: sysino
*
* returns %o0: intr_state (HV_INTR_STATE_*)
*/
.globl sun4v_intr_getstate
- .type sun4v_intr_getstate,#function
sun4v_intr_getstate:
mov HV_FAST_INTR_GETSTATE, %o5
ta HV_FAST_TRAP
retl
mov %o1, %o0
- .size sun4v_intr_getstate, .-sun4v_intr_getstate
/* %o0: sysino
* %o1: intr_state (HV_INTR_STATE_*)
*/
.globl sun4v_intr_setstate
- .type sun4v_intr_setstate,#function
sun4v_intr_setstate:
mov HV_FAST_INTR_SETSTATE, %o5
ta HV_FAST_TRAP
retl
nop
- .size sun4v_intr_setstate, .-sun4v_intr_setstate
/* %o0: sysino
*
* returns %o0: cpuid
*/
.globl sun4v_intr_gettarget
- .type sun4v_intr_gettarget,#function
sun4v_intr_gettarget:
mov HV_FAST_INTR_GETTARGET, %o5
ta HV_FAST_TRAP
retl
mov %o1, %o0
- .size sun4v_intr_gettarget, .-sun4v_intr_gettarget
/* %o0: sysino
* %o1: cpuid
*/
.globl sun4v_intr_settarget
- .type sun4v_intr_settarget,#function
sun4v_intr_settarget:
mov HV_FAST_INTR_SETTARGET, %o5
ta HV_FAST_TRAP
retl
nop
- .size sun4v_intr_settarget, .-sun4v_intr_settarget
- /* %o0: cpuid
- * %o1: pc
- * %o2: rtba
- * %o3: arg0
+ /* %o0: type
+ * %o1: queue paddr
+ * %o2: num queue entries
*
* returns %o0: status
*/
- .globl sun4v_cpu_start
- .type sun4v_cpu_start,#function
-sun4v_cpu_start:
- mov HV_FAST_CPU_START, %o5
+ .globl sun4v_cpu_qconf
+sun4v_cpu_qconf:
+ mov HV_FAST_CPU_QCONF, %o5
ta HV_FAST_TRAP
retl
nop
- .size sun4v_cpu_start, .-sun4v_cpu_start
- /* %o0: cpuid
- *
- * returns %o0: status
+ /* returns %o0: status
*/
- .globl sun4v_cpu_stop
- .type sun4v_cpu_stop,#function
-sun4v_cpu_stop:
- mov HV_FAST_CPU_STOP, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_cpu_stop, .-sun4v_cpu_stop
-
- /* returns %o0: status */
.globl sun4v_cpu_yield
- .type sun4v_cpu_yield, #function
sun4v_cpu_yield:
mov HV_FAST_CPU_YIELD, %o5
ta HV_FAST_TRAP
retl
nop
- .size sun4v_cpu_yield, .-sun4v_cpu_yield
-
- /* %o0: type
- * %o1: queue paddr
- * %o2: num queue entries
- *
- * returns %o0: status
- */
- .globl sun4v_cpu_qconf
- .type sun4v_cpu_qconf,#function
-sun4v_cpu_qconf:
- mov HV_FAST_CPU_QCONF, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_cpu_qconf, .-sun4v_cpu_qconf
/* %o0: num cpus in cpu list
* %o1: cpu list paddr
@@ -1869,13 +1823,11 @@ sun4v_cpu_qconf:
* returns %o0: status
*/
.globl sun4v_cpu_mondo_send
- .type sun4v_cpu_mondo_send,#function
sun4v_cpu_mondo_send:
mov HV_FAST_CPU_MONDO_SEND, %o5
ta HV_FAST_TRAP
retl
nop
- .size sun4v_cpu_mondo_send, .-sun4v_cpu_mondo_send
/* %o0: CPU ID
*
@@ -1883,7 +1835,6 @@ sun4v_cpu_mondo_send:
* %o0: cpu state as HV_CPU_STATE_*
*/
.globl sun4v_cpu_state
- .type sun4v_cpu_state,#function
sun4v_cpu_state:
mov HV_FAST_CPU_STATE, %o5
ta HV_FAST_TRAP
@@ -1892,37 +1843,6 @@ sun4v_cpu_state:
mov %o1, %o0
1: retl
nop
- .size sun4v_cpu_state, .-sun4v_cpu_state
-
- /* %o0: virtual address
- * %o1: must be zero
- * %o2: TTE
- * %o3: HV_MMU_* flags
- *
- * returns %o0: status
- */
- .globl sun4v_mmu_map_perm_addr
- .type sun4v_mmu_map_perm_addr,#function
-sun4v_mmu_map_perm_addr:
- mov HV_FAST_MMU_MAP_PERM_ADDR, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_mmu_map_perm_addr, .-sun4v_mmu_map_perm_addr
-
- /* %o0: number of TSB descriptions
- * %o1: TSB descriptions real address
- *
- * returns %o0: status
- */
- .globl sun4v_mmu_tsb_ctx0
- .type sun4v_mmu_tsb_ctx0,#function
-sun4v_mmu_tsb_ctx0:
- mov HV_FAST_MMU_TSB_CTX0, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_mmu_tsb_ctx0, .-sun4v_mmu_tsb_ctx0
/* %o0: API group number
* %o1: pointer to unsigned long major number storage
@@ -1931,7 +1851,6 @@ sun4v_mmu_tsb_ctx0:
* returns %o0: status
*/
.globl sun4v_get_version
- .type sun4v_get_version,#function
sun4v_get_version:
mov HV_CORE_GET_VER, %o5
mov %o1, %o3
@@ -1940,7 +1859,6 @@ sun4v_get_version:
stx %o1, [%o3]
retl
stx %o2, [%o4]
- .size sun4v_get_version, .-sun4v_get_version
/* %o0: API group number
* %o1: desired major number
@@ -1950,49 +1868,18 @@ sun4v_get_version:
* returns %o0: status
*/
.globl sun4v_set_version
- .type sun4v_set_version,#function
sun4v_set_version:
mov HV_CORE_SET_VER, %o5
mov %o3, %o4
ta HV_CORE_TRAP
retl
stx %o1, [%o4]
- .size sun4v_set_version, .-sun4v_set_version
-
- /* %o0: pointer to unsigned long time
- *
- * returns %o0: status
- */
- .globl sun4v_tod_get
- .type sun4v_tod_get,#function
-sun4v_tod_get:
- mov %o0, %o4
- mov HV_FAST_TOD_GET, %o5
- ta HV_FAST_TRAP
- stx %o1, [%o4]
- retl
- nop
- .size sun4v_tod_get, .-sun4v_tod_get
-
- /* %o0: time
- *
- * returns %o0: status
- */
- .globl sun4v_tod_set
- .type sun4v_tod_set,#function
-sun4v_tod_set:
- mov HV_FAST_TOD_SET, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_tod_set, .-sun4v_tod_set
/* %o0: pointer to unsigned long status
*
* returns %o0: signed character
*/
.globl sun4v_con_getchar
- .type sun4v_con_getchar,#function
sun4v_con_getchar:
mov %o0, %o4
mov HV_FAST_CONS_GETCHAR, %o5
@@ -2002,20 +1889,17 @@ sun4v_con_getchar:
stx %o0, [%o4]
retl
sra %o1, 0, %o0
- .size sun4v_con_getchar, .-sun4v_con_getchar
/* %o0: signed long character
*
* returns %o0: status
*/
.globl sun4v_con_putchar
- .type sun4v_con_putchar,#function
sun4v_con_putchar:
mov HV_FAST_CONS_PUTCHAR, %o5
ta HV_FAST_TRAP
retl
sra %o0, 0, %o0
- .size sun4v_con_putchar, .-sun4v_con_putchar
/* %o0: buffer real address
* %o1: buffer size
@@ -2024,7 +1908,6 @@ sun4v_con_putchar:
* returns %o0: status
*/
.globl sun4v_con_read
- .type sun4v_con_read,#function
sun4v_con_read:
mov %o2, %o4
mov HV_FAST_CONS_READ, %o5
@@ -2039,7 +1922,6 @@ sun4v_con_read:
stx %o1, [%o4]
1: retl
nop
- .size sun4v_con_read, .-sun4v_con_read
/* %o0: buffer real address
* %o1: buffer size
@@ -2048,7 +1930,6 @@ sun4v_con_read:
* returns %o0: status
*/
.globl sun4v_con_write
- .type sun4v_con_write,#function
sun4v_con_write:
mov %o2, %o4
mov HV_FAST_CONS_WRITE, %o5
@@ -2056,517 +1937,3 @@ sun4v_con_write:
stx %o1, [%o4]
retl
nop
- .size sun4v_con_write, .-sun4v_con_write
-
- /* %o0: soft state
- * %o1: address of description string
- *
- * returns %o0: status
- */
- .globl sun4v_mach_set_soft_state
- .type sun4v_mach_set_soft_state,#function
-sun4v_mach_set_soft_state:
- mov HV_FAST_MACH_SET_SOFT_STATE, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_mach_set_soft_state, .-sun4v_mach_set_soft_state
-
- /* %o0: exit code
- *
- * Does not return.
- */
- .globl sun4v_mach_exit
- .type sun4v_mach_exit,#function
-sun4v_mach_exit:
- mov HV_FAST_MACH_EXIT, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_mach_exit, .-sun4v_mach_exit
-
- /* %o0: buffer real address
- * %o1: buffer length
- * %o2: pointer to unsigned long real_buf_len
- *
- * returns %o0: status
- */
- .globl sun4v_mach_desc
- .type sun4v_mach_desc,#function
-sun4v_mach_desc:
- mov %o2, %o4
- mov HV_FAST_MACH_DESC, %o5
- ta HV_FAST_TRAP
- stx %o1, [%o4]
- retl
- nop
- .size sun4v_mach_desc, .-sun4v_mach_desc
-
- /* %o0: new timeout in milliseconds
- * %o1: pointer to unsigned long orig_timeout
- *
- * returns %o0: status
- */
- .globl sun4v_mach_set_watchdog
- .type sun4v_mach_set_watchdog,#function
-sun4v_mach_set_watchdog:
- mov %o1, %o4
- mov HV_FAST_MACH_SET_WATCHDOG, %o5
- ta HV_FAST_TRAP
- stx %o1, [%o4]
- retl
- nop
- .size sun4v_mach_set_watchdog, .-sun4v_mach_set_watchdog
-
- /* No inputs and does not return. */
- .globl sun4v_mach_sir
- .type sun4v_mach_sir,#function
-sun4v_mach_sir:
- mov %o1, %o4
- mov HV_FAST_MACH_SIR, %o5
- ta HV_FAST_TRAP
- stx %o1, [%o4]
- retl
- nop
- .size sun4v_mach_sir, .-sun4v_mach_sir
-
- /* %o0: channel
- * %o1: ra
- * %o2: num_entries
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_tx_qconf
- .type sun4v_ldc_tx_qconf,#function
-sun4v_ldc_tx_qconf:
- mov HV_FAST_LDC_TX_QCONF, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_ldc_tx_qconf, .-sun4v_ldc_tx_qconf
-
- /* %o0: channel
- * %o1: pointer to unsigned long ra
- * %o2: pointer to unsigned long num_entries
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_tx_qinfo
- .type sun4v_ldc_tx_qinfo,#function
-sun4v_ldc_tx_qinfo:
- mov %o1, %g1
- mov %o2, %g2
- mov HV_FAST_LDC_TX_QINFO, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- stx %o2, [%g2]
- retl
- nop
- .size sun4v_ldc_tx_qinfo, .-sun4v_ldc_tx_qinfo
-
- /* %o0: channel
- * %o1: pointer to unsigned long head_off
- * %o2: pointer to unsigned long tail_off
- * %o2: pointer to unsigned long chan_state
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_tx_get_state
- .type sun4v_ldc_tx_get_state,#function
-sun4v_ldc_tx_get_state:
- mov %o1, %g1
- mov %o2, %g2
- mov %o3, %g3
- mov HV_FAST_LDC_TX_GET_STATE, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- stx %o2, [%g2]
- stx %o3, [%g3]
- retl
- nop
- .size sun4v_ldc_tx_get_state, .-sun4v_ldc_tx_get_state
-
- /* %o0: channel
- * %o1: tail_off
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_tx_set_qtail
- .type sun4v_ldc_tx_set_qtail,#function
-sun4v_ldc_tx_set_qtail:
- mov HV_FAST_LDC_TX_SET_QTAIL, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_ldc_tx_set_qtail, .-sun4v_ldc_tx_set_qtail
-
- /* %o0: channel
- * %o1: ra
- * %o2: num_entries
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_rx_qconf
- .type sun4v_ldc_rx_qconf,#function
-sun4v_ldc_rx_qconf:
- mov HV_FAST_LDC_RX_QCONF, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_ldc_rx_qconf, .-sun4v_ldc_rx_qconf
-
- /* %o0: channel
- * %o1: pointer to unsigned long ra
- * %o2: pointer to unsigned long num_entries
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_rx_qinfo
- .type sun4v_ldc_rx_qinfo,#function
-sun4v_ldc_rx_qinfo:
- mov %o1, %g1
- mov %o2, %g2
- mov HV_FAST_LDC_RX_QINFO, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- stx %o2, [%g2]
- retl
- nop
- .size sun4v_ldc_rx_qinfo, .-sun4v_ldc_rx_qinfo
-
- /* %o0: channel
- * %o1: pointer to unsigned long head_off
- * %o2: pointer to unsigned long tail_off
- * %o2: pointer to unsigned long chan_state
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_rx_get_state
- .type sun4v_ldc_rx_get_state,#function
-sun4v_ldc_rx_get_state:
- mov %o1, %g1
- mov %o2, %g2
- mov %o3, %g3
- mov HV_FAST_LDC_RX_GET_STATE, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- stx %o2, [%g2]
- stx %o3, [%g3]
- retl
- nop
- .size sun4v_ldc_rx_get_state, .-sun4v_ldc_rx_get_state
-
- /* %o0: channel
- * %o1: head_off
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_rx_set_qhead
- .type sun4v_ldc_rx_set_qhead,#function
-sun4v_ldc_rx_set_qhead:
- mov HV_FAST_LDC_RX_SET_QHEAD, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_ldc_rx_set_qhead, .-sun4v_ldc_rx_set_qhead
-
- /* %o0: channel
- * %o1: ra
- * %o2: num_entries
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_set_map_table
- .type sun4v_ldc_set_map_table,#function
-sun4v_ldc_set_map_table:
- mov HV_FAST_LDC_SET_MAP_TABLE, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_ldc_set_map_table, .-sun4v_ldc_set_map_table
-
- /* %o0: channel
- * %o1: pointer to unsigned long ra
- * %o2: pointer to unsigned long num_entries
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_get_map_table
- .type sun4v_ldc_get_map_table,#function
-sun4v_ldc_get_map_table:
- mov %o1, %g1
- mov %o2, %g2
- mov HV_FAST_LDC_GET_MAP_TABLE, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- stx %o2, [%g2]
- retl
- nop
- .size sun4v_ldc_get_map_table, .-sun4v_ldc_get_map_table
-
- /* %o0: channel
- * %o1: dir_code
- * %o2: tgt_raddr
- * %o3: lcl_raddr
- * %o4: len
- * %o5: pointer to unsigned long actual_len
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_copy
- .type sun4v_ldc_copy,#function
-sun4v_ldc_copy:
- mov %o5, %g1
- mov HV_FAST_LDC_COPY, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- retl
- nop
- .size sun4v_ldc_copy, .-sun4v_ldc_copy
-
- /* %o0: channel
- * %o1: cookie
- * %o2: pointer to unsigned long ra
- * %o3: pointer to unsigned long perm
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_mapin
- .type sun4v_ldc_mapin,#function
-sun4v_ldc_mapin:
- mov %o2, %g1
- mov %o3, %g2
- mov HV_FAST_LDC_MAPIN, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- stx %o2, [%g2]
- retl
- nop
- .size sun4v_ldc_mapin, .-sun4v_ldc_mapin
-
- /* %o0: ra
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_unmap
- .type sun4v_ldc_unmap,#function
-sun4v_ldc_unmap:
- mov HV_FAST_LDC_UNMAP, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_ldc_unmap, .-sun4v_ldc_unmap
-
- /* %o0: cookie
- * %o1: mte_cookie
- *
- * returns %o0: status
- */
- .globl sun4v_ldc_revoke
- .type sun4v_ldc_revoke,#function
-sun4v_ldc_revoke:
- mov HV_FAST_LDC_REVOKE, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_ldc_revoke, .-sun4v_ldc_revoke
-
- /* %o0: device handle
- * %o1: device INO
- * %o2: pointer to unsigned long cookie
- *
- * returns %o0: status
- */
- .globl sun4v_vintr_get_cookie
- .type sun4v_vintr_get_cookie,#function
-sun4v_vintr_get_cookie:
- mov %o2, %g1
- mov HV_FAST_VINTR_GET_COOKIE, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- retl
- nop
- .size sun4v_vintr_get_cookie, .-sun4v_vintr_get_cookie
-
- /* %o0: device handle
- * %o1: device INO
- * %o2: cookie
- *
- * returns %o0: status
- */
- .globl sun4v_vintr_set_cookie
- .type sun4v_vintr_set_cookie,#function
-sun4v_vintr_set_cookie:
- mov HV_FAST_VINTR_SET_COOKIE, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_vintr_set_cookie, .-sun4v_vintr_set_cookie
-
- /* %o0: device handle
- * %o1: device INO
- * %o2: pointer to unsigned long valid_state
- *
- * returns %o0: status
- */
- .globl sun4v_vintr_get_valid
- .type sun4v_vintr_get_valid,#function
-sun4v_vintr_get_valid:
- mov %o2, %g1
- mov HV_FAST_VINTR_GET_VALID, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- retl
- nop
- .size sun4v_vintr_get_valid, .-sun4v_vintr_get_valid
-
- /* %o0: device handle
- * %o1: device INO
- * %o2: valid_state
- *
- * returns %o0: status
- */
- .globl sun4v_vintr_set_valid
- .type sun4v_vintr_set_valid,#function
-sun4v_vintr_set_valid:
- mov HV_FAST_VINTR_SET_VALID, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_vintr_set_valid, .-sun4v_vintr_set_valid
-
- /* %o0: device handle
- * %o1: device INO
- * %o2: pointer to unsigned long state
- *
- * returns %o0: status
- */
- .globl sun4v_vintr_get_state
- .type sun4v_vintr_get_state,#function
-sun4v_vintr_get_state:
- mov %o2, %g1
- mov HV_FAST_VINTR_GET_STATE, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- retl
- nop
- .size sun4v_vintr_get_state, .-sun4v_vintr_get_state
-
- /* %o0: device handle
- * %o1: device INO
- * %o2: state
- *
- * returns %o0: status
- */
- .globl sun4v_vintr_set_state
- .type sun4v_vintr_set_state,#function
-sun4v_vintr_set_state:
- mov HV_FAST_VINTR_SET_STATE, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_vintr_set_state, .-sun4v_vintr_set_state
-
- /* %o0: device handle
- * %o1: device INO
- * %o2: pointer to unsigned long cpuid
- *
- * returns %o0: status
- */
- .globl sun4v_vintr_get_target
- .type sun4v_vintr_get_target,#function
-sun4v_vintr_get_target:
- mov %o2, %g1
- mov HV_FAST_VINTR_GET_TARGET, %o5
- ta HV_FAST_TRAP
- stx %o1, [%g1]
- retl
- nop
- .size sun4v_vintr_get_target, .-sun4v_vintr_get_target
-
- /* %o0: device handle
- * %o1: device INO
- * %o2: cpuid
- *
- * returns %o0: status
- */
- .globl sun4v_vintr_set_target
- .type sun4v_vintr_set_target,#function
-sun4v_vintr_set_target:
- mov HV_FAST_VINTR_SET_TARGET, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_vintr_set_target, .-sun4v_vintr_set_target
-
- /* %o0: NCS sub-function
- * %o1: sub-function arg real-address
- * %o2: sub-function arg size
- *
- * returns %o0: status
- */
- .globl sun4v_ncs_request
- .type sun4v_ncs_request,#function
-sun4v_ncs_request:
- mov HV_FAST_NCS_REQUEST, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_ncs_request, .-sun4v_ncs_request
-
- .globl sun4v_scv_send
- .type sun4v_scv_send,#function
-sun4v_scv_send:
- save %sp, -192, %sp
- mov %i0, %o0
- mov %i1, %o1
- mov %i2, %o2
- mov HV_FAST_SVC_SEND, %o5
- ta HV_FAST_TRAP
- stx %o1, [%i3]
- ret
- restore
- .size sun4v_scv_send, .-sun4v_scv_send
-
- .globl sun4v_scv_recv
- .type sun4v_scv_recv,#function
-sun4v_scv_recv:
- save %sp, -192, %sp
- mov %i0, %o0
- mov %i1, %o1
- mov %i2, %o2
- mov HV_FAST_SVC_RECV, %o5
- ta HV_FAST_TRAP
- stx %o1, [%i3]
- ret
- restore
- .size sun4v_scv_recv, .-sun4v_scv_recv
-
- .globl sun4v_scv_getstatus
- .type sun4v_scv_getstatus,#function
-sun4v_scv_getstatus:
- mov HV_FAST_SVC_GETSTATUS, %o5
- mov %o1, %o4
- ta HV_FAST_TRAP
- stx %o1, [%o4]
- retl
- nop
- .size sun4v_scv_getstatus, .-sun4v_scv_getstatus
-
- .globl sun4v_scv_setstatus
- .type sun4v_scv_setstatus,#function
-sun4v_scv_setstatus:
- mov HV_FAST_SVC_SETSTATUS, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_scv_setstatus, .-sun4v_scv_setstatus
-
- .globl sun4v_scv_clrstatus
- .type sun4v_scv_clrstatus,#function
-sun4v_scv_clrstatus:
- mov HV_FAST_SVC_CLRSTATUS, %o5
- ta HV_FAST_TRAP
- retl
- nop
- .size sun4v_scv_clrstatus, .-sun4v_scv_clrstatus
diff --git a/trunk/arch/sparc64/kernel/head.S b/trunk/arch/sparc64/kernel/head.S
index 77259526cb15..baea10a98196 100644
--- a/trunk/arch/sparc64/kernel/head.S
+++ b/trunk/arch/sparc64/kernel/head.S
@@ -523,7 +523,7 @@ tlb_fixup_done:
#else
mov 0, %o0
#endif
- sth %o0, [%g6 + TI_CPU]
+ stb %o0, [%g6 + TI_CPU]
/* Off we go.... */
call start_kernel
@@ -653,54 +653,33 @@ setup_tba:
restore
sparc64_boot_end:
+#include "ktlb.S"
+#include "tsb.S"
#include "etrap.S"
#include "rtrap.S"
#include "winfixup.S"
#include "entry.S"
#include "sun4v_tlb_miss.S"
#include "sun4v_ivec.S"
-#include "ktlb.S"
-#include "tsb.S"
/*
* The following skip makes sure the trap table in ttable.S is aligned
* on a 32K boundary as required by the v9 specs for TBA register.
*
* We align to a 32K boundary, then we have the 32K kernel TSB,
- * the 64K kernel 4MB TSB, and then the 32K aligned trap table.
+ * then the 32K aligned trap table.
*/
1:
.skip 0x4000 + _start - 1b
-! 0x0000000000408000
-
.globl swapper_tsb
swapper_tsb:
.skip (32 * 1024)
- .globl swapper_4m_tsb
-swapper_4m_tsb:
- .skip (64 * 1024)
-
-! 0x0000000000420000
+! 0x0000000000408000
- /* Some care needs to be exercised if you try to move the
- * location of the trap table relative to other things. For
- * one thing there are br* instructions in some of the
- * trap table entires which branch back to code in ktlb.S
- * Those instructions can only handle a signed 16-bit
- * displacement.
- *
- * There is a binutils bug (bugzilla #4558) which causes
- * the relocation overflow checks for such instructions to
- * not be done correctly. So bintuils will not notice the
- * error and will instead write junk into the relocation and
- * you'll have an unbootable kernel.
- */
#include "ttable.S"
-! 0x0000000000428000
-
#include "systbls.S"
.data
diff --git a/trunk/arch/sparc64/kernel/hvapi.c b/trunk/arch/sparc64/kernel/hvapi.c
index f34f5d6181ef..f03ffc829c7a 100644
--- a/trunk/arch/sparc64/kernel/hvapi.c
+++ b/trunk/arch/sparc64/kernel/hvapi.c
@@ -9,7 +9,6 @@
#include
#include
-#include
/* If the hypervisor indicates that the API setting
* calls are unsupported, by returning HV_EBADTRAP or
@@ -108,7 +107,7 @@ int sun4v_hvapi_register(unsigned long group, unsigned long major,
p->minor = actual_minor;
ret = 0;
} else if (hv_ret == HV_EBADTRAP ||
- hv_ret == HV_ENOTSUPPORTED) {
+ HV_ENOTSUPPORTED) {
if (p->flags & FLAG_PRE_API) {
if (major == 1) {
p->major = 1;
@@ -180,8 +179,6 @@ void __init sun4v_hvapi_init(void)
if (sun4v_hvapi_register(group, major, &minor))
goto bad;
- sun4v_sstate_init();
-
return;
bad:
diff --git a/trunk/arch/sparc64/kernel/irq.c b/trunk/arch/sparc64/kernel/irq.c
index a36f8dd0c021..3edc18e1b818 100644
--- a/trunk/arch/sparc64/kernel/irq.c
+++ b/trunk/arch/sparc64/kernel/irq.c
@@ -171,6 +171,8 @@ int show_interrupts(struct seq_file *p, void *v)
return 0;
}
+extern unsigned long real_hard_smp_processor_id(void);
+
static unsigned int sun4u_compute_tid(unsigned long imap, unsigned long cpuid)
{
unsigned int tid;
@@ -692,20 +694,9 @@ void init_irqwork_curcpu(void)
trap_block[cpu].irq_worklist = 0;
}
-/* Please be very careful with register_one_mondo() and
- * sun4v_register_mondo_queues().
- *
- * On SMP this gets invoked from the CPU trampoline before
- * the cpu has fully taken over the trap table from OBP,
- * and it's kernel stack + %g6 thread register state is
- * not fully cooked yet.
- *
- * Therefore you cannot make any OBP calls, not even prom_printf,
- * from these two routines.
- */
-static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type, unsigned long qmask)
+static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type)
{
- unsigned long num_entries = (qmask + 1) / 64;
+ unsigned long num_entries = 128;
unsigned long status;
status = sun4v_cpu_qconf(type, paddr, num_entries);
@@ -720,58 +711,44 @@ static void __cpuinit sun4v_register_mondo_queues(int this_cpu)
{
struct trap_per_cpu *tb = &trap_block[this_cpu];
- register_one_mondo(tb->cpu_mondo_pa, HV_CPU_QUEUE_CPU_MONDO,
- tb->cpu_mondo_qmask);
- register_one_mondo(tb->dev_mondo_pa, HV_CPU_QUEUE_DEVICE_MONDO,
- tb->dev_mondo_qmask);
- register_one_mondo(tb->resum_mondo_pa, HV_CPU_QUEUE_RES_ERROR,
- tb->resum_qmask);
- register_one_mondo(tb->nonresum_mondo_pa, HV_CPU_QUEUE_NONRES_ERROR,
- tb->nonresum_qmask);
+ register_one_mondo(tb->cpu_mondo_pa, HV_CPU_QUEUE_CPU_MONDO);
+ register_one_mondo(tb->dev_mondo_pa, HV_CPU_QUEUE_DEVICE_MONDO);
+ register_one_mondo(tb->resum_mondo_pa, HV_CPU_QUEUE_RES_ERROR);
+ register_one_mondo(tb->nonresum_mondo_pa, HV_CPU_QUEUE_NONRES_ERROR);
}
-static void __cpuinit alloc_one_mondo(unsigned long *pa_ptr, unsigned long qmask, int use_bootmem)
+static void __cpuinit alloc_one_mondo(unsigned long *pa_ptr, int use_bootmem)
{
- unsigned long size = PAGE_ALIGN(qmask + 1);
- unsigned long order = get_order(size);
- void *p = NULL;
+ void *page;
- if (use_bootmem) {
- p = __alloc_bootmem_low(size, size, 0);
- } else {
- struct page *page = alloc_pages(GFP_ATOMIC | __GFP_ZERO, order);
- if (page)
- p = page_address(page);
- }
+ if (use_bootmem)
+ page = alloc_bootmem_low_pages(PAGE_SIZE);
+ else
+ page = (void *) get_zeroed_page(GFP_ATOMIC);
- if (!p) {
+ if (!page) {
prom_printf("SUN4V: Error, cannot allocate mondo queue.\n");
prom_halt();
}
- *pa_ptr = __pa(p);
+ *pa_ptr = __pa(page);
}
-static void __cpuinit alloc_one_kbuf(unsigned long *pa_ptr, unsigned long qmask, int use_bootmem)
+static void __cpuinit alloc_one_kbuf(unsigned long *pa_ptr, int use_bootmem)
{
- unsigned long size = PAGE_ALIGN(qmask + 1);
- unsigned long order = get_order(size);
- void *p = NULL;
+ void *page;
- if (use_bootmem) {
- p = __alloc_bootmem_low(size, size, 0);
- } else {
- struct page *page = alloc_pages(GFP_ATOMIC | __GFP_ZERO, order);
- if (page)
- p = page_address(page);
- }
+ if (use_bootmem)
+ page = alloc_bootmem_low_pages(PAGE_SIZE);
+ else
+ page = (void *) get_zeroed_page(GFP_ATOMIC);
- if (!p) {
+ if (!page) {
prom_printf("SUN4V: Error, cannot allocate kbuf page.\n");
prom_halt();
}
- *pa_ptr = __pa(p);
+ *pa_ptr = __pa(page);
}
static void __cpuinit init_cpu_send_mondo_info(struct trap_per_cpu *tb, int use_bootmem)
@@ -802,12 +779,12 @@ void __cpuinit sun4v_init_mondo_queues(int use_bootmem, int cpu, int alloc, int
struct trap_per_cpu *tb = &trap_block[cpu];
if (alloc) {
- alloc_one_mondo(&tb->cpu_mondo_pa, tb->cpu_mondo_qmask, use_bootmem);
- alloc_one_mondo(&tb->dev_mondo_pa, tb->dev_mondo_qmask, use_bootmem);
- alloc_one_mondo(&tb->resum_mondo_pa, tb->resum_qmask, use_bootmem);
- alloc_one_kbuf(&tb->resum_kernel_buf_pa, tb->resum_qmask, use_bootmem);
- alloc_one_mondo(&tb->nonresum_mondo_pa, tb->nonresum_qmask, use_bootmem);
- alloc_one_kbuf(&tb->nonresum_kernel_buf_pa, tb->nonresum_qmask, use_bootmem);
+ alloc_one_mondo(&tb->cpu_mondo_pa, use_bootmem);
+ alloc_one_mondo(&tb->dev_mondo_pa, use_bootmem);
+ alloc_one_mondo(&tb->resum_mondo_pa, use_bootmem);
+ alloc_one_kbuf(&tb->resum_kernel_buf_pa, use_bootmem);
+ alloc_one_mondo(&tb->nonresum_mondo_pa, use_bootmem);
+ alloc_one_kbuf(&tb->nonresum_kernel_buf_pa, use_bootmem);
init_cpu_send_mondo_info(tb, use_bootmem);
}
diff --git a/trunk/arch/sparc64/kernel/itlb_miss.S b/trunk/arch/sparc64/kernel/itlb_miss.S
index 5a8377b54955..ad46e2024f4b 100644
--- a/trunk/arch/sparc64/kernel/itlb_miss.S
+++ b/trunk/arch/sparc64/kernel/itlb_miss.S
@@ -11,12 +11,12 @@
/* ITLB ** ICACHE line 2: TSB compare and TLB load */
bne,pn %xcc, tsb_miss_itlb ! Miss
mov FAULT_CODE_ITLB, %g3
- sethi %hi(_PAGE_EXEC_4U), %g4
- andcc %g5, %g4, %g0 ! Executable?
+ andcc %g5, _PAGE_EXEC_4U, %g0 ! Executable?
be,pn %xcc, tsb_do_fault
nop ! Delay slot, fill me
stxa %g5, [%g0] ASI_ITLB_DATA_IN ! Load TLB
retry ! Trap done
+ nop
/* ITLB ** ICACHE line 3: */
nop
diff --git a/trunk/arch/sparc64/kernel/mdesc.c b/trunk/arch/sparc64/kernel/mdesc.c
deleted file mode 100644
index 9246c2cf9574..000000000000
--- a/trunk/arch/sparc64/kernel/mdesc.c
+++ /dev/null
@@ -1,619 +0,0 @@
-/* mdesc.c: Sun4V machine description handling.
- *
- * Copyright (C) 2007 David S. Miller
- */
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-/* Unlike the OBP device tree, the machine description is a full-on
- * DAG. An arbitrary number of ARCs are possible from one
- * node to other nodes and thus we can't use the OBP device_node
- * data structure to represent these nodes inside of the kernel.
- *
- * Actually, it isn't even a DAG, because there are back pointers
- * which create cycles in the graph.
- *
- * mdesc_hdr and mdesc_elem describe the layout of the data structure
- * we get from the Hypervisor.
- */
-struct mdesc_hdr {
- u32 version; /* Transport version */
- u32 node_sz; /* node block size */
- u32 name_sz; /* name block size */
- u32 data_sz; /* data block size */
-};
-
-struct mdesc_elem {
- u8 tag;
-#define MD_LIST_END 0x00
-#define MD_NODE 0x4e
-#define MD_NODE_END 0x45
-#define MD_NOOP 0x20
-#define MD_PROP_ARC 0x61
-#define MD_PROP_VAL 0x76
-#define MD_PROP_STR 0x73
-#define MD_PROP_DATA 0x64
- u8 name_len;
- u16 resv;
- u32 name_offset;
- union {
- struct {
- u32 data_len;
- u32 data_offset;
- } data;
- u64 val;
- } d;
-};
-
-static struct mdesc_hdr *main_mdesc;
-static struct mdesc_node *allnodes;
-
-static struct mdesc_node *allnodes_tail;
-static unsigned int unique_id;
-
-static struct mdesc_node **mdesc_hash;
-static unsigned int mdesc_hash_size;
-
-static inline unsigned int node_hashfn(u64 node)
-{
- return ((unsigned int) (node ^ (node >> 8) ^ (node >> 16)))
- & (mdesc_hash_size - 1);
-}
-
-static inline void hash_node(struct mdesc_node *mp)
-{
- struct mdesc_node **head = &mdesc_hash[node_hashfn(mp->node)];
-
- mp->hash_next = *head;
- *head = mp;
-
- if (allnodes_tail) {
- allnodes_tail->allnodes_next = mp;
- allnodes_tail = mp;
- } else {
- allnodes = allnodes_tail = mp;
- }
-}
-
-static struct mdesc_node *find_node(u64 node)
-{
- struct mdesc_node *mp = mdesc_hash[node_hashfn(node)];
-
- while (mp) {
- if (mp->node == node)
- return mp;
-
- mp = mp->hash_next;
- }
- return NULL;
-}
-
-struct property *md_find_property(const struct mdesc_node *mp,
- const char *name,
- int *lenp)
-{
- struct property *pp;
-
- for (pp = mp->properties; pp != 0; pp = pp->next) {
- if (strcasecmp(pp->name, name) == 0) {
- if (lenp)
- *lenp = pp->length;
- break;
- }
- }
- return pp;
-}
-EXPORT_SYMBOL(md_find_property);
-
-/*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *md_get_property(const struct mdesc_node *mp, const char *name,
- int *lenp)
-{
- struct property *pp = md_find_property(mp, name, lenp);
- return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(md_get_property);
-
-struct mdesc_node *md_find_node_by_name(struct mdesc_node *from,
- const char *name)
-{
- struct mdesc_node *mp;
-
- mp = from ? from->allnodes_next : allnodes;
- for (; mp != NULL; mp = mp->allnodes_next) {
- if (strcmp(mp->name, name) == 0)
- break;
- }
- return mp;
-}
-EXPORT_SYMBOL(md_find_node_by_name);
-
-static unsigned int mdesc_early_allocated;
-
-static void * __init mdesc_early_alloc(unsigned long size)
-{
- void *ret;
-
- ret = __alloc_bootmem(size, SMP_CACHE_BYTES, 0UL);
- if (ret == NULL) {
- prom_printf("MDESC: alloc of %lu bytes failed.\n", size);
- prom_halt();
- }
-
- memset(ret, 0, size);
-
- mdesc_early_allocated += size;
-
- return ret;
-}
-
-static unsigned int __init count_arcs(struct mdesc_elem *ep)
-{
- unsigned int ret = 0;
-
- ep++;
- while (ep->tag != MD_NODE_END) {
- if (ep->tag == MD_PROP_ARC)
- ret++;
- ep++;
- }
- return ret;
-}
-
-static void __init mdesc_node_alloc(u64 node, struct mdesc_elem *ep, const char *names)
-{
- unsigned int num_arcs = count_arcs(ep);
- struct mdesc_node *mp;
-
- mp = mdesc_early_alloc(sizeof(*mp) +
- (num_arcs * sizeof(struct mdesc_arc)));
- mp->name = names + ep->name_offset;
- mp->node = node;
- mp->unique_id = unique_id++;
- mp->num_arcs = num_arcs;
-
- hash_node(mp);
-}
-
-static inline struct mdesc_elem *node_block(struct mdesc_hdr *mdesc)
-{
- return (struct mdesc_elem *) (mdesc + 1);
-}
-
-static inline void *name_block(struct mdesc_hdr *mdesc)
-{
- return ((void *) node_block(mdesc)) + mdesc->node_sz;
-}
-
-static inline void *data_block(struct mdesc_hdr *mdesc)
-{
- return ((void *) name_block(mdesc)) + mdesc->name_sz;
-}
-
-/* In order to avoid recursion (the graph can be very deep) we use a
- * two pass algorithm. First we allocate all the nodes and hash them.
- * Then we iterate over each node, filling in the arcs and properties.
- */
-static void __init build_all_nodes(struct mdesc_hdr *mdesc)
-{
- struct mdesc_elem *start, *ep;
- struct mdesc_node *mp;
- const char *names;
- void *data;
- u64 last_node;
-
- start = ep = node_block(mdesc);
- last_node = mdesc->node_sz / 16;
-
- names = name_block(mdesc);
-
- while (1) {
- u64 node = ep - start;
-
- if (ep->tag == MD_LIST_END)
- break;
-
- if (ep->tag != MD_NODE) {
- prom_printf("MDESC: Inconsistent element list.\n");
- prom_halt();
- }
-
- mdesc_node_alloc(node, ep, names);
-
- if (ep->d.val >= last_node) {
- printk("MDESC: Warning, early break out of node scan.\n");
- printk("MDESC: Next node [%lu] last_node [%lu].\n",
- node, last_node);
- break;
- }
-
- ep = start + ep->d.val;
- }
-
- data = data_block(mdesc);
- for (mp = allnodes; mp; mp = mp->allnodes_next) {
- struct mdesc_elem *ep = start + mp->node;
- struct property **link = &mp->properties;
- unsigned int this_arc = 0;
-
- ep++;
- while (ep->tag != MD_NODE_END) {
- switch (ep->tag) {
- case MD_PROP_ARC: {
- struct mdesc_node *target;
-
- if (this_arc >= mp->num_arcs) {
- prom_printf("MDESC: ARC overrun [%u:%u]\n",
- this_arc, mp->num_arcs);
- prom_halt();
- }
- target = find_node(ep->d.val);
- if (!target) {
- printk("MDESC: Warning, arc points to "
- "missing node, ignoring.\n");
- break;
- }
- mp->arcs[this_arc].name =
- (names + ep->name_offset);
- mp->arcs[this_arc].arc = target;
- this_arc++;
- break;
- }
-
- case MD_PROP_VAL:
- case MD_PROP_STR:
- case MD_PROP_DATA: {
- struct property *p = mdesc_early_alloc(sizeof(*p));
-
- p->unique_id = unique_id++;
- p->name = (char *) names + ep->name_offset;
- if (ep->tag == MD_PROP_VAL) {
- p->value = &ep->d.val;
- p->length = 8;
- } else {
- p->value = data + ep->d.data.data_offset;
- p->length = ep->d.data.data_len;
- }
- *link = p;
- link = &p->next;
- break;
- }
-
- case MD_NOOP:
- break;
-
- default:
- printk("MDESC: Warning, ignoring unknown tag type %02x\n",
- ep->tag);
- }
- ep++;
- }
- }
-}
-
-static unsigned int __init count_nodes(struct mdesc_hdr *mdesc)
-{
- struct mdesc_elem *ep = node_block(mdesc);
- struct mdesc_elem *end;
- unsigned int cnt = 0;
-
- end = ((void *)ep) + mdesc->node_sz;
- while (ep < end) {
- if (ep->tag == MD_NODE)
- cnt++;
- ep++;
- }
- return cnt;
-}
-
-static void __init report_platform_properties(void)
-{
- struct mdesc_node *pn = md_find_node_by_name(NULL, "platform");
- const char *s;
- const u64 *v;
-
- if (!pn) {
- prom_printf("No platform node in machine-description.\n");
- prom_halt();
- }
-
- s = md_get_property(pn, "banner-name", NULL);
- printk("PLATFORM: banner-name [%s]\n", s);
- s = md_get_property(pn, "name", NULL);
- printk("PLATFORM: name [%s]\n", s);
-
- v = md_get_property(pn, "hostid", NULL);
- if (v)
- printk("PLATFORM: hostid [%08lx]\n", *v);
- v = md_get_property(pn, "serial#", NULL);
- if (v)
- printk("PLATFORM: serial# [%08lx]\n", *v);
- v = md_get_property(pn, "stick-frequency", NULL);
- printk("PLATFORM: stick-frequency [%08lx]\n", *v);
- v = md_get_property(pn, "mac-address", NULL);
- if (v)
- printk("PLATFORM: mac-address [%lx]\n", *v);
- v = md_get_property(pn, "watchdog-resolution", NULL);
- if (v)
- printk("PLATFORM: watchdog-resolution [%lu ms]\n", *v);
- v = md_get_property(pn, "watchdog-max-timeout", NULL);
- if (v)
- printk("PLATFORM: watchdog-max-timeout [%lu ms]\n", *v);
- v = md_get_property(pn, "max-cpus", NULL);
- if (v)
- printk("PLATFORM: max-cpus [%lu]\n", *v);
-}
-
-static int inline find_in_proplist(const char *list, const char *match, int len)
-{
- while (len > 0) {
- int l;
-
- if (!strcmp(list, match))
- return 1;
- l = strlen(list) + 1;
- list += l;
- len -= l;
- }
- return 0;
-}
-
-static void __init fill_in_one_cache(cpuinfo_sparc *c, struct mdesc_node *mp)
-{
- const u64 *level = md_get_property(mp, "level", NULL);
- const u64 *size = md_get_property(mp, "size", NULL);
- const u64 *line_size = md_get_property(mp, "line-size", NULL);
- const char *type;
- int type_len;
-
- type = md_get_property(mp, "type", &type_len);
-
- switch (*level) {
- case 1:
- if (find_in_proplist(type, "instn", type_len)) {
- c->icache_size = *size;
- c->icache_line_size = *line_size;
- } else if (find_in_proplist(type, "data", type_len)) {
- c->dcache_size = *size;
- c->dcache_line_size = *line_size;
- }
- break;
-
- case 2:
- c->ecache_size = *size;
- c->ecache_line_size = *line_size;
- break;
-
- default:
- break;
- }
-
- if (*level == 1) {
- unsigned int i;
-
- for (i = 0; i < mp->num_arcs; i++) {
- struct mdesc_node *t = mp->arcs[i].arc;
-
- if (strcmp(mp->arcs[i].name, "fwd"))
- continue;
-
- if (!strcmp(t->name, "cache"))
- fill_in_one_cache(c, t);
- }
- }
-}
-
-static void __init mark_core_ids(struct mdesc_node *mp, int core_id)
-{
- unsigned int i;
-
- for (i = 0; i < mp->num_arcs; i++) {
- struct mdesc_node *t = mp->arcs[i].arc;
- const u64 *id;
-
- if (strcmp(mp->arcs[i].name, "back"))
- continue;
-
- if (!strcmp(t->name, "cpu")) {
- id = md_get_property(t, "id", NULL);
- if (*id < NR_CPUS)
- cpu_data(*id).core_id = core_id;
- } else {
- unsigned int j;
-
- for (j = 0; j < t->num_arcs; j++) {
- struct mdesc_node *n = t->arcs[j].arc;
-
- if (strcmp(t->arcs[j].name, "back"))
- continue;
-
- if (strcmp(n->name, "cpu"))
- continue;
-
- id = md_get_property(n, "id", NULL);
- if (*id < NR_CPUS)
- cpu_data(*id).core_id = core_id;
- }
- }
- }
-}
-
-static void __init set_core_ids(void)
-{
- struct mdesc_node *mp;
- int idx;
-
- idx = 1;
- md_for_each_node_by_name(mp, "cache") {
- const u64 *level = md_get_property(mp, "level", NULL);
- const char *type;
- int len;
-
- if (*level != 1)
- continue;
-
- type = md_get_property(mp, "type", &len);
- if (!find_in_proplist(type, "instn", len))
- continue;
-
- mark_core_ids(mp, idx);
-
- idx++;
- }
-}
-
-static void __init get_one_mondo_bits(const u64 *p, unsigned int *mask, unsigned char def)
-{
- u64 val;
-
- if (!p)
- goto use_default;
- val = *p;
-
- if (!val || val >= 64)
- goto use_default;
-
- *mask = ((1U << val) * 64U) - 1U;
- return;
-
-use_default:
- *mask = ((1U << def) * 64U) - 1U;
-}
-
-static void __init get_mondo_data(struct mdesc_node *mp, struct trap_per_cpu *tb)
-{
- const u64 *val;
-
- val = md_get_property(mp, "q-cpu-mondo-#bits", NULL);
- get_one_mondo_bits(val, &tb->cpu_mondo_qmask, 7);
-
- val = md_get_property(mp, "q-dev-mondo-#bits", NULL);
- get_one_mondo_bits(val, &tb->dev_mondo_qmask, 7);
-
- val = md_get_property(mp, "q-resumable-#bits", NULL);
- get_one_mondo_bits(val, &tb->resum_qmask, 6);
-
- val = md_get_property(mp, "q-nonresumable-#bits", NULL);
- get_one_mondo_bits(val, &tb->nonresum_qmask, 2);
-}
-
-static void __init mdesc_fill_in_cpu_data(void)
-{
- struct mdesc_node *mp;
-
- ncpus_probed = 0;
- md_for_each_node_by_name(mp, "cpu") {
- const u64 *id = md_get_property(mp, "id", NULL);
- const u64 *cfreq = md_get_property(mp, "clock-frequency", NULL);
- struct trap_per_cpu *tb;
- cpuinfo_sparc *c;
- unsigned int i;
- int cpuid;
-
- ncpus_probed++;
-
- cpuid = *id;
-
-#ifdef CONFIG_SMP
- if (cpuid >= NR_CPUS)
- continue;
-#else
- /* On uniprocessor we only want the values for the
- * real physical cpu the kernel booted onto, however
- * cpu_data() only has one entry at index 0.
- */
- if (cpuid != real_hard_smp_processor_id())
- continue;
- cpuid = 0;
-#endif
-
- c = &cpu_data(cpuid);
- c->clock_tick = *cfreq;
-
- tb = &trap_block[cpuid];
- get_mondo_data(mp, tb);
-
- for (i = 0; i < mp->num_arcs; i++) {
- struct mdesc_node *t = mp->arcs[i].arc;
- unsigned int j;
-
- if (strcmp(mp->arcs[i].name, "fwd"))
- continue;
-
- if (!strcmp(t->name, "cache")) {
- fill_in_one_cache(c, t);
- continue;
- }
-
- for (j = 0; j < t->num_arcs; j++) {
- struct mdesc_node *n;
-
- n = t->arcs[j].arc;
- if (strcmp(t->arcs[j].name, "fwd"))
- continue;
-
- if (!strcmp(n->name, "cache"))
- fill_in_one_cache(c, n);
- }
- }
-
-#ifdef CONFIG_SMP
- cpu_set(cpuid, cpu_present_map);
- cpu_set(cpuid, phys_cpu_present_map);
-#endif
-
- c->core_id = 0;
- }
-
- set_core_ids();
-
- smp_fill_in_sib_core_maps();
-}
-
-void __init sun4v_mdesc_init(void)
-{
- unsigned long len, real_len, status;
-
- (void) sun4v_mach_desc(0UL, 0UL, &len);
-
- printk("MDESC: Size is %lu bytes.\n", len);
-
- main_mdesc = mdesc_early_alloc(len);
-
- status = sun4v_mach_desc(__pa(main_mdesc), len, &real_len);
- if (status != HV_EOK || real_len > len) {
- prom_printf("sun4v_mach_desc fails, err(%lu), "
- "len(%lu), real_len(%lu)\n",
- status, len, real_len);
- prom_halt();
- }
-
- len = count_nodes(main_mdesc);
- printk("MDESC: %lu nodes.\n", len);
-
- len = roundup_pow_of_two(len);
-
- mdesc_hash = mdesc_early_alloc(len * sizeof(struct mdesc_node *));
- mdesc_hash_size = len;
-
- printk("MDESC: Hash size %lu entries.\n", len);
-
- build_all_nodes(main_mdesc);
-
- printk("MDESC: Built graph with %u bytes of memory.\n",
- mdesc_early_allocated);
-
- report_platform_properties();
- mdesc_fill_in_cpu_data();
-}
diff --git a/trunk/arch/sparc64/kernel/pci.c b/trunk/arch/sparc64/kernel/pci.c
index 38a32bc95d22..d4c077dc5e85 100644
--- a/trunk/arch/sparc64/kernel/pci.c
+++ b/trunk/arch/sparc64/kernel/pci.c
@@ -306,20 +306,6 @@ static void __init pci_controller_probe(void)
pci_controller_scan(pci_controller_init);
}
-static int ofpci_verbose;
-
-static int __init ofpci_debug(char *str)
-{
- int val = 0;
-
- get_option(&str, &val);
- if (val)
- ofpci_verbose = 1;
- return 1;
-}
-
-__setup("ofpci_debug=", ofpci_debug);
-
static unsigned long pci_parse_of_flags(u32 addr0)
{
unsigned long flags = 0;
@@ -351,9 +337,7 @@ static void pci_parse_of_addrs(struct of_device *op,
addrs = of_get_property(node, "assigned-addresses", &proplen);
if (!addrs)
return;
- if (ofpci_verbose)
- printk(" parse addresses (%d bytes) @ %p\n",
- proplen, addrs);
+ printk(" parse addresses (%d bytes) @ %p\n", proplen, addrs);
op_res = &op->resource[0];
for (; proplen >= 20; proplen -= 20, addrs += 5, op_res++) {
struct resource *res;
@@ -364,9 +348,8 @@ static void pci_parse_of_addrs(struct of_device *op,
if (!flags)
continue;
i = addrs[0] & 0xff;
- if (ofpci_verbose)
- printk(" start: %lx, end: %lx, i: %x\n",
- op_res->start, op_res->end, i);
+ printk(" start: %lx, end: %lx, i: %x\n",
+ op_res->start, op_res->end, i);
if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) {
res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2];
@@ -410,9 +393,8 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
if (type == NULL)
type = "";
- if (ofpci_verbose)
- printk(" create device, devfn: %x, type: %s\n",
- devfn, type);
+ printk(" create device, devfn: %x, type: %s hostcontroller(%d)\n",
+ devfn, type, host_controller);
dev->bus = bus;
dev->sysdata = node;
@@ -452,9 +434,8 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
}
- if (ofpci_verbose)
- printk(" class: 0x%x device name: %s\n",
- dev->class, pci_name(dev));
+ printk(" class: 0x%x device name: %s\n",
+ dev->class, pci_name(dev));
/* I have seen IDE devices which will not respond to
* the bmdma simplex check reads if bus mastering is
@@ -488,8 +469,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
}
pci_parse_of_addrs(sd->op, node, dev);
- if (ofpci_verbose)
- printk(" adding to system ...\n");
+ printk(" adding to system ...\n");
pci_device_add(dev, bus);
@@ -567,8 +547,7 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
unsigned int flags;
u64 size;
- if (ofpci_verbose)
- printk("of_scan_pci_bridge(%s)\n", node->full_name);
+ printk("of_scan_pci_bridge(%s)\n", node->full_name);
/* parse bus-range property */
busrange = of_get_property(node, "bus-range", &len);
@@ -653,8 +632,7 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
simba_cont:
sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
bus->number);
- if (ofpci_verbose)
- printk(" bus name: %s\n", bus->name);
+ printk(" bus name: %s\n", bus->name);
pci_of_scan_bus(pbm, node, bus);
}
@@ -668,14 +646,12 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
int reglen, devfn;
struct pci_dev *dev;
- if (ofpci_verbose)
- printk("PCI: scan_bus[%s] bus no %d\n",
- node->full_name, bus->number);
+ printk("PCI: scan_bus[%s] bus no %d\n",
+ node->full_name, bus->number);
child = NULL;
while ((child = of_get_next_child(node, child)) != NULL) {
- if (ofpci_verbose)
- printk(" * %s\n", child->full_name);
+ printk(" * %s\n", child->full_name);
reg = of_get_property(child, "reg", ®len);
if (reg == NULL || reglen < 20)
continue;
@@ -685,9 +661,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
dev = of_create_pci_dev(pbm, child, bus, devfn, 0);
if (!dev)
continue;
- if (ofpci_verbose)
- printk("PCI: dev header type: %x\n",
- dev->hdr_type);
+ printk("PCI: dev header type: %x\n", dev->hdr_type);
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
diff --git a/trunk/arch/sparc64/kernel/pci_sabre.c b/trunk/arch/sparc64/kernel/pci_sabre.c
index 323d6c278518..e2377796de89 100644
--- a/trunk/arch/sparc64/kernel/pci_sabre.c
+++ b/trunk/arch/sparc64/kernel/pci_sabre.c
@@ -762,10 +762,9 @@ void sabre_init(struct device_node *dp, char *model_name)
/* Of course, Sun has to encode things a thousand
* different ways, inconsistently.
*/
- for_each_node_by_type(dp, "cpu") {
- if (!strcmp(dp->name, "SUNW,UltraSPARC-IIe"))
- hummingbird_p = 1;
- }
+ cpu_find_by_instance(0, &dp, NULL);
+ if (!strcmp(dp->name, "SUNW,UltraSPARC-IIe"))
+ hummingbird_p = 1;
}
}
diff --git a/trunk/arch/sparc64/kernel/pci_sun4v.c b/trunk/arch/sparc64/kernel/pci_sun4v.c
index 6b3fe2c1d65e..044e8ec4c0f5 100644
--- a/trunk/arch/sparc64/kernel/pci_sun4v.c
+++ b/trunk/arch/sparc64/kernel/pci_sun4v.c
@@ -12,7 +12,6 @@
#include
#include
#include
-#include
#include
#include
@@ -27,9 +26,6 @@
#include "pci_sun4v.h"
-static unsigned long vpci_major = 1;
-static unsigned long vpci_minor = 1;
-
#define PGLIST_NENTS (PAGE_SIZE / sizeof(u64))
struct iommu_batch {
@@ -642,8 +638,9 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
{
struct iommu *iommu = pbm->iommu;
struct property *prop;
- unsigned long num_tsb_entries, sz, tsbsize;
+ unsigned long num_tsb_entries, sz;
u32 vdma[2], dma_mask, dma_offset;
+ int tsbsize;
prop = of_find_property(pbm->prom_node, "virtual-dma", NULL);
if (prop) {
@@ -657,15 +654,31 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
vdma[1] = 0x80000000;
}
- if ((vdma[0] | vdma[1]) & ~IO_PAGE_MASK) {
- prom_printf("PCI-SUN4V: strange virtual-dma[%08x:%08x].\n",
- vdma[0], vdma[1]);
- prom_halt();
+ dma_mask = vdma[0];
+ switch (vdma[1]) {
+ case 0x20000000:
+ dma_mask |= 0x1fffffff;
+ tsbsize = 64;
+ break;
+
+ case 0x40000000:
+ dma_mask |= 0x3fffffff;
+ tsbsize = 128;
+ break;
+
+ case 0x80000000:
+ dma_mask |= 0x7fffffff;
+ tsbsize = 256;
+ break;
+
+ default:
+ prom_printf("PCI-SUN4V: strange virtual-dma size.\n");
+ prom_halt();
};
- dma_mask = (roundup_pow_of_two(vdma[1]) - 1UL);
- num_tsb_entries = vdma[1] / IO_PAGE_SIZE;
- tsbsize = num_tsb_entries * sizeof(iopte_t);
+ tsbsize *= (8 * 1024);
+
+ num_tsb_entries = tsbsize / sizeof(iopte_t);
dma_offset = vdma[0];
@@ -676,7 +689,7 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
iommu->dma_addr_mask = dma_mask;
/* Allocate and initialize the free area map. */
- sz = (num_tsb_entries + 7) / 8;
+ sz = num_tsb_entries / 8;
sz = (sz + 7UL) & ~7UL;
iommu->arena.map = kzalloc(sz, GFP_KERNEL);
if (!iommu->arena.map) {
@@ -1165,7 +1178,6 @@ static void pci_sun4v_pbm_init(struct pci_controller_info *p, struct device_node
void sun4v_pci_init(struct device_node *dp, char *model_name)
{
- static int hvapi_negotiated = 0;
struct pci_controller_info *p;
struct pci_pbm_info *pbm;
struct iommu *iommu;
@@ -1174,20 +1186,6 @@ void sun4v_pci_init(struct device_node *dp, char *model_name)
u32 devhandle;
int i;
- if (!hvapi_negotiated++) {
- int err = sun4v_hvapi_register(HV_GRP_PCI,
- vpci_major,
- &vpci_minor);
-
- if (err) {
- prom_printf("SUN4V_PCI: Could not register hvapi, "
- "err=%d\n", err);
- prom_halt();
- }
- printk("SUN4V_PCI: Registered hvapi major[%lu] minor[%lu]\n",
- vpci_major, vpci_minor);
- }
-
prop = of_find_property(dp, "reg", NULL);
regs = prop->value;
diff --git a/trunk/arch/sparc64/kernel/power.c b/trunk/arch/sparc64/kernel/power.c
index 5d6adea3967f..699b24b890df 100644
--- a/trunk/arch/sparc64/kernel/power.c
+++ b/trunk/arch/sparc64/kernel/power.c
@@ -19,7 +19,6 @@
#include
#include
#include
-#include
#include
@@ -54,7 +53,6 @@ static void (*poweroff_method)(void) = machine_alt_power_off;
void machine_power_off(void)
{
- sstate_poweroff();
if (!serial_console || scons_pwroff) {
#ifdef CONFIG_PCI
if (power_reg) {
diff --git a/trunk/arch/sparc64/kernel/process.c b/trunk/arch/sparc64/kernel/process.c
index f5f97e2c669c..952762bfb4c0 100644
--- a/trunk/arch/sparc64/kernel/process.c
+++ b/trunk/arch/sparc64/kernel/process.c
@@ -45,7 +45,6 @@
#include
#include
#include
-#include
/* #define VERBOSE_SHOWREGS */
@@ -107,7 +106,6 @@ extern void (*prom_keyboard)(void);
void machine_halt(void)
{
- sstate_halt();
if (!serial_console && prom_palette)
prom_palette (1);
if (prom_keyboard)
@@ -118,7 +116,6 @@ void machine_halt(void)
void machine_alt_power_off(void)
{
- sstate_poweroff();
if (!serial_console && prom_palette)
prom_palette(1);
if (prom_keyboard)
@@ -131,7 +128,6 @@ void machine_restart(char * cmd)
{
char *p;
- sstate_reboot();
p = strchr (reboot_command, '\n');
if (p) *p = 0;
if (!serial_console && prom_palette)
diff --git a/trunk/arch/sparc64/kernel/prom.c b/trunk/arch/sparc64/kernel/prom.c
index dad4b3ba705f..02830e4671f5 100644
--- a/trunk/arch/sparc64/kernel/prom.c
+++ b/trunk/arch/sparc64/kernel/prom.c
@@ -28,7 +28,6 @@
#include
#include
#include
-#include
static struct device_node *allnodes;
@@ -1666,150 +1665,6 @@ static struct device_node * __init build_tree(struct device_node *parent, phandl
return ret;
}
-static const char *get_mid_prop(void)
-{
- return (tlb_type == spitfire ? "upa-portid" : "portid");
-}
-
-struct device_node *of_find_node_by_cpuid(int cpuid)
-{
- struct device_node *dp;
- const char *mid_prop = get_mid_prop();
-
- for_each_node_by_type(dp, "cpu") {
- int id = of_getintprop_default(dp, mid_prop, -1);
- const char *this_mid_prop = mid_prop;
-
- if (id < 0) {
- this_mid_prop = "cpuid";
- id = of_getintprop_default(dp, this_mid_prop, -1);
- }
-
- if (id < 0) {
- prom_printf("OF: Serious problem, cpu lacks "
- "%s property", this_mid_prop);
- prom_halt();
- }
- if (cpuid == id)
- return dp;
- }
- return NULL;
-}
-
-static void __init of_fill_in_cpu_data(void)
-{
- struct device_node *dp;
- const char *mid_prop = get_mid_prop();
-
- ncpus_probed = 0;
- for_each_node_by_type(dp, "cpu") {
- int cpuid = of_getintprop_default(dp, mid_prop, -1);
- const char *this_mid_prop = mid_prop;
- struct device_node *portid_parent;
- int portid = -1;
-
- portid_parent = NULL;
- if (cpuid < 0) {
- this_mid_prop = "cpuid";
- cpuid = of_getintprop_default(dp, this_mid_prop, -1);
- if (cpuid >= 0) {
- int limit = 2;
-
- portid_parent = dp;
- while (limit--) {
- portid_parent = portid_parent->parent;
- if (!portid_parent)
- break;
- portid = of_getintprop_default(portid_parent,
- "portid", -1);
- if (portid >= 0)
- break;
- }
- }
- }
-
- if (cpuid < 0) {
- prom_printf("OF: Serious problem, cpu lacks "
- "%s property", this_mid_prop);
- prom_halt();
- }
-
- ncpus_probed++;
-
-#ifdef CONFIG_SMP
- if (cpuid >= NR_CPUS)
- continue;
-#else
- /* On uniprocessor we only want the values for the
- * real physical cpu the kernel booted onto, however
- * cpu_data() only has one entry at index 0.
- */
- if (cpuid != real_hard_smp_processor_id())
- continue;
- cpuid = 0;
-#endif
-
- cpu_data(cpuid).clock_tick =
- of_getintprop_default(dp, "clock-frequency", 0);
-
- if (portid_parent) {
- cpu_data(cpuid).dcache_size =
- of_getintprop_default(dp, "l1-dcache-size",
- 16 * 1024);
- cpu_data(cpuid).dcache_line_size =
- of_getintprop_default(dp, "l1-dcache-line-size",
- 32);
- cpu_data(cpuid).icache_size =
- of_getintprop_default(dp, "l1-icache-size",
- 8 * 1024);
- cpu_data(cpuid).icache_line_size =
- of_getintprop_default(dp, "l1-icache-line-size",
- 32);
- cpu_data(cpuid).ecache_size =
- of_getintprop_default(dp, "l2-cache-size", 0);
- cpu_data(cpuid).ecache_line_size =
- of_getintprop_default(dp, "l2-cache-line-size", 0);
- if (!cpu_data(cpuid).ecache_size ||
- !cpu_data(cpuid).ecache_line_size) {
- cpu_data(cpuid).ecache_size =
- of_getintprop_default(portid_parent,
- "l2-cache-size",
- (4 * 1024 * 1024));
- cpu_data(cpuid).ecache_line_size =
- of_getintprop_default(portid_parent,
- "l2-cache-line-size", 64);
- }
-
- cpu_data(cpuid).core_id = portid + 1;
- } else {
- cpu_data(cpuid).dcache_size =
- of_getintprop_default(dp, "dcache-size", 16 * 1024);
- cpu_data(cpuid).dcache_line_size =
- of_getintprop_default(dp, "dcache-line-size", 32);
-
- cpu_data(cpuid).icache_size =
- of_getintprop_default(dp, "icache-size", 16 * 1024);
- cpu_data(cpuid).icache_line_size =
- of_getintprop_default(dp, "icache-line-size", 32);
-
- cpu_data(cpuid).ecache_size =
- of_getintprop_default(dp, "ecache-size",
- (4 * 1024 * 1024));
- cpu_data(cpuid).ecache_line_size =
- of_getintprop_default(dp, "ecache-line-size", 64);
-
- cpu_data(cpuid).core_id = 0;
- }
-
-#ifdef CONFIG_SMP
- cpu_set(cpuid, cpu_present_map);
- cpu_set(cpuid, phys_cpu_present_map);
-#endif
- }
-
- smp_fill_in_sib_core_maps();
-}
-
void __init prom_build_devicetree(void)
{
struct device_node **nextp;
@@ -1824,7 +1679,4 @@ void __init prom_build_devicetree(void)
&nextp);
printk("PROM: Built device tree with %u bytes of memory.\n",
prom_early_allocated);
-
- if (tlb_type != hypervisor)
- of_fill_in_cpu_data();
}
diff --git a/trunk/arch/sparc64/kernel/setup.c b/trunk/arch/sparc64/kernel/setup.c
index de9b4c13f1c7..dea9c3c9ec5f 100644
--- a/trunk/arch/sparc64/kernel/setup.c
+++ b/trunk/arch/sparc64/kernel/setup.c
@@ -46,17 +46,11 @@
#include
#include
#include
-#include
#ifdef CONFIG_IP_PNP
#include
#endif
-/* Used to synchronize accesses to NatSemi SUPER I/O chip configure
- * operations in asm/ns87303.h
- */
-DEFINE_SPINLOCK(ns87303_lock);
-
struct screen_info screen_info = {
0, 0, /* orig-x, orig-y */
0, /* unused */
@@ -376,6 +370,8 @@ void __init setup_arch(char **cmdline_p)
init_cur_cpu_trap(current_thread_info());
paging_init();
+
+ smp_setup_cpu_possible_map();
}
static int __init set_preferred_console(void)
@@ -428,7 +424,7 @@ extern void mmu_info(struct seq_file *);
unsigned int dcache_parity_tl1_occurred;
unsigned int icache_parity_tl1_occurred;
-int ncpus_probed;
+static int ncpus_probed;
static int show_cpuinfo(struct seq_file *m, void *__unused)
{
@@ -520,6 +516,14 @@ static int __init topology_init(void)
err = -ENOMEM;
+ /* Count the number of physically present processors in
+ * the machine, even on uniprocessor, so that /proc/cpuinfo
+ * output is consistent with 2.4.x
+ */
+ ncpus_probed = 0;
+ while (!cpu_find_by_instance(ncpus_probed, NULL, NULL))
+ ncpus_probed++;
+
for_each_possible_cpu(i) {
struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
if (p) {
diff --git a/trunk/arch/sparc64/kernel/smp.c b/trunk/arch/sparc64/kernel/smp.c
index c550bba3490a..24fdf1d0adc5 100644
--- a/trunk/arch/sparc64/kernel/smp.c
+++ b/trunk/arch/sparc64/kernel/smp.c
@@ -40,7 +40,6 @@
#include
#include
#include
-#include
extern void calibrate_delay(void);
@@ -76,6 +75,53 @@ void smp_bogo(struct seq_file *m)
i, cpu_data(i).clock_tick);
}
+void __init smp_store_cpu_info(int id)
+{
+ struct device_node *dp;
+ int def;
+
+ cpu_data(id).udelay_val = loops_per_jiffy;
+
+ cpu_find_by_mid(id, &dp);
+ cpu_data(id).clock_tick =
+ of_getintprop_default(dp, "clock-frequency", 0);
+
+ def = ((tlb_type == hypervisor) ? (8 * 1024) : (16 * 1024));
+ cpu_data(id).dcache_size =
+ of_getintprop_default(dp, "dcache-size", def);
+
+ def = 32;
+ cpu_data(id).dcache_line_size =
+ of_getintprop_default(dp, "dcache-line-size", def);
+
+ def = 16 * 1024;
+ cpu_data(id).icache_size =
+ of_getintprop_default(dp, "icache-size", def);
+
+ def = 32;
+ cpu_data(id).icache_line_size =
+ of_getintprop_default(dp, "icache-line-size", def);
+
+ def = ((tlb_type == hypervisor) ?
+ (3 * 1024 * 1024) :
+ (4 * 1024 * 1024));
+ cpu_data(id).ecache_size =
+ of_getintprop_default(dp, "ecache-size", def);
+
+ def = 64;
+ cpu_data(id).ecache_line_size =
+ of_getintprop_default(dp, "ecache-line-size", def);
+
+ printk("CPU[%d]: Caches "
+ "D[sz(%d):line_sz(%d)] "
+ "I[sz(%d):line_sz(%d)] "
+ "E[sz(%d):line_sz(%d)]\n",
+ id,
+ cpu_data(id).dcache_size, cpu_data(id).dcache_line_size,
+ cpu_data(id).icache_size, cpu_data(id).icache_line_size,
+ cpu_data(id).ecache_size, cpu_data(id).ecache_line_size);
+}
+
extern void setup_sparc64_timer(void);
static volatile unsigned long callin_flag = 0;
@@ -99,7 +145,7 @@ void __init smp_callin(void)
local_irq_enable();
calibrate_delay();
- cpu_data(cpuid).udelay_val = loops_per_jiffy;
+ smp_store_cpu_info(cpuid);
callin_flag = 1;
__asm__ __volatile__("membar #Sync\n\t"
"flush %%g6" : : : "memory");
@@ -294,8 +340,9 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu)
prom_startcpu_cpuid(cpu, entry, cookie);
} else {
- struct device_node *dp = of_find_node_by_cpuid(cpu);
+ struct device_node *dp;
+ cpu_find_by_mid(cpu, &dp);
prom_startcpu(dp->node, entry, cookie);
}
@@ -400,7 +447,7 @@ static __inline__ void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, c
static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask)
{
u64 pstate, ver;
- int nack_busy_id, is_jbus, need_more;
+ int nack_busy_id, is_jbus;
if (cpus_empty(mask))
return;
@@ -416,7 +463,6 @@ static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mas
__asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate));
retry:
- need_more = 0;
__asm__ __volatile__("wrpr %0, %1, %%pstate\n\t"
: : "r" (pstate), "i" (PSTATE_IE));
@@ -445,10 +491,6 @@ static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mas
: /* no outputs */
: "r" (target), "i" (ASI_INTR_W));
nack_busy_id++;
- if (nack_busy_id == 32) {
- need_more = 1;
- break;
- }
}
}
@@ -465,16 +507,6 @@ static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mas
if (dispatch_stat == 0UL) {
__asm__ __volatile__("wrpr %0, 0x0, %%pstate"
: : "r" (pstate));
- if (unlikely(need_more)) {
- int i, cnt = 0;
- for_each_cpu_mask(i, mask) {
- cpu_clear(i, mask);
- cnt++;
- if (cnt == 32)
- break;
- }
- goto retry;
- }
return;
}
if (!--stuck)
@@ -512,8 +544,6 @@ static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mas
if ((dispatch_stat & check_mask) == 0)
cpu_clear(i, mask);
this_busy_nack += 2;
- if (this_busy_nack == 64)
- break;
}
goto retry;
@@ -1161,14 +1191,23 @@ int setup_profiling_timer(unsigned int multiplier)
static void __init smp_tune_scheduling(void)
{
- unsigned int smallest = ~0U;
- int i;
+ struct device_node *dp;
+ int instance;
+ unsigned int def, smallest = ~0U;
+
+ def = ((tlb_type == hypervisor) ?
+ (3 * 1024 * 1024) :
+ (4 * 1024 * 1024));
- for (i = 0; i < NR_CPUS; i++) {
- unsigned int val = cpu_data(i).ecache_size;
+ instance = 0;
+ while (!cpu_find_by_instance(instance, &dp, NULL)) {
+ unsigned int val;
- if (val && val < smallest)
+ val = of_getintprop_default(dp, "ecache-size", def);
+ if (val < smallest)
smallest = val;
+
+ instance++;
}
/* Any value less than 256K is nonsense. */
@@ -1191,44 +1230,60 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
int i;
if (num_possible_cpus() > max_cpus) {
- for_each_possible_cpu(i) {
- if (i != boot_cpu_id) {
- cpu_clear(i, phys_cpu_present_map);
- cpu_clear(i, cpu_present_map);
+ int instance, mid;
+
+ instance = 0;
+ while (!cpu_find_by_instance(instance, NULL, &mid)) {
+ if (mid != boot_cpu_id) {
+ cpu_clear(mid, phys_cpu_present_map);
+ cpu_clear(mid, cpu_present_map);
if (num_possible_cpus() <= max_cpus)
break;
}
+ instance++;
}
}
- cpu_data(boot_cpu_id).udelay_val = loops_per_jiffy;
- smp_tune_scheduling();
-}
-
-void __devinit smp_prepare_boot_cpu(void)
-{
-}
-
-void __devinit smp_fill_in_sib_core_maps(void)
-{
- unsigned int i;
-
for_each_possible_cpu(i) {
- unsigned int j;
+ if (tlb_type == hypervisor) {
+ int j;
- if (cpu_data(i).core_id == 0) {
+ /* XXX get this mapping from machine description */
+ for_each_possible_cpu(j) {
+ if ((j >> 2) == (i >> 2))
+ cpu_set(j, cpu_sibling_map[i]);
+ }
+ } else {
cpu_set(i, cpu_sibling_map[i]);
- continue;
}
+ }
+
+ smp_store_cpu_info(boot_cpu_id);
+ smp_tune_scheduling();
+}
+
+/* Set this up early so that things like the scheduler can init
+ * properly. We use the same cpu mask for both the present and
+ * possible cpu map.
+ */
+void __init smp_setup_cpu_possible_map(void)
+{
+ int instance, mid;
- for_each_possible_cpu(j) {
- if (cpu_data(i).core_id ==
- cpu_data(j).core_id)
- cpu_set(j, cpu_sibling_map[i]);
+ instance = 0;
+ while (!cpu_find_by_instance(instance, NULL, &mid)) {
+ if (mid < NR_CPUS) {
+ cpu_set(mid, phys_cpu_present_map);
+ cpu_set(mid, cpu_present_map);
}
+ instance++;
}
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+}
+
int __cpuinit __cpu_up(unsigned int cpu)
{
int ret = smp_boot_one_cpu(cpu);
@@ -1282,7 +1337,7 @@ unsigned long __per_cpu_shift __read_mostly;
EXPORT_SYMBOL(__per_cpu_base);
EXPORT_SYMBOL(__per_cpu_shift);
-void __init real_setup_per_cpu_areas(void)
+void __init setup_per_cpu_areas(void)
{
unsigned long goal, size, i;
char *ptr;
diff --git a/trunk/arch/sparc64/kernel/sstate.c b/trunk/arch/sparc64/kernel/sstate.c
deleted file mode 100644
index 5b6e75b7f052..000000000000
--- a/trunk/arch/sparc64/kernel/sstate.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* sstate.c: System soft state support.
- *
- * Copyright (C) 2007 David S. Miller
- */
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-static int hv_supports_soft_state;
-
-static unsigned long kimage_addr_to_ra(const char *p)
-{
- unsigned long val = (unsigned long) p;
-
- return kern_base + (val - KERNBASE);
-}
-
-static void do_set_sstate(unsigned long state, const char *msg)
-{
- unsigned long err;
-
- if (!hv_supports_soft_state)
- return;
-
- err = sun4v_mach_set_soft_state(state, kimage_addr_to_ra(msg));
- if (err) {
- printk(KERN_WARNING "SSTATE: Failed to set soft-state to "
- "state[%lx] msg[%s], err=%lu\n",
- state, msg, err);
- }
-}
-
-static const char booting_msg[32] __attribute__((aligned(32))) =
- "Linux booting";
-static const char running_msg[32] __attribute__((aligned(32))) =
- "Linux running";
-static const char halting_msg[32] __attribute__((aligned(32))) =
- "Linux halting";
-static const char poweroff_msg[32] __attribute__((aligned(32))) =
- "Linux powering off";
-static const char rebooting_msg[32] __attribute__((aligned(32))) =
- "Linux rebooting";
-static const char panicing_msg[32] __attribute__((aligned(32))) =
- "Linux panicing";
-
-void sstate_booting(void)
-{
- do_set_sstate(HV_SOFT_STATE_TRANSITION, booting_msg);
-}
-
-void sstate_running(void)
-{
- do_set_sstate(HV_SOFT_STATE_NORMAL, running_msg);
-}
-
-void sstate_halt(void)
-{
- do_set_sstate(HV_SOFT_STATE_TRANSITION, halting_msg);
-}
-
-void sstate_poweroff(void)
-{
- do_set_sstate(HV_SOFT_STATE_TRANSITION, poweroff_msg);
-}
-
-void sstate_reboot(void)
-{
- do_set_sstate(HV_SOFT_STATE_TRANSITION, rebooting_msg);
-}
-
-static int sstate_panic_event(struct notifier_block *n, unsigned long event, void *ptr)
-{
- do_set_sstate(HV_SOFT_STATE_TRANSITION, panicing_msg);
-
- return NOTIFY_DONE;
-}
-
-static struct notifier_block sstate_panic_block = {
- .notifier_call = sstate_panic_event,
- .priority = INT_MAX,
-};
-
-void __init sun4v_sstate_init(void)
-{
- unsigned long major, minor;
-
- major = 1;
- minor = 0;
- if (sun4v_hvapi_register(HV_GRP_SOFT_STATE, major, &minor))
- return;
-
- hv_supports_soft_state = 1;
-
- prom_sun4v_guest_soft_state();
- atomic_notifier_chain_register(&panic_notifier_list,
- &sstate_panic_block);
-}
diff --git a/trunk/arch/sparc64/kernel/sun4v_ivec.S b/trunk/arch/sparc64/kernel/sun4v_ivec.S
index 574bc248bca6..405855dd886b 100644
--- a/trunk/arch/sparc64/kernel/sun4v_ivec.S
+++ b/trunk/arch/sparc64/kernel/sun4v_ivec.S
@@ -22,12 +22,12 @@ sun4v_cpu_mondo:
be,pn %xcc, sun4v_cpu_mondo_queue_empty
nop
- /* Get &trap_block[smp_processor_id()] into %g4. */
- ldxa [%g0] ASI_SCRATCHPAD, %g4
- sub %g4, TRAP_PER_CPU_FAULT_INFO, %g4
+ /* Get &trap_block[smp_processor_id()] into %g3. */
+ ldxa [%g0] ASI_SCRATCHPAD, %g3
+ sub %g3, TRAP_PER_CPU_FAULT_INFO, %g3
/* Get CPU mondo queue base phys address into %g7. */
- ldx [%g4 + TRAP_PER_CPU_CPU_MONDO_PA], %g7
+ ldx [%g3 + TRAP_PER_CPU_CPU_MONDO_PA], %g7
/* Now get the cross-call arguments and handler PC, same
* layout as sun4u:
@@ -47,7 +47,8 @@ sun4v_cpu_mondo:
add %g2, 0x40 - 0x8 - 0x8, %g2
/* Update queue head pointer. */
- lduw [%g4 + TRAP_PER_CPU_CPU_MONDO_QMASK], %g4
+ sethi %hi(8192 - 1), %g4
+ or %g4, %lo(8192 - 1), %g4
and %g2, %g4, %g2
mov INTRQ_CPU_MONDO_HEAD, %g4
@@ -70,12 +71,12 @@ sun4v_dev_mondo:
be,pn %xcc, sun4v_dev_mondo_queue_empty
nop
- /* Get &trap_block[smp_processor_id()] into %g4. */
- ldxa [%g0] ASI_SCRATCHPAD, %g4
- sub %g4, TRAP_PER_CPU_FAULT_INFO, %g4
+ /* Get &trap_block[smp_processor_id()] into %g3. */
+ ldxa [%g0] ASI_SCRATCHPAD, %g3
+ sub %g3, TRAP_PER_CPU_FAULT_INFO, %g3
/* Get DEV mondo queue base phys address into %g5. */
- ldx [%g4 + TRAP_PER_CPU_DEV_MONDO_PA], %g5
+ ldx [%g3 + TRAP_PER_CPU_DEV_MONDO_PA], %g5
/* Load IVEC into %g3. */
ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
@@ -89,7 +90,8 @@ sun4v_dev_mondo:
*/
/* Update queue head pointer, this frees up some registers. */
- lduw [%g4 + TRAP_PER_CPU_DEV_MONDO_QMASK], %g4
+ sethi %hi(8192 - 1), %g4
+ or %g4, %lo(8192 - 1), %g4
and %g2, %g4, %g2
mov INTRQ_DEVICE_MONDO_HEAD, %g4
@@ -141,8 +143,6 @@ sun4v_res_mondo:
brnz,pn %g1, sun4v_res_mondo_queue_full
nop
- lduw [%g3 + TRAP_PER_CPU_RESUM_QMASK], %g4
-
/* Remember this entry's offset in %g1. */
mov %g2, %g1
@@ -173,6 +173,8 @@ sun4v_res_mondo:
add %g2, 0x08, %g2
/* Update queue head pointer. */
+ sethi %hi(8192 - 1), %g4
+ or %g4, %lo(8192 - 1), %g4
and %g2, %g4, %g2
mov INTRQ_RESUM_MONDO_HEAD, %g4
@@ -252,8 +254,6 @@ sun4v_nonres_mondo:
brnz,pn %g1, sun4v_nonres_mondo_queue_full
nop
- lduw [%g3 + TRAP_PER_CPU_NONRESUM_QMASK], %g4
-
/* Remember this entry's offset in %g1. */
mov %g2, %g1
@@ -284,6 +284,8 @@ sun4v_nonres_mondo:
add %g2, 0x08, %g2
/* Update queue head pointer. */
+ sethi %hi(8192 - 1), %g4
+ or %g4, %lo(8192 - 1), %g4
and %g2, %g4, %g2
mov INTRQ_NONRESUM_MONDO_HEAD, %g4
diff --git a/trunk/arch/sparc64/kernel/time.c b/trunk/arch/sparc64/kernel/time.c
index a31a0439244f..2d63d7689962 100644
--- a/trunk/arch/sparc64/kernel/time.c
+++ b/trunk/arch/sparc64/kernel/time.c
@@ -680,14 +680,22 @@ static int starfire_set_time(u32 val)
static u32 hypervisor_get_time(void)
{
- unsigned long ret, time;
+ register unsigned long func asm("%o5");
+ register unsigned long arg0 asm("%o0");
+ register unsigned long arg1 asm("%o1");
int retries = 10000;
retry:
- ret = sun4v_tod_get(&time);
- if (ret == HV_EOK)
- return time;
- if (ret == HV_EWOULDBLOCK) {
+ func = HV_FAST_TOD_GET;
+ arg0 = 0;
+ arg1 = 0;
+ __asm__ __volatile__("ta %6"
+ : "=&r" (func), "=&r" (arg0), "=&r" (arg1)
+ : "0" (func), "1" (arg0), "2" (arg1),
+ "i" (HV_FAST_TRAP));
+ if (arg0 == HV_EOK)
+ return arg1;
+ if (arg0 == HV_EWOULDBLOCK) {
if (--retries > 0) {
udelay(100);
goto retry;
@@ -701,14 +709,20 @@ static u32 hypervisor_get_time(void)
static int hypervisor_set_time(u32 secs)
{
- unsigned long ret;
+ register unsigned long func asm("%o5");
+ register unsigned long arg0 asm("%o0");
int retries = 10000;
retry:
- ret = sun4v_tod_set(secs);
- if (ret == HV_EOK)
+ func = HV_FAST_TOD_SET;
+ arg0 = secs;
+ __asm__ __volatile__("ta %4"
+ : "=&r" (func), "=&r" (arg0)
+ : "0" (func), "1" (arg0),
+ "i" (HV_FAST_TRAP));
+ if (arg0 == HV_EOK)
return 0;
- if (ret == HV_EWOULDBLOCK) {
+ if (arg0 == HV_EWOULDBLOCK) {
if (--retries > 0) {
udelay(100);
goto retry;
@@ -848,6 +862,7 @@ fs_initcall(clock_init);
static unsigned long sparc64_init_timers(void)
{
struct device_node *dp;
+ struct property *prop;
unsigned long clock;
#ifdef CONFIG_SMP
extern void smp_tick_init(void);
@@ -864,15 +879,17 @@ static unsigned long sparc64_init_timers(void)
if (manuf == 0x17 && impl == 0x13) {
/* Hummingbird, aka Ultra-IIe */
tick_ops = &hbtick_operations;
- clock = of_getintprop_default(dp, "stick-frequency", 0);
+ prop = of_find_property(dp, "stick-frequency", NULL);
} else {
tick_ops = &tick_operations;
- clock = local_cpu_data().clock_tick;
+ cpu_find_by_instance(0, &dp, NULL);
+ prop = of_find_property(dp, "clock-frequency", NULL);
}
} else {
tick_ops = &stick_operations;
- clock = of_getintprop_default(dp, "stick-frequency", 0);
+ prop = of_find_property(dp, "stick-frequency", NULL);
}
+ clock = *(unsigned int *) prop->value;
#ifdef CONFIG_SMP
smp_tick_init();
@@ -1348,7 +1365,6 @@ static int hypervisor_set_rtc_time(struct rtc_time *time)
return hypervisor_set_time(seconds);
}
-#ifdef CONFIG_PCI
static void bq4802_get_rtc_time(struct rtc_time *time)
{
unsigned char val = readb(bq4802_regs + 0x0e);
@@ -1420,7 +1436,6 @@ static int bq4802_set_rtc_time(struct rtc_time *time)
return 0;
}
-#endif /* CONFIG_PCI */
struct mini_rtc_ops {
void (*get_rtc_time)(struct rtc_time *);
@@ -1437,12 +1452,10 @@ static struct mini_rtc_ops hypervisor_rtc_ops = {
.set_rtc_time = hypervisor_set_rtc_time,
};
-#ifdef CONFIG_PCI
static struct mini_rtc_ops bq4802_rtc_ops = {
.get_rtc_time = bq4802_get_rtc_time,
.set_rtc_time = bq4802_set_rtc_time,
};
-#endif /* CONFIG_PCI */
static struct mini_rtc_ops *mini_rtc_ops;
@@ -1566,10 +1579,8 @@ static int __init rtc_mini_init(void)
mini_rtc_ops = &hypervisor_rtc_ops;
else if (this_is_starfire)
mini_rtc_ops = &starfire_rtc_ops;
-#ifdef CONFIG_PCI
else if (bq4802_regs)
mini_rtc_ops = &bq4802_rtc_ops;
-#endif /* CONFIG_PCI */
else
return -ENODEV;
diff --git a/trunk/arch/sparc64/kernel/traps.c b/trunk/arch/sparc64/kernel/traps.c
index 00a9e3286c83..d0fde36395b4 100644
--- a/trunk/arch/sparc64/kernel/traps.c
+++ b/trunk/arch/sparc64/kernel/traps.c
@@ -795,7 +795,8 @@ extern unsigned int cheetah_deferred_trap_vector[], cheetah_deferred_trap_vector
void __init cheetah_ecache_flush_init(void)
{
unsigned long largest_size, smallest_linesize, order, ver;
- int i, sz;
+ struct device_node *dp;
+ int i, instance, sz;
/* Scan all cpu device tree nodes, note two values:
* 1) largest E-cache size
@@ -804,20 +805,18 @@ void __init cheetah_ecache_flush_init(void)
largest_size = 0UL;
smallest_linesize = ~0UL;
- for (i = 0; i < NR_CPUS; i++) {
+ instance = 0;
+ while (!cpu_find_by_instance(instance, &dp, NULL)) {
unsigned long val;
- val = cpu_data(i).ecache_size;
- if (!val)
- continue;
-
+ val = of_getintprop_default(dp, "ecache-size",
+ (2 * 1024 * 1024));
if (val > largest_size)
largest_size = val;
-
- val = cpu_data(i).ecache_line_size;
+ val = of_getintprop_default(dp, "ecache-line-size", 64);
if (val < smallest_linesize)
smallest_linesize = val;
-
+ instance++;
}
if (largest_size == 0UL || smallest_linesize == ~0UL) {
@@ -2565,15 +2564,7 @@ void __init trap_init(void)
(TRAP_PER_CPU_TSB_HUGE_TEMP !=
offsetof(struct trap_per_cpu, tsb_huge_temp)) ||
(TRAP_PER_CPU_IRQ_WORKLIST !=
- offsetof(struct trap_per_cpu, irq_worklist)) ||
- (TRAP_PER_CPU_CPU_MONDO_QMASK !=
- offsetof(struct trap_per_cpu, cpu_mondo_qmask)) ||
- (TRAP_PER_CPU_DEV_MONDO_QMASK !=
- offsetof(struct trap_per_cpu, dev_mondo_qmask)) ||
- (TRAP_PER_CPU_RESUM_QMASK !=
- offsetof(struct trap_per_cpu, resum_qmask)) ||
- (TRAP_PER_CPU_NONRESUM_QMASK !=
- offsetof(struct trap_per_cpu, nonresum_qmask)))
+ offsetof(struct trap_per_cpu, irq_worklist)))
trap_per_cpu_offsets_are_bolixed_dave();
if ((TSB_CONFIG_TSB !=
diff --git a/trunk/arch/sparc64/mm/init.c b/trunk/arch/sparc64/mm/init.c
index 3010227fe243..6e5b01d779d2 100644
--- a/trunk/arch/sparc64/mm/init.c
+++ b/trunk/arch/sparc64/mm/init.c
@@ -23,7 +23,6 @@
#include
#include
#include
-#include
#include
#include
@@ -44,8 +43,8 @@
#include
#include
#include
-#include
-#include
+
+extern void device_scan(void);
#define MAX_PHYS_ADDRESS (1UL << 42UL)
#define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL)
@@ -61,11 +60,8 @@ unsigned long kern_linear_pte_xor[2] __read_mostly;
unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)];
#ifndef CONFIG_DEBUG_PAGEALLOC
-/* A special kernel TSB for 4MB and 256MB linear mappings.
- * Space is allocated for this right after the trap table
- * in arch/sparc64/kernel/head.S
- */
-extern struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES];
+/* A special kernel TSB for 4MB and 256MB linear mappings. */
+struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES];
#endif
#define MAX_BANKS 32
@@ -194,9 +190,12 @@ inline void flush_dcache_page_impl(struct page *page)
}
#define PG_dcache_dirty PG_arch_1
-#define PG_dcache_cpu_shift 32UL
-#define PG_dcache_cpu_mask \
- ((1UL< 256
+#error D-cache dirty tracking and thread_info->cpu need fixing for > 256 cpus
+#endif
#define dcache_dirty_cpu(page) \
(((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask)
@@ -558,11 +557,26 @@ static void __init hypervisor_tlb_lock(unsigned long vaddr,
unsigned long pte,
unsigned long mmu)
{
- unsigned long ret = sun4v_mmu_map_perm_addr(vaddr, 0, pte, mmu);
-
- if (ret != 0) {
+ register unsigned long func asm("%o5");
+ register unsigned long arg0 asm("%o0");
+ register unsigned long arg1 asm("%o1");
+ register unsigned long arg2 asm("%o2");
+ register unsigned long arg3 asm("%o3");
+
+ func = HV_FAST_MMU_MAP_PERM_ADDR;
+ arg0 = vaddr;
+ arg1 = 0;
+ arg2 = pte;
+ arg3 = mmu;
+ __asm__ __volatile__("ta 0x80"
+ : "=&r" (func), "=&r" (arg0),
+ "=&r" (arg1), "=&r" (arg2),
+ "=&r" (arg3)
+ : "0" (func), "1" (arg0), "2" (arg1),
+ "3" (arg2), "4" (arg3));
+ if (arg0 != 0) {
prom_printf("hypervisor_tlb_lock[%lx:%lx:%lx:%lx]: "
- "errors with %lx\n", vaddr, 0, pte, mmu, ret);
+ "errors with %lx\n", vaddr, 0, pte, mmu, arg0);
prom_halt();
}
}
@@ -1299,16 +1313,20 @@ static void __init sun4v_ktsb_init(void)
void __cpuinit sun4v_ktsb_register(void)
{
- unsigned long pa, ret;
+ register unsigned long func asm("%o5");
+ register unsigned long arg0 asm("%o0");
+ register unsigned long arg1 asm("%o1");
+ unsigned long pa;
pa = kern_base + ((unsigned long)&ktsb_descr[0] - KERNBASE);
- ret = sun4v_mmu_tsb_ctx0(NUM_KTSB_DESCR, pa);
- if (ret != 0) {
- prom_printf("hypervisor_mmu_tsb_ctx0[%lx]: "
- "errors with %lx\n", pa, ret);
- prom_halt();
- }
+ func = HV_FAST_MMU_TSB_CTX0;
+ arg0 = NUM_KTSB_DESCR;
+ arg1 = pa;
+ __asm__ __volatile__("ta %6"
+ : "=&r" (func), "=&r" (arg0), "=&r" (arg1)
+ : "0" (func), "1" (arg0), "2" (arg1),
+ "i" (HV_FAST_TRAP));
}
/* paging_init() sets up the page tables */
@@ -1316,9 +1334,6 @@ void __cpuinit sun4v_ktsb_register(void)
extern void cheetah_ecache_flush_init(void);
extern void sun4v_patch_tlb_handlers(void);
-extern void cpu_probe(void);
-extern void central_probe(void);
-
static unsigned long last_valid_pfn;
pgd_t swapper_pg_dir[2048];
@@ -1330,24 +1345,9 @@ void __init paging_init(void)
unsigned long end_pfn, pages_avail, shift, phys_base;
unsigned long real_end, i;
- /* These build time checkes make sure that the dcache_dirty_cpu()
- * page->flags usage will work.
- *
- * When a page gets marked as dcache-dirty, we store the
- * cpu number starting at bit 32 in the page->flags. Also,
- * functions like clear_dcache_dirty_cpu use the cpu mask
- * in 13-bit signed-immediate instruction fields.
- */
- BUILD_BUG_ON(FLAGS_RESERVED != 32);
- BUILD_BUG_ON(SECTIONS_WIDTH + NODES_WIDTH + ZONES_WIDTH +
- ilog2(roundup_pow_of_two(NR_CPUS)) > FLAGS_RESERVED);
- BUILD_BUG_ON(NR_CPUS > 4096);
-
kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL;
kern_size = (unsigned long)&_end - (unsigned long)KERNBASE;
- sstate_booting();
-
/* Invalidate both kernel TSBs. */
memset(swapper_tsb, 0x40, sizeof(swapper_tsb));
#ifndef CONFIG_DEBUG_PAGEALLOC
@@ -1416,13 +1416,8 @@ void __init paging_init(void)
kernel_physical_mapping_init();
- real_setup_per_cpu_areas();
-
prom_build_devicetree();
- if (tlb_type == hypervisor)
- sun4v_mdesc_init();
-
{
unsigned long zones_size[MAX_NR_ZONES];
unsigned long zholes_size[MAX_NR_ZONES];
@@ -1439,10 +1434,7 @@ void __init paging_init(void)
zholes_size);
}
- prom_printf("Booting Linux...\n");
-
- central_probe();
- cpu_probe();
+ device_scan();
}
static void __init taint_real_pages(void)
diff --git a/trunk/arch/sparc64/prom/misc.c b/trunk/arch/sparc64/prom/misc.c
index f3e0c14e9eef..0b4213720d43 100644
--- a/trunk/arch/sparc64/prom/misc.c
+++ b/trunk/arch/sparc64/prom/misc.c
@@ -15,25 +15,6 @@
#include
#include
-int prom_service_exists(const char *service_name)
-{
- int err = p1275_cmd("test", P1275_ARG(0, P1275_ARG_IN_STRING) |
- P1275_INOUT(1, 1), service_name);
-
- if (err)
- return 0;
- return 1;
-}
-
-void prom_sun4v_guest_soft_state(void)
-{
- const char *svc = "SUNW,soft-state-supported";
-
- if (!prom_service_exists(svc))
- return;
- p1275_cmd(svc, P1275_INOUT(0, 0));
-}
-
/* Reset and reboot the machine with the command 'bcommand'. */
void prom_reboot(const char *bcommand)
{
diff --git a/trunk/arch/um/os-Linux/start_up.c b/trunk/arch/um/os-Linux/start_up.c
index 3fc13fa8729d..79471f85eb89 100644
--- a/trunk/arch/um/os-Linux/start_up.c
+++ b/trunk/arch/um/os-Linux/start_up.c
@@ -144,7 +144,9 @@ static int stop_ptraced_child(int pid, void *stack, int exitcode,
int exit_with = WEXITSTATUS(status);
if (exit_with == 2)
non_fatal("check_ptrace : child exited with status 2. "
- "\nDisabling SYSEMU support.\n");
+ "Serious trouble happening! Try updating "
+ "your host skas patch!\nDisabling SYSEMU "
+ "support.");
non_fatal("check_ptrace : child exited with exitcode %d, while "
"expecting %d; status 0x%x\n", exit_with,
exitcode, status);
@@ -207,7 +209,6 @@ __uml_setup("nosysemu", nosysemu_cmd_param,
static void __init check_sysemu(void)
{
void *stack;
- unsigned long regs[MAX_REG_NR];
int pid, n, status, count=0;
non_fatal("Checking syscall emulation patch for ptrace...");
@@ -224,20 +225,11 @@ static void __init check_sysemu(void)
fatal("check_sysemu : expected SIGTRAP, got status = %d",
status);
- if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
- fatal_perror("check_sysemu : PTRACE_GETREGS failed");
- if(PT_SYSCALL_NR(regs) != __NR_getpid){
- non_fatal("check_sysemu got system call number %d, "
- "expected %d...", PT_SYSCALL_NR(regs), __NR_getpid);
- goto fail;
- }
-
- n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET, os_getpid());
- if(n < 0){
- non_fatal("check_sysemu : failed to modify system call "
- "return");
- goto fail;
- }
+ n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET,
+ os_getpid());
+ if(n < 0)
+ fatal_perror("check_sysemu : failed to modify system call "
+ "return");
if (stop_ptraced_child(pid, stack, 0, 0) < 0)
goto fail_stopped;
diff --git a/trunk/arch/x86_64/Kconfig b/trunk/arch/x86_64/Kconfig
index 5ce94430c019..145bb824b2a8 100644
--- a/trunk/arch/x86_64/Kconfig
+++ b/trunk/arch/x86_64/Kconfig
@@ -428,15 +428,12 @@ config NR_CPUS
memory in the static kernel configuration.
config HOTPLUG_CPU
- bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
+ bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
depends on SMP && HOTPLUG && EXPERIMENTAL
help
Say Y here to experiment with turning CPUs off and on. CPUs
can be controlled through /sys/devices/system/cpu/cpu#.
- This is also required for suspend/hibernation on SMP systems.
-
- Say N if you want to disable CPU hotplug and don't need to
- suspend.
+ Say N if you want to disable CPU hotplug.
config ARCH_ENABLE_MEMORY_HOTPLUG
def_bool y
diff --git a/trunk/arch/x86_64/kernel/k8.c b/trunk/arch/x86_64/kernel/k8.c
index 7377ccb21335..bc11b32e8b4d 100644
--- a/trunk/arch/x86_64/kernel/k8.c
+++ b/trunk/arch/x86_64/kernel/k8.c
@@ -39,10 +39,10 @@ int cache_k8_northbridges(void)
{
int i;
struct pci_dev *dev;
-
if (num_k8_northbridges)
return 0;
+ num_k8_northbridges = 0;
dev = NULL;
while ((dev = next_k8_northbridge(dev)) != NULL)
num_k8_northbridges++;
@@ -52,11 +52,6 @@ int cache_k8_northbridges(void)
if (!k8_northbridges)
return -ENOMEM;
- if (!num_k8_northbridges) {
- k8_northbridges[0] = NULL;
- return 0;
- }
-
flush_words = kmalloc(num_k8_northbridges * sizeof(u32), GFP_KERNEL);
if (!flush_words) {
kfree(k8_northbridges);
diff --git a/trunk/block/genhd.c b/trunk/block/genhd.c
index 863a8c0623ed..93a2cf654597 100644
--- a/trunk/block/genhd.c
+++ b/trunk/block/genhd.c
@@ -423,10 +423,7 @@ static ssize_t disk_size_read(struct gendisk * disk, char *page)
{
return sprintf(page, "%llu\n", (unsigned long long)get_capacity(disk));
}
-static ssize_t disk_capability_read(struct gendisk *disk, char *page)
-{
- return sprintf(page, "%x\n", disk->flags);
-}
+
static ssize_t disk_stats_read(struct gendisk * disk, char *page)
{
preempt_disable();
@@ -469,10 +466,6 @@ static struct disk_attribute disk_attr_size = {
.attr = {.name = "size", .mode = S_IRUGO },
.show = disk_size_read
};
-static struct disk_attribute disk_attr_capability = {
- .attr = {.name = "capability", .mode = S_IRUGO },
- .show = disk_capability_read
-};
static struct disk_attribute disk_attr_stat = {
.attr = {.name = "stat", .mode = S_IRUGO },
.show = disk_stats_read
@@ -513,7 +506,6 @@ static struct attribute * default_attrs[] = {
&disk_attr_removable.attr,
&disk_attr_size.attr,
&disk_attr_stat.attr,
- &disk_attr_capability.attr,
#ifdef CONFIG_FAIL_MAKE_REQUEST
&disk_attr_fail.attr,
#endif
@@ -696,27 +688,6 @@ struct seq_operations diskstats_op = {
.show = diskstats_show
};
-static void media_change_notify_thread(struct work_struct *work)
-{
- struct gendisk *gd = container_of(work, struct gendisk, async_notify);
- char event[] = "MEDIA_CHANGE=1";
- char *envp[] = { event, NULL };
-
- /*
- * set enviroment vars to indicate which event this is for
- * so that user space will know to go check the media status.
- */
- kobject_uevent_env(&gd->kobj, KOBJ_CHANGE, envp);
- put_device(gd->driverfs_dev);
-}
-
-void genhd_media_change_notify(struct gendisk *disk)
-{
- get_device(disk->driverfs_dev);
- schedule_work(&disk->async_notify);
-}
-EXPORT_SYMBOL_GPL(genhd_media_change_notify);
-
struct gendisk *alloc_disk(int minors)
{
return alloc_disk_node(minors, -1);
@@ -746,8 +717,6 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
kobj_set_kset_s(disk,block_subsys);
kobject_init(&disk->kobj);
rand_initialize_disk(disk);
- INIT_WORK(&disk->async_notify,
- media_change_notify_thread);
}
return disk;
}
diff --git a/trunk/crypto/cryptd.c b/trunk/crypto/cryptd.c
index ac6dce2e7596..3ff4e1f0f032 100644
--- a/trunk/crypto/cryptd.c
+++ b/trunk/crypto/cryptd.c
@@ -298,7 +298,7 @@ static inline int cryptd_create_thread(struct cryptd_state *state,
mutex_init(&state->mutex);
crypto_init_queue(&state->queue, CRYPTD_MAX_QLEN);
- state->task = kthread_run(fn, state, name);
+ state->task = kthread_create(fn, state, name);
if (IS_ERR(state->task))
return PTR_ERR(state->task);
@@ -316,8 +316,6 @@ static int cryptd_thread(void *data)
struct cryptd_state *state = data;
int stop;
- current->flags |= PF_NOFREEZE;
-
do {
struct crypto_async_request *req, *backlog;
diff --git a/trunk/drivers/ata/ata_piix.c b/trunk/drivers/ata/ata_piix.c
index 9c07b88631be..0458811010fd 100644
--- a/trunk/drivers/ata/ata_piix.c
+++ b/trunk/drivers/ata/ata_piix.c
@@ -578,7 +578,6 @@ static const struct ich_laptop ich_laptop[] = {
{ 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
{ 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */
{ 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */
- { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */
/* end marker */
{ 0, }
};
diff --git a/trunk/drivers/ata/libata-core.c b/trunk/drivers/ata/libata-core.c
index af625147df62..a6de57e02047 100644
--- a/trunk/drivers/ata/libata-core.c
+++ b/trunk/drivers/ata/libata-core.c
@@ -3022,7 +3022,7 @@ int ata_wait_ready(struct ata_port *ap, unsigned long deadline)
if (!(status & ATA_BUSY))
return 0;
- if (!ata_port_online(ap) && status == 0xff)
+ if (status == 0xff)
return -ENODEV;
if (time_after(now, deadline))
return -EBUSY;
@@ -3368,7 +3368,7 @@ int ata_std_prereset(struct ata_port *ap, unsigned long deadline)
*/
if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_port_offline(ap)) {
rc = ata_wait_ready(ap, deadline);
- if (rc && rc != -ENODEV) {
+ if (rc) {
ata_port_printk(ap, KERN_WARNING, "device not ready "
"(errno=%d), forcing hardreset\n", rc);
ehc->i.action |= ATA_EH_HARDRESET;
@@ -3783,7 +3783,6 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ },
/* NCQ is broken */
{ "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ },
- { "Maxtor 6B200M0", "BANC1B10", ATA_HORKAGE_NONCQ },
/* NCQ hard hangs device under heavier load, needs hard power cycle */
{ "Maxtor 6B250S0", "BANC1B70", ATA_HORKAGE_NONCQ },
/* Blacklist entries taken from Silicon Image 3124/3132
diff --git a/trunk/drivers/ata/libata-scsi.c b/trunk/drivers/ata/libata-scsi.c
index b3900cfbd880..242c43eef807 100644
--- a/trunk/drivers/ata/libata-scsi.c
+++ b/trunk/drivers/ata/libata-scsi.c
@@ -1050,15 +1050,14 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc)
static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen)
{
u64 lba = 0;
- u32 len;
+ u32 len = 0;
VPRINTK("six-byte command\n");
- lba |= ((u64)(cdb[1] & 0x1f)) << 16;
lba |= ((u64)cdb[2]) << 8;
lba |= ((u64)cdb[3]);
- len = cdb[4];
+ len |= ((u32)cdb[4]);
*plba = lba;
*plen = len;
diff --git a/trunk/drivers/ata/pata_artop.c b/trunk/drivers/ata/pata_artop.c
index 03b6ddd2abd2..7b4810c171b7 100644
--- a/trunk/drivers/ata/pata_artop.c
+++ b/trunk/drivers/ata/pata_artop.c
@@ -97,7 +97,7 @@ static int artop6260_pre_reset(struct ata_port *ap, unsigned long deadline)
* artop6260_cable_detect - identify cable type
* @ap: Port
*
- * Identify the cable type for the ARTOP interface in question
+ * Identify the cable type for the ARTOp interface in question
*/
static int artop6260_cable_detect(struct ata_port *ap)
diff --git a/trunk/drivers/ata/pata_hpt37x.c b/trunk/drivers/ata/pata_hpt37x.c
index 6446735a46e0..a54c17433eef 100644
--- a/trunk/drivers/ata/pata_hpt37x.c
+++ b/trunk/drivers/ata/pata_hpt37x.c
@@ -26,7 +26,7 @@
#include
#define DRV_NAME "pata_hpt37x"
-#define DRV_VERSION "0.6.6"
+#define DRV_VERSION "0.6.5"
struct hpt_clock {
u8 xfer_speed;
@@ -931,6 +931,15 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
.udma_mask = 0x7f,
.port_ops = &hpt372_port_ops
};
+ /* HPT371, 372 and friends - UDMA100 at 50MHz clock */
+ static const struct ata_port_info info_hpt372_50 = {
+ .sht = &hpt37x_sht,
+ .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
+ .pio_mask = 0x1f,
+ .mwdma_mask = 0x07,
+ .udma_mask = 0x3f,
+ .port_ops = &hpt372_port_ops
+ };
/* HPT374 - UDMA133 */
static const struct ata_port_info info_hpt374 = {
.sht = &hpt37x_sht,
@@ -1089,21 +1098,17 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
* use a 50MHz DPLL by choice
*/
unsigned int f_low, f_high;
- int dpll, adjust;
+ int adjust;
- /* Compute DPLL */
- dpll = 2;
+ clock_slot = 2;
if (port->udma_mask & 0xE0)
- dpll = 3;
+ clock_slot = 3;
- f_low = (MHz[clock_slot] * 48) / MHz[dpll];
+ f_low = (MHz[clock_slot] * chip_table->base) / 192;
f_high = f_low + 2;
- if (clock_slot > 1)
- f_high += 2;
/* Select the DPLL clock. */
pci_write_config_byte(dev, 0x5b, 0x21);
- pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
for(adjust = 0; adjust < 8; adjust++) {
if (hpt37x_calibrate_dpll(dev))
@@ -1119,12 +1124,12 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n");
return -ENODEV;
}
- if (dpll == 3)
+ if (clock_slot == 3)
private_data = (void *)hpt37x_timings_66;
else
private_data = (void *)hpt37x_timings_50;
- printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[dpll]);
+ printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[clock_slot]);
} else {
private_data = (void *)chip_table->clocks[clock_slot];
/*
diff --git a/trunk/drivers/ata/pata_hpt3x2n.c b/trunk/drivers/ata/pata_hpt3x2n.c
index e947433cb37d..f25154aed75d 100644
--- a/trunk/drivers/ata/pata_hpt3x2n.c
+++ b/trunk/drivers/ata/pata_hpt3x2n.c
@@ -521,8 +521,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
/* 371N if rev > 1 */
break;
case PCI_DEVICE_ID_TTI_HPT372:
- /* 372N if rev >= 2*/
- if (class_rev < 2)
+ /* 372N if rev >= 1*/
+ if (class_rev == 0)
return -ENODEV;
break;
case PCI_DEVICE_ID_TTI_HPT302:
diff --git a/trunk/drivers/ata/pata_it821x.c b/trunk/drivers/ata/pata_it821x.c
index b3456d7a592c..ff9a6fd36657 100644
--- a/trunk/drivers/ata/pata_it821x.c
+++ b/trunk/drivers/ata/pata_it821x.c
@@ -1,5 +1,5 @@
/*
- * pata_it821x.c - IT821x PATA for new ATA layer
+ * ata-it821x.c - IT821x PATA for new ATA layer
* (C) 2005 Red Hat Inc
* Alan Cox
*
@@ -65,6 +65,7 @@
*
* TODO
* - ATAPI and other speed filtering
+ * - Command filter in smart mode
* - RAID configuration ioctls
*/
diff --git a/trunk/drivers/ata/pata_scc.c b/trunk/drivers/ata/pata_scc.c
index 61502bc7bf1d..aa138d211b09 100644
--- a/trunk/drivers/ata/pata_scc.c
+++ b/trunk/drivers/ata/pata_scc.c
@@ -489,26 +489,23 @@ static unsigned int scc_devchk (struct ata_port *ap,
* Note: Original code is ata_bus_post_reset().
*/
-static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask,
- unsigned long deadline)
+static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
{
struct ata_ioports *ioaddr = &ap->ioaddr;
unsigned int dev0 = devmask & (1 << 0);
unsigned int dev1 = devmask & (1 << 1);
- int rc;
+ unsigned long timeout;
/* if device 0 was found in ata_devchk, wait for its
* BSY bit to clear
*/
- if (dev0) {
- rc = ata_wait_ready(ap, deadline);
- if (rc && rc != -ENODEV)
- return rc;
- }
+ if (dev0)
+ ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
/* if device 1 was found in ata_devchk, wait for
* register access, then wait for BSY to clear
*/
+ timeout = jiffies + ATA_TMOUT_BOOT;
while (dev1) {
u8 nsect, lbal;
@@ -517,15 +514,14 @@ static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask,
lbal = in_be32(ioaddr->lbal_addr);
if ((nsect == 1) && (lbal == 1))
break;
- if (time_after(jiffies, deadline))
- return -EBUSY;
+ if (time_after(jiffies, timeout)) {
+ dev1 = 0;
+ break;
+ }
msleep(50); /* give drive a breather */
}
- if (dev1) {
- rc = ata_wait_ready(ap, deadline);
- if (rc && rc != -ENODEV)
- return rc;
- }
+ if (dev1)
+ ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
/* is all this really necessary? */
ap->ops->dev_select(ap, 0);
@@ -533,8 +529,6 @@ static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask,
ap->ops->dev_select(ap, 1);
if (dev0)
ap->ops->dev_select(ap, 0);
-
- return 0;
}
/**
@@ -543,8 +537,8 @@ static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask,
* Note: Original code is ata_bus_softreset().
*/
-static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
- unsigned long deadline)
+static unsigned int scc_bus_softreset (struct ata_port *ap,
+ unsigned int devmask)
{
struct ata_ioports *ioaddr = &ap->ioaddr;
@@ -576,7 +570,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
if (scc_check_status(ap) == 0xFF)
return 0;
- scc_bus_post_reset(ap, devmask, deadline);
+ scc_bus_post_reset(ap, devmask);
return 0;
}
@@ -585,13 +579,11 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
* scc_std_softreset - reset host port via ATA SRST
* @ap: port to reset
* @classes: resulting classes of attached devices
- * @deadline: deadline jiffies for the operation
*
* Note: Original code is ata_std_softreset().
*/
-static int scc_std_softreset (struct ata_port *ap, unsigned int *classes,
- unsigned long deadline)
+static int scc_std_softreset (struct ata_port *ap, unsigned int *classes)
{
unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
unsigned int devmask = 0, err_mask;
@@ -615,7 +607,7 @@ static int scc_std_softreset (struct ata_port *ap, unsigned int *classes,
/* issue bus reset */
DPRINTK("about to softreset, devmask=%x\n", devmask);
- err_mask = scc_bus_softreset(ap, devmask, deadline);
+ err_mask = scc_bus_softreset(ap, devmask);
if (err_mask) {
ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n",
err_mask);
@@ -684,11 +676,10 @@ static void scc_bmdma_stop (struct ata_queued_cmd *qc)
if (reg & INTSTS_BMSINT) {
unsigned int classes;
- unsigned long deadline = jiffies + ATA_TMOUT_BOOT;
printk(KERN_WARNING "%s: Internal Bus Error\n", DRV_NAME);
out_be32(bmid_base + SCC_DMA_INTST, INTSTS_BMSINT);
/* TBD: SW reset */
- scc_std_softreset(ap, &classes, deadline);
+ scc_std_softreset(ap, &classes);
continue;
}
@@ -871,10 +862,9 @@ static void scc_bmdma_freeze (struct ata_port *ap)
/**
* scc_pata_prereset - prepare for reset
* @ap: ATA port to be reset
- * @deadline: deadline jiffies for the operation
*/
-static int scc_pata_prereset(struct ata_port *ap, unsigned long deadline)
+static int scc_pata_prereset (struct ata_port *ap, unsigned long deadline)
{
ap->cbl = ATA_CBL_PATA80;
return ata_std_prereset(ap, deadline);
diff --git a/trunk/drivers/ata/pata_sis.c b/trunk/drivers/ata/pata_sis.c
index ec3ae9375015..f2231267e011 100644
--- a/trunk/drivers/ata/pata_sis.c
+++ b/trunk/drivers/ata/pata_sis.c
@@ -73,14 +73,14 @@ static int sis_short_ata40(struct pci_dev *dev)
}
/**
- * sis_old_port_base - return PCI configuration base for dev
+ * sis_port_base - return PCI configuration base for dev
* @adev: device
*
* Returns the base of the PCI configuration registers for this port
* number.
*/
-static int sis_old_port_base(struct ata_device *adev)
+static int sis_port_base(struct ata_device *adev)
{
return 0x40 + (4 * adev->ap->port_no) + (2 * adev->devno);
}
@@ -211,7 +211,7 @@ static void sis_set_fifo(struct ata_port *ap, struct ata_device *adev)
static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
- int port = sis_old_port_base(adev);
+ int port = sis_port_base(adev);
u8 t1, t2;
int speed = adev->pio_mode - XFER_PIO_0;
@@ -248,7 +248,7 @@ static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev)
static void sis_100_set_piomode (struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
- int port = sis_old_port_base(adev);
+ int port = sis_port_base(adev);
int speed = adev->pio_mode - XFER_PIO_0;
const u8 actrec[] = { 0x00, 0x67, 0x44, 0x33, 0x31 };
@@ -328,7 +328,7 @@ static void sis_old_set_dmamode (struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int speed = adev->dma_mode - XFER_MW_DMA_0;
- int drive_pci = sis_old_port_base(adev);
+ int drive_pci = sis_port_base(adev);
u16 timing;
const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 };
@@ -367,7 +367,7 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int speed = adev->dma_mode - XFER_MW_DMA_0;
- int drive_pci = sis_old_port_base(adev);
+ int drive_pci = sis_port_base(adev);
u16 timing;
const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 };
@@ -378,12 +378,12 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
if (adev->dma_mode < XFER_UDMA_0) {
/* bits 3-0 hold recovery timing bits 8-10 active timing and
the higer bits are dependant on the device, bit 15 udma */
- timing &= ~0x870F;
+ timing &= ~ 0x870F;
timing |= mwdma_bits[speed];
} else {
/* Bit 15 is UDMA on/off, bit 12-14 are cycle time */
speed = adev->dma_mode - XFER_UDMA_0;
- timing &= ~0xF000;
+ timing &= ~0x6000;
timing |= udma_bits[speed];
}
pci_write_config_word(pdev, drive_pci, timing);
@@ -405,22 +405,22 @@ static void sis_100_set_dmamode (struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int speed = adev->dma_mode - XFER_MW_DMA_0;
- int drive_pci = sis_old_port_base(adev);
- u8 timing;
+ int drive_pci = sis_port_base(adev);
+ u16 timing;
- const u8 udma_bits[] = { 0x8B, 0x87, 0x85, 0x83, 0x82, 0x81};
+ const u16 udma_bits[] = { 0x8B00, 0x8700, 0x8500, 0x8300, 0x8200, 0x8100};
- pci_read_config_byte(pdev, drive_pci + 1, &timing);
+ pci_read_config_word(pdev, drive_pci, &timing);
if (adev->dma_mode < XFER_UDMA_0) {
/* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */
} else {
- /* Bit 7 is UDMA on/off, bit 0-3 are cycle time */
+ /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */
speed = adev->dma_mode - XFER_UDMA_0;
- timing &= ~0x8F;
+ timing &= ~0x0F00;
timing |= udma_bits[speed];
}
- pci_write_config_byte(pdev, drive_pci + 1, timing);
+ pci_write_config_word(pdev, drive_pci, timing);
}
/**
@@ -440,22 +440,22 @@ static void sis_133_early_set_dmamode (struct ata_port *ap, struct ata_device *a
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int speed = adev->dma_mode - XFER_MW_DMA_0;
- int drive_pci = sis_old_port_base(adev);
- u8 timing;
- /* Low 4 bits are timing */
- static const u8 udma_bits[] = { 0x8F, 0x8A, 0x87, 0x85, 0x83, 0x82, 0x81};
+ int drive_pci = sis_port_base(adev);
+ u16 timing;
+
+ static const u16 udma_bits[] = { 0x8F00, 0x8A00, 0x8700, 0x8500, 0x8300, 0x8200, 0x8100};
- pci_read_config_byte(pdev, drive_pci + 1, &timing);
+ pci_read_config_word(pdev, drive_pci, &timing);
if (adev->dma_mode < XFER_UDMA_0) {
/* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */
} else {
- /* Bit 7 is UDMA on/off, bit 0-3 are cycle time */
+ /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */
speed = adev->dma_mode - XFER_UDMA_0;
- timing &= ~0x8F;
+ timing &= ~0x0F00;
timing |= udma_bits[speed];
}
- pci_write_config_byte(pdev, drive_pci + 1, timing);
+ pci_write_config_word(pdev, drive_pci, timing);
}
/**
diff --git a/trunk/drivers/ata/pata_via.c b/trunk/drivers/ata/pata_via.c
index a8462f1e890b..e4c71f76bd55 100644
--- a/trunk/drivers/ata/pata_via.c
+++ b/trunk/drivers/ata/pata_via.c
@@ -60,7 +60,6 @@
#include
#include
#include
-#include
#define DRV_NAME "pata_via"
#define DRV_VERSION "0.3.1"
@@ -123,31 +122,6 @@ static const struct via_isa_bridge {
{ NULL }
};
-
-/*
- * Cable special cases
- */
-
-static struct dmi_system_id cable_dmi_table[] = {
- {
- .ident = "Acer Ferrari 3400",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."),
- DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"),
- },
- },
- { }
-};
-
-static int via_cable_override(struct pci_dev *pdev)
-{
- /* Systems by DMI */
- if (dmi_check_system(cable_dmi_table))
- return 1;
- return 0;
-}
-
-
/**
* via_cable_detect - cable detection
* @ap: ATA port
@@ -165,9 +139,6 @@ static int via_cable_detect(struct ata_port *ap) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 ata66;
- if (via_cable_override(pdev))
- return ATA_CBL_PATA40_SHORT;
-
/* Early chips are 40 wire */
if ((config->flags & VIA_UDMA) < VIA_UDMA_66)
return ATA_CBL_PATA40;
@@ -621,11 +592,10 @@ static int via_reinit_one(struct pci_dev *pdev)
#endif
static const struct pci_device_id via[] = {
- { PCI_VDEVICE(VIA, 0x0571), },
- { PCI_VDEVICE(VIA, 0x0581), },
- { PCI_VDEVICE(VIA, 0x1571), },
- { PCI_VDEVICE(VIA, 0x3164), },
- { PCI_VDEVICE(VIA, 0x5324), },
+ { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), },
+ { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C586_1), },
+ { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_6410), },
+ { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_SATA_EIDE), },
{ },
};
diff --git a/trunk/drivers/ata/sata_mv.c b/trunk/drivers/ata/sata_mv.c
index c957e6e54ba1..705a020e1597 100644
--- a/trunk/drivers/ata/sata_mv.c
+++ b/trunk/drivers/ata/sata_mv.c
@@ -21,50 +21,6 @@
*
*/
-/*
- sata_mv TODO list:
-
- 1) Needs a full errata audit for all chipsets. I implemented most
- of the errata workarounds found in the Marvell vendor driver, but
- I distinctly remember a couple workarounds (one related to PCI-X)
- are still needed.
-
- 2) Convert to LibATA new EH. Required for hotplug, NCQ, and sane
- probing/error handling in general. MUST HAVE.
-
- 3) Add hotplug support (easy, once new-EH support appears)
-
- 4) Add NCQ support (easy to intermediate, once new-EH support appears)
-
- 5) Investigate problems with PCI Message Signalled Interrupts (MSI).
-
- 6) Add port multiplier support (intermediate)
-
- 7) Test and verify 3.0 Gbps support
-
- 8) Develop a low-power-consumption strategy, and implement it.
-
- 9) [Experiment, low priority] See if ATAPI can be supported using
- "unknown FIS" or "vendor-specific FIS" support, or something creative
- like that.
-
- 10) [Experiment, low priority] Investigate interrupt coalescing.
- Quite often, especially with PCI Message Signalled Interrupts (MSI),
- the overhead reduced by interrupt mitigation is quite often not
- worth the latency cost.
-
- 11) [Experiment, Marvell value added] Is it possible to use target
- mode to cross-connect two Linux boxes with Marvell cards? If so,
- creating LibATA target mode support would be very interesting.
-
- Target mode, for those without docs, is the ability to directly
- connect two SATA controllers.
-
- 13) Verify that 7042 is fully supported. I only have a 6042.
-
-*/
-
-
#include
#include
#include
diff --git a/trunk/drivers/ata/sata_promise.c b/trunk/drivers/ata/sata_promise.c
index 2b924a69b365..3a7d9b5332af 100644
--- a/trunk/drivers/ata/sata_promise.c
+++ b/trunk/drivers/ata/sata_promise.c
@@ -297,7 +297,7 @@ static const struct ata_port_info pdc_port_info[] = {
/* board_2057x_pata */
{
- .flags = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS |
+ .flags = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS,
PDC_FLAG_GEN_II,
.pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
diff --git a/trunk/drivers/ata/sata_sis.c b/trunk/drivers/ata/sata_sis.c
index 221099d1d08f..51d9251b0898 100644
--- a/trunk/drivers/ata/sata_sis.c
+++ b/trunk/drivers/ata/sata_sis.c
@@ -255,7 +255,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{
static int printed_version;
struct ata_port_info pi = sis_port_info;
- const struct ata_port_info *ppi[] = { &pi, &pi };
+ const struct ata_port_info *ppi[] = { &pi, NULL };
struct ata_host *host;
u32 genctl, val;
u8 pmr;
diff --git a/trunk/drivers/ata/sata_via.c b/trunk/drivers/ata/sata_via.c
index e8b90e7b42dd..01bba26d8d1a 100644
--- a/trunk/drivers/ata/sata_via.c
+++ b/trunk/drivers/ata/sata_via.c
@@ -85,9 +85,6 @@ static const struct pci_device_id svia_pci_tbl[] = {
{ PCI_VDEVICE(VIA, 0x0591), vt6420 },
{ PCI_VDEVICE(VIA, 0x3149), vt6420 },
{ PCI_VDEVICE(VIA, 0x3249), vt6421 },
- { PCI_VDEVICE(VIA, 0x5287), vt6420 },
- { PCI_VDEVICE(VIA, 0x5372), vt6420 },
- { PCI_VDEVICE(VIA, 0x7372), vt6420 },
{ } /* terminate list */
};
diff --git a/trunk/drivers/atm/idt77252.c b/trunk/drivers/atm/idt77252.c
index 3800bc0cb2ef..057efbc55d38 100644
--- a/trunk/drivers/atm/idt77252.c
+++ b/trunk/drivers/atm/idt77252.c
@@ -47,8 +47,7 @@ static char const rcsid[] =
#include
#include
#include
-#include
-
+#include
#include
#include
#include
@@ -2436,7 +2435,7 @@ idt77252_open(struct atm_vcc *vcc)
set_bit(ATM_VF_ADDR, &vcc->flags);
- mutex_lock(&card->mutex);
+ down(&card->mutex);
OPRINTK("%s: opening vpi.vci: %d.%d\n", card->name, vpi, vci);
@@ -2447,7 +2446,7 @@ idt77252_open(struct atm_vcc *vcc)
break;
default:
printk("%s: Unsupported AAL: %d\n", card->name, vcc->qos.aal);
- mutex_unlock(&card->mutex);
+ up(&card->mutex);
return -EPROTONOSUPPORT;
}
@@ -2456,7 +2455,7 @@ idt77252_open(struct atm_vcc *vcc)
card->vcs[index] = kzalloc(sizeof(struct vc_map), GFP_KERNEL);
if (!card->vcs[index]) {
printk("%s: can't alloc vc in open()\n", card->name);
- mutex_unlock(&card->mutex);
+ up(&card->mutex);
return -ENOMEM;
}
card->vcs[index]->card = card;
@@ -2485,14 +2484,14 @@ idt77252_open(struct atm_vcc *vcc)
if (inuse) {
printk("%s: %s vci already in use.\n", card->name,
inuse == 1 ? "tx" : inuse == 2 ? "rx" : "tx and rx");
- mutex_unlock(&card->mutex);
+ up(&card->mutex);
return -EADDRINUSE;
}
if (vcc->qos.txtp.traffic_class != ATM_NONE) {
error = idt77252_init_tx(card, vc, vcc, &vcc->qos);
if (error) {
- mutex_unlock(&card->mutex);
+ up(&card->mutex);
return error;
}
}
@@ -2500,14 +2499,14 @@ idt77252_open(struct atm_vcc *vcc)
if (vcc->qos.rxtp.traffic_class != ATM_NONE) {
error = idt77252_init_rx(card, vc, vcc, &vcc->qos);
if (error) {
- mutex_unlock(&card->mutex);
+ up(&card->mutex);
return error;
}
}
set_bit(ATM_VF_READY, &vcc->flags);
- mutex_unlock(&card->mutex);
+ up(&card->mutex);
return 0;
}
@@ -2521,7 +2520,7 @@ idt77252_close(struct atm_vcc *vcc)
unsigned long addr;
unsigned long timeout;
- mutex_lock(&card->mutex);
+ down(&card->mutex);
IPRINTK("%s: idt77252_close: vc = %d (%d.%d)\n",
card->name, vc->index, vcc->vpi, vcc->vci);
@@ -2592,7 +2591,7 @@ idt77252_close(struct atm_vcc *vcc)
free_scq(card, vc->scq);
}
- mutex_unlock(&card->mutex);
+ up(&card->mutex);
}
static int
@@ -2603,7 +2602,7 @@ idt77252_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, int flags)
struct vc_map *vc = vcc->dev_data;
int error = 0;
- mutex_lock(&card->mutex);
+ down(&card->mutex);
if (qos->txtp.traffic_class != ATM_NONE) {
if (!test_bit(VCF_TX, &vc->flags)) {
@@ -2649,7 +2648,7 @@ idt77252_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, int flags)
set_bit(ATM_VF_HASQOS, &vcc->flags);
out:
- mutex_unlock(&card->mutex);
+ up(&card->mutex);
return error;
}
@@ -3710,7 +3709,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
membase = pci_resource_start(pcidev, 1);
srambase = pci_resource_start(pcidev, 2);
- mutex_init(&card->mutex);
+ init_MUTEX(&card->mutex);
spin_lock_init(&card->cmd_lock);
spin_lock_init(&card->tst_lock);
diff --git a/trunk/drivers/atm/idt77252.h b/trunk/drivers/atm/idt77252.h
index 6f2b4a5875fb..544b39738291 100644
--- a/trunk/drivers/atm/idt77252.h
+++ b/trunk/drivers/atm/idt77252.h
@@ -37,7 +37,7 @@
#include
#include
#include
-#include
+
/*****************************************************************************/
/* */
@@ -359,7 +359,7 @@ struct idt77252_dev
unsigned long srambase; /* SAR's sram base address */
void __iomem *fbq[4]; /* FBQ fill addresses */
- struct mutex mutex;
+ struct semaphore mutex;
spinlock_t cmd_lock; /* for r/w utility/sram */
unsigned long softstat;
diff --git a/trunk/drivers/block/floppy.c b/trunk/drivers/block/floppy.c
index fe088045dd08..3587cb434371 100644
--- a/trunk/drivers/block/floppy.c
+++ b/trunk/drivers/block/floppy.c
@@ -670,7 +670,7 @@ static void __reschedule_timeout(int drive, const char *message, int marg)
if (drive == current_reqD)
drive = current_drive;
del_timer(&fd_timeout);
- if (drive < 0 || drive >= N_DRIVE) {
+ if (drive < 0 || drive > N_DRIVE) {
fd_timeout.expires = jiffies + 20UL * HZ;
drive = 0;
} else
diff --git a/trunk/drivers/bluetooth/hci_usb.c b/trunk/drivers/bluetooth/hci_usb.c
index 7e04dd69f609..b0238b46dded 100644
--- a/trunk/drivers/bluetooth/hci_usb.c
+++ b/trunk/drivers/bluetooth/hci_usb.c
@@ -115,11 +115,11 @@ static struct usb_device_id blacklist_ids[] = {
{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
/* Broadcom BCM2045 */
- { USB_DEVICE(0x0a5c, 0x2101), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
+ { USB_DEVICE(0x0a5c, 0x2101), .driver_info = HCI_WRONG_SCO_MTU },
/* IBM/Lenovo ThinkPad with Broadcom chip */
- { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
- { USB_DEVICE(0x0a5c, 0x2110), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
+ { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU },
+ { USB_DEVICE(0x0a5c, 0x2110), .driver_info = HCI_WRONG_SCO_MTU },
/* Targus ACB10US */
{ USB_DEVICE(0x0a5c, 0x2100), .driver_info = HCI_RESET },
@@ -128,17 +128,17 @@ static struct usb_device_id blacklist_ids[] = {
{ USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET },
/* HP laptop with Broadcom chip */
- { USB_DEVICE(0x03f0, 0x171d), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
+ { USB_DEVICE(0x03f0, 0x171d), .driver_info = HCI_WRONG_SCO_MTU },
/* Dell laptop with Broadcom chip */
- { USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
+ { USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_WRONG_SCO_MTU },
/* Microsoft Wireless Transceiver for Bluetooth 2.0 */
{ USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
/* Kensington Bluetooth USB adapter */
{ USB_DEVICE(0x047d, 0x105d), .driver_info = HCI_RESET },
- { USB_DEVICE(0x047d, 0x105e), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
+ { USB_DEVICE(0x047d, 0x105e), .driver_info = HCI_WRONG_SCO_MTU },
/* ISSC Bluetooth Adapter v3.1 */
{ USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET },
@@ -148,8 +148,8 @@ static struct usb_device_id blacklist_ids[] = {
{ USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC },
/* Belkin F8T012 and F8T013 devices */
- { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
- { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
+ { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_WRONG_SCO_MTU },
+ { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_WRONG_SCO_MTU },
/* Digianswer devices */
{ USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER },
diff --git a/trunk/drivers/char/cyclades.c b/trunk/drivers/char/cyclades.c
index ca376b92162c..c72ee97d3892 100644
--- a/trunk/drivers/char/cyclades.c
+++ b/trunk/drivers/char/cyclades.c
@@ -1061,7 +1061,6 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
if (data & info->ignore_status_mask) {
info->icount.rx++;
- spin_unlock(&cinfo->card_lock);
return;
}
if (tty_buffer_request_room(tty, 1)) {
diff --git a/trunk/drivers/char/drm/Kconfig b/trunk/drivers/char/drm/Kconfig
index 0b7ffa5191c6..ef833a1c27eb 100644
--- a/trunk/drivers/char/drm/Kconfig
+++ b/trunk/drivers/char/drm/Kconfig
@@ -6,7 +6,7 @@
#
config DRM
tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
- depends on (AGP || AGP=n) && PCI && !EMULATED_CMPXCHG
+ depends on (AGP || AGP=n) && PCI
help
Kernel-level support for the Direct Rendering Infrastructure (DRI)
introduced in XFree86 4.0. If you say Y here, you need to select
diff --git a/trunk/drivers/char/drm/drm_drawable.c b/trunk/drivers/char/drm/drm_drawable.c
index b33313be2547..de37d5f74563 100644
--- a/trunk/drivers/char/drm/drm_drawable.c
+++ b/trunk/drivers/char/drm/drm_drawable.c
@@ -172,49 +172,38 @@ int drm_rmdraw(DRM_IOCTL_ARGS)
bitfield_length = idx + 1;
- bitfield = NULL;
+ if (idx != id / (8 * sizeof(*bitfield)))
+ bitfield = drm_alloc(bitfield_length *
+ sizeof(*bitfield), DRM_MEM_BUFS);
- if (bitfield_length) {
- if (bitfield_length != dev->drw_bitfield_length)
- bitfield = drm_alloc(bitfield_length *
- sizeof(*bitfield),
- DRM_MEM_BUFS);
-
- if (!bitfield) {
- bitfield = dev->drw_bitfield;
- bitfield_length = dev->drw_bitfield_length;
- }
+ if (!bitfield && bitfield_length) {
+ bitfield = dev->drw_bitfield;
+ bitfield_length = dev->drw_bitfield_length;
}
}
if (bitfield != dev->drw_bitfield) {
info_length = 8 * sizeof(*bitfield) * bitfield_length;
- if (info_length) {
- info = drm_alloc(info_length * sizeof(*info),
- DRM_MEM_BUFS);
+ info = drm_alloc(info_length * sizeof(*info), DRM_MEM_BUFS);
- if (!info) {
- info = dev->drw_info;
- info_length = dev->drw_info_length;
- }
- } else
- info = NULL;
+ if (!info && info_length) {
+ info = dev->drw_info;
+ info_length = dev->drw_info_length;
+ }
spin_lock_irqsave(&dev->drw_lock, irqflags);
- if (bitfield)
- memcpy(bitfield, dev->drw_bitfield, bitfield_length *
- sizeof(*bitfield));
+ memcpy(bitfield, dev->drw_bitfield, bitfield_length *
+ sizeof(*bitfield));
drm_free(dev->drw_bitfield, sizeof(*bitfield) *
dev->drw_bitfield_length, DRM_MEM_BUFS);
dev->drw_bitfield = bitfield;
dev->drw_bitfield_length = bitfield_length;
if (info != dev->drw_info) {
- if (info)
- memcpy(info, dev->drw_info, info_length *
- sizeof(*info));
+ memcpy(info, dev->drw_info, info_length *
+ sizeof(*info));
drm_free(dev->drw_info, sizeof(*info) *
dev->drw_info_length, DRM_MEM_BUFS);
dev->drw_info = info;
diff --git a/trunk/drivers/char/drm/drm_pciids.h b/trunk/drivers/char/drm/drm_pciids.h
index 177ccc07f968..31cdde83713b 100644
--- a/trunk/drivers/char/drm/drm_pciids.h
+++ b/trunk/drivers/char/drm/drm_pciids.h
@@ -102,20 +102,13 @@
{0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
{0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \
{0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \
- {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
{0x1002, 0x5955, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
- {0x1002, 0x5974, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
- {0x1002, 0x5975, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
{0x1002, 0x5960, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
{0x1002, 0x5961, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
{0x1002, 0x5962, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
{0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
{0x1002, 0x5965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
{0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \
- {0x1002, 0x5a41, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
- {0x1002, 0x5a42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
- {0x1002, 0x5a61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
- {0x1002, 0x5a62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
{0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
{0x1002, 0x5b62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
{0x1002, 0x5b63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
diff --git a/trunk/drivers/char/drm/i915_irq.c b/trunk/drivers/char/drm/i915_irq.c
index b92062a239f1..78c1ae28f17c 100644
--- a/trunk/drivers/char/drm/i915_irq.c
+++ b/trunk/drivers/char/drm/i915_irq.c
@@ -582,7 +582,7 @@ void i915_driver_irq_postinstall(drm_device_t * dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
- spin_lock_init(&dev_priv->swaps_lock);
+ dev_priv->swaps_lock = SPIN_LOCK_UNLOCKED;
INIT_LIST_HEAD(&dev_priv->vbl_swaps.head);
dev_priv->swaps_pending = 0;
diff --git a/trunk/drivers/char/random.c b/trunk/drivers/char/random.c
index 0474cac4a84e..46c1b97748b6 100644
--- a/trunk/drivers/char/random.c
+++ b/trunk/drivers/char/random.c
@@ -760,7 +760,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
static void extract_buf(struct entropy_store *r, __u8 *out)
{
- int i;
+ int i, x;
__u32 data[16], buf[5 + SHA_WORKSPACE_WORDS];
sha_init(buf);
@@ -772,11 +772,9 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
* attempts to find previous ouputs), unless the hash
* function can be inverted.
*/
- for (i = 0; i < r->poolinfo->poolwords; i += 16) {
- /* hash blocks of 16 words = 512 bits */
- sha_transform(buf, (__u8 *)(r->pool + i), buf + 5);
- /* feed back portion of the resulting hash */
- add_entropy_words(r, &buf[i % 5], 1);
+ for (i = 0, x = 0; i < r->poolinfo->poolwords; i += 16, x+=2) {
+ sha_transform(buf, (__u8 *)r->pool+i, buf + 5);
+ add_entropy_words(r, &buf[x % 5], 1);
}
/*
@@ -784,7 +782,7 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
* portion of the pool while mixing, and hash one
* final time.
*/
- __add_entropy_words(r, &buf[i % 5], 1, data);
+ __add_entropy_words(r, &buf[x % 5], 1, data);
sha_transform(buf, (__u8 *)data, buf + 5);
/*
@@ -1020,44 +1018,37 @@ random_poll(struct file *file, poll_table * wait)
return mask;
}
-static int
-write_pool(struct entropy_store *r, const char __user *buffer, size_t count)
+static ssize_t
+random_write(struct file * file, const char __user * buffer,
+ size_t count, loff_t *ppos)
{
+ int ret = 0;
size_t bytes;
__u32 buf[16];
const char __user *p = buffer;
+ size_t c = count;
- while (count > 0) {
- bytes = min(count, sizeof(buf));
- if (copy_from_user(&buf, p, bytes))
- return -EFAULT;
+ while (c > 0) {
+ bytes = min(c, sizeof(buf));
- count -= bytes;
+ bytes -= copy_from_user(&buf, p, bytes);
+ if (!bytes) {
+ ret = -EFAULT;
+ break;
+ }
+ c -= bytes;
p += bytes;
- add_entropy_words(r, buf, (bytes + 3) / 4);
+ add_entropy_words(&input_pool, buf, (bytes + 3) / 4);
+ }
+ if (p == buffer) {
+ return (ssize_t)ret;
+ } else {
+ struct inode *inode = file->f_path.dentry->d_inode;
+ inode->i_mtime = current_fs_time(inode->i_sb);
+ mark_inode_dirty(inode);
+ return (ssize_t)(p - buffer);
}
-
- return 0;
-}
-
-static ssize_t
-random_write(struct file * file, const char __user * buffer,
- size_t count, loff_t *ppos)
-{
- size_t ret;
- struct inode *inode = file->f_path.dentry->d_inode;
-
- ret = write_pool(&blocking_pool, buffer, count);
- if (ret)
- return ret;
- ret = write_pool(&nonblocking_pool, buffer, count);
- if (ret)
- return ret;
-
- inode->i_mtime = current_fs_time(inode->i_sb);
- mark_inode_dirty(inode);
- return (ssize_t)count;
}
static int
@@ -1096,8 +1087,8 @@ random_ioctl(struct inode * inode, struct file * file,
return -EINVAL;
if (get_user(size, p++))
return -EFAULT;
- retval = write_pool(&input_pool, (const char __user *)p,
- size);
+ retval = random_write(file, (const char __user *) p,
+ size, &file->f_pos);
if (retval < 0)
return retval;
credit_entropy_store(&input_pool, ent_count);
diff --git a/trunk/drivers/crypto/geode-aes.c b/trunk/drivers/crypto/geode-aes.c
index 6a86958b577f..6d3840e629de 100644
--- a/trunk/drivers/crypto/geode-aes.c
+++ b/trunk/drivers/crypto/geode-aes.c
@@ -102,15 +102,10 @@ geode_aes_crypt(struct geode_aes_op *op)
u32 flags = 0;
unsigned long iflags;
- if (op->len == 0)
+ if (op->len == 0 || op->src == op->dst)
return 0;
- /* If the source and destination is the same, then
- * we need to turn on the coherent flags, otherwise
- * we don't need to worry
- */
-
- if (op->src == op->dst)
+ if (op->flags & AES_FLAGS_COHERENT)
flags |= (AES_CTRL_DCA | AES_CTRL_SCA);
if (op->dir == AES_DIR_ENCRYPT)
@@ -125,7 +120,7 @@ geode_aes_crypt(struct geode_aes_op *op)
_writefield(AES_WRITEIV0_REG, op->iv);
}
- if (!(op->flags & AES_FLAGS_HIDDENKEY)) {
+ if (op->flags & AES_FLAGS_USRKEY) {
flags |= AES_CTRL_WRKEY;
_writefield(AES_WRITEKEY0_REG, op->key);
}
@@ -294,7 +289,6 @@ static struct crypto_alg geode_cbc_alg = {
.setkey = geode_setkey,
.encrypt = geode_cbc_encrypt,
.decrypt = geode_cbc_decrypt,
- .ivsize = AES_IV_LENGTH,
}
}
};
diff --git a/trunk/drivers/crypto/geode-aes.h b/trunk/drivers/crypto/geode-aes.h
index f47968671ae7..8003a36f3a83 100644
--- a/trunk/drivers/crypto/geode-aes.h
+++ b/trunk/drivers/crypto/geode-aes.h
@@ -20,7 +20,8 @@
#define AES_DIR_DECRYPT 0
#define AES_DIR_ENCRYPT 1
-#define AES_FLAGS_HIDDENKEY (1 << 0)
+#define AES_FLAGS_USRKEY (1 << 0)
+#define AES_FLAGS_COHERENT (1 << 1)
struct geode_aes_op {
diff --git a/trunk/drivers/firewire/Kconfig b/trunk/drivers/firewire/Kconfig
index 396dade731f9..5932c72f9e42 100644
--- a/trunk/drivers/firewire/Kconfig
+++ b/trunk/drivers/firewire/Kconfig
@@ -18,7 +18,7 @@ config FIREWIRE
your IEEE 1394 adapter.
To compile this driver as a module, say M here: the module will be
- called firewire-core.
+ called fw-core.
This is the "JUJU" FireWire stack, an alternative implementation
designed for robustness and simplicity. You can build either this
@@ -34,11 +34,11 @@ config FIREWIRE_OHCI
is the only chipset in use, so say Y here.
To compile this driver as a module, say M here: The module will be
- called firewire-ohci.
+ called fw-ohci.
If you also build ohci1394 of the classic IEEE 1394 driver stack,
- blacklist either ohci1394 or firewire-ohci to let hotplug load the
- desired driver.
+ blacklist either ohci1394 or fw-ohci to let hotplug load the desired
+ driver.
config FIREWIRE_SBP2
tristate "Support for storage devices (SBP-2 protocol driver)"
@@ -50,12 +50,12 @@ config FIREWIRE_SBP2
like scanners.
To compile this driver as a module, say M here: The module will be
- called firewire-sbp2.
+ called fw-sbp2.
You should also enable support for disks, CD-ROMs, etc. in the SCSI
configuration section.
If you also build sbp2 of the classic IEEE 1394 driver stack,
- blacklist either sbp2 or firewire-sbp2 to let hotplug load the
- desired driver.
+ blacklist either sbp2 or fw-sbp2 to let hotplug load the desired
+ driver.
diff --git a/trunk/drivers/firewire/Makefile b/trunk/drivers/firewire/Makefile
index a7c31e9039c1..fc7d59d4bce0 100644
--- a/trunk/drivers/firewire/Makefile
+++ b/trunk/drivers/firewire/Makefile
@@ -2,11 +2,9 @@
# Makefile for the Linux IEEE 1394 implementation
#
-firewire-core-y += fw-card.o fw-topology.o fw-transaction.o fw-iso.o \
- fw-device.o fw-cdev.o
-firewire-ohci-y += fw-ohci.o
-firewire-sbp2-y += fw-sbp2.o
+fw-core-y += fw-card.o fw-topology.o fw-transaction.o fw-iso.o \
+ fw-device.o fw-cdev.o
-obj-$(CONFIG_FIREWIRE) += firewire-core.o
-obj-$(CONFIG_FIREWIRE_OHCI) += firewire-ohci.o
-obj-$(CONFIG_FIREWIRE_SBP2) += firewire-sbp2.o
+obj-$(CONFIG_FIREWIRE) += fw-core.o
+obj-$(CONFIG_FIREWIRE_OHCI) += fw-ohci.o
+obj-$(CONFIG_FIREWIRE_SBP2) += fw-sbp2.o
diff --git a/trunk/drivers/firewire/fw-cdev.c b/trunk/drivers/firewire/fw-cdev.c
index 3ab3585d3601..0fa5bd54c6a1 100644
--- a/trunk/drivers/firewire/fw-cdev.c
+++ b/trunk/drivers/firewire/fw-cdev.c
@@ -365,7 +365,7 @@ complete_transaction(struct fw_card *card, int rcode,
response->response.data, response->response.length);
}
-static int ioctl_send_request(struct client *client, void *buffer)
+static ssize_t ioctl_send_request(struct client *client, void *buffer)
{
struct fw_device *device = client->device;
struct fw_cdev_send_request *request = buffer;
diff --git a/trunk/drivers/firewire/fw-ohci.c b/trunk/drivers/firewire/fw-ohci.c
index 2e4cfa57126d..c17342d3e6fd 100644
--- a/trunk/drivers/firewire/fw-ohci.c
+++ b/trunk/drivers/firewire/fw-ohci.c
@@ -268,7 +268,7 @@ static int ar_context_add_page(struct ar_context *ctx)
dma_sync_single_for_device(dev, ab_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
- ctx->last_buffer->descriptor.branch_address = cpu_to_le32(ab_bus | 1);
+ ctx->last_buffer->descriptor.branch_address = ab_bus | 1;
ctx->last_buffer->next = ab;
ctx->last_buffer = ab;
@@ -417,8 +417,7 @@ ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, u32 regs)
ctx->current_buffer = ab.next;
ctx->pointer = ctx->current_buffer->data;
- reg_write(ctx->ohci, COMMAND_PTR(ctx->regs),
- le32_to_cpu(ab.descriptor.branch_address));
+ reg_write(ctx->ohci, COMMAND_PTR(ctx->regs), ab.descriptor.branch_address);
reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN);
flush_writes(ctx->ohci);
diff --git a/trunk/drivers/hwmon/Kconfig b/trunk/drivers/hwmon/Kconfig
index 13eea47dceb3..4d1cb5b855d1 100644
--- a/trunk/drivers/hwmon/Kconfig
+++ b/trunk/drivers/hwmon/Kconfig
@@ -620,7 +620,7 @@ config SENSORS_HDAPS
config SENSORS_APPLESMC
tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)"
- depends on INPUT && X86
+ depends on HWMON && INPUT && X86
select NEW_LEDS
select LEDS_CLASS
default n
diff --git a/trunk/drivers/hwmon/applesmc.c b/trunk/drivers/hwmon/applesmc.c
index fd1281f42209..0c160675b3ac 100644
--- a/trunk/drivers/hwmon/applesmc.c
+++ b/trunk/drivers/hwmon/applesmc.c
@@ -491,12 +491,6 @@ static void applesmc_idev_poll(unsigned long unused)
/* Sysfs Files */
-static ssize_t applesmc_name_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- return snprintf(buf, PAGE_SIZE, "applesmc\n");
-}
-
static ssize_t applesmc_position_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -919,8 +913,6 @@ static struct led_classdev applesmc_backlight = {
.brightness_set = applesmc_brightness_set,
};
-static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL);
-
static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL);
static DEVICE_ATTR(calibrate, 0644,
applesmc_calibrate_show, applesmc_calibrate_store);
@@ -1205,14 +1197,10 @@ static int __init applesmc_init(void)
goto out_driver;
}
- ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr);
- if (ret)
- goto out_device;
-
/* Create key enumeration sysfs files */
ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group);
if (ret)
- goto out_name;
+ goto out_device;
/* create fan files */
count = applesmc_get_fan_count();
@@ -1312,8 +1300,6 @@ static int __init applesmc_init(void)
sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]);
out_key_enumeration:
sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group);
-out_name:
- sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr);
out_device:
platform_device_unregister(pdev);
out_driver:
@@ -1339,7 +1325,6 @@ static void __exit applesmc_exit(void)
sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]);
sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]);
sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group);
- sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr);
platform_device_unregister(pdev);
platform_driver_unregister(&applesmc_driver);
release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
diff --git a/trunk/drivers/hwmon/coretemp.c b/trunk/drivers/hwmon/coretemp.c
index 0328382df8fa..75e3911810a3 100644
--- a/trunk/drivers/hwmon/coretemp.c
+++ b/trunk/drivers/hwmon/coretemp.c
@@ -176,22 +176,6 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
goto exit_free;
}
- /* Check if we have problem with errata AE18 of Core processors:
- Readings might stop update when processor visited too deep sleep,
- fixed for stepping D0 (6EC).
- */
-
- if ((c->x86_model == 0xe) && (c->x86_mask < 0xc)) {
- /* check for microcode update */
- rdmsr_on_cpu(data->id, MSR_IA32_UCODE_REV, &eax, &edx);
- if (edx < 0x39) {
- dev_err(&pdev->dev,
- "Errata AE18 not fixed, update BIOS or "
- "microcode of the CPU!\n");
- goto exit_free;
- }
- }
-
/* Some processors have Tjmax 85 following magic should detect it
Intel won't disclose the information without signed NDA, but
individuals cannot sign it. Catch(ed) 22.
@@ -209,19 +193,6 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
}
}
- /* Intel says that above should not work for desktop Core2 processors,
- but it seems to work. There is no other way how get the absolute
- readings. Warn the user about this. First check if are desktop,
- bit 50 of MSR_IA32_PLATFORM_ID should be 0.
- */
-
- rdmsr_safe_on_cpu(data->id, MSR_IA32_PLATFORM_ID, &eax, &edx);
-
- if ((c->x86_model == 0xf) && (!(edx & 0x00040000))) {
- dev_warn(&pdev->dev, "Using undocumented features, absolute "
- "temperature might be wrong!\n");
- }
-
platform_set_drvdata(pdev, data);
if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
@@ -359,6 +330,9 @@ static int __init coretemp_init(void)
int i, err = -ENODEV;
struct pdev_entry *p, *n;
+ printk(KERN_NOTICE DRVNAME ": This driver uses undocumented features "
+ "of Core CPU. Temperature might be wrong!\n");
+
/* quick check if we run Intel */
if (cpu_data[0].x86_vendor != X86_VENDOR_INTEL)
goto exit;
diff --git a/trunk/drivers/hwmon/ds1621.c b/trunk/drivers/hwmon/ds1621.c
index d5ac422d73b2..c849c0c6ee9c 100644
--- a/trunk/drivers/hwmon/ds1621.c
+++ b/trunk/drivers/hwmon/ds1621.c
@@ -53,8 +53,8 @@ MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low")
/* The DS1621 registers */
#define DS1621_REG_TEMP 0xAA /* word, RO */
-#define DS1621_REG_TEMP_MIN 0xA2 /* word, RW */
-#define DS1621_REG_TEMP_MAX 0xA1 /* word, RW */
+#define DS1621_REG_TEMP_MIN 0xA1 /* word, RW */
+#define DS1621_REG_TEMP_MAX 0xA2 /* word, RW */
#define DS1621_REG_CONF 0xAC /* byte, RW */
#define DS1621_COM_START 0xEE /* no data */
#define DS1621_COM_STOP 0x22 /* no data */
@@ -328,9 +328,9 @@ static struct ds1621_data *ds1621_update_client(struct device *dev)
/* reset alarms if necessary */
new_conf = data->conf;
- if (data->temp > data->temp_min)
+ if (data->temp < data->temp_min)
new_conf &= ~DS1621_ALARM_TEMP_LOW;
- if (data->temp < data->temp_max)
+ if (data->temp > data->temp_max)
new_conf &= ~DS1621_ALARM_TEMP_HIGH;
if (data->conf != new_conf)
ds1621_write_value(client, DS1621_REG_CONF,
diff --git a/trunk/drivers/hwmon/hwmon-vid.c b/trunk/drivers/hwmon/hwmon-vid.c
index f17e771e42f8..5aab23b93e24 100644
--- a/trunk/drivers/hwmon/hwmon-vid.c
+++ b/trunk/drivers/hwmon/hwmon-vid.c
@@ -132,9 +132,7 @@ int vid_from_reg(int val, u8 vrm)
val &= 0x7f;
return(val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000);
default: /* report 0 for unknown */
- if (vrm)
- printk(KERN_WARNING "hwmon-vid: Requested unsupported "
- "VRM version (%u)\n", (unsigned int)vrm);
+ printk(KERN_INFO "hwmon-vid: requested unknown VRM version\n");
return 0;
}
}
diff --git a/trunk/drivers/hwmon/w83627hf.c b/trunk/drivers/hwmon/w83627hf.c
index 12cb40a975de..a5b774b07cbd 100644
--- a/trunk/drivers/hwmon/w83627hf.c
+++ b/trunk/drivers/hwmon/w83627hf.c
@@ -965,10 +965,8 @@ static int __init w83627hf_find(int sioaddr, unsigned short *addr,
case W687THF_DEVID:
sio_data->type = w83687thf;
break;
- case 0xff: /* No device at all */
- goto exit;
default:
- pr_debug(DRVNAME ": Unsupported chip (DEVID=0x%02x)\n", val);
+ pr_debug(DRVNAME ": Unsupported chip (DEVID=0x%x)\n", val);
goto exit;
}
diff --git a/trunk/drivers/i2c/busses/i2c-pxa.c b/trunk/drivers/i2c/busses/i2c-pxa.c
index 28e7b91a4553..8a0a99b93641 100644
--- a/trunk/drivers/i2c/busses/i2c-pxa.c
+++ b/trunk/drivers/i2c/busses/i2c-pxa.c
@@ -837,10 +837,20 @@ static const struct i2c_algorithm i2c_pxa_algorithm = {
.functionality = i2c_pxa_functionality,
};
+static struct pxa_i2c i2c_pxa = {
+ .lock = __SPIN_LOCK_UNLOCKED(i2c_pxa.lock),
+ .adap = {
+ .owner = THIS_MODULE,
+ .algo = &i2c_pxa_algorithm,
+ .name = "pxa2xx-i2c.0",
+ .retries = 5,
+ },
+};
+
#define res_len(r) ((r)->end - (r)->start + 1)
static int i2c_pxa_probe(struct platform_device *dev)
{
- struct pxa_i2c *i2c;
+ struct pxa_i2c *i2c = &i2c_pxa;
struct resource *res;
struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
int ret;
@@ -854,20 +864,15 @@ static int i2c_pxa_probe(struct platform_device *dev)
if (!request_mem_region(res->start, res_len(res), res->name))
return -ENOMEM;
- i2c = kzalloc(sizeof(struct pxa_i2c), GFP_KERNEL);
+ i2c = kmalloc(sizeof(struct pxa_i2c), GFP_KERNEL);
if (!i2c) {
ret = -ENOMEM;
goto emalloc;
}
- i2c->adap.owner = THIS_MODULE;
- i2c->adap.algo = &i2c_pxa_algorithm;
- i2c->adap.retries = 5;
-
- spin_lock_init(&i2c->lock);
+ memcpy(i2c, &i2c_pxa, sizeof(struct pxa_i2c));
init_waitqueue_head(&i2c->wait);
-
- sprintf(i2c->adap.name, "pxa_i2c-i2c.%u", dev->id);
+ i2c->adap.name[strlen(i2c->adap.name) - 1] = '0' + dev->id % 10;
i2c->reg_base = ioremap(res->start, res_len(res));
if (!i2c->reg_base) {
diff --git a/trunk/drivers/i2c/busses/i2c-s3c2410.c b/trunk/drivers/i2c/busses/i2c-s3c2410.c
index e4540fcf6476..e68a96f589fd 100644
--- a/trunk/drivers/i2c/busses/i2c-s3c2410.c
+++ b/trunk/drivers/i2c/busses/i2c-s3c2410.c
@@ -830,8 +830,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
i2c->irq = res;
- dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res,
- (unsigned long)res->start);
+ dev_dbg(&pdev->dev, "irq resource %p (%ld)\n", res, res->start);
ret = i2c_add_adapter(&i2c->adap);
if (ret < 0) {
diff --git a/trunk/drivers/i2c/busses/i2c-tiny-usb.c b/trunk/drivers/i2c/busses/i2c-tiny-usb.c
index cb9abe7565a7..907999049d50 100644
--- a/trunk/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/trunk/drivers/i2c/busses/i2c-tiny-usb.c
@@ -208,7 +208,7 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface,
dev->adapter.class = I2C_CLASS_HWMON;
dev->adapter.algo = &usb_algorithm;
dev->adapter.algo_data = dev;
- snprintf(dev->adapter.name, sizeof(dev->adapter.name),
+ snprintf(dev->adapter.name, I2C_NAME_SIZE,
"i2c-tiny-usb at bus %03d device %03d",
dev->usb_dev->bus->busnum, dev->usb_dev->devnum);
diff --git a/trunk/drivers/i2c/i2c-core.c b/trunk/drivers/i2c/i2c-core.c
index 435925eba437..64f8e56d300e 100644
--- a/trunk/drivers/i2c/i2c-core.c
+++ b/trunk/drivers/i2c/i2c-core.c
@@ -697,10 +697,9 @@ int i2c_attach_client(struct i2c_client *client)
if (client->driver)
client->dev.driver = &client->driver->driver;
- if (client->driver && !is_newstyle_driver(client->driver)) {
+ if (client->driver && !is_newstyle_driver(client->driver))
client->dev.release = i2c_client_release;
- client->dev.uevent_suppress = 1;
- } else
+ else
client->dev.release = i2c_client_dev_release;
snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id),
diff --git a/trunk/drivers/ide/ide-dma.c b/trunk/drivers/ide/ide-dma.c
index ead141e2db9e..b77b7d138c49 100644
--- a/trunk/drivers/ide/ide-dma.c
+++ b/trunk/drivers/ide/ide-dma.c
@@ -119,17 +119,15 @@ static const struct drive_list_entry drive_blacklist [] = {
{ "HITACHI CDR-8335" , "ALL" },
{ "HITACHI CDR-8435" , "ALL" },
{ "Toshiba CD-ROM XM-6202B" , "ALL" },
- { "TOSHIBA CD-ROM XM-1702BC", "ALL" },
{ "CD-532E-A" , "ALL" },
{ "E-IDE CD-ROM CR-840", "ALL" },
{ "CD-ROM Drive/F5A", "ALL" },
{ "WPI CDD-820", "ALL" },
{ "SAMSUNG CD-ROM SC-148C", "ALL" },
{ "SAMSUNG CD-ROM SC", "ALL" },
+ { "SanDisk SDP3B-64" , "ALL" },
{ "ATAPI CD-ROM DRIVE 40X MAXIMUM", "ALL" },
{ "_NEC DV5800A", "ALL" },
- { "SAMSUNG CD-ROM SN-124", "N001" },
- { "Seagate STT20000A", "ALL" },
{ NULL , NULL }
};
diff --git a/trunk/drivers/ide/ide-proc.c b/trunk/drivers/ide/ide-proc.c
index ea94c9aa1220..d50bd996ff22 100644
--- a/trunk/drivers/ide/ide-proc.c
+++ b/trunk/drivers/ide/ide-proc.c
@@ -67,8 +67,6 @@ static int proc_ide_read_imodel
case ide_4drives: name = "4drives"; break;
case ide_pmac: name = "mac-io"; break;
case ide_au1xxx: name = "au1xxx"; break;
- case ide_etrax100: name = "etrax100"; break;
- case ide_acorn: name = "acorn"; break;
default: name = "(unknown)"; break;
}
len = sprintf(page, "%s\n", name);
diff --git a/trunk/drivers/ide/pci/atiixp.c b/trunk/drivers/ide/pci/atiixp.c
index 8ab33faf6f76..0e52ad722a72 100644
--- a/trunk/drivers/ide/pci/atiixp.c
+++ b/trunk/drivers/ide/pci/atiixp.c
@@ -317,7 +317,6 @@ static struct pci_device_id atiixp_pci_tbl[] = {
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
diff --git a/trunk/drivers/ide/pci/serverworks.c b/trunk/drivers/ide/pci/serverworks.c
index 47bcd91c9b5f..6234f806c6b5 100644
--- a/trunk/drivers/ide/pci/serverworks.c
+++ b/trunk/drivers/ide/pci/serverworks.c
@@ -158,12 +158,6 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed)
pci_read_config_word(dev, 0x4A, &csb5_pio);
pci_read_config_byte(dev, 0x54, &ultra_enable);
- /* If we are in RAID mode (eg AMI MegaIDE) then we can't it
- turns out trust the firmware configuration */
-
- if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
- goto oem_setup_failed;
-
/* Per Specified Design by OEM, and ASIC Architect */
if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
(dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) {
@@ -179,7 +173,7 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed)
((dma_stat&(1<<(5+unit)))==(1<<(5+unit)))) {
u8 dmaspeed = dma_timing;
- dma_timing &= ~0xFFU;
+ dma_timing &= ~0xFF;
if ((dmaspeed & 0x20) == 0x20)
dmaspeed = XFER_MW_DMA_2;
else if ((dmaspeed & 0x21) == 0x21)
@@ -193,7 +187,7 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed)
} else if (pio_timing) {
u8 piospeed = pio_timing;
- pio_timing &= ~0xFFU;
+ pio_timing &= ~0xFF;
if ((piospeed & 0x20) == 0x20)
piospeed = XFER_PIO_4;
else if ((piospeed & 0x22) == 0x22)
@@ -214,8 +208,8 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed)
oem_setup_failed:
- pio_timing &= ~0xFFU;
- dma_timing &= ~0xFFU;
+ pio_timing &= ~0xFF;
+ dma_timing &= ~0xFF;
ultra_timing &= ~(0x0F << (4*unit));
ultra_enable &= ~(0x01 << drive->dn);
csb5_pio &= ~(0x0F << (4*drive->dn));
diff --git a/trunk/drivers/ieee1394/eth1394.c b/trunk/drivers/ieee1394/eth1394.c
index 5f026b5d7857..2296d43a2414 100644
--- a/trunk/drivers/ieee1394/eth1394.c
+++ b/trunk/drivers/ieee1394/eth1394.c
@@ -47,7 +47,6 @@
#include
#include
#include
-#include
#include
#include
@@ -236,9 +235,6 @@ static int ether1394_open(struct net_device *dev)
/* This is called after an "ifdown" */
static int ether1394_stop(struct net_device *dev)
{
- /* flush priv->wake */
- flush_scheduled_work();
-
netif_stop_queue(dev);
return 0;
}
@@ -534,37 +530,6 @@ static void ether1394_init_dev(struct net_device *dev)
dev->tx_queue_len = 1000;
}
-/*
- * Wake the queue up after commonly encountered transmit failure conditions are
- * hopefully over. Currently only tlabel exhaustion is accounted for.
- */
-static void ether1394_wake_queue(struct work_struct *work)
-{
- struct eth1394_priv *priv;
- struct hpsb_packet *packet;
-
- priv = container_of(work, struct eth1394_priv, wake);
- packet = hpsb_alloc_packet(0);
-
- /* This is really bad, but unjam the queue anyway. */
- if (!packet)
- goto out;
-
- packet->host = priv->host;
- packet->node_id = priv->wake_node;
- /*
- * A transaction label is all we really want. If we get one, it almost
- * always means we can get a lot more because the ieee1394 core recycled
- * a whole batch of tlabels, at last.
- */
- if (hpsb_get_tlabel(packet) == 0)
- hpsb_free_tlabel(packet);
-
- hpsb_free_packet(packet);
-out:
- netif_wake_queue(priv->wake_dev);
-}
-
/*
* This function is called every time a card is found. It is generally called
* when the module is installed. This is where we add all of our ethernet
@@ -599,17 +564,16 @@ static void ether1394_add_host(struct hpsb_host *host)
}
SET_MODULE_OWNER(dev);
-
- /* This used to be &host->device in Linux 2.6.20 and before. */
- SET_NETDEV_DEV(dev, host->device.parent);
+#if 0
+ /* FIXME - Is this the correct parent device anyway? */
+ SET_NETDEV_DEV(dev, &host->device);
+#endif
priv = netdev_priv(dev);
INIT_LIST_HEAD(&priv->ip_node_list);
spin_lock_init(&priv->lock);
priv->host = host;
priv->local_fifo = fifo_addr;
- INIT_WORK(&priv->wake, ether1394_wake_queue);
- priv->wake_dev = dev;
hi = hpsb_create_hostinfo(ð1394_highlevel, host, sizeof(*hi));
if (hi == NULL) {
@@ -1426,17 +1390,22 @@ static int ether1394_prep_write_packet(struct hpsb_packet *p,
u64 addr, void *data, int tx_len)
{
p->node_id = node;
-
- if (hpsb_get_tlabel(p))
- return -EAGAIN;
+ p->data = NULL;
p->tcode = TCODE_WRITEB;
+ p->header[1] = host->node_id << 16 | addr >> 32;
+ p->header[2] = addr & 0xffffffff;
+
p->header_size = 16;
p->expect_response = 1;
+
+ if (hpsb_get_tlabel(p)) {
+ ETH1394_PRINT_G(KERN_ERR, "Out of tlabels\n");
+ return -1;
+ }
p->header[0] =
p->node_id << 16 | p->tlabel << 10 | 1 << 8 | TCODE_WRITEB << 4;
- p->header[1] = host->node_id << 16 | addr >> 32;
- p->header[2] = addr & 0xffffffff;
+
p->header[3] = tx_len << 16;
p->data_size = (tx_len + 3) & ~3;
p->data = data;
@@ -1482,7 +1451,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
packet = ether1394_alloc_common_packet(priv->host);
if (!packet)
- return -ENOMEM;
+ return -1;
if (ptask->tx_type == ETH1394_GASP) {
int length = tx_len + 2 * sizeof(quadlet_t);
@@ -1493,7 +1462,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
ptask->addr, ptask->skb->data,
tx_len)) {
hpsb_free_packet(packet);
- return -EAGAIN;
+ return -1;
}
ptask->packet = packet;
@@ -1502,7 +1471,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
if (hpsb_send_packet(packet) < 0) {
ether1394_free_packet(packet);
- return -EIO;
+ return -1;
}
return 0;
@@ -1545,18 +1514,13 @@ static void ether1394_complete_cb(void *__ptask)
ptask->outstanding_pkts--;
if (ptask->outstanding_pkts > 0 && !fail) {
- int tx_len, err;
+ int tx_len;
/* Add the encapsulation header to the fragment */
tx_len = ether1394_encapsulate(ptask->skb, ptask->max_payload,
&ptask->hdr);
- err = ether1394_send_packet(ptask, tx_len);
- if (err) {
- if (err == -EAGAIN)
- ETH1394_PRINT_G(KERN_ERR, "Out of tlabels\n");
-
+ if (ether1394_send_packet(ptask, tx_len))
ether1394_dg_complete(ptask, 1);
- }
} else {
ether1394_dg_complete(ptask, fail);
}
@@ -1669,18 +1633,10 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
/* Add the encapsulation header to the fragment */
tx_len = ether1394_encapsulate(skb, max_payload, &ptask->hdr);
dev->trans_start = jiffies;
- if (ether1394_send_packet(ptask, tx_len)) {
- if (dest_node == (LOCAL_BUS | ALL_NODES))
- goto fail;
-
- /* Most failures of ether1394_send_packet are recoverable. */
- netif_stop_queue(dev);
- priv->wake_node = dest_node;
- schedule_work(&priv->wake);
- kmem_cache_free(packet_task_cache, ptask);
- return NETDEV_TX_BUSY;
- }
+ if (ether1394_send_packet(ptask, tx_len))
+ goto fail;
+ netif_wake_queue(dev);
return NETDEV_TX_OK;
fail:
if (ptask)
@@ -1694,6 +1650,9 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
priv->stats.tx_errors++;
spin_unlock_irqrestore(&priv->lock, flags);
+ if (netif_queue_stopped(dev))
+ netif_wake_queue(dev);
+
/*
* FIXME: According to a patch from 2003-02-26, "returning non-zero
* causes serious problems" here, allegedly. Before that patch,
diff --git a/trunk/drivers/ieee1394/eth1394.h b/trunk/drivers/ieee1394/eth1394.h
index 4f3e2dd46f00..a3439ee7cb4e 100644
--- a/trunk/drivers/ieee1394/eth1394.h
+++ b/trunk/drivers/ieee1394/eth1394.h
@@ -66,10 +66,6 @@ struct eth1394_priv {
int bc_dgl; /* Outgoing broadcast datagram label */
struct list_head ip_node_list; /* List of IP capable nodes */
struct unit_directory *ud_list[ALL_NODES]; /* Cached unit dir list */
-
- struct work_struct wake; /* Wake up after xmit failure */
- struct net_device *wake_dev; /* Stupid backlink for .wake */
- nodeid_t wake_node; /* Destination of failed xmit */
};
diff --git a/trunk/drivers/ieee1394/raw1394.c b/trunk/drivers/ieee1394/raw1394.c
index f1d05eeb9f51..d382500f4210 100644
--- a/trunk/drivers/ieee1394/raw1394.c
+++ b/trunk/drivers/ieee1394/raw1394.c
@@ -936,7 +936,6 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
struct hpsb_packet *packet;
int header_length = req->req.misc & 0xffff;
int expect_response = req->req.misc >> 16;
- size_t data_size;
if (header_length > req->req.length || header_length < 12 ||
header_length > FIELD_SIZEOF(struct hpsb_packet, header)) {
@@ -946,8 +945,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
return sizeof(struct raw1394_request);
}
- data_size = req->req.length - header_length;
- packet = hpsb_alloc_packet(data_size);
+ packet = hpsb_alloc_packet(req->req.length - header_length);
req->packet = packet;
if (!packet)
return -ENOMEM;
@@ -962,7 +960,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
if (copy_from_user
(packet->data, int2ptr(req->req.sendb) + header_length,
- data_size)) {
+ packet->data_size)) {
req->req.error = RAW1394_ERROR_MEMFAULT;
req->req.length = 0;
queue_complete_req(req);
@@ -976,7 +974,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
packet->host = fi->host;
packet->expect_response = expect_response;
packet->header_size = header_length;
- packet->data_size = data_size;
+ packet->data_size = req->req.length - header_length;
req->req.length = 0;
hpsb_set_packet_complete_task(packet,
diff --git a/trunk/drivers/ieee1394/sbp2.c b/trunk/drivers/ieee1394/sbp2.c
index 875eadd5e8f5..4cb6fa2bcfb7 100644
--- a/trunk/drivers/ieee1394/sbp2.c
+++ b/trunk/drivers/ieee1394/sbp2.c
@@ -70,7 +70,6 @@
#include
#include
#include
-#include
#include