diff --git a/[refs] b/[refs] index 52a354a037c2..badacc5c16a6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7ad7153b051d9628ecd6a336b543ea6ef099bd2c +refs/heads/master: ccb2fe209dac9ff67f6351e783e610073afaaeaf diff --git a/trunk/Documentation/DocBook/mtdnand.tmpl b/trunk/Documentation/DocBook/mtdnand.tmpl index a8c8cce50633..6e463d0db266 100644 --- a/trunk/Documentation/DocBook/mtdnand.tmpl +++ b/trunk/Documentation/DocBook/mtdnand.tmpl @@ -109,7 +109,7 @@ for most of the implementations. These functions can be replaced by the board driver if neccecary. Those functions are called via pointers in the NAND chip description structure. The board driver can set the functions which - should be replaced by board dependent functions before calling nand_scan(). + should be replaced by board dependend functions before calling nand_scan(). If the function pointer is NULL on entry to nand_scan() then the pointer is set to the default function which is suitable for the detected chip type. @@ -133,7 +133,7 @@ [REPLACEABLE] Replaceable members hold hardware related functions which can be provided by the board driver. The board driver can set the functions which - should be replaced by board dependent functions before calling nand_scan(). + should be replaced by board dependend functions before calling nand_scan(). If the function pointer is NULL on entry to nand_scan() then the pointer is set to the default function which is suitable for the detected chip type. @@ -156,8 +156,9 @@ Basic board driver For most boards it will be sufficient to provide just the - basic functions and fill out some really board dependent + basic functions and fill out some really board dependend members in the nand chip description structure. + See drivers/mtd/nand/skeleton for reference. Basic defines @@ -188,9 +189,9 @@ static unsigned long baseaddr; Partition defines - If you want to divide your device into partitions, then - enable the configuration switch CONFIG_MTD_PARTITIONS and define - a partitioning scheme suitable to your board. + If you want to divide your device into parititions, then + enable the configuration switch CONFIG_MTD_PARITIONS and define + a paritioning scheme suitable to your board. #define NUM_PARTITIONS 2 @@ -1294,9 +1295,7 @@ in this page !Idrivers/mtd/nand/nand_base.c !Idrivers/mtd/nand/nand_bbt.c - +!Idrivers/mtd/nand/nand_ecc.c diff --git a/trunk/Documentation/DocBook/videobook.tmpl b/trunk/Documentation/DocBook/videobook.tmpl index b629da33951d..fdff984a5161 100644 --- a/trunk/Documentation/DocBook/videobook.tmpl +++ b/trunk/Documentation/DocBook/videobook.tmpl @@ -976,7 +976,7 @@ static int camera_close(struct video_device *dev) Interrupt Handling Our example handler is for an ISA bus device. If it was PCI you would be - able to share the interrupt and would have set IRQF_SHARED to indicate a + able to share the interrupt and would have set SA_SHIRQ to indicate a shared IRQ. We pass the device pointer as the interrupt routine argument. We don't need to since we only support one card but doing this will make it easier to upgrade the driver for multiple devices in the future. diff --git a/trunk/Documentation/IPMI.txt b/trunk/Documentation/IPMI.txt index 0256805b548f..bf1cf98d2a27 100644 --- a/trunk/Documentation/IPMI.txt +++ b/trunk/Documentation/IPMI.txt @@ -10,7 +10,7 @@ standard for controlling intelligent devices that monitor a system. It provides for dynamic discovery of sensors in the system and the ability to monitor the sensors and be informed when the sensor's values change or go outside certain boundaries. It also has a -standardized database for field-replaceable units (FRUs) and a watchdog +standardized database for field-replacable units (FRUs) and a watchdog timer. To use this, you need an interface to an IPMI controller in your @@ -64,7 +64,7 @@ situation, you need to read the section below named 'The SI Driver' or IPMI defines a standard watchdog timer. You can enable this with the 'IPMI Watchdog Timer' config option. If you compile the driver into the kernel, then via a kernel command-line option you can have the -watchdog timer start as soon as it initializes. It also have a lot +watchdog timer start as soon as it intitializes. It also have a lot of other options, see the 'Watchdog' section below for more details. Note that you can also have the watchdog continue to run if it is closed (by default it is disabled on close). Go into the 'Watchdog diff --git a/trunk/Documentation/arm/IXP4xx b/trunk/Documentation/arm/IXP4xx index 43edb4ecf27d..d4c6d3aa0c25 100644 --- a/trunk/Documentation/arm/IXP4xx +++ b/trunk/Documentation/arm/IXP4xx @@ -85,7 +85,7 @@ IXP4xx provides two methods of accessing PCI memory space: 2) If > 64MB of memory space is required, the IXP4xx can be configured to use indirect registers to access PCI This allows for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus. - The disadvantage of this is that every PCI access requires + The disadvantadge of this is that every PCI access requires three local register accesses plus a spinlock, but in some cases the performance hit is acceptable. In addition, you cannot mmap() PCI devices in this case due to the indirect nature diff --git a/trunk/Documentation/digiepca.txt b/trunk/Documentation/digiepca.txt index f2560e22f2c9..88820fe38dad 100644 --- a/trunk/Documentation/digiepca.txt +++ b/trunk/Documentation/digiepca.txt @@ -2,7 +2,7 @@ NOTE: This driver is obsolete. Digi provides a 2.6 driver (dgdm) at http://www.digi.com for PCI cards. They no longer maintain this driver, and have no 2.6 driver for ISA cards. -This driver requires a number of user-space tools. They can be acquired from +This driver requires a number of user-space tools. They can be aquired from http://www.digi.com, but only works with 2.4 kernels. diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index 99f219a01e0e..1cbbb8e28999 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -257,12 +257,3 @@ Why: Code does no longer build since at least 2.6.0, apparently there is Who: Ralf Baechle --------------------------- - -What: Interrupt only SA_* flags -When: Januar 2007 -Why: The interrupt related SA_* flags are replaced by IRQF_* to move them - out of the signal namespace. - -Who: Thomas Gleixner - ---------------------------- diff --git a/trunk/Documentation/irqflags-tracing.txt b/trunk/Documentation/irqflags-tracing.txt deleted file mode 100644 index 6a444877ee0b..000000000000 --- a/trunk/Documentation/irqflags-tracing.txt +++ /dev/null @@ -1,57 +0,0 @@ -IRQ-flags state tracing - -started by Ingo Molnar - -the "irq-flags tracing" feature "traces" hardirq and softirq state, in -that it gives interested subsystems an opportunity to be notified of -every hardirqs-off/hardirqs-on, softirqs-off/softirqs-on event that -happens in the kernel. - -CONFIG_TRACE_IRQFLAGS_SUPPORT is needed for CONFIG_PROVE_SPIN_LOCKING -and CONFIG_PROVE_RW_LOCKING to be offered by the generic lock debugging -code. Otherwise only CONFIG_PROVE_MUTEX_LOCKING and -CONFIG_PROVE_RWSEM_LOCKING will be offered on an architecture - these -are locking APIs that are not used in IRQ context. (the one exception -for rwsems is worked around) - -architecture support for this is certainly not in the "trivial" -category, because lots of lowlevel assembly code deal with irq-flags -state changes. But an architecture can be irq-flags-tracing enabled in a -rather straightforward and risk-free manner. - -Architectures that want to support this need to do a couple of -code-organizational changes first: - -- move their irq-flags manipulation code from their asm/system.h header - to asm/irqflags.h - -- rename local_irq_disable()/etc to raw_local_irq_disable()/etc. so that - the linux/irqflags.h code can inject callbacks and can construct the - real local_irq_disable()/etc APIs. - -- add and enable TRACE_IRQFLAGS_SUPPORT in their arch level Kconfig file - -and then a couple of functional changes are needed as well to implement -irq-flags-tracing support: - -- in lowlevel entry code add (build-conditional) calls to the - trace_hardirqs_off()/trace_hardirqs_on() functions. The lock validator - closely guards whether the 'real' irq-flags matches the 'virtual' - irq-flags state, and complains loudly (and turns itself off) if the - two do not match. Usually most of the time for arch support for - irq-flags-tracing is spent in this state: look at the lockdep - complaint, try to figure out the assembly code we did not cover yet, - fix and repeat. Once the system has booted up and works without a - lockdep complaint in the irq-flags-tracing functions arch support is - complete. -- if the architecture has non-maskable interrupts then those need to be - excluded from the irq-tracing [and lock validation] mechanism via - lockdep_off()/lockdep_on(). - -in general there is no risk from having an incomplete irq-flags-tracing -implementation in an architecture: lockdep will detect that and will -turn itself off. I.e. the lock validator will still be reliable. There -should be no crashes due to irq-tracing bugs. (except if the assembly -changes break other code by modifying conditions or registers that -shouldnt be) - diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index 149f62ba14a5..86e9282d1c20 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -435,15 +435,6 @@ running once the system is up. debug [KNL] Enable kernel debugging (events log level). - debug_locks_verbose= - [KNL] verbose self-tests - Format=<0|1> - Print debugging info while doing the locking API - self-tests. - We default to 0 (no extra messages), setting it to - 1 will print _a lot_ more information - normally - only useful to kernel developers. - decnet= [HW,NET] Format: [,] See also Documentation/networking/decnet.txt. diff --git a/trunk/Documentation/lockdep-design.txt b/trunk/Documentation/lockdep-design.txt deleted file mode 100644 index 00d93605bfd3..000000000000 --- a/trunk/Documentation/lockdep-design.txt +++ /dev/null @@ -1,197 +0,0 @@ -Runtime locking correctness validator -===================================== - -started by Ingo Molnar -additions by Arjan van de Ven - -Lock-class ----------- - -The basic object the validator operates upon is a 'class' of locks. - -A class of locks is a group of locks that are logically the same with -respect to locking rules, even if the locks may have multiple (possibly -tens of thousands of) instantiations. For example a lock in the inode -struct is one class, while each inode has its own instantiation of that -lock class. - -The validator tracks the 'state' of lock-classes, and it tracks -dependencies between different lock-classes. The validator maintains a -rolling proof that the state and the dependencies are correct. - -Unlike an lock instantiation, the lock-class itself never goes away: when -a lock-class is used for the first time after bootup it gets registered, -and all subsequent uses of that lock-class will be attached to this -lock-class. - -State ------ - -The validator tracks lock-class usage history into 5 separate state bits: - -- 'ever held in hardirq context' [ == hardirq-safe ] -- 'ever held in softirq context' [ == softirq-safe ] -- 'ever held with hardirqs enabled' [ == hardirq-unsafe ] -- 'ever held with softirqs and hardirqs enabled' [ == softirq-unsafe ] - -- 'ever used' [ == !unused ] - -Single-lock state rules: ------------------------- - -A softirq-unsafe lock-class is automatically hardirq-unsafe as well. The -following states are exclusive, and only one of them is allowed to be -set for any lock-class: - - and - and - -The validator detects and reports lock usage that violate these -single-lock state rules. - -Multi-lock dependency rules: ----------------------------- - -The same lock-class must not be acquired twice, because this could lead -to lock recursion deadlocks. - -Furthermore, two locks may not be taken in different order: - - -> - -> - -because this could lead to lock inversion deadlocks. (The validator -finds such dependencies in arbitrary complexity, i.e. there can be any -other locking sequence between the acquire-lock operations, the -validator will still track all dependencies between locks.) - -Furthermore, the following usage based lock dependencies are not allowed -between any two lock-classes: - - -> - -> - -The first rule comes from the fact the a hardirq-safe lock could be -taken by a hardirq context, interrupting a hardirq-unsafe lock - and -thus could result in a lock inversion deadlock. Likewise, a softirq-safe -lock could be taken by an softirq context, interrupting a softirq-unsafe -lock. - -The above rules are enforced for any locking sequence that occurs in the -kernel: when acquiring a new lock, the validator checks whether there is -any rule violation between the new lock and any of the held locks. - -When a lock-class changes its state, the following aspects of the above -dependency rules are enforced: - -- if a new hardirq-safe lock is discovered, we check whether it - took any hardirq-unsafe lock in the past. - -- if a new softirq-safe lock is discovered, we check whether it took - any softirq-unsafe lock in the past. - -- if a new hardirq-unsafe lock is discovered, we check whether any - hardirq-safe lock took it in the past. - -- if a new softirq-unsafe lock is discovered, we check whether any - softirq-safe lock took it in the past. - -(Again, we do these checks too on the basis that an interrupt context -could interrupt _any_ of the irq-unsafe or hardirq-unsafe locks, which -could lead to a lock inversion deadlock - even if that lock scenario did -not trigger in practice yet.) - -Exception: Nested data dependencies leading to nested locking -------------------------------------------------------------- - -There are a few cases where the Linux kernel acquires more than one -instance of the same lock-class. Such cases typically happen when there -is some sort of hierarchy within objects of the same type. In these -cases there is an inherent "natural" ordering between the two objects -(defined by the properties of the hierarchy), and the kernel grabs the -locks in this fixed order on each of the objects. - -An example of such an object hieararchy that results in "nested locking" -is that of a "whole disk" block-dev object and a "partition" block-dev -object; the partition is "part of" the whole device and as long as one -always takes the whole disk lock as a higher lock than the partition -lock, the lock ordering is fully correct. The validator does not -automatically detect this natural ordering, as the locking rule behind -the ordering is not static. - -In order to teach the validator about this correct usage model, new -versions of the various locking primitives were added that allow you to -specify a "nesting level". An example call, for the block device mutex, -looks like this: - -enum bdev_bd_mutex_lock_class -{ - BD_MUTEX_NORMAL, - BD_MUTEX_WHOLE, - BD_MUTEX_PARTITION -}; - - mutex_lock_nested(&bdev->bd_contains->bd_mutex, BD_MUTEX_PARTITION); - -In this case the locking is done on a bdev object that is known to be a -partition. - -The validator treats a lock that is taken in such a nested fasion as a -separate (sub)class for the purposes of validation. - -Note: When changing code to use the _nested() primitives, be careful and -check really thoroughly that the hiearchy is correctly mapped; otherwise -you can get false positives or false negatives. - -Proof of 100% correctness: --------------------------- - -The validator achieves perfect, mathematical 'closure' (proof of locking -correctness) in the sense that for every simple, standalone single-task -locking sequence that occured at least once during the lifetime of the -kernel, the validator proves it with a 100% certainty that no -combination and timing of these locking sequences can cause any class of -lock related deadlock. [*] - -I.e. complex multi-CPU and multi-task locking scenarios do not have to -occur in practice to prove a deadlock: only the simple 'component' -locking chains have to occur at least once (anytime, in any -task/context) for the validator to be able to prove correctness. (For -example, complex deadlocks that would normally need more than 3 CPUs and -a very unlikely constellation of tasks, irq-contexts and timings to -occur, can be detected on a plain, lightly loaded single-CPU system as -well!) - -This radically decreases the complexity of locking related QA of the -kernel: what has to be done during QA is to trigger as many "simple" -single-task locking dependencies in the kernel as possible, at least -once, to prove locking correctness - instead of having to trigger every -possible combination of locking interaction between CPUs, combined with -every possible hardirq and softirq nesting scenario (which is impossible -to do in practice). - -[*] assuming that the validator itself is 100% correct, and no other - part of the system corrupts the state of the validator in any way. - We also assume that all NMI/SMM paths [which could interrupt - even hardirq-disabled codepaths] are correct and do not interfere - with the validator. We also assume that the 64-bit 'chain hash' - value is unique for every lock-chain in the system. Also, lock - recursion must not be higher than 20. - -Performance: ------------- - -The above rules require _massive_ amounts of runtime checking. If we did -that for every lock taken and for every irqs-enable event, it would -render the system practically unusably slow. The complexity of checking -is O(N^2), so even with just a few hundred lock-classes we'd have to do -tens of thousands of checks for every event. - -This problem is solved by checking any given 'locking scenario' (unique -sequence of locks taken after each other) only once. A simple stack of -held locks is maintained, and a lightweight 64-bit hash value is -calculated, which hash is unique for every lock chain. The hash value, -when the chain is validated for the first time, is then put into a hash -table, which hash-table can be checked in a lockfree manner. If the -locking chain occurs again later on, the hash table tells us that we -dont have to validate the chain again. diff --git a/trunk/Documentation/memory-barriers.txt b/trunk/Documentation/memory-barriers.txt index 28d1bc3edb1c..cf0d5416a4c3 100644 --- a/trunk/Documentation/memory-barriers.txt +++ b/trunk/Documentation/memory-barriers.txt @@ -602,7 +602,7 @@ Consider the following sequence of events: This sequence of events is committed to the memory coherence system in an order that the rest of the system might perceive as the unordered set of { STORE A, -STORE B, STORE C } all occurring before the unordered set of { STORE D, STORE E +STORE B, STORE C } all occuring before the unordered set of { STORE D, STORE E }: +-------+ : : diff --git a/trunk/Documentation/networking/ipvs-sysctl.txt b/trunk/Documentation/networking/ipvs-sysctl.txt deleted file mode 100644 index 4ccdbca03811..000000000000 --- a/trunk/Documentation/networking/ipvs-sysctl.txt +++ /dev/null @@ -1,143 +0,0 @@ -/proc/sys/net/ipv4/vs/* Variables: - -am_droprate - INTEGER - default 10 - - It sets the always mode drop rate, which is used in the mode 3 - of the drop_rate defense. - -amemthresh - INTEGER - default 1024 - - It sets the available memory threshold (in pages), which is - used in the automatic modes of defense. When there is no - enough available memory, the respective strategy will be - enabled and the variable is automatically set to 2, otherwise - the strategy is disabled and the variable is set to 1. - -cache_bypass - BOOLEAN - 0 - disabled (default) - not 0 - enabled - - If it is enabled, forward packets to the original destination - directly when no cache server is available and destination - address is not local (iph->daddr is RTN_UNICAST). It is mostly - used in transparent web cache cluster. - -debug_level - INTEGER - 0 - transmission error messages (default) - 1 - non-fatal error messages - 2 - configuration - 3 - destination trash - 4 - drop entry - 5 - service lookup - 6 - scheduling - 7 - connection new/expire, lookup and synchronization - 8 - state transition - 9 - binding destination, template checks and applications - 10 - IPVS packet transmission - 11 - IPVS packet handling (ip_vs_in/ip_vs_out) - 12 or more - packet traversal - - Only available when IPVS is compiled with the CONFIG_IPVS_DEBUG - - Higher debugging levels include the messages for lower debugging - levels, so setting debug level 2, includes level 0, 1 and 2 - messages. Thus, logging becomes more and more verbose the higher - the level. - -drop_entry - INTEGER - 0 - disabled (default) - - The drop_entry defense is to randomly drop entries in the - connection hash table, just in order to collect back some - memory for new connections. In the current code, the - drop_entry procedure can be activated every second, then it - randomly scans 1/32 of the whole and drops entries that are in - the SYN-RECV/SYNACK state, which should be effective against - syn-flooding attack. - - The valid values of drop_entry are from 0 to 3, where 0 means - that this strategy is always disabled, 1 and 2 mean automatic - modes (when there is no enough available memory, the strategy - is enabled and the variable is automatically set to 2, - otherwise the strategy is disabled and the variable is set to - 1), and 3 means that that the strategy is always enabled. - -drop_packet - INTEGER - 0 - disabled (default) - - The drop_packet defense is designed to drop 1/rate packets - before forwarding them to real servers. If the rate is 1, then - drop all the incoming packets. - - The value definition is the same as that of the drop_entry. In - the automatic mode, the rate is determined by the follow - formula: rate = amemthresh / (amemthresh - available_memory) - when available memory is less than the available memory - threshold. When the mode 3 is set, the always mode drop rate - is controlled by the /proc/sys/net/ipv4/vs/am_droprate. - -expire_nodest_conn - BOOLEAN - 0 - disabled (default) - not 0 - enabled - - The default value is 0, the load balancer will silently drop - packets when its destination server is not available. It may - be useful, when user-space monitoring program deletes the - destination server (because of server overload or wrong - detection) and add back the server later, and the connections - to the server can continue. - - If this feature is enabled, the load balancer will expire the - connection immediately when a packet arrives and its - destination server is not available, then the client program - will be notified that the connection is closed. This is - equivalent to the feature some people requires to flush - connections when its destination is not available. - -expire_quiescent_template - BOOLEAN - 0 - disabled (default) - not 0 - enabled - - When set to a non-zero value, the load balancer will expire - persistent templates when the destination server is quiescent. - This may be useful, when a user makes a destination server - quiescent by setting its weight to 0 and it is desired that - subsequent otherwise persistent connections are sent to a - different destination server. By default new persistent - connections are allowed to quiescent destination servers. - - If this feature is enabled, the load balancer will expire the - persistence template if it is to be used to schedule a new - connection and the destination server is quiescent. - -nat_icmp_send - BOOLEAN - 0 - disabled (default) - not 0 - enabled - - It controls sending icmp error messages (ICMP_DEST_UNREACH) - for VS/NAT when the load balancer receives packets from real - servers but the connection entries don't exist. - -secure_tcp - INTEGER - 0 - disabled (default) - - The secure_tcp defense is to use a more complicated state - transition table and some possible short timeouts of each - state. In the VS/NAT, it delays the entering the ESTABLISHED - until the real server starts to send data and ACK packet - (after 3-way handshake). - - The value definition is the same as that of drop_entry or - drop_packet. - -sync_threshold - INTEGER - default 3 - - It sets synchronization threshold, which is the minimum number - of incoming packets that a connection needs to receive before - the connection will be synchronized. A connection will be - synchronized, every time the number of its incoming packets - modulus 50 equals the threshold. The range of the threshold is - from 0 to 49. diff --git a/trunk/Documentation/networking/pktgen.txt b/trunk/Documentation/networking/pktgen.txt index 44f2f769e865..278771c9ad99 100644 --- a/trunk/Documentation/networking/pktgen.txt +++ b/trunk/Documentation/networking/pktgen.txt @@ -74,7 +74,7 @@ Examples: pgset "pkt_size 9014" sets packet size to 9014 pgset "frags 5" packet will consist of 5 fragments pgset "count 200000" sets number of packets to send, set to zero - for continuous sends until explicitly stopped. + for continious sends untill explicitl stopped. pgset "delay 5000" adds delay to hard_start_xmit(). nanoseconds diff --git a/trunk/Documentation/pci.txt b/trunk/Documentation/pci.txt index 2b395e478961..3242e5c1ee9c 100644 --- a/trunk/Documentation/pci.txt +++ b/trunk/Documentation/pci.txt @@ -225,7 +225,7 @@ Generic flavors of pci_request_region() are request_mem_region() Use these for address resources that are not described by "normal" PCI interfaces (e.g. BAR). - All interrupt handlers should be registered with IRQF_SHARED and use the devid + All interrupt handlers should be registered with SA_SHIRQ and use the devid to map IRQs to devices (remember that all PCI interrupts are shared). diff --git a/trunk/Documentation/pcmcia/crc32hash.c b/trunk/Documentation/pcmcia/crc32hash.c deleted file mode 100644 index cbc36d299af8..000000000000 --- a/trunk/Documentation/pcmcia/crc32hash.c +++ /dev/null @@ -1,32 +0,0 @@ -/* crc32hash.c - derived from linux/lib/crc32.c, GNU GPL v2 */ -/* Usage example: -$ ./crc32hash "Dual Speed" -*/ - -#include -#include -#include -#include - -unsigned int crc32(unsigned char const *p, unsigned int len) -{ - int i; - unsigned int crc = 0; - while (len--) { - crc ^= *p++; - for (i = 0; i < 8; i++) - crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0); - } - return crc; -} - -int main(int argc, char **argv) { - unsigned int result; - if (argc != 2) { - printf("no string passed as argument\n"); - return -1; - } - result = crc32(argv[1], strlen(argv[1])); - printf("0x%x\n", result); - return 0; -} diff --git a/trunk/Documentation/pcmcia/devicetable.txt b/trunk/Documentation/pcmcia/devicetable.txt index 199afd100cf2..3351c0355143 100644 --- a/trunk/Documentation/pcmcia/devicetable.txt +++ b/trunk/Documentation/pcmcia/devicetable.txt @@ -27,7 +27,37 @@ pcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000 The hex value after "pa" is the hash of product ID string 1, after "pb" for string 2 and so on. -Alternatively, you can use crc32hash (see Documentation/pcmcia/crc32hash.c) -to determine the crc32 hash. Simply pass the string you want to evaluate -as argument to this program, e.g.: +Alternatively, you can use this small tool to determine the crc32 hash. +simply pass the string you want to evaluate as argument to this program, +e.g. $ ./crc32hash "Dual Speed" + +------------------------------------------------------------------------- +/* crc32hash.c - derived from linux/lib/crc32.c, GNU GPL v2 */ +#include +#include +#include +#include + +unsigned int crc32(unsigned char const *p, unsigned int len) +{ + int i; + unsigned int crc = 0; + while (len--) { + crc ^= *p++; + for (i = 0; i < 8; i++) + crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0); + } + return crc; +} + +int main(int argc, char **argv) { + unsigned int result; + if (argc != 2) { + printf("no string passed as argument\n"); + return -1; + } + result = crc32(argv[1], strlen(argv[1])); + printf("0x%x\n", result); + return 0; +} diff --git a/trunk/Documentation/powerpc/booting-without-of.txt b/trunk/Documentation/powerpc/booting-without-of.txt index 3c62e66e1fcc..217e51768b87 100644 --- a/trunk/Documentation/powerpc/booting-without-of.txt +++ b/trunk/Documentation/powerpc/booting-without-of.txt @@ -1436,9 +1436,9 @@ platforms are moved over to use the flattened-device-tree model. interrupts = <1d 3>; interrupt-parent = <40000>; num-channels = <4>; - channel-fifo-len = <18>; + channel-fifo-len = <24>; exec-units-mask = <000000fe>; - descriptor-types-mask = <012b0ebf>; + descriptor-types-mask = <073f1127>; }; diff --git a/trunk/Documentation/scsi/ChangeLog.megaraid_sas b/trunk/Documentation/scsi/ChangeLog.megaraid_sas index d9e5960dafd5..0a85a7e8120e 100644 --- a/trunk/Documentation/scsi/ChangeLog.megaraid_sas +++ b/trunk/Documentation/scsi/ChangeLog.megaraid_sas @@ -1,20 +1,4 @@ -1 Release Date : Sun May 14 22:49:52 PDT 2006 - Sumant Patro -2 Current Version : 00.00.03.01 -3 Older Version : 00.00.02.04 - -i. Added support for ZCR controller. - - New device id 0x413 added. - -ii. Bug fix : Disable controller interrupt before firing INIT cmd to FW. - - Interrupt is enabled after required initialization is over. - This is done to ensure that driver is ready to handle interrupts when - it is generated by the controller. - - -Sumant Patro - 1 Release Date : Wed Feb 03 14:31:44 PST 2006 - Sumant Patro 2 Current Version : 00.00.02.04 3 Older Version : 00.00.02.04 diff --git a/trunk/Documentation/scsi/tmscsim.txt b/trunk/Documentation/scsi/tmscsim.txt index df7a02bfb5bf..e165229adf50 100644 --- a/trunk/Documentation/scsi/tmscsim.txt +++ b/trunk/Documentation/scsi/tmscsim.txt @@ -109,7 +109,7 @@ than the 33.33 MHz being in the PCI spec. If you want to share the IRQ with another device and the driver refuses to do so, you might succeed with changing the DC390_IRQ type in tmscsim.c to -IRQF_SHARED | IRQF_DISABLED. +SA_SHIRQ | SA_INTERRUPT. 3.Features diff --git a/trunk/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/trunk/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl index 69866d5997a4..635cbb94357c 100644 --- a/trunk/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +++ b/trunk/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl @@ -1149,7 +1149,7 @@ } chip->port = pci_resource_start(pci, 0); if (request_irq(pci->irq, snd_mychip_interrupt, - IRQF_DISABLED|IRQF_SHARED, "My Chip", chip)) { + SA_INTERRUPT|SA_SHIRQ, "My Chip", chip)) { printk(KERN_ERR "cannot grab irq %d\n", pci->irq); snd_mychip_free(chip); return -EBUSY; @@ -1323,7 +1323,7 @@ irq, snd_mychip_interrupt, - IRQF_DISABLED|IRQF_SHARED, "My Chip", chip)) { + SA_INTERRUPT|SA_SHIRQ, "My Chip", chip)) { printk(KERN_ERR "cannot grab irq %d\n", pci->irq); snd_mychip_free(chip); return -EBUSY; @@ -1342,7 +1342,7 @@ On the PCI bus, the interrupts can be shared. Thus, - IRQF_SHARED is given as the interrupt flag of + SA_SHIRQ is given as the interrupt flag of request_irq(). @@ -3048,7 +3048,7 @@ struct _snd_pcm_runtime { - If you acquire a spinlock in the interrupt handler, and the + If you aquire a spinlock in the interrupt handler, and the lock is used in other pcm callbacks, too, then you have to release the lock before calling snd_pcm_period_elapsed(), because diff --git a/trunk/Documentation/sysctl/vm.txt b/trunk/Documentation/sysctl/vm.txt index 7cee90223d3a..2dc246af4885 100644 --- a/trunk/Documentation/sysctl/vm.txt +++ b/trunk/Documentation/sysctl/vm.txt @@ -28,7 +28,7 @@ Currently, these files are in /proc/sys/vm: - block_dump - drop-caches - zone_reclaim_mode -- min_unmapped_ratio +- zone_reclaim_interval - panic_on_oom ============================================================== @@ -167,18 +167,17 @@ use of files and builds up large slab caches. However, the slab shrink operation is global, may take a long time and free slabs in all nodes of the system. -============================================================= +================================================================ -min_unmapped_ratio: +zone_reclaim_interval: -This is available only on NUMA kernels. +The time allowed for off node allocations after zone reclaim +has failed to reclaim enough pages to allow a local allocation. -A percentage of the file backed pages in each zone. Zone reclaim will only -occur if more than this percentage of pages are file backed and unmapped. -This is to insure that a minimal amount of local pages is still available for -file I/O even if the node is overallocated. +Time is set in seconds and set by default to 30 seconds. -The default is 1 percent. +Reduce the interval if undesired off node allocations occur. However, too +frequent scans will have a negative impact onoff node allocation performance. ============================================================= diff --git a/trunk/Documentation/video4linux/CARDLIST.cx88 b/trunk/Documentation/video4linux/CARDLIST.cx88 index 00d9a1f2a54c..6cb63ddf6163 100644 --- a/trunk/Documentation/video4linux/CARDLIST.cx88 +++ b/trunk/Documentation/video4linux/CARDLIST.cx88 @@ -50,4 +50,3 @@ 49 -> PixelView PlayTV P7000 [1554:4813] 50 -> NPG Tech Real TV FM Top 10 [14f1:0842] 51 -> WinFast DTV2000 H [107d:665e] - 52 -> Geniatech DVB-S [14f1:0084] diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 5f76a4f5cd4b..31a13720f23c 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -861,8 +861,6 @@ S: Maintained DOCBOOK FOR DOCUMENTATION P: Martin Waitz M: tali@admingilde.org -P: Randy Dunlap -M: rdunlap@xenotime.net T: git http://tali.admingilde.org/git/linux-docbook.git S: Maintained @@ -927,21 +925,23 @@ S: Maintained EDAC-CORE P: Doug Thompson -M: norsk5@xmission.com +M: norsk5@xmission.com, dthompson@linuxnetworx.com +P: Dave Peterson +M: dsp@llnl.gov, dave_peterson@pobox.com L: bluesmoke-devel@lists.sourceforge.net W: bluesmoke.sourceforge.net -S: Supported +S: Maintained EDAC-E752X -P: Mark Gross -M: mark.gross@intel.com +P: Dave Peterson +M: dsp@llnl.gov, dave_peterson@pobox.com L: bluesmoke-devel@lists.sourceforge.net W: bluesmoke.sourceforge.net S: Maintained EDAC-E7XXX -P: Doug Thompson -M: norsk5@xmission.com +P: Dave Peterson +M: dsp@llnl.gov, dave_peterson@pobox.com L: bluesmoke-devel@lists.sourceforge.net W: bluesmoke.sourceforge.net S: Maintained @@ -2300,14 +2300,6 @@ M: promise@pnd-pc.demon.co.uk W: http://www.pnd-pc.demon.co.uk/promise/ S: Maintained -PVRUSB2 VIDEO4LINUX DRIVER -P: Mike Isely -M: isely@pobox.com -L: pvrusb2@isely.net -L: video4linux-list@redhat.com -W: http://www.isely.net/pvrusb2/ -S: Maintained - PXA2xx SUPPORT P: Nicolas Pitre M: nico@cam.org @@ -2565,6 +2557,13 @@ M: thomas@winischhofer.net W: http://www.winischhofer.at/linuxsisusbvga.shtml S: Maintained +SMB FILESYSTEM +P: Urban Widmark +M: urban@teststation.com +W: http://samba.org/ +L: samba@samba.org +S: Maintained + SMC91x ETHERNET DRIVER P: Nicolas Pitre M: nico@cam.org diff --git a/trunk/Makefile b/trunk/Makefile index 11a850cffd3d..e9560c6f8156 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -41,9 +41,8 @@ ifndef KBUILD_VERBOSE KBUILD_VERBOSE = 0 endif -# Call checker as part of compilation of C files -# Use 'make C=1' to enable checking (sparse, by default) -# Override with 'make C=1 CHECK=checker_executable CHECKFLAGS=....' +# Call sparse as part of compilation of C files +# Use 'make C=1' to enable sparse checking ifdef C ifeq ("$(origin C)", "command line") @@ -309,9 +308,6 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common -# Force gcc to behave correct even for buggy distributions -CFLAGS += $(call cc-option, -fno-stack-protector-all \ - -fno-stack-protector) AFLAGS := -D__ASSEMBLY__ # Read KERNELRELEASE from include/config/kernel.release (if it exists) @@ -812,8 +808,8 @@ endif # prepare2 creates a makefile if using a separate output directory prepare2: prepare3 outputmakefile -prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ - include/asm include/config/auto.conf +prepare1: prepare2 include/linux/version.h include/asm \ + include/config/auto.conf ifneq ($(KBUILD_MODULES),) $(Q)mkdir -p $(MODVERDIR) $(Q)rm -f $(MODVERDIR)/* @@ -848,47 +844,27 @@ include/asm: # needs to be updated, so this check is forced on all builds uts_len := 64 -define filechk_utsrelease.h - if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ - echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ - exit 1; \ - fi; \ - (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";) -endef define filechk_version.h - (echo \#define LINUX_VERSION_CODE $(shell \ - expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ - echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) + if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ + echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ + exit 1; \ + fi; \ + (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \ + echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \ + echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \ + ) endef -include/linux/version.h: $(srctree)/Makefile FORCE +include/linux/version.h: $(srctree)/Makefile include/config/kernel.release FORCE $(call filechk,version.h) -include/linux/utsrelease.h: include/config/kernel.release FORCE - $(call filechk,utsrelease.h) - # --------------------------------------------------------------------------- PHONY += depend dep depend dep: @echo '*** Warning: make $@ is unnecessary now.' -# --------------------------------------------------------------------------- -# Kernel headers -INSTALL_HDR_PATH=$(MODLIB)/abi -export INSTALL_HDR_PATH - -PHONY += headers_install -headers_install: include/linux/version.h - $(Q)unifdef -Ux /dev/null - $(Q)rm -rf $(INSTALL_HDR_PATH)/include - $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include - -PHONY += headers_check -headers_check: headers_install - $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include HDRCHECK=1 - # --------------------------------------------------------------------------- # Modules @@ -975,8 +951,7 @@ CLEAN_FILES += vmlinux System.map \ # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include2 MRPROPER_FILES += .config .config.old include/asm .version .old_version \ - include/linux/autoconf.h include/linux/version.h \ - include/linux/utsrelease.h \ + include/linux/autoconf.h include/linux/version.h \ Module.symvers tags TAGS cscope* # clean - Delete most, but leave enough to build external modules @@ -1063,8 +1038,6 @@ help: @echo ' cscope - Generate cscope index' @echo ' kernelrelease - Output the release version string' @echo ' kernelversion - Output the version stored in Makefile' - @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH' - @echo ' (default: /lib/modules/$$VERSION/abi)' @echo '' @echo 'Static analysers' @echo ' checkstack - Generate a list of stack hogs' @@ -1087,8 +1060,8 @@ help: @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' @echo ' make O=dir [targets] Locate all output files in "dir", including .config' - @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' - @echo ' make C=2 [targets] Force check of all c source with $$CHECK' + @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse)' + @echo ' make C=2 [targets] Force check of all c source with $$CHECK (sparse)' @echo '' @echo 'Execute "make" or "make all" to build all targets marked with [*] ' @echo 'For further info see the ./README file' @@ -1379,7 +1352,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)) a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \ $(NOSTDINC_FLAGS) $(CPPFLAGS) \ - $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) + $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) quiet_cmd_as_o_S = AS $@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< diff --git a/trunk/arch/alpha/boot/bootp.c b/trunk/arch/alpha/boot/bootp.c index 3af21c789339..ec53c28e33de 100644 --- a/trunk/arch/alpha/boot/bootp.c +++ b/trunk/arch/alpha/boot/bootp.c @@ -9,7 +9,7 @@ */ #include #include -#include +#include #include #include diff --git a/trunk/arch/alpha/boot/bootpz.c b/trunk/arch/alpha/boot/bootpz.c index 4307bde80a35..a6657f2cf9bd 100644 --- a/trunk/arch/alpha/boot/bootpz.c +++ b/trunk/arch/alpha/boot/bootpz.c @@ -11,7 +11,7 @@ */ #include #include -#include +#include #include #include diff --git a/trunk/arch/alpha/boot/main.c b/trunk/arch/alpha/boot/main.c index 90ed55b662a8..78c9b0b6eea7 100644 --- a/trunk/arch/alpha/boot/main.c +++ b/trunk/arch/alpha/boot/main.c @@ -7,7 +7,7 @@ */ #include #include -#include +#include #include #include diff --git a/trunk/arch/alpha/kernel/alpha_ksyms.c b/trunk/arch/alpha/kernel/alpha_ksyms.c index 425643762bf5..d3848c5b0d2b 100644 --- a/trunk/arch/alpha/kernel/alpha_ksyms.c +++ b/trunk/arch/alpha/kernel/alpha_ksyms.c @@ -5,6 +5,7 @@ * modules. */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/console.c b/trunk/arch/alpha/kernel/console.c index f313b34939bb..cb3e739fbad8 100644 --- a/trunk/arch/alpha/kernel/console.c +++ b/trunk/arch/alpha/kernel/console.c @@ -5,6 +5,7 @@ * non-0 I/O hose */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/entry.S b/trunk/arch/alpha/kernel/entry.S index 01ecd09d4a64..7af15bf7e5ab 100644 --- a/trunk/arch/alpha/kernel/entry.S +++ b/trunk/arch/alpha/kernel/entry.S @@ -4,6 +4,7 @@ * Kernel entry-points. */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/gct.c b/trunk/arch/alpha/kernel/gct.c index c0c7155448e0..8827687b9f89 100644 --- a/trunk/arch/alpha/kernel/gct.c +++ b/trunk/arch/alpha/kernel/gct.c @@ -2,6 +2,7 @@ * linux/arch/alpha/kernel/gct.c */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/head.S b/trunk/arch/alpha/kernel/head.S index 1e2a62a1f75f..0905721fcbca 100644 --- a/trunk/arch/alpha/kernel/head.S +++ b/trunk/arch/alpha/kernel/head.S @@ -7,6 +7,7 @@ * the kernel global pointer and jump to the kernel entry-point. */ +#include #include #include diff --git a/trunk/arch/alpha/kernel/irq.c b/trunk/arch/alpha/kernel/irq.c index 729c475d2269..63af36cf7f6e 100644 --- a/trunk/arch/alpha/kernel/irq.c +++ b/trunk/arch/alpha/kernel/irq.c @@ -10,6 +10,7 @@ * should be easier. */ +#include #include #include #include @@ -94,12 +95,12 @@ show_interrupts(struct seq_file *p, void *v) #endif seq_printf(p, " %14s", irq_desc[irq].chip->typename); seq_printf(p, " %c%s", - (action->flags & IRQF_DISABLED)?'+':' ', + (action->flags & SA_INTERRUPT)?'+':' ', action->name); for (action=action->next; action; action = action->next) { seq_printf(p, ", %c%s", - (action->flags & IRQF_DISABLED)?'+':' ', + (action->flags & SA_INTERRUPT)?'+':' ', action->name); } diff --git a/trunk/arch/alpha/kernel/irq_alpha.c b/trunk/arch/alpha/kernel/irq_alpha.c index ddf5cf8dcb0b..f20f2dff9c43 100644 --- a/trunk/arch/alpha/kernel/irq_alpha.c +++ b/trunk/arch/alpha/kernel/irq_alpha.c @@ -2,6 +2,7 @@ * Alpha specific irq code. */ +#include #include #include #include @@ -214,7 +215,7 @@ static unsigned int rtc_startup(unsigned int irq) { return 0; } struct irqaction timer_irqaction = { .handler = timer_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "timer", }; diff --git a/trunk/arch/alpha/kernel/irq_i8259.c b/trunk/arch/alpha/kernel/irq_i8259.c index ebbadbc0c36a..ac893bd48036 100644 --- a/trunk/arch/alpha/kernel/irq_i8259.c +++ b/trunk/arch/alpha/kernel/irq_i8259.c @@ -7,6 +7,7 @@ * Started hacking from linux-2.3.30pre6/arch/i386/kernel/i8259.c. */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/machvec_impl.h b/trunk/arch/alpha/kernel/machvec_impl.h index 08b8302e64ca..11f996f24fde 100644 --- a/trunk/arch/alpha/kernel/machvec_impl.h +++ b/trunk/arch/alpha/kernel/machvec_impl.h @@ -6,6 +6,7 @@ * This file has goodies to help simplify instantiation of machine vectors. */ +#include #include /* Whee. These systems don't have an HAE: diff --git a/trunk/arch/alpha/kernel/pci.c b/trunk/arch/alpha/kernel/pci.c index ffb7d5423cc0..4ea6711e55aa 100644 --- a/trunk/arch/alpha/kernel/pci.c +++ b/trunk/arch/alpha/kernel/pci.c @@ -12,6 +12,7 @@ * Nov 2000, Ivan Kokshaysky * PCI-PCI bridges cleanup */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/process.c b/trunk/arch/alpha/kernel/process.c index 41ebf51a107a..c760a831fd1a 100644 --- a/trunk/arch/alpha/kernel/process.c +++ b/trunk/arch/alpha/kernel/process.c @@ -8,6 +8,7 @@ * This file handles the architecture-dependent parts of process handling. */ +#include #include #include #include @@ -474,7 +475,7 @@ do_sys_execve(char __user *ufilename, char __user * __user *argv, */ unsigned long -thread_saved_pc(struct task_struct *t) +thread_saved_pc(task_t *t) { unsigned long base = (unsigned long)task_stack_page(t); unsigned long fp, sp = task_thread_info(t)->pcb.ksp; diff --git a/trunk/arch/alpha/kernel/proto.h b/trunk/arch/alpha/kernel/proto.h index 2a6e3da8144f..e1560fb15610 100644 --- a/trunk/arch/alpha/kernel/proto.h +++ b/trunk/arch/alpha/kernel/proto.h @@ -1,3 +1,4 @@ +#include #include diff --git a/trunk/arch/alpha/kernel/smc37c93x.c b/trunk/arch/alpha/kernel/smc37c93x.c index 2636cc028d06..421e51ea6bb7 100644 --- a/trunk/arch/alpha/kernel/smc37c93x.c +++ b/trunk/arch/alpha/kernel/smc37c93x.c @@ -2,6 +2,7 @@ * SMC 37C93X initialization code */ +#include #include #include diff --git a/trunk/arch/alpha/kernel/srm_env.c b/trunk/arch/alpha/kernel/srm_env.c index 990ac61028f8..5c98fc83e238 100644 --- a/trunk/arch/alpha/kernel/srm_env.c +++ b/trunk/arch/alpha/kernel/srm_env.c @@ -57,6 +57,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/srmcons.c b/trunk/arch/alpha/kernel/srmcons.c index 9d7dff27f815..3b30d4f1fc42 100644 --- a/trunk/arch/alpha/kernel/srmcons.c +++ b/trunk/arch/alpha/kernel/srmcons.c @@ -5,6 +5,7 @@ * (TTY driver and console driver) */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/sys_alcor.c b/trunk/arch/alpha/kernel/sys_alcor.c index d6926b7b1e99..1a1a2c7a3d94 100644 --- a/trunk/arch/alpha/kernel/sys_alcor.c +++ b/trunk/arch/alpha/kernel/sys_alcor.c @@ -8,6 +8,7 @@ * Code supporting the ALCOR and XLT (XL-300/366/433). */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/sys_cabriolet.c b/trunk/arch/alpha/kernel/sys_cabriolet.c index 25a215067da8..8c9e443d93ad 100644 --- a/trunk/arch/alpha/kernel/sys_cabriolet.c +++ b/trunk/arch/alpha/kernel/sys_cabriolet.c @@ -9,6 +9,7 @@ * PC164 and LX164. */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/sys_dp264.c b/trunk/arch/alpha/kernel/sys_dp264.c index dd6103b867e7..b28c8f1c6e10 100644 --- a/trunk/arch/alpha/kernel/sys_dp264.c +++ b/trunk/arch/alpha/kernel/sys_dp264.c @@ -12,6 +12,7 @@ * Code supporting the DP264 (EV6+TSUNAMI). */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/sys_eb64p.c b/trunk/arch/alpha/kernel/sys_eb64p.c index ed108b66ec09..aeb8e0277905 100644 --- a/trunk/arch/alpha/kernel/sys_eb64p.c +++ b/trunk/arch/alpha/kernel/sys_eb64p.c @@ -8,6 +8,7 @@ * Code supporting the EB64+ and EB66. */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/sys_jensen.c b/trunk/arch/alpha/kernel/sys_jensen.c index 4ac2b328b8de..0148e095638f 100644 --- a/trunk/arch/alpha/kernel/sys_jensen.c +++ b/trunk/arch/alpha/kernel/sys_jensen.c @@ -74,7 +74,7 @@ jensen_local_startup(unsigned int irq) * the IPL from being dropped during handler processing. */ if (irq_desc[irq].action) - irq_desc[irq].action->flags |= IRQF_DISABLED; + irq_desc[irq].action->flags |= SA_INTERRUPT; return 0; } diff --git a/trunk/arch/alpha/kernel/sys_mikasa.c b/trunk/arch/alpha/kernel/sys_mikasa.c index cc4c58111366..b741600e3761 100644 --- a/trunk/arch/alpha/kernel/sys_mikasa.c +++ b/trunk/arch/alpha/kernel/sys_mikasa.c @@ -8,6 +8,7 @@ * Code supporting the MIKASA (AlphaServer 1000). */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/sys_noritake.c b/trunk/arch/alpha/kernel/sys_noritake.c index 2d3cff7e8c5f..55db02d318d7 100644 --- a/trunk/arch/alpha/kernel/sys_noritake.c +++ b/trunk/arch/alpha/kernel/sys_noritake.c @@ -9,6 +9,7 @@ * CORELLE (AlphaServer 800), and ALCOR Primo (AlphaStation 600A). */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/sys_sable.c b/trunk/arch/alpha/kernel/sys_sable.c index a7a14647b50e..24dea40c9bfe 100644 --- a/trunk/arch/alpha/kernel/sys_sable.c +++ b/trunk/arch/alpha/kernel/sys_sable.c @@ -8,6 +8,7 @@ * Code supporting the Sable, Sable-Gamma, and Lynx systems. */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/sys_sio.c b/trunk/arch/alpha/kernel/sys_sio.c index cd85ef725e0e..131a2d9f79d3 100644 --- a/trunk/arch/alpha/kernel/sys_sio.c +++ b/trunk/arch/alpha/kernel/sys_sio.c @@ -10,6 +10,7 @@ * Kenetics's Platform 2000, Avanti (AlphaStation), XL, and AlphaBook1. */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/sys_titan.c b/trunk/arch/alpha/kernel/sys_titan.c index 302aab38d95f..13f3ed8ed7ac 100644 --- a/trunk/arch/alpha/kernel/sys_titan.c +++ b/trunk/arch/alpha/kernel/sys_titan.c @@ -12,6 +12,7 @@ * Granite */ +#include #include #include #include @@ -279,15 +280,15 @@ titan_late_init(void) * all reported to the kernel as machine checks, so the handler * is a nop so it can be called to count the individual events. */ - request_irq(63+16, titan_intr_nop, IRQF_DISABLED, + request_irq(63+16, titan_intr_nop, SA_INTERRUPT, "CChip Error", NULL); - request_irq(62+16, titan_intr_nop, IRQF_DISABLED, + request_irq(62+16, titan_intr_nop, SA_INTERRUPT, "PChip 0 H_Error", NULL); - request_irq(61+16, titan_intr_nop, IRQF_DISABLED, + request_irq(61+16, titan_intr_nop, SA_INTERRUPT, "PChip 1 H_Error", NULL); - request_irq(60+16, titan_intr_nop, IRQF_DISABLED, + request_irq(60+16, titan_intr_nop, SA_INTERRUPT, "PChip 0 C_Error", NULL); - request_irq(59+16, titan_intr_nop, IRQF_DISABLED, + request_irq(59+16, titan_intr_nop, SA_INTERRUPT, "PChip 1 C_Error", NULL); /* @@ -348,9 +349,9 @@ privateer_init_pci(void) * Hook a couple of extra err interrupts that the * common titan code won't. */ - request_irq(53+16, titan_intr_nop, IRQF_DISABLED, + request_irq(53+16, titan_intr_nop, SA_INTERRUPT, "NMI", NULL); - request_irq(50+16, titan_intr_nop, IRQF_DISABLED, + request_irq(50+16, titan_intr_nop, SA_INTERRUPT, "Temperature Warning", NULL); /* diff --git a/trunk/arch/alpha/kernel/time.c b/trunk/arch/alpha/kernel/time.c index 50eccde2dcd8..3859749810b4 100644 --- a/trunk/arch/alpha/kernel/time.c +++ b/trunk/arch/alpha/kernel/time.c @@ -27,6 +27,7 @@ * 2003-06-03 R. Scott Bailey * Tighten sanity in time_init from 1% (10,000 PPM) to 250 PPM */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/traps.c b/trunk/arch/alpha/kernel/traps.c index d6e665d567bd..f9d12319e0fb 100644 --- a/trunk/arch/alpha/kernel/traps.c +++ b/trunk/arch/alpha/kernel/traps.c @@ -8,6 +8,7 @@ * This file initializes the trap entry points */ +#include #include #include #include diff --git a/trunk/arch/alpha/kernel/vmlinux.lds.S b/trunk/arch/alpha/kernel/vmlinux.lds.S index 71470e9d93ba..0922e0785ddb 100644 --- a/trunk/arch/alpha/kernel/vmlinux.lds.S +++ b/trunk/arch/alpha/kernel/vmlinux.lds.S @@ -1,3 +1,4 @@ +#include #include OUTPUT_FORMAT("elf64-alpha") diff --git a/trunk/arch/alpha/lib/callback_srm.S b/trunk/arch/alpha/lib/callback_srm.S index 8804bec2c644..0528acd0d9ad 100644 --- a/trunk/arch/alpha/lib/callback_srm.S +++ b/trunk/arch/alpha/lib/callback_srm.S @@ -2,6 +2,7 @@ * arch/alpha/lib/callback_srm.S */ +#include #include .text diff --git a/trunk/arch/alpha/lib/udelay.c b/trunk/arch/alpha/lib/udelay.c index 69d52aa37bae..1c879bbce419 100644 --- a/trunk/arch/alpha/lib/udelay.c +++ b/trunk/arch/alpha/lib/udelay.c @@ -4,6 +4,7 @@ * Delay routines, using a pre-computed "loops_per_jiffy" value. */ +#include #include #include /* for udelay's use of smp_processor_id */ #include diff --git a/trunk/arch/alpha/mm/extable.c b/trunk/arch/alpha/mm/extable.c index dc7aeda15773..c3849baebd57 100644 --- a/trunk/arch/alpha/mm/extable.c +++ b/trunk/arch/alpha/mm/extable.c @@ -2,6 +2,7 @@ * linux/arch/alpha/mm/extable.c */ +#include #include #include diff --git a/trunk/arch/alpha/mm/fault.c b/trunk/arch/alpha/mm/fault.c index 622dabd84680..64ace5a9cd3d 100644 --- a/trunk/arch/alpha/mm/fault.c +++ b/trunk/arch/alpha/mm/fault.c @@ -4,6 +4,7 @@ * Copyright (C) 1995 Linus Torvalds */ +#include #include #include #include diff --git a/trunk/arch/alpha/mm/init.c b/trunk/arch/alpha/mm/init.c index 917dad1b74c8..544ac5dc09eb 100644 --- a/trunk/arch/alpha/mm/init.c +++ b/trunk/arch/alpha/mm/init.c @@ -6,6 +6,7 @@ /* 2.3.x zone allocator, 1999 Andrea Arcangeli */ +#include #include #include #include diff --git a/trunk/arch/alpha/mm/numa.c b/trunk/arch/alpha/mm/numa.c index b826f58c6e72..bf6b65c81bef 100644 --- a/trunk/arch/alpha/mm/numa.c +++ b/trunk/arch/alpha/mm/numa.c @@ -6,6 +6,7 @@ * Copyright (C) 2001 Andrea Arcangeli SuSE */ +#include #include #include #include diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig index f81a62380add..f123c7c9fc98 100644 --- a/trunk/arch/arm/Kconfig +++ b/trunk/arch/arm/Kconfig @@ -47,18 +47,6 @@ config MCA (and especially the web page given there) before attempting to build an MCA bus kernel. -config GENERIC_HARDIRQS - bool - default y - -config HARDIRQS_SW_RESEND - bool - default y - -config GENERIC_IRQ_PROBE - bool - default y - config RWSEM_GENERIC_SPINLOCK bool default y @@ -133,11 +121,11 @@ config ARCH_VERSATILE help This enables support for ARM Ltd Versatile board. -config ARCH_AT91 - bool "Atmel AT91" +config ARCH_AT91RM9200 + bool "Atmel AT91RM9200" help - This enables support for systems based on the Atmel AT91RM9200 - and AT91SAM9xxx processors. + Say Y here if you intend to run this kernel on an Atmel + AT91RM9200-based board. config ARCH_CLPS7500 bool "Cirrus CL-PS7500FE" @@ -559,7 +547,7 @@ config LEDS ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \ ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \ ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \ - ARCH_AT91RM9200 || MACH_TRIZEPS4 + ARCH_AT91RM9200 help If you say Y here, the LEDs on your machine will be used to provide useful information about your current system status. @@ -690,7 +678,7 @@ config XIP_PHYS_ADDR endmenu -if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP) +if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP1) menu "CPU Frequency scaling" diff --git a/trunk/arch/arm/Makefile b/trunk/arch/arm/Makefile index 3345c6d0fd1e..a3bbaaf480b9 100644 --- a/trunk/arch/arm/Makefile +++ b/trunk/arch/arm/Makefile @@ -114,7 +114,7 @@ endif machine-$(CONFIG_ARCH_H720X) := h720x machine-$(CONFIG_ARCH_AAEC2000) := aaec2000 machine-$(CONFIG_ARCH_REALVIEW) := realview - machine-$(CONFIG_ARCH_AT91) := at91rm9200 + machine-$(CONFIG_ARCH_AT91RM9200) := at91rm9200 machine-$(CONFIG_ARCH_EP93XX) := ep93xx machine-$(CONFIG_ARCH_PNX4008) := pnx4008 machine-$(CONFIG_ARCH_NETX) := netx diff --git a/trunk/arch/arm/boot/compressed/head-clps7500.S b/trunk/arch/arm/boot/compressed/head-clps7500.S index 941c5f5cbacf..4a8a689d15e6 100644 --- a/trunk/arch/arm/boot/compressed/head-clps7500.S +++ b/trunk/arch/arm/boot/compressed/head-clps7500.S @@ -4,6 +4,7 @@ * Copyright (C) 1999, 2000, 2001 Nexus Electronics Ltd */ +#include /* There are three different ways the kernel can be booted on a 7500 system: from Angel (loaded in RAM), from diff --git a/trunk/arch/arm/boot/compressed/head-l7200.S b/trunk/arch/arm/boot/compressed/head-l7200.S index d0e3b20856cd..b08bd23f8d16 100644 --- a/trunk/arch/arm/boot/compressed/head-l7200.S +++ b/trunk/arch/arm/boot/compressed/head-l7200.S @@ -7,6 +7,7 @@ * is merged with head.S by the linker. */ +#include #include #ifndef CONFIG_ARCH_L7200 diff --git a/trunk/arch/arm/boot/compressed/head-sa1100.S b/trunk/arch/arm/boot/compressed/head-sa1100.S index 4c8c0e46027d..5aefffd46048 100644 --- a/trunk/arch/arm/boot/compressed/head-sa1100.S +++ b/trunk/arch/arm/boot/compressed/head-sa1100.S @@ -7,6 +7,7 @@ * */ +#include #include #include diff --git a/trunk/arch/arm/boot/compressed/head-sharpsl.S b/trunk/arch/arm/boot/compressed/head-sharpsl.S index eb0084ea1ec4..59ad69640d6b 100644 --- a/trunk/arch/arm/boot/compressed/head-sharpsl.S +++ b/trunk/arch/arm/boot/compressed/head-sharpsl.S @@ -12,6 +12,7 @@ * */ +#include #include #include diff --git a/trunk/arch/arm/boot/compressed/head-xscale.S b/trunk/arch/arm/boot/compressed/head-xscale.S index 73c5d9e0201c..d3fe2533907e 100644 --- a/trunk/arch/arm/boot/compressed/head-xscale.S +++ b/trunk/arch/arm/boot/compressed/head-xscale.S @@ -5,6 +5,7 @@ * */ +#include #include #include diff --git a/trunk/arch/arm/boot/compressed/head.S b/trunk/arch/arm/boot/compressed/head.S index 14a9ff9c68df..23016f6aa645 100644 --- a/trunk/arch/arm/boot/compressed/head.S +++ b/trunk/arch/arm/boot/compressed/head.S @@ -8,6 +8,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include /* @@ -447,11 +448,8 @@ __common_mmu_cache_on: mov r1, #-1 mcr p15, 0, r3, c2, c0, 0 @ load page table pointer mcr p15, 0, r1, c3, c0, 0 @ load domain access control - b 1f - .align 5 @ cache line aligned -1: mcr p15, 0, r0, c1, c0, 0 @ load control register - mrc p15, 0, r0, c1, c0, 0 @ and read it back to - sub pc, lr, r0, lsr #32 @ properly flush pipeline + mcr p15, 0, r0, c1, c0, 0 @ load control register + mov pc, lr /* * All code following this line is relocatable. It is relocated by diff --git a/trunk/arch/arm/common/gic.c b/trunk/arch/arm/common/gic.c index f3c1ebfdd0aa..c02dc8116a18 100644 --- a/trunk/arch/arm/common/gic.c +++ b/trunk/arch/arm/common/gic.c @@ -33,7 +33,6 @@ static void __iomem *gic_dist_base; static void __iomem *gic_cpu_base; -static DEFINE_SPINLOCK(irq_controller_lock); /* * Routines to acknowledge, disable and enable interrupts @@ -53,45 +52,32 @@ static DEFINE_SPINLOCK(irq_controller_lock); static void gic_ack_irq(unsigned int irq) { u32 mask = 1 << (irq % 32); - - spin_lock(&irq_controller_lock); writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4); writel(irq, gic_cpu_base + GIC_CPU_EOI); - spin_unlock(&irq_controller_lock); } static void gic_mask_irq(unsigned int irq) { u32 mask = 1 << (irq % 32); - - spin_lock(&irq_controller_lock); writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4); - spin_unlock(&irq_controller_lock); } static void gic_unmask_irq(unsigned int irq) { u32 mask = 1 << (irq % 32); - - spin_lock(&irq_controller_lock); writel(mask, gic_dist_base + GIC_DIST_ENABLE_SET + (irq / 32) * 4); - spin_unlock(&irq_controller_lock); } #ifdef CONFIG_SMP -static void gic_set_cpu(unsigned int irq, cpumask_t mask_val) +static void gic_set_cpu(struct irqdesc *desc, unsigned int irq, unsigned int cpu) { void __iomem *reg = gic_dist_base + GIC_DIST_TARGET + (irq & ~3); unsigned int shift = (irq % 4) * 8; - unsigned int cpu = first_cpu(mask_val); u32 val; - spin_lock(&irq_controller_lock); - irq_desc[irq].cpu = cpu; val = readl(reg) & ~(0xff << shift); val |= 1 << (cpu + shift); writel(val, reg); - spin_unlock(&irq_controller_lock); } #endif @@ -100,7 +86,7 @@ static struct irqchip gic_chip = { .mask = gic_mask_irq, .unmask = gic_unmask_irq, #ifdef CONFIG_SMP - .set_affinity = gic_set_cpu, + .set_cpu = gic_set_cpu, #endif }; diff --git a/trunk/arch/arm/common/locomo.c b/trunk/arch/arm/common/locomo.c index fbc3ab0e1011..0dafba3a701d 100644 --- a/trunk/arch/arm/common/locomo.c +++ b/trunk/arch/arm/common/locomo.c @@ -15,6 +15,7 @@ * Based on sa1111.c */ +#include #include #include #include diff --git a/trunk/arch/arm/common/sa1111.c b/trunk/arch/arm/common/sa1111.c index 1cdb26a47e1f..3f68db84e5e6 100644 --- a/trunk/arch/arm/common/sa1111.c +++ b/trunk/arch/arm/common/sa1111.c @@ -14,6 +14,7 @@ * All initialization functions provided here are intended to be called * from machine specific code with proper arguments when required. */ +#include #include #include #include @@ -150,7 +151,7 @@ static void sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) { unsigned int stat0, stat1, i; - void __iomem *base = get_irq_data(irq); + void __iomem *base = desc->data; stat0 = sa1111_readl(base + SA1111_INTSTATCLR0); stat1 = sa1111_readl(base + SA1111_INTSTATCLR1); @@ -168,11 +169,11 @@ sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1) if (stat0 & 1) - handle_edge_irq(i, irq_desc + i, regs); + do_edge_IRQ(i, irq_desc + i, regs); for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1) if (stat1 & 1) - handle_edge_irq(i, irq_desc + i, regs); + do_edge_IRQ(i, irq_desc + i, regs); /* For level-based interrupts */ desc->chip->unmask(irq); diff --git a/trunk/arch/arm/common/time-acorn.c b/trunk/arch/arm/common/time-acorn.c index 3f60dd9aca80..486add853fb8 100644 --- a/trunk/arch/arm/common/time-acorn.c +++ b/trunk/arch/arm/common/time-acorn.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -77,7 +76,7 @@ ioc_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction ioc_timer_irq = { .name = "timer", - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .handler = ioc_timer_interrupt }; diff --git a/trunk/arch/arm/common/uengine.c b/trunk/arch/arm/common/uengine.c index 95c8508c29b7..dfca596a9a27 100644 --- a/trunk/arch/arm/common/uengine.c +++ b/trunk/arch/arm/common/uengine.c @@ -11,6 +11,7 @@ * License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/arm/common/via82c505.c b/trunk/arch/arm/common/via82c505.c index ba2e62986a57..ef716a5b07ac 100644 --- a/trunk/arch/arm/common/via82c505.c +++ b/trunk/arch/arm/common/via82c505.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/arm/configs/at91rm9200dk_defconfig b/trunk/arch/arm/configs/at91rm9200dk_defconfig index 4f3d8d37741e..9e1c1cceb735 100644 --- a/trunk/arch/arm/configs/at91rm9200dk_defconfig +++ b/trunk/arch/arm/configs/at91rm9200dk_defconfig @@ -103,7 +103,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set -CONFIG_ARCH_AT91=y CONFIG_ARCH_AT91RM9200=y # diff --git a/trunk/arch/arm/configs/at91rm9200ek_defconfig b/trunk/arch/arm/configs/at91rm9200ek_defconfig index 08b5dc38876f..6e0805a971d7 100644 --- a/trunk/arch/arm/configs/at91rm9200ek_defconfig +++ b/trunk/arch/arm/configs/at91rm9200ek_defconfig @@ -103,7 +103,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set -CONFIG_ARCH_AT91=y CONFIG_ARCH_AT91RM9200=y # diff --git a/trunk/arch/arm/configs/ateb9200_defconfig b/trunk/arch/arm/configs/ateb9200_defconfig index bee7813d040e..69c39e098743 100644 --- a/trunk/arch/arm/configs/ateb9200_defconfig +++ b/trunk/arch/arm/configs/ateb9200_defconfig @@ -105,7 +105,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set -CONFIG_ARCH_AT91=y CONFIG_ARCH_AT91RM9200=y # diff --git a/trunk/arch/arm/configs/carmeva_defconfig b/trunk/arch/arm/configs/carmeva_defconfig index 8a075c8ecc63..5ccd29a7c1fb 100644 --- a/trunk/arch/arm/configs/carmeva_defconfig +++ b/trunk/arch/arm/configs/carmeva_defconfig @@ -82,7 +82,6 @@ CONFIG_OBSOLETE_MODPARM=y # CONFIG_ARCH_VERSATILE is not set # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set -CONFIG_ARCH_AT91=y CONFIG_ARCH_AT91RM9200=y # diff --git a/trunk/arch/arm/configs/csb337_defconfig b/trunk/arch/arm/configs/csb337_defconfig index 3594155a8137..94bd9932a402 100644 --- a/trunk/arch/arm/configs/csb337_defconfig +++ b/trunk/arch/arm/configs/csb337_defconfig @@ -103,7 +103,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set -CONFIG_ARCH_AT91=y CONFIG_ARCH_AT91RM9200=y # diff --git a/trunk/arch/arm/configs/csb637_defconfig b/trunk/arch/arm/configs/csb637_defconfig index 640d70c1f066..1519124c5501 100644 --- a/trunk/arch/arm/configs/csb637_defconfig +++ b/trunk/arch/arm/configs/csb637_defconfig @@ -103,7 +103,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set -CONFIG_ARCH_AT91=y CONFIG_ARCH_AT91RM9200=y # diff --git a/trunk/arch/arm/configs/kafa_defconfig b/trunk/arch/arm/configs/kafa_defconfig index 1db633e2c940..51ded20e3f64 100644 --- a/trunk/arch/arm/configs/kafa_defconfig +++ b/trunk/arch/arm/configs/kafa_defconfig @@ -105,7 +105,6 @@ CONFIG_DEFAULT_IOSCHED="deadline" # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set -CONFIG_ARCH_AT91=y CONFIG_ARCH_AT91RM9200=y # diff --git a/trunk/arch/arm/configs/kb9202_defconfig b/trunk/arch/arm/configs/kb9202_defconfig index 45396e087196..fee4f566452e 100644 --- a/trunk/arch/arm/configs/kb9202_defconfig +++ b/trunk/arch/arm/configs/kb9202_defconfig @@ -80,7 +80,6 @@ CONFIG_KMOD=y # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set -CONFIG_ARCH_AT91=y CONFIG_ARCH_AT91RM9200=y # diff --git a/trunk/arch/arm/configs/omap_h2_1610_defconfig b/trunk/arch/arm/configs/omap_h2_1610_defconfig index 05adb0b34e72..ee3ecbd9002d 100644 --- a/trunk/arch/arm/configs/omap_h2_1610_defconfig +++ b/trunk/arch/arm/configs/omap_h2_1610_defconfig @@ -1,20 +1,19 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.17 -# Thu Jun 29 15:25:18 2006 +# Linux kernel version: 2.6.14 +# Wed Nov 9 18:53:40 2005 # CONFIG_ARM=y CONFIG_MMU=y +CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y -CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # Code maturity level options # CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 @@ -30,26 +29,26 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set -# CONFIG_RELAY is not set CONFIG_INITRAMFS_SOURCE="" -CONFIG_UID16=y -CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y -CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SHMEM=y -CONFIG_SLAB=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 -# CONFIG_SLOB is not set # # Loadable module support @@ -57,6 +56,7 @@ CONFIG_BASE_SMALL=0 CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set @@ -64,7 +64,6 @@ CONFIG_MODULE_UNLOAD=y # # Block layer # -# CONFIG_BLK_DEV_IO_TRACE is not set # # IO Schedulers @@ -82,26 +81,16 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # # System Type # -# CONFIG_ARCH_AAEC2000 is not set -# CONFIG_ARCH_INTEGRATOR is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_AT91RM9200 is not set # CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set -# CONFIG_ARCH_EP93XX is not set # CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_NETX is not set -# CONFIG_ARCH_H720X is not set -# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_IOP3XX is not set # CONFIG_ARCH_IXP4XX is not set # CONFIG_ARCH_IXP2000 is not set -# CONFIG_ARCH_IXP23XX is not set # CONFIG_ARCH_L7200 is not set -# CONFIG_ARCH_PNX4008 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set # CONFIG_ARCH_SA1100 is not set @@ -109,6 +98,11 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set CONFIG_ARCH_OMAP=y +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_AAEC2000 is not set # # TI OMAP Implementations @@ -147,7 +141,6 @@ CONFIG_ARCH_OMAP16XX=y CONFIG_MACH_OMAP_H2=y # CONFIG_MACH_OMAP_H3 is not set # CONFIG_MACH_OMAP_OSK is not set -# CONFIG_MACH_NOKIA770 is not set # CONFIG_MACH_OMAP_GENERIC is not set # @@ -184,6 +177,7 @@ CONFIG_ARM_THUMB=y # # Bus support # +CONFIG_ISA_DMA_API=y # # PCCARD (PCMCIA/CardBus) support @@ -195,8 +189,6 @@ CONFIG_ARM_THUMB=y # CONFIG_PREEMPT=y CONFIG_NO_IDLE_HZ=y -CONFIG_HZ=128 -# CONFIG_AEABI is not set # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y @@ -257,8 +249,6 @@ CONFIG_BINFMT_AOUT=y # Power management options # CONFIG_PM=y -CONFIG_PM_LEGACY=y -# CONFIG_PM_DEBUG is not set # CONFIG_APM is not set # @@ -269,12 +259,9 @@ CONFIG_NET=y # # Networking options # -# CONFIG_NETDEBUG is not set CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set CONFIG_UNIX=y -CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set @@ -291,18 +278,12 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set # CONFIG_INET_TUNNEL is not set -CONFIG_INET_XFRM_MODE_TRANSPORT=y -CONFIG_INET_XFRM_MODE_TUNNEL=y CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set -# CONFIG_INET6_XFRM_TUNNEL is not set -# CONFIG_INET6_TUNNEL is not set -# CONFIG_NETWORK_SECMARK is not set # CONFIG_NETFILTER is not set # @@ -314,11 +295,6 @@ CONFIG_TCP_CONG_BIC=y # SCTP Configuration (EXPERIMENTAL) # # CONFIG_IP_SCTP is not set - -# -# TIPC Configuration (EXPERIMENTAL) -# -# CONFIG_TIPC is not set # CONFIG_ATM is not set # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set @@ -336,6 +312,7 @@ CONFIG_TCP_CONG_BIC=y # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -356,12 +333,6 @@ CONFIG_TCP_CONG_BIC=y CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set -# CONFIG_SYS_HYPERVISOR is not set - -# -# Connector - unified userspace <-> kernelspace linker -# -# CONFIG_CONNECTOR is not set # # Memory Technology Devices (MTD) @@ -555,7 +526,6 @@ CONFIG_SERIO_SERPORT=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y -# CONFIG_VT_HW_CONSOLE_BINDING is not set # CONFIG_SERIAL_NONSTANDARD is not set # @@ -564,7 +534,6 @@ CONFIG_HW_CONSOLE=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # @@ -590,8 +559,8 @@ CONFIG_WATCHDOG_NOWAYOUT=y # Watchdog Device Drivers # # CONFIG_SOFT_WATCHDOG is not set -# CONFIG_HW_RANDOM is not set # CONFIG_NVRAM is not set +# CONFIG_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -603,7 +572,6 @@ CONFIG_WATCHDOG_NOWAYOUT=y # # TPM devices # -# CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set # @@ -611,23 +579,11 @@ CONFIG_WATCHDOG_NOWAYOUT=y # # CONFIG_I2C is not set -# -# SPI support -# -# CONFIG_SPI is not set -# CONFIG_SPI_MASTER is not set - -# -# Dallas's 1-wire bus -# - # # Hardware Monitoring support # CONFIG_HWMON=y # CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_ABITUGURU is not set -# CONFIG_SENSORS_F71805F is not set # CONFIG_HWMON_DEBUG_CHIP is not set # @@ -635,23 +591,13 @@ CONFIG_HWMON=y # # -# LED devices -# -# CONFIG_NEW_LEDS is not set - -# -# LED drivers -# - -# -# LED Triggers +# Multimedia Capabilities Port drivers # # # Multimedia devices # # CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -661,13 +607,11 @@ CONFIG_VIDEO_V4L2=y # # Graphics support # -CONFIG_FIRMWARE_EDID=y CONFIG_FB=y # CONFIG_FB_CFB_FILLRECT is not set # CONFIG_FB_CFB_COPYAREA is not set # CONFIG_FB_CFB_IMAGEBLIT is not set # CONFIG_FB_MACMODES is not set -# CONFIG_FB_BACKLIGHT is not set CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_S1D13XXX is not set @@ -691,6 +635,7 @@ CONFIG_FONT_8x16=y # CONFIG_FONT_SUN8x16 is not set # CONFIG_FONT_SUN12x22 is not set # CONFIG_FONT_10x18 is not set +# CONFIG_FONT_RL is not set # # Logo configuration @@ -715,15 +660,16 @@ CONFIG_SOUND=y # Open Sound System # CONFIG_SOUND_PRIME=y +# CONFIG_OBSOLETE_OSS_DRIVER is not set # CONFIG_SOUND_MSNDCLAS is not set # CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_OSS is not set # # USB support # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y -# CONFIG_USB_ARCH_HAS_EHCI is not set # CONFIG_USB is not set # @@ -734,18 +680,23 @@ CONFIG_USB_ARCH_HAS_OHCI=y # USB Gadget Support # # CONFIG_USB_GADGET is not set +# CONFIG_USB_GADGET_NET2280 is not set +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_ZERO is not set +# CONFIG_USB_ETH is not set +# CONFIG_USB_GADGETFS is not set +# CONFIG_USB_FILE_STORAGE is not set +# CONFIG_USB_G_SERIAL is not set # # MMC/SD Card support # # CONFIG_MMC is not set -# -# Real Time Clock -# -CONFIG_RTC_LIB=y -# CONFIG_RTC_CLASS is not set - # # File systems # @@ -753,15 +704,14 @@ CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XIP is not set # CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set # CONFIG_XFS_FS is not set -# CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set CONFIG_ROMFS_FS=y CONFIG_INOTIFY=y -CONFIG_INOTIFY_USER=y # CONFIG_QUOTA is not set CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set @@ -791,7 +741,7 @@ CONFIG_SYSFS=y # CONFIG_TMPFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y -# CONFIG_CONFIGFS_FS is not set +# CONFIG_RELAYFS_FS is not set # # Miscellaneous filesystems @@ -893,13 +843,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # # CONFIG_PRINTK_TIME is not set -# CONFIG_MAGIC_SYSRQ is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_DEBUG_BUGVERBOSE=y -# CONFIG_DEBUG_FS is not set CONFIG_FRAME_POINTER=y -# CONFIG_UNWIND_INFO is not set # CONFIG_DEBUG_USER is not set # diff --git a/trunk/arch/arm/configs/onearm_defconfig b/trunk/arch/arm/configs/onearm_defconfig index 2b4a63be03f7..5401c01caefe 100644 --- a/trunk/arch/arm/configs/onearm_defconfig +++ b/trunk/arch/arm/configs/onearm_defconfig @@ -85,7 +85,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_REALVIEW is not set # CONFIG_ARCH_VERSATILE is not set -CONFIG_ARCH_AT91=y CONFIG_ARCH_AT91RM9200=y # CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS711X is not set diff --git a/trunk/arch/arm/configs/trizeps4_defconfig b/trunk/arch/arm/configs/trizeps4_defconfig deleted file mode 100644 index a6698dc4f6b9..000000000000 --- a/trunk/arch/arm/configs/trizeps4_defconfig +++ /dev/null @@ -1,1579 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.17 -# Sat Jun 24 22:45:14 2006 -# -CONFIG_ARM=y -CONFIG_MMU=y -CONFIG_RWSEM_GENERIC_SPINLOCK=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_ARCH_MTD_XIP=y -CONFIG_VECTORS_BASE=0xffff0000 - -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_LOCK_KERNEL=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_POSIX_MQUEUE=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y -CONFIG_SYSCTL=y -CONFIG_AUDIT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -# CONFIG_RELAY is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_UID16=y -CONFIG_CC_OPTIMIZE_FOR_SIZE=y -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -CONFIG_KALLSYMS_EXTRA_PASS=y -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SHMEM=y -CONFIG_SLAB=y -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 -# CONFIG_SLOB is not set -CONFIG_OBSOLETE_INTERMODULE=y - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -CONFIG_MODULE_FORCE_UNLOAD=y -# CONFIG_MODVERSIONS is not set -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_BLK_DEV_IO_TRACE is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - -# -# System Type -# -# CONFIG_ARCH_CLPS7500 is not set -# CONFIG_ARCH_CLPS711X is not set -# CONFIG_ARCH_CO285 is not set -# CONFIG_ARCH_EBSA110 is not set -# CONFIG_ARCH_EP93XX is not set -# CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_INTEGRATOR is not set -# CONFIG_ARCH_IOP3XX is not set -# CONFIG_ARCH_IXP4XX is not set -# CONFIG_ARCH_IXP2000 is not set -# CONFIG_ARCH_IXP23XX is not set -# CONFIG_ARCH_L7200 is not set -CONFIG_ARCH_PXA=y -# CONFIG_ARCH_RPC is not set -# CONFIG_ARCH_SA1100 is not set -# CONFIG_ARCH_S3C2410 is not set -# CONFIG_ARCH_SHARK is not set -# CONFIG_ARCH_LH7A40X is not set -# CONFIG_ARCH_OMAP is not set -# CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_IMX is not set -# CONFIG_ARCH_H720X is not set -# CONFIG_ARCH_AAEC2000 is not set -# CONFIG_ARCH_AT91RM9200 is not set - -# -# Intel PXA2xx Implementations -# -# CONFIG_ARCH_LUBBOCK is not set -# CONFIG_MACH_LOGICPD_PXA270 is not set -# CONFIG_MACH_MAINSTONE is not set -# CONFIG_ARCH_PXA_IDP is not set -# CONFIG_PXA_SHARPSL is not set -CONFIG_MACH_TRIZEPS4=y -CONFIG_MACH_TRIZEPS4_CONXS=y -# CONFIG_MACH_TRIZEPS4_ANY is not set -CONFIG_PXA27x=y - -# -# Processor Type -# -CONFIG_CPU_32=y -CONFIG_CPU_XSCALE=y -CONFIG_CPU_32v5=y -CONFIG_CPU_ABRT_EV5T=y -CONFIG_CPU_CACHE_VIVT=y -CONFIG_CPU_TLB_V4WBI=y - -# -# Processor Features -# -CONFIG_ARM_THUMB=y -CONFIG_XSCALE_PMU=y - -# -# Bus support -# - -# -# PCCARD (PCMCIA/CardBus) support -# -CONFIG_PCCARD=m -# CONFIG_PCMCIA_DEBUG is not set -CONFIG_PCMCIA=m -CONFIG_PCMCIA_LOAD_CIS=y -CONFIG_PCMCIA_IOCTL=y - -# -# PC-card bridges -# -CONFIG_PCMCIA_PXA2XX=m - -# -# Kernel Features -# -CONFIG_PREEMPT=y -# CONFIG_NO_IDLE_HZ is not set -CONFIG_HZ=100 -# CONFIG_AEABI is not set -# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4096 -CONFIG_LEDS=y -CONFIG_LEDS_TIMER=y -CONFIG_LEDS_CPU=y -CONFIG_ALIGNMENT_TRAP=y - -# -# Boot options -# -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_CMDLINE="root=/dev/nfs ip=bootp console=ttyS0,115200n8" -# CONFIG_XIP_KERNEL is not set - -# -# Floating point emulation -# - -# -# At least one emulation must be selected -# -CONFIG_FPE_NWFPE=y -CONFIG_FPE_NWFPE_XP=y -# CONFIG_FPE_FASTFPE is not set - -# -# Userspace binary formats -# -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_AOUT is not set -CONFIG_BINFMT_MISC=m -# CONFIG_ARTHUR is not set - -# -# Power management options -# -CONFIG_PM=y -CONFIG_PM_LEGACY=y -# CONFIG_PM_DEBUG is not set -CONFIG_APM=y - -# -# Networking -# -CONFIG_NET=y - -# -# Networking options -# -# CONFIG_NETDEBUG is not set -CONFIG_PACKET=y -CONFIG_PACKET_MMAP=y -CONFIG_UNIX=y -CONFIG_XFRM=y -CONFIG_XFRM_USER=m -CONFIG_NET_KEY=y -CONFIG_INET=y -# CONFIG_IP_MULTICAST is not set -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_FIB_HASH=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -# CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_BIC=y - -# -# IP: Virtual Server Configuration -# -# CONFIG_IP_VS is not set -CONFIG_IPV6=m -# CONFIG_IPV6_PRIVACY is not set -# CONFIG_IPV6_ROUTER_PREF is not set -# CONFIG_INET6_AH is not set -# CONFIG_INET6_ESP is not set -# CONFIG_INET6_IPCOMP is not set -# CONFIG_INET6_XFRM_TUNNEL is not set -# CONFIG_INET6_TUNNEL is not set -# CONFIG_IPV6_TUNNEL is not set -CONFIG_NETFILTER=y -# CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# -# CONFIG_NETFILTER_NETLINK is not set -# CONFIG_NETFILTER_XTABLES is not set - -# -# IP: Netfilter Configuration -# -CONFIG_IP_NF_CONNTRACK=m -CONFIG_IP_NF_CT_ACCT=y -CONFIG_IP_NF_CONNTRACK_MARK=y -# CONFIG_IP_NF_CONNTRACK_EVENTS is not set -# CONFIG_IP_NF_CT_PROTO_SCTP is not set -CONFIG_IP_NF_FTP=m -CONFIG_IP_NF_IRC=m -# CONFIG_IP_NF_NETBIOS_NS is not set -CONFIG_IP_NF_TFTP=m -CONFIG_IP_NF_AMANDA=m -# CONFIG_IP_NF_PPTP is not set -# CONFIG_IP_NF_H323 is not set -CONFIG_IP_NF_QUEUE=m - -# -# IPv6: Netfilter Configuration (EXPERIMENTAL) -# -# CONFIG_IP6_NF_QUEUE is not set - -# -# DCCP Configuration (EXPERIMENTAL) -# -# CONFIG_IP_DCCP is not set - -# -# SCTP Configuration (EXPERIMENTAL) -# -# CONFIG_IP_SCTP is not set - -# -# TIPC Configuration (EXPERIMENTAL) -# -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -CONFIG_VLAN_8021Q=m -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_NET_DIVERT is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# -# CONFIG_NET_SCHED is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -CONFIG_IRDA=m - -# -# IrDA protocols -# -CONFIG_IRLAN=m -CONFIG_IRNET=m -CONFIG_IRCOMM=m -CONFIG_IRDA_ULTRA=y - -# -# IrDA options -# -CONFIG_IRDA_CACHE_LAST_LSAP=y -CONFIG_IRDA_FAST_RR=y -# CONFIG_IRDA_DEBUG is not set - -# -# Infrared-port device drivers -# - -# -# SIR device drivers -# -CONFIG_IRTTY_SIR=m - -# -# Dongle support -# -# CONFIG_DONGLE is not set - -# -# Old SIR device drivers -# -# CONFIG_IRPORT_SIR is not set - -# -# Old Serial dongle support -# - -# -# FIR device drivers -# -# CONFIG_USB_IRDA is not set -# CONFIG_SIGMATEL_FIR is not set -# CONFIG_PXA_FICP is not set -CONFIG_BT=m -CONFIG_BT_L2CAP=m -CONFIG_BT_SCO=m -CONFIG_BT_RFCOMM=m -CONFIG_BT_RFCOMM_TTY=y -CONFIG_BT_BNEP=m -CONFIG_BT_BNEP_MC_FILTER=y -CONFIG_BT_BNEP_PROTO_FILTER=y -CONFIG_BT_HIDP=m - -# -# Bluetooth device drivers -# -# CONFIG_BT_HCIUSB is not set -# CONFIG_BT_HCIUART is not set -# CONFIG_BT_HCIBCM203X is not set -# CONFIG_BT_HCIBPA10X is not set -# CONFIG_BT_HCIBFUSB is not set -# CONFIG_BT_HCIDTL1 is not set -# CONFIG_BT_HCIBT3C is not set -# CONFIG_BT_HCIBLUECARD is not set -# CONFIG_BT_HCIBTUART is not set -# CONFIG_BT_HCIVHCI is not set -CONFIG_IEEE80211=m -# CONFIG_IEEE80211_DEBUG is not set -CONFIG_IEEE80211_CRYPT_WEP=m -CONFIG_IEEE80211_CRYPT_CCMP=m -CONFIG_IEEE80211_CRYPT_TKIP=m -CONFIG_IEEE80211_SOFTMAC=m -# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set -CONFIG_WIRELESS_EXT=y - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_FW_LOADER=y - -# -# Connector - unified userspace <-> kernelspace linker -# -CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y - -# -# Memory Technology Devices (MTD) -# -CONFIG_MTD=y -# CONFIG_MTD_DEBUG is not set -CONFIG_MTD_CONCAT=y -CONFIG_MTD_PARTITIONS=y -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 -CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y -CONFIG_MTD_REDBOOT_PARTS_READONLY=y -# CONFIG_MTD_CMDLINE_PARTS is not set -# CONFIG_MTD_AFS_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_CHAR=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -CONFIG_NFTL=y -CONFIG_NFTL_RW=y -CONFIG_INFTL=y -# CONFIG_RFD_FTL is not set - -# -# RAM/ROM/Flash chip drivers -# -CONFIG_MTD_CFI=y -CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_GEN_PROBE=y -CONFIG_MTD_CFI_ADV_OPTIONS=y -# CONFIG_MTD_CFI_NOSWAP is not set -# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set -CONFIG_MTD_CFI_LE_BYTE_SWAP=y -CONFIG_MTD_CFI_GEOMETRY=y -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -# CONFIG_MTD_OTP is not set -CONFIG_MTD_CFI_INTELEXT=y -CONFIG_MTD_CFI_AMDSTD=y -# CONFIG_MTD_CFI_STAA is not set -CONFIG_MTD_CFI_UTIL=y -# CONFIG_MTD_RAM is not set -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set -# CONFIG_MTD_OBSOLETE_CHIPS is not set -# CONFIG_MTD_XIP is not set - -# -# Mapping drivers for chip access -# -CONFIG_MTD_COMPLEX_MAPPINGS=y -CONFIG_MTD_PHYSMAP=y -CONFIG_MTD_PHYSMAP_START=0x0 -CONFIG_MTD_PHYSMAP_LEN=0x4000000 -CONFIG_MTD_PHYSMAP_BANKWIDTH=2 -# CONFIG_MTD_TRIZEPS4 is not set -# CONFIG_MTD_ARM_INTEGRATOR is not set -# CONFIG_MTD_IMPA7 is not set -# CONFIG_MTD_SHARP_SL is not set -# CONFIG_MTD_PLATRAM is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_DATAFLASH is not set -# CONFIG_MTD_M25P80 is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -CONFIG_MTD_DOC2001PLUS=y -CONFIG_MTD_DOCPROBE=y -CONFIG_MTD_DOCECC=y -# CONFIG_MTD_DOCPROBE_ADVANCED is not set -CONFIG_MTD_DOCPROBE_ADDRESS=0 - -# -# NAND Flash Device Drivers -# -CONFIG_MTD_NAND=y -# CONFIG_MTD_NAND_VERIFY_WRITE is not set -# CONFIG_MTD_NAND_H1900 is not set -CONFIG_MTD_NAND_IDS=y -CONFIG_MTD_NAND_DISKONCHIP=y -# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set -CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 -# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set -# CONFIG_MTD_NAND_SHARPSL is not set -# CONFIG_MTD_NAND_NANDSIM is not set - -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - -# -# Parallel port support -# -# CONFIG_PARPORT is not set - -# -# Plug and Play support -# - -# -# Block devices -# -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_CRYPTOLOOP=m -CONFIG_BLK_DEV_NBD=y -# CONFIG_BLK_DEV_UB is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=4 -CONFIG_BLK_DEV_RAM_SIZE=4096 -CONFIG_BLK_DEV_INITRD=y -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set - -# -# ATA/ATAPI/MFM/RLL support -# -CONFIG_IDE=y -CONFIG_BLK_DEV_IDE=y - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# -# CONFIG_BLK_DEV_IDE_SATA is not set -CONFIG_BLK_DEV_IDEDISK=y -CONFIG_IDEDISK_MULTI_MODE=y -CONFIG_BLK_DEV_IDECS=m -# CONFIG_BLK_DEV_IDECD is not set -# CONFIG_BLK_DEV_IDETAPE is not set -# CONFIG_BLK_DEV_IDEFLOPPY is not set -# CONFIG_BLK_DEV_IDESCSI is not set -# CONFIG_IDE_TASK_IOCTL is not set - -# -# IDE chipset support/bugfixes -# -CONFIG_IDE_GENERIC=y -CONFIG_IDE_PXA_CF=y -CONFIG_IDE_ARM=y -# CONFIG_BLK_DEV_IDEDMA is not set -# CONFIG_IDEDMA_AUTO is not set -# CONFIG_BLK_DEV_HD is not set - -# -# SCSI device support -# -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=m -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=m -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -CONFIG_CHR_DEV_SG=m -# CONFIG_CHR_DEV_SCH is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# -CONFIG_SCSI_MULTI_LUN=y -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set - -# -# SCSI Transport Attributes -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set - -# -# SCSI low-level drivers -# -# CONFIG_ISCSI_TCP is not set -# CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_DEBUG is not set - -# -# PCMCIA SCSI adapter support -# -# CONFIG_PCMCIA_AHA152X is not set -# CONFIG_PCMCIA_FDOMAIN is not set -# CONFIG_PCMCIA_NINJA_SCSI is not set -# CONFIG_PCMCIA_QLOGIC is not set -# CONFIG_PCMCIA_SYM53C500 is not set - -# -# Multi-device support (RAID and LVM) -# -# CONFIG_MD is not set - -# -# Fusion MPT device support -# -# CONFIG_FUSION is not set - -# -# IEEE 1394 (FireWire) support -# - -# -# I2O device support -# - -# -# Network device support -# -CONFIG_NETDEVICES=y -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set - -# -# PHY device support -# -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -# CONFIG_MARVELL_PHY is not set -CONFIG_DAVICOM_PHY=y -# CONFIG_QSEMI_PHY is not set -# CONFIG_LXT_PHY is not set -# CONFIG_CICADA_PHY is not set - -# -# Ethernet (10 or 100Mbit) -# -CONFIG_NET_ETHERNET=y -CONFIG_MII=y -# CONFIG_SMC91X is not set -CONFIG_DM9000=y - -# -# Ethernet (1000 Mbit) -# - -# -# Ethernet (10000 Mbit) -# - -# -# Token Ring devices -# - -# -# Wireless LAN (non-hamradio) -# -CONFIG_NET_RADIO=y -# CONFIG_NET_WIRELESS_RTNETLINK is not set - -# -# Obsolete Wireless cards support (pre-802.11) -# -# CONFIG_STRIP is not set -# CONFIG_PCMCIA_WAVELAN is not set -# CONFIG_PCMCIA_NETWAVE is not set - -# -# Wireless 802.11 Frequency Hopping cards support -# -# CONFIG_PCMCIA_RAYCS is not set - -# -# Wireless 802.11b ISA/PCI cards support -# -CONFIG_HERMES=m -# CONFIG_ATMEL is not set - -# -# Wireless 802.11b Pcmcia/Cardbus cards support -# -CONFIG_PCMCIA_HERMES=m -# CONFIG_PCMCIA_SPECTRUM is not set -CONFIG_AIRO_CS=m -# CONFIG_PCMCIA_WL3501 is not set -CONFIG_HOSTAP=m -CONFIG_HOSTAP_FIRMWARE=y -CONFIG_HOSTAP_FIRMWARE_NVRAM=y -CONFIG_HOSTAP_CS=m -CONFIG_NET_WIRELESS=y - -# -# PCMCIA network device support -# -# CONFIG_NET_PCMCIA is not set - -# -# Wan interfaces -# -# CONFIG_WAN is not set -CONFIG_PPP=m -CONFIG_PPP_MULTILINK=y -CONFIG_PPP_FILTER=y -CONFIG_PPP_ASYNC=m -CONFIG_PPP_SYNC_TTY=m -CONFIG_PPP_DEFLATE=m -CONFIG_PPP_BSDCOMP=m -CONFIG_PPP_MPPE=m -# CONFIG_PPPOE is not set -# CONFIG_SLIP is not set -# CONFIG_SHAPER is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set - -# -# ISDN subsystem -# -# CONFIG_ISDN is not set - -# -# Input device support -# -CONFIG_INPUT=y - -# -# Userland interfaces -# -CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y -CONFIG_INPUT_MOUSEDEV_SCREEN_X=640 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480 -# CONFIG_INPUT_JOYDEV is not set -CONFIG_INPUT_TSDEV=y -CONFIG_INPUT_TSDEV_SCREEN_X=640 -CONFIG_INPUT_TSDEV_SCREEN_Y=480 -CONFIG_INPUT_EVDEV=y -# CONFIG_INPUT_EVBUG is not set - -# -# Input Device Drivers -# -CONFIG_INPUT_KEYBOARD=y -CONFIG_KEYBOARD_ATKBD=y -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYBOARD_NEWTON is not set -CONFIG_INPUT_MOUSE=y -# CONFIG_MOUSE_PS2 is not set -CONFIG_MOUSE_SERIAL=y -# CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_INPUT_JOYSTICK is not set -CONFIG_INPUT_TOUCHSCREEN=y -# CONFIG_TOUCHSCREEN_ADS7846 is not set -# CONFIG_TOUCHSCREEN_GUNZE is not set -# CONFIG_TOUCHSCREEN_ELO is not set -# CONFIG_TOUCHSCREEN_MTOUCH is not set -# CONFIG_TOUCHSCREEN_MK712 is not set -CONFIG_INPUT_MISC=y -CONFIG_INPUT_UINPUT=m - -# -# Hardware I/O ports -# -CONFIG_SERIO=y -CONFIG_SERIO_SERPORT=y -CONFIG_SERIO_LIBPS2=y -# CONFIG_SERIO_RAW is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_HW_CONSOLE=y -# CONFIG_SERIAL_NONSTANDARD is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_8250 is not set - -# -# Non-8250 serial port support -# -CONFIG_SERIAL_PXA=y -CONFIG_SERIAL_PXA_CONSOLE=y -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_UNIX98_PTYS=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 - -# -# IPMI -# -# CONFIG_IPMI_HANDLER is not set - -# -# Watchdog Cards -# -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -CONFIG_SA1100_WATCHDOG=y - -# -# USB-based Watchdog Cards -# -# CONFIG_USBPCWATCHDOG is not set -# CONFIG_NVRAM is not set -# CONFIG_DTLK is not set -# CONFIG_R3964 is not set - -# -# Ftape, the floppy tape device driver -# - -# -# PCMCIA character devices -# -# CONFIG_SYNCLINK_CS is not set -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set -# CONFIG_RAW_DRIVER is not set - -# -# TPM devices -# -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set - -# -# I2C support -# -CONFIG_I2C=y -CONFIG_I2C_CHARDEV=y - -# -# I2C Algorithms -# -# CONFIG_I2C_ALGOBIT is not set -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALGOPCA is not set - -# -# I2C Hardware Bus support -# -CONFIG_I2C_PXA=y -CONFIG_I2C_PXA_SLAVE=y -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_PCA_ISA is not set - -# -# Miscellaneous I2C Chip support -# -# CONFIG_SENSORS_DS1337 is not set -# CONFIG_SENSORS_DS1374 is not set -CONFIG_SENSORS_EEPROM=m -# CONFIG_SENSORS_PCF8574 is not set -# CONFIG_SENSORS_PCA9539 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_MAX6875 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set - -# -# SPI support -# -CONFIG_SPI=y -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -# CONFIG_SPI_BITBANG is not set -CONFIG_SPI_PXA2XX=m - -# -# SPI Protocol Masters -# - -# -# Dallas's 1-wire bus -# -# CONFIG_W1 is not set - -# -# Hardware Monitoring support -# -CONFIG_HWMON=y -# CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_ADM1021 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ASB100 is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_FSCHER is not set -# CONFIG_SENSORS_FSCPOS is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set -# CONFIG_HWMON_DEBUG_CHIP is not set - -# -# Misc devices -# - -# -# Multimedia Capabilities Port drivers -# -CONFIG_UCB1400=y -CONFIG_UCB1400_TS=y - -# -# LED devices -# -CONFIG_NEW_LEDS=y -CONFIG_LEDS_CLASS=y - -# -# LED drivers -# - -# -# LED Triggers -# -CONFIG_LEDS_TRIGGERS=y -CONFIG_LEDS_TRIGGER_TIMER=y -CONFIG_LEDS_TRIGGER_IDE_DISK=y - -# -# Multimedia devices -# -# CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y - -# -# Digital Video Broadcasting Devices -# -# CONFIG_DVB is not set -# CONFIG_USB_DABUSB is not set - -# -# Graphics support -# -CONFIG_FB=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y -# CONFIG_FB_MACMODES is not set -CONFIG_FB_FIRMWARE_EDID=y -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set -# CONFIG_FB_S1D13XXX is not set -CONFIG_FB_PXA=y -# CONFIG_FB_PXA_PARAMETERS is not set -# CONFIG_FB_VIRTUAL is not set - -# -# Console display driver support -# -# CONFIG_VGA_CONSOLE is not set -CONFIG_DUMMY_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y -CONFIG_FONTS=y -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y -# CONFIG_FONT_6x11 is not set -# CONFIG_FONT_7x14 is not set -# CONFIG_FONT_PEARL_8x8 is not set -# CONFIG_FONT_ACORN_8x8 is not set -# CONFIG_FONT_MINI_4x6 is not set -# CONFIG_FONT_SUN8x16 is not set -# CONFIG_FONT_SUN12x22 is not set -# CONFIG_FONT_10x18 is not set - -# -# Logo configuration -# -CONFIG_LOGO=y -CONFIG_LOGO_LINUX_MONO=y -CONFIG_LOGO_LINUX_VGA16=y -CONFIG_LOGO_LINUX_CLUT224=y -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_CLASS_DEVICE=y -CONFIG_BACKLIGHT_DEVICE=y -CONFIG_LCD_CLASS_DEVICE=y -CONFIG_LCD_DEVICE=y - -# -# Sound -# -CONFIG_SOUND=y - -# -# Advanced Linux Sound Architecture -# -CONFIG_SND=y -CONFIG_SND_TIMER=y -CONFIG_SND_PCM=y -CONFIG_SND_HWDEP=m -CONFIG_SND_RAWMIDI=m -CONFIG_SND_SEQUENCER=m -# CONFIG_SND_SEQ_DUMMY is not set -CONFIG_SND_OSSEMUL=y -CONFIG_SND_MIXER_OSS=y -CONFIG_SND_PCM_OSS=y -CONFIG_SND_PCM_OSS_PLUGINS=y -# CONFIG_SND_SEQUENCER_OSS is not set -# CONFIG_SND_DYNAMIC_MINORS is not set -CONFIG_SND_SUPPORT_OLD_API=y -CONFIG_SND_VERBOSE_PROCFS=y -CONFIG_SND_VERBOSE_PRINTK=y -# CONFIG_SND_DEBUG is not set - -# -# Generic devices -# -CONFIG_SND_AC97_CODEC=y -CONFIG_SND_AC97_BUS=y -# CONFIG_SND_DUMMY is not set -# CONFIG_SND_VIRMIDI is not set -# CONFIG_SND_MTPAV is not set -# CONFIG_SND_SERIAL_U16550 is not set -# CONFIG_SND_MPU401 is not set - -# -# ALSA ARM devices -# -CONFIG_SND_PXA2XX_PCM=y -CONFIG_SND_PXA2XX_AC97=y - -# -# USB devices -# -CONFIG_SND_USB_AUDIO=m - -# -# PCMCIA devices -# -# CONFIG_SND_VXPOCKET is not set -# CONFIG_SND_PDAUDIOCF is not set - -# -# Open Sound System -# -# CONFIG_SOUND_PRIME is not set - -# -# USB support -# -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARCH_HAS_OHCI=y -# CONFIG_USB_ARCH_HAS_EHCI is not set -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set - -# -# Miscellaneous USB options -# -CONFIG_USB_DEVICEFS=y -# CONFIG_USB_BANDWIDTH is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_SUSPEND is not set -# CONFIG_USB_OTG is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_ISP116X_HCD is not set -CONFIG_USB_OHCI_HCD=y -# CONFIG_USB_OHCI_BIG_ENDIAN is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -# CONFIG_USB_SL811_HCD is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set - -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information -# -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_DPCM is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_LIBUSUAL is not set - -# -# USB Input Devices -# -CONFIG_USB_HID=m -CONFIG_USB_HIDINPUT=y -# CONFIG_USB_HIDINPUT_POWERBOOK is not set -# CONFIG_HID_FF is not set -# CONFIG_USB_HIDDEV is not set - -# -# USB HID Boot Protocol drivers -# -# CONFIG_USB_KBD is not set -# CONFIG_USB_MOUSE is not set -# CONFIG_USB_AIPTEK is not set -# CONFIG_USB_WACOM is not set -# CONFIG_USB_ACECAD is not set -# CONFIG_USB_KBTAB is not set -# CONFIG_USB_POWERMATE is not set -CONFIG_USB_TOUCHSCREEN=m -# CONFIG_USB_TOUCHSCREEN_EGALAX is not set -# CONFIG_USB_TOUCHSCREEN_PANJIT is not set -# CONFIG_USB_TOUCHSCREEN_3M is not set -# CONFIG_USB_TOUCHSCREEN_ITM is not set -# CONFIG_USB_YEALINK is not set -# CONFIG_USB_XPAD is not set -# CONFIG_USB_ATI_REMOTE is not set -# CONFIG_USB_ATI_REMOTE2 is not set -# CONFIG_USB_KEYSPAN_REMOTE is not set -# CONFIG_USB_APPLETOUCH is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set -# CONFIG_USB_ZD1201 is not set -CONFIG_USB_MON=y - -# -# USB port drivers -# - -# -# USB Serial Converter support -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_AUERSWALD is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_PHIDGETKIT is not set -# CONFIG_USB_PHIDGETSERVO is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TEST is not set - -# -# USB DSL modem support -# - -# -# USB Gadget Support -# -CONFIG_USB_GADGET=y -# CONFIG_USB_GADGET_DEBUG_FILES is not set -CONFIG_USB_GADGET_SELECTED=y -# CONFIG_USB_GADGET_NET2280 is not set -# CONFIG_USB_GADGET_PXA2XX is not set -# CONFIG_USB_GADGET_GOKU is not set -# CONFIG_USB_GADGET_LH7A40X is not set -# CONFIG_USB_GADGET_OMAP is not set -# CONFIG_USB_GADGET_AT91 is not set -CONFIG_USB_GADGET_DUMMY_HCD=y -CONFIG_USB_DUMMY_HCD=y -CONFIG_USB_GADGET_DUALSPEED=y -# CONFIG_USB_ZERO is not set -CONFIG_USB_ETH=m -CONFIG_USB_ETH_RNDIS=y -CONFIG_USB_GADGETFS=m -CONFIG_USB_FILE_STORAGE=m -# CONFIG_USB_FILE_STORAGE_TEST is not set -CONFIG_USB_G_SERIAL=m - -# -# MMC/SD Card support -# -CONFIG_MMC=y -# CONFIG_MMC_DEBUG is not set -CONFIG_MMC_BLOCK=y -CONFIG_MMC_PXA=y - -# -# Real Time Clock -# -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" - -# -# RTC interfaces -# -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y - -# -# RTC drivers -# -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_M48T86 is not set -CONFIG_RTC_DRV_SA1100=y -# CONFIG_RTC_DRV_TEST is not set - -# -# File systems -# -CONFIG_EXT2_FS=y -CONFIG_EXT2_FS_XATTR=y -CONFIG_EXT2_FS_POSIX_ACL=y -CONFIG_EXT2_FS_SECURITY=y -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -CONFIG_EXT3_FS_XATTR=y -CONFIG_EXT3_FS_POSIX_ACL=y -CONFIG_EXT3_FS_SECURITY=y -CONFIG_JBD=y -# CONFIG_JBD_DEBUG is not set -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -CONFIG_FS_POSIX_ACL=y -# CONFIG_XFS_FS is not set -# CONFIG_OCFS2_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_ROMFS_FS is not set -CONFIG_INOTIFY=y -# CONFIG_QUOTA is not set -CONFIG_DNOTIFY=y -# CONFIG_AUTOFS_FS is not set -CONFIG_AUTOFS4_FS=y -# CONFIG_FUSE_FS is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-15" -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_HUGETLB_PAGE is not set -CONFIG_RAMFS=y -# CONFIG_CONFIGFS_FS is not set - -# -# Miscellaneous filesystems -# -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS_FS=y -CONFIG_JFFS_FS_VERBOSE=0 -CONFIG_JFFS_PROC_FS=y -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_SUMMARY is not set -CONFIG_JFFS2_COMPRESSION_OPTIONS=y -CONFIG_JFFS2_ZLIB=y -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set -# CONFIG_JFFS2_CMODE_NONE is not set -CONFIG_JFFS2_CMODE_PRIORITY=y -# CONFIG_JFFS2_CMODE_SIZE is not set -# CONFIG_CRAMFS is not set -# CONFIG_VXFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set - -# -# Network File Systems -# -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_NFS_V3_ACL=y -CONFIG_NFS_V4=y -# CONFIG_NFS_DIRECTIO is not set -CONFIG_NFSD=y -CONFIG_NFSD_V2_ACL=y -CONFIG_NFSD_V3=y -CONFIG_NFSD_V3_ACL=y -CONFIG_NFSD_V4=y -CONFIG_NFSD_TCP=y -CONFIG_ROOT_NFS=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_EXPORTFS=y -CONFIG_NFS_ACL_SUPPORT=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y -CONFIG_RPCSEC_GSS_KRB5=y -# CONFIG_RPCSEC_GSS_SPKM3 is not set -CONFIG_SMB_FS=m -# CONFIG_SMB_NLS_DEFAULT is not set -CONFIG_CIFS=m -# CONFIG_CIFS_STATS is not set -# CONFIG_CIFS_XATTR is not set -# CONFIG_CIFS_EXPERIMENTAL is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -# CONFIG_9P_FS is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -CONFIG_LDM_PARTITION=y -# CONFIG_LDM_DEBUG is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -# CONFIG_EFI_PARTITION is not set - -# -# Native Language Support -# -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-15" -CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -CONFIG_NLS_CODEPAGE_850=y -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -CONFIG_NLS_ASCII=y -CONFIG_NLS_ISO8859_1=m -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -CONFIG_NLS_ISO8859_15=m -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -CONFIG_NLS_UTF8=m - -# -# Profiling support -# -CONFIG_PROFILING=y -CONFIG_OPROFILE=y - -# -# Kernel hacking -# -# CONFIG_PRINTK_TIME is not set -CONFIG_MAGIC_SYSRQ=y -# CONFIG_DEBUG_KERNEL is not set -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_DEBUG_FS is not set -CONFIG_FRAME_POINTER=y -# CONFIG_UNWIND_INFO is not set -CONFIG_DEBUG_USER=y - -# -# Security options -# -CONFIG_KEYS=y -CONFIG_KEYS_DEBUG_PROC_KEYS=y -CONFIG_SECURITY=y -# CONFIG_SECURITY_NETWORK is not set -CONFIG_SECURITY_CAPABILITIES=y -# CONFIG_SECURITY_ROOTPLUG is not set -# CONFIG_SECURITY_SECLVL is not set - -# -# Cryptographic options -# -CONFIG_CRYPTO=y -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_NULL is not set -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_SHA1=m -CONFIG_CRYPTO_SHA256=m -CONFIG_CRYPTO_SHA512=m -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_TGR192 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_TWOFISH is not set -# CONFIG_CRYPTO_SERPENT is not set -CONFIG_CRYPTO_AES=m -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -# CONFIG_CRYPTO_TEA is not set -CONFIG_CRYPTO_ARC4=m -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_ANUBIS is not set -CONFIG_CRYPTO_DEFLATE=m -CONFIG_CRYPTO_MICHAEL_MIC=m -CONFIG_CRYPTO_CRC32C=y -# CONFIG_CRYPTO_TEST is not set - -# -# Hardware crypto devices -# - -# -# Library routines -# -CONFIG_CRC_CCITT=y -CONFIG_CRC16=y -CONFIG_CRC32=y -CONFIG_LIBCRC32C=y -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_REED_SOLOMON=y -CONFIG_REED_SOLOMON_DEC16=y diff --git a/trunk/arch/arm/kernel/Makefile b/trunk/arch/arm/kernel/Makefile index f0c0cdb1c183..7cffbaef064b 100644 --- a/trunk/arch/arm/kernel/Makefile +++ b/trunk/arch/arm/kernel/Makefile @@ -25,7 +25,7 @@ obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 -obj-$(CONFIG_IWMMXT) += iwmmxt.o iwmmxt-notifier.o +obj-$(CONFIG_IWMMXT) += iwmmxt.o AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt ifneq ($(CONFIG_ARCH_EBSA110),y) diff --git a/trunk/arch/arm/kernel/apm.c b/trunk/arch/arm/kernel/apm.c index 33c55689f999..2bed290fec76 100644 --- a/trunk/arch/arm/kernel/apm.c +++ b/trunk/arch/arm/kernel/apm.c @@ -10,6 +10,7 @@ * [This document is available from Microsoft at: * http://www.microsoft.com/hwdev/busbios/amp_12.htm] */ +#include #include #include #include diff --git a/trunk/arch/arm/kernel/asm-offsets.c b/trunk/arch/arm/kernel/asm-offsets.c index cc2d58d028e1..447ede5143a8 100644 --- a/trunk/arch/arm/kernel/asm-offsets.c +++ b/trunk/arch/arm/kernel/asm-offsets.c @@ -105,7 +105,6 @@ int main(void) BLANK(); DEFINE(PROC_INFO_SZ, sizeof(struct proc_info_list)); DEFINE(PROCINFO_INITFUNC, offsetof(struct proc_info_list, __cpu_flush)); - DEFINE(PROCINFO_MM_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mm_mmu_flags)); - DEFINE(PROCINFO_IO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_io_mmu_flags)); + DEFINE(PROCINFO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mmu_flags)); return 0; } diff --git a/trunk/arch/arm/kernel/bios32.c b/trunk/arch/arm/kernel/bios32.c index 964faac104fb..45da06fc1ba1 100644 --- a/trunk/arch/arm/kernel/bios32.c +++ b/trunk/arch/arm/kernel/bios32.c @@ -5,6 +5,7 @@ * * Bits taken from various places. */ +#include #include #include #include diff --git a/trunk/arch/arm/kernel/compat.c b/trunk/arch/arm/kernel/compat.c index 0a1385442f43..60cfa7f3226c 100644 --- a/trunk/arch/arm/kernel/compat.c +++ b/trunk/arch/arm/kernel/compat.c @@ -15,6 +15,7 @@ * the kernel for 5 years from now (2001). This will allow boot loaders * to convert to the new struct tag way. */ +#include #include #include #include diff --git a/trunk/arch/arm/kernel/debug.S b/trunk/arch/arm/kernel/debug.S index a5747e58a9dc..da280bae3d07 100644 --- a/trunk/arch/arm/kernel/debug.S +++ b/trunk/arch/arm/kernel/debug.S @@ -9,6 +9,7 @@ * * 32-bit debugging code */ +#include #include .text diff --git a/trunk/arch/arm/kernel/ecard.c b/trunk/arch/arm/kernel/ecard.c index b9a74a741d00..00aa225e8d95 100644 --- a/trunk/arch/arm/kernel/ecard.c +++ b/trunk/arch/arm/kernel/ecard.c @@ -27,6 +27,7 @@ */ #define ECARD_C +#include #include #include #include @@ -619,7 +620,7 @@ ecard_irqexp_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg ecard_t *ec = slot_to_ecard(slot); if (ec->claimed) { - struct irq_desc *d = irq_desc + ec->irq; + struct irqdesc *d = irqdesc + ec->irq; /* * this ugly code is so that we can operate a * prioritorising system: @@ -883,7 +884,7 @@ static ssize_t ecard_show_resources(struct device *dev, struct device_attribute int i; for (i = 0; i < ECARD_NUM_RESOURCES; i++) - str += sprintf(str, "%08x %08x %08lx\n", + str += sprintf(str, "%08lx %08lx %08lx\n", ec->resource[i].start, ec->resource[i].end, ec->resource[i].flags); diff --git a/trunk/arch/arm/kernel/entry-armv.S b/trunk/arch/arm/kernel/entry-armv.S index 7ea5f01dfc7b..6423a38839b8 100644 --- a/trunk/arch/arm/kernel/entry-armv.S +++ b/trunk/arch/arm/kernel/entry-armv.S @@ -14,6 +14,7 @@ * Note: there is a StrongARM bug in the STMIA rn, {regs}^ instruction that causes * it to save wrong values... Be aware! */ +#include #include #include @@ -589,7 +590,9 @@ ENTRY(__switch_to) #ifdef CONFIG_MMU mcr p15, 0, r6, c3, c0, 0 @ Set domain register #endif -#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT) +#if defined(CONFIG_IWMMXT) + bl iwmmxt_task_switch +#elif defined(CONFIG_CPU_XSCALE) add r4, r2, #TI_CPU_DOMAIN + 40 @ cpu_context_save->extra ldmib r4, {r4, r5} mar acc0, r4, r5 diff --git a/trunk/arch/arm/kernel/entry-common.S b/trunk/arch/arm/kernel/entry-common.S index 6f5e7c50d42f..75af6d6e2f28 100644 --- a/trunk/arch/arm/kernel/entry-common.S +++ b/trunk/arch/arm/kernel/entry-common.S @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include diff --git a/trunk/arch/arm/kernel/entry-header.S b/trunk/arch/arm/kernel/entry-header.S index 87ab4e157997..f1c2fd5b63e4 100644 --- a/trunk/arch/arm/kernel/entry-header.S +++ b/trunk/arch/arm/kernel/entry-header.S @@ -1,3 +1,4 @@ +#include #include #include diff --git a/trunk/arch/arm/kernel/fiq.c b/trunk/arch/arm/kernel/fiq.c index e8e90346f11c..1ec3f7faa259 100644 --- a/trunk/arch/arm/kernel/fiq.c +++ b/trunk/arch/arm/kernel/fiq.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include diff --git a/trunk/arch/arm/kernel/head-nommu.S b/trunk/arch/arm/kernel/head-nommu.S index ac9eb3d30518..2af7e44218af 100644 --- a/trunk/arch/arm/kernel/head-nommu.S +++ b/trunk/arch/arm/kernel/head-nommu.S @@ -12,6 +12,7 @@ * for 32-bit CPUs which has a process ID register(CP15). * */ +#include #include #include diff --git a/trunk/arch/arm/kernel/head.S b/trunk/arch/arm/kernel/head.S index 2242f5f7cb7d..330b9476c398 100644 --- a/trunk/arch/arm/kernel/head.S +++ b/trunk/arch/arm/kernel/head.S @@ -11,6 +11,7 @@ * * Kernel startup code for all 32-bit CPUs */ +#include #include #include @@ -220,7 +221,7 @@ __create_page_tables: teq r0, r6 bne 1b - ldr r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags + ldr r7, [r10, #PROCINFO_MMUFLAGS] @ mmuflags /* * Create identity mapping for first MB of kernel to @@ -271,7 +272,8 @@ __create_page_tables: #endif #ifdef CONFIG_DEBUG_LL - ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags + bic r7, r7, #0x0c @ turn off cacheable + @ and bufferable bits /* * Map in IO space for serial debugging. * This allows debug messages to be output diff --git a/trunk/arch/arm/kernel/irq.c b/trunk/arch/arm/kernel/irq.c index c3d4e94ef5bf..ec20f8935e8b 100644 --- a/trunk/arch/arm/kernel/irq.c +++ b/trunk/arch/arm/kernel/irq.c @@ -21,12 +21,12 @@ * IRQ's are in fact implemented a bit like signal handlers for the kernel. * Naturally it's not a 1:1 relation, but there are similarities. */ +#include #include #include #include #include #include -#include #include #include #include @@ -38,9 +38,28 @@ #include #include +#include #include +#include #include +/* + * Maximum IRQ count. Currently, this is arbitary. However, it should + * not be set too low to prevent false triggering. Conversely, if it + * is set too high, then you could miss a stuck IRQ. + * + * Maybe we ought to set a timer and re-enable the IRQ at a later time? + */ +#define MAX_IRQ_CNT 100000 + +static int noirqdebug __read_mostly; +static volatile unsigned long irq_err_count; +static DEFINE_SPINLOCK(irq_controller_lock); +static LIST_HEAD(irq_pending); + +struct irqdesc irq_desc[NR_IRQS]; +void (*init_arch_irq)(void) __initdata = NULL; + /* * No architecture-specific irq_finish function defined in arm/arch/irqs.h. */ @@ -48,8 +67,163 @@ #define irq_finish(irq) do { } while (0) #endif -void (*init_arch_irq)(void) __initdata = NULL; -unsigned long irq_err_count; +/* + * Dummy mask/unmask handler + */ +void dummy_mask_unmask_irq(unsigned int irq) +{ +} + +irqreturn_t no_action(int irq, void *dev_id, struct pt_regs *regs) +{ + return IRQ_NONE; +} + +void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +{ + irq_err_count++; + printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq); +} + +static struct irqchip bad_chip = { + .ack = dummy_mask_unmask_irq, + .mask = dummy_mask_unmask_irq, + .unmask = dummy_mask_unmask_irq, +}; + +static struct irqdesc bad_irq_desc = { + .chip = &bad_chip, + .handle = do_bad_IRQ, + .pend = LIST_HEAD_INIT(bad_irq_desc.pend), + .disable_depth = 1, +}; + +#ifdef CONFIG_SMP +void synchronize_irq(unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + + while (desc->running) + barrier(); +} +EXPORT_SYMBOL(synchronize_irq); + +#define smp_set_running(desc) do { desc->running = 1; } while (0) +#define smp_clear_running(desc) do { desc->running = 0; } while (0) +#else +#define smp_set_running(desc) do { } while (0) +#define smp_clear_running(desc) do { } while (0) +#endif + +/** + * disable_irq_nosync - disable an irq without waiting + * @irq: Interrupt to disable + * + * Disable the selected interrupt line. Enables and disables + * are nested. We do this lazily. + * + * This function may be called from IRQ context. + */ +void disable_irq_nosync(unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + unsigned long flags; + + spin_lock_irqsave(&irq_controller_lock, flags); + desc->disable_depth++; + list_del_init(&desc->pend); + spin_unlock_irqrestore(&irq_controller_lock, flags); +} +EXPORT_SYMBOL(disable_irq_nosync); + +/** + * disable_irq - disable an irq and wait for completion + * @irq: Interrupt to disable + * + * Disable the selected interrupt line. Enables and disables + * are nested. This functions waits for any pending IRQ + * handlers for this interrupt to complete before returning. + * If you use this function while holding a resource the IRQ + * handler may need you will deadlock. + * + * This function may be called - with care - from IRQ context. + */ +void disable_irq(unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + + disable_irq_nosync(irq); + if (desc->action) + synchronize_irq(irq); +} +EXPORT_SYMBOL(disable_irq); + +/** + * enable_irq - enable interrupt handling on an irq + * @irq: Interrupt to enable + * + * Re-enables the processing of interrupts on this IRQ line. + * Note that this may call the interrupt handler, so you may + * get unexpected results if you hold IRQs disabled. + * + * This function may be called from IRQ context. + */ +void enable_irq(unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + unsigned long flags; + + spin_lock_irqsave(&irq_controller_lock, flags); + if (unlikely(!desc->disable_depth)) { + printk("enable_irq(%u) unbalanced from %p\n", irq, + __builtin_return_address(0)); + } else if (!--desc->disable_depth) { + desc->probing = 0; + desc->chip->unmask(irq); + + /* + * If the interrupt is waiting to be processed, + * try to re-run it. We can't directly run it + * from here since the caller might be in an + * interrupt-protected region. + */ + if (desc->pending && list_empty(&desc->pend)) { + desc->pending = 0; + if (!desc->chip->retrigger || + desc->chip->retrigger(irq)) + list_add(&desc->pend, &irq_pending); + } + } + spin_unlock_irqrestore(&irq_controller_lock, flags); +} +EXPORT_SYMBOL(enable_irq); + +/* + * Enable wake on selected irq + */ +void enable_irq_wake(unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + unsigned long flags; + + spin_lock_irqsave(&irq_controller_lock, flags); + if (desc->chip->set_wake) + desc->chip->set_wake(irq, 1); + spin_unlock_irqrestore(&irq_controller_lock, flags); +} +EXPORT_SYMBOL(enable_irq_wake); + +void disable_irq_wake(unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + unsigned long flags; + + spin_lock_irqsave(&irq_controller_lock, flags); + if (desc->chip->set_wake) + desc->chip->set_wake(irq, 0); + spin_unlock_irqrestore(&irq_controller_lock, flags); +} +EXPORT_SYMBOL(disable_irq_wake); int show_interrupts(struct seq_file *p, void *v) { @@ -69,8 +243,8 @@ int show_interrupts(struct seq_file *p, void *v) } if (i < NR_IRQS) { - spin_lock_irqsave(&irq_desc[i].lock, flags); - action = irq_desc[i].action; + spin_lock_irqsave(&irq_controller_lock, flags); + action = irq_desc[i].action; if (!action) goto unlock; @@ -83,7 +257,7 @@ int show_interrupts(struct seq_file *p, void *v) seq_putc(p, '\n'); unlock: - spin_unlock_irqrestore(&irq_desc[i].lock, flags); + spin_unlock_irqrestore(&irq_controller_lock, flags); } else if (i == NR_IRQS) { #ifdef CONFIG_ARCH_ACORN show_fiq_list(p, v); @@ -97,11 +271,267 @@ int show_interrupts(struct seq_file *p, void *v) return 0; } -/* Handle bad interrupts */ -static struct irq_desc bad_irq_desc = { - .handle_irq = handle_bad_irq, - .lock = SPIN_LOCK_UNLOCKED -}; +/* + * IRQ lock detection. + * + * Hopefully, this should get us out of a few locked situations. + * However, it may take a while for this to happen, since we need + * a large number if IRQs to appear in the same jiffie with the + * same instruction pointer (or within 2 instructions). + */ +static int check_irq_lock(struct irqdesc *desc, int irq, struct pt_regs *regs) +{ + unsigned long instr_ptr = instruction_pointer(regs); + + if (desc->lck_jif == jiffies && + desc->lck_pc >= instr_ptr && desc->lck_pc < instr_ptr + 8) { + desc->lck_cnt += 1; + + if (desc->lck_cnt > MAX_IRQ_CNT) { + printk(KERN_ERR "IRQ LOCK: IRQ%d is locking the system, disabled\n", irq); + return 1; + } + } else { + desc->lck_cnt = 0; + desc->lck_pc = instruction_pointer(regs); + desc->lck_jif = jiffies; + } + return 0; +} + +static void +report_bad_irq(unsigned int irq, struct pt_regs *regs, struct irqdesc *desc, int ret) +{ + static int count = 100; + struct irqaction *action; + + if (noirqdebug) + return; + + if (ret != IRQ_HANDLED && ret != IRQ_NONE) { + if (!count) + return; + count--; + printk("irq%u: bogus retval mask %x\n", irq, ret); + } else { + desc->irqs_unhandled++; + if (desc->irqs_unhandled <= 99900) + return; + desc->irqs_unhandled = 0; + printk("irq%u: nobody cared\n", irq); + } + show_regs(regs); + dump_stack(); + printk(KERN_ERR "handlers:"); + action = desc->action; + do { + printk("\n" KERN_ERR "[<%p>]", action->handler); + print_symbol(" (%s)", (unsigned long)action->handler); + action = action->next; + } while (action); + printk("\n"); +} + +static int +__do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs) +{ + unsigned int status; + int ret, retval = 0; + + spin_unlock(&irq_controller_lock); + +#ifdef CONFIG_NO_IDLE_HZ + if (!(action->flags & SA_TIMER) && system_timer->dyn_tick != NULL) { + spin_lock(&system_timer->dyn_tick->lock); + if (system_timer->dyn_tick->state & DYN_TICK_ENABLED) + system_timer->dyn_tick->handler(irq, 0, regs); + spin_unlock(&system_timer->dyn_tick->lock); + } +#endif + + if (!(action->flags & SA_INTERRUPT)) + local_irq_enable(); + + status = 0; + do { + ret = action->handler(irq, action->dev_id, regs); + if (ret == IRQ_HANDLED) + status |= action->flags; + retval |= ret; + action = action->next; + } while (action); + + if (status & SA_SAMPLE_RANDOM) + add_interrupt_randomness(irq); + + spin_lock_irq(&irq_controller_lock); + + return retval; +} + +/* + * This is for software-decoded IRQs. The caller is expected to + * handle the ack, clear, mask and unmask issues. + */ +void +do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +{ + struct irqaction *action; + const unsigned int cpu = smp_processor_id(); + + desc->triggered = 1; + + kstat_cpu(cpu).irqs[irq]++; + + smp_set_running(desc); + + action = desc->action; + if (action) { + int ret = __do_irq(irq, action, regs); + if (ret != IRQ_HANDLED) + report_bad_irq(irq, regs, desc, ret); + } + + smp_clear_running(desc); +} + +/* + * Most edge-triggered IRQ implementations seem to take a broken + * approach to this. Hence the complexity. + */ +void +do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +{ + const unsigned int cpu = smp_processor_id(); + + desc->triggered = 1; + + /* + * If we're currently running this IRQ, or its disabled, + * we shouldn't process the IRQ. Instead, turn on the + * hardware masks. + */ + if (unlikely(desc->running || desc->disable_depth)) + goto running; + + /* + * Acknowledge and clear the IRQ, but don't mask it. + */ + desc->chip->ack(irq); + + /* + * Mark the IRQ currently in progress. + */ + desc->running = 1; + + kstat_cpu(cpu).irqs[irq]++; + + do { + struct irqaction *action; + + action = desc->action; + if (!action) + break; + + if (desc->pending && !desc->disable_depth) { + desc->pending = 0; + desc->chip->unmask(irq); + } + + __do_irq(irq, action, regs); + } while (desc->pending && !desc->disable_depth); + + desc->running = 0; + + /* + * If we were disabled or freed, shut down the handler. + */ + if (likely(desc->action && !check_irq_lock(desc, irq, regs))) + return; + + running: + /* + * We got another IRQ while this one was masked or + * currently running. Delay it. + */ + desc->pending = 1; + desc->chip->mask(irq); + desc->chip->ack(irq); +} + +/* + * Level-based IRQ handler. Nice and simple. + */ +void +do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +{ + struct irqaction *action; + const unsigned int cpu = smp_processor_id(); + + desc->triggered = 1; + + /* + * Acknowledge, clear _AND_ disable the interrupt. + */ + desc->chip->ack(irq); + + if (likely(!desc->disable_depth)) { + kstat_cpu(cpu).irqs[irq]++; + + smp_set_running(desc); + + /* + * Return with this interrupt masked if no action + */ + action = desc->action; + if (action) { + int ret = __do_irq(irq, desc->action, regs); + + if (ret != IRQ_HANDLED) + report_bad_irq(irq, regs, desc, ret); + + if (likely(!desc->disable_depth && + !check_irq_lock(desc, irq, regs))) + desc->chip->unmask(irq); + } + + smp_clear_running(desc); + } +} + +static void do_pending_irqs(struct pt_regs *regs) +{ + struct list_head head, *l, *n; + + do { + struct irqdesc *desc; + + /* + * First, take the pending interrupts off the list. + * The act of calling the handlers may add some IRQs + * back onto the list. + */ + head = irq_pending; + INIT_LIST_HEAD(&irq_pending); + head.next->prev = &head; + head.prev->next = &head; + + /* + * Now run each entry. We must delete it from our + * list before calling the handler. + */ + list_for_each_safe(l, n, &head) { + desc = list_entry(l, struct irqdesc, pend); + list_del_init(&desc->pend); + desc_handle_irq(desc - irq_desc, desc, regs); + } + + /* + * The list must be empty. + */ + BUG_ON(!list_empty(&head)); + } while (!list_empty(&irq_pending)); +} /* * do_IRQ handles all hardware IRQ's. Decoded IRQs should not @@ -120,15 +550,96 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) desc = &bad_irq_desc; irq_enter(); - + spin_lock(&irq_controller_lock); desc_handle_irq(irq, desc, regs); - /* AT91 specific workaround */ + /* + * Now re-run any pending interrupts. + */ + if (!list_empty(&irq_pending)) + do_pending_irqs(regs); + irq_finish(irq); + spin_unlock(&irq_controller_lock); irq_exit(); } +void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained) +{ + struct irqdesc *desc; + unsigned long flags; + + if (irq >= NR_IRQS) { + printk(KERN_ERR "Trying to install handler for IRQ%d\n", irq); + return; + } + + if (handle == NULL) + handle = do_bad_IRQ; + + desc = irq_desc + irq; + + if (is_chained && desc->chip == &bad_chip) + printk(KERN_WARNING "Trying to install chained handler for IRQ%d\n", irq); + + spin_lock_irqsave(&irq_controller_lock, flags); + if (handle == do_bad_IRQ) { + desc->chip->mask(irq); + desc->chip->ack(irq); + desc->disable_depth = 1; + } + desc->handle = handle; + if (handle != do_bad_IRQ && is_chained) { + desc->valid = 0; + desc->probe_ok = 0; + desc->disable_depth = 0; + desc->chip->unmask(irq); + } + spin_unlock_irqrestore(&irq_controller_lock, flags); +} + +void set_irq_chip(unsigned int irq, struct irqchip *chip) +{ + struct irqdesc *desc; + unsigned long flags; + + if (irq >= NR_IRQS) { + printk(KERN_ERR "Trying to install chip for IRQ%d\n", irq); + return; + } + + if (chip == NULL) + chip = &bad_chip; + + desc = irq_desc + irq; + spin_lock_irqsave(&irq_controller_lock, flags); + desc->chip = chip; + spin_unlock_irqrestore(&irq_controller_lock, flags); +} + +int set_irq_type(unsigned int irq, unsigned int type) +{ + struct irqdesc *desc; + unsigned long flags; + int ret = -ENXIO; + + if (irq >= NR_IRQS) { + printk(KERN_ERR "Trying to set irq type for IRQ%d\n", irq); + return -ENODEV; + } + + desc = irq_desc + irq; + if (desc->chip->set_type) { + spin_lock_irqsave(&irq_controller_lock, flags); + ret = desc->chip->set_type(irq, type); + spin_unlock_irqrestore(&irq_controller_lock, flags); + } + + return ret; +} +EXPORT_SYMBOL(set_irq_type); + void set_irq_flags(unsigned int irq, unsigned int iflags) { struct irqdesc *desc; @@ -140,32 +651,421 @@ void set_irq_flags(unsigned int irq, unsigned int iflags) } desc = irq_desc + irq; - spin_lock_irqsave(&desc->lock, flags); - desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; - if (iflags & IRQF_VALID) - desc->status &= ~IRQ_NOREQUEST; - if (iflags & IRQF_PROBE) - desc->status &= ~IRQ_NOPROBE; - if (!(iflags & IRQF_NOAUTOEN)) - desc->status &= ~IRQ_NOAUTOEN; - spin_unlock_irqrestore(&desc->lock, flags); + spin_lock_irqsave(&irq_controller_lock, flags); + desc->valid = (iflags & IRQF_VALID) != 0; + desc->probe_ok = (iflags & IRQF_PROBE) != 0; + desc->noautoenable = (iflags & IRQF_NOAUTOEN) != 0; + spin_unlock_irqrestore(&irq_controller_lock, flags); } -void __init init_IRQ(void) +int setup_irq(unsigned int irq, struct irqaction *new) +{ + int shared = 0; + struct irqaction *old, **p; + unsigned long flags; + struct irqdesc *desc; + + /* + * Some drivers like serial.c use request_irq() heavily, + * so we have to be careful not to interfere with a + * running system. + */ + if (new->flags & SA_SAMPLE_RANDOM) { + /* + * This function might sleep, we want to call it first, + * outside of the atomic block. + * Yes, this might clear the entropy pool if the wrong + * driver is attempted to be loaded, without actually + * installing a new handler, but is this really a problem, + * only the sysadmin is able to do this. + */ + rand_initialize_irq(irq); + } + + /* + * The following block of code has to be executed atomically + */ + desc = irq_desc + irq; + spin_lock_irqsave(&irq_controller_lock, flags); + p = &desc->action; + if ((old = *p) != NULL) { + /* + * Can't share interrupts unless both agree to and are + * the same type. + */ + if (!(old->flags & new->flags & SA_SHIRQ) || + (~old->flags & new->flags) & SA_TRIGGER_MASK) { + spin_unlock_irqrestore(&irq_controller_lock, flags); + return -EBUSY; + } + + /* add new interrupt at end of irq queue */ + do { + p = &old->next; + old = *p; + } while (old); + shared = 1; + } + + *p = new; + + if (!shared) { + desc->probing = 0; + desc->running = 0; + desc->pending = 0; + desc->disable_depth = 1; + + if (new->flags & SA_TRIGGER_MASK && + desc->chip->set_type) { + unsigned int type = new->flags & SA_TRIGGER_MASK; + desc->chip->set_type(irq, type); + } + + if (!desc->noautoenable) { + desc->disable_depth = 0; + desc->chip->unmask(irq); + } + } + + spin_unlock_irqrestore(&irq_controller_lock, flags); + return 0; +} + +/** + * request_irq - allocate an interrupt line + * @irq: Interrupt line to allocate + * @handler: Function to be called when the IRQ occurs + * @irqflags: Interrupt type flags + * @devname: An ascii name for the claiming device + * @dev_id: A cookie passed back to the handler function + * + * This call allocates interrupt resources and enables the + * interrupt line and IRQ handling. From the point this + * call is made your handler function may be invoked. Since + * your handler function must clear any interrupt the board + * raises, you must take care both to initialise your hardware + * and to set up the interrupt handler in the right order. + * + * Dev_id must be globally unique. Normally the address of the + * device data structure is used as the cookie. Since the handler + * receives this value it makes sense to use it. + * + * If your interrupt is shared you must pass a non NULL dev_id + * as this is required when freeing the interrupt. + * + * Flags: + * + * SA_SHIRQ Interrupt is shared + * + * SA_INTERRUPT Disable local interrupts while processing + * + * SA_SAMPLE_RANDOM The interrupt can be used for entropy + * + */ +int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), + unsigned long irq_flags, const char * devname, void *dev_id) +{ + unsigned long retval; + struct irqaction *action; + + if (irq >= NR_IRQS || !irq_desc[irq].valid || !handler || + (irq_flags & SA_SHIRQ && !dev_id)) + return -EINVAL; + + action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL); + if (!action) + return -ENOMEM; + + action->handler = handler; + action->flags = irq_flags; + cpus_clear(action->mask); + action->name = devname; + action->next = NULL; + action->dev_id = dev_id; + + retval = setup_irq(irq, action); + + if (retval) + kfree(action); + return retval; +} + +EXPORT_SYMBOL(request_irq); + +/** + * free_irq - free an interrupt + * @irq: Interrupt line to free + * @dev_id: Device identity to free + * + * Remove an interrupt handler. The handler is removed and if the + * interrupt line is no longer in use by any driver it is disabled. + * On a shared IRQ the caller must ensure the interrupt is disabled + * on the card it drives before calling this function. + * + * This function must not be called from interrupt context. + */ +void free_irq(unsigned int irq, void *dev_id) +{ + struct irqaction * action, **p; + unsigned long flags; + + if (irq >= NR_IRQS || !irq_desc[irq].valid) { + printk(KERN_ERR "Trying to free IRQ%d\n",irq); + dump_stack(); + return; + } + + spin_lock_irqsave(&irq_controller_lock, flags); + for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next) { + if (action->dev_id != dev_id) + continue; + + /* Found it - now free it */ + *p = action->next; + break; + } + spin_unlock_irqrestore(&irq_controller_lock, flags); + + if (!action) { + printk(KERN_ERR "Trying to free free IRQ%d\n",irq); + dump_stack(); + } else { + synchronize_irq(irq); + kfree(action); + } +} + +EXPORT_SYMBOL(free_irq); + +static DECLARE_MUTEX(probe_sem); + +/* Start the interrupt probing. Unlike other architectures, + * we don't return a mask of interrupts from probe_irq_on, + * but return the number of interrupts enabled for the probe. + * The interrupts which have been enabled for probing is + * instead recorded in the irq_desc structure. + */ +unsigned long probe_irq_on(void) +{ + unsigned int i, irqs = 0; + unsigned long delay; + + down(&probe_sem); + + /* + * first snaffle up any unassigned but + * probe-able interrupts + */ + spin_lock_irq(&irq_controller_lock); + for (i = 0; i < NR_IRQS; i++) { + if (!irq_desc[i].probe_ok || irq_desc[i].action) + continue; + + irq_desc[i].probing = 1; + irq_desc[i].triggered = 0; + if (irq_desc[i].chip->set_type) + irq_desc[i].chip->set_type(i, IRQT_PROBE); + irq_desc[i].chip->unmask(i); + irqs += 1; + } + spin_unlock_irq(&irq_controller_lock); + + /* + * wait for spurious interrupts to mask themselves out again + */ + for (delay = jiffies + HZ/10; time_before(jiffies, delay); ) + /* min 100ms delay */; + + /* + * now filter out any obviously spurious interrupts + */ + spin_lock_irq(&irq_controller_lock); + for (i = 0; i < NR_IRQS; i++) { + if (irq_desc[i].probing && irq_desc[i].triggered) { + irq_desc[i].probing = 0; + irqs -= 1; + } + } + spin_unlock_irq(&irq_controller_lock); + + return irqs; +} + +EXPORT_SYMBOL(probe_irq_on); + +unsigned int probe_irq_mask(unsigned long irqs) +{ + unsigned int mask = 0, i; + + spin_lock_irq(&irq_controller_lock); + for (i = 0; i < 16 && i < NR_IRQS; i++) + if (irq_desc[i].probing && irq_desc[i].triggered) + mask |= 1 << i; + spin_unlock_irq(&irq_controller_lock); + + up(&probe_sem); + + return mask; +} +EXPORT_SYMBOL(probe_irq_mask); + +/* + * Possible return values: + * >= 0 - interrupt number + * -1 - no interrupt/many interrupts + */ +int probe_irq_off(unsigned long irqs) +{ + unsigned int i; + int irq_found = NO_IRQ; + + /* + * look at the interrupts, and find exactly one + * that we were probing has been triggered + */ + spin_lock_irq(&irq_controller_lock); + for (i = 0; i < NR_IRQS; i++) { + if (irq_desc[i].probing && + irq_desc[i].triggered) { + if (irq_found != NO_IRQ) { + irq_found = NO_IRQ; + goto out; + } + irq_found = i; + } + } + + if (irq_found == -1) + irq_found = NO_IRQ; +out: + spin_unlock_irq(&irq_controller_lock); + + up(&probe_sem); + + return irq_found; +} + +EXPORT_SYMBOL(probe_irq_off); + +#ifdef CONFIG_SMP +static void route_irq(struct irqdesc *desc, unsigned int irq, unsigned int cpu) +{ + pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu); + + spin_lock_irq(&irq_controller_lock); + desc->cpu = cpu; + desc->chip->set_cpu(desc, irq, cpu); + spin_unlock_irq(&irq_controller_lock); +} + +#ifdef CONFIG_PROC_FS +static int +irq_affinity_read_proc(char *page, char **start, off_t off, int count, + int *eof, void *data) +{ + struct irqdesc *desc = irq_desc + ((int)data); + int len = cpumask_scnprintf(page, count, desc->affinity); + + if (count - len < 2) + return -EINVAL; + page[len++] = '\n'; + page[len] = '\0'; + + return len; +} + +static int +irq_affinity_write_proc(struct file *file, const char __user *buffer, + unsigned long count, void *data) { + unsigned int irq = (unsigned int)data; + struct irqdesc *desc = irq_desc + irq; + cpumask_t affinity, tmp; + int ret = -EIO; + + if (!desc->chip->set_cpu) + goto out; + + ret = cpumask_parse(buffer, count, affinity); + if (ret) + goto out; + + cpus_and(tmp, affinity, cpu_online_map); + if (cpus_empty(tmp)) { + ret = -EINVAL; + goto out; + } + + desc->affinity = affinity; + route_irq(desc, irq, first_cpu(tmp)); + ret = count; + + out: + return ret; +} +#endif +#endif + +void __init init_irq_proc(void) +{ +#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS) + struct proc_dir_entry *dir; int irq; - for (irq = 0; irq < NR_IRQS; irq++) - irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_DELAYED_DISABLE | - IRQ_NOPROBE; + dir = proc_mkdir("irq", NULL); + if (!dir) + return; + + for (irq = 0; irq < NR_IRQS; irq++) { + struct proc_dir_entry *entry; + struct irqdesc *desc; + char name[16]; + + desc = irq_desc + irq; + memset(name, 0, sizeof(name)); + snprintf(name, sizeof(name) - 1, "%u", irq); + + desc->procdir = proc_mkdir(name, dir); + if (!desc->procdir) + continue; + + entry = create_proc_entry("smp_affinity", 0600, desc->procdir); + if (entry) { + entry->nlink = 1; + entry->data = (void *)irq; + entry->read_proc = irq_affinity_read_proc; + entry->write_proc = irq_affinity_write_proc; + } + } +#endif +} + +void __init init_IRQ(void) +{ + struct irqdesc *desc; + int irq; #ifdef CONFIG_SMP bad_irq_desc.affinity = CPU_MASK_ALL; bad_irq_desc.cpu = smp_processor_id(); #endif + + for (irq = 0, desc = irq_desc; irq < NR_IRQS; irq++, desc++) { + *desc = bad_irq_desc; + INIT_LIST_HEAD(&desc->pend); + } + init_arch_irq(); } +static int __init noirqdebug_setup(char *str) +{ + noirqdebug = 1; + return 1; +} + +__setup("noirqdebug", noirqdebug_setup); + #ifdef CONFIG_HOTPLUG_CPU /* * The CPU has been marked offline. Migrate IRQs off this CPU. If diff --git a/trunk/arch/arm/kernel/iwmmxt-notifier.c b/trunk/arch/arm/kernel/iwmmxt-notifier.c deleted file mode 100644 index 44a86c33796e..000000000000 --- a/trunk/arch/arm/kernel/iwmmxt-notifier.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * linux/arch/arm/kernel/iwmmxt-notifier.c - * - * XScale iWMMXt (Concan) context switching and handling - * - * Initial code: - * Copyright (c) 2003, Intel Corporation - * - * Full lazy switching support, optimizations and more, by Nicolas Pitre - * Copyright (c) 2003-2004, MontaVista Software, Inc. - * - * 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. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t) -{ - struct thread_info *thread = t; - - switch (cmd) { - case THREAD_NOTIFY_FLUSH: - /* - * flush_thread() zeroes thread->fpstate, so no need - * to do anything here. - * - * FALLTHROUGH: Ensure we don't try to overwrite our newly - * initialised state information on the first fault. - */ - - case THREAD_NOTIFY_RELEASE: - iwmmxt_task_release(thread); - break; - - case THREAD_NOTIFY_SWITCH: - iwmmxt_task_switch(thread); - break; - } - - return NOTIFY_DONE; -} - -static struct notifier_block iwmmxt_notifier_block = { - .notifier_call = iwmmxt_do, -}; - -static int __init iwmmxt_init(void) -{ - thread_register_notifier(&iwmmxt_notifier_block); - - return 0; -} - -late_initcall(iwmmxt_init); diff --git a/trunk/arch/arm/kernel/iwmmxt.S b/trunk/arch/arm/kernel/iwmmxt.S index b63b528f22a6..a3bae95e536c 100644 --- a/trunk/arch/arm/kernel/iwmmxt.S +++ b/trunk/arch/arm/kernel/iwmmxt.S @@ -271,27 +271,30 @@ ENTRY(iwmmxt_task_restore) /* * Concan handling on task switch * - * r0 = next thread_info pointer + * r0 = previous task_struct pointer (must be preserved) + * r1 = previous thread_info pointer + * r2 = next thread_info pointer (must be preserved) * - * Called only from the iwmmxt notifier with task preemption disabled. + * Called only from __switch_to with task preemption disabled. + * No need to care about preserving r4 and above. */ ENTRY(iwmmxt_task_switch) - mrc p15, 0, r1, c15, c1, 0 - tst r1, #0x3 @ CP0 and CP1 accessible? + mrc p15, 0, r4, c15, c1, 0 + tst r4, #0x3 @ CP0 and CP1 accessible? bne 1f @ yes: block them for next task - ldr r2, =concan_owner - add r3, r0, #TI_IWMMXT_STATE @ get next task Concan save area - ldr r2, [r2] @ get current Concan owner - teq r2, r3 @ next task owns it? + ldr r5, =concan_owner + add r6, r2, #TI_IWMMXT_STATE @ get next task Concan save area + ldr r5, [r5] @ get current Concan owner + teq r5, r6 @ next task owns it? movne pc, lr @ no: leave Concan disabled -1: eor r1, r1, #3 @ flip Concan access - mcr p15, 0, r1, c15, c1, 0 +1: eor r4, r4, #3 @ flip Concan access + mcr p15, 0, r4, c15, c1, 0 - mrc p15, 0, r1, c2, c0, 0 - sub pc, lr, r1, lsr #32 @ cpwait and return + mrc p15, 0, r4, c2, c0, 0 + sub pc, lr, r4, lsr #32 @ cpwait and return /* * Remove Concan ownership of given task diff --git a/trunk/arch/arm/kernel/module.c b/trunk/arch/arm/kernel/module.c index 298363d97047..055bf5d28894 100644 --- a/trunk/arch/arm/kernel/module.c +++ b/trunk/arch/arm/kernel/module.c @@ -9,6 +9,7 @@ * * Module allocation method suggested by Andi Kleen. */ +#include #include #include #include diff --git a/trunk/arch/arm/kernel/process.c b/trunk/arch/arm/kernel/process.c index 3079535afccd..e1c77ee885a7 100644 --- a/trunk/arch/arm/kernel/process.c +++ b/trunk/arch/arm/kernel/process.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -352,6 +353,9 @@ void flush_thread(void) memset(&thread->fpstate, 0, sizeof(union fp_state)); thread_notify(THREAD_NOTIFY_FLUSH, thread); +#if defined(CONFIG_IWMMXT) + iwmmxt_task_release(thread); +#endif } void release_thread(struct task_struct *dead_task) @@ -359,6 +363,9 @@ void release_thread(struct task_struct *dead_task) struct thread_info *thread = task_thread_info(dead_task); thread_notify(THREAD_NOTIFY_RELEASE, thread); +#if defined(CONFIG_IWMMXT) + iwmmxt_task_release(thread); +#endif } asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); diff --git a/trunk/arch/arm/kernel/ptrace.c b/trunk/arch/arm/kernel/ptrace.c index 9254ba2f46fc..c40bdc770054 100644 --- a/trunk/arch/arm/kernel/ptrace.c +++ b/trunk/arch/arm/kernel/ptrace.c @@ -9,6 +9,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/kernel/setup.c b/trunk/arch/arm/kernel/setup.c index ed1c4d62d999..6bdf70def01f 100644 --- a/trunk/arch/arm/kernel/setup.c +++ b/trunk/arch/arm/kernel/setup.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -344,9 +345,9 @@ static void __init setup_processor(void) cpu_cache = *list->cache; #endif - printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", + printk("CPU: %s [%08x] revision %d (ARMv%s)\n", cpu_name, processor_id, (int)processor_id & 15, - proc_arch[cpu_architecture()], cr_alignment); + proc_arch[cpu_architecture()]); sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS); sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS); diff --git a/trunk/arch/arm/kernel/signal.c b/trunk/arch/arm/kernel/signal.c index 48cf7fffddf2..83a8d3c95eb3 100644 --- a/trunk/arch/arm/kernel/signal.c +++ b/trunk/arch/arm/kernel/signal.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/kernel/smp.c b/trunk/arch/arm/kernel/smp.c index 68e9634d260a..1370d726dc10 100644 --- a/trunk/arch/arm/kernel/smp.c +++ b/trunk/arch/arm/kernel/smp.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/kernel/time.c b/trunk/arch/arm/kernel/time.c index 09a67d771857..9c12d4fefbd3 100644 --- a/trunk/arch/arm/kernel/time.c +++ b/trunk/arch/arm/kernel/time.c @@ -16,6 +16,7 @@ * 1998-12-20 Updated NTP code according to technical memorandum Jan '96 * "A Kernel Model for Precision Timekeeping" by Dave Mills */ +#include #include #include #include diff --git a/trunk/arch/arm/kernel/traps.c b/trunk/arch/arm/kernel/traps.c index 35a052fc177a..35230a060108 100644 --- a/trunk/arch/arm/kernel/traps.c +++ b/trunk/arch/arm/kernel/traps.c @@ -12,6 +12,7 @@ * 'linux/arch/arm/lib/traps.S'. Mostly a debugging aid, but will probably * kill the offending process. */ +#include #include #include #include diff --git a/trunk/arch/arm/kernel/vmlinux.lds.S b/trunk/arch/arm/kernel/vmlinux.lds.S index 3ca574ee2772..2df9688a7028 100644 --- a/trunk/arch/arm/kernel/vmlinux.lds.S +++ b/trunk/arch/arm/kernel/vmlinux.lds.S @@ -4,6 +4,7 @@ */ #include +#include #include #include diff --git a/trunk/arch/arm/lib/backtrace.S b/trunk/arch/arm/lib/backtrace.S index 74230083cbf4..91f993f2e9db 100644 --- a/trunk/arch/arm/lib/backtrace.S +++ b/trunk/arch/arm/lib/backtrace.S @@ -10,6 +10,7 @@ * 27/03/03 Ian Molton Clean up CONFIG_CPU * */ +#include #include #include .text diff --git a/trunk/arch/arm/lib/bitops.h b/trunk/arch/arm/lib/bitops.h index 542251021744..b8c14e936697 100644 --- a/trunk/arch/arm/lib/bitops.h +++ b/trunk/arch/arm/lib/bitops.h @@ -1,3 +1,4 @@ +#include #if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_32v6K) .macro bitop, instr diff --git a/trunk/arch/arm/lib/ucmpdi2.S b/trunk/arch/arm/lib/ucmpdi2.S index f76de07ac182..d847a62834cb 100644 --- a/trunk/arch/arm/lib/ucmpdi2.S +++ b/trunk/arch/arm/lib/ucmpdi2.S @@ -10,6 +10,7 @@ * published by the Free Software Foundation. */ +#include #include #ifdef __ARMEB__ diff --git a/trunk/arch/arm/mach-aaec2000/core.c b/trunk/arch/arm/mach-aaec2000/core.c index baa997c857dc..65be5efd633c 100644 --- a/trunk/arch/arm/mach-aaec2000/core.c +++ b/trunk/arch/arm/mach-aaec2000/core.c @@ -9,6 +9,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -142,7 +143,7 @@ aaec2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction aaec2000_timer_irq = { .name = "AAEC-2000 Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = aaec2000_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-at91rm9200/Kconfig b/trunk/arch/arm/mach-at91rm9200/Kconfig index 2f85e8693b1b..70d402f76ce5 100644 --- a/trunk/arch/arm/mach-at91rm9200/Kconfig +++ b/trunk/arch/arm/mach-at91rm9200/Kconfig @@ -1,109 +1,65 @@ -if ARCH_AT91 - -menu "Atmel AT91 System-on-Chip" - -comment "Atmel AT91 Processors" - -config ARCH_AT91RM9200 - bool "AT91RM9200" - -config ARCH_AT91SAM9260 - bool "AT91SAM9260" - -config ARCH_AT91SAM9261 - bool "AT91SAM9261" - -# ---------------------------------------------------------- - if ARCH_AT91RM9200 +menu "AT91RM9200 Implementations" + comment "AT91RM9200 Board Type" config MACH_ONEARM bool "Ajeco 1ARM Single Board Computer" depends on ARCH_AT91RM9200 help - Select this if you are using Ajeco's 1ARM Single Board Computer. - + Select this if you are using Ajeco's 1ARM Single Board Computer config ARCH_AT91RM9200DK bool "Atmel AT91RM9200-DK Development board" depends on ARCH_AT91RM9200 help - Select this if you are using Atmel's AT91RM9200-DK Development board. - (Discontinued) - + Select this if you are using Atmel's AT91RM9200-DK Development board config MACH_AT91RM9200EK bool "Atmel AT91RM9200-EK Evaluation Kit" depends on ARCH_AT91RM9200 help - Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit. - + Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit config MACH_CSB337 - bool "Cogent CSB337" + bool "Cogent CSB337 board" depends on ARCH_AT91RM9200 help - Select this if you are using Cogent's CSB337 board. - + Select this if you are using Cogent's CSB337 board config MACH_CSB637 - bool "Cogent CSB637" + bool "Cogent CSB637 board" depends on ARCH_AT91RM9200 help - Select this if you are using Cogent's CSB637 board. - + Select this if you are using Cogent's CSB637 board config MACH_CARMEVA - bool "Conitec ARM&EVA" + bool "Conitec's ARM&EVA" depends on ARCH_AT91RM9200 help - Select this if you are using Conitec's AT91RM9200-MCU-Module. - + Select this if you are using Conitec's AT91RM9200-MCU-Module -config MACH_ATEB9200 - bool "Embest ATEB9200" +config MACH_KB9200 + bool "KwikByte's KB920x" depends on ARCH_AT91RM9200 help - Select this if you are using Embest's ATEB9200 board. - + Select this if you are using KwikByte's KB920x board -config MACH_KB9200 - bool "KwikByte KB920x" +config MACH_ATEB9200 + bool "Embest's ATEB9200" depends on ARCH_AT91RM9200 help - Select this if you are using KwikByte's KB920x board. - + Select this if you are using Embest's ATEB9200 board config MACH_KAFA bool "Sperry-Sun KAFA board" depends on ARCH_AT91RM9200 help - Select this if you are using Sperry-Sun's KAFA board. - -endif - -# ---------------------------------------------------------- - -if ARCH_AT91SAM9260 - -comment "AT91SAM9260 Board Type" - -endif - -# ---------------------------------------------------------- - -if ARCH_AT91SAM9261 - -comment "AT91SAM9261 Board Type" - -endif - + Select this if you are using Sperry-Sun's KAFA board -# ---------------------------------------------------------- -comment "AT91 Feature Selections" +comment "AT91RM9200 Feature Selections" config AT91_PROGRAMMABLE_CLOCKS bool "Programmable Clocks" diff --git a/trunk/arch/arm/mach-at91rm9200/Makefile b/trunk/arch/arm/mach-at91rm9200/Makefile index c174805c24e5..82db957322df 100644 --- a/trunk/arch/arm/mach-at91rm9200/Makefile +++ b/trunk/arch/arm/mach-at91rm9200/Makefile @@ -2,19 +2,14 @@ # Makefile for the linux kernel. # -obj-y := clock.o irq.o gpio.o devices.o +obj-y := clock.o irq.o time.o gpio.o common.o devices.o obj-m := obj-n := obj- := obj-$(CONFIG_PM) += pm.o -# CPU-specific support -obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o -obj-$(CONFIG_ARCH_AT91SAM9260) += -obj-$(CONFIG_ARCH_AT91SAM9261) += - -# AT91RM9200 Board-specific support +# Board-specific support obj-$(CONFIG_MACH_ONEARM) += board-1arm.o obj-$(CONFIG_ARCH_AT91RM9200DK) += board-dk.o obj-$(CONFIG_MACH_AT91RM9200EK) += board-ek.o @@ -25,10 +20,6 @@ obj-$(CONFIG_MACH_KB9200) += board-kb9202.o obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o obj-$(CONFIG_MACH_KAFA) += board-kafa.o -# AT91SAM9260 board-specific support - -# AT91SAM9261 board-specific support - # LEDs support led-$(CONFIG_ARCH_AT91RM9200DK) += leds.o led-$(CONFIG_MACH_AT91RM9200EK) += leds.o diff --git a/trunk/arch/arm/mach-at91rm9200/board-csb337.c b/trunk/arch/arm/mach-at91rm9200/board-csb337.c index 794d3fbb449b..e94645d77f7a 100644 --- a/trunk/arch/arm/mach-at91rm9200/board-csb337.c +++ b/trunk/arch/arm/mach-at91rm9200/board-csb337.c @@ -18,6 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-at91rm9200/board-csb637.c b/trunk/arch/arm/mach-at91rm9200/board-csb637.c index c8b6f334246a..67d5f7786cdb 100644 --- a/trunk/arch/arm/mach-at91rm9200/board-csb637.c +++ b/trunk/arch/arm/mach-at91rm9200/board-csb637.c @@ -18,6 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-at91rm9200/board-dk.c b/trunk/arch/arm/mach-at91rm9200/board-dk.c index 65873037e02a..48d7390fa584 100644 --- a/trunk/arch/arm/mach-at91rm9200/board-dk.c +++ b/trunk/arch/arm/mach-at91rm9200/board-dk.c @@ -21,6 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-at91rm9200/board-ek.c b/trunk/arch/arm/mach-at91rm9200/board-ek.c index 868192351dda..72202ed830ad 100644 --- a/trunk/arch/arm/mach-at91rm9200/board-ek.c +++ b/trunk/arch/arm/mach-at91rm9200/board-ek.c @@ -21,6 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-at91rm9200/at91rm9200.c b/trunk/arch/arm/mach-at91rm9200/common.c similarity index 97% rename from trunk/arch/arm/mach-at91rm9200/at91rm9200.c rename to trunk/arch/arm/mach-at91rm9200/common.c index 7e1d072bdd80..e836f8537a1d 100644 --- a/trunk/arch/arm/mach-at91rm9200/at91rm9200.c +++ b/trunk/arch/arm/mach-at91rm9200/common.c @@ -1,5 +1,5 @@ /* - * arch/arm/mach-at91rm9200/at91rm9200.c + * arch/arm/mach-at91rm9200/common.c * * Copyright (C) 2005 SAN People * @@ -10,6 +10,7 @@ * */ +#include #include #include diff --git a/trunk/arch/arm/mach-at91rm9200/devices.c b/trunk/arch/arm/mach-at91rm9200/devices.c index 4352acb88178..1cf85d231baa 100644 --- a/trunk/arch/arm/mach-at91rm9200/devices.c +++ b/trunk/arch/arm/mach-at91rm9200/devices.c @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/trunk/arch/arm/mach-at91rm9200/gpio.c b/trunk/arch/arm/mach-at91rm9200/gpio.c index 5783c282ae7b..83c34747087b 100644 --- a/trunk/arch/arm/mach-at91rm9200/gpio.c +++ b/trunk/arch/arm/mach-at91rm9200/gpio.c @@ -10,13 +10,12 @@ */ #include -#include -#include #include #include #include #include +#include #include #include @@ -341,7 +340,7 @@ static void gpio_irq_handler(unsigned irq, struct irqdesc *desc, struct pt_regs void __iomem *pio; u32 isr; - pio = get_irq_chip_data(irq); + pio = desc->base; /* temporarily mask (level sensitive) parent IRQ */ desc->chip->ack(irq); @@ -351,12 +350,12 @@ static void gpio_irq_handler(unsigned irq, struct irqdesc *desc, struct pt_regs if (!isr) break; - pin = (unsigned) get_irq_data(irq); + pin = (unsigned) desc->data; gpio = &irq_desc[pin]; while (isr) { if (isr & 1) { - if (unlikely(gpio->depth)) { + if (unlikely(gpio->disable_depth)) { /* * The core ARM interrupt handler lazily disables IRQs so * another IRQ must be generated before it actually gets @@ -365,7 +364,7 @@ static void gpio_irq_handler(unsigned irq, struct irqdesc *desc, struct pt_regs gpio_irq_mask(pin); } else - desc_handle_irq(pin, gpio, regs); + gpio->handle(pin, gpio, regs); } pin++; gpio++; diff --git a/trunk/arch/arm/mach-at91rm9200/irq.c b/trunk/arch/arm/mach-at91rm9200/irq.c index dcd560dbcfb7..70f4d7ac1533 100644 --- a/trunk/arch/arm/mach-at91rm9200/irq.c +++ b/trunk/arch/arm/mach-at91rm9200/irq.c @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-at91rm9200/leds.c b/trunk/arch/arm/mach-at91rm9200/leds.c index 1a333730466e..28150e8905ba 100644 --- a/trunk/arch/arm/mach-at91rm9200/leds.c +++ b/trunk/arch/arm/mach-at91rm9200/leds.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-at91rm9200/at91rm9200_time.c b/trunk/arch/arm/mach-at91rm9200/time.c similarity index 96% rename from trunk/arch/arm/mach-at91rm9200/at91rm9200_time.c rename to trunk/arch/arm/mach-at91rm9200/time.c index a92a8622c78a..fc2d7d5e4637 100644 --- a/trunk/arch/arm/mach-at91rm9200/at91rm9200_time.c +++ b/trunk/arch/arm/mach-at91rm9200/time.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/mach-at91rm9200/at91rm9200_time.c + * linux/arch/arm/mach-at91rm9200/time.c * * Copyright (C) 2003 SAN People * Copyright (C) 2003 ATMEL @@ -19,15 +19,16 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include -#include #include #include #include #include #include +#include #include static unsigned long last_crtr; @@ -85,7 +86,7 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id, struct pt_r static struct irqaction at91rm9200_timer_irq = { .name = "at91_tick", - .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER, + .flags = SA_SHIRQ | SA_INTERRUPT | SA_TIMER, .handler = at91rm9200_timer_interrupt }; diff --git a/trunk/arch/arm/mach-clps711x/fortunet.c b/trunk/arch/arm/mach-clps711x/fortunet.c index 3792ab4f0996..ff26a85aa4ba 100644 --- a/trunk/arch/arm/mach-clps711x/fortunet.c +++ b/trunk/arch/arm/mach-clps711x/fortunet.c @@ -19,6 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-clps711x/p720t.c b/trunk/arch/arm/mach-clps711x/p720t.c index c8ecd2480c27..9ba45f4d5a7e 100644 --- a/trunk/arch/arm/mach-clps711x/p720t.c +++ b/trunk/arch/arm/mach-clps711x/p720t.c @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-clps711x/time.c b/trunk/arch/arm/mach-clps711x/time.c index a071eac4a30a..1a23f0dcd4b8 100644 --- a/trunk/arch/arm/mach-clps711x/time.c +++ b/trunk/arch/arm/mach-clps711x/time.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -58,7 +57,7 @@ p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction clps711x_timer_irq = { .name = "CLPS711x Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = p720t_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-clps7500/core.c b/trunk/arch/arm/mach-clps7500/core.c index 92eaebdd5606..5b12cab0e691 100644 --- a/trunk/arch/arm/mach-clps7500/core.c +++ b/trunk/arch/arm/mach-clps7500/core.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -316,7 +315,7 @@ clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction clps7500_timer_irq = { .name = "CLPS7500 Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = clps7500_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-ebsa110/core.c b/trunk/arch/arm/mach-ebsa110/core.c index 70dd12ef3c40..6d620d8268cc 100644 --- a/trunk/arch/arm/mach-ebsa110/core.c +++ b/trunk/arch/arm/mach-ebsa110/core.c @@ -199,7 +199,7 @@ ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction ebsa110_timer_irq = { .name = "EBSA110 Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = ebsa110_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-ep93xx/Kconfig b/trunk/arch/arm/mach-ep93xx/Kconfig index f1b740083aee..e15e4c54a253 100644 --- a/trunk/arch/arm/mach-ep93xx/Kconfig +++ b/trunk/arch/arm/mach-ep93xx/Kconfig @@ -9,24 +9,12 @@ config CRUNCH comment "EP93xx Platforms" -config MACH_EDB9302 - bool "Support Cirrus Logic EDB9302" - help - Say 'Y' here if you want your kernel to support the Cirrus - Logic EDB9302 Evaluation Board. - config MACH_EDB9315 bool "Support Cirrus Logic EDB9315" help Say 'Y' here if you want your kernel to support the Cirrus Logic EDB9315 Evaluation Board. -config MACH_EDB9315A - bool "Support Cirrus Logic EDB9315A" - help - Say 'Y' here if you want your kernel to support the Cirrus - Logic EDB9315A Evaluation Board. - config MACH_GESBC9312 bool "Support Glomation GESBC-9312-sx" help diff --git a/trunk/arch/arm/mach-ep93xx/Makefile b/trunk/arch/arm/mach-ep93xx/Makefile index 1f5a6b0487ee..dfa7e2e8a18b 100644 --- a/trunk/arch/arm/mach-ep93xx/Makefile +++ b/trunk/arch/arm/mach-ep93xx/Makefile @@ -6,8 +6,6 @@ obj-m := obj-n := obj- := -obj-$(CONFIG_MACH_EDB9302) += edb9302.o obj-$(CONFIG_MACH_EDB9315) += edb9315.o -obj-$(CONFIG_MACH_EDB9315A) += edb9315a.o obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o obj-$(CONFIG_MACH_TS72XX) += ts72xx.o diff --git a/trunk/arch/arm/mach-ep93xx/core.c b/trunk/arch/arm/mach-ep93xx/core.c index a87a784b9201..1fe73c0a9d01 100644 --- a/trunk/arch/arm/mach-ep93xx/core.c +++ b/trunk/arch/arm/mach-ep93xx/core.c @@ -13,6 +13,7 @@ * your option) any later version. */ +#include #include #include #include @@ -116,7 +117,7 @@ static int ep93xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction ep93xx_timer_irq = { .name = "ep93xx timer", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = ep93xx_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-ep93xx/edb9302.c b/trunk/arch/arm/mach-ep93xx/edb9302.c deleted file mode 100644 index 62a8efd23256..000000000000 --- a/trunk/arch/arm/mach-ep93xx/edb9302.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * arch/arm/mach-ep93xx/edb9302.c - * Cirrus Logic EDB9302 support. - * - * Copyright (C) 2006 George Kashperko - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static struct physmap_flash_data edb9302_flash_data = { - .width = 2, -}; - -static struct resource edb9302_flash_resource = { - .start = 0x60000000, - .end = 0x60ffffff, - .flags = IORESOURCE_MEM, -}; - -static struct platform_device edb9302_flash = { - .name = "physmap-flash", - .id = 0, - .dev = { - .platform_data = &edb9302_flash_data, - }, - .num_resources = 1, - .resource = &edb9302_flash_resource, -}; - -static void __init edb9302_init_machine(void) -{ - ep93xx_init_devices(); - platform_device_register(&edb9302_flash); -} - -MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board") - /* Maintainer: George Kashperko */ - .phys_io = EP93XX_APB_PHYS_BASE, - .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, - .boot_params = 0x00000100, - .map_io = ep93xx_map_io, - .init_irq = ep93xx_init_irq, - .timer = &ep93xx_timer, - .init_machine = edb9302_init_machine, -MACHINE_END diff --git a/trunk/arch/arm/mach-ep93xx/edb9315a.c b/trunk/arch/arm/mach-ep93xx/edb9315a.c deleted file mode 100644 index bfefdaa8f794..000000000000 --- a/trunk/arch/arm/mach-ep93xx/edb9315a.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * arch/arm/mach-ep93xx/edb9315a.c - * Cirrus Logic EDB9315A support. - * - * Copyright (C) 2006 Lennert Buytenhek - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static struct physmap_flash_data edb9315a_flash_data = { - .width = 2, -}; - -static struct resource edb9315a_flash_resource = { - .start = 0x60000000, - .end = 0x60ffffff, - .flags = IORESOURCE_MEM, -}; - -static struct platform_device edb9315a_flash = { - .name = "physmap-flash", - .id = 0, - .dev = { - .platform_data = &edb9315a_flash_data, - }, - .num_resources = 1, - .resource = &edb9315a_flash_resource, -}; - -static void __init edb9315a_init_machine(void) -{ - ep93xx_init_devices(); - platform_device_register(&edb9315a_flash); -} - -MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board") - /* Maintainer: Lennert Buytenhek */ - .phys_io = EP93XX_APB_PHYS_BASE, - .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, - .boot_params = 0xc0000100, - .map_io = ep93xx_map_io, - .init_irq = ep93xx_init_irq, - .timer = &ep93xx_timer, - .init_machine = edb9315a_init_machine, -MACHINE_END diff --git a/trunk/arch/arm/mach-ep93xx/gesbc9312.c b/trunk/arch/arm/mach-ep93xx/gesbc9312.c index e760fd4f3655..2c28d66d260e 100644 --- a/trunk/arch/arm/mach-ep93xx/gesbc9312.c +++ b/trunk/arch/arm/mach-ep93xx/gesbc9312.c @@ -10,6 +10,7 @@ * your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-ep93xx/ts72xx.c b/trunk/arch/arm/mach-ep93xx/ts72xx.c index df315f2e9beb..0b3b875b1875 100644 --- a/trunk/arch/arm/mach-ep93xx/ts72xx.c +++ b/trunk/arch/arm/mach-ep93xx/ts72xx.c @@ -10,6 +10,7 @@ * your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-footbridge/common.c b/trunk/arch/arm/mach-footbridge/common.c index af900f4755a4..bbe6e4a0bf6a 100644 --- a/trunk/arch/arm/mach-footbridge/common.c +++ b/trunk/arch/arm/mach-footbridge/common.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-footbridge/dc21285-timer.c b/trunk/arch/arm/mach-footbridge/dc21285-timer.c index 2af610811ca4..14a62d6008fe 100644 --- a/trunk/arch/arm/mach-footbridge/dc21285-timer.c +++ b/trunk/arch/arm/mach-footbridge/dc21285-timer.c @@ -6,7 +6,6 @@ */ #include #include -#include #include @@ -44,7 +43,7 @@ timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction footbridge_timer_irq = { .name = "Timer1 timer tick", .handler = timer1_interrupt, - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, }; /* diff --git a/trunk/arch/arm/mach-footbridge/dc21285.c b/trunk/arch/arm/mach-footbridge/dc21285.c index 607ed1f5b3f8..5dace2597838 100644 --- a/trunk/arch/arm/mach-footbridge/dc21285.c +++ b/trunk/arch/arm/mach-footbridge/dc21285.c @@ -332,15 +332,15 @@ void __init dc21285_preinit(void) /* * We don't care if these fail. */ - request_irq(IRQ_PCI_SERR, dc21285_serr_irq, IRQF_DISABLED, + request_irq(IRQ_PCI_SERR, dc21285_serr_irq, SA_INTERRUPT, "PCI system error", &serr_timer); - request_irq(IRQ_PCI_PERR, dc21285_parity_irq, IRQF_DISABLED, + request_irq(IRQ_PCI_PERR, dc21285_parity_irq, SA_INTERRUPT, "PCI parity error", &perr_timer); - request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, IRQF_DISABLED, + request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, SA_INTERRUPT, "PCI abort", NULL); - request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, IRQF_DISABLED, + request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, SA_INTERRUPT, "Discard timer", NULL); - request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, IRQF_DISABLED, + request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, SA_INTERRUPT, "PCI data parity", NULL); if (cfn_mode) { diff --git a/trunk/arch/arm/mach-footbridge/dma.c b/trunk/arch/arm/mach-footbridge/dma.c index 1f9b09b8ed88..7a54578b51af 100644 --- a/trunk/arch/arm/mach-footbridge/dma.c +++ b/trunk/arch/arm/mach-footbridge/dma.c @@ -10,6 +10,7 @@ * 17-Mar-1999 RMK Allow any EBSA285-like architecture to have * ISA DMA controllers. */ +#include #include #include diff --git a/trunk/arch/arm/mach-footbridge/ebsa285-leds.c b/trunk/arch/arm/mach-footbridge/ebsa285-leds.c index a64e22226515..2c7c3630401b 100644 --- a/trunk/arch/arm/mach-footbridge/ebsa285-leds.c +++ b/trunk/arch/arm/mach-footbridge/ebsa285-leds.c @@ -16,6 +16,7 @@ * Changelog: * 02-05-1999 RMK Various cleanups */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-footbridge/isa-irq.c b/trunk/arch/arm/mach-footbridge/isa-irq.c index 87448c2d6baa..e1c43b331d64 100644 --- a/trunk/arch/arm/mach-footbridge/isa-irq.c +++ b/trunk/arch/arm/mach-footbridge/isa-irq.c @@ -98,22 +98,9 @@ isa_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) desc_handle_irq(isa_irq, desc, regs); } -static struct irqaction irq_cascade = { - .handler = no_action, - .name = "cascade", -}; - -static struct resource pic1_resource = { - .name = "pic1", - .start = 0x20, - .end = 0x3f, -}; - -static struct resource pic2_resource = { - .name = "pic2", - .start = 0xa0, - .end = 0xbf, -}; +static struct irqaction irq_cascade = { .handler = no_action, .name = "cascade", }; +static struct resource pic1_resource = { "pic1", 0x20, 0x3f }; +static struct resource pic2_resource = { "pic2", 0xa0, 0xbf }; void __init isa_init_irq(unsigned int host_irq) { diff --git a/trunk/arch/arm/mach-footbridge/isa-timer.c b/trunk/arch/arm/mach-footbridge/isa-timer.c index c4810a40c8e1..c1d74f7ab669 100644 --- a/trunk/arch/arm/mach-footbridge/isa-timer.c +++ b/trunk/arch/arm/mach-footbridge/isa-timer.c @@ -6,7 +6,6 @@ */ #include #include -#include #include #include @@ -73,7 +72,7 @@ isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction isa_timer_irq = { .name = "ISA timer tick", .handler = isa_timer_interrupt, - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, }; static void __init isa_timer_init(void) diff --git a/trunk/arch/arm/mach-footbridge/netwinder-hw.c b/trunk/arch/arm/mach-footbridge/netwinder-hw.c index a1f381c64a30..229bf0585e40 100644 --- a/trunk/arch/arm/mach-footbridge/netwinder-hw.c +++ b/trunk/arch/arm/mach-footbridge/netwinder-hw.c @@ -5,6 +5,7 @@ * * Copyright (C) 1998, 1999 Russell King, Phil Blundell */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-footbridge/netwinder-leds.c b/trunk/arch/arm/mach-footbridge/netwinder-leds.c index 8e9cac5a213b..7451fc07b85a 100644 --- a/trunk/arch/arm/mach-footbridge/netwinder-leds.c +++ b/trunk/arch/arm/mach-footbridge/netwinder-leds.c @@ -16,6 +16,7 @@ * Changelog: * 02-05-1999 RMK Various cleanups */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-h720x/cpu-h7201.c b/trunk/arch/arm/mach-h720x/cpu-h7201.c index a9a8255a3a03..af9e4a5d5ea7 100644 --- a/trunk/arch/arm/mach-h720x/cpu-h7201.c +++ b/trunk/arch/arm/mach-h720x/cpu-h7201.c @@ -41,7 +41,7 @@ h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction h7201_timer_irq = { .name = "h7201 Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = h7201_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-h720x/cpu-h7202.c b/trunk/arch/arm/mach-h720x/cpu-h7202.c index da678d163fd9..a4a7c0125d03 100644 --- a/trunk/arch/arm/mach-h720x/cpu-h7202.c +++ b/trunk/arch/arm/mach-h720x/cpu-h7202.c @@ -171,7 +171,7 @@ static struct irqchip h7202_timerx_chip = { static struct irqaction h7202_timer_irq = { .name = "h7202 Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = h7202_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-h720x/h7201-eval.c b/trunk/arch/arm/mach-h720x/h7201-eval.c index 407cd4c0aa8a..193f968edac3 100644 --- a/trunk/arch/arm/mach-h720x/h7201-eval.c +++ b/trunk/arch/arm/mach-h720x/h7201-eval.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-h720x/h7202-eval.c b/trunk/arch/arm/mach-h720x/h7202-eval.c index bf2acdce62e5..36266896979c 100644 --- a/trunk/arch/arm/mach-h720x/h7202-eval.c +++ b/trunk/arch/arm/mach-h720x/h7202-eval.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-imx/time.c b/trunk/arch/arm/mach-imx/time.c index 6ed7523c65bb..ea805bfa5e54 100644 --- a/trunk/arch/arm/mach-imx/time.c +++ b/trunk/arch/arm/mach-imx/time.c @@ -8,11 +8,11 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include #include -#include #include #include @@ -72,7 +72,7 @@ imx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction imx_timer_irq = { .name = "i.MX Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = imx_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-integrator/core.c b/trunk/arch/arm/mach-integrator/core.c index 42021fdfa0c6..576a5e979c00 100644 --- a/trunk/arch/arm/mach-integrator/core.c +++ b/trunk/arch/arm/mach-integrator/core.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -282,7 +281,7 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction integrator_timer_irq = { .name = "Integrator Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = integrator_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-integrator/pci_v3.c b/trunk/arch/arm/mach-integrator/pci_v3.c index f9043592e299..229a63a525cd 100644 --- a/trunk/arch/arm/mach-integrator/pci_v3.c +++ b/trunk/arch/arm/mach-integrator/pci_v3.c @@ -20,6 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-integrator/time.c b/trunk/arch/arm/mach-integrator/time.c index ee49cf790dab..bc07f52a6fd7 100644 --- a/trunk/arch/arm/mach-integrator/time.c +++ b/trunk/arch/arm/mach-integrator/time.c @@ -125,7 +125,7 @@ static int rtc_probe(struct amba_device *dev, void *id) xtime.tv_sec = __raw_readl(rtc_base + RTC_DR); - ret = request_irq(dev->irq[0], arm_rtc_interrupt, IRQF_DISABLED, + ret = request_irq(dev->irq[0], arm_rtc_interrupt, SA_INTERRUPT, "rtc-pl030", dev); if (ret) goto map_out; diff --git a/trunk/arch/arm/mach-iop3xx/Kconfig b/trunk/arch/arm/mach-iop3xx/Kconfig index 4422f2388607..2bfe8c729f9f 100644 --- a/trunk/arch/arm/mach-iop3xx/Kconfig +++ b/trunk/arch/arm/mach-iop3xx/Kconfig @@ -30,15 +30,12 @@ config MACH_IQ80332 select ARCH_IOP331 help Say Y here if you want to run your kernel on the Intel IQ80332 - evaluation kit for the IOP332 chipset. + evaluation kit for the IOP332 chipset config ARCH_EP80219 - bool "Enable support for EP80219" - select ARCH_IOP321 - select ARCH_IQ31244 - help - Say Y here if you want to run your kernel on the Intel EP80219 - evaluation kit for the Intel 80219 chipset (a IOP321 variant). + bool "Enable support for EP80219" + select ARCH_IOP321 + select ARCH_IQ31244 # Which IOP variant are we running? config ARCH_IOP321 @@ -59,8 +56,8 @@ config IOP331_STEPD bool "Chip stepping D of the IOP80331 processor or IOP80333" depends on (ARCH_IOP331) help - Say Y here if you have StepD of the IOP80331 or IOP8033 - based platforms. + Say Y here if you have StepD of the IOP80331 or IOP8033 + based platforms. endmenu endif diff --git a/trunk/arch/arm/mach-iop3xx/common.c b/trunk/arch/arm/mach-iop3xx/common.c index d7f50e57e753..fdeeef489a73 100644 --- a/trunk/arch/arm/mach-iop3xx/common.c +++ b/trunk/arch/arm/mach-iop3xx/common.c @@ -12,6 +12,7 @@ * warranty of any kind, whether express or implied. */ +#include #include #include diff --git a/trunk/arch/arm/mach-iop3xx/iop321-setup.c b/trunk/arch/arm/mach-iop3xx/iop321-setup.c index b6d096903c4a..0ebbcb20c6ae 100644 --- a/trunk/arch/arm/mach-iop3xx/iop321-setup.c +++ b/trunk/arch/arm/mach-iop3xx/iop321-setup.c @@ -12,6 +12,7 @@ */ #include #include +#include #include #include #include diff --git a/trunk/arch/arm/mach-iop3xx/iop321-time.c b/trunk/arch/arm/mach-iop3xx/iop321-time.c index 04b1a6f7ebae..d67ac0e5d438 100644 --- a/trunk/arch/arm/mach-iop3xx/iop321-time.c +++ b/trunk/arch/arm/mach-iop3xx/iop321-time.c @@ -85,7 +85,7 @@ iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction iop321_timer_irq = { .name = "IOP321 Timer Tick", .handler = iop321_timer_interrupt, - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, }; static void __init iop321_timer_init(void) diff --git a/trunk/arch/arm/mach-iop3xx/iop331-setup.c b/trunk/arch/arm/mach-iop3xx/iop331-setup.c index 3cc98d892ad4..7b7b6eea3846 100644 --- a/trunk/arch/arm/mach-iop3xx/iop331-setup.c +++ b/trunk/arch/arm/mach-iop3xx/iop331-setup.c @@ -11,6 +11,7 @@ */ #include #include +#include #include #include #include diff --git a/trunk/arch/arm/mach-iop3xx/iop331-time.c b/trunk/arch/arm/mach-iop3xx/iop331-time.c index 0c09e74c5740..3c1f0ebbd636 100644 --- a/trunk/arch/arm/mach-iop3xx/iop331-time.c +++ b/trunk/arch/arm/mach-iop3xx/iop331-time.c @@ -82,7 +82,7 @@ iop331_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction iop331_timer_irq = { .name = "IOP331 Timer Tick", .handler = iop331_timer_interrupt, - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, }; static void __init iop331_timer_init(void) diff --git a/trunk/arch/arm/mach-ixp2000/core.c b/trunk/arch/arm/mach-ixp2000/core.c index 7f91f689a041..ebe4391dd7f9 100644 --- a/trunk/arch/arm/mach-ixp2000/core.c +++ b/trunk/arch/arm/mach-ixp2000/core.c @@ -14,12 +14,12 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include #include #include -#include #include #include #include @@ -224,7 +224,7 @@ static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction ixp2000_timer_irq = { .name = "IXP2000 Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = ixp2000_timer_interrupt, }; @@ -409,7 +409,7 @@ static void ixp2000_err_irq_handler(unsigned int irq, struct irqdesc *desc, str for(i = 31; i >= 0; i--) { if(status & (1 << i)) { desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i; - desc_handle_irq(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs); + desc->handle(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs); } } } diff --git a/trunk/arch/arm/mach-ixp2000/enp2611.c b/trunk/arch/arm/mach-ixp2000/enp2611.c index ac29298c5d3f..52fac89e95b5 100644 --- a/trunk/arch/arm/mach-ixp2000/enp2611.c +++ b/trunk/arch/arm/mach-ixp2000/enp2611.c @@ -18,6 +18,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2400.c b/trunk/arch/arm/mach-ixp2000/ixdp2400.c index a6f14801872d..09101271298e 100644 --- a/trunk/arch/arm/mach-ixp2000/ixdp2400.c +++ b/trunk/arch/arm/mach-ixp2000/ixdp2400.c @@ -14,6 +14,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2800.c b/trunk/arch/arm/mach-ixp2000/ixdp2800.c index 91d36d91dac0..076e3f8acc96 100644 --- a/trunk/arch/arm/mach-ixp2000/ixdp2800.c +++ b/trunk/arch/arm/mach-ixp2000/ixdp2800.c @@ -14,6 +14,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2x00.c b/trunk/arch/arm/mach-ixp2000/ixdp2x00.c index 40eef8b36740..d628da56b4bc 100644 --- a/trunk/arch/arm/mach-ixp2000/ixdp2x00.c +++ b/trunk/arch/arm/mach-ixp2000/ixdp2x00.c @@ -14,6 +14,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include @@ -167,7 +168,7 @@ void ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long } /* Hook into PCI interrupt */ - set_irq_chained_handler(IRQ_IXP2000_PCIB, ixdp2x00_irq_handler); + set_irq_chained_handler(IRQ_IXP2000_PCIB, &ixdp2x00_irq_handler); } /************************************************************************* diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2x01.c b/trunk/arch/arm/mach-ixp2000/ixdp2x01.c index 7f42366f60d1..66915282a463 100644 --- a/trunk/arch/arm/mach-ixp2000/ixdp2x01.c +++ b/trunk/arch/arm/mach-ixp2000/ixdp2x01.c @@ -15,6 +15,7 @@ * option) any later version. */ +#include #include #include #include @@ -127,7 +128,7 @@ void __init ixdp2x01_init_irq(void) } /* Hook into PCI interrupts */ - set_irq_chained_handler(IRQ_IXP2000_PCIB, ixdp2x01_irq_handler); + set_irq_chained_handler(IRQ_IXP2000_PCIB, &ixdp2x01_irq_handler); } diff --git a/trunk/arch/arm/mach-ixp23xx/core.c b/trunk/arch/arm/mach-ixp23xx/core.c index 566a07821c77..051e3d70026e 100644 --- a/trunk/arch/arm/mach-ixp23xx/core.c +++ b/trunk/arch/arm/mach-ixp23xx/core.c @@ -14,6 +14,7 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include @@ -271,7 +272,7 @@ static void pci_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs * } int_desc = irq_desc + irqno; - desc_handle_irq(irqno, int_desc, regs); + int_desc->handle(irqno, int_desc, regs); desc->chip->unmask(irq); } @@ -363,7 +364,7 @@ ixp23xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction ixp23xx_timer_irq = { .name = "IXP23xx Timer Tick", .handler = ixp23xx_timer_interrupt, - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, }; void __init ixp23xx_init_timer(void) diff --git a/trunk/arch/arm/mach-ixp23xx/espresso.c b/trunk/arch/arm/mach-ixp23xx/espresso.c index 7a85ced56718..357351fbb1e2 100644 --- a/trunk/arch/arm/mach-ixp23xx/espresso.c +++ b/trunk/arch/arm/mach-ixp23xx/espresso.c @@ -10,6 +10,7 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-ixp23xx/ixdp2351.c b/trunk/arch/arm/mach-ixp23xx/ixdp2351.c index 37a32e6bcca2..e0886871cc77 100644 --- a/trunk/arch/arm/mach-ixp23xx/ixdp2351.c +++ b/trunk/arch/arm/mach-ixp23xx/ixdp2351.c @@ -14,12 +14,12 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include #include #include -#include #include #include #include @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,7 @@ static void ixdp2351_inta_handler(unsigned int irq, struct irqdesc *desc, struct int cpld_irq = IXP23XX_MACH_IRQ(IXDP2351_INTA_IRQ_BASE + i); cpld_desc = irq_desc + cpld_irq; - desc_handle_irq(cpld_irq, cpld_desc, regs); + cpld_desc->handle(cpld_irq, cpld_desc, regs); } } @@ -111,7 +112,7 @@ static void ixdp2351_intb_handler(unsigned int irq, struct irqdesc *desc, struct int cpld_irq = IXP23XX_MACH_IRQ(IXDP2351_INTB_IRQ_BASE + i); cpld_desc = irq_desc + cpld_irq; - desc_handle_irq(cpld_irq, cpld_desc, regs); + cpld_desc->handle(cpld_irq, cpld_desc, regs); } } @@ -158,8 +159,8 @@ void ixdp2351_init_irq(void) } } - set_irq_chained_handler(IRQ_IXP23XX_INTA, ixdp2351_inta_handler); - set_irq_chained_handler(IRQ_IXP23XX_INTB, ixdp2351_intb_handler); + set_irq_chained_handler(IRQ_IXP23XX_INTA, &ixdp2351_inta_handler); + set_irq_chained_handler(IRQ_IXP23XX_INTB, &ixdp2351_intb_handler); } /* diff --git a/trunk/arch/arm/mach-ixp23xx/pci.c b/trunk/arch/arm/mach-ixp23xx/pci.c index 3b34fa35e36b..ac72f94c5b4d 100644 --- a/trunk/arch/arm/mach-ixp23xx/pci.c +++ b/trunk/arch/arm/mach-ixp23xx/pci.c @@ -16,6 +16,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-ixp23xx/roadrunner.c b/trunk/arch/arm/mach-ixp23xx/roadrunner.c index d06e21b70de5..92ad18f41251 100644 --- a/trunk/arch/arm/mach-ixp23xx/roadrunner.c +++ b/trunk/arch/arm/mach-ixp23xx/roadrunner.c @@ -14,6 +14,7 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-ixp4xx/common.c b/trunk/arch/arm/mach-ixp4xx/common.c index 7c25dbd5a181..bf25a76e9bdf 100644 --- a/trunk/arch/arm/mach-ixp4xx/common.c +++ b/trunk/arch/arm/mach-ixp4xx/common.c @@ -13,6 +13,7 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include @@ -287,7 +288,7 @@ static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs static struct irqaction ixp4xx_timer_irq = { .name = "IXP4xx Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = ixp4xx_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-ixp4xx/coyote-pci.c b/trunk/arch/arm/mach-ixp4xx/coyote-pci.c index 2cebb2878895..e6b7fcd923fa 100644 --- a/trunk/arch/arm/mach-ixp4xx/coyote-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/coyote-pci.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include diff --git a/trunk/arch/arm/mach-ixp4xx/ixdp425-pci.c b/trunk/arch/arm/mach-ixp4xx/ixdp425-pci.c index d5156c043f0b..da415d5d7f37 100644 --- a/trunk/arch/arm/mach-ixp4xx/ixdp425-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/ixdp425-pci.c @@ -15,9 +15,9 @@ */ #include +#include #include #include -#include #include #include diff --git a/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c b/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c index ed5270800217..526fb6175bc3 100644 --- a/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/ixdpg425-pci.c @@ -16,10 +16,10 @@ #include #include #include -#include #include #include +#include #include diff --git a/trunk/arch/arm/mach-ixp4xx/nas100d-pci.c b/trunk/arch/arm/mach-ixp4xx/nas100d-pci.c index b8ebaf4a9c8e..26b7c001ff64 100644 --- a/trunk/arch/arm/mach-ixp4xx/nas100d-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/nas100d-pci.c @@ -15,9 +15,9 @@ * */ +#include #include #include -#include #include #include diff --git a/trunk/arch/arm/mach-ixp4xx/nas100d-power.c b/trunk/arch/arm/mach-ixp4xx/nas100d-power.c index 81ffcae1f56e..a3745ed37f9f 100644 --- a/trunk/arch/arm/mach-ixp4xx/nas100d-power.c +++ b/trunk/arch/arm/mach-ixp4xx/nas100d-power.c @@ -17,10 +17,10 @@ * */ -#include -#include #include #include +#include +#include #include @@ -42,7 +42,7 @@ static int __init nas100d_power_init(void) set_irq_type(NAS100D_RB_IRQ, IRQT_LOW); if (request_irq(NAS100D_RB_IRQ, &nas100d_reset_handler, - IRQF_DISABLED, "NAS100D reset button", NULL) < 0) { + SA_INTERRUPT, "NAS100D reset button", NULL) < 0) { printk(KERN_DEBUG "Reset Button IRQ %d not available\n", NAS100D_RB_IRQ); diff --git a/trunk/arch/arm/mach-ixp4xx/nslu2-pci.c b/trunk/arch/arm/mach-ixp4xx/nslu2-pci.c index 0de639d6e60a..ece860444d5b 100644 --- a/trunk/arch/arm/mach-ixp4xx/nslu2-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/nslu2-pci.c @@ -15,6 +15,7 @@ * */ +#include #include #include diff --git a/trunk/arch/arm/mach-ixp4xx/nslu2-power.c b/trunk/arch/arm/mach-ixp4xx/nslu2-power.c index e2a2230b69f0..6d38e97142cc 100644 --- a/trunk/arch/arm/mach-ixp4xx/nslu2-power.c +++ b/trunk/arch/arm/mach-ixp4xx/nslu2-power.c @@ -54,7 +54,7 @@ static int __init nslu2_power_init(void) set_irq_type(NSLU2_PB_IRQ, IRQT_HIGH); if (request_irq(NSLU2_RB_IRQ, &nslu2_reset_handler, - IRQF_DISABLED, "NSLU2 reset button", NULL) < 0) { + SA_INTERRUPT, "NSLU2 reset button", NULL) < 0) { printk(KERN_DEBUG "Reset Button IRQ %d not available\n", NSLU2_RB_IRQ); @@ -63,7 +63,7 @@ static int __init nslu2_power_init(void) } if (request_irq(NSLU2_PB_IRQ, &nslu2_power_handler, - IRQF_DISABLED, "NSLU2 power button", NULL) < 0) { + SA_INTERRUPT, "NSLU2 power button", NULL) < 0) { printk(KERN_DEBUG "Power Button IRQ %d not available\n", NSLU2_PB_IRQ); diff --git a/trunk/arch/arm/mach-l7200/core.c b/trunk/arch/arm/mach-l7200/core.c index b7af5640ea7b..ac626436e96f 100644 --- a/trunk/arch/arm/mach-l7200/core.c +++ b/trunk/arch/arm/mach-l7200/core.c @@ -7,7 +7,6 @@ */ #include #include -#include #include #include diff --git a/trunk/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/trunk/arch/arm/mach-lh7a40x/arch-lpd7a40x.c index 35c3606a2079..c0e6854289f1 100644 --- a/trunk/arch/arm/mach-lh7a40x/arch-lpd7a40x.c +++ b/trunk/arch/arm/mach-lh7a40x/arch-lpd7a40x.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/trunk/arch/arm/mach-lh7a40x/time.c b/trunk/arch/arm/mach-lh7a40x/time.c index ad5652e01507..ef9af375fcc4 100644 --- a/trunk/arch/arm/mach-lh7a40x/time.c +++ b/trunk/arch/arm/mach-lh7a40x/time.c @@ -8,10 +8,10 @@ * version 2 as published by the Free Software Foundation. * */ +#include #include #include #include -#include #include #include @@ -53,7 +53,7 @@ lh7a40x_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction lh7a40x_timer_irq = { .name = "LHA740x Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = lh7a40x_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-netx/time.c b/trunk/arch/arm/mach-netx/time.c index 6d72c81b7d9f..edfbdf40c600 100644 --- a/trunk/arch/arm/mach-netx/time.c +++ b/trunk/arch/arm/mach-netx/time.c @@ -54,7 +54,7 @@ netx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction netx_timer_irq = { .name = "NetX Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = netx_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-omap1/Kconfig b/trunk/arch/arm/mach-omap1/Kconfig index d135568dc9e7..f8d716ccc1df 100644 --- a/trunk/arch/arm/mach-omap1/Kconfig +++ b/trunk/arch/arm/mach-omap1/Kconfig @@ -62,13 +62,6 @@ config MACH_OMAP_PERSEUS2 Support for TI OMAP 730 Perseus2 board. Say Y here if you have such a board. -config MACH_OMAP_FSAMPLE - bool "TI F-Sample" - depends on ARCH_OMAP1 && ARCH_OMAP730 - help - Support for TI OMAP 850 F-Sample board. Say Y here if you have such - a board. - config MACH_VOICEBLUE bool "Voiceblue" depends on ARCH_OMAP1 && ARCH_OMAP15XX diff --git a/trunk/arch/arm/mach-omap1/Makefile b/trunk/arch/arm/mach-omap1/Makefile index 7165f74f78da..9ea719550ad3 100644 --- a/trunk/arch/arm/mach-omap1/Makefile +++ b/trunk/arch/arm/mach-omap1/Makefile @@ -17,7 +17,6 @@ obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o obj-$(CONFIG_MACH_OMAP_INNOVATOR) += board-innovator.o obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o obj-$(CONFIG_MACH_OMAP_PERSEUS2) += board-perseus2.o -obj-$(CONFIG_MACH_OMAP_FSAMPLE) += board-fsample.o obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o diff --git a/trunk/arch/arm/mach-omap1/board-ams-delta.c b/trunk/arch/arm/mach-omap1/board-ams-delta.c index 8437d065ada5..73df32aac4c4 100644 --- a/trunk/arch/arm/mach-omap1/board-ams-delta.c +++ b/trunk/arch/arm/mach-omap1/board-ams-delta.c @@ -80,15 +80,8 @@ static struct omap_uart_config ams_delta_uart_config __initdata = { .enabled_uarts = 1, }; -static struct omap_usb_config ams_delta_usb_config __initdata = { - .register_host = 1, - .hmc_mode = 16, - .pins[0] = 2, -}; - static struct omap_board_config_kernel ams_delta_config[] = { { OMAP_TAG_UART, &ams_delta_uart_config }, - { OMAP_TAG_USB, &ams_delta_usb_config }, }; static struct platform_device ams_delta_led_device = { diff --git a/trunk/arch/arm/mach-omap1/board-fsample.c b/trunk/arch/arm/mach-omap1/board-fsample.c deleted file mode 100644 index c753a3c5aadd..000000000000 --- a/trunk/arch/arm/mach-omap1/board-fsample.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - * linux/arch/arm/mach-omap1/board-fsample.c - * - * Modified from board-perseus2.c - * - * Original OMAP730 support by Jean Pihet - * Updated for 2.6 by Kevin Hilman - * - * 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. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -static int fsample_keymap[] = { - KEY(0,0,KEY_UP), - KEY(0,1,KEY_RIGHT), - KEY(0,2,KEY_LEFT), - KEY(0,3,KEY_DOWN), - KEY(0,4,KEY_CENTER), - KEY(0,5,KEY_0_5), - KEY(1,0,KEY_SOFT2), - KEY(1,1,KEY_SEND), - KEY(1,2,KEY_END), - KEY(1,3,KEY_VOLUMEDOWN), - KEY(1,4,KEY_VOLUMEUP), - KEY(1,5,KEY_RECORD), - KEY(2,0,KEY_SOFT1), - KEY(2,1,KEY_3), - KEY(2,2,KEY_6), - KEY(2,3,KEY_9), - KEY(2,4,KEY_SHARP), - KEY(2,5,KEY_2_5), - KEY(3,0,KEY_BACK), - KEY(3,1,KEY_2), - KEY(3,2,KEY_5), - KEY(3,3,KEY_8), - KEY(3,4,KEY_0), - KEY(3,5,KEY_HEADSETHOOK), - KEY(4,0,KEY_HOME), - KEY(4,1,KEY_1), - KEY(4,2,KEY_4), - KEY(4,3,KEY_7), - KEY(4,4,KEY_STAR), - KEY(4,5,KEY_POWER), - 0 -}; - -static struct resource smc91x_resources[] = { - [0] = { - .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ - .end = H2P2_DBG_FPGA_ETHR_START + 0xf, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_730_MPU_EXT_NIRQ, - .end = 0, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct mtd_partition nor_partitions[] = { - /* bootloader (U-Boot, etc) in first sector */ - { - .name = "bootloader", - .offset = 0, - .size = SZ_128K, - .mask_flags = MTD_WRITEABLE, /* force read-only */ - }, - /* bootloader params in the next sector */ - { - .name = "params", - .offset = MTDPART_OFS_APPEND, - .size = SZ_128K, - .mask_flags = 0, - }, - /* kernel */ - { - .name = "kernel", - .offset = MTDPART_OFS_APPEND, - .size = SZ_2M, - .mask_flags = 0 - }, - /* rest of flash is a file system */ - { - .name = "rootfs", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL, - .mask_flags = 0 - }, -}; - -static struct flash_platform_data nor_data = { - .map_name = "cfi_probe", - .width = 2, - .parts = nor_partitions, - .nr_parts = ARRAY_SIZE(nor_partitions), -}; - -static struct resource nor_resource = { - .start = OMAP_CS0_PHYS, - .end = OMAP_CS0_PHYS + SZ_32M - 1, - .flags = IORESOURCE_MEM, -}; - -static struct platform_device nor_device = { - .name = "omapflash", - .id = 0, - .dev = { - .platform_data = &nor_data, - }, - .num_resources = 1, - .resource = &nor_resource, -}; - -static struct nand_platform_data nand_data = { - .options = NAND_SAMSUNG_LP_OPTIONS, -}; - -static struct resource nand_resource = { - .start = OMAP_CS3_PHYS, - .end = OMAP_CS3_PHYS + SZ_4K - 1, - .flags = IORESOURCE_MEM, -}; - -static struct platform_device nand_device = { - .name = "omapnand", - .id = 0, - .dev = { - .platform_data = &nand_data, - }, - .num_resources = 1, - .resource = &nand_resource, -}; - -static struct platform_device smc91x_device = { - .name = "smc91x", - .id = 0, - .num_resources = ARRAY_SIZE(smc91x_resources), - .resource = smc91x_resources, -}; - -static struct resource kp_resources[] = { - [0] = { - .start = INT_730_MPUIO_KEYPAD, - .end = INT_730_MPUIO_KEYPAD, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct omap_kp_platform_data kp_data = { - .rows = 8, - .cols = 8, - .keymap = fsample_keymap, -}; - -static struct platform_device kp_device = { - .name = "omap-keypad", - .id = -1, - .dev = { - .platform_data = &kp_data, - }, - .num_resources = ARRAY_SIZE(kp_resources), - .resource = kp_resources, -}; - -static struct platform_device lcd_device = { - .name = "lcd_p2", - .id = -1, -}; - -static struct platform_device *devices[] __initdata = { - &nor_device, - &nand_device, - &smc91x_device, - &kp_device, - &lcd_device, -}; - -#define P2_NAND_RB_GPIO_PIN 62 - -static int nand_dev_ready(struct nand_platform_data *data) -{ - return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); -} - -static struct omap_uart_config fsample_uart_config __initdata = { - .enabled_uarts = ((1 << 0) | (1 << 1)), -}; - -static struct omap_lcd_config fsample_lcd_config __initdata = { - .ctrl_name = "internal", -}; - -static struct omap_board_config_kernel fsample_config[] = { - { OMAP_TAG_UART, &fsample_uart_config }, - { OMAP_TAG_LCD, &fsample_lcd_config }, -}; - -static void __init omap_fsample_init(void) -{ - if (!(omap_request_gpio(P2_NAND_RB_GPIO_PIN))) - nand_data.dev_ready = nand_dev_ready; - - omap_cfg_reg(L3_1610_FLASH_CS2B_OE); - omap_cfg_reg(M8_1610_FLASH_CS2B_WE); - - platform_add_devices(devices, ARRAY_SIZE(devices)); - - omap_board_config = fsample_config; - omap_board_config_size = ARRAY_SIZE(fsample_config); - omap_serial_init(); -} - -static void __init fsample_init_smc91x(void) -{ - fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); - mdelay(50); - fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, - H2P2_DBG_FPGA_LAN_RESET); - mdelay(50); -} - -void omap_fsample_init_irq(void) -{ - omap1_init_common_hw(); - omap_init_irq(); - omap_gpio_init(); - fsample_init_smc91x(); -} - -/* Only FPGA needs to be mapped here. All others are done with ioremap */ -static struct map_desc omap_fsample_io_desc[] __initdata = { - { - .virtual = H2P2_DBG_FPGA_BASE, - .pfn = __phys_to_pfn(H2P2_DBG_FPGA_START), - .length = H2P2_DBG_FPGA_SIZE, - .type = MT_DEVICE - }, - { - .virtual = FSAMPLE_CPLD_BASE, - .pfn = __phys_to_pfn(FSAMPLE_CPLD_START), - .length = FSAMPLE_CPLD_SIZE, - .type = MT_DEVICE - } -}; - -static void __init omap_fsample_map_io(void) -{ - omap1_map_common_io(); - iotable_init(omap_fsample_io_desc, - ARRAY_SIZE(omap_fsample_io_desc)); - - /* Early, board-dependent init */ - - /* - * Hold GSM Reset until needed - */ - omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL); - - /* - * UARTs -> done automagically by 8250 driver - */ - - /* - * CSx timings, GPIO Mux ... setup - */ - - /* Flash: CS0 timings setup */ - omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0); - omap_writel(0x00000088, OMAP730_FLASH_ACFG_0); - - /* - * Ethernet support through the debug board - * CS1 timings setup - */ - omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1); - omap_writel(0x00000000, OMAP730_FLASH_ACFG_1); - - /* - * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, - * It is used as the Ethernet controller interrupt - */ - omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9); -} - -MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample") -/* Maintainer: Brian Swetland */ - .phys_io = 0xfff00000, - .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, - .boot_params = 0x10000100, - .map_io = omap_fsample_map_io, - .init_irq = omap_fsample_init_irq, - .init_machine = omap_fsample_init, - .timer = &omap_timer, -MACHINE_END diff --git a/trunk/arch/arm/mach-omap1/board-h3.c b/trunk/arch/arm/mach-omap1/board-h3.c index 7b206116cd03..4b8d0ec73cb7 100644 --- a/trunk/arch/arm/mach-omap1/board-h3.c +++ b/trunk/arch/arm/mach-omap1/board-h3.c @@ -14,6 +14,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap1/board-innovator.c b/trunk/arch/arm/mach-omap1/board-innovator.c index 4cbc62db5b5d..e90c137a4cf3 100644 --- a/trunk/arch/arm/mach-omap1/board-innovator.c +++ b/trunk/arch/arm/mach-omap1/board-innovator.c @@ -37,8 +37,6 @@ #include #include #include -#include -#include static int innovator_keymap[] = { KEY(0, 0, KEY_F1), @@ -114,42 +112,6 @@ static struct platform_device innovator_flash_device = { .resource = &innovator_flash_resource, }; -#define DEFAULT_BITPERSAMPLE 16 - -static struct omap_mcbsp_reg_cfg mcbsp_regs = { - .spcr2 = FREE | FRST | GRST | XRST | XINTM(3), - .spcr1 = RINTM(3) | RRST, - .rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) | - RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(0), - .rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16), - .xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) | - XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(0) | XFIG, - .xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16), - .srgr1 = FWID(DEFAULT_BITPERSAMPLE - 1), - .srgr2 = GSYNC | CLKSP | FSGM | FPER(DEFAULT_BITPERSAMPLE * 2 - 1), - /*.pcr0 = FSXM | FSRM | CLKXM | CLKRM | CLKXP | CLKRP,*/ /* mcbsp: master */ - .pcr0 = CLKXP | CLKRP, /* mcbsp: slave */ -}; - -static struct omap_alsa_codec_config alsa_config = { - .name = "OMAP Innovator AIC23", - .mcbsp_regs_alsa = &mcbsp_regs, - .codec_configure_dev = NULL, // aic23_configure, - .codec_set_samplerate = NULL, // aic23_set_samplerate, - .codec_clock_setup = NULL, // aic23_clock_setup, - .codec_clock_on = NULL, // aic23_clock_on, - .codec_clock_off = NULL, // aic23_clock_off, - .get_default_samplerate = NULL, // aic23_get_default_samplerate, -}; - -static struct platform_device innovator_mcbsp1_device = { - .name = "omap_alsa_mcbsp", - .id = 1, - .dev = { - .platform_data = &alsa_config, - }, -}; - static struct resource innovator_kp_resources[] = { [0] = { .start = INT_KEYBOARD, @@ -177,10 +139,6 @@ static struct platform_device innovator_kp_device = { #ifdef CONFIG_ARCH_OMAP15XX -#include -#include - - /* Only FPGA needs to be mapped here. All others are done with ioremap */ static struct map_desc innovator1510_io_desc[] __initdata = { { @@ -216,44 +174,13 @@ static struct platform_device innovator1510_lcd_device = { .id = -1, }; -static struct platform_device innovator1510_spi_device = { - .name = "spi_inn1510", - .id = -1, -}; - static struct platform_device *innovator1510_devices[] __initdata = { &innovator_flash_device, &innovator1510_smc91x_device, - &innovator_mcbsp1_device, &innovator_kp_device, &innovator1510_lcd_device, - &innovator1510_spi_device, }; -static int innovator_get_pendown_state(void) -{ - return !(fpga_read(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5)); -} - -static const struct ads7846_platform_data innovator1510_ts_info = { - .model = 7846, - .vref_delay_usecs = 100, /* internal, no capacitor */ - .x_plate_ohms = 419, - .y_plate_ohms = 486, - .get_pendown_state = innovator_get_pendown_state, -}; - -static struct spi_board_info __initdata innovator1510_boardinfo[] = { { - /* FPGA (bus "10") CS0 has an ads7846e */ - .modalias = "ads7846", - .platform_data = &innovator1510_ts_info, - .irq = OMAP1510_INT_FPGA_TS, - .max_speed_hz = 120000 /* max sample rate at 3V */ - * 26 /* command + data + overhead */, - .bus_num = 10, - .chip_select = 0, -} }; - #endif /* CONFIG_ARCH_OMAP15XX */ #ifdef CONFIG_ARCH_OMAP16XX @@ -384,8 +311,6 @@ static void __init innovator_init(void) #ifdef CONFIG_ARCH_OMAP15XX if (cpu_is_omap1510()) { platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices)); - spi_register_board_info(innovator1510_boardinfo, - ARRAY_SIZE(innovator1510_boardinfo)); } #endif #ifdef CONFIG_ARCH_OMAP16XX diff --git a/trunk/arch/arm/mach-omap1/board-osk.c b/trunk/arch/arm/mach-omap1/board-osk.c index b742261c97ad..1160093e8ef6 100644 --- a/trunk/arch/arm/mach-omap1/board-osk.c +++ b/trunk/arch/arm/mach-omap1/board-osk.c @@ -29,10 +29,11 @@ #include #include #include -#include +#include #include #include +#include #include #include @@ -44,10 +45,25 @@ #include #include #include +#include #include #include #include +static int osk_keymap[] = { + KEY(0, 0, KEY_F1), + KEY(0, 3, KEY_UP), + KEY(1, 1, KEY_LEFTCTRL), + KEY(1, 2, KEY_LEFT), + KEY(2, 0, KEY_SPACE), + KEY(2, 1, KEY_ESC), + KEY(2, 2, KEY_DOWN), + KEY(3, 2, KEY_ENTER), + KEY(3, 3, KEY_RIGHT), + 0 +}; + + static struct mtd_partition osk_partitions[] = { /* bootloader (U-Boot, etc) in first sector */ { @@ -165,17 +181,48 @@ static struct omap_alsa_codec_config alsa_config = { static struct platform_device osk5912_mcbsp1_device = { .name = "omap_alsa_mcbsp", - .id = 1, + .id = 1, .dev = { .platform_data = &alsa_config, }, }; +static struct resource osk5912_kp_resources[] = { + [0] = { + .start = INT_KEYBOARD, + .end = INT_KEYBOARD, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct omap_kp_platform_data osk_kp_data = { + .rows = 8, + .cols = 8, + .keymap = osk_keymap, +}; + +static struct platform_device osk5912_kp_device = { + .name = "omap-keypad", + .id = -1, + .dev = { + .platform_data = &osk_kp_data, + }, + .num_resources = ARRAY_SIZE(osk5912_kp_resources), + .resource = osk5912_kp_resources, +}; + +static struct platform_device osk5912_lcd_device = { + .name = "lcd_osk", + .id = -1, +}; + static struct platform_device *osk5912_devices[] __initdata = { &osk5912_flash_device, &osk5912_smc91x_device, &osk5912_cf_device, &osk5912_mcbsp1_device, + &osk5912_kp_device, + &osk5912_lcd_device, }; static void __init osk_init_smc91x(void) @@ -229,100 +276,18 @@ static struct omap_uart_config osk_uart_config __initdata = { .enabled_uarts = (1 << 0), }; -#ifdef CONFIG_OMAP_OSK_MISTRAL static struct omap_lcd_config osk_lcd_config __initdata = { .ctrl_name = "internal", }; -#endif static struct omap_board_config_kernel osk_config[] = { { OMAP_TAG_USB, &osk_usb_config }, { OMAP_TAG_UART, &osk_uart_config }, -#ifdef CONFIG_OMAP_OSK_MISTRAL { OMAP_TAG_LCD, &osk_lcd_config }, -#endif }; #ifdef CONFIG_OMAP_OSK_MISTRAL -#include -#include -#include - -#include - -static const int osk_keymap[] = { - /* KEY(col, row, code) */ - KEY(0, 0, KEY_F1), /* SW4 */ - KEY(0, 3, KEY_UP), /* (sw2/up) */ - KEY(1, 1, KEY_LEFTCTRL), /* SW5 */ - KEY(1, 2, KEY_LEFT), /* (sw2/left) */ - KEY(2, 0, KEY_SPACE), /* SW3 */ - KEY(2, 1, KEY_ESC), /* SW6 */ - KEY(2, 2, KEY_DOWN), /* (sw2/down) */ - KEY(3, 2, KEY_ENTER), /* (sw2/select) */ - KEY(3, 3, KEY_RIGHT), /* (sw2/right) */ - 0 -}; - -static struct omap_kp_platform_data osk_kp_data = { - .rows = 8, - .cols = 8, - .keymap = (int *) osk_keymap, -}; - -static struct resource osk5912_kp_resources[] = { - [0] = { - .start = INT_KEYBOARD, - .end = INT_KEYBOARD, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device osk5912_kp_device = { - .name = "omap-keypad", - .id = -1, - .dev = { - .platform_data = &osk_kp_data, - }, - .num_resources = ARRAY_SIZE(osk5912_kp_resources), - .resource = osk5912_kp_resources, -}; - -static struct platform_device osk5912_lcd_device = { - .name = "lcd_osk", - .id = -1, -}; - -static struct platform_device *mistral_devices[] __initdata = { - &osk5912_kp_device, - &osk5912_lcd_device, -}; - -static int mistral_get_pendown_state(void) -{ - return !omap_get_gpio_datain(4); -} - -static const struct ads7846_platform_data mistral_ts_info = { - .model = 7846, - .vref_delay_usecs = 100, /* internal, no capacitor */ - .x_plate_ohms = 419, - .y_plate_ohms = 486, - .get_pendown_state = mistral_get_pendown_state, -}; - -static struct spi_board_info __initdata mistral_boardinfo[] = { { - /* MicroWire (bus 2) CS0 has an ads7846e */ - .modalias = "ads7846", - .platform_data = &mistral_ts_info, - .irq = OMAP_GPIO_IRQ(4), - .max_speed_hz = 120000 /* max sample rate at 3V */ - * 26 /* command + data + overhead */, - .bus_num = 2, - .chip_select = 0, -} }; - #ifdef CONFIG_PM static irqreturn_t osk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs) @@ -333,18 +298,14 @@ osk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs) static void __init osk_mistral_init(void) { - /* NOTE: we could actually tell if there's a Mistral board + /* FIXME here's where to feed in framebuffer, touchpad, and + * keyboard setup ... not in the drivers for those devices! + * + * NOTE: we could actually tell if there's a Mistral board * attached, e.g. by trying to read something from the ads7846. - * But this arch_init() code is too early for that, since we - * can't talk to the ads or even the i2c eeprom. + * But this is too early for that... */ - // omap_cfg_reg(P19_1610_GPIO6); // BUSY - omap_cfg_reg(P20_1610_GPIO4); // PENIRQ - set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING); - spi_register_board_info(mistral_boardinfo, - ARRAY_SIZE(mistral_boardinfo)); - /* the sideways button (SW1) is for use as a "wakeup" button */ omap_cfg_reg(N15_1610_MPUIO2); if (omap_request_gpio(OMAP_MPUIO(2)) == 0) { @@ -357,7 +318,7 @@ static void __init osk_mistral_init(void) */ ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), &osk_mistral_wake_interrupt, - IRQF_SHARED, "mistral_wakeup", + SA_SHIRQ, "mistral_wakeup", &osk_mistral_wake_interrupt); if (ret != 0) { omap_free_gpio(OMAP_MPUIO(2)); @@ -368,8 +329,6 @@ static void __init osk_mistral_init(void) #endif } else printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n"); - - platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices)); } #else static void __init osk_mistral_init(void) { } diff --git a/trunk/arch/arm/mach-omap1/clock.c b/trunk/arch/arm/mach-omap1/clock.c index f1958e882e86..619db18144ea 100644 --- a/trunk/arch/arm/mach-omap1/clock.c +++ b/trunk/arch/arm/mach-omap1/clock.c @@ -1,4 +1,3 @@ -//kernel/linux-omap-fsample/arch/arm/mach-omap1/clock.c#2 - edit change 3808 (text) /* * linux/arch/arm/mach-omap1/clock.c * @@ -21,7 +20,6 @@ #include -#include #include #include #include @@ -272,12 +270,8 @@ static int omap1_select_table_rate(struct clk * clk, unsigned long rate) /* * In most cases we should not need to reprogram DPLL. * Reprogramming the DPLL is tricky, it must be done from SRAM. - * (on 730, bit 13 must always be 1) */ - if (cpu_is_omap730()) - omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val | 0x2000); - else - omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val); + omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val); ck_dpll1.rate = ptr->pll_rate; propagate_rate(&ck_dpll1); @@ -754,7 +748,7 @@ int __init omap1_clk_init(void) printk(KERN_ERR "System frequencies not set. Check your config.\n"); /* Guess sane values (60MHz) */ omap_writew(0x2290, DPLL_CTL); - omap_writew(cpu_is_omap730() ? 0x3005 : 0x1005, ARM_CKCTL); + omap_writew(0x1005, ARM_CKCTL); ck_dpll1.rate = 60000000; propagate_rate(&ck_dpll1); } @@ -767,17 +761,13 @@ int __init omap1_clk_init(void) ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10, arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); -#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE) +#ifdef CONFIG_MACH_OMAP_PERSEUS2 /* Select slicer output as OMAP input clock */ omap_writew(omap_readw(OMAP730_PCC_UPLD_CTRL) & ~0x1, OMAP730_PCC_UPLD_CTRL); #endif /* Turn off DSP and ARM_TIMXO. Make sure ARM_INTHCK is not divided */ - /* (on 730, bit 13 must not be cleared) */ - if (cpu_is_omap730()) - omap_writew(omap_readw(ARM_CKCTL) & 0x2fff, ARM_CKCTL); - else - omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL); + omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL); /* Put DSP/MPUI into reset until needed */ omap_writew(0, ARM_RSTCT1); diff --git a/trunk/arch/arm/mach-omap1/devices.c b/trunk/arch/arm/mach-omap1/devices.c index a611c3b63954..847329cafc5c 100644 --- a/trunk/arch/arm/mach-omap1/devices.c +++ b/trunk/arch/arm/mach-omap1/devices.c @@ -9,6 +9,7 @@ * (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap1/fpga.c b/trunk/arch/arm/mach-omap1/fpga.c index 34eb79ee6e61..aca2a120813a 100644 --- a/trunk/arch/arm/mach-omap1/fpga.c +++ b/trunk/arch/arm/mach-omap1/fpga.c @@ -16,6 +16,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -133,7 +134,7 @@ static struct irqchip omap_fpga_irq = { * mask_ack routine for all of the FPGA interrupts has been changed from * fpga_mask_ack_irq() to fpga_ack_irq() so that the specific FPGA interrupt * being serviced is left unmasked. We can do this because the FPGA cascade - * interrupt is installed with the IRQF_DISABLED flag, which leaves all + * interrupt is installed with the SA_INTERRUPT flag, which leaves all * interrupts masked at the CPU while an FPGA interrupt handler executes. * * Limited testing indicates that this workaround appears to be effective diff --git a/trunk/arch/arm/mach-omap1/id.c b/trunk/arch/arm/mach-omap1/id.c index da13c3e82850..5c637c048368 100644 --- a/trunk/arch/arm/mach-omap1/id.c +++ b/trunk/arch/arm/mach-omap1/id.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap1/io.c b/trunk/arch/arm/mach-omap1/io.c index fab8b0b27cfb..be3a2a4ee2b8 100644 --- a/trunk/arch/arm/mach-omap1/io.c +++ b/trunk/arch/arm/mach-omap1/io.c @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap1/irq.c b/trunk/arch/arm/mach-omap1/irq.c index 9e039845b50e..a0431c00fa81 100644 --- a/trunk/arch/arm/mach-omap1/irq.c +++ b/trunk/arch/arm/mach-omap1/irq.c @@ -36,6 +36,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap1/leds-h2p2-debug.c b/trunk/arch/arm/mach-omap1/leds-h2p2-debug.c index 8976fbb21f7c..650650815915 100644 --- a/trunk/arch/arm/mach-omap1/leds-h2p2-debug.c +++ b/trunk/arch/arm/mach-omap1/leds-h2p2-debug.c @@ -9,6 +9,7 @@ * The "surfer" expansion board and H2 sample board also have two-color * green+red LEDs (in parallel), used here for timer and idle indicators. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap1/leds-innovator.c b/trunk/arch/arm/mach-omap1/leds-innovator.c index a0cd001ac39a..c8ffd1ddcded 100644 --- a/trunk/arch/arm/mach-omap1/leds-innovator.c +++ b/trunk/arch/arm/mach-omap1/leds-innovator.c @@ -1,6 +1,7 @@ /* * linux/arch/arm/mach-omap1/leds-innovator.c */ +#include #include #include diff --git a/trunk/arch/arm/mach-omap1/leds-osk.c b/trunk/arch/arm/mach-omap1/leds-osk.c index 3b29e59b0e6f..2c8bda847c18 100644 --- a/trunk/arch/arm/mach-omap1/leds-osk.c +++ b/trunk/arch/arm/mach-omap1/leds-osk.c @@ -3,6 +3,7 @@ * * LED driver for OSK, and optionally Mistral QVGA, boards */ +#include #include #include diff --git a/trunk/arch/arm/mach-omap1/mux.c b/trunk/arch/arm/mach-omap1/mux.c index fa74ef7af15f..10fe0b3efcac 100644 --- a/trunk/arch/arm/mach-omap1/mux.c +++ b/trunk/arch/arm/mach-omap1/mux.c @@ -22,6 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap1/pm.c b/trunk/arch/arm/mach-omap1/pm.c index cd76185bab74..ddf6b07dc9c7 100644 --- a/trunk/arch/arm/mach-omap1/pm.c +++ b/trunk/arch/arm/mach-omap1/pm.c @@ -1,4 +1,3 @@ -//kernel/linux-omap-fsample/arch/arm/mach-omap1/pm.c#3 - integrate change 4545 (text) /* * linux/arch/arm/mach-omap1/pm.c * @@ -51,7 +50,6 @@ #include #include -#include #include #include #include @@ -328,9 +326,8 @@ void omap_pm_suspend(void) /* stop DSP */ omap_writew(omap_readw(ARM_RSTCT1) & ~(1 << DSP_EN), ARM_RSTCT1); - /* shut down dsp_ck */ - if (!cpu_is_omap730()) - omap_writew(omap_readw(ARM_CKCTL) & ~(1 << EN_DSPCK), ARM_CKCTL); + /* shut down dsp_ck */ + omap_writew(omap_readw(ARM_CKCTL) & ~(1 << EN_DSPCK), ARM_CKCTL); /* temporarily enabling api_ck to access DSP registers */ omap_writew(omap_readw(ARM_IDLECT2) | 1 << EN_APICK, ARM_IDLECT2); @@ -690,7 +687,7 @@ static irqreturn_t omap_wakeup_interrupt(int irq, void * dev, static struct irqaction omap_wakeup_irq = { .name = "peripheral wakeup", - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .handler = omap_wakeup_interrupt }; diff --git a/trunk/arch/arm/mach-omap1/serial.c b/trunk/arch/arm/mach-omap1/serial.c index 976edfb882e2..9b4cd698bec8 100644 --- a/trunk/arch/arm/mach-omap1/serial.c +++ b/trunk/arch/arm/mach-omap1/serial.c @@ -8,10 +8,10 @@ * published by the Free Software Foundation. */ +#include #include #include #include -#include #include #include #include @@ -253,7 +253,7 @@ static void __init omap_serial_set_port_wakeup(int gpio_nr) } omap_set_gpio_direction(gpio_nr, 1); ret = request_irq(OMAP_GPIO_IRQ(gpio_nr), &omap_serial_wake_interrupt, - IRQF_TRIGGER_RISING, "serial wakeup", NULL); + SA_TRIGGER_RISING, "serial wakeup", NULL); if (ret) { omap_free_gpio(gpio_nr); printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n", diff --git a/trunk/arch/arm/mach-omap1/sleep.S b/trunk/arch/arm/mach-omap1/sleep.S index abef33d10f01..e58295e2d3b2 100644 --- a/trunk/arch/arm/mach-omap1/sleep.S +++ b/trunk/arch/arm/mach-omap1/sleep.S @@ -32,6 +32,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap1/time.c b/trunk/arch/arm/mach-omap1/time.c index 4d91b9f51084..a85fe6066bc4 100644 --- a/trunk/arch/arm/mach-omap1/time.c +++ b/trunk/arch/arm/mach-omap1/time.c @@ -33,6 +33,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -93,7 +94,7 @@ static inline unsigned long long cycles_2_ns(unsigned long long cyc) * will break. On P2, the timer count rate is 6.5 MHz after programming PTV * with 0. This divides the 13MHz input by 2, and is undocumented. */ -#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE) +#ifdef CONFIG_MACH_OMAP_PERSEUS2 /* REVISIT: This ifdef construct should be replaced by a query to clock * framework to see if timer base frequency is 12.0, 13.0 or 19.2 MHz. */ @@ -177,7 +178,7 @@ static irqreturn_t omap_mpu_timer_interrupt(int irq, void *dev_id, static struct irqaction omap_mpu_timer_irq = { .name = "mpu timer", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = omap_mpu_timer_interrupt, }; @@ -191,7 +192,7 @@ static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id, static struct irqaction omap_mpu_timer1_irq = { .name = "mpu timer1 overflow", - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .handler = omap_mpu_timer1_interrupt, }; diff --git a/trunk/arch/arm/mach-omap2/Kconfig b/trunk/arch/arm/mach-omap2/Kconfig index aab97ccf1e63..537dd2e6d380 100644 --- a/trunk/arch/arm/mach-omap2/Kconfig +++ b/trunk/arch/arm/mach-omap2/Kconfig @@ -8,7 +8,6 @@ config ARCH_OMAP24XX config ARCH_OMAP2420 bool "OMAP2420 support" depends on ARCH_OMAP24XX - select OMAP_DM_TIMER comment "OMAP Board Type" depends on ARCH_OMAP2 diff --git a/trunk/arch/arm/mach-omap2/Makefile b/trunk/arch/arm/mach-omap2/Makefile index 266d88e77bdc..111eaa64258f 100644 --- a/trunk/arch/arm/mach-omap2/Makefile +++ b/trunk/arch/arm/mach-omap2/Makefile @@ -3,13 +3,12 @@ # # Common support -obj-y := irq.o id.o io.o sram-fn.o memory.o prcm.o clock.o mux.o devices.o \ - serial.o gpmc.o +obj-y := irq.o id.o io.o sram-fn.o memory.o prcm.o clock.o mux.o devices.o serial.o obj-$(CONFIG_OMAP_MPU_TIMER) += timer-gp.o # Power Management -obj-$(CONFIG_PM) += pm.o pm-domain.o sleep.o +obj-$(CONFIG_PM) += pm.o sleep.o # Specific board support obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o diff --git a/trunk/arch/arm/mach-omap2/board-apollon.c b/trunk/arch/arm/mach-omap2/board-apollon.c index 7993b7bae2bd..6c6ba172cdf6 100644 --- a/trunk/arch/arm/mach-omap2/board-apollon.c +++ b/trunk/arch/arm/mach-omap2/board-apollon.c @@ -234,17 +234,17 @@ static void __init apollon_sw_init(void) set_irq_type(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), IRQT_RISING); if (request_irq(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), &apollon_sw_interrupt, - IRQF_SHARED, "enter sw", + SA_SHIRQ, "enter sw", &apollon_sw_interrupt)) return; set_irq_type(OMAP_GPIO_IRQ(SW_UP_GPIO17), IRQT_RISING); if (request_irq(OMAP_GPIO_IRQ(SW_UP_GPIO17), &apollon_sw_interrupt, - IRQF_SHARED, "up sw", + SA_SHIRQ, "up sw", &apollon_sw_interrupt)) return; set_irq_type(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), IRQT_RISING); if (request_irq(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), &apollon_sw_interrupt, - IRQF_SHARED, "down sw", + SA_SHIRQ, "down sw", &apollon_sw_interrupt)) return; } diff --git a/trunk/arch/arm/mach-omap2/clock.c b/trunk/arch/arm/mach-omap2/clock.c index d1b648a4efbf..72eb4bf571ac 100644 --- a/trunk/arch/arm/mach-omap2/clock.c +++ b/trunk/arch/arm/mach-omap2/clock.c @@ -15,6 +15,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -659,35 +660,26 @@ static int omap2_clk_set_rate(struct clk *clk, unsigned long rate) /* Isolate control register */ div_sel = (SRC_RATE_SEL_MASK & clk->flags); - div_off = clk->rate_offset; + div_off = clk->src_offset; validrate = omap2_clksel_round_rate(clk, rate, &new_div); - if (validrate != rate) + if(validrate != rate) return(ret); field_val = omap2_get_clksel(&div_sel, &field_mask, clk); if (div_sel == 0) return ret; - if (clk->flags & CM_SYSCLKOUT_SEL1) { - switch (new_div) { - case 16: - field_val = 4; - break; - case 8: - field_val = 3; - break; - case 4: - field_val = 2; - break; - case 2: - field_val = 1; - break; - case 1: - field_val = 0; - break; + if(clk->flags & CM_SYSCLKOUT_SEL1){ + switch(new_div){ + case 16: field_val = 4; break; + case 8: field_val = 3; break; + case 4: field_val = 2; break; + case 2: field_val = 1; break; + case 1: field_val = 0; break; } - } else + } + else field_val = new_div; reg = (void __iomem *)div_sel; @@ -752,7 +744,7 @@ static u32 omap2_get_src_field(u32 *type_to_addr, u32 reg_offset, val = 0x2; break; case CM_WKUP_SEL1: - src_reg_addr = (u32)&CM_CLKSEL_WKUP; + src_reg_addr = (u32)&CM_CLKSEL2_CORE; mask = 0x3; if (src_clk == &func_32k_ck) val = 0x0; @@ -792,9 +784,9 @@ static u32 omap2_get_src_field(u32 *type_to_addr, u32 reg_offset, val = 0; if (src_clk == &sys_ck) val = 1; - if (src_clk == &func_96m_ck) - val = 2; if (src_clk == &func_54m_ck) + val = 2; + if (src_clk == &func_96m_ck) val = 3; break; } diff --git a/trunk/arch/arm/mach-omap2/clock.h b/trunk/arch/arm/mach-omap2/clock.h index 2781dfbc5164..6c78d471fab7 100644 --- a/trunk/arch/arm/mach-omap2/clock.h +++ b/trunk/arch/arm/mach-omap2/clock.h @@ -1062,7 +1062,7 @@ static struct clk gpt2_ick = { .parent = &l4_ck, .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* Bit4 */ - .enable_bit = 4, + .enable_bit = 0, .recalc = &omap2_followparent_recalc, }; diff --git a/trunk/arch/arm/mach-omap2/devices.c b/trunk/arch/arm/mach-omap2/devices.c index aa4322451e8b..fb7f91da1aad 100644 --- a/trunk/arch/arm/mach-omap2/devices.c +++ b/trunk/arch/arm/mach-omap2/devices.c @@ -9,6 +9,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -104,51 +105,6 @@ static inline void omap_init_sti(void) static inline void omap_init_sti(void) {} #endif -#if defined(CONFIG_SPI_OMAP24XX) - -#include - -#define OMAP2_MCSPI1_BASE 0x48098000 -#define OMAP2_MCSPI2_BASE 0x4809a000 - -/* FIXME: use resources instead */ - -static struct omap2_mcspi_platform_config omap2_mcspi1_config = { - .base = io_p2v(OMAP2_MCSPI1_BASE), - .num_cs = 4, -}; - -struct platform_device omap2_mcspi1 = { - .name = "omap2_mcspi", - .id = 1, - .dev = { - .platform_data = &omap2_mcspi1_config, - }, -}; - -static struct omap2_mcspi_platform_config omap2_mcspi2_config = { - .base = io_p2v(OMAP2_MCSPI2_BASE), - .num_cs = 2, -}; - -struct platform_device omap2_mcspi2 = { - .name = "omap2_mcspi", - .id = 2, - .dev = { - .platform_data = &omap2_mcspi2_config, - }, -}; - -static void omap_init_mcspi(void) -{ - platform_device_register(&omap2_mcspi1); - platform_device_register(&omap2_mcspi2); -} - -#else -static inline void omap_init_mcspi(void) {} -#endif - /*-------------------------------------------------------------------------*/ static int __init omap2_init_devices(void) @@ -157,7 +113,6 @@ static int __init omap2_init_devices(void) * in alphabetical order so they're easier to sort through. */ omap_init_i2c(); - omap_init_mcspi(); omap_init_sti(); return 0; diff --git a/trunk/arch/arm/mach-omap2/gpmc.c b/trunk/arch/arm/mach-omap2/gpmc.c deleted file mode 100644 index c7a48f921fef..000000000000 --- a/trunk/arch/arm/mach-omap2/gpmc.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - * GPMC support functions - * - * Copyright (C) 2005-2006 Nokia Corporation - * - * Author: Juha Yrjola - * - * 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. - */ -#include -#include -#include -#include - -#include -#include - -#undef DEBUG - -#define GPMC_BASE 0x6800a000 -#define GPMC_REVISION 0x00 -#define GPMC_SYSCONFIG 0x10 -#define GPMC_SYSSTATUS 0x14 -#define GPMC_IRQSTATUS 0x18 -#define GPMC_IRQENABLE 0x1c -#define GPMC_TIMEOUT_CONTROL 0x40 -#define GPMC_ERR_ADDRESS 0x44 -#define GPMC_ERR_TYPE 0x48 -#define GPMC_CONFIG 0x50 -#define GPMC_STATUS 0x54 -#define GPMC_PREFETCH_CONFIG1 0x1e0 -#define GPMC_PREFETCH_CONFIG2 0x1e4 -#define GPMC_PREFETCH_CONTROL 0x1e8 -#define GPMC_PREFETCH_STATUS 0x1f0 -#define GPMC_ECC_CONFIG 0x1f4 -#define GPMC_ECC_CONTROL 0x1f8 -#define GPMC_ECC_SIZE_CONFIG 0x1fc - -#define GPMC_CS0 0x60 -#define GPMC_CS_SIZE 0x30 - -static void __iomem *gpmc_base = - (void __iomem *) IO_ADDRESS(GPMC_BASE); -static void __iomem *gpmc_cs_base = - (void __iomem *) IO_ADDRESS(GPMC_BASE) + GPMC_CS0; - -static struct clk *gpmc_l3_clk; - -static void gpmc_write_reg(int idx, u32 val) -{ - __raw_writel(val, gpmc_base + idx); -} - -static u32 gpmc_read_reg(int idx) -{ - return __raw_readl(gpmc_base + idx); -} - -void gpmc_cs_write_reg(int cs, int idx, u32 val) -{ - void __iomem *reg_addr; - - reg_addr = gpmc_cs_base + (cs * GPMC_CS_SIZE) + idx; - __raw_writel(val, reg_addr); -} - -u32 gpmc_cs_read_reg(int cs, int idx) -{ - return __raw_readl(gpmc_cs_base + (cs * GPMC_CS_SIZE) + idx); -} - -/* TODO: Add support for gpmc_fck to clock framework and use it */ -static unsigned long gpmc_get_fclk_period(void) -{ - /* In picoseconds */ - return 1000000000 / ((clk_get_rate(gpmc_l3_clk)) / 1000); -} - -unsigned int gpmc_ns_to_ticks(unsigned int time_ns) -{ - unsigned long tick_ps; - - /* Calculate in picosecs to yield more exact results */ - tick_ps = gpmc_get_fclk_period(); - - return (time_ns * 1000 + tick_ps - 1) / tick_ps; -} - -#ifdef DEBUG -static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, - int time, const char *name) -#else -static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, - int time) -#endif -{ - u32 l; - int ticks, mask, nr_bits; - - if (time == 0) - ticks = 0; - else - ticks = gpmc_ns_to_ticks(time); - nr_bits = end_bit - st_bit + 1; - if (ticks >= 1 << nr_bits) - return -1; - - mask = (1 << nr_bits) - 1; - l = gpmc_cs_read_reg(cs, reg); -#ifdef DEBUG - printk(KERN_INFO "GPMC CS%d: %-10s: %d ticks, %3lu ns (was %i ticks)\n", - cs, name, ticks, gpmc_get_fclk_period() * ticks / 1000, - (l >> st_bit) & mask); -#endif - l &= ~(mask << st_bit); - l |= ticks << st_bit; - gpmc_cs_write_reg(cs, reg, l); - - return 0; -} - -#ifdef DEBUG -#define GPMC_SET_ONE(reg, st, end, field) \ - if (set_gpmc_timing_reg(cs, (reg), (st), (end), \ - t->field, #field) < 0) \ - return -1 -#else -#define GPMC_SET_ONE(reg, st, end, field) \ - if (set_gpmc_timing_reg(cs, (reg), (st), (end), t->field) < 0) \ - return -1 -#endif - -int gpmc_cs_calc_divider(int cs, unsigned int sync_clk) -{ - int div; - u32 l; - - l = sync_clk * 1000 + (gpmc_get_fclk_period() - 1); - div = l / gpmc_get_fclk_period(); - if (div > 4) - return -1; - if (div < 0) - div = 1; - - return div; -} - -int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t) -{ - int div; - u32 l; - - div = gpmc_cs_calc_divider(cs, t->sync_clk); - if (div < 0) - return -1; - - GPMC_SET_ONE(GPMC_CS_CONFIG2, 0, 3, cs_on); - GPMC_SET_ONE(GPMC_CS_CONFIG2, 8, 12, cs_rd_off); - GPMC_SET_ONE(GPMC_CS_CONFIG2, 16, 20, cs_wr_off); - - GPMC_SET_ONE(GPMC_CS_CONFIG3, 0, 3, adv_on); - GPMC_SET_ONE(GPMC_CS_CONFIG3, 8, 12, adv_rd_off); - GPMC_SET_ONE(GPMC_CS_CONFIG3, 16, 20, adv_wr_off); - - GPMC_SET_ONE(GPMC_CS_CONFIG4, 0, 3, oe_on); - GPMC_SET_ONE(GPMC_CS_CONFIG4, 8, 12, oe_off); - GPMC_SET_ONE(GPMC_CS_CONFIG4, 16, 19, we_on); - GPMC_SET_ONE(GPMC_CS_CONFIG4, 24, 28, we_off); - - GPMC_SET_ONE(GPMC_CS_CONFIG5, 0, 4, rd_cycle); - GPMC_SET_ONE(GPMC_CS_CONFIG5, 8, 12, wr_cycle); - GPMC_SET_ONE(GPMC_CS_CONFIG5, 16, 20, access); - - GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access); - -#ifdef DEBUG - printk(KERN_INFO "GPMC CS%d CLK period is %lu (div %d)\n", - cs, gpmc_get_fclk_period(), div); -#endif - - l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); - l &= ~0x03; - l |= (div - 1); - - return 0; -} - -unsigned long gpmc_cs_get_base_addr(int cs) -{ - return (gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7) & 0x1f) << 24; -} - -void __init gpmc_init(void) -{ - u32 l; - - gpmc_l3_clk = clk_get(NULL, "core_l3_ck"); - BUG_ON(IS_ERR(gpmc_l3_clk)); - - l = gpmc_read_reg(GPMC_REVISION); - printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f); - /* Set smart idle mode and automatic L3 clock gating */ - l = gpmc_read_reg(GPMC_SYSCONFIG); - l &= 0x03 << 3; - l |= (0x02 << 3) | (1 << 0); - gpmc_write_reg(GPMC_SYSCONFIG, l); -} diff --git a/trunk/arch/arm/mach-omap2/id.c b/trunk/arch/arm/mach-omap2/id.c index 871ace4fccb8..76187300f2b6 100644 --- a/trunk/arch/arm/mach-omap2/id.c +++ b/trunk/arch/arm/mach-omap2/id.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap2/io.c b/trunk/arch/arm/mach-omap2/io.c index a0728c33e5d9..7d5711611f2f 100644 --- a/trunk/arch/arm/mach-omap2/io.c +++ b/trunk/arch/arm/mach-omap2/io.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -26,7 +27,6 @@ extern void omap_sram_init(void); extern int omap2_clk_init(void); extern void omap2_check_revision(void); -extern void gpmc_init(void); /* * The machine specific code may provide the extra mapping besides the @@ -67,5 +67,4 @@ void __init omap2_init_common_hw(void) { omap2_mux_init(); omap2_clk_init(); - gpmc_init(); } diff --git a/trunk/arch/arm/mach-omap2/irq.c b/trunk/arch/arm/mach-omap2/irq.c index 3eed6a737bf8..d7baff675cfe 100644 --- a/trunk/arch/arm/mach-omap2/irq.c +++ b/trunk/arch/arm/mach-omap2/irq.c @@ -12,6 +12,7 @@ */ #include #include +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap2/memory.c b/trunk/arch/arm/mach-omap2/memory.c index 85cbc2a2e663..1d925d69fc35 100644 --- a/trunk/arch/arm/mach-omap2/memory.c +++ b/trunk/arch/arm/mach-omap2/memory.c @@ -14,6 +14,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap2/mux.c b/trunk/arch/arm/mach-omap2/mux.c index 60ef084faffd..1197dc38c20a 100644 --- a/trunk/arch/arm/mach-omap2/mux.c +++ b/trunk/arch/arm/mach-omap2/mux.c @@ -22,6 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#include #include #include #include @@ -52,12 +53,6 @@ MUX_CFG_24XX("W19_24XX_SYS_NIRQ", 0x12c, 0, 1, 1, 1) /* 24xx clocks */ MUX_CFG_24XX("W14_24XX_SYS_CLKOUT", 0x137, 0, 1, 1, 1) -/* 24xx GPMC wait pin monitoring */ -MUX_CFG_24XX("L3_GPMC_WAIT0", 0x09a, 0, 1, 1, 1) -MUX_CFG_24XX("N7_GPMC_WAIT1", 0x09b, 0, 1, 1, 1) -MUX_CFG_24XX("M1_GPMC_WAIT2", 0x09c, 0, 1, 1, 1) -MUX_CFG_24XX("P1_GPMC_WAIT3", 0x09d, 0, 1, 1, 1) - /* 24xx McBSP */ MUX_CFG_24XX("Y15_24XX_MCBSP2_CLKX", 0x124, 1, 1, 0, 1) MUX_CFG_24XX("R14_24XX_MCBSP2_FSX", 0x125, 1, 1, 0, 1) @@ -65,38 +60,18 @@ MUX_CFG_24XX("W15_24XX_MCBSP2_DR", 0x126, 1, 1, 0, 1) MUX_CFG_24XX("V15_24XX_MCBSP2_DX", 0x127, 1, 1, 0, 1) /* 24xx GPIO */ -MUX_CFG_24XX("M21_242X_GPIO11", 0x0c9, 3, 1, 1, 1) +MUX_CFG_24XX("M21_242X_GPIO11", 0x0c9, 3, 1, 1, 1) MUX_CFG_24XX("AA10_242X_GPIO13", 0x0e5, 3, 0, 0, 1) -MUX_CFG_24XX("AA6_242X_GPIO14", 0x0e6, 3, 0, 0, 1) -MUX_CFG_24XX("AA4_242X_GPIO15", 0x0e7, 3, 0, 0, 1) -MUX_CFG_24XX("Y11_242X_GPIO16", 0x0e8, 3, 0, 0, 1) +MUX_CFG_24XX("AA6_242X_GPIO14", 0x0e6, 3, 0, 0, 1) +MUX_CFG_24XX("AA4_242X_GPIO15", 0x0e7, 3, 0, 0, 1) +MUX_CFG_24XX("Y11_242X_GPIO16", 0x0e8, 3, 0, 0, 1) MUX_CFG_24XX("AA12_242X_GPIO17", 0x0e9, 3, 0, 0, 1) -MUX_CFG_24XX("AA8_242X_GPIO58", 0x0ea, 3, 0, 0, 1) +MUX_CFG_24XX("AA8_242X_GPIO58", 0x0ea, 3, 0, 0, 1) MUX_CFG_24XX("Y20_24XX_GPIO60", 0x12c, 3, 0, 0, 1) -MUX_CFG_24XX("W4__24XX_GPIO74", 0x0f2, 3, 0, 0, 1) +MUX_CFG_24XX("W4__24XX_GPIO74", 0x0f2, 3, 0, 0, 1) MUX_CFG_24XX("M15_24XX_GPIO92", 0x10a, 3, 0, 0, 1) MUX_CFG_24XX("V14_24XX_GPIO117", 0x128, 3, 1, 0, 1) -/* 242x DBG GPIO */ -MUX_CFG_24XX("V4_242X_GPIO49", 0xd3, 3, 0, 0, 1) -MUX_CFG_24XX("W2_242X_GPIO50", 0xd4, 3, 0, 0, 1) -MUX_CFG_24XX("U4_242X_GPIO51", 0xd5, 3, 0, 0, 1) -MUX_CFG_24XX("V3_242X_GPIO52", 0xd6, 3, 0, 0, 1) -MUX_CFG_24XX("V2_242X_GPIO53", 0xd7, 3, 0, 0, 1) -MUX_CFG_24XX("V6_242X_GPIO53", 0xcf, 3, 0, 0, 1) -MUX_CFG_24XX("T4_242X_GPIO54", 0xd8, 3, 0, 0, 1) -MUX_CFG_24XX("Y4_242X_GPIO54", 0xd0, 3, 0, 0, 1) -MUX_CFG_24XX("T3_242X_GPIO55", 0xd9, 3, 0, 0, 1) -MUX_CFG_24XX("U2_242X_GPIO56", 0xda, 3, 0, 0, 1) - -/* 24xx external DMA requests */ -MUX_CFG_24XX("AA10_242X_DMAREQ0", 0x0e5, 2, 0, 0, 1) -MUX_CFG_24XX("AA6_242X_DMAREQ1", 0x0e6, 2, 0, 0, 1) -MUX_CFG_24XX("E4_242X_DMAREQ2", 0x074, 2, 0, 0, 1) -MUX_CFG_24XX("G4_242X_DMAREQ3", 0x073, 2, 0, 0, 1) -MUX_CFG_24XX("D3_242X_DMAREQ4", 0x072, 2, 0, 0, 1) -MUX_CFG_24XX("E3_242X_DMAREQ5", 0x071, 2, 0, 0, 1) - /* TSC IRQ */ MUX_CFG_24XX("P20_24XX_TSC_IRQ", 0x108, 0, 0, 0, 1) diff --git a/trunk/arch/arm/mach-omap2/pm-domain.c b/trunk/arch/arm/mach-omap2/pm-domain.c deleted file mode 100644 index 5e20e740cde5..000000000000 --- a/trunk/arch/arm/mach-omap2/pm-domain.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * linux/arch/arm/mach-omap2/pm-domain.c - * - * Power domain functions for OMAP2 - * - * Copyright (C) 2006 Nokia Corporation - * Tony Lindgren - * - * Some code based on earlier OMAP2 sample PM code - * Copyright (C) 2005 Texas Instruments, Inc. - * Richard Woodruff - * - * 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. - */ - -#include -#include -#include -#include - -#include - -#include "prcm-regs.h" - -/* Power domain offsets */ -#define PM_MPU_OFFSET 0x100 -#define PM_CORE_OFFSET 0x200 -#define PM_GFX_OFFSET 0x300 -#define PM_WKUP_OFFSET 0x400 /* Autoidle only */ -#define PM_PLL_OFFSET 0x500 /* Autoidle only */ -#define PM_DSP_OFFSET 0x800 -#define PM_MDM_OFFSET 0xc00 - -/* Power domain wake-up dependency control register */ -#define PM_WKDEP_OFFSET 0xc8 -#define EN_MDM (1 << 5) -#define EN_WKUP (1 << 4) -#define EN_GFX (1 << 3) -#define EN_DSP (1 << 2) -#define EN_MPU (1 << 1) -#define EN_CORE (1 << 0) - -/* Core power domain state transition control register */ -#define PM_PWSTCTRL_OFFSET 0xe0 -#define FORCESTATE (1 << 18) /* Only for DSP & GFX */ -#define MEM4RETSTATE (1 << 6) -#define MEM3RETSTATE (1 << 5) -#define MEM2RETSTATE (1 << 4) -#define MEM1RETSTATE (1 << 3) -#define LOGICRETSTATE (1 << 2) /* Logic is retained */ -#define POWERSTATE_OFF 0x3 -#define POWERSTATE_RETENTION 0x1 -#define POWERSTATE_ON 0x0 - -/* Power domain state register */ -#define PM_PWSTST_OFFSET 0xe4 - -/* Hardware supervised state transition control register */ -#define CM_CLKSTCTRL_OFFSET 0x48 -#define AUTOSTAT_MPU (1 << 0) /* MPU */ -#define AUTOSTAT_DSS (1 << 2) /* Core */ -#define AUTOSTAT_L4 (1 << 1) /* Core */ -#define AUTOSTAT_L3 (1 << 0) /* Core */ -#define AUTOSTAT_GFX (1 << 0) /* GFX */ -#define AUTOSTAT_IVA (1 << 8) /* 2420 IVA in DSP domain */ -#define AUTOSTAT_DSP (1 << 0) /* DSP */ -#define AUTOSTAT_MDM (1 << 0) /* MDM */ - -/* Automatic control of interface clock idling */ -#define CM_AUTOIDLE1_OFFSET 0x30 -#define CM_AUTOIDLE2_OFFSET 0x34 /* Core only */ -#define CM_AUTOIDLE3_OFFSET 0x38 /* Core only */ -#define CM_AUTOIDLE4_OFFSET 0x3c /* Core only */ -#define AUTO_54M(x) (((x) & 0x3) << 6) -#define AUTO_96M(x) (((x) & 0x3) << 2) -#define AUTO_DPLL(x) (((x) & 0x3) << 0) -#define AUTO_STOPPED 0x3 -#define AUTO_BYPASS_FAST 0x2 /* DPLL only */ -#define AUTO_BYPASS_LOW_POWER 0x1 /* DPLL only */ -#define AUTO_DISABLED 0x0 - -/* Voltage control PRCM_VOLTCTRL bits */ -#define AUTO_EXTVOLT (1 << 15) -#define FORCE_EXTVOLT (1 << 14) -#define SETOFF_LEVEL(x) (((x) & 0x3) << 12) -#define MEMRETCTRL (1 << 8) -#define SETRET_LEVEL(x) (((x) & 0x3) << 6) -#define VOLT_LEVEL(x) (((x) & 0x3) << 0) - -#define OMAP24XX_PRCM_VBASE IO_ADDRESS(OMAP24XX_PRCM_BASE) -#define prcm_readl(r) __raw_readl(OMAP24XX_PRCM_VBASE + (r)) -#define prcm_writel(v, r) __raw_writel((v), OMAP24XX_PRCM_VBASE + (r)) - -static u32 pmdomain_get_wakeup_dependencies(int domain_offset) -{ - return prcm_readl(domain_offset + PM_WKDEP_OFFSET); -} - -static void pmdomain_set_wakeup_dependencies(u32 state, int domain_offset) -{ - prcm_writel(state, domain_offset + PM_WKDEP_OFFSET); -} - -static u32 pmdomain_get_powerstate(int domain_offset) -{ - return prcm_readl(domain_offset + PM_PWSTCTRL_OFFSET); -} - -static void pmdomain_set_powerstate(u32 state, int domain_offset) -{ - prcm_writel(state, domain_offset + PM_PWSTCTRL_OFFSET); -} - -static u32 pmdomain_get_clock_autocontrol(int domain_offset) -{ - return prcm_readl(domain_offset + CM_CLKSTCTRL_OFFSET); -} - -static void pmdomain_set_clock_autocontrol(u32 state, int domain_offset) -{ - prcm_writel(state, domain_offset + CM_CLKSTCTRL_OFFSET); -} - -static u32 pmdomain_get_clock_autoidle1(int domain_offset) -{ - return prcm_readl(domain_offset + CM_AUTOIDLE1_OFFSET); -} - -/* Core domain only */ -static u32 pmdomain_get_clock_autoidle2(int domain_offset) -{ - return prcm_readl(domain_offset + CM_AUTOIDLE2_OFFSET); -} - -/* Core domain only */ -static u32 pmdomain_get_clock_autoidle3(int domain_offset) -{ - return prcm_readl(domain_offset + CM_AUTOIDLE3_OFFSET); -} - -/* Core domain only */ -static u32 pmdomain_get_clock_autoidle4(int domain_offset) -{ - return prcm_readl(domain_offset + CM_AUTOIDLE4_OFFSET); -} - -static void pmdomain_set_clock_autoidle1(u32 state, int domain_offset) -{ - prcm_writel(state, CM_AUTOIDLE1_OFFSET + domain_offset); -} - -/* Core domain only */ -static void pmdomain_set_clock_autoidle2(u32 state, int domain_offset) -{ - prcm_writel(state, CM_AUTOIDLE2_OFFSET + domain_offset); -} - -/* Core domain only */ -static void pmdomain_set_clock_autoidle3(u32 state, int domain_offset) -{ - prcm_writel(state, CM_AUTOIDLE3_OFFSET + domain_offset); -} - -/* Core domain only */ -static void pmdomain_set_clock_autoidle4(u32 state, int domain_offset) -{ - prcm_writel(state, CM_AUTOIDLE4_OFFSET + domain_offset); -} - -/* - * Configures power management domains to idle clocks automatically. - */ -void pmdomain_set_autoidle(void) -{ - u32 val; - - /* Set PLL auto stop for 54M, 96M & DPLL */ - pmdomain_set_clock_autoidle1(AUTO_54M(AUTO_STOPPED) | - AUTO_96M(AUTO_STOPPED) | - AUTO_DPLL(AUTO_STOPPED), PM_PLL_OFFSET); - - /* External clock input control - * REVISIT: Should this be in clock framework? - */ - PRCM_CLKSRC_CTRL |= (0x3 << 3); - - /* Configure number of 32KHz clock cycles for sys_clk */ - PRCM_CLKSSETUP = 0x00ff; - - /* Configure automatic voltage transition */ - PRCM_VOLTSETUP = 0; - val = PRCM_VOLTCTRL; - val &= ~(SETOFF_LEVEL(0x3) | VOLT_LEVEL(0x3)); - val |= SETOFF_LEVEL(1) | VOLT_LEVEL(1) | AUTO_EXTVOLT; - PRCM_VOLTCTRL = val; - - /* Disable emulation tools functional clock */ - PRCM_CLKEMUL_CTRL = 0x0; - - /* Set core memory retention state */ - val = pmdomain_get_powerstate(PM_CORE_OFFSET); - if (cpu_is_omap2420()) { - val &= ~(0x7 << 3); - val |= (MEM3RETSTATE | MEM2RETSTATE | MEM1RETSTATE); - } else { - val &= ~(0xf << 3); - val |= (MEM4RETSTATE | MEM3RETSTATE | MEM2RETSTATE | - MEM1RETSTATE); - } - pmdomain_set_powerstate(val, PM_CORE_OFFSET); - - /* OCP interface smart idle. REVISIT: Enable autoidle bit0 ? */ - val = SMS_SYSCONFIG; - val &= ~(0x3 << 3); - val |= (0x2 << 3) | (1 << 0); - SMS_SYSCONFIG |= val; - - val = SDRC_SYSCONFIG; - val &= ~(0x3 << 3); - val |= (0x2 << 3); - SDRC_SYSCONFIG = val; - - /* Configure L3 interface for smart idle. - * REVISIT: Enable autoidle bit0 ? - */ - val = GPMC_SYSCONFIG; - val &= ~(0x3 << 3); - val |= (0x2 << 3) | (1 << 0); - GPMC_SYSCONFIG = val; - - pmdomain_set_powerstate(LOGICRETSTATE | POWERSTATE_RETENTION, - PM_MPU_OFFSET); - pmdomain_set_powerstate(POWERSTATE_RETENTION, PM_CORE_OFFSET); - if (!cpu_is_omap2420()) - pmdomain_set_powerstate(POWERSTATE_RETENTION, PM_MDM_OFFSET); - - /* Assume suspend function has saved the state for DSP and GFX */ - pmdomain_set_powerstate(FORCESTATE | POWERSTATE_OFF, PM_DSP_OFFSET); - pmdomain_set_powerstate(FORCESTATE | POWERSTATE_OFF, PM_GFX_OFFSET); - -#if 0 - /* REVISIT: Internal USB needs special handling */ - force_standby_usb(); - if (cpu_is_omap2430()) - force_hsmmc(); - sdram_self_refresh_on_idle_req(1); -#endif - - /* Enable clock auto control for all domains. - * Note that CORE domain includes also DSS, L4 & L3. - */ - pmdomain_set_clock_autocontrol(AUTOSTAT_MPU, PM_MPU_OFFSET); - pmdomain_set_clock_autocontrol(AUTOSTAT_GFX, PM_GFX_OFFSET); - pmdomain_set_clock_autocontrol(AUTOSTAT_DSS | AUTOSTAT_L4 | AUTOSTAT_L3, - PM_CORE_OFFSET); - if (cpu_is_omap2420()) - pmdomain_set_clock_autocontrol(AUTOSTAT_IVA | AUTOSTAT_DSP, - PM_DSP_OFFSET); - else { - pmdomain_set_clock_autocontrol(AUTOSTAT_DSP, PM_DSP_OFFSET); - pmdomain_set_clock_autocontrol(AUTOSTAT_MDM, PM_MDM_OFFSET); - } - - /* Enable clock autoidle for all domains */ - pmdomain_set_clock_autoidle1(0x2, PM_DSP_OFFSET); - if (cpu_is_omap2420()) { - pmdomain_set_clock_autoidle1(0xfffffff9, PM_CORE_OFFSET); - pmdomain_set_clock_autoidle2(0x7, PM_CORE_OFFSET); - pmdomain_set_clock_autoidle1(0x3f, PM_WKUP_OFFSET); - } else { - pmdomain_set_clock_autoidle1(0xeafffff1, PM_CORE_OFFSET); - pmdomain_set_clock_autoidle2(0xfff, PM_CORE_OFFSET); - pmdomain_set_clock_autoidle1(0x7f, PM_WKUP_OFFSET); - pmdomain_set_clock_autoidle1(0x3, PM_MDM_OFFSET); - } - pmdomain_set_clock_autoidle3(0x7, PM_CORE_OFFSET); - pmdomain_set_clock_autoidle4(0x1f, PM_CORE_OFFSET); -} - -/* - * Initializes power domains by removing wake-up dependencies and powering - * down DSP and GFX. Gets called from PM init. Note that DSP and IVA code - * must re-enable DSP and GFX when used. - */ -void __init pmdomain_init(void) -{ - /* Remove all domain wakeup dependencies */ - pmdomain_set_wakeup_dependencies(EN_WKUP | EN_CORE, PM_MPU_OFFSET); - pmdomain_set_wakeup_dependencies(0, PM_DSP_OFFSET); - pmdomain_set_wakeup_dependencies(0, PM_GFX_OFFSET); - pmdomain_set_wakeup_dependencies(EN_WKUP | EN_MPU, PM_CORE_OFFSET); - if (cpu_is_omap2430()) - pmdomain_set_wakeup_dependencies(0, PM_MDM_OFFSET); - - /* Power down DSP and GFX */ - pmdomain_set_powerstate(POWERSTATE_OFF | FORCESTATE, PM_DSP_OFFSET); - pmdomain_set_powerstate(POWERSTATE_OFF | FORCESTATE, PM_GFX_OFFSET); -} diff --git a/trunk/arch/arm/mach-omap2/pm.c b/trunk/arch/arm/mach-omap2/pm.c index d7eee99b7e3f..562168fa2b16 100644 --- a/trunk/arch/arm/mach-omap2/pm.c +++ b/trunk/arch/arm/mach-omap2/pm.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -37,18 +36,11 @@ #include #include -#include "prcm-regs.h" - static struct clk *vclk; static void (*omap2_sram_idle)(void); static void (*omap2_sram_suspend)(int dllctrl, int cpu_rev); static void (*saved_idle)(void); -extern void __init pmdomain_init(void); -extern void pmdomain_set_autoidle(void); - -static unsigned int omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_SIZE]; - void omap2_pm_idle(void) { local_irq_disable(); @@ -95,272 +87,23 @@ static int omap2_pm_prepare(suspend_state_t state) return error; } -#define INT0_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK1) | \ - OMAP_IRQ_BIT(INT_24XX_GPIO_BANK2) | \ - OMAP_IRQ_BIT(INT_24XX_GPIO_BANK3)) - -#define INT1_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK4)) - -#define INT2_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_UART1_IRQ) | \ - OMAP_IRQ_BIT(INT_24XX_UART2_IRQ) | \ - OMAP_IRQ_BIT(INT_24XX_UART3_IRQ)) - -#define preg(reg) printk("%s\t(0x%p):\t0x%08x\n", #reg, ®, reg); - -static void omap2_pm_debug(char * desc) -{ - printk("%s:\n", desc); - - preg(CM_CLKSTCTRL_MPU); - preg(CM_CLKSTCTRL_CORE); - preg(CM_CLKSTCTRL_GFX); - preg(CM_CLKSTCTRL_DSP); - preg(CM_CLKSTCTRL_MDM); - - preg(PM_PWSTCTRL_MPU); - preg(PM_PWSTCTRL_CORE); - preg(PM_PWSTCTRL_GFX); - preg(PM_PWSTCTRL_DSP); - preg(PM_PWSTCTRL_MDM); - - preg(PM_PWSTST_MPU); - preg(PM_PWSTST_CORE); - preg(PM_PWSTST_GFX); - preg(PM_PWSTST_DSP); - preg(PM_PWSTST_MDM); - - preg(CM_AUTOIDLE1_CORE); - preg(CM_AUTOIDLE2_CORE); - preg(CM_AUTOIDLE3_CORE); - preg(CM_AUTOIDLE4_CORE); - preg(CM_AUTOIDLE_WKUP); - preg(CM_AUTOIDLE_PLL); - preg(CM_AUTOIDLE_DSP); - preg(CM_AUTOIDLE_MDM); - - preg(CM_ICLKEN1_CORE); - preg(CM_ICLKEN2_CORE); - preg(CM_ICLKEN3_CORE); - preg(CM_ICLKEN4_CORE); - preg(CM_ICLKEN_GFX); - preg(CM_ICLKEN_WKUP); - preg(CM_ICLKEN_DSP); - preg(CM_ICLKEN_MDM); - - preg(CM_IDLEST1_CORE); - preg(CM_IDLEST2_CORE); - preg(CM_IDLEST3_CORE); - preg(CM_IDLEST4_CORE); - preg(CM_IDLEST_GFX); - preg(CM_IDLEST_WKUP); - preg(CM_IDLEST_CKGEN); - preg(CM_IDLEST_DSP); - preg(CM_IDLEST_MDM); - - preg(RM_RSTST_MPU); - preg(RM_RSTST_GFX); - preg(RM_RSTST_WKUP); - preg(RM_RSTST_DSP); - preg(RM_RSTST_MDM); - - preg(PM_WKDEP_MPU); - preg(PM_WKDEP_CORE); - preg(PM_WKDEP_GFX); - preg(PM_WKDEP_DSP); - preg(PM_WKDEP_MDM); - - preg(CM_FCLKEN_WKUP); - preg(CM_ICLKEN_WKUP); - preg(CM_IDLEST_WKUP); - preg(CM_AUTOIDLE_WKUP); - preg(CM_CLKSEL_WKUP); - - preg(PM_WKEN_WKUP); - preg(PM_WKST_WKUP); -} - -static inline void omap2_pm_save_registers(void) -{ - /* Save interrupt registers */ - OMAP24XX_SAVE(INTC_MIR0); - OMAP24XX_SAVE(INTC_MIR1); - OMAP24XX_SAVE(INTC_MIR2); - - /* Save power control registers */ - OMAP24XX_SAVE(CM_CLKSTCTRL_MPU); - OMAP24XX_SAVE(CM_CLKSTCTRL_CORE); - OMAP24XX_SAVE(CM_CLKSTCTRL_GFX); - OMAP24XX_SAVE(CM_CLKSTCTRL_DSP); - OMAP24XX_SAVE(CM_CLKSTCTRL_MDM); - - /* Save power state registers */ - OMAP24XX_SAVE(PM_PWSTCTRL_MPU); - OMAP24XX_SAVE(PM_PWSTCTRL_CORE); - OMAP24XX_SAVE(PM_PWSTCTRL_GFX); - OMAP24XX_SAVE(PM_PWSTCTRL_DSP); - OMAP24XX_SAVE(PM_PWSTCTRL_MDM); - - /* Save autoidle registers */ - OMAP24XX_SAVE(CM_AUTOIDLE1_CORE); - OMAP24XX_SAVE(CM_AUTOIDLE2_CORE); - OMAP24XX_SAVE(CM_AUTOIDLE3_CORE); - OMAP24XX_SAVE(CM_AUTOIDLE4_CORE); - OMAP24XX_SAVE(CM_AUTOIDLE_WKUP); - OMAP24XX_SAVE(CM_AUTOIDLE_PLL); - OMAP24XX_SAVE(CM_AUTOIDLE_DSP); - OMAP24XX_SAVE(CM_AUTOIDLE_MDM); - - /* Save idle state registers */ - OMAP24XX_SAVE(CM_IDLEST1_CORE); - OMAP24XX_SAVE(CM_IDLEST2_CORE); - OMAP24XX_SAVE(CM_IDLEST3_CORE); - OMAP24XX_SAVE(CM_IDLEST4_CORE); - OMAP24XX_SAVE(CM_IDLEST_GFX); - OMAP24XX_SAVE(CM_IDLEST_WKUP); - OMAP24XX_SAVE(CM_IDLEST_CKGEN); - OMAP24XX_SAVE(CM_IDLEST_DSP); - OMAP24XX_SAVE(CM_IDLEST_MDM); - - /* Save clock registers */ - OMAP24XX_SAVE(CM_FCLKEN1_CORE); - OMAP24XX_SAVE(CM_FCLKEN2_CORE); - OMAP24XX_SAVE(CM_ICLKEN1_CORE); - OMAP24XX_SAVE(CM_ICLKEN2_CORE); - OMAP24XX_SAVE(CM_ICLKEN3_CORE); - OMAP24XX_SAVE(CM_ICLKEN4_CORE); -} - -static inline void omap2_pm_restore_registers(void) -{ - /* Restore clock state registers */ - OMAP24XX_RESTORE(CM_CLKSTCTRL_MPU); - OMAP24XX_RESTORE(CM_CLKSTCTRL_CORE); - OMAP24XX_RESTORE(CM_CLKSTCTRL_GFX); - OMAP24XX_RESTORE(CM_CLKSTCTRL_DSP); - OMAP24XX_RESTORE(CM_CLKSTCTRL_MDM); - - /* Restore power state registers */ - OMAP24XX_RESTORE(PM_PWSTCTRL_MPU); - OMAP24XX_RESTORE(PM_PWSTCTRL_CORE); - OMAP24XX_RESTORE(PM_PWSTCTRL_GFX); - OMAP24XX_RESTORE(PM_PWSTCTRL_DSP); - OMAP24XX_RESTORE(PM_PWSTCTRL_MDM); - - /* Restore idle state registers */ - OMAP24XX_RESTORE(CM_IDLEST1_CORE); - OMAP24XX_RESTORE(CM_IDLEST2_CORE); - OMAP24XX_RESTORE(CM_IDLEST3_CORE); - OMAP24XX_RESTORE(CM_IDLEST4_CORE); - OMAP24XX_RESTORE(CM_IDLEST_GFX); - OMAP24XX_RESTORE(CM_IDLEST_WKUP); - OMAP24XX_RESTORE(CM_IDLEST_CKGEN); - OMAP24XX_RESTORE(CM_IDLEST_DSP); - OMAP24XX_RESTORE(CM_IDLEST_MDM); - - /* Restore autoidle registers */ - OMAP24XX_RESTORE(CM_AUTOIDLE1_CORE); - OMAP24XX_RESTORE(CM_AUTOIDLE2_CORE); - OMAP24XX_RESTORE(CM_AUTOIDLE3_CORE); - OMAP24XX_RESTORE(CM_AUTOIDLE4_CORE); - OMAP24XX_RESTORE(CM_AUTOIDLE_WKUP); - OMAP24XX_RESTORE(CM_AUTOIDLE_PLL); - OMAP24XX_RESTORE(CM_AUTOIDLE_DSP); - OMAP24XX_RESTORE(CM_AUTOIDLE_MDM); - - /* Restore clock registers */ - OMAP24XX_RESTORE(CM_FCLKEN1_CORE); - OMAP24XX_RESTORE(CM_FCLKEN2_CORE); - OMAP24XX_RESTORE(CM_ICLKEN1_CORE); - OMAP24XX_RESTORE(CM_ICLKEN2_CORE); - OMAP24XX_RESTORE(CM_ICLKEN3_CORE); - OMAP24XX_RESTORE(CM_ICLKEN4_CORE); - - /* REVISIT: Clear interrupts here */ - - /* Restore interrupt registers */ - OMAP24XX_RESTORE(INTC_MIR0); - OMAP24XX_RESTORE(INTC_MIR1); - OMAP24XX_RESTORE(INTC_MIR2); -} - -static int omap2_pm_suspend(void) -{ - int processor_type = 0; - - /* REVISIT: 0x21 or 0x26? */ - if (cpu_is_omap2420()) - processor_type = 0x21; - - if (!processor_type) - return -ENOTSUPP; - - local_irq_disable(); - local_fiq_disable(); - - omap2_pm_save_registers(); - - /* Disable interrupts except for the wake events */ - INTC_MIR_SET0 = 0xffffffff & ~INT0_WAKE_MASK; - INTC_MIR_SET1 = 0xffffffff & ~INT1_WAKE_MASK; - INTC_MIR_SET2 = 0xffffffff & ~INT2_WAKE_MASK; - - pmdomain_set_autoidle(); - - /* Clear old wake-up events */ - PM_WKST1_CORE = 0; - PM_WKST2_CORE = 0; - PM_WKST_WKUP = 0; - - /* Enable wake-up events */ - PM_WKEN1_CORE = (1 << 22) | (1 << 21); /* UART1 & 2 */ - PM_WKEN2_CORE = (1 << 2); /* UART3 */ - PM_WKEN_WKUP = (1 << 2) | (1 << 0); /* GPIO & GPT1 */ - - /* Disable clocks except for CM_ICLKEN2_CORE. It gets disabled - * in the SRAM suspend code */ - CM_FCLKEN1_CORE = 0; - CM_FCLKEN2_CORE = 0; - CM_ICLKEN1_CORE = 0; - CM_ICLKEN3_CORE = 0; - CM_ICLKEN4_CORE = 0; - - omap2_pm_debug("Status before suspend"); - - /* Must wait for serial buffers to clear */ - mdelay(200); - - /* Jump to SRAM suspend code - * REVISIT: When is this SDRC_DLLB_CTRL? - */ - omap2_sram_suspend(SDRC_DLLA_CTRL, processor_type); - - /* Back from sleep */ - omap2_pm_restore_registers(); - - local_fiq_enable(); - local_irq_enable(); - - return 0; -} - static int omap2_pm_enter(suspend_state_t state) { - int ret = 0; - switch (state) { case PM_SUSPEND_STANDBY: case PM_SUSPEND_MEM: - ret = omap2_pm_suspend(); + /* FIXME: Add suspend */ break; + case PM_SUSPEND_DISK: - ret = -ENOTSUPP; - break; + return -ENOTSUPP; + default: - ret = -EINVAL; + return -EINVAL; } - return ret; + return 0; } static int omap2_pm_finish(suspend_state_t state) @@ -400,8 +143,6 @@ int __init omap2_pm_init(void) pm_set_ops(&omap_pm_ops); pm_idle = omap2_pm_idle; - pmdomain_init(); - return 0; } diff --git a/trunk/arch/arm/mach-omap2/prcm.c b/trunk/arch/arm/mach-omap2/prcm.c index c2bf57ef6825..8893479dc7e0 100644 --- a/trunk/arch/arm/mach-omap2/prcm.c +++ b/trunk/arch/arm/mach-omap2/prcm.c @@ -13,6 +13,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap2/sleep.S b/trunk/arch/arm/mach-omap2/sleep.S index 16247d557853..00299cbeb911 100644 --- a/trunk/arch/arm/mach-omap2/sleep.S +++ b/trunk/arch/arm/mach-omap2/sleep.S @@ -21,6 +21,7 @@ * MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap2/sram-fn.S b/trunk/arch/arm/mach-omap2/sram-fn.S index a5ef7f611da9..d261e4ff4d9b 100644 --- a/trunk/arch/arm/mach-omap2/sram-fn.S +++ b/trunk/arch/arm/mach-omap2/sram-fn.S @@ -22,6 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-omap2/timer-gp.c b/trunk/arch/arm/mach-omap2/timer-gp.c index fe5fd6d42dea..1d2f5ac2f69b 100644 --- a/trunk/arch/arm/mach-omap2/timer-gp.c +++ b/trunk/arch/arm/mach-omap2/timer-gp.c @@ -6,7 +6,6 @@ * Copyright (C) 2005 Nokia Corporation * Author: Paul Mundt * Juha Yrjölä - * OMAP Dual-mode timer framework support by Timo Teras * * Some parts based off of TI's 24xx code: * @@ -23,18 +22,54 @@ #include #include #include -#include #include -#include +#include +#include -static struct omap_dm_timer *gptimer; +#define OMAP2_GP_TIMER1_BASE 0x48028000 +#define OMAP2_GP_TIMER2_BASE 0x4802a000 +#define OMAP2_GP_TIMER3_BASE 0x48078000 +#define OMAP2_GP_TIMER4_BASE 0x4807a000 -static inline void omap2_gp_timer_start(unsigned long load_val) +#define GP_TIMER_TIDR 0x00 +#define GP_TIMER_TISR 0x18 +#define GP_TIMER_TIER 0x1c +#define GP_TIMER_TCLR 0x24 +#define GP_TIMER_TCRR 0x28 +#define GP_TIMER_TLDR 0x2c +#define GP_TIMER_TSICR 0x40 + +#define OS_TIMER_NR 1 /* GP timer 2 */ + +static unsigned long timer_base[] = { + IO_ADDRESS(OMAP2_GP_TIMER1_BASE), + IO_ADDRESS(OMAP2_GP_TIMER2_BASE), + IO_ADDRESS(OMAP2_GP_TIMER3_BASE), + IO_ADDRESS(OMAP2_GP_TIMER4_BASE), +}; + +static inline unsigned int timer_read_reg(int nr, unsigned int reg) +{ + return __raw_readl(timer_base[nr] + reg); +} + +static inline void timer_write_reg(int nr, unsigned int reg, unsigned int val) +{ + __raw_writel(val, timer_base[nr] + reg); +} + +/* Note that we always enable the clock prescale divider bit */ +static inline void omap2_gp_timer_start(int nr, unsigned long load_val) { - omap_dm_timer_set_load(gptimer, 1, 0xffffffff - load_val); - omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW); - omap_dm_timer_start(gptimer); + unsigned int tmp; + + tmp = 0xffffffff - load_val; + + timer_write_reg(nr, GP_TIMER_TLDR, tmp); + timer_write_reg(nr, GP_TIMER_TCRR, tmp); + timer_write_reg(nr, GP_TIMER_TIER, 1 << 1); + timer_write_reg(nr, GP_TIMER_TCLR, (1 << 5) | (1 << 1) | 1); } static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id, @@ -42,7 +77,7 @@ static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id, { write_seqlock(&xtime_lock); - omap_dm_timer_write_status(gptimer, OMAP_TIMER_INT_OVERFLOW); + timer_write_reg(OS_TIMER_NR, GP_TIMER_TISR, 1 << 1); timer_tick(regs); write_sequnlock(&xtime_lock); @@ -52,26 +87,41 @@ static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id, static struct irqaction omap2_gp_timer_irq = { .name = "gp timer", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT, .handler = omap2_gp_timer_interrupt, }; static void __init omap2_gp_timer_init(void) { - u32 tick_period; + struct clk * sys_ck; + u32 tick_period = 120000; + u32 l; - omap_dm_timer_init(); - gptimer = omap_dm_timer_request_specific(1); - BUG_ON(gptimer == NULL); + /* Reset clock and prescale value */ + timer_write_reg(OS_TIMER_NR, GP_TIMER_TCLR, 0); - omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_SYS_CLK); - tick_period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / 100; + sys_ck = clk_get(NULL, "sys_ck"); + if (IS_ERR(sys_ck)) + printk(KERN_ERR "Could not get sys_ck\n"); + else { + clk_enable(sys_ck); + tick_period = clk_get_rate(sys_ck) / 100; + clk_put(sys_ck); + } + + tick_period /= 2; /* Minimum prescale divider is 2 */ tick_period -= 1; - setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq); - omap2_gp_timer_start(tick_period); + l = timer_read_reg(OS_TIMER_NR, GP_TIMER_TIDR); + printk(KERN_INFO "OMAP2 GP timer (HW version %d.%d)\n", + (l >> 4) & 0x0f, l & 0x0f); + + setup_irq(38, &omap2_gp_timer_irq); + + omap2_gp_timer_start(OS_TIMER_NR, tick_period); } struct sys_timer omap_timer = { .init = omap2_gp_timer_init, }; + diff --git a/trunk/arch/arm/mach-pnx4008/time.c b/trunk/arch/arm/mach-pnx4008/time.c index 888bf6cfba8a..4ce680698529 100644 --- a/trunk/arch/arm/mach-pnx4008/time.c +++ b/trunk/arch/arm/mach-pnx4008/time.c @@ -86,7 +86,7 @@ static irqreturn_t pnx4008_timer_interrupt(int irq, void *dev_id, static struct irqaction pnx4008_timer_irq = { .name = "PNX4008 Tick Timer", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = pnx4008_timer_interrupt }; diff --git a/trunk/arch/arm/mach-pxa/Kconfig b/trunk/arch/arm/mach-pxa/Kconfig index 03d07cae26c8..ea5137f319c4 100644 --- a/trunk/arch/arm/mach-pxa/Kconfig +++ b/trunk/arch/arm/mach-pxa/Kconfig @@ -35,10 +35,6 @@ config PXA_SHARPSL SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa) handheld computer. -config MACH_TRIZEPS4 - bool "Keith und Koep Trizeps4 DIMM-Module" - select PXA27x - endchoice if PXA_SHARPSL @@ -59,21 +55,6 @@ endchoice endif -if MACH_TRIZEPS4 - -choice - prompt "Select base board for Trizeps 4 module" - -config MACH_TRIZEPS4_CONXS - bool "ConXS Eval Board" - -config MACH_TRIZEPS4_ANY - bool "another Board" - -endchoice - -endif - endmenu config MACH_POODLE diff --git a/trunk/arch/arm/mach-pxa/Makefile b/trunk/arch/arm/mach-pxa/Makefile index 9093eb1c94eb..1610690be419 100644 --- a/trunk/arch/arm/mach-pxa/Makefile +++ b/trunk/arch/arm/mach-pxa/Makefile @@ -12,7 +12,6 @@ obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o obj-$(CONFIG_ARCH_PXA_IDP) += idp.o -obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o @@ -24,7 +23,6 @@ led-y := leds.o led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o -led-$(CONFIG_MACH_TRIZEPS4) += leds-trizeps4.o obj-$(CONFIG_LEDS) += $(led-y) diff --git a/trunk/arch/arm/mach-pxa/corgi.c b/trunk/arch/arm/mach-pxa/corgi.c index cce26576999e..bf6648a83901 100644 --- a/trunk/arch/arm/mach-pxa/corgi.c +++ b/trunk/arch/arm/mach-pxa/corgi.c @@ -225,7 +225,7 @@ static int corgi_mci_init(struct device *dev, irqreturn_t (*corgi_detect_int)(in corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250); err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int, - IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, "MMC card detect", data); if (err) { printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); diff --git a/trunk/arch/arm/mach-pxa/idp.c b/trunk/arch/arm/mach-pxa/idp.c index 6914d22bc20f..347b9dea24c6 100644 --- a/trunk/arch/arm/mach-pxa/idp.c +++ b/trunk/arch/arm/mach-pxa/idp.c @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/trunk/arch/arm/mach-pxa/leds-idp.c b/trunk/arch/arm/mach-pxa/leds-idp.c index 38aa9270540e..5eba6ea0b0f7 100644 --- a/trunk/arch/arm/mach-pxa/leds-idp.c +++ b/trunk/arch/arm/mach-pxa/leds-idp.c @@ -12,6 +12,7 @@ */ +#include #include #include diff --git a/trunk/arch/arm/mach-pxa/leds-lubbock.c b/trunk/arch/arm/mach-pxa/leds-lubbock.c index afbc6698e27c..05cf56059a0f 100644 --- a/trunk/arch/arm/mach-pxa/leds-lubbock.c +++ b/trunk/arch/arm/mach-pxa/leds-lubbock.c @@ -11,6 +11,7 @@ * namespace collision. Mostly adapted the Mainstone version. */ +#include #include #include diff --git a/trunk/arch/arm/mach-pxa/leds-mainstone.c b/trunk/arch/arm/mach-pxa/leds-mainstone.c index 065293eb0d82..c06d3d7a8dd4 100644 --- a/trunk/arch/arm/mach-pxa/leds-mainstone.c +++ b/trunk/arch/arm/mach-pxa/leds-mainstone.c @@ -10,6 +10,7 @@ * published by the Free Software Foundation. */ +#include #include #include diff --git a/trunk/arch/arm/mach-pxa/leds-trizeps4.c b/trunk/arch/arm/mach-pxa/leds-trizeps4.c deleted file mode 100644 index 14cfc85e44b5..000000000000 --- a/trunk/arch/arm/mach-pxa/leds-trizeps4.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * linux/arch/arm/mach-pxa/leds-trizeps4.c - * - * Author: Jürgen Schindele - * Created: 20 02, 2006 - * Copyright: Jürgen Schindele - * - * 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. - */ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "leds.h" - -#define LED_STATE_ENABLED 1 -#define LED_STATE_CLAIMED 2 - -#define SYS_BUSY 0x01 -#define HEARTBEAT 0x02 -#define BLINK 0x04 - -static unsigned int led_state; -static unsigned int hw_led_state; - -void trizeps4_leds_event(led_event_t evt) -{ - unsigned long flags; - - local_irq_save(flags); - - switch (evt) { - case led_start: - hw_led_state = 0; - pxa_gpio_mode( GPIO_SYS_BUSY_LED | GPIO_OUT); /* LED1 */ - pxa_gpio_mode( GPIO_HEARTBEAT_LED | GPIO_OUT); /* LED2 */ - led_state = LED_STATE_ENABLED; - break; - - case led_stop: - led_state &= ~LED_STATE_ENABLED; - break; - - case led_claim: - led_state |= LED_STATE_CLAIMED; - hw_led_state = 0; - break; - - case led_release: - led_state &= ~LED_STATE_CLAIMED; - hw_led_state = 0; - break; - -#ifdef CONFIG_LEDS_TIMER - case led_timer: - hw_led_state ^= HEARTBEAT; - break; -#endif - -#ifdef CONFIG_LEDS_CPU - case led_idle_start: - hw_led_state &= ~SYS_BUSY; - break; - - case led_idle_end: - hw_led_state |= SYS_BUSY; - break; -#endif - - case led_halted: - break; - - case led_green_on: - hw_led_state |= BLINK; - break; - - case led_green_off: - hw_led_state &= ~BLINK; - break; - - case led_amber_on: - break; - - case led_amber_off: - break; - - case led_red_on: - break; - - case led_red_off: - break; - - default: - break; - } - - if (led_state & LED_STATE_ENABLED) { - switch (hw_led_state) { - case 0: - GPSR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); - GPSR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); - break; - case 1: - GPCR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); - GPSR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); - break; - case 2: - GPSR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); - GPCR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); - break; - case 3: - GPCR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); - GPCR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); - break; - } - } - else { - /* turn all off */ - GPSR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); - GPSR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); - } - - local_irq_restore(flags); -} diff --git a/trunk/arch/arm/mach-pxa/leds.c b/trunk/arch/arm/mach-pxa/leds.c index e13eb841e48d..bbe4d5f6afaa 100644 --- a/trunk/arch/arm/mach-pxa/leds.c +++ b/trunk/arch/arm/mach-pxa/leds.c @@ -24,8 +24,6 @@ pxa_leds_init(void) leds_event = mainstone_leds_event; if (machine_is_pxa_idp()) leds_event = idp_leds_event; - if (machine_is_trizeps4()) - leds_event = trizeps4_leds_event; leds_event(led_start); return 0; diff --git a/trunk/arch/arm/mach-pxa/leds.h b/trunk/arch/arm/mach-pxa/leds.h index 4f829b8c39dd..d98f6e93c12b 100644 --- a/trunk/arch/arm/mach-pxa/leds.h +++ b/trunk/arch/arm/mach-pxa/leds.h @@ -10,4 +10,3 @@ extern void idp_leds_event(led_event_t evt); extern void lubbock_leds_event(led_event_t evt); extern void mainstone_leds_event(led_event_t evt); -extern void trizeps4_leds_event(led_event_t evt); diff --git a/trunk/arch/arm/mach-pxa/lpd270.c b/trunk/arch/arm/mach-pxa/lpd270.c index 1a5f5c21481e..ec0f43a102c7 100644 --- a/trunk/arch/arm/mach-pxa/lpd270.c +++ b/trunk/arch/arm/mach-pxa/lpd270.c @@ -248,137 +248,58 @@ static void lpd270_backlight_power(int on) /* 5.7" TFT QVGA (LoLo display number 1) */ static struct pxafb_mach_info sharp_lq057q3dc02 __initdata = { - .pixclock = 150000, - .xres = 320, - .yres = 240, + .pixclock = 100000, + .xres = 240, + .yres = 320, .bpp = 16, - .hsync_len = 0x14, - .left_margin = 0x28, - .right_margin = 0x0a, - .vsync_len = 0x02, + .hsync_len = 64, + .left_margin = 0x27, + .right_margin = 0x09, + .vsync_len = 0x04, .upper_margin = 0x08, .lower_margin = 0x14, - .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, + .sync = 0, .lccr0 = 0x07800080, - .lccr3 = 0x00400000, - .pxafb_backlight_power = lpd270_backlight_power, -}; - -/* 12.1" TFT SVGA (LoLo display number 2) */ -static struct pxafb_mach_info sharp_lq121s1dg31 __initdata = { - .pixclock = 50000, - .xres = 800, - .yres = 600, - .bpp = 16, - .hsync_len = 0x05, - .left_margin = 0x52, - .right_margin = 0x05, - .vsync_len = 0x04, - .upper_margin = 0x14, - .lower_margin = 0x0a, - .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, - .lccr0 = 0x07800080, - .lccr3 = 0x00400000, - .pxafb_backlight_power = lpd270_backlight_power, -}; - -/* 3.6" TFT QVGA (LoLo display number 3) */ -static struct pxafb_mach_info sharp_lq036q1da01 __initdata = { - .pixclock = 150000, - .xres = 320, - .yres = 240, - .bpp = 16, - .hsync_len = 0x0e, - .left_margin = 0x04, - .right_margin = 0x0a, - .vsync_len = 0x03, - .upper_margin = 0x03, - .lower_margin = 0x03, - .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, - .lccr0 = 0x07800080, - .lccr3 = 0x00400000, + .lccr3 = 0x04400007, .pxafb_backlight_power = lpd270_backlight_power, }; /* 6.4" TFT VGA (LoLo display number 5) */ static struct pxafb_mach_info sharp_lq64d343 __initdata = { - .pixclock = 25000, + .pixclock = 20000, .xres = 640, .yres = 480, .bpp = 16, - .hsync_len = 0x31, + .hsync_len = 49, .left_margin = 0x89, .right_margin = 0x19, - .vsync_len = 0x12, + .vsync_len = 18, .upper_margin = 0x22, - .lower_margin = 0x00, + .lower_margin = 0, .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, .lccr0 = 0x07800080, - .lccr3 = 0x00400000, - .pxafb_backlight_power = lpd270_backlight_power, -}; - -/* 10.4" TFT VGA (LoLo display number 7) */ -static struct pxafb_mach_info sharp_lq10d368 __initdata = { - .pixclock = 25000, - .xres = 640, - .yres = 480, - .bpp = 16, - .hsync_len = 0x31, - .left_margin = 0x89, - .right_margin = 0x19, - .vsync_len = 0x12, - .upper_margin = 0x22, - .lower_margin = 0x00, - .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, - .lccr0 = 0x07800080, - .lccr3 = 0x00400000, + .lccr3 = 0x04400001, .pxafb_backlight_power = lpd270_backlight_power, }; /* 3.5" TFT QVGA (LoLo display number 8) */ static struct pxafb_mach_info sharp_lq035q7db02_20 __initdata = { - .pixclock = 150000, + .pixclock = 100000, .xres = 240, .yres = 320, .bpp = 16, - .hsync_len = 0x0e, - .left_margin = 0x0a, - .right_margin = 0x0a, - .vsync_len = 0x03, + .hsync_len = 0x34, + .left_margin = 0x09, + .right_margin = 0x09, + .vsync_len = 0x08, .upper_margin = 0x05, .lower_margin = 0x14, - .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, + .sync = 0, .lccr0 = 0x07800080, - .lccr3 = 0x00400000, + .lccr3 = 0x04400007, .pxafb_backlight_power = lpd270_backlight_power, }; -static struct pxafb_mach_info *lpd270_lcd_to_use; - -static int __init lpd270_set_lcd(char *str) -{ - if (!strnicmp(str, "lq057q3dc02", 11)) { - lpd270_lcd_to_use = &sharp_lq057q3dc02; - } else if (!strnicmp(str, "lq121s1dg31", 11)) { - lpd270_lcd_to_use = &sharp_lq121s1dg31; - } else if (!strnicmp(str, "lq036q1da01", 11)) { - lpd270_lcd_to_use = &sharp_lq036q1da01; - } else if (!strnicmp(str, "lq64d343", 8)) { - lpd270_lcd_to_use = &sharp_lq64d343; - } else if (!strnicmp(str, "lq10d368", 8)) { - lpd270_lcd_to_use = &sharp_lq10d368; - } else if (!strnicmp(str, "lq035q7db02-20", 14)) { - lpd270_lcd_to_use = &sharp_lq035q7db02_20; - } else { - printk(KERN_INFO "lpd270: unknown lcd panel [%s]\n", str); - } - - return 1; -} - -__setup("lcd=", lpd270_set_lcd); - static struct platform_device *platform_devices[] __initdata = { &smc91x_device, &lpd270_audio_device, @@ -424,8 +345,9 @@ static void __init lpd270_init(void) platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); - if (lpd270_lcd_to_use != NULL) - set_pxa_fb_info(lpd270_lcd_to_use); + // set_pxa_fb_info(&sharp_lq057q3dc02); + set_pxa_fb_info(&sharp_lq64d343); + // set_pxa_fb_info(&sharp_lq035q7db02_20); pxa_set_ohci_info(&lpd270_ohci_platform_data); } diff --git a/trunk/arch/arm/mach-pxa/lubbock.c b/trunk/arch/arm/mach-pxa/lubbock.c index 6a9a669d60de..1ab26c6914f2 100644 --- a/trunk/arch/arm/mach-pxa/lubbock.c +++ b/trunk/arch/arm/mach-pxa/lubbock.c @@ -419,7 +419,7 @@ static int lubbock_mci_init(struct device *dev, init_timer(&mmc_timer); mmc_timer.data = (unsigned long) data; return request_irq(LUBBOCK_SD_IRQ, lubbock_detect_int, - IRQF_SAMPLE_RANDOM, "lubbock-sd-detect", data); + SA_SAMPLE_RANDOM, "lubbock-sd-detect", data); } static int lubbock_mci_get_ro(struct device *dev) diff --git a/trunk/arch/arm/mach-pxa/mainstone.c b/trunk/arch/arm/mach-pxa/mainstone.c index 21ddf3de2f6e..b307f11951df 100644 --- a/trunk/arch/arm/mach-pxa/mainstone.c +++ b/trunk/arch/arm/mach-pxa/mainstone.c @@ -331,7 +331,7 @@ static int mainstone_mci_init(struct device *dev, irqreturn_t (*mstone_detect_in */ MST_MSCWR1 &= ~MST_MSCWR1_MS_SEL; - err = request_irq(MAINSTONE_MMC_IRQ, mstone_detect_int, IRQF_DISABLED, + err = request_irq(MAINSTONE_MMC_IRQ, mstone_detect_int, SA_INTERRUPT, "MMC card detect", data); if (err) { printk(KERN_ERR "mainstone_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); diff --git a/trunk/arch/arm/mach-pxa/pm.c b/trunk/arch/arm/mach-pxa/pm.c index 2112c414f0e2..852ea72d8c80 100644 --- a/trunk/arch/arm/mach-pxa/pm.c +++ b/trunk/arch/arm/mach-pxa/pm.c @@ -10,6 +10,7 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-pxa/poodle.c b/trunk/arch/arm/mach-pxa/poodle.c index 6dbff6d94801..9a9fa87cea9f 100644 --- a/trunk/arch/arm/mach-pxa/poodle.c +++ b/trunk/arch/arm/mach-pxa/poodle.c @@ -212,7 +212,7 @@ static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)( poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250); err = request_irq(POODLE_IRQ_GPIO_nSD_DETECT, poodle_detect_int, - IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, "MMC card detect", data); if (err) { printk(KERN_ERR "poodle_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); diff --git a/trunk/arch/arm/mach-pxa/pxa25x.c b/trunk/arch/arm/mach-pxa/pxa25x.c index c1f21739bf71..573a5758e781 100644 --- a/trunk/arch/arm/mach-pxa/pxa25x.c +++ b/trunk/arch/arm/mach-pxa/pxa25x.c @@ -16,6 +16,7 @@ * initialization stuff for PXA machines which can be overridden later if * need be. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-pxa/pxa27x.c b/trunk/arch/arm/mach-pxa/pxa27x.c index 74eeada1e2fc..3baa70819f24 100644 --- a/trunk/arch/arm/mach-pxa/pxa27x.c +++ b/trunk/arch/arm/mach-pxa/pxa27x.c @@ -11,6 +11,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-pxa/sharpsl_pm.c b/trunk/arch/arm/mach-pxa/sharpsl_pm.c index db6e8f56a75f..0f1648780c41 100644 --- a/trunk/arch/arm/mach-pxa/sharpsl_pm.c +++ b/trunk/arch/arm/mach-pxa/sharpsl_pm.c @@ -18,11 +18,11 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -142,18 +142,18 @@ void sharpsl_pm_pxa_init(void) pxa_gpio_mode(sharpsl_pm.machinfo->gpio_batlock | GPIO_IN); /* Register interrupt handlers */ - if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED, "AC Input Detect", sharpsl_ac_isr)) { + if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, SA_INTERRUPT, "AC Input Detect", sharpsl_ac_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin)); } else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin),IRQT_BOTHEDGE); - if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED, "Battery Cover", sharpsl_fatal_isr)) { + if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, SA_INTERRUPT, "Battery Cover", sharpsl_fatal_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock)); } else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock),IRQT_FALLING); if (sharpsl_pm.machinfo->gpio_fatal) { - if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED, "Fatal Battery", sharpsl_fatal_isr)) { + if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, SA_INTERRUPT, "Fatal Battery", sharpsl_fatal_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal)); } else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal),IRQT_FALLING); @@ -162,7 +162,7 @@ void sharpsl_pm_pxa_init(void) if (sharpsl_pm.machinfo->batfull_irq) { /* Register interrupt handler. */ - if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED, "CO", sharpsl_chrg_full_isr)) { + if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, SA_INTERRUPT, "CO", sharpsl_chrg_full_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull)); } else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull),IRQT_RISING); diff --git a/trunk/arch/arm/mach-pxa/sleep.S b/trunk/arch/arm/mach-pxa/sleep.S index 15874b360e51..0650bed3b96e 100644 --- a/trunk/arch/arm/mach-pxa/sleep.S +++ b/trunk/arch/arm/mach-pxa/sleep.S @@ -11,6 +11,7 @@ * modify it under the terms of the GNU General Public License. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-pxa/spitz.c b/trunk/arch/arm/mach-pxa/spitz.c index 1c32a9310dc2..eb9937f6f5cd 100644 --- a/trunk/arch/arm/mach-pxa/spitz.c +++ b/trunk/arch/arm/mach-pxa/spitz.c @@ -308,7 +308,7 @@ static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(in spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250); err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int, - IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, "MMC card detect", data); if (err) { printk(KERN_ERR "spitz_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); diff --git a/trunk/arch/arm/mach-pxa/standby.S b/trunk/arch/arm/mach-pxa/standby.S index d774430d02c0..6f6dbbd08021 100644 --- a/trunk/arch/arm/mach-pxa/standby.S +++ b/trunk/arch/arm/mach-pxa/standby.S @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-pxa/time.c b/trunk/arch/arm/mach-pxa/time.c index 5dbd191c57c4..b9b2057349eb 100644 --- a/trunk/arch/arm/mach-pxa/time.c +++ b/trunk/arch/arm/mach-pxa/time.c @@ -10,6 +10,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -117,7 +118,7 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction pxa_timer_irq = { .name = "PXA Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = pxa_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-pxa/tosa.c b/trunk/arch/arm/mach-pxa/tosa.c index 249353616aba..7152bc13680f 100644 --- a/trunk/arch/arm/mach-pxa/tosa.c +++ b/trunk/arch/arm/mach-pxa/tosa.c @@ -185,7 +185,7 @@ static int tosa_mci_init(struct device *dev, irqreturn_t (*tosa_detect_int)(int, tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250); - err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, IRQF_DISABLED, + err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, SA_INTERRUPT, "MMC/SD card detect", data); if (err) { printk(KERN_ERR "tosa_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); diff --git a/trunk/arch/arm/mach-pxa/trizeps4.c b/trunk/arch/arm/mach-pxa/trizeps4.c deleted file mode 100644 index 7c3007df1bd6..000000000000 --- a/trunk/arch/arm/mach-pxa/trizeps4.c +++ /dev/null @@ -1,473 +0,0 @@ -/* - * linux/arch/arm/mach-pxa/trizeps4.c - * - * Support for the Keith und Koep Trizeps4 Module Platform. - * - * Author: Jürgen Schindele - * Created: 20 02, 2006 - * Copyright: Jürgen Schindele - * - * 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. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "generic.h" - -/******************************************************************************************** - * ONBOARD FLASH - ********************************************************************************************/ -static struct mtd_partition trizeps4_partitions[] = { - { - .name = "Bootloader", - .size = 0x00040000, - .offset = 0, - .mask_flags = MTD_WRITEABLE /* force read-only */ - },{ - .name = "Kernel", - .size = 0x00400000, - .offset = 0x00040000 - },{ - .name = "Filesystem", - .size = MTDPART_SIZ_FULL, - .offset = 0x00440000 - } -}; - -static struct flash_platform_data trizeps4_flash_data[] = { - { - .map_name = "cfi_probe", - .parts = trizeps4_partitions, - .nr_parts = ARRAY_SIZE(trizeps4_partitions) - } -}; - -static struct resource flash_resource = { - .start = PXA_CS0_PHYS, - .end = PXA_CS0_PHYS + SZ_64M - 1, - .flags = IORESOURCE_MEM, -}; - -static struct platform_device flash_device = { - .name = "pxa2xx-flash", - .id = 0, - .dev = { - .platform_data = &trizeps4_flash_data, - }, - .resource = &flash_resource, - .num_resources = 1, -}; - -/******************************************************************************************** - * DAVICOM DM9000 Ethernet - ********************************************************************************************/ -static struct resource dm9000_resources[] = { - [0] = { - .start = TRIZEPS4_ETH_PHYS+0x300, - .end = TRIZEPS4_ETH_PHYS+0x400-1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = TRIZEPS4_ETH_PHYS+0x8300, - .end = TRIZEPS4_ETH_PHYS+0x8400-1, - .flags = IORESOURCE_MEM, - }, - [2] = { - .start = TRIZEPS4_ETH_IRQ, - .end = TRIZEPS4_ETH_IRQ, - .flags = (IORESOURCE_IRQ | IRQT_RISING), - }, -}; - -static struct platform_device dm9000_device = { - .name = "dm9000", - .id = -1, - .num_resources = ARRAY_SIZE(dm9000_resources), - .resource = dm9000_resources, -}; - -/******************************************************************************************** - * PXA270 serial ports - ********************************************************************************************/ -static struct plat_serial8250_port tri_serial_ports[] = { -#ifdef CONFIG_SERIAL_PXA - /* this uses the own PXA driver */ - { - 0, - }, -#else - /* this uses the generic 8520 driver */ - [0] = { - .membase = (void *)&FFUART, - .irq = IRQ_FFUART, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM32, - .regshift = 2, - .uartclk = (921600*16), - }, - [1] = { - .membase = (void *)&BTUART, - .irq = IRQ_BTUART, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM32, - .regshift = 2, - .uartclk = (921600*16), - }, - { - 0, - }, -#endif -}; - -static struct platform_device uart_devices = { - .name = "serial8250", - .id = 0, - .dev = { - .platform_data = tri_serial_ports, - }, - .num_resources = 0, - .resource = NULL, -}; - -/******************************************************************************************** - * PXA270 ac97 sound codec - ********************************************************************************************/ -static struct platform_device ac97_audio_device = { - .name = "pxa2xx-ac97", - .id = -1, -}; - -static struct platform_device * trizeps4_devices[] __initdata = { - &flash_device, - &uart_devices, - &dm9000_device, - &ac97_audio_device, -}; - -#ifdef CONFIG_MACH_TRIZEPS4_CONXS -static short trizeps_conxs_bcr; - -/* PCCARD power switching supports only 3,3V */ -void board_pcmcia_power(int power) -{ - if (power) { - /* switch power on, put in reset and enable buffers */ - trizeps_conxs_bcr |= power; - trizeps_conxs_bcr |= ConXS_BCR_CF_RESET; - trizeps_conxs_bcr &= ~(ConXS_BCR_CF_BUF_EN); - ConXS_BCR = trizeps_conxs_bcr; - /* wait a little */ - udelay(2000); - /* take reset away */ - trizeps_conxs_bcr &= ~(ConXS_BCR_CF_RESET); - ConXS_BCR = trizeps_conxs_bcr; - udelay(2000); - } else { - /* put in reset */ - trizeps_conxs_bcr |= ConXS_BCR_CF_RESET; - ConXS_BCR = trizeps_conxs_bcr; - udelay(1000); - /* switch power off */ - trizeps_conxs_bcr &= ~(0xf); - ConXS_BCR = trizeps_conxs_bcr; - - } - pr_debug("%s: o%s 0x%x\n", __FUNCTION__, power ? "n": "ff", trizeps_conxs_bcr); -} - -/* backlight power switching for LCD panel */ -static void board_backlight_power(int on) -{ - if (on) { - trizeps_conxs_bcr |= ConXS_BCR_L_DISP; - } else { - trizeps_conxs_bcr &= ~ConXS_BCR_L_DISP; - } - pr_debug("%s: o%s 0x%x\n", __FUNCTION__, on ? "n" : "ff", trizeps_conxs_bcr); - ConXS_BCR = trizeps_conxs_bcr; -} - -/* Powersupply for MMC/SD cardslot */ -static void board_mci_power(struct device *dev, unsigned int vdd) -{ - struct pxamci_platform_data* p_d = dev->platform_data; - - if (( 1 << vdd) & p_d->ocr_mask) { - pr_debug("%s: on\n", __FUNCTION__); - /* FIXME fill in values here */ - } else { - pr_debug("%s: off\n", __FUNCTION__); - /* FIXME fill in values here */ - } -} - -static short trizeps_conxs_ircr; - -/* Switch modes and Power for IRDA receiver */ -static void board_irda_mode(struct device *dev, int mode) -{ - unsigned long flags; - - local_irq_save(flags); - if (mode & IR_SIRMODE) { - /* Slow mode */ - trizeps_conxs_ircr &= ~ConXS_IRCR_MODE; - } else if (mode & IR_FIRMODE) { - /* Fast mode */ - trizeps_conxs_ircr |= ConXS_IRCR_MODE; - } - if (mode & IR_OFF) { - trizeps_conxs_ircr |= ConXS_IRCR_SD; - } else { - trizeps_conxs_ircr &= ~ConXS_IRCR_SD; - } - /* FIXME write values to register */ - local_irq_restore(flags); -} - -#else -/* for other baseboards define dummies */ -void board_pcmcia_power(int power) {;} -#define board_backlight_power NULL -#define board_mci_power NULL -#define board_irda_mode NULL - -#endif /* CONFIG_MACH_TRIZEPS4_CONXS */ -EXPORT_SYMBOL(board_pcmcia_power); - -static int trizeps4_mci_init(struct device *dev, irqreturn_t (*mci_detect_int)(int, void *, struct pt_regs *), void *data) -{ - int err; - /* setup GPIO for PXA27x MMC controller */ - pxa_gpio_mode(GPIO32_MMCCLK_MD); - pxa_gpio_mode(GPIO112_MMCCMD_MD); - pxa_gpio_mode(GPIO92_MMCDAT0_MD); - pxa_gpio_mode(GPIO109_MMCDAT1_MD); - pxa_gpio_mode(GPIO110_MMCDAT2_MD); - pxa_gpio_mode(GPIO111_MMCDAT3_MD); - - pxa_gpio_mode(GPIO_MMC_DET | GPIO_IN); - - err = request_irq(TRIZEPS4_MMC_IRQ, mci_detect_int, - IRQF_DISABLED | IRQF_TRIGGER_RISING, - "MMC card detect", data); - if (err) { - printk(KERN_ERR "trizeps4_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); - return -1; - } - return 0; -} - -static void trizeps4_mci_exit(struct device *dev, void *data) -{ - free_irq(TRIZEPS4_MMC_IRQ, data); -} - -static struct pxamci_platform_data trizeps4_mci_platform_data = { - .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, - .init = trizeps4_mci_init, - .exit = trizeps4_mci_exit, - .setpower = board_mci_power, -}; - -static struct pxaficp_platform_data trizeps4_ficp_platform_data = { - .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF, - .transceiver_mode = board_irda_mode, -}; - -static int trizeps4_ohci_init(struct device *dev) -{ - /* setup Port1 GPIO pin. */ - pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */ - pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */ - - /* Set the Power Control Polarity Low and Power Sense - Polarity Low to active low. */ - UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) & - ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE); - - return 0; -} - -static void trizeps4_ohci_exit(struct device *dev) -{ - ; -} - -static struct pxaohci_platform_data trizeps4_ohci_platform_data = { - .port_mode = PMM_PERPORT_MODE, - .init = trizeps4_ohci_init, - .exit = trizeps4_ohci_exit, -}; - -static struct map_desc trizeps4_io_desc[] __initdata = { - { /* ConXS CFSR */ - .virtual = TRIZEPS4_CFSR_VIRT, - .pfn = __phys_to_pfn(TRIZEPS4_CFSR_PHYS), - .length = 0x00001000, - .type = MT_DEVICE - }, - { /* ConXS BCR */ - .virtual = TRIZEPS4_BOCR_VIRT, - .pfn = __phys_to_pfn(TRIZEPS4_BOCR_PHYS), - .length = 0x00001000, - .type = MT_DEVICE - }, - { /* ConXS IRCR */ - .virtual = TRIZEPS4_IRCR_VIRT, - .pfn = __phys_to_pfn(TRIZEPS4_IRCR_PHYS), - .length = 0x00001000, - .type = MT_DEVICE - }, - { /* ConXS DCR */ - .virtual = TRIZEPS4_DICR_VIRT, - .pfn = __phys_to_pfn(TRIZEPS4_DICR_PHYS), - .length = 0x00001000, - .type = MT_DEVICE - }, - { /* ConXS UPSR */ - .virtual = TRIZEPS4_UPSR_VIRT, - .pfn = __phys_to_pfn(TRIZEPS4_UPSR_PHYS), - .length = 0x00001000, - .type = MT_DEVICE - } -}; - -static struct pxafb_mach_info sharp_lcd __initdata = { - .pixclock = 78000, - .xres = 640, - .yres = 480, - .bpp = 8, - .hsync_len = 4, - .left_margin = 4, - .right_margin = 4, - .vsync_len = 2, - .upper_margin = 0, - .lower_margin = 0, - .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, - .cmap_greyscale = 0, - .cmap_inverse = 0, - .cmap_static = 0, - .lccr0 = LCCR0_Color | LCCR0_Pas | LCCR0_Dual, - .lccr3 = 0x0340ff02, - .pxafb_backlight_power = board_backlight_power, -}; - -static void __init trizeps4_fixup(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) -{ -} - -static void __init trizeps4_init(void) -{ - platform_add_devices(trizeps4_devices, ARRAY_SIZE(trizeps4_devices)); - - set_pxa_fb_info(&sharp_lcd); - - pxa_set_mci_info(&trizeps4_mci_platform_data); - pxa_set_ficp_info(&trizeps4_ficp_platform_data); - pxa_set_ohci_info(&trizeps4_ohci_platform_data); -} - -static void __init trizeps4_map_io(void) -{ - pxa_map_io(); - iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc)); - - /* for DiskOnChip */ - pxa_gpio_mode(GPIO15_nCS_1_MD); - - /* for off-module PIC on ConXS board */ - pxa_gpio_mode(GPIO_PIC | GPIO_IN); - - /* UCB1400 irq */ - pxa_gpio_mode(GPIO_UCB1400 | GPIO_IN); - - /* for DM9000 LAN */ - pxa_gpio_mode(GPIO78_nCS_2_MD); - pxa_gpio_mode(GPIO_DM9000 | GPIO_IN); - - /* for PCMCIA device */ - pxa_gpio_mode(GPIO_PCD | GPIO_IN); - pxa_gpio_mode(GPIO_PRDY | GPIO_IN); - - /* for I2C adapter */ - pxa_gpio_mode(GPIO117_I2CSCL_MD); - pxa_gpio_mode(GPIO118_I2CSDA_MD); - - /* MMC_DET s.o. */ - pxa_gpio_mode(GPIO_MMC_DET | GPIO_IN); - - /* whats that for ??? */ - pxa_gpio_mode(GPIO79_nCS_3_MD); - - pxa_gpio_mode( GPIO_SYS_BUSY_LED | GPIO_OUT); /* LED1 */ - pxa_gpio_mode( GPIO_HEARTBEAT_LED | GPIO_OUT); /* LED2 */ - -#ifdef CONFIG_MACH_TRIZEPS4_CONXS -#ifdef CONFIG_IDE_PXA_CF - /* if boot direct from compact flash dont disable power */ - trizeps_conxs_bcr = 0x0009; -#else - /* this is the reset value */ - trizeps_conxs_bcr = 0x00A0; -#endif - ConXS_BCR = trizeps_conxs_bcr; -#endif - - PWER = 0x00000002; - PFER = 0x00000000; - PRER = 0x00000002; - PGSR0 = 0x0158C000; - PGSR1 = 0x00FF0080; - PGSR2 = 0x0001C004; - /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ - PCFR |= PCFR_OPDE; -} - -MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module") - /* MAINTAINER("Jürgen Schindele") */ - .phys_io = 0x40000000, - .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, - .boot_params = TRIZEPS4_SDRAM_BASE + 0x100, - .fixup = trizeps4_fixup, - .init_machine = trizeps4_init, - .map_io = trizeps4_map_io, - .init_irq = pxa_init_irq, - .timer = &pxa_timer, -MACHINE_END - diff --git a/trunk/arch/arm/mach-realview/core.c b/trunk/arch/arm/mach-realview/core.c index da0286973823..d13270c5d7cd 100644 --- a/trunk/arch/arm/mach-realview/core.c +++ b/trunk/arch/arm/mach-realview/core.c @@ -18,6 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -536,7 +537,7 @@ static irqreturn_t realview_timer_interrupt(int irq, void *dev_id, struct pt_reg static struct irqaction realview_timer_irq = { .name = "RealView Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = realview_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-realview/realview_eb.c b/trunk/arch/arm/mach-realview/realview_eb.c index 84a959530fb6..693fb1e396e0 100644 --- a/trunk/arch/arm/mach-realview/realview_eb.c +++ b/trunk/arch/arm/mach-realview/realview_eb.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-rpc/dma.c b/trunk/arch/arm/mach-rpc/dma.c index ac511d41d4d7..bd86ffba8810 100644 --- a/trunk/arch/arm/mach-rpc/dma.c +++ b/trunk/arch/arm/mach-rpc/dma.c @@ -128,7 +128,7 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id, struct pt_regs *regs) static int iomd_request_dma(dmach_t channel, dma_t *dma) { return request_irq(dma->dma_irq, iomd_dma_handle, - IRQF_DISABLED, dma->device_id, dma); + SA_INTERRUPT, dma->device_id, dma); } static void iomd_free_dma(dmach_t channel, dma_t *dma) diff --git a/trunk/arch/arm/mach-s3c2410/bast-irq.c b/trunk/arch/arm/mach-s3c2410/bast-irq.c index def4441d2442..fbbeb0553006 100644 --- a/trunk/arch/arm/mach-s3c2410/bast-irq.c +++ b/trunk/arch/arm/mach-s3c2410/bast-irq.c @@ -136,8 +136,8 @@ bast_irq_pc104_demux(unsigned int irq, for (i = 0; stat != 0; i++, stat >>= 1) { if (stat & 1) { irqno = bast_pc104_irqs[i]; - desc = irq_desc + irqno; - desc_handle_irq(irqno, desc, regs); + + desc_handle_irq(irqno, irq_desc + irqno, regs); } } } @@ -156,7 +156,7 @@ static __init int bast_irq_init(void) set_irq_chained_handler(IRQ_ISA, bast_irq_pc104_demux); - /* register our IRQs */ + /* reigster our IRQs */ for (i = 0; i < 4; i++) { unsigned int irqno = bast_pc104_irqs[i]; diff --git a/trunk/arch/arm/mach-s3c2410/devs.h b/trunk/arch/arm/mach-s3c2410/devs.h index 726e2eaf8797..fa124ed920e0 100644 --- a/trunk/arch/arm/mach-s3c2410/devs.h +++ b/trunk/arch/arm/mach-s3c2410/devs.h @@ -14,6 +14,7 @@ * 27-Aug-2004 BJD Added timers 0 through 3 * 10-Feb-2005 BJD Added camera from guillaume.gourat@nexvision.tv */ +#include #include struct s3c24xx_uart_resources { diff --git a/trunk/arch/arm/mach-s3c2410/dma.c b/trunk/arch/arm/mach-s3c2410/dma.c index 094cc52745c5..4dbd8e758ea6 100644 --- a/trunk/arch/arm/mach-s3c2410/dma.c +++ b/trunk/arch/arm/mach-s3c2410/dma.c @@ -31,6 +31,7 @@ * possible DMA function */ +#include #ifdef CONFIG_S3C2410_DMA_DEBUG #define DEBUG @@ -718,7 +719,7 @@ int s3c2410_dma_request(unsigned int channel, s3c2410_dma_client_t *client, pr_debug("dma%d: %s : requesting irq %d\n", channel, __FUNCTION__, chan->irq); - err = request_irq(chan->irq, s3c2410_dma_irq, IRQF_DISABLED, + err = request_irq(chan->irq, s3c2410_dma_irq, SA_INTERRUPT, client->name, (void *)chan); if (err) { diff --git a/trunk/arch/arm/mach-s3c2410/pm.c b/trunk/arch/arm/mach-s3c2410/pm.c index a589fe76d915..43e9a550a203 100644 --- a/trunk/arch/arm/mach-s3c2410/pm.c +++ b/trunk/arch/arm/mach-s3c2410/pm.c @@ -29,6 +29,7 @@ * 10-Mar-2005 LCVR Changed S3C2410_VA_UART to S3C24XX_VA_UART */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-s3c2410/sleep.S b/trunk/arch/arm/mach-s3c2410/sleep.S index a7561a79fc82..dc27167f4d59 100644 --- a/trunk/arch/arm/mach-s3c2410/sleep.S +++ b/trunk/arch/arm/mach-s3c2410/sleep.S @@ -24,6 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-s3c2410/time.c b/trunk/arch/arm/mach-s3c2410/time.c index 00d1cfca9712..9d7b799ea4a4 100644 --- a/trunk/arch/arm/mach-s3c2410/time.c +++ b/trunk/arch/arm/mach-s3c2410/time.c @@ -18,11 +18,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include #include -#include #include #include @@ -138,7 +138,7 @@ s3c2410_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction s3c2410_timer_irq = { .name = "S3C2410 Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = s3c2410_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-s3c2410/usb-simtec.c b/trunk/arch/arm/mach-s3c2410/usb-simtec.c index 6b22d8f0a00d..495f8c6ffcb6 100644 --- a/trunk/arch/arm/mach-s3c2410/usb-simtec.c +++ b/trunk/arch/arm/mach-s3c2410/usb-simtec.c @@ -85,8 +85,8 @@ static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on) if (on) { ret = request_irq(IRQ_USBOC, usb_simtec_ocirq, - IRQF_DISABLED | IRQF_TRIGGER_RISING | - IRQF_TRIGGER_FALLING, + SA_INTERRUPT | SA_TRIGGER_RISING | + SA_TRIGGER_FALLING, "USB Over-current", info); if (ret != 0) { printk(KERN_ERR "failed to request usb oc irq\n"); diff --git a/trunk/arch/arm/mach-sa1100/assabet.c b/trunk/arch/arm/mach-sa1100/assabet.c index be06d668a3c9..c58f12ba7a93 100644 --- a/trunk/arch/arm/mach-sa1100/assabet.c +++ b/trunk/arch/arm/mach-sa1100/assabet.c @@ -9,6 +9,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-sa1100/cerf.c b/trunk/arch/arm/mach-sa1100/cerf.c index 31afe50d7cd5..8269a9ef9afe 100644 --- a/trunk/arch/arm/mach-sa1100/cerf.c +++ b/trunk/arch/arm/mach-sa1100/cerf.c @@ -10,11 +10,11 @@ * Jan-2004 : Removed io map for flash [FB] */ +#include #include #include #include #include -#include #include #include diff --git a/trunk/arch/arm/mach-sa1100/collie.c b/trunk/arch/arm/mach-sa1100/collie.c index a6bab50dab61..676b5c5b75bb 100644 --- a/trunk/arch/arm/mach-sa1100/collie.c +++ b/trunk/arch/arm/mach-sa1100/collie.c @@ -17,6 +17,7 @@ * 04-16-2001 Lineo Japan,Inc. ... */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-sa1100/collie_pm.c b/trunk/arch/arm/mach-sa1100/collie_pm.c index 45b1e71f111d..696d7d29c8a5 100644 --- a/trunk/arch/arm/mach-sa1100/collie_pm.c +++ b/trunk/arch/arm/mach-sa1100/collie_pm.c @@ -45,12 +45,12 @@ static void collie_charger_init(void) } /* Register interrupt handler. */ - if ((err = request_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr, IRQF_DISABLED, + if ((err = request_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr, SA_INTERRUPT, "ACIN", sharpsl_ac_isr))) { printk("Could not get irq %d.\n", COLLIE_IRQ_GPIO_AC_IN); return; } - if ((err = request_irq(COLLIE_IRQ_GPIO_CO, sharpsl_chrg_full_isr, IRQF_DISABLED, + if ((err = request_irq(COLLIE_IRQ_GPIO_CO, sharpsl_chrg_full_isr, SA_INTERRUPT, "CO", sharpsl_chrg_full_isr))) { free_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr); printk("Could not get irq %d.\n", COLLIE_IRQ_GPIO_CO); diff --git a/trunk/arch/arm/mach-sa1100/cpu-sa1110.c b/trunk/arch/arm/mach-sa1100/cpu-sa1110.c index 639597729932..04c94ab6c18b 100644 --- a/trunk/arch/arm/mach-sa1100/cpu-sa1110.c +++ b/trunk/arch/arm/mach-sa1100/cpu-sa1110.c @@ -15,10 +15,7 @@ * SDRAM reads (rev A0, B0, B1) * * We ignore rev. A0 and B0 devices; I don't think they're worth supporting. - * - * The SDRAM type can be passed on the command line as cpu_sa1110.sdram=type */ -#include #include #include #include @@ -38,7 +35,6 @@ static struct cpufreq_driver sa1110_driver; struct sdram_params { - const char name[16]; u_char rows; /* bits */ u_char cas_latency; /* cycles */ u_char tck; /* clock cycle time (ns) */ @@ -54,53 +50,54 @@ struct sdram_info { u_int mdcas[3]; }; -static struct sdram_params sdram_tbl[] __initdata = { - { /* Toshiba TC59SM716 CL2 */ - .name = "TC59SM716-CL2", - .rows = 12, - .tck = 10, - .trcd = 20, - .trp = 20, - .twr = 10, - .refresh = 64000, - .cas_latency = 2, - }, { /* Toshiba TC59SM716 CL3 */ - .name = "TC59SM716-CL3", - .rows = 12, - .tck = 8, - .trcd = 20, - .trp = 20, - .twr = 8, - .refresh = 64000, - .cas_latency = 3, - }, { /* Samsung K4S641632D TC75 */ - .name = "K4S641632D", - .rows = 14, - .tck = 9, - .trcd = 27, - .trp = 20, - .twr = 9, - .refresh = 64000, - .cas_latency = 3, - }, { /* Samsung KM416S4030CT */ - .name = "KM416S4030CT", - .rows = 13, - .tck = 8, - .trcd = 24, /* 3 CLKs */ - .trp = 24, /* 3 CLKs */ - .twr = 16, /* Trdl: 2 CLKs */ - .refresh = 64000, - .cas_latency = 3, - }, { /* Winbond W982516AH75L CL3 */ - .name = "W982516AH75L", - .rows = 16, - .tck = 8, - .trcd = 20, - .trp = 20, - .twr = 8, - .refresh = 64000, - .cas_latency = 3, - }, +static struct sdram_params tc59sm716_cl2_params __initdata = { + .rows = 12, + .tck = 10, + .trcd = 20, + .trp = 20, + .twr = 10, + .refresh = 64000, + .cas_latency = 2, +}; + +static struct sdram_params tc59sm716_cl3_params __initdata = { + .rows = 12, + .tck = 8, + .trcd = 20, + .trp = 20, + .twr = 8, + .refresh = 64000, + .cas_latency = 3, +}; + +static struct sdram_params samsung_k4s641632d_tc75 __initdata = { + .rows = 14, + .tck = 9, + .trcd = 27, + .trp = 20, + .twr = 9, + .refresh = 64000, + .cas_latency = 3, +}; + +static struct sdram_params samsung_km416s4030ct __initdata = { + .rows = 13, + .tck = 8, + .trcd = 24, /* 3 CLKs */ + .trp = 24, /* 3 CLKs */ + .twr = 16, /* Trdl: 2 CLKs */ + .refresh = 64000, + .cas_latency = 3, +}; + +static struct sdram_params wbond_w982516ah75l_cl3_params __initdata = { + .rows = 16, + .tck = 8, + .trcd = 20, + .trp = 20, + .twr = 8, + .refresh = 64000, + .cas_latency = 3, }; static struct sdram_params sdram_params; @@ -339,36 +336,19 @@ static struct cpufreq_driver sa1110_driver = { .name = "sa1110", }; -static struct sdram_params *sa1110_find_sdram(const char *name) -{ - struct sdram_params *sdram; - - for (sdram = sdram_tbl; sdram < sdram_tbl + ARRAY_SIZE(sdram_tbl); sdram++) - if (strcmp(name, sdram->name) == 0) - return sdram; - - return NULL; -} - -static char sdram_name[16]; - static int __init sa1110_clk_init(void) { - struct sdram_params *sdram; - const char *name = sdram_name; + struct sdram_params *sdram = NULL; - if (!name[0]) { - if (machine_is_assabet()) - name = "TC59SM716-CL3"; + if (machine_is_assabet()) + sdram = &tc59sm716_cl3_params; - if (machine_is_pt_system3()) - name = "K4S641632D"; + if (machine_is_pt_system3()) + sdram = &samsung_k4s641632d_tc75; - if (machine_is_h3100()) - name = "KM416S4030CT"; - } + if (machine_is_h3100()) + sdram = &samsung_km416s4030ct; - sdram = sa1110_find_sdram(name); if (sdram) { printk(KERN_DEBUG "SDRAM: tck: %d trcd: %d trp: %d" " twr: %d refresh: %d cas_latency: %d\n", @@ -383,5 +363,4 @@ static int __init sa1110_clk_init(void) return 0; } -module_param_string(sdram, sdram_name, sizeof(sdram_name), 0); arch_initcall(sa1110_clk_init); diff --git a/trunk/arch/arm/mach-sa1100/dma.c b/trunk/arch/arm/mach-sa1100/dma.c index 3c6441d4bc59..be0e4427bec7 100644 --- a/trunk/arch/arm/mach-sa1100/dma.c +++ b/trunk/arch/arm/mach-sa1100/dma.c @@ -124,7 +124,7 @@ int sa1100_request_dma (dma_device_t device, const char *device_id, i = dma - dma_chan; regs = (dma_regs_t *)&DDAR(i); - err = request_irq(IRQ_DMA0 + i, dma_irq_handler, IRQF_DISABLED, + err = request_irq(IRQ_DMA0 + i, dma_irq_handler, SA_INTERRUPT, device_id, regs); if (err) { printk(KERN_ERR diff --git a/trunk/arch/arm/mach-sa1100/generic.c b/trunk/arch/arm/mach-sa1100/generic.c index 4575f316e141..9ea71551fc04 100644 --- a/trunk/arch/arm/mach-sa1100/generic.c +++ b/trunk/arch/arm/mach-sa1100/generic.c @@ -9,6 +9,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-sa1100/h3600.c b/trunk/arch/arm/mach-sa1100/h3600.c index 7364478cec12..b04d92271020 100644 --- a/trunk/arch/arm/mach-sa1100/h3600.c +++ b/trunk/arch/arm/mach-sa1100/h3600.c @@ -19,6 +19,7 @@ * and abstracted EGPIO interface. * */ +#include #include #include #include @@ -740,7 +741,7 @@ static void h3800_IRQ_demux(unsigned int irq, struct irqdesc *desc, struct pt_re static struct irqaction h3800_irq = { .name = "h3800_asic", .handler = h3800_IRQ_demux, - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, }; u32 kpio_int_shadow = 0; @@ -835,7 +836,7 @@ static void __init h3800_init_irq(void) } #endif set_irq_type(IRQ_GPIO_H3800_ASIC, IRQT_RISING); - set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, h3800_IRQ_demux); + set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, &h3800_IRQ_demux); } diff --git a/trunk/arch/arm/mach-sa1100/irq.c b/trunk/arch/arm/mach-sa1100/irq.c index 2891b8ca86dd..b3a56024182e 100644 --- a/trunk/arch/arm/mach-sa1100/irq.c +++ b/trunk/arch/arm/mach-sa1100/irq.c @@ -11,13 +11,12 @@ */ #include #include -#include -#include #include #include #include #include +#include #include #include "generic.h" diff --git a/trunk/arch/arm/mach-sa1100/leds-assabet.c b/trunk/arch/arm/mach-sa1100/leds-assabet.c index ee9788989875..e9aa9dff211a 100644 --- a/trunk/arch/arm/mach-sa1100/leds-assabet.c +++ b/trunk/arch/arm/mach-sa1100/leds-assabet.c @@ -9,6 +9,7 @@ * - Green - toggles state every 50 timer interrupts * - Red - on if system is not idle */ +#include #include #include diff --git a/trunk/arch/arm/mach-sa1100/leds-badge4.c b/trunk/arch/arm/mach-sa1100/leds-badge4.c index 280929be972d..0a8f87bb6c4f 100644 --- a/trunk/arch/arm/mach-sa1100/leds-badge4.c +++ b/trunk/arch/arm/mach-sa1100/leds-badge4.c @@ -10,6 +10,7 @@ * */ +#include #include #include diff --git a/trunk/arch/arm/mach-sa1100/leds-cerf.c b/trunk/arch/arm/mach-sa1100/leds-cerf.c index f38eeddbef10..f6635a2d0e83 100644 --- a/trunk/arch/arm/mach-sa1100/leds-cerf.c +++ b/trunk/arch/arm/mach-sa1100/leds-cerf.c @@ -3,6 +3,7 @@ * * Author: ??? */ +#include #include #include diff --git a/trunk/arch/arm/mach-sa1100/leds-hackkit.c b/trunk/arch/arm/mach-sa1100/leds-hackkit.c index 7e91cc90b5ae..2e5fa14aa4eb 100644 --- a/trunk/arch/arm/mach-sa1100/leds-hackkit.c +++ b/trunk/arch/arm/mach-sa1100/leds-hackkit.c @@ -9,6 +9,7 @@ * The HackKit has two leds (GPIO 22/23). The red led (gpio 22) is used * as cpu led, the green one is used as timer led. */ +#include #include #include diff --git a/trunk/arch/arm/mach-sa1100/leds-lart.c b/trunk/arch/arm/mach-sa1100/leds-lart.c index 2d27d76cfc6b..187501490713 100644 --- a/trunk/arch/arm/mach-sa1100/leds-lart.c +++ b/trunk/arch/arm/mach-sa1100/leds-lart.c @@ -9,6 +9,7 @@ * time, but in that case the timer events will still dictate the * pace of the LED. */ +#include #include #include diff --git a/trunk/arch/arm/mach-sa1100/leds-simpad.c b/trunk/arch/arm/mach-sa1100/leds-simpad.c index def090a87385..6a27a2d32206 100644 --- a/trunk/arch/arm/mach-sa1100/leds-simpad.c +++ b/trunk/arch/arm/mach-sa1100/leds-simpad.c @@ -3,6 +3,7 @@ * * Author: Juergen Messerer */ +#include #include #include diff --git a/trunk/arch/arm/mach-sa1100/pleb.c b/trunk/arch/arm/mach-sa1100/pleb.c index c7bf7e0038f0..0709ebab531c 100644 --- a/trunk/arch/arm/mach-sa1100/pleb.c +++ b/trunk/arch/arm/mach-sa1100/pleb.c @@ -7,7 +7,6 @@ #include #include #include -#include #include diff --git a/trunk/arch/arm/mach-sa1100/shannon.c b/trunk/arch/arm/mach-sa1100/shannon.c index 8acab7b1e4c2..5aafe0b56992 100644 --- a/trunk/arch/arm/mach-sa1100/shannon.c +++ b/trunk/arch/arm/mach-sa1100/shannon.c @@ -2,6 +2,7 @@ * linux/arch/arm/mach-sa1100/shannon.c */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-sa1100/simpad.c b/trunk/arch/arm/mach-sa1100/simpad.c index a9ae1b581aa6..d2c23b2c34d1 100644 --- a/trunk/arch/arm/mach-sa1100/simpad.c +++ b/trunk/arch/arm/mach-sa1100/simpad.c @@ -2,6 +2,7 @@ * linux/arch/arm/mach-sa1100/simpad.c */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-sa1100/time.c b/trunk/arch/arm/mach-sa1100/time.c index 49ae716e16c2..e4b435e634e4 100644 --- a/trunk/arch/arm/mach-sa1100/time.c +++ b/trunk/arch/arm/mach-sa1100/time.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -111,7 +110,7 @@ sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction sa1100_timer_irq = { .name = "SA11xx Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = sa1100_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-shark/core.c b/trunk/arch/arm/mach-shark/core.c index 1095df34fec0..877600e212dd 100644 --- a/trunk/arch/arm/mach-shark/core.c +++ b/trunk/arch/arm/mach-shark/core.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include @@ -90,7 +89,7 @@ shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction shark_timer_irq = { .name = "Shark Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = shark_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-shark/dma.c b/trunk/arch/arm/mach-shark/dma.c index 6774b8d5d13d..835989a02918 100644 --- a/trunk/arch/arm/mach-shark/dma.c +++ b/trunk/arch/arm/mach-shark/dma.c @@ -8,6 +8,7 @@ * Copyright (C) 1998 Phil Blundell */ +#include #include #include diff --git a/trunk/arch/arm/mach-shark/leds.c b/trunk/arch/arm/mach-shark/leds.c index 7cd86d357a3c..7bdeb70a0c10 100644 --- a/trunk/arch/arm/mach-shark/leds.c +++ b/trunk/arch/arm/mach-shark/leds.c @@ -15,6 +15,7 @@ * * Changelog: */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-versatile/core.c b/trunk/arch/arm/mach-versatile/core.c index a432539cc1bd..cebd48a3dae4 100644 --- a/trunk/arch/arm/mach-versatile/core.c +++ b/trunk/arch/arm/mach-versatile/core.c @@ -18,6 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -869,7 +870,7 @@ static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_re static struct irqaction versatile_timer_irq = { .name = "Versatile Timer Tick", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = versatile_timer_interrupt, }; diff --git a/trunk/arch/arm/mach-versatile/pci.c b/trunk/arch/arm/mach-versatile/pci.c index 41b370090b60..722fbabc9cfb 100644 --- a/trunk/arch/arm/mach-versatile/pci.c +++ b/trunk/arch/arm/mach-versatile/pci.c @@ -14,6 +14,7 @@ * 14/04/2005 Initial version, colin.king@philips.com * */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-versatile/versatile_ab.c b/trunk/arch/arm/mach-versatile/versatile_ab.c index b257ef78ef45..1eb596782078 100644 --- a/trunk/arch/arm/mach-versatile/versatile_ab.c +++ b/trunk/arch/arm/mach-versatile/versatile_ab.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mach-versatile/versatile_pb.c b/trunk/arch/arm/mach-versatile/versatile_pb.c index 503725b166fc..f17ab4fb548a 100644 --- a/trunk/arch/arm/mach-versatile/versatile_pb.c +++ b/trunk/arch/arm/mach-versatile/versatile_pb.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/mm/Kconfig b/trunk/arch/arm/mm/Kconfig index 5f80f184cd32..c4bca753165b 100644 --- a/trunk/arch/arm/mm/Kconfig +++ b/trunk/arch/arm/mm/Kconfig @@ -121,8 +121,8 @@ config CPU_ARM925T # ARM926T config CPU_ARM926T bool "Support ARM926T processor" - depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 - default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 + depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 + default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 select CPU_32v5 select CPU_ABRT_EV5TJ select CPU_CACHE_VIVT diff --git a/trunk/arch/arm/mm/alignment.c b/trunk/arch/arm/mm/alignment.c index e0d21bbbe7d7..705c98921c37 100644 --- a/trunk/arch/arm/mm/alignment.c +++ b/trunk/arch/arm/mm/alignment.c @@ -11,6 +11,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mm/cache-v4wb.S b/trunk/arch/arm/mm/cache-v4wb.S index 2ebc1b3bf856..54e3c5bb5186 100644 --- a/trunk/arch/arm/mm/cache-v4wb.S +++ b/trunk/arch/arm/mm/cache-v4wb.S @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mm/fault.c b/trunk/arch/arm/mm/fault.c index c5e0622c7765..4a884baf3b9c 100644 --- a/trunk/arch/arm/mm/fault.c +++ b/trunk/arch/arm/mm/fault.c @@ -8,6 +8,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mm/init.c b/trunk/arch/arm/mm/init.c index fe3f7f625008..989fd681c822 100644 --- a/trunk/arch/arm/mm/init.c +++ b/trunk/arch/arm/mm/init.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/mm/ioremap.c b/trunk/arch/arm/mm/ioremap.c index dba7dddfe57d..7691cfdba567 100644 --- a/trunk/arch/arm/mm/ioremap.c +++ b/trunk/arch/arm/mm/ioremap.c @@ -27,16 +27,7 @@ #include #include -#include -#include #include -#include - -/* - * Used by ioremap() and iounmap() code to mark (super)section-mapped - * I/O regions in vm_struct->flags field. - */ -#define VM_ARM_SECTION_MAPPING 0x80000000 static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, @@ -122,168 +113,10 @@ remap_area_pages(unsigned long start, unsigned long pfn, dir++; } while (address && (address < end)); + flush_cache_vmap(start, end); return err; } - -void __check_kvm_seq(struct mm_struct *mm) -{ - unsigned int seq; - - do { - seq = init_mm.context.kvm_seq; - memcpy(pgd_offset(mm, VMALLOC_START), - pgd_offset_k(VMALLOC_START), - sizeof(pgd_t) * (pgd_index(VMALLOC_END) - - pgd_index(VMALLOC_START))); - mm->context.kvm_seq = seq; - } while (seq != init_mm.context.kvm_seq); -} - -#ifndef CONFIG_SMP -/* - * Section support is unsafe on SMP - If you iounmap and ioremap a region, - * the other CPUs will not see this change until their next context switch. - * Meanwhile, (eg) if an interrupt comes in on one of those other CPUs - * which requires the new ioremap'd region to be referenced, the CPU will - * reference the _old_ region. - * - * Note that get_vm_area() allocates a guard 4K page, so we need to mask - * the size back to 1MB aligned or we will overflow in the loop below. - */ -static void unmap_area_sections(unsigned long virt, unsigned long size) -{ - unsigned long addr = virt, end = virt + (size & ~SZ_1M); - pgd_t *pgd; - - flush_cache_vunmap(addr, end); - pgd = pgd_offset_k(addr); - do { - pmd_t pmd, *pmdp = pmd_offset(pgd, addr); - - pmd = *pmdp; - if (!pmd_none(pmd)) { - /* - * Clear the PMD from the page table, and - * increment the kvm sequence so others - * notice this change. - * - * Note: this is still racy on SMP machines. - */ - pmd_clear(pmdp); - init_mm.context.kvm_seq++; - - /* - * Free the page table, if there was one. - */ - if ((pmd_val(pmd) & PMD_TYPE_MASK) == PMD_TYPE_TABLE) - pte_free_kernel(pmd_page_kernel(pmd)); - } - - addr += PGDIR_SIZE; - pgd++; - } while (addr < end); - - /* - * Ensure that the active_mm is up to date - we want to - * catch any use-after-iounmap cases. - */ - if (current->active_mm->context.kvm_seq != init_mm.context.kvm_seq) - __check_kvm_seq(current->active_mm); - - flush_tlb_kernel_range(virt, end); -} - -static int -remap_area_sections(unsigned long virt, unsigned long pfn, - unsigned long size, unsigned long flags) -{ - unsigned long prot, addr = virt, end = virt + size; - pgd_t *pgd; - - /* - * Remove and free any PTE-based mapping, and - * sync the current kernel mapping. - */ - unmap_area_sections(virt, size); - - prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO) | - (flags & (L_PTE_CACHEABLE | L_PTE_BUFFERABLE)); - - /* - * ARMv6 and above need XN set to prevent speculative prefetches - * hitting IO. - */ - if (cpu_architecture() >= CPU_ARCH_ARMv6) - prot |= PMD_SECT_XN; - - pgd = pgd_offset_k(addr); - do { - pmd_t *pmd = pmd_offset(pgd, addr); - - pmd[0] = __pmd(__pfn_to_phys(pfn) | prot); - pfn += SZ_1M >> PAGE_SHIFT; - pmd[1] = __pmd(__pfn_to_phys(pfn) | prot); - pfn += SZ_1M >> PAGE_SHIFT; - flush_pmd_entry(pmd); - - addr += PGDIR_SIZE; - pgd++; - } while (addr < end); - - return 0; -} - -static int -remap_area_supersections(unsigned long virt, unsigned long pfn, - unsigned long size, unsigned long flags) -{ - unsigned long prot, addr = virt, end = virt + size; - pgd_t *pgd; - - /* - * Remove and free any PTE-based mapping, and - * sync the current kernel mapping. - */ - unmap_area_sections(virt, size); - - prot = PMD_TYPE_SECT | PMD_SECT_SUPER | PMD_SECT_AP_WRITE | - PMD_DOMAIN(DOMAIN_IO) | - (flags & (L_PTE_CACHEABLE | L_PTE_BUFFERABLE)); - - /* - * ARMv6 and above need XN set to prevent speculative prefetches - * hitting IO. - */ - if (cpu_architecture() >= CPU_ARCH_ARMv6) - prot |= PMD_SECT_XN; - - pgd = pgd_offset_k(virt); - do { - unsigned long super_pmd_val, i; - - super_pmd_val = __pfn_to_phys(pfn) | prot; - super_pmd_val |= ((pfn >> (32 - PAGE_SHIFT)) & 0xf) << 20; - - for (i = 0; i < 8; i++) { - pmd_t *pmd = pmd_offset(pgd, addr); - - pmd[0] = __pmd(super_pmd_val); - pmd[1] = __pmd(super_pmd_val); - flush_pmd_entry(pmd); - - addr += PGDIR_SIZE; - pgd++; - } - - pfn += SUPERSECTION_SIZE >> PAGE_SHIFT; - } while (addr < end); - - return 0; -} -#endif - - /* * Remap an arbitrary physical address space into the kernel virtual * address space. Needed when the kernel wants to access high addresses @@ -300,41 +133,18 @@ void __iomem * __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, unsigned long flags) { - int err; unsigned long addr; struct vm_struct * area; - /* - * High mappings must be supersection aligned - */ - if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK)) - return NULL; - area = get_vm_area(size, VM_IOREMAP); if (!area) return NULL; addr = (unsigned long)area->addr; - -#ifndef CONFIG_SMP - if ((((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) || - cpu_is_xsc3()) && - !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) { - area->flags |= VM_ARM_SECTION_MAPPING; - err = remap_area_supersections(addr, pfn, size, flags); - } else if (!((__pfn_to_phys(pfn) | size | addr) & ~PMD_MASK)) { - area->flags |= VM_ARM_SECTION_MAPPING; - err = remap_area_sections(addr, pfn, size, flags); - } else -#endif - err = remap_area_pages(addr, pfn, size, flags); - - if (err) { + if (remap_area_pages(addr, pfn, size, flags)) { vunmap((void *)addr); return NULL; } - - flush_cache_vmap(addr, addr + size); - return (void __iomem *) (offset + addr); + return (void __iomem *) (offset + (char *)addr); } EXPORT_SYMBOL(__ioremap_pfn); @@ -363,36 +173,6 @@ EXPORT_SYMBOL(__ioremap); void __iounmap(void __iomem *addr) { - struct vm_struct **p, *tmp; - unsigned int section_mapping = 0; - - addr = (void __iomem *)(PAGE_MASK & (unsigned long)addr); - -#ifndef CONFIG_SMP - /* - * If this is a section based mapping we need to handle it - * specially as the VM subysystem does not know how to handle - * such a beast. We need the lock here b/c we need to clear - * all the mappings before the area can be reclaimed - * by someone else. - */ - write_lock(&vmlist_lock); - for (p = &vmlist ; (tmp = *p) ; p = &tmp->next) { - if((tmp->flags & VM_IOREMAP) && (tmp->addr == addr)) { - if (tmp->flags & VM_ARM_SECTION_MAPPING) { - *p = tmp->next; - unmap_area_sections((unsigned long)tmp->addr, - tmp->size); - kfree(tmp); - section_mapping = 1; - } - break; - } - } - write_unlock(&vmlist_lock); -#endif - - if (!section_mapping) - vunmap(addr); + vunmap((void *)(PAGE_MASK & (unsigned long)addr)); } EXPORT_SYMBOL(__iounmap); diff --git a/trunk/arch/arm/mm/mm-armv.c b/trunk/arch/arm/mm/mm-armv.c index 38769f5862bc..95273de4f772 100644 --- a/trunk/arch/arm/mm/mm-armv.c +++ b/trunk/arch/arm/mm/mm-armv.c @@ -9,6 +9,7 @@ * * Page table sludge for ARM v3 and v4 processor architectures. */ +#include #include #include #include @@ -226,7 +227,7 @@ void free_pgd_slow(pgd_t *pgd) pte = pmd_page(*pmd); pmd_clear(pmd); - dec_zone_page_state(virt_to_page((unsigned long *)pgd), NR_PAGETABLE); + dec_page_state(nr_page_table_pages); pte_lock_deinit(pte); pte_free(pte); pmd_free(pmd); @@ -302,16 +303,16 @@ static struct mem_types mem_types[] __initdata = { .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE, .prot_l1 = PMD_TYPE_TABLE, - .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_UNCACHED | + .prot_sect = PMD_TYPE_SECT | PMD_SECT_UNCACHED | PMD_SECT_AP_WRITE, .domain = DOMAIN_IO, }, [MT_CACHECLEAN] = { - .prot_sect = PMD_TYPE_SECT | PMD_BIT4, + .prot_sect = PMD_TYPE_SECT, .domain = DOMAIN_KERNEL, }, [MT_MINICLEAN] = { - .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_MINICACHE, + .prot_sect = PMD_TYPE_SECT | PMD_SECT_MINICACHE, .domain = DOMAIN_KERNEL, }, [MT_LOW_VECTORS] = { @@ -327,25 +328,25 @@ static struct mem_types mem_types[] __initdata = { .domain = DOMAIN_USER, }, [MT_MEMORY] = { - .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_AP_WRITE, + .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, .domain = DOMAIN_KERNEL, }, [MT_ROM] = { - .prot_sect = PMD_TYPE_SECT | PMD_BIT4, + .prot_sect = PMD_TYPE_SECT, .domain = DOMAIN_KERNEL, }, [MT_IXP2000_DEVICE] = { /* IXP2400 requires XCB=101 for on-chip I/O */ .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE, .prot_l1 = PMD_TYPE_TABLE, - .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_UNCACHED | + .prot_sect = PMD_TYPE_SECT | PMD_SECT_UNCACHED | PMD_SECT_AP_WRITE | PMD_SECT_BUFFERABLE | PMD_SECT_TEX(1), .domain = DOMAIN_IO, }, [MT_NONSHARED_DEVICE] = { .prot_l1 = PMD_TYPE_TABLE, - .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_NONSHARED_DEV | + .prot_sect = PMD_TYPE_SECT | PMD_SECT_NONSHARED_DEV | PMD_SECT_AP_WRITE, .domain = DOMAIN_IO, } @@ -375,21 +376,14 @@ void __init build_mem_type_table(void) ecc_mask = 0; } - /* - * Xscale must not have PMD bit 4 set for section mappings. - */ - if (cpu_is_xscale()) - for (i = 0; i < ARRAY_SIZE(mem_types); i++) - mem_types[i].prot_sect &= ~PMD_BIT4; - - /* - * ARMv5 and lower, excluding Xscale, bit 4 must be set for - * page tables. - */ - if (cpu_arch < CPU_ARCH_ARMv6 && !cpu_is_xscale()) - for (i = 0; i < ARRAY_SIZE(mem_types); i++) + if (cpu_arch <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) { + for (i = 0; i < ARRAY_SIZE(mem_types); i++) { if (mem_types[i].prot_l1) mem_types[i].prot_l1 |= PMD_BIT4; + if (mem_types[i].prot_sect) + mem_types[i].prot_sect |= PMD_BIT4; + } + } cp = &cache_policies[cachepolicy]; kern_pgprot = user_pgprot = cp->pte; @@ -413,8 +407,8 @@ void __init build_mem_type_table(void) * bit 4 becomes XN which we must clear for the * kernel memory mapping. */ - mem_types[MT_MEMORY].prot_sect &= ~PMD_SECT_XN; - mem_types[MT_ROM].prot_sect &= ~PMD_SECT_XN; + mem_types[MT_MEMORY].prot_sect &= ~PMD_BIT4; + mem_types[MT_ROM].prot_sect &= ~PMD_BIT4; /* * Mark cache clean areas and XIP ROM read only diff --git a/trunk/arch/arm/mm/mmap.c b/trunk/arch/arm/mm/mmap.c index 29e54807c5bc..3de7f84b53c2 100644 --- a/trunk/arch/arm/mm/mmap.c +++ b/trunk/arch/arm/mm/mmap.c @@ -1,6 +1,7 @@ /* * linux/arch/arm/mm/mmap.c */ +#include #include #include #include diff --git a/trunk/arch/arm/mm/proc-arm1020.S b/trunk/arch/arm/mm/proc-arm1020.S index 1d8316f3cecf..b9abbafca812 100644 --- a/trunk/arch/arm/mm/proc-arm1020.S +++ b/trunk/arch/arm/mm/proc-arm1020.S @@ -26,6 +26,7 @@ * CONFIG_CPU_ARM1020_CPU_IDLE -> nohlt */ #include +#include #include #include #include @@ -34,8 +35,6 @@ #include #include -#include "proc-macros.S" - /* * This is the maximum size of an area which will be invalidated * using the single invalidate entry instructions. Anything larger @@ -441,12 +440,11 @@ __arm1020_setup: #ifdef CONFIG_MMU mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 #endif - - adr r5, arm1020_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, arm1020_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, arm1020_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN orr r0, r0, #0x4000 @ .R.. .... .... .... #endif @@ -458,9 +456,12 @@ __arm1020_setup: * .RVI ZFRS BLDP WCAM * .011 1001 ..11 0101 */ - .type arm1020_crval, #object -arm1020_crval: - crval clear=0x0000593f, mmuset=0x00003935, ucset=0x00001930 + .type arm1020_cr1_clear, #object + .type arm1020_cr1_set, #object +arm1020_cr1_clear: + .word 0x593f +arm1020_cr1_set: + .word 0x3935 __INITDATA @@ -523,9 +524,6 @@ cpu_arm1020_name: __arm1020_proc_info: .long 0x4104a200 @ ARM 1020T (Architecture v5T) .long 0xff0ffff0 - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ .long PMD_TYPE_SECT | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ diff --git a/trunk/arch/arm/mm/proc-arm1020e.S b/trunk/arch/arm/mm/proc-arm1020e.S index 89b1d6d3d7c0..bcd5ee022e00 100644 --- a/trunk/arch/arm/mm/proc-arm1020e.S +++ b/trunk/arch/arm/mm/proc-arm1020e.S @@ -26,6 +26,7 @@ * CONFIG_CPU_ARM1020_CPU_IDLE -> nohlt */ #include +#include #include #include #include @@ -34,8 +35,6 @@ #include #include -#include "proc-macros.S" - /* * This is the maximum size of an area which will be invalidated * using the single invalidate entry instructions. Anything larger @@ -423,11 +422,11 @@ __arm1020e_setup: #ifdef CONFIG_MMU mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 #endif - adr r5, arm1020e_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, arm1020e_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, arm1020e_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN orr r0, r0, #0x4000 @ .R.. .... .... .... #endif @@ -439,9 +438,12 @@ __arm1020e_setup: * .RVI ZFRS BLDP WCAM * .011 1001 ..11 0101 */ - .type arm1020e_crval, #object -arm1020e_crval: - crval clear=0x00007f3f, mmuset=0x00003935, ucset=0x00001930 + .type arm1020e_cr1_clear, #object + .type arm1020e_cr1_set, #object +arm1020e_cr1_clear: + .word 0x5f3f +arm1020e_cr1_set: + .word 0x3935 __INITDATA @@ -475,7 +477,25 @@ cpu_elf_name: .type cpu_arm1020e_name, #object cpu_arm1020e_name: - .asciz "ARM1020E" + .ascii "ARM1020E" +#ifndef CONFIG_CPU_ICACHE_DISABLE + .ascii "i" +#endif +#ifndef CONFIG_CPU_DCACHE_DISABLE + .ascii "d" +#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH + .ascii "(wt)" +#else + .ascii "(wb)" +#endif +#endif +#ifndef CONFIG_CPU_BPREDICT_DISABLE + .ascii "B" +#endif +#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN + .ascii "RR" +#endif + .ascii "\0" .size cpu_arm1020e_name, . - cpu_arm1020e_name .align @@ -486,10 +506,6 @@ cpu_arm1020e_name: __arm1020e_proc_info: .long 0x4105a200 @ ARM 1020TE (Architecture v5TE) .long 0xff0ffff0 - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ .long PMD_TYPE_SECT | \ PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ diff --git a/trunk/arch/arm/mm/proc-arm1022.S b/trunk/arch/arm/mm/proc-arm1022.S index a089528e6bce..b0ccff4fadd2 100644 --- a/trunk/arch/arm/mm/proc-arm1022.S +++ b/trunk/arch/arm/mm/proc-arm1022.S @@ -15,6 +15,7 @@ * functions on the ARM1022E. */ #include +#include #include #include #include @@ -23,8 +24,6 @@ #include #include -#include "proc-macros.S" - /* * This is the maximum size of an area which will be invalidated * using the single invalidate entry instructions. Anything larger @@ -405,11 +404,11 @@ __arm1022_setup: #ifdef CONFIG_MMU mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 #endif - adr r5, arm1022_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, arm1022_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, arm1022_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN orr r0, r0, #0x4000 @ .R.............. #endif @@ -422,9 +421,12 @@ __arm1022_setup: * .011 1001 ..11 0101 * */ - .type arm1022_crval, #object -arm1022_crval: - crval clear=0x00007f3f, mmuset=0x00003935, ucset=0x00001930 + .type arm1022_cr1_clear, #object + .type arm1022_cr1_set, #object +arm1022_cr1_clear: + .word 0x7f3f +arm1022_cr1_set: + .word 0x3935 __INITDATA @@ -458,7 +460,25 @@ cpu_elf_name: .type cpu_arm1022_name, #object cpu_arm1022_name: - .asciz "ARM1022" + .ascii "arm1022" +#ifndef CONFIG_CPU_ICACHE_DISABLE + .ascii "i" +#endif +#ifndef CONFIG_CPU_DCACHE_DISABLE + .ascii "d" +#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH + .ascii "(wt)" +#else + .ascii "(wb)" +#endif +#endif +#ifndef CONFIG_CPU_BPREDICT_DISABLE + .ascii "B" +#endif +#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN + .ascii "RR" +#endif + .ascii "\0" .size cpu_arm1022_name, . - cpu_arm1022_name .align @@ -469,10 +489,6 @@ cpu_arm1022_name: __arm1022_proc_info: .long 0x4105a220 @ ARM 1022E (v5TE) .long 0xff0ffff0 - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ .long PMD_TYPE_SECT | \ PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ diff --git a/trunk/arch/arm/mm/proc-arm1026.S b/trunk/arch/arm/mm/proc-arm1026.S index d6d84d92c7c7..abe850c9a641 100644 --- a/trunk/arch/arm/mm/proc-arm1026.S +++ b/trunk/arch/arm/mm/proc-arm1026.S @@ -15,6 +15,7 @@ * functions on the ARM1026EJ-S. */ #include +#include #include #include #include @@ -23,8 +24,6 @@ #include #include -#include "proc-macros.S" - /* * This is the maximum size of an area which will be invalidated * using the single invalidate entry instructions. Anything larger @@ -400,11 +399,11 @@ __arm1026_setup: mov r0, #4 @ explicitly disable writeback mcr p15, 7, r0, c15, c0, 0 #endif - adr r5, arm1026_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, arm1026_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, arm1026_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN orr r0, r0, #0x4000 @ .R.. .... .... .... #endif @@ -417,9 +416,12 @@ __arm1026_setup: * .011 1001 ..11 0101 * */ - .type arm1026_crval, #object -arm1026_crval: - crval clear=0x00007f3f, mmuset=0x00003935, ucset=0x00001934 + .type arm1026_cr1_clear, #object + .type arm1026_cr1_set, #object +arm1026_cr1_clear: + .word 0x7f3f +arm1026_cr1_set: + .word 0x3935 __INITDATA @@ -454,7 +456,25 @@ cpu_elf_name: .type cpu_arm1026_name, #object cpu_arm1026_name: - .asciz "ARM1026EJ-S" + .ascii "ARM1026EJ-S" +#ifndef CONFIG_CPU_ICACHE_DISABLE + .ascii "i" +#endif +#ifndef CONFIG_CPU_DCACHE_DISABLE + .ascii "d" +#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH + .ascii "(wt)" +#else + .ascii "(wb)" +#endif +#endif +#ifndef CONFIG_CPU_BPREDICT_DISABLE + .ascii "B" +#endif +#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN + .ascii "RR" +#endif + .ascii "\0" .size cpu_arm1026_name, . - cpu_arm1026_name .align @@ -465,10 +485,6 @@ cpu_arm1026_name: __arm1026_proc_info: .long 0x4106a260 @ ARM 1026EJ-S (v5TEJ) .long 0xff0ffff0 - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ .long PMD_TYPE_SECT | \ PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ diff --git a/trunk/arch/arm/mm/proc-arm6_7.S b/trunk/arch/arm/mm/proc-arm6_7.S index 0432e4806888..7a705edfa4b2 100644 --- a/trunk/arch/arm/mm/proc-arm6_7.S +++ b/trunk/arch/arm/mm/proc-arm6_7.S @@ -355,10 +355,6 @@ __arm6_proc_info: .long 0x41560600 .long 0xfffffff0 .long 0x00000c1e - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __arm6_setup .long cpu_arch_name .long cpu_elf_name @@ -375,10 +371,6 @@ __arm610_proc_info: .long 0x41560610 .long 0xfffffff0 .long 0x00000c1e - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __arm6_setup .long cpu_arch_name .long cpu_elf_name @@ -395,10 +387,6 @@ __arm7_proc_info: .long 0x41007000 .long 0xffffff00 .long 0x00000c1e - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __arm7_setup .long cpu_arch_name .long cpu_elf_name @@ -420,10 +408,6 @@ __arm710_proc_info: PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __arm7_setup .long cpu_arch_name .long cpu_elf_name diff --git a/trunk/arch/arm/mm/proc-arm720.S b/trunk/arch/arm/mm/proc-arm720.S index c2f0705bfd49..86102467d37f 100644 --- a/trunk/arch/arm/mm/proc-arm720.S +++ b/trunk/arch/arm/mm/proc-arm720.S @@ -41,8 +41,6 @@ #include #include -#include "proc-macros.S" - /* * Function: arm720_proc_init (void) * : arm720_proc_fin (void) @@ -171,11 +169,11 @@ __arm720_setup: #ifdef CONFIG_MMU mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) #endif - adr r5, arm720_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register + ldr r5, arm720_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, arm720_cr1_set + orr r0, r0, r5 mov pc, lr @ __ret (head.S) .size __arm720_setup, . - __arm720_setup @@ -185,9 +183,12 @@ __arm720_setup: * ..1. 1001 ..11 1101 * */ - .type arm720_crval, #object -arm720_crval: - crval clear=0x00002f3f, mmuset=0x0000213d, ucset=0x00000130 + .type arm720_cr1_clear, #object + .type arm720_cr1_set, #object +arm720_cr1_clear: + .word 0x2f3f +arm720_cr1_set: + .word 0x213d __INITDATA @@ -245,10 +246,6 @@ __arm710_proc_info: PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __arm710_setup @ cpu_flush .long cpu_arch_name @ arch_name .long cpu_elf_name @ elf_name @@ -270,10 +267,6 @@ __arm720_proc_info: PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __arm720_setup @ cpu_flush .long cpu_arch_name @ arch_name .long cpu_elf_name @ elf_name diff --git a/trunk/arch/arm/mm/proc-arm920.S b/trunk/arch/arm/mm/proc-arm920.S index 4adb46b3a4e0..31dc839ba07c 100644 --- a/trunk/arch/arm/mm/proc-arm920.S +++ b/trunk/arch/arm/mm/proc-arm920.S @@ -26,6 +26,7 @@ * CONFIG_CPU_ARM920_CPU_IDLE -> nohlt */ #include +#include #include #include #include @@ -390,11 +391,11 @@ __arm920_setup: #ifdef CONFIG_MMU mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 #endif - adr r5, arm920_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, arm920_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, arm920_cr1_set + orr r0, r0, r5 mov pc, lr .size __arm920_setup, . - __arm920_setup @@ -404,9 +405,12 @@ __arm920_setup: * ..11 0001 ..11 0101 * */ - .type arm920_crval, #object -arm920_crval: - crval clear=0x00003f3f, mmuset=0x00003135, ucset=0x00001130 + .type arm920_cr1_clear, #object + .type arm920_cr1_set, #object +arm920_cr1_clear: + .word 0x3f3f +arm920_cr1_set: + .word 0x3135 __INITDATA @@ -440,7 +444,19 @@ cpu_elf_name: .type cpu_arm920_name, #object cpu_arm920_name: - .asciz "ARM920T" + .ascii "ARM920T" +#ifndef CONFIG_CPU_ICACHE_DISABLE + .ascii "i" +#endif +#ifndef CONFIG_CPU_DCACHE_DISABLE + .ascii "d" +#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH + .ascii "(wt)" +#else + .ascii "(wb)" +#endif +#endif + .ascii "\0" .size cpu_arm920_name, . - cpu_arm920_name .align @@ -457,10 +473,6 @@ __arm920_proc_info: PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __arm920_setup .long cpu_arch_name .long cpu_elf_name diff --git a/trunk/arch/arm/mm/proc-arm922.S b/trunk/arch/arm/mm/proc-arm922.S index 571f082f0247..9e57c34f5c09 100644 --- a/trunk/arch/arm/mm/proc-arm922.S +++ b/trunk/arch/arm/mm/proc-arm922.S @@ -27,6 +27,7 @@ * CONFIG_CPU_ARM922_CPU_IDLE -> nohlt */ #include +#include #include #include #include @@ -394,11 +395,11 @@ __arm922_setup: #ifdef CONFIG_MMU mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 #endif - adr r5, arm922_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, arm922_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, arm922_cr1_set + orr r0, r0, r5 mov pc, lr .size __arm922_setup, . - __arm922_setup @@ -408,9 +409,12 @@ __arm922_setup: * ..11 0001 ..11 0101 * */ - .type arm922_crval, #object -arm922_crval: - crval clear=0x00003f3f, mmuset=0x00003135, ucset=0x00001130 + .type arm922_cr1_clear, #object + .type arm922_cr1_set, #object +arm922_cr1_clear: + .word 0x3f3f +arm922_cr1_set: + .word 0x3135 __INITDATA @@ -444,7 +448,19 @@ cpu_elf_name: .type cpu_arm922_name, #object cpu_arm922_name: - .asciz "ARM922T" + .ascii "ARM922T" +#ifndef CONFIG_CPU_ICACHE_DISABLE + .ascii "i" +#endif +#ifndef CONFIG_CPU_DCACHE_DISABLE + .ascii "d" +#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH + .ascii "(wt)" +#else + .ascii "(wb)" +#endif +#endif + .ascii "\0" .size cpu_arm922_name, . - cpu_arm922_name .align @@ -461,10 +477,6 @@ __arm922_proc_info: PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __arm922_setup .long cpu_arch_name .long cpu_elf_name diff --git a/trunk/arch/arm/mm/proc-arm925.S b/trunk/arch/arm/mm/proc-arm925.S index 8d9a9f93b011..8d47c9f3f931 100644 --- a/trunk/arch/arm/mm/proc-arm925.S +++ b/trunk/arch/arm/mm/proc-arm925.S @@ -50,6 +50,7 @@ */ #include +#include #include #include #include @@ -454,11 +455,11 @@ __arm925_setup: mcr p15, 7, r0, c15, c0, 0 #endif - adr r5, arm925_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, arm925_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, arm925_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN orr r0, r0, #0x4000 @ .1.. .... .... .... #endif @@ -471,9 +472,12 @@ __arm925_setup: * .011 0001 ..11 1101 * */ - .type arm925_crval, #object -arm925_crval: - crval clear=0x00007f3f, mmuset=0x0000313d, ucset=0x00001130 + .type arm925_cr1_clear, #object + .type arm925_cr1_set, #object +arm925_cr1_clear: + .word 0x7f3f +arm925_cr1_set: + .word 0x313d __INITDATA @@ -507,7 +511,22 @@ cpu_elf_name: .type cpu_arm925_name, #object cpu_arm925_name: - .asciz "ARM925T" + .ascii "ARM925T" +#ifndef CONFIG_CPU_ICACHE_DISABLE + .ascii "i" +#endif +#ifndef CONFIG_CPU_DCACHE_DISABLE + .ascii "d" +#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH + .ascii "(wt)" +#else + .ascii "(wb)" +#endif +#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN + .ascii "RR" +#endif +#endif + .ascii "\0" .size cpu_arm925_name, . - cpu_arm925_name .align @@ -518,10 +537,6 @@ cpu_arm925_name: __arm925_proc_info: .long 0x54029250 .long 0xfffffff0 - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ .long PMD_TYPE_SECT | \ PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ @@ -541,10 +556,6 @@ __arm925_proc_info: __arm915_proc_info: .long 0x54029150 .long 0xfffffff0 - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ .long PMD_TYPE_SECT | \ PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ diff --git a/trunk/arch/arm/mm/proc-arm926.S b/trunk/arch/arm/mm/proc-arm926.S index 1e89d4080474..cb4d8f33d2a3 100644 --- a/trunk/arch/arm/mm/proc-arm926.S +++ b/trunk/arch/arm/mm/proc-arm926.S @@ -26,6 +26,7 @@ * CONFIG_CPU_ARM926_CPU_IDLE -> nohlt */ #include +#include #include #include #include @@ -403,11 +404,11 @@ __arm926_setup: mcr p15, 7, r0, c15, c0, 0 #endif - adr r5, arm926_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, arm926_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, arm926_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN orr r0, r0, #0x4000 @ .1.. .... .... .... #endif @@ -420,9 +421,12 @@ __arm926_setup: * .011 0001 ..11 0101 * */ - .type arm926_crval, #object -arm926_crval: - crval clear=0x00007f3f, mmuset=0x00003135, ucset=0x00001134 + .type arm926_cr1_clear, #object + .type arm926_cr1_set, #object +arm926_cr1_clear: + .word 0x7f3f +arm926_cr1_set: + .word 0x3135 __INITDATA @@ -456,7 +460,22 @@ cpu_elf_name: .type cpu_arm926_name, #object cpu_arm926_name: - .asciz "ARM926EJ-S" + .ascii "ARM926EJ-S" +#ifndef CONFIG_CPU_ICACHE_DISABLE + .ascii "i" +#endif +#ifndef CONFIG_CPU_DCACHE_DISABLE + .ascii "d" +#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH + .ascii "(wt)" +#else + .ascii "(wb)" +#endif +#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN + .ascii "RR" +#endif +#endif + .ascii "\0" .size cpu_arm926_name, . - cpu_arm926_name .align @@ -473,10 +492,6 @@ __arm926_proc_info: PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_BIT4 | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __arm926_setup .long cpu_arch_name .long cpu_elf_name diff --git a/trunk/arch/arm/mm/proc-macros.S b/trunk/arch/arm/mm/proc-macros.S index 9e2c89eb2115..7cfc2604a1ee 100644 --- a/trunk/arch/arm/mm/proc-macros.S +++ b/trunk/arch/arm/mm/proc-macros.S @@ -49,13 +49,3 @@ .macro asid, rd, rn and \rd, \rn, #255 .endm - - .macro crval, clear, mmuset, ucset -#ifdef CONFIG_MMU - .word \clear - .word \mmuset -#else - .word \clear - .word \ucset -#endif - .endm diff --git a/trunk/arch/arm/mm/proc-sa110.S b/trunk/arch/arm/mm/proc-sa110.S index c878064e9b88..5a760a2c629c 100644 --- a/trunk/arch/arm/mm/proc-sa110.S +++ b/trunk/arch/arm/mm/proc-sa110.S @@ -23,8 +23,6 @@ #include #include -#include "proc-macros.S" - /* * the cache line size of the I and D cache */ @@ -187,12 +185,11 @@ __sa110_setup: #ifdef CONFIG_MMU mcr p15, 0, r10, c8, c7 @ invalidate I,D TLBs on v4 #endif - - adr r5, sa110_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, sa110_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, sa110_cr1_set + orr r0, r0, r5 mov pc, lr .size __sa110_setup, . - __sa110_setup @@ -202,9 +199,12 @@ __sa110_setup: * ..01 0001 ..11 1101 * */ - .type sa110_crval, #object -sa110_crval: - crval clear=0x00003f3f, mmuset=0x0000113d, ucset=0x00001130 + .type sa110_cr1_clear, #object + .type sa110_cr1_set, #object +sa110_cr1_clear: + .word 0x3f3f +sa110_cr1_set: + .word 0x113d __INITDATA @@ -255,9 +255,6 @@ __sa110_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __sa110_setup .long cpu_arch_name .long cpu_elf_name diff --git a/trunk/arch/arm/mm/proc-sa1100.S b/trunk/arch/arm/mm/proc-sa1100.S index b23b66a6155a..0a2107ad4c32 100644 --- a/trunk/arch/arm/mm/proc-sa1100.S +++ b/trunk/arch/arm/mm/proc-sa1100.S @@ -27,8 +27,6 @@ #include #include -#include "proc-macros.S" - /* * the cache line size of the I and D cache */ @@ -200,11 +198,11 @@ __sa1100_setup: #ifdef CONFIG_MMU mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 #endif - adr r5, sa1100_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, sa1100_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, sa1100_cr1_set + orr r0, r0, r5 mov pc, lr .size __sa1100_setup, . - __sa1100_setup @@ -214,9 +212,12 @@ __sa1100_setup: * ..11 0001 ..11 1101 * */ - .type sa1100_crval, #object -sa1100_crval: - crval clear=0x00003f3f, mmuset=0x0000313d, ucset=0x00001130 + .type sa1100_cr1_clear, #object + .type sa1100_cr1_set, #object +sa1100_cr1_clear: + .word 0x3f3f +sa1100_cr1_set: + .word 0x313d __INITDATA @@ -275,9 +276,6 @@ __sa1100_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __sa1100_setup .long cpu_arch_name .long cpu_elf_name @@ -298,9 +296,6 @@ __sa1110_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __sa1100_setup .long cpu_arch_name .long cpu_elf_name diff --git a/trunk/arch/arm/mm/proc-v6.S b/trunk/arch/arm/mm/proc-v6.S index 6f72549f8843..ca13d4d05f65 100644 --- a/trunk/arch/arm/mm/proc-v6.S +++ b/trunk/arch/arm/mm/proc-v6.S @@ -212,11 +212,11 @@ __v6_setup: orr r0, r0, #(0xf << 20) mcr p15, 0, r0, c1, c0, 2 @ Enable full access to VFP #endif - adr r5, v6_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0, 0 @ read control register + ldr r5, v6_cr1_clear @ get mask for bits to clear bic r0, r0, r5 @ clear bits them - orr r0, r0, r6 @ set them + ldr r5, v6_cr1_set @ get mask for bits to set + orr r0, r0, r5 @ set them mov pc, lr @ return to head.S:__ret /* @@ -225,9 +225,12 @@ __v6_setup: * rrrr rrrx xxx0 0101 xxxx xxxx x111 xxxx < forced * 0 110 0011 1.00 .111 1101 < we want */ - .type v6_crval, #object -v6_crval: - crval clear=0x01e0fb7f, mmuset=0x00c0387d, ucset=0x00c0187c + .type v6_cr1_clear, #object + .type v6_cr1_set, #object +v6_cr1_clear: + .word 0x01e0fb7f +v6_cr1_set: + .word 0x00c0387d .type v6_processor_functions, #object ENTRY(v6_processor_functions) @@ -266,10 +269,6 @@ __v6_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_XN | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __v6_setup .long cpu_arch_name .long cpu_elf_name diff --git a/trunk/arch/arm/mm/proc-xsc3.S b/trunk/arch/arm/mm/proc-xsc3.S index 4ace2d8090c7..8d32e21fe151 100644 --- a/trunk/arch/arm/mm/proc-xsc3.S +++ b/trunk/arch/arm/mm/proc-xsc3.S @@ -426,26 +426,23 @@ __xsc3_setup: orr r0, r0, #(1 << 10) @ enable L2 for LLR cache #endif mcr p15, 0, r0, c1, c0, 1 @ set auxiliary control reg - - adr r5, xsc3_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0, 0 @ get control register - bic r0, r0, r5 @ .... .... .... ..A. - orr r0, r0, r6 @ .... .... .... .C.M + bic r0, r0, #0x0002 @ .... .... .... ..A. + orr r0, r0, #0x0005 @ .... .... .... .C.M #if BTB_ENABLE - orr r0, r0, #0x00000800 @ ..VI Z..S .... .... + bic r0, r0, #0x0200 @ .... ..R. .... .... + orr r0, r0, #0x3900 @ ..VI Z..S .... .... +#else + bic r0, r0, #0x0a00 @ .... Z.R. .... .... + orr r0, r0, #0x3100 @ ..VI ...S .... .... #endif #if L2_CACHE_ENABLE - orr r0, r0, #0x04000000 @ L2 enable + orr r0, r0, #0x4000000 @ L2 enable #endif mov pc, lr .size __xsc3_setup, . - __xsc3_setup - .type xsc3_crval, #object -xsc3_crval: - crval clear=0x04003b02, mmuset=0x00003105, ucset=0x00001100 - __INITDATA /* @@ -490,14 +487,7 @@ cpu_xsc3_name: __xsc3_proc_info: .long 0x69056000 .long 0xffffe000 - .long PMD_TYPE_SECT | \ - PMD_SECT_BUFFERABLE | \ - PMD_SECT_CACHEABLE | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ + .long 0x00000c0e b __xsc3_setup .long cpu_arch_name .long cpu_elf_name diff --git a/trunk/arch/arm/mm/proc-xscale.S b/trunk/arch/arm/mm/proc-xscale.S index 521538671f4c..29bcc4dd6517 100644 --- a/trunk/arch/arm/mm/proc-xscale.S +++ b/trunk/arch/arm/mm/proc-xscale.S @@ -138,23 +138,17 @@ ENTRY(cpu_xscale_proc_fin) * to what would be the reset vector. * * loc: location to jump to for soft reset - * - * Beware PXA270 erratum E7. */ .align 5 ENTRY(cpu_xscale_reset) mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE msr cpsr_c, r1 @ reset CPSR - mcr p15, 0, r1, c10, c4, 1 @ unlock I-TLB - mcr p15, 0, r1, c8, c5, 0 @ invalidate I-TLB mrc p15, 0, r1, c1, c0, 0 @ ctrl register bic r1, r1, #0x0086 @ ........B....CA. bic r1, r1, #0x3900 @ ..VIZ..S........ - sub pc, pc, #4 @ flush pipeline - @ *** cache line aligned *** mcr p15, 0, r1, c1, c0, 0 @ ctrl register - bic r1, r1, #0x0001 @ ...............M mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches & BTB + bic r1, r1, #0x0001 @ ...............M mcr p15, 0, r1, c1, c0, 0 @ ctrl register @ CAUTION: MMU turned off from this point. We count on the pipeline @ already containing those two last instructions to survive. @@ -481,12 +475,11 @@ __xscale_setup: orr r0, r0, #1 << 6 @ cp6 for IOP3xx and Bulverde orr r0, r0, #1 << 13 @ Its undefined whether this mcr p15, 0, r0, c15, c1, 0 @ affects USR or SVC modes - - adr r5, xscale_crval - ldmia r5, {r5, r6} mrc p15, 0, r0, c1, c0, 0 @ get control register + ldr r5, xscale_cr1_clear bic r0, r0, r5 - orr r0, r0, r6 + ldr r5, xscale_cr1_set + orr r0, r0, r5 mov pc, lr .size __xscale_setup, . - __xscale_setup @@ -496,9 +489,12 @@ __xscale_setup: * ..11 1.01 .... .101 * */ - .type xscale_crval, #object -xscale_crval: - crval clear=0x00003b07, mmuset=0x00003905, ucset=0x00001900 + .type xscale_cr1_clear, #object + .type xscale_cr1_set, #object +xscale_cr1_clear: + .word 0x3b07 +xscale_cr1_set: + .word 0x3905 __INITDATA @@ -599,9 +595,6 @@ __80200_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -622,9 +615,6 @@ __8032x_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -645,9 +635,6 @@ __8033x_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -668,9 +655,6 @@ __pxa250_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -691,9 +675,6 @@ __pxa210_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -714,9 +695,6 @@ __ixp2400_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -737,9 +715,6 @@ __ixp2800_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -760,9 +735,6 @@ __ixp42x_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -778,14 +750,7 @@ __ixp42x_proc_info: __ixp46x_proc_info: .long 0x69054200 .long 0xffffff00 - .long PMD_TYPE_SECT | \ - PMD_SECT_BUFFERABLE | \ - PMD_SECT_CACHEABLE | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ + .long 0x00000c0e b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -806,9 +771,6 @@ __pxa255_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -829,9 +791,6 @@ __pxa270_proc_info: PMD_SECT_CACHEABLE | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ - .long PMD_TYPE_SECT | \ - PMD_SECT_AP_WRITE | \ - PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name diff --git a/trunk/arch/arm/nwfpe/fpa11.c b/trunk/arch/arm/nwfpe/fpa11.c index cc60acde84d9..7b3d74d73c80 100644 --- a/trunk/arch/arm/nwfpe/fpa11.c +++ b/trunk/arch/arm/nwfpe/fpa11.c @@ -26,6 +26,7 @@ #include "fpmodule.h" #include "fpmodule.inl" +#include #include #include #include diff --git a/trunk/arch/arm/nwfpe/fpa11.h b/trunk/arch/arm/nwfpe/fpa11.h index 4a4d02c09112..28cd79a451d3 100644 --- a/trunk/arch/arm/nwfpe/fpa11.h +++ b/trunk/arch/arm/nwfpe/fpa11.h @@ -31,6 +31,7 @@ */ #define GET_USERREG() ((struct pt_regs *)(THREAD_START_SP + (unsigned long)current_thread_info()) - 1) +#include #include /* includes */ diff --git a/trunk/arch/arm/nwfpe/fpa11_cpdo.c b/trunk/arch/arm/nwfpe/fpa11_cpdo.c index 2cebb1529607..4a31dfd94068 100644 --- a/trunk/arch/arm/nwfpe/fpa11_cpdo.c +++ b/trunk/arch/arm/nwfpe/fpa11_cpdo.c @@ -20,6 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include "fpa11.h" #include "fpopcode.h" diff --git a/trunk/arch/arm/nwfpe/fpa11_cpdt.c b/trunk/arch/arm/nwfpe/fpa11_cpdt.c index 79f8e67cc6c1..32859fa8dcfc 100644 --- a/trunk/arch/arm/nwfpe/fpa11_cpdt.c +++ b/trunk/arch/arm/nwfpe/fpa11_cpdt.c @@ -20,6 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include "fpa11.h" #include "softfloat.h" #include "fpopcode.h" diff --git a/trunk/arch/arm/nwfpe/fpa11_cprt.c b/trunk/arch/arm/nwfpe/fpa11_cprt.c index 9843dc533047..7c67023655e4 100644 --- a/trunk/arch/arm/nwfpe/fpa11_cprt.c +++ b/trunk/arch/arm/nwfpe/fpa11_cprt.c @@ -20,6 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include "fpa11.h" #include "fpopcode.h" #include "fpa11.inl" diff --git a/trunk/arch/arm/nwfpe/fpmodule.c b/trunk/arch/arm/nwfpe/fpmodule.c index 4c0ab50f399a..7d977d23f026 100644 --- a/trunk/arch/arm/nwfpe/fpmodule.c +++ b/trunk/arch/arm/nwfpe/fpmodule.c @@ -24,6 +24,7 @@ #include "fpa11.h" #include +#include /* XXX */ #include diff --git a/trunk/arch/arm/nwfpe/fpopcode.c b/trunk/arch/arm/nwfpe/fpopcode.c index 922b81107585..67ff2ab08ea0 100644 --- a/trunk/arch/arm/nwfpe/fpopcode.c +++ b/trunk/arch/arm/nwfpe/fpopcode.c @@ -19,6 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include "fpa11.h" #include "softfloat.h" #include "fpopcode.h" diff --git a/trunk/arch/arm/nwfpe/fpopcode.h b/trunk/arch/arm/nwfpe/fpopcode.h index ec78e3517fc9..6528e081c83f 100644 --- a/trunk/arch/arm/nwfpe/fpopcode.h +++ b/trunk/arch/arm/nwfpe/fpopcode.h @@ -23,6 +23,7 @@ #ifndef __FPOPCODE_H__ #define __FPOPCODE_H__ +#include /* ARM Floating Point Instruction Classes diff --git a/trunk/arch/arm/nwfpe/softfloat.h b/trunk/arch/arm/nwfpe/softfloat.h index e1125bc39ee4..978c699673c6 100644 --- a/trunk/arch/arm/nwfpe/softfloat.h +++ b/trunk/arch/arm/nwfpe/softfloat.h @@ -32,6 +32,7 @@ this code that are retained. #ifndef __SOFTFLOAT_H__ #define __SOFTFLOAT_H__ +#include /* ------------------------------------------------------------------------------- diff --git a/trunk/arch/arm/oprofile/op_model_xscale.c b/trunk/arch/arm/oprofile/op_model_xscale.c index 34fdc733743b..e0f0b320d76c 100644 --- a/trunk/arch/arm/oprofile/op_model_xscale.c +++ b/trunk/arch/arm/oprofile/op_model_xscale.c @@ -384,7 +384,7 @@ static int xscale_pmu_start(void) int ret; u32 pmnc = read_pmnc(); - ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, IRQF_DISABLED, + ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, SA_INTERRUPT, "XScale PMU", (void *)results); if (ret < 0) { diff --git a/trunk/arch/arm/plat-omap/Kconfig b/trunk/arch/arm/plat-omap/Kconfig index ec752e16d618..ec49495e651e 100644 --- a/trunk/arch/arm/plat-omap/Kconfig +++ b/trunk/arch/arm/plat-omap/Kconfig @@ -91,7 +91,7 @@ config OMAP_32K_TIMER_HZ config OMAP_DM_TIMER bool "Use dual-mode timer" - depends on ARCH_OMAP16XX || ARCH_OMAP24XX + depends on ARCH_OMAP16XX help Select this option if you want to use OMAP Dual-Mode timers. diff --git a/trunk/arch/arm/plat-omap/clock.c b/trunk/arch/arm/plat-omap/clock.c index 7f45c7c3e673..32ec04c58bcd 100644 --- a/trunk/arch/arm/plat-omap/clock.c +++ b/trunk/arch/arm/plat-omap/clock.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ #include +#include #include #include #include @@ -27,9 +28,9 @@ #include -static LIST_HEAD(clocks); +LIST_HEAD(clocks); static DEFINE_MUTEX(clocks_mutex); -static DEFINE_SPINLOCK(clockfw_lock); +DEFINE_SPINLOCK(clockfw_lock); static struct clk_functions *arch_clock; diff --git a/trunk/arch/arm/plat-omap/common.c b/trunk/arch/arm/plat-omap/common.c index 57b7b93674a4..adffc5a859ee 100644 --- a/trunk/arch/arm/plat-omap/common.c +++ b/trunk/arch/arm/plat-omap/common.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/plat-omap/cpu-omap.c b/trunk/arch/arm/plat-omap/cpu-omap.c index a0c71dca2373..98edc9fdd6d1 100644 --- a/trunk/arch/arm/plat-omap/cpu-omap.c +++ b/trunk/arch/arm/plat-omap/cpu-omap.c @@ -25,14 +25,6 @@ #include #include -#define VERY_HI_RATE 900000000 - -#ifdef CONFIG_ARCH_OMAP1 -#define MPU_CLK "mpu" -#else -#define MPU_CLK "virt_prcm_set" -#endif - /* TODO: Add support for SDRAM timing changes */ int omap_verify_speed(struct cpufreq_policy *policy) @@ -44,7 +36,7 @@ int omap_verify_speed(struct cpufreq_policy *policy) cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); - mpu_clk = clk_get(NULL, MPU_CLK); + mpu_clk = clk_get(NULL, "mpu"); if (IS_ERR(mpu_clk)) return PTR_ERR(mpu_clk); policy->min = clk_round_rate(mpu_clk, policy->min * 1000) / 1000; @@ -64,7 +56,7 @@ unsigned int omap_getspeed(unsigned int cpu) if (cpu) return 0; - mpu_clk = clk_get(NULL, MPU_CLK); + mpu_clk = clk_get(NULL, "mpu"); if (IS_ERR(mpu_clk)) return 0; rate = clk_get_rate(mpu_clk) / 1000; @@ -81,7 +73,7 @@ static int omap_target(struct cpufreq_policy *policy, struct cpufreq_freqs freqs; int ret = 0; - mpu_clk = clk_get(NULL, MPU_CLK); + mpu_clk = clk_get(NULL, "mpu"); if (IS_ERR(mpu_clk)) return PTR_ERR(mpu_clk); @@ -101,7 +93,7 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy) { struct clk * mpu_clk; - mpu_clk = clk_get(NULL, MPU_CLK); + mpu_clk = clk_get(NULL, "mpu"); if (IS_ERR(mpu_clk)) return PTR_ERR(mpu_clk); @@ -110,7 +102,7 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy) policy->cur = policy->min = policy->max = omap_getspeed(0); policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000; - policy->cpuinfo.max_freq = clk_round_rate(mpu_clk, VERY_HI_RATE) / 1000; + policy->cpuinfo.max_freq = clk_round_rate(mpu_clk, 216000000) / 1000; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; clk_put(mpu_clk); diff --git a/trunk/arch/arm/plat-omap/devices.c b/trunk/arch/arm/plat-omap/devices.c index 1812f237d12f..5d5d6eb222dd 100644 --- a/trunk/arch/arm/plat-omap/devices.c +++ b/trunk/arch/arm/plat-omap/devices.c @@ -9,6 +9,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -104,7 +105,7 @@ static void omap_init_kp(void) omap_cfg_reg(E20_1610_KBR3); omap_cfg_reg(E19_1610_KBR4); omap_cfg_reg(N19_1610_KBR5); - } else if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { + } else if (machine_is_omap_perseus2()) { omap_cfg_reg(E2_730_KBR0); omap_cfg_reg(J7_730_KBR1); omap_cfg_reg(E1_730_KBR2); @@ -161,8 +162,8 @@ static u64 mmc1_dmamask = 0xffffffff; static struct resource mmc1_resources[] = { { - .start = OMAP_MMC1_BASE, - .end = OMAP_MMC1_BASE + 0x7f, + .start = IO_ADDRESS(OMAP_MMC1_BASE), + .end = IO_ADDRESS(OMAP_MMC1_BASE) + 0x7f, .flags = IORESOURCE_MEM, }, { @@ -190,8 +191,8 @@ static u64 mmc2_dmamask = 0xffffffff; static struct resource mmc2_resources[] = { { - .start = OMAP_MMC2_BASE, - .end = OMAP_MMC2_BASE + 0x7f, + .start = IO_ADDRESS(OMAP_MMC2_BASE), + .end = IO_ADDRESS(OMAP_MMC2_BASE) + 0x7f, .flags = IORESOURCE_MEM, }, { diff --git a/trunk/arch/arm/plat-omap/dma.c b/trunk/arch/arm/plat-omap/dma.c index 9eddc9507147..5dac4230360d 100644 --- a/trunk/arch/arm/plat-omap/dma.c +++ b/trunk/arch/arm/plat-omap/dma.c @@ -24,9 +24,9 @@ #include #include #include -#include #include +#include #include #include #include @@ -43,7 +43,6 @@ #define OMAP_DMA_ACTIVE 0x01 #define OMAP_DMA_CCR_EN (1 << 7) -#define OMAP2_DMA_CSR_CLEAR_MASK 0xffe #define OMAP_FUNC_MUX_ARM_BASE (0xfffe1000 + 0xec) @@ -167,24 +166,18 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, if (cpu_is_omap24xx() && dma_trigger) { u32 val = OMAP_DMA_CCR_REG(lch); - val &= ~(3 << 19); if (dma_trigger > 63) val |= 1 << 20; if (dma_trigger > 31) val |= 1 << 19; - val &= ~(0x1f); val |= (dma_trigger & 0x1f); if (sync_mode & OMAP_DMA_SYNC_FRAME) val |= 1 << 5; - else - val &= ~(1 << 5); if (sync_mode & OMAP_DMA_SYNC_BLOCK) val |= 1 << 18; - else - val &= ~(1 << 18); if (src_or_dst_synch) val |= 1 << 24; /* source synch */ @@ -293,39 +286,22 @@ void omap_set_dma_src_data_pack(int lch, int enable) void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) { - unsigned int burst = 0; OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 7); switch (burst_mode) { case OMAP_DMA_DATA_BURST_DIS: break; case OMAP_DMA_DATA_BURST_4: - if (cpu_is_omap24xx()) - burst = 0x1; - else - burst = 0x2; + OMAP_DMA_CSDP_REG(lch) |= (0x02 << 7); break; case OMAP_DMA_DATA_BURST_8: - if (cpu_is_omap24xx()) { - burst = 0x2; - break; - } - /* not supported by current hardware on OMAP1 + /* not supported by current hardware * w |= (0x03 << 7); * fall through */ - case OMAP_DMA_DATA_BURST_16: - if (cpu_is_omap24xx()) { - burst = 0x3; - break; - } - /* OMAP1 don't support burst 16 - * fall through - */ default: BUG(); } - OMAP_DMA_CSDP_REG(lch) |= (burst << 7); } /* Note that dest_port is only for OMAP1 */ @@ -372,49 +348,30 @@ void omap_set_dma_dest_data_pack(int lch, int enable) void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) { - unsigned int burst = 0; OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 14); switch (burst_mode) { case OMAP_DMA_DATA_BURST_DIS: break; case OMAP_DMA_DATA_BURST_4: - if (cpu_is_omap24xx()) - burst = 0x1; - else - burst = 0x2; + OMAP_DMA_CSDP_REG(lch) |= (0x02 << 14); break; case OMAP_DMA_DATA_BURST_8: - if (cpu_is_omap24xx()) - burst = 0x2; - else - burst = 0x3; + OMAP_DMA_CSDP_REG(lch) |= (0x03 << 14); break; - case OMAP_DMA_DATA_BURST_16: - if (cpu_is_omap24xx()) { - burst = 0x3; - break; - } - /* OMAP1 don't support burst 16 - * fall through - */ default: printk(KERN_ERR "Invalid DMA burst mode\n"); BUG(); return; } - OMAP_DMA_CSDP_REG(lch) |= (burst << 14); } static inline void omap_enable_channel_irq(int lch) { u32 status; - /* Clear CSR */ - if (cpu_class_is_omap1()) - status = OMAP_DMA_CSR_REG(lch); - else if (cpu_is_omap24xx()) - OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK; + /* Read CSR to make sure it's cleared. */ + status = OMAP_DMA_CSR_REG(lch); /* Enable some nice interrupts. */ OMAP_DMA_CICR_REG(lch) = dma_chan[lch].enabled_irqs; @@ -513,13 +470,11 @@ int omap_request_dma(int dev_id, const char *dev_name, chan->dev_name = dev_name; chan->callback = callback; chan->data = data; - chan->enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ; + chan->enabled_irqs = OMAP_DMA_TOUT_IRQ | OMAP_DMA_DROP_IRQ | + OMAP_DMA_BLOCK_IRQ; - if (cpu_class_is_omap1()) - chan->enabled_irqs |= OMAP1_DMA_TOUT_IRQ; - else if (cpu_is_omap24xx()) - chan->enabled_irqs |= OMAP2_DMA_MISALIGNED_ERR_IRQ | - OMAP2_DMA_TRANS_ERR_IRQ; + if (cpu_is_omap24xx()) + chan->enabled_irqs |= OMAP2_DMA_TRANS_ERR_IRQ; if (cpu_is_omap16xx()) { /* If the sync device is set, configure it dynamically. */ @@ -539,7 +494,7 @@ int omap_request_dma(int dev_id, const char *dev_name, omap_enable_channel_irq(free_ch); /* Clear the CSR register and IRQ status register */ - OMAP_DMA_CSR_REG(free_ch) = OMAP2_DMA_CSR_CLEAR_MASK; + OMAP_DMA_CSR_REG(free_ch) = 0x0; omap_writel(~0x0, OMAP_DMA4_IRQSTATUS_L0); } @@ -579,7 +534,7 @@ void omap_free_dma(int lch) omap_writel(val, OMAP_DMA4_IRQENABLE_L0); /* Clear the CSR register and IRQ status register */ - OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK; + OMAP_DMA_CSR_REG(lch) = 0x0; val = omap_readl(OMAP_DMA4_IRQSTATUS_L0); val |= 1 << lch; @@ -843,7 +798,7 @@ static int omap1_dma_handle_ch(int ch) "%d (CSR %04x)\n", ch, csr); return 0; } - if (unlikely(csr & OMAP1_DMA_TOUT_IRQ)) + if (unlikely(csr & OMAP_DMA_TOUT_IRQ)) printk(KERN_WARNING "DMA timeout with device %d\n", dma_chan[ch].dev_id); if (unlikely(csr & OMAP_DMA_DROP_IRQ)) @@ -891,21 +846,20 @@ static int omap2_dma_handle_ch(int ch) return 0; if (unlikely(dma_chan[ch].dev_id == -1)) return 0; + /* REVISIT: According to 24xx TRM, there's no TOUT_IE */ + if (unlikely(status & OMAP_DMA_TOUT_IRQ)) + printk(KERN_INFO "DMA timeout with device %d\n", + dma_chan[ch].dev_id); if (unlikely(status & OMAP_DMA_DROP_IRQ)) printk(KERN_INFO "DMA synchronization event drop occurred with device " "%d\n", dma_chan[ch].dev_id); + if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) printk(KERN_INFO "DMA transaction error with device %d\n", dma_chan[ch].dev_id); - if (unlikely(status & OMAP2_DMA_SECURE_ERR_IRQ)) - printk(KERN_INFO "DMA secure error with device %d\n", - dma_chan[ch].dev_id); - if (unlikely(status & OMAP2_DMA_MISALIGNED_ERR_IRQ)) - printk(KERN_INFO "DMA misaligned error with device %d\n", - dma_chan[ch].dev_id); - OMAP_DMA_CSR_REG(ch) = OMAP2_DMA_CSR_CLEAR_MASK; + OMAP_DMA_CSR_REG(ch) = 0x20; val = omap_readl(OMAP_DMA4_IRQSTATUS_L0); /* ch in this function is from 0-31 while in register it is 1-32 */ @@ -939,7 +893,7 @@ static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id, static struct irqaction omap24xx_dma_irq = { .name = "DMA", .handler = omap2_dma_irq_handler, - .flags = IRQF_DISABLED + .flags = SA_INTERRUPT }; #else diff --git a/trunk/arch/arm/plat-omap/dmtimer.c b/trunk/arch/arm/plat-omap/dmtimer.c index 50524436de63..eba3cb52ad87 100644 --- a/trunk/arch/arm/plat-omap/dmtimer.c +++ b/trunk/arch/arm/plat-omap/dmtimer.c @@ -4,8 +4,7 @@ * OMAP Dual-Mode Timers * * Copyright (C) 2005 Nokia Corporation - * OMAP2 support by Juha Yrjola - * API improvements and OMAP2 clock framework support by Timo Teras + * Author: Lauri Leukkunen * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -27,17 +26,15 @@ */ #include -#include -#include -#include -#include -#include #include #include #include #include +#include +#include + +#define OMAP_TIMER_COUNT 8 -/* register offsets */ #define OMAP_TIMER_ID_REG 0x00 #define OMAP_TIMER_OCP_CFG_REG 0x10 #define OMAP_TIMER_SYS_STAT_REG 0x14 @@ -53,196 +50,52 @@ #define OMAP_TIMER_CAPTURE_REG 0x3c #define OMAP_TIMER_IF_CTRL_REG 0x40 -/* timer control reg bits */ -#define OMAP_TIMER_CTRL_GPOCFG (1 << 14) -#define OMAP_TIMER_CTRL_CAPTMODE (1 << 13) -#define OMAP_TIMER_CTRL_PT (1 << 12) -#define OMAP_TIMER_CTRL_TCM_LOWTOHIGH (0x1 << 8) -#define OMAP_TIMER_CTRL_TCM_HIGHTOLOW (0x2 << 8) -#define OMAP_TIMER_CTRL_TCM_BOTHEDGES (0x3 << 8) -#define OMAP_TIMER_CTRL_SCPWM (1 << 7) -#define OMAP_TIMER_CTRL_CE (1 << 6) /* compare enable */ -#define OMAP_TIMER_CTRL_PRE (1 << 5) /* prescaler enable */ -#define OMAP_TIMER_CTRL_PTV_SHIFT 2 /* how much to shift the prescaler value */ -#define OMAP_TIMER_CTRL_AR (1 << 1) /* auto-reload enable */ -#define OMAP_TIMER_CTRL_ST (1 << 0) /* start timer */ - -struct omap_dm_timer { - unsigned long phys_base; - int irq; -#ifdef CONFIG_ARCH_OMAP2 - struct clk *iclk, *fclk; -#endif - void __iomem *io_base; - unsigned reserved:1; -}; -#ifdef CONFIG_ARCH_OMAP1 +static struct dmtimer_info_struct { + struct list_head unused_timers; + struct list_head reserved_timers; +} dm_timer_info; static struct omap_dm_timer dm_timers[] = { - { .phys_base = 0xfffb1400, .irq = INT_1610_GPTIMER1 }, - { .phys_base = 0xfffb1c00, .irq = INT_1610_GPTIMER2 }, - { .phys_base = 0xfffb2400, .irq = INT_1610_GPTIMER3 }, - { .phys_base = 0xfffb2c00, .irq = INT_1610_GPTIMER4 }, - { .phys_base = 0xfffb3400, .irq = INT_1610_GPTIMER5 }, - { .phys_base = 0xfffb3c00, .irq = INT_1610_GPTIMER6 }, - { .phys_base = 0xfffb4400, .irq = INT_1610_GPTIMER7 }, - { .phys_base = 0xfffb4c00, .irq = INT_1610_GPTIMER8 }, + { .base=0xfffb1400, .irq=INT_1610_GPTIMER1 }, + { .base=0xfffb1c00, .irq=INT_1610_GPTIMER2 }, + { .base=0xfffb2400, .irq=INT_1610_GPTIMER3 }, + { .base=0xfffb2c00, .irq=INT_1610_GPTIMER4 }, + { .base=0xfffb3400, .irq=INT_1610_GPTIMER5 }, + { .base=0xfffb3c00, .irq=INT_1610_GPTIMER6 }, + { .base=0xfffb4400, .irq=INT_1610_GPTIMER7 }, + { .base=0xfffb4c00, .irq=INT_1610_GPTIMER8 }, + { .base=0x0 }, }; -#elif defined(CONFIG_ARCH_OMAP2) - -static struct omap_dm_timer dm_timers[] = { - { .phys_base = 0x48028000, .irq = INT_24XX_GPTIMER1 }, - { .phys_base = 0x4802a000, .irq = INT_24XX_GPTIMER2 }, - { .phys_base = 0x48078000, .irq = INT_24XX_GPTIMER3 }, - { .phys_base = 0x4807a000, .irq = INT_24XX_GPTIMER4 }, - { .phys_base = 0x4807c000, .irq = INT_24XX_GPTIMER5 }, - { .phys_base = 0x4807e000, .irq = INT_24XX_GPTIMER6 }, - { .phys_base = 0x48080000, .irq = INT_24XX_GPTIMER7 }, - { .phys_base = 0x48082000, .irq = INT_24XX_GPTIMER8 }, - { .phys_base = 0x48084000, .irq = INT_24XX_GPTIMER9 }, - { .phys_base = 0x48086000, .irq = INT_24XX_GPTIMER10 }, - { .phys_base = 0x48088000, .irq = INT_24XX_GPTIMER11 }, - { .phys_base = 0x4808a000, .irq = INT_24XX_GPTIMER12 }, -}; - -static const char *dm_source_names[] = { - "sys_ck", - "func_32k_ck", - "alt_ck" -}; -static struct clk *dm_source_clocks[3]; - -#else - -#error OMAP architecture not supported! - -#endif - -static const int dm_timer_count = ARRAY_SIZE(dm_timers); static spinlock_t dm_timer_lock; -static inline u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, int reg) -{ - return readl(timer->io_base + reg); -} -static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, int reg, u32 value) +inline void omap_dm_timer_write_reg(struct omap_dm_timer *timer, int reg, u32 value) { - writel(value, timer->io_base + reg); + omap_writel(value, timer->base + reg); while (omap_dm_timer_read_reg(timer, OMAP_TIMER_WRITE_PEND_REG)) ; } -static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer) +u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, int reg) { - int c; - - c = 0; - while (!(omap_dm_timer_read_reg(timer, OMAP_TIMER_SYS_STAT_REG) & 1)) { - c++; - if (c > 100000) { - printk(KERN_ERR "Timer failed to reset\n"); - return; - } - } -} - -static void omap_dm_timer_reset(struct omap_dm_timer *timer) -{ - u32 l; - - if (timer != &dm_timers[0]) { - omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06); - omap_dm_timer_wait_for_reset(timer); - } - omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_SYS_CLK); - - /* Set to smart-idle mode */ - l = omap_dm_timer_read_reg(timer, OMAP_TIMER_OCP_CFG_REG); - l |= 0x02 << 3; - omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l); -} - -static void omap_dm_timer_prepare(struct omap_dm_timer *timer) -{ -#ifdef CONFIG_ARCH_OMAP2 - clk_enable(timer->iclk); - clk_enable(timer->fclk); -#endif - omap_dm_timer_reset(timer); -} - -struct omap_dm_timer *omap_dm_timer_request(void) -{ - struct omap_dm_timer *timer = NULL; - unsigned long flags; - int i; - - spin_lock_irqsave(&dm_timer_lock, flags); - for (i = 0; i < dm_timer_count; i++) { - if (dm_timers[i].reserved) - continue; - - timer = &dm_timers[i]; - timer->reserved = 1; - break; - } - spin_unlock_irqrestore(&dm_timer_lock, flags); - - if (timer != NULL) - omap_dm_timer_prepare(timer); - - return timer; + return omap_readl(timer->base + reg); } -struct omap_dm_timer *omap_dm_timer_request_specific(int id) +int omap_dm_timers_active(void) { struct omap_dm_timer *timer; - unsigned long flags; - - spin_lock_irqsave(&dm_timer_lock, flags); - if (id <= 0 || id > dm_timer_count || dm_timers[id-1].reserved) { - spin_unlock_irqrestore(&dm_timer_lock, flags); - printk("BUG: warning at %s:%d/%s(): unable to get timer %d\n", - __FILE__, __LINE__, __FUNCTION__, id); - dump_stack(); - return NULL; - } - - timer = &dm_timers[id-1]; - timer->reserved = 1; - spin_unlock_irqrestore(&dm_timer_lock, flags); - - omap_dm_timer_prepare(timer); - return timer; -} - -void omap_dm_timer_free(struct omap_dm_timer *timer) -{ - omap_dm_timer_reset(timer); -#ifdef CONFIG_ARCH_OMAP2 - clk_disable(timer->iclk); - clk_disable(timer->fclk); -#endif - WARN_ON(!timer->reserved); - timer->reserved = 0; -} + for (timer = &dm_timers[0]; timer->base; ++timer) + if (omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG) & + OMAP_TIMER_CTRL_ST) + return 1; -int omap_dm_timer_get_irq(struct omap_dm_timer *timer) -{ - return timer->irq; + return 0; } -#if defined(CONFIG_ARCH_OMAP1) - -struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) -{ - BUG(); -} /** * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR @@ -250,229 +103,184 @@ struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) */ __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask) { - int i; + int n; /* If ARMXOR cannot be idled this function call is unnecessary */ if (!(inputmask & (1 << 1))) return inputmask; /* If any active timer is using ARMXOR return modified mask */ - for (i = 0; i < dm_timer_count; i++) { - u32 l; - - l = omap_dm_timer_read_reg(&dm_timers[i], OMAP_TIMER_CTRL_REG); - if (l & OMAP_TIMER_CTRL_ST) { - if (((omap_readl(MOD_CONF_CTRL_1) >> (i * 2)) & 0x03) == 0) + for (n = 0; dm_timers[n].base; ++n) + if (omap_dm_timer_read_reg(&dm_timers[n], OMAP_TIMER_CTRL_REG)& + OMAP_TIMER_CTRL_ST) { + if (((omap_readl(MOD_CONF_CTRL_1)>>(n*2)) & 0x03) == 0) inputmask &= ~(1 << 1); else inputmask &= ~(1 << 2); } - } return inputmask; } -#elif defined(CONFIG_ARCH_OMAP2) -struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) +void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) { - return timer->fclk; -} + int n = (timer - dm_timers) << 1; + u32 l; -__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask) -{ - BUG(); + l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n); + l |= source << n; + omap_writel(l, MOD_CONF_CTRL_1); } -#endif -void omap_dm_timer_trigger(struct omap_dm_timer *timer) +static void omap_dm_timer_reset(struct omap_dm_timer *timer) { - omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0); + /* Reset and set posted mode */ + omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06); + omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, 0x02); + + omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_ARMXOR); } -void omap_dm_timer_start(struct omap_dm_timer *timer) -{ - u32 l; - l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); - if (!(l & OMAP_TIMER_CTRL_ST)) { - l |= OMAP_TIMER_CTRL_ST; - omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); - } -} -void omap_dm_timer_stop(struct omap_dm_timer *timer) +struct omap_dm_timer * omap_dm_timer_request(void) { - u32 l; + struct omap_dm_timer *timer = NULL; + unsigned long flags; - l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); - if (l & OMAP_TIMER_CTRL_ST) { - l &= ~0x1; - omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); + spin_lock_irqsave(&dm_timer_lock, flags); + if (!list_empty(&dm_timer_info.unused_timers)) { + timer = (struct omap_dm_timer *) + dm_timer_info.unused_timers.next; + list_move_tail((struct list_head *)timer, + &dm_timer_info.reserved_timers); } + spin_unlock_irqrestore(&dm_timer_lock, flags); + + return timer; } -#ifdef CONFIG_ARCH_OMAP1 -void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) +void omap_dm_timer_free(struct omap_dm_timer *timer) { - int n = (timer - dm_timers) << 1; - u32 l; + unsigned long flags; - l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n); - l |= source << n; - omap_writel(l, MOD_CONF_CTRL_1); -} + omap_dm_timer_reset(timer); -#else + spin_lock_irqsave(&dm_timer_lock, flags); + list_move_tail((struct list_head *)timer, &dm_timer_info.unused_timers); + spin_unlock_irqrestore(&dm_timer_lock, flags); +} -void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) +void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, + unsigned int value) { - if (source < 0 || source >= 3) - return; - - clk_disable(timer->fclk); - clk_set_parent(timer->fclk, dm_source_clocks[source]); - clk_enable(timer->fclk); + omap_dm_timer_write_reg(timer, OMAP_TIMER_INT_EN_REG, value); +} - /* When the functional clock disappears, too quick writes seem to - * cause an abort. */ - __delay(15000); +unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer) +{ + return omap_dm_timer_read_reg(timer, OMAP_TIMER_STAT_REG); } -#endif +void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value) +{ + omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, value); +} -void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, - unsigned int load) +void omap_dm_timer_enable_autoreload(struct omap_dm_timer *timer) { u32 l; - l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); - if (autoreload) - l |= OMAP_TIMER_CTRL_AR; - else - l &= ~OMAP_TIMER_CTRL_AR; + l |= OMAP_TIMER_CTRL_AR; omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); - omap_dm_timer_write_reg(timer, OMAP_TIMER_LOAD_REG, load); - omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0); } -void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, - unsigned int match) +void omap_dm_timer_trigger(struct omap_dm_timer *timer) +{ + omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 1); +} + +void omap_dm_timer_set_trigger(struct omap_dm_timer *timer, unsigned int value) { u32 l; l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); - if (enable) - l |= OMAP_TIMER_CTRL_CE; - else - l &= ~OMAP_TIMER_CTRL_CE; + l |= value & 0x3; omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); - omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG, match); } - -void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, - int toggle, int trigger) +void omap_dm_timer_start(struct omap_dm_timer *timer) { u32 l; l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); - l &= ~(OMAP_TIMER_CTRL_GPOCFG | OMAP_TIMER_CTRL_SCPWM | - OMAP_TIMER_CTRL_PT | (0x03 << 10)); - if (def_on) - l |= OMAP_TIMER_CTRL_SCPWM; - if (toggle) - l |= OMAP_TIMER_CTRL_PT; - l |= trigger << 10; + l |= OMAP_TIMER_CTRL_ST; omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); } -void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler) +void omap_dm_timer_stop(struct omap_dm_timer *timer) { u32 l; l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); - l &= ~(OMAP_TIMER_CTRL_PRE | (0x07 << 2)); - if (prescaler >= 0x00 && prescaler <= 0x07) { - l |= OMAP_TIMER_CTRL_PRE; - l |= prescaler << 2; - } + l &= ~0x1; omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); } -void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, - unsigned int value) -{ - omap_dm_timer_write_reg(timer, OMAP_TIMER_INT_EN_REG, value); -} - -unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer) +unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer) { - return omap_dm_timer_read_reg(timer, OMAP_TIMER_STAT_REG); + return omap_dm_timer_read_reg(timer, OMAP_TIMER_COUNTER_REG); } -void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value) +void omap_dm_timer_reset_counter(struct omap_dm_timer *timer) { - omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, value); + omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, 0); } -unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer) +void omap_dm_timer_set_load(struct omap_dm_timer *timer, unsigned int load) { - return omap_dm_timer_read_reg(timer, OMAP_TIMER_COUNTER_REG); + omap_dm_timer_write_reg(timer, OMAP_TIMER_LOAD_REG, load); } -void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value) +void omap_dm_timer_set_match(struct omap_dm_timer *timer, unsigned int match) { - return omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value); + omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG, match); } -int omap_dm_timers_active(void) +void omap_dm_timer_enable_compare(struct omap_dm_timer *timer) { - int i; - - for (i = 0; i < dm_timer_count; i++) { - struct omap_dm_timer *timer; + u32 l; - timer = &dm_timers[i]; - if (omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG) & - OMAP_TIMER_CTRL_ST) - return 1; - } - return 0; + l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); + l |= OMAP_TIMER_CTRL_CE; + omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); } -int omap_dm_timer_init(void) + +static inline void __dm_timer_init(void) { struct omap_dm_timer *timer; - int i; - - if (!(cpu_is_omap16xx() || cpu_is_omap24xx())) - return -ENODEV; spin_lock_init(&dm_timer_lock); -#ifdef CONFIG_ARCH_OMAP2 - for (i = 0; i < ARRAY_SIZE(dm_source_names); i++) { - dm_source_clocks[i] = clk_get(NULL, dm_source_names[i]); - BUG_ON(dm_source_clocks[i] == NULL); - } -#endif - - for (i = 0; i < dm_timer_count; i++) { -#ifdef CONFIG_ARCH_OMAP2 - char clk_name[16]; -#endif - - timer = &dm_timers[i]; - timer->io_base = (void __iomem *) io_p2v(timer->phys_base); -#ifdef CONFIG_ARCH_OMAP2 - sprintf(clk_name, "gpt%d_ick", i + 1); - timer->iclk = clk_get(NULL, clk_name); - sprintf(clk_name, "gpt%d_fck", i + 1); - timer->fclk = clk_get(NULL, clk_name); -#endif + INIT_LIST_HEAD(&dm_timer_info.unused_timers); + INIT_LIST_HEAD(&dm_timer_info.reserved_timers); + + timer = &dm_timers[0]; + while (timer->base) { + list_add_tail((struct list_head *)timer, &dm_timer_info.unused_timers); + omap_dm_timer_reset(timer); + timer++; } +} +static int __init omap_dm_timer_init(void) +{ + if (cpu_is_omap16xx()) + __dm_timer_init(); return 0; } + +arch_initcall(omap_dm_timer_init); diff --git a/trunk/arch/arm/plat-omap/fb.c b/trunk/arch/arm/plat-omap/fb.c index 56acb8720f78..305e9b990b71 100644 --- a/trunk/arch/arm/plat-omap/fb.c +++ b/trunk/arch/arm/plat-omap/fb.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/arm/plat-omap/gpio.c b/trunk/arch/arm/plat-omap/gpio.c index fec7970e564d..d3c8ea7eecfd 100644 --- a/trunk/arch/arm/plat-omap/gpio.c +++ b/trunk/arch/arm/plat-omap/gpio.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -536,49 +537,6 @@ static inline void _clear_gpio_irqstatus(struct gpio_bank *bank, int gpio) _clear_gpio_irqbank(bank, 1 << get_gpio_index(gpio)); } -static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank) -{ - void __iomem *reg = bank->base; - int inv = 0; - u32 l; - u32 mask; - - switch (bank->method) { - case METHOD_MPUIO: - reg += OMAP_MPUIO_GPIO_MASKIT; - mask = 0xffff; - inv = 1; - break; - case METHOD_GPIO_1510: - reg += OMAP1510_GPIO_INT_MASK; - mask = 0xffff; - inv = 1; - break; - case METHOD_GPIO_1610: - reg += OMAP1610_GPIO_IRQENABLE1; - mask = 0xffff; - break; - case METHOD_GPIO_730: - reg += OMAP730_GPIO_INT_MASK; - mask = 0xffffffff; - inv = 1; - break; - case METHOD_GPIO_24XX: - reg += OMAP24XX_GPIO_IRQENABLE1; - mask = 0xffffffff; - break; - default: - BUG(); - return 0; - } - - l = __raw_readl(reg); - if (inv) - l = ~l; - l &= mask; - return l; -} - static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enable) { void __iomem *reg = bank->base; @@ -778,12 +736,10 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc, u32 isr; unsigned int gpio_irq; struct gpio_bank *bank; - u32 retrigger = 0; - int unmasked = 0; desc->chip->ack(irq); - bank = get_irq_data(irq); + bank = (struct gpio_bank *) desc->data; if (bank->method == METHOD_MPUIO) isr_reg = bank->base + OMAP_MPUIO_GPIO_INT; #ifdef CONFIG_ARCH_OMAP15XX @@ -804,22 +760,18 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc, #endif while(1) { u32 isr_saved, level_mask = 0; - u32 enabled; - enabled = _get_gpio_irqbank_mask(bank); - isr_saved = isr = __raw_readl(isr_reg) & enabled; + isr_saved = isr = __raw_readl(isr_reg); if (cpu_is_omap15xx() && (bank->method == METHOD_MPUIO)) isr &= 0x0000ffff; - if (cpu_is_omap24xx()) { + if (cpu_is_omap24xx()) level_mask = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0) | __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1); - level_mask &= enabled; - } /* clear edge sensitive interrupts before handler(s) are called so that we don't miss any interrupt occurred while @@ -830,55 +782,19 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc, /* if there is only edge sensitive GPIO pin interrupts configured, we could unmask GPIO bank interrupt immediately */ - if (!level_mask && !unmasked) { - unmasked = 1; + if (!level_mask) desc->chip->unmask(irq); - } - isr |= retrigger; - retrigger = 0; if (!isr) break; gpio_irq = bank->virtual_irq_start; for (; isr != 0; isr >>= 1, gpio_irq++) { struct irqdesc *d; - int irq_mask; if (!(isr & 1)) continue; d = irq_desc + gpio_irq; - /* Don't run the handler if it's already running - * or was disabled lazely. - */ - if (unlikely((d->depth || - (d->status & IRQ_INPROGRESS)))) { - irq_mask = 1 << - (gpio_irq - bank->virtual_irq_start); - /* The unmasking will be done by - * enable_irq in case it is disabled or - * after returning from the handler if - * it's already running. - */ - _enable_gpio_irqbank(bank, irq_mask, 0); - if (!d->depth) { - /* Level triggered interrupts - * won't ever be reentered - */ - BUG_ON(level_mask & irq_mask); - d->status |= IRQ_PENDING; - } - continue; - } - desc_handle_irq(gpio_irq, d, regs); - - if (unlikely((d->status & IRQ_PENDING) && !d->depth)) { - irq_mask = 1 << - (gpio_irq - bank->virtual_irq_start); - d->status &= ~IRQ_PENDING; - _enable_gpio_irqbank(bank, irq_mask, 1); - retrigger |= irq_mask; - } } if (cpu_is_omap24xx()) { @@ -888,14 +804,13 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc, _enable_gpio_irqbank(bank, isr_saved & level_mask, 1); } + /* if bank has any level sensitive GPIO pin interrupt + configured, we must unmask the bank interrupt only after + handler(s) are executed in order to avoid spurious bank + interrupt */ + if (level_mask) + desc->chip->unmask(irq); } - /* if bank has any level sensitive GPIO pin interrupt - configured, we must unmask the bank interrupt only after - handler(s) are executed in order to avoid spurious bank - interrupt */ - if (!unmasked) - desc->chip->unmask(irq); - } static void gpio_ack_irq(unsigned int irq) diff --git a/trunk/arch/arm/plat-omap/mux.c b/trunk/arch/arm/plat-omap/mux.c index 042105ac30b8..8c1c016aa689 100644 --- a/trunk/arch/arm/plat-omap/mux.c +++ b/trunk/arch/arm/plat-omap/mux.c @@ -22,6 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#include #include #include #include diff --git a/trunk/arch/arm/plat-omap/ocpi.c b/trunk/arch/arm/plat-omap/ocpi.c index b5d307026c82..37792d43738b 100644 --- a/trunk/arch/arm/plat-omap/ocpi.c +++ b/trunk/arch/arm/plat-omap/ocpi.c @@ -23,6 +23,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/arm/plat-omap/pm.c b/trunk/arch/arm/plat-omap/pm.c index 04b4102727a8..1a24e2c10714 100644 --- a/trunk/arch/arm/plat-omap/pm.c +++ b/trunk/arch/arm/plat-omap/pm.c @@ -580,7 +580,7 @@ static irqreturn_t omap_wakeup_interrupt(int irq, void * dev, static struct irqaction omap_wakeup_irq = { .name = "peripheral wakeup", - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .handler = omap_wakeup_interrupt }; diff --git a/trunk/arch/arm/plat-omap/sram-fn.S b/trunk/arch/arm/plat-omap/sram-fn.S index 85cffe2c6266..66414cc8e6e3 100644 --- a/trunk/arch/arm/plat-omap/sram-fn.S +++ b/trunk/arch/arm/plat-omap/sram-fn.S @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/plat-omap/sram.c b/trunk/arch/arm/plat-omap/sram.c index e75718301b0f..b7bf09b1b412 100644 --- a/trunk/arch/arm/plat-omap/sram.c +++ b/trunk/arch/arm/plat-omap/sram.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -157,12 +158,14 @@ static struct map_desc omap_sram_io_desc[] __initdata = { { /* .length gets filled in at runtime */ .virtual = OMAP1_SRAM_VA, .pfn = __phys_to_pfn(OMAP1_SRAM_PA), - .type = MT_MEMORY + .type = MT_DEVICE } }; /* - * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early. + * In order to use last 2kB of SRAM on 1611b, we must round the size + * up to multiple of PAGE_SIZE. We cannot use ioremap for SRAM, as + * clock init needs SRAM early. */ void __init omap_map_sram(void) { @@ -182,7 +185,8 @@ void __init omap_map_sram(void) omap_sram_io_desc[0].pfn = __phys_to_pfn(base); } - omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */ + omap_sram_io_desc[0].length = (omap_sram_size + PAGE_SIZE-1)/PAGE_SIZE; + omap_sram_io_desc[0].length *= PAGE_SIZE; iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n", diff --git a/trunk/arch/arm/plat-omap/timer32k.c b/trunk/arch/arm/plat-omap/timer32k.c index 281ecc7fcdfc..3461a6c9665c 100644 --- a/trunk/arch/arm/plat-omap/timer32k.c +++ b/trunk/arch/arm/plat-omap/timer32k.c @@ -7,7 +7,6 @@ * Partial timer rewrite and additional dynamic tick timer support by * Tony Lindgen and * Tuukka Tikkanen - * OMAP Dual-mode timer framework support by Timo Teras * * MPU timer code based on the older MPU timer code for OMAP * Copyright (C) 2000 RidgeRun, Inc. @@ -34,6 +33,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -50,7 +50,6 @@ #include #include #include -#include struct sys_timer omap_timer; @@ -80,6 +79,18 @@ struct sys_timer omap_timer; #define OMAP1_32K_TIMER_TVR 0x00 #define OMAP1_32K_TIMER_TCR 0x04 +/* 24xx specific defines */ +#define OMAP2_GP_TIMER_BASE 0x48028000 +#define CM_CLKSEL_WKUP 0x48008440 +#define GP_TIMER_TIDR 0x00 +#define GP_TIMER_TISR 0x18 +#define GP_TIMER_TIER 0x1c +#define GP_TIMER_TCLR 0x24 +#define GP_TIMER_TCRR 0x28 +#define GP_TIMER_TLDR 0x2c +#define GP_TIMER_TTGR 0x30 +#define GP_TIMER_TSICR 0x40 + #define OMAP_32K_TICKS_PER_HZ (32768 / HZ) /* @@ -91,62 +102,54 @@ struct sys_timer omap_timer; #define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate) \ (((nr_jiffies) * (clock_rate)) / HZ) -#if defined(CONFIG_ARCH_OMAP1) - static inline void omap_32k_timer_write(int val, int reg) { - omap_writew(val, OMAP1_32K_TIMER_BASE + reg); + if (cpu_class_is_omap1()) + omap_writew(val, OMAP1_32K_TIMER_BASE + reg); + + if (cpu_is_omap24xx()) + omap_writel(val, OMAP2_GP_TIMER_BASE + reg); } static inline unsigned long omap_32k_timer_read(int reg) { - return omap_readl(OMAP1_32K_TIMER_BASE + reg) & 0xffffff; -} + if (cpu_class_is_omap1()) + return omap_readl(OMAP1_32K_TIMER_BASE + reg) & 0xffffff; -static inline void omap_32k_timer_start(unsigned long load_val) -{ - omap_32k_timer_write(load_val, OMAP1_32K_TIMER_TVR); - omap_32k_timer_write(0x0f, OMAP1_32K_TIMER_CR); + if (cpu_is_omap24xx()) + return omap_readl(OMAP2_GP_TIMER_BASE + reg); } -static inline void omap_32k_timer_stop(void) +/* + * The 32KHz synchronized timer is an additional timer on 16xx. + * It is always running. + */ +static inline unsigned long omap_32k_sync_timer_read(void) { - omap_32k_timer_write(0x0, OMAP1_32K_TIMER_CR); + return omap_readl(TIMER_32K_SYNCHRONIZED); } -#define omap_32k_timer_ack_irq() - -#elif defined(CONFIG_ARCH_OMAP2) - -static struct omap_dm_timer *gptimer; - static inline void omap_32k_timer_start(unsigned long load_val) { - omap_dm_timer_set_load(gptimer, 1, 0xffffffff - load_val); - omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW); - omap_dm_timer_start(gptimer); -} + if (cpu_class_is_omap1()) { + omap_32k_timer_write(load_val, OMAP1_32K_TIMER_TVR); + omap_32k_timer_write(0x0f, OMAP1_32K_TIMER_CR); + } -static inline void omap_32k_timer_stop(void) -{ - omap_dm_timer_stop(gptimer); + if (cpu_is_omap24xx()) { + omap_32k_timer_write(0xffffffff - load_val, GP_TIMER_TCRR); + omap_32k_timer_write((1 << 1), GP_TIMER_TIER); + omap_32k_timer_write((1 << 1) | 1, GP_TIMER_TCLR); + } } -static inline void omap_32k_timer_ack_irq(void) +static inline void omap_32k_timer_stop(void) { - u32 status = omap_dm_timer_read_status(gptimer); - omap_dm_timer_write_status(gptimer, status); -} - -#endif + if (cpu_class_is_omap1()) + omap_32k_timer_write(0x0, OMAP1_32K_TIMER_CR); -/* - * The 32KHz synchronized timer is an additional timer on 16xx. - * It is always running. - */ -static inline unsigned long omap_32k_sync_timer_read(void) -{ - return omap_readl(TIMER_32K_SYNCHRONIZED); + if (cpu_is_omap24xx()) + omap_32k_timer_write(0x0, GP_TIMER_TCLR); } /* @@ -200,7 +203,11 @@ static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id, write_seqlock_irqsave(&xtime_lock, flags); - omap_32k_timer_ack_irq(); + if (cpu_is_omap24xx()) { + u32 status = omap_32k_timer_read(GP_TIMER_TISR); + omap_32k_timer_write(status, GP_TIMER_TISR); + } + now = omap_32k_sync_timer_read(); while ((signed long)(now - omap_32k_last_tick) @@ -258,10 +265,13 @@ static struct dyn_tick_timer omap_dyn_tick_timer = { static struct irqaction omap_32k_timer_irq = { .name = "32KHz timer", - .flags = IRQF_DISABLED | IRQF_TIMER, + .flags = SA_INTERRUPT | SA_TIMER, .handler = omap_32k_timer_interrupt, }; +static struct clk * gpt1_ick; +static struct clk * gpt1_fck; + static __init void omap_init_32k_timer(void) { #ifdef CONFIG_NO_IDLE_HZ @@ -270,22 +280,32 @@ static __init void omap_init_32k_timer(void) if (cpu_class_is_omap1()) setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); + if (cpu_is_omap24xx()) + setup_irq(37, &omap_32k_timer_irq); omap_timer.offset = omap_32k_timer_gettimeoffset; omap_32k_last_tick = omap_32k_sync_timer_read(); -#ifdef CONFIG_ARCH_OMAP2 /* REVISIT: Check 24xx TIOCP_CFG settings after idle works */ if (cpu_is_omap24xx()) { - gptimer = omap_dm_timer_request_specific(1); - BUG_ON(gptimer == NULL); - - omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ); - setup_irq(omap_dm_timer_get_irq(gptimer), &omap_32k_timer_irq); - omap_dm_timer_set_int_enable(gptimer, - OMAP_TIMER_INT_CAPTURE | OMAP_TIMER_INT_OVERFLOW | - OMAP_TIMER_INT_MATCH); + omap_32k_timer_write(0, GP_TIMER_TCLR); + omap_writel(0, CM_CLKSEL_WKUP); /* 32KHz clock source */ + + gpt1_ick = clk_get(NULL, "gpt1_ick"); + if (IS_ERR(gpt1_ick)) + printk(KERN_ERR "Could not get gpt1_ick\n"); + else + clk_enable(gpt1_ick); + + gpt1_fck = clk_get(NULL, "gpt1_fck"); + if (IS_ERR(gpt1_fck)) + printk(KERN_ERR "Could not get gpt1_fck\n"); + else + clk_enable(gpt1_fck); + + mdelay(100); /* Wait for clocks to stabilize */ + + omap_32k_timer_write(0x7, GP_TIMER_TISR); } -#endif omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); } @@ -297,9 +317,6 @@ static __init void omap_init_32k_timer(void) */ static void __init omap_timer_init(void) { -#ifdef CONFIG_OMAP_DM_TIMER - omap_dm_timer_init(); -#endif omap_init_32k_timer(); } diff --git a/trunk/arch/arm/plat-omap/usb.c b/trunk/arch/arm/plat-omap/usb.c index 9b815327b6a5..00afc7a8c2ab 100644 --- a/trunk/arch/arm/plat-omap/usb.c +++ b/trunk/arch/arm/plat-omap/usb.c @@ -20,6 +20,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/arm/vfp/vfpmodule.c b/trunk/arch/arm/vfp/vfpmodule.c index 9d265d5e748c..2476f4c2e760 100644 --- a/trunk/arch/arm/vfp/vfpmodule.c +++ b/trunk/arch/arm/vfp/vfpmodule.c @@ -9,6 +9,7 @@ * published by the Free Software Foundation. */ #include +#include #include #include #include diff --git a/trunk/arch/arm26/Kconfig b/trunk/arch/arm26/Kconfig index c14fe918bc4c..cf4ebf4c274d 100644 --- a/trunk/arch/arm26/Kconfig +++ b/trunk/arch/arm26/Kconfig @@ -79,7 +79,7 @@ config ARCH_A5K bool "A5000" select ARCH_MAY_HAVE_PC_FDC help - Say Y here to support the Acorn A5000. + Say Y here to to support the Acorn A5000. Linux can support the internal IDE disk and CD-ROM interface, serial and parallel port, @@ -129,7 +129,7 @@ config ZBOOT_ROM_BSS config XIP_KERNEL bool "Execute In Place (XIP) kernel image" help - Select this option to create a kernel that can be programmed into + Select this option to create a kernel that can be programed into the OS ROMs. comment "At least one math emulation must be selected" @@ -140,7 +140,7 @@ config FPE_NWFPE Say Y to include the NWFPE floating point emulator in the kernel. This is necessary to run most binaries. Linux does not currently support floating point hardware so you need to say Y here even if - your machine has an FPA or floating point co-processor module. + your machine has an FPA or floating point co-processor podule. It is also possible to say M to build the emulator as a module (nwfpe) or indeed to leave it out altogether. However, unless you diff --git a/trunk/arch/arm26/boot/compressed/head.S b/trunk/arch/arm26/boot/compressed/head.S index 2a2cda36d83b..0307804a6070 100644 --- a/trunk/arch/arm26/boot/compressed/head.S +++ b/trunk/arch/arm26/boot/compressed/head.S @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include /* diff --git a/trunk/arch/arm26/kernel/armksyms.c b/trunk/arch/arm26/kernel/armksyms.c index 07907b6ecb63..9d66c27f2724 100644 --- a/trunk/arch/arm26/kernel/armksyms.c +++ b/trunk/arch/arm26/kernel/armksyms.c @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ #include +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/asm-offsets.c b/trunk/arch/arm26/kernel/asm-offsets.c index 76d9d7d489a8..ac682d5fd039 100644 --- a/trunk/arch/arm26/kernel/asm-offsets.c +++ b/trunk/arch/arm26/kernel/asm-offsets.c @@ -12,6 +12,7 @@ * published by the Free Software Foundation. */ +#include #include #include diff --git a/trunk/arch/arm26/kernel/compat.c b/trunk/arch/arm26/kernel/compat.c index 21e966ff0aa7..db0310db8998 100644 --- a/trunk/arch/arm26/kernel/compat.c +++ b/trunk/arch/arm26/kernel/compat.c @@ -16,6 +16,7 @@ * the kernel for 5 years from now (2001). This will allow boot loaders * to convert to the new struct tag way. */ +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/ecard.c b/trunk/arch/arm26/kernel/ecard.c index 047d0a408b9d..f2278aadac8a 100644 --- a/trunk/arch/arm26/kernel/ecard.c +++ b/trunk/arch/arm26/kernel/ecard.c @@ -24,6 +24,7 @@ */ #define ECARD_C +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/fiq.c b/trunk/arch/arm26/kernel/fiq.c index c4776c96be6b..a24272b61f30 100644 --- a/trunk/arch/arm26/kernel/fiq.c +++ b/trunk/arch/arm26/kernel/fiq.c @@ -36,6 +36,7 @@ * - enables FIQ. * 6. Goto 3 */ +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/head.S b/trunk/arch/arm26/kernel/head.S index 93575e0e58fe..8bfc62539ba6 100644 --- a/trunk/arch/arm26/kernel/head.S +++ b/trunk/arch/arm26/kernel/head.S @@ -10,6 +10,7 @@ * * 26-bit kernel startup code */ +#include #include #include diff --git a/trunk/arch/arm26/kernel/irq.c b/trunk/arch/arm26/kernel/irq.c index d87d68b77d66..0934e6fba606 100644 --- a/trunk/arch/arm26/kernel/irq.c +++ b/trunk/arch/arm26/kernel/irq.c @@ -18,6 +18,7 @@ * IRQ's are in fact implemented a bit like signal handlers for the kernel. * Naturally it's not a 1:1 relation, but there are similarities. */ +#include #include #include #include @@ -190,7 +191,7 @@ __do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs) int ret; spin_unlock(&irq_controller_lock); - if (!(action->flags & IRQF_DISABLED)) + if (!(action->flags & SA_INTERRUPT)) local_irq_enable(); status = 0; @@ -201,7 +202,7 @@ __do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs) action = action->next; } while (action); - if (status & IRQF_SAMPLE_RANDOM) + if (status & SA_SAMPLE_RANDOM) add_interrupt_randomness(irq); spin_lock_irq(&irq_controller_lock); @@ -451,7 +452,7 @@ int setup_irq(unsigned int irq, struct irqaction *new) * so we have to be careful not to interfere with a * running system. */ - if (new->flags & IRQF_SAMPLE_RANDOM) { + if (new->flags & SA_SAMPLE_RANDOM) { /* * This function might sleep, we want to call it first, * outside of the atomic block. @@ -471,7 +472,7 @@ int setup_irq(unsigned int irq, struct irqaction *new) p = &desc->action; if ((old = *p) != NULL) { /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & IRQF_SHARED)) { + if (!(old->flags & new->flags & SA_SHIRQ)) { spin_unlock_irqrestore(&irq_controller_lock, flags); return -EBUSY; } @@ -526,11 +527,11 @@ int setup_irq(unsigned int irq, struct irqaction *new) * * Flags: * - * IRQF_SHARED Interrupt is shared + * SA_SHIRQ Interrupt is shared * - * IRQF_DISABLED Disable local interrupts while processing + * SA_INTERRUPT Disable local interrupts while processing * - * IRQF_SAMPLE_RANDOM The interrupt can be used for entropy + * SA_SAMPLE_RANDOM The interrupt can be used for entropy * */ @@ -542,7 +543,7 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_ struct irqaction *action; if (irq >= NR_IRQS || !irq_desc[irq].valid || !handler || - (irq_flags & IRQF_SHARED && !dev_id)) + (irq_flags & SA_SHIRQ && !dev_id)) return -EINVAL; action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL); diff --git a/trunk/arch/arm26/kernel/process.c b/trunk/arch/arm26/kernel/process.c index dcd81e62ff4e..386305659171 100644 --- a/trunk/arch/arm26/kernel/process.c +++ b/trunk/arch/arm26/kernel/process.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/ptrace.c b/trunk/arch/arm26/kernel/ptrace.c index 9343889b27fe..282e24d79328 100644 --- a/trunk/arch/arm26/kernel/ptrace.c +++ b/trunk/arch/arm26/kernel/ptrace.c @@ -9,6 +9,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/semaphore.c b/trunk/arch/arm26/kernel/semaphore.c index 5447a06db3fa..3023a53431ff 100644 --- a/trunk/arch/arm26/kernel/semaphore.c +++ b/trunk/arch/arm26/kernel/semaphore.c @@ -13,6 +13,7 @@ * published by the Free Software Foundation. */ #include +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/setup.c b/trunk/arch/arm26/kernel/setup.c index 843c29fe9af5..4eb329e3828a 100644 --- a/trunk/arch/arm26/kernel/setup.c +++ b/trunk/arch/arm26/kernel/setup.c @@ -8,6 +8,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/signal.c b/trunk/arch/arm26/kernel/signal.c index 6a8ef8da6dab..2a48c12100c0 100644 --- a/trunk/arch/arm26/kernel/signal.c +++ b/trunk/arch/arm26/kernel/signal.c @@ -10,6 +10,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/time.c b/trunk/arch/arm26/kernel/time.c index db63d75d0715..335525339ad6 100644 --- a/trunk/arch/arm26/kernel/time.c +++ b/trunk/arch/arm26/kernel/time.c @@ -18,6 +18,7 @@ * "A Kernel Model for Precision Timekeeping" by Dave Mills */ +#include #include #include #include @@ -205,7 +206,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction timer_irq = { .name = "timer", - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .handler = timer_interrupt, }; diff --git a/trunk/arch/arm26/kernel/traps.c b/trunk/arch/arm26/kernel/traps.c index d594fb59e945..a79de041b50e 100644 --- a/trunk/arch/arm26/kernel/traps.c +++ b/trunk/arch/arm26/kernel/traps.c @@ -15,6 +15,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/arm26/kernel/vmlinux.lds.S b/trunk/arch/arm26/kernel/vmlinux.lds.S index 1fa39f02e07c..811a69048010 100644 --- a/trunk/arch/arm26/kernel/vmlinux.lds.S +++ b/trunk/arch/arm26/kernel/vmlinux.lds.S @@ -1,3 +1,4 @@ +#include #ifdef CONFIG_XIP_KERNEL diff --git a/trunk/arch/arm26/lib/backtrace.S b/trunk/arch/arm26/lib/backtrace.S index e27feb1e891d..d793fe4339fc 100644 --- a/trunk/arch/arm26/lib/backtrace.S +++ b/trunk/arch/arm26/lib/backtrace.S @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include .text diff --git a/trunk/arch/arm26/lib/csumpartialcopyuser.S b/trunk/arch/arm26/lib/csumpartialcopyuser.S index a98eea74305a..261dd154c1a4 100644 --- a/trunk/arch/arm26/lib/csumpartialcopyuser.S +++ b/trunk/arch/arm26/lib/csumpartialcopyuser.S @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm26/lib/kbd.c b/trunk/arch/arm26/lib/kbd.c index cb56e943e006..22d2c93aaf1a 100644 --- a/trunk/arch/arm26/lib/kbd.c +++ b/trunk/arch/arm26/lib/kbd.c @@ -1,3 +1,4 @@ +#include #include //#include #include diff --git a/trunk/arch/arm26/lib/lib1funcs.S b/trunk/arch/arm26/lib/lib1funcs.S index 0e29970b0e8a..b8f9518db871 100644 --- a/trunk/arch/arm26/lib/lib1funcs.S +++ b/trunk/arch/arm26/lib/lib1funcs.S @@ -39,6 +39,7 @@ Boston, MA 02111-1307, USA. */ #include #include #include +#include #define RET movs #define RETc(x) mov##x##s diff --git a/trunk/arch/arm26/machine/dma.c b/trunk/arch/arm26/machine/dma.c index 4402a5a1b78f..cbc7c61d5b32 100644 --- a/trunk/arch/arm26/machine/dma.c +++ b/trunk/arch/arm26/machine/dma.c @@ -10,6 +10,7 @@ * * DMA functions specific to Archimedes and A5000 architecture */ +#include #include #include diff --git a/trunk/arch/arm26/machine/irq.c b/trunk/arch/arm26/machine/irq.c index a60d543edecc..4361863f7ed2 100644 --- a/trunk/arch/arm26/machine/irq.c +++ b/trunk/arch/arm26/machine/irq.c @@ -16,6 +16,7 @@ * 08-09-2002 IM Brought up to date for 2.5 * 01-06-2003 JMA Removed arc_fiq_chip */ +#include #include #include diff --git a/trunk/arch/arm26/mm/extable.c b/trunk/arch/arm26/mm/extable.c index 38e1958d9538..2d9f5b5a78d6 100644 --- a/trunk/arch/arm26/mm/extable.c +++ b/trunk/arch/arm26/mm/extable.c @@ -2,6 +2,7 @@ * linux/arch/arm26/mm/extable.c */ +#include #include #include diff --git a/trunk/arch/arm26/mm/fault.c b/trunk/arch/arm26/mm/fault.c index 761938b56679..bd6f2db608b7 100644 --- a/trunk/arch/arm26/mm/fault.c +++ b/trunk/arch/arm26/mm/fault.c @@ -8,6 +8,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm26/mm/init.c b/trunk/arch/arm26/mm/init.c index 562fac12eb95..7da8a5205678 100644 --- a/trunk/arch/arm26/mm/init.c +++ b/trunk/arch/arm26/mm/init.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm26/nwfpe/fpmodule.c b/trunk/arch/arm26/nwfpe/fpmodule.c index a8fad92eb44f..5258c6096fb9 100644 --- a/trunk/arch/arm26/nwfpe/fpmodule.c +++ b/trunk/arch/arm26/nwfpe/fpmodule.c @@ -25,6 +25,7 @@ #include #include +#include /* XXX */ #include diff --git a/trunk/arch/arm26/nwfpe/fpmodule.h b/trunk/arch/arm26/nwfpe/fpmodule.h index f971ddd60cc1..ef71aab46a32 100644 --- a/trunk/arch/arm26/nwfpe/fpmodule.h +++ b/trunk/arch/arm26/nwfpe/fpmodule.h @@ -22,6 +22,7 @@ #ifndef __FPMODULE_H__ #define __FPMODULE_H__ +#include #define REG_ORIG_R0 16 #define REG_CPSR 15 diff --git a/trunk/arch/cris/arch-v10/boot/compressed/head.S b/trunk/arch/cris/arch-v10/boot/compressed/head.S index 610bdb237553..e73f44c998d9 100644 --- a/trunk/arch/cris/arch-v10/boot/compressed/head.S +++ b/trunk/arch/cris/arch-v10/boot/compressed/head.S @@ -8,6 +8,7 @@ * */ +#include #define ASSEMBLER_MACROS_ONLY #include diff --git a/trunk/arch/cris/arch-v10/boot/compressed/misc.c b/trunk/arch/cris/arch-v10/boot/compressed/misc.c index ffb8d21b2f83..1b5e83f1f846 100644 --- a/trunk/arch/cris/arch-v10/boot/compressed/misc.c +++ b/trunk/arch/cris/arch-v10/boot/compressed/misc.c @@ -20,6 +20,7 @@ #define KERNEL_LOAD_ADR 0x40004000 +#include #include #include diff --git a/trunk/arch/cris/arch-v10/boot/rescue/head.S b/trunk/arch/cris/arch-v10/boot/rescue/head.S index f223cc0c00bb..addb2194de0f 100644 --- a/trunk/arch/cris/arch-v10/boot/rescue/head.S +++ b/trunk/arch/cris/arch-v10/boot/rescue/head.S @@ -63,6 +63,7 @@ * Copyright (C) 1999, 2000, 2001, 2002, 2003 Axis Communications AB */ +#include #define ASSEMBLER_MACROS_ONLY #include diff --git a/trunk/arch/cris/arch-v10/boot/rescue/kimagerescue.S b/trunk/arch/cris/arch-v10/boot/rescue/kimagerescue.S index cbccd6316d39..264bf7afc9ad 100644 --- a/trunk/arch/cris/arch-v10/boot/rescue/kimagerescue.S +++ b/trunk/arch/cris/arch-v10/boot/rescue/kimagerescue.S @@ -6,6 +6,7 @@ * 4004000 and after a timeout jump to it. */ +#include #define ASSEMBLER_MACROS_ONLY #include diff --git a/trunk/arch/cris/arch-v10/drivers/axisflashmap.c b/trunk/arch/cris/arch-v10/drivers/axisflashmap.c index 4fa81abab0c7..56b038c8d482 100644 --- a/trunk/arch/cris/arch-v10/drivers/axisflashmap.c +++ b/trunk/arch/cris/arch-v10/drivers/axisflashmap.c @@ -138,6 +138,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/cris/arch-v10/drivers/ds1302.c b/trunk/arch/cris/arch-v10/drivers/ds1302.c index 3cf4f23de1d0..b100f26497c4 100644 --- a/trunk/arch/cris/arch-v10/drivers/ds1302.c +++ b/trunk/arch/cris/arch-v10/drivers/ds1302.c @@ -139,6 +139,7 @@ *! *!***************************************************************************/ +#include #include #include diff --git a/trunk/arch/cris/arch-v10/drivers/eeprom.c b/trunk/arch/cris/arch-v10/drivers/eeprom.c index 037582028560..512f16dec060 100644 --- a/trunk/arch/cris/arch-v10/drivers/eeprom.c +++ b/trunk/arch/cris/arch-v10/drivers/eeprom.c @@ -93,6 +93,7 @@ *! (c) 1999 Axis Communications AB, Lund, Sweden *!*****************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v10/drivers/gpio.c b/trunk/arch/cris/arch-v10/drivers/gpio.c index 48fd801792d1..09963fe299a7 100644 --- a/trunk/arch/cris/arch-v10/drivers/gpio.c +++ b/trunk/arch/cris/arch-v10/drivers/gpio.c @@ -135,6 +135,7 @@ * */ +#include #include #include @@ -937,11 +938,11 @@ gpio_init(void) * in some tests. */ if (request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt, - IRQF_SHARED | IRQF_DISABLED,"gpio poll", NULL)) { + SA_SHIRQ | SA_INTERRUPT,"gpio poll", NULL)) { printk(KERN_CRIT "err: timer0 irq for gpio\n"); } if (request_irq(PA_IRQ_NBR, gpio_pa_interrupt, - IRQF_SHARED | IRQF_DISABLED,"gpio PA", NULL)) { + SA_SHIRQ | SA_INTERRUPT,"gpio PA", NULL)) { printk(KERN_CRIT "err: PA irq for gpio\n"); } diff --git a/trunk/arch/cris/arch-v10/drivers/i2c.c b/trunk/arch/cris/arch-v10/drivers/i2c.c index 6114596c3b33..b38267d60d30 100644 --- a/trunk/arch/cris/arch-v10/drivers/i2c.c +++ b/trunk/arch/cris/arch-v10/drivers/i2c.c @@ -96,6 +96,7 @@ #include #include #include +#include #include diff --git a/trunk/arch/cris/arch-v10/drivers/pcf8563.c b/trunk/arch/cris/arch-v10/drivers/pcf8563.c index 8c830eefc89c..af517c210383 100644 --- a/trunk/arch/cris/arch-v10/drivers/pcf8563.c +++ b/trunk/arch/cris/arch-v10/drivers/pcf8563.c @@ -18,6 +18,7 @@ * $Id: pcf8563.c,v 1.11 2005/03/07 13:13:07 starvik Exp $ */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v10/kernel/crisksyms.c b/trunk/arch/cris/arch-v10/kernel/crisksyms.c index e6b80135502f..b332bf9b312b 100644 --- a/trunk/arch/cris/arch-v10/kernel/crisksyms.c +++ b/trunk/arch/cris/arch-v10/kernel/crisksyms.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v10/kernel/debugport.c b/trunk/arch/cris/arch-v10/kernel/debugport.c index 2b536ca6f444..dde813e16294 100644 --- a/trunk/arch/cris/arch-v10/kernel/debugport.c +++ b/trunk/arch/cris/arch-v10/kernel/debugport.c @@ -103,6 +103,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v10/kernel/entry.S b/trunk/arch/cris/arch-v10/kernel/entry.S index ae45d4522e65..c808005e8457 100644 --- a/trunk/arch/cris/arch-v10/kernel/entry.S +++ b/trunk/arch/cris/arch-v10/kernel/entry.S @@ -263,6 +263,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v10/kernel/fasttimer.c b/trunk/arch/cris/arch-v10/kernel/fasttimer.c index 8cbdf594b369..cac05a5e514c 100644 --- a/trunk/arch/cris/arch-v10/kernel/fasttimer.c +++ b/trunk/arch/cris/arch-v10/kernel/fasttimer.c @@ -111,6 +111,7 @@ #include #include +#include #include #include diff --git a/trunk/arch/cris/arch-v10/kernel/head.S b/trunk/arch/cris/arch-v10/kernel/head.S index d946d8b8d277..f00c145b43f1 100644 --- a/trunk/arch/cris/arch-v10/kernel/head.S +++ b/trunk/arch/cris/arch-v10/kernel/head.S @@ -183,6 +183,7 @@ * */ +#include #define ASSEMBLER_MACROS_ONLY /* The IO_* macros use the ## token concatenation operator, so -traditional must not be used when assembling this file. */ diff --git a/trunk/arch/cris/arch-v10/kernel/irq.c b/trunk/arch/cris/arch-v10/kernel/irq.c index 96094cbf1255..2d5be93b5197 100644 --- a/trunk/arch/cris/arch-v10/kernel/irq.c +++ b/trunk/arch/cris/arch-v10/kernel/irq.c @@ -15,6 +15,7 @@ #include #include #include +#include #define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr)); #define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr)); diff --git a/trunk/arch/cris/arch-v10/kernel/process.c b/trunk/arch/cris/arch-v10/kernel/process.c index b6831ceb6a62..0a675ce9e099 100644 --- a/trunk/arch/cris/arch-v10/kernel/process.c +++ b/trunk/arch/cris/arch-v10/kernel/process.c @@ -11,6 +11,7 @@ * This file handles the architecture-dependent parts of process handling.. */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v10/kernel/setup.c b/trunk/arch/cris/arch-v10/kernel/setup.c index 682ef955aec4..b668d7fb68ee 100644 --- a/trunk/arch/cris/arch-v10/kernel/setup.c +++ b/trunk/arch/cris/arch-v10/kernel/setup.c @@ -10,6 +10,7 @@ * This file handles the architecture-dependent parts of initialization */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v10/kernel/time.c b/trunk/arch/cris/arch-v10/kernel/time.c index 9c22b76e129a..dc3dfe9b4a1a 100644 --- a/trunk/arch/cris/arch-v10/kernel/time.c +++ b/trunk/arch/cris/arch-v10/kernel/time.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include @@ -251,11 +252,11 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -/* timer is IRQF_SHARED so drivers can add stuff to the timer irq chain - * it needs to be IRQF_DISABLED to make the jiffies update work properly +/* timer is SA_SHIRQ so drivers can add stuff to the timer irq chain + * it needs to be SA_INTERRUPT to make the jiffies update work properly */ -static struct irqaction irq2 = { timer_interrupt, IRQF_SHARED | IRQF_DISABLED, +static struct irqaction irq2 = { timer_interrupt, SA_SHIRQ | SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL}; void __init diff --git a/trunk/arch/cris/arch-v10/kernel/traps.c b/trunk/arch/cris/arch-v10/kernel/traps.c index 4becc1bcced9..34a27ea2052d 100644 --- a/trunk/arch/cris/arch-v10/kernel/traps.c +++ b/trunk/arch/cris/arch-v10/kernel/traps.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v10/lib/dram_init.S b/trunk/arch/cris/arch-v10/lib/dram_init.S index 9cf83932cd5d..2ef4ad5706ef 100644 --- a/trunk/arch/cris/arch-v10/lib/dram_init.S +++ b/trunk/arch/cris/arch-v10/lib/dram_init.S @@ -70,6 +70,7 @@ * uses this code. */ +#include ;; WARNING! The registers r8 and r9 are used as parameters carrying ;; information from the decompressor (if the kernel was compressed). diff --git a/trunk/arch/cris/arch-v10/mm/init.c b/trunk/arch/cris/arch-v10/mm/init.c index e0fcd1a9bfd5..ff3481e76dd4 100644 --- a/trunk/arch/cris/arch-v10/mm/init.c +++ b/trunk/arch/cris/arch-v10/mm/init.c @@ -2,6 +2,7 @@ * linux/arch/cris/arch-v10/mm/init.c * */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v10/vmlinux.lds.S b/trunk/arch/cris/arch-v10/vmlinux.lds.S index 689729a7e66e..71ba736be8f0 100644 --- a/trunk/arch/cris/arch-v10/vmlinux.lds.S +++ b/trunk/arch/cris/arch-v10/vmlinux.lds.S @@ -8,6 +8,7 @@ * the kernel has booted. */ +#include #include jiffies = jiffies_64; diff --git a/trunk/arch/cris/arch-v32/boot/compressed/head.S b/trunk/arch/cris/arch-v32/boot/compressed/head.S index 34cea10a8998..0c55b83b8287 100644 --- a/trunk/arch/cris/arch-v32/boot/compressed/head.S +++ b/trunk/arch/cris/arch-v32/boot/compressed/head.S @@ -5,6 +5,7 @@ * Copyright (C) 1999 - 2003, Axis Communications AB */ +#include #define ASSEMBLER_MACROS_ONLY #include #include diff --git a/trunk/arch/cris/arch-v32/boot/compressed/misc.c b/trunk/arch/cris/arch-v32/boot/compressed/misc.c index 11902697196d..54644238ed59 100644 --- a/trunk/arch/cris/arch-v32/boot/compressed/misc.c +++ b/trunk/arch/cris/arch-v32/boot/compressed/misc.c @@ -20,6 +20,7 @@ #define KERNEL_LOAD_ADR 0x40004000 +#include #include #include diff --git a/trunk/arch/cris/arch-v32/boot/rescue/head.S b/trunk/arch/cris/arch-v32/boot/rescue/head.S index 8cdb4011bc16..61ede5f30f99 100644 --- a/trunk/arch/cris/arch-v32/boot/rescue/head.S +++ b/trunk/arch/cris/arch-v32/boot/rescue/head.S @@ -4,6 +4,7 @@ * RedBoot based RFL instead. Nothing to see here, move along. */ +#include #include #include diff --git a/trunk/arch/cris/arch-v32/drivers/axisflashmap.c b/trunk/arch/cris/arch-v32/drivers/axisflashmap.c index 41952320e00a..b679f983b90a 100644 --- a/trunk/arch/cris/arch-v32/drivers/axisflashmap.c +++ b/trunk/arch/cris/arch-v32/drivers/axisflashmap.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/cris/arch-v32/drivers/gpio.c b/trunk/arch/cris/arch-v32/drivers/gpio.c index 00e9167de530..a551237dcb5e 100644 --- a/trunk/arch/cris/arch-v32/drivers/gpio.c +++ b/trunk/arch/cris/arch-v32/drivers/gpio.c @@ -62,6 +62,7 @@ * */ +#include #include #include @@ -744,11 +745,11 @@ gpio_init(void) * in some tests. */ if (request_irq(TIMER_INTR_VECT, gpio_poll_timer_interrupt, - IRQF_SHARED | IRQF_DISABLED,"gpio poll", &alarmlist)) { + SA_SHIRQ | SA_INTERRUPT,"gpio poll", &alarmlist)) { printk("err: timer0 irq for gpio\n"); } if (request_irq(GEN_IO_INTR_VECT, gpio_pa_interrupt, - IRQF_SHARED | IRQF_DISABLED,"gpio PA", &alarmlist)) { + SA_SHIRQ | SA_INTERRUPT,"gpio PA", &alarmlist)) { printk("err: PA irq for gpio\n"); } /* enable the gio and timer irq in global config */ diff --git a/trunk/arch/cris/arch-v32/drivers/i2c.c b/trunk/arch/cris/arch-v32/drivers/i2c.c index 95f00188c628..440c20a94963 100644 --- a/trunk/arch/cris/arch-v32/drivers/i2c.c +++ b/trunk/arch/cris/arch-v32/drivers/i2c.c @@ -33,6 +33,7 @@ #include #include #include +#include #include diff --git a/trunk/arch/cris/arch-v32/drivers/pcf8563.c b/trunk/arch/cris/arch-v32/drivers/pcf8563.c index ffc6d2572f2b..d788bda3578c 100644 --- a/trunk/arch/cris/arch-v32/drivers/pcf8563.c +++ b/trunk/arch/cris/arch-v32/drivers/pcf8563.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/drivers/sync_serial.c b/trunk/arch/cris/arch-v32/drivers/sync_serial.c index 7c29957f5f02..c85a6df8558f 100644 --- a/trunk/arch/cris/arch-v32/drivers/sync_serial.c +++ b/trunk/arch/cris/arch-v32/drivers/sync_serial.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/kernel/arbiter.c b/trunk/arch/cris/arch-v32/kernel/arbiter.c index 420a5312ed03..3870d2fd5160 100644 --- a/trunk/arch/cris/arch-v32/kernel/arbiter.c +++ b/trunk/arch/cris/arch-v32/kernel/arbiter.c @@ -1,14 +1,15 @@ /* - * Memory arbiter functions. Allocates bandwidth through the + * Memory arbiter functions. Allocates bandwith through the * arbiter and sets up arbiter breakpoints. * * The algorithm first assigns slots to the clients that has specified - * bandwidth (e.g. ethernet) and then the remaining slots are divided + * bandwith (e.g. ethernet) and then the remaining slots are divided * on all the active clients. * * Copyright (c) 2004, 2005 Axis Communications AB. */ +#include #include #include #include @@ -119,7 +120,7 @@ static void crisv32_arbiter_init(void) crisv32_arbiter_config(EXT_REGION); crisv32_arbiter_config(INT_REGION); - if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, IRQF_DISABLED, + if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, SA_INTERRUPT, "arbiter", NULL)) printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); @@ -132,8 +133,8 @@ static void crisv32_arbiter_init(void) -int crisv32_arbiter_allocate_bandwidth(int client, int region, - unsigned long bandwidth) +int crisv32_arbiter_allocate_bandwith(int client, int region, + unsigned long bandwidth) { int i; int total_assigned = 0; diff --git a/trunk/arch/cris/arch-v32/kernel/crisksyms.c b/trunk/arch/cris/arch-v32/kernel/crisksyms.c index e513da711245..2c3bb9a0afe2 100644 --- a/trunk/arch/cris/arch-v32/kernel/crisksyms.c +++ b/trunk/arch/cris/arch-v32/kernel/crisksyms.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/kernel/debugport.c b/trunk/arch/cris/arch-v32/kernel/debugport.c index d1272ad92153..3dc587e6201a 100644 --- a/trunk/arch/cris/arch-v32/kernel/debugport.c +++ b/trunk/arch/cris/arch-v32/kernel/debugport.c @@ -2,6 +2,7 @@ * Copyright (C) 2003, Axis Communications AB. */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/kernel/dma.c b/trunk/arch/cris/arch-v32/kernel/dma.c index 570e19128ffd..b92e85799b44 100644 --- a/trunk/arch/cris/arch-v32/kernel/dma.c +++ b/trunk/arch/cris/arch-v32/kernel/dma.c @@ -25,8 +25,8 @@ int crisv32_request_dma(unsigned int dmanr, const char * device_id, reg_config_rw_clk_ctrl clk_ctrl; reg_strmux_rw_cfg strmux_cfg; - if (crisv32_arbiter_allocate_bandwidth(dmanr, - options & DMA_INT_MEM ? INT_REGION : EXT_REGION, + if (crisv32_arbiter_allocate_bandwith(dmanr, + options & DMA_INT_MEM ? INT_REGION : EXT_REGION, bandwidth)) return -ENOMEM; diff --git a/trunk/arch/cris/arch-v32/kernel/entry.S b/trunk/arch/cris/arch-v32/kernel/entry.S index f9d27807b914..3bd8503fec68 100644 --- a/trunk/arch/cris/arch-v32/kernel/entry.S +++ b/trunk/arch/cris/arch-v32/kernel/entry.S @@ -17,6 +17,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/kernel/fasttimer.c b/trunk/arch/cris/arch-v32/kernel/fasttimer.c index 5daeb6f7f3b7..ea2b4a97c8c7 100644 --- a/trunk/arch/cris/arch-v32/kernel/fasttimer.c +++ b/trunk/arch/cris/arch-v32/kernel/fasttimer.c @@ -120,6 +120,7 @@ #include #include +#include #include #include @@ -981,7 +982,7 @@ void fast_timer_init(void) proc_register_dynamic(&proc_root, &fasttimer_proc_entry); #endif #endif /* PROC_FS */ - if(request_irq(TIMER_INTR_VECT, timer_trig_interrupt, IRQF_DISABLED, + if(request_irq(TIMER_INTR_VECT, timer_trig_interrupt, SA_INTERRUPT, "fast timer int", NULL)) { printk("err: timer1 irq\n"); diff --git a/trunk/arch/cris/arch-v32/kernel/head.S b/trunk/arch/cris/arch-v32/kernel/head.S index 20bd80a84e48..3cfe57dc391d 100644 --- a/trunk/arch/cris/arch-v32/kernel/head.S +++ b/trunk/arch/cris/arch-v32/kernel/head.S @@ -4,6 +4,7 @@ * Copyright (C) 2003, Axis Communications AB */ +#include #define ASSEMBLER_MACROS_ONLY diff --git a/trunk/arch/cris/arch-v32/kernel/io.c b/trunk/arch/cris/arch-v32/kernel/io.c index dfbfcb8d2585..6bc9f263c3d6 100644 --- a/trunk/arch/cris/arch-v32/kernel/io.c +++ b/trunk/arch/cris/arch-v32/kernel/io.c @@ -4,6 +4,7 @@ * Copyright (c) 2004 Axis Communications AB. */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/kernel/irq.c b/trunk/arch/cris/arch-v32/kernel/irq.c index cc361bf578ae..06260874f018 100644 --- a/trunk/arch/cris/arch-v32/kernel/irq.c +++ b/trunk/arch/cris/arch-v32/kernel/irq.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -268,7 +269,7 @@ void crisv32_do_IRQ(int irq, int block, struct pt_regs* regs) { /* Interrupts that may not be moved to another CPU and - * are IRQF_DISABLED may skip blocking. This is currently + * are SA_INTERRUPT may skip blocking. This is currently * only valid for the timer IRQ and the IPI and is used * for the timer interrupt to avoid watchdog starvation. */ diff --git a/trunk/arch/cris/arch-v32/kernel/kgdb_asm.S b/trunk/arch/cris/arch-v32/kernel/kgdb_asm.S index 3e7fa9ef8510..b350dd279ed2 100644 --- a/trunk/arch/cris/arch-v32/kernel/kgdb_asm.S +++ b/trunk/arch/cris/arch-v32/kernel/kgdb_asm.S @@ -5,6 +5,7 @@ * port exceptions for kernel debugging purposes. */ +#include #include ;; Exported functions. diff --git a/trunk/arch/cris/arch-v32/kernel/process.c b/trunk/arch/cris/arch-v32/kernel/process.c index 6326351af252..843513102d3c 100644 --- a/trunk/arch/cris/arch-v32/kernel/process.c +++ b/trunk/arch/cris/arch-v32/kernel/process.c @@ -8,6 +8,7 @@ * This file handles the architecture-dependent parts of process handling.. */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/kernel/setup.c b/trunk/arch/cris/arch-v32/kernel/setup.c index 4662f363df63..b17a39a2e164 100644 --- a/trunk/arch/cris/arch-v32/kernel/setup.c +++ b/trunk/arch/cris/arch-v32/kernel/setup.c @@ -4,6 +4,7 @@ * Copyright (C) 2003, Axis Communications AB. */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/kernel/smp.c b/trunk/arch/cris/arch-v32/kernel/smp.c index 464ecaec3bc0..da40d19a151e 100644 --- a/trunk/arch/cris/arch-v32/kernel/smp.c +++ b/trunk/arch/cris/arch-v32/kernel/smp.c @@ -62,7 +62,7 @@ static unsigned long irq_regs[NR_CPUS] = static irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int send_ipi(int vector, int wait, cpumask_t cpu_mask); -static struct irqaction irq_ipi = { crisv32_ipi_interrupt, IRQF_DISABLED, +static struct irqaction irq_ipi = { crisv32_ipi_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "ipi", NULL, NULL}; extern void cris_mmu_init(void); diff --git a/trunk/arch/cris/arch-v32/kernel/time.c b/trunk/arch/cris/arch-v32/kernel/time.c index 50f3f93293d6..d48e397f5fa4 100644 --- a/trunk/arch/cris/arch-v32/kernel/time.c +++ b/trunk/arch/cris/arch-v32/kernel/time.c @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -241,16 +242,12 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -/* timer is IRQF_SHARED so drivers can add stuff to the timer irq chain - * it needs to be IRQF_DISABLED to make the jiffies update work properly +/* timer is SA_SHIRQ so drivers can add stuff to the timer irq chain + * it needs to be SA_INTERRUPT to make the jiffies update work properly */ -static struct irqaction irq_timer = { - .mask = timer_interrupt, - .flags = IRQF_SHARED | IRQF_DISABLED, - .mask = CPU_MASK_NONE, - .name = "timer" -}; +static struct irqaction irq_timer = { timer_interrupt, SA_SHIRQ | SA_INTERRUPT, + CPU_MASK_NONE, "timer", NULL, NULL}; void __init cris_timer_init(void) diff --git a/trunk/arch/cris/arch-v32/kernel/traps.c b/trunk/arch/cris/arch-v32/kernel/traps.c index 2462b1ef1fbb..6e3787045560 100644 --- a/trunk/arch/cris/arch-v32/kernel/traps.c +++ b/trunk/arch/cris/arch-v32/kernel/traps.c @@ -2,6 +2,7 @@ * Copyright (C) 2003, Axis Communications AB. */ +#include #include #include diff --git a/trunk/arch/cris/arch-v32/lib/dram_init.S b/trunk/arch/cris/arch-v32/lib/dram_init.S index 158b3dbb4d9d..47b6cf5f4afd 100644 --- a/trunk/arch/cris/arch-v32/lib/dram_init.S +++ b/trunk/arch/cris/arch-v32/lib/dram_init.S @@ -16,6 +16,7 @@ * uses this code. */ +#include #include #include diff --git a/trunk/arch/cris/arch-v32/lib/hw_settings.S b/trunk/arch/cris/arch-v32/lib/hw_settings.S index fff9443513d1..5182e8c2cff2 100644 --- a/trunk/arch/cris/arch-v32/lib/hw_settings.S +++ b/trunk/arch/cris/arch-v32/lib/hw_settings.S @@ -10,6 +10,7 @@ * Authors: Mikael Starvik (starvik@axis.com) */ +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/lib/nand_init.S b/trunk/arch/cris/arch-v32/lib/nand_init.S index e019816facd7..aba5c751c282 100644 --- a/trunk/arch/cris/arch-v32/lib/nand_init.S +++ b/trunk/arch/cris/arch-v32/lib/nand_init.S @@ -27,6 +27,7 @@ #include #include #include +#include ;; There are 8-bit NAND flashes and 16-bit NAND flashes. ;; We need to treat them slightly different. diff --git a/trunk/arch/cris/arch-v32/mm/init.c b/trunk/arch/cris/arch-v32/mm/init.c index a84ba7ff22d2..f2fba27d822c 100644 --- a/trunk/arch/cris/arch-v32/mm/init.c +++ b/trunk/arch/cris/arch-v32/mm/init.c @@ -6,10 +6,12 @@ * Authors: Bjorn Wesen * Tobias Anderberg , CRISv32 port. */ +#include #include #include #include #include +#include #include #include #include diff --git a/trunk/arch/cris/arch-v32/vmlinux.lds.S b/trunk/arch/cris/arch-v32/vmlinux.lds.S index 472d4b3c4cf4..adb94605d92a 100644 --- a/trunk/arch/cris/arch-v32/vmlinux.lds.S +++ b/trunk/arch/cris/arch-v32/vmlinux.lds.S @@ -8,6 +8,7 @@ * the kernel has booted. */ +#include #include jiffies = jiffies_64; diff --git a/trunk/arch/cris/kernel/crisksyms.c b/trunk/arch/cris/kernel/crisksyms.c index 1f20c16ac2a4..d57859053ce7 100644 --- a/trunk/arch/cris/kernel/crisksyms.c +++ b/trunk/arch/cris/kernel/crisksyms.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/cris/kernel/irq.c b/trunk/arch/cris/kernel/irq.c index 903ea62c6e21..6547bb646364 100644 --- a/trunk/arch/cris/kernel/irq.c +++ b/trunk/arch/cris/kernel/irq.c @@ -19,6 +19,7 @@ * Naturally it's not a 1:1 relation, but there are similarities. */ +#include #include #include #include @@ -85,7 +86,7 @@ int show_interrupts(struct seq_file *p, void *v) /* called by the assembler IRQ entry functions defined in irq.h * to dispatch the interrupts to registred handlers * interrupts are disabled upon entry - depending on if the - * interrupt was registred with IRQF_DISABLED or not, interrupts + * interrupt was registred with SA_INTERRUPT or not, interrupts * are re-enabled or not. */ diff --git a/trunk/arch/cris/kernel/setup.c b/trunk/arch/cris/kernel/setup.c index 6d941fb9f379..619a6eefd893 100644 --- a/trunk/arch/cris/kernel/setup.c +++ b/trunk/arch/cris/kernel/setup.c @@ -10,6 +10,7 @@ * This file handles the architecture-dependent parts of initialization */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/break.S b/trunk/arch/frv/kernel/break.S index ea161f0ca427..687c48d62dde 100644 --- a/trunk/arch/frv/kernel/break.S +++ b/trunk/arch/frv/kernel/break.S @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/frv/kernel/cmode.S b/trunk/arch/frv/kernel/cmode.S index 81ba28ad2207..6591e6a37ae9 100644 --- a/trunk/arch/frv/kernel/cmode.S +++ b/trunk/arch/frv/kernel/cmode.S @@ -11,6 +11,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/frv/kernel/entry-table.S b/trunk/arch/frv/kernel/entry-table.S index d3b9253d862a..81568acea9cd 100644 --- a/trunk/arch/frv/kernel/entry-table.S +++ b/trunk/arch/frv/kernel/entry-table.S @@ -11,6 +11,7 @@ */ #include +#include #include #include diff --git a/trunk/arch/frv/kernel/entry.S b/trunk/arch/frv/kernel/entry.S index 2a1ff1ff8692..81d94e41a189 100644 --- a/trunk/arch/frv/kernel/entry.S +++ b/trunk/arch/frv/kernel/entry.S @@ -28,6 +28,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/frv/kernel/frv_ksyms.c b/trunk/arch/frv/kernel/frv_ksyms.c index f772704b3d28..dee637fffda5 100644 --- a/trunk/arch/frv/kernel/frv_ksyms.c +++ b/trunk/arch/frv/kernel/frv_ksyms.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/frv/kernel/head-mmu-fr451.S b/trunk/arch/frv/kernel/head-mmu-fr451.S index c8f210d84ff5..a143c2f66ee5 100644 --- a/trunk/arch/frv/kernel/head-mmu-fr451.S +++ b/trunk/arch/frv/kernel/head-mmu-fr451.S @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/head-uc-fr401.S b/trunk/arch/frv/kernel/head-uc-fr401.S index ee282be20fff..4ccf8414ae44 100644 --- a/trunk/arch/frv/kernel/head-uc-fr401.S +++ b/trunk/arch/frv/kernel/head-uc-fr401.S @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/head-uc-fr451.S b/trunk/arch/frv/kernel/head-uc-fr451.S index b10d9c8295d2..31cb54a6f080 100644 --- a/trunk/arch/frv/kernel/head-uc-fr451.S +++ b/trunk/arch/frv/kernel/head-uc-fr451.S @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/head-uc-fr555.S b/trunk/arch/frv/kernel/head-uc-fr555.S index 39937c19b460..d088db2699bf 100644 --- a/trunk/arch/frv/kernel/head-uc-fr555.S +++ b/trunk/arch/frv/kernel/head-uc-fr555.S @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/head.S b/trunk/arch/frv/kernel/head.S index 47c990af2e06..29a5265489b7 100644 --- a/trunk/arch/frv/kernel/head.S +++ b/trunk/arch/frv/kernel/head.S @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/irq-mb93091.c b/trunk/arch/frv/kernel/irq-mb93091.c index 1381abcd5cc9..9778e0ff7c1c 100644 --- a/trunk/arch/frv/kernel/irq-mb93091.c +++ b/trunk/arch/frv/kernel/irq-mb93091.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/irq-mb93093.c b/trunk/arch/frv/kernel/irq-mb93093.c index 48b2a6420888..21ca2b298247 100644 --- a/trunk/arch/frv/kernel/irq-mb93093.c +++ b/trunk/arch/frv/kernel/irq-mb93093.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/irq-mb93493.c b/trunk/arch/frv/kernel/irq-mb93493.c index 988d035640e1..c003ae5e2b30 100644 --- a/trunk/arch/frv/kernel/irq-mb93493.c +++ b/trunk/arch/frv/kernel/irq-mb93493.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/irq-routing.c b/trunk/arch/frv/kernel/irq-routing.c index 53886adf47de..b90b70a761d1 100644 --- a/trunk/arch/frv/kernel/irq-routing.c +++ b/trunk/arch/frv/kernel/irq-routing.c @@ -81,7 +81,7 @@ void distribute_irqs(struct irq_group *group, unsigned long irqmask) if (action) { int status = 0; -// if (!(action->flags & IRQF_DISABLED)) +// if (!(action->flags & SA_INTERRUPT)) // local_irq_enable(); do { @@ -90,7 +90,7 @@ void distribute_irqs(struct irq_group *group, unsigned long irqmask) action = action->next; } while (action); - if (status & IRQF_SAMPLE_RANDOM) + if (status & SA_SAMPLE_RANDOM) add_interrupt_randomness(irq); local_irq_disable(); } diff --git a/trunk/arch/frv/kernel/irq.c b/trunk/arch/frv/kernel/irq.c index 08967010be04..8b112b361914 100644 --- a/trunk/arch/frv/kernel/irq.c +++ b/trunk/arch/frv/kernel/irq.c @@ -16,6 +16,7 @@ * Naturally it's not a 1:1 relation, but there are similarities. */ +#include #include #include #include @@ -341,11 +342,11 @@ asmlinkage void do_NMI(void) * * Flags: * - * IRQF_SHARED Interrupt is shared + * SA_SHIRQ Interrupt is shared * - * IRQF_DISABLED Disable local interrupts while processing + * SA_INTERRUPT Disable local interrupts while processing * - * IRQF_SAMPLE_RANDOM The interrupt can be used for entropy + * SA_SAMPLE_RANDOM The interrupt can be used for entropy * */ @@ -365,7 +366,7 @@ int request_irq(unsigned int irq, * to figure out which interrupt is which (messes up the * interrupt freeing logic etc). */ - if (irqflags & IRQF_SHARED) { + if (irqflags & SA_SHIRQ) { if (!dev_id) printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]); @@ -576,7 +577,7 @@ int setup_irq(unsigned int irq, struct irqaction *new) * so we have to be careful not to interfere with a * running system. */ - if (new->flags & IRQF_SAMPLE_RANDOM) { + if (new->flags & SA_SAMPLE_RANDOM) { /* * This function might sleep, we want to call it first, * outside of the atomic block. @@ -592,7 +593,7 @@ int setup_irq(unsigned int irq, struct irqaction *new) spin_lock_irqsave(&level->lock, flags); /* can't share interrupts unless all parties agree to */ - if (level->usage != 0 && !(level->flags & new->flags & IRQF_SHARED)) { + if (level->usage != 0 && !(level->flags & new->flags & SA_SHIRQ)) { spin_unlock_irqrestore(&level->lock,flags); return -EBUSY; } diff --git a/trunk/arch/frv/kernel/pm-mb93093.c b/trunk/arch/frv/kernel/pm-mb93093.c index eaa7b582ef52..34d01d7dcc3b 100644 --- a/trunk/arch/frv/kernel/pm-mb93093.c +++ b/trunk/arch/frv/kernel/pm-mb93093.c @@ -10,6 +10,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/pm.c b/trunk/arch/frv/kernel/pm.c index e65a9f1c0c26..43ce28a13a5d 100644 --- a/trunk/arch/frv/kernel/pm.c +++ b/trunk/arch/frv/kernel/pm.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/process.c b/trunk/arch/frv/kernel/process.c index eeeb1e2641d5..489e6c489cbe 100644 --- a/trunk/arch/frv/kernel/process.c +++ b/trunk/arch/frv/kernel/process.c @@ -10,6 +10,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/ptrace.c b/trunk/arch/frv/kernel/ptrace.c index fcff819b4340..f953484e7d59 100644 --- a/trunk/arch/frv/kernel/ptrace.c +++ b/trunk/arch/frv/kernel/ptrace.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/frv/kernel/semaphore.c b/trunk/arch/frv/kernel/semaphore.c index f278cdf3a72f..7971d680ae29 100644 --- a/trunk/arch/frv/kernel/semaphore.c +++ b/trunk/arch/frv/kernel/semaphore.c @@ -10,6 +10,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/setup.c b/trunk/arch/frv/kernel/setup.c index af08ccd4ed6e..1f7d65f29e78 100644 --- a/trunk/arch/frv/kernel/setup.c +++ b/trunk/arch/frv/kernel/setup.c @@ -10,7 +10,8 @@ * 2 of the License, or (at your option) any later version. */ -#include +#include +#include #include #include #include diff --git a/trunk/arch/frv/kernel/sleep.S b/trunk/arch/frv/kernel/sleep.S index c9b2d51ab9ad..e6079b8cac60 100644 --- a/trunk/arch/frv/kernel/sleep.S +++ b/trunk/arch/frv/kernel/sleep.S @@ -11,6 +11,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/frv/kernel/switch_to.S b/trunk/arch/frv/kernel/switch_to.S index 9e5a583991a3..1703dc20174e 100644 --- a/trunk/arch/frv/kernel/switch_to.S +++ b/trunk/arch/frv/kernel/switch_to.S @@ -11,6 +11,7 @@ # 2 of the License, or (at your option) any later version. # ############################################################################### +#include #include #include #include diff --git a/trunk/arch/frv/kernel/sysctl.c b/trunk/arch/frv/kernel/sysctl.c index ce676803eb6f..b908863d6593 100644 --- a/trunk/arch/frv/kernel/sysctl.c +++ b/trunk/arch/frv/kernel/sysctl.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/kernel/time.c b/trunk/arch/frv/kernel/time.c index d5b64e193d92..24cf85f89e40 100644 --- a/trunk/arch/frv/kernel/time.c +++ b/trunk/arch/frv/kernel/time.c @@ -47,7 +47,7 @@ unsigned long __delay_loops_MHz; static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs *regs); static struct irqaction timer_irq = { - timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL + timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL }; static inline int set_rtc_mmss(unsigned long nowtime) diff --git a/trunk/arch/frv/kernel/traps.c b/trunk/arch/frv/kernel/traps.c index 98ce3628ebde..9eb84b2e6abc 100644 --- a/trunk/arch/frv/kernel/traps.c +++ b/trunk/arch/frv/kernel/traps.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/mb93090-mb00/pci-irq.c b/trunk/arch/frv/mb93090-mb00/pci-irq.c index 2278c80bd88c..45ae39d84b69 100644 --- a/trunk/arch/frv/mb93090-mb00/pci-irq.c +++ b/trunk/arch/frv/mb93090-mb00/pci-irq.c @@ -5,6 +5,7 @@ * derived from: arch/i386/kernel/pci-irq.c: (c) 1999--2000 Martin Mares */ +#include #include #include #include diff --git a/trunk/arch/frv/mb93090-mb00/pci-vdk.c b/trunk/arch/frv/mb93090-mb00/pci-vdk.c index fb98e90c5794..c8817f7b8605 100644 --- a/trunk/arch/frv/mb93090-mb00/pci-vdk.c +++ b/trunk/arch/frv/mb93090-mb00/pci-vdk.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/mm/dma-alloc.c b/trunk/arch/frv/mm/dma-alloc.c index dc6522c464d4..636b2f8b5d98 100644 --- a/trunk/arch/frv/mm/dma-alloc.c +++ b/trunk/arch/frv/mm/dma-alloc.c @@ -21,6 +21,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/frv/mm/extable.c b/trunk/arch/frv/mm/extable.c index 6aea124f574d..caacf030ac75 100644 --- a/trunk/arch/frv/mm/extable.c +++ b/trunk/arch/frv/mm/extable.c @@ -2,6 +2,7 @@ * linux/arch/frv/mm/extable.c */ +#include #include #include #include diff --git a/trunk/arch/frv/mm/init.c b/trunk/arch/frv/mm/init.c index b5b4286f9dd4..8899aa1a4f06 100644 --- a/trunk/arch/frv/mm/init.c +++ b/trunk/arch/frv/mm/init.c @@ -16,6 +16,7 @@ * - Copyright (C) 1995 Hamish Macdonald */ +#include #include #include #include diff --git a/trunk/arch/frv/mm/kmap.c b/trunk/arch/frv/mm/kmap.c index fb78be38ea02..40b62c5c2951 100644 --- a/trunk/arch/frv/mm/kmap.c +++ b/trunk/arch/frv/mm/kmap.c @@ -10,6 +10,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/frv/mm/tlb-flush.S b/trunk/arch/frv/mm/tlb-flush.S index 79b3c70910ac..6f43c74c5d95 100644 --- a/trunk/arch/frv/mm/tlb-flush.S +++ b/trunk/arch/frv/mm/tlb-flush.S @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/frv/mm/tlb-miss.S b/trunk/arch/frv/mm/tlb-miss.S index 04da67468378..8729f7d7c6e0 100644 --- a/trunk/arch/frv/mm/tlb-miss.S +++ b/trunk/arch/frv/mm/tlb-miss.S @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/frv/mm/unaligned.c b/trunk/arch/frv/mm/unaligned.c index 8f0375fc15a8..09b361443fc2 100644 --- a/trunk/arch/frv/mm/unaligned.c +++ b/trunk/arch/frv/mm/unaligned.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/h8300/kernel/gpio.c b/trunk/arch/h8300/kernel/gpio.c index 6a25dd5530e7..d195568ca8a2 100644 --- a/trunk/arch/h8300/kernel/gpio.c +++ b/trunk/arch/h8300/kernel/gpio.c @@ -9,6 +9,7 @@ * Internal I/O Port Management */ +#include #include #include #include diff --git a/trunk/arch/h8300/kernel/h8300_ksyms.c b/trunk/arch/h8300/kernel/h8300_ksyms.c index 9b4be053de3c..f8d6dee84781 100644 --- a/trunk/arch/h8300/kernel/h8300_ksyms.c +++ b/trunk/arch/h8300/kernel/h8300_ksyms.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/h8300/kernel/ints.c b/trunk/arch/h8300/kernel/ints.c index 1488b6ace18c..edb3c4170013 100644 --- a/trunk/arch/h8300/kernel/ints.c +++ b/trunk/arch/h8300/kernel/ints.c @@ -158,7 +158,7 @@ int request_irq(unsigned int irq, irq_handle->devname = devname; irq_list[irq] = irq_handle; - if (irq_handle->flags & IRQF_SAMPLE_RANDOM) + if (irq_handle->flags & SA_SAMPLE_RANDOM) rand_initialize_irq(irq); enable_irq(irq); @@ -222,7 +222,7 @@ asmlinkage void process_int(int irq, struct pt_regs *fp) if (irq_list[irq]) { irq_list[irq]->handler(irq, irq_list[irq]->dev_id, fp); irq_list[irq]->count++; - if (irq_list[irq]->flags & IRQF_SAMPLE_RANDOM) + if (irq_list[irq]->flags & SA_SAMPLE_RANDOM) add_interrupt_randomness(irq); } } else { diff --git a/trunk/arch/h8300/kernel/process.c b/trunk/arch/h8300/kernel/process.c index e061b63a0038..16ccddc69c2b 100644 --- a/trunk/arch/h8300/kernel/process.c +++ b/trunk/arch/h8300/kernel/process.c @@ -22,6 +22,7 @@ * This file handles the architecture-dependent parts of process handling.. */ +#include #include #include #include diff --git a/trunk/arch/h8300/kernel/ptrace.c b/trunk/arch/h8300/kernel/ptrace.c index f6031373dc21..0ff6f79b0fed 100644 --- a/trunk/arch/h8300/kernel/ptrace.c +++ b/trunk/arch/h8300/kernel/ptrace.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/h8300/kernel/semaphore.c b/trunk/arch/h8300/kernel/semaphore.c index d12cbbfe6ebd..1ebb79baaa8c 100644 --- a/trunk/arch/h8300/kernel/semaphore.c +++ b/trunk/arch/h8300/kernel/semaphore.c @@ -3,6 +3,7 @@ * specific changes in */ +#include #include #include #include diff --git a/trunk/arch/h8300/kernel/setup.c b/trunk/arch/h8300/kernel/setup.c index 1077b71d5226..f469d9160730 100644 --- a/trunk/arch/h8300/kernel/setup.c +++ b/trunk/arch/h8300/kernel/setup.c @@ -16,6 +16,7 @@ * This file handles the architecture-dependent parts of system setup */ +#include #include #include #include diff --git a/trunk/arch/h8300/kernel/syscalls.S b/trunk/arch/h8300/kernel/syscalls.S index dab98fd99e63..79b3bda5c6e3 100644 --- a/trunk/arch/h8300/kernel/syscalls.S +++ b/trunk/arch/h8300/kernel/syscalls.S @@ -1,4 +1,5 @@ /* Systemcall Entry Table */ +#include #include #include #include diff --git a/trunk/arch/h8300/kernel/vmlinux.lds.S b/trunk/arch/h8300/kernel/vmlinux.lds.S index 6406c388f88a..17fa11da1e4a 100644 --- a/trunk/arch/h8300/kernel/vmlinux.lds.S +++ b/trunk/arch/h8300/kernel/vmlinux.lds.S @@ -1,5 +1,6 @@ #define VMLINUX_SYMBOL(_sym_) _##_sym_ #include +#include /* target memory map */ #ifdef CONFIG_H8300H_GENERIC diff --git a/trunk/arch/h8300/lib/romfs.S b/trunk/arch/h8300/lib/romfs.S index 68910d8e1ff4..b72f93a47e31 100644 --- a/trunk/arch/h8300/lib/romfs.S +++ b/trunk/arch/h8300/lib/romfs.S @@ -1,6 +1,7 @@ /* romfs move to __ebss */ #include +#include #if defined(__H8300H__) .h8300h diff --git a/trunk/arch/h8300/mm/init.c b/trunk/arch/h8300/mm/init.c index d3d40bdc2d6a..09efc4b1f038 100644 --- a/trunk/arch/h8300/mm/init.c +++ b/trunk/arch/h8300/mm/init.c @@ -16,6 +16,7 @@ * DEC/2000 -- linux 2.4 support */ +#include #include #include #include diff --git a/trunk/arch/h8300/mm/kmap.c b/trunk/arch/h8300/mm/kmap.c index 26ab17286a53..4101ab54fc17 100644 --- a/trunk/arch/h8300/mm/kmap.c +++ b/trunk/arch/h8300/mm/kmap.c @@ -8,6 +8,7 @@ * Copyright (C) 2000-2002 David McCullough */ +#include #include #include #include diff --git a/trunk/arch/h8300/mm/memory.c b/trunk/arch/h8300/mm/memory.c index ccd6ade816dd..81eace93f867 100644 --- a/trunk/arch/h8300/mm/memory.c +++ b/trunk/arch/h8300/mm/memory.c @@ -17,6 +17,7 @@ * Copyright (C) 1995 Hamish Macdonald */ +#include #include #include #include diff --git a/trunk/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S b/trunk/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S index ecaeb31ae9a4..31c3703d8d60 100644 --- a/trunk/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S +++ b/trunk/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S @@ -10,6 +10,7 @@ #define ASSEMBLY +#include #include #if !defined(CONFIG_BLKDEV_RESERVE) diff --git a/trunk/arch/h8300/platform/h8300h/aki3068net/timer.c b/trunk/arch/h8300/platform/h8300h/aki3068net/timer.c index 27cd85d56128..086efb1fd283 100644 --- a/trunk/arch/h8300/platform/h8300h/aki3068net/timer.c +++ b/trunk/arch/h8300/platform/h8300h/aki3068net/timer.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/h8300/platform/h8300h/entry.S b/trunk/arch/h8300/platform/h8300h/entry.S index d2dea2432fb2..2052dbb9483f 100644 --- a/trunk/arch/h8300/platform/h8300h/entry.S +++ b/trunk/arch/h8300/platform/h8300h/entry.S @@ -14,6 +14,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/h8300/platform/h8300h/generic/crt0_ram.S b/trunk/arch/h8300/platform/h8300h/generic/crt0_ram.S index 80d0e16a4499..b735042a7c3f 100644 --- a/trunk/arch/h8300/platform/h8300h/generic/crt0_ram.S +++ b/trunk/arch/h8300/platform/h8300h/generic/crt0_ram.S @@ -10,6 +10,7 @@ #define ASSEMBLY +#include #include #if !defined(CONFIG_BLKDEV_RESERVE) diff --git a/trunk/arch/h8300/platform/h8300h/generic/crt0_rom.S b/trunk/arch/h8300/platform/h8300h/generic/crt0_rom.S index 120add7ca832..2e32d8179db3 100644 --- a/trunk/arch/h8300/platform/h8300h/generic/crt0_rom.S +++ b/trunk/arch/h8300/platform/h8300h/generic/crt0_rom.S @@ -10,6 +10,7 @@ #define ASSEMBLY +#include #include .global SYMBOL_NAME(_start) diff --git a/trunk/arch/h8300/platform/h8300h/generic/timer.c b/trunk/arch/h8300/platform/h8300h/generic/timer.c index 6f5cefe0cceb..6590f89e521a 100644 --- a/trunk/arch/h8300/platform/h8300h/generic/timer.c +++ b/trunk/arch/h8300/platform/h8300h/generic/timer.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/h8300/platform/h8300h/h8max/crt0_ram.S b/trunk/arch/h8300/platform/h8300h/h8max/crt0_ram.S index efcbefb91b67..a5c5a9156e04 100644 --- a/trunk/arch/h8300/platform/h8300h/h8max/crt0_ram.S +++ b/trunk/arch/h8300/platform/h8300h/h8max/crt0_ram.S @@ -10,6 +10,7 @@ #define ASSEMBLY +#include #include #if !defined(CONFIG_BLKDEV_RESERVE) diff --git a/trunk/arch/h8300/platform/h8300h/h8max/timer.c b/trunk/arch/h8300/platform/h8300h/h8max/timer.c index 85a574afe9d0..9ac9fa6691c0 100644 --- a/trunk/arch/h8300/platform/h8300h/h8max/timer.c +++ b/trunk/arch/h8300/platform/h8300h/h8max/timer.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/h8300/platform/h8300h/ints_h8300h.c b/trunk/arch/h8300/platform/h8300h/ints_h8300h.c index f1777119b871..86a155479167 100644 --- a/trunk/arch/h8300/platform/h8300h/ints_h8300h.c +++ b/trunk/arch/h8300/platform/h8300h/ints_h8300h.c @@ -6,6 +6,7 @@ * */ +#include #include #include diff --git a/trunk/arch/h8300/platform/h8s/edosk2674/crt0_ram.S b/trunk/arch/h8300/platform/h8s/edosk2674/crt0_ram.S index d12b0debe478..8105dc17d735 100644 --- a/trunk/arch/h8300/platform/h8s/edosk2674/crt0_ram.S +++ b/trunk/arch/h8300/platform/h8s/edosk2674/crt0_ram.S @@ -10,6 +10,7 @@ #define ASSEMBLY +#include #include #include diff --git a/trunk/arch/h8300/platform/h8s/edosk2674/crt0_rom.S b/trunk/arch/h8300/platform/h8s/edosk2674/crt0_rom.S index c03d23c6fe12..65748bf18556 100644 --- a/trunk/arch/h8300/platform/h8s/edosk2674/crt0_rom.S +++ b/trunk/arch/h8300/platform/h8s/edosk2674/crt0_rom.S @@ -10,6 +10,7 @@ #define ASSEMBLY +#include #include #include diff --git a/trunk/arch/h8300/platform/h8s/edosk2674/timer.c b/trunk/arch/h8300/platform/h8s/edosk2674/timer.c index bfb1424482f4..9441a4f1631f 100644 --- a/trunk/arch/h8300/platform/h8s/edosk2674/timer.c +++ b/trunk/arch/h8300/platform/h8s/edosk2674/timer.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/h8300/platform/h8s/entry.S b/trunk/arch/h8300/platform/h8s/entry.S index aeb2e9faa9b2..a7a53c84c801 100644 --- a/trunk/arch/h8300/platform/h8s/entry.S +++ b/trunk/arch/h8300/platform/h8s/entry.S @@ -15,6 +15,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/h8300/platform/h8s/generic/crt0_ram.S b/trunk/arch/h8300/platform/h8s/generic/crt0_ram.S index b04541069976..86f450178466 100644 --- a/trunk/arch/h8300/platform/h8s/generic/crt0_ram.S +++ b/trunk/arch/h8300/platform/h8s/generic/crt0_ram.S @@ -10,6 +10,7 @@ #define ASSEMBLY +#include #include #include diff --git a/trunk/arch/h8300/platform/h8s/generic/crt0_rom.S b/trunk/arch/h8300/platform/h8s/generic/crt0_rom.S index 95b6f2898f52..e18e41202282 100644 --- a/trunk/arch/h8300/platform/h8s/generic/crt0_rom.S +++ b/trunk/arch/h8300/platform/h8s/generic/crt0_rom.S @@ -10,6 +10,7 @@ #define ASSEMBLY +#include #include #include diff --git a/trunk/arch/h8300/platform/h8s/generic/timer.c b/trunk/arch/h8300/platform/h8s/generic/timer.c index c2211c6e79da..633cd8e1c21d 100644 --- a/trunk/arch/h8300/platform/h8s/generic/timer.c +++ b/trunk/arch/h8300/platform/h8s/generic/timer.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/h8300/platform/h8s/ints.c b/trunk/arch/h8300/platform/h8s/ints.c index 270440de4610..f6ed663bdde0 100644 --- a/trunk/arch/h8300/platform/h8s/ints.c +++ b/trunk/arch/h8300/platform/h8s/ints.c @@ -192,7 +192,7 @@ int request_irq(unsigned int irq, irq_handle->dev_id = dev_id; irq_handle->devname = devname; irq_list[irq] = irq_handle; - if (irq_handle->flags & IRQF_SAMPLE_RANDOM) + if (irq_handle->flags & SA_SAMPLE_RANDOM) rand_initialize_irq(irq); /* enable interrupt */ @@ -270,7 +270,7 @@ asmlinkage void process_int(unsigned long vec, struct pt_regs *fp) if (irq_list[vec]) { irq_list[vec]->handler(vec, irq_list[vec]->dev_id, fp); irq_list[vec]->count++; - if (irq_list[vec]->flags & IRQF_SAMPLE_RANDOM) + if (irq_list[vec]->flags & SA_SAMPLE_RANDOM) add_interrupt_randomness(vec); } } else { diff --git a/trunk/arch/h8300/platform/h8s/ints_h8s.c b/trunk/arch/h8300/platform/h8s/ints_h8s.c index 93395d2a8a07..8268dfd12f1f 100644 --- a/trunk/arch/h8300/platform/h8s/ints_h8s.c +++ b/trunk/arch/h8300/platform/h8s/ints_h8s.c @@ -6,6 +6,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/i386/Kconfig b/trunk/arch/i386/Kconfig index daa75ce4b777..1718429286d4 100644 --- a/trunk/arch/i386/Kconfig +++ b/trunk/arch/i386/Kconfig @@ -18,14 +18,6 @@ config GENERIC_TIME bool default y -config LOCKDEP_SUPPORT - bool - default y - -config STACKTRACE_SUPPORT - bool - default y - config SEMAPHORE_SLEEPERS bool default y @@ -184,7 +176,7 @@ endchoice config ACPI_SRAT bool default y - depends on ACPI && NUMA && (X86_SUMMIT || X86_GENERICARCH) + depends on NUMA && (X86_SUMMIT || X86_GENERICARCH) select ACPI_NUMA config HAVE_ARCH_PARSE_SRAT diff --git a/trunk/arch/i386/Kconfig.debug b/trunk/arch/i386/Kconfig.debug index b31c0802e1cc..c92191b1fb67 100644 --- a/trunk/arch/i386/Kconfig.debug +++ b/trunk/arch/i386/Kconfig.debug @@ -1,9 +1,5 @@ menu "Kernel hacking" -config TRACE_IRQFLAGS_SUPPORT - bool - default y - source "lib/Kconfig.debug" config EARLY_PRINTK @@ -35,6 +31,15 @@ config DEBUG_STACK_USAGE This option will slow down process creation somewhat. +config STACK_BACKTRACE_COLS + int "Stack backtraces per line" if DEBUG_KERNEL + range 1 3 + default 2 + help + Selects how many stack backtrace entries per line to display. + + This can save screen space when displaying traces. + comment "Page alloc debug is incompatible with Software Suspend on i386" depends on DEBUG_KERNEL && SOFTWARE_SUSPEND diff --git a/trunk/arch/i386/boot/setup.S b/trunk/arch/i386/boot/setup.S index d2b684cd620a..ca668d9df164 100644 --- a/trunk/arch/i386/boot/setup.S +++ b/trunk/arch/i386/boot/setup.S @@ -46,8 +46,9 @@ * by Robert Schwebel, December 2001 */ +#include #include -#include +#include #include #include #include diff --git a/trunk/arch/i386/kernel/Makefile b/trunk/arch/i386/kernel/Makefile index 1b452a1665c4..5e70c2fb273a 100644 --- a/trunk/arch/i386/kernel/Makefile +++ b/trunk/arch/i386/kernel/Makefile @@ -9,7 +9,6 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ pci-dma.o i386_ksyms.o i387.o bootflag.o \ quirks.o i8237.o topology.o alternative.o i8253.o tsc.o -obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-y += cpu/ obj-y += acpi/ obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o @@ -39,7 +38,6 @@ obj-$(CONFIG_VM86) += vm86.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-$(CONFIG_HPET_TIMER) += hpet.o obj-$(CONFIG_K8_NB) += k8.o -obj-$(CONFIG_AUDIT) += audit.o EXTRA_AFLAGS := -traditional diff --git a/trunk/arch/i386/kernel/acpi/boot.c b/trunk/arch/i386/kernel/acpi/boot.c index 0db6387025ca..97ca17189af5 100644 --- a/trunk/arch/i386/kernel/acpi/boot.c +++ b/trunk/arch/i386/kernel/acpi/boot.c @@ -24,6 +24,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/i386/kernel/alternative.c b/trunk/arch/i386/kernel/alternative.c index 28ab80649764..50eb0e03777e 100644 --- a/trunk/arch/i386/kernel/alternative.c +++ b/trunk/arch/i386/kernel/alternative.c @@ -168,8 +168,6 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end) } } -#ifdef CONFIG_SMP - static void alternatives_smp_save(struct alt_instr *start, struct alt_instr *end) { struct alt_instr *a; @@ -303,16 +301,6 @@ void alternatives_smp_switch(int smp) struct smp_alt_module *mod; unsigned long flags; -#ifdef CONFIG_LOCKDEP - /* - * A not yet fixed binutils section handling bug prevents - * alternatives-replacement from working reliably, so turn - * it off: - */ - printk("lockdep: not fixing up alternatives.\n"); - return; -#endif - if (no_replacement || smp_alt_once) return; BUG_ON(!smp && (num_online_cpus() > 1)); @@ -340,8 +328,6 @@ void alternatives_smp_switch(int smp) spin_unlock_irqrestore(&smp_alt, flags); } -#endif - void __init alternative_instructions(void) { if (no_replacement) { @@ -363,7 +349,6 @@ void __init alternative_instructions(void) smp_alt_once = 1; #endif -#ifdef CONFIG_SMP if (smp_alt_once) { if (1 == num_possible_cpus()) { printk(KERN_INFO "SMP alternatives: switching to UP code\n"); @@ -385,5 +370,4 @@ void __init alternative_instructions(void) _text, _etext); alternatives_smp_switch(0); } -#endif } diff --git a/trunk/arch/i386/kernel/apic.c b/trunk/arch/i386/kernel/apic.c index 8c844d07862f..7ce09492fc0c 100644 --- a/trunk/arch/i386/kernel/apic.c +++ b/trunk/arch/i386/kernel/apic.c @@ -14,6 +14,7 @@ * Mikael Pettersson : PM converted to driver model. */ +#include #include #include diff --git a/trunk/arch/i386/kernel/apm.c b/trunk/arch/i386/kernel/apm.c index 8591f2fa920c..7c5729d1fd06 100644 --- a/trunk/arch/i386/kernel/apm.c +++ b/trunk/arch/i386/kernel/apm.c @@ -201,6 +201,7 @@ * http://www.microsoft.com/hwdev/busbios/amp_12.htm] */ +#include #include #include diff --git a/trunk/arch/i386/kernel/audit.c b/trunk/arch/i386/kernel/audit.c deleted file mode 100644 index 5a53c6f371ff..000000000000 --- a/trunk/arch/i386/kernel/audit.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include -#include - -static unsigned dir_class[] = { -#include -~0U -}; - -static unsigned chattr_class[] = { -#include -~0U -}; - -static int __init audit_classes_init(void) -{ - audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class); - audit_register_class(AUDIT_CLASS_CHATTR, chattr_class); - return 0; -} - -__initcall(audit_classes_init); diff --git a/trunk/arch/i386/kernel/bootflag.c b/trunk/arch/i386/kernel/bootflag.c index 0b9860530a6b..4c30ed01f4e1 100644 --- a/trunk/arch/i386/kernel/bootflag.c +++ b/trunk/arch/i386/kernel/bootflag.c @@ -3,6 +3,7 @@ */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/trunk/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c index 567b39bea07e..5fd65325b81a 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c @@ -24,6 +24,7 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include #include #include #include @@ -417,14 +418,8 @@ acpi_cpufreq_cpu_init ( goto err_free; perf = data->acpi_data; + policy->cpus = perf->shared_cpu_map; policy->shared_type = perf->shared_type; - /* - * Will let policy->cpus know about dependency only when software - * coordination is required. - */ - if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || - policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) - policy->cpus = perf->shared_cpu_map; if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) { acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS; diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/trunk/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c index 304d2eaa4a1b..ab6504efd801 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c @@ -20,6 +20,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k7.c index 54382760983a..694d4793bf6a 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k7.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k7.c @@ -12,6 +12,7 @@ * - We disable half multipliers if ACPI is used on A0 stepping CPUs. */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c index b77f1358bd79..f7e4356f6820 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c @@ -17,6 +17,7 @@ #include #include #include +#include #include /* current */ #include #include @@ -398,14 +399,8 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy) dprintk(PFX "obtaining ACPI data failed\n"); return -EIO; } + policy->cpus = p->shared_cpu_map; policy->shared_type = p->shared_type; - /* - * Will let policy->cpus know about dependency only when software - * coordination is required. - */ - if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || - policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) - policy->cpus = p->shared_cpu_map; /* verify the acpi_data */ if (p->state_count <= 1) { diff --git a/trunk/arch/i386/kernel/cpu/intel.c b/trunk/arch/i386/kernel/cpu/intel.c index 5a2e270924b1..10afc645c540 100644 --- a/trunk/arch/i386/kernel/cpu/intel.c +++ b/trunk/arch/i386/kernel/cpu/intel.c @@ -1,3 +1,4 @@ +#include #include #include diff --git a/trunk/arch/i386/kernel/cpu/mcheck/k7.c b/trunk/arch/i386/kernel/cpu/mcheck/k7.c index b0862af595aa..fc5d5215e23d 100644 --- a/trunk/arch/i386/kernel/cpu/mcheck/k7.c +++ b/trunk/arch/i386/kernel/cpu/mcheck/k7.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/i386/kernel/cpu/mcheck/mce.c b/trunk/arch/i386/kernel/cpu/mcheck/mce.c index d555bec0db99..afa0888f9a1e 100644 --- a/trunk/arch/i386/kernel/cpu/mcheck/mce.c +++ b/trunk/arch/i386/kernel/cpu/mcheck/mce.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/i386/kernel/cpu/mcheck/non-fatal.c b/trunk/arch/i386/kernel/cpu/mcheck/non-fatal.c index 1f9153ae5b03..82dffe0d4954 100644 --- a/trunk/arch/i386/kernel/cpu/mcheck/non-fatal.c +++ b/trunk/arch/i386/kernel/cpu/mcheck/non-fatal.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/i386/kernel/cpu/mcheck/p4.c b/trunk/arch/i386/kernel/cpu/mcheck/p4.c index b95f1b3d53aa..fd2c459a31ef 100644 --- a/trunk/arch/i386/kernel/cpu/mcheck/p4.c +++ b/trunk/arch/i386/kernel/cpu/mcheck/p4.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/i386/kernel/cpuid.c b/trunk/arch/i386/kernel/cpuid.c index fde8bea85cee..f6dfa9fb675c 100644 --- a/trunk/arch/i386/kernel/cpuid.c +++ b/trunk/arch/i386/kernel/cpuid.c @@ -24,6 +24,7 @@ */ #include +#include #include #include @@ -167,7 +168,6 @@ static int cpuid_class_device_create(int i) return err; } -#ifdef CONFIG_HOTPLUG_CPU static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -187,7 +187,6 @@ static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier = { .notifier_call = cpuid_class_cpu_callback, }; -#endif /* !CONFIG_HOTPLUG_CPU */ static int __init cpuid_init(void) { @@ -210,7 +209,7 @@ static int __init cpuid_init(void) if (err != 0) goto out_class; } - register_hotcpu_notifier(&cpuid_class_cpu_notifier); + register_cpu_notifier(&cpuid_class_cpu_notifier); err = 0; goto out; @@ -235,7 +234,7 @@ static void __exit cpuid_exit(void) class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu)); class_destroy(cpuid_class); unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); - unregister_hotcpu_notifier(&cpuid_class_cpu_notifier); + unregister_cpu_notifier(&cpuid_class_cpu_notifier); } module_init(cpuid_init); diff --git a/trunk/arch/i386/kernel/efi.c b/trunk/arch/i386/kernel/efi.c index fe158042110b..8beb0f07d999 100644 --- a/trunk/arch/i386/kernel/efi.c +++ b/trunk/arch/i386/kernel/efi.c @@ -19,6 +19,7 @@ * Skip non-WB memory and ignore empty memory ranges. */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/efi_stub.S b/trunk/arch/i386/kernel/efi_stub.S index d3ee73a3eee3..08c0312d9b6c 100644 --- a/trunk/arch/i386/kernel/efi_stub.S +++ b/trunk/arch/i386/kernel/efi_stub.S @@ -5,6 +5,7 @@ * turned off. */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/entry.S b/trunk/arch/i386/kernel/entry.S index d9a260f2efb4..fbdb933251b6 100644 --- a/trunk/arch/i386/kernel/entry.S +++ b/trunk/arch/i386/kernel/entry.S @@ -40,9 +40,9 @@ * "current" is in register %ebx during any slow entries. */ +#include #include #include -#include #include #include #include @@ -77,21 +77,12 @@ NT_MASK = 0x00004000 VM_MASK = 0x00020000 #ifdef CONFIG_PREEMPT -#define preempt_stop cli; TRACE_IRQS_OFF +#define preempt_stop cli #else #define preempt_stop #define resume_kernel restore_nocheck #endif -.macro TRACE_IRQS_IRET -#ifdef CONFIG_TRACE_IRQFLAGS - testl $IF_MASK,EFLAGS(%esp) # interrupts off? - jz 1f - TRACE_IRQS_ON -1: -#endif -.endm - #ifdef CONFIG_VM86 #define resume_userspace_sig check_userspace #else @@ -267,10 +258,6 @@ ENTRY(sysenter_entry) CFI_REGISTER esp, ebp movl TSS_sysenter_esp0(%esp),%esp sysenter_past_esp: - /* - * No need to follow this irqs on/off section: the syscall - * disabled irqs and here we enable it straight after entry: - */ sti pushl $(__USER_DS) CFI_ADJUST_CFA_OFFSET 4 @@ -317,7 +304,6 @@ sysenter_past_esp: call *sys_call_table(,%eax,4) movl %eax,EAX(%esp) cli - TRACE_IRQS_OFF movl TI_flags(%ebp), %ecx testw $_TIF_ALLWORK_MASK, %cx jne syscall_exit_work @@ -325,7 +311,6 @@ sysenter_past_esp: movl EIP(%esp), %edx movl OLDESP(%esp), %ecx xorl %ebp,%ebp - TRACE_IRQS_ON sti sysexit CFI_ENDPROC @@ -355,7 +340,6 @@ syscall_exit: cli # make sure we don't miss an interrupt # setting need_resched or sigpending # between sampling and the iret - TRACE_IRQS_OFF movl TI_flags(%ebp), %ecx testw $_TIF_ALLWORK_MASK, %cx # current->work jne syscall_exit_work @@ -372,15 +356,12 @@ restore_all: CFI_REMEMBER_STATE je ldt_ss # returning to user-space with LDT SS restore_nocheck: - TRACE_IRQS_IRET -restore_nocheck_notrace: RESTORE_REGS addl $4, %esp CFI_ADJUST_CFA_OFFSET -4 1: iret .section .fixup,"ax" iret_exc: - TRACE_IRQS_ON sti pushl $0 # no error code pushl $do_iret_error @@ -406,13 +387,11 @@ ldt_ss: subl $8, %esp # reserve space for switch16 pointer CFI_ADJUST_CFA_OFFSET 8 cli - TRACE_IRQS_OFF movl %esp, %eax /* Set up the 16bit stack frame with switch32 pointer on top, * and a switch16 pointer on top of the current frame. */ call setup_x86_bogus_stack CFI_ADJUST_CFA_OFFSET -8 # frame has moved - TRACE_IRQS_IRET RESTORE_REGS lss 20+4(%esp), %esp # switch to 16bit stack 1: iret @@ -433,7 +412,6 @@ work_resched: cli # make sure we don't miss an interrupt # setting need_resched or sigpending # between sampling and the iret - TRACE_IRQS_OFF movl TI_flags(%ebp), %ecx andl $_TIF_WORK_MASK, %ecx # is there any work to be done other # than syscall tracing? @@ -485,7 +463,6 @@ syscall_trace_entry: syscall_exit_work: testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl jz work_pending - TRACE_IRQS_ON sti # could let do_syscall_trace() call # schedule() instead movl %esp, %eax @@ -559,14 +536,9 @@ ENTRY(irq_entries_start) vector=vector+1 .endr -/* - * the CPU automatically disables interrupts when executing an IRQ vector, - * so IRQ-flags tracing has to follow that: - */ ALIGN common_interrupt: SAVE_ALL - TRACE_IRQS_OFF movl %esp,%eax call do_IRQ jmp ret_from_intr @@ -578,10 +550,9 @@ ENTRY(name) \ pushl $~(nr); \ CFI_ADJUST_CFA_OFFSET 4; \ SAVE_ALL; \ - TRACE_IRQS_OFF \ movl %esp,%eax; \ call smp_/**/name; \ - jmp ret_from_intr; \ + jmp ret_from_intr; \ CFI_ENDPROC /* The include is where all of the SMP etc. interrupts come from */ @@ -756,7 +727,7 @@ nmi_stack_correct: xorl %edx,%edx # zero error code movl %esp,%eax # pt_regs pointer call do_nmi - jmp restore_nocheck_notrace + jmp restore_all CFI_ENDPROC nmi_stack_fixup: diff --git a/trunk/arch/i386/kernel/head.S b/trunk/arch/i386/kernel/head.S index eb79aa2fa8bb..3debc2e26542 100644 --- a/trunk/arch/i386/kernel/head.S +++ b/trunk/arch/i386/kernel/head.S @@ -8,6 +8,7 @@ */ .text +#include #include #include #include diff --git a/trunk/arch/i386/kernel/i386_ksyms.c b/trunk/arch/i386/kernel/i386_ksyms.c index e3d4b73bfdb0..036a9857936f 100644 --- a/trunk/arch/i386/kernel/i386_ksyms.c +++ b/trunk/arch/i386/kernel/i386_ksyms.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/i387.c b/trunk/arch/i386/kernel/i387.c index 665847281ed2..c4351972d9af 100644 --- a/trunk/arch/i386/kernel/i387.c +++ b/trunk/arch/i386/kernel/i387.c @@ -8,6 +8,7 @@ * Gareth Hughes , May 2000 */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/i8259.c b/trunk/arch/i386/kernel/i8259.c index d4756d154f47..3c6063671a9f 100644 --- a/trunk/arch/i386/kernel/i8259.c +++ b/trunk/arch/i386/kernel/i8259.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/io_apic.c b/trunk/arch/i386/kernel/io_apic.c index 4fb32c551fe0..ec9ea0269d36 100644 --- a/trunk/arch/i386/kernel/io_apic.c +++ b/trunk/arch/i386/kernel/io_apic.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/i386/kernel/irq.c b/trunk/arch/i386/kernel/irq.c index 6cb529f60dcc..16b491703967 100644 --- a/trunk/arch/i386/kernel/irq.c +++ b/trunk/arch/i386/kernel/irq.c @@ -166,7 +166,7 @@ void irq_ctx_init(int cpu) irqctx->tinfo.task = NULL; irqctx->tinfo.exec_domain = NULL; irqctx->tinfo.cpu = cpu; - irqctx->tinfo.preempt_count = 0; + irqctx->tinfo.preempt_count = SOFTIRQ_OFFSET; irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); softirq_ctx[cpu] = irqctx; @@ -211,10 +211,6 @@ asmlinkage void do_softirq(void) : "0"(isp) : "memory", "cc", "edx", "ecx", "eax" ); - /* - * Shouldnt happen, we returned above if in_interrupt(): - */ - WARN_ON_ONCE(softirq_count()); } local_irq_restore(flags); diff --git a/trunk/arch/i386/kernel/kprobes.c b/trunk/arch/i386/kernel/kprobes.c index de2e16e561c0..727e419ad78a 100644 --- a/trunk/arch/i386/kernel/kprobes.c +++ b/trunk/arch/i386/kernel/kprobes.c @@ -28,6 +28,7 @@ * added function-return probes. */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/mca.c b/trunk/arch/i386/kernel/mca.c index cd5456f14af4..558bb207720f 100644 --- a/trunk/arch/i386/kernel/mca.c +++ b/trunk/arch/i386/kernel/mca.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/i386/kernel/mpparse.c b/trunk/arch/i386/kernel/mpparse.c index a70b5fa0ef06..6b1392d33ed5 100644 --- a/trunk/arch/i386/kernel/mpparse.c +++ b/trunk/arch/i386/kernel/mpparse.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/i386/kernel/msr.c b/trunk/arch/i386/kernel/msr.c index d535cdbbfd25..d022cb8fd725 100644 --- a/trunk/arch/i386/kernel/msr.c +++ b/trunk/arch/i386/kernel/msr.c @@ -24,6 +24,7 @@ */ #include +#include #include #include @@ -250,9 +251,7 @@ static int msr_class_device_create(int i) return err; } -#ifdef CONFIG_HOTPLUG_CPU -static int msr_class_cpu_callback(struct notifier_block *nfb, - unsigned long action, void *hcpu) +static int msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -271,7 +270,6 @@ static struct notifier_block __cpuinitdata msr_class_cpu_notifier = { .notifier_call = msr_class_cpu_callback, }; -#endif static int __init msr_init(void) { @@ -294,7 +292,7 @@ static int __init msr_init(void) if (err != 0) goto out_class; } - register_hotcpu_notifier(&msr_class_cpu_notifier); + register_cpu_notifier(&msr_class_cpu_notifier); err = 0; goto out; @@ -317,7 +315,7 @@ static void __exit msr_exit(void) class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); class_destroy(msr_class); unregister_chrdev(MSR_MAJOR, "cpu/msr"); - unregister_hotcpu_notifier(&msr_class_cpu_notifier); + unregister_cpu_notifier(&msr_class_cpu_notifier); } module_init(msr_init); diff --git a/trunk/arch/i386/kernel/nmi.c b/trunk/arch/i386/kernel/nmi.c index 2dd928a84645..a76e93146585 100644 --- a/trunk/arch/i386/kernel/nmi.c +++ b/trunk/arch/i386/kernel/nmi.c @@ -107,7 +107,7 @@ int nmi_active; static __init void nmi_cpu_busy(void *data) { volatile int *endflag = data; - local_irq_enable_in_hardirq(); + local_irq_enable(); /* Intentionally don't use cpu_relax here. This is to make sure that the performance counter really ticks, even if there is a simulator or similar that catches the diff --git a/trunk/arch/i386/kernel/numaq.c b/trunk/arch/i386/kernel/numaq.c index 9000d82c6dc0..0caf14652bad 100644 --- a/trunk/arch/i386/kernel/numaq.c +++ b/trunk/arch/i386/kernel/numaq.c @@ -23,6 +23,7 @@ * Send feedback to */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/process.c b/trunk/arch/i386/kernel/process.c index 94e2c87edeaa..6946b06e2784 100644 --- a/trunk/arch/i386/kernel/process.c +++ b/trunk/arch/i386/kernel/process.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/i386/kernel/quirks.c b/trunk/arch/i386/kernel/quirks.c index 9f6ab1789bb0..87ccdac84928 100644 --- a/trunk/arch/i386/kernel/quirks.c +++ b/trunk/arch/i386/kernel/quirks.c @@ -1,6 +1,7 @@ /* * This file contains work-arounds for x86 and x86_64 platform bugs. */ +#include #include #include diff --git a/trunk/arch/i386/kernel/reboot.c b/trunk/arch/i386/kernel/reboot.c index 54cfeabbc5e4..d207242976d3 100644 --- a/trunk/arch/i386/kernel/reboot.c +++ b/trunk/arch/i386/kernel/reboot.c @@ -2,6 +2,7 @@ * linux/arch/i386/kernel/reboot.c */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/scx200.c b/trunk/arch/i386/kernel/scx200.c index c7d3df23f589..9bf590cefc7d 100644 --- a/trunk/arch/i386/kernel/scx200.c +++ b/trunk/arch/i386/kernel/scx200.c @@ -4,6 +4,7 @@ National Semiconductor SCx200 support. */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/semaphore.c b/trunk/arch/i386/kernel/semaphore.c index 98352c374c76..967dc74df9ee 100644 --- a/trunk/arch/i386/kernel/semaphore.c +++ b/trunk/arch/i386/kernel/semaphore.c @@ -12,6 +12,7 @@ * * rw semaphores implemented November 1999 by Benjamin LaHaise */ +#include #include /* diff --git a/trunk/arch/i386/kernel/setup.c b/trunk/arch/i386/kernel/setup.c index 08c00d20f162..6712f0d2eb37 100644 --- a/trunk/arch/i386/kernel/setup.c +++ b/trunk/arch/i386/kernel/setup.c @@ -23,6 +23,7 @@ * This file handles the architecture-dependent parts of initialization */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/smpboot.c b/trunk/arch/i386/kernel/smpboot.c index 6f5fea05f1d7..89e7315e539c 100644 --- a/trunk/arch/i386/kernel/smpboot.c +++ b/trunk/arch/i386/kernel/smpboot.c @@ -34,6 +34,7 @@ * Rusty Russell : Hacked into shape for new "hotplug" boot process. */ #include +#include #include #include diff --git a/trunk/arch/i386/kernel/srat.c b/trunk/arch/i386/kernel/srat.c index b1809c9a0899..989c85255dbe 100644 --- a/trunk/arch/i386/kernel/srat.c +++ b/trunk/arch/i386/kernel/srat.c @@ -23,6 +23,7 @@ * * Send feedback to Pat Gaughen */ +#include #include #include #include diff --git a/trunk/arch/i386/kernel/stacktrace.c b/trunk/arch/i386/kernel/stacktrace.c deleted file mode 100644 index e62a037ab399..000000000000 --- a/trunk/arch/i386/kernel/stacktrace.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * arch/i386/kernel/stacktrace.c - * - * Stack trace management functions - * - * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar - */ -#include -#include - -static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) -{ - return p > (void *)tinfo && - p < (void *)tinfo + THREAD_SIZE - 3; -} - -/* - * Save stack-backtrace addresses into a stack_trace buffer: - */ -static inline unsigned long -save_context_stack(struct stack_trace *trace, unsigned int skip, - struct thread_info *tinfo, unsigned long *stack, - unsigned long ebp) -{ - unsigned long addr; - -#ifdef CONFIG_FRAME_POINTER - while (valid_stack_ptr(tinfo, (void *)ebp)) { - addr = *(unsigned long *)(ebp + 4); - if (!skip) - trace->entries[trace->nr_entries++] = addr; - else - skip--; - if (trace->nr_entries >= trace->max_entries) - break; - /* - * break out of recursive entries (such as - * end_of_stack_stop_unwind_function): - */ - if (ebp == *(unsigned long *)ebp) - break; - - ebp = *(unsigned long *)ebp; - } -#else - while (valid_stack_ptr(tinfo, stack)) { - addr = *stack++; - if (__kernel_text_address(addr)) { - if (!skip) - trace->entries[trace->nr_entries++] = addr; - else - skip--; - if (trace->nr_entries >= trace->max_entries) - break; - } - } -#endif - - return ebp; -} - -/* - * Save stack-backtrace addresses into a stack_trace buffer. - * If all_contexts is set, all contexts (hardirq, softirq and process) - * are saved. If not set then only the current context is saved. - */ -void save_stack_trace(struct stack_trace *trace, - struct task_struct *task, int all_contexts, - unsigned int skip) -{ - unsigned long ebp; - unsigned long *stack = &ebp; - - WARN_ON(trace->nr_entries || !trace->max_entries); - - if (!task || task == current) { - /* Grab ebp right from our regs: */ - asm ("movl %%ebp, %0" : "=r" (ebp)); - } else { - /* ebp is the last reg pushed by switch_to(): */ - ebp = *(unsigned long *) task->thread.esp; - } - - while (1) { - struct thread_info *context = (struct thread_info *) - ((unsigned long)stack & (~(THREAD_SIZE - 1))); - - ebp = save_context_stack(trace, skip, context, stack, ebp); - stack = (unsigned long *)context->previous_esp; - if (!all_contexts || !stack || - trace->nr_entries >= trace->max_entries) - break; - trace->entries[trace->nr_entries++] = ULONG_MAX; - if (trace->nr_entries >= trace->max_entries) - break; - } -} - diff --git a/trunk/arch/i386/kernel/time.c b/trunk/arch/i386/kernel/time.c index 316421a7f56f..5f43d0410122 100644 --- a/trunk/arch/i386/kernel/time.c +++ b/trunk/arch/i386/kernel/time.c @@ -60,6 +60,7 @@ #include "mach_time.h" #include +#include #include diff --git a/trunk/arch/i386/kernel/time_hpet.c b/trunk/arch/i386/kernel/time_hpet.c index 14a1376fedd1..a529f0cdce17 100644 --- a/trunk/arch/i386/kernel/time_hpet.c +++ b/trunk/arch/i386/kernel/time_hpet.c @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/trunk/arch/i386/kernel/traps.c b/trunk/arch/i386/kernel/traps.c index 2bf8b55b91f8..78464097470a 100644 --- a/trunk/arch/i386/kernel/traps.c +++ b/trunk/arch/i386/kernel/traps.c @@ -11,6 +11,7 @@ * 'Traps.c' handles hardware traps and faults after we have saved some * state in 'asm.s'. */ +#include #include #include #include @@ -115,13 +116,28 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) } /* - * Print one address/symbol entries per line. + * Print CONFIG_STACK_BACKTRACE_COLS address/symbol entries per line. */ -static inline void print_addr_and_symbol(unsigned long addr, char *log_lvl) +static inline int print_addr_and_symbol(unsigned long addr, char *log_lvl, + int printed) { + if (!printed) + printk(log_lvl); + +#if CONFIG_STACK_BACKTRACE_COLS == 1 printk(" [<%08lx>] ", addr); +#else + printk(" <%08lx> ", addr); +#endif + print_symbol("%s", addr); - print_symbol("%s\n", addr); + printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS; + if (printed) + printk(" "); + else + printk("\n"); + + return printed; } static inline unsigned long print_context_stack(struct thread_info *tinfo, @@ -129,11 +145,12 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo, char *log_lvl) { unsigned long addr; + int printed = 0; /* nr of entries already printed on current line */ #ifdef CONFIG_FRAME_POINTER while (valid_stack_ptr(tinfo, (void *)ebp)) { addr = *(unsigned long *)(ebp + 4); - print_addr_and_symbol(addr, log_lvl); + printed = print_addr_and_symbol(addr, log_lvl, printed); /* * break out of recursive entries (such as * end_of_stack_stop_unwind_function): @@ -146,23 +163,28 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo, while (valid_stack_ptr(tinfo, stack)) { addr = *stack++; if (__kernel_text_address(addr)) - print_addr_and_symbol(addr, log_lvl); + printed = print_addr_and_symbol(addr, log_lvl, printed); } #endif + if (printed) + printk("\n"); + return ebp; } -static asmlinkage int -show_trace_unwind(struct unwind_frame_info *info, void *log_lvl) +static asmlinkage int show_trace_unwind(struct unwind_frame_info *info, void *log_lvl) { int n = 0; + int printed = 0; /* nr of entries already printed on current line */ while (unwind(info) == 0 && UNW_PC(info)) { - n++; - print_addr_and_symbol(UNW_PC(info), log_lvl); + ++n; + printed = print_addr_and_symbol(UNW_PC(info), log_lvl, printed); if (arch_unw_user_mode(info)) break; } + if (printed) + printk("\n"); return n; } diff --git a/trunk/arch/i386/kernel/vm86.c b/trunk/arch/i386/kernel/vm86.c index 8355d8d87d18..00e0118e717c 100644 --- a/trunk/arch/i386/kernel/vm86.c +++ b/trunk/arch/i386/kernel/vm86.c @@ -31,6 +31,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/i386/lib/checksum.S b/trunk/arch/i386/lib/checksum.S index 75ffd02654fc..94c7867ddc33 100644 --- a/trunk/arch/i386/lib/checksum.S +++ b/trunk/arch/i386/lib/checksum.S @@ -25,6 +25,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include /* diff --git a/trunk/arch/i386/lib/memcpy.c b/trunk/arch/i386/lib/memcpy.c index 8ac51b82a632..891b2359d18a 100644 --- a/trunk/arch/i386/lib/memcpy.c +++ b/trunk/arch/i386/lib/memcpy.c @@ -1,3 +1,4 @@ +#include #include #include diff --git a/trunk/arch/i386/lib/mmx.c b/trunk/arch/i386/lib/mmx.c index 28084d2e8dd4..2afda94dffd3 100644 --- a/trunk/arch/i386/lib/mmx.c +++ b/trunk/arch/i386/lib/mmx.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/i386/lib/usercopy.c b/trunk/arch/i386/lib/usercopy.c index 4b75212ab6dd..c5aa65f7c02a 100644 --- a/trunk/arch/i386/lib/usercopy.c +++ b/trunk/arch/i386/lib/usercopy.c @@ -5,6 +5,7 @@ * Copyright 1997 Andi Kleen * Copyright 1997 Linus Torvalds */ +#include #include #include #include diff --git a/trunk/arch/i386/mach-default/setup.c b/trunk/arch/i386/mach-default/setup.c index c511705c386c..004837c58793 100644 --- a/trunk/arch/i386/mach-default/setup.c +++ b/trunk/arch/i386/mach-default/setup.c @@ -2,6 +2,7 @@ * Machine specific setup for generic */ +#include #include #include #include @@ -79,7 +80,7 @@ void __init trap_init_hook(void) { } -static struct irqaction irq0 = { timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL}; +static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL}; /** * time_init_hook - do any specific initialisations for the system timer. diff --git a/trunk/arch/i386/mach-generic/bigsmp.c b/trunk/arch/i386/mach-generic/bigsmp.c index ef7a6e6fcb9f..037b2af1a1f4 100644 --- a/trunk/arch/i386/mach-generic/bigsmp.c +++ b/trunk/arch/i386/mach-generic/bigsmp.c @@ -3,6 +3,7 @@ * Drives the local APIC in "clustered mode". */ #define APIC_DEFINITION 1 +#include #include #include #include diff --git a/trunk/arch/i386/mach-generic/default.c b/trunk/arch/i386/mach-generic/default.c index 96c19821e47d..7da14e9a79c3 100644 --- a/trunk/arch/i386/mach-generic/default.c +++ b/trunk/arch/i386/mach-generic/default.c @@ -2,6 +2,7 @@ * Default generic APIC driver. This handles upto 8 CPUs. */ #define APIC_DEFINITION 1 +#include #include #include #include diff --git a/trunk/arch/i386/mach-generic/es7000.c b/trunk/arch/i386/mach-generic/es7000.c index 845cdd0b3593..48d3ec37241b 100644 --- a/trunk/arch/i386/mach-generic/es7000.c +++ b/trunk/arch/i386/mach-generic/es7000.c @@ -2,6 +2,7 @@ * APIC driver for the Unisys ES7000 chipset. */ #define APIC_DEFINITION 1 +#include #include #include #include diff --git a/trunk/arch/i386/mach-generic/probe.c b/trunk/arch/i386/mach-generic/probe.c index bcd1bcfaa723..d55fa7b187ab 100644 --- a/trunk/arch/i386/mach-generic/probe.c +++ b/trunk/arch/i386/mach-generic/probe.c @@ -3,6 +3,7 @@ * * Generic x86 APIC driver probe layer. */ +#include #include #include #include diff --git a/trunk/arch/i386/mach-generic/summit.c b/trunk/arch/i386/mach-generic/summit.c index b73501ddd653..65ddf74d7f25 100644 --- a/trunk/arch/i386/mach-generic/summit.c +++ b/trunk/arch/i386/mach-generic/summit.c @@ -2,6 +2,7 @@ * APIC driver for the IBM "Summit" chipset. */ #define APIC_DEFINITION 1 +#include #include #include #include diff --git a/trunk/arch/i386/mach-visws/mpparse.c b/trunk/arch/i386/mach-visws/mpparse.c index f3c74fab8b95..5f3d7e6de37b 100644 --- a/trunk/arch/i386/mach-visws/mpparse.c +++ b/trunk/arch/i386/mach-visws/mpparse.c @@ -1,4 +1,5 @@ +#include #include #include diff --git a/trunk/arch/i386/mach-visws/setup.c b/trunk/arch/i386/mach-visws/setup.c index 885c7cbfd478..1f84cdb24779 100644 --- a/trunk/arch/i386/mach-visws/setup.c +++ b/trunk/arch/i386/mach-visws/setup.c @@ -115,7 +115,7 @@ void __init pre_setup_arch_hook() static struct irqaction irq0 = { .handler = timer_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "timer", }; diff --git a/trunk/arch/i386/mach-visws/traps.c b/trunk/arch/i386/mach-visws/traps.c index 5199bd03254a..964353992031 100644 --- a/trunk/arch/i386/mach-visws/traps.c +++ b/trunk/arch/i386/mach-visws/traps.c @@ -1,5 +1,6 @@ /* VISWS traps */ +#include #include #include #include diff --git a/trunk/arch/i386/mach-visws/visws_apic.c b/trunk/arch/i386/mach-visws/visws_apic.c index 828522541a88..c418521dd554 100644 --- a/trunk/arch/i386/mach-visws/visws_apic.c +++ b/trunk/arch/i386/mach-visws/visws_apic.c @@ -16,6 +16,7 @@ * 25/11/2002 - Updated for 2.5 by Andrey Panin */ +#include #include #include #include diff --git a/trunk/arch/i386/mach-voyager/setup.c b/trunk/arch/i386/mach-voyager/setup.c index cfa16c151c8f..defc6ebbd565 100644 --- a/trunk/arch/i386/mach-voyager/setup.c +++ b/trunk/arch/i386/mach-voyager/setup.c @@ -2,6 +2,7 @@ * Machine specific setup for generic */ +#include #include #include #include @@ -40,7 +41,7 @@ void __init trap_init_hook(void) { } -static struct irqaction irq0 = { timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL}; +static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL}; void __init time_init_hook(void) { diff --git a/trunk/arch/i386/mach-voyager/voyager_basic.c b/trunk/arch/i386/mach-voyager/voyager_basic.c index 80b7f2fc4f46..b584060ec004 100644 --- a/trunk/arch/i386/mach-voyager/voyager_basic.c +++ b/trunk/arch/i386/mach-voyager/voyager_basic.c @@ -12,6 +12,7 @@ * voyager_smp.c - Voyager SMP hal (emulates linux smp.c) */ +#include #include #include #include diff --git a/trunk/arch/i386/mach-voyager/voyager_cat.c b/trunk/arch/i386/mach-voyager/voyager_cat.c index f50c6c6ad680..10d21df14531 100644 --- a/trunk/arch/i386/mach-voyager/voyager_cat.c +++ b/trunk/arch/i386/mach-voyager/voyager_cat.c @@ -16,6 +16,7 @@ * of bit shift manipulations to send and receive packets on the * serial bus */ +#include #include #include #include diff --git a/trunk/arch/i386/mach-voyager/voyager_smp.c b/trunk/arch/i386/mach-voyager/voyager_smp.c index 6c86575ffdcb..5b8b579a079f 100644 --- a/trunk/arch/i386/mach-voyager/voyager_smp.c +++ b/trunk/arch/i386/mach-voyager/voyager_smp.c @@ -9,6 +9,7 @@ * This file provides all the same external entries as smp.c but uses * the voyager hal to provide the functionality */ +#include #include #include #include @@ -1937,9 +1938,3 @@ smp_cpus_done(unsigned int max_cpus) { zap_low_mappings(); } - -void __init -smp_setup_processor_id(void) -{ - current_thread_info()->cpu = hard_smp_processor_id(); -} diff --git a/trunk/arch/i386/mach-voyager/voyager_thread.c b/trunk/arch/i386/mach-voyager/voyager_thread.c index 50f6de6ff64d..2b03884fdb2a 100644 --- a/trunk/arch/i386/mach-voyager/voyager_thread.c +++ b/trunk/arch/i386/mach-voyager/voyager_thread.c @@ -14,6 +14,7 @@ * */ #include +#include #include #include #include diff --git a/trunk/arch/i386/mm/boot_ioremap.c b/trunk/arch/i386/mm/boot_ioremap.c index 5d44f4f5ff59..523b30634e0a 100644 --- a/trunk/arch/i386/mm/boot_ioremap.c +++ b/trunk/arch/i386/mm/boot_ioremap.c @@ -15,6 +15,7 @@ * boot_pte_t is defined only if this all works correctly */ +#include #undef CONFIG_X86_PAE #include #include diff --git a/trunk/arch/i386/mm/discontig.c b/trunk/arch/i386/mm/discontig.c index 7c392dc553b8..fe6eb901326e 100644 --- a/trunk/arch/i386/mm/discontig.c +++ b/trunk/arch/i386/mm/discontig.c @@ -22,6 +22,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -42,7 +43,7 @@ EXPORT_SYMBOL(node_data); bootmem_data_t node0_bdata; /* - * numa interface - we expect the numa architecture specific code to have + * numa interface - we expect the numa architecture specfic code to have * populated the following initialisation. * * 1) node_online_map - the map of all nodes configured (online) in the system diff --git a/trunk/arch/i386/mm/extable.c b/trunk/arch/i386/mm/extable.c index de03c5430abc..f706449319c4 100644 --- a/trunk/arch/i386/mm/extable.c +++ b/trunk/arch/i386/mm/extable.c @@ -2,6 +2,7 @@ * linux/arch/i386/mm/extable.c */ +#include #include #include #include diff --git a/trunk/arch/i386/mm/fault.c b/trunk/arch/i386/mm/fault.c index f7279468323a..6ee7faaf2c1b 100644 --- a/trunk/arch/i386/mm/fault.c +++ b/trunk/arch/i386/mm/fault.c @@ -389,7 +389,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs, /* When running in the kernel we expect faults to occur only to * addresses in user space. All other faults represent errors in the * kernel and should generate an OOPS. Unfortunatly, in the case of an - * erroneous fault occurring in a code path which already holds mmap_sem + * erroneous fault occuring in a code path which already holds mmap_sem * we will deadlock attempting to validate the fault against the * address space. Luckily the kernel only validly references user * space from well defined areas of code, which are listed in the diff --git a/trunk/arch/i386/mm/hugetlbpage.c b/trunk/arch/i386/mm/hugetlbpage.c index 1719a8141f81..a7d891585411 100644 --- a/trunk/arch/i386/mm/hugetlbpage.c +++ b/trunk/arch/i386/mm/hugetlbpage.c @@ -4,6 +4,7 @@ * Copyright (C) 2002, Rohit Seth */ +#include #include #include #include diff --git a/trunk/arch/i386/mm/init.c b/trunk/arch/i386/mm/init.c index 89e8486aac34..f84b16e007ff 100644 --- a/trunk/arch/i386/mm/init.c +++ b/trunk/arch/i386/mm/init.c @@ -6,6 +6,7 @@ * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 */ +#include #include #include #include @@ -725,15 +726,16 @@ static int noinline do_test_wp_bit(void) #ifdef CONFIG_DEBUG_RODATA +extern char __start_rodata, __end_rodata; void mark_rodata_ro(void) { - unsigned long addr = (unsigned long)__start_rodata; + unsigned long addr = (unsigned long)&__start_rodata; - for (; addr < (unsigned long)__end_rodata; addr += PAGE_SIZE) + for (; addr < (unsigned long)&__end_rodata; addr += PAGE_SIZE) change_page_attr(virt_to_page(addr), 1, PAGE_KERNEL_RO); - printk("Write protecting the kernel read-only data: %uk\n", - (__end_rodata - __start_rodata) >> 10); + printk ("Write protecting the kernel read-only data: %luk\n", + (unsigned long)(&__end_rodata - &__start_rodata) >> 10); /* * change_page_attr() requires a global_flush_tlb() call after it. diff --git a/trunk/arch/i386/mm/pageattr.c b/trunk/arch/i386/mm/pageattr.c index 8564b6ae17e3..353a836ed63c 100644 --- a/trunk/arch/i386/mm/pageattr.c +++ b/trunk/arch/i386/mm/pageattr.c @@ -3,6 +3,7 @@ * Thanks to Ben LaHaise for precious feedback. */ +#include #include #include #include diff --git a/trunk/arch/i386/mm/pgtable.c b/trunk/arch/i386/mm/pgtable.c index bd98768d8764..2889567e21a1 100644 --- a/trunk/arch/i386/mm/pgtable.c +++ b/trunk/arch/i386/mm/pgtable.c @@ -2,6 +2,7 @@ * linux/arch/i386/mm/pgtable.c */ +#include #include #include #include @@ -29,6 +30,7 @@ void show_mem(void) struct page *page; pg_data_t *pgdat; unsigned long i; + struct page_state ps; unsigned long flags; printk(KERN_INFO "Mem-info:\n"); @@ -56,13 +58,12 @@ void show_mem(void) printk(KERN_INFO "%d pages shared\n", shared); printk(KERN_INFO "%d pages swap cached\n", cached); - printk(KERN_INFO "%lu pages dirty\n", global_page_state(NR_FILE_DIRTY)); - printk(KERN_INFO "%lu pages writeback\n", - global_page_state(NR_WRITEBACK)); - printk(KERN_INFO "%lu pages mapped\n", global_page_state(NR_FILE_MAPPED)); - printk(KERN_INFO "%lu pages slab\n", global_page_state(NR_SLAB)); - printk(KERN_INFO "%lu pages pagetables\n", - global_page_state(NR_PAGETABLE)); + get_page_state(&ps); + printk(KERN_INFO "%lu pages dirty\n", ps.nr_dirty); + printk(KERN_INFO "%lu pages writeback\n", ps.nr_writeback); + printk(KERN_INFO "%lu pages mapped\n", ps.nr_mapped); + printk(KERN_INFO "%lu pages slab\n", ps.nr_slab); + printk(KERN_INFO "%lu pages pagetables\n", ps.nr_page_table_pages); } /* diff --git a/trunk/arch/i386/pci/init.c b/trunk/arch/i386/pci/init.c index c7650a7e0b07..f9156d3ac723 100644 --- a/trunk/arch/i386/pci/init.c +++ b/trunk/arch/i386/pci/init.c @@ -1,3 +1,4 @@ +#include #include #include #include "pci.h" diff --git a/trunk/arch/i386/pci/irq.c b/trunk/arch/i386/pci/irq.c index 4a8995c9c762..8ce69508f3c7 100644 --- a/trunk/arch/i386/pci/irq.c +++ b/trunk/arch/i386/pci/irq.c @@ -4,6 +4,7 @@ * (c) 1999--2000 Martin Mares */ +#include #include #include #include @@ -864,7 +865,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) for (i = 0; i < 16; i++) { if (!(mask & (1 << i))) continue; - if (pirq_penalty[i] < pirq_penalty[newirq] && can_request_irq(i, IRQF_SHARED)) + if (pirq_penalty[i] < pirq_penalty[newirq] && can_request_irq(i, SA_SHIRQ)) newirq = i; } } diff --git a/trunk/arch/i386/pci/visws.c b/trunk/arch/i386/pci/visws.c index f1b486d4190b..6c17433fdf7d 100644 --- a/trunk/arch/i386/pci/visws.c +++ b/trunk/arch/i386/pci/visws.c @@ -4,6 +4,7 @@ * (c) 1999--2000 Martin Mares */ +#include #include #include #include diff --git a/trunk/arch/i386/power/cpu.c b/trunk/arch/i386/power/cpu.c index 5a1abeff033b..e6517915fe3e 100644 --- a/trunk/arch/i386/power/cpu.c +++ b/trunk/arch/i386/power/cpu.c @@ -7,6 +7,7 @@ * Copyright (c) 2001 Patrick Mochel */ +#include #include #include #include diff --git a/trunk/arch/ia64/Kconfig b/trunk/arch/ia64/Kconfig index 47de9ee6bcd6..b487e227a1f7 100644 --- a/trunk/arch/ia64/Kconfig +++ b/trunk/arch/ia64/Kconfig @@ -70,11 +70,6 @@ config DMA_IS_DMA32 bool default y -config DMA_IS_NORMAL - bool - depends on IA64_SGI_SN2 - default y - choice prompt "System type" default IA64_GENERIC diff --git a/trunk/arch/ia64/dig/setup.c b/trunk/arch/ia64/dig/setup.c index 5ab12b8351d0..38aa9c108857 100644 --- a/trunk/arch/ia64/dig/setup.c +++ b/trunk/arch/ia64/dig/setup.c @@ -8,6 +8,7 @@ * Copyright (C) 1999 Walt Drummond * Copyright (C) 1999 Vijay Chander */ +#include #include #include diff --git a/trunk/arch/ia64/hp/common/sba_iommu.c b/trunk/arch/ia64/hp/common/sba_iommu.c index db8e1fcfa047..5825ddee58d6 100644 --- a/trunk/arch/ia64/hp/common/sba_iommu.c +++ b/trunk/arch/ia64/hp/common/sba_iommu.c @@ -19,6 +19,7 @@ ** */ +#include #include #include #include diff --git a/trunk/arch/ia64/hp/sim/boot/bootloader.c b/trunk/arch/ia64/hp/sim/boot/bootloader.c index c5e9baafafe0..51a7b7b4dd0e 100644 --- a/trunk/arch/ia64/hp/sim/boot/bootloader.c +++ b/trunk/arch/ia64/hp/sim/boot/bootloader.c @@ -11,6 +11,7 @@ */ struct task_struct; /* forward declaration for elf.h */ +#include #include #include #include diff --git a/trunk/arch/ia64/hp/sim/boot/fw-emu.c b/trunk/arch/ia64/hp/sim/boot/fw-emu.c index 5a0a7afcfc3a..30fdfb1d0a53 100644 --- a/trunk/arch/ia64/hp/sim/boot/fw-emu.c +++ b/trunk/arch/ia64/hp/sim/boot/fw-emu.c @@ -4,6 +4,7 @@ * Copyright (C) 1998-2001 Hewlett-Packard Co * David Mosberger-Tang */ +#include #ifdef CONFIG_PCI # include diff --git a/trunk/arch/ia64/hp/sim/hpsim_console.c b/trunk/arch/ia64/hp/sim/hpsim_console.c index 6e149c8ab835..5deff21e5877 100644 --- a/trunk/arch/ia64/hp/sim/hpsim_console.c +++ b/trunk/arch/ia64/hp/sim/hpsim_console.c @@ -5,6 +5,7 @@ * David Mosberger-Tang * Copyright (C) 1999 Vijay Chander */ +#include #include #include diff --git a/trunk/arch/ia64/hp/sim/hpsim_setup.c b/trunk/arch/ia64/hp/sim/hpsim_setup.c index f2297192a582..694fc86bfbd5 100644 --- a/trunk/arch/ia64/hp/sim/hpsim_setup.c +++ b/trunk/arch/ia64/hp/sim/hpsim_setup.c @@ -5,6 +5,7 @@ * David Mosberger-Tang * Copyright (C) 1999 Vijay Chander */ +#include #include #include #include diff --git a/trunk/arch/ia64/hp/sim/simeth.c b/trunk/arch/ia64/hp/sim/simeth.c index b5195be62818..0639ec0ed015 100644 --- a/trunk/arch/ia64/hp/sim/simeth.c +++ b/trunk/arch/ia64/hp/sim/simeth.c @@ -4,6 +4,7 @@ * Copyright (C) 1999-2001, 2003 Hewlett-Packard Co * Stephane Eranian */ +#include #include #include #include diff --git a/trunk/arch/ia64/hp/sim/simserial.c b/trunk/arch/ia64/hp/sim/simserial.c index 0daacc20ed36..0e5c6ae50228 100644 --- a/trunk/arch/ia64/hp/sim/simserial.c +++ b/trunk/arch/ia64/hp/sim/simserial.c @@ -16,6 +16,7 @@ * 07/30/02 D. Mosberger Replace sti()/cli() with explicit spinlocks & local irq masking */ +#include #include #include #include @@ -46,7 +47,7 @@ #define NR_PORTS 1 /* only one port for now */ -#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? IRQF_SHARED : IRQF_DISABLED) +#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT) #define SSC_GETCHAR 21 diff --git a/trunk/arch/ia64/ia32/Makefile b/trunk/arch/ia64/ia32/Makefile index baad8c7699c0..61cb60affd95 100644 --- a/trunk/arch/ia64/ia32/Makefile +++ b/trunk/arch/ia64/ia32/Makefile @@ -4,7 +4,6 @@ obj-y := ia32_entry.o sys_ia32.o ia32_signal.o \ ia32_support.o ia32_traps.o binfmt_elf32.o ia32_ldt.o -obj-$(CONFIG_AUDIT) += audit.o # Don't let GCC uses f16-f31 so that save_ia32_fpstate_live() and # restore_ia32_fpstate_live() can be sure the live register contain user-level state. diff --git a/trunk/arch/ia64/ia32/audit.c b/trunk/arch/ia64/ia32/audit.c deleted file mode 100644 index ab94f2e58cdd..000000000000 --- a/trunk/arch/ia64/ia32/audit.c +++ /dev/null @@ -1,11 +0,0 @@ -#include - -unsigned ia32_dir_class[] = { -#include -~0U -}; - -unsigned ia32_chattr_class[] = { -#include -~0U -}; diff --git a/trunk/arch/ia64/ia32/binfmt_elf32.c b/trunk/arch/ia64/ia32/binfmt_elf32.c index daa6b91bc921..da03c06744f1 100644 --- a/trunk/arch/ia64/ia32/binfmt_elf32.c +++ b/trunk/arch/ia64/ia32/binfmt_elf32.c @@ -9,6 +9,7 @@ * 04/13/01 D. Mosberger dropped saving tssd in ar.k1---it's not needed * 09/14/01 D. Mosberger fixed memory management for gdt/tss page */ +#include #include #include diff --git a/trunk/arch/ia64/ia32/ia32priv.h b/trunk/arch/ia64/ia32/ia32priv.h index 703a67c934f8..ccb98ed48e58 100644 --- a/trunk/arch/ia64/ia32/ia32priv.h +++ b/trunk/arch/ia64/ia32/ia32priv.h @@ -1,6 +1,7 @@ #ifndef _ASM_IA64_IA32_PRIV_H #define _ASM_IA64_IA32_PRIV_H +#include #include diff --git a/trunk/arch/ia64/ia32/sys_ia32.c b/trunk/arch/ia64/ia32/sys_ia32.c index 6aa3c51619ca..5366b3b23d09 100644 --- a/trunk/arch/ia64/ia32/sys_ia32.c +++ b/trunk/arch/ia64/ia32/sys_ia32.c @@ -14,6 +14,7 @@ * environment. */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/Makefile b/trunk/arch/ia64/kernel/Makefile index 0e4553f320bf..09a0dbc17fb6 100644 --- a/trunk/arch/ia64/kernel/Makefile +++ b/trunk/arch/ia64/kernel/Makefile @@ -29,7 +29,6 @@ obj-$(CONFIG_CPU_FREQ) += cpufreq/ obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o -obj-$(CONFIG_AUDIT) += audit.o mca_recovery-y += mca_drv.o mca_drv_asm.o # The gate DSO image is built using a special linker script. diff --git a/trunk/arch/ia64/kernel/acpi-ext.c b/trunk/arch/ia64/kernel/acpi-ext.c index b7515bc808a8..fff82929d225 100644 --- a/trunk/arch/ia64/kernel/acpi-ext.c +++ b/trunk/arch/ia64/kernel/acpi-ext.c @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -50,7 +51,7 @@ static acpi_status hp_ccsr_locate(acpi_handle obj, u64 *base, u64 *length) memcpy(length, vendor->byte_data + 8, sizeof(*length)); exit: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); return status; } diff --git a/trunk/arch/ia64/kernel/acpi.c b/trunk/arch/ia64/kernel/acpi.c index 99761b81db44..ca16d9556bde 100644 --- a/trunk/arch/ia64/kernel/acpi.c +++ b/trunk/arch/ia64/kernel/acpi.c @@ -32,6 +32,7 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include #include #include #include @@ -856,7 +857,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) obj = buffer.pointer; if (obj->type != ACPI_TYPE_BUFFER || obj->buffer.length < sizeof(*lsapic)) { - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); return -EINVAL; } @@ -864,13 +865,13 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) if ((lsapic->header.type != ACPI_MADT_LSAPIC) || (!lsapic->flags.enabled)) { - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); return -EINVAL; } physid = ((lsapic->id << 8) | (lsapic->eid)); - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); buffer.length = ACPI_ALLOCATE_BUFFER; buffer.pointer = NULL; @@ -934,20 +935,20 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret) obj = buffer.pointer; if (obj->type != ACPI_TYPE_BUFFER || obj->buffer.length < sizeof(*iosapic)) { - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); return AE_OK; } iosapic = (struct acpi_table_iosapic *)obj->buffer.pointer; if (iosapic->header.type != ACPI_MADT_IOSAPIC) { - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); return AE_OK; } gsi_base = iosapic->global_irq_base; - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); /* * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell diff --git a/trunk/arch/ia64/kernel/asm-offsets.c b/trunk/arch/ia64/kernel/asm-offsets.c index 75a2a2c12258..16e7b6600ae6 100644 --- a/trunk/arch/ia64/kernel/asm-offsets.c +++ b/trunk/arch/ia64/kernel/asm-offsets.c @@ -5,6 +5,7 @@ */ #define ASM_OFFSETS_C 1 +#include #include diff --git a/trunk/arch/ia64/kernel/audit.c b/trunk/arch/ia64/kernel/audit.c deleted file mode 100644 index f2512931ccaf..000000000000 --- a/trunk/arch/ia64/kernel/audit.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include -#include - -static unsigned dir_class[] = { -#include -~0U -}; - -static unsigned chattr_class[] = { -#include -~0U -}; - -static int __init audit_classes_init(void) -{ -#ifdef CONFIG_IA32_SUPPORT - extern __u32 ia32_dir_class[]; - extern __u32 ia32_chattr_class[]; - audit_register_class(AUDIT_CLASS_DIR_WRITE_32, ia32_dir_class); - audit_register_class(AUDIT_CLASS_CHATTR_32, ia32_chattr_class); -#endif - audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class); - audit_register_class(AUDIT_CLASS_CHATTR, chattr_class); - return 0; -} - -__initcall(audit_classes_init); diff --git a/trunk/arch/ia64/kernel/cpufreq/acpi-cpufreq.c b/trunk/arch/ia64/kernel/cpufreq/acpi-cpufreq.c index 86faf221a070..5a1bf815282d 100644 --- a/trunk/arch/ia64/kernel/cpufreq/acpi-cpufreq.c +++ b/trunk/arch/ia64/kernel/cpufreq/acpi-cpufreq.c @@ -9,6 +9,7 @@ * Venkatesh Pallipadi */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/efi.c b/trunk/arch/ia64/kernel/efi.c index b13c0555c3ba..c33d0ba7e300 100644 --- a/trunk/arch/ia64/kernel/efi.c +++ b/trunk/arch/ia64/kernel/efi.c @@ -20,6 +20,7 @@ * Goutham Rao: * Skip non-WB memory and ignore empty memory ranges. */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/entry.S b/trunk/arch/ia64/kernel/entry.S index 12701cf32d99..32c999f58d12 100644 --- a/trunk/arch/ia64/kernel/entry.S +++ b/trunk/arch/ia64/kernel/entry.S @@ -31,6 +31,7 @@ * pNonSys: !pSys */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/entry.h b/trunk/arch/ia64/kernel/entry.h index b83edac02965..ebc3dfb88826 100644 --- a/trunk/arch/ia64/kernel/entry.h +++ b/trunk/arch/ia64/kernel/entry.h @@ -1,3 +1,4 @@ +#include /* * Preserved registers that are shared between code in ivt.S and diff --git a/trunk/arch/ia64/kernel/gate.S b/trunk/arch/ia64/kernel/gate.S index 3274850cf272..86064ca98952 100644 --- a/trunk/arch/ia64/kernel/gate.S +++ b/trunk/arch/ia64/kernel/gate.S @@ -6,6 +6,7 @@ * David Mosberger-Tang */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/gate.lds.S b/trunk/arch/ia64/kernel/gate.lds.S index cc35cddfd4cf..7c99e6ec3daf 100644 --- a/trunk/arch/ia64/kernel/gate.lds.S +++ b/trunk/arch/ia64/kernel/gate.lds.S @@ -4,6 +4,7 @@ * in one page). This script controls its layout. */ +#include #include diff --git a/trunk/arch/ia64/kernel/head.S b/trunk/arch/ia64/kernel/head.S index 561b8f1d3bc7..f1778a84ea61 100644 --- a/trunk/arch/ia64/kernel/head.S +++ b/trunk/arch/ia64/kernel/head.S @@ -19,6 +19,7 @@ * Support for CPU Hotplug */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/ia64_ksyms.c b/trunk/arch/ia64/kernel/ia64_ksyms.c index b7cf651ceb14..bbcfd08378a6 100644 --- a/trunk/arch/ia64/kernel/ia64_ksyms.c +++ b/trunk/arch/ia64/kernel/ia64_ksyms.c @@ -5,6 +5,7 @@ * All other exports should be put directly after the definition. */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/iosapic.c b/trunk/arch/ia64/kernel/iosapic.c index 9bf15fefa7e4..efc7df4b0fd2 100644 --- a/trunk/arch/ia64/kernel/iosapic.c +++ b/trunk/arch/ia64/kernel/iosapic.c @@ -79,6 +79,7 @@ * describeinterrupts. Now we use "IRQ" only for Linux IRQ's. ISA IRQ * (isa_irq) is the only exception in this source code. */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/irq_ia64.c b/trunk/arch/ia64/kernel/irq_ia64.c index a041367f043b..f5035304594e 100644 --- a/trunk/arch/ia64/kernel/irq_ia64.c +++ b/trunk/arch/ia64/kernel/irq_ia64.c @@ -14,6 +14,7 @@ * Added CPU Hotplug handling for IPF. */ +#include #include #include @@ -235,7 +236,7 @@ extern irqreturn_t handle_IPI (int irq, void *dev_id, struct pt_regs *regs); static struct irqaction ipi_irqaction = { .handler = handle_IPI, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "IPI" }; #endif diff --git a/trunk/arch/ia64/kernel/ivt.S b/trunk/arch/ia64/kernel/ivt.S index 6b7fcbd3f6f1..829a43cab797 100644 --- a/trunk/arch/ia64/kernel/ivt.S +++ b/trunk/arch/ia64/kernel/ivt.S @@ -38,6 +38,7 @@ * Table is based upon EAS2.6 (Oct 1999) */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/kprobes.c b/trunk/arch/ia64/kernel/kprobes.c index 00d9c83b8020..f9039f88d01d 100644 --- a/trunk/arch/ia64/kernel/kprobes.c +++ b/trunk/arch/ia64/kernel/kprobes.c @@ -23,6 +23,7 @@ * adapted from i386 */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/machvec.c b/trunk/arch/ia64/kernel/machvec.c index d4a546aa5048..4b0b71d5aef4 100644 --- a/trunk/arch/ia64/kernel/machvec.c +++ b/trunk/arch/ia64/kernel/machvec.c @@ -1,3 +1,4 @@ +#include #include #include diff --git a/trunk/arch/ia64/kernel/mca.c b/trunk/arch/ia64/kernel/mca.c index 2fbe4536fe18..d7dc5e63de63 100644 --- a/trunk/arch/ia64/kernel/mca.c +++ b/trunk/arch/ia64/kernel/mca.c @@ -55,6 +55,7 @@ * 2005-10-07 Keith Owens * Add notify_die() hooks. */ +#include #include #include #include @@ -678,7 +679,7 @@ copy_reg(const u64 *fr, u64 fnat, u64 *tr, u64 *tnat) */ static void -ia64_mca_modify_comm(const struct task_struct *previous_current) +ia64_mca_modify_comm(const task_t *previous_current) { char *p, comm[sizeof(current->comm)]; if (previous_current->pid) @@ -709,7 +710,7 @@ ia64_mca_modify_comm(const struct task_struct *previous_current) * that we can do backtrace on the MCA/INIT handler code itself. */ -static struct task_struct * +static task_t * ia64_mca_modify_original_stack(struct pt_regs *regs, const struct switch_stack *sw, struct ia64_sal_os_state *sos, @@ -719,7 +720,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs, ia64_va va; extern char ia64_leave_kernel[]; /* Need asm address, not function descriptor */ const pal_min_state_area_t *ms = sos->pal_min_state; - struct task_struct *previous_current; + task_t *previous_current; struct pt_regs *old_regs; struct switch_stack *old_sw; unsigned size = sizeof(struct pt_regs) + @@ -1023,7 +1024,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, pal_processor_state_info_t *psp = (pal_processor_state_info_t *) &sos->proc_state_param; int recover, cpu = smp_processor_id(); - struct task_struct *previous_current; + task_t *previous_current; struct ia64_mca_notify_die nd = { .sos = sos, .monarch_cpu = &monarch_cpu }; @@ -1352,7 +1353,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, { static atomic_t slaves; static atomic_t monarchs; - struct task_struct *previous_current; + task_t *previous_current; int cpu = smp_processor_id(); struct ia64_mca_notify_die nd = { .sos = sos, .monarch_cpu = &monarch_cpu }; @@ -1457,38 +1458,38 @@ __setup("disable_cpe_poll", ia64_mca_disable_cpe_polling); static struct irqaction cmci_irqaction = { .handler = ia64_mca_cmc_int_handler, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "cmc_hndlr" }; static struct irqaction cmcp_irqaction = { .handler = ia64_mca_cmc_int_caller, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "cmc_poll" }; static struct irqaction mca_rdzv_irqaction = { .handler = ia64_mca_rendez_int_handler, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "mca_rdzv" }; static struct irqaction mca_wkup_irqaction = { .handler = ia64_mca_wakeup_int_handler, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "mca_wkup" }; #ifdef CONFIG_ACPI static struct irqaction mca_cpe_irqaction = { .handler = ia64_mca_cpe_int_handler, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "cpe_hndlr" }; static struct irqaction mca_cpep_irqaction = { .handler = ia64_mca_cpe_int_caller, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "cpe_poll" }; #endif /* CONFIG_ACPI */ diff --git a/trunk/arch/ia64/kernel/mca_asm.S b/trunk/arch/ia64/kernel/mca_asm.S index 96047491d1b9..c1bd1feffab0 100644 --- a/trunk/arch/ia64/kernel/mca_asm.S +++ b/trunk/arch/ia64/kernel/mca_asm.S @@ -19,6 +19,7 @@ // 12/08/05 Keith Owens // Use per cpu MCA/INIT stacks for all data. // +#include #include #include diff --git a/trunk/arch/ia64/kernel/mca_drv.c b/trunk/arch/ia64/kernel/mca_drv.c index 8db6e0cedadc..ca6666b51ccb 100644 --- a/trunk/arch/ia64/kernel/mca_drv.c +++ b/trunk/arch/ia64/kernel/mca_drv.c @@ -8,6 +8,7 @@ * Copyright (C) 2005 Keith Owens * Copyright (C) 2006 Russ Anderson */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/mca_drv_asm.S b/trunk/arch/ia64/kernel/mca_drv_asm.S index f2d4900751ba..e6a580d354b9 100644 --- a/trunk/arch/ia64/kernel/mca_drv_asm.S +++ b/trunk/arch/ia64/kernel/mca_drv_asm.S @@ -5,6 +5,7 @@ * Copyright (C) 2004 FUJITSU LIMITED * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/minstate.h b/trunk/arch/ia64/kernel/minstate.h index c9ac8bada786..85ed54179afa 100644 --- a/trunk/arch/ia64/kernel/minstate.h +++ b/trunk/arch/ia64/kernel/minstate.h @@ -1,3 +1,4 @@ +#include #include diff --git a/trunk/arch/ia64/kernel/module.c b/trunk/arch/ia64/kernel/module.c index 158e3c51bb77..3a30cfc9574f 100644 --- a/trunk/arch/ia64/kernel/module.c +++ b/trunk/arch/ia64/kernel/module.c @@ -25,6 +25,7 @@ SEGREL64LSB */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/numa.c b/trunk/arch/ia64/kernel/numa.c index 1cc360c83e7a..0766493d4d00 100644 --- a/trunk/arch/ia64/kernel/numa.c +++ b/trunk/arch/ia64/kernel/numa.c @@ -19,6 +19,7 @@ * Copyright (C) 2004 Silicon Graphics, Inc. * Jesse Barnes */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/palinfo.c b/trunk/arch/ia64/kernel/palinfo.c index 3f5bac59209a..8a1208419138 100644 --- a/trunk/arch/ia64/kernel/palinfo.c +++ b/trunk/arch/ia64/kernel/palinfo.c @@ -17,6 +17,7 @@ * 10/23/2001 S.Eranian updated pal_perf_mon_info bug fixes * 03/24/2004 Ashok Raj updated to work with CPU Hotplug */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/perfmon.c b/trunk/arch/ia64/kernel/perfmon.c index c7ccd6ee1ddf..a0055d3d695c 100644 --- a/trunk/arch/ia64/kernel/perfmon.c +++ b/trunk/arch/ia64/kernel/perfmon.c @@ -19,6 +19,7 @@ * http://www.hpl.hp.com/research/linux/perfmon */ +#include #include #include #include @@ -6439,7 +6440,7 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx) static struct irqaction perfmon_irqaction = { .handler = pfm_interrupt_handler, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "perfmon" }; diff --git a/trunk/arch/ia64/kernel/perfmon_default_smpl.c b/trunk/arch/ia64/kernel/perfmon_default_smpl.c index ff80eab83b38..344941db0a9e 100644 --- a/trunk/arch/ia64/kernel/perfmon_default_smpl.c +++ b/trunk/arch/ia64/kernel/perfmon_default_smpl.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/process.c b/trunk/arch/ia64/kernel/process.c index ea914cc6812a..b045c279136c 100644 --- a/trunk/arch/ia64/kernel/process.c +++ b/trunk/arch/ia64/kernel/process.c @@ -9,6 +9,7 @@ * Add notify_die() hooks. */ #define __KERNEL_SYSCALLS__ /* see */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/ptrace.c b/trunk/arch/ia64/kernel/ptrace.c index aa705e46b974..e61e15e28d8b 100644 --- a/trunk/arch/ia64/kernel/ptrace.c +++ b/trunk/arch/ia64/kernel/ptrace.c @@ -6,6 +6,7 @@ * * Derived from the x86 and Alpha versions. */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/sal.c b/trunk/arch/ia64/kernel/sal.c index 642fdc7b969d..77fa65903d94 100644 --- a/trunk/arch/ia64/kernel/sal.c +++ b/trunk/arch/ia64/kernel/sal.c @@ -6,6 +6,7 @@ * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/setup.c b/trunk/arch/ia64/kernel/setup.c index 6a33f414de58..6dba2d63f24d 100644 --- a/trunk/arch/ia64/kernel/setup.c +++ b/trunk/arch/ia64/kernel/setup.c @@ -22,6 +22,7 @@ * 06/24/99 W.Drummond added boot_cpu_data. * 05/28/05 Z. Menyhart Dynamic stride size for "flush_icache_range()" */ +#include #include #include diff --git a/trunk/arch/ia64/kernel/signal.c b/trunk/arch/ia64/kernel/signal.c index 77f8b49c7882..1d7903ee2126 100644 --- a/trunk/arch/ia64/kernel/signal.c +++ b/trunk/arch/ia64/kernel/signal.c @@ -7,6 +7,7 @@ * Derived from i386 and Alpha versions. */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/smpboot.c b/trunk/arch/ia64/kernel/smpboot.c index 6203ed4ec8cf..5203df78f150 100644 --- a/trunk/arch/ia64/kernel/smpboot.c +++ b/trunk/arch/ia64/kernel/smpboot.c @@ -21,6 +21,7 @@ * 05/01/30 Suresh Siddha * Setup cpu_sibling_map and cpu_core_map */ +#include #include #include @@ -124,7 +125,7 @@ extern void __devinit calibrate_delay (void); extern void start_ap (void); extern unsigned long ia64_iobase; -struct task_struct *task_for_booting_cpu; +task_t *task_for_booting_cpu; /* * State for each CPU diff --git a/trunk/arch/ia64/kernel/sys_ia64.c b/trunk/arch/ia64/kernel/sys_ia64.c index 40722d88607a..c7b943f10199 100644 --- a/trunk/arch/ia64/kernel/sys_ia64.c +++ b/trunk/arch/ia64/kernel/sys_ia64.c @@ -5,6 +5,7 @@ * Copyright (C) 1999-2000, 2002-2003, 2005 Hewlett-Packard Co * David Mosberger-Tang */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/time.c b/trunk/arch/ia64/kernel/time.c index 6928ef0d64d8..49958904045b 100644 --- a/trunk/arch/ia64/kernel/time.c +++ b/trunk/arch/ia64/kernel/time.c @@ -8,6 +8,7 @@ * Copyright (C) 1999-2000 VA Linux Systems * Copyright (C) 1999-2000 Walt Drummond */ +#include #include #include @@ -231,7 +232,7 @@ ia64_init_itm (void) static struct irqaction timer_irqaction = { .handler = timer_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "timer" }; diff --git a/trunk/arch/ia64/kernel/topology.c b/trunk/arch/ia64/kernel/topology.c index b146f1cfad31..5511d9c6c701 100644 --- a/trunk/arch/ia64/kernel/topology.c +++ b/trunk/arch/ia64/kernel/topology.c @@ -13,6 +13,7 @@ * Populate cpu cache entries in sysfs for cpu cache info */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/traps.c b/trunk/arch/ia64/kernel/traps.c index e7bbb0f40aa2..7c1ddc8ac443 100644 --- a/trunk/arch/ia64/kernel/traps.c +++ b/trunk/arch/ia64/kernel/traps.c @@ -7,6 +7,7 @@ * 05/12/00 grao : added isr in siginfo for SIGFPE */ +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/vmlinux.lds.S b/trunk/arch/ia64/kernel/vmlinux.lds.S index 5b0d5f64a9b1..783600fe52b2 100644 --- a/trunk/arch/ia64/kernel/vmlinux.lds.S +++ b/trunk/arch/ia64/kernel/vmlinux.lds.S @@ -1,3 +1,4 @@ +#include #include #include diff --git a/trunk/arch/ia64/lib/clear_page.S b/trunk/arch/ia64/lib/clear_page.S index 2d814e7ed191..d4987061dda7 100644 --- a/trunk/arch/ia64/lib/clear_page.S +++ b/trunk/arch/ia64/lib/clear_page.S @@ -8,6 +8,7 @@ * 2/12/02 kchen Tuned for both Itanium and McKinley * 3/08/02 davidm Some more tweaking */ +#include #include #include diff --git a/trunk/arch/ia64/lib/io.c b/trunk/arch/ia64/lib/io.c index bcd16f8ad9d9..8949e44091ac 100644 --- a/trunk/arch/ia64/lib/io.c +++ b/trunk/arch/ia64/lib/io.c @@ -1,3 +1,4 @@ +#include #include #include diff --git a/trunk/arch/ia64/lib/memcpy_mck.S b/trunk/arch/ia64/lib/memcpy_mck.S index ab0f87639729..9e534d52b1d5 100644 --- a/trunk/arch/ia64/lib/memcpy_mck.S +++ b/trunk/arch/ia64/lib/memcpy_mck.S @@ -13,6 +13,7 @@ * Copyright (C) 2002 Intel Corp. * Copyright (C) 2002 Ken Chen */ +#include #include #include diff --git a/trunk/arch/ia64/mm/contig.c b/trunk/arch/ia64/mm/contig.c index 2a88cdd6d924..84fd1c14c8a9 100644 --- a/trunk/arch/ia64/mm/contig.c +++ b/trunk/arch/ia64/mm/contig.c @@ -14,6 +14,7 @@ * Routines used by ia64 machines with contiguous (or virtually contiguous) * memory. */ +#include #include #include #include diff --git a/trunk/arch/ia64/mm/discontig.c b/trunk/arch/ia64/mm/discontig.c index 99bd9e30db96..525b082eb661 100644 --- a/trunk/arch/ia64/mm/discontig.c +++ b/trunk/arch/ia64/mm/discontig.c @@ -313,19 +313,9 @@ static void __meminit scatter_node_data(void) pg_data_t **dst; int node; - /* - * for_each_online_node() can't be used at here. - * node_online_map is not set for hot-added nodes at this time, - * because we are halfway through initialization of the new node's - * structures. If for_each_online_node() is used, a new node's - * pg_data_ptrs will be not initialized. Insted of using it, - * pgdat_list[] is checked. - */ - for_each_node(node) { - if (pgdat_list[node]) { - dst = LOCAL_DATA_ADDR(pgdat_list[node])->pg_data_ptrs; - memcpy(dst, pgdat_list, sizeof(pgdat_list)); - } + for_each_online_node(node) { + dst = LOCAL_DATA_ADDR(pgdat_list[node])->pg_data_ptrs; + memcpy(dst, pgdat_list, sizeof(pgdat_list)); } } diff --git a/trunk/arch/ia64/mm/extable.c b/trunk/arch/ia64/mm/extable.c index 71c50dd8f870..6d259e34f359 100644 --- a/trunk/arch/ia64/mm/extable.c +++ b/trunk/arch/ia64/mm/extable.c @@ -5,6 +5,7 @@ * David Mosberger-Tang */ +#include #include #include diff --git a/trunk/arch/ia64/mm/hugetlbpage.c b/trunk/arch/ia64/mm/hugetlbpage.c index eee5c1cfbe32..8d506710fdbd 100644 --- a/trunk/arch/ia64/mm/hugetlbpage.c +++ b/trunk/arch/ia64/mm/hugetlbpage.c @@ -8,6 +8,7 @@ * Feb, 2004: dynamic hugetlb page size via boot parameter */ +#include #include #include #include diff --git a/trunk/arch/ia64/mm/init.c b/trunk/arch/ia64/mm/init.c index 2f50c064513c..38306e98f04b 100644 --- a/trunk/arch/ia64/mm/init.c +++ b/trunk/arch/ia64/mm/init.c @@ -4,6 +4,7 @@ * Copyright (C) 1998-2003 Hewlett-Packard Co * David Mosberger-Tang */ +#include #include #include diff --git a/trunk/arch/ia64/mm/numa.c b/trunk/arch/ia64/mm/numa.c index 64e4c21f311c..4e5c8b36ad93 100644 --- a/trunk/arch/ia64/mm/numa.c +++ b/trunk/arch/ia64/mm/numa.c @@ -10,6 +10,7 @@ * 2002/08/07 Erich Focht */ +#include #include #include #include diff --git a/trunk/arch/ia64/mm/tlb.c b/trunk/arch/ia64/mm/tlb.c index ffad7624436c..4dbbca0b5e9c 100644 --- a/trunk/arch/ia64/mm/tlb.c +++ b/trunk/arch/ia64/mm/tlb.c @@ -11,6 +11,7 @@ * Rohit Seth * Ken Chen */ +#include #include #include #include diff --git a/trunk/arch/ia64/oprofile/perfmon.c b/trunk/arch/ia64/oprofile/perfmon.c index bc41dd32fec6..b7975a469fb8 100644 --- a/trunk/arch/ia64/oprofile/perfmon.c +++ b/trunk/arch/ia64/oprofile/perfmon.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/ia64/pci/pci.c b/trunk/arch/ia64/pci/pci.c index 276512fd8922..5bef0e3603f2 100644 --- a/trunk/arch/ia64/pci/pci.c +++ b/trunk/arch/ia64/pci/pci.c @@ -10,6 +10,7 @@ * * Note: Above list of copyright holders is incomplete... */ +#include #include #include diff --git a/trunk/arch/ia64/sn/kernel/bte.c b/trunk/arch/ia64/sn/kernel/bte.c index 27dee4584061..e952ef4f6d91 100644 --- a/trunk/arch/ia64/sn/kernel/bte.c +++ b/trunk/arch/ia64/sn/kernel/bte.c @@ -6,6 +6,7 @@ * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. */ +#include #include #include #include diff --git a/trunk/arch/ia64/sn/kernel/huberror.c b/trunk/arch/ia64/sn/kernel/huberror.c index 96fb81e6321f..56ab6bae00ee 100644 --- a/trunk/arch/ia64/sn/kernel/huberror.c +++ b/trunk/arch/ia64/sn/kernel/huberror.c @@ -178,7 +178,7 @@ void hubiio_crb_error_handler(struct hubdev_info *hubdev_info) */ void hub_error_init(struct hubdev_info *hubdev_info) { - if (request_irq(SGI_II_ERROR, (void *)hub_eint_handler, IRQF_SHARED, + if (request_irq(SGI_II_ERROR, (void *)hub_eint_handler, SA_SHIRQ, "SN_hub_error", (void *)hubdev_info)) printk("hub_error_init: Failed to request_irq for 0x%p\n", hubdev_info); @@ -196,7 +196,7 @@ void hub_error_init(struct hubdev_info *hubdev_info) void ice_error_init(struct hubdev_info *hubdev_info) { if (request_irq - (SGI_TIO_ERROR, (void *)hub_eint_handler, IRQF_SHARED, "SN_TIO_error", + (SGI_TIO_ERROR, (void *)hub_eint_handler, SA_SHIRQ, "SN_TIO_error", (void *)hubdev_info)) printk("ice_error_init: request_irq() error hubdev_info 0x%p\n", hubdev_info); diff --git a/trunk/arch/ia64/sn/kernel/setup.c b/trunk/arch/ia64/sn/kernel/setup.c index dd6bcf4d58bf..3bfccf354343 100644 --- a/trunk/arch/ia64/sn/kernel/setup.c +++ b/trunk/arch/ia64/sn/kernel/setup.c @@ -6,6 +6,7 @@ * Copyright (C) 1999,2001-2006 Silicon Graphics, Inc. All rights reserved. */ +#include #include #include #include diff --git a/trunk/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/trunk/arch/ia64/sn/kernel/sn2/prominfo_proc.c index 4dcce3d0e04c..6ae276d5d50c 100644 --- a/trunk/arch/ia64/sn/kernel/sn2/prominfo_proc.c +++ b/trunk/arch/ia64/sn/kernel/sn2/prominfo_proc.c @@ -8,6 +8,7 @@ * Module to export the system's Firmware Interface Tables, including * PROM revision numbers and banners, in /proc */ +#include #include #include #include diff --git a/trunk/arch/ia64/sn/kernel/sn2/sn_proc_fs.c b/trunk/arch/ia64/sn/kernel/sn2/sn_proc_fs.c index 43ddc2eccb96..5100261310f7 100644 --- a/trunk/arch/ia64/sn/kernel/sn2/sn_proc_fs.c +++ b/trunk/arch/ia64/sn/kernel/sn2/sn_proc_fs.c @@ -5,6 +5,7 @@ * * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved. */ +#include #ifdef CONFIG_PROC_FS #include diff --git a/trunk/arch/ia64/sn/kernel/xpc_channel.c b/trunk/arch/ia64/sn/kernel/xpc_channel.c index c2f69f7942af..8255a9be4632 100644 --- a/trunk/arch/ia64/sn/kernel/xpc_channel.c +++ b/trunk/arch/ia64/sn/kernel/xpc_channel.c @@ -202,7 +202,7 @@ xpc_setup_infrastructure(struct xpc_partition *part) init_waitqueue_head(&part->channel_mgr_wq); sprintf(part->IPI_owner, "xpc%02d", partid); - ret = request_irq(SGI_XPC_NOTIFY, xpc_notify_IRQ_handler, IRQF_SHARED, + ret = request_irq(SGI_XPC_NOTIFY, xpc_notify_IRQ_handler, SA_SHIRQ, part->IPI_owner, (void *) (u64) partid); if (ret != 0) { dev_err(xpc_chan, "can't register NOTIFY IRQ handler, " diff --git a/trunk/arch/ia64/sn/kernel/xpnet.c b/trunk/arch/ia64/sn/kernel/xpnet.c index 007703c494a4..e5c6d3c0a8e9 100644 --- a/trunk/arch/ia64/sn/kernel/xpnet.c +++ b/trunk/arch/ia64/sn/kernel/xpnet.c @@ -22,6 +22,7 @@ */ +#include #include #include #include diff --git a/trunk/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/trunk/arch/ia64/sn/pci/pcibr/pcibr_provider.c index 838c93c9a16a..ab1211ef0176 100644 --- a/trunk/arch/ia64/sn/pci/pcibr/pcibr_provider.c +++ b/trunk/arch/ia64/sn/pci/pcibr/pcibr_provider.c @@ -139,7 +139,7 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont * register the bridge's error interrupt handler */ if (request_irq(SGI_PCIASIC_ERROR, (void *)pcibr_error_intr_handler, - IRQF_SHARED, "PCIBR error", (void *)(soft))) { + SA_SHIRQ, "PCIBR error", (void *)(soft))) { printk(KERN_WARNING "pcibr cannot allocate interrupt for error handler\n"); } diff --git a/trunk/arch/ia64/sn/pci/tioca_provider.c b/trunk/arch/ia64/sn/pci/tioca_provider.c index c36b0f5affb3..e4aa839d0189 100644 --- a/trunk/arch/ia64/sn/pci/tioca_provider.c +++ b/trunk/arch/ia64/sn/pci/tioca_provider.c @@ -646,7 +646,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont if (request_irq(SGI_TIOCA_ERROR, tioca_error_intr_handler, - IRQF_SHARED, "TIOCA error", (void *)tioca_common)) + SA_SHIRQ, "TIOCA error", (void *)tioca_common)) printk(KERN_WARNING "%s: Unable to get irq %d. " "Error interrupts won't be routed for TIOCA bus %d\n", diff --git a/trunk/arch/ia64/sn/pci/tioce_provider.c b/trunk/arch/ia64/sn/pci/tioce_provider.c index 17cd34284886..2d7948567ebc 100644 --- a/trunk/arch/ia64/sn/pci/tioce_provider.c +++ b/trunk/arch/ia64/sn/pci/tioce_provider.c @@ -1027,7 +1027,7 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont if (request_irq(SGI_PCIASIC_ERROR, tioce_error_intr_handler, - IRQF_SHARED, "TIOCE error", (void *)tioce_common)) + SA_SHIRQ, "TIOCE error", (void *)tioce_common)) printk(KERN_WARNING "%s: Unable to get irq %d. " "Error interrupts won't be routed for " diff --git a/trunk/arch/m32r/boot/compressed/head.S b/trunk/arch/m32r/boot/compressed/head.S index 95a0563ff076..234d8b1e0ac1 100644 --- a/trunk/arch/m32r/boot/compressed/head.S +++ b/trunk/arch/m32r/boot/compressed/head.S @@ -7,6 +7,7 @@ */ .text +#include #include #include #include diff --git a/trunk/arch/m32r/boot/compressed/m32r_sio.c b/trunk/arch/m32r/boot/compressed/m32r_sio.c index bce8af5e3bb2..8f9a57271f83 100644 --- a/trunk/arch/m32r/boot/compressed/m32r_sio.c +++ b/trunk/arch/m32r/boot/compressed/m32r_sio.c @@ -5,6 +5,7 @@ * */ +#include #include static void putc(char c); diff --git a/trunk/arch/m32r/boot/compressed/misc.c b/trunk/arch/m32r/boot/compressed/misc.c index 600d40e33495..70fa799005c3 100644 --- a/trunk/arch/m32r/boot/compressed/misc.c +++ b/trunk/arch/m32r/boot/compressed/misc.c @@ -12,6 +12,7 @@ * This is based on arch/sh/boot/compressed/misc.c. */ +#include #include /* diff --git a/trunk/arch/m32r/boot/compressed/vmlinux.lds.S b/trunk/arch/m32r/boot/compressed/vmlinux.lds.S index dd11963f6939..a18431759633 100644 --- a/trunk/arch/m32r/boot/compressed/vmlinux.lds.S +++ b/trunk/arch/m32r/boot/compressed/vmlinux.lds.S @@ -1,3 +1,4 @@ +#include OUTPUT_ARCH(m32r) ENTRY(startup) diff --git a/trunk/arch/m32r/boot/setup.S b/trunk/arch/m32r/boot/setup.S index ef843d63083d..398542507d84 100644 --- a/trunk/arch/m32r/boot/setup.S +++ b/trunk/arch/m32r/boot/setup.S @@ -11,6 +11,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/align.c b/trunk/arch/m32r/kernel/align.c index ab871ccd33f8..48ec29714238 100644 --- a/trunk/arch/m32r/kernel/align.c +++ b/trunk/arch/m32r/kernel/align.c @@ -4,6 +4,7 @@ * Copyright (c) 2003 Hitoshi Yamamoto */ +#include #include #include diff --git a/trunk/arch/m32r/kernel/entry.S b/trunk/arch/m32r/kernel/entry.S index ac6d840b382b..920bb742b7a2 100644 --- a/trunk/arch/m32r/kernel/entry.S +++ b/trunk/arch/m32r/kernel/entry.S @@ -54,6 +54,7 @@ * @(0x6c,sp) - orig_r0 ditto */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/head.S b/trunk/arch/m32r/kernel/head.S index 0d3c8ee0e03d..3e83173995cd 100644 --- a/trunk/arch/m32r/kernel/head.S +++ b/trunk/arch/m32r/kernel/head.S @@ -14,6 +14,7 @@ __INIT __INITDATA .text +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/io_m32104ut.c b/trunk/arch/m32r/kernel/io_m32104ut.c index 2189eca30b56..d26adab9586c 100644 --- a/trunk/arch/m32r/kernel/io_m32104ut.c +++ b/trunk/arch/m32r/kernel/io_m32104ut.c @@ -8,6 +8,7 @@ * Naoto Sugai, Hayato Fujiwara */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/io_m32700ut.c b/trunk/arch/m32r/kernel/io_m32700ut.c index 5898f4031a0c..939932d6cc00 100644 --- a/trunk/arch/m32r/kernel/io_m32700ut.c +++ b/trunk/arch/m32r/kernel/io_m32700ut.c @@ -11,6 +11,7 @@ * archive for more details. */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/io_mappi.c b/trunk/arch/m32r/kernel/io_mappi.c index 31396789ab1b..a662b537c5ba 100644 --- a/trunk/arch/m32r/kernel/io_mappi.c +++ b/trunk/arch/m32r/kernel/io_mappi.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/io_mappi2.c b/trunk/arch/m32r/kernel/io_mappi2.c index ecc6aa88f9ac..e72d725606af 100644 --- a/trunk/arch/m32r/kernel/io_mappi2.c +++ b/trunk/arch/m32r/kernel/io_mappi2.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto, Mamoru Sakugawa */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/io_mappi3.c b/trunk/arch/m32r/kernel/io_mappi3.c index a13b5f6b07e9..ed6da930bc64 100644 --- a/trunk/arch/m32r/kernel/io_mappi3.c +++ b/trunk/arch/m32r/kernel/io_mappi3.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto, Mamoru Sakugawa */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/io_oaks32r.c b/trunk/arch/m32r/kernel/io_oaks32r.c index 068bf47060f8..910dd131c227 100644 --- a/trunk/arch/m32r/kernel/io_oaks32r.c +++ b/trunk/arch/m32r/kernel/io_oaks32r.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto, Mamoru Sakugawa */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/io_opsput.c b/trunk/arch/m32r/kernel/io_opsput.c index da6c5f5c1f82..bec69297db3c 100644 --- a/trunk/arch/m32r/kernel/io_opsput.c +++ b/trunk/arch/m32r/kernel/io_opsput.c @@ -11,6 +11,7 @@ * archive for more details. */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/io_usrv.c b/trunk/arch/m32r/kernel/io_usrv.c index a8c0e2eceb4d..39a379af40bc 100644 --- a/trunk/arch/m32r/kernel/io_usrv.c +++ b/trunk/arch/m32r/kernel/io_usrv.c @@ -12,6 +12,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/m32r_ksyms.c b/trunk/arch/m32r/kernel/m32r_ksyms.c index 8cbbb0b11e0c..c50330fa83b9 100644 --- a/trunk/arch/m32r/kernel/m32r_ksyms.c +++ b/trunk/arch/m32r/kernel/m32r_ksyms.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/module.c b/trunk/arch/m32r/kernel/module.c index 8d4205794380..f6a79a016ce0 100644 --- a/trunk/arch/m32r/kernel/module.c +++ b/trunk/arch/m32r/kernel/module.c @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/process.c b/trunk/arch/m32r/kernel/process.c index 44cbe0ce0f8f..065f5e719058 100644 --- a/trunk/arch/m32r/kernel/process.c +++ b/trunk/arch/m32r/kernel/process.c @@ -21,6 +21,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/ptrace.c b/trunk/arch/m32r/kernel/ptrace.c index 5f02b3144875..340a3bf59b88 100644 --- a/trunk/arch/m32r/kernel/ptrace.c +++ b/trunk/arch/m32r/kernel/ptrace.c @@ -14,6 +14,7 @@ * Copyright (C) 2000 Russell King */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/semaphore.c b/trunk/arch/m32r/kernel/semaphore.c index 940c2d37cfd1..9a6e6d754ddc 100644 --- a/trunk/arch/m32r/kernel/semaphore.c +++ b/trunk/arch/m32r/kernel/semaphore.c @@ -21,6 +21,7 @@ * * rw semaphores implemented November 1999 by Benjamin LaHaise */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup.c b/trunk/arch/m32r/kernel/setup.c index 0a6c6e677afe..1ff483c8a4c9 100644 --- a/trunk/arch/m32r/kernel/setup.c +++ b/trunk/arch/m32r/kernel/setup.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup_m32104ut.c b/trunk/arch/m32r/kernel/setup_m32104ut.c index 1692b321f476..f9f56c270195 100644 --- a/trunk/arch/m32r/kernel/setup_m32104ut.c +++ b/trunk/arch/m32r/kernel/setup_m32104ut.c @@ -8,6 +8,7 @@ * Naoto Sugai, Hayato Fujiwara */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup_m32700ut.c b/trunk/arch/m32r/kernel/setup_m32700ut.c index 7efc145c74c2..b6ab00eff580 100644 --- a/trunk/arch/m32r/kernel/setup_m32700ut.c +++ b/trunk/arch/m32r/kernel/setup_m32700ut.c @@ -11,6 +11,7 @@ * archive for more details. */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup_mappi.c b/trunk/arch/m32r/kernel/setup_mappi.c index 67dbbdc9d111..c268044185f5 100644 --- a/trunk/arch/m32r/kernel/setup_mappi.c +++ b/trunk/arch/m32r/kernel/setup_mappi.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup_mappi2.c b/trunk/arch/m32r/kernel/setup_mappi2.c index 55abb2102750..bd2327d5cca2 100644 --- a/trunk/arch/m32r/kernel/setup_mappi2.c +++ b/trunk/arch/m32r/kernel/setup_mappi2.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto, Mamoru Sakugawa */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup_mappi3.c b/trunk/arch/m32r/kernel/setup_mappi3.c index 93dc010c7fc3..014b51d17505 100644 --- a/trunk/arch/m32r/kernel/setup_mappi3.c +++ b/trunk/arch/m32r/kernel/setup_mappi3.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto, Mamoru Sakugawa */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup_oaks32r.c b/trunk/arch/m32r/kernel/setup_oaks32r.c index cd62598e3cea..ea64831aef7a 100644 --- a/trunk/arch/m32r/kernel/setup_oaks32r.c +++ b/trunk/arch/m32r/kernel/setup_oaks32r.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto, Mamoru Sakugawa */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup_opsput.c b/trunk/arch/m32r/kernel/setup_opsput.c index 61d3b01cbe07..55e8972d455a 100644 --- a/trunk/arch/m32r/kernel/setup_opsput.c +++ b/trunk/arch/m32r/kernel/setup_opsput.c @@ -12,6 +12,7 @@ * archive for more details. */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/setup_usrv.c b/trunk/arch/m32r/kernel/setup_usrv.c index f5b4b5ac31e7..7fa12d8f66b4 100644 --- a/trunk/arch/m32r/kernel/setup_usrv.c +++ b/trunk/arch/m32r/kernel/setup_usrv.c @@ -7,6 +7,7 @@ * Hitoshi Yamamoto */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/signal.c b/trunk/arch/m32r/kernel/signal.c index a9174efe80cb..6498ee70bb73 100644 --- a/trunk/arch/m32r/kernel/signal.c +++ b/trunk/arch/m32r/kernel/signal.c @@ -10,6 +10,7 @@ * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/smpboot.c b/trunk/arch/m32r/kernel/smpboot.c index fa7865609495..840b4348bf0c 100644 --- a/trunk/arch/m32r/kernel/smpboot.c +++ b/trunk/arch/m32r/kernel/smpboot.c @@ -40,6 +40,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/sys_m32r.c b/trunk/arch/m32r/kernel/sys_m32r.c index a9cea32eb824..670cb49210af 100644 --- a/trunk/arch/m32r/kernel/sys_m32r.c +++ b/trunk/arch/m32r/kernel/sys_m32r.c @@ -7,6 +7,7 @@ * Taken from i386 version. */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/time.c b/trunk/arch/m32r/kernel/time.c index ded0be07a476..b8e68b542302 100644 --- a/trunk/arch/m32r/kernel/time.c +++ b/trunk/arch/m32r/kernel/time.c @@ -17,6 +17,7 @@ #undef DEBUG_TIMER +#include #include #include #include @@ -237,7 +238,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -struct irqaction irq0 = { timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, +struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "MFT2", NULL, NULL }; void __init time_init(void) diff --git a/trunk/arch/m32r/kernel/traps.c b/trunk/arch/m32r/kernel/traps.c index c1daf2c40c7c..5fe8ed6d62dc 100644 --- a/trunk/arch/m32r/kernel/traps.c +++ b/trunk/arch/m32r/kernel/traps.c @@ -9,6 +9,7 @@ * 'traps.c' handles hardware traps and faults after we have saved some * state in 'entry.S'. */ +#include #include #include #include diff --git a/trunk/arch/m32r/kernel/vmlinux.lds.S b/trunk/arch/m32r/kernel/vmlinux.lds.S index 13c7bb698e37..729a2645a03f 100644 --- a/trunk/arch/m32r/kernel/vmlinux.lds.S +++ b/trunk/arch/m32r/kernel/vmlinux.lds.S @@ -1,6 +1,7 @@ /* ld script to make M32R Linux kernel */ +#include #include #include #include diff --git a/trunk/arch/m32r/lib/ashxdi3.S b/trunk/arch/m32r/lib/ashxdi3.S index 107594b65d58..78effca9d97a 100644 --- a/trunk/arch/m32r/lib/ashxdi3.S +++ b/trunk/arch/m32r/lib/ashxdi3.S @@ -6,6 +6,7 @@ */ /* $Id$ */ +#include ; ; input (r0,r1) src diff --git a/trunk/arch/m32r/lib/checksum.S b/trunk/arch/m32r/lib/checksum.S index cfbe00e5184a..f6fc1bdb87e4 100644 --- a/trunk/arch/m32r/lib/checksum.S +++ b/trunk/arch/m32r/lib/checksum.S @@ -28,6 +28,7 @@ /* $Id$ */ +#include #include #include #include diff --git a/trunk/arch/m32r/lib/delay.c b/trunk/arch/m32r/lib/delay.c index 06382a38c318..fb29632c7eaa 100644 --- a/trunk/arch/m32r/lib/delay.c +++ b/trunk/arch/m32r/lib/delay.c @@ -7,6 +7,7 @@ /* $Id$ */ +#include #include #ifdef CONFIG_SMP #include diff --git a/trunk/arch/m32r/lib/memcpy.S b/trunk/arch/m32r/lib/memcpy.S index 2089a215314e..800898a2d2e3 100644 --- a/trunk/arch/m32r/lib/memcpy.S +++ b/trunk/arch/m32r/lib/memcpy.S @@ -14,6 +14,7 @@ .text +#include #include #include diff --git a/trunk/arch/m32r/lib/memset.S b/trunk/arch/m32r/lib/memset.S index b47fa3537aa4..6e26df120acb 100644 --- a/trunk/arch/m32r/lib/memset.S +++ b/trunk/arch/m32r/lib/memset.S @@ -14,6 +14,7 @@ */ /* $Id$ */ +#include .text .global memset diff --git a/trunk/arch/m32r/lib/strlen.S b/trunk/arch/m32r/lib/strlen.S index 5f41aacd7b3e..8d23cfbd600c 100644 --- a/trunk/arch/m32r/lib/strlen.S +++ b/trunk/arch/m32r/lib/strlen.S @@ -9,6 +9,7 @@ /* $Id$ */ +#include #include #include diff --git a/trunk/arch/m32r/lib/usercopy.c b/trunk/arch/m32r/lib/usercopy.c index 896cef1aca5f..2d1dd2106c4d 100644 --- a/trunk/arch/m32r/lib/usercopy.c +++ b/trunk/arch/m32r/lib/usercopy.c @@ -6,6 +6,7 @@ * Copyright 1997 Linus Torvalds * Copyright 2001, 2002, 2004 Hirokazu Takata */ +#include #include #include #include diff --git a/trunk/arch/m32r/mm/cache.c b/trunk/arch/m32r/mm/cache.c index fac759584875..9f54dd937013 100644 --- a/trunk/arch/m32r/mm/cache.c +++ b/trunk/arch/m32r/mm/cache.c @@ -4,6 +4,7 @@ * Copyright (C) 2002-2005 Hirokazu Takata, Hayato Fujiwara */ +#include #include #undef MCCR diff --git a/trunk/arch/m32r/mm/discontig.c b/trunk/arch/m32r/mm/discontig.c index abb34ccd5986..cf610a7c5ff0 100644 --- a/trunk/arch/m32r/mm/discontig.c +++ b/trunk/arch/m32r/mm/discontig.c @@ -6,6 +6,7 @@ * Copyright (c) 2003 Hitoshi Yamamoto */ +#include #include #include #include diff --git a/trunk/arch/m32r/mm/fault-nommu.c b/trunk/arch/m32r/mm/fault-nommu.c index 03fc4c858e0e..d9d488d782e8 100644 --- a/trunk/arch/m32r/mm/fault-nommu.c +++ b/trunk/arch/m32r/mm/fault-nommu.c @@ -9,6 +9,7 @@ /* $Id: fault-nommu.c,v 1.1 2004/03/30 06:40:59 sakugawa Exp $ */ +#include #include #include #include diff --git a/trunk/arch/m32r/mm/fault.c b/trunk/arch/m32r/mm/fault.c index dc18a33eefef..bf7fb58ef02c 100644 --- a/trunk/arch/m32r/mm/fault.c +++ b/trunk/arch/m32r/mm/fault.c @@ -8,6 +8,7 @@ * Copyright (C) 1995 Linus Torvalds */ +#include #include #include #include @@ -147,7 +148,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, /* When running in the kernel we expect faults to occur only to * addresses in user space. All other faults represent errors in the * kernel and should generate an OOPS. Unfortunatly, in the case of an - * erroneous fault occurring in a code path which already holds mmap_sem + * erroneous fault occuring in a code path which already holds mmap_sem * we will deadlock attempting to validate the fault against the * address space. Luckily the kernel only validly references user * space from well defined areas of code, which are listed in the diff --git a/trunk/arch/m68k/amiga/amiga_ksyms.c b/trunk/arch/m68k/amiga/amiga_ksyms.c index 7fdcf6bf3ada..8f2e0587ae2f 100644 --- a/trunk/arch/m68k/amiga/amiga_ksyms.c +++ b/trunk/arch/m68k/amiga/amiga_ksyms.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/m68k/amiga/amiints.c b/trunk/arch/m68k/amiga/amiints.c index 96c79d840cff..f9403f4640a1 100644 --- a/trunk/arch/m68k/amiga/amiints.c +++ b/trunk/arch/m68k/amiga/amiints.c @@ -22,7 +22,7 @@ * * 07/08/99: rewamp of the interrupt handling - we now have two types of * interrupts, normal and fast handlers, fast handlers being - * marked with IRQF_DISABLED and runs with all other interrupts + * marked with SA_INTERRUPT and runs with all other interrupts * disabled. Normal interrupts disable their own source but * run with all other interrupt sources enabled. * PORTS and EXTER interrupts are always shared even if the diff --git a/trunk/arch/m68k/amiga/amisound.c b/trunk/arch/m68k/amiga/amisound.c index 1f5bfb584297..ae94db5d93b2 100644 --- a/trunk/arch/m68k/amiga/amisound.c +++ b/trunk/arch/m68k/amiga/amisound.c @@ -8,6 +8,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/m68k/amiga/chipram.c b/trunk/arch/m68k/amiga/chipram.c index de1304c91112..558d5fd2d2ba 100644 --- a/trunk/arch/m68k/amiga/chipram.c +++ b/trunk/arch/m68k/amiga/chipram.c @@ -7,6 +7,7 @@ ** Rewritten 15/9/2000 by Geert to use resource management */ +#include #include #include #include diff --git a/trunk/arch/m68k/amiga/cia.c b/trunk/arch/m68k/amiga/cia.c index dbad30054721..0956e45399e5 100644 --- a/trunk/arch/m68k/amiga/cia.c +++ b/trunk/arch/m68k/amiga/cia.c @@ -176,5 +176,5 @@ void __init cia_init_IRQ(struct ciabase *base) /* override auto int and install CIA handler */ m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1); m68k_irq_startup(base->handler_irq); - request_irq(base->handler_irq, cia_handler, IRQF_SHARED, base->name, base); + request_irq(base->handler_irq, cia_handler, SA_SHIRQ, base->name, base); } diff --git a/trunk/arch/m68k/amiga/config.c b/trunk/arch/m68k/amiga/config.c index 092e50d2cb13..b5b8a416a07a 100644 --- a/trunk/arch/m68k/amiga/config.c +++ b/trunk/arch/m68k/amiga/config.c @@ -12,6 +12,7 @@ * Miscellaneous Amiga stuff */ +#include #include #include #include diff --git a/trunk/arch/m68k/apollo/config.c b/trunk/arch/m68k/apollo/config.c index 6f4581575fb4..99c70978aafa 100644 --- a/trunk/arch/m68k/apollo/config.c +++ b/trunk/arch/m68k/apollo/config.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/m68k/atari/config.c b/trunk/arch/m68k/atari/config.c index b2079252a954..727289acad7e 100644 --- a/trunk/arch/m68k/atari/config.c +++ b/trunk/arch/m68k/atari/config.c @@ -24,6 +24,7 @@ * Miscellaneous atari stuff */ +#include #include #include #include diff --git a/trunk/arch/m68k/atari/debug.c b/trunk/arch/m68k/atari/debug.c index 4ae01004d8dd..ace05f79d968 100644 --- a/trunk/arch/m68k/atari/debug.c +++ b/trunk/arch/m68k/atari/debug.c @@ -10,6 +10,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/m68k/atari/hades-pci.c b/trunk/arch/m68k/atari/hades-pci.c index 6ca57b6564da..8888debf71ec 100644 --- a/trunk/arch/m68k/atari/hades-pci.c +++ b/trunk/arch/m68k/atari/hades-pci.c @@ -4,6 +4,7 @@ * Written by Wout Klaren. */ +#include #include #include #include diff --git a/trunk/arch/m68k/atari/stram.c b/trunk/arch/m68k/atari/stram.c index bf4588cbe371..22e0481a5f7b 100644 --- a/trunk/arch/m68k/atari/stram.c +++ b/trunk/arch/m68k/atari/stram.c @@ -8,6 +8,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/m68k/hp300/config.c b/trunk/arch/m68k/hp300/config.c index 1c05a6260546..2ef271cd818b 100644 --- a/trunk/arch/m68k/hp300/config.c +++ b/trunk/arch/m68k/hp300/config.c @@ -7,6 +7,7 @@ * called by setup.c. */ +#include #include #include #include diff --git a/trunk/arch/m68k/kernel/bios32.c b/trunk/arch/m68k/kernel/bios32.c index af170c2be735..a901685eb6a9 100644 --- a/trunk/arch/m68k/kernel/bios32.c +++ b/trunk/arch/m68k/kernel/bios32.c @@ -6,6 +6,7 @@ * Based on the DEC Alpha bios32.c by Dave Rusling and David Mosberger. */ +#include #include #include diff --git a/trunk/arch/m68k/kernel/entry.S b/trunk/arch/m68k/kernel/entry.S index 9083c8b7659f..449b62b30f45 100644 --- a/trunk/arch/m68k/kernel/entry.S +++ b/trunk/arch/m68k/kernel/entry.S @@ -33,6 +33,7 @@ * for 68040 */ +#include #include #include #include diff --git a/trunk/arch/m68k/kernel/head.S b/trunk/arch/m68k/kernel/head.S index 6739e87fe825..70002c146eed 100644 --- a/trunk/arch/m68k/kernel/head.S +++ b/trunk/arch/m68k/kernel/head.S @@ -255,6 +255,7 @@ * MAC_USE_SCC_B: Use the SCC port B (printer) for serial debug (default). */ +#include #include #include #include diff --git a/trunk/arch/m68k/kernel/ints.c b/trunk/arch/m68k/kernel/ints.c index b33e37fb7b0e..5a8344b93547 100644 --- a/trunk/arch/m68k/kernel/ints.c +++ b/trunk/arch/m68k/kernel/ints.c @@ -25,6 +25,7 @@ * which must be served /Roman Zippel */ +#include #include #include #include @@ -192,7 +193,7 @@ int setup_irq(unsigned int irq, struct irq_node *node) prev = irq_list + irq; if (*prev) { /* Can't share interrupts unless both agree to */ - if (!((*prev)->flags & node->flags & IRQF_SHARED)) { + if (!((*prev)->flags & node->flags & SA_SHIRQ)) { spin_unlock_irqrestore(&contr->lock, flags); return -EBUSY; } diff --git a/trunk/arch/m68k/kernel/m68k_ksyms.c b/trunk/arch/m68k/kernel/m68k_ksyms.c index aff26a52167c..1f5e1b5aeda4 100644 --- a/trunk/arch/m68k/kernel/m68k_ksyms.c +++ b/trunk/arch/m68k/kernel/m68k_ksyms.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/m68k/kernel/process.c b/trunk/arch/m68k/kernel/process.c index 45a46646c1b3..33648efb772e 100644 --- a/trunk/arch/m68k/kernel/process.c +++ b/trunk/arch/m68k/kernel/process.c @@ -10,6 +10,7 @@ * This file handles the architecture-dependent parts of process handling.. */ +#include #include #include #include diff --git a/trunk/arch/m68k/kernel/ptrace.c b/trunk/arch/m68k/kernel/ptrace.c index ef89060ea328..540638ca81f9 100644 --- a/trunk/arch/m68k/kernel/ptrace.c +++ b/trunk/arch/m68k/kernel/ptrace.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/m68k/kernel/semaphore.c b/trunk/arch/m68k/kernel/semaphore.c index d12cbbfe6ebd..1ebb79baaa8c 100644 --- a/trunk/arch/m68k/kernel/semaphore.c +++ b/trunk/arch/m68k/kernel/semaphore.c @@ -3,6 +3,7 @@ * specific changes in */ +#include #include #include #include diff --git a/trunk/arch/m68k/kernel/setup.c b/trunk/arch/m68k/kernel/setup.c index f2d7ee0ee18c..214a95f9f3ac 100644 --- a/trunk/arch/m68k/kernel/setup.c +++ b/trunk/arch/m68k/kernel/setup.c @@ -8,6 +8,7 @@ * This file handles the architecture-dependent parts of system setup */ +#include #include #include #include diff --git a/trunk/arch/m68k/kernel/traps.c b/trunk/arch/m68k/kernel/traps.c index 4569406a2e1f..e86de7b061cd 100644 --- a/trunk/arch/m68k/kernel/traps.c +++ b/trunk/arch/m68k/kernel/traps.c @@ -18,6 +18,7 @@ * Sets up all exception vectors */ +#include #include #include #include diff --git a/trunk/arch/m68k/kernel/vmlinux.lds.S b/trunk/arch/m68k/kernel/vmlinux.lds.S index 99ba315bd0a8..497b924f3c86 100644 --- a/trunk/arch/m68k/kernel/vmlinux.lds.S +++ b/trunk/arch/m68k/kernel/vmlinux.lds.S @@ -1,3 +1,4 @@ +#include PHDRS { text PT_LOAD FILEHDR PHDRS FLAGS (7); diff --git a/trunk/arch/m68k/mac/config.c b/trunk/arch/m68k/mac/config.c index 85dda1095b1f..5a9990e436bb 100644 --- a/trunk/arch/m68k/mac/config.c +++ b/trunk/arch/m68k/mac/config.c @@ -10,6 +10,7 @@ * Miscellaneous linux stuff */ +#include #include #include #include diff --git a/trunk/arch/m68k/mac/debug.c b/trunk/arch/m68k/mac/debug.c index 4eeb09dc0e8f..cc62ed61cda2 100644 --- a/trunk/arch/m68k/mac/debug.c +++ b/trunk/arch/m68k/mac/debug.c @@ -14,6 +14,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/m68k/mac/iop.c b/trunk/arch/m68k/mac/iop.c index bc657b1057a7..4c8ece7e64a3 100644 --- a/trunk/arch/m68k/mac/iop.c +++ b/trunk/arch/m68k/mac/iop.c @@ -104,6 +104,7 @@ * should execute quickly.) */ +#include #include #include #include diff --git a/trunk/arch/m68k/mac/misc.c b/trunk/arch/m68k/mac/misc.c index 56d1f5676ade..bbb0c3b95e9c 100644 --- a/trunk/arch/m68k/mac/misc.c +++ b/trunk/arch/m68k/mac/misc.c @@ -2,6 +2,7 @@ * Miscellaneous Mac68K-specific stuff */ +#include #include #include #include diff --git a/trunk/arch/m68k/math-emu/fp_entry.S b/trunk/arch/m68k/math-emu/fp_entry.S index 954b4f304a7d..5ec2d9101ea3 100644 --- a/trunk/arch/m68k/math-emu/fp_entry.S +++ b/trunk/arch/m68k/math-emu/fp_entry.S @@ -35,6 +35,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include diff --git a/trunk/arch/m68k/math-emu/fp_util.S b/trunk/arch/m68k/math-emu/fp_util.S index b093b85fcdd2..a9f7f0129067 100644 --- a/trunk/arch/m68k/math-emu/fp_util.S +++ b/trunk/arch/m68k/math-emu/fp_util.S @@ -35,6 +35,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include "fp_emu.h" /* diff --git a/trunk/arch/m68k/mm/init.c b/trunk/arch/m68k/mm/init.c index ab90213e5c54..a190e39c907a 100644 --- a/trunk/arch/m68k/mm/init.c +++ b/trunk/arch/m68k/mm/init.c @@ -7,6 +7,7 @@ * to motorola.c and sun3mmu.c */ +#include #include #include #include diff --git a/trunk/arch/m68k/mm/kmap.c b/trunk/arch/m68k/mm/kmap.c index f46f049d29ff..43ffab048724 100644 --- a/trunk/arch/m68k/mm/kmap.c +++ b/trunk/arch/m68k/mm/kmap.c @@ -7,6 +7,7 @@ * used by other architectures /Roman Zippel */ +#include #include #include #include diff --git a/trunk/arch/m68k/mm/memory.c b/trunk/arch/m68k/mm/memory.c index a0c095e17222..a226668f20c3 100644 --- a/trunk/arch/m68k/mm/memory.c +++ b/trunk/arch/m68k/mm/memory.c @@ -4,6 +4,7 @@ * Copyright (C) 1995 Hamish Macdonald */ +#include #include #include #include diff --git a/trunk/arch/m68k/mm/motorola.c b/trunk/arch/m68k/mm/motorola.c index 49015e32d8fc..bdb11103694b 100644 --- a/trunk/arch/m68k/mm/motorola.c +++ b/trunk/arch/m68k/mm/motorola.c @@ -8,6 +8,7 @@ * Moved 8/20/1999 Sam Creasey */ +#include #include #include #include diff --git a/trunk/arch/m68k/q40/config.c b/trunk/arch/m68k/q40/config.c index 9a1827876408..efa52d302d67 100644 --- a/trunk/arch/m68k/q40/config.c +++ b/trunk/arch/m68k/q40/config.c @@ -12,6 +12,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/m68k/sun3/config.c b/trunk/arch/m68k/sun3/config.c index d09d03b3d956..553c304aa2c5 100644 --- a/trunk/arch/m68k/sun3/config.c +++ b/trunk/arch/m68k/sun3/config.c @@ -8,6 +8,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/m68k/sun3/prom/init.c b/trunk/arch/m68k/sun3/prom/init.c index 202adfcc316e..2e6ae56aec12 100644 --- a/trunk/arch/m68k/sun3/prom/init.c +++ b/trunk/arch/m68k/sun3/prom/init.c @@ -5,6 +5,7 @@ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include diff --git a/trunk/arch/m68k/sun3/prom/printf.c b/trunk/arch/m68k/sun3/prom/printf.c index e7bfde377b5e..e6ee1006344e 100644 --- a/trunk/arch/m68k/sun3/prom/printf.c +++ b/trunk/arch/m68k/sun3/prom/printf.c @@ -8,6 +8,7 @@ * about or use it! It's simple and smelly anyway.... */ +#include #include #include diff --git a/trunk/arch/m68k/sun3/sun3dvma.c b/trunk/arch/m68k/sun3/sun3dvma.c index 6c265222cbcd..97c7bfde8ae8 100644 --- a/trunk/arch/m68k/sun3/sun3dvma.c +++ b/trunk/arch/m68k/sun3/sun3dvma.c @@ -6,6 +6,7 @@ * Contains common routines for sun3/sun3x DVMA management. */ +#include #include #include #include diff --git a/trunk/arch/m68k/sun3/sun3ints.c b/trunk/arch/m68k/sun3/sun3ints.c index f18b9d3ef16d..0912435e9e90 100644 --- a/trunk/arch/m68k/sun3/sun3ints.c +++ b/trunk/arch/m68k/sun3/sun3ints.c @@ -6,6 +6,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/m68k/sun3x/config.c b/trunk/arch/m68k/sun3x/config.c index 987891783a47..52fb17408869 100644 --- a/trunk/arch/m68k/sun3x/config.c +++ b/trunk/arch/m68k/sun3x/config.c @@ -6,6 +6,7 @@ * based on code from Oliver Jowett */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/kernel/comempci.c b/trunk/arch/m68knommu/kernel/comempci.c index 6ee00effbad2..db7a0c1cebae 100644 --- a/trunk/arch/m68knommu/kernel/comempci.c +++ b/trunk/arch/m68knommu/kernel/comempci.c @@ -9,6 +9,7 @@ /*****************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/kernel/entry.S b/trunk/arch/m68knommu/kernel/entry.S index 1e7ea6a3e1a1..8b1f47239b9a 100644 --- a/trunk/arch/m68knommu/kernel/entry.S +++ b/trunk/arch/m68knommu/kernel/entry.S @@ -24,6 +24,7 @@ * linux 2.4 support David McCullough */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/kernel/m68k_ksyms.c b/trunk/arch/m68knommu/kernel/m68k_ksyms.c index 1e62150f3588..4320d5dcc9cb 100644 --- a/trunk/arch/m68knommu/kernel/m68k_ksyms.c +++ b/trunk/arch/m68knommu/kernel/m68k_ksyms.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/m68knommu/kernel/process.c b/trunk/arch/m68knommu/kernel/process.c index c18a83306953..f861755ec88b 100644 --- a/trunk/arch/m68knommu/kernel/process.c +++ b/trunk/arch/m68knommu/kernel/process.c @@ -13,6 +13,7 @@ * This file handles the architecture-dependent parts of process handling.. */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/kernel/ptrace.c b/trunk/arch/m68knommu/kernel/ptrace.c index 9130119537b9..382ca5797b97 100644 --- a/trunk/arch/m68knommu/kernel/ptrace.c +++ b/trunk/arch/m68knommu/kernel/ptrace.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/m68knommu/kernel/semaphore.c b/trunk/arch/m68knommu/kernel/semaphore.c index bce2bc7d87c6..c083f4772add 100644 --- a/trunk/arch/m68knommu/kernel/semaphore.c +++ b/trunk/arch/m68knommu/kernel/semaphore.c @@ -3,6 +3,7 @@ * specific changes in */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/kernel/setup.c b/trunk/arch/m68knommu/kernel/setup.c index bde9811cf98c..99d038e9ab31 100644 --- a/trunk/arch/m68knommu/kernel/setup.c +++ b/trunk/arch/m68knommu/kernel/setup.c @@ -16,6 +16,7 @@ * This file handles the architecture-dependent parts of system setup */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/kernel/syscalltable.S b/trunk/arch/m68knommu/kernel/syscalltable.S index 617e43ec95ae..897deaa06b01 100644 --- a/trunk/arch/m68knommu/kernel/syscalltable.S +++ b/trunk/arch/m68knommu/kernel/syscalltable.S @@ -11,6 +11,7 @@ * Copyright (C) 1991, 1992 Linus Torvalds */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/kernel/time.c b/trunk/arch/m68knommu/kernel/time.c index 1db987272220..b9d8abb45430 100644 --- a/trunk/arch/m68knommu/kernel/time.c +++ b/trunk/arch/m68knommu/kernel/time.c @@ -10,6 +10,7 @@ * "A Kernel Model for Precision Timekeeping" by Dave Mills */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/kernel/traps.c b/trunk/arch/m68knommu/kernel/traps.c index 17649d2543ef..44ff74e643b1 100644 --- a/trunk/arch/m68knommu/kernel/traps.c +++ b/trunk/arch/m68knommu/kernel/traps.c @@ -16,6 +16,7 @@ /* * Sets up all exception vectors */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/kernel/vmlinux.lds.S b/trunk/arch/m68knommu/kernel/vmlinux.lds.S index ccd2ceb05cfb..59ced831b792 100644 --- a/trunk/arch/m68knommu/kernel/vmlinux.lds.S +++ b/trunk/arch/m68knommu/kernel/vmlinux.lds.S @@ -7,6 +7,7 @@ * run kernels. */ +#include #include #if defined(CONFIG_RAMKERNEL) diff --git a/trunk/arch/m68knommu/lib/semaphore.S b/trunk/arch/m68knommu/lib/semaphore.S index 87c746034376..76765362fea6 100644 --- a/trunk/arch/m68knommu/lib/semaphore.S +++ b/trunk/arch/m68knommu/lib/semaphore.S @@ -9,6 +9,7 @@ */ #include +#include #include /* diff --git a/trunk/arch/m68knommu/mm/init.c b/trunk/arch/m68knommu/mm/init.c index e4c233eef195..70d1653be3da 100644 --- a/trunk/arch/m68knommu/mm/init.c +++ b/trunk/arch/m68knommu/mm/init.c @@ -15,6 +15,7 @@ * DEC/2000 -- linux 2.4 support */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/mm/kmap.c b/trunk/arch/m68knommu/mm/kmap.c index bc32f38843f0..04213e1c1e57 100644 --- a/trunk/arch/m68knommu/mm/kmap.c +++ b/trunk/arch/m68knommu/mm/kmap.c @@ -5,6 +5,7 @@ * Copyright (C) 2000-2002 David McCullough */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/mm/memory.c b/trunk/arch/m68knommu/mm/memory.c index 411e45248e5c..0eef72915e61 100644 --- a/trunk/arch/m68knommu/mm/memory.c +++ b/trunk/arch/m68knommu/mm/memory.c @@ -11,6 +11,7 @@ * Copyright (C) 1995 Hamish Macdonald */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/5206/config.c b/trunk/arch/m68knommu/platform/5206/config.c index 34657f85e702..987c91a9a206 100644 --- a/trunk/arch/m68knommu/platform/5206/config.c +++ b/trunk/arch/m68knommu/platform/5206/config.c @@ -9,6 +9,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/5206e/config.c b/trunk/arch/m68knommu/platform/5206e/config.c index 48e4d6266507..f35b8606c1ee 100644 --- a/trunk/arch/m68knommu/platform/5206e/config.c +++ b/trunk/arch/m68knommu/platform/5206e/config.c @@ -8,6 +8,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/520x/config.c b/trunk/arch/m68knommu/platform/520x/config.c index 823f561f35b0..71dea2e0f452 100644 --- a/trunk/arch/m68knommu/platform/520x/config.c +++ b/trunk/arch/m68knommu/platform/520x/config.c @@ -11,6 +11,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/523x/config.c b/trunk/arch/m68knommu/platform/523x/config.c index 85de817e9ec5..22767ce506e0 100644 --- a/trunk/arch/m68knommu/platform/523x/config.c +++ b/trunk/arch/m68knommu/platform/523x/config.c @@ -12,6 +12,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/5249/config.c b/trunk/arch/m68knommu/platform/5249/config.c index 9d19d5bdb8af..289c1821b841 100644 --- a/trunk/arch/m68knommu/platform/5249/config.c +++ b/trunk/arch/m68knommu/platform/5249/config.c @@ -8,6 +8,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/5272/config.c b/trunk/arch/m68knommu/platform/5272/config.c index d500e27eda57..cf36e7d007b9 100644 --- a/trunk/arch/m68knommu/platform/5272/config.c +++ b/trunk/arch/m68knommu/platform/5272/config.c @@ -9,6 +9,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/527x/config.c b/trunk/arch/m68knommu/platform/527x/config.c index bbae51597457..804de33cd6b7 100644 --- a/trunk/arch/m68knommu/platform/527x/config.c +++ b/trunk/arch/m68knommu/platform/527x/config.c @@ -12,6 +12,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/528x/config.c b/trunk/arch/m68knommu/platform/528x/config.c index 18dad9046144..a5d2aa38a27a 100644 --- a/trunk/arch/m68knommu/platform/528x/config.c +++ b/trunk/arch/m68knommu/platform/528x/config.c @@ -12,6 +12,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/5307/config.c b/trunk/arch/m68knommu/platform/5307/config.c index 8074ac56f479..7ed5782e9236 100644 --- a/trunk/arch/m68knommu/platform/5307/config.c +++ b/trunk/arch/m68knommu/platform/5307/config.c @@ -9,6 +9,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/5307/entry.S b/trunk/arch/m68knommu/platform/5307/entry.S index f0dba84d9101..9ddf5476ef8f 100644 --- a/trunk/arch/m68knommu/platform/5307/entry.S +++ b/trunk/arch/m68knommu/platform/5307/entry.S @@ -26,6 +26,7 @@ * Bug, speed and maintainability fixes by Philippe De Muyter */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/5307/head.S b/trunk/arch/m68knommu/platform/5307/head.S index f2edb6498cd9..1d9eb301d7ac 100644 --- a/trunk/arch/m68knommu/platform/5307/head.S +++ b/trunk/arch/m68knommu/platform/5307/head.S @@ -8,6 +8,7 @@ /*****************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/5307/ints.c b/trunk/arch/m68knommu/platform/5307/ints.c index b4b55093ae7e..a134fb2f0566 100644 --- a/trunk/arch/m68knommu/platform/5307/ints.c +++ b/trunk/arch/m68knommu/platform/5307/ints.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/m68knommu/platform/5307/pit.c b/trunk/arch/m68knommu/platform/5307/pit.c index 9dc5688f71b5..ef174748825f 100644 --- a/trunk/arch/m68knommu/platform/5307/pit.c +++ b/trunk/arch/m68knommu/platform/5307/pit.c @@ -12,6 +12,7 @@ /***************************************************************************/ +#include #include #include #include @@ -48,7 +49,7 @@ void coldfire_pit_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)) volatile unsigned char *icrp; volatile unsigned long *imrp; - request_irq(MCFINT_VECBASE + MCFINT_PIT1, handler, IRQF_DISABLED, + request_irq(MCFINT_VECBASE + MCFINT_PIT1, handler, SA_INTERRUPT, "ColdFire Timer", NULL); icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 + diff --git a/trunk/arch/m68knommu/platform/5307/timers.c b/trunk/arch/m68knommu/platform/5307/timers.c index 24781f009337..83b8b89dfa09 100644 --- a/trunk/arch/m68knommu/platform/5307/timers.c +++ b/trunk/arch/m68knommu/platform/5307/timers.c @@ -8,6 +8,7 @@ /***************************************************************************/ +#include #include #include #include @@ -61,7 +62,7 @@ void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)) __raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 | MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, TA(MCFTIMER_TMR)); - request_irq(mcf_timervector, handler, IRQF_DISABLED, "timer", NULL); + request_irq(mcf_timervector, handler, SA_INTERRUPT, "timer", NULL); mcf_settimericr(1, mcf_timerlevel); #ifdef CONFIG_HIGHPROFILE @@ -125,7 +126,7 @@ void coldfire_profile_init(void) MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, PA(MCFTIMER_TMR)); request_irq(mcf_profilevector, coldfire_profile_tick, - (IRQF_DISABLED | IRQ_FLG_FAST), "profile timer", NULL); + (SA_INTERRUPT | IRQ_FLG_FAST), "profile timer", NULL); mcf_settimericr(2, 7); } diff --git a/trunk/arch/m68knommu/platform/5307/vectors.c b/trunk/arch/m68knommu/platform/5307/vectors.c index 2a8b0d044ce5..ac313a160d8d 100644 --- a/trunk/arch/m68knommu/platform/5307/vectors.c +++ b/trunk/arch/m68knommu/platform/5307/vectors.c @@ -8,6 +8,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/5407/config.c b/trunk/arch/m68knommu/platform/5407/config.c index 5aad2645f0f1..f7c9018b85a7 100644 --- a/trunk/arch/m68knommu/platform/5407/config.c +++ b/trunk/arch/m68knommu/platform/5407/config.c @@ -9,6 +9,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/68328/config.c b/trunk/arch/m68knommu/platform/68328/config.c index 26ffeba28642..bcfa5d7fe1e2 100644 --- a/trunk/arch/m68knommu/platform/68328/config.c +++ b/trunk/arch/m68knommu/platform/68328/config.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/68328/entry.S b/trunk/arch/m68knommu/platform/68328/entry.S index f97862715450..7d8990d784a2 100644 --- a/trunk/arch/m68knommu/platform/68328/entry.S +++ b/trunk/arch/m68knommu/platform/68328/entry.S @@ -10,6 +10,7 @@ * Linux/m68k support by Hamish Macdonald */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/68328/head-de2.S b/trunk/arch/m68knommu/platform/68328/head-de2.S index 92d96456d363..94c5a1609a75 100644 --- a/trunk/arch/m68knommu/platform/68328/head-de2.S +++ b/trunk/arch/m68knommu/platform/68328/head-de2.S @@ -1,3 +1,4 @@ +#include #if defined(CONFIG_RAM32MB) #define MEM_END 0x02000000 /* Memory size 32Mb */ diff --git a/trunk/arch/m68knommu/platform/68328/head-pilot.S b/trunk/arch/m68knommu/platform/68328/head-pilot.S index 9e07faa3e81d..46b3604f999c 100644 --- a/trunk/arch/m68knommu/platform/68328/head-pilot.S +++ b/trunk/arch/m68knommu/platform/68328/head-pilot.S @@ -15,6 +15,7 @@ #define IMMED # #define DBG_PUTC(x) moveb IMMED x, 0xfffff907 +#include .global _stext .global _start diff --git a/trunk/arch/m68knommu/platform/68328/head-ram.S b/trunk/arch/m68knommu/platform/68328/head-ram.S index 252b80b02038..e8dc9241ff96 100644 --- a/trunk/arch/m68knommu/platform/68328/head-ram.S +++ b/trunk/arch/m68knommu/platform/68328/head-ram.S @@ -1,3 +1,4 @@ +#include .global __main .global __rom_start diff --git a/trunk/arch/m68knommu/platform/68328/head-rom.S b/trunk/arch/m68knommu/platform/68328/head-rom.S index 6ec77d3ea0b3..234430b9551c 100644 --- a/trunk/arch/m68knommu/platform/68328/head-rom.S +++ b/trunk/arch/m68knommu/platform/68328/head-rom.S @@ -1,3 +1,4 @@ +#include .global _start .global _stext diff --git a/trunk/arch/m68knommu/platform/68328/timers.c b/trunk/arch/m68knommu/platform/68328/timers.c index 438ef6ee9720..68c2cd6b0030 100644 --- a/trunk/arch/m68knommu/platform/68328/timers.c +++ b/trunk/arch/m68knommu/platform/68328/timers.c @@ -14,6 +14,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/68360/config.c b/trunk/arch/m68knommu/platform/68360/config.c index c5482e3622eb..69c670dfd62b 100644 --- a/trunk/arch/m68knommu/platform/68360/config.c +++ b/trunk/arch/m68knommu/platform/68360/config.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/68360/entry.S b/trunk/arch/m68knommu/platform/68360/entry.S index f1af8977f294..8ff48adf24ab 100644 --- a/trunk/arch/m68knommu/platform/68360/entry.S +++ b/trunk/arch/m68knommu/platform/68360/entry.S @@ -12,6 +12,7 @@ * M68360 Port by SED Systems, and Lineo. */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/68360/head-ram.S b/trunk/arch/m68knommu/platform/68360/head-ram.S index 2ea51479f13a..f497713a4ec7 100644 --- a/trunk/arch/m68knommu/platform/68360/head-ram.S +++ b/trunk/arch/m68knommu/platform/68360/head-ram.S @@ -12,6 +12,7 @@ * */ #define ASSEMBLY +#include .global _stext .global _start diff --git a/trunk/arch/m68knommu/platform/68360/head-rom.S b/trunk/arch/m68knommu/platform/68360/head-rom.S index 62ecf4144b3b..2d28c3e19a88 100644 --- a/trunk/arch/m68knommu/platform/68360/head-rom.S +++ b/trunk/arch/m68knommu/platform/68360/head-rom.S @@ -11,6 +11,7 @@ * Copyright (C) 1998 D. Jeff Dionne , * */ +#include .global _stext .global _sbss diff --git a/trunk/arch/m68knommu/platform/68360/ints.c b/trunk/arch/m68knommu/platform/68360/ints.c index 4df3c146eb74..0245fc4a4781 100644 --- a/trunk/arch/m68knommu/platform/68360/ints.c +++ b/trunk/arch/m68knommu/platform/68360/ints.c @@ -10,6 +10,7 @@ * Copyright (c) 1999 D. Jeff Dionne */ +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/68EZ328/config.c b/trunk/arch/m68knommu/platform/68EZ328/config.c index 659b80aca118..15a14a67c2bf 100644 --- a/trunk/arch/m68knommu/platform/68EZ328/config.c +++ b/trunk/arch/m68knommu/platform/68EZ328/config.c @@ -14,6 +14,7 @@ /***************************************************************************/ #include +#include #include #include #include diff --git a/trunk/arch/m68knommu/platform/68VZ328/config.c b/trunk/arch/m68knommu/platform/68VZ328/config.c index fcd100b7594d..4058de5c8fa2 100644 --- a/trunk/arch/m68knommu/platform/68VZ328/config.c +++ b/trunk/arch/m68knommu/platform/68VZ328/config.c @@ -14,6 +14,7 @@ /***************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/mips/arc/identify.c b/trunk/arch/mips/arc/identify.c index 3ba7c47f9f23..1bd6199e174a 100644 --- a/trunk/arch/mips/arc/identify.c +++ b/trunk/arch/mips/arc/identify.c @@ -11,6 +11,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/au1xxx_irqmap.c b/trunk/arch/mips/au1000/common/au1xxx_irqmap.c index 7acfe9bf5fc3..5a1e3687cafa 100644 --- a/trunk/arch/mips/au1000/common/au1xxx_irqmap.c +++ b/trunk/arch/mips/au1000/common/au1xxx_irqmap.c @@ -25,6 +25,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/dbdma.c b/trunk/arch/mips/au1000/common/dbdma.c index 98244d51c154..a547e47dd5fd 100644 --- a/trunk/arch/mips/au1000/common/dbdma.c +++ b/trunk/arch/mips/au1000/common/dbdma.c @@ -30,6 +30,7 @@ * */ +#include #include #include #include @@ -892,7 +893,7 @@ static void au1xxx_dbdma_init(void) #error Unknown Au1x00 SOC #endif - if (request_irq(irq_nr, dbdma_interrupt, IRQF_DISABLED, + if (request_irq(irq_nr, dbdma_interrupt, SA_INTERRUPT, "Au1xxx dbdma", (void *)dbdma_gptr)) printk("Can't get 1550 dbdma irq"); } diff --git a/trunk/arch/mips/au1000/common/dbg_io.c b/trunk/arch/mips/au1000/common/dbg_io.c index 0a50af7f34b8..7bc768e558db 100644 --- a/trunk/arch/mips/au1000/common/dbg_io.c +++ b/trunk/arch/mips/au1000/common/dbg_io.c @@ -1,4 +1,5 @@ +#include #include #include diff --git a/trunk/arch/mips/au1000/common/dma.c b/trunk/arch/mips/au1000/common/dma.c index fb7c47c1585d..1d82f2277517 100644 --- a/trunk/arch/mips/au1000/common/dma.c +++ b/trunk/arch/mips/au1000/common/dma.c @@ -30,6 +30,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. * */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/gpio.c b/trunk/arch/mips/au1000/common/gpio.c index ce55297dcb8c..5f5915b83142 100644 --- a/trunk/arch/mips/au1000/common/gpio.c +++ b/trunk/arch/mips/au1000/common/gpio.c @@ -19,6 +19,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/irq.c b/trunk/arch/mips/au1000/common/irq.c index 29d6f8178bad..12d6edee895e 100644 --- a/trunk/arch/mips/au1000/common/irq.c +++ b/trunk/arch/mips/au1000/common/irq.c @@ -26,6 +26,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -309,7 +310,7 @@ void startup_match20_interrupt(irqreturn_t (*handler)(int, void *, struct pt_reg * can avoid it. --cgray */ action.dev_id = handler; - action.flags = IRQF_DISABLED; + action.flags = SA_INTERRUPT; cpus_clear(action.mask); action.name = "Au1xxx TOY"; action.handler = handler; diff --git a/trunk/arch/mips/au1000/common/pci.c b/trunk/arch/mips/au1000/common/pci.c index da591f674893..b1392abac809 100644 --- a/trunk/arch/mips/au1000/common/pci.c +++ b/trunk/arch/mips/au1000/common/pci.c @@ -30,6 +30,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/platform.c b/trunk/arch/mips/au1000/common/platform.c index 8fd203d4a339..32702e5fbf67 100644 --- a/trunk/arch/mips/au1000/common/platform.c +++ b/trunk/arch/mips/au1000/common/platform.c @@ -7,6 +7,7 @@ * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/power.c b/trunk/arch/mips/au1000/common/power.c index 7504a6364616..b035513fe30a 100644 --- a/trunk/arch/mips/au1000/common/power.c +++ b/trunk/arch/mips/au1000/common/power.c @@ -29,6 +29,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/reset.c b/trunk/arch/mips/au1000/common/reset.c index de5447e83849..c93af224c1b3 100644 --- a/trunk/arch/mips/au1000/common/reset.c +++ b/trunk/arch/mips/au1000/common/reset.c @@ -27,6 +27,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/setup.c b/trunk/arch/mips/au1000/common/setup.c index cc5138ce9c95..97165b6b3894 100644 --- a/trunk/arch/mips/au1000/common/setup.c +++ b/trunk/arch/mips/au1000/common/setup.c @@ -25,6 +25,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/time.c b/trunk/arch/mips/au1000/common/time.c index 7e988b0b0130..842e1b5ac4a1 100644 --- a/trunk/arch/mips/au1000/common/time.c +++ b/trunk/arch/mips/au1000/common/time.c @@ -33,6 +33,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/usbdev.c b/trunk/arch/mips/au1000/common/usbdev.c index 63bcb3a95dc7..2cab7629702c 100644 --- a/trunk/arch/mips/au1000/common/usbdev.c +++ b/trunk/arch/mips/au1000/common/usbdev.c @@ -1465,14 +1465,14 @@ usbdev_init(struct usb_device_descriptor* dev_desc, */ /* request the USB device transfer complete interrupt */ - if (request_irq(AU1000_USB_DEV_REQ_INT, req_sus_intr, IRQF_DISABLED, + if (request_irq(AU1000_USB_DEV_REQ_INT, req_sus_intr, SA_INTERRUPT, "USBdev req", &usbdev)) { err("Can't get device request intr"); ret = -ENXIO; goto out; } /* request the USB device suspend interrupt */ - if (request_irq(AU1000_USB_DEV_SUS_INT, req_sus_intr, IRQF_DISABLED, + if (request_irq(AU1000_USB_DEV_SUS_INT, req_sus_intr, SA_INTERRUPT, "USBdev sus", &usbdev)) { err("Can't get device suspend intr"); ret = -ENXIO; @@ -1483,7 +1483,7 @@ usbdev_init(struct usb_device_descriptor* dev_desc, if ((ep0->indma = request_au1000_dma(ep_dma_id[0].id, ep_dma_id[0].str, dma_done_ep0_intr, - IRQF_DISABLED, + SA_INTERRUPT, &usbdev)) < 0) { err("Can't get %s DMA", ep_dma_id[0].str); ret = -ENXIO; @@ -1516,7 +1516,7 @@ usbdev_init(struct usb_device_descriptor* dev_desc, request_au1000_dma(ep_dma_id[ep->address].id, ep_dma_id[ep->address].str, dma_done_ep_intr, - IRQF_DISABLED, + SA_INTERRUPT, &usbdev); if (ep->indma < 0) { err("Can't get %s DMA", diff --git a/trunk/arch/mips/au1000/csb250/board_setup.c b/trunk/arch/mips/au1000/csb250/board_setup.c index 348c3024d3d1..1c55c5f59d75 100644 --- a/trunk/arch/mips/au1000/csb250/board_setup.c +++ b/trunk/arch/mips/au1000/csb250/board_setup.c @@ -26,6 +26,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/db1x00/board_setup.c b/trunk/arch/mips/au1000/db1x00/board_setup.c index 7a79293f8527..f00ec3b175d8 100644 --- a/trunk/arch/mips/au1000/db1x00/board_setup.c +++ b/trunk/arch/mips/au1000/db1x00/board_setup.c @@ -27,6 +27,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/db1x00/init.c b/trunk/arch/mips/au1000/db1x00/init.c index 0a3f025eb023..41e0522f3cf1 100644 --- a/trunk/arch/mips/au1000/db1x00/init.c +++ b/trunk/arch/mips/au1000/db1x00/init.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/mips/au1000/db1x00/irqmap.c b/trunk/arch/mips/au1000/db1x00/irqmap.c index 3e5729145c2b..0138c5b7c860 100644 --- a/trunk/arch/mips/au1000/db1x00/irqmap.c +++ b/trunk/arch/mips/au1000/db1x00/irqmap.c @@ -25,6 +25,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/db1x00/mirage_ts.c b/trunk/arch/mips/au1000/db1x00/mirage_ts.c index 0942dcf69518..c29852c24b4f 100644 --- a/trunk/arch/mips/au1000/db1x00/mirage_ts.c +++ b/trunk/arch/mips/au1000/db1x00/mirage_ts.c @@ -31,6 +31,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/hydrogen3/board_setup.c b/trunk/arch/mips/au1000/hydrogen3/board_setup.c index d081640e2e00..2efae1064647 100644 --- a/trunk/arch/mips/au1000/hydrogen3/board_setup.c +++ b/trunk/arch/mips/au1000/hydrogen3/board_setup.c @@ -27,6 +27,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/hydrogen3/init.c b/trunk/arch/mips/au1000/hydrogen3/init.c index 8f02bb80a55a..01ab28483959 100644 --- a/trunk/arch/mips/au1000/hydrogen3/init.c +++ b/trunk/arch/mips/au1000/hydrogen3/init.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/mips/au1000/mtx-1/board_setup.c b/trunk/arch/mips/au1000/mtx-1/board_setup.c index e917e54fc683..638de7bb43f0 100644 --- a/trunk/arch/mips/au1000/mtx-1/board_setup.c +++ b/trunk/arch/mips/au1000/mtx-1/board_setup.c @@ -28,6 +28,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/pb1000/board_setup.c b/trunk/arch/mips/au1000/pb1000/board_setup.c index 1cf18e16ab54..0b4807dc9f44 100644 --- a/trunk/arch/mips/au1000/pb1000/board_setup.c +++ b/trunk/arch/mips/au1000/pb1000/board_setup.c @@ -23,6 +23,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/pb1100/board_setup.c b/trunk/arch/mips/au1000/pb1100/board_setup.c index db27b9331ff3..13c2f6ca7e33 100644 --- a/trunk/arch/mips/au1000/pb1100/board_setup.c +++ b/trunk/arch/mips/au1000/pb1100/board_setup.c @@ -23,6 +23,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/pb1200/board_setup.c b/trunk/arch/mips/au1000/pb1200/board_setup.c index 8b953b9fc25c..a45b17538ac9 100644 --- a/trunk/arch/mips/au1000/pb1200/board_setup.c +++ b/trunk/arch/mips/au1000/pb1200/board_setup.c @@ -23,6 +23,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/pb1200/irqmap.c b/trunk/arch/mips/au1000/pb1200/irqmap.c index 2d49f32f4622..5dd164fc1889 100644 --- a/trunk/arch/mips/au1000/pb1200/irqmap.c +++ b/trunk/arch/mips/au1000/pb1200/irqmap.c @@ -22,6 +22,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/pb1500/board_setup.c b/trunk/arch/mips/au1000/pb1500/board_setup.c index 1a9a293de6ab..30bb87282b1f 100644 --- a/trunk/arch/mips/au1000/pb1500/board_setup.c +++ b/trunk/arch/mips/au1000/pb1500/board_setup.c @@ -23,6 +23,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/au1000/xxs1500/board_setup.c b/trunk/arch/mips/au1000/xxs1500/board_setup.c index ae3d6b19e94d..1e59433dfd66 100644 --- a/trunk/arch/mips/au1000/xxs1500/board_setup.c +++ b/trunk/arch/mips/au1000/xxs1500/board_setup.c @@ -23,6 +23,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/basler/excite/excite_iodev.c b/trunk/arch/mips/basler/excite/excite_iodev.c index b288151b532e..91121e523043 100644 --- a/trunk/arch/mips/basler/excite/excite_iodev.c +++ b/trunk/arch/mips/basler/excite/excite_iodev.c @@ -113,7 +113,7 @@ static int __exit iodev_remove(struct device *dev) static int iodev_open(struct inode *i, struct file *f) { - return request_irq(iodev_irq, iodev_irqhdl, IRQF_DISABLED, + return request_irq(iodev_irq, iodev_irqhdl, SA_INTERRUPT, iodev_name, &miscdev); } diff --git a/trunk/arch/mips/cobalt/console.c b/trunk/arch/mips/cobalt/console.c index 46c23b66bc17..300797d5f558 100644 --- a/trunk/arch/mips/cobalt/console.c +++ b/trunk/arch/mips/cobalt/console.c @@ -2,6 +2,7 @@ * (C) P. Horton 2006 */ +#include #include #include #include diff --git a/trunk/arch/mips/cobalt/setup.c b/trunk/arch/mips/cobalt/setup.c index c99714587ce8..ca719d6398bd 100644 --- a/trunk/arch/mips/cobalt/setup.c +++ b/trunk/arch/mips/cobalt/setup.c @@ -9,6 +9,7 @@ * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv) * */ +#include #include #include #include diff --git a/trunk/arch/mips/ddb5xxx/common/prom.c b/trunk/arch/mips/ddb5xxx/common/prom.c index efef0f57ce1e..20c845c84d4b 100644 --- a/trunk/arch/mips/ddb5xxx/common/prom.c +++ b/trunk/arch/mips/ddb5xxx/common/prom.c @@ -7,6 +7,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/mips/ddb5xxx/ddb5477/irq.c b/trunk/arch/mips/ddb5xxx/ddb5477/irq.c index 22fb94b7c440..de433cf9fb50 100644 --- a/trunk/arch/mips/ddb5xxx/ddb5477/irq.c +++ b/trunk/arch/mips/ddb5xxx/ddb5477/irq.c @@ -10,6 +10,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/mips/ddb5xxx/ddb5477/setup.c b/trunk/arch/mips/ddb5xxx/ddb5477/setup.c index 47ba0b6f210f..93167ecdb424 100644 --- a/trunk/arch/mips/ddb5xxx/ddb5477/setup.c +++ b/trunk/arch/mips/ddb5xxx/ddb5477/setup.c @@ -13,6 +13,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/mips/dec/int-handler.S b/trunk/arch/mips/dec/int-handler.S index 455a65b91cb0..e8ec93e33fe6 100644 --- a/trunk/arch/mips/dec/int-handler.S +++ b/trunk/arch/mips/dec/int-handler.S @@ -13,6 +13,7 @@ * Rewritten extensively for controller-driven IRQ support * by Maciej W. Rozycki. */ +#include #include #include diff --git a/trunk/arch/mips/dec/prom/init.c b/trunk/arch/mips/dec/prom/init.c index bf2858071f1f..32a7cc7e4c65 100644 --- a/trunk/arch/mips/dec/prom/init.c +++ b/trunk/arch/mips/dec/prom/init.c @@ -4,6 +4,7 @@ * Copyright (C) 1998 Harald Koerfgen * Copyright (C) 2002, 2004 Maciej W. Rozycki */ +#include #include #include #include diff --git a/trunk/arch/mips/dec/prom/memory.c b/trunk/arch/mips/dec/prom/memory.c index 3027ce782797..1edaf3074ee9 100644 --- a/trunk/arch/mips/dec/prom/memory.c +++ b/trunk/arch/mips/dec/prom/memory.c @@ -4,6 +4,7 @@ * Copyright (C) 1998 Harald Koerfgen, Frieder Streffer and Paul M. Antoine * Copyright (C) 2000, 2002 Maciej W. Rozycki */ +#include #include #include #include diff --git a/trunk/arch/mips/dec/setup.c b/trunk/arch/mips/dec/setup.c index 2684f121784b..9c707b9ceb65 100644 --- a/trunk/arch/mips/dec/setup.c +++ b/trunk/arch/mips/dec/setup.c @@ -105,7 +105,7 @@ static struct irqaction fpuirq = { }; static struct irqaction busirq = { - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "bus error", }; @@ -124,7 +124,7 @@ static void __init dec_be_init(void) case MACH_DS23100: /* DS2100/DS3100 Pmin/Pmax */ board_be_handler = dec_kn01_be_handler; busirq.handler = dec_kn01_be_interrupt; - busirq.flags |= IRQF_SHARED; + busirq.flags |= SA_SHIRQ; dec_kn01_be_init(); break; case MACH_DS5000_1XX: /* DS5000/1xx 3min */ diff --git a/trunk/arch/mips/galileo-boards/ev96100/setup.c b/trunk/arch/mips/galileo-boards/ev96100/setup.c index 639ad5562c63..a04aea6123da 100644 --- a/trunk/arch/mips/galileo-boards/ev96100/setup.c +++ b/trunk/arch/mips/galileo-boards/ev96100/setup.c @@ -32,6 +32,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/galileo-boards/ev96100/time.c b/trunk/arch/mips/galileo-boards/ev96100/time.c index 8cbe8426491a..bff5b1c174e4 100644 --- a/trunk/arch/mips/galileo-boards/ev96100/time.c +++ b/trunk/arch/mips/galileo-boards/ev96100/time.c @@ -32,6 +32,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/gt64120/common/time.c b/trunk/arch/mips/gt64120/common/time.c index d837b26fbe51..2287b59536e5 100644 --- a/trunk/arch/mips/gt64120/common/time.c +++ b/trunk/arch/mips/gt64120/common/time.c @@ -8,6 +8,7 @@ */ #include #include +#include #include #include #include @@ -77,7 +78,7 @@ void gt64120_time_init(void) * the values to the correct interrupt line. */ timer.handler = gt64120_irq; - timer.flags = IRQF_SHARED | IRQF_DISABLED; + timer.flags = SA_SHIRQ | SA_INTERRUPT; timer.name = "timer"; timer.dev_id = NULL; timer.next = NULL; diff --git a/trunk/arch/mips/gt64120/momenco_ocelot/dbg_io.c b/trunk/arch/mips/gt64120/momenco_ocelot/dbg_io.c index 2128684584f5..f0a6a38fcf4d 100644 --- a/trunk/arch/mips/gt64120/momenco_ocelot/dbg_io.c +++ b/trunk/arch/mips/gt64120/momenco_ocelot/dbg_io.c @@ -1,3 +1,4 @@ +#include #ifdef CONFIG_KGDB diff --git a/trunk/arch/mips/ite-boards/generic/dbg_io.c b/trunk/arch/mips/ite-boards/generic/dbg_io.c index 8e9cd8a9670a..6a7ccaf93502 100644 --- a/trunk/arch/mips/ite-boards/generic/dbg_io.c +++ b/trunk/arch/mips/ite-boards/generic/dbg_io.c @@ -1,4 +1,5 @@ +#include #ifdef CONFIG_KGDB diff --git a/trunk/arch/mips/ite-boards/generic/it8172_cir.c b/trunk/arch/mips/ite-boards/generic/it8172_cir.c index bfc25adcfec6..19deb153d005 100644 --- a/trunk/arch/mips/ite-boards/generic/it8172_cir.c +++ b/trunk/arch/mips/ite-boards/generic/it8172_cir.c @@ -28,6 +28,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #ifdef CONFIG_IT8172_CIR diff --git a/trunk/arch/mips/ite-boards/generic/it8172_setup.c b/trunk/arch/mips/ite-boards/generic/it8172_setup.c index a4615a5904aa..da6ae0991199 100644 --- a/trunk/arch/mips/ite-boards/generic/it8172_setup.c +++ b/trunk/arch/mips/ite-boards/generic/it8172_setup.c @@ -26,6 +26,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/ite-boards/generic/pmon_prom.c b/trunk/arch/mips/ite-boards/generic/pmon_prom.c index 7d0a79be34d8..6e505af0cc08 100644 --- a/trunk/arch/mips/ite-boards/generic/pmon_prom.c +++ b/trunk/arch/mips/ite-boards/generic/pmon_prom.c @@ -35,6 +35,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/jazz/setup.c b/trunk/arch/mips/jazz/setup.c index 385413e30fdd..c8d0df7d0c36 100644 --- a/trunk/arch/mips/jazz/setup.c +++ b/trunk/arch/mips/jazz/setup.c @@ -8,6 +8,7 @@ * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle * Copyright (C) 2001 MIPS Technologies, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/jmr3927/rbhma3100/init.c b/trunk/arch/mips/jmr3927/rbhma3100/init.c index a55cb4572ded..a0674d73962f 100644 --- a/trunk/arch/mips/jmr3927/rbhma3100/init.c +++ b/trunk/arch/mips/jmr3927/rbhma3100/init.c @@ -27,6 +27,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/jmr3927/rbhma3100/irq.c b/trunk/arch/mips/jmr3927/rbhma3100/irq.c index 9c43702e7a93..380046ea1db5 100644 --- a/trunk/arch/mips/jmr3927/rbhma3100/irq.c +++ b/trunk/arch/mips/jmr3927/rbhma3100/irq.c @@ -29,6 +29,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include diff --git a/trunk/arch/mips/jmr3927/rbhma3100/setup.c b/trunk/arch/mips/jmr3927/rbhma3100/setup.c index 6d4635d89d94..308e6cdcd245 100644 --- a/trunk/arch/mips/jmr3927/rbhma3100/setup.c +++ b/trunk/arch/mips/jmr3927/rbhma3100/setup.c @@ -33,6 +33,7 @@ *********************************************************************** */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/asm-offsets.c b/trunk/arch/mips/kernel/asm-offsets.c index ec28077d5ee2..f1bb6a2dc5fc 100644 --- a/trunk/arch/mips/kernel/asm-offsets.c +++ b/trunk/arch/mips/kernel/asm-offsets.c @@ -8,6 +8,7 @@ * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com * Copyright (C) 2000 MIPS Technologies, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/cpu-bugs64.c b/trunk/arch/mips/kernel/cpu-bugs64.c index c09337b947b9..d268827c62bd 100644 --- a/trunk/arch/mips/kernel/cpu-bugs64.c +++ b/trunk/arch/mips/kernel/cpu-bugs64.c @@ -6,6 +6,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/cpu-probe.c b/trunk/arch/mips/kernel/cpu-probe.c index ba08f055feb2..e045aba4ebda 100644 --- a/trunk/arch/mips/kernel/cpu-probe.c +++ b/trunk/arch/mips/kernel/cpu-probe.c @@ -11,6 +11,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/entry.S b/trunk/arch/mips/kernel/entry.S index 01e7fa86aa43..457565162dd5 100644 --- a/trunk/arch/mips/kernel/entry.S +++ b/trunk/arch/mips/kernel/entry.S @@ -7,6 +7,7 @@ * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 2001 MIPS Technologies, Inc. */ +#include #include #include @@ -65,7 +66,7 @@ need_resched: #endif FEXPORT(ret_from_fork) - jal schedule_tail # a0 = struct task_struct *prev + jal schedule_tail # a0 = task_t *prev FEXPORT(syscall_exit) local_irq_disable # make sure need_resched and diff --git a/trunk/arch/mips/kernel/gdb-low.S b/trunk/arch/mips/kernel/gdb-low.S index 666bc9014cbd..8760131f89d9 100644 --- a/trunk/arch/mips/kernel/gdb-low.S +++ b/trunk/arch/mips/kernel/gdb-low.S @@ -3,6 +3,7 @@ * * Copyright (C) 1995 Andreas Busse */ +#include #include #include diff --git a/trunk/arch/mips/kernel/gdb-stub.c b/trunk/arch/mips/kernel/gdb-stub.c index 719d26968cb2..6ecbdc1fefd1 100644 --- a/trunk/arch/mips/kernel/gdb-stub.c +++ b/trunk/arch/mips/kernel/gdb-stub.c @@ -120,6 +120,7 @@ * breakpoints, single stepping, * printing variables, etc. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/genex.S b/trunk/arch/mips/kernel/genex.S index 5254a2222d2b..6888cde560af 100644 --- a/trunk/arch/mips/kernel/genex.S +++ b/trunk/arch/mips/kernel/genex.S @@ -8,6 +8,7 @@ * Copyright (C) 2001 MIPS Technologies, Inc. * Copyright (C) 2002 Maciej W. Rozycki */ +#include #include #include diff --git a/trunk/arch/mips/kernel/head.S b/trunk/arch/mips/kernel/head.S index 476c1eb33c94..c018098c9a56 100644 --- a/trunk/arch/mips/kernel/head.S +++ b/trunk/arch/mips/kernel/head.S @@ -13,6 +13,7 @@ * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. */ +#include #include #include diff --git a/trunk/arch/mips/kernel/irq.c b/trunk/arch/mips/kernel/irq.c index cde5e5afa179..5c9dcd5eed59 100644 --- a/trunk/arch/mips/kernel/irq.c +++ b/trunk/arch/mips/kernel/irq.c @@ -8,6 +8,7 @@ * Copyright (C) 1992 Linus Torvalds * Copyright (C) 1994 - 2000 Ralf Baechle */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/linux32.c b/trunk/arch/mips/kernel/linux32.c index 450ac592da57..a7d2bb3cf835 100644 --- a/trunk/arch/mips/kernel/linux32.c +++ b/trunk/arch/mips/kernel/linux32.c @@ -5,6 +5,7 @@ * Written by Ulf Carlsson (ulfc@engr.sgi.com) * sys32_execve from ia64/ia32 code, Feb 2000, Kanoj Sarcar (kanoj@sgi.com) */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/mips-mt.c b/trunk/arch/mips/kernel/mips-mt.c index 4dcc39f42951..02237a685ec7 100644 --- a/trunk/arch/mips/kernel/mips-mt.c +++ b/trunk/arch/mips/kernel/mips-mt.c @@ -47,7 +47,7 @@ unsigned long mt_fpemul_threshold = 0; * used in sys_sched_set/getaffinity() in kernel/sched.c, so * cloned here. */ -static inline struct task_struct *find_process_by_pid(pid_t pid) +static inline task_t *find_process_by_pid(pid_t pid) { return pid ? find_task_by_pid(pid) : current; } @@ -62,7 +62,7 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len, cpumask_t new_mask; cpumask_t effective_mask; int retval; - struct task_struct *p; + task_t *p; if (len < sizeof(new_mask)) return -EINVAL; @@ -127,7 +127,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, unsigned int real_len; cpumask_t mask; int retval; - struct task_struct *p; + task_t *p; real_len = sizeof(mask); if (len < real_len) diff --git a/trunk/arch/mips/kernel/mips_ksyms.c b/trunk/arch/mips/kernel/mips_ksyms.c index f44a01357ada..0a71a4c33716 100644 --- a/trunk/arch/mips/kernel/mips_ksyms.c +++ b/trunk/arch/mips/kernel/mips_ksyms.c @@ -8,6 +8,7 @@ * Copyright (C) 1996, 97, 98, 99, 2000, 01, 03, 04, 05 by Ralf Baechle * Copyright (C) 1999, 2000, 01 Silicon Graphics, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/proc.c b/trunk/arch/mips/kernel/proc.c index d8beef107902..9def554f335b 100644 --- a/trunk/arch/mips/kernel/proc.c +++ b/trunk/arch/mips/kernel/proc.c @@ -5,6 +5,7 @@ * Copyright (C) 2001, 2004 MIPS Technologies, Inc. * Copyright (C) 2004 Maciej W. Rozycki */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/process.c b/trunk/arch/mips/kernel/process.c index 7ab67f786bfe..199a06e873c6 100644 --- a/trunk/arch/mips/kernel/process.c +++ b/trunk/arch/mips/kernel/process.c @@ -8,6 +8,7 @@ * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 2004 Thiemo Seufer */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/ptrace.c b/trunk/arch/mips/kernel/ptrace.c index 362d1728e531..1d44025188d8 100644 --- a/trunk/arch/mips/kernel/ptrace.c +++ b/trunk/arch/mips/kernel/ptrace.c @@ -14,6 +14,7 @@ * At this time Linux/MIPS64 only supports syscall tracing, even for 32-bit * binaries. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/r2300_switch.S b/trunk/arch/mips/kernel/r2300_switch.S index 656bde2e11b1..0d9c4a32a9c2 100644 --- a/trunk/arch/mips/kernel/r2300_switch.S +++ b/trunk/arch/mips/kernel/r2300_switch.S @@ -10,6 +10,7 @@ * Further modifications to make this work: * Copyright (c) 1998-2000 Harald Koerfgen */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/r4k_fpu.S b/trunk/arch/mips/kernel/r4k_fpu.S index 880fa6e841ee..283a98508fc8 100644 --- a/trunk/arch/mips/kernel/r4k_fpu.S +++ b/trunk/arch/mips/kernel/r4k_fpu.S @@ -12,6 +12,7 @@ * Copyright (C) 2000 MIPS Technologies, Inc. * Copyright (C) 1999, 2001 Silicon Graphics, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/r4k_switch.S b/trunk/arch/mips/kernel/r4k_switch.S index d5c8b82fed72..e1b85e6c486a 100644 --- a/trunk/arch/mips/kernel/r4k_switch.S +++ b/trunk/arch/mips/kernel/r4k_switch.S @@ -10,6 +10,7 @@ * Copyright (C) 2000 MIPS Technologies, Inc. * written by Carsten Langgaard, carstenl@mips.com */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/rtlx.c b/trunk/arch/mips/kernel/rtlx.c index cdab1b2cd134..caf777f83289 100644 --- a/trunk/arch/mips/kernel/rtlx.c +++ b/trunk/arch/mips/kernel/rtlx.c @@ -487,7 +487,7 @@ static struct file_operations rtlx_fops = { static struct irqaction rtlx_irq = { .handler = rtlx_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "RTLX", }; diff --git a/trunk/arch/mips/kernel/scall32-o32.S b/trunk/arch/mips/kernel/scall32-o32.S index 8f8101f878ca..6344be46ca8c 100644 --- a/trunk/arch/mips/kernel/scall32-o32.S +++ b/trunk/arch/mips/kernel/scall32-o32.S @@ -7,6 +7,7 @@ * Copyright (C) 2001 MIPS Technologies, Inc. * Copyright (C) 2004 Thiemo Seufer */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/scall64-64.S b/trunk/arch/mips/kernel/scall64-64.S index b4a34a625a2e..12d96c7d0bb2 100644 --- a/trunk/arch/mips/kernel/scall64-64.S +++ b/trunk/arch/mips/kernel/scall64-64.S @@ -7,6 +7,7 @@ * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 2001 MIPS Technologies, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/scall64-n32.S b/trunk/arch/mips/kernel/scall64-n32.S index df8c4f8ccd61..685698554a8a 100644 --- a/trunk/arch/mips/kernel/scall64-n32.S +++ b/trunk/arch/mips/kernel/scall64-n32.S @@ -7,6 +7,7 @@ * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 2001 MIPS Technologies, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/scall64-o32.S b/trunk/arch/mips/kernel/scall64-o32.S index f04fe4f085c3..0e632934cb76 100644 --- a/trunk/arch/mips/kernel/scall64-o32.S +++ b/trunk/arch/mips/kernel/scall64-o32.S @@ -13,6 +13,7 @@ * to ABI64 calling convention. 64-bit syscalls are also processed * here for now. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/setup.c b/trunk/arch/mips/kernel/setup.c index 5edd8d4bb665..d3e087115023 100644 --- a/trunk/arch/mips/kernel/setup.c +++ b/trunk/arch/mips/kernel/setup.c @@ -10,6 +10,7 @@ * Copyright (C) 1999 Silicon Graphics, Inc. * Copyright (C) 2000 2001, 2002 Maciej W. Rozycki */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/signal-common.h b/trunk/arch/mips/kernel/signal-common.h index b1f09d54ebe6..ce6cb915c0a7 100644 --- a/trunk/arch/mips/kernel/signal-common.h +++ b/trunk/arch/mips/kernel/signal-common.h @@ -8,6 +8,7 @@ * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ +#include static inline int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) diff --git a/trunk/arch/mips/kernel/signal.c b/trunk/arch/mips/kernel/signal.c index 6b4d9be31615..402efd27c79e 100644 --- a/trunk/arch/mips/kernel/signal.c +++ b/trunk/arch/mips/kernel/signal.c @@ -7,6 +7,7 @@ * Copyright (C) 1994 - 2000 Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/smp-mt.c b/trunk/arch/mips/kernel/smp-mt.c index 93429a4d3012..57770902b9ae 100644 --- a/trunk/arch/mips/kernel/smp-mt.c +++ b/trunk/arch/mips/kernel/smp-mt.c @@ -130,13 +130,13 @@ irqreturn_t ipi_call_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction irq_resched = { .handler = ipi_resched_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "IPI_resched" }; static struct irqaction irq_call = { .handler = ipi_call_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "IPI_call" }; diff --git a/trunk/arch/mips/kernel/smtc.c b/trunk/arch/mips/kernel/smtc.c index a48d9e553083..70cf09afdf56 100644 --- a/trunk/arch/mips/kernel/smtc.c +++ b/trunk/arch/mips/kernel/smtc.c @@ -1002,7 +1002,7 @@ void setup_cross_vpe_interrupts(void) set_vi_handler(MIPS_CPU_IPI_IRQ, ipi_irq_dispatch); irq_ipi.handler = ipi_interrupt; - irq_ipi.flags = IRQF_DISABLED; + irq_ipi.flags = SA_INTERRUPT; irq_ipi.name = "SMTC_IPI"; setup_irq_smtc(cpu_ipi_irq, &irq_ipi, (0x100 << MIPS_CPU_IPI_IRQ)); diff --git a/trunk/arch/mips/kernel/syscall.c b/trunk/arch/mips/kernel/syscall.c index 0721314db657..6da8c68e89db 100644 --- a/trunk/arch/mips/kernel/syscall.c +++ b/trunk/arch/mips/kernel/syscall.c @@ -7,6 +7,7 @@ * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 2001 MIPS Technologies, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/time.c b/trunk/arch/mips/kernel/time.c index 2393c11d5a20..13ff4da598cd 100644 --- a/trunk/arch/mips/kernel/time.c +++ b/trunk/arch/mips/kernel/time.c @@ -11,6 +11,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include @@ -579,7 +580,7 @@ unsigned int mips_hpt_frequency; static struct irqaction timer_irqaction = { .handler = timer_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "timer", }; diff --git a/trunk/arch/mips/kernel/traps.c b/trunk/arch/mips/kernel/traps.c index 8b95eca9ac74..67971938a2cb 100644 --- a/trunk/arch/mips/kernel/traps.c +++ b/trunk/arch/mips/kernel/traps.c @@ -11,6 +11,7 @@ * Copyright (C) 2000, 01 MIPS Technologies, Inc. * Copyright (C) 2002, 2003, 2004, 2005 Maciej W. Rozycki */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/unaligned.c b/trunk/arch/mips/kernel/unaligned.c index 7e7d54823486..5b5a3736cbbc 100644 --- a/trunk/arch/mips/kernel/unaligned.c +++ b/trunk/arch/mips/kernel/unaligned.c @@ -72,6 +72,7 @@ * A store crossing a page boundary might be executed only partially. * Undo the partial store in this case. */ +#include #include #include #include diff --git a/trunk/arch/mips/kernel/vmlinux.lds.S b/trunk/arch/mips/kernel/vmlinux.lds.S index 0bb9cd889456..b84d1f9ce28e 100644 --- a/trunk/arch/mips/kernel/vmlinux.lds.S +++ b/trunk/arch/mips/kernel/vmlinux.lds.S @@ -1,3 +1,4 @@ +#include #include #include diff --git a/trunk/arch/mips/lasat/lasat_board.c b/trunk/arch/mips/lasat/lasat_board.c index d425120b0282..fc9b0e2a6be1 100644 --- a/trunk/arch/mips/lasat/lasat_board.c +++ b/trunk/arch/mips/lasat/lasat_board.c @@ -17,6 +17,7 @@ * * Routines specific to the LASAT boards */ +#include #include #include #include diff --git a/trunk/arch/mips/lasat/reset.c b/trunk/arch/mips/lasat/reset.c index 9e22acf03083..181bf68175fc 100644 --- a/trunk/arch/mips/lasat/reset.c +++ b/trunk/arch/mips/lasat/reset.c @@ -17,6 +17,7 @@ * * Reset the LASAT board. */ +#include #include #include diff --git a/trunk/arch/mips/lasat/setup.c b/trunk/arch/mips/lasat/setup.c index 2187e63c6d88..3f64277429e4 100644 --- a/trunk/arch/mips/lasat/setup.c +++ b/trunk/arch/mips/lasat/setup.c @@ -22,6 +22,7 @@ * * Lasat specific setup. */ +#include #include #include #include diff --git a/trunk/arch/mips/lasat/sysctl.c b/trunk/arch/mips/lasat/sysctl.c index 6dd7ae1b7c25..e3d5aaa90f0d 100644 --- a/trunk/arch/mips/lasat/sysctl.c +++ b/trunk/arch/mips/lasat/sysctl.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/mips/lib-32/dump_tlb.c b/trunk/arch/mips/lib-32/dump_tlb.c index 6a68deb51aae..c49a925d0169 100644 --- a/trunk/arch/mips/lib-32/dump_tlb.c +++ b/trunk/arch/mips/lib-32/dump_tlb.c @@ -4,6 +4,7 @@ * Copyright (C) 1994, 1995 by Waldorf Electronics, written by Ralf Baechle. * Copyright (C) 1999 by Silicon Graphics, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/lib-64/dump_tlb.c b/trunk/arch/mips/lib-64/dump_tlb.c index be8261be679b..11a5f015f040 100644 --- a/trunk/arch/mips/lib-64/dump_tlb.c +++ b/trunk/arch/mips/lib-64/dump_tlb.c @@ -4,6 +4,7 @@ * Copyright (C) 1994, 1995 by Waldorf Electronics, written by Ralf Baechle. * Copyright (C) 1999 by Silicon Graphics, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/lib/memcpy.S b/trunk/arch/mips/lib/memcpy.S index a526c62cb76a..7f9aafa4d80e 100644 --- a/trunk/arch/mips/lib/memcpy.S +++ b/trunk/arch/mips/lib/memcpy.S @@ -12,6 +12,7 @@ * * Mnemonic names for arguments to memcpy/__copy_user */ +#include /* * Hack to resolve longstanding prefetch issue diff --git a/trunk/arch/mips/math-emu/kernel_linkage.c b/trunk/arch/mips/math-emu/kernel_linkage.c index 5b3390f64917..56ca0c6a7178 100644 --- a/trunk/arch/mips/math-emu/kernel_linkage.c +++ b/trunk/arch/mips/math-emu/kernel_linkage.c @@ -19,6 +19,7 @@ * manipulation primitives for the Algorithmics MIPS * FPU Emulator */ +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/atlas/atlas_setup.c b/trunk/arch/mips/mips-boards/atlas/atlas_setup.c index 3a7c3d28aa0d..8cc9effcb832 100644 --- a/trunk/arch/mips/mips-boards/atlas/atlas_setup.c +++ b/trunk/arch/mips/mips-boards/atlas/atlas_setup.c @@ -15,6 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/generic/init.c b/trunk/arch/mips/mips-boards/generic/init.c index 58a0fe883591..df4e94735604 100644 --- a/trunk/arch/mips/mips-boards/generic/init.c +++ b/trunk/arch/mips/mips-boards/generic/init.c @@ -19,6 +19,7 @@ * * PROM library initialisation code. */ +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/generic/memory.c b/trunk/arch/mips/mips-boards/generic/memory.c index c89fcf9e9c22..fd492562584a 100644 --- a/trunk/arch/mips/mips-boards/generic/memory.c +++ b/trunk/arch/mips/mips-boards/generic/memory.c @@ -18,6 +18,7 @@ * PROM library functions for acquiring/using memory descriptors given to * us from the YAMON. */ +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/generic/printf.c b/trunk/arch/mips/mips-boards/generic/printf.c index 1a711bd79b51..2c1ab1f19fdc 100644 --- a/trunk/arch/mips/mips-boards/generic/printf.c +++ b/trunk/arch/mips/mips-boards/generic/printf.c @@ -17,6 +17,7 @@ * * Putting things on the screen/serial line using YAMONs facilities. */ +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/generic/reset.c b/trunk/arch/mips/mips-boards/generic/reset.c index 0996ba368b2a..7213c395fb6b 100644 --- a/trunk/arch/mips/mips-boards/generic/reset.c +++ b/trunk/arch/mips/mips-boards/generic/reset.c @@ -22,6 +22,7 @@ * Reset the MIPS boards. * */ +#include #include #include diff --git a/trunk/arch/mips/mips-boards/generic/time.c b/trunk/arch/mips/mips-boards/generic/time.c index 5e207760826b..a9f6124b3a22 100644 --- a/trunk/arch/mips/mips-boards/generic/time.c +++ b/trunk/arch/mips/mips-boards/generic/time.c @@ -19,6 +19,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/malta/malta_setup.c b/trunk/arch/mips/mips-boards/malta/malta_setup.c index bc4ac6f01877..0766e434b6bd 100644 --- a/trunk/arch/mips/mips-boards/malta/malta_setup.c +++ b/trunk/arch/mips/mips-boards/malta/malta_setup.c @@ -15,6 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/sead/sead_setup.c b/trunk/arch/mips/mips-boards/sead/sead_setup.c index a856bd664879..6430f11f3a95 100644 --- a/trunk/arch/mips/mips-boards/sead/sead_setup.c +++ b/trunk/arch/mips/mips-boards/sead/sead_setup.c @@ -17,6 +17,7 @@ * * SEAD specific setup. */ +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/sim/sim_IRQ.c b/trunk/arch/mips/mips-boards/sim/sim_IRQ.c index ec549f3e2011..5b84c7fe1022 100644 --- a/trunk/arch/mips/mips-boards/sim/sim_IRQ.c +++ b/trunk/arch/mips/mips-boards/sim/sim_IRQ.c @@ -17,6 +17,7 @@ * * Interrupt exception dispatch code. */ +#include #include #include diff --git a/trunk/arch/mips/mips-boards/sim/sim_irq.S b/trunk/arch/mips/mips-boards/sim/sim_irq.S index b7444e74a6a1..d16cf3822076 100644 --- a/trunk/arch/mips/mips-boards/sim/sim_irq.S +++ b/trunk/arch/mips/mips-boards/sim/sim_irq.S @@ -17,6 +17,7 @@ * Interrupt exception dispatch code. * */ +#include #include #include diff --git a/trunk/arch/mips/mips-boards/sim/sim_setup.c b/trunk/arch/mips/mips-boards/sim/sim_setup.c index 3d4a785b565a..15a5dac4ae19 100644 --- a/trunk/arch/mips/mips-boards/sim/sim_setup.c +++ b/trunk/arch/mips/mips-boards/sim/sim_setup.c @@ -16,6 +16,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/sim/sim_smp.c b/trunk/arch/mips/mips-boards/sim/sim_smp.c index cb47863ecf10..004070956cca 100644 --- a/trunk/arch/mips/mips-boards/sim/sim_smp.c +++ b/trunk/arch/mips/mips-boards/sim/sim_smp.c @@ -18,6 +18,7 @@ /* * Simulator Platform-specific hooks for SMP operation */ +#include #include #include #include diff --git a/trunk/arch/mips/mips-boards/sim/sim_time.c b/trunk/arch/mips/mips-boards/sim/sim_time.c index e7f6003357f7..18b968c696d1 100644 --- a/trunk/arch/mips/mips-boards/sim/sim_time.c +++ b/trunk/arch/mips/mips-boards/sim/sim_time.c @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/trunk/arch/mips/mm/c-r4k.c b/trunk/arch/mips/mm/c-r4k.c index 857b726f4d41..75d887e89739 100644 --- a/trunk/arch/mips/mm/c-r4k.c +++ b/trunk/arch/mips/mm/c-r4k.c @@ -7,6 +7,7 @@ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Ralf Baechle (ralf@gnu.org) * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/c-sb1.c b/trunk/arch/mips/mm/c-sb1.c index 2d71efb82ac5..f9b129491b1e 100644 --- a/trunk/arch/mips/mm/c-sb1.c +++ b/trunk/arch/mips/mm/c-sb1.c @@ -18,6 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include diff --git a/trunk/arch/mips/mm/cache.c b/trunk/arch/mips/mm/cache.c index ddd3a2de1d73..83a56296be86 100644 --- a/trunk/arch/mips/mm/cache.c +++ b/trunk/arch/mips/mm/cache.c @@ -5,6 +5,7 @@ * * Copyright (C) 1994 - 2003 by Ralf Baechle */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/cerr-sb1.c b/trunk/arch/mips/mm/cerr-sb1.c index e19fbb9ee47f..1cf3c6006ccd 100644 --- a/trunk/arch/mips/mm/cerr-sb1.c +++ b/trunk/arch/mips/mm/cerr-sb1.c @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/dma-coherent.c b/trunk/arch/mips/mm/dma-coherent.c index 7fa5fd16e46b..f6b3c722230c 100644 --- a/trunk/arch/mips/mm/dma-coherent.c +++ b/trunk/arch/mips/mm/dma-coherent.c @@ -7,6 +7,7 @@ * Copyright (C) 2000, 2001 Ralf Baechle * swiped from i386, and cloned for MIPS by Geert, polished by Ralf. */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/dma-noncoherent.c b/trunk/arch/mips/mm/dma-noncoherent.c index 2eeffe5c2a3a..cd4ea8474f89 100644 --- a/trunk/arch/mips/mm/dma-noncoherent.c +++ b/trunk/arch/mips/mm/dma-noncoherent.c @@ -7,6 +7,7 @@ * Copyright (C) 2000, 2001 Ralf Baechle * swiped from i386, and cloned for MIPS by Geert, polished by Ralf. */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/highmem.c b/trunk/arch/mips/mm/highmem.c index 99ebf3ccc222..0c544375b856 100644 --- a/trunk/arch/mips/mm/highmem.c +++ b/trunk/arch/mips/mm/highmem.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/mips/mm/init.c b/trunk/arch/mips/mm/init.c index 802bdd32aa2b..33f6e1cdfd5b 100644 --- a/trunk/arch/mips/mm/init.c +++ b/trunk/arch/mips/mm/init.c @@ -8,6 +8,7 @@ * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/pg-sb1.c b/trunk/arch/mips/mm/pg-sb1.c index fc3c7878fb45..148c65b9cd8b 100644 --- a/trunk/arch/mips/mm/pg-sb1.c +++ b/trunk/arch/mips/mm/pg-sb1.c @@ -22,6 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/pgtable-32.c b/trunk/arch/mips/mm/pgtable-32.c index 4bdaa05f485b..4a3c4919e314 100644 --- a/trunk/arch/mips/mm/pgtable-32.c +++ b/trunk/arch/mips/mm/pgtable-32.c @@ -5,6 +5,7 @@ * * Copyright (C) 2003 by Ralf Baechle */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/pgtable.c b/trunk/arch/mips/mm/pgtable.c index 792c6eb44232..3fe94202da8c 100644 --- a/trunk/arch/mips/mm/pgtable.c +++ b/trunk/arch/mips/mm/pgtable.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/mips/mm/tlb-r4k.c b/trunk/arch/mips/mm/tlb-r4k.c index 2cde1b772443..965cb4c4359d 100644 --- a/trunk/arch/mips/mm/tlb-r4k.c +++ b/trunk/arch/mips/mm/tlb-r4k.c @@ -8,6 +8,7 @@ * Carsten Langgaard, carstenl@mips.com * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved. */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/tlb-r8k.c b/trunk/arch/mips/mm/tlb-r8k.c index 266a47d65eed..1bfb09198ce3 100644 --- a/trunk/arch/mips/mm/tlb-r8k.c +++ b/trunk/arch/mips/mm/tlb-r8k.c @@ -8,6 +8,7 @@ * Carsten Langgaard, carstenl@mips.com * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved. */ +#include #include #include #include diff --git a/trunk/arch/mips/mm/tlbex.c b/trunk/arch/mips/mm/tlbex.c index e1a8139fc8fb..54507be2ab5b 100644 --- a/trunk/arch/mips/mm/tlbex.c +++ b/trunk/arch/mips/mm/tlbex.c @@ -21,6 +21,7 @@ #include +#include #include #include #include diff --git a/trunk/arch/mips/momentum/jaguar_atx/dbg_io.c b/trunk/arch/mips/momentum/jaguar_atx/dbg_io.c index b85a6521f72d..d7dea0a136aa 100644 --- a/trunk/arch/mips/momentum/jaguar_atx/dbg_io.c +++ b/trunk/arch/mips/momentum/jaguar_atx/dbg_io.c @@ -1,3 +1,4 @@ +#include #if defined(CONFIG_REMOTE_DEBUG) diff --git a/trunk/arch/mips/momentum/jaguar_atx/irq.c b/trunk/arch/mips/momentum/jaguar_atx/irq.c index f9067469a656..ec4032b38f19 100644 --- a/trunk/arch/mips/momentum/jaguar_atx/irq.c +++ b/trunk/arch/mips/momentum/jaguar_atx/irq.c @@ -71,7 +71,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) } static struct irqaction cascade_mv64340 = { - no_action, IRQF_DISABLED, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL + no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL }; void __init arch_init_irq(void) diff --git a/trunk/arch/mips/momentum/jaguar_atx/prom.c b/trunk/arch/mips/momentum/jaguar_atx/prom.c index 3d2712929293..1cadaa92946a 100644 --- a/trunk/arch/mips/momentum/jaguar_atx/prom.c +++ b/trunk/arch/mips/momentum/jaguar_atx/prom.c @@ -16,6 +16,7 @@ * * Added changes for SMP - Manish Lachwani (lachwani@pmc-sierra.com) */ +#include #include #include #include diff --git a/trunk/arch/mips/momentum/jaguar_atx/reset.c b/trunk/arch/mips/momentum/jaguar_atx/reset.c index c73b0897dc52..ce9fb2e3d952 100644 --- a/trunk/arch/mips/momentum/jaguar_atx/reset.c +++ b/trunk/arch/mips/momentum/jaguar_atx/reset.c @@ -14,6 +14,7 @@ * Louis Hamilton, Red Hat, Inc. * hamilton@redhat.com [MIPS64 modifications] */ +#include #include #include #include diff --git a/trunk/arch/mips/momentum/jaguar_atx/setup.c b/trunk/arch/mips/momentum/jaguar_atx/setup.c index b08e6a0456c1..d0419480b097 100644 --- a/trunk/arch/mips/momentum/jaguar_atx/setup.c +++ b/trunk/arch/mips/momentum/jaguar_atx/setup.c @@ -39,6 +39,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/momentum/ocelot_3/irq.c b/trunk/arch/mips/momentum/ocelot_3/irq.c index 793782a9c195..87c63c340ae3 100644 --- a/trunk/arch/mips/momentum/ocelot_3/irq.c +++ b/trunk/arch/mips/momentum/ocelot_3/irq.c @@ -54,7 +54,7 @@ #include static struct irqaction cascade_mv64340 = { - no_action, IRQF_DISABLED, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL + no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL }; void __init arch_init_irq(void) diff --git a/trunk/arch/mips/momentum/ocelot_3/prom.c b/trunk/arch/mips/momentum/ocelot_3/prom.c index 296d945bc248..9803daa2a792 100644 --- a/trunk/arch/mips/momentum/ocelot_3/prom.c +++ b/trunk/arch/mips/momentum/ocelot_3/prom.c @@ -21,6 +21,7 @@ * Author: Manish Lachwani, mlachwani@mvista.com * */ +#include #include #include #include diff --git a/trunk/arch/mips/momentum/ocelot_c/dbg_io.c b/trunk/arch/mips/momentum/ocelot_c/dbg_io.c index 2128684584f5..f0a6a38fcf4d 100644 --- a/trunk/arch/mips/momentum/ocelot_c/dbg_io.c +++ b/trunk/arch/mips/momentum/ocelot_c/dbg_io.c @@ -1,3 +1,4 @@ +#include #ifdef CONFIG_KGDB diff --git a/trunk/arch/mips/momentum/ocelot_c/irq.c b/trunk/arch/mips/momentum/ocelot_c/irq.c index 9d44ae1e156b..86f61ce59e53 100644 --- a/trunk/arch/mips/momentum/ocelot_c/irq.c +++ b/trunk/arch/mips/momentum/ocelot_c/irq.c @@ -52,11 +52,11 @@ extern void uart_irq_init(void); extern void cpci_irq_init(void); static struct irqaction cascade_fpga = { - no_action, IRQF_DISABLED, CPU_MASK_NONE, "cascade via FPGA", NULL, NULL + no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade via FPGA", NULL, NULL }; static struct irqaction cascade_mv64340 = { - no_action, IRQF_DISABLED, CPU_MASK_NONE, "cascade via MV64340", NULL, NULL + no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade via MV64340", NULL, NULL }; extern void ll_uart_irq(struct pt_regs *regs); diff --git a/trunk/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h b/trunk/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h index 7228cd19e5ea..97fb77dad723 100644 --- a/trunk/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h +++ b/trunk/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h @@ -30,6 +30,7 @@ #ifndef __OCELOT_C_FPGA_H__ #define __OCELOT_C_FPGA_H__ +#include #ifdef CONFIG_64BIT #define OCELOT_C_CS0_ADDR (0xfffffffffc000000) diff --git a/trunk/arch/mips/momentum/ocelot_c/prom.c b/trunk/arch/mips/momentum/ocelot_c/prom.c index 4c50a147f429..e92364482c7b 100644 --- a/trunk/arch/mips/momentum/ocelot_c/prom.c +++ b/trunk/arch/mips/momentum/ocelot_c/prom.c @@ -14,6 +14,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/mips/momentum/ocelot_c/reset.c b/trunk/arch/mips/momentum/ocelot_c/reset.c index 3fdcb64ff1e6..9dcd154c7767 100644 --- a/trunk/arch/mips/momentum/ocelot_c/reset.c +++ b/trunk/arch/mips/momentum/ocelot_c/reset.c @@ -14,6 +14,7 @@ * Louis Hamilton, Red Hat, Inc. * hamilton@redhat.com [MIPS64 modifications] */ +#include #include #include #include diff --git a/trunk/arch/mips/momentum/ocelot_c/setup.c b/trunk/arch/mips/momentum/ocelot_c/setup.c index 6a4519936ee9..a0ee006d75cf 100644 --- a/trunk/arch/mips/momentum/ocelot_c/setup.c +++ b/trunk/arch/mips/momentum/ocelot_c/setup.c @@ -40,6 +40,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. * */ +#include #include #include #include diff --git a/trunk/arch/mips/momentum/ocelot_g/dbg_io.c b/trunk/arch/mips/momentum/ocelot_g/dbg_io.c index 2128684584f5..f0a6a38fcf4d 100644 --- a/trunk/arch/mips/momentum/ocelot_g/dbg_io.c +++ b/trunk/arch/mips/momentum/ocelot_g/dbg_io.c @@ -1,3 +1,4 @@ +#include #ifdef CONFIG_KGDB diff --git a/trunk/arch/mips/momentum/ocelot_g/gt-irq.c b/trunk/arch/mips/momentum/ocelot_g/gt-irq.c index 9fb2493fff02..8bd9b844fa9e 100644 --- a/trunk/arch/mips/momentum/ocelot_g/gt-irq.c +++ b/trunk/arch/mips/momentum/ocelot_g/gt-irq.c @@ -11,6 +11,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include @@ -173,7 +174,7 @@ void gt64240_time_init(void) * the values to the correct interrupt line. */ timer.handler = >64240_p0int_irq; - timer.flags = IRQF_SHARED | IRQF_DISABLED; + timer.flags = SA_SHIRQ | SA_INTERRUPT; timer.name = "timer"; timer.dev_id = NULL; timer.next = NULL; diff --git a/trunk/arch/mips/momentum/ocelot_g/prom.c b/trunk/arch/mips/momentum/ocelot_g/prom.c index 6509a9c9863c..6b4f577c2757 100644 --- a/trunk/arch/mips/momentum/ocelot_g/prom.c +++ b/trunk/arch/mips/momentum/ocelot_g/prom.c @@ -11,6 +11,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/mips/momentum/ocelot_g/setup.c b/trunk/arch/mips/momentum/ocelot_g/setup.c index c580b1de33bc..39da02b4e076 100644 --- a/trunk/arch/mips/momentum/ocelot_g/setup.c +++ b/trunk/arch/mips/momentum/ocelot_g/setup.c @@ -37,6 +37,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. * */ +#include #include #include #include diff --git a/trunk/arch/mips/pci/fixup-atlas.c b/trunk/arch/mips/pci/fixup-atlas.c index 439510af3037..87920b245931 100644 --- a/trunk/arch/mips/pci/fixup-atlas.c +++ b/trunk/arch/mips/pci/fixup-atlas.c @@ -16,6 +16,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ +#include #include #include diff --git a/trunk/arch/mips/pci/fixup-vr4133.c b/trunk/arch/mips/pci/fixup-vr4133.c index 8e01d0c1b76b..a8a47b494b23 100644 --- a/trunk/arch/mips/pci/fixup-vr4133.c +++ b/trunk/arch/mips/pci/fixup-vr4133.c @@ -15,6 +15,7 @@ * Author: Manish Lachwani (mlachwani@mvista.com) * */ +#include #include #include diff --git a/trunk/arch/mips/pci/ops-au1000.c b/trunk/arch/mips/pci/ops-au1000.c index 0c0c1e6519f9..be1420126c42 100644 --- a/trunk/arch/mips/pci/ops-au1000.c +++ b/trunk/arch/mips/pci/ops-au1000.c @@ -28,6 +28,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/pci/pci-bcm1480.c b/trunk/arch/mips/pci/pci-bcm1480.c index f6774f54cd3c..f4ef1a35ca18 100644 --- a/trunk/arch/mips/pci/pci-bcm1480.c +++ b/trunk/arch/mips/pci/pci-bcm1480.c @@ -32,6 +32,7 @@ * * XXX: AT THIS TIME, ONLY the NATIVE PCI-X INTERFACE IS SUPPORTED. */ +#include #include #include #include diff --git a/trunk/arch/mips/pci/pci-bcm1480ht.c b/trunk/arch/mips/pci/pci-bcm1480ht.c index ba2e34b09231..a3eebe5890a7 100644 --- a/trunk/arch/mips/pci/pci-bcm1480ht.c +++ b/trunk/arch/mips/pci/pci-bcm1480ht.c @@ -31,6 +31,7 @@ * problem. * */ +#include #include #include #include diff --git a/trunk/arch/mips/pci/pci-ip32.c b/trunk/arch/mips/pci/pci-ip32.c index 17c7932cf0ae..180af89bcb1e 100644 --- a/trunk/arch/mips/pci/pci-ip32.c +++ b/trunk/arch/mips/pci/pci-ip32.c @@ -6,6 +6,7 @@ * Copyright (C) 2000, 2001 Keith M Wesolowski * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) */ +#include #include #include #include diff --git a/trunk/arch/mips/pci/pci-sb1250.c b/trunk/arch/mips/pci/pci-sb1250.c index 80f5e8c4bcd4..7cca3bde59b2 100644 --- a/trunk/arch/mips/pci/pci-sb1250.c +++ b/trunk/arch/mips/pci/pci-sb1250.c @@ -30,6 +30,7 @@ * kernel mapped memory. Hopefully neither of these should be a huge * problem. */ +#include #include #include #include diff --git a/trunk/arch/mips/pci/pci.c b/trunk/arch/mips/pci/pci.c index 5ace368657ad..ba66f8c9bd4e 100644 --- a/trunk/arch/mips/pci/pci.c +++ b/trunk/arch/mips/pci/pci.c @@ -6,6 +6,7 @@ * * Copyright (C) 2003, 04 Ralf Baechle (ralf@linux-mips.org) */ +#include #include #include #include diff --git a/trunk/arch/mips/philips/pnx8550/common/int.c b/trunk/arch/mips/philips/pnx8550/common/int.c index 8aca317d4624..8f18764a2359 100644 --- a/trunk/arch/mips/philips/pnx8550/common/int.c +++ b/trunk/arch/mips/philips/pnx8550/common/int.c @@ -23,6 +23,7 @@ * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * */ +#include #include #include #include @@ -219,13 +220,13 @@ static struct hw_interrupt_type level_irq_type = { static struct irqaction gic_action = { .handler = no_action, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "GIC", }; static struct irqaction timer_action = { .handler = no_action, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "Timer", }; diff --git a/trunk/arch/mips/philips/pnx8550/common/setup.c b/trunk/arch/mips/philips/pnx8550/common/setup.c index 8ac81a9dc293..0e791f4f6ea3 100644 --- a/trunk/arch/mips/philips/pnx8550/common/setup.c +++ b/trunk/arch/mips/philips/pnx8550/common/setup.c @@ -17,6 +17,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/pmc-sierra/yosemite/ht.c b/trunk/arch/mips/pmc-sierra/yosemite/ht.c index 1f7c999eb7c6..fb523ebcafa8 100644 --- a/trunk/arch/mips/pmc-sierra/yosemite/ht.c +++ b/trunk/arch/mips/pmc-sierra/yosemite/ht.c @@ -23,6 +23,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/pmc-sierra/yosemite/irq.c b/trunk/arch/mips/pmc-sierra/yosemite/irq.c index b91d0aa3b7ed..a1f524fc4c10 100644 --- a/trunk/arch/mips/pmc-sierra/yosemite/irq.c +++ b/trunk/arch/mips/pmc-sierra/yosemite/irq.c @@ -26,6 +26,7 @@ * * Second level Interrupt handlers for the PMC-Sierra Titan/Yosemite board */ +#include #include #include #include diff --git a/trunk/arch/mips/pmc-sierra/yosemite/prom.c b/trunk/arch/mips/pmc-sierra/yosemite/prom.c index 9fe4973377c3..165275c00cbb 100644 --- a/trunk/arch/mips/pmc-sierra/yosemite/prom.c +++ b/trunk/arch/mips/pmc-sierra/yosemite/prom.c @@ -8,6 +8,7 @@ * Author: Manish Lachwani (lachwani@pmc-sierra.com) * Copyright (C) 2004 Ralf Baechle */ +#include #include #include #include diff --git a/trunk/arch/mips/sgi-ip22/ip22-eisa.c b/trunk/arch/mips/sgi-ip22/ip22-eisa.c index ce8e4a7869b0..989167b49ce9 100644 --- a/trunk/arch/mips/sgi-ip22/ip22-eisa.c +++ b/trunk/arch/mips/sgi-ip22/ip22-eisa.c @@ -19,6 +19,7 @@ * - Fix more bugs. */ +#include #include #include #include diff --git a/trunk/arch/mips/sgi-ip22/ip22-int.c b/trunk/arch/mips/sgi-ip22/ip22-int.c index 2d8762818d95..18906af69691 100644 --- a/trunk/arch/mips/sgi-ip22/ip22-int.c +++ b/trunk/arch/mips/sgi-ip22/ip22-int.c @@ -9,6 +9,7 @@ * - Interrupt handling fixes * Copyright (C) 2001, 2003 Ladislav Michl (ladis@linux-mips.org) */ +#include #include #include #include @@ -272,32 +273,32 @@ static void indy_buserror_irq(struct pt_regs *regs) static struct irqaction local0_cascade = { .handler = no_action, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "local0 cascade", }; static struct irqaction local1_cascade = { .handler = no_action, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "local1 cascade", }; static struct irqaction buserr = { .handler = no_action, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "Bus Error", }; static struct irqaction map0_cascade = { .handler = no_action, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "mapable0 cascade", }; #ifdef USE_LIO3_IRQ static struct irqaction map1_cascade = { .handler = no_action, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "mapable1 cascade", }; #define SGI_INTERRUPTS SGINT_END diff --git a/trunk/arch/mips/sgi-ip22/ip22-setup.c b/trunk/arch/mips/sgi-ip22/ip22-setup.c index 25097ecc9baa..d7138906eb10 100644 --- a/trunk/arch/mips/sgi-ip22/ip22-setup.c +++ b/trunk/arch/mips/sgi-ip22/ip22-setup.c @@ -4,6 +4,7 @@ * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * Copyright (C) 1997, 1998 Ralf Baechle (ralf@gnu.org) */ +#include #include #include #include diff --git a/trunk/arch/mips/sgi-ip27/ip27-init.c b/trunk/arch/mips/sgi-ip27/ip27-init.c index 9094baf31d0e..a6b490e99709 100644 --- a/trunk/arch/mips/sgi-ip27/ip27-init.c +++ b/trunk/arch/mips/sgi-ip27/ip27-init.c @@ -6,6 +6,7 @@ * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com) * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/sgi-ip27/ip27-irq.c b/trunk/arch/mips/sgi-ip27/ip27-irq.c index 597ec73359b7..869566c360ae 100644 --- a/trunk/arch/mips/sgi-ip27/ip27-irq.c +++ b/trunk/arch/mips/sgi-ip27/ip27-irq.c @@ -8,6 +8,7 @@ #undef DEBUG +#include #include #include #include @@ -118,7 +119,7 @@ static int ms1bit(unsigned long x) } /* - * This code is unnecessarily complex, because we do IRQF_DISABLED + * This code is unnecessarily complex, because we do SA_INTERRUPT * intr enabling. Basically, once we grab the set of intrs we need * to service, we must mask _all_ these interrupts; firstly, to make * sure the same intr does not intr again, causing recursion that diff --git a/trunk/arch/mips/sgi-ip27/ip27-klnuma.c b/trunk/arch/mips/sgi-ip27/ip27-klnuma.c index d777b7d1a9fe..41c3f405e00c 100644 --- a/trunk/arch/mips/sgi-ip27/ip27-klnuma.c +++ b/trunk/arch/mips/sgi-ip27/ip27-klnuma.c @@ -3,6 +3,7 @@ * Copyright 2000 - 2001 Silicon Graphics, Inc. * Copyright 2000 - 2001 Kanoj Sarcar (kanoj@sgi.com) */ +#include #include #include #include diff --git a/trunk/arch/mips/sgi-ip27/ip27-memory.c b/trunk/arch/mips/sgi-ip27/ip27-memory.c index efe6971fc800..6c00dce9f73f 100644 --- a/trunk/arch/mips/sgi-ip27/ip27-memory.c +++ b/trunk/arch/mips/sgi-ip27/ip27-memory.c @@ -10,6 +10,7 @@ * On SGI IP27 the ARC memory configuration data is completly bogus but * alternate easier to use mechanisms are available. */ +#include #include #include #include diff --git a/trunk/arch/mips/sgi-ip27/ip27-reset.c b/trunk/arch/mips/sgi-ip27/ip27-reset.c index c17076108d47..4322db57d3c1 100644 --- a/trunk/arch/mips/sgi-ip27/ip27-reset.c +++ b/trunk/arch/mips/sgi-ip27/ip27-reset.c @@ -8,6 +8,7 @@ * Copyright (C) 1997, 1998, 1999, 2000, 06 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ +#include #include #include #include diff --git a/trunk/arch/mips/sgi-ip27/ip27-timer.c b/trunk/arch/mips/sgi-ip27/ip27-timer.c index 3ca614a851e5..1fb860c7ac6d 100644 --- a/trunk/arch/mips/sgi-ip27/ip27-timer.c +++ b/trunk/arch/mips/sgi-ip27/ip27-timer.c @@ -217,7 +217,7 @@ static struct hw_interrupt_type rt_irq_type = { static struct irqaction rt_irqaction = { .handler = ip27_rt_timer_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, .name = "timer" }; diff --git a/trunk/arch/mips/sgi-ip32/ip32-irq.c b/trunk/arch/mips/sgi-ip32/ip32-irq.c index 3b7e74b6222e..00b94aaf6371 100644 --- a/trunk/arch/mips/sgi-ip32/ip32-irq.c +++ b/trunk/arch/mips/sgi-ip32/ip32-irq.c @@ -125,9 +125,9 @@ extern irqreturn_t crime_memerr_intr (int irq, void *dev_id, extern irqreturn_t crime_cpuerr_intr (int irq, void *dev_id, struct pt_regs *regs); -struct irqaction memerr_irq = { crime_memerr_intr, IRQF_DISABLED, +struct irqaction memerr_irq = { crime_memerr_intr, SA_INTERRUPT, CPU_MASK_NONE, "CRIME memory error", NULL, NULL }; -struct irqaction cpuerr_irq = { crime_cpuerr_intr, IRQF_DISABLED, +struct irqaction cpuerr_irq = { crime_cpuerr_intr, SA_INTERRUPT, CPU_MASK_NONE, "CRIME CPU error", NULL, NULL }; /* @@ -316,9 +316,9 @@ static struct hw_interrupt_type ip32_macepci_interrupt = { MACEISA_KEYB_POLL_INT | \ MACEISA_MOUSE_INT | \ MACEISA_MOUSE_POLL_INT | \ - MACEIIRQF_TIMER0_INT | \ - MACEIIRQF_TIMER1_INT | \ - MACEIIRQF_TIMER2_INT) + MACEISA_TIMER0_INT | \ + MACEISA_TIMER1_INT | \ + MACEISA_TIMER2_INT) #define MACEISA_SUPERIO_INT (MACEISA_PARALLEL_INT | \ MACEISA_PAR_CTXA_INT | \ MACEISA_PAR_CTXB_INT | \ @@ -349,7 +349,7 @@ static void enable_maceisa_irq (unsigned int irq) case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ: crime_int = MACE_AUDIO_INT; break; - case MACEISA_RTC_IRQ ... MACEIIRQF_TIMER2_IRQ: + case MACEISA_RTC_IRQ ... MACEISA_TIMER2_IRQ: crime_int = MACE_MISC_INT; break; case MACEISA_PARALLEL_IRQ ... MACEISA_SERIAL2_RDMAOR_IRQ: diff --git a/trunk/arch/mips/sgi-ip32/ip32-setup.c b/trunk/arch/mips/sgi-ip32/ip32-setup.c index 240a2f981d08..acbdad06fac1 100644 --- a/trunk/arch/mips/sgi-ip32/ip32-setup.c +++ b/trunk/arch/mips/sgi-ip32/ip32-setup.c @@ -8,6 +8,7 @@ * Copyright (C) 2000 Harald Koerfgen * Copyright (C) 2002, 2003, 2005 Ilya A. Volynets */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/bcm1480/irq.c b/trunk/arch/mips/sibyte/bcm1480/irq.c index 29d3bbb5847d..610df40cb820 100644 --- a/trunk/arch/mips/sibyte/bcm1480/irq.c +++ b/trunk/arch/mips/sibyte/bcm1480/irq.c @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/bcm1480/setup.c b/trunk/arch/mips/sibyte/bcm1480/setup.c index 8236d0c48542..d90a0b87874c 100644 --- a/trunk/arch/mips/sibyte/bcm1480/setup.c +++ b/trunk/arch/mips/sibyte/bcm1480/setup.c @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/bcm1480/time.c b/trunk/arch/mips/sibyte/bcm1480/time.c index 7e088f6c4a86..efaf83efd2e4 100644 --- a/trunk/arch/mips/sibyte/bcm1480/time.c +++ b/trunk/arch/mips/sibyte/bcm1480/time.c @@ -25,6 +25,7 @@ * code to do general bookkeeping (e.g. update jiffies, run * bottom halves, etc.) */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/cfe/console.c b/trunk/arch/mips/sibyte/cfe/console.c index c6ec748175b0..7721100d0275 100644 --- a/trunk/arch/mips/sibyte/cfe/console.c +++ b/trunk/arch/mips/sibyte/cfe/console.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/cfe/setup.c b/trunk/arch/mips/sibyte/cfe/setup.c index 6e8952da6e2a..ea308029450e 100644 --- a/trunk/arch/mips/sibyte/cfe/setup.c +++ b/trunk/arch/mips/sibyte/cfe/setup.c @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/sb1250/bus_watcher.c b/trunk/arch/mips/sibyte/sb1250/bus_watcher.c index bb90649fbc48..482dee054e68 100644 --- a/trunk/arch/mips/sibyte/sb1250/bus_watcher.c +++ b/trunk/arch/mips/sibyte/sb1250/bus_watcher.c @@ -25,6 +25,7 @@ * /proc/bus_watcher if PROC_FS is on. */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/sb1250/irq.c b/trunk/arch/mips/sibyte/sb1250/irq.c index 1d280aabcf6a..fcc61940f1ff 100644 --- a/trunk/arch/mips/sibyte/sb1250/irq.c +++ b/trunk/arch/mips/sibyte/sb1250/irq.c @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/sb1250/prom.c b/trunk/arch/mips/sibyte/sb1250/prom.c index 3c33a4517bc3..742043f8d755 100644 --- a/trunk/arch/mips/sibyte/sb1250/prom.c +++ b/trunk/arch/mips/sibyte/sb1250/prom.c @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/sb1250/setup.c b/trunk/arch/mips/sibyte/sb1250/setup.c index d0ee1d5b8223..fde4751c84fe 100644 --- a/trunk/arch/mips/sibyte/sb1250/setup.c +++ b/trunk/arch/mips/sibyte/sb1250/setup.c @@ -15,6 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/sb1250/time.c b/trunk/arch/mips/sibyte/sb1250/time.c index 4b669dc86ef4..1588f6debd90 100644 --- a/trunk/arch/mips/sibyte/sb1250/time.c +++ b/trunk/arch/mips/sibyte/sb1250/time.c @@ -25,6 +25,7 @@ * code to do general bookkeeping (e.g. update jiffies, run * bottom halves, etc.) */ +#include #include #include #include diff --git a/trunk/arch/mips/sibyte/swarm/setup.c b/trunk/arch/mips/sibyte/swarm/setup.c index a9a6dbc06849..f9e694988cdf 100644 --- a/trunk/arch/mips/sibyte/swarm/setup.c +++ b/trunk/arch/mips/sibyte/swarm/setup.c @@ -21,6 +21,7 @@ * Setup code for the SWARM board */ +#include #include #include #include diff --git a/trunk/arch/mips/sni/setup.c b/trunk/arch/mips/sni/setup.c index 870486d6cd75..a050bb6ae704 100644 --- a/trunk/arch/mips/sni/setup.c +++ b/trunk/arch/mips/sni/setup.c @@ -7,6 +7,7 @@ * * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org) */ +#include #include #include #include diff --git a/trunk/arch/mips/tx4927/common/tx4927_irq.c b/trunk/arch/mips/tx4927/common/tx4927_irq.c index ae9d5653a863..a42be00483e6 100644 --- a/trunk/arch/mips/tx4927/common/tx4927_irq.c +++ b/trunk/arch/mips/tx4927/common/tx4927_irq.c @@ -23,6 +23,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/tx4927/common/tx4927_setup.c b/trunk/arch/mips/tx4927/common/tx4927_setup.c index 64a1b394b252..81a5acfe8c42 100644 --- a/trunk/arch/mips/tx4927/common/tx4927_setup.c +++ b/trunk/arch/mips/tx4927/common/tx4927_setup.c @@ -24,6 +24,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/trunk/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c index ec0a0de3083d..c67978b6dae4 100644 --- a/trunk/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c +++ b/trunk/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c @@ -111,6 +111,7 @@ SuperIO/PS2/Mouse, using INTR via ISA IRQ12 (mouse not currently supported) JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthBridge, JP4, JP5, JP6 */ +#include #include #include #include @@ -337,7 +338,7 @@ int toshiba_rbtx4927_irq_nested(int sw_irq) } //#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, 0, CPU_MASK_NONE, s, NULL, NULL } -#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, IRQF_SHARED, CPU_MASK_NONE, s, NULL, NULL } +#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, SA_SHIRQ, CPU_MASK_NONE, s, NULL, NULL } static struct irqaction toshiba_rbtx4927_irq_ioc_action = TOSHIBA_RBTX4927_PIC_ACTION(TOSHIBA_RBTX4927_IOC_NAME); #ifdef CONFIG_TOSHIBA_FPCIB0 diff --git a/trunk/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/trunk/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c index f0d70c476005..6dcf077f61a0 100644 --- a/trunk/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c +++ b/trunk/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c @@ -42,6 +42,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/mips/tx4938/toshiba_rbtx4938/prom.c b/trunk/arch/mips/tx4938/toshiba_rbtx4938/prom.c index e44daf30a7c1..7df8b32ba265 100644 --- a/trunk/arch/mips/tx4938/toshiba_rbtx4938/prom.c +++ b/trunk/arch/mips/tx4938/toshiba_rbtx4938/prom.c @@ -12,6 +12,7 @@ * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) */ +#include #include #include #include diff --git a/trunk/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/trunk/arch/mips/tx4938/toshiba_rbtx4938/setup.c index 66163ba452c8..96e833cd4c14 100644 --- a/trunk/arch/mips/tx4938/toshiba_rbtx4938/setup.c +++ b/trunk/arch/mips/tx4938/toshiba_rbtx4938/setup.c @@ -11,6 +11,7 @@ * * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) */ +#include #include #include #include diff --git a/trunk/arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c b/trunk/arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c index 89596e62f909..951a208ee9b3 100644 --- a/trunk/arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c +++ b/trunk/arch/mips/tx4938/toshiba_rbtx4938/spi_eeprom.c @@ -9,6 +9,7 @@ * * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) */ +#include #include #include #include diff --git a/trunk/arch/mips/vr41xx/nec-cmbvr4133/init.c b/trunk/arch/mips/vr41xx/nec-cmbvr4133/init.c index ae1af6b21c45..be590edb0b83 100644 --- a/trunk/arch/mips/vr41xx/nec-cmbvr4133/init.c +++ b/trunk/arch/mips/vr41xx/nec-cmbvr4133/init.c @@ -15,6 +15,7 @@ * Support for NEC-CMBVR4133 in 2.6 * Manish Lachwani (mlachwani@mvista.com) */ +#include #ifdef CONFIG_ROCKHOPPER #include diff --git a/trunk/arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c b/trunk/arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c index f45caccedc07..1f6b24ef8695 100644 --- a/trunk/arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c +++ b/trunk/arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c @@ -14,6 +14,7 @@ * Support for NEC-CMBVR4133 in 2.6 * Author: Manish Lachwani (mlachwani@mvista.com) */ +#include #include #include #include diff --git a/trunk/arch/mips/vr41xx/nec-cmbvr4133/setup.c b/trunk/arch/mips/vr41xx/nec-cmbvr4133/setup.c index b20b93b2b95e..53272a5c3cbe 100644 --- a/trunk/arch/mips/vr41xx/nec-cmbvr4133/setup.c +++ b/trunk/arch/mips/vr41xx/nec-cmbvr4133/setup.c @@ -14,6 +14,7 @@ * Support for CMBVR4133 board in 2.6 * Author: Manish Lachwani (mlachwani@mvista.com) */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/entry.S b/trunk/arch/parisc/kernel/entry.S index 95c1b8ec4289..630730c32a5a 100644 --- a/trunk/arch/parisc/kernel/entry.S +++ b/trunk/arch/parisc/kernel/entry.S @@ -22,6 +22,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include /* we have the following possibilities to act on an interruption: diff --git a/trunk/arch/parisc/kernel/irq.c b/trunk/arch/parisc/kernel/irq.c index 5b8803cc3d69..82fe6ba29727 100644 --- a/trunk/arch/parisc/kernel/irq.c +++ b/trunk/arch/parisc/kernel/irq.c @@ -22,6 +22,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include +#include #include #include #include @@ -366,14 +367,14 @@ void do_cpu_irq_mask(struct pt_regs *regs) static struct irqaction timer_action = { .handler = timer_interrupt, .name = "timer", - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, }; #ifdef CONFIG_SMP static struct irqaction ipi_action = { .handler = ipi_interrupt, .name = "IPI", - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, }; #endif diff --git a/trunk/arch/parisc/kernel/pacache.S b/trunk/arch/parisc/kernel/pacache.S index e81c9937d10a..f600556414d1 100644 --- a/trunk/arch/parisc/kernel/pacache.S +++ b/trunk/arch/parisc/kernel/pacache.S @@ -40,6 +40,7 @@ .level 2.0 #endif +#include #include #include diff --git a/trunk/arch/parisc/kernel/parisc_ksyms.c b/trunk/arch/parisc/kernel/parisc_ksyms.c index 6d57553d8ef8..fc107add627c 100644 --- a/trunk/arch/parisc/kernel/parisc_ksyms.c +++ b/trunk/arch/parisc/kernel/parisc_ksyms.c @@ -24,6 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/pci.c b/trunk/arch/parisc/kernel/pci.c index d3b8fc52dfc1..7d6967ee367c 100644 --- a/trunk/arch/parisc/kernel/pci.c +++ b/trunk/arch/parisc/kernel/pci.c @@ -9,6 +9,7 @@ * Copyright (C) 1999-2001 Hewlett-Packard Company * Copyright (C) 1999-2001 Grant Grundler */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/pdc_cons.c b/trunk/arch/parisc/kernel/pdc_cons.c index ce78f412ff2e..215d78c87bc5 100644 --- a/trunk/arch/parisc/kernel/pdc_cons.c +++ b/trunk/arch/parisc/kernel/pdc_cons.c @@ -44,6 +44,7 @@ #define EARLY_BOOTUP_DEBUG +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/perf_asm.S b/trunk/arch/parisc/kernel/perf_asm.S index 5e7bb90e7e08..adb3c6444910 100644 --- a/trunk/arch/parisc/kernel/perf_asm.S +++ b/trunk/arch/parisc/kernel/perf_asm.S @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #ifdef CONFIG_64BIT diff --git a/trunk/arch/parisc/kernel/processor.c b/trunk/arch/parisc/kernel/processor.c index 99d7fca93104..6df9f62cecb5 100644 --- a/trunk/arch/parisc/kernel/processor.c +++ b/trunk/arch/parisc/kernel/processor.c @@ -26,6 +26,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/real2.S b/trunk/arch/parisc/kernel/real2.S index 789061f6ceb4..453d01a9f971 100644 --- a/trunk/arch/parisc/kernel/real2.S +++ b/trunk/arch/parisc/kernel/real2.S @@ -7,6 +7,7 @@ * Copyright (C) 2000 Hewlett Packard (Paul Bame bame@puffin.external.hp.com) * */ +#include #include #include diff --git a/trunk/arch/parisc/kernel/setup.c b/trunk/arch/parisc/kernel/setup.c index 3c7a3faf78ed..278f4b9f6a38 100644 --- a/trunk/arch/parisc/kernel/setup.c +++ b/trunk/arch/parisc/kernel/setup.c @@ -27,6 +27,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/smp.c b/trunk/arch/parisc/kernel/smp.c index 98e40959a564..d6ac1c60a471 100644 --- a/trunk/arch/parisc/kernel/smp.c +++ b/trunk/arch/parisc/kernel/smp.c @@ -18,6 +18,7 @@ */ #undef ENTRY_SYS_CPUS /* syscall support for iCOD-like functionality */ +#include #include #include diff --git a/trunk/arch/parisc/kernel/sys_parisc32.c b/trunk/arch/parisc/kernel/sys_parisc32.c index b74869803081..d286f68a3d3a 100644 --- a/trunk/arch/parisc/kernel/sys_parisc32.c +++ b/trunk/arch/parisc/kernel/sys_parisc32.c @@ -9,6 +9,7 @@ * environment. Based heavily on sys_ia32.c and sys_sparc32.c. */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/time.c b/trunk/arch/parisc/kernel/time.c index 5facc9bff4ef..eb35e1c0bb53 100644 --- a/trunk/arch/parisc/kernel/time.c +++ b/trunk/arch/parisc/kernel/time.c @@ -10,6 +10,7 @@ * 1998-12-20 Updated NTP code according to technical memorandum Jan '96 * "A Kernel Model for Precision Timekeeping" by Dave Mills */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/traps.c b/trunk/arch/parisc/kernel/traps.c index 77b28cb8aca6..348344a84bf7 100644 --- a/trunk/arch/parisc/kernel/traps.c +++ b/trunk/arch/parisc/kernel/traps.c @@ -10,6 +10,7 @@ * state in 'asm.s'. */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/unaligned.c b/trunk/arch/parisc/kernel/unaligned.c index bd2230d6a2a6..92328fbddb3e 100644 --- a/trunk/arch/parisc/kernel/unaligned.c +++ b/trunk/arch/parisc/kernel/unaligned.c @@ -20,6 +20,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/unwind.c b/trunk/arch/parisc/kernel/unwind.c index 920bdbf8404f..cc1c1afc3187 100644 --- a/trunk/arch/parisc/kernel/unwind.c +++ b/trunk/arch/parisc/kernel/unwind.c @@ -8,6 +8,7 @@ * understand what is happening here */ +#include #include #include #include diff --git a/trunk/arch/parisc/kernel/vmlinux.lds.S b/trunk/arch/parisc/kernel/vmlinux.lds.S index 9989495a51dd..94dcc03a28ed 100644 --- a/trunk/arch/parisc/kernel/vmlinux.lds.S +++ b/trunk/arch/parisc/kernel/vmlinux.lds.S @@ -23,6 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include /* needed for the processor specific cache alignment size */ #include diff --git a/trunk/arch/parisc/lib/bitops.c b/trunk/arch/parisc/lib/bitops.c index f352666b5b2f..90f400b10282 100644 --- a/trunk/arch/parisc/lib/bitops.c +++ b/trunk/arch/parisc/lib/bitops.c @@ -6,6 +6,7 @@ * Copyright 2000 Grant Grundler (grundler@cup.hp.com) */ +#include #include #include #include diff --git a/trunk/arch/parisc/lib/fixup.S b/trunk/arch/parisc/lib/fixup.S index ecce3d35401f..e0661c2978ed 100644 --- a/trunk/arch/parisc/lib/fixup.S +++ b/trunk/arch/parisc/lib/fixup.S @@ -19,6 +19,7 @@ * * Fixup routines for kernel exception handling. */ +#include #include #include #include diff --git a/trunk/arch/parisc/lib/memcpy.c b/trunk/arch/parisc/lib/memcpy.c index 5575e41f9d60..b7098035321f 100644 --- a/trunk/arch/parisc/lib/memcpy.c +++ b/trunk/arch/parisc/lib/memcpy.c @@ -53,6 +53,7 @@ */ #ifdef __KERNEL__ +#include #include #include #include diff --git a/trunk/arch/parisc/mm/init.c b/trunk/arch/parisc/mm/init.c index f2b96f1e0da7..631712562656 100644 --- a/trunk/arch/parisc/mm/init.c +++ b/trunk/arch/parisc/mm/init.c @@ -10,6 +10,7 @@ * */ +#include #include #include @@ -27,7 +28,6 @@ #include #include #include -#include DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); @@ -418,10 +418,11 @@ void free_initmem(void) #ifdef CONFIG_DEBUG_RODATA void mark_rodata_ro(void) { + extern char __start_rodata, __end_rodata; /* rodata memory was already mapped with KERNEL_RO access rights by pagetable_init() and map_pages(). No need to do additional stuff here */ printk (KERN_INFO "Write protecting the kernel read-only data: %luk\n", - (unsigned long)(__end_rodata - __start_rodata) >> 10); + (unsigned long)(&__end_rodata - &__start_rodata) >> 10); } #endif diff --git a/trunk/arch/powerpc/configs/chrp32_defconfig b/trunk/arch/powerpc/configs/chrp32_defconfig deleted file mode 100644 index 0fa010a63a8e..000000000000 --- a/trunk/arch/powerpc/configs/chrp32_defconfig +++ /dev/null @@ -1,1378 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.17 -# Mon Jul 3 12:08:41 2006 -# -# CONFIG_PPC64 is not set -CONFIG_PPC32=y -CONFIG_PPC_MERGE=y -CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_FIND_NEXT_BIT=y -CONFIG_PPC=y -CONFIG_EARLY_PRINTK=y -CONFIG_GENERIC_NVRAM=y -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_PPC_OF=y -CONFIG_PPC_UDBG_16550=y -CONFIG_GENERIC_TBSYNC=y -# CONFIG_DEFAULT_UIMAGE is not set - -# -# Processor support -# -CONFIG_CLASSIC32=y -# CONFIG_PPC_52xx is not set -# CONFIG_PPC_82xx is not set -# CONFIG_PPC_83xx is not set -# CONFIG_PPC_85xx is not set -# CONFIG_PPC_86xx is not set -# CONFIG_40x is not set -# CONFIG_44x is not set -# CONFIG_8xx is not set -# CONFIG_E200 is not set -CONFIG_6xx=y -CONFIG_PPC_FPU=y -# CONFIG_ALTIVEC is not set -CONFIG_PPC_STD_MMU=y -CONFIG_PPC_STD_MMU_32=y -CONFIG_SMP=y -CONFIG_NR_CPUS=4 - -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_LOCK_KERNEL=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_POSIX_MQUEUE=y -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -# CONFIG_CPUSETS is not set -# CONFIG_RELAY is not set -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -# CONFIG_EMBEDDED is not set -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SHMEM=y -CONFIG_SLAB=y -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 -# CONFIG_SLOB is not set - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -CONFIG_MODULE_FORCE_UNLOAD=y -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_KMOD=y -CONFIG_STOP_MACHINE=y - -# -# Block layer -# -CONFIG_LBD=y -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - -# -# Platform support -# -CONFIG_PPC_MULTIPLATFORM=y -# CONFIG_PPC_ISERIES is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_APUS is not set -CONFIG_PPC_CHRP=y -# CONFIG_PPC_PMAC is not set -# CONFIG_PPC_CELL is not set -# CONFIG_PPC_CELL_NATIVE is not set -CONFIG_MPIC=y -CONFIG_PPC_RTAS=y -# CONFIG_RTAS_ERROR_LOGGING is not set -CONFIG_RTAS_PROC=y -# CONFIG_MMIO_NVRAM is not set -CONFIG_PPC_MPC106=y -# CONFIG_PPC_970_NAP is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_TAU is not set -# CONFIG_WANT_EARLY_SERIAL is not set - -# -# Kernel options -# -CONFIG_HIGHMEM=y -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -CONFIG_PREEMPT_BKL=y -CONFIG_BINFMT_ELF=y -CONFIG_BINFMT_MISC=y -# CONFIG_KEXEC is not set -CONFIG_IRQ_ALL_CPUS=y -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -CONFIG_PROC_DEVICETREE=y -# CONFIG_CMDLINE_BOOL is not set -# CONFIG_PM is not set -CONFIG_SECCOMP=y -CONFIG_ISA_DMA_API=y - -# -# Bus options -# -CONFIG_ISA=y -CONFIG_GENERIC_ISA_DMA=y -CONFIG_PPC_I8259=y -CONFIG_PPC_INDIRECT_PCI=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -# CONFIG_PCIEPORTBUS is not set -# CONFIG_PCI_DEBUG is not set - -# -# PCCARD (PCMCIA/CardBus) support -# -# CONFIG_PCCARD is not set - -# -# PCI Hotplug Support -# -# CONFIG_HOTPLUG_PCI is not set - -# -# Advanced setup -# -# CONFIG_ADVANCED_OPTIONS is not set - -# -# Default settings for advanced configuration options are used -# -CONFIG_HIGHMEM_START=0xfe000000 -CONFIG_LOWMEM_SIZE=0x30000000 -CONFIG_KERNEL_START=0xc0000000 -CONFIG_TASK_SIZE=0x80000000 -CONFIG_BOOT_LOAD=0x00800000 - -# -# Networking -# -CONFIG_NET=y - -# -# Networking options -# -# CONFIG_NETDEBUG is not set -CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set -CONFIG_UNIX=y -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_FIB_HASH=y -# CONFIG_IP_PNP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_BIC=y - -# -# IP: Virtual Server Configuration -# -# CONFIG_IP_VS is not set -# CONFIG_IPV6 is not set -# CONFIG_INET6_XFRM_TUNNEL is not set -# CONFIG_INET6_TUNNEL is not set -# CONFIG_NETWORK_SECMARK is not set -CONFIG_NETFILTER=y -# CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# -# CONFIG_NETFILTER_NETLINK is not set -# CONFIG_NETFILTER_XTABLES is not set - -# -# IP: Netfilter Configuration -# -CONFIG_IP_NF_CONNTRACK=m -# CONFIG_IP_NF_CT_ACCT is not set -# CONFIG_IP_NF_CONNTRACK_MARK is not set -# CONFIG_IP_NF_CONNTRACK_EVENTS is not set -# CONFIG_IP_NF_CT_PROTO_SCTP is not set -CONFIG_IP_NF_FTP=m -CONFIG_IP_NF_IRC=m -# CONFIG_IP_NF_NETBIOS_NS is not set -CONFIG_IP_NF_TFTP=m -CONFIG_IP_NF_AMANDA=m -# CONFIG_IP_NF_PPTP is not set -# CONFIG_IP_NF_H323 is not set -# CONFIG_IP_NF_SIP is not set -# CONFIG_IP_NF_QUEUE is not set - -# -# DCCP Configuration (EXPERIMENTAL) -# -# CONFIG_IP_DCCP is not set - -# -# SCTP Configuration (EXPERIMENTAL) -# -# CONFIG_IP_SCTP is not set - -# -# TIPC Configuration (EXPERIMENTAL) -# -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_NET_DIVERT is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# -# CONFIG_NET_SCHED is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_IEEE80211 is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -# CONFIG_STANDALONE is not set -CONFIG_PREVENT_FIRMWARE_BUILD=y -# CONFIG_FW_LOADER is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_SYS_HYPERVISOR is not set - -# -# Connector - unified userspace <-> kernelspace linker -# -# CONFIG_CONNECTOR is not set - -# -# Memory Technology Devices (MTD) -# -# CONFIG_MTD is not set - -# -# Parallel port support -# -# CONFIG_PARPORT is not set - -# -# Plug and Play support -# -# CONFIG_PNP is not set - -# -# Block devices -# -CONFIG_BLK_DEV_FD=y -# CONFIG_BLK_DEV_XD is not set -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_UB is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=4096 -CONFIG_BLK_DEV_INITRD=y -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set - -# -# ATA/ATAPI/MFM/RLL support -# -CONFIG_IDE=y -CONFIG_BLK_DEV_IDE=y - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# -# CONFIG_BLK_DEV_IDE_SATA is not set -CONFIG_BLK_DEV_IDEDISK=y -CONFIG_IDEDISK_MULTI_MODE=y -CONFIG_BLK_DEV_IDECD=y -# CONFIG_BLK_DEV_IDETAPE is not set -# CONFIG_BLK_DEV_IDEFLOPPY is not set -# CONFIG_BLK_DEV_IDESCSI is not set -# CONFIG_IDE_TASK_IOCTL is not set - -# -# IDE chipset support/bugfixes -# -CONFIG_IDE_GENERIC=y -CONFIG_BLK_DEV_IDEPCI=y -CONFIG_IDEPCI_SHARE_IRQ=y -# CONFIG_BLK_DEV_OFFBOARD is not set -CONFIG_BLK_DEV_GENERIC=y -# CONFIG_BLK_DEV_OPTI621 is not set -CONFIG_BLK_DEV_SL82C105=y -CONFIG_BLK_DEV_IDEDMA_PCI=y -# CONFIG_BLK_DEV_IDEDMA_FORCED is not set -CONFIG_IDEDMA_PCI_AUTO=y -# CONFIG_IDEDMA_ONLYDISK is not set -# CONFIG_BLK_DEV_AEC62XX is not set -# CONFIG_BLK_DEV_ALI15X3 is not set -# CONFIG_BLK_DEV_AMD74XX is not set -# CONFIG_BLK_DEV_CMD64X is not set -# CONFIG_BLK_DEV_TRIFLEX is not set -# CONFIG_BLK_DEV_CY82C693 is not set -# CONFIG_BLK_DEV_CS5520 is not set -# CONFIG_BLK_DEV_CS5530 is not set -# CONFIG_BLK_DEV_HPT34X is not set -# CONFIG_BLK_DEV_HPT366 is not set -# CONFIG_BLK_DEV_SC1200 is not set -# CONFIG_BLK_DEV_PIIX is not set -# CONFIG_BLK_DEV_IT821X is not set -# CONFIG_BLK_DEV_NS87415 is not set -# CONFIG_BLK_DEV_PDC202XX_OLD is not set -# CONFIG_BLK_DEV_PDC202XX_NEW is not set -# CONFIG_BLK_DEV_SVWKS is not set -# CONFIG_BLK_DEV_SIIMAGE is not set -# CONFIG_BLK_DEV_SLC90E66 is not set -# CONFIG_BLK_DEV_TRM290 is not set -CONFIG_BLK_DEV_VIA82CXXX=y -# CONFIG_IDE_ARM is not set -# CONFIG_IDE_CHIPSETS is not set -CONFIG_BLK_DEV_IDEDMA=y -# CONFIG_IDEDMA_IVB is not set -CONFIG_IDEDMA_AUTO=y -# CONFIG_BLK_DEV_HD is not set - -# -# SCSI device support -# -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -CONFIG_CHR_DEV_ST=y -# CONFIG_CHR_DEV_OSST is not set -CONFIG_BLK_DEV_SR=y -CONFIG_BLK_DEV_SR_VENDOR=y -CONFIG_CHR_DEV_SG=y -# CONFIG_CHR_DEV_SCH is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# -# CONFIG_SCSI_MULTI_LUN is not set -CONFIG_SCSI_CONSTANTS=y -# CONFIG_SCSI_LOGGING is not set - -# -# SCSI Transport Attributes -# -CONFIG_SCSI_SPI_ATTRS=y -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set - -# -# SCSI low-level drivers -# -# CONFIG_ISCSI_TCP is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_7000FASST is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_AHA152X is not set -# CONFIG_SCSI_AHA1542 is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC7XXX_OLD is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_IN2000 is not set -# CONFIG_MEGARAID_NEWGEN is not set -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set -# CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_DTC3280 is not set -# CONFIG_SCSI_EATA is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_GDTH is not set -# CONFIG_SCSI_GENERIC_NCR5380 is not set -# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set -# CONFIG_SCSI_IPS is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_NCR53C406A is not set -CONFIG_SCSI_SYM53C8XX_2=y -CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 -CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 -CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 -CONFIG_SCSI_SYM53C8XX_MMIO=y -# CONFIG_SCSI_IPR is not set -# CONFIG_SCSI_PAS16 is not set -# CONFIG_SCSI_PSI240I is not set -# CONFIG_SCSI_QLOGIC_FAS is not set -# CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLA_FC is not set -# CONFIG_SCSI_LPFC is not set -# CONFIG_SCSI_SYM53C416 is not set -# CONFIG_SCSI_DC395x is not set -# CONFIG_SCSI_DC390T is not set -# CONFIG_SCSI_T128 is not set -# CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_NSP32 is not set -# CONFIG_SCSI_DEBUG is not set - -# -# Old CD-ROM drivers (not SCSI, not IDE) -# -# CONFIG_CD_NO_IDESCSI is not set - -# -# Multi-device support (RAID and LVM) -# -# CONFIG_MD is not set - -# -# Fusion MPT device support -# -# CONFIG_FUSION is not set -# CONFIG_FUSION_SPI is not set -# CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set - -# -# IEEE 1394 (FireWire) support -# -# CONFIG_IEEE1394 is not set - -# -# I2O device support -# -# CONFIG_I2O is not set - -# -# Macintosh device drivers -# -# CONFIG_WINDFARM is not set - -# -# Network device support -# -CONFIG_NETDEVICES=y -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set - -# -# ARCnet devices -# -# CONFIG_ARCNET is not set - -# -# PHY device support -# -# CONFIG_PHYLIB is not set - -# -# Ethernet (10 or 100Mbit) -# -CONFIG_NET_ETHERNET=y -CONFIG_MII=y -# CONFIG_HAPPYMEAL is not set -# CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_LANCE is not set -# CONFIG_NET_VENDOR_SMC is not set -# CONFIG_NET_VENDOR_RACAL is not set - -# -# Tulip family network device support -# -CONFIG_NET_TULIP=y -# CONFIG_DE2104X is not set -# CONFIG_TULIP is not set -CONFIG_DE4X5=y -# CONFIG_WINBOND_840 is not set -# CONFIG_DM9102 is not set -# CONFIG_ULI526X is not set -# CONFIG_AT1700 is not set -# CONFIG_DEPCA is not set -# CONFIG_HP100 is not set -# CONFIG_NET_ISA is not set -CONFIG_NET_PCI=y -CONFIG_PCNET32=y -# CONFIG_AMD8111_ETH is not set -# CONFIG_ADAPTEC_STARFIRE is not set -# CONFIG_AC3200 is not set -# CONFIG_APRICOT is not set -# CONFIG_B44 is not set -# CONFIG_FORCEDETH is not set -# CONFIG_CS89x0 is not set -# CONFIG_DGRS is not set -# CONFIG_EEPRO100 is not set -# CONFIG_E100 is not set -# CONFIG_FEALNX is not set -# CONFIG_NATSEMI is not set -# CONFIG_NE2K_PCI is not set -CONFIG_8139CP=y -CONFIG_8139TOO=y -# CONFIG_8139TOO_PIO is not set -# CONFIG_8139TOO_TUNE_TWISTER is not set -# CONFIG_8139TOO_8129 is not set -# CONFIG_8139_OLD_RX_RESET is not set -# CONFIG_SIS900 is not set -# CONFIG_EPIC100 is not set -# CONFIG_SUNDANCE is not set -# CONFIG_TLAN is not set -CONFIG_VIA_RHINE=y -# CONFIG_VIA_RHINE_MMIO is not set - -# -# Ethernet (1000 Mbit) -# -# CONFIG_ACENIC is not set -# CONFIG_DL2K is not set -# CONFIG_E1000 is not set -# CONFIG_NS83820 is not set -# CONFIG_HAMACHI is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_R8169 is not set -# CONFIG_SIS190 is not set -# CONFIG_SKGE is not set -# CONFIG_SKY2 is not set -# CONFIG_SK98LIN is not set -# CONFIG_VIA_VELOCITY is not set -# CONFIG_TIGON3 is not set -# CONFIG_BNX2 is not set -CONFIG_MV643XX_ETH=y -# CONFIG_MV643XX_ETH_0 is not set -# CONFIG_MV643XX_ETH_1 is not set -# CONFIG_MV643XX_ETH_2 is not set - -# -# Ethernet (10000 Mbit) -# -# CONFIG_CHELSIO_T1 is not set -# CONFIG_IXGB is not set -# CONFIG_S2IO is not set -# CONFIG_MYRI10GE is not set - -# -# Token Ring devices -# -# CONFIG_TR is not set - -# -# Wireless LAN (non-hamradio) -# -# CONFIG_NET_RADIO is not set - -# -# Wan interfaces -# -# CONFIG_WAN is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -CONFIG_PPP=m -CONFIG_PPP_MULTILINK=y -CONFIG_PPP_FILTER=y -CONFIG_PPP_ASYNC=m -CONFIG_PPP_SYNC_TTY=m -CONFIG_PPP_DEFLATE=m -CONFIG_PPP_BSDCOMP=m -CONFIG_PPP_MPPE=m -CONFIG_PPPOE=m -# CONFIG_SLIP is not set -# CONFIG_NET_FC is not set -# CONFIG_SHAPER is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set - -# -# ISDN subsystem -# -# CONFIG_ISDN is not set - -# -# Telephony Support -# -# CONFIG_PHONE is not set - -# -# Input device support -# -CONFIG_INPUT=y - -# -# Userland interfaces -# -CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_TSDEV is not set -CONFIG_INPUT_EVDEV=y -# CONFIG_INPUT_EVBUG is not set - -# -# Input Device Drivers -# -CONFIG_INPUT_KEYBOARD=y -CONFIG_KEYBOARD_ATKBD=y -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYBOARD_NEWTON is not set -CONFIG_INPUT_MOUSE=y -CONFIG_MOUSE_PS2=y -# CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_INPORT is not set -# CONFIG_MOUSE_LOGIBM is not set -# CONFIG_MOUSE_PC110PAD is not set -# CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -CONFIG_INPUT_MISC=y -# CONFIG_INPUT_PCSPKR is not set -CONFIG_INPUT_UINPUT=y - -# -# Hardware I/O ports -# -CONFIG_SERIO=y -CONFIG_SERIO_I8042=y -CONFIG_SERIO_SERPORT=y -# CONFIG_SERIO_PCIPS2 is not set -CONFIG_SERIO_LIBPS2=y -# CONFIG_SERIO_RAW is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_HW_CONSOLE=y -# CONFIG_SERIAL_NONSTANDARD is not set - -# -# Serial drivers -# -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set - -# -# Non-8250 serial port support -# -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set -CONFIG_UNIX98_PTYS=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_HVC_RTAS is not set - -# -# IPMI -# -# CONFIG_IPMI_HANDLER is not set - -# -# Watchdog Cards -# -# CONFIG_WATCHDOG is not set -CONFIG_NVRAM=y -CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set -# CONFIG_DTLK is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set - -# -# Ftape, the floppy tape device driver -# -# CONFIG_AGP is not set -# CONFIG_DRM is not set -# CONFIG_RAW_DRIVER is not set - -# -# TPM devices -# -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set - -# -# I2C support -# -CONFIG_I2C=y -# CONFIG_I2C_CHARDEV is not set - -# -# I2C Algorithms -# -CONFIG_I2C_ALGOBIT=y -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALGOPCA is not set - -# -# I2C Hardware Bus support -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_HYDRA is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_I810 is not set -# CONFIG_I2C_PIIX4 is not set -# CONFIG_I2C_MPC is not set -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_PROSAVAGE is not set -# CONFIG_I2C_SAVAGE4 is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_VOODOO3 is not set -# CONFIG_I2C_PCA_ISA is not set - -# -# Miscellaneous I2C Chip support -# -# CONFIG_SENSORS_DS1337 is not set -# CONFIG_SENSORS_DS1374 is not set -# CONFIG_SENSORS_EEPROM is not set -# CONFIG_SENSORS_PCF8574 is not set -# CONFIG_SENSORS_PCA9539 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_M41T00 is not set -# CONFIG_SENSORS_MAX6875 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set - -# -# SPI support -# -# CONFIG_SPI is not set -# CONFIG_SPI_MASTER is not set - -# -# Dallas's 1-wire bus -# - -# -# Hardware Monitoring support -# -# CONFIG_HWMON is not set -# CONFIG_HWMON_VID is not set - -# -# Misc devices -# - -# -# Multimedia devices -# -# CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y - -# -# Digital Video Broadcasting Devices -# -# CONFIG_DVB is not set -# CONFIG_USB_DABUSB is not set - -# -# Graphics support -# -CONFIG_FB=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_MACMODES=y -CONFIG_FB_FIRMWARE_EDID=y -# CONFIG_FB_BACKLIGHT is not set -CONFIG_FB_MODE_HELPERS=y -CONFIG_FB_TILEBLITTING=y -# CONFIG_FB_CIRRUS is not set -# CONFIG_FB_PM2 is not set -# CONFIG_FB_CYBER2000 is not set -CONFIG_FB_OF=y -# CONFIG_FB_CT65550 is not set -# CONFIG_FB_ASILIANT is not set -# CONFIG_FB_IMSTT is not set -# CONFIG_FB_VGA16 is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_NVIDIA is not set -# CONFIG_FB_RIVA is not set -CONFIG_FB_MATROX=y -CONFIG_FB_MATROX_MILLENIUM=y -CONFIG_FB_MATROX_MYSTIQUE=y -CONFIG_FB_MATROX_G=y -# CONFIG_FB_MATROX_I2C is not set -# CONFIG_FB_MATROX_MULTIHEAD is not set -CONFIG_FB_RADEON=y -CONFIG_FB_RADEON_I2C=y -# CONFIG_FB_RADEON_DEBUG is not set -# CONFIG_FB_ATY128 is not set -CONFIG_FB_ATY=y -CONFIG_FB_ATY_CT=y -# CONFIG_FB_ATY_GENERIC_LCD is not set -CONFIG_FB_ATY_GX=y -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_SIS is not set -# CONFIG_FB_NEOMAGIC is not set -# CONFIG_FB_KYRO is not set -CONFIG_FB_3DFX=y -# CONFIG_FB_3DFX_ACCEL is not set -# CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_TRIDENT is not set -# CONFIG_FB_VIRTUAL is not set - -# -# Console display driver support -# -CONFIG_VGA_CONSOLE=y -# CONFIG_VGACON_SOFT_SCROLLBACK is not set -# CONFIG_MDA_CONSOLE is not set -CONFIG_DUMMY_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set -# CONFIG_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y - -# -# Logo configuration -# -CONFIG_LOGO=y -CONFIG_LOGO_LINUX_MONO=y -CONFIG_LOGO_LINUX_VGA16=y -CONFIG_LOGO_LINUX_CLUT224=y -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set - -# -# Sound -# -# CONFIG_SOUND is not set - -# -# USB support -# -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARCH_HAS_OHCI=y -CONFIG_USB_ARCH_HAS_EHCI=y -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set - -# -# Miscellaneous USB options -# -CONFIG_USB_DEVICEFS=y -# CONFIG_USB_BANDWIDTH is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG is not set - -# -# USB Host Controller Drivers -# -CONFIG_USB_EHCI_HCD=m -# CONFIG_USB_EHCI_SPLIT_ISO is not set -# CONFIG_USB_EHCI_ROOT_HUB_TT is not set -# CONFIG_USB_EHCI_TT_NEWSCHED is not set -# CONFIG_USB_ISP116X_HCD is not set -CONFIG_USB_OHCI_HCD=y -# CONFIG_USB_OHCI_BIG_ENDIAN is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_UHCI_HCD=y -# CONFIG_USB_SL811_HCD is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set - -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information -# -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_DPCM is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_ONETOUCH is not set -# CONFIG_USB_LIBUSUAL is not set - -# -# USB Input Devices -# -CONFIG_USB_HID=y -CONFIG_USB_HIDINPUT=y -# CONFIG_USB_HIDINPUT_POWERBOOK is not set -# CONFIG_HID_FF is not set -# CONFIG_USB_HIDDEV is not set -# CONFIG_USB_AIPTEK is not set -# CONFIG_USB_WACOM is not set -# CONFIG_USB_ACECAD is not set -# CONFIG_USB_KBTAB is not set -# CONFIG_USB_POWERMATE is not set -# CONFIG_USB_TOUCHSCREEN is not set -# CONFIG_USB_YEALINK is not set -# CONFIG_USB_XPAD is not set -# CONFIG_USB_ATI_REMOTE is not set -# CONFIG_USB_ATI_REMOTE2 is not set -# CONFIG_USB_KEYSPAN_REMOTE is not set -# CONFIG_USB_APPLETOUCH is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set -CONFIG_USB_MON=y - -# -# USB port drivers -# - -# -# USB Serial Converter support -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_AUERSWALD is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_PHIDGETKIT is not set -# CONFIG_USB_PHIDGETSERVO is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TEST is not set - -# -# USB DSL modem support -# - -# -# USB Gadget Support -# -# CONFIG_USB_GADGET is not set - -# -# MMC/SD Card support -# -# CONFIG_MMC is not set - -# -# LED devices -# -# CONFIG_NEW_LEDS is not set - -# -# LED drivers -# - -# -# LED Triggers -# - -# -# InfiniBand support -# -# CONFIG_INFINIBAND is not set - -# -# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) -# - -# -# Real Time Clock -# -# CONFIG_RTC_CLASS is not set - -# -# DMA Engine support -# -# CONFIG_DMA_ENGINE is not set - -# -# DMA Clients -# - -# -# DMA Devices -# - -# -# File systems -# -CONFIG_EXT2_FS=y -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -CONFIG_EXT3_FS_XATTR=y -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set -CONFIG_JBD=y -# CONFIG_JBD_DEBUG is not set -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_FS_POSIX_ACL is not set -# CONFIG_XFS_FS is not set -# CONFIG_OCFS2_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_ROMFS_FS is not set -CONFIG_INOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_QUOTA is not set -CONFIG_DNOTIFY=y -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set - -# -# CD-ROM/DVD Filesystems -# -CONFIG_ISO9660_FS=y -# CONFIG_JOLIET is not set -# CONFIG_ZISOFS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_HUGETLB_PAGE is not set -CONFIG_RAMFS=y -# CONFIG_CONFIGFS_FS is not set - -# -# Miscellaneous filesystems -# -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_CRAMFS is not set -# CONFIG_VXFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set - -# -# Network File Systems -# -# CONFIG_NFS_FS is not set -# CONFIG_NFSD is not set -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -# CONFIG_9P_FS is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -CONFIG_MAC_PARTITION=y -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -# CONFIG_EFI_PARTITION is not set - -# -# Native Language Support -# -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-1" -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -CONFIG_NLS_ASCII=y -CONFIG_NLS_ISO8859_1=m -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set - -# -# Library routines -# -CONFIG_CRC_CCITT=m -# CONFIG_CRC16 is not set -CONFIG_CRC32=y -# CONFIG_LIBCRC32C is not set -CONFIG_ZLIB_INFLATE=m -CONFIG_ZLIB_DEFLATE=m -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m - -# -# Instrumentation Support -# -# CONFIG_PROFILING is not set - -# -# Kernel hacking -# -# CONFIG_PRINTK_TIME is not set -CONFIG_MAGIC_SYSRQ=y -CONFIG_DEBUG_KERNEL=y -CONFIG_LOG_BUF_SHIFT=15 -CONFIG_DETECT_SOFTLOCKUP=y -# CONFIG_SCHEDSTATS is not set -# CONFIG_DEBUG_SLAB is not set -CONFIG_DEBUG_MUTEXES=y -# CONFIG_DEBUG_SPINLOCK is not set -CONFIG_DEBUG_SPINLOCK_SLEEP=y -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_HIGHMEM is not set -# CONFIG_DEBUG_INFO is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set -CONFIG_FORCED_INLINING=y -# CONFIG_RCU_TORTURE_TEST is not set -CONFIG_DEBUGGER=y -CONFIG_XMON=y -CONFIG_XMON_DEFAULT=y -# CONFIG_BDI_SWITCH is not set -# CONFIG_BOOTX_TEXT is not set -# CONFIG_PPC_EARLY_DEBUG is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY is not set - -# -# Cryptographic options -# -CONFIG_CRYPTO=y -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_MD4 is not set -# CONFIG_CRYPTO_MD5 is not set -CONFIG_CRYPTO_SHA1=m -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_DES is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_TWOFISH is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_AES is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -# CONFIG_CRYPTO_TEA is not set -CONFIG_CRYPTO_ARC4=m -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Hardware crypto devices -# diff --git a/trunk/arch/powerpc/configs/mpc834x_itx_defconfig b/trunk/arch/powerpc/configs/mpc834x_itx_defconfig deleted file mode 100644 index fc2d9789adc8..000000000000 --- a/trunk/arch/powerpc/configs/mpc834x_itx_defconfig +++ /dev/null @@ -1,1336 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.17 -# Fri Jun 30 17:53:25 2006 -# -# CONFIG_PPC64 is not set -CONFIG_PPC32=y -CONFIG_PPC_MERGE=y -CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y -CONFIG_IRQ_PER_CPU=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_FIND_NEXT_BIT=y -CONFIG_PPC=y -CONFIG_EARLY_PRINTK=y -CONFIG_GENERIC_NVRAM=y -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_PPC_OF=y -CONFIG_PPC_UDBG_16550=y -# CONFIG_GENERIC_TBSYNC is not set -CONFIG_DEFAULT_UIMAGE=y - -# -# Processor support -# -# CONFIG_CLASSIC32 is not set -# CONFIG_PPC_52xx is not set -# CONFIG_PPC_82xx is not set -CONFIG_PPC_83xx=y -# CONFIG_PPC_85xx is not set -# CONFIG_PPC_86xx is not set -# CONFIG_40x is not set -# CONFIG_44x is not set -# CONFIG_8xx is not set -# CONFIG_E200 is not set -CONFIG_6xx=y -CONFIG_83xx=y -CONFIG_PPC_FPU=y -CONFIG_PPC_STD_MMU=y -CONFIG_PPC_STD_MMU_32=y -# CONFIG_SMP is not set -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" - -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_IKCONFIG is not set -# CONFIG_RELAY is not set -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EMBEDDED=y -# CONFIG_KALLSYMS is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_BASE_FULL=y -CONFIG_RT_MUTEXES=y -CONFIG_FUTEX=y -# CONFIG_EPOLL is not set -CONFIG_SHMEM=y -CONFIG_SLAB=y -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 -# CONFIG_SLOB is not set - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -# CONFIG_KMOD is not set - -# -# Block layer -# -# CONFIG_LBD is not set -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" -CONFIG_PPC_GEN550=y -# CONFIG_WANT_EARLY_SERIAL is not set - -# -# Platform support -# -# CONFIG_MPC834x_SYS is not set -CONFIG_MPC834x_ITX=y -CONFIG_MPC834x=y - -# -# Kernel options -# -# CONFIG_HIGHMEM is not set -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_RESOURCES_64BIT is not set -CONFIG_PROC_DEVICETREE=y -# CONFIG_CMDLINE_BOOL is not set -# CONFIG_PM is not set -# CONFIG_SOFTWARE_SUSPEND is not set -CONFIG_SECCOMP=y -CONFIG_ISA_DMA_API=y - -# -# Bus options -# -CONFIG_GENERIC_ISA_DMA=y -# CONFIG_PPC_I8259 is not set -CONFIG_PPC_INDIRECT_PCI=y -CONFIG_FSL_SOC=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -# CONFIG_PCIEPORTBUS is not set -# CONFIG_PCI_DEBUG is not set - -# -# PCCARD (PCMCIA/CardBus) support -# -# CONFIG_PCCARD is not set - -# -# PCI Hotplug Support -# -# CONFIG_HOTPLUG_PCI is not set - -# -# Advanced setup -# -# CONFIG_ADVANCED_OPTIONS is not set - -# -# Default settings for advanced configuration options are used -# -CONFIG_HIGHMEM_START=0xfe000000 -CONFIG_LOWMEM_SIZE=0x30000000 -CONFIG_KERNEL_START=0xc0000000 -CONFIG_TASK_SIZE=0x80000000 -CONFIG_BOOT_LOAD=0x00800000 - -# -# Networking -# -CONFIG_NET=y - -# -# Networking options -# -# CONFIG_NETDEBUG is not set -CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set -CONFIG_UNIX=y -CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_FIB_HASH=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -# CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -CONFIG_INET_XFRM_MODE_TRANSPORT=y -CONFIG_INET_XFRM_MODE_TUNNEL=y -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_BIC=y -# CONFIG_IPV6 is not set -# CONFIG_INET6_XFRM_TUNNEL is not set -# CONFIG_INET6_TUNNEL is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETFILTER is not set - -# -# DCCP Configuration (EXPERIMENTAL) -# -# CONFIG_IP_DCCP is not set - -# -# SCTP Configuration (EXPERIMENTAL) -# -# CONFIG_IP_SCTP is not set - -# -# TIPC Configuration (EXPERIMENTAL) -# -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_NET_DIVERT is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# -# CONFIG_NET_SCHED is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_IEEE80211 is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -# CONFIG_FW_LOADER is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_SYS_HYPERVISOR is not set - -# -# Connector - unified userspace <-> kernelspace linker -# -# CONFIG_CONNECTOR is not set - -# -# Memory Technology Devices (MTD) -# -CONFIG_MTD=y -# CONFIG_MTD_DEBUG is not set -# CONFIG_MTD_CONCAT is not set -# CONFIG_MTD_PARTITIONS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_CHAR=y -# CONFIG_MTD_BLOCK is not set -# CONFIG_MTD_BLOCK_RO is not set -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set - -# -# RAM/ROM/Flash chip drivers -# -CONFIG_MTD_CFI=y -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_CFI_ADV_OPTIONS is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -# CONFIG_MTD_CFI_INTELEXT is not set -CONFIG_MTD_CFI_AMDSTD=y -# CONFIG_MTD_CFI_STAA is not set -CONFIG_MTD_CFI_UTIL=y -# CONFIG_MTD_RAM is not set -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set -# CONFIG_MTD_OBSOLETE_CHIPS is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_PHYSMAP=y -CONFIG_MTD_PHYSMAP_START=0xfe000000 -CONFIG_MTD_PHYSMAP_LEN=0x1000000 -CONFIG_MTD_PHYSMAP_BANKWIDTH=2 -# CONFIG_MTD_PLATRAM is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_PMC551 is not set -# CONFIG_MTD_DATAFLASH is not set -# CONFIG_MTD_M25P80 is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOC2001PLUS is not set - -# -# NAND Flash Device Drivers -# -# CONFIG_MTD_NAND is not set - -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - -# -# Parallel port support -# -# CONFIG_PARPORT is not set - -# -# Plug and Play support -# - -# -# Block devices -# -# CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_UB is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=32768 -CONFIG_BLK_DEV_INITRD=y -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set - -# -# ATA/ATAPI/MFM/RLL support -# -CONFIG_IDE=y -# CONFIG_BLK_DEV_IDE is not set -# CONFIG_BLK_DEV_HD_ONLY is not set -# CONFIG_BLK_DEV_HD is not set - -# -# SCSI device support -# -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -CONFIG_CHR_DEV_SG=y -# CONFIG_CHR_DEV_SCH is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set - -# -# SCSI Transport Attributes -# -CONFIG_SCSI_SPI_ATTRS=y -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set - -# -# SCSI low-level drivers -# -# CONFIG_ISCSI_TCP is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC7XXX_OLD is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_DPT_I2O is not set -# CONFIG_MEGARAID_NEWGEN is not set -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set -CONFIG_SCSI_SATA=y -# CONFIG_SCSI_SATA_AHCI is not set -# CONFIG_SCSI_SATA_SVW is not set -# CONFIG_SCSI_ATA_PIIX is not set -# CONFIG_SCSI_SATA_MV is not set -# CONFIG_SCSI_SATA_NV is not set -# CONFIG_SCSI_PDC_ADMA is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_SCSI_SATA_QSTOR is not set -# CONFIG_SCSI_SATA_PROMISE is not set -# CONFIG_SCSI_SATA_SX4 is not set -CONFIG_SCSI_SATA_SIL=y -# CONFIG_SCSI_SATA_SIL24 is not set -# CONFIG_SCSI_SATA_SIS is not set -# CONFIG_SCSI_SATA_ULI is not set -# CONFIG_SCSI_SATA_VIA is not set -# CONFIG_SCSI_SATA_VITESSE is not set -# CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_EATA is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_GDTH is not set -# CONFIG_SCSI_IPS is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set -# CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLA_FC is not set -# CONFIG_SCSI_LPFC is not set -# CONFIG_SCSI_DC395x is not set -# CONFIG_SCSI_DC390T is not set -# CONFIG_SCSI_NSP32 is not set -# CONFIG_SCSI_DEBUG is not set - -# -# Multi-device support (RAID and LVM) -# -CONFIG_MD=y -CONFIG_BLK_DEV_MD=y -CONFIG_MD_LINEAR=y -CONFIG_MD_RAID0=y -CONFIG_MD_RAID1=y -# CONFIG_MD_RAID10 is not set -# CONFIG_MD_RAID456 is not set -# CONFIG_MD_MULTIPATH is not set -# CONFIG_MD_FAULTY is not set -# CONFIG_BLK_DEV_DM is not set - -# -# Fusion MPT device support -# -# CONFIG_FUSION is not set -# CONFIG_FUSION_SPI is not set -# CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set - -# -# IEEE 1394 (FireWire) support -# -# CONFIG_IEEE1394 is not set - -# -# I2O device support -# -# CONFIG_I2O is not set - -# -# Macintosh device drivers -# -# CONFIG_WINDFARM is not set - -# -# Network device support -# -CONFIG_NETDEVICES=y -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set - -# -# ARCnet devices -# -# CONFIG_ARCNET is not set - -# -# PHY device support -# -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -# CONFIG_MARVELL_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_QSEMI_PHY is not set -# CONFIG_LXT_PHY is not set -CONFIG_CICADA_PHY=y -# CONFIG_VITESSE_PHY is not set -# CONFIG_SMSC_PHY is not set - -# -# Ethernet (10 or 100Mbit) -# -CONFIG_NET_ETHERNET=y -CONFIG_MII=y -# CONFIG_HAPPYMEAL is not set -# CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set -# CONFIG_NET_VENDOR_3COM is not set - -# -# Tulip family network device support -# -# CONFIG_NET_TULIP is not set -# CONFIG_HP100 is not set -CONFIG_NET_PCI=y -# CONFIG_PCNET32 is not set -# CONFIG_AMD8111_ETH is not set -# CONFIG_ADAPTEC_STARFIRE is not set -# CONFIG_B44 is not set -# CONFIG_FORCEDETH is not set -# CONFIG_DGRS is not set -# CONFIG_EEPRO100 is not set -CONFIG_E100=y -# CONFIG_FEALNX is not set -# CONFIG_NATSEMI is not set -# CONFIG_NE2K_PCI is not set -# CONFIG_8139CP is not set -# CONFIG_8139TOO is not set -# CONFIG_SIS900 is not set -# CONFIG_EPIC100 is not set -# CONFIG_SUNDANCE is not set -# CONFIG_TLAN is not set -# CONFIG_VIA_RHINE is not set - -# -# Ethernet (1000 Mbit) -# -# CONFIG_ACENIC is not set -# CONFIG_DL2K is not set -# CONFIG_E1000 is not set -# CONFIG_NS83820 is not set -# CONFIG_HAMACHI is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_R8169 is not set -# CONFIG_SIS190 is not set -# CONFIG_SKGE is not set -# CONFIG_SKY2 is not set -# CONFIG_SK98LIN is not set -# CONFIG_VIA_VELOCITY is not set -# CONFIG_TIGON3 is not set -# CONFIG_BNX2 is not set -CONFIG_GIANFAR=y -CONFIG_GFAR_NAPI=y - -# -# Ethernet (10000 Mbit) -# -# CONFIG_CHELSIO_T1 is not set -# CONFIG_IXGB is not set -# CONFIG_S2IO is not set -# CONFIG_MYRI10GE is not set - -# -# Token Ring devices -# -# CONFIG_TR is not set - -# -# Wireless LAN (non-hamradio) -# -# CONFIG_NET_RADIO is not set - -# -# Wan interfaces -# -# CONFIG_WAN is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set -# CONFIG_NET_FC is not set -# CONFIG_SHAPER is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set - -# -# ISDN subsystem -# -# CONFIG_ISDN is not set - -# -# Telephony Support -# -# CONFIG_PHONE is not set - -# -# Input device support -# -CONFIG_INPUT=y - -# -# Userland interfaces -# -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_TSDEV is not set -# CONFIG_INPUT_EVDEV is not set -# CONFIG_INPUT_EVBUG is not set - -# -# Input Device Drivers -# -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -# CONFIG_VT is not set -# CONFIG_SERIAL_NONSTANDARD is not set - -# -# Serial drivers -# -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set - -# -# Non-8250 serial port support -# -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set -CONFIG_UNIX98_PTYS=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 - -# -# IPMI -# -# CONFIG_IPMI_HANDLER is not set - -# -# Watchdog Cards -# -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -CONFIG_83xx_WDT=y - -# -# PCI-based Watchdog Cards -# -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_WDTPCI is not set - -# -# USB-based Watchdog Cards -# -# CONFIG_USBPCWATCHDOG is not set -CONFIG_HW_RANDOM=y -# CONFIG_NVRAM is not set -# CONFIG_GEN_RTC is not set -# CONFIG_DTLK is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set - -# -# Ftape, the floppy tape device driver -# -# CONFIG_AGP is not set -# CONFIG_DRM is not set -# CONFIG_RAW_DRIVER is not set - -# -# TPM devices -# -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set - -# -# I2C support -# -CONFIG_I2C=y -CONFIG_I2C_CHARDEV=y - -# -# I2C Algorithms -# -# CONFIG_I2C_ALGOBIT is not set -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALGOPCA is not set - -# -# I2C Hardware Bus support -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_I810 is not set -# CONFIG_I2C_PIIX4 is not set -CONFIG_I2C_MPC=y -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_PROSAVAGE is not set -# CONFIG_I2C_SAVAGE4 is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_VOODOO3 is not set -# CONFIG_I2C_PCA_ISA is not set - -# -# Miscellaneous I2C Chip support -# -# CONFIG_SENSORS_DS1337 is not set -# CONFIG_SENSORS_DS1374 is not set -# CONFIG_SENSORS_EEPROM is not set -# CONFIG_SENSORS_PCF8574 is not set -# CONFIG_SENSORS_PCA9539 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_M41T00 is not set -# CONFIG_SENSORS_MAX6875 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set - -# -# SPI support -# -CONFIG_SPI=y -# CONFIG_SPI_DEBUG is not set -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -CONFIG_SPI_BITBANG=y -CONFIG_SPI_MPC83xx=y - -# -# SPI Protocol Masters -# - -# -# Dallas's 1-wire bus -# - -# -# Hardware Monitoring support -# -CONFIG_HWMON=y -# CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_ABITUGURU is not set -# CONFIG_SENSORS_ADM1021 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ASB100 is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_FSCHER is not set -# CONFIG_SENSORS_FSCPOS is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM70 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_SIS5595 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_VIA686A is not set -# CONFIG_SENSORS_VT8231 is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set -# CONFIG_HWMON_DEBUG_CHIP is not set - -# -# Misc devices -# - -# -# Multimedia devices -# -# CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y - -# -# Digital Video Broadcasting Devices -# -# CONFIG_DVB is not set -# CONFIG_USB_DABUSB is not set - -# -# Graphics support -# -CONFIG_FIRMWARE_EDID=y -# CONFIG_FB is not set - -# -# Sound -# -# CONFIG_SOUND is not set - -# -# USB support -# -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARCH_HAS_OHCI=y -CONFIG_USB_ARCH_HAS_EHCI=y -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set - -# -# Miscellaneous USB options -# -CONFIG_USB_DEVICEFS=y -# CONFIG_USB_BANDWIDTH is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG is not set - -# -# USB Host Controller Drivers -# -CONFIG_USB_EHCI_HCD=y -# CONFIG_USB_EHCI_SPLIT_ISO is not set -# CONFIG_USB_EHCI_ROOT_HUB_TT is not set -# CONFIG_USB_EHCI_TT_NEWSCHED is not set -# CONFIG_USB_ISP116X_HCD is not set -CONFIG_USB_OHCI_HCD=y -# CONFIG_USB_OHCI_BIG_ENDIAN is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_UHCI_HCD=y -# CONFIG_USB_SL811_HCD is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set - -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information -# -CONFIG_USB_STORAGE=y -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_DPCM is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_LIBUSUAL is not set - -# -# USB Input Devices -# -# CONFIG_USB_HID is not set - -# -# USB HID Boot Protocol drivers -# -# CONFIG_USB_KBD is not set -# CONFIG_USB_MOUSE is not set -# CONFIG_USB_AIPTEK is not set -# CONFIG_USB_WACOM is not set -# CONFIG_USB_ACECAD is not set -# CONFIG_USB_KBTAB is not set -# CONFIG_USB_POWERMATE is not set -# CONFIG_USB_TOUCHSCREEN is not set -# CONFIG_USB_YEALINK is not set -# CONFIG_USB_XPAD is not set -# CONFIG_USB_ATI_REMOTE is not set -# CONFIG_USB_ATI_REMOTE2 is not set -# CONFIG_USB_KEYSPAN_REMOTE is not set -# CONFIG_USB_APPLETOUCH is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set -CONFIG_USB_MON=y - -# -# USB port drivers -# - -# -# USB Serial Converter support -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_AUERSWALD is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_PHIDGETKIT is not set -# CONFIG_USB_PHIDGETSERVO is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TEST is not set - -# -# USB DSL modem support -# - -# -# USB Gadget Support -# -CONFIG_USB_GADGET=y -# CONFIG_USB_GADGET_DEBUG_FILES is not set -CONFIG_USB_GADGET_SELECTED=y -CONFIG_USB_GADGET_NET2280=y -CONFIG_USB_NET2280=y -# CONFIG_USB_GADGET_PXA2XX is not set -# CONFIG_USB_GADGET_GOKU is not set -# CONFIG_USB_GADGET_LH7A40X is not set -# CONFIG_USB_GADGET_OMAP is not set -# CONFIG_USB_GADGET_AT91 is not set -# CONFIG_USB_GADGET_DUMMY_HCD is not set -CONFIG_USB_GADGET_DUALSPEED=y -# CONFIG_USB_ZERO is not set -CONFIG_USB_ETH=y -CONFIG_USB_ETH_RNDIS=y -# CONFIG_USB_GADGETFS is not set -# CONFIG_USB_FILE_STORAGE is not set -# CONFIG_USB_G_SERIAL is not set - -# -# MMC/SD Card support -# -# CONFIG_MMC is not set - -# -# LED devices -# -# CONFIG_NEW_LEDS is not set - -# -# LED drivers -# - -# -# LED Triggers -# - -# -# InfiniBand support -# -# CONFIG_INFINIBAND is not set - -# -# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) -# - -# -# Real Time Clock -# -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" - -# -# RTC interfaces -# -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -CONFIG_RTC_INTF_DEV_UIE_EMUL=y - -# -# RTC drivers -# -# CONFIG_RTC_DRV_X1205 is not set -CONFIG_RTC_DRV_DS1307=y -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_RS5C348 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_TEST is not set -# CONFIG_RTC_DRV_MAX6902 is not set -# CONFIG_RTC_DRV_V3020 is not set - -# -# DMA Engine support -# -CONFIG_DMA_ENGINE=y - -# -# DMA Clients -# -CONFIG_NET_DMA=y - -# -# DMA Devices -# -CONFIG_INTEL_IOATDMA=y - -# -# File systems -# -CONFIG_EXT2_FS=y -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -CONFIG_EXT3_FS_XATTR=y -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set -CONFIG_JBD=y -# CONFIG_JBD_DEBUG is not set -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_FS_POSIX_ACL is not set -# CONFIG_XFS_FS is not set -# CONFIG_OCFS2_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_ROMFS_FS is not set -CONFIG_INOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_QUOTA is not set -CONFIG_DNOTIFY=y -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -# CONFIG_MSDOS_FS is not set -# CONFIG_VFAT_FS is not set -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_HUGETLB_PAGE is not set -CONFIG_RAMFS=y -# CONFIG_CONFIGFS_FS is not set - -# -# Miscellaneous filesystems -# -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_JFFS_FS is not set -# CONFIG_JFFS2_FS is not set -# CONFIG_CRAMFS is not set -# CONFIG_VXFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set - -# -# Network File Systems -# -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -CONFIG_NFS_V4=y -# CONFIG_NFS_DIRECTIO is not set -# CONFIG_NFSD is not set -CONFIG_ROOT_NFS=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y -CONFIG_RPCSEC_GSS_KRB5=y -# CONFIG_RPCSEC_GSS_SPKM3 is not set -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set -# CONFIG_CIFS_DEBUG2 is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -# CONFIG_9P_FS is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -# CONFIG_MSDOS_PARTITION is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -# CONFIG_EFI_PARTITION is not set - -# -# Native Language Support -# -# CONFIG_NLS is not set - -# -# Library routines -# -# CONFIG_CRC_CCITT is not set -# CONFIG_CRC16 is not set -CONFIG_CRC32=y -# CONFIG_LIBCRC32C is not set -CONFIG_PLIST=y - -# -# Instrumentation Support -# -# CONFIG_PROFILING is not set - -# -# Kernel hacking -# -CONFIG_PRINTK_TIME=y -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_UNUSED_SYMBOLS is not set -CONFIG_DEBUG_KERNEL=y -CONFIG_LOG_BUF_SHIFT=17 -CONFIG_DETECT_SOFTLOCKUP=y -# CONFIG_SCHEDSTATS is not set -# CONFIG_DEBUG_SLAB is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set -# CONFIG_DEBUG_KOBJECT is not set -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set -CONFIG_FORCED_INLINING=y -# CONFIG_RCU_TORTURE_TEST is not set -# CONFIG_DEBUGGER is not set -# CONFIG_BDI_SWITCH is not set -CONFIG_BOOTX_TEXT=y -CONFIG_SERIAL_TEXT_DEBUG=y -# CONFIG_PPC_EARLY_DEBUG is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY is not set - -# -# Cryptographic options -# -CONFIG_CRYPTO=y -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_MD4 is not set -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_SHA1 is not set -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_TGR192 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_TWOFISH is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_AES is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_ARC4 is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Hardware crypto devices -# diff --git a/trunk/arch/powerpc/kernel/asm-offsets.c b/trunk/arch/powerpc/kernel/asm-offsets.c index 7ee84968087b..ff2940548929 100644 --- a/trunk/arch/powerpc/kernel/asm-offsets.c +++ b/trunk/arch/powerpc/kernel/asm-offsets.c @@ -13,6 +13,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/binfmt_elf32.c b/trunk/arch/powerpc/kernel/binfmt_elf32.c index 5cb58757e1b1..8ad6b0f33651 100644 --- a/trunk/arch/powerpc/kernel/binfmt_elf32.c +++ b/trunk/arch/powerpc/kernel/binfmt_elf32.c @@ -19,6 +19,7 @@ #include #include +#include #include #include diff --git a/trunk/arch/powerpc/kernel/btext.c b/trunk/arch/powerpc/kernel/btext.c index f4e5e14ee2b6..6223d39177cb 100644 --- a/trunk/arch/powerpc/kernel/btext.c +++ b/trunk/arch/powerpc/kernel/btext.c @@ -3,6 +3,7 @@ * * Benjamin Herrenschmidt */ +#include #include #include #include @@ -111,7 +112,7 @@ void __init btext_setup_display(int width, int height, int depth, int pitch, logicalDisplayBase = (unsigned char *)address; dispDeviceBase = (unsigned char *)address; dispDeviceRowBytes = pitch; - dispDeviceDepth = depth == 15 ? 16 : depth; + dispDeviceDepth = depth; dispDeviceRect[0] = dispDeviceRect[1] = 0; dispDeviceRect[2] = width; dispDeviceRect[3] = height; @@ -160,28 +161,20 @@ int btext_initialize(struct device_node *np) unsigned long address = 0; u32 *prop; - prop = (u32 *)get_property(np, "linux,bootx-width", NULL); - if (prop == NULL) - prop = (u32 *)get_property(np, "width", NULL); + prop = (u32 *)get_property(np, "width", NULL); if (prop == NULL) return -EINVAL; width = *prop; - prop = (u32 *)get_property(np, "linux,bootx-height", NULL); - if (prop == NULL) - prop = (u32 *)get_property(np, "height", NULL); + prop = (u32 *)get_property(np, "height", NULL); if (prop == NULL) return -EINVAL; height = *prop; - prop = (u32 *)get_property(np, "linux,bootx-depth", NULL); - if (prop == NULL) - prop = (u32 *)get_property(np, "depth", NULL); + prop = (u32 *)get_property(np, "depth", NULL); if (prop == NULL) return -EINVAL; depth = *prop; pitch = width * ((depth + 7) / 8); - prop = (u32 *)get_property(np, "linux,bootx-linebytes", NULL); - if (prop == NULL) - prop = (u32 *)get_property(np, "linebytes", NULL); + prop = (u32 *)get_property(np, "linebytes", NULL); if (prop) pitch = *prop; if (pitch == 1) @@ -202,7 +195,7 @@ int btext_initialize(struct device_node *np) g_max_loc_Y = height / 16; dispDeviceBase = (unsigned char *)address; dispDeviceRowBytes = pitch; - dispDeviceDepth = depth == 15 ? 16 : depth; + dispDeviceDepth = depth; dispDeviceRect[0] = dispDeviceRect[1] = 0; dispDeviceRect[2] = width; dispDeviceRect[3] = height; diff --git a/trunk/arch/powerpc/kernel/cpu_setup_6xx.S b/trunk/arch/powerpc/kernel/cpu_setup_6xx.S index 8b4a4ee85eca..365381fcb27c 100644 --- a/trunk/arch/powerpc/kernel/cpu_setup_6xx.S +++ b/trunk/arch/powerpc/kernel/cpu_setup_6xx.S @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/cpu_setup_power4.S b/trunk/arch/powerpc/kernel/cpu_setup_power4.S index f69af2c5d7b3..1fc863261003 100644 --- a/trunk/arch/powerpc/kernel/cpu_setup_power4.S +++ b/trunk/arch/powerpc/kernel/cpu_setup_power4.S @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/cputable.c b/trunk/arch/powerpc/kernel/cputable.c index 272e43622fd6..abf7d42a8b07 100644 --- a/trunk/arch/powerpc/kernel/cputable.c +++ b/trunk/arch/powerpc/kernel/cputable.c @@ -10,6 +10,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/entry_32.S b/trunk/arch/powerpc/kernel/entry_32.S index c03e829fee3c..8866fd26c6b9 100644 --- a/trunk/arch/powerpc/kernel/entry_32.S +++ b/trunk/arch/powerpc/kernel/entry_32.S @@ -19,6 +19,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/entry_64.S b/trunk/arch/powerpc/kernel/entry_64.S index 54d9f5cdaab4..221062c960c9 100644 --- a/trunk/arch/powerpc/kernel/entry_64.S +++ b/trunk/arch/powerpc/kernel/entry_64.S @@ -18,6 +18,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/firmware.c b/trunk/arch/powerpc/kernel/firmware.c index 1679a70bbcad..0bfe9061720a 100644 --- a/trunk/arch/powerpc/kernel/firmware.c +++ b/trunk/arch/powerpc/kernel/firmware.c @@ -13,6 +13,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include diff --git a/trunk/arch/powerpc/kernel/fpu.S b/trunk/arch/powerpc/kernel/fpu.S index 7e2c9fe44ac1..01f71200c603 100644 --- a/trunk/arch/powerpc/kernel/fpu.S +++ b/trunk/arch/powerpc/kernel/fpu.S @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/head_32.S b/trunk/arch/powerpc/kernel/head_32.S index d88e182e40b3..b25b25902d15 100644 --- a/trunk/arch/powerpc/kernel/head_32.S +++ b/trunk/arch/powerpc/kernel/head_32.S @@ -22,6 +22,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/head_44x.S b/trunk/arch/powerpc/kernel/head_44x.S index accb39d49911..47c7fa148c9a 100644 --- a/trunk/arch/powerpc/kernel/head_44x.S +++ b/trunk/arch/powerpc/kernel/head_44x.S @@ -28,6 +28,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/head_4xx.S b/trunk/arch/powerpc/kernel/head_4xx.S index adc7f8097cd4..2590e97f5539 100644 --- a/trunk/arch/powerpc/kernel/head_4xx.S +++ b/trunk/arch/powerpc/kernel/head_4xx.S @@ -31,6 +31,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/head_64.S b/trunk/arch/powerpc/kernel/head_64.S index e16eb2a33173..8cfd040d1f50 100644 --- a/trunk/arch/powerpc/kernel/head_64.S +++ b/trunk/arch/powerpc/kernel/head_64.S @@ -21,6 +21,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/head_8xx.S b/trunk/arch/powerpc/kernel/head_8xx.S index 901be47a02a9..28941f5ce673 100644 --- a/trunk/arch/powerpc/kernel/head_8xx.S +++ b/trunk/arch/powerpc/kernel/head_8xx.S @@ -19,6 +19,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/head_fsl_booke.S b/trunk/arch/powerpc/kernel/head_fsl_booke.S index 66877bdfe0b7..dd86bbed7627 100644 --- a/trunk/arch/powerpc/kernel/head_fsl_booke.S +++ b/trunk/arch/powerpc/kernel/head_fsl_booke.S @@ -30,6 +30,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/ibmebus.c b/trunk/arch/powerpc/kernel/ibmebus.c index 97ddc02a3d42..e47d40ac6f39 100644 --- a/trunk/arch/powerpc/kernel/ibmebus.c +++ b/trunk/arch/powerpc/kernel/ibmebus.c @@ -323,11 +323,13 @@ int ibmebus_request_irq(struct ibmebus_dev *dev, unsigned long irq_flags, const char * devname, void *dev_id) { - unsigned int irq = irq_create_mapping(NULL, ist, 0); + unsigned int irq = virt_irq_create_mapping(ist); if (irq == NO_IRQ) return -EINVAL; + irq = irq_offset_up(irq); + return request_irq(irq, handler, irq_flags, devname, dev_id); } @@ -335,9 +337,12 @@ EXPORT_SYMBOL(ibmebus_request_irq); void ibmebus_free_irq(struct ibmebus_dev *dev, u32 ist, void *dev_id) { - unsigned int irq = irq_find_mapping(NULL, ist); + unsigned int irq = virt_irq_create_mapping(ist); + irq = irq_offset_up(irq); free_irq(irq, dev_id); + + return; } EXPORT_SYMBOL(ibmebus_free_irq); diff --git a/trunk/arch/powerpc/kernel/idle.c b/trunk/arch/powerpc/kernel/idle.c index 4180c3998b39..d491052c8e0c 100644 --- a/trunk/arch/powerpc/kernel/idle.c +++ b/trunk/arch/powerpc/kernel/idle.c @@ -19,6 +19,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/idle_6xx.S b/trunk/arch/powerpc/kernel/idle_6xx.S index 01bcd52bbf8e..b45fa0e37212 100644 --- a/trunk/arch/powerpc/kernel/idle_6xx.S +++ b/trunk/arch/powerpc/kernel/idle_6xx.S @@ -13,6 +13,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/idle_power4.S b/trunk/arch/powerpc/kernel/idle_power4.S index 30de81da7b40..d85c7c938eed 100644 --- a/trunk/arch/powerpc/kernel/idle_power4.S +++ b/trunk/arch/powerpc/kernel/idle_power4.S @@ -7,6 +7,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/iommu.c b/trunk/arch/powerpc/kernel/iommu.c index ba0694071728..3d677ac99659 100644 --- a/trunk/arch/powerpc/kernel/iommu.c +++ b/trunk/arch/powerpc/kernel/iommu.c @@ -23,6 +23,7 @@ */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/irq.c b/trunk/arch/powerpc/kernel/irq.c index 8cf987809c66..24f6050aa4ab 100644 --- a/trunk/arch/powerpc/kernel/irq.c +++ b/trunk/arch/powerpc/kernel/irq.c @@ -29,8 +29,6 @@ * to reduce code space and undefined function references. */ -#undef DEBUG - #include #include #include @@ -40,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -48,10 +47,7 @@ #include #include #include -#include -#include -#include -#include +#include #include #include @@ -62,38 +58,39 @@ #include #include #include -#include #ifdef CONFIG_PPC_ISERIES #include #endif int __irq_offset_value; -static int ppc_spurious_interrupts; - #ifdef CONFIG_PPC32 EXPORT_SYMBOL(__irq_offset_value); -atomic_t ppc_n_lost_interrupts; +#endif + +static int ppc_spurious_interrupts; -#ifndef CONFIG_PPC_MERGE +#ifdef CONFIG_PPC32 #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) + unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; -#endif +atomic_t ppc_n_lost_interrupts; #ifdef CONFIG_TAU_INT extern int tau_initialized; extern int tau_interrupts(int); #endif -#endif /* CONFIG_PPC32 */ #if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE) extern atomic_t ipi_recv; extern atomic_t ipi_sent; #endif +#endif /* CONFIG_PPC32 */ #ifdef CONFIG_PPC64 EXPORT_SYMBOL(irq_desc); int distribute_irqs = 1; +u64 ppc64_interrupt_controller; #endif /* CONFIG_PPC64 */ int show_interrupts(struct seq_file *p, void *v) @@ -186,7 +183,7 @@ void fixup_irqs(cpumask_t map) void do_IRQ(struct pt_regs *regs) { - unsigned int irq; + int irq; #ifdef CONFIG_IRQSTACKS struct thread_info *curtp, *irqtp; #endif @@ -217,26 +214,22 @@ void do_IRQ(struct pt_regs *regs) */ irq = ppc_md.get_irq(regs); - if (irq != NO_IRQ && irq != NO_IRQ_IGNORE) { + if (irq >= 0) { #ifdef CONFIG_IRQSTACKS /* Switch to the irq stack to handle this */ curtp = current_thread_info(); irqtp = hardirq_ctx[smp_processor_id()]; if (curtp != irqtp) { - struct irq_desc *desc = irq_desc + irq; - void *handler = desc->handle_irq; - if (handler == NULL) - handler = &__do_IRQ; irqtp->task = curtp->task; irqtp->flags = 0; - call_handle_irq(irq, desc, regs, irqtp, handler); + call___do_IRQ(irq, regs, irqtp); irqtp->task = NULL; if (irqtp->flags) set_bits(irqtp->flags, &curtp->flags); } else #endif - generic_handle_irq(irq, regs); - } else if (irq != NO_IRQ_IGNORE) + __do_IRQ(irq, regs); + } else if (irq != -2) /* That's not SMP safe ... but who cares ? */ ppc_spurious_interrupts++; @@ -253,562 +246,196 @@ void do_IRQ(struct pt_regs *regs) void __init init_IRQ(void) { - ppc_md.init_IRQ(); #ifdef CONFIG_PPC64 - irq_ctx_init(); -#endif -} - - -#ifdef CONFIG_IRQSTACKS -struct thread_info *softirq_ctx[NR_CPUS] __read_mostly; -struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly; - -void irq_ctx_init(void) -{ - struct thread_info *tp; - int i; - - for_each_possible_cpu(i) { - memset((void *)softirq_ctx[i], 0, THREAD_SIZE); - tp = softirq_ctx[i]; - tp->cpu = i; - tp->preempt_count = SOFTIRQ_OFFSET; - - memset((void *)hardirq_ctx[i], 0, THREAD_SIZE); - tp = hardirq_ctx[i]; - tp->cpu = i; - tp->preempt_count = HARDIRQ_OFFSET; - } -} - -static inline void do_softirq_onstack(void) -{ - struct thread_info *curtp, *irqtp; - - curtp = current_thread_info(); - irqtp = softirq_ctx[smp_processor_id()]; - irqtp->task = curtp->task; - call_do_softirq(irqtp); - irqtp->task = NULL; -} + static int once = 0; -#else -#define do_softirq_onstack() __do_softirq() -#endif /* CONFIG_IRQSTACKS */ - -void do_softirq(void) -{ - unsigned long flags; - - if (in_interrupt()) + if (once) return; - local_irq_save(flags); + once++; - if (local_softirq_pending()) - do_softirq_onstack(); - - local_irq_restore(flags); +#endif + ppc_md.init_IRQ(); +#ifdef CONFIG_PPC64 + irq_ctx_init(); +#endif } -EXPORT_SYMBOL(do_softirq); - +#ifdef CONFIG_PPC64 /* - * IRQ controller and virtual interrupts + * Virtual IRQ mapping code, used on systems with XICS interrupt controllers. */ -#ifdef CONFIG_PPC_MERGE - -static LIST_HEAD(irq_hosts); -static spinlock_t irq_big_lock = SPIN_LOCK_UNLOCKED; - -struct irq_map_entry irq_map[NR_IRQS]; -static unsigned int irq_virq_count = NR_IRQS; -static struct irq_host *irq_default_host; +#define UNDEFINED_IRQ 0xffffffff +unsigned int virt_irq_to_real_map[NR_IRQS]; -struct irq_host *irq_alloc_host(unsigned int revmap_type, - unsigned int revmap_arg, - struct irq_host_ops *ops, - irq_hw_number_t inval_irq) -{ - struct irq_host *host; - unsigned int size = sizeof(struct irq_host); - unsigned int i; - unsigned int *rmap; - unsigned long flags; - - /* Allocate structure and revmap table if using linear mapping */ - if (revmap_type == IRQ_HOST_MAP_LINEAR) - size += revmap_arg * sizeof(unsigned int); - if (mem_init_done) - host = kzalloc(size, GFP_KERNEL); - else { - host = alloc_bootmem(size); - if (host) - memset(host, 0, size); - } - if (host == NULL) - return NULL; - - /* Fill structure */ - host->revmap_type = revmap_type; - host->inval_irq = inval_irq; - host->ops = ops; - - spin_lock_irqsave(&irq_big_lock, flags); - - /* If it's a legacy controller, check for duplicates and - * mark it as allocated (we use irq 0 host pointer for that - */ - if (revmap_type == IRQ_HOST_MAP_LEGACY) { - if (irq_map[0].host != NULL) { - spin_unlock_irqrestore(&irq_big_lock, flags); - /* If we are early boot, we can't free the structure, - * too bad... - * this will be fixed once slab is made available early - * instead of the current cruft - */ - if (mem_init_done) - kfree(host); - return NULL; - } - irq_map[0].host = host; - } - - list_add(&host->link, &irq_hosts); - spin_unlock_irqrestore(&irq_big_lock, flags); - - /* Additional setups per revmap type */ - switch(revmap_type) { - case IRQ_HOST_MAP_LEGACY: - /* 0 is always the invalid number for legacy */ - host->inval_irq = 0; - /* setup us as the host for all legacy interrupts */ - for (i = 1; i < NUM_ISA_INTERRUPTS; i++) { - irq_map[i].hwirq = 0; - smp_wmb(); - irq_map[i].host = host; - smp_wmb(); - - /* Clear some flags */ - get_irq_desc(i)->status - &= ~(IRQ_NOREQUEST | IRQ_LEVEL); - - /* Legacy flags are left to default at this point, - * one can then use irq_create_mapping() to - * explicitely change them - */ - ops->map(host, i, i, 0); - } - break; - case IRQ_HOST_MAP_LINEAR: - rmap = (unsigned int *)(host + 1); - for (i = 0; i < revmap_arg; i++) - rmap[i] = IRQ_NONE; - host->revmap_data.linear.size = revmap_arg; - smp_wmb(); - host->revmap_data.linear.revmap = rmap; - break; - default: - break; - } - - pr_debug("irq: Allocated host of type %d @0x%p\n", revmap_type, host); +/* + * Don't use virtual irqs 0, 1, 2 for devices. + * The pcnet32 driver considers interrupt numbers < 2 to be invalid, + * and 2 is the XICS IPI interrupt. + * We limit virtual irqs to __irq_offet_value less than virt_irq_max so + * that when we offset them we don't end up with an interrupt + * number >= virt_irq_max. + */ +#define MIN_VIRT_IRQ 3 - return host; -} +unsigned int virt_irq_max; +static unsigned int max_virt_irq; +static unsigned int nr_virt_irqs; -struct irq_host *irq_find_host(struct device_node *node) +void +virt_irq_init(void) { - struct irq_host *h, *found = NULL; - unsigned long flags; - - /* We might want to match the legacy controller last since - * it might potentially be set to match all interrupts in - * the absence of a device node. This isn't a problem so far - * yet though... - */ - spin_lock_irqsave(&irq_big_lock, flags); - list_for_each_entry(h, &irq_hosts, link) - if (h->ops->match == NULL || h->ops->match(h, node)) { - found = h; - break; - } - spin_unlock_irqrestore(&irq_big_lock, flags); - return found; -} -EXPORT_SYMBOL_GPL(irq_find_host); + int i; -void irq_set_default_host(struct irq_host *host) -{ - pr_debug("irq: Default host set to @0x%p\n", host); + if ((virt_irq_max == 0) || (virt_irq_max > (NR_IRQS - 1))) + virt_irq_max = NR_IRQS - 1; + max_virt_irq = virt_irq_max - __irq_offset_value; + nr_virt_irqs = max_virt_irq - MIN_VIRT_IRQ + 1; - irq_default_host = host; + for (i = 0; i < NR_IRQS; i++) + virt_irq_to_real_map[i] = UNDEFINED_IRQ; } -void irq_set_virq_count(unsigned int count) +/* Create a mapping for a real_irq if it doesn't already exist. + * Return the virtual irq as a convenience. + */ +int virt_irq_create_mapping(unsigned int real_irq) { - pr_debug("irq: Trying to set virq count to %d\n", count); + unsigned int virq, first_virq; + static int warned; - BUG_ON(count < NUM_ISA_INTERRUPTS); - if (count < NR_IRQS) - irq_virq_count = count; -} + if (ppc64_interrupt_controller == IC_OPEN_PIC) + return real_irq; /* no mapping for openpic (for now) */ -unsigned int irq_create_mapping(struct irq_host *host, - irq_hw_number_t hwirq, - unsigned int flags) -{ - unsigned int virq, hint; - - pr_debug("irq: irq_create_mapping(0x%p, 0x%lx, 0x%x)\n", - host, hwirq, flags); - - /* Look for default host if nececssary */ - if (host == NULL) - host = irq_default_host; - if (host == NULL) { - printk(KERN_WARNING "irq_create_mapping called for" - " NULL host, hwirq=%lx\n", hwirq); - WARN_ON(1); - return NO_IRQ; - } - pr_debug("irq: -> using host @%p\n", host); + if (ppc64_interrupt_controller == IC_CELL_PIC) + return real_irq; /* no mapping for iic either */ - /* Check if mapping already exist, if it does, call - * host->ops->map() to update the flags - */ - virq = irq_find_mapping(host, hwirq); - if (virq != IRQ_NONE) { - pr_debug("irq: -> existing mapping on virq %d\n", virq); - host->ops->map(host, virq, hwirq, flags); - return virq; + /* don't map interrupts < MIN_VIRT_IRQ */ + if (real_irq < MIN_VIRT_IRQ) { + virt_irq_to_real_map[real_irq] = real_irq; + return real_irq; } - /* Get a virtual interrupt number */ - if (host->revmap_type == IRQ_HOST_MAP_LEGACY) { - /* Handle legacy */ - virq = (unsigned int)hwirq; - if (virq == 0 || virq >= NUM_ISA_INTERRUPTS) - return NO_IRQ; - return virq; - } else { - /* Allocate a virtual interrupt number */ - hint = hwirq % irq_virq_count; - virq = irq_alloc_virt(host, 1, hint); - if (virq == NO_IRQ) { - pr_debug("irq: -> virq allocation failed\n"); - return NO_IRQ; - } + /* map to a number between MIN_VIRT_IRQ and max_virt_irq */ + virq = real_irq; + if (virq > max_virt_irq) + virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ; + + /* search for this number or a free slot */ + first_virq = virq; + while (virt_irq_to_real_map[virq] != UNDEFINED_IRQ) { + if (virt_irq_to_real_map[virq] == real_irq) + return virq; + if (++virq > max_virt_irq) + virq = MIN_VIRT_IRQ; + if (virq == first_virq) + goto nospace; /* oops, no free slots */ } - pr_debug("irq: -> obtained virq %d\n", virq); - /* Clear some flags */ - get_irq_desc(virq)->status &= ~(IRQ_NOREQUEST | IRQ_LEVEL); - - /* map it */ - if (host->ops->map(host, virq, hwirq, flags)) { - pr_debug("irq: -> mapping failed, freeing\n"); - irq_free_virt(virq, 1); - return NO_IRQ; - } - smp_wmb(); - irq_map[virq].hwirq = hwirq; - smp_mb(); + virt_irq_to_real_map[virq] = real_irq; return virq; -} -EXPORT_SYMBOL_GPL(irq_create_mapping); -extern unsigned int irq_create_of_mapping(struct device_node *controller, - u32 *intspec, unsigned int intsize) -{ - struct irq_host *host; - irq_hw_number_t hwirq; - unsigned int flags = IRQ_TYPE_NONE; - - if (controller == NULL) - host = irq_default_host; - else - host = irq_find_host(controller); - if (host == NULL) - return NO_IRQ; - - /* If host has no translation, then we assume interrupt line */ - if (host->ops->xlate == NULL) - hwirq = intspec[0]; - else { - if (host->ops->xlate(host, controller, intspec, intsize, - &hwirq, &flags)) - return NO_IRQ; + nospace: + if (!warned) { + printk(KERN_CRIT "Interrupt table is full\n"); + printk(KERN_CRIT "Increase virt_irq_max (currently %d) " + "in your kernel sources and rebuild.\n", virt_irq_max); + warned = 1; } - - return irq_create_mapping(host, hwirq, flags); + return NO_IRQ; } -EXPORT_SYMBOL_GPL(irq_create_of_mapping); -unsigned int irq_of_parse_and_map(struct device_node *dev, int index) +/* + * In most cases will get a hit on the very first slot checked in the + * virt_irq_to_real_map. Only when there are a large number of + * IRQs will this be expensive. + */ +unsigned int real_irq_to_virt_slowpath(unsigned int real_irq) { - struct of_irq oirq; - - if (of_irq_map_one(dev, index, &oirq)) - return NO_IRQ; - - return irq_create_of_mapping(oirq.controller, oirq.specifier, - oirq.size); -} -EXPORT_SYMBOL_GPL(irq_of_parse_and_map); + unsigned int virq; + unsigned int first_virq; -void irq_dispose_mapping(unsigned int virq) -{ - struct irq_host *host = irq_map[virq].host; - irq_hw_number_t hwirq; - unsigned long flags; + virq = real_irq; - WARN_ON (host == NULL); - if (host == NULL) - return; + if (virq > max_virt_irq) + virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ; - /* Never unmap legacy interrupts */ - if (host->revmap_type == IRQ_HOST_MAP_LEGACY) - return; + first_virq = virq; - /* remove chip and handler */ - set_irq_chip_and_handler(virq, NULL, NULL); - - /* Make sure it's completed */ - synchronize_irq(virq); - - /* Tell the PIC about it */ - if (host->ops->unmap) - host->ops->unmap(host, virq); - smp_mb(); - - /* Clear reverse map */ - hwirq = irq_map[virq].hwirq; - switch(host->revmap_type) { - case IRQ_HOST_MAP_LINEAR: - if (hwirq < host->revmap_data.linear.size) - host->revmap_data.linear.revmap[hwirq] = IRQ_NONE; - break; - case IRQ_HOST_MAP_TREE: - /* Check if radix tree allocated yet */ - if (host->revmap_data.tree.gfp_mask == 0) - break; - /* XXX radix tree not safe ! remove lock whem it becomes safe - * and use some RCU sync to make sure everything is ok before we - * can re-use that map entry - */ - spin_lock_irqsave(&irq_big_lock, flags); - radix_tree_delete(&host->revmap_data.tree, hwirq); - spin_unlock_irqrestore(&irq_big_lock, flags); - break; - } + do { + if (virt_irq_to_real_map[virq] == real_irq) + return virq; - /* Destroy map */ - smp_mb(); - irq_map[virq].hwirq = host->inval_irq; + virq++; - /* Set some flags */ - get_irq_desc(virq)->status |= IRQ_NOREQUEST; + if (virq >= max_virt_irq) + virq = 0; - /* Free it */ - irq_free_virt(virq, 1); -} -EXPORT_SYMBOL_GPL(irq_dispose_mapping); + } while (first_virq != virq); -unsigned int irq_find_mapping(struct irq_host *host, - irq_hw_number_t hwirq) -{ - unsigned int i; - unsigned int hint = hwirq % irq_virq_count; - - /* Look for default host if nececssary */ - if (host == NULL) - host = irq_default_host; - if (host == NULL) - return NO_IRQ; - - /* legacy -> bail early */ - if (host->revmap_type == IRQ_HOST_MAP_LEGACY) - return hwirq; - - /* Slow path does a linear search of the map */ - if (hint < NUM_ISA_INTERRUPTS) - hint = NUM_ISA_INTERRUPTS; - i = hint; - do { - if (irq_map[i].host == host && - irq_map[i].hwirq == hwirq) - return i; - i++; - if (i >= irq_virq_count) - i = NUM_ISA_INTERRUPTS; - } while(i != hint); return NO_IRQ; + } -EXPORT_SYMBOL_GPL(irq_find_mapping); +#endif /* CONFIG_PPC64 */ +#ifdef CONFIG_IRQSTACKS +struct thread_info *softirq_ctx[NR_CPUS] __read_mostly; +struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly; -unsigned int irq_radix_revmap(struct irq_host *host, - irq_hw_number_t hwirq) +void irq_ctx_init(void) { - struct radix_tree_root *tree; - struct irq_map_entry *ptr; - unsigned int virq; - unsigned long flags; - - WARN_ON(host->revmap_type != IRQ_HOST_MAP_TREE); + struct thread_info *tp; + int i; - /* Check if the radix tree exist yet. We test the value of - * the gfp_mask for that. Sneaky but saves another int in the - * structure. If not, we fallback to slow mode - */ - tree = &host->revmap_data.tree; - if (tree->gfp_mask == 0) - return irq_find_mapping(host, hwirq); + for_each_possible_cpu(i) { + memset((void *)softirq_ctx[i], 0, THREAD_SIZE); + tp = softirq_ctx[i]; + tp->cpu = i; + tp->preempt_count = SOFTIRQ_OFFSET; - /* XXX Current radix trees are NOT SMP safe !!! Remove that lock - * when that is fixed (when Nick's patch gets in - */ - spin_lock_irqsave(&irq_big_lock, flags); - - /* Now try to resolve */ - ptr = radix_tree_lookup(tree, hwirq); - /* Found it, return */ - if (ptr) { - virq = ptr - irq_map; - goto bail; + memset((void *)hardirq_ctx[i], 0, THREAD_SIZE); + tp = hardirq_ctx[i]; + tp->cpu = i; + tp->preempt_count = HARDIRQ_OFFSET; } - - /* If not there, try to insert it */ - virq = irq_find_mapping(host, hwirq); - if (virq != NO_IRQ) - radix_tree_insert(tree, virq, &irq_map[virq]); - bail: - spin_unlock_irqrestore(&irq_big_lock, flags); - return virq; } -unsigned int irq_linear_revmap(struct irq_host *host, - irq_hw_number_t hwirq) +static inline void do_softirq_onstack(void) { - unsigned int *revmap; - - WARN_ON(host->revmap_type != IRQ_HOST_MAP_LINEAR); - - /* Check revmap bounds */ - if (unlikely(hwirq >= host->revmap_data.linear.size)) - return irq_find_mapping(host, hwirq); - - /* Check if revmap was allocated */ - revmap = host->revmap_data.linear.revmap; - if (unlikely(revmap == NULL)) - return irq_find_mapping(host, hwirq); - - /* Fill up revmap with slow path if no mapping found */ - if (unlikely(revmap[hwirq] == NO_IRQ)) - revmap[hwirq] = irq_find_mapping(host, hwirq); + struct thread_info *curtp, *irqtp; - return revmap[hwirq]; + curtp = current_thread_info(); + irqtp = softirq_ctx[smp_processor_id()]; + irqtp->task = curtp->task; + call_do_softirq(irqtp); + irqtp->task = NULL; } -unsigned int irq_alloc_virt(struct irq_host *host, - unsigned int count, - unsigned int hint) -{ - unsigned long flags; - unsigned int i, j, found = NO_IRQ; - unsigned int limit = irq_virq_count - count; - - if (count == 0 || count > (irq_virq_count - NUM_ISA_INTERRUPTS)) - return NO_IRQ; - - spin_lock_irqsave(&irq_big_lock, flags); - - /* Use hint for 1 interrupt if any */ - if (count == 1 && hint >= NUM_ISA_INTERRUPTS && - hint < irq_virq_count && irq_map[hint].host == NULL) { - found = hint; - goto hint_found; - } - - /* Look for count consecutive numbers in the allocatable - * (non-legacy) space - */ - for (i = NUM_ISA_INTERRUPTS; i <= limit; ) { - for (j = i; j < (i + count); j++) - if (irq_map[j].host != NULL) { - i = j + 1; - continue; - } - found = i; - break; - } - if (found == NO_IRQ) { - spin_unlock_irqrestore(&irq_big_lock, flags); - return NO_IRQ; - } - hint_found: - for (i = found; i < (found + count); i++) { - irq_map[i].hwirq = host->inval_irq; - smp_wmb(); - irq_map[i].host = host; - } - spin_unlock_irqrestore(&irq_big_lock, flags); - return found; -} +#else +#define do_softirq_onstack() __do_softirq() +#endif /* CONFIG_IRQSTACKS */ -void irq_free_virt(unsigned int virq, unsigned int count) +void do_softirq(void) { unsigned long flags; - unsigned int i; - - WARN_ON (virq < NUM_ISA_INTERRUPTS); - WARN_ON (count == 0 || (virq + count) > irq_virq_count); - - spin_lock_irqsave(&irq_big_lock, flags); - for (i = virq; i < (virq + count); i++) { - struct irq_host *host; - - if (i < NUM_ISA_INTERRUPTS || - (virq + count) > irq_virq_count) - continue; - - host = irq_map[i].host; - irq_map[i].hwirq = host->inval_irq; - smp_wmb(); - irq_map[i].host = NULL; - } - spin_unlock_irqrestore(&irq_big_lock, flags); -} - -void irq_early_init(void) -{ - unsigned int i; - for (i = 0; i < NR_IRQS; i++) - get_irq_desc(i)->status |= IRQ_NOREQUEST; -} + if (in_interrupt()) + return; -/* We need to create the radix trees late */ -static int irq_late_init(void) -{ - struct irq_host *h; - unsigned long flags; + local_irq_save(flags); - spin_lock_irqsave(&irq_big_lock, flags); - list_for_each_entry(h, &irq_hosts, link) { - if (h->revmap_type == IRQ_HOST_MAP_TREE) - INIT_RADIX_TREE(&h->revmap_data.tree, GFP_ATOMIC); + if (local_softirq_pending()) { + account_system_vtime(current); + local_bh_disable(); + do_softirq_onstack(); + account_system_vtime(current); + __local_bh_enable(); } - spin_unlock_irqrestore(&irq_big_lock, flags); - return 0; + local_irq_restore(flags); } -arch_initcall(irq_late_init); - -#endif /* CONFIG_PPC_MERGE */ +EXPORT_SYMBOL(do_softirq); #ifdef CONFIG_PCI_MSI int pci_enable_msi(struct pci_dev * pdev) diff --git a/trunk/arch/powerpc/kernel/kprobes.c b/trunk/arch/powerpc/kernel/kprobes.c index 9f0898c89759..f78866367b70 100644 --- a/trunk/arch/powerpc/kernel/kprobes.c +++ b/trunk/arch/powerpc/kernel/kprobes.c @@ -26,6 +26,7 @@ * for PPC64 */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/l2cr_6xx.S b/trunk/arch/powerpc/kernel/l2cr_6xx.S index 858f28ac8a06..d7f4e982b539 100644 --- a/trunk/arch/powerpc/kernel/l2cr_6xx.S +++ b/trunk/arch/powerpc/kernel/l2cr_6xx.S @@ -40,6 +40,7 @@ Author: Terry Greeniaus (tgree@phys.ualberta.ca) Please e-mail updates to this file to me, thanks! */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/legacy_serial.c b/trunk/arch/powerpc/kernel/legacy_serial.c index 7e98e778b52f..3a9b78d03542 100644 --- a/trunk/arch/powerpc/kernel/legacy_serial.c +++ b/trunk/arch/powerpc/kernel/legacy_serial.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -28,7 +29,6 @@ static struct legacy_serial_info { struct device_node *np; unsigned int speed; unsigned int clock; - int irq_check_parent; phys_addr_t taddr; } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS]; static unsigned int legacy_serial_count; @@ -37,7 +37,7 @@ static int legacy_serial_console = -1; static int __init add_legacy_port(struct device_node *np, int want_index, int iotype, phys_addr_t base, phys_addr_t taddr, unsigned long irq, - upf_t flags, int irq_check_parent) + upf_t flags) { u32 *clk, *spd, clock = BASE_BAUD * 16; int index; @@ -69,7 +69,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index, if (legacy_serial_infos[index].np != 0) { /* if we still have some room, move it, else override */ if (legacy_serial_count < MAX_LEGACY_SERIAL_PORTS) { - printk(KERN_DEBUG "Moved legacy port %d -> %d\n", + printk(KERN_INFO "Moved legacy port %d -> %d\n", index, legacy_serial_count); legacy_serial_ports[legacy_serial_count] = legacy_serial_ports[index]; @@ -77,7 +77,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index, legacy_serial_infos[index]; legacy_serial_count++; } else { - printk(KERN_DEBUG "Replacing legacy port %d\n", index); + printk(KERN_INFO "Replacing legacy port %d\n", index); } } @@ -96,11 +96,10 @@ static int __init add_legacy_port(struct device_node *np, int want_index, legacy_serial_infos[index].np = of_node_get(np); legacy_serial_infos[index].clock = clock; legacy_serial_infos[index].speed = spd ? *spd : 0; - legacy_serial_infos[index].irq_check_parent = irq_check_parent; - printk(KERN_DEBUG "Found legacy serial port %d for %s\n", + printk(KERN_INFO "Found legacy serial port %d for %s\n", index, np->full_name); - printk(KERN_DEBUG " %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n", + printk(KERN_INFO " %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n", (iotype == UPIO_PORT) ? "port" : "mem", (unsigned long long)base, (unsigned long long)taddr, irq, legacy_serial_ports[index].uartclk, @@ -128,13 +127,11 @@ static int __init add_legacy_soc_port(struct device_node *np, return -1; addr = of_translate_address(soc_dev, addrp); - if (addr == OF_BAD_ADDR) - return -1; /* Add port, irq will be dealt with later. We passed a translated * IO port value. It will be fixed up later along with the irq */ - return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags, 0); + return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags); } static int __init add_legacy_isa_port(struct device_node *np, @@ -145,8 +142,6 @@ static int __init add_legacy_isa_port(struct device_node *np, int index = -1; phys_addr_t taddr; - DBG(" -> add_legacy_isa_port(%s)\n", np->full_name); - /* Get the ISA port number */ reg = (u32 *)get_property(np, "reg", NULL); if (reg == NULL) @@ -167,12 +162,9 @@ static int __init add_legacy_isa_port(struct device_node *np, /* Translate ISA address */ taddr = of_translate_address(np, reg); - if (taddr == OF_BAD_ADDR) - return -1; /* Add port, irq will be dealt with later */ - return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, - NO_IRQ, UPF_BOOT_AUTOCONF, 0); + return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, NO_IRQ, UPF_BOOT_AUTOCONF); } @@ -185,8 +177,6 @@ static int __init add_legacy_pci_port(struct device_node *np, unsigned int flags; int iotype, index = -1, lindex = 0; - DBG(" -> add_legacy_pci_port(%s)\n", np->full_name); - /* We only support ports that have a clock frequency properly * encoded in the device-tree (that is have an fcode). Anything * else can't be used that early and will be normally probed by @@ -205,8 +195,6 @@ static int __init add_legacy_pci_port(struct device_node *np, /* We only support BAR 0 for now */ iotype = (flags & IORESOURCE_MEM) ? UPIO_MEM : UPIO_PORT; addr = of_translate_address(pci_dev, addrp); - if (addr == OF_BAD_ADDR) - return -1; /* Set the IO base to the same as the translated address for MMIO, * or to the domain local IO base for PIO (it will be fixed up later) @@ -244,8 +232,7 @@ static int __init add_legacy_pci_port(struct device_node *np, /* Add port, irq will be dealt with later. We passed a translated * IO port value. It will be fixed up later along with the irq */ - return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, - UPF_BOOT_AUTOCONF, np != pci_dev); + return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, UPF_BOOT_AUTOCONF); } #endif @@ -376,22 +363,27 @@ static void __init fixup_port_irq(int index, struct device_node *np, struct plat_serial8250_port *port) { - unsigned int virq; - DBG("fixup_port_irq(%d)\n", index); - virq = irq_of_parse_and_map(np, 0); - if (virq == NO_IRQ && legacy_serial_infos[index].irq_check_parent) { - np = of_get_parent(np); - if (np == NULL) - return; - virq = irq_of_parse_and_map(np, 0); - of_node_put(np); + /* Check for interrupts in that node */ + if (np->n_intrs > 0) { + port->irq = np->intrs[0].line; + DBG(" port %d (%s), irq=%d\n", + index, np->full_name, port->irq); + return; } - if (virq == NO_IRQ) + + /* Check for interrupts in the parent */ + np = of_get_parent(np); + if (np == NULL) return; - port->irq = virq; + if (np->n_intrs > 0) { + port->irq = np->intrs[0].line; + DBG(" port %d (%s), irq=%d\n", + index, np->full_name, port->irq); + } + of_node_put(np); } static void __init fixup_port_pio(int index, diff --git a/trunk/arch/powerpc/kernel/lparcfg.c b/trunk/arch/powerpc/kernel/lparcfg.c index 23f34daa044a..73edc3c16137 100644 --- a/trunk/arch/powerpc/kernel/lparcfg.c +++ b/trunk/arch/powerpc/kernel/lparcfg.c @@ -18,6 +18,7 @@ * keyword - value pairs that specify the configuration of the partition. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/misc_32.S b/trunk/arch/powerpc/kernel/misc_32.S index 58758d883361..c74774e2175d 100644 --- a/trunk/arch/powerpc/kernel/misc_32.S +++ b/trunk/arch/powerpc/kernel/misc_32.S @@ -16,6 +16,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/misc_64.S b/trunk/arch/powerpc/kernel/misc_64.S index bfb407fc1aa1..580891cb8ccb 100644 --- a/trunk/arch/powerpc/kernel/misc_64.S +++ b/trunk/arch/powerpc/kernel/misc_64.S @@ -14,6 +14,7 @@ * */ +#include #include #include #include @@ -51,14 +52,12 @@ _GLOBAL(call_do_softirq) mtlr r0 blr -_GLOBAL(call_handle_irq) - ld r8,0(r7) +_GLOBAL(call___do_IRQ) mflr r0 std r0,16(r1) - mtctr r8 - stdu r1,THREAD_SIZE-112(r6) - mr r1,r6 - bctrl + stdu r1,THREAD_SIZE-112(r5) + mr r1,r5 + bl .__do_IRQ ld r1,0(r1) ld r0,16(r1) mtlr r0 diff --git a/trunk/arch/powerpc/kernel/of_device.c b/trunk/arch/powerpc/kernel/of_device.c index 3262b73a3a68..9feeeef5a875 100644 --- a/trunk/arch/powerpc/kernel/of_device.c +++ b/trunk/arch/powerpc/kernel/of_device.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/paca.c b/trunk/arch/powerpc/kernel/paca.c index c68741fed14b..a0bb354c1c08 100644 --- a/trunk/arch/powerpc/kernel/paca.c +++ b/trunk/arch/powerpc/kernel/paca.c @@ -7,6 +7,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/pci_32.c b/trunk/arch/powerpc/kernel/pci_32.c index 898dae8ab6d9..8474355a1a4f 100644 --- a/trunk/arch/powerpc/kernel/pci_32.c +++ b/trunk/arch/powerpc/kernel/pci_32.c @@ -2,6 +2,7 @@ * Common pmac/prep/chrp pci routines. -- Cort */ +#include #include #include #include @@ -1404,43 +1405,6 @@ pcibios_update_irq(struct pci_dev *dev, int irq) /* XXX FIXME - update OF device tree node interrupt property */ } -#ifdef CONFIG_PPC_MERGE -/* XXX This is a copy of the ppc64 version. This is temporary until we start - * merging the 2 PCI layers - */ -/* - * Reads the interrupt pin to determine if interrupt is use by card. - * If the interrupt is used, then gets the interrupt line from the - * openfirmware and sets it in the pci_dev and pci_config line. - */ -int pci_read_irq_line(struct pci_dev *pci_dev) -{ - struct of_irq oirq; - unsigned int virq; - - DBG("Try to map irq for %s...\n", pci_name(pci_dev)); - - if (of_irq_map_pci(pci_dev, &oirq)) { - DBG(" -> failed !\n"); - return -1; - } - - DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", - oirq.size, oirq.specifier[0], oirq.controller->full_name); - - virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); - if(virq == NO_IRQ) { - DBG(" -> failed to map !\n"); - return -1; - } - pci_dev->irq = virq; - pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, virq); - - return 0; -} -EXPORT_SYMBOL(pci_read_irq_line); -#endif /* CONFIG_PPC_MERGE */ - int pcibios_enable_device(struct pci_dev *dev, int mask) { u16 cmd, old_cmd; diff --git a/trunk/arch/powerpc/kernel/pci_64.c b/trunk/arch/powerpc/kernel/pci_64.c index efc0b5559ee0..286aa52aae33 100644 --- a/trunk/arch/powerpc/kernel/pci_64.c +++ b/trunk/arch/powerpc/kernel/pci_64.c @@ -13,6 +13,7 @@ #undef DEBUG +#include #include #include #include @@ -398,8 +399,12 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, } else { dev->hdr_type = PCI_HEADER_TYPE_NORMAL; dev->rom_base_reg = PCI_ROM_ADDRESS; - /* Maybe do a default OF mapping here */ dev->irq = NO_IRQ; + if (node->n_intrs > 0) { + dev->irq = node->intrs[0].line; + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, + dev->irq); + } } pci_parse_of_addrs(node, dev); @@ -1284,26 +1289,23 @@ EXPORT_SYMBOL(pcibios_fixup_bus); */ int pci_read_irq_line(struct pci_dev *pci_dev) { - struct of_irq oirq; - unsigned int virq; + u8 intpin; + struct device_node *node; - DBG("Try to map irq for %s...\n", pci_name(pci_dev)); + pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &intpin); + if (intpin == 0) + return 0; - if (of_irq_map_pci(pci_dev, &oirq)) { - DBG(" -> failed !\n"); + node = pci_device_to_OF_node(pci_dev); + if (node == NULL) return -1; - } - - DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", - oirq.size, oirq.specifier[0], oirq.controller->full_name); - virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); - if(virq == NO_IRQ) { - DBG(" -> failed to map !\n"); + if (node->n_intrs == 0) return -1; - } - pci_dev->irq = virq; - pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, virq); + + pci_dev->irq = node->intrs[0].line; + + pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, pci_dev->irq); return 0; } diff --git a/trunk/arch/powerpc/kernel/perfmon_fsl_booke.c b/trunk/arch/powerpc/kernel/perfmon_fsl_booke.c index bdc3977a7b06..32455dfcc36b 100644 --- a/trunk/arch/powerpc/kernel/perfmon_fsl_booke.c +++ b/trunk/arch/powerpc/kernel/perfmon_fsl_booke.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/pmc.c b/trunk/arch/powerpc/kernel/pmc.c index a0a2efadeabf..e6fb194fe537 100644 --- a/trunk/arch/powerpc/kernel/pmc.c +++ b/trunk/arch/powerpc/kernel/pmc.c @@ -12,6 +12,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/ppc_ksyms.c b/trunk/arch/powerpc/kernel/ppc_ksyms.c index e3b80f71748e..4b052ae5dc34 100644 --- a/trunk/arch/powerpc/kernel/ppc_ksyms.c +++ b/trunk/arch/powerpc/kernel/ppc_ksyms.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/proc_ppc64.c b/trunk/arch/powerpc/kernel/proc_ppc64.c index f598cb519539..2ab8f2be911e 100644 --- a/trunk/arch/powerpc/kernel/proc_ppc64.c +++ b/trunk/arch/powerpc/kernel/proc_ppc64.c @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/process.c b/trunk/arch/powerpc/kernel/process.c index a127a1e3c097..e4732459c485 100644 --- a/trunk/arch/powerpc/kernel/process.c +++ b/trunk/arch/powerpc/kernel/process.c @@ -14,6 +14,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/prom.c b/trunk/arch/powerpc/kernel/prom.c index a1787ffb6319..320c913435cd 100644 --- a/trunk/arch/powerpc/kernel/prom.c +++ b/trunk/arch/powerpc/kernel/prom.c @@ -16,6 +16,7 @@ #undef DEBUG #include +#include #include #include #include @@ -30,7 +31,6 @@ #include #include #include -#include #include #include @@ -87,6 +87,424 @@ static DEFINE_RWLOCK(devtree_lock); /* export that to outside world */ struct device_node *of_chosen; +struct device_node *dflt_interrupt_controller; +int num_interrupt_controllers; + +/* + * Wrapper for allocating memory for various data that needs to be + * attached to device nodes as they are processed at boot or when + * added to the device tree later (e.g. DLPAR). At boot there is + * already a region reserved so we just increment *mem_start by size; + * otherwise we call kmalloc. + */ +static void * prom_alloc(unsigned long size, unsigned long *mem_start) +{ + unsigned long tmp; + + if (!mem_start) + return kmalloc(size, GFP_KERNEL); + + tmp = *mem_start; + *mem_start += size; + return (void *)tmp; +} + +/* + * Find the device_node with a given phandle. + */ +static struct device_node * find_phandle(phandle ph) +{ + struct device_node *np; + + for (np = allnodes; np != 0; np = np->allnext) + if (np->linux_phandle == ph) + return np; + return NULL; +} + +/* + * Find the interrupt parent of a node. + */ +static struct device_node * __devinit intr_parent(struct device_node *p) +{ + phandle *parp; + + parp = (phandle *) get_property(p, "interrupt-parent", NULL); + if (parp == NULL) + return p->parent; + p = find_phandle(*parp); + if (p != NULL) + return p; + /* + * On a powermac booted with BootX, we don't get to know the + * phandles for any nodes, so find_phandle will return NULL. + * Fortunately these machines only have one interrupt controller + * so there isn't in fact any ambiguity. -- paulus + */ + if (num_interrupt_controllers == 1) + p = dflt_interrupt_controller; + return p; +} + +/* + * Find out the size of each entry of the interrupts property + * for a node. + */ +int __devinit prom_n_intr_cells(struct device_node *np) +{ + struct device_node *p; + unsigned int *icp; + + for (p = np; (p = intr_parent(p)) != NULL; ) { + icp = (unsigned int *) + get_property(p, "#interrupt-cells", NULL); + if (icp != NULL) + return *icp; + if (get_property(p, "interrupt-controller", NULL) != NULL + || get_property(p, "interrupt-map", NULL) != NULL) { + printk("oops, node %s doesn't have #interrupt-cells\n", + p->full_name); + return 1; + } + } +#ifdef DEBUG_IRQ + printk("prom_n_intr_cells failed for %s\n", np->full_name); +#endif + return 1; +} + +/* + * Map an interrupt from a device up to the platform interrupt + * descriptor. + */ +static int __devinit map_interrupt(unsigned int **irq, struct device_node **ictrler, + struct device_node *np, unsigned int *ints, + int nintrc) +{ + struct device_node *p, *ipar; + unsigned int *imap, *imask, *ip; + int i, imaplen, match; + int newintrc = 0, newaddrc = 0; + unsigned int *reg; + int naddrc; + + reg = (unsigned int *) get_property(np, "reg", NULL); + naddrc = prom_n_addr_cells(np); + p = intr_parent(np); + while (p != NULL) { + if (get_property(p, "interrupt-controller", NULL) != NULL) + /* this node is an interrupt controller, stop here */ + break; + imap = (unsigned int *) + get_property(p, "interrupt-map", &imaplen); + if (imap == NULL) { + p = intr_parent(p); + continue; + } + imask = (unsigned int *) + get_property(p, "interrupt-map-mask", NULL); + if (imask == NULL) { + printk("oops, %s has interrupt-map but no mask\n", + p->full_name); + return 0; + } + imaplen /= sizeof(unsigned int); + match = 0; + ipar = NULL; + while (imaplen > 0 && !match) { + /* check the child-interrupt field */ + match = 1; + for (i = 0; i < naddrc && match; ++i) + match = ((reg[i] ^ imap[i]) & imask[i]) == 0; + for (; i < naddrc + nintrc && match; ++i) + match = ((ints[i-naddrc] ^ imap[i]) & imask[i]) == 0; + imap += naddrc + nintrc; + imaplen -= naddrc + nintrc; + /* grab the interrupt parent */ + ipar = find_phandle((phandle) *imap++); + --imaplen; + if (ipar == NULL && num_interrupt_controllers == 1) + /* cope with BootX not giving us phandles */ + ipar = dflt_interrupt_controller; + if (ipar == NULL) { + printk("oops, no int parent %x in map of %s\n", + imap[-1], p->full_name); + return 0; + } + /* find the parent's # addr and intr cells */ + ip = (unsigned int *) + get_property(ipar, "#interrupt-cells", NULL); + if (ip == NULL) { + printk("oops, no #interrupt-cells on %s\n", + ipar->full_name); + return 0; + } + newintrc = *ip; + ip = (unsigned int *) + get_property(ipar, "#address-cells", NULL); + newaddrc = (ip == NULL)? 0: *ip; + imap += newaddrc + newintrc; + imaplen -= newaddrc + newintrc; + } + if (imaplen < 0) { + printk("oops, error decoding int-map on %s, len=%d\n", + p->full_name, imaplen); + return 0; + } + if (!match) { +#ifdef DEBUG_IRQ + printk("oops, no match in %s int-map for %s\n", + p->full_name, np->full_name); +#endif + return 0; + } + p = ipar; + naddrc = newaddrc; + nintrc = newintrc; + ints = imap - nintrc; + reg = ints - naddrc; + } + if (p == NULL) { +#ifdef DEBUG_IRQ + printk("hmmm, int tree for %s doesn't have ctrler\n", + np->full_name); +#endif + return 0; + } + *irq = ints; + *ictrler = p; + return nintrc; +} + +static unsigned char map_isa_senses[4] = { + IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE, + IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE, + IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE, + IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE +}; + +static unsigned char map_mpic_senses[4] = { + IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE, + IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE, + /* 2 seems to be used for the 8259 cascade... */ + IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE, + IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE, +}; + +static int __devinit finish_node_interrupts(struct device_node *np, + unsigned long *mem_start, + int measure_only) +{ + unsigned int *ints; + int intlen, intrcells, intrcount; + int i, j, n, sense; + unsigned int *irq, virq; + struct device_node *ic; + int trace = 0; + + //#define TRACE(fmt...) do { if (trace) { printk(fmt); mdelay(1000); } } while(0) +#define TRACE(fmt...) + + if (!strcmp(np->name, "smu-doorbell")) + trace = 1; + + TRACE("Finishing SMU doorbell ! num_interrupt_controllers = %d\n", + num_interrupt_controllers); + + if (num_interrupt_controllers == 0) { + /* + * Old machines just have a list of interrupt numbers + * and no interrupt-controller nodes. + */ + ints = (unsigned int *) get_property(np, "AAPL,interrupts", + &intlen); + /* XXX old interpret_pci_props looked in parent too */ + /* XXX old interpret_macio_props looked for interrupts + before AAPL,interrupts */ + if (ints == NULL) + ints = (unsigned int *) get_property(np, "interrupts", + &intlen); + if (ints == NULL) + return 0; + + np->n_intrs = intlen / sizeof(unsigned int); + np->intrs = prom_alloc(np->n_intrs * sizeof(np->intrs[0]), + mem_start); + if (!np->intrs) + return -ENOMEM; + if (measure_only) + return 0; + + for (i = 0; i < np->n_intrs; ++i) { + np->intrs[i].line = *ints++; + np->intrs[i].sense = IRQ_SENSE_LEVEL + | IRQ_POLARITY_NEGATIVE; + } + return 0; + } + + ints = (unsigned int *) get_property(np, "interrupts", &intlen); + TRACE("ints=%p, intlen=%d\n", ints, intlen); + if (ints == NULL) + return 0; + intrcells = prom_n_intr_cells(np); + intlen /= intrcells * sizeof(unsigned int); + TRACE("intrcells=%d, new intlen=%d\n", intrcells, intlen); + np->intrs = prom_alloc(intlen * sizeof(*(np->intrs)), mem_start); + if (!np->intrs) + return -ENOMEM; + + if (measure_only) + return 0; + + intrcount = 0; + for (i = 0; i < intlen; ++i, ints += intrcells) { + n = map_interrupt(&irq, &ic, np, ints, intrcells); + TRACE("map, irq=%d, ic=%p, n=%d\n", irq, ic, n); + if (n <= 0) + continue; + + /* don't map IRQ numbers under a cascaded 8259 controller */ + if (ic && device_is_compatible(ic, "chrp,iic")) { + np->intrs[intrcount].line = irq[0]; + sense = (n > 1)? (irq[1] & 3): 3; + np->intrs[intrcount].sense = map_isa_senses[sense]; + } else { + virq = virt_irq_create_mapping(irq[0]); + TRACE("virq=%d\n", virq); +#ifdef CONFIG_PPC64 + if (virq == NO_IRQ) { + printk(KERN_CRIT "Could not allocate interrupt" + " number for %s\n", np->full_name); + continue; + } +#endif + np->intrs[intrcount].line = irq_offset_up(virq); + sense = (n > 1)? (irq[1] & 3): 1; + + /* Apple uses bits in there in a different way, let's + * only keep the real sense bit on macs + */ + if (machine_is(powermac)) + sense &= 0x1; + np->intrs[intrcount].sense = map_mpic_senses[sense]; + } + +#ifdef CONFIG_PPC64 + /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ + if (machine_is(powermac) && ic && ic->parent) { + char *name = get_property(ic->parent, "name", NULL); + if (name && !strcmp(name, "u3")) + np->intrs[intrcount].line += 128; + else if (!(name && (!strcmp(name, "mac-io") || + !strcmp(name, "u4")))) + /* ignore other cascaded controllers, such as + the k2-sata-root */ + break; + } +#endif /* CONFIG_PPC64 */ + if (n > 2) { + printk("hmmm, got %d intr cells for %s:", n, + np->full_name); + for (j = 0; j < n; ++j) + printk(" %d", irq[j]); + printk("\n"); + } + ++intrcount; + } + np->n_intrs = intrcount; + + return 0; +} + +static int __devinit finish_node(struct device_node *np, + unsigned long *mem_start, + int measure_only) +{ + struct device_node *child; + int rc = 0; + + rc = finish_node_interrupts(np, mem_start, measure_only); + if (rc) + goto out; + + for (child = np->child; child != NULL; child = child->sibling) { + rc = finish_node(child, mem_start, measure_only); + if (rc) + goto out; + } +out: + return rc; +} + +static void __init scan_interrupt_controllers(void) +{ + struct device_node *np; + int n = 0; + char *name, *ic; + int iclen; + + for (np = allnodes; np != NULL; np = np->allnext) { + ic = get_property(np, "interrupt-controller", &iclen); + name = get_property(np, "name", NULL); + /* checking iclen makes sure we don't get a false + match on /chosen.interrupt_controller */ + if ((name != NULL + && strcmp(name, "interrupt-controller") == 0) + || (ic != NULL && iclen == 0 + && strcmp(name, "AppleKiwi"))) { + if (n == 0) + dflt_interrupt_controller = np; + ++n; + } + } + num_interrupt_controllers = n; +} + +/** + * finish_device_tree is called once things are running normally + * (i.e. with text and data mapped to the address they were linked at). + * It traverses the device tree and fills in some of the additional, + * fields in each node like {n_}addrs and {n_}intrs, the virt interrupt + * mapping is also initialized at this point. + */ +void __init finish_device_tree(void) +{ + unsigned long start, end, size = 0; + + DBG(" -> finish_device_tree\n"); + +#ifdef CONFIG_PPC64 + /* Initialize virtual IRQ map */ + virt_irq_init(); +#endif + scan_interrupt_controllers(); + + /* + * Finish device-tree (pre-parsing some properties etc...) + * We do this in 2 passes. One with "measure_only" set, which + * will only measure the amount of memory needed, then we can + * allocate that memory, and call finish_node again. However, + * we must be careful as most routines will fail nowadays when + * prom_alloc() returns 0, so we must make sure our first pass + * doesn't start at 0. We pre-initialize size to 16 for that + * reason and then remove those additional 16 bytes + */ + size = 16; + finish_node(allnodes, &size, 1); + size -= 16; + + if (0 == size) + end = start = 0; + else + end = start = (unsigned long)__va(lmb_alloc(size, 128)); + + finish_node(allnodes, &end, 0); + BUG_ON(end != start + size); + + DBG(" <- finish_device_tree\n"); +} + static inline char *find_flat_dt_string(u32 offset) { return ((char *)initial_boot_params) + @@ -971,6 +1389,27 @@ prom_n_size_cells(struct device_node* np) } EXPORT_SYMBOL(prom_n_size_cells); +/** + * Work out the sense (active-low level / active-high edge) + * of each interrupt from the device tree. + */ +void __init prom_get_irq_senses(unsigned char *senses, int off, int max) +{ + struct device_node *np; + int i, j; + + /* default to level-triggered */ + memset(senses, IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE, max - off); + + for (np = allnodes; np != 0; np = np->allnext) { + for (j = 0; j < np->n_intrs; j++) { + i = np->intrs[j].line; + if (i >= off && i < max) + senses[i-off] = np->intrs[j].sense; + } + } +} + /** * Construct and return a list of the device_nodes with a given name. */ @@ -1370,6 +1809,7 @@ static void of_node_release(struct kref *kref) node->deadprops = NULL; } } + kfree(node->intrs); kfree(node->full_name); kfree(node->data); kfree(node); @@ -1442,7 +1882,13 @@ void of_detach_node(const struct device_node *np) #ifdef CONFIG_PPC_PSERIES /* * Fix up the uninitialized fields in a new device node: - * name, type and pci-specific fields + * name, type, n_addrs, addrs, n_intrs, intrs, and pci-specific fields + * + * A lot of boot-time code is duplicated here, because functions such + * as finish_node_interrupts, interpret_pci_props, etc. cannot use the + * slab allocator. + * + * This should probably be split up into smaller chunks. */ static int of_finish_dynamic_node(struct device_node *node) @@ -1483,6 +1929,8 @@ static int prom_reconfig_notifier(struct notifier_block *nb, switch (action) { case PSERIES_RECONFIG_ADD: err = of_finish_dynamic_node(node); + if (!err) + finish_node(node, NULL, 0); if (err < 0) { printk(KERN_ERR "finish_node returned %d\n", err); err = NOTIFY_BAD; @@ -1528,7 +1976,8 @@ struct property *of_find_property(struct device_node *np, const char *name, * Find a property with a given name for a given node * and return the value. */ -void *get_property(struct device_node *np, const char *name, int *lenp) +unsigned char *get_property(struct device_node *np, const char *name, + int *lenp) { struct property *pp = of_find_property(np,name,lenp); return pp ? pp->value : NULL; diff --git a/trunk/arch/powerpc/kernel/prom_init.c b/trunk/arch/powerpc/kernel/prom_init.c index ebd501a59abd..8c28eb0cbdac 100644 --- a/trunk/arch/powerpc/kernel/prom_init.c +++ b/trunk/arch/powerpc/kernel/prom_init.c @@ -16,6 +16,7 @@ #undef DEBUG_PROM #include +#include #include #include #include @@ -987,7 +988,7 @@ static void reserve_mem(u64 base, u64 size) } /* - * Initialize memory allocation mechanism, parse "memory" nodes and + * Initialize memory allocation mecanism, parse "memory" nodes and * obtain that way the top of memory and RMO to setup out local allocator */ static void __init prom_init_mem(void) @@ -1990,22 +1991,12 @@ static void __init flatten_device_tree(void) static void __init fixup_device_tree_maple(void) { phandle isa; - u32 rloc = 0x01002000; /* IO space; PCI device = 4 */ u32 isa_ranges[6]; - char *name; - - name = "/ht@0/isa@4"; - isa = call_prom("finddevice", 1, 1, ADDR(name)); - if (!PHANDLE_VALID(isa)) { - name = "/ht@0/isa@6"; - isa = call_prom("finddevice", 1, 1, ADDR(name)); - rloc = 0x01003000; /* IO space; PCI device = 6 */ - } + + isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4")); if (!PHANDLE_VALID(isa)) return; - if (prom_getproplen(isa, "ranges") != 12) - return; if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges)) == PROM_ERROR) return; @@ -2015,15 +2006,15 @@ static void __init fixup_device_tree_maple(void) isa_ranges[2] != 0x00010000) return; - prom_printf("Fixing up bogus ISA range on Maple/Apache...\n"); + prom_printf("fixing up bogus ISA range on Maple...\n"); isa_ranges[0] = 0x1; isa_ranges[1] = 0x0; - isa_ranges[2] = rloc; + isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */ isa_ranges[3] = 0x0; isa_ranges[4] = 0x0; isa_ranges[5] = 0x00010000; - prom_setprop(isa, name, "ranges", + prom_setprop(isa, "/ht@0/isa@4", "ranges", isa_ranges, sizeof(isa_ranges)); } #else diff --git a/trunk/arch/powerpc/kernel/prom_parse.c b/trunk/arch/powerpc/kernel/prom_parse.c index 21009b1f7869..45df420383cc 100644 --- a/trunk/arch/powerpc/kernel/prom_parse.c +++ b/trunk/arch/powerpc/kernel/prom_parse.c @@ -38,6 +38,14 @@ static void of_dump_addr(const char *s, u32 *addr, int na) static void of_dump_addr(const char *s, u32 *addr, int na) { } #endif +/* Read a big address */ +static inline u64 of_read_addr(u32 *cell, int size) +{ + u64 r = 0; + while (size--) + r = (r << 32) | *(cell++); + return r; +} /* Callbacks for bus specific translators */ struct of_bus { @@ -69,9 +77,9 @@ static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna) { u64 cp, s, da; - cp = of_read_number(range, na); - s = of_read_number(range + na + pna, ns); - da = of_read_number(addr, na); + cp = of_read_addr(range, na); + s = of_read_addr(range + na + pna, ns); + da = of_read_addr(addr, na); DBG("OF: default map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da); @@ -83,7 +91,7 @@ static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna) static int of_bus_default_translate(u32 *addr, u64 offset, int na) { - u64 a = of_read_number(addr, na); + u64 a = of_read_addr(addr, na); memset(addr, 0, na * 4); a += offset; if (na > 1) @@ -127,9 +135,9 @@ static u64 of_bus_pci_map(u32 *addr, u32 *range, int na, int ns, int pna) return OF_BAD_ADDR; /* Read address values, skipping high cell */ - cp = of_read_number(range + 1, na - 1); - s = of_read_number(range + na + pna, ns); - da = of_read_number(addr + 1, na - 1); + cp = of_read_addr(range + 1, na - 1); + s = of_read_addr(range + na + pna, ns); + da = of_read_addr(addr + 1, na - 1); DBG("OF: PCI map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da); @@ -187,9 +195,9 @@ static u64 of_bus_isa_map(u32 *addr, u32 *range, int na, int ns, int pna) return OF_BAD_ADDR; /* Read address values, skipping high cell */ - cp = of_read_number(range + 1, na - 1); - s = of_read_number(range + na + pna, ns); - da = of_read_number(addr + 1, na - 1); + cp = of_read_addr(range + 1, na - 1); + s = of_read_addr(range + na + pna, ns); + da = of_read_addr(addr + 1, na - 1); DBG("OF: ISA map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da); @@ -287,7 +295,7 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus, */ ranges = (u32 *)get_property(parent, "ranges", &rlen); if (ranges == NULL || rlen == 0) { - offset = of_read_number(addr, na); + offset = of_read_addr(addr, na); memset(addr, 0, pna * 4); DBG("OF: no ranges, 1:1 translation\n"); goto finish; @@ -370,7 +378,7 @@ u64 of_translate_address(struct device_node *dev, u32 *in_addr) /* If root, we have finished */ if (parent == NULL) { DBG("OF: reached root node\n"); - result = of_read_number(addr, na); + result = of_read_addr(addr, na); break; } @@ -434,7 +442,7 @@ u32 *of_get_address(struct device_node *dev, int index, u64 *size, for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++) if (i == index) { if (size) - *size = of_read_number(prop + na, ns); + *size = of_read_addr(prop + na, ns); if (flags) *flags = bus->get_flags(prop); return prop; @@ -476,7 +484,7 @@ u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size, for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++) if ((prop[0] & 0xff) == ((bar_no * 4) + PCI_BASE_ADDRESS_0)) { if (size) - *size = of_read_number(prop + na, ns); + *size = of_read_addr(prop + na, ns); if (flags) *flags = bus->get_flags(prop); return prop; @@ -557,414 +565,11 @@ void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop, prop = get_property(dn, "#address-cells", NULL); cells = prop ? *(u32 *)prop : prom_n_addr_cells(dn); - *phys = of_read_number(dma_window, cells); + *phys = of_read_addr(dma_window, cells); dma_window += cells; prop = get_property(dn, "ibm,#dma-size-cells", NULL); cells = prop ? *(u32 *)prop : prom_n_size_cells(dn); - *size = of_read_number(dma_window, cells); -} - -/* - * Interrupt remapper - */ - -static unsigned int of_irq_workarounds; -static struct device_node *of_irq_dflt_pic; - -static struct device_node *of_irq_find_parent(struct device_node *child) -{ - struct device_node *p; - phandle *parp; - - if (!of_node_get(child)) - return NULL; - - do { - parp = (phandle *)get_property(child, "interrupt-parent", NULL); - if (parp == NULL) - p = of_get_parent(child); - else { - if (of_irq_workarounds & OF_IMAP_NO_PHANDLE) - p = of_node_get(of_irq_dflt_pic); - else - p = of_find_node_by_phandle(*parp); - } - of_node_put(child); - child = p; - } while (p && get_property(p, "#interrupt-cells", NULL) == NULL); - - return p; -} - -static u8 of_irq_pci_swizzle(u8 slot, u8 pin) -{ - return (((pin - 1) + slot) % 4) + 1; + *size = of_read_addr(dma_window, cells); } - -/* This doesn't need to be called if you don't have any special workaround - * flags to pass - */ -void of_irq_map_init(unsigned int flags) -{ - of_irq_workarounds = flags; - - /* OldWorld, don't bother looking at other things */ - if (flags & OF_IMAP_OLDWORLD_MAC) - return; - - /* If we don't have phandles, let's try to locate a default interrupt - * controller (happens when booting with BootX). We do a first match - * here, hopefully, that only ever happens on machines with one - * controller. - */ - if (flags & OF_IMAP_NO_PHANDLE) { - struct device_node *np; - - for(np = NULL; (np = of_find_all_nodes(np)) != NULL;) { - if (get_property(np, "interrupt-controller", NULL) - == NULL) - continue; - /* Skip /chosen/interrupt-controller */ - if (strcmp(np->name, "chosen") == 0) - continue; - /* It seems like at least one person on this planet wants - * to use BootX on a machine with an AppleKiwi controller - * which happens to pretend to be an interrupt - * controller too. - */ - if (strcmp(np->name, "AppleKiwi") == 0) - continue; - /* I think we found one ! */ - of_irq_dflt_pic = np; - break; - } - } - -} - -int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr, - struct of_irq *out_irq) -{ - struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL; - u32 *tmp, *imap, *imask; - u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0; - int imaplen, match, i; - - ipar = of_node_get(parent); - - /* First get the #interrupt-cells property of the current cursor - * that tells us how to interpret the passed-in intspec. If there - * is none, we are nice and just walk up the tree - */ - do { - tmp = (u32 *)get_property(ipar, "#interrupt-cells", NULL); - if (tmp != NULL) { - intsize = *tmp; - break; - } - tnode = ipar; - ipar = of_irq_find_parent(ipar); - of_node_put(tnode); - } while (ipar); - if (ipar == NULL) { - DBG(" -> no parent found !\n"); - goto fail; - } - - DBG("of_irq_map_raw: ipar=%s, size=%d\n", ipar->full_name, intsize); - - /* Look for this #address-cells. We have to implement the old linux - * trick of looking for the parent here as some device-trees rely on it - */ - old = of_node_get(ipar); - do { - tmp = (u32 *)get_property(old, "#address-cells", NULL); - tnode = of_get_parent(old); - of_node_put(old); - old = tnode; - } while(old && tmp == NULL); - of_node_put(old); - old = NULL; - addrsize = (tmp == NULL) ? 2 : *tmp; - - DBG(" -> addrsize=%d\n", addrsize); - - /* Now start the actual "proper" walk of the interrupt tree */ - while (ipar != NULL) { - /* Now check if cursor is an interrupt-controller and if it is - * then we are done - */ - if (get_property(ipar, "interrupt-controller", NULL) != NULL) { - DBG(" -> got it !\n"); - memcpy(out_irq->specifier, intspec, - intsize * sizeof(u32)); - out_irq->size = intsize; - out_irq->controller = ipar; - of_node_put(old); - return 0; - } - - /* Now look for an interrupt-map */ - imap = (u32 *)get_property(ipar, "interrupt-map", &imaplen); - /* No interrupt map, check for an interrupt parent */ - if (imap == NULL) { - DBG(" -> no map, getting parent\n"); - newpar = of_irq_find_parent(ipar); - goto skiplevel; - } - imaplen /= sizeof(u32); - - /* Look for a mask */ - imask = (u32 *)get_property(ipar, "interrupt-map-mask", NULL); - - /* If we were passed no "reg" property and we attempt to parse - * an interrupt-map, then #address-cells must be 0. - * Fail if it's not. - */ - if (addr == NULL && addrsize != 0) { - DBG(" -> no reg passed in when needed !\n"); - goto fail; - } - - /* Parse interrupt-map */ - match = 0; - while (imaplen > (addrsize + intsize + 1) && !match) { - /* Compare specifiers */ - match = 1; - for (i = 0; i < addrsize && match; ++i) { - u32 mask = imask ? imask[i] : 0xffffffffu; - match = ((addr[i] ^ imap[i]) & mask) == 0; - } - for (; i < (addrsize + intsize) && match; ++i) { - u32 mask = imask ? imask[i] : 0xffffffffu; - match = - ((intspec[i-addrsize] ^ imap[i]) & mask) == 0; - } - imap += addrsize + intsize; - imaplen -= addrsize + intsize; - - DBG(" -> match=%d (imaplen=%d)\n", match, imaplen); - - /* Get the interrupt parent */ - if (of_irq_workarounds & OF_IMAP_NO_PHANDLE) - newpar = of_node_get(of_irq_dflt_pic); - else - newpar = of_find_node_by_phandle((phandle)*imap); - imap++; - --imaplen; - - /* Check if not found */ - if (newpar == NULL) { - DBG(" -> imap parent not found !\n"); - goto fail; - } - - /* Get #interrupt-cells and #address-cells of new - * parent - */ - tmp = (u32 *)get_property(newpar, "#interrupt-cells", - NULL); - if (tmp == NULL) { - DBG(" -> parent lacks #interrupt-cells !\n"); - goto fail; - } - newintsize = *tmp; - tmp = (u32 *)get_property(newpar, "#address-cells", - NULL); - newaddrsize = (tmp == NULL) ? 0 : *tmp; - - DBG(" -> newintsize=%d, newaddrsize=%d\n", - newintsize, newaddrsize); - - /* Check for malformed properties */ - if (imaplen < (newaddrsize + newintsize)) - goto fail; - - imap += newaddrsize + newintsize; - imaplen -= newaddrsize + newintsize; - - DBG(" -> imaplen=%d\n", imaplen); - } - if (!match) - goto fail; - - of_node_put(old); - old = of_node_get(newpar); - addrsize = newaddrsize; - intsize = newintsize; - intspec = imap - intsize; - addr = intspec - addrsize; - - skiplevel: - /* Iterate again with new parent */ - DBG(" -> new parent: %s\n", newpar ? newpar->full_name : "<>"); - of_node_put(ipar); - ipar = newpar; - newpar = NULL; - } - fail: - of_node_put(ipar); - of_node_put(old); - of_node_put(newpar); - - return -EINVAL; -} -EXPORT_SYMBOL_GPL(of_irq_map_raw); - -#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32) -static int of_irq_map_oldworld(struct device_node *device, int index, - struct of_irq *out_irq) -{ - u32 *ints; - int intlen; - - /* - * Old machines just have a list of interrupt numbers - * and no interrupt-controller nodes. - */ - ints = (u32 *) get_property(device, "AAPL,interrupts", &intlen); - if (ints == NULL) - return -EINVAL; - intlen /= sizeof(u32); - - if (index >= intlen) - return -EINVAL; - - out_irq->controller = NULL; - out_irq->specifier[0] = ints[index]; - out_irq->size = 1; - - return 0; -} -#else /* defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32) */ -static int of_irq_map_oldworld(struct device_node *device, int index, - struct of_irq *out_irq) -{ - return -EINVAL; -} -#endif /* !(defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)) */ - -int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq) -{ - struct device_node *p; - u32 *intspec, *tmp, intsize, intlen, *addr; - int res; - - DBG("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index); - - /* OldWorld mac stuff is "special", handle out of line */ - if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC) - return of_irq_map_oldworld(device, index, out_irq); - - /* Get the interrupts property */ - intspec = (u32 *)get_property(device, "interrupts", &intlen); - if (intspec == NULL) - return -EINVAL; - intlen /= sizeof(u32); - - /* Get the reg property (if any) */ - addr = (u32 *)get_property(device, "reg", NULL); - - /* Look for the interrupt parent. */ - p = of_irq_find_parent(device); - if (p == NULL) - return -EINVAL; - - /* Get size of interrupt specifier */ - tmp = (u32 *)get_property(p, "#interrupt-cells", NULL); - if (tmp == NULL) { - of_node_put(p); - return -EINVAL; - } - intsize = *tmp; - - /* Check index */ - if (index * intsize >= intlen) - return -EINVAL; - - /* Get new specifier and map it */ - res = of_irq_map_raw(p, intspec + index * intsize, addr, out_irq); - of_node_put(p); - return res; -} -EXPORT_SYMBOL_GPL(of_irq_map_one); - -int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) -{ - struct device_node *dn, *ppnode; - struct pci_dev *ppdev; - u32 lspec; - u32 laddr[3]; - u8 pin; - int rc; - - /* Check if we have a device node, if yes, fallback to standard OF - * parsing - */ - dn = pci_device_to_OF_node(pdev); - if (dn) - return of_irq_map_one(dn, 0, out_irq); - - /* Ok, we don't, time to have fun. Let's start by building up an - * interrupt spec. we assume #interrupt-cells is 1, which is standard - * for PCI. If you do different, then don't use that routine. - */ - rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); - if (rc != 0) - return rc; - /* No pin, exit */ - if (pin == 0) - return -ENODEV; - - /* Now we walk up the PCI tree */ - lspec = pin; - for (;;) { - /* Get the pci_dev of our parent */ - ppdev = pdev->bus->self; - - /* Ouch, it's a host bridge... */ - if (ppdev == NULL) { -#ifdef CONFIG_PPC64 - ppnode = pci_bus_to_OF_node(pdev->bus); -#else - struct pci_controller *host; - host = pci_bus_to_host(pdev->bus); - ppnode = host ? host->arch_data : NULL; -#endif - /* No node for host bridge ? give up */ - if (ppnode == NULL) - return -EINVAL; - } else - /* We found a P2P bridge, check if it has a node */ - ppnode = pci_device_to_OF_node(ppdev); - - /* Ok, we have found a parent with a device-node, hand over to - * the OF parsing code. - * We build a unit address from the linux device to be used for - * resolution. Note that we use the linux bus number which may - * not match your firmware bus numbering. - * Fortunately, in most cases, interrupt-map-mask doesn't include - * the bus number as part of the matching. - * You should still be careful about that though if you intend - * to rely on this function (you ship a firmware that doesn't - * create device nodes for all PCI devices). - */ - if (ppnode) - break; - - /* We can only get here if we hit a P2P bridge with no node, - * let's do standard swizzling and try again - */ - lspec = of_irq_pci_swizzle(PCI_SLOT(pdev->devfn), lspec); - pdev = ppdev; - } - - laddr[0] = (pdev->bus->number << 16) - | (pdev->devfn << 8); - laddr[1] = laddr[2] = 0; - return of_irq_map_raw(ppnode, &lspec, laddr, out_irq); -} -EXPORT_SYMBOL_GPL(of_irq_map_pci); - diff --git a/trunk/arch/powerpc/kernel/ptrace-common.h b/trunk/arch/powerpc/kernel/ptrace-common.h index 8797ae737a7b..c42a860c8d25 100644 --- a/trunk/arch/powerpc/kernel/ptrace-common.h +++ b/trunk/arch/powerpc/kernel/ptrace-common.h @@ -10,6 +10,7 @@ #ifndef _PPC64_PTRACE_COMMON_H #define _PPC64_PTRACE_COMMON_H +#include #include /* diff --git a/trunk/arch/powerpc/kernel/ptrace.c b/trunk/arch/powerpc/kernel/ptrace.c index dea75d73f983..5563e2e7d89c 100644 --- a/trunk/arch/powerpc/kernel/ptrace.c +++ b/trunk/arch/powerpc/kernel/ptrace.c @@ -15,6 +15,7 @@ * this archive for more details. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/ptrace32.c b/trunk/arch/powerpc/kernel/ptrace32.c index 9b9a230349bc..826ee3d056de 100644 --- a/trunk/arch/powerpc/kernel/ptrace32.c +++ b/trunk/arch/powerpc/kernel/ptrace32.c @@ -17,6 +17,7 @@ * this archive for more details. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/rtas_pci.c b/trunk/arch/powerpc/kernel/rtas_pci.c index cda022657324..6eb7e49b394a 100644 --- a/trunk/arch/powerpc/kernel/rtas_pci.c +++ b/trunk/arch/powerpc/kernel/rtas_pci.c @@ -297,9 +297,19 @@ unsigned long __init find_and_init_phbs(void) struct device_node *node; struct pci_controller *phb; unsigned int index; + unsigned int root_size_cells = 0; + unsigned int *opprop = NULL; struct device_node *root = of_find_node_by_path("/"); + if (ppc64_interrupt_controller == IC_OPEN_PIC) { + opprop = (unsigned int *)get_property(root, + "platform-open-pic", NULL); + } + + root_size_cells = prom_n_size_cells(root); + index = 0; + for (node = of_get_next_child(root, NULL); node != NULL; node = of_get_next_child(root, node)) { @@ -314,6 +324,13 @@ unsigned long __init find_and_init_phbs(void) setup_phb(node, phb); pci_process_bridge_OF_ranges(phb, node, 0); pci_setup_phb_io(phb, index == 0); +#ifdef CONFIG_PPC_PSERIES + /* XXX This code need serious fixing ... --BenH */ + if (ppc64_interrupt_controller == IC_OPEN_PIC && pSeries_mpic) { + int addr = root_size_cells * (index + 2) - 1; + mpic_assign_isu(pSeries_mpic, index, opprop[addr]); + } +#endif index++; } diff --git a/trunk/arch/powerpc/kernel/setup-common.c b/trunk/arch/powerpc/kernel/setup-common.c index c6d7b98af7d5..bd328123af75 100644 --- a/trunk/arch/powerpc/kernel/setup-common.c +++ b/trunk/arch/powerpc/kernel/setup-common.c @@ -12,6 +12,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/setup_32.c b/trunk/arch/powerpc/kernel/setup_32.c index e0df2ba1ab9f..0932a62a1c96 100644 --- a/trunk/arch/powerpc/kernel/setup_32.c +++ b/trunk/arch/powerpc/kernel/setup_32.c @@ -2,6 +2,7 @@ * Common prep/pmac/chrp boot and setup code. */ +#include #include #include #include @@ -51,6 +52,7 @@ extern void bootx_init(unsigned long r4, unsigned long phys); +boot_infos_t *boot_infos; struct ide_machdep_calls ppc_ide_md; int boot_cpuid; @@ -239,6 +241,7 @@ void __init setup_arch(char **cmdline_p) ppc_md.init_early(); find_legacy_serial_ports(); + finish_device_tree(); smp_setup_cpu_maps(); diff --git a/trunk/arch/powerpc/kernel/setup_64.c b/trunk/arch/powerpc/kernel/setup_64.c index fd1785e4c9bb..175539c9afa0 100644 --- a/trunk/arch/powerpc/kernel/setup_64.c +++ b/trunk/arch/powerpc/kernel/setup_64.c @@ -12,6 +12,7 @@ #undef DEBUG +#include #include #include #include @@ -361,15 +362,12 @@ void __init setup_system(void) /* * Fill the ppc64_caches & systemcfg structures with informations - * retrieved from the device-tree. + * retrieved from the device-tree. Need to be called before + * finish_device_tree() since the later requires some of the + * informations filled up here to properly parse the interrupt tree. */ initialize_cache_info(); - /* - * Initialize irq remapping subsystem - */ - irq_early_init(); - #ifdef CONFIG_PPC_RTAS /* * Initialize RTAS if available @@ -396,6 +394,12 @@ void __init setup_system(void) */ find_legacy_serial_ports(); + /* + * "Finish" the device-tree, that is do the actual parsing of + * some of the properties like the interrupt map + */ + finish_device_tree(); + /* * Initialize xmon */ @@ -424,6 +428,8 @@ void __init setup_system(void) printk("-----------------------------------------------------\n"); printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); + printk("ppc64_interrupt_controller = 0x%ld\n", + ppc64_interrupt_controller); printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); printk("ppc64_caches.dcache_line_size = 0x%x\n", ppc64_caches.dline_size); diff --git a/trunk/arch/powerpc/kernel/signal_32.c b/trunk/arch/powerpc/kernel/signal_32.c index 320353f0926f..d73b25e22fca 100644 --- a/trunk/arch/powerpc/kernel/signal_32.c +++ b/trunk/arch/powerpc/kernel/signal_32.c @@ -17,6 +17,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/signal_64.c b/trunk/arch/powerpc/kernel/signal_64.c index f72e8e823d78..6e75d7ab6d4d 100644 --- a/trunk/arch/powerpc/kernel/signal_64.c +++ b/trunk/arch/powerpc/kernel/signal_64.c @@ -12,6 +12,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/smp-tbsync.c b/trunk/arch/powerpc/kernel/smp-tbsync.c index f19e2e0e61e7..9adef3bddad4 100644 --- a/trunk/arch/powerpc/kernel/smp-tbsync.c +++ b/trunk/arch/powerpc/kernel/smp-tbsync.c @@ -5,6 +5,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/smp.c b/trunk/arch/powerpc/kernel/smp.c index 46c56cfd1b2f..c5d179d4f818 100644 --- a/trunk/arch/powerpc/kernel/smp.c +++ b/trunk/arch/powerpc/kernel/smp.c @@ -17,6 +17,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/swsusp_32.S b/trunk/arch/powerpc/kernel/swsusp_32.S index 7369f9a6ad25..69773cc1a85f 100644 --- a/trunk/arch/powerpc/kernel/swsusp_32.S +++ b/trunk/arch/powerpc/kernel/swsusp_32.S @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/sys_ppc32.c b/trunk/arch/powerpc/kernel/sys_ppc32.c index 2e292863e982..ec274e688816 100644 --- a/trunk/arch/powerpc/kernel/sys_ppc32.c +++ b/trunk/arch/powerpc/kernel/sys_ppc32.c @@ -14,6 +14,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/sysfs.c b/trunk/arch/powerpc/kernel/sysfs.c index 010435095550..4662b580efa1 100644 --- a/trunk/arch/powerpc/kernel/sysfs.c +++ b/trunk/arch/powerpc/kernel/sysfs.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/systbl.S b/trunk/arch/powerpc/kernel/systbl.S index 579de70e0b4d..ee75ccf1a802 100644 --- a/trunk/arch/powerpc/kernel/systbl.S +++ b/trunk/arch/powerpc/kernel/systbl.S @@ -14,6 +14,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #ifdef CONFIG_PPC64 diff --git a/trunk/arch/powerpc/kernel/tau_6xx.c b/trunk/arch/powerpc/kernel/tau_6xx.c index 368a4934f7ee..26bd8ea35a4e 100644 --- a/trunk/arch/powerpc/kernel/tau_6xx.c +++ b/trunk/arch/powerpc/kernel/tau_6xx.c @@ -11,6 +11,7 @@ * life in portables, and add a 'performance/watt' metric somewhere in /proc */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/time.c b/trunk/arch/powerpc/kernel/time.c index 774c0a3c5019..7dd5dab789a1 100644 --- a/trunk/arch/powerpc/kernel/time.c +++ b/trunk/arch/powerpc/kernel/time.c @@ -32,6 +32,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/traps.c b/trunk/arch/powerpc/kernel/traps.c index 3c668078e524..fa6bd97b6b9d 100644 --- a/trunk/arch/powerpc/kernel/traps.c +++ b/trunk/arch/powerpc/kernel/traps.c @@ -14,6 +14,7 @@ * This file handles the architecture-dependent parts of hardware exceptions */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/udbg.c b/trunk/arch/powerpc/kernel/udbg.c index 5730906b23d5..759afd5e0d8a 100644 --- a/trunk/arch/powerpc/kernel/udbg.c +++ b/trunk/arch/powerpc/kernel/udbg.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/udbg_16550.c b/trunk/arch/powerpc/kernel/udbg_16550.c index 0835b4841dea..5d29dcca523c 100644 --- a/trunk/arch/powerpc/kernel/udbg_16550.c +++ b/trunk/arch/powerpc/kernel/udbg_16550.c @@ -8,6 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vdso.c b/trunk/arch/powerpc/kernel/vdso.c index 1a7e19cdab39..bc3e15be3087 100644 --- a/trunk/arch/powerpc/kernel/vdso.c +++ b/trunk/arch/powerpc/kernel/vdso.c @@ -8,6 +8,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vdso32/cacheflush.S b/trunk/arch/powerpc/kernel/vdso32/cacheflush.S index 9cb319992c38..09629aea3e47 100644 --- a/trunk/arch/powerpc/kernel/vdso32/cacheflush.S +++ b/trunk/arch/powerpc/kernel/vdso32/cacheflush.S @@ -9,6 +9,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vdso32/datapage.S b/trunk/arch/powerpc/kernel/vdso32/datapage.S index dc21e891d2e7..4709f1d9542c 100644 --- a/trunk/arch/powerpc/kernel/vdso32/datapage.S +++ b/trunk/arch/powerpc/kernel/vdso32/datapage.S @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vdso32/gettimeofday.S b/trunk/arch/powerpc/kernel/vdso32/gettimeofday.S index 05909f754307..7eebff03a041 100644 --- a/trunk/arch/powerpc/kernel/vdso32/gettimeofday.S +++ b/trunk/arch/powerpc/kernel/vdso32/gettimeofday.S @@ -10,6 +10,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vdso32/sigtramp.S b/trunk/arch/powerpc/kernel/vdso32/sigtramp.S index 68d49dd71dcc..0c6a37b29dde 100644 --- a/trunk/arch/powerpc/kernel/vdso32/sigtramp.S +++ b/trunk/arch/powerpc/kernel/vdso32/sigtramp.S @@ -10,6 +10,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vdso64/cacheflush.S b/trunk/arch/powerpc/kernel/vdso64/cacheflush.S index 66a36d3cc6ad..cb4ae0a5edd0 100644 --- a/trunk/arch/powerpc/kernel/vdso64/cacheflush.S +++ b/trunk/arch/powerpc/kernel/vdso64/cacheflush.S @@ -9,6 +9,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vdso64/datapage.S b/trunk/arch/powerpc/kernel/vdso64/datapage.S index 79796de11737..3b2dd7d0c1eb 100644 --- a/trunk/arch/powerpc/kernel/vdso64/datapage.S +++ b/trunk/arch/powerpc/kernel/vdso64/datapage.S @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S b/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S index 56e76ff5498f..4ee871f1cadb 100644 --- a/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S +++ b/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S @@ -11,6 +11,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vdso64/sigtramp.S b/trunk/arch/powerpc/kernel/vdso64/sigtramp.S index 17a83fa6dc52..7479edb101b8 100644 --- a/trunk/arch/powerpc/kernel/vdso64/sigtramp.S +++ b/trunk/arch/powerpc/kernel/vdso64/sigtramp.S @@ -10,6 +10,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/kernel/vector.S b/trunk/arch/powerpc/kernel/vector.S index 49ac3d6e1399..9416b4ab92ec 100644 --- a/trunk/arch/powerpc/kernel/vector.S +++ b/trunk/arch/powerpc/kernel/vector.S @@ -1,3 +1,4 @@ +#include #include #include diff --git a/trunk/arch/powerpc/kernel/vio.c b/trunk/arch/powerpc/kernel/vio.c index fad8580f9081..cdf5867838a6 100644 --- a/trunk/arch/powerpc/kernel/vio.c +++ b/trunk/arch/powerpc/kernel/vio.c @@ -218,6 +218,7 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node) { struct vio_dev *viodev; unsigned int *unit_address; + unsigned int *irq_p; /* we need the 'device_type' property, in order to match with drivers */ if (of_node->type == NULL) { @@ -242,7 +243,16 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node) viodev->dev.platform_data = of_node_get(of_node); - viodev->irq = irq_of_parse_and_map(of_node, 0); + viodev->irq = NO_IRQ; + irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL); + if (irq_p) { + int virq = virt_irq_create_mapping(*irq_p); + if (virq == NO_IRQ) { + printk(KERN_ERR "Unable to allocate interrupt " + "number for %s\n", of_node->full_name); + } else + viodev->irq = irq_offset_up(virq); + } snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address); viodev->name = of_node->name; diff --git a/trunk/arch/powerpc/kernel/vmlinux.lds.S b/trunk/arch/powerpc/kernel/vmlinux.lds.S index 02665a02130d..8b25953dc4f0 100644 --- a/trunk/arch/powerpc/kernel/vmlinux.lds.S +++ b/trunk/arch/powerpc/kernel/vmlinux.lds.S @@ -1,3 +1,4 @@ +#include #ifdef CONFIG_PPC64 #include #define PROVIDE32(x) PROVIDE(__unused__##x) diff --git a/trunk/arch/powerpc/lib/copy_32.S b/trunk/arch/powerpc/lib/copy_32.S index c657de59abca..bee51414812e 100644 --- a/trunk/arch/powerpc/lib/copy_32.S +++ b/trunk/arch/powerpc/lib/copy_32.S @@ -8,6 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/lib/locks.c b/trunk/arch/powerpc/lib/locks.c index 077bed7dc52b..8362fa272ca5 100644 --- a/trunk/arch/powerpc/lib/locks.c +++ b/trunk/arch/powerpc/lib/locks.c @@ -12,6 +12,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/lib/sstep.c b/trunk/arch/powerpc/lib/sstep.c index 9590ba780b98..c251d9936612 100644 --- a/trunk/arch/powerpc/lib/sstep.c +++ b/trunk/arch/powerpc/lib/sstep.c @@ -10,6 +10,7 @@ */ #include #include +#include #include #include diff --git a/trunk/arch/powerpc/lib/string.S b/trunk/arch/powerpc/lib/string.S index c4c622d8e6ac..b9ca84ed8927 100644 --- a/trunk/arch/powerpc/lib/string.S +++ b/trunk/arch/powerpc/lib/string.S @@ -8,6 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/math-emu/math.c b/trunk/arch/powerpc/math-emu/math.c index 69058b2873de..589153472761 100644 --- a/trunk/arch/powerpc/math-emu/math.c +++ b/trunk/arch/powerpc/math-emu/math.c @@ -2,6 +2,7 @@ * Copyright (C) 1999 Eddie C. Dost (ecd@atecom.com) */ +#include #include #include diff --git a/trunk/arch/powerpc/mm/44x_mmu.c b/trunk/arch/powerpc/mm/44x_mmu.c index 376829ed2211..3d79ce281b67 100644 --- a/trunk/arch/powerpc/mm/44x_mmu.c +++ b/trunk/arch/powerpc/mm/44x_mmu.c @@ -24,6 +24,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/4xx_mmu.c b/trunk/arch/powerpc/mm/4xx_mmu.c index 838e09db71d9..4d006aa1a0d1 100644 --- a/trunk/arch/powerpc/mm/4xx_mmu.c +++ b/trunk/arch/powerpc/mm/4xx_mmu.c @@ -21,6 +21,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/fault.c b/trunk/arch/powerpc/mm/fault.c index 78a0d59903ee..a0a9e1e0061e 100644 --- a/trunk/arch/powerpc/mm/fault.c +++ b/trunk/arch/powerpc/mm/fault.c @@ -15,6 +15,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/fsl_booke_mmu.c b/trunk/arch/powerpc/mm/fsl_booke_mmu.c index 123da03ab118..5d581bb3aa12 100644 --- a/trunk/arch/powerpc/mm/fsl_booke_mmu.c +++ b/trunk/arch/powerpc/mm/fsl_booke_mmu.c @@ -26,6 +26,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/hash_low_32.S b/trunk/arch/powerpc/mm/hash_low_32.S index bd68df5fa78a..94255beeecd3 100644 --- a/trunk/arch/powerpc/mm/hash_low_32.S +++ b/trunk/arch/powerpc/mm/hash_low_32.S @@ -21,6 +21,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/hash_low_64.S b/trunk/arch/powerpc/mm/hash_low_64.S index 9bc0a9c2b9bc..52e914238959 100644 --- a/trunk/arch/powerpc/mm/hash_low_64.S +++ b/trunk/arch/powerpc/mm/hash_low_64.S @@ -10,6 +10,7 @@ * described in the kernel's COPYING file. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/hash_utils_64.c b/trunk/arch/powerpc/mm/hash_utils_64.c index 1915661c2c81..3cc6d68f7117 100644 --- a/trunk/arch/powerpc/mm/hash_utils_64.c +++ b/trunk/arch/powerpc/mm/hash_utils_64.c @@ -21,6 +21,7 @@ #undef DEBUG #undef DEBUG_LOW +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/init_32.c b/trunk/arch/powerpc/mm/init_32.c index 0e53ca8f02fb..b57fb3a2b7bb 100644 --- a/trunk/arch/powerpc/mm/init_32.c +++ b/trunk/arch/powerpc/mm/init_32.c @@ -18,6 +18,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/init_64.c b/trunk/arch/powerpc/mm/init_64.c index 3ff374697e34..d454caada265 100644 --- a/trunk/arch/powerpc/mm/init_64.c +++ b/trunk/arch/powerpc/mm/init_64.c @@ -22,6 +22,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/lmb.c b/trunk/arch/powerpc/mm/lmb.c index 4b17a7359924..8b6f522655a6 100644 --- a/trunk/arch/powerpc/mm/lmb.c +++ b/trunk/arch/powerpc/mm/lmb.c @@ -10,6 +10,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/mem.c b/trunk/arch/powerpc/mm/mem.c index eebd8b83a6b0..089d939a0b3e 100644 --- a/trunk/arch/powerpc/mm/mem.c +++ b/trunk/arch/powerpc/mm/mem.c @@ -18,6 +18,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/mmu_context_32.c b/trunk/arch/powerpc/mm/mmu_context_32.c index 792086b01000..e326e4249e1a 100644 --- a/trunk/arch/powerpc/mm/mmu_context_32.c +++ b/trunk/arch/powerpc/mm/mmu_context_32.c @@ -23,6 +23,7 @@ * */ +#include #include #include diff --git a/trunk/arch/powerpc/mm/mmu_context_64.c b/trunk/arch/powerpc/mm/mmu_context_64.c index 90a06ac02d5e..e2051efa09c5 100644 --- a/trunk/arch/powerpc/mm/mmu_context_64.c +++ b/trunk/arch/powerpc/mm/mmu_context_64.c @@ -10,6 +10,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/pgtable_32.c b/trunk/arch/powerpc/mm/pgtable_32.c index 8fcacb0239da..90628601fac7 100644 --- a/trunk/arch/powerpc/mm/pgtable_32.c +++ b/trunk/arch/powerpc/mm/pgtable_32.c @@ -20,6 +20,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/pgtable_64.c b/trunk/arch/powerpc/mm/pgtable_64.c index b1da03165496..7b278d83739e 100644 --- a/trunk/arch/powerpc/mm/pgtable_64.c +++ b/trunk/arch/powerpc/mm/pgtable_64.c @@ -22,6 +22,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/ppc_mmu_32.c b/trunk/arch/powerpc/mm/ppc_mmu_32.c index 7cceb2c44cb9..2ed43a493b31 100644 --- a/trunk/arch/powerpc/mm/ppc_mmu_32.c +++ b/trunk/arch/powerpc/mm/ppc_mmu_32.c @@ -23,6 +23,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/slb.c b/trunk/arch/powerpc/mm/slb.c index de0c8842415c..6a8bf6c6000e 100644 --- a/trunk/arch/powerpc/mm/slb.c +++ b/trunk/arch/powerpc/mm/slb.c @@ -16,6 +16,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/slb_low.S b/trunk/arch/powerpc/mm/slb_low.S index dbc1abbde038..8548dcf8ef8b 100644 --- a/trunk/arch/powerpc/mm/slb_low.S +++ b/trunk/arch/powerpc/mm/slb_low.S @@ -14,6 +14,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/stab.c b/trunk/arch/powerpc/mm/stab.c index eeeacab548e6..691320c90b78 100644 --- a/trunk/arch/powerpc/mm/stab.c +++ b/trunk/arch/powerpc/mm/stab.c @@ -12,6 +12,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/tlb_32.c b/trunk/arch/powerpc/mm/tlb_32.c index 925ff70be8ba..02eb23e036d5 100644 --- a/trunk/arch/powerpc/mm/tlb_32.c +++ b/trunk/arch/powerpc/mm/tlb_32.c @@ -23,6 +23,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/mm/tlb_64.c b/trunk/arch/powerpc/mm/tlb_64.c index f6eef78efd29..e7449b068c82 100644 --- a/trunk/arch/powerpc/mm/tlb_64.c +++ b/trunk/arch/powerpc/mm/tlb_64.c @@ -22,6 +22,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/83xx/Kconfig b/trunk/arch/powerpc/platforms/83xx/Kconfig index 5fe7b7faf45f..7675e675dce1 100644 --- a/trunk/arch/powerpc/platforms/83xx/Kconfig +++ b/trunk/arch/powerpc/platforms/83xx/Kconfig @@ -16,21 +16,12 @@ config MPC834x_SYS 3 PCI slots. The PIBs PCI initialization is the bootloader's responsiblilty. -config MPC834x_ITX - bool "Freescale MPC834x ITX" - select DEFAULT_UIMAGE - help - This option enables support for the MPC 834x ITX evaluation board. - - Be aware that PCI initialization is the bootloader's - responsiblilty. - endchoice config MPC834x bool select PPC_UDBG_16550 select PPC_INDIRECT_PCI - default y if MPC834x_SYS || MPC834x_ITX + default y if MPC834x_SYS endmenu diff --git a/trunk/arch/powerpc/platforms/83xx/Makefile b/trunk/arch/powerpc/platforms/83xx/Makefile index 9387a110d28a..5c72367441a8 100644 --- a/trunk/arch/powerpc/platforms/83xx/Makefile +++ b/trunk/arch/powerpc/platforms/83xx/Makefile @@ -4,4 +4,3 @@ obj-y := misc.o obj-$(CONFIG_PCI) += pci.o obj-$(CONFIG_MPC834x_SYS) += mpc834x_sys.o -obj-$(CONFIG_MPC834x_ITX) += mpc834x_itx.o diff --git a/trunk/arch/powerpc/platforms/83xx/misc.c b/trunk/arch/powerpc/platforms/83xx/misc.c index f0c6df61faa9..1455bcef4892 100644 --- a/trunk/arch/powerpc/platforms/83xx/misc.c +++ b/trunk/arch/powerpc/platforms/83xx/misc.c @@ -9,6 +9,7 @@ * option) any later version. */ +#include #include #include diff --git a/trunk/arch/powerpc/platforms/83xx/mpc834x_itx.c b/trunk/arch/powerpc/platforms/83xx/mpc834x_itx.c deleted file mode 100644 index b46305645d38..000000000000 --- a/trunk/arch/powerpc/platforms/83xx/mpc834x_itx.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * arch/powerpc/platforms/83xx/mpc834x_itx.c - * - * MPC834x ITX board specific routines - * - * Maintainer: Kumar Gala - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "mpc83xx.h" - -#include - -#ifndef CONFIG_PCI -unsigned long isa_io_base = 0; -unsigned long isa_mem_base = 0; -#endif - -#ifdef CONFIG_PCI -static int -mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) -{ - static char pci_irq_table[][4] = - /* - * PCI IDSEL/INTPIN->INTLINE - * A B C D - */ - { - {PIRQB, PIRQC, PIRQD, PIRQA}, /* idsel 0x0e */ - {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x0f */ - {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x10 */ - }; - - const long min_idsel = 0x0e, max_idsel = 0x10, irqs_per_slot = 4; - return PCI_IRQ_TABLE_LOOKUP; -} -#endif /* CONFIG_PCI */ - -/* ************************************************************************ - * - * Setup the architecture - * - */ -static void __init mpc834x_itx_setup_arch(void) -{ - struct device_node *np; - - if (ppc_md.progress) - ppc_md.progress("mpc834x_itx_setup_arch()", 0); - - np = of_find_node_by_type(NULL, "cpu"); - if (np != 0) { - unsigned int *fp = - (int *)get_property(np, "clock-frequency", NULL); - if (fp != 0) - loops_per_jiffy = *fp / HZ; - else - loops_per_jiffy = 50000000 / HZ; - of_node_put(np); - } -#ifdef CONFIG_PCI - for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) - add_bridge(np); - - ppc_md.pci_swizzle = common_swizzle; - ppc_md.pci_map_irq = mpc83xx_map_irq; - ppc_md.pci_exclude_device = mpc83xx_exclude_device; -#endif - -#ifdef CONFIG_ROOT_NFS - ROOT_DEV = Root_NFS; -#else - ROOT_DEV = Root_HDA1; -#endif -} - -void __init mpc834x_itx_init_IRQ(void) -{ - u8 senses[8] = { - 0, /* EXT 0 */ - IRQ_SENSE_LEVEL, /* EXT 1 */ - IRQ_SENSE_LEVEL, /* EXT 2 */ - 0, /* EXT 3 */ -#ifdef CONFIG_PCI - IRQ_SENSE_LEVEL, /* EXT 4 */ - IRQ_SENSE_LEVEL, /* EXT 5 */ - IRQ_SENSE_LEVEL, /* EXT 6 */ - IRQ_SENSE_LEVEL, /* EXT 7 */ -#else - 0, /* EXT 4 */ - 0, /* EXT 5 */ - 0, /* EXT 6 */ - 0, /* EXT 7 */ -#endif - }; - - ipic_init(get_immrbase() + 0x00700, 0, 0, senses, 8); - - /* Initialize the default interrupt mapping priorities, - * in case the boot rom changed something on us. - */ - ipic_set_default_priority(); -} - -/* - * Called very early, MMU is off, device-tree isn't unflattened - */ -static int __init mpc834x_itx_probe(void) -{ - /* We always match for now, eventually we should look at the flat - dev tree to ensure this is the board we are suppose to run on - */ - return 1; -} - -define_machine(mpc834x_itx) { - .name = "MPC834x ITX", - .probe = mpc834x_itx_probe, - .setup_arch = mpc834x_itx_setup_arch, - .init_IRQ = mpc834x_itx_init_IRQ, - .get_irq = ipic_get_irq, - .restart = mpc83xx_restart, - .time_init = mpc83xx_time_init, - .calibrate_decr = generic_calibrate_decr, - .progress = udbg_progress, -}; diff --git a/trunk/arch/powerpc/platforms/83xx/mpc834x_itx.h b/trunk/arch/powerpc/platforms/83xx/mpc834x_itx.h deleted file mode 100644 index 174ca4ef55f3..000000000000 --- a/trunk/arch/powerpc/platforms/83xx/mpc834x_itx.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * arch/powerpc/platforms/83xx/mpc834x_itx.h - * - * MPC834X ITX common board definitions - * - * Maintainer: Kumar Gala - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - */ - -#ifndef __MACH_MPC83XX_ITX_H__ -#define __MACH_MPC83XX_ITX_H__ - -#define PIRQA MPC83xx_IRQ_EXT4 -#define PIRQB MPC83xx_IRQ_EXT5 -#define PIRQC MPC83xx_IRQ_EXT6 -#define PIRQD MPC83xx_IRQ_EXT7 - -#endif /* __MACH_MPC83XX_ITX_H__ */ diff --git a/trunk/arch/powerpc/platforms/83xx/mpc834x_sys.c b/trunk/arch/powerpc/platforms/83xx/mpc834x_sys.c index 3e1c16eb4a63..7e789d2420ba 100644 --- a/trunk/arch/powerpc/platforms/83xx/mpc834x_sys.c +++ b/trunk/arch/powerpc/platforms/83xx/mpc834x_sys.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/83xx/pci.c b/trunk/arch/powerpc/platforms/83xx/pci.c index 3b5e563c279f..3baceb00fefa 100644 --- a/trunk/arch/powerpc/platforms/83xx/pci.c +++ b/trunk/arch/powerpc/platforms/83xx/pci.c @@ -9,6 +9,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/85xx/mpc8540_ads.h b/trunk/arch/powerpc/platforms/85xx/mpc8540_ads.h index c0d56d2bb5a5..f770cadb2080 100644 --- a/trunk/arch/powerpc/platforms/85xx/mpc8540_ads.h +++ b/trunk/arch/powerpc/platforms/85xx/mpc8540_ads.h @@ -17,6 +17,7 @@ #ifndef __MACH_MPC8540ADS_H__ #define __MACH_MPC8540ADS_H__ +#include #include #define BOARD_CCSRBAR ((uint)0xe0000000) diff --git a/trunk/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/trunk/arch/powerpc/platforms/85xx/mpc85xx_ads.c index 06a497676c99..5eeff370f5fc 100644 --- a/trunk/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/trunk/arch/powerpc/platforms/85xx/mpc85xx_ads.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/85xx/pci.c b/trunk/arch/powerpc/platforms/85xx/pci.c index 1d51f3242ab1..48c8849c07ca 100644 --- a/trunk/arch/powerpc/platforms/85xx/pci.c +++ b/trunk/arch/powerpc/platforms/85xx/pci.c @@ -9,6 +9,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/cell/interrupt.c b/trunk/arch/powerpc/platforms/cell/interrupt.c index 9d5da7896892..7bff3cbc5723 100644 --- a/trunk/arch/powerpc/platforms/cell/interrupt.c +++ b/trunk/arch/powerpc/platforms/cell/interrupt.c @@ -1,9 +1,6 @@ /* * Cell Internal Interrupt Controller * - * Copyright (C) 2006 Benjamin Herrenschmidt (benh@kernel.crashing.org) - * IBM, Corp. - * * (C) Copyright IBM Deutschland Entwicklung GmbH 2005 * * Author: Arnd Bergmann @@ -23,18 +20,17 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include #include #include -#include #include #include #include #include -#include #include "interrupt.h" #include "cbe_regs.h" @@ -42,65 +38,231 @@ struct iic { struct cbe_iic_thread_regs __iomem *regs; u8 target_id; - u8 eoi_stack[16]; - int eoi_ptr; - struct irq_host *host; }; static DEFINE_PER_CPU(struct iic, iic); -#define IIC_NODE_COUNT 2 -static struct irq_host *iic_hosts[IIC_NODE_COUNT]; -/* Convert between "pending" bits and hw irq number */ -static irq_hw_number_t iic_pending_to_hwnum(struct cbe_iic_pending_bits bits) +void iic_local_enable(void) { - unsigned char unit = bits.source & 0xf; + struct iic *iic = &__get_cpu_var(iic); + u64 tmp; + + /* + * There seems to be a bug that is present in DD2.x CPUs + * and still only partially fixed in DD3.1. + * This bug causes a value written to the priority register + * not to make it there, resulting in a system hang unless we + * write it again. + * Masking with 0xf0 is done because the Cell BE does not + * implement the lower four bits of the interrupt priority, + * they always read back as zeroes, although future CPUs + * might implement different bits. + */ + do { + out_be64(&iic->regs->prio, 0xff); + tmp = in_be64(&iic->regs->prio); + } while ((tmp & 0xf0) != 0xf0); +} - if (bits.flags & CBE_IIC_IRQ_IPI) - return IIC_IRQ_IPI0 | (bits.prio >> 4); - else if (bits.class <= 3) - return (bits.class << 4) | unit; - else - return IIC_IRQ_INVALID; +void iic_local_disable(void) +{ + out_be64(&__get_cpu_var(iic).regs->prio, 0x0); +} + +static unsigned int iic_startup(unsigned int irq) +{ + return 0; } -static void iic_mask(unsigned int irq) +static void iic_enable(unsigned int irq) { + iic_local_enable(); } -static void iic_unmask(unsigned int irq) +static void iic_disable(unsigned int irq) { } -static void iic_eoi(unsigned int irq) +static void iic_end(unsigned int irq) { - struct iic *iic = &__get_cpu_var(iic); - out_be64(&iic->regs->prio, iic->eoi_stack[--iic->eoi_ptr]); - BUG_ON(iic->eoi_ptr < 0); + iic_local_enable(); } -static struct irq_chip iic_chip = { +static struct hw_interrupt_type iic_pic = { .typename = " CELL-IIC ", - .mask = iic_mask, - .unmask = iic_unmask, - .eoi = iic_eoi, + .startup = iic_startup, + .enable = iic_enable, + .disable = iic_disable, + .end = iic_end, }; +static int iic_external_get_irq(struct cbe_iic_pending_bits pending) +{ + int irq; + unsigned char node, unit; + + node = pending.source >> 4; + unit = pending.source & 0xf; + irq = -1; + + /* + * This mapping is specific to the Cell Broadband + * Engine. We might need to get the numbers + * from the device tree to support future CPUs. + */ + switch (unit) { + case 0x00: + case 0x0b: + /* + * One of these units can be connected + * to an external interrupt controller. + */ + if (pending.class != 2) + break; + irq = IIC_EXT_OFFSET + + spider_get_irq(node) + + node * IIC_NODE_STRIDE; + break; + case 0x01 ... 0x04: + case 0x07 ... 0x0a: + /* + * These units are connected to the SPEs + */ + if (pending.class > 2) + break; + irq = IIC_SPE_OFFSET + + pending.class * IIC_CLASS_STRIDE + + node * IIC_NODE_STRIDE + + unit; + break; + } + if (irq == -1) + printk(KERN_WARNING "Unexpected interrupt class %02x, " + "source %02x, prio %02x, cpu %02x\n", pending.class, + pending.source, pending.prio, smp_processor_id()); + return irq; +} + /* Get an IRQ number from the pending state register of the IIC */ -static unsigned int iic_get_irq(struct pt_regs *regs) +int iic_get_irq(struct pt_regs *regs) { - struct cbe_iic_pending_bits pending; - struct iic *iic; - - iic = &__get_cpu_var(iic); - *(unsigned long *) &pending = - in_be64((unsigned long __iomem *) &iic->regs->pending_destr); - iic->eoi_stack[++iic->eoi_ptr] = pending.prio; - BUG_ON(iic->eoi_ptr > 15); - if (pending.flags & CBE_IIC_IRQ_VALID) - return irq_linear_revmap(iic->host, - iic_pending_to_hwnum(pending)); - return NO_IRQ; + struct iic *iic; + int irq; + struct cbe_iic_pending_bits pending; + + iic = &__get_cpu_var(iic); + *(unsigned long *) &pending = + in_be64((unsigned long __iomem *) &iic->regs->pending_destr); + + irq = -1; + if (pending.flags & CBE_IIC_IRQ_VALID) { + if (pending.flags & CBE_IIC_IRQ_IPI) { + irq = IIC_IPI_OFFSET + (pending.prio >> 4); +/* + if (irq > 0x80) + printk(KERN_WARNING "Unexpected IPI prio %02x" + "on CPU %02x\n", pending.prio, + smp_processor_id()); +*/ + } else { + irq = iic_external_get_irq(pending); + } + } + return irq; +} + +/* hardcoded part to be compatible with older firmware */ + +static int setup_iic_hardcoded(void) +{ + struct device_node *np; + int nodeid, cpu; + unsigned long regs; + struct iic *iic; + + for_each_possible_cpu(cpu) { + iic = &per_cpu(iic, cpu); + nodeid = cpu/2; + + for (np = of_find_node_by_type(NULL, "cpu"); + np; + np = of_find_node_by_type(np, "cpu")) { + if (nodeid == *(int *)get_property(np, "node-id", NULL)) + break; + } + + if (!np) { + printk(KERN_WARNING "IIC: CPU %d not found\n", cpu); + iic->regs = NULL; + iic->target_id = 0xff; + return -ENODEV; + } + + regs = *(long *)get_property(np, "iic", NULL); + + /* hack until we have decided on the devtree info */ + regs += 0x400; + if (cpu & 1) + regs += 0x20; + + printk(KERN_INFO "IIC for CPU %d at %lx\n", cpu, regs); + iic->regs = ioremap(regs, sizeof(struct cbe_iic_thread_regs)); + iic->target_id = (nodeid << 4) + ((cpu & 1) ? 0xf : 0xe); + } + + return 0; +} + +static int setup_iic(void) +{ + struct device_node *dn; + unsigned long *regs; + char *compatible; + unsigned *np, found = 0; + struct iic *iic = NULL; + + for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) { + compatible = (char *)get_property(dn, "compatible", NULL); + + if (!compatible) { + printk(KERN_WARNING "no compatible property found !\n"); + continue; + } + + if (strstr(compatible, "IBM,CBEA-Internal-Interrupt-Controller")) + regs = (unsigned long *)get_property(dn,"reg", NULL); + else + continue; + + if (!regs) + printk(KERN_WARNING "IIC: no reg property\n"); + + np = (unsigned int *)get_property(dn, "ibm,interrupt-server-ranges", NULL); + + if (!np) { + printk(KERN_WARNING "IIC: CPU association not found\n"); + iic->regs = NULL; + iic->target_id = 0xff; + return -ENODEV; + } + + iic = &per_cpu(iic, np[0]); + iic->regs = ioremap(regs[0], sizeof(struct cbe_iic_thread_regs)); + iic->target_id = ((np[0] & 2) << 3) + ((np[0] & 1) ? 0xf : 0xe); + printk("IIC for CPU %d at %lx mapped to %p\n", np[0], regs[0], iic->regs); + + iic = &per_cpu(iic, np[1]); + iic->regs = ioremap(regs[2], sizeof(struct cbe_iic_thread_regs)); + iic->target_id = ((np[1] & 2) << 3) + ((np[1] & 1) ? 0xf : 0xe); + printk("IIC for CPU %d at %lx mapped to %p\n", np[1], regs[2], iic->regs); + + found++; + } + + if (found) + return 0; + else + return -ENODEV; } #ifdef CONFIG_SMP @@ -108,12 +270,12 @@ static unsigned int iic_get_irq(struct pt_regs *regs) /* Use the highest interrupt priorities for IPI */ static inline int iic_ipi_to_irq(int ipi) { - return IIC_IRQ_IPI0 + IIC_NUM_IPIS - 1 - ipi; + return IIC_IPI_OFFSET + IIC_NUM_IPIS - 1 - ipi; } static inline int iic_irq_to_ipi(int irq) { - return IIC_NUM_IPIS - 1 - (irq - IIC_IRQ_IPI0); + return IIC_NUM_IPIS - 1 - (irq - IIC_IPI_OFFSET); } void iic_setup_cpu(void) @@ -132,51 +294,22 @@ u8 iic_get_target_id(int cpu) } EXPORT_SYMBOL_GPL(iic_get_target_id); -struct irq_host *iic_get_irq_host(int node) -{ - if (node < 0 || node >= IIC_NODE_COUNT) - return NULL; - return iic_hosts[node]; -} -EXPORT_SYMBOL_GPL(iic_get_irq_host); - - static irqreturn_t iic_ipi_action(int irq, void *dev_id, struct pt_regs *regs) { - int ipi = (int)(long)dev_id; - - smp_message_recv(ipi, regs); - + smp_message_recv(iic_irq_to_ipi(irq), regs); return IRQ_HANDLED; } static void iic_request_ipi(int ipi, const char *name) { - int node, virq; - - for (node = 0; node < IIC_NODE_COUNT; node++) { - char *rname; - if (iic_hosts[node] == NULL) - continue; - virq = irq_create_mapping(iic_hosts[node], - iic_ipi_to_irq(ipi), 0); - if (virq == NO_IRQ) { - printk(KERN_ERR - "iic: failed to map IPI %s on node %d\n", - name, node); - continue; - } - rname = kzalloc(strlen(name) + 16, GFP_KERNEL); - if (rname) - sprintf(rname, "%s node %d", name, node); - else - rname = (char *)name; - if (request_irq(virq, iic_ipi_action, IRQF_DISABLED, - rname, (void *)(long)ipi)) - printk(KERN_ERR - "iic: failed to request IPI %s on node %d\n", - name, node); - } + int irq; + + irq = iic_ipi_to_irq(ipi); + /* IPIs are marked SA_INTERRUPT as they must run with irqs + * disabled */ + get_irq_desc(irq)->chip = &iic_pic; + get_irq_desc(irq)->status |= IRQ_PER_CPU; + request_irq(irq, iic_ipi_action, SA_INTERRUPT, name, NULL); } void iic_request_IPIs(void) @@ -187,119 +320,34 @@ void iic_request_IPIs(void) iic_request_ipi(PPC_MSG_DEBUGGER_BREAK, "IPI-debug"); #endif /* CONFIG_DEBUGGER */ } - #endif /* CONFIG_SMP */ - -static int iic_host_match(struct irq_host *h, struct device_node *node) -{ - return h->host_data != NULL && node == h->host_data; -} - -static int iic_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw, unsigned int flags) -{ - if (hw < IIC_IRQ_IPI0) - set_irq_chip_and_handler(virq, &iic_chip, handle_fasteoi_irq); - else - set_irq_chip_and_handler(virq, &iic_chip, handle_percpu_irq); - return 0; -} - -static int iic_host_xlate(struct irq_host *h, struct device_node *ct, - u32 *intspec, unsigned int intsize, - irq_hw_number_t *out_hwirq, unsigned int *out_flags) - -{ - /* Currently, we don't translate anything. That needs to be fixed as - * we get better defined device-trees. iic interrupts have to be - * explicitely mapped by whoever needs them - */ - return -ENODEV; -} - -static struct irq_host_ops iic_host_ops = { - .match = iic_host_match, - .map = iic_host_map, - .xlate = iic_host_xlate, -}; - -static void __init init_one_iic(unsigned int hw_cpu, unsigned long addr, - struct irq_host *host) +static void iic_setup_spe_handlers(void) { - /* XXX FIXME: should locate the linux CPU number from the HW cpu - * number properly. We are lucky for now - */ - struct iic *iic = &per_cpu(iic, hw_cpu); - - iic->regs = ioremap(addr, sizeof(struct cbe_iic_thread_regs)); - BUG_ON(iic->regs == NULL); + int be, isrc; - iic->target_id = ((hw_cpu & 2) << 3) | ((hw_cpu & 1) ? 0xf : 0xe); - iic->eoi_stack[0] = 0xff; - iic->host = host; - out_be64(&iic->regs->prio, 0); - - printk(KERN_INFO "IIC for CPU %d at %lx mapped to %p, target id 0x%x\n", - hw_cpu, addr, iic->regs, iic->target_id); -} - -static int __init setup_iic(void) -{ - struct device_node *dn; - struct resource r0, r1; - struct irq_host *host; - int found = 0; - u32 *np; - - for (dn = NULL; - (dn = of_find_node_by_name(dn,"interrupt-controller")) != NULL;) { - if (!device_is_compatible(dn, - "IBM,CBEA-Internal-Interrupt-Controller")) - continue; - np = (u32 *)get_property(dn, "ibm,interrupt-server-ranges", - NULL); - if (np == NULL) { - printk(KERN_WARNING "IIC: CPU association not found\n"); - of_node_put(dn); - return -ENODEV; - } - if (of_address_to_resource(dn, 0, &r0) || - of_address_to_resource(dn, 1, &r1)) { - printk(KERN_WARNING "IIC: Can't resolve addresses\n"); - of_node_put(dn); - return -ENODEV; + /* Assume two threads per BE are present */ + for (be=0; be < num_present_cpus() / 2; be++) { + for (isrc = 0; isrc < IIC_CLASS_STRIDE * 3; isrc++) { + int irq = IIC_NODE_STRIDE * be + IIC_SPE_OFFSET + isrc; + get_irq_desc(irq)->chip = &iic_pic; } - host = NULL; - if (found < IIC_NODE_COUNT) { - host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, - IIC_SOURCE_COUNT, - &iic_host_ops, - IIC_IRQ_INVALID); - iic_hosts[found] = host; - BUG_ON(iic_hosts[found] == NULL); - iic_hosts[found]->host_data = of_node_get(dn); - found++; - } - init_one_iic(np[0], r0.start, host); - init_one_iic(np[1], r1.start, host); } - - if (found) - return 0; - else - return -ENODEV; } -void __init iic_init_IRQ(void) +void iic_init_IRQ(void) { - /* Discover and initialize iics */ - if (setup_iic() < 0) - panic("IIC: Failed to initialize !\n"); + int cpu, irq_offset; + struct iic *iic; - /* Set master interrupt handling function */ - ppc_md.get_irq = iic_get_irq; + if (setup_iic() < 0) + setup_iic_hardcoded(); - /* Enable on current CPU */ - iic_setup_cpu(); + irq_offset = 0; + for_each_possible_cpu(cpu) { + iic = &per_cpu(iic, cpu); + if (iic->regs) + out_be64(&iic->regs->prio, 0xff); + } + iic_setup_spe_handlers(); } diff --git a/trunk/arch/powerpc/platforms/cell/interrupt.h b/trunk/arch/powerpc/platforms/cell/interrupt.h index 5560a92ec3ab..799f77d98f96 100644 --- a/trunk/arch/powerpc/platforms/cell/interrupt.h +++ b/trunk/arch/powerpc/platforms/cell/interrupt.h @@ -37,24 +37,27 @@ */ enum { - IIC_IRQ_INVALID = 0xff, - IIC_IRQ_MAX = 0x3f, - IIC_IRQ_EXT_IOIF0 = 0x20, - IIC_IRQ_EXT_IOIF1 = 0x2b, - IIC_IRQ_IPI0 = 0x40, - IIC_NUM_IPIS = 0x10, /* IRQs reserved for IPI */ - IIC_SOURCE_COUNT = 0x50, + IIC_EXT_OFFSET = 0x00, /* Start of south bridge IRQs */ + IIC_NUM_EXT = 0x40, /* Number of south bridge IRQs */ + IIC_SPE_OFFSET = 0x40, /* Start of SPE interrupts */ + IIC_CLASS_STRIDE = 0x10, /* SPE IRQs per class */ + IIC_IPI_OFFSET = 0x70, /* Start of IPI IRQs */ + IIC_NUM_IPIS = 0x10, /* IRQs reserved for IPI */ + IIC_NODE_STRIDE = 0x80, /* Total IRQs per node */ }; extern void iic_init_IRQ(void); +extern int iic_get_irq(struct pt_regs *regs); extern void iic_cause_IPI(int cpu, int mesg); extern void iic_request_IPIs(void); extern void iic_setup_cpu(void); +extern void iic_local_enable(void); +extern void iic_local_disable(void); extern u8 iic_get_target_id(int cpu); -extern struct irq_host *iic_get_irq_host(int node); extern void spider_init_IRQ(void); +extern int spider_get_irq(int node); #endif #endif /* ASM_CELL_PIC_H */ diff --git a/trunk/arch/powerpc/platforms/cell/pervasive.c b/trunk/arch/powerpc/platforms/cell/pervasive.c index 9f2e4ed20a57..695ac4e1617e 100644 --- a/trunk/arch/powerpc/platforms/cell/pervasive.c +++ b/trunk/arch/powerpc/platforms/cell/pervasive.c @@ -23,6 +23,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/cell/setup.c b/trunk/arch/powerpc/platforms/cell/setup.c index 282987d6d4a2..00d112f92272 100644 --- a/trunk/arch/powerpc/platforms/cell/setup.c +++ b/trunk/arch/powerpc/platforms/cell/setup.c @@ -14,6 +14,7 @@ */ #undef DEBUG +#include #include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include "interrupt.h" #include "iommu.h" @@ -80,22 +80,10 @@ static void cell_progress(char *s, unsigned short hex) printk("*** %04x : %s\n", hex, s ? s : ""); } -static void __init cell_pcibios_fixup(void) -{ - struct pci_dev *dev = NULL; - - for_each_pci_dev(dev) - pci_read_irq_line(dev); -} - -static void __init cell_init_irq(void) -{ - iic_init_IRQ(); - spider_init_IRQ(); -} - static void __init cell_setup_arch(void) { + ppc_md.init_IRQ = iic_init_IRQ; + ppc_md.get_irq = iic_get_irq; #ifdef CONFIG_SPU_BASE spu_priv1_ops = &spu_priv1_mmio_ops; #endif @@ -121,6 +109,7 @@ static void __init cell_setup_arch(void) /* Find and initialize PCI host bridges */ init_pci_config_tokens(); find_and_init_phbs(); + spider_init_IRQ(); cbe_pervasive_init(); #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; @@ -138,6 +127,8 @@ static void __init cell_init_early(void) cell_init_iommu(); + ppc64_interrupt_controller = IC_CELL_PIC; + DBG(" <- cell_init_early()\n"); } @@ -183,8 +174,6 @@ define_machine(cell) { .calibrate_decr = generic_calibrate_decr, .check_legacy_ioport = cell_check_legacy_ioport, .progress = cell_progress, - .init_IRQ = cell_init_irq, - .pcibios_fixup = cell_pcibios_fixup, #ifdef CONFIG_KEXEC .machine_kexec = default_machine_kexec, .machine_kexec_prepare = default_machine_kexec_prepare, diff --git a/trunk/arch/powerpc/platforms/cell/smp.c b/trunk/arch/powerpc/platforms/cell/smp.c index 46aef0640742..bdf6c5fe58c0 100644 --- a/trunk/arch/powerpc/platforms/cell/smp.c +++ b/trunk/arch/powerpc/platforms/cell/smp.c @@ -14,6 +14,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/cell/spider-pic.c b/trunk/arch/powerpc/platforms/cell/spider-pic.c index ae7ef88f1a37..7c3a0b6d34fd 100644 --- a/trunk/arch/powerpc/platforms/cell/spider-pic.c +++ b/trunk/arch/powerpc/platforms/cell/spider-pic.c @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -57,313 +56,184 @@ enum { REISWAITEN = 0x508, /* Reissue Wait Control*/ }; -#define SPIDER_CHIP_COUNT 4 -#define SPIDER_SRC_COUNT 64 -#define SPIDER_IRQ_INVALID 63 +static void __iomem *spider_pics[4]; -struct spider_pic { - struct irq_host *host; - struct device_node *of_node; - void __iomem *regs; - unsigned int node_id; -}; -static struct spider_pic spider_pics[SPIDER_CHIP_COUNT]; +static void __iomem *spider_get_pic(int irq) +{ + int node = irq / IIC_NODE_STRIDE; + irq %= IIC_NODE_STRIDE; + + if (irq >= IIC_EXT_OFFSET && + irq < IIC_EXT_OFFSET + IIC_NUM_EXT && + spider_pics) + return spider_pics[node]; + return NULL; +} -static struct spider_pic *spider_virq_to_pic(unsigned int virq) +static int spider_get_nr(unsigned int irq) { - return irq_map[virq].host->host_data; + return (irq % IIC_NODE_STRIDE) - IIC_EXT_OFFSET; } -static void __iomem *spider_get_irq_config(struct spider_pic *pic, - unsigned int src) +static void __iomem *spider_get_irq_config(int irq) { - return pic->regs + TIR_CFGA + 8 * src; + void __iomem *pic; + pic = spider_get_pic(irq); + return pic + TIR_CFGA + 8 * spider_get_nr(irq); } -static void spider_unmask_irq(unsigned int virq) +static void spider_enable_irq(unsigned int irq) { - struct spider_pic *pic = spider_virq_to_pic(virq); - void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); + int nodeid = (irq / IIC_NODE_STRIDE) * 0x10; + void __iomem *cfg = spider_get_irq_config(irq); + irq = spider_get_nr(irq); - /* We use no locking as we should be covered by the descriptor lock - * for access to invidual source configuration registers - */ - out_be32(cfg, in_be32(cfg) | 0x30000000u); + out_be32(cfg, (in_be32(cfg) & ~0xf0)| 0x3107000eu | nodeid); + out_be32(cfg + 4, in_be32(cfg + 4) | 0x00020000u | irq); } -static void spider_mask_irq(unsigned int virq) +static void spider_disable_irq(unsigned int irq) { - struct spider_pic *pic = spider_virq_to_pic(virq); - void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); + void __iomem *cfg = spider_get_irq_config(irq); + irq = spider_get_nr(irq); - /* We use no locking as we should be covered by the descriptor lock - * for access to invidual source configuration registers - */ out_be32(cfg, in_be32(cfg) & ~0x30000000u); } -static void spider_ack_irq(unsigned int virq) +static unsigned int spider_startup_irq(unsigned int irq) { - struct spider_pic *pic = spider_virq_to_pic(virq); - unsigned int src = irq_map[virq].hwirq; - - /* Reset edge detection logic if necessary - */ - if (get_irq_desc(virq)->status & IRQ_LEVEL) - return; - - /* Only interrupts 47 to 50 can be set to edge */ - if (src < 47 || src > 50) - return; - - /* Perform the clear of the edge logic */ - out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf)); + spider_enable_irq(irq); + return 0; } -static struct irq_chip spider_pic = { - .typename = " SPIDER ", - .unmask = spider_unmask_irq, - .mask = spider_mask_irq, - .ack = spider_ack_irq, -}; - -static int spider_host_match(struct irq_host *h, struct device_node *node) +static void spider_shutdown_irq(unsigned int irq) { - struct spider_pic *pic = h->host_data; - return node == pic->of_node; + spider_disable_irq(irq); } -static int spider_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw, unsigned int flags) +static void spider_end_irq(unsigned int irq) { - unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; - struct spider_pic *pic = h->host_data; - void __iomem *cfg = spider_get_irq_config(pic, hw); - int level = 0; - u32 ic; - - /* Note that only level high is supported for most interrupts */ - if (sense != IRQ_TYPE_NONE && sense != IRQ_TYPE_LEVEL_HIGH && - (hw < 47 || hw > 50)) - return -EINVAL; - - /* Decode sense type */ - switch(sense) { - case IRQ_TYPE_EDGE_RISING: - ic = 0x3; - break; - case IRQ_TYPE_EDGE_FALLING: - ic = 0x2; - break; - case IRQ_TYPE_LEVEL_LOW: - ic = 0x0; - level = 1; - break; - case IRQ_TYPE_LEVEL_HIGH: - case IRQ_TYPE_NONE: - ic = 0x1; - level = 1; - break; - default: - return -EINVAL; - } - - /* Configure the source. One gross hack that was there before and - * that I've kept around is the priority to the BE which I set to - * be the same as the interrupt source number. I don't know wether - * that's supposed to make any kind of sense however, we'll have to - * decide that, but for now, I'm not changing the behaviour. - */ - out_be32(cfg, (ic << 24) | (0x7 << 16) | (pic->node_id << 4) | 0xe); - out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff)); - - if (level) - get_irq_desc(virq)->status |= IRQ_LEVEL; - set_irq_chip_and_handler(virq, &spider_pic, handle_level_irq); - return 0; + spider_enable_irq(irq); } -static int spider_host_xlate(struct irq_host *h, struct device_node *ct, - u32 *intspec, unsigned int intsize, - irq_hw_number_t *out_hwirq, unsigned int *out_flags) - +static void spider_ack_irq(unsigned int irq) { - /* Spider interrupts have 2 cells, first is the interrupt source, - * second, well, I don't know for sure yet ... We mask the top bits - * because old device-trees encode a node number in there - */ - *out_hwirq = intspec[0] & 0x3f; - *out_flags = IRQ_TYPE_LEVEL_HIGH; - return 0; + spider_disable_irq(irq); + iic_local_enable(); } -static struct irq_host_ops spider_host_ops = { - .match = spider_host_match, - .map = spider_host_map, - .xlate = spider_host_xlate, +static struct hw_interrupt_type spider_pic = { + .typename = " SPIDER ", + .startup = spider_startup_irq, + .shutdown = spider_shutdown_irq, + .enable = spider_enable_irq, + .disable = spider_disable_irq, + .ack = spider_ack_irq, + .end = spider_end_irq, }; -static void spider_irq_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +int spider_get_irq(int node) { - struct spider_pic *pic = desc->handler_data; - unsigned int cs, virq; + unsigned long cs; + void __iomem *regs = spider_pics[node]; + + cs = in_be32(regs + TIR_CS) >> 24; - cs = in_be32(pic->regs + TIR_CS) >> 24; - if (cs == SPIDER_IRQ_INVALID) - virq = NO_IRQ; + if (cs == 63) + return -1; else - virq = irq_linear_revmap(pic->host, cs); - if (virq != NO_IRQ) - generic_handle_irq(virq, regs); - desc->chip->eoi(irq); + return cs; } -/* For hooking up the cascace we have a problem. Our device-tree is - * crap and we don't know on which BE iic interrupt we are hooked on at - * least not the "standard" way. We can reconstitute it based on two - * informations though: which BE node we are connected to and wether - * we are connected to IOIF0 or IOIF1. Right now, we really only care - * about the IBM cell blade and we know that its firmware gives us an - * interrupt-map property which is pretty strange. - */ -static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) +/* hardcoded part to be compatible with older firmware */ + +void spider_init_IRQ_hardcoded(void) { - unsigned int virq; - u32 *imap, *tmp; - int imaplen, intsize, unit; - struct device_node *iic; - struct irq_host *iic_host; - -#if 0 /* Enable that when we have a way to retreive the node as well */ - /* First, we check wether we have a real "interrupts" in the device - * tree in case the device-tree is ever fixed - */ - struct of_irq oirq; - if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) { - virq = irq_create_of_mapping(oirq.controller, oirq.specifier, - oirq.size); - goto bail; + int node; + long spiderpic; + long pics[] = { 0x24000008000, 0x34000008000 }; + int n; + + pr_debug("%s(%d): Using hardcoded defaults\n", __FUNCTION__, __LINE__); + + for (node = 0; node < num_present_cpus()/2; node++) { + spiderpic = pics[node]; + printk(KERN_DEBUG "SPIDER addr: %lx\n", spiderpic); + spider_pics[node] = ioremap(spiderpic, 0x800); + for (n = 0; n < IIC_NUM_EXT; n++) { + int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE; + get_irq_desc(irq)->chip = &spider_pic; + } + + /* do not mask any interrupts because of level */ + out_be32(spider_pics[node] + TIR_MSK, 0x0); + + /* disable edge detection clear */ + /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */ + + /* enable interrupt packets to be output */ + out_be32(spider_pics[node] + TIR_PIEN, + in_be32(spider_pics[node] + TIR_PIEN) | 0x1); + + /* Enable the interrupt detection enable bit. Do this last! */ + out_be32(spider_pics[node] + TIR_DEN, + in_be32(spider_pics[node] + TIR_DEN) | 0x1); } -#endif - - /* Now do the horrible hacks */ - tmp = (u32 *)get_property(pic->of_node, "#interrupt-cells", NULL); - if (tmp == NULL) - return NO_IRQ; - intsize = *tmp; - imap = (u32 *)get_property(pic->of_node, "interrupt-map", &imaplen); - if (imap == NULL || imaplen < (intsize + 1)) - return NO_IRQ; - iic = of_find_node_by_phandle(imap[intsize]); - if (iic == NULL) - return NO_IRQ; - imap += intsize + 1; - tmp = (u32 *)get_property(iic, "#interrupt-cells", NULL); - if (tmp == NULL) - return NO_IRQ; - intsize = *tmp; - /* Assume unit is last entry of interrupt specifier */ - unit = imap[intsize - 1]; - /* Ok, we have a unit, now let's try to get the node */ - tmp = (u32 *)get_property(iic, "ibm,interrupt-server-ranges", NULL); - if (tmp == NULL) { - of_node_put(iic); - return NO_IRQ; - } - /* ugly as hell but works for now */ - pic->node_id = (*tmp) >> 1; - of_node_put(iic); - - /* Ok, now let's get cracking. You may ask me why I just didn't match - * the iic host from the iic OF node, but that way I'm still compatible - * with really really old old firmwares for which we don't have a node - */ - iic_host = iic_get_irq_host(pic->node_id); - if (iic_host == NULL) - return NO_IRQ; - /* Manufacture an IIC interrupt number of class 2 */ - virq = irq_create_mapping(iic_host, 0x20 | unit, 0); - if (virq == NO_IRQ) - printk(KERN_ERR "spider_pic: failed to map cascade !"); - return virq; } - -static void __init spider_init_one(struct device_node *of_node, int chip, - unsigned long addr) +void spider_init_IRQ(void) { - struct spider_pic *pic = &spider_pics[chip]; - int i, virq; - - /* Map registers */ - pic->regs = ioremap(addr, 0x1000); - if (pic->regs == NULL) - panic("spider_pic: can't map registers !"); - - /* Allocate a host */ - pic->host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, SPIDER_SRC_COUNT, - &spider_host_ops, SPIDER_IRQ_INVALID); - if (pic->host == NULL) - panic("spider_pic: can't allocate irq host !"); - pic->host->host_data = pic; - - /* Fill out other bits */ - pic->of_node = of_node_get(of_node); - - /* Go through all sources and disable them */ - for (i = 0; i < SPIDER_SRC_COUNT; i++) { - void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i; - out_be32(cfg, in_be32(cfg) & ~0x30000000u); - } + long spider_reg; + struct device_node *dn; + char *compatible; + int n, node = 0; - /* do not mask any interrupts because of level */ - out_be32(pic->regs + TIR_MSK, 0x0); + for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) { + compatible = (char *)get_property(dn, "compatible", NULL); - /* enable interrupt packets to be output */ - out_be32(pic->regs + TIR_PIEN, in_be32(pic->regs + TIR_PIEN) | 0x1); + if (!compatible) + continue; - /* Hook up the cascade interrupt to the iic and nodeid */ - virq = spider_find_cascade_and_node(pic); - if (virq == NO_IRQ) - return; - set_irq_data(virq, pic); - set_irq_chained_handler(virq, spider_irq_cascade); + if (strstr(compatible, "CBEA,platform-spider-pic")) + spider_reg = *(long *)get_property(dn,"reg", NULL); + else if (strstr(compatible, "sti,platform-spider-pic")) { + spider_init_IRQ_hardcoded(); + return; + } else + continue; - printk(KERN_INFO "spider_pic: node %d, addr: 0x%lx %s\n", - pic->node_id, addr, of_node->full_name); + if (!spider_reg) + printk("interrupt controller does not have reg property !\n"); - /* Enable the interrupt detection enable bit. Do this last! */ - out_be32(pic->regs + TIR_DEN, in_be32(pic->regs + TIR_DEN) | 0x1); -} + n = prom_n_addr_cells(dn); -void __init spider_init_IRQ(void) -{ - struct resource r; - struct device_node *dn; - int chip = 0; - - /* XXX node numbers are totally bogus. We _hope_ we get the device - * nodes in the right order here but that's definitely not guaranteed, - * we need to get the node from the device tree instead. - * There is currently no proper property for it (but our whole - * device-tree is bogus anyway) so all we can do is pray or maybe test - * the address and deduce the node-id - */ - for (dn = NULL; - (dn = of_find_node_by_name(dn, "interrupt-controller"));) { - if (device_is_compatible(dn, "CBEA,platform-spider-pic")) { - if (of_address_to_resource(dn, 0, &r)) { - printk(KERN_WARNING "spider-pic: Failed\n"); - continue; - } - } else if (device_is_compatible(dn, "sti,platform-spider-pic") - && (chip < 2)) { - static long hard_coded_pics[] = - { 0x24000008000, 0x34000008000 }; - r.start = hard_coded_pics[chip]; - } else - continue; - spider_init_one(dn, chip++, r.start); + if ( n != 2) + printk("reg property with invalid number of elements \n"); + + spider_pics[node] = ioremap(spider_reg, 0x800); + + printk("SPIDER addr: %lx with %i addr_cells mapped to %p\n", + spider_reg, n, spider_pics[node]); + + for (n = 0; n < IIC_NUM_EXT; n++) { + int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE; + get_irq_desc(irq)->chip = &spider_pic; + } + + /* do not mask any interrupts because of level */ + out_be32(spider_pics[node] + TIR_MSK, 0x0); + + /* disable edge detection clear */ + /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */ + + /* enable interrupt packets to be output */ + out_be32(spider_pics[node] + TIR_PIEN, + in_be32(spider_pics[node] + TIR_PIEN) | 0x1); + + /* Enable the interrupt detection enable bit. Do this last! */ + out_be32(spider_pics[node] + TIR_DEN, + in_be32(spider_pics[node] + TIR_DEN) | 0x1); + + node++; } } diff --git a/trunk/arch/powerpc/platforms/cell/spu_base.c b/trunk/arch/powerpc/platforms/cell/spu_base.c index 5d2313a6c82b..b306723abb87 100644 --- a/trunk/arch/powerpc/platforms/cell/spu_base.c +++ b/trunk/arch/powerpc/platforms/cell/spu_base.c @@ -264,57 +264,51 @@ spu_irq_class_2(int irq, void *data, struct pt_regs *regs) return stat ? IRQ_HANDLED : IRQ_NONE; } -static int spu_request_irqs(struct spu *spu) +static int +spu_request_irqs(struct spu *spu) { - int ret = 0; + int ret; + int irq_base; - if (spu->irqs[0] != NO_IRQ) { - snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", - spu->number); - ret = request_irq(spu->irqs[0], spu_irq_class_0, - IRQF_DISABLED, - spu->irq_c0, spu); - if (ret) - goto bail0; - } - if (spu->irqs[1] != NO_IRQ) { - snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", - spu->number); - ret = request_irq(spu->irqs[1], spu_irq_class_1, - IRQF_DISABLED, - spu->irq_c1, spu); - if (ret) - goto bail1; - } - if (spu->irqs[2] != NO_IRQ) { - snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", - spu->number); - ret = request_irq(spu->irqs[2], spu_irq_class_2, - IRQF_DISABLED, - spu->irq_c2, spu); - if (ret) - goto bail2; - } - return 0; + irq_base = IIC_NODE_STRIDE * spu->node + IIC_SPE_OFFSET; -bail2: - if (spu->irqs[1] != NO_IRQ) - free_irq(spu->irqs[1], spu); -bail1: - if (spu->irqs[0] != NO_IRQ) - free_irq(spu->irqs[0], spu); -bail0: + snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", spu->number); + ret = request_irq(irq_base + spu->isrc, + spu_irq_class_0, SA_INTERRUPT, spu->irq_c0, spu); + if (ret) + goto out; + + snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", spu->number); + ret = request_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, + spu_irq_class_1, SA_INTERRUPT, spu->irq_c1, spu); + if (ret) + goto out1; + + snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", spu->number); + ret = request_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc, + spu_irq_class_2, SA_INTERRUPT, spu->irq_c2, spu); + if (ret) + goto out2; + goto out; + +out2: + free_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, spu); +out1: + free_irq(irq_base + spu->isrc, spu); +out: return ret; } -static void spu_free_irqs(struct spu *spu) +static void +spu_free_irqs(struct spu *spu) { - if (spu->irqs[0] != NO_IRQ) - free_irq(spu->irqs[0], spu); - if (spu->irqs[1] != NO_IRQ) - free_irq(spu->irqs[1], spu); - if (spu->irqs[2] != NO_IRQ) - free_irq(spu->irqs[2], spu); + int irq_base; + + irq_base = IIC_NODE_STRIDE * spu->node + IIC_SPE_OFFSET; + + free_irq(irq_base + spu->isrc, spu); + free_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, spu); + free_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc, spu); } static LIST_HEAD(spu_list); @@ -565,38 +559,17 @@ static void spu_unmap(struct spu *spu) iounmap((u8 __iomem *)spu->local_store); } -/* This function shall be abstracted for HV platforms */ -static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) -{ - struct irq_host *host; - unsigned int isrc; - u32 *tmp; - - host = iic_get_irq_host(spu->node); - if (host == NULL) - return -ENODEV; - - /* Get the interrupt source from the device-tree */ - tmp = (u32 *)get_property(np, "isrc", NULL); - if (!tmp) - return -ENODEV; - spu->isrc = isrc = tmp[0]; - - /* Now map interrupts of all 3 classes */ - spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc, 0); - spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc, 0); - spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc, 0); - - /* Right now, we only fail if class 2 failed */ - return spu->irqs[2] == NO_IRQ ? -EINVAL : 0; -} - static int __init spu_map_device(struct spu *spu, struct device_node *node) { char *prop; int ret; ret = -ENODEV; + prop = get_property(node, "isrc", NULL); + if (!prop) + goto out; + spu->isrc = *(unsigned int *)prop; + spu->name = get_property(node, "name", NULL); if (!spu->name) goto out; @@ -663,8 +636,7 @@ static int spu_create_sysdev(struct spu *spu) return ret; } - if (spu->isrc != 0) - sysdev_create_file(&spu->sysdev, &attr_isrc); + sysdev_create_file(&spu->sysdev, &attr_isrc); sysfs_add_device_to_node(&spu->sysdev, spu->nid); return 0; @@ -696,9 +668,6 @@ static int __init create_spu(struct device_node *spe) spu->nid = of_node_to_nid(spe); if (spu->nid == -1) spu->nid = 0; - ret = spu_map_interrupts(spu, spe); - if (ret) - goto out_unmap; spin_lock_init(&spu->register_lock); spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1)); spu_mfc_sr1_set(spu, 0x33); diff --git a/trunk/arch/powerpc/platforms/cell/spufs/backing_ops.c b/trunk/arch/powerpc/platforms/cell/spufs/backing_ops.c index 2d22cd59d6fc..f1d35ddc9df3 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/backing_ops.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/backing_ops.c @@ -21,6 +21,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/cell/spufs/hw_ops.c b/trunk/arch/powerpc/platforms/cell/spufs/hw_ops.c index c8670f519734..ede2cac46b6d 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/hw_ops.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/hw_ops.c @@ -18,6 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/cell/spufs/sched.c b/trunk/arch/powerpc/platforms/cell/spufs/sched.c index 1350294484b6..3dcc5d8d66b9 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/sched.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/sched.c @@ -26,6 +26,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/cell/spufs/switch.c b/trunk/arch/powerpc/platforms/cell/spufs/switch.c index 9d9d82dd32ba..c7fea2cca534 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/switch.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/switch.c @@ -32,6 +32,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/chrp/pci.c b/trunk/arch/powerpc/platforms/chrp/pci.c index 6802cdc3168a..53515daf01b1 100644 --- a/trunk/arch/powerpc/platforms/chrp/pci.c +++ b/trunk/arch/powerpc/platforms/chrp/pci.c @@ -2,6 +2,7 @@ * CHRP pci routines. */ +#include #include #include #include @@ -18,6 +19,7 @@ #include #include #include +#include #include #include @@ -160,9 +162,15 @@ void __init chrp_pcibios_fixup(void) { struct pci_dev *dev = NULL; + struct device_node *np; - for_each_pci_dev(dev) - pci_read_irq_line(dev); + /* PCI interrupts are controlled by the OpenPIC */ + for_each_pci_dev(dev) { + np = pci_device_to_OF_node(dev); + if ((np != 0) && (np->n_intrs > 0) && (np->intrs[0].line != 0)) + dev->irq = np->intrs[0].line; + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); + } } #define PRG_CL_RESET_VALID 0x00010000 diff --git a/trunk/arch/powerpc/platforms/chrp/setup.c b/trunk/arch/powerpc/platforms/chrp/setup.c index 538e337d63e2..18d89f38796b 100644 --- a/trunk/arch/powerpc/platforms/chrp/setup.c +++ b/trunk/arch/powerpc/platforms/chrp/setup.c @@ -8,6 +8,7 @@ * bootup setup stuff.. */ +#include #include #include #include @@ -24,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -59,7 +60,7 @@ void rtas_indicator_progress(char *, unsigned short); int _chrp_type; EXPORT_SYMBOL(_chrp_type); -static struct mpic *chrp_mpic; +struct mpic *chrp_mpic; /* Used for doing CHRP event-scans */ DEFINE_PER_CPU(struct timer_list, heartbeat_timer); @@ -315,32 +316,24 @@ chrp_event_scan(unsigned long unused) jiffies + event_scan_interval); } -static void chrp_8259_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) -{ - unsigned int cascade_irq = i8259_irq(regs); - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq, regs); - desc->chip->eoi(irq); -} - /* * Finds the open-pic node and sets up the mpic driver. */ static void __init chrp_find_openpic(void) { struct device_node *np, *root; - int len, i, j; + int len, i, j, irq_count; int isu_size, idu_size; unsigned int *iranges, *opprop = NULL; int oplen = 0; unsigned long opaddr; int na = 1; + unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS]; - np = of_find_node_by_type(NULL, "open-pic"); + np = find_type_devices("open-pic"); if (np == NULL) return; - root = of_find_node_by_path("/"); + root = find_path_device("/"); if (root) { opprop = (unsigned int *) get_property (root, "platform-open-pic", &oplen); @@ -351,15 +344,19 @@ static void __init chrp_find_openpic(void) oplen /= na * sizeof(unsigned int); } else { struct resource r; - if (of_address_to_resource(np, 0, &r)) { - goto bail; - } + if (of_address_to_resource(np, 0, &r)) + return; opaddr = r.start; oplen = 0; } printk(KERN_INFO "OpenPIC at %lx\n", opaddr); + irq_count = NR_IRQS - NUM_ISA_INTERRUPTS - 4; /* leave room for IPIs */ + prom_get_irq_senses(init_senses, NUM_ISA_INTERRUPTS, NR_IRQS - 4); + /* i8259 cascade is always positive level */ + init_senses[0] = IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE; + iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len); if (iranges == NULL) len = 0; /* non-distributed mpic */ @@ -386,12 +383,15 @@ static void __init chrp_find_openpic(void) if (len > 1) isu_size = iranges[3]; - chrp_mpic = mpic_alloc(np, opaddr, MPIC_PRIMARY, - isu_size, 0, " MPIC "); + chrp_mpic = mpic_alloc(opaddr, MPIC_PRIMARY, + isu_size, NUM_ISA_INTERRUPTS, irq_count, + NR_IRQS - 4, init_senses, irq_count, + " MPIC "); if (chrp_mpic == NULL) { printk(KERN_ERR "Failed to allocate MPIC structure\n"); - goto bail; + return; } + j = na - 1; for (i = 1; i < len; ++i) { iranges += 2; @@ -403,10 +403,7 @@ static void __init chrp_find_openpic(void) } mpic_init(chrp_mpic); - ppc_md.get_irq = mpic_get_irq; - bail: - of_node_put(root); - of_node_put(np); + mpic_setup_cascade(NUM_ISA_INTERRUPTS, i8259_irq_cascade, NULL); } #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON) @@ -417,34 +414,14 @@ static struct irqaction xmon_irqaction = { }; #endif -static void __init chrp_find_8259(void) +void __init chrp_init_IRQ(void) { - struct device_node *np, *pic = NULL; + struct device_node *np; unsigned long chrp_int_ack = 0; - unsigned int cascade_irq; - - /* Look for cascade */ - for_each_node_by_type(np, "interrupt-controller") - if (device_is_compatible(np, "chrp,iic")) { - pic = np; - break; - } - /* Ok, 8259 wasn't found. We need to handle the case where - * we have a pegasos that claims to be chrp but doesn't have - * a proper interrupt tree - */ - if (pic == NULL && chrp_mpic != NULL) { - printk(KERN_ERR "i8259: Not found in device-tree" - " assuming no legacy interrupts\n"); - return; - } +#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON) + struct device_node *kbd; +#endif - /* Look for intack. In a perfect world, we would look for it on - * the ISA bus that holds the 8259 but heh... Works that way. If - * we ever see a problem, we can try to re-use the pSeries code here. - * Also, Pegasos-type platforms don't have a proper node to start - * from anyway - */ for (np = find_devices("pci"); np != NULL; np = np->next) { unsigned int *addrp = (unsigned int *) get_property(np, "8259-interrupt-acknowledge", NULL); @@ -455,29 +432,11 @@ static void __init chrp_find_8259(void) break; } if (np == NULL) - printk(KERN_WARNING "Cannot find PCI interrupt acknowledge" - " address, polling\n"); - - i8259_init(pic, chrp_int_ack); - if (ppc_md.get_irq == NULL) - ppc_md.get_irq = i8259_irq; - if (chrp_mpic != NULL) { - cascade_irq = irq_of_parse_and_map(pic, 0); - if (cascade_irq == NO_IRQ) - printk(KERN_ERR "i8259: failed to map cascade irq\n"); - else - set_irq_chained_handler(cascade_irq, - chrp_8259_cascade); - } -} + printk(KERN_ERR "Cannot find PCI interrupt acknowledge address\n"); -void __init chrp_init_IRQ(void) -{ -#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON) - struct device_node *kbd; -#endif chrp_find_openpic(); - chrp_find_8259(); + + i8259_init(chrp_int_ack, 0); if (_chrp_type == _CHRP_Pegasos) ppc_md.get_irq = i8259_irq; @@ -562,6 +521,10 @@ static int __init chrp_probe(void) DMA_MODE_READ = 0x44; DMA_MODE_WRITE = 0x48; isa_io_base = CHRP_ISA_IO_BASE; /* default value */ + ppc_do_canonicalize_irqs = 1; + + /* Assume we have an 8259... */ + __irq_offset_value = NUM_ISA_INTERRUPTS; return 1; } @@ -573,6 +536,7 @@ define_machine(chrp) { .init = chrp_init2, .show_cpuinfo = chrp_show_cpuinfo, .init_IRQ = chrp_init_IRQ, + .get_irq = mpic_get_irq, .pcibios_fixup = chrp_pcibios_fixup, .restart = rtas_restart, .power_off = rtas_power_off, diff --git a/trunk/arch/powerpc/platforms/chrp/smp.c b/trunk/arch/powerpc/platforms/chrp/smp.c index 1d2307e87c30..b616053bc331 100644 --- a/trunk/arch/powerpc/platforms/chrp/smp.c +++ b/trunk/arch/powerpc/platforms/chrp/smp.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include @@ -29,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/iseries/irq.c b/trunk/arch/powerpc/platforms/iseries/irq.c index 2275e64f3152..33bb4aa0e1e8 100644 --- a/trunk/arch/powerpc/platforms/iseries/irq.c +++ b/trunk/arch/powerpc/platforms/iseries/irq.c @@ -23,6 +23,7 @@ * Created, December 13, 2000 by Wayne Holm * End Change Activity */ +#include #include #include #include @@ -162,6 +163,27 @@ static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs) printk(KERN_ERR "pci_event_handler: NULL event received\n"); } +/* + * This is called by init_IRQ. set in ppc_md.init_IRQ by iSeries_setup.c + * It must be called before the bus walk. + */ +void __init iSeries_init_IRQ(void) +{ + /* Register PCI event handler and open an event path */ + int ret; + + ret = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo, + &pci_event_handler); + if (ret == 0) { + ret = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0); + if (ret != 0) + printk(KERN_ERR "iseries_init_IRQ: open event path " + "failed with rc 0x%x\n", ret); + } else + printk(KERN_ERR "iseries_init_IRQ: register handler " + "failed with rc 0x%x\n", ret); +} + #define REAL_IRQ_TO_SUBBUS(irq) (((irq) >> 14) & 0xff) #define REAL_IRQ_TO_BUS(irq) ((((irq) >> 6) & 0xff) + 1) #define REAL_IRQ_TO_IDSEL(irq) ((((irq) >> 3) & 7) + 1) @@ -175,7 +197,7 @@ static void iseries_enable_IRQ(unsigned int irq) { u32 bus, dev_id, function, mask; const u32 sub_bus = 0; - unsigned int rirq = (unsigned int)irq_map[irq].hwirq; + unsigned int rirq = virt_irq_to_real_map[irq]; /* The IRQ has already been locked by the caller */ bus = REAL_IRQ_TO_BUS(rirq); @@ -192,7 +214,7 @@ static unsigned int iseries_startup_IRQ(unsigned int irq) { u32 bus, dev_id, function, mask; const u32 sub_bus = 0; - unsigned int rirq = (unsigned int)irq_map[irq].hwirq; + unsigned int rirq = virt_irq_to_real_map[irq]; bus = REAL_IRQ_TO_BUS(rirq); function = REAL_IRQ_TO_FUNC(rirq); @@ -233,7 +255,7 @@ static void iseries_shutdown_IRQ(unsigned int irq) { u32 bus, dev_id, function, mask; const u32 sub_bus = 0; - unsigned int rirq = (unsigned int)irq_map[irq].hwirq; + unsigned int rirq = virt_irq_to_real_map[irq]; /* irq should be locked by the caller */ bus = REAL_IRQ_TO_BUS(rirq); @@ -256,7 +278,7 @@ static void iseries_disable_IRQ(unsigned int irq) { u32 bus, dev_id, function, mask; const u32 sub_bus = 0; - unsigned int rirq = (unsigned int)irq_map[irq].hwirq; + unsigned int rirq = virt_irq_to_real_map[irq]; /* The IRQ has already been locked by the caller */ bus = REAL_IRQ_TO_BUS(rirq); @@ -270,19 +292,19 @@ static void iseries_disable_IRQ(unsigned int irq) static void iseries_end_IRQ(unsigned int irq) { - unsigned int rirq = (unsigned int)irq_map[irq].hwirq; + unsigned int rirq = virt_irq_to_real_map[irq]; HvCallPci_eoi(REAL_IRQ_TO_BUS(rirq), REAL_IRQ_TO_SUBBUS(rirq), (REAL_IRQ_TO_IDSEL(rirq) << 4) + REAL_IRQ_TO_FUNC(rirq)); } -static struct irq_chip iseries_pic = { - .typename = "iSeries irq controller", - .startup = iseries_startup_IRQ, - .shutdown = iseries_shutdown_IRQ, - .unmask = iseries_enable_IRQ, - .mask = iseries_disable_IRQ, - .eoi = iseries_end_IRQ +static hw_irq_controller iSeries_IRQ_handler = { + .typename = "iSeries irq controller", + .startup = iseries_startup_IRQ, + .shutdown = iseries_shutdown_IRQ, + .enable = iseries_enable_IRQ, + .disable = iseries_disable_IRQ, + .end = iseries_end_IRQ }; /* @@ -293,14 +315,17 @@ static struct irq_chip iseries_pic = { int __init iSeries_allocate_IRQ(HvBusNumber bus, HvSubBusNumber sub_bus, u32 bsubbus) { + int virtirq; unsigned int realirq; u8 idsel = ISERIES_GET_DEVICE_FROM_SUBBUS(bsubbus); u8 function = ISERIES_GET_FUNCTION_FROM_SUBBUS(bsubbus); realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3) + function; + virtirq = virt_irq_create_mapping(realirq); - return irq_create_mapping(NULL, realirq, IRQ_TYPE_NONE); + irq_desc[virtirq].chip = &iSeries_IRQ_handler; + return virtirq; } #endif /* CONFIG_PCI */ @@ -308,9 +333,10 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus, /* * Get the next pending IRQ. */ -unsigned int iSeries_get_irq(struct pt_regs *regs) +int iSeries_get_irq(struct pt_regs *regs) { - int irq = NO_IRQ_IGNORE; + /* -2 means ignore this interrupt */ + int irq = -2; #ifdef CONFIG_SMP if (get_lppaca()->int_dword.fields.ipi_cnt) { @@ -333,57 +359,9 @@ unsigned int iSeries_get_irq(struct pt_regs *regs) } spin_unlock(&pending_irqs_lock); if (irq >= NR_IRQS) - irq = NO_IRQ_IGNORE; + irq = -2; } #endif return irq; } - -static int iseries_irq_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw, unsigned int flags) -{ - set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq); - - return 0; -} - -static struct irq_host_ops iseries_irq_host_ops = { - .map = iseries_irq_host_map, -}; - -/* - * This is called by init_IRQ. set in ppc_md.init_IRQ by iSeries_setup.c - * It must be called before the bus walk. - */ -void __init iSeries_init_IRQ(void) -{ - /* Register PCI event handler and open an event path */ - struct irq_host *host; - int ret; - - /* - * The Hypervisor only allows us up to 256 interrupt - * sources (the irq number is passed in a u8). - */ - irq_set_virq_count(256); - - /* Create irq host. No need for a revmap since HV will give us - * back our virtual irq number - */ - host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &iseries_irq_host_ops, 0); - BUG_ON(host == NULL); - irq_set_default_host(host); - - ret = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo, - &pci_event_handler); - if (ret == 0) { - ret = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0); - if (ret != 0) - printk(KERN_ERR "iseries_init_IRQ: open event path " - "failed with rc 0x%x\n", ret); - } else - printk(KERN_ERR "iseries_init_IRQ: register handler " - "failed with rc 0x%x\n", ret); -} - diff --git a/trunk/arch/powerpc/platforms/iseries/irq.h b/trunk/arch/powerpc/platforms/iseries/irq.h index 1ee8985140e5..188aa808abd7 100644 --- a/trunk/arch/powerpc/platforms/iseries/irq.h +++ b/trunk/arch/powerpc/platforms/iseries/irq.h @@ -4,6 +4,6 @@ extern void iSeries_init_IRQ(void); extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, u32); extern void iSeries_activate_IRQs(void); -extern unsigned int iSeries_get_irq(struct pt_regs *); +extern int iSeries_get_irq(struct pt_regs *); #endif /* _ISERIES_IRQ_H */ diff --git a/trunk/arch/powerpc/platforms/iseries/lpardata.c b/trunk/arch/powerpc/platforms/iseries/lpardata.c index a7769445d6c7..438e2dba63b5 100644 --- a/trunk/arch/powerpc/platforms/iseries/lpardata.c +++ b/trunk/arch/powerpc/platforms/iseries/lpardata.c @@ -6,6 +6,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/iseries/setup.c b/trunk/arch/powerpc/platforms/iseries/setup.c index c9605d773a77..66c77e4f8ec2 100644 --- a/trunk/arch/powerpc/platforms/iseries/setup.c +++ b/trunk/arch/powerpc/platforms/iseries/setup.c @@ -16,6 +16,7 @@ #undef DEBUG +#include #include #include #include @@ -294,6 +295,8 @@ static void __init iSeries_init_early(void) { DBG(" -> iSeries_init_early()\n"); + ppc64_interrupt_controller = IC_ISERIES; + #if defined(CONFIG_BLK_DEV_INITRD) /* * If the init RAM disk has been configured and there is @@ -657,6 +660,12 @@ static int __init iseries_probe(void) powerpc_firmware_features |= FW_FEATURE_ISERIES; powerpc_firmware_features |= FW_FEATURE_LPAR; + /* + * The Hypervisor only allows us up to 256 interrupt + * sources (the irq number is passed in a u8). + */ + virt_irq_max = 255; + hpte_init_iSeries(); return 1; diff --git a/trunk/arch/powerpc/platforms/iseries/smp.c b/trunk/arch/powerpc/platforms/iseries/smp.c index 2eb095edb472..6f9d407a709f 100644 --- a/trunk/arch/powerpc/platforms/iseries/smp.c +++ b/trunk/arch/powerpc/platforms/iseries/smp.c @@ -14,6 +14,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/maple/pci.c b/trunk/arch/powerpc/platforms/maple/pci.c index 63a1670d3bfd..f7170ff86dab 100644 --- a/trunk/arch/powerpc/platforms/maple/pci.c +++ b/trunk/arch/powerpc/platforms/maple/pci.c @@ -443,23 +443,18 @@ void __init maple_pci_init(void) int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel) { struct device_node *np; - unsigned int defirq = channel ? 15 : 14; - unsigned int irq; + int irq = channel ? 15 : 14; if (pdev->vendor != PCI_VENDOR_ID_AMD || pdev->device != PCI_DEVICE_ID_AMD_8111_IDE) - return defirq; + return irq; np = pci_device_to_OF_node(pdev); if (np == NULL) - return defirq; - irq = irq_of_parse_and_map(np, channel & 0x1); - if (irq == NO_IRQ) { - printk("Failed to map onboard IDE interrupt for channel %d\n", - channel); - return defirq; - } - return irq; + return irq; + if (np->n_intrs < 2) + return irq; + return np->intrs[channel & 0x1].line; } /* XXX: To remove once all firmwares are ok */ diff --git a/trunk/arch/powerpc/platforms/maple/setup.c b/trunk/arch/powerpc/platforms/maple/setup.c index cb528c9de4c3..4e32a5417fd1 100644 --- a/trunk/arch/powerpc/platforms/maple/setup.c +++ b/trunk/arch/powerpc/platforms/maple/setup.c @@ -11,8 +11,9 @@ * */ -#undef DEBUG +#define DEBUG +#include #include #include #include @@ -198,81 +199,50 @@ static void __init maple_init_early(void) { DBG(" -> maple_init_early\n"); + /* Setup interrupt mapping options */ + ppc64_interrupt_controller = IC_OPEN_PIC; + iommu_init_early_dart(); DBG(" <- maple_init_early\n"); } -/* - * This is almost identical to pSeries and CHRP. We need to make that - * code generic at one point, with appropriate bits in the device-tree to - * identify the presence of an HT APIC - */ -static void __init maple_init_IRQ(void) + +static __init void maple_init_IRQ(void) { - struct device_node *root, *np, *mpic_node = NULL; + struct device_node *root; unsigned int *opprop; - unsigned long openpic_addr = 0; - int naddr, n, i, opplen, has_isus = 0; + unsigned long opic_addr; struct mpic *mpic; - unsigned int flags = MPIC_PRIMARY; + unsigned char senses[128]; + int n; - /* Locate MPIC in the device-tree. Note that there is a bug - * in Maple device-tree where the type of the controller is - * open-pic and not interrupt-controller - */ - for_each_node_by_type(np, "open-pic") { - mpic_node = np; - break; - } - if (mpic_node == NULL) { - printk(KERN_ERR - "Failed to locate the MPIC interrupt controller\n"); - return; - } + DBG(" -> maple_init_IRQ\n"); - /* Find address list in /platform-open-pic */ + /* XXX: Non standard, replace that with a proper openpic/mpic node + * in the device-tree. Find the Open PIC if present */ root = of_find_node_by_path("/"); - naddr = prom_n_addr_cells(root); - opprop = (unsigned int *) get_property(root, "platform-open-pic", - &opplen); - if (opprop != 0) { - openpic_addr = of_read_number(opprop, naddr); - has_isus = (opplen > naddr); - printk(KERN_DEBUG "OpenPIC addr: %lx, has ISUs: %d\n", - openpic_addr, has_isus); - } + opprop = (unsigned int *) get_property(root, + "platform-open-pic", NULL); + if (opprop == 0) + panic("OpenPIC not found !\n"); + + n = prom_n_addr_cells(root); + for (opic_addr = 0; n > 0; --n) + opic_addr = (opic_addr << 32) + *opprop++; of_node_put(root); - BUG_ON(openpic_addr == 0); - - /* Check for a big endian MPIC */ - if (get_property(np, "big-endian", NULL) != NULL) - flags |= MPIC_BIG_ENDIAN; + /* Obtain sense values from device-tree */ + prom_get_irq_senses(senses, 0, 128); - /* XXX Maple specific bits */ - flags |= MPIC_BROKEN_U3 | MPIC_WANTS_RESET; - - /* Setup the openpic driver. More device-tree junks, we hard code no - * ISUs for now. I'll have to revisit some stuffs with the folks doing - * the firmware for those - */ - mpic = mpic_alloc(mpic_node, openpic_addr, flags, - /*has_isus ? 16 :*/ 0, 0, " MPIC "); + mpic = mpic_alloc(opic_addr, + MPIC_PRIMARY | MPIC_BIG_ENDIAN | + MPIC_BROKEN_U3 | MPIC_WANTS_RESET, + 0, 0, 128, 128, senses, 128, "U3-MPIC"); BUG_ON(mpic == NULL); - - /* Add ISUs */ - opplen /= sizeof(u32); - for (n = 0, i = naddr; i < opplen; i += naddr, n++) { - unsigned long isuaddr = of_read_number(opprop + i, naddr); - mpic_assign_isu(mpic, n, isuaddr); - } - - /* All ISUs are setup, complete initialization */ mpic_init(mpic); - ppc_md.get_irq = mpic_get_irq; - of_node_put(mpic_node); - of_node_put(root); + + DBG(" <- maple_init_IRQ\n"); } static void __init maple_progress(char *s, unsigned short hex) @@ -287,9 +257,7 @@ static void __init maple_progress(char *s, unsigned short hex) static int __init maple_probe(void) { unsigned long root = of_get_flat_dt_root(); - - if (!of_flat_dt_is_compatible(root, "Momentum,Maple") && - !of_flat_dt_is_compatible(root, "Momentum,Apache")) + if (!of_flat_dt_is_compatible(root, "Momentum,Maple")) return 0; /* * On U3, the DART (iommu) must be allocated now since it @@ -310,6 +278,7 @@ define_machine(maple_md) { .setup_arch = maple_setup_arch, .init_early = maple_init_early, .init_IRQ = maple_init_IRQ, + .get_irq = mpic_get_irq, .pcibios_fixup = maple_pcibios_fixup, .pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq, .restart = maple_restart, diff --git a/trunk/arch/powerpc/platforms/maple/time.c b/trunk/arch/powerpc/platforms/maple/time.c index 9f7579b38c72..b9a2b3d4bf33 100644 --- a/trunk/arch/powerpc/platforms/maple/time.c +++ b/trunk/arch/powerpc/platforms/maple/time.c @@ -11,6 +11,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/powermac/backlight.c b/trunk/arch/powerpc/platforms/powermac/backlight.c index 69f65e215a5c..c7a27eddca6d 100644 --- a/trunk/arch/powerpc/platforms/powermac/backlight.c +++ b/trunk/arch/powerpc/platforms/powermac/backlight.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/powermac/bootx_init.c b/trunk/arch/powerpc/platforms/powermac/bootx_init.c index 871b002c9f90..eacbfd9beabc 100644 --- a/trunk/arch/powerpc/platforms/powermac/bootx_init.c +++ b/trunk/arch/powerpc/platforms/powermac/bootx_init.c @@ -9,10 +9,11 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include -#include +#include #include #include #include @@ -162,8 +163,6 @@ static void __init bootx_add_chosen_props(unsigned long base, { u32 val; - bootx_dt_add_prop("linux,bootx", NULL, 0, mem_end); - if (bootx_info->kernelParamsOffset) { char *args = (char *)((unsigned long)bootx_info) + bootx_info->kernelParamsOffset; @@ -183,25 +182,8 @@ static void __init bootx_add_chosen_props(unsigned long base, static void __init bootx_add_display_props(unsigned long base, unsigned long *mem_end) { - boot_infos_t *bi = bootx_info; - u32 tmp; - bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end); bootx_dt_add_prop("linux,opened", NULL, 0, mem_end); - tmp = bi->dispDeviceDepth; - bootx_dt_add_prop("linux,bootx-depth", &tmp, 4, mem_end); - tmp = bi->dispDeviceRect[2] - bi->dispDeviceRect[0]; - bootx_dt_add_prop("linux,bootx-width", &tmp, 4, mem_end); - tmp = bi->dispDeviceRect[3] - bi->dispDeviceRect[1]; - bootx_dt_add_prop("linux,bootx-height", &tmp, 4, mem_end); - tmp = bi->dispDeviceRowBytes; - bootx_dt_add_prop("linux,bootx-linebytes", &tmp, 4, mem_end); - tmp = (u32)bi->dispDeviceBase; - if (tmp == 0) - tmp = (u32)bi->logicalDisplayBase; - tmp += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes; - tmp += bi->dispDeviceRect[0] * ((bi->dispDeviceDepth + 7) / 8); - bootx_dt_add_prop("linux,bootx-addr", &tmp, 4, mem_end); } static void __init bootx_dt_add_string(char *s, unsigned long *mem_end) @@ -230,7 +212,7 @@ static void __init bootx_scan_dt_build_strings(unsigned long base, if (!strcmp(namep, "/chosen")) { DBG(" detected /chosen ! adding properties names !\n"); - bootx_dt_add_string("linux,bootx", mem_end); + bootx_dt_add_string("linux,platform", mem_end); bootx_dt_add_string("linux,stdout-path", mem_end); bootx_dt_add_string("linux,initrd-start", mem_end); bootx_dt_add_string("linux,initrd-end", mem_end); @@ -241,11 +223,6 @@ static void __init bootx_scan_dt_build_strings(unsigned long base, DBG(" detected display ! adding properties names !\n"); bootx_dt_add_string("linux,boot-display", mem_end); bootx_dt_add_string("linux,opened", mem_end); - bootx_dt_add_string("linux,bootx-depth", mem_end); - bootx_dt_add_string("linux,bootx-width", mem_end); - bootx_dt_add_string("linux,bootx-height", mem_end); - bootx_dt_add_string("linux,bootx-linebytes", mem_end); - bootx_dt_add_string("linux,bootx-addr", mem_end); strncpy(bootx_disp_path, namep, 255); } @@ -467,14 +444,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4) if (!BOOT_INFO_IS_V2_COMPATIBLE(bi)) bi->logicalDisplayBase = bi->dispDeviceBase; - /* Fixup depth 16 -> 15 as that's what MacOS calls 16bpp */ - if (bi->dispDeviceDepth == 16) - bi->dispDeviceDepth = 15; - #ifdef CONFIG_BOOTX_TEXT - ptr = (unsigned long)bi->logicalDisplayBase; - ptr += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes; - ptr += bi->dispDeviceRect[0] * ((bi->dispDeviceDepth + 7) / 8); btext_setup_display(bi->dispDeviceRect[2] - bi->dispDeviceRect[0], bi->dispDeviceRect[3] - bi->dispDeviceRect[1], bi->dispDeviceDepth, bi->dispDeviceRowBytes, diff --git a/trunk/arch/powerpc/platforms/powermac/cache.S b/trunk/arch/powerpc/platforms/powermac/cache.S index 6be1a4af3359..fb977de6b704 100644 --- a/trunk/arch/powerpc/platforms/powermac/cache.S +++ b/trunk/arch/powerpc/platforms/powermac/cache.S @@ -14,6 +14,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/powermac/cpufreq_32.c b/trunk/arch/powerpc/platforms/powermac/cpufreq_32.c index 62926248bdb8..af2a8f9f1222 100644 --- a/trunk/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/trunk/arch/powerpc/platforms/powermac/cpufreq_32.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include @@ -67,7 +68,7 @@ static unsigned int cur_freq; static unsigned int sleep_freq; /* - * Different models uses different mechanisms to switch the frequency + * Different models uses different mecanisms to switch the frequency */ static int (*set_speed_proc)(int low_speed); static unsigned int (*get_speed_proc)(void); @@ -267,7 +268,7 @@ static int pmu_set_cpu_speed(int low_speed) /* Make sure the decrementer won't interrupt us */ asm volatile("mtdec %0" : : "r" (0x7fffffff)); - /* Make sure any pending DEC interrupt occurring while we did + /* Make sure any pending DEC interrupt occuring while we did * the above didn't re-enable the DEC */ mb(); asm volatile("mtdec %0" : : "r" (0x7fffffff)); diff --git a/trunk/arch/powerpc/platforms/powermac/cpufreq_64.c b/trunk/arch/powerpc/platforms/powermac/cpufreq_64.c index f08a14516139..b57e465a1b71 100644 --- a/trunk/arch/powerpc/platforms/powermac/cpufreq_64.c +++ b/trunk/arch/powerpc/platforms/powermac/cpufreq_64.c @@ -10,6 +10,7 @@ * that is iMac G5 and latest single CPU desktop. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/powermac/feature.c b/trunk/arch/powerpc/platforms/powermac/feature.c index f8313bf9a9f7..85e00cb0006e 100644 --- a/trunk/arch/powerpc/platforms/powermac/feature.c +++ b/trunk/arch/powerpc/platforms/powermac/feature.c @@ -16,6 +16,7 @@ * - Split split split... * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/powermac/low_i2c.c b/trunk/arch/powerpc/platforms/powermac/low_i2c.c index 8677f50c2586..c896ce83d412 100644 --- a/trunk/arch/powerpc/platforms/powermac/low_i2c.c +++ b/trunk/arch/powerpc/platforms/powermac/low_i2c.c @@ -30,6 +30,7 @@ #undef DEBUG #undef DEBUG_LOW +#include #include #include #include @@ -522,11 +523,10 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) host->speed = KW_I2C_MODE_25KHZ; break; } - host->irq = irq_of_parse_and_map(np, 0); - if (host->irq == NO_IRQ) - printk(KERN_WARNING - "low_i2c: Failed to map interrupt for %s\n", - np->full_name); + if (np->n_intrs > 0) + host->irq = np->intrs[0].line; + else + host->irq = NO_IRQ; host->base = ioremap((*addrp), 0x1000); if (host->base == NULL) { diff --git a/trunk/arch/powerpc/platforms/powermac/nvram.c b/trunk/arch/powerpc/platforms/powermac/nvram.c index 6a36ea9bf673..262f967b880a 100644 --- a/trunk/arch/powerpc/platforms/powermac/nvram.c +++ b/trunk/arch/powerpc/platforms/powermac/nvram.c @@ -8,6 +8,7 @@ * * Todo: - add support for the OF persistent properties */ +#include #include #include #include @@ -29,8 +30,6 @@ #include #include -#include "pmac.h" - #define DEBUG #ifdef DEBUG @@ -82,6 +81,9 @@ static int nvram_partitions[3]; // XXX Turn that into a sem static DEFINE_SPINLOCK(nv_lock); +extern int pmac_newworld; +extern int system_running; + static int (*core99_write_bank)(int bank, u8* datas); static int (*core99_erase_bank)(int bank); diff --git a/trunk/arch/powerpc/platforms/powermac/pci.c b/trunk/arch/powerpc/platforms/powermac/pci.c index 556b349797e8..d524a915aa86 100644 --- a/trunk/arch/powerpc/platforms/powermac/pci.c +++ b/trunk/arch/powerpc/platforms/powermac/pci.c @@ -46,9 +46,6 @@ static int has_uninorth; static struct pci_controller *u3_agp; static struct pci_controller *u4_pcie; static struct pci_controller *u3_ht; -#define has_second_ohare 0 -#else -static int has_second_ohare; #endif /* CONFIG_PPC64 */ extern u8 pci_cache_line_size; @@ -650,33 +647,6 @@ static void __init init_p2pbridge(void) early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val); } -static void __init init_second_ohare(void) -{ - struct device_node *np = of_find_node_by_name(NULL, "pci106b,7"); - unsigned char bus, devfn; - unsigned short cmd; - - if (np == NULL) - return; - - /* This must run before we initialize the PICs since the second - * ohare hosts a PIC that will be accessed there. - */ - if (pci_device_from_OF_node(np, &bus, &devfn) == 0) { - struct pci_controller* hose = - pci_find_hose_for_OF_device(np); - if (!hose) { - printk(KERN_ERR "Can't find PCI hose for OHare2 !\n"); - return; - } - early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd); - cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; - cmd &= ~PCI_COMMAND_IO; - early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd); - } - has_second_ohare = 1; -} - /* * Some Apple desktop machines have a NEC PD720100A USB2 controller * on the motherboard. Open Firmware, on these, will disable the @@ -718,6 +688,9 @@ static void __init fixup_nec_usb2(void) " EHCI, fixing up...\n"); data &= ~1UL; early_write_config_dword(hose, bus, devfn, 0xe4, data); + early_write_config_byte(hose, bus, + devfn | 2, PCI_INTERRUPT_LINE, + nec->intrs[0].line); } } } @@ -985,28 +958,32 @@ static int __init add_bridge(struct device_node *dev) return 0; } -void __init pmac_pcibios_fixup(void) +static void __init pcibios_fixup_OF_interrupts(void) { struct pci_dev* dev = NULL; + /* + * Open Firmware often doesn't initialize the + * PCI_INTERRUPT_LINE config register properly, so we + * should find the device node and apply the interrupt + * obtained from the OF device-tree + */ for_each_pci_dev(dev) { - /* Read interrupt from the device-tree */ - pci_read_irq_line(dev); - - /* Fixup interrupt for the modem/ethernet combo controller. - * on machines with a second ohare chip. - * The number in the device tree (27) is bogus (correct for - * the ethernet-only board but not the combo ethernet/modem - * board). The real interrupt is 28 on the second controller - * -> 28+32 = 60. - */ - if (has_second_ohare && - dev->vendor == PCI_VENDOR_ID_DEC && - dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) - dev->irq = irq_create_mapping(NULL, 60, 0); + struct device_node *node; + node = pci_device_to_OF_node(dev); + /* this is the node, see if it has interrupts */ + if (node && node->n_intrs > 0) + dev->irq = node->intrs[0].line; + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); } } +void __init pmac_pcibios_fixup(void) +{ + /* Fixup interrupts according to OF tree */ + pcibios_fixup_OF_interrupts(); +} + #ifdef CONFIG_PPC64 static void __init pmac_fixup_phb_resources(void) { @@ -1094,7 +1071,6 @@ void __init pmac_pci_init(void) #else /* CONFIG_PPC64 */ init_p2pbridge(); - init_second_ohare(); fixup_nec_usb2(); /* We are still having some issues with the Xserve G4, enabling diff --git a/trunk/arch/powerpc/platforms/powermac/pfunc_base.c b/trunk/arch/powerpc/platforms/powermac/pfunc_base.c index 6d66359ec8c8..a3bd3e728fa3 100644 --- a/trunk/arch/powerpc/platforms/powermac/pfunc_base.c +++ b/trunk/arch/powerpc/platforms/powermac/pfunc_base.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -24,18 +25,19 @@ static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs) static int macio_do_gpio_irq_enable(struct pmf_function *func) { - unsigned int irq = irq_of_parse_and_map(func->node, 0); - if (irq == NO_IRQ) + if (func->node->n_intrs < 1) return -EINVAL; - return request_irq(irq, macio_gpio_irq, 0, func->node->name, func); + + return request_irq(func->node->intrs[0].line, macio_gpio_irq, 0, + func->node->name, func); } static int macio_do_gpio_irq_disable(struct pmf_function *func) { - unsigned int irq = irq_of_parse_and_map(func->node, 0); - if (irq == NO_IRQ) + if (func->node->n_intrs < 1) return -EINVAL; - free_irq(irq, func); + + free_irq(func->node->intrs[0].line, func); return 0; } diff --git a/trunk/arch/powerpc/platforms/powermac/pfunc_core.c b/trunk/arch/powerpc/platforms/powermac/pfunc_core.c index b117adbf9571..93e7505debc5 100644 --- a/trunk/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/trunk/arch/powerpc/platforms/powermac/pfunc_core.c @@ -5,6 +5,7 @@ * FIXME: LOCKING !!! */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/powermac/pic.c b/trunk/arch/powerpc/platforms/powermac/pic.c index 3d328bc1f7e0..9f6189af6dd6 100644 --- a/trunk/arch/powerpc/platforms/powermac/pic.c +++ b/trunk/arch/powerpc/platforms/powermac/pic.c @@ -15,6 +15,7 @@ * */ +#include #include #include #include @@ -65,36 +66,39 @@ static u32 level_mask[4]; static DEFINE_SPINLOCK(pmac_pic_lock); +#define GATWICK_IRQ_POOL_SIZE 10 +static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE]; + #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) static unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; -static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; -static int pmac_irq_cascade = -1; -static struct irq_host *pmac_pic_host; -static void __pmac_retrigger(unsigned int irq_nr) +/* + * Mark an irq as "lost". This is only used on the pmac + * since it can lose interrupts (see pmac_set_irq_mask). + * -- Cort + */ +void __set_lost(unsigned long irq_nr, int nokick) { - if (irq_nr >= max_real_irqs && pmac_irq_cascade > 0) { - __set_bit(irq_nr, ppc_lost_interrupts); - irq_nr = pmac_irq_cascade; - mb(); - } - if (!__test_and_set_bit(irq_nr, ppc_lost_interrupts)) { + if (!test_and_set_bit(irq_nr, ppc_lost_interrupts)) { atomic_inc(&ppc_n_lost_interrupts); - set_dec(1); + if (!nokick) + set_dec(1); } } -static void pmac_mask_and_ack_irq(unsigned int virq) +static void pmac_mask_and_ack_irq(unsigned int irq_nr) { - unsigned int src = irq_map[virq].hwirq; - unsigned long bit = 1UL << (virq & 0x1f); - int i = virq >> 5; + unsigned long bit = 1UL << (irq_nr & 0x1f); + int i = irq_nr >> 5; unsigned long flags; - spin_lock_irqsave(&pmac_pic_lock, flags); - __clear_bit(src, ppc_cached_irq_mask); - if (__test_and_clear_bit(src, ppc_lost_interrupts)) + if ((unsigned)irq_nr >= max_irqs) + return; + + clear_bit(irq_nr, ppc_cached_irq_mask); + if (test_and_clear_bit(irq_nr, ppc_lost_interrupts)) atomic_dec(&ppc_n_lost_interrupts); + spin_lock_irqsave(&pmac_pic_lock, flags); out_le32(&pmac_irq_hw[i]->enable, ppc_cached_irq_mask[i]); out_le32(&pmac_irq_hw[i]->ack, bit); do { @@ -106,29 +110,16 @@ static void pmac_mask_and_ack_irq(unsigned int virq) spin_unlock_irqrestore(&pmac_pic_lock, flags); } -static void pmac_ack_irq(unsigned int virq) -{ - unsigned int src = irq_map[virq].hwirq; - unsigned long bit = 1UL << (src & 0x1f); - int i = src >> 5; - unsigned long flags; - - spin_lock_irqsave(&pmac_pic_lock, flags); - if (__test_and_clear_bit(src, ppc_lost_interrupts)) - atomic_dec(&ppc_n_lost_interrupts); - out_le32(&pmac_irq_hw[i]->ack, bit); - (void)in_le32(&pmac_irq_hw[i]->ack); - spin_unlock_irqrestore(&pmac_pic_lock, flags); -} - -static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost) +static void pmac_set_irq_mask(unsigned int irq_nr, int nokicklost) { unsigned long bit = 1UL << (irq_nr & 0x1f); int i = irq_nr >> 5; + unsigned long flags; if ((unsigned)irq_nr >= max_irqs) return; + spin_lock_irqsave(&pmac_pic_lock, flags); /* enable unmasked interrupts */ out_le32(&pmac_irq_hw[i]->enable, ppc_cached_irq_mask[i]); @@ -145,78 +136,71 @@ static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost) * the bit in the flag register or request another interrupt. */ if (bit & ppc_cached_irq_mask[i] & in_le32(&pmac_irq_hw[i]->level)) - __pmac_retrigger(irq_nr); + __set_lost((ulong)irq_nr, nokicklost); + spin_unlock_irqrestore(&pmac_pic_lock, flags); } /* When an irq gets requested for the first client, if it's an * edge interrupt, we clear any previous one on the controller */ -static unsigned int pmac_startup_irq(unsigned int virq) +static unsigned int pmac_startup_irq(unsigned int irq_nr) { - unsigned long flags; - unsigned int src = irq_map[virq].hwirq; - unsigned long bit = 1UL << (src & 0x1f); - int i = src >> 5; + unsigned long bit = 1UL << (irq_nr & 0x1f); + int i = irq_nr >> 5; - spin_lock_irqsave(&pmac_pic_lock, flags); - if ((irq_desc[virq].status & IRQ_LEVEL) == 0) + if ((irq_desc[irq_nr].status & IRQ_LEVEL) == 0) out_le32(&pmac_irq_hw[i]->ack, bit); - __set_bit(src, ppc_cached_irq_mask); - __pmac_set_irq_mask(src, 0); - spin_unlock_irqrestore(&pmac_pic_lock, flags); + set_bit(irq_nr, ppc_cached_irq_mask); + pmac_set_irq_mask(irq_nr, 0); return 0; } -static void pmac_mask_irq(unsigned int virq) +static void pmac_mask_irq(unsigned int irq_nr) { - unsigned long flags; - unsigned int src = irq_map[virq].hwirq; - - spin_lock_irqsave(&pmac_pic_lock, flags); - __clear_bit(src, ppc_cached_irq_mask); - __pmac_set_irq_mask(src, 0); - spin_unlock_irqrestore(&pmac_pic_lock, flags); + clear_bit(irq_nr, ppc_cached_irq_mask); + pmac_set_irq_mask(irq_nr, 0); + mb(); } -static void pmac_unmask_irq(unsigned int virq) +static void pmac_unmask_irq(unsigned int irq_nr) { - unsigned long flags; - unsigned int src = irq_map[virq].hwirq; - - spin_lock_irqsave(&pmac_pic_lock, flags); - __set_bit(src, ppc_cached_irq_mask); - __pmac_set_irq_mask(src, 0); - spin_unlock_irqrestore(&pmac_pic_lock, flags); + set_bit(irq_nr, ppc_cached_irq_mask); + pmac_set_irq_mask(irq_nr, 0); } -static int pmac_retrigger(unsigned int virq) +static void pmac_end_irq(unsigned int irq_nr) { - unsigned long flags; - - spin_lock_irqsave(&pmac_pic_lock, flags); - __pmac_retrigger(irq_map[virq].hwirq); - spin_unlock_irqrestore(&pmac_pic_lock, flags); - return 1; + if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS)) + && irq_desc[irq_nr].action) { + set_bit(irq_nr, ppc_cached_irq_mask); + pmac_set_irq_mask(irq_nr, 1); + } } -static struct irq_chip pmac_pic = { + +struct hw_interrupt_type pmac_pic = { .typename = " PMAC-PIC ", .startup = pmac_startup_irq, - .mask = pmac_mask_irq, - .ack = pmac_ack_irq, - .mask_ack = pmac_mask_and_ack_irq, - .unmask = pmac_unmask_irq, - .retrigger = pmac_retrigger, + .enable = pmac_unmask_irq, + .disable = pmac_mask_irq, + .ack = pmac_mask_and_ack_irq, + .end = pmac_end_irq, +}; + +struct hw_interrupt_type gatwick_pic = { + .typename = " GATWICK ", + .startup = pmac_startup_irq, + .enable = pmac_unmask_irq, + .disable = pmac_mask_irq, + .ack = pmac_mask_and_ack_irq, + .end = pmac_end_irq, }; static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs) { - unsigned long flags; int irq, bits; - int rc = IRQ_NONE; - spin_lock_irqsave(&pmac_pic_lock, flags); for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) { int i = irq >> 5; bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; @@ -226,20 +210,17 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs) if (bits == 0) continue; irq += __ilog2(bits); - spin_unlock_irqrestore(&pmac_pic_lock, flags); __do_IRQ(irq, regs); - spin_lock_irqsave(&pmac_pic_lock, flags); - rc = IRQ_HANDLED; + return IRQ_HANDLED; } - spin_unlock_irqrestore(&pmac_pic_lock, flags); - return rc; + printk("gatwick irq not from gatwick pic\n"); + return IRQ_NONE; } -static unsigned int pmac_pic_get_irq(struct pt_regs *regs) +static int pmac_get_irq(struct pt_regs *regs) { int irq; unsigned long bits = 0; - unsigned long flags; #ifdef CONFIG_SMP void psurge_smp_message_recv(struct pt_regs *); @@ -247,10 +228,9 @@ static unsigned int pmac_pic_get_irq(struct pt_regs *regs) /* IPI's are a hack on the powersurge -- Cort */ if ( smp_processor_id() != 0 ) { psurge_smp_message_recv(regs); - return NO_IRQ_IGNORE; /* ignore, already handled */ + return -2; /* ignore, already handled */ } #endif /* CONFIG_SMP */ - spin_lock_irqsave(&pmac_pic_lock, flags); for (irq = max_real_irqs; (irq -= 32) >= 0; ) { int i = irq >> 5; bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; @@ -262,10 +242,133 @@ static unsigned int pmac_pic_get_irq(struct pt_regs *regs) irq += __ilog2(bits); break; } - spin_unlock_irqrestore(&pmac_pic_lock, flags); - if (unlikely(irq < 0)) - return NO_IRQ; - return irq_linear_revmap(pmac_pic_host, irq); + + return irq; +} + +/* This routine will fix some missing interrupt values in the device tree + * on the gatwick mac-io controller used by some PowerBooks + * + * Walking of OF nodes could use a bit more fixing up here, but it's not + * very important as this is all boot time code on static portions of the + * device-tree. + * + * However, the modifications done to "intrs" will have to be removed and + * replaced with proper updates of the "interrupts" properties or + * AAPL,interrupts, yet to be decided, once the dynamic parsing is there. + */ +static void __init pmac_fix_gatwick_interrupts(struct device_node *gw, + int irq_base) +{ + struct device_node *node; + int count; + + memset(gatwick_int_pool, 0, sizeof(gatwick_int_pool)); + count = 0; + for (node = NULL; (node = of_get_next_child(gw, node)) != NULL;) { + /* Fix SCC */ + if ((strcasecmp(node->name, "escc") == 0) && node->child) { + if (node->child->n_intrs < 3) { + node->child->intrs = &gatwick_int_pool[count]; + count += 3; + } + node->child->n_intrs = 3; + node->child->intrs[0].line = 15+irq_base; + node->child->intrs[1].line = 4+irq_base; + node->child->intrs[2].line = 5+irq_base; + printk(KERN_INFO "irq: fixed SCC on gatwick" + " (%d,%d,%d)\n", + node->child->intrs[0].line, + node->child->intrs[1].line, + node->child->intrs[2].line); + } + /* Fix media-bay & left SWIM */ + if (strcasecmp(node->name, "media-bay") == 0) { + struct device_node* ya_node; + + if (node->n_intrs == 0) + node->intrs = &gatwick_int_pool[count++]; + node->n_intrs = 1; + node->intrs[0].line = 29+irq_base; + printk(KERN_INFO "irq: fixed media-bay on gatwick" + " (%d)\n", node->intrs[0].line); + + ya_node = node->child; + while(ya_node) { + if (strcasecmp(ya_node->name, "floppy") == 0) { + if (ya_node->n_intrs < 2) { + ya_node->intrs = &gatwick_int_pool[count]; + count += 2; + } + ya_node->n_intrs = 2; + ya_node->intrs[0].line = 19+irq_base; + ya_node->intrs[1].line = 1+irq_base; + printk(KERN_INFO "irq: fixed floppy on second controller (%d,%d)\n", + ya_node->intrs[0].line, ya_node->intrs[1].line); + } + if (strcasecmp(ya_node->name, "ata4") == 0) { + if (ya_node->n_intrs < 2) { + ya_node->intrs = &gatwick_int_pool[count]; + count += 2; + } + ya_node->n_intrs = 2; + ya_node->intrs[0].line = 14+irq_base; + ya_node->intrs[1].line = 3+irq_base; + printk(KERN_INFO "irq: fixed ide on second controller (%d,%d)\n", + ya_node->intrs[0].line, ya_node->intrs[1].line); + } + ya_node = ya_node->sibling; + } + } + } + if (count > 10) { + printk("WARNING !! Gatwick interrupt pool overflow\n"); + printk(" GATWICK_IRQ_POOL_SIZE = %d\n", GATWICK_IRQ_POOL_SIZE); + printk(" requested = %d\n", count); + } +} + +/* + * The PowerBook 3400/2400/3500 can have a combo ethernet/modem + * card which includes an ohare chip that acts as a second interrupt + * controller. If we find this second ohare, set it up and fix the + * interrupt value in the device tree for the ethernet chip. + */ +static void __init enable_second_ohare(struct device_node *np) +{ + unsigned char bus, devfn; + unsigned short cmd; + struct device_node *ether; + + /* This code doesn't strictly belong here, it could be part of + * either the PCI initialisation or the feature code. It's kept + * here for historical reasons. + */ + if (pci_device_from_OF_node(np, &bus, &devfn) == 0) { + struct pci_controller* hose = + pci_find_hose_for_OF_device(np); + if (!hose) { + printk(KERN_ERR "Can't find PCI hose for OHare2 !\n"); + return; + } + early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd); + cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; + cmd &= ~PCI_COMMAND_IO; + early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd); + } + + /* Fix interrupt for the modem/ethernet combo controller. The number + * in the device tree (27) is bogus (correct for the ethernet-only + * board but not the combo ethernet/modem board). + * The real interrupt is 28 on the second controller -> 28+32 = 60. + */ + ether = of_find_node_by_name(NULL, "pci1011,14"); + if (ether && ether->n_intrs > 0) { + ether->intrs[0].line = 60; + printk(KERN_INFO "irq: Fixed ethernet IRQ to %d\n", + ether->intrs[0].line); + } + of_node_put(ether); } #ifdef CONFIG_XMON @@ -279,65 +382,22 @@ static struct irqaction xmon_action = { static struct irqaction gatwick_cascade_action = { .handler = gatwick_action, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, .name = "cascade", }; -static int pmac_pic_host_match(struct irq_host *h, struct device_node *node) -{ - /* We match all, we don't always have a node anyway */ - return 1; -} - -static int pmac_pic_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw, unsigned int flags) -{ - struct irq_desc *desc = get_irq_desc(virq); - int level; - - if (hw >= max_irqs) - return -EINVAL; - - /* Mark level interrupts, set delayed disable for edge ones and set - * handlers - */ - level = !!(level_mask[hw >> 5] & (1UL << (hw & 0x1f))); - if (level) - desc->status |= IRQ_LEVEL; - else - desc->status |= IRQ_DELAYED_DISABLE; - set_irq_chip_and_handler(virq, &pmac_pic, level ? - handle_level_irq : handle_edge_irq); - return 0; -} - -static int pmac_pic_host_xlate(struct irq_host *h, struct device_node *ct, - u32 *intspec, unsigned int intsize, - irq_hw_number_t *out_hwirq, - unsigned int *out_flags) - -{ - *out_hwirq = *intspec; - return 0; -} - -static struct irq_host_ops pmac_pic_host_ops = { - .match = pmac_pic_host_match, - .map = pmac_pic_host_map, - .xlate = pmac_pic_host_xlate, -}; - static void __init pmac_pic_probe_oldstyle(void) { int i; + int irq_cascade = -1; struct device_node *master = NULL; struct device_node *slave = NULL; u8 __iomem *addr; struct resource r; /* Set our get_irq function */ - ppc_md.get_irq = pmac_pic_get_irq; + ppc_md.get_irq = pmac_get_irq; /* * Find the interrupt controller type & node @@ -355,6 +415,7 @@ static void __init pmac_pic_probe_oldstyle(void) if (slave) { max_irqs = 64; level_mask[1] = OHARE_LEVEL_MASK; + enable_second_ohare(slave); } } else if ((master = of_find_node_by_name(NULL, "mac-io")) != NULL) { max_irqs = max_real_irqs = 64; @@ -378,18 +439,14 @@ static void __init pmac_pic_probe_oldstyle(void) max_irqs = 128; level_mask[2] = HEATHROW_LEVEL_MASK; level_mask[3] = 0; + pmac_fix_gatwick_interrupts(slave, max_real_irqs); } } BUG_ON(master == NULL); - /* - * Allocate an irq host - */ - pmac_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, max_irqs, - &pmac_pic_host_ops, - max_irqs); - BUG_ON(pmac_pic_host == NULL); - irq_set_default_host(pmac_pic_host); + /* Set the handler for the main PIC */ + for ( i = 0; i < max_real_irqs ; i++ ) + irq_desc[i].chip = &pmac_pic; /* Get addresses of first controller if we have a node for it */ BUG_ON(of_address_to_resource(master, 0, &r)); @@ -416,38 +473,39 @@ static void __init pmac_pic_probe_oldstyle(void) pmac_irq_hw[i++] = (volatile struct pmac_irq_hw __iomem *) (addr + 0x10); - pmac_irq_cascade = irq_of_parse_and_map(slave, 0); + irq_cascade = slave->intrs[0].line; printk(KERN_INFO "irq: Found slave Apple PIC %s for %d irqs" " cascade: %d\n", slave->full_name, - max_irqs - max_real_irqs, pmac_irq_cascade); + max_irqs - max_real_irqs, irq_cascade); } of_node_put(slave); - /* Disable all interrupts in all controllers */ + /* disable all interrupts in all controllers */ for (i = 0; i * 32 < max_irqs; ++i) out_le32(&pmac_irq_hw[i]->enable, 0); - /* Hookup cascade irq */ - if (slave && pmac_irq_cascade != NO_IRQ) - setup_irq(pmac_irq_cascade, &gatwick_cascade_action); + /* mark level interrupts */ + for (i = 0; i < max_irqs; i++) + if (level_mask[i >> 5] & (1UL << (i & 0x1f))) + irq_desc[i].status = IRQ_LEVEL; + /* Setup handlers for secondary controller and hook cascade irq*/ + if (slave) { + for ( i = max_real_irqs ; i < max_irqs ; i++ ) + irq_desc[i].chip = &gatwick_pic; + setup_irq(irq_cascade, &gatwick_cascade_action); + } printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); #ifdef CONFIG_XMON - setup_irq(irq_create_mapping(NULL, 20, 0), &xmon_action); + setup_irq(20, &xmon_action); #endif } #endif /* CONFIG_PPC32 */ -static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +static int pmac_u3_cascade(struct pt_regs *regs, void *data) { - struct mpic *mpic = desc->handler_data; - - unsigned int cascade_irq = mpic_get_one_irq(mpic, regs); - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq, regs); - desc->chip->eoi(irq); + return mpic_get_one_irq((struct mpic *)data, regs); } static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic) @@ -457,20 +515,21 @@ static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic) int nmi_irq; pswitch = of_find_node_by_name(NULL, "programmer-switch"); - if (pswitch) { - nmi_irq = irq_of_parse_and_map(pswitch, 0); - if (nmi_irq != NO_IRQ) { - mpic_irq_set_priority(nmi_irq, 9); - setup_irq(nmi_irq, &xmon_action); - } - of_node_put(pswitch); + if (pswitch && pswitch->n_intrs) { + nmi_irq = pswitch->intrs[0].line; + mpic_irq_set_priority(nmi_irq, 9); + setup_irq(nmi_irq, &xmon_action); } + of_node_put(pswitch); #endif /* defined(CONFIG_XMON) && defined(CONFIG_PPC32) */ } static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, int master) { + unsigned char senses[128]; + int offset = master ? 0 : 128; + int count = master ? 128 : 124; const char *name = master ? " MPIC 1 " : " MPIC 2 "; struct resource r; struct mpic *mpic; @@ -483,6 +542,8 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); + prom_get_irq_senses(senses, offset, offset + count); + flags |= MPIC_WANTS_RESET; if (get_property(np, "big-endian", NULL)) flags |= MPIC_BIG_ENDIAN; @@ -493,7 +554,8 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, if (master && (flags & MPIC_BIG_ENDIAN)) flags |= MPIC_BROKEN_U3; - mpic = mpic_alloc(np, r.start, flags, 0, 0, name); + mpic = mpic_alloc(r.start, flags, 0, offset, count, master ? 252 : 0, + senses, count, name); if (mpic == NULL) return NULL; @@ -506,7 +568,6 @@ static int __init pmac_pic_probe_mpic(void) { struct mpic *mpic1, *mpic2; struct device_node *np, *master = NULL, *slave = NULL; - unsigned int cascade; /* We can have up to 2 MPICs cascaded */ for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) @@ -543,15 +604,8 @@ static int __init pmac_pic_probe_mpic(void) of_node_put(master); /* No slave, let's go out */ - if (slave == NULL) - return 0; - - /* Get/Map slave interrupt */ - cascade = irq_of_parse_and_map(slave, 0); - if (cascade == NO_IRQ) { - printk(KERN_ERR "Failed to map cascade IRQ\n"); + if (slave == NULL || slave->n_intrs < 1) return 0; - } mpic2 = pmac_setup_one_mpic(slave, 0); if (mpic2 == NULL) { @@ -559,8 +613,7 @@ static int __init pmac_pic_probe_mpic(void) of_node_put(slave); return 0; } - set_irq_data(cascade, mpic2); - set_irq_chained_handler(cascade, pmac_u3_cascade); + mpic_setup_cascade(slave->intrs[0].line, pmac_u3_cascade, mpic2); of_node_put(slave); return 0; @@ -569,19 +622,6 @@ static int __init pmac_pic_probe_mpic(void) void __init pmac_pic_init(void) { - unsigned int flags = 0; - - /* We configure the OF parsing based on our oldworld vs. newworld - * platform type and wether we were booted by BootX. - */ -#ifdef CONFIG_PPC32 - if (!pmac_newworld) - flags |= OF_IMAP_OLDWORLD_MAC; - if (get_property(of_chosen, "linux,bootx", NULL) != NULL) - flags |= OF_IMAP_NO_PHANDLE; - of_irq_map_init(flags); -#endif /* CONFIG_PPC_32 */ - /* We first try to detect Apple's new Core99 chipset, since mac-io * is quite different on those machines and contains an IBM MPIC2. */ @@ -604,7 +644,6 @@ unsigned long sleep_save_mask[2]; /* This used to be passed by the PMU driver but that link got * broken with the new driver model. We use this tweak for now... - * We really want to do things differently though... */ static int pmacpic_find_viaint(void) { @@ -618,7 +657,7 @@ static int pmacpic_find_viaint(void) np = of_find_node_by_name(NULL, "via-pmu"); if (np == NULL) goto not_found; - viaint = irq_of_parse_and_map(np, 0);; + viaint = np->intrs[0].line; #endif /* CONFIG_ADB_PMU */ not_found: diff --git a/trunk/arch/powerpc/platforms/powermac/pmac.h b/trunk/arch/powerpc/platforms/powermac/pmac.h index 94e7b24b840b..21c7b0f8f329 100644 --- a/trunk/arch/powerpc/platforms/powermac/pmac.h +++ b/trunk/arch/powerpc/platforms/powermac/pmac.h @@ -12,8 +12,6 @@ struct rtc_time; -extern int pmac_newworld; - extern long pmac_time_init(void); extern unsigned long pmac_get_boot_time(void); extern void pmac_get_rtc_time(struct rtc_time *); diff --git a/trunk/arch/powerpc/platforms/powermac/setup.c b/trunk/arch/powerpc/platforms/powermac/setup.c index 31a9da769fa2..89c5775f83be 100644 --- a/trunk/arch/powerpc/platforms/powermac/setup.c +++ b/trunk/arch/powerpc/platforms/powermac/setup.c @@ -23,6 +23,7 @@ * bootup setup stuff.. */ +#include #include #include #include @@ -613,6 +614,9 @@ static void __init pmac_init_early(void) udbg_adb_init(!!strstr(cmd_line, "btextdbg")); #ifdef CONFIG_PPC64 + /* Setup interrupt mapping options */ + ppc64_interrupt_controller = IC_OPEN_PIC; + iommu_init_early_dart(); #endif } diff --git a/trunk/arch/powerpc/platforms/powermac/sleep.S b/trunk/arch/powerpc/platforms/powermac/sleep.S index 1174ca128efa..22b113d19b24 100644 --- a/trunk/arch/powerpc/platforms/powermac/sleep.S +++ b/trunk/arch/powerpc/platforms/powermac/sleep.S @@ -10,6 +10,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/powermac/smp.c b/trunk/arch/powerpc/platforms/powermac/smp.c index 827b7121ffb8..1065d87fc279 100644 --- a/trunk/arch/powerpc/platforms/powermac/smp.c +++ b/trunk/arch/powerpc/platforms/powermac/smp.c @@ -21,6 +21,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include @@ -377,7 +378,7 @@ static void __init psurge_dual_sync_tb(int cpu_nr) static struct irqaction psurge_irqaction = { .handler = psurge_primary_intr, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, .name = "primary IPI", }; diff --git a/trunk/arch/powerpc/platforms/powermac/time.c b/trunk/arch/powerpc/platforms/powermac/time.c index a4173906e945..890758aa9667 100644 --- a/trunk/arch/powerpc/platforms/powermac/time.c +++ b/trunk/arch/powerpc/platforms/powermac/time.c @@ -9,6 +9,7 @@ * Copyright (C) 2003-2005 Benjamin Herrenschmidt. * */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/powermac/udbg_adb.c b/trunk/arch/powerpc/platforms/powermac/udbg_adb.c index 6124e59e1038..06c8265c2baf 100644 --- a/trunk/arch/powerpc/platforms/powermac/udbg_adb.c +++ b/trunk/arch/powerpc/platforms/powermac/udbg_adb.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/powermac/udbg_scc.c b/trunk/arch/powerpc/platforms/powermac/udbg_scc.c index 37e5b1eff911..b4fa9f03b461 100644 --- a/trunk/arch/powerpc/platforms/powermac/udbg_scc.c +++ b/trunk/arch/powerpc/platforms/powermac/udbg_scc.c @@ -8,6 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/pseries/eeh_driver.c b/trunk/arch/powerpc/platforms/pseries/eeh_driver.c index aaad2c0afcbf..0ec9a5445b95 100644 --- a/trunk/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/trunk/arch/powerpc/platforms/pseries/eeh_driver.c @@ -175,7 +175,7 @@ static void eeh_report_failure(struct pci_dev *dev, void *userdata) * * pSeries systems will isolate a PCI slot if the PCI-Host * bridge detects address or data parity errors, DMA's - * occurring to wild addresses (which usually happen due to + * occuring to wild addresses (which usually happen due to * bugs in device drivers or in PCI adapter firmware). * Slot isolations also occur if #SERR, #PERR or other misc * PCI-related errors are detected. diff --git a/trunk/arch/powerpc/platforms/pseries/iommu.c b/trunk/arch/powerpc/platforms/pseries/iommu.c index d67af2c65754..8cfb5706790e 100644 --- a/trunk/arch/powerpc/platforms/pseries/iommu.c +++ b/trunk/arch/powerpc/platforms/pseries/iommu.c @@ -24,6 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/pseries/lpar.c b/trunk/arch/powerpc/platforms/pseries/lpar.c index 3aeb40699042..27480705996f 100644 --- a/trunk/arch/powerpc/platforms/pseries/lpar.c +++ b/trunk/arch/powerpc/platforms/pseries/lpar.c @@ -21,6 +21,7 @@ #undef DEBUG_LOW +#include #include #include #include diff --git a/trunk/arch/powerpc/platforms/pseries/ras.c b/trunk/arch/powerpc/platforms/pseries/ras.c index 9df783088b61..9639c66b453d 100644 --- a/trunk/arch/powerpc/platforms/pseries/ras.c +++ b/trunk/arch/powerpc/platforms/pseries/ras.c @@ -72,62 +72,32 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id, /* #define DEBUG */ - -static void request_ras_irqs(struct device_node *np, +static void request_ras_irqs(struct device_node *np, char *propname, irqreturn_t (*handler)(int, void *, struct pt_regs *), const char *name) { - int i, index, count = 0; - struct of_irq oirq; - u32 *opicprop; - unsigned int opicplen; - unsigned int virqs[16]; - - /* Check for obsolete "open-pic-interrupt" property. If present, then - * map those interrupts using the default interrupt host and default - * trigger - */ - opicprop = (u32 *)get_property(np, "open-pic-interrupt", &opicplen); - if (opicprop) { - opicplen /= sizeof(u32); - for (i = 0; i < opicplen; i++) { - if (count > 15) - break; - virqs[count] = irq_create_mapping(NULL, *(opicprop++), - IRQ_TYPE_NONE); - if (virqs[count] == NO_IRQ) - printk(KERN_ERR "Unable to allocate interrupt " - "number for %s\n", np->full_name); - else - count++; - - } - } - /* Else use normal interrupt tree parsing */ - else { - /* First try to do a proper OF tree parsing */ - for (index = 0; of_irq_map_one(np, index, &oirq) == 0; - index++) { - if (count > 15) - break; - virqs[count] = irq_create_of_mapping(oirq.controller, - oirq.specifier, - oirq.size); - if (virqs[count] == NO_IRQ) - printk(KERN_ERR "Unable to allocate interrupt " - "number for %s\n", np->full_name); - else - count++; + unsigned int *ireg, len, i; + int virq, n_intr; + + ireg = (unsigned int *)get_property(np, propname, &len); + if (ireg == NULL) + return; + n_intr = prom_n_intr_cells(np); + len /= n_intr * sizeof(*ireg); + + for (i = 0; i < len; i++) { + virq = virt_irq_create_mapping(*ireg); + if (virq == NO_IRQ) { + printk(KERN_ERR "Unable to allocate interrupt " + "number for %s\n", np->full_name); + return; } - } - - /* Now request them */ - for (i = 0; i < count; i++) { - if (request_irq(virqs[i], handler, 0, name, NULL)) { + if (request_irq(irq_offset_up(virq), handler, 0, name, NULL)) { printk(KERN_ERR "Unable to request interrupt %d for " - "%s\n", virqs[i], np->full_name); + "%s\n", irq_offset_up(virq), np->full_name); return; } + ireg += n_intr; } } @@ -145,14 +115,20 @@ static int __init init_ras_IRQ(void) /* Internal Errors */ np = of_find_node_by_path("/event-sources/internal-errors"); if (np != NULL) { - request_ras_irqs(np, ras_error_interrupt, "RAS_ERROR"); + request_ras_irqs(np, "open-pic-interrupt", ras_error_interrupt, + "RAS_ERROR"); + request_ras_irqs(np, "interrupts", ras_error_interrupt, + "RAS_ERROR"); of_node_put(np); } /* EPOW Events */ np = of_find_node_by_path("/event-sources/epow-events"); if (np != NULL) { - request_ras_irqs(np, ras_epow_interrupt, "RAS_EPOW"); + request_ras_irqs(np, "open-pic-interrupt", ras_epow_interrupt, + "RAS_EPOW"); + request_ras_irqs(np, "interrupts", ras_epow_interrupt, + "RAS_EPOW"); of_node_put(np); } @@ -186,7 +162,7 @@ ras_epow_interrupt(int irq, void *dev_id, struct pt_regs * regs) status = rtas_call(ras_check_exception_token, 6, 1, NULL, RAS_VECTOR_OFFSET, - irq_map[irq].hwirq, + virt_irq_to_real(irq_offset_down(irq)), RTAS_EPOW_WARNING | RTAS_POWERMGM_EVENTS, critical, __pa(&ras_log_buf), rtas_get_error_log_max()); @@ -222,7 +198,7 @@ ras_error_interrupt(int irq, void *dev_id, struct pt_regs * regs) status = rtas_call(ras_check_exception_token, 6, 1, NULL, RAS_VECTOR_OFFSET, - irq_map[irq].hwirq, + virt_irq_to_real(irq_offset_down(irq)), RTAS_INTERNAL_ERROR, 1 /*Time Critical */, __pa(&ras_log_buf), rtas_get_error_log_max()); diff --git a/trunk/arch/powerpc/platforms/pseries/setup.c b/trunk/arch/powerpc/platforms/pseries/setup.c index 54a52437265c..b3197ff156c6 100644 --- a/trunk/arch/powerpc/platforms/pseries/setup.c +++ b/trunk/arch/powerpc/platforms/pseries/setup.c @@ -18,6 +18,7 @@ #undef DEBUG +#include #include #include #include @@ -76,9 +77,6 @@ #define DBG(fmt...) #endif -/* move those away to a .h */ -extern void smp_init_pseries_mpic(void); -extern void smp_init_pseries_xics(void); extern void find_udbg_vterm(void); int fwnmi_active; /* TRUE if an FWNMI handler is present */ @@ -86,7 +84,7 @@ int fwnmi_active; /* TRUE if an FWNMI handler is present */ static void pseries_shared_idle_sleep(void); static void pseries_dedicated_idle_sleep(void); -static struct device_node *pSeries_mpic_node; +struct mpic *pSeries_mpic; static void pSeries_show_cpuinfo(struct seq_file *m) { @@ -121,92 +119,63 @@ static void __init fwnmi_init(void) fwnmi_active = 1; } -void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +static void __init pSeries_init_mpic(void) { - unsigned int cascade_irq = i8259_irq(regs); - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq, regs); - desc->chip->eoi(irq); + unsigned int *addrp; + struct device_node *np; + unsigned long intack = 0; + + /* All ISUs are setup, complete initialization */ + mpic_init(pSeries_mpic); + + /* Check what kind of cascade ACK we have */ + if (!(np = of_find_node_by_name(NULL, "pci")) + || !(addrp = (unsigned int *) + get_property(np, "8259-interrupt-acknowledge", NULL))) + printk(KERN_ERR "Cannot find pci to get ack address\n"); + else + intack = addrp[prom_n_addr_cells(np)-1]; + of_node_put(np); + + /* Setup the legacy interrupts & controller */ + i8259_init(intack, 0); + + /* Hook cascade to mpic */ + mpic_setup_cascade(NUM_ISA_INTERRUPTS, i8259_irq_cascade, NULL); } -static void __init pseries_mpic_init_IRQ(void) +static void __init pSeries_setup_mpic(void) { - struct device_node *np, *old, *cascade = NULL; - unsigned int *addrp; - unsigned long intack = 0; unsigned int *opprop; unsigned long openpic_addr = 0; - unsigned int cascade_irq; - int naddr, n, i, opplen; - struct mpic *mpic; + unsigned char senses[NR_IRQS - NUM_ISA_INTERRUPTS]; + struct device_node *root; + int irq_count; - np = of_find_node_by_path("/"); - naddr = prom_n_addr_cells(np); - opprop = (unsigned int *) get_property(np, "platform-open-pic", &opplen); + /* Find the Open PIC if present */ + root = of_find_node_by_path("/"); + opprop = (unsigned int *) get_property(root, "platform-open-pic", NULL); if (opprop != 0) { - openpic_addr = of_read_number(opprop, naddr); + int n = prom_n_addr_cells(root); + + for (openpic_addr = 0; n > 0; --n) + openpic_addr = (openpic_addr << 32) + *opprop++; printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); } - of_node_put(np); + of_node_put(root); BUG_ON(openpic_addr == 0); + /* Get the sense values from OF */ + prom_get_irq_senses(senses, NUM_ISA_INTERRUPTS, NR_IRQS); + /* Setup the openpic driver */ - mpic = mpic_alloc(pSeries_mpic_node, openpic_addr, - MPIC_PRIMARY, - 16, 250, /* isu size, irq count */ - " MPIC "); - BUG_ON(mpic == NULL); - - /* Add ISUs */ - opplen /= sizeof(u32); - for (n = 0, i = naddr; i < opplen; i += naddr, n++) { - unsigned long isuaddr = of_read_number(opprop + i, naddr); - mpic_assign_isu(mpic, n, isuaddr); - } - - /* All ISUs are setup, complete initialization */ - mpic_init(mpic); - - /* Look for cascade */ - for_each_node_by_type(np, "interrupt-controller") - if (device_is_compatible(np, "chrp,iic")) { - cascade = np; - break; - } - if (cascade == NULL) - return; - - cascade_irq = irq_of_parse_and_map(cascade, 0); - if (cascade == NO_IRQ) { - printk(KERN_ERR "xics: failed to map cascade interrupt"); - return; - } - - /* Check ACK type */ - for (old = of_node_get(cascade); old != NULL ; old = np) { - np = of_get_parent(old); - of_node_put(old); - if (np == NULL) - break; - if (strcmp(np->name, "pci") != 0) - continue; - addrp = (u32 *)get_property(np, "8259-interrupt-acknowledge", - NULL); - if (addrp == NULL) - continue; - naddr = prom_n_addr_cells(np); - intack = addrp[naddr-1]; - if (naddr > 1) - intack |= ((unsigned long)addrp[naddr-2]) << 32; - } - if (intack) - printk(KERN_DEBUG "mpic: PCI 8259 intack at 0x%016lx\n", - intack); - i8259_init(cascade, intack); - of_node_put(cascade); - set_irq_chained_handler(cascade_irq, pseries_8259_cascade); + irq_count = NR_IRQS - NUM_ISA_INTERRUPTS - 4; /* leave room for IPIs */ + pSeries_mpic = mpic_alloc(openpic_addr, MPIC_PRIMARY, + 16, 16, irq_count, /* isu size, irq offset, irq count */ + NR_IRQS - 4, /* ipi offset */ + senses, irq_count, /* sense & sense size */ + " MPIC "); } static void pseries_lpar_enable_pmcs(void) @@ -224,67 +193,23 @@ static void pseries_lpar_enable_pmcs(void) get_lppaca()->pmcregs_in_use = 1; } -#ifdef CONFIG_KEXEC -static void pseries_kexec_cpu_down_mpic(int crash_shutdown, int secondary) -{ - mpic_teardown_this_cpu(secondary); -} - -static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary) +static void __init pSeries_setup_arch(void) { - /* Don't risk a hypervisor call if we're crashing */ - if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { - unsigned long vpa = __pa(get_lppaca()); - - if (unregister_vpa(hard_smp_processor_id(), vpa)) { - printk("VPA deregistration of cpu %u (hw_cpu_id %d) " - "failed\n", smp_processor_id(), - hard_smp_processor_id()); - } + /* Fixup ppc_md depending on the type of interrupt controller */ + if (ppc64_interrupt_controller == IC_OPEN_PIC) { + ppc_md.init_IRQ = pSeries_init_mpic; + ppc_md.get_irq = mpic_get_irq; + /* Allocate the mpic now, so that find_and_init_phbs() can + * fill the ISUs */ + pSeries_setup_mpic(); + } else { + ppc_md.init_IRQ = xics_init_IRQ; + ppc_md.get_irq = xics_get_irq; } - xics_teardown_cpu(secondary); -} -#endif /* CONFIG_KEXEC */ -static void __init pseries_discover_pic(void) -{ - struct device_node *np; - char *typep; - - for (np = NULL; (np = of_find_node_by_name(np, - "interrupt-controller"));) { - typep = (char *)get_property(np, "compatible", NULL); - if (strstr(typep, "open-pic")) { - pSeries_mpic_node = of_node_get(np); - ppc_md.init_IRQ = pseries_mpic_init_IRQ; - ppc_md.get_irq = mpic_get_irq; -#ifdef CONFIG_KEXEC - ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_mpic; -#endif -#ifdef CONFIG_SMP - smp_init_pseries_mpic(); -#endif - return; - } else if (strstr(typep, "ppc-xicp")) { - ppc_md.init_IRQ = xics_init_IRQ; -#ifdef CONFIG_KEXEC - ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics; -#endif #ifdef CONFIG_SMP - smp_init_pseries_xics(); + smp_init_pSeries(); #endif - return; - } - } - printk(KERN_ERR "pSeries_discover_pic: failed to recognize" - " interrupt-controller\n"); -} - -static void __init pSeries_setup_arch(void) -{ - /* Discover PIC type and setup ppc_md accordingly */ - pseries_discover_pic(); - /* openpic global configuration register (64-bit format). */ /* openpic Interrupt Source Unit pointer (64-bit format). */ /* python0 facility area (mmio) (64-bit format) REAL address. */ @@ -336,11 +261,41 @@ static int __init pSeries_init_panel(void) } arch_initcall(pSeries_init_panel); +static void __init pSeries_discover_pic(void) +{ + struct device_node *np; + char *typep; + + /* + * Setup interrupt mapping options that are needed for finish_device_tree + * to properly parse the OF interrupt tree & do the virtual irq mapping + */ + __irq_offset_value = NUM_ISA_INTERRUPTS; + ppc64_interrupt_controller = IC_INVALID; + for (np = NULL; (np = of_find_node_by_name(np, "interrupt-controller"));) { + typep = (char *)get_property(np, "compatible", NULL); + if (strstr(typep, "open-pic")) { + ppc64_interrupt_controller = IC_OPEN_PIC; + break; + } else if (strstr(typep, "ppc-xicp")) { + ppc64_interrupt_controller = IC_PPC_XIC; + break; + } + } + if (ppc64_interrupt_controller == IC_INVALID) + printk("pSeries_discover_pic: failed to recognize" + " interrupt-controller\n"); + +} + static void pSeries_mach_cpu_die(void) { local_irq_disable(); idle_task_exit(); - xics_teardown_cpu(0); + /* Some hardware requires clearing the CPPR, while other hardware does not + * it is safe either way + */ + pSeriesLP_cppr_info(0, 0); rtas_stop_self(); /* Should never get here... */ BUG(); @@ -378,6 +333,8 @@ static void __init pSeries_init_early(void) iommu_init_early_pSeries(); + pSeries_discover_pic(); + DBG(" <- pSeries_init_early()\n"); } @@ -549,6 +506,27 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus) return PCI_PROBE_NORMAL; } +#ifdef CONFIG_KEXEC +static void pseries_kexec_cpu_down(int crash_shutdown, int secondary) +{ + /* Don't risk a hypervisor call if we're crashing */ + if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { + unsigned long vpa = __pa(get_lppaca()); + + if (unregister_vpa(hard_smp_processor_id(), vpa)) { + printk("VPA deregistration of cpu %u (hw_cpu_id %d) " + "failed\n", smp_processor_id(), + hard_smp_processor_id()); + } + } + + if (ppc64_interrupt_controller == IC_OPEN_PIC) + mpic_teardown_this_cpu(secondary); + else + xics_teardown_cpu(secondary); +} +#endif + define_machine(pseries) { .name = "pSeries", .probe = pSeries_probe, @@ -573,6 +551,7 @@ define_machine(pseries) { .system_reset_exception = pSeries_system_reset_exception, .machine_check_exception = pSeries_machine_check_exception, #ifdef CONFIG_KEXEC + .kexec_cpu_down = pseries_kexec_cpu_down, .machine_kexec = default_machine_kexec, .machine_kexec_prepare = default_machine_kexec_prepare, .machine_crash_shutdown = default_machine_crash_shutdown, diff --git a/trunk/arch/powerpc/platforms/pseries/smp.c b/trunk/arch/powerpc/platforms/pseries/smp.c index ac61098ff401..3cf78a6cd27c 100644 --- a/trunk/arch/powerpc/platforms/pseries/smp.c +++ b/trunk/arch/powerpc/platforms/pseries/smp.c @@ -14,6 +14,7 @@ #undef DEBUG +#include #include #include #include @@ -416,12 +417,27 @@ static struct smp_ops_t pSeries_xics_smp_ops = { #endif /* This is called very early */ -static void __init smp_init_pseries(void) +void __init smp_init_pSeries(void) { int i; DBG(" -> smp_init_pSeries()\n"); + switch (ppc64_interrupt_controller) { +#ifdef CONFIG_MPIC + case IC_OPEN_PIC: + smp_ops = &pSeries_mpic_smp_ops; + break; +#endif +#ifdef CONFIG_XICS + case IC_PPC_XIC: + smp_ops = &pSeries_xics_smp_ops; + break; +#endif + default: + panic("Invalid interrupt controller"); + } + #ifdef CONFIG_HOTPLUG_CPU smp_ops->cpu_disable = pSeries_cpu_disable; smp_ops->cpu_die = pSeries_cpu_die; @@ -456,18 +472,3 @@ static void __init smp_init_pseries(void) DBG(" <- smp_init_pSeries()\n"); } -#ifdef CONFIG_MPIC -void __init smp_init_pseries_mpic(void) -{ - smp_ops = &pSeries_mpic_smp_ops; - - smp_init_pseries(); -} -#endif - -void __init smp_init_pseries_xics(void) -{ - smp_ops = &pSeries_xics_smp_ops; - - smp_init_pseries(); -} diff --git a/trunk/arch/powerpc/platforms/pseries/xics.c b/trunk/arch/powerpc/platforms/pseries/xics.c index 716972aa9777..19c03dd43000 100644 --- a/trunk/arch/powerpc/platforms/pseries/xics.c +++ b/trunk/arch/powerpc/platforms/pseries/xics.c @@ -8,9 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ - -#undef DEBUG - +#include #include #include #include @@ -22,7 +20,6 @@ #include #include #include - #include #include #include @@ -35,6 +32,26 @@ #include "xics.h" +static unsigned int xics_startup(unsigned int irq); +static void xics_enable_irq(unsigned int irq); +static void xics_disable_irq(unsigned int irq); +static void xics_mask_and_ack_irq(unsigned int irq); +static void xics_end_irq(unsigned int irq); +static void xics_set_affinity(unsigned int irq_nr, cpumask_t cpumask); + +static struct hw_interrupt_type xics_pic = { + .typename = " XICS ", + .startup = xics_startup, + .enable = xics_enable_irq, + .disable = xics_disable_irq, + .ack = xics_mask_and_ack_irq, + .end = xics_end_irq, + .set_affinity = xics_set_affinity +}; + +/* This is used to map real irq numbers to virtual */ +static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC); + #define XICS_IPI 2 #define XICS_IRQ_SPURIOUS 0 @@ -43,7 +60,7 @@ /* * Mark IPIs as higher priority so we can take them inside interrupts that - * arent marked IRQF_DISABLED + * arent marked SA_INTERRUPT */ #define IPI_PRIORITY 4 @@ -65,12 +82,12 @@ struct xics_ipl { static struct xics_ipl __iomem *xics_per_cpu[NR_CPUS]; +static int xics_irq_8259_cascade = 0; +static int xics_irq_8259_cascade_real = 0; static unsigned int default_server = 0xFF; static unsigned int default_distrib_server = 0; static unsigned int interrupt_server_size = 8; -static struct irq_host *xics_host; - /* * XICS only has a single IPI, so encode the messages per CPU */ @@ -82,34 +99,48 @@ static int ibm_set_xive; static int ibm_int_on; static int ibm_int_off; +typedef struct { + int (*xirr_info_get)(int cpu); + void (*xirr_info_set)(int cpu, int val); + void (*cppr_info)(int cpu, u8 val); + void (*qirr_info)(int cpu, u8 val); +} xics_ops; -/* Direct HW low level accessors */ +/* SMP */ -static inline unsigned int direct_xirr_info_get(int n_cpu) +static int pSeries_xirr_info_get(int n_cpu) { return in_be32(&xics_per_cpu[n_cpu]->xirr.word); } -static inline void direct_xirr_info_set(int n_cpu, int value) +static void pSeries_xirr_info_set(int n_cpu, int value) { out_be32(&xics_per_cpu[n_cpu]->xirr.word, value); } -static inline void direct_cppr_info(int n_cpu, u8 value) +static void pSeries_cppr_info(int n_cpu, u8 value) { out_8(&xics_per_cpu[n_cpu]->xirr.bytes[0], value); } -static inline void direct_qirr_info(int n_cpu, u8 value) +static void pSeries_qirr_info(int n_cpu, u8 value) { out_8(&xics_per_cpu[n_cpu]->qirr.bytes[0], value); } +static xics_ops pSeries_ops = { + pSeries_xirr_info_get, + pSeries_xirr_info_set, + pSeries_cppr_info, + pSeries_qirr_info +}; -/* LPAR low level accessors */ +static xics_ops *ops = &pSeries_ops; +/* LPAR */ + static inline long plpar_eoi(unsigned long xirr) { return plpar_hcall_norets(H_EOI, xirr); @@ -131,7 +162,7 @@ static inline long plpar_xirr(unsigned long *xirr_ret) return plpar_hcall(H_XIRR, 0, 0, 0, 0, xirr_ret, &dummy, &dummy); } -static inline unsigned int lpar_xirr_info_get(int n_cpu) +static int pSeriesLP_xirr_info_get(int n_cpu) { unsigned long lpar_rc; unsigned long return_value; @@ -139,10 +170,10 @@ static inline unsigned int lpar_xirr_info_get(int n_cpu) lpar_rc = plpar_xirr(&return_value); if (lpar_rc != H_SUCCESS) panic(" bad return code xirr - rc = %lx \n", lpar_rc); - return (unsigned int)return_value; + return (int)return_value; } -static inline void lpar_xirr_info_set(int n_cpu, int value) +static void pSeriesLP_xirr_info_set(int n_cpu, int value) { unsigned long lpar_rc; unsigned long val64 = value & 0xffffffff; @@ -153,7 +184,7 @@ static inline void lpar_xirr_info_set(int n_cpu, int value) val64); } -static inline void lpar_cppr_info(int n_cpu, u8 value) +void pSeriesLP_cppr_info(int n_cpu, u8 value) { unsigned long lpar_rc; @@ -162,7 +193,7 @@ static inline void lpar_cppr_info(int n_cpu, u8 value) panic("bad return code cppr - rc = %lx\n", lpar_rc); } -static inline void lpar_qirr_info(int n_cpu , u8 value) +static void pSeriesLP_qirr_info(int n_cpu , u8 value) { unsigned long lpar_rc; @@ -171,16 +202,43 @@ static inline void lpar_qirr_info(int n_cpu , u8 value) panic("bad return code qirr - rc = %lx\n", lpar_rc); } +xics_ops pSeriesLP_ops = { + pSeriesLP_xirr_info_get, + pSeriesLP_xirr_info_set, + pSeriesLP_cppr_info, + pSeriesLP_qirr_info +}; + +static unsigned int xics_startup(unsigned int virq) +{ + unsigned int irq; + + irq = irq_offset_down(virq); + if (radix_tree_insert(&irq_map, virt_irq_to_real(irq), + &virt_irq_to_real_map[irq]) == -ENOMEM) + printk(KERN_CRIT "Out of memory creating real -> virtual" + " IRQ mapping for irq %u (real 0x%x)\n", + virq, virt_irq_to_real(irq)); + xics_enable_irq(virq); + return 0; /* return value is ignored */ +} -/* High level handlers and init code */ +static unsigned int real_irq_to_virt(unsigned int real_irq) +{ + unsigned int *ptr; + ptr = radix_tree_lookup(&irq_map, real_irq); + if (ptr == NULL) + return NO_IRQ; + return ptr - virt_irq_to_real_map; +} #ifdef CONFIG_SMP -static int get_irq_server(unsigned int virq) +static int get_irq_server(unsigned int irq) { unsigned int server; /* For the moment only implement delivery to all cpus or one cpu */ - cpumask_t cpumask = irq_desc[virq].affinity; + cpumask_t cpumask = irq_desc[irq].affinity; cpumask_t tmp = CPU_MASK_NONE; if (!distribute_irqs) @@ -201,28 +259,23 @@ static int get_irq_server(unsigned int virq) } #else -static int get_irq_server(unsigned int virq) +static int get_irq_server(unsigned int irq) { return default_server; } #endif - -static void xics_unmask_irq(unsigned int virq) +static void xics_enable_irq(unsigned int virq) { unsigned int irq; int call_status; unsigned int server; - pr_debug("xics: unmask virq %d\n", virq); - - irq = (unsigned int)irq_map[virq].hwirq; - pr_debug(" -> map to hwirq 0x%x\n", irq); - if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) + irq = virt_irq_to_real(irq_offset_down(virq)); + if (irq == XICS_IPI) return; server = get_irq_server(virq); - call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, DEFAULT_PRIORITY); if (call_status != 0) { @@ -241,7 +294,7 @@ static void xics_unmask_irq(unsigned int virq) } } -static void xics_mask_real_irq(unsigned int irq) +static void xics_disable_real_irq(unsigned int irq) { int call_status; unsigned int server; @@ -266,86 +319,75 @@ static void xics_mask_real_irq(unsigned int irq) } } -static void xics_mask_irq(unsigned int virq) +static void xics_disable_irq(unsigned int virq) { unsigned int irq; - pr_debug("xics: mask virq %d\n", virq); - - irq = (unsigned int)irq_map[virq].hwirq; - if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) - return; - xics_mask_real_irq(irq); -} - -static unsigned int xics_startup(unsigned int virq) -{ - unsigned int irq; - - /* force a reverse mapping of the interrupt so it gets in the cache */ - irq = (unsigned int)irq_map[virq].hwirq; - irq_radix_revmap(xics_host, irq); - - /* unmask it */ - xics_unmask_irq(virq); - return 0; + irq = virt_irq_to_real(irq_offset_down(virq)); + xics_disable_real_irq(irq); } -static void xics_eoi_direct(unsigned int virq) +static void xics_end_irq(unsigned int irq) { int cpu = smp_processor_id(); - unsigned int irq = (unsigned int)irq_map[virq].hwirq; iosync(); - direct_xirr_info_set(cpu, (0xff << 24) | irq); -} + ops->xirr_info_set(cpu, ((0xff << 24) | + (virt_irq_to_real(irq_offset_down(irq))))); +} -static void xics_eoi_lpar(unsigned int virq) +static void xics_mask_and_ack_irq(unsigned int irq) { int cpu = smp_processor_id(); - unsigned int irq = (unsigned int)irq_map[virq].hwirq; - iosync(); - lpar_xirr_info_set(cpu, (0xff << 24) | irq); + if (irq < irq_offset_value()) { + i8259_pic.ack(irq); + iosync(); + ops->xirr_info_set(cpu, ((0xff<<24) | + xics_irq_8259_cascade_real)); + iosync(); + } } -static inline unsigned int xics_remap_irq(unsigned int vec) +int xics_get_irq(struct pt_regs *regs) { - unsigned int irq; + unsigned int cpu = smp_processor_id(); + unsigned int vec; + int irq; + vec = ops->xirr_info_get(cpu); + /* (vec >> 24) == old priority */ vec &= 0x00ffffff; - if (vec == XICS_IRQ_SPURIOUS) - return NO_IRQ; - irq = irq_radix_revmap(xics_host, vec); - if (likely(irq != NO_IRQ)) - return irq; - - printk(KERN_ERR "Interrupt %u (real) is invalid," - " disabling it.\n", vec); - xics_mask_real_irq(vec); - return NO_IRQ; + /* for sanity, this had better be < NR_IRQS - 16 */ + if (vec == xics_irq_8259_cascade_real) { + irq = i8259_irq(regs); + xics_end_irq(irq_offset_up(xics_irq_8259_cascade)); + } else if (vec == XICS_IRQ_SPURIOUS) { + irq = -1; + } else { + irq = real_irq_to_virt(vec); + if (irq == NO_IRQ) + irq = real_irq_to_virt_slowpath(vec); + if (irq == NO_IRQ) { + printk(KERN_ERR "Interrupt %u (real) is invalid," + " disabling it.\n", vec); + xics_disable_real_irq(vec); + } else + irq = irq_offset_up(irq); + } + return irq; } -static unsigned int xics_get_irq_direct(struct pt_regs *regs) -{ - unsigned int cpu = smp_processor_id(); - - return xics_remap_irq(direct_xirr_info_get(cpu)); -} +#ifdef CONFIG_SMP -static unsigned int xics_get_irq_lpar(struct pt_regs *regs) +static irqreturn_t xics_ipi_action(int irq, void *dev_id, struct pt_regs *regs) { - unsigned int cpu = smp_processor_id(); - - return xics_remap_irq(lpar_xirr_info_get(cpu)); -} + int cpu = smp_processor_id(); -#ifdef CONFIG_SMP + ops->qirr_info(cpu, 0xff); -static irqreturn_t xics_ipi_dispatch(int cpu, struct pt_regs *regs) -{ WARN_ON(cpu_is_offline(cpu)); while (xics_ipi_message[cpu].value) { @@ -377,88 +419,18 @@ static irqreturn_t xics_ipi_dispatch(int cpu, struct pt_regs *regs) return IRQ_HANDLED; } -static irqreturn_t xics_ipi_action_direct(int irq, void *dev_id, struct pt_regs *regs) -{ - int cpu = smp_processor_id(); - - direct_qirr_info(cpu, 0xff); - - return xics_ipi_dispatch(cpu, regs); -} - -static irqreturn_t xics_ipi_action_lpar(int irq, void *dev_id, struct pt_regs *regs) -{ - int cpu = smp_processor_id(); - - lpar_qirr_info(cpu, 0xff); - - return xics_ipi_dispatch(cpu, regs); -} - void xics_cause_IPI(int cpu) { - if (firmware_has_feature(FW_FEATURE_LPAR)) - lpar_qirr_info(cpu, IPI_PRIORITY); - else - direct_qirr_info(cpu, IPI_PRIORITY); + ops->qirr_info(cpu, IPI_PRIORITY); } - #endif /* CONFIG_SMP */ -static void xics_set_cpu_priority(int cpu, unsigned char cppr) -{ - if (firmware_has_feature(FW_FEATURE_LPAR)) - lpar_cppr_info(cpu, cppr); - else - direct_cppr_info(cpu, cppr); - iosync(); -} - -static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) -{ - unsigned int irq; - int status; - int xics_status[2]; - unsigned long newmask; - cpumask_t tmp = CPU_MASK_NONE; - - irq = (unsigned int)irq_map[virq].hwirq; - if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) - return; - - status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); - - if (status) { - printk(KERN_ERR "xics_set_affinity: irq=%u ibm,get-xive " - "returns %d\n", irq, status); - return; - } - - /* For the moment only implement delivery to all cpus or one cpu */ - if (cpus_equal(cpumask, CPU_MASK_ALL)) { - newmask = default_distrib_server; - } else { - cpus_and(tmp, cpu_online_map, cpumask); - if (cpus_empty(tmp)) - return; - newmask = get_hard_smp_processor_id(first_cpu(tmp)); - } - - status = rtas_call(ibm_set_xive, 3, 1, NULL, - irq, newmask, xics_status[1]); - - if (status) { - printk(KERN_ERR "xics_set_affinity: irq=%u ibm,set-xive " - "returns %d\n", irq, status); - return; - } -} - void xics_setup_cpu(void) { int cpu = smp_processor_id(); - xics_set_cpu_priority(cpu, 0xff); + ops->cppr_info(cpu, 0xff); + iosync(); /* * Put the calling processor into the GIQ. This is really only @@ -471,266 +443,72 @@ void xics_setup_cpu(void) (1UL << interrupt_server_size) - 1 - default_distrib_server, 1); } - -static struct irq_chip xics_pic_direct = { - .typename = " XICS ", - .startup = xics_startup, - .mask = xics_mask_irq, - .unmask = xics_unmask_irq, - .eoi = xics_eoi_direct, - .set_affinity = xics_set_affinity -}; - - -static struct irq_chip xics_pic_lpar = { - .typename = " XICS ", - .startup = xics_startup, - .mask = xics_mask_irq, - .unmask = xics_unmask_irq, - .eoi = xics_eoi_lpar, - .set_affinity = xics_set_affinity -}; - - -static int xics_host_match(struct irq_host *h, struct device_node *node) -{ - /* IBM machines have interrupt parents of various funky types for things - * like vdevices, events, etc... The trick we use here is to match - * everything here except the legacy 8259 which is compatible "chrp,iic" - */ - return !device_is_compatible(node, "chrp,iic"); -} - -static int xics_host_map_direct(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw, unsigned int flags) -{ - unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; - - pr_debug("xics: map_direct virq %d, hwirq 0x%lx, flags: 0x%x\n", - virq, hw, flags); - - if (sense && sense != IRQ_TYPE_LEVEL_LOW) - printk(KERN_WARNING "xics: using unsupported sense 0x%x" - " for irq %d (h: 0x%lx)\n", flags, virq, hw); - - get_irq_desc(virq)->status |= IRQ_LEVEL; - set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq); - return 0; -} - -static int xics_host_map_lpar(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw, unsigned int flags) -{ - unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; - - pr_debug("xics: map_lpar virq %d, hwirq 0x%lx, flags: 0x%x\n", - virq, hw, flags); - - if (sense && sense != IRQ_TYPE_LEVEL_LOW) - printk(KERN_WARNING "xics: using unsupported sense 0x%x" - " for irq %d (h: 0x%lx)\n", flags, virq, hw); - - get_irq_desc(virq)->status |= IRQ_LEVEL; - set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq); - return 0; -} - -static int xics_host_xlate(struct irq_host *h, struct device_node *ct, - u32 *intspec, unsigned int intsize, - irq_hw_number_t *out_hwirq, unsigned int *out_flags) - -{ - /* Current xics implementation translates everything - * to level. It is not technically right for MSIs but this - * is irrelevant at this point. We might get smarter in the future - */ - *out_hwirq = intspec[0]; - *out_flags = IRQ_TYPE_LEVEL_LOW; - - return 0; -} - -static struct irq_host_ops xics_host_direct_ops = { - .match = xics_host_match, - .map = xics_host_map_direct, - .xlate = xics_host_xlate, -}; - -static struct irq_host_ops xics_host_lpar_ops = { - .match = xics_host_match, - .map = xics_host_map_lpar, - .xlate = xics_host_xlate, -}; - -static void __init xics_init_host(void) -{ - struct irq_host_ops *ops; - - if (firmware_has_feature(FW_FEATURE_LPAR)) - ops = &xics_host_lpar_ops; - else - ops = &xics_host_direct_ops; - xics_host = irq_alloc_host(IRQ_HOST_MAP_TREE, 0, ops, - XICS_IRQ_SPURIOUS); - BUG_ON(xics_host == NULL); - irq_set_default_host(xics_host); -} - -static void __init xics_map_one_cpu(int hw_id, unsigned long addr, - unsigned long size) +void xics_init_IRQ(void) { -#ifdef CONFIG_SMP int i; + unsigned long intr_size = 0; + struct device_node *np; + uint *ireg, ilen, indx = 0; + unsigned long intr_base = 0; + struct xics_interrupt_node { + unsigned long addr; + unsigned long size; + } intnodes[NR_CPUS]; - /* This may look gross but it's good enough for now, we don't quite - * have a hard -> linux processor id matching. - */ - for_each_possible_cpu(i) { - if (!cpu_present(i)) - continue; - if (hw_id == get_hard_smp_processor_id(i)) { - xics_per_cpu[i] = ioremap(addr, size); - return; - } - } -#else - if (hw_id != 0) - return; - xics_per_cpu[0] = ioremap(addr, size); -#endif /* CONFIG_SMP */ -} + ppc64_boot_msg(0x20, "XICS Init"); -static void __init xics_init_one_node(struct device_node *np, - unsigned int *indx) -{ - unsigned int ilen; - u32 *ireg; + ibm_get_xive = rtas_token("ibm,get-xive"); + ibm_set_xive = rtas_token("ibm,set-xive"); + ibm_int_on = rtas_token("ibm,int-on"); + ibm_int_off = rtas_token("ibm,int-off"); - /* This code does the theorically broken assumption that the interrupt - * server numbers are the same as the hard CPU numbers. - * This happens to be the case so far but we are playing with fire... - * should be fixed one of these days. -BenH. - */ - ireg = (u32 *)get_property(np, "ibm,interrupt-server-ranges", NULL); + np = of_find_node_by_type(NULL, "PowerPC-External-Interrupt-Presentation"); + if (!np) + panic("xics_init_IRQ: can't find interrupt presentation"); - /* Do that ever happen ? we'll know soon enough... but even good'old - * f80 does have that property .. - */ - WARN_ON(ireg == NULL); +nextnode: + ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", NULL); if (ireg) { /* * set node starting index for this node */ - *indx = *ireg; + indx = *ireg; } - ireg = (u32 *)get_property(np, "reg", &ilen); + + ireg = (uint *)get_property(np, "reg", &ilen); if (!ireg) panic("xics_init_IRQ: can't find interrupt reg property"); - while (ilen >= (4 * sizeof(u32))) { - unsigned long addr, size; - - /* XXX Use proper OF parsing code here !!! */ - addr = (unsigned long)*ireg++ << 32; - ilen -= sizeof(u32); - addr |= *ireg++; - ilen -= sizeof(u32); - size = (unsigned long)*ireg++ << 32; - ilen -= sizeof(u32); - size |= *ireg++; - ilen -= sizeof(u32); - xics_map_one_cpu(*indx, addr, size); - (*indx)++; - } -} - - -static void __init xics_setup_8259_cascade(void) -{ - struct device_node *np, *old, *found = NULL; - int cascade, naddr; - u32 *addrp; - unsigned long intack = 0; - - for_each_node_by_type(np, "interrupt-controller") - if (device_is_compatible(np, "chrp,iic")) { - found = np; - break; - } - if (found == NULL) { - printk(KERN_DEBUG "xics: no ISA interrupt controller\n"); - return; - } - cascade = irq_of_parse_and_map(found, 0); - if (cascade == NO_IRQ) { - printk(KERN_ERR "xics: failed to map cascade interrupt"); - return; - } - pr_debug("xics: cascade mapped to irq %d\n", cascade); - - for (old = of_node_get(found); old != NULL ; old = np) { - np = of_get_parent(old); - of_node_put(old); - if (np == NULL) - break; - if (strcmp(np->name, "pci") != 0) - continue; - addrp = (u32 *)get_property(np, "8259-interrupt-acknowledge", NULL); - if (addrp == NULL) - continue; - naddr = prom_n_addr_cells(np); - intack = addrp[naddr-1]; - if (naddr > 1) - intack |= ((unsigned long)addrp[naddr-2]) << 32; - } - if (intack) - printk(KERN_DEBUG "xics: PCI 8259 intack at 0x%016lx\n", intack); - i8259_init(found, intack); - of_node_put(found); - set_irq_chained_handler(cascade, pseries_8259_cascade); -} - -void __init xics_init_IRQ(void) -{ - int i; - struct device_node *np; - u32 *ireg, ilen, indx = 0; - int found = 0; - - ppc64_boot_msg(0x20, "XICS Init"); - - ibm_get_xive = rtas_token("ibm,get-xive"); - ibm_set_xive = rtas_token("ibm,set-xive"); - ibm_int_on = rtas_token("ibm,int-on"); - ibm_int_off = rtas_token("ibm,int-off"); - - for_each_node_by_type(np, "PowerPC-External-Interrupt-Presentation") { - found = 1; - if (firmware_has_feature(FW_FEATURE_LPAR)) - break; - xics_init_one_node(np, &indx); + while (ilen) { + intnodes[indx].addr = (unsigned long)*ireg++ << 32; + ilen -= sizeof(uint); + intnodes[indx].addr |= *ireg++; + ilen -= sizeof(uint); + intnodes[indx].size = (unsigned long)*ireg++ << 32; + ilen -= sizeof(uint); + intnodes[indx].size |= *ireg++; + ilen -= sizeof(uint); + indx++; + if (indx >= NR_CPUS) break; } - if (found == 0) - return; - xics_init_host(); + np = of_find_node_by_type(np, "PowerPC-External-Interrupt-Presentation"); + if ((indx < NR_CPUS) && np) goto nextnode; /* Find the server numbers for the boot cpu. */ for (np = of_find_node_by_type(NULL, "cpu"); np; np = of_find_node_by_type(np, "cpu")) { - ireg = (u32 *)get_property(np, "reg", &ilen); + ireg = (uint *)get_property(np, "reg", &ilen); if (ireg && ireg[0] == get_hard_smp_processor_id(boot_cpuid)) { - ireg = (u32 *)get_property(np, - "ibm,ppc-interrupt-gserver#s", - &ilen); + ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s", + &ilen); i = ilen / sizeof(int); if (ireg && i > 0) { default_server = ireg[0]; - /* take last element */ - default_distrib_server = ireg[i-1]; + default_distrib_server = ireg[i-1]; /* take last element */ } - ireg = (u32 *)get_property(np, + ireg = (uint *)get_property(np, "ibm,interrupt-server#-size", NULL); if (ireg) interrupt_server_size = *ireg; @@ -739,48 +517,132 @@ void __init xics_init_IRQ(void) } of_node_put(np); + intr_base = intnodes[0].addr; + intr_size = intnodes[0].size; + + np = of_find_node_by_type(NULL, "interrupt-controller"); + if (!np) { + printk(KERN_DEBUG "xics: no ISA interrupt controller\n"); + xics_irq_8259_cascade_real = -1; + xics_irq_8259_cascade = -1; + } else { + ireg = (uint *) get_property(np, "interrupts", NULL); + if (!ireg) + panic("xics_init_IRQ: can't find ISA interrupts property"); + + xics_irq_8259_cascade_real = *ireg; + xics_irq_8259_cascade + = virt_irq_create_mapping(xics_irq_8259_cascade_real); + i8259_init(0, 0); + of_node_put(np); + } + if (firmware_has_feature(FW_FEATURE_LPAR)) - ppc_md.get_irq = xics_get_irq_lpar; - else - ppc_md.get_irq = xics_get_irq_direct; + ops = &pSeriesLP_ops; + else { +#ifdef CONFIG_SMP + for_each_possible_cpu(i) { + int hard_id; - xics_setup_cpu(); + /* FIXME: Do this dynamically! --RR */ + if (!cpu_present(i)) + continue; + + hard_id = get_hard_smp_processor_id(i); + xics_per_cpu[i] = ioremap(intnodes[hard_id].addr, + intnodes[hard_id].size); + } +#else + xics_per_cpu[0] = ioremap(intr_base, intr_size); +#endif /* CONFIG_SMP */ + } - xics_setup_8259_cascade(); + for (i = irq_offset_value(); i < NR_IRQS; ++i) + get_irq_desc(i)->chip = &xics_pic; + + xics_setup_cpu(); ppc64_boot_msg(0x21, "XICS Done"); } +/* + * We cant do this in init_IRQ because we need the memory subsystem up for + * request_irq() + */ +static int __init xics_setup_i8259(void) +{ + if (ppc64_interrupt_controller == IC_PPC_XIC && + xics_irq_8259_cascade != -1) { + if (request_irq(irq_offset_up(xics_irq_8259_cascade), + no_action, 0, "8259 cascade", NULL)) + printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 " + "cascade\n"); + } + return 0; +} +arch_initcall(xics_setup_i8259); #ifdef CONFIG_SMP void xics_request_IPIs(void) { - unsigned int ipi; + virt_irq_to_real_map[XICS_IPI] = XICS_IPI; - ipi = irq_create_mapping(xics_host, XICS_IPI, 0); - BUG_ON(ipi == NO_IRQ); + /* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */ + request_irq(irq_offset_up(XICS_IPI), xics_ipi_action, SA_INTERRUPT, + "IPI", NULL); + get_irq_desc(irq_offset_up(XICS_IPI))->status |= IRQ_PER_CPU; +} +#endif - /* - * IPIs are marked IRQF_DISABLED as they must run with irqs - * disabled - */ - set_irq_handler(ipi, handle_percpu_irq); - if (firmware_has_feature(FW_FEATURE_LPAR)) - request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED, - "IPI", NULL); - else - request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED, - "IPI", NULL); +static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) +{ + unsigned int irq; + int status; + int xics_status[2]; + unsigned long newmask; + cpumask_t tmp = CPU_MASK_NONE; + + irq = virt_irq_to_real(irq_offset_down(virq)); + if (irq == XICS_IPI || irq == NO_IRQ) + return; + + status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); + + if (status) { + printk(KERN_ERR "xics_set_affinity: irq=%u ibm,get-xive " + "returns %d\n", irq, status); + return; + } + + /* For the moment only implement delivery to all cpus or one cpu */ + if (cpus_equal(cpumask, CPU_MASK_ALL)) { + newmask = default_distrib_server; + } else { + cpus_and(tmp, cpu_online_map, cpumask); + if (cpus_empty(tmp)) + return; + newmask = get_hard_smp_processor_id(first_cpu(tmp)); + } + + status = rtas_call(ibm_set_xive, 3, 1, NULL, + irq, newmask, xics_status[1]); + + if (status) { + printk(KERN_ERR "xics_set_affinity: irq=%u ibm,set-xive " + "returns %d\n", irq, status); + return; + } } -#endif /* CONFIG_SMP */ void xics_teardown_cpu(int secondary) { int cpu = smp_processor_id(); - unsigned int ipi; - struct irq_desc *desc; - xics_set_cpu_priority(cpu, 0); + ops->cppr_info(cpu, 0x00); + iosync(); + + /* Clear IPI */ + ops->qirr_info(cpu, 0xff); /* * we need to EOI the IPI if we got here from kexec down IPI @@ -789,13 +651,7 @@ void xics_teardown_cpu(int secondary) * should we be flagging idle loop instead? * or creating some task to be scheduled? */ - - ipi = irq_find_mapping(xics_host, XICS_IPI); - if (ipi == XICS_IRQ_SPURIOUS) - return; - desc = get_irq_desc(ipi); - if (desc->chip && desc->chip->eoi) - desc->chip->eoi(XICS_IPI); + ops->xirr_info_set(cpu, XICS_IPI); /* * Some machines need to have at least one cpu in the GIQ, @@ -803,8 +659,8 @@ void xics_teardown_cpu(int secondary) */ if (secondary) rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, - (1UL << interrupt_server_size) - 1 - - default_distrib_server, 0); + (1UL << interrupt_server_size) - 1 - + default_distrib_server, 0); } #ifdef CONFIG_HOTPLUG_CPU @@ -816,7 +672,8 @@ void xics_migrate_irqs_away(void) unsigned int irq, virq, cpu = smp_processor_id(); /* Reject any interrupt that was queued to us... */ - xics_set_cpu_priority(cpu, 0); + ops->cppr_info(cpu, 0); + iosync(); /* remove ourselves from the global interrupt queue */ status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, @@ -824,23 +681,24 @@ void xics_migrate_irqs_away(void) WARN_ON(status < 0); /* Allow IPIs again... */ - xics_set_cpu_priority(cpu, DEFAULT_PRIORITY); + ops->cppr_info(cpu, DEFAULT_PRIORITY); + iosync(); for_each_irq(virq) { - struct irq_desc *desc; + irq_desc_t *desc; int xics_status[2]; unsigned long flags; /* We cant set affinity on ISA interrupts */ - if (virq < NUM_ISA_INTERRUPTS) - continue; - if (irq_map[virq].host != xics_host) + if (virq < irq_offset_value()) continue; - irq = (unsigned int)irq_map[virq].hwirq; + + desc = get_irq_desc(virq); + irq = virt_irq_to_real(irq_offset_down(virq)); + /* We need to get IPIs still. */ - if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) + if (irq == XICS_IPI || irq == NO_IRQ) continue; - desc = get_irq_desc(virq); /* We only need to migrate enabled IRQS */ if (desc == NULL || desc->chip == NULL diff --git a/trunk/arch/powerpc/platforms/pseries/xics.h b/trunk/arch/powerpc/platforms/pseries/xics.h index 6ee1055b0ffb..e14c70868f1d 100644 --- a/trunk/arch/powerpc/platforms/pseries/xics.h +++ b/trunk/arch/powerpc/platforms/pseries/xics.h @@ -14,12 +14,13 @@ #include -extern void xics_init_IRQ(void); -extern void xics_setup_cpu(void); -extern void xics_teardown_cpu(int secondary); -extern void xics_cause_IPI(int cpu); -extern void xics_request_IPIs(void); -extern void xics_migrate_irqs_away(void); +void xics_init_IRQ(void); +int xics_get_irq(struct pt_regs *); +void xics_setup_cpu(void); +void xics_teardown_cpu(int secondary); +void xics_cause_IPI(int cpu); +void xics_request_IPIs(void); +void xics_migrate_irqs_away(void); /* first argument is ignored for now*/ void pSeriesLP_cppr_info(int n_cpu, u8 value); @@ -30,8 +31,4 @@ struct xics_ipi_struct { extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned; -struct irq_desc; -extern void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs); - #endif /* _POWERPC_KERNEL_XICS_H */ diff --git a/trunk/arch/powerpc/sysdev/Makefile b/trunk/arch/powerpc/sysdev/Makefile index cebfae242602..054bd8b41ef5 100644 --- a/trunk/arch/powerpc/sysdev/Makefile +++ b/trunk/arch/powerpc/sysdev/Makefile @@ -4,6 +4,7 @@ endif obj-$(CONFIG_MPIC) += mpic.o obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o +obj-$(CONFIG_PPC_I8259) += i8259.o obj-$(CONFIG_PPC_MPC106) += grackle.o obj-$(CONFIG_BOOKE) += dcr.o obj-$(CONFIG_40x) += dcr.o @@ -13,7 +14,3 @@ obj-$(CONFIG_PPC_83xx) += ipic.o obj-$(CONFIG_FSL_SOC) += fsl_soc.o obj-$(CONFIG_PPC_TODC) += todc.o obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o - -ifeq ($(CONFIG_PPC_MERGE),y) -obj-$(CONFIG_PPC_I8259) += i8259.o - endif diff --git a/trunk/arch/powerpc/sysdev/dart_iommu.c b/trunk/arch/powerpc/sysdev/dart_iommu.c index e32fadde1f77..7c7f34ce4986 100644 --- a/trunk/arch/powerpc/sysdev/dart_iommu.c +++ b/trunk/arch/powerpc/sysdev/dart_iommu.c @@ -27,6 +27,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/arch/powerpc/sysdev/fsl_soc.c b/trunk/arch/powerpc/sysdev/fsl_soc.c index e983972132d8..71a3275935ec 100644 --- a/trunk/arch/powerpc/sysdev/fsl_soc.c +++ b/trunk/arch/powerpc/sysdev/fsl_soc.c @@ -9,6 +9,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/powerpc/sysdev/i8259.c b/trunk/arch/powerpc/sysdev/i8259.c index 72c73a6105cd..2bff30f6d635 100644 --- a/trunk/arch/powerpc/sysdev/i8259.c +++ b/trunk/arch/powerpc/sysdev/i8259.c @@ -6,16 +6,11 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#undef DEBUG - #include #include #include -#include -#include #include #include -#include static volatile void __iomem *pci_intack; /* RO, gives us the irq vector */ @@ -25,8 +20,7 @@ static unsigned char cached_8259[2] = { 0xff, 0xff }; static DEFINE_SPINLOCK(i8259_lock); -static struct device_node *i8259_node; -static struct irq_host *i8259_host; +static int i8259_pic_irq_offset; /* * Acknowledge the IRQ using either the PCI host bridge's interrupt @@ -34,18 +28,16 @@ static struct irq_host *i8259_host; * which is called. It should be noted that polling is broken on some * IBM and Motorola PReP boxes so we must use the int-ack feature on them. */ -unsigned int i8259_irq(struct pt_regs *regs) +int i8259_irq(struct pt_regs *regs) { int irq; - int lock = 0; + + spin_lock(&i8259_lock); /* Either int-ack or poll for the IRQ */ if (pci_intack) irq = readb(pci_intack); else { - spin_lock(&i8259_lock); - lock = 1; - /* Perform an interrupt acknowledge cycle on controller 1. */ outb(0x0C, 0x20); /* prepare for poll */ irq = inb(0x20) & 7; @@ -70,13 +62,16 @@ unsigned int i8259_irq(struct pt_regs *regs) if (!pci_intack) outb(0x0B, 0x20); /* ISR register */ if(~inb(0x20) & 0x80) - irq = NO_IRQ; - } else if (irq == 0xff) - irq = NO_IRQ; + irq = -1; + } - if (lock) - spin_unlock(&i8259_lock); - return irq; + spin_unlock(&i8259_lock); + return irq + i8259_pic_irq_offset; +} + +int i8259_irq_cascade(struct pt_regs *regs, void *unused) +{ + return i8259_irq(regs); } static void i8259_mask_and_ack_irq(unsigned int irq_nr) @@ -84,6 +79,7 @@ static void i8259_mask_and_ack_irq(unsigned int irq_nr) unsigned long flags; spin_lock_irqsave(&i8259_lock, flags); + irq_nr -= i8259_pic_irq_offset; if (irq_nr > 7) { cached_A1 |= 1 << (irq_nr-8); inb(0xA1); /* DUMMY */ @@ -109,9 +105,8 @@ static void i8259_mask_irq(unsigned int irq_nr) { unsigned long flags; - pr_debug("i8259_mask_irq(%d)\n", irq_nr); - spin_lock_irqsave(&i8259_lock, flags); + irq_nr -= i8259_pic_irq_offset; if (irq_nr < 8) cached_21 |= 1 << irq_nr; else @@ -124,9 +119,8 @@ static void i8259_unmask_irq(unsigned int irq_nr) { unsigned long flags; - pr_debug("i8259_unmask_irq(%d)\n", irq_nr); - spin_lock_irqsave(&i8259_lock, flags); + irq_nr -= i8259_pic_irq_offset; if (irq_nr < 8) cached_21 &= ~(1 << irq_nr); else @@ -135,11 +129,19 @@ static void i8259_unmask_irq(unsigned int irq_nr) spin_unlock_irqrestore(&i8259_lock, flags); } -static struct irq_chip i8259_pic = { - .typename = " i8259 ", - .mask = i8259_mask_irq, - .unmask = i8259_unmask_irq, - .mask_ack = i8259_mask_and_ack_irq, +static void i8259_end_irq(unsigned int irq) +{ + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)) + && irq_desc[irq].action) + i8259_unmask_irq(irq); +} + +struct hw_interrupt_type i8259_pic = { + .typename = " i8259 ", + .enable = i8259_unmask_irq, + .disable = i8259_mask_irq, + .ack = i8259_mask_and_ack_irq, + .end = i8259_end_irq, }; static struct resource pic1_iores = { @@ -163,84 +165,25 @@ static struct resource pic_edgectrl_iores = { .flags = IORESOURCE_BUSY, }; -static int i8259_host_match(struct irq_host *h, struct device_node *node) -{ - return i8259_node == NULL || i8259_node == node; -} - -static int i8259_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw, unsigned int flags) -{ - pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw); - - /* We block the internal cascade */ - if (hw == 2) - get_irq_desc(virq)->status |= IRQ_NOREQUEST; - - /* We use the level stuff only for now, we might want to - * be more cautious here but that works for now - */ - get_irq_desc(virq)->status |= IRQ_LEVEL; - set_irq_chip_and_handler(virq, &i8259_pic, handle_level_irq); - return 0; -} - -static void i8259_host_unmap(struct irq_host *h, unsigned int virq) -{ - /* Make sure irq is masked in hardware */ - i8259_mask_irq(virq); - - /* remove chip and handler */ - set_irq_chip_and_handler(virq, NULL, NULL); - - /* Make sure it's completed */ - synchronize_irq(virq); -} - -static int i8259_host_xlate(struct irq_host *h, struct device_node *ct, - u32 *intspec, unsigned int intsize, - irq_hw_number_t *out_hwirq, unsigned int *out_flags) -{ - static unsigned char map_isa_senses[4] = { - IRQ_TYPE_LEVEL_LOW, - IRQ_TYPE_LEVEL_HIGH, - IRQ_TYPE_EDGE_FALLING, - IRQ_TYPE_EDGE_RISING, - }; - - *out_hwirq = intspec[0]; - if (intsize > 1 && intspec[1] < 4) - *out_flags = map_isa_senses[intspec[1]]; - else - *out_flags = IRQ_TYPE_NONE; - - return 0; -} - -static struct irq_host_ops i8259_host_ops = { - .match = i8259_host_match, - .map = i8259_host_map, - .unmap = i8259_host_unmap, - .xlate = i8259_host_xlate, +static struct irqaction i8259_irqaction = { + .handler = no_action, + .flags = SA_INTERRUPT, + .mask = CPU_MASK_NONE, + .name = "82c59 secondary cascade", }; -/**** - * i8259_init - Initialize the legacy controller - * @node: device node of the legacy PIC (can be NULL, but then, it will match - * all interrupts, so beware) - * @intack_addr: PCI interrupt acknowledge (real) address which will return - * the active irq from the 8259 +/* + * i8259_init() + * intack_addr - PCI interrupt acknowledge (real) address which will return + * the active irq from the 8259 */ -void i8259_init(struct device_node *node, unsigned long intack_addr) +void __init i8259_init(unsigned long intack_addr, int offset) { unsigned long flags; + int i; - /* initialize the controller */ spin_lock_irqsave(&i8259_lock, flags); - - /* Mask all first */ - outb(0xff, 0xA1); - outb(0xff, 0x21); + i8259_pic_irq_offset = offset; /* init master interrupt controller */ outb(0x11, 0x20); /* Start init sequence */ @@ -254,36 +197,21 @@ void i8259_init(struct device_node *node, unsigned long intack_addr) outb(0x02, 0xA1); /* edge triggered, Cascade (slave) on IRQ2 */ outb(0x01, 0xA1); /* Select 8086 mode */ - /* That thing is slow */ - udelay(100); - /* always read ISR */ outb(0x0B, 0x20); outb(0x0B, 0xA0); - /* Unmask the internal cascade */ - cached_21 &= ~(1 << 2); - - /* Set interrupt masks */ + /* Mask all interrupts */ outb(cached_A1, 0xA1); outb(cached_21, 0x21); spin_unlock_irqrestore(&i8259_lock, flags); - /* create a legacy host */ - if (node) - i8259_node = of_node_get(node); - i8259_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &i8259_host_ops, 0); - if (i8259_host == NULL) { - printk(KERN_ERR "i8259: failed to allocate irq host !\n"); - return; - } + for (i = 0; i < NUM_ISA_INTERRUPTS; ++i) + irq_desc[offset + i].chip = &i8259_pic; /* reserve our resources */ - /* XXX should we continue doing that ? it seems to cause problems - * with further requesting of PCI IO resources for that range... - * need to look into it. - */ + setup_irq(offset + 2, &i8259_irqaction); request_resource(&ioport_resource, &pic1_iores); request_resource(&ioport_resource, &pic2_iores); request_resource(&ioport_resource, &pic_edgectrl_iores); @@ -291,5 +219,4 @@ void i8259_init(struct device_node *node, unsigned long intack_addr) if (intack_addr != 0) pci_intack = ioremap(intack_addr, 1); - printk(KERN_INFO "i8259 legacy interrupt controller initialized\n"); } diff --git a/trunk/arch/powerpc/sysdev/mpic.c b/trunk/arch/powerpc/sysdev/mpic.c index 7d31d7cc392d..28df9c827ca6 100644 --- a/trunk/arch/powerpc/sysdev/mpic.c +++ b/trunk/arch/powerpc/sysdev/mpic.c @@ -17,6 +17,7 @@ #undef DEBUG_IRQ #undef DEBUG_LOW +#include #include #include #include @@ -100,8 +101,8 @@ static inline u32 _mpic_cpu_read(struct mpic *mpic, unsigned int reg) if (mpic->flags & MPIC_PRIMARY) cpu = hard_smp_processor_id(); - return _mpic_read(mpic->flags & MPIC_BIG_ENDIAN, - mpic->cpuregs[cpu], reg); + + return _mpic_read(mpic->flags & MPIC_BIG_ENDIAN, mpic->cpuregs[cpu], reg); } static inline void _mpic_cpu_write(struct mpic *mpic, unsigned int reg, u32 value) @@ -340,19 +341,27 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic) #endif /* CONFIG_MPIC_BROKEN_U3 */ -#define mpic_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) - /* Find an mpic associated with a given linux interrupt */ static struct mpic *mpic_find(unsigned int irq, unsigned int *is_ipi) { - unsigned int src = mpic_irq_to_hw(irq); - - if (irq < NUM_ISA_INTERRUPTS) - return NULL; - if (is_ipi) - *is_ipi = (src >= MPIC_VEC_IPI_0 && src <= MPIC_VEC_IPI_3); - - return irq_desc[irq].chip_data; + struct mpic *mpic = mpics; + + while(mpic) { + /* search IPIs first since they may override the main interrupts */ + if (irq >= mpic->ipi_offset && irq < (mpic->ipi_offset + 4)) { + if (is_ipi) + *is_ipi = 1; + return mpic; + } + if (irq >= mpic->irq_offset && + irq < (mpic->irq_offset + mpic->irq_count)) { + if (is_ipi) + *is_ipi = 0; + return mpic; + } + mpic = mpic -> next; + } + return NULL; } /* Convert a cpu mask from logical to physical cpu numbers. */ @@ -370,14 +379,14 @@ static inline u32 mpic_physmask(u32 cpumask) /* Get the mpic structure from the IPI number */ static inline struct mpic * mpic_from_ipi(unsigned int ipi) { - return irq_desc[ipi].chip_data; + return container_of(irq_desc[ipi].chip, struct mpic, hc_ipi); } #endif /* Get the mpic structure from the irq number */ static inline struct mpic * mpic_from_irq(unsigned int irq) { - return irq_desc[irq].chip_data; + return container_of(irq_desc[irq].chip, struct mpic, hc_irq); } /* Send an EOI */ @@ -390,7 +399,9 @@ static inline void mpic_eoi(struct mpic *mpic) #ifdef CONFIG_SMP static irqreturn_t mpic_ipi_action(int irq, void *dev_id, struct pt_regs *regs) { - smp_message_recv(mpic_irq_to_hw(irq) - MPIC_VEC_IPI_0, regs); + struct mpic *mpic = dev_id; + + smp_message_recv(irq - mpic->ipi_offset, regs); return IRQ_HANDLED; } #endif /* CONFIG_SMP */ @@ -400,11 +411,11 @@ static irqreturn_t mpic_ipi_action(int irq, void *dev_id, struct pt_regs *regs) */ -static void mpic_unmask_irq(unsigned int irq) +static void mpic_enable_irq(unsigned int irq) { unsigned int loops = 100000; struct mpic *mpic = mpic_from_irq(irq); - unsigned int src = mpic_irq_to_hw(irq); + unsigned int src = irq - mpic->irq_offset; DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src); @@ -419,13 +430,39 @@ static void mpic_unmask_irq(unsigned int irq) break; } } while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK); + +#ifdef CONFIG_MPIC_BROKEN_U3 + if (mpic->flags & MPIC_BROKEN_U3) { + unsigned int src = irq - mpic->irq_offset; + if (mpic_is_ht_interrupt(mpic, src) && + (irq_desc[irq].status & IRQ_LEVEL)) + mpic_ht_end_irq(mpic, src); + } +#endif /* CONFIG_MPIC_BROKEN_U3 */ +} + +static unsigned int mpic_startup_irq(unsigned int irq) +{ +#ifdef CONFIG_MPIC_BROKEN_U3 + struct mpic *mpic = mpic_from_irq(irq); + unsigned int src = irq - mpic->irq_offset; +#endif /* CONFIG_MPIC_BROKEN_U3 */ + + mpic_enable_irq(irq); + +#ifdef CONFIG_MPIC_BROKEN_U3 + if (mpic_is_ht_interrupt(mpic, src)) + mpic_startup_ht_interrupt(mpic, src, irq_desc[irq].status); +#endif /* CONFIG_MPIC_BROKEN_U3 */ + + return 0; } -static void mpic_mask_irq(unsigned int irq) +static void mpic_disable_irq(unsigned int irq) { unsigned int loops = 100000; struct mpic *mpic = mpic_from_irq(irq); - unsigned int src = mpic_irq_to_hw(irq); + unsigned int src = irq - mpic->irq_offset; DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src); @@ -442,58 +479,23 @@ static void mpic_mask_irq(unsigned int irq) } while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK)); } -static void mpic_end_irq(unsigned int irq) +static void mpic_shutdown_irq(unsigned int irq) { - struct mpic *mpic = mpic_from_irq(irq); - -#ifdef DEBUG_IRQ - DBG("%s: end_irq: %d\n", mpic->name, irq); -#endif - /* We always EOI on end_irq() even for edge interrupts since that - * should only lower the priority, the MPIC should have properly - * latched another edge interrupt coming in anyway - */ - - mpic_eoi(mpic); -} - #ifdef CONFIG_MPIC_BROKEN_U3 - -static void mpic_unmask_ht_irq(unsigned int irq) -{ - struct mpic *mpic = mpic_from_irq(irq); - unsigned int src = mpic_irq_to_hw(irq); - - mpic_unmask_irq(irq); - - if (irq_desc[irq].status & IRQ_LEVEL) - mpic_ht_end_irq(mpic, src); -} - -static unsigned int mpic_startup_ht_irq(unsigned int irq) -{ struct mpic *mpic = mpic_from_irq(irq); - unsigned int src = mpic_irq_to_hw(irq); + unsigned int src = irq - mpic->irq_offset; - mpic_unmask_irq(irq); - mpic_startup_ht_interrupt(mpic, src, irq_desc[irq].status); + if (mpic_is_ht_interrupt(mpic, src)) + mpic_shutdown_ht_interrupt(mpic, src, irq_desc[irq].status); - return 0; -} - -static void mpic_shutdown_ht_irq(unsigned int irq) -{ - struct mpic *mpic = mpic_from_irq(irq); - unsigned int src = mpic_irq_to_hw(irq); +#endif /* CONFIG_MPIC_BROKEN_U3 */ - mpic_shutdown_ht_interrupt(mpic, src, irq_desc[irq].status); - mpic_mask_irq(irq); + mpic_disable_irq(irq); } -static void mpic_end_ht_irq(unsigned int irq) +static void mpic_end_irq(unsigned int irq) { struct mpic *mpic = mpic_from_irq(irq); - unsigned int src = mpic_irq_to_hw(irq); #ifdef DEBUG_IRQ DBG("%s: end_irq: %d\n", mpic->name, irq); @@ -503,25 +505,30 @@ static void mpic_end_ht_irq(unsigned int irq) * latched another edge interrupt coming in anyway */ - if (irq_desc[irq].status & IRQ_LEVEL) - mpic_ht_end_irq(mpic, src); +#ifdef CONFIG_MPIC_BROKEN_U3 + if (mpic->flags & MPIC_BROKEN_U3) { + unsigned int src = irq - mpic->irq_offset; + if (mpic_is_ht_interrupt(mpic, src) && + (irq_desc[irq].status & IRQ_LEVEL)) + mpic_ht_end_irq(mpic, src); + } +#endif /* CONFIG_MPIC_BROKEN_U3 */ + mpic_eoi(mpic); } -#endif /* CONFIG_MPIC_BROKEN_U3 */ - #ifdef CONFIG_SMP -static void mpic_unmask_ipi(unsigned int irq) +static void mpic_enable_ipi(unsigned int irq) { struct mpic *mpic = mpic_from_ipi(irq); - unsigned int src = mpic_irq_to_hw(irq) - MPIC_VEC_IPI_0; + unsigned int src = irq - mpic->ipi_offset; DBG("%s: enable_ipi: %d (ipi %d)\n", mpic->name, irq, src); mpic_ipi_write(src, mpic_ipi_read(src) & ~MPIC_VECPRI_MASK); } -static void mpic_mask_ipi(unsigned int irq) +static void mpic_disable_ipi(unsigned int irq) { /* NEVER disable an IPI... that's just plain wrong! */ } @@ -534,7 +541,7 @@ static void mpic_end_ipi(unsigned int irq) * IPIs are marked IRQ_PER_CPU. This has the side effect of * preventing the IRQ_PENDING/IRQ_INPROGRESS logic from * applying to them. We EOI them late to avoid re-entering. - * We mark IPI's with IRQF_DISABLED as they must run with + * We mark IPI's with SA_INTERRUPT as they must run with * irqs disabled. */ mpic_eoi(mpic); @@ -545,176 +552,29 @@ static void mpic_end_ipi(unsigned int irq) static void mpic_set_affinity(unsigned int irq, cpumask_t cpumask) { struct mpic *mpic = mpic_from_irq(irq); - unsigned int src = mpic_irq_to_hw(irq); cpumask_t tmp; cpus_and(tmp, cpumask, cpu_online_map); - mpic_irq_write(src, MPIC_IRQ_DESTINATION, + mpic_irq_write(irq - mpic->irq_offset, MPIC_IRQ_DESTINATION, mpic_physmask(cpus_addr(tmp)[0])); } -static unsigned int mpic_flags_to_vecpri(unsigned int flags, int *level) -{ - unsigned int vecpri; - - /* Now convert sense value */ - switch(flags & IRQ_TYPE_SENSE_MASK) { - case IRQ_TYPE_EDGE_RISING: - vecpri = MPIC_VECPRI_SENSE_EDGE | - MPIC_VECPRI_POLARITY_POSITIVE; - *level = 0; - break; - case IRQ_TYPE_EDGE_FALLING: - vecpri = MPIC_VECPRI_SENSE_EDGE | - MPIC_VECPRI_POLARITY_NEGATIVE; - *level = 0; - break; - case IRQ_TYPE_LEVEL_HIGH: - vecpri = MPIC_VECPRI_SENSE_LEVEL | - MPIC_VECPRI_POLARITY_POSITIVE; - *level = 1; - break; - case IRQ_TYPE_LEVEL_LOW: - default: - vecpri = MPIC_VECPRI_SENSE_LEVEL | - MPIC_VECPRI_POLARITY_NEGATIVE; - *level = 1; - } - return vecpri; -} - -static struct irq_chip mpic_irq_chip = { - .mask = mpic_mask_irq, - .unmask = mpic_unmask_irq, - .eoi = mpic_end_irq, -}; - -#ifdef CONFIG_SMP -static struct irq_chip mpic_ipi_chip = { - .mask = mpic_mask_ipi, - .unmask = mpic_unmask_ipi, - .eoi = mpic_end_ipi, -}; -#endif /* CONFIG_SMP */ - -#ifdef CONFIG_MPIC_BROKEN_U3 -static struct irq_chip mpic_irq_ht_chip = { - .startup = mpic_startup_ht_irq, - .shutdown = mpic_shutdown_ht_irq, - .mask = mpic_mask_irq, - .unmask = mpic_unmask_ht_irq, - .eoi = mpic_end_ht_irq, -}; -#endif /* CONFIG_MPIC_BROKEN_U3 */ - - -static int mpic_host_match(struct irq_host *h, struct device_node *node) -{ - struct mpic *mpic = h->host_data; - - /* Exact match, unless mpic node is NULL */ - return mpic->of_node == NULL || mpic->of_node == node; -} - -static int mpic_host_map(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw, unsigned int flags) -{ - struct irq_desc *desc = get_irq_desc(virq); - struct irq_chip *chip; - struct mpic *mpic = h->host_data; - unsigned int vecpri = MPIC_VECPRI_SENSE_LEVEL | - MPIC_VECPRI_POLARITY_NEGATIVE; - int level; - - pr_debug("mpic: map virq %d, hwirq 0x%lx, flags: 0x%x\n", - virq, hw, flags); - - if (hw == MPIC_VEC_SPURRIOUS) - return -EINVAL; -#ifdef CONFIG_SMP - else if (hw >= MPIC_VEC_IPI_0) { - WARN_ON(!(mpic->flags & MPIC_PRIMARY)); - - pr_debug("mpic: mapping as IPI\n"); - set_irq_chip_data(virq, mpic); - set_irq_chip_and_handler(virq, &mpic->hc_ipi, - handle_percpu_irq); - return 0; - } -#endif /* CONFIG_SMP */ - - if (hw >= mpic->irq_count) - return -EINVAL; - - /* If no sense provided, check default sense array */ - if (((flags & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_NONE) && - mpic->senses && hw < mpic->senses_count) - flags |= mpic->senses[hw]; - - vecpri = mpic_flags_to_vecpri(flags, &level); - if (level) - desc->status |= IRQ_LEVEL; - chip = &mpic->hc_irq; - -#ifdef CONFIG_MPIC_BROKEN_U3 - /* Check for HT interrupts, override vecpri */ - if (mpic_is_ht_interrupt(mpic, hw)) { - vecpri &= ~(MPIC_VECPRI_SENSE_MASK | - MPIC_VECPRI_POLARITY_MASK); - vecpri |= MPIC_VECPRI_POLARITY_POSITIVE; - chip = &mpic->hc_ht_irq; - } -#endif - - /* Reconfigure irq */ - vecpri |= MPIC_VECPRI_MASK | hw | (8 << MPIC_VECPRI_PRIORITY_SHIFT); - mpic_irq_write(hw, MPIC_IRQ_VECTOR_PRI, vecpri); - - pr_debug("mpic: mapping as IRQ\n"); - - set_irq_chip_data(virq, mpic); - set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq); - return 0; -} - -static int mpic_host_xlate(struct irq_host *h, struct device_node *ct, - u32 *intspec, unsigned int intsize, - irq_hw_number_t *out_hwirq, unsigned int *out_flags) - -{ - static unsigned char map_mpic_senses[4] = { - IRQ_TYPE_EDGE_RISING, - IRQ_TYPE_LEVEL_LOW, - IRQ_TYPE_LEVEL_HIGH, - IRQ_TYPE_EDGE_FALLING, - }; - - *out_hwirq = intspec[0]; - if (intsize > 1 && intspec[1] < 4) - *out_flags = map_mpic_senses[intspec[1]]; - else - *out_flags = IRQ_TYPE_NONE; - - return 0; -} - -static struct irq_host_ops mpic_host_ops = { - .match = mpic_host_match, - .map = mpic_host_map, - .xlate = mpic_host_xlate, -}; /* * Exported functions */ -struct mpic * __init mpic_alloc(struct device_node *node, - unsigned long phys_addr, + +struct mpic * __init mpic_alloc(unsigned long phys_addr, unsigned int flags, unsigned int isu_size, + unsigned int irq_offset, unsigned int irq_count, + unsigned int ipi_offset, + unsigned char *senses, + unsigned int senses_count, const char *name) { struct mpic *mpic; @@ -726,38 +586,33 @@ struct mpic * __init mpic_alloc(struct device_node *node, if (mpic == NULL) return NULL; + memset(mpic, 0, sizeof(struct mpic)); mpic->name = name; - mpic->of_node = node ? of_node_get(node) : NULL; - mpic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 256, - &mpic_host_ops, - MPIC_VEC_SPURRIOUS); - if (mpic->irqhost == NULL) { - of_node_put(node); - return NULL; - } - - mpic->irqhost->host_data = mpic; - mpic->hc_irq = mpic_irq_chip; mpic->hc_irq.typename = name; + mpic->hc_irq.startup = mpic_startup_irq; + mpic->hc_irq.shutdown = mpic_shutdown_irq; + mpic->hc_irq.enable = mpic_enable_irq; + mpic->hc_irq.disable = mpic_disable_irq; + mpic->hc_irq.end = mpic_end_irq; if (flags & MPIC_PRIMARY) mpic->hc_irq.set_affinity = mpic_set_affinity; -#ifdef CONFIG_MPIC_BROKEN_U3 - mpic->hc_ht_irq = mpic_irq_ht_chip; - mpic->hc_ht_irq.typename = name; - if (flags & MPIC_PRIMARY) - mpic->hc_ht_irq.set_affinity = mpic_set_affinity; -#endif /* CONFIG_MPIC_BROKEN_U3 */ #ifdef CONFIG_SMP - mpic->hc_ipi = mpic_ipi_chip; mpic->hc_ipi.typename = name; + mpic->hc_ipi.enable = mpic_enable_ipi; + mpic->hc_ipi.disable = mpic_disable_ipi; + mpic->hc_ipi.end = mpic_end_ipi; #endif /* CONFIG_SMP */ mpic->flags = flags; mpic->isu_size = isu_size; + mpic->irq_offset = irq_offset; mpic->irq_count = irq_count; + mpic->ipi_offset = ipi_offset; mpic->num_sources = 0; /* so far */ + mpic->senses = senses; + mpic->senses_count = senses_count; /* Map the global registers */ mpic->gregs = ioremap(phys_addr + MPIC_GREG_BASE, 0x1000); @@ -825,10 +680,8 @@ struct mpic * __init mpic_alloc(struct device_node *node, mpic->next = mpics; mpics = mpic; - if (flags & MPIC_PRIMARY) { + if (flags & MPIC_PRIMARY) mpic_primary = mpic; - irq_set_default_host(mpic->irqhost); - } return mpic; } @@ -845,10 +698,26 @@ void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, mpic->num_sources = isu_first + mpic->isu_size; } -void __init mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count) +void __init mpic_setup_cascade(unsigned int irq, mpic_cascade_t handler, + void *data) { - mpic->senses = senses; - mpic->senses_count = count; + struct mpic *mpic = mpic_find(irq, NULL); + unsigned long flags; + + /* Synchronization here is a bit dodgy, so don't try to replace cascade + * interrupts on the fly too often ... but normally it's set up at boot. + */ + spin_lock_irqsave(&mpic_lock, flags); + if (mpic->cascade) + mpic_disable_irq(mpic->cascade_vec + mpic->irq_offset); + mpic->cascade = NULL; + wmb(); + mpic->cascade_vec = irq - mpic->irq_offset; + mpic->cascade_data = data; + wmb(); + mpic->cascade = handler; + mpic_enable_irq(irq); + spin_unlock_irqrestore(&mpic_lock, flags); } void __init mpic_init(struct mpic *mpic) @@ -856,11 +725,6 @@ void __init mpic_init(struct mpic *mpic) int i; BUG_ON(mpic->num_sources == 0); - WARN_ON(mpic->num_sources > MPIC_VEC_IPI_0); - - /* Sanitize source count */ - if (mpic->num_sources > MPIC_VEC_IPI_0) - mpic->num_sources = MPIC_VEC_IPI_0; printk(KERN_INFO "mpic: Initializing for %d sources\n", mpic->num_sources); @@ -884,6 +748,12 @@ void __init mpic_init(struct mpic *mpic) MPIC_VECPRI_MASK | (10 << MPIC_VECPRI_PRIORITY_SHIFT) | (MPIC_VEC_IPI_0 + i)); +#ifdef CONFIG_SMP + if (!(mpic->flags & MPIC_PRIMARY)) + continue; + irq_desc[mpic->ipi_offset+i].status |= IRQ_PER_CPU; + irq_desc[mpic->ipi_offset+i].chip = &mpic->hc_ipi; +#endif /* CONFIG_SMP */ } /* Initialize interrupt sources */ @@ -894,21 +764,31 @@ void __init mpic_init(struct mpic *mpic) /* Do the HT PIC fixups on U3 broken mpic */ DBG("MPIC flags: %x\n", mpic->flags); if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY)) - mpic_scan_ht_pics(mpic); + mpic_scan_ht_pics(mpic); #endif /* CONFIG_MPIC_BROKEN_U3 */ for (i = 0; i < mpic->num_sources; i++) { /* start with vector = source number, and masked */ u32 vecpri = MPIC_VECPRI_MASK | i | (8 << MPIC_VECPRI_PRIORITY_SHIFT); - int level = 1; + int level = 0; + /* if it's an IPI, we skip it */ + if ((mpic->irq_offset + i) >= (mpic->ipi_offset + i) && + (mpic->irq_offset + i) < (mpic->ipi_offset + i + 4)) + continue; + /* do senses munging */ - if (mpic->senses && i < mpic->senses_count) - vecpri = mpic_flags_to_vecpri(mpic->senses[i], - &level); - else + if (mpic->senses && i < mpic->senses_count) { + if (mpic->senses[i] & IRQ_SENSE_LEVEL) + vecpri |= MPIC_VECPRI_SENSE_LEVEL; + if (mpic->senses[i] & IRQ_POLARITY_POSITIVE) + vecpri |= MPIC_VECPRI_POLARITY_POSITIVE; + } else vecpri |= MPIC_VECPRI_SENSE_LEVEL; + /* remember if it was a level interrupts */ + level = (vecpri & MPIC_VECPRI_SENSE_LEVEL); + /* deal with broken U3 */ if (mpic->flags & MPIC_BROKEN_U3) { #ifdef CONFIG_MPIC_BROKEN_U3 @@ -929,6 +809,12 @@ void __init mpic_init(struct mpic *mpic) mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri); mpic_irq_write(i, MPIC_IRQ_DESTINATION, 1 << hard_smp_processor_id()); + + /* init linux descriptors */ + if (i < mpic->irq_count) { + irq_desc[mpic->irq_offset+i].status = level ? IRQ_LEVEL : 0; + irq_desc[mpic->irq_offset+i].chip = &mpic->hc_irq; + } } /* Init spurrious vector */ @@ -969,20 +855,19 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri) { int is_ipi; struct mpic *mpic = mpic_find(irq, &is_ipi); - unsigned int src = mpic_irq_to_hw(irq); unsigned long flags; u32 reg; spin_lock_irqsave(&mpic_lock, flags); if (is_ipi) { - reg = mpic_ipi_read(src - MPIC_VEC_IPI_0) & + reg = mpic_ipi_read(irq - mpic->ipi_offset) & ~MPIC_VECPRI_PRIORITY_MASK; - mpic_ipi_write(src - MPIC_VEC_IPI_0, + mpic_ipi_write(irq - mpic->ipi_offset, reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); } else { - reg = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) + reg = mpic_irq_read(irq - mpic->irq_offset,MPIC_IRQ_VECTOR_PRI) & ~MPIC_VECPRI_PRIORITY_MASK; - mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, + mpic_irq_write(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI, reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); } spin_unlock_irqrestore(&mpic_lock, flags); @@ -992,15 +877,14 @@ unsigned int mpic_irq_get_priority(unsigned int irq) { int is_ipi; struct mpic *mpic = mpic_find(irq, &is_ipi); - unsigned int src = mpic_irq_to_hw(irq); unsigned long flags; u32 reg; spin_lock_irqsave(&mpic_lock, flags); if (is_ipi) - reg = mpic_ipi_read(src = MPIC_VEC_IPI_0); + reg = mpic_ipi_read(irq - mpic->ipi_offset); else - reg = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI); + reg = mpic_irq_read(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI); spin_unlock_irqrestore(&mpic_lock, flags); return (reg & MPIC_VECPRI_PRIORITY_MASK) >> MPIC_VECPRI_PRIORITY_SHIFT; } @@ -1095,20 +979,37 @@ void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask) mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0])); } -unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs) +int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs) { - u32 src; + u32 irq; - src = mpic_cpu_read(MPIC_CPU_INTACK) & MPIC_VECPRI_VECTOR_MASK; + irq = mpic_cpu_read(MPIC_CPU_INTACK) & MPIC_VECPRI_VECTOR_MASK; +#ifdef DEBUG_LOW + DBG("%s: get_one_irq(): %d\n", mpic->name, irq); +#endif + if (mpic->cascade && irq == mpic->cascade_vec) { #ifdef DEBUG_LOW - DBG("%s: get_one_irq(): %d\n", mpic->name, src); + DBG("%s: cascading ...\n", mpic->name); +#endif + irq = mpic->cascade(regs, mpic->cascade_data); + mpic_eoi(mpic); + return irq; + } + if (unlikely(irq == MPIC_VEC_SPURRIOUS)) + return -1; + if (irq < MPIC_VEC_IPI_0) { +#ifdef DEBUG_IRQ + DBG("%s: irq %d\n", mpic->name, irq + mpic->irq_offset); +#endif + return irq + mpic->irq_offset; + } +#ifdef DEBUG_IPI + DBG("%s: ipi %d !\n", mpic->name, irq - MPIC_VEC_IPI_0); #endif - if (unlikely(src == MPIC_VEC_SPURRIOUS)) - return NO_IRQ; - return irq_linear_revmap(mpic->irqhost, src); + return irq - MPIC_VEC_IPI_0 + mpic->ipi_offset; } -unsigned int mpic_get_irq(struct pt_regs *regs) +int mpic_get_irq(struct pt_regs *regs) { struct mpic *mpic = mpic_primary; @@ -1122,27 +1023,22 @@ unsigned int mpic_get_irq(struct pt_regs *regs) void mpic_request_ipis(void) { struct mpic *mpic = mpic_primary; - int i; - static char *ipi_names[] = { - "IPI0 (call function)", - "IPI1 (reschedule)", - "IPI2 (unused)", - "IPI3 (debugger break)", - }; - BUG_ON(mpic == NULL); - - printk(KERN_INFO "mpic: requesting IPIs ... \n"); - for (i = 0; i < 4; i++) { - unsigned int vipi = irq_create_mapping(mpic->irqhost, - MPIC_VEC_IPI_0 + i, 0); - if (vipi == NO_IRQ) { - printk(KERN_ERR "Failed to map IPI %d\n", i); - break; - } - request_irq(vipi, mpic_ipi_action, IRQF_DISABLED, - ipi_names[i], mpic); - } + BUG_ON(mpic == NULL); + + printk("requesting IPIs ... \n"); + + /* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */ + request_irq(mpic->ipi_offset+0, mpic_ipi_action, SA_INTERRUPT, + "IPI0 (call function)", mpic); + request_irq(mpic->ipi_offset+1, mpic_ipi_action, SA_INTERRUPT, + "IPI1 (reschedule)", mpic); + request_irq(mpic->ipi_offset+2, mpic_ipi_action, SA_INTERRUPT, + "IPI2 (unused)", mpic); + request_irq(mpic->ipi_offset+3, mpic_ipi_action, SA_INTERRUPT, + "IPI3 (debugger break)", mpic); + + printk("IPIs requested... \n"); } void smp_mpic_message_pass(int target, int msg) diff --git a/trunk/arch/powerpc/xmon/xmon.c b/trunk/arch/powerpc/xmon/xmon.c index 179b10ced8c7..0741df8c41b7 100644 --- a/trunk/arch/powerpc/xmon/xmon.c +++ b/trunk/arch/powerpc/xmon/xmon.c @@ -8,6 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/4xx_io/serial_sicc.c b/trunk/arch/ppc/4xx_io/serial_sicc.c index b81a367dc278..1e113d0f59b8 100644 --- a/trunk/arch/ppc/4xx_io/serial_sicc.c +++ b/trunk/arch/ppc/4xx_io/serial_sicc.c @@ -28,6 +28,7 @@ * is compatible with normal ttyS* devices. */ +#include #include #include #include diff --git a/trunk/arch/ppc/8260_io/fcc_enet.c b/trunk/arch/ppc/8260_io/fcc_enet.c index e347fe88316d..4edeede9ccfd 100644 --- a/trunk/arch/ppc/8260_io/fcc_enet.c +++ b/trunk/arch/ppc/8260_io/fcc_enet.c @@ -21,6 +21,7 @@ * */ +#include #include #include #include @@ -2116,7 +2117,7 @@ init_fcc_startup(fcc_info_t *fip, struct net_device *dev) #ifdef PHY_INTERRUPT #ifdef CONFIG_ADS8272 - if (request_irq(PHY_INTERRUPT, mii_link_interrupt, IRQF_SHARED, + if (request_irq(PHY_INTERRUPT, mii_link_interrupt, SA_SHIRQ, "mii", dev) < 0) printk(KERN_CRIT "Can't get MII IRQ %d\n", PHY_INTERRUPT); #else diff --git a/trunk/arch/ppc/8xx_io/cs4218.h b/trunk/arch/ppc/8xx_io/cs4218.h index e5f943045afa..f1c7392255f8 100644 --- a/trunk/arch/ppc/8xx_io/cs4218.h +++ b/trunk/arch/ppc/8xx_io/cs4218.h @@ -13,6 +13,7 @@ #define _cs4218_h_ #include +#include #define SND_NDEVS 256 /* Number of supported devices */ #define SND_DEV_CTL 0 /* Control port /dev/mixer */ diff --git a/trunk/arch/ppc/8xx_io/cs4218_tdm.c b/trunk/arch/ppc/8xx_io/cs4218_tdm.c index f5f300fc213d..a892356d5c3b 100644 --- a/trunk/arch/ppc/8xx_io/cs4218_tdm.c +++ b/trunk/arch/ppc/8xx_io/cs4218_tdm.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/ppc/8xx_io/enet.c b/trunk/arch/ppc/8xx_io/enet.c index a695375c3e4c..ece6a9fbe09b 100644 --- a/trunk/arch/ppc/8xx_io/enet.c +++ b/trunk/arch/ppc/8xx_io/enet.c @@ -22,6 +22,7 @@ * small packets. * */ +#include #include #include #include diff --git a/trunk/arch/ppc/8xx_io/fec.c b/trunk/arch/ppc/8xx_io/fec.c index 8b6295bbb564..62f68d6181c6 100644 --- a/trunk/arch/ppc/8xx_io/fec.c +++ b/trunk/arch/ppc/8xx_io/fec.c @@ -28,6 +28,7 @@ * Thomas Lange, thomas@corelatus.com */ +#include #include #include #include diff --git a/trunk/arch/ppc/8xx_io/micropatch.c b/trunk/arch/ppc/8xx_io/micropatch.c index cfad46ba17e3..312af0776c31 100644 --- a/trunk/arch/ppc/8xx_io/micropatch.c +++ b/trunk/arch/ppc/8xx_io/micropatch.c @@ -4,6 +4,7 @@ * also relocates SMC2, but this would require additional changes * to uart.c, so I am holding off on that for a moment. */ +#include #include #include #include diff --git a/trunk/arch/ppc/amiga/amiints.c b/trunk/arch/ppc/amiga/amiints.c index 265fcd3c6ab2..b2bba052ab93 100644 --- a/trunk/arch/ppc/amiga/amiints.c +++ b/trunk/arch/ppc/amiga/amiints.c @@ -35,6 +35,7 @@ * /Jes */ +#include #include #include #include diff --git a/trunk/arch/ppc/amiga/config.c b/trunk/arch/ppc/amiga/config.c index bc50ed11957d..bbe47c9bd707 100644 --- a/trunk/arch/ppc/amiga/config.c +++ b/trunk/arch/ppc/amiga/config.c @@ -12,6 +12,7 @@ * Miscellaneous Amiga stuff */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/common/crt0.S b/trunk/arch/ppc/boot/common/crt0.S index 8f0ef04b8de5..4d31b824bbd1 100644 --- a/trunk/arch/ppc/boot/common/crt0.S +++ b/trunk/arch/ppc/boot/common/crt0.S @@ -18,6 +18,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include .text diff --git a/trunk/arch/ppc/boot/common/misc-common.c b/trunk/arch/ppc/boot/common/misc-common.c index 8e1fccd96fc0..073830a8559a 100644 --- a/trunk/arch/ppc/boot/common/misc-common.c +++ b/trunk/arch/ppc/boot/common/misc-common.c @@ -13,6 +13,7 @@ */ #include /* for va_ bits */ +#include #include #include #include "nonstdio.h" diff --git a/trunk/arch/ppc/boot/common/ns16550.c b/trunk/arch/ppc/boot/common/ns16550.c index fc5b72041948..4f00c93ac870 100644 --- a/trunk/arch/ppc/boot/common/ns16550.c +++ b/trunk/arch/ppc/boot/common/ns16550.c @@ -2,6 +2,7 @@ * COM1 NS16550 support */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/embed_config.c b/trunk/arch/ppc/boot/simple/embed_config.c index 840bff2a45fb..3a51b1062940 100644 --- a/trunk/arch/ppc/boot/simple/embed_config.c +++ b/trunk/arch/ppc/boot/simple/embed_config.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #ifdef CONFIG_8xx diff --git a/trunk/arch/ppc/boot/simple/head.S b/trunk/arch/ppc/boot/simple/head.S index 1b4d7b1d4ec1..160da1006ff8 100644 --- a/trunk/arch/ppc/boot/simple/head.S +++ b/trunk/arch/ppc/boot/simple/head.S @@ -11,6 +11,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/m8xx_tty.c b/trunk/arch/ppc/boot/simple/m8xx_tty.c index cacc40fdbcfa..1d2778e248c6 100644 --- a/trunk/arch/ppc/boot/simple/m8xx_tty.c +++ b/trunk/arch/ppc/boot/simple/m8xx_tty.c @@ -8,6 +8,7 @@ * use COM1 instead of SMC1 as the console port. This kinda sucks * for the rest of the kernel, so here we force the use of SMC1 again. */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/misc-chestnut.c b/trunk/arch/ppc/boot/simple/misc-chestnut.c index 14a4b56d4f84..b94e142ad892 100644 --- a/trunk/arch/ppc/boot/simple/misc-chestnut.c +++ b/trunk/arch/ppc/boot/simple/misc-chestnut.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/misc-embedded.c b/trunk/arch/ppc/boot/simple/misc-embedded.c index 10219eeca054..3865f3f8dcd1 100644 --- a/trunk/arch/ppc/boot/simple/misc-embedded.c +++ b/trunk/arch/ppc/boot/simple/misc-embedded.c @@ -6,6 +6,7 @@ * Currently maintained by: Tom Rini */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/misc-ev64260.c b/trunk/arch/ppc/boot/simple/misc-ev64260.c index 0b3978632aca..2678c224af22 100644 --- a/trunk/arch/ppc/boot/simple/misc-ev64260.c +++ b/trunk/arch/ppc/boot/simple/misc-ev64260.c @@ -10,6 +10,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/misc-ev64360.c b/trunk/arch/ppc/boot/simple/misc-ev64360.c index 96eaebb78df5..a212b5b988cb 100644 --- a/trunk/arch/ppc/boot/simple/misc-ev64360.c +++ b/trunk/arch/ppc/boot/simple/misc-ev64360.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/misc-katana.c b/trunk/arch/ppc/boot/simple/misc-katana.c index 79a1bbcbc6c5..d97f2ee6f04e 100644 --- a/trunk/arch/ppc/boot/simple/misc-katana.c +++ b/trunk/arch/ppc/boot/simple/misc-katana.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/misc-mv64x60.c b/trunk/arch/ppc/boot/simple/misc-mv64x60.c index 28b3108083ed..71ff20fd494a 100644 --- a/trunk/arch/ppc/boot/simple/misc-mv64x60.c +++ b/trunk/arch/ppc/boot/simple/misc-mv64x60.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/misc-prep.c b/trunk/arch/ppc/boot/simple/misc-prep.c index 0086e1cfb48c..63def9d13d70 100644 --- a/trunk/arch/ppc/boot/simple/misc-prep.c +++ b/trunk/arch/ppc/boot/simple/misc-prep.c @@ -4,6 +4,7 @@ * In the past: Gary Thomas, Cort Dougan */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/misc-spruce.c b/trunk/arch/ppc/boot/simple/misc-spruce.c index 5b3a6c6f113b..0cad2f557a1e 100644 --- a/trunk/arch/ppc/boot/simple/misc-spruce.c +++ b/trunk/arch/ppc/boot/simple/misc-spruce.c @@ -13,6 +13,7 @@ */ #include +#include #include #include diff --git a/trunk/arch/ppc/boot/simple/misc.c b/trunk/arch/ppc/boot/simple/misc.c index a5df08963695..3d78571ad945 100644 --- a/trunk/arch/ppc/boot/simple/misc.c +++ b/trunk/arch/ppc/boot/simple/misc.c @@ -15,6 +15,7 @@ */ #include +#include #include #include diff --git a/trunk/arch/ppc/boot/simple/mpc52xx_tty.c b/trunk/arch/ppc/boot/simple/mpc52xx_tty.c index 7b5924cc3c02..1964493cf3bd 100644 --- a/trunk/arch/ppc/boot/simple/mpc52xx_tty.c +++ b/trunk/arch/ppc/boot/simple/mpc52xx_tty.c @@ -9,6 +9,7 @@ * "as is" without any warranty of any kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/mv64x60_tty.c b/trunk/arch/ppc/boot/simple/mv64x60_tty.c index 781e040a97d1..0c52f5c784a2 100644 --- a/trunk/arch/ppc/boot/simple/mv64x60_tty.c +++ b/trunk/arch/ppc/boot/simple/mv64x60_tty.c @@ -12,6 +12,7 @@ /* This code assumes that the data cache has been disabled (L1, L2, L3). */ +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/openbios.c b/trunk/arch/ppc/boot/simple/openbios.c index 6ff2701598f2..3f2ed53f793a 100644 --- a/trunk/arch/ppc/boot/simple/openbios.c +++ b/trunk/arch/ppc/boot/simple/openbios.c @@ -12,6 +12,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/pibs.c b/trunk/arch/ppc/boot/simple/pibs.c index f39d01e0619d..67222d57c345 100644 --- a/trunk/arch/ppc/boot/simple/pibs.c +++ b/trunk/arch/ppc/boot/simple/pibs.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/ppc/boot/simple/relocate.S b/trunk/arch/ppc/boot/simple/relocate.S index 0c021556d78e..2533113c1cc5 100644 --- a/trunk/arch/ppc/boot/simple/relocate.S +++ b/trunk/arch/ppc/boot/simple/relocate.S @@ -13,6 +13,7 @@ * or implied. */ +#include #include #include diff --git a/trunk/arch/ppc/kernel/asm-offsets.c b/trunk/arch/ppc/kernel/asm-offsets.c index 1f91eca2f3d7..2f5c5e157617 100644 --- a/trunk/arch/ppc/kernel/asm-offsets.c +++ b/trunk/arch/ppc/kernel/asm-offsets.c @@ -8,6 +8,7 @@ * #defines from the assembly-language output. */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/cpu_setup_power4.S b/trunk/arch/ppc/kernel/cpu_setup_power4.S index 6a674e834eeb..d7bfd60e21fc 100644 --- a/trunk/arch/ppc/kernel/cpu_setup_power4.S +++ b/trunk/arch/ppc/kernel/cpu_setup_power4.S @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/dma-mapping.c b/trunk/arch/ppc/kernel/dma-mapping.c index 10fec7363962..61465ec88bc7 100644 --- a/trunk/arch/ppc/kernel/dma-mapping.c +++ b/trunk/arch/ppc/kernel/dma-mapping.c @@ -22,6 +22,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/entry.S b/trunk/arch/ppc/kernel/entry.S index a9d455369dc6..1adc9145516f 100644 --- a/trunk/arch/ppc/kernel/entry.S +++ b/trunk/arch/ppc/kernel/entry.S @@ -19,6 +19,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/head.S b/trunk/arch/ppc/kernel/head.S index 100052aaea9a..01303efeddad 100644 --- a/trunk/arch/ppc/kernel/head.S +++ b/trunk/arch/ppc/kernel/head.S @@ -22,6 +22,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/head_44x.S b/trunk/arch/ppc/kernel/head_44x.S index 7e44de5a26db..0d8b88219d38 100644 --- a/trunk/arch/ppc/kernel/head_44x.S +++ b/trunk/arch/ppc/kernel/head_44x.S @@ -28,6 +28,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/head_4xx.S b/trunk/arch/ppc/kernel/head_4xx.S index 51da157a629e..10c261c67021 100644 --- a/trunk/arch/ppc/kernel/head_4xx.S +++ b/trunk/arch/ppc/kernel/head_4xx.S @@ -31,6 +31,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/head_8xx.S b/trunk/arch/ppc/kernel/head_8xx.S index 944c35c24278..7a2f20583be4 100644 --- a/trunk/arch/ppc/kernel/head_8xx.S +++ b/trunk/arch/ppc/kernel/head_8xx.S @@ -19,6 +19,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/head_fsl_booke.S b/trunk/arch/ppc/kernel/head_fsl_booke.S index 66877bdfe0b7..dd86bbed7627 100644 --- a/trunk/arch/ppc/kernel/head_fsl_booke.S +++ b/trunk/arch/ppc/kernel/head_fsl_booke.S @@ -30,6 +30,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/misc.S b/trunk/arch/ppc/kernel/misc.S index 2fa0075f2b5f..5a936566fd61 100644 --- a/trunk/arch/ppc/kernel/misc.S +++ b/trunk/arch/ppc/kernel/misc.S @@ -12,6 +12,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/pci.c b/trunk/arch/ppc/kernel/pci.c index 63808e01cb0b..242bb052be67 100644 --- a/trunk/arch/ppc/kernel/pci.c +++ b/trunk/arch/ppc/kernel/pci.c @@ -2,6 +2,7 @@ * Common prep/chrp pci routines. -- Cort */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/ppc-stub.c b/trunk/arch/ppc/kernel/ppc-stub.c index 5f9ee7bb67ec..d61889c24046 100644 --- a/trunk/arch/ppc/kernel/ppc-stub.c +++ b/trunk/arch/ppc/kernel/ppc-stub.c @@ -99,6 +99,7 @@ * ****************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/ppc_htab.c b/trunk/arch/ppc/kernel/ppc_htab.c index bd129d3c2cc1..75c645043746 100644 --- a/trunk/arch/ppc/kernel/ppc_htab.c +++ b/trunk/arch/ppc/kernel/ppc_htab.c @@ -10,6 +10,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/ppc_ksyms.c b/trunk/arch/ppc/kernel/ppc_ksyms.c index 50c1b4739ca7..b250b1b539b6 100644 --- a/trunk/arch/ppc/kernel/ppc_ksyms.c +++ b/trunk/arch/ppc/kernel/ppc_ksyms.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/setup.c b/trunk/arch/ppc/kernel/setup.c index faf2940300b0..4b4607d89bfa 100644 --- a/trunk/arch/ppc/kernel/setup.c +++ b/trunk/arch/ppc/kernel/setup.c @@ -2,6 +2,7 @@ * Common prep boot and setup code. */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/smp-tbsync.c b/trunk/arch/ppc/kernel/smp-tbsync.c index 1576758debaf..6a5694fcc711 100644 --- a/trunk/arch/ppc/kernel/smp-tbsync.c +++ b/trunk/arch/ppc/kernel/smp-tbsync.c @@ -5,6 +5,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/smp.c b/trunk/arch/ppc/kernel/smp.c index ca57e896a36c..f77795a64dae 100644 --- a/trunk/arch/ppc/kernel/smp.c +++ b/trunk/arch/ppc/kernel/smp.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/time.c b/trunk/arch/ppc/kernel/time.c index 6ab8cc7226ab..53ea723af60a 100644 --- a/trunk/arch/ppc/kernel/time.c +++ b/trunk/arch/ppc/kernel/time.c @@ -42,6 +42,7 @@ * "A Kernel Model for Precision Timekeeping" by Dave Mills */ +#include #include #include #include diff --git a/trunk/arch/ppc/kernel/traps.c b/trunk/arch/ppc/kernel/traps.c index d7a433049b48..1c0d68026abd 100644 --- a/trunk/arch/ppc/kernel/traps.c +++ b/trunk/arch/ppc/kernel/traps.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/ppc/lib/locks.c b/trunk/arch/ppc/lib/locks.c index ea4aee6b20e6..c450dc4b766e 100644 --- a/trunk/arch/ppc/lib/locks.c +++ b/trunk/arch/ppc/lib/locks.c @@ -4,6 +4,7 @@ * Written by Cort Dougan (cort@cs.nmt.edu) */ +#include #include #include #include diff --git a/trunk/arch/ppc/lib/string.S b/trunk/arch/ppc/lib/string.S index 84ed33ab4c2d..2e258c49e8be 100644 --- a/trunk/arch/ppc/lib/string.S +++ b/trunk/arch/ppc/lib/string.S @@ -8,6 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/44x_mmu.c b/trunk/arch/ppc/mm/44x_mmu.c index 0a0a0487b334..e0152a9b26e6 100644 --- a/trunk/arch/ppc/mm/44x_mmu.c +++ b/trunk/arch/ppc/mm/44x_mmu.c @@ -24,6 +24,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/4xx_mmu.c b/trunk/arch/ppc/mm/4xx_mmu.c index 838e09db71d9..4d006aa1a0d1 100644 --- a/trunk/arch/ppc/mm/4xx_mmu.c +++ b/trunk/arch/ppc/mm/4xx_mmu.c @@ -21,6 +21,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/fault.c b/trunk/arch/ppc/mm/fault.c index 5cdfb71fcb07..8e08ca32531a 100644 --- a/trunk/arch/ppc/mm/fault.c +++ b/trunk/arch/ppc/mm/fault.c @@ -13,6 +13,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/fsl_booke_mmu.c b/trunk/arch/ppc/mm/fsl_booke_mmu.c index 123da03ab118..5d581bb3aa12 100644 --- a/trunk/arch/ppc/mm/fsl_booke_mmu.c +++ b/trunk/arch/ppc/mm/fsl_booke_mmu.c @@ -26,6 +26,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/hashtable.S b/trunk/arch/ppc/mm/hashtable.S index e756942e65c4..31d0a924317c 100644 --- a/trunk/arch/ppc/mm/hashtable.S +++ b/trunk/arch/ppc/mm/hashtable.S @@ -21,6 +21,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/init.c b/trunk/arch/ppc/mm/init.c index 523392d460fa..c9bd184a295a 100644 --- a/trunk/arch/ppc/mm/init.c +++ b/trunk/arch/ppc/mm/init.c @@ -18,6 +18,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/mem_pieces.c b/trunk/arch/ppc/mm/mem_pieces.c index 6030a0ddfbb4..3d639052017e 100644 --- a/trunk/arch/ppc/mm/mem_pieces.c +++ b/trunk/arch/ppc/mm/mem_pieces.c @@ -14,6 +14,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/mmu_context.c b/trunk/arch/ppc/mm/mmu_context.c index 85afa7f8aa78..8784f3715032 100644 --- a/trunk/arch/ppc/mm/mmu_context.c +++ b/trunk/arch/ppc/mm/mmu_context.c @@ -23,6 +23,7 @@ * */ +#include #include #include diff --git a/trunk/arch/ppc/mm/pgtable.c b/trunk/arch/ppc/mm/pgtable.c index 354a9408f024..706bca8eb144 100644 --- a/trunk/arch/ppc/mm/pgtable.c +++ b/trunk/arch/ppc/mm/pgtable.c @@ -20,6 +20,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/ppc_mmu.c b/trunk/arch/ppc/mm/ppc_mmu.c index 973f1e6afa53..25bb6f3347c1 100644 --- a/trunk/arch/ppc/mm/ppc_mmu.c +++ b/trunk/arch/ppc/mm/ppc_mmu.c @@ -23,6 +23,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/mm/tlb.c b/trunk/arch/ppc/mm/tlb.c index fa29740a28f5..606b023196a2 100644 --- a/trunk/arch/ppc/mm/tlb.c +++ b/trunk/arch/ppc/mm/tlb.c @@ -23,6 +23,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/bamboo.c b/trunk/arch/ppc/platforms/4xx/bamboo.c index 349660b84a02..b940cfd646c2 100644 --- a/trunk/arch/ppc/platforms/4xx/bamboo.c +++ b/trunk/arch/ppc/platforms/4xx/bamboo.c @@ -10,6 +10,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/bamboo.h b/trunk/arch/ppc/platforms/4xx/bamboo.h index dcd3d09a0a71..31c0dd6a26cb 100644 --- a/trunk/arch/ppc/platforms/4xx/bamboo.h +++ b/trunk/arch/ppc/platforms/4xx/bamboo.h @@ -15,6 +15,7 @@ #ifndef __ASM_BAMBOO_H__ #define __ASM_BAMBOO_H__ +#include #include /* F/W TLB mapping used in bootloader glue to reset EMAC */ diff --git a/trunk/arch/ppc/platforms/4xx/bubinga.c b/trunk/arch/ppc/platforms/4xx/bubinga.c index 4009f4983ca6..ce48a4f08cbb 100644 --- a/trunk/arch/ppc/platforms/4xx/bubinga.c +++ b/trunk/arch/ppc/platforms/4xx/bubinga.c @@ -10,6 +10,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/bubinga.h b/trunk/arch/ppc/platforms/4xx/bubinga.h index 5c408060eb35..606aa9fa5caa 100644 --- a/trunk/arch/ppc/platforms/4xx/bubinga.h +++ b/trunk/arch/ppc/platforms/4xx/bubinga.h @@ -19,6 +19,7 @@ #ifndef __BUBINGA_H__ #define __BUBINGA_H__ +#include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/cpci405.c b/trunk/arch/ppc/platforms/4xx/cpci405.c index 367430998fc5..970b69831e6f 100644 --- a/trunk/arch/ppc/platforms/4xx/cpci405.c +++ b/trunk/arch/ppc/platforms/4xx/cpci405.c @@ -15,6 +15,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/ebony.c b/trunk/arch/ppc/platforms/4xx/ebony.c index f0f9cc8480ca..b4ecb9c79854 100644 --- a/trunk/arch/ppc/platforms/4xx/ebony.c +++ b/trunk/arch/ppc/platforms/4xx/ebony.c @@ -13,6 +13,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/ebony.h b/trunk/arch/ppc/platforms/4xx/ebony.h index f40e33d39d76..27b2e77c7c83 100644 --- a/trunk/arch/ppc/platforms/4xx/ebony.h +++ b/trunk/arch/ppc/platforms/4xx/ebony.h @@ -15,6 +15,7 @@ #ifndef __ASM_EBONY_H__ #define __ASM_EBONY_H__ +#include #include /* F/W TLB mapping used in bootloader glue to reset EMAC */ diff --git a/trunk/arch/ppc/platforms/4xx/ep405.c b/trunk/arch/ppc/platforms/4xx/ep405.c index ae5c82081c95..6efa91ff9c07 100644 --- a/trunk/arch/ppc/platforms/4xx/ep405.c +++ b/trunk/arch/ppc/platforms/4xx/ep405.c @@ -9,6 +9,7 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/ibm405ep.c b/trunk/arch/ppc/platforms/4xx/ibm405ep.c index fb3630a1608d..55af769a6e70 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm405ep.c +++ b/trunk/arch/ppc/platforms/4xx/ibm405ep.c @@ -10,6 +10,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/ibm405ep.h b/trunk/arch/ppc/platforms/4xx/ibm405ep.h index 3ef20a547080..fe46640de152 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm405ep.h +++ b/trunk/arch/ppc/platforms/4xx/ibm405ep.h @@ -14,6 +14,7 @@ #ifndef __ASM_IBM405EP_H__ #define __ASM_IBM405EP_H__ +#include /* ibm405.h at bottom of this file */ diff --git a/trunk/arch/ppc/platforms/4xx/ibm405gp.c b/trunk/arch/ppc/platforms/4xx/ibm405gp.c index 2ac67a2f0ba6..e5700469a682 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm405gp.c +++ b/trunk/arch/ppc/platforms/4xx/ibm405gp.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/ibm405gp.h b/trunk/arch/ppc/platforms/4xx/ibm405gp.h index 9f15e5518719..eaf0ef57028d 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm405gp.h +++ b/trunk/arch/ppc/platforms/4xx/ibm405gp.h @@ -11,6 +11,7 @@ #ifndef __ASM_IBM405GP_H__ #define __ASM_IBM405GP_H__ +#include /* ibm405.h at bottom of this file */ diff --git a/trunk/arch/ppc/platforms/4xx/ibm405gpr.c b/trunk/arch/ppc/platforms/4xx/ibm405gpr.c index 9f4dacffdbb3..49da61f6854a 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm405gpr.c +++ b/trunk/arch/ppc/platforms/4xx/ibm405gpr.c @@ -7,6 +7,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/ibm405gpr.h b/trunk/arch/ppc/platforms/4xx/ibm405gpr.h index 9e01f1515de3..e90c5dde01d3 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm405gpr.h +++ b/trunk/arch/ppc/platforms/4xx/ibm405gpr.h @@ -11,6 +11,7 @@ #ifndef __ASM_IBM405GPR_H__ #define __ASM_IBM405GPR_H__ +#include /* ibm405.h at bottom of this file */ diff --git a/trunk/arch/ppc/platforms/4xx/ibm440ep.h b/trunk/arch/ppc/platforms/4xx/ibm440ep.h index d92572727d20..61717e8a799e 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm440ep.h +++ b/trunk/arch/ppc/platforms/4xx/ibm440ep.h @@ -17,6 +17,7 @@ #ifndef __PPC_PLATFORMS_IBM440EP_H #define __PPC_PLATFORMS_IBM440EP_H +#include #include /* UART */ diff --git a/trunk/arch/ppc/platforms/4xx/ibm440gp.h b/trunk/arch/ppc/platforms/4xx/ibm440gp.h index 391c90e1f5ea..7b2763b6024f 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm440gp.h +++ b/trunk/arch/ppc/platforms/4xx/ibm440gp.h @@ -18,6 +18,7 @@ #ifndef __PPC_PLATFORMS_IBM440GP_H #define __PPC_PLATFORMS_IBM440GP_H +#include /* UART */ #define PPC440GP_UART0_ADDR 0x0000000140000200ULL diff --git a/trunk/arch/ppc/platforms/4xx/ibm440gx.h b/trunk/arch/ppc/platforms/4xx/ibm440gx.h index 599c4289b9c2..070a34efe1c7 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm440gx.h +++ b/trunk/arch/ppc/platforms/4xx/ibm440gx.h @@ -17,6 +17,7 @@ #ifndef __PPC_PLATFORMS_IBM440GX_H #define __PPC_PLATFORMS_IBM440GX_H +#include #include diff --git a/trunk/arch/ppc/platforms/4xx/ibm440sp.h b/trunk/arch/ppc/platforms/4xx/ibm440sp.h index 2978682f1720..77e8bb22c527 100644 --- a/trunk/arch/ppc/platforms/4xx/ibm440sp.h +++ b/trunk/arch/ppc/platforms/4xx/ibm440sp.h @@ -15,6 +15,7 @@ #ifndef __PPC_PLATFORMS_IBM440SP_H #define __PPC_PLATFORMS_IBM440SP_H +#include #include diff --git a/trunk/arch/ppc/platforms/4xx/ibmnp405h.c b/trunk/arch/ppc/platforms/4xx/ibmnp405h.c index 1afc3642e5b1..f1dcb0ac15b7 100644 --- a/trunk/arch/ppc/platforms/4xx/ibmnp405h.c +++ b/trunk/arch/ppc/platforms/4xx/ibmnp405h.c @@ -7,6 +7,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/ibmnp405h.h b/trunk/arch/ppc/platforms/4xx/ibmnp405h.h index 4aa8821b478b..2c683f6aaa66 100644 --- a/trunk/arch/ppc/platforms/4xx/ibmnp405h.h +++ b/trunk/arch/ppc/platforms/4xx/ibmnp405h.h @@ -11,6 +11,7 @@ #ifndef __ASM_IBMNP405H_H__ #define __ASM_IBMNP405H_H__ +#include /* ibm405.h at bottom of this file */ diff --git a/trunk/arch/ppc/platforms/4xx/ibmstb4.h b/trunk/arch/ppc/platforms/4xx/ibmstb4.h index 31a08abaa4a2..9de426597351 100644 --- a/trunk/arch/ppc/platforms/4xx/ibmstb4.h +++ b/trunk/arch/ppc/platforms/4xx/ibmstb4.h @@ -11,6 +11,7 @@ #ifndef __ASM_IBMSTB4_H__ #define __ASM_IBMSTB4_H__ +#include /* serial port defines */ #define STB04xxx_IO_BASE ((uint)0xe0000000) diff --git a/trunk/arch/ppc/platforms/4xx/ibmstbx25.h b/trunk/arch/ppc/platforms/4xx/ibmstbx25.h index 31b63343e641..6884a49d3482 100644 --- a/trunk/arch/ppc/platforms/4xx/ibmstbx25.h +++ b/trunk/arch/ppc/platforms/4xx/ibmstbx25.h @@ -11,6 +11,7 @@ #ifndef __ASM_IBMSTBX25_H__ #define __ASM_IBMSTBX25_H__ +#include /* serial port defines */ #define STBx25xx_IO_BASE ((uint)0xe0000000) diff --git a/trunk/arch/ppc/platforms/4xx/luan.c b/trunk/arch/ppc/platforms/4xx/luan.c index 61706ef37112..5c37de28e135 100644 --- a/trunk/arch/ppc/platforms/4xx/luan.c +++ b/trunk/arch/ppc/platforms/4xx/luan.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/luan.h b/trunk/arch/ppc/platforms/4xx/luan.h index 68dd46b0a5c4..e0db6a810feb 100644 --- a/trunk/arch/ppc/platforms/4xx/luan.h +++ b/trunk/arch/ppc/platforms/4xx/luan.h @@ -16,6 +16,7 @@ #ifndef __ASM_LUAN_H__ #define __ASM_LUAN_H__ +#include #include /* F/W TLB mapping used in bootloader glue to reset EMAC */ diff --git a/trunk/arch/ppc/platforms/4xx/ocotea.c b/trunk/arch/ppc/platforms/4xx/ocotea.c index 84e999d9a7bb..554776d4b8ac 100644 --- a/trunk/arch/ppc/platforms/4xx/ocotea.c +++ b/trunk/arch/ppc/platforms/4xx/ocotea.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/ocotea.h b/trunk/arch/ppc/platforms/4xx/ocotea.h index 89730ce2322c..7c799a9ff82b 100644 --- a/trunk/arch/ppc/platforms/4xx/ocotea.h +++ b/trunk/arch/ppc/platforms/4xx/ocotea.h @@ -16,6 +16,7 @@ #ifndef __ASM_OCOTEA_H__ #define __ASM_OCOTEA_H__ +#include #include /* F/W TLB mapping used in bootloader glue to reset EMAC */ diff --git a/trunk/arch/ppc/platforms/4xx/ppc440spe.h b/trunk/arch/ppc/platforms/4xx/ppc440spe.h index f1e867c4c9fc..d3a620ddcdee 100644 --- a/trunk/arch/ppc/platforms/4xx/ppc440spe.h +++ b/trunk/arch/ppc/platforms/4xx/ppc440spe.h @@ -17,6 +17,7 @@ #ifndef __PPC_PLATFORMS_PPC440SPE_H #define __PPC_PLATFORMS_PPC440SPE_H +#include #include diff --git a/trunk/arch/ppc/platforms/4xx/redwood5.c b/trunk/arch/ppc/platforms/4xx/redwood5.c index edf4d37d1a52..53da2b4f7c24 100644 --- a/trunk/arch/ppc/platforms/4xx/redwood5.c +++ b/trunk/arch/ppc/platforms/4xx/redwood5.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/redwood6.c b/trunk/arch/ppc/platforms/4xx/redwood6.c index 006e29f83a1a..41b27d106fa3 100644 --- a/trunk/arch/ppc/platforms/4xx/redwood6.c +++ b/trunk/arch/ppc/platforms/4xx/redwood6.c @@ -7,6 +7,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/sycamore.c b/trunk/arch/ppc/platforms/4xx/sycamore.c index c47493e344c2..bab31eb30687 100644 --- a/trunk/arch/ppc/platforms/4xx/sycamore.c +++ b/trunk/arch/ppc/platforms/4xx/sycamore.c @@ -9,6 +9,7 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/sycamore.h b/trunk/arch/ppc/platforms/4xx/sycamore.h index 69b169eac053..dae01620227d 100644 --- a/trunk/arch/ppc/platforms/4xx/sycamore.h +++ b/trunk/arch/ppc/platforms/4xx/sycamore.h @@ -19,6 +19,7 @@ #ifndef __ASM_SYCAMORE_H__ #define __ASM_SYCAMORE_H__ +#include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/walnut.c b/trunk/arch/ppc/platforms/4xx/walnut.c index f414d2d4c58e..6bd77902b9a4 100644 --- a/trunk/arch/ppc/platforms/4xx/walnut.c +++ b/trunk/arch/ppc/platforms/4xx/walnut.c @@ -11,6 +11,7 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/walnut.h b/trunk/arch/ppc/platforms/4xx/walnut.h index d9c4eb788940..f13a577f0a41 100644 --- a/trunk/arch/ppc/platforms/4xx/walnut.h +++ b/trunk/arch/ppc/platforms/4xx/walnut.h @@ -21,6 +21,7 @@ #ifndef __ASM_WALNUT_H__ #define __ASM_WALNUT_H__ +#include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/xilinx_ml300.c b/trunk/arch/ppc/platforms/4xx/xilinx_ml300.c index fb5f0b5e13d1..d97a7f269f97 100644 --- a/trunk/arch/ppc/platforms/4xx/xilinx_ml300.c +++ b/trunk/arch/ppc/platforms/4xx/xilinx_ml300.c @@ -9,6 +9,7 @@ * "as is" without any warranty of any kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/xilinx_ml403.c b/trunk/arch/ppc/platforms/4xx/xilinx_ml403.c index cb3bf7a2bcbe..4c0c7e4c1114 100644 --- a/trunk/arch/ppc/platforms/4xx/xilinx_ml403.c +++ b/trunk/arch/ppc/platforms/4xx/xilinx_ml403.c @@ -13,6 +13,7 @@ * kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/xparameters/xparameters.h b/trunk/arch/ppc/platforms/4xx/xparameters/xparameters.h index cd7d0e7d9863..4cf21f256356 100644 --- a/trunk/arch/ppc/platforms/4xx/xparameters/xparameters.h +++ b/trunk/arch/ppc/platforms/4xx/xparameters/xparameters.h @@ -12,6 +12,7 @@ * "as is" without any warranty of any kind, whether express or implied. */ +#include #if defined(CONFIG_XILINX_ML300) #include "xparameters_ml300.h" diff --git a/trunk/arch/ppc/platforms/4xx/yucca.c b/trunk/arch/ppc/platforms/4xx/yucca.c index 346787df0ddb..f287dcdbffce 100644 --- a/trunk/arch/ppc/platforms/4xx/yucca.c +++ b/trunk/arch/ppc/platforms/4xx/yucca.c @@ -12,6 +12,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/4xx/yucca.h b/trunk/arch/ppc/platforms/4xx/yucca.h index bc9684e66a84..7ae23012237a 100644 --- a/trunk/arch/ppc/platforms/4xx/yucca.h +++ b/trunk/arch/ppc/platforms/4xx/yucca.h @@ -17,6 +17,7 @@ #ifndef __ASM_YUCCA_H__ #define __ASM_YUCCA_H__ +#include #include /* F/W TLB mapping used in bootloader glue to reset EMAC */ diff --git a/trunk/arch/ppc/platforms/83xx/mpc834x_sys.c b/trunk/arch/ppc/platforms/83xx/mpc834x_sys.c index 3397f0de1592..11626dd9090f 100644 --- a/trunk/arch/ppc/platforms/83xx/mpc834x_sys.c +++ b/trunk/arch/ppc/platforms/83xx/mpc834x_sys.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/83xx/mpc834x_sys.h b/trunk/arch/ppc/platforms/83xx/mpc834x_sys.h index d2e06c95b083..6727bbdc36ec 100644 --- a/trunk/arch/ppc/platforms/83xx/mpc834x_sys.h +++ b/trunk/arch/ppc/platforms/83xx/mpc834x_sys.h @@ -15,6 +15,7 @@ #ifndef __MACH_MPC83XX_SYS_H__ #define __MACH_MPC83XX_SYS_H__ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/mpc8540_ads.c b/trunk/arch/ppc/platforms/85xx/mpc8540_ads.c index 4f839da6782f..9b014df516b9 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8540_ads.c +++ b/trunk/arch/ppc/platforms/85xx/mpc8540_ads.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/mpc8540_ads.h b/trunk/arch/ppc/platforms/85xx/mpc8540_ads.h index 7559f9e6fc28..0b5e7ff856f5 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8540_ads.h +++ b/trunk/arch/ppc/platforms/85xx/mpc8540_ads.h @@ -15,6 +15,7 @@ #ifndef __MACH_MPC8540ADS_H__ #define __MACH_MPC8540ADS_H__ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/mpc8555_cds.h b/trunk/arch/ppc/platforms/85xx/mpc8555_cds.h index 4f79c372c4e7..9754dbd5d18c 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8555_cds.h +++ b/trunk/arch/ppc/platforms/85xx/mpc8555_cds.h @@ -15,6 +15,7 @@ #ifndef __MACH_MPC8555CDS_H__ #define __MACH_MPC8555CDS_H__ +#include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/mpc8560_ads.c b/trunk/arch/ppc/platforms/85xx/mpc8560_ads.c index d90cd24d018e..0cb2e86470e2 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8560_ads.c +++ b/trunk/arch/ppc/platforms/85xx/mpc8560_ads.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include @@ -131,7 +132,7 @@ static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction cpm2_irqaction = { .handler = cpm2_cascade, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, .name = "cpm2_cascade", }; diff --git a/trunk/arch/ppc/platforms/85xx/mpc8560_ads.h b/trunk/arch/ppc/platforms/85xx/mpc8560_ads.h index 9f185ab2e019..c2247c21fc53 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8560_ads.h +++ b/trunk/arch/ppc/platforms/85xx/mpc8560_ads.h @@ -15,6 +15,7 @@ #ifndef __MACH_MPC8560ADS_H #define __MACH_MPC8560ADS_H +#include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.c b/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.c index 674806e001f6..8fd9d763f58d 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.c +++ b/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.h b/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.h index abf32281655d..de8d41aafe11 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.h +++ b/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.h @@ -15,6 +15,7 @@ #ifndef __MACH_MPC85XX_ADS_H__ #define __MACH_MPC85XX_ADS_H__ +#include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.c index 75204588a3e7..4368dc3f3c30 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.c +++ b/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include @@ -136,7 +137,7 @@ static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction cpm2_irqaction = { .handler = cpm2_cascade, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, .name = "cpm2_cascade", }; diff --git a/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.h b/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.h index 32c5455c8b82..62df54f61ae3 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.h +++ b/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.h @@ -15,6 +15,7 @@ #ifndef __MACH_MPC85XX_CDS_H__ #define __MACH_MPC85XX_CDS_H__ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/sbc8560.c b/trunk/arch/ppc/platforms/85xx/sbc8560.c index 764d580ff535..b73778ecf827 100644 --- a/trunk/arch/ppc/platforms/85xx/sbc8560.c +++ b/trunk/arch/ppc/platforms/85xx/sbc8560.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/sbc8560.h b/trunk/arch/ppc/platforms/85xx/sbc8560.h index c7d61cf3a449..44ffaa2d2c87 100644 --- a/trunk/arch/ppc/platforms/85xx/sbc8560.h +++ b/trunk/arch/ppc/platforms/85xx/sbc8560.h @@ -13,6 +13,7 @@ #ifndef __MACH_SBC8560_H__ #define __MACH_SBC8560_H__ +#include #include #define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET) diff --git a/trunk/arch/ppc/platforms/85xx/sbc85xx.c b/trunk/arch/ppc/platforms/85xx/sbc85xx.c index 2c587ca97bce..d3ff280510ff 100644 --- a/trunk/arch/ppc/platforms/85xx/sbc85xx.c +++ b/trunk/arch/ppc/platforms/85xx/sbc85xx.c @@ -10,6 +10,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/sbc85xx.h b/trunk/arch/ppc/platforms/85xx/sbc85xx.h index 21ea7a55639b..5dd8b6a98c9b 100644 --- a/trunk/arch/ppc/platforms/85xx/sbc85xx.h +++ b/trunk/arch/ppc/platforms/85xx/sbc85xx.h @@ -14,6 +14,7 @@ #ifndef __PLATFORMS_85XX_SBC85XX_H__ #define __PLATFORMS_85XX_SBC85XX_H__ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/stx_gp3.c b/trunk/arch/ppc/platforms/85xx/stx_gp3.c index 495aa79bb3a1..8d7baa9a397a 100644 --- a/trunk/arch/ppc/platforms/85xx/stx_gp3.c +++ b/trunk/arch/ppc/platforms/85xx/stx_gp3.c @@ -16,6 +16,7 @@ * option) any later version. */ +#include #include #include #include @@ -166,7 +167,7 @@ static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction cpm2_irqaction = { .handler = cpm2_cascade, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, .name = "cpm2_cascade", }; diff --git a/trunk/arch/ppc/platforms/85xx/stx_gp3.h b/trunk/arch/ppc/platforms/85xx/stx_gp3.h index c6e34c09e979..3f71f8f59370 100644 --- a/trunk/arch/ppc/platforms/85xx/stx_gp3.h +++ b/trunk/arch/ppc/platforms/85xx/stx_gp3.h @@ -17,6 +17,7 @@ #ifndef __MACH_STX_GP3_H #define __MACH_STX_GP3_H +#include #include #include diff --git a/trunk/arch/ppc/platforms/85xx/tqm85xx.c b/trunk/arch/ppc/platforms/85xx/tqm85xx.c index 189ed4175f9f..00af132262b3 100644 --- a/trunk/arch/ppc/platforms/85xx/tqm85xx.c +++ b/trunk/arch/ppc/platforms/85xx/tqm85xx.c @@ -14,6 +14,7 @@ * option) any later version. */ +#include #include #include #include @@ -190,7 +191,7 @@ static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction cpm2_irqaction = { .handler = cpm2_cascade, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, .name = "cpm2_cascade", }; diff --git a/trunk/arch/ppc/platforms/85xx/tqm85xx.h b/trunk/arch/ppc/platforms/85xx/tqm85xx.h index 57284e68f676..612d80504f9b 100644 --- a/trunk/arch/ppc/platforms/85xx/tqm85xx.h +++ b/trunk/arch/ppc/platforms/85xx/tqm85xx.h @@ -14,6 +14,7 @@ #ifndef __MACH_TQM85XX_H #define __MACH_TQM85XX_H +#include #include #include diff --git a/trunk/arch/ppc/platforms/apus_pci.c b/trunk/arch/ppc/platforms/apus_pci.c index dc165f0c8908..33dad6db8243 100644 --- a/trunk/arch/ppc/platforms/apus_pci.c +++ b/trunk/arch/ppc/platforms/apus_pci.c @@ -10,6 +10,7 @@ * */ +#include #ifdef CONFIG_AMIGA #include diff --git a/trunk/arch/ppc/platforms/apus_setup.c b/trunk/arch/ppc/platforms/apus_setup.c index 1d034ead2c9a..5c4118a459f3 100644 --- a/trunk/arch/ppc/platforms/apus_setup.c +++ b/trunk/arch/ppc/platforms/apus_setup.c @@ -11,6 +11,7 @@ * Amiga specific stuff into mach/amiga. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/ccm.h b/trunk/arch/ppc/platforms/ccm.h index 69000b1c7a4c..edb87b573831 100644 --- a/trunk/arch/ppc/platforms/ccm.h +++ b/trunk/arch/ppc/platforms/ccm.h @@ -7,6 +7,7 @@ #ifndef __MACH_CCM_H #define __MACH_CCM_H +#include #include diff --git a/trunk/arch/ppc/platforms/chestnut.c b/trunk/arch/ppc/platforms/chestnut.c index a764ae71cbcb..f324f757cae1 100644 --- a/trunk/arch/ppc/platforms/chestnut.c +++ b/trunk/arch/ppc/platforms/chestnut.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/cpci690.c b/trunk/arch/ppc/platforms/cpci690.c index e78bccf96c9d..790475c22fd7 100644 --- a/trunk/arch/ppc/platforms/cpci690.c +++ b/trunk/arch/ppc/platforms/cpci690.c @@ -8,6 +8,7 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/ev64260.c b/trunk/arch/ppc/platforms/ev64260.c index 4957a7bcde22..31e8e21e1d5c 100644 --- a/trunk/arch/ppc/platforms/ev64260.c +++ b/trunk/arch/ppc/platforms/ev64260.c @@ -20,6 +20,7 @@ * Note: The 750CXe and 7450 are not stable with a 125MHz or 133MHz TCLK/SYSCLK. * At 100MHz, they are solid. */ +#include #include #include diff --git a/trunk/arch/ppc/platforms/ev64360.c b/trunk/arch/ppc/platforms/ev64360.c index 90ed375c9b90..104ac9b16e8b 100644 --- a/trunk/arch/ppc/platforms/ev64360.c +++ b/trunk/arch/ppc/platforms/ev64360.c @@ -11,6 +11,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/fads.h b/trunk/arch/ppc/platforms/fads.h index 2f9f0f60e3f7..e1c0b1b6dcb3 100644 --- a/trunk/arch/ppc/platforms/fads.h +++ b/trunk/arch/ppc/platforms/fads.h @@ -19,6 +19,7 @@ #ifndef __ASM_FADS_H__ #define __ASM_FADS_H__ +#include #include diff --git a/trunk/arch/ppc/platforms/gemini_prom.S b/trunk/arch/ppc/platforms/gemini_prom.S index e8c84d24f01f..b181f2108001 100644 --- a/trunk/arch/ppc/platforms/gemini_prom.S +++ b/trunk/arch/ppc/platforms/gemini_prom.S @@ -6,6 +6,7 @@ * ---Dan */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/gemini_serial.h b/trunk/arch/ppc/platforms/gemini_serial.h index b915eff79fdb..69855aeec888 100644 --- a/trunk/arch/ppc/platforms/gemini_serial.h +++ b/trunk/arch/ppc/platforms/gemini_serial.h @@ -2,6 +2,7 @@ #ifndef __ASMPPC_GEMINI_SERIAL_H #define __ASMPPC_GEMINI_SERIAL_H +#include #include #ifdef CONFIG_SERIAL_MANY_PORTS diff --git a/trunk/arch/ppc/platforms/gemini_setup.c b/trunk/arch/ppc/platforms/gemini_setup.c index f48048f362a8..0090ff154608 100644 --- a/trunk/arch/ppc/platforms/gemini_setup.c +++ b/trunk/arch/ppc/platforms/gemini_setup.c @@ -6,6 +6,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/hdpu.c b/trunk/arch/ppc/platforms/hdpu.c index e0f112a1fd0b..75dc2ee87d2f 100644 --- a/trunk/arch/ppc/platforms/hdpu.c +++ b/trunk/arch/ppc/platforms/hdpu.c @@ -12,6 +12,7 @@ * option) any later version. */ +#include #include #include @@ -837,7 +838,7 @@ static void smp_hdpu_setup_cpu(int cpu_nr) mv64x60_write(&bh, MV64360_CPU0_DOORBELL_CLR, 0xff); mv64x60_write(&bh, MV64360_CPU0_DOORBELL_MASK, 0xff); request_irq(60, hdpu_smp_cpu0_int_handler, - IRQF_DISABLED, hdpu_smp0, 0); + SA_INTERRUPT, hdpu_smp0, 0); } if (cpu_nr == 1) { @@ -857,7 +858,7 @@ static void smp_hdpu_setup_cpu(int cpu_nr) mv64x60_write(&bh, MV64360_CPU1_DOORBELL_CLR, 0x0); mv64x60_write(&bh, MV64360_CPU1_DOORBELL_MASK, 0xff); request_irq(28, hdpu_smp_cpu1_int_handler, - IRQF_DISABLED, hdpu_smp1, 0); + SA_INTERRUPT, hdpu_smp1, 0); } } diff --git a/trunk/arch/ppc/platforms/hermes.h b/trunk/arch/ppc/platforms/hermes.h index de91afff8ca1..198fc590b9f5 100644 --- a/trunk/arch/ppc/platforms/hermes.h +++ b/trunk/arch/ppc/platforms/hermes.h @@ -7,6 +7,7 @@ #ifndef __MACH_HERMES_H #define __MACH_HERMES_H +#include #include diff --git a/trunk/arch/ppc/platforms/ip860.h b/trunk/arch/ppc/platforms/ip860.h index 2f1f86ce1447..8c3836c5f054 100644 --- a/trunk/arch/ppc/platforms/ip860.h +++ b/trunk/arch/ppc/platforms/ip860.h @@ -7,6 +7,7 @@ #ifndef __MACH_IP860_H #define __MACH_IP860_H +#include #include diff --git a/trunk/arch/ppc/platforms/ivms8.h b/trunk/arch/ppc/platforms/ivms8.h index 9109e684ad9b..d4be310f8084 100644 --- a/trunk/arch/ppc/platforms/ivms8.h +++ b/trunk/arch/ppc/platforms/ivms8.h @@ -13,6 +13,7 @@ #ifndef __ASM_IVMS8_H__ #define __ASM_IVMS8_H__ +#include #include diff --git a/trunk/arch/ppc/platforms/katana.c b/trunk/arch/ppc/platforms/katana.c index 720f8b3e2fbc..ad21280e8920 100644 --- a/trunk/arch/ppc/platforms/katana.c +++ b/trunk/arch/ppc/platforms/katana.c @@ -16,6 +16,7 @@ * Supports the Artesyn 750i, 752i, and 3750. The 752i is virtually identical * to the 750i except that it has an mv64460 bridge. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/lantec.h b/trunk/arch/ppc/platforms/lantec.h index 5e5eb6d0f6aa..8c87642c510f 100644 --- a/trunk/arch/ppc/platforms/lantec.h +++ b/trunk/arch/ppc/platforms/lantec.h @@ -7,6 +7,7 @@ #ifndef __MACH_LANTEC_H #define __MACH_LANTEC_H +#include #include diff --git a/trunk/arch/ppc/platforms/lite5200.c b/trunk/arch/ppc/platforms/lite5200.c index b9e9db63f65b..fecbe9adc9e0 100644 --- a/trunk/arch/ppc/platforms/lite5200.c +++ b/trunk/arch/ppc/platforms/lite5200.c @@ -21,6 +21,7 @@ * kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/lopec.c b/trunk/arch/ppc/platforms/lopec.c index 18dc6e8dd4f4..c6445a727ca3 100644 --- a/trunk/arch/ppc/platforms/lopec.c +++ b/trunk/arch/ppc/platforms/lopec.c @@ -10,6 +10,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/lwmon.h b/trunk/arch/ppc/platforms/lwmon.h index e63f3b07a5db..995bf5112df0 100644 --- a/trunk/arch/ppc/platforms/lwmon.h +++ b/trunk/arch/ppc/platforms/lwmon.h @@ -7,6 +7,7 @@ #ifndef __MACH_LWMON_H #define __MACH_LWMON_H +#include #include diff --git a/trunk/arch/ppc/platforms/mpc866ads_setup.c b/trunk/arch/ppc/platforms/mpc866ads_setup.c index f19b6167c770..d919dab61347 100644 --- a/trunk/arch/ppc/platforms/mpc866ads_setup.c +++ b/trunk/arch/ppc/platforms/mpc866ads_setup.c @@ -11,6 +11,7 @@ * kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/mpc885ads.h b/trunk/arch/ppc/platforms/mpc885ads.h index d3bbbb3c9a1f..a80b7d116b49 100644 --- a/trunk/arch/ppc/platforms/mpc885ads.h +++ b/trunk/arch/ppc/platforms/mpc885ads.h @@ -15,6 +15,7 @@ #ifndef __ASM_MPC885ADS_H__ #define __ASM_MPC885ADS_H__ +#include #include diff --git a/trunk/arch/ppc/platforms/mpc885ads_setup.c b/trunk/arch/ppc/platforms/mpc885ads_setup.c index c1fc4a16fea9..4b88679cd31c 100644 --- a/trunk/arch/ppc/platforms/mpc885ads_setup.c +++ b/trunk/arch/ppc/platforms/mpc885ads_setup.c @@ -11,6 +11,7 @@ * kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/mvme5100.c b/trunk/arch/ppc/platforms/mvme5100.c index bb8d4a45437a..c717cd92c028 100644 --- a/trunk/arch/ppc/platforms/mvme5100.c +++ b/trunk/arch/ppc/platforms/mvme5100.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/pal4_setup.c b/trunk/arch/ppc/platforms/pal4_setup.c index 3da47d9ec7a2..3c3d881df00d 100644 --- a/trunk/arch/ppc/platforms/pal4_setup.c +++ b/trunk/arch/ppc/platforms/pal4_setup.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/pcu_e.h b/trunk/arch/ppc/platforms/pcu_e.h index a2c03a22875e..91a820a6fbc4 100644 --- a/trunk/arch/ppc/platforms/pcu_e.h +++ b/trunk/arch/ppc/platforms/pcu_e.h @@ -7,6 +7,7 @@ #ifndef __MACH_PCU_E_H #define __MACH_PCU_E_H +#include #include diff --git a/trunk/arch/ppc/platforms/powerpmc250.c b/trunk/arch/ppc/platforms/powerpmc250.c index 4d46650e07fd..c3a86be11fb7 100644 --- a/trunk/arch/ppc/platforms/powerpmc250.c +++ b/trunk/arch/ppc/platforms/powerpmc250.c @@ -11,6 +11,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/pplus.c b/trunk/arch/ppc/platforms/pplus.c index 9778105d4dfe..de2761ebe0d9 100644 --- a/trunk/arch/ppc/platforms/pplus.c +++ b/trunk/arch/ppc/platforms/pplus.c @@ -13,6 +13,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/pq2ads.h b/trunk/arch/ppc/platforms/pq2ads.h index 2b287f4e0ca3..6b26dd36c640 100644 --- a/trunk/arch/ppc/platforms/pq2ads.h +++ b/trunk/arch/ppc/platforms/pq2ads.h @@ -9,6 +9,7 @@ #ifndef __MACH_ADS8260_DEFS #define __MACH_ADS8260_DEFS +#include #include diff --git a/trunk/arch/ppc/platforms/prep_pci.c b/trunk/arch/ppc/platforms/prep_pci.c index c627ba41335f..e50b9996848c 100644 --- a/trunk/arch/ppc/platforms/prep_pci.c +++ b/trunk/arch/ppc/platforms/prep_pci.c @@ -6,6 +6,7 @@ * The motherboard routes/maps will disappear shortly. -- Cort */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/prep_setup.c b/trunk/arch/ppc/platforms/prep_setup.c index 6436beffdc96..e86f6156d589 100644 --- a/trunk/arch/ppc/platforms/prep_setup.c +++ b/trunk/arch/ppc/platforms/prep_setup.c @@ -11,6 +11,7 @@ * bootup setup stuff.. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/prpmc750.c b/trunk/arch/ppc/platforms/prpmc750.c index fcab513e206d..cdd9cfb13ee9 100644 --- a/trunk/arch/ppc/platforms/prpmc750.c +++ b/trunk/arch/ppc/platforms/prpmc750.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/prpmc800.c b/trunk/arch/ppc/platforms/prpmc800.c index f4ade5cd7a88..e459a199fb1d 100644 --- a/trunk/arch/ppc/platforms/prpmc800.c +++ b/trunk/arch/ppc/platforms/prpmc800.c @@ -7,6 +7,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/radstone_ppc7d.c b/trunk/arch/ppc/platforms/radstone_ppc7d.c index 3bb530af0297..bc26b6d71c1d 100644 --- a/trunk/arch/ppc/platforms/radstone_ppc7d.c +++ b/trunk/arch/ppc/platforms/radstone_ppc7d.c @@ -18,6 +18,7 @@ * SCSI / VGA. */ +#include #include #include #include @@ -1310,7 +1311,7 @@ static void ppc7d_init2(void) /* Hook up i8259 interrupt which is connected to GPP28 */ request_irq(mv64360_irq_base + MV64x60_IRQ_GPP28, ppc7d_i8259_intr, - IRQF_DISABLED, "I8259 (GPP28) interrupt", (void *)0); + SA_INTERRUPT, "I8259 (GPP28) interrupt", (void *)0); /* Configure MPP16 as watchdog NMI, MPP17 as watchdog WDE */ spin_lock_irqsave(&mv64x60_lock, flags); diff --git a/trunk/arch/ppc/platforms/rpxclassic.h b/trunk/arch/ppc/platforms/rpxclassic.h index 57a2a55dab8c..6daa109491c4 100644 --- a/trunk/arch/ppc/platforms/rpxclassic.h +++ b/trunk/arch/ppc/platforms/rpxclassic.h @@ -8,6 +8,7 @@ #ifndef __MACH_RPX_DEFS #define __MACH_RPX_DEFS +#include #ifndef __ASSEMBLY__ /* A Board Information structure that is given to a program when diff --git a/trunk/arch/ppc/platforms/rpxlite.h b/trunk/arch/ppc/platforms/rpxlite.h index 719780646270..deee5bd36aa8 100644 --- a/trunk/arch/ppc/platforms/rpxlite.h +++ b/trunk/arch/ppc/platforms/rpxlite.h @@ -8,6 +8,7 @@ #ifndef __MACH_RPX_DEFS #define __MACH_RPX_DEFS +#include #ifndef __ASSEMBLY__ /* A Board Information structure that is given to a program when diff --git a/trunk/arch/ppc/platforms/sandpoint.c b/trunk/arch/ppc/platforms/sandpoint.c index a76002af686f..6dc459decb2d 100644 --- a/trunk/arch/ppc/platforms/sandpoint.c +++ b/trunk/arch/ppc/platforms/sandpoint.c @@ -60,6 +60,7 @@ * found, we can hopefully stop hardcoding 32MB of RAM. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/sbc82xx.c b/trunk/arch/ppc/platforms/sbc82xx.c index 60b769c7f3fc..41006d2b4b38 100644 --- a/trunk/arch/ppc/platforms/sbc82xx.c +++ b/trunk/arch/ppc/platforms/sbc82xx.c @@ -13,6 +13,7 @@ * option) any later version. */ +#include #include #include #include @@ -145,7 +146,7 @@ static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id, struct pt_regs *re static struct irqaction sbc82xx_i8259_irqaction = { .handler = sbc82xx_i8259_demux, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, .name = "i8259 demux", }; diff --git a/trunk/arch/ppc/platforms/spruce.c b/trunk/arch/ppc/platforms/spruce.c index 3c7842784876..3783deccd9b2 100644 --- a/trunk/arch/ppc/platforms/spruce.c +++ b/trunk/arch/ppc/platforms/spruce.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/arch/ppc/platforms/tqm8260.h b/trunk/arch/ppc/platforms/tqm8260.h index 7f8c9a6928f8..c7a78a646c66 100644 --- a/trunk/arch/ppc/platforms/tqm8260.h +++ b/trunk/arch/ppc/platforms/tqm8260.h @@ -7,6 +7,7 @@ #ifndef __TQM8260_PLATFORM #define __TQM8260_PLATFORM +#include #include diff --git a/trunk/arch/ppc/platforms/tqm8xx.h b/trunk/arch/ppc/platforms/tqm8xx.h index 662131d0eb39..43ac064ebe5a 100644 --- a/trunk/arch/ppc/platforms/tqm8xx.h +++ b/trunk/arch/ppc/platforms/tqm8xx.h @@ -8,6 +8,7 @@ #ifndef __MACH_TQM8xx_H #define __MACH_TQM8xx_H +#include #include diff --git a/trunk/arch/ppc/syslib/Makefile b/trunk/arch/ppc/syslib/Makefile index 2497bbc07e76..490749ca88f9 100644 --- a/trunk/arch/ppc/syslib/Makefile +++ b/trunk/arch/ppc/syslib/Makefile @@ -104,5 +104,3 @@ obj-$(CONFIG_PPC_MPC52xx) += mpc52xx_setup.o mpc52xx_pic.o \ ifeq ($(CONFIG_PPC_MPC52xx),y) obj-$(CONFIG_PCI) += mpc52xx_pci.o endif - -obj-$(CONFIG_PPC_I8259) += i8259.o diff --git a/trunk/arch/ppc/syslib/btext.c b/trunk/arch/ppc/syslib/btext.c index d11667046f21..12fa83e6774a 100644 --- a/trunk/arch/ppc/syslib/btext.c +++ b/trunk/arch/ppc/syslib/btext.c @@ -3,10 +3,11 @@ * * Benjamin Herrenschmidt */ +#include #include #include #include -#include +#include #include #include diff --git a/trunk/arch/ppc/syslib/gen550_dbg.c b/trunk/arch/ppc/syslib/gen550_dbg.c index 9293f5c59099..9fcff74bfdd0 100644 --- a/trunk/arch/ppc/syslib/gen550_dbg.c +++ b/trunk/arch/ppc/syslib/gen550_dbg.c @@ -14,6 +14,7 @@ * or implied. */ +#include #include #include #include /* For linux/serial_core.h */ diff --git a/trunk/arch/ppc/syslib/gen550_kgdb.c b/trunk/arch/ppc/syslib/gen550_kgdb.c index 987cc0414e6e..874078a7664d 100644 --- a/trunk/arch/ppc/syslib/gen550_kgdb.c +++ b/trunk/arch/ppc/syslib/gen550_kgdb.c @@ -15,6 +15,7 @@ * or implied. */ +#include #include #include diff --git a/trunk/arch/ppc/syslib/gt64260_pic.c b/trunk/arch/ppc/syslib/gt64260_pic.c index 7fd550a7d586..91096b38ae70 100644 --- a/trunk/arch/ppc/syslib/gt64260_pic.c +++ b/trunk/arch/ppc/syslib/gt64260_pic.c @@ -297,7 +297,7 @@ gt64260_register_hdlrs(void) /* Register CPU interface error interrupt handler */ if ((rc = request_irq(MV64x60_IRQ_CPU_ERR, - gt64260_cpu_error_int_handler, IRQF_DISABLED, CPU_INTR_STR, 0))) + gt64260_cpu_error_int_handler, SA_INTERRUPT, CPU_INTR_STR, 0))) printk(KERN_WARNING "Can't register cpu error handler: %d", rc); mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0); @@ -305,7 +305,7 @@ gt64260_register_hdlrs(void) /* Register PCI 0 error interrupt handler */ if ((rc = request_irq(MV64360_IRQ_PCI0, gt64260_pci_error_int_handler, - IRQF_DISABLED, PCI0_INTR_STR, (void *)0))) + SA_INTERRUPT, PCI0_INTR_STR, (void *)0))) printk(KERN_WARNING "Can't register pci 0 error handler: %d", rc); @@ -314,7 +314,7 @@ gt64260_register_hdlrs(void) /* Register PCI 1 error interrupt handler */ if ((rc = request_irq(MV64360_IRQ_PCI1, gt64260_pci_error_int_handler, - IRQF_DISABLED, PCI1_INTR_STR, (void *)1))) + SA_INTERRUPT, PCI1_INTR_STR, (void *)1))) printk(KERN_WARNING "Can't register pci 1 error handler: %d", rc); diff --git a/trunk/arch/ppc/syslib/i8259.c b/trunk/arch/ppc/syslib/i8259.c deleted file mode 100644 index eb35353af837..000000000000 --- a/trunk/arch/ppc/syslib/i8259.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - * i8259 interrupt controller driver. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include -#include -#include -#include - -static volatile void __iomem *pci_intack; /* RO, gives us the irq vector */ - -static unsigned char cached_8259[2] = { 0xff, 0xff }; -#define cached_A1 (cached_8259[0]) -#define cached_21 (cached_8259[1]) - -static DEFINE_SPINLOCK(i8259_lock); - -static int i8259_pic_irq_offset; - -/* - * Acknowledge the IRQ using either the PCI host bridge's interrupt - * acknowledge feature or poll. How i8259_init() is called determines - * which is called. It should be noted that polling is broken on some - * IBM and Motorola PReP boxes so we must use the int-ack feature on them. - */ -int i8259_irq(struct pt_regs *regs) -{ - int irq; - - spin_lock(&i8259_lock); - - /* Either int-ack or poll for the IRQ */ - if (pci_intack) - irq = readb(pci_intack); - else { - /* Perform an interrupt acknowledge cycle on controller 1. */ - outb(0x0C, 0x20); /* prepare for poll */ - irq = inb(0x20) & 7; - if (irq == 2 ) { - /* - * Interrupt is cascaded so perform interrupt - * acknowledge on controller 2. - */ - outb(0x0C, 0xA0); /* prepare for poll */ - irq = (inb(0xA0) & 7) + 8; - } - } - - if (irq == 7) { - /* - * This may be a spurious interrupt. - * - * Read the interrupt status register (ISR). If the most - * significant bit is not set then there is no valid - * interrupt. - */ - if (!pci_intack) - outb(0x0B, 0x20); /* ISR register */ - if(~inb(0x20) & 0x80) - irq = -1; - } - - spin_unlock(&i8259_lock); - return irq + i8259_pic_irq_offset; -} - -static void i8259_mask_and_ack_irq(unsigned int irq_nr) -{ - unsigned long flags; - - spin_lock_irqsave(&i8259_lock, flags); - irq_nr -= i8259_pic_irq_offset; - if (irq_nr > 7) { - cached_A1 |= 1 << (irq_nr-8); - inb(0xA1); /* DUMMY */ - outb(cached_A1, 0xA1); - outb(0x20, 0xA0); /* Non-specific EOI */ - outb(0x20, 0x20); /* Non-specific EOI to cascade */ - } else { - cached_21 |= 1 << irq_nr; - inb(0x21); /* DUMMY */ - outb(cached_21, 0x21); - outb(0x20, 0x20); /* Non-specific EOI */ - } - spin_unlock_irqrestore(&i8259_lock, flags); -} - -static void i8259_set_irq_mask(int irq_nr) -{ - outb(cached_A1,0xA1); - outb(cached_21,0x21); -} - -static void i8259_mask_irq(unsigned int irq_nr) -{ - unsigned long flags; - - spin_lock_irqsave(&i8259_lock, flags); - irq_nr -= i8259_pic_irq_offset; - if (irq_nr < 8) - cached_21 |= 1 << irq_nr; - else - cached_A1 |= 1 << (irq_nr-8); - i8259_set_irq_mask(irq_nr); - spin_unlock_irqrestore(&i8259_lock, flags); -} - -static void i8259_unmask_irq(unsigned int irq_nr) -{ - unsigned long flags; - - spin_lock_irqsave(&i8259_lock, flags); - irq_nr -= i8259_pic_irq_offset; - if (irq_nr < 8) - cached_21 &= ~(1 << irq_nr); - else - cached_A1 &= ~(1 << (irq_nr-8)); - i8259_set_irq_mask(irq_nr); - spin_unlock_irqrestore(&i8259_lock, flags); -} - -static struct irq_chip i8259_pic = { - .typename = " i8259 ", - .mask = i8259_mask_irq, - .unmask = i8259_unmask_irq, - .mask_ack = i8259_mask_and_ack_irq, -}; - -static struct resource pic1_iores = { - .name = "8259 (master)", - .start = 0x20, - .end = 0x21, - .flags = IORESOURCE_BUSY, -}; - -static struct resource pic2_iores = { - .name = "8259 (slave)", - .start = 0xa0, - .end = 0xa1, - .flags = IORESOURCE_BUSY, -}; - -static struct resource pic_edgectrl_iores = { - .name = "8259 edge control", - .start = 0x4d0, - .end = 0x4d1, - .flags = IORESOURCE_BUSY, -}; - -static struct irqaction i8259_irqaction = { - .handler = no_action, - .flags = SA_INTERRUPT, - .mask = CPU_MASK_NONE, - .name = "82c59 secondary cascade", -}; - -/* - * i8259_init() - * intack_addr - PCI interrupt acknowledge (real) address which will return - * the active irq from the 8259 - */ -void __init i8259_init(unsigned long intack_addr, int offset) -{ - unsigned long flags; - int i; - - spin_lock_irqsave(&i8259_lock, flags); - i8259_pic_irq_offset = offset; - - /* init master interrupt controller */ - outb(0x11, 0x20); /* Start init sequence */ - outb(0x00, 0x21); /* Vector base */ - outb(0x04, 0x21); /* edge tiggered, Cascade (slave) on IRQ2 */ - outb(0x01, 0x21); /* Select 8086 mode */ - - /* init slave interrupt controller */ - outb(0x11, 0xA0); /* Start init sequence */ - outb(0x08, 0xA1); /* Vector base */ - outb(0x02, 0xA1); /* edge triggered, Cascade (slave) on IRQ2 */ - outb(0x01, 0xA1); /* Select 8086 mode */ - - /* always read ISR */ - outb(0x0B, 0x20); - outb(0x0B, 0xA0); - - /* Mask all interrupts */ - outb(cached_A1, 0xA1); - outb(cached_21, 0x21); - - spin_unlock_irqrestore(&i8259_lock, flags); - - for (i = 0; i < NUM_ISA_INTERRUPTS; ++i) { - set_irq_chip_and_handler(offset + i, &i8259_pic, - handle_level_irq); - irq_desc[offset + i].status |= IRQ_LEVEL; - } - - /* reserve our resources */ - setup_irq(offset + 2, &i8259_irqaction); - request_resource(&ioport_resource, &pic1_iores); - request_resource(&ioport_resource, &pic2_iores); - request_resource(&ioport_resource, &pic_edgectrl_iores); - - if (intack_addr != 0) - pci_intack = ioremap(intack_addr, 1); - -} diff --git a/trunk/arch/ppc/syslib/ibm440gp_common.c b/trunk/arch/ppc/syslib/ibm440gp_common.c index a3927ec9b5d7..fbaae5f6d834 100644 --- a/trunk/arch/ppc/syslib/ibm440gp_common.c +++ b/trunk/arch/ppc/syslib/ibm440gp_common.c @@ -13,6 +13,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ibm440gp_common.h b/trunk/arch/ppc/syslib/ibm440gp_common.h index 94d7835038ad..f48529f3c23d 100644 --- a/trunk/arch/ppc/syslib/ibm440gp_common.h +++ b/trunk/arch/ppc/syslib/ibm440gp_common.h @@ -16,6 +16,7 @@ #ifndef __ASSEMBLY__ +#include #include #include diff --git a/trunk/arch/ppc/syslib/ibm440gx_common.c b/trunk/arch/ppc/syslib/ibm440gx_common.c index 4b77e6c8c87f..f6cc16888527 100644 --- a/trunk/arch/ppc/syslib/ibm440gx_common.c +++ b/trunk/arch/ppc/syslib/ibm440gx_common.c @@ -10,6 +10,7 @@ * option) any later version. * */ +#include #include #include #include @@ -149,7 +150,7 @@ void __init ibm440gx_l2c_enable(void){ unsigned long flags; /* Install error handler */ - if (request_irq(87, l2c_error_handler, IRQF_DISABLED, "L2C", 0) < 0){ + if (request_irq(87, l2c_error_handler, SA_INTERRUPT, "L2C", 0) < 0){ printk(KERN_ERR "Cannot install L2C error handler, cache is not enabled\n"); return; } diff --git a/trunk/arch/ppc/syslib/ibm440gx_common.h b/trunk/arch/ppc/syslib/ibm440gx_common.h index 8d6f203e7a1d..a03ec6022e8f 100644 --- a/trunk/arch/ppc/syslib/ibm440gx_common.h +++ b/trunk/arch/ppc/syslib/ibm440gx_common.h @@ -16,6 +16,7 @@ #ifndef __ASSEMBLY__ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ibm440sp_common.c b/trunk/arch/ppc/syslib/ibm440sp_common.c index 571f8bcf78e6..293e4138d172 100644 --- a/trunk/arch/ppc/syslib/ibm440sp_common.c +++ b/trunk/arch/ppc/syslib/ibm440sp_common.c @@ -13,6 +13,7 @@ * option) any later version. * */ +#include #include #include diff --git a/trunk/arch/ppc/syslib/ibm44x_common.c b/trunk/arch/ppc/syslib/ibm44x_common.c index 01f99b4a6649..14a981a5cea7 100644 --- a/trunk/arch/ppc/syslib/ibm44x_common.c +++ b/trunk/arch/ppc/syslib/ibm44x_common.c @@ -13,6 +13,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/m8260_pci_erratum9.c b/trunk/arch/ppc/syslib/m8260_pci_erratum9.c index 974581ea4849..99e4bc0e42af 100644 --- a/trunk/arch/ppc/syslib/m8260_pci_erratum9.c +++ b/trunk/arch/ppc/syslib/m8260_pci_erratum9.c @@ -15,6 +15,7 @@ * or implied. */ #include +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/m8260_setup.c b/trunk/arch/ppc/syslib/m8260_setup.c index 15f0d7323535..b7a6cb2d8d52 100644 --- a/trunk/arch/ppc/syslib/m8260_setup.c +++ b/trunk/arch/ppc/syslib/m8260_setup.c @@ -6,6 +6,7 @@ * Further modified for generic 8xx and 8260 by Dan. */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/m82xx_pci.c b/trunk/arch/ppc/syslib/m82xx_pci.c index d3fa264e179e..63fa5b313396 100644 --- a/trunk/arch/ppc/syslib/m82xx_pci.c +++ b/trunk/arch/ppc/syslib/m82xx_pci.c @@ -139,7 +139,7 @@ pq2pci_irq_demux(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction pq2pci_irqaction = { .handler = pq2pci_irq_demux, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, .name = "PQ2 PCI cascade", }; diff --git a/trunk/arch/ppc/syslib/m8xx_setup.c b/trunk/arch/ppc/syslib/m8xx_setup.c index 54303a7b4e69..0c4c0de7c59f 100644 --- a/trunk/arch/ppc/syslib/m8xx_setup.c +++ b/trunk/arch/ppc/syslib/m8xx_setup.c @@ -10,6 +10,7 @@ * bootup setup stuff.. */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/mpc52xx_pci.c b/trunk/arch/ppc/syslib/mpc52xx_pci.c index 20a0eac0dc3a..5a5a7a9cd248 100644 --- a/trunk/arch/ppc/syslib/mpc52xx_pci.c +++ b/trunk/arch/ppc/syslib/mpc52xx_pci.c @@ -11,6 +11,7 @@ * kind, whether express or implied. */ +#include #include diff --git a/trunk/arch/ppc/syslib/mpc52xx_setup.c b/trunk/arch/ppc/syslib/mpc52xx_setup.c index 80c609019bda..ee6379bb415e 100644 --- a/trunk/arch/ppc/syslib/mpc52xx_setup.c +++ b/trunk/arch/ppc/syslib/mpc52xx_setup.c @@ -15,6 +15,7 @@ * kind, whether express or implied. */ +#include #include #include diff --git a/trunk/arch/ppc/syslib/mv64360_pic.c b/trunk/arch/ppc/syslib/mv64360_pic.c index 3f6d162f87cf..a4244d468381 100644 --- a/trunk/arch/ppc/syslib/mv64360_pic.c +++ b/trunk/arch/ppc/syslib/mv64360_pic.c @@ -380,7 +380,7 @@ mv64360_register_hdlrs(void) /* Clear old errors and register CPU interface error intr handler */ mv64x60_write(&bh, MV64x60_CPU_ERR_CAUSE, 0); if ((rc = request_irq(MV64x60_IRQ_CPU_ERR + mv64360_irq_base, - mv64360_cpu_error_int_handler, IRQF_DISABLED, CPU_INTR_STR, 0))) + mv64360_cpu_error_int_handler, SA_INTERRUPT, CPU_INTR_STR, 0))) printk(KERN_WARNING "Can't register cpu error handler: %d", rc); mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0); @@ -389,14 +389,14 @@ mv64360_register_hdlrs(void) /* Clear old errors and register internal SRAM error intr handler */ mv64x60_write(&bh, MV64360_SRAM_ERR_CAUSE, 0); if ((rc = request_irq(MV64360_IRQ_SRAM_PAR_ERR + mv64360_irq_base, - mv64360_sram_error_int_handler,IRQF_DISABLED,SRAM_INTR_STR, 0))) + mv64360_sram_error_int_handler,SA_INTERRUPT,SRAM_INTR_STR, 0))) printk(KERN_WARNING "Can't register SRAM error handler: %d",rc); /* Clear old errors and register PCI 0 error intr handler */ mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, 0); if ((rc = request_irq(MV64360_IRQ_PCI0 + mv64360_irq_base, mv64360_pci_error_int_handler, - IRQF_DISABLED, PCI0_INTR_STR, (void *)0))) + SA_INTERRUPT, PCI0_INTR_STR, (void *)0))) printk(KERN_WARNING "Can't register pci 0 error handler: %d", rc); @@ -411,7 +411,7 @@ mv64360_register_hdlrs(void) mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, 0); if ((rc = request_irq(MV64360_IRQ_PCI1 + mv64360_irq_base, mv64360_pci_error_int_handler, - IRQF_DISABLED, PCI1_INTR_STR, (void *)1))) + SA_INTERRUPT, PCI1_INTR_STR, (void *)1))) printk(KERN_WARNING "Can't register pci 1 error handler: %d", rc); diff --git a/trunk/arch/ppc/syslib/mv64x60_dbg.c b/trunk/arch/ppc/syslib/mv64x60_dbg.c index e1876261e5dc..9cf18764a1a1 100644 --- a/trunk/arch/ppc/syslib/mv64x60_dbg.c +++ b/trunk/arch/ppc/syslib/mv64x60_dbg.c @@ -18,6 +18,7 @@ */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ocp.c b/trunk/arch/ppc/syslib/ocp.c index 50c55622ece9..a4ecc2ee579f 100644 --- a/trunk/arch/ppc/syslib/ocp.c +++ b/trunk/arch/ppc/syslib/ocp.c @@ -36,6 +36,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/open_pic.c b/trunk/arch/ppc/syslib/open_pic.c index aa0b95788705..767a0bc95817 100644 --- a/trunk/arch/ppc/syslib/open_pic.c +++ b/trunk/arch/ppc/syslib/open_pic.c @@ -6,6 +6,7 @@ * for more details. */ +#include #include #include #include @@ -575,21 +576,18 @@ void openpic_request_IPIs(void) if (OpenPIC == NULL) return; - /* - * IPIs are marked IRQF_DISABLED as they must run with irqs - * disabled - */ + /* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */ request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset, - openpic_ipi_action, IRQF_DISABLED, + openpic_ipi_action, SA_INTERRUPT, "IPI0 (call function)", NULL); request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1, - openpic_ipi_action, IRQF_DISABLED, + openpic_ipi_action, SA_INTERRUPT, "IPI1 (reschedule)", NULL); request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2, - openpic_ipi_action, IRQF_DISABLED, + openpic_ipi_action, SA_INTERRUPT, "IPI2 (invalidate tlb)", NULL); request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3, - openpic_ipi_action, IRQF_DISABLED, + openpic_ipi_action, SA_INTERRUPT, "IPI3 (xmon break)", NULL); for ( i = 0; i < OPENPIC_NUM_IPI ; i++ ) @@ -694,7 +692,7 @@ openpic_init_nmi_irq(u_int irq) static struct irqaction openpic_cascade_irqaction = { .handler = no_action, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, }; diff --git a/trunk/arch/ppc/syslib/open_pic2.c b/trunk/arch/ppc/syslib/open_pic2.c index e1ff971539ea..b8154efff6ed 100644 --- a/trunk/arch/ppc/syslib/open_pic2.c +++ b/trunk/arch/ppc/syslib/open_pic2.c @@ -10,6 +10,7 @@ * register accesses */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc440spe_pcie.c b/trunk/arch/ppc/syslib/ppc440spe_pcie.c index dd5d4b958c31..1509fc1ddfb6 100644 --- a/trunk/arch/ppc/syslib/ppc440spe_pcie.c +++ b/trunk/arch/ppc/syslib/ppc440spe_pcie.c @@ -8,6 +8,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc4xx_dma.c b/trunk/arch/ppc/syslib/ppc4xx_dma.c index 1eef4ffed4fb..b40b96a8c609 100644 --- a/trunk/arch/ppc/syslib/ppc4xx_dma.c +++ b/trunk/arch/ppc/syslib/ppc4xx_dma.c @@ -19,6 +19,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc4xx_pic.c b/trunk/arch/ppc/syslib/ppc4xx_pic.c index 745685df5984..e669c1335d47 100644 --- a/trunk/arch/ppc/syslib/ppc4xx_pic.c +++ b/trunk/arch/ppc/syslib/ppc4xx_pic.c @@ -13,6 +13,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc4xx_setup.c b/trunk/arch/ppc/syslib/ppc4xx_setup.c index debe14c083a1..e83a83fd95e1 100644 --- a/trunk/arch/ppc/syslib/ppc4xx_setup.c +++ b/trunk/arch/ppc/syslib/ppc4xx_setup.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc4xx_sgdma.c b/trunk/arch/ppc/syslib/ppc4xx_sgdma.c index 2f83e162971f..280ea010a9c8 100644 --- a/trunk/arch/ppc/syslib/ppc4xx_sgdma.c +++ b/trunk/arch/ppc/syslib/ppc4xx_sgdma.c @@ -19,6 +19,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc83xx_setup.c b/trunk/arch/ppc/syslib/ppc83xx_setup.c index ec466db52114..26afd637dc81 100644 --- a/trunk/arch/ppc/syslib/ppc83xx_setup.c +++ b/trunk/arch/ppc/syslib/ppc83xx_setup.c @@ -22,6 +22,7 @@ * Added PCI support -- Tony Li */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc83xx_setup.h b/trunk/arch/ppc/syslib/ppc83xx_setup.h index b918a2d245ea..478b011cd963 100644 --- a/trunk/arch/ppc/syslib/ppc83xx_setup.h +++ b/trunk/arch/ppc/syslib/ppc83xx_setup.h @@ -23,6 +23,7 @@ #ifndef __PPC_SYSLIB_PPC83XX_SETUP_H #define __PPC_SYSLIB_PPC83XX_SETUP_H +#include #include extern unsigned long mpc83xx_find_end_of_memory(void) __init; diff --git a/trunk/arch/ppc/syslib/ppc85xx_common.c b/trunk/arch/ppc/syslib/ppc85xx_common.c index e5ac699e7316..0145c968f9ad 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_common.c +++ b/trunk/arch/ppc/syslib/ppc85xx_common.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc85xx_common.h b/trunk/arch/ppc/syslib/ppc85xx_common.h index 4fc405425113..182744a1321c 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_common.h +++ b/trunk/arch/ppc/syslib/ppc85xx_common.h @@ -14,6 +14,7 @@ #ifndef __PPC_SYSLIB_PPC85XX_COMMON_H #define __PPC_SYSLIB_PPC85XX_COMMON_H +#include #include /* Provide access to ccsrbar for any modules, etc */ diff --git a/trunk/arch/ppc/syslib/ppc85xx_rio.c b/trunk/arch/ppc/syslib/ppc85xx_rio.c index d9b471b4d695..297f3b549177 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_rio.c +++ b/trunk/arch/ppc/syslib/ppc85xx_rio.c @@ -10,6 +10,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc85xx_rio.h b/trunk/arch/ppc/syslib/ppc85xx_rio.h index 6d3ff30b1579..c0827a2c3eec 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_rio.h +++ b/trunk/arch/ppc/syslib/ppc85xx_rio.h @@ -13,6 +13,7 @@ #ifndef __PPC_SYSLIB_PPC85XX_RIO_H #define __PPC_SYSLIB_PPC85XX_RIO_H +#include #include extern void mpc85xx_rio_setup(int law_start, int law_size); diff --git a/trunk/arch/ppc/syslib/ppc85xx_setup.c b/trunk/arch/ppc/syslib/ppc85xx_setup.c index 2475ec6600fe..79b7089d7500 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_setup.c +++ b/trunk/arch/ppc/syslib/ppc85xx_setup.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc85xx_setup.h b/trunk/arch/ppc/syslib/ppc85xx_setup.h index 6ff79995210b..f55b8032d3d9 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_setup.h +++ b/trunk/arch/ppc/syslib/ppc85xx_setup.h @@ -15,6 +15,7 @@ #ifndef __PPC_SYSLIB_PPC85XX_SETUP_H #define __PPC_SYSLIB_PPC85XX_SETUP_H +#include #include #include diff --git a/trunk/arch/ppc/syslib/ppc8xx_pic.c b/trunk/arch/ppc/syslib/ppc8xx_pic.c index d6c25fe25011..3e6f51a61d46 100644 --- a/trunk/arch/ppc/syslib/ppc8xx_pic.c +++ b/trunk/arch/ppc/syslib/ppc8xx_pic.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/ppc/syslib/ppc8xx_pic.h b/trunk/arch/ppc/syslib/ppc8xx_pic.h index d7d9f651a91b..784935eac365 100644 --- a/trunk/arch/ppc/syslib/ppc8xx_pic.h +++ b/trunk/arch/ppc/syslib/ppc8xx_pic.h @@ -1,6 +1,7 @@ #ifndef _PPC_KERNEL_PPC8xx_H #define _PPC_KERNEL_PPC8xx_H +#include #include #include diff --git a/trunk/arch/ppc/syslib/qspan_pci.c b/trunk/arch/ppc/syslib/qspan_pci.c index 85053b2816a9..0970b5d30391 100644 --- a/trunk/arch/ppc/syslib/qspan_pci.c +++ b/trunk/arch/ppc/syslib/qspan_pci.c @@ -15,6 +15,7 @@ * we have switched the chip select. */ +#include #include #include #include diff --git a/trunk/arch/ppc/xmon/privinst.h b/trunk/arch/ppc/xmon/privinst.h index c492a35687bd..93978c027ca0 100644 --- a/trunk/arch/ppc/xmon/privinst.h +++ b/trunk/arch/ppc/xmon/privinst.h @@ -1,6 +1,7 @@ /* * Copyright (C) 1996 Paul Mackerras. */ +#include #define GETREG(reg) \ static inline int get_ ## reg (void) \ diff --git a/trunk/arch/ppc/xmon/start.c b/trunk/arch/ppc/xmon/start.c index f7e92986952a..cfc2d6ad464d 100644 --- a/trunk/arch/ppc/xmon/start.c +++ b/trunk/arch/ppc/xmon/start.c @@ -1,6 +1,7 @@ /* * Copyright (C) 1996 Paul Mackerras. */ +#include #include #include #include diff --git a/trunk/arch/ppc/xmon/xmon.c b/trunk/arch/ppc/xmon/xmon.c index 37d234f93394..06fa44b5c647 100644 --- a/trunk/arch/ppc/xmon/xmon.c +++ b/trunk/arch/ppc/xmon/xmon.c @@ -3,6 +3,7 @@ * * Copyright (C) 1996 Paul Mackerras. */ +#include #include #include #include diff --git a/trunk/arch/s390/Kconfig b/trunk/arch/s390/Kconfig index 224fbff79969..821a141889de 100644 --- a/trunk/arch/s390/Kconfig +++ b/trunk/arch/s390/Kconfig @@ -7,14 +7,6 @@ config MMU bool default y -config LOCKDEP_SUPPORT - bool - default y - -config STACKTRACE_SUPPORT - bool - default y - config RWSEM_GENERIC_SPINLOCK bool diff --git a/trunk/arch/s390/Kconfig.debug b/trunk/arch/s390/Kconfig.debug index 2283933a9a93..f53b6d5300e5 100644 --- a/trunk/arch/s390/Kconfig.debug +++ b/trunk/arch/s390/Kconfig.debug @@ -1,9 +1,5 @@ menu "Kernel hacking" -config TRACE_IRQFLAGS_SUPPORT - bool - default y - source "lib/Kconfig.debug" endmenu diff --git a/trunk/arch/s390/Makefile b/trunk/arch/s390/Makefile index 74ef57dcfa60..b3791fb094a8 100644 --- a/trunk/arch/s390/Makefile +++ b/trunk/arch/s390/Makefile @@ -34,11 +34,6 @@ cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5) cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900) cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990) -# -# Prevent tail-call optimizations, to get clearer backtraces: -# -cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls - # old style option for packed stacks ifeq ($(call cc-option-yn,-mkernel-backchain),y) cflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK diff --git a/trunk/arch/s390/appldata/appldata_base.c b/trunk/arch/s390/appldata/appldata_base.c index d0f82c995af6..61bc44626c04 100644 --- a/trunk/arch/s390/appldata/appldata_base.c +++ b/trunk/arch/s390/appldata/appldata_base.c @@ -10,6 +10,7 @@ * Author: Gerald Schaefer */ +#include #include #include #include @@ -765,6 +766,7 @@ unsigned long nr_iowait(void) #endif /* MODULE */ EXPORT_SYMBOL_GPL(si_swapinfo); EXPORT_SYMBOL_GPL(nr_threads); +EXPORT_SYMBOL_GPL(get_full_page_state); EXPORT_SYMBOL_GPL(nr_running); EXPORT_SYMBOL_GPL(nr_iowait); //EXPORT_SYMBOL_GPL(nr_context_switches); diff --git a/trunk/arch/s390/appldata/appldata_mem.c b/trunk/arch/s390/appldata/appldata_mem.c index ab3b0765a64e..7915a197d96d 100644 --- a/trunk/arch/s390/appldata/appldata_mem.c +++ b/trunk/arch/s390/appldata/appldata_mem.c @@ -9,6 +9,7 @@ * Author: Gerald Schaefer */ +#include #include #include #include @@ -106,21 +107,21 @@ static void appldata_get_mem_data(void *data) * serialized through the appldata_ops_lock and can use static */ static struct sysinfo val; - unsigned long ev[NR_VM_EVENT_ITEMS]; + static struct page_state ps; struct appldata_mem_data *mem_data; mem_data = data; mem_data->sync_count_1++; - all_vm_events(ev); - mem_data->pgpgin = ev[PGPGIN] >> 1; - mem_data->pgpgout = ev[PGPGOUT] >> 1; - mem_data->pswpin = ev[PSWPIN]; - mem_data->pswpout = ev[PSWPOUT]; - mem_data->pgalloc = ev[PGALLOC_HIGH] + ev[PGALLOC_NORMAL] + - ev[PGALLOC_DMA]; - mem_data->pgfault = ev[PGFAULT]; - mem_data->pgmajfault = ev[PGMAJFAULT]; + get_full_page_state(&ps); + mem_data->pgpgin = ps.pgpgin >> 1; + mem_data->pgpgout = ps.pgpgout >> 1; + mem_data->pswpin = ps.pswpin; + mem_data->pswpout = ps.pswpout; + mem_data->pgalloc = ps.pgalloc_high + ps.pgalloc_normal + + ps.pgalloc_dma; + mem_data->pgfault = ps.pgfault; + mem_data->pgmajfault = ps.pgmajfault; si_meminfo(&val); mem_data->sharedram = val.sharedram; @@ -129,8 +130,7 @@ static void appldata_get_mem_data(void *data) mem_data->totalhigh = P2K(val.totalhigh); mem_data->freehigh = P2K(val.freehigh); mem_data->bufferram = P2K(val.bufferram); - mem_data->cached = P2K(global_page_state(NR_FILE_PAGES) - - val.bufferram); + mem_data->cached = P2K(atomic_read(&nr_pagecache) - val.bufferram); si_swapinfo(&val); mem_data->totalswap = P2K(val.totalswap); diff --git a/trunk/arch/s390/appldata/appldata_net_sum.c b/trunk/arch/s390/appldata/appldata_net_sum.c index 075e619bf37d..39b7bdecbf05 100644 --- a/trunk/arch/s390/appldata/appldata_net_sum.c +++ b/trunk/arch/s390/appldata/appldata_net_sum.c @@ -10,6 +10,7 @@ * Author: Gerald Schaefer */ +#include #include #include #include diff --git a/trunk/arch/s390/appldata/appldata_os.c b/trunk/arch/s390/appldata/appldata_os.c index 161acc5c8a1b..f2b44a2f1dec 100644 --- a/trunk/arch/s390/appldata/appldata_os.c +++ b/trunk/arch/s390/appldata/appldata_os.c @@ -9,6 +9,7 @@ * Author: Gerald Schaefer */ +#include #include #include #include diff --git a/trunk/arch/s390/kernel/Makefile b/trunk/arch/s390/kernel/Makefile index eabf00a6f770..9269b5788fac 100644 --- a/trunk/arch/s390/kernel/Makefile +++ b/trunk/arch/s390/kernel/Makefile @@ -21,7 +21,6 @@ obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \ obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o obj-$(CONFIG_VIRT_TIMER) += vtime.o -obj-$(CONFIG_STACKTRACE) += stacktrace.o # Kexec part S390_KEXEC_OBJS := machine_kexec.o crash.o diff --git a/trunk/arch/s390/kernel/asm-offsets.c b/trunk/arch/s390/kernel/asm-offsets.c index ec514fe5ccd0..3f7018e9dbe4 100644 --- a/trunk/arch/s390/kernel/asm-offsets.c +++ b/trunk/arch/s390/kernel/asm-offsets.c @@ -4,6 +4,7 @@ * and format the required data. */ +#include #include /* Use marker if you need to separate the values later */ diff --git a/trunk/arch/s390/kernel/binfmt_elf32.c b/trunk/arch/s390/kernel/binfmt_elf32.c index 9565a2dcfadc..12a6311e9838 100644 --- a/trunk/arch/s390/kernel/binfmt_elf32.c +++ b/trunk/arch/s390/kernel/binfmt_elf32.c @@ -135,6 +135,7 @@ static inline int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs) #include #include +#include #include #include #include diff --git a/trunk/arch/s390/kernel/compat_linux.c b/trunk/arch/s390/kernel/compat_linux.c index cabb4ff54cd7..5e14de37c17b 100644 --- a/trunk/arch/s390/kernel/compat_linux.c +++ b/trunk/arch/s390/kernel/compat_linux.c @@ -16,6 +16,7 @@ */ +#include #include #include #include diff --git a/trunk/arch/s390/kernel/compat_linux.h b/trunk/arch/s390/kernel/compat_linux.h index 1a18e29668ef..3898f66d0b2f 100644 --- a/trunk/arch/s390/kernel/compat_linux.h +++ b/trunk/arch/s390/kernel/compat_linux.h @@ -1,6 +1,7 @@ #ifndef _ASM_S390X_S390_H #define _ASM_S390X_S390_H +#include #include #include #include diff --git a/trunk/arch/s390/kernel/compat_signal.c b/trunk/arch/s390/kernel/compat_signal.c index d49b876a83bf..b4c815d8ef75 100644 --- a/trunk/arch/s390/kernel/compat_signal.c +++ b/trunk/arch/s390/kernel/compat_signal.c @@ -10,6 +10,7 @@ * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson */ +#include #include #include #include diff --git a/trunk/arch/s390/kernel/debug.c b/trunk/arch/s390/kernel/debug.c index 7ba20922a535..06a3fbc12536 100644 --- a/trunk/arch/s390/kernel/debug.c +++ b/trunk/arch/s390/kernel/debug.c @@ -10,6 +10,7 @@ * Bugreports to: */ +#include #include #include #include diff --git a/trunk/arch/s390/kernel/entry.S b/trunk/arch/s390/kernel/entry.S index 5b5799ac8f83..aa8b52c2140f 100644 --- a/trunk/arch/s390/kernel/entry.S +++ b/trunk/arch/s390/kernel/entry.S @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -58,21 +59,6 @@ STACK_SIZE = 1 << STACK_SHIFT #define BASED(name) name-system_call(%r13) -#ifdef CONFIG_TRACE_IRQFLAGS - .macro TRACE_IRQS_ON - l %r1,BASED(.Ltrace_irq_on) - basr %r14,%r1 - .endm - - .macro TRACE_IRQS_OFF - l %r1,BASED(.Ltrace_irq_off) - basr %r14,%r1 - .endm -#else -#define TRACE_IRQS_ON -#define TRACE_IRQS_OFF -#endif - /* * Register usage in interrupt handlers: * R9 - pointer to current task structure @@ -243,9 +229,8 @@ sysc_do_svc: sysc_nr_ok: mvc SP_ARGS(4,%r15),SP_R7(%r15) sysc_do_restart: - l %r8,BASED(.Lsysc_table) tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) - l %r8,0(%r7,%r8) # get system call addr. + l %r8,sys_call_table-system_call(%r7,%r13) # get system call addr. bnz BASED(sysc_tracesys) basr %r14,%r8 # call sys_xxxx st %r2,SP_R2(%r15) # store return value (change R2 on stack) @@ -346,10 +331,9 @@ sysc_tracesys: basr %r14,%r1 clc SP_R2(4,%r15),BASED(.Lnr_syscalls) bnl BASED(sysc_tracenogo) - l %r8,BASED(.Lsysc_table) l %r7,SP_R2(%r15) # strace might have changed the sll %r7,2 # system call - l %r8,0(%r7,%r8) + l %r8,sys_call_table-system_call(%r7,%r13) sysc_tracego: lm %r3,%r6,SP_R3(%r15) l %r2,SP_ORIG_R2(%r15) @@ -376,7 +360,6 @@ ret_from_fork: st %r15,SP_R15(%r15) # store stack pointer for new kthread 0: l %r1,BASED(.Lschedtail) basr %r14,%r1 - TRACE_IRQS_ON stosm __SF_EMPTY(%r15),0x03 # reenable interrupts b BASED(sysc_return) @@ -532,7 +515,6 @@ pgm_no_vtime3: mvc __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP - TRACE_IRQS_ON stosm __SF_EMPTY(%r15),0x03 # reenable interrupts b BASED(sysc_do_svc) @@ -556,11 +538,9 @@ io_int_handler: io_no_vtime: #endif l %r9,__LC_THREAD_INFO # load pointer to thread_info struct - TRACE_IRQS_OFF l %r1,BASED(.Ldo_IRQ) # load address of do_IRQ la %r2,SP_PTREGS(%r15) # address of register-save area basr %r14,%r1 # branch to standard irq handler - TRACE_IRQS_ON io_return: tm SP_PSW+1(%r15),0x01 # returning to user ? @@ -670,12 +650,10 @@ ext_int_handler: ext_no_vtime: #endif l %r9,__LC_THREAD_INFO # load pointer to thread_info struct - TRACE_IRQS_OFF la %r2,SP_PTREGS(%r15) # address of register-save area lh %r3,__LC_EXT_INT_CODE # get interruption code l %r1,BASED(.Ldo_extint) basr %r14,%r1 - TRACE_IRQS_ON b BASED(io_return) __critical_end: @@ -752,10 +730,8 @@ mcck_no_vtime: stosm __SF_EMPTY(%r15),0x04 # turn dat on tm __TI_flags+3(%r9),_TIF_MCCK_PENDING bno BASED(mcck_return) - TRACE_IRQS_OFF l %r1,BASED(.Ls390_handle_mcck) basr %r14,%r1 # call machine check handler - TRACE_IRQS_ON mcck_return: mvc __LC_RETURN_MCCK_PSW(8),SP_PSW(%r15) # move return PSW ni __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit @@ -1034,12 +1010,7 @@ cleanup_io_leave_insn: .Ltrace: .long syscall_trace .Lvfork: .long sys_vfork .Lschedtail: .long schedule_tail -.Lsysc_table: .long sys_call_table -#ifdef CONFIG_TRACE_IRQFLAGS -.Ltrace_irq_on:.long trace_hardirqs_on -.Ltrace_irq_off: - .long trace_hardirqs_off -#endif + .Lcritical_start: .long __critical_start + 0x80000000 .Lcritical_end: @@ -1047,8 +1018,8 @@ cleanup_io_leave_insn: .Lcleanup_critical: .long cleanup_critical - .section .rodata, "a" #define SYSCALL(esa,esame,emu) .long esa sys_call_table: #include "syscalls.S" #undef SYSCALL + diff --git a/trunk/arch/s390/kernel/entry64.S b/trunk/arch/s390/kernel/entry64.S index 56f5f613b868..f3222a1b2861 100644 --- a/trunk/arch/s390/kernel/entry64.S +++ b/trunk/arch/s390/kernel/entry64.S @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -58,19 +59,6 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ #define BASED(name) name-system_call(%r13) -#ifdef CONFIG_TRACE_IRQFLAGS - .macro TRACE_IRQS_ON - brasl %r14,trace_hardirqs_on - .endm - - .macro TRACE_IRQS_OFF - brasl %r14,trace_hardirqs_off - .endm -#else -#define TRACE_IRQS_ON -#define TRACE_IRQS_OFF -#endif - .macro STORE_TIMER lc_offset #ifdef CONFIG_VIRT_CPU_ACCOUNTING stpt \lc_offset @@ -367,7 +355,6 @@ ret_from_fork: jo 0f stg %r15,SP_R15(%r15) # store stack pointer for new kthread 0: brasl %r14,schedule_tail - TRACE_IRQS_ON stosm 24(%r15),0x03 # reenable interrupts j sysc_return @@ -549,7 +536,6 @@ pgm_no_vtime3: mvc __THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP - TRACE_IRQS_ON stosm __SF_EMPTY(%r15),0x03 # reenable interrupts j sysc_do_svc @@ -572,10 +558,8 @@ io_int_handler: io_no_vtime: #endif lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct - TRACE_IRQS_OFF la %r2,SP_PTREGS(%r15) # address of register-save area brasl %r14,do_IRQ # call standard irq handler - TRACE_IRQS_ON io_return: tm SP_PSW+1(%r15),0x01 # returning to user ? @@ -682,11 +666,9 @@ ext_int_handler: ext_no_vtime: #endif lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct - TRACE_IRQS_OFF la %r2,SP_PTREGS(%r15) # address of register-save area llgh %r3,__LC_EXT_INT_CODE # get interruption code brasl %r14,do_extint - TRACE_IRQS_ON j io_return __critical_end: @@ -762,9 +744,7 @@ mcck_no_vtime: stosm __SF_EMPTY(%r15),0x04 # turn dat on tm __TI_flags+7(%r9),_TIF_MCCK_PENDING jno mcck_return - TRACE_IRQS_OFF brasl %r14,s390_handle_mcck - TRACE_IRQS_ON mcck_return: mvc __LC_RETURN_MCCK_PSW(16),SP_PSW(%r15) # move return PSW ni __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit @@ -1012,7 +992,6 @@ cleanup_io_leave_insn: .Lcritical_end: .quad __critical_end - .section .rodata, "a" #define SYSCALL(esa,esame,emu) .long esame sys_call_table: #include "syscalls.S" diff --git a/trunk/arch/s390/kernel/head.S b/trunk/arch/s390/kernel/head.S index adad8863ee2f..538c82da49b1 100644 --- a/trunk/arch/s390/kernel/head.S +++ b/trunk/arch/s390/kernel/head.S @@ -23,6 +23,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/s390/kernel/irq.c b/trunk/arch/s390/kernel/irq.c index 1eef50918615..480b6a5fef3a 100644 --- a/trunk/arch/s390/kernel/irq.c +++ b/trunk/arch/s390/kernel/irq.c @@ -69,6 +69,10 @@ asmlinkage void do_softirq(void) local_irq_save(flags); + account_system_vtime(current); + + local_bh_disable(); + if (local_softirq_pending()) { /* Get current stack pointer. */ asm volatile("la %0,0(15)" : "=a" (old)); @@ -91,6 +95,10 @@ asmlinkage void do_softirq(void) __do_softirq(); } + account_system_vtime(current); + + __local_bh_enable(); + local_irq_restore(flags); } diff --git a/trunk/arch/s390/kernel/process.c b/trunk/arch/s390/kernel/process.c index 78c8e5548caf..4a0f5a1551ea 100644 --- a/trunk/arch/s390/kernel/process.c +++ b/trunk/arch/s390/kernel/process.c @@ -15,6 +15,7 @@ * This file handles the architecture-dependent parts of process handling.. */ +#include #include #include #include @@ -142,7 +143,6 @@ static void default_idle(void) return; } - trace_hardirqs_on(); /* Wait for external, I/O or machine check interrupt. */ __load_psw_mask(PSW_KERNEL_BITS | PSW_MASK_WAIT | PSW_MASK_IO | PSW_MASK_EXT); diff --git a/trunk/arch/s390/kernel/s390_ksyms.c b/trunk/arch/s390/kernel/s390_ksyms.c index c73a45467fa4..0886e739d122 100644 --- a/trunk/arch/s390/kernel/s390_ksyms.c +++ b/trunk/arch/s390/kernel/s390_ksyms.c @@ -3,6 +3,7 @@ * * S390 version */ +#include #include #include #include diff --git a/trunk/arch/s390/kernel/setup.c b/trunk/arch/s390/kernel/setup.c index 1ca34f54ea8a..2b2551e3510b 100644 --- a/trunk/arch/s390/kernel/setup.c +++ b/trunk/arch/s390/kernel/setup.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/s390/kernel/signal.c b/trunk/arch/s390/kernel/signal.c index a887b686f279..d48cfc726b68 100644 --- a/trunk/arch/s390/kernel/signal.c +++ b/trunk/arch/s390/kernel/signal.c @@ -11,6 +11,7 @@ * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson */ +#include #include #include #include diff --git a/trunk/arch/s390/kernel/stacktrace.c b/trunk/arch/s390/kernel/stacktrace.c deleted file mode 100644 index de83f38288d0..000000000000 --- a/trunk/arch/s390/kernel/stacktrace.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * arch/s390/kernel/stacktrace.c - * - * Stack trace management functions - * - * Copyright (C) IBM Corp. 2006 - * Author(s): Heiko Carstens - */ - -#include -#include -#include - -static inline unsigned long save_context_stack(struct stack_trace *trace, - unsigned int *skip, - unsigned long sp, - unsigned long low, - unsigned long high) -{ - struct stack_frame *sf; - struct pt_regs *regs; - unsigned long addr; - - while(1) { - sp &= PSW_ADDR_INSN; - if (sp < low || sp > high) - return sp; - sf = (struct stack_frame *)sp; - while(1) { - addr = sf->gprs[8] & PSW_ADDR_INSN; - if (!(*skip)) - trace->entries[trace->nr_entries++] = addr; - else - (*skip)--; - if (trace->nr_entries >= trace->max_entries) - return sp; - low = sp; - sp = sf->back_chain & PSW_ADDR_INSN; - if (!sp) - break; - if (sp <= low || sp > high - sizeof(*sf)) - return sp; - sf = (struct stack_frame *)sp; - } - /* Zero backchain detected, check for interrupt frame. */ - sp = (unsigned long)(sf + 1); - if (sp <= low || sp > high - sizeof(*regs)) - return sp; - regs = (struct pt_regs *)sp; - addr = regs->psw.addr & PSW_ADDR_INSN; - if (!(*skip)) - trace->entries[trace->nr_entries++] = addr; - else - (*skip)--; - if (trace->nr_entries >= trace->max_entries) - return sp; - low = sp; - sp = regs->gprs[15]; - } -} - -void save_stack_trace(struct stack_trace *trace, - struct task_struct *task, int all_contexts, - unsigned int skip) -{ - register unsigned long sp asm ("15"); - unsigned long orig_sp; - - sp &= PSW_ADDR_INSN; - orig_sp = sp; - - sp = save_context_stack(trace, &skip, sp, - S390_lowcore.panic_stack - PAGE_SIZE, - S390_lowcore.panic_stack); - if ((sp != orig_sp) && !all_contexts) - return; - sp = save_context_stack(trace, &skip, sp, - S390_lowcore.async_stack - ASYNC_SIZE, - S390_lowcore.async_stack); - if ((sp != orig_sp) && !all_contexts) - return; - if (task) - save_context_stack(trace, &skip, sp, - (unsigned long) task_stack_page(task), - (unsigned long) task_stack_page(task) + THREAD_SIZE); - else - save_context_stack(trace, &skip, sp, S390_lowcore.thread_info, - S390_lowcore.thread_info + THREAD_SIZE); - return; -} diff --git a/trunk/arch/s390/kernel/time.c b/trunk/arch/s390/kernel/time.c index f7fe9bc43397..2a6c6efb6865 100644 --- a/trunk/arch/s390/kernel/time.c +++ b/trunk/arch/s390/kernel/time.c @@ -12,6 +12,7 @@ * Copyright (C) 1991, 1992, 1995 Linus Torvalds */ +#include #include #include #include diff --git a/trunk/arch/s390/kernel/traps.c b/trunk/arch/s390/kernel/traps.c index 12240c03a6dd..b7630436f693 100644 --- a/trunk/arch/s390/kernel/traps.c +++ b/trunk/arch/s390/kernel/traps.c @@ -14,6 +14,7 @@ * 'Traps.c' handles hardware traps and faults after we have saved some * state in 'asm.s'. */ +#include #include #include #include diff --git a/trunk/arch/s390/kernel/vmlinux.lds.S b/trunk/arch/s390/kernel/vmlinux.lds.S index ff5f7bb34f75..9f34bb54c051 100644 --- a/trunk/arch/s390/kernel/vmlinux.lds.S +++ b/trunk/arch/s390/kernel/vmlinux.lds.S @@ -3,6 +3,7 @@ */ #include +#include #ifndef CONFIG_64BIT OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") diff --git a/trunk/arch/s390/kernel/vtime.c b/trunk/arch/s390/kernel/vtime.c index 2306cd83fca1..1f0439dc245a 100644 --- a/trunk/arch/s390/kernel/vtime.c +++ b/trunk/arch/s390/kernel/vtime.c @@ -7,6 +7,7 @@ * Author(s): Jan Glauber */ +#include #include #include #include diff --git a/trunk/arch/s390/lib/delay.c b/trunk/arch/s390/lib/delay.c index 468f4ea33f99..71f0a2fb3078 100644 --- a/trunk/arch/s390/lib/delay.c +++ b/trunk/arch/s390/lib/delay.c @@ -11,6 +11,7 @@ * Copyright (C) 1997 Martin Mares */ +#include #include #include diff --git a/trunk/arch/s390/math-emu/math.c b/trunk/arch/s390/math-emu/math.c index b4957c84e4d6..648df7140335 100644 --- a/trunk/arch/s390/math-emu/math.c +++ b/trunk/arch/s390/math-emu/math.c @@ -9,6 +9,7 @@ * that does not have the IEEE fpu (all processors before G5). */ +#include #include #include #include diff --git a/trunk/arch/s390/mm/cmm.c b/trunk/arch/s390/mm/cmm.c index 81be2fec7dc5..51596f429235 100644 --- a/trunk/arch/s390/mm/cmm.c +++ b/trunk/arch/s390/mm/cmm.c @@ -8,6 +8,7 @@ * Collaborative memory management interface. */ +#include #include #include #include diff --git a/trunk/arch/s390/mm/fault.c b/trunk/arch/s390/mm/fault.c index 833d5941746a..81ade401b073 100644 --- a/trunk/arch/s390/mm/fault.c +++ b/trunk/arch/s390/mm/fault.c @@ -10,6 +10,7 @@ * Copyright (C) 1995 Linus Torvalds */ +#include #include #include #include diff --git a/trunk/arch/s390/mm/init.c b/trunk/arch/s390/mm/init.c index eb6ebfef134a..a055894f3bd8 100644 --- a/trunk/arch/s390/mm/init.c +++ b/trunk/arch/s390/mm/init.c @@ -9,6 +9,7 @@ * Copyright (C) 1995 Linus Torvalds */ +#include #include #include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include #include @@ -34,7 +34,6 @@ #include #include #include -#include DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); @@ -91,6 +90,17 @@ void show_mem(void) printk("%d pages swap cached\n",cached); } +/* References to section boundaries */ + +extern unsigned long _text; +extern unsigned long _etext; +extern unsigned long _edata; +extern unsigned long __bss_start; +extern unsigned long _end; + +extern unsigned long __init_begin; +extern unsigned long __init_end; + extern unsigned long __initdata zholes_size[]; /* * paging_init() sets up the page tables @@ -107,10 +117,6 @@ void __init paging_init(void) unsigned long pfn = 0; unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERNSEG_TABLE; static const int ssm_mask = 0x04000000L; - unsigned long ro_start_pfn, ro_end_pfn; - - ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata); - ro_end_pfn = PFN_UP((unsigned long)&__end_rodata); /* unmap whole virtual address space */ @@ -138,10 +144,7 @@ void __init paging_init(void) pg_dir++; for (tmp = 0 ; tmp < PTRS_PER_PTE ; tmp++,pg_table++) { - if (pfn >= ro_start_pfn && pfn < ro_end_pfn) - pte = pfn_pte(pfn, __pgprot(_PAGE_RO)); - else - pte = pfn_pte(pfn, PAGE_KERNEL); + pte = pfn_pte(pfn, PAGE_KERNEL); if (pfn >= max_low_pfn) pte_clear(&init_mm, 0, &pte); set_pte(pg_table, pte); @@ -173,7 +176,6 @@ void __init paging_init(void) } #else /* CONFIG_64BIT */ - void __init paging_init(void) { pgd_t * pg_dir; @@ -185,15 +187,13 @@ void __init paging_init(void) unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERN_REGION_TABLE; static const int ssm_mask = 0x04000000L; + unsigned long zones_size[MAX_NR_ZONES]; unsigned long dma_pfn, high_pfn; - unsigned long ro_start_pfn, ro_end_pfn; memset(zones_size, 0, sizeof(zones_size)); dma_pfn = MAX_DMA_ADDRESS >> PAGE_SHIFT; high_pfn = max_low_pfn; - ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata); - ro_end_pfn = PFN_UP((unsigned long)&__end_rodata); if (dma_pfn > high_pfn) zones_size[ZONE_DMA] = high_pfn; @@ -232,10 +232,7 @@ void __init paging_init(void) pmd_populate_kernel(&init_mm, pm_dir, pt_dir); for (k = 0 ; k < PTRS_PER_PTE ; k++,pt_dir++) { - if (pfn >= ro_start_pfn && pfn < ro_end_pfn) - pte = pfn_pte(pfn, __pgprot(_PAGE_RO)); - else - pte = pfn_pte(pfn, PAGE_KERNEL); + pte = pfn_pte(pfn, PAGE_KERNEL); if (pfn >= max_low_pfn) { pte_clear(&init_mm, 0, &pte); continue; @@ -286,9 +283,6 @@ void __init mem_init(void) reservedpages << (PAGE_SHIFT-10), datasize >>10, initsize >> 10); - printk("Write protected kernel read-only data: %#lx - %#lx\n", - (unsigned long)&__start_rodata, - PFN_ALIGN((unsigned long)&__end_rodata) - 1); } void free_initmem(void) diff --git a/trunk/arch/sh/boards/adx/irq_maskreg.c b/trunk/arch/sh/boards/adx/irq_maskreg.c index 4b2abe5eb165..357fab1bac2b 100644 --- a/trunk/arch/sh/boards/adx/irq_maskreg.c +++ b/trunk/arch/sh/boards/adx/irq_maskreg.c @@ -13,6 +13,7 @@ * Each bit of the register is for masking each interrupt. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/bigsur/io.c b/trunk/arch/sh/boards/bigsur/io.c index 6835381da5fd..a9fde781b21a 100644 --- a/trunk/arch/sh/boards/bigsur/io.c +++ b/trunk/arch/sh/boards/bigsur/io.c @@ -14,6 +14,7 @@ * IO functions for a Hitachi Big Sur Evaluation Board. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/bigsur/irq.c b/trunk/arch/sh/boards/bigsur/irq.c index ac946a2201c7..1d32425782c0 100644 --- a/trunk/arch/sh/boards/bigsur/irq.c +++ b/trunk/arch/sh/boards/bigsur/irq.c @@ -20,6 +20,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/bigsur/led.c b/trunk/arch/sh/boards/bigsur/led.c index 6b08c0e1c453..0a2339c69440 100644 --- a/trunk/arch/sh/boards/bigsur/led.c +++ b/trunk/arch/sh/boards/bigsur/led.c @@ -11,6 +11,7 @@ * This file contains Big Sur specific LED code. */ +#include #include #include diff --git a/trunk/arch/sh/boards/bigsur/setup.c b/trunk/arch/sh/boards/bigsur/setup.c index dfeede9da50f..e69be05195f5 100644 --- a/trunk/arch/sh/boards/bigsur/setup.c +++ b/trunk/arch/sh/boards/bigsur/setup.c @@ -20,6 +20,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/cat68701/setup.c b/trunk/arch/sh/boards/cat68701/setup.c index 90e5175df227..ae8a350ade53 100644 --- a/trunk/arch/sh/boards/cat68701/setup.c +++ b/trunk/arch/sh/boards/cat68701/setup.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/sh/boards/cqreek/setup.c b/trunk/arch/sh/boards/cqreek/setup.c index eff4ed93599f..29b537cd6546 100644 --- a/trunk/arch/sh/boards/cqreek/setup.c +++ b/trunk/arch/sh/boards/cqreek/setup.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/harp/irq.c b/trunk/arch/sh/boards/harp/irq.c index 96bb41c9fc55..701fa55d5297 100644 --- a/trunk/arch/sh/boards/harp/irq.c +++ b/trunk/arch/sh/boards/harp/irq.c @@ -9,6 +9,7 @@ * Bases on the IPR irq system */ +#include #include #include diff --git a/trunk/arch/sh/boards/harp/led.c b/trunk/arch/sh/boards/harp/led.c index aeb7b392b190..76ca4ccac703 100644 --- a/trunk/arch/sh/boards/harp/led.c +++ b/trunk/arch/sh/boards/harp/led.c @@ -9,6 +9,7 @@ * This file contains ST40STB1 HARP and compatible code. */ +#include #include #include diff --git a/trunk/arch/sh/boards/harp/setup.c b/trunk/arch/sh/boards/harp/setup.c index 886e450ab63e..05b01b8f40aa 100644 --- a/trunk/arch/sh/boards/harp/setup.c +++ b/trunk/arch/sh/boards/harp/setup.c @@ -9,6 +9,7 @@ * STMicroelectronics ST40STB1 HARP and compatible support. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/hp6xx/setup.c b/trunk/arch/sh/boards/hp6xx/setup.c index 71f315663cc9..6d94a8e2e67a 100644 --- a/trunk/arch/sh/boards/hp6xx/setup.c +++ b/trunk/arch/sh/boards/hp6xx/setup.c @@ -9,6 +9,7 @@ * Setup code for an HP680 (internal peripherials only) */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/mpc1211/led.c b/trunk/arch/sh/boards/mpc1211/led.c index 1fe36927f691..0a31beec3465 100644 --- a/trunk/arch/sh/boards/mpc1211/led.c +++ b/trunk/arch/sh/boards/mpc1211/led.c @@ -6,6 +6,7 @@ * This file contains Interface MPC-1211 specific LED code. */ +#include static void mach_led(int position, int value) { diff --git a/trunk/arch/sh/boards/mpc1211/pci.c b/trunk/arch/sh/boards/mpc1211/pci.c index 4ed1a95c6d56..9f7ccd33ffb6 100644 --- a/trunk/arch/sh/boards/mpc1211/pci.c +++ b/trunk/arch/sh/boards/mpc1211/pci.c @@ -11,6 +11,7 @@ * License. See linux/COPYING for more information. * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/mpc1211/setup.c b/trunk/arch/sh/boards/mpc1211/setup.c index 2bfb221cc35c..b72f009c52c2 100644 --- a/trunk/arch/sh/boards/mpc1211/setup.c +++ b/trunk/arch/sh/boards/mpc1211/setup.c @@ -5,6 +5,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/overdrive/fpga.c b/trunk/arch/sh/boards/overdrive/fpga.c index 956c23901228..3a1ec9403441 100644 --- a/trunk/arch/sh/boards/overdrive/fpga.c +++ b/trunk/arch/sh/boards/overdrive/fpga.c @@ -10,6 +10,7 @@ */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/overdrive/galileo.c b/trunk/arch/sh/boards/overdrive/galileo.c index 29e48971bba0..b055809d2ac1 100644 --- a/trunk/arch/sh/boards/overdrive/galileo.c +++ b/trunk/arch/sh/boards/overdrive/galileo.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/overdrive/io.c b/trunk/arch/sh/boards/overdrive/io.c index 4671b6b047bb..65f3fd0563d3 100644 --- a/trunk/arch/sh/boards/overdrive/io.c +++ b/trunk/arch/sh/boards/overdrive/io.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/overdrive/irq.c b/trunk/arch/sh/boards/overdrive/irq.c index 5d730c70389e..2c13a7de6b22 100644 --- a/trunk/arch/sh/boards/overdrive/irq.c +++ b/trunk/arch/sh/boards/overdrive/irq.c @@ -9,6 +9,7 @@ * Bases on the IPR irq system */ +#include #include #include diff --git a/trunk/arch/sh/boards/overdrive/led.c b/trunk/arch/sh/boards/overdrive/led.c index 860d7f204a4e..734742e92279 100644 --- a/trunk/arch/sh/boards/overdrive/led.c +++ b/trunk/arch/sh/boards/overdrive/led.c @@ -9,6 +9,7 @@ * This file contains an Overdrive specific LED feature. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/overdrive/setup.c b/trunk/arch/sh/boards/overdrive/setup.c index a3a7744c2047..94f6165d33b8 100644 --- a/trunk/arch/sh/boards/overdrive/setup.c +++ b/trunk/arch/sh/boards/overdrive/setup.c @@ -9,6 +9,7 @@ * STMicroelectronics Overdrive Support. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/renesas/edosk7705/setup.c b/trunk/arch/sh/boards/renesas/edosk7705/setup.c index ba143fa4afaa..8b6f0c2af092 100644 --- a/trunk/arch/sh/boards/renesas/edosk7705/setup.c +++ b/trunk/arch/sh/boards/renesas/edosk7705/setup.c @@ -9,6 +9,7 @@ * board by S. Dunn, 2003. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/renesas/hs7751rvoip/io.c b/trunk/arch/sh/boards/renesas/hs7751rvoip/io.c index 3a1abfa2fefb..456753d2649c 100644 --- a/trunk/arch/sh/boards/renesas/hs7751rvoip/io.c +++ b/trunk/arch/sh/boards/renesas/hs7751rvoip/io.c @@ -11,6 +11,7 @@ * expectation of later SuperIO and PCMCIA access. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/renesas/hs7751rvoip/irq.c b/trunk/arch/sh/boards/renesas/hs7751rvoip/irq.c index 705b7ddcb0d2..52a98b524e1f 100644 --- a/trunk/arch/sh/boards/renesas/hs7751rvoip/irq.c +++ b/trunk/arch/sh/boards/renesas/hs7751rvoip/irq.c @@ -10,6 +10,7 @@ * Lineo uSolutions, Inc. 2003. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/renesas/hs7751rvoip/led.c b/trunk/arch/sh/boards/renesas/hs7751rvoip/led.c index b6608fff9f38..18a13c8da8a4 100644 --- a/trunk/arch/sh/boards/renesas/hs7751rvoip/led.c +++ b/trunk/arch/sh/boards/renesas/hs7751rvoip/led.c @@ -10,6 +10,7 @@ * Lineo uSolutions, Inc. 2003. */ +#include #include #include diff --git a/trunk/arch/sh/boards/renesas/hs7751rvoip/mach.c b/trunk/arch/sh/boards/renesas/hs7751rvoip/mach.c index caf967f77c61..8bbed60220ca 100644 --- a/trunk/arch/sh/boards/renesas/hs7751rvoip/mach.c +++ b/trunk/arch/sh/boards/renesas/hs7751rvoip/mach.c @@ -9,6 +9,7 @@ * Machine vector for the Renesas Technology sales HS7751RVoIP */ +#include #include #include diff --git a/trunk/arch/sh/boards/renesas/hs7751rvoip/pci.c b/trunk/arch/sh/boards/renesas/hs7751rvoip/pci.c index 7e5786b58110..7a442d1eca46 100644 --- a/trunk/arch/sh/boards/renesas/hs7751rvoip/pci.c +++ b/trunk/arch/sh/boards/renesas/hs7751rvoip/pci.c @@ -11,6 +11,7 @@ * PCI initialization for the Renesas SH7751R HS7751RVoIP board */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/renesas/hs7751rvoip/setup.c b/trunk/arch/sh/boards/renesas/hs7751rvoip/setup.c index 29fb5ff70fb5..f1a78b6c714c 100644 --- a/trunk/arch/sh/boards/renesas/hs7751rvoip/setup.c +++ b/trunk/arch/sh/boards/renesas/hs7751rvoip/setup.c @@ -10,6 +10,7 @@ * Lineo uSolutions, Inc. 2003. */ +#include #include #include diff --git a/trunk/arch/sh/boards/renesas/rts7751r2d/irq.c b/trunk/arch/sh/boards/renesas/rts7751r2d/irq.c index 154535440bbf..e16915d9cda4 100644 --- a/trunk/arch/sh/boards/renesas/rts7751r2d/irq.c +++ b/trunk/arch/sh/boards/renesas/rts7751r2d/irq.c @@ -9,6 +9,7 @@ * Atom Create Engineering Co., Ltd. 2002. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/renesas/rts7751r2d/led.c b/trunk/arch/sh/boards/renesas/rts7751r2d/led.c index 4d16de71fac1..9993259a894f 100644 --- a/trunk/arch/sh/boards/renesas/rts7751r2d/led.c +++ b/trunk/arch/sh/boards/renesas/rts7751r2d/led.c @@ -9,6 +9,7 @@ * This file contains Renesas Technology Sales RTS7751R2D specific LED code. */ +#include #include #include diff --git a/trunk/arch/sh/boards/renesas/rts7751r2d/mach.c b/trunk/arch/sh/boards/renesas/rts7751r2d/mach.c index 5ed9e97ea197..610740512d56 100644 --- a/trunk/arch/sh/boards/renesas/rts7751r2d/mach.c +++ b/trunk/arch/sh/boards/renesas/rts7751r2d/mach.c @@ -9,6 +9,7 @@ * Machine vector for the Renesas Technology sales RTS7751R2D */ +#include #include #include diff --git a/trunk/arch/sh/boards/renesas/systemh/irq.c b/trunk/arch/sh/boards/renesas/systemh/irq.c index 8372d967f601..845979181059 100644 --- a/trunk/arch/sh/boards/renesas/systemh/irq.c +++ b/trunk/arch/sh/boards/renesas/systemh/irq.c @@ -9,6 +9,7 @@ * Jonathan Short. */ +#include #include #include diff --git a/trunk/arch/sh/boards/se/7300/io.c b/trunk/arch/sh/boards/se/7300/io.c index f449a94ddffd..3c89def46480 100644 --- a/trunk/arch/sh/boards/se/7300/io.c +++ b/trunk/arch/sh/boards/se/7300/io.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/se/7300/irq.c b/trunk/arch/sh/boards/se/7300/irq.c index 216a78d1a108..96c8c23d6c93 100644 --- a/trunk/arch/sh/boards/se/7300/irq.c +++ b/trunk/arch/sh/boards/se/7300/irq.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/se/7300/led.c b/trunk/arch/sh/boards/se/7300/led.c index ad51f0a9c1e3..02c7f846c84c 100644 --- a/trunk/arch/sh/boards/se/7300/led.c +++ b/trunk/arch/sh/boards/se/7300/led.c @@ -11,6 +11,7 @@ * This file contains Solution Engine specific LED code. */ +#include #include #include diff --git a/trunk/arch/sh/boards/se/7300/setup.c b/trunk/arch/sh/boards/se/7300/setup.c index ebcd98d4c081..08536bc224dc 100644 --- a/trunk/arch/sh/boards/se/7300/setup.c +++ b/trunk/arch/sh/boards/se/7300/setup.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/se/73180/io.c b/trunk/arch/sh/boards/se/73180/io.c index 755df5ac4a4e..73648cbe3678 100644 --- a/trunk/arch/sh/boards/se/73180/io.c +++ b/trunk/arch/sh/boards/se/73180/io.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/se/73180/irq.c b/trunk/arch/sh/boards/se/73180/irq.c index 4344d0ef24aa..402735c7c898 100644 --- a/trunk/arch/sh/boards/se/73180/irq.c +++ b/trunk/arch/sh/boards/se/73180/irq.c @@ -10,6 +10,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/se/73180/led.c b/trunk/arch/sh/boards/se/73180/led.c index 610439fde6ee..1e8f1cf3e10f 100644 --- a/trunk/arch/sh/boards/se/73180/led.c +++ b/trunk/arch/sh/boards/se/73180/led.c @@ -11,6 +11,7 @@ * This file contains Solution Engine specific LED code. */ +#include #include #include diff --git a/trunk/arch/sh/boards/se/73180/setup.c b/trunk/arch/sh/boards/se/73180/setup.c index cdb7b5f8d942..07fa90c38a06 100644 --- a/trunk/arch/sh/boards/se/73180/setup.c +++ b/trunk/arch/sh/boards/se/73180/setup.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/se/770x/irq.c b/trunk/arch/sh/boards/se/770x/irq.c index 3e558716ce10..210897b315f4 100644 --- a/trunk/arch/sh/boards/se/770x/irq.c +++ b/trunk/arch/sh/boards/se/770x/irq.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/se/770x/led.c b/trunk/arch/sh/boards/se/770x/led.c index 3cddbda025fc..5c64e8ab2cfb 100644 --- a/trunk/arch/sh/boards/se/770x/led.c +++ b/trunk/arch/sh/boards/se/770x/led.c @@ -9,6 +9,7 @@ * This file contains Solution Engine specific LED code. */ +#include #include static void mach_led(int position, int value) diff --git a/trunk/arch/sh/boards/se/770x/mach.c b/trunk/arch/sh/boards/se/770x/mach.c index 6ec07bd3dcf1..f9b4c56cc47e 100644 --- a/trunk/arch/sh/boards/se/770x/mach.c +++ b/trunk/arch/sh/boards/se/770x/mach.c @@ -9,6 +9,7 @@ * Machine vector for the Hitachi SolutionEngine */ +#include #include #include diff --git a/trunk/arch/sh/boards/se/770x/setup.c b/trunk/arch/sh/boards/se/770x/setup.c index 7d1a071727cc..2bed46fb607d 100644 --- a/trunk/arch/sh/boards/se/770x/setup.c +++ b/trunk/arch/sh/boards/se/770x/setup.c @@ -8,6 +8,7 @@ * */ +#include #include #include diff --git a/trunk/arch/sh/boards/se/7751/irq.c b/trunk/arch/sh/boards/se/7751/irq.c index bf6c023615df..ad71f3e66c11 100644 --- a/trunk/arch/sh/boards/se/7751/irq.c +++ b/trunk/arch/sh/boards/se/7751/irq.c @@ -9,6 +9,7 @@ * Ian da Silva and Jeremy Siegel, 2001. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/se/7751/led.c b/trunk/arch/sh/boards/se/7751/led.c index a878726d3c7c..0c788230cf8f 100644 --- a/trunk/arch/sh/boards/se/7751/led.c +++ b/trunk/arch/sh/boards/se/7751/led.c @@ -9,6 +9,7 @@ * This file contains Solution Engine specific LED code. */ +#include #include static void mach_led(int position, int value) diff --git a/trunk/arch/sh/boards/se/7751/mach.c b/trunk/arch/sh/boards/se/7751/mach.c index 62d8d3e62590..16d386b7e3bf 100644 --- a/trunk/arch/sh/boards/se/7751/mach.c +++ b/trunk/arch/sh/boards/se/7751/mach.c @@ -9,6 +9,7 @@ * Machine vector for the Hitachi 7751 SolutionEngine */ +#include #include #include diff --git a/trunk/arch/sh/boards/se/7751/pci.c b/trunk/arch/sh/boards/se/7751/pci.c index 3ee03014dea3..1f273efd2cf5 100644 --- a/trunk/arch/sh/boards/se/7751/pci.c +++ b/trunk/arch/sh/boards/se/7751/pci.c @@ -11,6 +11,7 @@ * PCI initialization for the Hitachi SH7751 Solution Engine board (MS7751SE01) */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/se/7751/setup.c b/trunk/arch/sh/boards/se/7751/setup.c index 48dc5aee67d4..9d111bb884f9 100644 --- a/trunk/arch/sh/boards/se/7751/setup.c +++ b/trunk/arch/sh/boards/se/7751/setup.c @@ -9,6 +9,7 @@ * Ian da Silva and Jeremy Siegel, 2001. */ +#include #include #include diff --git a/trunk/arch/sh/boards/sh03/led.c b/trunk/arch/sh/boards/sh03/led.c index d38562ad6be8..c851b0bec80f 100644 --- a/trunk/arch/sh/boards/sh03/led.c +++ b/trunk/arch/sh/boards/sh03/led.c @@ -6,6 +6,7 @@ * This file contains Interface CTP/PCI-SH03 specific LED code. */ +#include #include /* Cycle the LED's in the clasic Knightrider/Sun pattern */ diff --git a/trunk/arch/sh/boards/sh03/setup.c b/trunk/arch/sh/boards/sh03/setup.c index 60290f8f289c..d2a08ca5eb85 100644 --- a/trunk/arch/sh/boards/sh03/setup.c +++ b/trunk/arch/sh/boards/sh03/setup.c @@ -5,6 +5,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/sh2000/setup.c b/trunk/arch/sh/boards/sh2000/setup.c index 2fe6a11765e9..a290b1d09fb2 100644 --- a/trunk/arch/sh/boards/sh2000/setup.c +++ b/trunk/arch/sh/boards/sh2000/setup.c @@ -7,6 +7,7 @@ * */ +#include #include #include diff --git a/trunk/arch/sh/boards/snapgear/setup.c b/trunk/arch/sh/boards/snapgear/setup.c index f1f7c70c9402..08fc98342a0b 100644 --- a/trunk/arch/sh/boards/snapgear/setup.c +++ b/trunk/arch/sh/boards/snapgear/setup.c @@ -14,6 +14,7 @@ */ /****************************************************************************/ +#include #include #include #include @@ -50,7 +51,7 @@ static int __init eraseconfig_init(void) { printk("SnapGear: EraseConfig init\n"); /* Setup "EraseConfig" switch on external IRQ 0 */ - if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED, + if (request_irq(IRL0_IRQ, eraseconfig_interrupt, SA_INTERRUPT, "Erase Config", NULL)) printk("SnapGear: failed to register IRQ%d for Reset witch\n", IRL0_IRQ); diff --git a/trunk/arch/sh/boards/superh/microdev/io.c b/trunk/arch/sh/boards/superh/microdev/io.c index 4836b9422e27..1ed7f880b8c7 100644 --- a/trunk/arch/sh/boards/superh/microdev/io.c +++ b/trunk/arch/sh/boards/superh/microdev/io.c @@ -11,6 +11,7 @@ * License. See linux/COPYING for more information. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/superh/microdev/irq.c b/trunk/arch/sh/boards/superh/microdev/irq.c index 236398fbc083..cb5999425d16 100644 --- a/trunk/arch/sh/boards/superh/microdev/irq.c +++ b/trunk/arch/sh/boards/superh/microdev/irq.c @@ -9,6 +9,7 @@ * License. See linux/COPYING for more information. */ +#include #include #include diff --git a/trunk/arch/sh/boards/superh/microdev/led.c b/trunk/arch/sh/boards/superh/microdev/led.c index a38f5351bd16..52a98e69d3f0 100644 --- a/trunk/arch/sh/boards/superh/microdev/led.c +++ b/trunk/arch/sh/boards/superh/microdev/led.c @@ -9,6 +9,7 @@ * */ +#include #include #define LED_REGISTER 0xa6104d20 diff --git a/trunk/arch/sh/boards/superh/microdev/setup.c b/trunk/arch/sh/boards/superh/microdev/setup.c index 61b402a3f5d7..892b14d31405 100644 --- a/trunk/arch/sh/boards/superh/microdev/setup.c +++ b/trunk/arch/sh/boards/superh/microdev/setup.c @@ -11,6 +11,7 @@ * License. See linux/COPYING for more information. */ +#include #include #include #include diff --git a/trunk/arch/sh/boards/unknown/setup.c b/trunk/arch/sh/boards/unknown/setup.c index c5e4ed10876b..02e84f03f45c 100644 --- a/trunk/arch/sh/boards/unknown/setup.c +++ b/trunk/arch/sh/boards/unknown/setup.c @@ -12,6 +12,7 @@ * method to start debugging a new board during bring-up until proper board * setup code is written. */ +#include #include #include #include diff --git a/trunk/arch/sh/boot/compressed/head.S b/trunk/arch/sh/boot/compressed/head.S index 4c26a192277d..88db04d325fb 100644 --- a/trunk/arch/sh/boot/compressed/head.S +++ b/trunk/arch/sh/boot/compressed/head.S @@ -7,6 +7,7 @@ .text +#include #include .global startup diff --git a/trunk/arch/sh/boot/compressed/misc.c b/trunk/arch/sh/boot/compressed/misc.c index f2fed5ce5cc3..211e9110074f 100644 --- a/trunk/arch/sh/boot/compressed/misc.c +++ b/trunk/arch/sh/boot/compressed/misc.c @@ -11,6 +11,7 @@ * Modified to use standard LinuxSH BIOS by Greg Banks 7Jul2000 */ +#include #include #ifdef CONFIG_SH_STANDARD_BIOS #include diff --git a/trunk/arch/sh/cchips/hd6446x/hd64461/io.c b/trunk/arch/sh/cchips/hd6446x/hd64461/io.c index ac3062671db7..4c062d6b7a97 100644 --- a/trunk/arch/sh/cchips/hd6446x/hd64461/io.c +++ b/trunk/arch/sh/cchips/hd6446x/hd64461/io.c @@ -4,6 +4,7 @@ * Typical I/O routines for HD64461 system. */ +#include #include #include diff --git a/trunk/arch/sh/cchips/hd6446x/hd64461/setup.c b/trunk/arch/sh/cchips/hd6446x/hd64461/setup.c index ad126016720f..724db04cb392 100644 --- a/trunk/arch/sh/cchips/hd6446x/hd64461/setup.c +++ b/trunk/arch/sh/cchips/hd6446x/hd64461/setup.c @@ -4,6 +4,7 @@ * Hitachi HD64461 companion chip support */ +#include #include #include #include @@ -133,7 +134,7 @@ int hd64461_irq_demux(int irq) return __irq_demux(irq); } -static struct irqaction irq0 = { hd64461_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "HD64461", NULL, NULL }; +static struct irqaction irq0 = { hd64461_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "HD64461", NULL, NULL }; int __init setup_hd64461(void) { diff --git a/trunk/arch/sh/cchips/hd6446x/hd64465/gpio.c b/trunk/arch/sh/cchips/hd6446x/hd64465/gpio.c index 72320d02d69a..9785fdef868e 100644 --- a/trunk/arch/sh/cchips/hd6446x/hd64465/gpio.c +++ b/trunk/arch/sh/cchips/hd6446x/hd64465/gpio.c @@ -170,7 +170,7 @@ static int __init hd64465_gpio_init(void) if (!request_region(HD64465_REG_GPACR, 0x1000, MODNAME)) return -EBUSY; if (request_irq(HD64465_IRQ_GPIO, hd64465_gpio_interrupt, - IRQF_DISABLED, MODNAME, 0)) + SA_INTERRUPT, MODNAME, 0)) goto out_irqfailed; printk("HD64465 GPIO layer on irq %d\n", HD64465_IRQ_GPIO); diff --git a/trunk/arch/sh/cchips/hd6446x/hd64465/io.c b/trunk/arch/sh/cchips/hd6446x/hd64465/io.c index 58704d066ae2..84cb142def0b 100644 --- a/trunk/arch/sh/cchips/hd6446x/hd64465/io.c +++ b/trunk/arch/sh/cchips/hd6446x/hd64465/io.c @@ -9,6 +9,7 @@ * Typical I/O routines for HD64465 system. */ +#include #include #include #include diff --git a/trunk/arch/sh/cchips/hd6446x/hd64465/setup.c b/trunk/arch/sh/cchips/hd6446x/hd64465/setup.c index d2b2851bc44b..cf9142c620b7 100644 --- a/trunk/arch/sh/cchips/hd6446x/hd64465/setup.c +++ b/trunk/arch/sh/cchips/hd6446x/hd64465/setup.c @@ -9,6 +9,7 @@ * Copyright (C) 2000 YAEGASHI Takeshi */ +#include #include #include #include @@ -153,7 +154,7 @@ int hd64465_irq_demux(int irq) return irq; } -static struct irqaction irq0 = { hd64465_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "HD64465", NULL, NULL}; +static struct irqaction irq0 = { hd64465_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "HD64465", NULL, NULL}; static int __init setup_hd64465(void) diff --git a/trunk/arch/sh/cchips/voyagergx/irq.c b/trunk/arch/sh/cchips/voyagergx/irq.c index 0dc1fb8f9687..892214bade19 100644 --- a/trunk/arch/sh/cchips/voyagergx/irq.c +++ b/trunk/arch/sh/cchips/voyagergx/irq.c @@ -21,6 +21,7 @@ #undef DEBUG +#include #include #include #include @@ -165,7 +166,7 @@ int voyagergx_irq_demux(int irq) static struct irqaction irq0 = { .name = "voyagergx", .handler = voyagergx_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, }; diff --git a/trunk/arch/sh/drivers/dma/dma-g2.c b/trunk/arch/sh/drivers/dma/dma-g2.c index 0f866f8789f0..5afab6f56ec3 100644 --- a/trunk/arch/sh/drivers/dma/dma-g2.c +++ b/trunk/arch/sh/drivers/dma/dma-g2.c @@ -56,7 +56,7 @@ static irqreturn_t g2_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction g2_dma_irq = { .name = "g2 DMA handler", .handler = g2_dma_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, }; static int g2_enable_dma(struct dma_channel *chan) diff --git a/trunk/arch/sh/drivers/dma/dma-pvr2.c b/trunk/arch/sh/drivers/dma/dma-pvr2.c index 30a580aa7cbd..df604975ccc8 100644 --- a/trunk/arch/sh/drivers/dma/dma-pvr2.c +++ b/trunk/arch/sh/drivers/dma/dma-pvr2.c @@ -70,7 +70,7 @@ static int pvr2_xfer_dma(struct dma_channel *chan) static struct irqaction pvr2_dma_irq = { .name = "pvr2 DMA handler", .handler = pvr2_dma_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, }; static struct dma_ops pvr2_dma_ops = { diff --git a/trunk/arch/sh/drivers/dma/dma-sh.c b/trunk/arch/sh/drivers/dma/dma-sh.c index e028a2d2a4ea..cca26c4c9d1b 100644 --- a/trunk/arch/sh/drivers/dma/dma-sh.c +++ b/trunk/arch/sh/drivers/dma/dma-sh.c @@ -12,6 +12,7 @@ * for more details. */ +#include #include #include #include @@ -90,7 +91,7 @@ static int sh_dmac_request_dma(struct dma_channel *chan) chan->chan); return request_irq(get_dmte_irq(chan->chan), dma_tei, - IRQF_DISABLED, name, chan); + SA_INTERRUPT, name, chan); } static void sh_dmac_free_dma(struct dma_channel *chan) @@ -258,7 +259,7 @@ static int __init sh_dmac_init(void) #ifdef CONFIG_CPU_SH4 make_ipr_irq(DMAE_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY); - i = request_irq(DMAE_IRQ, dma_err, IRQF_DISABLED, "DMAC Address Error", 0); + i = request_irq(DMAE_IRQ, dma_err, SA_INTERRUPT, "DMAC Address Error", 0); if (i < 0) return i; #endif diff --git a/trunk/arch/sh/drivers/pci/dma-dreamcast.c b/trunk/arch/sh/drivers/pci/dma-dreamcast.c index 6acf02b9375b..e12418bb1fa5 100644 --- a/trunk/arch/sh/drivers/pci/dma-dreamcast.c +++ b/trunk/arch/sh/drivers/pci/dma-dreamcast.c @@ -15,6 +15,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/sh/drivers/pci/fixups-dreamcast.c b/trunk/arch/sh/drivers/pci/fixups-dreamcast.c index 63b1c6f4b8d2..cf30e2fa51be 100644 --- a/trunk/arch/sh/drivers/pci/fixups-dreamcast.c +++ b/trunk/arch/sh/drivers/pci/fixups-dreamcast.c @@ -15,6 +15,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/sh/drivers/pci/ops-bigsur.c b/trunk/arch/sh/drivers/pci/ops-bigsur.c index ae82c6ca05e5..9b43da67804b 100644 --- a/trunk/arch/sh/drivers/pci/ops-bigsur.c +++ b/trunk/arch/sh/drivers/pci/ops-bigsur.c @@ -11,6 +11,7 @@ * PCI initialization for the Hitachi Big Sur Evaluation Board */ +#include #include #include #include diff --git a/trunk/arch/sh/drivers/pci/ops-dreamcast.c b/trunk/arch/sh/drivers/pci/ops-dreamcast.c index 23d52791917e..69af80b93e3f 100644 --- a/trunk/arch/sh/drivers/pci/ops-dreamcast.c +++ b/trunk/arch/sh/drivers/pci/ops-dreamcast.c @@ -15,6 +15,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/sh/drivers/pci/ops-rts7751r2d.c b/trunk/arch/sh/drivers/pci/ops-rts7751r2d.c index 83171d10141a..beafa11f4d0c 100644 --- a/trunk/arch/sh/drivers/pci/ops-rts7751r2d.c +++ b/trunk/arch/sh/drivers/pci/ops-rts7751r2d.c @@ -11,6 +11,7 @@ * PCI initialization for the Renesas SH7751R RTS7751R2D board */ +#include #include #include #include diff --git a/trunk/arch/sh/drivers/pci/ops-sh03.c b/trunk/arch/sh/drivers/pci/ops-sh03.c index e58d556e5f94..df2199732348 100644 --- a/trunk/arch/sh/drivers/pci/ops-sh03.c +++ b/trunk/arch/sh/drivers/pci/ops-sh03.c @@ -4,6 +4,7 @@ * PCI initialization for the Interface CTP/PCI-SH03 board */ +#include #include #include #include diff --git a/trunk/arch/sh/drivers/pci/ops-snapgear.c b/trunk/arch/sh/drivers/pci/ops-snapgear.c index 3cbd14dd28fe..6fdb9765c99a 100644 --- a/trunk/arch/sh/drivers/pci/ops-snapgear.c +++ b/trunk/arch/sh/drivers/pci/ops-snapgear.c @@ -13,6 +13,7 @@ * PCI initialization for the SnapGear boards */ +#include #include #include #include diff --git a/trunk/arch/sh/drivers/pci/pci-sh7751.c b/trunk/arch/sh/drivers/pci/pci-sh7751.c index 682f3dae305d..30b14ac7ae5a 100644 --- a/trunk/arch/sh/drivers/pci/pci-sh7751.c +++ b/trunk/arch/sh/drivers/pci/pci-sh7751.c @@ -15,6 +15,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/sh/drivers/pci/pci-st40.c b/trunk/arch/sh/drivers/pci/pci-st40.c index 7c81b8b65bb5..cb6752131156 100644 --- a/trunk/arch/sh/drivers/pci/pci-st40.c +++ b/trunk/arch/sh/drivers/pci/pci-st40.c @@ -7,6 +7,7 @@ * Support functions for the ST40 PCI hardware. */ +#include #include #include #include @@ -447,7 +448,7 @@ static int __init pcibios_init(void) PHYSADDR(memory_end) - PHYSADDR(memory_start)); if (request_irq(ST40PCI_ERR_IRQ, st40_pci_irq, - IRQF_DISABLED, "st40pci", NULL)) { + SA_INTERRUPT, "st40pci", NULL)) { printk(KERN_ERR "st40pci: Cannot hook interrupt\n"); return -EIO; } diff --git a/trunk/arch/sh/kernel/cf-enabler.c b/trunk/arch/sh/kernel/cf-enabler.c index f1f9ab87f0b0..7a3b18faa277 100644 --- a/trunk/arch/sh/kernel/cf-enabler.c +++ b/trunk/arch/sh/kernel/cf-enabler.c @@ -9,6 +9,7 @@ * Enable the CF configuration. */ +#include #include #include diff --git a/trunk/arch/sh/kernel/cpu/irq/ipr.c b/trunk/arch/sh/kernel/cpu/irq/ipr.c index 0f545941fb4f..0373b65c77f9 100644 --- a/trunk/arch/sh/kernel/cpu/irq/ipr.c +++ b/trunk/arch/sh/kernel/cpu/irq/ipr.c @@ -15,6 +15,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/kernel/cpu/irq/pint.c b/trunk/arch/sh/kernel/cpu/irq/pint.c index 80cd8108d36a..714963a25bba 100644 --- a/trunk/arch/sh/kernel/cpu/irq/pint.c +++ b/trunk/arch/sh/kernel/cpu/irq/pint.c @@ -10,6 +10,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/sh/kernel/cpu/sh3/ex.S b/trunk/arch/sh/kernel/cpu/sh3/ex.S index cc04e9e239ff..966c0858b714 100644 --- a/trunk/arch/sh/kernel/cpu/sh3/ex.S +++ b/trunk/arch/sh/kernel/cpu/sh3/ex.S @@ -12,6 +12,7 @@ * */ #include +#include .align 2 .data diff --git a/trunk/arch/sh/kernel/cpu/sh4/ex.S b/trunk/arch/sh/kernel/cpu/sh4/ex.S index 26a27df06505..8221e9d15515 100644 --- a/trunk/arch/sh/kernel/cpu/sh4/ex.S +++ b/trunk/arch/sh/kernel/cpu/sh4/ex.S @@ -12,6 +12,7 @@ * */ #include +#include .align 2 .data diff --git a/trunk/arch/sh/kernel/cpu/sh4/sq.c b/trunk/arch/sh/kernel/cpu/sh4/sq.c index 781dbb11c038..83a4f91bce5a 100644 --- a/trunk/arch/sh/kernel/cpu/sh4/sq.c +++ b/trunk/arch/sh/kernel/cpu/sh4/sq.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/sh/kernel/entry.S b/trunk/arch/sh/kernel/entry.S index 7dfd2ba75f7f..a440d36ee618 100644 --- a/trunk/arch/sh/kernel/entry.S +++ b/trunk/arch/sh/kernel/entry.S @@ -13,6 +13,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/sh/kernel/ptrace.c b/trunk/arch/sh/kernel/ptrace.c index f7eebbde3291..3887b4f6feb2 100644 --- a/trunk/arch/sh/kernel/ptrace.c +++ b/trunk/arch/sh/kernel/ptrace.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh/kernel/relocate_kernel.S b/trunk/arch/sh/kernel/relocate_kernel.S index 8221b37c9773..b0695cffec6e 100644 --- a/trunk/arch/sh/kernel/relocate_kernel.S +++ b/trunk/arch/sh/kernel/relocate_kernel.S @@ -8,6 +8,7 @@ * Version 2. See the file COPYING for more details. */ +#include #include #define PAGE_SIZE 4096 /* must be same value as in */ diff --git a/trunk/arch/sh/kernel/sh_ksyms.c b/trunk/arch/sh/kernel/sh_ksyms.c index 245ed8f945e8..d5d032533a8b 100644 --- a/trunk/arch/sh/kernel/sh_ksyms.c +++ b/trunk/arch/sh/kernel/sh_ksyms.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/sh/kernel/smp.c b/trunk/arch/sh/kernel/smp.c index 6c0fb7c4af11..62c7d1c0ad7b 100644 --- a/trunk/arch/sh/kernel/smp.c +++ b/trunk/arch/sh/kernel/smp.c @@ -10,6 +10,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include diff --git a/trunk/arch/sh/kernel/time.c b/trunk/arch/sh/kernel/time.c index a1589f85499d..314a275c04e0 100644 --- a/trunk/arch/sh/kernel/time.c +++ b/trunk/arch/sh/kernel/time.c @@ -10,6 +10,7 @@ * Copyright (C) 1991, 1992, 1995 Linus Torvalds */ +#include #include #include #include diff --git a/trunk/arch/sh/kernel/timers/timer-tmu.c b/trunk/arch/sh/kernel/timers/timer-tmu.c index d4212add53b2..96a64cb13106 100644 --- a/trunk/arch/sh/kernel/timers/timer-tmu.c +++ b/trunk/arch/sh/kernel/timers/timer-tmu.c @@ -107,7 +107,7 @@ static irqreturn_t tmu_timer_interrupt(int irq, void *dev_id, static struct irqaction tmu_irq = { .name = "timer", .handler = tmu_timer_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .mask = CPU_MASK_NONE, }; diff --git a/trunk/arch/sh/kernel/traps.c b/trunk/arch/sh/kernel/traps.c index d9db1180f770..7eb06719d844 100644 --- a/trunk/arch/sh/kernel/traps.c +++ b/trunk/arch/sh/kernel/traps.c @@ -12,6 +12,7 @@ * 'Traps.c' handles hardware traps and faults after we have saved some * state in 'entry.S'. */ +#include #include #include #include diff --git a/trunk/arch/sh/kernel/vmlinux.lds.S b/trunk/arch/sh/kernel/vmlinux.lds.S index 95fdd9135fcf..51bdc1cf7838 100644 --- a/trunk/arch/sh/kernel/vmlinux.lds.S +++ b/trunk/arch/sh/kernel/vmlinux.lds.S @@ -2,6 +2,7 @@ * ld script to make SuperH Linux kernel * Written by Niibe Yutaka */ +#include #include #ifdef CONFIG_CPU_LITTLE_ENDIAN diff --git a/trunk/arch/sh/lib/memcpy-sh4.S b/trunk/arch/sh/lib/memcpy-sh4.S index db6b736537ad..55f227441f9e 100644 --- a/trunk/arch/sh/lib/memcpy-sh4.S +++ b/trunk/arch/sh/lib/memcpy-sh4.S @@ -8,6 +8,7 @@ * */ #include +#include /* * void *memcpy(void *dst, const void *src, size_t n); diff --git a/trunk/arch/sh/mm/cache-sh4.c b/trunk/arch/sh/mm/cache-sh4.c index 524cea5b47f9..ab833adf28c3 100644 --- a/trunk/arch/sh/mm/cache-sh4.c +++ b/trunk/arch/sh/mm/cache-sh4.c @@ -10,6 +10,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/arch/sh/mm/clear_page.S b/trunk/arch/sh/mm/clear_page.S index 08acead7b2a1..ae58a61f0e66 100644 --- a/trunk/arch/sh/mm/clear_page.S +++ b/trunk/arch/sh/mm/clear_page.S @@ -6,6 +6,7 @@ * Copyright (C) 2001, 2002 Niibe Yutaka * */ +#include #include /* diff --git a/trunk/arch/sh/mm/extable.c b/trunk/arch/sh/mm/extable.c index c1cf4463d09d..505ede7c21bf 100644 --- a/trunk/arch/sh/mm/extable.c +++ b/trunk/arch/sh/mm/extable.c @@ -4,6 +4,7 @@ * linux/arch/i386/mm/extable.c */ +#include #include #include diff --git a/trunk/arch/sh/mm/hugetlbpage.c b/trunk/arch/sh/mm/hugetlbpage.c index 2a85bc15a412..a3568fd51508 100644 --- a/trunk/arch/sh/mm/hugetlbpage.c +++ b/trunk/arch/sh/mm/hugetlbpage.c @@ -8,6 +8,7 @@ * Copyright (C) 2002, 2003 David S. Miller (davem@redhat.com) */ +#include #include #include #include diff --git a/trunk/arch/sh/mm/init.c b/trunk/arch/sh/mm/init.c index 8ea27ca4b700..77b4a838fe10 100644 --- a/trunk/arch/sh/mm/init.c +++ b/trunk/arch/sh/mm/init.c @@ -9,6 +9,7 @@ * Copyright (C) 1995 Linus Torvalds */ +#include #include #include #include diff --git a/trunk/arch/sh/mm/pg-sh4.c b/trunk/arch/sh/mm/pg-sh4.c index c776b60fc250..e5907c7330e5 100644 --- a/trunk/arch/sh/mm/pg-sh4.c +++ b/trunk/arch/sh/mm/pg-sh4.c @@ -6,6 +6,7 @@ * * Released under the terms of the GNU GPL v2.0. */ +#include #include #include #include diff --git a/trunk/arch/sh64/boot/compressed/misc.c b/trunk/arch/sh64/boot/compressed/misc.c index ee7a1b6acb83..89dbf45df3c8 100644 --- a/trunk/arch/sh64/boot/compressed/misc.c +++ b/trunk/arch/sh64/boot/compressed/misc.c @@ -9,6 +9,7 @@ * Adapted for SHmedia from sh by Stuart Menefy, May 2002 */ +#include #include /* cache.c */ diff --git a/trunk/arch/sh64/boot/compressed/vmlinux.lds.S b/trunk/arch/sh64/boot/compressed/vmlinux.lds.S index 59c2ef4aeda5..15a737d9bba8 100644 --- a/trunk/arch/sh64/boot/compressed/vmlinux.lds.S +++ b/trunk/arch/sh64/boot/compressed/vmlinux.lds.S @@ -4,6 +4,7 @@ * Modified by Stuart Menefy from arch/sh/vmlinux.lds.S written by Niibe Yutaka */ +#include #ifdef CONFIG_LITTLE_ENDIAN /* OUTPUT_FORMAT("elf32-sh64l-linux", "elf32-sh64l-linux", "elf32-sh64l-linux") */ diff --git a/trunk/arch/sh64/kernel/alphanum.c b/trunk/arch/sh64/kernel/alphanum.c index 9079d1e94f2b..56d6f9f71524 100644 --- a/trunk/arch/sh64/kernel/alphanum.c +++ b/trunk/arch/sh64/kernel/alphanum.c @@ -9,6 +9,7 @@ * Machine-independent functions for handling 8-digit alphanumeric display * (e.g. Agilent HDSP-253x) */ +#include #include #include diff --git a/trunk/arch/sh64/kernel/dma.c b/trunk/arch/sh64/kernel/dma.c index 32c6f0549bf1..09cd9f4670b5 100644 --- a/trunk/arch/sh64/kernel/dma.c +++ b/trunk/arch/sh64/kernel/dma.c @@ -115,7 +115,7 @@ static irqreturn_t dma_mte(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction irq_dmte = { .handler = dma_mte, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "DMA MTE", }; @@ -152,7 +152,7 @@ static irqreturn_t dma_err(int irq, void *dev_id, struct pt_regs *regs) static struct irqaction irq_derr = { .handler = dma_err, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "DMA Error", }; diff --git a/trunk/arch/sh64/kernel/entry.S b/trunk/arch/sh64/kernel/entry.S index 40d45346248d..2e2cfe20b426 100644 --- a/trunk/arch/sh64/kernel/entry.S +++ b/trunk/arch/sh64/kernel/entry.S @@ -11,6 +11,7 @@ * */ +#include #include #include diff --git a/trunk/arch/sh64/kernel/head.S b/trunk/arch/sh64/kernel/head.S index f3740ddbc471..cc0b628a9ea7 100644 --- a/trunk/arch/sh64/kernel/head.S +++ b/trunk/arch/sh64/kernel/head.S @@ -20,6 +20,7 @@ * Add early SCIF console DTLB mapping. */ +#include #include #include diff --git a/trunk/arch/sh64/kernel/irq.c b/trunk/arch/sh64/kernel/irq.c index e7e07f8749c9..675776a5477e 100644 --- a/trunk/arch/sh64/kernel/irq.c +++ b/trunk/arch/sh64/kernel/irq.c @@ -15,6 +15,7 @@ * Naturally it's not a 1:1 relation, but there are similarities. */ +#include #include #include #include diff --git a/trunk/arch/sh64/kernel/irq_intc.c b/trunk/arch/sh64/kernel/irq_intc.c index 42c07d2e71d9..fa730f5fe2e6 100644 --- a/trunk/arch/sh64/kernel/irq_intc.c +++ b/trunk/arch/sh64/kernel/irq_intc.c @@ -15,6 +15,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh64/kernel/led.c b/trunk/arch/sh64/kernel/led.c index e35d3f667fb4..cf993c4a9fdc 100644 --- a/trunk/arch/sh64/kernel/led.c +++ b/trunk/arch/sh64/kernel/led.c @@ -8,6 +8,7 @@ * * Flash the LEDs */ +#include #include #include diff --git a/trunk/arch/sh64/kernel/pci_sh5.c b/trunk/arch/sh64/kernel/pci_sh5.c index 9dae689b6a9b..6197879e8578 100644 --- a/trunk/arch/sh64/kernel/pci_sh5.c +++ b/trunk/arch/sh64/kernel/pci_sh5.c @@ -9,6 +9,7 @@ * Support functions for the SH5 PCI hardware. */ +#include #include #include #include @@ -473,13 +474,13 @@ static void __init pcibios_size_bridges(void) static int __init pcibios_init(void) { if (request_irq(IRQ_ERR, pcish5_err_irq, - IRQF_DISABLED, "PCI Error",NULL) < 0) { + SA_INTERRUPT, "PCI Error",NULL) < 0) { printk(KERN_ERR "PCISH5: Cannot hook PCI_PERR interrupt\n"); return -EINVAL; } if (request_irq(IRQ_SERR, pcish5_serr_irq, - IRQF_DISABLED, "PCI SERR interrupt", NULL) < 0) { + SA_INTERRUPT, "PCI SERR interrupt", NULL) < 0) { printk(KERN_ERR "PCISH5: Cannot hook PCI_SERR interrupt\n"); return -EINVAL; } diff --git a/trunk/arch/sh64/kernel/process.c b/trunk/arch/sh64/kernel/process.c index dba8e14013b6..1da9c61d6823 100644 --- a/trunk/arch/sh64/kernel/process.c +++ b/trunk/arch/sh64/kernel/process.c @@ -35,6 +35,7 @@ #define __KERNEL_SYSCALLS__ #include +#include #include #include #include diff --git a/trunk/arch/sh64/kernel/ptrace.c b/trunk/arch/sh64/kernel/ptrace.c index 4e95e18b46d9..cd22e9471316 100644 --- a/trunk/arch/sh64/kernel/ptrace.c +++ b/trunk/arch/sh64/kernel/ptrace.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh64/kernel/setup.c b/trunk/arch/sh64/kernel/setup.c index 0359fa647bbc..da98d8dbcf95 100644 --- a/trunk/arch/sh64/kernel/setup.c +++ b/trunk/arch/sh64/kernel/setup.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/sh64/kernel/sh_ksyms.c b/trunk/arch/sh64/kernel/sh_ksyms.c index 6efdfa2c3994..6f3a1c946339 100644 --- a/trunk/arch/sh64/kernel/sh_ksyms.c +++ b/trunk/arch/sh64/kernel/sh_ksyms.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh64/kernel/time.c b/trunk/arch/sh64/kernel/time.c index b8162e59030e..6b8f4d22abc6 100644 --- a/trunk/arch/sh64/kernel/time.c +++ b/trunk/arch/sh64/kernel/time.c @@ -15,6 +15,7 @@ * Copyright (C) 1991, 1992, 1995 Linus Torvalds */ +#include #include #include #include @@ -484,8 +485,8 @@ static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id, return IRQ_HANDLED; } -static struct irqaction irq0 = { timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL}; -static struct irqaction irq1 = { sh64_rtc_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "rtc", NULL, NULL}; +static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL}; +static struct irqaction irq1 = { sh64_rtc_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "rtc", NULL, NULL}; void __init time_init(void) { diff --git a/trunk/arch/sh64/kernel/vmlinux.lds.S b/trunk/arch/sh64/kernel/vmlinux.lds.S index a8fcc3a71585..7d9f7a6339a0 100644 --- a/trunk/arch/sh64/kernel/vmlinux.lds.S +++ b/trunk/arch/sh64/kernel/vmlinux.lds.S @@ -22,6 +22,7 @@ * Remove support for ancient toolchains. */ +#include #include #include #include diff --git a/trunk/arch/sh64/lib/c-checksum.c b/trunk/arch/sh64/lib/c-checksum.c index 53c1cabb3428..a82d8f1a7a64 100644 --- a/trunk/arch/sh64/lib/c-checksum.c +++ b/trunk/arch/sh64/lib/c-checksum.c @@ -7,6 +7,7 @@ #undef DEBUG +#include #include #include #include diff --git a/trunk/arch/sh64/lib/dbg.c b/trunk/arch/sh64/lib/dbg.c index 1326f45f31eb..58087331b8a6 100644 --- a/trunk/arch/sh64/lib/dbg.c +++ b/trunk/arch/sh64/lib/dbg.c @@ -8,6 +8,7 @@ -- Copyright 2004 Richard Curnow (evt_debug etc) -- --------------------------------------------------------------------------*/ +#include #include #include #include diff --git a/trunk/arch/sh64/lib/io.c b/trunk/arch/sh64/lib/io.c index 587baa3dffb9..277e11b10c2b 100644 --- a/trunk/arch/sh64/lib/io.c +++ b/trunk/arch/sh64/lib/io.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/sh64/lib/iomap.c b/trunk/arch/sh64/lib/iomap.c index 5cd3d5e9c762..83c5f0c04958 100644 --- a/trunk/arch/sh64/lib/iomap.c +++ b/trunk/arch/sh64/lib/iomap.c @@ -9,6 +9,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ +#include #include #include diff --git a/trunk/arch/sh64/lib/memcpy.c b/trunk/arch/sh64/lib/memcpy.c index fba436a92bfa..c785d0aa194d 100644 --- a/trunk/arch/sh64/lib/memcpy.c +++ b/trunk/arch/sh64/lib/memcpy.c @@ -6,6 +6,7 @@ * */ +#include #include #include diff --git a/trunk/arch/sh64/lib/udelay.c b/trunk/arch/sh64/lib/udelay.c index 327653914007..dad2f254efee 100644 --- a/trunk/arch/sh64/lib/udelay.c +++ b/trunk/arch/sh64/lib/udelay.c @@ -10,6 +10,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ +#include #include #include diff --git a/trunk/arch/sh64/mach-cayman/iomap.c b/trunk/arch/sh64/mach-cayman/iomap.c index 2d06e9a55137..d6a538c70709 100644 --- a/trunk/arch/sh64/mach-cayman/iomap.c +++ b/trunk/arch/sh64/mach-cayman/iomap.c @@ -9,6 +9,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ +#include #include #include #include diff --git a/trunk/arch/sh64/mach-cayman/irq.c b/trunk/arch/sh64/mach-cayman/irq.c index 228ce61c3515..05eb7cdc26f0 100644 --- a/trunk/arch/sh64/mach-cayman/irq.c +++ b/trunk/arch/sh64/mach-cayman/irq.c @@ -12,6 +12,7 @@ * Copyright (C) 2002 Stuart Menefy */ +#include #include #include #include @@ -44,13 +45,13 @@ static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id, struct pt_regs * static struct irqaction cayman_action_smsc = { .name = "Cayman SMSC Mux", .handler = cayman_interrupt_smsc, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, }; static struct irqaction cayman_action_pci2 = { .name = "Cayman PCI2 Mux", .handler = cayman_interrupt_pci2, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, }; static void enable_cayman_irq(unsigned int irq) diff --git a/trunk/arch/sh64/mach-cayman/setup.c b/trunk/arch/sh64/mach-cayman/setup.c index d84895dda3cd..c793245629ad 100644 --- a/trunk/arch/sh64/mach-cayman/setup.c +++ b/trunk/arch/sh64/mach-cayman/setup.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/sh64/mach-harp/setup.c b/trunk/arch/sh64/mach-harp/setup.c index fcd90afac297..3938a65c4b25 100644 --- a/trunk/arch/sh64/mach-harp/setup.c +++ b/trunk/arch/sh64/mach-harp/setup.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/sh64/mach-romram/setup.c b/trunk/arch/sh64/mach-romram/setup.c index eb98a1640cc1..a9ba03fc5bed 100644 --- a/trunk/arch/sh64/mach-romram/setup.c +++ b/trunk/arch/sh64/mach-romram/setup.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/sh64/mach-sim/setup.c b/trunk/arch/sh64/mach-sim/setup.c index f09400c1ad1b..a68639cb4e5a 100644 --- a/trunk/arch/sh64/mach-sim/setup.c +++ b/trunk/arch/sh64/mach-sim/setup.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/sh64/mm/cache.c b/trunk/arch/sh64/mm/cache.c index 421487cfff4c..c0c1b21350d8 100644 --- a/trunk/arch/sh64/mm/cache.c +++ b/trunk/arch/sh64/mm/cache.c @@ -13,6 +13,7 @@ /****************************************************************************/ +#include #include #include #include diff --git a/trunk/arch/sh64/mm/extable.c b/trunk/arch/sh64/mm/extable.c index a2e6e0563772..9da50e28b3fa 100644 --- a/trunk/arch/sh64/mm/extable.c +++ b/trunk/arch/sh64/mm/extable.c @@ -10,6 +10,7 @@ * * Cloned from the 2.5 SH version.. */ +#include #include #include #include diff --git a/trunk/arch/sh64/mm/hugetlbpage.c b/trunk/arch/sh64/mm/hugetlbpage.c index 187cf01750b8..3d89f2a6c785 100644 --- a/trunk/arch/sh64/mm/hugetlbpage.c +++ b/trunk/arch/sh64/mm/hugetlbpage.c @@ -8,6 +8,7 @@ * Copyright (C) 2002, 2003 David S. Miller (davem@redhat.com) */ +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/asm-offsets.c b/trunk/arch/sparc/kernel/asm-offsets.c index 29d7cfd1c970..1f55231f07de 100644 --- a/trunk/arch/sparc/kernel/asm-offsets.c +++ b/trunk/arch/sparc/kernel/asm-offsets.c @@ -10,6 +10,7 @@ * On sparc, thread_info data is static and TI_XXX offsets are computed by hand. */ +#include #include // #include diff --git a/trunk/arch/sparc/kernel/auxio.c b/trunk/arch/sparc/kernel/auxio.c index 118f3eca373e..d3b3648362c0 100644 --- a/trunk/arch/sparc/kernel/auxio.c +++ b/trunk/arch/sparc/kernel/auxio.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/cpu.c b/trunk/arch/sparc/kernel/cpu.c index 259a559d4cea..d7bfc61d2879 100644 --- a/trunk/arch/sparc/kernel/cpu.c +++ b/trunk/arch/sparc/kernel/cpu.c @@ -4,6 +4,7 @@ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/devices.c b/trunk/arch/sparc/kernel/devices.c index adba9dfee35e..fcb0c049c3fe 100644 --- a/trunk/arch/sparc/kernel/devices.c +++ b/trunk/arch/sparc/kernel/devices.c @@ -7,6 +7,7 @@ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/ebus.c b/trunk/arch/sparc/kernel/ebus.c index 81c0cbd96ff0..a7a4892956c8 100644 --- a/trunk/arch/sparc/kernel/ebus.c +++ b/trunk/arch/sparc/kernel/ebus.c @@ -7,6 +7,7 @@ * Fixes for different platforms by Pete Zaitcev. */ +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/entry.S b/trunk/arch/sparc/kernel/entry.S index a4edff4c3be3..887f6a160c58 100644 --- a/trunk/arch/sparc/kernel/entry.S +++ b/trunk/arch/sparc/kernel/entry.S @@ -8,6 +8,7 @@ * Copyright (C) 1997 Anton Blanchard (anton@progsoc.uts.edu.au) */ +#include #include #include diff --git a/trunk/arch/sparc/kernel/head.S b/trunk/arch/sparc/kernel/head.S index 9a219e8b5ddb..42d3de59d19b 100644 --- a/trunk/arch/sparc/kernel/head.S +++ b/trunk/arch/sparc/kernel/head.S @@ -11,6 +11,7 @@ */ #include +#include #include #include diff --git a/trunk/arch/sparc/kernel/idprom.c b/trunk/arch/sparc/kernel/idprom.c index 3a5bad525394..2e1b0f6e99d4 100644 --- a/trunk/arch/sparc/kernel/idprom.c +++ b/trunk/arch/sparc/kernel/idprom.c @@ -5,6 +5,7 @@ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/irq.c b/trunk/arch/sparc/kernel/irq.c index cde73327ca96..aac8af5aae51 100644 --- a/trunk/arch/sparc/kernel/irq.c +++ b/trunk/arch/sparc/kernel/irq.c @@ -11,6 +11,7 @@ * Copyright (C) 1998-2000 Anton Blanchard (anton@samba.org) */ +#include #include #include #include @@ -191,11 +192,11 @@ int show_interrupts(struct seq_file *p, void *v) } #endif seq_printf(p, " %c %s", - (action->flags & IRQF_DISABLED) ? '+' : ' ', + (action->flags & SA_INTERRUPT) ? '+' : ' ', action->name); for (action=action->next; action; action = action->next) { seq_printf(p, ",%s %s", - (action->flags & IRQF_DISABLED) ? " +" : "", + (action->flags & SA_INTERRUPT) ? " +" : "", action->name); } seq_putc(p, '\n'); @@ -243,7 +244,7 @@ void free_irq(unsigned int irq, void *dev_id) printk("Trying to free free shared IRQ%d\n",irq); goto out_unlock; } - } else if (action->flags & IRQF_SHARED) { + } else if (action->flags & SA_SHIRQ) { printk("Trying to free shared IRQ%d with NULL device ID\n", irq); goto out_unlock; } @@ -395,9 +396,9 @@ int request_fast_irq(unsigned int irq, action = sparc_irq[cpu_irq].action; if(action) { - if(action->flags & IRQF_SHARED) + if(action->flags & SA_SHIRQ) panic("Trying to register fast irq when already shared.\n"); - if(irqflags & IRQF_SHARED) + if(irqflags & SA_SHIRQ) panic("Trying to register fast irq as shared.\n"); /* Anyway, someone already owns it so cannot be made fast. */ @@ -497,11 +498,11 @@ int request_irq(unsigned int irq, actionp = &sparc_irq[cpu_irq].action; action = *actionp; if (action) { - if (!(action->flags & IRQF_SHARED) || !(irqflags & IRQF_SHARED)) { + if (!(action->flags & SA_SHIRQ) || !(irqflags & SA_SHIRQ)) { ret = -EBUSY; goto out_unlock; } - if ((action->flags & IRQF_DISABLED) != (irqflags & IRQF_DISABLED)) { + if ((action->flags & SA_INTERRUPT) != (irqflags & SA_INTERRUPT)) { printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq); ret = -EBUSY; goto out_unlock; diff --git a/trunk/arch/sparc/kernel/pcic.c b/trunk/arch/sparc/kernel/pcic.c index bfd31aac2df3..5df3ebdc0ab1 100644 --- a/trunk/arch/sparc/kernel/pcic.c +++ b/trunk/arch/sparc/kernel/pcic.c @@ -10,6 +10,7 @@ * CP-1200 by Eric Brower. */ +#include #include #include #include @@ -745,7 +746,7 @@ void __init pci_time_init(void) writel (PCI_COUNTER_IRQ_SET(timer_irq, 0), pcic->pcic_regs+PCI_COUNTER_IRQ); irq = request_irq(timer_irq, pcic_timer_handler, - (IRQF_DISABLED | SA_STATIC_ALLOC), "timer", NULL); + (SA_INTERRUPT | SA_STATIC_ALLOC), "timer", NULL); if (irq) { prom_printf("time_init: unable to attach IRQ%d\n", timer_irq); prom_halt(); diff --git a/trunk/arch/sparc/kernel/process.c b/trunk/arch/sparc/kernel/process.c index 89a28cc018c9..118cac84a0f5 100644 --- a/trunk/arch/sparc/kernel/process.c +++ b/trunk/arch/sparc/kernel/process.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/setup.c b/trunk/arch/sparc/kernel/setup.c index 8606ef4e52e9..2e5d08ce217b 100644 --- a/trunk/arch/sparc/kernel/setup.c +++ b/trunk/arch/sparc/kernel/setup.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/signal.c b/trunk/arch/sparc/kernel/signal.c index c9301b9143ca..0748d8147bbf 100644 --- a/trunk/arch/sparc/kernel/signal.c +++ b/trunk/arch/sparc/kernel/signal.c @@ -7,6 +7,7 @@ * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) */ +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/sparc_ksyms.c b/trunk/arch/sparc/kernel/sparc_ksyms.c index 5fb987fc3d63..fd7deabf9982 100644 --- a/trunk/arch/sparc/kernel/sparc_ksyms.c +++ b/trunk/arch/sparc/kernel/sparc_ksyms.c @@ -9,6 +9,7 @@ #define EXPORT_SYMTAB_STROPS #define PROMLIB_INTERNAL +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/sun4c_irq.c b/trunk/arch/sparc/kernel/sun4c_irq.c index 4be2c86ea540..0f2d8d9cbdba 100644 --- a/trunk/arch/sparc/kernel/sun4c_irq.c +++ b/trunk/arch/sparc/kernel/sun4c_irq.c @@ -9,6 +9,7 @@ * Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk) */ +#include #include #include #include @@ -179,7 +180,7 @@ static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, stru irq = request_irq(TIMER_IRQ, counter_fn, - (IRQF_DISABLED | SA_STATIC_ALLOC), + (SA_INTERRUPT | SA_STATIC_ALLOC), "timer", NULL); if (irq) { prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ); diff --git a/trunk/arch/sparc/kernel/sun4d_irq.c b/trunk/arch/sparc/kernel/sun4d_irq.c index 74eed9775ac0..9c30e35c88f7 100644 --- a/trunk/arch/sparc/kernel/sun4d_irq.c +++ b/trunk/arch/sparc/kernel/sun4d_irq.c @@ -6,6 +6,7 @@ * Heavily based on arch/sparc/kernel/irq.c. */ +#include #include #include #include @@ -107,13 +108,13 @@ found_it: seq_printf(p, "%3d: ", i); kstat_cpu(cpu_logical_map(x)).irqs[i]); #endif seq_printf(p, "%c %s", - (action->flags & IRQF_DISABLED) ? '+' : ' ', + (action->flags & SA_INTERRUPT) ? '+' : ' ', action->name); action = action->next; for (;;) { for (; action; action = action->next) { seq_printf(p, ",%s %s", - (action->flags & IRQF_DISABLED) ? " +" : "", + (action->flags & SA_INTERRUPT) ? " +" : "", action->name); } if (!sbusl) break; @@ -160,7 +161,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id) printk("Trying to free free shared IRQ%d\n",irq); goto out_unlock; } - } else if (action->flags & IRQF_SHARED) { + } else if (action->flags & SA_SHIRQ) { printk("Trying to free shared IRQ%d with NULL device ID\n", irq); goto out_unlock; } @@ -298,13 +299,13 @@ int sun4d_request_irq(unsigned int irq, action = *actionp; if (action) { - if ((action->flags & IRQF_SHARED) && (irqflags & IRQF_SHARED)) { + if ((action->flags & SA_SHIRQ) && (irqflags & SA_SHIRQ)) { for (tmp = action; tmp->next; tmp = tmp->next); } else { ret = -EBUSY; goto out_unlock; } - if ((action->flags & IRQF_DISABLED) ^ (irqflags & IRQF_DISABLED)) { + if ((action->flags & SA_INTERRUPT) ^ (irqflags & SA_INTERRUPT)) { printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq); ret = -EBUSY; goto out_unlock; @@ -490,7 +491,7 @@ static void __init sun4d_init_timers(irqreturn_t (*counter_fn)(int, void *, stru irq = request_irq(TIMER_IRQ, counter_fn, - (IRQF_DISABLED | SA_STATIC_ALLOC), + (SA_INTERRUPT | SA_STATIC_ALLOC), "timer", NULL); if (irq) { prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ); diff --git a/trunk/arch/sparc/kernel/sun4m_irq.c b/trunk/arch/sparc/kernel/sun4m_irq.c index 7cefa301efea..a296c13ac18f 100644 --- a/trunk/arch/sparc/kernel/sun4m_irq.c +++ b/trunk/arch/sparc/kernel/sun4m_irq.c @@ -9,6 +9,7 @@ * Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk) */ +#include #include #include #include @@ -278,7 +279,7 @@ static void __init sun4m_init_timers(irqreturn_t (*counter_fn)(int, void *, stru irq = request_irq(TIMER_IRQ, counter_fn, - (IRQF_DISABLED | SA_STATIC_ALLOC), + (SA_INTERRUPT | SA_STATIC_ALLOC), "timer", NULL); if (irq) { prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ); diff --git a/trunk/arch/sparc/kernel/sys_solaris.c b/trunk/arch/sparc/kernel/sys_solaris.c index c09afd96dd9c..fb7578554c78 100644 --- a/trunk/arch/sparc/kernel/sys_solaris.c +++ b/trunk/arch/sparc/kernel/sys_solaris.c @@ -4,6 +4,7 @@ * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) */ +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/sys_sunos.c b/trunk/arch/sparc/kernel/sys_sunos.c index aa0fb2efb615..288de276d9ff 100644 --- a/trunk/arch/sparc/kernel/sys_sunos.c +++ b/trunk/arch/sparc/kernel/sys_sunos.c @@ -196,7 +196,7 @@ asmlinkage int sunos_brk(unsigned long brk) * simple, it hopefully works in most obvious cases.. Easy to * fool it, but this should catch most mistakes. */ - freepages = global_page_state(NR_FILE_PAGES); + freepages = get_page_cache_size(); freepages >>= 1; freepages += nr_free_pages(); freepages += nr_swap_pages; diff --git a/trunk/arch/sparc/kernel/systbls.S b/trunk/arch/sparc/kernel/systbls.S index 10df38eeae08..2856551bddf1 100644 --- a/trunk/arch/sparc/kernel/systbls.S +++ b/trunk/arch/sparc/kernel/systbls.S @@ -9,6 +9,7 @@ * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu) */ +#include .data .align 4 diff --git a/trunk/arch/sparc/kernel/tick14.c b/trunk/arch/sparc/kernel/tick14.c index d3b4daac705f..591547af4c65 100644 --- a/trunk/arch/sparc/kernel/tick14.c +++ b/trunk/arch/sparc/kernel/tick14.c @@ -74,7 +74,7 @@ void claim_ticker14(irqreturn_t (*handler)(int, void *, struct pt_regs *), if (!request_irq(irq_nr, handler, - (IRQF_DISABLED | SA_STATIC_ALLOC), + (SA_INTERRUPT | SA_STATIC_ALLOC), "counter14", NULL)) { install_linux_ticker(); diff --git a/trunk/arch/sparc/kernel/time.c b/trunk/arch/sparc/kernel/time.c index 04eb1eab6e3e..9631e8f4ae60 100644 --- a/trunk/arch/sparc/kernel/time.c +++ b/trunk/arch/sparc/kernel/time.c @@ -15,6 +15,7 @@ * 1997-09-10 Updated NTP code according to technical memorandum Jan '96 * "A Kernel Model for Precision Timekeeping" by Dave Mills */ +#include #include #include #include diff --git a/trunk/arch/sparc/kernel/traps.c b/trunk/arch/sparc/kernel/traps.c index 6a70d215fd04..41d45c298fb2 100644 --- a/trunk/arch/sparc/kernel/traps.c +++ b/trunk/arch/sparc/kernel/traps.c @@ -9,6 +9,7 @@ * I hate traps on the sparc, grrr... */ +#include #include /* for jiffies */ #include #include diff --git a/trunk/arch/sparc/lib/atomic.S b/trunk/arch/sparc/lib/atomic.S index 178cbb8ae1b9..f48ad0c4dadb 100644 --- a/trunk/arch/sparc/lib/atomic.S +++ b/trunk/arch/sparc/lib/atomic.S @@ -3,6 +3,7 @@ * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu) */ +#include #include #include diff --git a/trunk/arch/sparc/lib/bitops.S b/trunk/arch/sparc/lib/bitops.S index cb7fb66a40c8..3e9399769075 100644 --- a/trunk/arch/sparc/lib/bitops.S +++ b/trunk/arch/sparc/lib/bitops.S @@ -3,6 +3,7 @@ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include diff --git a/trunk/arch/sparc/lib/rwsem.S b/trunk/arch/sparc/lib/rwsem.S index 20657744c864..e7578dc600b8 100644 --- a/trunk/arch/sparc/lib/rwsem.S +++ b/trunk/arch/sparc/lib/rwsem.S @@ -4,6 +4,7 @@ * Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com) */ +#include #include #include diff --git a/trunk/arch/sparc/mm/btfixup.c b/trunk/arch/sparc/mm/btfixup.c index ec4231c2855a..f147a44c9780 100644 --- a/trunk/arch/sparc/mm/btfixup.c +++ b/trunk/arch/sparc/mm/btfixup.c @@ -6,6 +6,7 @@ * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include #include diff --git a/trunk/arch/sparc/mm/extable.c b/trunk/arch/sparc/mm/extable.c index 16cc28935e39..c9845c71f426 100644 --- a/trunk/arch/sparc/mm/extable.c +++ b/trunk/arch/sparc/mm/extable.c @@ -2,6 +2,7 @@ * linux/arch/sparc/mm/extable.c */ +#include #include #include diff --git a/trunk/arch/sparc/mm/hypersparc.S b/trunk/arch/sparc/mm/hypersparc.S index d29cc24c5bba..a231cca37216 100644 --- a/trunk/arch/sparc/mm/hypersparc.S +++ b/trunk/arch/sparc/mm/hypersparc.S @@ -10,6 +10,7 @@ #include #include #include +#include #include .text diff --git a/trunk/arch/sparc/mm/init.c b/trunk/arch/sparc/mm/init.c index c85ddf312747..cfa7d3456634 100644 --- a/trunk/arch/sparc/mm/init.c +++ b/trunk/arch/sparc/mm/init.c @@ -7,6 +7,7 @@ * Copyright (C) 2000 Anton Blanchard (anton@samba.org) */ +#include #include #include #include diff --git a/trunk/arch/sparc/mm/io-unit.c b/trunk/arch/sparc/mm/io-unit.c index 42c1c700c0a7..eefffa1dc5de 100644 --- a/trunk/arch/sparc/mm/io-unit.c +++ b/trunk/arch/sparc/mm/io-unit.c @@ -4,6 +4,7 @@ * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include #include diff --git a/trunk/arch/sparc/mm/iommu.c b/trunk/arch/sparc/mm/iommu.c index be042efd1ba4..7215849db392 100644 --- a/trunk/arch/sparc/mm/iommu.c +++ b/trunk/arch/sparc/mm/iommu.c @@ -7,6 +7,7 @@ * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include #include diff --git a/trunk/arch/sparc/mm/srmmu.c b/trunk/arch/sparc/mm/srmmu.c index 16e13f663ab0..58c65cc8d0d3 100644 --- a/trunk/arch/sparc/mm/srmmu.c +++ b/trunk/arch/sparc/mm/srmmu.c @@ -8,6 +8,7 @@ * Copyright (C) 1999,2000 Anton Blanchard (anton@samba.org) */ +#include #include #include #include diff --git a/trunk/arch/sparc/mm/sun4c.c b/trunk/arch/sparc/mm/sun4c.c index 7fdddf3c7e16..49f28c1bdc6d 100644 --- a/trunk/arch/sparc/mm/sun4c.c +++ b/trunk/arch/sparc/mm/sun4c.c @@ -10,6 +10,7 @@ #define NR_TASK_BUCKETS 512 +#include #include #include #include diff --git a/trunk/arch/sparc/mm/swift.S b/trunk/arch/sparc/mm/swift.S index 9f4cd396a0fa..cd90f3fdc4e7 100644 --- a/trunk/arch/sparc/mm/swift.S +++ b/trunk/arch/sparc/mm/swift.S @@ -4,6 +4,7 @@ * Copyright (C) 1999 David S. Miller (davem@redhat.com) */ +#include #include #include #include diff --git a/trunk/arch/sparc/mm/tsunami.S b/trunk/arch/sparc/mm/tsunami.S index 4988e6a310bb..697af617594a 100644 --- a/trunk/arch/sparc/mm/tsunami.S +++ b/trunk/arch/sparc/mm/tsunami.S @@ -4,6 +4,7 @@ * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include #include diff --git a/trunk/arch/sparc/mm/viking.S b/trunk/arch/sparc/mm/viking.S index 754c622548a5..3cbd6de18dde 100644 --- a/trunk/arch/sparc/mm/viking.S +++ b/trunk/arch/sparc/mm/viking.S @@ -6,6 +6,7 @@ * Copyright (C) 1999 Pavel Semerad (semerad@ss1000.ms.mff.cuni.cz) */ +#include #include #include #include diff --git a/trunk/arch/sparc/prom/init.c b/trunk/arch/sparc/prom/init.c index 50abfb1b880e..b83409c81916 100644 --- a/trunk/arch/sparc/prom/init.c +++ b/trunk/arch/sparc/prom/init.c @@ -6,6 +6,7 @@ * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include diff --git a/trunk/arch/sparc/prom/memory.c b/trunk/arch/sparc/prom/memory.c index b0c0f9c4fc14..c20e5309f8aa 100644 --- a/trunk/arch/sparc/prom/memory.c +++ b/trunk/arch/sparc/prom/memory.c @@ -6,6 +6,7 @@ * Copyright (C) 1997 Michael A. Griffith (grif@acm.org) */ +#include #include #include diff --git a/trunk/arch/sparc/prom/misc.c b/trunk/arch/sparc/prom/misc.c index 1942c7c05cb1..c840c2062342 100644 --- a/trunk/arch/sparc/prom/misc.c +++ b/trunk/arch/sparc/prom/misc.c @@ -5,6 +5,7 @@ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/binfmt_elf32.c b/trunk/arch/sparc64/kernel/binfmt_elf32.c index a98f3ae175a3..8a2abcce2737 100644 --- a/trunk/arch/sparc64/kernel/binfmt_elf32.c +++ b/trunk/arch/sparc64/kernel/binfmt_elf32.c @@ -84,6 +84,7 @@ typedef struct { #include #include +#include #include #include diff --git a/trunk/arch/sparc64/kernel/cpu.c b/trunk/arch/sparc64/kernel/cpu.c index 7eb81d3954d9..11cc0caef592 100644 --- a/trunk/arch/sparc64/kernel/cpu.c +++ b/trunk/arch/sparc64/kernel/cpu.c @@ -4,6 +4,7 @@ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/devices.c b/trunk/arch/sparc64/kernel/devices.c index f8ef2f2b9b37..389301c95cb2 100644 --- a/trunk/arch/sparc64/kernel/devices.c +++ b/trunk/arch/sparc64/kernel/devices.c @@ -4,6 +4,7 @@ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include #include @@ -20,6 +21,8 @@ #include #include #include +#include +#include /* Used to synchronize acceses to NatSemi SUPER I/O chip configure * operations in asm/ns87303.h @@ -29,6 +32,100 @@ DEFINE_SPINLOCK(ns87303_lock); extern void cpu_probe(void); extern void central_probe(void); +u32 sun4v_vdev_devhandle; +struct device_node *sun4v_vdev_root; + +struct vdev_intmap { + unsigned int phys; + unsigned int irq; + unsigned int cnode; + unsigned int cinterrupt; +}; + +struct vdev_intmask { + unsigned int phys; + unsigned int interrupt; + unsigned int __unused; +}; + +static struct vdev_intmap *vdev_intmap; +static int vdev_num_intmap; +static struct vdev_intmask *vdev_intmask; + +static void __init sun4v_virtual_device_probe(void) +{ + struct linux_prom64_registers *regs; + struct property *prop; + struct device_node *dp; + int sz; + + if (tlb_type != hypervisor) + return; + + dp = of_find_node_by_name(NULL, "virtual-devices"); + if (!dp) { + prom_printf("SUN4V: Fatal error, no virtual-devices node.\n"); + prom_halt(); + } + + sun4v_vdev_root = dp; + + prop = of_find_property(dp, "reg", NULL); + regs = prop->value; + sun4v_vdev_devhandle = (regs[0].phys_addr >> 32UL) & 0x0fffffff; + + prop = of_find_property(dp, "interrupt-map", &sz); + vdev_intmap = prop->value; + vdev_num_intmap = sz / sizeof(struct vdev_intmap); + + prop = of_find_property(dp, "interrupt-map-mask", NULL); + vdev_intmask = prop->value; + + printk("%s: Virtual Device Bus devhandle[%x]\n", + dp->full_name, sun4v_vdev_devhandle); +} + +unsigned int sun4v_vdev_device_interrupt(struct device_node *dev_node) +{ + struct property *prop; + unsigned int irq, reg; + int i; + + prop = of_find_property(dev_node, "interrupts", NULL); + if (!prop) { + printk("VDEV: Cannot get \"interrupts\" " + "property for OBP node %s\n", + dev_node->full_name); + return 0; + } + irq = *(unsigned int *) prop->value; + + prop = of_find_property(dev_node, "reg", NULL); + if (!prop) { + printk("VDEV: Cannot get \"reg\" " + "property for OBP node %s\n", + dev_node->full_name); + return 0; + } + reg = *(unsigned int *) prop->value; + + for (i = 0; i < vdev_num_intmap; i++) { + if (vdev_intmap[i].phys == (reg & vdev_intmask->phys) && + vdev_intmap[i].irq == (irq & vdev_intmask->interrupt)) { + irq = vdev_intmap[i].cinterrupt; + break; + } + } + + if (i == vdev_num_intmap) { + printk("VDEV: No matching interrupt map entry " + "for OBP node %s\n", dev_node->full_name); + return 0; + } + + return sun4v_build_irq(sun4v_vdev_devhandle, irq); +} + static const char *cpu_mid_prop(void) { if (tlb_type == spitfire) @@ -193,6 +290,7 @@ void __init device_scan(void) } #endif + sun4v_virtual_device_probe(); central_probe(); cpu_probe(); diff --git a/trunk/arch/sparc64/kernel/ebus.c b/trunk/arch/sparc64/kernel/ebus.c index 8a9b470e1b65..aac014d15ad3 100644 --- a/trunk/arch/sparc64/kernel/ebus.c +++ b/trunk/arch/sparc64/kernel/ebus.c @@ -5,6 +5,7 @@ * Copyright (C) 1999 David S. Miller (davem@redhat.com) */ +#include #include #include #include @@ -140,7 +141,7 @@ int ebus_dma_irq_enable(struct ebus_dma_info *p, int on) if (on) { if (p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) { - if (request_irq(p->irq, ebus_dma_irq, IRQF_SHARED, p->name, p)) + if (request_irq(p->irq, ebus_dma_irq, SA_SHIRQ, p->name, p)) return -EBUSY; } diff --git a/trunk/arch/sparc64/kernel/entry.S b/trunk/arch/sparc64/kernel/entry.S index 0aaa35fc5a9c..be85ce2a4ad9 100644 --- a/trunk/arch/sparc64/kernel/entry.S +++ b/trunk/arch/sparc64/kernel/entry.S @@ -7,6 +7,7 @@ * Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include diff --git a/trunk/arch/sparc64/kernel/etrap.S b/trunk/arch/sparc64/kernel/etrap.S index 4b2bf9eb447a..149383835c25 100644 --- a/trunk/arch/sparc64/kernel/etrap.S +++ b/trunk/arch/sparc64/kernel/etrap.S @@ -5,6 +5,7 @@ * Copyright (C) 1997, 1998, 1999 Jakub Jelinek (jj@ultra.linux.cz) */ +#include #include #include diff --git a/trunk/arch/sparc64/kernel/head.S b/trunk/arch/sparc64/kernel/head.S index 75684b56767e..31c5892f5acc 100644 --- a/trunk/arch/sparc64/kernel/head.S +++ b/trunk/arch/sparc64/kernel/head.S @@ -7,6 +7,7 @@ * Copyright (C) 1997 Miguel de Icaza (miguel@nuclecu.unam.mx) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/irq.c b/trunk/arch/sparc64/kernel/irq.c index 4e64724cb9ae..eebe02f3f4cb 100644 --- a/trunk/arch/sparc64/kernel/irq.c +++ b/trunk/arch/sparc64/kernel/irq.c @@ -6,6 +6,7 @@ * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/kprobes.c b/trunk/arch/sparc64/kernel/kprobes.c index 8e75ed762fd8..2e1c824c1cc9 100644 --- a/trunk/arch/sparc64/kernel/kprobes.c +++ b/trunk/arch/sparc64/kernel/kprobes.c @@ -3,6 +3,7 @@ * Copyright (C) 2004 David S. Miller */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/ktlb.S b/trunk/arch/sparc64/kernel/ktlb.S index e492db845ea3..31da1e564c95 100644 --- a/trunk/arch/sparc64/kernel/ktlb.S +++ b/trunk/arch/sparc64/kernel/ktlb.S @@ -6,6 +6,7 @@ * Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/of_device.c b/trunk/arch/sparc64/kernel/of_device.c index 169b017eec0b..3670dc8a7d5f 100644 --- a/trunk/arch/sparc64/kernel/of_device.c +++ b/trunk/arch/sparc64/kernel/of_device.c @@ -602,9 +602,6 @@ static void __init build_device_resources(struct of_device *op, build_res: memset(r, 0, sizeof(*r)); if (result != OF_BAD_ADDR) { - if (tlb_type == hypervisor) - result &= 0x0fffffffffffffffUL; - r->start = result; r->end = result + size - 1; r->flags = flags; diff --git a/trunk/arch/sparc64/kernel/pci.c b/trunk/arch/sparc64/kernel/pci.c index e02f01b644af..04ea6c2eb7a1 100644 --- a/trunk/arch/sparc64/kernel/pci.c +++ b/trunk/arch/sparc64/kernel/pci.c @@ -6,6 +6,7 @@ * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/pci_psycho.c b/trunk/arch/sparc64/kernel/pci_psycho.c index 197a7ffd57ee..bf7b32b36705 100644 --- a/trunk/arch/sparc64/kernel/pci_psycho.c +++ b/trunk/arch/sparc64/kernel/pci_psycho.c @@ -863,11 +863,11 @@ static void psycho_register_error_handlers(struct pci_controller_info *p) if (op->num_irqs < 6) return; - request_irq(op->irqs[1], psycho_ue_intr, IRQF_SHARED, "PSYCHO UE", p); - request_irq(op->irqs[2], psycho_ce_intr, IRQF_SHARED, "PSYCHO CE", p); - request_irq(op->irqs[5], psycho_pcierr_intr, IRQF_SHARED, + request_irq(op->irqs[1], psycho_ue_intr, SA_SHIRQ, "PSYCHO UE", p); + request_irq(op->irqs[2], psycho_ce_intr, SA_SHIRQ, "PSYCHO CE", p); + request_irq(op->irqs[5], psycho_pcierr_intr, SA_SHIRQ, "PSYCHO PCIERR-A", &p->pbm_A); - request_irq(op->irqs[0], psycho_pcierr_intr, IRQF_SHARED, + request_irq(op->irqs[0], psycho_pcierr_intr, SA_SHIRQ, "PSYCHO PCIERR-B", &p->pbm_B); /* Enable UE and CE interrupts for controller. */ diff --git a/trunk/arch/sparc64/kernel/pci_sabre.c b/trunk/arch/sparc64/kernel/pci_sabre.c index 45891850b90d..5e087b0fb4c9 100644 --- a/trunk/arch/sparc64/kernel/pci_sabre.c +++ b/trunk/arch/sparc64/kernel/pci_sabre.c @@ -854,14 +854,14 @@ static void sabre_register_error_handlers(struct pci_controller_info *p) SABRE_UEAFSR_SDRD | SABRE_UEAFSR_SDWR | SABRE_UEAFSR_SDTE | SABRE_UEAFSR_PDTE)); - request_irq(op->irqs[1], sabre_ue_intr, IRQF_SHARED, "SABRE UE", p); + request_irq(op->irqs[1], sabre_ue_intr, SA_SHIRQ, "SABRE UE", p); sabre_write(base + SABRE_CE_AFSR, (SABRE_CEAFSR_PDRD | SABRE_CEAFSR_PDWR | SABRE_CEAFSR_SDRD | SABRE_CEAFSR_SDWR)); - request_irq(op->irqs[2], sabre_ce_intr, IRQF_SHARED, "SABRE CE", p); - request_irq(op->irqs[0], sabre_pcierr_intr, IRQF_SHARED, + request_irq(op->irqs[2], sabre_ce_intr, SA_SHIRQ, "SABRE CE", p); + request_irq(op->irqs[0], sabre_pcierr_intr, SA_SHIRQ, "SABRE PCIERR", p); tmp = sabre_read(base + SABRE_PCICTRL); diff --git a/trunk/arch/sparc64/kernel/pci_schizo.c b/trunk/arch/sparc64/kernel/pci_schizo.c index 75ade83ecc65..5c6e2a9b91f8 100644 --- a/trunk/arch/sparc64/kernel/pci_schizo.c +++ b/trunk/arch/sparc64/kernel/pci_schizo.c @@ -998,32 +998,32 @@ static void tomatillo_register_error_handlers(struct pci_controller_info *p) pbm = pbm_for_ino(p, SCHIZO_UE_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[1], schizo_ue_intr, IRQF_SHARED, + request_irq(op->irqs[1], schizo_ue_intr, SA_SHIRQ, "TOMATILLO_UE", p); pbm = pbm_for_ino(p, SCHIZO_CE_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[2], schizo_ce_intr, IRQF_SHARED, + request_irq(op->irqs[2], schizo_ce_intr, SA_SHIRQ, "TOMATILLO CE", p); pbm = pbm_for_ino(p, SCHIZO_PCIERR_A_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[0], schizo_pcierr_intr, IRQF_SHARED, + request_irq(op->irqs[0], schizo_pcierr_intr, SA_SHIRQ, "TOMATILLO PCIERR-A", pbm); pbm = pbm_for_ino(p, SCHIZO_PCIERR_B_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[0], schizo_pcierr_intr, IRQF_SHARED, + request_irq(op->irqs[0], schizo_pcierr_intr, SA_SHIRQ, "TOMATILLO PCIERR-B", pbm); pbm = pbm_for_ino(p, SCHIZO_SERR_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[3], schizo_safarierr_intr, IRQF_SHARED, + request_irq(op->irqs[3], schizo_safarierr_intr, SA_SHIRQ, "TOMATILLO SERR", p); /* Enable UE and CE interrupts for controller. */ @@ -1106,32 +1106,32 @@ static void schizo_register_error_handlers(struct pci_controller_info *p) pbm = pbm_for_ino(p, SCHIZO_UE_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[1], schizo_ue_intr, IRQF_SHARED, + request_irq(op->irqs[1], schizo_ue_intr, SA_SHIRQ, "SCHIZO_UE", p); pbm = pbm_for_ino(p, SCHIZO_CE_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[2], schizo_ce_intr, IRQF_SHARED, + request_irq(op->irqs[2], schizo_ce_intr, SA_SHIRQ, "SCHIZO CE", p); pbm = pbm_for_ino(p, SCHIZO_PCIERR_A_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[0], schizo_pcierr_intr, IRQF_SHARED, + request_irq(op->irqs[0], schizo_pcierr_intr, SA_SHIRQ, "SCHIZO PCIERR-A", pbm); pbm = pbm_for_ino(p, SCHIZO_PCIERR_B_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[0], schizo_pcierr_intr, IRQF_SHARED, + request_irq(op->irqs[0], schizo_pcierr_intr, SA_SHIRQ, "SCHIZO PCIERR-B", pbm); pbm = pbm_for_ino(p, SCHIZO_SERR_INO); op = of_find_device_by_node(pbm->prom_node); if (op) - request_irq(op->irqs[3], schizo_safarierr_intr, IRQF_SHARED, + request_irq(op->irqs[3], schizo_safarierr_intr, SA_SHIRQ, "SCHIZO SERR", p); /* Enable UE and CE interrupts for controller. */ diff --git a/trunk/arch/sparc64/kernel/power.c b/trunk/arch/sparc64/kernel/power.c index e55466c77b61..4febeda958a3 100644 --- a/trunk/arch/sparc64/kernel/power.c +++ b/trunk/arch/sparc64/kernel/power.c @@ -6,6 +6,7 @@ #define __KERNEL_SYSCALLS__ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/process.c b/trunk/arch/sparc64/kernel/process.c index 7d75cd4eb297..1c7ca2f712d9 100644 --- a/trunk/arch/sparc64/kernel/process.c +++ b/trunk/arch/sparc64/kernel/process.c @@ -12,6 +12,7 @@ #include +#include #include #include #include @@ -25,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/prom.c b/trunk/arch/sparc64/kernel/prom.c index fa484d4f241e..8a70c52c0447 100644 --- a/trunk/arch/sparc64/kernel/prom.c +++ b/trunk/arch/sparc64/kernel/prom.c @@ -1008,27 +1008,6 @@ static struct irq_trans pci_irq_trans_table[] = { }; #endif -static unsigned int sun4v_vdev_irq_build(struct device_node *dp, - unsigned int devino, - void *_data) -{ - u32 devhandle = (u32) (unsigned long) _data; - - return sun4v_build_irq(devhandle, devino); -} - -static void sun4v_vdev_irq_trans_init(struct device_node *dp) -{ - struct linux_prom64_registers *regs; - - dp->irq_trans = prom_early_alloc(sizeof(struct of_irq_controller)); - dp->irq_trans->irq_build = sun4v_vdev_irq_build; - - regs = of_get_property(dp, "reg", NULL); - dp->irq_trans->data = (void *) (unsigned long) - ((regs->phys_addr >> 32UL) & 0x0fffffff); -} - static void irq_trans_init(struct device_node *dp) { const char *model; @@ -1055,8 +1034,6 @@ static void irq_trans_init(struct device_node *dp) #endif if (!strcmp(dp->name, "central")) return central_irq_trans_init(dp->child); - if (!strcmp(dp->name, "virtual-devices")) - return sun4v_vdev_irq_trans_init(dp); } static int is_root_node(const struct device_node *dp) diff --git a/trunk/arch/sparc64/kernel/rtrap.S b/trunk/arch/sparc64/kernel/rtrap.S index 3522cd66f3bb..7130e866f935 100644 --- a/trunk/arch/sparc64/kernel/rtrap.S +++ b/trunk/arch/sparc64/kernel/rtrap.S @@ -5,6 +5,7 @@ * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include diff --git a/trunk/arch/sparc64/kernel/sbus.c b/trunk/arch/sparc64/kernel/sbus.c index c49a57795743..ef68aa4fec65 100644 --- a/trunk/arch/sparc64/kernel/sbus.c +++ b/trunk/arch/sparc64/kernel/sbus.c @@ -1065,7 +1065,7 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus) irq = sbus_build_irq(sbus, SYSIO_UE_INO); if (request_irq(irq, sysio_ue_handler, - IRQF_SHARED, "SYSIO UE", sbus) < 0) { + SA_SHIRQ, "SYSIO UE", sbus) < 0) { prom_printf("SYSIO[%x]: Cannot register UE interrupt.\n", sbus->portid); prom_halt(); @@ -1073,7 +1073,7 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus) irq = sbus_build_irq(sbus, SYSIO_CE_INO); if (request_irq(irq, sysio_ce_handler, - IRQF_SHARED, "SYSIO CE", sbus) < 0) { + SA_SHIRQ, "SYSIO CE", sbus) < 0) { prom_printf("SYSIO[%x]: Cannot register CE interrupt.\n", sbus->portid); prom_halt(); @@ -1081,7 +1081,7 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus) irq = sbus_build_irq(sbus, SYSIO_SBUSERR_INO); if (request_irq(irq, sysio_sbus_error_handler, - IRQF_SHARED, "SYSIO SBUS Error", sbus) < 0) { + SA_SHIRQ, "SYSIO SBUS Error", sbus) < 0) { prom_printf("SYSIO[%x]: Cannot register SBUS Error interrupt.\n", sbus->portid); prom_halt(); diff --git a/trunk/arch/sparc64/kernel/setup.c b/trunk/arch/sparc64/kernel/setup.c index a73140466e01..116d9632002d 100644 --- a/trunk/arch/sparc64/kernel/setup.c +++ b/trunk/arch/sparc64/kernel/setup.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/signal.c b/trunk/arch/sparc64/kernel/signal.c index 96d56a8410ad..ca11a4c457d4 100644 --- a/trunk/arch/sparc64/kernel/signal.c +++ b/trunk/arch/sparc64/kernel/signal.c @@ -8,6 +8,7 @@ * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #ifdef CONFIG_SPARC32_COMPAT #include /* for compat_old_sigset_t */ #endif diff --git a/trunk/arch/sparc64/kernel/sparc64_ksyms.c b/trunk/arch/sparc64/kernel/sparc64_ksyms.c index 4173de425f09..4ac35dd2088b 100644 --- a/trunk/arch/sparc64/kernel/sparc64_ksyms.c +++ b/trunk/arch/sparc64/kernel/sparc64_ksyms.c @@ -10,6 +10,7 @@ #define EXPORT_SYMTAB_STROPS #define PROMLIB_INTERNAL +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/sys32.S b/trunk/arch/sparc64/kernel/sys32.S index c09ab4b9431d..bdf1f4d02e3f 100644 --- a/trunk/arch/sparc64/kernel/sys32.S +++ b/trunk/arch/sparc64/kernel/sys32.S @@ -6,6 +6,7 @@ * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ +#include #include /* NOTE: call as jump breaks return stack, we have to avoid that */ diff --git a/trunk/arch/sparc64/kernel/sys_sparc.c b/trunk/arch/sparc64/kernel/sys_sparc.c index 51c056df528e..7a869138c37f 100644 --- a/trunk/arch/sparc64/kernel/sys_sparc.c +++ b/trunk/arch/sparc64/kernel/sys_sparc.c @@ -6,6 +6,7 @@ * platform. */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/sys_sparc32.c b/trunk/arch/sparc64/kernel/sys_sparc32.c index c88ae23ce812..31030bf00f1a 100644 --- a/trunk/arch/sparc64/kernel/sys_sparc32.c +++ b/trunk/arch/sparc64/kernel/sys_sparc32.c @@ -8,6 +8,7 @@ * environment. */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/sys_sunos32.c b/trunk/arch/sparc64/kernel/sys_sunos32.c index 87ebdf858a3a..ae5b32f817f0 100644 --- a/trunk/arch/sparc64/kernel/sys_sunos32.c +++ b/trunk/arch/sparc64/kernel/sys_sunos32.c @@ -155,7 +155,7 @@ asmlinkage int sunos_brk(u32 baddr) * simple, it hopefully works in most obvious cases.. Easy to * fool it, but this should catch most mistakes. */ - freepages = global_page_state(NR_FILE_PAGES); + freepages = get_page_cache_size(); freepages >>= 1; freepages += nr_free_pages(); freepages += nr_swap_pages; diff --git a/trunk/arch/sparc64/kernel/systbls.S b/trunk/arch/sparc64/kernel/systbls.S index 419a63fca172..1136fc465e37 100644 --- a/trunk/arch/sparc64/kernel/systbls.S +++ b/trunk/arch/sparc64/kernel/systbls.S @@ -10,6 +10,7 @@ * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu) */ +#include .text .align 4 diff --git a/trunk/arch/sparc64/kernel/time.c b/trunk/arch/sparc64/kernel/time.c index 8dcbfbffacc9..5f3dd4d800cd 100644 --- a/trunk/arch/sparc64/kernel/time.c +++ b/trunk/arch/sparc64/kernel/time.c @@ -9,6 +9,7 @@ * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/kernel/traps.c b/trunk/arch/sparc64/kernel/traps.c index 68420e2dad0e..1ff34b019f3f 100644 --- a/trunk/arch/sparc64/kernel/traps.c +++ b/trunk/arch/sparc64/kernel/traps.c @@ -9,6 +9,7 @@ * I like traps on v9, :)))) */ +#include #include #include /* for jiffies */ #include diff --git a/trunk/arch/sparc64/kernel/tsb.S b/trunk/arch/sparc64/kernel/tsb.S index eedf94fa5664..a0c8ba58920b 100644 --- a/trunk/arch/sparc64/kernel/tsb.S +++ b/trunk/arch/sparc64/kernel/tsb.S @@ -3,6 +3,7 @@ * Copyright (C) 2006 David S. Miller */ +#include #include #include diff --git a/trunk/arch/sparc64/kernel/ttable.S b/trunk/arch/sparc64/kernel/ttable.S index d7d2a8bdc66e..ee45ca2d7a04 100644 --- a/trunk/arch/sparc64/kernel/ttable.S +++ b/trunk/arch/sparc64/kernel/ttable.S @@ -3,6 +3,7 @@ * Copyright (C) 1996, 2001, 2006 David S. Miller (davem@davemloft.net) */ +#include .globl sparc64_ttable_tl0, sparc64_ttable_tl1 .globl tl0_icpe, tl1_icpe diff --git a/trunk/arch/sparc64/lib/atomic.S b/trunk/arch/sparc64/lib/atomic.S index 9633750167d0..faf87c31598b 100644 --- a/trunk/arch/sparc64/lib/atomic.S +++ b/trunk/arch/sparc64/lib/atomic.S @@ -4,6 +4,7 @@ * Copyright (C) 1999 David S. Miller (davem@redhat.com) */ +#include #include .text diff --git a/trunk/arch/sparc64/lib/bitops.S b/trunk/arch/sparc64/lib/bitops.S index 892431a82131..31afbfe6c1e8 100644 --- a/trunk/arch/sparc64/lib/bitops.S +++ b/trunk/arch/sparc64/lib/bitops.S @@ -4,6 +4,7 @@ * Copyright (C) 2000 David S. Miller (davem@redhat.com) */ +#include #include .text diff --git a/trunk/arch/sparc64/lib/mcount.S b/trunk/arch/sparc64/lib/mcount.S index 9e4534b485c7..2ef2e268bdcf 100644 --- a/trunk/arch/sparc64/lib/mcount.S +++ b/trunk/arch/sparc64/lib/mcount.S @@ -5,6 +5,7 @@ * This can also be tweaked for kernel stack overflow detection. */ +#include #include #include diff --git a/trunk/arch/sparc64/mm/hugetlbpage.c b/trunk/arch/sparc64/mm/hugetlbpage.c index 53b9b1f528e5..fbbbebbad8a4 100644 --- a/trunk/arch/sparc64/mm/hugetlbpage.c +++ b/trunk/arch/sparc64/mm/hugetlbpage.c @@ -4,6 +4,7 @@ * Copyright (C) 2002, 2003, 2006 David S. Miller (davem@davemloft.net) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/mm/init.c b/trunk/arch/sparc64/mm/init.c index dcba4e6ab570..cb75a27adb51 100644 --- a/trunk/arch/sparc64/mm/init.c +++ b/trunk/arch/sparc64/mm/init.c @@ -5,6 +5,7 @@ * Copyright (C) 1997-1999 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/mm/ultra.S b/trunk/arch/sparc64/mm/ultra.S index d70b60a3bbcc..f8479fad4047 100644 --- a/trunk/arch/sparc64/mm/ultra.S +++ b/trunk/arch/sparc64/mm/ultra.S @@ -4,6 +4,7 @@ * Copyright (C) 1997, 2000 David S. Miller (davem@redhat.com) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/prom/misc.c b/trunk/arch/sparc64/prom/misc.c index 0b4213720d43..577bde8b6647 100644 --- a/trunk/arch/sparc64/prom/misc.c +++ b/trunk/arch/sparc64/prom/misc.c @@ -6,6 +6,7 @@ * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include #include diff --git a/trunk/arch/sparc64/solaris/misc.c b/trunk/arch/sparc64/solaris/misc.c index 8135ec322c9c..719c90905a1e 100644 --- a/trunk/arch/sparc64/solaris/misc.c +++ b/trunk/arch/sparc64/solaris/misc.c @@ -4,6 +4,7 @@ * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include #include diff --git a/trunk/arch/um/Makefile-x86_64 b/trunk/arch/um/Makefile-x86_64 index dffd1184c956..dfd88b652fbe 100644 --- a/trunk/arch/um/Makefile-x86_64 +++ b/trunk/arch/um/Makefile-x86_64 @@ -6,11 +6,9 @@ START := 0x60000000 #We #undef __x86_64__ for kernelspace, not for userspace where #it's needed for headers to work! -CFLAGS += -U__$(SUBARCH)__ -fno-builtin -m64 -USER_CFLAGS += -fno-builtin -m64 +CFLAGS += -U__$(SUBARCH)__ -fno-builtin +USER_CFLAGS += -fno-builtin CHECKFLAGS += -m64 -AFLAGS += -m64 -LDFLAGS += -m elf_x86_64 ELF_ARCH := i386:x86-64 ELF_FORMAT := elf64-x86-64 @@ -18,4 +16,3 @@ ELF_FORMAT := elf64-x86-64 # Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example. LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64 -LINK-y += -m64 diff --git a/trunk/arch/um/drivers/harddog_kern.c b/trunk/arch/um/drivers/harddog_kern.c index 64ff22aa077b..d18a974735e6 100644 --- a/trunk/arch/um/drivers/harddog_kern.c +++ b/trunk/arch/um/drivers/harddog_kern.c @@ -35,6 +35,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/um/drivers/line.c b/trunk/arch/um/drivers/line.c index ebebaabb78ad..5ca57ca33713 100644 --- a/trunk/arch/um/drivers/line.c +++ b/trunk/arch/um/drivers/line.c @@ -373,7 +373,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data, int err; /* Interrupts are enabled here because we registered the interrupt with - * IRQF_DISABLED (see line_setup_irq).*/ + * SA_INTERRUPT (see line_setup_irq).*/ spin_lock_irq(&line->lock); err = flush_buffer(line); @@ -406,7 +406,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data, int line_setup_irq(int fd, int input, int output, struct line *line, void *data) { struct line_driver *driver = line->driver; - int err = 0, flags = IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM; + int err = 0, flags = SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM; if (input) err = um_request_irq(driver->read_irq, fd, IRQ_READ, @@ -767,7 +767,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty) spin_unlock(&winch_handler_lock); if(um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt, - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM, + SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, "winch", winch) < 0) printk("register_winch_irq - failed to register IRQ\n"); } diff --git a/trunk/arch/um/drivers/mconsole_kern.c b/trunk/arch/um/drivers/mconsole_kern.c index b414522f7686..79149314ed04 100644 --- a/trunk/arch/um/drivers/mconsole_kern.c +++ b/trunk/arch/um/drivers/mconsole_kern.c @@ -777,7 +777,7 @@ static int mconsole_init(void) register_reboot_notifier(&reboot_notifier); err = um_request_irq(MCONSOLE_IRQ, sock, IRQ_READ, mconsole_interrupt, - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM, + SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, "mconsole", (void *)sock); if (err){ printk("Failed to get IRQ for management console\n"); diff --git a/trunk/arch/um/drivers/net_kern.c b/trunk/arch/um/drivers/net_kern.c index 501f95675d89..8c7279bb353b 100644 --- a/trunk/arch/um/drivers/net_kern.c +++ b/trunk/arch/um/drivers/net_kern.c @@ -128,7 +128,7 @@ static int uml_net_open(struct net_device *dev) } err = um_request_irq(dev->irq, lp->fd, IRQ_READ, uml_net_interrupt, - IRQF_DISABLED | IRQF_SHARED, dev->name, dev); + SA_INTERRUPT | SA_SHIRQ, dev->name, dev); if(err != 0){ printk(KERN_ERR "uml_net_open: failed to get irq(%d)\n", err); err = -ENETUNREACH; diff --git a/trunk/arch/um/drivers/port_kern.c b/trunk/arch/um/drivers/port_kern.c index 73755f37a8a8..189839e4f1d4 100644 --- a/trunk/arch/um/drivers/port_kern.c +++ b/trunk/arch/um/drivers/port_kern.c @@ -105,7 +105,7 @@ static int port_accept(struct port_list *port) .port = port }); if(um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt, - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM, + SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, "telnetd", conn)){ printk(KERN_ERR "port_accept : failed to get IRQ for " "telnetd\n"); @@ -186,7 +186,7 @@ void *port_data(int port_num) goto out_free; } if(um_request_irq(ACCEPT_IRQ, fd, IRQ_READ, port_interrupt, - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM, "port", + SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, "port", port)){ printk(KERN_ERR "Failed to get IRQ for port %d\n", port_num); goto out_close; diff --git a/trunk/arch/um/drivers/stderr_console.c b/trunk/arch/um/drivers/stderr_console.c index 6d2cf32a9e8f..429ae8e6c7e5 100644 --- a/trunk/arch/um/drivers/stderr_console.c +++ b/trunk/arch/um/drivers/stderr_console.c @@ -8,7 +8,10 @@ /* * Don't register by default -- as this registeres very early in the - * boot process it becomes the default console. + * boot process it becomes the default console. And as this isn't a + * real tty driver init isn't able to open /dev/console then. + * + * In most cases this isn't what you want ... */ static int use_stderr_console = 0; @@ -40,20 +43,3 @@ static int stderr_setup(char *str) return 1; } __setup("stderr=", stderr_setup); - -/* The previous behavior of not unregistering led to /dev/console being - * impossible to open. My FC5 filesystem started having init die, and the - * system panicing because of this. Unregistering causes the real - * console to become the default console, and /dev/console can then be - * opened. Making this an initcall makes this happen late enough that - * there is no added value in dumping everything to stderr, and the - * normal console is good enough to show you all available output. - */ -static int __init unregister_stderr(void) -{ - unregister_console(&stderr_console); - - return 0; -} - -__initcall(unregister_stderr); diff --git a/trunk/arch/um/drivers/ubd_kern.c b/trunk/arch/um/drivers/ubd_kern.c index 602d7286b9e0..0345e2551247 100644 --- a/trunk/arch/um/drivers/ubd_kern.c +++ b/trunk/arch/um/drivers/ubd_kern.c @@ -874,7 +874,7 @@ int ubd_driver_init(void){ return(0); } err = um_request_irq(UBD_IRQ, thread_fd, IRQ_READ, ubd_intr, - IRQF_DISABLED, "ubd", ubd_dev); + SA_INTERRUPT, "ubd", ubd_dev); if(err != 0) printk(KERN_ERR "um_request_irq failed - errno = %d\n", -err); return 0; diff --git a/trunk/arch/um/drivers/xterm_kern.c b/trunk/arch/um/drivers/xterm_kern.c index 6036ec85895a..d269a80f4b0c 100644 --- a/trunk/arch/um/drivers/xterm_kern.c +++ b/trunk/arch/um/drivers/xterm_kern.c @@ -54,7 +54,7 @@ int xterm_fd(int socket, int *pid_out) init_completion(&data->ready); err = um_request_irq(XTERM_IRQ, socket, IRQ_READ, xterm_interrupt, - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM, + SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, "xterm", data); if (err){ printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, " diff --git a/trunk/arch/um/include/sysdep-x86_64/kernel-offsets.h b/trunk/arch/um/include/sysdep-x86_64/kernel-offsets.h index 91d129fb3930..939cc475757a 100644 --- a/trunk/arch/um/include/sysdep-x86_64/kernel-offsets.h +++ b/trunk/arch/um/include/sysdep-x86_64/kernel-offsets.h @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/arch/um/kernel/irq.c b/trunk/arch/um/kernel/irq.c index bfd0bdc8cd40..fae43a3054a0 100644 --- a/trunk/arch/um/kernel/irq.c +++ b/trunk/arch/um/kernel/irq.c @@ -474,7 +474,7 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *, } err = um_request_irq(irq, fds[0], IRQ_READ, handler, - IRQF_DISABLED | IRQF_SAMPLE_RANDOM, name, + SA_INTERRUPT | SA_SAMPLE_RANDOM, name, (void *) (long) fds[0]); if (err) { printk("init_aio_irq - : um_request_irq failed, err = %d\n", diff --git a/trunk/arch/um/kernel/sigio_kern.c b/trunk/arch/um/kernel/sigio_kern.c index 51b677083948..1c1300fb1e95 100644 --- a/trunk/arch/um/kernel/sigio_kern.c +++ b/trunk/arch/um/kernel/sigio_kern.c @@ -31,7 +31,7 @@ int write_sigio_irq(int fd) int err; err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt, - IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "write sigio", + SA_INTERRUPT | SA_SAMPLE_RANDOM, "write sigio", NULL); if(err){ printk("write_sigio_irq : um_request_irq failed, err = %d\n", diff --git a/trunk/arch/um/kernel/skas/mmu.c b/trunk/arch/um/kernel/skas/mmu.c index 624ca238d1fd..c5c9885a8297 100644 --- a/trunk/arch/um/kernel/skas/mmu.c +++ b/trunk/arch/um/kernel/skas/mmu.c @@ -152,7 +152,7 @@ void destroy_context_skas(struct mm_struct *mm) free_page(mmu->id.stack); pte_lock_deinit(virt_to_page(mmu->last_page_table)); pte_free_kernel((pte_t *) mmu->last_page_table); - dec_zone_page_state(virt_to_page(mmu->last_page_table), NR_PAGETABLE); + dec_page_state(nr_page_table_pages); #ifdef CONFIG_3_LEVEL_PGTABLES pmd_free((pmd_t *) mmu->last_pmd); #endif diff --git a/trunk/arch/um/kernel/skas/uaccess.c b/trunk/arch/um/kernel/skas/uaccess.c index 8912cec0fe43..5992c3257167 100644 --- a/trunk/arch/um/kernel/skas/uaccess.c +++ b/trunk/arch/um/kernel/skas/uaccess.c @@ -8,7 +8,6 @@ #include "linux/kernel.h" #include "linux/string.h" #include "linux/fs.h" -#include "linux/hardirq.h" #include "linux/highmem.h" #include "asm/page.h" #include "asm/pgtable.h" @@ -39,7 +38,7 @@ static unsigned long maybe_map(unsigned long virt, int is_write) return((unsigned long) phys); } -static int do_op_one_page(unsigned long addr, int len, int is_write, +static int do_op(unsigned long addr, int len, int is_write, int (*op)(unsigned long addr, int len, void *arg), void *arg) { struct page *page; @@ -50,11 +49,9 @@ static int do_op_one_page(unsigned long addr, int len, int is_write, return(-1); page = phys_to_page(addr); - addr = (unsigned long) kmap_atomic(page, KM_UML_USERCOPY) + (addr & ~PAGE_MASK); - + addr = (unsigned long) kmap(page) + (addr & ~PAGE_MASK); n = (*op)(addr, len, arg); - - kunmap_atomic(page, KM_UML_USERCOPY); + kunmap(page); return(n); } @@ -80,7 +77,7 @@ static void do_buffer_op(void *jmpbuf, void *arg_ptr) remain = len; current->thread.fault_catcher = jmpbuf; - n = do_op_one_page(addr, size, is_write, op, arg); + n = do_op(addr, size, is_write, op, arg); if(n != 0){ *res = (n < 0 ? remain : 0); goto out; @@ -94,7 +91,7 @@ static void do_buffer_op(void *jmpbuf, void *arg_ptr) } while(addr < ((addr + remain) & PAGE_MASK)){ - n = do_op_one_page(addr, PAGE_SIZE, is_write, op, arg); + n = do_op(addr, PAGE_SIZE, is_write, op, arg); if(n != 0){ *res = (n < 0 ? remain : 0); goto out; @@ -108,7 +105,7 @@ static void do_buffer_op(void *jmpbuf, void *arg_ptr) goto out; } - n = do_op_one_page(addr, remain, is_write, op, arg); + n = do_op(addr, remain, is_write, op, arg); if(n != 0) *res = (n < 0 ? remain : 0); else *res = 0; diff --git a/trunk/arch/um/kernel/time.c b/trunk/arch/um/kernel/time.c new file mode 100644 index 000000000000..8fa2ae7f3026 --- /dev/null +++ b/trunk/arch/um/kernel/time.c @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#include +#include +#include +#include +#include +#include +#include +#include "user_util.h" +#include "kern_util.h" +#include "user.h" +#include "process.h" +#include "time_user.h" +#include "kern_constants.h" +#include "os.h" + +/* XXX This really needs to be declared and initialized in a kernel file since + * it's in + */ +extern struct timespec wall_to_monotonic; + +extern struct timeval xtime; + +struct timeval local_offset = { 0, 0 }; + +void timer(void) +{ + gettimeofday(&xtime, NULL); + timeradd(&xtime, &local_offset, &xtime); +} + +static void set_interval(int timer_type) +{ + int usec = 1000000/hz(); + struct itimerval interval = ((struct itimerval) { { 0, usec }, + { 0, usec } }); + + if(setitimer(timer_type, &interval, NULL) == -1) + panic("setitimer failed - errno = %d\n", errno); +} + +void enable_timer(void) +{ + set_interval(ITIMER_VIRTUAL); +} + +void prepare_timer(void * ptr) +{ + int usec = 1000000/hz(); + *(struct itimerval *)ptr = ((struct itimerval) { { 0, usec }, + { 0, usec }}); +} + +void disable_timer(void) +{ + struct itimerval disable = ((struct itimerval) { { 0, 0 }, { 0, 0 }}); + if((setitimer(ITIMER_VIRTUAL, &disable, NULL) < 0) || + (setitimer(ITIMER_REAL, &disable, NULL) < 0)) + printk("disnable_timer - setitimer failed, errno = %d\n", + errno); + /* If there are signals already queued, after unblocking ignore them */ + set_handler(SIGALRM, SIG_IGN, 0, -1); + set_handler(SIGVTALRM, SIG_IGN, 0, -1); +} + +void switch_timers(int to_real) +{ + struct itimerval disable = ((struct itimerval) { { 0, 0 }, { 0, 0 }}); + struct itimerval enable = ((struct itimerval) { { 0, 1000000/hz() }, + { 0, 1000000/hz() }}); + int old, new; + + if(to_real){ + old = ITIMER_VIRTUAL; + new = ITIMER_REAL; + } + else { + old = ITIMER_REAL; + new = ITIMER_VIRTUAL; + } + + if((setitimer(old, &disable, NULL) < 0) || + (setitimer(new, &enable, NULL))) + printk("switch_timers - setitimer failed, errno = %d\n", + errno); +} + +void uml_idle_timer(void) +{ + if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR) + panic("Couldn't unset SIGVTALRM handler"); + + set_handler(SIGALRM, (__sighandler_t) alarm_handler, + SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1); + set_interval(ITIMER_REAL); +} + +extern void ktime_get_ts(struct timespec *ts); +#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) + +void time_init(void) +{ + struct timespec now; + + if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) + panic("Couldn't set SIGVTALRM handler"); + set_interval(ITIMER_VIRTUAL); + + do_posix_clock_monotonic_gettime(&now); + wall_to_monotonic.tv_sec = -now.tv_sec; + wall_to_monotonic.tv_nsec = -now.tv_nsec; +} + +/* Defined in linux/ktimer.h, which can't be included here */ +#define clock_was_set() do { } while (0) + +void do_gettimeofday(struct timeval *tv) +{ + unsigned long flags; + + flags = time_lock(); + gettimeofday(tv, NULL); + timeradd(tv, &local_offset, tv); + time_unlock(flags); + clock_was_set(); +} + +int do_settimeofday(struct timespec *tv) +{ + struct timeval now; + unsigned long flags; + struct timeval tv_in; + + if ((unsigned long) tv->tv_nsec >= UM_NSEC_PER_SEC) + return -EINVAL; + + tv_in.tv_sec = tv->tv_sec; + tv_in.tv_usec = tv->tv_nsec / 1000; + + flags = time_lock(); + gettimeofday(&now, NULL); + timersub(&tv_in, &now, &local_offset); + time_unlock(flags); + + return(0); +} + +void idle_sleep(int secs) +{ + struct timespec ts; + + ts.tv_sec = secs; + ts.tv_nsec = 0; + nanosleep(&ts, NULL); +} + +/* XXX This partly duplicates init_irq_signals */ + +void user_time_init(void) +{ + set_handler(SIGVTALRM, (__sighandler_t) alarm_handler, + SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, + SIGALRM, SIGUSR2, -1); + set_handler(SIGALRM, (__sighandler_t) alarm_handler, + SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, + SIGVTALRM, SIGUSR2, -1); + set_interval(ITIMER_VIRTUAL); +} diff --git a/trunk/arch/um/kernel/time_kern.c b/trunk/arch/um/kernel/time_kern.c index d7e044b5e5ee..87cdbc560d36 100644 --- a/trunk/arch/um/kernel/time_kern.c +++ b/trunk/arch/um/kernel/time_kern.c @@ -96,15 +96,11 @@ void time_init_kern(void) void do_boot_timer_handler(struct sigcontext * sc) { - unsigned long flags; struct pt_regs regs; CHOOSE_MODE((void) (UPT_SC(®s.regs) = sc), (void) (regs.regs.skas.is_user = 0)); - - write_seqlock_irqsave(&xtime_lock, flags); do_timer(®s); - write_sequnlock_irqrestore(&xtime_lock, flags); } static DEFINE_SPINLOCK(timer_spinlock); @@ -129,17 +125,25 @@ irqreturn_t um_timer(int irq, void *dev, struct pt_regs *regs) unsigned long long nsecs; unsigned long flags; - write_seqlock_irqsave(&xtime_lock, flags); - do_timer(regs); + write_seqlock_irqsave(&xtime_lock, flags); nsecs = get_time() + local_offset; xtime.tv_sec = nsecs / NSEC_PER_SEC; xtime.tv_nsec = nsecs - xtime.tv_sec * NSEC_PER_SEC; - write_sequnlock_irqrestore(&xtime_lock, flags); - return IRQ_HANDLED; + return(IRQ_HANDLED); +} + +long um_time(int __user *tloc) +{ + long ret = get_time() / NSEC_PER_SEC; + + if((tloc != NULL) && put_user(ret, tloc)) + return -EFAULT; + + return ret; } void do_gettimeofday(struct timeval *tv) @@ -170,6 +174,18 @@ static inline void set_time(unsigned long long nsecs) clock_was_set(); } +long um_stime(int __user *tptr) +{ + int value; + + if (get_user(value, tptr)) + return -EFAULT; + + set_time((unsigned long long) value * NSEC_PER_SEC); + + return 0; +} + int do_settimeofday(struct timespec *tv) { set_time((unsigned long long) tv->tv_sec * NSEC_PER_SEC + tv->tv_nsec); @@ -195,7 +211,7 @@ int __init timer_init(void) int err; user_time_init(); - err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL); + err = request_irq(TIMER_IRQ, um_timer, SA_INTERRUPT, "timer", NULL); if(err != 0) printk(KERN_ERR "timer_init : request_irq failed - " "errno = %d\n", -err); diff --git a/trunk/arch/um/kernel/tt/process_kern.c b/trunk/arch/um/kernel/tt/process_kern.c index 8368c2dbe635..a9c1443fc548 100644 --- a/trunk/arch/um/kernel/tt/process_kern.c +++ b/trunk/arch/um/kernel/tt/process_kern.c @@ -119,7 +119,7 @@ void suspend_new_thread(int fd) panic("read failed in suspend_new_thread, err = %d", -err); } -void schedule_tail(struct task_struct *prev); +void schedule_tail(task_t *prev); static void new_thread_handler(int sig) { diff --git a/trunk/arch/um/kernel/um_arch.c b/trunk/arch/um/kernel/um_arch.c index 37cfe7701f06..7d51dd7201c3 100644 --- a/trunk/arch/um/kernel/um_arch.c +++ b/trunk/arch/um/kernel/um_arch.c @@ -495,7 +495,6 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end) { } -#ifdef CONFIG_SMP void alternatives_smp_module_add(struct module *mod, char *name, void *locks, void *locks_end, void *text, void *text_end) @@ -505,4 +504,3 @@ void alternatives_smp_module_add(struct module *mod, char *name, void alternatives_smp_module_del(struct module *mod) { } -#endif diff --git a/trunk/arch/um/kernel/vmlinux.lds.S b/trunk/arch/um/kernel/vmlinux.lds.S index 72acdce205e0..1660a769674b 100644 --- a/trunk/arch/um/kernel/vmlinux.lds.S +++ b/trunk/arch/um/kernel/vmlinux.lds.S @@ -1,5 +1,4 @@ -/* in case the preprocessor is a 32bit one */ -#undef i386 +#include #ifdef CONFIG_LD_SCRIPT_STATIC #include "uml.lds.S" #else diff --git a/trunk/arch/um/os-Linux/mem.c b/trunk/arch/um/os-Linux/mem.c index 560c8063c77c..c6432e729241 100644 --- a/trunk/arch/um/os-Linux/mem.c +++ b/trunk/arch/um/os-Linux/mem.c @@ -55,7 +55,7 @@ static void __init find_tempdir(void) */ static int next(int fd, char *buf, int size, char c) { - int n, len; + int n; char *ptr; while((ptr = strchr(buf, c)) == NULL){ @@ -69,17 +69,7 @@ static int next(int fd, char *buf, int size, char c) } ptr++; - len = strlen(ptr); - memmove(buf, ptr, len + 1); - - /* Refill the buffer so that if there's a partial string that we care - * about, it will be completed, and we can recognize it. - */ - n = read(fd, &buf[len], size - len - 1); - if(n < 0) - return -errno; - - buf[len + n] = '\0'; + memmove(buf, ptr, strlen(ptr) + 1); return 1; } @@ -210,11 +200,8 @@ int create_tmp_file(unsigned long long len) exit(1); } - /* Seek to len - 1 because writing a character there will - * increase the file size by one byte, to the desired length. - */ - if (lseek64(fd, len - 1, SEEK_SET) < 0) { - perror("os_seek_file"); + if (lseek64(fd, len, SEEK_SET) < 0) { + perror("os_seek_file"); exit(1); } diff --git a/trunk/arch/um/os-Linux/umid.c b/trunk/arch/um/os-Linux/umid.c index 48092b95c8ab..362db059fe30 100644 --- a/trunk/arch/um/os-Linux/umid.c +++ b/trunk/arch/um/os-Linux/umid.c @@ -67,53 +67,32 @@ static int __init make_uml_dir(void) return err; } -/* - * Unlinks the files contained in @dir and then removes @dir. - * Doesn't handle directory trees, so it's not like rm -rf, but almost such. We - * ignore ENOENT errors for anything (they happen, strangely enough - possibly due - * to races between multiple dying UML threads). - */ -static int remove_files_and_dir(char *dir) +static int actually_do_remove(char *dir) { DIR *directory; struct dirent *ent; int len; char file[256]; - int ret; directory = opendir(dir); - if (directory == NULL) { - if (errno != ENOENT) - return -errno; - else - return 0; - } + if(directory == NULL) + return -errno; - while ((ent = readdir(directory)) != NULL) { - if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) + while((ent = readdir(directory)) != NULL){ + if(!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) continue; len = strlen(dir) + sizeof("/") + strlen(ent->d_name) + 1; - if (len > sizeof(file)) { - ret = -E2BIG; - goto out; - } + if(len > sizeof(file)) + return -E2BIG; sprintf(file, "%s/%s", dir, ent->d_name); - if (unlink(file) < 0 && errno != ENOENT) { - ret = -errno; - goto out; - } - } - - if (rmdir(dir) < 0 && errno != ENOENT) { - ret = -errno; - goto out; + if(unlink(file) < 0) + return -errno; } + if(rmdir(dir) < 0) + return -errno; - ret = 0; -out: - closedir(directory); - return ret; + return 0; } /* This says that there isn't already a user of the specified directory even if @@ -124,10 +103,9 @@ static int remove_files_and_dir(char *dir) * something other than UML sticking stuff in the directory * this boot racing with a shutdown of the other UML * In any of these cases, the directory isn't useful for anything else. - * - * Boolean return: 1 if in use, 0 otherwise. */ -static inline int is_umdir_used(char *dir) + +static int not_dead_yet(char *dir) { char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")]; char pid[sizeof("nnnnn\0")], *end; @@ -135,7 +113,7 @@ static inline int is_umdir_used(char *dir) n = snprintf(file, sizeof(file), "%s/pid", dir); if(n >= sizeof(file)){ - printk("is_umdir_used - pid filename too long\n"); + printk("not_dead_yet - pid filename too long\n"); err = -E2BIG; goto out; } @@ -145,7 +123,7 @@ static inline int is_umdir_used(char *dir) if(fd < 0) { fd = -errno; if(fd != -ENOENT){ - printk("is_umdir_used : couldn't open pid file '%s', " + printk("not_dead_yet : couldn't open pid file '%s', " "err = %d\n", file, -fd); } goto out; @@ -154,18 +132,18 @@ static inline int is_umdir_used(char *dir) err = 0; n = read(fd, pid, sizeof(pid)); if(n < 0){ - printk("is_umdir_used : couldn't read pid file '%s', " + printk("not_dead_yet : couldn't read pid file '%s', " "err = %d\n", file, errno); goto out_close; } else if(n == 0){ - printk("is_umdir_used : couldn't read pid file '%s', " + printk("not_dead_yet : couldn't read pid file '%s', " "0-byte read\n", file); goto out_close; } p = strtoul(pid, &end, 0); if(end == pid){ - printk("is_umdir_used : couldn't parse pid file '%s', " + printk("not_dead_yet : couldn't parse pid file '%s', " "errno = %d\n", file, errno); goto out_close; } @@ -175,32 +153,19 @@ static inline int is_umdir_used(char *dir) return 1; } + err = actually_do_remove(dir); + if(err) + printk("not_dead_yet - actually_do_remove failed with " + "err = %d\n", err); + + return err; + out_close: close(fd); out: return 0; } -/* - * Try to remove the directory @dir unless it's in use. - * Precondition: @dir exists. - * Returns 0 for success, < 0 for failure in removal or if the directory is in - * use. - */ -static int umdir_take_if_dead(char *dir) -{ - int ret; - if (is_umdir_used(dir)) - return -EEXIST; - - ret = remove_files_and_dir(dir); - if (ret) { - printk("is_umdir_used - remove_files_and_dir failed with " - "err = %d\n", ret); - } - return ret; -} - static void __init create_pid_file(void) { char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")]; @@ -279,7 +244,11 @@ int __init make_umid(void) if(err != -EEXIST) goto err; - if (umdir_take_if_dead(tmp) < 0) + /* 1 -> this umid is already in use + * < 0 -> we couldn't remove the umid directory + * In either case, we can't use this umid, so return -EEXIST. + */ + if(not_dead_yet(tmp) != 0) goto err; err = mkdir(tmp, 0777); @@ -375,9 +344,9 @@ static void remove_umid_dir(void) char dir[strlen(uml_dir) + UMID_LEN + 1], err; sprintf(dir, "%s%s", uml_dir, umid); - err = remove_files_and_dir(dir); + err = actually_do_remove(dir); if(err) - printf("remove_umid_dir - remove_files_and_dir failed with " + printf("remove_umid_dir - actually_do_remove failed with " "err = %d\n", err); } diff --git a/trunk/arch/um/scripts/Makefile.rules b/trunk/arch/um/scripts/Makefile.rules index 813077fb1e5b..1347dc6d5218 100644 --- a/trunk/arch/um/scripts/Makefile.rules +++ b/trunk/arch/um/scripts/Makefile.rules @@ -8,7 +8,7 @@ USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) $(USER_OBJS:.o=.%): \ - c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o) + c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(*F).o) $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ -Dunix -D__unix__ -D__$(SUBARCH)__ @@ -17,7 +17,7 @@ $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file)) $(UNPROFILE_OBJS:.o=.%): \ - c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o) + c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(*F).o) $(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ -Dunix -D__unix__ -D__$(SUBARCH)__ diff --git a/trunk/arch/um/sys-i386/checksum.S b/trunk/arch/um/sys-i386/checksum.S index 62c7e564f22e..d98b2fff3d08 100644 --- a/trunk/arch/um/sys-i386/checksum.S +++ b/trunk/arch/um/sys-i386/checksum.S @@ -25,6 +25,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include /* diff --git a/trunk/arch/um/sys-i386/ptrace.c b/trunk/arch/um/sys-i386/ptrace.c index 28bf01150323..6028bc7cc01b 100644 --- a/trunk/arch/um/sys-i386/ptrace.c +++ b/trunk/arch/um/sys-i386/ptrace.c @@ -3,6 +3,7 @@ * Licensed under the GPL */ +#include #include #include "linux/sched.h" #include "linux/mm.h" diff --git a/trunk/arch/um/sys-i386/sys_call_table.S b/trunk/arch/um/sys-i386/sys_call_table.S index 2497554b7b95..1ff61474b25c 100644 --- a/trunk/arch/um/sys-i386/sys_call_table.S +++ b/trunk/arch/um/sys-i386/sys_call_table.S @@ -7,6 +7,8 @@ #define sys_vm86old sys_ni_syscall #define sys_vm86 sys_ni_syscall +#define sys_stime um_stime +#define sys_time um_time #define old_mmap old_mmap_i386 #include "../../i386/kernel/syscall_table.S" diff --git a/trunk/arch/um/sys-ppc/misc.S b/trunk/arch/um/sys-ppc/misc.S index 1364b7da578c..f0c971db47e4 100644 --- a/trunk/arch/um/sys-ppc/misc.S +++ b/trunk/arch/um/sys-ppc/misc.S @@ -15,6 +15,7 @@ * */ +#include #include #include "ppc_asm.h" diff --git a/trunk/arch/um/sys-x86_64/syscall_table.c b/trunk/arch/um/sys-x86_64/syscall_table.c index 9e9ad72c2ba4..34b2e842864f 100644 --- a/trunk/arch/um/sys-x86_64/syscall_table.c +++ b/trunk/arch/um/sys-x86_64/syscall_table.c @@ -4,6 +4,7 @@ #include #include #include +#include #define __NO_STUBS @@ -19,6 +20,12 @@ /*#define sys_set_thread_area sys_ni_syscall #define sys_get_thread_area sys_ni_syscall*/ +/* For __NR_time. The x86-64 name hopefully will change from sys_time64 to + * sys_time (since the current situation is bogus). I've sent a patch to cleanup + * this. Remove below the obsoleted line. */ +#define sys_time64 um_time +#define sys_time um_time + /* On UML we call it this way ("old" means it's not mmap2) */ #define sys_mmap old_mmap /* On x86-64 sys_uname is actually sys_newuname plus a compatibility trick. diff --git a/trunk/arch/v850/kernel/anna.c b/trunk/arch/v850/kernel/anna.c index 40892d3e3c24..d0502e142437 100644 --- a/trunk/arch/v850/kernel/anna.c +++ b/trunk/arch/v850/kernel/anna.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/as85ep1.c b/trunk/arch/v850/kernel/as85ep1.c index 5352f8a5aa07..d78c5e4ea9bc 100644 --- a/trunk/arch/v850/kernel/as85ep1.c +++ b/trunk/arch/v850/kernel/as85ep1.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/fpga85e2c.c b/trunk/arch/v850/kernel/fpga85e2c.c index cb04a6954ccb..d8094519ad85 100644 --- a/trunk/arch/v850/kernel/fpga85e2c.c +++ b/trunk/arch/v850/kernel/fpga85e2c.c @@ -12,6 +12,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/gbus_int.c b/trunk/arch/v850/kernel/gbus_int.c index 25d636e79e6a..92918b8d89ef 100644 --- a/trunk/arch/v850/kernel/gbus_int.c +++ b/trunk/arch/v850/kernel/gbus_int.c @@ -154,7 +154,7 @@ static unsigned gbus_int_startup_irq (unsigned irq) /* First enable the CPU interrupt. */ int rval = request_irq (IRQ_GINT(gint), gbus_int_handle_irq, - IRQF_DISABLED, + SA_INTERRUPT, "gbus_int_handler", &gint_num_active_irqs[gint]); if (rval != 0) diff --git a/trunk/arch/v850/kernel/ma.c b/trunk/arch/v850/kernel/ma.c index 2aa8ab0f7edc..b3dfbc5d2f40 100644 --- a/trunk/arch/v850/kernel/ma.c +++ b/trunk/arch/v850/kernel/ma.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/me2.c b/trunk/arch/v850/kernel/me2.c index 14b0c8858aa4..6527c218f91d 100644 --- a/trunk/arch/v850/kernel/me2.c +++ b/trunk/arch/v850/kernel/me2.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/process.c b/trunk/arch/v850/kernel/process.c index c4f844c86e50..57218c76925c 100644 --- a/trunk/arch/v850/kernel/process.c +++ b/trunk/arch/v850/kernel/process.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/rte_cb.c b/trunk/arch/v850/kernel/rte_cb.c index 0f7f6cd705a2..0c794b9e0f9b 100644 --- a/trunk/arch/v850/kernel/rte_cb.c +++ b/trunk/arch/v850/kernel/rte_cb.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/rte_cb_leds.c b/trunk/arch/v850/kernel/rte_cb_leds.c index f654088b2760..b662ad838940 100644 --- a/trunk/arch/v850/kernel/rte_cb_leds.c +++ b/trunk/arch/v850/kernel/rte_cb_leds.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/rte_ma1_cb.c b/trunk/arch/v850/kernel/rte_ma1_cb.c index 9a716f946421..3873e276392f 100644 --- a/trunk/arch/v850/kernel/rte_ma1_cb.c +++ b/trunk/arch/v850/kernel/rte_ma1_cb.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/rte_mb_a_pci.c b/trunk/arch/v850/kernel/rte_mb_a_pci.c index f36b778f1432..3a7c5c9c3ac6 100644 --- a/trunk/arch/v850/kernel/rte_mb_a_pci.c +++ b/trunk/arch/v850/kernel/rte_mb_a_pci.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/rte_me2_cb.c b/trunk/arch/v850/kernel/rte_me2_cb.c index 3be355a029e2..faaf3d95e6cf 100644 --- a/trunk/arch/v850/kernel/rte_me2_cb.c +++ b/trunk/arch/v850/kernel/rte_me2_cb.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include @@ -263,7 +264,7 @@ static unsigned cb_pic_startup_irq (unsigned irq) if (cb_pic_active_irqs == 0) { rval = request_irq (IRQ_CB_PIC, cb_pic_handle_irq, - IRQF_DISABLED, "cb_pic_handler", 0); + SA_INTERRUPT, "cb_pic_handler", 0); if (rval != 0) return rval; } diff --git a/trunk/arch/v850/kernel/rte_nb85e_cb.c b/trunk/arch/v850/kernel/rte_nb85e_cb.c index b4a045da5d70..990b20bffe47 100644 --- a/trunk/arch/v850/kernel/rte_nb85e_cb.c +++ b/trunk/arch/v850/kernel/rte_nb85e_cb.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/sim.c b/trunk/arch/v850/kernel/sim.c index 467b4aa0acdd..17049aaa8f11 100644 --- a/trunk/arch/v850/kernel/sim.c +++ b/trunk/arch/v850/kernel/sim.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/sim85e2.c b/trunk/arch/v850/kernel/sim85e2.c index 566dde5e6070..9111613fb53a 100644 --- a/trunk/arch/v850/kernel/sim85e2.c +++ b/trunk/arch/v850/kernel/sim85e2.c @@ -12,6 +12,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/syscalls.c b/trunk/arch/v850/kernel/syscalls.c index 2ec0700fc46b..9224cb65f6ec 100644 --- a/trunk/arch/v850/kernel/syscalls.c +++ b/trunk/arch/v850/kernel/syscalls.c @@ -15,6 +15,7 @@ * and Paul Mackerras (paulus@cs.anu.edu.au). */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/teg.c b/trunk/arch/v850/kernel/teg.c index 290d50665016..495cf8f37bcb 100644 --- a/trunk/arch/v850/kernel/teg.c +++ b/trunk/arch/v850/kernel/teg.c @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #include #include #include diff --git a/trunk/arch/v850/kernel/time.c b/trunk/arch/v850/kernel/time.c index a0b46695f186..c1e85c2aef65 100644 --- a/trunk/arch/v850/kernel/time.c +++ b/trunk/arch/v850/kernel/time.c @@ -177,7 +177,7 @@ EXPORT_SYMBOL(do_settimeofday); static int timer_dev_id; static struct irqaction timer_irqaction = { timer_interrupt, - IRQF_DISABLED, + SA_INTERRUPT, CPU_MASK_NONE, "timer", &timer_dev_id, diff --git a/trunk/arch/v850/kernel/v850_ksyms.c b/trunk/arch/v850/kernel/v850_ksyms.c index c03ad6ed61cc..6bcfcfe88384 100644 --- a/trunk/arch/v850/kernel/v850_ksyms.c +++ b/trunk/arch/v850/kernel/v850_ksyms.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/v850/kernel/vmlinux.lds.S b/trunk/arch/v850/kernel/vmlinux.lds.S index 63399219cd9f..5b2ffcc6e2b2 100644 --- a/trunk/arch/v850/kernel/vmlinux.lds.S +++ b/trunk/arch/v850/kernel/vmlinux.lds.S @@ -11,6 +11,7 @@ * Written by Miles Bader */ +#include #define VMLINUX_SYMBOL(_sym_) _##_sym_ #include diff --git a/trunk/arch/x86_64/Kconfig b/trunk/arch/x86_64/Kconfig index 28df7d88ce2c..e856804c447f 100644 --- a/trunk/arch/x86_64/Kconfig +++ b/trunk/arch/x86_64/Kconfig @@ -24,14 +24,6 @@ config X86 bool default y -config LOCKDEP_SUPPORT - bool - default y - -config STACKTRACE_SUPPORT - bool - default y - config SEMAPHORE_SLEEPERS bool default y diff --git a/trunk/arch/x86_64/Kconfig.debug b/trunk/arch/x86_64/Kconfig.debug index 775d211a5cf9..1d92ab56c0f9 100644 --- a/trunk/arch/x86_64/Kconfig.debug +++ b/trunk/arch/x86_64/Kconfig.debug @@ -1,9 +1,5 @@ menu "Kernel hacking" -config TRACE_IRQFLAGS_SUPPORT - bool - default y - source "lib/Kconfig.debug" config DEBUG_RODATA diff --git a/trunk/arch/x86_64/boot/setup.S b/trunk/arch/x86_64/boot/setup.S index a50b631f4d2b..12ea0b6c52e2 100644 --- a/trunk/arch/x86_64/boot/setup.S +++ b/trunk/arch/x86_64/boot/setup.S @@ -45,8 +45,9 @@ * Added long mode checking and SSE force. March 2003, Andi Kleen. */ +#include #include -#include +#include #include #include #include diff --git a/trunk/arch/x86_64/ia32/Makefile b/trunk/arch/x86_64/ia32/Makefile index 62bc5f56da9e..e9263b4975e0 100644 --- a/trunk/arch/x86_64/ia32/Makefile +++ b/trunk/arch/x86_64/ia32/Makefile @@ -11,9 +11,6 @@ obj-$(CONFIG_IA32_EMULATION) += $(sysv-y) obj-$(CONFIG_IA32_AOUT) += ia32_aout.o -audit-class-$(CONFIG_AUDIT) := audit.o -obj-$(CONFIG_IA32_EMULATION) += $(audit-class-y) - $(obj)/syscall32_syscall.o: \ $(foreach F,sysenter syscall,$(obj)/vsyscall-$F.so) diff --git a/trunk/arch/x86_64/ia32/audit.c b/trunk/arch/x86_64/ia32/audit.c deleted file mode 100644 index ab94f2e58cdd..000000000000 --- a/trunk/arch/x86_64/ia32/audit.c +++ /dev/null @@ -1,11 +0,0 @@ -#include - -unsigned ia32_dir_class[] = { -#include -~0U -}; - -unsigned ia32_chattr_class[] = { -#include -~0U -}; diff --git a/trunk/arch/x86_64/ia32/ia32entry.S b/trunk/arch/x86_64/ia32/ia32entry.S index 9b5bb413a6e9..c536fa98ea37 100644 --- a/trunk/arch/x86_64/ia32/ia32entry.S +++ b/trunk/arch/x86_64/ia32/ia32entry.S @@ -13,7 +13,6 @@ #include #include #include -#include #include #define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8) @@ -76,10 +75,6 @@ ENTRY(ia32_sysenter_target) swapgs movq %gs:pda_kernelstack, %rsp addq $(PDA_STACKOFFSET),%rsp - /* - * No need to follow this irqs on/off section: the syscall - * disabled irqs, here we enable it straight after entry: - */ sti movl %ebp,%ebp /* zero extension */ pushq $__USER32_DS @@ -123,7 +118,6 @@ sysenter_do_call: movq %rax,RAX-ARGOFFSET(%rsp) GET_THREAD_INFO(%r10) cli - TRACE_IRQS_OFF testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10) jnz int_ret_from_sys_call andl $~TS_COMPAT,threadinfo_status(%r10) @@ -138,7 +132,6 @@ sysenter_do_call: CFI_REGISTER rsp,rcx movl $VSYSCALL32_SYSEXIT,%edx /* User %eip */ CFI_REGISTER rip,rdx - TRACE_IRQS_ON swapgs sti /* sti only takes effect after the next instruction */ /* sysexit */ @@ -193,10 +186,6 @@ ENTRY(ia32_cstar_target) movl %esp,%r8d CFI_REGISTER rsp,r8 movq %gs:pda_kernelstack,%rsp - /* - * No need to follow this irqs on/off section: the syscall - * disabled irqs and here we enable it straight after entry: - */ sti SAVE_ARGS 8,1,1 movl %eax,%eax /* zero extension */ @@ -231,7 +220,6 @@ cstar_do_call: movq %rax,RAX-ARGOFFSET(%rsp) GET_THREAD_INFO(%r10) cli - TRACE_IRQS_OFF testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10) jnz int_ret_from_sys_call andl $~TS_COMPAT,threadinfo_status(%r10) @@ -240,7 +228,6 @@ cstar_do_call: CFI_REGISTER rip,rcx movl EFLAGS-ARGOFFSET(%rsp),%r11d /*CFI_REGISTER rflags,r11*/ - TRACE_IRQS_ON movl RSP-ARGOFFSET(%rsp),%esp CFI_RESTORE rsp swapgs @@ -299,11 +286,7 @@ ENTRY(ia32_syscall) /*CFI_REL_OFFSET rflags,EFLAGS-RIP*/ /*CFI_REL_OFFSET cs,CS-RIP*/ CFI_REL_OFFSET rip,RIP-RIP - swapgs - /* - * No need to follow this irqs on/off section: the syscall - * disabled irqs and here we enable it straight after entry: - */ + swapgs sti movl %eax,%eax pushq %rax diff --git a/trunk/arch/x86_64/ia32/sys_ia32.c b/trunk/arch/x86_64/ia32/sys_ia32.c index 9c130993380d..dc88154c412b 100644 --- a/trunk/arch/x86_64/ia32/sys_ia32.c +++ b/trunk/arch/x86_64/ia32/sys_ia32.c @@ -20,6 +20,7 @@ * This should be fixed. */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/Makefile b/trunk/arch/x86_64/kernel/Makefile index b5aaeafc1cd3..aeb9c560be88 100644 --- a/trunk/arch/x86_64/kernel/Makefile +++ b/trunk/arch/x86_64/kernel/Makefile @@ -10,7 +10,6 @@ obj-y := process.o signal.o entry.o traps.o irq.o \ setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \ pci-dma.o pci-nommu.o alternative.o -obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-$(CONFIG_X86_MCE) += mce.o obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o obj-$(CONFIG_X86_MCE_AMD) += mce_amd.o @@ -36,7 +35,6 @@ obj-$(CONFIG_KPROBES) += kprobes.o obj-$(CONFIG_X86_PM_TIMER) += pmtimer.o obj-$(CONFIG_X86_VSMP) += vsmp.o obj-$(CONFIG_K8_NB) += k8.o -obj-$(CONFIG_AUDIT) += audit.o obj-$(CONFIG_MODULES) += module.o diff --git a/trunk/arch/x86_64/kernel/acpi/sleep.c b/trunk/arch/x86_64/kernel/acpi/sleep.c index 5ebf62c7a3d2..091bc79c888f 100644 --- a/trunk/arch/x86_64/kernel/acpi/sleep.c +++ b/trunk/arch/x86_64/kernel/acpi/sleep.c @@ -26,6 +26,7 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/aperture.c b/trunk/arch/x86_64/kernel/aperture.c index 58af8e73738b..a195ef06ec55 100644 --- a/trunk/arch/x86_64/kernel/aperture.c +++ b/trunk/arch/x86_64/kernel/aperture.c @@ -9,6 +9,7 @@ * * Copyright 2002 Andi Kleen, SuSE Labs. */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/apic.c b/trunk/arch/x86_64/kernel/apic.c index 2b8cef037a65..b2ead91df218 100644 --- a/trunk/arch/x86_64/kernel/apic.c +++ b/trunk/arch/x86_64/kernel/apic.c @@ -14,6 +14,7 @@ * Mikael Pettersson : PM converted to driver model. */ +#include #include #include diff --git a/trunk/arch/x86_64/kernel/audit.c b/trunk/arch/x86_64/kernel/audit.c deleted file mode 100644 index a067aa468a85..000000000000 --- a/trunk/arch/x86_64/kernel/audit.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include -#include - -static unsigned dir_class[] = { -#include -~0U -}; - -static unsigned chattr_class[] = { -#include -~0U -}; - -static int __init audit_classes_init(void) -{ -#ifdef CONFIG_IA32_EMULATION - extern __u32 ia32_dir_class[]; - extern __u32 ia32_chattr_class[]; - audit_register_class(AUDIT_CLASS_DIR_WRITE_32, ia32_dir_class); - audit_register_class(AUDIT_CLASS_CHATTR_32, ia32_chattr_class); -#endif - audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class); - audit_register_class(AUDIT_CLASS_CHATTR, chattr_class); - return 0; -} - -__initcall(audit_classes_init); diff --git a/trunk/arch/x86_64/kernel/e820.c b/trunk/arch/x86_64/kernel/e820.c index b8eee4c7888b..9e94d834624b 100644 --- a/trunk/arch/x86_64/kernel/e820.c +++ b/trunk/arch/x86_64/kernel/e820.c @@ -8,6 +8,7 @@ * Venkatesh Pallipadi * */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/entry.S b/trunk/arch/x86_64/kernel/entry.S index d464dded68c0..22cac4487b57 100644 --- a/trunk/arch/x86_64/kernel/entry.S +++ b/trunk/arch/x86_64/kernel/entry.S @@ -28,6 +28,7 @@ */ #define ASSEMBLY 1 +#include #include #include #include @@ -41,24 +42,13 @@ #include #include #include -#include .code64 #ifndef CONFIG_PREEMPT #define retint_kernel retint_restore_args #endif - - -.macro TRACE_IRQS_IRETQ offset=ARGOFFSET -#ifdef CONFIG_TRACE_IRQFLAGS - bt $9,EFLAGS-\offset(%rsp) /* interrupts off? */ - jnc 1f - TRACE_IRQS_ON -1: -#endif -.endm - + /* * C code is not supposed to know about undefined top of stack. Every time * a C function with an pt_regs argument is called from the SYSCALL based @@ -205,10 +195,6 @@ ENTRY(system_call) swapgs movq %rsp,%gs:pda_oldrsp movq %gs:pda_kernelstack,%rsp - /* - * No need to follow this irqs off/on section - it's straight - * and short: - */ sti SAVE_ARGS 8,1 movq %rax,ORIG_RAX-ARGOFFSET(%rsp) @@ -234,15 +220,10 @@ ret_from_sys_call: sysret_check: GET_THREAD_INFO(%rcx) cli - TRACE_IRQS_OFF movl threadinfo_flags(%rcx),%edx andl %edi,%edx CFI_REMEMBER_STATE jnz sysret_careful - /* - * sysretq will re-enable interrupts: - */ - TRACE_IRQS_ON movq RIP-ARGOFFSET(%rsp),%rcx CFI_REGISTER rip,rcx RESTORE_ARGS 0,-ARG_SKIP,1 @@ -257,7 +238,6 @@ sysret_careful: CFI_RESTORE_STATE bt $TIF_NEED_RESCHED,%edx jnc sysret_signal - TRACE_IRQS_ON sti pushq %rdi CFI_ADJUST_CFA_OFFSET 8 @@ -268,7 +248,6 @@ sysret_careful: /* Handle a signal */ sysret_signal: - TRACE_IRQS_ON sti testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx jz 1f @@ -283,7 +262,6 @@ sysret_signal: /* Use IRET because user could have changed frame. This works because ptregscall_common has called FIXUP_TOP_OF_STACK. */ cli - TRACE_IRQS_OFF jmp int_with_check badsys: @@ -332,7 +310,6 @@ ENTRY(int_ret_from_sys_call) CFI_REL_OFFSET r10,R10-ARGOFFSET CFI_REL_OFFSET r11,R11-ARGOFFSET cli - TRACE_IRQS_OFF testl $3,CS-ARGOFFSET(%rsp) je retint_restore_args movl $_TIF_ALLWORK_MASK,%edi @@ -351,7 +328,6 @@ int_with_check: int_careful: bt $TIF_NEED_RESCHED,%edx jnc int_very_careful - TRACE_IRQS_ON sti pushq %rdi CFI_ADJUST_CFA_OFFSET 8 @@ -359,12 +335,10 @@ int_careful: popq %rdi CFI_ADJUST_CFA_OFFSET -8 cli - TRACE_IRQS_OFF jmp int_with_check /* handle signals and tracing -- both require a full stack frame */ int_very_careful: - TRACE_IRQS_ON sti SAVE_REST /* Check for syscall exit trace */ @@ -378,7 +352,6 @@ int_very_careful: CFI_ADJUST_CFA_OFFSET -8 andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi cli - TRACE_IRQS_OFF jmp int_restore_rest int_signal: @@ -391,7 +364,6 @@ int_signal: int_restore_rest: RESTORE_REST cli - TRACE_IRQS_OFF jmp int_with_check CFI_ENDPROC END(int_ret_from_sys_call) @@ -513,10 +485,6 @@ END(stub_rt_sigreturn) swapgs 1: incl %gs:pda_irqcount # RED-PEN should check preempt count cmoveq %gs:pda_irqstackptr,%rsp - /* - * We entered an interrupt context - irqs are off: - */ - TRACE_IRQS_OFF call \func .endm @@ -526,7 +494,6 @@ ENTRY(common_interrupt) /* 0(%rsp): oldrsp-ARGOFFSET */ ret_from_intr: cli - TRACE_IRQS_OFF decl %gs:pda_irqcount leaveq CFI_DEF_CFA_REGISTER rsp @@ -549,21 +516,9 @@ retint_check: CFI_REMEMBER_STATE jnz retint_careful retint_swapgs: - /* - * The iretq could re-enable interrupts: - */ - cli - TRACE_IRQS_IRETQ swapgs - jmp restore_args - retint_restore_args: cli - /* - * The iretq could re-enable interrupts: - */ - TRACE_IRQS_IRETQ -restore_args: RESTORE_ARGS 0,8,0 iret_label: iretq @@ -576,7 +531,6 @@ iret_label: /* running with kernel gs */ bad_iret: movq $11,%rdi /* SIGSEGV */ - TRACE_IRQS_ON sti jmp do_exit .previous @@ -586,7 +540,6 @@ retint_careful: CFI_RESTORE_STATE bt $TIF_NEED_RESCHED,%edx jnc retint_signal - TRACE_IRQS_ON sti pushq %rdi CFI_ADJUST_CFA_OFFSET 8 @@ -595,13 +548,11 @@ retint_careful: CFI_ADJUST_CFA_OFFSET -8 GET_THREAD_INFO(%rcx) cli - TRACE_IRQS_OFF jmp retint_check retint_signal: testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx jz retint_swapgs - TRACE_IRQS_ON sti SAVE_REST movq $-1,ORIG_RAX(%rsp) @@ -610,7 +561,6 @@ retint_signal: call do_notify_resume RESTORE_REST cli - TRACE_IRQS_OFF movl $_TIF_NEED_RESCHED,%edi GET_THREAD_INFO(%rcx) jmp retint_check @@ -717,7 +667,7 @@ END(spurious_interrupt) /* error code is on the stack already */ /* handle NMI like exceptions that can happen everywhere */ - .macro paranoidentry sym, ist=0, irqtrace=1 + .macro paranoidentry sym, ist=0 SAVE_ALL cld movl $1,%ebx @@ -742,73 +692,8 @@ END(spurious_interrupt) addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) .endif cli - .if \irqtrace - TRACE_IRQS_OFF - .endif - .endm - - /* - * "Paranoid" exit path from exception stack. - * Paranoid because this is used by NMIs and cannot take - * any kernel state for granted. - * We don't do kernel preemption checks here, because only - * NMI should be common and it does not enable IRQs and - * cannot get reschedule ticks. - * - * "trace" is 0 for the NMI handler only, because irq-tracing - * is fundamentally NMI-unsafe. (we cannot change the soft and - * hard flags at once, atomically) - */ - .macro paranoidexit trace=1 - /* ebx: no swapgs flag */ -paranoid_exit\trace: - testl %ebx,%ebx /* swapgs needed? */ - jnz paranoid_restore\trace - testl $3,CS(%rsp) - jnz paranoid_userspace\trace -paranoid_swapgs\trace: - TRACE_IRQS_IRETQ 0 - swapgs -paranoid_restore\trace: - RESTORE_ALL 8 - iretq -paranoid_userspace\trace: - GET_THREAD_INFO(%rcx) - movl threadinfo_flags(%rcx),%ebx - andl $_TIF_WORK_MASK,%ebx - jz paranoid_swapgs\trace - movq %rsp,%rdi /* &pt_regs */ - call sync_regs - movq %rax,%rsp /* switch stack for scheduling */ - testl $_TIF_NEED_RESCHED,%ebx - jnz paranoid_schedule\trace - movl %ebx,%edx /* arg3: thread flags */ - .if \trace - TRACE_IRQS_ON - .endif - sti - xorl %esi,%esi /* arg2: oldset */ - movq %rsp,%rdi /* arg1: &pt_regs */ - call do_notify_resume - cli - .if \trace - TRACE_IRQS_OFF - .endif - jmp paranoid_userspace\trace -paranoid_schedule\trace: - .if \trace - TRACE_IRQS_ON - .endif - sti - call schedule - cli - .if \trace - TRACE_IRQS_OFF - .endif - jmp paranoid_userspace\trace - CFI_ENDPROC .endm - + /* * Exception entry point. This expects an error code/orig_rax on the stack * and the exception handler in %rax. @@ -864,7 +749,6 @@ error_exit: movl %ebx,%eax RESTORE_REST cli - TRACE_IRQS_OFF GET_THREAD_INFO(%rcx) testl %eax,%eax jne retint_kernel @@ -872,10 +756,6 @@ error_exit: movl $_TIF_WORK_MASK,%edi andl %edi,%edx jnz retint_careful - /* - * The iret might restore flags: - */ - TRACE_IRQS_IRETQ swapgs RESTORE_ARGS 0,8,0 jmp iret_label @@ -1037,7 +917,8 @@ KPROBE_ENTRY(debug) pushq $0 CFI_ADJUST_CFA_OFFSET 8 paranoidentry do_debug, DEBUG_STACK - paranoidexit + jmp paranoid_exit + CFI_ENDPROC END(debug) .previous .text @@ -1046,13 +927,49 @@ KPROBE_ENTRY(nmi) INTR_FRAME pushq $-1 CFI_ADJUST_CFA_OFFSET 8 - paranoidentry do_nmi, 0, 0 -#ifdef CONFIG_TRACE_IRQFLAGS - paranoidexit 0 -#else - jmp paranoid_exit1 - CFI_ENDPROC -#endif + paranoidentry do_nmi + /* + * "Paranoid" exit path from exception stack. + * Paranoid because this is used by NMIs and cannot take + * any kernel state for granted. + * We don't do kernel preemption checks here, because only + * NMI should be common and it does not enable IRQs and + * cannot get reschedule ticks. + */ + /* ebx: no swapgs flag */ +paranoid_exit: + testl %ebx,%ebx /* swapgs needed? */ + jnz paranoid_restore + testl $3,CS(%rsp) + jnz paranoid_userspace +paranoid_swapgs: + swapgs +paranoid_restore: + RESTORE_ALL 8 + iretq +paranoid_userspace: + GET_THREAD_INFO(%rcx) + movl threadinfo_flags(%rcx),%ebx + andl $_TIF_WORK_MASK,%ebx + jz paranoid_swapgs + movq %rsp,%rdi /* &pt_regs */ + call sync_regs + movq %rax,%rsp /* switch stack for scheduling */ + testl $_TIF_NEED_RESCHED,%ebx + jnz paranoid_schedule + movl %ebx,%edx /* arg3: thread flags */ + sti + xorl %esi,%esi /* arg2: oldset */ + movq %rsp,%rdi /* arg1: &pt_regs */ + call do_notify_resume + cli + jmp paranoid_userspace +paranoid_schedule: + sti + call schedule + cli + jmp paranoid_userspace + CFI_ENDPROC END(nmi) .previous .text @@ -1061,7 +978,7 @@ KPROBE_ENTRY(int3) pushq $0 CFI_ADJUST_CFA_OFFSET 8 paranoidentry do_int3, DEBUG_STACK - jmp paranoid_exit1 + jmp paranoid_exit CFI_ENDPROC END(int3) .previous .text @@ -1090,7 +1007,7 @@ END(reserved) ENTRY(double_fault) XCPT_FRAME paranoidentry do_double_fault - jmp paranoid_exit1 + jmp paranoid_exit CFI_ENDPROC END(double_fault) @@ -1106,7 +1023,7 @@ END(segment_not_present) ENTRY(stack_segment) XCPT_FRAME paranoidentry do_stack_segment - jmp paranoid_exit1 + jmp paranoid_exit CFI_ENDPROC END(stack_segment) @@ -1134,7 +1051,7 @@ ENTRY(machine_check) pushq $0 CFI_ADJUST_CFA_OFFSET 8 paranoidentry do_machine_check - jmp paranoid_exit1 + jmp paranoid_exit CFI_ENDPROC END(machine_check) #endif diff --git a/trunk/arch/x86_64/kernel/genapic.c b/trunk/arch/x86_64/kernel/genapic.c index 8e78a75d1866..7a64ea181788 100644 --- a/trunk/arch/x86_64/kernel/genapic.c +++ b/trunk/arch/x86_64/kernel/genapic.c @@ -8,6 +8,7 @@ * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and * James Cleverdon. */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/genapic_cluster.c b/trunk/arch/x86_64/kernel/genapic_cluster.c index 3020917546de..43fcf62fef0f 100644 --- a/trunk/arch/x86_64/kernel/genapic_cluster.c +++ b/trunk/arch/x86_64/kernel/genapic_cluster.c @@ -9,6 +9,7 @@ * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and * James Cleverdon. */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/genapic_flat.c b/trunk/arch/x86_64/kernel/genapic_flat.c index eb86d374813a..21c7066e236a 100644 --- a/trunk/arch/x86_64/kernel/genapic_flat.c +++ b/trunk/arch/x86_64/kernel/genapic_flat.c @@ -8,6 +8,7 @@ * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and * James Cleverdon. */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/head64.c b/trunk/arch/x86_64/kernel/head64.c index 36647ce6aecb..e6a71c9556d9 100644 --- a/trunk/arch/x86_64/kernel/head64.c +++ b/trunk/arch/x86_64/kernel/head64.c @@ -84,11 +84,6 @@ void __init x86_64_start_kernel(char * real_mode_data) asm volatile("lidt %0" :: "m" (idt_descr)); clear_bss(); - /* - * This must be called really, really early: - */ - lockdep_init(); - /* * switch to init_level4_pgt from boot_level4_pgt */ diff --git a/trunk/arch/x86_64/kernel/i387.c b/trunk/arch/x86_64/kernel/i387.c index 3aa1e9bb781d..44ddb1ec808d 100644 --- a/trunk/arch/x86_64/kernel/i387.c +++ b/trunk/arch/x86_64/kernel/i387.c @@ -14,6 +14,7 @@ * the 64bit user space sees a FXSAVE frame directly. */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/i8259.c b/trunk/arch/x86_64/kernel/i8259.c index 0434b1f8e3dd..3dd1659427dc 100644 --- a/trunk/arch/x86_64/kernel/i8259.c +++ b/trunk/arch/x86_64/kernel/i8259.c @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/io_apic.c b/trunk/arch/x86_64/kernel/io_apic.c index 924a4a332954..401b687fef21 100644 --- a/trunk/arch/x86_64/kernel/io_apic.c +++ b/trunk/arch/x86_64/kernel/io_apic.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/irq.c b/trunk/arch/x86_64/kernel/irq.c index 5221a53e90c1..a1f1df5f7bfc 100644 --- a/trunk/arch/x86_64/kernel/irq.c +++ b/trunk/arch/x86_64/kernel/irq.c @@ -177,10 +177,8 @@ asmlinkage void do_softirq(void) local_irq_save(flags); pending = local_softirq_pending(); /* Switch to interrupt stack */ - if (pending) { + if (pending) call_softirq(); - WARN_ON_ONCE(softirq_count()); - } local_irq_restore(flags); } EXPORT_SYMBOL(do_softirq); diff --git a/trunk/arch/x86_64/kernel/kprobes.c b/trunk/arch/x86_64/kernel/kprobes.c index ffc73ac72485..fa1d19ca700a 100644 --- a/trunk/arch/x86_64/kernel/kprobes.c +++ b/trunk/arch/x86_64/kernel/kprobes.c @@ -31,6 +31,7 @@ * Added function return probes functionality */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/mpparse.c b/trunk/arch/x86_64/kernel/mpparse.c index a1ab4197f8a1..083da7e606b1 100644 --- a/trunk/arch/x86_64/kernel/mpparse.c +++ b/trunk/arch/x86_64/kernel/mpparse.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/nmi.c b/trunk/arch/x86_64/kernel/nmi.c index 5baa0c726e97..0ef9cf2bc45e 100644 --- a/trunk/arch/x86_64/kernel/nmi.c +++ b/trunk/arch/x86_64/kernel/nmi.c @@ -12,6 +12,7 @@ * Mikael Pettersson : PM converted to driver model. Disable/enable API. */ +#include #include #include #include @@ -127,7 +128,7 @@ void __cpuinit nmi_watchdog_default(void) static __init void nmi_cpu_busy(void *data) { volatile int *endflag = data; - local_irq_enable_in_hardirq(); + local_irq_enable(); /* Intentionally don't use cpu_relax here. This is to make sure that the performance counter really ticks, even if there is a simulator or similar that catches the diff --git a/trunk/arch/x86_64/kernel/pci-gart.c b/trunk/arch/x86_64/kernel/pci-gart.c index 6d3e61baf7a0..4ca674d16b09 100644 --- a/trunk/arch/x86_64/kernel/pci-gart.c +++ b/trunk/arch/x86_64/kernel/pci-gart.c @@ -10,6 +10,7 @@ * Copyright 2002 Andi Kleen, SuSE Labs. */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/process.c b/trunk/arch/x86_64/kernel/process.c index bb6745d13b8f..ca56e19b8b6e 100644 --- a/trunk/arch/x86_64/kernel/process.c +++ b/trunk/arch/x86_64/kernel/process.c @@ -296,7 +296,7 @@ void __show_regs(struct pt_regs * regs) system_utsname.version); printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip); printk_address(regs->rip); - printk("RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->rsp, + printk("\nRSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->rsp, regs->eflags); printk("RAX: %016lx RBX: %016lx RCX: %016lx\n", regs->rax, regs->rbx, regs->rcx); diff --git a/trunk/arch/x86_64/kernel/setup.c b/trunk/arch/x86_64/kernel/setup.c index 0925518b58d0..1129918ede82 100644 --- a/trunk/arch/x86_64/kernel/setup.c +++ b/trunk/arch/x86_64/kernel/setup.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/setup64.c b/trunk/arch/x86_64/kernel/setup64.c index 6fe58a634b5f..f5934cb4a2b6 100644 --- a/trunk/arch/x86_64/kernel/setup64.c +++ b/trunk/arch/x86_64/kernel/setup64.c @@ -4,6 +4,7 @@ * Copyright 2001, 2002, 2003 SuSE Labs / Andi Kleen. * See setup.c for older changelog. */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/smpboot.c b/trunk/arch/x86_64/kernel/smpboot.c index b7c705969791..540c0ccbcccc 100644 --- a/trunk/arch/x86_64/kernel/smpboot.c +++ b/trunk/arch/x86_64/kernel/smpboot.c @@ -38,6 +38,7 @@ */ +#include #include #include @@ -775,8 +776,6 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid) }; DECLARE_WORK(work, do_fork_idle, &c_idle); - lockdep_set_class(&c_idle.done.wait.lock, &waitqueue_lock_key); - /* allocate memory for gdts of secondary cpus. Hotplug is considered */ if (!cpu_gdt_descr[cpu].address && !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) { diff --git a/trunk/arch/x86_64/kernel/stacktrace.c b/trunk/arch/x86_64/kernel/stacktrace.c deleted file mode 100644 index 32cf55eb9af8..000000000000 --- a/trunk/arch/x86_64/kernel/stacktrace.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * arch/x86_64/kernel/stacktrace.c - * - * Stack trace management functions - * - * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar - */ -#include -#include - -#include - -static inline int -in_range(unsigned long start, unsigned long addr, unsigned long end) -{ - return addr >= start && addr <= end; -} - -static unsigned long -get_stack_end(struct task_struct *task, unsigned long stack) -{ - unsigned long stack_start, stack_end, flags; - int i, cpu; - - /* - * The most common case is that we are in the task stack: - */ - stack_start = (unsigned long)task->thread_info; - stack_end = stack_start + THREAD_SIZE; - - if (in_range(stack_start, stack, stack_end)) - return stack_end; - - /* - * We are in an interrupt if irqstackptr is set: - */ - raw_local_irq_save(flags); - cpu = safe_smp_processor_id(); - stack_end = (unsigned long)cpu_pda(cpu)->irqstackptr; - - if (stack_end) { - stack_start = stack_end & ~(IRQSTACKSIZE-1); - if (in_range(stack_start, stack, stack_end)) - goto out_restore; - /* - * We get here if we are in an IRQ context but we - * are also in an exception stack. - */ - } - - /* - * Iterate over all exception stacks, and figure out whether - * 'stack' is in one of them: - */ - for (i = 0; i < N_EXCEPTION_STACKS; i++) { - /* - * set 'end' to the end of the exception stack. - */ - stack_end = per_cpu(init_tss, cpu).ist[i]; - stack_start = stack_end - EXCEPTION_STKSZ; - - /* - * Is 'stack' above this exception frame's end? - * If yes then skip to the next frame. - */ - if (stack >= stack_end) - continue; - /* - * Is 'stack' above this exception frame's start address? - * If yes then we found the right frame. - */ - if (stack >= stack_start) - goto out_restore; - - /* - * If this is a debug stack, and if it has a larger size than - * the usual exception stacks, then 'stack' might still - * be within the lower portion of the debug stack: - */ -#if DEBUG_STKSZ > EXCEPTION_STKSZ - if (i == DEBUG_STACK - 1 && stack >= stack_end - DEBUG_STKSZ) { - /* - * Black magic. A large debug stack is composed of - * multiple exception stack entries, which we - * iterate through now. Dont look: - */ - do { - stack_end -= EXCEPTION_STKSZ; - stack_start -= EXCEPTION_STKSZ; - } while (stack < stack_start); - - goto out_restore; - } -#endif - } - /* - * Ok, 'stack' is not pointing to any of the system stacks. - */ - stack_end = 0; - -out_restore: - raw_local_irq_restore(flags); - - return stack_end; -} - - -/* - * Save stack-backtrace addresses into a stack_trace buffer: - */ -static inline unsigned long -save_context_stack(struct stack_trace *trace, unsigned int skip, - unsigned long stack, unsigned long stack_end) -{ - unsigned long addr; - -#ifdef CONFIG_FRAME_POINTER - unsigned long prev_stack = 0; - - while (in_range(prev_stack, stack, stack_end)) { - pr_debug("stack: %p\n", (void *)stack); - addr = (unsigned long)(((unsigned long *)stack)[1]); - pr_debug("addr: %p\n", (void *)addr); - if (!skip) - trace->entries[trace->nr_entries++] = addr-1; - else - skip--; - if (trace->nr_entries >= trace->max_entries) - break; - if (!addr) - return 0; - /* - * Stack frames must go forwards (otherwise a loop could - * happen if the stackframe is corrupted), so we move - * prev_stack forwards: - */ - prev_stack = stack; - stack = (unsigned long)(((unsigned long *)stack)[0]); - } - pr_debug("invalid: %p\n", (void *)stack); -#else - while (stack < stack_end) { - addr = ((unsigned long *)stack)[0]; - stack += sizeof(long); - if (__kernel_text_address(addr)) { - if (!skip) - trace->entries[trace->nr_entries++] = addr-1; - else - skip--; - if (trace->nr_entries >= trace->max_entries) - break; - } - } -#endif - return stack; -} - -#define MAX_STACKS 10 - -/* - * Save stack-backtrace addresses into a stack_trace buffer. - * If all_contexts is set, all contexts (hardirq, softirq and process) - * are saved. If not set then only the current context is saved. - */ -void save_stack_trace(struct stack_trace *trace, - struct task_struct *task, int all_contexts, - unsigned int skip) -{ - unsigned long stack = (unsigned long)&stack; - int i, nr_stacks = 0, stacks_done[MAX_STACKS]; - - WARN_ON(trace->nr_entries || !trace->max_entries); - - if (!task) - task = current; - - pr_debug("task: %p, ti: %p\n", task, task->thread_info); - - if (!task || task == current) { - /* Grab rbp right from our regs: */ - asm ("mov %%rbp, %0" : "=r" (stack)); - pr_debug("rbp: %p\n", (void *)stack); - } else { - /* rbp is the last reg pushed by switch_to(): */ - stack = task->thread.rsp; - pr_debug("other task rsp: %p\n", (void *)stack); - stack = (unsigned long)(((unsigned long *)stack)[0]); - pr_debug("other task rbp: %p\n", (void *)stack); - } - - while (1) { - unsigned long stack_end = get_stack_end(task, stack); - - pr_debug("stack: %p\n", (void *)stack); - pr_debug("stack end: %p\n", (void *)stack_end); - - /* - * Invalid stack addres? - */ - if (!stack_end) - return; - /* - * Were we in this stack already? (recursion) - */ - for (i = 0; i < nr_stacks; i++) - if (stacks_done[i] == stack_end) - return; - stacks_done[nr_stacks] = stack_end; - - stack = save_context_stack(trace, skip, stack, stack_end); - if (!all_contexts || !stack || - trace->nr_entries >= trace->max_entries) - return; - trace->entries[trace->nr_entries++] = ULONG_MAX; - if (trace->nr_entries >= trace->max_entries) - return; - if (++nr_stacks >= MAX_STACKS) - return; - } -} - diff --git a/trunk/arch/x86_64/kernel/suspend.c b/trunk/arch/x86_64/kernel/suspend.c index 91f7e678bae7..ecbd34c1093d 100644 --- a/trunk/arch/x86_64/kernel/suspend.c +++ b/trunk/arch/x86_64/kernel/suspend.c @@ -7,6 +7,7 @@ * Copyright (c) 2001 Patrick Mochel */ +#include #include #include #include diff --git a/trunk/arch/x86_64/kernel/syscall.c b/trunk/arch/x86_64/kernel/syscall.c index 213fd6ab789d..7c176b3edde0 100644 --- a/trunk/arch/x86_64/kernel/syscall.c +++ b/trunk/arch/x86_64/kernel/syscall.c @@ -3,6 +3,7 @@ #include #include #include +#include #define __NO_STUBS diff --git a/trunk/arch/x86_64/kernel/time.c b/trunk/arch/x86_64/kernel/time.c index b9ff75992c16..ebbee6f59ff5 100644 --- a/trunk/arch/x86_64/kernel/time.c +++ b/trunk/arch/x86_64/kernel/time.c @@ -889,7 +889,7 @@ int __init time_setup(char *str) } static struct irqaction irq0 = { - timer_interrupt, IRQF_DISABLED, CPU_MASK_NONE, "timer", NULL, NULL + timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL }; void __init time_init(void) diff --git a/trunk/arch/x86_64/kernel/traps.c b/trunk/arch/x86_64/kernel/traps.c index 79d05c482072..3d11a2fe45b7 100644 --- a/trunk/arch/x86_64/kernel/traps.c +++ b/trunk/arch/x86_64/kernel/traps.c @@ -12,6 +12,7 @@ * 'Traps.c' handles hardware traps and faults after we have saved some * state in 'entry.S'. */ +#include #include #include #include @@ -110,31 +111,28 @@ static int kstack_depth_to_print = 12; static int call_trace = 1; #ifdef CONFIG_KALLSYMS -# include -void printk_address(unsigned long address) -{ +#include +int printk_address(unsigned long address) +{ unsigned long offset = 0, symsize; const char *symname; char *modname; - char *delim = ":"; + char *delim = ":"; char namebuf[128]; - symname = kallsyms_lookup(address, &symsize, &offset, - &modname, namebuf); - if (!symname) { - printk(" [<%016lx>]\n", address); - return; - } - if (!modname) + symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf); + if (!symname) + return printk("[<%016lx>]", address); + if (!modname) modname = delim = ""; - printk(" [<%016lx>] %s%s%s%s+0x%lx/0x%lx\n", - address, delim, modname, delim, symname, offset, symsize); -} + return printk("<%016lx>{%s%s%s%s%+ld}", + address, delim, modname, delim, symname, offset); +} #else -void printk_address(unsigned long address) -{ - printk(" [<%016lx>]\n", address); -} +int printk_address(unsigned long address) +{ + return printk("[<%016lx>]", address); +} #endif static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, @@ -152,22 +150,10 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, }; unsigned k; - /* - * Iterate over all exception stacks, and figure out whether - * 'stack' is in one of them: - */ for (k = 0; k < N_EXCEPTION_STACKS; k++) { unsigned long end; - /* - * set 'end' to the end of the exception stack. - */ switch (k + 1) { - /* - * TODO: this block is not needed i think, because - * setup64.c:cpu_init() sets up t->ist[DEBUG_STACK] - * properly too. - */ #if DEBUG_STKSZ > EXCEPTION_STKSZ case DEBUG_STACK: end = cpu_pda(cpu)->debugstack + DEBUG_STKSZ; @@ -177,43 +163,19 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, end = per_cpu(init_tss, cpu).ist[k]; break; } - /* - * Is 'stack' above this exception frame's end? - * If yes then skip to the next frame. - */ if (stack >= end) continue; - /* - * Is 'stack' above this exception frame's start address? - * If yes then we found the right frame. - */ if (stack >= end - EXCEPTION_STKSZ) { - /* - * Make sure we only iterate through an exception - * stack once. If it comes up for the second time - * then there's something wrong going on - just - * break out and return NULL: - */ if (*usedp & (1U << k)) break; *usedp |= 1U << k; *idp = ids[k]; return (unsigned long *)end; } - /* - * If this is a debug stack, and if it has a larger size than - * the usual exception stacks, then 'stack' might still - * be within the lower portion of the debug stack: - */ #if DEBUG_STKSZ > EXCEPTION_STKSZ if (k == DEBUG_STACK - 1 && stack >= end - DEBUG_STKSZ) { unsigned j = N_EXCEPTION_STACKS - 1; - /* - * Black magic. A large debug stack is composed of - * multiple exception stack entries, which we - * iterate through now. Dont look: - */ do { ++j; end -= EXCEPTION_STKSZ; @@ -232,14 +194,20 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, static int show_trace_unwind(struct unwind_frame_info *info, void *context) { - int n = 0; + int i = 11, n = 0; while (unwind(info) == 0 && UNW_PC(info)) { - n++; - printk_address(UNW_PC(info)); + ++n; + if (i > 50) { + printk("\n "); + i = 7; + } else + i += printk(" "); + i += printk_address(UNW_PC(info)); if (arch_unw_user_mode(info)) break; } + printk("\n"); return n; } @@ -257,7 +225,7 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s int i = 11; unsigned used = 0; - printk("\nCall Trace:\n"); + printk("\nCall Trace:"); if (!tsk) tsk = current; @@ -283,15 +251,16 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s } } - /* - * Print function call entries within a stack. 'cond' is the - * "end of stackframe" condition, that the 'stack++' - * iteration will eventually trigger. - */ #define HANDLE_STACK(cond) \ do while (cond) { \ unsigned long addr = *stack++; \ if (kernel_text_address(addr)) { \ + if (i > 50) { \ + printk("\n "); \ + i = 0; \ + } \ + else \ + i += printk(" "); \ /* \ * If the address is either in the text segment of the \ * kernel, or in the region which contains vmalloc'ed \ @@ -300,30 +269,20 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s * down the cause of the crash will be able to figure \ * out the call path that was taken. \ */ \ - printk_address(addr); \ + i += printk_address(addr); \ } \ } while (0) - /* - * Print function call entries in all stacks, starting at the - * current stack address. If the stacks consist of nested - * exceptions - */ - for ( ; ; ) { + for(; ; ) { const char *id; unsigned long *estack_end; estack_end = in_exception_stack(cpu, (unsigned long)stack, &used, &id); if (estack_end) { - printk(" <%s>", id); + i += printk(" <%s>", id); HANDLE_STACK (stack < estack_end); - printk(" "); - /* - * We link to the next stack via the - * second-to-last pointer (index -2 to end) in the - * exception stack: - */ + i += printk(" "); stack = (unsigned long *) estack_end[-2]; continue; } @@ -333,28 +292,19 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s (IRQSTACKSIZE - 64) / sizeof(*irqstack); if (stack >= irqstack && stack < irqstack_end) { - printk(" "); + i += printk(" "); HANDLE_STACK (stack < irqstack_end); - /* - * We link to the next stack (which would be - * the process stack normally) the last - * pointer (index -1 to end) in the IRQ stack: - */ stack = (unsigned long *) (irqstack_end[-1]); irqstack_end = NULL; - printk(" "); + i += printk(" "); continue; } } break; } - /* - * This prints the process stack: - */ HANDLE_STACK (((long) stack & (THREAD_SIZE-1)) != 0); #undef HANDLE_STACK - printk("\n"); } @@ -388,8 +338,8 @@ static void _show_stack(struct task_struct *tsk, struct pt_regs *regs, unsigned break; } if (i && ((i % 4) == 0)) - printk("\n"); - printk(" %016lx", *stack++); + printk("\n "); + printk("%016lx ", *stack++); touch_nmi_watchdog(); } show_trace(tsk, regs, rsp); diff --git a/trunk/arch/x86_64/kernel/vmlinux.lds.S b/trunk/arch/x86_64/kernel/vmlinux.lds.S index 7c4de31471d4..1c6a5f322919 100644 --- a/trunk/arch/x86_64/kernel/vmlinux.lds.S +++ b/trunk/arch/x86_64/kernel/vmlinux.lds.S @@ -6,6 +6,7 @@ #include #include +#include #undef i386 /* in case the preprocessor is a 32bit one */ diff --git a/trunk/arch/x86_64/lib/thunk.S b/trunk/arch/x86_64/lib/thunk.S index 332ea5dff916..e49af0032e94 100644 --- a/trunk/arch/x86_64/lib/thunk.S +++ b/trunk/arch/x86_64/lib/thunk.S @@ -47,11 +47,6 @@ thunk_retrax __down_failed_interruptible,__down_interruptible thunk_retrax __down_failed_trylock,__down_trylock thunk __up_wakeup,__up - -#ifdef CONFIG_TRACE_IRQFLAGS - thunk trace_hardirqs_on_thunk,trace_hardirqs_on - thunk trace_hardirqs_off_thunk,trace_hardirqs_off -#endif /* SAVE_ARGS below is used only for the .cfi directives it contains. */ CFI_STARTPROC diff --git a/trunk/arch/x86_64/mm/extable.c b/trunk/arch/x86_64/mm/extable.c index 79ac6e7100af..2d78f9fb4035 100644 --- a/trunk/arch/x86_64/mm/extable.c +++ b/trunk/arch/x86_64/mm/extable.c @@ -2,6 +2,7 @@ * linux/arch/x86_64/mm/extable.c */ +#include #include #include #include diff --git a/trunk/arch/x86_64/mm/fault.c b/trunk/arch/x86_64/mm/fault.c index ac8ea66ccb94..08dc696f54ee 100644 --- a/trunk/arch/x86_64/mm/fault.c +++ b/trunk/arch/x86_64/mm/fault.c @@ -5,6 +5,7 @@ * Copyright (C) 2001,2002 Andi Kleen, SuSE Labs. */ +#include #include #include #include @@ -417,7 +418,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, /* When running in the kernel we expect faults to occur only to * addresses in user space. All other faults represent errors in the * kernel and should generate an OOPS. Unfortunatly, in the case of an - * erroneous fault occurring in a code path which already holds mmap_sem + * erroneous fault occuring in a code path which already holds mmap_sem * we will deadlock attempting to validate the fault against the * address space. Luckily the kernel only validly references user * space from well defined areas of code, which are listed in the @@ -570,6 +571,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, printk(KERN_ALERT "Unable to handle kernel paging request"); printk(" at %016lx RIP: \n" KERN_ALERT,address); printk_address(regs->rip); + printk("\n"); dump_pagetable(address); tsk->thread.cr2 = address; tsk->thread.trap_no = 14; diff --git a/trunk/arch/x86_64/mm/init.c b/trunk/arch/x86_64/mm/init.c index d14fb2dfbfc4..95bd232ff0cf 100644 --- a/trunk/arch/x86_64/mm/init.c +++ b/trunk/arch/x86_64/mm/init.c @@ -6,6 +6,7 @@ * Copyright (C) 2002,2003 Andi Kleen */ +#include #include #include #include @@ -678,15 +679,16 @@ void free_initmem(void) #ifdef CONFIG_DEBUG_RODATA +extern char __start_rodata, __end_rodata; void mark_rodata_ro(void) { - unsigned long addr = (unsigned long)__start_rodata; + unsigned long addr = (unsigned long)&__start_rodata; - for (; addr < (unsigned long)__end_rodata; addr += PAGE_SIZE) + for (; addr < (unsigned long)&__end_rodata; addr += PAGE_SIZE) change_page_attr_addr(addr, 1, PAGE_KERNEL_RO); printk ("Write protecting the kernel read-only data: %luk\n", - (__end_rodata - __start_rodata) >> 10); + (&__end_rodata - &__start_rodata) >> 10); /* * change_page_attr_addr() requires a global_flush_tlb() call after it. diff --git a/trunk/arch/x86_64/mm/mmap.c b/trunk/arch/x86_64/mm/mmap.c index 80bba0dc000e..43e9b99bdf25 100644 --- a/trunk/arch/x86_64/mm/mmap.c +++ b/trunk/arch/x86_64/mm/mmap.c @@ -1,6 +1,7 @@ /* Copyright 2005 Andi Kleen, SuSE Labs. * Licensed under GPL, v.2 */ +#include #include #include #include diff --git a/trunk/arch/x86_64/mm/pageattr.c b/trunk/arch/x86_64/mm/pageattr.c index 2685b1f3671c..531ad21447b1 100644 --- a/trunk/arch/x86_64/mm/pageattr.c +++ b/trunk/arch/x86_64/mm/pageattr.c @@ -3,6 +3,7 @@ * Thanks to Ben LaHaise for precious feedback. */ +#include #include #include #include diff --git a/trunk/arch/xtensa/boot/boot-elf/bootstrap.S b/trunk/arch/xtensa/boot/boot-elf/bootstrap.S index f857fc760aa8..7cba94abdab8 100644 --- a/trunk/arch/xtensa/boot/boot-elf/bootstrap.S +++ b/trunk/arch/xtensa/boot/boot-elf/bootstrap.S @@ -2,6 +2,7 @@ #include #include +#include #include diff --git a/trunk/arch/xtensa/kernel/coprocessor.S b/trunk/arch/xtensa/kernel/coprocessor.S index cf5a93fb6a2e..356192a4d39d 100644 --- a/trunk/arch/xtensa/kernel/coprocessor.S +++ b/trunk/arch/xtensa/kernel/coprocessor.S @@ -24,6 +24,7 @@ * assigned when the Xtensa processor is generated. */ +#include #include #include diff --git a/trunk/arch/xtensa/kernel/head.S b/trunk/arch/xtensa/kernel/head.S index c07cb2522993..6e9b5225b8f6 100644 --- a/trunk/arch/xtensa/kernel/head.S +++ b/trunk/arch/xtensa/kernel/head.S @@ -16,6 +16,7 @@ */ #include +#include #include #include diff --git a/trunk/arch/xtensa/kernel/pci.c b/trunk/arch/xtensa/kernel/pci.c index 8709f8249d02..eda029fc8972 100644 --- a/trunk/arch/xtensa/kernel/pci.c +++ b/trunk/arch/xtensa/kernel/pci.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/xtensa/kernel/platform.c b/trunk/arch/xtensa/kernel/platform.c index 69675f216062..a17930747f20 100644 --- a/trunk/arch/xtensa/kernel/platform.c +++ b/trunk/arch/xtensa/kernel/platform.c @@ -12,6 +12,7 @@ * Chris Zankel */ +#include #include #include #include diff --git a/trunk/arch/xtensa/kernel/process.c b/trunk/arch/xtensa/kernel/process.c index a7c4178c2a8c..64a649eb883f 100644 --- a/trunk/arch/xtensa/kernel/process.c +++ b/trunk/arch/xtensa/kernel/process.c @@ -16,6 +16,7 @@ * Kevin Chea */ +#include #include #include #include diff --git a/trunk/arch/xtensa/kernel/ptrace.c b/trunk/arch/xtensa/kernel/ptrace.c index 5064d9383963..4cc85285a70a 100644 --- a/trunk/arch/xtensa/kernel/ptrace.c +++ b/trunk/arch/xtensa/kernel/ptrace.c @@ -13,6 +13,7 @@ * Marc Gauthier */ +#include #include #include #include diff --git a/trunk/arch/xtensa/kernel/setup.c b/trunk/arch/xtensa/kernel/setup.c index edb29410d953..513ed8d67766 100644 --- a/trunk/arch/xtensa/kernel/setup.c +++ b/trunk/arch/xtensa/kernel/setup.c @@ -14,6 +14,7 @@ * Marc Gauthier */ +#include #include #include #include diff --git a/trunk/arch/xtensa/kernel/syscalls.c b/trunk/arch/xtensa/kernel/syscalls.c index 4688ba2db84d..f20c6494c518 100644 --- a/trunk/arch/xtensa/kernel/syscalls.c +++ b/trunk/arch/xtensa/kernel/syscalls.c @@ -18,6 +18,7 @@ #define DEBUG 0 +#include #include #include #include diff --git a/trunk/arch/xtensa/kernel/time.c b/trunk/arch/xtensa/kernel/time.c index 412ab32de391..fe14909f45e0 100644 --- a/trunk/arch/xtensa/kernel/time.c +++ b/trunk/arch/xtensa/kernel/time.c @@ -12,6 +12,7 @@ * Chris Zankel */ +#include #include #include #include @@ -52,7 +53,7 @@ unsigned long long sched_clock(void) static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs); static struct irqaction timer_irqaction = { .handler = timer_interrupt, - .flags = IRQF_DISABLED, + .flags = SA_INTERRUPT, .name = "timer", }; diff --git a/trunk/arch/xtensa/kernel/vmlinux.lds.S b/trunk/arch/xtensa/kernel/vmlinux.lds.S index ab6cdbd5eb68..5ed71dfc8110 100644 --- a/trunk/arch/xtensa/kernel/vmlinux.lds.S +++ b/trunk/arch/xtensa/kernel/vmlinux.lds.S @@ -16,6 +16,7 @@ #include +#include #define _NOCLANGUAGE #include #include diff --git a/trunk/arch/xtensa/kernel/xtensa_ksyms.c b/trunk/arch/xtensa/kernel/xtensa_ksyms.c index 0b4cb93db5a3..a15b6e3e72c8 100644 --- a/trunk/arch/xtensa/kernel/xtensa_ksyms.c +++ b/trunk/arch/xtensa/kernel/xtensa_ksyms.c @@ -12,6 +12,7 @@ * Joe Taylor */ +#include #include #include #include diff --git a/trunk/arch/xtensa/mm/init.c b/trunk/arch/xtensa/mm/init.c index 660ef058c149..e1be4235f367 100644 --- a/trunk/arch/xtensa/mm/init.c +++ b/trunk/arch/xtensa/mm/init.c @@ -15,6 +15,7 @@ * Kevin Chea */ +#include #include #include #include diff --git a/trunk/arch/xtensa/platform-iss/console.c b/trunk/arch/xtensa/platform-iss/console.c index 22d3c571a7bc..2a580efb58ec 100644 --- a/trunk/arch/xtensa/platform-iss/console.c +++ b/trunk/arch/xtensa/platform-iss/console.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/trunk/arch/xtensa/platform-iss/network.c b/trunk/arch/xtensa/platform-iss/network.c index d96164e602fe..0dc55cc8691b 100644 --- a/trunk/arch/xtensa/platform-iss/network.c +++ b/trunk/arch/xtensa/platform-iss/network.c @@ -16,6 +16,7 @@ * */ +#include #include #include #include diff --git a/trunk/arch/xtensa/platform-iss/setup.c b/trunk/arch/xtensa/platform-iss/setup.c index c8a42b60c57a..23790a5610e2 100644 --- a/trunk/arch/xtensa/platform-iss/setup.c +++ b/trunk/arch/xtensa/platform-iss/setup.c @@ -15,6 +15,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/block/as-iosched.c b/trunk/block/as-iosched.c index 5da56d48fbd3..3af31ed49a9c 100644 --- a/trunk/block/as-iosched.c +++ b/trunk/block/as-iosched.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/block/blktrace.c b/trunk/block/blktrace.c index 92925e7d9e6c..36f3a172275f 100644 --- a/trunk/block/blktrace.c +++ b/trunk/block/blktrace.c @@ -15,6 +15,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ +#include #include #include #include diff --git a/trunk/block/cfq-iosched.c b/trunk/block/cfq-iosched.c index 102ebc2c5c34..e25223e147a2 100644 --- a/trunk/block/cfq-iosched.c +++ b/trunk/block/cfq-iosched.c @@ -6,6 +6,7 @@ * * Copyright (C) 2003 Jens Axboe */ +#include #include #include #include diff --git a/trunk/block/deadline-iosched.c b/trunk/block/deadline-iosched.c index c7ca9f0b6498..4469dd84623c 100644 --- a/trunk/block/deadline-iosched.c +++ b/trunk/block/deadline-iosched.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/block/elevator.c b/trunk/block/elevator.c index bc7baeec0d10..d00b283f31d2 100644 --- a/trunk/block/elevator.c +++ b/trunk/block/elevator.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/block/genhd.c b/trunk/block/genhd.c index 25d1f42568cc..8d7339511e5e 100644 --- a/trunk/block/genhd.c +++ b/trunk/block/genhd.c @@ -2,6 +2,7 @@ * gendisk handling */ +#include #include #include #include diff --git a/trunk/block/ll_rw_blk.c b/trunk/block/ll_rw_blk.c index ab17c7224bb6..eee03a3876a3 100644 --- a/trunk/block/ll_rw_blk.c +++ b/trunk/block/ll_rw_blk.c @@ -10,6 +10,7 @@ /* * This handles all read/write requests to block devices */ +#include #include #include #include @@ -2516,7 +2517,7 @@ EXPORT_SYMBOL_GPL(blk_execute_rq_nowait); int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk, struct request *rq, int at_head) { - DECLARE_COMPLETION_ONSTACK(wait); + DECLARE_COMPLETION(wait); char sense[SCSI_SENSE_BUFFERSIZE]; int err = 0; @@ -3116,9 +3117,9 @@ void submit_bio(int rw, struct bio *bio) BIO_BUG_ON(!bio->bi_io_vec); bio->bi_rw |= rw; if (rw & WRITE) - count_vm_events(PGPGOUT, count); + mod_page_state(pgpgout, count); else - count_vm_events(PGPGIN, count); + mod_page_state(pgpgin, count); if (unlikely(block_dump)) { char b[BDEVNAME_SIZE]; diff --git a/trunk/drivers/acorn/block/Kconfig b/trunk/drivers/acorn/block/Kconfig index a0ff25ea439f..073add35e66f 100644 --- a/trunk/drivers/acorn/block/Kconfig +++ b/trunk/drivers/acorn/block/Kconfig @@ -3,7 +3,7 @@ # menu "Acorn-specific block devices" - depends on ARCH_ARC || ARCH_A5K + depends on ARCH_ACORN config BLK_DEV_FD1772 tristate "Old Archimedes floppy (1772) support" diff --git a/trunk/drivers/acorn/block/mfmhd.c b/trunk/drivers/acorn/block/mfmhd.c index 3dd6b7bb5d35..ce074f6f3369 100644 --- a/trunk/drivers/acorn/block/mfmhd.c +++ b/trunk/drivers/acorn/block/mfmhd.c @@ -99,6 +99,7 @@ */ #include +#include #include #include #include @@ -1278,7 +1279,7 @@ static int mfm_do_init(unsigned char irqmask) printk("mfm: detected %d hard drive%s\n", mfm_drives, mfm_drives == 1 ? "" : "s"); - ret = request_irq(mfm_irq, mfm_interrupt_handler, IRQF_DISABLED, "MFM harddisk", NULL); + ret = request_irq(mfm_irq, mfm_interrupt_handler, SA_INTERRUPT, "MFM harddisk", NULL); if (ret) { printk("mfm: unable to get IRQ%d\n", mfm_irq); goto out4; diff --git a/trunk/drivers/acpi/Kconfig b/trunk/drivers/acpi/Kconfig index fef7bab12244..610d2cc02cf8 100644 --- a/trunk/drivers/acpi/Kconfig +++ b/trunk/drivers/acpi/Kconfig @@ -133,13 +133,6 @@ config ACPI_FAN This driver adds support for ACPI fan devices, allowing user-mode applications to perform basic fan control (on, off, status). -config ACPI_DOCK - tristate "Dock" - depends on !ACPI_IBM_DOCK - default y - help - This driver adds support for ACPI controlled docking stations - config ACPI_PROCESSOR tristate "Processor" default y @@ -352,18 +345,6 @@ config ACPI_HOTPLUG_MEMORY If one selects "m," this driver can be loaded using the following command: $>modprobe acpi_memhotplug - -config ACPI_SBS - tristate "Smart Battery System (EXPERIMENTAL)" - depends on X86 && I2C - depends on EXPERIMENTAL - default y - help - This driver adds support for the Smart Battery System. - Depends on I2C (Device Drivers ---> I2C support) - A "Smart Battery" is quite old and quite rare compared - to today's ACPI "Control Method" battery. - endif # ACPI endmenu diff --git a/trunk/drivers/acpi/Makefile b/trunk/drivers/acpi/Makefile index bce7ca27b429..5984b4f6715a 100644 --- a/trunk/drivers/acpi/Makefile +++ b/trunk/drivers/acpi/Makefile @@ -42,7 +42,6 @@ obj-$(CONFIG_ACPI_BATTERY) += battery.o obj-$(CONFIG_ACPI_BUTTON) += button.o obj-$(CONFIG_ACPI_EC) += ec.o obj-$(CONFIG_ACPI_FAN) += fan.o -obj-$(CONFIG_ACPI_DOCK) += dock.o obj-$(CONFIG_ACPI_VIDEO) += video.o obj-$(CONFIG_ACPI_HOTKEY) += hotkey.o obj-y += pci_root.o pci_link.o pci_irq.o pci_bind.o @@ -58,5 +57,3 @@ obj-$(CONFIG_ACPI_IBM) += ibm_acpi.o obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-y += scan.o motherboard.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o -obj-y += cm_sbs.o -obj-$(CONFIG_ACPI_SBS) += i2c_ec.o sbs.o diff --git a/trunk/drivers/acpi/ac.c b/trunk/drivers/acpi/ac.c index 24ccf81d135f..7839b831df94 100644 --- a/trunk/drivers/acpi/ac.c +++ b/trunk/drivers/acpi/ac.c @@ -50,9 +50,6 @@ ACPI_MODULE_NAME("acpi_ac") MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME); MODULE_LICENSE("GPL"); -extern struct proc_dir_entry *acpi_lock_ac_dir(void); -extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); - static int acpi_ac_add(struct acpi_device *device); static int acpi_ac_remove(struct acpi_device *device, int type); static int acpi_ac_open_fs(struct inode *inode, struct file *file); @@ -68,7 +65,7 @@ static struct acpi_driver acpi_ac_driver = { }; struct acpi_ac { - struct acpi_device * device; + acpi_handle handle; unsigned long state; }; @@ -87,18 +84,20 @@ static int acpi_ac_get_state(struct acpi_ac *ac) { acpi_status status = AE_OK; + ACPI_FUNCTION_TRACE("acpi_ac_get_state"); if (!ac) - return -EINVAL; + return_VALUE(-EINVAL); - status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state); + status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error reading AC Adapter state\n")); ac->state = ACPI_AC_STATUS_UNKNOWN; - return -ENODEV; + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -111,13 +110,14 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset) { struct acpi_ac *ac = (struct acpi_ac *)seq->private; + ACPI_FUNCTION_TRACE("acpi_ac_seq_show"); if (!ac) - return 0; + return_VALUE(0); if (acpi_ac_get_state(ac)) { seq_puts(seq, "ERROR: Unable to read AC Adapter state\n"); - return 0; + return_VALUE(0); } seq_puts(seq, "state: "); @@ -133,7 +133,7 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset) break; } - return 0; + return_VALUE(0); } static int acpi_ac_open_fs(struct inode *inode, struct file *file) @@ -145,12 +145,13 @@ static int acpi_ac_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; + ACPI_FUNCTION_TRACE("acpi_ac_add_fs"); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_ac_dir); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); acpi_device_dir(device)->owner = THIS_MODULE; } @@ -158,18 +159,21 @@ static int acpi_ac_add_fs(struct acpi_device *device) entry = create_proc_entry(ACPI_AC_FILE_STATE, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_AC_FILE_STATE)); else { entry->proc_fops = &acpi_ac_fops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } - return 0; + return_VALUE(0); } static int acpi_ac_remove_fs(struct acpi_device *device) { + ACPI_FUNCTION_TRACE("acpi_ac_remove_fs"); if (acpi_device_dir(device)) { remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device)); @@ -178,7 +182,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -190,15 +194,16 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) struct acpi_ac *ac = (struct acpi_ac *)data; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_ac_notify"); if (!ac) - return; + return_VOID; + + if (acpi_bus_get_device(ac->handle, &device)) + return_VOID; - device = ac->device; switch (event) { case ACPI_AC_NOTIFY_STATUS: - case ACPI_NOTIFY_BUS_CHECK: - case ACPI_NOTIFY_DEVICE_CHECK: acpi_ac_get_state(ac); acpi_bus_generate_event(device, event, (u32) ac->state); break; @@ -208,7 +213,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) break; } - return; + return_VOID; } static int acpi_ac_add(struct acpi_device *device) @@ -217,16 +222,17 @@ static int acpi_ac_add(struct acpi_device *device) acpi_status status = AE_OK; struct acpi_ac *ac = NULL; + ACPI_FUNCTION_TRACE("acpi_ac_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL); if (!ac) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(ac, 0, sizeof(struct acpi_ac)); - ac->device = device; + ac->handle = device->handle; strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_AC_CLASS); acpi_driver_data(device) = ac; @@ -239,10 +245,12 @@ static int acpi_ac_add(struct acpi_device *device) if (result) goto end; - status = acpi_install_notify_handler(device->handle, - ACPI_ALL_NOTIFY, acpi_ac_notify, + status = acpi_install_notify_handler(ac->handle, + ACPI_DEVICE_NOTIFY, acpi_ac_notify, ac); if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); result = -ENODEV; goto end; } @@ -257,7 +265,7 @@ static int acpi_ac_add(struct acpi_device *device) kfree(ac); } - return result; + return_VALUE(result); } static int acpi_ac_remove(struct acpi_device *device, int type) @@ -265,48 +273,55 @@ static int acpi_ac_remove(struct acpi_device *device, int type) acpi_status status = AE_OK; struct acpi_ac *ac = NULL; + ACPI_FUNCTION_TRACE("acpi_ac_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); ac = (struct acpi_ac *)acpi_driver_data(device); - status = acpi_remove_notify_handler(device->handle, - ACPI_ALL_NOTIFY, acpi_ac_notify); + status = acpi_remove_notify_handler(ac->handle, + ACPI_DEVICE_NOTIFY, acpi_ac_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); acpi_ac_remove_fs(device); kfree(ac); - return 0; + return_VALUE(0); } static int __init acpi_ac_init(void) { - int result; + int result = 0; + ACPI_FUNCTION_TRACE("acpi_ac_init"); - acpi_ac_dir = acpi_lock_ac_dir(); + acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); if (!acpi_ac_dir) - return -ENODEV; + return_VALUE(-ENODEV); + acpi_ac_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_ac_driver); if (result < 0) { - acpi_unlock_ac_dir(acpi_ac_dir); - return -ENODEV; + remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } static void __exit acpi_ac_exit(void) { + ACPI_FUNCTION_TRACE("acpi_ac_exit"); acpi_bus_unregister_driver(&acpi_ac_driver); - acpi_unlock_ac_dir(acpi_ac_dir); + remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); - return; + return_VOID; } module_init(acpi_ac_init); diff --git a/trunk/drivers/acpi/acpi_memhotplug.c b/trunk/drivers/acpi/acpi_memhotplug.c index 81e970adeab3..1012284ff4f7 100644 --- a/trunk/drivers/acpi/acpi_memhotplug.c +++ b/trunk/drivers/acpi/acpi_memhotplug.c @@ -80,7 +80,7 @@ struct acpi_memory_info { }; struct acpi_memory_device { - struct acpi_device * device; + acpi_handle handle; unsigned int state; /* State of the memory device */ struct list_head res_list; }; @@ -128,8 +128,9 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) acpi_status status; struct acpi_memory_info *info, *n; + ACPI_FUNCTION_TRACE("acpi_memory_get_device_resources"); - status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS, + status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS, acpi_memory_get_resource, mem_device); if (ACPI_FAILURE(status)) { list_for_each_entry_safe(info, n, &mem_device->res_list, list) @@ -149,21 +150,23 @@ acpi_memory_get_device(acpi_handle handle, struct acpi_device *device = NULL; struct acpi_device *pdevice = NULL; + ACPI_FUNCTION_TRACE("acpi_memory_get_device"); if (!acpi_bus_get_device(handle, &device) && device) goto end; status = acpi_get_parent(handle, &phandle); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent")); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_get_parent\n")); + return_VALUE(-EINVAL); } /* Get the parent device */ status = acpi_bus_get_device(phandle, &pdevice); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device")); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error in acpi_bus_get_device\n")); + return_VALUE(-EINVAL); } /* @@ -172,29 +175,30 @@ acpi_memory_get_device(acpi_handle handle, */ status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Cannot add acpi bus")); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_bus_add\n")); + return_VALUE(-EINVAL); } end: *mem_device = acpi_driver_data(device); if (!(*mem_device)) { printk(KERN_ERR "\n driver data not found"); - return -ENODEV; + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } static int acpi_memory_check_device(struct acpi_memory_device *mem_device) { unsigned long current_status; + ACPI_FUNCTION_TRACE("acpi_memory_check_device"); /* Get device present/absent information from the _STA */ - if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA", + if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA", NULL, ¤t_status))) - return -ENODEV; + return_VALUE(-ENODEV); /* * Check for device status. Device should be * present/enabled/functioning. @@ -202,9 +206,9 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device) if (!((current_status & ACPI_MEMORY_STA_PRESENT) && (current_status & ACPI_MEMORY_STA_ENABLED) && (current_status & ACPI_MEMORY_STA_FUNCTIONAL))) - return -ENODEV; + return_VALUE(-ENODEV); - return 0; + return_VALUE(0); } static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) @@ -213,16 +217,18 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) struct acpi_memory_info *info; int node; + ACPI_FUNCTION_TRACE("acpi_memory_enable_device"); /* Get the range from the _CRS */ result = acpi_memory_get_device_resources(mem_device); if (result) { - printk(KERN_ERR PREFIX "get_device_resources failed\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "\nget_device_resources failed\n")); mem_device->state = MEMORY_INVALID_STATE; return result; } - node = acpi_get_node(mem_device->device->handle); + node = acpi_get_node(mem_device->handle); /* * Tell the VM there is more memory here... * Note: Assume that this function returns zero on success @@ -248,7 +254,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) num_enabled++; } if (!num_enabled) { - printk(KERN_ERR PREFIX "add_memory failed\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n")); mem_device->state = MEMORY_INVALID_STATE; return -EINVAL; } @@ -263,31 +269,32 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) union acpi_object arg; unsigned long current_status; + ACPI_FUNCTION_TRACE("acpi_memory_powerdown_device"); /* Issue the _EJ0 command */ arg_list.count = 1; arg_list.pointer = &arg; arg.type = ACPI_TYPE_INTEGER; arg.integer.value = 1; - status = acpi_evaluate_object(mem_device->device->handle, + status = acpi_evaluate_object(mem_device->handle, "_EJ0", &arg_list, NULL); /* Return on _EJ0 failure */ if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "_EJ0 failed")); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_EJ0 failed.\n")); + return_VALUE(-ENODEV); } /* Evalute _STA to check if the device is disabled */ - status = acpi_evaluate_integer(mem_device->device->handle, "_STA", + status = acpi_evaluate_integer(mem_device->handle, "_STA", NULL, ¤t_status); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); /* Check for device status. Device should be disabled */ if (current_status & ACPI_MEMORY_STA_ENABLED) - return -EINVAL; + return_VALUE(-EINVAL); - return 0; + return_VALUE(0); } static int acpi_memory_disable_device(struct acpi_memory_device *mem_device) @@ -295,6 +302,7 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device) int result; struct acpi_memory_info *info, *n; + ACPI_FUNCTION_TRACE("acpi_memory_disable_device"); /* * Ask the VM to offline this memory range. @@ -312,6 +320,8 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device) /* Power-off and eject the device */ result = acpi_memory_powerdown_device(mem_device); if (result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Device Power Down failed.\n")); /* Set the status of the device to invalid */ mem_device->state = MEMORY_INVALID_STATE; return result; @@ -326,6 +336,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) struct acpi_memory_device *mem_device; struct acpi_device *device; + ACPI_FUNCTION_TRACE("acpi_memory_device_notify"); switch (event) { case ACPI_NOTIFY_BUS_CHECK: @@ -337,14 +348,15 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "\nReceived DEVICE CHECK notification for device\n")); if (acpi_memory_get_device(handle, &mem_device)) { - printk(KERN_ERR PREFIX "Cannot find driver data\n"); - return; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error in finding driver data\n")); + return_VOID; } if (!acpi_memory_check_device(mem_device)) { if (acpi_memory_enable_device(mem_device)) - printk(KERN_ERR PREFIX - "Cannot enable memory device\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error in acpi_memory_enable_device\n")); } break; case ACPI_NOTIFY_EJECT_REQUEST: @@ -352,12 +364,14 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) "\nReceived EJECT REQUEST notification for device\n")); if (acpi_bus_get_device(handle, &device)) { - printk(KERN_ERR PREFIX "Device doesn't exist\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Device doesn't exist\n")); break; } mem_device = acpi_driver_data(device); if (!mem_device) { - printk(KERN_ERR PREFIX "Driver Data is NULL\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Driver Data is NULL\n")); break; } @@ -368,8 +382,8 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) * with generic sysfs driver */ if (acpi_memory_disable_device(mem_device)) - printk(KERN_ERR PREFIX - "Disable memory device\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error in acpi_memory_disable_device\n")); /* * TBD: Invoke acpi_bus_remove to cleanup data structures */ @@ -380,7 +394,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) break; } - return; + return_VOID; } static int acpi_memory_device_add(struct acpi_device *device) @@ -388,17 +402,18 @@ static int acpi_memory_device_add(struct acpi_device *device) int result; struct acpi_memory_device *mem_device = NULL; + ACPI_FUNCTION_TRACE("acpi_memory_device_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL); if (!mem_device) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(mem_device, 0, sizeof(struct acpi_memory_device)); INIT_LIST_HEAD(&mem_device->res_list); - mem_device->device = device; + mem_device->handle = device->handle; sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); acpi_driver_data(device) = mem_device; @@ -407,7 +422,7 @@ static int acpi_memory_device_add(struct acpi_device *device) result = acpi_memory_get_device_resources(mem_device); if (result) { kfree(mem_device); - return result; + return_VALUE(result); } /* Set the device state */ @@ -415,21 +430,22 @@ static int acpi_memory_device_add(struct acpi_device *device) printk(KERN_INFO "%s \n", acpi_device_name(device)); - return result; + return_VALUE(result); } static int acpi_memory_device_remove(struct acpi_device *device, int type) { struct acpi_memory_device *mem_device = NULL; + ACPI_FUNCTION_TRACE("acpi_memory_device_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); mem_device = (struct acpi_memory_device *)acpi_driver_data(device); kfree(mem_device); - return 0; + return_VALUE(0); } static int acpi_memory_device_start (struct acpi_device *device) @@ -437,6 +453,8 @@ static int acpi_memory_device_start (struct acpi_device *device) struct acpi_memory_device *mem_device; int result = 0; + ACPI_FUNCTION_TRACE("acpi_memory_device_start"); + mem_device = acpi_driver_data(device); if (!acpi_memory_check_device(mem_device)) { @@ -446,7 +464,7 @@ static int acpi_memory_device_start (struct acpi_device *device) ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_memory_enable_device\n")); } - return result; + return_VALUE(result); } /* @@ -459,15 +477,16 @@ static acpi_status is_memory_device(acpi_handle handle) struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_device_info *info; + ACPI_FUNCTION_TRACE("is_memory_device"); status = acpi_get_object_info(handle, &buffer); if (ACPI_FAILURE(status)) - return status; + return_ACPI_STATUS(AE_ERROR); info = buffer.pointer; if (!(info->valid & ACPI_VALID_HID)) { - kfree(buffer.pointer); - return AE_ERROR; + acpi_os_free(buffer.pointer); + return_ACPI_STATUS(AE_ERROR); } hardware_id = info->hardware_id.value; @@ -475,8 +494,8 @@ static acpi_status is_memory_device(acpi_handle handle) (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID))) status = AE_ERROR; - kfree(buffer.pointer); - return status; + acpi_os_free(buffer.pointer); + return_ACPI_STATUS(status); } static acpi_status @@ -485,17 +504,21 @@ acpi_memory_register_notify_handler(acpi_handle handle, { acpi_status status; + ACPI_FUNCTION_TRACE("acpi_memory_register_notify_handler"); status = is_memory_device(handle); - if (ACPI_FAILURE(status)){ - ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device")); - return AE_OK; /* continue */ - } + if (ACPI_FAILURE(status)) + return_ACPI_STATUS(AE_OK); /* continue */ status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, acpi_memory_device_notify, NULL); - /* continue */ - return AE_OK; + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); + return_ACPI_STATUS(AE_OK); /* continue */ + } + + return_ACPI_STATUS(status); } static acpi_status @@ -504,18 +527,22 @@ acpi_memory_deregister_notify_handler(acpi_handle handle, { acpi_status status; + ACPI_FUNCTION_TRACE("acpi_memory_deregister_notify_handler"); status = is_memory_device(handle); - if (ACPI_FAILURE(status)){ - ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device")); - return AE_OK; /* continue */ - } + if (ACPI_FAILURE(status)) + return_ACPI_STATUS(AE_OK); /* continue */ status = acpi_remove_notify_handler(handle, ACPI_SYSTEM_NOTIFY, acpi_memory_device_notify); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); + return_ACPI_STATUS(AE_OK); /* continue */ + } - return AE_OK; /* continue */ + return_ACPI_STATUS(status); } static int __init acpi_memory_device_init(void) @@ -523,11 +550,12 @@ static int __init acpi_memory_device_init(void) int result; acpi_status status; + ACPI_FUNCTION_TRACE("acpi_memory_device_init"); result = acpi_bus_register_driver(&acpi_memory_device_driver); if (result < 0) - return -ENODEV; + return_VALUE(-ENODEV); status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, @@ -535,18 +563,19 @@ static int __init acpi_memory_device_init(void) NULL, NULL); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n")); acpi_bus_unregister_driver(&acpi_memory_device_driver); - return -ENODEV; + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } static void __exit acpi_memory_device_exit(void) { acpi_status status; + ACPI_FUNCTION_TRACE("acpi_memory_device_exit"); /* * Adding this to un-install notification handlers for all the device @@ -558,11 +587,11 @@ static void __exit acpi_memory_device_exit(void) NULL, NULL); if (ACPI_FAILURE(status)) - ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n")); acpi_bus_unregister_driver(&acpi_memory_device_driver); - return; + return_VOID; } module_init(acpi_memory_device_init); diff --git a/trunk/drivers/acpi/asus_acpi.c b/trunk/drivers/acpi/asus_acpi.c index e9ee4c52a5f6..839f423d738d 100644 --- a/trunk/drivers/acpi/asus_acpi.c +++ b/trunk/drivers/acpi/asus_acpi.c @@ -2,7 +2,7 @@ * asus_acpi.c - Asus Laptop ACPI Extras * * - * Copyright (C) 2002-2005 Julien Lerouge, 2003-2006 Karol Kozimor + * Copyright (C) 2002, 2003, 2004 Julien Lerouge, Karol Kozimor * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,8 +26,11 @@ * Pontus Fuchs - Helper functions, cleanup * Johann Wiesner - Small compile fixes * John Belmonte - ACPI code for Toshiba laptop was a good starting point. - * Éric Burghard - LED display support for W1N * + * TODO: + * add Fn key status + * Add mode selection on module loading (parameter) -> still necessary? + * Complete display switching -- may require dirty hacks or calling _DOS? */ #include @@ -39,14 +42,12 @@ #include #include -#define ASUS_ACPI_VERSION "0.30" +#define ASUS_ACPI_VERSION "0.29" #define PROC_ASUS "asus" //the directory #define PROC_MLED "mled" #define PROC_WLED "wled" #define PROC_TLED "tled" -#define PROC_BT "bluetooth" -#define PROC_LEDD "ledd" #define PROC_INFO "info" #define PROC_LCD "lcd" #define PROC_BRN "brn" @@ -66,10 +67,9 @@ /* * Flags for hotk status */ -#define MLED_ON 0x01 //mail LED -#define WLED_ON 0x02 //wireless LED -#define TLED_ON 0x04 //touchpad LED -#define BT_ON 0x08 //internal Bluetooth +#define MLED_ON 0x01 //is MLED ON ? +#define WLED_ON 0x02 +#define TLED_ON 0x04 MODULE_AUTHOR("Julien Lerouge, Karol Kozimor"); MODULE_DESCRIPTION(ACPI_HOTK_NAME); @@ -92,10 +92,7 @@ struct model_data { char *wled_status; //node to handle wled reading_______A char *mt_tled; //method to handle tled_____________R char *tled_status; //node to handle tled reading_______A - char *mt_ledd; //method to handle LED display______R - char *mt_bt_switch; //method to switch Bluetooth on/off_R - char *bt_status; //no model currently supports this__? - char *mt_lcd_switch; //method to turn LCD on/off_________A + char *mt_lcd_switch; //method to turn LCD ON/OFF_________A char *lcd_status; //node to read LCD panel state______A char *brightness_up; //method to set brightness up_______A char *brightness_down; //guess what ?______________________A @@ -114,31 +111,27 @@ struct asus_hotk { struct acpi_device *device; //the device we are in acpi_handle handle; //the handle of the hotk device char status; //status of the hotk, for LEDs, ... - u32 ledd_status; //status of the LED display struct model_data *methods; //methods available on the laptop u8 brightness; //brightness level enum { A1x = 0, //A1340D, A1300F A2x, //A2500H - A4G, //A4700G D1x, //D1 L2D, //L2000D L3C, //L3800C L3D, //L3400D - L3H, //L3H, L2000E, L5D + L3H, //L3H, but also L2000E L4R, //L4500R L5x, //L5800C L8L, //L8400L M1A, //M1300A M2E, //M2400E, L4400L - M6N, //M6800N, W3400N - M6R, //M6700R, A3000G + M6N, //M6800N + M6R, //M6700R P30, //Samsung P30 S1x, //S1300A, but also L1400B and M2400A (L84F) S2x, //S200 (J1 reported), Victor MP-XP7210 - W1N, //W1000N - W5A, //W5A - xxN, //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N + xxN, //M2400N, M3700N, M5200N, S1300N, S5200N, W1OOON //(Centrino) END_MODEL } model; //Models currently supported @@ -156,8 +149,17 @@ struct asus_hotk { static struct model_data model_conf[END_MODEL] = { /* + * Those pathnames are relative to the HOTK / ATKD device : + * - mt_mled + * - mt_wled + * - brightness_set + * - brightness_get + * - display_set + * - display_get + * * TODO I have seen a SWBX and AIBX method on some models, like L1400B, * it seems to be a kind of switch, but what for ? + * */ { @@ -181,16 +183,6 @@ static struct model_data model_conf[END_MODEL] = { .display_set = "SDSP", .display_get = "\\INFB"}, - { - .name = "A4G", - .mt_mled = "MLED", -/* WLED present, but not controlled by ACPI */ - .mt_lcd_switch = xxN_PREFIX "_Q10", - .brightness_set = "SPLV", - .brightness_get = "GPLV", - .display_set = "SDSP", - .display_get = "\\ADVG"}, - { .name = "D1x", .mt_mled = "MLED", @@ -310,8 +302,7 @@ static struct model_data model_conf[END_MODEL] = { .brightness_set = "SPLV", .brightness_get = "GPLV", .display_set = "SDSP", - .display_get = "\\SSTE"}, - + .display_get = "\\_SB.PCI0.P0P1.VGA.GETD"}, { .name = "M6R", .mt_mled = "MLED", @@ -321,7 +312,7 @@ static struct model_data model_conf[END_MODEL] = { .brightness_set = "SPLV", .brightness_get = "GPLV", .display_set = "SDSP", - .display_get = "\\_SB.PCI0.P0P1.VGA.GETD"}, + .display_get = "\\SSTE"}, { .name = "P30", @@ -353,28 +344,6 @@ static struct model_data model_conf[END_MODEL] = { .brightness_up = S2x_PREFIX "_Q0B", .brightness_down = S2x_PREFIX "_Q0A"}, - { - .name = "W1N", - .mt_mled = "MLED", - .mt_wled = "WLED", - .mt_ledd = "SLCM", - .mt_lcd_switch = xxN_PREFIX "_Q10", - .lcd_status = "\\BKLT", - .brightness_set = "SPLV", - .brightness_get = "GPLV", - .display_set = "SDSP", - .display_get = "\\ADVG"}, - - { - .name = "W5A", - .mt_bt_switch = "BLED", - .mt_wled = "WLED", - .mt_lcd_switch = xxN_PREFIX "_Q10", - .brightness_set = "SPLV", - .brightness_get = "GPLV", - .display_set = "SDSP", - .display_get = "\\ADVG"}, - { .name = "xxN", .mt_mled = "MLED", @@ -593,36 +562,6 @@ proc_write_mled(struct file *file, const char __user * buffer, return write_led(buffer, count, hotk->methods->mt_mled, MLED_ON, 1); } -/* - * Proc handlers for LED display - */ -static int -proc_read_ledd(char *page, char **start, off_t off, int count, int *eof, - void *data) -{ - return sprintf(page, "0x%08x\n", hotk->ledd_status); -} - -static int -proc_write_ledd(struct file *file, const char __user * buffer, - unsigned long count, void *data) -{ - int value; - - count = parse_arg(buffer, count, &value); - if (count > 0) { - if (!write_acpi_int - (hotk->handle, hotk->methods->mt_ledd, value, NULL)) - printk(KERN_WARNING - "Asus ACPI: LED display write failed\n"); - else - hotk->ledd_status = (u32) value; - } else if (count < 0) - printk(KERN_WARNING "Asus ACPI: Error reading user input\n"); - - return count; -} - /* * Proc handlers for WLED */ @@ -641,25 +580,6 @@ proc_write_wled(struct file *file, const char __user * buffer, return write_led(buffer, count, hotk->methods->mt_wled, WLED_ON, 0); } -/* - * Proc handlers for Bluetooth - */ -static int -proc_read_bluetooth(char *page, char **start, off_t off, int count, int *eof, - void *data) -{ - return sprintf(page, "%d\n", read_led(hotk->methods->bt_status, BT_ON)); -} - -static int -proc_write_bluetooth(struct file *file, const char __user * buffer, - unsigned long count, void *data) -{ - /* Note: mt_bt_switch controls both internal Bluetooth adapter's - presence and its LED */ - return write_led(buffer, count, hotk->methods->mt_bt_switch, BT_ON, 0); -} - /* * Proc handlers for TLED */ @@ -956,11 +876,6 @@ static int asus_hotk_add_fs(struct acpi_device *device) mode, device); } - if (hotk->methods->mt_ledd) { - asus_proc_add(PROC_LEDD, &proc_write_ledd, &proc_read_ledd, - mode, device); - } - if (hotk->methods->mt_mled) { asus_proc_add(PROC_MLED, &proc_write_mled, &proc_read_mled, mode, device); @@ -971,11 +886,6 @@ static int asus_hotk_add_fs(struct acpi_device *device) mode, device); } - if (hotk->methods->mt_bt_switch) { - asus_proc_add(PROC_BT, &proc_write_bluetooth, - &proc_read_bluetooth, mode, device); - } - /* * We need both read node and write method as LCD switch is also accessible * from keyboard @@ -1009,10 +919,6 @@ static int asus_hotk_remove_fs(struct acpi_device *device) remove_proc_entry(PROC_MLED, acpi_device_dir(device)); if (hotk->methods->mt_tled) remove_proc_entry(PROC_TLED, acpi_device_dir(device)); - if (hotk->methods->mt_ledd) - remove_proc_entry(PROC_LEDD, acpi_device_dir(device)); - if (hotk->methods->mt_bt_switch) - remove_proc_entry(PROC_BT, acpi_device_dir(device)); if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status) remove_proc_entry(PROC_LCD, acpi_device_dir(device)); if ((hotk->methods->brightness_up @@ -1044,65 +950,6 @@ static void asus_hotk_notify(acpi_handle handle, u32 event, void *data) return; } -/* - * Match the model string to the list of supported models. Return END_MODEL if - * no match or model is NULL. - */ -static int asus_model_match(char *model) -{ - if (model == NULL) - return END_MODEL; - - if (strncmp(model, "L3D", 3) == 0) - return L3D; - else if (strncmp(model, "L2E", 3) == 0 || - strncmp(model, "L3H", 3) == 0 || strncmp(model, "L5D", 3) == 0) - return L3H; - else if (strncmp(model, "L3", 2) == 0 || strncmp(model, "L2B", 3) == 0) - return L3C; - else if (strncmp(model, "L8L", 3) == 0) - return L8L; - else if (strncmp(model, "L4R", 3) == 0) - return L4R; - else if (strncmp(model, "M6N", 3) == 0 || strncmp(model, "W3N", 3) == 0) - return M6N; - else if (strncmp(model, "M6R", 3) == 0 || strncmp(model, "A3G", 3) == 0) - return M6R; - else if (strncmp(model, "M2N", 3) == 0 || - strncmp(model, "M3N", 3) == 0 || - strncmp(model, "M5N", 3) == 0 || - strncmp(model, "M6N", 3) == 0 || - strncmp(model, "S1N", 3) == 0 || - strncmp(model, "S5N", 3) == 0 || strncmp(model, "W1N", 3) == 0) - return xxN; - else if (strncmp(model, "M1", 2) == 0) - return M1A; - else if (strncmp(model, "M2", 2) == 0 || strncmp(model, "L4E", 3) == 0) - return M2E; - else if (strncmp(model, "L2", 2) == 0) - return L2D; - else if (strncmp(model, "L8", 2) == 0) - return S1x; - else if (strncmp(model, "D1", 2) == 0) - return D1x; - else if (strncmp(model, "A1", 2) == 0) - return A1x; - else if (strncmp(model, "A2", 2) == 0) - return A2x; - else if (strncmp(model, "J1", 2) == 0) - return S2x; - else if (strncmp(model, "L5", 2) == 0) - return L5x; - else if (strncmp(model, "A4G", 3) == 0) - return A4G; - else if (strncmp(model, "W1N", 3) == 0) - return W1N; - else if (strncmp(model, "W5A", 3) == 0) - return W5A; - else - return END_MODEL; -} - /* * This function is used to initialize the hotk with right values. In this * method, we can make all the detection we want, and modify the hotk struct @@ -1113,7 +960,6 @@ static int asus_hotk_get_info(void) struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *model = NULL; int bsts_result; - char *string = NULL; acpi_status status; /* @@ -1143,73 +989,114 @@ static int asus_hotk_get_info(void) printk(KERN_NOTICE " BSTS called, 0x%02x returned\n", bsts_result); + /* This is unlikely with implicit return */ + if (buffer.pointer == NULL) + return -EINVAL; + + model = (union acpi_object *) buffer.pointer; /* - * Try to match the object returned by INIT to the specific model. - * Handle every possible object (or the lack of thereof) the DSDT - * writers might throw at us. When in trouble, we pass NULL to - * asus_model_match() and try something completely different. + * Samsung P30 has a device with a valid _HID whose INIT does not + * return anything. It used to be possible to catch this exception, + * but the implicit return code will now happily confuse the + * driver. We assume that every ACPI_TYPE_STRING is a valid model + * identifier but it's still possible to get completely bogus data. */ - if (buffer.pointer) { - model = (union acpi_object *)buffer.pointer; - switch (model->type) { - case ACPI_TYPE_STRING: - string = model->string.pointer; - break; - case ACPI_TYPE_BUFFER: - string = model->buffer.pointer; - break; - default: - kfree(model); - break; - } - } - hotk->model = asus_model_match(string); - if (hotk->model == END_MODEL) { /* match failed */ - if (asus_info && + if (model->type == ACPI_TYPE_STRING) { + printk(KERN_NOTICE " %s model detected, ", model->string.pointer); + } else { + if (asus_info && /* Samsung P30 */ strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) { hotk->model = P30; printk(KERN_NOTICE " Samsung P30 detected, supported\n"); } else { hotk->model = M2E; - printk(KERN_NOTICE " unsupported model %s, trying " - "default values\n", string); - printk(KERN_NOTICE - " send /proc/acpi/dsdt to the developers\n"); + printk(KERN_WARNING " no string returned by INIT\n"); + printk(KERN_WARNING " trying default values, supply " + "the developers with your DSDT\n"); } hotk->methods = &model_conf[hotk->model]; + + acpi_os_free(model); + return AE_OK; } + + hotk->model = END_MODEL; + if (strncmp(model->string.pointer, "L3D", 3) == 0) + hotk->model = L3D; + else if (strncmp(model->string.pointer, "L3H", 3) == 0 || + strncmp(model->string.pointer, "L2E", 3) == 0) + hotk->model = L3H; + else if (strncmp(model->string.pointer, "L3", 2) == 0 || + strncmp(model->string.pointer, "L2B", 3) == 0) + hotk->model = L3C; + else if (strncmp(model->string.pointer, "L8L", 3) == 0) + hotk->model = L8L; + else if (strncmp(model->string.pointer, "L4R", 3) == 0) + hotk->model = L4R; + else if (strncmp(model->string.pointer, "M6N", 3) == 0) + hotk->model = M6N; + else if (strncmp(model->string.pointer, "M6R", 3) == 0) + hotk->model = M6R; + else if (strncmp(model->string.pointer, "M2N", 3) == 0 || + strncmp(model->string.pointer, "M3N", 3) == 0 || + strncmp(model->string.pointer, "M5N", 3) == 0 || + strncmp(model->string.pointer, "M6N", 3) == 0 || + strncmp(model->string.pointer, "S1N", 3) == 0 || + strncmp(model->string.pointer, "S5N", 3) == 0 || + strncmp(model->string.pointer, "W1N", 3) == 0) + hotk->model = xxN; + else if (strncmp(model->string.pointer, "M1", 2) == 0) + hotk->model = M1A; + else if (strncmp(model->string.pointer, "M2", 2) == 0 || + strncmp(model->string.pointer, "L4E", 3) == 0) + hotk->model = M2E; + else if (strncmp(model->string.pointer, "L2", 2) == 0) + hotk->model = L2D; + else if (strncmp(model->string.pointer, "L8", 2) == 0) + hotk->model = S1x; + else if (strncmp(model->string.pointer, "D1", 2) == 0) + hotk->model = D1x; + else if (strncmp(model->string.pointer, "A1", 2) == 0) + hotk->model = A1x; + else if (strncmp(model->string.pointer, "A2", 2) == 0) + hotk->model = A2x; + else if (strncmp(model->string.pointer, "J1", 2) == 0) + hotk->model = S2x; + else if (strncmp(model->string.pointer, "L5", 2) == 0) + hotk->model = L5x; + + if (hotk->model == END_MODEL) { + printk("unsupported, trying default values, supply the " + "developers with your DSDT\n"); + hotk->model = M2E; + } else { + printk("supported\n"); + } + hotk->methods = &model_conf[hotk->model]; - printk(KERN_NOTICE " %s model detected, supported\n", string); /* Sort of per-model blacklist */ - if (strncmp(string, "L2B", 3) == 0) + if (strncmp(model->string.pointer, "L2B", 3) == 0) hotk->methods->lcd_status = NULL; /* L2B is similar enough to L3C to use its settings, with this only exception */ - else if (strncmp(string, "A3G", 3) == 0) - hotk->methods->lcd_status = "\\BLFG"; - /* A3G is like M6R */ - else if (strncmp(string, "S5N", 3) == 0 || - strncmp(string, "M5N", 3) == 0 || - strncmp(string, "W3N", 3) == 0) + else if (strncmp(model->string.pointer, "S5N", 3) == 0 || + strncmp(model->string.pointer, "M5N", 3) == 0) hotk->methods->mt_mled = NULL; - /* S5N, M5N and W3N have no MLED */ - else if (strncmp(string, "L5D", 3) == 0) - hotk->methods->mt_wled = NULL; - /* L5D's WLED is not controlled by ACPI */ - else if (strncmp(string, "M2N", 3) == 0 || - strncmp(string, "S1N", 3) == 0) + /* S5N and M5N have no MLED */ + else if (strncmp(model->string.pointer, "M2N", 3) == 0 || + strncmp(model->string.pointer, "W1N", 3) == 0) hotk->methods->mt_wled = "WLED"; - /* M2N and S1N have a usable WLED */ + /* M2N and W1N have a usable WLED */ else if (asus_info) { if (strncmp(asus_info->oem_table_id, "L1", 2) == 0) hotk->methods->mled_status = NULL; /* S1300A reports L84F, but L1400B too, account for that */ } - kfree(model); + acpi_os_free(model); return AE_OK; } @@ -1277,7 +1164,8 @@ static int asus_hotk_add(struct acpi_device *device) /* For laptops without GPLV: init the hotk->brightness value */ if ((!hotk->methods->brightness_get) && (!hotk->methods->brightness_status) - && (hotk->methods->brightness_up && hotk->methods->brightness_down)) { + && (hotk->methods->brightness_up + && hotk->methods->brightness_down)) { status = acpi_evaluate_object(NULL, hotk->methods->brightness_down, NULL, NULL); @@ -1296,9 +1184,6 @@ static int asus_hotk_add(struct acpi_device *device) asus_hotk_found = 1; - /* LED display is off by default */ - hotk->ledd_status = 0xFFF; - end: if (result) { kfree(hotk); @@ -1347,7 +1232,7 @@ static int __init asus_acpi_init(void) result = acpi_bus_register_driver(&asus_hotk_driver); if (result < 0) { remove_proc_entry(PROC_ASUS, acpi_root_dir); - return result; + return -ENODEV; } /* @@ -1371,7 +1256,7 @@ static void __exit asus_acpi_exit(void) acpi_bus_unregister_driver(&asus_hotk_driver); remove_proc_entry(PROC_ASUS, acpi_root_dir); - kfree(asus_info); + acpi_os_free(asus_info); return; } diff --git a/trunk/drivers/acpi/battery.c b/trunk/drivers/acpi/battery.c index 24bf4dca88cc..702e857e98c5 100644 --- a/trunk/drivers/acpi/battery.c +++ b/trunk/drivers/acpi/battery.c @@ -59,9 +59,6 @@ ACPI_MODULE_NAME("acpi_battery") MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME); MODULE_LICENSE("GPL"); -extern struct proc_dir_entry *acpi_lock_battery_dir(void); -extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); - static int acpi_battery_add(struct acpi_device *device); static int acpi_battery_remove(struct acpi_device *device, int type); @@ -111,7 +108,7 @@ struct acpi_battery_trips { }; struct acpi_battery { - struct acpi_device * device; + acpi_handle handle; struct acpi_battery_flags flags; struct acpi_battery_trips trips; unsigned long alarm; @@ -135,16 +132,17 @@ acpi_battery_get_info(struct acpi_battery *battery, struct acpi_buffer data = { 0, NULL }; union acpi_object *package = NULL; + ACPI_FUNCTION_TRACE("acpi_battery_get_info"); if (!battery || !bif) - return -EINVAL; + return_VALUE(-EINVAL); /* Evalute _BIF */ - status = acpi_evaluate_object(battery->device->handle, "_BIF", NULL, &buffer); + status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BIF\n")); + return_VALUE(-ENODEV); } package = (union acpi_object *)buffer.pointer; @@ -153,7 +151,7 @@ acpi_battery_get_info(struct acpi_battery *battery, status = acpi_extract_package(package, &format, &data); if (status != AE_BUFFER_OVERFLOW) { - ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n")); result = -ENODEV; goto end; } @@ -167,19 +165,19 @@ acpi_battery_get_info(struct acpi_battery *battery, status = acpi_extract_package(package, &format, &data); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n")); kfree(data.pointer); result = -ENODEV; goto end; } end: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); if (!result) (*bif) = (struct acpi_battery_info *)data.pointer; - return result; + return_VALUE(result); } static int @@ -195,16 +193,17 @@ acpi_battery_get_status(struct acpi_battery *battery, struct acpi_buffer data = { 0, NULL }; union acpi_object *package = NULL; + ACPI_FUNCTION_TRACE("acpi_battery_get_status"); if (!battery || !bst) - return -EINVAL; + return_VALUE(-EINVAL); /* Evalute _BST */ - status = acpi_evaluate_object(battery->device->handle, "_BST", NULL, &buffer); + status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BST\n")); + return_VALUE(-ENODEV); } package = (union acpi_object *)buffer.pointer; @@ -213,7 +212,7 @@ acpi_battery_get_status(struct acpi_battery *battery, status = acpi_extract_package(package, &format, &data); if (status != AE_BUFFER_OVERFLOW) { - ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n")); result = -ENODEV; goto end; } @@ -227,19 +226,19 @@ acpi_battery_get_status(struct acpi_battery *battery, status = acpi_extract_package(package, &format, &data); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n")); kfree(data.pointer); result = -ENODEV; goto end; } end: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); if (!result) (*bst) = (struct acpi_battery_status *)data.pointer; - return result; + return_VALUE(result); } static int @@ -249,24 +248,25 @@ acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm) union acpi_object arg0 = { ACPI_TYPE_INTEGER }; struct acpi_object_list arg_list = { 1, &arg0 }; + ACPI_FUNCTION_TRACE("acpi_battery_set_alarm"); if (!battery) - return -EINVAL; + return_VALUE(-EINVAL); if (!battery->flags.alarm) - return -ENODEV; + return_VALUE(-ENODEV); arg0.integer.value = alarm; - status = acpi_evaluate_object(battery->device->handle, "_BTP", &arg_list, NULL); + status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", (u32) alarm)); battery->alarm = alarm; - return 0; + return_VALUE(0); } static int acpi_battery_check(struct acpi_battery *battery) @@ -277,15 +277,18 @@ static int acpi_battery_check(struct acpi_battery *battery) struct acpi_device *device = NULL; struct acpi_battery_info *bif = NULL; + ACPI_FUNCTION_TRACE("acpi_battery_check"); if (!battery) - return -EINVAL; + return_VALUE(-EINVAL); - device = battery->device; + result = acpi_bus_get_device(battery->handle, &device); + if (result) + return_VALUE(result); result = acpi_bus_get_status(device); if (result) - return result; + return_VALUE(result); /* Insertion? */ @@ -297,7 +300,7 @@ static int acpi_battery_check(struct acpi_battery *battery) result = acpi_battery_get_info(battery, &bif); if (result) - return result; + return_VALUE(result); battery->flags.power_unit = bif->power_unit; battery->trips.warning = bif->design_capacity_warning; @@ -306,7 +309,7 @@ static int acpi_battery_check(struct acpi_battery *battery) /* See if alarms are supported, and if so, set default */ - status = acpi_get_handle(battery->device->handle, "_BTP", &handle); + status = acpi_get_handle(battery->handle, "_BTP", &handle); if (ACPI_SUCCESS(status)) { battery->flags.alarm = 1; acpi_battery_set_alarm(battery, battery->trips.warning); @@ -321,7 +324,7 @@ static int acpi_battery_check(struct acpi_battery *battery) battery->flags.present = device->status.battery_present; - return result; + return_VALUE(result); } /* -------------------------------------------------------------------------- @@ -336,6 +339,7 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset) struct acpi_battery_info *bif = NULL; char *units = "?"; + ACPI_FUNCTION_TRACE("acpi_battery_read_info"); if (!battery) goto end; @@ -405,7 +409,7 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset) end: kfree(bif); - return 0; + return_VALUE(0); } static int acpi_battery_info_open_fs(struct inode *inode, struct file *file) @@ -420,6 +424,7 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) struct acpi_battery_status *bst = NULL; char *units = "?"; + ACPI_FUNCTION_TRACE("acpi_battery_read_state"); if (!battery) goto end; @@ -453,6 +458,8 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) if ((bst->state & 0x01) && (bst->state & 0x02)) { seq_printf(seq, "charging state: charging/discharging\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Battery Charging and Discharging?\n")); } else if (bst->state & 0x01) seq_printf(seq, "charging state: discharging\n"); else if (bst->state & 0x02) @@ -482,7 +489,7 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) end: kfree(bst); - return 0; + return_VALUE(0); } static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) @@ -495,6 +502,7 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) struct acpi_battery *battery = (struct acpi_battery *)seq->private; char *units = "?"; + ACPI_FUNCTION_TRACE("acpi_battery_read_alarm"); if (!battery) goto end; @@ -519,7 +527,7 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units); end: - return 0; + return_VALUE(0); } static ssize_t @@ -532,24 +540,25 @@ acpi_battery_write_alarm(struct file *file, struct seq_file *m = (struct seq_file *)file->private_data; struct acpi_battery *battery = (struct acpi_battery *)m->private; + ACPI_FUNCTION_TRACE("acpi_battery_write_alarm"); if (!battery || (count > sizeof(alarm_string) - 1)) - return -EINVAL; + return_VALUE(-EINVAL); if (!battery->flags.present) - return -ENODEV; + return_VALUE(-ENODEV); if (copy_from_user(alarm_string, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); alarm_string[count] = '\0'; result = acpi_battery_set_alarm(battery, simple_strtoul(alarm_string, NULL, 0)); if (result) - return result; + return_VALUE(result); - return count; + return_VALUE(count); } static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) @@ -586,12 +595,13 @@ static int acpi_battery_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; + ACPI_FUNCTION_TRACE("acpi_battery_add_fs"); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_battery_dir); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); acpi_device_dir(device)->owner = THIS_MODULE; } @@ -599,7 +609,9 @@ static int acpi_battery_add_fs(struct acpi_device *device) entry = create_proc_entry(ACPI_BATTERY_FILE_INFO, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_BATTERY_FILE_INFO)); else { entry->proc_fops = &acpi_battery_info_ops; entry->data = acpi_driver_data(device); @@ -610,7 +622,9 @@ static int acpi_battery_add_fs(struct acpi_device *device) entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_BATTERY_FILE_STATUS)); else { entry->proc_fops = &acpi_battery_state_ops; entry->data = acpi_driver_data(device); @@ -622,18 +636,21 @@ static int acpi_battery_add_fs(struct acpi_device *device) S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_BATTERY_FILE_ALARM)); else { entry->proc_fops = &acpi_battery_alarm_ops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } - return 0; + return_VALUE(0); } static int acpi_battery_remove_fs(struct acpi_device *device) { + ACPI_FUNCTION_TRACE("acpi_battery_remove_fs"); if (acpi_device_dir(device)) { remove_proc_entry(ACPI_BATTERY_FILE_ALARM, @@ -647,7 +664,7 @@ static int acpi_battery_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -659,17 +676,17 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) struct acpi_battery *battery = (struct acpi_battery *)data; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_battery_notify"); if (!battery) - return; + return_VOID; - device = battery->device; + if (acpi_bus_get_device(handle, &device)) + return_VOID; switch (event) { case ACPI_BATTERY_NOTIFY_STATUS: case ACPI_BATTERY_NOTIFY_INFO: - case ACPI_NOTIFY_BUS_CHECK: - case ACPI_NOTIFY_DEVICE_CHECK: acpi_battery_check(battery); acpi_bus_generate_event(device, event, battery->flags.present); break; @@ -679,7 +696,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) break; } - return; + return_VOID; } static int acpi_battery_add(struct acpi_device *device) @@ -688,16 +705,17 @@ static int acpi_battery_add(struct acpi_device *device) acpi_status status = 0; struct acpi_battery *battery = NULL; + ACPI_FUNCTION_TRACE("acpi_battery_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL); if (!battery) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(battery, 0, sizeof(struct acpi_battery)); - battery->device = device; + battery->handle = device->handle; strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); acpi_driver_data(device) = battery; @@ -710,10 +728,12 @@ static int acpi_battery_add(struct acpi_device *device) if (result) goto end; - status = acpi_install_notify_handler(device->handle, - ACPI_ALL_NOTIFY, + status = acpi_install_notify_handler(battery->handle, + ACPI_DEVICE_NOTIFY, acpi_battery_notify, battery); if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); result = -ENODEV; goto end; } @@ -728,7 +748,7 @@ static int acpi_battery_add(struct acpi_device *device) kfree(battery); } - return result; + return_VALUE(result); } static int acpi_battery_remove(struct acpi_device *device, int type) @@ -736,48 +756,56 @@ static int acpi_battery_remove(struct acpi_device *device, int type) acpi_status status = 0; struct acpi_battery *battery = NULL; + ACPI_FUNCTION_TRACE("acpi_battery_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); battery = (struct acpi_battery *)acpi_driver_data(device); - status = acpi_remove_notify_handler(device->handle, - ACPI_ALL_NOTIFY, + status = acpi_remove_notify_handler(battery->handle, + ACPI_DEVICE_NOTIFY, acpi_battery_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); acpi_battery_remove_fs(device); kfree(battery); - return 0; + return_VALUE(0); } static int __init acpi_battery_init(void) { - int result; + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_battery_init"); - acpi_battery_dir = acpi_lock_battery_dir(); + acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); if (!acpi_battery_dir) - return -ENODEV; + return_VALUE(-ENODEV); + acpi_battery_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_battery_driver); if (result < 0) { - acpi_unlock_battery_dir(acpi_battery_dir); - return -ENODEV; + remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } static void __exit acpi_battery_exit(void) { + ACPI_FUNCTION_TRACE("acpi_battery_exit"); acpi_bus_unregister_driver(&acpi_battery_driver); - acpi_unlock_battery_dir(acpi_battery_dir); + remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); - return; + return_VOID; } module_init(acpi_battery_init); diff --git a/trunk/drivers/acpi/bus.c b/trunk/drivers/acpi/bus.c index ea5a0496a4fd..dd3983cece92 100644 --- a/trunk/drivers/acpi/bus.c +++ b/trunk/drivers/acpi/bus.c @@ -60,19 +60,21 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) { acpi_status status = AE_OK; + ACPI_FUNCTION_TRACE("acpi_bus_get_device"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); /* TBD: Support fixed-feature devices */ status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device); if (ACPI_FAILURE(status) || !*device) { - ACPI_EXCEPTION((AE_INFO, status, "No context for object [%p]", handle)); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No context for object [%p]\n", + handle)); + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } EXPORT_SYMBOL(acpi_bus_get_device); @@ -82,9 +84,10 @@ int acpi_bus_get_status(struct acpi_device *device) acpi_status status = AE_OK; unsigned long sta = 0; + ACPI_FUNCTION_TRACE("acpi_bus_get_status"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); /* * Evaluate _STA if present. @@ -93,7 +96,7 @@ int acpi_bus_get_status(struct acpi_device *device) status = acpi_evaluate_integer(device->handle, "_STA", NULL, &sta); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); STRUCT_TO_INT(device->status) = (int)sta; } @@ -117,7 +120,7 @@ int acpi_bus_get_status(struct acpi_device *device) device->pnp.bus_id, (u32) STRUCT_TO_INT(device->status))); - return 0; + return_VALUE(0); } EXPORT_SYMBOL(acpi_bus_get_status); @@ -133,10 +136,11 @@ int acpi_bus_get_power(acpi_handle handle, int *state) struct acpi_device *device = NULL; unsigned long psc = 0; + ACPI_FUNCTION_TRACE("acpi_bus_get_power"); result = acpi_bus_get_device(handle, &device); if (result) - return result; + return_VALUE(result); *state = ACPI_STATE_UNKNOWN; @@ -155,12 +159,12 @@ int acpi_bus_get_power(acpi_handle handle, int *state) status = acpi_evaluate_integer(device->handle, "_PSC", NULL, &psc); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); device->power.state = (int)psc; } else if (device->power.flags.power_resources) { result = acpi_power_get_inferred_state(device); if (result) - return result; + return_VALUE(result); } *state = device->power.state; @@ -169,7 +173,7 @@ int acpi_bus_get_power(acpi_handle handle, int *state) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is D%d\n", device->pnp.bus_id, device->power.state)); - return 0; + return_VALUE(0); } EXPORT_SYMBOL(acpi_bus_get_power); @@ -181,20 +185,21 @@ int acpi_bus_set_power(acpi_handle handle, int state) struct acpi_device *device = NULL; char object_name[5] = { '_', 'P', 'S', '0' + state, '\0' }; + ACPI_FUNCTION_TRACE("acpi_bus_set_power"); result = acpi_bus_get_device(handle, &device); if (result) - return result; + return_VALUE(result); if ((state < ACPI_STATE_D0) || (state > ACPI_STATE_D3)) - return -EINVAL; + return_VALUE(-EINVAL); /* Make sure this is a valid target state */ if (!device->flags.power_manageable) { - printk(KERN_DEBUG "Device `[%s]' is not power manageable", - device->kobj.name); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Device is not power manageable\n")); + return_VALUE(-ENODEV); } /* * Get device's current power state if it's unknown @@ -206,18 +211,18 @@ int acpi_bus_set_power(acpi_handle handle, int state) if (state == device->power.state) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", state)); - return 0; + return_VALUE(0); } } if (!device->power.states[state].flags.valid) { - printk(KERN_WARNING PREFIX "Device does not support D%d\n", state); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device does not support D%d\n", + state)); + return_VALUE(-ENODEV); } if (device->parent && (state < device->parent->power.state)) { - printk(KERN_WARNING PREFIX - "Cannot set device to a higher-powered" - " state than parent\n"); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Cannot set device to a higher-powered state than parent\n")); + return_VALUE(-ENODEV); } /* @@ -259,15 +264,15 @@ int acpi_bus_set_power(acpi_handle handle, int state) end: if (result) - printk(KERN_WARNING PREFIX - "Transitioning device [%s] to D%d\n", - device->pnp.bus_id, state); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Error transitioning device [%s] to D%d\n", + device->pnp.bus_id, state)); else ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] transitioned to D%d\n", device->pnp.bus_id, state)); - return result; + return_VALUE(result); } EXPORT_SYMBOL(acpi_bus_set_power); @@ -288,17 +293,18 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data) struct acpi_bus_event *event = NULL; unsigned long flags = 0; + ACPI_FUNCTION_TRACE("acpi_bus_generate_event"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); /* drop event on the floor if no one's listening */ if (!event_is_open) - return 0; + return_VALUE(0); event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC); if (!event) - return -ENOMEM; + return_VALUE(-ENOMEM); strcpy(event->device_class, device->pnp.device_class); strcpy(event->bus_id, device->pnp.bus_id); @@ -311,7 +317,7 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data) wake_up_interruptible(&acpi_bus_event_queue); - return 0; + return_VALUE(0); } EXPORT_SYMBOL(acpi_bus_generate_event); @@ -323,9 +329,10 @@ int acpi_bus_receive_event(struct acpi_bus_event *event) DECLARE_WAITQUEUE(wait, current); + ACPI_FUNCTION_TRACE("acpi_bus_receive_event"); if (!event) - return -EINVAL; + return_VALUE(-EINVAL); if (list_empty(&acpi_bus_event_list)) { @@ -339,7 +346,7 @@ int acpi_bus_receive_event(struct acpi_bus_event *event) set_current_state(TASK_RUNNING); if (signal_pending(current)) - return -ERESTARTSYS; + return_VALUE(-ERESTARTSYS); } spin_lock_irqsave(&acpi_bus_event_lock, flags); @@ -350,13 +357,13 @@ int acpi_bus_receive_event(struct acpi_bus_event *event) spin_unlock_irqrestore(&acpi_bus_event_lock, flags); if (!entry) - return -ENODEV; + return_VALUE(-ENODEV); memcpy(event, entry, sizeof(struct acpi_bus_event)); kfree(entry); - return 0; + return_VALUE(0); } EXPORT_SYMBOL(acpi_bus_receive_event); @@ -371,9 +378,10 @@ acpi_bus_check_device(struct acpi_device *device, int *status_changed) acpi_status status = 0; struct acpi_device_status old_status; + ACPI_FUNCTION_TRACE("acpi_bus_check_device"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); if (status_changed) *status_changed = 0; @@ -390,15 +398,15 @@ acpi_bus_check_device(struct acpi_device *device, int *status_changed) if (status_changed) *status_changed = 1; } - return 0; + return_VALUE(0); } status = acpi_bus_get_status(device); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status)) - return 0; + return_VALUE(0); if (status_changed) *status_changed = 1; @@ -414,7 +422,7 @@ acpi_bus_check_device(struct acpi_device *device, int *status_changed) /* TBD: Handle device removal */ } - return 0; + return_VALUE(0); } static int acpi_bus_check_scope(struct acpi_device *device) @@ -422,24 +430,25 @@ static int acpi_bus_check_scope(struct acpi_device *device) int result = 0; int status_changed = 0; + ACPI_FUNCTION_TRACE("acpi_bus_check_scope"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); /* Status Change? */ result = acpi_bus_check_device(device, &status_changed); if (result) - return result; + return_VALUE(result); if (!status_changed) - return 0; + return_VALUE(0); /* * TBD: Enumerate child devices within this device's scope and * run acpi_bus_check_device()'s on them. */ - return 0; + return_VALUE(0); } /** @@ -452,9 +461,10 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) int result = 0; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_bus_notify"); if (acpi_bus_get_device(handle, &device)) - return; + return_VOID; switch (type) { @@ -529,7 +539,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) break; } - return; + return_VOID; } /* -------------------------------------------------------------------------- @@ -543,6 +553,7 @@ static int __init acpi_bus_init_irq(void) struct acpi_object_list arg_list = { 1, &arg }; char *message = NULL; + ACPI_FUNCTION_TRACE("acpi_bus_init_irq"); /* * Let the system know what interrupt model we are using by @@ -561,7 +572,7 @@ static int __init acpi_bus_init_irq(void) break; default: printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n"); - return -ENODEV; + return_VALUE(-ENODEV); } printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message); @@ -570,11 +581,11 @@ static int __init acpi_bus_init_irq(void) status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL); if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PIC")); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PIC\n")); + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } void __init acpi_early_init(void) @@ -582,9 +593,10 @@ void __init acpi_early_init(void) acpi_status status = AE_OK; struct acpi_buffer buffer = { sizeof(acpi_fadt), &acpi_fadt }; + ACPI_FUNCTION_TRACE("acpi_early_init"); if (acpi_disabled) - return; + return_VOID; printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION); @@ -644,11 +656,11 @@ void __init acpi_early_init(void) goto error0; } - return; + return_VOID; error0: disable_acpi(); - return; + return_VOID; } static int __init acpi_bus_init(void) @@ -657,6 +669,7 @@ static int __init acpi_bus_init(void) acpi_status status = AE_OK; extern acpi_status acpi_os_initialize1(void); + ACPI_FUNCTION_TRACE("acpi_bus_init"); status = acpi_os_initialize1(); @@ -718,12 +731,12 @@ static int __init acpi_bus_init(void) */ acpi_root_dir = proc_mkdir(ACPI_BUS_FILE_ROOT, NULL); - return 0; + return_VALUE(0); /* Mimic structured exception handling */ error1: acpi_terminate(); - return -ENODEV; + return_VALUE(-ENODEV); } decl_subsys(acpi, NULL, NULL); @@ -732,10 +745,11 @@ static int __init acpi_init(void) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_init"); if (acpi_disabled) { printk(KERN_INFO PREFIX "Interpreter disabled.\n"); - return -ENODEV; + return_VALUE(-ENODEV); } firmware_register(&acpi_subsys); @@ -756,7 +770,7 @@ static int __init acpi_init(void) } else disable_acpi(); - return result; + return_VALUE(result); } subsys_initcall(acpi_init); diff --git a/trunk/drivers/acpi/button.c b/trunk/drivers/acpi/button.c index fd1ba05eab68..4b6d9f0096a1 100644 --- a/trunk/drivers/acpi/button.c +++ b/trunk/drivers/acpi/button.c @@ -82,6 +82,7 @@ static struct acpi_driver acpi_button_driver = { }; struct acpi_button { + acpi_handle handle; struct acpi_device *device; /* Fixed button kludge */ u8 type; unsigned long pushed; @@ -111,14 +112,15 @@ static int acpi_button_info_seq_show(struct seq_file *seq, void *offset) { struct acpi_button *button = (struct acpi_button *)seq->private; + ACPI_FUNCTION_TRACE("acpi_button_info_seq_show"); if (!button || !button->device) - return 0; + return_VALUE(0); seq_printf(seq, "type: %s\n", acpi_device_name(button->device)); - return 0; + return_VALUE(0); } static int acpi_button_info_open_fs(struct inode *inode, struct file *file) @@ -132,11 +134,12 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) acpi_status status; unsigned long state; + ACPI_FUNCTION_TRACE("acpi_button_state_seq_show"); if (!button || !button->device) - return 0; + return_VALUE(0); - status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, &state); + status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state); if (ACPI_FAILURE(status)) { seq_printf(seq, "state: unsupported\n"); } else { @@ -144,7 +147,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) (state ? "open" : "closed")); } - return 0; + return_VALUE(0); } static int acpi_button_state_open_fs(struct inode *inode, struct file *file) @@ -161,9 +164,10 @@ static int acpi_button_add_fs(struct acpi_device *device) struct proc_dir_entry *entry = NULL; struct acpi_button *button = NULL; + ACPI_FUNCTION_TRACE("acpi_button_add_fs"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); button = acpi_driver_data(device); @@ -191,19 +195,21 @@ static int acpi_button_add_fs(struct acpi_device *device) } if (!entry) - return -ENODEV; + return_VALUE(-ENODEV); entry->owner = THIS_MODULE; acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); acpi_device_dir(device)->owner = THIS_MODULE; /* 'info' [R] */ entry = create_proc_entry(ACPI_BUTTON_FILE_INFO, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_BUTTON_FILE_INFO)); else { entry->proc_fops = &acpi_button_info_fops; entry->data = acpi_driver_data(device); @@ -215,7 +221,9 @@ static int acpi_button_add_fs(struct acpi_device *device) entry = create_proc_entry(ACPI_BUTTON_FILE_STATE, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_BUTTON_FILE_INFO)); else { entry->proc_fops = &acpi_button_state_fops; entry->data = acpi_driver_data(device); @@ -223,13 +231,14 @@ static int acpi_button_add_fs(struct acpi_device *device) } } - return 0; + return_VALUE(0); } static int acpi_button_remove_fs(struct acpi_device *device) { struct acpi_button *button = NULL; + ACPI_FUNCTION_TRACE("acpi_button_remove_fs"); button = acpi_driver_data(device); if (acpi_device_dir(device)) { @@ -244,7 +253,7 @@ static int acpi_button_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -255,9 +264,10 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data) { struct acpi_button *button = (struct acpi_button *)data; + ACPI_FUNCTION_TRACE("acpi_button_notify"); if (!button || !button->device) - return; + return_VOID; switch (event) { case ACPI_BUTTON_NOTIFY_STATUS: @@ -270,20 +280,21 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data) break; } - return; + return_VOID; } static acpi_status acpi_button_notify_fixed(void *data) { struct acpi_button *button = (struct acpi_button *)data; + ACPI_FUNCTION_TRACE("acpi_button_notify_fixed"); if (!button) - return AE_BAD_PARAMETER; + return_ACPI_STATUS(AE_BAD_PARAMETER); - acpi_button_notify(button->device->handle, ACPI_BUTTON_NOTIFY_STATUS, button); + acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); - return AE_OK; + return_ACPI_STATUS(AE_OK); } static int acpi_button_add(struct acpi_device *device) @@ -292,16 +303,18 @@ static int acpi_button_add(struct acpi_device *device) acpi_status status = AE_OK; struct acpi_button *button = NULL; + ACPI_FUNCTION_TRACE("acpi_button_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); button = kmalloc(sizeof(struct acpi_button), GFP_KERNEL); if (!button) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(button, 0, sizeof(struct acpi_button)); button->device = device; + button->handle = device->handle; acpi_driver_data(device) = button; /* @@ -336,8 +349,8 @@ static int acpi_button_add(struct acpi_device *device) sprintf(acpi_device_class(device), "%s/%s", ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); } else { - printk(KERN_ERR PREFIX "Unsupported hid [%s]\n", - acpi_device_hid(device)); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n", + acpi_device_hid(device))); result = -ENODEV; goto end; } @@ -360,7 +373,7 @@ static int acpi_button_add(struct acpi_device *device) button); break; default: - status = acpi_install_notify_handler(device->handle, + status = acpi_install_notify_handler(button->handle, ACPI_DEVICE_NOTIFY, acpi_button_notify, button); @@ -368,6 +381,8 @@ static int acpi_button_add(struct acpi_device *device) } if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); result = -ENODEV; goto end; } @@ -391,7 +406,7 @@ static int acpi_button_add(struct acpi_device *device) kfree(button); } - return result; + return_VALUE(result); } static int acpi_button_remove(struct acpi_device *device, int type) @@ -399,9 +414,10 @@ static int acpi_button_remove(struct acpi_device *device, int type) acpi_status status = 0; struct acpi_button *button = NULL; + ACPI_FUNCTION_TRACE("acpi_button_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); button = acpi_driver_data(device); @@ -418,39 +434,45 @@ static int acpi_button_remove(struct acpi_device *device, int type) acpi_button_notify_fixed); break; default: - status = acpi_remove_notify_handler(device->handle, + status = acpi_remove_notify_handler(button->handle, ACPI_DEVICE_NOTIFY, acpi_button_notify); break; } + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); + acpi_button_remove_fs(device); kfree(button); - return 0; + return_VALUE(0); } static int __init acpi_button_init(void) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_button_init"); acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir); if (!acpi_button_dir) - return -ENODEV; + return_VALUE(-ENODEV); acpi_button_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_button_driver); if (result < 0) { remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); - return -ENODEV; + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } static void __exit acpi_button_exit(void) { + ACPI_FUNCTION_TRACE("acpi_button_exit"); acpi_bus_unregister_driver(&acpi_button_driver); @@ -462,7 +484,7 @@ static void __exit acpi_button_exit(void) remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir); remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); - return; + return_VOID; } module_init(acpi_button_init); diff --git a/trunk/drivers/acpi/cm_sbs.c b/trunk/drivers/acpi/cm_sbs.c deleted file mode 100644 index 574a75a166c5..000000000000 --- a/trunk/drivers/acpi/cm_sbs.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -ACPI_MODULE_NAME("cm_sbs") -#define ACPI_AC_CLASS "ac_adapter" -#define ACPI_BATTERY_CLASS "battery" -#define ACPI_SBS_COMPONENT 0x00080000 -#define _COMPONENT ACPI_SBS_COMPONENT -static struct proc_dir_entry *acpi_ac_dir; -static struct proc_dir_entry *acpi_battery_dir; - -static struct semaphore cm_sbs_sem; - -static int lock_ac_dir_cnt = 0; -static int lock_battery_dir_cnt = 0; - -struct proc_dir_entry *acpi_lock_ac_dir(void) -{ - - down(&cm_sbs_sem); - if (!acpi_ac_dir) { - acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); - } - if (acpi_ac_dir) { - lock_ac_dir_cnt++; - } else { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Cannot create %s\n", ACPI_AC_CLASS)); - } - up(&cm_sbs_sem); - return acpi_ac_dir; -} - -EXPORT_SYMBOL(acpi_lock_ac_dir); - -void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param) -{ - - down(&cm_sbs_sem); - if (acpi_ac_dir_param) { - lock_ac_dir_cnt--; - } - if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) { - remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); - acpi_ac_dir = 0; - } - up(&cm_sbs_sem); -} - -EXPORT_SYMBOL(acpi_unlock_ac_dir); - -struct proc_dir_entry *acpi_lock_battery_dir(void) -{ - - down(&cm_sbs_sem); - if (!acpi_battery_dir) { - acpi_battery_dir = - proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); - } - if (acpi_battery_dir) { - lock_battery_dir_cnt++; - } else { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Cannot create %s\n", ACPI_BATTERY_CLASS)); - } - up(&cm_sbs_sem); - return acpi_battery_dir; -} - -EXPORT_SYMBOL(acpi_lock_battery_dir); - -void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param) -{ - - down(&cm_sbs_sem); - if (acpi_battery_dir_param) { - lock_battery_dir_cnt--; - } - if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param - && acpi_battery_dir) { - remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); - acpi_battery_dir = 0; - } - up(&cm_sbs_sem); - return; -} - -EXPORT_SYMBOL(acpi_unlock_battery_dir); - -static int __init acpi_cm_sbs_init(void) -{ - - if (acpi_disabled) - return 0; - - init_MUTEX(&cm_sbs_sem); - - return 0; -} - -subsys_initcall(acpi_cm_sbs_init); diff --git a/trunk/drivers/acpi/container.c b/trunk/drivers/acpi/container.c index 871aa520ece7..b69a8cad82b7 100644 --- a/trunk/drivers/acpi/container.c +++ b/trunk/drivers/acpi/container.c @@ -73,16 +73,17 @@ static int is_device_present(acpi_handle handle) acpi_status status; unsigned long sta; + ACPI_FUNCTION_TRACE("is_device_present"); status = acpi_get_handle(handle, "_STA", &temp); if (ACPI_FAILURE(status)) - return 1; /* _STA not found, assmue device present */ + return_VALUE(1); /* _STA not found, assmue device present */ status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); if (ACPI_FAILURE(status)) - return 0; /* Firmware error */ + return_VALUE(0); /* Firmware error */ - return ((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT); + return_VALUE((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT); } /*******************************************************************/ @@ -90,15 +91,16 @@ static int acpi_container_add(struct acpi_device *device) { struct acpi_container *container; + ACPI_FUNCTION_TRACE("acpi_container_add"); if (!device) { - printk(KERN_ERR PREFIX "device is NULL\n"); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "device is NULL\n")); + return_VALUE(-EINVAL); } container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL); if (!container) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(container, 0, sizeof(struct acpi_container)); container->handle = device->handle; @@ -109,7 +111,7 @@ static int acpi_container_add(struct acpi_device *device) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n", acpi_device_name(device), acpi_device_bid(device))); - return 0; + return_VALUE(0); } static int acpi_container_remove(struct acpi_device *device, int type) @@ -128,22 +130,23 @@ static int container_device_add(struct acpi_device **device, acpi_handle handle) struct acpi_device *pdev; int result; + ACPI_FUNCTION_TRACE("container_device_add"); if (acpi_get_parent(handle, &phandle)) { - return -ENODEV; + return_VALUE(-ENODEV); } if (acpi_bus_get_device(phandle, &pdev)) { - return -ENODEV; + return_VALUE(-ENODEV); } if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) { - return -ENODEV; + return_VALUE(-ENODEV); } result = acpi_bus_start(*device); - return result; + return_VALUE(result); } static void container_notify_cb(acpi_handle handle, u32 type, void *context) @@ -153,6 +156,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) int present; acpi_status status; + ACPI_FUNCTION_TRACE("container_notify_cb"); present = is_device_present(handle); @@ -188,7 +192,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) default: break; } - return; + return_VOID; } static acpi_status @@ -201,10 +205,11 @@ container_walk_namespace_cb(acpi_handle handle, acpi_status status; int *action = context; + ACPI_FUNCTION_TRACE("container_walk_namespace_cb"); status = acpi_get_object_info(handle, &buffer); if (ACPI_FAILURE(status) || !buffer.pointer) { - return AE_OK; + return_ACPI_STATUS(AE_OK); } info = buffer.pointer; @@ -236,9 +241,9 @@ container_walk_namespace_cb(acpi_handle handle, } end: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); - return AE_OK; + return_ACPI_STATUS(AE_OK); } static int __init acpi_container_init(void) @@ -264,6 +269,7 @@ static void __exit acpi_container_exit(void) { int action = UNINSTALL_NOTIFY_HANDLER; + ACPI_FUNCTION_TRACE("acpi_container_exit"); acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, @@ -272,7 +278,7 @@ static void __exit acpi_container_exit(void) acpi_bus_unregister_driver(&acpi_container_driver); - return; + return_VOID; } module_init(acpi_container_init); diff --git a/trunk/drivers/acpi/debug.c b/trunk/drivers/acpi/debug.c index 35c6af8a83cd..263322b7d113 100644 --- a/trunk/drivers/acpi/debug.c +++ b/trunk/drivers/acpi/debug.c @@ -155,12 +155,13 @@ acpi_system_write_debug(struct file *file, { char debug_string[12] = { '\0' }; + ACPI_FUNCTION_TRACE("acpi_system_write_debug"); if (count > sizeof(debug_string) - 1) - return -EINVAL; + return_VALUE(-EINVAL); if (copy_from_user(debug_string, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); debug_string[count] = '\0'; @@ -172,10 +173,10 @@ acpi_system_write_debug(struct file *file, acpi_dbg_level = simple_strtoul(debug_string, NULL, 0); break; default: - return -EINVAL; + return_VALUE(-EINVAL); } - return count; + return_VALUE(count); } static int __init acpi_debug_init(void) @@ -184,9 +185,10 @@ static int __init acpi_debug_init(void) int error = 0; char *name; + ACPI_FUNCTION_TRACE("acpi_debug_init"); if (acpi_disabled) - return 0; + return_VALUE(0); /* 'debug_layer' [R/W] */ name = ACPI_SYSTEM_FILE_DEBUG_LAYER; @@ -211,12 +213,15 @@ static int __init acpi_debug_init(void) goto Error; Done: - return error; + return_VALUE(error); Error: + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' proc fs entry\n", name)); + remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir); - error = -ENODEV; + error = -EFAULT; goto Done; } diff --git a/trunk/drivers/acpi/dispatcher/dsinit.c b/trunk/drivers/acpi/dispatcher/dsinit.c index daf51b5b5875..bbdf990e9f65 100644 --- a/trunk/drivers/acpi/dispatcher/dsinit.c +++ b/trunk/drivers/acpi/dispatcher/dsinit.c @@ -125,7 +125,37 @@ acpi_ds_init_one_object(acpi_handle obj_handle, if (info->table_desc->pointer->revision == 1) { node->flags |= ANOBJ_DATA_WIDTH_32; } +#ifdef ACPI_INIT_PARSE_METHODS + /* + * Note 11/2005: Removed this code to parse all methods during table + * load because it causes problems if there are any errors during the + * parse. Also, it seems like overkill and we probably don't want to + * abort a table load because of an issue with a single method. + */ + + /* + * Print a dot for each method unless we are going to print + * the entire pathname + */ + if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) { + ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ".")); + } + /* + * Always parse methods to detect errors, we will delete + * the parse tree below + */ + status = acpi_ds_parse_method(obj_handle); + if (ACPI_FAILURE(status)) { + ACPI_ERROR((AE_INFO, + "Method %p [%4.4s] - parse failure, %s", + obj_handle, + acpi_ut_get_node_name(obj_handle), + acpi_format_exception(status))); + + /* This parse failed, but we will continue parsing more methods */ + } +#endif info->method_count++; break; diff --git a/trunk/drivers/acpi/dispatcher/dsmethod.c b/trunk/drivers/acpi/dispatcher/dsmethod.c index a39a33f4847a..bc9aca4e7401 100644 --- a/trunk/drivers/acpi/dispatcher/dsmethod.c +++ b/trunk/drivers/acpi/dispatcher/dsmethod.c @@ -52,10 +52,6 @@ #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME("dsmethod") -/* Local prototypes */ -static acpi_status -acpi_ds_create_method_mutex(union acpi_operand_object *method_desc); - /******************************************************************************* * * FUNCTION: acpi_ds_method_error @@ -71,7 +67,6 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc); * Note: Allows the exception handler to change the status code * ******************************************************************************/ - acpi_status acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) { @@ -116,53 +111,13 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) return (status); } -/******************************************************************************* - * - * FUNCTION: acpi_ds_create_method_mutex - * - * PARAMETERS: obj_desc - The method object - * - * RETURN: Status - * - * DESCRIPTION: Create a mutex object for a serialized control method - * - ******************************************************************************/ - -static acpi_status -acpi_ds_create_method_mutex(union acpi_operand_object *method_desc) -{ - union acpi_operand_object *mutex_desc; - acpi_status status; - - ACPI_FUNCTION_NAME(ds_create_method_mutex); - - /* Create the new mutex object */ - - mutex_desc = acpi_ut_create_internal_object(ACPI_TYPE_MUTEX); - if (!mutex_desc) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - /* Create the actual OS Mutex */ - - status = acpi_os_create_mutex(&mutex_desc->mutex.os_mutex); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - mutex_desc->mutex.sync_level = method_desc->method.sync_level; - method_desc->method.mutex = mutex_desc; - return_ACPI_STATUS(AE_OK); -} - /******************************************************************************* * * FUNCTION: acpi_ds_begin_method_execution * * PARAMETERS: method_node - Node of the method * obj_desc - The method object - * walk_state - current state, NULL if not yet executing - * a method. + * calling_method_node - Caller of this method (if non-null) * * RETURN: Status * @@ -173,9 +128,9 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc) ******************************************************************************/ acpi_status -acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state) +acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node, + union acpi_operand_object * obj_desc, + struct acpi_namespace_node * calling_method_node) { acpi_status status = AE_OK; @@ -194,80 +149,35 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, } /* - * If this method is serialized, we need to acquire the method mutex. + * If there is a concurrency limit on this method, we need to + * obtain a unit from the method semaphore. */ - if (obj_desc->method.method_flags & AML_METHOD_SERIALIZED) { - /* - * Create a mutex for the method if it is defined to be Serialized - * and a mutex has not already been created. We defer the mutex creation - * until a method is actually executed, to minimize the object count - */ - if (!obj_desc->method.mutex) { - status = acpi_ds_create_method_mutex(obj_desc); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - } - + if (obj_desc->method.semaphore) { /* - * The current_sync_level (per-thread) must be less than or equal to - * the sync level of the method. This mechanism provides some - * deadlock prevention + * Allow recursive method calls, up to the reentrancy/concurrency + * limit imposed by the SERIALIZED rule and the sync_level method + * parameter. * - * Top-level method invocation has no walk state at this point + * The point of this code is to avoid permanently blocking a + * thread that is making recursive method calls. */ - if (walk_state && - (walk_state->thread->current_sync_level > - obj_desc->method.mutex->mutex.sync_level)) { - ACPI_ERROR((AE_INFO, - "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%d)", - acpi_ut_get_node_name(method_node), - walk_state->thread->current_sync_level)); - - return_ACPI_STATUS(AE_AML_MUTEX_ORDER); + if (method_node == calling_method_node) { + if (obj_desc->method.thread_count >= + obj_desc->method.concurrency) { + return_ACPI_STATUS(AE_AML_METHOD_LIMIT); + } } /* - * Obtain the method mutex if necessary. Do not acquire mutex for a - * recursive call. + * Get a unit from the method semaphore. This releases the + * interpreter if we block (then reacquires it) */ - if (!walk_state || - !obj_desc->method.mutex->mutex.owner_thread || - (walk_state->thread != - obj_desc->method.mutex->mutex.owner_thread)) { - /* - * Acquire the method mutex. This releases the interpreter if we - * block (and reacquires it before it returns) - */ - status = - acpi_ex_system_wait_mutex(obj_desc->method.mutex-> - mutex.os_mutex, - ACPI_WAIT_FOREVER); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Update the mutex and walk info and save the original sync_level */ - - if (walk_state) { - obj_desc->method.mutex->mutex. - original_sync_level = - walk_state->thread->current_sync_level; - - obj_desc->method.mutex->mutex.owner_thread = - walk_state->thread; - walk_state->thread->current_sync_level = - obj_desc->method.sync_level; - } else { - obj_desc->method.mutex->mutex. - original_sync_level = - obj_desc->method.mutex->mutex.sync_level; - } + status = + acpi_ex_system_wait_semaphore(obj_desc->method.semaphore, + ACPI_WAIT_FOREVER); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); } - - /* Always increase acquisition depth */ - - obj_desc->method.mutex->mutex.acquisition_depth++; } /* @@ -290,10 +200,10 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, return_ACPI_STATUS(status); cleanup: - /* On error, must release the method mutex (if present) */ + /* On error, must signal the method semaphore if present */ - if (obj_desc->method.mutex) { - acpi_os_release_mutex(obj_desc->method.mutex->mutex.os_mutex); + if (obj_desc->method.semaphore) { + (void)acpi_os_signal_semaphore(obj_desc->method.semaphore, 1); } return_ACPI_STATUS(status); } @@ -343,10 +253,10 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, return_ACPI_STATUS(AE_NULL_OBJECT); } - /* Init for new method, possibly wait on method mutex */ + /* Init for new method, possibly wait on concurrency semaphore */ status = acpi_ds_begin_method_execution(method_node, obj_desc, - this_walk_state); + this_walk_state->method_node); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } @@ -568,8 +478,6 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, * created, delete all locals and arguments, and delete the parse * tree if requested. * - * MUTEX: Interpreter is locked - * ******************************************************************************/ void @@ -595,21 +503,26 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, } /* - * If method is serialized, release the mutex and restore the - * current sync level for this thread + * Lock the parser while we terminate this method. + * If this is the last thread executing the method, + * we have additional cleanup to perform */ - if (method_desc->method.mutex) { + status = acpi_ut_acquire_mutex(ACPI_MTX_CONTROL_METHOD); + if (ACPI_FAILURE(status)) { + return_VOID; + } - /* Acquisition Depth handles recursive calls */ + /* Signal completion of the execution of this method if necessary */ - method_desc->method.mutex->mutex.acquisition_depth--; - if (!method_desc->method.mutex->mutex.acquisition_depth) { - walk_state->thread->current_sync_level = - method_desc->method.mutex->mutex. - original_sync_level; + if (method_desc->method.semaphore) { + status = + acpi_os_signal_semaphore(method_desc->method.semaphore, 1); + if (ACPI_FAILURE(status)) { + + /* Ignore error and continue */ - acpi_os_release_mutex(method_desc->method.mutex->mutex. - os_mutex); + ACPI_EXCEPTION((AE_INFO, status, + "Could not signal method semaphore")); } } @@ -624,7 +537,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { - return_VOID; + goto exit; } /* @@ -667,16 +580,18 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, /* * Support to dynamically change a method from not_serialized to * Serialized if it appears that the method is incorrectly written and - * does not support multiple thread execution. The best example of this - * is if such a method creates namespace objects and blocks. A second + * does not support multiple thread execution. The best example of this + * is if such a method creates namespace objects and blocks. A second * thread will fail with an AE_ALREADY_EXISTS exception * * This code is here because we must wait until the last thread exits * before creating the synchronization semaphore. */ - if ((method_desc->method.method_flags & AML_METHOD_SERIALIZED) - && (!method_desc->method.mutex)) { - status = acpi_ds_create_method_mutex(method_desc); + if ((method_desc->method.concurrency == 1) && + (!method_desc->method.semaphore)) { + status = acpi_os_create_semaphore(1, 1, + &method_desc->method. + semaphore); } /* No more threads, we can free the owner_id */ @@ -684,5 +599,144 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, acpi_ut_release_owner_id(&method_desc->method.owner_id); } + exit: + (void)acpi_ut_release_mutex(ACPI_MTX_CONTROL_METHOD); return_VOID; } + +#ifdef ACPI_INIT_PARSE_METHODS + /* + * Note 11/2005: Removed this code to parse all methods during table + * load because it causes problems if there are any errors during the + * parse. Also, it seems like overkill and we probably don't want to + * abort a table load because of an issue with a single method. + */ + +/******************************************************************************* + * + * FUNCTION: acpi_ds_parse_method + * + * PARAMETERS: Node - Method node + * + * RETURN: Status + * + * DESCRIPTION: Parse the AML that is associated with the method. + * + * MUTEX: Assumes parser is locked + * + ******************************************************************************/ + +acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node) +{ + acpi_status status; + union acpi_operand_object *obj_desc; + union acpi_parse_object *op; + struct acpi_walk_state *walk_state; + + ACPI_FUNCTION_TRACE_PTR(ds_parse_method, node); + + /* Parameter Validation */ + + if (!node) { + return_ACPI_STATUS(AE_NULL_ENTRY); + } + + ACPI_DEBUG_PRINT((ACPI_DB_PARSE, + "**** Parsing [%4.4s] **** NamedObj=%p\n", + acpi_ut_get_node_name(node), node)); + + /* Extract the method object from the method Node */ + + obj_desc = acpi_ns_get_attached_object(node); + if (!obj_desc) { + return_ACPI_STATUS(AE_NULL_OBJECT); + } + + /* Create a mutex for the method if there is a concurrency limit */ + + if ((obj_desc->method.concurrency != ACPI_INFINITE_CONCURRENCY) && + (!obj_desc->method.semaphore)) { + status = acpi_os_create_semaphore(obj_desc->method.concurrency, + obj_desc->method.concurrency, + &obj_desc->method.semaphore); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + } + + /* + * Allocate a new parser op to be the root of the parsed + * method tree + */ + op = acpi_ps_alloc_op(AML_METHOD_OP); + if (!op) { + return_ACPI_STATUS(AE_NO_MEMORY); + } + + /* Init new op with the method name and pointer back to the Node */ + + acpi_ps_set_name(op, node->name.integer); + op->common.node = node; + + /* + * Get a new owner_id for objects created by this method. Namespace + * objects (such as Operation Regions) can be created during the + * first pass parse. + */ + status = acpi_ut_allocate_owner_id(&obj_desc->method.owner_id); + if (ACPI_FAILURE(status)) { + goto cleanup; + } + + /* Create and initialize a new walk state */ + + walk_state = + acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, NULL, + NULL); + if (!walk_state) { + status = AE_NO_MEMORY; + goto cleanup2; + } + + status = acpi_ds_init_aml_walk(walk_state, op, node, + obj_desc->method.aml_start, + obj_desc->method.aml_length, NULL, 1); + if (ACPI_FAILURE(status)) { + acpi_ds_delete_walk_state(walk_state); + goto cleanup2; + } + + /* + * Parse the method, first pass + * + * The first pass load is where newly declared named objects are added into + * the namespace. Actual evaluation of the named objects (what would be + * called a "second pass") happens during the actual execution of the + * method so that operands to the named objects can take on dynamic + * run-time values. + */ + status = acpi_ps_parse_aml(walk_state); + if (ACPI_FAILURE(status)) { + goto cleanup2; + } + + ACPI_DEBUG_PRINT((ACPI_DB_PARSE, + "**** [%4.4s] Parsed **** NamedObj=%p Op=%p\n", + acpi_ut_get_node_name(node), node, op)); + + /* + * Delete the parse tree. We simply re-parse the method for every + * execution since there isn't much overhead (compared to keeping lots + * of parse trees around) + */ + acpi_ns_delete_namespace_subtree(node); + acpi_ns_delete_namespace_by_owner(obj_desc->method.owner_id); + + cleanup2: + acpi_ut_release_owner_id(&obj_desc->method.owner_id); + + cleanup: + acpi_ps_delete_parse_tree(op); + return_ACPI_STATUS(status); +} +#endif diff --git a/trunk/drivers/acpi/dispatcher/dswexec.c b/trunk/drivers/acpi/dispatcher/dswexec.c index b1ded62d0df1..3acbd9145d72 100644 --- a/trunk/drivers/acpi/dispatcher/dswexec.c +++ b/trunk/drivers/acpi/dispatcher/dswexec.c @@ -472,6 +472,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) acpi_ds_result_push(walk_state->result_obj, walk_state); } + break; default: @@ -509,7 +510,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Method Reference in a Package, Op=%p\n", op)); - op->common.node = (struct acpi_namespace_node *)op->asl.value. arg->asl.node->object; @@ -670,6 +670,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) status = acpi_ds_result_stack_pop(walk_state); } + break; case AML_TYPE_UNDEFINED: @@ -707,6 +708,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) * Check if we just completed the evaluation of a * conditional predicate */ + if ((ACPI_SUCCESS(status)) && (walk_state->control_state) && (walk_state->control_state->common.state == diff --git a/trunk/drivers/acpi/dispatcher/dswload.c b/trunk/drivers/acpi/dispatcher/dswload.c index e3ca7f6539c1..35074399c617 100644 --- a/trunk/drivers/acpi/dispatcher/dswload.c +++ b/trunk/drivers/acpi/dispatcher/dswload.c @@ -175,7 +175,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, if (status == AE_NOT_FOUND) { /* * Table disassembly: - * Target of Scope() not found. Generate an External for it, and + * Target of Scope() not found. Generate an External for it, and * insert the name into the namespace. */ acpi_dm_add_to_external_list(path, ACPI_TYPE_DEVICE, 0); @@ -210,15 +210,16 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This + * These types we will allow, but we will change the type. This * enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } * - * Note: silently change the type here. On the second pass, we will report + * Note: silently change the type here. On the second pass, we will report * a warning */ + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", path, @@ -241,6 +242,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, break; default: + /* * For all other named opcodes, we will enter the name into * the namespace. @@ -257,6 +259,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, * buffer_field, or Package), the name of the object is already * in the namespace. */ + if (walk_state->deferred_node) { /* This name is already in the namespace, get the node */ @@ -290,8 +293,8 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, } /* - * Enter the named type into the internal namespace. We enter the name - * as we go downward in the parse tree. Any necessary subobjects that + * Enter the named type into the internal namespace. We enter the name + * as we go downward in the parse tree. Any necessary subobjects that * involve arguments to the opcode must be created as we go back up the * parse tree later. */ @@ -324,12 +327,12 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, (status); } } - status = AE_OK; } } if (ACPI_FAILURE(status)) { + ACPI_ERROR_NAMESPACE(path, status); return_ACPI_STATUS(status); } @@ -431,13 +434,9 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state) status = acpi_ex_create_region(op->named.data, op->named.length, - (acpi_adr_space_type) ((op-> - common. - value. - arg)-> - common. - value. - integer), + (acpi_adr_space_type) + ((op->common.value.arg)-> + common.value.integer), walk_state); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); @@ -475,7 +474,7 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state) * method_op pkg_length name_string method_flags term_list * * Note: We must create the method node/object pair as soon as we - * see the method declaration. This allows later pass1 parsing + * see the method declaration. This allows later pass1 parsing * of invocations of the method (need to know the number of * arguments.) */ @@ -500,7 +499,6 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state) length, walk_state); } - walk_state->operands[0] = NULL; walk_state->num_operands = 0; @@ -572,6 +570,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, #ifdef ACPI_ENABLE_MODULE_LEVEL_CODE if ((walk_state->op_info->class == AML_CLASS_EXECUTE) || (walk_state->op_info->class == AML_CLASS_CONTROL)) { + ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Begin/EXEC: %s (fl %8.8X)\n", walk_state->op_info->name, @@ -603,7 +602,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, } else { /* Get name from the op */ - buffer_ptr = ACPI_CAST_PTR(char, &op->named.name); + buffer_ptr = (char *)&op->named.name; } } else { /* Get the namestring from the raw AML */ @@ -630,6 +629,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, break; case AML_INT_NAMEPATH_OP: + /* * The name_path is an object reference to an existing object. * Don't enter the name into the namespace, but look it up @@ -642,6 +642,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, break; case AML_SCOPE_OP: + /* * The Path is an object reference to an existing object. * Don't enter the name into the namespace, but look it up @@ -663,7 +664,6 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, #endif return_ACPI_STATUS(status); } - /* * We must check to make sure that the target is * one of the opcodes that actually opens a scope @@ -683,12 +683,13 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This + * These types we will allow, but we will change the type. This * enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } */ + ACPI_WARNING((AE_INFO, "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", buffer_ptr, @@ -728,14 +729,14 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } - } + } return_ACPI_STATUS(AE_OK); } /* - * Enter the named type into the internal namespace. We enter the name - * as we go downward in the parse tree. Any necessary subobjects that + * Enter the named type into the internal namespace. We enter the name + * as we go downward in the parse tree. Any necessary subobjects that * involve arguments to the opcode must be created as we go back up the * parse tree later. * @@ -786,6 +787,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, * can get it again quickly when this scope is closed */ op->common.node = node; + return_ACPI_STATUS(status); } @@ -920,6 +922,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) #ifndef ACPI_NO_METHOD_EXECUTION case AML_TYPE_CREATE_FIELD: + /* * Create the field object, but the field buffer and index must * be evaluated later during the execution phase @@ -928,6 +931,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) break; case AML_TYPE_NAMED_FIELD: + /* * If we are executing a method, initialize the field */ @@ -1047,7 +1051,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) * argument is the space_id. (We must save the address of the * AML of the address and length operands) */ - /* * If we have a valid region, initialize it * Namespace is NOT locked at this point. @@ -1077,7 +1080,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) * method_op pkg_length name_string method_flags term_list * * Note: We must create the method node/object pair as soon as we - * see the method declaration. This allows later pass1 parsing + * see the method declaration. This allows later pass1 parsing * of invocations of the method (need to know the number of * arguments.) */ diff --git a/trunk/drivers/acpi/dock.c b/trunk/drivers/acpi/dock.c deleted file mode 100644 index 510a94524298..000000000000 --- a/trunk/drivers/acpi/dock.c +++ /dev/null @@ -1,739 +0,0 @@ -/* - * dock.c - ACPI dock station driver - * - * Copyright (C) 2006 Kristen Carlson Accardi - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - -#include -#include -#include -#include -#include -#include -#include - -#define ACPI_DOCK_DRIVER_NAME "ACPI Dock Station Driver" - -ACPI_MODULE_NAME("dock") -MODULE_AUTHOR("Kristen Carlson Accardi"); -MODULE_DESCRIPTION(ACPI_DOCK_DRIVER_NAME); -MODULE_LICENSE("GPL"); - -static struct atomic_notifier_head dock_notifier_list; - -struct dock_station { - acpi_handle handle; - unsigned long last_dock_time; - u32 flags; - spinlock_t dd_lock; - spinlock_t hp_lock; - struct list_head dependent_devices; - struct list_head hotplug_devices; -}; - -struct dock_dependent_device { - struct list_head list; - struct list_head hotplug_list; - acpi_handle handle; - acpi_notify_handler handler; - void *context; -}; - -#define DOCK_DOCKING 0x00000001 -#define DOCK_EVENT KOBJ_DOCK -#define UNDOCK_EVENT KOBJ_UNDOCK - -static struct dock_station *dock_station; - -/***************************************************************************** - * Dock Dependent device functions * - *****************************************************************************/ -/** - * alloc_dock_dependent_device - allocate and init a dependent device - * @handle: the acpi_handle of the dependent device - * - * Allocate memory for a dependent device structure for a device referenced - * by the acpi handle - */ -static struct dock_dependent_device * -alloc_dock_dependent_device(acpi_handle handle) -{ - struct dock_dependent_device *dd; - - dd = kzalloc(sizeof(*dd), GFP_KERNEL); - if (dd) { - dd->handle = handle; - INIT_LIST_HEAD(&dd->list); - INIT_LIST_HEAD(&dd->hotplug_list); - } - return dd; -} - -/** - * add_dock_dependent_device - associate a device with the dock station - * @ds: The dock station - * @dd: The dependent device - * - * Add the dependent device to the dock's dependent device list. - */ -static void -add_dock_dependent_device(struct dock_station *ds, - struct dock_dependent_device *dd) -{ - spin_lock(&ds->dd_lock); - list_add_tail(&dd->list, &ds->dependent_devices); - spin_unlock(&ds->dd_lock); -} - -/** - * dock_add_hotplug_device - associate a hotplug handler with the dock station - * @ds: The dock station - * @dd: The dependent device struct - * - * Add the dependent device to the dock's hotplug device list - */ -static void -dock_add_hotplug_device(struct dock_station *ds, - struct dock_dependent_device *dd) -{ - spin_lock(&ds->hp_lock); - list_add_tail(&dd->hotplug_list, &ds->hotplug_devices); - spin_unlock(&ds->hp_lock); -} - -/** - * dock_del_hotplug_device - remove a hotplug handler from the dock station - * @ds: The dock station - * @dd: the dependent device struct - * - * Delete the dependent device from the dock's hotplug device list - */ -static void -dock_del_hotplug_device(struct dock_station *ds, - struct dock_dependent_device *dd) -{ - spin_lock(&ds->hp_lock); - list_del(&dd->hotplug_list); - spin_unlock(&ds->hp_lock); -} - -/** - * find_dock_dependent_device - get a device dependent on this dock - * @ds: the dock station - * @handle: the acpi_handle of the device we want - * - * iterate over the dependent device list for this dock. If the - * dependent device matches the handle, return. - */ -static struct dock_dependent_device * -find_dock_dependent_device(struct dock_station *ds, acpi_handle handle) -{ - struct dock_dependent_device *dd; - - spin_lock(&ds->dd_lock); - list_for_each_entry(dd, &ds->dependent_devices, list) { - if (handle == dd->handle) { - spin_unlock(&ds->dd_lock); - return dd; - } - } - spin_unlock(&ds->dd_lock); - return NULL; -} - -/***************************************************************************** - * Dock functions * - *****************************************************************************/ -/** - * is_dock - see if a device is a dock station - * @handle: acpi handle of the device - * - * If an acpi object has a _DCK method, then it is by definition a dock - * station, so return true. - */ -static int is_dock(acpi_handle handle) -{ - acpi_status status; - acpi_handle tmp; - - status = acpi_get_handle(handle, "_DCK", &tmp); - if (ACPI_FAILURE(status)) - return 0; - return 1; -} - -/** - * is_dock_device - see if a device is on a dock station - * @handle: acpi handle of the device - * - * If this device is either the dock station itself, - * or is a device dependent on the dock station, then it - * is a dock device - */ -int is_dock_device(acpi_handle handle) -{ - if (!dock_station) - return 0; - - if (is_dock(handle) || find_dock_dependent_device(dock_station, handle)) - return 1; - - return 0; -} - -EXPORT_SYMBOL_GPL(is_dock_device); - -/** - * dock_present - see if the dock station is present. - * @ds: the dock station - * - * execute the _STA method. note that present does not - * imply that we are docked. - */ -static int dock_present(struct dock_station *ds) -{ - unsigned long sta; - acpi_status status; - - if (ds) { - status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta); - if (ACPI_SUCCESS(status) && sta) - return 1; - } - return 0; -} - - - -/** - * dock_create_acpi_device - add new devices to acpi - * @handle - handle of the device to add - * - * This function will create a new acpi_device for the given - * handle if one does not exist already. This should cause - * acpi to scan for drivers for the given devices, and call - * matching driver's add routine. - * - * Returns a pointer to the acpi_device corresponding to the handle. - */ -static struct acpi_device * dock_create_acpi_device(acpi_handle handle) -{ - struct acpi_device *device = NULL; - struct acpi_device *parent_device; - acpi_handle parent; - int ret; - - if (acpi_bus_get_device(handle, &device)) { - /* - * no device created for this object, - * so we should create one. - */ - acpi_get_parent(handle, &parent); - if (acpi_bus_get_device(parent, &parent_device)) - parent_device = NULL; - - ret = acpi_bus_add(&device, parent_device, handle, - ACPI_BUS_TYPE_DEVICE); - if (ret) { - pr_debug("error adding bus, %x\n", - -ret); - return NULL; - } - } - return device; -} - -/** - * dock_remove_acpi_device - remove the acpi_device struct from acpi - * @handle - the handle of the device to remove - * - * Tell acpi to remove the acpi_device. This should cause any loaded - * driver to have it's remove routine called. - */ -static void dock_remove_acpi_device(acpi_handle handle) -{ - struct acpi_device *device; - int ret; - - if (!acpi_bus_get_device(handle, &device)) { - ret = acpi_bus_trim(device, 1); - if (ret) - pr_debug("error removing bus, %x\n", -ret); - } -} - - -/** - * hotplug_dock_devices - insert or remove devices on the dock station - * @ds: the dock station - * @event: either bus check or eject request - * - * Some devices on the dock station need to have drivers called - * to perform hotplug operations after a dock event has occurred. - * Traverse the list of dock devices that have registered a - * hotplug handler, and call the handler. - */ -static void hotplug_dock_devices(struct dock_station *ds, u32 event) -{ - struct dock_dependent_device *dd; - - spin_lock(&ds->hp_lock); - - /* - * First call driver specific hotplug functions - */ - list_for_each_entry(dd, &ds->hotplug_devices, hotplug_list) { - if (dd->handler) - dd->handler(dd->handle, event, dd->context); - } - - /* - * Now make sure that an acpi_device is created for each - * dependent device, or removed if this is an eject request. - * This will cause acpi_drivers to be stopped/started if they - * exist - */ - list_for_each_entry(dd, &ds->dependent_devices, list) { - if (event == ACPI_NOTIFY_EJECT_REQUEST) - dock_remove_acpi_device(dd->handle); - else - dock_create_acpi_device(dd->handle); - } - spin_unlock(&ds->hp_lock); -} - -static void dock_event(struct dock_station *ds, u32 event, int num) -{ - struct acpi_device *device; - - device = dock_create_acpi_device(ds->handle); - if (device) - kobject_uevent(&device->kobj, num); -} - -/** - * eject_dock - respond to a dock eject request - * @ds: the dock station - * - * This is called after _DCK is called, to execute the dock station's - * _EJ0 method. - */ -static void eject_dock(struct dock_station *ds) -{ - struct acpi_object_list arg_list; - union acpi_object arg; - acpi_status status; - acpi_handle tmp; - - /* all dock devices should have _EJ0, but check anyway */ - status = acpi_get_handle(ds->handle, "_EJ0", &tmp); - if (ACPI_FAILURE(status)) { - pr_debug("No _EJ0 support for dock device\n"); - return; - } - - arg_list.count = 1; - arg_list.pointer = &arg; - arg.type = ACPI_TYPE_INTEGER; - arg.integer.value = 1; - - if (ACPI_FAILURE(acpi_evaluate_object(ds->handle, "_EJ0", - &arg_list, NULL))) - pr_debug("Failed to evaluate _EJ0!\n"); -} - -/** - * handle_dock - handle a dock event - * @ds: the dock station - * @dock: to dock, or undock - that is the question - * - * Execute the _DCK method in response to an acpi event - */ -static void handle_dock(struct dock_station *ds, int dock) -{ - acpi_status status; - struct acpi_object_list arg_list; - union acpi_object arg; - struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; - struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL }; - union acpi_object *obj; - - acpi_get_name(ds->handle, ACPI_FULL_PATHNAME, &name_buffer); - obj = name_buffer.pointer; - - printk(KERN_INFO PREFIX "%s\n", dock ? "docking" : "undocking"); - - /* _DCK method has one argument */ - arg_list.count = 1; - arg_list.pointer = &arg; - arg.type = ACPI_TYPE_INTEGER; - arg.integer.value = dock; - status = acpi_evaluate_object(ds->handle, "_DCK", &arg_list, &buffer); - if (ACPI_FAILURE(status)) - pr_debug("%s: failed to execute _DCK\n", obj->string.pointer); - kfree(buffer.pointer); - kfree(name_buffer.pointer); -} - -static inline void dock(struct dock_station *ds) -{ - handle_dock(ds, 1); -} - -static inline void undock(struct dock_station *ds) -{ - handle_dock(ds, 0); -} - -static inline void begin_dock(struct dock_station *ds) -{ - ds->flags |= DOCK_DOCKING; -} - -static inline void complete_dock(struct dock_station *ds) -{ - ds->flags &= ~(DOCK_DOCKING); - ds->last_dock_time = jiffies; -} - -/** - * dock_in_progress - see if we are in the middle of handling a dock event - * @ds: the dock station - * - * Sometimes while docking, false dock events can be sent to the driver - * because good connections aren't made or some other reason. Ignore these - * if we are in the middle of doing something. - */ -static int dock_in_progress(struct dock_station *ds) -{ - if ((ds->flags & DOCK_DOCKING) || - time_before(jiffies, (ds->last_dock_time + HZ))) - return 1; - return 0; -} - -/** - * register_dock_notifier - add yourself to the dock notifier list - * @nb: the callers notifier block - * - * If a driver wishes to be notified about dock events, they can - * use this function to put a notifier block on the dock notifier list. - * this notifier call chain will be called after a dock event, but - * before hotplugging any new devices. - */ -int register_dock_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&dock_notifier_list, nb); -} - -EXPORT_SYMBOL_GPL(register_dock_notifier); - -/** - * unregister_dock_notifier - remove yourself from the dock notifier list - * @nb: the callers notifier block - */ -void unregister_dock_notifier(struct notifier_block *nb) -{ - atomic_notifier_chain_unregister(&dock_notifier_list, nb); -} - -EXPORT_SYMBOL_GPL(unregister_dock_notifier); - -/** - * register_hotplug_dock_device - register a hotplug function - * @handle: the handle of the device - * @handler: the acpi_notifier_handler to call after docking - * @context: device specific data - * - * If a driver would like to perform a hotplug operation after a dock - * event, they can register an acpi_notifiy_handler to be called by - * the dock driver after _DCK is executed. - */ -int -register_hotplug_dock_device(acpi_handle handle, acpi_notify_handler handler, - void *context) -{ - struct dock_dependent_device *dd; - - if (!dock_station) - return -ENODEV; - - /* - * make sure this handle is for a device dependent on the dock, - * this would include the dock station itself - */ - dd = find_dock_dependent_device(dock_station, handle); - if (dd) { - dd->handler = handler; - dd->context = context; - dock_add_hotplug_device(dock_station, dd); - return 0; - } - - return -EINVAL; -} - -EXPORT_SYMBOL_GPL(register_hotplug_dock_device); - -/** - * unregister_hotplug_dock_device - remove yourself from the hotplug list - * @handle: the acpi handle of the device - */ -void unregister_hotplug_dock_device(acpi_handle handle) -{ - struct dock_dependent_device *dd; - - if (!dock_station) - return; - - dd = find_dock_dependent_device(dock_station, handle); - if (dd) - dock_del_hotplug_device(dock_station, dd); -} - -EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device); - -/** - * dock_notify - act upon an acpi dock notification - * @handle: the dock station handle - * @event: the acpi event - * @data: our driver data struct - * - * If we are notified to dock, then check to see if the dock is - * present and then dock. Notify all drivers of the dock event, - * and then hotplug and devices that may need hotplugging. For undock - * check to make sure the dock device is still present, then undock - * and hotremove all the devices that may need removing. - */ -static void dock_notify(acpi_handle handle, u32 event, void *data) -{ - struct dock_station *ds = (struct dock_station *)data; - - switch (event) { - case ACPI_NOTIFY_BUS_CHECK: - if (!dock_in_progress(ds) && dock_present(ds)) { - begin_dock(ds); - dock(ds); - if (!dock_present(ds)) { - printk(KERN_ERR PREFIX "Unable to dock!\n"); - break; - } - atomic_notifier_call_chain(&dock_notifier_list, - event, NULL); - hotplug_dock_devices(ds, event); - complete_dock(ds); - dock_event(ds, event, DOCK_EVENT); - } - break; - case ACPI_NOTIFY_DEVICE_CHECK: - /* - * According to acpi spec 3.0a, if a DEVICE_CHECK notification - * is sent and _DCK is present, it is assumed to mean an - * undock request. This notify routine will only be called - * for objects defining _DCK, so we will fall through to eject - * request here. However, we will pass an eject request through - * to the driver who wish to hotplug. - */ - case ACPI_NOTIFY_EJECT_REQUEST: - if (!dock_in_progress(ds) && dock_present(ds)) { - /* - * here we need to generate the undock - * event prior to actually doing the undock - * so that the device struct still exists. - */ - dock_event(ds, event, UNDOCK_EVENT); - hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST); - undock(ds); - eject_dock(ds); - if (dock_present(ds)) - printk(KERN_ERR PREFIX "Unable to undock!\n"); - } - break; - default: - printk(KERN_ERR PREFIX "Unknown dock event %d\n", event); - } -} - -/** - * find_dock_devices - find devices on the dock station - * @handle: the handle of the device we are examining - * @lvl: unused - * @context: the dock station private data - * @rv: unused - * - * This function is called by acpi_walk_namespace. It will - * check to see if an object has an _EJD method. If it does, then it - * will see if it is dependent on the dock station. - */ -static acpi_status -find_dock_devices(acpi_handle handle, u32 lvl, void *context, void **rv) -{ - acpi_status status; - acpi_handle tmp; - struct dock_station *ds = (struct dock_station *)context; - struct dock_dependent_device *dd; - - status = acpi_bus_get_ejd(handle, &tmp); - if (ACPI_FAILURE(status)) - return AE_OK; - - if (tmp == ds->handle) { - dd = alloc_dock_dependent_device(handle); - if (dd) - add_dock_dependent_device(ds, dd); - } - - return AE_OK; -} - -/** - * dock_add - add a new dock station - * @handle: the dock station handle - * - * allocated and initialize a new dock station device. Find all devices - * that are on the dock station, and register for dock event notifications. - */ -static int dock_add(acpi_handle handle) -{ - int ret; - acpi_status status; - struct dock_dependent_device *dd; - - /* allocate & initialize the dock_station private data */ - dock_station = kzalloc(sizeof(*dock_station), GFP_KERNEL); - if (!dock_station) - return -ENOMEM; - dock_station->handle = handle; - dock_station->last_dock_time = jiffies - HZ; - INIT_LIST_HEAD(&dock_station->dependent_devices); - INIT_LIST_HEAD(&dock_station->hotplug_devices); - spin_lock_init(&dock_station->dd_lock); - spin_lock_init(&dock_station->hp_lock); - - /* Find dependent devices */ - acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, find_dock_devices, dock_station, - NULL); - - /* add the dock station as a device dependent on itself */ - dd = alloc_dock_dependent_device(handle); - if (!dd) { - kfree(dock_station); - return -ENOMEM; - } - add_dock_dependent_device(dock_station, dd); - - /* register for dock events */ - status = acpi_install_notify_handler(dock_station->handle, - ACPI_SYSTEM_NOTIFY, - dock_notify, dock_station); - - if (ACPI_FAILURE(status)) { - printk(KERN_ERR PREFIX "Error installing notify handler\n"); - ret = -ENODEV; - goto dock_add_err; - } - - printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_NAME); - - return 0; - -dock_add_err: - kfree(dock_station); - kfree(dd); - return ret; -} - -/** - * dock_remove - free up resources related to the dock station - */ -static int dock_remove(void) -{ - struct dock_dependent_device *dd, *tmp; - acpi_status status; - - if (!dock_station) - return 0; - - /* remove dependent devices */ - list_for_each_entry_safe(dd, tmp, &dock_station->dependent_devices, - list) - kfree(dd); - - /* remove dock notify handler */ - status = acpi_remove_notify_handler(dock_station->handle, - ACPI_SYSTEM_NOTIFY, - dock_notify); - if (ACPI_FAILURE(status)) - printk(KERN_ERR "Error removing notify handler\n"); - - /* free dock station memory */ - kfree(dock_station); - return 0; -} - -/** - * find_dock - look for a dock station - * @handle: acpi handle of a device - * @lvl: unused - * @context: counter of dock stations found - * @rv: unused - * - * This is called by acpi_walk_namespace to look for dock stations. - */ -static acpi_status -find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) -{ - int *count = (int *)context; - acpi_status status = AE_OK; - - if (is_dock(handle)) { - if (dock_add(handle) >= 0) { - (*count)++; - status = AE_CTRL_TERMINATE; - } - } - return status; -} - -static int __init dock_init(void) -{ - int num = 0; - - dock_station = NULL; - - /* look for a dock station */ - acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, find_dock, &num, NULL); - - if (!num) - return -ENODEV; - - return 0; -} - -static void __exit dock_exit(void) -{ - dock_remove(); -} - -postcore_initcall(dock_init); -module_exit(dock_exit); diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index 8c5d7df7d343..18b3ea9dace2 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -207,15 +207,16 @@ static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_ec_wait"); ec->intr.expect_event = event; smp_mb(); switch (event) { case ACPI_EC_EVENT_IBE: - if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) { + if (~acpi_ec_read_status(ec) & event) { ec->intr.expect_event = 0; - return 0; + return_VALUE(0); } break; default: @@ -237,16 +238,16 @@ static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event) switch (event) { case ACPI_EC_EVENT_OBF: if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_OBF) - return 0; + return_VALUE(0); break; case ACPI_EC_EVENT_IBE: if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) - return 0; + return_VALUE(0); break; } - return -ETIME; + return_VALUE(-ETIME); } #ifdef ACPI_FUTURE_USAGE @@ -259,6 +260,7 @@ int acpi_ec_enter_burst_mode(union acpi_ec *ec) u32 tmp = 0; int status = 0; + ACPI_FUNCTION_TRACE("acpi_ec_enter_burst_mode"); status = acpi_ec_read_status(ec); if (status != -EINVAL && !(status & ACPI_EC_FLAG_BURST)) { @@ -270,21 +272,22 @@ int acpi_ec_enter_burst_mode(union acpi_ec *ec) status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr); if (tmp != 0x90) { /* Burst ACK byte */ - return -EINVAL; + return_VALUE(-EINVAL); } } atomic_set(&ec->intr.leaving_burst, 0); - return 0; + return_VALUE(0); end: - ACPI_EXCEPTION ((AE_INFO, status, "EC wait, burst mode"); - return -1; + printk(KERN_WARNING PREFIX "Error in acpi_ec_wait\n"); + return_VALUE(-1); } int acpi_ec_leave_burst_mode(union acpi_ec *ec) { int status = 0; + ACPI_FUNCTION_TRACE("acpi_ec_leave_burst_mode"); status = acpi_ec_read_status(ec); if (status != -EINVAL && (status & ACPI_EC_FLAG_BURST)){ @@ -295,10 +298,10 @@ int acpi_ec_leave_burst_mode(union acpi_ec *ec) acpi_ec_wait(ec, ACPI_EC_FLAG_IBF); } atomic_set(&ec->intr.leaving_burst, 1); - return 0; + return_VALUE(0); end: - ACPI_EXCEPTION((AE_INFO, status, "EC leave burst mode"); - return -1; + printk(KERN_WARNING PREFIX "leave burst_mode:error\n"); + return_VALUE(-1); } #endif /* ACPI_FUTURE_USAGE */ @@ -322,16 +325,17 @@ static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data) int result = 0; u32 glk = 0; + ACPI_FUNCTION_TRACE("acpi_ec_read"); if (!ec || !data) - return -EINVAL; + return_VALUE(-EINVAL); *data = 0; if (ec->common.global_lock) { status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); } if (down_interruptible(&ec->poll.sem)) { @@ -361,7 +365,7 @@ static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data) if (ec->common.global_lock) acpi_release_global_lock(glk); - return result; + return_VALUE(result); } static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data) @@ -370,14 +374,15 @@ static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data) acpi_status status = AE_OK; u32 glk = 0; + ACPI_FUNCTION_TRACE("acpi_ec_write"); if (!ec) - return -EINVAL; + return_VALUE(-EINVAL); if (ec->common.global_lock) { status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); } if (down_interruptible(&ec->poll.sem)) { @@ -410,7 +415,7 @@ static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data) if (ec->common.global_lock) acpi_release_global_lock(glk); - return result; + return_VALUE(result); } static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data) @@ -418,16 +423,17 @@ static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data) int status = 0; u32 glk; + ACPI_FUNCTION_TRACE("acpi_ec_read"); if (!ec || !data) - return -EINVAL; + return_VALUE(-EINVAL); *data = 0; if (ec->common.global_lock) { status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); } WARN_ON(in_interrupt()); @@ -461,7 +467,7 @@ static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data) if (ec->common.global_lock) acpi_release_global_lock(glk); - return status; + return_VALUE(status); } static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data) @@ -469,14 +475,15 @@ static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data) int status = 0; u32 glk; + ACPI_FUNCTION_TRACE("acpi_ec_write"); if (!ec) - return -EINVAL; + return_VALUE(-EINVAL); if (ec->common.global_lock) { status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); } WARN_ON(in_interrupt()); @@ -509,7 +516,7 @@ static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data) if (ec->common.global_lock) acpi_release_global_lock(glk); - return status; + return_VALUE(status); } /* @@ -567,16 +574,17 @@ static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data) acpi_status status = AE_OK; u32 glk = 0; + ACPI_FUNCTION_TRACE("acpi_ec_query"); if (!ec || !data) - return -EINVAL; + return_VALUE(-EINVAL); *data = 0; if (ec->common.global_lock) { status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); } /* @@ -605,22 +613,23 @@ static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data) if (ec->common.global_lock) acpi_release_global_lock(glk); - return result; + return_VALUE(result); } static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data) { int status = 0; u32 glk; + ACPI_FUNCTION_TRACE("acpi_ec_query"); if (!ec || !data) - return -EINVAL; + return_VALUE(-EINVAL); *data = 0; if (ec->common.global_lock) { status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); } down(&ec->intr.sem); @@ -653,7 +662,7 @@ static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data) if (ec->common.global_lock) acpi_release_global_lock(glk); - return status; + return_VALUE(status); } /* -------------------------------------------------------------------------- @@ -682,12 +691,13 @@ static void acpi_ec_gpe_poll_query(void *ec_cxt) '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + ACPI_FUNCTION_TRACE("acpi_ec_gpe_query"); if (!ec_cxt) goto end; if (down_interruptible (&ec->poll.sem)) { - return; + return_VOID; } acpi_hw_low_level_read(8, &value, &ec->common.command_addr); up(&ec->poll.sem); @@ -724,6 +734,7 @@ static void acpi_ec_gpe_intr_query(void *ec_cxt) '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + ACPI_FUNCTION_TRACE("acpi_ec_gpe_query"); if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI) result = acpi_ec_query(ec, &value); @@ -782,15 +793,12 @@ static u32 acpi_ec_gpe_intr_handler(void *data) case ACPI_EC_EVENT_OBF: if (!(value & ACPI_EC_FLAG_OBF)) break; - ec->intr.expect_event = 0; - wake_up(&ec->intr.wait); - break; case ACPI_EC_EVENT_IBE: if ((value & ACPI_EC_FLAG_IBF)) break; ec->intr.expect_event = 0; wake_up(&ec->intr.wait); - break; + return ACPI_INTERRUPT_HANDLED; default: break; } @@ -838,14 +846,15 @@ acpi_ec_space_handler(u32 function, acpi_integer f_v = 0; int i = 0; + ACPI_FUNCTION_TRACE("acpi_ec_space_handler"); if ((address > 0xFF) || !value || !handler_context) - return AE_BAD_PARAMETER; + return_VALUE(AE_BAD_PARAMETER); if (bit_width != 8 && acpi_strict) { printk(KERN_WARNING PREFIX "acpi_ec_space_handler: bit_width should be 8\n"); - return AE_BAD_PARAMETER; + return_VALUE(AE_BAD_PARAMETER); } ec = (union acpi_ec *)handler_context; @@ -884,16 +893,16 @@ acpi_ec_space_handler(u32 function, out: switch (result) { case -EINVAL: - return AE_BAD_PARAMETER; + return_VALUE(AE_BAD_PARAMETER); break; case -ENODEV: - return AE_NOT_FOUND; + return_VALUE(AE_NOT_FOUND); break; case -ETIME: - return AE_TIME; + return_VALUE(AE_TIME); break; default: - return AE_OK; + return_VALUE(AE_OK); } } @@ -907,6 +916,7 @@ static int acpi_ec_read_info(struct seq_file *seq, void *offset) { union acpi_ec *ec = (union acpi_ec *)seq->private; + ACPI_FUNCTION_TRACE("acpi_ec_read_info"); if (!ec) goto end; @@ -921,7 +931,7 @@ static int acpi_ec_read_info(struct seq_file *seq, void *offset) acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); end: - return 0; + return_VALUE(0); } static int acpi_ec_info_open_fs(struct inode *inode, struct file *file) @@ -941,29 +951,33 @@ static int acpi_ec_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; + ACPI_FUNCTION_TRACE("acpi_ec_add_fs"); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_ec_dir); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); } entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Unable to create '%s' fs entry\n", + ACPI_EC_FILE_INFO)); else { entry->proc_fops = &acpi_ec_info_ops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } - return 0; + return_VALUE(0); } static int acpi_ec_remove_fs(struct acpi_device *device) { + ACPI_FUNCTION_TRACE("acpi_ec_remove_fs"); if (acpi_device_dir(device)) { remove_proc_entry(ACPI_EC_FILE_INFO, acpi_device_dir(device)); @@ -971,7 +985,7 @@ static int acpi_ec_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -984,13 +998,14 @@ static int acpi_ec_poll_add(struct acpi_device *device) acpi_status status = AE_OK; union acpi_ec *ec = NULL; + ACPI_FUNCTION_TRACE("acpi_ec_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL); if (!ec) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(ec, 0, sizeof(union acpi_ec)); ec->common.handle = device->handle; @@ -1023,7 +1038,8 @@ static int acpi_ec_poll_add(struct acpi_device *device) acpi_evaluate_integer(ec->common.handle, "_GPE", NULL, &ec->common.gpe_bit); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Obtaining GPE bit")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error obtaining GPE bit assignment\n")); result = -ENODEV; goto end; } @@ -1043,7 +1059,7 @@ static int acpi_ec_poll_add(struct acpi_device *device) if (result) kfree(ec); - return result; + return_VALUE(result); } static int acpi_ec_intr_add(struct acpi_device *device) { @@ -1051,13 +1067,14 @@ static int acpi_ec_intr_add(struct acpi_device *device) acpi_status status = AE_OK; union acpi_ec *ec = NULL; + ACPI_FUNCTION_TRACE("acpi_ec_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL); if (!ec) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(ec, 0, sizeof(union acpi_ec)); ec->common.handle = device->handle; @@ -1093,7 +1110,8 @@ static int acpi_ec_intr_add(struct acpi_device *device) acpi_evaluate_integer(ec->common.handle, "_GPE", NULL, &ec->common.gpe_bit); if (ACPI_FAILURE(status)) { - printk(KERN_ERR PREFIX "Obtaining GPE bit assignment\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error obtaining GPE bit assignment\n")); result = -ENODEV; goto end; } @@ -1113,16 +1131,17 @@ static int acpi_ec_intr_add(struct acpi_device *device) if (result) kfree(ec); - return result; + return_VALUE(result); } static int acpi_ec_remove(struct acpi_device *device, int type) { union acpi_ec *ec = NULL; + ACPI_FUNCTION_TRACE("acpi_ec_remove"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); ec = acpi_driver_data(device); @@ -1130,7 +1149,7 @@ static int acpi_ec_remove(struct acpi_device *device, int type) kfree(ec); - return 0; + return_VALUE(0); } static acpi_status @@ -1169,14 +1188,15 @@ static int acpi_ec_start(struct acpi_device *device) acpi_status status = AE_OK; union acpi_ec *ec = NULL; + ACPI_FUNCTION_TRACE("acpi_ec_start"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); ec = acpi_driver_data(device); if (!ec) - return -EINVAL; + return_VALUE(-EINVAL); /* * Get I/O port addresses. Convert to GAS format. @@ -1185,8 +1205,9 @@ static int acpi_ec_start(struct acpi_device *device) acpi_ec_io_ports, ec); if (ACPI_FAILURE(status) || ec->common.command_addr.register_bit_width == 0) { - printk(KERN_ERR PREFIX "Error getting I/O port addresses\n"); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error getting I/O port addresses")); + return_VALUE(-ENODEV); } ec->common.status_addr = ec->common.command_addr; @@ -1203,7 +1224,7 @@ static int acpi_ec_start(struct acpi_device *device) ACPI_GPE_EDGE_TRIGGERED, &acpi_ec_gpe_handler, ec); if (ACPI_FAILURE(status)) { - return -ENODEV; + return_VALUE(-ENODEV); } acpi_set_gpe_type(NULL, ec->common.gpe_bit, ACPI_GPE_TYPE_RUNTIME); acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); @@ -1215,10 +1236,10 @@ static int acpi_ec_start(struct acpi_device *device) if (ACPI_FAILURE(status)) { acpi_remove_gpe_handler(NULL, ec->common.gpe_bit, &acpi_ec_gpe_handler); - return -ENODEV; + return_VALUE(-ENODEV); } - return AE_OK; + return_VALUE(AE_OK); } static int acpi_ec_stop(struct acpi_device *device, int type) @@ -1226,9 +1247,10 @@ static int acpi_ec_stop(struct acpi_device *device, int type) acpi_status status = AE_OK; union acpi_ec *ec = NULL; + ACPI_FUNCTION_TRACE("acpi_ec_stop"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); ec = acpi_driver_data(device); @@ -1236,15 +1258,15 @@ static int acpi_ec_stop(struct acpi_device *device, int type) ACPI_ADR_SPACE_EC, &acpi_ec_space_handler); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); status = acpi_remove_gpe_handler(NULL, ec->common.gpe_bit, &acpi_ec_gpe_handler); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); - return 0; + return_VALUE(0); } static acpi_status __init @@ -1514,22 +1536,23 @@ static int __init acpi_ec_init(void) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_ec_init"); if (acpi_disabled) - return 0; + return_VALUE(0); acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir); if (!acpi_ec_dir) - return -ENODEV; + return_VALUE(-ENODEV); /* Now register the driver for the EC */ result = acpi_bus_register_driver(&acpi_ec_driver); if (result < 0) { remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir); - return -ENODEV; + return_VALUE(-ENODEV); } - return result; + return_VALUE(result); } subsys_initcall(acpi_ec_init); @@ -1538,12 +1561,13 @@ subsys_initcall(acpi_ec_init); #if 0 static void __exit acpi_ec_exit(void) { + ACPI_FUNCTION_TRACE("acpi_ec_exit"); acpi_bus_unregister_driver(&acpi_ec_driver); remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir); - return; + return_VOID; } #endif /* 0 */ diff --git a/trunk/drivers/acpi/event.c b/trunk/drivers/acpi/event.c index a901b23e95e7..2dbb1b0f11d5 100644 --- a/trunk/drivers/acpi/event.c +++ b/trunk/drivers/acpi/event.c @@ -48,17 +48,18 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count, static int chars_remaining = 0; static char *ptr; + ACPI_FUNCTION_TRACE("acpi_system_read_event"); if (!chars_remaining) { memset(&event, 0, sizeof(struct acpi_bus_event)); if ((file->f_flags & O_NONBLOCK) && (list_empty(&acpi_bus_event_list))) - return -EAGAIN; + return_VALUE(-EAGAIN); result = acpi_bus_receive_event(&event); if (result) - return result; + return_VALUE(result); chars_remaining = sprintf(str, "%s %s %08x %08x\n", event.device_class ? event. @@ -74,13 +75,13 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count, } if (copy_to_user(buffer, ptr, count)) - return -EFAULT; + return_VALUE(-EFAULT); *ppos += count; chars_remaining -= count; ptr += count; - return count; + return_VALUE(count); } static int acpi_system_close_event(struct inode *inode, struct file *file) @@ -111,18 +112,22 @@ static int __init acpi_event_init(void) struct proc_dir_entry *entry; int error = 0; + ACPI_FUNCTION_TRACE("acpi_event_init"); if (acpi_disabled) - return 0; + return_VALUE(0); /* 'event' [R] */ entry = create_proc_entry("event", S_IRUSR, acpi_root_dir); if (entry) entry->proc_fops = &acpi_system_event_ops; else { - error = -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' proc fs entry\n", + "event")); + error = -EFAULT; } - return error; + return_VALUE(error); } subsys_initcall(acpi_event_init); diff --git a/trunk/drivers/acpi/events/evgpe.c b/trunk/drivers/acpi/events/evgpe.c index c76c0583ca6a..f01d339407f8 100644 --- a/trunk/drivers/acpi/events/evgpe.c +++ b/trunk/drivers/acpi/events/evgpe.c @@ -382,6 +382,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) u32 status_reg; u32 enable_reg; acpi_cpu_flags flags; + acpi_cpu_flags hw_flags; acpi_native_uint i; acpi_native_uint j; @@ -393,11 +394,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) return (int_status); } - /* - * We need to obtain the GPE lock for both the data structs and registers - * Note: Not necessary to obtain the hardware lock, since the GPE registers - * are owned by the gpe_lock. - */ + /* We need to hold the GPE lock now, hardware lock in the loop */ + flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); /* Examine all GPE blocks attached to this interrupt level */ @@ -415,6 +413,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) gpe_register_info = &gpe_block->register_info[i]; + hw_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); + /* Read the Status Register */ status = @@ -423,6 +423,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) &gpe_register_info-> status_address); if (ACPI_FAILURE(status)) { + acpi_os_release_lock(acpi_gbl_hardware_lock, + hw_flags); goto unlock_and_exit; } @@ -433,6 +435,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) &enable_reg, &gpe_register_info-> enable_address); + acpi_os_release_lock(acpi_gbl_hardware_lock, hw_flags); + if (ACPI_FAILURE(status)) { goto unlock_and_exit; } diff --git a/trunk/drivers/acpi/events/evxface.c b/trunk/drivers/acpi/events/evxface.c index 4f948df17ab9..76c34a66e0e0 100644 --- a/trunk/drivers/acpi/events/evxface.c +++ b/trunk/drivers/acpi/events/evxface.c @@ -414,13 +414,12 @@ acpi_remove_notify_handler(acpi_handle device, if ((!device) || (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { - status = AE_BAD_PARAMETER; - goto exit; + return_ACPI_STATUS(AE_BAD_PARAMETER); } status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { - goto exit; + return_ACPI_STATUS(status); } /* Convert and validate the device handle */ @@ -428,7 +427,7 @@ acpi_remove_notify_handler(acpi_handle device, node = acpi_ns_map_handle_to_node(device); if (!node) { status = AE_BAD_PARAMETER; - goto unlock; + goto unlock_and_exit; } /* Root Object */ @@ -442,7 +441,7 @@ acpi_remove_notify_handler(acpi_handle device, ((handler_type & ACPI_DEVICE_NOTIFY) && !acpi_gbl_device_notify.handler)) { status = AE_NOT_EXIST; - goto unlock; + goto unlock_and_exit; } /* Make sure all deferred tasks are completed */ @@ -451,7 +450,7 @@ acpi_remove_notify_handler(acpi_handle device, acpi_os_wait_events_complete(NULL); status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { - goto exit; + return_ACPI_STATUS(status); } if (handler_type & ACPI_SYSTEM_NOTIFY) { @@ -474,7 +473,7 @@ acpi_remove_notify_handler(acpi_handle device, if (!acpi_ev_is_notify_object(node)) { status = AE_TYPE; - goto unlock; + goto unlock_and_exit; } /* Check for an existing internal object */ @@ -482,7 +481,7 @@ acpi_remove_notify_handler(acpi_handle device, obj_desc = acpi_ns_get_attached_object(node); if (!obj_desc) { status = AE_NOT_EXIST; - goto unlock; + goto unlock_and_exit; } /* Object exists - make sure there's an existing handler */ @@ -492,7 +491,7 @@ acpi_remove_notify_handler(acpi_handle device, if ((!notify_obj) || (notify_obj->notify.handler != handler)) { status = AE_BAD_PARAMETER; - goto unlock; + goto unlock_and_exit; } /* Make sure all deferred tasks are completed */ @@ -500,7 +499,7 @@ acpi_remove_notify_handler(acpi_handle device, acpi_os_wait_events_complete(NULL); status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { - goto exit; + return_ACPI_STATUS(status); } /* Remove the handler */ @@ -513,7 +512,7 @@ acpi_remove_notify_handler(acpi_handle device, if ((!notify_obj) || (notify_obj->notify.handler != handler)) { status = AE_BAD_PARAMETER; - goto unlock; + goto unlock_and_exit; } /* Make sure all deferred tasks are completed */ @@ -521,7 +520,7 @@ acpi_remove_notify_handler(acpi_handle device, acpi_os_wait_events_complete(NULL); status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { - goto exit; + return_ACPI_STATUS(status); } /* Remove the handler */ @@ -530,11 +529,8 @@ acpi_remove_notify_handler(acpi_handle device, } } -unlock: + unlock_and_exit: (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); -exit: - if (ACPI_FAILURE(status)) - ACPI_EXCEPTION((AE_INFO, status, "Removing notify handler")); return_ACPI_STATUS(status); } @@ -572,13 +568,12 @@ acpi_install_gpe_handler(acpi_handle gpe_device, /* Parameter validation */ if ((!address) || (type > ACPI_GPE_XRUPT_TYPE_MASK)) { - status = AE_BAD_PARAMETER; - goto exit; + return_ACPI_STATUS(AE_BAD_PARAMETER); } status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); if (ACPI_FAILURE(status)) { - goto exit; + return_ACPI_STATUS(status); } /* Ensure that we have a valid GPE number */ @@ -586,7 +581,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); if (!gpe_event_info) { status = AE_BAD_PARAMETER; - goto unlock; + goto unlock_and_exit; } /* Make sure that there isn't a handler there already */ @@ -594,7 +589,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) { status = AE_ALREADY_EXISTS; - goto unlock; + goto unlock_and_exit; } /* Allocate and init handler object */ @@ -602,7 +597,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_handler_info)); if (!handler) { status = AE_NO_MEMORY; - goto unlock; + goto unlock_and_exit; } handler->address = address; @@ -613,7 +608,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, status = acpi_ev_disable_gpe(gpe_event_info); if (ACPI_FAILURE(status)) { - goto unlock; + goto unlock_and_exit; } /* Install the handler */ @@ -628,12 +623,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device, acpi_os_release_lock(acpi_gbl_gpe_lock, flags); -unlock: + unlock_and_exit: (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); -exit: - if (ACPI_FAILURE(status)) - ACPI_EXCEPTION((AE_INFO, status, - "Installing notify handler failed")); return_ACPI_STATUS(status); } diff --git a/trunk/drivers/acpi/executer/exconfig.c b/trunk/drivers/acpi/executer/exconfig.c index 83fed079a276..823352435e08 100644 --- a/trunk/drivers/acpi/executer/exconfig.c +++ b/trunk/drivers/acpi/executer/exconfig.c @@ -266,10 +266,6 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, } } - ACPI_INFO((AE_INFO, - "Dynamic OEM Table Load - [%4.4s] OemId [%6.6s] OemTableId [%8.8s]", - table->signature, table->oem_id, table->oem_table_id)); - *return_desc = ddb_handle; return_ACPI_STATUS(status); } @@ -450,10 +446,6 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, return_ACPI_STATUS(status); } - ACPI_INFO((AE_INFO, - "Dynamic SSDT Load - OemId [%6.6s] OemTableId [%8.8s]", - table_ptr->oem_id, table_ptr->oem_table_id)); - cleanup: if (ACPI_FAILURE(status)) { ACPI_FREE(table_ptr); diff --git a/trunk/drivers/acpi/executer/excreate.c b/trunk/drivers/acpi/executer/excreate.c index 34eec82c1b1e..106dc7219df7 100644 --- a/trunk/drivers/acpi/executer/excreate.c +++ b/trunk/drivers/acpi/executer/excreate.c @@ -177,7 +177,7 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state) * that the event is created in an unsignalled state */ status = acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, - &obj_desc->event.os_semaphore); + &obj_desc->event.semaphore); if (ACPI_FAILURE(status)) { goto cleanup; } @@ -226,9 +226,12 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state) goto cleanup; } - /* Create the actual OS Mutex */ - - status = acpi_os_create_mutex(&obj_desc->mutex.os_mutex); + /* + * Create the actual OS semaphore. + * One unit max to make it a mutex, with one initial unit to allow + * the mutex to be acquired. + */ + status = acpi_os_create_semaphore(1, 1, &obj_desc->mutex.semaphore); if (ACPI_FAILURE(status)) { goto cleanup; } @@ -562,7 +565,7 @@ acpi_ex_create_method(u8 * aml_start, obj_desc->method.aml_length = aml_length; /* - * Disassemble the method flags. Split off the Arg Count + * Disassemble the method flags. Split off the Arg Count * for efficiency */ method_flags = (u8) operand[1]->integer.value; @@ -573,19 +576,21 @@ acpi_ex_create_method(u8 * aml_start, (u8) (method_flags & AML_METHOD_ARG_COUNT); /* - * Get the sync_level. If method is serialized, a mutex will be + * Get the concurrency count. If required, a semaphore will be * created for this method when it is parsed. */ if (acpi_gbl_all_methods_serialized) { - obj_desc->method.sync_level = 0; + obj_desc->method.concurrency = 1; obj_desc->method.method_flags |= AML_METHOD_SERIALIZED; } else if (method_flags & AML_METHOD_SERIALIZED) { /* - * ACPI 1.0: sync_level = 0 - * ACPI 2.0: sync_level = sync_level in method declaration + * ACPI 1.0: Concurrency = 1 + * ACPI 2.0: Concurrency = (sync_level (in method declaration) + 1) */ - obj_desc->method.sync_level = (u8) - ((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4); + obj_desc->method.concurrency = (u8) + (((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4) + 1); + } else { + obj_desc->method.concurrency = ACPI_INFINITE_CONCURRENCY; } /* Attach the new object to the method Node */ diff --git a/trunk/drivers/acpi/executer/exdump.c b/trunk/drivers/acpi/executer/exdump.c index 2450943add33..7b9718e976bf 100644 --- a/trunk/drivers/acpi/executer/exdump.c +++ b/trunk/drivers/acpi/executer/exdump.c @@ -118,14 +118,14 @@ static struct acpi_exdump_info acpi_ex_dump_device[4] = { static struct acpi_exdump_info acpi_ex_dump_event[2] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.os_semaphore), "OsSemaphore"} + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.semaphore), "Semaphore"} }; static struct acpi_exdump_info acpi_ex_dump_method[8] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "ParamCount"}, - {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.mutex), "Mutex"}, + {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.concurrency), "Concurrency"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.semaphore), "Semaphore"}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"}, @@ -138,7 +138,7 @@ static struct acpi_exdump_info acpi_ex_dump_mutex[5] = { {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"}, {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth), "Acquire Depth"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"} + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.semaphore), "Semaphore"} }; static struct acpi_exdump_info acpi_ex_dump_region[7] = { diff --git a/trunk/drivers/acpi/executer/exfldio.c b/trunk/drivers/acpi/executer/exfldio.c index 40f0bee6faa5..051053f7cccb 100644 --- a/trunk/drivers/acpi/executer/exfldio.c +++ b/trunk/drivers/acpi/executer/exfldio.c @@ -727,23 +727,11 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, return_ACPI_STATUS(status); } - /* - * Merge with previous datum if necessary. - * - * Note: Before the shift, check if the shift value will be larger than - * the integer size. If so, there is no need to perform the operation. - * This avoids the differences in behavior between different compilers - * concerning shift values larger than the target data width. - */ - if ((obj_desc->common_field.access_bit_width - - obj_desc->common_field.start_field_bit_offset) < - ACPI_INTEGER_BIT_SIZE) { - merged_datum |= - raw_datum << (obj_desc->common_field. - access_bit_width - - obj_desc->common_field. - start_field_bit_offset); - } + /* Merge with previous datum if necessary */ + + merged_datum |= raw_datum << + (obj_desc->common_field.access_bit_width - + obj_desc->common_field.start_field_bit_offset); if (i == datum_count) { break; @@ -820,24 +808,14 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, return_ACPI_STATUS(AE_BUFFER_OVERFLOW); } - /* - * Create the bitmasks used for bit insertion. - * Note: This if/else is used to bypass compiler differences with the - * shift operator - */ - if (obj_desc->common_field.access_bit_width == ACPI_INTEGER_BIT_SIZE) { - width_mask = ACPI_INTEGER_MAX; - } else { - width_mask = - ACPI_MASK_BITS_ABOVE(obj_desc->common_field. - access_bit_width); - } - - mask = width_mask & - ACPI_MASK_BITS_BELOW(obj_desc->common_field.start_field_bit_offset); - /* Compute the number of datums (access width data items) */ + width_mask = + ACPI_MASK_BITS_ABOVE(obj_desc->common_field.access_bit_width); + mask = + width_mask & ACPI_MASK_BITS_BELOW(obj_desc->common_field. + start_field_bit_offset); + datum_count = ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length, obj_desc->common_field.access_bit_width); @@ -870,29 +848,12 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, return_ACPI_STATUS(status); } - field_offset += obj_desc->common_field.access_byte_width; - - /* - * Start new output datum by merging with previous input datum - * if necessary. - * - * Note: Before the shift, check if the shift value will be larger than - * the integer size. If so, there is no need to perform the operation. - * This avoids the differences in behavior between different compilers - * concerning shift values larger than the target data width. - */ - if ((obj_desc->common_field.access_bit_width - - obj_desc->common_field.start_field_bit_offset) < - ACPI_INTEGER_BIT_SIZE) { - merged_datum = - raw_datum >> (obj_desc->common_field. - access_bit_width - - obj_desc->common_field. - start_field_bit_offset); - } else { - merged_datum = 0; - } + /* Start new output datum by merging with previous input datum */ + field_offset += obj_desc->common_field.access_byte_width; + merged_datum = raw_datum >> + (obj_desc->common_field.access_bit_width - + obj_desc->common_field.start_field_bit_offset); mask = width_mask; if (i == datum_count) { diff --git a/trunk/drivers/acpi/executer/exmutex.c b/trunk/drivers/acpi/executer/exmutex.c index d8ac2877cf05..93098d68cadf 100644 --- a/trunk/drivers/acpi/executer/exmutex.c +++ b/trunk/drivers/acpi/executer/exmutex.c @@ -161,13 +161,12 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, /* * Current Sync must be less than or equal to the sync level of the - * mutex. This mechanism provides some deadlock prevention + * mutex. This mechanism provides some deadlock prevention */ if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { ACPI_ERROR((AE_INFO, - "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%d)", - acpi_ut_get_node_name(obj_desc->mutex.node), - walk_state->thread->current_sync_level)); + "Cannot acquire Mutex [%4.4s], incorrect SyncLevel", + acpi_ut_get_node_name(obj_desc->mutex.node))); return_ACPI_STATUS(AE_AML_MUTEX_ORDER); } @@ -179,7 +178,8 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, if ((obj_desc->mutex.owner_thread->thread_id == walk_state->thread->thread_id) || - (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK)) { + (obj_desc->mutex.semaphore == + acpi_gbl_global_lock_semaphore)) { /* * The mutex is already owned by this thread, * just increment the acquisition depth @@ -264,7 +264,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, */ if ((obj_desc->mutex.owner_thread->thread_id != walk_state->thread->thread_id) - && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) { + && (obj_desc->mutex.semaphore != acpi_gbl_global_lock_semaphore)) { ACPI_ERROR((AE_INFO, "Thread %X cannot release Mutex [%4.4s] acquired by thread %X", walk_state->thread->thread_id, diff --git a/trunk/drivers/acpi/executer/exsystem.c b/trunk/drivers/acpi/executer/exsystem.c index 6b5d1e6ce94b..52beee3674a0 100644 --- a/trunk/drivers/acpi/executer/exsystem.c +++ b/trunk/drivers/acpi/executer/exsystem.c @@ -63,14 +63,14 @@ ACPI_MODULE_NAME("exsystem") * interpreter is released. * ******************************************************************************/ -acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) +acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout) { acpi_status status; acpi_status status2; ACPI_FUNCTION_TRACE(ex_system_wait_semaphore); - status = acpi_os_wait_semaphore(semaphore, 1, ACPI_DO_NOT_WAIT); + status = acpi_os_wait_semaphore(semaphore, 1, 0); if (ACPI_SUCCESS(status)) { return_ACPI_STATUS(status); } @@ -101,59 +101,6 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) return_ACPI_STATUS(status); } -/******************************************************************************* - * - * FUNCTION: acpi_ex_system_wait_mutex - * - * PARAMETERS: Mutex - Mutex to wait on - * Timeout - Max time to wait - * - * RETURN: Status - * - * DESCRIPTION: Implements a semaphore wait with a check to see if the - * semaphore is available immediately. If it is not, the - * interpreter is released. - * - ******************************************************************************/ - -acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) -{ - acpi_status status; - acpi_status status2; - - ACPI_FUNCTION_TRACE(ex_system_wait_mutex); - - status = acpi_os_acquire_mutex(mutex, ACPI_DO_NOT_WAIT); - if (ACPI_SUCCESS(status)) { - return_ACPI_STATUS(status); - } - - if (status == AE_TIME) { - - /* We must wait, so unlock the interpreter */ - - acpi_ex_exit_interpreter(); - - status = acpi_os_acquire_mutex(mutex, timeout); - - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, - "*** Thread awake after blocking, %s\n", - acpi_format_exception(status))); - - /* Reacquire the interpreter */ - - status2 = acpi_ex_enter_interpreter(); - if (ACPI_FAILURE(status2)) { - - /* Report fatal error, could not acquire interpreter */ - - return_ACPI_STATUS(status2); - } - } - - return_ACPI_STATUS(status); -} - /******************************************************************************* * * FUNCTION: acpi_ex_system_do_stall @@ -229,7 +176,7 @@ acpi_status acpi_ex_system_do_suspend(acpi_integer how_long) * * FUNCTION: acpi_ex_system_acquire_mutex * - * PARAMETERS: time_desc - Maximum time to wait for the mutex + * PARAMETERS: time_desc - The 'time to delay' object descriptor * obj_desc - The object descriptor for this op * * RETURN: Status @@ -254,14 +201,14 @@ acpi_ex_system_acquire_mutex(union acpi_operand_object * time_desc, /* Support for the _GL_ Mutex object -- go get the global lock */ - if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) { + if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) { status = acpi_ev_acquire_global_lock((u16) time_desc->integer.value); return_ACPI_STATUS(status); } - status = acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex, - (u16) time_desc->integer.value); + status = acpi_ex_system_wait_semaphore(obj_desc->mutex.semaphore, + (u16) time_desc->integer.value); return_ACPI_STATUS(status); } @@ -292,13 +239,13 @@ acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc) /* Support for the _GL_ Mutex object -- release the global lock */ - if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) { + if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) { status = acpi_ev_release_global_lock(); return_ACPI_STATUS(status); } - acpi_os_release_mutex(obj_desc->mutex.os_mutex); - return_ACPI_STATUS(AE_OK); + status = acpi_os_signal_semaphore(obj_desc->mutex.semaphore, 1); + return_ACPI_STATUS(status); } /******************************************************************************* @@ -321,8 +268,7 @@ acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc) ACPI_FUNCTION_TRACE(ex_system_signal_event); if (obj_desc) { - status = - acpi_os_signal_semaphore(obj_desc->event.os_semaphore, 1); + status = acpi_os_signal_semaphore(obj_desc->event.semaphore, 1); } return_ACPI_STATUS(status); @@ -353,7 +299,7 @@ acpi_ex_system_wait_event(union acpi_operand_object *time_desc, if (obj_desc) { status = - acpi_ex_system_wait_semaphore(obj_desc->event.os_semaphore, + acpi_ex_system_wait_semaphore(obj_desc->event.semaphore, (u16) time_desc->integer. value); } @@ -376,7 +322,7 @@ acpi_ex_system_wait_event(union acpi_operand_object *time_desc, acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc) { acpi_status status = AE_OK; - acpi_semaphore temp_semaphore; + void *temp_semaphore; ACPI_FUNCTION_ENTRY(); @@ -387,8 +333,8 @@ acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc) status = acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, &temp_semaphore); if (ACPI_SUCCESS(status)) { - (void)acpi_os_delete_semaphore(obj_desc->event.os_semaphore); - obj_desc->event.os_semaphore = temp_semaphore; + (void)acpi_os_delete_semaphore(obj_desc->event.semaphore); + obj_desc->event.semaphore = temp_semaphore; } return (status); diff --git a/trunk/drivers/acpi/fan.c b/trunk/drivers/acpi/fan.c index daed2460924d..1cd25784b7a4 100644 --- a/trunk/drivers/acpi/fan.c +++ b/trunk/drivers/acpi/fan.c @@ -64,7 +64,7 @@ static struct acpi_driver acpi_fan_driver = { }; struct acpi_fan { - struct acpi_device * device; + acpi_handle handle; }; /* -------------------------------------------------------------------------- @@ -78,15 +78,16 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset) struct acpi_fan *fan = seq->private; int state = 0; + ACPI_FUNCTION_TRACE("acpi_fan_read_state"); if (fan) { - if (acpi_bus_get_power(fan->device->handle, &state)) + if (acpi_bus_get_power(fan->handle, &state)) seq_printf(seq, "status: ERROR\n"); else seq_printf(seq, "status: %s\n", !state ? "on" : "off"); } - return 0; + return_VALUE(0); } static int acpi_fan_state_open_fs(struct inode *inode, struct file *file) @@ -103,21 +104,22 @@ acpi_fan_write_state(struct file *file, const char __user * buffer, struct acpi_fan *fan = (struct acpi_fan *)m->private; char state_string[12] = { '\0' }; + ACPI_FUNCTION_TRACE("acpi_fan_write_state"); if (!fan || (count > sizeof(state_string) - 1)) - return -EINVAL; + return_VALUE(-EINVAL); if (copy_from_user(state_string, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); state_string[count] = '\0'; - result = acpi_bus_set_power(fan->device->handle, + result = acpi_bus_set_power(fan->handle, simple_strtoul(state_string, NULL, 0)); if (result) - return result; + return_VALUE(result); - return count; + return_VALUE(count); } static struct file_operations acpi_fan_state_ops = { @@ -133,15 +135,16 @@ static int acpi_fan_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; + ACPI_FUNCTION_TRACE("acpi_fan_add_fs"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_fan_dir); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); acpi_device_dir(device)->owner = THIS_MODULE; } @@ -150,18 +153,21 @@ static int acpi_fan_add_fs(struct acpi_device *device) S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_FAN_FILE_STATE)); else { entry->proc_fops = &acpi_fan_state_ops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } - return 0; + return_VALUE(0); } static int acpi_fan_remove_fs(struct acpi_device *device) { + ACPI_FUNCTION_TRACE("acpi_fan_remove_fs"); if (acpi_device_dir(device)) { remove_proc_entry(ACPI_FAN_FILE_STATE, acpi_device_dir(device)); @@ -169,7 +175,7 @@ static int acpi_fan_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -182,23 +188,25 @@ static int acpi_fan_add(struct acpi_device *device) struct acpi_fan *fan = NULL; int state = 0; + ACPI_FUNCTION_TRACE("acpi_fan_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); fan = kmalloc(sizeof(struct acpi_fan), GFP_KERNEL); if (!fan) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(fan, 0, sizeof(struct acpi_fan)); - fan->device = device; + fan->handle = device->handle; strcpy(acpi_device_name(device), "Fan"); strcpy(acpi_device_class(device), ACPI_FAN_CLASS); acpi_driver_data(device) = fan; - result = acpi_bus_get_power(device->handle, &state); + result = acpi_bus_get_power(fan->handle, &state); if (result) { - printk(KERN_ERR PREFIX "Reading power state\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error reading power state\n")); goto end; } @@ -218,16 +226,17 @@ static int acpi_fan_add(struct acpi_device *device) if (result) kfree(fan); - return result; + return_VALUE(result); } static int acpi_fan_remove(struct acpi_device *device, int type) { struct acpi_fan *fan = NULL; + ACPI_FUNCTION_TRACE("acpi_fan_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); fan = (struct acpi_fan *)acpi_driver_data(device); @@ -235,7 +244,7 @@ static int acpi_fan_remove(struct acpi_device *device, int type) kfree(fan); - return 0; + return_VALUE(0); } static int acpi_fan_suspend(struct acpi_device *device, int state) @@ -274,29 +283,31 @@ static int __init acpi_fan_init(void) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_fan_init"); acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir); if (!acpi_fan_dir) - return -ENODEV; + return_VALUE(-ENODEV); acpi_fan_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_fan_driver); if (result < 0) { remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); - return -ENODEV; + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } static void __exit acpi_fan_exit(void) { + ACPI_FUNCTION_TRACE("acpi_fan_exit"); acpi_bus_unregister_driver(&acpi_fan_driver); remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); - return; + return_VOID; } module_init(acpi_fan_init); diff --git a/trunk/drivers/acpi/glue.c b/trunk/drivers/acpi/glue.c index 10f160dc75b1..8daef57b994c 100644 --- a/trunk/drivers/acpi/glue.c +++ b/trunk/drivers/acpi/glue.c @@ -152,7 +152,7 @@ static int get_root_bridge_busnr(acpi_handle handle) bbn = bus; } exit: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); return (int)bbn; } @@ -192,7 +192,7 @@ find_pci_rootbridge(acpi_handle handle, u32 lvl, void *context, void **rv) find->handle = handle; status = AE_OK; exit: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); return status; } @@ -224,7 +224,7 @@ do_acpi_find_child(acpi_handle handle, u32 lvl, void *context, void **rv) info = buffer.pointer; if (info->address == find->address) find->handle = handle; - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); } return AE_OK; } @@ -330,7 +330,7 @@ static int acpi_platform_notify(struct device *dev) acpi_get_name(dev->firmware_data, ACPI_FULL_PATHNAME, &buffer); DBG("Device %s -> %s\n", dev->bus_id, (char *)buffer.pointer); - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); } else DBG("Device %s -> No ACPI support\n", dev->bus_id); #endif diff --git a/trunk/drivers/acpi/hardware/hwregs.c b/trunk/drivers/acpi/hardware/hwregs.c index 3143f36fcec9..ae142de19507 100644 --- a/trunk/drivers/acpi/hardware/hwregs.c +++ b/trunk/drivers/acpi/hardware/hwregs.c @@ -172,9 +172,9 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) } /* - * The package must have at least two elements. NOTE (March 2005): This + * The package must have at least two elements. NOTE (March 2005): This * goes against the current ACPI spec which defines this object as a - * package with one encoded DWORD element. However, existing practice + * package with one encoded DWORD element. However, existing practice * by BIOS vendors seems to be to have 2 or more elements, at least * one per sleep type (A/B). */ @@ -255,7 +255,7 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) * return_value - Value that was read from the register * Flags - Lock the hardware or not * - * RETURN: Status and the value read from specified Register. Value + * RETURN: Status and the value read from specified Register. Value * returned is normalized to bit0 (is shifted all the way right) * * DESCRIPTION: ACPI bit_register read function. @@ -361,8 +361,8 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) case ACPI_REGISTER_PM1_STATUS: /* - * Status Registers are different from the rest. Clear by - * writing 1, and writing 0 has no effect. So, the only relevant + * Status Registers are different from the rest. Clear by + * writing 1, and writing 0 has no effect. So, the only relevant * information is the single bit we're interested in, all others should * be written as 0 so they will be left unchanged. */ @@ -467,13 +467,14 @@ ACPI_EXPORT_SYMBOL(acpi_set_register) * * FUNCTION: acpi_hw_register_read * - * PARAMETERS: use_lock - Lock hardware? True/False - * register_id - ACPI Register ID + * PARAMETERS: use_lock - Mutex hw access + * register_id - register_iD + Offset * return_value - Where the register value is returned * * RETURN: Status and the value read. * - * DESCRIPTION: Read from the specified ACPI register + * DESCRIPTION: Acpi register read function. Registers are read at the + * given offset. * ******************************************************************************/ acpi_status @@ -579,26 +580,14 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) * * FUNCTION: acpi_hw_register_write * - * PARAMETERS: use_lock - Lock hardware? True/False - * register_id - ACPI Register ID + * PARAMETERS: use_lock - Mutex hw access + * register_id - register_iD + Offset * Value - The value to write * * RETURN: Status * - * DESCRIPTION: Write to the specified ACPI register - * - * NOTE: In accordance with the ACPI specification, this function automatically - * preserves the value of the following bits, meaning that these bits cannot be - * changed via this interface: - * - * PM1_CONTROL[0] = SCI_EN - * PM1_CONTROL[9] - * PM1_STATUS[11] - * - * ACPI References: - * 1) Hardware Ignored Bits: When software writes to a register with ignored - * bit fields, it preserves the ignored bit fields - * 2) SCI_EN: OSPM always preserves this bit position + * DESCRIPTION: Acpi register Write function. Registers are written at the + * given offset. * ******************************************************************************/ @@ -606,7 +595,6 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) { acpi_status status; acpi_cpu_flags lock_flags = 0; - u32 read_value; ACPI_FUNCTION_TRACE(hw_register_write); @@ -617,22 +605,6 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) switch (register_id) { case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ - /* Perform a read first to preserve certain bits (per ACPI spec) */ - - status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_STATUS, - &read_value); - if (ACPI_FAILURE(status)) { - goto unlock_and_exit; - } - - /* Insert the bits to be preserved */ - - ACPI_INSERT_BITS(value, ACPI_PM1_STATUS_PRESERVED_BITS, - read_value); - - /* Now we can write the data */ - status = acpi_hw_low_level_write(16, value, &acpi_gbl_FADT->xpm1a_evt_blk); @@ -663,25 +635,6 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */ - /* - * Perform a read first to preserve certain bits (per ACPI spec) - * - * Note: This includes SCI_EN, we never want to change this bit - */ - status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_CONTROL, - &read_value); - if (ACPI_FAILURE(status)) { - goto unlock_and_exit; - } - - /* Insert the bits to be preserved */ - - ACPI_INSERT_BITS(value, ACPI_PM1_CONTROL_PRESERVED_BITS, - read_value); - - /* Now we can write the data */ - status = acpi_hw_low_level_write(16, value, &acpi_gbl_FADT->xpm1a_cnt_blk); @@ -773,7 +726,7 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg) return (AE_OK); } - /* Get a local copy of the address. Handles possible alignment issues */ + /* Get a local copy of the address. Handles possible alignment issues */ ACPI_MOVE_64_TO_64(&address, ®->address); if (!address) { @@ -845,7 +798,7 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg) return (AE_OK); } - /* Get a local copy of the address. Handles possible alignment issues */ + /* Get a local copy of the address. Handles possible alignment issues */ ACPI_MOVE_64_TO_64(&address, ®->address); if (!address) { diff --git a/trunk/drivers/acpi/hotkey.c b/trunk/drivers/acpi/hotkey.c index fd81a0f5222f..c25b2b92edcf 100644 --- a/trunk/drivers/acpi/hotkey.c +++ b/trunk/drivers/acpi/hotkey.c @@ -231,10 +231,11 @@ struct list_head hotkey_entries; /* head of the list of hotkey_list */ static int hotkey_info_seq_show(struct seq_file *seq, void *offset) { + ACPI_FUNCTION_TRACE("hotkey_info_seq_show"); seq_printf(seq, "Hotkey generic driver ver: %s\n", HOTKEY_ACPI_VERSION); - return 0; + return_VALUE(0); } static int hotkey_info_open_fs(struct inode *inode, struct file *file) @@ -265,6 +266,7 @@ static int hotkey_polling_seq_show(struct seq_file *seq, void *offset) (struct acpi_polling_hotkey *)seq->private; char *buf; + ACPI_FUNCTION_TRACE("hotkey_polling_seq_show"); if (poll_hotkey->poll_result) { buf = format_result(poll_hotkey->poll_result); @@ -272,7 +274,7 @@ static int hotkey_polling_seq_show(struct seq_file *seq, void *offset) seq_printf(seq, "%s", buf); kfree(buf); } - return 0; + return_VALUE(0); } static int hotkey_polling_open_fs(struct inode *inode, struct file *file) @@ -291,6 +293,7 @@ static int hotkey_get_internal_event(int event, struct acpi_hotkey_list *list) struct list_head *entries; int val = -1; + ACPI_FUNCTION_TRACE("hotkey_get_internal_event"); list_for_each(entries, list->entries) { union acpi_hotkey *key = @@ -302,7 +305,7 @@ static int hotkey_get_internal_event(int event, struct acpi_hotkey_list *list) } } - return val; + return_VALUE(val); } static void @@ -311,14 +314,15 @@ acpi_hotkey_notify_handler(acpi_handle handle, u32 event, void *data) struct acpi_device *device = NULL; u32 internal_event; + ACPI_FUNCTION_TRACE("acpi_hotkey_notify_handler"); if (acpi_bus_get_device(handle, &device)) - return; + return_VOID; internal_event = hotkey_get_internal_event(event, &global_hotkey_list); acpi_bus_generate_event(device, internal_event, 0); - return; + return_VOID; } /* Need to invent automatically hotkey add method */ @@ -342,6 +346,7 @@ static int create_polling_proc(union acpi_hotkey *device) char proc_name[80]; mode_t mode; + ACPI_FUNCTION_TRACE("create_polling_proc"); mode = S_IFREG | S_IRUGO | S_IWUGO; sprintf(proc_name, "%d", device->link.hotkey_standard_num); @@ -351,7 +356,10 @@ static int create_polling_proc(union acpi_hotkey *device) proc = create_proc_entry(proc_name, mode, hotkey_proc_dir); if (!proc) { - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Hotkey: Unable to create %s entry\n", + device->poll_hotkey.poll_method)); + return_VALUE(-ENODEV); } else { proc->proc_fops = &hotkey_polling_fops; proc->owner = THIS_MODULE; @@ -360,7 +368,7 @@ static int create_polling_proc(union acpi_hotkey *device) proc->gid = 0; device->poll_hotkey.proc = proc; } - return 0; + return_VALUE(0); } static int hotkey_add(union acpi_hotkey *device) @@ -368,6 +376,7 @@ static int hotkey_add(union acpi_hotkey *device) int status = 0; struct acpi_device *dev = NULL; + ACPI_FUNCTION_TRACE("hotkey_add"); if (device->link.hotkey_type == ACPI_HOTKEY_EVENT) { acpi_bus_get_device(device->event_hotkey.bus_handle, &dev); @@ -382,13 +391,14 @@ static int hotkey_add(union acpi_hotkey *device) list_add_tail(&device->link.entries, global_hotkey_list.entries); - return status; + return_VALUE(status); } static int hotkey_remove(union acpi_hotkey *device) { struct list_head *entries, *next; + ACPI_FUNCTION_TRACE("hotkey_remove"); list_for_each_safe(entries, next, global_hotkey_list.entries) { union acpi_hotkey *key = @@ -402,13 +412,14 @@ static int hotkey_remove(union acpi_hotkey *device) } } kfree(device); - return 0; + return_VALUE(0); } static int hotkey_update(union acpi_hotkey *key) { struct list_head *entries; + ACPI_FUNCTION_TRACE("hotkey_update"); list_for_each(entries, global_hotkey_list.entries) { union acpi_hotkey *tmp = @@ -450,18 +461,19 @@ static int hotkey_update(union acpi_hotkey *key) */ kfree(key); } - return 0; + return_VALUE(0); break; } } - return -ENODEV; + return_VALUE(-ENODEV); } static void free_hotkey_device(union acpi_hotkey *key) { struct acpi_device *dev; + ACPI_FUNCTION_TRACE("free_hotkey_device"); if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) { acpi_bus_get_device(key->event_hotkey.bus_handle, &dev); @@ -481,7 +493,7 @@ static void free_hotkey_device(union acpi_hotkey *key) free_poll_hotkey_buffer(key); } kfree(key); - return; + return_VOID; } static void free_hotkey_buffer(union acpi_hotkey *key) @@ -502,6 +514,7 @@ init_hotkey_device(union acpi_hotkey *key, char *bus_str, char *action_str, acpi_handle tmp_handle; acpi_status status = AE_OK; + ACPI_FUNCTION_TRACE("init_hotkey_device"); if (std_num < 0 || IS_POLL(std_num) || !key) goto do_fail; @@ -528,9 +541,9 @@ init_hotkey_device(union acpi_hotkey *key, char *bus_str, char *action_str, method, &tmp_handle); if (ACPI_FAILURE(status)) goto do_fail; - return AE_OK; + return_VALUE(AE_OK); do_fail: - return -ENODEV; + return_VALUE(-ENODEV); } static int @@ -542,6 +555,7 @@ init_poll_hotkey_device(union acpi_hotkey *key, acpi_status status = AE_OK; acpi_handle tmp_handle; + ACPI_FUNCTION_TRACE("init_poll_hotkey_device"); if (std_num < 0 || IS_EVENT(std_num) || !key) goto do_fail; @@ -576,20 +590,22 @@ init_poll_hotkey_device(union acpi_hotkey *key, (union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL); if (!key->poll_hotkey.poll_result) goto do_fail; - return AE_OK; + return_VALUE(AE_OK); do_fail: - return -ENODEV; + return_VALUE(-ENODEV); } static int hotkey_open_config(struct inode *inode, struct file *file) { - return (single_open + ACPI_FUNCTION_TRACE("hotkey_open_config"); + return_VALUE(single_open (file, hotkey_config_seq_show, PDE(inode)->data)); } static int hotkey_poll_open_config(struct inode *inode, struct file *file) { - return (single_open + ACPI_FUNCTION_TRACE("hotkey_poll_open_config"); + return_VALUE(single_open (file, hotkey_poll_config_seq_show, PDE(inode)->data)); } @@ -602,6 +618,7 @@ static int hotkey_config_seq_show(struct seq_file *seq, void *offset) struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name }; struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name }; + ACPI_FUNCTION_TRACE(("hotkey_config_seq_show")); list_for_each(entries, hotkey_list->entries) { union acpi_hotkey *key = @@ -619,7 +636,7 @@ static int hotkey_config_seq_show(struct seq_file *seq, void *offset) } } seq_puts(seq, "\n"); - return 0; + return_VALUE(0); } static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset) @@ -631,6 +648,7 @@ static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset) struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name }; struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name }; + ACPI_FUNCTION_TRACE(("hotkey_config_seq_show")); list_for_each(entries, hotkey_list->entries) { union acpi_hotkey *key = @@ -648,7 +666,7 @@ static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset) } } seq_puts(seq, "\n"); - return 0; + return_VALUE(0); } static int @@ -660,6 +678,7 @@ get_parms(char *config_record, char **method, int *internal_event_num, int *external_event_num) { char *tmp, *tmp1, count; + ACPI_FUNCTION_TRACE(("get_parms")); sscanf(config_record, "%d", cmd); @@ -725,9 +744,9 @@ get_parms(char *config_record, 0) goto do_fail; - return 6; + return_VALUE(6); do_fail: - return -1; + return_VALUE(-1); } /* count is length for one input record */ @@ -744,15 +763,16 @@ static ssize_t hotkey_write_config(struct file *file, int ret = 0; union acpi_hotkey *key = NULL; + ACPI_FUNCTION_TRACE(("hotkey_write_config")); config_record = (char *)kmalloc(count + 1, GFP_KERNEL); if (!config_record) - return -ENOMEM; + return_VALUE(-ENOMEM); if (copy_from_user(config_record, buffer, count)) { kfree(config_record); - printk(KERN_ERR PREFIX "Invalid data\n"); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data \n")); + return_VALUE(-EINVAL); } config_record[count] = 0; @@ -772,8 +792,9 @@ static ssize_t hotkey_write_config(struct file *file, kfree(bus_method); kfree(action_handle); kfree(method); - printk(KERN_ERR PREFIX "Invalid data format ret=%d\n", ret); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid data format ret=%d\n", ret)); + return_VALUE(-EINVAL); } key = kmalloc(sizeof(union acpi_hotkey), GFP_KERNEL); @@ -785,7 +806,7 @@ static ssize_t hotkey_write_config(struct file *file, tmp = get_hotkey_by_event(&global_hotkey_list, internal_event_num); if (!tmp) - printk(KERN_ERR PREFIX "Invalid key\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid key")); else memcpy(key, tmp, sizeof(union acpi_hotkey)); goto cont_cmd; @@ -807,8 +828,8 @@ static ssize_t hotkey_write_config(struct file *file, else free_poll_hotkey_buffer(key); kfree(key); - printk(KERN_ERR PREFIX "Invalid hotkey\n"); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid hotkey \n")); + return_VALUE(-EINVAL); } cont_cmd: @@ -834,15 +855,15 @@ static ssize_t hotkey_write_config(struct file *file, goto fail_out; break; } - return count; + return_VALUE(count); fail_out: if (IS_EVENT(internal_event_num)) free_hotkey_buffer(key); else free_poll_hotkey_buffer(key); kfree(key); - printk(KERN_ERR PREFIX "invalid key\n"); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid key\n")); + return_VALUE(-EINVAL); } /* @@ -859,6 +880,7 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val, union acpi_object in_obj; /* the only param we use */ acpi_status status; + ACPI_FUNCTION_TRACE("write_acpi_int"); params.count = 1; params.pointer = &in_obj; in_obj.type = ACPI_TYPE_INTEGER; @@ -866,7 +888,7 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val, status = acpi_evaluate_object(handle, (char *)method, ¶ms, output); - return (status == AE_OK); + return_VALUE(status == AE_OK); } static int read_acpi_int(acpi_handle handle, const char *method, @@ -876,6 +898,7 @@ static int read_acpi_int(acpi_handle handle, const char *method, union acpi_object out_obj; acpi_status status; + ACPI_FUNCTION_TRACE("read_acpi_int"); output.length = sizeof(out_obj); output.pointer = &out_obj; @@ -884,8 +907,8 @@ static int read_acpi_int(acpi_handle handle, const char *method, val->integer.value = out_obj.integer.value; val->type = out_obj.type; } else - printk(KERN_ERR PREFIX "null val pointer\n"); - return ((status == AE_OK) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "null val pointer")); + return_VALUE((status == AE_OK) && (out_obj.type == ACPI_TYPE_INTEGER)); } @@ -922,23 +945,24 @@ static ssize_t hotkey_execute_aml_method(struct file *file, int event, method_type, type, value; union acpi_hotkey *key; + ACPI_FUNCTION_TRACE("hotkey_execte_aml_method"); arg = (char *)kmalloc(count + 1, GFP_KERNEL); if (!arg) - return -ENOMEM; + return_VALUE(-ENOMEM); arg[count] = 0; if (copy_from_user(arg, buffer, count)) { kfree(arg); - printk(KERN_ERR PREFIX "Invalid argument 2\n"); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 2")); + return_VALUE(-EINVAL); } if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) != 4) { kfree(arg); - printk(KERN_ERR PREFIX "Invalid argument 3\n"); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 3")); + return_VALUE(-EINVAL); } kfree(arg); if (type == ACPI_TYPE_INTEGER) { @@ -963,12 +987,12 @@ static ssize_t hotkey_execute_aml_method(struct file *file, } } else { - printk(KERN_WARNING "Not supported\n"); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Not supported")); + return_VALUE(-EINVAL); } - return count; + return_VALUE(count); do_fail: - return -EINVAL; + return_VALUE(-EINVAL); } @@ -977,6 +1001,7 @@ static int __init hotkey_init(void) int result; mode_t mode = S_IFREG | S_IRUGO | S_IWUGO; + ACPI_FUNCTION_TRACE("hotkey_init"); if (acpi_disabled) return -ENODEV; @@ -988,6 +1013,9 @@ static int __init hotkey_init(void) hotkey_proc_dir = proc_mkdir(HOTKEY_PROC, acpi_root_dir); if (!hotkey_proc_dir) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Hotkey: Unable to create %s entry\n", + HOTKEY_PROC)); return (-ENODEV); } hotkey_proc_dir->owner = THIS_MODULE; @@ -995,6 +1023,9 @@ static int __init hotkey_init(void) hotkey_config = create_proc_entry(HOTKEY_EV_CONFIG, mode, hotkey_proc_dir); if (!hotkey_config) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Hotkey: Unable to create %s entry\n", + HOTKEY_EV_CONFIG)); goto do_fail1; } else { hotkey_config->proc_fops = &hotkey_config_fops; @@ -1007,6 +1038,10 @@ static int __init hotkey_init(void) hotkey_poll_config = create_proc_entry(HOTKEY_PL_CONFIG, mode, hotkey_proc_dir); if (!hotkey_poll_config) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Hotkey: Unable to create %s entry\n", + HOTKEY_EV_CONFIG)); + goto do_fail2; } else { hotkey_poll_config->proc_fops = &hotkey_poll_config_fops; @@ -1018,6 +1053,9 @@ static int __init hotkey_init(void) hotkey_action = create_proc_entry(HOTKEY_ACTION, mode, hotkey_proc_dir); if (!hotkey_action) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Hotkey: Unable to create %s entry\n", + HOTKEY_ACTION)); goto do_fail3; } else { hotkey_action->proc_fops = &hotkey_action_fops; @@ -1028,6 +1066,9 @@ static int __init hotkey_init(void) hotkey_info = create_proc_entry(HOTKEY_INFO, mode, hotkey_proc_dir); if (!hotkey_info) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Hotkey: Unable to create %s entry\n", + HOTKEY_INFO)); goto do_fail4; } else { hotkey_info->proc_fops = &hotkey_info_fops; @@ -1063,6 +1104,7 @@ static void __exit hotkey_exit(void) { struct list_head *entries, *next; + ACPI_FUNCTION_TRACE("hotkey_exit"); list_for_each_safe(entries, next, global_hotkey_list.entries) { union acpi_hotkey *key = diff --git a/trunk/drivers/acpi/i2c_ec.c b/trunk/drivers/acpi/i2c_ec.c deleted file mode 100644 index 84239d51dc0c..000000000000 --- a/trunk/drivers/acpi/i2c_ec.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - * SMBus driver for ACPI Embedded Controller ($Revision: 1.3 $) - * - * Copyright (c) 2002, 2005 Ducrot Bruno - * Copyright (c) 2005 Rich Townsend (tiny hacks & tweaks) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "i2c_ec.h" - -#define xudelay(t) udelay(t) -#define xmsleep(t) msleep(t) - -#define ACPI_EC_HC_COMPONENT 0x00080000 -#define ACPI_EC_HC_CLASS "ec_hc_smbus" -#define ACPI_EC_HC_HID "ACPI0001" -#define ACPI_EC_HC_DRIVER_NAME "ACPI EC HC smbus driver" -#define ACPI_EC_HC_DEVICE_NAME "EC HC smbus" - -#define _COMPONENT ACPI_EC_HC_COMPONENT - -ACPI_MODULE_NAME("acpi_smbus") - -static int acpi_ec_hc_add(struct acpi_device *device); -static int acpi_ec_hc_remove(struct acpi_device *device, int type); - -static struct acpi_driver acpi_ec_hc_driver = { - .name = ACPI_EC_HC_DRIVER_NAME, - .class = ACPI_EC_HC_CLASS, - .ids = ACPI_EC_HC_HID, - .ops = { - .add = acpi_ec_hc_add, - .remove = acpi_ec_hc_remove, - }, -}; - -/* Various bit mask for EC_SC (R) */ -#define OBF 0x01 -#define IBF 0x02 -#define CMD 0x08 -#define BURST 0x10 -#define SCI_EVT 0x20 -#define SMI_EVT 0x40 - -/* Commands for EC_SC (W) */ -#define RD_EC 0x80 -#define WR_EC 0x81 -#define BE_EC 0x82 -#define BD_EC 0x83 -#define QR_EC 0x84 - -/* - * ACPI 2.0 chapter 13 SMBus 2.0 EC register model - */ - -#define ACPI_EC_SMB_PRTCL 0x00 /* protocol, PEC */ -#define ACPI_EC_SMB_STS 0x01 /* status */ -#define ACPI_EC_SMB_ADDR 0x02 /* address */ -#define ACPI_EC_SMB_CMD 0x03 /* command */ -#define ACPI_EC_SMB_DATA 0x04 /* 32 data registers */ -#define ACPI_EC_SMB_BCNT 0x24 /* number of data bytes */ -#define ACPI_EC_SMB_ALRM_A 0x25 /* alarm address */ -#define ACPI_EC_SMB_ALRM_D 0x26 /* 2 bytes alarm data */ - -#define ACPI_EC_SMB_STS_DONE 0x80 -#define ACPI_EC_SMB_STS_ALRM 0x40 -#define ACPI_EC_SMB_STS_RES 0x20 -#define ACPI_EC_SMB_STS_STATUS 0x1f - -#define ACPI_EC_SMB_STATUS_OK 0x00 -#define ACPI_EC_SMB_STATUS_FAIL 0x07 -#define ACPI_EC_SMB_STATUS_DNAK 0x10 -#define ACPI_EC_SMB_STATUS_DERR 0x11 -#define ACPI_EC_SMB_STATUS_CMD_DENY 0x12 -#define ACPI_EC_SMB_STATUS_UNKNOWN 0x13 -#define ACPI_EC_SMB_STATUS_ACC_DENY 0x17 -#define ACPI_EC_SMB_STATUS_TIMEOUT 0x18 -#define ACPI_EC_SMB_STATUS_NOTSUP 0x19 -#define ACPI_EC_SMB_STATUS_BUSY 0x1A -#define ACPI_EC_SMB_STATUS_PEC 0x1F - -#define ACPI_EC_SMB_PRTCL_WRITE 0x00 -#define ACPI_EC_SMB_PRTCL_READ 0x01 -#define ACPI_EC_SMB_PRTCL_QUICK 0x02 -#define ACPI_EC_SMB_PRTCL_BYTE 0x04 -#define ACPI_EC_SMB_PRTCL_BYTE_DATA 0x06 -#define ACPI_EC_SMB_PRTCL_WORD_DATA 0x08 -#define ACPI_EC_SMB_PRTCL_BLOCK_DATA 0x0a -#define ACPI_EC_SMB_PRTCL_PROC_CALL 0x0c -#define ACPI_EC_SMB_PRTCL_BLOCK_PROC_CALL 0x0d -#define ACPI_EC_SMB_PRTCL_I2C_BLOCK_DATA 0x4a -#define ACPI_EC_SMB_PRTCL_PEC 0x80 - -/* Length of pre/post transaction sleep (msec) */ -#define ACPI_EC_SMB_TRANSACTION_SLEEP 1 -#define ACPI_EC_SMB_ACCESS_SLEEP1 1 -#define ACPI_EC_SMB_ACCESS_SLEEP2 10 - -static int acpi_ec_smb_read(struct acpi_ec_smbus *smbus, u8 address, u8 * data) -{ - u8 val; - int err; - - err = ec_read(smbus->base + address, &val); - if (!err) { - *data = val; - } - xmsleep(ACPI_EC_SMB_TRANSACTION_SLEEP); - return (err); -} - -static int acpi_ec_smb_write(struct acpi_ec_smbus *smbus, u8 address, u8 data) -{ - int err; - - err = ec_write(smbus->base + address, data); - return (err); -} - -static int -acpi_ec_smb_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, - char read_write, u8 command, int size, - union i2c_smbus_data *data) -{ - struct acpi_ec_smbus *smbus = adap->algo_data; - unsigned char protocol, len = 0, pec, temp[2] = { 0, 0 }; - int i; - - if (read_write == I2C_SMBUS_READ) { - protocol = ACPI_EC_SMB_PRTCL_READ; - } else { - protocol = ACPI_EC_SMB_PRTCL_WRITE; - } - pec = (flags & I2C_CLIENT_PEC) ? ACPI_EC_SMB_PRTCL_PEC : 0; - - switch (size) { - - case I2C_SMBUS_QUICK: - protocol |= ACPI_EC_SMB_PRTCL_QUICK; - read_write = I2C_SMBUS_WRITE; - break; - - case I2C_SMBUS_BYTE: - if (read_write == I2C_SMBUS_WRITE) { - acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA, data->byte); - } - protocol |= ACPI_EC_SMB_PRTCL_BYTE; - break; - - case I2C_SMBUS_BYTE_DATA: - acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command); - if (read_write == I2C_SMBUS_WRITE) { - acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA, data->byte); - } - protocol |= ACPI_EC_SMB_PRTCL_BYTE_DATA; - break; - - case I2C_SMBUS_WORD_DATA: - acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command); - if (read_write == I2C_SMBUS_WRITE) { - acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA, data->word); - acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + 1, - data->word >> 8); - } - protocol |= ACPI_EC_SMB_PRTCL_WORD_DATA | pec; - break; - - case I2C_SMBUS_BLOCK_DATA: - acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command); - if (read_write == I2C_SMBUS_WRITE) { - len = min_t(u8, data->block[0], 32); - acpi_ec_smb_write(smbus, ACPI_EC_SMB_BCNT, len); - for (i = 0; i < len; i++) - acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + i, - data->block[i + 1]); - } - protocol |= ACPI_EC_SMB_PRTCL_BLOCK_DATA | pec; - break; - - case I2C_SMBUS_I2C_BLOCK_DATA: - len = min_t(u8, data->block[0], 32); - acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command); - acpi_ec_smb_write(smbus, ACPI_EC_SMB_BCNT, len); - if (read_write == I2C_SMBUS_WRITE) { - for (i = 0; i < len; i++) { - acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + i, - data->block[i + 1]); - } - } - protocol |= ACPI_EC_SMB_PRTCL_I2C_BLOCK_DATA; - break; - - case I2C_SMBUS_PROC_CALL: - acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command); - acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA, data->word); - acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + 1, data->word >> 8); - protocol = ACPI_EC_SMB_PRTCL_PROC_CALL | pec; - read_write = I2C_SMBUS_READ; - break; - - case I2C_SMBUS_BLOCK_PROC_CALL: - protocol |= pec; - len = min_t(u8, data->block[0], 31); - acpi_ec_smb_write(smbus, ACPI_EC_SMB_CMD, command); - acpi_ec_smb_write(smbus, ACPI_EC_SMB_BCNT, len); - for (i = 0; i < len; i++) - acpi_ec_smb_write(smbus, ACPI_EC_SMB_DATA + i, - data->block[i + 1]); - protocol = ACPI_EC_SMB_PRTCL_BLOCK_PROC_CALL | pec; - read_write = I2C_SMBUS_READ; - break; - - default: - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "EC SMBus adapter: " - "Unsupported transaction %d\n", size)); - return (-1); - } - - acpi_ec_smb_write(smbus, ACPI_EC_SMB_ADDR, addr << 1); - acpi_ec_smb_write(smbus, ACPI_EC_SMB_PRTCL, protocol); - - acpi_ec_smb_read(smbus, ACPI_EC_SMB_STS, temp + 0); - - if (~temp[0] & ACPI_EC_SMB_STS_DONE) { - xudelay(500); - acpi_ec_smb_read(smbus, ACPI_EC_SMB_STS, temp + 0); - } - if (~temp[0] & ACPI_EC_SMB_STS_DONE) { - xmsleep(ACPI_EC_SMB_ACCESS_SLEEP2); - acpi_ec_smb_read(smbus, ACPI_EC_SMB_STS, temp + 0); - } - if ((~temp[0] & ACPI_EC_SMB_STS_DONE) - || (temp[0] & ACPI_EC_SMB_STS_STATUS)) { - return (-1); - } - - if (read_write == I2C_SMBUS_WRITE) { - return (0); - } - - switch (size) { - - case I2C_SMBUS_BYTE: - case I2C_SMBUS_BYTE_DATA: - acpi_ec_smb_read(smbus, ACPI_EC_SMB_DATA, &data->byte); - break; - - case I2C_SMBUS_WORD_DATA: - case I2C_SMBUS_PROC_CALL: - acpi_ec_smb_read(smbus, ACPI_EC_SMB_DATA, temp + 0); - acpi_ec_smb_read(smbus, ACPI_EC_SMB_DATA + 1, temp + 1); - data->word = (temp[1] << 8) | temp[0]; - break; - - case I2C_SMBUS_BLOCK_DATA: - case I2C_SMBUS_BLOCK_PROC_CALL: - len = 0; - acpi_ec_smb_read(smbus, ACPI_EC_SMB_BCNT, &len); - len = min_t(u8, len, 32); - case I2C_SMBUS_I2C_BLOCK_DATA: - for (i = 0; i < len; i++) - acpi_ec_smb_read(smbus, ACPI_EC_SMB_DATA + i, - data->block + i + 1); - data->block[0] = len; - break; - } - - return (0); -} - -static u32 acpi_ec_smb_func(struct i2c_adapter *adapter) -{ - - return (I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | - I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | - I2C_FUNC_SMBUS_BLOCK_DATA | - I2C_FUNC_SMBUS_PROC_CALL | - I2C_FUNC_SMBUS_BLOCK_PROC_CALL | - I2C_FUNC_SMBUS_I2C_BLOCK | I2C_FUNC_SMBUS_HWPEC_CALC); -} - -static struct i2c_algorithm acpi_ec_smbus_algorithm = { - .smbus_xfer = acpi_ec_smb_access, - .functionality = acpi_ec_smb_func, -}; - -static int acpi_ec_hc_add(struct acpi_device *device) -{ - int status; - unsigned long val; - struct acpi_ec_hc *ec_hc; - struct acpi_ec_smbus *smbus; - - if (!device) { - return -EINVAL; - } - - ec_hc = kmalloc(sizeof(struct acpi_ec_hc), GFP_KERNEL); - if (!ec_hc) { - return -ENOMEM; - } - memset(ec_hc, 0, sizeof(struct acpi_ec_hc)); - - smbus = kmalloc(sizeof(struct acpi_ec_smbus), GFP_KERNEL); - if (!smbus) { - kfree(ec_hc); - return -ENOMEM; - } - memset(smbus, 0, sizeof(struct acpi_ec_smbus)); - - ec_hc->handle = device->handle; - strcpy(acpi_device_name(device), ACPI_EC_HC_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_EC_HC_CLASS); - acpi_driver_data(device) = ec_hc; - - status = acpi_evaluate_integer(ec_hc->handle, "_EC", NULL, &val); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error obtaining _EC\n")); - kfree(ec_hc->smbus); - kfree(smbus); - return -EIO; - } - - smbus->ec = acpi_driver_data(device->parent); - smbus->base = (val & 0xff00ull) >> 8; - smbus->alert = val & 0xffull; - - smbus->adapter.owner = THIS_MODULE; - smbus->adapter.algo = &acpi_ec_smbus_algorithm; - smbus->adapter.algo_data = smbus; - - if (i2c_add_adapter(&smbus->adapter)) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, - "EC SMBus adapter: Failed to register adapter\n")); - kfree(smbus); - kfree(ec_hc); - return -EIO; - } - - ec_hc->smbus = smbus; - - printk(KERN_INFO PREFIX "%s [%s]\n", - acpi_device_name(device), acpi_device_bid(device)); - - return AE_OK; -} - -static int acpi_ec_hc_remove(struct acpi_device *device, int type) -{ - struct acpi_ec_hc *ec_hc; - - if (!device) { - return -EINVAL; - } - ec_hc = acpi_driver_data(device); - - i2c_del_adapter(&ec_hc->smbus->adapter); - kfree(ec_hc->smbus); - kfree(ec_hc); - - return AE_OK; -} - -static int __init acpi_ec_hc_init(void) -{ - int result; - - result = acpi_bus_register_driver(&acpi_ec_hc_driver); - if (result < 0) { - return -ENODEV; - } - return 0; -} - -static void __exit acpi_ec_hc_exit(void) -{ - acpi_bus_unregister_driver(&acpi_ec_hc_driver); -} - -struct acpi_ec_hc *acpi_get_ec_hc(struct acpi_device *device) -{ - return ((struct acpi_ec_hc *)acpi_driver_data(device->parent)); -} - -EXPORT_SYMBOL(acpi_get_ec_hc); - -module_init(acpi_ec_hc_init); -module_exit(acpi_ec_hc_exit); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Ducrot Bruno"); -MODULE_DESCRIPTION("ACPI EC SMBus driver"); diff --git a/trunk/drivers/acpi/i2c_ec.h b/trunk/drivers/acpi/i2c_ec.h deleted file mode 100644 index 7c53fb732d61..000000000000 --- a/trunk/drivers/acpi/i2c_ec.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SMBus driver for ACPI Embedded Controller ($Revision: 1.2 $) - * - * Copyright (c) 2002, 2005 Ducrot Bruno - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2. - */ - -struct acpi_ec_smbus { - struct i2c_adapter adapter; - union acpi_ec *ec; - int base; - int alert; -}; - -struct acpi_ec_hc { - acpi_handle handle; - struct acpi_ec_smbus *smbus; -}; - -struct acpi_ec_hc *acpi_get_ec_hc(struct acpi_device *device); diff --git a/trunk/drivers/acpi/motherboard.c b/trunk/drivers/acpi/motherboard.c index ec6b7f9ede34..d51d68f5dd8d 100644 --- a/trunk/drivers/acpi/motherboard.c +++ b/trunk/drivers/acpi/motherboard.c @@ -52,12 +52,13 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data) { struct resource *requested_res = NULL; + ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges"); if (res->type == ACPI_RESOURCE_TYPE_IO) { struct acpi_resource_io *io_res = &res->data.io; if (io_res->minimum != io_res->maximum) - return AE_OK; + return_VALUE(AE_OK); if (IS_RESERVED_ADDR (io_res->minimum, io_res->address_length)) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, @@ -91,7 +92,7 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data) if (requested_res) requested_res->flags &= ~IORESOURCE_BUSY; - return AE_OK; + return_VALUE(AE_OK); } static int acpi_motherboard_add(struct acpi_device *device) diff --git a/trunk/drivers/acpi/namespace/nsaccess.c b/trunk/drivers/acpi/namespace/nsaccess.c index c1c6c236df9a..48fadade52e2 100644 --- a/trunk/drivers/acpi/namespace/nsaccess.c +++ b/trunk/drivers/acpi/namespace/nsaccess.c @@ -196,30 +196,33 @@ acpi_status acpi_ns_root_initialize(void) (u8) (ACPI_TO_INTEGER(val) - 1); if (ACPI_STRCMP(init_val->name, "_GL_") == 0) { - - /* Create a counting semaphore for the global lock */ - + /* + * Create a counting semaphore for the + * global lock + */ status = acpi_os_create_semaphore (ACPI_NO_UNIT_LIMIT, 1, - &acpi_gbl_global_lock_semaphore); + &obj_desc->mutex.semaphore); if (ACPI_FAILURE(status)) { acpi_ut_remove_reference (obj_desc); goto unlock_and_exit; } - /* Mark this mutex as very special */ - - obj_desc->mutex.os_mutex = - ACPI_GLOBAL_LOCK; + /* + * We just created the mutex for the + * global lock, save it + */ + acpi_gbl_global_lock_semaphore = + obj_desc->mutex.semaphore; } else { /* Create a mutex */ - status = - acpi_os_create_mutex(&obj_desc-> - mutex. - os_mutex); + status = acpi_os_create_semaphore(1, 1, + &obj_desc-> + mutex. + semaphore); if (ACPI_FAILURE(status)) { acpi_ut_remove_reference (obj_desc); diff --git a/trunk/drivers/acpi/namespace/nsxfeval.c b/trunk/drivers/acpi/namespace/nsxfeval.c index dca6799ac678..6d9bd45af30a 100644 --- a/trunk/drivers/acpi/namespace/nsxfeval.c +++ b/trunk/drivers/acpi/namespace/nsxfeval.c @@ -133,7 +133,7 @@ acpi_evaluate_object_typed(acpi_handle handle, /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ - ACPI_FREE(return_buffer->pointer); + acpi_os_free(return_buffer->pointer); return_buffer->pointer = NULL; } diff --git a/trunk/drivers/acpi/numa.c b/trunk/drivers/acpi/numa.c index e5e448edca41..13d6d5bdea26 100644 --- a/trunk/drivers/acpi/numa.c +++ b/trunk/drivers/acpi/numa.c @@ -23,6 +23,7 @@ * */ #include +#include #include #include #include @@ -259,10 +260,12 @@ int acpi_get_node(acpi_handle *handle) { int pxm, node = -1; + ACPI_FUNCTION_TRACE("acpi_get_node"); + pxm = acpi_get_pxm(handle); if (pxm >= 0) node = acpi_map_pxm_to_node(pxm); - return node; + return_VALUE(node); } EXPORT_SYMBOL(acpi_get_node); diff --git a/trunk/drivers/acpi/osl.c b/trunk/drivers/acpi/osl.c index eedb05c6dc7b..1bb558adee66 100644 --- a/trunk/drivers/acpi/osl.c +++ b/trunk/drivers/acpi/osl.c @@ -25,6 +25,7 @@ * */ +#include #include #include #include @@ -136,7 +137,6 @@ void acpi_os_vprintf(const char *fmt, va_list args) #endif } - extern int acpi_in_resume; void *acpi_os_allocate(acpi_size size) { @@ -146,6 +146,13 @@ void *acpi_os_allocate(acpi_size size) return kmalloc(size, GFP_KERNEL); } +void acpi_os_free(void *ptr) +{ + kfree(ptr); +} + +EXPORT_SYMBOL(acpi_os_free); + acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr) { if (efi_enabled) { @@ -273,7 +280,7 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, acpi_irq_handler = handler; acpi_irq_context = context; - if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) { + if (request_irq(irq, acpi_irq, SA_SHIRQ, "acpi", acpi_irq)) { printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq); return AE_NOT_ACQUIRED; } @@ -579,18 +586,19 @@ static void acpi_os_execute_deferred(void *context) { struct acpi_os_dpc *dpc = NULL; + ACPI_FUNCTION_TRACE("os_execute_deferred"); dpc = (struct acpi_os_dpc *)context; if (!dpc) { - printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); - return; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); + return_VOID; } dpc->function(dpc->context); kfree(dpc); - return; + return_VOID; } static int acpi_os_execute_thread(void *context) @@ -680,19 +688,35 @@ EXPORT_SYMBOL(acpi_os_wait_events_complete); /* * Allocate the memory for a spinlock and initialize it. */ -acpi_status acpi_os_create_lock(acpi_spinlock * handle) +acpi_status acpi_os_create_lock(acpi_handle * out_handle) { - spin_lock_init(*handle); + spinlock_t *lock_ptr; - return AE_OK; + ACPI_FUNCTION_TRACE("os_create_lock"); + + lock_ptr = acpi_os_allocate(sizeof(spinlock_t)); + + spin_lock_init(lock_ptr); + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating spinlock[%p].\n", lock_ptr)); + + *out_handle = lock_ptr; + + return_ACPI_STATUS(AE_OK); } /* * Deallocate the memory for a spinlock. */ -void acpi_os_delete_lock(acpi_spinlock handle) +void acpi_os_delete_lock(acpi_handle handle) { - return; + ACPI_FUNCTION_TRACE("os_create_lock"); + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting spinlock[%p].\n", handle)); + + acpi_os_free(handle); + + return_VOID; } acpi_status @@ -700,10 +724,11 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle) { struct semaphore *sem = NULL; + ACPI_FUNCTION_TRACE("os_create_semaphore"); sem = acpi_os_allocate(sizeof(struct semaphore)); if (!sem) - return AE_NO_MEMORY; + return_ACPI_STATUS(AE_NO_MEMORY); memset(sem, 0, sizeof(struct semaphore)); sema_init(sem, initial_units); @@ -713,7 +738,7 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle) ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating semaphore[%p|%d].\n", *handle, initial_units)); - return AE_OK; + return_ACPI_STATUS(AE_OK); } EXPORT_SYMBOL(acpi_os_create_semaphore); @@ -729,16 +754,17 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle) { struct semaphore *sem = (struct semaphore *)handle; + ACPI_FUNCTION_TRACE("os_delete_semaphore"); if (!sem) - return AE_BAD_PARAMETER; + return_ACPI_STATUS(AE_BAD_PARAMETER); ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle)); - kfree(sem); + acpi_os_free(sem); sem = NULL; - return AE_OK; + return_ACPI_STATUS(AE_OK); } EXPORT_SYMBOL(acpi_os_delete_semaphore); @@ -758,12 +784,13 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout) struct semaphore *sem = (struct semaphore *)handle; int ret = 0; + ACPI_FUNCTION_TRACE("os_wait_semaphore"); if (!sem || (units < 1)) - return AE_BAD_PARAMETER; + return_ACPI_STATUS(AE_BAD_PARAMETER); if (units > 1) - return AE_SUPPORT; + return_ACPI_STATUS(AE_SUPPORT); ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n", handle, units, timeout)); @@ -812,17 +839,17 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout) } if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, - "Failed to acquire semaphore[%p|%d|%d], %s", + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Failed to acquire semaphore[%p|%d|%d], %s\n", handle, units, timeout, acpi_format_exception(status))); } else { ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, - "Acquired semaphore[%p|%d|%d]", handle, + "Acquired semaphore[%p|%d|%d]\n", handle, units, timeout)); } - return status; + return_ACPI_STATUS(status); } EXPORT_SYMBOL(acpi_os_wait_semaphore); @@ -834,19 +861,20 @@ acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units) { struct semaphore *sem = (struct semaphore *)handle; + ACPI_FUNCTION_TRACE("os_signal_semaphore"); if (!sem || (units < 1)) - return AE_BAD_PARAMETER; + return_ACPI_STATUS(AE_BAD_PARAMETER); if (units > 1) - return AE_SUPPORT; + return_ACPI_STATUS(AE_SUPPORT); ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Signaling semaphore[%p|%d]\n", handle, units)); up(sem); - return AE_OK; + return_ACPI_STATUS(AE_OK); } EXPORT_SYMBOL(acpi_os_signal_semaphore); @@ -1015,10 +1043,10 @@ EXPORT_SYMBOL(max_cstate); * handle is a pointer to the spinlock_t. */ -acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp) +acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle) { acpi_cpu_flags flags; - spin_lock_irqsave(lockp, flags); + spin_lock_irqsave((spinlock_t *) handle, flags); return flags; } @@ -1026,9 +1054,9 @@ acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp) * Release a spinlock. See above. */ -void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags) +void acpi_os_release_lock(acpi_handle handle, acpi_cpu_flags flags) { - spin_unlock_irqrestore(lockp, flags); + spin_unlock_irqrestore((spinlock_t *) handle, flags); } #ifndef ACPI_USE_LOCAL_CACHE diff --git a/trunk/drivers/acpi/parser/psparse.c b/trunk/drivers/acpi/parser/psparse.c index a02aa62fe1e5..7ee2f2e77525 100644 --- a/trunk/drivers/acpi/parser/psparse.c +++ b/trunk/drivers/acpi/parser/psparse.c @@ -469,16 +469,6 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) } walk_state->thread = thread; - - /* - * If executing a method, the starting sync_level is this method's - * sync_level - */ - if (walk_state->method_desc) { - walk_state->thread->current_sync_level = - walk_state->method_desc->method.sync_level; - } - acpi_ds_push_walk_state(walk_state, thread); /* @@ -515,10 +505,6 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) status = acpi_ds_call_control_method(thread, walk_state, NULL); - if (ACPI_FAILURE(status)) { - status = - acpi_ds_method_error(status, walk_state); - } /* * If the transfer to the new method method call worked, a new walk @@ -539,7 +525,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) /* Check for possible multi-thread reentrancy problem */ if ((status == AE_ALREADY_EXISTS) && - (!walk_state->method_desc->method.mutex)) { + (!walk_state->method_desc->method.semaphore)) { /* * Method tried to create an object twice. The probable cause is * that the method cannot handle reentrancy. @@ -551,7 +537,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) */ walk_state->method_desc->method.method_flags |= AML_METHOD_SERIALIZED; - walk_state->method_desc->method.sync_level = 0; + walk_state->method_desc->method.concurrency = 1; } } diff --git a/trunk/drivers/acpi/pci_bind.c b/trunk/drivers/acpi/pci_bind.c index 1e2ae6e7a7e4..2a718df769b5 100644 --- a/trunk/drivers/acpi/pci_bind.c +++ b/trunk/drivers/acpi/pci_bind.c @@ -47,10 +47,11 @@ struct acpi_pci_data { static void acpi_pci_data_handler(acpi_handle handle, u32 function, void *context) { + ACPI_FUNCTION_TRACE("acpi_pci_data_handler"); /* TBD: Anything we need to do here? */ - return; + return_VOID; } /** @@ -67,24 +68,25 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id) struct acpi_device *device = NULL; struct acpi_pci_data *data = NULL; + ACPI_FUNCTION_TRACE("acpi_get_pci_id"); if (!id) - return AE_BAD_PARAMETER; + return_ACPI_STATUS(AE_BAD_PARAMETER); result = acpi_bus_get_device(handle, &device); if (result) { - printk(KERN_ERR PREFIX - "Invalid ACPI Bus context for device %s\n", - acpi_device_bid(device)); - return AE_NOT_EXIST; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid ACPI Bus context for device %s\n", + acpi_device_bid(device))); + return_ACPI_STATUS(AE_NOT_EXIST); } status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data); if (ACPI_FAILURE(status) || !data) { - ACPI_EXCEPTION((AE_INFO, status, - "Invalid ACPI-PCI context for device %s", - acpi_device_bid(device))); - return status; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid ACPI-PCI context for device %s\n", + acpi_device_bid(device))); + return_ACPI_STATUS(status); } *id = data->id; @@ -101,7 +103,7 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id) acpi_device_bid(device), id->segment, id->bus, id->device, id->function)); - return AE_OK; + return_ACPI_STATUS(AE_OK); } EXPORT_SYMBOL(acpi_get_pci_id); @@ -118,13 +120,14 @@ int acpi_pci_bind(struct acpi_device *device) struct pci_dev *dev; struct pci_bus *bus; + ACPI_FUNCTION_TRACE("acpi_pci_bind"); if (!device || !device->parent) - return -EINVAL; + return_VALUE(-EINVAL); pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); if (!pathname) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(pathname, 0, ACPI_PATHNAME_MAX); buffer.length = ACPI_PATHNAME_MAX; buffer.pointer = pathname; @@ -132,7 +135,7 @@ int acpi_pci_bind(struct acpi_device *device) data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); if (!data) { kfree(pathname); - return -ENOMEM; + return_VALUE(-ENOMEM); } memset(data, 0, sizeof(struct acpi_pci_data)); @@ -148,9 +151,9 @@ int acpi_pci_bind(struct acpi_device *device) status = acpi_get_data(device->parent->handle, acpi_pci_data_handler, (void **)&pdata); if (ACPI_FAILURE(status) || !pdata || !pdata->bus) { - ACPI_EXCEPTION((AE_INFO, status, - "Invalid ACPI-PCI context for parent device %s", - acpi_device_bid(device->parent))); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid ACPI-PCI context for parent device %s\n", + acpi_device_bid(device->parent))); result = -ENODEV; goto end; } @@ -203,10 +206,10 @@ int acpi_pci_bind(struct acpi_device *device) goto end; } if (!data->dev->bus) { - printk(KERN_ERR PREFIX - "Device %02x:%02x:%02x.%02x has invalid 'bus' field\n", - data->id.segment, data->id.bus, - data->id.device, data->id.function); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Device %02x:%02x:%02x.%02x has invalid 'bus' field\n", + data->id.segment, data->id.bus, + data->id.device, data->id.function)); result = -ENODEV; goto end; } @@ -234,9 +237,9 @@ int acpi_pci_bind(struct acpi_device *device) */ status = acpi_attach_data(device->handle, acpi_pci_data_handler, data); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "Unable to attach ACPI-PCI context to device %s", - acpi_device_bid(device))); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to attach ACPI-PCI context to device %s\n", + acpi_device_bid(device))); result = -ENODEV; goto end; } @@ -266,7 +269,7 @@ int acpi_pci_bind(struct acpi_device *device) if (result) kfree(data); - return result; + return_VALUE(result); } int acpi_pci_unbind(struct acpi_device *device) @@ -277,13 +280,14 @@ int acpi_pci_unbind(struct acpi_device *device) char *pathname = NULL; struct acpi_buffer buffer = { 0, NULL }; + ACPI_FUNCTION_TRACE("acpi_pci_unbind"); if (!device || !device->parent) - return -EINVAL; + return_VALUE(-EINVAL); pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); if (!pathname) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(pathname, 0, ACPI_PATHNAME_MAX); buffer.length = ACPI_PATHNAME_MAX; @@ -297,18 +301,18 @@ int acpi_pci_unbind(struct acpi_device *device) acpi_get_data(device->handle, acpi_pci_data_handler, (void **)&data); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "Unable to get data from device %s", - acpi_device_bid(device))); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to get data from device %s\n", + acpi_device_bid(device))); result = -ENODEV; goto end; } status = acpi_detach_data(device->handle, acpi_pci_data_handler); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "Unable to detach data from device %s", - acpi_device_bid(device))); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to detach data from device %s\n", + acpi_device_bid(device))); result = -ENODEV; goto end; } @@ -318,7 +322,7 @@ int acpi_pci_unbind(struct acpi_device *device) kfree(data); end: - return result; + return_VALUE(result); } int @@ -331,10 +335,11 @@ acpi_pci_bind_root(struct acpi_device *device, char *pathname = NULL; struct acpi_buffer buffer = { 0, NULL }; + ACPI_FUNCTION_TRACE("acpi_pci_bind_root"); pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); if (!pathname) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(pathname, 0, ACPI_PATHNAME_MAX); buffer.length = ACPI_PATHNAME_MAX; @@ -342,13 +347,13 @@ acpi_pci_bind_root(struct acpi_device *device, if (!device || !id || !bus) { kfree(pathname); - return -EINVAL; + return_VALUE(-EINVAL); } data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); if (!data) { kfree(pathname); - return -ENOMEM; + return_VALUE(-ENOMEM); } memset(data, 0, sizeof(struct acpi_pci_data)); @@ -364,9 +369,9 @@ acpi_pci_bind_root(struct acpi_device *device, status = acpi_attach_data(device->handle, acpi_pci_data_handler, data); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "Unable to attach ACPI-PCI context to device %s", - pathname)); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to attach ACPI-PCI context to device %s\n", + pathname)); result = -ENODEV; goto end; } @@ -376,5 +381,5 @@ acpi_pci_bind_root(struct acpi_device *device, if (result != 0) kfree(data); - return result; + return_VALUE(result); } diff --git a/trunk/drivers/acpi/pci_irq.c b/trunk/drivers/acpi/pci_irq.c index feda0341f5a7..65aee79b3971 100644 --- a/trunk/drivers/acpi/pci_irq.c +++ b/trunk/drivers/acpi/pci_irq.c @@ -24,6 +24,7 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include #include #include @@ -54,9 +55,10 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment, struct list_head *node = NULL; struct acpi_prt_entry *entry = NULL; + ACPI_FUNCTION_TRACE("acpi_pci_irq_find_prt_entry"); if (!acpi_prt.count) - return NULL; + return_PTR(NULL); /* * Parse through all PRT entries looking for a match on the specified @@ -71,12 +73,12 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment, && (device == entry->id.device) && (pin == entry->pin)) { spin_unlock(&acpi_prt_lock); - return entry; + return_PTR(entry); } } spin_unlock(&acpi_prt_lock); - return NULL; + return_PTR(NULL); } static int @@ -85,13 +87,14 @@ acpi_pci_irq_add_entry(acpi_handle handle, { struct acpi_prt_entry *entry = NULL; + ACPI_FUNCTION_TRACE("acpi_pci_irq_add_entry"); if (!prt) - return -EINVAL; + return_VALUE(-EINVAL); entry = kmalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL); if (!entry) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(entry, 0, sizeof(struct acpi_prt_entry)); entry->id.segment = segment; @@ -138,7 +141,7 @@ acpi_pci_irq_add_entry(acpi_handle handle, acpi_prt.count++; spin_unlock(&acpi_prt_lock); - return 0; + return_VALUE(0); } static void @@ -160,10 +163,11 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus) struct acpi_pci_routing_table *entry = NULL; static int first_time = 1; + ACPI_FUNCTION_TRACE("acpi_pci_irq_add_prt"); pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); if (!pathname) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(pathname, 0, ACPI_PATHNAME_MAX); if (first_time) { @@ -193,24 +197,24 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus) kfree(pathname); status = acpi_get_irq_routing_table(handle, &buffer); if (status != AE_BUFFER_OVERFLOW) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]", - acpi_format_exception(status))); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n", + acpi_format_exception(status))); + return_VALUE(-ENODEV); } prt = kmalloc(buffer.length, GFP_KERNEL); if (!prt) { - return -ENOMEM; + return_VALUE(-ENOMEM); } memset(prt, 0, buffer.length); buffer.pointer = prt; status = acpi_get_irq_routing_table(handle, &buffer); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]", - acpi_format_exception(status))); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n", + acpi_format_exception(status))); kfree(buffer.pointer); - return -ENODEV; + return_VALUE(-ENODEV); } entry = prt; @@ -223,7 +227,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus) kfree(prt); - return 0; + return_VALUE(0); } void acpi_pci_irq_del_prt(int segment, int bus) @@ -258,15 +262,16 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry, { int irq; + ACPI_FUNCTION_TRACE("acpi_pci_allocate_irq"); if (entry->link.handle) { irq = acpi_pci_link_allocate_irq(entry->link.handle, entry->link.index, triggering, polarity, link); if (irq < 0) { - printk(KERN_WARNING PREFIX - "Invalid IRQ link routing entry\n"); - return -1; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid IRQ link routing entry\n")); + return_VALUE(-1); } } else { irq = entry->link.index; @@ -275,7 +280,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry, } ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq)); - return irq; + return_VALUE(irq); } static int @@ -284,12 +289,13 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry, { int irq; + ACPI_FUNCTION_TRACE("acpi_pci_free_irq"); if (entry->link.handle) { irq = acpi_pci_link_free_irq(entry->link.handle); } else { irq = entry->link.index; } - return irq; + return_VALUE(irq); } /* @@ -309,6 +315,7 @@ acpi_pci_irq_lookup(struct pci_bus *bus, int bus_nr = bus->number; int ret; + ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup"); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Searching for PRT entry for %02x:%02x:%02x[%c]\n", @@ -317,11 +324,11 @@ acpi_pci_irq_lookup(struct pci_bus *bus, entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin); if (!entry) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n")); - return -1; + return_VALUE(-1); } ret = func(entry, triggering, polarity, link); - return ret; + return_VALUE(ret); } /* @@ -339,9 +346,10 @@ acpi_pci_irq_derive(struct pci_dev *dev, int irq = -1; u8 bridge_pin = 0; + ACPI_FUNCTION_TRACE("acpi_pci_irq_derive"); if (!dev) - return -EINVAL; + return_VALUE(-EINVAL); /* * Attempt to derive an IRQ for this device from a parent bridge's @@ -358,7 +366,7 @@ acpi_pci_irq_derive(struct pci_dev *dev, ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No interrupt pin configured for device %s\n", pci_name(bridge))); - return -1; + return_VALUE(-1); } /* Pin is from 0 to 3 */ bridge_pin--; @@ -371,15 +379,16 @@ acpi_pci_irq_derive(struct pci_dev *dev, } if (irq < 0) { - printk(KERN_WARNING PREFIX "Unable to derive IRQ for device %s\n", - pci_name(dev)); - return -1; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Unable to derive IRQ for device %s\n", + pci_name(dev))); + return_VALUE(-1); } ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n", irq, pci_name(dev), pci_name(bridge))); - return irq; + return_VALUE(irq); } /* @@ -397,22 +406,24 @@ int acpi_pci_irq_enable(struct pci_dev *dev) char *link = NULL; int rc; + ACPI_FUNCTION_TRACE("acpi_pci_irq_enable"); if (!dev) - return -EINVAL; + return_VALUE(-EINVAL); pin = dev->pin; if (!pin) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No interrupt pin configured for device %s\n", pci_name(dev))); - return 0; + return_VALUE(0); } pin--; if (!dev->bus) { - printk(KERN_ERR PREFIX "Invalid (NULL) 'bus' field\n"); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid (NULL) 'bus' field\n")); + return_VALUE(-ENODEV); } /* @@ -444,10 +455,10 @@ int acpi_pci_irq_enable(struct pci_dev *dev) printk(" - using IRQ %d\n", dev->irq); acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); - return 0; + return_VALUE(0); } else { printk("\n"); - return 0; + return_VALUE(0); } } @@ -455,7 +466,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) if (rc < 0) { printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed " "to register GSI\n", pci_name(dev), ('A' + pin)); - return rc; + return_VALUE(rc); } dev->irq = rc; @@ -469,7 +480,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) (triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge", (polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq); - return 0; + return_VALUE(0); } EXPORT_SYMBOL(acpi_pci_irq_enable); @@ -486,13 +497,14 @@ void acpi_pci_irq_disable(struct pci_dev *dev) int triggering = ACPI_LEVEL_SENSITIVE; int polarity = ACPI_ACTIVE_LOW; + ACPI_FUNCTION_TRACE("acpi_pci_irq_disable"); if (!dev || !dev->bus) - return; + return_VOID; pin = dev->pin; if (!pin) - return; + return_VOID; pin--; /* @@ -510,7 +522,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev) &triggering, &polarity, NULL, acpi_pci_free_irq); if (gsi < 0) - return; + return_VOID; /* * TBD: It might be worth clearing dev->irq by magic constant @@ -522,5 +534,5 @@ void acpi_pci_irq_disable(struct pci_dev *dev) acpi_unregister_gsi(gsi); - return; + return_VOID; } diff --git a/trunk/drivers/acpi/pci_link.c b/trunk/drivers/acpi/pci_link.c index 8197c0e40769..228bdb626502 100644 --- a/trunk/drivers/acpi/pci_link.c +++ b/trunk/drivers/acpi/pci_link.c @@ -83,6 +83,7 @@ struct acpi_pci_link_irq { struct acpi_pci_link { struct list_head node; struct acpi_device *device; + acpi_handle handle; struct acpi_pci_link_irq irq; int refcnt; }; @@ -106,23 +107,26 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) struct acpi_pci_link *link = (struct acpi_pci_link *)context; u32 i = 0; + ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible"); switch (resource->type) { case ACPI_RESOURCE_TYPE_START_DEPENDENT: - return AE_OK; + return_ACPI_STATUS(AE_OK); case ACPI_RESOURCE_TYPE_IRQ: { struct acpi_resource_irq *p = &resource->data.irq; if (!p || !p->interrupt_count) { - printk(KERN_WARNING PREFIX "Blank IRQ resource\n"); - return AE_OK; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Blank IRQ resource\n")); + return_ACPI_STATUS(AE_OK); } for (i = 0; (i < p->interrupt_count && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { if (!p->interrupts[i]) { - printk(KERN_WARNING PREFIX "Invalid IRQ %d\n", - p->interrupts[i]); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid IRQ %d\n", + p->interrupts[i])); continue; } link->irq.possible[i] = p->interrupts[i]; @@ -138,16 +142,17 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) struct acpi_resource_extended_irq *p = &resource->data.extended_irq; if (!p || !p->interrupt_count) { - printk(KERN_WARNING PREFIX - "Blank EXT IRQ resource\n"); - return AE_OK; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Blank EXT IRQ resource\n")); + return_ACPI_STATUS(AE_OK); } for (i = 0; (i < p->interrupt_count && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { if (!p->interrupts[i]) { - printk(KERN_WARNING PREFIX "Invalid IRQ %d\n", - p->interrupts[i]); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid IRQ %d\n", + p->interrupts[i])); continue; } link->irq.possible[i] = p->interrupts[i]; @@ -159,33 +164,35 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) break; } default: - printk(KERN_ERR PREFIX "Resource is not an IRQ entry\n"); - return AE_OK; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Resource is not an IRQ entry\n")); + return_ACPI_STATUS(AE_OK); } - return AE_CTRL_TERMINATE; + return_ACPI_STATUS(AE_CTRL_TERMINATE); } static int acpi_pci_link_get_possible(struct acpi_pci_link *link) { acpi_status status; + ACPI_FUNCTION_TRACE("acpi_pci_link_get_possible"); if (!link) - return -EINVAL; + return_VALUE(-EINVAL); - status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS, + status = acpi_walk_resources(link->handle, METHOD_NAME__PRS, acpi_pci_link_check_possible, link); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS")); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRS\n")); + return_VALUE(-ENODEV); } ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d possible IRQs\n", link->irq.possible_count)); - return 0; + return_VALUE(0); } static acpi_status @@ -193,6 +200,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) { int *irq = (int *)context; + ACPI_FUNCTION_TRACE("acpi_pci_link_check_current"); switch (resource->type) { case ACPI_RESOURCE_TYPE_IRQ: @@ -205,7 +213,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) */ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Blank IRQ resource\n")); - return AE_OK; + return_ACPI_STATUS(AE_OK); } *irq = p->interrupts[0]; break; @@ -219,20 +227,20 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) * extended IRQ descriptors must * return at least 1 IRQ */ - printk(KERN_WARNING PREFIX - "Blank EXT IRQ resource\n"); - return AE_OK; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Blank EXT IRQ resource\n")); + return_ACPI_STATUS(AE_OK); } *irq = p->interrupts[0]; break; } break; default: - printk(KERN_ERR PREFIX "Resource %d isn't an IRQ\n", resource->type); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Resource %d isn't an IRQ\n", resource->type)); case ACPI_RESOURCE_TYPE_END_TAG: - return AE_OK; + return_ACPI_STATUS(AE_OK); } - return AE_CTRL_TERMINATE; + return_ACPI_STATUS(AE_CTRL_TERMINATE); } /* @@ -248,8 +256,10 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) acpi_status status = AE_OK; int irq = 0; - if (!link) - return -EINVAL; + ACPI_FUNCTION_TRACE("acpi_pci_link_get_current"); + + if (!link || !link->handle) + return_VALUE(-EINVAL); link->irq.active = 0; @@ -258,13 +268,14 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) /* Query _STA, set link->device->status */ result = acpi_bus_get_status(link->device); if (result) { - printk(KERN_ERR PREFIX "Unable to read status\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to read status\n")); goto end; } if (!link->device->status.enabled) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n")); - return 0; + return_VALUE(0); } } @@ -272,16 +283,16 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) * Query and parse _CRS to get the current IRQ assignment. */ - status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS, + status = acpi_walk_resources(link->handle, METHOD_NAME__CRS, acpi_pci_link_check_current, &irq); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _CRS\n")); result = -ENODEV; goto end; } if (acpi_strict && !irq) { - printk(KERN_ERR PREFIX "_CRS returned 0\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_CRS returned 0\n")); result = -ENODEV; } @@ -290,7 +301,7 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active)); end: - return result; + return_VALUE(result); } static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) @@ -303,13 +314,14 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) } *resource; struct acpi_buffer buffer = { 0, NULL }; + ACPI_FUNCTION_TRACE("acpi_pci_link_set"); if (!link || !irq) - return -EINVAL; + return_VALUE(-EINVAL); resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC); if (!resource) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(resource, 0, sizeof(*resource) + 1); buffer.length = sizeof(*resource) + 1; @@ -350,7 +362,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) /* ignore resource_source, it's optional */ break; default: - printk(KERN_ERR PREFIX "Invalid Resource_type %d\n", link->irq.resource_type); + printk("ACPI BUG: resource_type %d\n", link->irq.resource_type); result = -EINVAL; goto end; @@ -358,11 +370,11 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) resource->end.type = ACPI_RESOURCE_TYPE_END_TAG; /* Attempt to set the resource */ - status = acpi_set_current_resources(link->device->handle, &buffer); + status = acpi_set_current_resources(link->handle, &buffer); /* check for total failure */ if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SRS")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n")); result = -ENODEV; goto end; } @@ -370,14 +382,14 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) /* Query _STA, set device->status */ result = acpi_bus_get_status(link->device); if (result) { - printk(KERN_ERR PREFIX "Unable to read status\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n")); goto end; } if (!link->device->status.enabled) { printk(KERN_WARNING PREFIX - "%s [%s] disabled and referenced, BIOS bug\n", - acpi_device_name(link->device), - acpi_device_bid(link->device)); + "%s [%s] disabled and referenced, BIOS bug.\n", + acpi_device_name(link->device), + acpi_device_bid(link->device)); } /* Query _CRS, set link->irq.active */ @@ -396,9 +408,9 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) * assume _SRS worked and override _CRS value. */ printk(KERN_WARNING PREFIX - "%s [%s] BIOS reported IRQ %d, using IRQ %d\n", - acpi_device_name(link->device), - acpi_device_bid(link->device), link->irq.active, irq); + "%s [%s] BIOS reported IRQ %d, using IRQ %d\n", + acpi_device_name(link->device), + acpi_device_bid(link->device), link->irq.active, irq); link->irq.active = irq; } @@ -406,7 +418,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) end: kfree(resource); - return result; + return_VALUE(result); } /* -------------------------------------------------------------------------- @@ -480,6 +492,7 @@ int __init acpi_irq_penalty_init(void) struct acpi_pci_link *link = NULL; int i = 0; + ACPI_FUNCTION_TRACE("acpi_irq_penalty_init"); /* * Update penalties to facilitate IRQ balancing. @@ -488,7 +501,8 @@ int __init acpi_irq_penalty_init(void) link = list_entry(node, struct acpi_pci_link, node); if (!link) { - printk(KERN_ERR PREFIX "Invalid link context\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid link context\n")); continue; } @@ -516,7 +530,7 @@ int __init acpi_irq_penalty_init(void) /* Add a penalty for the SCI */ acpi_irq_penalty[acpi_fadt.sci_int] += PIRQ_PENALTY_PCI_USING; - return 0; + return_VALUE(0); } static int acpi_irq_balance; /* 0: static, 1: balance */ @@ -526,12 +540,13 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link) int irq; int i; + ACPI_FUNCTION_TRACE("acpi_pci_link_allocate"); if (link->irq.initialized) { if (link->refcnt == 0) /* This means the link is disabled but initialized */ acpi_pci_link_set(link, link->irq.active); - return 0; + return_VALUE(0); } /* @@ -547,7 +562,7 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link) if (i == link->irq.possible_count) { if (acpi_strict) printk(KERN_WARNING PREFIX "_CRS %d not found" - " in _PRS\n", link->irq.active); + " in _PRS\n", link->irq.active); link->irq.active = 0; } @@ -574,11 +589,12 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link) /* Attempt to enable the link device at this IRQ. */ if (acpi_pci_link_set(link, irq)) { - printk(KERN_ERR PREFIX "Unable to set IRQ for %s [%s]. " - "Try pci=noacpi or acpi=off\n", - acpi_device_name(link->device), - acpi_device_bid(link->device)); - return -ENODEV; + printk(PREFIX + "Unable to set IRQ for %s [%s] (likely buggy ACPI BIOS).\n" + "Try pci=noacpi or acpi=off\n", + acpi_device_name(link->device), + acpi_device_bid(link->device)); + return_VALUE(-ENODEV); } else { acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING; printk(PREFIX "%s [%s] enabled at IRQ %d\n", @@ -588,7 +604,7 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link) link->irq.initialized = 1; - return 0; + return_VALUE(0); } /* @@ -606,35 +622,36 @@ acpi_pci_link_allocate_irq(acpi_handle handle, struct acpi_device *device = NULL; struct acpi_pci_link *link = NULL; + ACPI_FUNCTION_TRACE("acpi_pci_link_allocate_irq"); result = acpi_bus_get_device(handle, &device); if (result) { - printk(KERN_ERR PREFIX "Invalid link device\n"); - return -1; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n")); + return_VALUE(-1); } link = (struct acpi_pci_link *)acpi_driver_data(device); if (!link) { - printk(KERN_ERR PREFIX "Invalid link context\n"); - return -1; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); + return_VALUE(-1); } /* TBD: Support multiple index (IRQ) entries per Link Device */ if (index) { - printk(KERN_ERR PREFIX "Invalid index %d\n", index); - return -1; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid index %d\n", index)); + return_VALUE(-1); } mutex_lock(&acpi_link_lock); if (acpi_pci_link_allocate(link)) { mutex_unlock(&acpi_link_lock); - return -1; + return_VALUE(-1); } if (!link->irq.active) { mutex_unlock(&acpi_link_lock); - printk(KERN_ERR PREFIX "Link active IRQ is 0!\n"); - return -1; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n")); + return_VALUE(-1); } link->refcnt++; mutex_unlock(&acpi_link_lock); @@ -648,7 +665,7 @@ acpi_pci_link_allocate_irq(acpi_handle handle, ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link %s is referenced\n", acpi_device_bid(link->device))); - return (link->irq.active); + return_VALUE(link->irq.active); } /* @@ -661,24 +678,25 @@ int acpi_pci_link_free_irq(acpi_handle handle) struct acpi_pci_link *link = NULL; acpi_status result; + ACPI_FUNCTION_TRACE("acpi_pci_link_free_irq"); result = acpi_bus_get_device(handle, &device); if (result) { - printk(KERN_ERR PREFIX "Invalid link device\n"); - return -1; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n")); + return_VALUE(-1); } link = (struct acpi_pci_link *)acpi_driver_data(device); if (!link) { - printk(KERN_ERR PREFIX "Invalid link context\n"); - return -1; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); + return_VALUE(-1); } mutex_lock(&acpi_link_lock); if (!link->irq.initialized) { mutex_unlock(&acpi_link_lock); - printk(KERN_ERR PREFIX "Link isn't initialized\n"); - return -1; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link isn't initialized\n")); + return_VALUE(-1); } #ifdef FUTURE_USE /* @@ -697,10 +715,10 @@ int acpi_pci_link_free_irq(acpi_handle handle) acpi_device_bid(link->device))); if (link->refcnt == 0) { - acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, NULL); + acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); } mutex_unlock(&acpi_link_lock); - return (link->irq.active); + return_VALUE(link->irq.active); } /* -------------------------------------------------------------------------- @@ -714,16 +732,18 @@ static int acpi_pci_link_add(struct acpi_device *device) int i = 0; int found = 0; + ACPI_FUNCTION_TRACE("acpi_pci_link_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); link = kmalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); if (!link) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(link, 0, sizeof(struct acpi_pci_link)); link->device = device; + link->handle = device->handle; strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); acpi_driver_data(device) = link; @@ -762,22 +782,23 @@ static int acpi_pci_link_add(struct acpi_device *device) end: /* disable all links -- to be activated on use */ - acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL); + acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); mutex_unlock(&acpi_link_lock); if (result) kfree(link); - return result; + return_VALUE(result); } static int acpi_pci_link_resume(struct acpi_pci_link *link) { + ACPI_FUNCTION_TRACE("acpi_pci_link_resume"); if (link->refcnt && link->irq.active && link->irq.initialized) - return (acpi_pci_link_set(link, link->irq.active)); + return_VALUE(acpi_pci_link_set(link, link->irq.active)); else - return 0; + return_VALUE(0); } /* @@ -790,6 +811,7 @@ static int irqrouter_resume(struct sys_device *dev) struct list_head *node = NULL; struct acpi_pci_link *link = NULL; + ACPI_FUNCTION_TRACE("irqrouter_resume"); /* Make sure SCI is enabled again (Apple firmware bug?) */ acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK); @@ -798,22 +820,24 @@ static int irqrouter_resume(struct sys_device *dev) list_for_each(node, &acpi_link.entries) { link = list_entry(node, struct acpi_pci_link, node); if (!link) { - printk(KERN_ERR PREFIX "Invalid link context\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid link context\n")); continue; } acpi_pci_link_resume(link); } acpi_in_resume = 0; - return 0; + return_VALUE(0); } static int acpi_pci_link_remove(struct acpi_device *device, int type) { struct acpi_pci_link *link = NULL; + ACPI_FUNCTION_TRACE("acpi_pci_link_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); link = (struct acpi_pci_link *)acpi_driver_data(device); @@ -823,7 +847,7 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type) kfree(link); - return 0; + return_VALUE(0); } /* @@ -929,32 +953,34 @@ static int __init irqrouter_init_sysfs(void) { int error; + ACPI_FUNCTION_TRACE("irqrouter_init_sysfs"); if (acpi_disabled || acpi_noirq) - return 0; + return_VALUE(0); error = sysdev_class_register(&irqrouter_sysdev_class); if (!error) error = sysdev_register(&device_irqrouter); - return error; + return_VALUE(error); } device_initcall(irqrouter_init_sysfs); static int __init acpi_pci_link_init(void) { + ACPI_FUNCTION_TRACE("acpi_pci_link_init"); if (acpi_noirq) - return 0; + return_VALUE(0); acpi_link.count = 0; INIT_LIST_HEAD(&acpi_link.entries); if (acpi_bus_register_driver(&acpi_pci_link_driver) < 0) - return -ENODEV; + return_VALUE(-ENODEV); - return 0; + return_VALUE(0); } subsys_initcall(acpi_pci_link_init); diff --git a/trunk/drivers/acpi/pci_root.c b/trunk/drivers/acpi/pci_root.c index 0984a1ee24ed..4c313eab6313 100644 --- a/trunk/drivers/acpi/pci_root.c +++ b/trunk/drivers/acpi/pci_root.c @@ -58,7 +58,7 @@ static struct acpi_driver acpi_pci_root_driver = { struct acpi_pci_root { struct list_head node; - struct acpi_device * device; + acpi_handle handle; struct acpi_pci_id id; struct pci_bus *bus; }; @@ -83,7 +83,7 @@ int acpi_pci_register_driver(struct acpi_pci_driver *driver) list_for_each(entry, &acpi_pci_roots) { struct acpi_pci_root *root; root = list_entry(entry, struct acpi_pci_root, node); - driver->add(root->device->handle); + driver->add(root->handle); n++; } @@ -110,7 +110,7 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) list_for_each(entry, &acpi_pci_roots) { struct acpi_pci_root *root; root = list_entry(entry, struct acpi_pci_root, node); - driver->remove(root->device->handle); + driver->remove(root->handle); } } @@ -160,17 +160,18 @@ static int acpi_pci_root_add(struct acpi_device *device) unsigned long value = 0; acpi_handle handle = NULL; + ACPI_FUNCTION_TRACE("acpi_pci_root_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); if (!root) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(root, 0, sizeof(struct acpi_pci_root)); INIT_LIST_HEAD(&root->node); - root->device = device; + root->handle = device->handle; strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); acpi_driver_data(device) = root; @@ -185,7 +186,7 @@ static int acpi_pci_root_add(struct acpi_device *device) * ------- * Obtained via _SEG, if exists, otherwise assumed to be zero (0). */ - status = acpi_evaluate_integer(device->handle, METHOD_NAME__SEG, NULL, + status = acpi_evaluate_integer(root->handle, METHOD_NAME__SEG, NULL, &value); switch (status) { case AE_OK: @@ -197,7 +198,7 @@ static int acpi_pci_root_add(struct acpi_device *device) root->id.segment = 0; break; default: - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SEG")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SEG\n")); result = -ENODEV; goto end; } @@ -207,7 +208,7 @@ static int acpi_pci_root_add(struct acpi_device *device) * --- * Obtained via _BBN, if exists, otherwise assumed to be zero (0). */ - status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, NULL, + status = acpi_evaluate_integer(root->handle, METHOD_NAME__BBN, NULL, &value); switch (status) { case AE_OK: @@ -218,7 +219,7 @@ static int acpi_pci_root_add(struct acpi_device *device) root->id.bus = 0; break; default: - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BBN")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BBN\n")); result = -ENODEV; goto end; } @@ -230,11 +231,10 @@ static int acpi_pci_root_add(struct acpi_device *device) int bus = 0; acpi_status status; - printk(KERN_ERR PREFIX - "Wrong _BBN value, reboot" - " and use option 'pci=noacpi'\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Wrong _BBN value, please reboot and using option 'pci=noacpi'\n")); - status = try_get_root_bridge_busnr(device->handle, &bus); + status = try_get_root_bridge_busnr(root->handle, &bus); if (ACPI_FAILURE(status)) break; if (bus != root->id.bus) { @@ -273,9 +273,9 @@ static int acpi_pci_root_add(struct acpi_device *device) */ root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus); if (!root->bus) { - printk(KERN_ERR PREFIX - "Bus %04x:%02x not present in PCI namespace\n", - root->id.segment, root->id.bus); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Bus %04x:%02x not present in PCI namespace\n", + root->id.segment, root->id.bus)); result = -ENODEV; goto end; } @@ -294,9 +294,9 @@ static int acpi_pci_root_add(struct acpi_device *device) * ----------------- * Evaluate and parse _PRT, if exists. */ - status = acpi_get_handle(device->handle, METHOD_NAME__PRT, &handle); + status = acpi_get_handle(root->handle, METHOD_NAME__PRT, &handle); if (ACPI_SUCCESS(status)) - result = acpi_pci_irq_add_prt(device->handle, root->id.segment, + result = acpi_pci_irq_add_prt(root->handle, root->id.segment, root->id.bus); end: @@ -306,43 +306,46 @@ static int acpi_pci_root_add(struct acpi_device *device) kfree(root); } - return result; + return_VALUE(result); } static int acpi_pci_root_start(struct acpi_device *device) { struct acpi_pci_root *root; + ACPI_FUNCTION_TRACE("acpi_pci_root_start"); list_for_each_entry(root, &acpi_pci_roots, node) { - if (root->device == device) { + if (root->handle == device->handle) { pci_bus_add_devices(root->bus); - return 0; + return_VALUE(0); } } - return -ENODEV; + return_VALUE(-ENODEV); } static int acpi_pci_root_remove(struct acpi_device *device, int type) { struct acpi_pci_root *root = NULL; + ACPI_FUNCTION_TRACE("acpi_pci_root_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); root = (struct acpi_pci_root *)acpi_driver_data(device); kfree(root); - return 0; + return_VALUE(0); } static int __init acpi_pci_root_init(void) { + ACPI_FUNCTION_TRACE("acpi_pci_root_init"); if (acpi_pci_disabled) - return 0; + return_VALUE(0); /* DEBUG: acpi_dbg_layer = ACPI_PCI_COMPONENT; @@ -350,9 +353,9 @@ static int __init acpi_pci_root_init(void) */ if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0) - return -ENODEV; + return_VALUE(-ENODEV); - return 0; + return_VALUE(0); } subsys_initcall(acpi_pci_root_init); diff --git a/trunk/drivers/acpi/power.c b/trunk/drivers/acpi/power.c index 5d3447f4582c..62a5595ed8bc 100644 --- a/trunk/drivers/acpi/power.c +++ b/trunk/drivers/acpi/power.c @@ -70,7 +70,7 @@ static struct acpi_driver acpi_power_driver = { }; struct acpi_power_resource { - struct acpi_device * device; + acpi_handle handle; acpi_bus_id name; u32 system_level; u32 order; @@ -98,21 +98,23 @@ acpi_power_get_context(acpi_handle handle, int result = 0; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_power_get_context"); if (!resource) - return -ENODEV; + return_VALUE(-ENODEV); result = acpi_bus_get_device(handle, &device); if (result) { - printk(KERN_WARNING PREFIX "Getting context [%p]\n", handle); - return result; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context [%p]\n", + handle)); + return_VALUE(result); } *resource = (struct acpi_power_resource *)acpi_driver_data(device); if (!resource) - return -ENODEV; + return_VALUE(-ENODEV); - return 0; + return_VALUE(0); } static int acpi_power_get_state(struct acpi_power_resource *resource) @@ -120,13 +122,14 @@ static int acpi_power_get_state(struct acpi_power_resource *resource) acpi_status status = AE_OK; unsigned long sta = 0; + ACPI_FUNCTION_TRACE("acpi_power_get_state"); if (!resource) - return -EINVAL; + return_VALUE(-EINVAL); - status = acpi_evaluate_integer(resource->device->handle, "_STA", NULL, &sta); + status = acpi_evaluate_integer(resource->handle, "_STA", NULL, &sta); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); if (sta & 0x01) resource->state = ACPI_POWER_RESOURCE_STATE_ON; @@ -136,7 +139,7 @@ static int acpi_power_get_state(struct acpi_power_resource *resource) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n", resource->name, resource->state ? "on" : "off")); - return 0; + return_VALUE(0); } static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state) @@ -145,19 +148,20 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state) struct acpi_power_resource *resource = NULL; u32 i = 0; + ACPI_FUNCTION_TRACE("acpi_power_get_list_state"); if (!list || !state) - return -EINVAL; + return_VALUE(-EINVAL); /* The state of the list is 'on' IFF all resources are 'on'. */ for (i = 0; i < list->count; i++) { result = acpi_power_get_context(list->handles[i], &resource); if (result) - return result; + return_VALUE(result); result = acpi_power_get_state(resource); if (result) - return result; + return_VALUE(result); *state = resource->state; @@ -168,7 +172,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n", *state ? "on" : "off")); - return result; + return_VALUE(result); } static int acpi_power_on(acpi_handle handle) @@ -178,10 +182,11 @@ static int acpi_power_on(acpi_handle handle) struct acpi_device *device = NULL; struct acpi_power_resource *resource = NULL; + ACPI_FUNCTION_TRACE("acpi_power_on"); result = acpi_power_get_context(handle, &resource); if (result) - return result; + return_VALUE(result); resource->references++; @@ -189,27 +194,29 @@ static int acpi_power_on(acpi_handle handle) || (resource->state == ACPI_POWER_RESOURCE_STATE_ON)) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already on\n", resource->name)); - return 0; + return_VALUE(0); } - status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL); + status = acpi_evaluate_object(resource->handle, "_ON", NULL, NULL); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); result = acpi_power_get_state(resource); if (result) - return result; + return_VALUE(result); if (resource->state != ACPI_POWER_RESOURCE_STATE_ON) - return -ENOEXEC; + return_VALUE(-ENOEXEC); /* Update the power resource's _device_ power state */ - device = resource->device; - resource->device->power.state = ACPI_STATE_D0; + result = acpi_bus_get_device(resource->handle, &device); + if (result) + return_VALUE(result); + device->power.state = ACPI_STATE_D0; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n", resource->name)); - return 0; + return_VALUE(0); } static int acpi_power_off_device(acpi_handle handle) @@ -219,10 +226,11 @@ static int acpi_power_off_device(acpi_handle handle) struct acpi_device *device = NULL; struct acpi_power_resource *resource = NULL; + ACPI_FUNCTION_TRACE("acpi_power_off_device"); result = acpi_power_get_context(handle, &resource); if (result) - return result; + return_VALUE(result); if (resource->references) resource->references--; @@ -231,33 +239,35 @@ static int acpi_power_off_device(acpi_handle handle) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is still in use, dereferencing\n", device->pnp.bus_id)); - return 0; + return_VALUE(0); } if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n", device->pnp.bus_id)); - return 0; + return_VALUE(0); } - status = acpi_evaluate_object(resource->device->handle, "_OFF", NULL, NULL); + status = acpi_evaluate_object(resource->handle, "_OFF", NULL, NULL); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); result = acpi_power_get_state(resource); if (result) - return result; + return_VALUE(result); if (resource->state != ACPI_POWER_RESOURCE_STATE_OFF) - return -ENOEXEC; + return_VALUE(-ENOEXEC); /* Update the power resource's _device_ power state */ - device = resource->device; + result = acpi_bus_get_device(resource->handle, &device); + if (result) + return_VALUE(result); device->power.state = ACPI_STATE_D3; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n", resource->name)); - return 0; + return_VALUE(0); } /* @@ -273,29 +283,31 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev) int i; int ret = 0; + ACPI_FUNCTION_TRACE("acpi_enable_wakeup_device_power"); if (!dev || !dev->wakeup.flags.valid) - return -1; + return_VALUE(-1); arg.integer.value = 1; /* Open power resource */ for (i = 0; i < dev->wakeup.resources.count; i++) { ret = acpi_power_on(dev->wakeup.resources.handles[i]); if (ret) { - printk(KERN_ERR PREFIX "Transition power state\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error transition power state\n")); dev->wakeup.flags.valid = 0; - return -1; + return_VALUE(-1); } } /* Execute PSW */ status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL); if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { - printk(KERN_ERR PREFIX "Evaluate _PSW\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluate _PSW\n")); dev->wakeup.flags.valid = 0; ret = -1; } - return ret; + return_VALUE(ret); } /* @@ -311,30 +323,32 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev) int i; int ret = 0; + ACPI_FUNCTION_TRACE("acpi_disable_wakeup_device_power"); if (!dev || !dev->wakeup.flags.valid) - return -1; + return_VALUE(-1); arg.integer.value = 0; /* Execute PSW */ status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL); if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { - printk(KERN_ERR PREFIX "Evaluate _PSW\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluate _PSW\n")); dev->wakeup.flags.valid = 0; - return -1; + return_VALUE(-1); } /* Close power resource */ for (i = 0; i < dev->wakeup.resources.count; i++) { ret = acpi_power_off_device(dev->wakeup.resources.handles[i]); if (ret) { - printk(KERN_ERR PREFIX "Transition power state\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error transition power state\n")); dev->wakeup.flags.valid = 0; - return -1; + return_VALUE(-1); } } - return ret; + return_VALUE(ret); } /* -------------------------------------------------------------------------- @@ -348,9 +362,10 @@ int acpi_power_get_inferred_state(struct acpi_device *device) int list_state = 0; int i = 0; + ACPI_FUNCTION_TRACE("acpi_power_get_inferred_state"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); device->power.state = ACPI_STATE_UNKNOWN; @@ -365,17 +380,17 @@ int acpi_power_get_inferred_state(struct acpi_device *device) result = acpi_power_get_list_state(list, &list_state); if (result) - return result; + return_VALUE(result); if (list_state == ACPI_POWER_RESOURCE_STATE_ON) { device->power.state = i; - return 0; + return_VALUE(0); } } device->power.state = ACPI_STATE_D3; - return 0; + return_VALUE(0); } int acpi_power_transition(struct acpi_device *device, int state) @@ -385,13 +400,14 @@ int acpi_power_transition(struct acpi_device *device, int state) struct acpi_handle_list *tl = NULL; /* Target Resources */ int i = 0; + ACPI_FUNCTION_TRACE("acpi_power_transition"); if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3)) - return -EINVAL; + return_VALUE(-EINVAL); if ((device->power.state < ACPI_STATE_D0) || (device->power.state > ACPI_STATE_D3)) - return -ENODEV; + return_VALUE(-ENODEV); cl = &device->power.states[device->power.state].resources; tl = &device->power.states[state].resources; @@ -428,10 +444,11 @@ int acpi_power_transition(struct acpi_device *device, int state) device->power.state = state; end: if (result) - printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n", - device->pnp.bus_id, state); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Error transitioning device [%s] to D%d\n", + device->pnp.bus_id, state)); - return result; + return_VALUE(result); } /* -------------------------------------------------------------------------- @@ -444,6 +461,7 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset) { struct acpi_power_resource *resource = NULL; + ACPI_FUNCTION_TRACE("acpi_power_seq_show"); resource = (struct acpi_power_resource *)seq->private; @@ -470,7 +488,7 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset) resource->order, resource->references); end: - return 0; + return_VALUE(0); } static int acpi_power_open_fs(struct inode *inode, struct file *file) @@ -482,32 +500,36 @@ static int acpi_power_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; + ACPI_FUNCTION_TRACE("acpi_power_add_fs"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_power_dir); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); } /* 'status' [R] */ entry = create_proc_entry(ACPI_POWER_FILE_STATUS, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -EIO; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_POWER_FILE_STATUS)); else { entry->proc_fops = &acpi_power_fops; entry->data = acpi_driver_data(device); } - return 0; + return_VALUE(0); } static int acpi_power_remove_fs(struct acpi_device *device) { + ACPI_FUNCTION_TRACE("acpi_power_remove_fs"); if (acpi_device_dir(device)) { remove_proc_entry(ACPI_POWER_FILE_STATUS, @@ -516,7 +538,7 @@ static int acpi_power_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -531,23 +553,24 @@ static int acpi_power_add(struct acpi_device *device) union acpi_object acpi_object; struct acpi_buffer buffer = { sizeof(acpi_object), &acpi_object }; + ACPI_FUNCTION_TRACE("acpi_power_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); resource = kmalloc(sizeof(struct acpi_power_resource), GFP_KERNEL); if (!resource) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(resource, 0, sizeof(struct acpi_power_resource)); - resource->device = device; + resource->handle = device->handle; strcpy(resource->name, device->pnp.bus_id); strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_POWER_CLASS); acpi_driver_data(device) = resource; /* Evalute the object to get the system level and resource order. */ - status = acpi_evaluate_object(device->handle, NULL, NULL, &buffer); + status = acpi_evaluate_object(resource->handle, NULL, NULL, &buffer); if (ACPI_FAILURE(status)) { result = -ENODEV; goto end; @@ -582,16 +605,17 @@ static int acpi_power_add(struct acpi_device *device) if (result) kfree(resource); - return result; + return_VALUE(result); } static int acpi_power_remove(struct acpi_device *device, int type) { struct acpi_power_resource *resource = NULL; + ACPI_FUNCTION_TRACE("acpi_power_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); resource = (struct acpi_power_resource *)acpi_driver_data(device); @@ -599,30 +623,31 @@ static int acpi_power_remove(struct acpi_device *device, int type) kfree(resource); - return 0; + return_VALUE(0); } static int __init acpi_power_init(void) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_power_init"); if (acpi_disabled) - return 0; + return_VALUE(0); INIT_LIST_HEAD(&acpi_power_resource_list); acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir); if (!acpi_power_dir) - return -ENODEV; + return_VALUE(-ENODEV); result = acpi_bus_register_driver(&acpi_power_driver); if (result < 0) { remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir); - return -ENODEV; + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } subsys_initcall(acpi_power_init); diff --git a/trunk/drivers/acpi/processor_core.c b/trunk/drivers/acpi/processor_core.c index 52674323b14d..decaebb4cbe9 100644 --- a/trunk/drivers/acpi/processor_core.c +++ b/trunk/drivers/acpi/processor_core.c @@ -122,9 +122,10 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) u8 value1 = 0; u8 value2 = 0; + ACPI_FUNCTION_TRACE("acpi_processor_errata_piix4"); if (!dev) - return -EINVAL; + return_VALUE(-EINVAL); /* * Note that 'dev' references the PIIX4 ACPI Controller. @@ -217,7 +218,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Type-F DMA livelock erratum (C3 disabled)\n")); - return 0; + return_VALUE(0); } static int acpi_processor_errata(struct acpi_processor *pr) @@ -225,9 +226,10 @@ static int acpi_processor_errata(struct acpi_processor *pr) int result = 0; struct pci_dev *dev = NULL; + ACPI_FUNCTION_TRACE("acpi_processor_errata"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); /* * PIIX4 @@ -240,7 +242,7 @@ static int acpi_processor_errata(struct acpi_processor *pr) pci_dev_put(dev); } - return result; + return_VALUE(result); } /* -------------------------------------------------------------------------- @@ -256,9 +258,10 @@ static int acpi_processor_set_pdc(struct acpi_processor *pr) struct acpi_object_list *pdc_in = pr->pdc; acpi_status status = AE_OK; + ACPI_FUNCTION_TRACE("acpi_processor_set_pdc"); if (!pdc_in) - return status; + return_VALUE(status); status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL); @@ -266,7 +269,7 @@ static int acpi_processor_set_pdc(struct acpi_processor *pr) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not evaluate _PDC, using legacy perf. control...\n")); - return status; + return_VALUE(status); } /* -------------------------------------------------------------------------- @@ -279,6 +282,7 @@ static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset) { struct acpi_processor *pr = (struct acpi_processor *)seq->private; + ACPI_FUNCTION_TRACE("acpi_processor_info_seq_show"); if (!pr) goto end; @@ -297,7 +301,7 @@ static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset) pr->flags.limit ? "yes" : "no"); end: - return 0; + return_VALUE(0); } static int acpi_processor_info_open_fs(struct inode *inode, struct file *file) @@ -310,12 +314,13 @@ static int acpi_processor_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; + ACPI_FUNCTION_TRACE("acpi_processor_add_fs"); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_processor_dir); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); } acpi_device_dir(device)->owner = THIS_MODULE; @@ -323,7 +328,9 @@ static int acpi_processor_add_fs(struct acpi_device *device) entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -EIO; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_INFO)); else { entry->proc_fops = &acpi_processor_info_fops; entry->data = acpi_driver_data(device); @@ -335,7 +342,9 @@ static int acpi_processor_add_fs(struct acpi_device *device) S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); if (!entry) - return -EIO; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_THROTTLING)); else { entry->proc_fops = &acpi_processor_throttling_fops; entry->data = acpi_driver_data(device); @@ -347,18 +356,21 @@ static int acpi_processor_add_fs(struct acpi_device *device) S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); if (!entry) - return -EIO; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_LIMIT)); else { entry->proc_fops = &acpi_processor_limit_fops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } - return 0; + return_VALUE(0); } static int acpi_processor_remove_fs(struct acpi_device *device) { + ACPI_FUNCTION_TRACE("acpi_processor_remove_fs"); if (acpi_device_dir(device)) { remove_proc_entry(ACPI_PROCESSOR_FILE_INFO, @@ -371,7 +383,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* Use the acpiid in MADT to map cpus in case of SMP */ @@ -418,9 +430,10 @@ static int acpi_processor_get_info(struct acpi_processor *pr) int cpu_index; static int cpu0_initialized; + ACPI_FUNCTION_TRACE("acpi_processor_get_info"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); if (num_online_cpus() > 1) errata.smp = TRUE; @@ -446,8 +459,9 @@ static int acpi_processor_get_info(struct acpi_processor *pr) */ status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); if (ACPI_FAILURE(status)) { - printk(KERN_ERR PREFIX "Evaluating processor object\n"); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error evaluating processor object\n")); + return_VALUE(-ENODEV); } /* @@ -476,10 +490,10 @@ static int acpi_processor_get_info(struct acpi_processor *pr) if (cpu_index == -1) { if (ACPI_FAILURE (acpi_processor_hotadd_init(pr->handle, &pr->id))) { - printk(KERN_ERR PREFIX - "Getting cpuindex for acpiid 0x%x\n", - pr->acpi_id); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error getting cpuindex for acpiid 0x%x\n", + pr->acpi_id)); + return_VALUE(-ENODEV); } } @@ -489,8 +503,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr) if (!object.processor.pblk_address) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n")); else if (object.processor.pblk_length != 6) - printk(KERN_ERR PREFIX "Invalid PBLK length [%d]\n", - object.processor.pblk_length); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid PBLK length [%d]\n", + object.processor.pblk_length)); else { pr->throttling.address = object.processor.pblk_address; pr->throttling.duty_offset = acpi_fadt.duty_offset; @@ -514,7 +528,7 @@ static int acpi_processor_get_info(struct acpi_processor *pr) acpi_processor_get_throttling_info(pr); acpi_processor_get_limit_info(pr); - return 0; + return_VALUE(0); } static void *processor_device_array[NR_CPUS]; @@ -525,13 +539,14 @@ static int acpi_processor_start(struct acpi_device *device) acpi_status status = AE_OK; struct acpi_processor *pr; + ACPI_FUNCTION_TRACE("acpi_processor_start"); pr = acpi_driver_data(device); result = acpi_processor_get_info(pr); if (result) { /* Processor is physically not present */ - return 0; + return_VALUE(0); } BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0)); @@ -545,7 +560,7 @@ static int acpi_processor_start(struct acpi_device *device) processor_device_array[pr->id] != (void *)device) { printk(KERN_WARNING "BIOS reported wrong ACPI id" "for the processor\n"); - return -ENODEV; + return_VALUE(-ENODEV); } processor_device_array[pr->id] = (void *)device; @@ -557,6 +572,10 @@ static int acpi_processor_start(struct acpi_device *device) status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, acpi_processor_notify, pr); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing device notify handler\n")); + } /* _PDC call should be done before doing anything else (if reqd.). */ arch_acpi_processor_init_pdc(pr); @@ -573,7 +592,7 @@ static int acpi_processor_start(struct acpi_device *device) end: - return result; + return_VALUE(result); } static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) @@ -581,12 +600,13 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) struct acpi_processor *pr = (struct acpi_processor *)data; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_processor_notify"); if (!pr) - return; + return_VOID; if (acpi_bus_get_device(pr->handle, &device)) - return; + return_VOID; switch (event) { case ACPI_PROCESSOR_NOTIFY_PERFORMANCE: @@ -604,20 +624,21 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) break; } - return; + return_VOID; } static int acpi_processor_add(struct acpi_device *device) { struct acpi_processor *pr = NULL; + ACPI_FUNCTION_TRACE("acpi_processor_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); pr = kmalloc(sizeof(struct acpi_processor), GFP_KERNEL); if (!pr) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(pr, 0, sizeof(struct acpi_processor)); pr->handle = device->handle; @@ -625,7 +646,7 @@ static int acpi_processor_add(struct acpi_device *device) strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); acpi_driver_data(device) = pr; - return 0; + return_VALUE(0); } static int acpi_processor_remove(struct acpi_device *device, int type) @@ -633,26 +654,31 @@ static int acpi_processor_remove(struct acpi_device *device, int type) acpi_status status = AE_OK; struct acpi_processor *pr = NULL; + ACPI_FUNCTION_TRACE("acpi_processor_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); pr = (struct acpi_processor *)acpi_driver_data(device); if (pr->id >= NR_CPUS) { kfree(pr); - return 0; + return_VALUE(0); } if (type == ACPI_BUS_REMOVAL_EJECT) { if (acpi_processor_handle_eject(pr)) - return -EINVAL; + return_VALUE(-EINVAL); } acpi_processor_power_exit(pr, device); status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, acpi_processor_notify); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); + } acpi_processor_remove_fs(device); @@ -660,7 +686,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type) kfree(pr); - return 0; + return_VALUE(0); } #ifdef CONFIG_ACPI_HOTPLUG_CPU @@ -675,13 +701,15 @@ static int is_processor_present(acpi_handle handle) acpi_status status; unsigned long sta = 0; + ACPI_FUNCTION_TRACE("is_processor_present"); status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) { - ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present")); - return 0; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Processor Device is not present\n")); + return_VALUE(0); } - return 1; + return_VALUE(1); } static @@ -691,29 +719,30 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device) struct acpi_device *pdev; struct acpi_processor *pr; + ACPI_FUNCTION_TRACE("acpi_processor_device_add"); if (acpi_get_parent(handle, &phandle)) { - return -ENODEV; + return_VALUE(-ENODEV); } if (acpi_bus_get_device(phandle, &pdev)) { - return -ENODEV; + return_VALUE(-ENODEV); } if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_PROCESSOR)) { - return -ENODEV; + return_VALUE(-ENODEV); } acpi_bus_start(*device); pr = acpi_driver_data(*device); if (!pr) - return -ENODEV; + return_VALUE(-ENODEV); if ((pr->id >= 0) && (pr->id < NR_CPUS)) { kobject_uevent(&(*device)->kobj, KOBJ_ONLINE); } - return 0; + return_VALUE(0); } static void @@ -723,6 +752,7 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data) struct acpi_device *device = NULL; int result; + ACPI_FUNCTION_TRACE("acpi_processor_hotplug_notify"); switch (event) { case ACPI_NOTIFY_BUS_CHECK: @@ -737,14 +767,15 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data) if (acpi_bus_get_device(handle, &device)) { result = acpi_processor_device_add(handle, &device); if (result) - printk(KERN_ERR PREFIX - "Unable to add the device\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to add the device\n")); break; } pr = acpi_driver_data(device); if (!pr) { - printk(KERN_ERR PREFIX "Driver data is NULL\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Driver data is NULL\n")); break; } @@ -757,8 +788,9 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data) if ((!result) && ((pr->id >= 0) && (pr->id < NR_CPUS))) { kobject_uevent(&device->kobj, KOBJ_ONLINE); } else { - printk(KERN_ERR PREFIX "Device [%s] failed to start\n", - acpi_device_bid(device)); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Device [%s] failed to start\n", + acpi_device_bid(device))); } break; case ACPI_NOTIFY_EJECT_REQUEST: @@ -766,15 +798,15 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data) "received ACPI_NOTIFY_EJECT_REQUEST\n")); if (acpi_bus_get_device(handle, &device)) { - printk(KERN_ERR PREFIX - "Device don't exist, dropping EJECT\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Device don't exist, dropping EJECT\n")); break; } pr = acpi_driver_data(device); if (!pr) { - printk(KERN_ERR PREFIX - "Driver data is NULL, dropping EJECT\n"); - return; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Driver data is NULL, dropping EJECT\n")); + return_VOID; } if ((pr->id < NR_CPUS) && (cpu_present(pr->id))) @@ -786,7 +818,7 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data) break; } - return; + return_VOID; } static acpi_status @@ -825,20 +857,21 @@ processor_walk_namespace_cb(acpi_handle handle, static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu) { + ACPI_FUNCTION_TRACE("acpi_processor_hotadd_init"); if (!is_processor_present(handle)) { - return AE_ERROR; + return_VALUE(AE_ERROR); } if (acpi_map_lsapic(handle, p_cpu)) - return AE_ERROR; + return_VALUE(AE_ERROR); if (arch_register_cpu(*p_cpu)) { acpi_unmap_lsapic(*p_cpu); - return AE_ERROR; + return_VALUE(AE_ERROR); } - return AE_OK; + return_VALUE(AE_OK); } static int acpi_processor_handle_eject(struct acpi_processor *pr) @@ -895,19 +928,20 @@ static int __init acpi_processor_init(void) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_processor_init"); memset(&processors, 0, sizeof(processors)); memset(&errata, 0, sizeof(errata)); acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); if (!acpi_processor_dir) - return 0; + return_VALUE(0); acpi_processor_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_processor_driver); if (result < 0) { remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); - return 0; + return_VALUE(0); } acpi_processor_install_hotplug_notify(); @@ -916,11 +950,12 @@ static int __init acpi_processor_init(void) acpi_processor_ppc_init(); - return 0; + return_VALUE(0); } static void __exit acpi_processor_exit(void) { + ACPI_FUNCTION_TRACE("acpi_processor_exit"); acpi_processor_ppc_exit(); @@ -932,7 +967,7 @@ static void __exit acpi_processor_exit(void) remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); - return; + return_VOID; } module_init(acpi_processor_init); diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c index 8e9c26aae8fe..8a74bf3efd8e 100644 --- a/trunk/drivers/acpi/processor_idle.c +++ b/trunk/drivers/acpi/processor_idle.c @@ -3,7 +3,7 @@ * * Copyright (C) 2001, 2002 Andy Grover * Copyright (C) 2001, 2002 Paul Diefenbaugh - * Copyright (C) 2004, 2005 Dominik Brodowski + * Copyright (C) 2004 Dominik Brodowski * Copyright (C) 2004 Anil S Keshavamurthy * - Added processor hotplug support * Copyright (C) 2005 Venkatesh Pallipadi @@ -97,9 +97,6 @@ static int set_max_cstate(struct dmi_system_id *id) /* Actually this shouldn't be __cpuinitdata, would be better to fix the callers to only run once -AK */ static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = { - { set_max_cstate, "IBM ThinkPad R40e", { - DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), - DMI_MATCH(DMI_BIOS_VERSION,"1SET70WW")}, (void *)1}, { set_max_cstate, "IBM ThinkPad R40e", { DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW")}, (void *)1}, @@ -264,15 +261,21 @@ static void acpi_processor_idle(void) u32 bm_status = 0; unsigned long diff = jiffies - pr->power.bm_check_timestamp; - if (diff > 31) - diff = 31; + if (diff > 32) + diff = 32; - pr->power.bm_activity <<= diff; + while (diff) { + /* if we didn't get called, assume there was busmaster activity */ + diff--; + if (diff) + pr->power.bm_activity |= 0x1; + pr->power.bm_activity <<= 1; + } acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status, ACPI_MTX_DO_NOT_LOCK); if (bm_status) { - pr->power.bm_activity |= 0x1; + pr->power.bm_activity++; acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, 1, ACPI_MTX_DO_NOT_LOCK); } @@ -284,16 +287,16 @@ static void acpi_processor_idle(void) else if (errata.piix4.bmisx) { if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01) || (inb_p(errata.piix4.bmisx + 0x0A) & 0x01)) - pr->power.bm_activity |= 0x1; + pr->power.bm_activity++; } pr->power.bm_check_timestamp = jiffies; /* - * If bus mastering is or was active this jiffy, demote + * Apply bus mastering demotion policy. Automatically demote * to avoid a faulty transition. Note that the processor * won't enter a low-power state during this call (to this - * function) but should upon the next. + * funciton) but should upon the next. * * TBD: A better policy might be to fallback to the demotion * state (use it for this quantum only) istead of @@ -301,8 +304,7 @@ static void acpi_processor_idle(void) * qualification. This may, however, introduce DMA * issues (e.g. floppy DMA transfer overrun/underrun). */ - if ((pr->power.bm_activity & 0x1) && - cx->demotion.threshold.bm) { + if (pr->power.bm_activity & cx->demotion.threshold.bm) { local_irq_enable(); next_state = cx->demotion.state; goto end; @@ -320,6 +322,8 @@ static void acpi_processor_idle(void) cx = &pr->power.states[ACPI_STATE_C1]; #endif + cx->usage++; + /* * Sleep: * ------ @@ -361,9 +365,7 @@ static void acpi_processor_idle(void) t1 = inl(acpi_fadt.xpm_tmr_blk.address); /* Invoke C2 */ inb(cx->address); - /* Dummy wait op - must do something useless after P_LVL2 read - because chipsets cannot guarantee that STPCLK# signal - gets asserted in time to freeze execution properly. */ + /* Dummy op - must do something useless after P_LVL2 read */ t2 = inl(acpi_fadt.xpm_tmr_blk.address); /* Get end time (ticks) */ t2 = inl(acpi_fadt.xpm_tmr_blk.address); @@ -401,7 +403,7 @@ static void acpi_processor_idle(void) t1 = inl(acpi_fadt.xpm_tmr_blk.address); /* Invoke C3 */ inb(cx->address); - /* Dummy wait op (see above) */ + /* Dummy op - must do something useless after P_LVL3 read */ t2 = inl(acpi_fadt.xpm_tmr_blk.address); /* Get end time (ticks) */ t2 = inl(acpi_fadt.xpm_tmr_blk.address); @@ -428,9 +430,6 @@ static void acpi_processor_idle(void) local_irq_enable(); return; } - cx->usage++; - if ((cx->type != ACPI_STATE_C1) && (sleep_ticks > 0)) - cx->time += sleep_ticks; next_state = pr->power.state; @@ -518,9 +517,10 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr) struct acpi_processor_cx *higher = NULL; struct acpi_processor_cx *cx; + ACPI_FUNCTION_TRACE("acpi_processor_set_power_policy"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); /* * This function sets the default Cx state policy (OS idle handler). @@ -544,7 +544,7 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr) } if (!state_is_set) - return -ENODEV; + return_VALUE(-ENODEV); /* demotion */ for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { @@ -583,17 +583,18 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr) higher = cx; } - return 0; + return_VALUE(0); } static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) { + ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_fadt"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); if (!pr->pblk) - return -ENODEV; + return_VALUE(-ENODEV); /* if info is obtained from pblk/fadt, type equals state */ pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2; @@ -605,7 +606,7 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) * an SMP system. */ if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up) - return -ENODEV; + return_VALUE(-ENODEV); #endif /* determine C2 and C3 address from pblk */ @@ -621,11 +622,12 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) pr->power.states[ACPI_STATE_C2].address, pr->power.states[ACPI_STATE_C3].address)); - return 0; + return_VALUE(0); } static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr) { + ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1"); /* Zero initialize all the C-states info. */ memset(pr->power.states, 0, sizeof(pr->power.states)); @@ -638,7 +640,7 @@ static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr) pr->power.states[ACPI_STATE_C0].valid = 1; pr->power.states[ACPI_STATE_C1].valid = 1; - return 0; + return_VALUE(0); } static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) @@ -650,9 +652,10 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *cst; + ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_cst"); if (nocst) - return -ENODEV; + return_VALUE(-ENODEV); current_count = 1; @@ -664,14 +667,15 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer); if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _CST, giving up\n")); - return -ENODEV; + return_VALUE(-ENODEV); } cst = (union acpi_object *)buffer.pointer; /* There must be at least 2 elements */ if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) { - printk(KERN_ERR PREFIX "not enough elements in _CST\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "not enough elements in _CST\n")); status = -EFAULT; goto end; } @@ -680,7 +684,8 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) /* Validate number of power states. */ if (count < 1 || count != cst->package.count - 1) { - printk(KERN_ERR PREFIX "count given by _CST is not valid\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "count given by _CST is not valid\n")); status = -EFAULT; goto end; } @@ -768,16 +773,17 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) status = -EFAULT; end: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); - return status; + return_VALUE(status); } static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx) { + ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c2"); if (!cx->address) - return; + return_VOID; /* * C2 latency must be less than or equal to 100 @@ -786,7 +792,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx) else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "latency too large [%d]\n", cx->latency)); - return; + return_VOID; } /* @@ -796,7 +802,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx) cx->valid = 1; cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency); - return; + return_VOID; } static void acpi_processor_power_verify_c3(struct acpi_processor *pr, @@ -804,9 +810,10 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, { static int bm_check_flag; + ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c3"); if (!cx->address) - return; + return_VOID; /* * C3 latency must be less than or equal to 1000 @@ -815,7 +822,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, else if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "latency too large [%d]\n", cx->latency)); - return; + return_VOID; } /* @@ -828,7 +835,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, else if (errata.piix4.fdma) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "C3 not supported on PIIX4 with Type-F DMA\n")); - return; + return_VOID; } /* All the logic here assumes flags.bm_check is same across all CPUs */ @@ -845,7 +852,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, if (!pr->flags.bm_control) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "C3 support requires bus mastering control\n")); - return; + return_VOID; } } else { /* @@ -856,7 +863,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cache invalidation should work properly" " for C3 to be enabled on SMP systems\n")); - return; + return_VOID; } acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0, ACPI_MTX_DO_NOT_LOCK); @@ -871,7 +878,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, cx->valid = 1; cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency); - return; + return_VOID; } static int acpi_processor_power_verify(struct acpi_processor *pr) @@ -930,6 +937,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) unsigned int i; int result; + ACPI_FUNCTION_TRACE("acpi_processor_get_power_info"); /* NOTE: the idle thread may not be running while calling * this function */ @@ -952,7 +960,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) */ result = acpi_processor_set_power_policy(pr); if (result) - return result; + return_VALUE(result); /* * if one state of type C2 or C3 is available, mark this @@ -966,23 +974,24 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) } } - return 0; + return_VALUE(0); } int acpi_processor_cst_has_changed(struct acpi_processor *pr) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_processor_cst_has_changed"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); if (nocst) { - return -ENODEV; + return_VALUE(-ENODEV); } if (!pr->flags.power_setup_done) - return -ENODEV; + return_VALUE(-ENODEV); /* Fall back to the default idle loop */ pm_idle = pm_idle_save; @@ -993,7 +1002,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) if ((pr->flags.power == 1) && (pr->flags.power_setup_done)) pm_idle = acpi_processor_idle; - return result; + return_VALUE(result); } /* proc interface */ @@ -1003,6 +1012,7 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) struct acpi_processor *pr = (struct acpi_processor *)seq->private; unsigned int i; + ACPI_FUNCTION_TRACE("acpi_processor_power_seq_show"); if (!pr) goto end; @@ -1054,14 +1064,13 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) else seq_puts(seq, "demotion[--] "); - seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n", + seq_printf(seq, "latency[%03d] usage[%08d]\n", pr->power.states[i].latency, - pr->power.states[i].usage, - pr->power.states[i].time); + pr->power.states[i].usage); } end: - return 0; + return_VALUE(0); } static int acpi_processor_power_open_fs(struct inode *inode, struct file *file) @@ -1085,6 +1094,7 @@ int acpi_processor_power_init(struct acpi_processor *pr, struct proc_dir_entry *entry = NULL; unsigned int i; + ACPI_FUNCTION_TRACE("acpi_processor_power_init"); if (!first_run) { dmi_check_system(processor_power_dmi_table); @@ -1096,14 +1106,14 @@ int acpi_processor_power_init(struct acpi_processor *pr, } if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); if (acpi_fadt.cst_cnt && !nocst) { status = acpi_os_write_port(acpi_fadt.smi_cmd, acpi_fadt.cst_cnt, 8); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "Notifying BIOS of _CST ability failed")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Notifying BIOS of _CST ability failed\n")); } } @@ -1132,7 +1142,9 @@ int acpi_processor_power_init(struct acpi_processor *pr, entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -EIO; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_POWER)); else { entry->proc_fops = &acpi_processor_power_fops; entry->data = acpi_driver_data(device); @@ -1141,12 +1153,13 @@ int acpi_processor_power_init(struct acpi_processor *pr, pr->flags.power_setup_done = 1; - return 0; + return_VALUE(0); } int acpi_processor_power_exit(struct acpi_processor *pr, struct acpi_device *device) { + ACPI_FUNCTION_TRACE("acpi_processor_power_exit"); pr->flags.power_setup_done = 0; @@ -1166,5 +1179,5 @@ int acpi_processor_power_exit(struct acpi_processor *pr, cpu_idle_wait(); } - return 0; + return_VALUE(0); } diff --git a/trunk/drivers/acpi/processor_perflib.c b/trunk/drivers/acpi/processor_perflib.c index 7ba5e49ab302..41aaaba74b19 100644 --- a/trunk/drivers/acpi/processor_perflib.c +++ b/trunk/drivers/acpi/processor_perflib.c @@ -108,9 +108,10 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) acpi_status status = 0; unsigned long ppc = 0; + ACPI_FUNCTION_TRACE("acpi_processor_get_platform_limit"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); /* * _PPC indicates the maximum state currently supported by the platform @@ -122,13 +123,13 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) acpi_processor_ppc_status |= PPC_IN_USE; if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC")); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PPC\n")); + return_VALUE(-ENODEV); } pr->performance_platform_limit = (int)ppc; - return 0; + return_VALUE(0); } int acpi_processor_ppc_has_changed(struct acpi_processor *pr) @@ -167,17 +168,18 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr) union acpi_object *pct = NULL; union acpi_object obj = { 0 }; + ACPI_FUNCTION_TRACE("acpi_processor_get_performance_control"); status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT")); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PCT\n")); + return_VALUE(-ENODEV); } pct = (union acpi_object *)buffer.pointer; if (!pct || (pct->type != ACPI_TYPE_PACKAGE) || (pct->package.count != 2)) { - printk(KERN_ERR PREFIX "Invalid _PCT data\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PCT data\n")); result = -EFAULT; goto end; } @@ -191,7 +193,8 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr) if ((obj.type != ACPI_TYPE_BUFFER) || (obj.buffer.length < sizeof(struct acpi_pct_register)) || (obj.buffer.pointer == NULL)) { - printk(KERN_ERR PREFIX "Invalid _PCT data (control_register)\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid _PCT data (control_register)\n")); result = -EFAULT; goto end; } @@ -207,7 +210,8 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr) if ((obj.type != ACPI_TYPE_BUFFER) || (obj.buffer.length < sizeof(struct acpi_pct_register)) || (obj.buffer.pointer == NULL)) { - printk(KERN_ERR PREFIX "Invalid _PCT data (status_register)\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid _PCT data (status_register)\n")); result = -EFAULT; goto end; } @@ -216,9 +220,9 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr) sizeof(struct acpi_pct_register)); end: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); - return result; + return_VALUE(result); } static int acpi_processor_get_performance_states(struct acpi_processor *pr) @@ -231,16 +235,17 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) union acpi_object *pss = NULL; int i; + ACPI_FUNCTION_TRACE("acpi_processor_get_performance_states"); status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS")); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PSS\n")); + return_VALUE(-ENODEV); } pss = (union acpi_object *)buffer.pointer; if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) { - printk(KERN_ERR PREFIX "Invalid _PSS data\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n")); result = -EFAULT; goto end; } @@ -269,7 +274,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) status = acpi_extract_package(&(pss->package.elements[i]), &format, &state); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid _PSS data\n")); result = -EFAULT; kfree(pr->performance->states); goto end; @@ -285,8 +291,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) (u32) px->control, (u32) px->status)); if (!px->core_frequency) { - printk(KERN_ERR PREFIX - "Invalid _PSS data: freq is zero\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid _PSS data: freq is zero\n")); result = -EFAULT; kfree(pr->performance->states); goto end; @@ -294,9 +300,9 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) } end: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); - return result; + return_VALUE(result); } static int acpi_processor_get_performance_info(struct acpi_processor *pr) @@ -305,30 +311,31 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr) acpi_status status = AE_OK; acpi_handle handle = NULL; + ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info"); if (!pr || !pr->performance || !pr->handle) - return -EINVAL; + return_VALUE(-EINVAL); status = acpi_get_handle(pr->handle, "_PCT", &handle); if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "ACPI-based processor performance control unavailable\n")); - return -ENODEV; + return_VALUE(-ENODEV); } result = acpi_processor_get_performance_control(pr); if (result) - return result; + return_VALUE(result); result = acpi_processor_get_performance_states(pr); if (result) - return result; + return_VALUE(result); result = acpi_processor_get_platform_limit(pr); if (result) - return result; + return_VALUE(result); - return 0; + return_VALUE(0); } int acpi_processor_notify_smm(struct module *calling_module) @@ -336,12 +343,13 @@ int acpi_processor_notify_smm(struct module *calling_module) acpi_status status; static int is_done = 0; + ACPI_FUNCTION_TRACE("acpi_processor_notify_smm"); if (!(acpi_processor_ppc_status & PPC_REGISTERED)) - return -EBUSY; + return_VALUE(-EBUSY); if (!try_module_get(calling_module)) - return -EINVAL; + return_VALUE(-EINVAL); /* is_done is set to negative if an error occured, * and to postitive if _no_ error occured, but SMM @@ -350,10 +358,10 @@ int acpi_processor_notify_smm(struct module *calling_module) */ if (is_done > 0) { module_put(calling_module); - return 0; + return_VALUE(0); } else if (is_done < 0) { module_put(calling_module); - return is_done; + return_VALUE(is_done); } is_done = -EIO; @@ -362,7 +370,7 @@ int acpi_processor_notify_smm(struct module *calling_module) if ((!acpi_fadt.smi_cmd) || (!acpi_fadt.pstate_cnt)) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_cnt\n")); module_put(calling_module); - return 0; + return_VALUE(0); } ACPI_DEBUG_PRINT((ACPI_DB_INFO, @@ -379,12 +387,12 @@ int acpi_processor_notify_smm(struct module *calling_module) status = acpi_os_write_port(acpi_fadt.smi_cmd, (u32) acpi_fadt.pstate_cnt, 8); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "Failed to write pstate_cnt [0x%x] to " - "smi_cmd [0x%x]", acpi_fadt.pstate_cnt, - acpi_fadt.smi_cmd)); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Failed to write pstate_cnt [0x%x] to " + "smi_cmd [0x%x]\n", acpi_fadt.pstate_cnt, + acpi_fadt.smi_cmd)); module_put(calling_module); - return status; + return_VALUE(status); } /* Success. If there's no _PPC, we need to fear nothing, so @@ -394,7 +402,7 @@ int acpi_processor_notify_smm(struct module *calling_module) if (!(acpi_processor_ppc_status & PPC_IN_USE)) module_put(calling_module); - return 0; + return_VALUE(0); } EXPORT_SYMBOL(acpi_processor_notify_smm); @@ -415,6 +423,7 @@ static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset) struct acpi_processor *pr = (struct acpi_processor *)seq->private; int i; + ACPI_FUNCTION_TRACE("acpi_processor_perf_seq_show"); if (!pr) goto end; @@ -438,7 +447,7 @@ static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset) (u32) pr->performance->states[i].transition_latency); end: - return 0; + return_VALUE(0); } static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file) @@ -460,22 +469,23 @@ acpi_processor_write_performance(struct file *file, unsigned int new_state = 0; struct cpufreq_policy policy; + ACPI_FUNCTION_TRACE("acpi_processor_write_performance"); if (!pr || (count > sizeof(state_string) - 1)) - return -EINVAL; + return_VALUE(-EINVAL); perf = pr->performance; if (!perf) - return -EINVAL; + return_VALUE(-EINVAL); if (copy_from_user(state_string, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); state_string[count] = '\0'; new_state = simple_strtoul(state_string, NULL, 0); if (new_state >= perf->state_count) - return -EINVAL; + return_VALUE(-EINVAL); cpufreq_get_policy(&policy, pr->id); @@ -485,9 +495,9 @@ acpi_processor_write_performance(struct file *file, result = cpufreq_set_policy(&policy); if (result) - return result; + return_VALUE(result); - return count; + return_VALUE(count); } static void acpi_cpufreq_add_file(struct acpi_processor *pr) @@ -495,36 +505,42 @@ static void acpi_cpufreq_add_file(struct acpi_processor *pr) struct proc_dir_entry *entry = NULL; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile"); if (acpi_bus_get_device(pr->handle, &device)) - return; + return_VOID; /* add file 'performance' [R/W] */ entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); - if (entry){ + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_PERFORMANCE)); + else { acpi_processor_perf_fops.write = acpi_processor_write_performance; entry->proc_fops = &acpi_processor_perf_fops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } - return; + return_VOID; } static void acpi_cpufreq_remove_file(struct acpi_processor *pr) { struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile"); if (acpi_bus_get_device(pr->handle, &device)) - return; + return_VOID; /* remove file 'performance' */ remove_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, acpi_device_dir(device)); - return; + return_VOID; } #else @@ -592,7 +608,7 @@ static int acpi_processor_get_psd(struct acpi_processor *pr) } end: - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); return result; } @@ -682,12 +698,12 @@ int acpi_processor_preregister_performance( /* Validate the Domain info */ count_target = pdomain->num_processors; count = 1; - if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL) + if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL || + pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL) { pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL; - else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL) - pr->performance->shared_type = CPUFREQ_SHARED_TYPE_HW; - else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY) + } else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY) { pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY; + } for_each_possible_cpu(j) { if (i == j) @@ -768,21 +784,22 @@ acpi_processor_register_performance(struct acpi_processor_performance { struct acpi_processor *pr; + ACPI_FUNCTION_TRACE("acpi_processor_register_performance"); if (!(acpi_processor_ppc_status & PPC_REGISTERED)) - return -EINVAL; + return_VALUE(-EINVAL); mutex_lock(&performance_mutex); pr = processors[cpu]; if (!pr) { mutex_unlock(&performance_mutex); - return -ENODEV; + return_VALUE(-ENODEV); } if (pr->performance) { mutex_unlock(&performance_mutex); - return -EBUSY; + return_VALUE(-EBUSY); } WARN_ON(!performance); @@ -792,13 +809,13 @@ acpi_processor_register_performance(struct acpi_processor_performance if (acpi_processor_get_performance_info(pr)) { pr->performance = NULL; mutex_unlock(&performance_mutex); - return -EIO; + return_VALUE(-EIO); } acpi_cpufreq_add_file(pr); mutex_unlock(&performance_mutex); - return 0; + return_VALUE(0); } EXPORT_SYMBOL(acpi_processor_register_performance); @@ -809,13 +826,14 @@ acpi_processor_unregister_performance(struct acpi_processor_performance { struct acpi_processor *pr; + ACPI_FUNCTION_TRACE("acpi_processor_unregister_performance"); mutex_lock(&performance_mutex); pr = processors[cpu]; if (!pr) { mutex_unlock(&performance_mutex); - return; + return_VOID; } if (pr->performance) @@ -826,7 +844,7 @@ acpi_processor_unregister_performance(struct acpi_processor_performance mutex_unlock(&performance_mutex); - return; + return_VOID; } EXPORT_SYMBOL(acpi_processor_unregister_performance); diff --git a/trunk/drivers/acpi/processor_thermal.c b/trunk/drivers/acpi/processor_thermal.c index ef5e0f6efdba..f99ad05cd6a2 100644 --- a/trunk/drivers/acpi/processor_thermal.c +++ b/trunk/drivers/acpi/processor_thermal.c @@ -54,12 +54,13 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr) u16 px = 0; u16 tx = 0; + ACPI_FUNCTION_TRACE("acpi_processor_apply_limit"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); if (!pr->flags.limit) - return -ENODEV; + return_VALUE(-ENODEV); if (pr->flags.throttling) { if (pr->limit.user.tx > tx) @@ -81,9 +82,9 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr) end: if (result) - printk(KERN_ERR PREFIX "Unable to set limit\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to set limit\n")); - return result; + return_VALUE(result); } #ifdef CONFIG_CPU_FREQ @@ -199,18 +200,19 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type) struct acpi_device *device = NULL; int tx = 0, max_tx_px = 0; + ACPI_FUNCTION_TRACE("acpi_processor_set_thermal_limit"); if ((type < ACPI_PROCESSOR_LIMIT_NONE) || (type > ACPI_PROCESSOR_LIMIT_DECREMENT)) - return -EINVAL; + return_VALUE(-EINVAL); result = acpi_bus_get_device(handle, &device); if (result) - return result; + return_VALUE(result); pr = (struct acpi_processor *)acpi_driver_data(device); if (!pr) - return -ENODEV; + return_VALUE(-ENODEV); /* Thermal limits are always relative to the current Px/Tx state. */ if (pr->flags.throttling) @@ -287,28 +289,30 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type) result = acpi_processor_apply_limit(pr); if (result) - printk(KERN_ERR PREFIX "Unable to set thermal limit\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to set thermal limit\n")); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n", pr->limit.thermal.px, pr->limit.thermal.tx)); } else result = 0; if (max_tx_px) - return 1; + return_VALUE(1); else - return result; + return_VALUE(result); } int acpi_processor_get_limit_info(struct acpi_processor *pr) { + ACPI_FUNCTION_TRACE("acpi_processor_get_limit_info"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); if (pr->flags.throttling) pr->flags.limit = 1; - return 0; + return_VALUE(0); } /* /proc interface */ @@ -317,6 +321,7 @@ static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset) { struct acpi_processor *pr = (struct acpi_processor *)seq->private; + ACPI_FUNCTION_TRACE("acpi_processor_limit_seq_show"); if (!pr) goto end; @@ -334,7 +339,7 @@ static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset) pr->limit.thermal.px, pr->limit.thermal.tx); end: - return 0; + return_VALUE(0); } static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file) @@ -354,33 +359,36 @@ static ssize_t acpi_processor_write_limit(struct file * file, int px = 0; int tx = 0; + ACPI_FUNCTION_TRACE("acpi_processor_write_limit"); if (!pr || (count > sizeof(limit_string) - 1)) { - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n")); + return_VALUE(-EINVAL); } if (copy_from_user(limit_string, buffer, count)) { - return -EFAULT; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n")); + return_VALUE(-EFAULT); } limit_string[count] = '\0'; if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) { - printk(KERN_ERR PREFIX "Invalid data format\n"); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n")); + return_VALUE(-EINVAL); } if (pr->flags.throttling) { if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) { - printk(KERN_ERR PREFIX "Invalid tx\n"); - return -EINVAL; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid tx\n")); + return_VALUE(-EINVAL); } pr->limit.user.tx = tx; } result = acpi_processor_apply_limit(pr); - return count; + return_VALUE(count); } struct file_operations acpi_processor_limit_fops = { diff --git a/trunk/drivers/acpi/processor_throttling.c b/trunk/drivers/acpi/processor_throttling.c index d044ec519db0..b966549ec000 100644 --- a/trunk/drivers/acpi/processor_throttling.c +++ b/trunk/drivers/acpi/processor_throttling.c @@ -55,12 +55,13 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr) u32 duty_mask = 0; u32 duty_value = 0; + ACPI_FUNCTION_TRACE("acpi_processor_get_throttling"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); if (!pr->flags.throttling) - return -ENODEV; + return_VALUE(-ENODEV); pr->throttling.state = 0; @@ -92,7 +93,7 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr) "Throttling state is T%d (%d%% throttling applied)\n", state, pr->throttling.states[state].performance)); - return 0; + return_VALUE(0); } int acpi_processor_set_throttling(struct acpi_processor *pr, int state) @@ -101,18 +102,19 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) u32 duty_mask = 0; u32 duty_value = 0; + ACPI_FUNCTION_TRACE("acpi_processor_set_throttling"); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); if ((state < 0) || (state > (pr->throttling.state_count - 1))) - return -EINVAL; + return_VALUE(-EINVAL); if (!pr->flags.throttling) - return -ENODEV; + return_VALUE(-ENODEV); if (state == pr->throttling.state) - return 0; + return_VALUE(0); /* * Calculate the duty_value and duty_mask. @@ -163,7 +165,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) (pr->throttling.states[state].performance ? pr-> throttling.states[state].performance / 10 : 0))); - return 0; + return_VALUE(0); } int acpi_processor_get_throttling_info(struct acpi_processor *pr) @@ -172,6 +174,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) int step = 0; int i = 0; + ACPI_FUNCTION_TRACE("acpi_processor_get_throttling_info"); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", @@ -180,21 +183,21 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) pr->throttling.duty_width)); if (!pr) - return -EINVAL; + return_VALUE(-EINVAL); /* TBD: Support ACPI 2.0 objects */ if (!pr->throttling.address) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n")); - return 0; + return_VALUE(0); } else if (!pr->throttling.duty_width) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n")); - return 0; + return_VALUE(0); } /* TBD: Support duty_cycle values that span bit 4. */ else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) { - printk(KERN_WARNING PREFIX "duty_cycle spans bit 4\n"); - return 0; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "duty_cycle spans bit 4\n")); + return_VALUE(0); } /* @@ -205,7 +208,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) if (errata.piix4.throttle) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Throttling not supported on PIIX4 A- or B-step\n")); - return 0; + return_VALUE(0); } pr->throttling.state_count = 1 << acpi_fadt.duty_width; @@ -251,7 +254,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) if (result) pr->flags.throttling = 0; - return result; + return_VALUE(result); } /* proc interface */ @@ -263,6 +266,7 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq, int i = 0; int result = 0; + ACPI_FUNCTION_TRACE("acpi_processor_throttling_seq_show"); if (!pr) goto end; @@ -292,7 +296,7 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq, throttling.states[i].performance / 10 : 0)); end: - return 0; + return_VALUE(0); } static int acpi_processor_throttling_open_fs(struct inode *inode, @@ -311,12 +315,13 @@ static ssize_t acpi_processor_write_throttling(struct file * file, struct acpi_processor *pr = (struct acpi_processor *)m->private; char state_string[12] = { '\0' }; + ACPI_FUNCTION_TRACE("acpi_processor_write_throttling"); if (!pr || (count > sizeof(state_string) - 1)) - return -EINVAL; + return_VALUE(-EINVAL); if (copy_from_user(state_string, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); state_string[count] = '\0'; @@ -324,9 +329,9 @@ static ssize_t acpi_processor_write_throttling(struct file * file, simple_strtoul(state_string, NULL, 0)); if (result) - return result; + return_VALUE(result); - return count; + return_VALUE(count); } struct file_operations acpi_processor_throttling_fops = { diff --git a/trunk/drivers/acpi/sbs.c b/trunk/drivers/acpi/sbs.c deleted file mode 100644 index db7b350a5035..000000000000 --- a/trunk/drivers/acpi/sbs.c +++ /dev/null @@ -1,1766 +0,0 @@ -/* - * acpi_sbs.c - ACPI Smart Battery System Driver ($Revision: 1.16 $) - * - * Copyright (c) 2005 Rich Townsend - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "i2c_ec.h" - -#define DEF_CAPACITY_UNIT 3 -#define MAH_CAPACITY_UNIT 1 -#define MWH_CAPACITY_UNIT 2 -#define CAPACITY_UNIT DEF_CAPACITY_UNIT - -#define REQUEST_UPDATE_MODE 1 -#define QUEUE_UPDATE_MODE 2 - -#define DATA_TYPE_COMMON 0 -#define DATA_TYPE_INFO 1 -#define DATA_TYPE_STATE 2 -#define DATA_TYPE_ALARM 3 -#define DATA_TYPE_AC_STATE 4 - -extern struct proc_dir_entry *acpi_lock_ac_dir(void); -extern struct proc_dir_entry *acpi_lock_battery_dir(void); -extern void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); -extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); - -#define ACPI_SBS_COMPONENT 0x00080000 -#define ACPI_SBS_CLASS "sbs" -#define ACPI_AC_CLASS "ac_adapter" -#define ACPI_BATTERY_CLASS "battery" -#define ACPI_SBS_HID "ACPI0002" -#define ACPI_SBS_DRIVER_NAME "ACPI Smart Battery System Driver" -#define ACPI_SBS_DEVICE_NAME "Smart Battery System" -#define ACPI_SBS_FILE_INFO "info" -#define ACPI_SBS_FILE_STATE "state" -#define ACPI_SBS_FILE_ALARM "alarm" -#define ACPI_BATTERY_DIR_NAME "BAT%i" -#define ACPI_AC_DIR_NAME "AC0" -#define ACPI_SBC_SMBUS_ADDR 0x9 -#define ACPI_SBSM_SMBUS_ADDR 0xa -#define ACPI_SB_SMBUS_ADDR 0xb -#define ACPI_SBS_AC_NOTIFY_STATUS 0x80 -#define ACPI_SBS_BATTERY_NOTIFY_STATUS 0x80 -#define ACPI_SBS_BATTERY_NOTIFY_INFO 0x81 - -#define _COMPONENT ACPI_SBS_COMPONENT - -#define MAX_SBS_BAT 4 -#define MAX_SMBUS_ERR 1 - -ACPI_MODULE_NAME("acpi_sbs"); - -MODULE_AUTHOR("Rich Townsend"); -MODULE_DESCRIPTION("Smart Battery System ACPI interface driver"); -MODULE_LICENSE("GPL"); - -static struct semaphore sbs_sem; - -#define UPDATE_MODE QUEUE_UPDATE_MODE -/* REQUEST_UPDATE_MODE QUEUE_UPDATE_MODE */ -#define UPDATE_INFO_MODE 0 -#define UPDATE_TIME 60 -#define UPDATE_TIME2 0 - -static int capacity_mode = CAPACITY_UNIT; -static int update_mode = UPDATE_MODE; -static int update_info_mode = UPDATE_INFO_MODE; -static int update_time = UPDATE_TIME; -static int update_time2 = UPDATE_TIME2; - -module_param(capacity_mode, int, CAPACITY_UNIT); -module_param(update_mode, int, UPDATE_MODE); -module_param(update_info_mode, int, UPDATE_INFO_MODE); -module_param(update_time, int, UPDATE_TIME); -module_param(update_time2, int, UPDATE_TIME2); - -static int acpi_sbs_add(struct acpi_device *device); -static int acpi_sbs_remove(struct acpi_device *device, int type); -static void acpi_battery_smbus_err_handler(struct acpi_ec_smbus *smbus); -static void acpi_sbs_update_queue(void *data); - -static struct acpi_driver acpi_sbs_driver = { - .name = ACPI_SBS_DRIVER_NAME, - .class = ACPI_SBS_CLASS, - .ids = ACPI_SBS_HID, - .ops = { - .add = acpi_sbs_add, - .remove = acpi_sbs_remove, - }, -}; - -struct acpi_battery_info { - int capacity_mode; - s16 full_charge_capacity; - s16 design_capacity; - s16 design_voltage; - int vscale; - int ipscale; - s16 serial_number; - char manufacturer_name[I2C_SMBUS_BLOCK_MAX + 3]; - char device_name[I2C_SMBUS_BLOCK_MAX + 3]; - char device_chemistry[I2C_SMBUS_BLOCK_MAX + 3]; -}; - -struct acpi_battery_state { - s16 voltage; - s16 amperage; - s16 remaining_capacity; - s16 average_time_to_empty; - s16 average_time_to_full; - s16 battery_status; -}; - -struct acpi_battery_alarm { - s16 remaining_capacity; -}; - -struct acpi_battery { - int alive; - int battery_present; - int id; - int init_state; - struct acpi_sbs *sbs; - struct acpi_battery_info info; - struct acpi_battery_state state; - struct acpi_battery_alarm alarm; - struct proc_dir_entry *battery_entry; -}; - -struct acpi_sbs { - acpi_handle handle; - struct acpi_device *device; - struct acpi_ec_smbus *smbus; - int sbsm_present; - int sbsm_batteries_supported; - int ac_present; - struct proc_dir_entry *ac_entry; - struct acpi_battery battery[MAX_SBS_BAT]; - int update_info_mode; - int zombie; - int update_time; - int update_time2; - struct timer_list update_timer; -}; - -static void acpi_update_delay(struct acpi_sbs *sbs); -static int acpi_sbs_update_run(struct acpi_sbs *sbs, int data_type); - -/* -------------------------------------------------------------------------- - SMBus Communication - -------------------------------------------------------------------------- */ - -static void acpi_battery_smbus_err_handler(struct acpi_ec_smbus *smbus) -{ - union i2c_smbus_data data; - int result = 0; - char *err_str; - int err_number; - - data.word = 0; - - result = smbus->adapter.algo-> - smbus_xfer(&smbus->adapter, - ACPI_SB_SMBUS_ADDR, - 0, I2C_SMBUS_READ, 0x16, I2C_SMBUS_BLOCK_DATA, &data); - - err_number = (data.word & 0x000f); - - switch (data.word & 0x000f) { - case 0x0000: - err_str = "unexpected bus error"; - break; - case 0x0001: - err_str = "busy"; - break; - case 0x0002: - err_str = "reserved command"; - break; - case 0x0003: - err_str = "unsupported command"; - break; - case 0x0004: - err_str = "access denied"; - break; - case 0x0005: - err_str = "overflow/underflow"; - break; - case 0x0006: - err_str = "bad size"; - break; - case 0x0007: - err_str = "unknown error"; - break; - default: - err_str = "unrecognized error"; - } - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "%s: ret %i, err %i\n", err_str, result, err_number)); -} - -static int -acpi_sbs_smbus_read_word(struct acpi_ec_smbus *smbus, int addr, int func, - u16 * word, - void (*err_handler) (struct acpi_ec_smbus * smbus)) -{ - union i2c_smbus_data data; - int result = 0; - int i; - - if (err_handler == NULL) { - err_handler = acpi_battery_smbus_err_handler; - } - - for (i = 0; i < MAX_SMBUS_ERR; i++) { - result = - smbus->adapter.algo->smbus_xfer(&smbus->adapter, addr, 0, - I2C_SMBUS_READ, func, - I2C_SMBUS_WORD_DATA, &data); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "try %i: smbus->adapter.algo->smbus_xfer() failed\n", - i)); - if (err_handler) { - err_handler(smbus); - } - } else { - *word = data.word; - break; - } - } - - return result; -} - -static int -acpi_sbs_smbus_read_str(struct acpi_ec_smbus *smbus, int addr, int func, - char *str, - void (*err_handler) (struct acpi_ec_smbus * smbus)) -{ - union i2c_smbus_data data; - int result = 0; - int i; - - if (err_handler == NULL) { - err_handler = acpi_battery_smbus_err_handler; - } - - for (i = 0; i < MAX_SMBUS_ERR; i++) { - result = - smbus->adapter.algo->smbus_xfer(&smbus->adapter, addr, 0, - I2C_SMBUS_READ, func, - I2C_SMBUS_BLOCK_DATA, - &data); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "try %i: smbus->adapter.algo->smbus_xfer() failed\n", - i)); - if (err_handler) { - err_handler(smbus); - } - } else { - strncpy(str, (const char *)data.block + 1, - data.block[0]); - str[data.block[0]] = 0; - break; - } - } - - return result; -} - -static int -acpi_sbs_smbus_write_word(struct acpi_ec_smbus *smbus, int addr, int func, - int word, - void (*err_handler) (struct acpi_ec_smbus * smbus)) -{ - union i2c_smbus_data data; - int result = 0; - int i; - - if (err_handler == NULL) { - err_handler = acpi_battery_smbus_err_handler; - } - - data.word = word; - - for (i = 0; i < MAX_SMBUS_ERR; i++) { - result = - smbus->adapter.algo->smbus_xfer(&smbus->adapter, addr, 0, - I2C_SMBUS_WRITE, func, - I2C_SMBUS_WORD_DATA, &data); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "try %i: smbus->adapter.algo" - "->smbus_xfer() failed\n", i)); - if (err_handler) { - err_handler(smbus); - } - } else { - break; - } - } - - return result; -} - -/* -------------------------------------------------------------------------- - Smart Battery System Management - -------------------------------------------------------------------------- */ - -/* Smart Battery */ - -static int acpi_sbs_generate_event(struct acpi_device *device, - int event, int state, char *bid, char *class) -{ - char bid_saved[5]; - char class_saved[20]; - int result = 0; - - strcpy(bid_saved, acpi_device_bid(device)); - strcpy(class_saved, acpi_device_class(device)); - - strcpy(acpi_device_bid(device), bid); - strcpy(acpi_device_class(device), class); - - result = acpi_bus_generate_event(device, event, state); - - strcpy(acpi_device_bid(device), bid_saved); - strcpy(acpi_device_class(device), class_saved); - - return result; -} - -static int acpi_battery_get_present(struct acpi_battery *battery) -{ - s16 state; - int result = 0; - int is_present = 0; - - result = acpi_sbs_smbus_read_word(battery->sbs->smbus, - ACPI_SBSM_SMBUS_ADDR, 0x01, - &state, NULL); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed")); - } - if (!result) { - is_present = (state & 0x000f) & (1 << battery->id); - } - battery->battery_present = is_present; - - return result; -} - -static int acpi_battery_is_present(struct acpi_battery *battery) -{ - return (battery->battery_present); -} - -static int acpi_ac_is_present(struct acpi_sbs *sbs) -{ - return (sbs->ac_present); -} - -static int acpi_battery_select(struct acpi_battery *battery) -{ - struct acpi_ec_smbus *smbus = battery->sbs->smbus; - int result = 0; - s16 state; - int foo; - - if (battery->sbs->sbsm_present) { - - /* Take special care not to knobble other nibbles of - * state (aka selector_state), since - * it causes charging to halt on SBSELs */ - - result = - acpi_sbs_smbus_read_word(smbus, ACPI_SBSM_SMBUS_ADDR, 0x01, - &state, NULL); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - foo = (state & 0x0fff) | (1 << (battery->id + 12)); - result = - acpi_sbs_smbus_write_word(smbus, ACPI_SBSM_SMBUS_ADDR, 0x01, - foo, NULL); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_write_word() failed\n")); - goto end; - } - } - - end: - return result; -} - -static int acpi_sbsm_get_info(struct acpi_sbs *sbs) -{ - struct acpi_ec_smbus *smbus = sbs->smbus; - int result = 0; - s16 battery_system_info; - - result = acpi_sbs_smbus_read_word(smbus, ACPI_SBSM_SMBUS_ADDR, 0x04, - &battery_system_info, NULL); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - sbs->sbsm_batteries_supported = battery_system_info & 0x000f; - - end: - - return result; -} - -static int acpi_battery_get_info(struct acpi_battery *battery) -{ - struct acpi_ec_smbus *smbus = battery->sbs->smbus; - int result = 0; - s16 battery_mode; - s16 specification_info; - - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x03, - &battery_mode, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - battery->info.capacity_mode = (battery_mode & 0x8000) >> 15; - - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x10, - &battery->info.full_charge_capacity, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x18, - &battery->info.design_capacity, - &acpi_battery_smbus_err_handler); - - if (result) { - goto end; - } - - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x19, - &battery->info.design_voltage, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x1a, - &specification_info, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - switch ((specification_info & 0x0f00) >> 8) { - case 1: - battery->info.vscale = 10; - break; - case 2: - battery->info.vscale = 100; - break; - case 3: - battery->info.vscale = 1000; - break; - default: - battery->info.vscale = 1; - } - - switch ((specification_info & 0xf000) >> 12) { - case 1: - battery->info.ipscale = 10; - break; - case 2: - battery->info.ipscale = 100; - break; - case 3: - battery->info.ipscale = 1000; - break; - default: - battery->info.ipscale = 1; - } - - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x1c, - &battery->info.serial_number, - &acpi_battery_smbus_err_handler); - if (result) { - goto end; - } - - result = acpi_sbs_smbus_read_str(smbus, ACPI_SB_SMBUS_ADDR, 0x20, - battery->info.manufacturer_name, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_str() failed\n")); - goto end; - } - - result = acpi_sbs_smbus_read_str(smbus, ACPI_SB_SMBUS_ADDR, 0x21, - battery->info.device_name, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_str() failed\n")); - goto end; - } - - result = acpi_sbs_smbus_read_str(smbus, ACPI_SB_SMBUS_ADDR, 0x22, - battery->info.device_chemistry, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_str() failed\n")); - goto end; - } - - end: - return result; -} - -static void acpi_update_delay(struct acpi_sbs *sbs) -{ - if (sbs->zombie) { - return; - } - if (sbs->update_time2 > 0) { - msleep(sbs->update_time2 * 1000); - } -} - -static int acpi_battery_get_state(struct acpi_battery *battery) -{ - struct acpi_ec_smbus *smbus = battery->sbs->smbus; - int result = 0; - - acpi_update_delay(battery->sbs); - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x09, - &battery->state.voltage, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - acpi_update_delay(battery->sbs); - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x0a, - &battery->state.amperage, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - acpi_update_delay(battery->sbs); - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x0f, - &battery->state.remaining_capacity, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - acpi_update_delay(battery->sbs); - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x12, - &battery->state.average_time_to_empty, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - acpi_update_delay(battery->sbs); - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x13, - &battery->state.average_time_to_full, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - acpi_update_delay(battery->sbs); - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x16, - &battery->state.battery_status, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - acpi_update_delay(battery->sbs); - - end: - return result; -} - -static int acpi_battery_get_alarm(struct acpi_battery *battery) -{ - struct acpi_ec_smbus *smbus = battery->sbs->smbus; - int result = 0; - - result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x01, - &battery->alarm.remaining_capacity, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - acpi_update_delay(battery->sbs); - - end: - - return result; -} - -static int acpi_battery_set_alarm(struct acpi_battery *battery, - unsigned long alarm) -{ - struct acpi_ec_smbus *smbus = battery->sbs->smbus; - int result = 0; - s16 battery_mode; - int foo; - - result = acpi_battery_select(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_select() failed\n")); - goto end; - } - - /* If necessary, enable the alarm */ - - if (alarm > 0) { - result = - acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x03, - &battery_mode, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - result = - acpi_sbs_smbus_write_word(smbus, ACPI_SB_SMBUS_ADDR, 0x01, - battery_mode & 0xbfff, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_write_word() failed\n")); - goto end; - } - } - - foo = alarm / (battery->info.capacity_mode ? 10 : 1); - result = acpi_sbs_smbus_write_word(smbus, ACPI_SB_SMBUS_ADDR, 0x01, - foo, - &acpi_battery_smbus_err_handler); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_write_word() failed\n")); - goto end; - } - - end: - - return result; -} - -static int acpi_battery_set_mode(struct acpi_battery *battery) -{ - int result = 0; - s16 battery_mode; - - if (capacity_mode == DEF_CAPACITY_UNIT) { - goto end; - } - - result = acpi_sbs_smbus_read_word(battery->sbs->smbus, - ACPI_SB_SMBUS_ADDR, 0x03, - &battery_mode, NULL); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - if (capacity_mode == MAH_CAPACITY_UNIT) { - battery_mode &= 0x7fff; - } else { - battery_mode |= 0x8000; - } - result = acpi_sbs_smbus_write_word(battery->sbs->smbus, - ACPI_SB_SMBUS_ADDR, 0x03, - battery_mode, NULL); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_write_word() failed\n")); - goto end; - } - - result = acpi_sbs_smbus_read_word(battery->sbs->smbus, - ACPI_SB_SMBUS_ADDR, 0x03, - &battery_mode, NULL); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - end: - return result; -} - -static int acpi_battery_init(struct acpi_battery *battery) -{ - int result = 0; - - result = acpi_battery_select(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_init() failed\n")); - goto end; - } - - result = acpi_battery_set_mode(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_set_mode() failed\n")); - goto end; - } - - result = acpi_battery_get_info(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_get_info() failed\n")); - goto end; - } - - result = acpi_battery_get_state(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_get_state() failed\n")); - goto end; - } - - result = acpi_battery_get_alarm(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_get_alarm() failed\n")); - goto end; - } - - end: - return result; -} - -static int acpi_ac_get_present(struct acpi_sbs *sbs) -{ - struct acpi_ec_smbus *smbus = sbs->smbus; - int result = 0; - s16 charger_status; - - result = acpi_sbs_smbus_read_word(smbus, ACPI_SBC_SMBUS_ADDR, 0x13, - &charger_status, NULL); - - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_smbus_read_word() failed\n")); - goto end; - } - - sbs->ac_present = (charger_status & 0x8000) >> 15; - - end: - - return result; -} - -/* -------------------------------------------------------------------------- - FS Interface (/proc/acpi) - -------------------------------------------------------------------------- */ - -/* Generic Routines */ - -static int -acpi_sbs_generic_add_fs(struct proc_dir_entry **dir, - struct proc_dir_entry *parent_dir, - char *dir_name, - struct file_operations *info_fops, - struct file_operations *state_fops, - struct file_operations *alarm_fops, void *data) -{ - struct proc_dir_entry *entry = NULL; - - if (!*dir) { - *dir = proc_mkdir(dir_name, parent_dir); - if (!*dir) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "proc_mkdir() failed\n")); - return -ENODEV; - } - (*dir)->owner = THIS_MODULE; - } - - /* 'info' [R] */ - if (info_fops) { - entry = create_proc_entry(ACPI_SBS_FILE_INFO, S_IRUGO, *dir); - if (!entry) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "create_proc_entry() failed\n")); - } else { - entry->proc_fops = info_fops; - entry->data = data; - entry->owner = THIS_MODULE; - } - } - - /* 'state' [R] */ - if (state_fops) { - entry = create_proc_entry(ACPI_SBS_FILE_STATE, S_IRUGO, *dir); - if (!entry) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "create_proc_entry() failed\n")); - } else { - entry->proc_fops = state_fops; - entry->data = data; - entry->owner = THIS_MODULE; - } - } - - /* 'alarm' [R/W] */ - if (alarm_fops) { - entry = create_proc_entry(ACPI_SBS_FILE_ALARM, S_IRUGO, *dir); - if (!entry) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "create_proc_entry() failed\n")); - } else { - entry->proc_fops = alarm_fops; - entry->data = data; - entry->owner = THIS_MODULE; - } - } - - return 0; -} - -static void -acpi_sbs_generic_remove_fs(struct proc_dir_entry **dir, - struct proc_dir_entry *parent_dir) -{ - - if (*dir) { - remove_proc_entry(ACPI_SBS_FILE_INFO, *dir); - remove_proc_entry(ACPI_SBS_FILE_STATE, *dir); - remove_proc_entry(ACPI_SBS_FILE_ALARM, *dir); - remove_proc_entry((*dir)->name, parent_dir); - *dir = NULL; - } - -} - -/* Smart Battery Interface */ - -static struct proc_dir_entry *acpi_battery_dir = NULL; - -static int acpi_battery_read_info(struct seq_file *seq, void *offset) -{ - struct acpi_battery *battery = (struct acpi_battery *)seq->private; - int cscale; - int result = 0; - - if (battery->sbs->zombie) { - return -ENODEV; - } - - down(&sbs_sem); - - if (update_mode == REQUEST_UPDATE_MODE) { - result = acpi_sbs_update_run(battery->sbs, DATA_TYPE_INFO); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_update_run() failed\n")); - } - } - - if (acpi_battery_is_present(battery)) { - seq_printf(seq, "present: yes\n"); - } else { - seq_printf(seq, "present: no\n"); - goto end; - } - - if (battery->info.capacity_mode) { - cscale = battery->info.vscale * battery->info.ipscale; - } else { - cscale = battery->info.ipscale; - } - seq_printf(seq, "design capacity: %i%s", - battery->info.design_capacity * cscale, - battery->info.capacity_mode ? "0 mWh\n" : " mAh\n"); - - seq_printf(seq, "last full capacity: %i%s", - battery->info.full_charge_capacity * cscale, - battery->info.capacity_mode ? "0 mWh\n" : " mAh\n"); - - seq_printf(seq, "battery technology: rechargeable\n"); - - seq_printf(seq, "design voltage: %i mV\n", - battery->info.design_voltage * battery->info.vscale); - - seq_printf(seq, "design capacity warning: unknown\n"); - seq_printf(seq, "design capacity low: unknown\n"); - seq_printf(seq, "capacity granularity 1: unknown\n"); - seq_printf(seq, "capacity granularity 2: unknown\n"); - - seq_printf(seq, "model number: %s\n", - battery->info.device_name); - - seq_printf(seq, "serial number: %i\n", - battery->info.serial_number); - - seq_printf(seq, "battery type: %s\n", - battery->info.device_chemistry); - - seq_printf(seq, "OEM info: %s\n", - battery->info.manufacturer_name); - - end: - - up(&sbs_sem); - - return result; -} - -static int acpi_battery_info_open_fs(struct inode *inode, struct file *file) -{ - return single_open(file, acpi_battery_read_info, PDE(inode)->data); -} - -static int acpi_battery_read_state(struct seq_file *seq, void *offset) -{ - struct acpi_battery *battery = (struct acpi_battery *)seq->private; - int result = 0; - int cscale; - int foo; - - if (battery->sbs->zombie) { - return -ENODEV; - } - - down(&sbs_sem); - - if (update_mode == REQUEST_UPDATE_MODE) { - result = acpi_sbs_update_run(battery->sbs, DATA_TYPE_STATE); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_update_run() failed\n")); - } - } - - if (acpi_battery_is_present(battery)) { - seq_printf(seq, "present: yes\n"); - } else { - seq_printf(seq, "present: no\n"); - goto end; - } - - if (battery->info.capacity_mode) { - cscale = battery->info.vscale * battery->info.ipscale; - } else { - cscale = battery->info.ipscale; - } - - if (battery->state.battery_status & 0x0010) { - seq_printf(seq, "capacity state: critical\n"); - } else { - seq_printf(seq, "capacity state: ok\n"); - } - if (battery->state.amperage < 0) { - seq_printf(seq, "charging state: discharging\n"); - foo = battery->state.remaining_capacity * cscale * 60 / - (battery->state.average_time_to_empty == 0 ? 1 : - battery->state.average_time_to_empty); - seq_printf(seq, "present rate: %i%s\n", - foo, battery->info.capacity_mode ? "0 mW" : " mA"); - } else if (battery->state.amperage > 0) { - seq_printf(seq, "charging state: charging\n"); - foo = (battery->info.full_charge_capacity - - battery->state.remaining_capacity) * cscale * 60 / - (battery->state.average_time_to_full == 0 ? 1 : - battery->state.average_time_to_full); - seq_printf(seq, "present rate: %i%s\n", - foo, battery->info.capacity_mode ? "0 mW" : " mA"); - } else { - seq_printf(seq, "charging state: charged\n"); - seq_printf(seq, "present rate: 0 %s\n", - battery->info.capacity_mode ? "mW" : "mA"); - } - - seq_printf(seq, "remaining capacity: %i%s", - battery->state.remaining_capacity * cscale, - battery->info.capacity_mode ? "0 mWh\n" : " mAh\n"); - - seq_printf(seq, "present voltage: %i mV\n", - battery->state.voltage * battery->info.vscale); - - end: - - up(&sbs_sem); - - return result; -} - -static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) -{ - return single_open(file, acpi_battery_read_state, PDE(inode)->data); -} - -static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) -{ - struct acpi_battery *battery = (struct acpi_battery *)seq->private; - int result = 0; - int cscale; - - if (battery->sbs->zombie) { - return -ENODEV; - } - - down(&sbs_sem); - - if (update_mode == REQUEST_UPDATE_MODE) { - result = acpi_sbs_update_run(battery->sbs, DATA_TYPE_ALARM); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_update_run() failed\n")); - } - } - - if (!acpi_battery_is_present(battery)) { - seq_printf(seq, "present: no\n"); - goto end; - } - - if (battery->info.capacity_mode) { - cscale = battery->info.vscale * battery->info.ipscale; - } else { - cscale = battery->info.ipscale; - } - - seq_printf(seq, "alarm: "); - if (battery->alarm.remaining_capacity) { - seq_printf(seq, "%i%s", - battery->alarm.remaining_capacity * cscale, - battery->info.capacity_mode ? "0 mWh\n" : " mAh\n"); - } else { - seq_printf(seq, "disabled\n"); - } - - end: - - up(&sbs_sem); - - return result; -} - -static ssize_t -acpi_battery_write_alarm(struct file *file, const char __user * buffer, - size_t count, loff_t * ppos) -{ - struct seq_file *seq = (struct seq_file *)file->private_data; - struct acpi_battery *battery = (struct acpi_battery *)seq->private; - char alarm_string[12] = { '\0' }; - int result, old_alarm, new_alarm; - - if (battery->sbs->zombie) { - return -ENODEV; - } - - down(&sbs_sem); - - if (!acpi_battery_is_present(battery)) { - result = -ENODEV; - goto end; - } - - if (count > sizeof(alarm_string) - 1) { - result = -EINVAL; - goto end; - } - - if (copy_from_user(alarm_string, buffer, count)) { - result = -EFAULT; - goto end; - } - - alarm_string[count] = 0; - - old_alarm = battery->alarm.remaining_capacity; - new_alarm = simple_strtoul(alarm_string, NULL, 0); - - result = acpi_battery_set_alarm(battery, new_alarm); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_set_alarm() failed\n")); - (void)acpi_battery_set_alarm(battery, old_alarm); - goto end; - } - result = acpi_battery_get_alarm(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_get_alarm() failed\n")); - (void)acpi_battery_set_alarm(battery, old_alarm); - goto end; - } - - end: - up(&sbs_sem); - - if (result) { - return result; - } else { - return count; - } -} - -static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) -{ - return single_open(file, acpi_battery_read_alarm, PDE(inode)->data); -} - -static struct file_operations acpi_battery_info_fops = { - .open = acpi_battery_info_open_fs, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .owner = THIS_MODULE, -}; - -static struct file_operations acpi_battery_state_fops = { - .open = acpi_battery_state_open_fs, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .owner = THIS_MODULE, -}; - -static struct file_operations acpi_battery_alarm_fops = { - .open = acpi_battery_alarm_open_fs, - .read = seq_read, - .write = acpi_battery_write_alarm, - .llseek = seq_lseek, - .release = single_release, - .owner = THIS_MODULE, -}; - -/* Legacy AC Adapter Interface */ - -static struct proc_dir_entry *acpi_ac_dir = NULL; - -static int acpi_ac_read_state(struct seq_file *seq, void *offset) -{ - struct acpi_sbs *sbs = (struct acpi_sbs *)seq->private; - int result; - - if (sbs->zombie) { - return -ENODEV; - } - - down(&sbs_sem); - - if (update_mode == REQUEST_UPDATE_MODE) { - result = acpi_sbs_update_run(sbs, DATA_TYPE_AC_STATE); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_update_run() failed\n")); - } - } - - seq_printf(seq, "state: %s\n", - sbs->ac_present ? "on-line" : "off-line"); - - up(&sbs_sem); - - return 0; -} - -static int acpi_ac_state_open_fs(struct inode *inode, struct file *file) -{ - return single_open(file, acpi_ac_read_state, PDE(inode)->data); -} - -static struct file_operations acpi_ac_state_fops = { - .open = acpi_ac_state_open_fs, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .owner = THIS_MODULE, -}; - -/* -------------------------------------------------------------------------- - Driver Interface - -------------------------------------------------------------------------- */ - -/* Smart Battery */ - -static int acpi_battery_add(struct acpi_sbs *sbs, int id) -{ - int is_present; - int result; - char dir_name[32]; - struct acpi_battery *battery; - - battery = &sbs->battery[id]; - - battery->alive = 0; - - battery->init_state = 0; - battery->id = id; - battery->sbs = sbs; - - result = acpi_battery_select(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_select() failed\n")); - goto end; - } - - result = acpi_battery_get_present(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_get_present() failed\n")); - goto end; - } - - is_present = acpi_battery_is_present(battery); - - if (is_present) { - result = acpi_battery_init(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_init() failed\n")); - goto end; - } - battery->init_state = 1; - } - - (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); - - result = acpi_sbs_generic_add_fs(&battery->battery_entry, - acpi_battery_dir, - dir_name, - &acpi_battery_info_fops, - &acpi_battery_state_fops, - &acpi_battery_alarm_fops, battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_generic_add_fs() failed\n")); - goto end; - } - battery->alive = 1; - - end: - return result; -} - -static void acpi_battery_remove(struct acpi_sbs *sbs, int id) -{ - - if (sbs->battery[id].battery_entry) { - acpi_sbs_generic_remove_fs(&(sbs->battery[id].battery_entry), - acpi_battery_dir); - } -} - -static int acpi_ac_add(struct acpi_sbs *sbs) -{ - int result; - - result = acpi_ac_get_present(sbs); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_ac_get_present() failed\n")); - goto end; - } - - result = acpi_sbs_generic_add_fs(&sbs->ac_entry, - acpi_ac_dir, - ACPI_AC_DIR_NAME, - NULL, &acpi_ac_state_fops, NULL, sbs); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_generic_add_fs() failed\n")); - goto end; - } - - end: - - return result; -} - -static void acpi_ac_remove(struct acpi_sbs *sbs) -{ - - if (sbs->ac_entry) { - acpi_sbs_generic_remove_fs(&sbs->ac_entry, acpi_ac_dir); - } -} - -static void acpi_sbs_update_queue_run(unsigned long data) -{ - acpi_os_execute(OSL_GPE_HANDLER, acpi_sbs_update_queue, (void *)data); -} - -static int acpi_sbs_update_run(struct acpi_sbs *sbs, int data_type) -{ - struct acpi_battery *battery; - int result = 0; - int old_ac_present; - int old_battery_present; - int new_ac_present; - int new_battery_present; - int id; - char dir_name[32]; - int do_battery_init, do_ac_init; - s16 old_remaining_capacity; - - if (sbs->zombie) { - goto end; - } - - old_ac_present = acpi_ac_is_present(sbs); - - result = acpi_ac_get_present(sbs); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_ac_get_present() failed\n")); - } - - new_ac_present = acpi_ac_is_present(sbs); - - do_ac_init = (old_ac_present != new_ac_present); - - if (data_type == DATA_TYPE_AC_STATE) { - goto end; - } - - for (id = 0; id < MAX_SBS_BAT; id++) { - battery = &sbs->battery[id]; - if (battery->alive == 0) { - continue; - } - - old_remaining_capacity = battery->state.remaining_capacity; - - old_battery_present = acpi_battery_is_present(battery); - - result = acpi_battery_select(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_select() failed\n")); - } - if (sbs->zombie) { - goto end; - } - - result = acpi_battery_get_present(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_get_present() failed\n")); - } - if (sbs->zombie) { - goto end; - } - - new_battery_present = acpi_battery_is_present(battery); - - do_battery_init = ((old_battery_present != new_battery_present) - && new_battery_present); - - if (sbs->zombie) { - goto end; - } - if (do_ac_init || do_battery_init || - update_info_mode || sbs->update_info_mode) { - if (sbs->update_info_mode) { - sbs->update_info_mode = 0; - } else { - sbs->update_info_mode = 1; - } - result = acpi_battery_init(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_init() " - "failed\n")); - } - } - if (data_type == DATA_TYPE_INFO) { - continue; - } - - if (sbs->zombie) { - goto end; - } - if (new_battery_present) { - result = acpi_battery_get_alarm(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_get_alarm() " - "failed\n")); - } - if (data_type == DATA_TYPE_ALARM) { - continue; - } - - result = acpi_battery_get_state(battery); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_get_state() " - "failed\n")); - } - } - if (sbs->zombie) { - goto end; - } - if (data_type != DATA_TYPE_COMMON) { - continue; - } - - if (old_battery_present != new_battery_present) { - (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); - result = acpi_sbs_generate_event(sbs->device, - ACPI_SBS_BATTERY_NOTIFY_STATUS, - new_battery_present, - dir_name, - ACPI_BATTERY_CLASS); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_generate_event() " - "failed\n")); - } - } - if (old_remaining_capacity != battery->state.remaining_capacity) { - (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); - result = acpi_sbs_generate_event(sbs->device, - ACPI_SBS_BATTERY_NOTIFY_STATUS, - new_battery_present, - dir_name, - ACPI_BATTERY_CLASS); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_generate_event() failed\n")); - } - } - - } - if (sbs->zombie) { - goto end; - } - if (data_type != DATA_TYPE_COMMON) { - goto end; - } - - if (old_ac_present != new_ac_present) { - result = acpi_sbs_generate_event(sbs->device, - ACPI_SBS_AC_NOTIFY_STATUS, - new_ac_present, - ACPI_AC_DIR_NAME, - ACPI_AC_CLASS); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_generate_event() failed\n")); - } - } - - end: - return result; -} - -static void acpi_sbs_update_queue(void *data) -{ - struct acpi_sbs *sbs = data; - unsigned long delay = -1; - int result; - - if (sbs->zombie) { - goto end; - } - - result = acpi_sbs_update_run(sbs, DATA_TYPE_COMMON); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_update_run() failed\n")); - } - - if (sbs->zombie) { - goto end; - } - - if (update_mode == REQUEST_UPDATE_MODE) { - goto end; - } - - delay = jiffies + HZ * update_time; - sbs->update_timer.data = (unsigned long)data; - sbs->update_timer.function = acpi_sbs_update_queue_run; - sbs->update_timer.expires = delay; - add_timer(&sbs->update_timer); - end: - ; -} - -static int acpi_sbs_add(struct acpi_device *device) -{ - struct acpi_sbs *sbs = NULL; - struct acpi_ec_hc *ec_hc = NULL; - int result, remove_result = 0; - unsigned long sbs_obj; - int id, cnt; - acpi_status status = AE_OK; - - sbs = kmalloc(sizeof(struct acpi_sbs), GFP_KERNEL); - if (!sbs) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "kmalloc() failed\n")); - return -ENOMEM; - } - memset(sbs, 0, sizeof(struct acpi_sbs)); - - cnt = 0; - while (cnt < 10) { - cnt++; - ec_hc = acpi_get_ec_hc(device); - if (ec_hc) { - break; - } - msleep(1000); - } - - if (!ec_hc) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_get_ec_hc() failed: " - "NO driver found for EC HC SMBus\n")); - result = -ENODEV; - goto end; - } - - sbs->device = device; - sbs->smbus = ec_hc->smbus; - - strcpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_SBS_CLASS); - acpi_driver_data(device) = sbs; - - sbs->update_time = 0; - sbs->update_time2 = 0; - - result = acpi_ac_add(sbs); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "acpi_ac_add() failed\n")); - goto end; - } - result = acpi_evaluate_integer(device->handle, "_SBS", NULL, &sbs_obj); - if (ACPI_FAILURE(result)) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_evaluate_integer() failed\n")); - result = -EIO; - goto end; - } - - if (sbs_obj > 0) { - result = acpi_sbsm_get_info(sbs); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbsm_get_info() failed\n")); - goto end; - } - sbs->sbsm_present = 1; - } - if (sbs->sbsm_present == 0) { - result = acpi_battery_add(sbs, 0); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_add() failed\n")); - goto end; - } - } else { - for (id = 0; id < MAX_SBS_BAT; id++) { - if ((sbs->sbsm_batteries_supported & (1 << id))) { - result = acpi_battery_add(sbs, id); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_battery_add() " - "failed\n")); - goto end; - } - } - } - } - - sbs->handle = device->handle; - - init_timer(&sbs->update_timer); - if (update_mode == QUEUE_UPDATE_MODE) { - status = acpi_os_execute(OSL_GPE_HANDLER, - acpi_sbs_update_queue, (void *)sbs); - if (status != AE_OK) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_os_execute() failed\n")); - } - } - sbs->update_time = update_time; - sbs->update_time2 = update_time2; - - printk(KERN_INFO PREFIX "%s [%s]\n", - acpi_device_name(device), acpi_device_bid(device)); - - end: - if (result) { - remove_result = acpi_sbs_remove(device, 0); - if (remove_result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_sbs_remove() failed\n")); - } - } - - return result; -} - -int acpi_sbs_remove(struct acpi_device *device, int type) -{ - struct acpi_sbs *sbs = (struct acpi_sbs *)acpi_driver_data(device); - int id; - - if (!device || !sbs) { - return -EINVAL; - } - - sbs->zombie = 1; - sbs->update_time = 0; - sbs->update_time2 = 0; - del_timer_sync(&sbs->update_timer); - acpi_os_wait_events_complete(NULL); - del_timer_sync(&sbs->update_timer); - - for (id = 0; id < MAX_SBS_BAT; id++) { - acpi_battery_remove(sbs, id); - } - - acpi_ac_remove(sbs); - - kfree(sbs); - - return 0; -} - -static int __init acpi_sbs_init(void) -{ - int result = 0; - - init_MUTEX(&sbs_sem); - - if (capacity_mode != DEF_CAPACITY_UNIT - && capacity_mode != MAH_CAPACITY_UNIT - && capacity_mode != MWH_CAPACITY_UNIT) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "acpi_sbs_init: " - "invalid capacity_mode = %d\n", - capacity_mode)); - return -EINVAL; - } - - acpi_ac_dir = acpi_lock_ac_dir(); - if (!acpi_ac_dir) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_lock_ac_dir() failed\n")); - return -ENODEV; - } - - acpi_battery_dir = acpi_lock_battery_dir(); - if (!acpi_battery_dir) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_lock_battery_dir() failed\n")); - return -ENODEV; - } - - result = acpi_bus_register_driver(&acpi_sbs_driver); - if (result < 0) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "acpi_bus_register_driver() failed\n")); - return -ENODEV; - } - - return 0; -} - -static void __exit acpi_sbs_exit(void) -{ - - acpi_bus_unregister_driver(&acpi_sbs_driver); - - acpi_unlock_ac_dir(acpi_ac_dir); - acpi_ac_dir = NULL; - acpi_unlock_battery_dir(acpi_battery_dir); - acpi_battery_dir = NULL; - - return; -} - -module_init(acpi_sbs_init); -module_exit(acpi_sbs_exit); diff --git a/trunk/drivers/acpi/scan.c b/trunk/drivers/acpi/scan.c index 5fcb50c7b778..f8316a05ede7 100644 --- a/trunk/drivers/acpi/scan.c +++ b/trunk/drivers/acpi/scan.c @@ -162,10 +162,11 @@ static void acpi_device_unregister(struct acpi_device *device, int type) void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context) { + ACPI_FUNCTION_TRACE("acpi_bus_data_handler"); /* TBD */ - return; + return_VOID; } static int acpi_bus_get_power_flags(struct acpi_device *device) @@ -174,6 +175,7 @@ static int acpi_bus_get_power_flags(struct acpi_device *device) acpi_handle handle = NULL; u32 i = 0; + ACPI_FUNCTION_TRACE("acpi_bus_get_power_flags"); /* * Power Management Flags @@ -226,7 +228,7 @@ static int acpi_bus_get_power_flags(struct acpi_device *device) device->power.state = ACPI_STATE_UNKNOWN; - return 0; + return_VALUE(0); } int acpi_match_ids(struct acpi_device *device, char *ids) @@ -304,22 +306,24 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *package = NULL; + ACPI_FUNCTION_TRACE("acpi_bus_get_wakeup_flags"); /* _PRW */ status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRW\n")); goto end; } package = (union acpi_object *)buffer.pointer; status = acpi_bus_extract_wakeup_device_power_package(device, package); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error extracting _PRW package\n")); goto end; } - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); device->wakeup.flags.valid = 1; /* Power button, Lid switch always enable wakeup */ @@ -329,7 +333,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) end: if (ACPI_FAILURE(status)) device->flags.wake_capable = 0; - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -485,18 +489,19 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_bus_driver_init"); if (!device || !driver) - return -EINVAL; + return_VALUE(-EINVAL); if (!driver->ops.add) - return -ENOSYS; + return_VALUE(-ENOSYS); result = driver->ops.add(device); if (result) { device->driver = NULL; acpi_driver_data(device) = NULL; - return result; + return_VALUE(result); } device->driver = driver; @@ -508,7 +513,7 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Driver successfully bound to device\n")); - return 0; + return_VALUE(0); } static int acpi_start_single_object(struct acpi_device *device) @@ -516,9 +521,10 @@ static int acpi_start_single_object(struct acpi_device *device) int result = 0; struct acpi_driver *driver; + ACPI_FUNCTION_TRACE("acpi_start_single_object"); if (!(driver = device->driver)) - return 0; + return_VALUE(0); if (driver->ops.start) { result = driver->ops.start(device); @@ -526,13 +532,14 @@ static int acpi_start_single_object(struct acpi_device *device) driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL); } - return result; + return_VALUE(result); } static void acpi_driver_attach(struct acpi_driver *drv) { struct list_head *node, *next; + ACPI_FUNCTION_TRACE("acpi_driver_attach"); spin_lock(&acpi_device_lock); list_for_each_safe(node, next, &acpi_device_list) { @@ -561,6 +568,7 @@ static void acpi_driver_detach(struct acpi_driver *drv) { struct list_head *node, *next; + ACPI_FUNCTION_TRACE("acpi_driver_detach"); spin_lock(&acpi_device_lock); list_for_each_safe(node, next, &acpi_device_list) { @@ -590,16 +598,17 @@ static void acpi_driver_detach(struct acpi_driver *drv) */ int acpi_bus_register_driver(struct acpi_driver *driver) { + ACPI_FUNCTION_TRACE("acpi_bus_register_driver"); if (acpi_disabled) - return -ENODEV; + return_VALUE(-ENODEV); spin_lock(&acpi_device_lock); list_add_tail(&driver->node, &acpi_bus_drivers); spin_unlock(&acpi_device_lock); acpi_driver_attach(driver); - return 0; + return_VALUE(0); } EXPORT_SYMBOL(acpi_bus_register_driver); @@ -637,6 +646,7 @@ static int acpi_bus_find_driver(struct acpi_device *device) int result = 0; struct list_head *node, *next; + ACPI_FUNCTION_TRACE("acpi_bus_find_driver"); spin_lock(&acpi_device_lock); list_for_each_safe(node, next, &acpi_bus_drivers) { @@ -656,41 +666,19 @@ static int acpi_bus_find_driver(struct acpi_device *device) spin_unlock(&acpi_device_lock); Done: - return result; + return_VALUE(result); } /* -------------------------------------------------------------------------- Device Enumeration -------------------------------------------------------------------------- */ -acpi_status -acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd) -{ - acpi_status status; - acpi_handle tmp; - struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; - union acpi_object *obj; - - status = acpi_get_handle(handle, "_EJD", &tmp); - if (ACPI_FAILURE(status)) - return status; - - status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer); - if (ACPI_SUCCESS(status)) { - obj = buffer.pointer; - status = acpi_get_handle(NULL, obj->string.pointer, ejd); - kfree(buffer.pointer); - } - return status; -} -EXPORT_SYMBOL_GPL(acpi_bus_get_ejd); - - static int acpi_bus_get_flags(struct acpi_device *device) { acpi_status status = AE_OK; acpi_handle temp = NULL; + ACPI_FUNCTION_TRACE("acpi_bus_get_flags"); /* Presence of _STA indicates 'dynamic_status' */ status = acpi_get_handle(device->handle, "_STA", &temp); @@ -736,7 +724,7 @@ static int acpi_bus_get_flags(struct acpi_device *device) /* TBD: Peformance management */ - return 0; + return_VALUE(0); } static void acpi_device_get_busid(struct acpi_device *device, @@ -854,7 +842,7 @@ static void acpi_device_set_id(struct acpi_device *device, printk(KERN_ERR "Memory allocation error\n"); } - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); } static int acpi_device_set_context(struct acpi_device *device, int type) @@ -930,9 +918,10 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice) int result = 0; struct acpi_driver *driver; + ACPI_FUNCTION_TRACE("acpi_bus_remove"); if (!dev) - return -EINVAL; + return_VALUE(-EINVAL); driver = dev->driver; @@ -941,12 +930,12 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice) if (driver->ops.stop) { result = driver->ops.stop(dev, ACPI_BUS_REMOVAL_EJECT); if (result) - return result; + return_VALUE(result); } result = dev->driver->ops.remove(dev, ACPI_BUS_REMOVAL_EJECT); if (result) { - return result; + return_VALUE(result); } atomic_dec(&dev->driver->references); @@ -955,7 +944,7 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice) } if (!rmdevice) - return 0; + return_VALUE(0); if (dev->flags.bus_address) { if ((dev->parent) && (dev->parent->ops.unbind)) @@ -964,7 +953,7 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice) acpi_device_unregister(dev, ACPI_BUS_REMOVAL_EJECT); - return 0; + return_VALUE(0); } static int @@ -974,14 +963,15 @@ acpi_add_single_object(struct acpi_device **child, int result = 0; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_add_single_object"); if (!child) - return -EINVAL; + return_VALUE(-EINVAL); device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL); if (!device) { - printk(KERN_ERR PREFIX "Memory allocation error\n"); - return -ENOMEM; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n")); + return_VALUE(-ENOMEM); } memset(device, 0, sizeof(struct acpi_device)); @@ -1106,7 +1096,7 @@ acpi_add_single_object(struct acpi_device **child, kfree(device); } - return result; + return_VALUE(result); } static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops) @@ -1119,9 +1109,10 @@ static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops) acpi_object_type type = 0; u32 level = 1; + ACPI_FUNCTION_TRACE("acpi_bus_scan"); if (!start) - return -EINVAL; + return_VALUE(-EINVAL); parent = start; phandle = start->handle; @@ -1218,7 +1209,7 @@ static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops) } } - return 0; + return_VALUE(0); } int @@ -1228,6 +1219,7 @@ acpi_bus_add(struct acpi_device **child, int result; struct acpi_bus_ops ops; + ACPI_FUNCTION_TRACE("acpi_bus_add"); result = acpi_add_single_object(child, parent, handle, type); if (!result) { @@ -1235,7 +1227,7 @@ acpi_bus_add(struct acpi_device **child, ops.acpi_op_add = 1; result = acpi_bus_scan(*child, &ops); } - return result; + return_VALUE(result); } EXPORT_SYMBOL(acpi_bus_add); @@ -1245,9 +1237,10 @@ int acpi_bus_start(struct acpi_device *device) int result; struct acpi_bus_ops ops; + ACPI_FUNCTION_TRACE("acpi_bus_start"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); result = acpi_start_single_object(device); if (!result) { @@ -1255,7 +1248,7 @@ int acpi_bus_start(struct acpi_device *device) ops.acpi_op_start = 1; result = acpi_bus_scan(device, &ops); } - return result; + return_VALUE(result); } EXPORT_SYMBOL(acpi_bus_start); @@ -1321,9 +1314,10 @@ static int acpi_bus_scan_fixed(struct acpi_device *root) int result = 0; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed"); if (!root) - return -ENODEV; + return_VALUE(-ENODEV); /* * Enumerate all fixed-feature devices. @@ -1344,7 +1338,7 @@ static int acpi_bus_scan_fixed(struct acpi_device *root) result = acpi_start_single_object(device); } - return result; + return_VALUE(result); } @@ -1433,7 +1427,7 @@ static int acpi_device_resume(struct device * dev) } -static struct bus_type acpi_bus_type = { +struct bus_type acpi_bus_type = { .name = "acpi", .suspend = acpi_device_suspend, .resume = acpi_device_resume, @@ -1446,9 +1440,10 @@ static int __init acpi_scan_init(void) int result; struct acpi_bus_ops ops; + ACPI_FUNCTION_TRACE("acpi_scan_init"); if (acpi_disabled) - return 0; + return_VALUE(0); kset_register(&acpi_namespace_kset); @@ -1493,7 +1488,7 @@ static int __init acpi_scan_init(void) acpi_device_unregister(acpi_root, ACPI_BUS_REMOVAL_NORMAL); Done: - return result; + return_VALUE(result); } subsys_initcall(acpi_scan_init); diff --git a/trunk/drivers/acpi/system.c b/trunk/drivers/acpi/system.c index c3bb7faad75e..a934ac42178d 100644 --- a/trunk/drivers/acpi/system.c +++ b/trunk/drivers/acpi/system.c @@ -47,9 +47,10 @@ extern struct fadt_descriptor acpi_fadt; static int acpi_system_read_info(struct seq_file *seq, void *offset) { + ACPI_FUNCTION_TRACE("acpi_system_read_info"); seq_printf(seq, "version: %x\n", ACPI_CA_VERSION); - return 0; + return_VALUE(0); } static int acpi_system_info_open_fs(struct inode *inode, struct file *file) @@ -79,16 +80,17 @@ acpi_system_read_dsdt(struct file *file, struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL }; ssize_t res; + ACPI_FUNCTION_TRACE("acpi_system_read_dsdt"); status = acpi_get_table(ACPI_TABLE_ID_DSDT, 1, &dsdt); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); res = simple_read_from_buffer(buffer, count, ppos, dsdt.pointer, dsdt.length); - kfree(dsdt.pointer); + acpi_os_free(dsdt.pointer); - return res; + return_VALUE(res); } static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t, @@ -106,16 +108,17 @@ acpi_system_read_fadt(struct file *file, struct acpi_buffer fadt = { ACPI_ALLOCATE_BUFFER, NULL }; ssize_t res; + ACPI_FUNCTION_TRACE("acpi_system_read_fadt"); status = acpi_get_table(ACPI_TABLE_ID_FADT, 1, &fadt); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); res = simple_read_from_buffer(buffer, count, ppos, fadt.pointer, fadt.length); - kfree(fadt.pointer); + acpi_os_free(fadt.pointer); - return res; + return_VALUE(res); } static int __init acpi_system_init(void) @@ -124,9 +127,10 @@ static int __init acpi_system_init(void) int error = 0; char *name; + ACPI_FUNCTION_TRACE("acpi_system_init"); if (acpi_disabled) - return 0; + return_VALUE(0); /* 'info' [R] */ name = ACPI_SYSTEM_FILE_INFO; @@ -154,9 +158,12 @@ static int __init acpi_system_init(void) goto Error; Done: - return error; + return_VALUE(error); Error: + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' proc fs entry\n", name)); + remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir); diff --git a/trunk/drivers/acpi/tables.c b/trunk/drivers/acpi/tables.c index bfb3bfcf9e91..ed5e8816d83d 100644 --- a/trunk/drivers/acpi/tables.c +++ b/trunk/drivers/acpi/tables.c @@ -23,6 +23,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/acpi/thermal.c b/trunk/drivers/acpi/thermal.c index 503c0b99db12..e7fe3a14fdaf 100644 --- a/trunk/drivers/acpi/thermal.c +++ b/trunk/drivers/acpi/thermal.c @@ -162,7 +162,7 @@ struct acpi_thermal_flags { }; struct acpi_thermal { - struct acpi_device * device; + acpi_handle handle; acpi_bus_id name; unsigned long temperature; unsigned long last_temperature; @@ -222,48 +222,51 @@ static int acpi_thermal_get_temperature(struct acpi_thermal *tz) { acpi_status status = AE_OK; + ACPI_FUNCTION_TRACE("acpi_thermal_get_temperature"); if (!tz) - return -EINVAL; + return_VALUE(-EINVAL); tz->last_temperature = tz->temperature; status = - acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tz->temperature); + acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", tz->temperature)); - return 0; + return_VALUE(0); } static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) { acpi_status status = AE_OK; + ACPI_FUNCTION_TRACE("acpi_thermal_get_polling_frequency"); if (!tz) - return -EINVAL; + return_VALUE(-EINVAL); status = - acpi_evaluate_integer(tz->device->handle, "_TZP", NULL, + acpi_evaluate_integer(tz->handle, "_TZP", NULL, &tz->polling_frequency); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n", tz->polling_frequency)); - return 0; + return_VALUE(0); } static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds) { + ACPI_FUNCTION_TRACE("acpi_thermal_set_polling"); if (!tz) - return -EINVAL; + return_VALUE(-EINVAL); tz->polling_frequency = seconds * 10; /* Convert value to deci-seconds */ @@ -271,7 +274,7 @@ static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds) "Polling frequency set to %lu seconds\n", tz->polling_frequency)); - return 0; + return_VALUE(0); } static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode) @@ -281,28 +284,29 @@ static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode) struct acpi_object_list arg_list = { 1, &arg0 }; acpi_handle handle = NULL; + ACPI_FUNCTION_TRACE("acpi_thermal_set_cooling_mode"); if (!tz) - return -EINVAL; + return_VALUE(-EINVAL); - status = acpi_get_handle(tz->device->handle, "_SCP", &handle); + status = acpi_get_handle(tz->handle, "_SCP", &handle); if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n")); - return -ENODEV; + return_VALUE(-ENODEV); } arg0.integer.value = mode; status = acpi_evaluate_object(handle, NULL, &arg_list, NULL); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); tz->cooling_mode = mode; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling mode [%s]\n", mode ? "passive" : "active")); - return 0; + return_VALUE(0); } static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) @@ -310,18 +314,19 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) acpi_status status = AE_OK; int i = 0; + ACPI_FUNCTION_TRACE("acpi_thermal_get_trip_points"); if (!tz) - return -EINVAL; + return_VALUE(-EINVAL); /* Critical Shutdown (required) */ - status = acpi_evaluate_integer(tz->device->handle, "_CRT", NULL, + status = acpi_evaluate_integer(tz->handle, "_CRT", NULL, &tz->trips.critical.temperature); if (ACPI_FAILURE(status)) { tz->trips.critical.flags.valid = 0; - ACPI_EXCEPTION((AE_INFO, status, "No critical threshold")); - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No critical threshold\n")); + return_VALUE(-ENODEV); } else { tz->trips.critical.flags.valid = 1; ACPI_DEBUG_PRINT((ACPI_DB_INFO, @@ -332,7 +337,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) /* Critical Sleep (optional) */ status = - acpi_evaluate_integer(tz->device->handle, "_HOT", NULL, + acpi_evaluate_integer(tz->handle, "_HOT", NULL, &tz->trips.hot.temperature); if (ACPI_FAILURE(status)) { tz->trips.hot.flags.valid = 0; @@ -346,7 +351,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) /* Passive: Processors (optional) */ status = - acpi_evaluate_integer(tz->device->handle, "_PSV", NULL, + acpi_evaluate_integer(tz->handle, "_PSV", NULL, &tz->trips.passive.temperature); if (ACPI_FAILURE(status)) { tz->trips.passive.flags.valid = 0; @@ -355,31 +360,32 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) tz->trips.passive.flags.valid = 1; status = - acpi_evaluate_integer(tz->device->handle, "_TC1", NULL, + acpi_evaluate_integer(tz->handle, "_TC1", NULL, &tz->trips.passive.tc1); if (ACPI_FAILURE(status)) tz->trips.passive.flags.valid = 0; status = - acpi_evaluate_integer(tz->device->handle, "_TC2", NULL, + acpi_evaluate_integer(tz->handle, "_TC2", NULL, &tz->trips.passive.tc2); if (ACPI_FAILURE(status)) tz->trips.passive.flags.valid = 0; status = - acpi_evaluate_integer(tz->device->handle, "_TSP", NULL, + acpi_evaluate_integer(tz->handle, "_TSP", NULL, &tz->trips.passive.tsp); if (ACPI_FAILURE(status)) tz->trips.passive.flags.valid = 0; status = - acpi_evaluate_reference(tz->device->handle, "_PSL", NULL, + acpi_evaluate_reference(tz->handle, "_PSL", NULL, &tz->trips.passive.devices); if (ACPI_FAILURE(status)) tz->trips.passive.flags.valid = 0; if (!tz->trips.passive.flags.valid) - printk(KERN_WARNING PREFIX "Invalid passive threshold\n"); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid passive threshold\n")); else ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found passive threshold [%lu]\n", @@ -393,14 +399,14 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) char name[5] = { '_', 'A', 'C', ('0' + i), '\0' }; status = - acpi_evaluate_integer(tz->device->handle, name, NULL, + acpi_evaluate_integer(tz->handle, name, NULL, &tz->trips.active[i].temperature); if (ACPI_FAILURE(status)) break; name[2] = 'L'; status = - acpi_evaluate_reference(tz->device->handle, name, NULL, + acpi_evaluate_reference(tz->handle, name, NULL, &tz->trips.active[i].devices); if (ACPI_SUCCESS(status)) { tz->trips.active[i].flags.valid = 1; @@ -408,27 +414,29 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) "Found active threshold [%d]:[%lu]\n", i, tz->trips.active[i].temperature)); } else - ACPI_EXCEPTION((AE_INFO, status, - "Invalid active threshold [%d]", i)); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid active threshold [%d]\n", + i)); } - return 0; + return_VALUE(0); } static int acpi_thermal_get_devices(struct acpi_thermal *tz) { acpi_status status = AE_OK; + ACPI_FUNCTION_TRACE("acpi_thermal_get_devices"); if (!tz) - return -EINVAL; + return_VALUE(-EINVAL); status = - acpi_evaluate_reference(tz->device->handle, "_TZD", NULL, &tz->devices); + acpi_evaluate_reference(tz->handle, "_TZD", NULL, &tz->devices); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); - return 0; + return_VALUE(0); } static int acpi_thermal_call_usermode(char *path) @@ -436,9 +444,10 @@ static int acpi_thermal_call_usermode(char *path) char *argv[2] = { NULL, NULL }; char *envp[3] = { NULL, NULL, NULL }; + ACPI_FUNCTION_TRACE("acpi_thermal_call_usermode"); if (!path) - return -EINVAL; + return_VALUE(-EINVAL); argv[0] = path; @@ -448,48 +457,66 @@ static int acpi_thermal_call_usermode(char *path) call_usermodehelper(argv[0], argv, envp, 0); - return 0; + return_VALUE(0); } static int acpi_thermal_critical(struct acpi_thermal *tz) { + int result = 0; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_thermal_critical"); + if (!tz || !tz->trips.critical.flags.valid) - return -EINVAL; + return_VALUE(-EINVAL); if (tz->temperature >= tz->trips.critical.temperature) { - printk(KERN_WARNING PREFIX "Critical trip point\n"); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Critical trip point\n")); tz->trips.critical.flags.enabled = 1; } else if (tz->trips.critical.flags.enabled) tz->trips.critical.flags.enabled = 0; + result = acpi_bus_get_device(tz->handle, &device); + if (result) + return_VALUE(result); + printk(KERN_EMERG "Critical temperature reached (%ld C), shutting down.\n", KELVIN_TO_CELSIUS(tz->temperature)); - acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, + acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL, tz->trips.critical.flags.enabled); acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF); - return 0; + return_VALUE(0); } static int acpi_thermal_hot(struct acpi_thermal *tz) { + int result = 0; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_thermal_hot"); + if (!tz || !tz->trips.hot.flags.valid) - return -EINVAL; + return_VALUE(-EINVAL); if (tz->temperature >= tz->trips.hot.temperature) { - printk(KERN_WARNING PREFIX "Hot trip point\n"); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Hot trip point\n")); tz->trips.hot.flags.enabled = 1; } else if (tz->trips.hot.flags.enabled) tz->trips.hot.flags.enabled = 0; - acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, + result = acpi_bus_get_device(tz->handle, &device); + if (result) + return_VALUE(result); + + acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_HOT, tz->trips.hot.flags.enabled); /* TBD: Call user-mode "sleep(S4)" function */ - return 0; + return_VALUE(0); } static void acpi_thermal_passive(struct acpi_thermal *tz) @@ -499,6 +526,7 @@ static void acpi_thermal_passive(struct acpi_thermal *tz) int trend = 0; int i = 0; + ACPI_FUNCTION_TRACE("acpi_thermal_passive"); if (!tz || !tz->trips.passive.flags.valid) return; @@ -587,6 +615,7 @@ static void acpi_thermal_active(struct acpi_thermal *tz) int j = 0; unsigned long maxtemp = 0; + ACPI_FUNCTION_TRACE("acpi_thermal_active"); if (!tz) return; @@ -613,10 +642,10 @@ static void acpi_thermal_active(struct acpi_thermal *tz) handles[j], ACPI_STATE_D0); if (result) { - printk(KERN_WARNING PREFIX - "Unable to turn cooling device [%p] 'on'\n", - active->devices. - handles[j]); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Unable to turn cooling device [%p] 'on'\n", + active->devices. + handles[j])); continue; } active->flags.enabled = 1; @@ -638,9 +667,9 @@ static void acpi_thermal_active(struct acpi_thermal *tz) result = acpi_bus_set_power(active->devices.handles[j], ACPI_STATE_D3); if (result) { - printk(KERN_WARNING PREFIX - "Unable to turn cooling device [%p] 'off'\n", - active->devices.handles[j]); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Unable to turn cooling device [%p] 'off'\n", + active->devices.handles[j])); continue; } active->flags.enabled = 0; @@ -668,17 +697,18 @@ static void acpi_thermal_check(void *data) int i = 0; struct acpi_thermal_state state; + ACPI_FUNCTION_TRACE("acpi_thermal_check"); if (!tz) { - printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); - return; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); + return_VOID; } state = tz->state; result = acpi_thermal_get_temperature(tz); if (result) - return; + return_VOID; memset(&tz->state, 0, sizeof(tz->state)); @@ -767,7 +797,7 @@ static void acpi_thermal_check(void *data) } } - return; + return_VOID; } /* -------------------------------------------------------------------------- @@ -780,6 +810,7 @@ static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset) { struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; + ACPI_FUNCTION_TRACE("acpi_thermal_state_seq_show"); if (!tz) goto end; @@ -802,7 +833,7 @@ static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset) } end: - return 0; + return_VALUE(0); } static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file) @@ -815,6 +846,7 @@ static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset) int result = 0; struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; + ACPI_FUNCTION_TRACE("acpi_thermal_temp_seq_show"); if (!tz) goto end; @@ -827,7 +859,7 @@ static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset) KELVIN_TO_CELSIUS(tz->temperature)); end: - return 0; + return_VALUE(0); } static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file) @@ -841,6 +873,7 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) int i = 0; int j = 0; + ACPI_FUNCTION_TRACE("acpi_thermal_trip_seq_show"); if (!tz) goto end; @@ -880,7 +913,7 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) } end: - return 0; + return_VALUE(0); } static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file) @@ -901,25 +934,28 @@ acpi_thermal_write_trip_points(struct file *file, int *active; int i = 0; + ACPI_FUNCTION_TRACE("acpi_thermal_write_trip_points"); limit_string = kmalloc(ACPI_THERMAL_MAX_LIMIT_STR_LEN, GFP_KERNEL); if (!limit_string) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN); active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL); if (!active) { kfree(limit_string); - return -ENOMEM; + return_VALUE(-ENOMEM); } if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n")); count = -EINVAL; goto end; } if (copy_from_user(limit_string, buffer, count)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n")); count = -EFAULT; goto end; } @@ -932,6 +968,7 @@ acpi_thermal_write_trip_points(struct file *file, &active[5], &active[6], &active[7], &active[8], &active[9]); if (!(num >= 5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n")); count = -EINVAL; goto end; } @@ -948,13 +985,14 @@ acpi_thermal_write_trip_points(struct file *file, end: kfree(active); kfree(limit_string); - return count; + return_VALUE(count); } static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset) { struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; + ACPI_FUNCTION_TRACE("acpi_thermal_cooling_seq_show"); if (!tz) goto end; @@ -970,7 +1008,7 @@ static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset) tz->cooling_mode ? "passive" : "active"); end: - return 0; + return_VALUE(0); } static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file) @@ -989,15 +1027,16 @@ acpi_thermal_write_cooling_mode(struct file *file, int result = 0; char mode_string[12] = { '\0' }; + ACPI_FUNCTION_TRACE("acpi_thermal_write_cooling_mode"); if (!tz || (count > sizeof(mode_string) - 1)) - return -EINVAL; + return_VALUE(-EINVAL); if (!tz->flags.cooling_mode) - return -ENODEV; + return_VALUE(-ENODEV); if (copy_from_user(mode_string, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); mode_string[count] = '\0'; @@ -1005,17 +1044,18 @@ acpi_thermal_write_cooling_mode(struct file *file, simple_strtoul(mode_string, NULL, 0)); if (result) - return result; + return_VALUE(result); acpi_thermal_check(tz); - return count; + return_VALUE(count); } static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset) { struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; + ACPI_FUNCTION_TRACE("acpi_thermal_polling_seq_show"); if (!tz) goto end; @@ -1029,7 +1069,7 @@ static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset) (tz->polling_frequency / 10)); end: - return 0; + return_VALUE(0); } static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file) @@ -1049,12 +1089,13 @@ acpi_thermal_write_polling(struct file *file, char polling_string[12] = { '\0' }; int seconds = 0; + ACPI_FUNCTION_TRACE("acpi_thermal_write_polling"); if (!tz || (count > sizeof(polling_string) - 1)) - return -EINVAL; + return_VALUE(-EINVAL); if (copy_from_user(polling_string, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); polling_string[count] = '\0'; @@ -1062,23 +1103,24 @@ acpi_thermal_write_polling(struct file *file, result = acpi_thermal_set_polling(tz, seconds); if (result) - return result; + return_VALUE(result); acpi_thermal_check(tz); - return count; + return_VALUE(count); } static int acpi_thermal_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; + ACPI_FUNCTION_TRACE("acpi_thermal_add_fs"); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_thermal_dir); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); acpi_device_dir(device)->owner = THIS_MODULE; } @@ -1086,7 +1128,9 @@ static int acpi_thermal_add_fs(struct acpi_device *device) entry = create_proc_entry(ACPI_THERMAL_FILE_STATE, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_STATE)); else { entry->proc_fops = &acpi_thermal_state_fops; entry->data = acpi_driver_data(device); @@ -1097,7 +1141,9 @@ static int acpi_thermal_add_fs(struct acpi_device *device) entry = create_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE, S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_TEMPERATURE)); else { entry->proc_fops = &acpi_thermal_temp_fops; entry->data = acpi_driver_data(device); @@ -1109,7 +1155,9 @@ static int acpi_thermal_add_fs(struct acpi_device *device) S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_TRIP_POINTS)); else { entry->proc_fops = &acpi_thermal_trip_fops; entry->data = acpi_driver_data(device); @@ -1121,7 +1169,9 @@ static int acpi_thermal_add_fs(struct acpi_device *device) S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_COOLING_MODE)); else { entry->proc_fops = &acpi_thermal_cooling_fops; entry->data = acpi_driver_data(device); @@ -1133,18 +1183,21 @@ static int acpi_thermal_add_fs(struct acpi_device *device) S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_POLLING_FREQ)); else { entry->proc_fops = &acpi_thermal_polling_fops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } - return 0; + return_VALUE(0); } static int acpi_thermal_remove_fs(struct acpi_device *device) { + ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs"); if (acpi_device_dir(device)) { remove_proc_entry(ACPI_THERMAL_FILE_POLLING_FREQ, @@ -1161,7 +1214,7 @@ static int acpi_thermal_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -1173,11 +1226,13 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data) struct acpi_thermal *tz = (struct acpi_thermal *)data; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_thermal_notify"); if (!tz) - return; + return_VOID; - device = tz->device; + if (acpi_bus_get_device(tz->handle, &device)) + return_VOID; switch (event) { case ACPI_THERMAL_NOTIFY_TEMPERATURE: @@ -1199,26 +1254,27 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data) break; } - return; + return_VOID; } static int acpi_thermal_get_info(struct acpi_thermal *tz) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_thermal_get_info"); if (!tz) - return -EINVAL; + return_VALUE(-EINVAL); /* Get temperature [_TMP] (required) */ result = acpi_thermal_get_temperature(tz); if (result) - return result; + return_VALUE(result); /* Get trip points [_CRT, _PSV, etc.] (required) */ result = acpi_thermal_get_trip_points(tz); if (result) - return result; + return_VALUE(result); /* Set the cooling mode [_SCP] to active cooling (default) */ result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE); @@ -1258,7 +1314,7 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz) if (!result) tz->flags.devices = 1; - return 0; + return_VALUE(0); } static int acpi_thermal_add(struct acpi_device *device) @@ -1267,16 +1323,17 @@ static int acpi_thermal_add(struct acpi_device *device) acpi_status status = AE_OK; struct acpi_thermal *tz = NULL; + ACPI_FUNCTION_TRACE("acpi_thermal_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); tz = kmalloc(sizeof(struct acpi_thermal), GFP_KERNEL); if (!tz) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(tz, 0, sizeof(struct acpi_thermal)); - tz->device = device; + tz->handle = device->handle; strcpy(tz->name, device->pnp.bus_id); strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS); @@ -1294,10 +1351,12 @@ static int acpi_thermal_add(struct acpi_device *device) acpi_thermal_check(tz); - status = acpi_install_notify_handler(device->handle, + status = acpi_install_notify_handler(tz->handle, ACPI_DEVICE_NOTIFY, acpi_thermal_notify, tz); if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); result = -ENODEV; goto end; } @@ -1312,7 +1371,7 @@ static int acpi_thermal_add(struct acpi_device *device) kfree(tz); } - return result; + return_VALUE(result); } static int acpi_thermal_remove(struct acpi_device *device, int type) @@ -1320,9 +1379,10 @@ static int acpi_thermal_remove(struct acpi_device *device, int type) acpi_status status = AE_OK; struct acpi_thermal *tz = NULL; + ACPI_FUNCTION_TRACE("acpi_thermal_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); tz = (struct acpi_thermal *)acpi_driver_data(device); @@ -1335,9 +1395,12 @@ static int acpi_thermal_remove(struct acpi_device *device, int type) /* deferred task may reinsert timer */ del_timer_sync(&(tz->timer)); - status = acpi_remove_notify_handler(device->handle, + status = acpi_remove_notify_handler(tz->handle, ACPI_DEVICE_NOTIFY, acpi_thermal_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); /* Terminate policy */ if (tz->trips.passive.flags.valid && tz->trips.passive.flags.enabled) { @@ -1353,7 +1416,7 @@ static int acpi_thermal_remove(struct acpi_device *device, int type) acpi_thermal_remove_fs(device); kfree(tz); - return 0; + return_VALUE(0); } static int acpi_thermal_resume(struct acpi_device *device, int state) @@ -1361,7 +1424,7 @@ static int acpi_thermal_resume(struct acpi_device *device, int state) struct acpi_thermal *tz = NULL; if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); tz = (struct acpi_thermal *)acpi_driver_data(device); @@ -1374,29 +1437,31 @@ static int __init acpi_thermal_init(void) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_thermal_init"); acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir); if (!acpi_thermal_dir) - return -ENODEV; + return_VALUE(-ENODEV); acpi_thermal_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_thermal_driver); if (result < 0) { remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir); - return -ENODEV; + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } static void __exit acpi_thermal_exit(void) { + ACPI_FUNCTION_TRACE("acpi_thermal_exit"); acpi_bus_unregister_driver(&acpi_thermal_driver); remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir); - return; + return_VOID; } module_init(acpi_thermal_init); diff --git a/trunk/drivers/acpi/utilities/utalloc.c b/trunk/drivers/acpi/utilities/utalloc.c index 5cff17dc78b3..7940fc1bd69e 100644 --- a/trunk/drivers/acpi/utilities/utalloc.c +++ b/trunk/drivers/acpi/utilities/utalloc.c @@ -166,10 +166,10 @@ acpi_status acpi_ut_delete_caches(void) /* Free memory lists */ - ACPI_FREE(acpi_gbl_global_list); + acpi_os_free(acpi_gbl_global_list); acpi_gbl_global_list = NULL; - ACPI_FREE(acpi_gbl_ns_node_list); + acpi_os_free(acpi_gbl_ns_node_list); acpi_gbl_ns_node_list = NULL; #endif diff --git a/trunk/drivers/acpi/utilities/utcache.c b/trunk/drivers/acpi/utilities/utcache.c index 1a1f8109159c..56270a30718a 100644 --- a/trunk/drivers/acpi/utilities/utcache.c +++ b/trunk/drivers/acpi/utilities/utcache.c @@ -162,7 +162,7 @@ acpi_status acpi_os_delete_cache(struct acpi_memory_list * cache) /* Now we can delete the cache object */ - ACPI_FREE(cache); + acpi_os_free(cache); return (AE_OK); } diff --git a/trunk/drivers/acpi/utilities/utdelete.c b/trunk/drivers/acpi/utilities/utdelete.c index 38ebe1c54330..67b9f325c6fa 100644 --- a/trunk/drivers/acpi/utilities/utdelete.c +++ b/trunk/drivers/acpi/utilities/utdelete.c @@ -155,30 +155,21 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) case ACPI_TYPE_MUTEX: ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, - "***** Mutex %p, OS Mutex %p\n", - object, object->mutex.os_mutex)); + "***** Mutex %p, Semaphore %p\n", + object, object->mutex.semaphore)); - if (object->mutex.os_mutex != ACPI_GLOBAL_LOCK) { - acpi_ex_unlink_mutex(object); - acpi_os_delete_mutex(object->mutex.os_mutex); - } else { - /* Global Lock "mutex" is actually a counting semaphore */ - - (void) - acpi_os_delete_semaphore - (acpi_gbl_global_lock_semaphore); - acpi_gbl_global_lock_semaphore = NULL; - } + acpi_ex_unlink_mutex(object); + (void)acpi_os_delete_semaphore(object->mutex.semaphore); break; case ACPI_TYPE_EVENT: ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, - "***** Event %p, OS Semaphore %p\n", - object, object->event.os_semaphore)); + "***** Event %p, Semaphore %p\n", + object, object->event.semaphore)); - (void)acpi_os_delete_semaphore(object->event.os_semaphore); - object->event.os_semaphore = NULL; + (void)acpi_os_delete_semaphore(object->event.semaphore); + object->event.semaphore = NULL; break; case ACPI_TYPE_METHOD: @@ -186,13 +177,12 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "***** Method %p\n", object)); - /* Delete the method mutex if it exists */ + /* Delete the method semaphore if it exists */ - if (object->method.mutex) { - acpi_os_delete_mutex(object->method.mutex->mutex. - os_mutex); - acpi_ut_delete_object_desc(object->method.mutex); - object->method.mutex = NULL; + if (object->method.semaphore) { + (void)acpi_os_delete_semaphore(object->method. + semaphore); + object->method.semaphore = NULL; } break; diff --git a/trunk/drivers/acpi/utilities/utglobal.c b/trunk/drivers/acpi/utilities/utglobal.c index 014030af8b50..e5999c65c0b8 100644 --- a/trunk/drivers/acpi/utilities/utglobal.c +++ b/trunk/drivers/acpi/utilities/utglobal.c @@ -794,7 +794,6 @@ void acpi_ut_init_globals(void) /* Global Lock support */ - acpi_gbl_global_lock_semaphore = NULL; acpi_gbl_global_lock_acquired = FALSE; acpi_gbl_global_lock_thread_count = 0; acpi_gbl_global_lock_handle = 0; diff --git a/trunk/drivers/acpi/utilities/utmisc.c b/trunk/drivers/acpi/utilities/utmisc.c index 33268310c738..5c75d35ad1cd 100644 --- a/trunk/drivers/acpi/utilities/utmisc.c +++ b/trunk/drivers/acpi/utilities/utmisc.c @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#include - #include #include @@ -964,7 +962,6 @@ acpi_ut_exception(char *module_name, acpi_os_vprintf(format, args); acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); } -EXPORT_SYMBOL(acpi_ut_exception); void ACPI_INTERNAL_VAR_XFACE acpi_ut_warning(char *module_name, u32 line_number, char *format, ...) diff --git a/trunk/drivers/acpi/utilities/utmutex.c b/trunk/drivers/acpi/utilities/utmutex.c index dfc8f30ca892..25eb34369afa 100644 --- a/trunk/drivers/acpi/utilities/utmutex.c +++ b/trunk/drivers/acpi/utilities/utmutex.c @@ -82,9 +82,12 @@ acpi_status acpi_ut_mutex_initialize(void) /* Create the spinlocks for use at interrupt level */ - spin_lock_init(acpi_gbl_gpe_lock); - spin_lock_init(acpi_gbl_hardware_lock); + status = acpi_os_create_lock(&acpi_gbl_gpe_lock); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + status = acpi_os_create_lock(&acpi_gbl_hardware_lock); return_ACPI_STATUS(status); } @@ -143,8 +146,9 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id) } if (!acpi_gbl_mutex_info[mutex_id].mutex) { - status = - acpi_os_create_mutex(&acpi_gbl_mutex_info[mutex_id].mutex); + status = acpi_os_create_semaphore(1, 1, + &acpi_gbl_mutex_info + [mutex_id].mutex); acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED; acpi_gbl_mutex_info[mutex_id].use_count = 0; @@ -167,6 +171,7 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id) static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id) { + acpi_status status; ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id); @@ -174,12 +179,12 @@ static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id) return_ACPI_STATUS(AE_BAD_PARAMETER); } - acpi_os_delete_mutex(acpi_gbl_mutex_info[mutex_id].mutex); + status = acpi_os_delete_semaphore(acpi_gbl_mutex_info[mutex_id].mutex); acpi_gbl_mutex_info[mutex_id].mutex = NULL; acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED; - return_ACPI_STATUS(AE_OK); + return_ACPI_STATUS(status); } /******************************************************************************* @@ -246,8 +251,8 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) "Thread %X attempting to acquire Mutex [%s]\n", this_thread_id, acpi_ut_get_mutex_name(mutex_id))); - status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, - ACPI_WAIT_FOREVER); + status = acpi_os_wait_semaphore(acpi_gbl_mutex_info[mutex_id].mutex, + 1, ACPI_WAIT_FOREVER); if (ACPI_SUCCESS(status)) { ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %X acquired Mutex [%s]\n", @@ -279,6 +284,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) { + acpi_status status; acpi_thread_id this_thread_id; ACPI_FUNCTION_NAME(ut_release_mutex); @@ -334,6 +340,19 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED; - acpi_os_release_mutex(acpi_gbl_mutex_info[mutex_id].mutex); - return (AE_OK); + status = + acpi_os_signal_semaphore(acpi_gbl_mutex_info[mutex_id].mutex, 1); + + if (ACPI_FAILURE(status)) { + ACPI_EXCEPTION((AE_INFO, status, + "Thread %X could not release Mutex [%X]", + this_thread_id, mutex_id)); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "Thread %X released Mutex [%s]\n", + this_thread_id, + acpi_ut_get_mutex_name(mutex_id))); + } + + return (status); } diff --git a/trunk/drivers/acpi/utils.c b/trunk/drivers/acpi/utils.c index f48227f4c8c9..6b516852ac12 100644 --- a/trunk/drivers/acpi/utils.c +++ b/trunk/drivers/acpi/utils.c @@ -58,29 +58,31 @@ acpi_extract_package(union acpi_object *package, u8 *head = NULL; u8 *tail = NULL; + ACPI_FUNCTION_TRACE("acpi_extract_package"); if (!package || (package->type != ACPI_TYPE_PACKAGE) || (package->package.count < 1)) { - printk(KERN_WARNING PREFIX "Invalid package argument\n"); - return AE_BAD_PARAMETER; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid 'package' argument\n")); + return_ACPI_STATUS(AE_BAD_PARAMETER); } if (!format || !format->pointer || (format->length < 1)) { - printk(KERN_WARNING PREFIX "Invalid format argument\n"); - return AE_BAD_PARAMETER; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'format' argument\n")); + return_ACPI_STATUS(AE_BAD_PARAMETER); } if (!buffer) { - printk(KERN_WARNING PREFIX "Invalid buffer argument\n"); - return AE_BAD_PARAMETER; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'buffer' argument\n")); + return_ACPI_STATUS(AE_BAD_PARAMETER); } format_count = (format->length / sizeof(char)) - 1; if (format_count > package->package.count) { - printk(KERN_WARNING PREFIX "Format specifies more objects [%d]" - " than exist in package [%d].\n", - format_count, package->package.count); - return AE_BAD_DATA; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Format specifies more objects [%d] than exist in package [%d].", + format_count, package->package.count)); + return_ACPI_STATUS(AE_BAD_DATA); } format_string = (char *)format->pointer; @@ -93,7 +95,7 @@ acpi_extract_package(union acpi_object *package, union acpi_object *element = &(package->package.elements[i]); if (!element) { - return AE_BAD_DATA; + return_ACPI_STATUS(AE_BAD_DATA); } switch (element->type) { @@ -111,11 +113,10 @@ acpi_extract_package(union acpi_object *package, tail_offset += sizeof(char *); break; default: - printk(KERN_WARNING PREFIX "Invalid package element" - " [%d]: got number, expecing" - " [%c]\n", - i, format_string[i]); - return AE_BAD_DATA; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid package element [%d]: got number, expecing [%c].\n", + i, format_string[i])); + return_ACPI_STATUS(AE_BAD_DATA); break; } break; @@ -137,11 +138,10 @@ acpi_extract_package(union acpi_object *package, tail_offset += sizeof(u8 *); break; default: - printk(KERN_WARNING PREFIX "Invalid package element" - " [%d] got string/buffer," - " expecing [%c]\n", - i, format_string[i]); - return AE_BAD_DATA; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid package element [%d] got string/buffer, expecing [%c].\n", + i, format_string[i])); + return_ACPI_STATUS(AE_BAD_DATA); break; } break; @@ -152,7 +152,7 @@ acpi_extract_package(union acpi_object *package, "Found unsupported element at index=%d\n", i)); /* TBD: handle nested packages... */ - return AE_SUPPORT; + return_ACPI_STATUS(AE_SUPPORT); break; } } @@ -162,9 +162,9 @@ acpi_extract_package(union acpi_object *package, */ if (buffer->length < size_required) { buffer->length = size_required; - return AE_BUFFER_OVERFLOW; + return_ACPI_STATUS(AE_BUFFER_OVERFLOW); } else if (buffer->length != size_required || !buffer->pointer) { - return AE_BAD_PARAMETER; + return_ACPI_STATUS(AE_BAD_PARAMETER); } head = buffer->pointer; @@ -179,7 +179,7 @@ acpi_extract_package(union acpi_object *package, union acpi_object *element = &(package->package.elements[i]); if (!element) { - return AE_BAD_DATA; + return_ACPI_STATUS(AE_BAD_DATA); } switch (element->type) { @@ -244,7 +244,7 @@ acpi_extract_package(union acpi_object *package, } } - return AE_OK; + return_ACPI_STATUS(AE_OK); } EXPORT_SYMBOL(acpi_extract_package); @@ -258,13 +258,14 @@ acpi_evaluate_integer(acpi_handle handle, union acpi_object *element; struct acpi_buffer buffer = { 0, NULL }; + ACPI_FUNCTION_TRACE("acpi_evaluate_integer"); if (!data) - return AE_BAD_PARAMETER; + return_ACPI_STATUS(AE_BAD_PARAMETER); element = kmalloc(sizeof(union acpi_object), GFP_KERNEL); if (!element) - return AE_NO_MEMORY; + return_ACPI_STATUS(AE_NO_MEMORY); memset(element, 0, sizeof(union acpi_object)); buffer.length = sizeof(union acpi_object); @@ -273,13 +274,13 @@ acpi_evaluate_integer(acpi_handle handle, if (ACPI_FAILURE(status)) { acpi_util_eval_error(handle, pathname, status); kfree(element); - return status; + return_ACPI_STATUS(status); } if (element->type != ACPI_TYPE_INTEGER) { acpi_util_eval_error(handle, pathname, AE_BAD_DATA); kfree(element); - return AE_BAD_DATA; + return_ACPI_STATUS(AE_BAD_DATA); } *data = element->integer.value; @@ -287,7 +288,7 @@ acpi_evaluate_integer(acpi_handle handle, ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data)); - return AE_OK; + return_ACPI_STATUS(AE_OK); } EXPORT_SYMBOL(acpi_evaluate_integer); @@ -302,14 +303,15 @@ acpi_evaluate_string(acpi_handle handle, acpi_object *element = NULL; acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; + ACPI_FUNCTION_TRACE("acpi_evaluate_string"); if (!data) - return AE_BAD_PARAMETER; + return_ACPI_STATUS(AE_BAD_PARAMETER); status = acpi_evaluate_object(handle, pathname, arguments, &buffer); if (ACPI_FAILURE(status)) { acpi_util_eval_error(handle, pathname, status); - return status; + return_ACPI_STATUS(status); } element = (acpi_object *) buffer.pointer; @@ -318,13 +320,13 @@ acpi_evaluate_string(acpi_handle handle, || (element->type != ACPI_TYPE_BUFFER) || !element->string.length) { acpi_util_eval_error(handle, pathname, AE_BAD_DATA); - return AE_BAD_DATA; + return_ACPI_STATUS(AE_BAD_DATA); } *data = kmalloc(element->string.length + 1, GFP_KERNEL); if (!data) { - printk(KERN_ERR PREFIX "Memory allocation\n"); - return -ENOMEM; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n")); + return_VALUE(-ENOMEM); } memset(*data, 0, element->string.length + 1); @@ -332,9 +334,9 @@ acpi_evaluate_string(acpi_handle handle, ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%s]\n", *data)); - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); - return AE_OK; + return_ACPI_STATUS(AE_OK); } #endif @@ -350,9 +352,10 @@ acpi_evaluate_reference(acpi_handle handle, struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; u32 i = 0; + ACPI_FUNCTION_TRACE("acpi_evaluate_reference"); if (!list) { - return AE_BAD_PARAMETER; + return_ACPI_STATUS(AE_BAD_PARAMETER); } /* Evaluate object. */ @@ -364,29 +367,32 @@ acpi_evaluate_reference(acpi_handle handle, package = (union acpi_object *)buffer.pointer; if ((buffer.length == 0) || !package) { - printk(KERN_ERR PREFIX "No return object (len %X ptr %p)\n", - (unsigned)buffer.length, package); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "No return object (len %X ptr %p)\n", + (unsigned)buffer.length, package)); status = AE_BAD_DATA; acpi_util_eval_error(handle, pathname, status); goto end; } if (package->type != ACPI_TYPE_PACKAGE) { - printk(KERN_ERR PREFIX "Expecting a [Package], found type %X\n", - package->type); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Expecting a [Package], found type %X\n", + package->type)); status = AE_BAD_DATA; acpi_util_eval_error(handle, pathname, status); goto end; } if (!package->package.count) { - printk(KERN_ERR PREFIX "[Package] has zero elements (%p)\n", - package); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "[Package] has zero elements (%p)\n", + package)); status = AE_BAD_DATA; acpi_util_eval_error(handle, pathname, status); goto end; } if (package->package.count > ACPI_MAX_HANDLES) { - return AE_NO_MEMORY; + return_ACPI_STATUS(AE_NO_MEMORY); } list->count = package->package.count; @@ -398,9 +404,9 @@ acpi_evaluate_reference(acpi_handle handle, if (element->type != ACPI_TYPE_ANY) { status = AE_BAD_DATA; - printk(KERN_ERR PREFIX - "Expecting a [Reference] package element, found type %X\n", - element->type); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Expecting a [Reference] package element, found type %X\n", + element->type)); acpi_util_eval_error(handle, pathname, status); break; } @@ -418,9 +424,9 @@ acpi_evaluate_reference(acpi_handle handle, //kfree(list->handles); } - kfree(buffer.pointer); + acpi_os_free(buffer.pointer); - return status; + return_ACPI_STATUS(status); } EXPORT_SYMBOL(acpi_evaluate_reference); diff --git a/trunk/drivers/acpi/video.c b/trunk/drivers/acpi/video.c index 56666a982476..e7e9a693953a 100644 --- a/trunk/drivers/acpi/video.c +++ b/trunk/drivers/acpi/video.c @@ -117,7 +117,7 @@ struct acpi_video_enumerated_device { }; struct acpi_video_bus { - struct acpi_device *device; + acpi_handle handle; u8 dos_setting; struct acpi_video_enumerated_device *attached_array; u8 attached_count; @@ -155,6 +155,7 @@ struct acpi_video_device_brightness { }; struct acpi_video_device { + acpi_handle handle; unsigned long device_id; struct acpi_video_device_flags flags; struct acpi_video_device_cap cap; @@ -271,10 +272,10 @@ static int acpi_video_device_query(struct acpi_video_device *device, unsigned long *state) { int status; + ACPI_FUNCTION_TRACE("acpi_video_device_query"); + status = acpi_evaluate_integer(device->handle, "_DGS", NULL, state); - status = acpi_evaluate_integer(device->dev->handle, "_DGS", NULL, state); - - return status; + return_VALUE(status); } static int @@ -283,9 +284,11 @@ acpi_video_device_get_state(struct acpi_video_device *device, { int status; - status = acpi_evaluate_integer(device->dev->handle, "_DCS", NULL, state); + ACPI_FUNCTION_TRACE("acpi_video_device_get_state"); + + status = acpi_evaluate_integer(device->handle, "_DCS", NULL, state); - return status; + return_VALUE(status); } static int @@ -296,11 +299,12 @@ acpi_video_device_set_state(struct acpi_video_device *device, int state) struct acpi_object_list args = { 1, &arg0 }; unsigned long ret; + ACPI_FUNCTION_TRACE("acpi_video_device_set_state"); arg0.integer.value = state; - status = acpi_evaluate_integer(device->dev->handle, "_DSS", &args, &ret); + status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret); - return status; + return_VALUE(status); } static int @@ -311,27 +315,28 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device, struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *obj; + ACPI_FUNCTION_TRACE("acpi_video_device_lcd_query_levels"); *levels = NULL; - status = acpi_evaluate_object(device->dev->handle, "_BCL", NULL, &buffer); + status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer); if (!ACPI_SUCCESS(status)) - return status; + return_VALUE(status); obj = (union acpi_object *)buffer.pointer; if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { - printk(KERN_ERR PREFIX "Invalid _BCL data\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _BCL data\n")); status = -EFAULT; goto err; } *levels = obj; - return 0; + return_VALUE(0); err: kfree(buffer.pointer); - return status; + return_VALUE(status); } static int @@ -341,12 +346,13 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level) union acpi_object arg0 = { ACPI_TYPE_INTEGER }; struct acpi_object_list args = { 1, &arg0 }; + ACPI_FUNCTION_TRACE("acpi_video_device_lcd_set_level"); arg0.integer.value = level; - status = acpi_evaluate_object(device->dev->handle, "_BCM", &args, NULL); + status = acpi_evaluate_object(device->handle, "_BCM", &args, NULL); printk(KERN_DEBUG "set_level status: %x\n", status); - return status; + return_VALUE(status); } static int @@ -354,10 +360,11 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, unsigned long *level) { int status; + ACPI_FUNCTION_TRACE("acpi_video_device_lcd_get_level_current"); - status = acpi_evaluate_integer(device->dev->handle, "_BQC", NULL, level); + status = acpi_evaluate_integer(device->handle, "_BQC", NULL, level); - return status; + return_VALUE(status); } static int @@ -370,33 +377,34 @@ acpi_video_device_EDID(struct acpi_video_device *device, union acpi_object arg0 = { ACPI_TYPE_INTEGER }; struct acpi_object_list args = { 1, &arg0 }; + ACPI_FUNCTION_TRACE("acpi_video_device_get_EDID"); *edid = NULL; if (!device) - return -ENODEV; + return_VALUE(-ENODEV); if (length == 128) arg0.integer.value = 1; else if (length == 256) arg0.integer.value = 2; else - return -EINVAL; + return_VALUE(-EINVAL); - status = acpi_evaluate_object(device->dev->handle, "_DDC", &args, &buffer); + status = acpi_evaluate_object(device->handle, "_DDC", &args, &buffer); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); obj = (union acpi_object *)buffer.pointer; if (obj && obj->type == ACPI_TYPE_BUFFER) *edid = obj; else { - printk(KERN_ERR PREFIX "Invalid _DDC data\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _DDC data\n")); status = -EFAULT; kfree(obj); } - return status; + return_VALUE(status); } /* bus */ @@ -409,14 +417,15 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option) union acpi_object arg0 = { ACPI_TYPE_INTEGER }; struct acpi_object_list args = { 1, &arg0 }; + ACPI_FUNCTION_TRACE("acpi_video_bus_set_POST"); arg0.integer.value = option; - status = acpi_evaluate_integer(video->device->handle, "_SPD", &args, &tmp); + status = acpi_evaluate_integer(video->handle, "_SPD", &args, &tmp); if (ACPI_SUCCESS(status)) status = tmp ? (-EINVAL) : (AE_OK); - return status; + return_VALUE(status); } static int @@ -424,9 +433,11 @@ acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id) { int status; - status = acpi_evaluate_integer(video->device->handle, "_GPD", NULL, id); + ACPI_FUNCTION_TRACE("acpi_video_bus_get_POST"); + + status = acpi_evaluate_integer(video->handle, "_GPD", NULL, id); - return status; + return_VALUE(status); } static int @@ -434,11 +445,12 @@ acpi_video_bus_POST_options(struct acpi_video_bus *video, unsigned long *options) { int status; + ACPI_FUNCTION_TRACE("acpi_video_bus_POST_options"); - status = acpi_evaluate_integer(video->device->handle, "_VPO", NULL, options); + status = acpi_evaluate_integer(video->handle, "_VPO", NULL, options); *options &= 3; - return status; + return_VALUE(status); } /* @@ -469,6 +481,7 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag) union acpi_object arg0 = { ACPI_TYPE_INTEGER }; struct acpi_object_list args = { 1, &arg0 }; + ACPI_FUNCTION_TRACE("acpi_video_bus_DOS"); if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) { status = -1; @@ -476,10 +489,10 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag) } arg0.integer.value = (lcd_flag << 2) | bios_flag; video->dos_setting = arg0.integer.value; - acpi_evaluate_object(video->device->handle, "_DOS", &args, NULL); + acpi_evaluate_object(video->handle, "_DOS", &args, NULL); Failed: - return status; + return_VALUE(status); } /* @@ -501,28 +514,29 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) union acpi_object *obj = NULL; struct acpi_video_device_brightness *br = NULL; + ACPI_FUNCTION_TRACE("acpi_video_device_find_cap"); memset(&device->cap, 0, 4); - if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ADR", &h_dummy1))) { device->cap._ADR = 1; } - if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCL", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCL", &h_dummy1))) { device->cap._BCL = 1; } - if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCM", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCM", &h_dummy1))) { device->cap._BCM = 1; } - if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DDC", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DDC", &h_dummy1))) { device->cap._DDC = 1; } - if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DCS", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DCS", &h_dummy1))) { device->cap._DCS = 1; } - if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DGS", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DGS", &h_dummy1))) { device->cap._DGS = 1; } - if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DSS", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DSS", &h_dummy1))) { device->cap._DSS = 1; } @@ -546,7 +560,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) o = (union acpi_object *)&obj->package. elements[i]; if (o->type != ACPI_TYPE_INTEGER) { - printk(KERN_ERR PREFIX "Invalid data\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid data\n")); continue; } br->levels[count] = (u32) o->integer.value; @@ -568,7 +583,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) kfree(obj); - return; + return_VOID; } /* @@ -586,22 +601,22 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video) acpi_handle h_dummy1; memset(&video->cap, 0, 4); - if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOS", &h_dummy1))) { video->cap._DOS = 1; } - if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOD", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOD", &h_dummy1))) { video->cap._DOD = 1; } - if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_ROM", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_ROM", &h_dummy1))) { video->cap._ROM = 1; } - if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_GPD", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_GPD", &h_dummy1))) { video->cap._GPD = 1; } - if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_SPD", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_SPD", &h_dummy1))) { video->cap._SPD = 1; } - if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_VPO", &h_dummy1))) { + if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_VPO", &h_dummy1))) { video->cap._VPO = 1; } } @@ -615,9 +630,10 @@ static int acpi_video_bus_check(struct acpi_video_bus *video) { acpi_status status = -ENOENT; + ACPI_FUNCTION_TRACE("acpi_video_bus_check"); if (!video) - return -EINVAL; + return_VALUE(-EINVAL); /* Since there is no HID, CID and so on for VGA driver, we have * to check well known required nodes. @@ -641,7 +657,7 @@ static int acpi_video_bus_check(struct acpi_video_bus *video) status = 0; } - return status; + return_VALUE(status); } /* -------------------------------------------------------------------------- @@ -657,6 +673,7 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset) struct acpi_video_device *dev = (struct acpi_video_device *)seq->private; + ACPI_FUNCTION_TRACE("acpi_video_device_info_seq_show"); if (!dev) goto end; @@ -675,7 +692,7 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset) seq_printf(seq, "known by bios: %s\n", dev->flags.bios ? "yes" : "no"); end: - return 0; + return_VALUE(0); } static int @@ -692,6 +709,7 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) (struct acpi_video_device *)seq->private; unsigned long state; + ACPI_FUNCTION_TRACE("acpi_video_device_state_seq_show"); if (!dev) goto end; @@ -711,7 +729,7 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) seq_printf(seq, "\n"); end: - return 0; + return_VALUE(0); } static int @@ -732,12 +750,13 @@ acpi_video_device_write_state(struct file *file, char str[12] = { 0 }; u32 state = 0; + ACPI_FUNCTION_TRACE("acpi_video_device_write_state"); if (!dev || count + 1 > sizeof str) - return -EINVAL; + return_VALUE(-EINVAL); if (copy_from_user(str, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); str[count] = 0; state = simple_strtoul(str, NULL, 0); @@ -746,9 +765,9 @@ acpi_video_device_write_state(struct file *file, status = acpi_video_device_set_state(dev, state); if (status) - return -EFAULT; + return_VALUE(-EFAULT); - return count; + return_VALUE(count); } static int @@ -758,10 +777,11 @@ acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset) (struct acpi_video_device *)seq->private; int i; + ACPI_FUNCTION_TRACE("acpi_video_device_brightness_seq_show"); if (!dev || !dev->brightness) { seq_printf(seq, "\n"); - return 0; + return_VALUE(0); } seq_printf(seq, "levels: "); @@ -769,7 +789,7 @@ acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset) seq_printf(seq, " %d", dev->brightness->levels[i]); seq_printf(seq, "\ncurrent: %d\n", dev->brightness->curr); - return 0; + return_VALUE(0); } static int @@ -790,18 +810,19 @@ acpi_video_device_write_brightness(struct file *file, unsigned int level = 0; int i; + ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness"); if (!dev || !dev->brightness || count + 1 > sizeof str) - return -EINVAL; + return_VALUE(-EINVAL); if (copy_from_user(str, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); str[count] = 0; level = simple_strtoul(str, NULL, 0); if (level > 100) - return -EFAULT; + return_VALUE(-EFAULT); /* validate though the list of available levels */ for (i = 0; i < dev->brightness->count; i++) @@ -812,7 +833,7 @@ acpi_video_device_write_brightness(struct file *file, break; } - return count; + return_VALUE(count); } static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) @@ -823,6 +844,7 @@ static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) int i; union acpi_object *edid = NULL; + ACPI_FUNCTION_TRACE("acpi_video_device_EDID_seq_show"); if (!dev) goto out; @@ -847,7 +869,7 @@ static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) else kfree(edid); - return 0; + return_VALUE(0); } static int @@ -862,26 +884,28 @@ static int acpi_video_device_add_fs(struct acpi_device *device) struct proc_dir_entry *entry = NULL; struct acpi_video_device *vid_dev; + ACPI_FUNCTION_TRACE("acpi_video_device_add_fs"); if (!device) - return -ENODEV; + return_VALUE(-ENODEV); vid_dev = (struct acpi_video_device *)acpi_driver_data(device); if (!vid_dev) - return -ENODEV; + return_VALUE(-ENODEV); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), vid_dev->video->dir); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); acpi_device_dir(device)->owner = THIS_MODULE; } /* 'info' [R] */ entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create 'info' fs entry\n")); else { entry->proc_fops = &acpi_video_device_info_fops; entry->data = acpi_driver_data(device); @@ -893,7 +917,8 @@ static int acpi_video_device_add_fs(struct acpi_device *device) create_proc_entry("state", S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create 'state' fs entry\n")); else { acpi_video_device_state_fops.write = acpi_video_device_write_state; entry->proc_fops = &acpi_video_device_state_fops; @@ -906,7 +931,8 @@ static int acpi_video_device_add_fs(struct acpi_device *device) create_proc_entry("brightness", S_IFREG | S_IRUGO | S_IWUSR, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create 'brightness' fs entry\n")); else { acpi_video_device_brightness_fops.write = acpi_video_device_write_brightness; entry->proc_fops = &acpi_video_device_brightness_fops; @@ -917,23 +943,25 @@ static int acpi_video_device_add_fs(struct acpi_device *device) /* 'EDID' [R] */ entry = create_proc_entry("EDID", S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create 'brightness' fs entry\n")); else { entry->proc_fops = &acpi_video_device_EDID_fops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } - return 0; + return_VALUE(0); } static int acpi_video_device_remove_fs(struct acpi_device *device) { struct acpi_video_device *vid_dev; + ACPI_FUNCTION_TRACE("acpi_video_device_remove_fs"); vid_dev = (struct acpi_video_device *)acpi_driver_data(device); if (!vid_dev || !vid_dev->video || !vid_dev->video->dir) - return -ENODEV; + return_VALUE(-ENODEV); if (acpi_device_dir(device)) { remove_proc_entry("info", acpi_device_dir(device)); @@ -944,7 +972,7 @@ static int acpi_video_device_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* video bus */ @@ -952,6 +980,7 @@ static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset) { struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; + ACPI_FUNCTION_TRACE("acpi_video_bus_info_seq_show"); if (!video) goto end; @@ -964,7 +993,7 @@ static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset) video->flags.post ? "yes" : "no"); end: - return 0; + return_VALUE(0); } static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file) @@ -977,6 +1006,7 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset) { struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; + ACPI_FUNCTION_TRACE("acpi_video_bus_ROM_seq_show"); if (!video) goto end; @@ -985,7 +1015,7 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset) seq_printf(seq, "\n"); end: - return 0; + return_VALUE(0); } static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file) @@ -999,6 +1029,7 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) unsigned long options; int status; + ACPI_FUNCTION_TRACE("acpi_video_bus_POST_info_seq_show"); if (!video) goto end; @@ -1021,7 +1052,7 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) } else seq_printf(seq, "\n"); end: - return 0; + return_VALUE(0); } static int @@ -1037,6 +1068,7 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) int status; unsigned long id; + ACPI_FUNCTION_TRACE("acpi_video_bus_POST_seq_show"); if (!video) goto end; @@ -1049,17 +1081,18 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) seq_printf(seq, "device posted is <%s>\n", device_decode[id & 3]); end: - return 0; + return_VALUE(0); } static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset) { struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; + ACPI_FUNCTION_TRACE("acpi_video_bus_DOS_seq_show"); seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); - return 0; + return_VALUE(0); } static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file) @@ -1084,21 +1117,22 @@ acpi_video_bus_write_POST(struct file *file, char str[12] = { 0 }; unsigned long opt, options; + ACPI_FUNCTION_TRACE("acpi_video_bus_write_POST"); if (!video || count + 1 > sizeof str) - return -EINVAL; + return_VALUE(-EINVAL); status = acpi_video_bus_POST_options(video, &options); if (!ACPI_SUCCESS(status)) - return -EINVAL; + return_VALUE(-EINVAL); if (copy_from_user(str, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); str[count] = 0; opt = strtoul(str, NULL, 0); if (opt > 3) - return -EFAULT; + return_VALUE(-EFAULT); /* just in case an OEM 'forget' the motherboard... */ options |= 1; @@ -1106,11 +1140,11 @@ acpi_video_bus_write_POST(struct file *file, if (options & (1ul << opt)) { status = acpi_video_bus_set_POST(video, opt); if (!ACPI_SUCCESS(status)) - return -EFAULT; + return_VALUE(-EFAULT); } - return count; + return_VALUE(count); } static ssize_t @@ -1124,24 +1158,25 @@ acpi_video_bus_write_DOS(struct file *file, char str[12] = { 0 }; unsigned long opt; + ACPI_FUNCTION_TRACE("acpi_video_bus_write_DOS"); if (!video || count + 1 > sizeof str) - return -EINVAL; + return_VALUE(-EINVAL); if (copy_from_user(str, buffer, count)) - return -EFAULT; + return_VALUE(-EFAULT); str[count] = 0; opt = strtoul(str, NULL, 0); if (opt > 7) - return -EFAULT; + return_VALUE(-EFAULT); status = acpi_video_bus_DOS(video, opt & 0x3, (opt & 0x4) >> 2); if (!ACPI_SUCCESS(status)) - return -EFAULT; + return_VALUE(-EFAULT); - return count; + return_VALUE(count); } static int acpi_video_bus_add_fs(struct acpi_device *device) @@ -1149,6 +1184,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) struct proc_dir_entry *entry = NULL; struct acpi_video_bus *video; + ACPI_FUNCTION_TRACE("acpi_video_bus_add_fs"); video = (struct acpi_video_bus *)acpi_driver_data(device); @@ -1156,7 +1192,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_video_dir); if (!acpi_device_dir(device)) - return -ENODEV; + return_VALUE(-ENODEV); video->dir = acpi_device_dir(device); acpi_device_dir(device)->owner = THIS_MODULE; } @@ -1164,7 +1200,8 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) /* 'info' [R] */ entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create 'info' fs entry\n")); else { entry->proc_fops = &acpi_video_bus_info_fops; entry->data = acpi_driver_data(device); @@ -1174,7 +1211,8 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) /* 'ROM' [R] */ entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create 'ROM' fs entry\n")); else { entry->proc_fops = &acpi_video_bus_ROM_fops; entry->data = acpi_driver_data(device); @@ -1185,7 +1223,8 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) entry = create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create 'POST_info' fs entry\n")); else { entry->proc_fops = &acpi_video_bus_POST_info_fops; entry->data = acpi_driver_data(device); @@ -1197,7 +1236,8 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create 'POST' fs entry\n")); else { acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST; entry->proc_fops = &acpi_video_bus_POST_fops; @@ -1210,7 +1250,8 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR, acpi_device_dir(device)); if (!entry) - return -ENODEV; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create 'DOS' fs entry\n")); else { acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS; entry->proc_fops = &acpi_video_bus_DOS_fops; @@ -1218,13 +1259,14 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) entry->owner = THIS_MODULE; } - return 0; + return_VALUE(0); } static int acpi_video_bus_remove_fs(struct acpi_device *device) { struct acpi_video_bus *video; + ACPI_FUNCTION_TRACE("acpi_video_bus_remove_fs"); video = (struct acpi_video_bus *)acpi_driver_data(device); @@ -1238,7 +1280,7 @@ static int acpi_video_bus_remove_fs(struct acpi_device *device) acpi_device_dir(device) = NULL; } - return 0; + return_VALUE(0); } /* -------------------------------------------------------------------------- @@ -1255,9 +1297,10 @@ acpi_video_bus_get_one_device(struct acpi_device *device, int status; struct acpi_video_device *data; + ACPI_FUNCTION_TRACE("acpi_video_bus_get_one_device"); if (!device || !video) - return -EINVAL; + return_VALUE(-EINVAL); status = acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); @@ -1265,10 +1308,11 @@ acpi_video_bus_get_one_device(struct acpi_device *device, data = kmalloc(sizeof(struct acpi_video_device), GFP_KERNEL); if (!data) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(data, 0, sizeof(struct acpi_video_device)); + data->handle = device->handle; strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); acpi_driver_data(device) = data; @@ -1295,7 +1339,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device, acpi_video_device_bind(video, data); acpi_video_device_find_cap(data); - status = acpi_install_notify_handler(device->handle, + status = acpi_install_notify_handler(data->handle, ACPI_DEVICE_NOTIFY, acpi_video_device_notify, data); @@ -1315,10 +1359,10 @@ acpi_video_bus_get_one_device(struct acpi_device *device, acpi_video_device_add_fs(device); - return 0; + return_VALUE(0); } - return -ENOENT; + return_VALUE(-ENOENT); } /* @@ -1361,6 +1405,7 @@ acpi_video_device_bind(struct acpi_video_bus *video, struct acpi_video_device *device) { int i; + ACPI_FUNCTION_TRACE("acpi_video_device_bind"); #define IDS_VAL(i) video->attached_array[i].value.int_val #define IDS_BIND(i) video->attached_array[i].bind_info @@ -1397,15 +1442,17 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) union acpi_object *dod = NULL; union acpi_object *obj; - status = acpi_evaluate_object(video->device->handle, "_DOD", NULL, &buffer); + ACPI_FUNCTION_TRACE("acpi_video_device_enumerate"); + + status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer); if (!ACPI_SUCCESS(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD")); - return status; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _DOD\n")); + return_VALUE(status); } dod = (union acpi_object *)buffer.pointer; if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) { - ACPI_EXCEPTION((AE_INFO, status, "Invalid _DOD data")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _DOD data\n")); status = -EFAULT; goto out; } @@ -1429,7 +1476,8 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) obj = (union acpi_object *)&dod->package.elements[i]; if (obj->type != ACPI_TYPE_INTEGER) { - printk(KERN_ERR PREFIX "Invalid _DOD data\n"); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid _DOD data\n")); active_device_list[i].value.int_val = ACPI_VIDEO_HEAD_INVALID; } @@ -1446,8 +1494,8 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) video->attached_array = active_device_list; video->attached_count = count; out: - kfree(buffer.pointer); - return status; + acpi_os_free(buffer.pointer); + return_VALUE(status); } /* @@ -1472,6 +1520,7 @@ static int acpi_video_switch_output(struct acpi_video_bus *video, int event) unsigned long state; int status = 0; + ACPI_FUNCTION_TRACE("acpi_video_switch_output"); list_for_each_safe(node, next, &video->video_device_list) { dev = container_of(node, struct acpi_video_device, entry); @@ -1502,7 +1551,7 @@ static int acpi_video_switch_output(struct acpi_video_bus *video, int event) break; } - return status; + return_VALUE(status); } static int @@ -1529,6 +1578,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video, int status = 0; struct list_head *node, *next; + ACPI_FUNCTION_TRACE("acpi_video_get_devices"); acpi_video_device_enumerate(video); @@ -1541,12 +1591,13 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video, status = acpi_video_bus_get_one_device(dev, video); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Cant attach device")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Cant attach device\n")); continue; } } - return status; + return_VALUE(status); } static int acpi_video_bus_put_one_device(struct acpi_video_device *device) @@ -1554,9 +1605,10 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device) acpi_status status; struct acpi_video_bus *video; + ACPI_FUNCTION_TRACE("acpi_video_bus_put_one_device"); if (!device || !device->video) - return -ENOENT; + return_VALUE(-ENOENT); video = device->video; @@ -1565,11 +1617,14 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device) up(&video->sem); acpi_video_device_remove_fs(device->dev); - status = acpi_remove_notify_handler(device->dev->handle, + status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_video_device_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); - return 0; + return_VALUE(0); } static int acpi_video_bus_put_devices(struct acpi_video_bus *video) @@ -1577,6 +1632,7 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) int status; struct list_head *node, *next; + ACPI_FUNCTION_TRACE("acpi_video_bus_put_devices"); list_for_each_safe(node, next, &video->video_device_list) { struct acpi_video_device *data = @@ -1595,7 +1651,7 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) kfree(data); } - return 0; + return_VALUE(0); } /* acpi_video interface */ @@ -1615,12 +1671,14 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) struct acpi_video_bus *video = (struct acpi_video_bus *)data; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_video_bus_notify"); printk("video bus notify\n"); if (!video) - return; + return_VOID; - device = video->device; + if (acpi_bus_get_device(handle, &device)) + return_VOID; switch (event) { case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur, @@ -1649,7 +1707,7 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) break; } - return; + return_VOID; } static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) @@ -1658,12 +1716,14 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) (struct acpi_video_device *)data; struct acpi_device *device = NULL; + ACPI_FUNCTION_TRACE("acpi_video_device_notify"); printk("video device notify\n"); if (!video_device) - return; + return_VOID; - device = video_device->dev; + if (acpi_bus_get_device(handle, &device)) + return_VOID; switch (event) { case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */ @@ -1683,7 +1743,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) "Unsupported event [0x%x]\n", event)); break; } - return; + return_VOID; } static int acpi_video_bus_add(struct acpi_device *device) @@ -1692,16 +1752,17 @@ static int acpi_video_bus_add(struct acpi_device *device) acpi_status status = 0; struct acpi_video_bus *video = NULL; + ACPI_FUNCTION_TRACE("acpi_video_bus_add"); if (!device) - return -EINVAL; + return_VALUE(-EINVAL); video = kmalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); if (!video) - return -ENOMEM; + return_VALUE(-ENOMEM); memset(video, 0, sizeof(struct acpi_video_bus)); - video->device = device; + video->handle = device->handle; strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); acpi_driver_data(device) = video; @@ -1721,7 +1782,7 @@ static int acpi_video_bus_add(struct acpi_device *device) acpi_video_bus_get_devices(video, device); acpi_video_bus_start_devices(video); - status = acpi_install_notify_handler(device->handle, + status = acpi_install_notify_handler(video->handle, ACPI_DEVICE_NOTIFY, acpi_video_bus_notify, video); if (ACPI_FAILURE(status)) { @@ -1745,7 +1806,7 @@ static int acpi_video_bus_add(struct acpi_device *device) if (result) kfree(video); - return result; + return_VALUE(result); } static int acpi_video_bus_remove(struct acpi_device *device, int type) @@ -1753,17 +1814,21 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) acpi_status status = 0; struct acpi_video_bus *video = NULL; + ACPI_FUNCTION_TRACE("acpi_video_bus_remove"); if (!device || !acpi_driver_data(device)) - return -EINVAL; + return_VALUE(-EINVAL); video = (struct acpi_video_bus *)acpi_driver_data(device); acpi_video_bus_stop_devices(video); - status = acpi_remove_notify_handler(video->device->handle, + status = acpi_remove_notify_handler(video->handle, ACPI_DEVICE_NOTIFY, acpi_video_bus_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); acpi_video_bus_put_devices(video); acpi_video_bus_remove_fs(device); @@ -1771,7 +1836,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) kfree(video->attached_array); kfree(video); - return 0; + return_VALUE(0); } static int @@ -1781,9 +1846,10 @@ acpi_video_bus_match(struct acpi_device *device, struct acpi_driver *driver) acpi_handle h_dummy2; acpi_handle h_dummy3; + ACPI_FUNCTION_TRACE("acpi_video_bus_match"); if (!device || !driver) - return -EINVAL; + return_VALUE(-EINVAL); /* Since there is no HID, CID for ACPI Video drivers, we have * to check well known required nodes for each feature we support. @@ -1792,25 +1858,26 @@ acpi_video_bus_match(struct acpi_device *device, struct acpi_driver *driver) /* Does this device able to support video switching ? */ if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy1)) && ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy2))) - return 0; + return_VALUE(0); /* Does this device able to retrieve a video ROM ? */ if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy1))) - return 0; + return_VALUE(0); /* Does this device able to configure which video head to be POSTed ? */ if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy1)) && ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy2)) && ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy3))) - return 0; + return_VALUE(0); - return -ENODEV; + return_VALUE(-ENODEV); } static int __init acpi_video_init(void) { int result = 0; + ACPI_FUNCTION_TRACE("acpi_video_init"); /* acpi_dbg_level = 0xFFFFFFFF; @@ -1819,26 +1886,27 @@ static int __init acpi_video_init(void) acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); if (!acpi_video_dir) - return -ENODEV; + return_VALUE(-ENODEV); acpi_video_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_video_bus); if (result < 0) { remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); - return -ENODEV; + return_VALUE(-ENODEV); } - return 0; + return_VALUE(0); } static void __exit acpi_video_exit(void) { + ACPI_FUNCTION_TRACE("acpi_video_exit"); acpi_bus_unregister_driver(&acpi_video_bus); remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); - return; + return_VOID; } module_init(acpi_video_init); diff --git a/trunk/drivers/atm/adummy.c b/trunk/drivers/atm/adummy.c index 6cc93de0b71d..d1387cfe2d30 100644 --- a/trunk/drivers/atm/adummy.c +++ b/trunk/drivers/atm/adummy.c @@ -2,6 +2,7 @@ * adummy.c: a dummy ATM driver */ +#include #include #include #include diff --git a/trunk/drivers/atm/ambassador.c b/trunk/drivers/atm/ambassador.c index 4521a249dd56..4048681f36d5 100644 --- a/trunk/drivers/atm/ambassador.c +++ b/trunk/drivers/atm/ambassador.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -1996,7 +1995,7 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) { } i += 1; } - if (*pointer == ATM_POISON) { + if (*pointer == 0xdeadbeef) { return loader_start (lb, dev, ucode_start); } else { // cast needed as there is no %? for pointer differnces @@ -2287,7 +2286,7 @@ static int __devinit amb_probe(struct pci_dev *pci_dev, const struct pci_device_ setup_pci_dev(pci_dev); // grab (but share) IRQ and install handler - err = request_irq(irq, interrupt_handler, IRQF_SHARED, DEV_LABEL, dev); + err = request_irq(irq, interrupt_handler, SA_SHIRQ, DEV_LABEL, dev); if (err < 0) { PRINTK (KERN_ERR, "request IRQ failed!"); goto out_reset; diff --git a/trunk/drivers/atm/ambassador.h b/trunk/drivers/atm/ambassador.h index 8296420ceaef..84a93063cfe1 100644 --- a/trunk/drivers/atm/ambassador.h +++ b/trunk/drivers/atm/ambassador.h @@ -23,6 +23,7 @@ #ifndef AMBASSADOR_H #define AMBASSADOR_H +#include #ifdef CONFIG_ATM_AMBASSADOR_DEBUG #define DEBUG_AMBASSADOR diff --git a/trunk/drivers/atm/eni.c b/trunk/drivers/atm/eni.c index df359a6c14f6..c13c4d736ef5 100644 --- a/trunk/drivers/atm/eni.c +++ b/trunk/drivers/atm/eni.c @@ -4,6 +4,7 @@ #include +#include #include #include #include @@ -1797,7 +1798,7 @@ static int __devinit eni_start(struct atm_dev *dev) DPRINTK(">eni_start\n"); eni_dev = ENI_DEV(dev); - if (request_irq(eni_dev->irq,&eni_int,IRQF_SHARED,DEV_LABEL,dev)) { + if (request_irq(eni_dev->irq,&eni_int,SA_SHIRQ,DEV_LABEL,dev)) { printk(KERN_ERR DEV_LABEL "(itf %d): IRQ%d is already in use\n", dev->number,eni_dev->irq); error = -EAGAIN; diff --git a/trunk/drivers/atm/firestream.c b/trunk/drivers/atm/firestream.c index 38fc054bd671..d40605c1af73 100644 --- a/trunk/drivers/atm/firestream.c +++ b/trunk/drivers/atm/firestream.c @@ -1829,7 +1829,7 @@ static int __devinit fs_init (struct fs_dev *dev) init_q (dev, &dev->rx_rq[i], RXB_RQ(i), RXRQ_NENTRIES, 1); dev->irq = pci_dev->irq; - if (request_irq (dev->irq, fs_irq, IRQF_SHARED, "firestream", dev)) { + if (request_irq (dev->irq, fs_irq, SA_SHIRQ, "firestream", dev)) { printk (KERN_WARNING "couldn't get irq %d for firestream.\n", pci_dev->irq); /* XXX undo all previous stuff... */ return 1; diff --git a/trunk/drivers/atm/fore200e.c b/trunk/drivers/atm/fore200e.c index 98622130de5b..92923bf27233 100644 --- a/trunk/drivers/atm/fore200e.c +++ b/trunk/drivers/atm/fore200e.c @@ -25,6 +25,7 @@ */ +#include #include #include #include @@ -2123,7 +2124,7 @@ fore200e_change_qos(struct atm_vcc* vcc,struct atm_qos* qos, int flags) static int __devinit fore200e_irq_request(struct fore200e* fore200e) { - if (request_irq(fore200e->irq, fore200e_interrupt, IRQF_SHARED, fore200e->name, fore200e->atm_dev) < 0) { + if (request_irq(fore200e->irq, fore200e_interrupt, SA_SHIRQ, fore200e->name, fore200e->atm_dev) < 0) { printk(FORE200E "unable to reserve IRQ %s for device %s\n", fore200e_irq_itoa(fore200e->irq), fore200e->name); diff --git a/trunk/drivers/atm/fore200e.h b/trunk/drivers/atm/fore200e.h index f9abfdac33e4..2558eb853235 100644 --- a/trunk/drivers/atm/fore200e.h +++ b/trunk/drivers/atm/fore200e.h @@ -3,6 +3,7 @@ #define _FORE200E_H #ifdef __KERNEL__ +#include /* rx buffer sizes */ diff --git a/trunk/drivers/atm/he.c b/trunk/drivers/atm/he.c index d369130f4235..a486eb1f1640 100644 --- a/trunk/drivers/atm/he.c +++ b/trunk/drivers/atm/he.c @@ -55,6 +55,7 @@ */ +#include #include #include #include @@ -1007,7 +1008,7 @@ he_init_irq(struct he_dev *he_dev) he_writel(he_dev, 0x0, GRP_54_MAP); he_writel(he_dev, 0x0, GRP_76_MAP); - if (request_irq(he_dev->pci_dev->irq, he_irq_handler, IRQF_DISABLED|IRQF_SHARED, DEV_LABEL, he_dev)) { + if (request_irq(he_dev->pci_dev->irq, he_irq_handler, SA_INTERRUPT|SA_SHIRQ, DEV_LABEL, he_dev)) { hprintk("irq %d already in use\n", he_dev->pci_dev->irq); return -EINVAL; } diff --git a/trunk/drivers/atm/horizon.c b/trunk/drivers/atm/horizon.c index d1113e845f95..821c81e8cd38 100644 --- a/trunk/drivers/atm/horizon.c +++ b/trunk/drivers/atm/horizon.c @@ -2735,7 +2735,7 @@ static int __devinit hrz_probe(struct pci_dev *pci_dev, const struct pci_device_ irq = pci_dev->irq; if (request_irq(irq, interrupt_handler, - IRQF_SHARED, /* irqflags guess */ + SA_SHIRQ, /* irqflags guess */ DEV_LABEL, /* name guess */ dev)) { PRINTD(DBG_WARN, "request IRQ failed!"); diff --git a/trunk/drivers/atm/horizon.h b/trunk/drivers/atm/horizon.h index 4461229f56a5..e2cc7020fa3b 100644 --- a/trunk/drivers/atm/horizon.h +++ b/trunk/drivers/atm/horizon.h @@ -30,6 +30,7 @@ #ifndef DRIVER_ATM_HORIZON_H #define DRIVER_ATM_HORIZON_H +#include #ifdef CONFIG_ATM_HORIZON_DEBUG #define DEBUG_HORIZON diff --git a/trunk/drivers/atm/idt77252.c b/trunk/drivers/atm/idt77252.c index b0369bb20f08..b4a76cade646 100644 --- a/trunk/drivers/atm/idt77252.c +++ b/trunk/drivers/atm/idt77252.c @@ -34,8 +34,8 @@ static char const rcsid[] = #include +#include #include -#include #include #include #include @@ -3387,7 +3387,7 @@ init_card(struct atm_dev *dev) writel(SAR_STAT_TMROF, SAR_REG_STAT); } IPRINTK("%s: Request IRQ ... ", card->name); - if (request_irq(pcidev->irq, idt77252_interrupt, IRQF_DISABLED|IRQF_SHARED, + if (request_irq(pcidev->irq, idt77252_interrupt, SA_INTERRUPT|SA_SHIRQ, card->name, card) != 0) { printk("%s: can't allocate IRQ.\n", card->name); deinit_card(card); @@ -3658,7 +3658,7 @@ probe_sram(struct idt77252_dev *card) writel(SAR_CMD_WRITE_SRAM | (0 << 2), SAR_REG_CMD); for (addr = 0x4000; addr < 0x80000; addr += 0x4000) { - writel(ATM_POISON, SAR_REG_DR0); + writel(0xdeadbeef, SAR_REG_DR0); writel(SAR_CMD_WRITE_SRAM | (addr << 2), SAR_REG_CMD); writel(SAR_CMD_READ_SRAM | (0 << 2), SAR_REG_CMD); diff --git a/trunk/drivers/atm/iphase.c b/trunk/drivers/atm/iphase.c index f20b0b2c06c6..333a7bc609d2 100644 --- a/trunk/drivers/atm/iphase.c +++ b/trunk/drivers/atm/iphase.c @@ -2488,7 +2488,7 @@ static int __devinit ia_start(struct atm_dev *dev) u32 ctrl_reg; IF_EVENT(printk(">ia_start\n");) iadev = INPH_IA_DEV(dev); - if (request_irq(iadev->irq, &ia_int, IRQF_SHARED, DEV_LABEL, dev)) { + if (request_irq(iadev->irq, &ia_int, SA_SHIRQ, DEV_LABEL, dev)) { printk(KERN_ERR DEV_LABEL "(itf %d): IRQ%d is already in use\n", dev->number, iadev->irq); error = -EAGAIN; diff --git a/trunk/drivers/atm/iphase.h b/trunk/drivers/atm/iphase.h index 133eefcc0475..b8d0bd4d6c30 100644 --- a/trunk/drivers/atm/iphase.h +++ b/trunk/drivers/atm/iphase.h @@ -43,6 +43,7 @@ #ifndef IPHASE_H #define IPHASE_H +#include /************************ IADBG DEFINE *********************************/ /* IADebugFlag Bit Map */ diff --git a/trunk/drivers/atm/lanai.c b/trunk/drivers/atm/lanai.c index fe60a59b7fc0..cac09e353be8 100644 --- a/trunk/drivers/atm/lanai.c +++ b/trunk/drivers/atm/lanai.c @@ -2240,7 +2240,7 @@ static int __devinit lanai_dev_open(struct atm_dev *atmdev) conf2_write(lanai); reg_write(lanai, TX_FIFO_DEPTH, TxDepth_Reg); reg_write(lanai, 0, CBR_ICG_Reg); /* CBR defaults to no limit */ - if ((result = request_irq(lanai->pci->irq, lanai_int, IRQF_SHARED, + if ((result = request_irq(lanai->pci->irq, lanai_int, SA_SHIRQ, DEV_LABEL, lanai)) != 0) { printk(KERN_ERR DEV_LABEL ": can't allocate interrupt\n"); goto error_vcctable; diff --git a/trunk/drivers/atm/nicstar.c b/trunk/drivers/atm/nicstar.c index b8036899e56f..074abc81ec3d 100644 --- a/trunk/drivers/atm/nicstar.c +++ b/trunk/drivers/atm/nicstar.c @@ -36,6 +36,7 @@ /* Header files ***************************************************************/ #include +#include #include #include #include @@ -625,7 +626,7 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev) if (mac[i] == NULL) nicstar_init_eprom(card->membase); - if (request_irq(pcidev->irq, &ns_irq_handler, IRQF_DISABLED | IRQF_SHARED, "nicstar", card) != 0) + if (request_irq(pcidev->irq, &ns_irq_handler, SA_INTERRUPT | SA_SHIRQ, "nicstar", card) != 0) { printk("nicstar%d: can't allocate IRQ %d.\n", i, pcidev->irq); error = 9; diff --git a/trunk/drivers/atm/zatm.c b/trunk/drivers/atm/zatm.c index 2c65e82f0d6b..f484747f255e 100644 --- a/trunk/drivers/atm/zatm.c +++ b/trunk/drivers/atm/zatm.c @@ -3,6 +3,7 @@ /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ +#include #include #include #include @@ -1270,7 +1271,7 @@ static int __init zatm_start(struct atm_dev *dev) zatm_dev->rx_map = zatm_dev->tx_map = NULL; for (i = 0; i < NR_MBX; i++) zatm_dev->mbx_start[i] = 0; - error = request_irq(zatm_dev->irq, zatm_int, IRQF_SHARED, DEV_LABEL, dev); + error = request_irq(zatm_dev->irq, zatm_int, SA_SHIRQ, DEV_LABEL, dev); if (error < 0) { printk(KERN_ERR DEV_LABEL "(itf %d): IRQ%d is already in use\n", dev->number,zatm_dev->irq); diff --git a/trunk/drivers/atm/zatm.h b/trunk/drivers/atm/zatm.h index ae9165ce15a0..416fe0fda60c 100644 --- a/trunk/drivers/atm/zatm.h +++ b/trunk/drivers/atm/zatm.h @@ -6,6 +6,7 @@ #ifndef DRIVER_ATM_ZATM_H #define DRIVER_ATM_ZATM_H +#include #include #include #include diff --git a/trunk/drivers/base/bus.c b/trunk/drivers/base/bus.c index 83fa8b291a59..050d86d0b872 100644 --- a/trunk/drivers/base/bus.c +++ b/trunk/drivers/base/bus.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/base/class.c b/trunk/drivers/base/class.c index de8908320f23..9aa127460262 100644 --- a/trunk/drivers/base/class.c +++ b/trunk/drivers/base/class.c @@ -10,6 +10,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/base/core.c b/trunk/drivers/base/core.c index b21f864c9ce8..27c2176895de 100644 --- a/trunk/drivers/base/core.c +++ b/trunk/drivers/base/core.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/base/driver.c b/trunk/drivers/base/driver.c index 562600dd540a..b400314e1c62 100644 --- a/trunk/drivers/base/driver.c +++ b/trunk/drivers/base/driver.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/base/node.c b/trunk/drivers/base/node.c index d7de1753e094..eae2bdc183bb 100644 --- a/trunk/drivers/base/node.c +++ b/trunk/drivers/base/node.c @@ -40,13 +40,24 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) int n; int nid = dev->id; struct sysinfo i; + struct page_state ps; unsigned long inactive; unsigned long active; unsigned long free; si_meminfo_node(&i, nid); + get_page_state_node(&ps, nid); __get_zone_counts(&active, &inactive, &free, NODE_DATA(nid)); + /* Check for negative values in these approximate counters */ + if ((long)ps.nr_dirty < 0) + ps.nr_dirty = 0; + if ((long)ps.nr_writeback < 0) + ps.nr_writeback = 0; + if ((long)ps.nr_mapped < 0) + ps.nr_mapped = 0; + if ((long)ps.nr_slab < 0) + ps.nr_slab = 0; n = sprintf(buf, "\n" "Node %d MemTotal: %8lu kB\n" @@ -60,12 +71,7 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) "Node %d LowFree: %8lu kB\n" "Node %d Dirty: %8lu kB\n" "Node %d Writeback: %8lu kB\n" - "Node %d FilePages: %8lu kB\n" "Node %d Mapped: %8lu kB\n" - "Node %d AnonPages: %8lu kB\n" - "Node %d PageTables: %8lu kB\n" - "Node %d NFS Unstable: %8lu kB\n" - "Node %d Bounce: %8lu kB\n" "Node %d Slab: %8lu kB\n", nid, K(i.totalram), nid, K(i.freeram), @@ -76,15 +82,10 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) nid, K(i.freehigh), nid, K(i.totalram - i.totalhigh), nid, K(i.freeram - i.freehigh), - nid, K(node_page_state(nid, NR_FILE_DIRTY)), - nid, K(node_page_state(nid, NR_WRITEBACK)), - nid, K(node_page_state(nid, NR_FILE_PAGES)), - nid, K(node_page_state(nid, NR_FILE_MAPPED)), - nid, K(node_page_state(nid, NR_ANON_PAGES)), - nid, K(node_page_state(nid, NR_PAGETABLE)), - nid, K(node_page_state(nid, NR_UNSTABLE_NFS)), - nid, K(node_page_state(nid, NR_BOUNCE)), - nid, K(node_page_state(nid, NR_SLAB))); + nid, K(ps.nr_dirty), + nid, K(ps.nr_writeback), + nid, K(ps.nr_mapped), + nid, K(ps.nr_slab)); n += hugetlb_report_node_meminfo(nid, buf + n); return n; } @@ -94,6 +95,28 @@ static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL); static ssize_t node_read_numastat(struct sys_device * dev, char * buf) { + unsigned long numa_hit, numa_miss, interleave_hit, numa_foreign; + unsigned long local_node, other_node; + int i, cpu; + pg_data_t *pg = NODE_DATA(dev->id); + numa_hit = 0; + numa_miss = 0; + interleave_hit = 0; + numa_foreign = 0; + local_node = 0; + other_node = 0; + for (i = 0; i < MAX_NR_ZONES; i++) { + struct zone *z = &pg->node_zones[i]; + for_each_online_cpu(cpu) { + struct per_cpu_pageset *ps = zone_pcp(z,cpu); + numa_hit += ps->numa_hit; + numa_miss += ps->numa_miss; + numa_foreign += ps->numa_foreign; + interleave_hit += ps->interleave_hit; + local_node += ps->local_node; + other_node += ps->other_node; + } + } return sprintf(buf, "numa_hit %lu\n" "numa_miss %lu\n" @@ -101,12 +124,12 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf) "interleave_hit %lu\n" "local_node %lu\n" "other_node %lu\n", - node_page_state(dev->id, NUMA_HIT), - node_page_state(dev->id, NUMA_MISS), - node_page_state(dev->id, NUMA_FOREIGN), - node_page_state(dev->id, NUMA_INTERLEAVE_HIT), - node_page_state(dev->id, NUMA_LOCAL), - node_page_state(dev->id, NUMA_OTHER)); + numa_hit, + numa_miss, + numa_foreign, + interleave_hit, + local_node, + other_node); } static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); diff --git a/trunk/drivers/base/power/main.c b/trunk/drivers/base/power/main.c index fdfa3d0cf6af..0d2e101e4f15 100644 --- a/trunk/drivers/base/power/main.c +++ b/trunk/drivers/base/power/main.c @@ -19,6 +19,7 @@ * ancestral dependencies that the subsystem list maintains. */ +#include #include #include "power.h" diff --git a/trunk/drivers/base/power/shutdown.c b/trunk/drivers/base/power/shutdown.c index 3483ae4d57f5..8826a5b6673e 100644 --- a/trunk/drivers/base/power/shutdown.c +++ b/trunk/drivers/base/power/shutdown.c @@ -8,6 +8,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/base/sys.c b/trunk/drivers/base/sys.c index 04e5db445c74..6858178b3aff 100644 --- a/trunk/drivers/base/sys.c +++ b/trunk/drivers/base/sys.c @@ -12,6 +12,7 @@ * add themselves as children of the system bus. */ +#include #include #include #include diff --git a/trunk/drivers/block/DAC960.c b/trunk/drivers/block/DAC960.c index 4cd23c3eab41..50ca1aa4ee3b 100644 --- a/trunk/drivers/block/DAC960.c +++ b/trunk/drivers/block/DAC960.c @@ -3014,7 +3014,7 @@ DAC960_DetectController(struct pci_dev *PCI_Device, Acquire shared access to the IRQ Channel. */ IRQ_Channel = PCI_Device->irq; - if (request_irq(IRQ_Channel, InterruptHandler, IRQF_SHARED, + if (request_irq(IRQ_Channel, InterruptHandler, SA_SHIRQ, Controller->FullModelName, Controller) < 0) { DAC960_Error("Unable to acquire IRQ Channel %d for Controller at\n", diff --git a/trunk/drivers/block/acsi.c b/trunk/drivers/block/acsi.c index 0b80fbb8dbfd..a317e4303952 100644 --- a/trunk/drivers/block/acsi.c +++ b/trunk/drivers/block/acsi.c @@ -43,6 +43,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/block/cciss.c b/trunk/drivers/block/cciss.c index 1c4df22dfd2a..05fb08312c01 100644 --- a/trunk/drivers/block/cciss.c +++ b/trunk/drivers/block/cciss.c @@ -3159,7 +3159,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, /* make sure the board interrupts are off */ hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_OFF); if (request_irq(hba[i]->intr[SIMPLE_MODE_INT], do_cciss_intr, - IRQF_DISABLED | IRQF_SHARED, hba[i]->devname, hba[i])) { + SA_INTERRUPT | SA_SHIRQ, hba[i]->devname, hba[i])) { printk(KERN_ERR "cciss: Unable to get irq %d for %s\n", hba[i]->intr[SIMPLE_MODE_INT], hba[i]->devname); goto clean2; diff --git a/trunk/drivers/block/cpqarray.c b/trunk/drivers/block/cpqarray.c index 757f42dd8e86..bfd245df0a8c 100644 --- a/trunk/drivers/block/cpqarray.c +++ b/trunk/drivers/block/cpqarray.c @@ -408,7 +408,7 @@ static int __init cpqarray_register_ctlr( int i, struct pci_dev *pdev) } hba[i]->access.set_intr_mask(hba[i], 0); if (request_irq(hba[i]->intr, do_ida_intr, - IRQF_DISABLED|IRQF_SHARED, hba[i]->devname, hba[i])) + SA_INTERRUPT|SA_SHIRQ, hba[i]->devname, hba[i])) { printk(KERN_ERR "cpqarray: Unable to get irq %d for %s\n", hba[i]->intr, hba[i]->devname); diff --git a/trunk/drivers/block/floppy.c b/trunk/drivers/block/floppy.c index 5109fa37c662..0242cbb86a87 100644 --- a/trunk/drivers/block/floppy.c +++ b/trunk/drivers/block/floppy.c @@ -249,6 +249,18 @@ static int irqdma_allocated; #include /* for the compatibility eject ioctl */ #include +/* + * Interrupt freeing also means /proc VFS work - dont do it + * from interrupt context. We push this work into keventd: + */ +static void fd_free_irq_fn(void *data) +{ + fd_free_irq(); +} + +static DECLARE_WORK(fd_free_irq_work, fd_free_irq_fn, NULL); + + static struct request *current_req; static struct request_queue *floppy_queue; static void do_fd_request(request_queue_t * q); @@ -814,6 +826,15 @@ static int set_dor(int fdc, char mask, char data) UDRS->select_date = jiffies; } } + /* + * We should propagate failures to grab the resources back + * nicely from here. Actually we ought to rewrite the fd + * driver some day too. + */ + if (newdor & FLOPPY_MOTOR_MASK) + floppy_grab_irq_and_dma(); + if (olddor & FLOPPY_MOTOR_MASK) + floppy_release_irq_and_dma(); return olddor; } @@ -871,6 +892,8 @@ static int _lock_fdc(int drive, int interruptible, int line) line); return -1; } + if (floppy_grab_irq_and_dma() == -1) + return -EBUSY; if (test_and_set_bit(0, &fdc_busy)) { DECLARE_WAITQUEUE(wait, current); @@ -892,8 +915,6 @@ static int _lock_fdc(int drive, int interruptible, int line) set_current_state(TASK_RUNNING); remove_wait_queue(&fdc_wait, &wait); - - flush_scheduled_work(); } command_status = FD_COMMAND_NONE; @@ -927,6 +948,7 @@ static inline void unlock_fdc(void) if (elv_next_request(floppy_queue)) do_fd_request(floppy_queue); spin_unlock_irqrestore(&floppy_lock, flags); + floppy_release_irq_and_dma(); wake_up(&fdc_wait); } @@ -3672,8 +3694,8 @@ static int floppy_release(struct inode *inode, struct file *filp) } if (!UDRS->fd_ref) opened_bdev[drive] = NULL; + floppy_release_irq_and_dma(); mutex_unlock(&open_lock); - return 0; } @@ -3704,6 +3726,9 @@ static int floppy_open(struct inode *inode, struct file *filp) if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (filp->f_flags & O_EXCL))) goto out2; + if (floppy_grab_irq_and_dma()) + goto out2; + if (filp->f_flags & O_EXCL) UDRS->fd_ref = -1; else @@ -3780,6 +3805,7 @@ static int floppy_open(struct inode *inode, struct file *filp) UDRS->fd_ref--; if (!UDRS->fd_ref) opened_bdev[drive] = NULL; + floppy_release_irq_and_dma(); out2: mutex_unlock(&open_lock); return res; @@ -3796,9 +3822,14 @@ static int check_floppy_change(struct gendisk *disk) return 1; if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) { + if (floppy_grab_irq_and_dma()) { + return 1; + } + lock_fdc(drive, 0); poll_drive(0, 0); process_fd_request(); + floppy_release_irq_and_dma(); } if (UTESTF(FD_DISK_CHANGED) || @@ -4315,6 +4346,7 @@ static int __init floppy_init(void) fdc = 0; del_timer(&fd_timeout); current_drive = 0; + floppy_release_irq_and_dma(); initialising = 0; if (have_no_fdc) { DPRINT("no floppy controllers found\n"); @@ -4472,7 +4504,7 @@ static void floppy_release_irq_and_dma(void) if (irqdma_allocated) { fd_disable_dma(); fd_free_dma(); - fd_free_irq(); + schedule_work(&fd_free_irq_work); irqdma_allocated = 0; } set_dor(0, ~0, 8); @@ -4568,6 +4600,8 @@ void cleanup_module(void) /* eject disk, if any */ fd_eject(0); + flush_scheduled_work(); /* fd_free_irq() might be pending */ + wait_for_completion(&device_release); } diff --git a/trunk/drivers/block/loop.c b/trunk/drivers/block/loop.c index 7b3b94ddddcc..013c5daddb0b 100644 --- a/trunk/drivers/block/loop.c +++ b/trunk/drivers/block/loop.c @@ -50,6 +50,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/block/nbd.c b/trunk/drivers/block/nbd.c index 0a1b1ea36ddc..39662f0c9cce 100644 --- a/trunk/drivers/block/nbd.c +++ b/trunk/drivers/block/nbd.c @@ -50,9 +50,9 @@ #define DBG_RX 0x0200 #define DBG_TX 0x0400 static unsigned int debugflags; +static unsigned int nbds_max = 16; #endif /* NDEBUG */ -static unsigned int nbds_max = 16; static struct nbd_device nbd_dev[MAX_NBD]; /* diff --git a/trunk/drivers/block/paride/paride.c b/trunk/drivers/block/paride/paride.c index 4b258f7836f3..ce94aa11f6a7 100644 --- a/trunk/drivers/block/paride/paride.c +++ b/trunk/drivers/block/paride/paride.c @@ -21,6 +21,7 @@ #define PI_VERSION "1.06" #include +#include #include #include #include diff --git a/trunk/drivers/block/pktcdvd.c b/trunk/drivers/block/pktcdvd.c index bde2c64b6346..3e4cce5e4736 100644 --- a/trunk/drivers/block/pktcdvd.c +++ b/trunk/drivers/block/pktcdvd.c @@ -44,6 +44,7 @@ *************************************************************************/ #include +#include #include #include #include diff --git a/trunk/drivers/block/ps2esdi.c b/trunk/drivers/block/ps2esdi.c index 5537974fb242..a729013a3973 100644 --- a/trunk/drivers/block/ps2esdi.c +++ b/trunk/drivers/block/ps2esdi.c @@ -29,6 +29,7 @@ #define DEVICE_NAME "PS/2 ESDI" +#include #include #include #include @@ -340,9 +341,9 @@ static int __init ps2esdi_geninit(void) /* try to grab IRQ, and try to grab a slow IRQ if it fails, so we can share with the SCSI driver */ if (request_irq(PS2ESDI_IRQ, ps2esdi_interrupt_handler, - IRQF_DISABLED | IRQF_SHARED, "PS/2 ESDI", &ps2esdi_gendisk) + SA_INTERRUPT | SA_SHIRQ, "PS/2 ESDI", &ps2esdi_gendisk) && request_irq(PS2ESDI_IRQ, ps2esdi_interrupt_handler, - IRQF_SHARED, "PS/2 ESDI", &ps2esdi_gendisk) + SA_SHIRQ, "PS/2 ESDI", &ps2esdi_gendisk) ) { printk("%s: Unable to get IRQ %d\n", DEVICE_NAME, PS2ESDI_IRQ); error = -EBUSY; diff --git a/trunk/drivers/block/rd.c b/trunk/drivers/block/rd.c index 3cf246abb5ec..a9e1c2524c2a 100644 --- a/trunk/drivers/block/rd.c +++ b/trunk/drivers/block/rd.c @@ -42,6 +42,7 @@ * and set blk_size for -ENOSPC, Werner Fink , Apr '99 */ +#include #include #include #include diff --git a/trunk/drivers/block/swim3.c b/trunk/drivers/block/swim3.c index cc42e762396f..628877945f9b 100644 --- a/trunk/drivers/block/swim3.c +++ b/trunk/drivers/block/swim3.c @@ -16,6 +16,7 @@ * handle GCR disks */ +#include #include #include #include @@ -250,6 +251,8 @@ static int floppy_open(struct inode *inode, struct file *filp); static int floppy_release(struct inode *inode, struct file *filp); static int floppy_check_change(struct gendisk *disk); static int floppy_revalidate(struct gendisk *disk); +static int swim3_add_device(struct device_node *swims); +int swim3_init(void); #ifndef CONFIG_PMAC_MEDIABAY #define check_media_bay(which, what) 1 @@ -1009,63 +1012,114 @@ static struct block_device_operations floppy_fops = { .revalidate_disk= floppy_revalidate, }; -static int swim3_add_device(struct macio_dev *mdev, int index) +int swim3_init(void) +{ + struct device_node *swim; + int err = -ENOMEM; + int i; + + swim = find_devices("floppy"); + while (swim && (floppy_count < MAX_FLOPPIES)) + { + swim3_add_device(swim); + swim = swim->next; + } + + swim = find_devices("swim3"); + while (swim && (floppy_count < MAX_FLOPPIES)) + { + swim3_add_device(swim); + swim = swim->next; + } + + if (!floppy_count) + return -ENODEV; + + for (i = 0; i < floppy_count; i++) { + disks[i] = alloc_disk(1); + if (!disks[i]) + goto out; + } + + if (register_blkdev(FLOPPY_MAJOR, "fd")) { + err = -EBUSY; + goto out; + } + + swim3_queue = blk_init_queue(do_fd_request, &swim3_lock); + if (!swim3_queue) { + err = -ENOMEM; + goto out_queue; + } + + for (i = 0; i < floppy_count; i++) { + struct gendisk *disk = disks[i]; + disk->major = FLOPPY_MAJOR; + disk->first_minor = i; + disk->fops = &floppy_fops; + disk->private_data = &floppy_states[i]; + disk->queue = swim3_queue; + disk->flags |= GENHD_FL_REMOVABLE; + sprintf(disk->disk_name, "fd%d", i); + set_capacity(disk, 2880); + add_disk(disk); + } + return 0; + +out_queue: + unregister_blkdev(FLOPPY_MAJOR, "fd"); +out: + while (i--) + put_disk(disks[i]); + /* shouldn't we do something with results of swim_add_device()? */ + return err; +} + +static int swim3_add_device(struct device_node *swim) { - struct device_node *swim = mdev->ofdev.node; struct device_node *mediabay; - struct floppy_state *fs = &floppy_states[index]; - int rc = -EBUSY; + struct floppy_state *fs = &floppy_states[floppy_count]; + struct resource res_reg, res_dma; - /* Check & Request resources */ - if (macio_resource_count(mdev) < 2) { - printk(KERN_WARNING "ifd%d: no address for %s\n", - index, swim->full_name); - return -ENXIO; + if (of_address_to_resource(swim, 0, &res_reg) || + of_address_to_resource(swim, 1, &res_dma)) { + printk(KERN_ERR "swim3: Can't get addresses\n"); + return -EINVAL; } - if (macio_irq_count(mdev) < 2) { - printk(KERN_WARNING "fd%d: no intrs for device %s\n", - index, swim->full_name); + if (request_mem_region(res_reg.start, res_reg.end - res_reg.start + 1, + " (reg)") == NULL) { + printk(KERN_ERR "swim3: Can't request register space\n"); + return -EINVAL; } - if (macio_request_resource(mdev, 0, "swim3 (mmio)")) { - printk(KERN_ERR "fd%d: can't request mmio resource for %s\n", - index, swim->full_name); - return -EBUSY; + if (request_mem_region(res_dma.start, res_dma.end - res_dma.start + 1, + " (dma)") == NULL) { + release_mem_region(res_reg.start, + res_reg.end - res_reg.start + 1); + printk(KERN_ERR "swim3: Can't request DMA space\n"); + return -EINVAL; } - if (macio_request_resource(mdev, 1, "swim3 (dma)")) { - printk(KERN_ERR "fd%d: can't request dma resource for %s\n", - index, swim->full_name); - macio_release_resource(mdev, 0); - return -EBUSY; + + if (swim->n_intrs < 2) { + printk(KERN_INFO "swim3: expecting 2 intrs (n_intrs:%d)\n", + swim->n_intrs); + release_mem_region(res_reg.start, + res_reg.end - res_reg.start + 1); + release_mem_region(res_dma.start, + res_dma.end - res_dma.start + 1); + return -EINVAL; } - dev_set_drvdata(&mdev->ofdev.dev, fs); - mediabay = (strcasecmp(swim->parent->type, "media-bay") == 0) ? - swim->parent : NULL; + mediabay = (strcasecmp(swim->parent->type, "media-bay") == 0) ? swim->parent : NULL; if (mediabay == NULL) pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 1); memset(fs, 0, sizeof(*fs)); spin_lock_init(&fs->lock); fs->state = idle; - fs->swim3 = (struct swim3 __iomem *) - ioremap(macio_resource_start(mdev, 0), 0x200); - if (fs->swim3 == NULL) { - printk("fd%d: couldn't map registers for %s\n", - index, swim->full_name); - rc = -ENOMEM; - goto out_release; - } - fs->dma = (struct dbdma_regs __iomem *) - ioremap(macio_resource_start(mdev, 1), 0x200); - if (fs->dma == NULL) { - printk("fd%d: couldn't map DMA for %s\n", - index, swim->full_name); - iounmap(fs->swim3); - rc = -ENOMEM; - goto out_release; - } - fs->swim3_intr = macio_irq(mdev, 0); - fs->dma_intr = macio_irq(mdev, 1);; + fs->swim3 = (struct swim3 __iomem *)ioremap(res_reg.start, 0x200); + fs->dma = (struct dbdma_regs __iomem *)ioremap(res_dma.start, 0x200); + fs->swim3_intr = swim->intrs[0].line; + fs->dma_intr = swim->intrs[1].line; fs->cur_cyl = -1; fs->cur_sector = -1; fs->secpercyl = 36; @@ -1079,16 +1133,15 @@ static int swim3_add_device(struct macio_dev *mdev, int index) st_le16(&fs->dma_cmd[1].command, DBDMA_STOP); if (request_irq(fs->swim3_intr, swim3_interrupt, 0, "SWIM3", fs)) { - printk(KERN_ERR "fd%d: couldn't request irq %d for %s\n", - index, fs->swim3_intr, swim->full_name); + printk(KERN_ERR "Couldn't get irq %d for SWIM3\n", fs->swim3_intr); pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 0); - goto out_unmap; return -EBUSY; } /* if (request_irq(fs->dma_intr, fd_dma_interrupt, 0, "SWIM3-dma", fs)) { printk(KERN_ERR "Couldn't get irq %d for SWIM3 DMA", fs->dma_intr); + pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 0); return -EBUSY; } */ @@ -1098,90 +1151,8 @@ static int swim3_add_device(struct macio_dev *mdev, int index) printk(KERN_INFO "fd%d: SWIM3 floppy controller %s\n", floppy_count, mediabay ? "in media bay" : ""); - return 0; - - out_unmap: - iounmap(fs->dma); - iounmap(fs->swim3); - - out_release: - macio_release_resource(mdev, 0); - macio_release_resource(mdev, 1); - - return rc; -} - -static int __devinit swim3_attach(struct macio_dev *mdev, const struct of_device_id *match) -{ - int i, rc; - struct gendisk *disk; - - /* Add the drive */ - rc = swim3_add_device(mdev, floppy_count); - if (rc) - return rc; - - /* Now create the queue if not there yet */ - if (swim3_queue == NULL) { - /* If we failed, there isn't much we can do as the driver is still - * too dumb to remove the device, just bail out - */ - if (register_blkdev(FLOPPY_MAJOR, "fd")) - return 0; - swim3_queue = blk_init_queue(do_fd_request, &swim3_lock); - if (swim3_queue == NULL) { - unregister_blkdev(FLOPPY_MAJOR, "fd"); - return 0; - } - } - - /* Now register that disk. Same comment about failure handling */ - i = floppy_count++; - disk = disks[i] = alloc_disk(1); - if (disk == NULL) - return 0; - - disk->major = FLOPPY_MAJOR; - disk->first_minor = i; - disk->fops = &floppy_fops; - disk->private_data = &floppy_states[i]; - disk->queue = swim3_queue; - disk->flags |= GENHD_FL_REMOVABLE; - sprintf(disk->disk_name, "fd%d", i); - set_capacity(disk, 2880); - add_disk(disk); - - return 0; -} - -static struct of_device_id swim3_match[] = -{ - { - .name = "swim3", - }, - { - .compatible = "ohare-swim3" - }, - { - .compatible = "swim3" - }, -}; - -static struct macio_driver swim3_driver = -{ - .name = "swim3", - .match_table = swim3_match, - .probe = swim3_attach, -#if 0 - .suspend = swim3_suspend, - .resume = swim3_resume, -#endif -}; - - -int swim3_init(void) -{ - macio_register_driver(&swim3_driver); + floppy_count++; + return 0; } diff --git a/trunk/drivers/block/sx8.c b/trunk/drivers/block/sx8.c index c6beee18a07c..10a4aa5fb54d 100644 --- a/trunk/drivers/block/sx8.c +++ b/trunk/drivers/block/sx8.c @@ -1676,7 +1676,7 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_master(pdev); - rc = request_irq(pdev->irq, carm_interrupt, IRQF_SHARED, DRV_NAME, host); + rc = request_irq(pdev->irq, carm_interrupt, SA_SHIRQ, DRV_NAME, host); if (rc) { printk(KERN_ERR DRV_NAME "(%s): irq alloc failure\n", pci_name(pdev)); diff --git a/trunk/drivers/block/umem.c b/trunk/drivers/block/umem.c index 5d8925bd9045..585197b95af7 100644 --- a/trunk/drivers/block/umem.c +++ b/trunk/drivers/block/umem.c @@ -35,6 +35,7 @@ */ //#define DEBUG /* uncomment if you want debugging info (pr_debug) */ +#include #include #include #include @@ -1040,7 +1041,7 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i card->win_size = data; - if (request_irq(dev->irq, mm_interrupt, IRQF_SHARED, "pci-umem", card)) { + if (request_irq(dev->irq, mm_interrupt, SA_SHIRQ, "pci-umem", card)) { printk(KERN_ERR "MM%d: Unable to allocate IRQ\n", card->card_number); ret = -ENODEV; diff --git a/trunk/drivers/bluetooth/bcm203x.c b/trunk/drivers/bluetooth/bcm203x.c index 6f67141f4de0..3e7a067cc087 100644 --- a/trunk/drivers/bluetooth/bcm203x.c +++ b/trunk/drivers/bluetooth/bcm203x.c @@ -22,6 +22,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/bluetooth/bfusb.c b/trunk/drivers/bluetooth/bfusb.c index 23f96213f4ac..8947c8837dac 100644 --- a/trunk/drivers/bluetooth/bfusb.c +++ b/trunk/drivers/bluetooth/bfusb.c @@ -21,6 +21,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/bluetooth/bluecard_cs.c b/trunk/drivers/bluetooth/bluecard_cs.c index 8eebf9ca3786..473a13b22b29 100644 --- a/trunk/drivers/bluetooth/bluecard_cs.c +++ b/trunk/drivers/bluetooth/bluecard_cs.c @@ -20,6 +20,7 @@ * */ +#include #include #include @@ -739,7 +740,6 @@ static int bluecard_open(bluecard_info_t *info) hdev->type = HCI_PCCARD; hdev->driver_data = info; - SET_HCIDEV_DEV(hdev, &info->p_dev->dev); hdev->open = bluecard_hci_open; hdev->close = bluecard_hci_close; diff --git a/trunk/drivers/bluetooth/bpa10x.c b/trunk/drivers/bluetooth/bpa10x.c index e0231dc2cb1a..9446960ac742 100644 --- a/trunk/drivers/bluetooth/bpa10x.c +++ b/trunk/drivers/bluetooth/bpa10x.c @@ -21,6 +21,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/bluetooth/bt3c_cs.c b/trunk/drivers/bluetooth/bt3c_cs.c index df7bb016df49..b94ac2f9f7ba 100644 --- a/trunk/drivers/bluetooth/bt3c_cs.c +++ b/trunk/drivers/bluetooth/bt3c_cs.c @@ -21,6 +21,7 @@ * */ +#include #include #include @@ -582,7 +583,6 @@ static int bt3c_open(bt3c_info_t *info) hdev->type = HCI_PCCARD; hdev->driver_data = info; - SET_HCIDEV_DEV(hdev, &info->p_dev->dev); hdev->open = bt3c_hci_open; hdev->close = bt3c_hci_close; diff --git a/trunk/drivers/bluetooth/btuart_cs.c b/trunk/drivers/bluetooth/btuart_cs.c index 746ccca97f6f..9ce4c93467e5 100644 --- a/trunk/drivers/bluetooth/btuart_cs.c +++ b/trunk/drivers/bluetooth/btuart_cs.c @@ -20,6 +20,7 @@ * */ +#include #include #include @@ -502,7 +503,6 @@ static int btuart_open(btuart_info_t *info) hdev->type = HCI_PCCARD; hdev->driver_data = info; - SET_HCIDEV_DEV(hdev, &info->p_dev->dev); hdev->open = btuart_hci_open; hdev->close = btuart_hci_close; diff --git a/trunk/drivers/bluetooth/dtl1_cs.c b/trunk/drivers/bluetooth/dtl1_cs.c index 0e99def8a1e3..ed8dca84ff69 100644 --- a/trunk/drivers/bluetooth/dtl1_cs.c +++ b/trunk/drivers/bluetooth/dtl1_cs.c @@ -20,6 +20,7 @@ * */ +#include #include #include @@ -484,7 +485,6 @@ static int dtl1_open(dtl1_info_t *info) hdev->type = HCI_PCCARD; hdev->driver_data = info; - SET_HCIDEV_DEV(hdev, &info->p_dev->dev); hdev->open = dtl1_hci_open; hdev->close = dtl1_hci_close; diff --git a/trunk/drivers/bluetooth/hci_bcsp.c b/trunk/drivers/bluetooth/hci_bcsp.c index d0cface535fb..7bd4ef904115 100644 --- a/trunk/drivers/bluetooth/hci_bcsp.c +++ b/trunk/drivers/bluetooth/hci_bcsp.c @@ -22,6 +22,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/bluetooth/hci_h4.c b/trunk/drivers/bluetooth/hci_h4.c index ad62abbbb739..4804d474dc87 100644 --- a/trunk/drivers/bluetooth/hci_h4.c +++ b/trunk/drivers/bluetooth/hci_h4.c @@ -23,6 +23,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/bluetooth/hci_ldisc.c b/trunk/drivers/bluetooth/hci_ldisc.c index 1994270c16e1..613673b12fa6 100644 --- a/trunk/drivers/bluetooth/hci_ldisc.c +++ b/trunk/drivers/bluetooth/hci_ldisc.c @@ -23,6 +23,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/bluetooth/hci_usb.c b/trunk/drivers/bluetooth/hci_usb.c index 6a0c2230f82f..92382e823285 100644 --- a/trunk/drivers/bluetooth/hci_usb.c +++ b/trunk/drivers/bluetooth/hci_usb.c @@ -31,6 +31,7 @@ * */ +#include #include #include @@ -122,9 +123,6 @@ static struct usb_device_id blacklist_ids[] = { /* RTX Telecom based adapter with buggy SCO support */ { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC }, - /* Belkin F8T012 */ - { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_WRONG_SCO_MTU }, - /* Digianswer devices */ { USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER }, { USB_DEVICE(0x08fd, 0x0002), .driver_info = HCI_IGNORE }, @@ -132,9 +130,6 @@ static struct usb_device_id blacklist_ids[] = { /* CSR BlueCore Bluetooth Sniffer */ { USB_DEVICE(0x0a12, 0x0002), .driver_info = HCI_SNIFFER }, - /* Frontline ComProbe Bluetooth Sniffer */ - { USB_DEVICE(0x16d3, 0x0002), .driver_info = HCI_SNIFFER }, - { } /* Terminating entry */ }; @@ -990,9 +985,6 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id if (reset || id->driver_info & HCI_RESET) set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks); - if (id->driver_info & HCI_WRONG_SCO_MTU) - set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks); - if (id->driver_info & HCI_SNIFFER) { if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997) set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); @@ -1051,81 +1043,10 @@ static void hci_usb_disconnect(struct usb_interface *intf) hci_free_dev(hdev); } -static int hci_usb_suspend(struct usb_interface *intf, pm_message_t message) -{ - struct hci_usb *husb = usb_get_intfdata(intf); - struct list_head killed; - unsigned long flags; - int i; - - if (!husb || intf == husb->isoc_iface) - return 0; - - hci_suspend_dev(husb->hdev); - - INIT_LIST_HEAD(&killed); - - for (i = 0; i < 4; i++) { - struct _urb_queue *q = &husb->pending_q[i]; - struct _urb *_urb, *_tmp; - - while ((_urb = _urb_dequeue(q))) { - /* reset queue since _urb_dequeue sets it to NULL */ - _urb->queue = q; - usb_kill_urb(&_urb->urb); - list_add(&_urb->list, &killed); - } - - spin_lock_irqsave(&q->lock, flags); - - list_for_each_entry_safe(_urb, _tmp, &killed, list) { - list_move_tail(&_urb->list, &q->head); - } - - spin_unlock_irqrestore(&q->lock, flags); - } - - return 0; -} - -static int hci_usb_resume(struct usb_interface *intf) -{ - struct hci_usb *husb = usb_get_intfdata(intf); - unsigned long flags; - int i, err = 0; - - if (!husb || intf == husb->isoc_iface) - return 0; - - for (i = 0; i < 4; i++) { - struct _urb_queue *q = &husb->pending_q[i]; - struct _urb *_urb; - - spin_lock_irqsave(&q->lock, flags); - - list_for_each_entry(_urb, &q->head, list) { - err = usb_submit_urb(&_urb->urb, GFP_ATOMIC); - if (err) - break; - } - - spin_unlock_irqrestore(&q->lock, flags); - - if (err) - return -EIO; - } - - hci_resume_dev(husb->hdev); - - return 0; -} - static struct usb_driver hci_usb_driver = { .name = "hci_usb", .probe = hci_usb_probe, .disconnect = hci_usb_disconnect, - .suspend = hci_usb_suspend, - .resume = hci_usb_resume, .id_table = bluetooth_ids, }; diff --git a/trunk/drivers/bluetooth/hci_usb.h b/trunk/drivers/bluetooth/hci_usb.h index 963fc55cdc85..37100a6ea1a8 100644 --- a/trunk/drivers/bluetooth/hci_usb.h +++ b/trunk/drivers/bluetooth/hci_usb.h @@ -35,7 +35,6 @@ #define HCI_SNIFFER 0x10 #define HCI_BCM92035 0x20 #define HCI_BROKEN_ISOC 0x40 -#define HCI_WRONG_SCO_MTU 0x80 #define HCI_MAX_IFACE_NUM 3 diff --git a/trunk/drivers/bluetooth/hci_vhci.c b/trunk/drivers/bluetooth/hci_vhci.c index aac67a3a6019..85738223ff0c 100644 --- a/trunk/drivers/bluetooth/hci_vhci.c +++ b/trunk/drivers/bluetooth/hci_vhci.c @@ -23,6 +23,7 @@ * */ +#include #include #include @@ -277,6 +278,7 @@ static int vhci_open(struct inode *inode, struct file *file) hdev->type = HCI_VHCI; hdev->driver_data = vhci; + SET_HCIDEV_DEV(hdev, vhci_miscdev.dev); hdev->open = vhci_open_dev; hdev->close = vhci_close_dev; diff --git a/trunk/drivers/cdrom/cdrom.c b/trunk/drivers/cdrom/cdrom.c index ca27ee89240b..3170eaa25087 100644 --- a/trunk/drivers/cdrom/cdrom.c +++ b/trunk/drivers/cdrom/cdrom.c @@ -263,6 +263,7 @@ /* #define ERRLOGMASK (CD_WARNING|CD_OPEN|CD_COUNT_TRACKS|CD_CLOSE) */ /* #define ERRLOGMASK (CD_WARNING|CD_REG_UNREG|CD_DO_IOCTL|CD_OPEN|CD_CLOSE|CD_COUNT_TRACKS) */ +#include #include #include #include diff --git a/trunk/drivers/cdrom/cdu31a.c b/trunk/drivers/cdrom/cdu31a.c index 37bdb0163f0d..5f0f2027f29e 100644 --- a/trunk/drivers/cdrom/cdu31a.c +++ b/trunk/drivers/cdrom/cdu31a.c @@ -3141,7 +3141,7 @@ int __init cdu31a_init(void) if (cdu31a_irq > 0) { if (request_irq - (cdu31a_irq, cdu31a_interrupt, IRQF_DISABLED, + (cdu31a_irq, cdu31a_interrupt, SA_INTERRUPT, "cdu31a", NULL)) { printk(KERN_WARNING PFX "Unable to grab IRQ%d for " "the CDU31A driver\n", cdu31a_irq); diff --git a/trunk/drivers/cdrom/cm206.c b/trunk/drivers/cdrom/cm206.c index 9b05ddd23141..4ee288688fed 100644 --- a/trunk/drivers/cdrom/cm206.c +++ b/trunk/drivers/cdrom/cm206.c @@ -914,7 +914,7 @@ static void seek(int lba) cd->dsb = wait_dsb(); } -static uch bcdbin(unsigned char bcd) +uch bcdbin(unsigned char bcd) { /* stolen from mcd.c! */ return (bcd >> 4) * 10 + (bcd & 0xf); } @@ -1532,7 +1532,7 @@ static void __init parse_options(void) } } -static int __init __cm206_init(void) +static int __cm206_init(void) { parse_options(); #if !defined(AUTO_PROBE_MODULE) @@ -1593,3 +1593,8 @@ __setup("cm206=", cm206_setup); #endif /* !MODULE */ MODULE_ALIAS_BLOCKDEV_MAJOR(CM206_CDROM_MAJOR); +/* + * Local variables: + * compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -DMODULE -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h -c -o cm206.o cm206.c" + * End: + */ diff --git a/trunk/drivers/cdrom/mcdx.c b/trunk/drivers/cdrom/mcdx.c index dcd1ab684f3e..788c7a0b2fe3 100644 --- a/trunk/drivers/cdrom/mcdx.c +++ b/trunk/drivers/cdrom/mcdx.c @@ -1193,7 +1193,7 @@ static int __init mcdx_init_drive(int drive) } xtrace(INIT, "init() subscribe irq and i/o\n"); - if (request_irq(stuffp->irq, mcdx_intr, IRQF_DISABLED, "mcdx", stuffp)) { + if (request_irq(stuffp->irq, mcdx_intr, SA_INTERRUPT, "mcdx", stuffp)) { release_region(stuffp->wreg_data, MCDX_IO_SIZE); xwarn("%s=0x%03x,%d: Init failed. Can't get irq (%d).\n", MCDX, stuffp->wreg_data, stuffp->irq, stuffp->irq); diff --git a/trunk/drivers/cdrom/sbpcd.c b/trunk/drivers/cdrom/sbpcd.c index ba50e5a712f2..2fc966c65a0e 100644 --- a/trunk/drivers/cdrom/sbpcd.c +++ b/trunk/drivers/cdrom/sbpcd.c @@ -381,6 +381,7 @@ #include #include #include +#include #include "sbpcd.h" #define MAJOR_NR MATSUSHITA_CDROM_MAJOR diff --git a/trunk/drivers/cdrom/sonycd535.c b/trunk/drivers/cdrom/sonycd535.c index 30ab56258a92..8f7cc452af8d 100644 --- a/trunk/drivers/cdrom/sonycd535.c +++ b/trunk/drivers/cdrom/sonycd535.c @@ -1527,7 +1527,7 @@ static int __init sony535_init(void) } if (sony535_irq_used > 0) { if (request_irq(sony535_irq_used, cdu535_interrupt, - IRQF_DISABLED, CDU535_HANDLE, NULL)) { + SA_INTERRUPT, CDU535_HANDLE, NULL)) { printk("Unable to grab IRQ%d for the " CDU535_MESSAGE_NAME " driver; polling instead.\n", sony535_irq_used); sony535_irq_used = 0; diff --git a/trunk/drivers/char/agp/amd64-agp.c b/trunk/drivers/char/agp/amd64-agp.c index 8cd52984cda5..f74eeeb8e377 100644 --- a/trunk/drivers/char/agp/amd64-agp.c +++ b/trunk/drivers/char/agp/amd64-agp.c @@ -8,6 +8,7 @@ * work is done in the northbridge(s). */ +#include #include #include #include diff --git a/trunk/drivers/char/agp/frontend.c b/trunk/drivers/char/agp/frontend.c index d9c5a9142ad1..ffcf15c30e90 100644 --- a/trunk/drivers/char/agp/frontend.c +++ b/trunk/drivers/char/agp/frontend.c @@ -1059,7 +1059,7 @@ static int agp_ioctl(struct inode *inode, struct file *file, return ret_val; } -static const struct file_operations agp_fops = +static struct file_operations agp_fops = { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/char/agp/generic.c b/trunk/drivers/char/agp/generic.c index cc5ea347a8a7..a92ab53a1370 100644 --- a/trunk/drivers/char/agp/generic.c +++ b/trunk/drivers/char/agp/generic.c @@ -27,6 +27,7 @@ * TODO: * - Allocate more than order 0 pages to avoid too much linear map splitting. */ +#include #include #include #include diff --git a/trunk/drivers/char/amiserial.c b/trunk/drivers/char/amiserial.c index 9d6713a93ed7..6602b3156df5 100644 --- a/trunk/drivers/char/amiserial.c +++ b/trunk/drivers/char/amiserial.c @@ -31,6 +31,7 @@ * ever possible. */ +#include #include #undef SERIAL_PARANOIA_CHECK @@ -2051,7 +2052,7 @@ static int __init rs_init(void) /* set ISRs, and then disable the rx interrupts */ request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); - request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED, "serial RX", state); + request_irq(IRQ_AMIGA_RBF, ser_rx_int, SA_INTERRUPT, "serial RX", state); /* turn off Rx and Tx interrupts */ custom.intena = IF_RBF | IF_TBE; diff --git a/trunk/drivers/char/applicom.c b/trunk/drivers/char/applicom.c index 10a389dafd60..72fb60765c45 100644 --- a/trunk/drivers/char/applicom.c +++ b/trunk/drivers/char/applicom.c @@ -112,7 +112,7 @@ static int ac_ioctl(struct inode *, struct file *, unsigned int, unsigned long); static irqreturn_t ac_interrupt(int, void *, struct pt_regs *); -static const struct file_operations ac_fops = { +static struct file_operations ac_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = ac_read, @@ -229,7 +229,7 @@ static int __init applicom_init(void) continue; } - if (request_irq(dev->irq, &ac_interrupt, IRQF_SHARED, "Applicom PCI", &dummy)) { + if (request_irq(dev->irq, &ac_interrupt, SA_SHIRQ, "Applicom PCI", &dummy)) { printk(KERN_INFO "Could not allocate IRQ %d for PCI Applicom device.\n", dev->irq); iounmap(RamIO); pci_disable_device(dev); @@ -276,7 +276,7 @@ static int __init applicom_init(void) printk(KERN_NOTICE "Applicom ISA card found at mem 0x%lx, irq %d\n", mem + (LEN_RAM_IO*i), irq); if (!numisa) { - if (request_irq(irq, &ac_interrupt, IRQF_SHARED, "Applicom ISA", &dummy)) { + if (request_irq(irq, &ac_interrupt, SA_SHIRQ, "Applicom ISA", &dummy)) { printk(KERN_WARNING "Could not allocate IRQ %d for ISA Applicom device.\n", irq); iounmap(RamIO); apbs[boardno - 1].RamIO = NULL; diff --git a/trunk/drivers/char/consolemap.c b/trunk/drivers/char/consolemap.c index 04a12027a740..c85a4fa60da7 100644 --- a/trunk/drivers/char/consolemap.c +++ b/trunk/drivers/char/consolemap.c @@ -11,6 +11,7 @@ * Fix bug in inverse translation. Stanislav Voronyi , Dec 1998 */ +#include #include #include #include diff --git a/trunk/drivers/char/cs5535_gpio.c b/trunk/drivers/char/cs5535_gpio.c index 8ce3f34cfc22..46d66037b917 100644 --- a/trunk/drivers/char/cs5535_gpio.c +++ b/trunk/drivers/char/cs5535_gpio.c @@ -158,7 +158,7 @@ static int cs5535_gpio_open(struct inode *inode, struct file *file) return nonseekable_open(inode, file); } -static const struct file_operations cs5535_gpio_fops = { +static struct file_operations cs5535_gpio_fops = { .owner = THIS_MODULE, .write = cs5535_gpio_write, .read = cs5535_gpio_read, diff --git a/trunk/drivers/char/cyclades.c b/trunk/drivers/char/cyclades.c index c1c67281750d..2657eeba7da6 100644 --- a/trunk/drivers/char/cyclades.c +++ b/trunk/drivers/char/cyclades.c @@ -633,6 +633,7 @@ static char rcsid[] = /* * Include section */ +#include #include #include #include @@ -4612,7 +4613,7 @@ cy_detect_isa(void) /* allocate IRQ */ if(request_irq(cy_isa_irq, cyy_interrupt, - IRQF_DISABLED, "Cyclom-Y", &cy_card[j])) + SA_INTERRUPT, "Cyclom-Y", &cy_card[j])) { printk("Cyclom-Y/ISA found at 0x%lx ", (unsigned long) cy_isa_address); @@ -4785,7 +4786,7 @@ cy_detect_pci(void) /* allocate IRQ */ if(request_irq(cy_pci_irq, cyy_interrupt, - IRQF_SHARED, "Cyclom-Y", &cy_card[j])) + SA_SHIRQ, "Cyclom-Y", &cy_card[j])) { printk("Cyclom-Y/PCI found at 0x%lx ", (ulong) cy_pci_phys2); @@ -4965,7 +4966,7 @@ cy_detect_pci(void) /* allocate IRQ only if board has an IRQ */ if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) { if(request_irq(cy_pci_irq, cyz_interrupt, - IRQF_SHARED, "Cyclades-Z", &cy_card[j])) + SA_SHIRQ, "Cyclades-Z", &cy_card[j])) { printk("Cyclom-8Zo/PCI found at 0x%lx ", (ulong) cy_pci_phys2); @@ -5059,7 +5060,7 @@ cy_detect_pci(void) /* allocate IRQ only if board has an IRQ */ if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) { if(request_irq(cy_pci_irq, cyz_interrupt, - IRQF_SHARED, "Cyclades-Z", &cy_card[j])) + SA_SHIRQ, "Cyclades-Z", &cy_card[j])) { printk("Cyclom-Ze/PCI found at 0x%lx ", (ulong) cy_pci_phys2); diff --git a/trunk/drivers/char/decserial.c b/trunk/drivers/char/decserial.c index 85f404e25c73..aa1440934e95 100644 --- a/trunk/drivers/char/decserial.c +++ b/trunk/drivers/char/decserial.c @@ -16,6 +16,7 @@ * console device I strongly recommend to use only one. */ +#include #include #include diff --git a/trunk/drivers/char/drm/drm.h b/trunk/drivers/char/drm/drm.h index 5642ac43e0f5..9da0ddb892b5 100644 --- a/trunk/drivers/char/drm/drm.h +++ b/trunk/drivers/char/drm/drm.h @@ -38,6 +38,7 @@ #if defined(__linux__) #if defined(__KERNEL__) +#include #endif #include /* For _IO* macros */ #define DRM_IOCTL_NR(n) _IOC_NR(n) diff --git a/trunk/drivers/char/drm/drmP.h b/trunk/drivers/char/drm/drmP.h index d2a56182bc35..cb76e5ca9a23 100644 --- a/trunk/drivers/char/drm/drmP.h +++ b/trunk/drivers/char/drm/drmP.h @@ -44,6 +44,7 @@ * can build the DRM (part of PI DRI). 4/21/2000 S + B */ #include #endif /* __alpha__ */ +#include #include #include #include diff --git a/trunk/drivers/char/drm/drm_irq.c b/trunk/drivers/char/drm/drm_irq.c index ebdb7182c4fd..611a1173091d 100644 --- a/trunk/drivers/char/drm/drm_irq.c +++ b/trunk/drivers/char/drm/drm_irq.c @@ -130,7 +130,7 @@ static int drm_irq_install(drm_device_t * dev) /* Install handler */ if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED)) - sh_flags = IRQF_SHARED; + sh_flags = SA_SHIRQ; ret = request_irq(dev->irq, dev->driver->irq_handler, sh_flags, dev->devname, dev); diff --git a/trunk/drivers/char/drm/drm_memory.c b/trunk/drivers/char/drm/drm_memory.c index 5681cae1d404..7e3318e1d1c6 100644 --- a/trunk/drivers/char/drm/drm_memory.c +++ b/trunk/drivers/char/drm/drm_memory.c @@ -33,6 +33,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include #include #include "drmP.h" diff --git a/trunk/drivers/char/drm/drm_memory.h b/trunk/drivers/char/drm/drm_memory.h index f1b97aff10cf..714d9aedcff5 100644 --- a/trunk/drivers/char/drm/drm_memory.h +++ b/trunk/drivers/char/drm/drm_memory.h @@ -33,6 +33,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include #include #include #include "drmP.h" diff --git a/trunk/drivers/char/drm/drm_memory_debug.h b/trunk/drivers/char/drm/drm_memory_debug.h index 74581af806e1..d117cc997192 100644 --- a/trunk/drivers/char/drm/drm_memory_debug.h +++ b/trunk/drivers/char/drm/drm_memory_debug.h @@ -31,6 +31,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include #include "drmP.h" typedef struct drm_mem_stats { diff --git a/trunk/drivers/char/drm/drm_scatter.c b/trunk/drivers/char/drm/drm_scatter.c index 06ef7ddbe67d..ce81bf248200 100644 --- a/trunk/drivers/char/drm/drm_scatter.c +++ b/trunk/drivers/char/drm/drm_scatter.c @@ -31,6 +31,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include #include "drmP.h" diff --git a/trunk/drivers/char/drm/drm_sysfs.c b/trunk/drivers/char/drm/drm_sysfs.c index 51ad98c685c3..0b9f98a7eb10 100644 --- a/trunk/drivers/char/drm/drm_sysfs.c +++ b/trunk/drivers/char/drm/drm_sysfs.c @@ -12,6 +12,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/char/drm/ffb_drv.c b/trunk/drivers/char/drm/ffb_drv.c index dd45111a4854..c13f9abb41e9 100644 --- a/trunk/drivers/char/drm/ffb_drv.c +++ b/trunk/drivers/char/drm/ffb_drv.c @@ -4,6 +4,7 @@ * Copyright (C) 2000 David S. Miller (davem@redhat.com) */ +#include #include "ffb.h" #include "drmP.h" diff --git a/trunk/drivers/char/drm/i810_drv.c b/trunk/drivers/char/drm/i810_drv.c index fabb9a817966..dfe6ad2b6a6e 100644 --- a/trunk/drivers/char/drm/i810_drv.c +++ b/trunk/drivers/char/drm/i810_drv.c @@ -30,6 +30,7 @@ * Gareth Hughes */ +#include #include "drmP.h" #include "drm.h" #include "i810_drm.h" diff --git a/trunk/drivers/char/drm/i830_drv.c b/trunk/drivers/char/drm/i830_drv.c index 389597e4a623..722658188f5f 100644 --- a/trunk/drivers/char/drm/i830_drv.c +++ b/trunk/drivers/char/drm/i830_drv.c @@ -32,6 +32,7 @@ * Keith Whitwell */ +#include #include "drmP.h" #include "drm.h" #include "i830_drm.h" diff --git a/trunk/drivers/char/drm/mga_drv.c b/trunk/drivers/char/drm/mga_drv.c index e30f556b79f1..9f7ed0e0351b 100644 --- a/trunk/drivers/char/drm/mga_drv.c +++ b/trunk/drivers/char/drm/mga_drv.c @@ -29,6 +29,7 @@ * Gareth Hughes */ +#include #include "drmP.h" #include "drm.h" #include "mga_drm.h" diff --git a/trunk/drivers/char/drm/r128_drv.c b/trunk/drivers/char/drm/r128_drv.c index 6108e7587e12..e20450ae220e 100644 --- a/trunk/drivers/char/drm/r128_drv.c +++ b/trunk/drivers/char/drm/r128_drv.c @@ -29,6 +29,7 @@ * Gareth Hughes */ +#include #include "drmP.h" #include "drm.h" #include "r128_drm.h" diff --git a/trunk/drivers/char/drm/radeon_drv.c b/trunk/drivers/char/drm/radeon_drv.c index eb985c2a31e9..b04ed1b562b9 100644 --- a/trunk/drivers/char/drm/radeon_drv.c +++ b/trunk/drivers/char/drm/radeon_drv.c @@ -29,6 +29,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include #include "drmP.h" #include "drm.h" #include "radeon_drm.h" diff --git a/trunk/drivers/char/drm/savage_drv.c b/trunk/drivers/char/drm/savage_drv.c index eee52aa92a7c..aa6c0d1a82f8 100644 --- a/trunk/drivers/char/drm/savage_drv.c +++ b/trunk/drivers/char/drm/savage_drv.c @@ -23,6 +23,7 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include #include "drmP.h" #include "savage_drm.h" #include "savage_drv.h" diff --git a/trunk/drivers/char/drm/sis_drv.c b/trunk/drivers/char/drm/sis_drv.c index 5e9dc86f2956..6f6d7d613ede 100644 --- a/trunk/drivers/char/drm/sis_drv.c +++ b/trunk/drivers/char/drm/sis_drv.c @@ -25,6 +25,7 @@ * */ +#include #include "drmP.h" #include "sis_drm.h" #include "sis_drv.h" diff --git a/trunk/drivers/char/drm/tdfx_drv.c b/trunk/drivers/char/drm/tdfx_drv.c index 012ff2e356b2..baa4416032a8 100644 --- a/trunk/drivers/char/drm/tdfx_drv.c +++ b/trunk/drivers/char/drm/tdfx_drv.c @@ -30,6 +30,7 @@ * Gareth Hughes */ +#include #include "drmP.h" #include "tdfx_drv.h" diff --git a/trunk/drivers/char/drm/via_drv.c b/trunk/drivers/char/drm/via_drv.c index b3d364d793d7..3f012255d315 100644 --- a/trunk/drivers/char/drm/via_drv.c +++ b/trunk/drivers/char/drm/via_drv.c @@ -22,6 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include "drmP.h" #include "via_drm.h" #include "via_drv.h" diff --git a/trunk/drivers/char/ds1286.c b/trunk/drivers/char/ds1286.c index 21c8229f5443..d755cac14bc1 100644 --- a/trunk/drivers/char/ds1286.c +++ b/trunk/drivers/char/ds1286.c @@ -281,7 +281,7 @@ static unsigned int ds1286_poll(struct file *file, poll_table *wait) * The various file operations we support. */ -static const struct file_operations ds1286_fops = { +static struct file_operations ds1286_fops = { .llseek = no_llseek, .read = ds1286_read, .poll = ds1286_poll, diff --git a/trunk/drivers/char/ds1302.c b/trunk/drivers/char/ds1302.c index bcdb107aa967..a75e8609be01 100644 --- a/trunk/drivers/char/ds1302.c +++ b/trunk/drivers/char/ds1302.c @@ -12,6 +12,7 @@ *! *!***************************************************************************/ +#include #include #include @@ -282,7 +283,7 @@ get_rtc_status(char *buf) /* The various file operations we support. */ -static const struct file_operations rtc_fops = { +static struct file_operations rtc_fops = { .owner = THIS_MODULE, .ioctl = rtc_ioctl, }; diff --git a/trunk/drivers/char/ds1620.c b/trunk/drivers/char/ds1620.c index 48cb8f0e8ebf..62cda25724e3 100644 --- a/trunk/drivers/char/ds1620.c +++ b/trunk/drivers/char/ds1620.c @@ -2,6 +2,7 @@ * linux/drivers/char/ds1620.c: Dallas Semiconductors DS1620 * thermometer driver (as used in the Rebel.com NetWinder) */ +#include #include #include #include @@ -336,7 +337,7 @@ proc_therm_ds1620_read(char *buf, char **start, off_t offset, static struct proc_dir_entry *proc_therm_ds1620; #endif -static const struct file_operations ds1620_fops = { +static struct file_operations ds1620_fops = { .owner = THIS_MODULE, .open = nonseekable_open, .read = ds1620_read, diff --git a/trunk/drivers/char/dsp56k.c b/trunk/drivers/char/dsp56k.c index 9b1bf60ffbe7..09b413618b57 100644 --- a/trunk/drivers/char/dsp56k.c +++ b/trunk/drivers/char/dsp56k.c @@ -483,7 +483,7 @@ static int dsp56k_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations dsp56k_fops = { +static struct file_operations dsp56k_fops = { .owner = THIS_MODULE, .read = dsp56k_read, .write = dsp56k_write, diff --git a/trunk/drivers/char/dtlk.c b/trunk/drivers/char/dtlk.c index 5e82c3bad2e3..da2c89f1b8bc 100644 --- a/trunk/drivers/char/dtlk.c +++ b/trunk/drivers/char/dtlk.c @@ -94,7 +94,7 @@ static int dtlk_release(struct inode *, struct file *); static int dtlk_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static const struct file_operations dtlk_fops = +static struct file_operations dtlk_fops = { .owner = THIS_MODULE, .read = dtlk_read, diff --git a/trunk/drivers/char/ec3104_keyb.c b/trunk/drivers/char/ec3104_keyb.c index abac18b1871c..4aed66968821 100644 --- a/trunk/drivers/char/ec3104_keyb.c +++ b/trunk/drivers/char/ec3104_keyb.c @@ -26,6 +26,7 @@ * (prumpf@tux.org). */ +#include #include #include diff --git a/trunk/drivers/char/efirtc.c b/trunk/drivers/char/efirtc.c index 004141d535a2..0090e7a4fcd3 100644 --- a/trunk/drivers/char/efirtc.c +++ b/trunk/drivers/char/efirtc.c @@ -285,7 +285,7 @@ efi_rtc_close(struct inode *inode, struct file *file) * The various file operations we support. */ -static const struct file_operations efi_rtc_fops = { +static struct file_operations efi_rtc_fops = { .owner = THIS_MODULE, .ioctl = efi_rtc_ioctl, .open = efi_rtc_open, diff --git a/trunk/drivers/char/epca.c b/trunk/drivers/char/epca.c index 86d290e9f307..d0b3890d9302 100644 --- a/trunk/drivers/char/epca.c +++ b/trunk/drivers/char/epca.c @@ -30,6 +30,7 @@ /* See README.epca for change history --DAT*/ +#include #include #include #include diff --git a/trunk/drivers/char/esp.c b/trunk/drivers/char/esp.c index afcd83d9984b..9827d170ca17 100644 --- a/trunk/drivers/char/esp.c +++ b/trunk/drivers/char/esp.c @@ -883,7 +883,7 @@ static int startup(struct esp_struct * info) * Allocate the IRQ */ - retval = request_irq(info->irq, rs_interrupt_single, IRQF_SHARED, + retval = request_irq(info->irq, rs_interrupt_single, SA_SHIRQ, "esp serial", info); if (retval) { diff --git a/trunk/drivers/char/ftape/lowlevel/fdc-io.c b/trunk/drivers/char/ftape/lowlevel/fdc-io.c index 65c9d2ec60bd..093fdf98b19a 100644 --- a/trunk/drivers/char/ftape/lowlevel/fdc-io.c +++ b/trunk/drivers/char/ftape/lowlevel/fdc-io.c @@ -1268,7 +1268,7 @@ static int fdc_grab_irq_and_dma(void) /* Get fast interrupt handler. */ if (request_irq(fdc.irq, ftape_interrupt, - IRQF_DISABLED, "ft", ftape_id)) { + SA_INTERRUPT, "ft", ftape_id)) { TRACE_ABORT(-EIO, ft_t_bug, "Unable to grab IRQ%d for ftape driver", fdc.irq); diff --git a/trunk/drivers/char/ftape/lowlevel/ftape-calibr.c b/trunk/drivers/char/ftape/lowlevel/ftape-calibr.c index 8e50bfd35a52..956b2586e138 100644 --- a/trunk/drivers/char/ftape/lowlevel/ftape-calibr.c +++ b/trunk/drivers/char/ftape/lowlevel/ftape-calibr.c @@ -24,6 +24,7 @@ * functions. */ +#include #include #include #include diff --git a/trunk/drivers/char/ftape/lowlevel/ftape-ctl.c b/trunk/drivers/char/ftape/lowlevel/ftape-ctl.c index 5d7c1ce92d59..32e043911790 100644 --- a/trunk/drivers/char/ftape/lowlevel/ftape-ctl.c +++ b/trunk/drivers/char/ftape/lowlevel/ftape-ctl.c @@ -25,6 +25,7 @@ * QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux. */ +#include #include #include #include diff --git a/trunk/drivers/char/ftape/lowlevel/ftape-init.c b/trunk/drivers/char/ftape/lowlevel/ftape-init.c index 4998132a81d1..b54260d457c2 100644 --- a/trunk/drivers/char/ftape/lowlevel/ftape-init.c +++ b/trunk/drivers/char/ftape/lowlevel/ftape-init.c @@ -21,6 +21,7 @@ * for the QIC-40/80/3010/3020 floppy-tape driver for Linux. */ +#include #include #include #include diff --git a/trunk/drivers/char/ftape/lowlevel/ftape-proc.c b/trunk/drivers/char/ftape/lowlevel/ftape-proc.c index e805b15e0a12..c66251e997ed 100644 --- a/trunk/drivers/char/ftape/lowlevel/ftape-proc.c +++ b/trunk/drivers/char/ftape/lowlevel/ftape-proc.c @@ -26,6 +26,7 @@ * Old code removed, switched to dynamic proc entry. */ +#include #if defined(CONFIG_PROC_FS) && defined(CONFIG_FT_PROC_FS) diff --git a/trunk/drivers/char/ftape/lowlevel/ftape-setup.c b/trunk/drivers/char/ftape/lowlevel/ftape-setup.c index 678340acd0b7..280a1a55d87e 100644 --- a/trunk/drivers/char/ftape/lowlevel/ftape-setup.c +++ b/trunk/drivers/char/ftape/lowlevel/ftape-setup.c @@ -25,6 +25,7 @@ * "ftape" for Linux. */ +#include #include #include #include diff --git a/trunk/drivers/char/ftape/lowlevel/ftape-tracing.h b/trunk/drivers/char/ftape/lowlevel/ftape-tracing.h index 2950810c7085..fa7cd20ee66c 100644 --- a/trunk/drivers/char/ftape/lowlevel/ftape-tracing.h +++ b/trunk/drivers/char/ftape/lowlevel/ftape-tracing.h @@ -28,6 +28,7 @@ * QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux. */ +#include #include /* diff --git a/trunk/drivers/char/ftape/lowlevel/ftape_syms.c b/trunk/drivers/char/ftape/lowlevel/ftape_syms.c index 8e0dc4a07ca6..5dc3a380c9bf 100644 --- a/trunk/drivers/char/ftape/lowlevel/ftape_syms.c +++ b/trunk/drivers/char/ftape/lowlevel/ftape_syms.c @@ -25,6 +25,7 @@ * exports to its high level clients */ +#include #include #include diff --git a/trunk/drivers/char/ftape/zftape/zftape-ctl.c b/trunk/drivers/char/ftape/zftape/zftape-ctl.c index 22ba0f5d00cf..6c7874e5c199 100644 --- a/trunk/drivers/char/ftape/zftape/zftape-ctl.c +++ b/trunk/drivers/char/ftape/zftape/zftape-ctl.c @@ -24,6 +24,7 @@ * for the QIC-40/80/3010/3020 floppy-tape driver for Linux. */ +#include #include #include #include diff --git a/trunk/drivers/char/ftape/zftape/zftape-ctl.h b/trunk/drivers/char/ftape/zftape/zftape-ctl.h index 8e6f2d7ac74e..414159891990 100644 --- a/trunk/drivers/char/ftape/zftape/zftape-ctl.h +++ b/trunk/drivers/char/ftape/zftape/zftape-ctl.h @@ -27,6 +27,7 @@ * for the QIC-40/80 floppy-tape driver for Linux. */ +#include #include #include diff --git a/trunk/drivers/char/ftape/zftape/zftape-init.c b/trunk/drivers/char/ftape/zftape/zftape-init.c index 164a1aa77a2f..3eeb869a9a11 100644 --- a/trunk/drivers/char/ftape/zftape/zftape-init.c +++ b/trunk/drivers/char/ftape/zftape/zftape-init.c @@ -20,6 +20,7 @@ * to the ftape floppy tape driver for Linux */ +#include #include #include #include @@ -86,7 +87,7 @@ static ssize_t zft_read (struct file *fp, char __user *buff, static ssize_t zft_write(struct file *fp, const char __user *buff, size_t req_len, loff_t *ppos); -static const struct file_operations zft_cdev = +static struct file_operations zft_cdev = { .owner = THIS_MODULE, .read = zft_read, diff --git a/trunk/drivers/char/genrtc.c b/trunk/drivers/char/genrtc.c index 817dc409ac20..588fca542a98 100644 --- a/trunk/drivers/char/genrtc.c +++ b/trunk/drivers/char/genrtc.c @@ -43,6 +43,7 @@ #define RTC_VERSION "1.07" #include +#include #include #include #include @@ -482,7 +483,7 @@ static inline int gen_rtc_proc_init(void) { return 0; } * The various file operations we support. */ -static const struct file_operations gen_rtc_fops = { +static struct file_operations gen_rtc_fops = { .owner = THIS_MODULE, #ifdef CONFIG_GEN_RTC_X .read = gen_rtc_read, diff --git a/trunk/drivers/char/hpet.c b/trunk/drivers/char/hpet.c index 8afba339f05a..07473cd84121 100644 --- a/trunk/drivers/char/hpet.c +++ b/trunk/drivers/char/hpet.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -395,7 +396,7 @@ static int hpet_ioctl_ieon(struct hpet_dev *devp) sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev)); irq_flags = devp->hd_flags & HPET_SHARED_IRQ - ? IRQF_SHARED : IRQF_DISABLED; + ? SA_SHIRQ : SA_INTERRUPT; if (request_irq(irq, hpet_interrupt, irq_flags, devp->hd_name, (void *)devp)) { printk(KERN_ERR "hpet: IRQ %d is not free\n", irq); @@ -553,7 +554,7 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel) return err; } -static const struct file_operations hpet_fops = { +static struct file_operations hpet_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = hpet_read, diff --git a/trunk/drivers/char/hvc_console.c b/trunk/drivers/char/hvc_console.c index ca2f538e549e..6e380aecea6a 100644 --- a/trunk/drivers/char/hvc_console.c +++ b/trunk/drivers/char/hvc_console.c @@ -22,6 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -346,7 +347,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) spin_unlock_irqrestore(&hp->lock, flags); /* check error, fallback to non-irq */ if (irq != NO_IRQ) - rc = request_irq(irq, hvc_handle_interrupt, IRQF_DISABLED, "hvc_console", hp); + rc = request_irq(irq, hvc_handle_interrupt, SA_INTERRUPT, "hvc_console", hp); /* * If the request_irq() fails and we return an error. The tty layer diff --git a/trunk/drivers/char/hvcs.c b/trunk/drivers/char/hvcs.c index 4589ff302b07..130dedc37568 100644 --- a/trunk/drivers/char/hvcs.c +++ b/trunk/drivers/char/hvcs.c @@ -899,7 +899,7 @@ static int hvcs_enable_device(struct hvcs_struct *hvcsd, uint32_t unit_address, * the conn was registered and now. */ if (!(rc = request_irq(irq, &hvcs_handle_interrupt, - IRQF_DISABLED, "ibmhvcs", hvcsd))) { + SA_INTERRUPT, "ibmhvcs", hvcsd))) { /* * It is possible the vty-server was removed after the irq was * requested but before we have time to enable interrupts. diff --git a/trunk/drivers/char/hvsi.c b/trunk/drivers/char/hvsi.c index 56612a2dca6b..7b04eb153205 100644 --- a/trunk/drivers/char/hvsi.c +++ b/trunk/drivers/char/hvsi.c @@ -1168,7 +1168,7 @@ static int __init hvsi_init(void) struct hvsi_struct *hp = &hvsi_ports[i]; int ret = 1; - ret = request_irq(hp->virq, hvsi_interrupt, IRQF_DISABLED, "hvsi", hp); + ret = request_irq(hp->virq, hvsi_interrupt, SA_INTERRUPT, "hvsi", hp); if (ret) printk(KERN_ERR "HVSI: couldn't reserve irq 0x%x (error %i)\n", hp->virq, ret); @@ -1299,12 +1299,13 @@ static int __init hvsi_console_init(void) hp->inbuf_end = hp->inbuf; hp->state = HVSI_CLOSED; hp->vtermno = *vtermno; - hp->virq = irq_create_mapping(NULL, irq[0], 0); + hp->virq = virt_irq_create_mapping(irq[0]); if (hp->virq == NO_IRQ) { printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n", - __FUNCTION__, irq[0]); + __FUNCTION__, hp->virq); continue; - } + } else + hp->virq = irq_offset_up(hp->virq); hvsi_count++; } diff --git a/trunk/drivers/char/hw_random/core.c b/trunk/drivers/char/hw_random/core.c index 154a81d328c1..88b026639f10 100644 --- a/trunk/drivers/char/hw_random/core.c +++ b/trunk/drivers/char/hw_random/core.c @@ -149,7 +149,7 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf, } -static const struct file_operations rng_chrdev_ops = { +static struct file_operations rng_chrdev_ops = { .owner = THIS_MODULE, .open = rng_dev_open, .read = rng_dev_read, diff --git a/trunk/drivers/char/i8k.c b/trunk/drivers/char/i8k.c index 353d9f3cf8d7..f3c3aaf4560e 100644 --- a/trunk/drivers/char/i8k.c +++ b/trunk/drivers/char/i8k.c @@ -80,7 +80,7 @@ static int i8k_open_fs(struct inode *inode, struct file *file); static int i8k_ioctl(struct inode *, struct file *, unsigned int, unsigned long); -static const struct file_operations i8k_fops = { +static struct file_operations i8k_fops = { .open = i8k_open_fs, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/char/ip2/i2ellis.h b/trunk/drivers/char/ip2/i2ellis.h index 5eabe47b0bc8..510b026d7d26 100644 --- a/trunk/drivers/char/ip2/i2ellis.h +++ b/trunk/drivers/char/ip2/i2ellis.h @@ -47,6 +47,7 @@ //---------------------- // Mandatory Includes: //---------------------- +#include #include "ip2types.h" #include "i2hw.h" // The hardware definitions diff --git a/trunk/drivers/char/ip2/ip2main.c b/trunk/drivers/char/ip2/ip2main.c index 518ece7ac656..8619542766cb 100644 --- a/trunk/drivers/char/ip2/ip2main.c +++ b/trunk/drivers/char/ip2/ip2main.c @@ -82,6 +82,7 @@ /************/ /* Includes */ /************/ +#include #include #include @@ -233,7 +234,7 @@ static void *DevTableMem[IP2_MAX_BOARDS]; /* This is the driver descriptor for the ip2ipl device, which is used to * download the loadware to the boards. */ -static const struct file_operations ip2_ipl = { +static struct file_operations ip2_ipl = { .owner = THIS_MODULE, .read = ip2_ipl_read, .write = ip2_ipl_write, @@ -491,8 +492,8 @@ static struct tty_operations ip2_ops = { /* initialisation of the devices and driver structures, and registers itself */ /* with the relevant kernel modules. */ /******************************************************************************/ -/* IRQF_DISABLED - if set blocks all interrupts else only this line */ -/* IRQF_SHARED - for shared irq PCI or maybe EISA only */ +/* SA_INTERRUPT- if set blocks all interrupts else only this line */ +/* SA_SHIRQ - for shared irq PCI or maybe EISA only */ /* SA_RANDOM - can be source for cert. random number generators */ #define IP2_SA_FLAGS 0 @@ -753,7 +754,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) if (have_requested_irq(ip2config.irq[i])) continue; rc = request_irq( ip2config.irq[i], ip2_interrupt, - IP2_SA_FLAGS | (ip2config.type[i] == PCI ? IRQF_SHARED : 0), + IP2_SA_FLAGS | (ip2config.type[i] == PCI ? SA_SHIRQ : 0), pcName, (void *)&pcName); if (rc) { printk(KERN_ERR "IP2: an request_irq failed: error %d\n",rc); diff --git a/trunk/drivers/char/ip27-rtc.c b/trunk/drivers/char/ip27-rtc.c index a48da02aad2f..3acdac3c967e 100644 --- a/trunk/drivers/char/ip27-rtc.c +++ b/trunk/drivers/char/ip27-rtc.c @@ -196,7 +196,7 @@ static int rtc_release(struct inode *inode, struct file *file) * The various file operations we support. */ -static const struct file_operations rtc_fops = { +static struct file_operations rtc_fops = { .owner = THIS_MODULE, .ioctl = rtc_ioctl, .open = rtc_open, diff --git a/trunk/drivers/char/ipmi/ipmi_devintf.c b/trunk/drivers/char/ipmi/ipmi_devintf.c index 68d7c61a864e..da637adbbfaa 100644 --- a/trunk/drivers/char/ipmi/ipmi_devintf.c +++ b/trunk/drivers/char/ipmi/ipmi_devintf.c @@ -31,6 +31,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -765,7 +766,7 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd, } #endif -static const struct file_operations ipmi_fops = { +static struct file_operations ipmi_fops = { .owner = THIS_MODULE, .ioctl = ipmi_ioctl, #ifdef CONFIG_COMPAT diff --git a/trunk/drivers/char/ipmi/ipmi_msghandler.c b/trunk/drivers/char/ipmi/ipmi_msghandler.c index 0aa5d608fe6f..ad26f4b997c5 100644 --- a/trunk/drivers/char/ipmi/ipmi_msghandler.c +++ b/trunk/drivers/char/ipmi/ipmi_msghandler.c @@ -31,6 +31,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/char/ipmi/ipmi_poweroff.c b/trunk/drivers/char/ipmi/ipmi_poweroff.c index 8d941db83457..d0b5c08e7b4e 100644 --- a/trunk/drivers/char/ipmi/ipmi_poweroff.c +++ b/trunk/drivers/char/ipmi/ipmi_poweroff.c @@ -31,6 +31,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/char/ipmi/ipmi_si_intf.c b/trunk/drivers/char/ipmi/ipmi_si_intf.c index f57eba0bf253..bd4f2248b758 100644 --- a/trunk/drivers/char/ipmi/ipmi_si_intf.c +++ b/trunk/drivers/char/ipmi/ipmi_si_intf.c @@ -38,6 +38,7 @@ * and drives the real SMI state machine. */ +#include #include #include #include @@ -1041,7 +1042,7 @@ static int std_irq_setup(struct smi_info *info) if (info->si_type == SI_BT) { rv = request_irq(info->irq, si_bt_irq_handler, - IRQF_DISABLED, + SA_INTERRUPT, DEVICE_NAME, info); if (!rv) @@ -1051,7 +1052,7 @@ static int std_irq_setup(struct smi_info *info) } else rv = request_irq(info->irq, si_irq_handler, - IRQF_DISABLED, + SA_INTERRUPT, DEVICE_NAME, info); if (rv) { diff --git a/trunk/drivers/char/ipmi/ipmi_watchdog.c b/trunk/drivers/char/ipmi/ipmi_watchdog.c index accaaf1a6b69..1a0a19c53605 100644 --- a/trunk/drivers/char/ipmi/ipmi_watchdog.c +++ b/trunk/drivers/char/ipmi/ipmi_watchdog.c @@ -31,6 +31,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -807,7 +808,7 @@ static int ipmi_close(struct inode *ino, struct file *filep) return 0; } -static const struct file_operations ipmi_wdog_fops = { +static struct file_operations ipmi_wdog_fops = { .owner = THIS_MODULE, .read = ipmi_read, .poll = ipmi_poll, diff --git a/trunk/drivers/char/isicom.c b/trunk/drivers/char/isicom.c index 913be23e0a24..478bf4d7d065 100644 --- a/trunk/drivers/char/isicom.c +++ b/trunk/drivers/char/isicom.c @@ -245,7 +245,7 @@ static int lock_card(struct isi_board *card) printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n", card->base); - return 0; /* Failed to acquire the card! */ + return 0; /* Failed to aquire the card! */ } static int lock_card_at_interrupt(struct isi_board *card) @@ -262,7 +262,7 @@ static int lock_card_at_interrupt(struct isi_board *card) spin_unlock_irqrestore(&card->card_lock, card->flags); } /* Failing in interrupt is an acceptable event */ - return 0; /* Failed to acquire the card! */ + return 0; /* Failed to aquire the card! */ } static void unlock_card(struct isi_board *card) @@ -1614,14 +1614,14 @@ static int __devinit isicom_register_isr(struct pci_dev *pdev, const unsigned int index) { struct isi_board *board = pci_get_drvdata(pdev); - unsigned long irqflags = IRQF_DISABLED; + unsigned long irqflags = SA_INTERRUPT; int retval = -EINVAL; if (!board->base) goto end; if (board->isa == NO) - irqflags |= IRQF_SHARED; + irqflags |= SA_SHIRQ; retval = request_irq(board->irq, isicom_interrupt, irqflags, ISICOM_NAME, board); diff --git a/trunk/drivers/char/istallion.c b/trunk/drivers/char/istallion.c index 84dfc4278139..c74e5660a9b7 100644 --- a/trunk/drivers/char/istallion.c +++ b/trunk/drivers/char/istallion.c @@ -26,6 +26,7 @@ /*****************************************************************************/ +#include #include #include #include @@ -281,6 +282,7 @@ static char *stli_brdnames[] = { /*****************************************************************************/ +#ifdef MODULE /* * Define some string labels for arguments passed from the module * load line. These allow for easy board definitions, and easy @@ -379,6 +381,8 @@ MODULE_PARM_DESC(board2, "Board 2 config -> name[,ioaddr[,memaddr]"); module_param_array(board3, charp, NULL, 0); MODULE_PARM_DESC(board3, "Board 3 config -> name[,ioaddr[,memaddr]"); +#endif + /* * Set up a default memory address table for EISA board probing. * The default addresses are all bellow 1Mbyte, which has to be the @@ -639,8 +643,14 @@ static unsigned int stli_baudrates[] = { * Prototype all functions in this driver! */ +#ifdef MODULE +static void stli_argbrds(void); static int stli_parsebrd(stlconf_t *confp, char **argp); -static int stli_init(void); + +static unsigned long stli_atol(char *str); +#endif + +int stli_init(void); static int stli_open(struct tty_struct *tty, struct file *filp); static void stli_close(struct tty_struct *tty, struct file *filp); static int stli_write(struct tty_struct *tty, const unsigned char *buf, int count); @@ -748,7 +758,7 @@ static int stli_initpcibrd(int brdtype, struct pci_dev *devp); * will give access to the shared memory on the Stallion intelligent * board. This is also a very useful debugging tool. */ -static const struct file_operations stli_fsiomem = { +static struct file_operations stli_fsiomem = { .owner = THIS_MODULE, .read = stli_memread, .write = stli_memwrite, @@ -776,6 +786,8 @@ static int stli_timeron; static struct class *istallion_class; +#ifdef MODULE + /* * Loadable module initialization stuff. */ @@ -942,6 +954,8 @@ static int stli_parsebrd(stlconf_t *confp, char **argp) return(1); } +#endif + /*****************************************************************************/ static int stli_open(struct tty_struct *tty, struct file *filp) @@ -4680,7 +4694,7 @@ static struct tty_operations stli_ops = { /*****************************************************************************/ -static int __init stli_init(void) +int __init stli_init(void) { int i; printk(KERN_INFO "%s: version %s\n", stli_drvtitle, stli_drvversion); diff --git a/trunk/drivers/char/ite_gpio.c b/trunk/drivers/char/ite_gpio.c index cde562d70c4f..d1ed6ac950d1 100644 --- a/trunk/drivers/char/ite_gpio.c +++ b/trunk/drivers/char/ite_gpio.c @@ -357,7 +357,7 @@ DEB(printk("interrupt 0x%x %d\n",ITE_GPAISR, i)); } } -static const struct file_operations ite_gpio_fops = { +static struct file_operations ite_gpio_fops = { .owner = THIS_MODULE, .ioctl = ite_gpio_ioctl, .open = ite_gpio_open, @@ -397,7 +397,7 @@ int __init ite_gpio_init(void) init_waitqueue_head(&ite_gpio_wait[i]); } - if (request_irq(ite_gpio_irq, ite_gpio_irq_handler, IRQF_SHARED, "gpio", 0) < 0) { + if (request_irq(ite_gpio_irq, ite_gpio_irq_handler, SA_SHIRQ, "gpio", 0) < 0) { misc_deregister(&ite_gpio_miscdev); release_region(ite_gpio_base, 0x1c); return 0; diff --git a/trunk/drivers/char/keyboard.c b/trunk/drivers/char/keyboard.c index 056ebe84b81d..4bb3d2272604 100644 --- a/trunk/drivers/char/keyboard.c +++ b/trunk/drivers/char/keyboard.c @@ -24,6 +24,7 @@ * 21-08-02: Converted to input API, major cleanup. (Vojtech Pavlik) */ +#include #include #include #include diff --git a/trunk/drivers/char/lcd.c b/trunk/drivers/char/lcd.c index da601fd6c07a..29963d8be667 100644 --- a/trunk/drivers/char/lcd.c +++ b/trunk/drivers/char/lcd.c @@ -14,6 +14,7 @@ #define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */ +#include #include #include #include @@ -598,7 +599,7 @@ static ssize_t lcd_read(struct file *file, char *buf, * The various file operations we support. */ -static const struct file_operations lcd_fops = { +static struct file_operations lcd_fops = { .read = lcd_read, .ioctl = lcd_ioctl, .open = lcd_open, diff --git a/trunk/drivers/char/lp.c b/trunk/drivers/char/lp.c index f875fda3b089..b11a390581ba 100644 --- a/trunk/drivers/char/lp.c +++ b/trunk/drivers/char/lp.c @@ -114,6 +114,7 @@ #include #include +#include #include #include #include @@ -666,7 +667,7 @@ static int lp_ioctl(struct inode *inode, struct file *file, return retval; } -static const struct file_operations lp_fops = { +static struct file_operations lp_fops = { .owner = THIS_MODULE, .write = lp_write, .ioctl = lp_ioctl, diff --git a/trunk/drivers/char/mbcs.c b/trunk/drivers/char/mbcs.c index 0385650f6077..c268ee04b2aa 100644 --- a/trunk/drivers/char/mbcs.c +++ b/trunk/drivers/char/mbcs.c @@ -10,6 +10,7 @@ * MOATB Core Services driver. */ +#include #include #include #include @@ -592,7 +593,7 @@ static int mbcs_intr_alloc(struct cx_dev *dev) getdma->intrHostDest = sn_irq->irq_xtalkaddr; getdma->intrVector = sn_irq->irq_irq; if (request_irq(sn_irq->irq_irq, - (void *)mbcs_completion_intr_handler, IRQF_SHARED, + (void *)mbcs_completion_intr_handler, SA_SHIRQ, "MBCS get intr", (void *)soft)) { tiocx_irq_free(soft->get_sn_irq); return -EAGAIN; @@ -608,7 +609,7 @@ static int mbcs_intr_alloc(struct cx_dev *dev) putdma->intrHostDest = sn_irq->irq_xtalkaddr; putdma->intrVector = sn_irq->irq_irq; if (request_irq(sn_irq->irq_irq, - (void *)mbcs_completion_intr_handler, IRQF_SHARED, + (void *)mbcs_completion_intr_handler, SA_SHIRQ, "MBCS put intr", (void *)soft)) { tiocx_irq_free(soft->put_sn_irq); free_irq(soft->get_sn_irq->irq_irq, soft); @@ -628,7 +629,7 @@ static int mbcs_intr_alloc(struct cx_dev *dev) algo->intrHostDest = sn_irq->irq_xtalkaddr; algo->intrVector = sn_irq->irq_irq; if (request_irq(sn_irq->irq_irq, - (void *)mbcs_completion_intr_handler, IRQF_SHARED, + (void *)mbcs_completion_intr_handler, SA_SHIRQ, "MBCS algo intr", (void *)soft)) { tiocx_irq_free(soft->algo_sn_irq); free_irq(soft->put_sn_irq->irq_irq, soft); diff --git a/trunk/drivers/char/mem.c b/trunk/drivers/char/mem.c index e97c32ceb796..6fe7b6c6c462 100644 --- a/trunk/drivers/char/mem.c +++ b/trunk/drivers/char/mem.c @@ -8,6 +8,7 @@ * Shared /dev/zero mmaping support, Feb 2000, Kanoj Sarcar */ +#include #include #include #include @@ -776,7 +777,7 @@ static int open_port(struct inode * inode, struct file * filp) #define open_kmem open_mem #define open_oldmem open_mem -static const struct file_operations mem_fops = { +static struct file_operations mem_fops = { .llseek = memory_lseek, .read = read_mem, .write = write_mem, @@ -784,7 +785,7 @@ static const struct file_operations mem_fops = { .open = open_mem, }; -static const struct file_operations kmem_fops = { +static struct file_operations kmem_fops = { .llseek = memory_lseek, .read = read_kmem, .write = write_kmem, @@ -792,7 +793,7 @@ static const struct file_operations kmem_fops = { .open = open_kmem, }; -static const struct file_operations null_fops = { +static struct file_operations null_fops = { .llseek = null_lseek, .read = read_null, .write = write_null, @@ -800,7 +801,7 @@ static const struct file_operations null_fops = { }; #if defined(CONFIG_ISA) || !defined(__mc68000__) -static const struct file_operations port_fops = { +static struct file_operations port_fops = { .llseek = memory_lseek, .read = read_port, .write = write_port, @@ -808,7 +809,7 @@ static const struct file_operations port_fops = { }; #endif -static const struct file_operations zero_fops = { +static struct file_operations zero_fops = { .llseek = zero_lseek, .read = read_zero, .write = write_zero, @@ -819,14 +820,14 @@ static struct backing_dev_info zero_bdi = { .capabilities = BDI_CAP_MAP_COPY, }; -static const struct file_operations full_fops = { +static struct file_operations full_fops = { .llseek = full_lseek, .read = read_full, .write = write_full, }; #ifdef CONFIG_CRASH_DUMP -static const struct file_operations oldmem_fops = { +static struct file_operations oldmem_fops = { .read = read_oldmem, .open = open_oldmem, }; @@ -853,7 +854,7 @@ static ssize_t kmsg_write(struct file * file, const char __user * buf, return ret; } -static const struct file_operations kmsg_fops = { +static struct file_operations kmsg_fops = { .write = kmsg_write, }; @@ -903,7 +904,7 @@ static int memory_open(struct inode * inode, struct file * filp) return 0; } -static const struct file_operations memory_fops = { +static struct file_operations memory_fops = { .open = memory_open, /* just a selector for the real open */ }; diff --git a/trunk/drivers/char/misc.c b/trunk/drivers/char/misc.c index 62ebe09656e3..dfe1cede3916 100644 --- a/trunk/drivers/char/misc.c +++ b/trunk/drivers/char/misc.c @@ -34,6 +34,7 @@ */ #include +#include #include #include @@ -113,7 +114,7 @@ static int misc_seq_open(struct inode *inode, struct file *file) return seq_open(file, &misc_seq_ops); } -static const struct file_operations misc_proc_fops = { +static struct file_operations misc_proc_fops = { .owner = THIS_MODULE, .open = misc_seq_open, .read = seq_read, @@ -176,7 +177,7 @@ static int misc_open(struct inode * inode, struct file * file) */ static struct class *misc_class; -static const struct file_operations misc_fops = { +static struct file_operations misc_fops = { .owner = THIS_MODULE, .open = misc_open, }; diff --git a/trunk/drivers/char/mmtimer.c b/trunk/drivers/char/mmtimer.c index 1f0f2b6dae26..95e8122b8068 100644 --- a/trunk/drivers/char/mmtimer.c +++ b/trunk/drivers/char/mmtimer.c @@ -63,7 +63,7 @@ static int mmtimer_mmap(struct file *file, struct vm_area_struct *vma); */ static unsigned long mmtimer_femtoperiod = 0; -static const struct file_operations mmtimer_fops = { +static struct file_operations mmtimer_fops = { .owner = THIS_MODULE, .mmap = mmtimer_mmap, .ioctl = mmtimer_ioctl, @@ -687,7 +687,7 @@ static int __init mmtimer_init(void) mmtimer_femtoperiod = ((unsigned long)1E15 + sn_rtc_cycles_per_second / 2) / sn_rtc_cycles_per_second; - if (request_irq(SGI_MMTIMER_VECTOR, mmtimer_interrupt, IRQF_PERCPU, MMTIMER_NAME, NULL)) { + if (request_irq(SGI_MMTIMER_VECTOR, mmtimer_interrupt, SA_PERCPU_IRQ, MMTIMER_NAME, NULL)) { printk(KERN_WARNING "%s: unable to allocate interrupt.", MMTIMER_NAME); return -1; diff --git a/trunk/drivers/char/moxa.c b/trunk/drivers/char/moxa.c index 4ea7bd5f4f56..52ef61f54ba0 100644 --- a/trunk/drivers/char/moxa.c +++ b/trunk/drivers/char/moxa.c @@ -29,6 +29,7 @@ * version : 5.1 */ +#include #include #include #include diff --git a/trunk/drivers/char/mwave/3780i.c b/trunk/drivers/char/mwave/3780i.c index 4e4865e90e50..d1fe05e83882 100644 --- a/trunk/drivers/char/mwave/3780i.c +++ b/trunk/drivers/char/mwave/3780i.c @@ -46,6 +46,7 @@ * First release to the public */ +#include #include #include #include diff --git a/trunk/drivers/char/mwave/mwavedd.c b/trunk/drivers/char/mwave/mwavedd.c index 39a2e661ff55..d3ba2f860ef0 100644 --- a/trunk/drivers/char/mwave/mwavedd.c +++ b/trunk/drivers/char/mwave/mwavedd.c @@ -454,7 +454,7 @@ static int register_serial_portandirq(unsigned int port, int irq) } -static const struct file_operations mwave_fops = { +static struct file_operations mwave_fops = { .owner = THIS_MODULE, .read = mwave_read, .write = mwave_write, diff --git a/trunk/drivers/char/mxser.c b/trunk/drivers/char/mxser.c index 556abd3e0d07..72cfd09091e0 100644 --- a/trunk/drivers/char/mxser.c +++ b/trunk/drivers/char/mxser.c @@ -36,6 +36,7 @@ */ +#include #include #include #include @@ -94,7 +95,7 @@ #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|\ IXON|IXOFF)) -#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? IRQF_SHARED : IRQF_DISABLED) +#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT) #define C168_ASIC_ID 1 #define C104_ASIC_ID 2 diff --git a/trunk/drivers/char/n_hdlc.c b/trunk/drivers/char/n_hdlc.c index 337a87f86a3b..9f54733f1623 100644 --- a/trunk/drivers/char/n_hdlc.c +++ b/trunk/drivers/char/n_hdlc.c @@ -81,6 +81,7 @@ #define HDLC_MAGIC 0x239e #define HDLC_VERSION "$Revision: 4.8 $" +#include #include #include #include diff --git a/trunk/drivers/char/nvram.c b/trunk/drivers/char/nvram.c index a39f19c35a6a..3556ccd77570 100644 --- a/trunk/drivers/char/nvram.c +++ b/trunk/drivers/char/nvram.c @@ -37,6 +37,7 @@ #define NVRAM_VERSION "1.2" #include +#include #include #include #include @@ -437,7 +438,7 @@ nvram_read_proc(char *buffer, char **start, off_t offset, #endif /* CONFIG_PROC_FS */ -static const struct file_operations nvram_fops = { +static struct file_operations nvram_fops = { .owner = THIS_MODULE, .llseek = nvram_llseek, .read = nvram_read, diff --git a/trunk/drivers/char/nwbutton.c b/trunk/drivers/char/nwbutton.c index 7c57ebfa8640..4083b781adbf 100644 --- a/trunk/drivers/char/nwbutton.c +++ b/trunk/drivers/char/nwbutton.c @@ -4,6 +4,7 @@ * */ +#include #include #include #include @@ -183,7 +184,7 @@ static int button_read (struct file *filp, char __user *buffer, * attempts to perform these operations on the device. */ -static const struct file_operations button_fops = { +static struct file_operations button_fops = { .owner = THIS_MODULE, .read = button_read, }; @@ -223,7 +224,7 @@ static int __init nwbutton_init(void) return -EBUSY; } - if (request_irq (IRQ_NETWINDER_BUTTON, button_handler, IRQF_DISABLED, + if (request_irq (IRQ_NETWINDER_BUTTON, button_handler, SA_INTERRUPT, "nwbutton", NULL)) { printk (KERN_WARNING "nwbutton: IRQ %d is not free.\n", IRQ_NETWINDER_BUTTON); diff --git a/trunk/drivers/char/nwflash.c b/trunk/drivers/char/nwflash.c index 206cf6f50695..8865387d3448 100644 --- a/trunk/drivers/char/nwflash.c +++ b/trunk/drivers/char/nwflash.c @@ -642,7 +642,7 @@ static void kick_open(void) udelay(25); } -static const struct file_operations flash_fops = +static struct file_operations flash_fops = { .owner = THIS_MODULE, .llseek = flash_llseek, diff --git a/trunk/drivers/char/pc8736x_gpio.c b/trunk/drivers/char/pc8736x_gpio.c index 4005ee0aa11e..1c706ccfdbb3 100644 --- a/trunk/drivers/char/pc8736x_gpio.c +++ b/trunk/drivers/char/pc8736x_gpio.c @@ -236,7 +236,7 @@ static int pc8736x_gpio_open(struct inode *inode, struct file *file) return nonseekable_open(inode, file); } -static const struct file_operations pc8736x_gpio_fops = { +static struct file_operations pc8736x_gpio_fops = { .owner = THIS_MODULE, .open = pc8736x_gpio_open, .write = nsc_gpio_write, @@ -319,10 +319,9 @@ static int __init pc8736x_gpio_init(void) return 0; undo_platform_dev_add: - platform_device_del(pdev); -undo_platform_dev_alloc: platform_device_put(pdev); - +undo_platform_dev_alloc: + kfree(pdev); return rc; } diff --git a/trunk/drivers/char/pcmcia/cm4000_cs.c b/trunk/drivers/char/pcmcia/cm4000_cs.c index 50d20aafeb18..eab5394da666 100644 --- a/trunk/drivers/char/pcmcia/cm4000_cs.c +++ b/trunk/drivers/char/pcmcia/cm4000_cs.c @@ -149,7 +149,12 @@ struct cm4000_dev { #define ZERO_DEV(dev) \ memset(&dev->atr_csum,0, \ sizeof(struct cm4000_dev) - \ - offsetof(struct cm4000_dev, atr_csum)) + /*link*/ sizeof(struct pcmcia_device *) - \ + /*node*/ sizeof(dev_node_t) - \ + /*atr*/ MAX_ATR*sizeof(char) - \ + /*rbuf*/ 512*sizeof(char) - \ + /*sbuf*/ 512*sizeof(char) - \ + /*queue*/ 4*sizeof(wait_queue_head_t)) static struct pcmcia_device *dev_table[CM4000_MAX_DEV]; static struct class *cmm_class; @@ -1938,7 +1943,7 @@ static void cm4000_detach(struct pcmcia_device *link) return; } -static const struct file_operations cm4000_fops = { +static struct file_operations cm4000_fops = { .owner = THIS_MODULE, .read = cmm_read, .write = cmm_write, diff --git a/trunk/drivers/char/pcmcia/cm4040_cs.c b/trunk/drivers/char/pcmcia/cm4040_cs.c index 55cf4be42976..47a8465bf95b 100644 --- a/trunk/drivers/char/pcmcia/cm4040_cs.c +++ b/trunk/drivers/char/pcmcia/cm4040_cs.c @@ -688,7 +688,7 @@ static void reader_detach(struct pcmcia_device *link) return; } -static const struct file_operations reader_fops = { +static struct file_operations reader_fops = { .owner = THIS_MODULE, .read = cm4040_read, .write = cm4040_write, diff --git a/trunk/drivers/char/ppdev.c b/trunk/drivers/char/ppdev.c index 520d2cf82bc0..24231d9743dc 100644 --- a/trunk/drivers/char/ppdev.c +++ b/trunk/drivers/char/ppdev.c @@ -739,7 +739,7 @@ static unsigned int pp_poll (struct file * file, poll_table * wait) static struct class *ppdev_class; -static const struct file_operations pp_fops = { +static struct file_operations pp_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = pp_read, diff --git a/trunk/drivers/char/pty.c b/trunk/drivers/char/pty.c index 34dd4c38110e..9491e4307566 100644 --- a/trunk/drivers/char/pty.c +++ b/trunk/drivers/char/pty.c @@ -11,6 +11,7 @@ * */ +#include #include /* For EXPORT_SYMBOL */ #include diff --git a/trunk/drivers/char/qtronix.c b/trunk/drivers/char/qtronix.c index 9d134e98d2a0..601d09baf9d7 100644 --- a/trunk/drivers/char/qtronix.c +++ b/trunk/drivers/char/qtronix.c @@ -33,6 +33,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include /* * NOTE: @@ -144,7 +145,7 @@ void __init init_qtronix_990P_kbd(void) cir_port_init(cir); retval = request_irq(IT8172_CIR0_IRQ, kbd_int_handler, - (unsigned long )(IRQF_DISABLED|IRQF_SHARED), + (unsigned long )(SA_INTERRUPT|SA_SHIRQ), (const char *)"Qtronix IR Keyboard", (void *)cir); if (retval) { diff --git a/trunk/drivers/char/random.c b/trunk/drivers/char/random.c index 4c3a5ca9d8f7..58f3512c52e1 100644 --- a/trunk/drivers/char/random.c +++ b/trunk/drivers/char/random.c @@ -224,6 +224,7 @@ */ #include +#include #include #include #include @@ -416,7 +417,7 @@ static struct entropy_store input_pool = { .poolinfo = &poolinfo_table[0], .name = "input", .limit = 1, - .lock = __SPIN_LOCK_UNLOCKED(&input_pool.lock), + .lock = SPIN_LOCK_UNLOCKED, .pool = input_pool_data }; @@ -425,7 +426,7 @@ static struct entropy_store blocking_pool = { .name = "blocking", .limit = 1, .pull = &input_pool, - .lock = __SPIN_LOCK_UNLOCKED(&blocking_pool.lock), + .lock = SPIN_LOCK_UNLOCKED, .pool = blocking_pool_data }; @@ -433,7 +434,7 @@ static struct entropy_store nonblocking_pool = { .poolinfo = &poolinfo_table[1], .name = "nonblocking", .pull = &input_pool, - .lock = __SPIN_LOCK_UNLOCKED(&nonblocking_pool.lock), + .lock = SPIN_LOCK_UNLOCKED, .pool = nonblocking_pool_data }; diff --git a/trunk/drivers/char/raw.c b/trunk/drivers/char/raw.c index 579868af4a54..9bf97c5e38c0 100644 --- a/trunk/drivers/char/raw.c +++ b/trunk/drivers/char/raw.c @@ -30,7 +30,7 @@ struct raw_device_data { static struct class *raw_class; static struct raw_device_data raw_devices[MAX_RAW_MINORS]; static DEFINE_MUTEX(raw_mutex); -static const struct file_operations raw_ctl_fops; /* forward declaration */ +static struct file_operations raw_ctl_fops; /* forward declaration */ /* * Open/close code for raw IO. @@ -261,7 +261,7 @@ static ssize_t raw_file_aio_write(struct kiocb *iocb, const char __user *buf, } -static const struct file_operations raw_fops = { +static struct file_operations raw_fops = { .read = generic_file_read, .aio_read = generic_file_aio_read, .write = raw_file_write, @@ -274,7 +274,7 @@ static const struct file_operations raw_fops = { .owner = THIS_MODULE, }; -static const struct file_operations raw_ctl_fops = { +static struct file_operations raw_ctl_fops = { .ioctl = raw_ctl_ioctl, .open = raw_open, .owner = THIS_MODULE, diff --git a/trunk/drivers/char/rio/rio_linux.c b/trunk/drivers/char/rio/rio_linux.c index 3fa80aaf4527..aa43436d5d1b 100644 --- a/trunk/drivers/char/rio/rio_linux.c +++ b/trunk/drivers/char/rio/rio_linux.c @@ -33,6 +33,7 @@ * */ #include +#include #include #include #include @@ -243,7 +244,7 @@ static struct real_driver rio_real_driver = { * */ -static const struct file_operations rio_fw_fops = { +static struct file_operations rio_fw_fops = { .owner = THIS_MODULE, .ioctl = rio_fw_ioctl, }; @@ -1119,7 +1120,7 @@ static int __init rio_init(void) for (i = 0; i < p->RIONumHosts; i++) { hp = &p->RIOHosts[i]; if (hp->Ivec) { - int mode = IRQF_SHARED; + int mode = SA_SHIRQ; if (hp->Ivec & 0x8000) { mode = 0; hp->Ivec &= 0x7fff; diff --git a/trunk/drivers/char/rio/rio_linux.h b/trunk/drivers/char/rio/rio_linux.h index dc3f005614a3..55b9c97e8477 100644 --- a/trunk/drivers/char/rio/rio_linux.h +++ b/trunk/drivers/char/rio/rio_linux.h @@ -23,6 +23,7 @@ * Version 1.0 -- July, 1999. * */ +#include #define RIO_NBOARDS 4 #define RIO_PORTSPERBOARD 128 diff --git a/trunk/drivers/char/rio/rioinit.c b/trunk/drivers/char/rio/rioinit.c index 99f3df02b61c..12e34bc3f7ce 100644 --- a/trunk/drivers/char/rio/rioinit.c +++ b/trunk/drivers/char/rio/rioinit.c @@ -33,6 +33,7 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3"; #endif +#include #include #include #include diff --git a/trunk/drivers/char/riscom8.c b/trunk/drivers/char/riscom8.c index f1c94f771af5..c84c3c3f10c3 100644 --- a/trunk/drivers/char/riscom8.c +++ b/trunk/drivers/char/riscom8.c @@ -625,7 +625,7 @@ static inline int rc_setup_board(struct riscom_board * bp) if (bp->flags & RC_BOARD_ACTIVE) return 0; - error = request_irq(bp->irq, rc_interrupt, IRQF_DISABLED, + error = request_irq(bp->irq, rc_interrupt, SA_INTERRUPT, "RISCom/8", NULL); if (error) return error; diff --git a/trunk/drivers/char/rtc.c b/trunk/drivers/char/rtc.c index cc7bd1a3095b..0897b0c8d528 100644 --- a/trunk/drivers/char/rtc.c +++ b/trunk/drivers/char/rtc.c @@ -61,6 +61,7 @@ * this driver.) */ +#include #include #include #include @@ -220,7 +221,7 @@ static inline unsigned char rtc_is_updating(void) #ifdef RTC_IRQ /* - * A very tiny interrupt handler. It runs with IRQF_DISABLED set, + * A very tiny interrupt handler. It runs with SA_INTERRUPT set, * but there is possibility of conflicting with the set_rtc_mmss() * call (the rtc irq and the timer irq can easily run at the same * time in two different CPUs). So we need to serialize @@ -877,7 +878,7 @@ int rtc_control(rtc_task_t *task, unsigned int cmd, unsigned long arg) * The various file operations we support. */ -static const struct file_operations rtc_fops = { +static struct file_operations rtc_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = rtc_read, @@ -896,7 +897,7 @@ static struct miscdevice rtc_dev = { .fops = &rtc_fops, }; -static const struct file_operations rtc_proc_fops = { +static struct file_operations rtc_proc_fops = { .owner = THIS_MODULE, .open = rtc_proc_open, .read = seq_read, @@ -958,7 +959,7 @@ static int __init rtc_init(void) * XXX Interrupt pin #7 in Espresso is shared between RTC and * PCI Slot 2 INTA# (and some INTx# in Slot 1). */ - if (request_irq(rtc_irq, rtc_interrupt, IRQF_SHARED, "rtc", (void *)&rtc_port)) { + if (request_irq(rtc_irq, rtc_interrupt, SA_SHIRQ, "rtc", (void *)&rtc_port)) { printk(KERN_ERR "rtc: cannot register IRQ %d\n", rtc_irq); return -EIO; } @@ -976,7 +977,7 @@ static int __init rtc_init(void) rtc_int_handler_ptr = rtc_interrupt; } - if(request_irq(RTC_IRQ, rtc_int_handler_ptr, IRQF_DISABLED, "rtc", NULL)) { + if(request_irq(RTC_IRQ, rtc_int_handler_ptr, SA_INTERRUPT, "rtc", NULL)) { /* Yeah right, seeing as irq 8 doesn't even hit the bus. */ printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ); release_region(RTC_PORT(0), RTC_IO_EXTENT); diff --git a/trunk/drivers/char/s3c2410-rtc.c b/trunk/drivers/char/s3c2410-rtc.c index 5458ef1634e5..b0038b19b505 100644 --- a/trunk/drivers/char/s3c2410-rtc.c +++ b/trunk/drivers/char/s3c2410-rtc.c @@ -341,13 +341,13 @@ static int s3c2410_rtc_open(void) int ret; ret = request_irq(s3c2410_rtc_alarmno, s3c2410_rtc_alarmirq, - IRQF_DISABLED, "s3c2410-rtc alarm", NULL); + SA_INTERRUPT, "s3c2410-rtc alarm", NULL); if (ret) printk(KERN_ERR "IRQ%d already in use\n", s3c2410_rtc_alarmno); ret = request_irq(s3c2410_rtc_tickno, s3c2410_rtc_tickirq, - IRQF_DISABLED, "s3c2410-rtc tick", NULL); + SA_INTERRUPT, "s3c2410-rtc tick", NULL); if (ret) { printk(KERN_ERR "IRQ%d already in use\n", s3c2410_rtc_tickno); diff --git a/trunk/drivers/char/scx200_gpio.c b/trunk/drivers/char/scx200_gpio.c index 425c58719db6..5a280a330401 100644 --- a/trunk/drivers/char/scx200_gpio.c +++ b/trunk/drivers/char/scx200_gpio.c @@ -63,7 +63,7 @@ static int scx200_gpio_release(struct inode *inode, struct file *file) } -static const struct file_operations scx200_gpio_fops = { +static struct file_operations scx200_gpio_fops = { .owner = THIS_MODULE, .write = nsc_gpio_write, .read = nsc_gpio_read, @@ -126,10 +126,9 @@ static int __init scx200_gpio_init(void) undo_chrdev_region: unregister_chrdev_region(dev, num_pins); undo_platform_device_add: - platform_device_del(pdev); -undo_malloc: platform_device_put(pdev); - +undo_malloc: + kfree(pdev); return rc; } @@ -137,6 +136,7 @@ static void __exit scx200_gpio_cleanup(void) { kfree(scx200_devices); unregister_chrdev_region(MKDEV(major, 0), num_pins); + platform_device_put(pdev); platform_device_unregister(pdev); /* kfree(pdev); */ } diff --git a/trunk/drivers/char/serial167.c b/trunk/drivers/char/serial167.c index 21a710cb4bba..c851eeaa4069 100644 --- a/trunk/drivers/char/serial167.c +++ b/trunk/drivers/char/serial167.c @@ -44,6 +44,7 @@ * - replace bottom half handler with task queue handler */ +#include #include #include #include diff --git a/trunk/drivers/char/snsc.c b/trunk/drivers/char/snsc.c index afc6eda602f7..56c8243cdb73 100644 --- a/trunk/drivers/char/snsc.c +++ b/trunk/drivers/char/snsc.c @@ -105,7 +105,7 @@ scdrv_open(struct inode *inode, struct file *file) /* hook this subchannel up to the system controller interrupt */ rv = request_irq(SGI_UART_VECTOR, scdrv_interrupt, - IRQF_SHARED | IRQF_DISABLED, + SA_SHIRQ | SA_INTERRUPT, SYSCTL_BASENAME, sd); if (rv) { ia64_sn_irtr_close(sd->sd_nasid, sd->sd_subch); @@ -347,7 +347,7 @@ scdrv_poll(struct file *file, struct poll_table_struct *wait) return mask; } -static const struct file_operations scdrv_fops = { +static struct file_operations scdrv_fops = { .owner = THIS_MODULE, .read = scdrv_read, .write = scdrv_write, diff --git a/trunk/drivers/char/snsc_event.c b/trunk/drivers/char/snsc_event.c index 8b2210b633df..e234d50e142a 100644 --- a/trunk/drivers/char/snsc_event.c +++ b/trunk/drivers/char/snsc_event.c @@ -310,7 +310,7 @@ scdrv_event_init(struct sysctl_data_s *scd) /* hook event subchannel up to the system controller interrupt */ rv = request_irq(SGI_UART_VECTOR, scdrv_event_interrupt, - IRQF_SHARED | IRQF_DISABLED, + SA_SHIRQ | SA_INTERRUPT, "system controller events", event_sd); if (rv) { printk(KERN_WARNING "%s: irq request failed (%d)\n", diff --git a/trunk/drivers/char/sonypi.c b/trunk/drivers/char/sonypi.c index d4e434d694b7..43dfd8689dce 100644 --- a/trunk/drivers/char/sonypi.c +++ b/trunk/drivers/char/sonypi.c @@ -33,6 +33,7 @@ * */ +#include #include #include #include @@ -1106,7 +1107,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp, return ret; } -static const struct file_operations sonypi_misc_fops = { +static struct file_operations sonypi_misc_fops = { .owner = THIS_MODULE, .read = sonypi_misc_read, .poll = sonypi_misc_poll, @@ -1282,7 +1283,7 @@ static int __devinit sonypi_setup_irq(struct sonypi_device *dev, while (irq_list->irq) { if (!request_irq(irq_list->irq, sonypi_irq, - IRQF_SHARED, "sonypi", sonypi_irq)) { + SA_SHIRQ, "sonypi", sonypi_irq)) { dev->irq = irq_list->irq; dev->bits = irq_list->bits; return 0; diff --git a/trunk/drivers/char/specialix.c b/trunk/drivers/char/specialix.c index cb2859249d49..d2d6b01dcd05 100644 --- a/trunk/drivers/char/specialix.c +++ b/trunk/drivers/char/specialix.c @@ -75,6 +75,7 @@ * Documentation/specialix.txt */ +#include #include #include @@ -1015,9 +1016,9 @@ static inline int sx_setup_board(struct specialix_board * bp) return 0; if (bp->flags & SX_BOARD_IS_PCI) - error = request_irq(bp->irq, sx_interrupt, IRQF_DISABLED | IRQF_SHARED, "specialix IO8+", bp); + error = request_irq(bp->irq, sx_interrupt, SA_INTERRUPT | SA_SHIRQ, "specialix IO8+", bp); else - error = request_irq(bp->irq, sx_interrupt, IRQF_DISABLED, "specialix IO8+", bp); + error = request_irq(bp->irq, sx_interrupt, SA_INTERRUPT, "specialix IO8+", bp); if (error) return error; diff --git a/trunk/drivers/char/stallion.c b/trunk/drivers/char/stallion.c index 3beb2203d24b..0f7a542d9041 100644 --- a/trunk/drivers/char/stallion.c +++ b/trunk/drivers/char/stallion.c @@ -26,6 +26,7 @@ /*****************************************************************************/ +#include #include #include #include @@ -707,7 +708,7 @@ static unsigned int sc26198_baudtable[] = { * Define the driver info for a user level control device. Used mainly * to get at port stats - only not using the port device itself. */ -static const struct file_operations stl_fsiomem = { +static struct file_operations stl_fsiomem = { .owner = THIS_MODULE, .ioctl = stl_memioctl, }; @@ -2302,7 +2303,7 @@ static inline int stl_initeio(stlbrd_t *brdp) brdp->nrpanels = 1; brdp->state |= BRD_FOUND; brdp->hwid = status; - if (request_irq(brdp->irq, stl_intr, IRQF_SHARED, name, brdp) != 0) { + if (request_irq(brdp->irq, stl_intr, SA_SHIRQ, name, brdp) != 0) { printk("STALLION: failed to register interrupt " "routine for %s irq=%d\n", name, brdp->irq); rc = -ENODEV; @@ -2512,7 +2513,7 @@ static inline int stl_initech(stlbrd_t *brdp) outb((brdp->ioctrlval | ECH_BRDDISABLE), brdp->ioctrl); brdp->state |= BRD_FOUND; - if (request_irq(brdp->irq, stl_intr, IRQF_SHARED, name, brdp) != 0) { + if (request_irq(brdp->irq, stl_intr, SA_SHIRQ, name, brdp) != 0) { printk("STALLION: failed to register interrupt " "routine for %s irq=%d\n", name, brdp->irq); i = -ENODEV; diff --git a/trunk/drivers/char/sx.c b/trunk/drivers/char/sx.c index e1cd2bc4b1e4..76b9107f7f81 100644 --- a/trunk/drivers/char/sx.c +++ b/trunk/drivers/char/sx.c @@ -410,7 +410,7 @@ static struct real_driver sx_real_driver = { * */ -static const struct file_operations sx_fw_fops = { +static struct file_operations sx_fw_fops = { .owner = THIS_MODULE, .ioctl = sx_fw_ioctl, }; @@ -1993,7 +1993,7 @@ static int sx_init_board (struct sx_board *board) if(board->irq > 0) { /* fixed irq, probably PCI */ if(sx_irqmask & (1 << board->irq)) { /* may we use this irq? */ - if(request_irq(board->irq, sx_interrupt, IRQF_SHARED | IRQF_DISABLED, "sx", board)) { + if(request_irq(board->irq, sx_interrupt, SA_SHIRQ | SA_INTERRUPT, "sx", board)) { printk(KERN_ERR "sx: Cannot allocate irq %d.\n", board->irq); board->irq = 0; } @@ -2005,7 +2005,7 @@ static int sx_init_board (struct sx_board *board) int irqmask = sx_irqmask & (IS_SX_BOARD(board) ? SX_ISA_IRQ_MASK : SI2_ISA_IRQ_MASK); for(irqnr = 15; irqnr > 0; irqnr--) if(irqmask & (1 << irqnr)) - if(! request_irq(irqnr, sx_interrupt, IRQF_SHARED | IRQF_DISABLED, "sx", board)) + if(! request_irq(irqnr, sx_interrupt, SA_SHIRQ | SA_INTERRUPT, "sx", board)) break; if(! irqnr) printk(KERN_ERR "sx: Cannot allocate IRQ.\n"); diff --git a/trunk/drivers/char/synclink.c b/trunk/drivers/char/synclink.c index df782dd1098c..fee2aca3f6a5 100644 --- a/trunk/drivers/char/synclink.c +++ b/trunk/drivers/char/synclink.c @@ -8150,7 +8150,7 @@ static int __devinit synclink_init_one (struct pci_dev *dev, info->bus_type = MGSL_BUS_TYPE_PCI; info->io_addr_size = 8; - info->irq_flags = IRQF_SHARED; + info->irq_flags = SA_SHIRQ; if (dev->device == 0x0210) { /* Version 1 PCI9030 based universal PCI adapter */ diff --git a/trunk/drivers/char/synclink_gt.c b/trunk/drivers/char/synclink_gt.c index e829594195c1..4e35d4181224 100644 --- a/trunk/drivers/char/synclink_gt.c +++ b/trunk/drivers/char/synclink_gt.c @@ -46,6 +46,7 @@ //#define DBGRBUF(info) dump_rbufs(info) +#include #include #include #include @@ -3343,7 +3344,7 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev info->phys_reg_addr = pci_resource_start(pdev,0); info->bus_type = MGSL_BUS_TYPE_PCI; - info->irq_flags = IRQF_SHARED; + info->irq_flags = SA_SHIRQ; info->init_error = -1; /* assume error, set to 0 on successful init */ } diff --git a/trunk/drivers/char/synclinkmp.c b/trunk/drivers/char/synclinkmp.c index 1e443a233f51..21bf15ad9980 100644 --- a/trunk/drivers/char/synclinkmp.c +++ b/trunk/drivers/char/synclinkmp.c @@ -34,6 +34,7 @@ #define MAX_DEVICES 12 +#include #include #include #include @@ -3835,7 +3836,7 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev) info->phys_statctrl_base &= ~(PAGE_SIZE-1); info->bus_type = MGSL_BUS_TYPE_PCI; - info->irq_flags = IRQF_SHARED; + info->irq_flags = SA_SHIRQ; init_timer(&info->tx_timer); info->tx_timer.data = (unsigned long)info; diff --git a/trunk/drivers/char/sysrq.c b/trunk/drivers/char/sysrq.c index ee3ca8f1768e..35082dc12eae 100644 --- a/trunk/drivers/char/sysrq.c +++ b/trunk/drivers/char/sysrq.c @@ -12,6 +12,7 @@ * based upon discusions in irc://irc.openprojects.net/#kernelnewbies */ +#include #include #include #include @@ -147,13 +148,12 @@ static struct sysrq_key_op sysrq_mountro_op = { .enable_mask = SYSRQ_ENABLE_REMOUNT, }; -#ifdef CONFIG_LOCKDEP +#ifdef CONFIG_DEBUG_MUTEXES static void sysrq_handle_showlocks(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { - debug_show_all_locks(); + mutex_debug_show_all_locks(); } - static struct sysrq_key_op sysrq_showlocks_op = { .handler = sysrq_handle_showlocks, .help_msg = "show-all-locks(D)", diff --git a/trunk/drivers/char/tb0219.c b/trunk/drivers/char/tb0219.c index bb1bad4c18f9..a80c83210872 100644 --- a/trunk/drivers/char/tb0219.c +++ b/trunk/drivers/char/tb0219.c @@ -255,7 +255,7 @@ static int tanbac_tb0219_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations tb0219_fops = { +static struct file_operations tb0219_fops = { .owner = THIS_MODULE, .read = tanbac_tb0219_read, .write = tanbac_tb0219_write, diff --git a/trunk/drivers/char/tipar.c b/trunk/drivers/char/tipar.c index d30dc09dbbc9..f7802e5bd7ca 100644 --- a/trunk/drivers/char/tipar.c +++ b/trunk/drivers/char/tipar.c @@ -42,6 +42,7 @@ */ #undef DEBUG /* change to #define to get debugging * output - for pr_debug() */ +#include #include #include #include @@ -381,7 +382,7 @@ tipar_ioctl(struct inode *inode, struct file *file, /* ----- kernel module registering ------------------------------------ */ -static const struct file_operations tipar_fops = { +static struct file_operations tipar_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = tipar_read, diff --git a/trunk/drivers/char/tlclk.c b/trunk/drivers/char/tlclk.c index d2c5ba4e83b8..ef68d152d3e4 100644 --- a/trunk/drivers/char/tlclk.c +++ b/trunk/drivers/char/tlclk.c @@ -27,6 +27,7 @@ * MPCBL0010 ATCA computer. */ +#include #include #include #include @@ -208,7 +209,7 @@ static int tlclk_open(struct inode *inode, struct file *filp) /* This device is wired through the FPGA IO space of the ATCA blade * we can't share this IRQ */ result = request_irq(telclk_interrupt, &tlclk_interrupt, - IRQF_DISABLED, "telco_clock", tlclk_interrupt); + SA_INTERRUPT, "telco_clock", tlclk_interrupt); if (result == -EBUSY) { printk(KERN_ERR "tlclk: Interrupt can't be reserved.\n"); return -EBUSY; @@ -247,7 +248,7 @@ static ssize_t tlclk_write(struct file *filp, const char __user *buf, size_t cou return 0; } -static const struct file_operations tlclk_fops = { +static struct file_operations tlclk_fops = { .read = tlclk_read, .write = tlclk_write, .open = tlclk_open, diff --git a/trunk/drivers/char/toshiba.c b/trunk/drivers/char/toshiba.c index dd36fd04a842..e2fb234dee40 100644 --- a/trunk/drivers/char/toshiba.c +++ b/trunk/drivers/char/toshiba.c @@ -92,7 +92,7 @@ static int tosh_ioctl(struct inode *, struct file *, unsigned int, unsigned long); -static const struct file_operations tosh_fops = { +static struct file_operations tosh_fops = { .owner = THIS_MODULE, .ioctl = tosh_ioctl, }; diff --git a/trunk/drivers/char/tpm/tpm_atmel.c b/trunk/drivers/char/tpm/tpm_atmel.c index ad8ffe49256f..58a258cec153 100644 --- a/trunk/drivers/char/tpm/tpm_atmel.c +++ b/trunk/drivers/char/tpm/tpm_atmel.c @@ -116,7 +116,7 @@ static u8 tpm_atml_status(struct tpm_chip *chip) return ioread8(chip->vendor.iobase + 1); } -static const struct file_operations atmel_ops = { +static struct file_operations atmel_ops = { .owner = THIS_MODULE, .llseek = no_llseek, .open = tpm_open, diff --git a/trunk/drivers/char/tpm/tpm_infineon.c b/trunk/drivers/char/tpm/tpm_infineon.c index 1353b5a6bae8..adfff21beb21 100644 --- a/trunk/drivers/char/tpm/tpm_infineon.c +++ b/trunk/drivers/char/tpm/tpm_infineon.c @@ -338,7 +338,7 @@ static struct attribute *inf_attrs[] = { static struct attribute_group inf_attr_grp = {.attrs = inf_attrs }; -static const struct file_operations inf_ops = { +static struct file_operations inf_ops = { .owner = THIS_MODULE, .llseek = no_llseek, .open = tpm_open, diff --git a/trunk/drivers/char/tpm/tpm_nsc.c b/trunk/drivers/char/tpm/tpm_nsc.c index 26287aace87d..4c8bc06c7d95 100644 --- a/trunk/drivers/char/tpm/tpm_nsc.c +++ b/trunk/drivers/char/tpm/tpm_nsc.c @@ -226,7 +226,7 @@ static u8 tpm_nsc_status(struct tpm_chip *chip) return inb(chip->vendor.base + NSC_STATUS); } -static const struct file_operations nsc_ops = { +static struct file_operations nsc_ops = { .owner = THIS_MODULE, .llseek = no_llseek, .open = tpm_open, diff --git a/trunk/drivers/char/tpm/tpm_tis.c b/trunk/drivers/char/tpm/tpm_tis.c index 3232b1932597..8ea70625f7ea 100644 --- a/trunk/drivers/char/tpm/tpm_tis.c +++ b/trunk/drivers/char/tpm/tpm_tis.c @@ -330,7 +330,7 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len) return rc; } -static const struct file_operations tis_ops = { +static struct file_operations tis_ops = { .owner = THIS_MODULE, .llseek = no_llseek, .open = tpm_open, @@ -522,7 +522,7 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, iowrite8(i, chip->vendor.iobase + TPM_INT_VECTOR(chip->vendor.locality)); if (request_irq - (i, tis_int_probe, IRQF_SHARED, + (i, tis_int_probe, SA_SHIRQ, chip->vendor.miscdev.name, chip) != 0) { dev_info(chip->dev, "Unable to request irq: %d for probe\n", @@ -557,7 +557,7 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, chip->vendor.iobase + TPM_INT_VECTOR(chip->vendor.locality)); if (request_irq - (chip->vendor.irq, tis_int_handler, IRQF_SHARED, + (chip->vendor.irq, tis_int_handler, SA_SHIRQ, chip->vendor.miscdev.name, chip) != 0) { dev_info(chip->dev, "Unable to request irq: %d for use\n", diff --git a/trunk/drivers/char/tty_io.c b/trunk/drivers/char/tty_io.c index bfdb90242a90..a1143238feca 100644 --- a/trunk/drivers/char/tty_io.c +++ b/trunk/drivers/char/tty_io.c @@ -65,6 +65,7 @@ * alloc_tty_struct() always uses kmalloc() -- Andrew Morton 17Mar01 */ +#include #include #include #include @@ -912,7 +913,7 @@ static int hung_up_tty_ioctl(struct inode * inode, struct file * file, return cmd == TIOCSPGRP ? -ENOTTY : -EIO; } -static const struct file_operations tty_fops = { +static struct file_operations tty_fops = { .llseek = no_llseek, .read = tty_read, .write = tty_write, @@ -924,7 +925,7 @@ static const struct file_operations tty_fops = { }; #ifdef CONFIG_UNIX98_PTYS -static const struct file_operations ptmx_fops = { +static struct file_operations ptmx_fops = { .llseek = no_llseek, .read = tty_read, .write = tty_write, @@ -936,7 +937,7 @@ static const struct file_operations ptmx_fops = { }; #endif -static const struct file_operations console_fops = { +static struct file_operations console_fops = { .llseek = no_llseek, .read = tty_read, .write = redirected_tty_write, @@ -947,7 +948,7 @@ static const struct file_operations console_fops = { .fasync = tty_fasync, }; -static const struct file_operations hung_up_tty_fops = { +static struct file_operations hung_up_tty_fops = { .llseek = no_llseek, .read = hung_up_tty_read, .write = hung_up_tty_write, @@ -2336,7 +2337,7 @@ static int fionbio(struct file *file, int __user *p) static int tiocsctty(struct tty_struct *tty, int arg) { - struct task_struct *p; + task_t *p; if (current->signal->leader && (current->signal->session == tty->session)) diff --git a/trunk/drivers/char/vc_screen.c b/trunk/drivers/char/vc_screen.c index a9247b5213d5..234d7f3fb114 100644 --- a/trunk/drivers/char/vc_screen.c +++ b/trunk/drivers/char/vc_screen.c @@ -21,6 +21,7 @@ * - making it shorter - scr_readw are macros which expand in PRETTY long code */ +#include #include #include #include @@ -465,7 +466,7 @@ vcs_open(struct inode *inode, struct file *filp) return 0; } -static const struct file_operations vcs_fops = { +static struct file_operations vcs_fops = { .llseek = vcs_lseek, .read = vcs_read, .write = vcs_write, diff --git a/trunk/drivers/char/viocons.c b/trunk/drivers/char/viocons.c index 766f7864c6c6..07f5ce4b28e3 100644 --- a/trunk/drivers/char/viocons.c +++ b/trunk/drivers/char/viocons.c @@ -25,6 +25,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/drivers/char/viotape.c b/trunk/drivers/char/viotape.c index b72b2049aaae..198f1505ae23 100644 --- a/trunk/drivers/char/viotape.c +++ b/trunk/drivers/char/viotape.c @@ -31,6 +31,7 @@ * the OS/400 partition. The format of the messages is defined in * iseries/vio.h */ +#include #include #include #include @@ -292,7 +293,7 @@ static int proc_viotape_open(struct inode *inode, struct file *file) return single_open(file, proc_viotape_show, NULL); } -static const struct file_operations proc_viotape_operations = { +static struct file_operations proc_viotape_operations = { .open = proc_viotape_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/char/vme_scc.c b/trunk/drivers/char/vme_scc.c index bfe5ea948f6a..fe99fc1aba45 100644 --- a/trunk/drivers/char/vme_scc.c +++ b/trunk/drivers/char/vme_scc.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -203,13 +204,13 @@ static int mvme147_scc_init(void) port->datap = port->ctrlp + 1; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; - request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, + request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, SA_INTERRUPT, "SCC-A TX", port); - request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, + request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, SA_INTERRUPT, "SCC-A status", port); - request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, + request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, SA_INTERRUPT, "SCC-A RX", port); - request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, + request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-A special cond", port); { SCC_ACCESS_INIT(port); @@ -230,13 +231,13 @@ static int mvme147_scc_init(void) port->datap = port->ctrlp + 1; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; - request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, + request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, SA_INTERRUPT, "SCC-B TX", port); - request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, + request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, SA_INTERRUPT, "SCC-B status", port); - request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, + request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, SA_INTERRUPT, "SCC-B RX", port); - request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, + request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-B special cond", port); { SCC_ACCESS_INIT(port); @@ -273,13 +274,13 @@ static int mvme162_scc_init(void) port->datap = port->ctrlp + 2; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; - request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, + request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, SA_INTERRUPT, "SCC-A TX", port); - request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, + request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, SA_INTERRUPT, "SCC-A status", port); - request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, + request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, SA_INTERRUPT, "SCC-A RX", port); - request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, + request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-A special cond", port); { SCC_ACCESS_INIT(port); @@ -300,13 +301,13 @@ static int mvme162_scc_init(void) port->datap = port->ctrlp + 2; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; - request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, + request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, SA_INTERRUPT, "SCC-B TX", port); - request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, + request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, SA_INTERRUPT, "SCC-B status", port); - request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, + request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, SA_INTERRUPT, "SCC-B RX", port); - request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, + request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-B special cond", port); { @@ -341,13 +342,13 @@ static int bvme6000_scc_init(void) port->datap = port->ctrlp + 4; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; - request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, + request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, SA_INTERRUPT, "SCC-A TX", port); - request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, + request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, SA_INTERRUPT, "SCC-A status", port); - request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, + request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, SA_INTERRUPT, "SCC-A RX", port); - request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, + request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-A special cond", port); { SCC_ACCESS_INIT(port); @@ -368,13 +369,13 @@ static int bvme6000_scc_init(void) port->datap = port->ctrlp + 4; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; - request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, + request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, SA_INTERRUPT, "SCC-B TX", port); - request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, + request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, SA_INTERRUPT, "SCC-B status", port); - request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, + request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, SA_INTERRUPT, "SCC-B RX", port); - request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, + request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-B special cond", port); { diff --git a/trunk/drivers/char/vr41xx_giu.c b/trunk/drivers/char/vr41xx_giu.c index 1b9b1f1d4c49..073da48c092e 100644 --- a/trunk/drivers/char/vr41xx_giu.c +++ b/trunk/drivers/char/vr41xx_giu.c @@ -605,7 +605,7 @@ static int gpio_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations gpio_fops = { +static struct file_operations gpio_fops = { .owner = THIS_MODULE, .read = gpio_read, .write = gpio_write, diff --git a/trunk/drivers/char/vt.c b/trunk/drivers/char/vt.c index da7e66a2a38b..d6f65032649a 100644 --- a/trunk/drivers/char/vt.c +++ b/trunk/drivers/char/vt.c @@ -86,6 +86,7 @@ #include #include #include +#include #include #include #include @@ -886,7 +887,6 @@ void vc_disallocate(unsigned int currcons) if (vc_cons_allocated(currcons)) { struct vc_data *vc = vc_cons[currcons].d; vc->vc_sw->con_deinit(vc); - module_put(vc->vc_sw->owner); if (vc->vc_kmalloced) kfree(vc->vc_screenbuf); if (currcons >= MIN_NR_CONSOLES) diff --git a/trunk/drivers/char/vt_ioctl.c b/trunk/drivers/char/vt_ioctl.c index eccffaf26faa..24011e7c81ff 100644 --- a/trunk/drivers/char/vt_ioctl.c +++ b/trunk/drivers/char/vt_ioctl.c @@ -10,6 +10,7 @@ * Check put/get_user, cleanups - acme@conectiva.com.br - Jun 2001 */ +#include #include #include #include diff --git a/trunk/drivers/char/watchdog/acquirewdt.c b/trunk/drivers/char/watchdog/acquirewdt.c index c77fe3cf2852..7289f4af93d0 100644 --- a/trunk/drivers/char/watchdog/acquirewdt.c +++ b/trunk/drivers/char/watchdog/acquirewdt.c @@ -231,7 +231,7 @@ static int acq_notify_sys(struct notifier_block *this, unsigned long code, * Kernel Interfaces */ -static const struct file_operations acq_fops = { +static struct file_operations acq_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = acq_write, diff --git a/trunk/drivers/char/watchdog/advantechwdt.c b/trunk/drivers/char/watchdog/advantechwdt.c index 8069be445edc..194a3fd36b91 100644 --- a/trunk/drivers/char/watchdog/advantechwdt.c +++ b/trunk/drivers/char/watchdog/advantechwdt.c @@ -227,7 +227,7 @@ advwdt_notify_sys(struct notifier_block *this, unsigned long code, * Kernel Interfaces */ -static const struct file_operations advwdt_fops = { +static struct file_operations advwdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = advwdt_write, diff --git a/trunk/drivers/char/watchdog/alim1535_wdt.c b/trunk/drivers/char/watchdog/alim1535_wdt.c index c5c94e4c9495..8338ca300e2e 100644 --- a/trunk/drivers/char/watchdog/alim1535_wdt.c +++ b/trunk/drivers/char/watchdog/alim1535_wdt.c @@ -362,7 +362,7 @@ static int __init ali_find_watchdog(void) * Kernel Interfaces */ -static const struct file_operations ali_fops = { +static struct file_operations ali_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = ali_write, diff --git a/trunk/drivers/char/watchdog/alim7101_wdt.c b/trunk/drivers/char/watchdog/alim7101_wdt.c index ffd7684f999b..c05ac188a4d7 100644 --- a/trunk/drivers/char/watchdog/alim7101_wdt.c +++ b/trunk/drivers/char/watchdog/alim7101_wdt.c @@ -281,7 +281,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u } } -static const struct file_operations wdt_fops = { +static struct file_operations wdt_fops = { .owner= THIS_MODULE, .llseek= no_llseek, .write= fop_write, diff --git a/trunk/drivers/char/watchdog/at91_wdt.c b/trunk/drivers/char/watchdog/at91_wdt.c index cc266715ea32..00080655533d 100644 --- a/trunk/drivers/char/watchdog/at91_wdt.c +++ b/trunk/drivers/char/watchdog/at91_wdt.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include @@ -183,7 +184,7 @@ static ssize_t at91_wdt_write(struct file *file, const char *data, size_t len, l /* ......................................................................... */ -static const struct file_operations at91wdt_fops = { +static struct file_operations at91wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = at91_wdt_ioctl, diff --git a/trunk/drivers/char/watchdog/booke_wdt.c b/trunk/drivers/char/watchdog/booke_wdt.c index e3cefc538b40..b6640606b44d 100644 --- a/trunk/drivers/char/watchdog/booke_wdt.c +++ b/trunk/drivers/char/watchdog/booke_wdt.c @@ -14,6 +14,7 @@ * option) any later version. */ +#include #include #include #include @@ -145,7 +146,7 @@ static int booke_wdt_open (struct inode *inode, struct file *file) return 0; } -static const struct file_operations booke_wdt_fops = { +static struct file_operations booke_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = booke_wdt_write, diff --git a/trunk/drivers/char/watchdog/cpu5wdt.c b/trunk/drivers/char/watchdog/cpu5wdt.c index 04c7e49918db..3e8410b5a65e 100644 --- a/trunk/drivers/char/watchdog/cpu5wdt.c +++ b/trunk/drivers/char/watchdog/cpu5wdt.c @@ -198,7 +198,7 @@ static ssize_t cpu5wdt_write(struct file *file, const char __user *buf, size_t c return count; } -static const struct file_operations cpu5wdt_fops = { +static struct file_operations cpu5wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = cpu5wdt_ioctl, diff --git a/trunk/drivers/char/watchdog/ep93xx_wdt.c b/trunk/drivers/char/watchdog/ep93xx_wdt.c index 77c8a955ae9e..9021dbb78299 100644 --- a/trunk/drivers/char/watchdog/ep93xx_wdt.c +++ b/trunk/drivers/char/watchdog/ep93xx_wdt.c @@ -187,7 +187,7 @@ static int ep93xx_wdt_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations ep93xx_wdt_fops = { +static struct file_operations ep93xx_wdt_fops = { .owner = THIS_MODULE, .write = ep93xx_wdt_write, .ioctl = ep93xx_wdt_ioctl, diff --git a/trunk/drivers/char/watchdog/eurotechwdt.c b/trunk/drivers/char/watchdog/eurotechwdt.c index 62dbccb2f6df..25c2f2575611 100644 --- a/trunk/drivers/char/watchdog/eurotechwdt.c +++ b/trunk/drivers/char/watchdog/eurotechwdt.c @@ -40,6 +40,7 @@ * Added Matt Domsch's nowayout module option. */ +#include #include #include #include @@ -356,7 +357,7 @@ static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code, */ -static const struct file_operations eurwdt_fops = { +static struct file_operations eurwdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = eurwdt_write, @@ -420,7 +421,7 @@ static int __init eurwdt_init(void) goto out; } - ret = request_irq(irq, eurwdt_interrupt, IRQF_DISABLED, "eurwdt", NULL); + ret = request_irq(irq, eurwdt_interrupt, SA_INTERRUPT, "eurwdt", NULL); if(ret) { printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq); goto outmisc; diff --git a/trunk/drivers/char/watchdog/i6300esb.c b/trunk/drivers/char/watchdog/i6300esb.c index 870539eabbf3..93785f13242e 100644 --- a/trunk/drivers/char/watchdog/i6300esb.c +++ b/trunk/drivers/char/watchdog/i6300esb.c @@ -337,7 +337,7 @@ static int esb_notify_sys (struct notifier_block *this, unsigned long code, void * Kernel Interfaces */ -static const struct file_operations esb_fops = { +static struct file_operations esb_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = esb_write, diff --git a/trunk/drivers/char/watchdog/i8xx_tco.c b/trunk/drivers/char/watchdog/i8xx_tco.c index 8385dd36eefe..bfbdbbf3c2f2 100644 --- a/trunk/drivers/char/watchdog/i8xx_tco.c +++ b/trunk/drivers/char/watchdog/i8xx_tco.c @@ -378,7 +378,7 @@ static int i8xx_tco_notify_sys (struct notifier_block *this, unsigned long code, * Kernel Interfaces */ -static const struct file_operations i8xx_tco_fops = { +static struct file_operations i8xx_tco_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = i8xx_tco_write, diff --git a/trunk/drivers/char/watchdog/ib700wdt.c b/trunk/drivers/char/watchdog/ib700wdt.c index fd95f7327798..cf60329eec85 100644 --- a/trunk/drivers/char/watchdog/ib700wdt.c +++ b/trunk/drivers/char/watchdog/ib700wdt.c @@ -31,6 +31,7 @@ * */ +#include #include #include #include @@ -255,7 +256,7 @@ ibwdt_notify_sys(struct notifier_block *this, unsigned long code, * Kernel Interfaces */ -static const struct file_operations ibwdt_fops = { +static struct file_operations ibwdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = ibwdt_write, diff --git a/trunk/drivers/char/watchdog/ibmasr.c b/trunk/drivers/char/watchdog/ibmasr.c index 26ceee7a4df0..294c474ae485 100644 --- a/trunk/drivers/char/watchdog/ibmasr.c +++ b/trunk/drivers/char/watchdog/ibmasr.c @@ -10,6 +10,7 @@ * of the GNU Public License, incorporated herein by reference. */ +#include #include #include #include @@ -322,7 +323,7 @@ static int asr_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations asr_fops = { +static struct file_operations asr_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = asr_write, diff --git a/trunk/drivers/char/watchdog/indydog.c b/trunk/drivers/char/watchdog/indydog.c index dacc1c20a310..b4b94daba67e 100644 --- a/trunk/drivers/char/watchdog/indydog.c +++ b/trunk/drivers/char/watchdog/indydog.c @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -154,7 +155,7 @@ static int indydog_notify_sys(struct notifier_block *this, unsigned long code, v return NOTIFY_DONE; } -static const struct file_operations indydog_fops = { +static struct file_operations indydog_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = indydog_write, diff --git a/trunk/drivers/char/watchdog/ixp2000_wdt.c b/trunk/drivers/char/watchdog/ixp2000_wdt.c index 692908819e26..0cfb9b9c4a4b 100644 --- a/trunk/drivers/char/watchdog/ixp2000_wdt.c +++ b/trunk/drivers/char/watchdog/ixp2000_wdt.c @@ -16,6 +16,7 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include @@ -168,7 +169,7 @@ ixp2000_wdt_release(struct inode *inode, struct file *file) } -static const struct file_operations ixp2000_wdt_fops = +static struct file_operations ixp2000_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/char/watchdog/ixp4xx_wdt.c b/trunk/drivers/char/watchdog/ixp4xx_wdt.c index 9db5cf2c38c3..3800835ca8f3 100644 --- a/trunk/drivers/char/watchdog/ixp4xx_wdt.c +++ b/trunk/drivers/char/watchdog/ixp4xx_wdt.c @@ -13,6 +13,7 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include @@ -162,7 +163,7 @@ ixp4xx_wdt_release(struct inode *inode, struct file *file) } -static const struct file_operations ixp4xx_wdt_fops = +static struct file_operations ixp4xx_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/char/watchdog/machzwd.c b/trunk/drivers/char/watchdog/machzwd.c index 23734e07fb22..a9a20aad61e7 100644 --- a/trunk/drivers/char/watchdog/machzwd.c +++ b/trunk/drivers/char/watchdog/machzwd.c @@ -28,6 +28,7 @@ * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT */ +#include #include #include #include @@ -388,7 +389,7 @@ static int zf_notify_sys(struct notifier_block *this, unsigned long code, -static const struct file_operations zf_fops = { +static struct file_operations zf_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = zf_write, diff --git a/trunk/drivers/char/watchdog/mixcomwd.c b/trunk/drivers/char/watchdog/mixcomwd.c index ae943324d251..d8dede575402 100644 --- a/trunk/drivers/char/watchdog/mixcomwd.c +++ b/trunk/drivers/char/watchdog/mixcomwd.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -190,7 +191,7 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file, return 0; } -static const struct file_operations mixcomwd_fops= +static struct file_operations mixcomwd_fops= { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/char/watchdog/mpc83xx_wdt.c b/trunk/drivers/char/watchdog/mpc83xx_wdt.c index a480903ee1a5..5d6f5061603a 100644 --- a/trunk/drivers/char/watchdog/mpc83xx_wdt.c +++ b/trunk/drivers/char/watchdog/mpc83xx_wdt.c @@ -15,6 +15,7 @@ * option) any later version. */ +#include #include #include #include @@ -129,7 +130,7 @@ static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file, } } -static const struct file_operations mpc83xx_wdt_fops = { +static struct file_operations mpc83xx_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = mpc83xx_wdt_write, diff --git a/trunk/drivers/char/watchdog/mpc8xx_wdt.c b/trunk/drivers/char/watchdog/mpc8xx_wdt.c index 35dd9e6e1140..b2fc71e20850 100644 --- a/trunk/drivers/char/watchdog/mpc8xx_wdt.c +++ b/trunk/drivers/char/watchdog/mpc8xx_wdt.c @@ -9,6 +9,7 @@ * or implied. */ +#include #include #include #include @@ -132,7 +133,7 @@ static int mpc8xx_wdt_ioctl(struct inode *inode, struct file *file, return 0; } -static const struct file_operations mpc8xx_wdt_fops = { +static struct file_operations mpc8xx_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = mpc8xx_wdt_write, diff --git a/trunk/drivers/char/watchdog/mpcore_wdt.c b/trunk/drivers/char/watchdog/mpcore_wdt.c index 54b3c56ead0d..2c2c51773200 100644 --- a/trunk/drivers/char/watchdog/mpcore_wdt.c +++ b/trunk/drivers/char/watchdog/mpcore_wdt.c @@ -21,6 +21,7 @@ */ #include #include +#include #include #include #include @@ -297,7 +298,7 @@ static void mpcore_wdt_shutdown(struct platform_device *dev) /* * Kernel Interfaces */ -static const struct file_operations mpcore_wdt_fops = { +static struct file_operations mpcore_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = mpcore_wdt_write, @@ -355,7 +356,7 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev) goto err_misc; } - ret = request_irq(wdt->irq, mpcore_wdt_fire, IRQF_DISABLED, "mpcore_wdt", wdt); + ret = request_irq(wdt->irq, mpcore_wdt_fire, SA_INTERRUPT, "mpcore_wdt", wdt); if (ret) { dev_printk(KERN_ERR, _dev, "cannot register IRQ%d for watchdog\n", wdt->irq); goto err_irq; diff --git a/trunk/drivers/char/watchdog/mv64x60_wdt.c b/trunk/drivers/char/watchdog/mv64x60_wdt.c index 5c8fab345b40..f1b9cf89f153 100644 --- a/trunk/drivers/char/watchdog/mv64x60_wdt.c +++ b/trunk/drivers/char/watchdog/mv64x60_wdt.c @@ -15,6 +15,7 @@ * or implied. */ +#include #include #include #include @@ -166,7 +167,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, return 0; } -static const struct file_operations mv64x60_wdt_fops = { +static struct file_operations mv64x60_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = mv64x60_wdt_write, diff --git a/trunk/drivers/char/watchdog/pcwd.c b/trunk/drivers/char/watchdog/pcwd.c index cd7d1b6a5d9f..6d44ca68312d 100644 --- a/trunk/drivers/char/watchdog/pcwd.c +++ b/trunk/drivers/char/watchdog/pcwd.c @@ -740,7 +740,7 @@ static int pcwd_notify_sys(struct notifier_block *this, unsigned long code, void * Kernel Interfaces */ -static const struct file_operations pcwd_fops = { +static struct file_operations pcwd_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = pcwd_write, @@ -755,7 +755,7 @@ static struct miscdevice pcwd_miscdev = { .fops = &pcwd_fops, }; -static const struct file_operations pcwd_temp_fops = { +static struct file_operations pcwd_temp_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = pcwd_temp_read, diff --git a/trunk/drivers/char/watchdog/pcwd_pci.c b/trunk/drivers/char/watchdog/pcwd_pci.c index c7cfd6dbfe1b..1f40ecefbf72 100644 --- a/trunk/drivers/char/watchdog/pcwd_pci.c +++ b/trunk/drivers/char/watchdog/pcwd_pci.c @@ -625,7 +625,7 @@ static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, v * Kernel Interfaces */ -static const struct file_operations pcipcwd_fops = { +static struct file_operations pcipcwd_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = pcipcwd_write, @@ -640,7 +640,7 @@ static struct miscdevice pcipcwd_miscdev = { .fops = &pcipcwd_fops, }; -static const struct file_operations pcipcwd_temp_fops = { +static struct file_operations pcipcwd_temp_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = pcipcwd_temp_read, diff --git a/trunk/drivers/char/watchdog/pcwd_usb.c b/trunk/drivers/char/watchdog/pcwd_usb.c index b7ae73dcdd08..0d072bed501d 100644 --- a/trunk/drivers/char/watchdog/pcwd_usb.c +++ b/trunk/drivers/char/watchdog/pcwd_usb.c @@ -24,6 +24,7 @@ * http://www.berkprod.com/ or http://www.pcwatchdog.com/ */ +#include #include #include #include @@ -523,7 +524,7 @@ static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code, * Kernel Interfaces */ -static const struct file_operations usb_pcwd_fops = { +static struct file_operations usb_pcwd_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = usb_pcwd_write, @@ -538,7 +539,7 @@ static struct miscdevice usb_pcwd_miscdev = { .fops = &usb_pcwd_fops, }; -static const struct file_operations usb_pcwd_temperature_fops = { +static struct file_operations usb_pcwd_temperature_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = usb_pcwd_temperature_read, diff --git a/trunk/drivers/char/watchdog/s3c2410_wdt.c b/trunk/drivers/char/watchdog/s3c2410_wdt.c index be978e8ed754..1ea04e9b2b0b 100644 --- a/trunk/drivers/char/watchdog/s3c2410_wdt.c +++ b/trunk/drivers/char/watchdog/s3c2410_wdt.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -319,7 +320,7 @@ static int s3c2410wdt_ioctl(struct inode *inode, struct file *file, /* kernel interface */ -static const struct file_operations s3c2410wdt_fops = { +static struct file_operations s3c2410wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = s3c2410wdt_write, diff --git a/trunk/drivers/char/watchdog/sa1100_wdt.c b/trunk/drivers/char/watchdog/sa1100_wdt.c index 1fc16d995788..522a9370db94 100644 --- a/trunk/drivers/char/watchdog/sa1100_wdt.c +++ b/trunk/drivers/char/watchdog/sa1100_wdt.c @@ -17,6 +17,7 @@ * * 27/11/2000 Initial release */ +#include #include #include #include @@ -135,7 +136,7 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file, return ret; } -static const struct file_operations sa1100dog_fops = +static struct file_operations sa1100dog_fops = { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/char/watchdog/sbc60xxwdt.c b/trunk/drivers/char/watchdog/sbc60xxwdt.c index 4663c2fd53cd..ed0bd55fbfc1 100644 --- a/trunk/drivers/char/watchdog/sbc60xxwdt.c +++ b/trunk/drivers/char/watchdog/sbc60xxwdt.c @@ -282,7 +282,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, } } -static const struct file_operations wdt_fops = { +static struct file_operations wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = fop_write, diff --git a/trunk/drivers/char/watchdog/sbc8360.c b/trunk/drivers/char/watchdog/sbc8360.c index 1035be5b5019..c6cbf808d8c2 100644 --- a/trunk/drivers/char/watchdog/sbc8360.c +++ b/trunk/drivers/char/watchdog/sbc8360.c @@ -36,6 +36,7 @@ * */ +#include #include #include #include @@ -305,7 +306,7 @@ static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code, * Kernel Interfaces */ -static const struct file_operations sbc8360_fops = { +static struct file_operations sbc8360_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = sbc8360_write, diff --git a/trunk/drivers/char/watchdog/sbc_epx_c3.c b/trunk/drivers/char/watchdog/sbc_epx_c3.c index bfc475dabe6d..837b1ec3ffe3 100644 --- a/trunk/drivers/char/watchdog/sbc_epx_c3.c +++ b/trunk/drivers/char/watchdog/sbc_epx_c3.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -154,7 +155,7 @@ static int epx_c3_notify_sys(struct notifier_block *this, unsigned long code, return NOTIFY_DONE; } -static const struct file_operations epx_c3_fops = { +static struct file_operations epx_c3_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = epx_c3_write, diff --git a/trunk/drivers/char/watchdog/sc1200wdt.c b/trunk/drivers/char/watchdog/sc1200wdt.c index 7c3cf293a5af..20b88f9b7be2 100644 --- a/trunk/drivers/char/watchdog/sc1200wdt.c +++ b/trunk/drivers/char/watchdog/sc1200wdt.c @@ -27,6 +27,7 @@ * */ +#include #include #include #include @@ -292,7 +293,7 @@ static struct notifier_block sc1200wdt_notifier = .notifier_call = sc1200wdt_notify_sys, }; -static const struct file_operations sc1200wdt_fops = +static struct file_operations sc1200wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/char/watchdog/sc520_wdt.c b/trunk/drivers/char/watchdog/sc520_wdt.c index 2c7c9db71be8..4ee9974ad8cb 100644 --- a/trunk/drivers/char/watchdog/sc520_wdt.c +++ b/trunk/drivers/char/watchdog/sc520_wdt.c @@ -336,7 +336,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, } } -static const struct file_operations wdt_fops = { +static struct file_operations wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = fop_write, diff --git a/trunk/drivers/char/watchdog/scx200_wdt.c b/trunk/drivers/char/watchdog/scx200_wdt.c index c561299a5537..b4a102a2d7e3 100644 --- a/trunk/drivers/char/watchdog/scx200_wdt.c +++ b/trunk/drivers/char/watchdog/scx200_wdt.c @@ -17,6 +17,7 @@ of any nature resulting due to the use of this software. This software is provided AS-IS with no warranties. */ +#include #include #include #include @@ -194,7 +195,7 @@ static int scx200_wdt_ioctl(struct inode *inode, struct file *file, } } -static const struct file_operations scx200_wdt_fops = { +static struct file_operations scx200_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = scx200_wdt_write, diff --git a/trunk/drivers/char/watchdog/shwdt.c b/trunk/drivers/char/watchdog/shwdt.c index 1355038f1044..1f4cab55b2ef 100644 --- a/trunk/drivers/char/watchdog/shwdt.c +++ b/trunk/drivers/char/watchdog/shwdt.c @@ -17,6 +17,7 @@ * Added expect close support, made emulated timeout runtime changeable * general cleanups, add some ioctls */ +#include #include #include #include @@ -344,7 +345,7 @@ static int sh_wdt_notify_sys(struct notifier_block *this, return NOTIFY_DONE; } -static const struct file_operations sh_wdt_fops = { +static struct file_operations sh_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = sh_wdt_write, diff --git a/trunk/drivers/char/watchdog/softdog.c b/trunk/drivers/char/watchdog/softdog.c index ef8da517545a..a91edaf3a350 100644 --- a/trunk/drivers/char/watchdog/softdog.c +++ b/trunk/drivers/char/watchdog/softdog.c @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -243,7 +244,7 @@ static int softdog_notify_sys(struct notifier_block *this, unsigned long code, * Kernel Interfaces */ -static const struct file_operations softdog_fops = { +static struct file_operations softdog_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = softdog_write, diff --git a/trunk/drivers/char/watchdog/w83627hf_wdt.c b/trunk/drivers/char/watchdog/w83627hf_wdt.c index 13f16d41c2fd..d15ca9a3986f 100644 --- a/trunk/drivers/char/watchdog/w83627hf_wdt.c +++ b/trunk/drivers/char/watchdog/w83627hf_wdt.c @@ -274,7 +274,7 @@ wdt_notify_sys(struct notifier_block *this, unsigned long code, * Kernel Interfaces */ -static const struct file_operations wdt_fops = { +static struct file_operations wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = wdt_write, diff --git a/trunk/drivers/char/watchdog/w83877f_wdt.c b/trunk/drivers/char/watchdog/w83877f_wdt.c index ccf6c0915945..52a8bd0a5988 100644 --- a/trunk/drivers/char/watchdog/w83877f_wdt.c +++ b/trunk/drivers/char/watchdog/w83877f_wdt.c @@ -299,7 +299,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, } } -static const struct file_operations wdt_fops = { +static struct file_operations wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = fop_write, diff --git a/trunk/drivers/char/watchdog/w83977f_wdt.c b/trunk/drivers/char/watchdog/w83977f_wdt.c index 98f4e17db70a..a7ff64c8921f 100644 --- a/trunk/drivers/char/watchdog/w83977f_wdt.c +++ b/trunk/drivers/char/watchdog/w83977f_wdt.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -449,7 +450,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, return NOTIFY_DONE; } -static const struct file_operations wdt_fops= +static struct file_operations wdt_fops= { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/char/watchdog/wafer5823wdt.c b/trunk/drivers/char/watchdog/wafer5823wdt.c index 2bb6a9d6ad28..7cf6c9bbf486 100644 --- a/trunk/drivers/char/watchdog/wafer5823wdt.c +++ b/trunk/drivers/char/watchdog/wafer5823wdt.c @@ -222,7 +222,7 @@ static int wafwdt_notify_sys(struct notifier_block *this, unsigned long code, vo * Kernel Interfaces */ -static const struct file_operations wafwdt_fops = { +static struct file_operations wafwdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = wafwdt_write, diff --git a/trunk/drivers/char/watchdog/wd501p.h b/trunk/drivers/char/watchdog/wd501p.h index a4504f40394d..84e60eb74337 100644 --- a/trunk/drivers/char/watchdog/wd501p.h +++ b/trunk/drivers/char/watchdog/wd501p.h @@ -19,6 +19,7 @@ * */ +#include #define WDT_COUNT0 (io+0) #define WDT_COUNT1 (io+1) diff --git a/trunk/drivers/char/watchdog/wdrtas.c b/trunk/drivers/char/watchdog/wdrtas.c index 5c38cdf41731..dacfe31caccf 100644 --- a/trunk/drivers/char/watchdog/wdrtas.c +++ b/trunk/drivers/char/watchdog/wdrtas.c @@ -26,6 +26,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -520,7 +521,7 @@ wdrtas_reboot(struct notifier_block *this, unsigned long code, void *ptr) /*** initialization stuff */ -static const struct file_operations wdrtas_fops = { +static struct file_operations wdrtas_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = wdrtas_write, @@ -535,7 +536,7 @@ static struct miscdevice wdrtas_miscdev = { .fops = &wdrtas_fops, }; -static const struct file_operations wdrtas_temp_fops = { +static struct file_operations wdrtas_temp_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = wdrtas_temp_read, diff --git a/trunk/drivers/char/watchdog/wdt.c b/trunk/drivers/char/watchdog/wdt.c index 70be81e39a61..ec7e401228ee 100644 --- a/trunk/drivers/char/watchdog/wdt.c +++ b/trunk/drivers/char/watchdog/wdt.c @@ -31,6 +31,7 @@ * Matt Domsch : Added nowayout module option */ +#include #include #include #include @@ -494,7 +495,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, */ -static const struct file_operations wdt_fops = { +static struct file_operations wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = wdt_write, @@ -510,7 +511,7 @@ static struct miscdevice wdt_miscdev = { }; #ifdef CONFIG_WDT_501 -static const struct file_operations wdt_temp_fops = { +static struct file_operations wdt_temp_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = wdt_temp_read, @@ -580,7 +581,7 @@ static int __init wdt_init(void) goto out; } - ret = request_irq(irq, wdt_interrupt, IRQF_DISABLED, "wdt501p", NULL); + ret = request_irq(irq, wdt_interrupt, SA_INTERRUPT, "wdt501p", NULL); if(ret) { printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq); goto outreg; diff --git a/trunk/drivers/char/watchdog/wdt285.c b/trunk/drivers/char/watchdog/wdt285.c index 6555fb844f23..52825a1f1779 100644 --- a/trunk/drivers/char/watchdog/wdt285.c +++ b/trunk/drivers/char/watchdog/wdt285.c @@ -178,7 +178,7 @@ watchdog_ioctl(struct inode *inode, struct file *file, unsigned int cmd, return ret; } -static const struct file_operations watchdog_fops = { +static struct file_operations watchdog_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = watchdog_write, diff --git a/trunk/drivers/char/watchdog/wdt977.c b/trunk/drivers/char/watchdog/wdt977.c index a0935bc775f8..3843900e94c4 100644 --- a/trunk/drivers/char/watchdog/wdt977.c +++ b/trunk/drivers/char/watchdog/wdt977.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -418,7 +419,7 @@ static int wdt977_notify_sys(struct notifier_block *this, unsigned long code, return NOTIFY_DONE; } -static const struct file_operations wdt977_fops= +static struct file_operations wdt977_fops= { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/char/watchdog/wdt_pci.c b/trunk/drivers/char/watchdog/wdt_pci.c index 5918ca2c9c35..4b3311993d48 100644 --- a/trunk/drivers/char/watchdog/wdt_pci.c +++ b/trunk/drivers/char/watchdog/wdt_pci.c @@ -35,6 +35,7 @@ * Matt Domsch : nowayout module option */ +#include #include #include #include @@ -543,7 +544,7 @@ static int wdtpci_notify_sys(struct notifier_block *this, unsigned long code, */ -static const struct file_operations wdtpci_fops = { +static struct file_operations wdtpci_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = wdtpci_write, @@ -559,7 +560,7 @@ static struct miscdevice wdtpci_miscdev = { }; #ifdef CONFIG_WDT_501_PCI -static const struct file_operations wdtpci_temp_fops = { +static struct file_operations wdtpci_temp_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = wdtpci_temp_read, @@ -617,7 +618,7 @@ static int __devinit wdtpci_init_one (struct pci_dev *dev, goto out_pci; } - if (request_irq (irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED, + if (request_irq (irq, wdtpci_interrupt, SA_INTERRUPT | SA_SHIRQ, "wdt_pci", &wdtpci_miscdev)) { printk (KERN_ERR PFX "IRQ %d is not free\n", irq); goto out_reg; diff --git a/trunk/drivers/cpufreq/cpufreq.c b/trunk/drivers/cpufreq/cpufreq.c index 1ba4039777e8..35e0b9ceecf7 100644 --- a/trunk/drivers/cpufreq/cpufreq.c +++ b/trunk/drivers/cpufreq/cpufreq.c @@ -15,6 +15,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/cpufreq/cpufreq_ondemand.c b/trunk/drivers/cpufreq/cpufreq_ondemand.c index 693e540481b4..a2add11e56f1 100644 --- a/trunk/drivers/cpufreq/cpufreq_ondemand.c +++ b/trunk/drivers/cpufreq/cpufreq_ondemand.c @@ -56,16 +56,14 @@ static unsigned int def_sampling_rate; #define MIN_SAMPLING_RATE (def_sampling_rate / MIN_SAMPLING_RATE_RATIO) #define MAX_SAMPLING_RATE (500 * def_sampling_rate) #define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000) -#define DEF_SAMPLING_DOWN_FACTOR (1) -#define MAX_SAMPLING_DOWN_FACTOR (10) #define TRANSITION_LATENCY_LIMIT (10 * 1000) static void do_dbs_timer(void *data); struct cpu_dbs_info_s { + cputime64_t prev_cpu_idle; + cputime64_t prev_cpu_wall; struct cpufreq_policy *cur_policy; - unsigned int prev_cpu_idle_up; - unsigned int prev_cpu_idle_down; unsigned int enable; }; static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info); @@ -87,24 +85,26 @@ static struct workqueue_struct *dbs_workq; struct dbs_tuners { unsigned int sampling_rate; - unsigned int sampling_down_factor; unsigned int up_threshold; unsigned int ignore_nice; }; static struct dbs_tuners dbs_tuners_ins = { .up_threshold = DEF_FREQUENCY_UP_THRESHOLD, - .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR, .ignore_nice = 0, }; -static inline unsigned int get_cpu_idle_time(unsigned int cpu) +static inline cputime64_t get_cpu_idle_time(unsigned int cpu) { - return kstat_cpu(cpu).cpustat.idle + - kstat_cpu(cpu).cpustat.iowait + - ( dbs_tuners_ins.ignore_nice ? - kstat_cpu(cpu).cpustat.nice : - 0); + cputime64_t retval; + + retval = cputime64_add(kstat_cpu(cpu).cpustat.idle, + kstat_cpu(cpu).cpustat.iowait); + + if (dbs_tuners_ins.ignore_nice) + retval = cputime64_add(retval, kstat_cpu(cpu).cpustat.nice); + + return retval; } /************************** sysfs interface ************************/ @@ -133,29 +133,9 @@ static ssize_t show_##file_name \ return sprintf(buf, "%u\n", dbs_tuners_ins.object); \ } show_one(sampling_rate, sampling_rate); -show_one(sampling_down_factor, sampling_down_factor); show_one(up_threshold, up_threshold); show_one(ignore_nice_load, ignore_nice); -static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, - const char *buf, size_t count) -{ - unsigned int input; - int ret; - ret = sscanf (buf, "%u", &input); - if (ret != 1 ) - return -EINVAL; - - if (input > MAX_SAMPLING_DOWN_FACTOR || input < 1) - return -EINVAL; - - mutex_lock(&dbs_mutex); - dbs_tuners_ins.sampling_down_factor = input; - mutex_unlock(&dbs_mutex); - - return count; -} - static ssize_t store_sampling_rate(struct cpufreq_policy *unused, const char *buf, size_t count) { @@ -217,12 +197,12 @@ static ssize_t store_ignore_nice_load(struct cpufreq_policy *policy, } dbs_tuners_ins.ignore_nice = input; - /* we need to re-evaluate prev_cpu_idle_up and prev_cpu_idle_down */ + /* we need to re-evaluate prev_cpu_idle */ for_each_online_cpu(j) { - struct cpu_dbs_info_s *j_dbs_info; - j_dbs_info = &per_cpu(cpu_dbs_info, j); - j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j); - j_dbs_info->prev_cpu_idle_down = j_dbs_info->prev_cpu_idle_up; + struct cpu_dbs_info_s *dbs_info; + dbs_info = &per_cpu(cpu_dbs_info, j); + dbs_info->prev_cpu_idle = get_cpu_idle_time(j); + dbs_info->prev_cpu_wall = get_jiffies_64(); } mutex_unlock(&dbs_mutex); @@ -234,7 +214,6 @@ static struct freq_attr _name = \ __ATTR(_name, 0644, show_##_name, store_##_name) define_one_rw(sampling_rate); -define_one_rw(sampling_down_factor); define_one_rw(up_threshold); define_one_rw(ignore_nice_load); @@ -242,7 +221,6 @@ static struct attribute * dbs_attributes[] = { &sampling_rate_max.attr, &sampling_rate_min.attr, &sampling_rate.attr, - &sampling_down_factor.attr, &up_threshold.attr, &ignore_nice_load.attr, NULL @@ -257,11 +235,10 @@ static struct attribute_group dbs_attr_group = { static void dbs_check_cpu(int cpu) { - unsigned int idle_ticks, up_idle_ticks, total_ticks; - unsigned int freq_next; - unsigned int freq_down_sampling_rate; - static int down_skip[NR_CPUS]; + unsigned int idle_ticks, total_ticks; + unsigned int load; struct cpu_dbs_info_s *this_dbs_info; + cputime64_t cur_jiffies; struct cpufreq_policy *policy; unsigned int j; @@ -271,10 +248,14 @@ static void dbs_check_cpu(int cpu) return; policy = this_dbs_info->cur_policy; + cur_jiffies = jiffies64_to_cputime64(get_jiffies_64()); + total_ticks = (unsigned int) cputime64_sub(cur_jiffies, + this_dbs_info->prev_cpu_wall); + this_dbs_info->prev_cpu_wall = cur_jiffies; /* * Every sampling_rate, we check, if current idle time is less * than 20% (default), then we try to increase frequency - * Every sampling_rate*sampling_down_factor, we look for a the lowest + * Every sampling_rate, we look for a the lowest * frequency which can sustain the load while keeping idle time over * 30%. If such a frequency exist, we try to decrease to this frequency. * @@ -283,36 +264,26 @@ static void dbs_check_cpu(int cpu) * 5% (default) of current frequency */ - /* Check for frequency increase */ + /* Get Idle Time */ idle_ticks = UINT_MAX; for_each_cpu_mask(j, policy->cpus) { - unsigned int tmp_idle_ticks, total_idle_ticks; + cputime64_t total_idle_ticks; + unsigned int tmp_idle_ticks; struct cpu_dbs_info_s *j_dbs_info; j_dbs_info = &per_cpu(cpu_dbs_info, j); total_idle_ticks = get_cpu_idle_time(j); - tmp_idle_ticks = total_idle_ticks - - j_dbs_info->prev_cpu_idle_up; - j_dbs_info->prev_cpu_idle_up = total_idle_ticks; + tmp_idle_ticks = (unsigned int) cputime64_sub(total_idle_ticks, + j_dbs_info->prev_cpu_idle); + j_dbs_info->prev_cpu_idle = total_idle_ticks; if (tmp_idle_ticks < idle_ticks) idle_ticks = tmp_idle_ticks; } + load = (100 * (total_ticks - idle_ticks)) / total_ticks; - /* Scale idle ticks by 100 and compare with up and down ticks */ - idle_ticks *= 100; - up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) * - usecs_to_jiffies(dbs_tuners_ins.sampling_rate); - - if (idle_ticks < up_idle_ticks) { - down_skip[cpu] = 0; - for_each_cpu_mask(j, policy->cpus) { - struct cpu_dbs_info_s *j_dbs_info; - - j_dbs_info = &per_cpu(cpu_dbs_info, j); - j_dbs_info->prev_cpu_idle_down = - j_dbs_info->prev_cpu_idle_up; - } + /* Check for frequency increase */ + if (load > dbs_tuners_ins.up_threshold) { /* if we are already at full speed then break out early */ if (policy->cur == policy->max) return; @@ -323,50 +294,22 @@ static void dbs_check_cpu(int cpu) } /* Check for frequency decrease */ - down_skip[cpu]++; - if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor) - return; - - idle_ticks = UINT_MAX; - for_each_cpu_mask(j, policy->cpus) { - unsigned int tmp_idle_ticks, total_idle_ticks; - struct cpu_dbs_info_s *j_dbs_info; - - j_dbs_info = &per_cpu(cpu_dbs_info, j); - /* Check for frequency decrease */ - total_idle_ticks = j_dbs_info->prev_cpu_idle_up; - tmp_idle_ticks = total_idle_ticks - - j_dbs_info->prev_cpu_idle_down; - j_dbs_info->prev_cpu_idle_down = total_idle_ticks; - - if (tmp_idle_ticks < idle_ticks) - idle_ticks = tmp_idle_ticks; - } - - down_skip[cpu] = 0; /* if we cannot reduce the frequency anymore, break out early */ if (policy->cur == policy->min) return; - /* Compute how many ticks there are between two measurements */ - freq_down_sampling_rate = dbs_tuners_ins.sampling_rate * - dbs_tuners_ins.sampling_down_factor; - total_ticks = usecs_to_jiffies(freq_down_sampling_rate); - /* * The optimal frequency is the frequency that is the lowest that * can support the current CPU usage without triggering the up * policy. To be safe, we focus 10 points under the threshold. */ - freq_next = ((total_ticks - idle_ticks) * 100) / total_ticks; - freq_next = (freq_next * policy->cur) / + if (load < (dbs_tuners_ins.up_threshold - 10)) { + unsigned int freq_next; + freq_next = (policy->cur * load) / (dbs_tuners_ins.up_threshold - 10); - if (freq_next < policy->min) - freq_next = policy->min; - - if (freq_next <= ((policy->cur * 95) / 100)) __cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L); + } } static void do_dbs_timer(void *data) @@ -432,9 +375,8 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, j_dbs_info = &per_cpu(cpu_dbs_info, j); j_dbs_info->cur_policy = policy; - j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j); - j_dbs_info->prev_cpu_idle_down - = j_dbs_info->prev_cpu_idle_up; + j_dbs_info->prev_cpu_idle = get_cpu_idle_time(j); + j_dbs_info->prev_cpu_wall = get_jiffies_64(); } this_dbs_info->enable = 1; sysfs_create_group(&policy->kobj, &dbs_attr_group); diff --git a/trunk/drivers/cpufreq/cpufreq_stats.c b/trunk/drivers/cpufreq/cpufreq_stats.c index 25eee5394201..145061b8472a 100644 --- a/trunk/drivers/cpufreq/cpufreq_stats.c +++ b/trunk/drivers/cpufreq/cpufreq_stats.c @@ -9,6 +9,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/cpufreq/cpufreq_userspace.c b/trunk/drivers/cpufreq/cpufreq_userspace.c index 44ae5e5b94cf..071ee4f1bbf2 100644 --- a/trunk/drivers/cpufreq/cpufreq_userspace.c +++ b/trunk/drivers/cpufreq/cpufreq_userspace.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/dma/dmaengine.c b/trunk/drivers/dma/dmaengine.c index 15278044295c..5829143558e1 100644 --- a/trunk/drivers/dma/dmaengine.c +++ b/trunk/drivers/dma/dmaengine.c @@ -166,8 +166,8 @@ static struct dma_chan *dma_client_chan_alloc(struct dma_client *client) } /** - * dma_chan_cleanup - release a DMA channel's resources - * @kref: kernel reference structure that contains the DMA channel device + * dma_client_chan_free - release a DMA channel + * @chan: &dma_chan */ void dma_chan_cleanup(struct kref *kref) { @@ -199,7 +199,7 @@ static void dma_client_chan_free(struct dma_chan *chan) * dma_chans_rebalance - reallocate channels to clients * * When the number of DMA channel in the system changes, - * channels need to be rebalanced among clients. + * channels need to be rebalanced among clients */ static void dma_chans_rebalance(void) { @@ -264,7 +264,7 @@ struct dma_client *dma_async_client_register(dma_event_callback event_callback) /** * dma_async_client_unregister - unregister a client and free the &dma_client - * @client: &dma_client to free + * @client: * * Force frees any allocated DMA channels, frees the &dma_client memory */ @@ -306,7 +306,7 @@ void dma_async_client_chan_request(struct dma_client *client, } /** - * dma_async_device_register - registers DMA devices found + * dma_async_device_register - * @device: &dma_device */ int dma_async_device_register(struct dma_device *device) @@ -348,8 +348,8 @@ int dma_async_device_register(struct dma_device *device) } /** - * dma_async_device_cleanup - function called when all references are released - * @kref: kernel reference object + * dma_async_device_unregister - + * @device: &dma_device */ static void dma_async_device_cleanup(struct kref *kref) { @@ -359,11 +359,7 @@ static void dma_async_device_cleanup(struct kref *kref) complete(&device->done); } -/** - * dma_async_device_unregister - unregisters DMA devices - * @device: &dma_device - */ -void dma_async_device_unregister(struct dma_device *device) +void dma_async_device_unregister(struct dma_device* device) { struct dma_chan *chan; unsigned long flags; diff --git a/trunk/drivers/dma/ioatdma.c b/trunk/drivers/dma/ioatdma.c index 78bf46d917b7..2801d14a5e42 100644 --- a/trunk/drivers/dma/ioatdma.c +++ b/trunk/drivers/dma/ioatdma.c @@ -217,7 +217,7 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan) /** * do_ioat_dma_memcpy - actual function that initiates a IOAT DMA transaction - * @ioat_chan: IOAT DMA channel handle + * @chan: IOAT DMA channel handle * @dest: DMA destination address * @src: DMA source address * @len: transaction length in bytes @@ -383,7 +383,7 @@ static dma_cookie_t ioat_dma_memcpy_buf_to_pg(struct dma_chan *chan, * @dest_off: offset into that page * @src_pg: pointer to the page to copy from * @src_off: offset into that page - * @len: transaction length in bytes. This is guaranteed not to make a copy + * @len: transaction length in bytes. This is guaranteed to not make a copy * across a page boundary. */ @@ -407,7 +407,7 @@ static dma_cookie_t ioat_dma_memcpy_pg_to_pg(struct dma_chan *chan, } /** - * ioat_dma_memcpy_issue_pending - push potentially unrecognized appended descriptors to hw + * ioat_dma_memcpy_issue_pending - push potentially unrecognoized appended descriptors to hw * @chan: DMA channel handle */ @@ -510,8 +510,6 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *chan) * ioat_dma_is_complete - poll the status of a IOAT DMA transaction * @chan: IOAT DMA channel handle * @cookie: DMA transaction identifier - * @done: if not %NULL, updated with last completed transaction - * @used: if not %NULL, updated with last used transaction */ static enum dma_status ioat_dma_is_complete(struct dma_chan *chan, @@ -741,7 +739,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev, device->msi = 0; } #endif - err = request_irq(pdev->irq, &ioat_do_interrupt, IRQF_SHARED, "ioat", + err = request_irq(pdev->irq, &ioat_do_interrupt, SA_SHIRQ, "ioat", device); if (err) goto err_irq; @@ -828,7 +826,7 @@ static int __init ioat_init_module(void) /* if forced, worst case is that rmmod hangs */ __unsafe(THIS_MODULE); - return pci_module_init(&ioat_pci_drv); + pci_module_init(&ioat_pci_drv); } module_init(ioat_init_module); diff --git a/trunk/drivers/dma/ioatdma_registers.h b/trunk/drivers/dma/ioatdma_registers.h index a30c7349075a..41a21ab2b000 100644 --- a/trunk/drivers/dma/ioatdma_registers.h +++ b/trunk/drivers/dma/ioatdma_registers.h @@ -76,7 +76,7 @@ #define IOAT_CHANSTS_OFFSET 0x04 /* 64-bit Channel Status Register */ #define IOAT_CHANSTS_OFFSET_LOW 0x04 #define IOAT_CHANSTS_OFFSET_HIGH 0x08 -#define IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR 0xFFFFFFFFFFFFFFC0UL +#define IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR 0xFFFFFFFFFFFFFFC0 #define IOAT_CHANSTS_SOFT_ERR 0x0000000000000010 #define IOAT_CHANSTS_DMA_TRANSFER_STATUS 0x0000000000000007 #define IOAT_CHANSTS_DMA_TRANSFER_STATUS_ACTIVE 0x0 diff --git a/trunk/drivers/dma/iovlock.c b/trunk/drivers/dma/iovlock.c index d637555a833b..5ed327e453a2 100644 --- a/trunk/drivers/dma/iovlock.c +++ b/trunk/drivers/dma/iovlock.c @@ -31,7 +31,7 @@ #include #include -static int num_pages_spanned(struct iovec *iov) +int num_pages_spanned(struct iovec *iov) { return ((PAGE_ALIGN((unsigned long)iov->iov_base + iov->iov_len) - diff --git a/trunk/drivers/edac/amd76x_edac.c b/trunk/drivers/edac/amd76x_edac.c index f79f6b587bfa..53423ad6d4a3 100644 --- a/trunk/drivers/edac/amd76x_edac.c +++ b/trunk/drivers/edac/amd76x_edac.c @@ -12,6 +12,7 @@ * */ +#include #include #include #include @@ -19,9 +20,6 @@ #include #include "edac_mc.h" -#define AMD76X_REVISION " Ver: 2.0.1 " __DATE__ -#define EDAC_MOD_STR "amd76x_edac" - #define amd76x_printk(level, fmt, arg...) \ edac_printk(level, "amd76x", fmt, ##arg) @@ -104,18 +102,15 @@ static const struct amd76x_dev_info amd76x_devs[] = { static void amd76x_get_error_info(struct mem_ctl_info *mci, struct amd76x_error_info *info) { - struct pci_dev *pdev; - - pdev = to_pci_dev(mci->dev); - pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, + pci_read_config_dword(mci->pdev, AMD76X_ECC_MODE_STATUS, &info->ecc_mode_status); if (info->ecc_mode_status & BIT(8)) - pci_write_bits32(pdev, AMD76X_ECC_MODE_STATUS, + pci_write_bits32(mci->pdev, AMD76X_ECC_MODE_STATUS, (u32) BIT(8), (u32) BIT(8)); if (info->ecc_mode_status & BIT(9)) - pci_write_bits32(pdev, AMD76X_ECC_MODE_STATUS, + pci_write_bits32(mci->pdev, AMD76X_ECC_MODE_STATUS, (u32) BIT(9), (u32) BIT(9)); } @@ -181,38 +176,6 @@ static void amd76x_check(struct mem_ctl_info *mci) amd76x_process_error_info(mci, &info, 1); } -static void amd76x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, - enum edac_type edac_mode) -{ - struct csrow_info *csrow; - u32 mba, mba_base, mba_mask, dms; - int index; - - for (index = 0; index < mci->nr_csrows; index++) { - csrow = &mci->csrows[index]; - - /* find the DRAM Chip Select Base address and mask */ - pci_read_config_dword(pdev, - AMD76X_MEM_BASE_ADDR + (index * 4), - &mba); - - if (!(mba & BIT(0))) - continue; - - mba_base = mba & 0xff800000UL; - mba_mask = ((mba & 0xff80) << 16) | 0x7fffffUL; - pci_read_config_dword(pdev, AMD76X_DRAM_MODE_STATUS, &dms); - csrow->first_page = mba_base >> PAGE_SHIFT; - csrow->nr_pages = (mba_mask + 1) >> PAGE_SHIFT; - csrow->last_page = csrow->first_page + csrow->nr_pages - 1; - csrow->page_mask = mba_mask >> PAGE_SHIFT; - csrow->grain = csrow->nr_pages << PAGE_SHIFT; - csrow->mtype = MEM_RDDR; - csrow->dtype = ((dms >> index) & 0x1) ? DEV_X4 : DEV_UNKNOWN; - csrow->edac_mode = edac_mode; - } -} - /** * amd76x_probe1 - Perform set up for detected device * @pdev; PCI device detected @@ -224,13 +187,15 @@ static void amd76x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, */ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx) { - static const enum edac_type ems_modes[] = { + int rc = -ENODEV; + int index; + struct mem_ctl_info *mci = NULL; + enum edac_type ems_modes[] = { EDAC_NONE, EDAC_EC, EDAC_SECDED, EDAC_SECDED }; - struct mem_ctl_info *mci = NULL; u32 ems; u32 ems_mode; struct amd76x_error_info discard; @@ -241,28 +206,53 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx) mci = edac_mc_alloc(0, AMD76X_NR_CSROWS, AMD76X_NR_CHANS); if (mci == NULL) { - return -ENOMEM; + rc = -ENOMEM; + goto fail; } debugf0("%s(): mci = %p\n", __func__, mci); - mci->dev = &pdev->dev; + mci->pdev = pdev; mci->mtype_cap = MEM_FLAG_RDDR; mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; mci->edac_cap = ems_mode ? (EDAC_FLAG_EC | EDAC_FLAG_SECDED) : EDAC_FLAG_NONE; mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = AMD76X_REVISION; + mci->mod_ver = "$Revision: 1.4.2.5 $"; mci->ctl_name = amd76x_devs[dev_idx].ctl_name; mci->edac_check = amd76x_check; mci->ctl_page_to_phys = NULL; - amd76x_init_csrows(mci, pdev, ems_modes[ems_mode]); + for (index = 0; index < mci->nr_csrows; index++) { + struct csrow_info *csrow = &mci->csrows[index]; + u32 mba; + u32 mba_base; + u32 mba_mask; + u32 dms; + + /* find the DRAM Chip Select Base address and mask */ + pci_read_config_dword(mci->pdev, + AMD76X_MEM_BASE_ADDR + (index * 4), &mba); + + if (!(mba & BIT(0))) + continue; + + mba_base = mba & 0xff800000UL; + mba_mask = ((mba & 0xff80) << 16) | 0x7fffffUL; + pci_read_config_dword(mci->pdev, AMD76X_DRAM_MODE_STATUS, + &dms); + csrow->first_page = mba_base >> PAGE_SHIFT; + csrow->nr_pages = (mba_mask + 1) >> PAGE_SHIFT; + csrow->last_page = csrow->first_page + csrow->nr_pages - 1; + csrow->page_mask = mba_mask >> PAGE_SHIFT; + csrow->grain = csrow->nr_pages << PAGE_SHIFT; + csrow->mtype = MEM_RDDR; + csrow->dtype = ((dms >> index) & 0x1) ? DEV_X4 : DEV_UNKNOWN; + csrow->edac_mode = ems_modes[ems_mode]; + } + amd76x_get_error_info(mci, &discard); /* clear counters */ - /* Here we assume that we will never see multiple instances of this - * type of memory controller. The ID is therefore hardcoded to 0. - */ - if (edac_mc_add_mc(mci,0)) { + if (edac_mc_add_mc(mci)) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); goto fail; } @@ -272,8 +262,9 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx) return 0; fail: - edac_mc_free(mci); - return -ENODEV; + if (mci != NULL) + edac_mc_free(mci); + return rc; } /* returns count (>= 0), or negative on error */ @@ -300,7 +291,7 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) + if ((mci = edac_mc_del_mc(pdev)) == NULL) return; edac_mc_free(mci); diff --git a/trunk/drivers/edac/e752x_edac.c b/trunk/drivers/edac/e752x_edac.c index c82bc0ed7f14..fce31936e6d7 100644 --- a/trunk/drivers/edac/e752x_edac.c +++ b/trunk/drivers/edac/e752x_edac.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include @@ -24,9 +25,6 @@ #include #include "edac_mc.h" -#define E752X_REVISION " Ver: 2.0.1 " __DATE__ -#define EDAC_MOD_STR "e752x_edac" - static int force_function_unhide; #define e752x_printk(level, fmt, arg...) \ @@ -765,174 +763,22 @@ static void e752x_check(struct mem_ctl_info *mci) e752x_process_error_info(mci, &info, 1); } -/* Return 1 if dual channel mode is active. Else return 0. */ -static inline int dual_channel_active(u16 ddrcsr) -{ - return (((ddrcsr >> 12) & 3) == 3); -} - -static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, - u16 ddrcsr) -{ - struct csrow_info *csrow; - unsigned long last_cumul_size; - int index, mem_dev, drc_chan; - int drc_drbg; /* DRB granularity 0=64mb, 1=128mb */ - int drc_ddim; /* DRAM Data Integrity Mode 0=none, 2=edac */ - u8 value; - u32 dra, drc, cumul_size; - - pci_read_config_dword(pdev, E752X_DRA, &dra); - pci_read_config_dword(pdev, E752X_DRC, &drc); - drc_chan = dual_channel_active(ddrcsr); - drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */ - drc_ddim = (drc >> 20) & 0x3; - - /* The dram row boundary (DRB) reg values are boundary address for - * each DRAM row with a granularity of 64 or 128MB (single/dual - * channel operation). DRB regs are cumulative; therefore DRB7 will - * contain the total memory contained in all eight rows. - */ - for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { - /* mem_dev 0=x8, 1=x4 */ - mem_dev = (dra >> (index * 4 + 2)) & 0x3; - csrow = &mci->csrows[index]; - - mem_dev = (mem_dev == 2); - pci_read_config_byte(pdev, E752X_DRB + index, &value); - /* convert a 128 or 64 MiB DRB to a page size. */ - cumul_size = value << (25 + drc_drbg - PAGE_SHIFT); - debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, - cumul_size); - if (cumul_size == last_cumul_size) - continue; /* not populated */ - - csrow->first_page = last_cumul_size; - csrow->last_page = cumul_size - 1; - csrow->nr_pages = cumul_size - last_cumul_size; - last_cumul_size = cumul_size; - csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */ - csrow->mtype = MEM_RDDR; /* only one type supported */ - csrow->dtype = mem_dev ? DEV_X4 : DEV_X8; - - /* - * if single channel or x8 devices then SECDED - * if dual channel and x4 then S4ECD4ED - */ - if (drc_ddim) { - if (drc_chan && mem_dev) { - csrow->edac_mode = EDAC_S4ECD4ED; - mci->edac_cap |= EDAC_FLAG_S4ECD4ED; - } else { - csrow->edac_mode = EDAC_SECDED; - mci->edac_cap |= EDAC_FLAG_SECDED; - } - } else - csrow->edac_mode = EDAC_NONE; - } -} - -static void e752x_init_mem_map_table(struct pci_dev *pdev, - struct e752x_pvt *pvt) -{ - int index; - u8 value, last, row, stat8; - - last = 0; - row = 0; - - for (index = 0; index < 8; index += 2) { - pci_read_config_byte(pdev, E752X_DRB + index, &value); - /* test if there is a dimm in this slot */ - if (value == last) { - /* no dimm in the slot, so flag it as empty */ - pvt->map[index] = 0xff; - pvt->map[index + 1] = 0xff; - } else { /* there is a dimm in the slot */ - pvt->map[index] = row; - row++; - last = value; - /* test the next value to see if the dimm is double - * sided - */ - pci_read_config_byte(pdev, E752X_DRB + index + 1, - &value); - pvt->map[index + 1] = (value == last) ? - 0xff : /* the dimm is single sided, - so flag as empty */ - row; /* this is a double sided dimm - to save the next row # */ - row++; - last = value; - } - } - - /* set the map type. 1 = normal, 0 = reversed */ - pci_read_config_byte(pdev, E752X_DRM, &stat8); - pvt->map_type = ((stat8 & 0x0f) > ((stat8 >> 4) & 0x0f)); -} - -/* Return 0 on success or 1 on failure. */ -static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, - struct e752x_pvt *pvt) -{ - struct pci_dev *dev; - - pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, - pvt->dev_info->err_dev, - pvt->bridge_ck); - - if (pvt->bridge_ck == NULL) - pvt->bridge_ck = pci_scan_single_device(pdev->bus, - PCI_DEVFN(0, 1)); - - if (pvt->bridge_ck == NULL) { - e752x_printk(KERN_ERR, "error reporting device not found:" - "vendor %x device 0x%x (broken BIOS?)\n", - PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); - return 1; - } - - dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev, - NULL); - - if (dev == NULL) - goto fail; - - pvt->dev_d0f0 = dev; - pvt->dev_d0f1 = pci_dev_get(pvt->bridge_ck); - - return 0; - -fail: - pci_dev_put(pvt->bridge_ck); - return 1; -} - -static void e752x_init_error_reporting_regs(struct e752x_pvt *pvt) -{ - struct pci_dev *dev; - - dev = pvt->dev_d0f1; - /* Turn off error disable & SMI in case the BIOS turned it on */ - pci_write_config_byte(dev, E752X_HI_ERRMASK, 0x00); - pci_write_config_byte(dev, E752X_HI_SMICMD, 0x00); - pci_write_config_word(dev, E752X_SYSBUS_ERRMASK, 0x00); - pci_write_config_word(dev, E752X_SYSBUS_SMICMD, 0x00); - pci_write_config_byte(dev, E752X_BUF_ERRMASK, 0x00); - pci_write_config_byte(dev, E752X_BUF_SMICMD, 0x00); - pci_write_config_byte(dev, E752X_DRAM_ERRMASK, 0x00); - pci_write_config_byte(dev, E752X_DRAM_SMICMD, 0x00); -} - static int e752x_probe1(struct pci_dev *pdev, int dev_idx) { + int rc = -ENODEV; + int index; u16 pci_data; u8 stat8; - struct mem_ctl_info *mci; - struct e752x_pvt *pvt; + struct mem_ctl_info *mci = NULL; + struct e752x_pvt *pvt = NULL; u16 ddrcsr; + u32 drc; int drc_chan; /* Number of channels 0=1chan,1=2chan */ + int drc_drbg; /* DRB granularity 0=64mb, 1=128mb */ + int drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ + u32 dra; + unsigned long last_cumul_size; + struct pci_dev *dev = NULL; struct e752x_error_info discard; debugf0("%s(): mci\n", __func__); @@ -946,20 +792,25 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) if (!force_function_unhide && !(stat8 & (1 << 5))) { printk(KERN_INFO "Contact your BIOS vendor to see if the " "E752x error registers can be safely un-hidden\n"); - return -ENOMEM; + goto fail; } stat8 |= (1 << 5); pci_write_config_byte(pdev, E752X_DEVPRES1, stat8); + /* need to find out the number of channels */ + pci_read_config_dword(pdev, E752X_DRC, &drc); pci_read_config_word(pdev, E752X_DDRCSR, &ddrcsr); /* FIXME: should check >>12 or 0xf, true for all? */ /* Dual channel = 1, Single channel = 0 */ - drc_chan = dual_channel_active(ddrcsr); + drc_chan = (((ddrcsr >> 12) & 3) == 3); + drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */ + drc_ddim = (drc >> 20) & 0x3; mci = edac_mc_alloc(sizeof(*pvt), E752X_NR_CSROWS, drc_chan + 1); if (mci == NULL) { - return -ENOMEM; + rc = -ENOMEM; + goto fail; } debugf3("%s(): init mci\n", __func__); @@ -968,54 +819,159 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) EDAC_FLAG_S4ECD4ED; /* FIXME - what if different memory types are in different csrows? */ mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = E752X_REVISION; - mci->dev = &pdev->dev; + mci->mod_ver = "$Revision: 1.5.2.11 $"; + mci->pdev = pdev; debugf3("%s(): init pvt\n", __func__); pvt = (struct e752x_pvt *) mci->pvt_info; pvt->dev_info = &e752x_devs[dev_idx]; - pvt->mc_symmetric = ((ddrcsr & 0x10) != 0); + pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, + pvt->dev_info->err_dev, + pvt->bridge_ck); - if (e752x_get_devs(pdev, dev_idx, pvt)) { - edac_mc_free(mci); - return -ENODEV; + if (pvt->bridge_ck == NULL) + pvt->bridge_ck = pci_scan_single_device(pdev->bus, + PCI_DEVFN(0, 1)); + + if (pvt->bridge_ck == NULL) { + e752x_printk(KERN_ERR, "error reporting device not found:" + "vendor %x device 0x%x (broken BIOS?)\n", + PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); + goto fail; } + pvt->mc_symmetric = ((ddrcsr & 0x10) != 0); debugf3("%s(): more mci init\n", __func__); mci->ctl_name = pvt->dev_info->ctl_name; mci->edac_check = e752x_check; mci->ctl_page_to_phys = ctl_page_to_phys; - e752x_init_csrows(mci, pdev, ddrcsr); - e752x_init_mem_map_table(pdev, pvt); + /* find out the device types */ + pci_read_config_dword(pdev, E752X_DRA, &dra); + + /* + * The dram row boundary (DRB) reg values are boundary address for + * each DRAM row with a granularity of 64 or 128MB (single/dual + * channel operation). DRB regs are cumulative; therefore DRB7 will + * contain the total memory contained in all eight rows. + */ + for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { + u8 value; + u32 cumul_size; + + /* mem_dev 0=x8, 1=x4 */ + int mem_dev = (dra >> (index * 4 + 2)) & 0x3; + struct csrow_info *csrow = &mci->csrows[index]; + + mem_dev = (mem_dev == 2); + pci_read_config_byte(mci->pdev, E752X_DRB + index, &value); + /* convert a 128 or 64 MiB DRB to a page size. */ + cumul_size = value << (25 + drc_drbg - PAGE_SHIFT); + debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, + cumul_size); + + if (cumul_size == last_cumul_size) + continue; /* not populated */ + + csrow->first_page = last_cumul_size; + csrow->last_page = cumul_size - 1; + csrow->nr_pages = cumul_size - last_cumul_size; + last_cumul_size = cumul_size; + csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */ + csrow->mtype = MEM_RDDR; /* only one type supported */ + csrow->dtype = mem_dev ? DEV_X4 : DEV_X8; + + /* + * if single channel or x8 devices then SECDED + * if dual channel and x4 then S4ECD4ED + */ + if (drc_ddim) { + if (drc_chan && mem_dev) { + csrow->edac_mode = EDAC_S4ECD4ED; + mci->edac_cap |= EDAC_FLAG_S4ECD4ED; + } else { + csrow->edac_mode = EDAC_SECDED; + mci->edac_cap |= EDAC_FLAG_SECDED; + } + } else + csrow->edac_mode = EDAC_NONE; + } + + /* Fill in the memory map table */ + { + u8 value; + u8 last = 0; + u8 row = 0; + + for (index = 0; index < 8; index += 2) { + pci_read_config_byte(mci->pdev, E752X_DRB + index, + &value); + + /* test if there is a dimm in this slot */ + if (value == last) { + /* no dimm in the slot, so flag it as empty */ + pvt->map[index] = 0xff; + pvt->map[index + 1] = 0xff; + } else { /* there is a dimm in the slot */ + pvt->map[index] = row; + row++; + last = value; + /* test the next value to see if the dimm is + double sided */ + pci_read_config_byte(mci->pdev, + E752X_DRB + index + 1, + &value); + pvt->map[index + 1] = (value == last) ? + 0xff : /* the dimm is single sided, + * so flag as empty + */ + row; /* this is a double sided dimm + * to save the next row # + */ + row++; + last = value; + } + } + } /* set the map type. 1 = normal, 0 = reversed */ - pci_read_config_byte(pdev, E752X_DRM, &stat8); + pci_read_config_byte(mci->pdev, E752X_DRM, &stat8); pvt->map_type = ((stat8 & 0x0f) > ((stat8 >> 4) & 0x0f)); mci->edac_cap |= EDAC_FLAG_NONE; debugf3("%s(): tolm, remapbase, remaplimit\n", __func__); /* load the top of low memory, remap base, and remap limit vars */ - pci_read_config_word(pdev, E752X_TOLM, &pci_data); + pci_read_config_word(mci->pdev, E752X_TOLM, &pci_data); pvt->tolm = ((u32) pci_data) << 4; - pci_read_config_word(pdev, E752X_REMAPBASE, &pci_data); + pci_read_config_word(mci->pdev, E752X_REMAPBASE, &pci_data); pvt->remapbase = ((u32) pci_data) << 14; - pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data); + pci_read_config_word(mci->pdev, E752X_REMAPLIMIT, &pci_data); pvt->remaplimit = ((u32) pci_data) << 14; e752x_printk(KERN_INFO, "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, pvt->remapbase, pvt->remaplimit); - /* Here we assume that we will never see multiple instances of this - * type of memory controller. The ID is therefore hardcoded to 0. - */ - if (edac_mc_add_mc(mci,0)) { + if (edac_mc_add_mc(mci)) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); goto fail; } - e752x_init_error_reporting_regs(pvt); + dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev, + NULL); + pvt->dev_d0f0 = dev; + /* find the error reporting device and clear errors */ + dev = pvt->dev_d0f1 = pci_dev_get(pvt->bridge_ck); + /* Turn off error disable & SMI in case the BIOS turned it on */ + pci_write_config_byte(dev, E752X_HI_ERRMASK, 0x00); + pci_write_config_byte(dev, E752X_HI_SMICMD, 0x00); + pci_write_config_word(dev, E752X_SYSBUS_ERRMASK, 0x00); + pci_write_config_word(dev, E752X_SYSBUS_SMICMD, 0x00); + pci_write_config_byte(dev, E752X_BUF_ERRMASK, 0x00); + pci_write_config_byte(dev, E752X_BUF_SMICMD, 0x00); + pci_write_config_byte(dev, E752X_DRAM_ERRMASK, 0x00); + pci_write_config_byte(dev, E752X_DRAM_SMICMD, 0x00); + e752x_get_error_info(mci, &discard); /* clear other MCH errors */ /* get this far and it's successful */ @@ -1023,12 +979,20 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) return 0; fail: - pci_dev_put(pvt->dev_d0f0); - pci_dev_put(pvt->dev_d0f1); - pci_dev_put(pvt->bridge_ck); - edac_mc_free(mci); + if (mci) { + if (pvt->dev_d0f0) + pci_dev_put(pvt->dev_d0f0); + + if (pvt->dev_d0f1) + pci_dev_put(pvt->dev_d0f1); + + if (pvt->bridge_ck) + pci_dev_put(pvt->bridge_ck); + + edac_mc_free(mci); + } - return -ENODEV; + return rc; } /* returns count (>= 0), or negative on error */ @@ -1051,7 +1015,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) + if ((mci = edac_mc_del_mc(pdev)) == NULL) return; pvt = (struct e752x_pvt *) mci->pvt_info; diff --git a/trunk/drivers/edac/e7xxx_edac.c b/trunk/drivers/edac/e7xxx_edac.c index 310d91b41c96..a9518d3e4be4 100644 --- a/trunk/drivers/edac/e7xxx_edac.c +++ b/trunk/drivers/edac/e7xxx_edac.c @@ -22,6 +22,7 @@ * */ +#include #include #include #include @@ -29,9 +30,6 @@ #include #include "edac_mc.h" -#define E7XXX_REVISION " Ver: 2.0.1 " __DATE__ -#define EDAC_MOD_STR "e7xxx_edac" - #define e7xxx_printk(level, fmt, arg...) \ edac_printk(level, "e7xxx", fmt, ##arg) @@ -335,61 +333,99 @@ static void e7xxx_check(struct mem_ctl_info *mci) e7xxx_process_error_info(mci, &info, 1); } -/* Return 1 if dual channel mode is active. Else return 0. */ -static inline int dual_channel_active(u32 drc, int dev_idx) +static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) { - return (dev_idx == E7501) ? ((drc >> 22) & 0x1) : 1; -} + int rc = -ENODEV; + int index; + u16 pci_data; + struct mem_ctl_info *mci = NULL; + struct e7xxx_pvt *pvt = NULL; + u32 drc; + int drc_chan = 1; /* Number of channels 0=1chan,1=2chan */ + int drc_drbg = 1; /* DRB granularity 0=32mb,1=64mb */ + int drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ + u32 dra; + unsigned long last_cumul_size; + struct e7xxx_error_info discard; + debugf0("%s(): mci\n", __func__); + + /* need to find out the number of channels */ + pci_read_config_dword(pdev, E7XXX_DRC, &drc); -/* Return DRB granularity (0=32mb, 1=64mb). */ -static inline int drb_granularity(u32 drc, int dev_idx) -{ /* only e7501 can be single channel */ - return (dev_idx == E7501) ? ((drc >> 18) & 0x3) : 1; -} + if (dev_idx == E7501) { + drc_chan = ((drc >> 22) & 0x1); + drc_drbg = (drc >> 18) & 0x3; + } + + drc_ddim = (drc >> 20) & 0x3; + mci = edac_mc_alloc(sizeof(*pvt), E7XXX_NR_CSROWS, drc_chan + 1); + if (mci == NULL) { + rc = -ENOMEM; + goto fail; + } -static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, - int dev_idx, u32 drc) -{ - unsigned long last_cumul_size; - int index; - u8 value; - u32 dra, cumul_size; - int drc_chan, drc_drbg, drc_ddim, mem_dev; - struct csrow_info *csrow; + debugf3("%s(): init mci\n", __func__); + mci->mtype_cap = MEM_FLAG_RDDR; + mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED | + EDAC_FLAG_S4ECD4ED; + /* FIXME - what if different memory types are in different csrows? */ + mci->mod_name = EDAC_MOD_STR; + mci->mod_ver = "$Revision: 1.5.2.9 $"; + mci->pdev = pdev; + + debugf3("%s(): init pvt\n", __func__); + pvt = (struct e7xxx_pvt *) mci->pvt_info; + pvt->dev_info = &e7xxx_devs[dev_idx]; + pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, + pvt->dev_info->err_dev, + pvt->bridge_ck); + + if (!pvt->bridge_ck) { + e7xxx_printk(KERN_ERR, "error reporting device not found:" + "vendor %x device 0x%x (broken BIOS?)\n", + PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev); + goto fail; + } + + debugf3("%s(): more mci init\n", __func__); + mci->ctl_name = pvt->dev_info->ctl_name; + mci->edac_check = e7xxx_check; + mci->ctl_page_to_phys = ctl_page_to_phys; + /* find out the device types */ pci_read_config_dword(pdev, E7XXX_DRA, &dra); - drc_chan = dual_channel_active(drc, dev_idx); - drc_drbg = drb_granularity(drc, dev_idx); - drc_ddim = (drc >> 20) & 0x3; - last_cumul_size = 0; - /* The dram row boundary (DRB) reg values are boundary address + /* + * The dram row boundary (DRB) reg values are boundary address * for each DRAM row with a granularity of 32 or 64MB (single/dual * channel operation). DRB regs are cumulative; therefore DRB7 will * contain the total memory contained in all eight rows. */ - for (index = 0; index < mci->nr_csrows; index++) { + for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { + u8 value; + u32 cumul_size; /* mem_dev 0=x8, 1=x4 */ - mem_dev = (dra >> (index * 4 + 3)) & 0x1; - csrow = &mci->csrows[index]; + int mem_dev = (dra >> (index * 4 + 3)) & 0x1; + struct csrow_info *csrow = &mci->csrows[index]; - pci_read_config_byte(pdev, E7XXX_DRB + index, &value); + pci_read_config_byte(mci->pdev, E7XXX_DRB + index, &value); /* convert a 64 or 32 MiB DRB to a page size. */ cumul_size = value << (25 + drc_drbg - PAGE_SHIFT); debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, cumul_size); + if (cumul_size == last_cumul_size) - continue; /* not populated */ + continue; /* not populated */ csrow->first_page = last_cumul_size; csrow->last_page = cumul_size - 1; csrow->nr_pages = cumul_size - last_cumul_size; last_cumul_size = cumul_size; - csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */ - csrow->mtype = MEM_RDDR; /* only one type supported */ + csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */ + csrow->mtype = MEM_RDDR; /* only one type supported */ csrow->dtype = mem_dev ? DEV_X4 : DEV_X8; /* @@ -407,61 +443,16 @@ static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, } else csrow->edac_mode = EDAC_NONE; } -} - -static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) -{ - u16 pci_data; - struct mem_ctl_info *mci = NULL; - struct e7xxx_pvt *pvt = NULL; - u32 drc; - int drc_chan; - struct e7xxx_error_info discard; - - debugf0("%s(): mci\n", __func__); - pci_read_config_dword(pdev, E7XXX_DRC, &drc); - - drc_chan = dual_channel_active(drc, dev_idx); - mci = edac_mc_alloc(sizeof(*pvt), E7XXX_NR_CSROWS, drc_chan + 1); - - if (mci == NULL) - return -ENOMEM; - - debugf3("%s(): init mci\n", __func__); - mci->mtype_cap = MEM_FLAG_RDDR; - mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED | - EDAC_FLAG_S4ECD4ED; - /* FIXME - what if different memory types are in different csrows? */ - mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = E7XXX_REVISION; - mci->dev = &pdev->dev; - debugf3("%s(): init pvt\n", __func__); - pvt = (struct e7xxx_pvt *) mci->pvt_info; - pvt->dev_info = &e7xxx_devs[dev_idx]; - pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, - pvt->dev_info->err_dev, - pvt->bridge_ck); - - if (!pvt->bridge_ck) { - e7xxx_printk(KERN_ERR, "error reporting device not found:" - "vendor %x device 0x%x (broken BIOS?)\n", - PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev); - goto fail0; - } - debugf3("%s(): more mci init\n", __func__); - mci->ctl_name = pvt->dev_info->ctl_name; - mci->edac_check = e7xxx_check; - mci->ctl_page_to_phys = ctl_page_to_phys; - e7xxx_init_csrows(mci, pdev, dev_idx, drc); mci->edac_cap |= EDAC_FLAG_NONE; + debugf3("%s(): tolm, remapbase, remaplimit\n", __func__); /* load the top of low memory, remap base, and remap limit vars */ - pci_read_config_word(pdev, E7XXX_TOLM, &pci_data); + pci_read_config_word(mci->pdev, E7XXX_TOLM, &pci_data); pvt->tolm = ((u32) pci_data) << 4; - pci_read_config_word(pdev, E7XXX_REMAPBASE, &pci_data); + pci_read_config_word(mci->pdev, E7XXX_REMAPBASE, &pci_data); pvt->remapbase = ((u32) pci_data) << 14; - pci_read_config_word(pdev, E7XXX_REMAPLIMIT, &pci_data); + pci_read_config_word(mci->pdev, E7XXX_REMAPLIMIT, &pci_data); pvt->remaplimit = ((u32) pci_data) << 14; e7xxx_printk(KERN_INFO, "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, @@ -470,25 +461,23 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) /* clear any pending errors, or initial state bits */ e7xxx_get_error_info(mci, &discard); - /* Here we assume that we will never see multiple instances of this - * type of memory controller. The ID is therefore hardcoded to 0. - */ - if (edac_mc_add_mc(mci,0)) { + if (edac_mc_add_mc(mci) != 0) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); - goto fail1; + goto fail; } /* get this far and it's successful */ debugf3("%s(): success\n", __func__); return 0; -fail1: - pci_dev_put(pvt->bridge_ck); - -fail0: - edac_mc_free(mci); +fail: + if (mci != NULL) { + if(pvt != NULL && pvt->bridge_ck) + pci_dev_put(pvt->bridge_ck); + edac_mc_free(mci); + } - return -ENODEV; + return rc; } /* returns count (>= 0), or negative on error */ @@ -509,7 +498,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) + if ((mci = edac_mc_del_mc(pdev)) == NULL) return; pvt = (struct e7xxx_pvt *) mci->pvt_info; diff --git a/trunk/drivers/edac/edac_mc.c b/trunk/drivers/edac/edac_mc.c index 3a7cfe88b169..ea06e3a4dc35 100644 --- a/trunk/drivers/edac/edac_mc.c +++ b/trunk/drivers/edac/edac_mc.c @@ -12,6 +12,7 @@ * */ +#include #include #include #include @@ -53,17 +54,16 @@ static int log_ce = 1; static int panic_on_ue; static int poll_msec = 1000; +static int check_pci_parity = 0; /* default YES check PCI parity */ +static int panic_on_pci_parity; /* default no panic on PCI Parity */ +static atomic_t pci_parity_count = ATOMIC_INIT(0); + /* lock to memory controller's control array */ static DECLARE_MUTEX(mem_ctls_mutex); static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices); static struct task_struct *edac_thread; -#ifdef CONFIG_PCI -static int check_pci_parity = 0; /* default YES check PCI parity */ -static int panic_on_pci_parity; /* default no panic on PCI Parity */ -static atomic_t pci_parity_count = ATOMIC_INIT(0); - /* Structure of the whitelist and blacklist arrays */ struct edac_pci_device_list { unsigned int vendor; /* Vendor ID */ @@ -80,12 +80,6 @@ static int pci_blacklist_count; static struct edac_pci_device_list pci_whitelist[MAX_LISTED_PCI_DEVICES]; static int pci_whitelist_count ; -#ifndef DISABLE_EDAC_SYSFS -static struct kobject edac_pci_kobj; /* /sys/devices/system/edac/pci */ -static struct completion edac_pci_kobj_complete; -#endif /* DISABLE_EDAC_SYSFS */ -#endif /* CONFIG_PCI */ - /* START sysfs data and methods */ #ifndef DISABLE_EDAC_SYSFS @@ -133,15 +127,18 @@ static struct sysdev_class edac_class = { set_kset_name("edac"), }; -/* sysfs object: +/* sysfs objects: * /sys/devices/system/edac/mc + * /sys/devices/system/edac/pci */ static struct kobject edac_memctrl_kobj; +static struct kobject edac_pci_kobj; /* We use these to wait for the reference counts on edac_memctrl_kobj and * edac_pci_kobj to reach 0. */ static struct completion edac_memctrl_kobj_complete; +static struct completion edac_pci_kobj_complete; /* * /sys/devices/system/edac/mc; @@ -327,8 +324,6 @@ static void edac_sysfs_memctrl_teardown(void) #endif /* DISABLE_EDAC_SYSFS */ } -#ifdef CONFIG_PCI - #ifndef DISABLE_EDAC_SYSFS /* @@ -625,255 +620,9 @@ static void edac_sysfs_pci_teardown(void) debugf0("%s()\n", __func__); init_completion(&edac_pci_kobj_complete); kobject_unregister(&edac_pci_kobj); - wait_for_completion(&edac_pci_kobj_complete); -#endif -} - - -static u16 get_pci_parity_status(struct pci_dev *dev, int secondary) -{ - int where; - u16 status; - - where = secondary ? PCI_SEC_STATUS : PCI_STATUS; - pci_read_config_word(dev, where, &status); - - /* If we get back 0xFFFF then we must suspect that the card has been - * pulled but the Linux PCI layer has not yet finished cleaning up. - * We don't want to report on such devices - */ - - if (status == 0xFFFF) { - u32 sanity; - - pci_read_config_dword(dev, 0, &sanity); - - if (sanity == 0xFFFFFFFF) - return 0; - } - - status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR | - PCI_STATUS_PARITY; - - if (status) - /* reset only the bits we are interested in */ - pci_write_config_word(dev, where, status); - - return status; -} - -typedef void (*pci_parity_check_fn_t) (struct pci_dev *dev); - -/* Clear any PCI parity errors logged by this device. */ -static void edac_pci_dev_parity_clear(struct pci_dev *dev) -{ - u8 header_type; - - get_pci_parity_status(dev, 0); - - /* read the device TYPE, looking for bridges */ - pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); - - if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) - get_pci_parity_status(dev, 1); -} - -/* - * PCI Parity polling - * - */ -static void edac_pci_dev_parity_test(struct pci_dev *dev) -{ - u16 status; - u8 header_type; - - /* read the STATUS register on this device - */ - status = get_pci_parity_status(dev, 0); - - debugf2("PCI STATUS= 0x%04x %s\n", status, dev->dev.bus_id ); - - /* check the status reg for errors */ - if (status) { - if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) - edac_printk(KERN_CRIT, EDAC_PCI, - "Signaled System Error on %s\n", - pci_name(dev)); - - if (status & (PCI_STATUS_PARITY)) { - edac_printk(KERN_CRIT, EDAC_PCI, - "Master Data Parity Error on %s\n", - pci_name(dev)); - - atomic_inc(&pci_parity_count); - } - - if (status & (PCI_STATUS_DETECTED_PARITY)) { - edac_printk(KERN_CRIT, EDAC_PCI, - "Detected Parity Error on %s\n", - pci_name(dev)); - - atomic_inc(&pci_parity_count); - } - } - - /* read the device TYPE, looking for bridges */ - pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); - - debugf2("PCI HEADER TYPE= 0x%02x %s\n", header_type, dev->dev.bus_id ); - - if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { - /* On bridges, need to examine secondary status register */ - status = get_pci_parity_status(dev, 1); - - debugf2("PCI SEC_STATUS= 0x%04x %s\n", - status, dev->dev.bus_id ); - - /* check the secondary status reg for errors */ - if (status) { - if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) - edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " - "Signaled System Error on %s\n", - pci_name(dev)); - - if (status & (PCI_STATUS_PARITY)) { - edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " - "Master Data Parity Error on " - "%s\n", pci_name(dev)); - - atomic_inc(&pci_parity_count); - } - - if (status & (PCI_STATUS_DETECTED_PARITY)) { - edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " - "Detected Parity Error on %s\n", - pci_name(dev)); - - atomic_inc(&pci_parity_count); - } - } - } -} - -/* - * check_dev_on_list: Scan for a PCI device on a white/black list - * @list: an EDAC &edac_pci_device_list white/black list pointer - * @free_index: index of next free entry on the list - * @pci_dev: PCI Device pointer - * - * see if list contains the device. - * - * Returns: 0 not found - * 1 found on list - */ -static int check_dev_on_list(struct edac_pci_device_list *list, - int free_index, struct pci_dev *dev) -{ - int i; - int rc = 0; /* Assume not found */ - unsigned short vendor=dev->vendor; - unsigned short device=dev->device; - - /* Scan the list, looking for a vendor/device match */ - for (i = 0; i < free_index; i++, list++ ) { - if ((list->vendor == vendor ) && (list->device == device )) { - rc = 1; - break; - } - } - - return rc; -} - -/* - * pci_dev parity list iterator - * Scan the PCI device list for one iteration, looking for SERRORs - * Master Parity ERRORS or Parity ERRORs on primary or secondary devices - */ -static inline void edac_pci_dev_parity_iterator(pci_parity_check_fn_t fn) -{ - struct pci_dev *dev = NULL; - - /* request for kernel access to the next PCI device, if any, - * and while we are looking at it have its reference count - * bumped until we are done with it - */ - while((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { - /* if whitelist exists then it has priority, so only scan - * those devices on the whitelist - */ - if (pci_whitelist_count > 0 ) { - if (check_dev_on_list(pci_whitelist, - pci_whitelist_count, dev)) - fn(dev); - } else { - /* - * if no whitelist, then check if this devices is - * blacklisted - */ - if (!check_dev_on_list(pci_blacklist, - pci_blacklist_count, dev)) - fn(dev); - } - } -} - -static void do_pci_parity_check(void) -{ - unsigned long flags; - int before_count; - - debugf3("%s()\n", __func__); - - if (!check_pci_parity) - return; - - before_count = atomic_read(&pci_parity_count); - - /* scan all PCI devices looking for a Parity Error on devices and - * bridges - */ - local_irq_save(flags); - edac_pci_dev_parity_iterator(edac_pci_dev_parity_test); - local_irq_restore(flags); - - /* Only if operator has selected panic on PCI Error */ - if (panic_on_pci_parity) { - /* If the count is different 'after' from 'before' */ - if (before_count != atomic_read(&pci_parity_count)) - panic("EDAC: PCI Parity Error"); - } -} - -static inline void clear_pci_parity_errors(void) -{ - /* Clear any PCI bus parity errors that devices initially have logged - * in their registers. - */ - edac_pci_dev_parity_iterator(edac_pci_dev_parity_clear); -} - -#else /* CONFIG_PCI */ - -static inline void do_pci_parity_check(void) -{ - /* no-op */ -} - -static inline void clear_pci_parity_errors(void) -{ - /* no-op */ -} - -static void edac_sysfs_pci_teardown(void) -{ -} - -static int edac_sysfs_pci_setup(void) -{ - return 0; + wait_for_completion(&edac_pci_kobj_complete); +#endif } -#endif /* CONFIG_PCI */ #ifndef DISABLE_EDAC_SYSFS @@ -1383,7 +1132,7 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) return err; /* create a symlink for the device */ - err = sysfs_create_link(edac_mci_kobj, &mci->dev->kobj, + err = sysfs_create_link(edac_mci_kobj, &mci->pdev->dev.kobj, EDAC_DEVICE_SYMLINK); if (err) @@ -1489,7 +1238,7 @@ void edac_mc_dump_mci(struct mem_ctl_info *mci) debugf4("\tmci->edac_check = %p\n", mci->edac_check); debugf3("\tmci->nr_csrows = %d, csrows = %p\n", mci->nr_csrows, mci->csrows); - debugf3("\tdev = %p\n", mci->dev); + debugf3("\tpdev = %p\n", mci->pdev); debugf3("\tmod_name:ctl_name = %s:%s\n", mci->mod_name, mci->ctl_name); debugf3("\tpvt_info = %p\n\n", mci->pvt_info); @@ -1614,7 +1363,7 @@ void edac_mc_free(struct mem_ctl_info *mci) } EXPORT_SYMBOL_GPL(edac_mc_free); -static struct mem_ctl_info *find_mci_by_dev(struct device *dev) +static struct mem_ctl_info *find_mci_by_pdev(struct pci_dev *pdev) { struct mem_ctl_info *mci; struct list_head *item; @@ -1624,53 +1373,54 @@ static struct mem_ctl_info *find_mci_by_dev(struct device *dev) list_for_each(item, &mc_devices) { mci = list_entry(item, struct mem_ctl_info, link); - if (mci->dev == dev) + if (mci->pdev == pdev) return mci; } return NULL; } -/* Return 0 on success, 1 on failure. - * Before calling this function, caller must - * assign a unique value to mci->mc_idx. - */ -static int add_mc_to_global_list (struct mem_ctl_info *mci) +static int add_mc_to_global_list(struct mem_ctl_info *mci) { struct list_head *item, *insert_before; struct mem_ctl_info *p; + int i; - insert_before = &mc_devices; + if (list_empty(&mc_devices)) { + mci->mc_idx = 0; + insert_before = &mc_devices; + } else { + if (find_mci_by_pdev(mci->pdev)) { + edac_printk(KERN_WARNING, EDAC_MC, + "%s (%s) %s %s already assigned %d\n", + mci->pdev->dev.bus_id, + pci_name(mci->pdev), mci->mod_name, + mci->ctl_name, mci->mc_idx); + return 1; + } - if (unlikely((p = find_mci_by_dev(mci->dev)) != NULL)) - goto fail0; + insert_before = NULL; + i = 0; - list_for_each(item, &mc_devices) { - p = list_entry(item, struct mem_ctl_info, link); + list_for_each(item, &mc_devices) { + p = list_entry(item, struct mem_ctl_info, link); - if (p->mc_idx >= mci->mc_idx) { - if (unlikely(p->mc_idx == mci->mc_idx)) - goto fail1; + if (p->mc_idx != i) { + insert_before = item; + break; + } - insert_before = item; - break; + i++; } + + mci->mc_idx = i; + + if (insert_before == NULL) + insert_before = &mc_devices; } list_add_tail_rcu(&mci->link, insert_before); return 0; - -fail0: - edac_printk(KERN_WARNING, EDAC_MC, - "%s (%s) %s %s already assigned %d\n", p->dev->bus_id, - dev_name(p->dev), p->mod_name, p->ctl_name, p->mc_idx); - return 1; - -fail1: - edac_printk(KERN_WARNING, EDAC_MC, - "bug in low-level driver: attempt to assign\n" - " duplicate mc_idx %d in %s()\n", p->mc_idx, __func__); - return 1; } static void complete_mc_list_del(struct rcu_head *head) @@ -1694,7 +1444,6 @@ static void del_mc_from_global_list(struct mem_ctl_info *mci) * edac_mc_add_mc: Insert the 'mci' structure into the mci global list and * create sysfs entries associated with mci structure * @mci: pointer to the mci structure to be added to the list - * @mc_idx: A unique numeric identifier to be assigned to the 'mci' structure. * * Return: * 0 Success @@ -1702,10 +1451,9 @@ static void del_mc_from_global_list(struct mem_ctl_info *mci) */ /* FIXME - should a warning be printed if no error detection? correction? */ -int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx) +int edac_mc_add_mc(struct mem_ctl_info *mci) { debugf0("%s()\n", __func__); - mci->mc_idx = mc_idx; #ifdef CONFIG_EDAC_DEBUG if (edac_debug_level >= 3) edac_mc_dump_mci(mci); @@ -1738,8 +1486,8 @@ int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx) } /* Report action taken */ - edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: DEV %s\n", - mci->mod_name, mci->ctl_name, dev_name(mci->dev)); + edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: PCI %s\n", + mci->mod_name, mci->ctl_name, pci_name(mci->pdev)); up(&mem_ctls_mutex); return 0; @@ -1756,18 +1504,18 @@ EXPORT_SYMBOL_GPL(edac_mc_add_mc); /** * edac_mc_del_mc: Remove sysfs entries for specified mci structure and * remove mci structure from global list - * @pdev: Pointer to 'struct device' representing mci structure to remove. + * @pdev: Pointer to 'struct pci_dev' representing mci structure to remove. * * Return pointer to removed mci structure, or NULL if device not found. */ -struct mem_ctl_info * edac_mc_del_mc(struct device *dev) +struct mem_ctl_info * edac_mc_del_mc(struct pci_dev *pdev) { struct mem_ctl_info *mci; debugf0("MC: %s()\n", __func__); down(&mem_ctls_mutex); - if ((mci = find_mci_by_dev(dev)) == NULL) { + if ((mci = find_mci_by_pdev(pdev)) == NULL) { up(&mem_ctls_mutex); return NULL; } @@ -1776,8 +1524,8 @@ struct mem_ctl_info * edac_mc_del_mc(struct device *dev) del_mc_from_global_list(mci); up(&mem_ctls_mutex); edac_printk(KERN_INFO, EDAC_MC, - "Removed device %d for %s %s: DEV %s\n", mci->mc_idx, - mci->mod_name, mci->ctl_name, dev_name(mci->dev)); + "Removed device %d for %s %s: PCI %s\n", mci->mc_idx, + mci->mod_name, mci->ctl_name, pci_name(mci->pdev)); return mci; } EXPORT_SYMBOL_GPL(edac_mc_del_mc); @@ -1991,6 +1739,244 @@ void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg) } EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info); +#ifdef CONFIG_PCI + +static u16 get_pci_parity_status(struct pci_dev *dev, int secondary) +{ + int where; + u16 status; + + where = secondary ? PCI_SEC_STATUS : PCI_STATUS; + pci_read_config_word(dev, where, &status); + + /* If we get back 0xFFFF then we must suspect that the card has been + * pulled but the Linux PCI layer has not yet finished cleaning up. + * We don't want to report on such devices + */ + + if (status == 0xFFFF) { + u32 sanity; + + pci_read_config_dword(dev, 0, &sanity); + + if (sanity == 0xFFFFFFFF) + return 0; + } + + status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR | + PCI_STATUS_PARITY; + + if (status) + /* reset only the bits we are interested in */ + pci_write_config_word(dev, where, status); + + return status; +} + +typedef void (*pci_parity_check_fn_t) (struct pci_dev *dev); + +/* Clear any PCI parity errors logged by this device. */ +static void edac_pci_dev_parity_clear(struct pci_dev *dev) +{ + u8 header_type; + + get_pci_parity_status(dev, 0); + + /* read the device TYPE, looking for bridges */ + pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); + + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) + get_pci_parity_status(dev, 1); +} + +/* + * PCI Parity polling + * + */ +static void edac_pci_dev_parity_test(struct pci_dev *dev) +{ + u16 status; + u8 header_type; + + /* read the STATUS register on this device + */ + status = get_pci_parity_status(dev, 0); + + debugf2("PCI STATUS= 0x%04x %s\n", status, dev->dev.bus_id ); + + /* check the status reg for errors */ + if (status) { + if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) + edac_printk(KERN_CRIT, EDAC_PCI, + "Signaled System Error on %s\n", + pci_name(dev)); + + if (status & (PCI_STATUS_PARITY)) { + edac_printk(KERN_CRIT, EDAC_PCI, + "Master Data Parity Error on %s\n", + pci_name(dev)); + + atomic_inc(&pci_parity_count); + } + + if (status & (PCI_STATUS_DETECTED_PARITY)) { + edac_printk(KERN_CRIT, EDAC_PCI, + "Detected Parity Error on %s\n", + pci_name(dev)); + + atomic_inc(&pci_parity_count); + } + } + + /* read the device TYPE, looking for bridges */ + pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); + + debugf2("PCI HEADER TYPE= 0x%02x %s\n", header_type, dev->dev.bus_id ); + + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { + /* On bridges, need to examine secondary status register */ + status = get_pci_parity_status(dev, 1); + + debugf2("PCI SEC_STATUS= 0x%04x %s\n", + status, dev->dev.bus_id ); + + /* check the secondary status reg for errors */ + if (status) { + if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) + edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " + "Signaled System Error on %s\n", + pci_name(dev)); + + if (status & (PCI_STATUS_PARITY)) { + edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " + "Master Data Parity Error on " + "%s\n", pci_name(dev)); + + atomic_inc(&pci_parity_count); + } + + if (status & (PCI_STATUS_DETECTED_PARITY)) { + edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " + "Detected Parity Error on %s\n", + pci_name(dev)); + + atomic_inc(&pci_parity_count); + } + } + } +} + +/* + * check_dev_on_list: Scan for a PCI device on a white/black list + * @list: an EDAC &edac_pci_device_list white/black list pointer + * @free_index: index of next free entry on the list + * @pci_dev: PCI Device pointer + * + * see if list contains the device. + * + * Returns: 0 not found + * 1 found on list + */ +static int check_dev_on_list(struct edac_pci_device_list *list, + int free_index, struct pci_dev *dev) +{ + int i; + int rc = 0; /* Assume not found */ + unsigned short vendor=dev->vendor; + unsigned short device=dev->device; + + /* Scan the list, looking for a vendor/device match */ + for (i = 0; i < free_index; i++, list++ ) { + if ((list->vendor == vendor ) && (list->device == device )) { + rc = 1; + break; + } + } + + return rc; +} + +/* + * pci_dev parity list iterator + * Scan the PCI device list for one iteration, looking for SERRORs + * Master Parity ERRORS or Parity ERRORs on primary or secondary devices + */ +static inline void edac_pci_dev_parity_iterator(pci_parity_check_fn_t fn) +{ + struct pci_dev *dev = NULL; + + /* request for kernel access to the next PCI device, if any, + * and while we are looking at it have its reference count + * bumped until we are done with it + */ + while((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + /* if whitelist exists then it has priority, so only scan + * those devices on the whitelist + */ + if (pci_whitelist_count > 0 ) { + if (check_dev_on_list(pci_whitelist, + pci_whitelist_count, dev)) + fn(dev); + } else { + /* + * if no whitelist, then check if this devices is + * blacklisted + */ + if (!check_dev_on_list(pci_blacklist, + pci_blacklist_count, dev)) + fn(dev); + } + } +} + +static void do_pci_parity_check(void) +{ + unsigned long flags; + int before_count; + + debugf3("%s()\n", __func__); + + if (!check_pci_parity) + return; + + before_count = atomic_read(&pci_parity_count); + + /* scan all PCI devices looking for a Parity Error on devices and + * bridges + */ + local_irq_save(flags); + edac_pci_dev_parity_iterator(edac_pci_dev_parity_test); + local_irq_restore(flags); + + /* Only if operator has selected panic on PCI Error */ + if (panic_on_pci_parity) { + /* If the count is different 'after' from 'before' */ + if (before_count != atomic_read(&pci_parity_count)) + panic("EDAC: PCI Parity Error"); + } +} + +static inline void clear_pci_parity_errors(void) +{ + /* Clear any PCI bus parity errors that devices initially have logged + * in their registers. + */ + edac_pci_dev_parity_iterator(edac_pci_dev_parity_clear); +} + +#else /* CONFIG_PCI */ + +static inline void do_pci_parity_check(void) +{ + /* no-op */ +} + +static inline void clear_pci_parity_errors(void) +{ + /* no-op */ +} + +#endif /* CONFIG_PCI */ /* * Iterate over all MC instances and check for ECC, et al, errors @@ -2110,12 +2096,10 @@ MODULE_DESCRIPTION("Core library routines for MC reporting"); module_param(panic_on_ue, int, 0644); MODULE_PARM_DESC(panic_on_ue, "Panic on uncorrected error: 0=off 1=on"); -#ifdef CONFIG_PCI module_param(check_pci_parity, int, 0644); MODULE_PARM_DESC(check_pci_parity, "Check for PCI bus parity errors: 0=off 1=on"); module_param(panic_on_pci_parity, int, 0644); MODULE_PARM_DESC(panic_on_pci_parity, "Panic on PCI Bus Parity error: 0=off 1=on"); -#endif module_param(log_ue, int, 0644); MODULE_PARM_DESC(log_ue, "Log uncorrectable error to console: 0=off 1=on"); module_param(log_ce, int, 0644); diff --git a/trunk/drivers/edac/edac_mc.h b/trunk/drivers/edac/edac_mc.h index bf6ab8a8d5ed..8d9e83909b9c 100644 --- a/trunk/drivers/edac/edac_mc.h +++ b/trunk/drivers/edac/edac_mc.h @@ -18,6 +18,7 @@ #ifndef _EDAC_MC_H_ #define _EDAC_MC_H_ +#include #include #include #include @@ -78,17 +79,15 @@ extern int edac_debug_level; #endif /* !CONFIG_EDAC_DEBUG */ +#define edac_xstr(s) edac_str(s) +#define edac_str(s) #s +#define EDAC_MOD_STR edac_xstr(KBUILD_BASENAME) + #define BIT(x) (1 << (x)) #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \ PCI_DEVICE_ID_ ## vend ## _ ## dev -#if defined(CONFIG_X86) && defined(CONFIG_PCI) -#define dev_name(dev) pci_name(to_pci_dev(dev)) -#else -#define dev_name(dev) to_platform_device(dev)->name -#endif - /* memory devices */ enum dev_type { DEV_UNKNOWN = 0, @@ -328,10 +327,10 @@ struct mem_ctl_info { struct csrow_info *csrows; /* * FIXME - what about controllers on other busses? - IDs must be - * unique. dev pointer should be sufficiently unique, but + * unique. pdev pointer should be sufficiently unique, but * BUS:SLOT.FUNC numbers may not be unique. */ - struct device *dev; + struct pci_dev *pdev; const char *mod_name; const char *mod_ver; const char *ctl_name; @@ -354,8 +353,6 @@ struct mem_ctl_info { struct completion kobj_complete; }; -#ifdef CONFIG_PCI - /* write all or some bits in a byte-register*/ static inline void pci_write_bits8(struct pci_dev *pdev, int offset, u8 value, u8 mask) @@ -404,16 +401,14 @@ static inline void pci_write_bits32(struct pci_dev *pdev, int offset, pci_write_config_dword(pdev, offset, value); } -#endif /* CONFIG_PCI */ - #ifdef CONFIG_EDAC_DEBUG void edac_mc_dump_channel(struct channel_info *chan); void edac_mc_dump_mci(struct mem_ctl_info *mci); void edac_mc_dump_csrow(struct csrow_info *csrow); #endif /* CONFIG_EDAC_DEBUG */ -extern int edac_mc_add_mc(struct mem_ctl_info *mci,int mc_idx); -extern struct mem_ctl_info * edac_mc_del_mc(struct device *dev); +extern int edac_mc_add_mc(struct mem_ctl_info *mci); +extern struct mem_ctl_info * edac_mc_del_mc(struct pci_dev *pdev); extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, unsigned long page); extern void edac_mc_scrub_block(unsigned long page, unsigned long offset, diff --git a/trunk/drivers/edac/i82860_edac.c b/trunk/drivers/edac/i82860_edac.c index e4bb298e613f..fd342163cf97 100644 --- a/trunk/drivers/edac/i82860_edac.c +++ b/trunk/drivers/edac/i82860_edac.c @@ -9,6 +9,7 @@ * by Thayne Harbaugh of Linux Networx. (http://lnxi.com) */ +#include #include #include #include @@ -16,9 +17,6 @@ #include #include "edac_mc.h" -#define I82860_REVISION " Ver: 2.0.1 " __DATE__ -#define EDAC_MOD_STR "i82860_edac" - #define i82860_printk(level, fmt, arg...) \ edac_printk(level, "i82860", fmt, ##arg) @@ -65,21 +63,17 @@ static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code static void i82860_get_error_info(struct mem_ctl_info *mci, struct i82860_error_info *info) { - struct pci_dev *pdev; - - pdev = to_pci_dev(mci->dev); - /* * This is a mess because there is no atomic way to read all the * registers at once and the registers can transition from CE being * overwritten by UE. */ - pci_read_config_word(pdev, I82860_ERRSTS, &info->errsts); - pci_read_config_dword(pdev, I82860_EAP, &info->eap); - pci_read_config_word(pdev, I82860_DERRCTL_STS, &info->derrsyn); - pci_read_config_word(pdev, I82860_ERRSTS, &info->errsts2); + pci_read_config_word(mci->pdev, I82860_ERRSTS, &info->errsts); + pci_read_config_dword(mci->pdev, I82860_EAP, &info->eap); + pci_read_config_word(mci->pdev, I82860_DERRCTL_STS, &info->derrsyn); + pci_read_config_word(mci->pdev, I82860_ERRSTS, &info->errsts2); - pci_write_bits16(pdev, I82860_ERRSTS, 0x0003, 0x0003); + pci_write_bits16(mci->pdev, I82860_ERRSTS, 0x0003, 0x0003); /* * If the error is the same for both reads then the first set of reads @@ -90,8 +84,8 @@ static void i82860_get_error_info(struct mem_ctl_info *mci, return; if ((info->errsts ^ info->errsts2) & 0x0003) { - pci_read_config_dword(pdev, I82860_EAP, &info->eap); - pci_read_config_word(pdev, I82860_DERRCTL_STS, + pci_read_config_dword(mci->pdev, I82860_EAP, &info->eap); + pci_read_config_word(mci->pdev, I82860_DERRCTL_STS, &info->derrsyn); } } @@ -133,51 +127,16 @@ static void i82860_check(struct mem_ctl_info *mci) i82860_process_error_info(mci, &info, 1); } -static void i82860_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev) -{ - unsigned long last_cumul_size; - u16 mchcfg_ddim; /* DRAM Data Integrity Mode 0=none, 2=edac */ - u16 value; - u32 cumul_size; - struct csrow_info *csrow; - int index; - - pci_read_config_word(pdev, I82860_MCHCFG, &mchcfg_ddim); - mchcfg_ddim = mchcfg_ddim & 0x180; - last_cumul_size = 0; - - /* The group row boundary (GRA) reg values are boundary address - * for each DRAM row with a granularity of 16MB. GRA regs are - * cumulative; therefore GRA15 will contain the total memory contained - * in all eight rows. - */ - for (index = 0; index < mci->nr_csrows; index++) { - csrow = &mci->csrows[index]; - pci_read_config_word(pdev, I82860_GBA + index * 2, &value); - cumul_size = (value & I82860_GBA_MASK) << - (I82860_GBA_SHIFT - PAGE_SHIFT); - debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, - cumul_size); - - if (cumul_size == last_cumul_size) - continue; /* not populated */ - - csrow->first_page = last_cumul_size; - csrow->last_page = cumul_size - 1; - csrow->nr_pages = cumul_size - last_cumul_size; - last_cumul_size = cumul_size; - csrow->grain = 1 << 12; /* I82860_EAP has 4KiB reolution */ - csrow->mtype = MEM_RMBS; - csrow->dtype = DEV_UNKNOWN; - csrow->edac_mode = mchcfg_ddim ? EDAC_SECDED : EDAC_NONE; - } -} - static int i82860_probe1(struct pci_dev *pdev, int dev_idx) { - struct mem_ctl_info *mci; + int rc = -ENODEV; + int index; + struct mem_ctl_info *mci = NULL; + unsigned long last_cumul_size; struct i82860_error_info discard; + u16 mchcfg_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ + /* RDRAM has channels but these don't map onto the abstractions that edac uses. The device groups from the GRA registers seem to map reasonably @@ -192,35 +151,67 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx) return -ENOMEM; debugf3("%s(): init mci\n", __func__); - mci->dev = &pdev->dev; + mci->pdev = pdev; mci->mtype_cap = MEM_FLAG_DDR; + mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; /* I"m not sure about this but I think that all RDRAM is SECDED */ mci->edac_cap = EDAC_FLAG_SECDED; + /* adjust FLAGS */ + mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = I82860_REVISION; + mci->mod_ver = "$Revision: 1.1.2.6 $"; mci->ctl_name = i82860_devs[dev_idx].ctl_name; mci->edac_check = i82860_check; mci->ctl_page_to_phys = NULL; - i82860_init_csrows(mci, pdev); - i82860_get_error_info(mci, &discard); /* clear counters */ - /* Here we assume that we will never see multiple instances of this - * type of memory controller. The ID is therefore hardcoded to 0. + pci_read_config_word(mci->pdev, I82860_MCHCFG, &mchcfg_ddim); + mchcfg_ddim = mchcfg_ddim & 0x180; + + /* + * The group row boundary (GRA) reg values are boundary address + * for each DRAM row with a granularity of 16MB. GRA regs are + * cumulative; therefore GRA15 will contain the total memory contained + * in all eight rows. */ - if (edac_mc_add_mc(mci,0)) { - debugf3("%s(): failed edac_mc_add_mc()\n", __func__); - goto fail; + for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { + u16 value; + u32 cumul_size; + struct csrow_info *csrow = &mci->csrows[index]; + + pci_read_config_word(mci->pdev, I82860_GBA + index * 2, + &value); + + cumul_size = (value & I82860_GBA_MASK) << + (I82860_GBA_SHIFT - PAGE_SHIFT); + debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, + cumul_size); + + if (cumul_size == last_cumul_size) + continue; /* not populated */ + + csrow->first_page = last_cumul_size; + csrow->last_page = cumul_size - 1; + csrow->nr_pages = cumul_size - last_cumul_size; + last_cumul_size = cumul_size; + csrow->grain = 1 << 12; /* I82860_EAP has 4KiB reolution */ + csrow->mtype = MEM_RMBS; + csrow->dtype = DEV_UNKNOWN; + csrow->edac_mode = mchcfg_ddim ? EDAC_SECDED : EDAC_NONE; } - /* get this far and it's successful */ - debugf3("%s(): success\n", __func__); + i82860_get_error_info(mci, &discard); /* clear counters */ - return 0; + if (edac_mc_add_mc(mci)) { + debugf3("%s(): failed edac_mc_add_mc()\n", __func__); + edac_mc_free(mci); + } else { + /* get this far and it's successful */ + debugf3("%s(): success\n", __func__); + rc = 0; + } -fail: - edac_mc_free(mci); - return -ENODEV; + return rc; } /* returns count (>= 0), or negative on error */ @@ -249,7 +240,7 @@ static void __devexit i82860_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) + if ((mci = edac_mc_del_mc(pdev)) == NULL) return; edac_mc_free(mci); diff --git a/trunk/drivers/edac/i82875p_edac.c b/trunk/drivers/edac/i82875p_edac.c index 161fe09a6d38..0aec92698f17 100644 --- a/trunk/drivers/edac/i82875p_edac.c +++ b/trunk/drivers/edac/i82875p_edac.c @@ -13,6 +13,7 @@ * Note: E7210 appears same as D82875P - zhenyu.z.wang at intel.com */ +#include #include #include #include @@ -20,9 +21,6 @@ #include #include "edac_mc.h" -#define I82875P_REVISION " Ver: 2.0.1 " __DATE__ -#define EDAC_MOD_STR "i82875p_edac" - #define i82875p_printk(level, fmt, arg...) \ edac_printk(level, "i82875p", fmt, ##arg) @@ -187,22 +185,18 @@ static int i82875p_registered = 1; static void i82875p_get_error_info(struct mem_ctl_info *mci, struct i82875p_error_info *info) { - struct pci_dev *pdev; - - pdev = to_pci_dev(mci->dev); - /* * This is a mess because there is no atomic way to read all the * registers at once and the registers can transition from CE being * overwritten by UE. */ - pci_read_config_word(pdev, I82875P_ERRSTS, &info->errsts); - pci_read_config_dword(pdev, I82875P_EAP, &info->eap); - pci_read_config_byte(pdev, I82875P_DES, &info->des); - pci_read_config_byte(pdev, I82875P_DERRSYN, &info->derrsyn); - pci_read_config_word(pdev, I82875P_ERRSTS, &info->errsts2); + pci_read_config_word(mci->pdev, I82875P_ERRSTS, &info->errsts); + pci_read_config_dword(mci->pdev, I82875P_EAP, &info->eap); + pci_read_config_byte(mci->pdev, I82875P_DES, &info->des); + pci_read_config_byte(mci->pdev, I82875P_DERRSYN, &info->derrsyn); + pci_read_config_word(mci->pdev, I82875P_ERRSTS, &info->errsts2); - pci_write_bits16(pdev, I82875P_ERRSTS, 0x0081, 0x0081); + pci_write_bits16(mci->pdev, I82875P_ERRSTS, 0x0081, 0x0081); /* * If the error is the same then we can for both reads then @@ -214,9 +208,9 @@ static void i82875p_get_error_info(struct mem_ctl_info *mci, return; if ((info->errsts ^ info->errsts2) & 0x0081) { - pci_read_config_dword(pdev, I82875P_EAP, &info->eap); - pci_read_config_byte(pdev, I82875P_DES, &info->des); - pci_read_config_byte(pdev, I82875P_DERRSYN, + pci_read_config_dword(mci->pdev, I82875P_EAP, &info->eap); + pci_read_config_byte(mci->pdev, I82875P_DES, &info->des); + pci_read_config_byte(mci->pdev, I82875P_DERRSYN, &info->derrsyn); } } @@ -265,109 +259,116 @@ static void i82875p_check(struct mem_ctl_info *mci) extern int pci_proc_attach_device(struct pci_dev *); #endif -/* Return 0 on success or 1 on failure. */ -static int i82875p_setup_overfl_dev(struct pci_dev *pdev, - struct pci_dev **ovrfl_pdev, void __iomem **ovrfl_window) +static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) { - struct pci_dev *dev; - void __iomem *window; + int rc = -ENODEV; + int index; + struct mem_ctl_info *mci = NULL; + struct i82875p_pvt *pvt = NULL; + unsigned long last_cumul_size; + struct pci_dev *ovrfl_pdev; + void __iomem *ovrfl_window = NULL; + u32 drc; + u32 drc_chan; /* Number of channels 0=1chan,1=2chan */ + u32 nr_chans; + u32 drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ + struct i82875p_error_info discard; - *ovrfl_pdev = NULL; - *ovrfl_window = NULL; - dev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL); + debugf0("%s()\n", __func__); + ovrfl_pdev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL); - if (dev == NULL) { - /* Intel tells BIOS developers to hide device 6 which + if (!ovrfl_pdev) { + /* + * Intel tells BIOS developers to hide device 6 which * configures the overflow device access containing * the DRBs - this is where we expose device 6. * http://www.x86-secret.com/articles/tweak/pat/patsecrets-2.htm */ pci_write_bits8(pdev, 0xf4, 0x2, 0x2); - dev = pci_scan_single_device(pdev->bus, PCI_DEVFN(6, 0)); + ovrfl_pdev = + pci_scan_single_device(pdev->bus, PCI_DEVFN(6, 0)); - if (dev == NULL) - return 1; + if (!ovrfl_pdev) + return -ENODEV; } - *ovrfl_pdev = dev; - #ifdef CONFIG_PROC_FS - if ((dev->procent == NULL) && pci_proc_attach_device(dev)) { - i82875p_printk(KERN_ERR, "%s(): Failed to attach overflow " - "device\n", __func__); - return 1; + if (!ovrfl_pdev->procent && pci_proc_attach_device(ovrfl_pdev)) { + i82875p_printk(KERN_ERR, + "%s(): Failed to attach overflow device\n", __func__); + return -ENODEV; } -#endif /* CONFIG_PROC_FS */ - if (pci_enable_device(dev)) { - i82875p_printk(KERN_ERR, "%s(): Failed to enable overflow " - "device\n", __func__); - return 1; +#endif + /* CONFIG_PROC_FS */ + if (pci_enable_device(ovrfl_pdev)) { + i82875p_printk(KERN_ERR, + "%s(): Failed to enable overflow device\n", __func__); + return -ENODEV; } - if (pci_request_regions(dev, pci_name(dev))) { + if (pci_request_regions(ovrfl_pdev, pci_name(ovrfl_pdev))) { #ifdef CORRECT_BIOS goto fail0; #endif } /* cache is irrelevant for PCI bus reads/writes */ - window = ioremap_nocache(pci_resource_start(dev, 0), - pci_resource_len(dev, 0)); + ovrfl_window = ioremap_nocache(pci_resource_start(ovrfl_pdev, 0), + pci_resource_len(ovrfl_pdev, 0)); - if (window == NULL) { + if (!ovrfl_window) { i82875p_printk(KERN_ERR, "%s(): Failed to ioremap bar6\n", - __func__); + __func__); goto fail1; } - *ovrfl_window = window; - return 0; - -fail1: - pci_release_regions(dev); - -#ifdef CORRECT_BIOS -fail0: - pci_disable_device(dev); -#endif - /* NOTE: the ovrfl proc entry and pci_dev are intentionally left */ - return 1; -} - + /* need to find out the number of channels */ + drc = readl(ovrfl_window + I82875P_DRC); + drc_chan = ((drc >> 21) & 0x1); + nr_chans = drc_chan + 1; -/* Return 1 if dual channel mode is active. Else return 0. */ -static inline int dual_channel_active(u32 drc) -{ - return (drc >> 21) & 0x1; -} + drc_ddim = (drc >> 18) & 0x1; + mci = edac_mc_alloc(sizeof(*pvt), I82875P_NR_CSROWS(nr_chans), + nr_chans); + if (!mci) { + rc = -ENOMEM; + goto fail2; + } -static void i82875p_init_csrows(struct mem_ctl_info *mci, - struct pci_dev *pdev, void __iomem *ovrfl_window, u32 drc) -{ - struct csrow_info *csrow; - unsigned long last_cumul_size; - u8 value; - u32 drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ - u32 cumul_size; - int index; + debugf3("%s(): init mci\n", __func__); + mci->pdev = pdev; + mci->mtype_cap = MEM_FLAG_DDR; + mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; + mci->edac_cap = EDAC_FLAG_UNKNOWN; + /* adjust FLAGS */ - drc_ddim = (drc >> 18) & 0x1; - last_cumul_size = 0; + mci->mod_name = EDAC_MOD_STR; + mci->mod_ver = "$Revision: 1.5.2.11 $"; + mci->ctl_name = i82875p_devs[dev_idx].ctl_name; + mci->edac_check = i82875p_check; + mci->ctl_page_to_phys = NULL; + debugf3("%s(): init pvt\n", __func__); + pvt = (struct i82875p_pvt *) mci->pvt_info; + pvt->ovrfl_pdev = ovrfl_pdev; + pvt->ovrfl_window = ovrfl_window; - /* The dram row boundary (DRB) reg values are boundary address + /* + * The dram row boundary (DRB) reg values are boundary address * for each DRAM row with a granularity of 32 or 64MB (single/dual * channel operation). DRB regs are cumulative; therefore DRB7 will * contain the total memory contained in all eight rows. */ - - for (index = 0; index < mci->nr_csrows; index++) { - csrow = &mci->csrows[index]; + for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { + u8 value; + u32 cumul_size; + struct csrow_info *csrow = &mci->csrows[index]; value = readb(ovrfl_window + I82875P_DRB + index); cumul_size = value << (I82875P_DRB_SHIFT - PAGE_SHIFT); debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, cumul_size); + if (cumul_size == last_cumul_size) continue; /* not populated */ @@ -375,75 +376,35 @@ static void i82875p_init_csrows(struct mem_ctl_info *mci, csrow->last_page = cumul_size - 1; csrow->nr_pages = cumul_size - last_cumul_size; last_cumul_size = cumul_size; - csrow->grain = 1 << 12; /* I82875P_EAP has 4KiB reolution */ + csrow->grain = 1 << 12; /* I82875P_EAP has 4KiB reolution */ csrow->mtype = MEM_DDR; csrow->dtype = DEV_UNKNOWN; csrow->edac_mode = drc_ddim ? EDAC_SECDED : EDAC_NONE; } -} - -static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) -{ - int rc = -ENODEV; - struct mem_ctl_info *mci; - struct i82875p_pvt *pvt; - struct pci_dev *ovrfl_pdev; - void __iomem *ovrfl_window; - u32 drc; - u32 nr_chans; - struct i82875p_error_info discard; - - debugf0("%s()\n", __func__); - ovrfl_pdev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL); - - if (i82875p_setup_overfl_dev(pdev, &ovrfl_pdev, &ovrfl_window)) - return -ENODEV; - drc = readl(ovrfl_window + I82875P_DRC); - nr_chans = dual_channel_active(drc) + 1; - mci = edac_mc_alloc(sizeof(*pvt), I82875P_NR_CSROWS(nr_chans), - nr_chans); - - if (!mci) { - rc = -ENOMEM; - goto fail0; - } - debugf3("%s(): init mci\n", __func__); - mci->dev = &pdev->dev; - mci->mtype_cap = MEM_FLAG_DDR; - mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; - mci->edac_cap = EDAC_FLAG_UNKNOWN; - mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = I82875P_REVISION; - mci->ctl_name = i82875p_devs[dev_idx].ctl_name; - mci->edac_check = i82875p_check; - mci->ctl_page_to_phys = NULL; - debugf3("%s(): init pvt\n", __func__); - pvt = (struct i82875p_pvt *) mci->pvt_info; - pvt->ovrfl_pdev = ovrfl_pdev; - pvt->ovrfl_window = ovrfl_window; - i82875p_init_csrows(mci, pdev, ovrfl_window, drc); i82875p_get_error_info(mci, &discard); /* clear counters */ - /* Here we assume that we will never see multiple instances of this - * type of memory controller. The ID is therefore hardcoded to 0. - */ - if (edac_mc_add_mc(mci,0)) { + if (edac_mc_add_mc(mci)) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); - goto fail1; + goto fail3; } /* get this far and it's successful */ debugf3("%s(): success\n", __func__); return 0; -fail1: +fail3: edac_mc_free(mci); -fail0: +fail2: iounmap(ovrfl_window); + +fail1: pci_release_regions(ovrfl_pdev); +#ifdef CORRECT_BIOS +fail0: +#endif pci_disable_device(ovrfl_pdev); /* NOTE: the ovrfl proc entry and pci_dev are intentionally left */ return rc; @@ -476,7 +437,7 @@ static void __devexit i82875p_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) + if ((mci = edac_mc_del_mc(pdev)) == NULL) return; pvt = (struct i82875p_pvt *) mci->pvt_info; diff --git a/trunk/drivers/edac/r82600_edac.c b/trunk/drivers/edac/r82600_edac.c index a49cf0a39398..2c29fafe67c7 100644 --- a/trunk/drivers/edac/r82600_edac.c +++ b/trunk/drivers/edac/r82600_edac.c @@ -15,6 +15,7 @@ * references to this document given in [] */ +#include #include #include #include @@ -22,9 +23,6 @@ #include #include "edac_mc.h" -#define R82600_REVISION " Ver: 2.0.1 " __DATE__ -#define EDAC_MOD_STR "r82600_edac" - #define r82600_printk(level, fmt, arg...) \ edac_printk(level, "r82600", fmt, ##arg) @@ -136,20 +134,17 @@ static unsigned int disable_hardware_scrub = 0; static void r82600_get_error_info (struct mem_ctl_info *mci, struct r82600_error_info *info) { - struct pci_dev *pdev; - - pdev = to_pci_dev(mci->dev); - pci_read_config_dword(pdev, R82600_EAP, &info->eapr); + pci_read_config_dword(mci->pdev, R82600_EAP, &info->eapr); if (info->eapr & BIT(0)) /* Clear error to allow next error to be reported [p.62] */ - pci_write_bits32(pdev, R82600_EAP, + pci_write_bits32(mci->pdev, R82600_EAP, ((u32) BIT(0) & (u32) BIT(1)), ((u32) BIT(0) & (u32) BIT(1))); if (info->eapr & BIT(1)) /* Clear error to allow next error to be reported [p.62] */ - pci_write_bits32(pdev, R82600_EAP, + pci_write_bits32(mci->pdev, R82600_EAP, ((u32) BIT(0) & (u32) BIT(1)), ((u32) BIT(0) & (u32) BIT(1))); } @@ -205,72 +200,25 @@ static void r82600_check(struct mem_ctl_info *mci) r82600_process_error_info(mci, &info, 1); } -static inline int ecc_enabled(u8 dramcr) -{ - return dramcr & BIT(5); -} - -static void r82600_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, - u8 dramcr) -{ - struct csrow_info *csrow; - int index; - u8 drbar; /* SDRAM Row Boundry Address Register */ - u32 row_high_limit, row_high_limit_last; - u32 reg_sdram, ecc_on, row_base; - - ecc_on = ecc_enabled(dramcr); - reg_sdram = dramcr & BIT(4); - row_high_limit_last = 0; - - for (index = 0; index < mci->nr_csrows; index++) { - csrow = &mci->csrows[index]; - - /* find the DRAM Chip Select Base address and mask */ - pci_read_config_byte(pdev, R82600_DRBA + index, &drbar); - - debugf1("%s() Row=%d DRBA = %#0x\n", __func__, index, drbar); - - row_high_limit = ((u32) drbar << 24); -/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */ - - debugf1("%s() Row=%d, Boundry Address=%#0x, Last = %#0x\n", - __func__, index, row_high_limit, row_high_limit_last); - - /* Empty row [p.57] */ - if (row_high_limit == row_high_limit_last) - continue; - - row_base = row_high_limit_last; - - csrow->first_page = row_base >> PAGE_SHIFT; - csrow->last_page = (row_high_limit >> PAGE_SHIFT) - 1; - csrow->nr_pages = csrow->last_page - csrow->first_page + 1; - /* Error address is top 19 bits - so granularity is * - * 14 bits */ - csrow->grain = 1 << 14; - csrow->mtype = reg_sdram ? MEM_RDDR : MEM_DDR; - /* FIXME - check that this is unknowable with this chipset */ - csrow->dtype = DEV_UNKNOWN; - - /* Mode is global on 82600 */ - csrow->edac_mode = ecc_on ? EDAC_SECDED : EDAC_NONE; - row_high_limit_last = row_high_limit; - } -} - static int r82600_probe1(struct pci_dev *pdev, int dev_idx) { - struct mem_ctl_info *mci; + int rc = -ENODEV; + int index; + struct mem_ctl_info *mci = NULL; u8 dramcr; + u32 ecc_on; + u32 reg_sdram; u32 eapr; u32 scrub_disabled; u32 sdram_refresh_rate; + u32 row_high_limit_last = 0; struct r82600_error_info discard; debugf0("%s()\n", __func__); pci_read_config_byte(pdev, R82600_DRAMC, &dramcr); pci_read_config_dword(pdev, R82600_EAP, &eapr); + ecc_on = dramcr & BIT(5); + reg_sdram = dramcr & BIT(4); scrub_disabled = eapr & BIT(31); sdram_refresh_rate = dramcr & (BIT(0) | BIT(1)); debugf2("%s(): sdram refresh rate = %#0x\n", __func__, @@ -278,11 +226,13 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx) debugf2("%s(): DRAMC register = %#0x\n", __func__, dramcr); mci = edac_mc_alloc(0, R82600_NR_CSROWS, R82600_NR_CHANS); - if (mci == NULL) - return -ENOMEM; + if (mci == NULL) { + rc = -ENOMEM; + goto fail; + } debugf0("%s(): mci = %p\n", __func__, mci); - mci->dev = &pdev->dev; + mci->pdev = pdev; mci->mtype_cap = MEM_FLAG_RDDR | MEM_FLAG_DDR; mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; /* FIXME try to work out if the chip leads have been used for COM2 @@ -295,7 +245,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx) * is possible. */ mci->edac_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; - if (ecc_enabled(dramcr)) { + if (ecc_on) { if (scrub_disabled) debugf3("%s(): mci = %p - Scrubbing disabled! EAP: " "%#0x\n", __func__, mci, eapr); @@ -303,17 +253,53 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx) mci->edac_cap = EDAC_FLAG_NONE; mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = R82600_REVISION; + mci->mod_ver = "$Revision: 1.1.2.6 $"; mci->ctl_name = "R82600"; mci->edac_check = r82600_check; mci->ctl_page_to_phys = NULL; - r82600_init_csrows(mci, pdev, dramcr); + + for (index = 0; index < mci->nr_csrows; index++) { + struct csrow_info *csrow = &mci->csrows[index]; + u8 drbar; /* sDram Row Boundry Address Register */ + u32 row_high_limit; + u32 row_base; + + /* find the DRAM Chip Select Base address and mask */ + pci_read_config_byte(mci->pdev, R82600_DRBA + index, &drbar); + + debugf1("MC%d: %s() Row=%d DRBA = %#0x\n", mci->mc_idx, + __func__, index, drbar); + + row_high_limit = ((u32) drbar << 24); +/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */ + + debugf1("MC%d: %s() Row=%d, Boundry Address=%#0x, Last = " + "%#0x \n", mci->mc_idx, __func__, index, + row_high_limit, row_high_limit_last); + + /* Empty row [p.57] */ + if (row_high_limit == row_high_limit_last) + continue; + + row_base = row_high_limit_last; + csrow->first_page = row_base >> PAGE_SHIFT; + csrow->last_page = (row_high_limit >> PAGE_SHIFT) - 1; + csrow->nr_pages = csrow->last_page - csrow->first_page + 1; + /* Error address is top 19 bits - so granularity is * + * 14 bits */ + csrow->grain = 1 << 14; + csrow->mtype = reg_sdram ? MEM_RDDR : MEM_DDR; + /* FIXME - check that this is unknowable with this chipset */ + csrow->dtype = DEV_UNKNOWN; + + /* Mode is global on 82600 */ + csrow->edac_mode = ecc_on ? EDAC_SECDED : EDAC_NONE; + row_high_limit_last = row_high_limit; + } + r82600_get_error_info(mci, &discard); /* clear counters */ - /* Here we assume that we will never see multiple instances of this - * type of memory controller. The ID is therefore hardcoded to 0. - */ - if (edac_mc_add_mc(mci,0)) { + if (edac_mc_add_mc(mci)) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); goto fail; } @@ -323,15 +309,17 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx) if (disable_hardware_scrub) { debugf3("%s(): Disabling Hardware Scrub (scrub on error)\n", __func__); - pci_write_bits32(pdev, R82600_EAP, BIT(31), BIT(31)); + pci_write_bits32(mci->pdev, R82600_EAP, BIT(31), BIT(31)); } debugf3("%s(): success\n", __func__); return 0; fail: - edac_mc_free(mci); - return -ENODEV; + if (mci) + edac_mc_free(mci); + + return rc; } /* returns count (>= 0), or negative on error */ @@ -350,7 +338,7 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) + if ((mci = edac_mc_del_mc(pdev)) == NULL) return; edac_mc_free(mci); diff --git a/trunk/drivers/eisa/virtual_root.c b/trunk/drivers/eisa/virtual_root.c index 9b4fcac03ad5..0f97a0cb0ff4 100644 --- a/trunk/drivers/eisa/virtual_root.c +++ b/trunk/drivers/eisa/virtual_root.c @@ -7,6 +7,7 @@ * This code is released under the GPL version 2. */ +#include #include #include #include diff --git a/trunk/drivers/fc4/fc_syms.c b/trunk/drivers/fc4/fc_syms.c index 8700a8076d04..ed85dfcef69a 100644 --- a/trunk/drivers/fc4/fc_syms.c +++ b/trunk/drivers/fc4/fc_syms.c @@ -2,6 +2,7 @@ * We should not even be trying to compile this if we are not doing * a module. */ +#include #include #ifdef CONFIG_MODULES diff --git a/trunk/drivers/fc4/soc.c b/trunk/drivers/fc4/soc.c index 3b07e0ca81cd..cf8768b8d1f1 100644 --- a/trunk/drivers/fc4/soc.c +++ b/trunk/drivers/fc4/soc.c @@ -637,7 +637,7 @@ static inline void soc_init(struct sbus_dev *sdev, int no) irq = sdev->irqs[0]; - if (request_irq (irq, soc_intr, IRQF_SHARED, "SOC", (void *)s)) { + if (request_irq (irq, soc_intr, SA_SHIRQ, "SOC", (void *)s)) { soc_printk ("Cannot order irq %d to go\n", irq); socs = s->next; return; diff --git a/trunk/drivers/fc4/socal.c b/trunk/drivers/fc4/socal.c index 2b75edc5859d..f52d1e5bd5a5 100644 --- a/trunk/drivers/fc4/socal.c +++ b/trunk/drivers/fc4/socal.c @@ -761,7 +761,7 @@ static inline void socal_init(struct sbus_dev *sdev, int no) irq = sdev->irqs[0]; - if (request_irq (irq, socal_intr, IRQF_SHARED, "SOCAL", (void *)s)) { + if (request_irq (irq, socal_intr, SA_SHIRQ, "SOCAL", (void *)s)) { socal_printk ("Cannot order irq %d to go\n", irq); socals = s->next; return; diff --git a/trunk/drivers/firmware/dell_rbu.c b/trunk/drivers/firmware/dell_rbu.c index 23b086685453..fdb8b042e64d 100644 --- a/trunk/drivers/firmware/dell_rbu.c +++ b/trunk/drivers/firmware/dell_rbu.c @@ -34,6 +34,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ +#include #include #include #include diff --git a/trunk/drivers/firmware/efivars.c b/trunk/drivers/firmware/efivars.c index 8ebce1c03ad7..9b7e4d52ffd4 100644 --- a/trunk/drivers/firmware/efivars.c +++ b/trunk/drivers/firmware/efivars.c @@ -66,6 +66,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/firmware/pcdp.c b/trunk/drivers/firmware/pcdp.c index c2ad72fefd9d..c37baf9448bc 100644 --- a/trunk/drivers/firmware/pcdp.c +++ b/trunk/drivers/firmware/pcdp.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/hwmon/hwmon-vid.c b/trunk/drivers/hwmon/hwmon-vid.c index 9d67320e6840..a6764ff00803 100644 --- a/trunk/drivers/hwmon/hwmon-vid.c +++ b/trunk/drivers/hwmon/hwmon-vid.c @@ -22,6 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/hwmon/w83792d.c b/trunk/drivers/hwmon/w83792d.c index 7576ec9426a3..e407c74bda35 100644 --- a/trunk/drivers/hwmon/w83792d.c +++ b/trunk/drivers/hwmon/w83792d.c @@ -35,6 +35,7 @@ w83792d 9 7 7 3 0x7a 0x5ca3 yes no */ +#include #include #include #include diff --git a/trunk/drivers/i2c/busses/i2c-i801.c b/trunk/drivers/i2c/busses/i2c-i801.c index 7be1d0a3e8f8..8b46ef7d9ff8 100644 --- a/trunk/drivers/i2c/busses/i2c-i801.c +++ b/trunk/drivers/i2c/busses/i2c-i801.c @@ -494,8 +494,8 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id err = pci_request_region(dev, SMBBAR, i801_driver.name); if (err) { dev_err(&dev->dev, "Failed to request SMBus region " - "0x%lx-0x%Lx\n", i801_smba, - (unsigned long long)pci_resource_end(dev, SMBBAR)); + "0x%lx-0x%lx\n", i801_smba, + pci_resource_end(dev, SMBBAR)); goto exit; } diff --git a/trunk/drivers/i2c/busses/i2c-ibm_iic.c b/trunk/drivers/i2c/busses/i2c-ibm_iic.c index 0599bbd65d93..87fae937e666 100644 --- a/trunk/drivers/i2c/busses/i2c-ibm_iic.c +++ b/trunk/drivers/i2c/busses/i2c-ibm_iic.c @@ -28,6 +28,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/i2c/busses/i2c-iop3xx.c b/trunk/drivers/i2c/busses/i2c-iop3xx.c index aca7e1668605..d00a02fc23e4 100644 --- a/trunk/drivers/i2c/busses/i2c-iop3xx.c +++ b/trunk/drivers/i2c/busses/i2c-iop3xx.c @@ -26,6 +26,7 @@ * the Free Software Foundation, version 2. */ +#include #include #include #include diff --git a/trunk/drivers/i2c/busses/i2c-mpc.c b/trunk/drivers/i2c/busses/i2c-mpc.c index 377ab40944b8..2721e4c8184a 100644 --- a/trunk/drivers/i2c/busses/i2c-mpc.c +++ b/trunk/drivers/i2c/busses/i2c-mpc.c @@ -13,6 +13,7 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include @@ -318,7 +319,7 @@ static int fsl_i2c_probe(struct platform_device *pdev) if (i2c->irq != 0) if ((result = request_irq(i2c->irq, mpc_i2c_isr, - IRQF_SHARED, "i2c-mpc", i2c)) < 0) { + SA_SHIRQ, "i2c-mpc", i2c)) < 0) { printk(KERN_ERR "i2c-mpc - failed to attach interrupt\n"); goto fail_irq; diff --git a/trunk/drivers/i2c/busses/i2c-powermac.c b/trunk/drivers/i2c/busses/i2c-powermac.c index 2a0b3be7cdd0..df786eb55295 100644 --- a/trunk/drivers/i2c/busses/i2c-powermac.c +++ b/trunk/drivers/i2c/busses/i2c-powermac.c @@ -20,6 +20,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/i2c/busses/i2c-pxa.c b/trunk/drivers/i2c/busses/i2c-pxa.c index ee114b48face..5155010b455e 100644 --- a/trunk/drivers/i2c/busses/i2c-pxa.c +++ b/trunk/drivers/i2c/busses/i2c-pxa.c @@ -968,7 +968,7 @@ static int i2c_pxa_probe(struct platform_device *dev) #endif pxa_set_cken(CKEN14_I2C, 1); - ret = request_irq(IRQ_I2C, i2c_pxa_handler, IRQF_DISABLED, + ret = request_irq(IRQ_I2C, i2c_pxa_handler, SA_INTERRUPT, "pxa2xx-i2c", i2c); if (ret) goto out; diff --git a/trunk/drivers/i2c/busses/i2c-s3c2410.c b/trunk/drivers/i2c/busses/i2c-s3c2410.c index 5d2950e91fc5..f7d40f8e5f5c 100644 --- a/trunk/drivers/i2c/busses/i2c-s3c2410.c +++ b/trunk/drivers/i2c/busses/i2c-s3c2410.c @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include @@ -828,7 +829,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) goto out; } - ret = request_irq(res->start, s3c24xx_i2c_irq, IRQF_DISABLED, + ret = request_irq(res->start, s3c24xx_i2c_irq, SA_INTERRUPT, pdev->name, i2c); if (ret != 0) { diff --git a/trunk/drivers/i2c/busses/scx200_i2c.c b/trunk/drivers/i2c/busses/scx200_i2c.c index cb3ef5ac99fd..27fbfecc414f 100644 --- a/trunk/drivers/i2c/busses/scx200_i2c.c +++ b/trunk/drivers/i2c/busses/scx200_i2c.c @@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/i2c/chips/isp1301_omap.c b/trunk/drivers/i2c/chips/isp1301_omap.c index f92505b94c61..e6f1ab7b913c 100644 --- a/trunk/drivers/i2c/chips/isp1301_omap.c +++ b/trunk/drivers/i2c/chips/isp1301_omap.c @@ -21,6 +21,7 @@ #undef DEBUG #undef VERBOSE +#include #include #include #include @@ -908,7 +909,7 @@ static int otg_bind(struct isp1301 *isp) if (otg_dev) status = request_irq(otg_dev->resource[1].start, omap_otg_irq, - IRQF_DISABLED, DRIVER_NAME, isp); + SA_INTERRUPT, DRIVER_NAME, isp); else status = -ENODEV; @@ -1578,7 +1579,7 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind) } status = request_irq(isp->irq, isp1301_irq, - IRQF_SAMPLE_RANDOM, DRIVER_NAME, isp); + SA_SAMPLE_RANDOM, DRIVER_NAME, isp); if (status < 0) { dev_dbg(&i2c->dev, "can't get IRQ %d, err %d\n", isp->irq, status); diff --git a/trunk/drivers/i2c/chips/tps65010.c b/trunk/drivers/i2c/chips/tps65010.c index e7e27049fbfa..179b1e022d80 100644 --- a/trunk/drivers/i2c/chips/tps65010.c +++ b/trunk/drivers/i2c/chips/tps65010.c @@ -19,6 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -521,14 +522,14 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind) } #ifdef CONFIG_ARM - irqflags = IRQF_SAMPLE_RANDOM | IRQF_TRIGGER_LOW; + irqflags = SA_SAMPLE_RANDOM | SA_TRIGGER_LOW; if (machine_is_omap_h2()) { tps->model = TPS65010; omap_cfg_reg(W4_GPIO58); tps->irq = OMAP_GPIO_IRQ(58); omap_request_gpio(58); omap_set_gpio_direction(58, 1); - irqflags |= IRQF_TRIGGER_FALLING; + irqflags |= SA_TRIGGER_FALLING; } if (machine_is_omap_osk()) { tps->model = TPS65010; @@ -536,7 +537,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind) tps->irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1)); omap_request_gpio(OMAP_MPUIO(1)); omap_set_gpio_direction(OMAP_MPUIO(1), 1); - irqflags |= IRQF_TRIGGER_FALLING; + irqflags |= SA_TRIGGER_FALLING; } if (machine_is_omap_h3()) { tps->model = TPS65013; @@ -544,7 +545,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind) // FIXME set up this board's IRQ ... } #else - irqflags = IRQF_SAMPLE_RANDOM; + irqflags = SA_SAMPLE_RANDOM; #endif if (tps->irq > 0) { diff --git a/trunk/drivers/ide/arm/icside.c b/trunk/drivers/ide/arm/icside.c index 8a1c27f28692..308897e57e4d 100644 --- a/trunk/drivers/ide/arm/icside.c +++ b/trunk/drivers/ide/arm/icside.c @@ -6,6 +6,7 @@ * Please note that this platform does not support 32-bit IDE IO. */ +#include #include #include #include diff --git a/trunk/drivers/ide/cris/ide-cris.c b/trunk/drivers/ide/cris/ide-cris.c index 5797e0b5a132..cd15e6260510 100644 --- a/trunk/drivers/ide/cris/ide-cris.c +++ b/trunk/drivers/ide/cris/ide-cris.c @@ -19,6 +19,7 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ +#include #include #include #include diff --git a/trunk/drivers/ide/h8300/ide-h8300.c b/trunk/drivers/ide/h8300/ide-h8300.c index 15955996a1f3..fb91cb8bf2d2 100644 --- a/trunk/drivers/ide/h8300/ide-h8300.c +++ b/trunk/drivers/ide/h8300/ide-h8300.c @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/trunk/drivers/ide/ide-cd.c b/trunk/drivers/ide/ide-cd.c index 654d4cd09847..bfafd4846a08 100644 --- a/trunk/drivers/ide/ide-cd.c +++ b/trunk/drivers/ide/ide-cd.c @@ -301,6 +301,7 @@ #define IDECD_VERSION "4.61" +#include #include #include #include diff --git a/trunk/drivers/ide/ide-disk.c b/trunk/drivers/ide/ide-disk.c index f712e4cfd9dc..d0227c39ced1 100644 --- a/trunk/drivers/ide/ide-disk.c +++ b/trunk/drivers/ide/ide-disk.c @@ -47,6 +47,7 @@ //#define DEBUG +#include #include #include #include diff --git a/trunk/drivers/ide/ide-dma.c b/trunk/drivers/ide/ide-dma.c index 98918fb6b2ce..783a2475ee8b 100644 --- a/trunk/drivers/ide/ide-dma.c +++ b/trunk/drivers/ide/ide-dma.c @@ -74,6 +74,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ide/ide-floppy.c b/trunk/drivers/ide/ide-floppy.c index adbe9f76a505..68628327c0f5 100644 --- a/trunk/drivers/ide/ide-floppy.c +++ b/trunk/drivers/ide/ide-floppy.c @@ -82,6 +82,7 @@ #define IDEFLOPPY_VERSION "0.99.newide" +#include #include #include #include @@ -838,7 +839,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive) "transferred\n", pc->actually_transferred); clear_bit(PC_DMA_IN_PROGRESS, &pc->flags); - local_irq_enable_in_hardirq(); + local_irq_enable(); if (status.b.check || test_bit(PC_DMA_ERROR, &pc->flags)) { /* Error detected */ diff --git a/trunk/drivers/ide/ide-io.c b/trunk/drivers/ide/ide-io.c index fb6795236e76..26ceab1e90bb 100644 --- a/trunk/drivers/ide/ide-io.c +++ b/trunk/drivers/ide/ide-io.c @@ -24,6 +24,7 @@ */ +#include #include #include #include @@ -693,7 +694,7 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive) u8 stat = hwif->INB(IDE_STATUS_REG); int retries = 10; - local_irq_enable_in_hardirq(); + local_irq_enable(); if ((stat & DRQ_STAT) && args && args[3]) { u8 io_32bit = drive->io_32bit; drive->io_32bit = 0; @@ -1286,7 +1287,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) if (masked_irq != IDE_NO_IRQ && hwif->irq != masked_irq) disable_irq_nosync(hwif->irq); spin_unlock(&ide_lock); - local_irq_enable_in_hardirq(); + local_irq_enable(); /* allow other IRQs while we start this request */ startstop = start_request(drive, rq); spin_lock_irq(&ide_lock); @@ -1631,7 +1632,7 @@ irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs) spin_unlock(&ide_lock); if (drive->unmask) - local_irq_enable_in_hardirq(); + local_irq_enable(); /* service this interrupt, may set handler for next interrupt */ startstop = handler(drive); spin_lock_irq(&ide_lock); @@ -1705,7 +1706,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio { unsigned long flags; ide_hwgroup_t *hwgroup = HWGROUP(drive); - DECLARE_COMPLETION_ONSTACK(wait); + DECLARE_COMPLETION(wait); int where = ELEVATOR_INSERT_BACK, err; int must_wait = (action == ide_wait || action == ide_head_wait); diff --git a/trunk/drivers/ide/ide-iops.c b/trunk/drivers/ide/ide-iops.c index 657165297dc7..32117f0ec5c0 100644 --- a/trunk/drivers/ide/ide-iops.c +++ b/trunk/drivers/ide/ide-iops.c @@ -6,6 +6,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ide/ide-lib.c b/trunk/drivers/ide/ide-lib.c index 1feff23487d4..7ddb11828731 100644 --- a/trunk/drivers/ide/ide-lib.c +++ b/trunk/drivers/ide/ide-lib.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/drivers/ide/ide-probe.c b/trunk/drivers/ide/ide-probe.c index 9cadf0106c6c..0d5038a28560 100644 --- a/trunk/drivers/ide/ide-probe.c +++ b/trunk/drivers/ide/ide-probe.c @@ -33,6 +33,7 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ +#include #include #include #include @@ -1004,7 +1005,7 @@ static int ide_init_queue(ide_drive_t *drive) * and irq serialization situations. This is somewhat complex because * it handles static as well as dynamic (PCMCIA) IDE interfaces. * - * The IRQF_DISABLED in sa_flags means ide_intr() is always entered with + * The SA_INTERRUPT in sa_flags means ide_intr() is always entered with * interrupts completely disabled. This can be bad for interrupt latency, * but anything else has led to problems on some machines. We re-enable * interrupts as much as we can safely do in most places. @@ -1090,15 +1091,15 @@ static int init_irq (ide_hwif_t *hwif) * Allocate the irq, if not already obtained for another hwif */ if (!match || match->irq != hwif->irq) { - int sa = IRQF_DISABLED; + int sa = SA_INTERRUPT; #if defined(__mc68000__) || defined(CONFIG_APUS) - sa = IRQF_SHARED; + sa = SA_SHIRQ; #endif /* __mc68000__ || CONFIG_APUS */ if (IDE_CHIPSET_IS_PCI(hwif->chipset)) { - sa = IRQF_SHARED; + sa = SA_SHIRQ; #ifndef CONFIG_IDEPCI_SHARE_IRQ - sa |= IRQF_DISABLED; + sa |= SA_INTERRUPT; #endif /* CONFIG_IDEPCI_SHARE_IRQ */ } diff --git a/trunk/drivers/ide/ide-proc.c b/trunk/drivers/ide/ide-proc.c index c12f1b71e934..84665e2ba3c8 100644 --- a/trunk/drivers/ide/ide-proc.c +++ b/trunk/drivers/ide/ide-proc.c @@ -22,6 +22,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/ide/ide-tape.c b/trunk/drivers/ide/ide-tape.c index 7067ab997927..4b91101e12b7 100644 --- a/trunk/drivers/ide/ide-tape.c +++ b/trunk/drivers/ide/ide-tape.c @@ -424,6 +424,7 @@ #define IDETAPE_VERSION "1.19" +#include #include #include #include diff --git a/trunk/drivers/ide/ide-taskfile.c b/trunk/drivers/ide/ide-taskfile.c index 97a9244312fc..a839b2a8f6f4 100644 --- a/trunk/drivers/ide/ide-taskfile.c +++ b/trunk/drivers/ide/ide-taskfile.c @@ -27,6 +27,7 @@ * request. */ +#include #include #include #include @@ -222,7 +223,7 @@ ide_startstop_t task_no_data_intr (ide_drive_t *drive) ide_hwif_t *hwif = HWIF(drive); u8 stat; - local_irq_enable_in_hardirq(); + local_irq_enable(); if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),READY_STAT,BAD_STAT)) { return ide_error(drive, "task_no_data_intr", stat); /* calls ide_end_drive_cmd */ diff --git a/trunk/drivers/ide/ide.c b/trunk/drivers/ide/ide.c index 05fbd9298db7..1cdf44205162 100644 --- a/trunk/drivers/ide/ide.c +++ b/trunk/drivers/ide/ide.c @@ -130,6 +130,7 @@ #define _IDE_C /* Tell ide.h it's really us */ +#include #include #include #include diff --git a/trunk/drivers/ide/legacy/ali14xx.c b/trunk/drivers/ide/legacy/ali14xx.c index 9c544467cb74..fb88711812e6 100644 --- a/trunk/drivers/ide/legacy/ali14xx.c +++ b/trunk/drivers/ide/legacy/ali14xx.c @@ -40,6 +40,7 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ #include +#include #include #include #include diff --git a/trunk/drivers/ide/legacy/dtc2278.c b/trunk/drivers/ide/legacy/dtc2278.c index 3b1d33baaa2f..20eb5b872ca9 100644 --- a/trunk/drivers/ide/legacy/dtc2278.c +++ b/trunk/drivers/ide/legacy/dtc2278.c @@ -7,6 +7,7 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ #include +#include #include #include #include diff --git a/trunk/drivers/ide/legacy/gayle.c b/trunk/drivers/ide/legacy/gayle.c index 64d42619ab06..3fac3e9ec47d 100644 --- a/trunk/drivers/ide/legacy/gayle.c +++ b/trunk/drivers/ide/legacy/gayle.c @@ -8,6 +8,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/ide/legacy/hd.c b/trunk/drivers/ide/legacy/hd.c index aebecd8f51cc..6439dec66881 100644 --- a/trunk/drivers/ide/legacy/hd.c +++ b/trunk/drivers/ide/legacy/hd.c @@ -691,7 +691,7 @@ static struct block_device_operations hd_fops = { }; /* - * This is the hard disk IRQ description. The IRQF_DISABLED in sa_flags + * This is the hard disk IRQ description. The SA_INTERRUPT in sa_flags * means we run the IRQ-handler with interrupts disabled: this is bad for * interrupt latency, but anything else has led to problems on some * machines. @@ -806,7 +806,7 @@ static int __init hd_init(void) p->cyl, p->head, p->sect); } - if (request_irq(HD_IRQ, hd_interrupt, IRQF_DISABLED, "hd", NULL)) { + if (request_irq(HD_IRQ, hd_interrupt, SA_INTERRUPT, "hd", NULL)) { printk("hd: unable to get IRQ%d for the hard disk driver\n", HD_IRQ); goto out1; diff --git a/trunk/drivers/ide/legacy/ht6560b.c b/trunk/drivers/ide/legacy/ht6560b.c index c48e87e512d3..a77fb249d5cf 100644 --- a/trunk/drivers/ide/legacy/ht6560b.c +++ b/trunk/drivers/ide/legacy/ht6560b.c @@ -39,6 +39,7 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ #include +#include #include #include #include diff --git a/trunk/drivers/ide/legacy/ide-cs.c b/trunk/drivers/ide/legacy/ide-cs.c index b7e459e4f284..602797a44208 100644 --- a/trunk/drivers/ide/legacy/ide-cs.c +++ b/trunk/drivers/ide/legacy/ide-cs.c @@ -146,16 +146,7 @@ static void ide_detach(struct pcmcia_device *link) kfree(link->priv); } /* ide_detach */ -static void idecs_mmio_fixup(ide_hwif_t *hwif) -{ - default_hwif_mmiops(hwif); - hwif->mmio = 2; - - ide_undecoded_slave(hwif); -} - -static int idecs_register(unsigned long io, unsigned long ctl, - unsigned long irq, struct pcmcia_device *handle, int is_mmio) +static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) { hw_regs_t hw; memset(&hw, 0, sizeof(hw)); @@ -163,19 +154,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, hw.irq = irq; hw.chipset = ide_pci; hw.dev = &handle->dev; - - if(is_mmio) - return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup); - else - return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); -} - -void outb_io(unsigned char value, unsigned long port) { - outb(value, port); -} - -void outb_mem(unsigned char value, unsigned long port) { - writeb(value, (void __iomem *) port); + return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); } /*====================================================================== @@ -201,8 +180,7 @@ static int ide_config(struct pcmcia_device *link) } *stk = NULL; cistpl_cftable_entry_t *cfg; int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; - unsigned long io_base, ctl_base, is_mmio, try_slave; - void (*my_outb)(unsigned char, unsigned long); + unsigned long io_base, ctl_base; DEBUG(0, "ide_config(0x%p)\n", link); @@ -232,7 +210,7 @@ static int ide_config(struct pcmcia_device *link) /* Not sure if this is right... look up the current Vcc */ CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); - pass = io_base = ctl_base = is_mmio = try_slave = 0; + pass = io_base = ctl_base = 0; tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; tuple.Attributes = 0; CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); @@ -280,45 +258,11 @@ static int ide_config(struct pcmcia_device *link) goto next_entry; io_base = link->io.BasePort1; ctl_base = link->io.BasePort1 + 0x0e; - - if (io->win[0].len >= 0x20) - try_slave = 1; - } else goto next_entry; /* If we've got this far, we're done */ break; } - if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) { - win_req_t req; - memreq_t map; - cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem; - - if (mem->win[0].len < 16) - goto next_entry; - - req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; - req.Attributes |= WIN_ENABLE; - req.Base = mem->win[0].host_addr; - req.Size = 0; - - req.AccessSpeed = 0; - if (pcmcia_request_window(&link, &req, &link->win) != 0) - goto next_entry; - map.Page = 0; map.CardOffset = mem->win[0].card_addr; - if (pcmcia_map_mem_page(link->win, &map) != 0) - goto next_entry; - - io_base = (unsigned long) ioremap(req.Base, req.Size); - ctl_base = io_base + 0x0e; - is_mmio = 1; - - if (mem->win[0].len >= 0x20) - try_slave = 1; - - break; - } - next_entry: if (cfg->flags & CISTPL_CFTABLE_DEFAULT) memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); @@ -334,26 +278,21 @@ static int ide_config(struct pcmcia_device *link) CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); - if(is_mmio) - my_outb = outb_mem; - else - my_outb = outb_io; - /* disable drive interrupts during IDE probe */ - my_outb(0x02, ctl_base); + outb(0x02, ctl_base); /* special setup for KXLC005 card */ if (is_kme) - my_outb(0x81, ctl_base+1); + outb(0x81, ctl_base+1); /* retry registration in case device is still spinning up */ for (hd = -1, i = 0; i < 10; i++) { - hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio); + hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); if (hd >= 0) break; - if (try_slave) { - my_outb(0x02, ctl_base + 0x10); + if (link->io.NumPorts1 == 0x20) { + outb(0x02, ctl_base + 0x10); hd = idecs_register(io_base + 0x10, ctl_base + 0x10, - link->irq.AssignedIRQ, link, is_mmio); + link->irq.AssignedIRQ, link); if (hd >= 0) { io_base += 0x10; ctl_base += 0x10; diff --git a/trunk/drivers/ide/legacy/macide.c b/trunk/drivers/ide/legacy/macide.c index d655da749144..90cac609d9cf 100644 --- a/trunk/drivers/ide/legacy/macide.c +++ b/trunk/drivers/ide/legacy/macide.c @@ -11,6 +11,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/ide/legacy/qd65xx.c b/trunk/drivers/ide/legacy/qd65xx.c index d3c3bc2640e7..563fab0098be 100644 --- a/trunk/drivers/ide/legacy/qd65xx.c +++ b/trunk/drivers/ide/legacy/qd65xx.c @@ -28,6 +28,7 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ #include +#include #include #include #include diff --git a/trunk/drivers/ide/legacy/umc8672.c b/trunk/drivers/ide/legacy/umc8672.c index 6e2c58c5f6a2..cdbdb2ff9f15 100644 --- a/trunk/drivers/ide/legacy/umc8672.c +++ b/trunk/drivers/ide/legacy/umc8672.c @@ -40,6 +40,7 @@ #define REALLY_SLOW_IO /* some systems can safely undef this */ #include +#include #include #include #include diff --git a/trunk/drivers/ide/pci/aec62xx.c b/trunk/drivers/ide/pci/aec62xx.c index a7c725f8bf64..3edd7060510f 100644 --- a/trunk/drivers/ide/pci/aec62xx.c +++ b/trunk/drivers/ide/pci/aec62xx.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/ide/pci/alim15x3.c b/trunk/drivers/ide/pci/alim15x3.c index 351dab2fcacf..8b24b4f2a839 100644 --- a/trunk/drivers/ide/pci/alim15x3.c +++ b/trunk/drivers/ide/pci/alim15x3.c @@ -27,6 +27,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/amd74xx.c b/trunk/drivers/ide/pci/amd74xx.c index 2b0ea8b6608d..85007cb12c52 100644 --- a/trunk/drivers/ide/pci/amd74xx.c +++ b/trunk/drivers/ide/pci/amd74xx.c @@ -16,6 +16,7 @@ * the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/atiixp.c b/trunk/drivers/ide/pci/atiixp.c index a574de5f0835..900efd1da587 100644 --- a/trunk/drivers/ide/pci/atiixp.c +++ b/trunk/drivers/ide/pci/atiixp.c @@ -6,6 +6,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/cmd640.c b/trunk/drivers/ide/pci/cmd640.c index 61b5f9c0b2f4..11d035f1983d 100644 --- a/trunk/drivers/ide/pci/cmd640.c +++ b/trunk/drivers/ide/pci/cmd640.c @@ -103,6 +103,7 @@ //#define CMD640_DUMP_REGS +#include #include #include #include diff --git a/trunk/drivers/ide/pci/cmd64x.c b/trunk/drivers/ide/pci/cmd64x.c index 20c32716bbc4..92b7b1549b16 100644 --- a/trunk/drivers/ide/pci/cmd64x.c +++ b/trunk/drivers/ide/pci/cmd64x.c @@ -14,6 +14,7 @@ * Copyright (C) 1999-2002 Andre Hedrick */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/cs5520.c b/trunk/drivers/ide/pci/cs5520.c index 079f7c86726b..ea3c52cc8ac1 100644 --- a/trunk/drivers/ide/pci/cs5520.c +++ b/trunk/drivers/ide/pci/cs5520.c @@ -32,6 +32,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/cs5530.c b/trunk/drivers/ide/pci/cs5530.c index 380bb28c7c54..09269e574b3e 100644 --- a/trunk/drivers/ide/pci/cs5530.c +++ b/trunk/drivers/ide/pci/cs5530.c @@ -14,6 +14,7 @@ * CS5530 documentation available from National Semiconductor. */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/cs5535.c b/trunk/drivers/ide/pci/cs5535.c index 5c5aec28e671..6eb305197f3c 100644 --- a/trunk/drivers/ide/pci/cs5535.c +++ b/trunk/drivers/ide/pci/cs5535.c @@ -23,6 +23,7 @@ * CS5535 documentation available from AMD */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/cy82c693.c b/trunk/drivers/ide/pci/cy82c693.c index 120929fbe7a3..9f41ecd56338 100644 --- a/trunk/drivers/ide/pci/cy82c693.c +++ b/trunk/drivers/ide/pci/cy82c693.c @@ -44,6 +44,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/hpt34x.c b/trunk/drivers/ide/pci/hpt34x.c index b46cb042290a..7da550281cf2 100644 --- a/trunk/drivers/ide/pci/hpt34x.c +++ b/trunk/drivers/ide/pci/hpt34x.c @@ -24,6 +24,7 @@ * Non-bootable card or HPT343 :: pcicmd == 0x05 */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/hpt366.c b/trunk/drivers/ide/pci/hpt366.c index e993a51f250e..940bdd4c5784 100644 --- a/trunk/drivers/ide/pci/hpt366.c +++ b/trunk/drivers/ide/pci/hpt366.c @@ -55,6 +55,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/it8172.c b/trunk/drivers/ide/pci/it8172.c index 0fc89fafad65..93462926b9d5 100644 --- a/trunk/drivers/ide/pci/it8172.c +++ b/trunk/drivers/ide/pci/it8172.c @@ -28,6 +28,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/it821x.c b/trunk/drivers/ide/pci/it821x.c index 3cb04424d351..38f41b377ff6 100644 --- a/trunk/drivers/ide/pci/it821x.c +++ b/trunk/drivers/ide/pci/it821x.c @@ -62,6 +62,7 @@ * - Move to libata once it grows up */ +#include #include #include #include @@ -650,8 +651,6 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) } ide_set_hwifdata(hwif, idev); - hwif->atapi_dma = 1; - pci_read_config_byte(hwif->pci_dev, 0x50, &conf); if(conf & 1) { idev->smart = 1; diff --git a/trunk/drivers/ide/pci/ns87415.c b/trunk/drivers/ide/pci/ns87415.c index d95714bcee4e..fcd5142f5cfe 100644 --- a/trunk/drivers/ide/pci/ns87415.c +++ b/trunk/drivers/ide/pci/ns87415.c @@ -9,6 +9,7 @@ * Inspired by an earlier effort from David S. Miller */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/pdc202xx_new.c b/trunk/drivers/ide/pci/pdc202xx_new.c index 6c097e80b4df..5a8334d134fb 100644 --- a/trunk/drivers/ide/pci/pdc202xx_new.c +++ b/trunk/drivers/ide/pci/pdc202xx_new.c @@ -14,6 +14,7 @@ * Released under terms of General Public License */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/pdc202xx_old.c b/trunk/drivers/ide/pci/pdc202xx_old.c index b46022a11bef..1e209d8f9437 100644 --- a/trunk/drivers/ide/pci/pdc202xx_old.c +++ b/trunk/drivers/ide/pci/pdc202xx_old.c @@ -28,6 +28,7 @@ * Released under terms of General Public License */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/piix.c b/trunk/drivers/ide/pci/piix.c index 50332ddd5ddb..7fac6f57b5d6 100644 --- a/trunk/drivers/ide/pci/piix.c +++ b/trunk/drivers/ide/pci/piix.c @@ -90,6 +90,7 @@ * ICH3 errata #18 - Don't use native mode */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/sc1200.c b/trunk/drivers/ide/pci/sc1200.c index fc2b5496b6d2..778b82ae964d 100644 --- a/trunk/drivers/ide/pci/sc1200.c +++ b/trunk/drivers/ide/pci/sc1200.c @@ -11,6 +11,7 @@ * Available from National Semiconductor */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/serverworks.c b/trunk/drivers/ide/pci/serverworks.c index 03677bff0d72..5100b827a935 100644 --- a/trunk/drivers/ide/pci/serverworks.c +++ b/trunk/drivers/ide/pci/serverworks.c @@ -29,6 +29,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/siimage.c b/trunk/drivers/ide/pci/siimage.c index 25ceb4a39ed2..72dade14c725 100644 --- a/trunk/drivers/ide/pci/siimage.c +++ b/trunk/drivers/ide/pci/siimage.c @@ -27,6 +27,7 @@ * if neccessary */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/sis5513.c b/trunk/drivers/ide/pci/sis5513.c index 8a6c23ac8cc1..8e9d87701ce2 100644 --- a/trunk/drivers/ide/pci/sis5513.c +++ b/trunk/drivers/ide/pci/sis5513.c @@ -44,6 +44,7 @@ * 962/963. */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/sl82c105.c b/trunk/drivers/ide/pci/sl82c105.c index 0b4b60498515..900301e43818 100644 --- a/trunk/drivers/ide/pci/sl82c105.c +++ b/trunk/drivers/ide/pci/sl82c105.c @@ -13,6 +13,7 @@ * -- Benjamin Herrenschmidt (01/11/03) benh@kernel.crashing.org */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/slc90e66.c b/trunk/drivers/ide/pci/slc90e66.c index 4a1853af3bbb..0968f6bc669a 100644 --- a/trunk/drivers/ide/pci/slc90e66.c +++ b/trunk/drivers/ide/pci/slc90e66.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/triflex.c b/trunk/drivers/ide/pci/triflex.c index 56d84931d6de..f96b56838f33 100644 --- a/trunk/drivers/ide/pci/triflex.c +++ b/trunk/drivers/ide/pci/triflex.c @@ -27,6 +27,7 @@ * Not publically available. */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/trm290.c b/trunk/drivers/ide/pci/trm290.c index 2a282529bfc1..fe80295974e1 100644 --- a/trunk/drivers/ide/pci/trm290.c +++ b/trunk/drivers/ide/pci/trm290.c @@ -128,6 +128,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ide/pci/via82cxxx.c b/trunk/drivers/ide/pci/via82cxxx.c index afdaee3c15c9..3e677c4f8c28 100644 --- a/trunk/drivers/ide/pci/via82cxxx.c +++ b/trunk/drivers/ide/pci/via82cxxx.c @@ -26,6 +26,7 @@ * the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/ide/ppc/mpc8xx.c b/trunk/drivers/ide/ppc/mpc8xx.c index 0ac9da3a7378..b80c6135ae93 100644 --- a/trunk/drivers/ide/ppc/mpc8xx.c +++ b/trunk/drivers/ide/ppc/mpc8xx.c @@ -11,6 +11,7 @@ * by Mathew Locke */ +#include #include #include #include diff --git a/trunk/drivers/ide/ppc/pmac.c b/trunk/drivers/ide/ppc/pmac.c index ebf961f1718d..e8ef3455ec35 100644 --- a/trunk/drivers/ide/ppc/pmac.c +++ b/trunk/drivers/ide/ppc/pmac.c @@ -22,6 +22,7 @@ * big table * */ +#include #include #include #include diff --git a/trunk/drivers/ide/setup-pci.c b/trunk/drivers/ide/setup-pci.c index eb0945284acc..c11e3b2e67a6 100644 --- a/trunk/drivers/ide/setup-pci.c +++ b/trunk/drivers/ide/setup-pci.c @@ -18,6 +18,7 @@ * configuration of all PCI IDE interfaces present in a system. */ +#include #include #include #include diff --git a/trunk/drivers/ieee1394/config_roms.c b/trunk/drivers/ieee1394/config_roms.c index e2de6fa0c9fe..1017fd717248 100644 --- a/trunk/drivers/ieee1394/config_roms.c +++ b/trunk/drivers/ieee1394/config_roms.c @@ -9,6 +9,7 @@ * directory of the kernel sources for details. */ +#include #include #include "csr1212.h" diff --git a/trunk/drivers/ieee1394/dv1394.c b/trunk/drivers/ieee1394/dv1394.c index 87532dd43374..85c2d4ca0def 100644 --- a/trunk/drivers/ieee1394/dv1394.c +++ b/trunk/drivers/ieee1394/dv1394.c @@ -83,6 +83,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/ieee1394/highlevel.c b/trunk/drivers/ieee1394/highlevel.c index 694da82d820b..25b22609e793 100644 --- a/trunk/drivers/ieee1394/highlevel.c +++ b/trunk/drivers/ieee1394/highlevel.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ieee1394/hosts.c b/trunk/drivers/ieee1394/hosts.c index 4feead4a35c5..ad49c040b674 100644 --- a/trunk/drivers/ieee1394/hosts.c +++ b/trunk/drivers/ieee1394/hosts.c @@ -10,6 +10,7 @@ * directory of the kernel sources for details. */ +#include #include #include #include @@ -107,14 +108,6 @@ static int alloc_hostnum_cb(struct hpsb_host *host, void *__data) */ static DEFINE_MUTEX(host_num_alloc); -/* - * The pending_packet_queue is special in that it's processed - * from hardirq context too (such as hpsb_bus_reset()). Hence - * split the lock class from the usual networking skb-head - * lock class by using a separate key for it: - */ -static struct lock_class_key pending_packet_queue_key; - struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, struct device *dev) { @@ -136,8 +129,6 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, h->driver = drv; skb_queue_head_init(&h->pending_packet_queue); - lockdep_set_class(&h->pending_packet_queue.lock, - &pending_packet_queue_key); INIT_LIST_HEAD(&h->addr_space); for (i = 2; i < 16; i++) diff --git a/trunk/drivers/ieee1394/ieee1394_core.c b/trunk/drivers/ieee1394/ieee1394_core.c index f43739c5cab2..49354de9fb8a 100644 --- a/trunk/drivers/ieee1394/ieee1394_core.c +++ b/trunk/drivers/ieee1394/ieee1394_core.c @@ -20,6 +20,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/ieee1394/nodemgr.c b/trunk/drivers/ieee1394/nodemgr.c index d541b508a159..50c71e17de73 100644 --- a/trunk/drivers/ieee1394/nodemgr.c +++ b/trunk/drivers/ieee1394/nodemgr.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/ieee1394/ohci1394.c b/trunk/drivers/ieee1394/ohci1394.c index d4bad6704bbe..800c8d518430 100644 --- a/trunk/drivers/ieee1394/ohci1394.c +++ b/trunk/drivers/ieee1394/ohci1394.c @@ -82,6 +82,7 @@ * */ +#include #include #include #include @@ -3392,12 +3393,12 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev, spin_lock_init(&ohci->event_lock); /* - * interrupts are disabled, all right, but... due to IRQF_SHARED we + * interrupts are disabled, all right, but... due to SA_SHIRQ we * might get called anyway. We'll see no event, of course, but * we need to get to that "no event", so enough should be initialized * by that point. */ - if (request_irq(dev->irq, ohci_irq_handler, IRQF_SHARED, + if (request_irq(dev->irq, ohci_irq_handler, SA_SHIRQ, OHCI1394_DRIVER_NAME, ohci)) FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq); diff --git a/trunk/drivers/ieee1394/oui2c.sh b/trunk/drivers/ieee1394/oui2c.sh index b9d0e8f10abb..d50dc7a2d087 100644 --- a/trunk/drivers/ieee1394/oui2c.sh +++ b/trunk/drivers/ieee1394/oui2c.sh @@ -3,6 +3,7 @@ cat < #ifdef CONFIG_IEEE1394_OUI_DB struct oui_list_struct { diff --git a/trunk/drivers/ieee1394/pcilynx.c b/trunk/drivers/ieee1394/pcilynx.c index e6f41238f5e8..e29dfd280bee 100644 --- a/trunk/drivers/ieee1394/pcilynx.c +++ b/trunk/drivers/ieee1394/pcilynx.c @@ -30,6 +30,7 @@ * Enhancements in async and iso send code */ +#include #include #include #include @@ -1253,7 +1254,7 @@ static int __devinit add_card(struct pci_dev *dev, sprintf (irq_buf, "%d", dev->irq); - if (!request_irq(dev->irq, lynx_irq_handler, IRQF_SHARED, + if (!request_irq(dev->irq, lynx_irq_handler, SA_SHIRQ, PCILYNX_DRIVER_NAME, lynx)) { PRINT(KERN_INFO, lynx->id, "allocated interrupt %s", irq_buf); lynx->state = have_intr; diff --git a/trunk/drivers/ieee1394/pcilynx.h b/trunk/drivers/ieee1394/pcilynx.h index ec27321f6724..d631aa8383ad 100644 --- a/trunk/drivers/ieee1394/pcilynx.h +++ b/trunk/drivers/ieee1394/pcilynx.h @@ -1,6 +1,7 @@ #ifndef __PCILYNX_H__ #define __PCILYNX_H__ +#include #define PCILYNX_DRIVER_NAME "pcilynx" #define PCILYNX_MAJOR 177 diff --git a/trunk/drivers/ieee1394/sbp2.c b/trunk/drivers/ieee1394/sbp2.c index aaa74f293aaf..1d5ceb7ecc83 100644 --- a/trunk/drivers/ieee1394/sbp2.c +++ b/trunk/drivers/ieee1394/sbp2.c @@ -38,6 +38,7 @@ * but the code needs additional debugging. */ +#include #include #include #include diff --git a/trunk/drivers/ieee1394/video1394.c b/trunk/drivers/ieee1394/video1394.c index c6e3f02bc6d7..295d0f8c3d06 100644 --- a/trunk/drivers/ieee1394/video1394.c +++ b/trunk/drivers/ieee1394/video1394.c @@ -28,6 +28,7 @@ * ENOTTY for unsupported ioctl request * */ +#include #include #include #include diff --git a/trunk/drivers/infiniband/core/cm.c b/trunk/drivers/infiniband/core/cm.c index 3f6705f3083a..450adfe0a4f1 100644 --- a/trunk/drivers/infiniband/core/cm.c +++ b/trunk/drivers/infiniband/core/cm.c @@ -3152,7 +3152,6 @@ static int cm_init_qp_rtr_attr(struct cm_id_private *cm_id_priv, } if (cm_id_priv->alt_av.ah_attr.dlid) { *qp_attr_mask |= IB_QP_ALT_PATH; - qp_attr->alt_port_num = cm_id_priv->alt_av.port->port_num; qp_attr->alt_ah_attr = cm_id_priv->alt_av.ah_attr; } ret = 0; diff --git a/trunk/drivers/infiniband/core/uverbs_cmd.c b/trunk/drivers/infiniband/core/uverbs_cmd.c index bdf5d5098190..a908a7bdcd7f 100644 --- a/trunk/drivers/infiniband/core/uverbs_cmd.c +++ b/trunk/drivers/infiniband/core/uverbs_cmd.c @@ -1963,7 +1963,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file, if (!obj) return -ENOMEM; - init_uobj(&obj->uobject, cmd.user_handle, file->ucontext); + init_uobj(&obj->uobject, 0, file->ucontext); down_write(&obj->uobject.mutex); pd = idr_read_pd(cmd.pd_handle, file->ucontext); diff --git a/trunk/drivers/infiniband/hw/ipath/Kconfig b/trunk/drivers/infiniband/hw/ipath/Kconfig index 1db9489f1e82..9ea67c409b6d 100644 --- a/trunk/drivers/infiniband/hw/ipath/Kconfig +++ b/trunk/drivers/infiniband/hw/ipath/Kconfig @@ -1,16 +1,16 @@ config IPATH_CORE - tristate "QLogic InfiniPath Driver" + tristate "PathScale InfiniPath Driver" depends on 64BIT && PCI_MSI && NET ---help--- - This is a low-level driver for QLogic InfiniPath host channel + This is a low-level driver for PathScale InfiniPath host channel adapters (HCAs) based on the HT-400 and PE-800 chips. config INFINIBAND_IPATH - tristate "QLogic InfiniPath Verbs Driver" + tristate "PathScale InfiniPath Verbs Driver" depends on IPATH_CORE && INFINIBAND ---help--- This is a driver that provides InfiniBand verbs support for - QLogic InfiniPath host channel adapters (HCAs). This + PathScale InfiniPath host channel adapters (HCAs). This allows these devices to be used with both kernel upper level protocols such as IP-over-InfiniBand as well as with userspace applications (in conjunction with InfiniBand userspace access). diff --git a/trunk/drivers/infiniband/hw/ipath/Makefile b/trunk/drivers/infiniband/hw/ipath/Makefile index b0bf72864130..b4d084abfd22 100644 --- a/trunk/drivers/infiniband/hw/ipath/Makefile +++ b/trunk/drivers/infiniband/hw/ipath/Makefile @@ -1,4 +1,4 @@ -EXTRA_CFLAGS += -DIPATH_IDSTR='"QLogic kernel.org driver"' \ +EXTRA_CFLAGS += -DIPATH_IDSTR='"PathScale kernel.org driver"' \ -DIPATH_KERN_TYPE=0 obj-$(CONFIG_IPATH_CORE) += ipath_core.o diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_common.h b/trunk/drivers/infiniband/hw/ipath/ipath_common.h index 062bd392e7e5..48a55247b832 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_common.h +++ b/trunk/drivers/infiniband/hw/ipath/ipath_common.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -39,8 +38,7 @@ * to communicate between kernel and user code. */ - -/* This is the IEEE-assigned OUI for QLogic Inc. InfiniPath */ +/* This is the IEEE-assigned OUI for PathScale, Inc. */ #define IPATH_SRC_OUI_1 0x00 #define IPATH_SRC_OUI_2 0x11 #define IPATH_SRC_OUI_3 0x75 @@ -98,8 +96,8 @@ struct infinipath_stats { __u64 sps_hwerrs; /* number of times IB link changed state unexpectedly */ __u64 sps_iblink; - /* kernel receive interrupts that didn't read intstat */ - __u64 sps_fastrcvint; + /* no longer used; left for compatibility */ + __u64 sps_unused3; /* number of kernel (port0) packets received */ __u64 sps_port0pkts; /* number of "ethernet" packets sent by driver */ @@ -123,7 +121,8 @@ struct infinipath_stats { __u64 sps_ports; /* list of pkeys (other than default) accepted (0 means not set) */ __u16 sps_pkeys[4]; - __u16 sps_unused16[4]; /* available; maintaining compatible layout */ + /* lids for up to 4 infinipaths, indexed by infinipath # */ + __u16 sps_lid[4]; /* number of user ports per chip (not IB ports) */ __u32 sps_nports; /* not our interrupt, or already handled */ @@ -141,8 +140,10 @@ struct infinipath_stats { * packets if ipath not configured, sma/mad, etc.) */ __u64 sps_krdrops; + /* mlids for up to 4 infinipaths, indexed by infinipath # */ + __u16 sps_mlid[4]; /* pad for future growth */ - __u64 __sps_pad[46]; + __u64 __sps_pad[45]; }; /* @@ -309,9 +310,6 @@ struct ipath_base_info { __u32 spi_rcv_egrchunksize; /* total size of mmap to cover full rcvegrbuffers */ __u32 spi_rcv_egrbuftotlen; - __u32 spi_filler_for_align; - /* address of readonly memory copy of the rcvhdrq tail register. */ - __u64 spi_rcvhdr_tailaddr; } __attribute__ ((aligned(8))); @@ -344,9 +342,9 @@ struct ipath_base_info { /* * Similarly, this is the kernel version going back to the user. It's * slightly different, in that we want to tell if the driver was built as - * part of a QLogic release, or from the driver from openfabrics.org, - * kernel.org, or a standard distribution, for support reasons. - * The high bit is 0 for non-QLogic and 1 for QLogic-built/supplied. + * part of a PathScale release, or from the driver from OpenIB, kernel.org, + * or a standard distribution, for support reasons. The high bit is 0 for + * non-PathScale, and 1 for PathScale-built/supplied. * * It's returned by the driver to the user code during initialization in the * spi_sw_version field of ipath_base_info, so the user code can in turn @@ -381,7 +379,13 @@ struct ipath_user_info { */ __u32 spu_rcvhdrsize; - __u64 spu_unused; /* kept for compatible layout */ + /* + * cache line aligned (64 byte) user address to + * which the rcvhdrtail register will be written by infinipath + * whenever it changes, so that no chip registers are read in + * the performance path. + */ + __u64 spu_rcvhdraddr; /* * address of struct base_info to write to @@ -477,7 +481,7 @@ struct ipath_sma_pkt * Data layout in I2C flash (for GUID, etc.) * All fields are little-endian binary unless otherwise stated */ -#define IPATH_FLASH_VERSION 2 +#define IPATH_FLASH_VERSION 1 struct ipath_flash { /* flash layout version (IPATH_FLASH_VERSION) */ __u8 if_fversion; @@ -485,14 +489,14 @@ struct ipath_flash { __u8 if_csum; /* * valid length (in use, protected by if_csum), including - * if_fversion and if_csum themselves) + * if_fversion and if_sum themselves) */ __u8 if_length; /* the GUID, in network order */ __u8 if_guid[8]; /* number of GUIDs to use, starting from if_guid */ __u8 if_numguid; - /* the (last 10 characters of) board serial number, in ASCII */ + /* the board serial number, in ASCII */ char if_serial[12]; /* board mfg date (YYYYMMDD ASCII) */ char if_mfgdate[8]; @@ -504,10 +508,8 @@ struct ipath_flash { __u8 if_powerhour[2]; /* ASCII free-form comment field */ char if_comment[32]; - /* Backwards compatible prefix for longer QLogic Serial Numbers */ - char if_sprefix[4]; - /* 82 bytes used, min flash size is 128 bytes */ - __u8 if_future[46]; + /* 78 bytes used, min flash size is 128 bytes */ + __u8 if_future[50]; }; /* @@ -601,118 +603,14 @@ struct infinipath_counters { #define INFINIPATH_KPF_INTR 0x1 /* SendPIO per-buffer control */ -#define INFINIPATH_SP_TEST 0x40 -#define INFINIPATH_SP_TESTEBP 0x20 +#define INFINIPATH_SP_LENGTHP1_MASK 0x3FF +#define INFINIPATH_SP_LENGTHP1_SHIFT 0 +#define INFINIPATH_SP_INTR 0x80000000 +#define INFINIPATH_SP_TEST 0x40000000 +#define INFINIPATH_SP_TESTEBP 0x20000000 /* SendPIOAvail bits */ #define INFINIPATH_SENDPIOAVAIL_BUSY_SHIFT 1 #define INFINIPATH_SENDPIOAVAIL_CHECK_SHIFT 0 -/* infinipath header format */ -struct ipath_header { - /* - * Version - 4 bits, Port - 4 bits, TID - 10 bits and Offset - - * 14 bits before ECO change ~28 Dec 03. After that, Vers 4, - * Port 3, TID 11, offset 14. - */ - __le32 ver_port_tid_offset; - __le16 chksum; - __le16 pkt_flags; -}; - -/* infinipath user message header format. - * This structure contains the first 4 fields common to all protocols - * that employ infinipath. - */ -struct ipath_message_header { - __be16 lrh[4]; - __be32 bth[3]; - /* fields below this point are in host byte order */ - struct ipath_header iph; - __u8 sub_opcode; -}; - -/* infinipath ethernet header format */ -struct ether_header { - __be16 lrh[4]; - __be32 bth[3]; - struct ipath_header iph; - __u8 sub_opcode; - __u8 cmd; - __be16 lid; - __u16 mac[3]; - __u8 frag_num; - __u8 seq_num; - __le32 len; - /* MUST be of word size due to PIO write requirements */ - __le32 csum; - __le16 csum_offset; - __le16 flags; - __u16 first_2_bytes; - __u8 unused[2]; /* currently unused */ -}; - - -/* IB - LRH header consts */ -#define IPATH_LRH_GRH 0x0003 /* 1. word of IB LRH - next header: GRH */ -#define IPATH_LRH_BTH 0x0002 /* 1. word of IB LRH - next header: BTH */ - -/* misc. */ -#define SIZE_OF_CRC 1 - -#define IPATH_DEFAULT_P_KEY 0xFFFF -#define IPATH_PERMISSIVE_LID 0xFFFF -#define IPATH_AETH_CREDIT_SHIFT 24 -#define IPATH_AETH_CREDIT_MASK 0x1F -#define IPATH_AETH_CREDIT_INVAL 0x1F -#define IPATH_PSN_MASK 0xFFFFFF -#define IPATH_MSN_MASK 0xFFFFFF -#define IPATH_QPN_MASK 0xFFFFFF -#define IPATH_MULTICAST_LID_BASE 0xC000 -#define IPATH_MULTICAST_QPN 0xFFFFFF - -/* Receive Header Queue: receive type (from infinipath) */ -#define RCVHQ_RCV_TYPE_EXPECTED 0 -#define RCVHQ_RCV_TYPE_EAGER 1 -#define RCVHQ_RCV_TYPE_NON_KD 2 -#define RCVHQ_RCV_TYPE_ERROR 3 - - -/* sub OpCodes - ith4x */ -#define IPATH_ITH4X_OPCODE_ENCAP 0x81 -#define IPATH_ITH4X_OPCODE_LID_ARP 0x82 - -#define IPATH_HEADER_QUEUE_WORDS 9 - -/* functions for extracting fields from rcvhdrq entries for the driver. - */ -static inline __u32 ipath_hdrget_err_flags(const __le32 * rbuf) -{ - return __le32_to_cpu(rbuf[1]); -} - -static inline __u32 ipath_hdrget_rcv_type(const __le32 * rbuf) -{ - return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_RCVTYPE_SHIFT) - & INFINIPATH_RHF_RCVTYPE_MASK; -} - -static inline __u32 ipath_hdrget_length_in_bytes(const __le32 * rbuf) -{ - return ((__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_LENGTH_SHIFT) - & INFINIPATH_RHF_LENGTH_MASK) << 2; -} - -static inline __u32 ipath_hdrget_index(const __le32 * rbuf) -{ - return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_EGRINDEX_SHIFT) - & INFINIPATH_RHF_EGRINDEX_MASK; -} - -static inline __u32 ipath_hdrget_ipath_ver(__le32 hdrword) -{ - return (__le32_to_cpu(hdrword) >> INFINIPATH_I_VERS_SHIFT) - & INFINIPATH_I_VERS_MASK; -} - #endif /* _IPATH_COMMON_H */ diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_cq.c b/trunk/drivers/infiniband/hw/ipath/ipath_cq.c index 3efee341c9bc..7ece1135ddfe 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_cq.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_cq.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -158,21 +157,10 @@ struct ib_cq *ipath_create_cq(struct ib_device *ibdev, int entries, struct ib_ucontext *context, struct ib_udata *udata) { - struct ipath_ibdev *dev = to_idev(ibdev); struct ipath_cq *cq; struct ib_wc *wc; struct ib_cq *ret; - if (entries > ib_ipath_max_cqes) { - ret = ERR_PTR(-EINVAL); - goto bail; - } - - if (dev->n_cqs_allocated == ib_ipath_max_cqs) { - ret = ERR_PTR(-ENOMEM); - goto bail; - } - /* * Need to use vmalloc() if we want to support large #s of * entries. @@ -208,8 +196,6 @@ struct ib_cq *ipath_create_cq(struct ib_device *ibdev, int entries, ret = &cq->ibcq; - dev->n_cqs_allocated++; - bail: return ret; } @@ -224,11 +210,9 @@ struct ib_cq *ipath_create_cq(struct ib_device *ibdev, int entries, */ int ipath_destroy_cq(struct ib_cq *ibcq) { - struct ipath_ibdev *dev = to_idev(ibcq->device); struct ipath_cq *cq = to_icq(ibcq); tasklet_kill(&cq->comptask); - dev->n_cqs_allocated--; vfree(cq->queue); kfree(cq); diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_debug.h b/trunk/drivers/infiniband/hw/ipath/ipath_debug.h index f415beda0d32..46762387f5f8 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_debug.h +++ b/trunk/drivers/infiniband/hw/ipath/ipath_debug.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_diag.c b/trunk/drivers/infiniband/hw/ipath/ipath_diag.c index 147dd89e21c9..28ddceb260e8 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_diag.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_diag.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -44,9 +43,10 @@ #include #include +#include "ipath_common.h" #include "ipath_kernel.h" +#include "ips_common.h" #include "ipath_layer.h" -#include "ipath_common.h" int ipath_diag_inuse; static int diag_set_link; @@ -66,20 +66,18 @@ static struct file_operations diag_file_ops = { .release = ipath_diag_release }; -int ipath_diag_add(struct ipath_devdata *dd) -{ - char name[16]; - - snprintf(name, sizeof(name), "ipath_diag%d", dd->ipath_unit); +static struct cdev *diag_cdev; +static struct class_device *diag_class_dev; - return ipath_cdev_init(IPATH_DIAG_MINOR_BASE + dd->ipath_unit, name, - &diag_file_ops, &dd->diag_cdev, - &dd->diag_class_dev); +int ipath_diag_init(void) +{ + return ipath_cdev_init(IPATH_DIAG_MINOR, "ipath_diag", + &diag_file_ops, &diag_cdev, &diag_class_dev); } -void ipath_diag_remove(struct ipath_devdata *dd) +void ipath_diag_cleanup(void) { - ipath_cdev_cleanup(&dd->diag_cdev, &dd->diag_class_dev); + ipath_cdev_cleanup(&diag_cdev, &diag_class_dev); } /** @@ -103,7 +101,8 @@ static int ipath_read_umem64(struct ipath_devdata *dd, void __user *uaddr, int ret; /* not very efficient, but it works for now */ - if (reg_addr < dd->ipath_kregbase || reg_end > dd->ipath_kregend) { + if (reg_addr < dd->ipath_kregbase || + reg_end > dd->ipath_kregend) { ret = -EINVAL; goto bail; } @@ -114,7 +113,7 @@ static int ipath_read_umem64(struct ipath_devdata *dd, void __user *uaddr, goto bail; } reg_addr++; - uaddr += sizeof(u64); + uaddr++; } ret = 0; bail: @@ -140,7 +139,8 @@ static int ipath_write_umem64(struct ipath_devdata *dd, void __iomem *caddr, int ret; /* not very efficient, but it works for now */ - if (reg_addr < dd->ipath_kregbase || reg_end > dd->ipath_kregend) { + if (reg_addr < dd->ipath_kregbase || + reg_end > dd->ipath_kregend) { ret = -EINVAL; goto bail; } @@ -153,7 +153,7 @@ static int ipath_write_umem64(struct ipath_devdata *dd, void __iomem *caddr, writeq(data, reg_addr); reg_addr++; - uaddr += sizeof(u64); + uaddr++; } ret = 0; bail: @@ -191,8 +191,7 @@ static int ipath_read_umem32(struct ipath_devdata *dd, void __user *uaddr, } reg_addr++; - uaddr += sizeof(u32); - + uaddr++; } ret = 0; bail: @@ -231,7 +230,7 @@ static int ipath_write_umem32(struct ipath_devdata *dd, void __iomem *caddr, writel(data, reg_addr); reg_addr++; - uaddr += sizeof(u32); + uaddr++; } ret = 0; bail: @@ -240,45 +239,59 @@ static int ipath_write_umem32(struct ipath_devdata *dd, void __iomem *caddr, static int ipath_diag_open(struct inode *in, struct file *fp) { - int unit = iminor(in) - IPATH_DIAG_MINOR_BASE; struct ipath_devdata *dd; + int unit = 0; /* XXX this is bogus */ + unsigned long flags; int ret; + dd = ipath_lookup(unit); + mutex_lock(&ipath_mutex); + spin_lock_irqsave(&ipath_devs_lock, flags); if (ipath_diag_inuse) { ret = -EBUSY; goto bail; } - dd = ipath_lookup(unit); - - if (dd == NULL || !(dd->ipath_flags & IPATH_PRESENT) || - !dd->ipath_kregbase) { - ret = -ENODEV; + list_for_each_entry(dd, &ipath_dev_list, ipath_list) { + /* + * we need at least one infinipath device to be present + * (don't use INITTED, because we want to be able to open + * even if device is in freeze mode, which cleared INITTED). + * There is a small amount of risk to this, which is why we + * also verify kregbase is set. + */ + + if (!(dd->ipath_flags & IPATH_PRESENT) || + !dd->ipath_kregbase) + continue; + + ipath_diag_inuse = 1; + diag_set_link = 0; + ret = 0; goto bail; } - fp->private_data = dd; - ipath_diag_inuse = 1; - diag_set_link = 0; - ret = 0; + ret = -ENODEV; + +bail: + spin_unlock_irqrestore(&ipath_devs_lock, flags); /* Only expose a way to reset the device if we make it into diag mode. */ - ipath_expose_reset(&dd->pcidev->dev); + if (ret == 0) + ipath_expose_reset(&dd->pcidev->dev); -bail: mutex_unlock(&ipath_mutex); return ret; } -static int ipath_diag_release(struct inode *in, struct file *fp) +static int ipath_diag_release(struct inode *i, struct file *f) { mutex_lock(&ipath_mutex); ipath_diag_inuse = 0; - fp->private_data = NULL; mutex_unlock(&ipath_mutex); return 0; } @@ -286,10 +299,17 @@ static int ipath_diag_release(struct inode *in, struct file *fp) static ssize_t ipath_diag_read(struct file *fp, char __user *data, size_t count, loff_t *off) { - struct ipath_devdata *dd = fp->private_data; + int unit = 0; /* XXX provide for reads on other units some day */ + struct ipath_devdata *dd; void __iomem *kreg_base; ssize_t ret; + dd = ipath_lookup(unit); + if (!dd) { + ret = -ENODEV; + goto bail; + } + kreg_base = dd->ipath_kregbase; if (count == 0) @@ -308,16 +328,23 @@ static ssize_t ipath_diag_read(struct file *fp, char __user *data, ret = count; } +bail: return ret; } static ssize_t ipath_diag_write(struct file *fp, const char __user *data, size_t count, loff_t *off) { - struct ipath_devdata *dd = fp->private_data; + int unit = 0; /* XXX this is bogus */ + struct ipath_devdata *dd; void __iomem *kreg_base; ssize_t ret; + dd = ipath_lookup(unit); + if (!dd) { + ret = -ENODEV; + goto bail; + } kreg_base = dd->ipath_kregbase; if (count == 0) @@ -336,5 +363,6 @@ static ssize_t ipath_diag_write(struct file *fp, const char __user *data, ret = count; } +bail: return ret; } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_driver.c b/trunk/drivers/infiniband/hw/ipath/ipath_driver.c index 823131d58b34..e4b897fa569a 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_driver.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -39,8 +38,8 @@ #include #include "ipath_kernel.h" +#include "ips_common.h" #include "ipath_layer.h" -#include "ipath_common.h" static void ipath_update_pio_bufs(struct ipath_devdata *); @@ -53,7 +52,7 @@ const char *ipath_get_unit_name(int unit) EXPORT_SYMBOL_GPL(ipath_get_unit_name); -#define DRIVER_LOAD_MSG "QLogic " IPATH_DRV_NAME " loaded: " +#define DRIVER_LOAD_MSG "PathScale " IPATH_DRV_NAME " loaded: " #define PFX IPATH_DRV_NAME ": " /* @@ -75,8 +74,8 @@ MODULE_PARM_DESC(debug, "mask for debug prints"); EXPORT_SYMBOL_GPL(ipath_debug); MODULE_LICENSE("GPL"); -MODULE_AUTHOR("QLogic "); -MODULE_DESCRIPTION("QLogic InfiniPath driver"); +MODULE_AUTHOR("PathScale "); +MODULE_DESCRIPTION("Pathscale InfiniPath driver"); const char *ipath_ibcstatus_str[] = { "Disabled", @@ -131,6 +130,14 @@ static struct pci_driver ipath_driver = { .id_table = ipath_pci_tbl, }; +/* + * This is where port 0's rcvhdrtail register is written back; we also + * want nothing else sharing the cache line, so make it a cache line + * in size. Used for all units. + */ +volatile __le64 *ipath_port0_rcvhdrtail; +dma_addr_t ipath_port0_rcvhdrtail_dma; +static int port0_rcvhdrtail_refs; static inline void read_bars(struct ipath_devdata *dd, struct pci_dev *dev, u32 *bar0, u32 *bar1) @@ -163,13 +170,14 @@ static void ipath_free_devdata(struct pci_dev *pdev, list_del(&dd->ipath_list); spin_unlock_irqrestore(&ipath_devs_lock, flags); } - vfree(dd); + dma_free_coherent(&pdev->dev, sizeof(*dd), dd, dd->ipath_dma_addr); } static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev) { unsigned long flags; struct ipath_devdata *dd; + dma_addr_t dma_addr; int ret; if (!idr_pre_get(&unit_table, GFP_KERNEL)) { @@ -177,12 +185,15 @@ static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev) goto bail; } - dd = vmalloc(sizeof(*dd)); + dd = dma_alloc_coherent(&pdev->dev, sizeof(*dd), &dma_addr, + GFP_KERNEL); + if (!dd) { dd = ERR_PTR(-ENOMEM); goto bail; } - memset(dd, 0, sizeof(*dd)); + + dd->ipath_dma_addr = dma_addr; dd->ipath_unit = -1; spin_lock_irqsave(&ipath_devs_lock, flags); @@ -260,6 +271,47 @@ int ipath_count_units(int *npresentp, int *nupp, u32 *maxportsp) return nunits; } +static int init_port0_rcvhdrtail(struct pci_dev *pdev) +{ + int ret; + + mutex_lock(&ipath_mutex); + + if (!ipath_port0_rcvhdrtail) { + ipath_port0_rcvhdrtail = + dma_alloc_coherent(&pdev->dev, + IPATH_PORT0_RCVHDRTAIL_SIZE, + &ipath_port0_rcvhdrtail_dma, + GFP_KERNEL); + + if (!ipath_port0_rcvhdrtail) { + ret = -ENOMEM; + goto bail; + } + } + port0_rcvhdrtail_refs++; + ret = 0; + +bail: + mutex_unlock(&ipath_mutex); + + return ret; +} + +static void cleanup_port0_rcvhdrtail(struct pci_dev *pdev) +{ + mutex_lock(&ipath_mutex); + + if (!--port0_rcvhdrtail_refs) { + dma_free_coherent(&pdev->dev, IPATH_PORT0_RCVHDRTAIL_SIZE, + (void *) ipath_port0_rcvhdrtail, + ipath_port0_rcvhdrtail_dma); + ipath_port0_rcvhdrtail = NULL; + } + + mutex_unlock(&ipath_mutex); +} + /* * These next two routines are placeholders in case we don't have per-arch * code for controlling write combining. If explicit control of write @@ -284,12 +336,20 @@ static int __devinit ipath_init_one(struct pci_dev *pdev, u32 bar0 = 0, bar1 = 0; u8 rev; + ret = init_port0_rcvhdrtail(pdev); + if (ret < 0) { + printk(KERN_ERR IPATH_DRV_NAME + ": Could not allocate port0_rcvhdrtail: error %d\n", + -ret); + goto bail; + } + dd = ipath_alloc_devdata(pdev); if (IS_ERR(dd)) { ret = PTR_ERR(dd); printk(KERN_ERR IPATH_DRV_NAME ": Could not allocate devdata: error %d\n", -ret); - goto bail; + goto bail_rcvhdrtail; } ipath_cdbg(VERBOSE, "initializing unit #%u\n", dd->ipath_unit); @@ -364,29 +424,12 @@ static int __devinit ipath_init_one(struct pci_dev *pdev, */ ret = pci_set_dma_mask(pdev, DMA_32BIT_MASK); if (ret) { - dev_info(&pdev->dev, - "Unable to set DMA mask for unit %u: %d\n", - dd->ipath_unit, ret); + dev_info(&pdev->dev, "pci_set_dma_mask unit %u " + "fails: %d\n", dd->ipath_unit, ret); goto bail_regions; } - else { + else ipath_dbg("No 64bit DMA mask, used 32 bit mask\n"); - ret = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); - if (ret) - dev_info(&pdev->dev, - "Unable to set DMA consistent mask " - "for unit %u: %d\n", - dd->ipath_unit, ret); - - } - } - else { - ret = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); - if (ret) - dev_info(&pdev->dev, - "Unable to set DMA consistent mask " - "for unit %u: %d\n", - dd->ipath_unit, ret); } pci_set_master(pdev); @@ -409,7 +452,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev, ipath_init_pe800_funcs(dd); break; default: - ipath_dev_err(dd, "Found unknown QLogic deviceid 0x%x, " + ipath_dev_err(dd, "Found unknown PathScale deviceid 0x%x, " "failing\n", ent->device); return -ENODEV; } @@ -452,23 +495,23 @@ static int __devinit ipath_init_one(struct pci_dev *pdev, ((void __iomem *)dd->ipath_kregbase + len); dd->ipath_physaddr = addr; /* used for io_remap, etc. */ /* for user mmap */ - ipath_cdbg(VERBOSE, "mapped io addr %llx to kregbase %p\n", - addr, dd->ipath_kregbase); + dd->ipath_kregvirt = (u64 __iomem *) phys_to_virt(addr); + ipath_cdbg(VERBOSE, "mapped io addr %llx to kregbase %p " + "kregvirt %p\n", addr, dd->ipath_kregbase, + dd->ipath_kregvirt); /* * clear ipath_flags here instead of in ipath_init_chip as it is set * by ipath_setup_htconfig. */ dd->ipath_flags = 0; - dd->ipath_lli_counter = 0; - dd->ipath_lli_errors = 0; if (dd->ipath_f_bus(dd, pdev)) ipath_dev_err(dd, "Failed to setup config space; " "continuing anyway\n"); /* - * set up our interrupt handler; IRQF_SHARED probably not needed, + * set up our interrupt handler; SA_SHIRQ probably not needed, * since MSI interrupts shouldn't be shared but won't hurt for now. * check 0 irq after we return from chip-specific bus setup, since * that can affect this due to setup @@ -477,7 +520,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev, ipath_dev_err(dd, "irq is 0, BIOS error? Interrupts won't " "work\n"); else { - ret = request_irq(pdev->irq, ipath_intr, IRQF_SHARED, + ret = request_irq(pdev->irq, ipath_intr, SA_SHIRQ, IPATH_DRV_NAME, dd); if (ret) { ipath_dev_err(dd, "Couldn't setup irq handler, " @@ -502,7 +545,6 @@ static int __devinit ipath_init_one(struct pci_dev *pdev, ipath_device_create_group(&pdev->dev, dd); ipathfs_add_device(dd); ipath_user_add(dd); - ipath_diag_add(dd); ipath_layer_add(dd); goto bail; @@ -519,6 +561,9 @@ static int __devinit ipath_init_one(struct pci_dev *pdev, bail_devdata: ipath_free_devdata(pdev, dd); +bail_rcvhdrtail: + cleanup_port0_rcvhdrtail(pdev); + bail: return ret; } @@ -532,9 +577,8 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev) return; dd = pci_get_drvdata(pdev); - ipath_layer_remove(dd); - ipath_diag_remove(dd); - ipath_user_remove(dd); + ipath_layer_del(dd); + ipath_user_del(dd); ipathfs_remove_device(dd); ipath_device_remove_group(&pdev->dev, dd); ipath_cdbg(VERBOSE, "Releasing pci memory regions, dd %p, " @@ -550,6 +594,7 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev) pci_disable_device(pdev); ipath_free_devdata(pdev, dd); + cleanup_port0_rcvhdrtail(pdev); } /* general driver use */ @@ -823,8 +868,7 @@ static void ipath_rcv_layer(struct ipath_devdata *dd, u32 etail, u8 pad, *bthbytes; struct sk_buff *skb, *nskb; - if (dd->ipath_port0_skbs && - hdr->sub_opcode == IPATH_ITH4X_OPCODE_ENCAP) { + if (dd->ipath_port0_skbs && hdr->sub_opcode == OPCODE_ENCAP) { /* * Allocate a new sk_buff to replace the one we give * to the network stack. @@ -855,7 +899,7 @@ static void ipath_rcv_layer(struct ipath_devdata *dd, u32 etail, /* another ether packet received */ ipath_stats.sps_ether_rpkts++; } - else if (hdr->sub_opcode == IPATH_ITH4X_OPCODE_LID_ARP) + else if (hdr->sub_opcode == OPCODE_LID_ARP) __ipath_layer_rcv_lid(dd, hdr); } @@ -872,8 +916,8 @@ void ipath_kreceive(struct ipath_devdata *dd) const u32 rsize = dd->ipath_rcvhdrentsize; /* words */ const u32 maxcnt = dd->ipath_rcvhdrcnt * rsize; /* words */ u32 etail = -1, l, hdrqtail; - struct ipath_message_header *hdr; - u32 eflags, i, etype, tlen, pkttot = 0, updegr=0, reloop=0; + struct ips_message_header *hdr; + u32 eflags, i, etype, tlen, pkttot = 0; static u64 totcalls; /* stats, may eventually remove */ char emsg[128]; @@ -887,18 +931,24 @@ void ipath_kreceive(struct ipath_devdata *dd) if (test_and_set_bit(0, &dd->ipath_rcv_pending)) goto bail; - l = dd->ipath_port0head; - hdrqtail = (u32) le64_to_cpu(*dd->ipath_hdrqtailptr); - if (l == hdrqtail) + if (dd->ipath_port0head == + (u32)le64_to_cpu(*dd->ipath_hdrqtailptr)) goto done; -reloop: - for (i = 0; l != hdrqtail; i++) { +gotmore: + /* + * read only once at start. If in flood situation, this helps + * performance slightly. If more arrive while we are processing, + * we'll come back here and do them + */ + hdrqtail = (u32)le64_to_cpu(*dd->ipath_hdrqtailptr); + + for (i = 0, l = dd->ipath_port0head; l != hdrqtail; i++) { u32 qp; u8 *bthbytes; rc = (u64 *) (dd->ipath_pd[0]->port_rcvhdrq + (l << 2)); - hdr = (struct ipath_message_header *)&rc[1]; + hdr = (struct ips_message_header *)&rc[1]; /* * could make a network order version of IPATH_KD_QP, and * do the obvious shift before masking to speed this up. @@ -906,10 +956,10 @@ void ipath_kreceive(struct ipath_devdata *dd) qp = ntohl(hdr->bth[1]) & 0xffffff; bthbytes = (u8 *) hdr->bth; - eflags = ipath_hdrget_err_flags((__le32 *) rc); - etype = ipath_hdrget_rcv_type((__le32 *) rc); + eflags = ips_get_hdr_err_flags((__le32 *) rc); + etype = ips_get_rcv_type((__le32 *) rc); /* total length */ - tlen = ipath_hdrget_length_in_bytes((__le32 *) rc); + tlen = ips_get_length_in_bytes((__le32 *) rc); ebuf = NULL; if (etype != RCVHQ_RCV_TYPE_EXPECTED) { /* @@ -919,7 +969,7 @@ void ipath_kreceive(struct ipath_devdata *dd) * set ebuf (so we try to copy data) unless the * length requires it. */ - etail = ipath_hdrget_index((__le32 *) rc); + etail = ips_get_index((__le32 *) rc); if (tlen > sizeof(*hdr) || etype == RCVHQ_RCV_TYPE_NON_KD) ebuf = ipath_get_egrbuf(dd, etail, 0); @@ -931,7 +981,7 @@ void ipath_kreceive(struct ipath_devdata *dd) */ if (etype != RCVHQ_RCV_TYPE_NON_KD && etype != - RCVHQ_RCV_TYPE_ERROR && ipath_hdrget_ipath_ver( + RCVHQ_RCV_TYPE_ERROR && ips_get_ipath_ver( hdr->iph.ver_port_tid_offset) != IPS_PROTO_VERSION) { ipath_cdbg(PKT, "Bad InfiniPath protocol version " @@ -944,19 +994,7 @@ void ipath_kreceive(struct ipath_devdata *dd) ipath_cdbg(PKT, "RHFerrs %x hdrqtail=%x typ=%u " "tlen=%x opcode=%x egridx=%x: %s\n", eflags, l, etype, tlen, bthbytes[0], - ipath_hdrget_index((__le32 *) rc), emsg); - /* Count local link integrity errors. */ - if (eflags & (INFINIPATH_RHF_H_ICRCERR | - INFINIPATH_RHF_H_VCRCERR)) { - u8 n = (dd->ipath_ibcctrl >> - INFINIPATH_IBCC_PHYERRTHRESHOLD_SHIFT) & - INFINIPATH_IBCC_PHYERRTHRESHOLD_MASK; - - if (++dd->ipath_lli_counter > n) { - dd->ipath_lli_counter = 0; - dd->ipath_lli_errors++; - } - } + ips_get_index((__le32 *) rc), emsg); } else if (etype == RCVHQ_RCV_TYPE_NON_KD) { int ret = __ipath_verbs_rcv(dd, rc + 1, ebuf, tlen); @@ -964,9 +1002,6 @@ void ipath_kreceive(struct ipath_devdata *dd) ipath_cdbg(VERBOSE, "received IB packet, " "not SMA (QP=%x)\n", qp); - if (dd->ipath_lli_counter) - dd->ipath_lli_counter--; - } else if (etype == RCVHQ_RCV_TYPE_EAGER) { if (qp == IPATH_KD_QP && bthbytes[0] == ipath_layer_rcv_opcode && @@ -1019,49 +1054,25 @@ void ipath_kreceive(struct ipath_devdata *dd) l += rsize; if (l >= maxcnt) l = 0; - if (etype != RCVHQ_RCV_TYPE_EXPECTED) - updegr = 1; /* - * update head regs on last packet, and every 16 packets. - * Reduce bus traffic, while still trying to prevent - * rcvhdrq overflows, for when the queue is nearly full + * update for each packet, to help prevent overflows if we + * have lots of packets. */ - if (l == hdrqtail || (i && !(i&0xf))) { - u64 lval; - if (l == hdrqtail) /* PE-800 interrupt only on last */ - lval = dd->ipath_rhdrhead_intr_off | l; - else - lval = l; - (void)ipath_write_ureg(dd, ur_rcvhdrhead, lval, 0); - if (updegr) { - (void)ipath_write_ureg(dd, ur_rcvegrindexhead, - etail, 0); - updegr = 0; - } - } - } - - if (!dd->ipath_rhdrhead_intr_off && !reloop) { - /* HT-400 workaround; we can have a race clearing chip - * interrupt with another interrupt about to be delivered, - * and can clear it before it is delivered on the GPIO - * workaround. By doing the extra check here for the - * in-memory tail register updating while we were doing - * earlier packets, we "almost" guarantee we have covered - * that case. - */ - u32 hqtail = (u32)le64_to_cpu(*dd->ipath_hdrqtailptr); - if (hqtail != hdrqtail) { - hdrqtail = hqtail; - reloop = 1; /* loop 1 extra time at most */ - goto reloop; - } + (void)ipath_write_ureg(dd, ur_rcvhdrhead, + dd->ipath_rhdrhead_intr_off | l, 0); + if (etype != RCVHQ_RCV_TYPE_EXPECTED) + (void)ipath_write_ureg(dd, ur_rcvegrindexhead, + etail, 0); } pkttot += i; dd->ipath_port0head = l; + if (hdrqtail != (u32)le64_to_cpu(*dd->ipath_hdrqtailptr)) + /* more arrived while we handled first batch */ + goto gotmore; + if (pkttot > ipath_stats.sps_maxpkts_call) ipath_stats.sps_maxpkts_call = pkttot; ipath_stats.sps_port0pkts += pkttot; @@ -1358,20 +1369,26 @@ u32 __iomem *ipath_getpiobuf(struct ipath_devdata *dd, u32 * pbufnum) * @dd: the infinipath device * @pd: the port data * - * this must be contiguous memory (from an i/o perspective), and must be - * DMA'able (which means for some systems, it will go through an IOMMU, - * or be forced into a low address range). + * this *must* be physically contiguous memory, and for now, + * that limits it to what kmalloc can do. */ int ipath_create_rcvhdrq(struct ipath_devdata *dd, struct ipath_portdata *pd) { - int ret = 0; + int ret = 0, amt; + amt = ALIGN(dd->ipath_rcvhdrcnt * dd->ipath_rcvhdrentsize * + sizeof(u32), PAGE_SIZE); if (!pd->port_rcvhdrq) { - dma_addr_t phys_hdrqtail; + /* + * not using REPEAT isn't viable; at 128KB, we can easily + * fail this. The problem with REPEAT is we can block here + * "forever". There isn't an inbetween, unfortunately. We + * could reduce the risk by never freeing the rcvhdrq except + * at unload, but even then, the first time a port is used, + * we could delay for some time... + */ gfp_t gfp_flags = GFP_USER | __GFP_COMP; - int amt = ALIGN(dd->ipath_rcvhdrcnt * dd->ipath_rcvhdrentsize * - sizeof(u32), PAGE_SIZE); pd->port_rcvhdrq = dma_alloc_coherent( &dd->pcidev->dev, amt, &pd->port_rcvhdrq_phys, @@ -1384,16 +1401,6 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd, ret = -ENOMEM; goto bail; } - pd->port_rcvhdrtail_kvaddr = dma_alloc_coherent( - &dd->pcidev->dev, PAGE_SIZE, &phys_hdrqtail, GFP_KERNEL); - if (!pd->port_rcvhdrtail_kvaddr) { - ipath_dev_err(dd, "attempt to allocate 1 page " - "for port %u rcvhdrqtailaddr failed\n", - pd->port_port); - ret = -ENOMEM; - goto bail; - } - pd->port_rcvhdrqtailaddr_phys = phys_hdrqtail; pd->port_rcvhdrq_size = amt; @@ -1403,28 +1410,20 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd, (unsigned long) pd->port_rcvhdrq_phys, (unsigned long) pd->port_rcvhdrq_size, pd->port_port); - - ipath_cdbg(VERBOSE, "port %d hdrtailaddr, %llx physical\n", - pd->port_port, - (unsigned long long) phys_hdrqtail); + } else { + /* + * clear for security, sanity, and/or debugging, each + * time we reuse + */ + memset(pd->port_rcvhdrq, 0, amt); } - else - ipath_cdbg(VERBOSE, "reuse port %d rcvhdrq @%p %llx phys; " - "hdrtailaddr@%p %llx physical\n", - pd->port_port, pd->port_rcvhdrq, - pd->port_rcvhdrq_phys, pd->port_rcvhdrtail_kvaddr, - (unsigned long long)pd->port_rcvhdrqtailaddr_phys); - - /* clear for security and sanity on each use */ - memset(pd->port_rcvhdrq, 0, pd->port_rcvhdrq_size); - memset((void *)pd->port_rcvhdrtail_kvaddr, 0, PAGE_SIZE); /* * tell chip each time we init it, even if we are re-using previous - * memory (we zero the register at process close) + * memory (we zero it at process close) */ - ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdrtailaddr, - pd->port_port, pd->port_rcvhdrqtailaddr_phys); + ipath_cdbg(VERBOSE, "writing port %d rcvhdraddr as %lx\n", + pd->port_port, (unsigned long) pd->port_rcvhdrq_phys); ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdraddr, pd->port_port, pd->port_rcvhdrq_phys); @@ -1512,27 +1511,15 @@ void ipath_set_ib_lstate(struct ipath_devdata *dd, int which) [INFINIPATH_IBCC_LINKCMD_ARMED] = "ARMED", [INFINIPATH_IBCC_LINKCMD_ACTIVE] = "ACTIVE" }; - int linkcmd = (which >> INFINIPATH_IBCC_LINKCMD_SHIFT) & - INFINIPATH_IBCC_LINKCMD_MASK; - ipath_cdbg(SMA, "Trying to move unit %u to %s, current ltstate " "is %s\n", dd->ipath_unit, - what[linkcmd], + what[(which >> INFINIPATH_IBCC_LINKCMD_SHIFT) & + INFINIPATH_IBCC_LINKCMD_MASK], ipath_ibcstatus_str[ (ipath_read_kreg64 (dd, dd->ipath_kregs->kr_ibcstatus) >> INFINIPATH_IBCS_LINKTRAININGSTATE_SHIFT) & INFINIPATH_IBCS_LINKTRAININGSTATE_MASK]); - /* flush all queued sends when going to DOWN or INIT, to be sure that - * they don't block SMA and other MAD packets */ - if (!linkcmd || linkcmd == INFINIPATH_IBCC_LINKCMD_INIT) { - ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, - INFINIPATH_S_ABORT); - ipath_disarm_piobufs(dd, dd->ipath_lastport_piobuf, - (unsigned)(dd->ipath_piobcnt2k + - dd->ipath_piobcnt4k) - - dd->ipath_lastport_piobuf); - } ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl, dd->ipath_ibcctrl | which); @@ -1651,7 +1638,7 @@ void ipath_shutdown_device(struct ipath_devdata *dd) /* disable IBC */ dd->ipath_control &= ~INFINIPATH_C_LINKENABLE; ipath_write_kreg(dd, dd->ipath_kregs->kr_control, - dd->ipath_control | INFINIPATH_C_FREEZEMODE); + dd->ipath_control); /* * clear SerdesEnable and turn the leds off; do this here because @@ -1680,54 +1667,60 @@ void ipath_shutdown_device(struct ipath_devdata *dd) /** * ipath_free_pddata - free a port's allocated data * @dd: the infinipath device - * @pd: the portdata structure + * @port: the port + * @freehdrq: free the port data structure if true * - * free up any allocated data for a port - * This should not touch anything that would affect a simultaneous - * re-allocation of port data, because it is called after ipath_mutex - * is released (and can be called from reinit as well). - * It should never change any chip state, or global driver state. - * (The only exception to global state is freeing the port0 port0_skbs.) + * when closing, free up any allocated data for a port, if the + * reference count goes to zero + * Note: this also optionally frees the portdata itself! + * Any changes here have to be matched up with the reinit case + * of ipath_init_chip(), which calls this routine on reinit after reset. */ -void ipath_free_pddata(struct ipath_devdata *dd, struct ipath_portdata *pd) +void ipath_free_pddata(struct ipath_devdata *dd, u32 port, int freehdrq) { + struct ipath_portdata *pd = dd->ipath_pd[port]; + if (!pd) return; - - if (pd->port_rcvhdrq) { + if (freehdrq) + /* + * only clear and free portdata if we are going to also + * release the hdrq, otherwise we leak the hdrq on each + * open/close cycle + */ + dd->ipath_pd[port] = NULL; + if (freehdrq && pd->port_rcvhdrq) { ipath_cdbg(VERBOSE, "free closed port %d rcvhdrq @ %p " "(size=%lu)\n", pd->port_port, pd->port_rcvhdrq, (unsigned long) pd->port_rcvhdrq_size); dma_free_coherent(&dd->pcidev->dev, pd->port_rcvhdrq_size, pd->port_rcvhdrq, pd->port_rcvhdrq_phys); pd->port_rcvhdrq = NULL; - if (pd->port_rcvhdrtail_kvaddr) { - dma_free_coherent(&dd->pcidev->dev, PAGE_SIZE, - (void *)pd->port_rcvhdrtail_kvaddr, - pd->port_rcvhdrqtailaddr_phys); - pd->port_rcvhdrtail_kvaddr = NULL; - } } - if (pd->port_port && pd->port_rcvegrbuf) { - unsigned e; - - for (e = 0; e < pd->port_rcvegrbuf_chunks; e++) { - void *base = pd->port_rcvegrbuf[e]; - size_t size = pd->port_rcvegrbuf_size; - - ipath_cdbg(VERBOSE, "egrbuf free(%p, %lu), " - "chunk %u/%u\n", base, - (unsigned long) size, - e, pd->port_rcvegrbuf_chunks); - dma_free_coherent(&dd->pcidev->dev, size, - base, pd->port_rcvegrbuf_phys[e]); + if (port && pd->port_rcvegrbuf) { + /* always free this */ + if (pd->port_rcvegrbuf) { + unsigned e; + + for (e = 0; e < pd->port_rcvegrbuf_chunks; e++) { + void *base = pd->port_rcvegrbuf[e]; + size_t size = pd->port_rcvegrbuf_size; + + ipath_cdbg(VERBOSE, "egrbuf free(%p, %lu), " + "chunk %u/%u\n", base, + (unsigned long) size, + e, pd->port_rcvegrbuf_chunks); + dma_free_coherent( + &dd->pcidev->dev, size, base, + pd->port_rcvegrbuf_phys[e]); + } + vfree(pd->port_rcvegrbuf); + pd->port_rcvegrbuf = NULL; + vfree(pd->port_rcvegrbuf_phys); + pd->port_rcvegrbuf_phys = NULL; } - vfree(pd->port_rcvegrbuf); - pd->port_rcvegrbuf = NULL; - vfree(pd->port_rcvegrbuf_phys); - pd->port_rcvegrbuf_phys = NULL; pd->port_rcvegrbuf_chunks = 0; - } else if (pd->port_port == 0 && dd->ipath_port0_skbs) { + } else if (port == 0 && dd->ipath_port0_skbs) { unsigned e; struct sk_buff **skbs = dd->ipath_port0_skbs; @@ -1739,8 +1732,10 @@ void ipath_free_pddata(struct ipath_devdata *dd, struct ipath_portdata *pd) dev_kfree_skb(skbs[e]); vfree(skbs); } - kfree(pd->port_tid_pg_list); - kfree(pd); + if (freehdrq) { + kfree(pd->port_tid_pg_list); + kfree(pd); + } } static int __init infinipath_init(void) @@ -1811,6 +1806,7 @@ static void cleanup_device(struct ipath_devdata *dd) * re-init */ dd->ipath_kregbase = NULL; + dd->ipath_kregvirt = NULL; dd->ipath_uregbase = 0; dd->ipath_sregbase = 0; dd->ipath_cregbase = 0; @@ -1825,12 +1821,6 @@ static void cleanup_device(struct ipath_devdata *dd) dd->ipath_pioavailregs_phys); dd->ipath_pioavailregs_dma = NULL; } - if (dd->ipath_dummy_hdrq) { - dma_free_coherent(&dd->pcidev->dev, - dd->ipath_pd[0]->port_rcvhdrq_size, - dd->ipath_dummy_hdrq, dd->ipath_dummy_hdrq_phys); - dd->ipath_dummy_hdrq = NULL; - } if (dd->ipath_pageshadow) { struct page **tmpp = dd->ipath_pageshadow; @@ -1871,14 +1861,10 @@ static void cleanup_device(struct ipath_devdata *dd) /* * free any resources still in use (usually just kernel ports) - * at unload; we do for portcnt, not cfgports, because cfgports - * could have changed while we were loaded. + * at unload */ - for (port = 0; port < dd->ipath_portcnt; port++) { - struct ipath_portdata *pd = dd->ipath_pd[port]; - dd->ipath_pd[port] = NULL; - ipath_free_pddata(dd, pd); - } + for (port = 0; port < dd->ipath_cfgports; port++) + ipath_free_pddata(dd, port, 1); kfree(dd->ipath_pd); /* * debuggability, in case some cleanup path tries to use it diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_eeprom.c b/trunk/drivers/infiniband/hw/ipath/ipath_eeprom.c index 3313356ab93a..a2f1ceafcca9 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_eeprom.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_eeprom.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -601,31 +600,8 @@ void ipath_get_eeprom_info(struct ipath_devdata *dd) guid = *(__be64 *) ifp->if_guid; dd->ipath_guid = guid; dd->ipath_nguid = ifp->if_numguid; - /* - * Things are slightly complicated by the desire to transparently - * support both the Pathscale 10-digit serial number and the QLogic - * 13-character version. - */ - if ((ifp->if_fversion > 1) && ifp->if_sprefix[0] - && ((u8 *)ifp->if_sprefix)[0] != 0xFF) { - /* This board has a Serial-prefix, which is stored - * elsewhere for backward-compatibility. - */ - char *snp = dd->ipath_serial; - int len; - memcpy(snp, ifp->if_sprefix, sizeof ifp->if_sprefix); - snp[sizeof ifp->if_sprefix] = '\0'; - len = strlen(snp); - snp += len; - len = (sizeof dd->ipath_serial) - len; - if (len > sizeof ifp->if_serial) { - len = sizeof ifp->if_serial; - } - memcpy(snp, ifp->if_serial, len); - } else - memcpy(dd->ipath_serial, ifp->if_serial, - sizeof ifp->if_serial); - + memcpy(dd->ipath_serial, ifp->if_serial, + sizeof(ifp->if_serial)); ipath_cdbg(VERBOSE, "Initted GUID to %llx from eeprom\n", (unsigned long long) be64_to_cpu(dd->ipath_guid)); diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c b/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c index bbaa70e57db1..ada267e41f6c 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -39,8 +38,8 @@ #include #include "ipath_kernel.h" +#include "ips_common.h" #include "ipath_layer.h" -#include "ipath_common.h" static int ipath_open(struct inode *, struct file *); static int ipath_close(struct inode *, struct file *); @@ -123,7 +122,6 @@ static int ipath_get_base_info(struct ipath_portdata *pd, * on to yet another method of dealing with this */ kinfo->spi_rcvhdr_base = (u64) pd->port_rcvhdrq_phys; - kinfo->spi_rcvhdr_tailaddr = (u64)pd->port_rcvhdrqtailaddr_phys; kinfo->spi_rcv_egrbufs = (u64) pd->port_rcvegr_phys; kinfo->spi_pioavailaddr = (u64) dd->ipath_pioavailregs_phys; kinfo->spi_status = (u64) kinfo->spi_pioavailaddr + @@ -458,7 +456,7 @@ static int ipath_set_part_key(struct ipath_portdata *pd, u16 key) u16 lkey = key & 0x7FFF; int ret; - if (lkey == (IPATH_DEFAULT_P_KEY & 0x7FFF)) { + if (lkey == (IPS_DEFAULT_P_KEY & 0x7FFF)) { /* nothing to do; this key always valid */ ret = 0; goto bail; @@ -706,15 +704,6 @@ static int ipath_create_user_egr(struct ipath_portdata *pd) unsigned e, egrcnt, alloced, egrperchunk, chunk, egrsize, egroff; size_t size; int ret; - gfp_t gfp_flags; - - /* - * GFP_USER, but without GFP_FS, so buffer cache can be - * coalesced (we hope); otherwise, even at order 4, - * heavy filesystem activity makes these fail, and we can - * use compound pages. - */ - gfp_flags = __GFP_WAIT | __GFP_IO | __GFP_COMP; egrcnt = dd->ipath_rcvegrcnt; /* TID number offset for this port */ @@ -731,8 +720,10 @@ static int ipath_create_user_egr(struct ipath_portdata *pd) * memory pressure (creating large files and then copying them over * NFS while doing lots of MPI jobs), we hit some allocation * failures, even though we can sleep... (2.6.10) Still get - * failures at 64K. 32K is the lowest we can go without wasting - * additional memory. + * failures at 64K. 32K is the lowest we can go without waiting + * more memory again. It seems likely that the coalescing in + * free_pages, etc. still has issues (as it has had previously + * during 2.6.x development). */ size = 0x8000; alloced = ALIGN(egrsize * egrcnt, size); @@ -753,6 +744,12 @@ static int ipath_create_user_egr(struct ipath_portdata *pd) goto bail_rcvegrbuf; } for (e = 0; e < pd->port_rcvegrbuf_chunks; e++) { + /* + * GFP_USER, but without GFP_FS, so buffer cache can be + * coalesced (we hope); otherwise, even at order 4, + * heavy filesystem activity makes these fail + */ + gfp_t gfp_flags = __GFP_WAIT | __GFP_IO | __GFP_COMP; pd->port_rcvegrbuf[e] = dma_alloc_coherent( &dd->pcidev->dev, size, &pd->port_rcvegrbuf_phys[e], @@ -786,12 +783,11 @@ static int ipath_create_user_egr(struct ipath_portdata *pd) bail_rcvegrbuf_phys: for (e = 0; e < pd->port_rcvegrbuf_chunks && - pd->port_rcvegrbuf[e]; e++) { + pd->port_rcvegrbuf[e]; e++) dma_free_coherent(&dd->pcidev->dev, size, pd->port_rcvegrbuf[e], pd->port_rcvegrbuf_phys[e]); - } vfree(pd->port_rcvegrbuf_phys); pd->port_rcvegrbuf_phys = NULL; bail_rcvegrbuf: @@ -806,7 +802,10 @@ static int ipath_do_user_init(struct ipath_portdata *pd, { int ret = 0; struct ipath_devdata *dd = pd->port_dd; + u64 physaddr, uaddr, off, atmp; + struct page *pagep; u32 head32; + u64 head; /* for now, if major version is different, bail */ if ((uinfo->spu_userversion >> 16) != IPATH_USER_SWMAJOR) { @@ -831,6 +830,54 @@ static int ipath_do_user_init(struct ipath_portdata *pd, /* for now we do nothing with rcvhdrcnt: uinfo->spu_rcvhdrcnt */ + /* set up for the rcvhdr Q tail register writeback to user memory */ + if (!uinfo->spu_rcvhdraddr || + !access_ok(VERIFY_WRITE, (u64 __user *) (unsigned long) + uinfo->spu_rcvhdraddr, sizeof(u64))) { + ipath_dbg("Port %d rcvhdrtail addr %llx not valid\n", + pd->port_port, + (unsigned long long) uinfo->spu_rcvhdraddr); + ret = -EINVAL; + goto done; + } + + off = offset_in_page(uinfo->spu_rcvhdraddr); + uaddr = PAGE_MASK & (unsigned long) uinfo->spu_rcvhdraddr; + ret = ipath_get_user_pages_nocopy(uaddr, &pagep); + if (ret) { + dev_info(&dd->pcidev->dev, "Failed to lookup and lock " + "address %llx for rcvhdrtail: errno %d\n", + (unsigned long long) uinfo->spu_rcvhdraddr, -ret); + goto done; + } + ipath_stats.sps_pagelocks++; + pd->port_rcvhdrtail_uaddr = uaddr; + pd->port_rcvhdrtail_pagep = pagep; + pd->port_rcvhdrtail_kvaddr = + page_address(pagep); + pd->port_rcvhdrtail_kvaddr += off; + physaddr = page_to_phys(pagep) + off; + ipath_cdbg(VERBOSE, "port %d user addr %llx hdrtailaddr, %llx " + "physical (off=%llx)\n", + pd->port_port, + (unsigned long long) uinfo->spu_rcvhdraddr, + (unsigned long long) physaddr, (unsigned long long) off); + ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdrtailaddr, + pd->port_port, physaddr); + atmp = ipath_read_kreg64_port(dd, + dd->ipath_kregs->kr_rcvhdrtailaddr, + pd->port_port); + if (physaddr != atmp) { + ipath_dev_err(dd, + "Catastrophic software error, " + "RcvHdrTailAddr%u written as %llx, " + "read back as %llx\n", pd->port_port, + (unsigned long long) physaddr, + (unsigned long long) atmp); + ret = -EINVAL; + goto done; + } + /* for right now, kernel piobufs are at end, so port 1 is at 0 */ pd->port_piobufs = dd->ipath_piobufbase + dd->ipath_pbufsport * (pd->port_port - @@ -849,18 +896,26 @@ static int ipath_do_user_init(struct ipath_portdata *pd, ret = ipath_create_user_egr(pd); if (ret) goto done; + /* enable receives now */ + /* atomically set enable bit for this port */ + set_bit(INFINIPATH_R_PORTENABLE_SHIFT + pd->port_port, + &dd->ipath_rcvctrl); /* - * set the eager head register for this port to the current values + * set the head registers for this port to the current values * of the tail pointers, since we don't know if they were * updated on last use of the port. */ + head32 = ipath_read_ureg32(dd, ur_rcvhdrtail, pd->port_port); + head = (u64) head32; + ipath_write_ureg(dd, ur_rcvhdrhead, head, pd->port_port); head32 = ipath_read_ureg32(dd, ur_rcvegrindextail, pd->port_port); ipath_write_ureg(dd, ur_rcvegrindexhead, head32, pd->port_port); dd->ipath_lastegrheads[pd->port_port] = -1; dd->ipath_lastrcvhdrqtails[pd->port_port] = -1; - ipath_cdbg(VERBOSE, "Wrote port%d egrhead %x from tail regs\n", - pd->port_port, head32); + ipath_cdbg(VERBOSE, "Wrote port%d head %llx, egrhead %x from " + "tail regs\n", pd->port_port, + (unsigned long long) head, head32); pd->port_tidcursor = 0; /* start at beginning after open */ /* * now enable the port; the tail registers will be written to memory @@ -869,62 +924,13 @@ static int ipath_do_user_init(struct ipath_portdata *pd, * transition from 0 to 1, so clear it first, then set it as part of * enabling the port. This will (very briefly) affect any other * open ports, but it shouldn't be long enough to be an issue. - * We explictly set the in-memory copy to 0 beforehand, so we don't - * have to wait to be sure the DMA update has happened. */ - *pd->port_rcvhdrtail_kvaddr = 0ULL; - set_bit(INFINIPATH_R_PORTENABLE_SHIFT + pd->port_port, - &dd->ipath_rcvctrl); ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl, dd->ipath_rcvctrl & ~INFINIPATH_R_TAILUPD); ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl, dd->ipath_rcvctrl); -done: - return ret; -} - - -/* common code for the mappings on dma_alloc_coherent mem */ -static int ipath_mmap_mem(struct vm_area_struct *vma, - struct ipath_portdata *pd, unsigned len, - int write_ok, dma_addr_t addr, char *what) -{ - struct ipath_devdata *dd = pd->port_dd; - unsigned pfn = (unsigned long)addr >> PAGE_SHIFT; - int ret; - - if ((vma->vm_end - vma->vm_start) > len) { - dev_info(&dd->pcidev->dev, - "FAIL on %s: len %lx > %x\n", what, - vma->vm_end - vma->vm_start, len); - ret = -EFAULT; - goto bail; - } - - if (!write_ok) { - if (vma->vm_flags & VM_WRITE) { - dev_info(&dd->pcidev->dev, - "%s must be mapped readonly\n", what); - ret = -EPERM; - goto bail; - } - /* don't allow them to later change with mprotect */ - vma->vm_flags &= ~VM_MAYWRITE; - } - - ret = remap_pfn_range(vma, vma->vm_start, pfn, - len, vma->vm_page_prot); - if (ret) - dev_info(&dd->pcidev->dev, - "%s port%u mmap of %lx, %x bytes r%c failed: %d\n", - what, pd->port_port, (unsigned long)addr, len, - write_ok?'w':'o', ret); - else - ipath_cdbg(VERBOSE, "%s port%u mmaped %lx, %x bytes r%c\n", - what, pd->port_port, (unsigned long)addr, len, - write_ok?'w':'o'); -bail: +done: return ret; } @@ -934,11 +940,8 @@ static int mmap_ureg(struct vm_area_struct *vma, struct ipath_devdata *dd, unsigned long phys; int ret; - /* - * This is real hardware, so use io_remap. This is the mechanism - * for the user process to update the head registers for their port - * in the chip. - */ + /* it's the real hardware, so io_remap works */ + if ((vma->vm_end - vma->vm_start) > PAGE_SIZE) { dev_info(&dd->pcidev->dev, "FAIL mmap userreg: reqlen " "%lx > PAGE\n", vma->vm_end - vma->vm_start); @@ -964,11 +967,10 @@ static int mmap_piobufs(struct vm_area_struct *vma, int ret; /* - * When we map the PIO buffers in the chip, we want to map them as - * writeonly, no read possible. This prevents access to previous - * process data, and catches users who might try to read the i/o - * space due to a bug. + * When we map the PIO buffers, we want to map them as writeonly, no + * read possible. */ + if ((vma->vm_end - vma->vm_start) > (dd->ipath_pbufsport * dd->ipath_palign)) { dev_info(&dd->pcidev->dev, "FAIL mmap piobufs: " @@ -979,10 +981,11 @@ static int mmap_piobufs(struct vm_area_struct *vma, } phys = dd->ipath_physaddr + pd->port_piobufs; - /* - * Don't mark this as non-cached, or we don't get the + * Do *NOT* mark this as non-cached (PWT bit), or we don't get the * write combining behavior we want on the PIO buffers! + * vma->vm_page_prot = + * pgprot_noncached(vma->vm_page_prot); */ if (vma->vm_flags & VM_READ) { @@ -994,7 +997,8 @@ static int mmap_piobufs(struct vm_area_struct *vma, } /* don't allow them to later change to readable with mprotect */ - vma->vm_flags &= ~VM_MAYREAD; + + vma->vm_flags &= ~VM_MAYWRITE; vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND; ret = io_remap_pfn_range(vma, vma->vm_start, phys >> PAGE_SHIFT, @@ -1013,6 +1017,11 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma, dma_addr_t *phys; int ret; + if (!pd->port_rcvegrbuf) { + ret = -EFAULT; + goto bail; + } + size = pd->port_rcvegrbuf_size; total_size = pd->port_rcvegrbuf_chunks * size; if ((vma->vm_end - vma->vm_start) > total_size) { @@ -1030,12 +1039,13 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma, ret = -EPERM; goto bail; } - /* don't allow them to later change to writeable with mprotect */ - vma->vm_flags &= ~VM_MAYWRITE; start = vma->vm_start; phys = pd->port_rcvegrbuf_phys; + /* don't allow them to later change to writeable with mprotect */ + vma->vm_flags &= ~VM_MAYWRITE; + for (i = 0; i < pd->port_rcvegrbuf_chunks; i++, start += size) { ret = remap_pfn_range(vma, start, phys[i] >> PAGE_SHIFT, size, vma->vm_page_prot); @@ -1048,6 +1058,78 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma, return ret; } +static int mmap_rcvhdrq(struct vm_area_struct *vma, + struct ipath_portdata *pd) +{ + struct ipath_devdata *dd = pd->port_dd; + size_t total_size; + int ret; + + /* + * kmalloc'ed memory, physically contiguous; this is from + * spi_rcvhdr_base; we allow user to map read-write so they can + * write hdrq entries to allow protocol code to directly poll + * whether a hdrq entry has been written. + */ + total_size = ALIGN(dd->ipath_rcvhdrcnt * dd->ipath_rcvhdrentsize * + sizeof(u32), PAGE_SIZE); + if ((vma->vm_end - vma->vm_start) > total_size) { + dev_info(&dd->pcidev->dev, + "FAIL on rcvhdrq: reqlen %lx > actual %lx\n", + vma->vm_end - vma->vm_start, + (unsigned long) total_size); + ret = -EFAULT; + goto bail; + } + + ret = remap_pfn_range(vma, vma->vm_start, + pd->port_rcvhdrq_phys >> PAGE_SHIFT, + vma->vm_end - vma->vm_start, + vma->vm_page_prot); +bail: + return ret; +} + +static int mmap_pioavailregs(struct vm_area_struct *vma, + struct ipath_portdata *pd) +{ + struct ipath_devdata *dd = pd->port_dd; + int ret; + + /* + * when we map the PIO bufferavail registers, we want to map them as + * readonly, no write possible. + * + * kmalloc'ed memory, physically contiguous, one page only, readonly + */ + + if ((vma->vm_end - vma->vm_start) > PAGE_SIZE) { + dev_info(&dd->pcidev->dev, "FAIL on pioavailregs_dma: " + "reqlen %lx > actual %lx\n", + vma->vm_end - vma->vm_start, + (unsigned long) PAGE_SIZE); + ret = -EFAULT; + goto bail; + } + + if (vma->vm_flags & VM_WRITE) { + dev_info(&dd->pcidev->dev, + "Can't map pioavailregs as writable (flags=%lx)\n", + vma->vm_flags); + ret = -EPERM; + goto bail; + } + + /* don't allow them to later change with mprotect */ + vma->vm_flags &= ~VM_MAYWRITE; + + ret = remap_pfn_range(vma, vma->vm_start, + dd->ipath_pioavailregs_phys >> PAGE_SHIFT, + PAGE_SIZE, vma->vm_page_prot); +bail: + return ret; +} + /** * ipath_mmap - mmap various structures into user space * @fp: the file pointer @@ -1067,7 +1149,6 @@ static int ipath_mmap(struct file *fp, struct vm_area_struct *vma) pd = port_fp(fp); dd = pd->port_dd; - /* * This is the ipath_do_user_init() code, mapping the shared buffers * into the user process. The address referred to by vm_pgoff is the @@ -1077,59 +1158,28 @@ static int ipath_mmap(struct file *fp, struct vm_area_struct *vma) pgaddr = vma->vm_pgoff << PAGE_SHIFT; /* - * Must fit in 40 bits for our hardware; some checked elsewhere, - * but we'll be paranoid. Check for 0 is mostly in case one of the - * allocations failed, but user called mmap anyway. We want to catch - * that before it can match. + * note that ureg does *NOT* have the kregvirt as part of it, to be + * sure that for 32 bit programs, we don't end up trying to map a > + * 44 address. Has to match ipath_get_base_info() code that sets + * __spi_uregbase */ - if (!pgaddr || pgaddr >= (1ULL<<40)) { - ipath_dev_err(dd, "Bad phys addr %llx, start %lx, end %lx\n", - (unsigned long long)pgaddr, vma->vm_start, vma->vm_end); - return -EINVAL; - } - /* just the offset of the port user registers, not physical addr */ ureg = dd->ipath_uregbase + dd->ipath_palign * pd->port_port; ipath_cdbg(MM, "ushare: pgaddr %llx vm_start=%lx, vmlen %lx\n", (unsigned long long) pgaddr, vma->vm_start, vma->vm_end - vma->vm_start); - if (vma->vm_start & (PAGE_SIZE-1)) { - ipath_dev_err(dd, - "vm_start not aligned: %lx, end=%lx phys %lx\n", - vma->vm_start, vma->vm_end, (unsigned long)pgaddr); - ret = -EINVAL; - } - else if (pgaddr == ureg) + if (pgaddr == ureg) ret = mmap_ureg(vma, dd, ureg); else if (pgaddr == pd->port_piobufs) ret = mmap_piobufs(vma, dd, pd); else if (pgaddr == (u64) pd->port_rcvegr_phys) ret = mmap_rcvegrbufs(vma, pd); - else if (pgaddr == (u64) pd->port_rcvhdrq_phys) { - /* - * The rcvhdrq itself; readonly except on HT-400 (so have - * to allow writable mapping), multiple pages, contiguous - * from an i/o perspective. - */ - unsigned total_size = - ALIGN(dd->ipath_rcvhdrcnt * dd->ipath_rcvhdrentsize - * sizeof(u32), PAGE_SIZE); - ret = ipath_mmap_mem(vma, pd, total_size, 1, - pd->port_rcvhdrq_phys, - "rcvhdrq"); - } - else if (pgaddr == (u64)pd->port_rcvhdrqtailaddr_phys) - /* in-memory copy of rcvhdrq tail register */ - ret = ipath_mmap_mem(vma, pd, PAGE_SIZE, 0, - pd->port_rcvhdrqtailaddr_phys, - "rcvhdrq tail"); + else if (pgaddr == (u64) pd->port_rcvhdrq_phys) + ret = mmap_rcvhdrq(vma, pd); else if (pgaddr == dd->ipath_pioavailregs_phys) - /* in-memory copy of pioavail registers */ - ret = ipath_mmap_mem(vma, pd, PAGE_SIZE, 0, - dd->ipath_pioavailregs_phys, - "pioavail registers"); + ret = mmap_pioavailregs(vma, pd); else ret = -EINVAL; @@ -1392,16 +1442,16 @@ static int find_best_unit(struct file *fp) static int ipath_open(struct inode *in, struct file *fp) { - int ret, user_minor; + int ret, minor; mutex_lock(&ipath_mutex); - user_minor = iminor(in) - IPATH_USER_MINOR_BASE; + minor = iminor(in); ipath_cdbg(VERBOSE, "open on dev %lx (minor %d)\n", - (long)in->i_rdev, user_minor); + (long)in->i_rdev, minor); - if (user_minor) - ret = find_free_port(user_minor - 1, fp); + if (minor) + ret = find_free_port(minor - 1, fp); else ret = find_best_unit(fp); @@ -1486,54 +1536,53 @@ static int ipath_close(struct inode *in, struct file *fp) } if (dd->ipath_kregbase) { - int i; - /* atomically clear receive enable port. */ - clear_bit(INFINIPATH_R_PORTENABLE_SHIFT + port, - &dd->ipath_rcvctrl); - ipath_write_kreg( dd, dd->ipath_kregs->kr_rcvctrl, - dd->ipath_rcvctrl); - /* and read back from chip to be sure that nothing - * else is in flight when we do the rest */ - (void)ipath_read_kreg64(dd, dd->ipath_kregs->kr_scratch); + if (pd->port_rcvhdrtail_uaddr) { + pd->port_rcvhdrtail_uaddr = 0; + pd->port_rcvhdrtail_kvaddr = NULL; + ipath_release_user_pages_on_close( + &pd->port_rcvhdrtail_pagep, 1); + pd->port_rcvhdrtail_pagep = NULL; + ipath_stats.sps_pageunlocks++; + } + ipath_write_kreg_port( + dd, dd->ipath_kregs->kr_rcvhdrtailaddr, + port, 0ULL); + ipath_write_kreg_port( + dd, dd->ipath_kregs->kr_rcvhdraddr, + pd->port_port, 0); /* clean up the pkeys for this port user */ ipath_clean_part_key(pd, dd); + if (port < dd->ipath_cfgports) { + int i = dd->ipath_pbufsport * (port - 1); + ipath_disarm_piobufs(dd, i, dd->ipath_pbufsport); - /* - * be paranoid, and never write 0's to these, just use an - * unused part of the port 0 tail page. Of course, - * rcvhdraddr points to a large chunk of memory, so this - * could still trash things, but at least it won't trash - * page 0, and by disabling the port, it should stop "soon", - * even if a packet or two is in already in flight after we - * disabled the port. - */ - ipath_write_kreg_port(dd, - dd->ipath_kregs->kr_rcvhdrtailaddr, port, - dd->ipath_dummy_hdrq_phys); - ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdraddr, - pd->port_port, dd->ipath_dummy_hdrq_phys); - - i = dd->ipath_pbufsport * (port - 1); - ipath_disarm_piobufs(dd, i, dd->ipath_pbufsport); - - if (dd->ipath_pageshadow) - unlock_expected_tids(pd); - ipath_stats.sps_ports--; - ipath_cdbg(PROC, "%s[%u] closed port %u:%u\n", - pd->port_comm, pd->port_pid, - dd->ipath_unit, port); - - dd->ipath_f_clear_tids(dd, pd->port_port); + /* atomically clear receive enable port. */ + clear_bit(INFINIPATH_R_PORTENABLE_SHIFT + port, + &dd->ipath_rcvctrl); + ipath_write_kreg( + dd, + dd->ipath_kregs->kr_rcvctrl, + dd->ipath_rcvctrl); + + if (dd->ipath_pageshadow) + unlock_expected_tids(pd); + ipath_stats.sps_ports--; + ipath_cdbg(PROC, "%s[%u] closed port %u:%u\n", + pd->port_comm, pd->port_pid, + dd->ipath_unit, port); + } } pd->port_cnt = 0; pd->port_pid = 0; - dd->ipath_pd[pd->port_port] = NULL; /* before releasing mutex */ + dd->ipath_f_clear_tids(dd, pd->port_port); + + ipath_free_pddata(dd, pd->port_port, 0); + mutex_unlock(&ipath_mutex); - ipath_free_pddata(dd, pd); /* after releasing the mutex */ return ret; } @@ -1810,12 +1859,19 @@ int ipath_user_add(struct ipath_devdata *dd) "error %d\n", -ret); goto bail; } + ret = ipath_diag_init(); + if (ret < 0) { + ipath_dev_err(dd, "Unable to set up diag support: " + "error %d\n", -ret); + goto bail_sma; + } + ret = init_cdev(0, "ipath", &ipath_file_ops, &wildcard_cdev, &wildcard_class_dev); if (ret < 0) { ipath_dev_err(dd, "Could not create wildcard " "minor: error %d\n", -ret); - goto bail_sma; + goto bail_diag; } atomic_set(&user_setup, 1); @@ -1824,28 +1880,31 @@ int ipath_user_add(struct ipath_devdata *dd) snprintf(name, sizeof(name), "ipath%d", dd->ipath_unit); ret = init_cdev(dd->ipath_unit + 1, name, &ipath_file_ops, - &dd->user_cdev, &dd->user_class_dev); + &dd->cdev, &dd->class_dev); if (ret < 0) ipath_dev_err(dd, "Could not create user minor %d, %s\n", dd->ipath_unit + 1, name); goto bail; +bail_diag: + ipath_diag_cleanup(); bail_sma: user_cleanup(); bail: return ret; } -void ipath_user_remove(struct ipath_devdata *dd) +void ipath_user_del(struct ipath_devdata *dd) { - cleanup_cdev(&dd->user_cdev, &dd->user_class_dev); + cleanup_cdev(&dd->cdev, &dd->class_dev); if (atomic_dec_return(&user_count) == 0) { if (atomic_read(&user_setup) == 0) goto bail; cleanup_cdev(&wildcard_cdev, &wildcard_class_dev); + ipath_diag_cleanup(); user_cleanup(); atomic_set(&user_setup, 0); @@ -1853,4 +1912,3 @@ void ipath_user_remove(struct ipath_devdata *dd) bail: return; } - diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_fs.c b/trunk/drivers/infiniband/hw/ipath/ipath_fs.c index 0936d8e8d704..63de3046aff3 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_fs.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -32,6 +31,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_ht400.c b/trunk/drivers/infiniband/hw/ipath/ipath_ht400.c index 3db015da6e77..fac0a2b74de2 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_ht400.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_ht400.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -1573,6 +1572,7 @@ void ipath_init_ht400_funcs(struct ipath_devdata *dd) dd->ipath_f_reset = ipath_setup_ht_reset; dd->ipath_f_get_boardname = ipath_ht_boardname; dd->ipath_f_init_hwerrors = ipath_ht_init_hwerrors; + dd->ipath_f_init_hwerrors = ipath_ht_init_hwerrors; dd->ipath_f_early_init = ipath_ht_early_init; dd->ipath_f_handle_hwerrors = ipath_ht_handle_hwerrors; dd->ipath_f_quiet_serdes = ipath_ht_quiet_serdes; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_init_chip.c b/trunk/drivers/infiniband/hw/ipath/ipath_init_chip.c index 414cdd1d80a6..dc83250d26a6 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_init_chip.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_init_chip.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -36,7 +35,7 @@ #include #include "ipath_kernel.h" -#include "ipath_common.h" +#include "ips_common.h" /* * min buffers we want to have per port, after driver @@ -115,7 +114,6 @@ static int create_port0_egr(struct ipath_devdata *dd) "eager TID %u\n", e); while (e != 0) dev_kfree_skb(skbs[--e]); - vfree(skbs); ret = -ENOMEM; goto bail; } @@ -277,7 +275,7 @@ static int init_chip_first(struct ipath_devdata *dd, pd->port_port = 0; pd->port_cnt = 1; /* The port 0 pkey table is used by the layer interface. */ - pd->port_pkeys[0] = IPATH_DEFAULT_P_KEY; + pd->port_pkeys[0] = IPS_DEFAULT_P_KEY; dd->ipath_rcvtidcnt = ipath_read_kreg32(dd, dd->ipath_kregs->kr_rcvtidcnt); dd->ipath_rcvtidbase = @@ -411,8 +409,17 @@ static int init_pioavailregs(struct ipath_devdata *dd) /* and its length */ dd->ipath_freezelen = L1_CACHE_BYTES - sizeof(dd->ipath_statusp[0]); - ret = 0; + if (dd->ipath_unit * 64 > (IPATH_PORT0_RCVHDRTAIL_SIZE - 64)) { + ipath_dev_err(dd, "unit %u too large for port 0 " + "rcvhdrtail buffer size\n", dd->ipath_unit); + ret = -ENODEV; + } + else + ret = 0; + /* so we can get current tail in ipath_kreceive(), per chip */ + dd->ipath_hdrqtailptr = &ipath_port0_rcvhdrtail[ + dd->ipath_unit * (64 / sizeof(*ipath_port0_rcvhdrtail))]; done: return ret; } @@ -645,9 +652,8 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit) { int ret = 0, i; u32 val32, kpiobufs; - u64 val; + u64 val, atmp; struct ipath_portdata *pd = NULL; /* keep gcc4 happy */ - gfp_t gfp_flags = GFP_USER | __GFP_COMP; ret = init_housekeeping(dd, &pd, reinit); if (ret) @@ -769,6 +775,24 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit) goto done; } + val = ipath_port0_rcvhdrtail_dma + dd->ipath_unit * 64; + + /* verify that the alignment requirement was met */ + ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdrtailaddr, + 0, val); + atmp = ipath_read_kreg64_port( + dd, dd->ipath_kregs->kr_rcvhdrtailaddr, 0); + if (val != atmp) { + ipath_dev_err(dd, "Catastrophic software error, " + "RcvHdrTailAddr0 written as %llx, " + "read back as %llx from %x\n", + (unsigned long long) val, + (unsigned long long) atmp, + dd->ipath_kregs->kr_rcvhdrtailaddr); + ret = -EINVAL; + goto done; + } + ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvbthqp, IPATH_KD_QP); /* @@ -812,45 +836,25 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit) /* clear any interrups up to this point (ints still not enabled) */ ipath_write_kreg(dd, dd->ipath_kregs->kr_intclear, -1LL); + ipath_stats.sps_lid[dd->ipath_unit] = dd->ipath_lid; + /* * Set up the port 0 (kernel) rcvhdr q and egr TIDs. If doing * re-init, the simplest way to handle this is to free * existing, and re-allocate. */ - if (reinit) { - struct ipath_portdata *pd = dd->ipath_pd[0]; - dd->ipath_pd[0] = NULL; - ipath_free_pddata(dd, pd); - } + if (reinit) + ipath_free_pddata(dd, 0, 0); dd->ipath_f_tidtemplate(dd); ret = ipath_create_rcvhdrq(dd, pd); - if (!ret) { - dd->ipath_hdrqtailptr = - (volatile __le64 *)pd->port_rcvhdrtail_kvaddr; + if (!ret) ret = create_port0_egr(dd); - } if (ret) ipath_dev_err(dd, "failed to allocate port 0 (kernel) " "rcvhdrq and/or egr bufs\n"); else enable_chip(dd, pd, reinit); - - if (!ret && !reinit) { - /* used when we close a port, for DMA already in flight at close */ - dd->ipath_dummy_hdrq = dma_alloc_coherent( - &dd->pcidev->dev, pd->port_rcvhdrq_size, - &dd->ipath_dummy_hdrq_phys, - gfp_flags); - if (!dd->ipath_dummy_hdrq ) { - dev_info(&dd->pcidev->dev, - "Couldn't allocate 0x%lx bytes for dummy hdrq\n", - pd->port_rcvhdrq_size); - /* fallback to just 0'ing */ - dd->ipath_dummy_hdrq_phys = 0UL; - } - } - /* * cause retrigger of pending interrupts ignored during init, * even if we had errors diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_intr.c b/trunk/drivers/infiniband/hw/ipath/ipath_intr.c index 280e732660a1..3e72a1fe3d73 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_intr.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_intr.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -34,10 +33,9 @@ #include #include "ipath_kernel.h" +#include "ips_common.h" #include "ipath_layer.h" -#include "ipath_common.h" -/* These are all rcv-related errors which we want to count for stats */ #define E_SUM_PKTERRS \ (INFINIPATH_E_RHDRLEN | INFINIPATH_E_RBADTID | \ INFINIPATH_E_RBADVERSION | INFINIPATH_E_RHDR | \ @@ -46,7 +44,6 @@ INFINIPATH_E_RFORMATERR | INFINIPATH_E_RUNSUPVL | \ INFINIPATH_E_RUNEXPCHAR | INFINIPATH_E_REBP) -/* These are all send-related errors which we want to count for stats */ #define E_SUM_ERRS \ (INFINIPATH_E_SPIOARMLAUNCH | INFINIPATH_E_SUNEXPERRPKTNUM | \ INFINIPATH_E_SDROPPEDDATAPKT | INFINIPATH_E_SDROPPEDSMPPKT | \ @@ -54,18 +51,6 @@ INFINIPATH_E_SMINPKTLEN | INFINIPATH_E_SPKTLEN | \ INFINIPATH_E_INVALIDADDR) -/* - * these are errors that can occur when the link changes state while - * a packet is being sent or received. This doesn't cover things - * like EBP or VCRC that can be the result of a sending having the - * link change state, so we receive a "known bad" packet. - */ -#define E_SUM_LINK_PKTERRS \ - (INFINIPATH_E_SDROPPEDDATAPKT | INFINIPATH_E_SDROPPEDSMPPKT | \ - INFINIPATH_E_SMINPKTLEN | INFINIPATH_E_SPKTLEN | \ - INFINIPATH_E_RSHORTPKTLEN | INFINIPATH_E_RMINPKTLEN | \ - INFINIPATH_E_RUNEXPCHAR) - static u64 handle_e_sum_errs(struct ipath_devdata *dd, ipath_err_t errs) { unsigned long sbuf[4]; @@ -115,7 +100,9 @@ static u64 handle_e_sum_errs(struct ipath_devdata *dd, ipath_err_t errs) if (ipath_debug & __IPATH_PKTDBG) printk("\n"); } - if ((errs & E_SUM_LINK_PKTERRS) && + if ((errs & (INFINIPATH_E_SDROPPEDDATAPKT | + INFINIPATH_E_SDROPPEDSMPPKT | + INFINIPATH_E_SMINPKTLEN)) && !(dd->ipath_flags & IPATH_LINKACTIVE)) { /* * This can happen when SMA is trying to bring the link @@ -124,9 +111,11 @@ static u64 handle_e_sum_errs(struct ipath_devdata *dd, ipath_err_t errs) * valid. We don't want to confuse people, so we just * don't print them, except at debug */ - ipath_dbg("Ignoring packet errors %llx, because link not " - "ACTIVE\n", (unsigned long long) errs); - ignore_this_time = errs & E_SUM_LINK_PKTERRS; + ipath_dbg("Ignoring pktsend errors %llx, because not " + "yet active\n", (unsigned long long) errs); + ignore_this_time = INFINIPATH_E_SDROPPEDDATAPKT | + INFINIPATH_E_SDROPPEDSMPPKT | + INFINIPATH_E_SMINPKTLEN; } return ignore_this_time; @@ -167,29 +156,7 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd, */ val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_ibcstatus); lstate = val & IPATH_IBSTATE_MASK; - - /* - * this is confusing enough when it happens that I want to always put it - * on the console and in the logs. If it was a requested state change, - * we'll have already cleared the flags, so we won't print this warning - */ - if ((lstate != IPATH_IBSTATE_ARM && lstate != IPATH_IBSTATE_ACTIVE) - && (dd->ipath_flags & (IPATH_LINKARMED | IPATH_LINKACTIVE))) { - dev_info(&dd->pcidev->dev, "Link state changed from %s to %s\n", - (dd->ipath_flags & IPATH_LINKARMED) ? "ARM" : "ACTIVE", - ib_linkstate(lstate)); - /* - * Flush all queued sends when link went to DOWN or INIT, - * to be sure that they don't block SMA and other MAD packets - */ - ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, - INFINIPATH_S_ABORT); - ipath_disarm_piobufs(dd, dd->ipath_lastport_piobuf, - (unsigned)(dd->ipath_piobcnt2k + - dd->ipath_piobcnt4k) - - dd->ipath_lastport_piobuf); - } - else if (lstate == IPATH_IBSTATE_INIT || lstate == IPATH_IBSTATE_ARM || + if (lstate == IPATH_IBSTATE_INIT || lstate == IPATH_IBSTATE_ARM || lstate == IPATH_IBSTATE_ACTIVE) { /* * only print at SMA if there is a change, debug if not @@ -262,7 +229,6 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd, | IPATH_LINKACTIVE | IPATH_LINKARMED); *dd->ipath_statusp &= ~IPATH_STATUS_IB_READY; - dd->ipath_lli_counter = 0; if (!noprint) { if (((dd->ipath_lastibcstat >> INFINIPATH_IBCS_LINKSTATE_SHIFT) & @@ -384,7 +350,7 @@ static unsigned handle_frequent_errors(struct ipath_devdata *dd, return supp_msgs; } -static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) +static void handle_errors(struct ipath_devdata *dd, ipath_err_t errs) { char msg[512]; u64 ignore_this_time = 0; @@ -413,19 +379,6 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) if (errs & E_SUM_ERRS) ignore_this_time = handle_e_sum_errs(dd, errs); - else if ((errs & E_SUM_LINK_PKTERRS) && - !(dd->ipath_flags & IPATH_LINKACTIVE)) { - /* - * This can happen when SMA is trying to bring the link - * up, but the IB link changes state at the "wrong" time. - * The IB logic then complains that the packet isn't - * valid. We don't want to confuse people, so we just - * don't print them, except at debug - */ - ipath_dbg("Ignoring packet errors %llx, because link not " - "ACTIVE\n", (unsigned long long) errs); - ignore_this_time = errs & E_SUM_LINK_PKTERRS; - } if (supp_msgs == 250000) { /* @@ -444,7 +397,7 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) if ((dd->ipath_maskederrs & ~dd->ipath_ignorederrs) & ~(INFINIPATH_E_RRCVEGRFULL | INFINIPATH_E_RRCVHDRFULL)) ipath_dev_err(dd, "Disabling error(s) %llx because " - "occurring too frequently (%s)\n", + "occuring too frequently (%s)\n", (unsigned long long) (dd->ipath_maskederrs & ~dd->ipath_ignorederrs), msg); @@ -481,7 +434,7 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) INFINIPATH_E_IBSTATUSCHANGED); } if (!errs) - return 0; + return; if (!noprint) /* @@ -540,10 +493,10 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) continue; if (hd == (tl + 1) || (!hd && tl == dd->ipath_hdrqlast)) { - if (i == 0) - chkerrpkts = 1; dd->ipath_lastrcvhdrqtails[i] = tl; pd->port_hdrqfull++; + if (i == 0) + chkerrpkts = 1; } } } @@ -605,7 +558,9 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) wake_up_interruptible(&ipath_sma_state_wait); } - return chkerrpkts; + if (chkerrpkts) + /* process possible error packets in hdrq */ + ipath_kreceive(dd); } /* this is separate to allow for better optimization of ipath_intr() */ @@ -723,12 +678,7 @@ static void handle_layer_pioavail(struct ipath_devdata *dd) dd->ipath_sendctrl); } -/* - * Handle receive interrupts for user ports; this means a user - * process was waiting for a packet to arrive, and didn't want - * to poll - */ -static void handle_urcv(struct ipath_devdata *dd, u32 istat) +static void handle_rcv(struct ipath_devdata *dd, u32 istat) { u64 portr; int i; @@ -738,17 +688,22 @@ static void handle_urcv(struct ipath_devdata *dd, u32 istat) infinipath_i_rcvavail_mask) | ((istat >> INFINIPATH_I_RCVURG_SHIFT) & infinipath_i_rcvurg_mask); - for (i = 1; i < dd->ipath_cfgports; i++) { + for (i = 0; i < dd->ipath_cfgports; i++) { struct ipath_portdata *pd = dd->ipath_pd[i]; - if (portr & (1 << i) && pd && pd->port_cnt && - test_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag)) { - int rcbit; - clear_bit(IPATH_PORT_WAITING_RCV, - &pd->port_flag); - rcbit = i + INFINIPATH_R_INTRAVAIL_SHIFT; - clear_bit(1UL << rcbit, &dd->ipath_rcvctrl); - wake_up_interruptible(&pd->port_wait); - rcvdint = 1; + if (portr & (1 << i) && pd && + pd->port_cnt) { + if (i == 0) + ipath_kreceive(dd); + else if (test_bit(IPATH_PORT_WAITING_RCV, + &pd->port_flag)) { + int rcbit; + clear_bit(IPATH_PORT_WAITING_RCV, + &pd->port_flag); + rcbit = i + INFINIPATH_R_INTRAVAIL_SHIFT; + clear_bit(1UL << rcbit, &dd->ipath_rcvctrl); + wake_up_interruptible(&pd->port_wait); + rcvdint = 1; + } } } if (rcvdint) { @@ -764,19 +719,16 @@ static void handle_urcv(struct ipath_devdata *dd, u32 istat) irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs) { struct ipath_devdata *dd = data; - u32 istat, chk0rcv = 0; + u32 istat; ipath_err_t estat = 0; - irqreturn_t ret; - u32 oldhead, curtail; static unsigned unexpected = 0; - static const u32 port0rbits = (1U<ipath_flags & IPATH_PRESENT)) { + if(!(dd->ipath_flags & IPATH_PRESENT)) { + /* this is mostly so we don't try to touch the chip while + * it is being reset */ /* - * This return value is not great, but we do not want the + * This return value is perhaps odd, but we do not want the * interrupt core code to remove our interrupt handler * because we don't appear to be handling an interrupt * during a chip reset. @@ -784,51 +736,7 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs) return IRQ_HANDLED; } - /* - * this needs to be flags&initted, not statusp, so we keep - * taking interrupts even after link goes down, etc. - * Also, we *must* clear the interrupt at some point, or we won't - * take it again, which can be real bad for errors, etc... - */ - - if (!(dd->ipath_flags & IPATH_INITTED)) { - ipath_bad_intr(dd, &unexpected); - ret = IRQ_NONE; - goto bail; - } - - /* - * We try to avoid reading the interrupt status register, since - * that's a PIO read, and stalls the processor for up to about - * ~0.25 usec. The idea is that if we processed a port0 packet, - * we blindly clear the port 0 receive interrupt bits, and nothing - * else, then return. If other interrupts are pending, the chip - * will re-interrupt us as soon as we write the intclear register. - * We then won't process any more kernel packets (if not the 2nd - * time, then the 3rd or 4th) and we'll then handle the other - * interrupts. We clear the interrupts first so that we don't - * lose intr for later packets that arrive while we are processing. - */ - oldhead = dd->ipath_port0head; - curtail = (u32)le64_to_cpu(*dd->ipath_hdrqtailptr); - if (oldhead != curtail) { - if (dd->ipath_flags & IPATH_GPIO_INTR) { - ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_clear, - (u64) (1 << 2)); - istat = port0rbits | INFINIPATH_I_GPIO; - } - else - istat = port0rbits; - ipath_write_kreg(dd, dd->ipath_kregs->kr_intclear, istat); - ipath_kreceive(dd); - if (oldhead != dd->ipath_port0head) { - ipath_stats.sps_fastrcvint++; - goto done; - } - } - istat = ipath_read_kreg32(dd, dd->ipath_kregs->kr_intstatus); - if (unlikely(!istat)) { ipath_stats.sps_nullintr++; ret = IRQ_NONE; /* not our interrupt, or already handled */ @@ -841,17 +749,31 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs) goto bail; } + ipath_stats.sps_ints++; + + /* + * this needs to be flags&initted, not statusp, so we keep + * taking interrupts even after link goes down, etc. + * Also, we *must* clear the interrupt at some point, or we won't + * take it again, which can be real bad for errors, etc... + */ + + if (!(dd->ipath_flags & IPATH_INITTED)) { + ipath_bad_intr(dd, &unexpected); + ret = IRQ_NONE; + goto bail; + } if (unexpected) unexpected = 0; - if (unlikely(istat & ~infinipath_i_bitsextant)) + ipath_cdbg(VERBOSE, "intr stat=0x%x\n", istat); + + if (istat & ~infinipath_i_bitsextant) ipath_dev_err(dd, "interrupt with unknown interrupts %x set\n", istat & (u32) ~ infinipath_i_bitsextant); - else - ipath_cdbg(VERBOSE, "intr stat=0x%x\n", istat); - if (unlikely(istat & INFINIPATH_I_ERROR)) { + if (istat & INFINIPATH_I_ERROR) { ipath_stats.sps_errints++; estat = ipath_read_kreg64(dd, dd->ipath_kregs->kr_errorstatus); @@ -866,18 +788,10 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs) ipath_dev_err(dd, "Read of error status failed " "(all bits set); ignoring\n"); else - if (handle_errors(dd, estat)) - /* force calling ipath_kreceive() */ - chk0rcv = 1; + handle_errors(dd, estat); } if (istat & INFINIPATH_I_GPIO) { - /* - * Packets are available in the port 0 rcv queue. - * Eventually this needs to be generalized to check - * IPATH_GPIO_INTR, and the specific GPIO bit, if - * GPIO interrupts are used for anything else. - */ if (unlikely(!(dd->ipath_flags & IPATH_GPIO_INTR))) { u32 gpiostatus; gpiostatus = ipath_read_kreg32( @@ -890,39 +804,27 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs) else { /* Clear GPIO status bit 2 */ ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_clear, - (u64) (1 << 2)); - chk0rcv = 1; + (u64) (1 << 2)); + + /* + * Packets are available in the port 0 rcv queue. + * Eventually this needs to be generalized to check + * IPATH_GPIO_INTR, and the specific GPIO bit, if + * GPIO interrupts are used for anything else. + */ + ipath_kreceive(dd); } } - chk0rcv |= istat & port0rbits; /* - * Clear the interrupt bits we found set, unless they are receive - * related, in which case we already cleared them above, and don't - * want to clear them again, because we might lose an interrupt. - * Clear it early, so we "know" know the chip will have seen this by - * the time we process the queue, and will re-interrupt if necessary. - * The processor itself won't take the interrupt again until we return. + * clear the ones we will deal with on this round + * We clear it early, mostly for receive interrupts, so we + * know the chip will have seen this by the time we process + * the queue, and will re-interrupt if necessary. The processor + * itself won't take the interrupt again until we return. */ ipath_write_kreg(dd, dd->ipath_kregs->kr_intclear, istat); - /* - * handle port0 receive before checking for pio buffers available, - * since receives can overflow; piobuf waiters can afford a few - * extra cycles, since they were waiting anyway, and user's waiting - * for receive are at the bottom. - */ - if (chk0rcv) { - ipath_kreceive(dd); - istat &= ~port0rbits; - } - - if (istat & ((infinipath_i_rcvavail_mask << - INFINIPATH_I_RCVAVAIL_SHIFT) - | (infinipath_i_rcvurg_mask << - INFINIPATH_I_RCVURG_SHIFT))) - handle_urcv(dd, istat); - if (istat & INFINIPATH_I_SPIOBUFAVAIL) { clear_bit(IPATH_S_PIOINTBUFAVAIL, &dd->ipath_sendctrl); ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, @@ -934,7 +836,17 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs) handle_layer_pioavail(dd); } -done: + /* + * we check for both transition from empty to non-empty, and urgent + * packets (those with the interrupt bit set in the header) + */ + + if (istat & ((infinipath_i_rcvavail_mask << + INFINIPATH_I_RCVAVAIL_SHIFT) + | (infinipath_i_rcvurg_mask << + INFINIPATH_I_RCVURG_SHIFT))) + handle_rcv(dd, istat); + ret = IRQ_HANDLED; bail: diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h b/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h index e9f374fb641e..5d92d57b6f54 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h @@ -1,7 +1,6 @@ #ifndef _IPATH_KERNEL_H #define _IPATH_KERNEL_H /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -62,7 +61,9 @@ struct ipath_portdata { /* rcvhdrq base, needs mmap before useful */ void *port_rcvhdrq; /* kernel virtual address where hdrqtail is updated */ - volatile __le64 *port_rcvhdrtail_kvaddr; + u64 *port_rcvhdrtail_kvaddr; + /* page * used for uaddr */ + struct page *port_rcvhdrtail_pagep; /* * temp buffer for expected send setup, allocated at open, instead * of each setup call @@ -77,7 +78,11 @@ struct ipath_portdata { dma_addr_t port_rcvegr_phys; /* mmap of hdrq, must fit in 44 bits */ dma_addr_t port_rcvhdrq_phys; - dma_addr_t port_rcvhdrqtailaddr_phys; + /* + * the actual user address that we ipath_mlock'ed, so we can + * ipath_munlock it at close + */ + unsigned long port_rcvhdrtail_uaddr; /* * number of opens on this instance (0 or 1; ignoring forks, dup, * etc. for now) @@ -152,11 +157,17 @@ struct ipath_devdata { unsigned long ipath_physaddr; /* base of memory alloced for ipath_kregbase, for free */ u64 *ipath_kregalloc; + /* + * version of kregbase that doesn't have high bits set (for 32 bit + * programs, so mmap64 44 bit works) + */ + u64 __iomem *ipath_kregvirt; /* * virtual address where port0 rcvhdrqtail updated for this unit. * only written to by the chip, not the driver. */ volatile __le64 *ipath_hdrqtailptr; + dma_addr_t ipath_dma_addr; /* ipath_cfgports pointers */ struct ipath_portdata **ipath_pd; /* sk_buffs used by port 0 eager receive queue */ @@ -343,17 +354,13 @@ struct ipath_devdata { char *ipath_freezemsg; /* pci access data structure */ struct pci_dev *pcidev; - struct cdev *user_cdev; - struct cdev *diag_cdev; - struct class_device *user_class_dev; - struct class_device *diag_class_dev; + struct cdev *cdev; + struct class_device *class_dev; /* timer used to prevent stats overflow, error throttling, etc. */ struct timer_list ipath_stats_timer; /* check for stale messages in rcv queue */ /* only allow one intr at a time. */ unsigned long ipath_rcv_pending; - void *ipath_dummy_hdrq; /* used after port close */ - dma_addr_t ipath_dummy_hdrq_phys; /* * Shadow copies of registers; size indicates read access size. @@ -493,11 +500,8 @@ struct ipath_devdata { u16 ipath_lid; /* list of pkeys programmed; 0 if not set */ u16 ipath_pkeys[4]; - /* - * ASCII serial number, from flash, large enough for original - * all digit strings, and longer QLogic serial number format - */ - u8 ipath_serial[16]; + /* ASCII serial number, from flash */ + u8 ipath_serial[12]; /* human readable board version */ u8 ipath_boardversion[80]; /* chip major rev, from ipath_revision */ @@ -512,13 +516,13 @@ struct ipath_devdata { u8 ipath_pci_cacheline; /* LID mask control */ u8 ipath_lmc; - - /* local link integrity counter */ - u32 ipath_lli_counter; - /* local link integrity errors */ - u32 ipath_lli_errors; }; +extern volatile __le64 *ipath_port0_rcvhdrtail; +extern dma_addr_t ipath_port0_rcvhdrtail_dma; + +#define IPATH_PORT0_RCVHDRTAIL_SIZE PAGE_SIZE + extern struct list_head ipath_dev_list; extern spinlock_t ipath_devs_lock; extern struct ipath_devdata *ipath_lookup(int unit); @@ -533,7 +537,7 @@ extern int __ipath_verbs_piobufavail(struct ipath_devdata *); extern int __ipath_verbs_rcv(struct ipath_devdata *, void *, void *, u32); void ipath_layer_add(struct ipath_devdata *); -void ipath_layer_remove(struct ipath_devdata *); +void ipath_layer_del(struct ipath_devdata *); int ipath_init_chip(struct ipath_devdata *, int); int ipath_enable_wc(struct ipath_devdata *dd); @@ -547,14 +551,14 @@ int ipath_cdev_init(int minor, char *name, struct file_operations *fops, void ipath_cdev_cleanup(struct cdev **cdevp, struct class_device **class_devp); -int ipath_diag_add(struct ipath_devdata *); -void ipath_diag_remove(struct ipath_devdata *); +int ipath_diag_init(void); +void ipath_diag_cleanup(void); void ipath_diag_bringup_link(struct ipath_devdata *); extern wait_queue_head_t ipath_sma_state_wait; int ipath_user_add(struct ipath_devdata *dd); -void ipath_user_remove(struct ipath_devdata *dd); +void ipath_user_del(struct ipath_devdata *dd); struct sk_buff *ipath_alloc_skb(struct ipath_devdata *dd, gfp_t); @@ -578,7 +582,7 @@ void ipath_disarm_piobufs(struct ipath_devdata *, unsigned first, unsigned cnt); int ipath_create_rcvhdrq(struct ipath_devdata *, struct ipath_portdata *); -void ipath_free_pddata(struct ipath_devdata *, struct ipath_portdata *); +void ipath_free_pddata(struct ipath_devdata *, u32, int); int ipath_parse_ushort(const char *str, unsigned short *valp); @@ -716,8 +720,13 @@ u64 ipath_read_kreg64_port(const struct ipath_devdata *, ipath_kreg, * @port: port number * * Return the contents of a register that is virtualized to be per port. - * Returns -1 on errors (not distinguishable from valid contents at - * runtime; we may add a separate error variable at some point). + * Prints a debug message and returns -1 on errors (not distinguishable from + * valid contents at runtime; we may add a separate error variable at some + * point). + * + * This is normally not used by the kernel, but may be for debugging, and + * has a different implementation than user mode, which is why it's not in + * _common.h. */ static inline u32 ipath_read_ureg32(const struct ipath_devdata *dd, ipath_ureg regno, int port) @@ -833,10 +842,9 @@ extern struct mutex ipath_mutex; #define IPATH_DRV_NAME "ipath_core" #define IPATH_MAJOR 233 -#define IPATH_USER_MINOR_BASE 0 #define IPATH_SMA_MINOR 128 -#define IPATH_DIAG_MINOR_BASE 129 -#define IPATH_NMINORS 255 +#define IPATH_DIAG_MINOR 129 +#define IPATH_NMINORS 130 #define ipath_dev_err(dd,fmt,...) \ do { \ diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_keys.c b/trunk/drivers/infiniband/hw/ipath/ipath_keys.c index 46773c673a1a..5ae8761f9dd2 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_keys.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_keys.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -121,7 +120,6 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge, struct ib_sge *sge, int acc) { struct ipath_mregion *mr; - unsigned n, m; size_t off; int ret; @@ -153,22 +151,20 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge, } off += mr->offset; - m = 0; - n = 0; - while (off >= mr->map[m]->segs[n].length) { - off -= mr->map[m]->segs[n].length; - n++; - if (n >= IPATH_SEGSZ) { - m++; - n = 0; + isge->mr = mr; + isge->m = 0; + isge->n = 0; + while (off >= mr->map[isge->m]->segs[isge->n].length) { + off -= mr->map[isge->m]->segs[isge->n].length; + isge->n++; + if (isge->n >= IPATH_SEGSZ) { + isge->m++; + isge->n = 0; } } - isge->mr = mr; - isge->vaddr = mr->map[m]->segs[n].vaddr + off; - isge->length = mr->map[m]->segs[n].length - off; + isge->vaddr = mr->map[isge->m]->segs[isge->n].vaddr + off; + isge->length = mr->map[isge->m]->segs[isge->n].length - off; isge->sge_length = sge->length; - isge->m = m; - isge->n = n; ret = 1; @@ -193,7 +189,6 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, struct ipath_lkey_table *rkt = &dev->lk_table; struct ipath_sge *sge = &ss->sge; struct ipath_mregion *mr; - unsigned n, m; size_t off; int ret; @@ -211,22 +206,20 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, } off += mr->offset; - m = 0; - n = 0; - while (off >= mr->map[m]->segs[n].length) { - off -= mr->map[m]->segs[n].length; - n++; - if (n >= IPATH_SEGSZ) { - m++; - n = 0; + sge->mr = mr; + sge->m = 0; + sge->n = 0; + while (off >= mr->map[sge->m]->segs[sge->n].length) { + off -= mr->map[sge->m]->segs[sge->n].length; + sge->n++; + if (sge->n >= IPATH_SEGSZ) { + sge->m++; + sge->n = 0; } } - sge->mr = mr; - sge->vaddr = mr->map[m]->segs[n].vaddr + off; - sge->length = mr->map[m]->segs[n].length - off; + sge->vaddr = mr->map[sge->m]->segs[sge->n].vaddr + off; + sge->length = mr->map[sge->m]->segs[sge->n].length - off; sge->sge_length = len; - sge->m = m; - sge->n = n; ss->sg_list = NULL; ss->num_sge = 1; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_layer.c b/trunk/drivers/infiniband/hw/ipath/ipath_layer.c index b28c6f81c731..9ec4ac77b87f 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_layer.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_layer.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -41,8 +40,8 @@ #include #include "ipath_kernel.h" +#include "ips_common.h" #include "ipath_layer.h" -#include "ipath_common.h" /* Acquire before ipath_devs_lock. */ static DEFINE_MUTEX(ipath_layer_mutex); @@ -300,8 +299,9 @@ int ipath_layer_set_mtu(struct ipath_devdata *dd, u16 arg) EXPORT_SYMBOL_GPL(ipath_layer_set_mtu); -int ipath_set_lid(struct ipath_devdata *dd, u32 arg, u8 lmc) +int ipath_set_sps_lid(struct ipath_devdata *dd, u32 arg, u8 lmc) { + ipath_stats.sps_lid[dd->ipath_unit] = arg; dd->ipath_lid = arg; dd->ipath_lmc = lmc; @@ -315,7 +315,7 @@ int ipath_set_lid(struct ipath_devdata *dd, u32 arg, u8 lmc) return 0; } -EXPORT_SYMBOL_GPL(ipath_set_lid); +EXPORT_SYMBOL_GPL(ipath_set_sps_lid); int ipath_layer_set_guid(struct ipath_devdata *dd, __be64 guid) { @@ -340,26 +340,18 @@ u32 ipath_layer_get_nguid(struct ipath_devdata *dd) EXPORT_SYMBOL_GPL(ipath_layer_get_nguid); -u32 ipath_layer_get_majrev(struct ipath_devdata *dd) +int ipath_layer_query_device(struct ipath_devdata *dd, u32 * vendor, + u32 * boardrev, u32 * majrev, u32 * minrev) { - return dd->ipath_majrev; -} - -EXPORT_SYMBOL_GPL(ipath_layer_get_majrev); + *vendor = dd->ipath_vendorid; + *boardrev = dd->ipath_boardrev; + *majrev = dd->ipath_majrev; + *minrev = dd->ipath_minrev; -u32 ipath_layer_get_minrev(struct ipath_devdata *dd) -{ - return dd->ipath_minrev; -} - -EXPORT_SYMBOL_GPL(ipath_layer_get_minrev); - -u32 ipath_layer_get_pcirev(struct ipath_devdata *dd) -{ - return dd->ipath_pcirev; + return 0; } -EXPORT_SYMBOL_GPL(ipath_layer_get_pcirev); +EXPORT_SYMBOL_GPL(ipath_layer_query_device); u32 ipath_layer_get_flags(struct ipath_devdata *dd) { @@ -382,13 +374,6 @@ u16 ipath_layer_get_deviceid(struct ipath_devdata *dd) EXPORT_SYMBOL_GPL(ipath_layer_get_deviceid); -u32 ipath_layer_get_vendorid(struct ipath_devdata *dd) -{ - return dd->ipath_vendorid; -} - -EXPORT_SYMBOL_GPL(ipath_layer_get_vendorid); - u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd) { return dd->ipath_lastibcstat; @@ -418,7 +403,7 @@ void ipath_layer_add(struct ipath_devdata *dd) mutex_unlock(&ipath_layer_mutex); } -void ipath_layer_remove(struct ipath_devdata *dd) +void ipath_layer_del(struct ipath_devdata *dd) { mutex_lock(&ipath_layer_mutex); @@ -622,7 +607,7 @@ int ipath_layer_open(struct ipath_devdata *dd, u32 * pktmax) goto bail; } - ret = ipath_setrcvhdrsize(dd, IPATH_HEADER_QUEUE_WORDS); + ret = ipath_setrcvhdrsize(dd, NUM_OF_EXTRA_WORDS_IN_HEADER_QUEUE); if (ret < 0) goto bail; @@ -631,9 +616,9 @@ int ipath_layer_open(struct ipath_devdata *dd, u32 * pktmax) if (*dd->ipath_statusp & IPATH_STATUS_IB_READY) intval |= IPATH_LAYER_INT_IF_UP; - if (dd->ipath_lid) + if (ipath_stats.sps_lid[dd->ipath_unit]) intval |= IPATH_LAYER_INT_LID; - if (dd->ipath_mlid) + if (ipath_stats.sps_mlid[dd->ipath_unit]) intval |= IPATH_LAYER_INT_BCAST; /* * do this on open, in case low level is already up and @@ -899,7 +884,7 @@ static void copy_io(u32 __iomem *piobuf, struct ipath_sge_state *ss, /** * ipath_verbs_send - send a packet from the verbs layer * @dd: the infinipath device - * @hdrwords: the number of words in the header + * @hdrwords: the number of works in the header * @hdr: the packet header * @len: the length of the packet in bytes * @ss: the SGE to send @@ -1031,22 +1016,19 @@ int ipath_layer_get_counters(struct ipath_devdata *dd, ipath_snap_cntr(dd, dd->ipath_cregs->cr_ibsymbolerrcnt); cntrs->link_error_recovery_counter = ipath_snap_cntr(dd, dd->ipath_cregs->cr_iblinkerrrecovcnt); - /* - * The link downed counter counts when the other side downs the - * connection. We add in the number of times we downed the link - * due to local link integrity errors to compensate. - */ cntrs->link_downed_counter = ipath_snap_cntr(dd, dd->ipath_cregs->cr_iblinkdowncnt); cntrs->port_rcv_errors = ipath_snap_cntr(dd, dd->ipath_cregs->cr_rxdroppktcnt) + ipath_snap_cntr(dd, dd->ipath_cregs->cr_rcvovflcnt) + ipath_snap_cntr(dd, dd->ipath_cregs->cr_portovflcnt) + + ipath_snap_cntr(dd, dd->ipath_cregs->cr_errrcvflowctrlcnt) + ipath_snap_cntr(dd, dd->ipath_cregs->cr_err_rlencnt) + ipath_snap_cntr(dd, dd->ipath_cregs->cr_invalidrlencnt) + ipath_snap_cntr(dd, dd->ipath_cregs->cr_erricrccnt) + ipath_snap_cntr(dd, dd->ipath_cregs->cr_errvcrccnt) + ipath_snap_cntr(dd, dd->ipath_cregs->cr_errlpcrccnt) + + ipath_snap_cntr(dd, dd->ipath_cregs->cr_errlinkcnt) + ipath_snap_cntr(dd, dd->ipath_cregs->cr_badformatcnt); cntrs->port_rcv_remphys_errors = ipath_snap_cntr(dd, dd->ipath_cregs->cr_rcvebpcnt); @@ -1060,8 +1042,6 @@ int ipath_layer_get_counters(struct ipath_devdata *dd, ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktsendcnt); cntrs->port_rcv_packets = ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktrcvcnt); - cntrs->local_link_integrity_errors = dd->ipath_lli_errors; - cntrs->excessive_buffer_overrun_errors = 0; /* XXX */ ret = 0; @@ -1106,10 +1086,10 @@ int ipath_layer_send_hdr(struct ipath_devdata *dd, struct ether_header *hdr) } vlsllnh = *((__be16 *) hdr); - if (vlsllnh != htons(IPATH_LRH_BTH)) { + if (vlsllnh != htons(IPS_LRH_BTH)) { ipath_dbg("Warning: lrh[0] wrong (%x, not %x); " "not sending\n", be16_to_cpu(vlsllnh), - IPATH_LRH_BTH); + IPS_LRH_BTH); ret = -EINVAL; } if (ret) diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_layer.h b/trunk/drivers/infiniband/hw/ipath/ipath_layer.h index 71485096fcac..6fefd15bd2da 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_layer.h +++ b/trunk/drivers/infiniband/hw/ipath/ipath_layer.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -55,8 +54,6 @@ struct ipath_layer_counters { u64 port_rcv_data; u64 port_xmit_packets; u64 port_rcv_packets; - u32 local_link_integrity_errors; - u32 excessive_buffer_overrun_errors; }; /* @@ -129,7 +126,7 @@ u16 ipath_layer_get_bcast(struct ipath_devdata *dd); u32 ipath_layer_get_cr_errpkey(struct ipath_devdata *dd); int ipath_layer_set_linkstate(struct ipath_devdata *dd, u8 state); int ipath_layer_set_mtu(struct ipath_devdata *, u16); -int ipath_set_lid(struct ipath_devdata *, u32, u8); +int ipath_set_sps_lid(struct ipath_devdata *, u32, u8); int ipath_layer_send_hdr(struct ipath_devdata *dd, struct ether_header *hdr); int ipath_verbs_send(struct ipath_devdata *dd, u32 hdrwords, @@ -146,13 +143,11 @@ int ipath_layer_want_buffer(struct ipath_devdata *dd); int ipath_layer_set_guid(struct ipath_devdata *, __be64 guid); __be64 ipath_layer_get_guid(struct ipath_devdata *); u32 ipath_layer_get_nguid(struct ipath_devdata *); -u32 ipath_layer_get_majrev(struct ipath_devdata *); -u32 ipath_layer_get_minrev(struct ipath_devdata *); -u32 ipath_layer_get_pcirev(struct ipath_devdata *); +int ipath_layer_query_device(struct ipath_devdata *, u32 * vendor, + u32 * boardrev, u32 * majrev, u32 * minrev); u32 ipath_layer_get_flags(struct ipath_devdata *dd); struct device *ipath_layer_get_device(struct ipath_devdata *dd); u16 ipath_layer_get_deviceid(struct ipath_devdata *dd); -u32 ipath_layer_get_vendorid(struct ipath_devdata *); u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd); u32 ipath_layer_get_ibmtu(struct ipath_devdata *dd); int ipath_layer_enable_timer(struct ipath_devdata *dd); diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_mad.c b/trunk/drivers/infiniband/hw/ipath/ipath_mad.c index d3402341b7d0..1a9d0a2c33c3 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_mad.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_mad.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -35,7 +34,7 @@ #include "ipath_kernel.h" #include "ipath_verbs.h" -#include "ipath_common.h" +#include "ips_common.h" #define IB_SMP_UNSUP_VERSION __constant_htons(0x0004) #define IB_SMP_UNSUP_METHOD __constant_htons(0x0008) @@ -85,7 +84,7 @@ static int recv_subn_get_nodeinfo(struct ib_smp *smp, { struct nodeinfo *nip = (struct nodeinfo *)&smp->data; struct ipath_devdata *dd = to_idev(ibdev)->dd; - u32 vendor, majrev, minrev; + u32 vendor, boardid, majrev, minrev; if (smp->attr_mod) smp->status |= IB_SMP_INVALID_FIELD; @@ -105,11 +104,9 @@ static int recv_subn_get_nodeinfo(struct ib_smp *smp, nip->port_guid = nip->sys_guid; nip->partition_cap = cpu_to_be16(ipath_layer_get_npkeys(dd)); nip->device_id = cpu_to_be16(ipath_layer_get_deviceid(dd)); - majrev = ipath_layer_get_majrev(dd); - minrev = ipath_layer_get_minrev(dd); + ipath_layer_query_device(dd, &vendor, &boardid, &majrev, &minrev); nip->revision = cpu_to_be32((majrev << 16) | minrev); nip->local_port_num = port; - vendor = ipath_layer_get_vendorid(dd); nip->vendor_id[0] = 0; nip->vendor_id[1] = vendor >> 8; nip->vendor_id[2] = vendor; @@ -218,7 +215,7 @@ static int recv_subn_get_portinfo(struct ib_smp *smp, /* P_KeyViolations are counted by hardware. */ pip->pkey_violations = cpu_to_be16((ipath_layer_get_cr_errpkey(dev->dd) - - dev->z_pkey_violations) & 0xFFFF); + dev->n_pkey_violations) & 0xFFFF); pip->qkey_violations = cpu_to_be16(dev->qkey_violations); /* Only the hardware GUID is supported for now */ pip->guid_cap = 1; @@ -306,9 +303,9 @@ static int recv_subn_set_portinfo(struct ib_smp *smp, lid = be16_to_cpu(pip->lid); if (lid != ipath_layer_get_lid(dev->dd)) { /* Must be a valid unicast LID address. */ - if (lid == 0 || lid >= IPATH_MULTICAST_LID_BASE) + if (lid == 0 || lid >= IPS_MULTICAST_LID_BASE) goto err; - ipath_set_lid(dev->dd, lid, pip->mkeyprot_resv_lmc & 7); + ipath_set_sps_lid(dev->dd, lid, pip->mkeyprot_resv_lmc & 7); event.event = IB_EVENT_LID_CHANGE; ib_dispatch_event(&event); } @@ -316,7 +313,7 @@ static int recv_subn_set_portinfo(struct ib_smp *smp, smlid = be16_to_cpu(pip->sm_lid); if (smlid != dev->sm_lid) { /* Must be a valid unicast LID address. */ - if (smlid == 0 || smlid >= IPATH_MULTICAST_LID_BASE) + if (smlid == 0 || smlid >= IPS_MULTICAST_LID_BASE) goto err; dev->sm_lid = smlid; event.event = IB_EVENT_SM_CHANGE; @@ -392,7 +389,7 @@ static int recv_subn_set_portinfo(struct ib_smp *smp, * later. */ if (pip->pkey_violations == 0) - dev->z_pkey_violations = + dev->n_pkey_violations = ipath_layer_get_cr_errpkey(dev->dd); if (pip->qkey_violations == 0) @@ -613,9 +610,6 @@ struct ib_pma_portcounters { #define IB_PMA_SEL_PORT_RCV_ERRORS __constant_htons(0x0008) #define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS __constant_htons(0x0010) #define IB_PMA_SEL_PORT_XMIT_DISCARDS __constant_htons(0x0040) -#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS __constant_htons(0x0200) -#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS __constant_htons(0x0400) -#define IB_PMA_SEL_PORT_VL15_DROPPED __constant_htons(0x0800) #define IB_PMA_SEL_PORT_XMIT_DATA __constant_htons(0x1000) #define IB_PMA_SEL_PORT_RCV_DATA __constant_htons(0x2000) #define IB_PMA_SEL_PORT_XMIT_PACKETS __constant_htons(0x4000) @@ -850,22 +844,18 @@ static int recv_pma_get_portcounters(struct ib_perf *pmp, ipath_layer_get_counters(dev->dd, &cntrs); /* Adjust counters for any resets done. */ - cntrs.symbol_error_counter -= dev->z_symbol_error_counter; + cntrs.symbol_error_counter -= dev->n_symbol_error_counter; cntrs.link_error_recovery_counter -= - dev->z_link_error_recovery_counter; - cntrs.link_downed_counter -= dev->z_link_downed_counter; + dev->n_link_error_recovery_counter; + cntrs.link_downed_counter -= dev->n_link_downed_counter; cntrs.port_rcv_errors += dev->rcv_errors; - cntrs.port_rcv_errors -= dev->z_port_rcv_errors; - cntrs.port_rcv_remphys_errors -= dev->z_port_rcv_remphys_errors; - cntrs.port_xmit_discards -= dev->z_port_xmit_discards; - cntrs.port_xmit_data -= dev->z_port_xmit_data; - cntrs.port_rcv_data -= dev->z_port_rcv_data; - cntrs.port_xmit_packets -= dev->z_port_xmit_packets; - cntrs.port_rcv_packets -= dev->z_port_rcv_packets; - cntrs.local_link_integrity_errors -= - dev->z_local_link_integrity_errors; - cntrs.excessive_buffer_overrun_errors -= - dev->z_excessive_buffer_overrun_errors; + cntrs.port_rcv_errors -= dev->n_port_rcv_errors; + cntrs.port_rcv_remphys_errors -= dev->n_port_rcv_remphys_errors; + cntrs.port_xmit_discards -= dev->n_port_xmit_discards; + cntrs.port_xmit_data -= dev->n_port_xmit_data; + cntrs.port_rcv_data -= dev->n_port_rcv_data; + cntrs.port_xmit_packets -= dev->n_port_xmit_packets; + cntrs.port_rcv_packets -= dev->n_port_rcv_packets; memset(pmp->data, 0, sizeof(pmp->data)); @@ -903,16 +893,6 @@ static int recv_pma_get_portcounters(struct ib_perf *pmp, else p->port_xmit_discards = cpu_to_be16((u16)cntrs.port_xmit_discards); - if (cntrs.local_link_integrity_errors > 0xFUL) - cntrs.local_link_integrity_errors = 0xFUL; - if (cntrs.excessive_buffer_overrun_errors > 0xFUL) - cntrs.excessive_buffer_overrun_errors = 0xFUL; - p->lli_ebor_errors = (cntrs.local_link_integrity_errors << 4) | - cntrs.excessive_buffer_overrun_errors; - if (dev->n_vl15_dropped > 0xFFFFUL) - p->vl15_dropped = __constant_cpu_to_be16(0xFFFF); - else - p->vl15_dropped = cpu_to_be16((u16)dev->n_vl15_dropped); if (cntrs.port_xmit_data > 0xFFFFFFFFUL) p->port_xmit_data = __constant_cpu_to_be32(0xFFFFFFFF); else @@ -948,10 +928,10 @@ static int recv_pma_get_portcounters_ext(struct ib_perf *pmp, &rpkts, &xwait); /* Adjust counters for any resets done. */ - swords -= dev->z_port_xmit_data; - rwords -= dev->z_port_rcv_data; - spkts -= dev->z_port_xmit_packets; - rpkts -= dev->z_port_rcv_packets; + swords -= dev->n_port_xmit_data; + rwords -= dev->n_port_rcv_data; + spkts -= dev->n_port_xmit_packets; + rpkts -= dev->n_port_rcv_packets; memset(pmp->data, 0, sizeof(pmp->data)); @@ -987,48 +967,37 @@ static int recv_pma_set_portcounters(struct ib_perf *pmp, ipath_layer_get_counters(dev->dd, &cntrs); if (p->counter_select & IB_PMA_SEL_SYMBOL_ERROR) - dev->z_symbol_error_counter = cntrs.symbol_error_counter; + dev->n_symbol_error_counter = cntrs.symbol_error_counter; if (p->counter_select & IB_PMA_SEL_LINK_ERROR_RECOVERY) - dev->z_link_error_recovery_counter = + dev->n_link_error_recovery_counter = cntrs.link_error_recovery_counter; if (p->counter_select & IB_PMA_SEL_LINK_DOWNED) - dev->z_link_downed_counter = cntrs.link_downed_counter; + dev->n_link_downed_counter = cntrs.link_downed_counter; if (p->counter_select & IB_PMA_SEL_PORT_RCV_ERRORS) - dev->z_port_rcv_errors = + dev->n_port_rcv_errors = cntrs.port_rcv_errors + dev->rcv_errors; if (p->counter_select & IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS) - dev->z_port_rcv_remphys_errors = + dev->n_port_rcv_remphys_errors = cntrs.port_rcv_remphys_errors; if (p->counter_select & IB_PMA_SEL_PORT_XMIT_DISCARDS) - dev->z_port_xmit_discards = cntrs.port_xmit_discards; - - if (p->counter_select & IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS) - dev->z_local_link_integrity_errors = - cntrs.local_link_integrity_errors; - - if (p->counter_select & IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS) - dev->z_excessive_buffer_overrun_errors = - cntrs.excessive_buffer_overrun_errors; - - if (p->counter_select & IB_PMA_SEL_PORT_VL15_DROPPED) - dev->n_vl15_dropped = 0; + dev->n_port_xmit_discards = cntrs.port_xmit_discards; if (p->counter_select & IB_PMA_SEL_PORT_XMIT_DATA) - dev->z_port_xmit_data = cntrs.port_xmit_data; + dev->n_port_xmit_data = cntrs.port_xmit_data; if (p->counter_select & IB_PMA_SEL_PORT_RCV_DATA) - dev->z_port_rcv_data = cntrs.port_rcv_data; + dev->n_port_rcv_data = cntrs.port_rcv_data; if (p->counter_select & IB_PMA_SEL_PORT_XMIT_PACKETS) - dev->z_port_xmit_packets = cntrs.port_xmit_packets; + dev->n_port_xmit_packets = cntrs.port_xmit_packets; if (p->counter_select & IB_PMA_SEL_PORT_RCV_PACKETS) - dev->z_port_rcv_packets = cntrs.port_rcv_packets; + dev->n_port_rcv_packets = cntrs.port_rcv_packets; return recv_pma_get_portcounters(pmp, ibdev, port); } @@ -1045,16 +1014,16 @@ static int recv_pma_set_portcounters_ext(struct ib_perf *pmp, &rpkts, &xwait); if (p->counter_select & IB_PMA_SELX_PORT_XMIT_DATA) - dev->z_port_xmit_data = swords; + dev->n_port_xmit_data = swords; if (p->counter_select & IB_PMA_SELX_PORT_RCV_DATA) - dev->z_port_rcv_data = rwords; + dev->n_port_rcv_data = rwords; if (p->counter_select & IB_PMA_SELX_PORT_XMIT_PACKETS) - dev->z_port_xmit_packets = spkts; + dev->n_port_xmit_packets = spkts; if (p->counter_select & IB_PMA_SELX_PORT_RCV_PACKETS) - dev->z_port_rcv_packets = rpkts; + dev->n_port_rcv_packets = rpkts; if (p->counter_select & IB_PMA_SELX_PORT_UNI_XMIT_PACKETS) dev->n_unicast_xmit = 0; @@ -1303,8 +1272,32 @@ int ipath_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num, struct ib_wc *in_wc, struct ib_grh *in_grh, struct ib_mad *in_mad, struct ib_mad *out_mad) { + struct ipath_ibdev *dev = to_idev(ibdev); int ret; + /* + * Snapshot current HW counters to "clear" them. + * This should be done when the driver is loaded except that for + * some reason we get a zillion errors when brining up the link. + */ + if (dev->rcv_errors == 0) { + struct ipath_layer_counters cntrs; + + ipath_layer_get_counters(to_idev(ibdev)->dd, &cntrs); + dev->rcv_errors++; + dev->n_symbol_error_counter = cntrs.symbol_error_counter; + dev->n_link_error_recovery_counter = + cntrs.link_error_recovery_counter; + dev->n_link_downed_counter = cntrs.link_downed_counter; + dev->n_port_rcv_errors = cntrs.port_rcv_errors + 1; + dev->n_port_rcv_remphys_errors = + cntrs.port_rcv_remphys_errors; + dev->n_port_xmit_discards = cntrs.port_xmit_discards; + dev->n_port_xmit_data = cntrs.port_xmit_data; + dev->n_port_rcv_data = cntrs.port_rcv_data; + dev->n_port_xmit_packets = cntrs.port_xmit_packets; + dev->n_port_rcv_packets = cntrs.port_rcv_packets; + } switch (in_mad->mad_hdr.mgmt_class) { case IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE: case IB_MGMT_CLASS_SUBN_LID_ROUTED: diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_mr.c b/trunk/drivers/infiniband/hw/ipath/ipath_mr.c index 4ac31a5da330..69ffec66d45d 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_mr.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_mr.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -170,11 +169,6 @@ struct ib_mr *ipath_reg_user_mr(struct ib_pd *pd, struct ib_umem *region, int n, m, i; struct ib_mr *ret; - if (region->length == 0) { - ret = ERR_PTR(-EINVAL); - goto bail; - } - n = 0; list_for_each_entry(chunk, ®ion->chunk_list, list) n += chunk->nents; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_pe800.c b/trunk/drivers/infiniband/hw/ipath/ipath_pe800.c index b83f66d8262c..02e8c75b24f6 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_pe800.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_pe800.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -45,7 +44,7 @@ /* * This file contains all the chip-specific register information and - * access functions for the QLogic InfiniPath PE800, the PCI-Express chip. + * access functions for the PathScale PE800, the PCI-Express chip. * * This lists the InfiniPath PE800 registers, in the actual chip layout. * This structure should never be directly accessed. @@ -533,7 +532,7 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name, if (n) snprintf(name, namelen, "%s", n); - if (dd->ipath_majrev != 4 || !dd->ipath_minrev || dd->ipath_minrev>2) { + if (dd->ipath_majrev != 4 || dd->ipath_minrev != 1) { ipath_dev_err(dd, "Unsupported PE-800 revision %u.%u!\n", dd->ipath_majrev, dd->ipath_minrev); ret = 1; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_qp.c b/trunk/drivers/infiniband/hw/ipath/ipath_qp.c index 83e557be591e..9f8855d970c8 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_qp.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -35,7 +34,7 @@ #include #include "ipath_verbs.h" -#include "ipath_common.h" +#include "ips_common.h" #define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) #define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) @@ -333,11 +332,10 @@ static void ipath_reset_qp(struct ipath_qp *qp) qp->remote_qpn = 0; qp->qkey = 0; qp->qp_access_flags = 0; - clear_bit(IPATH_S_BUSY, &qp->s_flags); qp->s_hdrwords = 0; qp->s_psn = 0; qp->r_psn = 0; - qp->r_msn = 0; + atomic_set(&qp->msn, 0); if (qp->ibqp.qp_type == IB_QPT_RC) { qp->s_state = IB_OPCODE_RC_SEND_LAST; qp->r_state = IB_OPCODE_RC_SEND_LAST; @@ -346,8 +344,7 @@ static void ipath_reset_qp(struct ipath_qp *qp) qp->r_state = IB_OPCODE_UC_SEND_LAST; } qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE; - qp->r_ack_state = IB_OPCODE_RC_ACKNOWLEDGE; - qp->r_nak_state = 0; + qp->s_nak_state = 0; qp->s_rnr_timeout = 0; qp->s_head = 0; qp->s_tail = 0; @@ -365,10 +362,10 @@ static void ipath_reset_qp(struct ipath_qp *qp) * @qp: the QP to put into an error state * * Flushes both send and receive work queues. - * QP s_lock should be held and interrupts disabled. + * QP r_rq.lock and s_lock should be held. */ -void ipath_error_qp(struct ipath_qp *qp) +static void ipath_error_qp(struct ipath_qp *qp) { struct ipath_ibdev *dev = to_idev(qp->ibqp.device); struct ib_wc wc; @@ -411,14 +408,12 @@ void ipath_error_qp(struct ipath_qp *qp) qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE; wc.opcode = IB_WC_RECV; - spin_lock(&qp->r_rq.lock); while (qp->r_rq.tail != qp->r_rq.head) { wc.wr_id = get_rwqe_ptr(&qp->r_rq, qp->r_rq.tail)->wr_id; if (++qp->r_rq.tail >= qp->r_rq.size) qp->r_rq.tail = 0; ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1); } - spin_unlock(&qp->r_rq.lock); } /** @@ -438,7 +433,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, unsigned long flags; int ret; - spin_lock_irqsave(&qp->s_lock, flags); + spin_lock_irqsave(&qp->r_rq.lock, flags); + spin_lock(&qp->s_lock); cur_state = attr_mask & IB_QP_CUR_STATE ? attr->cur_qp_state : qp->state; @@ -450,7 +446,7 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, if (attr_mask & IB_QP_AV) if (attr->ah_attr.dlid == 0 || - attr->ah_attr.dlid >= IPATH_MULTICAST_LID_BASE) + attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE) goto inval; if (attr_mask & IB_QP_PKEY_INDEX) @@ -509,19 +505,34 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, } if (attr_mask & IB_QP_MIN_RNR_TIMER) - qp->r_min_rnr_timer = attr->min_rnr_timer; + qp->s_min_rnr_timer = attr->min_rnr_timer; if (attr_mask & IB_QP_QKEY) qp->qkey = attr->qkey; + if (attr_mask & IB_QP_PKEY_INDEX) + qp->s_pkey_index = attr->pkey_index; + qp->state = new_state; - spin_unlock_irqrestore(&qp->s_lock, flags); + spin_unlock(&qp->s_lock); + spin_unlock_irqrestore(&qp->r_rq.lock, flags); + + /* + * If QP1 changed to the RTS state, try to move to the link to INIT + * even if it was ACTIVE so the SM will reinitialize the SMA's + * state. + */ + if (qp->ibqp.qp_num == 1 && new_state == IB_QPS_RTS) { + struct ipath_ibdev *dev = to_idev(ibqp->device); + ipath_layer_set_linkstate(dev->dd, IPATH_IB_LINKDOWN); + } ret = 0; goto bail; inval: - spin_unlock_irqrestore(&qp->s_lock, flags); + spin_unlock(&qp->s_lock); + spin_unlock_irqrestore(&qp->r_rq.lock, flags); ret = -EINVAL; bail: @@ -555,7 +566,7 @@ int ipath_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, attr->sq_draining = 0; attr->max_rd_atomic = 1; attr->max_dest_rd_atomic = 1; - attr->min_rnr_timer = qp->r_min_rnr_timer; + attr->min_rnr_timer = qp->s_min_rnr_timer; attr->port_num = 1; attr->timeout = 0; attr->retry_cnt = qp->s_retry_cnt; @@ -582,17 +593,21 @@ int ipath_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, * @qp: the queue pair to compute the AETH for * * Returns the AETH. + * + * The QP s_lock should be held. */ __be32 ipath_compute_aeth(struct ipath_qp *qp) { - u32 aeth = qp->r_msn & IPATH_MSN_MASK; + u32 aeth = atomic_read(&qp->msn) & IPS_MSN_MASK; - if (qp->ibqp.srq) { + if (qp->s_nak_state) { + aeth |= qp->s_nak_state << IPS_AETH_CREDIT_SHIFT; + } else if (qp->ibqp.srq) { /* * Shared receive queues don't generate credits. * Set the credit field to the invalid value. */ - aeth |= IPATH_AETH_CREDIT_INVAL << IPATH_AETH_CREDIT_SHIFT; + aeth |= IPS_AETH_CREDIT_INVAL << IPS_AETH_CREDIT_SHIFT; } else { u32 min, max, x; u32 credits; @@ -622,7 +637,7 @@ __be32 ipath_compute_aeth(struct ipath_qp *qp) else min = x; } - aeth |= x << IPATH_AETH_CREDIT_SHIFT; + aeth |= x << IPS_AETH_CREDIT_SHIFT; } return cpu_to_be32(aeth); } @@ -648,22 +663,12 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, size_t sz; struct ib_qp *ret; - if (init_attr->cap.max_send_sge > ib_ipath_max_sges || - init_attr->cap.max_recv_sge > ib_ipath_max_sges || - init_attr->cap.max_send_wr > ib_ipath_max_qp_wrs || - init_attr->cap.max_recv_wr > ib_ipath_max_qp_wrs) { + if (init_attr->cap.max_send_sge > 255 || + init_attr->cap.max_recv_sge > 255) { ret = ERR_PTR(-ENOMEM); goto bail; } - if (init_attr->cap.max_send_sge + - init_attr->cap.max_recv_sge + - init_attr->cap.max_send_wr + - init_attr->cap.max_recv_wr == 0) { - ret = ERR_PTR(-EINVAL); - goto bail; - } - switch (init_attr->qp_type) { case IB_QPT_UC: case IB_QPT_RC: @@ -681,26 +686,18 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, case IB_QPT_GSI: qp = kmalloc(sizeof(*qp), GFP_KERNEL); if (!qp) { - vfree(swq); ret = ERR_PTR(-ENOMEM); goto bail; } - if (init_attr->srq) { - qp->r_rq.size = 0; - qp->r_rq.max_sge = 0; - qp->r_rq.wq = NULL; - } else { - qp->r_rq.size = init_attr->cap.max_recv_wr + 1; - qp->r_rq.max_sge = init_attr->cap.max_recv_sge; - sz = (sizeof(struct ipath_sge) * qp->r_rq.max_sge) + - sizeof(struct ipath_rwqe); - qp->r_rq.wq = vmalloc(qp->r_rq.size * sz); - if (!qp->r_rq.wq) { - kfree(qp); - vfree(swq); - ret = ERR_PTR(-ENOMEM); - goto bail; - } + qp->r_rq.size = init_attr->cap.max_recv_wr + 1; + sz = sizeof(struct ipath_sge) * + init_attr->cap.max_recv_sge + + sizeof(struct ipath_rwqe); + qp->r_rq.wq = vmalloc(qp->r_rq.size * sz); + if (!qp->r_rq.wq) { + kfree(qp); + ret = ERR_PTR(-ENOMEM); + goto bail; } /* @@ -711,7 +708,9 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, spin_lock_init(&qp->r_rq.lock); atomic_set(&qp->refcount, 0); init_waitqueue_head(&qp->wait); - tasklet_init(&qp->s_task, ipath_do_ruc_send, + tasklet_init(&qp->s_task, + init_attr->qp_type == IB_QPT_RC ? + ipath_do_rc_send : ipath_do_uc_send, (unsigned long)qp); INIT_LIST_HEAD(&qp->piowait); INIT_LIST_HEAD(&qp->timerwait); @@ -719,6 +718,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, qp->s_wq = swq; qp->s_size = init_attr->cap.max_send_wr + 1; qp->s_max_sge = init_attr->cap.max_send_sge; + qp->r_rq.max_sge = init_attr->cap.max_recv_sge; qp->s_flags = init_attr->sq_sig_type == IB_SIGNAL_REQ_WR ? 1 << IPATH_S_SIGNAL_REQ_WR : 0; dev = to_idev(ibpd->device); @@ -888,18 +888,18 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc) */ void ipath_get_credit(struct ipath_qp *qp, u32 aeth) { - u32 credit = (aeth >> IPATH_AETH_CREDIT_SHIFT) & IPATH_AETH_CREDIT_MASK; + u32 credit = (aeth >> IPS_AETH_CREDIT_SHIFT) & IPS_AETH_CREDIT_MASK; /* * If the credit is invalid, we can send * as many packets as we like. Otherwise, we have to * honor the credit field. */ - if (credit == IPATH_AETH_CREDIT_INVAL) + if (credit == IPS_AETH_CREDIT_INVAL) { qp->s_lsn = (u32) -1; - else if (qp->s_lsn != (u32) -1) { + } else if (qp->s_lsn != (u32) -1) { /* Compute new LSN (i.e., MSN + credit) */ - credit = (aeth + credit_table[credit]) & IPATH_MSN_MASK; + credit = (aeth + credit_table[credit]) & IPS_MSN_MASK; if (ipath_cmp24(credit, qp->s_lsn) > 0) qp->s_lsn = credit; } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_rc.c b/trunk/drivers/infiniband/hw/ipath/ipath_rc.c index 774d1615ce2f..493b1821a934 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_rc.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_rc.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -32,7 +31,7 @@ */ #include "ipath_verbs.h" -#include "ipath_common.h" +#include "ips_common.h" /* cut down ridiculously long IB macro names */ #define OP(x) IB_OPCODE_RC_##x @@ -42,14 +41,14 @@ * @qp: the QP who's SGE we're restarting * @wqe: the work queue to initialize the QP's SGE from * - * The QP s_lock should be held and interrupts disabled. + * The QP s_lock should be held. */ static void ipath_init_restart(struct ipath_qp *qp, struct ipath_swqe *wqe) { struct ipath_ibdev *dev; u32 len; - len = ((qp->s_psn - wqe->psn) & IPATH_PSN_MASK) * + len = ((qp->s_psn - wqe->psn) & IPS_PSN_MASK) * ib_mtu_enum_to_int(qp->path_mtu); qp->s_sge.sge = wqe->sg_list[0]; qp->s_sge.sg_list = wqe->sg_list + 1; @@ -73,10 +72,11 @@ static void ipath_init_restart(struct ipath_qp *qp, struct ipath_swqe *wqe) * Return bth0 if constructed; otherwise, return 0. * Note the QP s_lock must be held. */ -u32 ipath_make_rc_ack(struct ipath_qp *qp, - struct ipath_other_headers *ohdr, - u32 pmtu) +static inline u32 ipath_make_rc_ack(struct ipath_qp *qp, + struct ipath_other_headers *ohdr, + u32 pmtu) { + struct ipath_sge_state *ss; u32 hwords; u32 len; u32 bth0; @@ -90,12 +90,13 @@ u32 ipath_make_rc_ack(struct ipath_qp *qp, */ switch (qp->s_ack_state) { case OP(RDMA_READ_REQUEST): - qp->s_cur_sge = &qp->s_rdma_sge; + ss = &qp->s_rdma_sge; len = qp->s_rdma_len; if (len > pmtu) { len = pmtu; qp->s_ack_state = OP(RDMA_READ_RESPONSE_FIRST); - } else + } + else qp->s_ack_state = OP(RDMA_READ_RESPONSE_ONLY); qp->s_rdma_len -= len; bth0 = qp->s_ack_state << 24; @@ -107,7 +108,7 @@ u32 ipath_make_rc_ack(struct ipath_qp *qp, qp->s_ack_state = OP(RDMA_READ_RESPONSE_MIDDLE); /* FALLTHROUGH */ case OP(RDMA_READ_RESPONSE_MIDDLE): - qp->s_cur_sge = &qp->s_rdma_sge; + ss = &qp->s_rdma_sge; len = qp->s_rdma_len; if (len > pmtu) len = pmtu; @@ -126,50 +127,41 @@ u32 ipath_make_rc_ack(struct ipath_qp *qp, * We have to prevent new requests from changing * the r_sge state while a ipath_verbs_send() * is in progress. + * Changing r_state allows the receiver + * to continue processing new packets. + * We do it here now instead of above so + * that we are sure the packet was sent before + * changing the state. */ + qp->r_state = OP(RDMA_READ_RESPONSE_LAST); qp->s_ack_state = OP(ACKNOWLEDGE); - bth0 = 0; - goto bail; + return 0; case OP(COMPARE_SWAP): case OP(FETCH_ADD): - qp->s_cur_sge = NULL; + ss = NULL; len = 0; - /* - * Set the s_ack_state so the receive interrupt handler - * won't try to send an ACK (out of order) until this one - * is actually sent. - */ - qp->s_ack_state = OP(RDMA_READ_RESPONSE_LAST); - bth0 = OP(ATOMIC_ACKNOWLEDGE) << 24; + qp->r_state = OP(SEND_LAST); + qp->s_ack_state = OP(ACKNOWLEDGE); + bth0 = IB_OPCODE_ATOMIC_ACKNOWLEDGE << 24; ohdr->u.at.aeth = ipath_compute_aeth(qp); - ohdr->u.at.atomic_ack_eth = cpu_to_be64(qp->r_atomic_data); + ohdr->u.at.atomic_ack_eth = cpu_to_be64(qp->s_ack_atomic); hwords += sizeof(ohdr->u.at) / 4; break; default: /* Send a regular ACK. */ - qp->s_cur_sge = NULL; + ss = NULL; len = 0; - /* - * Set the s_ack_state so the receive interrupt handler - * won't try to send an ACK (out of order) until this one - * is actually sent. - */ - qp->s_ack_state = OP(RDMA_READ_RESPONSE_LAST); - bth0 = OP(ACKNOWLEDGE) << 24; - if (qp->s_nak_state) - ohdr->u.aeth = cpu_to_be32((qp->r_msn & IPATH_MSN_MASK) | - (qp->s_nak_state << - IPATH_AETH_CREDIT_SHIFT)); - else - ohdr->u.aeth = ipath_compute_aeth(qp); + qp->s_ack_state = OP(ACKNOWLEDGE); + bth0 = qp->s_ack_state << 24; + ohdr->u.aeth = ipath_compute_aeth(qp); hwords++; } qp->s_hdrwords = hwords; + qp->s_cur_sge = ss; qp->s_cur_size = len; -bail: return bth0; } @@ -182,11 +174,11 @@ u32 ipath_make_rc_ack(struct ipath_qp *qp, * @bth2p: pointer to the BTH PSN word * * Return 1 if constructed; otherwise, return 0. - * Note the QP s_lock must be held and interrupts disabled. + * Note the QP s_lock must be held. */ -int ipath_make_rc_req(struct ipath_qp *qp, - struct ipath_other_headers *ohdr, - u32 pmtu, u32 *bth0p, u32 *bth2p) +static inline int ipath_make_rc_req(struct ipath_qp *qp, + struct ipath_other_headers *ohdr, + u32 pmtu, u32 *bth0p, u32 *bth2p) { struct ipath_ibdev *dev = to_idev(qp->ibqp.device); struct ipath_sge_state *ss; @@ -265,7 +257,7 @@ int ipath_make_rc_req(struct ipath_qp *qp, break; case IB_WR_RDMA_WRITE: - if (newreq && qp->s_lsn != (u32) -1) + if (newreq) qp->s_lsn++; /* FALLTHROUGH */ case IB_WR_RDMA_WRITE_WITH_IMM: @@ -291,7 +283,8 @@ int ipath_make_rc_req(struct ipath_qp *qp, else { qp->s_state = OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE); - /* Immediate data comes after RETH */ + /* Immediate data comes + * after RETH */ ohdr->u.rc.imm_data = wqe->wr.imm_data; hwords += 1; if (wqe->wr.send_flags & IB_SEND_SOLICITED) @@ -311,8 +304,7 @@ int ipath_make_rc_req(struct ipath_qp *qp, qp->s_state = OP(RDMA_READ_REQUEST); hwords += sizeof(ohdr->u.rc.reth) / 4; if (newreq) { - if (qp->s_lsn != (u32) -1) - qp->s_lsn++; + qp->s_lsn++; /* * Adjust s_next_psn to count the * expected number of responses. @@ -343,8 +335,7 @@ int ipath_make_rc_req(struct ipath_qp *qp, wqe->wr.wr.atomic.compare_add); hwords += sizeof(struct ib_atomic_eth) / 4; if (newreq) { - if (qp->s_lsn != (u32) -1) - qp->s_lsn++; + qp->s_lsn++; wqe->lpsn = wqe->psn; } if (++qp->s_cur == qp->s_size) @@ -361,14 +352,9 @@ int ipath_make_rc_req(struct ipath_qp *qp, if (qp->s_tail >= qp->s_size) qp->s_tail = 0; } - bth2 |= qp->s_psn++ & IPATH_PSN_MASK; + bth2 |= qp->s_psn++ & IPS_PSN_MASK; if ((int)(qp->s_psn - qp->s_next_psn) > 0) qp->s_next_psn = qp->s_psn; - /* - * Put the QP on the pending list so lost ACKs will cause - * a retry. More than one request can be pending so the - * QP may already be on the dev->pending list. - */ spin_lock(&dev->pending_lock); if (list_empty(&qp->timerwait)) list_add_tail(&qp->timerwait, @@ -378,8 +364,8 @@ int ipath_make_rc_req(struct ipath_qp *qp, case OP(RDMA_READ_RESPONSE_FIRST): /* - * This case can only happen if a send is restarted. - * See ipath_restart_rc(). + * This case can only happen if a send is restarted. See + * ipath_restart_rc(). */ ipath_init_restart(qp, wqe); /* FALLTHROUGH */ @@ -387,7 +373,7 @@ int ipath_make_rc_req(struct ipath_qp *qp, qp->s_state = OP(SEND_MIDDLE); /* FALLTHROUGH */ case OP(SEND_MIDDLE): - bth2 = qp->s_psn++ & IPATH_PSN_MASK; + bth2 = qp->s_psn++ & IPS_PSN_MASK; if ((int)(qp->s_psn - qp->s_next_psn) > 0) qp->s_next_psn = qp->s_psn; ss = &qp->s_sge; @@ -429,7 +415,7 @@ int ipath_make_rc_req(struct ipath_qp *qp, qp->s_state = OP(RDMA_WRITE_MIDDLE); /* FALLTHROUGH */ case OP(RDMA_WRITE_MIDDLE): - bth2 = qp->s_psn++ & IPATH_PSN_MASK; + bth2 = qp->s_psn++ & IPS_PSN_MASK; if ((int)(qp->s_psn - qp->s_next_psn) > 0) qp->s_next_psn = qp->s_psn; ss = &qp->s_sge; @@ -466,7 +452,7 @@ int ipath_make_rc_req(struct ipath_qp *qp, * See ipath_restart_rc(). */ ipath_init_restart(qp, wqe); - len = ((qp->s_psn - wqe->psn) & IPATH_PSN_MASK) * pmtu; + len = ((qp->s_psn - wqe->psn) & IPS_PSN_MASK) * pmtu; ohdr->u.rc.reth.vaddr = cpu_to_be64(wqe->wr.wr.rdma.remote_addr + len); ohdr->u.rc.reth.rkey = @@ -474,7 +460,7 @@ int ipath_make_rc_req(struct ipath_qp *qp, ohdr->u.rc.reth.length = cpu_to_be32(qp->s_len); qp->s_state = OP(RDMA_READ_REQUEST); hwords += sizeof(ohdr->u.rc.reth) / 4; - bth2 = qp->s_psn++ & IPATH_PSN_MASK; + bth2 = qp->s_psn++ & IPS_PSN_MASK; if ((int)(qp->s_psn - qp->s_next_psn) > 0) qp->s_next_psn = qp->s_psn; ss = NULL; @@ -510,169 +496,189 @@ int ipath_make_rc_req(struct ipath_qp *qp, return 0; } +static inline void ipath_make_rc_grh(struct ipath_qp *qp, + struct ib_global_route *grh, + u32 nwords) +{ + struct ipath_ibdev *dev = to_idev(qp->ibqp.device); + + /* GRH header size in 32-bit words. */ + qp->s_hdrwords += 10; + qp->s_hdr.u.l.grh.version_tclass_flow = + cpu_to_be32((6 << 28) | + (grh->traffic_class << 20) | + grh->flow_label); + qp->s_hdr.u.l.grh.paylen = + cpu_to_be16(((qp->s_hdrwords - 12) + nwords + + SIZE_OF_CRC) << 2); + /* next_hdr is defined by C8-7 in ch. 8.4.1 */ + qp->s_hdr.u.l.grh.next_hdr = 0x1B; + qp->s_hdr.u.l.grh.hop_limit = grh->hop_limit; + /* The SGID is 32-bit aligned. */ + qp->s_hdr.u.l.grh.sgid.global.subnet_prefix = dev->gid_prefix; + qp->s_hdr.u.l.grh.sgid.global.interface_id = + ipath_layer_get_guid(dev->dd); + qp->s_hdr.u.l.grh.dgid = grh->dgid; +} + /** - * send_rc_ack - Construct an ACK packet and send it - * @qp: a pointer to the QP + * ipath_do_rc_send - perform a send on an RC QP + * @data: contains a pointer to the QP * - * This is called from ipath_rc_rcv() and only uses the receive - * side QP state. - * Note that RDMA reads are handled in the send side QP state and tasklet. + * Process entries in the send work queue until credit or queue is + * exhausted. Only allow one CPU to send a packet per QP (tasklet). + * Otherwise, after we drop the QP s_lock, two threads could send + * packets out of order. */ -static void send_rc_ack(struct ipath_qp *qp) +void ipath_do_rc_send(unsigned long data) { + struct ipath_qp *qp = (struct ipath_qp *)data; struct ipath_ibdev *dev = to_idev(qp->ibqp.device); + unsigned long flags; u16 lrh0; + u32 nwords; + u32 extra_bytes; u32 bth0; - u32 hwords; - struct ipath_ib_header hdr; + u32 bth2; + u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu); struct ipath_other_headers *ohdr; - /* Construct the header. */ - ohdr = &hdr.u.oth; - lrh0 = IPATH_LRH_BTH; - /* header size in 32-bit words LRH+BTH+AETH = (8+12+4)/4. */ - hwords = 6; - if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) { - hwords += ipath_make_grh(dev, &hdr.u.l.grh, - &qp->remote_ah_attr.grh, - hwords, 0); - ohdr = &hdr.u.l.oth; - lrh0 = IPATH_LRH_GRH; - } - /* read pkey_index w/o lock (its atomic) */ - bth0 = ipath_layer_get_pkey(dev->dd, qp->s_pkey_index); - if (qp->r_nak_state) - ohdr->u.aeth = cpu_to_be32((qp->r_msn & IPATH_MSN_MASK) | - (qp->r_nak_state << - IPATH_AETH_CREDIT_SHIFT)); - else - ohdr->u.aeth = ipath_compute_aeth(qp); - if (qp->r_ack_state >= OP(COMPARE_SWAP)) { - bth0 |= OP(ATOMIC_ACKNOWLEDGE) << 24; - ohdr->u.at.atomic_ack_eth = cpu_to_be64(qp->r_atomic_data); - hwords += sizeof(ohdr->u.at.atomic_ack_eth) / 4; - } else - bth0 |= OP(ACKNOWLEDGE) << 24; - lrh0 |= qp->remote_ah_attr.sl << 4; - hdr.lrh[0] = cpu_to_be16(lrh0); - hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid); - hdr.lrh[2] = cpu_to_be16(hwords + SIZE_OF_CRC); - hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd)); - ohdr->bth[0] = cpu_to_be32(bth0); - ohdr->bth[1] = cpu_to_be32(qp->remote_qpn); - ohdr->bth[2] = cpu_to_be32(qp->r_ack_psn & IPATH_PSN_MASK); + if (test_and_set_bit(IPATH_S_BUSY, &qp->s_flags)) + goto bail; + + if (unlikely(qp->remote_ah_attr.dlid == + ipath_layer_get_lid(dev->dd))) { + struct ib_wc wc; - /* - * If we can send the ACK, clear the ACK state. - */ - if (ipath_verbs_send(dev->dd, hwords, (u32 *) &hdr, 0, NULL) == 0) { - qp->r_ack_state = OP(ACKNOWLEDGE); - dev->n_unicast_xmit++; - } else { /* - * We are out of PIO buffers at the moment. - * Pass responsibility for sending the ACK to the - * send tasklet so that when a PIO buffer becomes - * available, the ACK is sent ahead of other outgoing - * packets. + * Pass in an uninitialized ib_wc to be consistent with + * other places where ipath_ruc_loopback() is called. */ - dev->n_rc_qacks++; - spin_lock_irq(&qp->s_lock); - /* Don't coalesce if a RDMA read or atomic is pending. */ - if (qp->s_ack_state == OP(ACKNOWLEDGE) || - qp->s_ack_state < OP(RDMA_READ_REQUEST)) { - qp->s_ack_state = qp->r_ack_state; - qp->s_nak_state = qp->r_nak_state; - qp->s_ack_psn = qp->r_ack_psn; - qp->r_ack_state = OP(ACKNOWLEDGE); - } - spin_unlock_irq(&qp->s_lock); - - /* Call ipath_do_rc_send() in another thread. */ - tasklet_hi_schedule(&qp->s_task); - } -} - -/** - * reset_psn - reset the QP state to send starting from PSN - * @qp: the QP - * @psn: the packet sequence number to restart at - * - * This is called from ipath_rc_rcv() to process an incoming RC ACK - * for the given QP. - * Called at interrupt level with the QP s_lock held. - */ -static void reset_psn(struct ipath_qp *qp, u32 psn) -{ - u32 n = qp->s_last; - struct ipath_swqe *wqe = get_swqe_ptr(qp, n); - u32 opcode; - - qp->s_cur = n; - - /* - * If we are starting the request from the beginning, - * let the normal send code handle initialization. - */ - if (ipath_cmp24(psn, wqe->psn) <= 0) { - qp->s_state = OP(SEND_LAST); - goto done; + ipath_ruc_loopback(qp, &wc); + goto clear; } - /* Find the work request opcode corresponding to the given PSN. */ - opcode = wqe->wr.opcode; - for (;;) { - int diff; + ohdr = &qp->s_hdr.u.oth; + if (qp->remote_ah_attr.ah_flags & IB_AH_GRH) + ohdr = &qp->s_hdr.u.l.oth; - if (++n == qp->s_size) - n = 0; - if (n == qp->s_tail) - break; - wqe = get_swqe_ptr(qp, n); - diff = ipath_cmp24(psn, wqe->psn); - if (diff < 0) - break; - qp->s_cur = n; +again: + /* Check for a constructed packet to be sent. */ + if (qp->s_hdrwords != 0) { /* - * If we are starting the request from the beginning, - * let the normal send code handle initialization. + * If no PIO bufs are available, return. An interrupt will + * call ipath_ib_piobufavail() when one is available. */ - if (diff == 0) { - qp->s_state = OP(SEND_LAST); - goto done; + _VERBS_INFO("h %u %p\n", qp->s_hdrwords, &qp->s_hdr); + _VERBS_INFO("d %u %p %u %p %u %u %u %u\n", qp->s_cur_size, + qp->s_cur_sge->sg_list, + qp->s_cur_sge->num_sge, + qp->s_cur_sge->sge.vaddr, + qp->s_cur_sge->sge.sge_length, + qp->s_cur_sge->sge.length, + qp->s_cur_sge->sge.m, + qp->s_cur_sge->sge.n); + if (ipath_verbs_send(dev->dd, qp->s_hdrwords, + (u32 *) &qp->s_hdr, qp->s_cur_size, + qp->s_cur_sge)) { + ipath_no_bufs_available(qp, dev); + goto bail; } - opcode = wqe->wr.opcode; + dev->n_unicast_xmit++; + /* Record that we sent the packet and s_hdr is empty. */ + qp->s_hdrwords = 0; } /* - * Set the state to restart in the middle of a request. - * Don't change the s_sge, s_cur_sge, or s_cur_size. - * See ipath_do_rc_send(). + * The lock is needed to synchronize between setting + * qp->s_ack_state, resend timer, and post_send(). */ - switch (opcode) { - case IB_WR_SEND: - case IB_WR_SEND_WITH_IMM: - qp->s_state = OP(RDMA_READ_RESPONSE_FIRST); - break; + spin_lock_irqsave(&qp->s_lock, flags); - case IB_WR_RDMA_WRITE: - case IB_WR_RDMA_WRITE_WITH_IMM: - qp->s_state = OP(RDMA_READ_RESPONSE_LAST); - break; + /* Sending responses has higher priority over sending requests. */ + if (qp->s_ack_state != OP(ACKNOWLEDGE) && + (bth0 = ipath_make_rc_ack(qp, ohdr, pmtu)) != 0) + bth2 = qp->s_ack_psn++ & IPS_PSN_MASK; + else if (!ipath_make_rc_req(qp, ohdr, pmtu, &bth0, &bth2)) + goto done; - case IB_WR_RDMA_READ: - qp->s_state = OP(RDMA_READ_RESPONSE_MIDDLE); - break; + spin_unlock_irqrestore(&qp->s_lock, flags); - default: - /* - * This case shouldn't happen since its only - * one PSN per req. - */ - qp->s_state = OP(SEND_LAST); + /* Construct the header. */ + extra_bytes = (4 - qp->s_cur_size) & 3; + nwords = (qp->s_cur_size + extra_bytes) >> 2; + lrh0 = IPS_LRH_BTH; + if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) { + ipath_make_rc_grh(qp, &qp->remote_ah_attr.grh, nwords); + lrh0 = IPS_LRH_GRH; } + lrh0 |= qp->remote_ah_attr.sl << 4; + qp->s_hdr.lrh[0] = cpu_to_be16(lrh0); + qp->s_hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid); + qp->s_hdr.lrh[2] = cpu_to_be16(qp->s_hdrwords + nwords + + SIZE_OF_CRC); + qp->s_hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd)); + bth0 |= ipath_layer_get_pkey(dev->dd, qp->s_pkey_index); + bth0 |= extra_bytes << 20; + ohdr->bth[0] = cpu_to_be32(bth0); + ohdr->bth[1] = cpu_to_be32(qp->remote_qpn); + ohdr->bth[2] = cpu_to_be32(bth2); + + /* Check for more work to do. */ + goto again; + done: - qp->s_psn = psn; + spin_unlock_irqrestore(&qp->s_lock, flags); +clear: + clear_bit(IPATH_S_BUSY, &qp->s_flags); +bail: + return; +} + +static void send_rc_ack(struct ipath_qp *qp) +{ + struct ipath_ibdev *dev = to_idev(qp->ibqp.device); + u16 lrh0; + u32 bth0; + struct ipath_other_headers *ohdr; + + /* Construct the header. */ + ohdr = &qp->s_hdr.u.oth; + lrh0 = IPS_LRH_BTH; + /* header size in 32-bit words LRH+BTH+AETH = (8+12+4)/4. */ + qp->s_hdrwords = 6; + if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) { + ipath_make_rc_grh(qp, &qp->remote_ah_attr.grh, 0); + ohdr = &qp->s_hdr.u.l.oth; + lrh0 = IPS_LRH_GRH; + } + bth0 = ipath_layer_get_pkey(dev->dd, qp->s_pkey_index); + ohdr->u.aeth = ipath_compute_aeth(qp); + if (qp->s_ack_state >= OP(COMPARE_SWAP)) { + bth0 |= IB_OPCODE_ATOMIC_ACKNOWLEDGE << 24; + ohdr->u.at.atomic_ack_eth = cpu_to_be64(qp->s_ack_atomic); + qp->s_hdrwords += sizeof(ohdr->u.at.atomic_ack_eth) / 4; + } + else + bth0 |= OP(ACKNOWLEDGE) << 24; + lrh0 |= qp->remote_ah_attr.sl << 4; + qp->s_hdr.lrh[0] = cpu_to_be16(lrh0); + qp->s_hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid); + qp->s_hdr.lrh[2] = cpu_to_be16(qp->s_hdrwords + SIZE_OF_CRC); + qp->s_hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd)); + ohdr->bth[0] = cpu_to_be32(bth0); + ohdr->bth[1] = cpu_to_be32(qp->remote_qpn); + ohdr->bth[2] = cpu_to_be32(qp->s_ack_psn & IPS_PSN_MASK); + + /* + * If we can send the ACK, clear the ACK state. + */ + if (ipath_verbs_send(dev->dd, qp->s_hdrwords, (u32 *) &qp->s_hdr, + 0, NULL) == 0) { + qp->s_ack_state = OP(ACKNOWLEDGE); + dev->n_rc_qacks++; + dev->n_unicast_xmit++; + } } /** @@ -681,12 +687,13 @@ static void reset_psn(struct ipath_qp *qp, u32 psn) * @psn: packet sequence number for the request * @wc: the work completion request * - * The QP s_lock should be held and interrupts disabled. + * The QP s_lock should be held. */ void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc) { struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last); struct ipath_ibdev *dev; + u32 n; /* * If there are no requests pending, we are done. @@ -728,7 +735,62 @@ void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc) else dev->n_rc_resends += (int)qp->s_psn - (int)psn; - reset_psn(qp, psn); + /* + * If we are starting the request from the beginning, let the normal + * send code handle initialization. + */ + qp->s_cur = qp->s_last; + if (ipath_cmp24(psn, wqe->psn) <= 0) { + qp->s_state = OP(SEND_LAST); + qp->s_psn = wqe->psn; + } else { + n = qp->s_cur; + for (;;) { + if (++n == qp->s_size) + n = 0; + if (n == qp->s_tail) { + if (ipath_cmp24(psn, qp->s_next_psn) >= 0) { + qp->s_cur = n; + wqe = get_swqe_ptr(qp, n); + } + break; + } + wqe = get_swqe_ptr(qp, n); + if (ipath_cmp24(psn, wqe->psn) < 0) + break; + qp->s_cur = n; + } + qp->s_psn = psn; + + /* + * Reset the state to restart in the middle of a request. + * Don't change the s_sge, s_cur_sge, or s_cur_size. + * See ipath_do_rc_send(). + */ + switch (wqe->wr.opcode) { + case IB_WR_SEND: + case IB_WR_SEND_WITH_IMM: + qp->s_state = OP(RDMA_READ_RESPONSE_FIRST); + break; + + case IB_WR_RDMA_WRITE: + case IB_WR_RDMA_WRITE_WITH_IMM: + qp->s_state = OP(RDMA_READ_RESPONSE_LAST); + break; + + case IB_WR_RDMA_READ: + qp->s_state = + OP(RDMA_READ_RESPONSE_MIDDLE); + break; + + default: + /* + * This case shouldn't happen since its only + * one PSN per req. + */ + qp->s_state = OP(SEND_LAST); + } + } done: tasklet_hi_schedule(&qp->s_task); @@ -737,15 +799,77 @@ void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc) return; } +/** + * reset_psn - reset the QP state to send starting from PSN + * @qp: the QP + * @psn: the packet sequence number to restart at + * + * This is called from ipath_rc_rcv() to process an incoming RC ACK + * for the given QP. + * Called at interrupt level with the QP s_lock held. + */ +static void reset_psn(struct ipath_qp *qp, u32 psn) +{ + struct ipath_swqe *wqe; + u32 n; + + n = qp->s_cur; + wqe = get_swqe_ptr(qp, n); + for (;;) { + if (++n == qp->s_size) + n = 0; + if (n == qp->s_tail) { + if (ipath_cmp24(psn, qp->s_next_psn) >= 0) { + qp->s_cur = n; + wqe = get_swqe_ptr(qp, n); + } + break; + } + wqe = get_swqe_ptr(qp, n); + if (ipath_cmp24(psn, wqe->psn) < 0) + break; + qp->s_cur = n; + } + qp->s_psn = psn; + + /* + * Set the state to restart in the middle of a + * request. Don't change the s_sge, s_cur_sge, or + * s_cur_size. See ipath_do_rc_send(). + */ + switch (wqe->wr.opcode) { + case IB_WR_SEND: + case IB_WR_SEND_WITH_IMM: + qp->s_state = OP(RDMA_READ_RESPONSE_FIRST); + break; + + case IB_WR_RDMA_WRITE: + case IB_WR_RDMA_WRITE_WITH_IMM: + qp->s_state = OP(RDMA_READ_RESPONSE_LAST); + break; + + case IB_WR_RDMA_READ: + qp->s_state = OP(RDMA_READ_RESPONSE_MIDDLE); + break; + + default: + /* + * This case shouldn't happen since its only + * one PSN per req. + */ + qp->s_state = OP(SEND_LAST); + } +} + /** * do_rc_ack - process an incoming RC ACK * @qp: the QP the ACK came in on * @psn: the packet sequence number of the ACK * @opcode: the opcode of the request that resulted in the ACK * - * This is called from ipath_rc_rcv_resp() to process an incoming RC ACK + * This is called from ipath_rc_rcv() to process an incoming RC ACK * for the given QP. - * Called at interrupt level with the QP s_lock held and interrupts disabled. + * Called at interrupt level with the QP s_lock held. * Returns 1 if OK, 0 if current operation should be aborted (NAK). */ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode) @@ -882,16 +1006,26 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode) if (qp->s_last == qp->s_tail) goto bail; - /* The last valid PSN is the previous PSN. */ - qp->s_last_psn = psn - 1; + /* The last valid PSN seen is the previous request's. */ + qp->s_last_psn = wqe->psn - 1; dev->n_rc_resends += (int)qp->s_psn - (int)psn; - reset_psn(qp, psn); + /* + * If we are starting the request from the beginning, let + * the normal send code handle initialization. + */ + qp->s_cur = qp->s_last; + wqe = get_swqe_ptr(qp, qp->s_cur); + if (ipath_cmp24(psn, wqe->psn) <= 0) { + qp->s_state = OP(SEND_LAST); + qp->s_psn = wqe->psn; + } else + reset_psn(qp, psn); qp->s_rnr_timeout = - ib_ipath_rnr_table[(aeth >> IPATH_AETH_CREDIT_SHIFT) & - IPATH_AETH_CREDIT_MASK]; + ib_ipath_rnr_table[(aeth >> IPS_AETH_CREDIT_SHIFT) & + IPS_AETH_CREDIT_MASK]; ipath_insert_rnr_queue(qp); goto bail; @@ -899,8 +1033,8 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode) /* The last valid PSN seen is the previous request's. */ if (qp->s_last != qp->s_tail) qp->s_last_psn = wqe->psn - 1; - switch ((aeth >> IPATH_AETH_CREDIT_SHIFT) & - IPATH_AETH_CREDIT_MASK) { + switch ((aeth >> IPS_AETH_CREDIT_SHIFT) & + IPS_AETH_CREDIT_MASK) { case 0: /* PSN sequence error */ dev->n_seq_naks++; /* @@ -1048,33 +1182,32 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev, goto ack_done; } rdma_read: - if (unlikely(qp->s_state != OP(RDMA_READ_REQUEST))) - goto ack_done; - if (unlikely(tlen != (hdrsize + pmtu + 4))) - goto ack_done; - if (unlikely(pmtu >= qp->s_len)) - goto ack_done; - /* We got a response so update the timeout. */ - if (unlikely(qp->s_last == qp->s_tail || - get_swqe_ptr(qp, qp->s_last)->wr.opcode != - IB_WR_RDMA_READ)) - goto ack_done; - spin_lock(&dev->pending_lock); - if (qp->s_rnr_timeout == 0 && !list_empty(&qp->timerwait)) - list_move_tail(&qp->timerwait, - &dev->pending[dev->pending_index]); - spin_unlock(&dev->pending_lock); - /* - * Update the RDMA receive state but do the copy w/o - * holding the locks and blocking interrupts. - * XXX Yet another place that affects relaxed RDMA order - * since we don't want s_sge modified. - */ - qp->s_len -= pmtu; - qp->s_last_psn = psn; - spin_unlock_irqrestore(&qp->s_lock, flags); - ipath_copy_sge(&qp->s_sge, data, pmtu); - goto bail; + if (unlikely(qp->s_state != OP(RDMA_READ_REQUEST))) + goto ack_done; + if (unlikely(tlen != (hdrsize + pmtu + 4))) + goto ack_done; + if (unlikely(pmtu >= qp->s_len)) + goto ack_done; + /* We got a response so update the timeout. */ + if (unlikely(qp->s_last == qp->s_tail || + get_swqe_ptr(qp, qp->s_last)->wr.opcode != + IB_WR_RDMA_READ)) + goto ack_done; + spin_lock(&dev->pending_lock); + if (qp->s_rnr_timeout == 0 && !list_empty(&qp->timerwait)) + list_move_tail(&qp->timerwait, + &dev->pending[dev->pending_index]); + spin_unlock(&dev->pending_lock); + /* + * Update the RDMA receive state but do the copy w/o holding the + * locks and blocking interrupts. XXX Yet another place that + * affects relaxed RDMA order since we don't want s_sge modified. + */ + qp->s_len -= pmtu; + qp->s_last_psn = psn; + spin_unlock_irqrestore(&qp->s_lock, flags); + ipath_copy_sge(&qp->s_sge, data, pmtu); + goto bail; case OP(RDMA_READ_RESPONSE_LAST): /* ACKs READ req. */ @@ -1097,12 +1230,18 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev, * ICRC (4). */ if (unlikely(tlen <= (hdrsize + pad + 8))) { - /* XXX Need to generate an error CQ entry. */ + /* + * XXX Need to generate an error CQ + * entry. + */ goto ack_done; } tlen -= hdrsize + pad + 8; if (unlikely(tlen != qp->s_len)) { - /* XXX Need to generate an error CQ entry. */ + /* + * XXX Need to generate an error CQ + * entry. + */ goto ack_done; } if (!header_in_data) @@ -1115,12 +1254,9 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev, if (do_rc_ack(qp, aeth, psn, OP(RDMA_READ_RESPONSE_LAST))) { /* * Change the state so we contimue - * processing new requests and wake up the - * tasklet if there are posted sends. + * processing new requests. */ qp->s_state = OP(SEND_LAST); - if (qp->s_tail != qp->s_head) - tasklet_hi_schedule(&qp->s_task); } goto ack_done; } @@ -1166,16 +1302,18 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev, * Don't queue the NAK if a RDMA read, atomic, or * NAK is pending though. */ - if (qp->s_ack_state != OP(ACKNOWLEDGE) || - qp->r_nak_state != 0) + spin_lock(&qp->s_lock); + if ((qp->s_ack_state >= OP(RDMA_READ_REQUEST) && + qp->s_ack_state != IB_OPCODE_ACKNOWLEDGE) || + qp->s_nak_state != 0) { + spin_unlock(&qp->s_lock); goto done; - if (qp->r_ack_state < OP(COMPARE_SWAP)) { - qp->r_ack_state = OP(SEND_ONLY); - qp->r_nak_state = IB_NAK_PSN_ERROR; - /* Use the expected PSN. */ - qp->r_ack_psn = qp->r_psn; } - goto send_ack; + qp->s_ack_state = OP(SEND_ONLY); + qp->s_nak_state = IB_NAK_PSN_ERROR; + /* Use the expected PSN. */ + qp->s_ack_psn = qp->r_psn; + goto resched; } /* @@ -1189,7 +1327,27 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev, * send the earliest so that RDMA reads can be restarted at * the requester's expected PSN. */ - if (opcode == OP(RDMA_READ_REQUEST)) { + spin_lock(&qp->s_lock); + if (qp->s_ack_state != IB_OPCODE_ACKNOWLEDGE && + ipath_cmp24(psn, qp->s_ack_psn) >= 0) { + if (qp->s_ack_state < IB_OPCODE_RDMA_READ_REQUEST) + qp->s_ack_psn = psn; + spin_unlock(&qp->s_lock); + goto done; + } + switch (opcode) { + case OP(RDMA_READ_REQUEST): + /* + * We have to be careful to not change s_rdma_sge + * while ipath_do_rc_send() is using it and not + * holding the s_lock. + */ + if (qp->s_ack_state != OP(ACKNOWLEDGE) && + qp->s_ack_state >= IB_OPCODE_RDMA_READ_REQUEST) { + spin_unlock(&qp->s_lock); + dev->n_rdma_dup_busy++; + goto done; + } /* RETH comes after BTH */ if (!header_in_data) reth = &ohdr->u.rc.reth; @@ -1197,22 +1355,6 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev, reth = (struct ib_reth *)data; data += sizeof(*reth); } - /* - * If we receive a duplicate RDMA request, it means the - * requester saw a sequence error and needs to restart - * from an earlier point. We can abort the current - * RDMA read send in that case. - */ - spin_lock_irq(&qp->s_lock); - if (qp->s_ack_state != OP(ACKNOWLEDGE) && - (qp->s_hdrwords || ipath_cmp24(psn, qp->s_ack_psn) >= 0)) { - /* - * We are already sending earlier requested data. - * Don't abort it to send later out of sequence data. - */ - spin_unlock_irq(&qp->s_lock); - goto done; - } qp->s_rdma_len = be32_to_cpu(reth->length); if (qp->s_rdma_len != 0) { u32 rkey = be32_to_cpu(reth->rkey); @@ -1226,10 +1368,8 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev, ok = ipath_rkey_ok(dev, &qp->s_rdma_sge, qp->s_rdma_len, vaddr, rkey, IB_ACCESS_REMOTE_READ); - if (unlikely(!ok)) { - spin_unlock_irq(&qp->s_lock); + if (unlikely(!ok)) goto done; - } } else { qp->s_rdma_sge.sg_list = NULL; qp->s_rdma_sge.num_sge = 0; @@ -1238,44 +1378,25 @@ static inline int ipath_rc_rcv_error(struct ipath_ibdev *dev, qp->s_rdma_sge.sge.length = 0; qp->s_rdma_sge.sge.sge_length = 0; } - qp->s_ack_state = opcode; - qp->s_ack_psn = psn; - spin_unlock_irq(&qp->s_lock); - tasklet_hi_schedule(&qp->s_task); - goto send_ack; - } - - /* - * A pending RDMA read will ACK anything before it so - * ignore earlier duplicate requests. - */ - if (qp->s_ack_state != OP(ACKNOWLEDGE)) - goto done; + break; - /* - * If an ACK is pending, don't replace the pending ACK - * with an earlier one since the later one will ACK the earlier. - * Also, if we already have a pending atomic, send it. - */ - if (qp->r_ack_state != OP(ACKNOWLEDGE) && - (ipath_cmp24(psn, qp->r_ack_psn) <= 0 || - qp->r_ack_state >= OP(COMPARE_SWAP))) - goto send_ack; - switch (opcode) { case OP(COMPARE_SWAP): case OP(FETCH_ADD): /* - * Check for the PSN of the last atomic operation + * Check for the PSN of the last atomic operations * performed and resend the result if found. */ - if ((psn & IPATH_PSN_MASK) != qp->r_atomic_psn) + if ((psn & IPS_PSN_MASK) != qp->r_atomic_psn) { + spin_unlock(&qp->s_lock); goto done; + } + qp->s_ack_atomic = qp->r_atomic_data; break; } - qp->r_ack_state = opcode; - qp->r_nak_state = 0; - qp->r_ack_psn = psn; -send_ack: + qp->s_ack_state = opcode; + qp->s_nak_state = 0; + qp->s_ack_psn = psn; +resched: return 0; done: @@ -1303,6 +1424,7 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, u32 hdrsize; u32 psn; u32 pad; + unsigned long flags; struct ib_wc wc; u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu); int diff; @@ -1331,6 +1453,11 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, } else psn = be32_to_cpu(ohdr->bth[2]); } + /* + * The opcode is in the low byte when its in network order + * (top byte when in host order). + */ + opcode = be32_to_cpu(ohdr->bth[0]) >> 24; /* * Process responses (ACKs) before anything else. Note that the @@ -1338,21 +1465,22 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, * queue rather than the expected receive packet sequence number. * In other words, this QP is the requester. */ - opcode = be32_to_cpu(ohdr->bth[0]) >> 24; if (opcode >= OP(RDMA_READ_RESPONSE_FIRST) && opcode <= OP(ATOMIC_ACKNOWLEDGE)) { ipath_rc_rcv_resp(dev, ohdr, data, tlen, qp, opcode, psn, hdrsize, pmtu, header_in_data); - goto done; + goto bail; } + spin_lock_irqsave(&qp->r_rq.lock, flags); + /* Compute 24 bits worth of difference. */ diff = ipath_cmp24(psn, qp->r_psn); if (unlikely(diff)) { if (ipath_rc_rcv_error(dev, ohdr, data, qp, opcode, psn, diff, header_in_data)) goto done; - goto send_ack; + goto resched; } /* Check for opcode sequence errors. */ @@ -1364,19 +1492,22 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, opcode == OP(SEND_LAST_WITH_IMMEDIATE)) break; nack_inv: - /* - * A NAK will ACK earlier sends and RDMA writes. - * Don't queue the NAK if a RDMA read, atomic, or NAK - * is pending though. - */ - if (qp->r_ack_state >= OP(COMPARE_SWAP)) - goto send_ack; - /* XXX Flush WQEs */ - qp->state = IB_QPS_ERR; - qp->r_ack_state = OP(SEND_ONLY); - qp->r_nak_state = IB_NAK_INVALID_REQUEST; - qp->r_ack_psn = qp->r_psn; - goto send_ack; + /* + * A NAK will ACK earlier sends and RDMA writes. Don't queue the + * NAK if a RDMA read, atomic, or NAK is pending though. + */ + spin_lock(&qp->s_lock); + if (qp->s_ack_state >= OP(RDMA_READ_REQUEST) && + qp->s_ack_state != IB_OPCODE_ACKNOWLEDGE) { + spin_unlock(&qp->s_lock); + goto done; + } + /* XXX Flush WQEs */ + qp->state = IB_QPS_ERR; + qp->s_ack_state = OP(SEND_ONLY); + qp->s_nak_state = IB_NAK_INVALID_REQUEST; + qp->s_ack_psn = qp->r_psn; + goto resched; case OP(RDMA_WRITE_FIRST): case OP(RDMA_WRITE_MIDDLE): @@ -1386,6 +1517,20 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, break; goto nack_inv; + case OP(RDMA_READ_REQUEST): + case OP(COMPARE_SWAP): + case OP(FETCH_ADD): + /* + * Drop all new requests until a response has been sent. A + * new request then ACKs the RDMA response we sent. Relaxed + * ordering would allow new requests to be processed but we + * would need to keep a queue of rwqe's for all that are in + * progress. Note that we can't RNR NAK this request since + * the RDMA READ or atomic response is already queued to be + * sent (unless we implement a response send queue). + */ + goto done; + default: if (opcode == OP(SEND_MIDDLE) || opcode == OP(SEND_LAST) || @@ -1394,11 +1539,6 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, opcode == OP(RDMA_WRITE_LAST) || opcode == OP(RDMA_WRITE_LAST_WITH_IMMEDIATE)) goto nack_inv; - /* - * Note that it is up to the requester to not send a new - * RDMA read or atomic operation before receiving an ACK - * for the previous operation. - */ break; } @@ -1415,12 +1555,17 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, * Don't queue the NAK if a RDMA read or atomic * is pending though. */ - if (qp->r_ack_state >= OP(COMPARE_SWAP)) - goto send_ack; - qp->r_ack_state = OP(SEND_ONLY); - qp->r_nak_state = IB_RNR_NAK | qp->r_min_rnr_timer; - qp->r_ack_psn = qp->r_psn; - goto send_ack; + spin_lock(&qp->s_lock); + if (qp->s_ack_state >= + OP(RDMA_READ_REQUEST) && + qp->s_ack_state != IB_OPCODE_ACKNOWLEDGE) { + spin_unlock(&qp->s_lock); + goto done; + } + qp->s_ack_state = OP(SEND_ONLY); + qp->s_nak_state = IB_RNR_NAK | qp->s_min_rnr_timer; + qp->s_ack_psn = qp->r_psn; + goto resched; } qp->r_rcv_len = 0; /* FALLTHROUGH */ @@ -1477,7 +1622,7 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, if (unlikely(wc.byte_len > qp->r_len)) goto nack_inv; ipath_copy_sge(&qp->r_sge, data, tlen); - qp->r_msn++; + atomic_inc(&qp->msn); if (opcode == OP(RDMA_WRITE_LAST) || opcode == OP(RDMA_WRITE_ONLY)) break; @@ -1521,8 +1666,29 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, ok = ipath_rkey_ok(dev, &qp->r_sge, qp->r_len, vaddr, rkey, IB_ACCESS_REMOTE_WRITE); - if (unlikely(!ok)) - goto nack_acc; + if (unlikely(!ok)) { + nack_acc: + /* + * A NAK will ACK earlier sends and RDMA + * writes. Don't queue the NAK if a RDMA + * read, atomic, or NAK is pending though. + */ + spin_lock(&qp->s_lock); + if (qp->s_ack_state >= + OP(RDMA_READ_REQUEST) && + qp->s_ack_state != + IB_OPCODE_ACKNOWLEDGE) { + spin_unlock(&qp->s_lock); + goto done; + } + /* XXX Flush WQEs */ + qp->state = IB_QPS_ERR; + qp->s_ack_state = OP(RDMA_WRITE_ONLY); + qp->s_nak_state = + IB_NAK_REMOTE_ACCESS_ERROR; + qp->s_ack_psn = qp->r_psn; + goto resched; + } } else { qp->r_sge.sg_list = NULL; qp->r_sge.sge.mr = NULL; @@ -1549,10 +1715,12 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, reth = (struct ib_reth *)data; data += sizeof(*reth); } - if (unlikely(!(qp->qp_access_flags & - IB_ACCESS_REMOTE_READ))) - goto nack_acc; - spin_lock_irq(&qp->s_lock); + spin_lock(&qp->s_lock); + if (qp->s_ack_state != OP(ACKNOWLEDGE) && + qp->s_ack_state >= IB_OPCODE_RDMA_READ_REQUEST) { + spin_unlock(&qp->s_lock); + goto done; + } qp->s_rdma_len = be32_to_cpu(reth->length); if (qp->s_rdma_len != 0) { u32 rkey = be32_to_cpu(reth->rkey); @@ -1564,7 +1732,7 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, qp->s_rdma_len, vaddr, rkey, IB_ACCESS_REMOTE_READ); if (unlikely(!ok)) { - spin_unlock_irq(&qp->s_lock); + spin_unlock(&qp->s_lock); goto nack_acc; } /* @@ -1581,25 +1749,21 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, qp->s_rdma_sge.sge.length = 0; qp->s_rdma_sge.sge.sge_length = 0; } + if (unlikely(!(qp->qp_access_flags & + IB_ACCESS_REMOTE_READ))) + goto nack_acc; /* * We need to increment the MSN here instead of when we * finish sending the result since a duplicate request would * increment it more than once. */ - qp->r_msn++; - + atomic_inc(&qp->msn); qp->s_ack_state = opcode; + qp->s_nak_state = 0; qp->s_ack_psn = psn; - spin_unlock_irq(&qp->s_lock); - qp->r_psn++; qp->r_state = opcode; - qp->r_nak_state = 0; - - /* Call ipath_do_rc_send() in another thread. */ - tasklet_hi_schedule(&qp->s_task); - - goto done; + goto rdmadone; case OP(COMPARE_SWAP): case OP(FETCH_ADD): { @@ -1628,7 +1792,7 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, goto nack_acc; /* Perform atomic OP and save result. */ sdata = be64_to_cpu(ateth->swap_data); - spin_lock_irq(&dev->pending_lock); + spin_lock(&dev->pending_lock); qp->r_atomic_data = *(u64 *) qp->r_sge.sge.vaddr; if (opcode == OP(FETCH_ADD)) *(u64 *) qp->r_sge.sge.vaddr = @@ -1636,9 +1800,9 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, else if (qp->r_atomic_data == be64_to_cpu(ateth->compare_data)) *(u64 *) qp->r_sge.sge.vaddr = sdata; - spin_unlock_irq(&dev->pending_lock); - qp->r_msn++; - qp->r_atomic_psn = psn & IPATH_PSN_MASK; + spin_unlock(&dev->pending_lock); + atomic_inc(&qp->msn); + qp->r_atomic_psn = psn & IPS_PSN_MASK; psn |= 1 << 31; break; } @@ -1649,39 +1813,44 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, } qp->r_psn++; qp->r_state = opcode; - qp->r_nak_state = 0; /* Send an ACK if requested or required. */ if (psn & (1 << 31)) { /* * Coalesce ACKs unless there is a RDMA READ or * ATOMIC pending. */ - if (qp->r_ack_state < OP(COMPARE_SWAP)) { - qp->r_ack_state = opcode; - qp->r_ack_psn = psn; + spin_lock(&qp->s_lock); + if (qp->s_ack_state == OP(ACKNOWLEDGE) || + qp->s_ack_state < IB_OPCODE_RDMA_READ_REQUEST) { + qp->s_ack_state = opcode; + qp->s_nak_state = 0; + qp->s_ack_psn = psn; + qp->s_ack_atomic = qp->r_atomic_data; + goto resched; } - goto send_ack; + spin_unlock(&qp->s_lock); } - goto done; +done: + spin_unlock_irqrestore(&qp->r_rq.lock, flags); + goto bail; -nack_acc: +resched: /* - * A NAK will ACK earlier sends and RDMA writes. - * Don't queue the NAK if a RDMA read, atomic, or NAK - * is pending though. + * Try to send ACK right away but not if ipath_do_rc_send() is + * active. */ - if (qp->r_ack_state < OP(COMPARE_SWAP)) { - /* XXX Flush WQEs */ - qp->state = IB_QPS_ERR; - qp->r_ack_state = OP(RDMA_WRITE_ONLY); - qp->r_nak_state = IB_NAK_REMOTE_ACCESS_ERROR; - qp->r_ack_psn = qp->r_psn; - } -send_ack: - /* Send ACK right away unless the send tasklet has a pending ACK. */ - if (qp->s_ack_state == OP(ACKNOWLEDGE)) + if (qp->s_hdrwords == 0 && + (qp->s_ack_state < IB_OPCODE_RDMA_READ_REQUEST || + qp->s_ack_state >= IB_OPCODE_COMPARE_SWAP)) send_rc_ack(qp); -done: +rdmadone: + spin_unlock(&qp->s_lock); + spin_unlock_irqrestore(&qp->r_rq.lock, flags); + + /* Call ipath_do_rc_send() in another thread. */ + tasklet_hi_schedule(&qp->s_task); + +bail: return; } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_registers.h b/trunk/drivers/infiniband/hw/ipath/ipath_registers.h index 89df8f5ea998..402126eb79c9 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_registers.h +++ b/trunk/drivers/infiniband/hw/ipath/ipath_registers.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c b/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c index 772bc59fb85c..d38f4f3cfd1d 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -32,7 +31,6 @@ */ #include "ipath_verbs.h" -#include "ipath_common.h" /* * Convert the AETH RNR timeout code into the number of milliseconds. @@ -113,23 +111,20 @@ void ipath_insert_rnr_queue(struct ipath_qp *qp) * * Return 0 if no RWQE is available, otherwise return 1. * - * Can be called from interrupt level. + * Called at interrupt level with the QP r_rq.lock held. */ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only) { - unsigned long flags; struct ipath_rq *rq; struct ipath_srq *srq; struct ipath_rwqe *wqe; - int ret = 1; + int ret; if (!qp->ibqp.srq) { rq = &qp->r_rq; - spin_lock_irqsave(&rq->lock, flags); - if (unlikely(rq->tail == rq->head)) { ret = 0; - goto done; + goto bail; } wqe = get_rwqe_ptr(rq, rq->tail); qp->r_wr_id = wqe->wr_id; @@ -141,16 +136,17 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only) } if (++rq->tail >= rq->size) rq->tail = 0; - goto done; + ret = 1; + goto bail; } srq = to_isrq(qp->ibqp.srq); rq = &srq->rq; - spin_lock_irqsave(&rq->lock, flags); - + spin_lock(&rq->lock); if (unlikely(rq->tail == rq->head)) { + spin_unlock(&rq->lock); ret = 0; - goto done; + goto bail; } wqe = get_rwqe_ptr(rq, rq->tail); qp->r_wr_id = wqe->wr_id; @@ -172,18 +168,18 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only) n = rq->head - rq->tail; if (n < srq->limit) { srq->limit = 0; - spin_unlock_irqrestore(&rq->lock, flags); + spin_unlock(&rq->lock); ev.device = qp->ibqp.device; ev.element.srq = qp->ibqp.srq; ev.event = IB_EVENT_SRQ_LIMIT_REACHED; srq->ibsrq.event_handler(&ev, srq->ibsrq.srq_context); - goto bail; - } - } + } else + spin_unlock(&rq->lock); + } else + spin_unlock(&rq->lock); + ret = 1; -done: - spin_unlock_irqrestore(&rq->lock, flags); bail: return ret; } @@ -191,6 +187,7 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only) /** * ipath_ruc_loopback - handle UC and RC lookback requests * @sqp: the loopback QP + * @wc: the work completion entry * * This is called from ipath_do_uc_send() or ipath_do_rc_send() to * forward a WQE addressed to the same HCA. @@ -199,14 +196,13 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only) * receive interrupts since this is a connected protocol and all packets * will pass through here. */ -static void ipath_ruc_loopback(struct ipath_qp *sqp) +void ipath_ruc_loopback(struct ipath_qp *sqp, struct ib_wc *wc) { struct ipath_ibdev *dev = to_idev(sqp->ibqp.device); struct ipath_qp *qp; struct ipath_swqe *wqe; struct ipath_sge *sge; unsigned long flags; - struct ib_wc wc; u64 sdata; qp = ipath_lookup_qpn(&dev->qp_table, sqp->remote_qpn); @@ -237,8 +233,8 @@ static void ipath_ruc_loopback(struct ipath_qp *sqp) wqe = get_swqe_ptr(sqp, sqp->s_last); spin_unlock_irqrestore(&sqp->s_lock, flags); - wc.wc_flags = 0; - wc.imm_data = 0; + wc->wc_flags = 0; + wc->imm_data = 0; sqp->s_sge.sge = wqe->sg_list[0]; sqp->s_sge.sg_list = wqe->sg_list + 1; @@ -246,34 +242,39 @@ static void ipath_ruc_loopback(struct ipath_qp *sqp) sqp->s_len = wqe->length; switch (wqe->wr.opcode) { case IB_WR_SEND_WITH_IMM: - wc.wc_flags = IB_WC_WITH_IMM; - wc.imm_data = wqe->wr.imm_data; + wc->wc_flags = IB_WC_WITH_IMM; + wc->imm_data = wqe->wr.imm_data; /* FALLTHROUGH */ case IB_WR_SEND: + spin_lock_irqsave(&qp->r_rq.lock, flags); if (!ipath_get_rwqe(qp, 0)) { rnr_nak: + spin_unlock_irqrestore(&qp->r_rq.lock, flags); /* Handle RNR NAK */ if (qp->ibqp.qp_type == IB_QPT_UC) goto send_comp; if (sqp->s_rnr_retry == 0) { - wc.status = IB_WC_RNR_RETRY_EXC_ERR; + wc->status = IB_WC_RNR_RETRY_EXC_ERR; goto err; } if (sqp->s_rnr_retry_cnt < 7) sqp->s_rnr_retry--; dev->n_rnr_naks++; sqp->s_rnr_timeout = - ib_ipath_rnr_table[sqp->r_min_rnr_timer]; + ib_ipath_rnr_table[sqp->s_min_rnr_timer]; ipath_insert_rnr_queue(sqp); goto done; } + spin_unlock_irqrestore(&qp->r_rq.lock, flags); break; case IB_WR_RDMA_WRITE_WITH_IMM: - wc.wc_flags = IB_WC_WITH_IMM; - wc.imm_data = wqe->wr.imm_data; + wc->wc_flags = IB_WC_WITH_IMM; + wc->imm_data = wqe->wr.imm_data; + spin_lock_irqsave(&qp->r_rq.lock, flags); if (!ipath_get_rwqe(qp, 1)) goto rnr_nak; + spin_unlock_irqrestore(&qp->r_rq.lock, flags); /* FALLTHROUGH */ case IB_WR_RDMA_WRITE: if (wqe->length == 0) @@ -283,20 +284,20 @@ static void ipath_ruc_loopback(struct ipath_qp *sqp) wqe->wr.wr.rdma.rkey, IB_ACCESS_REMOTE_WRITE))) { acc_err: - wc.status = IB_WC_REM_ACCESS_ERR; + wc->status = IB_WC_REM_ACCESS_ERR; err: - wc.wr_id = wqe->wr.wr_id; - wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode]; - wc.vendor_err = 0; - wc.byte_len = 0; - wc.qp_num = sqp->ibqp.qp_num; - wc.src_qp = sqp->remote_qpn; - wc.pkey_index = 0; - wc.slid = sqp->remote_ah_attr.dlid; - wc.sl = sqp->remote_ah_attr.sl; - wc.dlid_path_bits = 0; - wc.port_num = 0; - ipath_sqerror_qp(sqp, &wc); + wc->wr_id = wqe->wr.wr_id; + wc->opcode = ib_ipath_wc_opcode[wqe->wr.opcode]; + wc->vendor_err = 0; + wc->byte_len = 0; + wc->qp_num = sqp->ibqp.qp_num; + wc->src_qp = sqp->remote_qpn; + wc->pkey_index = 0; + wc->slid = sqp->remote_ah_attr.dlid; + wc->sl = sqp->remote_ah_attr.sl; + wc->dlid_path_bits = 0; + wc->port_num = 0; + ipath_sqerror_qp(sqp, wc); goto done; } break; @@ -372,22 +373,22 @@ static void ipath_ruc_loopback(struct ipath_qp *sqp) goto send_comp; if (wqe->wr.opcode == IB_WR_RDMA_WRITE_WITH_IMM) - wc.opcode = IB_WC_RECV_RDMA_WITH_IMM; + wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; else - wc.opcode = IB_WC_RECV; - wc.wr_id = qp->r_wr_id; - wc.status = IB_WC_SUCCESS; - wc.vendor_err = 0; - wc.byte_len = wqe->length; - wc.qp_num = qp->ibqp.qp_num; - wc.src_qp = qp->remote_qpn; + wc->opcode = IB_WC_RECV; + wc->wr_id = qp->r_wr_id; + wc->status = IB_WC_SUCCESS; + wc->vendor_err = 0; + wc->byte_len = wqe->length; + wc->qp_num = qp->ibqp.qp_num; + wc->src_qp = qp->remote_qpn; /* XXX do we know which pkey matched? Only needed for GSI. */ - wc.pkey_index = 0; - wc.slid = qp->remote_ah_attr.dlid; - wc.sl = qp->remote_ah_attr.sl; - wc.dlid_path_bits = 0; + wc->pkey_index = 0; + wc->slid = qp->remote_ah_attr.dlid; + wc->sl = qp->remote_ah_attr.sl; + wc->dlid_path_bits = 0; /* Signal completion event if the solicited bit is set. */ - ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, + ipath_cq_enter(to_icq(qp->ibqp.recv_cq), wc, wqe->wr.send_flags & IB_SEND_SOLICITED); send_comp: @@ -395,19 +396,19 @@ static void ipath_ruc_loopback(struct ipath_qp *sqp) if (!test_bit(IPATH_S_SIGNAL_REQ_WR, &sqp->s_flags) || (wqe->wr.send_flags & IB_SEND_SIGNALED)) { - wc.wr_id = wqe->wr.wr_id; - wc.status = IB_WC_SUCCESS; - wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode]; - wc.vendor_err = 0; - wc.byte_len = wqe->length; - wc.qp_num = sqp->ibqp.qp_num; - wc.src_qp = 0; - wc.pkey_index = 0; - wc.slid = 0; - wc.sl = 0; - wc.dlid_path_bits = 0; - wc.port_num = 0; - ipath_cq_enter(to_icq(sqp->ibqp.send_cq), &wc, 0); + wc->wr_id = wqe->wr.wr_id; + wc->status = IB_WC_SUCCESS; + wc->opcode = ib_ipath_wc_opcode[wqe->wr.opcode]; + wc->vendor_err = 0; + wc->byte_len = wqe->length; + wc->qp_num = sqp->ibqp.qp_num; + wc->src_qp = 0; + wc->pkey_index = 0; + wc->slid = 0; + wc->sl = 0; + wc->dlid_path_bits = 0; + wc->port_num = 0; + ipath_cq_enter(to_icq(sqp->ibqp.send_cq), wc, 0); } /* Update s_last now that we are finished with the SWQE */ @@ -453,11 +454,11 @@ void ipath_no_bufs_available(struct ipath_qp *qp, struct ipath_ibdev *dev) } /** - * ipath_post_ruc_send - post RC and UC sends + * ipath_post_rc_send - post RC and UC sends * @qp: the QP to post on * @wr: the work request to send */ -int ipath_post_ruc_send(struct ipath_qp *qp, struct ib_send_wr *wr) +int ipath_post_rc_send(struct ipath_qp *qp, struct ib_send_wr *wr) { struct ipath_swqe *wqe; unsigned long flags; @@ -532,149 +533,13 @@ int ipath_post_ruc_send(struct ipath_qp *qp, struct ib_send_wr *wr) qp->s_head = next; spin_unlock_irqrestore(&qp->s_lock, flags); - ipath_do_ruc_send((unsigned long) qp); + if (qp->ibqp.qp_type == IB_QPT_UC) + ipath_do_uc_send((unsigned long) qp); + else + ipath_do_rc_send((unsigned long) qp); ret = 0; bail: return ret; } - -/** - * ipath_make_grh - construct a GRH header - * @dev: a pointer to the ipath device - * @hdr: a pointer to the GRH header being constructed - * @grh: the global route address to send to - * @hwords: the number of 32 bit words of header being sent - * @nwords: the number of 32 bit words of data being sent - * - * Return the size of the header in 32 bit words. - */ -u32 ipath_make_grh(struct ipath_ibdev *dev, struct ib_grh *hdr, - struct ib_global_route *grh, u32 hwords, u32 nwords) -{ - hdr->version_tclass_flow = - cpu_to_be32((6 << 28) | - (grh->traffic_class << 20) | - grh->flow_label); - hdr->paylen = cpu_to_be16((hwords - 2 + nwords + SIZE_OF_CRC) << 2); - /* next_hdr is defined by C8-7 in ch. 8.4.1 */ - hdr->next_hdr = 0x1B; - hdr->hop_limit = grh->hop_limit; - /* The SGID is 32-bit aligned. */ - hdr->sgid.global.subnet_prefix = dev->gid_prefix; - hdr->sgid.global.interface_id = ipath_layer_get_guid(dev->dd); - hdr->dgid = grh->dgid; - - /* GRH header size in 32-bit words. */ - return sizeof(struct ib_grh) / sizeof(u32); -} - -/** - * ipath_do_ruc_send - perform a send on an RC or UC QP - * @data: contains a pointer to the QP - * - * Process entries in the send work queue until credit or queue is - * exhausted. Only allow one CPU to send a packet per QP (tasklet). - * Otherwise, after we drop the QP s_lock, two threads could send - * packets out of order. - */ -void ipath_do_ruc_send(unsigned long data) -{ - struct ipath_qp *qp = (struct ipath_qp *)data; - struct ipath_ibdev *dev = to_idev(qp->ibqp.device); - unsigned long flags; - u16 lrh0; - u32 nwords; - u32 extra_bytes; - u32 bth0; - u32 bth2; - u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu); - struct ipath_other_headers *ohdr; - - if (test_and_set_bit(IPATH_S_BUSY, &qp->s_flags)) - goto bail; - - if (unlikely(qp->remote_ah_attr.dlid == - ipath_layer_get_lid(dev->dd))) { - ipath_ruc_loopback(qp); - goto clear; - } - - ohdr = &qp->s_hdr.u.oth; - if (qp->remote_ah_attr.ah_flags & IB_AH_GRH) - ohdr = &qp->s_hdr.u.l.oth; - -again: - /* Check for a constructed packet to be sent. */ - if (qp->s_hdrwords != 0) { - /* - * If no PIO bufs are available, return. An interrupt will - * call ipath_ib_piobufavail() when one is available. - */ - if (ipath_verbs_send(dev->dd, qp->s_hdrwords, - (u32 *) &qp->s_hdr, qp->s_cur_size, - qp->s_cur_sge)) { - ipath_no_bufs_available(qp, dev); - goto bail; - } - dev->n_unicast_xmit++; - /* Record that we sent the packet and s_hdr is empty. */ - qp->s_hdrwords = 0; - } - - /* - * The lock is needed to synchronize between setting - * qp->s_ack_state, resend timer, and post_send(). - */ - spin_lock_irqsave(&qp->s_lock, flags); - - /* Sending responses has higher priority over sending requests. */ - if (qp->s_ack_state != IB_OPCODE_RC_ACKNOWLEDGE && - (bth0 = ipath_make_rc_ack(qp, ohdr, pmtu)) != 0) - bth2 = qp->s_ack_psn++ & IPATH_PSN_MASK; - else if (!((qp->ibqp.qp_type == IB_QPT_RC) ? - ipath_make_rc_req(qp, ohdr, pmtu, &bth0, &bth2) : - ipath_make_uc_req(qp, ohdr, pmtu, &bth0, &bth2))) { - /* - * Clear the busy bit before unlocking to avoid races with - * adding new work queue items and then failing to process - * them. - */ - clear_bit(IPATH_S_BUSY, &qp->s_flags); - spin_unlock_irqrestore(&qp->s_lock, flags); - goto bail; - } - - spin_unlock_irqrestore(&qp->s_lock, flags); - - /* Construct the header. */ - extra_bytes = (4 - qp->s_cur_size) & 3; - nwords = (qp->s_cur_size + extra_bytes) >> 2; - lrh0 = IPATH_LRH_BTH; - if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) { - qp->s_hdrwords += ipath_make_grh(dev, &qp->s_hdr.u.l.grh, - &qp->remote_ah_attr.grh, - qp->s_hdrwords, nwords); - lrh0 = IPATH_LRH_GRH; - } - lrh0 |= qp->remote_ah_attr.sl << 4; - qp->s_hdr.lrh[0] = cpu_to_be16(lrh0); - qp->s_hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid); - qp->s_hdr.lrh[2] = cpu_to_be16(qp->s_hdrwords + nwords + - SIZE_OF_CRC); - qp->s_hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd)); - bth0 |= ipath_layer_get_pkey(dev->dd, qp->s_pkey_index); - bth0 |= extra_bytes << 20; - ohdr->bth[0] = cpu_to_be32(bth0); - ohdr->bth[1] = cpu_to_be32(qp->remote_qpn); - ohdr->bth[2] = cpu_to_be32(bth2); - - /* Check for more work to do. */ - goto again; - -clear: - clear_bit(IPATH_S_BUSY, &qp->s_flags); -bail: - return; -} diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_srq.c b/trunk/drivers/infiniband/hw/ipath/ipath_srq.c index f760434660bd..01c4c6c56118 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_srq.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_srq.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -126,23 +125,11 @@ struct ib_srq *ipath_create_srq(struct ib_pd *ibpd, struct ib_srq_init_attr *srq_init_attr, struct ib_udata *udata) { - struct ipath_ibdev *dev = to_idev(ibpd->device); struct ipath_srq *srq; u32 sz; struct ib_srq *ret; - if (dev->n_srqs_allocated == ib_ipath_max_srqs) { - ret = ERR_PTR(-ENOMEM); - goto bail; - } - - if (srq_init_attr->attr.max_wr == 0) { - ret = ERR_PTR(-EINVAL); - goto bail; - } - - if ((srq_init_attr->attr.max_sge > ib_ipath_max_srq_sges) || - (srq_init_attr->attr.max_wr > ib_ipath_max_srq_wrs)) { + if (srq_init_attr->attr.max_sge < 1) { ret = ERR_PTR(-EINVAL); goto bail; } @@ -177,8 +164,6 @@ struct ib_srq *ipath_create_srq(struct ib_pd *ibpd, ret = &srq->ibsrq; - dev->n_srqs_allocated++; - bail: return ret; } @@ -196,26 +181,24 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr, unsigned long flags; int ret; - if (attr_mask & IB_SRQ_MAX_WR) - if ((attr->max_wr > ib_ipath_max_srq_wrs) || - (attr->max_sge > srq->rq.max_sge)) { - ret = -EINVAL; - goto bail; - } + if (attr_mask & IB_SRQ_LIMIT) { + spin_lock_irqsave(&srq->rq.lock, flags); + srq->limit = attr->srq_limit; + spin_unlock_irqrestore(&srq->rq.lock, flags); + } + if (attr_mask & IB_SRQ_MAX_WR) { + u32 size = attr->max_wr + 1; + struct ipath_rwqe *wq, *p; + u32 n; + u32 sz; - if (attr_mask & IB_SRQ_LIMIT) - if (attr->srq_limit >= srq->rq.size) { + if (attr->max_sge < srq->rq.max_sge) { ret = -EINVAL; goto bail; } - if (attr_mask & IB_SRQ_MAX_WR) { - struct ipath_rwqe *wq, *p; - u32 sz, size, n; - sz = sizeof(struct ipath_rwqe) + attr->max_sge * sizeof(struct ipath_sge); - size = attr->max_wr + 1; wq = vmalloc(size * sz); if (!wq) { ret = -ENOMEM; @@ -259,11 +242,6 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr, spin_unlock_irqrestore(&srq->rq.lock, flags); } - if (attr_mask & IB_SRQ_LIMIT) { - spin_lock_irqsave(&srq->rq.lock, flags); - srq->limit = attr->srq_limit; - spin_unlock_irqrestore(&srq->rq.lock, flags); - } ret = 0; bail: @@ -287,9 +265,7 @@ int ipath_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr) int ipath_destroy_srq(struct ib_srq *ibsrq) { struct ipath_srq *srq = to_isrq(ibsrq); - struct ipath_ibdev *dev = to_idev(ibsrq->device); - dev->n_srqs_allocated--; vfree(srq->rq.wq); kfree(srq); diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_stats.c b/trunk/drivers/infiniband/hw/ipath/ipath_stats.c index 70351b7e35c0..fe209137ee74 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_stats.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_stats.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -186,6 +185,7 @@ static void ipath_qcheck(struct ipath_devdata *dd) dd->ipath_port0head, (unsigned long long) ipath_stats.sps_port0pkts); + ipath_kreceive(dd); } dd->ipath_lastport0rcv_cnt = ipath_stats.sps_port0pkts; } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_sysfs.c b/trunk/drivers/infiniband/hw/ipath/ipath_sysfs.c index b98821d7801d..f323791cc495 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_sysfs.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_sysfs.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -35,8 +34,8 @@ #include #include "ipath_kernel.h" +#include "ips_common.h" #include "ipath_layer.h" -#include "ipath_common.h" /** * ipath_parse_ushort - parse an unsigned short value in an arbitrary base @@ -85,6 +84,99 @@ static ssize_t show_num_units(struct device_driver *dev, char *buf) ipath_count_units(NULL, NULL, NULL)); } +#define DRIVER_STAT(name, attr) \ + static ssize_t show_stat_##name(struct device_driver *dev, \ + char *buf) \ + { \ + return scnprintf( \ + buf, PAGE_SIZE, "%llu\n", \ + (unsigned long long) ipath_stats.sps_ ##attr); \ + } \ + static DRIVER_ATTR(name, S_IRUGO, show_stat_##name, NULL) + +DRIVER_STAT(intrs, ints); +DRIVER_STAT(err_intrs, errints); +DRIVER_STAT(errs, errs); +DRIVER_STAT(pkt_errs, pkterrs); +DRIVER_STAT(crc_errs, crcerrs); +DRIVER_STAT(hw_errs, hwerrs); +DRIVER_STAT(ib_link, iblink); +DRIVER_STAT(port0_pkts, port0pkts); +DRIVER_STAT(ether_spkts, ether_spkts); +DRIVER_STAT(ether_rpkts, ether_rpkts); +DRIVER_STAT(sma_spkts, sma_spkts); +DRIVER_STAT(sma_rpkts, sma_rpkts); +DRIVER_STAT(hdrq_full, hdrqfull); +DRIVER_STAT(etid_full, etidfull); +DRIVER_STAT(no_piobufs, nopiobufs); +DRIVER_STAT(ports, ports); +DRIVER_STAT(pkey0, pkeys[0]); +DRIVER_STAT(pkey1, pkeys[1]); +DRIVER_STAT(pkey2, pkeys[2]); +DRIVER_STAT(pkey3, pkeys[3]); +/* XXX fix the following when dynamic table of devices used */ +DRIVER_STAT(lid0, lid[0]); +DRIVER_STAT(lid1, lid[1]); +DRIVER_STAT(lid2, lid[2]); +DRIVER_STAT(lid3, lid[3]); + +DRIVER_STAT(nports, nports); +DRIVER_STAT(null_intr, nullintr); +DRIVER_STAT(max_pkts_call, maxpkts_call); +DRIVER_STAT(avg_pkts_call, avgpkts_call); +DRIVER_STAT(page_locks, pagelocks); +DRIVER_STAT(page_unlocks, pageunlocks); +DRIVER_STAT(krdrops, krdrops); +/* XXX fix the following when dynamic table of devices used */ +DRIVER_STAT(mlid0, mlid[0]); +DRIVER_STAT(mlid1, mlid[1]); +DRIVER_STAT(mlid2, mlid[2]); +DRIVER_STAT(mlid3, mlid[3]); + +static struct attribute *driver_stat_attributes[] = { + &driver_attr_intrs.attr, + &driver_attr_err_intrs.attr, + &driver_attr_errs.attr, + &driver_attr_pkt_errs.attr, + &driver_attr_crc_errs.attr, + &driver_attr_hw_errs.attr, + &driver_attr_ib_link.attr, + &driver_attr_port0_pkts.attr, + &driver_attr_ether_spkts.attr, + &driver_attr_ether_rpkts.attr, + &driver_attr_sma_spkts.attr, + &driver_attr_sma_rpkts.attr, + &driver_attr_hdrq_full.attr, + &driver_attr_etid_full.attr, + &driver_attr_no_piobufs.attr, + &driver_attr_ports.attr, + &driver_attr_pkey0.attr, + &driver_attr_pkey1.attr, + &driver_attr_pkey2.attr, + &driver_attr_pkey3.attr, + &driver_attr_lid0.attr, + &driver_attr_lid1.attr, + &driver_attr_lid2.attr, + &driver_attr_lid3.attr, + &driver_attr_nports.attr, + &driver_attr_null_intr.attr, + &driver_attr_max_pkts_call.attr, + &driver_attr_avg_pkts_call.attr, + &driver_attr_page_locks.attr, + &driver_attr_page_unlocks.attr, + &driver_attr_krdrops.attr, + &driver_attr_mlid0.attr, + &driver_attr_mlid1.attr, + &driver_attr_mlid2.attr, + &driver_attr_mlid3.attr, + NULL +}; + +static struct attribute_group driver_stat_attr_group = { + .name = "stats", + .attrs = driver_stat_attributes +}; + static ssize_t show_status(struct device *dev, struct device_attribute *attr, char *buf) @@ -180,23 +272,23 @@ static ssize_t store_lid(struct device *dev, size_t count) { struct ipath_devdata *dd = dev_get_drvdata(dev); - u16 lid = 0; + u16 lid; int ret; ret = ipath_parse_ushort(buf, &lid); if (ret < 0) goto invalid; - if (lid == 0 || lid >= IPATH_MULTICAST_LID_BASE) { + if (lid == 0 || lid >= 0xc000) { ret = -EINVAL; goto invalid; } - ipath_set_lid(dd, lid, 0); + ipath_set_sps_lid(dd, lid, 0); goto bail; invalid: - ipath_dev_err(dd, "attempt to set invalid LID 0x%x\n", lid); + ipath_dev_err(dd, "attempt to set invalid LID\n"); bail: return ret; } @@ -221,12 +313,13 @@ static ssize_t store_mlid(struct device *dev, int ret; ret = ipath_parse_ushort(buf, &mlid); - if (ret < 0 || mlid < IPATH_MULTICAST_LID_BASE) + if (ret < 0) goto invalid; unit = dd->ipath_unit; dd->ipath_mlid = mlid; + ipath_stats.sps_mlid[unit] = mlid; ipath_layer_intr(dd, IPATH_LAYER_INT_BCAST); goto bail; @@ -641,12 +734,20 @@ int ipath_driver_create_group(struct device_driver *drv) int ret; ret = sysfs_create_group(&drv->kobj, &driver_attr_group); + if (ret) + goto bail; + ret = sysfs_create_group(&drv->kobj, &driver_stat_attr_group); + if (ret) + sysfs_remove_group(&drv->kobj, &driver_attr_group); + +bail: return ret; } void ipath_driver_remove_group(struct device_driver *drv) { + sysfs_remove_group(&drv->kobj, &driver_stat_attr_group); sysfs_remove_group(&drv->kobj, &driver_attr_group); } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_uc.c b/trunk/drivers/infiniband/hw/ipath/ipath_uc.c index c33abea2d5a7..0d6dbc0a541e 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_uc.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_uc.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -32,7 +31,7 @@ */ #include "ipath_verbs.h" -#include "ipath_common.h" +#include "ips_common.h" /* cut down ridiculously long IB macro names */ #define OP(x) IB_OPCODE_UC_##x @@ -62,40 +61,90 @@ static void complete_last_send(struct ipath_qp *qp, struct ipath_swqe *wqe, } /** - * ipath_make_uc_req - construct a request packet (SEND, RDMA write) - * @qp: a pointer to the QP - * @ohdr: a pointer to the IB header being constructed - * @pmtu: the path MTU - * @bth0p: pointer to the BTH opcode word - * @bth2p: pointer to the BTH PSN word + * ipath_do_uc_send - do a send on a UC queue + * @data: contains a pointer to the QP to send on * - * Return 1 if constructed; otherwise, return 0. - * Note the QP s_lock must be held and interrupts disabled. + * Process entries in the send work queue until the queue is exhausted. + * Only allow one CPU to send a packet per QP (tasklet). + * Otherwise, after we drop the QP lock, two threads could send + * packets out of order. + * This is similar to ipath_do_rc_send() below except we don't have + * timeouts or resends. */ -int ipath_make_uc_req(struct ipath_qp *qp, - struct ipath_other_headers *ohdr, - u32 pmtu, u32 *bth0p, u32 *bth2p) +void ipath_do_uc_send(unsigned long data) { + struct ipath_qp *qp = (struct ipath_qp *)data; + struct ipath_ibdev *dev = to_idev(qp->ibqp.device); struct ipath_swqe *wqe; + unsigned long flags; + u16 lrh0; u32 hwords; + u32 nwords; + u32 extra_bytes; u32 bth0; + u32 bth2; + u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu); u32 len; + struct ipath_other_headers *ohdr; struct ib_wc wc; - if (!(ib_ipath_state_ops[qp->state] & IPATH_PROCESS_SEND_OK)) - goto done; + if (test_and_set_bit(IPATH_S_BUSY, &qp->s_flags)) + goto bail; + + if (unlikely(qp->remote_ah_attr.dlid == + ipath_layer_get_lid(dev->dd))) { + /* Pass in an uninitialized ib_wc to save stack space. */ + ipath_ruc_loopback(qp, &wc); + clear_bit(IPATH_S_BUSY, &qp->s_flags); + goto bail; + } + + ohdr = &qp->s_hdr.u.oth; + if (qp->remote_ah_attr.ah_flags & IB_AH_GRH) + ohdr = &qp->s_hdr.u.l.oth; +again: + /* Check for a constructed packet to be sent. */ + if (qp->s_hdrwords != 0) { + /* + * If no PIO bufs are available, return. + * An interrupt will call ipath_ib_piobufavail() + * when one is available. + */ + if (ipath_verbs_send(dev->dd, qp->s_hdrwords, + (u32 *) &qp->s_hdr, + qp->s_cur_size, + qp->s_cur_sge)) { + ipath_no_bufs_available(qp, dev); + goto bail; + } + dev->n_unicast_xmit++; + /* Record that we sent the packet and s_hdr is empty. */ + qp->s_hdrwords = 0; + } + + lrh0 = IPS_LRH_BTH; /* header size in 32-bit words LRH+BTH = (8+12)/4. */ hwords = 5; - bth0 = 0; - /* Get the next send request. */ + /* + * The lock is needed to synchronize between + * setting qp->s_ack_state and post_send(). + */ + spin_lock_irqsave(&qp->s_lock, flags); + + if (!(ib_ipath_state_ops[qp->state] & IPATH_PROCESS_SEND_OK)) + goto done; + + bth0 = ipath_layer_get_pkey(dev->dd, qp->s_pkey_index); + + /* Send a request. */ wqe = get_swqe_ptr(qp, qp->s_last); switch (qp->s_state) { default: /* - * Signal the completion of the last send - * (if there is one). + * Signal the completion of the last send (if there is + * one). */ if (qp->s_last != qp->s_tail) complete_last_send(qp, wqe, &wc); @@ -208,16 +257,61 @@ int ipath_make_uc_req(struct ipath_qp *qp, } break; } + bth2 = qp->s_next_psn++ & IPS_PSN_MASK; qp->s_len -= len; + bth0 |= qp->s_state << 24; + + spin_unlock_irqrestore(&qp->s_lock, flags); + + /* Construct the header. */ + extra_bytes = (4 - len) & 3; + nwords = (len + extra_bytes) >> 2; + if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) { + /* Header size in 32-bit words. */ + hwords += 10; + lrh0 = IPS_LRH_GRH; + qp->s_hdr.u.l.grh.version_tclass_flow = + cpu_to_be32((6 << 28) | + (qp->remote_ah_attr.grh.traffic_class + << 20) | + qp->remote_ah_attr.grh.flow_label); + qp->s_hdr.u.l.grh.paylen = + cpu_to_be16(((hwords - 12) + nwords + + SIZE_OF_CRC) << 2); + /* next_hdr is defined by C8-7 in ch. 8.4.1 */ + qp->s_hdr.u.l.grh.next_hdr = 0x1B; + qp->s_hdr.u.l.grh.hop_limit = + qp->remote_ah_attr.grh.hop_limit; + /* The SGID is 32-bit aligned. */ + qp->s_hdr.u.l.grh.sgid.global.subnet_prefix = + dev->gid_prefix; + qp->s_hdr.u.l.grh.sgid.global.interface_id = + ipath_layer_get_guid(dev->dd); + qp->s_hdr.u.l.grh.dgid = qp->remote_ah_attr.grh.dgid; + } qp->s_hdrwords = hwords; qp->s_cur_sge = &qp->s_sge; qp->s_cur_size = len; - *bth0p = bth0 | (qp->s_state << 24); - *bth2p = qp->s_next_psn++ & IPATH_PSN_MASK; - return 1; + lrh0 |= qp->remote_ah_attr.sl << 4; + qp->s_hdr.lrh[0] = cpu_to_be16(lrh0); + /* DEST LID */ + qp->s_hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid); + qp->s_hdr.lrh[2] = cpu_to_be16(hwords + nwords + SIZE_OF_CRC); + qp->s_hdr.lrh[3] = cpu_to_be16(ipath_layer_get_lid(dev->dd)); + bth0 |= extra_bytes << 20; + ohdr->bth[0] = cpu_to_be32(bth0); + ohdr->bth[1] = cpu_to_be32(qp->remote_qpn); + ohdr->bth[2] = cpu_to_be32(bth2); + + /* Check for more work to do. */ + goto again; done: - return 0; + spin_unlock_irqrestore(&qp->s_lock, flags); + clear_bit(IPATH_S_BUSY, &qp->s_flags); + +bail: + return; } /** @@ -241,6 +335,7 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, u32 hdrsize; u32 psn; u32 pad; + unsigned long flags; struct ib_wc wc; u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu); struct ib_reth *reth; @@ -278,6 +373,8 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, wc.imm_data = 0; wc.wc_flags = 0; + spin_lock_irqsave(&qp->r_rq.lock, flags); + /* Compare the PSN verses the expected PSN. */ if (unlikely(ipath_cmp24(psn, qp->r_psn) != 0)) { /* @@ -438,13 +535,12 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, if (qp->r_len != 0) { u32 rkey = be32_to_cpu(reth->rkey); u64 vaddr = be64_to_cpu(reth->vaddr); - int ok; /* Check rkey */ - ok = ipath_rkey_ok(dev, &qp->r_sge, qp->r_len, - vaddr, rkey, - IB_ACCESS_REMOTE_WRITE); - if (unlikely(!ok)) { + if (unlikely(!ipath_rkey_ok( + dev, &qp->r_sge, qp->r_len, + vaddr, rkey, + IB_ACCESS_REMOTE_WRITE))) { dev->n_pkt_drops++; goto done; } @@ -462,7 +558,8 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, } if (opcode == OP(RDMA_WRITE_ONLY)) goto rdma_last; - else if (opcode == OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE)) + else if (opcode == + OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE)) goto rdma_last_imm; /* FALLTHROUGH */ case OP(RDMA_WRITE_MIDDLE): @@ -495,9 +592,9 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, dev->n_pkt_drops++; goto done; } - if (qp->r_reuse_sge) + if (qp->r_reuse_sge) { qp->r_reuse_sge = 0; - else if (!ipath_get_rwqe(qp, 1)) { + } else if (!ipath_get_rwqe(qp, 1)) { dev->n_pkt_drops++; goto done; } @@ -534,11 +631,15 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, default: /* Drop packet for unknown opcodes. */ + spin_unlock_irqrestore(&qp->r_rq.lock, flags); dev->n_pkt_drops++; - goto done; + goto bail; } qp->r_psn++; qp->r_state = opcode; done: + spin_unlock_irqrestore(&qp->r_rq.lock, flags); + +bail: return; } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_ud.c b/trunk/drivers/infiniband/hw/ipath/ipath_ud.c index 3466129af804..e606daf83210 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_ud.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_ud.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -34,7 +33,7 @@ #include #include "ipath_verbs.h" -#include "ipath_common.h" +#include "ips_common.h" /** * ipath_ud_loopback - handle send on loopback QPs @@ -275,11 +274,6 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr) len += wr->sg_list[i].length; ss.num_sge++; } - /* Check for invalid packet size. */ - if (len > ipath_layer_get_ibmtu(dev->dd)) { - ret = -EINVAL; - goto bail; - } extra_bytes = (4 - len) & 3; nwords = (len + extra_bytes) >> 2; @@ -289,8 +283,8 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr) ret = -EINVAL; goto bail; } - if (ah_attr->dlid >= IPATH_MULTICAST_LID_BASE) { - if (ah_attr->dlid != IPATH_PERMISSIVE_LID) + if (ah_attr->dlid >= IPS_MULTICAST_LID_BASE) { + if (ah_attr->dlid != IPS_PERMISSIVE_LID) dev->n_multicast_xmit++; else dev->n_unicast_xmit++; @@ -310,7 +304,7 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr) if (ah_attr->ah_flags & IB_AH_GRH) { /* Header size in 32-bit words. */ hwords = 17; - lrh0 = IPATH_LRH_GRH; + lrh0 = IPS_LRH_GRH; ohdr = &qp->s_hdr.u.l.oth; qp->s_hdr.u.l.grh.version_tclass_flow = cpu_to_be32((6 << 28) | @@ -336,7 +330,7 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr) } else { /* Header size in 32-bit words. */ hwords = 7; - lrh0 = IPATH_LRH_BTH; + lrh0 = IPS_LRH_BTH; ohdr = &qp->s_hdr.u.oth; } if (wr->opcode == IB_WR_SEND_WITH_IMM) { @@ -367,18 +361,18 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr) if (wr->send_flags & IB_SEND_SOLICITED) bth0 |= 1 << 23; bth0 |= extra_bytes << 20; - bth0 |= qp->ibqp.qp_type == IB_QPT_SMI ? IPATH_DEFAULT_P_KEY : + bth0 |= qp->ibqp.qp_type == IB_QPT_SMI ? IPS_DEFAULT_P_KEY : ipath_layer_get_pkey(dev->dd, qp->s_pkey_index); ohdr->bth[0] = cpu_to_be32(bth0); /* * Use the multicast QP if the destination LID is a multicast LID. */ - ohdr->bth[1] = ah_attr->dlid >= IPATH_MULTICAST_LID_BASE && - ah_attr->dlid != IPATH_PERMISSIVE_LID ? - __constant_cpu_to_be32(IPATH_MULTICAST_QPN) : + ohdr->bth[1] = ah_attr->dlid >= IPS_MULTICAST_LID_BASE && + ah_attr->dlid != IPS_PERMISSIVE_LID ? + __constant_cpu_to_be32(IPS_MULTICAST_QPN) : cpu_to_be32(wr->wr.ud.remote_qpn); /* XXX Could lose a PSN count but not worth locking */ - ohdr->bth[2] = cpu_to_be32(qp->s_next_psn++ & IPATH_PSN_MASK); + ohdr->bth[2] = cpu_to_be32(qp->s_next_psn++ & IPS_PSN_MASK); /* * Qkeys with the high order bit set mean use the * qkey from the QP context instead of the WR (see 10.2.5). @@ -469,7 +463,7 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, src_qp = be32_to_cpu(ohdr->u.ud.deth[1]); } } - src_qp &= IPATH_QPN_MASK; + src_qp &= IPS_QPN_MASK; /* * Check that the permissive LID is only used on QP0 @@ -560,16 +554,7 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, spin_lock_irqsave(&rq->lock, flags); if (rq->tail == rq->head) { spin_unlock_irqrestore(&rq->lock, flags); - /* - * Count VL15 packets dropped due to no receive buffer. - * Otherwise, count them as buffer overruns since usually, - * the HW will be able to receive packets even if there are - * no QPs with posted receive buffers. - */ - if (qp->ibqp.qp_num == 0) - dev->n_vl15_dropped++; - else - dev->rcv_errors++; + dev->n_pkt_drops++; goto bail; } /* Silently drop packets which are too big. */ @@ -627,7 +612,7 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, /* * Save the LMC lower bits if the destination LID is a unicast LID. */ - wc.dlid_path_bits = dlid >= IPATH_MULTICAST_LID_BASE ? 0 : + wc.dlid_path_bits = dlid >= IPS_MULTICAST_LID_BASE ? 0 : dlid & ((1 << (dev->mkeyprot_resv_lmc & 7)) - 1); /* Signal completion event if the solicited bit is set. */ ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_user_pages.c b/trunk/drivers/infiniband/hw/ipath/ipath_user_pages.c index e32fca9faf80..2bb08afc86d0 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_user_pages.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_user_pages.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -58,6 +57,17 @@ static int __get_user_pages(unsigned long start_page, size_t num_pages, size_t got; int ret; +#if 0 + /* + * XXX - causes MPI programs to fail, haven't had time to check + * yet + */ + if (!capable(CAP_IPC_LOCK)) { + ret = -EPERM; + goto bail; + } +#endif + lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur >> PAGE_SHIFT; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_verbs.c b/trunk/drivers/infiniband/hw/ipath/ipath_verbs.c index 56ac336dd1ec..28fdbdaa789d 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_verbs.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -37,7 +36,7 @@ #include "ipath_kernel.h" #include "ipath_verbs.h" -#include "ipath_common.h" +#include "ips_common.h" /* Not static, because we don't want the compiler removing it */ const char ipath_verbs_version[] = "ipath_verbs " IPATH_IDSTR; @@ -56,62 +55,9 @@ unsigned int ib_ipath_debug; /* debug mask */ module_param_named(debug, ib_ipath_debug, uint, S_IWUSR | S_IRUGO); MODULE_PARM_DESC(debug, "Verbs debug mask"); -static unsigned int ib_ipath_max_pds = 0xFFFF; -module_param_named(max_pds, ib_ipath_max_pds, uint, S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_pds, - "Maximum number of protection domains to support"); - -static unsigned int ib_ipath_max_ahs = 0xFFFF; -module_param_named(max_ahs, ib_ipath_max_ahs, uint, S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_ahs, "Maximum number of address handles to support"); - -unsigned int ib_ipath_max_cqes = 0x2FFFF; -module_param_named(max_cqes, ib_ipath_max_cqes, uint, S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_cqes, - "Maximum number of completion queue entries to support"); - -unsigned int ib_ipath_max_cqs = 0x1FFFF; -module_param_named(max_cqs, ib_ipath_max_cqs, uint, S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_cqs, "Maximum number of completion queues to support"); - -unsigned int ib_ipath_max_qp_wrs = 0x3FFF; -module_param_named(max_qp_wrs, ib_ipath_max_qp_wrs, uint, - S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_qp_wrs, "Maximum number of QP WRs to support"); - -unsigned int ib_ipath_max_sges = 0x60; -module_param_named(max_sges, ib_ipath_max_sges, uint, S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_sges, "Maximum number of SGEs to support"); - -unsigned int ib_ipath_max_mcast_grps = 16384; -module_param_named(max_mcast_grps, ib_ipath_max_mcast_grps, uint, - S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_mcast_grps, - "Maximum number of multicast groups to support"); - -unsigned int ib_ipath_max_mcast_qp_attached = 16; -module_param_named(max_mcast_qp_attached, ib_ipath_max_mcast_qp_attached, - uint, S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_mcast_qp_attached, - "Maximum number of attached QPs to support"); - -unsigned int ib_ipath_max_srqs = 1024; -module_param_named(max_srqs, ib_ipath_max_srqs, uint, S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_srqs, "Maximum number of SRQs to support"); - -unsigned int ib_ipath_max_srq_sges = 128; -module_param_named(max_srq_sges, ib_ipath_max_srq_sges, - uint, S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_srq_sges, "Maximum number of SRQ SGEs to support"); - -unsigned int ib_ipath_max_srq_wrs = 0x1FFFF; -module_param_named(max_srq_wrs, ib_ipath_max_srq_wrs, - uint, S_IWUSR | S_IRUGO); -MODULE_PARM_DESC(max_srq_wrs, "Maximum number of SRQ WRs support"); - MODULE_LICENSE("GPL"); -MODULE_AUTHOR("QLogic "); -MODULE_DESCRIPTION("QLogic InfiniPath driver"); +MODULE_AUTHOR("PathScale "); +MODULE_DESCRIPTION("Pathscale InfiniPath driver"); const int ib_ipath_state_ops[IB_QPS_ERR + 1] = { [IB_QPS_RESET] = 0, @@ -247,7 +193,7 @@ static int ipath_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, switch (qp->ibqp.qp_type) { case IB_QPT_UC: case IB_QPT_RC: - err = ipath_post_ruc_send(qp, wr); + err = ipath_post_rc_send(qp, wr); break; case IB_QPT_SMI: @@ -429,7 +375,7 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen) /* Check for a valid destination LID (see ch. 7.11.1). */ lid = be16_to_cpu(hdr->lrh[1]); - if (lid < IPATH_MULTICAST_LID_BASE) { + if (lid < IPS_MULTICAST_LID_BASE) { lid &= ~((1 << (dev->mkeyprot_resv_lmc & 7)) - 1); if (unlikely(lid != ipath_layer_get_lid(dev->dd))) { dev->rcv_errors++; @@ -439,9 +385,9 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen) /* Check for GRH */ lnh = be16_to_cpu(hdr->lrh[0]) & 3; - if (lnh == IPATH_LRH_BTH) + if (lnh == IPS_LRH_BTH) ohdr = &hdr->u.oth; - else if (lnh == IPATH_LRH_GRH) + else if (lnh == IPS_LRH_GRH) ohdr = &hdr->u.l.oth; else { dev->rcv_errors++; @@ -453,8 +399,8 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen) dev->opstats[opcode].n_packets++; /* Get the destination QP number. */ - qp_num = be32_to_cpu(ohdr->bth[1]) & IPATH_QPN_MASK; - if (qp_num == IPATH_MULTICAST_QPN) { + qp_num = be32_to_cpu(ohdr->bth[1]) & IPS_QPN_MASK; + if (qp_num == IPS_MULTICAST_QPN) { struct ipath_mcast *mcast; struct ipath_mcast_qp *p; @@ -465,7 +411,7 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen) } dev->n_multicast_rcv++; list_for_each_entry_rcu(p, &mcast->qp_list, list) - ipath_qp_rcv(dev, hdr, lnh == IPATH_LRH_GRH, data, + ipath_qp_rcv(dev, hdr, lnh == IPS_LRH_GRH, data, tlen, p->qp); /* * Notify ipath_multicast_detach() if it is waiting for us @@ -477,7 +423,7 @@ static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen) qp = ipath_lookup_qpn(&dev->qp_table, qp_num); if (qp) { dev->n_unicast_rcv++; - ipath_qp_rcv(dev, hdr, lnh == IPATH_LRH_GRH, data, + ipath_qp_rcv(dev, hdr, lnh == IPS_LRH_GRH, data, tlen, qp); /* * Notify ipath_destroy_qp() if it is waiting @@ -621,38 +567,40 @@ static int ipath_query_device(struct ib_device *ibdev, struct ib_device_attr *props) { struct ipath_ibdev *dev = to_idev(ibdev); + u32 vendor, boardrev, majrev, minrev; memset(props, 0, sizeof(*props)); props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR | IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT | IB_DEVICE_SYS_IMAGE_GUID; - props->vendor_id = ipath_layer_get_vendorid(dev->dd); - props->vendor_part_id = ipath_layer_get_deviceid(dev->dd); - props->hw_ver = ipath_layer_get_pcirev(dev->dd); + ipath_layer_query_device(dev->dd, &vendor, &boardrev, + &majrev, &minrev); + props->vendor_id = vendor; + props->vendor_part_id = boardrev; + props->hw_ver = boardrev << 16 | majrev << 8 | minrev; props->sys_image_guid = dev->sys_image_guid; props->max_mr_size = ~0ull; - props->max_qp = dev->qp_table.max; - props->max_qp_wr = ib_ipath_max_qp_wrs; - props->max_sge = ib_ipath_max_sges; - props->max_cq = ib_ipath_max_cqs; - props->max_ah = ib_ipath_max_ahs; - props->max_cqe = ib_ipath_max_cqes; - props->max_mr = dev->lk_table.max; - props->max_pd = ib_ipath_max_pds; + props->max_qp = 0xffff; + props->max_qp_wr = 0xffff; + props->max_sge = 255; + props->max_cq = 0xffff; + props->max_cqe = 0xffff; + props->max_mr = 0xffff; + props->max_pd = 0xffff; props->max_qp_rd_atom = 1; props->max_qp_init_rd_atom = 1; /* props->max_res_rd_atom */ - props->max_srq = ib_ipath_max_srqs; - props->max_srq_wr = ib_ipath_max_srq_wrs; - props->max_srq_sge = ib_ipath_max_srq_sges; + props->max_srq = 0xffff; + props->max_srq_wr = 0xffff; + props->max_srq_sge = 255; /* props->local_ca_ack_delay */ props->atomic_cap = IB_ATOMIC_HCA; props->max_pkeys = ipath_layer_get_npkeys(dev->dd); - props->max_mcast_grp = ib_ipath_max_mcast_grps; - props->max_mcast_qp_attach = ib_ipath_max_mcast_qp_attached; + props->max_mcast_grp = 0xffff; + props->max_mcast_qp_attach = 0xffff; props->max_total_mcast_qp_attach = props->max_mcast_qp_attach * props->max_mcast_grp; @@ -695,10 +643,10 @@ static int ipath_query_port(struct ib_device *ibdev, ipath_layer_get_lastibcstat(dev->dd) & 0xf]; props->port_cap_flags = dev->port_cap_flags; props->gid_tbl_len = 1; - props->max_msg_sz = 0x80000000; + props->max_msg_sz = 4096; props->pkey_tbl_len = ipath_layer_get_npkeys(dev->dd); props->bad_pkey_cntr = ipath_layer_get_cr_errpkey(dev->dd) - - dev->z_pkey_violations; + dev->n_pkey_violations; props->qkey_viol_cntr = dev->qkey_violations; props->active_width = IB_WIDTH_4X; /* See rate_show() */ @@ -795,30 +743,15 @@ static struct ib_pd *ipath_alloc_pd(struct ib_device *ibdev, struct ib_ucontext *context, struct ib_udata *udata) { - struct ipath_ibdev *dev = to_idev(ibdev); struct ipath_pd *pd; struct ib_pd *ret; - /* - * This is actually totally arbitrary. Some correctness tests - * assume there's a maximum number of PDs that can be allocated. - * We don't actually have this limit, but we fail the test if - * we allow allocations of more than we report for this value. - */ - - if (dev->n_pds_allocated == ib_ipath_max_pds) { - ret = ERR_PTR(-ENOMEM); - goto bail; - } - pd = kmalloc(sizeof *pd, GFP_KERNEL); if (!pd) { ret = ERR_PTR(-ENOMEM); goto bail; } - dev->n_pds_allocated++; - /* ib_alloc_pd() will initialize pd->ibpd. */ pd->user = udata != NULL; @@ -831,9 +764,6 @@ static struct ib_pd *ipath_alloc_pd(struct ib_device *ibdev, static int ipath_dealloc_pd(struct ib_pd *ibpd) { struct ipath_pd *pd = to_ipd(ibpd); - struct ipath_ibdev *dev = to_idev(ibpd->device); - - dev->n_pds_allocated--; kfree(pd); @@ -852,40 +782,21 @@ static struct ib_ah *ipath_create_ah(struct ib_pd *pd, { struct ipath_ah *ah; struct ib_ah *ret; - struct ipath_ibdev *dev = to_idev(pd->device); - - if (dev->n_ahs_allocated == ib_ipath_max_ahs) { - ret = ERR_PTR(-ENOMEM); - goto bail; - } /* A multicast address requires a GRH (see ch. 8.4.1). */ - if (ah_attr->dlid >= IPATH_MULTICAST_LID_BASE && - ah_attr->dlid != IPATH_PERMISSIVE_LID && + if (ah_attr->dlid >= IPS_MULTICAST_LID_BASE && + ah_attr->dlid != IPS_PERMISSIVE_LID && !(ah_attr->ah_flags & IB_AH_GRH)) { ret = ERR_PTR(-EINVAL); goto bail; } - if (ah_attr->dlid == 0) { - ret = ERR_PTR(-EINVAL); - goto bail; - } - - if (ah_attr->port_num < 1 || - ah_attr->port_num > pd->device->phys_port_cnt) { - ret = ERR_PTR(-EINVAL); - goto bail; - } - ah = kmalloc(sizeof *ah, GFP_ATOMIC); if (!ah) { ret = ERR_PTR(-ENOMEM); goto bail; } - dev->n_ahs_allocated++; - /* ib_create_ah() will initialize ah->ibah. */ ah->attr = *ah_attr; @@ -903,11 +814,8 @@ static struct ib_ah *ipath_create_ah(struct ib_pd *pd, */ static int ipath_destroy_ah(struct ib_ah *ibah) { - struct ipath_ibdev *dev = to_idev(ibah->device); struct ipath_ah *ah = to_iah(ibah); - dev->n_ahs_allocated--; - kfree(ah); return 0; @@ -981,7 +889,6 @@ static int ipath_verbs_register_sysfs(struct ib_device *dev); */ static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd) { - struct ipath_layer_counters cntrs; struct ipath_ibdev *idev; struct ib_device *dev; int ret; @@ -1032,25 +939,6 @@ static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd) idev->pma_counter_select[5] = IB_PMA_PORT_XMIT_WAIT; idev->link_width_enabled = 3; /* 1x or 4x */ - /* Snapshot current HW counters to "clear" them. */ - ipath_layer_get_counters(dd, &cntrs); - idev->z_symbol_error_counter = cntrs.symbol_error_counter; - idev->z_link_error_recovery_counter = - cntrs.link_error_recovery_counter; - idev->z_link_downed_counter = cntrs.link_downed_counter; - idev->z_port_rcv_errors = cntrs.port_rcv_errors; - idev->z_port_rcv_remphys_errors = - cntrs.port_rcv_remphys_errors; - idev->z_port_xmit_discards = cntrs.port_xmit_discards; - idev->z_port_xmit_data = cntrs.port_xmit_data; - idev->z_port_rcv_data = cntrs.port_rcv_data; - idev->z_port_xmit_packets = cntrs.port_xmit_packets; - idev->z_port_rcv_packets = cntrs.port_rcv_packets; - idev->z_local_link_integrity_errors = - cntrs.local_link_integrity_errors; - idev->z_excessive_buffer_overrun_errors = - cntrs.excessive_buffer_overrun_errors; - /* * The system image GUID is supposed to be the same for all * IB HCAs in a single system but since there can be other @@ -1221,8 +1109,11 @@ static ssize_t show_rev(struct class_device *cdev, char *buf) { struct ipath_ibdev *dev = container_of(cdev, struct ipath_ibdev, ibdev.class_dev); + int vendor, boardrev, majrev, minrev; - return sprintf(buf, "%x\n", ipath_layer_get_pcirev(dev->dd)); + ipath_layer_query_device(dev->dd, &vendor, &boardrev, + &majrev, &minrev); + return sprintf(buf, "%d.%d\n", majrev, minrev); } static ssize_t show_hca(struct class_device *cdev, char *buf) diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_verbs.h b/trunk/drivers/infiniband/hw/ipath/ipath_verbs.h index 2df684727dc1..4f8d59300e9b 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_verbs.h +++ b/trunk/drivers/infiniband/hw/ipath/ipath_verbs.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -149,7 +148,6 @@ struct ipath_mcast { struct list_head qp_list; wait_queue_head_t wait; atomic_t refcount; - int n_attached; }; /* Memory region */ @@ -307,34 +305,32 @@ struct ipath_qp { u32 s_next_psn; /* PSN for next request */ u32 s_last_psn; /* last response PSN processed */ u32 s_psn; /* current packet sequence number */ - u32 s_ack_psn; /* PSN for RDMA_READ */ u32 s_rnr_timeout; /* number of milliseconds for RNR timeout */ - u32 r_ack_psn; /* PSN for next ACK or atomic ACK */ + u32 s_ack_psn; /* PSN for next ACK or RDMA_READ */ + u64 s_ack_atomic; /* data for atomic ACK */ u64 r_wr_id; /* ID for current receive WQE */ u64 r_atomic_data; /* data for last atomic op */ u32 r_atomic_psn; /* PSN of last atomic op */ u32 r_len; /* total length of r_sge */ u32 r_rcv_len; /* receive data len processed */ u32 r_psn; /* expected rcv packet sequence number */ - u32 r_msn; /* message sequence number */ u8 state; /* QP state */ u8 s_state; /* opcode of last packet sent */ u8 s_ack_state; /* opcode of packet to ACK */ u8 s_nak_state; /* non-zero if NAK is pending */ u8 r_state; /* opcode of last packet received */ - u8 r_ack_state; /* opcode of packet to ACK */ - u8 r_nak_state; /* non-zero if NAK is pending */ - u8 r_min_rnr_timer; /* retry timeout value for RNR NAKs */ u8 r_reuse_sge; /* for UC receive errors */ u8 r_sge_inx; /* current index into sg_list */ - u8 qp_access_flags; u8 s_max_sge; /* size of s_wq->sg_list */ + u8 qp_access_flags; u8 s_retry_cnt; /* number of times to retry */ u8 s_rnr_retry_cnt; + u8 s_min_rnr_timer; u8 s_retry; /* requester retry counter */ u8 s_rnr_retry; /* requester RNR retry counter */ u8 s_pkey_index; /* PKEY index to use */ enum ib_mtu path_mtu; + atomic_t msn; /* message sequence number */ u32 remote_qpn; u32 qkey; /* QKEY for this QP (for UD or RD) */ u32 s_size; /* send work queue size */ @@ -435,11 +431,6 @@ struct ipath_ibdev { __be64 sys_image_guid; /* in network order */ __be64 gid_prefix; /* in network order */ __be64 mkey; - u32 n_pds_allocated; /* number of PDs allocated for device */ - u32 n_ahs_allocated; /* number of AHs allocated for device */ - u32 n_cqs_allocated; /* number of CQs allocated for device */ - u32 n_srqs_allocated; /* number of SRQs allocated for device */ - u32 n_mcast_grps_allocated; /* number of mcast groups allocated */ u64 ipath_sword; /* total dwords sent (sample result) */ u64 ipath_rword; /* total dwords received (sample result) */ u64 ipath_spkts; /* total packets sent (sample result) */ @@ -451,19 +442,17 @@ struct ipath_ibdev { u64 n_unicast_rcv; /* total unicast packets received */ u64 n_multicast_xmit; /* total multicast packets sent */ u64 n_multicast_rcv; /* total multicast packets received */ - u64 z_symbol_error_counter; /* starting count for PMA */ - u64 z_link_error_recovery_counter; /* starting count for PMA */ - u64 z_link_downed_counter; /* starting count for PMA */ - u64 z_port_rcv_errors; /* starting count for PMA */ - u64 z_port_rcv_remphys_errors; /* starting count for PMA */ - u64 z_port_xmit_discards; /* starting count for PMA */ - u64 z_port_xmit_data; /* starting count for PMA */ - u64 z_port_rcv_data; /* starting count for PMA */ - u64 z_port_xmit_packets; /* starting count for PMA */ - u64 z_port_rcv_packets; /* starting count for PMA */ - u32 z_pkey_violations; /* starting count for PMA */ - u32 z_local_link_integrity_errors; /* starting count for PMA */ - u32 z_excessive_buffer_overrun_errors; /* starting count for PMA */ + u64 n_symbol_error_counter; /* starting count for PMA */ + u64 n_link_error_recovery_counter; /* starting count for PMA */ + u64 n_link_downed_counter; /* starting count for PMA */ + u64 n_port_rcv_errors; /* starting count for PMA */ + u64 n_port_rcv_remphys_errors; /* starting count for PMA */ + u64 n_port_xmit_discards; /* starting count for PMA */ + u64 n_port_xmit_data; /* starting count for PMA */ + u64 n_port_rcv_data; /* starting count for PMA */ + u64 n_port_xmit_packets; /* starting count for PMA */ + u64 n_port_rcv_packets; /* starting count for PMA */ + u32 n_pkey_violations; /* starting count for PMA */ u32 n_rc_resends; u32 n_rc_acks; u32 n_rc_qacks; @@ -473,7 +462,6 @@ struct ipath_ibdev { u32 n_other_naks; u32 n_timeouts; u32 n_pkt_drops; - u32 n_vl15_dropped; u32 n_wqe_errs; u32 n_rdma_dup_busy; u32 n_piowait; @@ -592,6 +580,10 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc); void ipath_get_credit(struct ipath_qp *qp, u32 aeth); +void ipath_do_rc_send(unsigned long data); + +void ipath_do_uc_send(unsigned long data); + void ipath_cq_enter(struct ipath_cq *cq, struct ib_wc *entry, int sig); int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, @@ -604,7 +596,7 @@ void ipath_copy_sge(struct ipath_sge_state *ss, void *data, u32 length); void ipath_skip_sge(struct ipath_sge_state *ss, u32 length); -int ipath_post_ruc_send(struct ipath_qp *qp, struct ib_send_wr *wr); +int ipath_post_rc_send(struct ipath_qp *qp, struct ib_send_wr *wr); void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, int has_grh, void *data, u32 tlen, struct ipath_qp *qp); @@ -686,19 +678,7 @@ void ipath_insert_rnr_queue(struct ipath_qp *qp); int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only); -u32 ipath_make_grh(struct ipath_ibdev *dev, struct ib_grh *hdr, - struct ib_global_route *grh, u32 hwords, u32 nwords); - -void ipath_do_ruc_send(unsigned long data); - -u32 ipath_make_rc_ack(struct ipath_qp *qp, struct ipath_other_headers *ohdr, - u32 pmtu); - -int ipath_make_rc_req(struct ipath_qp *qp, struct ipath_other_headers *ohdr, - u32 pmtu, u32 *bth0p, u32 *bth2p); - -int ipath_make_uc_req(struct ipath_qp *qp, struct ipath_other_headers *ohdr, - u32 pmtu, u32 *bth0p, u32 *bth2p); +void ipath_ruc_loopback(struct ipath_qp *sqp, struct ib_wc *wc); extern const enum ib_wc_opcode ib_ipath_wc_opcode[]; @@ -708,24 +688,6 @@ extern const int ib_ipath_state_ops[]; extern unsigned int ib_ipath_lkey_table_size; -extern unsigned int ib_ipath_max_cqes; - -extern unsigned int ib_ipath_max_cqs; - -extern unsigned int ib_ipath_max_qp_wrs; - -extern unsigned int ib_ipath_max_sges; - -extern unsigned int ib_ipath_max_mcast_grps; - -extern unsigned int ib_ipath_max_mcast_qp_attached; - -extern unsigned int ib_ipath_max_srqs; - -extern unsigned int ib_ipath_max_srq_sges; - -extern unsigned int ib_ipath_max_srq_wrs; - extern const u32 ib_ipath_rnr_table[]; #endif /* IPATH_VERBS_H */ diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c b/trunk/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c index ee0e1d96d723..10b31d2c4f20 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -93,7 +92,6 @@ static struct ipath_mcast *ipath_mcast_alloc(union ib_gid *mgid) INIT_LIST_HEAD(&mcast->qp_list); init_waitqueue_head(&mcast->wait); atomic_set(&mcast->refcount, 0); - mcast->n_attached = 0; bail: return mcast; @@ -159,8 +157,7 @@ struct ipath_mcast *ipath_mcast_find(union ib_gid *mgid) * the table but the QP was added. Return ESRCH if the QP was already * attached and neither structure was added. */ -static int ipath_mcast_add(struct ipath_ibdev *dev, - struct ipath_mcast *mcast, +static int ipath_mcast_add(struct ipath_mcast *mcast, struct ipath_mcast_qp *mqp) { struct rb_node **n = &mcast_tree.rb_node; @@ -191,47 +188,34 @@ static int ipath_mcast_add(struct ipath_ibdev *dev, /* Search the QP list to see if this is already there. */ list_for_each_entry_rcu(p, &tmcast->qp_list, list) { if (p->qp == mqp->qp) { + spin_unlock_irqrestore(&mcast_lock, flags); ret = ESRCH; goto bail; } } - if (tmcast->n_attached == ib_ipath_max_mcast_qp_attached) { - ret = ENOMEM; - goto bail; - } - - tmcast->n_attached++; - list_add_tail_rcu(&mqp->list, &tmcast->qp_list); + spin_unlock_irqrestore(&mcast_lock, flags); ret = EEXIST; goto bail; } - if (dev->n_mcast_grps_allocated == ib_ipath_max_mcast_grps) { - ret = ENOMEM; - goto bail; - } - - dev->n_mcast_grps_allocated++; - list_add_tail_rcu(&mqp->list, &mcast->qp_list); atomic_inc(&mcast->refcount); rb_link_node(&mcast->rb_node, pn, n); rb_insert_color(&mcast->rb_node, &mcast_tree); + spin_unlock_irqrestore(&mcast_lock, flags); + ret = 0; bail: - spin_unlock_irqrestore(&mcast_lock, flags); - return ret; } int ipath_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) { struct ipath_qp *qp = to_iqp(ibqp); - struct ipath_ibdev *dev = to_idev(ibqp->device); struct ipath_mcast *mcast; struct ipath_mcast_qp *mqp; int ret; @@ -251,7 +235,7 @@ int ipath_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) ret = -ENOMEM; goto bail; } - switch (ipath_mcast_add(dev, mcast, mqp)) { + switch (ipath_mcast_add(mcast, mqp)) { case ESRCH: /* Neither was used: can't attach the same QP twice. */ ipath_mcast_qp_free(mqp); @@ -261,12 +245,6 @@ int ipath_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) case EEXIST: /* The mcast wasn't used */ ipath_mcast_free(mcast); break; - case ENOMEM: - /* Exceeded the maximum number of mcast groups. */ - ipath_mcast_qp_free(mqp); - ipath_mcast_free(mcast); - ret = -ENOMEM; - goto bail; default: break; } @@ -280,7 +258,6 @@ int ipath_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) { struct ipath_qp *qp = to_iqp(ibqp); - struct ipath_ibdev *dev = to_idev(ibqp->device); struct ipath_mcast *mcast = NULL; struct ipath_mcast_qp *p, *tmp; struct rb_node *n; @@ -295,7 +272,7 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) while (1) { if (n == NULL) { spin_unlock_irqrestore(&mcast_lock, flags); - ret = -EINVAL; + ret = 0; goto bail; } @@ -319,7 +296,6 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) * link until we are sure there are no list walkers. */ list_del_rcu(&p->list); - mcast->n_attached--; /* If this was the last attached QP, remove the GID too. */ if (list_empty(&mcast->qp_list)) { @@ -343,7 +319,6 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) atomic_dec(&mcast->refcount); wait_event(mcast->wait, !atomic_read(&mcast->refcount)); ipath_mcast_free(mcast); - dev->n_mcast_grps_allocated--; } ret = 0; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_wc_x86_64.c b/trunk/drivers/infiniband/hw/ipath/ipath_wc_x86_64.c index f8f9e2e8cbdd..adc5322f15c1 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_wc_x86_64.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_wc_x86_64.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two diff --git a/trunk/drivers/infiniband/hw/ipath/ips_common.h b/trunk/drivers/infiniband/hw/ipath/ips_common.h new file mode 100644 index 000000000000..ab7cbbbfd03a --- /dev/null +++ b/trunk/drivers/infiniband/hw/ipath/ips_common.h @@ -0,0 +1,263 @@ +#ifndef IPS_COMMON_H +#define IPS_COMMON_H +/* + * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "ipath_common.h" + +struct ipath_header { + /* + * Version - 4 bits, Port - 4 bits, TID - 10 bits and Offset - + * 14 bits before ECO change ~28 Dec 03. After that, Vers 4, + * Port 3, TID 11, offset 14. + */ + __le32 ver_port_tid_offset; + __le16 chksum; + __le16 pkt_flags; +}; + +struct ips_message_header { + __be16 lrh[4]; + __be32 bth[3]; + /* fields below this point are in host byte order */ + struct ipath_header iph; + __u8 sub_opcode; + __u8 flags; + __u16 src_rank; + /* 24 bits. The upper 8 bit is available for other use */ + union { + struct { + unsigned ack_seq_num:24; + unsigned port:4; + unsigned unused:4; + }; + __u32 ack_seq_num_org; + }; + __u8 expected_tid_session_id; + __u8 tinylen; /* to aid MPI */ + union { + __u16 tag; /* to aid MPI */ + __u16 mqhdr; /* for PSM MQ */ + }; + union { + __u32 mpi[4]; /* to aid MPI */ + __u32 data[4]; + __u64 mq[2]; /* for PSM MQ */ + struct { + __u16 mtu; + __u8 major_ver; + __u8 minor_ver; + __u32 not_used; //free + __u32 run_id; + __u32 client_ver; + }; + }; +}; + +struct ether_header { + __be16 lrh[4]; + __be32 bth[3]; + struct ipath_header iph; + __u8 sub_opcode; + __u8 cmd; + __be16 lid; + __u16 mac[3]; + __u8 frag_num; + __u8 seq_num; + __le32 len; + /* MUST be of word size due to PIO write requirements */ + __le32 csum; + __le16 csum_offset; + __le16 flags; + __u16 first_2_bytes; + __u8 unused[2]; /* currently unused */ +}; + +/* + * The PIO buffer used for sending infinipath messages must only be written + * in 32-bit words, all the data must be written, and no writes can occur + * after the last word is written (which transfers "ownership" of the buffer + * to the chip and triggers the message to be sent). + * Since the Linux sk_buff structure can be recursive, non-aligned, and + * any number of bytes in each segment, we use the following structure + * to keep information about the overall state of the copy operation. + * This is used to save the information needed to store the checksum + * in the right place before sending the last word to the hardware and + * to buffer the last 0-3 bytes of non-word sized segments. + */ +struct copy_data_s { + struct ether_header *hdr; + /* addr of PIO buf to write csum to */ + __u32 __iomem *csum_pio; + __u32 __iomem *to; /* addr of PIO buf to write data to */ + __u32 device; /* which device to allocate PIO bufs from */ + __s32 error; /* set if there is an error. */ + __s32 extra; /* amount of data saved in u.buf below */ + __u32 len; /* total length to send in bytes */ + __u32 flen; /* frament length in words */ + __u32 csum; /* partial IP checksum */ + __u32 pos; /* position for partial checksum */ + __u32 offset; /* offset to where data currently starts */ + __s32 checksum_calc; /* set to 1 when csum has been calculated */ + struct sk_buff *skb; + union { + __u32 w; + __u8 buf[4]; + } u; +}; + +/* IB - LRH header consts */ +#define IPS_LRH_GRH 0x0003 /* 1. word of IB LRH - next header: GRH */ +#define IPS_LRH_BTH 0x0002 /* 1. word of IB LRH - next header: BTH */ + +#define IPS_OFFSET 0 + +/* + * defines the cut-off point between the header queue and eager/expected + * TID queue + */ +#define NUM_OF_EXTRA_WORDS_IN_HEADER_QUEUE \ + ((sizeof(struct ips_message_header) - \ + offsetof(struct ips_message_header, iph)) >> 2) + +/* OpCodes */ +#define OPCODE_IPS 0xC0 +#define OPCODE_ITH4X 0xC1 + +/* OpCode 30 is use by stand-alone test programs */ +#define OPCODE_RAW_DATA 0xDE +/* last OpCode (31) is reserved for test */ +#define OPCODE_TEST 0xDF + +/* sub OpCodes - ips */ +#define OPCODE_SEQ_DATA 0x01 +#define OPCODE_SEQ_CTRL 0x02 + +#define OPCODE_SEQ_MQ_DATA 0x03 +#define OPCODE_SEQ_MQ_CTRL 0x04 + +#define OPCODE_ACK 0x10 +#define OPCODE_NAK 0x11 + +#define OPCODE_ERR_CHK 0x20 +#define OPCODE_ERR_CHK_PLS 0x21 + +#define OPCODE_STARTUP 0x30 +#define OPCODE_STARTUP_ACK 0x31 +#define OPCODE_STARTUP_NAK 0x32 + +#define OPCODE_STARTUP_EXT 0x34 +#define OPCODE_STARTUP_ACK_EXT 0x35 +#define OPCODE_STARTUP_NAK_EXT 0x36 + +#define OPCODE_TIDS_RELEASE 0x40 +#define OPCODE_TIDS_RELEASE_CONFIRM 0x41 + +#define OPCODE_CLOSE 0x50 +#define OPCODE_CLOSE_ACK 0x51 +/* + * like OPCODE_CLOSE, but no complaint if other side has already closed. + * Used when doing abort(), MPI_Abort(), etc. + */ +#define OPCODE_ABORT 0x52 + +/* sub OpCodes - ith4x */ +#define OPCODE_ENCAP 0x81 +#define OPCODE_LID_ARP 0x82 + +/* Receive Header Queue: receive type (from infinipath) */ +#define RCVHQ_RCV_TYPE_EXPECTED 0 +#define RCVHQ_RCV_TYPE_EAGER 1 +#define RCVHQ_RCV_TYPE_NON_KD 2 +#define RCVHQ_RCV_TYPE_ERROR 3 + +/* misc. */ +#define SIZE_OF_CRC 1 + +#define EAGER_TID_ID INFINIPATH_I_TID_MASK + +#define IPS_DEFAULT_P_KEY 0xFFFF + +#define IPS_PERMISSIVE_LID 0xFFFF +#define IPS_MULTICAST_LID_BASE 0xC000 + +#define IPS_AETH_CREDIT_SHIFT 24 +#define IPS_AETH_CREDIT_MASK 0x1F +#define IPS_AETH_CREDIT_INVAL 0x1F + +#define IPS_PSN_MASK 0xFFFFFF +#define IPS_MSN_MASK 0xFFFFFF +#define IPS_QPN_MASK 0xFFFFFF +#define IPS_MULTICAST_QPN 0xFFFFFF + +/* functions for extracting fields from rcvhdrq entries */ +static inline __u32 ips_get_hdr_err_flags(const __le32 * rbuf) +{ + return __le32_to_cpu(rbuf[1]); +} + +static inline __u32 ips_get_index(const __le32 * rbuf) +{ + return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_EGRINDEX_SHIFT) + & INFINIPATH_RHF_EGRINDEX_MASK; +} + +static inline __u32 ips_get_rcv_type(const __le32 * rbuf) +{ + return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_RCVTYPE_SHIFT) + & INFINIPATH_RHF_RCVTYPE_MASK; +} + +static inline __u32 ips_get_length_in_bytes(const __le32 * rbuf) +{ + return ((__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_LENGTH_SHIFT) + & INFINIPATH_RHF_LENGTH_MASK) << 2; +} + +static inline void *ips_get_first_protocol_header(const __u32 * rbuf) +{ + return (void *)&rbuf[2]; +} + +static inline struct ips_message_header *ips_get_ips_header(const __u32 * + rbuf) +{ + return (struct ips_message_header *)&rbuf[2]; +} + +static inline __u32 ips_get_ipath_ver(__le32 hdrword) +{ + return (__le32_to_cpu(hdrword) >> INFINIPATH_I_VERS_SHIFT) + & INFINIPATH_I_VERS_MASK; +} + +#endif /* IPS_COMMON_H */ diff --git a/trunk/drivers/infiniband/hw/ipath/verbs_debug.h b/trunk/drivers/infiniband/hw/ipath/verbs_debug.h index 6186676f2a16..40d693cf3f94 100644 --- a/trunk/drivers/infiniband/hw/ipath/verbs_debug.h +++ b/trunk/drivers/infiniband/hw/ipath/verbs_debug.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2006 QLogic, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_eq.c b/trunk/drivers/infiniband/hw/mthca/mthca_eq.c index a29b1b6d82b1..d536217e700e 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_eq.c +++ b/trunk/drivers/infiniband/hw/mthca/mthca_eq.c @@ -900,7 +900,7 @@ int __devinit mthca_init_eq_table(struct mthca_dev *dev) mthca_is_memfree(dev) ? mthca_arbel_interrupt : mthca_tavor_interrupt, - IRQF_SHARED, DRV_NAME, dev); + SA_SHIRQ, DRV_NAME, dev); if (err) goto err_out_cmd; dev->eq_table.have_irq = 1; diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_main.c b/trunk/drivers/infiniband/hw/mthca/mthca_main.c index 557cde3a4563..465fd220569c 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_main.c +++ b/trunk/drivers/infiniband/hw/mthca/mthca_main.c @@ -34,6 +34,7 @@ * $Id: mthca_main.c 1396 2004-12-28 04:10:27Z roland $ */ +#include #include #include #include diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_qp.c b/trunk/drivers/infiniband/hw/mthca/mthca_qp.c index 490fc783bb0c..16c387d8170c 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/trunk/drivers/infiniband/hw/mthca/mthca_qp.c @@ -224,7 +224,7 @@ static void *get_send_wqe(struct mthca_qp *qp, int n) static void mthca_wq_init(struct mthca_wq *wq) { - /* mthca_alloc_qp_common() initializes the locks */ + spin_lock_init(&wq->lock); wq->next_ind = 0; wq->last_comp = wq->max - 1; wq->head = 0; @@ -1114,9 +1114,6 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev, qp->sq_policy = send_policy; mthca_wq_init(&qp->sq); mthca_wq_init(&qp->rq); - /* these are initialized separately so lockdep can tell them apart */ - spin_lock_init(&qp->sq.lock); - spin_lock_init(&qp->rq.lock); ret = mthca_map_memfree(dev, qp); if (ret) diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_reset.c b/trunk/drivers/infiniband/hw/mthca/mthca_reset.c index 91934f2d9dba..f4fddd5327f5 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_reset.c +++ b/trunk/drivers/infiniband/hw/mthca/mthca_reset.c @@ -32,6 +32,7 @@ * $Id: mthca_reset.c 1349 2004-12-16 21:09:43Z roland $ */ +#include #include #include #include diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib.h b/trunk/drivers/infiniband/ulp/ipoib/ipoib.h index 3f89f5e19036..491d2afaf5b4 100644 --- a/trunk/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib.h @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/infiniband/ulp/iser/iscsi_iser.c b/trunk/drivers/infiniband/ulp/iser/iscsi_iser.c index 34b0da5cfa0a..4c3f2de2a06e 100644 --- a/trunk/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/trunk/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -437,50 +438,159 @@ iscsi_iser_session_create(struct iscsi_transport *iscsit, } static int -iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn, - enum iscsi_param param, char *buf, int buflen) +iscsi_iser_conn_set_param(struct iscsi_cls_conn *cls_conn, + enum iscsi_param param, uint32_t value) { - int value; + struct iscsi_conn *conn = cls_conn->dd_data; + struct iscsi_session *session = conn->session; + + spin_lock_bh(&session->lock); + if (conn->c_stage != ISCSI_CONN_INITIAL_STAGE && + conn->stop_stage != STOP_CONN_RECOVER) { + printk(KERN_ERR "iscsi_iser: can not change parameter [%d]\n", + param); + spin_unlock_bh(&session->lock); + return 0; + } + spin_unlock_bh(&session->lock); switch (param) { case ISCSI_PARAM_MAX_RECV_DLENGTH: /* TBD */ break; + case ISCSI_PARAM_MAX_XMIT_DLENGTH: + conn->max_xmit_dlength = value; + break; case ISCSI_PARAM_HDRDGST_EN: - sscanf(buf, "%d", &value); if (value) { printk(KERN_ERR "DataDigest wasn't negotiated to None"); return -EPROTO; } break; case ISCSI_PARAM_DATADGST_EN: - sscanf(buf, "%d", &value); if (value) { printk(KERN_ERR "DataDigest wasn't negotiated to None"); return -EPROTO; } break; + case ISCSI_PARAM_INITIAL_R2T_EN: + session->initial_r2t_en = value; + break; + case ISCSI_PARAM_IMM_DATA_EN: + session->imm_data_en = value; + break; + case ISCSI_PARAM_FIRST_BURST: + session->first_burst = value; + break; + case ISCSI_PARAM_MAX_BURST: + session->max_burst = value; + break; + case ISCSI_PARAM_PDU_INORDER_EN: + session->pdu_inorder_en = value; + break; + case ISCSI_PARAM_DATASEQ_INORDER_EN: + session->dataseq_inorder_en = value; + break; + case ISCSI_PARAM_ERL: + session->erl = value; + break; case ISCSI_PARAM_IFMARKER_EN: - sscanf(buf, "%d", &value); if (value) { printk(KERN_ERR "IFMarker wasn't negotiated to No"); return -EPROTO; } break; case ISCSI_PARAM_OFMARKER_EN: - sscanf(buf, "%d", &value); if (value) { printk(KERN_ERR "OFMarker wasn't negotiated to No"); return -EPROTO; } break; default: - return iscsi_set_param(cls_conn, param, buf, buflen); + break; + } + + return 0; +} + +static int +iscsi_iser_session_get_param(struct iscsi_cls_session *cls_session, + enum iscsi_param param, uint32_t *value) +{ + struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); + struct iscsi_session *session = iscsi_hostdata(shost->hostdata); + + switch (param) { + case ISCSI_PARAM_INITIAL_R2T_EN: + *value = session->initial_r2t_en; + break; + case ISCSI_PARAM_MAX_R2T: + *value = session->max_r2t; + break; + case ISCSI_PARAM_IMM_DATA_EN: + *value = session->imm_data_en; + break; + case ISCSI_PARAM_FIRST_BURST: + *value = session->first_burst; + break; + case ISCSI_PARAM_MAX_BURST: + *value = session->max_burst; + break; + case ISCSI_PARAM_PDU_INORDER_EN: + *value = session->pdu_inorder_en; + break; + case ISCSI_PARAM_DATASEQ_INORDER_EN: + *value = session->dataseq_inorder_en; + break; + case ISCSI_PARAM_ERL: + *value = session->erl; + break; + case ISCSI_PARAM_IFMARKER_EN: + *value = 0; + break; + case ISCSI_PARAM_OFMARKER_EN: + *value = 0; + break; + default: + return ISCSI_ERR_PARAM_NOT_FOUND; + } + + return 0; +} + +static int +iscsi_iser_conn_get_param(struct iscsi_cls_conn *cls_conn, + enum iscsi_param param, uint32_t *value) +{ + struct iscsi_conn *conn = cls_conn->dd_data; + + switch(param) { + case ISCSI_PARAM_MAX_RECV_DLENGTH: + *value = conn->max_recv_dlength; + break; + case ISCSI_PARAM_MAX_XMIT_DLENGTH: + *value = conn->max_xmit_dlength; + break; + case ISCSI_PARAM_HDRDGST_EN: + *value = 0; + break; + case ISCSI_PARAM_DATADGST_EN: + *value = 0; + break; + /*case ISCSI_PARAM_TARGET_RECV_DLENGTH: + *value = conn->target_recv_dlength; + break; + case ISCSI_PARAM_INITIATOR_RECV_DLENGTH: + *value = conn->initiator_recv_dlength; + break;*/ + default: + return ISCSI_ERR_PARAM_NOT_FOUND; } return 0; } + static void iscsi_iser_conn_get_stats(struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats) { @@ -592,12 +702,7 @@ static struct iscsi_transport iscsi_iser_transport = { ISCSI_FIRST_BURST | ISCSI_MAX_BURST | ISCSI_PDU_INORDER_EN | - ISCSI_DATASEQ_INORDER_EN | - ISCSI_EXP_STATSN | - ISCSI_PERSISTENT_PORT | - ISCSI_PERSISTENT_ADDRESS | - ISCSI_TARGET_NAME | - ISCSI_TPGT, + ISCSI_DATASEQ_INORDER_EN, .host_template = &iscsi_iser_sht, .conndata_size = sizeof(struct iscsi_conn), .max_lun = ISCSI_ISER_MAX_LUN, @@ -609,9 +714,9 @@ static struct iscsi_transport iscsi_iser_transport = { .create_conn = iscsi_iser_conn_create, .bind_conn = iscsi_iser_conn_bind, .destroy_conn = iscsi_iser_conn_destroy, - .set_param = iscsi_iser_set_param, - .get_conn_param = iscsi_conn_get_param, - .get_session_param = iscsi_session_get_param, + .set_param = iscsi_iser_conn_set_param, + .get_conn_param = iscsi_iser_conn_get_param, + .get_session_param = iscsi_iser_session_get_param, .start_conn = iscsi_iser_conn_start, .stop_conn = iscsi_conn_stop, /* these are called as part of conn recovery */ diff --git a/trunk/drivers/input/gameport/emu10k1-gp.c b/trunk/drivers/input/gameport/emu10k1-gp.c index 9793ac36d17f..462f8d300aae 100644 --- a/trunk/drivers/input/gameport/emu10k1-gp.c +++ b/trunk/drivers/input/gameport/emu10k1-gp.c @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/input/gameport/ns558.c b/trunk/drivers/input/gameport/ns558.c index f68dbe6f7f04..3e2d28f263e9 100644 --- a/trunk/drivers/input/gameport/ns558.c +++ b/trunk/drivers/input/gameport/ns558.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/input/joystick/analog.c b/trunk/drivers/input/joystick/analog.c index e9a02db36ecc..01dc0b195d59 100644 --- a/trunk/drivers/input/joystick/analog.c +++ b/trunk/drivers/input/joystick/analog.c @@ -28,6 +28,7 @@ * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#include #include #include #include diff --git a/trunk/drivers/input/joystick/iforce/iforce.h b/trunk/drivers/input/joystick/iforce/iforce.h index e9924d6f01b3..668f24535ba0 100644 --- a/trunk/drivers/input/joystick/iforce/iforce.h +++ b/trunk/drivers/input/joystick/iforce/iforce.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/trunk/drivers/input/keyboard/corgikbd.c b/trunk/drivers/input/keyboard/corgikbd.c index 1e03153b9bca..1f0e720267d7 100644 --- a/trunk/drivers/input/keyboard/corgikbd.c +++ b/trunk/drivers/input/keyboard/corgikbd.c @@ -352,7 +352,7 @@ static int __init corgikbd_probe(struct platform_device *pdev) for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) { pxa_gpio_mode(CORGI_GPIO_KEY_SENSE(i) | GPIO_IN); if (request_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd_interrupt, - IRQF_DISABLED | IRQF_TRIGGER_RISING, + SA_INTERRUPT | SA_TRIGGER_RISING, "corgikbd", corgikbd)) printk(KERN_WARNING "corgikbd: Can't get IRQ: %d!\n", i); } diff --git a/trunk/drivers/input/keyboard/hilkbd.c b/trunk/drivers/input/keyboard/hilkbd.c index d22c7c624296..33edd030aa75 100644 --- a/trunk/drivers/input/keyboard/hilkbd.c +++ b/trunk/drivers/input/keyboard/hilkbd.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/input/keyboard/locomokbd.c b/trunk/drivers/input/keyboard/locomokbd.c index 83906f80ba21..2c510881874a 100644 --- a/trunk/drivers/input/keyboard/locomokbd.c +++ b/trunk/drivers/input/keyboard/locomokbd.c @@ -25,6 +25,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/input/keyboard/spitzkbd.c b/trunk/drivers/input/keyboard/spitzkbd.c index e385710233f4..c5d03fb77bcb 100644 --- a/trunk/drivers/input/keyboard/spitzkbd.c +++ b/trunk/drivers/input/keyboard/spitzkbd.c @@ -410,7 +410,7 @@ static int __init spitzkbd_probe(struct platform_device *dev) for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) { pxa_gpio_mode(spitz_senses[i] | GPIO_IN); if (request_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd_interrupt, - IRQF_DISABLED|IRQF_TRIGGER_RISING, + SA_INTERRUPT|SA_TRIGGER_RISING, "Spitzkbd Sense", spitzkbd)) printk(KERN_WARNING "spitzkbd: Can't get Sense IRQ: %d!\n", i); } @@ -425,19 +425,19 @@ static int __init spitzkbd_probe(struct platform_device *dev) pxa_gpio_mode(SPITZ_GPIO_SWB | GPIO_IN); request_irq(SPITZ_IRQ_GPIO_SYNC, spitzkbd_interrupt, - IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, "Spitzkbd Sync", spitzkbd); request_irq(SPITZ_IRQ_GPIO_ON_KEY, spitzkbd_interrupt, - IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, "Spitzkbd PwrOn", spitzkbd); request_irq(SPITZ_IRQ_GPIO_SWA, spitzkbd_hinge_isr, - IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, "Spitzkbd SWA", spitzkbd); request_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd_hinge_isr, - IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, "Spitzkbd SWB", spitzkbd); request_irq(SPITZ_IRQ_GPIO_AK_INT, spitzkbd_hinge_isr, - IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, "Spitzkbd HP", spitzkbd); printk(KERN_INFO "input: Spitz Keyboard Registered\n"); diff --git a/trunk/drivers/input/misc/ixp4xx-beeper.c b/trunk/drivers/input/misc/ixp4xx-beeper.c index 805b636e73d9..3a6ae85cd69c 100644 --- a/trunk/drivers/input/misc/ixp4xx-beeper.c +++ b/trunk/drivers/input/misc/ixp4xx-beeper.c @@ -113,7 +113,7 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev) input_dev->event = ixp4xx_spkr_event; err = request_irq(IRQ_IXP4XX_TIMER2, &ixp4xx_spkr_interrupt, - IRQF_DISABLED | IRQF_TIMER, "ixp4xx-beeper", (void *) dev->id); + SA_INTERRUPT | SA_TIMER, "ixp4xx-beeper", (void *) dev->id); if (err) goto err_free_device; diff --git a/trunk/drivers/input/misc/sparcspkr.c b/trunk/drivers/input/misc/sparcspkr.c index 106c94f33b93..42c11fbf3c79 100644 --- a/trunk/drivers/input/misc/sparcspkr.c +++ b/trunk/drivers/input/misc/sparcspkr.c @@ -4,6 +4,7 @@ * Copyright (c) 2002 Vojtech Pavlik * Copyright (c) 2002, 2006 David S. Miller (davem@davemloft.net) */ +#include #include #include #include diff --git a/trunk/drivers/input/mouse/inport.c b/trunk/drivers/input/mouse/inport.c index 50f1fed10be4..afc66f56df43 100644 --- a/trunk/drivers/input/mouse/inport.c +++ b/trunk/drivers/input/mouse/inport.c @@ -36,6 +36,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/input/mouse/rpcmouse.c b/trunk/drivers/input/mouse/rpcmouse.c index 872b30bf7aad..09b6ffdb7582 100644 --- a/trunk/drivers/input/mouse/rpcmouse.c +++ b/trunk/drivers/input/mouse/rpcmouse.c @@ -85,7 +85,7 @@ static int __init rpcmouse_init(void) rpcmouse_lastx = (short) iomd_readl(IOMD_MOUSEX); rpcmouse_lasty = (short) iomd_readl(IOMD_MOUSEY); - if (request_irq(IRQ_VSYNCPULSE, rpcmouse_irq, IRQF_SHARED, "rpcmouse", rpcmouse_dev)) { + if (request_irq(IRQ_VSYNCPULSE, rpcmouse_irq, SA_SHIRQ, "rpcmouse", rpcmouse_dev)) { printk(KERN_ERR "rpcmouse: unable to allocate VSYNC interrupt\n"); input_free_device(rpcmouse_dev); return -EBUSY; diff --git a/trunk/drivers/input/mouse/sermouse.c b/trunk/drivers/input/mouse/sermouse.c index 0023501a5b63..a89742431717 100644 --- a/trunk/drivers/input/mouse/sermouse.c +++ b/trunk/drivers/input/mouse/sermouse.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/trunk/drivers/input/mouse/vsxxxaa.c b/trunk/drivers/input/mouse/vsxxxaa.c index 47edcfd022ba..7b85bc21ae4a 100644 --- a/trunk/drivers/input/mouse/vsxxxaa.c +++ b/trunk/drivers/input/mouse/vsxxxaa.c @@ -81,6 +81,7 @@ #include #include #include +#include #include #include diff --git a/trunk/drivers/input/mousedev.c b/trunk/drivers/input/mousedev.c index 1f851acab30d..eb721b11ff37 100644 --- a/trunk/drivers/input/mousedev.c +++ b/trunk/drivers/input/mousedev.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/input/power.c b/trunk/drivers/input/power.c index 51a519e24b6d..526e6070600c 100644 --- a/trunk/drivers/input/power.c +++ b/trunk/drivers/input/power.c @@ -28,6 +28,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/input/serio/ct82c710.c b/trunk/drivers/input/serio/ct82c710.c index bc6e87add093..1ac739ef2ffa 100644 --- a/trunk/drivers/input/serio/ct82c710.c +++ b/trunk/drivers/input/serio/ct82c710.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/input/serio/gscps2.c b/trunk/drivers/input/serio/gscps2.c index cde036a92168..c0b1e4becad3 100644 --- a/trunk/drivers/input/serio/gscps2.c +++ b/trunk/drivers/input/serio/gscps2.c @@ -22,6 +22,7 @@ * was usable/enabled ?) */ +#include #include #include #include @@ -370,7 +371,7 @@ static int __init gscps2_probe(struct parisc_device *dev) serio->dev.parent = &dev->dev; ret = -EBUSY; - if (request_irq(dev->irq, gscps2_interrupt, IRQF_SHARED, ps2port->port->name, ps2port)) + if (request_irq(dev->irq, gscps2_interrupt, SA_SHIRQ, ps2port->port->name, ps2port)) goto fail_miserably; if (ps2port->id != GSC_ID_KEYBOARD && ps2port->id != GSC_ID_MOUSE) { diff --git a/trunk/drivers/input/serio/i8042-sparcio.h b/trunk/drivers/input/serio/i8042-sparcio.h index 54adba2d8ed5..9cad197a4e68 100644 --- a/trunk/drivers/input/serio/i8042-sparcio.h +++ b/trunk/drivers/input/serio/i8042-sparcio.h @@ -1,6 +1,7 @@ #ifndef _I8042_SPARCIO_H #define _I8042_SPARCIO_H +#include #include #include #include @@ -88,7 +89,7 @@ static struct of_device_id sparc_i8042_match[] = { }, {}, }; -MODULE_DEVICE_TABLE(of, sparc_i8042_match); +MODULE_DEVICE_TABLE(of, i8042_match); static struct of_platform_driver sparc_i8042_driver = { .name = "i8042", diff --git a/trunk/drivers/input/serio/i8042.c b/trunk/drivers/input/serio/i8042.c index 06a3f25657dd..a7d91d5356a5 100644 --- a/trunk/drivers/input/serio/i8042.c +++ b/trunk/drivers/input/serio/i8042.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -328,7 +329,7 @@ static int i8042_open(struct serio *serio) return 0; if (request_irq(port->irq, i8042_interrupt, - IRQF_SHARED, "i8042", i8042_request_irq_cookie)) { + SA_SHIRQ, "i8042", i8042_request_irq_cookie)) { printk(KERN_ERR "i8042.c: Can't get irq %d for %s, unregistering the port.\n", port->irq, port->name); goto irq_fail; } @@ -610,7 +611,7 @@ static int __devinit i8042_check_aux(void) */ if (request_irq(i8042_ports[I8042_AUX_PORT_NO].irq, i8042_interrupt, - IRQF_SHARED, "i8042", &i8042_check_aux_cookie)) + SA_SHIRQ, "i8042", &i8042_check_aux_cookie)) return -1; free_irq(i8042_ports[I8042_AUX_PORT_NO].irq, &i8042_check_aux_cookie); diff --git a/trunk/drivers/input/serio/i8042.h b/trunk/drivers/input/serio/i8042.h index af526ab9ec04..cbbf3842da5b 100644 --- a/trunk/drivers/input/serio/i8042.h +++ b/trunk/drivers/input/serio/i8042.h @@ -1,6 +1,7 @@ #ifndef _I8042_H #define _I8042_H +#include /* * Copyright (c) 1999-2002 Vojtech Pavlik diff --git a/trunk/drivers/input/serio/libps2.c b/trunk/drivers/input/serio/libps2.c index 61a6f977846f..79c97f94bcbd 100644 --- a/trunk/drivers/input/serio/libps2.c +++ b/trunk/drivers/input/serio/libps2.c @@ -177,7 +177,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command) return -1; } - mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING); + mutex_lock(&ps2dev->cmd_mutex); serio_pause_rx(ps2dev->serio); ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0; diff --git a/trunk/drivers/input/serio/pcips2.c b/trunk/drivers/input/serio/pcips2.c index fb727c665253..1e139c5e59de 100644 --- a/trunk/drivers/input/serio/pcips2.c +++ b/trunk/drivers/input/serio/pcips2.c @@ -107,7 +107,7 @@ static int pcips2_open(struct serio *io) outb(PS2_CTRL_ENABLE, ps2if->base); pcips2_flush_input(ps2if); - ret = request_irq(ps2if->dev->irq, pcips2_interrupt, IRQF_SHARED, + ret = request_irq(ps2if->dev->irq, pcips2_interrupt, SA_SHIRQ, "pcips2", ps2if); if (ret == 0) val = PS2_CTRL_ENABLE | PS2_CTRL_RXIRQ; diff --git a/trunk/drivers/input/touchscreen/ads7846.c b/trunk/drivers/input/touchscreen/ads7846.c index 66e411badf70..386023c594d7 100644 --- a/trunk/drivers/input/touchscreen/ads7846.c +++ b/trunk/drivers/input/touchscreen/ads7846.c @@ -773,7 +773,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) ts->last_msg = m; - if (request_irq(spi->irq, ads7846_irq, IRQF_TRIGGER_FALLING, + if (request_irq(spi->irq, ads7846_irq, SA_TRIGGER_FALLING, spi->dev.driver->name, ts)) { dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); err = -EBUSY; diff --git a/trunk/drivers/input/touchscreen/corgi_ts.c b/trunk/drivers/input/touchscreen/corgi_ts.c index 9b66271d3ba8..5013703db0e6 100644 --- a/trunk/drivers/input/touchscreen/corgi_ts.c +++ b/trunk/drivers/input/touchscreen/corgi_ts.c @@ -17,7 +17,7 @@ #include #include #include -#include +//#include #include #include @@ -318,7 +318,7 @@ static int __init corgits_probe(struct platform_device *pdev) corgi_ssp_ads7846_putget((5u << ADSCTRL_ADR_SH) | ADSCTRL_STS); mdelay(5); - if (request_irq(corgi_ts->irq_gpio, ts_interrupt, IRQF_DISABLED, "ts", corgi_ts)) { + if (request_irq(corgi_ts->irq_gpio, ts_interrupt, SA_INTERRUPT, "ts", corgi_ts)) { err = -EBUSY; goto fail; } diff --git a/trunk/drivers/input/touchscreen/h3600_ts_input.c b/trunk/drivers/input/touchscreen/h3600_ts_input.c index e2b910018773..2de2139f2fed 100644 --- a/trunk/drivers/input/touchscreen/h3600_ts_input.c +++ b/trunk/drivers/input/touchscreen/h3600_ts_input.c @@ -399,14 +399,14 @@ static int h3600ts_connect(struct serio *serio, struct serio_driver *drv) set_GPIO_IRQ_edge(GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE); if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler, - IRQF_SHARED | IRQF_DISABLED, "h3600_action", &ts->dev)) { + SA_SHIRQ | SA_INTERRUPT, "h3600_action", &ts->dev)) { printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n"); err = -EBUSY; goto fail2; } if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler, - IRQF_SHARED | IRQF_DISABLED, "h3600_suspend", &ts->dev)) { + SA_SHIRQ | SA_INTERRUPT, "h3600_suspend", &ts->dev)) { printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n"); err = -EBUSY; goto fail3; diff --git a/trunk/drivers/input/touchscreen/hp680_ts_input.c b/trunk/drivers/input/touchscreen/hp680_ts_input.c index fa97e0f79e7e..957dd5a1b15e 100644 --- a/trunk/drivers/input/touchscreen/hp680_ts_input.c +++ b/trunk/drivers/input/touchscreen/hp680_ts_input.c @@ -109,7 +109,7 @@ static int __init hp680_ts_init(void) input_register_device(hp680_ts_dev); if (request_irq(HP680_TS_IRQ, hp680_ts_interrupt, - IRQF_DISABLED, MODNAME, 0) < 0) { + SA_INTERRUPT, MODNAME, 0) < 0) { printk(KERN_ERR "hp680_touchscreen.c: Can't allocate irq %d\n", HP680_TS_IRQ); input_unregister_device(hp680_ts_dev); diff --git a/trunk/drivers/input/tsdev.c b/trunk/drivers/input/tsdev.c index 00e3929c6288..5f9ecad2ca75 100644 --- a/trunk/drivers/input/tsdev.c +++ b/trunk/drivers/input/tsdev.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/isdn/capi/capi.c b/trunk/drivers/isdn/capi/capi.c index 669f76393b5a..a518ec531021 100644 --- a/trunk/drivers/isdn/capi/capi.c +++ b/trunk/drivers/isdn/capi/capi.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/isdn/capi/capiutil.c b/trunk/drivers/isdn/capi/capiutil.c index c1b21552fc03..e7cf6bc286a6 100644 --- a/trunk/drivers/isdn/capi/capiutil.c +++ b/trunk/drivers/isdn/capi/capiutil.c @@ -17,6 +17,7 @@ #include #include #include +#include #include /* from CAPI2.0 DDK AVM Berlin GmbH */ diff --git a/trunk/drivers/isdn/divert/divert_procfs.c b/trunk/drivers/isdn/divert/divert_procfs.c index 399b316111f7..1b37d86d5ee1 100644 --- a/trunk/drivers/isdn/divert/divert_procfs.c +++ b/trunk/drivers/isdn/divert/divert_procfs.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/isdn/gigaset/gigaset.h b/trunk/drivers/isdn/gigaset/gigaset.h index 884bd72c1bf4..1ca3bfdef51d 100644 --- a/trunk/drivers/isdn/gigaset/gigaset.h +++ b/trunk/drivers/isdn/gigaset/gigaset.h @@ -16,6 +16,7 @@ #ifndef GIGASET_H #define GIGASET_H +#include #include #include #include diff --git a/trunk/drivers/isdn/hardware/avm/b1dma.c b/trunk/drivers/isdn/hardware/avm/b1dma.c index a4beeb46c859..4d64e5cbcdbf 100644 --- a/trunk/drivers/isdn/hardware/avm/b1dma.c +++ b/trunk/drivers/isdn/hardware/avm/b1dma.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/isdn/hardware/avm/b1pci.c b/trunk/drivers/isdn/hardware/avm/b1pci.c index 90e2e6643d19..5435a6cfb5e7 100644 --- a/trunk/drivers/isdn/hardware/avm/b1pci.c +++ b/trunk/drivers/isdn/hardware/avm/b1pci.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include @@ -97,7 +98,7 @@ static int b1pci_probe(struct capicardparams *p, struct pci_dev *pdev) b1_reset(card->port); b1_getrevision(card); - retval = request_irq(card->irq, b1_interrupt, IRQF_SHARED, card->name, card); + retval = request_irq(card->irq, b1_interrupt, SA_SHIRQ, card->name, card); if (retval) { printk(KERN_ERR "b1pci: unable to get IRQ %d.\n", card->irq); retval = -EBUSY; @@ -234,7 +235,7 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev) b1dma_reset(card); b1_getrevision(card); - retval = request_irq(card->irq, b1dma_interrupt, IRQF_SHARED, card->name, card); + retval = request_irq(card->irq, b1dma_interrupt, SA_SHIRQ, card->name, card); if (retval) { printk(KERN_ERR "b1pci: unable to get IRQ %d.\n", card->irq); diff --git a/trunk/drivers/isdn/hardware/avm/b1pcmcia.c b/trunk/drivers/isdn/hardware/avm/b1pcmcia.c index e479c0aef38d..ad5025155b4e 100644 --- a/trunk/drivers/isdn/hardware/avm/b1pcmcia.c +++ b/trunk/drivers/isdn/hardware/avm/b1pcmcia.c @@ -82,7 +82,7 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq, card->irq = irq; card->cardtype = cardtype; - retval = request_irq(card->irq, b1_interrupt, IRQF_SHARED, card->name, card); + retval = request_irq(card->irq, b1_interrupt, SA_SHIRQ, card->name, card); if (retval) { printk(KERN_ERR "b1pcmcia: unable to get IRQ %d.\n", card->irq); diff --git a/trunk/drivers/isdn/hardware/avm/c4.c b/trunk/drivers/isdn/hardware/avm/c4.c index 6c3d5f5f1f4b..f7253b2136ea 100644 --- a/trunk/drivers/isdn/hardware/avm/c4.c +++ b/trunk/drivers/isdn/hardware/avm/c4.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include @@ -1172,7 +1173,7 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev, } c4_reset(card); - retval = request_irq(card->irq, c4_interrupt, IRQF_SHARED, card->name, card); + retval = request_irq(card->irq, c4_interrupt, SA_SHIRQ, card->name, card); if (retval) { printk(KERN_ERR "c4: unable to get IRQ %d.\n",card->irq); retval = -EBUSY; diff --git a/trunk/drivers/isdn/hardware/avm/t1pci.c b/trunk/drivers/isdn/hardware/avm/t1pci.c index d1e253c94db4..2ceec8e8419f 100644 --- a/trunk/drivers/isdn/hardware/avm/t1pci.c +++ b/trunk/drivers/isdn/hardware/avm/t1pci.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include @@ -103,7 +104,7 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev) } b1dma_reset(card); - retval = request_irq(card->irq, b1dma_interrupt, IRQF_SHARED, card->name, card); + retval = request_irq(card->irq, b1dma_interrupt, SA_SHIRQ, card->name, card); if (retval) { printk(KERN_ERR "t1pci: unable to get IRQ %d.\n", card->irq); retval = -EBUSY; diff --git a/trunk/drivers/isdn/hardware/eicon/capimain.c b/trunk/drivers/isdn/hardware/eicon/capimain.c index 7a74ed35b1bf..8fe4f3f09353 100644 --- a/trunk/drivers/isdn/hardware/eicon/capimain.c +++ b/trunk/drivers/isdn/hardware/eicon/capimain.c @@ -10,6 +10,7 @@ * of the GNU General Public License, incorporated herein by reference. */ +#include #include #include #include diff --git a/trunk/drivers/isdn/hardware/eicon/diva_didd.c b/trunk/drivers/isdn/hardware/eicon/diva_didd.c index 14298b8c835f..27204f4b111a 100644 --- a/trunk/drivers/isdn/hardware/eicon/diva_didd.c +++ b/trunk/drivers/isdn/hardware/eicon/diva_didd.c @@ -11,6 +11,7 @@ * of the GNU General Public License, incorporated herein by reference. */ +#include #include #include #include diff --git a/trunk/drivers/isdn/hardware/eicon/divamnt.c b/trunk/drivers/isdn/hardware/eicon/divamnt.c index 77155d9f399b..b163c5909182 100644 --- a/trunk/drivers/isdn/hardware/eicon/divamnt.c +++ b/trunk/drivers/isdn/hardware/eicon/divamnt.c @@ -10,6 +10,7 @@ * of the GNU General Public License, incorporated herein by reference. */ +#include #include #include #include diff --git a/trunk/drivers/isdn/hardware/eicon/divasi.c b/trunk/drivers/isdn/hardware/eicon/divasi.c index fff0d89c806b..6e7d89a31c1d 100644 --- a/trunk/drivers/isdn/hardware/eicon/divasi.c +++ b/trunk/drivers/isdn/hardware/eicon/divasi.c @@ -10,6 +10,7 @@ * of the GNU General Public License, incorporated herein by reference. */ +#include #include #include #include diff --git a/trunk/drivers/isdn/hardware/eicon/divasmain.c b/trunk/drivers/isdn/hardware/eicon/divasmain.c index b7dadba13e82..9dee6a39104c 100644 --- a/trunk/drivers/isdn/hardware/eicon/divasmain.c +++ b/trunk/drivers/isdn/hardware/eicon/divasmain.c @@ -9,6 +9,7 @@ * of the GNU General Public License, incorporated herein by reference. */ +#include #include #include #include @@ -486,7 +487,7 @@ void __inline__ outpp(void __iomem *addr, word p) int diva_os_register_irq(void *context, byte irq, const char *name) { int result = request_irq(irq, diva_os_irq_wrapper, - IRQF_DISABLED | IRQF_SHARED, name, context); + SA_INTERRUPT | SA_SHIRQ, name, context); return (result); } diff --git a/trunk/drivers/isdn/hardware/eicon/divasproc.c b/trunk/drivers/isdn/hardware/eicon/divasproc.c index 6a4373a4f1e8..c12efa6f8429 100644 --- a/trunk/drivers/isdn/hardware/eicon/divasproc.c +++ b/trunk/drivers/isdn/hardware/eicon/divasproc.c @@ -10,6 +10,7 @@ * of the GNU General Public License, incorporated herein by reference. */ +#include #include #include #include diff --git a/trunk/drivers/isdn/hardware/eicon/platform.h b/trunk/drivers/isdn/hardware/eicon/platform.h index a66836cf756c..12b8ff29e976 100644 --- a/trunk/drivers/isdn/hardware/eicon/platform.h +++ b/trunk/drivers/isdn/hardware/eicon/platform.h @@ -18,6 +18,7 @@ #define DIVA_BUILD "local" #endif +#include #include #include #include diff --git a/trunk/drivers/isdn/hisax/avm_a1p.c b/trunk/drivers/isdn/hisax/avm_a1p.c index 574e252dfa43..d643bb32ad09 100644 --- a/trunk/drivers/isdn/hisax/avm_a1p.c +++ b/trunk/drivers/isdn/hisax/avm_a1p.c @@ -255,7 +255,7 @@ setup_avm_a1_pcmcia(struct IsdnCard *card) cs->BC_Write_Reg = &WriteHSCX; cs->BC_Send_Data = &hscx_fill_fifo; cs->cardmsg = &AVM_card_msg; - cs->irq_flags = IRQF_SHARED; + cs->irq_flags = SA_SHIRQ; cs->irq_func = &avm_a1p_interrupt; ISACVersion(cs, "AVM A1 PCMCIA:"); diff --git a/trunk/drivers/isdn/hisax/avm_pci.c b/trunk/drivers/isdn/hisax/avm_pci.c index 04f5917bf5a1..4abe5ff10e72 100644 --- a/trunk/drivers/isdn/hisax/avm_pci.c +++ b/trunk/drivers/isdn/hisax/avm_pci.c @@ -12,6 +12,7 @@ * */ +#include #include #include "hisax.h" #include "isac.h" @@ -808,7 +809,7 @@ setup_avm_pcipnp(struct IsdnCard *card) printk(KERN_WARNING "FritzPCI: No PCI card found\n"); return(0); } - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; #else printk(KERN_WARNING "FritzPCI: NO_PCI_BIOS\n"); return (0); diff --git a/trunk/drivers/isdn/hisax/bkm_a4t.c b/trunk/drivers/isdn/hisax/bkm_a4t.c index 3cf1f2421789..dcb308aeb50c 100644 --- a/trunk/drivers/isdn/hisax/bkm_a4t.c +++ b/trunk/drivers/isdn/hisax/bkm_a4t.c @@ -11,6 +11,7 @@ */ +#include #include #include "hisax.h" #include "isac.h" @@ -335,7 +336,7 @@ setup_bkm_a4t(struct IsdnCard *card) cs->BC_Send_Data = &jade_fill_fifo; cs->cardmsg = &BKM_card_msg; cs->irq_func = &bkm_interrupt; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; ISACVersion(cs, "Telekom A4T:"); /* Jade version */ JadeVersion(cs, "Telekom A4T:"); diff --git a/trunk/drivers/isdn/hisax/bkm_a8.c b/trunk/drivers/isdn/hisax/bkm_a8.c index 15681f3e73b8..5f21b82c8c8d 100644 --- a/trunk/drivers/isdn/hisax/bkm_a8.c +++ b/trunk/drivers/isdn/hisax/bkm_a8.c @@ -11,6 +11,7 @@ */ +#include #include #include "hisax.h" #include "isac.h" @@ -374,7 +375,7 @@ setup_sct_quadro(struct IsdnCard *card) pci_ioaddr5 &= PCI_BASE_ADDRESS_IO_MASK; /* Take over */ cs->irq = pci_irq; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; /* pci_ioaddr1 is unique to all subdevices */ /* pci_ioaddr2 is for the fourth subdevice only */ /* pci_ioaddr3 is for the third subdevice only */ diff --git a/trunk/drivers/isdn/hisax/config.c b/trunk/drivers/isdn/hisax/config.c index 5333be5d2c47..27332506f9f7 100644 --- a/trunk/drivers/isdn/hisax/config.c +++ b/trunk/drivers/isdn/hisax/config.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "hisax.h" #include diff --git a/trunk/drivers/isdn/hisax/diva.c b/trunk/drivers/isdn/hisax/diva.c index 323a02ef3844..b0ff1cc97d7c 100644 --- a/trunk/drivers/isdn/hisax/diva.c +++ b/trunk/drivers/isdn/hisax/diva.c @@ -16,6 +16,7 @@ */ #include +#include #include "hisax.h" #include "isac.h" #include "hscx.h" @@ -1076,7 +1077,7 @@ setup_diva(struct IsdnCard *card) printk(KERN_WARNING "Diva: No IO-Adr for PCI card found\n"); return(0); } - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; #else printk(KERN_WARNING "Diva: cfgreg 0 and NO_PCI_BIOS\n"); printk(KERN_WARNING "Diva: unable to config DIVA PCI\n"); diff --git a/trunk/drivers/isdn/hisax/elsa.c b/trunk/drivers/isdn/hisax/elsa.c index 3b3e318f6076..f8ca4b323331 100644 --- a/trunk/drivers/isdn/hisax/elsa.c +++ b/trunk/drivers/isdn/hisax/elsa.c @@ -19,6 +19,7 @@ */ #include +#include #include "hisax.h" #include "arcofi.h" #include "isac.h" @@ -85,8 +86,8 @@ static const char *ITACVer[] = *** ***/ /* Config-Register (Read) */ -#define ELIRQF_TIMER_RUN 0x02 /* Bit 1 des Config-Reg */ -#define ELIRQF_TIMER_RUN_PCC8 0x01 /* Bit 0 des Config-Reg bei PCC */ +#define ELSA_TIMER_RUN 0x02 /* Bit 1 des Config-Reg */ +#define ELSA_TIMER_RUN_PCC8 0x01 /* Bit 0 des Config-Reg bei PCC */ #define ELSA_IRQ_IDX 0x38 /* Bit 3,4,5 des Config-Reg */ #define ELSA_IRQ_IDX_PCC8 0x30 /* Bit 4,5 des Config-Reg */ #define ELSA_IRQ_IDX_PC 0x0c /* Bit 2,3 des Config-Reg */ @@ -102,7 +103,7 @@ static const char *ITACVer[] = #define ELSA_S0_POWER_BAD 0x08 /* Bit 3 S0-Bus Spannung fehlt */ /* Status Flags */ -#define ELIRQF_TIMER_AKTIV 1 +#define ELSA_TIMER_AKTIV 1 #define ELSA_BAD_PWR 2 #define ELSA_ASSIGN 4 @@ -259,10 +260,10 @@ TimerRun(struct IsdnCardState *cs) v = bytein(cs->hw.elsa.cfg); if ((cs->subtyp == ELSA_QS1000) || (cs->subtyp == ELSA_QS3000)) - return (0 == (v & ELIRQF_TIMER_RUN)); + return (0 == (v & ELSA_TIMER_RUN)); else if (cs->subtyp == ELSA_PCC8) - return (v & ELIRQF_TIMER_RUN_PCC8); - return (v & ELIRQF_TIMER_RUN); + return (v & ELSA_TIMER_RUN_PCC8); + return (v & ELSA_TIMER_RUN); } /* * fast interrupt HSCX stuff goes here @@ -334,7 +335,7 @@ elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs) writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0xFF); writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK + 0x40, 0xFF); writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_MASK, 0xFF); - if (cs->hw.elsa.status & ELIRQF_TIMER_AKTIV) { + if (cs->hw.elsa.status & ELSA_TIMER_AKTIV) { if (!TimerRun(cs)) { /* Timer Restart */ byteout(cs->hw.elsa.timer, 0); @@ -685,7 +686,7 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) spin_lock_irqsave(&cs->lock, flags); cs->hw.elsa.counter = 0; cs->hw.elsa.ctrl_reg |= ELSA_ENA_TIMER_INT; - cs->hw.elsa.status |= ELIRQF_TIMER_AKTIV; + cs->hw.elsa.status |= ELSA_TIMER_AKTIV; byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); byteout(cs->hw.elsa.timer, 0); spin_unlock_irqrestore(&cs->lock, flags); @@ -693,7 +694,7 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) spin_lock_irqsave(&cs->lock, flags); cs->hw.elsa.ctrl_reg &= ~ELSA_ENA_TIMER_INT; byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); - cs->hw.elsa.status &= ~ELIRQF_TIMER_AKTIV; + cs->hw.elsa.status &= ~ELSA_TIMER_AKTIV; spin_unlock_irqrestore(&cs->lock, flags); printk(KERN_INFO "Elsa: %d timer tics in 110 msek\n", cs->hw.elsa.counter); @@ -1012,7 +1013,7 @@ setup_elsa(struct IsdnCard *card) cs->hw.elsa.timer = 0; cs->hw.elsa.trig = 0; cs->hw.elsa.ctrl = 0; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; printk(KERN_INFO "Elsa: %s defined at %#lx IRQ %d\n", Elsa_Types[cs->subtyp], @@ -1061,7 +1062,7 @@ setup_elsa(struct IsdnCard *card) test_and_set_bit(HW_IPAC, &cs->HW_Flags); cs->hw.elsa.timer = 0; cs->hw.elsa.trig = 0; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; printk(KERN_INFO "Elsa: %s defined at %#lx/0x%x IRQ %d\n", Elsa_Types[cs->subtyp], diff --git a/trunk/drivers/isdn/hisax/elsa_ser.c b/trunk/drivers/isdn/hisax/elsa_ser.c index 0279fb323cb1..898ec0916195 100644 --- a/trunk/drivers/isdn/hisax/elsa_ser.c +++ b/trunk/drivers/isdn/hisax/elsa_ser.c @@ -7,6 +7,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/isdn/hisax/enternow_pci.c b/trunk/drivers/isdn/hisax/enternow_pci.c index 8fcbe2e7d765..3341cf155531 100644 --- a/trunk/drivers/isdn/hisax/enternow_pci.c +++ b/trunk/drivers/isdn/hisax/enternow_pci.c @@ -60,6 +60,7 @@ */ +#include #include "hisax.h" #include "isac.h" #include "isdnl1.h" @@ -405,7 +406,7 @@ setup_enternow_pci(struct IsdnCard *card) cs->BC_Send_Data = &netjet_fill_dma; cs->cardmsg = &enpci_card_msg; cs->irq_func = &enpci_interrupt; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; return (1); } diff --git a/trunk/drivers/isdn/hisax/gazel.c b/trunk/drivers/isdn/hisax/gazel.c index 3e7d92303582..60b04c6d9e7d 100644 --- a/trunk/drivers/isdn/hisax/gazel.c +++ b/trunk/drivers/isdn/hisax/gazel.c @@ -11,6 +11,7 @@ * */ +#include #include #include "hisax.h" #include "isac.h" @@ -592,7 +593,7 @@ setup_gazelpci(struct IsdnCardState *cs) cs->hw.gazel.hscxfifo[0] = cs->hw.gazel.hscx[0]; cs->hw.gazel.hscxfifo[1] = cs->hw.gazel.hscx[1]; cs->irq = pci_irq; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; switch (seekcard) { case PCI_DEVICE_ID_PLX_R685: diff --git a/trunk/drivers/isdn/hisax/hfc4s8s_l1.c b/trunk/drivers/isdn/hisax/hfc4s8s_l1.c index 0f967b3df79d..e3866b0a97fd 100644 --- a/trunk/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/trunk/drivers/isdn/hisax/hfc4s8s_l1.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -1552,7 +1553,7 @@ setup_instance(hfc4s8s_hw * hw) INIT_WORK(&hw->tqueue, (void *) (void *) hfc4s8s_bh, hw); if (request_irq - (hw->irq, hfc4s8s_interrupt, IRQF_SHARED, hw->card_name, hw)) { + (hw->irq, hfc4s8s_interrupt, SA_SHIRQ, hw->card_name, hw)) { printk(KERN_INFO "HFC-4S/8S: unable to alloc irq %d, card ignored\n", hw->irq); diff --git a/trunk/drivers/isdn/hisax/hfc_pci.c b/trunk/drivers/isdn/hisax/hfc_pci.c index 7241e73879ba..3622720f0505 100644 --- a/trunk/drivers/isdn/hisax/hfc_pci.c +++ b/trunk/drivers/isdn/hisax/hfc_pci.c @@ -16,6 +16,7 @@ */ #include +#include #include "hisax.h" #include "hfc_pci.h" #include "isdnl1.h" @@ -1732,7 +1733,7 @@ setup_hfcpci(struct IsdnCard *card) cs->BC_Read_Reg = NULL; cs->BC_Write_Reg = NULL; cs->irq_func = &hfcpci_interrupt; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; cs->hw.hfcpci.timer.function = (void *) hfcpci_Timer; cs->hw.hfcpci.timer.data = (long) cs; init_timer(&cs->hw.hfcpci.timer); diff --git a/trunk/drivers/isdn/hisax/hfc_usb.c b/trunk/drivers/isdn/hisax/hfc_usb.c index b5e571a52694..262c44127419 100644 --- a/trunk/drivers/isdn/hisax/hfc_usb.c +++ b/trunk/drivers/isdn/hisax/hfc_usb.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/isdn/hisax/hisax.h b/trunk/drivers/isdn/hisax/hisax.h index 75920aa0a3c5..11fe537e2f6f 100644 --- a/trunk/drivers/isdn/hisax/hisax.h +++ b/trunk/drivers/isdn/hisax/hisax.h @@ -6,6 +6,7 @@ * of the GNU General Public License, incorporated herein by reference. * */ +#include #include #include #include diff --git a/trunk/drivers/isdn/hisax/hisax_debug.h b/trunk/drivers/isdn/hisax/hisax_debug.h index ceafecdb1037..ba518a7a7fb7 100644 --- a/trunk/drivers/isdn/hisax/hisax_debug.h +++ b/trunk/drivers/isdn/hisax/hisax_debug.h @@ -22,6 +22,7 @@ #ifndef __HISAX_DEBUG_H__ #define __HISAX_DEBUG_H__ +#include #ifdef CONFIG_HISAX_DEBUG diff --git a/trunk/drivers/isdn/hisax/hisax_fcpcipnp.c b/trunk/drivers/isdn/hisax/hisax_fcpcipnp.c index 1d7cf3bd6aa3..dbcca287ee2c 100644 --- a/trunk/drivers/isdn/hisax/hisax_fcpcipnp.c +++ b/trunk/drivers/isdn/hisax/hisax_fcpcipnp.c @@ -725,11 +725,11 @@ static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter) switch (adapter->type) { case AVM_FRITZ_PCIV2: - retval = request_irq(adapter->irq, fcpci2_irq, IRQF_SHARED, + retval = request_irq(adapter->irq, fcpci2_irq, SA_SHIRQ, "fcpcipnp", adapter); break; case AVM_FRITZ_PCI: - retval = request_irq(adapter->irq, fcpci_irq, IRQF_SHARED, + retval = request_irq(adapter->irq, fcpci_irq, SA_SHIRQ, "fcpcipnp", adapter); break; case AVM_FRITZ_PNP: diff --git a/trunk/drivers/isdn/hisax/ipacx.c b/trunk/drivers/isdn/hisax/ipacx.c index df5fc92a89b2..2e9afae1254a 100644 --- a/trunk/drivers/isdn/hisax/ipacx.c +++ b/trunk/drivers/isdn/hisax/ipacx.c @@ -10,6 +10,7 @@ * */ #include +#include #include #include "hisax_if.h" #include "hisax.h" diff --git a/trunk/drivers/isdn/hisax/isdnl3.c b/trunk/drivers/isdn/hisax/isdnl3.c index 281fa27d9f00..c9917cd2132b 100644 --- a/trunk/drivers/isdn/hisax/isdnl3.c +++ b/trunk/drivers/isdn/hisax/isdnl3.c @@ -18,6 +18,7 @@ #include #include "hisax.h" #include "isdnl3.h" +#include const char *l3_revision = "$Revision: 2.22.2.3 $"; diff --git a/trunk/drivers/isdn/hisax/l3dss1.c b/trunk/drivers/isdn/hisax/l3dss1.c index 99feae8b9210..e96845cdd4f6 100644 --- a/trunk/drivers/isdn/hisax/l3dss1.c +++ b/trunk/drivers/isdn/hisax/l3dss1.c @@ -23,6 +23,7 @@ #include "isdnl3.h" #include "l3dss1.h" #include +#include extern char *HiSax_getrev(const char *revision); static const char *dss1_revision = "$Revision: 2.32.2.3 $"; diff --git a/trunk/drivers/isdn/hisax/niccy.c b/trunk/drivers/isdn/hisax/niccy.c index 79a97b1c3812..68a2159cbd11 100644 --- a/trunk/drivers/isdn/hisax/niccy.c +++ b/trunk/drivers/isdn/hisax/niccy.c @@ -14,6 +14,7 @@ */ +#include #include #include "hisax.h" #include "isac.h" @@ -336,7 +337,7 @@ setup_niccy(struct IsdnCard *card) printk(KERN_WARNING "Niccy: No PCI card found\n"); return(0); } - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; cs->hw.niccy.isac = pci_ioaddr + ISAC_PCI_DATA; cs->hw.niccy.isac_ale = pci_ioaddr + ISAC_PCI_ADDR; cs->hw.niccy.hscx = pci_ioaddr + HSCX_PCI_DATA; diff --git a/trunk/drivers/isdn/hisax/nj_s.c b/trunk/drivers/isdn/hisax/nj_s.c index e5b900a6fa0b..a7d3cd3f36fd 100644 --- a/trunk/drivers/isdn/hisax/nj_s.c +++ b/trunk/drivers/isdn/hisax/nj_s.c @@ -5,6 +5,7 @@ * */ +#include #include #include "hisax.h" #include "isac.h" @@ -271,7 +272,7 @@ setup_netjet_s(struct IsdnCard *card) setup_isac(cs); cs->cardmsg = &NETjet_S_card_msg; cs->irq_func = &netjet_s_interrupt; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; ISACVersion(cs, "NETjet-S:"); return (1); } diff --git a/trunk/drivers/isdn/hisax/nj_u.c b/trunk/drivers/isdn/hisax/nj_u.c index 7002b09936d4..1ae7cac98a87 100644 --- a/trunk/drivers/isdn/hisax/nj_u.c +++ b/trunk/drivers/isdn/hisax/nj_u.c @@ -5,6 +5,7 @@ * */ +#include #include #include "hisax.h" #include "icc.h" @@ -237,7 +238,7 @@ setup_netjet_u(struct IsdnCard *card) cs->BC_Send_Data = &netjet_fill_dma; cs->cardmsg = &NETjet_U_card_msg; cs->irq_func = &netjet_u_interrupt; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; ICCVersion(cs, "NETspider-U:"); return (1); } diff --git a/trunk/drivers/isdn/hisax/sedlbauer.c b/trunk/drivers/isdn/hisax/sedlbauer.c index 8d8e8a299892..8c044a6a7fe3 100644 --- a/trunk/drivers/isdn/hisax/sedlbauer.c +++ b/trunk/drivers/isdn/hisax/sedlbauer.c @@ -39,6 +39,7 @@ */ #include +#include #include "hisax.h" #include "isac.h" #include "ipac.h" @@ -632,7 +633,7 @@ setup_sedlbauer(struct IsdnCard *card) printk(KERN_WARNING "Sedlbauer: No PCI card found\n"); return(0); } - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; cs->hw.sedl.bus = SEDL_BUS_PCI; sub_vendor_id = dev_sedl->subsystem_vendor; sub_id = dev_sedl->subsystem_device; @@ -809,7 +810,7 @@ setup_sedlbauer(struct IsdnCard *card) cs->hw.sedl.hscx = cs->hw.sedl.cfg_reg + SEDL_HSCX_PCMCIA_HSCX; cs->hw.sedl.reset_on = cs->hw.sedl.cfg_reg + SEDL_HSCX_PCMCIA_RESET; cs->hw.sedl.reset_off = cs->hw.sedl.cfg_reg + SEDL_HSCX_PCMCIA_RESET; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; } else { cs->hw.sedl.adr = cs->hw.sedl.cfg_reg + SEDL_HSCX_ISA_ADR; cs->hw.sedl.isac = cs->hw.sedl.cfg_reg + SEDL_HSCX_ISA_ISAC; diff --git a/trunk/drivers/isdn/hisax/st5481.h b/trunk/drivers/isdn/hisax/st5481.h index 04416bad611d..9ffaae7c657a 100644 --- a/trunk/drivers/isdn/hisax/st5481.h +++ b/trunk/drivers/isdn/hisax/st5481.h @@ -13,6 +13,7 @@ #ifndef _ST5481_H_ #define _ST5481_H_ +#include // USB IDs, the Product Id is in the range 0x4810-0x481F diff --git a/trunk/drivers/isdn/hisax/st5481_init.c b/trunk/drivers/isdn/hisax/st5481_init.c index 2716aa5c60f7..99cb0f3d59a1 100644 --- a/trunk/drivers/isdn/hisax/st5481_init.c +++ b/trunk/drivers/isdn/hisax/st5481_init.c @@ -24,6 +24,7 @@ * clean up debug */ +#include #include #include #include diff --git a/trunk/drivers/isdn/hisax/teles3.c b/trunk/drivers/isdn/hisax/teles3.c index 5cb712437da4..090abd16b4bc 100644 --- a/trunk/drivers/isdn/hisax/teles3.c +++ b/trunk/drivers/isdn/hisax/teles3.c @@ -369,7 +369,7 @@ setup_teles3(struct IsdnCard *card) cs->hw.teles3.hscx[1] + 96); return (0); } - cs->irq_flags |= IRQF_SHARED; /* cardbus can share */ + cs->irq_flags |= SA_SHIRQ; /* cardbus can share */ } else { if (cs->hw.teles3.cfg_reg) { if (cs->typ == ISDN_CTYPE_COMPAQ_ISA) { diff --git a/trunk/drivers/isdn/hisax/telespci.c b/trunk/drivers/isdn/hisax/telespci.c index 9382cdf04d8d..e82ab2251b82 100644 --- a/trunk/drivers/isdn/hisax/telespci.c +++ b/trunk/drivers/isdn/hisax/telespci.c @@ -13,6 +13,7 @@ */ #include +#include #include "hisax.h" #include "isac.h" #include "hscx.h" @@ -347,7 +348,7 @@ setup_telespci(struct IsdnCard *card) cs->BC_Send_Data = &hscx_fill_fifo; cs->cardmsg = &TelesPCI_card_msg; cs->irq_func = &telespci_interrupt; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; ISACVersion(cs, "TelesPCI:"); if (HscxVersion(cs, "TelesPCI:")) { printk(KERN_WARNING diff --git a/trunk/drivers/isdn/hisax/w6692.c b/trunk/drivers/isdn/hisax/w6692.c index 6c68419c05ff..0352ee5f706c 100644 --- a/trunk/drivers/isdn/hisax/w6692.c +++ b/trunk/drivers/isdn/hisax/w6692.c @@ -10,6 +10,7 @@ * */ +#include #include #include "hisax.h" #include "w6692.h" @@ -1080,7 +1081,7 @@ setup_w6692(struct IsdnCard *card) cs->BC_Send_Data = &W6692B_fill_fifo; cs->cardmsg = &w6692_card_msg; cs->irq_func = &W6692_interrupt; - cs->irq_flags |= IRQF_SHARED; + cs->irq_flags |= SA_SHIRQ; W6692Version(cs, "W6692:"); printk(KERN_INFO "W6692 ISTA=0x%X\n", ReadW6692(cs, W_ISTA)); printk(KERN_INFO "W6692 IMASK=0x%X\n", ReadW6692(cs, W_IMASK)); diff --git a/trunk/drivers/isdn/hysdn/boardergo.c b/trunk/drivers/isdn/hysdn/boardergo.c index 73afebdf80bd..48d134be9908 100644 --- a/trunk/drivers/isdn/hysdn/boardergo.c +++ b/trunk/drivers/isdn/hysdn/boardergo.c @@ -14,6 +14,7 @@ * */ +#include #include #include #include @@ -435,7 +436,7 @@ ergo_inithardware(hysdn_card * card) } ergo_stopcard(card); /* disable interrupts */ - if (request_irq(card->irq, ergo_interrupt, IRQF_SHARED, "HYSDN", card)) { + if (request_irq(card->irq, ergo_interrupt, SA_SHIRQ, "HYSDN", card)) { ergo_releasehardware(card); /* return the acquired hardware */ return (-1); } diff --git a/trunk/drivers/isdn/hysdn/hysdn_defs.h b/trunk/drivers/isdn/hysdn/hysdn_defs.h index 461e831592dd..3a9b29b38bc4 100644 --- a/trunk/drivers/isdn/hysdn/hysdn_defs.h +++ b/trunk/drivers/isdn/hysdn/hysdn_defs.h @@ -14,6 +14,7 @@ #ifndef HYSDN_DEFS_H #define HYSDN_DEFS_H +#include #include #include #include diff --git a/trunk/drivers/isdn/hysdn/hysdn_init.c b/trunk/drivers/isdn/hysdn/hysdn_init.c index b702ed27252b..b75ac5af236a 100644 --- a/trunk/drivers/isdn/hysdn/hysdn_init.c +++ b/trunk/drivers/isdn/hysdn/hysdn_init.c @@ -10,6 +10,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/isdn/hysdn/hysdn_sched.c b/trunk/drivers/isdn/hysdn/hysdn_sched.c index 1c0d54ac12ab..133032920ff8 100644 --- a/trunk/drivers/isdn/hysdn/hysdn_sched.c +++ b/trunk/drivers/isdn/hysdn/hysdn_sched.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/isdn/i4l/isdn_common.c b/trunk/drivers/isdn/i4l/isdn_common.c index 9f6c6375ff75..eb21063e6f63 100644 --- a/trunk/drivers/isdn/i4l/isdn_common.c +++ b/trunk/drivers/isdn/i4l/isdn_common.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/isdn/i4l/isdn_net.c b/trunk/drivers/isdn/i4l/isdn_net.c index 43da8ae1b2ad..96c115e13389 100644 --- a/trunk/drivers/isdn/i4l/isdn_net.c +++ b/trunk/drivers/isdn/i4l/isdn_net.c @@ -22,6 +22,7 @@ * http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt */ +#include #include #include #include diff --git a/trunk/drivers/isdn/i4l/isdn_ppp.c b/trunk/drivers/isdn/i4l/isdn_ppp.c index 29e7667ec962..918742271c79 100644 --- a/trunk/drivers/isdn/i4l/isdn_ppp.c +++ b/trunk/drivers/isdn/i4l/isdn_ppp.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/isdn/i4l/isdn_tty.c b/trunk/drivers/isdn/i4l/isdn_tty.c index 9ab66e8960d5..0a53a990c100 100644 --- a/trunk/drivers/isdn/i4l/isdn_tty.c +++ b/trunk/drivers/isdn/i4l/isdn_tty.c @@ -11,6 +11,7 @@ */ #undef ISDN_TTY_STAT_DEBUG +#include #include #include #include "isdn_common.h" diff --git a/trunk/drivers/isdn/i4l/isdn_tty.h b/trunk/drivers/isdn/i4l/isdn_tty.h index 692c74d6b749..9f0fa9501f4d 100644 --- a/trunk/drivers/isdn/i4l/isdn_tty.h +++ b/trunk/drivers/isdn/i4l/isdn_tty.h @@ -10,6 +10,7 @@ * */ +#include #define DLE 0x10 #define ETX 0x03 diff --git a/trunk/drivers/isdn/isdnloop/isdnloop.c b/trunk/drivers/isdn/isdnloop/isdnloop.c index fabbd461603e..a67d31af797a 100644 --- a/trunk/drivers/isdn/isdnloop/isdnloop.c +++ b/trunk/drivers/isdn/isdnloop/isdnloop.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/isdn/sc/init.c b/trunk/drivers/isdn/sc/init.c index a627e68023f6..62b7acfad8a4 100644 --- a/trunk/drivers/isdn/sc/init.c +++ b/trunk/drivers/isdn/sc/init.c @@ -342,7 +342,7 @@ static int __init sc_init(void) */ sc_adapter[cinst]->interrupt = irq[b]; if (request_irq(sc_adapter[cinst]->interrupt, interrupt_handler, - IRQF_DISABLED, interface->id, NULL)) + SA_INTERRUPT, interface->id, NULL)) { kfree(sc_adapter[cinst]->channel); indicate_status(cinst, ISDN_STAT_UNLOAD, 0, NULL); /* Fix me */ diff --git a/trunk/drivers/leds/led-class.c b/trunk/drivers/leds/led-class.c index d424b4452028..c75d0ef1609c 100644 --- a/trunk/drivers/leds/led-class.c +++ b/trunk/drivers/leds/led-class.c @@ -9,6 +9,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/leds/led-triggers.c b/trunk/drivers/leds/led-triggers.c index 47f0ff196328..1b1ce6523960 100644 --- a/trunk/drivers/leds/led-triggers.c +++ b/trunk/drivers/leds/led-triggers.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/leds/leds-corgi.c b/trunk/drivers/leds/leds-corgi.c index cf1dcd719a28..bb7d84df0121 100644 --- a/trunk/drivers/leds/leds-corgi.c +++ b/trunk/drivers/leds/leds-corgi.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/leds/leds-ixp4xx-gpio.c b/trunk/drivers/leds/leds-ixp4xx-gpio.c index 7dcf0b92c460..30ced150e4cf 100644 --- a/trunk/drivers/leds/leds-ixp4xx-gpio.c +++ b/trunk/drivers/leds/leds-ixp4xx-gpio.c @@ -31,6 +31,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/leds/leds-locomo.c b/trunk/drivers/leds/leds-locomo.c index 3b87951aa555..8419e29b71f4 100644 --- a/trunk/drivers/leds/leds-locomo.c +++ b/trunk/drivers/leds/leds-locomo.c @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/leds/leds-s3c24xx.c b/trunk/drivers/leds/leds-s3c24xx.c index fb1edc1c9edb..650cf72dc675 100644 --- a/trunk/drivers/leds/leds-s3c24xx.c +++ b/trunk/drivers/leds/leds-s3c24xx.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/leds/leds-spitz.c b/trunk/drivers/leds/leds-spitz.c index 126d09cc96ec..65bbef4a5e09 100644 --- a/trunk/drivers/leds/leds-spitz.c +++ b/trunk/drivers/leds/leds-spitz.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/leds/leds-tosa.c b/trunk/drivers/leds/leds-tosa.c index fb2416a38303..c9e8cc1ec481 100644 --- a/trunk/drivers/leds/leds-tosa.c +++ b/trunk/drivers/leds/leds-tosa.c @@ -12,6 +12,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/leds/ledtrig-timer.c b/trunk/drivers/leds/ledtrig-timer.c index 179c2876b541..fbf141ef46ec 100644 --- a/trunk/drivers/leds/ledtrig-timer.c +++ b/trunk/drivers/leds/ledtrig-timer.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/macintosh/adb.c b/trunk/drivers/macintosh/adb.c index 360f93f6fcdb..9f1a049dc226 100644 --- a/trunk/drivers/macintosh/adb.c +++ b/trunk/drivers/macintosh/adb.c @@ -16,6 +16,7 @@ * - move bus probe to a kernel thread */ +#include #include #include #include diff --git a/trunk/drivers/macintosh/adbhid.c b/trunk/drivers/macintosh/adbhid.c index 545be1ed6927..cbfbbe2b150a 100644 --- a/trunk/drivers/macintosh/adbhid.c +++ b/trunk/drivers/macintosh/adbhid.c @@ -34,6 +34,7 @@ * Move to syfs */ +#include #include #include #include diff --git a/trunk/drivers/macintosh/apm_emu.c b/trunk/drivers/macintosh/apm_emu.c index 1293876a2ebd..e5a2bbf99399 100644 --- a/trunk/drivers/macintosh/apm_emu.c +++ b/trunk/drivers/macintosh/apm_emu.c @@ -18,6 +18,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/macintosh/mac_hid.c b/trunk/drivers/macintosh/mac_hid.c index 6b129eef7987..a66636116f0b 100644 --- a/trunk/drivers/macintosh/mac_hid.c +++ b/trunk/drivers/macintosh/mac_hid.c @@ -8,6 +8,7 @@ * This file will soon be removed in favor of an uinput userspace tool. */ +#include #include #include #include diff --git a/trunk/drivers/macintosh/macio-adb.c b/trunk/drivers/macintosh/macio-adb.c index 4b08852c35ee..314fc0830d90 100644 --- a/trunk/drivers/macintosh/macio-adb.c +++ b/trunk/drivers/macintosh/macio-adb.c @@ -90,12 +90,22 @@ int macio_init(void) { struct device_node *adbs; struct resource r; - unsigned int irq; adbs = find_compatible_devices("adb", "chrp,adb0"); if (adbs == 0) return -ENXIO; +#if 0 + { int i = 0; + + printk("macio_adb_init: node = %p, addrs =", adbs->node); + while(!of_address_to_resource(adbs, i, &r)) + printk(" %x(%x)", r.start, r.end - r.start); + printk(", intrs ="); + for (i = 0; i < adbs->n_intrs; ++i) + printk(" %x", adbs->intrs[i].line); + printk("\n"); } +#endif if (of_address_to_resource(adbs, 0, &r)) return -ENXIO; adb = ioremap(r.start, sizeof(struct adb_regs)); @@ -107,9 +117,10 @@ int macio_init(void) out_8(&adb->active_lo.r, 0xff); out_8(&adb->autopoll.r, APE); - irq = irq_of_parse_and_map(adbs, 0); - if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) { - printk(KERN_ERR "ADB: can't get irq %d\n", irq); + if (request_irq(adbs->intrs[0].line, macio_adb_interrupt, + 0, "ADB", (void *)0)) { + printk(KERN_ERR "ADB: can't get irq %d\n", + adbs->intrs[0].line); return -EAGAIN; } out_8(&adb->intr_enb.r, DFB | TAG); diff --git a/trunk/drivers/macintosh/macio_asic.c b/trunk/drivers/macintosh/macio_asic.c index 80c0c665b5f6..c687ac703941 100644 --- a/trunk/drivers/macintosh/macio_asic.c +++ b/trunk/drivers/macintosh/macio_asic.c @@ -17,6 +17,7 @@ * sub-devices. */ +#include #include #include #include @@ -280,128 +281,75 @@ static void macio_release_dev(struct device *dev) static int macio_resource_quirks(struct device_node *np, struct resource *res, int index) { - /* Only quirks for memory resources for now */ - if ((res->flags & IORESOURCE_MEM) == 0) - return 0; - - /* Grand Central has too large resource 0 on some machines */ - if (index == 0 && !strcmp(np->name, "gc")) - res->end = res->start + 0x1ffff; + if (res->flags & IORESOURCE_MEM) { + /* Grand Central has too large resource 0 on some machines */ + if (index == 0 && !strcmp(np->name, "gc")) + res->end = res->start + 0x1ffff; - /* Airport has bogus resource 2 */ - if (index >= 2 && !strcmp(np->name, "radio")) - return 1; + /* Airport has bogus resource 2 */ + if (index >= 2 && !strcmp(np->name, "radio")) + return 1; #ifndef CONFIG_PPC64 - /* DBDMAs may have bogus sizes */ - if ((res->start & 0x0001f000) == 0x00008000) - res->end = res->start + 0xff; + /* DBDMAs may have bogus sizes */ + if ((res->start & 0x0001f000) == 0x00008000) + res->end = res->start + 0xff; #endif /* CONFIG_PPC64 */ - /* ESCC parent eats child resources. We could have added a - * level of hierarchy, but I don't really feel the need - * for it - */ - if (!strcmp(np->name, "escc")) - return 1; - - /* ESCC has bogus resources >= 3 */ - if (index >= 3 && !(strcmp(np->name, "ch-a") && - strcmp(np->name, "ch-b"))) - return 1; - - /* Media bay has too many resources, keep only first one */ - if (index > 0 && !strcmp(np->name, "media-bay")) - return 1; - - /* Some older IDE resources have bogus sizes */ - if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") && - strcmp(np->type, "ide") && strcmp(np->type, "ata"))) { - if (index == 0 && (res->end - res->start) > 0xfff) - res->end = res->start + 0xfff; - if (index == 1 && (res->end - res->start) > 0xff) - res->end = res->start + 0xff; + /* ESCC parent eats child resources. We could have added a + * level of hierarchy, but I don't really feel the need + * for it + */ + if (!strcmp(np->name, "escc")) + return 1; + + /* ESCC has bogus resources >= 3 */ + if (index >= 3 && !(strcmp(np->name, "ch-a") && + strcmp(np->name, "ch-b"))) + return 1; + + /* Media bay has too many resources, keep only first one */ + if (index > 0 && !strcmp(np->name, "media-bay")) + return 1; + + /* Some older IDE resources have bogus sizes */ + if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") && + strcmp(np->type, "ide") && strcmp(np->type, "ata"))) { + if (index == 0 && (res->end - res->start) > 0xfff) + res->end = res->start + 0xfff; + if (index == 1 && (res->end - res->start) > 0xff) + res->end = res->start + 0xff; + } } return 0; } -static void macio_create_fixup_irq(struct macio_dev *dev, int index, - unsigned int line) -{ - unsigned int irq; - - irq = irq_create_mapping(NULL, line, 0); - if (irq != NO_IRQ) { - dev->interrupt[index].start = irq; - dev->interrupt[index].flags = IORESOURCE_IRQ; - dev->interrupt[index].name = dev->ofdev.dev.bus_id; - } - if (dev->n_interrupts <= index) - dev->n_interrupts = index + 1; -} - -static void macio_add_missing_resources(struct macio_dev *dev) -{ - struct device_node *np = dev->ofdev.node; - unsigned int irq_base; - - /* Gatwick has some missing interrupts on child nodes */ - if (dev->bus->chip->type != macio_gatwick) - return; - - /* irq_base is always 64 on gatwick. I have no cleaner way to get - * that value from here at this point - */ - irq_base = 64; - - /* Fix SCC */ - if (strcmp(np->name, "ch-a") == 0) { - macio_create_fixup_irq(dev, 0, 15 + irq_base); - macio_create_fixup_irq(dev, 1, 4 + irq_base); - macio_create_fixup_irq(dev, 2, 5 + irq_base); - printk(KERN_INFO "macio: fixed SCC irqs on gatwick\n"); - } - - /* Fix media-bay */ - if (strcmp(np->name, "media-bay") == 0) { - macio_create_fixup_irq(dev, 0, 29 + irq_base); - printk(KERN_INFO "macio: fixed media-bay irq on gatwick\n"); - } - - /* Fix left media bay childs */ - if (dev->media_bay != NULL && strcmp(np->name, "floppy") == 0) { - macio_create_fixup_irq(dev, 0, 19 + irq_base); - macio_create_fixup_irq(dev, 1, 1 + irq_base); - printk(KERN_INFO "macio: fixed left floppy irqs\n"); - } - if (dev->media_bay != NULL && strcasecmp(np->name, "ata4") == 0) { - macio_create_fixup_irq(dev, 0, 14 + irq_base); - macio_create_fixup_irq(dev, 0, 3 + irq_base); - printk(KERN_INFO "macio: fixed left ide irqs\n"); - } -} static void macio_setup_interrupts(struct macio_dev *dev) { struct device_node *np = dev->ofdev.node; - unsigned int irq; - int i = 0, j = 0; + int i,j; - for (;;) { + /* For now, we use pre-parsed entries in the device-tree for + * interrupt routing and addresses, but we should change that + * to dynamically parsed entries and so get rid of most of the + * clutter in struct device_node + */ + for (i = j = 0; i < np->n_intrs; i++) { struct resource *res = &dev->interrupt[j]; if (j >= MACIO_DEV_COUNT_IRQS) break; - irq = irq_of_parse_and_map(np, i++); - if (irq == NO_IRQ) - break; - res->start = irq; - res->flags = IORESOURCE_IRQ; + res->start = np->intrs[i].line; + res->flags = IORESOURCE_IO; + if (np->intrs[j].sense) + res->flags |= IORESOURCE_IRQ_LOWLEVEL; + else + res->flags |= IORESOURCE_IRQ_HIGHEDGE; res->name = dev->ofdev.dev.bus_id; - if (macio_resource_quirks(np, res, i - 1)) { + if (macio_resource_quirks(np, res, i)) memset(res, 0, sizeof(struct resource)); - continue; - } else + else j++; } dev->n_interrupts = j; @@ -480,10 +428,10 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, /* MacIO itself has a different reg, we use it's PCI base */ if (np == chip->of_node) { - sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", + sprintf(dev->ofdev.dev.bus_id, "%1d.%016llx:%.*s", chip->lbus.index, #ifdef CONFIG_PCI - (unsigned int)pci_resource_start(chip->lbus.pdev, 0), + (unsigned long long)pci_resource_start(chip->lbus.pdev, 0), #else 0, /* NuBus may want to do something better here */ #endif @@ -498,7 +446,6 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, /* Setup interrupts & resources */ macio_setup_interrupts(dev); macio_setup_resources(dev, parent_res); - macio_add_missing_resources(dev); /* Register with core */ if (of_device_register(&dev->ofdev) != 0) { diff --git a/trunk/drivers/macintosh/macio_sysfs.c b/trunk/drivers/macintosh/macio_sysfs.c index cae24a13526a..7f7d4eaca870 100644 --- a/trunk/drivers/macintosh/macio_sysfs.c +++ b/trunk/drivers/macintosh/macio_sysfs.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/drivers/macintosh/mediabay.c b/trunk/drivers/macintosh/mediabay.c index 0acf2f7fd9d7..53c1c7909413 100644 --- a/trunk/drivers/macintosh/mediabay.c +++ b/trunk/drivers/macintosh/mediabay.c @@ -10,6 +10,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/drivers/macintosh/smu.c b/trunk/drivers/macintosh/smu.c index f139a74696fe..f4516ca7aa3a 100644 --- a/trunk/drivers/macintosh/smu.c +++ b/trunk/drivers/macintosh/smu.c @@ -19,6 +19,7 @@ * the userland interface */ +#include #include #include #include @@ -497,7 +498,8 @@ int __init smu_init (void) smu->doorbell = *data; if (smu->doorbell < 0x50) smu->doorbell += 0x50; - smu->db_irq = irq_of_parse_and_map(np, 0); + if (np->n_intrs > 0) + smu->db_irq = np->intrs[0].line; of_node_put(np); @@ -514,7 +516,8 @@ int __init smu_init (void) smu->msg = *data; if (smu->msg < 0x50) smu->msg += 0x50; - smu->msg_irq = irq_of_parse_and_map(np, 0); + if (np->n_intrs > 0) + smu->msg_irq = np->intrs[0].line; of_node_put(np); } while(0); @@ -553,7 +556,7 @@ static int smu_late_init(void) if (smu->db_irq != NO_IRQ) { if (request_irq(smu->db_irq, smu_db_intr, - IRQF_SHARED, "SMU doorbell", smu) < 0) { + SA_SHIRQ, "SMU doorbell", smu) < 0) { printk(KERN_WARNING "SMU: can't " "request interrupt %d\n", smu->db_irq); @@ -563,7 +566,7 @@ static int smu_late_init(void) if (smu->msg_irq != NO_IRQ) { if (request_irq(smu->msg_irq, smu_msg_intr, - IRQF_SHARED, "SMU message", smu) < 0) { + SA_SHIRQ, "SMU message", smu) < 0) { printk(KERN_WARNING "SMU: can't " "request interrupt %d\n", smu->msg_irq); diff --git a/trunk/drivers/macintosh/therm_adt746x.c b/trunk/drivers/macintosh/therm_adt746x.c index 7f86478bdd36..5282fec17075 100644 --- a/trunk/drivers/macintosh/therm_adt746x.c +++ b/trunk/drivers/macintosh/therm_adt746x.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/macintosh/therm_pm72.c b/trunk/drivers/macintosh/therm_pm72.c index c1fe0b368f76..231146f439dd 100644 --- a/trunk/drivers/macintosh/therm_pm72.c +++ b/trunk/drivers/macintosh/therm_pm72.c @@ -97,6 +97,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/macintosh/therm_pm72.h b/trunk/drivers/macintosh/therm_pm72.h index fc7e9b7ecaf2..c17e61f9c418 100644 --- a/trunk/drivers/macintosh/therm_pm72.h +++ b/trunk/drivers/macintosh/therm_pm72.h @@ -93,7 +93,7 @@ static char * critical_overtemp_path = "/sbin/critical_overtemp"; * 0. This appear to be safe enough for this first version * of the driver, though I would accept any clean patch * doing a better use of the device-tree without turning the - * while i2c registration mechanism into a racy mess + * while i2c registration mecanism into a racy mess * * Note: Xserve changed this. We have some bits on the K2 bus, * which I arbitrarily set to 0x200. Ultimately, we really want diff --git a/trunk/drivers/macintosh/therm_windtunnel.c b/trunk/drivers/macintosh/therm_windtunnel.c index c7d1c290cb0c..3d9dd2e166aa 100644 --- a/trunk/drivers/macintosh/therm_windtunnel.c +++ b/trunk/drivers/macintosh/therm_windtunnel.c @@ -27,6 +27,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/macintosh/via-cuda.c b/trunk/drivers/macintosh/via-cuda.c index 69d5452fd22f..2d9d79150403 100644 --- a/trunk/drivers/macintosh/via-cuda.c +++ b/trunk/drivers/macintosh/via-cuda.c @@ -9,6 +9,7 @@ * Copyright (C) 1996 Paul Mackerras. */ #include +#include #include #include #include @@ -34,6 +35,13 @@ static volatile unsigned char __iomem *via; static DEFINE_SPINLOCK(cuda_lock); +#ifdef CONFIG_MAC +#define CUDA_IRQ IRQ_MAC_ADB +#define eieio() +#else +#define CUDA_IRQ vias->intrs[0].line +#endif + /* VIA registers - spaced 0x200 bytes apart */ #define RS 0x200 /* skip between registers */ #define B 0 /* B-side data */ @@ -182,24 +190,11 @@ int __init find_via_cuda(void) static int __init via_cuda_start(void) { - unsigned int irq; - if (via == NULL) return -ENODEV; -#ifdef CONFIG_MAC - irq = IRQ_MAC_ADB; -#else /* CONFIG_MAC */ - irq = irq_of_parse_and_map(vias, 0); - if (irq == NO_IRQ) { - printk(KERN_ERR "via-cuda: can't map interrupts for %s\n", - vias->full_name); - return -ENODEV; - } -#endif /* CONFIG_MAP */ - - if (request_irq(irq, cuda_interrupt, 0, "ADB", cuda_interrupt)) { - printk(KERN_ERR "via-cuda: can't request irq %d\n", irq); + if (request_irq(CUDA_IRQ, cuda_interrupt, 0, "ADB", cuda_interrupt)) { + printk(KERN_ERR "cuda_init: can't get irq %d\n", CUDA_IRQ); return -EAGAIN; } diff --git a/trunk/drivers/macintosh/via-pmu.c b/trunk/drivers/macintosh/via-pmu.c index 06ca80bfd6b9..1ab4f16c08b9 100644 --- a/trunk/drivers/macintosh/via-pmu.c +++ b/trunk/drivers/macintosh/via-pmu.c @@ -21,6 +21,7 @@ * */ #include +#include #include #include #include @@ -64,6 +65,10 @@ #include #endif +#ifdef CONFIG_PPC32 +#include +#endif + #include "via-pmu-event.h" /* Some compile options */ @@ -147,7 +152,7 @@ static int pmu_fully_inited = 0; static int pmu_has_adb; static struct device_node *gpio_node; static unsigned char __iomem *gpio_reg = NULL; -static int gpio_irq = NO_IRQ; +static int gpio_irq = -1; static int gpio_irq_enabled = -1; static volatile int pmu_suspended = 0; static spinlock_t pmu_lock; @@ -399,21 +404,22 @@ static int __init pmu_init(void) */ static int __init via_pmu_start(void) { - unsigned int irq; - if (vias == NULL) return -ENODEV; batt_req.complete = 1; - irq = irq_of_parse_and_map(vias, 0); - if (irq == NO_IRQ) { - printk(KERN_ERR "via-pmu: can't map interruptn"); - return -ENODEV; - } - if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) { - printk(KERN_ERR "via-pmu: can't request irq %d\n", irq); - return -ENODEV; +#ifndef CONFIG_PPC_MERGE + if (pmu_kind == PMU_KEYLARGO_BASED) + openpic_set_irq_priority(vias->intrs[0].line, + OPENPIC_PRIORITY_DEFAULT + 1); +#endif + + if (request_irq(vias->intrs[0].line, via_pmu_interrupt, 0, "VIA-PMU", + (void *)0)) { + printk(KERN_ERR "VIA-PMU: can't get irq %d\n", + vias->intrs[0].line); + return -EAGAIN; } if (pmu_kind == PMU_KEYLARGO_BASED) { @@ -421,10 +427,10 @@ static int __init via_pmu_start(void) if (gpio_node == NULL) gpio_node = of_find_node_by_name(NULL, "pmu-interrupt"); - if (gpio_node) - gpio_irq = irq_of_parse_and_map(gpio_node, 0); + if (gpio_node && gpio_node->n_intrs > 0) + gpio_irq = gpio_node->intrs[0].line; - if (gpio_irq != NO_IRQ) { + if (gpio_irq != -1) { if (request_irq(gpio_irq, gpio1_interrupt, 0, "GPIO1 ADB", (void *)0)) printk(KERN_ERR "pmu: can't get irq %d" diff --git a/trunk/drivers/macintosh/windfarm_cpufreq_clamp.c b/trunk/drivers/macintosh/windfarm_cpufreq_clamp.c index 900aade06198..81337cd16e80 100644 --- a/trunk/drivers/macintosh/windfarm_cpufreq_clamp.c +++ b/trunk/drivers/macintosh/windfarm_cpufreq_clamp.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/drivers/md/bitmap.c b/trunk/drivers/md/bitmap.c index ecc56765d949..ebbd2d856256 100644 --- a/trunk/drivers/md/bitmap.c +++ b/trunk/drivers/md/bitmap.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/md/dm-snap.c b/trunk/drivers/md/dm-snap.c index 1d0fafda0f76..8eea0ddbf5ec 100644 --- a/trunk/drivers/md/dm-snap.c +++ b/trunk/drivers/md/dm-snap.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/md/kcopyd.c b/trunk/drivers/md/kcopyd.c index f1db6eff4857..73ab875fb158 100644 --- a/trunk/drivers/md/kcopyd.c +++ b/trunk/drivers/md/kcopyd.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index e4e161372a3e..2ec1b3520a0b 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -33,6 +33,7 @@ */ #include +#include #include #include #include @@ -1404,7 +1405,7 @@ static int lock_rdev(mdk_rdev_t *rdev, dev_t dev) struct block_device *bdev; char b[BDEVNAME_SIZE]; - bdev = open_partition_by_devnum(dev, FMODE_READ|FMODE_WRITE); + bdev = open_by_devnum(dev, FMODE_READ|FMODE_WRITE); if (IS_ERR(bdev)) { printk(KERN_ERR "md: could not open %s.\n", __bdevname(dev, b)); @@ -1414,7 +1415,7 @@ static int lock_rdev(mdk_rdev_t *rdev, dev_t dev) if (err) { printk(KERN_ERR "md: could not bd_claim %s.\n", bdevname(bdev, b)); - blkdev_put_partition(bdev); + blkdev_put(bdev); return err; } rdev->bdev = bdev; @@ -1428,7 +1429,7 @@ static void unlock_rdev(mdk_rdev_t *rdev) if (!bdev) MD_BUG(); bd_release(bdev); - blkdev_put_partition(bdev); + blkdev_put(bdev); } void md_autodetect_dev(dev_t dev); diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c index 7433871f4b3a..837ec4eb3d60 100644 --- a/trunk/drivers/md/raid5.c +++ b/trunk/drivers/md/raid5.c @@ -19,6 +19,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/media/common/saa7146_core.c b/trunk/drivers/media/common/saa7146_core.c index b88451e33c09..8cdd4d265ffa 100644 --- a/trunk/drivers/media/common/saa7146_core.c +++ b/trunk/drivers/media/common/saa7146_core.c @@ -363,7 +363,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent saa7146_write(dev, MC2, 0xf8000000); /* request an interrupt for the saa7146 */ - err = request_irq(pci->irq, interrupt_hw, IRQF_SHARED | IRQF_DISABLED, + err = request_irq(pci->irq, interrupt_hw, SA_SHIRQ | SA_INTERRUPT, dev->name, dev); if (err < 0) { ERR(("request_irq() failed.\n")); diff --git a/trunk/drivers/media/common/saa7146_hlp.c b/trunk/drivers/media/common/saa7146_hlp.c index d2905720eb74..2092e6c33dd2 100644 --- a/trunk/drivers/media/common/saa7146_hlp.c +++ b/trunk/drivers/media/common/saa7146_hlp.c @@ -158,7 +158,7 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, } /* the horizontal scaling increment controls the UV filter - to reduce the bandwidth to improve the display quality, + to reduce the bandwith to improve the display quality, so set it ... */ if ( xsci == 0x400) pfuv = 0x00; diff --git a/trunk/drivers/media/dvb/b2c2/flexcop-common.h b/trunk/drivers/media/dvb/b2c2/flexcop-common.h index 5a6c4fe249e7..b3dd0603cd92 100644 --- a/trunk/drivers/media/dvb/b2c2/flexcop-common.h +++ b/trunk/drivers/media/dvb/b2c2/flexcop-common.h @@ -8,6 +8,7 @@ #ifndef __FLEXCOP_COMMON_H__ #define __FLEXCOP_COMMON_H__ +#include #include #include diff --git a/trunk/drivers/media/dvb/b2c2/flexcop-pci.c b/trunk/drivers/media/dvb/b2c2/flexcop-pci.c index eb2e6432c8c2..f04041702191 100644 --- a/trunk/drivers/media/dvb/b2c2/flexcop-pci.c +++ b/trunk/drivers/media/dvb/b2c2/flexcop-pci.c @@ -294,7 +294,7 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci) pci_set_drvdata(fc_pci->pdev, fc_pci); if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_isr, - IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0) + SA_SHIRQ, DRIVER_NAME, fc_pci)) != 0) goto err_pci_iounmap; spin_lock_init(&fc_pci->irq_lock); diff --git a/trunk/drivers/media/dvb/bt8xx/bt878.c b/trunk/drivers/media/dvb/bt8xx/bt878.c index 755822ee6e9b..761fa6e7d762 100644 --- a/trunk/drivers/media/dvb/bt8xx/bt878.c +++ b/trunk/drivers/media/dvb/bt8xx/bt878.c @@ -488,7 +488,7 @@ static int __devinit bt878_probe(struct pci_dev *dev, btwrite(0, BT848_INT_MASK); result = request_irq(bt->irq, bt878_irq, - IRQF_SHARED | IRQF_DISABLED, "bt878", + SA_SHIRQ | SA_INTERRUPT, "bt878", (void *) bt); if (result == -EINVAL) { printk(KERN_ERR "bt878(%d): Bad irq number or handler\n", diff --git a/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c b/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c index 001c71b6be61..1b8953600425 100644 --- a/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c @@ -22,6 +22,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c b/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c index 59ac35ddd51e..5e8bb41a088b 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -570,8 +570,7 @@ static int dvb_frontend_thread(void *data) dvb_frontend_add_event(fe, s); fepriv->status = s; } - } else - dvb_frontend_swzigzag(fe); + } } else dvb_frontend_swzigzag(fe); } @@ -976,7 +975,6 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, case FE_SET_FRONTEND_TUNE_MODE: fepriv->tune_mode_flags = (unsigned long) parg; - err = 0; break; }; diff --git a/trunk/drivers/media/dvb/dvb-usb/dvb-usb.h b/trunk/drivers/media/dvb/dvb-usb/dvb-usb.h index 97f8ea962438..4cf9f89c51bf 100644 --- a/trunk/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/trunk/drivers/media/dvb/dvb-usb/dvb-usb.h @@ -8,6 +8,7 @@ #ifndef __DVB_USB_H__ #define __DVB_USB_H__ +#include #include #include #include diff --git a/trunk/drivers/media/dvb/frontends/cx22700.c b/trunk/drivers/media/dvb/frontends/cx22700.c index 13ad1bfae663..3c7c09a362b2 100644 --- a/trunk/drivers/media/dvb/frontends/cx22700.c +++ b/trunk/drivers/media/dvb/frontends/cx22700.c @@ -134,7 +134,6 @@ static int cx22700_set_tps (struct cx22700_state *state, struct dvb_ofdm_paramet return -EINVAL; if (p->code_rate_LP < FEC_1_2 || p->code_rate_LP > FEC_7_8) - return -EINVAL; if (p->code_rate_HP == FEC_4_5 || p->code_rate_LP == FEC_4_5) return -EINVAL; diff --git a/trunk/drivers/media/dvb/frontends/cx24123.c b/trunk/drivers/media/dvb/frontends/cx24123.c index 274a87b7a5d5..f2f795cba56a 100644 --- a/trunk/drivers/media/dvb/frontends/cx24123.c +++ b/trunk/drivers/media/dvb/frontends/cx24123.c @@ -670,10 +670,10 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage switch (voltage) { case SEC_VOLTAGE_13: dprintk("%s: setting voltage 13V\n", __FUNCTION__); - return cx24123_writereg(state, 0x29, val & 0x7f); + return cx24123_writereg(state, 0x29, val | 0x80); case SEC_VOLTAGE_18: dprintk("%s: setting voltage 18V\n", __FUNCTION__); - return cx24123_writereg(state, 0x29, val | 0x80); + return cx24123_writereg(state, 0x29, val & 0x7f); default: return -EINVAL; }; diff --git a/trunk/drivers/media/dvb/frontends/dib3000mb.c b/trunk/drivers/media/dvb/frontends/dib3000mb.c index 5302e11883a2..7c6dc7e30900 100644 --- a/trunk/drivers/media/dvb/frontends/dib3000mb.c +++ b/trunk/drivers/media/dvb/frontends/dib3000mb.c @@ -21,6 +21,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/media/dvb/frontends/dib3000mc.c b/trunk/drivers/media/dvb/frontends/dib3000mc.c index 98673474a140..6c3be2529980 100644 --- a/trunk/drivers/media/dvb/frontends/dib3000mc.c +++ b/trunk/drivers/media/dvb/frontends/dib3000mc.c @@ -20,6 +20,7 @@ * see Documentation/dvb/README.dibusb for more information * */ +#include #include #include #include diff --git a/trunk/drivers/media/dvb/frontends/lgdt330x.c b/trunk/drivers/media/dvb/frontends/lgdt330x.c index 9a354708bd20..6e8ad176e1a1 100644 --- a/trunk/drivers/media/dvb/frontends/lgdt330x.c +++ b/trunk/drivers/media/dvb/frontends/lgdt330x.c @@ -216,7 +216,7 @@ static int lgdt330x_init(struct dvb_frontend* fe) AGC_DELAY0, 0x07, AGC_DELAY2, 0xfe, /* Change the value of IAGCBW[15:8] - of inner AGC loop filter bandwidth */ + of inner AGC loop filter bandwith */ AGC_LOOP_BANDWIDTH0, 0x08, AGC_LOOP_BANDWIDTH1, 0x9a }; diff --git a/trunk/drivers/media/dvb/frontends/tda10021.c b/trunk/drivers/media/dvb/frontends/tda10021.c index 9cbd164aa281..e83ff2104c9b 100644 --- a/trunk/drivers/media/dvb/frontends/tda10021.c +++ b/trunk/drivers/media/dvb/frontends/tda10021.c @@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/media/dvb/frontends/ves1820.c b/trunk/drivers/media/dvb/frontends/ves1820.c index 9b57576bfeb4..6bffe85c161c 100644 --- a/trunk/drivers/media/dvb/frontends/ves1820.c +++ b/trunk/drivers/media/dvb/frontends/ves1820.c @@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/media/dvb/pluto2/pluto2.c b/trunk/drivers/media/dvb/pluto2/pluto2.c index 2310b2bfed4e..acabea0793b6 100644 --- a/trunk/drivers/media/dvb/pluto2/pluto2.c +++ b/trunk/drivers/media/dvb/pluto2/pluto2.c @@ -616,7 +616,7 @@ static int __devinit pluto2_probe(struct pci_dev *pdev, pci_set_drvdata(pdev, pluto); - ret = request_irq(pdev->irq, pluto_irq, IRQF_SHARED, DRIVER_NAME, pluto); + ret = request_irq(pdev->irq, pluto_irq, SA_SHIRQ, DRIVER_NAME, pluto); if (ret < 0) goto err_pci_iounmap; diff --git a/trunk/drivers/media/dvb/ttpci/av7110.c b/trunk/drivers/media/dvb/ttpci/av7110.c index 500f15c10aaf..7a5c99c200e8 100644 --- a/trunk/drivers/media/dvb/ttpci/av7110.c +++ b/trunk/drivers/media/dvb/ttpci/av7110.c @@ -30,6 +30,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/media/dvb/ttpci/budget-av.c b/trunk/drivers/media/dvb/ttpci/budget-av.c index 5f111d407730..6163cb03b8f4 100644 --- a/trunk/drivers/media/dvb/ttpci/budget-av.c +++ b/trunk/drivers/media/dvb/ttpci/budget-av.c @@ -1141,15 +1141,6 @@ static void frontend_init(struct budget_av *budget_av) break; case SUBID_DVBC_KNC1: - budget_av->reinitialise_demod = 1; - fe = tda10021_attach(&philips_cu1216_config, - &budget_av->budget.i2c_adap, - read_pwm(budget_av)); - if (fe) { - fe->ops.tuner_ops.set_params = philips_cu1216_tuner_set_params; - } - break; - case SUBID_DVBC_KNC1_PLUS: case SUBID_DVBC_CINERGY1200: budget_av->reinitialise_demod = 1; @@ -1302,7 +1293,11 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio budget_av->budget.dvb_adapter.priv = budget_av; frontend_init(budget_av); - ciintf_init(budget_av); + + if (!budget_av->has_saa7113) { + ciintf_init(budget_av); + } + return 0; } diff --git a/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 04cef3023457..336b2fe1a5f2 100644 --- a/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c @@ -43,7 +43,7 @@ is a bit braindead (no matching channel masks or no matching filter mask), we won't support this - yet. it doesn't event support negative filters, so the best way is maybe to keep TTUSB_HWSECTIONS undef'd and just - parse TS data. USB bandwidth will be a problem when having large + parse TS data. USB bandwith will be a problem when having large datastreams, especially for dvb-net, but hey, that's not my problem. TTUSB_DISEQC, TTUSB_TONE: diff --git a/trunk/drivers/media/radio/radio-gemtek-pci.c b/trunk/drivers/media/radio/radio-gemtek-pci.c index 4c82956390c1..9f249e7e60c9 100644 --- a/trunk/drivers/media/radio/radio-gemtek-pci.c +++ b/trunk/drivers/media/radio/radio-gemtek-pci.c @@ -37,6 +37,7 @@ *************************************************************************** */ +#include #include #include #include diff --git a/trunk/drivers/media/video/arv.c b/trunk/drivers/media/video/arv.c index 5c5e682a3004..ae14f5f32039 100644 --- a/trunk/drivers/media/video/arv.c +++ b/trunk/drivers/media/video/arv.c @@ -18,6 +18,7 @@ * 2003-09-01: Support w3cam by Takeo Takahashi */ +#include #include #include #include diff --git a/trunk/drivers/media/video/bt8xx/bttv-cards.c b/trunk/drivers/media/video/bt8xx/bttv-cards.c index de14818d5cc4..e68a6d2fff24 100644 --- a/trunk/drivers/media/video/bt8xx/bttv-cards.c +++ b/trunk/drivers/media/video/bt8xx/bttv-cards.c @@ -25,6 +25,7 @@ */ +#include #include #include #include @@ -3547,6 +3548,11 @@ void __devinit bttv_init_card2(struct bttv *btv) /* Hybrid DVB card, DOES have a tda9887 */ if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE) tda9887 = 1; + if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) || + (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) || + (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) || + tda9887) + request_module("tda9887"); if (btv->tuner_type != UNSET) request_module("tuner"); } diff --git a/trunk/drivers/media/video/bt8xx/bttv-driver.c b/trunk/drivers/media/video/bt8xx/bttv-driver.c index 5764a89d3562..aa3203ae670c 100644 --- a/trunk/drivers/media/video/bt8xx/bttv-driver.c +++ b/trunk/drivers/media/video/bt8xx/bttv-driver.c @@ -4050,7 +4050,7 @@ static int __devinit bttv_probe(struct pci_dev *dev, /* disable irqs, register irq handler */ btwrite(0, BT848_INT_MASK); result = request_irq(btv->c.pci->irq, bttv_irq, - IRQF_SHARED | IRQF_DISABLED,btv->c.name,(void *)btv); + SA_SHIRQ | SA_INTERRUPT,btv->c.name,(void *)btv); if (result < 0) { printk(KERN_ERR "bttv%d: can't get IRQ %d\n", bttv_num,btv->c.pci->irq); diff --git a/trunk/drivers/media/video/bt8xx/bttvp.h b/trunk/drivers/media/video/bt8xx/bttvp.h index 311c4c541e01..d2956010f763 100644 --- a/trunk/drivers/media/video/bt8xx/bttvp.h +++ b/trunk/drivers/media/video/bt8xx/bttvp.h @@ -360,7 +360,7 @@ struct bttv { int mbox_csel; /* risc memory management data - - must acquire s_lock before changing these + - must aquire s_lock before changing these - only the irq handler is supported to touch top + bottom + vcurr */ struct btcx_riscmem main; struct bttv_buffer *screen; /* overlay */ diff --git a/trunk/drivers/media/video/compat_ioctl32.c b/trunk/drivers/media/video/compat_ioctl32.c index 353d02b67c33..840fe0177121 100644 --- a/trunk/drivers/media/video/compat_ioctl32.c +++ b/trunk/drivers/media/video/compat_ioctl32.c @@ -12,6 +12,7 @@ * ioctls. */ +#include #include #include #include diff --git a/trunk/drivers/media/video/cpia.c b/trunk/drivers/media/video/cpia.c index 3b31a0dd2f0c..95c5aceecc5b 100644 --- a/trunk/drivers/media/video/cpia.c +++ b/trunk/drivers/media/video/cpia.c @@ -26,6 +26,7 @@ /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ /* #define _CPIA_DEBUG_ 1 */ +#include #include #include diff --git a/trunk/drivers/media/video/cpia2/cpia2_v4l.c b/trunk/drivers/media/video/cpia2/cpia2_v4l.c index d09f49950f2a..d129db57fcd4 100644 --- a/trunk/drivers/media/video/cpia2/cpia2_v4l.c +++ b/trunk/drivers/media/video/cpia2/cpia2_v4l.c @@ -31,6 +31,7 @@ #include +#include #include #include diff --git a/trunk/drivers/media/video/cpia_pp.c b/trunk/drivers/media/video/cpia_pp.c index 41f4b8d17559..4c89bd395d3e 100644 --- a/trunk/drivers/media/video/cpia_pp.c +++ b/trunk/drivers/media/video/cpia_pp.c @@ -25,6 +25,7 @@ /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ /* #define _CPIA_DEBUG_ 1 */ +#include #include #include diff --git a/trunk/drivers/media/video/cx88/cx88-alsa.c b/trunk/drivers/media/video/cx88/cx88-alsa.c index f0340662e078..292a5e81eb75 100644 --- a/trunk/drivers/media/video/cx88/cx88-alsa.c +++ b/trunk/drivers/media/video/cx88/cx88-alsa.c @@ -700,7 +700,7 @@ static int __devinit snd_cx88_create(struct snd_card *card, /* get irq */ err = request_irq(chip->pci->irq, cx8801_irq, - IRQF_SHARED | IRQF_DISABLED, chip->core->name, chip); + SA_SHIRQ | SA_INTERRUPT, chip->core->name, chip); if (err < 0) { dprintk(0, "%s: can't get IRQ %d\n", chip->core->name, chip->pci->irq); diff --git a/trunk/drivers/media/video/cx88/cx88-blackbird.c b/trunk/drivers/media/video/cx88/cx88-blackbird.c index 349632b48e93..4ff81582ec56 100644 --- a/trunk/drivers/media/video/cx88/cx88-blackbird.c +++ b/trunk/drivers/media/video/cx88/cx88-blackbird.c @@ -686,39 +686,6 @@ static struct videobuf_queue_ops blackbird_qops = { /* ------------------------------------------------------------------ */ -static const u32 *ctrl_classes[] = { - cx88_user_ctrls, - cx2341x_mpeg_ctrls, - NULL -}; - -static int blackbird_queryctrl(struct cx8802_dev *dev, struct v4l2_queryctrl *qctrl) -{ - qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); - if (qctrl->id == 0) - return -EINVAL; - - /* Standard V4L2 controls */ - if (cx8800_ctrl_query(qctrl) == 0) - return 0; - - /* MPEG V4L2 controls */ - if (cx2341x_ctrl_query(&dev->params, qctrl)) - qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; - return 0; -} - -static int blackbird_querymenu(struct cx8802_dev *dev, struct v4l2_querymenu *qmenu) -{ - struct v4l2_queryctrl qctrl; - - qctrl.id = qmenu->id; - blackbird_queryctrl(dev, &qctrl); - return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); -} - -/* ------------------------------------------------------------------ */ - static int mpeg_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg) { @@ -899,16 +866,6 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file, core->name); return 0; } - case VIDIOC_QUERYMENU: - return blackbird_querymenu(dev, arg); - case VIDIOC_QUERYCTRL: - { - struct v4l2_queryctrl *c = arg; - - if (blackbird_queryctrl(dev, c) == 0) - return 0; - return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl); - } default: return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl); diff --git a/trunk/drivers/media/video/cx88/cx88-cards.c b/trunk/drivers/media/video/cx88/cx88-cards.c index 14bd4863d157..f9d68f20dc88 100644 --- a/trunk/drivers/media/video/cx88/cx88-cards.c +++ b/trunk/drivers/media/video/cx88/cx88-cards.c @@ -1194,21 +1194,6 @@ struct cx88_board cx88_boards[] = { }}, .dvb = 1, }, - [CX88_BOARD_GENIATECH_DVBS] = { - .name = "Geniatech DVB-S", - .tuner_type = TUNER_ABSENT, - .radio_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .input = {{ - .type = CX88_VMUX_DVB, - .vmux = 0, - },{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - }}, - .dvb = 1, - }, }; const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); @@ -1454,10 +1439,6 @@ struct cx88_subid cx88_subids[] = { .subvendor = 0x18ac, .subdevice = 0xd800, /* FusionHDTV 3 Gold (original revision) */ .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q, - },{ - .subvendor = 0x14f1, - .subdevice = 0x0084, - .card = CX88_BOARD_GENIATECH_DVBS, }, }; const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); diff --git a/trunk/drivers/media/video/cx88/cx88-dvb.c b/trunk/drivers/media/video/cx88/cx88-dvb.c index afde3789d702..dce1feddd55d 100644 --- a/trunk/drivers/media/video/cx88/cx88-dvb.c +++ b/trunk/drivers/media/video/cx88/cx88-dvb.c @@ -496,26 +496,6 @@ static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t return 0; } -static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) -{ - struct cx8802_dev *dev= fe->dvb->priv; - struct cx88_core *core = dev->core; - - if (voltage == SEC_VOLTAGE_OFF) { - dprintk(1,"LNB Voltage OFF\n"); - cx_write(MO_GP0_IO, 0x0000efff); - } - - if (core->prev_set_voltage) - return core->prev_set_voltage(fe, voltage); - return 0; -} - -static struct cx24123_config geniatech_dvbs_config = { - .demod_address = 0x55, - .set_ts_params = cx24123_set_ts_param, -}; - static struct cx24123_config hauppauge_novas_config = { .demod_address = 0x55, .set_ts_params = cx24123_set_ts_param, @@ -780,14 +760,6 @@ static int dvb_register(struct cx8802_dev *dev) dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage; } break; - case CX88_BOARD_GENIATECH_DVBS: - dev->dvb.frontend = cx24123_attach(&geniatech_dvbs_config, - &dev->core->i2c_adap); - if (dev->dvb.frontend) { - dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; - dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; - } - break; #endif default: printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", diff --git a/trunk/drivers/media/video/cx88/cx88-mpeg.c b/trunk/drivers/media/video/cx88/cx88-mpeg.c index 138a4f692501..2c12aca1b6a3 100644 --- a/trunk/drivers/media/video/cx88/cx88-mpeg.c +++ b/trunk/drivers/media/video/cx88/cx88-mpeg.c @@ -438,7 +438,7 @@ int cx8802_init_common(struct cx8802_dev *dev) /* get irq */ err = request_irq(dev->pci->irq, cx8802_irq, - IRQF_SHARED | IRQF_DISABLED, dev->core->name, dev); + SA_SHIRQ | SA_INTERRUPT, dev->core->name, dev); if (err < 0) { printk(KERN_ERR "%s: can't get IRQ %d\n", dev->core->name, dev->pci->irq); diff --git a/trunk/drivers/media/video/cx88/cx88-video.c b/trunk/drivers/media/video/cx88/cx88-video.c index 2225d4b94140..8d5cf474b68e 100644 --- a/trunk/drivers/media/video/cx88/cx88-video.c +++ b/trunk/drivers/media/video/cx88/cx88-video.c @@ -327,51 +327,6 @@ static struct cx88_ctrl cx8800_ctls[] = { }; static const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls); -const u32 cx88_user_ctrls[] = { - V4L2_CID_USER_CLASS, - V4L2_CID_BRIGHTNESS, - V4L2_CID_CONTRAST, - V4L2_CID_SATURATION, - V4L2_CID_HUE, - V4L2_CID_AUDIO_VOLUME, - V4L2_CID_AUDIO_BALANCE, - V4L2_CID_AUDIO_MUTE, - 0 -}; -EXPORT_SYMBOL(cx88_user_ctrls); - -static const u32 *ctrl_classes[] = { - cx88_user_ctrls, - NULL -}; - -int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl) -{ - int i; - - if (qctrl->id < V4L2_CID_BASE || - qctrl->id >= V4L2_CID_LASTP1) - return -EINVAL; - for (i = 0; i < CX8800_CTLS; i++) - if (cx8800_ctls[i].v.id == qctrl->id) - break; - if (i == CX8800_CTLS) { - *qctrl = no_ctl; - return 0; - } - *qctrl = cx8800_ctls[i].v; - return 0; -} -EXPORT_SYMBOL(cx8800_ctrl_query); - -static int cx88_queryctrl(struct v4l2_queryctrl *qctrl) -{ - qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); - if (qctrl->id == 0) - return -EINVAL; - return cx8800_ctrl_query(qctrl); -} - /* ------------------------------------------------------------------- */ /* resource management */ @@ -1407,8 +1362,20 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, case VIDIOC_QUERYCTRL: { struct v4l2_queryctrl *c = arg; + int i; - return cx88_queryctrl(c); + if (c->id < V4L2_CID_BASE || + c->id >= V4L2_CID_LASTP1) + return -EINVAL; + for (i = 0; i < CX8800_CTLS; i++) + if (cx8800_ctls[i].v.id == c->id) + break; + if (i == CX8800_CTLS) { + *c = no_ctl; + return 0; + } + *c = cx8800_ctls[i].v; + return 0; } case VIDIOC_G_CTRL: return get_control(core,arg); @@ -1915,7 +1882,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, /* get irq */ err = request_irq(pci_dev->irq, cx8800_irq, - IRQF_SHARED | IRQF_DISABLED, core->name, dev); + SA_SHIRQ | SA_INTERRUPT, core->name, dev); if (err < 0) { printk(KERN_ERR "%s: can't get IRQ %d\n", core->name,pci_dev->irq); @@ -1926,6 +1893,8 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, /* load and configure helper modules */ if (TUNER_ABSENT != core->tuner_type) request_module("tuner"); + if (core->tda9887_conf) + request_module("tda9887"); /* register v4l devices */ dev->video_dev = cx88_vdev_init(core,dev->pci, diff --git a/trunk/drivers/media/video/cx88/cx88.h b/trunk/drivers/media/video/cx88/cx88.h index e7810955dd4f..9a9a0fc7a41a 100644 --- a/trunk/drivers/media/video/cx88/cx88.h +++ b/trunk/drivers/media/video/cx88/cx88.h @@ -196,7 +196,6 @@ extern struct sram_channel cx88_sram_channels[]; #define CX88_BOARD_PIXELVIEW_PLAYTV_P7000 49 #define CX88_BOARD_NPGTECH_REALTV_TOP10FM 50 #define CX88_BOARD_WINFAST_DTV2000H 51 -#define CX88_BOARD_GENIATECH_DVBS 52 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, @@ -591,8 +590,6 @@ int cx8802_resume_common(struct pci_dev *pci_dev); extern int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, struct cx88_core *core, unsigned int cmd, void *arg, v4l2_kioctl driver_ioctl); -extern const u32 cx88_user_ctrls[]; -extern int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl); /* * Local variables: diff --git a/trunk/drivers/media/video/em28xx/em28xx-video.c b/trunk/drivers/media/video/em28xx/em28xx-video.c index 2a461dde480c..9286090817cd 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-video.c +++ b/trunk/drivers/media/video/em28xx/em28xx-video.c @@ -1574,6 +1574,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, request_module("tvp5150"); if (dev->has_tuner) request_module("tuner"); + if (dev->tda9887_conf) + request_module("tda9887"); #endif errCode = em28xx_config(dev); if (errCode) { diff --git a/trunk/drivers/media/video/meye.c b/trunk/drivers/media/video/meye.c index e278753f8f25..f68ca7d9f531 100644 --- a/trunk/drivers/media/video/meye.c +++ b/trunk/drivers/media/video/meye.c @@ -26,6 +26,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -1881,7 +1882,7 @@ static int __devinit meye_probe(struct pci_dev *pcidev, meye.mchip_irq = pcidev->irq; if (request_irq(meye.mchip_irq, meye_irq, - IRQF_DISABLED | IRQF_SHARED, "meye", meye_irq)) { + SA_INTERRUPT | SA_SHIRQ, "meye", meye_irq)) { printk(KERN_ERR "meye: request_irq failed\n"); goto outreqirq; } diff --git a/trunk/drivers/media/video/meye.h b/trunk/drivers/media/video/meye.h index ea107cb5c845..0d09a0e3803c 100644 --- a/trunk/drivers/media/video/meye.h +++ b/trunk/drivers/media/video/meye.h @@ -36,6 +36,7 @@ #define MEYE_DRIVER_VERSION __stringify(MEYE_DRIVER_MAJORVERSION) "." \ __stringify(MEYE_DRIVER_MINORVERSION) +#include #include #include #include diff --git a/trunk/drivers/media/video/msp3400-driver.h b/trunk/drivers/media/video/msp3400-driver.h index 545e4ac094f2..4e451049013d 100644 --- a/trunk/drivers/media/video/msp3400-driver.h +++ b/trunk/drivers/media/video/msp3400-driver.h @@ -90,8 +90,8 @@ struct msp_state { /* thread */ struct task_struct *kthread; wait_queue_head_t wq; - unsigned int restart:1; - unsigned int watch_stereo:1; + int restart:1; + int watch_stereo:1; }; /* msp3400-driver.c */ diff --git a/trunk/drivers/media/video/ov511.c b/trunk/drivers/media/video/ov511.c index 1b07a61c2ebb..a988df226aab 100644 --- a/trunk/drivers/media/video/ov511.c +++ b/trunk/drivers/media/video/ov511.c @@ -35,6 +35,7 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/media/video/pvrusb2/Makefile b/trunk/drivers/media/video/pvrusb2/Makefile index 02e414210dac..fed603ad0a67 100644 --- a/trunk/drivers/media/video/pvrusb2/Makefile +++ b/trunk/drivers/media/video/pvrusb2/Makefile @@ -8,7 +8,7 @@ obj-pvrusb2-24xxx-$(CONFIG_VIDEO_PVRUSB2_24XXX) := \ pvrusb2-objs := pvrusb2-i2c-core.o pvrusb2-i2c-cmd-v4l2.o \ pvrusb2-audio.o pvrusb2-i2c-chips-v4l2.o \ pvrusb2-encoder.o pvrusb2-video-v4l.o \ - pvrusb2-eeprom.o pvrusb2-tuner.o \ + pvrusb2-eeprom.o pvrusb2-tuner.o pvrusb2-demod.o \ pvrusb2-main.o pvrusb2-hdw.o pvrusb2-v4l2.o \ pvrusb2-ctrl.o pvrusb2-std.o \ pvrusb2-context.o pvrusb2-io.o pvrusb2-ioread.o \ diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-audio.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-audio.c index 9846c464ec80..313d2dcf9e4b 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-audio.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-audio.c @@ -145,8 +145,8 @@ static int get_audio_status(struct pvr2_msp3400_handler *ctxt) static void pvr2_msp3400_detach(struct pvr2_msp3400_handler *ctxt) { - ctxt->client->handler = NULL; - ctxt->hdw->audio_stat = NULL; + ctxt->client->handler = 0; + ctxt->hdw->audio_stat = 0; kfree(ctxt); } diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-context.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-context.c index f129f316d20e..40dc59871a45 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-context.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-context.c @@ -77,7 +77,7 @@ struct pvr2_context *pvr2_context_create( const struct usb_device_id *devid, void (*setup_func)(struct pvr2_context *)) { - struct pvr2_context *mp = NULL; + struct pvr2_context *mp = 0; mp = kmalloc(sizeof(*mp),GFP_KERNEL); if (!mp) goto done; memset(mp,0,sizeof(*mp)); @@ -87,7 +87,7 @@ struct pvr2_context *pvr2_context_create( mp->hdw = pvr2_hdw_create(intf,devid); if (!mp->hdw) { pvr2_context_destroy(mp); - mp = NULL; + mp = 0; goto done; } @@ -145,7 +145,7 @@ void pvr2_channel_init(struct pvr2_channel *cp,struct pvr2_context *mp) { cp->hdw = mp->hdw; cp->mc_head = mp; - cp->mc_next = NULL; + cp->mc_next = 0; cp->mc_prev = mp->mc_last; if (mp->mc_last) { mp->mc_last->mc_next = cp; @@ -160,8 +160,8 @@ static void pvr2_channel_disclaim_stream(struct pvr2_channel *cp) { if (!cp->stream) return; pvr2_stream_kill(cp->stream->stream); - cp->stream->user = NULL; - cp->stream = NULL; + cp->stream->user = 0; + cp->stream = 0; } @@ -179,7 +179,7 @@ void pvr2_channel_done(struct pvr2_channel *cp) } else { mp->mc_first = cp->mc_next; } - cp->hdw = NULL; + cp->hdw = 0; } @@ -212,7 +212,7 @@ struct pvr2_ioread *pvr2_channel_create_mpeg_stream( { struct pvr2_ioread *cp; cp = pvr2_ioread_create(); - if (!cp) return NULL; + if (!cp) return 0; pvr2_ioread_setup(cp,sp->stream); pvr2_ioread_set_sync_key(cp,stream_sync_key,sizeof(stream_sync_key)); return cp; diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-ctrl.c index fb6198f1df98..d5df9fbeba2f 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-ctrl.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-ctrl.c @@ -158,7 +158,7 @@ int pvr2_ctrl_get_mask(struct pvr2_ctrl *cptr) /* Retrieve the control's name */ const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr) { - if (!cptr) return NULL; + if (!cptr) return 0; return cptr->info->name; } @@ -166,7 +166,7 @@ const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr) /* Retrieve the control's desc */ const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *cptr) { - if (!cptr) return NULL; + if (!cptr) return 0; return cptr->info->desc; } @@ -488,7 +488,7 @@ int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *cptr, LOCK_TAKE(cptr->hdw->big_lock); do { if (cptr->info->type == pvr2_ctl_int) { - ret = parse_token(ptr,len,valptr,NULL,0); + ret = parse_token(ptr,len,valptr,0,0); if ((ret >= 0) && ((*valptr < cptr->info->def.type_int.min_value) || (*valptr > cptr->info->def.type_int.max_value))) { diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c index c80c26be6e4d..27eadaff75a0 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c @@ -139,8 +139,8 @@ static const struct pvr2_v4l_cx2584x_ops decoder_ops[] = { static void decoder_detach(struct pvr2_v4l_cx2584x *ctxt) { - ctxt->client->handler = NULL; - ctxt->hdw->decoder_ctrl = NULL; + ctxt->client->handler = 0; + ctxt->hdw->decoder_ctrl = 0; kfree(ctxt); } @@ -221,7 +221,7 @@ static unsigned int decoder_describe(struct pvr2_v4l_cx2584x *ctxt, static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt) { int ret; - ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,NULL); + ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,0); pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx25840 decoder_reset (ret=%d)",ret); } diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-debugifc.c index f985f00d885a..586900e365ff 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-debugifc.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-debugifc.c @@ -82,7 +82,7 @@ static unsigned int debugifc_isolate_word(const char *buf,unsigned int count, unsigned int wlen; unsigned int scnt; - wptr = NULL; + wptr = 0; wlen = 0; scnt = debugifc_count_whitespace(buf,count); consume_cnt += scnt; count -= scnt; buf += scnt; @@ -337,8 +337,8 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw, } -static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, - unsigned int count) +int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, + unsigned int count) { const char *wptr; unsigned int wlen; diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-demod.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-demod.c new file mode 100644 index 000000000000..9686569a11f6 --- /dev/null +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-demod.c @@ -0,0 +1,126 @@ +/* + * + * $Id$ + * + * Copyright (C) 2005 Mike Isely + * Copyright (C) 2004 Aurelien Alleaume + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "pvrusb2.h" +#include "pvrusb2-util.h" +#include "pvrusb2-demod.h" +#include "pvrusb2-hdw-internal.h" +#include "pvrusb2-debug.h" +#include +#include +#include + + +struct pvr2_demod_handler { + struct pvr2_hdw *hdw; + struct pvr2_i2c_client *client; + struct pvr2_i2c_handler i2c_handler; + int type_update_fl; +}; + + +static void set_config(struct pvr2_demod_handler *ctxt) +{ + struct pvr2_hdw *hdw = ctxt->hdw; + int cfg = 0; + + switch (hdw->tuner_type) { + case TUNER_PHILIPS_FM1216ME_MK3: + case TUNER_PHILIPS_FM1236_MK3: + cfg = TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE; + break; + default: + break; + } + pvr2_trace(PVR2_TRACE_CHIPS,"i2c demod set_config(0x%x)",cfg); + pvr2_i2c_client_cmd(ctxt->client,TDA9887_SET_CONFIG,&cfg); + ctxt->type_update_fl = 0; +} + + +static int demod_check(struct pvr2_demod_handler *ctxt) +{ + struct pvr2_hdw *hdw = ctxt->hdw; + if (hdw->tuner_updated) ctxt->type_update_fl = !0; + return ctxt->type_update_fl != 0; +} + + +static void demod_update(struct pvr2_demod_handler *ctxt) +{ + if (ctxt->type_update_fl) set_config(ctxt); +} + + +static void demod_detach(struct pvr2_demod_handler *ctxt) +{ + ctxt->client->handler = 0; + kfree(ctxt); +} + + +static unsigned int demod_describe(struct pvr2_demod_handler *ctxt,char *buf,unsigned int cnt) +{ + return scnprintf(buf,cnt,"handler: pvrusb2-demod"); +} + + +const static struct pvr2_i2c_handler_functions tuner_funcs = { + .detach = (void (*)(void *))demod_detach, + .check = (int (*)(void *))demod_check, + .update = (void (*)(void *))demod_update, + .describe = (unsigned int (*)(void *,char *,unsigned int))demod_describe, +}; + + +int pvr2_i2c_demod_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) +{ + struct pvr2_demod_handler *ctxt; + if (cp->handler) return 0; + + ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL); + if (!ctxt) return 0; + memset(ctxt,0,sizeof(*ctxt)); + + ctxt->i2c_handler.func_data = ctxt; + ctxt->i2c_handler.func_table = &tuner_funcs; + ctxt->type_update_fl = !0; + ctxt->client = cp; + ctxt->hdw = hdw; + cp->handler = &ctxt->i2c_handler; + pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x tda9887 V4L2 handler set up", + cp->client->addr); + return !0; +} + + + + +/* + Stuff for Emacs to see, in order to encourage consistent editing style: + *** Local Variables: *** + *** mode: c *** + *** fill-column: 70 *** + *** tab-width: 8 *** + *** c-basic-offset: 8 *** + *** End: *** + */ diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-demod.h b/trunk/drivers/media/video/pvrusb2/pvrusb2-demod.h new file mode 100644 index 000000000000..4c4e40ffbf03 --- /dev/null +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-demod.h @@ -0,0 +1,38 @@ +/* + * + * $Id$ + * + * Copyright (C) 2005 Mike Isely + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#ifndef __PVRUSB2_DEMOD_H +#define __PVRUSB2_DEMOD_H + +#include "pvrusb2-i2c-core.h" + +int pvr2_i2c_demod_setup(struct pvr2_hdw *,struct pvr2_i2c_client *); + +#endif /* __PVRUSB2_DEMOD_H */ + +/* + Stuff for Emacs to see, in order to encourage consistent editing style: + *** Local Variables: *** + *** mode: c *** + *** fill-column: 70 *** + *** tab-width: 8 *** + *** c-basic-offset: 8 *** + *** End: *** + */ diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-eeprom.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-eeprom.c index 6cff8e75f426..94d383ff9889 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-eeprom.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-eeprom.c @@ -58,7 +58,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Failed to allocate memory" " required to read eeprom"); - return NULL; + return 0; } trace_eeprom("Value for eeprom addr from controller was 0x%x", @@ -108,7 +108,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "eeprom fetch set offs err=%d",ret); kfree(eeprom); - return NULL; + return 0; } } return eeprom; diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-encoder.c index 18a7073501c6..2cc31695b435 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-encoder.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-encoder.c @@ -65,7 +65,7 @@ static int pvr2_encoder_write_words(struct pvr2_hdw *hdw, } ret = pvr2_send_request(hdw, hdw->cmd_buffer,1+(chunkCnt*7), - NULL,0); + 0,0); if (ret) return ret; data += chunkCnt; dlen -= chunkCnt; @@ -322,7 +322,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) } ret = cx2341x_update(hdw,pvr2_encoder_cmd, - (hdw->enc_cur_valid ? &hdw->enc_cur_state : NULL), + (hdw->enc_cur_valid ? &hdw->enc_cur_state : 0), &hdw->enc_ctl_state); if (ret) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index 0d6dc33ca320..ba2afbfe32c5 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h @@ -354,6 +354,23 @@ struct pvr2_hdw { unsigned int control_cnt; }; +int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); + +unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *); + +void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk,unsigned long val); +void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val); + +void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw); +void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw); + +int pvr2_i2c_basic_op(struct pvr2_hdw *,u8 i2c_addr, + u8 *wdata,u16 wlen, + u8 *rdata,u16 rlen); + #endif /* __PVRUSB2_HDW_INTERNAL_H */ /* diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 9b48abcf6089..643c471375da 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -63,6 +63,7 @@ struct pvr2_string_table { static const char *pvr2_client_24xxx[] = { "cx25840", "tuner", + "tda9887", "wm8775", }; #endif @@ -72,6 +73,7 @@ static const char *pvr2_client_29xxx[] = { "msp3400", "saa7115", "tuner", + "tda9887", }; static struct pvr2_string_table pvr2_client_lists[] = { @@ -87,8 +89,8 @@ static struct pvr2_string_table pvr2_client_lists[] = { #endif }; -static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL}; -static DECLARE_MUTEX(pvr2_unit_sem); +static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = 0}; +DECLARE_MUTEX(pvr2_unit_sem); static int ctlchg = 0; static int initusbreset = 1; @@ -261,25 +263,6 @@ static const char *control_values_subsystem[] = { [PVR2_SUBSYS_B_ENC_RUN] = "enc_run", }; -static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl); -static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); -static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw); -static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw); -static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw); -static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw); -static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw); -static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val); -static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val); -static int pvr2_send_request_ex(struct pvr2_hdw *hdw, - unsigned int timeout,int probe_fl, - void *write_data,unsigned int write_len, - void *read_data,unsigned int read_len); -static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res); -static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res); static int ctrl_channelfreq_get(struct pvr2_ctrl *cptr,int *vp) { @@ -422,7 +405,7 @@ static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr) info = (struct pvr2_ctl_info *)(cptr->info); if (qctrl.flags & V4L2_CTRL_FLAG_READ_ONLY) { if (info->set_value) { - info->set_value = NULL; + info->set_value = 0; } } else { if (!(info->set_value)) { @@ -853,6 +836,14 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *hdw) } +struct pvr2_hdw *pvr2_hdw_find(int unit_number) +{ + if (unit_number < 0) return 0; + if (unit_number >= PVR_NUM) return 0; + return unit_pointers[unit_number]; +} + + int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw) { return hdw->unit_number; @@ -926,9 +917,9 @@ static int pvr2_locate_firmware(struct pvr2_hdw *hdw, * is not suitable for an usb transaction. * */ -static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) +int pvr2_upload_firmware1(struct pvr2_hdw *hdw) { - const struct firmware *fw_entry = NULL; + const struct firmware *fw_entry = 0; void *fw_ptr; unsigned int pipe; int ret; @@ -1024,7 +1015,7 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) int pvr2_upload_firmware2(struct pvr2_hdw *hdw) { - const struct firmware *fw_entry = NULL; + const struct firmware *fw_entry = 0; void *fw_ptr; unsigned int pipe, fw_len, fw_done; int actual_length; @@ -1175,9 +1166,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) reconfigure and start over. */ -static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val) +void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk,unsigned long val) { unsigned long nmsk; unsigned long vmsk; @@ -1328,6 +1318,18 @@ void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw, } +void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk) +{ + pvr2_hdw_subsys_bit_chg(hdw,msk,msk); +} + + +void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk) +{ + pvr2_hdw_subsys_bit_chg(hdw,msk,0); +} + + unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *hdw) { return hdw->subsys_enabled_mask; @@ -1340,9 +1342,9 @@ unsigned long pvr2_hdw_subsys_stream_get(struct pvr2_hdw *hdw) } -static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val) +void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val) { unsigned long val2; msk &= PVR2_SUBSYS_ALL; @@ -1364,7 +1366,7 @@ void pvr2_hdw_subsys_stream_bit_chg(struct pvr2_hdw *hdw, } -static int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl) +int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl) { if ((!enableFl) == !(hdw->flag_streaming_enabled)) return 0; if (enableFl) { @@ -1398,8 +1400,8 @@ int pvr2_hdw_set_streaming(struct pvr2_hdw *hdw,int enable_flag) } -static int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw, - enum pvr2_config config) +int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw, + enum pvr2_config config) { unsigned long sm = hdw->subsys_enabled_mask; if (!hdw->flag_ok) return -EIO; @@ -1739,7 +1741,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Bogus device type of %u reported",hdw_type); - return NULL; + return 0; } hdw = kmalloc(sizeof(*hdw),GFP_KERNEL); @@ -1920,38 +1922,38 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, if (hdw->mpeg_ctrl_info) kfree(hdw->mpeg_ctrl_info); kfree(hdw); } - return NULL; + return 0; } /* Remove _all_ associations between this driver and the underlying USB layer. */ -static void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw) +void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw) { if (hdw->flag_disconnected) return; pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_remove_usb_stuff: hdw=%p",hdw); if (hdw->ctl_read_urb) { usb_kill_urb(hdw->ctl_read_urb); usb_free_urb(hdw->ctl_read_urb); - hdw->ctl_read_urb = NULL; + hdw->ctl_read_urb = 0; } if (hdw->ctl_write_urb) { usb_kill_urb(hdw->ctl_write_urb); usb_free_urb(hdw->ctl_write_urb); - hdw->ctl_write_urb = NULL; + hdw->ctl_write_urb = 0; } if (hdw->ctl_read_buffer) { kfree(hdw->ctl_read_buffer); - hdw->ctl_read_buffer = NULL; + hdw->ctl_read_buffer = 0; } if (hdw->ctl_write_buffer) { kfree(hdw->ctl_write_buffer); - hdw->ctl_write_buffer = NULL; + hdw->ctl_write_buffer = 0; } pvr2_hdw_render_useless_unlocked(hdw); hdw->flag_disconnected = !0; - hdw->usb_dev = NULL; - hdw->usb_intf = NULL; + hdw->usb_dev = 0; + hdw->usb_intf = 0; } @@ -1961,11 +1963,11 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw); if (hdw->fw_buffer) { kfree(hdw->fw_buffer); - hdw->fw_buffer = NULL; + hdw->fw_buffer = 0; } if (hdw->vid_stream) { pvr2_stream_destroy(hdw->vid_stream); - hdw->vid_stream = NULL; + hdw->vid_stream = 0; } if (hdw->audio_stat) { hdw->audio_stat->detach(hdw->audio_stat->ctxt); @@ -1979,7 +1981,7 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) if ((hdw->unit_number >= 0) && (hdw->unit_number < PVR_NUM) && (unit_pointers[hdw->unit_number] == hdw)) { - unit_pointers[hdw->unit_number] = NULL; + unit_pointers[hdw->unit_number] = 0; } } while (0); up(&pvr2_unit_sem); if (hdw->controls) kfree(hdw->controls); @@ -2016,7 +2018,7 @@ void pvr2_hdw_disconnect(struct pvr2_hdw *hdw) // Attempt to autoselect an appropriate value for std_enum_cur given // whatever is currently in std_mask_cur -static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) +void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) { unsigned int idx; for (idx = 1; idx < hdw->std_enum_cnt; idx++) { @@ -2031,7 +2033,7 @@ static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) // Calculate correct set of enumerated standards based on currently known // set of available standards bits. -static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) +void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) { struct v4l2_standard *newstd; unsigned int std_cnt; @@ -2041,12 +2043,12 @@ static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) if (hdw->std_defs) { kfree(hdw->std_defs); - hdw->std_defs = NULL; + hdw->std_defs = 0; } hdw->std_enum_cnt = 0; if (hdw->std_enum_names) { kfree(hdw->std_enum_names); - hdw->std_enum_names = NULL; + hdw->std_enum_names = 0; } if (!std_cnt) { @@ -2097,7 +2099,7 @@ unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *hdw) struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw, unsigned int idx) { - if (idx >= hdw->control_cnt) return NULL; + if (idx >= hdw->control_cnt) return 0; return hdw->controls + idx; } @@ -2116,7 +2118,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_id(struct pvr2_hdw *hdw, i = cptr->info->internal_id; if (i && (i == ctl_id)) return cptr; } - return NULL; + return 0; } @@ -2133,7 +2135,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id i = cptr->info->v4l_id; if (i && (i == ctl_id)) return cptr; } - return NULL; + return 0; } @@ -2147,7 +2149,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw, int i; /* This could be made a lot more efficient, but for now... */ - cp2 = NULL; + cp2 = 0; for (idx = 0; idx < hdw->control_cnt; idx++) { cptr = hdw->controls + idx; i = cptr->info->v4l_id; @@ -2157,7 +2159,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw, cp2 = cptr; } return cp2; - return NULL; + return 0; } @@ -2180,7 +2182,7 @@ static const char *get_ctrl_typename(enum pvr2_ctl_type tp) state(s) back to their previous value before this function was called. Thus we can automatically reconfigure affected pieces of the driver as controls are changed. */ -static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) +int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) { unsigned long saved_subsys_mask = hdw->subsys_enabled_mask; unsigned long stale_subsys_mask = 0; @@ -2319,6 +2321,14 @@ void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *hdw) } +void pvr2_hdw_poll_trigger(struct pvr2_hdw *hdw) +{ + LOCK_TAKE(hdw->big_lock); do { + pvr2_hdw_poll_trigger_unlocked(hdw); + } while (0); LOCK_GIVE(hdw->big_lock); +} + + /* Return name for this driver instance */ const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) { @@ -2327,7 +2337,7 @@ const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) /* Return bit mask indicating signal status */ -static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw) +unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw) { unsigned int msk = 0; switch (hdw->input_val) { @@ -2414,7 +2424,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag) pvr2_trace(PVR2_TRACE_FIRMWARE, "Cleaning up after CPU firmware fetch"); kfree(hdw->fw_buffer); - hdw->fw_buffer = NULL; + hdw->fw_buffer = 0; hdw->fw_size = 0; /* Now release the CPU. It will disconnect and reconnect later. */ @@ -2509,6 +2519,22 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int v) } +void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw) +{ + if (!hdw->usb_dev) return; + usb_settoggle(hdw->usb_dev, PVR2_CTL_WRITE_ENDPOINT & 0xf, + !(PVR2_CTL_WRITE_ENDPOINT & USB_DIR_IN), 0); + usb_settoggle(hdw->usb_dev, PVR2_CTL_READ_ENDPOINT & 0xf, + !(PVR2_CTL_READ_ENDPOINT & USB_DIR_IN), 0); + usb_clear_halt(hdw->usb_dev, + usb_rcvbulkpipe(hdw->usb_dev, + PVR2_CTL_READ_ENDPOINT & 0x7f)); + usb_clear_halt(hdw->usb_dev, + usb_sndbulkpipe(hdw->usb_dev, + PVR2_CTL_WRITE_ENDPOINT & 0x7f)); +} + + static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs) { struct pvr2_hdw *hdw = urb->context; @@ -2542,10 +2568,10 @@ static void pvr2_ctl_timeout(unsigned long data) } -static int pvr2_send_request_ex(struct pvr2_hdw *hdw, - unsigned int timeout,int probe_fl, - void *write_data,unsigned int write_len, - void *read_data,unsigned int read_len) +int pvr2_send_request_ex(struct pvr2_hdw *hdw, + unsigned int timeout,int probe_fl, + void *write_data,unsigned int write_len, + void *read_data,unsigned int read_len) { unsigned int idx; int status = 0; @@ -2800,7 +2826,7 @@ int pvr2_write_register(struct pvr2_hdw *hdw, u16 reg, u32 data) } -static int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) +int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) { int ret = 0; @@ -2824,7 +2850,7 @@ static int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) } -static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) +int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) { int ret; @@ -2841,7 +2867,7 @@ static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) } -static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) +int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) { int ret; @@ -2857,13 +2883,13 @@ static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) } -static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw) +void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw) { if (!hdw->flag_ok) return; pvr2_trace(PVR2_TRACE_INIT,"render_useless"); hdw->flag_ok = 0; if (hdw->vid_stream) { - pvr2_stream_setup(hdw->vid_stream,NULL,0,0); + pvr2_stream_setup(hdw->vid_stream,0,0,0); } hdw->flag_streaming_enabled = 0; hdw->subsys_enabled_mask = 0; @@ -2882,7 +2908,7 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw) { int ret; pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset..."); - ret = usb_lock_device_for_reset(hdw->usb_dev,NULL); + ret = usb_lock_device_for_reset(hdw->usb_dev,0); if (ret == 1) { ret = usb_reset_device(hdw->usb_dev); usb_unlock_device(hdw->usb_dev); @@ -2931,7 +2957,7 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset"); hdw->flag_ok = !0; hdw->cmd_buffer[0] = 0xdd; - status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); + status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); } while (0); LOCK_GIVE(hdw->ctl_lock); return status; } @@ -2943,7 +2969,7 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw) LOCK_TAKE(hdw->ctl_lock); do { pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup"); hdw->cmd_buffer[0] = 0xde; - status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); + status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); } while (0); LOCK_GIVE(hdw->ctl_lock); return status; } @@ -2970,12 +2996,12 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) } -static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) +int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) { int status; LOCK_TAKE(hdw->ctl_lock); do { hdw->cmd_buffer[0] = (runFl ? 0x36 : 0x37); - status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); + status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); } while (0); LOCK_GIVE(hdw->ctl_lock); if (!status) { hdw->subsys_enabled_mask = @@ -3068,7 +3094,7 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val) } -static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) +int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) { int result; LOCK_TAKE(hdw->ctl_lock); do { diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.h index fd931b5da490..63f529154431 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -91,6 +91,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, void pvr2_hdw_poll(struct pvr2_hdw *); /* Trigger a poll to take place later at a convenient time */ +void pvr2_hdw_poll_trigger(struct pvr2_hdw *); void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *); /* Register a callback used to trigger a future poll */ @@ -98,6 +99,9 @@ void pvr2_hdw_setup_poll_trigger(struct pvr2_hdw *, void (*func)(void *), void *data); +/* Get pointer to structure given unit number */ +struct pvr2_hdw *pvr2_hdw_find(int unit_number); + /* Destroy hardware interaction structure */ void pvr2_hdw_destroy(struct pvr2_hdw *); @@ -176,6 +180,12 @@ int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std, void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw, unsigned long msk,unsigned long val); +/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,msk) */ +void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk); + +/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,0) */ +void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk); + /* Retrieve mask indicating which pieces of hardware are currently enabled / configured. */ unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *); @@ -215,18 +225,34 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,int); /* The following entry points are all lower level things you normally don't want to worry about. */ +/* Attempt to recover from a USB foul-up (in practice I find that if you + have to do this, then it's already too late). */ +void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw); + /* Issue a command and get a response from the device. LOTS of higher level stuff is built on this. */ int pvr2_send_request(struct pvr2_hdw *, void *write_ptr,unsigned int write_len, void *read_ptr,unsigned int read_len); +/* Issue a command and get a response from the device. This extended + version includes a probe flag (which if set means that device errors + should not be logged or treated as fatal) and a timeout in jiffies. + This can be used to non-lethally probe the health of endpoint 1. */ +int pvr2_send_request_ex(struct pvr2_hdw *,unsigned int timeout,int probe_fl, + void *write_ptr,unsigned int write_len, + void *read_ptr,unsigned int read_len); + /* Slightly higher level device communication functions. */ int pvr2_write_register(struct pvr2_hdw *, u16, u32); +int pvr2_read_register(struct pvr2_hdw *, u16, u32 *); +int pvr2_write_u16(struct pvr2_hdw *, u16, int); +int pvr2_write_u8(struct pvr2_hdw *, u8, int); /* Call if for any reason we can't talk to the hardware anymore - this will cause the driver to stop flailing on the device. */ void pvr2_hdw_render_useless(struct pvr2_hdw *); +void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *); /* Set / clear 8051's reset bit */ void pvr2_hdw_cpureset_assert(struct pvr2_hdw *,int); @@ -245,6 +271,12 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *); /* Order decoder to reset */ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); +/* Stop / start video stream transport */ +int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl); + +/* Find I2C address of eeprom */ +int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *); + /* Direct manipulation of GPIO bits */ int pvr2_hdw_gpio_get_dir(struct pvr2_hdw *hdw,u32 *); int pvr2_hdw_gpio_get_out(struct pvr2_hdw *hdw,u32 *); diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c index fbe6039aeb6a..1dd4f6249b99 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c @@ -25,6 +25,7 @@ #include "pvrusb2-i2c-cmd-v4l2.h" #include "pvrusb2-audio.h" #include "pvrusb2-tuner.h" +#include "pvrusb2-demod.h" #include "pvrusb2-video-v4l.h" #ifdef CONFIG_VIDEO_PVRUSB2_24XXX #include "pvrusb2-cx2584x-v4l.h" @@ -88,6 +89,11 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) return; } } + if (id == I2C_DRIVERID_TDA9887) { + if (pvr2_i2c_demod_setup(hdw,cp)) { + return; + } + } } diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c index 8a9933dec912..9f81aff2b38a 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c @@ -196,7 +196,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size = { static void do_log(struct pvr2_hdw *hdw) { pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 do_log()"); - pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,NULL); + pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,0); } @@ -217,7 +217,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log = { void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl) { pvr2_i2c_client_cmd(cp, - (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),NULL); + (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),0); } diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index 7fca47982277..c8d0bdee3ff1 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -37,10 +37,6 @@ static unsigned int i2c_scan = 0; module_param(i2c_scan, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); -static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, - unsigned int detail, - char *buf,unsigned int maxlen); - static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ u8 i2c_addr, /* I2C address we're talking to */ u8 *data, /* Data to write */ @@ -169,12 +165,12 @@ static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */ /* This is the common low level entry point for doing I2C operations to the hardware. */ -static int pvr2_i2c_basic_op(struct pvr2_hdw *hdw, - u8 i2c_addr, - u8 *wdata, - u16 wlen, - u8 *rdata, - u16 rlen) +int pvr2_i2c_basic_op(struct pvr2_hdw *hdw, + u8 i2c_addr, + u8 *wdata, + u16 wlen, + u8 *rdata, + u16 rlen) { if (!rdata) rlen = 0; if (!wdata) wlen = 0; @@ -271,7 +267,7 @@ static int i2c_hack_cx25840(struct pvr2_hdw *hdw, "WARNING: Disabling further access to the device" " to prevent other foul-ups."); // This blocks all further communication with the part. - hdw->i2c_func[0x44] = NULL; + hdw->i2c_func[0x44] = 0; pvr2_hdw_render_useless(hdw); goto fail; } @@ -298,7 +294,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, int num) { int ret = -ENOTSUPP; - pvr2_i2c_func funcp = NULL; + pvr2_i2c_func funcp = 0; struct pvr2_hdw *hdw = (struct pvr2_hdw *)(i2c_adap->algo_data); if (!num) { @@ -323,7 +319,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, u16 tcnt,bcnt,offs; if (!msgs[0].len) { /* Length == 0 read. This is a probe. */ - if (funcp(hdw,msgs[0].addr,NULL,0,NULL,0)) { + if (funcp(hdw,msgs[0].addr,0,0,0,0)) { ret = -EIO; goto done; } @@ -340,7 +336,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, if (bcnt > sizeof(hdw->cmd_buffer)-1) { bcnt = sizeof(hdw->cmd_buffer)-1; } - if (funcp(hdw,msgs[0].addr,NULL,0, + if (funcp(hdw,msgs[0].addr,0,0, msgs[0].buf+offs,bcnt)) { ret = -EIO; goto done; @@ -354,7 +350,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, /* Simple write */ ret = 1; if (funcp(hdw,msgs[0].addr, - msgs[0].buf,msgs[0].len,NULL,0)) { + msgs[0].buf,msgs[0].len,0,0)) { ret = -EIO; } goto done; @@ -709,9 +705,9 @@ int pvr2_i2c_core_check_stale(struct pvr2_hdw *hdw) return (hdw->i2c_pend_types & PVR2_I2C_PEND_ALL) != 0; } -static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, - unsigned int detail, - char *buf,unsigned int maxlen) +unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, + unsigned int detail, + char *buf,unsigned int maxlen) { unsigned int ccnt,bcnt; int spcfl = 0; @@ -875,7 +871,7 @@ static void do_i2c_scan(struct pvr2_hdw *hdw) msg[0].addr = 0; msg[0].flags = I2C_M_RD; msg[0].len = 0; - msg[0].buf = NULL; + msg[0].buf = 0; printk("%s: i2c scan beginning\n",hdw->name); for (i = 0; i < 128; i++) { msg[0].addr = i; diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h index 6d7e25247576..e8af5b0ed3ce 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h @@ -75,6 +75,9 @@ unsigned int pvr2_i2c_report(struct pvr2_hdw *,char *buf,unsigned int maxlen); PVR2_I2C_DETAIL_DEBUG |\ PVR2_I2C_DETAIL_HANDLER |\ PVR2_I2C_DETAIL_CTLMASK) +unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *, + unsigned int detail_mask, + char *buf,unsigned int maxlen); void pvr2_i2c_probe(struct pvr2_hdw *,struct pvr2_i2c_client *); const struct pvr2_i2c_op *pvr2_i2c_get_op(unsigned int idx); diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-io.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-io.c index 681f79c8064e..a984c91f571c 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-io.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-io.c @@ -93,7 +93,7 @@ struct pvr2_buffer { struct urb *purb; }; -static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) +const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) { switch (st) { case pvr2_buffer_state_none: return "none"; @@ -104,8 +104,7 @@ static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) return "unknown"; } -#ifdef SANITY_CHECK_BUFFERS -static void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) +void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) { pvr2_trace(PVR2_TRACE_INFO, "buffer%s%s %p state=%s id=%d status=%d" @@ -116,11 +115,10 @@ static void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) (bp ? pvr2_buffer_state_decode(bp->state) : "(invalid)"), (bp ? bp->id : 0), (bp ? bp->status : 0), - (bp ? bp->stream : NULL), - (bp ? bp->purb : NULL), + (bp ? bp->stream : 0), + (bp ? bp->purb : 0), (bp ? bp->signature : 0)); } -#endif /* SANITY_CHECK_BUFFERS */ static void pvr2_buffer_remove(struct pvr2_buffer *bp) { @@ -286,7 +284,7 @@ static void pvr2_buffer_done(struct pvr2_buffer *bp) pvr2_buffer_wipe(bp); pvr2_buffer_set_none(bp); bp->signature = 0; - bp->stream = NULL; + bp->stream = 0; if (bp->purb) usb_free_urb(bp->purb); pvr2_trace(PVR2_TRACE_BUF_POOL,"/*---TRACE_FLOW---*/" " bufferDone %p",bp); @@ -341,13 +339,13 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp,unsigned int cnt) struct pvr2_buffer *bp; bp = sp->buffers[sp->buffer_total_count - 1]; /* Paranoia */ - sp->buffers[sp->buffer_total_count - 1] = NULL; + sp->buffers[sp->buffer_total_count - 1] = 0; (sp->buffer_total_count)--; pvr2_buffer_done(bp); kfree(bp); } if (scnt < sp->buffer_slot_count) { - struct pvr2_buffer **nb = NULL; + struct pvr2_buffer **nb = 0; if (scnt) { nb = kmalloc(scnt * sizeof(*nb),GFP_KERNEL); if (!nb) return -ENOMEM; @@ -515,6 +513,10 @@ void pvr2_stream_set_callback(struct pvr2_stream *sp, } /* Query / set the nominal buffer count */ +int pvr2_stream_get_buffer_count(struct pvr2_stream *sp) +{ + return sp->buffer_target_count; +} int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) { @@ -530,21 +532,21 @@ int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) struct pvr2_buffer *pvr2_stream_get_idle_buffer(struct pvr2_stream *sp) { struct list_head *lp = sp->idle_list.next; - if (lp == &sp->idle_list) return NULL; + if (lp == &sp->idle_list) return 0; return list_entry(lp,struct pvr2_buffer,list_overhead); } struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *sp) { struct list_head *lp = sp->ready_list.next; - if (lp == &sp->ready_list) return NULL; + if (lp == &sp->ready_list) return 0; return list_entry(lp,struct pvr2_buffer,list_overhead); } struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id) { - if (id < 0) return NULL; - if (id >= sp->buffer_total_count) return NULL; + if (id < 0) return 0; + if (id >= sp->buffer_total_count) return 0; return sp->buffers[id]; } @@ -553,6 +555,17 @@ int pvr2_stream_get_ready_count(struct pvr2_stream *sp) return sp->r_count; } +int pvr2_stream_get_idle_count(struct pvr2_stream *sp) +{ + return sp->i_count; +} + +void pvr2_stream_flush(struct pvr2_stream *sp) +{ + mutex_lock(&sp->mutex); do { + pvr2_stream_internal_flush(sp); + } while(0); mutex_unlock(&sp->mutex); +} void pvr2_stream_kill(struct pvr2_stream *sp) { @@ -607,6 +620,20 @@ int pvr2_buffer_queue(struct pvr2_buffer *bp) return ret; } +int pvr2_buffer_idle(struct pvr2_buffer *bp) +{ + struct pvr2_stream *sp; + if (!bp) return -EINVAL; + sp = bp->stream; + mutex_lock(&sp->mutex); do { + pvr2_buffer_wipe(bp); + pvr2_buffer_set_idle(bp); + if (sp->buffer_total_count != sp->buffer_target_count) { + pvr2_stream_achieve_buffer_count(sp); + } + } while(0); mutex_unlock(&sp->mutex); + return 0; +} int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt) { @@ -646,6 +673,10 @@ int pvr2_buffer_get_status(struct pvr2_buffer *bp) return bp->status; } +enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *bp) +{ + return bp->state; +} int pvr2_buffer_get_id(struct pvr2_buffer *bp) { diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-io.h b/trunk/drivers/media/video/pvrusb2/pvrusb2-io.h index 96285ad234a6..65e11385b2b3 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-io.h +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-io.h @@ -36,6 +36,8 @@ enum pvr2_buffer_state { struct pvr2_stream; struct pvr2_buffer; +const char *pvr2_buffer_state_decode(enum pvr2_buffer_state); + /* Initialize / tear down stream structure */ struct pvr2_stream *pvr2_stream_create(void); void pvr2_stream_destroy(struct pvr2_stream *); @@ -47,6 +49,7 @@ void pvr2_stream_set_callback(struct pvr2_stream *, void *data); /* Query / set the nominal buffer count */ +int pvr2_stream_get_buffer_count(struct pvr2_stream *); int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int); /* Get a pointer to a buffer that is either idle, ready, or is specified @@ -56,8 +59,12 @@ struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *); struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id); /* Find out how many buffers are idle or ready */ +int pvr2_stream_get_idle_count(struct pvr2_stream *); int pvr2_stream_get_ready_count(struct pvr2_stream *); +/* Kill all pending operations */ +void pvr2_stream_flush(struct pvr2_stream *); + /* Kill all pending buffers and throw away any ready buffers as well */ void pvr2_stream_kill(struct pvr2_stream *); @@ -70,12 +77,18 @@ unsigned int pvr2_buffer_get_count(struct pvr2_buffer *); /* Retrieve completion code for given ready buffer */ int pvr2_buffer_get_status(struct pvr2_buffer *); +/* Retrieve state of given buffer */ +enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *); + /* Retrieve ID of given buffer */ int pvr2_buffer_get_id(struct pvr2_buffer *); /* Start reading into given buffer (kill it if needed) */ int pvr2_buffer_queue(struct pvr2_buffer *); +/* Move buffer back to idle pool (kill it if needed) */ +int pvr2_buffer_idle(struct pvr2_buffer *); + #endif /* __PVRUSB2_IO_H */ /* diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-ioread.c index f7a2e225a002..49da062e3271 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-ioread.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-ioread.c @@ -54,7 +54,7 @@ static int pvr2_ioread_init(struct pvr2_ioread *cp) { unsigned int idx; - cp->stream = NULL; + cp->stream = 0; mutex_init(&cp->mutex); for (idx = 0; idx < BUFFER_COUNT; idx++) { @@ -77,7 +77,7 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp) { unsigned int idx; - pvr2_ioread_setup(cp,NULL); + pvr2_ioread_setup(cp,0); for (idx = 0; idx < BUFFER_COUNT; idx++) { if (!(cp->buffer_storage[idx])) continue; kfree(cp->buffer_storage[idx]); @@ -88,12 +88,12 @@ struct pvr2_ioread *pvr2_ioread_create(void) { struct pvr2_ioread *cp; cp = kmalloc(sizeof(*cp),GFP_KERNEL); - if (!cp) return NULL; + if (!cp) return 0; pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp); memset(cp,0,sizeof(*cp)); if (pvr2_ioread_init(cp) < 0) { kfree(cp); - return NULL; + return 0; } return cp; } @@ -105,7 +105,7 @@ void pvr2_ioread_destroy(struct pvr2_ioread *cp) pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_destroy id=%p",cp); if (cp->sync_key_ptr) { kfree(cp->sync_key_ptr); - cp->sync_key_ptr = NULL; + cp->sync_key_ptr = 0; } kfree(cp); } @@ -124,7 +124,7 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *cp, if (sync_key_len != cp->sync_key_len) { if (cp->sync_key_ptr) { kfree(cp->sync_key_ptr); - cp->sync_key_ptr = NULL; + cp->sync_key_ptr = 0; } cp->sync_key_len = 0; if (sync_key_len) { @@ -144,8 +144,8 @@ static void pvr2_ioread_stop(struct pvr2_ioread *cp) pvr2_trace(PVR2_TRACE_START_STOP, "/*---TRACE_READ---*/ pvr2_ioread_stop id=%p",cp); pvr2_stream_kill(cp->stream); - cp->c_buf = NULL; - cp->c_data_ptr = NULL; + cp->c_buf = 0; + cp->c_data_ptr = 0; cp->c_data_len = 0; cp->c_data_offs = 0; cp->enabled = 0; @@ -179,8 +179,8 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp) } } cp->enabled = !0; - cp->c_buf = NULL; - cp->c_data_ptr = NULL; + cp->c_buf = 0; + cp->c_data_ptr = 0; cp->c_data_len = 0; cp->c_data_offs = 0; cp->stream_running = 0; @@ -214,7 +214,7 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp) pvr2_ioread_stop(cp); pvr2_stream_kill(cp->stream); pvr2_stream_set_buffer_count(cp->stream,0); - cp->stream = NULL; + cp->stream = 0; } if (sp) { pvr2_trace(PVR2_TRACE_START_STOP, @@ -251,8 +251,12 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl) return ret; } +int pvr2_ioread_get_enabled(struct pvr2_ioread *cp) +{ + return cp->enabled != 0; +} -static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) +int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) { int stat; @@ -270,8 +274,8 @@ static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) pvr2_ioread_stop(cp); return 0; } - cp->c_buf = NULL; - cp->c_data_ptr = NULL; + cp->c_buf = 0; + cp->c_data_ptr = 0; cp->c_data_len = 0; cp->c_data_offs = 0; } @@ -303,7 +307,7 @@ static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) return !0; } -static void pvr2_ioread_filter(struct pvr2_ioread *cp) +void pvr2_ioread_filter(struct pvr2_ioread *cp) { unsigned int idx; if (!cp->enabled) return; diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-ioread.h b/trunk/drivers/media/video/pvrusb2/pvrusb2-ioread.h index 1d362f833588..6b002597f5de 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-ioread.h +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-ioread.h @@ -33,6 +33,7 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *, const char *sync_key_ptr, unsigned int sync_key_len); int pvr2_ioread_set_enabled(struct pvr2_ioread *,int fl); +int pvr2_ioread_get_enabled(struct pvr2_ioread *); int pvr2_ioread_read(struct pvr2_ioread *,void __user *buf,unsigned int cnt); int pvr2_ioread_avail(struct pvr2_ioread *); diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-main.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-main.c index 8f1a5afdd34e..b95248274ed0 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-main.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-main.c @@ -54,7 +54,7 @@ module_param_named(debug,pvrusb2_debug,int,S_IRUGO|S_IWUSR); MODULE_PARM_DESC(debug, "Debug trace mask"); #ifdef CONFIG_VIDEO_PVRUSB2_SYSFS -static struct pvr2_sysfs_class *class_ptr = NULL; +static struct pvr2_sysfs_class *class_ptr = 0; #endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */ static void pvr_setup_attach(struct pvr2_context *pvr) @@ -104,10 +104,10 @@ static void pvr_disconnect(struct usb_interface *intf) } static struct usb_driver pvr_driver = { - .name = "pvrusb2", - .id_table = pvr2_device_table, - .probe = pvr_probe, - .disconnect = pvr_disconnect + name: "pvrusb2", + id_table: pvr2_device_table, + probe: pvr_probe, + disconnect: pvr_disconnect }; /* diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-std.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-std.c index f95c598ff627..134063693643 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-std.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-std.c @@ -121,7 +121,7 @@ static const struct std_name *find_std_name(const struct std_name *arrPtr, if (strlen(p->name) != bufSize) continue; if (!memcmp(bufPtr,p->name,bufSize)) return p; } - return NULL; + return 0; } @@ -289,7 +289,7 @@ static struct v4l2_standard *match_std(v4l2_std_id id) return generic_standards + idx; } } - return NULL; + return 0; } static int pvr2_std_fill(struct v4l2_standard *std,v4l2_std_id id) @@ -364,7 +364,7 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr, pvr2_trace(PVR2_TRACE_INIT,"Setting up %u unique standard(s)", std_cnt); - if (!std_cnt) return NULL; // paranoia + if (!std_cnt) return 0; // paranoia stddefs = kmalloc(sizeof(struct v4l2_standard) * std_cnt, GFP_KERNEL); diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 6af55a8b6f05..c6e6523d74b4 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -504,7 +504,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id) cip->cptr = cptr; cip->chptr = sfp; - cip->item_next = NULL; + cip->item_next = 0; if (sfp->item_last) { sfp->item_last->item_next = cip; } else { @@ -625,7 +625,7 @@ static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp) &sfp->debugifc->attr_debuginfo); class_device_remove_file(sfp->class_dev,&sfp->debugifc->attr_debugcmd); kfree(sfp->debugifc); - sfp->debugifc = NULL; + sfp->debugifc = 0; } #endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */ @@ -678,9 +678,9 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp) class_device_remove_file(sfp->class_dev,&sfp->attr_v4l_minor_number); class_device_remove_file(sfp->class_dev,&sfp->attr_unit_number); pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); - sfp->class_dev->class_data = NULL; + sfp->class_dev->class_data = 0; class_device_unregister(sfp->class_dev); - sfp->class_dev = NULL; + sfp->class_dev = 0; } @@ -739,13 +739,13 @@ static void class_dev_create(struct pvr2_sysfs *sfp, sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; sfp->attr_v4l_minor_number.show = v4l_minor_number_show; - sfp->attr_v4l_minor_number.store = NULL; + sfp->attr_v4l_minor_number.store = 0; class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number); sfp->attr_unit_number.attr.owner = THIS_MODULE; sfp->attr_unit_number.attr.name = "unit_number"; sfp->attr_unit_number.attr.mode = S_IRUGO; sfp->attr_unit_number.show = unit_number_show; - sfp->attr_unit_number.store = NULL; + sfp->attr_unit_number.store = 0; class_device_create_file(sfp->class_dev,&sfp->attr_unit_number); pvr2_sysfs_add_controls(sfp); @@ -806,7 +806,7 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) pvr2_sysfs_trace( "Registration failed for pvr2_sysfs_class id=%p",clp); kfree(clp); - clp = NULL; + clp = 0; } return clp; } diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-tuner.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-tuner.c index af9f246f8d3f..f4aba8144ce0 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-tuner.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-tuner.c @@ -69,7 +69,7 @@ static void tuner_update(struct pvr2_tuner_handler *ctxt) static void pvr2_tuner_detach(struct pvr2_tuner_handler *ctxt) { - ctxt->client->handler = NULL; + ctxt->client->handler = 0; kfree(ctxt); } diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 0caf70b8c0de..961951010c27 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -81,7 +81,7 @@ static int video_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1}; module_param_array(video_nr, int, NULL, 0444); MODULE_PARM_DESC(video_nr, "Offset for device's minor"); -static struct v4l2_capability pvr_capability ={ +struct v4l2_capability pvr_capability ={ .driver = "pvrusb2", .card = "Hauppauge WinTV pvr-usb2", .bus_info = "usb", @@ -111,7 +111,7 @@ static struct v4l2_tuner pvr_v4l2_tuners[]= { } }; -static struct v4l2_fmtdesc pvr_fmtdesc [] = { +struct v4l2_fmtdesc pvr_fmtdesc [] = { { .index = 0, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, @@ -127,7 +127,7 @@ static struct v4l2_fmtdesc pvr_fmtdesc [] = { #define PVR_FORMAT_PIX 0 #define PVR_FORMAT_VBI 1 -static struct v4l2_format pvr_format [] = { +struct v4l2_format pvr_format [] = { [PVR_FORMAT_PIX] = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, .fmt = { @@ -701,8 +701,9 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip) { - printk(KERN_INFO "pvrusb2: unregistering device video%d [%s]\n", - dip->vdev->minor,pvr2_config_get_name(dip->config)); + pvr2_trace(PVR2_TRACE_INIT, + "unregistering device video%d [%s]", + dip->vdev->minor,pvr2_config_get_name(dip->config)); if (dip->ctxt_idx >= 0) { mutex_lock(&device_lock); devices[dip->ctxt_idx] = NULL; @@ -724,7 +725,7 @@ static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp) } -static void pvr2_v4l2_internal_check(struct pvr2_channel *chp) +void pvr2_v4l2_internal_check(struct pvr2_channel *chp) { struct pvr2_v4l2 *vp; vp = container_of(chp,struct pvr2_v4l2,channel); @@ -734,8 +735,8 @@ static void pvr2_v4l2_internal_check(struct pvr2_channel *chp) } -static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) +int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { /* Temporary hack : use ivtv api until a v4l2 one is available. */ @@ -746,7 +747,7 @@ static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, } -static int pvr2_v4l2_release(struct inode *inode, struct file *file) +int pvr2_v4l2_release(struct inode *inode, struct file *file) { struct pvr2_v4l2_fh *fhp = file->private_data; struct pvr2_v4l2 *vp = fhp->vhead; @@ -760,9 +761,9 @@ static int pvr2_v4l2_release(struct inode *inode, struct file *file) hdw = fhp->channel.mc_head->hdw; pvr2_hdw_set_streaming(hdw,0); sp = pvr2_ioread_get_stream(fhp->rhp); - if (sp) pvr2_stream_set_callback(sp,NULL,NULL); + if (sp) pvr2_stream_set_callback(sp,0,0); pvr2_ioread_destroy(fhp->rhp); - fhp->rhp = NULL; + fhp->rhp = 0; } v4l2_prio_close(&vp->prio, &fhp->prio); file->private_data = NULL; @@ -778,9 +779,9 @@ static int pvr2_v4l2_release(struct inode *inode, struct file *file) } else { vp->vfirst = fhp->vnext; } - fhp->vnext = NULL; - fhp->vprev = NULL; - fhp->vhead = NULL; + fhp->vnext = 0; + fhp->vprev = 0; + fhp->vhead = 0; pvr2_channel_done(&fhp->channel); pvr2_trace(PVR2_TRACE_STRUCT, "Destroying pvr_v4l2_fh id=%p",fhp); @@ -793,9 +794,9 @@ static int pvr2_v4l2_release(struct inode *inode, struct file *file) } -static int pvr2_v4l2_open(struct inode *inode, struct file *file) +int pvr2_v4l2_open(struct inode *inode, struct file *file) { - struct pvr2_v4l2_dev *dip = NULL; /* Our own context pointer */ + struct pvr2_v4l2_dev *dip = 0; /* Our own context pointer */ struct pvr2_v4l2_fh *fhp; struct pvr2_v4l2 *vp; struct pvr2_hdw *hdw; @@ -853,7 +854,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file) pvr2_context_enter(vp->channel.mc_head); do { pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_v4l2_fh id=%p",fhp); pvr2_channel_init(&fhp->channel,vp->channel.mc_head); - fhp->vnext = NULL; + fhp->vnext = 0; fhp->vprev = vp->vlast; if (vp->vlast) { vp->vlast->vnext = fhp; @@ -896,7 +897,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh) fh->rhp = pvr2_channel_create_mpeg_stream(fh->dev_info->stream); if (!fh->rhp) { - pvr2_channel_claim_stream(&fh->channel,NULL); + pvr2_channel_claim_stream(&fh->channel,0); return -ENOMEM; } @@ -1077,8 +1078,9 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, (video_register_device(dip->vdev, v4l_type, -1) < 0)) { err("Failed to register pvrusb2 v4l video device"); } else { - printk(KERN_INFO "pvrusb2: registered device video%d [%s]\n", - dip->vdev->minor,pvr2_config_get_name(dip->config)); + pvr2_trace(PVR2_TRACE_INIT, + "registered device video%d [%s]", + dip->vdev->minor,pvr2_config_get_name(dip->config)); } if ((dip->vdev->minor < sizeof(devices)/sizeof(devices[0])) && diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c index 05f2cddeb47b..e4ec7f25194c 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c @@ -126,8 +126,8 @@ static const struct pvr2_v4l_decoder_ops decoder_ops[] = { static void decoder_detach(struct pvr2_v4l_decoder *ctxt) { - ctxt->client->handler = NULL; - ctxt->hdw->decoder_ctrl = NULL; + ctxt->client->handler = 0; + ctxt->hdw->decoder_ctrl = 0; kfree(ctxt); } diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-wm8775.c index 2413e5198e16..fcad346e3955 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-wm8775.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-wm8775.c @@ -89,7 +89,7 @@ static unsigned int wm8775_describe(struct pvr2_v4l_wm8775 *ctxt, static void wm8775_detach(struct pvr2_v4l_wm8775 *ctxt) { - ctxt->client->handler = NULL; + ctxt->client->handler = 0; kfree(ctxt); } diff --git a/trunk/drivers/media/video/pwc/pwc-uncompress.h b/trunk/drivers/media/video/pwc/pwc-uncompress.h index 43028e74e9e0..041227f65246 100644 --- a/trunk/drivers/media/video/pwc/pwc-uncompress.h +++ b/trunk/drivers/media/video/pwc/pwc-uncompress.h @@ -30,6 +30,7 @@ #ifndef PWC_UNCOMPRESS_H #define PWC_UNCOMPRESS_H +#include #include diff --git a/trunk/drivers/media/video/pwc/pwc.h b/trunk/drivers/media/video/pwc/pwc.h index 7e9c4237d1e8..629f79e44fb6 100644 --- a/trunk/drivers/media/video/pwc/pwc.h +++ b/trunk/drivers/media/video/pwc/pwc.h @@ -25,6 +25,7 @@ #ifndef PWC_H #define PWC_H +#include #include #include #include diff --git a/trunk/drivers/media/video/saa7134/saa7134-alsa.c b/trunk/drivers/media/video/saa7134/saa7134-alsa.c index f1fd69e7f119..d77e6a8d9432 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-alsa.c +++ b/trunk/drivers/media/video/saa7134/saa7134-alsa.c @@ -929,7 +929,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) err = request_irq(dev->pci->irq, saa7134_alsa_irq, - IRQF_SHARED | IRQF_DISABLED, dev->name, + SA_SHIRQ | SA_INTERRUPT, dev->name, (void*) &dev->dmasound); if (err < 0) { diff --git a/trunk/drivers/media/video/saa7134/saa7134-core.c b/trunk/drivers/media/video/saa7134/saa7134-core.c index 6e97cc84ba89..da3007d2f411 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-core.c +++ b/trunk/drivers/media/video/saa7134/saa7134-core.c @@ -20,6 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -923,7 +924,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, /* get irq */ err = request_irq(pci_dev->irq, saa7134_irq, - IRQF_SHARED | IRQF_DISABLED, dev->name, dev); + SA_SHIRQ | SA_INTERRUPT, dev->name, dev); if (err < 0) { printk(KERN_ERR "%s: can't get IRQ %d\n", dev->name,pci_dev->irq); @@ -941,6 +942,8 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, /* load i2c helpers */ if (TUNER_ABSENT != dev->tuner_type) request_module("tuner"); + if (dev->tda9887_conf) + request_module("tda9887"); if (card_is_empress(dev)) { request_module("saa6752hs"); request_module_depend("saa7134-empress",&need_empress); diff --git a/trunk/drivers/media/video/saa7134/saa7134-oss.c b/trunk/drivers/media/video/saa7134/saa7134-oss.c index 3895d05804ae..7aa02b34e012 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-oss.c +++ b/trunk/drivers/media/video/saa7134/saa7134-oss.c @@ -845,7 +845,7 @@ int saa7134_oss_init1(struct saa7134_dev *dev) { if ((request_irq(dev->pci->irq, saa7134_oss_irq, - IRQF_SHARED | IRQF_DISABLED, dev->name, + SA_SHIRQ | SA_INTERRUPT, dev->name, (void*) &dev->dmasound)) < 0) return -1; diff --git a/trunk/drivers/media/video/se401.c b/trunk/drivers/media/video/se401.c index 67987baee77a..a846ebc78cd7 100644 --- a/trunk/drivers/media/video/se401.c +++ b/trunk/drivers/media/video/se401.c @@ -27,6 +27,7 @@ static const char version[] = "0.24"; +#include #include #include #include diff --git a/trunk/drivers/media/video/stradis.c b/trunk/drivers/media/video/stradis.c index b36ba9fa3a28..c18b31d9928c 100644 --- a/trunk/drivers/media/video/stradis.c +++ b/trunk/drivers/media/video/stradis.c @@ -1983,7 +1983,7 @@ static int __devinit configure_saa7146(struct pci_dev *pdev, int num) memcpy(&saa->video_dev, &saa_template, sizeof(saa_template)); saawrite(0, SAA7146_IER); /* turn off all interrupts */ - retval = request_irq(saa->irq, saa7146_irq, IRQF_SHARED | IRQF_DISABLED, + retval = request_irq(saa->irq, saa7146_irq, SA_SHIRQ | SA_INTERRUPT, "stradis", saa); if (retval == -EINVAL) dev_err(&pdev->dev, "%d: Bad irq number or handler\n", num); diff --git a/trunk/drivers/media/video/stv680.c b/trunk/drivers/media/video/stv680.c index 2ba2991a214f..351b182d921f 100644 --- a/trunk/drivers/media/video/stv680.c +++ b/trunk/drivers/media/video/stv680.c @@ -58,6 +58,7 @@ * Fixed proc entry removal bug. */ +#include #include #include #include diff --git a/trunk/drivers/media/video/tda9887.c b/trunk/drivers/media/video/tda9887.c index 8dab481d384a..2fadabf99688 100644 --- a/trunk/drivers/media/video/tda9887.c +++ b/trunk/drivers/media/video/tda9887.c @@ -590,8 +590,8 @@ int tda9887_tuner_init(struct i2c_client *c) t->set_tv_freq = tda9887_set_freq; t->set_radio_freq = tda9887_set_freq; t->standby = tda9887_standby; - t->tuner_status = tda9887_tuner_status; - t->get_afc = tda9887_get_afc; + t->tuner_status=tda9887_tuner_status; + t->get_afc=tda9887_get_afc; return 0; } diff --git a/trunk/drivers/media/video/tuner-core.c b/trunk/drivers/media/video/tuner-core.c index f7eb402d5f2b..011413cf34a8 100644 --- a/trunk/drivers/media/video/tuner-core.c +++ b/trunk/drivers/media/video/tuner-core.c @@ -416,7 +416,7 @@ static void tuner_status(struct i2c_client *client) /* ---------------------------------------------------------------------- */ -/* static vars: used only in tuner_attach and tuner_probe */ +/* static var Used only in tuner_attach and tuner_probe */ static unsigned default_mode_mask; /* During client attach, set_type is called by adapter's attach_inform callback. @@ -608,13 +608,13 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) tuner_dbg("VIDIOCSAUDIO not implemented.\n"); break; case TDA9887_SET_CONFIG: - if (t->type == TUNER_TDA9887) { - int *i = arg; + { + int *i = arg; - t->tda9887_config = *i; - set_freq(client, t->tv_freq); - } + t->tda9887_config = *i; + set_freq(client, t->tv_freq); break; + } /* --- v4l ioctls --- */ /* take care: bttv does userspace copying, we'll get a kernel pointer here... */ diff --git a/trunk/drivers/media/video/tuner-simple.c b/trunk/drivers/media/video/tuner-simple.c index d071c5cbf013..6da6f82b8c88 100644 --- a/trunk/drivers/media/video/tuner-simple.c +++ b/trunk/drivers/media/video/tuner-simple.c @@ -7,7 +7,6 @@ #include #include #include -#include static int offset = 0; module_param(offset, int, 0666); @@ -129,7 +128,6 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) u8 buffer[4]; int rc, IFPCoff, i, j; enum param_type desired_type; - struct tuner_params *params; tun = &tuners[t->type]; @@ -171,20 +169,19 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) IFPCoff,t->type); j = 0; } - params = &tun->params[j]; - for (i = 0; i < params->count; i++) { - if (freq > params->ranges[i].limit) + for (i = 0; i < tun->params[j].count; i++) { + if (freq > tun->params[j].ranges[i].limit) continue; break; } - if (i == params->count) { + if (i == tun->params[j].count) { tuner_dbg("TV frequency out of range (%d > %d)", - freq, params->ranges[i - 1].limit); - freq = params->ranges[--i].limit; + freq, tun->params[j].ranges[i - 1].limit); + freq = tun->params[j].ranges[--i].limit; } - config = params->ranges[i].config; - cb = params->ranges[i].cb; + config = tun->params[j].ranges[i].config; + cb = tun->params[j].ranges[i].cb; /* i == 0 -> VHF_LO * i == 1 -> VHF_HI * i == 2 -> UHF */ @@ -284,7 +281,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) break; } - if (params->cb_first_if_lower_freq && div < t->last_div) { + if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { buffer[0] = config; buffer[1] = cb; buffer[2] = (div>>8) & 0x7f; @@ -296,43 +293,6 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) buffer[3] = cb; } t->last_div = div; - if (params->has_tda9887) { - int config = 0; - int is_secam_l = (t->std & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)) && - !(t->std & ~(V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)); - - if (t->std == V4L2_STD_SECAM_LC) { - if (params->port1_active ^ params->port1_invert_for_secam_lc) - config |= TDA9887_PORT1_ACTIVE; - if (params->port2_active ^ params->port2_invert_for_secam_lc) - config |= TDA9887_PORT2_ACTIVE; - } - else { - if (params->port1_active) - config |= TDA9887_PORT1_ACTIVE; - if (params->port2_active) - config |= TDA9887_PORT2_ACTIVE; - } - if (params->intercarrier_mode) - config |= TDA9887_INTERCARRIER; - if (is_secam_l) { - if (i == 0 && params->default_top_secam_low) - config |= TDA9887_TOP(params->default_top_secam_low); - else if (i == 1 && params->default_top_secam_mid) - config |= TDA9887_TOP(params->default_top_secam_mid); - else if (params->default_top_secam_high) - config |= TDA9887_TOP(params->default_top_secam_high); - } - else { - if (i == 0 && params->default_top_low) - config |= TDA9887_TOP(params->default_top_low); - else if (i == 1 && params->default_top_mid) - config |= TDA9887_TOP(params->default_top_mid); - else if (params->default_top_high) - config |= TDA9887_TOP(params->default_top_high); - } - i2c_clients_command(c->adapter, TDA9887_SET_CONFIG, &config); - } tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", buffer[0],buffer[1],buffer[2],buffer[3]); @@ -379,7 +339,6 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) u16 div; int rc, j; enum param_type desired_type = TUNER_PARAM_TYPE_RADIO; - struct tuner_params *params; tun = &tuners[t->type]; @@ -393,8 +352,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) j = 0; div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */ - params = &tun->params[j]; - buffer[2] = (params->ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ + buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ switch (t->type) { case TUNER_TENA_9533_DI: @@ -426,7 +384,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) } buffer[0] = (div>>8) & 0x7f; buffer[1] = div & 0xff; - if (params->cb_first_if_lower_freq && div < t->last_div) { + if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { buffer[0] = buffer[2]; buffer[1] = buffer[3]; buffer[2] = (div>>8) & 0x7f; @@ -440,18 +398,6 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) buffer[0],buffer[1],buffer[2],buffer[3]); t->last_div = div; - if (params->has_tda9887) { - int config = 0; - if (params->port1_active && !params->port1_fm_high_sensitivity) - config |= TDA9887_PORT1_ACTIVE; - if (params->port2_active && !params->port2_fm_high_sensitivity) - config |= TDA9887_PORT2_ACTIVE; - if (params->intercarrier_mode) - config |= TDA9887_INTERCARRIER; -/* if (params->port1_set_for_fm_mono) - config &= ~TDA9887_PORT1_ACTIVE;*/ - i2c_clients_command(c->adapter, TDA9887_SET_CONFIG, &config); - } if (4 != (rc = i2c_master_send(c,buffer,4))) tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); } diff --git a/trunk/drivers/media/video/tuner-types.c b/trunk/drivers/media/video/tuner-types.c index a167e17c6dcd..9d9226cb6393 100644 --- a/trunk/drivers/media/video/tuner-types.c +++ b/trunk/drivers/media/video/tuner-types.c @@ -380,10 +380,6 @@ static struct tuner_params tuner_philips_fq1216me_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_lg_pal_ranges, .count = ARRAY_SIZE(tuner_lg_pal_ranges), - .has_tda9887 = 1, - .port1_active = 1, - .port2_active = 1, - .port2_invert_for_secam_lc = 1, }, }; @@ -546,14 +542,6 @@ static struct tuner_params tuner_fm1216me_mk3_params[] = { .ranges = tuner_fm1216me_mk3_pal_ranges, .count = ARRAY_SIZE(tuner_fm1216me_mk3_pal_ranges), .cb_first_if_lower_freq = 1, - .has_tda9887 = 1, - .port1_active = 1, - .port2_active = 1, - .port2_invert_for_secam_lc = 1, - .port1_fm_high_sensitivity = 1, - .default_top_mid = -2, - .default_top_secam_mid = -2, - .default_top_secam_high = -2, }, }; @@ -624,10 +612,6 @@ static struct tuner_params tuner_fm1236_mk3_params[] = { .ranges = tuner_fm1236_mk3_ntsc_ranges, .count = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges), .cb_first_if_lower_freq = 1, - .has_tda9887 = 1, - .port1_active = 1, - .port2_active = 1, - .port1_fm_high_sensitivity = 1, }, }; @@ -648,8 +632,6 @@ static struct tuner_params tuner_microtune_4049_fm5_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_temic_4009f_5_pal_ranges, .count = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges), - .has_tda9887 = 1, - .port1_invert_for_secam_lc = 1, }, }; @@ -666,8 +648,6 @@ static struct tuner_params tuner_panasonic_vp27_params[] = { .type = TUNER_PARAM_TYPE_NTSC, .ranges = tuner_panasonic_vp27_ntsc_ranges, .count = ARRAY_SIZE(tuner_panasonic_vp27_ntsc_ranges), - .has_tda9887 = 1, - .intercarrier_mode = 1, }, }; @@ -802,13 +782,6 @@ static struct tuner_params tuner_philips_fq1216ame_mk4_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_philips_fq12_6a___mk4_pal_ranges, .count = ARRAY_SIZE(tuner_philips_fq12_6a___mk4_pal_ranges), - .has_tda9887 = 1, - .port1_active = 1, - .port2_invert_for_secam_lc = 1, - .default_top_mid = -2, - .default_top_secam_low = -2, - .default_top_secam_mid = -2, - .default_top_secam_high = -2, }, }; @@ -897,12 +870,6 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_philips_fmd1216me_mk3_pal_ranges, .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_pal_ranges), - .has_tda9887 = 1, - .port1_active = 1, - .port2_active = 1, - .port2_fm_high_sensitivity = 1, - .port2_invert_for_secam_lc = 1, - .port1_set_for_fm_mono = 1, }, }; @@ -1038,7 +1005,6 @@ static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = { .type = TUNER_PARAM_TYPE_NTSC, .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges, .count = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges), - .has_tda9887 = 1, }, }; @@ -1071,10 +1037,6 @@ static struct tuner_params tuner_samsung_tcpg_6121p30a_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_samsung_tcpg_6121p30a_pal_ranges, .count = ARRAY_SIZE(tuner_samsung_tcpg_6121p30a_pal_ranges), - .has_tda9887 = 1, - .port1_active = 1, - .port2_active = 1, - .port2_invert_for_secam_lc = 1, }, }; diff --git a/trunk/drivers/media/video/tvaudio.c b/trunk/drivers/media/video/tvaudio.c index 936e3f746fba..c2b756107548 100644 --- a/trunk/drivers/media/video/tvaudio.c +++ b/trunk/drivers/media/video/tvaudio.c @@ -14,6 +14,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/media/video/tveeprom.c b/trunk/drivers/media/video/tveeprom.c index d95529e8e513..30f8d80ddcaa 100644 --- a/trunk/drivers/media/video/tveeprom.c +++ b/trunk/drivers/media/video/tveeprom.c @@ -73,14 +73,14 @@ static struct HAUPPAUGE_TUNER_FMT } hauppauge_tuner_fmt[] = { - { V4L2_STD_UNKNOWN, " UNKNOWN" }, - { V4L2_STD_UNKNOWN, " FM" }, - { V4L2_STD_B|V4L2_STD_GH, " PAL(B/G)" }, - { V4L2_STD_MN, " NTSC(M)" }, - { V4L2_STD_PAL_I, " PAL(I)" }, - { V4L2_STD_SECAM_L|V4L2_STD_SECAM_LC, " SECAM(L/L')" }, - { V4L2_STD_DK, " PAL(D/D1/K)" }, - { V4L2_STD_ATSC, " ATSC/DVB Digital" }, + { V4L2_STD_UNKNOWN," UNKNOWN" }, + { V4L2_STD_UNKNOWN," FM" }, + { V4L2_STD_PAL_BG, " PAL(B/G)" }, + { V4L2_STD_NTSC_M, " NTSC(M)" }, + { V4L2_STD_PAL_I, " PAL(I)" }, + { V4L2_STD_SECAM_L," SECAM(L/L')" }, + { V4L2_STD_PAL_DK, " PAL(D/D1/K)" }, + { V4L2_STD_ATSC, " ATSC/DVB Digital" }, }; /* This is the full list of possible tuners. Many thanks to Hauppauge for @@ -219,7 +219,7 @@ hauppauge_tuner[] = { TUNER_ABSENT, "Thompson DTT75105"}, { TUNER_ABSENT, "Conexant_CX24109"}, { TUNER_TCL_2002N, "TCL M2523_5N_E"}, - { TUNER_TCL_2002MB, "TCL M2523_3DB_E"}, + { TUNER_ABSENT, "TCL M2523_3DB_E"}, { TUNER_ABSENT, "Philips 8275A"}, { TUNER_ABSENT, "Microtune MT2060"}, { TUNER_ABSENT, "Philips FM1236 MK5"}, diff --git a/trunk/drivers/media/video/usbvideo/usbvideo.h b/trunk/drivers/media/video/usbvideo/usbvideo.h index 051775d4c726..49dbee5f5628 100644 --- a/trunk/drivers/media/video/usbvideo/usbvideo.h +++ b/trunk/drivers/media/video/usbvideo/usbvideo.h @@ -16,6 +16,7 @@ #ifndef usbvideo_h #define usbvideo_h +#include #include #include #include diff --git a/trunk/drivers/media/video/v4l1-compat.c b/trunk/drivers/media/video/v4l1-compat.c index d83a2c84d233..19d3c20dc7ef 100644 --- a/trunk/drivers/media/video/v4l1-compat.c +++ b/trunk/drivers/media/video/v4l1-compat.c @@ -16,6 +16,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/media/video/v4l2-common.c b/trunk/drivers/media/video/v4l2-common.c index f06dc19e504a..97f946db8597 100644 --- a/trunk/drivers/media/video/v4l2-common.c +++ b/trunk/drivers/media/video/v4l2-common.c @@ -44,6 +44,7 @@ * Added Gerd Knorrs v4l1 enhancements (Justin Schoeman) */ +#include #include #include #include diff --git a/trunk/drivers/media/video/videocodec.c b/trunk/drivers/media/video/videocodec.c index 2ae3fb250630..8f271de57fd6 100644 --- a/trunk/drivers/media/video/videocodec.c +++ b/trunk/drivers/media/video/videocodec.c @@ -36,6 +36,7 @@ #include // kernel config is here (procfs flag) +#include #ifdef CONFIG_PROC_FS #include diff --git a/trunk/drivers/media/video/videocodec.h b/trunk/drivers/media/video/videocodec.h index 97a3bbeda505..8c233720b6a5 100644 --- a/trunk/drivers/media/video/videocodec.h +++ b/trunk/drivers/media/video/videocodec.h @@ -222,14 +222,14 @@ M zr36055[1] 0001 0000c001 00000000 (zr36050[1]) /* ========================= */ struct vfe_polarity { - unsigned int vsync_pol:1; - unsigned int hsync_pol:1; - unsigned int field_pol:1; - unsigned int blank_pol:1; - unsigned int subimg_pol:1; - unsigned int poe_pol:1; - unsigned int pvalid_pol:1; - unsigned int vclk_pol:1; + int vsync_pol:1; + int hsync_pol:1; + int field_pol:1; + int blank_pol:1; + int subimg_pol:1; + int poe_pol:1; + int pvalid_pol:1; + int vclk_pol:1; }; struct vfe_settings { diff --git a/trunk/drivers/media/video/w9968cf.h b/trunk/drivers/media/video/w9968cf.h index ec7696e8f1fa..2836b45ec206 100644 --- a/trunk/drivers/media/video/w9968cf.h +++ b/trunk/drivers/media/video/w9968cf.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/media/video/zoran_card.c b/trunk/drivers/media/video/zoran_card.c index f2249ed25273..958c1e6fc852 100644 --- a/trunk/drivers/media/video/zoran_card.c +++ b/trunk/drivers/media/video/zoran_card.c @@ -29,6 +29,7 @@ #include +#include #include #include #include @@ -1380,7 +1381,7 @@ find_zr36057 (void) result = request_irq(zr->pci_dev->irq, zoran_irq, - IRQF_SHARED | IRQF_DISABLED, + SA_SHIRQ | SA_INTERRUPT, ZR_DEVNAME(zr), (void *) zr); if (result < 0) { diff --git a/trunk/drivers/media/video/zoran_device.c b/trunk/drivers/media/video/zoran_device.c index 3cbac2e8aed3..02168d9c2187 100644 --- a/trunk/drivers/media/video/zoran_device.c +++ b/trunk/drivers/media/video/zoran_device.c @@ -27,6 +27,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/media/video/zoran_driver.c b/trunk/drivers/media/video/zoran_driver.c index d9a5876eb386..9711f6248ef7 100644 --- a/trunk/drivers/media/video/zoran_driver.c +++ b/trunk/drivers/media/video/zoran_driver.c @@ -44,6 +44,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/media/video/zoran_procfs.c b/trunk/drivers/media/video/zoran_procfs.c index c7f6f6488360..f4ffe79bdc5b 100644 --- a/trunk/drivers/media/video/zoran_procfs.c +++ b/trunk/drivers/media/video/zoran_procfs.c @@ -27,6 +27,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/media/video/zr36120.c b/trunk/drivers/media/video/zr36120.c index 50437383ed62..6ac3b6740089 100644 --- a/trunk/drivers/media/video/zr36120.c +++ b/trunk/drivers/media/video/zr36120.c @@ -1858,7 +1858,7 @@ int __init find_zoran(void) DEBUG(printk(KERN_DEBUG "zoran: mapped-memory at 0x%p\n",ztv->zoran_mem)); result = request_irq(dev->irq, zoran_irq, - IRQF_SHARED|IRQF_DISABLED,"zoran", ztv); + SA_SHIRQ|SA_INTERRUPT,"zoran", ztv); if (result==-EINVAL) { iounmap(ztv->zoran_mem); diff --git a/trunk/drivers/media/video/zr36120_mem.c b/trunk/drivers/media/video/zr36120_mem.c index 416eaa93b8a4..c87113d6cc60 100644 --- a/trunk/drivers/media/video/zr36120_mem.c +++ b/trunk/drivers/media/video/zr36120_mem.c @@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/message/fusion/Makefile b/trunk/drivers/message/fusion/Makefile index b114236f4395..51740b346224 100644 --- a/trunk/drivers/message/fusion/Makefile +++ b/trunk/drivers/message/fusion/Makefile @@ -33,11 +33,6 @@ # For mptfc: #CFLAGS_mptfc.o += -DMPT_DEBUG_FC -# For mptsas: -#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS -#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS_WIDE - - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC obj-$(CONFIG_FUSION_SPI) += mptbase.o mptscsih.o mptspi.o diff --git a/trunk/drivers/message/fusion/lsi/fc_log.h b/trunk/drivers/message/fusion/lsi/fc_log.h new file mode 100644 index 000000000000..dc98d46f9071 --- /dev/null +++ b/trunk/drivers/message/fusion/lsi/fc_log.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2000-2001 LSI Logic Corporation. All rights reserved. + * + * NAME: fc_log.h + * SUMMARY: MPI IocLogInfo definitions for the SYMFC9xx chips + * DESCRIPTION: Contains the enumerated list of values that may be returned + * in the IOCLogInfo field of a MPI Default Reply Message. + * + * CREATION DATE: 6/02/2000 + * ID: $Id: fc_log.h,v 4.6 2001/07/26 14:41:33 sschremm Exp $ + */ + + +/* + * MpiIocLogInfo_t enum + * + * These 32 bit values are used in the IOCLogInfo field of the MPI reply + * messages. + * The value is 0xabcccccc where + * a = The type of log info as per the MPI spec. Since these codes are + * all for Fibre Channel this value will always be 2. + * b = Specifies a subclass of the firmware where + * 0 = FCP Initiator + * 1 = FCP Target + * 2 = LAN + * 3 = MPI Message Layer + * 4 = FC Link + * 5 = Context Manager + * 6 = Invalid Field Offset + * 7 = State Change Info + * all others are reserved for future use + * c = A specific value within the subclass. + * + * NOTE: Any new values should be added to the end of each subclass so that the + * codes remain consistent across firmware releases. + */ +typedef enum _MpiIocLogInfoFc +{ + MPI_IOCLOGINFO_FC_INIT_BASE = 0x20000000, + MPI_IOCLOGINFO_FC_INIT_ERROR_OUT_OF_ORDER_FRAME = 0x20000001, /* received an out of order frame - unsupported */ + MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_START_OF_FRAME = 0x20000002, /* Bad Rx Frame, bad start of frame primative */ + MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_END_OF_FRAME = 0x20000003, /* Bad Rx Frame, bad end of frame primative */ + MPI_IOCLOGINFO_FC_INIT_ERROR_OVER_RUN = 0x20000004, /* Bad Rx Frame, overrun */ + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OTHER = 0x20000005, /* Other errors caught by IOC which require retries */ + MPI_IOCLOGINFO_FC_INIT_ERROR_SUBPROC_DEAD = 0x20000006, /* Main processor could not initialize sub-processor */ + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OVERRUN = 0x20000007, /* Scatter Gather overrun */ + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_BAD_STATUS = 0x20000008, /* Receiver detected context mismatch via invalid header */ + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_UNEXPECTED_FRAME= 0x20000009, /* CtxMgr detected unsupported frame type */ + MPI_IOCLOGINFO_FC_INIT_ERROR_LINK_FAILURE = 0x2000000A, /* Link failure occurred */ + MPI_IOCLOGINFO_FC_INIT_ERROR_TX_TIMEOUT = 0x2000000B, /* Transmitter timeout error */ + + MPI_IOCLOGINFO_FC_TARGET_BASE = 0x21000000, + MPI_IOCLOGINFO_FC_TARGET_NO_PDISC = 0x21000001, /* not sent because we are waiting for a PDISC from the initiator */ + MPI_IOCLOGINFO_FC_TARGET_NO_LOGIN = 0x21000002, /* not sent because we are not logged in to the remote node */ + MPI_IOCLOGINFO_FC_TARGET_DOAR_KILLED_BY_LIP = 0x21000003, /* Data Out, Auto Response, not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_DIAR_KILLED_BY_LIP = 0x21000004, /* Data In, Auto Response, not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_DIAR_MISSING_DATA = 0x21000005, /* Data In, Auto Response, missing data frames */ + MPI_IOCLOGINFO_FC_TARGET_DONR_KILLED_BY_LIP = 0x21000006, /* Data Out, No Response, not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_WRSP_KILLED_BY_LIP = 0x21000007, /* Auto-response after a write not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_DINR_KILLED_BY_LIP = 0x21000008, /* Data In, No Response, not completed due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_DINR_MISSING_DATA = 0x21000009, /* Data In, No Response, missing data frames */ + MPI_IOCLOGINFO_FC_TARGET_MRSP_KILLED_BY_LIP = 0x2100000a, /* Manual Response not sent due to a LIP */ + MPI_IOCLOGINFO_FC_TARGET_NO_CLASS_3 = 0x2100000b, /* not sent because remote node does not support Class 3 */ + MPI_IOCLOGINFO_FC_TARGET_LOGIN_NOT_VALID = 0x2100000c, /* not sent because login to remote node not validated */ + MPI_IOCLOGINFO_FC_TARGET_FROM_OUTBOUND = 0x2100000e, /* cleared from the outbound queue after a logout */ + MPI_IOCLOGINFO_FC_TARGET_WAITING_FOR_DATA_IN = 0x2100000f, /* cleared waiting for data after a logout */ + + MPI_IOCLOGINFO_FC_LAN_BASE = 0x22000000, + MPI_IOCLOGINFO_FC_LAN_TRANS_SGL_MISSING = 0x22000001, /* Transaction Context Sgl Missing */ + MPI_IOCLOGINFO_FC_LAN_TRANS_WRONG_PLACE = 0x22000002, /* Transaction Context found before an EOB */ + MPI_IOCLOGINFO_FC_LAN_TRANS_RES_BITS_SET = 0x22000003, /* Transaction Context value has reserved bits set */ + MPI_IOCLOGINFO_FC_LAN_WRONG_SGL_FLAG = 0x22000004, /* Invalid SGL Flags */ + + MPI_IOCLOGINFO_FC_MSG_BASE = 0x23000000, + + MPI_IOCLOGINFO_FC_LINK_BASE = 0x24000000, + MPI_IOCLOGINFO_FC_LINK_LOOP_INIT_TIMEOUT = 0x24000001, /* Loop initialization timed out */ + MPI_IOCLOGINFO_FC_LINK_ALREADY_INITIALIZED = 0x24000002, /* Another system controller already initialized the loop */ + MPI_IOCLOGINFO_FC_LINK_LINK_NOT_ESTABLISHED = 0x24000003, /* Not synchronized to signal or still negotiating (possible cable problem) */ + MPI_IOCLOGINFO_FC_LINK_CRC_ERROR = 0x24000004, /* CRC check detected error on received frame */ + + MPI_IOCLOGINFO_FC_CTX_BASE = 0x25000000, + + MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET = 0x26000000, /* The lower 24 bits give the byte offset of the field in the request message that is invalid */ + MPI_IOCLOGINFO_FC_INVALID_FIELD_MAX_OFFSET = 0x26ffffff, + + MPI_IOCLOGINFO_FC_STATE_CHANGE = 0x27000000 /* The lower 24 bits give additional information concerning state change */ + +} MpiIocLogInfoFc_t; diff --git a/trunk/drivers/message/fusion/lsi/mpi.h b/trunk/drivers/message/fusion/lsi/mpi.h index 81ad77622dac..02cdc840a06b 100644 --- a/trunk/drivers/message/fusion/lsi/mpi.h +++ b/trunk/drivers/message/fusion/lsi/mpi.h @@ -6,7 +6,7 @@ * Title: MPI Message independent structures and definitions * Creation Date: July 27, 2000 * - * mpi.h Version: 01.05.11 + * mpi.h Version: 01.05.10 * * Version History * --------------- @@ -76,7 +76,6 @@ * Added EEDP IOCStatus codes. * 08-03-05 01.05.09 Bumped MPI_HEADER_VERSION_UNIT. * 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target. - * 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT. * -------------------------------------------------------------------------- */ @@ -107,7 +106,7 @@ /* Note: The major versions of 0xe0 through 0xff are reserved */ /* versioning for this MPI header set */ -#define MPI_HEADER_VERSION_UNIT (0x0D) +#define MPI_HEADER_VERSION_UNIT (0x0C) #define MPI_HEADER_VERSION_DEV (0x00) #define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI_HEADER_VERSION_UNIT_SHIFT (8) diff --git a/trunk/drivers/message/fusion/lsi/mpi_cnfg.h b/trunk/drivers/message/fusion/lsi/mpi_cnfg.h index 47e13e360c10..b1becec27e1b 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_cnfg.h +++ b/trunk/drivers/message/fusion/lsi/mpi_cnfg.h @@ -6,7 +6,7 @@ * Title: MPI Config message, structures, and Pages * Creation Date: July 27, 2000 * - * mpi_cnfg.h Version: 01.05.12 + * mpi_cnfg.h Version: 01.05.11 * * Version History * --------------- @@ -266,16 +266,6 @@ * Added postpone SATA Init bit to SAS IO Unit Page 1 * ControlFlags. * Changed LogEntry format for Log Page 0. - * 03-27-06 01.05.12 Added two new Flags defines for Manufacturing Page 4. - * Added Manufacturing Page 7. - * Added MPI_IOCPAGE2_CAP_FLAGS_RAID_64_BIT_ADDRESSING. - * Added IOC Page 6. - * Added PrevBootDeviceForm field to CONFIG_PAGE_BIOS_2. - * Added MaxLBAHigh field to RAID Volume Page 0. - * Added Nvdata version fields to SAS IO Unit Page 0. - * Added AdditionalControlFlags, MaxTargetPortConnectTime, - * ReportDeviceMissingDelay, and IODeviceMissingDelay - * fields to SAS IO Unit Page 1. * -------------------------------------------------------------------------- */ @@ -641,11 +631,9 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4 } CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; -#define MPI_MANUFACTURING4_PAGEVERSION (0x04) +#define MPI_MANUFACTURING4_PAGEVERSION (0x03) /* defines for the Flags field */ -#define MPI_MANPAGE4_FORCE_BAD_BLOCK_TABLE (0x80) -#define MPI_MANPAGE4_FORCE_OFFLINE_FAILOVER (0x40) #define MPI_MANPAGE4_IME_DISABLE (0x20) #define MPI_MANPAGE4_IM_DISABLE (0x10) #define MPI_MANPAGE4_IS_DISABLE (0x08) @@ -680,66 +668,6 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_6 #define MPI_MANUFACTURING6_PAGEVERSION (0x00) -typedef struct _MPI_MANPAGE7_CONNECTOR_INFO -{ - U32 Pinout; /* 00h */ - U8 Connector[16]; /* 04h */ - U8 Location; /* 14h */ - U8 Reserved1; /* 15h */ - U16 Slot; /* 16h */ - U32 Reserved2; /* 18h */ -} MPI_MANPAGE7_CONNECTOR_INFO, MPI_POINTER PTR_MPI_MANPAGE7_CONNECTOR_INFO, - MpiManPage7ConnectorInfo_t, MPI_POINTER pMpiManPage7ConnectorInfo_t; - -/* defines for the Pinout field */ -#define MPI_MANPAGE7_PINOUT_SFF_8484_L4 (0x00080000) -#define MPI_MANPAGE7_PINOUT_SFF_8484_L3 (0x00040000) -#define MPI_MANPAGE7_PINOUT_SFF_8484_L2 (0x00020000) -#define MPI_MANPAGE7_PINOUT_SFF_8484_L1 (0x00010000) -#define MPI_MANPAGE7_PINOUT_SFF_8470_L4 (0x00000800) -#define MPI_MANPAGE7_PINOUT_SFF_8470_L3 (0x00000400) -#define MPI_MANPAGE7_PINOUT_SFF_8470_L2 (0x00000200) -#define MPI_MANPAGE7_PINOUT_SFF_8470_L1 (0x00000100) -#define MPI_MANPAGE7_PINOUT_SFF_8482 (0x00000002) -#define MPI_MANPAGE7_PINOUT_CONNECTION_UNKNOWN (0x00000001) - -/* defines for the Location field */ -#define MPI_MANPAGE7_LOCATION_UNKNOWN (0x01) -#define MPI_MANPAGE7_LOCATION_INTERNAL (0x02) -#define MPI_MANPAGE7_LOCATION_EXTERNAL (0x04) -#define MPI_MANPAGE7_LOCATION_SWITCHABLE (0x08) -#define MPI_MANPAGE7_LOCATION_AUTO (0x10) -#define MPI_MANPAGE7_LOCATION_NOT_PRESENT (0x20) -#define MPI_MANPAGE7_LOCATION_NOT_CONNECTED (0x80) - -/* - * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check NumPhys at runtime. - */ -#ifndef MPI_MANPAGE7_CONNECTOR_INFO_MAX -#define MPI_MANPAGE7_CONNECTOR_INFO_MAX (1) -#endif - -typedef struct _CONFIG_PAGE_MANUFACTURING_7 -{ - CONFIG_PAGE_HEADER Header; /* 00h */ - U32 Reserved1; /* 04h */ - U32 Reserved2; /* 08h */ - U32 Flags; /* 0Ch */ - U8 EnclosureName[16]; /* 10h */ - U8 NumPhys; /* 20h */ - U8 Reserved3; /* 21h */ - U16 Reserved4; /* 22h */ - MPI_MANPAGE7_CONNECTOR_INFO ConnectorInfo[MPI_MANPAGE7_CONNECTOR_INFO_MAX]; /* 24h */ -} CONFIG_PAGE_MANUFACTURING_7, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_7, - ManufacturingPage7_t, MPI_POINTER pManufacturingPage7_t; - -#define MPI_MANUFACTURING7_PAGEVERSION (0x00) - -/* defines for the Flags field */ -#define MPI_MANPAGE7_FLAG_USE_SLOT_INFO (0x00000001) - - /**************************************************************************** * IO Unit Config Pages ****************************************************************************/ @@ -939,7 +867,7 @@ typedef struct _CONFIG_PAGE_IOC_2 } CONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2, IOCPage2_t, MPI_POINTER pIOCPage2_t; -#define MPI_IOCPAGE2_PAGEVERSION (0x04) +#define MPI_IOCPAGE2_PAGEVERSION (0x03) /* IOC Page 2 Capabilities flags */ @@ -950,7 +878,6 @@ typedef struct _CONFIG_PAGE_IOC_2 #define MPI_IOCPAGE2_CAP_FLAGS_RAID_6_SUPPORT (0x00000010) #define MPI_IOCPAGE2_CAP_FLAGS_RAID_10_SUPPORT (0x00000020) #define MPI_IOCPAGE2_CAP_FLAGS_RAID_50_SUPPORT (0x00000040) -#define MPI_IOCPAGE2_CAP_FLAGS_RAID_64_BIT_ADDRESSING (0x10000000) #define MPI_IOCPAGE2_CAP_FLAGS_SES_SUPPORT (0x20000000) #define MPI_IOCPAGE2_CAP_FLAGS_SAFTE_SUPPORT (0x40000000) #define MPI_IOCPAGE2_CAP_FLAGS_CROSS_CHANNEL_SUPPORT (0x80000000) @@ -1048,44 +975,6 @@ typedef struct _CONFIG_PAGE_IOC_5 #define MPI_IOCPAGE5_PAGEVERSION (0x00) -typedef struct _CONFIG_PAGE_IOC_6 -{ - CONFIG_PAGE_HEADER Header; /* 00h */ - U32 CapabilitiesFlags; /* 04h */ - U8 MaxDrivesIS; /* 08h */ - U8 MaxDrivesIM; /* 09h */ - U8 MaxDrivesIME; /* 0Ah */ - U8 Reserved1; /* 0Bh */ - U8 MinDrivesIS; /* 0Ch */ - U8 MinDrivesIM; /* 0Dh */ - U8 MinDrivesIME; /* 0Eh */ - U8 Reserved2; /* 0Fh */ - U8 MaxGlobalHotSpares; /* 10h */ - U8 Reserved3; /* 11h */ - U16 Reserved4; /* 12h */ - U32 Reserved5; /* 14h */ - U32 SupportedStripeSizeMapIS; /* 18h */ - U32 SupportedStripeSizeMapIME; /* 1Ch */ - U32 Reserved6; /* 20h */ - U8 MetadataSize; /* 24h */ - U8 Reserved7; /* 25h */ - U16 Reserved8; /* 26h */ - U16 MaxBadBlockTableEntries; /* 28h */ - U16 Reserved9; /* 2Ah */ - U16 IRNvsramUsage; /* 2Ch */ - U16 Reserved10; /* 2Eh */ - U32 IRNvsramVersion; /* 30h */ - U32 Reserved11; /* 34h */ - U32 Reserved12; /* 38h */ -} CONFIG_PAGE_IOC_6, MPI_POINTER PTR_CONFIG_PAGE_IOC_6, - IOCPage6_t, MPI_POINTER pIOCPage6_t; - -#define MPI_IOCPAGE6_PAGEVERSION (0x00) - -/* IOC Page 6 Capabilities Flags */ - -#define MPI_IOCPAGE6_CAP_FLAGS_GLOBAL_HOT_SPARE (0x00000001) - /**************************************************************************** * BIOS Config Pages @@ -1329,13 +1218,13 @@ typedef struct _CONFIG_PAGE_BIOS_2 U32 Reserved5; /* 14h */ U32 Reserved6; /* 18h */ U8 BootDeviceForm; /* 1Ch */ - U8 PrevBootDeviceForm; /* 1Ch */ + U8 Reserved7; /* 1Dh */ U16 Reserved8; /* 1Eh */ MPI_BIOSPAGE2_BOOT_DEVICE BootDevice; /* 20h */ } CONFIG_PAGE_BIOS_2, MPI_POINTER PTR_CONFIG_PAGE_BIOS_2, BIOSPage2_t, MPI_POINTER pBIOSPage2_t; -#define MPI_BIOSPAGE2_PAGEVERSION (0x02) +#define MPI_BIOSPAGE2_PAGEVERSION (0x01) #define MPI_BIOSPAGE2_FORM_MASK (0x0F) #define MPI_BIOSPAGE2_FORM_ADAPTER_ORDER (0x00) @@ -2191,7 +2080,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0 RAID_VOL0_STATUS VolumeStatus; /* 08h */ RAID_VOL0_SETTINGS VolumeSettings; /* 0Ch */ U32 MaxLBA; /* 10h */ - U32 MaxLBAHigh; /* 14h */ + U32 Reserved1; /* 14h */ U32 StripeSize; /* 18h */ U32 Reserved2; /* 1Ch */ U32 Reserved3; /* 20h */ @@ -2203,7 +2092,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0 } CONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0, RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t; -#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x06) +#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x05) /* values for RAID Volume Page 0 InactiveStatus field */ #define MPI_RAIDVOLPAGE0_UNKNOWN_INACTIVE (0x00) @@ -2435,8 +2324,7 @@ typedef struct _MPI_SAS_IO_UNIT0_PHY_DATA typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 { CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ - U16 NvdataVersionDefault; /* 08h */ - U16 NvdataVersionPersistent; /* 0Ah */ + U32 Reserved1; /* 08h */ U8 NumPhys; /* 0Ch */ U8 Reserved2; /* 0Dh */ U16 Reserved3; /* 0Eh */ @@ -2444,7 +2332,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 } CONFIG_PAGE_SAS_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_0, SasIOUnitPage0_t, MPI_POINTER pSasIOUnitPage0_t; -#define MPI_SASIOUNITPAGE0_PAGEVERSION (0x04) +#define MPI_SASIOUNITPAGE0_PAGEVERSION (0x03) /* values for SAS IO Unit Page 0 PortFlags */ #define MPI_SAS_IOUNIT0_PORT_FLAGS_DISCOVERY_IN_PROGRESS (0x08) @@ -2485,13 +2373,12 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA { - U8 Port; /* 00h */ - U8 PortFlags; /* 01h */ - U8 PhyFlags; /* 02h */ - U8 MaxMinLinkRate; /* 03h */ - U32 ControllerPhyDeviceInfo; /* 04h */ - U16 MaxTargetPortConnectTime; /* 08h */ - U16 Reserved1; /* 0Ah */ + U8 Port; /* 00h */ + U8 PortFlags; /* 01h */ + U8 PhyFlags; /* 02h */ + U8 MaxMinLinkRate; /* 03h */ + U32 ControllerPhyDeviceInfo;/* 04h */ + U32 Reserved1; /* 08h */ } MPI_SAS_IO_UNIT1_PHY_DATA, MPI_POINTER PTR_MPI_SAS_IO_UNIT1_PHY_DATA, SasIOUnit1PhyData, MPI_POINTER pSasIOUnit1PhyData; @@ -2508,17 +2395,15 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ U16 ControlFlags; /* 08h */ U16 MaxNumSATATargets; /* 0Ah */ - U16 AdditionalControlFlags; /* 0Ch */ - U16 Reserved1; /* 0Eh */ + U32 Reserved1; /* 0Ch */ U8 NumPhys; /* 10h */ U8 SATAMaxQDepth; /* 11h */ - U8 ReportDeviceMissingDelay; /* 12h */ - U8 IODeviceMissingDelay; /* 13h */ + U16 Reserved2; /* 12h */ MPI_SAS_IO_UNIT1_PHY_DATA PhyData[MPI_SAS_IOUNIT1_PHY_MAX]; /* 14h */ } CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1, SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t; -#define MPI_SASIOUNITPAGE1_PAGEVERSION (0x06) +#define MPI_SASIOUNITPAGE1_PAGEVERSION (0x05) /* values for SAS IO Unit Page 1 ControlFlags */ #define MPI_SAS_IOUNIT1_CONTROL_DEVICE_SELF_TEST (0x8000) @@ -2543,13 +2428,6 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1 #define MPI_SAS_IOUNIT1_CONTROL_FIRST_LVL_DISC_ONLY (0x0002) #define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001) -/* values for SAS IO Unit Page 1 AdditionalControlFlags */ -#define MPI_SAS_IOUNIT1_ACONTROL_ALLOW_TABLE_TO_TABLE (0x0001) - -/* defines for SAS IO Unit Page 1 ReportDeviceMissingDelay */ -#define MPI_SAS_IOUNIT1_REPORT_MISSING_TIMEOUT_MASK (0x7F) -#define MPI_SAS_IOUNIT1_REPORT_MISSING_UNIT_16 (0x80) - /* values for SAS IO Unit Page 1 PortFlags */ #define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM (0x00) #define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM (0x04) diff --git a/trunk/drivers/message/fusion/lsi/mpi_history.txt b/trunk/drivers/message/fusion/lsi/mpi_history.txt index 582cfe7c2aa1..4a5f8dd1d766 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_history.txt +++ b/trunk/drivers/message/fusion/lsi/mpi_history.txt @@ -6,25 +6,25 @@ Copyright (c) 2000-2005 LSI Logic Corporation. --------------------------------------- - Header Set Release Version: 01.05.13 - Header Set Release Date: 03-27-06 + Header Set Release Version: 01.05.12 + Header Set Release Date: 08-30-05 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi.h 01.05.11 01.05.10 - mpi_ioc.h 01.05.11 01.05.10 - mpi_cnfg.h 01.05.12 01.05.11 - mpi_init.h 01.05.07 01.05.06 - mpi_targ.h 01.05.06 01.05.05 + mpi.h 01.05.10 01.05.09 + mpi_ioc.h 01.05.10 01.05.09 + mpi_cnfg.h 01.05.11 01.05.10 + mpi_init.h 01.05.06 01.05.06 + mpi_targ.h 01.05.05 01.05.05 mpi_fc.h 01.05.01 01.05.01 mpi_lan.h 01.05.01 01.05.01 mpi_raid.h 01.05.02 01.05.02 mpi_tool.h 01.05.03 01.05.03 mpi_inb.h 01.05.01 01.05.01 - mpi_sas.h 01.05.03 01.05.02 - mpi_type.h 01.05.02 01.05.02 - mpi_history.txt 01.05.13 01.05.12 + mpi_sas.h 01.05.02 01.05.01 + mpi_type.h 01.05.02 01.05.01 + mpi_history.txt 01.05.12 01.05.11 * Date Version Description @@ -93,7 +93,6 @@ mpi.h * Added EEDP IOCStatus codes. * 08-03-05 01.05.09 Bumped MPI_HEADER_VERSION_UNIT. * 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target. - * 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT. * -------------------------------------------------------------------------- mpi_ioc.h @@ -171,17 +170,6 @@ mpi_ioc.h * Added new ReasonCode value for SAS Device Status Change * event. * Added new family code for FC949E. - * 03-27-06 01.05.11 Added MPI_IOCFACTS_CAPABILITY_TLR. - * Added additional Reason Codes and more event data fields - * to EVENT_DATA_SAS_DEVICE_STATUS_CHANGE. - * Added EVENT_DATA_SAS_BROADCAST_PRIMITIVE structure and - * new event. - * Added MPI_EVENT_SAS_SMP_ERROR and event data structure. - * Added MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE and event - * data structure. - * Added MPI_EVENT_SAS_INIT_TABLE_OVERFLOW and event - * data structure. - * Added MPI_EXT_IMAGE_TYPE_INITIALIZATION. * -------------------------------------------------------------------------- mpi_cnfg.h @@ -437,16 +425,6 @@ mpi_cnfg.h * Added postpone SATA Init bit to SAS IO Unit Page 1 * ControlFlags. * Changed LogEntry format for Log Page 0. - * 03-27-06 01.05.12 Added two new Flags defines for Manufacturing Page 4. - * Added Manufacturing Page 7. - * Added MPI_IOCPAGE2_CAP_FLAGS_RAID_64_BIT_ADDRESSING. - * Added IOC Page 6. - * Added PrevBootDeviceForm field to CONFIG_PAGE_BIOS_2. - * Added MaxLBAHigh field to RAID Volume Page 0. - * Added Nvdata version fields to SAS IO Unit Page 0. - * Added AdditionalControlFlags, MaxTargetPortConnectTime, - * ReportDeviceMissingDelay, and IODeviceMissingDelay - * fields to SAS IO Unit Page 1. * -------------------------------------------------------------------------- mpi_init.h @@ -489,7 +467,6 @@ mpi_init.h * Added four new defines for SEP SlotStatus. * 08-03-05 01.05.06 Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them * unique in the first 32 characters. - * 03-27-06 01.05.07 Added Task Management type of Clear ACA. * -------------------------------------------------------------------------- mpi_targ.h @@ -534,7 +511,6 @@ mpi_targ.h * 02-22-05 01.05.03 Changed a comment. * 03-11-05 01.05.04 Removed TargetAssistExtended Request. * 06-24-05 01.05.05 Added TargetAssistExtended structures and defines. - * 03-27-06 01.05.06 Added a comment. * -------------------------------------------------------------------------- mpi_fc.h @@ -634,10 +610,6 @@ mpi_sas.h * 08-30-05 01.05.02 Added DeviceInfo bit for SEP. * Added PrimFlags and Primitive field to SAS IO Unit * Control request, and added a new operation code. - * 03-27-06 01.05.03 Added Force Full Discovery, Transmit Port Select Signal, - * and Remove Device operations to SAS IO Unit Control. - * Added DevHandle field to SAS IO Unit Control request and - * reply. * -------------------------------------------------------------------------- mpi_type.h @@ -653,20 +625,20 @@ mpi_type.h mpi_history.txt Parts list history -Filename 01.05.13 01.05.12 01.05.11 01.05.10 01.05.09 ----------- -------- -------- -------- -------- -------- -mpi.h 01.05.11 01.05.10 01.05.09 01.05.08 01.05.07 -mpi_ioc.h 01.05.11 01.05.10 01.05.09 01.05.09 01.05.08 -mpi_cnfg.h 01.05.12 01.05.11 01.05.10 01.05.09 01.05.08 -mpi_init.h 01.05.07 01.05.06 01.05.06 01.05.05 01.05.04 -mpi_targ.h 01.05.06 01.05.05 01.05.05 01.05.05 01.05.04 -mpi_fc.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 -mpi_lan.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 -mpi_raid.h 01.05.02 01.05.02 01.05.02 01.05.02 01.05.02 -mpi_tool.h 01.05.03 01.05.03 01.05.03 01.05.03 01.05.03 -mpi_inb.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 -mpi_sas.h 01.05.03 01.05.02 01.05.01 01.05.01 01.05.01 -mpi_type.h 01.05.02 01.05.02 01.05.01 01.05.01 01.05.01 +Filename 01.05.12 01.05.11 01.05.10 01.05.09 +---------- -------- -------- -------- -------- +mpi.h 01.05.10 01.05.09 01.05.08 01.05.07 +mpi_ioc.h 01.05.10 01.05.09 01.05.09 01.05.08 +mpi_cnfg.h 01.05.11 01.05.10 01.05.09 01.05.08 +mpi_init.h 01.05.06 01.05.06 01.05.05 01.05.04 +mpi_targ.h 01.05.05 01.05.05 01.05.05 01.05.04 +mpi_fc.h 01.05.01 01.05.01 01.05.01 01.05.01 +mpi_lan.h 01.05.01 01.05.01 01.05.01 01.05.01 +mpi_raid.h 01.05.02 01.05.02 01.05.02 01.05.02 +mpi_tool.h 01.05.03 01.05.03 01.05.03 01.05.03 +mpi_inb.h 01.05.01 01.05.01 01.05.01 01.05.01 +mpi_sas.h 01.05.02 01.05.01 01.05.01 01.05.01 +mpi_type.h 01.05.02 01.05.01 01.05.01 01.05.01 Filename 01.05.08 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 ---------- -------- -------- -------- -------- -------- -------- diff --git a/trunk/drivers/message/fusion/lsi/mpi_init.h b/trunk/drivers/message/fusion/lsi/mpi_init.h index c1c678989a23..68941f459ca3 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_init.h +++ b/trunk/drivers/message/fusion/lsi/mpi_init.h @@ -6,7 +6,7 @@ * Title: MPI initiator mode messages and structures * Creation Date: June 8, 2000 * - * mpi_init.h Version: 01.05.07 + * mpi_init.h Version: 01.05.06 * * Version History * --------------- @@ -52,7 +52,6 @@ * Added four new defines for SEP SlotStatus. * 08-03-05 01.05.06 Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them * unique in the first 32 characters. - * 03-27-06 01.05.07 Added Task Management type of Clear ACA. * -------------------------------------------------------------------------- */ @@ -428,7 +427,6 @@ typedef struct _MSG_SCSI_TASK_MGMT #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) #define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06) #define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07) -#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_ACA (0x08) /* MsgFlags bits */ #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00) diff --git a/trunk/drivers/message/fusion/lsi/mpi_ioc.h b/trunk/drivers/message/fusion/lsi/mpi_ioc.h index 18ba407fd399..2c5f43fa7c73 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_ioc.h +++ b/trunk/drivers/message/fusion/lsi/mpi_ioc.h @@ -6,7 +6,7 @@ * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: August 11, 2000 * - * mpi_ioc.h Version: 01.05.11 + * mpi_ioc.h Version: 01.05.10 * * Version History * --------------- @@ -87,17 +87,6 @@ * Added new ReasonCode value for SAS Device Status Change * event. * Added new family code for FC949E. - * 03-27-06 01.05.11 Added MPI_IOCFACTS_CAPABILITY_TLR. - * Added additional Reason Codes and more event data fields - * to EVENT_DATA_SAS_DEVICE_STATUS_CHANGE. - * Added EVENT_DATA_SAS_BROADCAST_PRIMITIVE structure and - * new event. - * Added MPI_EVENT_SAS_SMP_ERROR and event data structure. - * Added MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE and event - * data structure. - * Added MPI_EVENT_SAS_INIT_TABLE_OVERFLOW and event - * data structure. - * Added MPI_EXT_IMAGE_TYPE_INITIALIZATION. * -------------------------------------------------------------------------- */ @@ -283,7 +272,6 @@ typedef struct _MSG_IOC_FACTS_REPLY #define MPI_IOCFACTS_CAPABILITY_MULTICAST (0x00000100) #define MPI_IOCFACTS_CAPABILITY_SCSIIO32 (0x00000200) #define MPI_IOCFACTS_CAPABILITY_NO_SCSIIO16 (0x00000400) -#define MPI_IOCFACTS_CAPABILITY_TLR (0x00000800) /***************************************************************************** @@ -460,34 +448,30 @@ typedef struct _MSG_EVENT_ACK_REPLY /* Event */ -#define MPI_EVENT_NONE (0x00000000) -#define MPI_EVENT_LOG_DATA (0x00000001) -#define MPI_EVENT_STATE_CHANGE (0x00000002) -#define MPI_EVENT_UNIT_ATTENTION (0x00000003) -#define MPI_EVENT_IOC_BUS_RESET (0x00000004) -#define MPI_EVENT_EXT_BUS_RESET (0x00000005) -#define MPI_EVENT_RESCAN (0x00000006) -#define MPI_EVENT_LINK_STATUS_CHANGE (0x00000007) -#define MPI_EVENT_LOOP_STATE_CHANGE (0x00000008) -#define MPI_EVENT_LOGOUT (0x00000009) -#define MPI_EVENT_EVENT_CHANGE (0x0000000A) -#define MPI_EVENT_INTEGRATED_RAID (0x0000000B) -#define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE (0x0000000C) -#define MPI_EVENT_ON_BUS_TIMER_EXPIRED (0x0000000D) -#define MPI_EVENT_QUEUE_FULL (0x0000000E) -#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0000000F) -#define MPI_EVENT_SAS_SES (0x00000010) -#define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) -#define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012) -#define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013) -#define MPI_EVENT_IR_RESYNC_UPDATE (0x00000014) -#define MPI_EVENT_IR2 (0x00000015) -#define MPI_EVENT_SAS_DISCOVERY (0x00000016) -#define MPI_EVENT_SAS_BROADCAST_PRIMITIVE (0x00000017) -#define MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE (0x00000018) -#define MPI_EVENT_SAS_INIT_TABLE_OVERFLOW (0x00000019) -#define MPI_EVENT_SAS_SMP_ERROR (0x0000001A) -#define MPI_EVENT_LOG_ENTRY_ADDED (0x00000021) +#define MPI_EVENT_NONE (0x00000000) +#define MPI_EVENT_LOG_DATA (0x00000001) +#define MPI_EVENT_STATE_CHANGE (0x00000002) +#define MPI_EVENT_UNIT_ATTENTION (0x00000003) +#define MPI_EVENT_IOC_BUS_RESET (0x00000004) +#define MPI_EVENT_EXT_BUS_RESET (0x00000005) +#define MPI_EVENT_RESCAN (0x00000006) +#define MPI_EVENT_LINK_STATUS_CHANGE (0x00000007) +#define MPI_EVENT_LOOP_STATE_CHANGE (0x00000008) +#define MPI_EVENT_LOGOUT (0x00000009) +#define MPI_EVENT_EVENT_CHANGE (0x0000000A) +#define MPI_EVENT_INTEGRATED_RAID (0x0000000B) +#define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE (0x0000000C) +#define MPI_EVENT_ON_BUS_TIMER_EXPIRED (0x0000000D) +#define MPI_EVENT_QUEUE_FULL (0x0000000E) +#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0000000F) +#define MPI_EVENT_SAS_SES (0x00000010) +#define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) +#define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012) +#define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013) +#define MPI_EVENT_IR_RESYNC_UPDATE (0x00000014) +#define MPI_EVENT_IR2 (0x00000015) +#define MPI_EVENT_SAS_DISCOVERY (0x00000016) +#define MPI_EVENT_LOG_ENTRY_ADDED (0x00000021) /* AckRequired field values */ @@ -574,25 +558,18 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE U8 PhyNum; /* 0Eh */ U8 Reserved1; /* 0Fh */ U64 SASAddress; /* 10h */ - U8 LUN[8]; /* 18h */ - U16 TaskTag; /* 20h */ - U16 Reserved2; /* 22h */ } EVENT_DATA_SAS_DEVICE_STATUS_CHANGE, MPI_POINTER PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE, MpiEventDataSasDeviceStatusChange_t, MPI_POINTER pMpiEventDataSasDeviceStatusChange_t; /* MPI SAS Device Status Change Event data ReasonCode values */ -#define MPI_EVENT_SAS_DEV_STAT_RC_ADDED (0x03) -#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING (0x04) -#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) -#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06) -#define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07) -#define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08) -#define MPI_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL (0x09) -#define MPI_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL (0x0A) -#define MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL (0x0B) -#define MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL (0x0C) +#define MPI_EVENT_SAS_DEV_STAT_RC_ADDED (0x03) +#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING (0x04) +#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) +#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06) +#define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07) +#define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08) /* SCSI Event data for Queue Full event */ @@ -765,27 +742,6 @@ typedef struct _EVENT_DATA_SAS_SES } EVENT_DATA_SAS_SES, MPI_POINTER PTR_EVENT_DATA_SAS_SES, MpiEventDataSasSes_t, MPI_POINTER pMpiEventDataSasSes_t; -/* SAS Broadcast Primitive Event data */ - -typedef struct _EVENT_DATA_SAS_BROADCAST_PRIMITIVE -{ - U8 PhyNum; /* 00h */ - U8 Port; /* 01h */ - U8 PortWidth; /* 02h */ - U8 Primitive; /* 04h */ -} EVENT_DATA_SAS_BROADCAST_PRIMITIVE, - MPI_POINTER PTR_EVENT_DATA_SAS_BROADCAST_PRIMITIVE, - MpiEventDataSasBroadcastPrimitive_t, - MPI_POINTER pMpiEventDataSasBroadcastPrimitive_t; - -#define MPI_EVENT_PRIMITIVE_CHANGE (0x01) -#define MPI_EVENT_PRIMITIVE_EXPANDER (0x03) -#define MPI_EVENT_PRIMITIVE_RESERVED2 (0x04) -#define MPI_EVENT_PRIMITIVE_RESERVED3 (0x05) -#define MPI_EVENT_PRIMITIVE_RESERVED4 (0x06) -#define MPI_EVENT_PRIMITIVE_CHANGE0_RESERVED (0x07) -#define MPI_EVENT_PRIMITIVE_CHANGE1_RESERVED (0x08) - /* SAS Phy Link Status Event data */ typedef struct _EVENT_DATA_SAS_PHY_LINK_STATUS @@ -848,53 +804,6 @@ typedef struct _EVENT_DATA_DISCOVERY_ERROR #define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_PATHS (0x00000800) #define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS (0x00001000) -/* SAS SMP Error Event data */ - -typedef struct _EVENT_DATA_SAS_SMP_ERROR -{ - U8 Status; /* 00h */ - U8 Port; /* 01h */ - U8 SMPFunctionResult; /* 02h */ - U8 Reserved1; /* 03h */ - U64 SASAddress; /* 04h */ -} EVENT_DATA_SAS_SMP_ERROR, MPI_POINTER PTR_EVENT_DATA_SAS_SMP_ERROR, - MpiEventDataSasSmpError_t, MPI_POINTER pMpiEventDataSasSmpError_t; - -/* defines for the Status field of the SAS SMP Error event */ -#define MPI_EVENT_SAS_SMP_FUNCTION_RESULT_VALID (0x00) -#define MPI_EVENT_SAS_SMP_CRC_ERROR (0x01) -#define MPI_EVENT_SAS_SMP_TIMEOUT (0x02) -#define MPI_EVENT_SAS_SMP_NO_DESTINATION (0x03) -#define MPI_EVENT_SAS_SMP_BAD_DESTINATION (0x04) - -/* SAS Initiator Device Status Change Event data */ - -typedef struct _EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE -{ - U8 ReasonCode; /* 00h */ - U8 Port; /* 01h */ - U16 DevHandle; /* 02h */ - U64 SASAddress; /* 04h */ -} EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE, - MPI_POINTER PTR_EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE, - MpiEventDataSasInitDevStatusChange_t, - MPI_POINTER pMpiEventDataSasInitDevStatusChange_t; - -/* defines for the ReasonCode field of the SAS Initiator Device Status Change event */ -#define MPI_EVENT_SAS_INIT_RC_ADDED (0x01) - -/* SAS Initiator Device Table Overflow Event data */ - -typedef struct _EVENT_DATA_SAS_INIT_TABLE_OVERFLOW -{ - U8 MaxInit; /* 00h */ - U8 CurrentInit; /* 01h */ - U16 Reserved1; /* 02h */ -} EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, - MPI_POINTER PTR_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, - MpiEventDataSasInitTableOverflow_t, - MPI_POINTER pMpiEventDataSasInitTableOverflow_t; - /***************************************************************************** * @@ -1104,6 +1013,5 @@ typedef struct _MPI_EXT_IMAGE_HEADER #define MPI_EXT_IMAGE_TYPE_FW (0x01) #define MPI_EXT_IMAGE_TYPE_NVDATA (0x03) #define MPI_EXT_IMAGE_TYPE_BOOTLOADER (0x04) -#define MPI_EXT_IMAGE_TYPE_INITIALIZATION (0x05) #endif diff --git a/trunk/drivers/message/fusion/lsi/mpi_log_sas.h b/trunk/drivers/message/fusion/lsi/mpi_log_sas.h index 871ebc08b706..a9c14ad132ce 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_log_sas.h +++ b/trunk/drivers/message/fusion/lsi/mpi_log_sas.h @@ -13,8 +13,6 @@ #ifndef IOPI_IOCLOGINFO_H_INCLUDED #define IOPI_IOCLOGINFO_H_INCLUDED -#define SAS_LOGINFO_NEXUS_LOSS 0x31170000 -#define SAS_LOGINFO_MASK 0xFFFF0000 /****************************************************************************/ /* IOC LOGINFO defines, 0x00000000 - 0x0FFFFFFF */ @@ -53,9 +51,6 @@ #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DNM (0x00030500) /* Device Not Mapped */ #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PERSIST (0x00030600) /* Persistent Page not found */ #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DEFAULT (0x00030700) /* Default Page not found */ - -#define IOP_LOGINFO_CODE_DIAG_MSG_ERROR (0x00040000) /* Error handling diag msg - or'd with diag status */ - #define IOP_LOGINFO_CODE_TASK_TERMINATED (0x00050000) #define IOP_LOGINFO_CODE_ENCL_MGMT_READ_ACTION_ERR0R (0x00060001) /* Read Action not supported for SEP msg */ @@ -108,7 +103,6 @@ #define PL_LOGINFO_CODE_IO_EXECUTED (0x00140000) #define PL_LOGINFO_CODE_PERS_RESV_OUT_NOT_AFFIL_OWNER (0x00150000) #define PL_LOGINFO_CODE_OPEN_TXDMA_ABORT (0x00160000) -#define PL_LOGINFO_CODE_IO_DEVICE_MISSING_DELAY_RETRY (0x00170000) #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE (0x00000100) #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_NO_DEST_TIMEOUT (0x00000101) #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ORR_TIMEOUT (0x0000011A) /* Open Reject (Retry) Timeout */ @@ -171,81 +165,11 @@ /****************************************************************************/ /* IR LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = IR */ /****************************************************************************/ -#define IR_LOGINFO_RAID_ACTION_ERROR (0x00010000) -#define IR_LOGINFO_CODE_UNUSED2 (0x00020000) - -/* Amount of information passed down for Create Volume is too large */ -#define IR_LOGINFO_VOLUME_CREATE_INVALID_LENGTH (0x00010001) -/* Creation of duplicate volume attempted (Bus/Target ID checked) */ -#define IR_LOGINFO_VOLUME_CREATE_DUPLICATE (0x00010002) -/* Creation failed due to maximum number of supported volumes exceeded */ -#define IR_LOGINFO_VOLUME_CREATE_NO_SLOTS (0x00010003) -/* Creation failed due to DMA error in trying to read from host */ -#define IR_LOGINFO_VOLUME_CREATE_DMA_ERROR (0x00010004) -/* Creation failed due to invalid volume type passed down */ -#define IR_LOGINFO_VOLUME_CREATE_INVALID_VOLUME_TYPE (0x00010005) -/* Creation failed due to error reading MFG Page 4 */ -#define IR_LOGINFO_VOLUME_MFG_PAGE4_ERROR (0x00010006) -/* Creation failed when trying to create internal structures */ -#define IR_LOGINFO_VOLUME_INTERNAL_CONFIG_STRUCTURE_ERROR (0x00010007) - -/* Activation failed due to trying to activate an already active volume */ -#define IR_LOGINFO_VOLUME_ACTIVATING_AN_ACTIVE_VOLUME (0x00010010) -/* Activation failed due to trying to active unsupported volume type */ -#define IR_LOGINFO_VOLUME_ACTIVATING_INVALID_VOLUME_TYPE (0x00010011) -/* Activation failed due to trying to active too many volumes */ -#define IR_LOGINFO_VOLUME_ACTIVATING_TOO_MANY_VOLUMES (0x00010012) -/* Activation failed due to Volume ID in use already */ -#define IR_LOGINFO_VOLUME_ACTIVATING_VOLUME_ID_IN_USE (0x00010013) -/* Activation failed call to activateVolume returned failure */ -#define IR_LOGINFO_VOLUME_ACTIVATE_VOLUME_FAILED (0x00010014) -/* Activation failed trying to import the volume */ -#define IR_LOGINFO_VOLUME_ACTIVATING_IMPORT_VOLUME_FAILED (0x00010015) - -/* Phys Disk failed, too many phys disks */ -#define IR_LOGINFO_PHYSDISK_CREATE_TOO_MANY_DISKS (0x00010020) -/* Amount of information passed down for Create Pnysdisk is too large */ -#define IR_LOGINFO_PHYSDISK_CREATE_INVALID_LENGTH (0x00010021) -/* Creation failed due to DMA error in trying to read from host */ -#define IR_LOGINFO_PHYSDISK_CREATE_DMA_ERROR (0x00010022) -/* Creation failed due to invalid Bus TargetID passed down */ -#define IR_LOGINFO_PHYSDISK_CREATE_BUS_TID_INVALID (0x00010023) -/* Creation failed due to error in creating RAID Phys Disk Config Page */ -#define IR_LOGINFO_PHYSDISK_CREATE_CONFIG_PAGE_ERROR (0x00010024) - - -/* Compatibility Error : IR Disabled */ -#define IR_LOGINFO_COMPAT_ERROR_RAID_DISABLED (0x00010030) -/* Compatibility Error : Inquiry Comand failed */ -#define IR_LOGINFO_COMPAT_ERROR_INQUIRY_FAILED (0x00010031) -/* Compatibility Error : Device not direct access device */ -#define IR_LOGINFO_COMPAT_ERROR_NOT_DIRECT_ACCESS (0x00010032) -/* Compatibility Error : Removable device found */ -#define IR_LOGINFO_COMPAT_ERROR_REMOVABLE_FOUND (0x00010033) -/* Compatibility Error : Device SCSI Version not 2 or higher */ -#define IR_LOGINFO_COMPAT_ERROR_NEED_SCSI_2_OR_HIGHER (0x00010034) -/* Compatibility Error : SATA device, 48 BIT LBA not supported */ -#define IR_LOGINFO_COMPAT_ERROR_SATA_48BIT_LBA_NOT_SUPPORTED (0x00010035) -/* Compatibility Error : Device does not have 512 byte block sizes */ -#define IR_LOGINFO_COMPAT_ERROR_DEVICE_NOT_512_BYTE_BLOCK (0x00010036) -/* Compatibility Error : Volume Type check failed */ -#define IR_LOGINFO_COMPAT_ERROR_VOLUME_TYPE_CHECK_FAILED (0x00010037) -/* Compatibility Error : Volume Type is unsupported by FW */ -#define IR_LOGINFO_COMPAT_ERROR_UNSUPPORTED_VOLUME_TYPE (0x00010038) -/* Compatibility Error : Disk drive too small for use in volume */ -#define IR_LOGINFO_COMPAT_ERROR_DISK_TOO_SMALL (0x00010039) -/* Compatibility Error : Phys disk for Create Volume not found */ -#define IR_LOGINFO_COMPAT_ERROR_PHYS_DISK_NOT_FOUND (0x0001003A) -/* Compatibility Error : membership count error, too many or too few disks for volume type */ -#define IR_LOGINFO_COMPAT_ERROR_MEMBERSHIP_COUNT (0x0001003B) -/* Compatibility Error : Disk stripe sizes must be 64KB */ -#define IR_LOGINFO_COMPAT_ERROR_NON_64K_STRIPE_SIZE (0x0001003C) -/* Compatibility Error : IME size limited to < 2TB */ -#define IR_LOGINFO_COMPAT_ERROR_IME_VOL_NOT_CURRENTLY_SUPPORTED (0x0001003D) - +#define IR_LOGINFO_CODE_UNUSED1 (0x00010000) +#define IR_LOGINFO_CODE_UNUSED2 (0x00020000) /****************************************************************************/ -/* Defines for convenience */ +/* Defines for convienence */ /****************************************************************************/ #define IOC_LOGINFO_PREFIX_IOP ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_IOP) #define IOC_LOGINFO_PREFIX_PL ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_PL) diff --git a/trunk/drivers/message/fusion/lsi/mpi_sas.h b/trunk/drivers/message/fusion/lsi/mpi_sas.h index 50b8f0a8f456..70514867bddf 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_sas.h +++ b/trunk/drivers/message/fusion/lsi/mpi_sas.h @@ -6,7 +6,7 @@ * Title: MPI Serial Attached SCSI structures and definitions * Creation Date: August 19, 2004 * - * mpi_sas.h Version: 01.05.03 + * mpi_sas.h Version: 01.05.02 * * Version History * --------------- @@ -17,10 +17,6 @@ * 08-30-05 01.05.02 Added DeviceInfo bit for SEP. * Added PrimFlags and Primitive field to SAS IO Unit * Control request, and added a new operation code. - * 03-27-06 01.05.03 Added Force Full Discovery, Transmit Port Select Signal, - * and Remove Device operations to SAS IO Unit Control. - * Added DevHandle field to SAS IO Unit Control request and - * reply. * -------------------------------------------------------------------------- */ @@ -213,7 +209,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST U8 Reserved1; /* 01h */ U8 ChainOffset; /* 02h */ U8 Function; /* 03h */ - U16 DevHandle; /* 04h */ + U16 Reserved2; /* 04h */ U8 Reserved3; /* 06h */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ @@ -235,9 +231,6 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST #define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08) #define MPI_SAS_OP_MAP_CURRENT (0x09) #define MPI_SAS_OP_SEND_PRIMITIVE (0x0A) -#define MPI_SAS_OP_FORCE_FULL_DISCOVERY (0x0B) -#define MPI_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL (0x0C) -#define MPI_SAS_OP_TRANSMIT_REMOVE_DEVICE (0x0D) /* values for the PrimFlags field */ #define MPI_SAS_PRIMFLAGS_SINGLE (0x08) @@ -252,7 +245,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY U8 Reserved1; /* 01h */ U8 MsgLength; /* 02h */ U8 Function; /* 03h */ - U16 DevHandle; /* 04h */ + U16 Reserved2; /* 04h */ U8 Reserved3; /* 06h */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ diff --git a/trunk/drivers/message/fusion/lsi/mpi_targ.h b/trunk/drivers/message/fusion/lsi/mpi_targ.h index 20b667315773..3f462859ceea 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_targ.h +++ b/trunk/drivers/message/fusion/lsi/mpi_targ.h @@ -6,7 +6,7 @@ * Title: MPI Target mode messages and structures * Creation Date: June 22, 2000 * - * mpi_targ.h Version: 01.05.06 + * mpi_targ.h Version: 01.05.05 * * Version History * --------------- @@ -54,7 +54,6 @@ * 02-22-05 01.05.03 Changed a comment. * 03-11-05 01.05.04 Removed TargetAssistExtended Request. * 06-24-05 01.05.05 Added TargetAssistExtended structures and defines. - * 03-27-06 01.05.06 Added a comment. * -------------------------------------------------------------------------- */ @@ -352,7 +351,7 @@ typedef struct _MSG_TARGET_ASSIST_REQUEST #define TARGET_ASSIST_FLAGS_CONFIRMED (0x08) #define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80) -/* Standard Target Mode Reply message */ + typedef struct _MSG_TARGET_ERROR_REPLY { U16 Reserved; /* 00h */ diff --git a/trunk/drivers/message/fusion/mptbase.c b/trunk/drivers/message/fusion/mptbase.c index 43308df64623..12dd8d493ee2 100644 --- a/trunk/drivers/message/fusion/mptbase.c +++ b/trunk/drivers/message/fusion/mptbase.c @@ -46,6 +46,7 @@ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +#include #include #include #include @@ -368,21 +369,20 @@ static irqreturn_t mpt_interrupt(int irq, void *bus_id, struct pt_regs *r) { MPT_ADAPTER *ioc = bus_id; - u32 pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo); - - if (pa == 0xFFFFFFFF) - return IRQ_NONE; + u32 pa; /* * Drain the reply FIFO! */ - do { - if (pa & MPI_ADDRESS_REPLY_A_BIT) + while (1) { + pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo); + if (pa == 0xFFFFFFFF) + return IRQ_HANDLED; + else if (pa & MPI_ADDRESS_REPLY_A_BIT) mpt_reply(ioc, pa); else mpt_turbo_reply(ioc, pa); - pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo); - } while (pa != 0xFFFFFFFF); + } return IRQ_HANDLED; } @@ -1220,25 +1220,31 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) port = psize = 0; for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) { if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) { - if (psize) - continue; /* Get I/O space! */ port = pci_resource_start(pdev, ii); psize = pci_resource_len(pdev,ii); } else { - if (msize) - continue; /* Get memmap */ mem_phys = pci_resource_start(pdev, ii); msize = pci_resource_len(pdev,ii); + break; } } ioc->mem_size = msize; + if (ii == DEVICE_COUNT_RESOURCE) { + printk(KERN_ERR MYNAM ": ERROR - MPT adapter has no memory regions defined!\n"); + kfree(ioc); + return -EINVAL; + } + + dinitprintk((KERN_INFO MYNAM ": MPT adapter @ %lx, msize=%dd bytes\n", mem_phys, msize)); + dinitprintk((KERN_INFO MYNAM ": (port i/o @ %lx, psize=%dd bytes)\n", port, psize)); + mem = NULL; /* Get logical ptr for PciMem0 space */ /*mem = ioremap(mem_phys, msize);*/ - mem = ioremap(mem_phys, msize); + mem = ioremap(mem_phys, 0x100); if (mem == NULL) { printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n"); kfree(ioc); @@ -1338,6 +1344,11 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ioc->bus_type = SAS; ioc->errata_flag_1064 = 1; } + else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066) { + ioc->prod_name = "LSISAS1066"; + ioc->bus_type = SAS; + ioc->errata_flag_1064 = 1; + } else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) { ioc->prod_name = "LSISAS1068"; ioc->bus_type = SAS; @@ -1347,12 +1358,12 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ioc->prod_name = "LSISAS1064E"; ioc->bus_type = SAS; } - else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) { - ioc->prod_name = "LSISAS1068E"; + else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066E) { + ioc->prod_name = "LSISAS1066E"; ioc->bus_type = SAS; } - else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) { - ioc->prod_name = "LSISAS1078"; + else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) { + ioc->prod_name = "LSISAS1068E"; ioc->bus_type = SAS; } @@ -1695,7 +1706,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", ioc->name); rc = request_irq(ioc->pcidev->irq, mpt_interrupt, - IRQF_SHARED, ioc->name, ioc); + SA_SHIRQ, ioc->name, ioc); if (rc < 0) { printk(MYIOC_s_ERR_FMT "Unable to allocate " "interrupt %d!\n", ioc->name, @@ -3174,37 +3185,6 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) u32 diag1val = 0; #endif - if (ioc->pcidev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) { - drsprintk((MYIOC_s_WARN_FMT "%s: Doorbell=%p; 1078 reset " - "address=%p\n", ioc->name, __FUNCTION__, - &ioc->chip->Doorbell, &ioc->chip->Reset_1078)); - CHIPREG_WRITE32(&ioc->chip->Reset_1078, 0x07); - if (sleepFlag == CAN_SLEEP) - msleep(1); - else - mdelay(1); - - for (count = 0; count < 60; count ++) { - doorbell = CHIPREG_READ32(&ioc->chip->Doorbell); - doorbell &= MPI_IOC_STATE_MASK; - - drsprintk((MYIOC_s_INFO_FMT - "looking for READY STATE: doorbell=%x" - " count=%d\n", - ioc->name, doorbell, count)); - if (doorbell == MPI_IOC_STATE_READY) { - return 0; - } - - /* wait 1 sec */ - if (sleepFlag == CAN_SLEEP) - msleep(1000); - else - mdelay(1000); - } - return -1; - } - /* Clear any existing interrupts */ CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); @@ -5612,7 +5592,7 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) /* The SCSI driver needs to adjust timeouts on all current * commands prior to the diagnostic reset being issued. - * Prevents timeouts occurring during a diagnostic reset...very bad. + * Prevents timeouts occuring during a diagnostic reset...very bad. * For all other protocol drivers, this is a no-op. */ { diff --git a/trunk/drivers/message/fusion/mptbase.h b/trunk/drivers/message/fusion/mptbase.h index a5ce10b67d02..4720f9ae86aa 100644 --- a/trunk/drivers/message/fusion/mptbase.h +++ b/trunk/drivers/message/fusion/mptbase.h @@ -49,6 +49,7 @@ #define MPTBASE_H_INCLUDED /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +#include #include #include @@ -75,8 +76,8 @@ #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR #endif -#define MPT_LINUX_VERSION_COMMON "3.04.00" -#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.00" +#define MPT_LINUX_VERSION_COMMON "3.03.10" +#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.10" #define WHAT_MAGIC_STRING "@" "(" "#" ")" #define show_mptmod_ver(s,ver) \ @@ -307,8 +308,7 @@ typedef struct _SYSIF_REGS u32 HostIndex; /* 50 Host Index register */ u32 Reserved4[15]; /* 54-8F */ u32 Fubar; /* 90 For Fubar usage */ - u32 Reserved5[1050];/* 94-10F8 */ - u32 Reset_1078; /* 10FC Reset 1078 */ + u32 Reserved5[27]; /* 94-FF */ } SYSIF_REGS; /* @@ -342,7 +342,6 @@ typedef struct _VirtTarget { u8 negoFlags; /* bit field, see above */ u8 raidVolume; /* set, if RAID Volume */ u8 type; /* byte 0 of Inquiry data */ - u8 deleted; /* target in process of being removed */ u32 num_luns; u32 luns[8]; /* Max LUNs is 256 */ } VirtTarget; @@ -631,11 +630,10 @@ typedef struct _MPT_ADAPTER struct mutex sas_discovery_mutex; u8 sas_discovery_runtime; u8 sas_discovery_ignore_events; - u16 handle; int sas_index; /* index refrencing */ MPT_SAS_MGMT sas_mgmt; int num_ports; - struct work_struct sas_persist_task; + struct work_struct mptscsih_persistTask; struct work_struct fc_setup_reset_work; struct list_head fc_rports; @@ -644,7 +642,6 @@ typedef struct _MPT_ADAPTER struct work_struct fc_rescan_work; char fc_rescan_work_q_name[KOBJ_NAME_LEN]; struct workqueue_struct *fc_rescan_work_q; - u8 port_serial_number; } MPT_ADAPTER; /* @@ -896,13 +893,6 @@ typedef struct _mpt_sge { #define DBG_DUMP_REQUEST_FRAME_HDR(mfp) #endif -// debug sas wide ports -#ifdef MPT_DEBUG_SAS_WIDE -#define dsaswideprintk(x) printk x -#else -#define dsaswideprintk(x) -#endif - /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ diff --git a/trunk/drivers/message/fusion/mptfc.c b/trunk/drivers/message/fusion/mptfc.c index a8f2fa985455..3ff8378ea660 100644 --- a/trunk/drivers/message/fusion/mptfc.c +++ b/trunk/drivers/message/fusion/mptfc.c @@ -132,21 +132,21 @@ static struct scsi_host_template mptfc_driver_template = { */ static struct pci_device_id mptfc_pci_table[] = { - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC909, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC919, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC929, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC919X, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC929X, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC939X, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC939X, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC949X, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949X, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC949E, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949ES, PCI_ANY_ID, PCI_ANY_ID }, {0} /* Terminating entry */ }; diff --git a/trunk/drivers/message/fusion/mptsas.c b/trunk/drivers/message/fusion/mptsas.c index f7bd8b11ed3b..85689ab46cbc 100644 --- a/trunk/drivers/message/fusion/mptsas.c +++ b/trunk/drivers/message/fusion/mptsas.c @@ -50,14 +50,11 @@ #include #include #include -#include /* for mdelay */ -#include #include #include #include #include -#include #include "mptbase.h" #include "mptscsih.h" @@ -140,37 +137,23 @@ struct mptsas_devinfo { u32 device_info; /* bitfield detailed info about this device */ }; -/* - * Specific details on ports, wide/narrow - */ -struct mptsas_portinfo_details{ - u8 port_id; /* port number provided to transport */ - u16 num_phys; /* number of phys belong to this port */ - u64 phy_bitmask; /* TODO, extend support for 255 phys */ - struct sas_rphy *rphy; /* transport layer rphy object */ - struct sas_port *port; /* transport layer port object */ - struct scsi_target *starget; - struct mptsas_portinfo *port_info; -}; - struct mptsas_phyinfo { u8 phy_id; /* phy index */ - u8 port_id; /* firmware port identifier */ + u8 port_id; /* port number this phy is part of */ u8 negotiated_link_rate; /* nego'd link rate for this phy */ u8 hw_link_rate; /* hardware max/min phys link rate */ u8 programmed_link_rate; /* programmed max/min phy link rate */ - u8 sas_port_add_phy; /* flag to request sas_port_add_phy*/ struct mptsas_devinfo identify; /* point to phy device info */ struct mptsas_devinfo attached; /* point to attached device info */ - struct sas_phy *phy; /* transport layer phy object */ - struct mptsas_portinfo *portinfo; - struct mptsas_portinfo_details * port_details; + struct sas_phy *phy; + struct sas_rphy *rphy; + struct scsi_target *starget; }; struct mptsas_portinfo { struct list_head list; u16 handle; /* unique id to address this */ - u16 num_phys; /* number of phys */ + u8 num_phys; /* number of phys */ struct mptsas_phyinfo *phy_info; }; @@ -186,7 +169,7 @@ struct mptsas_enclosure { u8 sep_channel; /* SEP channel logical channel id */ }; -#ifdef MPT_DEBUG_SAS +#ifdef SASDEBUG static void mptsas_print_phy_data(MPI_SAS_IO_UNIT0_PHY_DATA *phy_data) { printk("---- IO UNIT PAGE 0 ------------\n"); @@ -322,7 +305,7 @@ mptsas_find_portinfo_by_handle(MPT_ADAPTER *ioc, u16 handle) static inline int mptsas_is_end_device(struct mptsas_devinfo * attached) { - if ((attached->sas_address) && + if ((attached->handle) && (attached->device_info & MPI_SAS_DEVICE_INFO_END_DEVICE) && ((attached->device_info & @@ -336,253 +319,6 @@ mptsas_is_end_device(struct mptsas_devinfo * attached) return 0; } -/* no mutex */ -static void -mptsas_port_delete(struct mptsas_portinfo_details * port_details) -{ - struct mptsas_portinfo *port_info; - struct mptsas_phyinfo *phy_info; - u8 i; - - if (!port_details) - return; - - port_info = port_details->port_info; - phy_info = port_info->phy_info; - - dsaswideprintk((KERN_DEBUG "%s: [%p]: port=%02d num_phys=%02d " - "bitmask=0x%016llX\n", - __FUNCTION__, port_details, port_details->port_id, - port_details->num_phys, port_details->phy_bitmask)); - - for (i = 0; i < port_info->num_phys; i++, phy_info++) { - if(phy_info->port_details != port_details) - continue; - memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo)); - phy_info->port_details = NULL; - } - kfree(port_details); -} - -static inline struct sas_rphy * -mptsas_get_rphy(struct mptsas_phyinfo *phy_info) -{ - if (phy_info->port_details) - return phy_info->port_details->rphy; - else - return NULL; -} - -static inline void -mptsas_set_rphy(struct mptsas_phyinfo *phy_info, struct sas_rphy *rphy) -{ - if (phy_info->port_details) { - phy_info->port_details->rphy = rphy; - dsaswideprintk((KERN_DEBUG "sas_rphy_add: rphy=%p\n", rphy)); - } - -#ifdef MPT_DEBUG_SAS_WIDE - if (rphy) { - dev_printk(KERN_DEBUG, &rphy->dev, "add:"); - printk("rphy=%p release=%p\n", - rphy, rphy->dev.release); - } -#endif -} - -static inline struct sas_port * -mptsas_get_port(struct mptsas_phyinfo *phy_info) -{ - if (phy_info->port_details) - return phy_info->port_details->port; - else - return NULL; -} - -static inline void -mptsas_set_port(struct mptsas_phyinfo *phy_info, struct sas_port *port) -{ - if (phy_info->port_details) - phy_info->port_details->port = port; - -#ifdef MPT_DEBUG_SAS_WIDE - if (port) { - dev_printk(KERN_DEBUG, &port->dev, "add: "); - printk("port=%p release=%p\n", - port, port->dev.release); - } -#endif -} - -static inline struct scsi_target * -mptsas_get_starget(struct mptsas_phyinfo *phy_info) -{ - if (phy_info->port_details) - return phy_info->port_details->starget; - else - return NULL; -} - -static inline void -mptsas_set_starget(struct mptsas_phyinfo *phy_info, struct scsi_target * -starget) -{ - if (phy_info->port_details) - phy_info->port_details->starget = starget; -} - - -/* - * mptsas_setup_wide_ports - * - * Updates for new and existing narrow/wide port configuration - * in the sas_topology - */ -static void -mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) -{ - struct mptsas_portinfo_details * port_details; - struct mptsas_phyinfo *phy_info, *phy_info_cmp; - u64 sas_address; - int i, j; - - mutex_lock(&ioc->sas_topology_mutex); - - phy_info = port_info->phy_info; - for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) { - if (phy_info->attached.handle) - continue; - port_details = phy_info->port_details; - if (!port_details) - continue; - if (port_details->num_phys < 2) - continue; - /* - * Removing a phy from a port, letting the last - * phy be removed by firmware events. - */ - dsaswideprintk((KERN_DEBUG - "%s: [%p]: port=%d deleting phy = %d\n", - __FUNCTION__, port_details, - port_details->port_id, i)); - port_details->num_phys--; - port_details->phy_bitmask &= ~ (1 << phy_info->phy_id); - memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo)); - sas_port_delete_phy(port_details->port, phy_info->phy); - phy_info->port_details = NULL; - } - - /* - * Populate and refresh the tree - */ - phy_info = port_info->phy_info; - for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) { - sas_address = phy_info->attached.sas_address; - dsaswideprintk((KERN_DEBUG "phy_id=%d sas_address=0x%018llX\n", - i, sas_address)); - if (!sas_address) - continue; - port_details = phy_info->port_details; - /* - * Forming a port - */ - if (!port_details) { - port_details = kzalloc(sizeof(*port_details), - GFP_KERNEL); - if (!port_details) - goto out; - port_details->num_phys = 1; - port_details->port_info = port_info; - port_details->port_id = ioc->port_serial_number++; - if (phy_info->phy_id < 64 ) - port_details->phy_bitmask |= - (1 << phy_info->phy_id); - phy_info->sas_port_add_phy=1; - dsaswideprintk((KERN_DEBUG "\t\tForming port\n\t\t" - "phy_id=%d sas_address=0x%018llX\n", - i, sas_address)); - phy_info->port_details = port_details; - } - - if (i == port_info->num_phys - 1) - continue; - phy_info_cmp = &port_info->phy_info[i + 1]; - for (j = i + 1 ; j < port_info->num_phys ; j++, - phy_info_cmp++) { - if (!phy_info_cmp->attached.sas_address) - continue; - if (sas_address != phy_info_cmp->attached.sas_address) - continue; - if (phy_info_cmp->port_details == port_details ) - continue; - dsaswideprintk((KERN_DEBUG - "\t\tphy_id=%d sas_address=0x%018llX\n", - j, phy_info_cmp->attached.sas_address)); - if (phy_info_cmp->port_details) { - port_details->rphy = - mptsas_get_rphy(phy_info_cmp); - port_details->port = - mptsas_get_port(phy_info_cmp); - port_details->starget = - mptsas_get_starget(phy_info_cmp); - port_details->port_id = - phy_info_cmp->port_details->port_id; - port_details->num_phys = - phy_info_cmp->port_details->num_phys; -// port_info->port_serial_number--; - ioc->port_serial_number--; - if (!phy_info_cmp->port_details->num_phys) - kfree(phy_info_cmp->port_details); - } else - phy_info_cmp->sas_port_add_phy=1; - /* - * Adding a phy to a port - */ - phy_info_cmp->port_details = port_details; - if (phy_info_cmp->phy_id < 64 ) - port_details->phy_bitmask |= - (1 << phy_info_cmp->phy_id); - port_details->num_phys++; - } - } - - out: - -#ifdef MPT_DEBUG_SAS_WIDE - for (i = 0; i < port_info->num_phys; i++) { - port_details = port_info->phy_info[i].port_details; - if (!port_details) - continue; - dsaswideprintk((KERN_DEBUG - "%s: [%p]: phy_id=%02d port_id=%02d num_phys=%02d " - "bitmask=0x%016llX\n", - __FUNCTION__, - port_details, i, port_details->port_id, - port_details->num_phys, port_details->phy_bitmask)); - dsaswideprintk((KERN_DEBUG"\t\tport = %p rphy=%p\n", - port_details->port, port_details->rphy)); - } - dsaswideprintk((KERN_DEBUG"\n")); -#endif - mutex_unlock(&ioc->sas_topology_mutex); -} - -static void -mptsas_target_reset(MPT_ADAPTER *ioc, VirtTarget * vtarget) -{ - MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)ioc->sh->hostdata; - - if (mptscsih_TMHandler(hd, - MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, - vtarget->bus_id, vtarget->target_id, 0, 0, 5) < 0) { - hd->tmPending = 0; - hd->tmState = TM_STATE_NONE; - printk(MYIOC_s_WARN_FMT - "Error processing TaskMgmt id=%d TARGET_RESET\n", - ioc->name, vtarget->target_id); - } -} - static int mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure, u32 form, u32 form_specific) @@ -664,105 +400,11 @@ mptsas_slave_configure(struct scsi_device *sdev) return mptscsih_slave_configure(sdev); } -static int -mptsas_target_alloc(struct scsi_target *starget) -{ - struct Scsi_Host *host = dev_to_shost(&starget->dev); - MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; - VirtTarget *vtarget; - u32 target_id; - u32 channel; - struct sas_rphy *rphy; - struct mptsas_portinfo *p; - int i; - - vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL); - if (!vtarget) - return -ENOMEM; - - vtarget->starget = starget; - vtarget->ioc_id = hd->ioc->id; - vtarget->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY; - - target_id = starget->id; - channel = 0; - - hd->Targets[target_id] = vtarget; - - /* - * RAID volumes placed beyond the last expected port. - */ - if (starget->channel == hd->ioc->num_ports) - goto out; - - rphy = dev_to_rphy(starget->dev.parent); - mutex_lock(&hd->ioc->sas_topology_mutex); - list_for_each_entry(p, &hd->ioc->sas_topology, list) { - for (i = 0; i < p->num_phys; i++) { - if (p->phy_info[i].attached.sas_address != - rphy->identify.sas_address) - continue; - target_id = p->phy_info[i].attached.id; - channel = p->phy_info[i].attached.channel; - mptsas_set_starget(&p->phy_info[i], starget); - - /* - * Exposing hidden raid components - */ - if (mptscsih_is_phys_disk(hd->ioc, target_id)) { - target_id = mptscsih_raid_id_to_num(hd, - target_id); - vtarget->tflags |= - MPT_TARGET_FLAGS_RAID_COMPONENT; - } - mutex_unlock(&hd->ioc->sas_topology_mutex); - goto out; - } - } - mutex_unlock(&hd->ioc->sas_topology_mutex); - - kfree(vtarget); - return -ENXIO; - - out: - vtarget->target_id = target_id; - vtarget->bus_id = channel; - starget->hostdata = vtarget; - return 0; -} - -static void -mptsas_target_destroy(struct scsi_target *starget) -{ - struct Scsi_Host *host = dev_to_shost(&starget->dev); - MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; - struct sas_rphy *rphy; - struct mptsas_portinfo *p; - int i; - - if (!starget->hostdata) - return; - - if (starget->channel == hd->ioc->num_ports) - goto out; - - rphy = dev_to_rphy(starget->dev.parent); - list_for_each_entry(p, &hd->ioc->sas_topology, list) { - for (i = 0; i < p->num_phys; i++) { - if (p->phy_info[i].attached.sas_address != - rphy->identify.sas_address) - continue; - mptsas_set_starget(&p->phy_info[i], NULL); - goto out; - } - } - - out: - kfree(starget->hostdata); - starget->hostdata = NULL; -} - - +/* + * This is pretty ugly. We will be able to seriously clean it up + * once the DV code in mptscsih goes away and we can properly + * implement ->target_alloc. + */ static int mptsas_slave_alloc(struct scsi_device *sdev) { @@ -770,41 +412,61 @@ mptsas_slave_alloc(struct scsi_device *sdev) MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; struct sas_rphy *rphy; struct mptsas_portinfo *p; + VirtTarget *vtarget; VirtDevice *vdev; struct scsi_target *starget; - int i; + u32 target_id; + int i; vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); if (!vdev) { - printk(MYIOC_s_ERR_FMT "slave_alloc kzalloc(%zd) FAILED!\n", + printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", hd->ioc->name, sizeof(VirtDevice)); return -ENOMEM; } + sdev->hostdata = vdev; starget = scsi_target(sdev); - vdev->vtarget = starget->hostdata; + vtarget = starget->hostdata; + vtarget->ioc_id = hd->ioc->id; + vdev->vtarget = vtarget; + if (vtarget->num_luns == 0) { + vtarget->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY; + hd->Targets[sdev->id] = vtarget; + } /* - * RAID volumes placed beyond the last expected port. - */ - if (sdev->channel == hd->ioc->num_ports) + RAID volumes placed beyond the last expected port. + */ + if (sdev->channel == hd->ioc->num_ports) { + target_id = sdev->id; + vtarget->bus_id = 0; + vdev->lun = 0; goto out; + } rphy = dev_to_rphy(sdev->sdev_target->dev.parent); mutex_lock(&hd->ioc->sas_topology_mutex); list_for_each_entry(p, &hd->ioc->sas_topology, list) { for (i = 0; i < p->num_phys; i++) { - if (p->phy_info[i].attached.sas_address != - rphy->identify.sas_address) - continue; - vdev->lun = sdev->lun; - /* - * Exposing hidden raid components - */ - if (mptscsih_is_phys_disk(hd->ioc, - p->phy_info[i].attached.id)) - sdev->no_uld_attach = 1; - mutex_unlock(&hd->ioc->sas_topology_mutex); - goto out; + if (p->phy_info[i].attached.sas_address == + rphy->identify.sas_address) { + target_id = p->phy_info[i].attached.id; + vtarget->bus_id = p->phy_info[i].attached.channel; + vdev->lun = sdev->lun; + p->phy_info[i].starget = sdev->sdev_target; + /* + * Exposing hidden disk (RAID) + */ + if (mptscsih_is_phys_disk(hd->ioc, target_id)) { + target_id = mptscsih_raid_id_to_num(hd, + target_id); + vdev->vtarget->tflags |= + MPT_TARGET_FLAGS_RAID_COMPONENT; + sdev->no_uld_attach = 1; + } + mutex_unlock(&hd->ioc->sas_topology_mutex); + goto out; + } } } mutex_unlock(&hd->ioc->sas_topology_mutex); @@ -813,39 +475,57 @@ mptsas_slave_alloc(struct scsi_device *sdev) return -ENXIO; out: - vdev->vtarget->num_luns++; - sdev->hostdata = vdev; + vtarget->target_id = target_id; + vtarget->num_luns++; return 0; } -static int -mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +static void +mptsas_slave_destroy(struct scsi_device *sdev) { - VirtDevice *vdev = SCpnt->device->hostdata; + struct Scsi_Host *host = sdev->host; + MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; + VirtDevice *vdev; -// scsi_print_command(SCpnt); - if (vdev->vtarget->deleted) { - SCpnt->result = DID_NO_CONNECT << 16; - done(SCpnt); - return 0; - } + /* + * Issue target reset to flush firmware outstanding commands. + */ + vdev = sdev->hostdata; + if (vdev->configured_lun){ + if (mptscsih_TMHandler(hd, + MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, + vdev->vtarget->bus_id, + vdev->vtarget->target_id, + 0, 0, 5 /* 5 second timeout */) + < 0){ + + /* The TM request failed! + * Fatal error case. + */ + printk(MYIOC_s_WARN_FMT + "Error processing TaskMgmt id=%d TARGET_RESET\n", + hd->ioc->name, + vdev->vtarget->target_id); - return mptscsih_qcmd(SCpnt,done); + hd->tmPending = 0; + hd->tmState = TM_STATE_NONE; + } + } + mptscsih_slave_destroy(sdev); } - static struct scsi_host_template mptsas_driver_template = { .module = THIS_MODULE, .proc_name = "mptsas", .proc_info = mptscsih_proc_info, .name = "MPT SPI Host", .info = mptscsih_info, - .queuecommand = mptsas_qcmd, - .target_alloc = mptsas_target_alloc, + .queuecommand = mptscsih_qcmd, + .target_alloc = mptscsih_target_alloc, .slave_alloc = mptsas_slave_alloc, .slave_configure = mptsas_slave_configure, - .target_destroy = mptsas_target_destroy, - .slave_destroy = mptscsih_slave_destroy, + .target_destroy = mptscsih_target_destroy, + .slave_destroy = mptsas_slave_destroy, .change_queue_depth = mptscsih_change_queue_depth, .eh_abort_handler = mptscsih_abort, .eh_device_reset_handler = mptscsih_dev_reset, @@ -1115,7 +795,7 @@ mptsas_sas_io_unit_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) port_info->num_phys = buffer->NumPhys; port_info->phy_info = kcalloc(port_info->num_phys, - sizeof(*port_info->phy_info),GFP_KERNEL); + sizeof(struct mptsas_phyinfo),GFP_KERNEL); if (!port_info->phy_info) { error = -ENOMEM; goto out_free_consistent; @@ -1131,7 +811,6 @@ mptsas_sas_io_unit_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) buffer->PhyData[i].Port; port_info->phy_info[i].negotiated_link_rate = buffer->PhyData[i].NegotiatedLinkRate; - port_info->phy_info[i].portinfo = port_info; } out_free_consistent: @@ -1289,7 +968,7 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info, CONFIGPARMS cfg; SasExpanderPage0_t *buffer; dma_addr_t dma_handle; - int i, error; + int error; hdr.PageVersion = MPI_SASEXPANDER0_PAGEVERSION; hdr.ExtPageLength = 0; @@ -1334,15 +1013,12 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info, port_info->num_phys = buffer->NumPhys; port_info->handle = le16_to_cpu(buffer->DevHandle); port_info->phy_info = kcalloc(port_info->num_phys, - sizeof(*port_info->phy_info),GFP_KERNEL); + sizeof(struct mptsas_phyinfo),GFP_KERNEL); if (!port_info->phy_info) { error = -ENOMEM; goto out_free_consistent; } - for (i = 0; i < port_info->num_phys; i++) - port_info->phy_info[i].portinfo = port_info; - out_free_consistent: pci_free_consistent(ioc->pcidev, hdr.ExtPageLength * 4, buffer, dma_handle); @@ -1485,23 +1161,19 @@ static int mptsas_probe_one_phy(struct device *dev, { MPT_ADAPTER *ioc; struct sas_phy *phy; - struct sas_port *port; - int error = 0; + int error; - if (!dev) { - error = -ENODEV; - goto out; - } + if (!dev) + return -ENODEV; if (!phy_info->phy) { phy = sas_phy_alloc(dev, index); - if (!phy) { - error = -ENOMEM; - goto out; - } + if (!phy) + return -ENOMEM; } else phy = phy_info->phy; + phy->port_identifier = phy_info->port_id; mptsas_parse_device_info(&phy->identify, &phy_info->identify); /* @@ -1593,52 +1265,19 @@ static int mptsas_probe_one_phy(struct device *dev, error = sas_phy_add(phy); if (error) { sas_phy_free(phy); - goto out; + return error; } phy_info->phy = phy; } - if (!phy_info->attached.handle || - !phy_info->port_details) - goto out; - - port = mptsas_get_port(phy_info); - ioc = phy_to_ioc(phy_info->phy); - - if (phy_info->sas_port_add_phy) { - - if (!port) { - port = sas_port_alloc(dev, - phy_info->port_details->port_id); - dsaswideprintk((KERN_DEBUG - "sas_port_alloc: port=%p dev=%p port_id=%d\n", - port, dev, phy_info->port_details->port_id)); - if (!port) { - error = -ENOMEM; - goto out; - } - error = sas_port_add(port); - if (error) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); - goto out; - } - mptsas_set_port(phy_info, port); - } - dsaswideprintk((KERN_DEBUG "sas_port_add_phy: phy_id=%d\n", - phy_info->phy_id)); - sas_port_add_phy(port, phy_info->phy); - phy_info->sas_port_add_phy = 0; - } - - if (!mptsas_get_rphy(phy_info) && port && !port->rphy) { + if ((phy_info->attached.handle) && + (!phy_info->rphy)) { struct sas_rphy *rphy; - struct device *parent; struct sas_identify identify; - parent = dev->parent->parent; + ioc = phy_to_ioc(phy_info->phy); + /* * Let the hotplug_work thread handle processing * the adding/removing of devices that occur @@ -1646,63 +1285,36 @@ static int mptsas_probe_one_phy(struct device *dev, */ if (ioc->sas_discovery_runtime && mptsas_is_end_device(&phy_info->attached)) - goto out; + return 0; mptsas_parse_device_info(&identify, &phy_info->attached); - if (scsi_is_host_device(parent)) { - struct mptsas_portinfo *port_info; - int i; - - mutex_lock(&ioc->sas_topology_mutex); - port_info = mptsas_find_portinfo_by_handle(ioc, - ioc->handle); - mutex_unlock(&ioc->sas_topology_mutex); - - for (i = 0; i < port_info->num_phys; i++) - if (port_info->phy_info[i].identify.sas_address == - identify.sas_address) - goto out; - - } else if (scsi_is_sas_rphy(parent)) { - struct sas_rphy *parent_rphy = dev_to_rphy(parent); - if (identify.sas_address == - parent_rphy->identify.sas_address) - goto out; - } - switch (identify.device_type) { case SAS_END_DEVICE: - rphy = sas_end_device_alloc(port); + rphy = sas_end_device_alloc(phy); break; case SAS_EDGE_EXPANDER_DEVICE: case SAS_FANOUT_EXPANDER_DEVICE: - rphy = sas_expander_alloc(port, identify.device_type); + rphy = sas_expander_alloc(phy, identify.device_type); break; default: rphy = NULL; break; } - if (!rphy) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); - goto out; - } + if (!rphy) + return 0; /* non-fatal: an rphy can be added later */ rphy->identify = identify; + error = sas_rphy_add(rphy); if (error) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); sas_rphy_free(rphy); - goto out; + return error; } - mptsas_set_rphy(phy_info, rphy); + + phy_info->rphy = rphy; } - out: - return error; + return 0; } static int @@ -1721,7 +1333,6 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc) goto out_free_port_info; mutex_lock(&ioc->sas_topology_mutex); - ioc->handle = hba->handle; port_info = mptsas_find_portinfo_by_handle(ioc, hba->handle); if (!port_info) { port_info = hba; @@ -1731,7 +1342,8 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc) for (i = 0; i < hba->num_phys; i++) port_info->phy_info[i].negotiated_link_rate = hba->phy_info[i].negotiated_link_rate; - kfree(hba->phy_info); + if (hba->phy_info) + kfree(hba->phy_info); kfree(hba); hba = NULL; } @@ -1750,19 +1362,18 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc) port_info->phy_info[i].phy_id; handle = port_info->phy_info[i].identify.handle; - if (port_info->phy_info[i].attached.handle) + if (port_info->phy_info[i].attached.handle) { mptsas_sas_device_pg0(ioc, &port_info->phy_info[i].attached, (MPI_SAS_DEVICE_PGAD_FORM_HANDLE << MPI_SAS_DEVICE_PGAD_FORM_SHIFT), port_info->phy_info[i].attached.handle); - } - - mptsas_setup_wide_ports(ioc, port_info); + } - for (i = 0; i < port_info->num_phys; i++, ioc->sas_index++) mptsas_probe_one_phy(&ioc->sh->shost_gendev, &port_info->phy_info[i], ioc->sas_index, 1); + ioc->sas_index++; + } return 0; @@ -1776,8 +1387,6 @@ static int mptsas_probe_expander_phys(MPT_ADAPTER *ioc, u32 *handle) { struct mptsas_portinfo *port_info, *p, *ex; - struct device *parent; - struct sas_rphy *rphy; int error = -ENOMEM, i, j; ex = kzalloc(sizeof(*port_info), GFP_KERNEL); @@ -1799,13 +1408,16 @@ mptsas_probe_expander_phys(MPT_ADAPTER *ioc, u32 *handle) list_add_tail(&port_info->list, &ioc->sas_topology); } else { port_info->handle = ex->handle; - kfree(ex->phy_info); + if (ex->phy_info) + kfree(ex->phy_info); kfree(ex); ex = NULL; } mutex_unlock(&ioc->sas_topology_mutex); for (i = 0; i < port_info->num_phys; i++) { + struct device *parent; + mptsas_sas_expander_pg1(ioc, &port_info->phy_info[i], (MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM << MPI_SAS_EXPAND_PGAD_FORM_SHIFT), (i << 16) + *handle); @@ -1829,34 +1441,34 @@ mptsas_probe_expander_phys(MPT_ADAPTER *ioc, u32 *handle) port_info->phy_info[i].attached.phy_id = port_info->phy_info[i].phy_id; } - } - parent = &ioc->sh->shost_gendev; - for (i = 0; i < port_info->num_phys; i++) { + /* + * If we find a parent port handle this expander is + * attached to another expander, else it hangs of the + * HBA phys. + */ + parent = &ioc->sh->shost_gendev; mutex_lock(&ioc->sas_topology_mutex); list_for_each_entry(p, &ioc->sas_topology, list) { for (j = 0; j < p->num_phys; j++) { - if (port_info->phy_info[i].identify.handle != + if (port_info->phy_info[i].identify.handle == p->phy_info[j].attached.handle) - continue; - rphy = mptsas_get_rphy(&p->phy_info[j]); - parent = &rphy->dev; + parent = &p->phy_info[j].rphy->dev; } } mutex_unlock(&ioc->sas_topology_mutex); - } - - mptsas_setup_wide_ports(ioc, port_info); - for (i = 0; i < port_info->num_phys; i++, ioc->sas_index++) mptsas_probe_one_phy(parent, &port_info->phy_info[i], ioc->sas_index, 0); + ioc->sas_index++; + } return 0; out_free_port_info: if (ex) { - kfree(ex->phy_info); + if (ex->phy_info) + kfree(ex->phy_info); kfree(ex); } out: @@ -1875,12 +1487,7 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc) { struct mptsas_portinfo buffer; struct mptsas_portinfo *port_info, *n, *parent; - struct mptsas_phyinfo *phy_info; - struct scsi_target * starget; - VirtTarget * vtarget; - struct sas_port * port; int i; - u64 expander_sas_address; mutex_lock(&ioc->sas_topology_mutex); list_for_each_entry_safe(port_info, n, &ioc->sas_topology, list) { @@ -1894,25 +1501,6 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc) (MPI_SAS_EXPAND_PGAD_FORM_HANDLE << MPI_SAS_EXPAND_PGAD_FORM_SHIFT), port_info->handle)) { - /* - * Issue target reset to all child end devices - * then mark them deleted to prevent further - * IO going to them. - */ - phy_info = port_info->phy_info; - for (i = 0; i < port_info->num_phys; i++, phy_info++) { - starget = mptsas_get_starget(phy_info); - if (!starget) - continue; - vtarget = starget->hostdata; - if(vtarget->deleted) - continue; - vtarget->deleted = 1; - mptsas_target_reset(ioc, vtarget); - sas_port_delete(mptsas_get_port(phy_info)); - mptsas_port_delete(phy_info->port_details); - } - /* * Obtain the port_info instance to the parent port */ @@ -1922,43 +1510,34 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc) if (!parent) goto next_port; - expander_sas_address = - port_info->phy_info[0].identify.sas_address; - /* * Delete rphys in the parent that point * to this expander. The transport layer will * cleanup all the children. */ - phy_info = parent->phy_info; - for (i = 0; i < parent->num_phys; i++, phy_info++) { - port = mptsas_get_port(phy_info); - if (!port) - continue; - if (phy_info->attached.sas_address != - expander_sas_address) + for (i = 0; i < parent->num_phys; i++) { + if ((!parent->phy_info[i].rphy) || + (parent->phy_info[i].attached.sas_address != + port_info->phy_info[i].identify.sas_address)) continue; -#ifdef MPT_DEBUG_SAS_WIDE - dev_printk(KERN_DEBUG, &port->dev, "delete\n"); -#endif - sas_port_delete(port); - mptsas_port_delete(phy_info->port_details); + sas_rphy_delete(parent->phy_info[i].rphy); + memset(&parent->phy_info[i].attached, 0, + sizeof(struct mptsas_devinfo)); + parent->phy_info[i].rphy = NULL; + parent->phy_info[i].starget = NULL; } next_port: - - phy_info = port_info->phy_info; - for (i = 0; i < port_info->num_phys; i++, phy_info++) - mptsas_port_delete(phy_info->port_details); - list_del(&port_info->list); - kfree(port_info->phy_info); + if (port_info->phy_info) + kfree(port_info->phy_info); kfree(port_info); } /* * Free this memory allocated from inside * mptsas_sas_expander_pg0 */ - kfree(buffer.phy_info); + if (buffer.phy_info) + kfree(buffer.phy_info); } mutex_unlock(&ioc->sas_topology_mutex); } @@ -1994,59 +1573,60 @@ mptsas_scan_sas_topology(MPT_ADAPTER *ioc) /* * Work queue thread to handle Runtime discovery * Mere purpose is the hot add/delete of expanders - *(Mutex UNLOCKED) */ static void -__mptsas_discovery_work(MPT_ADAPTER *ioc) +mptscsih_discovery_work(void * arg) { + struct mptsas_discovery_event *ev = arg; + MPT_ADAPTER *ioc = ev->ioc; u32 handle = 0xFFFF; + mutex_lock(&ioc->sas_discovery_mutex); ioc->sas_discovery_runtime=1; mptsas_delete_expander_phys(ioc); mptsas_probe_hba_phys(ioc); while (!mptsas_probe_expander_phys(ioc, &handle)) ; + kfree(ev); ioc->sas_discovery_runtime=0; -} - -/* - * Work queue thread to handle Runtime discovery - * Mere purpose is the hot add/delete of expanders - *(Mutex LOCKED) - */ -static void -mptsas_discovery_work(void * arg) -{ - struct mptsas_discovery_event *ev = arg; - MPT_ADAPTER *ioc = ev->ioc; - - mutex_lock(&ioc->sas_discovery_mutex); - __mptsas_discovery_work(ioc); mutex_unlock(&ioc->sas_discovery_mutex); - kfree(ev); } static struct mptsas_phyinfo * -mptsas_find_phyinfo_by_sas_address(MPT_ADAPTER *ioc, u64 sas_address) +mptsas_find_phyinfo_by_parent(MPT_ADAPTER *ioc, u16 parent_handle, u8 phy_id) { struct mptsas_portinfo *port_info; + struct mptsas_devinfo device_info; struct mptsas_phyinfo *phy_info = NULL; - int i; + int i, error; + + /* + * Retrieve the parent sas_address + */ + error = mptsas_sas_device_pg0(ioc, &device_info, + (MPI_SAS_DEVICE_PGAD_FORM_HANDLE << + MPI_SAS_DEVICE_PGAD_FORM_SHIFT), + parent_handle); + if (error) + return NULL; + /* + * The phy_info structures are never deallocated during lifetime of + * a host, so the code below is safe without additional refcounting. + */ mutex_lock(&ioc->sas_topology_mutex); list_for_each_entry(port_info, &ioc->sas_topology, list) { for (i = 0; i < port_info->num_phys; i++) { - if (port_info->phy_info[i].attached.sas_address - != sas_address) - continue; - if (!mptsas_is_end_device( - &port_info->phy_info[i].attached)) - continue; - phy_info = &port_info->phy_info[i]; - break; + if (port_info->phy_info[i].identify.sas_address == + device_info.sas_address && + port_info->phy_info[i].phy_id == phy_id) { + phy_info = &port_info->phy_info[i]; + break; + } } } mutex_unlock(&ioc->sas_topology_mutex); + return phy_info; } @@ -2057,19 +1637,21 @@ mptsas_find_phyinfo_by_target(MPT_ADAPTER *ioc, u32 id) struct mptsas_phyinfo *phy_info = NULL; int i; + /* + * The phy_info structures are never deallocated during lifetime of + * a host, so the code below is safe without additional refcounting. + */ mutex_lock(&ioc->sas_topology_mutex); list_for_each_entry(port_info, &ioc->sas_topology, list) { - for (i = 0; i < port_info->num_phys; i++) { - if (port_info->phy_info[i].attached.id != id) - continue; - if (!mptsas_is_end_device( - &port_info->phy_info[i].attached)) - continue; - phy_info = &port_info->phy_info[i]; - break; - } + for (i = 0; i < port_info->num_phys; i++) + if (mptsas_is_end_device(&port_info->phy_info[i].attached)) + if (port_info->phy_info[i].attached.id == id) { + phy_info = &port_info->phy_info[i]; + break; + } } mutex_unlock(&ioc->sas_topology_mutex); + return phy_info; } @@ -2077,7 +1659,7 @@ mptsas_find_phyinfo_by_target(MPT_ADAPTER *ioc, u32 id) * Work queue thread to clear the persitency table */ static void -mptsas_persist_clear_table(void * arg) +mptscsih_sas_persist_clear_table(void * arg) { MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; @@ -2098,6 +1680,7 @@ mptsas_reprobe_target(struct scsi_target *starget, int uld_attach) mptsas_reprobe_lun); } + /* * Work queue thread to handle SAS hotplug events */ @@ -2108,17 +1691,14 @@ mptsas_hotplug_work(void *arg) MPT_ADAPTER *ioc = ev->ioc; struct mptsas_phyinfo *phy_info; struct sas_rphy *rphy; - struct sas_port *port; struct scsi_device *sdev; - struct scsi_target * starget; struct sas_identify identify; char *ds = NULL; struct mptsas_devinfo sas_device; VirtTarget *vtarget; - VirtDevice *vdevice; - mutex_lock(&ioc->sas_discovery_mutex); + switch (ev->event_type) { case MPTSAS_DEL_DEVICE: @@ -2127,50 +1707,24 @@ mptsas_hotplug_work(void *arg) /* * Sanity checks, for non-existing phys and remote rphys. */ - if (!phy_info || !phy_info->port_details) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); + if (!phy_info) break; - } - rphy = mptsas_get_rphy(phy_info); - if (!rphy) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); + if (!phy_info->rphy) break; - } - port = mptsas_get_port(phy_info); - if (!port) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); - break; - } + if (phy_info->starget) { + vtarget = phy_info->starget->hostdata; - starget = mptsas_get_starget(phy_info); - if (starget) { - vtarget = starget->hostdata; - - if (!vtarget) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); + if (!vtarget) break; - } - /* * Handling RAID components */ if (ev->phys_disk_num_valid) { vtarget->target_id = ev->phys_disk_num; vtarget->tflags |= MPT_TARGET_FLAGS_RAID_COMPONENT; - mptsas_reprobe_target(starget, 1); + mptsas_reprobe_target(vtarget->starget, 1); break; } - - vtarget->deleted = 1; - mptsas_target_reset(ioc, vtarget); } if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_SSP_TARGET) @@ -2184,11 +1738,10 @@ mptsas_hotplug_work(void *arg) "removing %s device, channel %d, id %d, phy %d\n", ioc->name, ds, ev->channel, ev->id, phy_info->phy_id); -#ifdef MPT_DEBUG_SAS_WIDE - dev_printk(KERN_DEBUG, &port->dev, "delete\n"); -#endif - sas_port_delete(port); - mptsas_port_delete(phy_info->port_details); + sas_rphy_delete(phy_info->rphy); + memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo)); + phy_info->rphy = NULL; + phy_info->starget = NULL; break; case MPTSAS_ADD_DEVICE: @@ -2200,60 +1753,59 @@ mptsas_hotplug_work(void *arg) */ if (mptsas_sas_device_pg0(ioc, &sas_device, (MPI_SAS_DEVICE_PGAD_FORM_BUS_TARGET_ID << - MPI_SAS_DEVICE_PGAD_FORM_SHIFT), ev->id)) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); + MPI_SAS_DEVICE_PGAD_FORM_SHIFT), ev->id)) break; - } - ssleep(2); - __mptsas_discovery_work(ioc); + phy_info = mptsas_find_phyinfo_by_parent(ioc, + sas_device.handle_parent, sas_device.phy_id); - phy_info = mptsas_find_phyinfo_by_sas_address(ioc, - sas_device.sas_address); + if (!phy_info) { + u32 handle = 0xFFFF; - if (!phy_info || !phy_info->port_details) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); - break; + /* + * Its possible when an expander has been hot added + * containing attached devices, the sas firmware + * may send a RC_ADDED event prior to the + * DISCOVERY STOP event. If that occurs, our + * view of the topology in the driver in respect to this + * expander might of not been setup, and we hit this + * condition. + * Therefore, this code kicks off discovery to + * refresh the data. + * Then again, we check whether the parent phy has + * been created. + */ + ioc->sas_discovery_runtime=1; + mptsas_delete_expander_phys(ioc); + mptsas_probe_hba_phys(ioc); + while (!mptsas_probe_expander_phys(ioc, &handle)) + ; + ioc->sas_discovery_runtime=0; + + phy_info = mptsas_find_phyinfo_by_parent(ioc, + sas_device.handle_parent, sas_device.phy_id); + if (!phy_info) + break; } - starget = mptsas_get_starget(phy_info); - if (starget) { - vtarget = starget->hostdata; + if (phy_info->starget) { + vtarget = phy_info->starget->hostdata; - if (!vtarget) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); + if (!vtarget) break; - } /* * Handling RAID components */ if (vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) { vtarget->tflags &= ~MPT_TARGET_FLAGS_RAID_COMPONENT; vtarget->target_id = ev->id; - mptsas_reprobe_target(starget, 0); + mptsas_reprobe_target(phy_info->starget, 0); } break; } - if (mptsas_get_rphy(phy_info)) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); + if (phy_info->rphy) break; - } - port = mptsas_get_port(phy_info); - if (!port) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); - break; - } memcpy(&phy_info->attached, &sas_device, sizeof(struct mptsas_devinfo)); @@ -2270,23 +1822,28 @@ mptsas_hotplug_work(void *arg) ioc->name, ds, ev->channel, ev->id, ev->phy_id); mptsas_parse_device_info(&identify, &phy_info->attached); - rphy = sas_end_device_alloc(port); - if (!rphy) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); - break; /* non-fatal: an rphy can be added later */ + switch (identify.device_type) { + case SAS_END_DEVICE: + rphy = sas_end_device_alloc(phy_info->phy); + break; + case SAS_EDGE_EXPANDER_DEVICE: + case SAS_FANOUT_EXPANDER_DEVICE: + rphy = sas_expander_alloc(phy_info->phy, identify.device_type); + break; + default: + rphy = NULL; + break; } + if (!rphy) + break; /* non-fatal: an rphy can be added later */ rphy->identify = identify; if (sas_rphy_add(rphy)) { - dfailprintk((MYIOC_s_ERR_FMT - "%s: exit at line=%d\n", ioc->name, - __FUNCTION__, __LINE__)); sas_rphy_free(rphy); break; } - mptsas_set_rphy(phy_info, rphy); + + phy_info->rphy = rphy; break; case MPTSAS_ADD_RAID: sdev = scsi_device_lookup( @@ -2318,9 +1875,6 @@ mptsas_hotplug_work(void *arg) printk(MYIOC_s_INFO_FMT "removing raid volume, channel %d, id %d\n", ioc->name, ioc->num_ports, ev->id); - vdevice = sdev->hostdata; - vdevice->vtarget->deleted = 1; - mptsas_target_reset(ioc, vdevice->vtarget); scsi_remove_device(sdev); scsi_device_put(sdev); mpt_findImVolumes(ioc); @@ -2330,13 +1884,12 @@ mptsas_hotplug_work(void *arg) break; } - mutex_unlock(&ioc->sas_discovery_mutex); kfree(ev); - + mutex_unlock(&ioc->sas_discovery_mutex); } static void -mptsas_send_sas_event(MPT_ADAPTER *ioc, +mptscsih_send_sas_event(MPT_ADAPTER *ioc, EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *sas_event_data) { struct mptsas_hotplug_event *ev; @@ -2352,7 +1905,7 @@ mptsas_send_sas_event(MPT_ADAPTER *ioc, switch (sas_event_data->ReasonCode) { case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: - ev = kzalloc(sizeof(*ev), GFP_ATOMIC); + ev = kmalloc(sizeof(*ev), GFP_ATOMIC); if (!ev) { printk(KERN_WARNING "mptsas: lost hotplug event\n"); break; @@ -2382,9 +1935,10 @@ mptsas_send_sas_event(MPT_ADAPTER *ioc, /* * Persistent table is full. */ - INIT_WORK(&ioc->sas_persist_task, - mptsas_persist_clear_table, (void *)ioc); - schedule_work(&ioc->sas_persist_task); + INIT_WORK(&ioc->mptscsih_persistTask, + mptscsih_sas_persist_clear_table, + (void *)ioc); + schedule_work(&ioc->mptscsih_persistTask); break; case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: /* TODO */ @@ -2396,7 +1950,7 @@ mptsas_send_sas_event(MPT_ADAPTER *ioc, } static void -mptsas_send_raid_event(MPT_ADAPTER *ioc, +mptscsih_send_raid_event(MPT_ADAPTER *ioc, EVENT_DATA_RAID *raid_event_data) { struct mptsas_hotplug_event *ev; @@ -2406,12 +1960,13 @@ mptsas_send_raid_event(MPT_ADAPTER *ioc, if (ioc->bus_type != SAS) return; - ev = kzalloc(sizeof(*ev), GFP_ATOMIC); + ev = kmalloc(sizeof(*ev), GFP_ATOMIC); if (!ev) { printk(KERN_WARNING "mptsas: lost hotplug event\n"); return; } + memset(ev,0,sizeof(struct mptsas_hotplug_event)); INIT_WORK(&ev->work, mptsas_hotplug_work, ev); ev->ioc = ioc; ev->id = raid_event_data->VolumeID; @@ -2473,7 +2028,7 @@ mptsas_send_raid_event(MPT_ADAPTER *ioc, } static void -mptsas_send_discovery_event(MPT_ADAPTER *ioc, +mptscsih_send_discovery(MPT_ADAPTER *ioc, EVENT_DATA_SAS_DISCOVERY *discovery_data) { struct mptsas_discovery_event *ev; @@ -2488,10 +2043,11 @@ mptsas_send_discovery_event(MPT_ADAPTER *ioc, if (discovery_data->DiscoveryStatus) return; - ev = kzalloc(sizeof(*ev), GFP_ATOMIC); + ev = kmalloc(sizeof(*ev), GFP_ATOMIC); if (!ev) return; - INIT_WORK(&ev->work, mptsas_discovery_work, ev); + memset(ev,0,sizeof(struct mptsas_discovery_event)); + INIT_WORK(&ev->work, mptscsih_discovery_work, ev); ev->ioc = ioc; schedule_work(&ev->work); }; @@ -2519,21 +2075,21 @@ mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply) switch (event) { case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: - mptsas_send_sas_event(ioc, + mptscsih_send_sas_event(ioc, (EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *)reply->Data); break; case MPI_EVENT_INTEGRATED_RAID: - mptsas_send_raid_event(ioc, + mptscsih_send_raid_event(ioc, (EVENT_DATA_RAID *)reply->Data); break; case MPI_EVENT_PERSISTENT_TABLE_FULL: - INIT_WORK(&ioc->sas_persist_task, - mptsas_persist_clear_table, + INIT_WORK(&ioc->mptscsih_persistTask, + mptscsih_sas_persist_clear_table, (void *)ioc); - schedule_work(&ioc->sas_persist_task); + schedule_work(&ioc->mptscsih_persistTask); break; case MPI_EVENT_SAS_DISCOVERY: - mptsas_send_discovery_event(ioc, + mptscsih_send_discovery(ioc, (EVENT_DATA_SAS_DISCOVERY *)reply->Data); break; default: @@ -2752,7 +2308,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) return 0; - out_mptsas_probe: +out_mptsas_probe: mptscsih_remove(pdev); return error; @@ -2762,7 +2318,6 @@ static void __devexit mptsas_remove(struct pci_dev *pdev) { MPT_ADAPTER *ioc = pci_get_drvdata(pdev); struct mptsas_portinfo *p, *n; - int i; ioc->sas_discovery_ignore_events=1; sas_remove_host(ioc->sh); @@ -2770,9 +2325,8 @@ static void __devexit mptsas_remove(struct pci_dev *pdev) mutex_lock(&ioc->sas_topology_mutex); list_for_each_entry_safe(p, n, &ioc->sas_topology, list) { list_del(&p->list); - for (i = 0 ; i < p->num_phys ; i++) - mptsas_port_delete(p->phy_info[i].port_details); - kfree(p->phy_info); + if (p->phy_info) + kfree(p->phy_info); kfree(p); } mutex_unlock(&ioc->sas_topology_mutex); @@ -2781,15 +2335,17 @@ static void __devexit mptsas_remove(struct pci_dev *pdev) } static struct pci_device_id mptsas_pci_table[] = { - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1064, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1064, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1066, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1068, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1068, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1064E, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1064E, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1068E, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1066E, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_SAS1078, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1068E, PCI_ANY_ID, PCI_ANY_ID }, {0} /* Terminating entry */ }; diff --git a/trunk/drivers/message/fusion/mptspi.c b/trunk/drivers/message/fusion/mptspi.c index 0a1ff762205f..3201de053943 100644 --- a/trunk/drivers/message/fusion/mptspi.c +++ b/trunk/drivers/message/fusion/mptspi.c @@ -775,9 +775,9 @@ static struct spi_function_template mptspi_transport_functions = { */ static struct pci_device_id mptspi_pci_table[] = { - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1030, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030, PCI_ANY_ID, PCI_ANY_ID }, - { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1035, + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_1030_53C1035, PCI_ANY_ID, PCI_ANY_ID }, {0} /* Terminating entry */ }; diff --git a/trunk/drivers/message/i2o/debug.c b/trunk/drivers/message/i2o/debug.c index 8abe45e49ad7..5a6cca8e8c45 100644 --- a/trunk/drivers/message/i2o/debug.c +++ b/trunk/drivers/message/i2o/debug.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/drivers/message/i2o/pci.c b/trunk/drivers/message/i2o/pci.c index 1b58444d5aaf..4f1515cae5dc 100644 --- a/trunk/drivers/message/i2o/pci.c +++ b/trunk/drivers/message/i2o/pci.c @@ -274,7 +274,7 @@ static int i2o_pci_irq_enable(struct i2o_controller *c) writel(0xffffffff, c->irq_mask); if (pdev->irq) { - rc = request_irq(pdev->irq, i2o_pci_interrupt, IRQF_SHARED, + rc = request_irq(pdev->irq, i2o_pci_interrupt, SA_SHIRQ, c->name, c); if (rc < 0) { printk(KERN_ERR "%s: unable to allocate interrupt %d." diff --git a/trunk/drivers/mfd/ucb1x00-core.c b/trunk/drivers/mfd/ucb1x00-core.c index 632bc218c86a..c8426a9bf273 100644 --- a/trunk/drivers/mfd/ucb1x00-core.c +++ b/trunk/drivers/mfd/ucb1x00-core.c @@ -16,6 +16,7 @@ * Note that all locks are private to this file. Nothing else may * touch them. */ +#include #include #include #include @@ -508,7 +509,7 @@ static int ucb1x00_probe(struct mcp *mcp) goto err_free; } - ret = request_irq(ucb->irq, ucb1x00_irq, IRQF_TRIGGER_RISING, + ret = request_irq(ucb->irq, ucb1x00_irq, SA_TRIGGER_RISING, "UCB1x00", ucb); if (ret) { printk(KERN_ERR "ucb1x00: unable to grab irq%d: %d\n", diff --git a/trunk/drivers/mfd/ucb1x00-ts.c b/trunk/drivers/mfd/ucb1x00-ts.c index 02776814443e..79fd062ccb34 100644 --- a/trunk/drivers/mfd/ucb1x00-ts.c +++ b/trunk/drivers/mfd/ucb1x00-ts.c @@ -17,6 +17,7 @@ * pin should provide pulses even when the LCD is blanked, otherwise * a pen touch needed to unblank the LCD will never be read. */ +#include #include #include #include diff --git a/trunk/drivers/misc/ibmasm/ibmasm.h b/trunk/drivers/misc/ibmasm/ibmasm.h index 634d538ccd14..6aba41954448 100644 --- a/trunk/drivers/misc/ibmasm/ibmasm.h +++ b/trunk/drivers/misc/ibmasm/ibmasm.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/misc/ibmasm/module.c b/trunk/drivers/misc/ibmasm/module.c index 2f3bddfab937..9706cc19134a 100644 --- a/trunk/drivers/misc/ibmasm/module.c +++ b/trunk/drivers/misc/ibmasm/module.c @@ -113,7 +113,7 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi goto error_ioremap; } - result = request_irq(sp->irq, ibmasm_interrupt_handler, IRQF_SHARED, sp->devname, (void*)sp); + result = request_irq(sp->irq, ibmasm_interrupt_handler, SA_SHIRQ, sp->devname, (void*)sp); if (result) { dev_err(sp->dev, "Failed to register interrupt handler\n"); goto error_request_irq; diff --git a/trunk/drivers/mmc/at91_mci.c b/trunk/drivers/mmc/at91_mci.c index 6b7638b84290..3228516b7d19 100644 --- a/trunk/drivers/mmc/at91_mci.c +++ b/trunk/drivers/mmc/at91_mci.c @@ -53,6 +53,7 @@ Gets the status of the write protect pin, if available. */ +#include #include #include #include @@ -850,7 +851,7 @@ static int at91_mci_probe(struct platform_device *pdev) /* * Allocate the MCI interrupt */ - ret = request_irq(AT91_ID_MCI, at91_mci_irq, IRQF_SHARED, DRIVER_NAME, host); + ret = request_irq(AT91_ID_MCI, at91_mci_irq, SA_SHIRQ, DRIVER_NAME, host); if (ret) { printk(KERN_ERR "Failed to request MCI interrupt\n"); clk_disable(mci_clk); diff --git a/trunk/drivers/mmc/au1xmmc.c b/trunk/drivers/mmc/au1xmmc.c index fb606165af3b..5dc4bee7abeb 100644 --- a/trunk/drivers/mmc/au1xmmc.c +++ b/trunk/drivers/mmc/au1xmmc.c @@ -34,6 +34,7 @@ * So we use the timer to check the status manually. */ +#include #include #include #include @@ -886,7 +887,7 @@ static int __devinit au1xmmc_probe(struct platform_device *pdev) int i, ret = 0; /* THe interrupt is shared among all controllers */ - ret = request_irq(AU1100_SD_IRQ, au1xmmc_irq, IRQF_DISABLED, "MMC", 0); + ret = request_irq(AU1100_SD_IRQ, au1xmmc_irq, SA_INTERRUPT, "MMC", 0); if (ret) { printk(DRIVER_NAME "ERROR: Couldn't get int %d: %d\n", diff --git a/trunk/drivers/mmc/imxmmc.c b/trunk/drivers/mmc/imxmmc.c index 7ca9e95bdf89..5c62f4e6ad06 100644 --- a/trunk/drivers/mmc/imxmmc.c +++ b/trunk/drivers/mmc/imxmmc.c @@ -25,6 +25,7 @@ * deficiencies * */ +#include #ifdef CONFIG_MMC_DEBUG #define DEBUG diff --git a/trunk/drivers/mmc/mmc.c b/trunk/drivers/mmc/mmc.c index 33525bdf2ab6..6201f3086a02 100644 --- a/trunk/drivers/mmc/mmc.c +++ b/trunk/drivers/mmc/mmc.c @@ -9,6 +9,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -128,7 +129,7 @@ static void mmc_wait_done(struct mmc_request *mrq) int mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { - DECLARE_COMPLETION_ONSTACK(complete); + DECLARE_COMPLETION(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; diff --git a/trunk/drivers/mmc/mmci.c b/trunk/drivers/mmc/mmci.c index 1886562abdd4..8576a65ca1c3 100644 --- a/trunk/drivers/mmc/mmci.c +++ b/trunk/drivers/mmc/mmci.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -531,11 +532,11 @@ static int mmci_probe(struct amba_device *dev, void *id) writel(0, host->base + MMCIMASK1); writel(0xfff, host->base + MMCICLEAR); - ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host); + ret = request_irq(dev->irq[0], mmci_irq, SA_SHIRQ, DRIVER_NAME " (cmd)", host); if (ret) goto unmap; - ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, DRIVER_NAME " (pio)", host); + ret = request_irq(dev->irq[1], mmci_pio_irq, SA_SHIRQ, DRIVER_NAME " (pio)", host); if (ret) goto irq0_free; diff --git a/trunk/drivers/mmc/omap.c b/trunk/drivers/mmc/omap.c index ddf06b32c159..c25244b3657b 100644 --- a/trunk/drivers/mmc/omap.c +++ b/trunk/drivers/mmc/omap.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -60,7 +61,6 @@ struct mmc_omap_host { unsigned char id; /* 16xx chips have 2 MMC blocks */ struct clk * iclk; struct clk * fclk; - struct resource *res; void __iomem *base; int irq; unsigned char bus_mode; @@ -340,6 +340,8 @@ static void mmc_omap_xfer_data(struct mmc_omap_host *host, int write) { int n; + void __iomem *reg; + u16 *p; if (host->buffer_bytes_left == 0) { host->sg_idx++; @@ -656,12 +658,12 @@ static void mmc_omap_dma_cb(int lch, u16 ch_status, void *data) struct mmc_data *mmcdat = host->data; if (unlikely(host->dma_ch < 0)) { - dev_err(mmc_dev(host->mmc), - "DMA callback while DMA not enabled\n"); + dev_err(mmc_dev(host->mmc), "DMA callback while DMA not + enabled\n"); return; } /* FIXME: We really should do something to _handle_ the errors */ - if (ch_status & OMAP1_DMA_TOUT_IRQ) { + if (ch_status & OMAP_DMA_TOUT_IRQ) { dev_err(mmc_dev(host->mmc),"DMA timeout\n"); return; } @@ -971,20 +973,20 @@ static int __init mmc_omap_probe(struct platform_device *pdev) struct omap_mmc_conf *minfo = pdev->dev.platform_data; struct mmc_host *mmc; struct mmc_omap_host *host = NULL; - struct resource *r; int ret = 0; - int irq; - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - irq = platform_get_irq(pdev, 0); - if (!r || irq < 0) - return -ENXIO; + if (platform_get_resource(pdev, IORESOURCE_MEM, 0) || + platform_get_irq(pdev, IORESOURCE_IRQ, 0)) { + dev_err(&pdev->dev, "mmc_omap_probe: invalid resource type\n"); + return -ENODEV; + } - r = request_mem_region(pdev->resource[0].start, + if (!request_mem_region(pdev->resource[0].start, pdev->resource[0].end - pdev->resource[0].start + 1, - pdev->name); - if (!r) + pdev->name)) { + dev_dbg(&pdev->dev, "request_mem_region failed\n"); return -EBUSY; + } mmc = mmc_alloc_host(sizeof(struct mmc_omap_host), &pdev->dev); if (!mmc) { @@ -1001,8 +1003,6 @@ static int __init mmc_omap_probe(struct platform_device *pdev) host->dma_timer.data = (unsigned long) host; host->id = pdev->id; - host->res = r; - host->irq = irq; if (cpu_is_omap24xx()) { host->iclk = clk_get(&pdev->dev, "mmc_ick"); @@ -1032,9 +1032,13 @@ static int __init mmc_omap_probe(struct platform_device *pdev) host->dma_ch = -1; host->irq = pdev->resource[1].start; - host->base = (void __iomem*)IO_ADDRESS(r->start); + host->base = ioremap(pdev->res.start, SZ_4K); + if (!host->base) { + ret = -ENOMEM; + goto out; + } - if (minfo->wire4) + if (minfo->wire4) mmc->caps |= MMC_CAP_4_BIT_DATA; mmc->ops = &mmc_omap_ops; @@ -1053,8 +1057,8 @@ static int __init mmc_omap_probe(struct platform_device *pdev) if (host->power_pin >= 0) { if ((ret = omap_request_gpio(host->power_pin)) != 0) { - dev_err(mmc_dev(host->mmc), - "Unable to get GPIO pin for MMC power\n"); + dev_err(mmc_dev(host->mmc), "Unable to get GPIO + pin for MMC power\n"); goto out; } omap_set_gpio_direction(host->power_pin, 0); @@ -1082,7 +1086,7 @@ static int __init mmc_omap_probe(struct platform_device *pdev) omap_set_gpio_direction(host->switch_pin, 1); ret = request_irq(OMAP_GPIO_IRQ(host->switch_pin), - mmc_omap_switch_irq, IRQF_TRIGGER_RISING, DRIVER_NAME, host); + mmc_omap_switch_irq, SA_TRIGGER_RISING, DRIVER_NAME, host); if (ret) { dev_warn(mmc_dev(host->mmc), "Unable to get IRQ for MMC cover switch\n"); omap_free_gpio(host->switch_pin); @@ -1096,7 +1100,7 @@ static int __init mmc_omap_probe(struct platform_device *pdev) device_remove_file(&pdev->dev, &dev_attr_cover_switch); } if (ret) { - dev_warn(mmc_dev(host->mmc), "Unable to create sysfs attributes\n"); + dev_wan(mmc_dev(host->mmc), "Unable to create sysfs attributes\n"); free_irq(OMAP_GPIO_IRQ(host->switch_pin), host); omap_free_gpio(host->switch_pin); host->switch_pin = -1; diff --git a/trunk/drivers/mmc/pxamci.c b/trunk/drivers/mmc/pxamci.c index ef350908478c..b49368fd96b8 100644 --- a/trunk/drivers/mmc/pxamci.c +++ b/trunk/drivers/mmc/pxamci.c @@ -16,6 +16,7 @@ * 1 and 3 byte data transfers not supported * max block length up to 1023 */ +#include #include #include #include diff --git a/trunk/drivers/mmc/sdhci.c b/trunk/drivers/mmc/sdhci.c index 893319108ba4..8e9100bd57ef 100644 --- a/trunk/drivers/mmc/sdhci.c +++ b/trunk/drivers/mmc/sdhci.c @@ -8,6 +8,12 @@ * published by the Free Software Foundation. */ + /* + * Note that PIO transfer is rather crappy atm. The buffer full/empty + * interrupts aren't reliable so we currently transfer the entire buffer + * directly. Patches to solve the problem are welcome. + */ + #include #include #include @@ -21,50 +27,16 @@ #include "sdhci.h" #define DRIVER_NAME "sdhci" -#define DRIVER_VERSION "0.12" +#define DRIVER_VERSION "0.11" #define BUGMAIL "" #define DBG(f, x...) \ pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x) -static unsigned int debug_nodma = 0; -static unsigned int debug_forcedma = 0; -static unsigned int debug_quirks = 0; - -#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0) -#define SDHCI_QUIRK_FORCE_DMA (1<<1) - static const struct pci_device_id pci_ids[] __devinitdata = { - { - .vendor = PCI_VENDOR_ID_RICOH, - .device = PCI_DEVICE_ID_RICOH_R5C822, - .subvendor = PCI_VENDOR_ID_IBM, - .subdevice = PCI_ANY_ID, - .driver_data = SDHCI_QUIRK_CLOCK_BEFORE_RESET | - SDHCI_QUIRK_FORCE_DMA, - }, - - { - .vendor = PCI_VENDOR_ID_RICOH, - .device = PCI_DEVICE_ID_RICOH_R5C822, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - .driver_data = SDHCI_QUIRK_FORCE_DMA, - }, - - { - .vendor = PCI_VENDOR_ID_TI, - .device = PCI_DEVICE_ID_TI_XX21_XX11_SD, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - .driver_data = SDHCI_QUIRK_FORCE_DMA, - }, - - { /* Generic SD host controller */ - PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00) - }, - + /* handle any SD host controller */ + {PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)}, { /* end: all zeroes */ }, }; @@ -122,27 +94,12 @@ static void sdhci_dumpregs(struct sdhci_host *host) static void sdhci_reset(struct sdhci_host *host, u8 mask) { - unsigned long timeout; - writeb(mask, host->ioaddr + SDHCI_SOFTWARE_RESET); - if (mask & SDHCI_RESET_ALL) + if (mask & SDHCI_RESET_ALL) { host->clock = 0; - /* Wait max 100 ms */ - timeout = 100; - - /* hw clears the bit when it's done */ - while (readb(host->ioaddr + SDHCI_SOFTWARE_RESET) & mask) { - if (timeout == 0) { - printk(KERN_ERR "%s: Reset 0x%x never completed. " - "Please report this to " BUGMAIL ".\n", - mmc_hostname(host->mmc), (int)mask); - sdhci_dumpregs(host); - return; - } - timeout--; - mdelay(1); + mdelay(50); } } @@ -152,15 +109,13 @@ static void sdhci_init(struct sdhci_host *host) sdhci_reset(host, SDHCI_RESET_ALL); - intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | - SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | - SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | - SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT | - SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | - SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE; + intmask = ~(SDHCI_INT_CARD_INT | SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL); writel(intmask, host->ioaddr + SDHCI_INT_ENABLE); writel(intmask, host->ioaddr + SDHCI_SIGNAL_ENABLE); + + /* This is unknown magic. */ + writeb(0xE, host->ioaddr + SDHCI_TIMEOUT_CONTROL); } static void sdhci_activate_led(struct sdhci_host *host) @@ -217,96 +172,79 @@ static inline int sdhci_next_sg(struct sdhci_host* host) return host->num_sg; } -static void sdhci_read_block_pio(struct sdhci_host *host) +static void sdhci_transfer_pio(struct sdhci_host *host) { - int blksize, chunk_remain; - u32 data; char *buffer; - int size; + u32 mask; + int bytes, size; + unsigned long max_jiffies; - DBG("PIO reading\n"); + BUG_ON(!host->data); - blksize = host->data->blksz; - chunk_remain = 0; - data = 0; + if (host->num_sg == 0) + return; - buffer = sdhci_kmap_sg(host) + host->offset; + bytes = 0; + if (host->data->flags & MMC_DATA_READ) + mask = SDHCI_DATA_AVAILABLE; + else + mask = SDHCI_SPACE_AVAILABLE; - while (blksize) { - if (chunk_remain == 0) { - data = readl(host->ioaddr + SDHCI_BUFFER); - chunk_remain = min(blksize, 4); - } + buffer = sdhci_kmap_sg(host) + host->offset; - size = min(host->size, host->remain); - size = min(size, chunk_remain); + /* Transfer shouldn't take more than 5 s */ + max_jiffies = jiffies + HZ * 5; - chunk_remain -= size; - blksize -= size; - host->offset += size; - host->remain -= size; - host->size -= size; - while (size) { - *buffer = data & 0xFF; - buffer++; - data >>= 8; - size--; - } + while (host->size > 0) { + if (time_after(jiffies, max_jiffies)) { + printk(KERN_ERR "%s: PIO transfer stalled. " + "Please report this to " + BUGMAIL ".\n", mmc_hostname(host->mmc)); + sdhci_dumpregs(host); - if (host->remain == 0) { sdhci_kunmap_sg(host); - if (sdhci_next_sg(host) == 0) { - BUG_ON(blksize != 0); - return; - } - buffer = sdhci_kmap_sg(host); - } - } - - sdhci_kunmap_sg(host); -} -static void sdhci_write_block_pio(struct sdhci_host *host) -{ - int blksize, chunk_remain; - u32 data; - char *buffer; - int bytes, size; - - DBG("PIO writing\n"); - - blksize = host->data->blksz; - chunk_remain = 4; - data = 0; + host->data->error = MMC_ERR_FAILED; + sdhci_finish_data(host); + return; + } - bytes = 0; - buffer = sdhci_kmap_sg(host) + host->offset; + if (!(readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask)) + continue; - while (blksize) { size = min(host->size, host->remain); - size = min(size, chunk_remain); - chunk_remain -= size; - blksize -= size; + if (size >= 4) { + if (host->data->flags & MMC_DATA_READ) + *(u32*)buffer = readl(host->ioaddr + SDHCI_BUFFER); + else + writel(*(u32*)buffer, host->ioaddr + SDHCI_BUFFER); + size = 4; + } else if (size >= 2) { + if (host->data->flags & MMC_DATA_READ) + *(u16*)buffer = readw(host->ioaddr + SDHCI_BUFFER); + else + writew(*(u16*)buffer, host->ioaddr + SDHCI_BUFFER); + size = 2; + } else { + if (host->data->flags & MMC_DATA_READ) + *(u8*)buffer = readb(host->ioaddr + SDHCI_BUFFER); + else + writeb(*(u8*)buffer, host->ioaddr + SDHCI_BUFFER); + size = 1; + } + + buffer += size; host->offset += size; host->remain -= size; - host->size -= size; - while (size) { - data >>= 8; - data |= (u32)*buffer << 24; - buffer++; - size--; - } - if (chunk_remain == 0) { - writel(data, host->ioaddr + SDHCI_BUFFER); - chunk_remain = min(blksize, 4); - } + bytes += size; + host->size -= size; if (host->remain == 0) { sdhci_kunmap_sg(host); if (sdhci_next_sg(host) == 0) { - BUG_ON(blksize != 0); + DBG("PIO transfer: %d bytes\n", bytes); return; } buffer = sdhci_kmap_sg(host); @@ -314,87 +252,38 @@ static void sdhci_write_block_pio(struct sdhci_host *host) } sdhci_kunmap_sg(host); -} - -static void sdhci_transfer_pio(struct sdhci_host *host) -{ - u32 mask; - - BUG_ON(!host->data); - - if (host->size == 0) - return; - - if (host->data->flags & MMC_DATA_READ) - mask = SDHCI_DATA_AVAILABLE; - else - mask = SDHCI_SPACE_AVAILABLE; - - while (readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask) { - if (host->data->flags & MMC_DATA_READ) - sdhci_read_block_pio(host); - else - sdhci_write_block_pio(host); - - if (host->size == 0) - break; - - BUG_ON(host->num_sg == 0); - } - DBG("PIO transfer complete.\n"); + DBG("PIO transfer: %d bytes\n", bytes); } static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data) { - u8 count; - unsigned target_timeout, current_timeout; + u16 mode; WARN_ON(host->data); - if (data == NULL) + if (data == NULL) { + writew(0, host->ioaddr + SDHCI_TRANSFER_MODE); return; + } DBG("blksz %04x blks %04x flags %08x\n", data->blksz, data->blocks, data->flags); DBG("tsac %d ms nsac %d clk\n", data->timeout_ns / 1000000, data->timeout_clks); - /* Sanity checks */ - BUG_ON(data->blksz * data->blocks > 524288); - BUG_ON(data->blksz > host->max_block); - BUG_ON(data->blocks > 65535); - - /* timeout in us */ - target_timeout = data->timeout_ns / 1000 + - data->timeout_clks / host->clock; - - /* - * Figure out needed cycles. - * We do this in steps in order to fit inside a 32 bit int. - * The first step is the minimum timeout, which will have a - * minimum resolution of 6 bits: - * (1) 2^13*1000 > 2^22, - * (2) host->timeout_clk < 2^16 - * => - * (1) / (2) > 2^6 - */ - count = 0; - current_timeout = (1 << 13) * 1000 / host->timeout_clk; - while (current_timeout < target_timeout) { - count++; - current_timeout <<= 1; - if (count >= 0xF) - break; - } + mode = SDHCI_TRNS_BLK_CNT_EN; + if (data->blocks > 1) + mode |= SDHCI_TRNS_MULTI; + if (data->flags & MMC_DATA_READ) + mode |= SDHCI_TRNS_READ; + if (host->flags & SDHCI_USE_DMA) + mode |= SDHCI_TRNS_DMA; - if (count >= 0xF) { - printk(KERN_WARNING "%s: Too large timeout requested!\n", - mmc_hostname(host->mmc)); - count = 0xE; - } + writew(mode, host->ioaddr + SDHCI_TRANSFER_MODE); - writeb(count, host->ioaddr + SDHCI_TIMEOUT_CONTROL); + writew(data->blksz, host->ioaddr + SDHCI_BLOCK_SIZE); + writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT); if (host->flags & SDHCI_USE_DMA) { int count; @@ -413,37 +302,12 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data) host->offset = 0; host->remain = host->cur_sg->length; } - - /* We do not handle DMA boundaries, so set it to max (512 KiB) */ - writew(SDHCI_MAKE_BLKSZ(7, data->blksz), - host->ioaddr + SDHCI_BLOCK_SIZE); - writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT); -} - -static void sdhci_set_transfer_mode(struct sdhci_host *host, - struct mmc_data *data) -{ - u16 mode; - - WARN_ON(host->data); - - if (data == NULL) - return; - - mode = SDHCI_TRNS_BLK_CNT_EN; - if (data->blocks > 1) - mode |= SDHCI_TRNS_MULTI; - if (data->flags & MMC_DATA_READ) - mode |= SDHCI_TRNS_READ; - if (host->flags & SDHCI_USE_DMA) - mode |= SDHCI_TRNS_DMA; - - writew(mode, host->ioaddr + SDHCI_TRANSFER_MODE); } static void sdhci_finish_data(struct sdhci_host *host) { struct mmc_data *data; + u32 intmask; u16 blocks; BUG_ON(!host->data); @@ -454,6 +318,14 @@ static void sdhci_finish_data(struct sdhci_host *host) if (host->flags & SDHCI_USE_DMA) { pci_unmap_sg(host->chip->pdev, data->sg, data->sg_len, (data->flags & MMC_DATA_READ)?PCI_DMA_FROMDEVICE:PCI_DMA_TODEVICE); + } else { + intmask = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE); + intmask &= ~(SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL); + writel(intmask, host->ioaddr + SDHCI_SIGNAL_ENABLE); + + intmask = readl(host->ioaddr + SDHCI_INT_ENABLE); + intmask &= ~(SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL); + writel(intmask, host->ioaddr + SDHCI_INT_ENABLE); } /* @@ -470,7 +342,9 @@ static void sdhci_finish_data(struct sdhci_host *host) "though there were blocks left. Please report this " "to " BUGMAIL ".\n", mmc_hostname(host->mmc)); data->error = MMC_ERR_FAILED; - } else if (host->size != 0) { + } + + if (host->size != 0) { printk(KERN_ERR "%s: %d bytes were left untransferred. " "Please report this to " BUGMAIL ".\n", mmc_hostname(host->mmc), host->size); @@ -497,38 +371,27 @@ static void sdhci_finish_data(struct sdhci_host *host) static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) { int flags; - u32 mask; - unsigned long timeout; + u32 present; + unsigned long max_jiffies; WARN_ON(host->cmd); DBG("Sending cmd (%x)\n", cmd->opcode); /* Wait max 10 ms */ - timeout = 10; - - mask = SDHCI_CMD_INHIBIT; - if ((cmd->data != NULL) || (cmd->flags & MMC_RSP_BUSY)) - mask |= SDHCI_DATA_INHIBIT; - - /* We shouldn't wait for data inihibit for stop commands, even - though they might use busy signaling */ - if (host->mrq->data && (cmd == host->mrq->data->stop)) - mask &= ~SDHCI_DATA_INHIBIT; - - while (readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask) { - if (timeout == 0) { + max_jiffies = jiffies + (HZ + 99)/100; + do { + if (time_after(jiffies, max_jiffies)) { printk(KERN_ERR "%s: Controller never released " - "inhibit bit(s). Please report this to " + "inhibit bits. Please report this to " BUGMAIL ".\n", mmc_hostname(host->mmc)); sdhci_dumpregs(host); cmd->error = MMC_ERR_FAILED; tasklet_schedule(&host->finish_tasklet); return; } - timeout--; - mdelay(1); - } + present = readl(host->ioaddr + SDHCI_PRESENT_STATE); + } while (present & (SDHCI_CMD_INHIBIT | SDHCI_DATA_INHIBIT)); mod_timer(&host->timer, jiffies + 10 * HZ); @@ -538,8 +401,6 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) writel(cmd->arg, host->ioaddr + SDHCI_ARGUMENT); - sdhci_set_transfer_mode(host, cmd->data); - if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) { printk(KERN_ERR "%s: Unsupported response type! " "Please report this to " BUGMAIL ".\n", @@ -595,9 +456,31 @@ static void sdhci_finish_command(struct sdhci_host *host) DBG("Ending cmd (%x)\n", host->cmd->opcode); - if (host->cmd->data) + if (host->cmd->data) { + u32 intmask; + host->data = host->cmd->data; - else + + if (!(host->flags & SDHCI_USE_DMA)) { + /* + * Don't enable the interrupts until now to make sure we + * get stable handling of the FIFO. + */ + intmask = readl(host->ioaddr + SDHCI_INT_ENABLE); + intmask |= SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL; + writel(intmask, host->ioaddr + SDHCI_INT_ENABLE); + + intmask = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE); + intmask |= SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL; + writel(intmask, host->ioaddr + SDHCI_SIGNAL_ENABLE); + + /* + * The buffer interrupts are to unreliable so we + * start the transfer immediatly. + */ + sdhci_transfer_pio(host); + } + } else tasklet_schedule(&host->finish_tasklet); host->cmd = NULL; @@ -607,7 +490,7 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) { int div; u16 clk; - unsigned long timeout; + unsigned long max_jiffies; if (clock == host->clock) return; @@ -628,19 +511,17 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) writew(clk, host->ioaddr + SDHCI_CLOCK_CONTROL); /* Wait max 10 ms */ - timeout = 10; - while (!((clk = readw(host->ioaddr + SDHCI_CLOCK_CONTROL)) - & SDHCI_CLOCK_INT_STABLE)) { - if (timeout == 0) { + max_jiffies = jiffies + (HZ + 99)/100; + do { + if (time_after(jiffies, max_jiffies)) { printk(KERN_ERR "%s: Internal clock never stabilised. " "Please report this to " BUGMAIL ".\n", mmc_hostname(host->mmc)); sdhci_dumpregs(host); return; } - timeout--; - mdelay(1); - } + clk = readw(host->ioaddr + SDHCI_CLOCK_CONTROL); + } while (!(clk & SDHCI_CLOCK_INT_STABLE)); clk |= SDHCI_CLOCK_CARD_EN; writew(clk, host->ioaddr + SDHCI_CLOCK_CONTROL); @@ -649,46 +530,6 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) host->clock = clock; } -static void sdhci_set_power(struct sdhci_host *host, unsigned short power) -{ - u8 pwr; - - if (host->power == power) - return; - - writeb(0, host->ioaddr + SDHCI_POWER_CONTROL); - - if (power == (unsigned short)-1) - goto out; - - pwr = SDHCI_POWER_ON; - - switch (power) { - case MMC_VDD_170: - case MMC_VDD_180: - case MMC_VDD_190: - pwr |= SDHCI_POWER_180; - break; - case MMC_VDD_290: - case MMC_VDD_300: - case MMC_VDD_310: - pwr |= SDHCI_POWER_300; - break; - case MMC_VDD_320: - case MMC_VDD_330: - case MMC_VDD_340: - pwr |= SDHCI_POWER_330; - break; - default: - BUG(); - } - - writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL); - -out: - host->power = power; -} - /*****************************************************************************\ * * * MMC callbacks * @@ -735,15 +576,17 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) */ if (ios->power_mode == MMC_POWER_OFF) { writel(0, host->ioaddr + SDHCI_SIGNAL_ENABLE); + spin_unlock_irqrestore(&host->lock, flags); sdhci_init(host); + spin_lock_irqsave(&host->lock, flags); } sdhci_set_clock(host, ios->clock); if (ios->power_mode == MMC_POWER_OFF) - sdhci_set_power(host, -1); + writeb(0, host->ioaddr + SDHCI_POWER_CONTROL); else - sdhci_set_power(host, ios->vdd); + writeb(0xFF, host->ioaddr + SDHCI_POWER_CONTROL); ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); if (ios->bus_width == MMC_BUS_WIDTH_4) @@ -836,19 +679,6 @@ static void sdhci_tasklet_finish(unsigned long param) if ((mrq->cmd->error != MMC_ERR_NONE) || (mrq->data && ((mrq->data->error != MMC_ERR_NONE) || (mrq->data->stop && (mrq->data->stop->error != MMC_ERR_NONE))))) { - - /* Some controllers need this kick or reset won't work here */ - if (host->chip->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET) { - unsigned int clock; - - /* This is to force an update */ - clock = host->clock; - host->clock = 0; - sdhci_set_clock(host, clock); - } - - /* Spec says we should do both at the same time, but Ricoh - controllers do not like that. */ sdhci_reset(host, SDHCI_RESET_CMD); sdhci_reset(host, SDHCI_RESET_DATA); } @@ -963,7 +793,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) if (host->data->error != MMC_ERR_NONE) sdhci_finish_data(host); else { - if (intmask & (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL)) + if (intmask & (SDHCI_INT_BUF_FULL | SDHCI_INT_BUF_EMPTY)) sdhci_transfer_pio(host); if (intmask & SDHCI_INT_DATA_END) @@ -988,45 +818,51 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id, struct pt_regs *regs) DBG("*** %s got interrupt: 0x%08x\n", host->slot_descr, intmask); - if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { - writel(intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE), - host->ioaddr + SDHCI_INT_STATUS); + if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) tasklet_schedule(&host->card_tasklet); - } - - intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); if (intmask & SDHCI_INT_CMD_MASK) { + sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK); + writel(intmask & SDHCI_INT_CMD_MASK, host->ioaddr + SDHCI_INT_STATUS); - sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK); } if (intmask & SDHCI_INT_DATA_MASK) { + sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK); + writel(intmask & SDHCI_INT_DATA_MASK, host->ioaddr + SDHCI_INT_STATUS); - sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK); } intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK); - if (intmask & SDHCI_INT_BUS_POWER) { - printk(KERN_ERR "%s: Card is consuming too much power!\n", + if (intmask & SDHCI_INT_CARD_INT) { + printk(KERN_ERR "%s: Unexpected card interrupt. Please " + "report this to " BUGMAIL ".\n", mmc_hostname(host->mmc)); - writel(SDHCI_INT_BUS_POWER, host->ioaddr + SDHCI_INT_STATUS); + sdhci_dumpregs(host); } - intmask &= SDHCI_INT_BUS_POWER; + if (intmask & SDHCI_INT_BUS_POWER) { + printk(KERN_ERR "%s: Unexpected bus power interrupt. Please " + "report this to " BUGMAIL ".\n", + mmc_hostname(host->mmc)); + sdhci_dumpregs(host); + } - if (intmask) { - printk(KERN_ERR "%s: Unexpected interrupt 0x%08x. Please " + if (intmask & SDHCI_INT_ACMD12ERR) { + printk(KERN_ERR "%s: Unexpected auto CMD12 error. Please " "report this to " BUGMAIL ".\n", - mmc_hostname(host->mmc), intmask); + mmc_hostname(host->mmc)); sdhci_dumpregs(host); - writel(intmask, host->ioaddr + SDHCI_INT_STATUS); + writew(~0, host->ioaddr + SDHCI_ACMD12_ERR); } + if (intmask) + writel(intmask, host->ioaddr + SDHCI_INT_STATUS); + result = IRQ_HANDLED; out: @@ -1118,7 +954,6 @@ static int sdhci_resume (struct pci_dev *pdev) static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) { int ret; - unsigned int version; struct sdhci_chip *chip; struct mmc_host *mmc; struct sdhci_host *host; @@ -1150,16 +985,6 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) return -ENODEV; } - if ((pdev->class & 0x0000FF) == PCI_SDHCI_IFVENDOR) { - printk(KERN_ERR DRIVER_NAME ": Vendor specific interface. Aborting.\n"); - return -ENODEV; - } - - if ((pdev->class & 0x0000FF) > PCI_SDHCI_IFVENDOR) { - printk(KERN_ERR DRIVER_NAME ": Unknown interface. Aborting.\n"); - return -ENODEV; - } - mmc = mmc_alloc_host(sizeof(struct sdhci_host), &pdev->dev); if (!mmc) return -ENOMEM; @@ -1187,32 +1012,9 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) goto release; } - sdhci_reset(host, SDHCI_RESET_ALL); - - version = readw(host->ioaddr + SDHCI_HOST_VERSION); - version = (version & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT; - if (version != 0) { - printk(KERN_ERR "%s: Unknown controller version (%d). " - "Cowardly refusing to continue.\n", host->slot_descr, - version); - ret = -ENODEV; - goto unmap; - } - caps = readl(host->ioaddr + SDHCI_CAPABILITIES); - if (debug_nodma) - DBG("DMA forced off\n"); - else if (debug_forcedma) { - DBG("DMA forced on\n"); - host->flags |= SDHCI_USE_DMA; - } else if (chip->quirks & SDHCI_QUIRK_FORCE_DMA) - host->flags |= SDHCI_USE_DMA; - else if ((pdev->class & 0x0000FF) != PCI_SDHCI_IFDMA) - DBG("Controller doesn't have DMA interface\n"); - else if (!(caps & SDHCI_CAN_DO_DMA)) - DBG("Controller doesn't have DMA capability\n"); - else + if ((caps & SDHCI_CAN_DO_DMA) && ((pdev->class & 0x0000FF) == 0x01)) host->flags |= SDHCI_USE_DMA; if (host->flags & SDHCI_USE_DMA) { @@ -1228,59 +1030,18 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) else /* XXX: Hack to get MMC layer to avoid highmem */ pdev->dma_mask = 0; - host->max_clk = - (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; - if (host->max_clk == 0) { - printk(KERN_ERR "%s: Hardware doesn't specify base clock " - "frequency.\n", host->slot_descr); - ret = -ENODEV; - goto unmap; - } + host->max_clk = (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; host->max_clk *= 1000000; - host->timeout_clk = - (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; - if (host->timeout_clk == 0) { - printk(KERN_ERR "%s: Hardware doesn't specify timeout clock " - "frequency.\n", host->slot_descr); - ret = -ENODEV; - goto unmap; - } - if (caps & SDHCI_TIMEOUT_CLK_UNIT) - host->timeout_clk *= 1000; - - host->max_block = (caps & SDHCI_MAX_BLOCK_MASK) >> SDHCI_MAX_BLOCK_SHIFT; - if (host->max_block >= 3) { - printk(KERN_ERR "%s: Invalid maximum block size.\n", - host->slot_descr); - ret = -ENODEV; - goto unmap; - } - host->max_block = 512 << host->max_block; - /* * Set host parameters. */ mmc->ops = &sdhci_ops; mmc->f_min = host->max_clk / 256; mmc->f_max = host->max_clk; + mmc->ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34; mmc->caps = MMC_CAP_4_BIT_DATA; - mmc->ocr_avail = 0; - if (caps & SDHCI_CAN_VDD_330) - mmc->ocr_avail |= MMC_VDD_32_33|MMC_VDD_33_34; - else if (caps & SDHCI_CAN_VDD_300) - mmc->ocr_avail |= MMC_VDD_29_30|MMC_VDD_30_31; - else if (caps & SDHCI_CAN_VDD_180) - mmc->ocr_avail |= MMC_VDD_17_18|MMC_VDD_18_19; - - if (mmc->ocr_avail == 0) { - printk(KERN_ERR "%s: Hardware doesn't report any " - "support voltages.\n", host->slot_descr); - ret = -ENODEV; - goto unmap; - } - spin_lock_init(&host->lock); /* @@ -1293,10 +1054,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) mmc->max_phys_segs = 16; /* - * Maximum number of sectors in one transfer. Limited by DMA boundary - * size (512KiB), which means (512 KiB/512=) 1024 entries. + * Maximum number of sectors in one transfer. Limited by sector + * count register. */ - mmc->max_sectors = 1024; + mmc->max_sectors = 0x3FFF; /* * Maximum segment size. Could be one segment with the maximum number @@ -1314,10 +1075,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) setup_timer(&host->timer, sdhci_timeout_timer, (long)host); - ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED, + ret = request_irq(host->irq, sdhci_irq, SA_SHIRQ, host->slot_descr, host); if (ret) - goto untasklet; + goto unmap; sdhci_init(host); @@ -1336,10 +1097,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) return 0; -untasklet: +unmap: tasklet_kill(&host->card_tasklet); tasklet_kill(&host->finish_tasklet); -unmap: + iounmap(host->ioaddr); release: pci_release_region(pdev, host->bar); @@ -1383,18 +1144,13 @@ static int __devinit sdhci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { int ret, i; - u8 slots, rev; + u8 slots; struct sdhci_chip *chip; BUG_ON(pdev == NULL); BUG_ON(ent == NULL); - pci_read_config_byte(pdev, PCI_CLASS_REVISION, &rev); - - printk(KERN_INFO DRIVER_NAME - ": SDHCI controller found at %s [%04x:%04x] (rev %x)\n", - pci_name(pdev), (int)pdev->vendor, (int)pdev->device, - (int)rev); + DBG("found at %s\n", pci_name(pdev)); ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &slots); if (ret) @@ -1417,10 +1173,6 @@ static int __devinit sdhci_probe(struct pci_dev *pdev, } chip->pdev = pdev; - chip->quirks = ent->driver_data; - - if (debug_quirks) - chip->quirks = debug_quirks; chip->num_slots = slots; pci_set_drvdata(pdev, chip); @@ -1499,15 +1251,7 @@ static void __exit sdhci_drv_exit(void) module_init(sdhci_drv_init); module_exit(sdhci_drv_exit); -module_param(debug_nodma, uint, 0444); -module_param(debug_forcedma, uint, 0444); -module_param(debug_quirks, uint, 0444); - MODULE_AUTHOR("Pierre Ossman "); MODULE_DESCRIPTION("Secure Digital Host Controller Interface driver"); MODULE_VERSION(DRIVER_VERSION); MODULE_LICENSE("GPL"); - -MODULE_PARM_DESC(debug_nodma, "Forcefully disable DMA transfers. (default 0)"); -MODULE_PARM_DESC(debug_forcedma, "Forcefully enable DMA transfers. (default 0)"); -MODULE_PARM_DESC(debug_quirks, "Force certain quirks."); diff --git a/trunk/drivers/mmc/sdhci.h b/trunk/drivers/mmc/sdhci.h index f2453343f783..3b270ef486b4 100644 --- a/trunk/drivers/mmc/sdhci.h +++ b/trunk/drivers/mmc/sdhci.h @@ -12,10 +12,6 @@ * PCI registers */ -#define PCI_SDHCI_IFPIO 0x00 -#define PCI_SDHCI_IFDMA 0x01 -#define PCI_SDHCI_IFVENDOR 0x02 - #define PCI_SLOT_INFO 0x40 /* 8 bits */ #define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7) #define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07 @@ -27,7 +23,6 @@ #define SDHCI_DMA_ADDRESS 0x00 #define SDHCI_BLOCK_SIZE 0x04 -#define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF)) #define SDHCI_BLOCK_COUNT 0x06 @@ -72,10 +67,6 @@ #define SDHCI_CTRL_4BITBUS 0x02 #define SDHCI_POWER_CONTROL 0x29 -#define SDHCI_POWER_ON 0x01 -#define SDHCI_POWER_180 0x0A -#define SDHCI_POWER_300 0x0C -#define SDHCI_POWER_330 0x0E #define SDHCI_BLOCK_GAP_CONTROL 0x2A @@ -100,8 +91,8 @@ #define SDHCI_INT_RESPONSE 0x00000001 #define SDHCI_INT_DATA_END 0x00000002 #define SDHCI_INT_DMA_END 0x00000008 -#define SDHCI_INT_SPACE_AVAIL 0x00000010 -#define SDHCI_INT_DATA_AVAIL 0x00000020 +#define SDHCI_INT_BUF_EMPTY 0x00000010 +#define SDHCI_INT_BUF_FULL 0x00000020 #define SDHCI_INT_CARD_INSERT 0x00000040 #define SDHCI_INT_CARD_REMOVE 0x00000080 #define SDHCI_INT_CARD_INT 0x00000100 @@ -121,7 +112,7 @@ #define SDHCI_INT_CMD_MASK (SDHCI_INT_RESPONSE | SDHCI_INT_TIMEOUT | \ SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX) #define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \ - SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \ + SDHCI_INT_BUF_EMPTY | SDHCI_INT_BUF_FULL | \ SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \ SDHCI_INT_DATA_END_BIT) @@ -130,17 +121,9 @@ /* 3E-3F reserved */ #define SDHCI_CAPABILITIES 0x40 -#define SDHCI_TIMEOUT_CLK_MASK 0x0000003F -#define SDHCI_TIMEOUT_CLK_SHIFT 0 -#define SDHCI_TIMEOUT_CLK_UNIT 0x00000080 +#define SDHCI_CAN_DO_DMA 0x00400000 #define SDHCI_CLOCK_BASE_MASK 0x00003F00 #define SDHCI_CLOCK_BASE_SHIFT 8 -#define SDHCI_MAX_BLOCK_MASK 0x00030000 -#define SDHCI_MAX_BLOCK_SHIFT 16 -#define SDHCI_CAN_DO_DMA 0x00400000 -#define SDHCI_CAN_VDD_330 0x01000000 -#define SDHCI_CAN_VDD_300 0x02000000 -#define SDHCI_CAN_VDD_180 0x04000000 /* 44-47 reserved for more caps */ @@ -153,10 +136,6 @@ #define SDHCI_SLOT_INT_STATUS 0xFC #define SDHCI_HOST_VERSION 0xFE -#define SDHCI_VENDOR_VER_MASK 0xFF00 -#define SDHCI_VENDOR_VER_SHIFT 8 -#define SDHCI_SPEC_VER_MASK 0x00FF -#define SDHCI_SPEC_VER_SHIFT 0 struct sdhci_chip; @@ -170,11 +149,8 @@ struct sdhci_host { #define SDHCI_USE_DMA (1<<0) unsigned int max_clk; /* Max possible freq (MHz) */ - unsigned int timeout_clk; /* Timeout freq (KHz) */ - unsigned int max_block; /* Max block size (bytes) */ unsigned int clock; /* Current clock (MHz) */ - unsigned short power; /* Current voltage */ struct mmc_request *mrq; /* Current request */ struct mmc_command *cmd; /* Current command */ @@ -204,8 +180,6 @@ struct sdhci_host { struct sdhci_chip { struct pci_dev *pdev; - unsigned long quirks; - int num_slots; /* Slots on controller */ struct sdhci_host *hosts[0]; /* Pointers to hosts */ }; diff --git a/trunk/drivers/mmc/wbsd.c b/trunk/drivers/mmc/wbsd.c index 8a30ef3ae419..8167332d4013 100644 --- a/trunk/drivers/mmc/wbsd.c +++ b/trunk/drivers/mmc/wbsd.c @@ -21,6 +21,7 @@ * - On APIC systems the FIFO empty interrupt is sometimes lost. */ +#include #include #include #include @@ -1553,7 +1554,7 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq) * Allocate interrupt. */ - ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host); + ret = request_irq(irq, wbsd_irq, SA_SHIRQ, DRIVER_NAME, host); if (ret) return ret; diff --git a/trunk/drivers/mtd/chips/cfi_cmdset_0002.c b/trunk/drivers/mtd/chips/cfi_cmdset_0002.c index 9885726a16e4..1e01ad38b26e 100644 --- a/trunk/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/trunk/drivers/mtd/chips/cfi_cmdset_0002.c @@ -21,6 +21,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/mtd/chips/cfi_probe.c b/trunk/drivers/mtd/chips/cfi_probe.c index 60e11a0ada97..4bf9f8cac0dd 100644 --- a/trunk/drivers/mtd/chips/cfi_probe.c +++ b/trunk/drivers/mtd/chips/cfi_probe.c @@ -4,6 +4,7 @@ $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/mtd/chips/chipreg.c b/trunk/drivers/mtd/chips/chipreg.c index 2174c97549f0..c2127840a183 100644 --- a/trunk/drivers/mtd/chips/chipreg.c +++ b/trunk/drivers/mtd/chips/chipreg.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/mtd/chips/jedec_probe.c b/trunk/drivers/mtd/chips/jedec_probe.c index 8f39d0a31438..517ea33e7260 100644 --- a/trunk/drivers/mtd/chips/jedec_probe.c +++ b/trunk/drivers/mtd/chips/jedec_probe.c @@ -8,6 +8,7 @@ Occasionally maintained by Thayne Harbaugh tharbaugh at lnxi dot com */ +#include #include #include #include diff --git a/trunk/drivers/mtd/devices/block2mtd.c b/trunk/drivers/mtd/devices/block2mtd.c index ede3561be870..be3f1c136d02 100644 --- a/trunk/drivers/mtd/devices/block2mtd.c +++ b/trunk/drivers/mtd/devices/block2mtd.c @@ -8,6 +8,7 @@ * * Licence: GPL */ +#include #include #include #include diff --git a/trunk/drivers/mtd/devices/doc2000.c b/trunk/drivers/mtd/devices/doc2000.c index 603a7951ac9b..c54e40464d82 100644 --- a/trunk/drivers/mtd/devices/doc2000.c +++ b/trunk/drivers/mtd/devices/doc2000.c @@ -55,6 +55,10 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); static int doc_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); +static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len, + size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); +static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, + size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, struct mtd_oob_ops *ops); static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, @@ -610,11 +614,18 @@ EXPORT_SYMBOL_GPL(DoC2k_init); static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, size_t * retlen, u_char * buf) +{ + /* Just a special case of doc_read_ecc */ + return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL); +} + +static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len, + size_t * retlen, u_char * buf, u_char * eccbuf, struct nand_oobinfo *oobsel) { struct DiskOnChip *this = mtd->priv; void __iomem *docptr = this->virtadr; struct Nand *mychip; - unsigned char syndrome[6], eccbuf[6]; + unsigned char syndrome[6]; volatile char dummy; int i, len256 = 0, ret=0; size_t left = len; @@ -662,9 +673,15 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, DoC_Address(this, ADDR_COLUMN_PAGE, from, CDSN_CTRL_WP, CDSN_CTRL_ECC_IO); - /* Prime the ECC engine */ - WriteDOC(DOC_ECC_RESET, docptr, ECCConf); - WriteDOC(DOC_ECC_EN, docptr, ECCConf); + if (eccbuf) { + /* Prime the ECC engine */ + WriteDOC(DOC_ECC_RESET, docptr, ECCConf); + WriteDOC(DOC_ECC_EN, docptr, ECCConf); + } else { + /* disable the ECC engine */ + WriteDOC(DOC_ECC_RESET, docptr, ECCConf); + WriteDOC(DOC_ECC_DIS, docptr, ECCConf); + } /* treat crossing 256-byte sector for 2M x 8bits devices */ if (this->page256 && from + len > (from | 0xff) + 1) { @@ -681,59 +698,58 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, /* Let the caller know we completed it */ *retlen += len; - /* Read the ECC data through the DiskOnChip ECC logic */ - /* Note: this will work even with 2M x 8bit devices as */ - /* they have 8 bytes of OOB per 256 page. mf. */ - DoC_ReadBuf(this, eccbuf, 6); - - /* Flush the pipeline */ - if (DoC_is_Millennium(this)) { - dummy = ReadDOC(docptr, ECCConf); - dummy = ReadDOC(docptr, ECCConf); - i = ReadDOC(docptr, ECCConf); - } else { - dummy = ReadDOC(docptr, 2k_ECCStatus); - dummy = ReadDOC(docptr, 2k_ECCStatus); - i = ReadDOC(docptr, 2k_ECCStatus); - } + if (eccbuf) { + /* Read the ECC data through the DiskOnChip ECC logic */ + /* Note: this will work even with 2M x 8bit devices as */ + /* they have 8 bytes of OOB per 256 page. mf. */ + DoC_ReadBuf(this, eccbuf, 6); + + /* Flush the pipeline */ + if (DoC_is_Millennium(this)) { + dummy = ReadDOC(docptr, ECCConf); + dummy = ReadDOC(docptr, ECCConf); + i = ReadDOC(docptr, ECCConf); + } else { + dummy = ReadDOC(docptr, 2k_ECCStatus); + dummy = ReadDOC(docptr, 2k_ECCStatus); + i = ReadDOC(docptr, 2k_ECCStatus); + } - /* Check the ECC Status */ - if (i & 0x80) { - int nb_errors; - /* There was an ECC error */ + /* Check the ECC Status */ + if (i & 0x80) { + int nb_errors; + /* There was an ECC error */ #ifdef ECC_DEBUG - printk(KERN_ERR "DiskOnChip ECC Error: Read at %lx\n", (long)from); + printk(KERN_ERR "DiskOnChip ECC Error: Read at %lx\n", (long)from); #endif - /* Read the ECC syndrom through the DiskOnChip ECC - logic. These syndrome will be all ZERO when there - is no error */ - for (i = 0; i < 6; i++) { - syndrome[i] = - ReadDOC(docptr, ECCSyndrome0 + i); - } - nb_errors = doc_decode_ecc(buf, syndrome); + /* Read the ECC syndrom through the DiskOnChip ECC logic. + These syndrome will be all ZERO when there is no error */ + for (i = 0; i < 6; i++) { + syndrome[i] = + ReadDOC(docptr, ECCSyndrome0 + i); + } + nb_errors = doc_decode_ecc(buf, syndrome); #ifdef ECC_DEBUG - printk(KERN_ERR "Errors corrected: %x\n", nb_errors); + printk(KERN_ERR "Errors corrected: %x\n", nb_errors); #endif - if (nb_errors < 0) { - /* We return error, but have actually done the - read. Not that this can be told to - user-space, via sys_read(), but at least - MTD-aware stuff can know about it by - checking *retlen */ - ret = -EIO; + if (nb_errors < 0) { + /* We return error, but have actually done the read. Not that + this can be told to user-space, via sys_read(), but at least + MTD-aware stuff can know about it by checking *retlen */ + ret = -EIO; + } } - } #ifdef PSYCHO_DEBUG - printk(KERN_DEBUG "ECC DATA at %lxB: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", - (long)from, eccbuf[0], eccbuf[1], eccbuf[2], - eccbuf[3], eccbuf[4], eccbuf[5]); + printk(KERN_DEBUG "ECC DATA at %lxB: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", + (long)from, eccbuf[0], eccbuf[1], eccbuf[2], + eccbuf[3], eccbuf[4], eccbuf[5]); #endif - /* disable the ECC engine */ - WriteDOC(DOC_ECC_DIS, docptr , ECCConf); + /* disable the ECC engine */ + WriteDOC(DOC_ECC_DIS, docptr , ECCConf); + } /* according to 11.4.1, we need to wait for the busy line * drop if we read to the end of the page. */ @@ -754,11 +770,18 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, static int doc_write(struct mtd_info *mtd, loff_t to, size_t len, size_t * retlen, const u_char * buf) +{ + char eccbuf[6]; + return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL); +} + +static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, + size_t * retlen, const u_char * buf, + u_char * eccbuf, struct nand_oobinfo *oobsel) { struct DiskOnChip *this = mtd->priv; int di; /* Yes, DI is a hangover from when I was disassembling the binary driver */ void __iomem *docptr = this->virtadr; - unsigned char eccbuf[6]; volatile char dummy; int len256 = 0; struct Nand *mychip; @@ -812,9 +835,15 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len, DoC_Command(this, NAND_CMD_SEQIN, 0); DoC_Address(this, ADDR_COLUMN_PAGE, to, 0, CDSN_CTRL_ECC_IO); - /* Prime the ECC engine */ - WriteDOC(DOC_ECC_RESET, docptr, ECCConf); - WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf); + if (eccbuf) { + /* Prime the ECC engine */ + WriteDOC(DOC_ECC_RESET, docptr, ECCConf); + WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf); + } else { + /* disable the ECC engine */ + WriteDOC(DOC_ECC_RESET, docptr, ECCConf); + WriteDOC(DOC_ECC_DIS, docptr, ECCConf); + } /* treat crossing 256-byte sector for 2M x 8bits devices */ if (this->page256 && to + len > (to | 0xff) + 1) { @@ -844,35 +873,39 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len, DoC_WriteBuf(this, &buf[len256], len - len256); - WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_CE, docptr, CDSNControl); - - if (DoC_is_Millennium(this)) { - WriteDOC(0, docptr, NOP); - WriteDOC(0, docptr, NOP); - WriteDOC(0, docptr, NOP); - } else { - WriteDOC_(0, docptr, this->ioreg); - WriteDOC_(0, docptr, this->ioreg); - WriteDOC_(0, docptr, this->ioreg); - } + if (eccbuf) { + WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_CE, docptr, + CDSNControl); + + if (DoC_is_Millennium(this)) { + WriteDOC(0, docptr, NOP); + WriteDOC(0, docptr, NOP); + WriteDOC(0, docptr, NOP); + } else { + WriteDOC_(0, docptr, this->ioreg); + WriteDOC_(0, docptr, this->ioreg); + WriteDOC_(0, docptr, this->ioreg); + } - WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_FLASH_IO | CDSN_CTRL_CE, docptr, - CDSNControl); + WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_FLASH_IO | CDSN_CTRL_CE, docptr, + CDSNControl); - /* Read the ECC data through the DiskOnChip ECC logic */ - for (di = 0; di < 6; di++) { - eccbuf[di] = ReadDOC(docptr, ECCSyndrome0 + di); - } + /* Read the ECC data through the DiskOnChip ECC logic */ + for (di = 0; di < 6; di++) { + eccbuf[di] = ReadDOC(docptr, ECCSyndrome0 + di); + } - /* Reset the ECC engine */ - WriteDOC(DOC_ECC_DIS, docptr, ECCConf); + /* Reset the ECC engine */ + WriteDOC(DOC_ECC_DIS, docptr, ECCConf); #ifdef PSYCHO_DEBUG - printk - ("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", - (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], - eccbuf[4], eccbuf[5]); + printk + ("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", + (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], + eccbuf[4], eccbuf[5]); #endif + } + DoC_Command(this, NAND_CMD_PAGEPROG, 0); DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP); diff --git a/trunk/drivers/mtd/devices/doc2001.c b/trunk/drivers/mtd/devices/doc2001.c index 0e2a9326f717..0cf022a69e65 100644 --- a/trunk/drivers/mtd/devices/doc2001.c +++ b/trunk/drivers/mtd/devices/doc2001.c @@ -37,6 +37,12 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); static int doc_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); +static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len, + size_t *retlen, u_char *buf, u_char *eccbuf, + struct nand_oobinfo *oobsel); +static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, + size_t *retlen, const u_char *buf, u_char *eccbuf, + struct nand_oobinfo *oobsel); static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, struct mtd_oob_ops *ops); static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, @@ -390,10 +396,18 @@ EXPORT_SYMBOL_GPL(DoCMil_init); static int doc_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) +{ + /* Just a special case of doc_read_ecc */ + return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL); +} + +static int doc_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, + size_t *retlen, u_char *buf, u_char *eccbuf, + struct nand_oobinfo *oobsel) { int i, ret; volatile char dummy; - unsigned char syndrome[6], eccbuf[6]; + unsigned char syndrome[6]; struct DiskOnChip *this = mtd->priv; void __iomem *docptr = this->virtadr; struct Nand *mychip = &this->chips[from >> (this->chipshift)]; @@ -423,9 +437,15 @@ static int doc_read (struct mtd_info *mtd, loff_t from, size_t len, DoC_Address(docptr, 3, from, CDSN_CTRL_WP, 0x00); DoC_WaitReady(docptr); - /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/ - WriteDOC (DOC_ECC_RESET, docptr, ECCConf); - WriteDOC (DOC_ECC_EN, docptr, ECCConf); + if (eccbuf) { + /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/ + WriteDOC (DOC_ECC_RESET, docptr, ECCConf); + WriteDOC (DOC_ECC_EN, docptr, ECCConf); + } else { + /* disable the ECC engine */ + WriteDOC (DOC_ECC_RESET, docptr, ECCConf); + WriteDOC (DOC_ECC_DIS, docptr, ECCConf); + } /* Read the data via the internal pipeline through CDSN IO register, see Pipelined Read Operations 11.3 */ @@ -445,56 +465,58 @@ static int doc_read (struct mtd_info *mtd, loff_t from, size_t len, *retlen = len; ret = 0; - /* Read the ECC data from Spare Data Area, - see Reed-Solomon EDC/ECC 11.1 */ - dummy = ReadDOC(docptr, ReadPipeInit); + if (eccbuf) { + /* Read the ECC data from Spare Data Area, + see Reed-Solomon EDC/ECC 11.1 */ + dummy = ReadDOC(docptr, ReadPipeInit); #ifndef USE_MEMCPY - for (i = 0; i < 5; i++) { - /* N.B. you have to increase the source address in this way or the - ECC logic will not work properly */ - eccbuf[i] = ReadDOC(docptr, Mil_CDSN_IO + i); - } + for (i = 0; i < 5; i++) { + /* N.B. you have to increase the source address in this way or the + ECC logic will not work properly */ + eccbuf[i] = ReadDOC(docptr, Mil_CDSN_IO + i); + } #else - memcpy_fromio(eccbuf, docptr + DoC_Mil_CDSN_IO, 5); + memcpy_fromio(eccbuf, docptr + DoC_Mil_CDSN_IO, 5); #endif - eccbuf[5] = ReadDOC(docptr, LastDataRead); + eccbuf[5] = ReadDOC(docptr, LastDataRead); - /* Flush the pipeline */ - dummy = ReadDOC(docptr, ECCConf); - dummy = ReadDOC(docptr, ECCConf); + /* Flush the pipeline */ + dummy = ReadDOC(docptr, ECCConf); + dummy = ReadDOC(docptr, ECCConf); - /* Check the ECC Status */ - if (ReadDOC(docptr, ECCConf) & 0x80) { - int nb_errors; - /* There was an ECC error */ + /* Check the ECC Status */ + if (ReadDOC(docptr, ECCConf) & 0x80) { + int nb_errors; + /* There was an ECC error */ #ifdef ECC_DEBUG - printk("DiskOnChip ECC Error: Read at %lx\n", (long)from); + printk("DiskOnChip ECC Error: Read at %lx\n", (long)from); #endif - /* Read the ECC syndrom through the DiskOnChip ECC logic. - These syndrome will be all ZERO when there is no error */ - for (i = 0; i < 6; i++) { - syndrome[i] = ReadDOC(docptr, ECCSyndrome0 + i); - } - nb_errors = doc_decode_ecc(buf, syndrome); + /* Read the ECC syndrom through the DiskOnChip ECC logic. + These syndrome will be all ZERO when there is no error */ + for (i = 0; i < 6; i++) { + syndrome[i] = ReadDOC(docptr, ECCSyndrome0 + i); + } + nb_errors = doc_decode_ecc(buf, syndrome); #ifdef ECC_DEBUG - printk("ECC Errors corrected: %x\n", nb_errors); + printk("ECC Errors corrected: %x\n", nb_errors); #endif - if (nb_errors < 0) { - /* We return error, but have actually done the read. Not that - this can be told to user-space, via sys_read(), but at least - MTD-aware stuff can know about it by checking *retlen */ - ret = -EIO; + if (nb_errors < 0) { + /* We return error, but have actually done the read. Not that + this can be told to user-space, via sys_read(), but at least + MTD-aware stuff can know about it by checking *retlen */ + ret = -EIO; + } } - } #ifdef PSYCHO_DEBUG - printk("ECC DATA at %lx: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", - (long)from, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], - eccbuf[4], eccbuf[5]); + printk("ECC DATA at %lx: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", + (long)from, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], + eccbuf[4], eccbuf[5]); #endif - /* disable the ECC engine */ - WriteDOC(DOC_ECC_DIS, docptr , ECCConf); + /* disable the ECC engine */ + WriteDOC(DOC_ECC_DIS, docptr , ECCConf); + } return ret; } @@ -502,8 +524,15 @@ static int doc_read (struct mtd_info *mtd, loff_t from, size_t len, static int doc_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { - int i,ret = 0; char eccbuf[6]; + return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL); +} + +static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len, + size_t *retlen, const u_char *buf, u_char *eccbuf, + struct nand_oobinfo *oobsel) +{ + int i,ret = 0; volatile char dummy; struct DiskOnChip *this = mtd->priv; void __iomem *docptr = this->virtadr; @@ -544,9 +573,15 @@ static int doc_write (struct mtd_info *mtd, loff_t to, size_t len, DoC_Address(docptr, 3, to, 0x00, 0x00); DoC_WaitReady(docptr); - /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/ - WriteDOC (DOC_ECC_RESET, docptr, ECCConf); - WriteDOC (DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf); + if (eccbuf) { + /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/ + WriteDOC (DOC_ECC_RESET, docptr, ECCConf); + WriteDOC (DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf); + } else { + /* disable the ECC engine */ + WriteDOC (DOC_ECC_RESET, docptr, ECCConf); + WriteDOC (DOC_ECC_DIS, docptr, ECCConf); + } /* Write the data via the internal pipeline through CDSN IO register, see Pipelined Write Operations 11.2 */ @@ -561,44 +596,46 @@ static int doc_write (struct mtd_info *mtd, loff_t to, size_t len, #endif WriteDOC(0x00, docptr, WritePipeTerm); - /* Write ECC data to flash, the ECC info is generated by the DiskOnChip ECC logic - see Reed-Solomon EDC/ECC 11.1 */ - WriteDOC(0, docptr, NOP); - WriteDOC(0, docptr, NOP); - WriteDOC(0, docptr, NOP); + if (eccbuf) { + /* Write ECC data to flash, the ECC info is generated by the DiskOnChip ECC logic + see Reed-Solomon EDC/ECC 11.1 */ + WriteDOC(0, docptr, NOP); + WriteDOC(0, docptr, NOP); + WriteDOC(0, docptr, NOP); - /* Read the ECC data through the DiskOnChip ECC logic */ - for (i = 0; i < 6; i++) { - eccbuf[i] = ReadDOC(docptr, ECCSyndrome0 + i); - } + /* Read the ECC data through the DiskOnChip ECC logic */ + for (i = 0; i < 6; i++) { + eccbuf[i] = ReadDOC(docptr, ECCSyndrome0 + i); + } - /* ignore the ECC engine */ - WriteDOC(DOC_ECC_DIS, docptr , ECCConf); + /* ignore the ECC engine */ + WriteDOC(DOC_ECC_DIS, docptr , ECCConf); #ifndef USE_MEMCPY - /* Write the ECC data to flash */ - for (i = 0; i < 6; i++) { - /* N.B. you have to increase the source address in this way or the - ECC logic will not work properly */ - WriteDOC(eccbuf[i], docptr, Mil_CDSN_IO + i); - } + /* Write the ECC data to flash */ + for (i = 0; i < 6; i++) { + /* N.B. you have to increase the source address in this way or the + ECC logic will not work properly */ + WriteDOC(eccbuf[i], docptr, Mil_CDSN_IO + i); + } #else - memcpy_toio(docptr + DoC_Mil_CDSN_IO, eccbuf, 6); + memcpy_toio(docptr + DoC_Mil_CDSN_IO, eccbuf, 6); #endif - /* write the block status BLOCK_USED (0x5555) at the end of ECC data - FIXME: this is only a hack for programming the IPL area for LinuxBIOS - and should be replace with proper codes in user space utilities */ - WriteDOC(0x55, docptr, Mil_CDSN_IO); - WriteDOC(0x55, docptr, Mil_CDSN_IO + 1); + /* write the block status BLOCK_USED (0x5555) at the end of ECC data + FIXME: this is only a hack for programming the IPL area for LinuxBIOS + and should be replace with proper codes in user space utilities */ + WriteDOC(0x55, docptr, Mil_CDSN_IO); + WriteDOC(0x55, docptr, Mil_CDSN_IO + 1); - WriteDOC(0x00, docptr, WritePipeTerm); + WriteDOC(0x00, docptr, WritePipeTerm); #ifdef PSYCHO_DEBUG - printk("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", - (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], - eccbuf[4], eccbuf[5]); + printk("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", + (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], + eccbuf[4], eccbuf[5]); #endif + } /* Commit the Page Program command and wait for ready see Software Requirement 11.4 item 1.*/ diff --git a/trunk/drivers/mtd/devices/doc2001plus.c b/trunk/drivers/mtd/devices/doc2001plus.c index 92dbb47f2ac3..66cb1e50469a 100644 --- a/trunk/drivers/mtd/devices/doc2001plus.c +++ b/trunk/drivers/mtd/devices/doc2001plus.c @@ -41,6 +41,12 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); static int doc_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); +static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len, + size_t *retlen, u_char *buf, u_char *eccbuf, + struct nand_oobinfo *oobsel); +static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, + size_t *retlen, const u_char *buf, u_char *eccbuf, + struct nand_oobinfo *oobsel); static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, struct mtd_oob_ops *ops); static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, @@ -588,11 +594,19 @@ static int doc_dumpblk(struct mtd_info *mtd, loff_t from) static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) +{ + /* Just a special case of doc_read_ecc */ + return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL); +} + +static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len, + size_t *retlen, u_char *buf, u_char *eccbuf, + struct nand_oobinfo *oobsel) { int ret, i; volatile char dummy; loff_t fofs; - unsigned char syndrome[6], eccbuf[6]; + unsigned char syndrome[6]; struct DiskOnChip *this = mtd->priv; void __iomem * docptr = this->virtadr; struct Nand *mychip = &this->chips[from >> (this->chipshift)]; @@ -630,51 +644,56 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, WriteDOC(0, docptr, Mplus_FlashControl); DoC_WaitReady(docptr); - /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/ - WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf); - WriteDOC(DOC_ECC_EN, docptr, Mplus_ECCConf); + if (eccbuf) { + /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/ + WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf); + WriteDOC(DOC_ECC_EN, docptr, Mplus_ECCConf); + } else { + /* disable the ECC engine */ + WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf); + } /* Let the caller know we completed it */ *retlen = len; - ret = 0; + ret = 0; ReadDOC(docptr, Mplus_ReadPipeInit); ReadDOC(docptr, Mplus_ReadPipeInit); - /* Read the data via the internal pipeline through CDSN IO - register, see Pipelined Read Operations 11.3 */ - MemReadDOC(docptr, buf, len); + if (eccbuf) { + /* Read the data via the internal pipeline through CDSN IO + register, see Pipelined Read Operations 11.3 */ + MemReadDOC(docptr, buf, len); - /* Read the ECC data following raw data */ - MemReadDOC(docptr, eccbuf, 4); - eccbuf[4] = ReadDOC(docptr, Mplus_LastDataRead); - eccbuf[5] = ReadDOC(docptr, Mplus_LastDataRead); + /* Read the ECC data following raw data */ + MemReadDOC(docptr, eccbuf, 4); + eccbuf[4] = ReadDOC(docptr, Mplus_LastDataRead); + eccbuf[5] = ReadDOC(docptr, Mplus_LastDataRead); - /* Flush the pipeline */ - dummy = ReadDOC(docptr, Mplus_ECCConf); - dummy = ReadDOC(docptr, Mplus_ECCConf); + /* Flush the pipeline */ + dummy = ReadDOC(docptr, Mplus_ECCConf); + dummy = ReadDOC(docptr, Mplus_ECCConf); - /* Check the ECC Status */ - if (ReadDOC(docptr, Mplus_ECCConf) & 0x80) { - int nb_errors; - /* There was an ECC error */ + /* Check the ECC Status */ + if (ReadDOC(docptr, Mplus_ECCConf) & 0x80) { + int nb_errors; + /* There was an ECC error */ #ifdef ECC_DEBUG - printk("DiskOnChip ECC Error: Read at %lx\n", (long)from); + printk("DiskOnChip ECC Error: Read at %lx\n", (long)from); #endif - /* Read the ECC syndrom through the DiskOnChip ECC logic. - These syndrome will be all ZERO when there is no error */ - for (i = 0; i < 6; i++) - syndrome[i] = ReadDOC(docptr, Mplus_ECCSyndrome0 + i); + /* Read the ECC syndrom through the DiskOnChip ECC logic. + These syndrome will be all ZERO when there is no error */ + for (i = 0; i < 6; i++) + syndrome[i] = ReadDOC(docptr, Mplus_ECCSyndrome0 + i); - nb_errors = doc_decode_ecc(buf, syndrome); + nb_errors = doc_decode_ecc(buf, syndrome); #ifdef ECC_DEBUG - printk("ECC Errors corrected: %x\n", nb_errors); + printk("ECC Errors corrected: %x\n", nb_errors); #endif - if (nb_errors < 0) { - /* We return error, but have actually done the - read. Not that this can be told to user-space, via - sys_read(), but at least MTD-aware stuff can know - about it by checking *retlen */ + if (nb_errors < 0) { + /* We return error, but have actually done the read. Not that + this can be told to user-space, via sys_read(), but at least + MTD-aware stuff can know about it by checking *retlen */ #ifdef ECC_DEBUG printk("%s(%d): Millennium Plus ECC error (from=0x%x:\n", __FILE__, __LINE__, (int)from); @@ -688,16 +707,24 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, eccbuf[3], eccbuf[4], eccbuf[5]); #endif ret = -EIO; + } } - } #ifdef PSYCHO_DEBUG - printk("ECC DATA at %lx: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", - (long)from, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], - eccbuf[4], eccbuf[5]); + printk("ECC DATA at %lx: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", + (long)from, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], + eccbuf[4], eccbuf[5]); #endif - /* disable the ECC engine */ - WriteDOC(DOC_ECC_DIS, docptr , Mplus_ECCConf); + + /* disable the ECC engine */ + WriteDOC(DOC_ECC_DIS, docptr , Mplus_ECCConf); + } else { + /* Read the data via the internal pipeline through CDSN IO + register, see Pipelined Read Operations 11.3 */ + MemReadDOC(docptr, buf, len-2); + buf[len-2] = ReadDOC(docptr, Mplus_LastDataRead); + buf[len-1] = ReadDOC(docptr, Mplus_LastDataRead); + } /* Disable flash internally */ WriteDOC(0, docptr, Mplus_FlashSelect); @@ -707,11 +734,18 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, static int doc_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) +{ + char eccbuf[6]; + return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL); +} + +static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, + size_t *retlen, const u_char *buf, u_char *eccbuf, + struct nand_oobinfo *oobsel) { int i, before, ret = 0; loff_t fto; volatile char dummy; - char eccbuf[6]; struct DiskOnChip *this = mtd->priv; void __iomem * docptr = this->virtadr; struct Nand *mychip = &this->chips[to >> (this->chipshift)]; @@ -761,42 +795,46 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len, /* Disable the ECC engine */ WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf); - if (before) { - /* Write the block status BLOCK_USED (0x5555) */ - WriteDOC(0x55, docptr, Mil_CDSN_IO); - WriteDOC(0x55, docptr, Mil_CDSN_IO); - } + if (eccbuf) { + if (before) { + /* Write the block status BLOCK_USED (0x5555) */ + WriteDOC(0x55, docptr, Mil_CDSN_IO); + WriteDOC(0x55, docptr, Mil_CDSN_IO); + } - /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/ - WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, Mplus_ECCConf); + /* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/ + WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, Mplus_ECCConf); + } MemWriteDOC(docptr, (unsigned char *) buf, len); - /* Write ECC data to flash, the ECC info is generated by - the DiskOnChip ECC logic see Reed-Solomon EDC/ECC 11.1 */ - DoC_Delay(docptr, 3); + if (eccbuf) { + /* Write ECC data to flash, the ECC info is generated by + the DiskOnChip ECC logic see Reed-Solomon EDC/ECC 11.1 */ + DoC_Delay(docptr, 3); - /* Read the ECC data through the DiskOnChip ECC logic */ - for (i = 0; i < 6; i++) - eccbuf[i] = ReadDOC(docptr, Mplus_ECCSyndrome0 + i); + /* Read the ECC data through the DiskOnChip ECC logic */ + for (i = 0; i < 6; i++) + eccbuf[i] = ReadDOC(docptr, Mplus_ECCSyndrome0 + i); - /* disable the ECC engine */ - WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf); + /* disable the ECC engine */ + WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf); - /* Write the ECC data to flash */ - MemWriteDOC(docptr, eccbuf, 6); + /* Write the ECC data to flash */ + MemWriteDOC(docptr, eccbuf, 6); - if (!before) { - /* Write the block status BLOCK_USED (0x5555) */ - WriteDOC(0x55, docptr, Mil_CDSN_IO+6); - WriteDOC(0x55, docptr, Mil_CDSN_IO+7); - } + if (!before) { + /* Write the block status BLOCK_USED (0x5555) */ + WriteDOC(0x55, docptr, Mil_CDSN_IO+6); + WriteDOC(0x55, docptr, Mil_CDSN_IO+7); + } #ifdef PSYCHO_DEBUG - printk("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", - (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], - eccbuf[4], eccbuf[5]); + printk("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n", + (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3], + eccbuf[4], eccbuf[5]); #endif + } WriteDOC(0x00, docptr, Mplus_WritePipeTerm); WriteDOC(0x00, docptr, Mplus_WritePipeTerm); diff --git a/trunk/drivers/mtd/devices/docprobe.c b/trunk/drivers/mtd/devices/docprobe.c index 78872c3f3760..593bb033a3fa 100644 --- a/trunk/drivers/mtd/devices/docprobe.c +++ b/trunk/drivers/mtd/devices/docprobe.c @@ -40,6 +40,7 @@ */ #define DOC_SINGLE_DRIVER +#include #include #include #include diff --git a/trunk/drivers/mtd/devices/mtd_dataflash.c b/trunk/drivers/mtd/devices/mtd_dataflash.c index 5db716045927..04271d02b6b6 100644 --- a/trunk/drivers/mtd/devices/mtd_dataflash.c +++ b/trunk/drivers/mtd/devices/mtd_dataflash.c @@ -9,6 +9,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/drivers/mtd/devices/mtdram.c b/trunk/drivers/mtd/devices/mtdram.c index e427c82d5f4c..b4438eacfd80 100644 --- a/trunk/drivers/mtd/devices/mtdram.c +++ b/trunk/drivers/mtd/devices/mtdram.c @@ -10,6 +10,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/mtd/devices/pmc551.c b/trunk/drivers/mtd/devices/pmc551.c index 6f9bbf6fee4d..30f07b473ae2 100644 --- a/trunk/drivers/mtd/devices/pmc551.c +++ b/trunk/drivers/mtd/devices/pmc551.c @@ -82,6 +82,7 @@ * * Comb the init routine. It's still a bit cludgy on a few things. */ +#include #include #include #include diff --git a/trunk/drivers/mtd/inftlcore.c b/trunk/drivers/mtd/inftlcore.c index 4116535805f1..1e21a2c3dd29 100644 --- a/trunk/drivers/mtd/inftlcore.c +++ b/trunk/drivers/mtd/inftlcore.c @@ -24,6 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/alchemy-flash.c b/trunk/drivers/mtd/maps/alchemy-flash.c index 7fc8097e41d2..b933a2a27b18 100644 --- a/trunk/drivers/mtd/maps/alchemy-flash.c +++ b/trunk/drivers/mtd/maps/alchemy-flash.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/amd76xrom.c b/trunk/drivers/mtd/maps/amd76xrom.c index 447955be18af..a50587005263 100644 --- a/trunk/drivers/mtd/maps/amd76xrom.c +++ b/trunk/drivers/mtd/maps/amd76xrom.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/ceiva.c b/trunk/drivers/mtd/maps/ceiva.c index 0402c21e291d..5a95ab370a97 100644 --- a/trunk/drivers/mtd/maps/ceiva.c +++ b/trunk/drivers/mtd/maps/ceiva.c @@ -14,6 +14,7 @@ * $Id: ceiva.c,v 1.11 2004/09/16 23:27:12 gleixner Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/cstm_mips_ixx.c b/trunk/drivers/mtd/maps/cstm_mips_ixx.c index aa56defb94c8..a370953c1513 100644 --- a/trunk/drivers/mtd/maps/cstm_mips_ixx.c +++ b/trunk/drivers/mtd/maps/cstm_mips_ixx.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #if defined(CONFIG_MIPS_ITE8172) || defined(CONFIG_MIPS_IVR) diff --git a/trunk/drivers/mtd/maps/dbox2-flash.c b/trunk/drivers/mtd/maps/dbox2-flash.c index 92a9c7fac993..85c2a9e22b1e 100644 --- a/trunk/drivers/mtd/maps/dbox2-flash.c +++ b/trunk/drivers/mtd/maps/dbox2-flash.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* partition_info gives details on the logical partitions that the split the diff --git a/trunk/drivers/mtd/maps/dc21285.c b/trunk/drivers/mtd/maps/dc21285.c index b32bb9347d71..8b3784e2de89 100644 --- a/trunk/drivers/mtd/maps/dc21285.c +++ b/trunk/drivers/mtd/maps/dc21285.c @@ -7,6 +7,7 @@ * * $Id: dc21285.c,v 1.24 2005/11/07 11:14:26 gleixner Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/dilnetpc.c b/trunk/drivers/mtd/maps/dilnetpc.c index b1104fe1f207..c299d10b33e6 100644 --- a/trunk/drivers/mtd/maps/dilnetpc.c +++ b/trunk/drivers/mtd/maps/dilnetpc.c @@ -25,6 +25,7 @@ * and http://www.ssv-embedded.de/ssv/pc104/p170.htm */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/dmv182.c b/trunk/drivers/mtd/maps/dmv182.c index a43c49905cac..2bb3c0f0f970 100644 --- a/trunk/drivers/mtd/maps/dmv182.c +++ b/trunk/drivers/mtd/maps/dmv182.c @@ -16,6 +16,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/ebony.c b/trunk/drivers/mtd/maps/ebony.c index 641e1dd8479e..60a6e51d662f 100644 --- a/trunk/drivers/mtd/maps/ebony.c +++ b/trunk/drivers/mtd/maps/ebony.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/edb7312.c b/trunk/drivers/mtd/maps/edb7312.c index 1c5b97c89685..b48a3473ffc1 100644 --- a/trunk/drivers/mtd/maps/edb7312.c +++ b/trunk/drivers/mtd/maps/edb7312.c @@ -17,6 +17,7 @@ #include #include #include +#include #ifdef CONFIG_MTD_PARTITIONS #include diff --git a/trunk/drivers/mtd/maps/h720x-flash.c b/trunk/drivers/mtd/maps/h720x-flash.c index 6dde3182d64a..0667101ccbe1 100644 --- a/trunk/drivers/mtd/maps/h720x-flash.c +++ b/trunk/drivers/mtd/maps/h720x-flash.c @@ -8,6 +8,7 @@ * 2003 Thomas Gleixner */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/ichxrom.c b/trunk/drivers/mtd/maps/ichxrom.c index db4b570d874a..16732794edf3 100644 --- a/trunk/drivers/mtd/maps/ichxrom.c +++ b/trunk/drivers/mtd/maps/ichxrom.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/impa7.c b/trunk/drivers/mtd/maps/impa7.c index a0b4dc7155dc..ba7f40311a7e 100644 --- a/trunk/drivers/mtd/maps/impa7.c +++ b/trunk/drivers/mtd/maps/impa7.c @@ -17,6 +17,7 @@ #include #include #include +#include #ifdef CONFIG_MTD_PARTITIONS #include diff --git a/trunk/drivers/mtd/maps/integrator-flash.c b/trunk/drivers/mtd/maps/integrator-flash.c index c8db01b3e45f..a3ba52fbd868 100644 --- a/trunk/drivers/mtd/maps/integrator-flash.c +++ b/trunk/drivers/mtd/maps/integrator-flash.c @@ -26,6 +26,7 @@ ======================================================================*/ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/ipaq-flash.c b/trunk/drivers/mtd/maps/ipaq-flash.c index f27c132794c3..b8ccb0a95789 100644 --- a/trunk/drivers/mtd/maps/ipaq-flash.c +++ b/trunk/drivers/mtd/maps/ipaq-flash.c @@ -8,6 +8,7 @@ * $Id: ipaq-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/l440gx.c b/trunk/drivers/mtd/maps/l440gx.c index 6b784ef5ee70..851bf9576052 100644 --- a/trunk/drivers/mtd/maps/l440gx.c +++ b/trunk/drivers/mtd/maps/l440gx.c @@ -13,6 +13,7 @@ #include #include #include +#include #define PIIXE_IOBASE_RESOURCE 11 diff --git a/trunk/drivers/mtd/maps/lasat.c b/trunk/drivers/mtd/maps/lasat.c index 1c13d2dc0cdf..c658d4045ef2 100644 --- a/trunk/drivers/mtd/maps/lasat.c +++ b/trunk/drivers/mtd/maps/lasat.c @@ -19,6 +19,7 @@ #include #include #include +#include #include static struct mtd_info *lasat_mtd; diff --git a/trunk/drivers/mtd/maps/mpc1211.c b/trunk/drivers/mtd/maps/mpc1211.c index 45a00fac88ac..4685e8e13460 100644 --- a/trunk/drivers/mtd/maps/mpc1211.c +++ b/trunk/drivers/mtd/maps/mpc1211.c @@ -15,6 +15,7 @@ #include #include #include +#include static struct mtd_info *flash_mtd; static struct mtd_partition *parsed_parts; diff --git a/trunk/drivers/mtd/maps/mtx-1_flash.c b/trunk/drivers/mtd/maps/mtx-1_flash.c index d884f2be28f6..5c25d4e552c6 100644 --- a/trunk/drivers/mtd/maps/mtx-1_flash.c +++ b/trunk/drivers/mtd/maps/mtx-1_flash.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/ocotea.c b/trunk/drivers/mtd/maps/ocotea.c index 2f07602ba940..a21fcd195ab4 100644 --- a/trunk/drivers/mtd/maps/ocotea.c +++ b/trunk/drivers/mtd/maps/ocotea.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/omap-toto-flash.c b/trunk/drivers/mtd/maps/omap-toto-flash.c index e6e391efbeb6..dc3765270057 100644 --- a/trunk/drivers/mtd/maps/omap-toto-flash.c +++ b/trunk/drivers/mtd/maps/omap-toto-flash.c @@ -8,6 +8,7 @@ * $Id: omap-toto-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/physmap.c b/trunk/drivers/mtd/maps/physmap.c index 7799a25a7f2a..d6301f08906d 100644 --- a/trunk/drivers/mtd/maps/physmap.c +++ b/trunk/drivers/mtd/maps/physmap.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/redwood.c b/trunk/drivers/mtd/maps/redwood.c index ec8fdae1dd99..50b14033613f 100644 --- a/trunk/drivers/mtd/maps/redwood.c +++ b/trunk/drivers/mtd/maps/redwood.c @@ -13,6 +13,7 @@ * or implied. */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/sa1100-flash.c b/trunk/drivers/mtd/maps/sa1100-flash.c index 950bf1c57841..5cefb015633c 100644 --- a/trunk/drivers/mtd/maps/sa1100-flash.c +++ b/trunk/drivers/mtd/maps/sa1100-flash.c @@ -5,6 +5,7 @@ * * $Id: sa1100-flash.c,v 1.51 2005/11/07 11:14:28 gleixner Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/sbc8240.c b/trunk/drivers/mtd/maps/sbc8240.c index 7d0fcf8f4f33..350286dc1d2e 100644 --- a/trunk/drivers/mtd/maps/sbc8240.c +++ b/trunk/drivers/mtd/maps/sbc8240.c @@ -18,6 +18,7 @@ * Both parts are JEDEC compatible. */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/sc520cdp.c b/trunk/drivers/mtd/maps/sc520cdp.c index 9b50cfc355b1..e8c130e1efd3 100644 --- a/trunk/drivers/mtd/maps/sc520cdp.c +++ b/trunk/drivers/mtd/maps/sc520cdp.c @@ -25,6 +25,7 @@ * For details see http://www.amd.com/products/epd/desiging/evalboards/18.elansc520/520_cdp_brief/index.html */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/scb2_flash.c b/trunk/drivers/mtd/maps/scb2_flash.c index dcfb85840d1e..97a8dfd69258 100644 --- a/trunk/drivers/mtd/maps/scb2_flash.c +++ b/trunk/drivers/mtd/maps/scb2_flash.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include diff --git a/trunk/drivers/mtd/maps/scx200_docflash.c b/trunk/drivers/mtd/maps/scx200_docflash.c index 7391fd544e86..331a15859d71 100644 --- a/trunk/drivers/mtd/maps/scx200_docflash.c +++ b/trunk/drivers/mtd/maps/scx200_docflash.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/solutionengine.c b/trunk/drivers/mtd/maps/solutionengine.c index d76ceef453ce..c53c2c369c9d 100644 --- a/trunk/drivers/mtd/maps/solutionengine.c +++ b/trunk/drivers/mtd/maps/solutionengine.c @@ -16,6 +16,7 @@ #include #include #include +#include #include static struct mtd_info *flash_mtd; diff --git a/trunk/drivers/mtd/maps/tqm834x.c b/trunk/drivers/mtd/maps/tqm834x.c index 58e5912bd381..c7ae9a515c1a 100644 --- a/trunk/drivers/mtd/maps/tqm834x.c +++ b/trunk/drivers/mtd/maps/tqm834x.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/tqm8xxl.c b/trunk/drivers/mtd/maps/tqm8xxl.c index 19578ba84ee8..a43517053e7c 100644 --- a/trunk/drivers/mtd/maps/tqm8xxl.c +++ b/trunk/drivers/mtd/maps/tqm8xxl.c @@ -22,6 +22,7 @@ * Thus, we choose CONFIG_MTD_CFI_I2 & CONFIG_MTD_CFI_B4 at * kernel configuration. */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/ts5500_flash.c b/trunk/drivers/mtd/maps/ts5500_flash.c index b47270e850bc..a7422c200567 100644 --- a/trunk/drivers/mtd/maps/ts5500_flash.c +++ b/trunk/drivers/mtd/maps/ts5500_flash.c @@ -26,6 +26,7 @@ * $Id: ts5500_flash.c,v 1.5 2005/11/07 11:14:28 gleixner Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/uclinux.c b/trunk/drivers/mtd/maps/uclinux.c index 389fea28b9a6..f7264dc2ac9b 100644 --- a/trunk/drivers/mtd/maps/uclinux.c +++ b/trunk/drivers/mtd/maps/uclinux.c @@ -10,6 +10,7 @@ /****************************************************************************/ +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/walnut.c b/trunk/drivers/mtd/maps/walnut.c index ec80eec376bf..f46bec66150f 100644 --- a/trunk/drivers/mtd/maps/walnut.c +++ b/trunk/drivers/mtd/maps/walnut.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/mtd/maps/wr_sbc82xx_flash.c b/trunk/drivers/mtd/maps/wr_sbc82xx_flash.c index ac5b8105b6ef..60c197ec455b 100644 --- a/trunk/drivers/mtd/maps/wr_sbc82xx_flash.c +++ b/trunk/drivers/mtd/maps/wr_sbc82xx_flash.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/trunk/drivers/mtd/mtdblock.c b/trunk/drivers/mtd/mtdblock.c index 04ed34694b14..e5c78463ebfd 100644 --- a/trunk/drivers/mtd/mtdblock.c +++ b/trunk/drivers/mtd/mtdblock.c @@ -7,6 +7,7 @@ * (C) 1999-2003 David Woodhouse */ +#include #include #include #include diff --git a/trunk/drivers/mtd/mtdchar.c b/trunk/drivers/mtd/mtdchar.c index fb8b4f7e48d3..9a4b59d92525 100644 --- a/trunk/drivers/mtd/mtdchar.c +++ b/trunk/drivers/mtd/mtdchar.c @@ -5,6 +5,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/mtd/mtdcore.c b/trunk/drivers/mtd/mtdcore.c index 168d3ba063c3..16a952dd486a 100644 --- a/trunk/drivers/mtd/mtdcore.c +++ b/trunk/drivers/mtd/mtdcore.c @@ -6,6 +6,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/mtd/mtdpart.c b/trunk/drivers/mtd/mtdpart.c index 06a930372b7a..77a7123a5c56 100644 --- a/trunk/drivers/mtd/mtdpart.c +++ b/trunk/drivers/mtd/mtdpart.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/mtd/nand/nand_base.c b/trunk/drivers/mtd/nand/nand_base.c index 62b861304e03..80a76654d963 100644 --- a/trunk/drivers/mtd/nand/nand_base.c +++ b/trunk/drivers/mtd/nand/nand_base.c @@ -155,7 +155,7 @@ static u16 nand_read_word(struct mtd_info *mtd) /** * nand_select_chip - [DEFAULT] control CE line * @mtd: MTD device structure - * @chipnr: chipnumber to select, -1 for deselect + * @chip: chipnumber to select, -1 for deselect * * Default select function for 1 chip devices. */ @@ -542,6 +542,7 @@ static void nand_command(struct mtd_info *mtd, unsigned int command, * Send command to NAND device. This is the version for the new large page * devices We dont have the separate regions as we have in the small page * devices. We must emulate NAND_CMD_READOOB to keep the code compatible. + * */ static void nand_command_lp(struct mtd_info *mtd, unsigned int command, int column, int page_addr) @@ -655,7 +656,7 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command, /** * nand_get_device - [GENERIC] Get chip for selected access - * @chip: the nand chip descriptor + * @this: the nand chip descriptor * @mtd: MTD device structure * @new_state: the state which is requested * @@ -695,12 +696,13 @@ nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state) /** * nand_wait - [DEFAULT] wait until the command is done * @mtd: MTD device structure - * @chip: NAND chip structure + * @this: NAND chip structure * * Wait for command done. This applies to erase and program only * Erase can take up to 400ms and program up to 20ms according to * general NAND and SmartMedia specs - */ + * +*/ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip) { @@ -894,7 +896,6 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip, /** * nand_transfer_oob - [Internal] Transfer oob to client buffer * @chip: nand chip structure - * @oob: oob destination address * @ops: oob ops structure */ static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob, @@ -945,7 +946,6 @@ static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob, * * @mtd: MTD device structure * @from: offset to read from - * @ops: oob ops structure * * Internal function. Called with chip held. */ @@ -1760,7 +1760,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to, /** * nand_write_oob - [MTD Interface] NAND write data and/or out-of-band * @mtd: MTD device structure - * @to: offset to write to + * @from: offset to read from * @ops: oob operation description structure */ static int nand_write_oob(struct mtd_info *mtd, loff_t to, @@ -2055,7 +2055,7 @@ static void nand_sync(struct mtd_info *mtd) /** * nand_block_isbad - [MTD Interface] Check if block at offset is bad * @mtd: MTD device structure - * @offs: offset relative to mtd start + * @ofs: offset relative to mtd start */ static int nand_block_isbad(struct mtd_info *mtd, loff_t offs) { diff --git a/trunk/drivers/mtd/nand/nand_ecc.c b/trunk/drivers/mtd/nand/nand_ecc.c index dd438ca47d9a..2a163e4084df 100644 --- a/trunk/drivers/mtd/nand/nand_ecc.c +++ b/trunk/drivers/mtd/nand/nand_ecc.c @@ -65,7 +65,8 @@ static const u_char nand_ecc_precalc_table[] = { }; /** - * nand_calculate_ecc - [NAND Interface] Calculate 3-byte ECC for 256-byte block + * nand_calculate_ecc - [NAND Interface] Calculate 3 byte ECC code + * for 256 byte block * @mtd: MTD block structure * @dat: raw data * @ecc_code: buffer for ECC diff --git a/trunk/drivers/mtd/nand/nandsim.c b/trunk/drivers/mtd/nand/nandsim.c index 545ff252d81e..ebd64abc8be8 100644 --- a/trunk/drivers/mtd/nand/nandsim.c +++ b/trunk/drivers/mtd/nand/nandsim.c @@ -25,6 +25,7 @@ * $Id: nandsim.c,v 1.8 2005/03/19 15:33:56 dedekind Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/mtd/nand/sharpsl.c b/trunk/drivers/mtd/nand/sharpsl.c index fbeedc3184e9..21743658d150 100644 --- a/trunk/drivers/mtd/nand/sharpsl.c +++ b/trunk/drivers/mtd/nand/sharpsl.c @@ -237,6 +237,11 @@ static int __init sharpsl_nand_init(void) } } + if (machine_is_husky() || machine_is_borzoi() || machine_is_akita()) { + /* Need to use small eraseblock size for backward compatibility */ + sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS; + } + add_mtd_partitions(sharpsl_mtd, sharpsl_partition_info, nr_partitions); /* Return happy */ @@ -250,6 +255,8 @@ module_init(sharpsl_nand_init); */ static void __exit sharpsl_nand_cleanup(void) { + struct nand_chip *this = (struct nand_chip *)&sharpsl_mtd[1]; + /* Release resources, unregister device */ nand_release(sharpsl_mtd); diff --git a/trunk/drivers/mtd/nftlcore.c b/trunk/drivers/mtd/nftlcore.c index dd5cea8b4a7a..dc7573501d8c 100644 --- a/trunk/drivers/mtd/nftlcore.c +++ b/trunk/drivers/mtd/nftlcore.c @@ -11,6 +11,7 @@ #define PRERELEASE +#include #include #include #include diff --git a/trunk/drivers/net/3c509.c b/trunk/drivers/net/3c509.c index cbdae54f715f..dc845f36fe49 100644 --- a/trunk/drivers/net/3c509.c +++ b/trunk/drivers/net/3c509.c @@ -68,6 +68,7 @@ /* Maximum events (Rx packets, etc.) to handle at each interrupt. */ static int max_interrupt_work = 10; +#include #include #ifdef CONFIG_MCA #include diff --git a/trunk/drivers/net/3c515.c b/trunk/drivers/net/3c515.c index 4532b17e40ea..91d1c4c24d9b 100644 --- a/trunk/drivers/net/3c515.c +++ b/trunk/drivers/net/3c515.c @@ -57,6 +57,7 @@ static int max_interrupt_work = 20; #define RX_RING_SIZE 16 #define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */ +#include #include #include #include @@ -760,7 +761,7 @@ static int corkscrew_open(struct net_device *dev) vp->product_name, dev)) return -EAGAIN; enable_dma(dev->dma); set_dma_mode(dev->dma, DMA_MODE_CASCADE); - } else if (request_irq(dev->irq, &corkscrew_interrupt, IRQF_SHARED, + } else if (request_irq(dev->irq, &corkscrew_interrupt, SA_SHIRQ, vp->product_name, dev)) { return -EAGAIN; } diff --git a/trunk/drivers/net/3c523.c b/trunk/drivers/net/3c523.c index 5dfd97f0ba9e..4bf8510655c5 100644 --- a/trunk/drivers/net/3c523.c +++ b/trunk/drivers/net/3c523.c @@ -289,7 +289,7 @@ static int elmc_open(struct net_device *dev) elmc_id_attn586(); /* disable interrupts */ - ret = request_irq(dev->irq, &elmc_interrupt, IRQF_SHARED | IRQF_SAMPLE_RANDOM, + ret = request_irq(dev->irq, &elmc_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); if (ret) { printk(KERN_ERR "%s: couldn't get irq %d\n", dev->name, dev->irq); diff --git a/trunk/drivers/net/3c527.c b/trunk/drivers/net/3c527.c index 03c0f7176fc9..157eda573925 100644 --- a/trunk/drivers/net/3c527.c +++ b/trunk/drivers/net/3c527.c @@ -435,7 +435,7 @@ static int __init mc32_probe1(struct net_device *dev, int slot) * Grab the IRQ */ - err = request_irq(dev->irq, &mc32_interrupt, IRQF_SHARED | IRQF_SAMPLE_RANDOM, DRV_NAME, dev); + err = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, DRV_NAME, dev); if (err) { release_region(dev->base_addr, MC32_IO_EXTENT); printk(KERN_ERR "%s: unable to get IRQ %d.\n", DRV_NAME, dev->irq); diff --git a/trunk/drivers/net/3c59x.c b/trunk/drivers/net/3c59x.c index 2819de79442c..d2f808979a2b 100644 --- a/trunk/drivers/net/3c59x.c +++ b/trunk/drivers/net/3c59x.c @@ -236,6 +236,7 @@ static int vortex_debug = VORTEX_DEBUG; static int vortex_debug = 1; #endif +#include #include #include #include @@ -996,7 +997,7 @@ static int vortex_resume(struct pci_dev *pdev) pci_enable_device(pdev); pci_set_master(pdev); if (request_irq(dev->irq, vp->full_bus_master_rx ? - &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev)) { + &boomerang_interrupt : &vortex_interrupt, SA_SHIRQ, dev->name, dev)) { printk(KERN_WARNING "%s: Could not reserve IRQ %d\n", dev->name, dev->irq); pci_disable_device(pdev); return -EBUSY; @@ -1833,7 +1834,7 @@ vortex_open(struct net_device *dev) /* Use the now-standard shared IRQ implementation. */ if ((retval = request_irq(dev->irq, vp->full_bus_master_rx ? - &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev))) { + &boomerang_interrupt : &vortex_interrupt, SA_SHIRQ, dev->name, dev))) { printk(KERN_ERR "%s: Could not reserve IRQ %d\n", dev->name, dev->irq); goto out; } @@ -1897,7 +1898,7 @@ vortex_timer(unsigned long data) printk(KERN_DEBUG "dev->watchdog_timeo=%d\n", dev->watchdog_timeo); } - disable_irq_lockdep(dev->irq); + disable_irq(dev->irq); old_window = ioread16(ioaddr + EL3_CMD) >> 13; EL3WINDOW(4); media_status = ioread16(ioaddr + Wn4_Media); @@ -1978,7 +1979,7 @@ vortex_timer(unsigned long data) dev->name, media_tbl[dev->if_port].name); EL3WINDOW(old_window); - enable_irq_lockdep(dev->irq); + enable_irq(dev->irq); mod_timer(&vp->timer, RUN_AT(next_tick)); if (vp->deferred) iowrite16(FakeIntr, ioaddr + EL3_CMD); diff --git a/trunk/drivers/net/8139cp.c b/trunk/drivers/net/8139cp.c index 1959654cbec8..d26dd6a7062d 100644 --- a/trunk/drivers/net/8139cp.c +++ b/trunk/drivers/net/8139cp.c @@ -52,6 +52,7 @@ #define DRV_RELDATE "Mar 22, 2004" +#include #include #include #include @@ -1203,7 +1204,7 @@ static int cp_open (struct net_device *dev) cp_init_hw(cp); - rc = request_irq(dev->irq, cp_interrupt, IRQF_SHARED, dev->name, dev); + rc = request_irq(dev->irq, cp_interrupt, SA_SHIRQ, dev->name, dev); if (rc) goto err_out_hw; diff --git a/trunk/drivers/net/8139too.c b/trunk/drivers/net/8139too.c index 717506b2b13a..ed2e3c03bc88 100644 --- a/trunk/drivers/net/8139too.c +++ b/trunk/drivers/net/8139too.c @@ -93,6 +93,7 @@ #define DRV_VERSION "0.9.27" +#include #include #include #include @@ -1310,7 +1311,7 @@ static int rtl8139_open (struct net_device *dev) int retval; void __iomem *ioaddr = tp->mmio_addr; - retval = request_irq (dev->irq, rtl8139_interrupt, IRQF_SHARED, dev->name, dev); + retval = request_irq (dev->irq, rtl8139_interrupt, SA_SHIRQ, dev->name, dev); if (retval) return retval; diff --git a/trunk/drivers/net/82596.c b/trunk/drivers/net/82596.c index 7e2ca9571467..8a9f7d61b9b1 100644 --- a/trunk/drivers/net/82596.c +++ b/trunk/drivers/net/82596.c @@ -40,6 +40,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/net/8390.c b/trunk/drivers/net/8390.c index d2935ae39814..86be96af9c8f 100644 --- a/trunk/drivers/net/8390.c +++ b/trunk/drivers/net/8390.c @@ -249,7 +249,7 @@ void ei_tx_timeout(struct net_device *dev) /* Ugly but a reset can be slow, yet must be protected */ - disable_irq_nosync_lockdep(dev->irq); + disable_irq_nosync(dev->irq); spin_lock(&ei_local->page_lock); /* Try to restart the card. Perhaps the user has fixed something. */ @@ -257,7 +257,7 @@ void ei_tx_timeout(struct net_device *dev) NS8390_init(dev, 1); spin_unlock(&ei_local->page_lock); - enable_irq_lockdep(dev->irq); + enable_irq(dev->irq); netif_wake_queue(dev); } diff --git a/trunk/drivers/net/8390.h b/trunk/drivers/net/8390.h index a9a58f518f45..51e39dcd0603 100644 --- a/trunk/drivers/net/8390.h +++ b/trunk/drivers/net/8390.h @@ -7,6 +7,7 @@ #ifndef _8390_h #define _8390_h +#include #include #include #include diff --git a/trunk/drivers/net/Space.c b/trunk/drivers/net/Space.c index a8c245a82261..60304f7e7e5b 100644 --- a/trunk/drivers/net/Space.c +++ b/trunk/drivers/net/Space.c @@ -27,6 +27,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/drivers/net/a2065.c b/trunk/drivers/net/a2065.c index f4ea62641acd..71165ac0257a 100644 --- a/trunk/drivers/net/a2065.c +++ b/trunk/drivers/net/a2065.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -495,7 +496,7 @@ static int lance_open (struct net_device *dev) ll->rdp = LE_C0_STOP; /* Install the Interrupt handler */ - ret = request_irq(IRQ_AMIGA_PORTS, lance_interrupt, IRQF_SHARED, + ret = request_irq(IRQ_AMIGA_PORTS, lance_interrupt, SA_SHIRQ, dev->name, dev); if (ret) return ret; diff --git a/trunk/drivers/net/acenic.c b/trunk/drivers/net/acenic.c index 1c01e9b3d07c..23ff22ba5d31 100644 --- a/trunk/drivers/net/acenic.c +++ b/trunk/drivers/net/acenic.c @@ -50,6 +50,7 @@ * Grant Grundler : PCI write posting fixes. */ +#include #include #include #include @@ -1194,7 +1195,7 @@ static int __devinit ace_init(struct net_device *dev) goto init_error; } - ecode = request_irq(pdev->irq, ace_interrupt, IRQF_SHARED, + ecode = request_irq(pdev->irq, ace_interrupt, SA_SHIRQ, DRV_NAME, dev); if (ecode) { printk(KERN_WARNING "%s: Requested IRQ %d is busy\n", diff --git a/trunk/drivers/net/acenic.h b/trunk/drivers/net/acenic.h index 62ec8ceee698..a97107023495 100644 --- a/trunk/drivers/net/acenic.h +++ b/trunk/drivers/net/acenic.h @@ -1,6 +1,7 @@ #ifndef _ACENIC_H_ #define _ACENIC_H_ +#include /* * Generate TX index update each time, when TX ring is closed. diff --git a/trunk/drivers/net/acenic_firmware.h b/trunk/drivers/net/acenic_firmware.h index ec146f60d77b..d7882dd783c8 100644 --- a/trunk/drivers/net/acenic_firmware.h +++ b/trunk/drivers/net/acenic_firmware.h @@ -1,3 +1,4 @@ +#include /* * Declare these here even if Tigon I support is disabled to avoid * the compiler complaining about undefined symbols. diff --git a/trunk/drivers/net/amd8111e.c b/trunk/drivers/net/amd8111e.c index ed322a76980d..d9ba8be72af8 100644 --- a/trunk/drivers/net/amd8111e.c +++ b/trunk/drivers/net/amd8111e.c @@ -69,6 +69,7 @@ Revision History: */ +#include #include #include #include @@ -1376,7 +1377,7 @@ static int amd8111e_open(struct net_device * dev ) { struct amd8111e_priv *lp = netdev_priv(dev); - if(dev->irq ==0 || request_irq(dev->irq, amd8111e_interrupt, IRQF_SHARED, + if(dev->irq ==0 || request_irq(dev->irq, amd8111e_interrupt, SA_SHIRQ, dev->name, dev)) return -EAGAIN; diff --git a/trunk/drivers/net/apne.c b/trunk/drivers/net/apne.c index 9cc13a0250d6..b9820b86cdcc 100644 --- a/trunk/drivers/net/apne.c +++ b/trunk/drivers/net/apne.c @@ -313,7 +313,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr) dev->base_addr = ioaddr; /* Install the Interrupt handler */ - i = request_irq(IRQ_AMIGA_PORTS, apne_interrupt, IRQF_SHARED, DRV_NAME, dev); + i = request_irq(IRQ_AMIGA_PORTS, apne_interrupt, SA_SHIRQ, DRV_NAME, dev); if (i) return i; for(i = 0; i < ETHER_ADDR_LEN; i++) { diff --git a/trunk/drivers/net/appletalk/cops.c b/trunk/drivers/net/appletalk/cops.c index 1d01ac0000e4..9edaa183227a 100644 --- a/trunk/drivers/net/appletalk/cops.c +++ b/trunk/drivers/net/appletalk/cops.c @@ -48,6 +48,7 @@ static const char *version = * the driver figure it out. */ +#include #include #include #include diff --git a/trunk/drivers/net/appletalk/cops_ffdrv.h b/trunk/drivers/net/appletalk/cops_ffdrv.h index b02005087c1b..31cf8c9c947f 100644 --- a/trunk/drivers/net/appletalk/cops_ffdrv.h +++ b/trunk/drivers/net/appletalk/cops_ffdrv.h @@ -24,6 +24,7 @@ * - Jay Schulist */ +#include #ifdef CONFIG_COPS_DAYNA diff --git a/trunk/drivers/net/appletalk/cops_ltdrv.h b/trunk/drivers/net/appletalk/cops_ltdrv.h index c699b1ad31da..4afb8e18ba65 100644 --- a/trunk/drivers/net/appletalk/cops_ltdrv.h +++ b/trunk/drivers/net/appletalk/cops_ltdrv.h @@ -23,6 +23,7 @@ * - Jay Schulist */ +#include #ifdef CONFIG_COPS_TANGENT diff --git a/trunk/drivers/net/appletalk/ipddp.c b/trunk/drivers/net/appletalk/ipddp.c index 7f7dd450226a..1a44a79ed064 100644 --- a/trunk/drivers/net/appletalk/ipddp.c +++ b/trunk/drivers/net/appletalk/ipddp.c @@ -23,6 +23,7 @@ * of the GNU General Public License, incorporated herein by reference. */ +#include #include #include #include diff --git a/trunk/drivers/net/arcnet/arcnet.c b/trunk/drivers/net/arcnet/arcnet.c index 5a95005253fa..fabc0607b0f1 100644 --- a/trunk/drivers/net/arcnet/arcnet.c +++ b/trunk/drivers/net/arcnet/arcnet.c @@ -44,6 +44,7 @@ #define VERSION "arcnet: v3.93 BETA 2000/04/29 - by Avery Pennarun et al.\n" #include +#include #include #include #include diff --git a/trunk/drivers/net/arcnet/com20020-pci.c b/trunk/drivers/net/arcnet/com20020-pci.c index 979a33df0a8c..96636ca8754e 100644 --- a/trunk/drivers/net/arcnet/com20020-pci.c +++ b/trunk/drivers/net/arcnet/com20020-pci.c @@ -120,7 +120,7 @@ static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_de goto out_port; } - if ((err = com20020_found(dev, IRQF_SHARED)) != 0) + if ((err = com20020_found(dev, SA_SHIRQ)) != 0) goto out_port; return 0; diff --git a/trunk/drivers/net/ariadne.c b/trunk/drivers/net/ariadne.c index cc721addd576..a9bb7a4aff98 100644 --- a/trunk/drivers/net/ariadne.c +++ b/trunk/drivers/net/ariadne.c @@ -320,7 +320,7 @@ static int ariadne_open(struct net_device *dev) netif_start_queue(dev); - i = request_irq(IRQ_AMIGA_PORTS, ariadne_interrupt, IRQF_SHARED, + i = request_irq(IRQ_AMIGA_PORTS, ariadne_interrupt, SA_SHIRQ, dev->name, dev); if (i) return i; diff --git a/trunk/drivers/net/arm/at91_ether.c b/trunk/drivers/net/arm/at91_ether.c index 85493b7b924f..613005a0285d 100644 --- a/trunk/drivers/net/arm/at91_ether.c +++ b/trunk/drivers/net/arm/at91_ether.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/net/at1700.c b/trunk/drivers/net/at1700.c index 5d7929c79bce..e613cc289749 100644 --- a/trunk/drivers/net/at1700.c +++ b/trunk/drivers/net/at1700.c @@ -35,6 +35,7 @@ response to inb()s from other device probes! */ +#include #include #include #include diff --git a/trunk/drivers/net/au1000_eth.c b/trunk/drivers/net/au1000_eth.c index 55f6e3f65b53..038d5fcb15e6 100644 --- a/trunk/drivers/net/au1000_eth.c +++ b/trunk/drivers/net/au1000_eth.c @@ -35,6 +35,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/net/b44.c b/trunk/drivers/net/b44.c index cd98d31dee8c..a7e4ba5a580f 100644 --- a/trunk/drivers/net/b44.c +++ b/trunk/drivers/net/b44.c @@ -1421,7 +1421,7 @@ static int b44_open(struct net_device *dev) b44_check_phy(bp); - err = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev); + err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev); if (unlikely(err < 0)) { b44_chip_reset(bp); b44_free_rings(bp); @@ -2322,7 +2322,7 @@ static int b44_resume(struct pci_dev *pdev) if (!netif_running(dev)) return 0; - if (request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev)) + if (request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev)) printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name); spin_lock_irq(&bp->lock); diff --git a/trunk/drivers/net/bmac.c b/trunk/drivers/net/bmac.c index 6fad83f24c4f..bbca8ae8018c 100644 --- a/trunk/drivers/net/bmac.c +++ b/trunk/drivers/net/bmac.c @@ -7,6 +7,7 @@ * May 1999, Al Viro: proper release of /proc/net/bmac entry, switched to * dynamic procfs inode. */ +#include #include #include #include diff --git a/trunk/drivers/net/bnx2.c b/trunk/drivers/net/bnx2.c index 4f4db5ae503b..d55b0f7939a6 100644 --- a/trunk/drivers/net/bnx2.c +++ b/trunk/drivers/net/bnx2.c @@ -9,6 +9,7 @@ * Written by: Michael Chan (mchan@broadcom.com) */ +#include #include #include @@ -4260,11 +4261,11 @@ bnx2_open(struct net_device *dev) } else { rc = request_irq(bp->pdev->irq, bnx2_interrupt, - IRQF_SHARED, dev->name, dev); + SA_SHIRQ, dev->name, dev); } } else { - rc = request_irq(bp->pdev->irq, bnx2_interrupt, IRQF_SHARED, + rc = request_irq(bp->pdev->irq, bnx2_interrupt, SA_SHIRQ, dev->name, dev); } if (rc) { @@ -4311,7 +4312,7 @@ bnx2_open(struct net_device *dev) if (!rc) { rc = request_irq(bp->pdev->irq, bnx2_interrupt, - IRQF_SHARED, dev->name, dev); + SA_SHIRQ, dev->name, dev); } if (rc) { bnx2_free_skbs(bp); diff --git a/trunk/drivers/net/bonding/bond_main.c b/trunk/drivers/net/bonding/bond_main.c index 8b951238f3a2..8171cae06688 100644 --- a/trunk/drivers/net/bonding/bond_main.c +++ b/trunk/drivers/net/bonding/bond_main.c @@ -33,6 +33,7 @@ //#define BONDING_DEBUG 1 +#include #include #include #include diff --git a/trunk/drivers/net/bonding/bond_sysfs.c b/trunk/drivers/net/bonding/bond_sysfs.c index cfe4dc3a93a3..5a9bd95884be 100644 --- a/trunk/drivers/net/bonding/bond_sysfs.c +++ b/trunk/drivers/net/bonding/bond_sysfs.c @@ -20,6 +20,7 @@ * file called LICENSE. * */ +#include #include #include #include diff --git a/trunk/drivers/net/cassini.c b/trunk/drivers/net/cassini.c index d33130f64700..565a54f1d06a 100644 --- a/trunk/drivers/net/cassini.c +++ b/trunk/drivers/net/cassini.c @@ -66,6 +66,7 @@ * by default, the selective clear mask is set up to process rx packets. */ +#include #include #include @@ -4349,7 +4350,7 @@ static int cas_open(struct net_device *dev) * mapping to expose them */ if (request_irq(cp->pdev->irq, cas_interrupt, - IRQF_SHARED, dev->name, (void *) dev)) { + SA_SHIRQ, dev->name, (void *) dev)) { printk(KERN_ERR "%s: failed to request irq !\n", cp->dev->name); err = -EAGAIN; diff --git a/trunk/drivers/net/chelsio/common.h b/trunk/drivers/net/chelsio/common.h index 5d9dd14427c5..bf3e7b6a7a18 100644 --- a/trunk/drivers/net/chelsio/common.h +++ b/trunk/drivers/net/chelsio/common.h @@ -39,6 +39,7 @@ #ifndef _CXGB_COMMON_H_ #define _CXGB_COMMON_H_ +#include #include #include #include diff --git a/trunk/drivers/net/chelsio/cxgb2.c b/trunk/drivers/net/chelsio/cxgb2.c index e67872433e92..7fe2638ae06d 100644 --- a/trunk/drivers/net/chelsio/cxgb2.c +++ b/trunk/drivers/net/chelsio/cxgb2.c @@ -37,6 +37,7 @@ ****************************************************************************/ #include "common.h" +#include #include #include #include @@ -218,7 +219,7 @@ static int cxgb_up(struct adapter *adapter) t1_interrupts_clear(adapter); if ((err = request_irq(adapter->pdev->irq, - t1_select_intr_handler(adapter), IRQF_SHARED, + t1_select_intr_handler(adapter), SA_SHIRQ, adapter->name, adapter))) { goto out_err; } diff --git a/trunk/drivers/net/chelsio/sge.c b/trunk/drivers/net/chelsio/sge.c index 87f94d939ff8..53efff6da784 100644 --- a/trunk/drivers/net/chelsio/sge.c +++ b/trunk/drivers/net/chelsio/sge.c @@ -39,6 +39,7 @@ #include "common.h" +#include #include #include #include diff --git a/trunk/drivers/net/cris/eth_v10.c b/trunk/drivers/net/cris/eth_v10.c index 0eb1f8787ed7..64105e4eaf31 100644 --- a/trunk/drivers/net/cris/eth_v10.c +++ b/trunk/drivers/net/cris/eth_v10.c @@ -218,6 +218,7 @@ * */ +#include #include @@ -671,7 +672,7 @@ e100_open(struct net_device *dev) /* allocate the irq corresponding to the receiving DMA */ if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rxtx_interrupt, - IRQF_SAMPLE_RANDOM, cardname, (void *)dev)) { + SA_SAMPLE_RANDOM, cardname, (void *)dev)) { goto grace_exit0; } diff --git a/trunk/drivers/net/cs89x0.c b/trunk/drivers/net/cs89x0.c index 47eecce35fa4..ef54ebeb29b8 100644 --- a/trunk/drivers/net/cs89x0.c +++ b/trunk/drivers/net/cs89x0.c @@ -100,6 +100,7 @@ /* Always include 'config.h' first in case the user wants to turn on or override something. */ +#include #include /* diff --git a/trunk/drivers/net/cs89x0.h b/trunk/drivers/net/cs89x0.h index 968fe11a0bf0..bd954aaa636f 100644 --- a/trunk/drivers/net/cs89x0.h +++ b/trunk/drivers/net/cs89x0.h @@ -14,6 +14,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #define PP_ChipID 0x0000 /* offset 0h -> Corp -ID */ /* offset 2h -> Model/Product Number */ diff --git a/trunk/drivers/net/declance.c b/trunk/drivers/net/declance.c index 2038ca7e49ce..d3d958e7ac56 100644 --- a/trunk/drivers/net/declance.c +++ b/trunk/drivers/net/declance.c @@ -42,6 +42,7 @@ * bits. macro */ +#include #include #include #include diff --git a/trunk/drivers/net/defxx.c b/trunk/drivers/net/defxx.c index 91cc8cbdd440..5acd35c312ac 100644 --- a/trunk/drivers/net/defxx.c +++ b/trunk/drivers/net/defxx.c @@ -1228,7 +1228,7 @@ static int dfx_open(struct net_device *dev) /* Register IRQ - support shared interrupts by passing device ptr */ - ret = request_irq(dev->irq, dfx_interrupt, IRQF_SHARED, dev->name, dev); + ret = request_irq(dev->irq, dfx_interrupt, SA_SHIRQ, dev->name, dev); if (ret) { printk(KERN_ERR "%s: Requested IRQ %d is busy\n", dev->name, dev->irq); return ret; diff --git a/trunk/drivers/net/depca.c b/trunk/drivers/net/depca.c index b1cbe99249c1..e946c43d3b10 100644 --- a/trunk/drivers/net/depca.c +++ b/trunk/drivers/net/depca.c @@ -235,6 +235,7 @@ ========================================================================= */ +#include #include #include #include diff --git a/trunk/drivers/net/dgrs.c b/trunk/drivers/net/dgrs.c index fa4f09432975..e175d4876682 100644 --- a/trunk/drivers/net/dgrs.c +++ b/trunk/drivers/net/dgrs.c @@ -1191,7 +1191,7 @@ dgrs_probe1(struct net_device *dev) if (priv->plxreg) OUTL(dev->base_addr + PLX_LCL2PCI_DOORBELL, 1); - rc = request_irq(dev->irq, &dgrs_intr, IRQF_SHARED, "RightSwitch", dev); + rc = request_irq(dev->irq, &dgrs_intr, SA_SHIRQ, "RightSwitch", dev); if (rc) goto err_out; diff --git a/trunk/drivers/net/dl2k.c b/trunk/drivers/net/dl2k.c index 4b6ddb70f921..038447fb5c5e 100644 --- a/trunk/drivers/net/dl2k.c +++ b/trunk/drivers/net/dl2k.c @@ -390,7 +390,7 @@ parse_eeprom (struct net_device *dev) for (i = 0; i < 6; i++) dev->dev_addr[i] = psrom->mac_addr[i]; - /* Parse Software Information Block */ + /* Parse Software Infomation Block */ i = 0x30; psib = (u8 *) sromdata; do { @@ -440,7 +440,7 @@ rio_open (struct net_device *dev) int i; u16 macctrl; - i = request_irq (dev->irq, &rio_interrupt, IRQF_SHARED, dev->name, dev); + i = request_irq (dev->irq, &rio_interrupt, SA_SHIRQ, dev->name, dev); if (i) return i; diff --git a/trunk/drivers/net/dm9000.c b/trunk/drivers/net/dm9000.c index 1b758b707134..7965a9b08e79 100644 --- a/trunk/drivers/net/dm9000.c +++ b/trunk/drivers/net/dm9000.c @@ -603,7 +603,7 @@ dm9000_open(struct net_device *dev) PRINTK2("entering dm9000_open\n"); - if (request_irq(dev->irq, &dm9000_interrupt, IRQF_SHARED, dev->name, dev)) + if (request_irq(dev->irq, &dm9000_interrupt, SA_SHIRQ, dev->name, dev)) return -EAGAIN; /* Initialize DM9000 board */ diff --git a/trunk/drivers/net/dummy.c b/trunk/drivers/net/dummy.c index 36d511729f71..dd8c15ac5c77 100644 --- a/trunk/drivers/net/dummy.c +++ b/trunk/drivers/net/dummy.c @@ -28,6 +28,7 @@ Alan Cox, 30th May 1994 */ +#include #include #include #include diff --git a/trunk/drivers/net/e100.c b/trunk/drivers/net/e100.c index 91ef5f2fd768..93a286570923 100644 --- a/trunk/drivers/net/e100.c +++ b/trunk/drivers/net/e100.c @@ -138,6 +138,7 @@ * - Stratus87247: protect MDI control register manipulations */ +#include #include #include #include @@ -2063,7 +2064,7 @@ static int e100_up(struct nic *nic) e100_set_multicast_list(nic->netdev); e100_start_receiver(nic, NULL); mod_timer(&nic->watchdog, jiffies); - if((err = request_irq(nic->pdev->irq, e100_intr, IRQF_SHARED, + if((err = request_irq(nic->pdev->irq, e100_intr, SA_SHIRQ, nic->netdev->name, nic->netdev))) goto err_no_irq; netif_wake_queue(nic->netdev); diff --git a/trunk/drivers/net/e1000/e1000.h b/trunk/drivers/net/e1000/e1000.h index 3042d33e2d4d..2bc34fbfa69c 100644 --- a/trunk/drivers/net/e1000/e1000.h +++ b/trunk/drivers/net/e1000/e1000.h @@ -34,6 +34,7 @@ #define _E1000_H_ #include +#include #include #include #include diff --git a/trunk/drivers/net/e1000/e1000_ethtool.c b/trunk/drivers/net/e1000/e1000_ethtool.c index d19664891768..6ed7f599eba3 100644 --- a/trunk/drivers/net/e1000/e1000_ethtool.c +++ b/trunk/drivers/net/e1000/e1000_ethtool.c @@ -871,10 +871,10 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) *data = 0; /* Hook up test interrupt handler just for this test */ - if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, - netdev->name, netdev)) { + if (!request_irq(irq, &e1000_test_intr, SA_PROBEIRQ, netdev->name, + netdev)) { shared_int = FALSE; - } else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED, + } else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ, netdev->name, netdev)){ *data = 1; return -1; diff --git a/trunk/drivers/net/e1000/e1000_main.c b/trunk/drivers/net/e1000/e1000_main.c index f77624f5f17b..32b7d444b374 100644 --- a/trunk/drivers/net/e1000/e1000_main.c +++ b/trunk/drivers/net/e1000/e1000_main.c @@ -426,7 +426,7 @@ e1000_up(struct e1000_adapter *adapter) } #endif if ((err = request_irq(adapter->pdev->irq, &e1000_intr, - IRQF_SHARED | IRQF_SAMPLE_RANDOM, + SA_SHIRQ | SA_SAMPLE_RANDOM, netdev->name, netdev))) { DPRINTK(PROBE, ERR, "Unable to allocate interrupt Error: %d\n", err); diff --git a/trunk/drivers/net/eepro.c b/trunk/drivers/net/eepro.c index 20d31430c74f..e70f172699db 100644 --- a/trunk/drivers/net/eepro.c +++ b/trunk/drivers/net/eepro.c @@ -920,7 +920,7 @@ static int eepro_grab_irq(struct net_device *dev) eepro_sw2bank0(ioaddr); /* Switch back to Bank 0 */ - if (request_irq (*irqp, NULL, IRQF_SHARED, "bogus", dev) != EBUSY) { + if (request_irq (*irqp, NULL, SA_SHIRQ, "bogus", dev) != EBUSY) { unsigned long irq_mask; /* Twinkle the interrupt, and check if it's seen */ irq_mask = probe_irq_on(); diff --git a/trunk/drivers/net/eepro100.c b/trunk/drivers/net/eepro100.c index 2ad327542927..ecf5ad85a684 100644 --- a/trunk/drivers/net/eepro100.c +++ b/trunk/drivers/net/eepro100.c @@ -87,6 +87,7 @@ static int options[] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* Size of an pre-allocated Rx buffer: + slack.*/ #define PKT_BUF_SZ 1536 +#include #include #include @@ -977,7 +978,7 @@ speedo_open(struct net_device *dev) sp->in_interrupt = 0; /* .. we can safely take handler calls during init. */ - retval = request_irq(dev->irq, &speedo_interrupt, IRQF_SHARED, dev->name, dev); + retval = request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ, dev->name, dev); if (retval) { return retval; } diff --git a/trunk/drivers/net/eexpress.c b/trunk/drivers/net/eexpress.c index 33291bcf6d4c..a74b20715755 100644 --- a/trunk/drivers/net/eexpress.c +++ b/trunk/drivers/net/eexpress.c @@ -97,6 +97,7 @@ #define LOCKUP16 0 #endif +#include #include #include #include diff --git a/trunk/drivers/net/epic100.c b/trunk/drivers/net/epic100.c index 9f3e09a3d88c..ee34a16eb4e2 100644 --- a/trunk/drivers/net/epic100.c +++ b/trunk/drivers/net/epic100.c @@ -114,6 +114,7 @@ static int rx_copybreak; #define TX_FIFO_THRESH 256 #define RX_FIFO_THRESH 1 /* 0-3, 0==32, 64,96, or 3==128 bytes */ +#include #include #include #include @@ -713,7 +714,7 @@ static int epic_open(struct net_device *dev) /* Soft reset the chip. */ outl(0x4001, ioaddr + GENCTL); - if ((retval = request_irq(dev->irq, &epic_interrupt, IRQF_SHARED, dev->name, dev))) + if ((retval = request_irq(dev->irq, &epic_interrupt, SA_SHIRQ, dev->name, dev))) return retval; epic_init_ring(dev); diff --git a/trunk/drivers/net/fealnx.c b/trunk/drivers/net/fealnx.c index c701951dcd6f..13eca7ede2af 100644 --- a/trunk/drivers/net/fealnx.c +++ b/trunk/drivers/net/fealnx.c @@ -834,7 +834,7 @@ static int netdev_open(struct net_device *dev) iowrite32(0x00000001, ioaddr + BCR); /* Reset */ - if (request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev)) + if (request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev)) return -EAGAIN; for (i = 0; i < 3; i++) diff --git a/trunk/drivers/net/fec.c b/trunk/drivers/net/fec.c index 9b4030031744..db694c832989 100644 --- a/trunk/drivers/net/fec.c +++ b/trunk/drivers/net/fec.c @@ -25,6 +25,7 @@ * Copyright (c) 2004-2006 Macq Electronique SA. */ +#include #include #include #include diff --git a/trunk/drivers/net/fec_8xx/fec_8xx-netta.c b/trunk/drivers/net/fec_8xx/fec_8xx-netta.c index 790d9dbe42dd..29c275e1d566 100644 --- a/trunk/drivers/net/fec_8xx/fec_8xx-netta.c +++ b/trunk/drivers/net/fec_8xx/fec_8xx-netta.c @@ -2,6 +2,7 @@ * FEC instantatiation file for NETTA */ +#include #include #include #include diff --git a/trunk/drivers/net/fec_8xx/fec_main.c b/trunk/drivers/net/fec_8xx/fec_main.c index 282b1452c39a..7e4338097139 100644 --- a/trunk/drivers/net/fec_8xx/fec_main.c +++ b/trunk/drivers/net/fec_8xx/fec_main.c @@ -10,6 +10,7 @@ * Released under the GPL */ +#include #include #include #include diff --git a/trunk/drivers/net/fec_8xx/fec_mii.c b/trunk/drivers/net/fec_8xx/fec_mii.c index d3c16b85d9a4..3b44ac1a7bfe 100644 --- a/trunk/drivers/net/fec_8xx/fec_mii.c +++ b/trunk/drivers/net/fec_8xx/fec_mii.c @@ -10,6 +10,7 @@ * Released under the GPL */ +#include #include #include #include diff --git a/trunk/drivers/net/forcedeth.c b/trunk/drivers/net/forcedeth.c index 037d870712ff..21be4fa071b5 100644 --- a/trunk/drivers/net/forcedeth.c +++ b/trunk/drivers/net/forcedeth.c @@ -2622,21 +2622,21 @@ static int nv_request_irq(struct net_device *dev, int intr_test) np->msi_flags |= NV_MSI_X_ENABLED; if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT && !intr_test) { /* Request irq for rx handling */ - if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector, &nv_nic_irq_rx, IRQF_SHARED, dev->name, dev) != 0) { + if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector, &nv_nic_irq_rx, SA_SHIRQ, dev->name, dev) != 0) { printk(KERN_INFO "forcedeth: request_irq failed for rx %d\n", ret); pci_disable_msix(np->pci_dev); np->msi_flags &= ~NV_MSI_X_ENABLED; goto out_err; } /* Request irq for tx handling */ - if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector, &nv_nic_irq_tx, IRQF_SHARED, dev->name, dev) != 0) { + if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector, &nv_nic_irq_tx, SA_SHIRQ, dev->name, dev) != 0) { printk(KERN_INFO "forcedeth: request_irq failed for tx %d\n", ret); pci_disable_msix(np->pci_dev); np->msi_flags &= ~NV_MSI_X_ENABLED; goto out_free_rx; } /* Request irq for link and timer handling */ - if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector, &nv_nic_irq_other, IRQF_SHARED, dev->name, dev) != 0) { + if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector, &nv_nic_irq_other, SA_SHIRQ, dev->name, dev) != 0) { printk(KERN_INFO "forcedeth: request_irq failed for link %d\n", ret); pci_disable_msix(np->pci_dev); np->msi_flags &= ~NV_MSI_X_ENABLED; @@ -2651,9 +2651,9 @@ static int nv_request_irq(struct net_device *dev, int intr_test) } else { /* Request irq for all interrupts */ if ((!intr_test && - request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq, IRQF_SHARED, dev->name, dev) != 0) || + request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) || (intr_test && - request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq_test, IRQF_SHARED, dev->name, dev) != 0)) { + request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq_test, SA_SHIRQ, dev->name, dev) != 0)) { printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret); pci_disable_msix(np->pci_dev); np->msi_flags &= ~NV_MSI_X_ENABLED; @@ -2669,8 +2669,8 @@ static int nv_request_irq(struct net_device *dev, int intr_test) if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) { if ((ret = pci_enable_msi(np->pci_dev)) == 0) { np->msi_flags |= NV_MSI_ENABLED; - if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, IRQF_SHARED, dev->name, dev) != 0) || - (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, IRQF_SHARED, dev->name, dev) != 0)) { + if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) || + (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, SA_SHIRQ, dev->name, dev) != 0)) { printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret); pci_disable_msi(np->pci_dev); np->msi_flags &= ~NV_MSI_ENABLED; @@ -2685,8 +2685,8 @@ static int nv_request_irq(struct net_device *dev, int intr_test) } } if (ret != 0) { - if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, IRQF_SHARED, dev->name, dev) != 0) || - (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, IRQF_SHARED, dev->name, dev) != 0)) + if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) || + (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, SA_SHIRQ, dev->name, dev) != 0)) goto out_err; } @@ -2735,21 +2735,21 @@ static void nv_do_nic_poll(unsigned long data) if (!using_multi_irqs(dev)) { if (np->msi_flags & NV_MSI_X_ENABLED) - disable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector); + disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector); else - disable_irq_lockdep(dev->irq); + disable_irq(dev->irq); mask = np->irqmask; } else { if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) { - disable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector); + disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector); mask |= NVREG_IRQ_RX_ALL; } if (np->nic_poll_irq & NVREG_IRQ_TX_ALL) { - disable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector); + disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector); mask |= NVREG_IRQ_TX_ALL; } if (np->nic_poll_irq & NVREG_IRQ_OTHER) { - disable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector); + disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector); mask |= NVREG_IRQ_OTHER; } } @@ -2761,23 +2761,23 @@ static void nv_do_nic_poll(unsigned long data) pci_push(base); if (!using_multi_irqs(dev)) { - nv_nic_irq(0, dev, NULL); + nv_nic_irq((int) 0, (void *) data, (struct pt_regs *) NULL); if (np->msi_flags & NV_MSI_X_ENABLED) - enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector); + enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector); else - enable_irq_lockdep(dev->irq); + enable_irq(dev->irq); } else { if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) { - nv_nic_irq_rx(0, dev, NULL); - enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector); + nv_nic_irq_rx((int) 0, (void *) data, (struct pt_regs *) NULL); + enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector); } if (np->nic_poll_irq & NVREG_IRQ_TX_ALL) { - nv_nic_irq_tx(0, dev, NULL); - enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector); + nv_nic_irq_tx((int) 0, (void *) data, (struct pt_regs *) NULL); + enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector); } if (np->nic_poll_irq & NVREG_IRQ_OTHER) { - nv_nic_irq_other(0, dev, NULL); - enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector); + nv_nic_irq_other((int) 0, (void *) data, (struct pt_regs *) NULL); + enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector); } } } diff --git a/trunk/drivers/net/fs_enet/fs_enet-main.c b/trunk/drivers/net/fs_enet/fs_enet-main.c index f6abff5846b3..196298f33db8 100644 --- a/trunk/drivers/net/fs_enet/fs_enet-main.c +++ b/trunk/drivers/net/fs_enet/fs_enet-main.c @@ -15,6 +15,7 @@ * kind, whether express or implied. */ +#include #include #include #include @@ -671,7 +672,7 @@ static int fs_request_irq(struct net_device *dev, int irq, const char *name, struct fs_enet_private *fep = netdev_priv(dev); (*fep->ops->pre_request_irq)(dev, irq); - return request_irq(irq, irqf, IRQF_SHARED, name, dev); + return request_irq(irq, irqf, SA_SHIRQ, name, dev); } static void fs_free_irq(struct net_device *dev, int irq) diff --git a/trunk/drivers/net/fs_enet/fs_enet-mii.c b/trunk/drivers/net/fs_enet/fs_enet-mii.c index b7e6e21725cb..0cd07150bf4a 100644 --- a/trunk/drivers/net/fs_enet/fs_enet-mii.c +++ b/trunk/drivers/net/fs_enet/fs_enet-mii.c @@ -16,6 +16,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/net/fs_enet/mac-fcc.c b/trunk/drivers/net/fs_enet/mac-fcc.c index 64e20982c1fe..95e2bb8dd7b4 100644 --- a/trunk/drivers/net/fs_enet/mac-fcc.c +++ b/trunk/drivers/net/fs_enet/mac-fcc.c @@ -12,6 +12,7 @@ * kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/drivers/net/fs_enet/mac-fec.c b/trunk/drivers/net/fs_enet/mac-fec.c index e09547077529..3dad69dfdb2c 100644 --- a/trunk/drivers/net/fs_enet/mac-fec.c +++ b/trunk/drivers/net/fs_enet/mac-fec.c @@ -12,6 +12,7 @@ * kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/drivers/net/fs_enet/mac-scc.c b/trunk/drivers/net/fs_enet/mac-scc.c index eaa24fab645f..a772b286f96d 100644 --- a/trunk/drivers/net/fs_enet/mac-scc.c +++ b/trunk/drivers/net/fs_enet/mac-scc.c @@ -12,6 +12,7 @@ * kind, whether express or implied. */ +#include #include #include #include diff --git a/trunk/drivers/net/fs_enet/mii-bitbang.c b/trunk/drivers/net/fs_enet/mii-bitbang.c index 48f9cf83ab6f..24a5e2e23d18 100644 --- a/trunk/drivers/net/fs_enet/mii-bitbang.c +++ b/trunk/drivers/net/fs_enet/mii-bitbang.c @@ -13,6 +13,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/net/fs_enet/mii-fixed.c b/trunk/drivers/net/fs_enet/mii-fixed.c index ae4a9c3bb393..b3e192d612e5 100644 --- a/trunk/drivers/net/fs_enet/mii-fixed.c +++ b/trunk/drivers/net/fs_enet/mii-fixed.c @@ -13,6 +13,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/net/gianfar.c b/trunk/drivers/net/gianfar.c index ebbbd6ca6204..218d31764c52 100644 --- a/trunk/drivers/net/gianfar.c +++ b/trunk/drivers/net/gianfar.c @@ -64,6 +64,7 @@ * The driver then cleans up the buffer. */ +#include #include #include #include diff --git a/trunk/drivers/net/gianfar.h b/trunk/drivers/net/gianfar.h index f87bbc408dae..127c98cf3336 100644 --- a/trunk/drivers/net/gianfar.h +++ b/trunk/drivers/net/gianfar.h @@ -22,6 +22,7 @@ #ifndef __GIANFAR_H #define __GIANFAR_H +#include #include #include #include diff --git a/trunk/drivers/net/gianfar_ethtool.c b/trunk/drivers/net/gianfar_ethtool.c index e0f505285e50..d69698c695ef 100644 --- a/trunk/drivers/net/gianfar_ethtool.c +++ b/trunk/drivers/net/gianfar_ethtool.c @@ -15,6 +15,7 @@ * by reference. */ +#include #include #include #include diff --git a/trunk/drivers/net/gianfar_mii.c b/trunk/drivers/net/gianfar_mii.c index c92e65984fd0..c6b725529af5 100644 --- a/trunk/drivers/net/gianfar_mii.c +++ b/trunk/drivers/net/gianfar_mii.c @@ -16,6 +16,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/net/gianfar_sysfs.c b/trunk/drivers/net/gianfar_sysfs.c index e8a18f18d08c..a6d5c43199cb 100644 --- a/trunk/drivers/net/gianfar_sysfs.c +++ b/trunk/drivers/net/gianfar_sysfs.c @@ -19,6 +19,7 @@ * Sysfs file creation and management */ +#include #include #include #include diff --git a/trunk/drivers/net/gt96100eth.c b/trunk/drivers/net/gt96100eth.c index 49dacc6e35aa..2d2435404614 100644 --- a/trunk/drivers/net/gt96100eth.c +++ b/trunk/drivers/net/gt96100eth.c @@ -1030,7 +1030,7 @@ gt96100_open(struct net_device *dev) } if ((retval = request_irq(dev->irq, >96100_interrupt, - IRQF_SHARED, dev->name, dev))) { + SA_SHIRQ, dev->name, dev))) { err("unable to get IRQ %d\n", dev->irq); return retval; } diff --git a/trunk/drivers/net/gt96100eth.h b/trunk/drivers/net/gt96100eth.h index 2a8331938b84..395869c5ed3e 100644 --- a/trunk/drivers/net/gt96100eth.h +++ b/trunk/drivers/net/gt96100eth.h @@ -27,6 +27,7 @@ #ifndef _GT96100ETH_H #define _GT96100ETH_H +#include #include #define dbg(lvl, format, arg...) \ diff --git a/trunk/drivers/net/hamachi.c b/trunk/drivers/net/hamachi.c index 7bcd939c6edd..0ea4cb4a0d80 100644 --- a/trunk/drivers/net/hamachi.c +++ b/trunk/drivers/net/hamachi.c @@ -871,7 +871,7 @@ static int hamachi_open(struct net_device *dev) u32 rx_int_var, tx_int_var; u16 fifo_info; - i = request_irq(dev->irq, &hamachi_interrupt, IRQF_SHARED, dev->name, dev); + i = request_irq(dev->irq, &hamachi_interrupt, SA_SHIRQ, dev->name, dev); if (i) return i; diff --git a/trunk/drivers/net/hamradio/6pack.c b/trunk/drivers/net/hamradio/6pack.c index 86b3bb9bec2d..d12605f0ac7c 100644 --- a/trunk/drivers/net/hamradio/6pack.c +++ b/trunk/drivers/net/hamradio/6pack.c @@ -12,6 +12,7 @@ * Fred N. van Kempen, */ +#include #include #include #include diff --git a/trunk/drivers/net/hamradio/baycom_ser_fdx.c b/trunk/drivers/net/hamradio/baycom_ser_fdx.c index 55906c7b4bb1..232793d2ce6b 100644 --- a/trunk/drivers/net/hamradio/baycom_ser_fdx.c +++ b/trunk/drivers/net/hamradio/baycom_ser_fdx.c @@ -434,7 +434,7 @@ static int ser12_open(struct net_device *dev) outb(0, FCR(dev->base_addr)); /* disable FIFOs */ outb(0x0d, MCR(dev->base_addr)); outb(0, IER(dev->base_addr)); - if (request_irq(dev->irq, ser12_interrupt, IRQF_DISABLED | IRQF_SHARED, + if (request_irq(dev->irq, ser12_interrupt, SA_INTERRUPT | SA_SHIRQ, "baycom_ser_fdx", dev)) { release_region(dev->base_addr, SER12_EXTENT); return -EBUSY; diff --git a/trunk/drivers/net/hamradio/baycom_ser_hdx.c b/trunk/drivers/net/hamradio/baycom_ser_hdx.c index de95de8983da..be596a3eb3fd 100644 --- a/trunk/drivers/net/hamradio/baycom_ser_hdx.c +++ b/trunk/drivers/net/hamradio/baycom_ser_hdx.c @@ -488,7 +488,7 @@ static int ser12_open(struct net_device *dev) outb(0, FCR(dev->base_addr)); /* disable FIFOs */ outb(0x0d, MCR(dev->base_addr)); outb(0, IER(dev->base_addr)); - if (request_irq(dev->irq, ser12_interrupt, IRQF_DISABLED | IRQF_SHARED, + if (request_irq(dev->irq, ser12_interrupt, SA_INTERRUPT | SA_SHIRQ, "baycom_ser12", dev)) { release_region(dev->base_addr, SER12_EXTENT); return -EBUSY; diff --git a/trunk/drivers/net/hamradio/bpqether.c b/trunk/drivers/net/hamradio/bpqether.c index 0641f54fc638..cb43a9d28774 100644 --- a/trunk/drivers/net/hamradio/bpqether.c +++ b/trunk/drivers/net/hamradio/bpqether.c @@ -54,6 +54,7 @@ * BPQ 004 Joerg(DL1BKE) Fixed to not lock up on ifconfig. */ +#include #include #include #include diff --git a/trunk/drivers/net/hamradio/mkiss.c b/trunk/drivers/net/hamradio/mkiss.c index d8715b200c17..3ebbbe56b6e9 100644 --- a/trunk/drivers/net/hamradio/mkiss.c +++ b/trunk/drivers/net/hamradio/mkiss.c @@ -16,6 +16,7 @@ * Copyright (C) 2004, 05 Ralf Baechle DL5RB * Copyright (C) 2004, 05 Thomas Osterried DL9SAU */ +#include #include #include #include diff --git a/trunk/drivers/net/hamradio/scc.c b/trunk/drivers/net/hamradio/scc.c index df4b68142ac7..5927784df3f9 100644 --- a/trunk/drivers/net/hamradio/scc.c +++ b/trunk/drivers/net/hamradio/scc.c @@ -148,6 +148,7 @@ /* ----------------------------------------------------------------------- */ +#include #include #include #include @@ -1736,7 +1737,7 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) if (!Ivec[hwcfg.irq].used && hwcfg.irq) { - if (request_irq(hwcfg.irq, scc_isr, IRQF_DISABLED, "AX.25 SCC", NULL)) + if (request_irq(hwcfg.irq, scc_isr, SA_INTERRUPT, "AX.25 SCC", NULL)) printk(KERN_WARNING "z8530drv: warning, cannot get IRQ %d\n", hwcfg.irq); else Ivec[hwcfg.irq].used = 1; diff --git a/trunk/drivers/net/hamradio/yam.c b/trunk/drivers/net/hamradio/yam.c index f98f5777dfbb..b49884048caa 100644 --- a/trunk/drivers/net/hamradio/yam.c +++ b/trunk/drivers/net/hamradio/yam.c @@ -42,6 +42,7 @@ /*****************************************************************************/ +#include #include #include #include @@ -873,7 +874,7 @@ static int yam_open(struct net_device *dev) goto out_release_base; } outb(0, IER(dev->base_addr)); - if (request_irq(dev->irq, yam_interrupt, IRQF_DISABLED | IRQF_SHARED, dev->name, dev)) { + if (request_irq(dev->irq, yam_interrupt, SA_INTERRUPT | SA_SHIRQ, dev->name, dev)) { printk(KERN_ERR "%s: irq %d busy\n", dev->name, dev->irq); ret = -EBUSY; goto out_release_base; diff --git a/trunk/drivers/net/hp100.c b/trunk/drivers/net/hp100.c index e7d9bf330287..dd1dc32dc98d 100644 --- a/trunk/drivers/net/hp100.c +++ b/trunk/drivers/net/hp100.c @@ -1079,7 +1079,7 @@ static int hp100_open(struct net_device *dev) /* New: if bus is PCI or EISA, interrupts might be shared interrupts */ if (request_irq(dev->irq, hp100_interrupt, lp->bus == HP100_BUS_PCI || lp->bus == - HP100_BUS_EISA ? IRQF_SHARED : IRQF_DISABLED, + HP100_BUS_EISA ? SA_SHIRQ : SA_INTERRUPT, "hp100", dev)) { printk("hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq); return -EAGAIN; diff --git a/trunk/drivers/net/hydra.c b/trunk/drivers/net/hydra.c index 91326ea3e12b..d9fb8e74e631 100644 --- a/trunk/drivers/net/hydra.c +++ b/trunk/drivers/net/hydra.c @@ -117,7 +117,7 @@ static int __devinit hydra_init(struct zorro_dev *z) dev->irq = IRQ_AMIGA_PORTS; /* Install the Interrupt handler */ - if (request_irq(IRQ_AMIGA_PORTS, ei_interrupt, IRQF_SHARED, "Hydra Ethernet", + if (request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, "Hydra Ethernet", dev)) { free_netdev(dev); return -EAGAIN; diff --git a/trunk/drivers/net/ibm_emac/ibm_emac.h b/trunk/drivers/net/ibm_emac/ibm_emac.h index 97ed22bb4320..c2dae6092c4c 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac.h +++ b/trunk/drivers/net/ibm_emac/ibm_emac.h @@ -20,6 +20,7 @@ #ifndef __IBM_EMAC_H_ #define __IBM_EMAC_H_ +#include #include /* This is a simple check to prevent use of this driver on non-tested SoCs */ diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_core.c b/trunk/drivers/net/ibm_emac/ibm_emac_core.c index 82468e2dc799..7e49522b8b3c 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_core.c +++ b/trunk/drivers/net/ibm_emac/ibm_emac_core.c @@ -19,6 +19,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_core.h b/trunk/drivers/net/ibm_emac/ibm_emac_core.h index dabb94afeb98..f61273b2e94f 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_core.h +++ b/trunk/drivers/net/ibm_emac/ibm_emac_core.h @@ -20,6 +20,7 @@ #ifndef __IBM_EMAC_CORE_H_ #define __IBM_EMAC_CORE_H_ +#include #include #include #include diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_debug.c b/trunk/drivers/net/ibm_emac/ibm_emac_debug.c index c3645908034d..c7e1ecfa08fe 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_debug.c +++ b/trunk/drivers/net/ibm_emac/ibm_emac_debug.c @@ -12,6 +12,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_debug.h b/trunk/drivers/net/ibm_emac/ibm_emac_debug.h index 5761389495d0..e85fbe0a8da9 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_debug.h +++ b/trunk/drivers/net/ibm_emac/ibm_emac_debug.h @@ -15,6 +15,7 @@ #ifndef __IBM_EMAC_DEBUG_H_ #define __IBM_EMAC_DEBUG_H_ +#include #include #include "ibm_emac_core.h" #include "ibm_emac_mal.h" diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_mal.c b/trunk/drivers/net/ibm_emac/ibm_emac_mal.c index af50e7b2e0d7..da88d43081cc 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_mal.c +++ b/trunk/drivers/net/ibm_emac/ibm_emac_mal.c @@ -19,6 +19,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_mal.h b/trunk/drivers/net/ibm_emac/ibm_emac_mal.h index f73f10a0a562..2a2d3b24b037 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_mal.h +++ b/trunk/drivers/net/ibm_emac/ibm_emac_mal.h @@ -19,6 +19,7 @@ #ifndef __IBM_EMAC_MAL_H_ #define __IBM_EMAC_MAL_H_ +#include #include #include #include diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_phy.c b/trunk/drivers/net/ibm_emac/ibm_emac_phy.c index 4a97024061e5..67935dd33a65 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_phy.c +++ b/trunk/drivers/net/ibm_emac/ibm_emac_phy.c @@ -12,6 +12,7 @@ * (c) 2004-2005, Eugene Surovegin * */ +#include #include #include #include diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_rgmii.c b/trunk/drivers/net/ibm_emac/ibm_emac_rgmii.c index 53d281cb9a16..f0b1ffb2dbbf 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_rgmii.c +++ b/trunk/drivers/net/ibm_emac/ibm_emac_rgmii.c @@ -16,6 +16,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_rgmii.h b/trunk/drivers/net/ibm_emac/ibm_emac_rgmii.h index 94abde55e2e9..7f03d536c9a3 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_rgmii.h +++ b/trunk/drivers/net/ibm_emac/ibm_emac_rgmii.h @@ -21,6 +21,7 @@ #ifndef _IBM_EMAC_RGMII_H_ #define _IBM_EMAC_RGMII_H_ +#include /* RGMII bridge */ struct rgmii_regs { diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_tah.c b/trunk/drivers/net/ibm_emac/ibm_emac_tah.c index e287b451bb44..af08afc22f9f 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_tah.c +++ b/trunk/drivers/net/ibm_emac/ibm_emac_tah.c @@ -13,6 +13,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include "ibm_emac_core.h" diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_tah.h b/trunk/drivers/net/ibm_emac/ibm_emac_tah.h index 38153945a240..9299b5dd7eb1 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_tah.h +++ b/trunk/drivers/net/ibm_emac/ibm_emac_tah.h @@ -17,6 +17,7 @@ #ifndef _IBM_EMAC_TAH_H #define _IBM_EMAC_TAH_H +#include #include #include diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_zmii.c b/trunk/drivers/net/ibm_emac/ibm_emac_zmii.c index 37dc8f342868..e129e0aaa045 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_zmii.c +++ b/trunk/drivers/net/ibm_emac/ibm_emac_zmii.c @@ -16,6 +16,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_zmii.h b/trunk/drivers/net/ibm_emac/ibm_emac_zmii.h index 972e3a44a09f..92c854410753 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_zmii.h +++ b/trunk/drivers/net/ibm_emac/ibm_emac_zmii.h @@ -19,6 +19,7 @@ #ifndef _IBM_EMAC_ZMII_H_ #define _IBM_EMAC_ZMII_H_ +#include #include #include diff --git a/trunk/drivers/net/ibmlana.c b/trunk/drivers/net/ibmlana.c index 2a95d72fa593..51fd51609ea9 100644 --- a/trunk/drivers/net/ibmlana.c +++ b/trunk/drivers/net/ibmlana.c @@ -782,7 +782,7 @@ static int ibmlana_open(struct net_device *dev) /* register resources - only necessary for IRQ */ - result = request_irq(priv->realirq, irq_handler, IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); + result = request_irq(priv->realirq, irq_handler, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); if (result != 0) { printk(KERN_ERR "%s: failed to register irq %d\n", dev->name, dev->irq); return result; diff --git a/trunk/drivers/net/ibmveth.c b/trunk/drivers/net/ibmveth.c index 0464e78f733a..4c2e7279ba34 100644 --- a/trunk/drivers/net/ibmveth.c +++ b/trunk/drivers/net/ibmveth.c @@ -33,6 +33,7 @@ - possibly remove procfs support */ +#include #include #include #include diff --git a/trunk/drivers/net/ifb.c b/trunk/drivers/net/ifb.c index 3a42afab5036..2e222ef91e22 100644 --- a/trunk/drivers/net/ifb.c +++ b/trunk/drivers/net/ifb.c @@ -27,6 +27,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/net/ioc3-eth.c b/trunk/drivers/net/ioc3-eth.c index 68d8af7df08e..e76e6e7be0b1 100644 --- a/trunk/drivers/net/ioc3-eth.c +++ b/trunk/drivers/net/ioc3-eth.c @@ -30,6 +30,7 @@ #define IOC3_NAME "ioc3-eth" #define IOC3_VERSION "2.6.3-3" +#include #include #include #include @@ -1063,7 +1064,7 @@ static int ioc3_open(struct net_device *dev) { struct ioc3_private *ip = netdev_priv(dev); - if (request_irq(dev->irq, ioc3_interrupt, IRQF_SHARED, ioc3_str, dev)) { + if (request_irq(dev->irq, ioc3_interrupt, SA_SHIRQ, ioc3_str, dev)) { printk(KERN_ERR "%s: Can't get irq %d\n", dev->name, dev->irq); return -EAGAIN; diff --git a/trunk/drivers/net/irda/au1k_ir.c b/trunk/drivers/net/irda/au1k_ir.c index 7b2b4135bb23..e6b1985767c2 100644 --- a/trunk/drivers/net/irda/au1k_ir.c +++ b/trunk/drivers/net/irda/au1k_ir.c @@ -18,6 +18,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/drivers/net/irda/donauboe.c b/trunk/drivers/net/irda/donauboe.c index 33c07d5275da..910c0cab35b0 100644 --- a/trunk/drivers/net/irda/donauboe.c +++ b/trunk/drivers/net/irda/donauboe.c @@ -1372,7 +1372,7 @@ toshoboe_net_open (struct net_device *dev) return 0; if (request_irq (self->io.irq, toshoboe_interrupt, - IRQF_SHARED | IRQF_DISABLED, dev->name, (void *) self)) + SA_SHIRQ | SA_INTERRUPT, dev->name, (void *) self)) { return -EAGAIN; } @@ -1573,7 +1573,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid) self->io.fir_base = self->base; self->io.fir_ext = OBOE_IO_EXTENT; self->io.irq = pci_dev->irq; - self->io.irqflags = IRQF_SHARED | IRQF_DISABLED; + self->io.irqflags = SA_SHIRQ | SA_INTERRUPT; self->speed = self->io.speed = 9600; self->async = 0; diff --git a/trunk/drivers/net/irda/pxaficp_ir.c b/trunk/drivers/net/irda/pxaficp_ir.c index afb19e8d95c8..e1aa9910503b 100644 --- a/trunk/drivers/net/irda/pxaficp_ir.c +++ b/trunk/drivers/net/irda/pxaficp_ir.c @@ -12,6 +12,7 @@ * Infra-red driver (SIR/FIR) for the PXA2xx embedded microprocessor * */ +#include #include #include #include diff --git a/trunk/drivers/net/irda/sa1100_ir.c b/trunk/drivers/net/irda/sa1100_ir.c index 8d5a288d7976..f530686bd09f 100644 --- a/trunk/drivers/net/irda/sa1100_ir.c +++ b/trunk/drivers/net/irda/sa1100_ir.c @@ -18,6 +18,7 @@ * power_leve:level - set the transmitter power level * tx_lpm:0|1 - set transmit low power mode */ +#include #include #include #include diff --git a/trunk/drivers/net/irda/vlsi_ir.c b/trunk/drivers/net/irda/vlsi_ir.c index 92d646cc9edc..d70b9e8d6e60 100644 --- a/trunk/drivers/net/irda/vlsi_ir.c +++ b/trunk/drivers/net/irda/vlsi_ir.c @@ -21,6 +21,7 @@ * ********************************************************************/ +#include #include #define DRIVER_NAME "vlsi_ir" @@ -1517,7 +1518,7 @@ static int vlsi_open(struct net_device *ndev) outb(IRINTR_INT_MASK, ndev->base_addr+VLSI_PIO_IRINTR); - if (request_irq(ndev->irq, vlsi_interrupt, IRQF_SHARED, + if (request_irq(ndev->irq, vlsi_interrupt, SA_SHIRQ, drivername, ndev)) { IRDA_WARNING("%s: couldn't get IRQ: %d\n", __FUNCTION__, ndev->irq); diff --git a/trunk/drivers/net/iseries_veth.c b/trunk/drivers/net/iseries_veth.c index cdc14401cdbe..93394d76587a 100644 --- a/trunk/drivers/net/iseries_veth.c +++ b/trunk/drivers/net/iseries_veth.c @@ -56,6 +56,7 @@ * number of packets outstanding to a remote partition at a time. */ +#include #include #include #include diff --git a/trunk/drivers/net/ixgb/ixgb.h b/trunk/drivers/net/ixgb/ixgb.h index 82b67af54c94..a83ef28dadb0 100644 --- a/trunk/drivers/net/ixgb/ixgb.h +++ b/trunk/drivers/net/ixgb/ixgb.h @@ -30,6 +30,7 @@ #define _IXGB_H_ #include +#include #include #include #include diff --git a/trunk/drivers/net/ixgb/ixgb_main.c b/trunk/drivers/net/ixgb/ixgb_main.c index b91e082483f6..8bb32f946993 100644 --- a/trunk/drivers/net/ixgb/ixgb_main.c +++ b/trunk/drivers/net/ixgb/ixgb_main.c @@ -253,7 +253,7 @@ ixgb_up(struct ixgb_adapter *adapter) #endif if((err = request_irq(adapter->pdev->irq, &ixgb_intr, - IRQF_SHARED | IRQF_SAMPLE_RANDOM, + SA_SHIRQ | SA_SAMPLE_RANDOM, netdev->name, netdev))) { DPRINTK(PROBE, ERR, "Unable to allocate interrupt Error: %d\n", err); diff --git a/trunk/drivers/net/ixp2000/caleb.c b/trunk/drivers/net/ixp2000/caleb.c index 7dea5b95012c..3595e107df22 100644 --- a/trunk/drivers/net/ixp2000/caleb.c +++ b/trunk/drivers/net/ixp2000/caleb.c @@ -9,6 +9,7 @@ * (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/drivers/net/ixp2000/enp2611.c b/trunk/drivers/net/ixp2000/enp2611.c index d3f4235c585d..b67f586d7392 100644 --- a/trunk/drivers/net/ixp2000/enp2611.c +++ b/trunk/drivers/net/ixp2000/enp2611.c @@ -9,6 +9,7 @@ * (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/drivers/net/ixp2000/ixp2400-msf.c b/trunk/drivers/net/ixp2000/ixp2400-msf.c index 9ec38eebfb56..48a3a891d3a4 100644 --- a/trunk/drivers/net/ixp2000/ixp2400-msf.c +++ b/trunk/drivers/net/ixp2000/ixp2400-msf.c @@ -11,6 +11,7 @@ * License, or (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/drivers/net/ixp2000/ixpdev.c b/trunk/drivers/net/ixp2000/ixpdev.c index 6eeb965b4d72..fbc2d21020f4 100644 --- a/trunk/drivers/net/ixp2000/ixpdev.c +++ b/trunk/drivers/net/ixp2000/ixpdev.c @@ -9,6 +9,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -235,7 +236,7 @@ static int ixpdev_open(struct net_device *dev) if (!nds_open++) { err = request_irq(IRQ_IXP2000_THDA0, ixpdev_interrupt, - IRQF_SHARED, "ixp2000_eth", nds); + SA_SHIRQ, "ixp2000_eth", nds); if (err) { nds_open--; return err; diff --git a/trunk/drivers/net/ixp2000/pm3386.c b/trunk/drivers/net/ixp2000/pm3386.c index e08d3f9863b8..5224651c9aac 100644 --- a/trunk/drivers/net/ixp2000/pm3386.c +++ b/trunk/drivers/net/ixp2000/pm3386.c @@ -9,6 +9,7 @@ * (at your option) any later version. */ +#include #include #include #include diff --git a/trunk/drivers/net/jazzsonic.c b/trunk/drivers/net/jazzsonic.c index 661d75b4cad2..272d331d29cd 100644 --- a/trunk/drivers/net/jazzsonic.c +++ b/trunk/drivers/net/jazzsonic.c @@ -260,7 +260,7 @@ MODULE_DESCRIPTION("Jazz SONIC ethernet driver"); module_param(sonic_debug, int, 0); MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)"); -#define SONIC_IRQ_FLAG IRQF_DISABLED +#define SONIC_IRQ_FLAG SA_INTERRUPT #include "sonic.c" diff --git a/trunk/drivers/net/lp486e.c b/trunk/drivers/net/lp486e.c index b783a6984abc..bf3f343ae715 100644 --- a/trunk/drivers/net/lp486e.c +++ b/trunk/drivers/net/lp486e.c @@ -851,7 +851,7 @@ static int i596_open(struct net_device *dev) { int i; - i = request_irq(dev->irq, &i596_interrupt, IRQF_SHARED, dev->name, dev); + i = request_irq(dev->irq, &i596_interrupt, SA_SHIRQ, dev->name, dev); if (i) { printk(KERN_ERR "%s: IRQ %d not free\n", dev->name, dev->irq); return i; diff --git a/trunk/drivers/net/mace.c b/trunk/drivers/net/mace.c index 29e4b5aa6ead..77792b286027 100644 --- a/trunk/drivers/net/mace.c +++ b/trunk/drivers/net/mace.c @@ -5,6 +5,7 @@ * Copyright (C) 1996 Paul Mackerras. */ +#include #include #include #include @@ -242,12 +243,12 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i } rc = request_irq(mp->tx_dma_intr, mace_txdma_intr, 0, "MACE-txdma", dev); if (rc) { - printk(KERN_ERR "MACE: can't get irq %d\n", mp->tx_dma_intr); + printk(KERN_ERR "MACE: can't get irq %d\n", mace->intrs[1].line); goto err_free_irq; } rc = request_irq(mp->rx_dma_intr, mace_rxdma_intr, 0, "MACE-rxdma", dev); if (rc) { - printk(KERN_ERR "MACE: can't get irq %d\n", mp->rx_dma_intr); + printk(KERN_ERR "MACE: can't get irq %d\n", mace->intrs[2].line); goto err_free_tx_irq; } diff --git a/trunk/drivers/net/mipsnet.c b/trunk/drivers/net/mipsnet.c index 07e58f4a2916..bbffb585b3b3 100644 --- a/trunk/drivers/net/mipsnet.c +++ b/trunk/drivers/net/mipsnet.c @@ -179,7 +179,7 @@ static int mipsnet_open(struct net_device *dev) pr_debug("%s: mipsnet_open\n", dev->name); err = request_irq(dev->irq, &mipsnet_interrupt, - IRQF_SHARED, dev->name, (void *) dev); + SA_SHIRQ, dev->name, (void *) dev); if (err) { pr_debug("%s: %s(): can't get irq %d\n", diff --git a/trunk/drivers/net/mv643xx_eth.c b/trunk/drivers/net/mv643xx_eth.c index 760c61b98867..625ff61c9988 100644 --- a/trunk/drivers/net/mv643xx_eth.c +++ b/trunk/drivers/net/mv643xx_eth.c @@ -778,7 +778,7 @@ static int mv643xx_eth_open(struct net_device *dev) int err; err = request_irq(dev->irq, mv643xx_eth_int_handler, - IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); + SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); if (err) { printk(KERN_ERR "Can not assign IRQ number to MV643XX_eth%d\n", port_num); diff --git a/trunk/drivers/net/mv643xx_eth.h b/trunk/drivers/net/mv643xx_eth.h index 33c5fafdbbd3..4262c1da6d4a 100644 --- a/trunk/drivers/net/mv643xx_eth.h +++ b/trunk/drivers/net/mv643xx_eth.h @@ -258,7 +258,7 @@ struct pkt_info { struct sk_buff *return_info; /* User resource return information */ }; -/* Ethernet port specific information */ +/* Ethernet port specific infomation */ struct mv643xx_mib_counters { u64 good_octets_received; diff --git a/trunk/drivers/net/myri10ge/myri10ge.c b/trunk/drivers/net/myri10ge/myri10ge.c index 72aad42db7b4..dbdf189436fa 100644 --- a/trunk/drivers/net/myri10ge/myri10ge.c +++ b/trunk/drivers/net/myri10ge/myri10ge.c @@ -2413,7 +2413,7 @@ static int myri10ge_resume(struct pci_dev *pdev) pci_enable_device(pdev); pci_set_master(pdev); - status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED, + status = request_irq(pdev->irq, myri10ge_intr, SA_SHIRQ, netdev->name, mgp); if (status != 0) { dev_err(&pdev->dev, "failed to allocate IRQ\n"); @@ -2694,7 +2694,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) mgp->msi_enabled = 1; } - status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED, + status = request_irq(pdev->irq, myri10ge_intr, SA_SHIRQ, netdev->name, mgp); if (status != 0) { dev_err(&pdev->dev, "failed to allocate IRQ\n"); diff --git a/trunk/drivers/net/myri_sbus.c b/trunk/drivers/net/myri_sbus.c index 1b965a2b56e4..d9f616fea3d9 100644 --- a/trunk/drivers/net/myri_sbus.c +++ b/trunk/drivers/net/myri_sbus.c @@ -7,6 +7,7 @@ static char version[] = "myri_sbus.c:v2.0 June 23, 2006 David S. Miller (davem@davemloft.net)\n"; #include +#include #include #include #include @@ -1069,7 +1070,7 @@ static int __init myri_ether_init(struct sbus_dev *sdev) /* Register interrupt handler now. */ DET(("Requesting MYRIcom IRQ line.\n")); if (request_irq(dev->irq, &myri_interrupt, - IRQF_SHARED, "MyriCOM Ethernet", (void *) dev)) { + SA_SHIRQ, "MyriCOM Ethernet", (void *) dev)) { printk("MyriCOM: Cannot register interrupt handler.\n"); goto err; } diff --git a/trunk/drivers/net/natsemi.c b/trunk/drivers/net/natsemi.c index 9df2628be1e7..5657049c2160 100644 --- a/trunk/drivers/net/natsemi.c +++ b/trunk/drivers/net/natsemi.c @@ -138,6 +138,7 @@ * big endian support with CFG:BEM instead of cpu_to_le32 */ +#include #include #include #include @@ -1574,7 +1575,7 @@ static int netdev_open(struct net_device *dev) /* Reset the chip, just in case. */ natsemi_reset(dev); - i = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev); + i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev); if (i) return i; if (netif_msg_ifup(np)) diff --git a/trunk/drivers/net/ne2k-pci.c b/trunk/drivers/net/ne2k-pci.c index fa50eb889408..ced9fdb8335c 100644 --- a/trunk/drivers/net/ne2k-pci.c +++ b/trunk/drivers/net/ne2k-pci.c @@ -420,7 +420,7 @@ static int ne2k_pci_set_fdx(struct net_device *dev) static int ne2k_pci_open(struct net_device *dev) { - int ret = request_irq(dev->irq, ei_interrupt, IRQF_SHARED, dev->name, dev); + int ret = request_irq(dev->irq, ei_interrupt, SA_SHIRQ, dev->name, dev); if (ret) return ret; diff --git a/trunk/drivers/net/netx-eth.c b/trunk/drivers/net/netx-eth.c index b1311ae82675..b92430c4e3ac 100644 --- a/trunk/drivers/net/netx-eth.c +++ b/trunk/drivers/net/netx-eth.c @@ -223,7 +223,7 @@ static int netx_eth_open(struct net_device *ndev) struct netx_eth_priv *priv = netdev_priv(ndev); if (request_irq - (ndev->irq, &netx_eth_interrupt, IRQF_SHARED, ndev->name, ndev)) + (ndev->irq, &netx_eth_interrupt, SA_SHIRQ, ndev->name, ndev)) return -EAGAIN; writel(ndev->dev_addr[0] | diff --git a/trunk/drivers/net/ns83820.c b/trunk/drivers/net/ns83820.c index 70429108c40d..706aed7d717f 100644 --- a/trunk/drivers/net/ns83820.c +++ b/trunk/drivers/net/ns83820.c @@ -96,6 +96,7 @@ //#define dprintk printk #define dprintk(x...) do { } while (0) +#include #include #include #include @@ -1881,7 +1882,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ dev->IMR_cache = 0; - err = request_irq(pci_dev->irq, ns83820_irq, IRQF_SHARED, + err = request_irq(pci_dev->irq, ns83820_irq, SA_SHIRQ, DRV_NAME, ndev); if (err) { printk(KERN_INFO "ns83820: unable to register irq %d\n", diff --git a/trunk/drivers/net/pci-skeleton.c b/trunk/drivers/net/pci-skeleton.c index 3388ee1313ea..a7bb54df75a8 100644 --- a/trunk/drivers/net/pci-skeleton.c +++ b/trunk/drivers/net/pci-skeleton.c @@ -85,6 +85,7 @@ IVc. Errata */ +#include #include #include #include @@ -1075,7 +1076,7 @@ static int netdrv_open (struct net_device *dev) DPRINTK ("ENTER\n"); - retval = request_irq (dev->irq, netdrv_interrupt, IRQF_SHARED, dev->name, dev); + retval = request_irq (dev->irq, netdrv_interrupt, SA_SHIRQ, dev->name, dev); if (retval) { DPRINTK ("EXIT, returning %d\n", retval); return retval; diff --git a/trunk/drivers/net/pcmcia/axnet_cs.c b/trunk/drivers/net/pcmcia/axnet_cs.c index 297e9f805366..2ea66aca648b 100644 --- a/trunk/drivers/net/pcmcia/axnet_cs.c +++ b/trunk/drivers/net/pcmcia/axnet_cs.c @@ -535,7 +535,7 @@ static int axnet_open(struct net_device *dev) link->open++; - request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev); + request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, "axnet_cs", dev); info->link_status = 0x00; init_timer(&info->watchdog); diff --git a/trunk/drivers/net/pcmcia/com20020_cs.c b/trunk/drivers/net/pcmcia/com20020_cs.c index 48434d7924eb..441de824ab6b 100644 --- a/trunk/drivers/net/pcmcia/com20020_cs.c +++ b/trunk/drivers/net/pcmcia/com20020_cs.c @@ -387,10 +387,7 @@ static int com20020_resume(struct pcmcia_device *link) } static struct pcmcia_device_id com20020_ids[] = { - PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.", - "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf), - PCMCIA_DEVICE_PROD_ID12("SoHard AG", - "SH ARC PCMCIA", 0xf8991729, 0x69dff0c7), + PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.", "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf), PCMCIA_DEVICE_NULL }; MODULE_DEVICE_TABLE(pcmcia, com20020_ids); diff --git a/trunk/drivers/net/pcmcia/pcnet_cs.c b/trunk/drivers/net/pcmcia/pcnet_cs.c index 0ecebfc31f07..661bfe54ff5d 100644 --- a/trunk/drivers/net/pcmcia/pcnet_cs.c +++ b/trunk/drivers/net/pcmcia/pcnet_cs.c @@ -998,7 +998,7 @@ static int pcnet_open(struct net_device *dev) link->open++; set_misc_reg(dev); - request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev); + request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, dev_info, dev); info->phy_id = info->eth_phy; info->link_status = 0x00; diff --git a/trunk/drivers/net/pcnet32.c b/trunk/drivers/net/pcnet32.c index d768f3d1ac28..0e01c75da429 100644 --- a/trunk/drivers/net/pcnet32.c +++ b/trunk/drivers/net/pcnet32.c @@ -1541,7 +1541,7 @@ static int pcnet32_open(struct net_device *dev) unsigned long flags; if (request_irq(dev->irq, &pcnet32_interrupt, - lp->shared_irq ? IRQF_SHARED : 0, dev->name, + lp->shared_irq ? SA_SHIRQ : 0, dev->name, (void *)dev)) { return -EAGAIN; } diff --git a/trunk/drivers/net/phy/cicada.c b/trunk/drivers/net/phy/cicada.c index 3efb715c28dc..7d8d534255c0 100644 --- a/trunk/drivers/net/phy/cicada.c +++ b/trunk/drivers/net/phy/cicada.c @@ -13,6 +13,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/phy/davicom.c b/trunk/drivers/net/phy/davicom.c index aa7983f55838..5e9002e444c5 100644 --- a/trunk/drivers/net/phy/davicom.c +++ b/trunk/drivers/net/phy/davicom.c @@ -13,6 +13,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/phy/lxt.c b/trunk/drivers/net/phy/lxt.c index 69d2325f848c..3f702c503afe 100644 --- a/trunk/drivers/net/phy/lxt.c +++ b/trunk/drivers/net/phy/lxt.c @@ -13,6 +13,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/phy/marvell.c b/trunk/drivers/net/phy/marvell.c index 0ad253282d0d..a2d6386d13bc 100644 --- a/trunk/drivers/net/phy/marvell.c +++ b/trunk/drivers/net/phy/marvell.c @@ -13,6 +13,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/phy/mdio_bus.c b/trunk/drivers/net/phy/mdio_bus.c index 1dde390c164d..1b236bdf6b92 100644 --- a/trunk/drivers/net/phy/mdio_bus.c +++ b/trunk/drivers/net/phy/mdio_bus.c @@ -13,6 +13,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/phy/phy.c b/trunk/drivers/net/phy/phy.c index 7d5c2233c252..33cec2dab942 100644 --- a/trunk/drivers/net/phy/phy.c +++ b/trunk/drivers/net/phy/phy.c @@ -14,6 +14,7 @@ * option) any later version. * */ +#include #include #include #include @@ -556,7 +557,7 @@ int phy_start_interrupts(struct phy_device *phydev) INIT_WORK(&phydev->phy_queue, phy_change, phydev); if (request_irq(phydev->irq, phy_interrupt, - IRQF_SHARED, + SA_SHIRQ, "phy_interrupt", phydev) < 0) { printk(KERN_WARNING "%s: Can't get IRQ %d (PHY)\n", diff --git a/trunk/drivers/net/phy/phy_device.c b/trunk/drivers/net/phy/phy_device.c index 1bc1e032c5d6..7da0e3dd5fe3 100644 --- a/trunk/drivers/net/phy/phy_device.c +++ b/trunk/drivers/net/phy/phy_device.c @@ -14,6 +14,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/phy/qsemi.c b/trunk/drivers/net/phy/qsemi.c index 2b50e1739aa5..65d995b02b25 100644 --- a/trunk/drivers/net/phy/qsemi.c +++ b/trunk/drivers/net/phy/qsemi.c @@ -13,6 +13,7 @@ * option) any later version. * */ +#include #include #include #include diff --git a/trunk/drivers/net/ppp_generic.c b/trunk/drivers/net/ppp_generic.c index 0ec6e9d57b94..425ff5b117f1 100644 --- a/trunk/drivers/net/ppp_generic.c +++ b/trunk/drivers/net/ppp_generic.c @@ -22,6 +22,7 @@ * ==FILEVERSION 20041108== */ +#include #include #include #include diff --git a/trunk/drivers/net/ppp_mppe.c b/trunk/drivers/net/ppp_mppe.c index 51ff9a9d1bb5..1985d1b57c45 100644 --- a/trunk/drivers/net/ppp_mppe.c +++ b/trunk/drivers/net/ppp_mppe.c @@ -43,6 +43,7 @@ * deprecated in 2.6 */ +#include #include #include #include diff --git a/trunk/drivers/net/r8169.c b/trunk/drivers/net/r8169.c index 16a0ef1b1369..12d1cb289bb0 100644 --- a/trunk/drivers/net/r8169.c +++ b/trunk/drivers/net/r8169.c @@ -1726,7 +1726,7 @@ static int rtl8169_open(struct net_device *dev) rtl8169_set_rxbufsize(tp, dev); retval = - request_irq(dev->irq, rtl8169_interrupt, IRQF_SHARED, dev->name, dev); + request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev); if (retval < 0) goto out; diff --git a/trunk/drivers/net/rrunner.c b/trunk/drivers/net/rrunner.c index c3ed734cbe39..19c2df9c86fe 100644 --- a/trunk/drivers/net/rrunner.c +++ b/trunk/drivers/net/rrunner.c @@ -28,6 +28,7 @@ #define RX_DMA_SKBUFF 1 #define PKT_COPY_THRESHOLD 512 +#include #include #include #include @@ -1252,7 +1253,7 @@ static int rr_open(struct net_device *dev) readl(®s->HostCtrl); spin_unlock_irqrestore(&rrpriv->lock, flags); - if (request_irq(dev->irq, rr_interrupt, IRQF_SHARED, dev->name, dev)) { + if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, dev->name, dev)) { printk(KERN_WARNING "%s: Requested IRQ %d is busy\n", dev->name, dev->irq); ecode = -EAGAIN; diff --git a/trunk/drivers/net/rrunner.h b/trunk/drivers/net/rrunner.h index 2c3c91ebd99f..10baae55953a 100644 --- a/trunk/drivers/net/rrunner.h +++ b/trunk/drivers/net/rrunner.h @@ -1,6 +1,7 @@ #ifndef _RRUNNER_H_ #define _RRUNNER_H_ +#include #include #if ((BITS_PER_LONG != 32) && (BITS_PER_LONG != 64)) diff --git a/trunk/drivers/net/s2io.c b/trunk/drivers/net/s2io.c index c6b77acb35ef..3defe5d4f7d3 100644 --- a/trunk/drivers/net/s2io.c +++ b/trunk/drivers/net/s2io.c @@ -44,6 +44,7 @@ * aggregated as a single large packet ************************************************************************/ +#include #include #include #include @@ -3761,7 +3762,7 @@ static int s2io_open(struct net_device *dev) /* After proper initialization of H/W, register ISR */ if (sp->intr_type == MSI) { err = request_irq((int) sp->pdev->irq, s2io_msi_handle, - IRQF_SHARED, sp->name, dev); + SA_SHIRQ, sp->name, dev); if (err) { DBG_PRINT(ERR_DBG, "%s: MSI registration \ failed\n", dev->name); @@ -3799,7 +3800,7 @@ failed\n", dev->name, i); } } if (sp->intr_type == INTA) { - err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED, + err = request_irq((int) sp->pdev->irq, s2io_isr, SA_SHIRQ, sp->name, dev); if (err) { DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n", @@ -3959,7 +3960,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) txdp->Control_2 = 0; #ifdef NETIF_F_TSO mss = skb_shinfo(skb)->gso_size; - if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) { + if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV4) { txdp->Control_1 |= TXD_TCP_LSO_EN; txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); } @@ -3979,7 +3980,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) } frg_len = skb->len - skb->data_len; - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) { + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) { int ufo_size; ufo_size = skb_shinfo(skb)->gso_size; @@ -4008,7 +4009,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) txdp->Host_Control = (unsigned long) skb; txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) txdp->Control_1 |= TXD_UFO_EN; frg_cnt = skb_shinfo(skb)->nr_frags; @@ -4023,12 +4024,12 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) (sp->pdev, frag->page, frag->page_offset, frag->size, PCI_DMA_TODEVICE); txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) txdp->Control_1 |= TXD_UFO_EN; } txdp->Control_1 |= TXD_GATHER_CODE_LAST; - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) frg_cnt++; /* as Txd0 was used for inband header */ tx_fifo = mac_control->tx_FIFO_start[queue]; @@ -4042,7 +4043,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) if (mss) val64 |= TX_FIFO_SPECIAL_FUNC; #endif - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) val64 |= TX_FIFO_SPECIAL_FUNC; writeq(val64, &tx_fifo->List_Control); @@ -7019,9 +7020,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) dev->features |= NETIF_F_HIGHDMA; #ifdef NETIF_F_TSO dev->features |= NETIF_F_TSO; -#endif -#ifdef NETIF_F_TSO6 - dev->features |= NETIF_F_TSO6; #endif if (sp->device_type & XFRAME_II_DEVICE) { dev->features |= NETIF_F_UFO; diff --git a/trunk/drivers/net/s2io.h b/trunk/drivers/net/s2io.h index c43f52179708..3203732a668d 100644 --- a/trunk/drivers/net/s2io.h +++ b/trunk/drivers/net/s2io.h @@ -652,7 +652,7 @@ typedef struct fifo_info { nic_t *nic; }fifo_info_t; -/* Information related to the Tx and Rx FIFOs and Rings of Xena +/* Infomation related to the Tx and Rx FIFOs and Rings of Xena * is maintained in this structure. */ typedef struct mac_info { diff --git a/trunk/drivers/net/sb1250-mac.c b/trunk/drivers/net/sb1250-mac.c index 9ab1618e82a4..f2be9f83f091 100644 --- a/trunk/drivers/net/sb1250-mac.c +++ b/trunk/drivers/net/sb1250-mac.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include /* Processor type for cache alignment. */ #include @@ -2450,7 +2451,7 @@ static int sbmac_open(struct net_device *dev) */ __raw_readq(sc->sbm_isr); - if (request_irq(dev->irq, &sbmac_intr, IRQF_SHARED, dev->name, dev)) + if (request_irq(dev->irq, &sbmac_intr, SA_SHIRQ, dev->name, dev)) return -EBUSY; /* diff --git a/trunk/drivers/net/shaper.c b/trunk/drivers/net/shaper.c index c7832e69f177..88e212043a43 100644 --- a/trunk/drivers/net/shaper.c +++ b/trunk/drivers/net/shaper.c @@ -69,6 +69,7 @@ * 2000/03 Andi Kleen */ +#include #include #include #include diff --git a/trunk/drivers/net/sis190.c b/trunk/drivers/net/sis190.c index df0cbebb3277..df39f3447655 100644 --- a/trunk/drivers/net/sis190.c +++ b/trunk/drivers/net/sis190.c @@ -1054,7 +1054,7 @@ static int sis190_open(struct net_device *dev) sis190_request_timer(dev); - rc = request_irq(dev->irq, sis190_interrupt, IRQF_SHARED, dev->name, dev); + rc = request_irq(dev->irq, sis190_interrupt, SA_SHIRQ, dev->name, dev); if (rc < 0) goto err_release_timer_2; diff --git a/trunk/drivers/net/sis900.c b/trunk/drivers/net/sis900.c index 29ee7ffedfff..d05874172209 100644 --- a/trunk/drivers/net/sis900.c +++ b/trunk/drivers/net/sis900.c @@ -1013,7 +1013,7 @@ sis900_open(struct net_device *net_dev) /* Equalizer workaround Rule */ sis630_set_eq(net_dev, sis_priv->chipset_rev); - ret = request_irq(net_dev->irq, &sis900_interrupt, IRQF_SHARED, + ret = request_irq(net_dev->irq, &sis900_interrupt, SA_SHIRQ, net_dev->name, net_dev); if (ret) return ret; diff --git a/trunk/drivers/net/sk98lin/skge.c b/trunk/drivers/net/sk98lin/skge.c index ee62845d3ac9..f3efbd177ae7 100644 --- a/trunk/drivers/net/sk98lin/skge.c +++ b/trunk/drivers/net/sk98lin/skge.c @@ -570,9 +570,9 @@ SK_BOOL DualNet; spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); if (pAC->GIni.GIMacsFound == 2) { - Ret = request_irq(dev->irq, SkGeIsr, IRQF_SHARED, "sk98lin", dev); + Ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, "sk98lin", dev); } else if (pAC->GIni.GIMacsFound == 1) { - Ret = request_irq(dev->irq, SkGeIsrOnePort, IRQF_SHARED, + Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, "sk98lin", dev); } else { printk(KERN_WARNING "sk98lin: Illegal number of ports: %d\n", @@ -5073,9 +5073,9 @@ static int skge_resume(struct pci_dev *pdev) pci_enable_device(pdev); pci_set_master(pdev); if (pAC->GIni.GIMacsFound == 2) - ret = request_irq(dev->irq, SkGeIsr, IRQF_SHARED, "sk98lin", dev); + ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, "sk98lin", dev); else - ret = request_irq(dev->irq, SkGeIsrOnePort, IRQF_SHARED, "sk98lin", dev); + ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, "sk98lin", dev); if (ret) { printk(KERN_WARNING "sk98lin: unable to acquire IRQ %d\n", dev->irq); pAC->AllocFlag &= ~SK_ALLOC_IRQ; diff --git a/trunk/drivers/net/sk98lin/skvpd.c b/trunk/drivers/net/sk98lin/skvpd.c index 1e662aaebf84..17786056c66a 100644 --- a/trunk/drivers/net/sk98lin/skvpd.c +++ b/trunk/drivers/net/sk98lin/skvpd.c @@ -22,7 +22,7 @@ ******************************************************************************/ /* - Please refer skvpd.txt for information how to include this module + Please refer skvpd.txt for infomation how to include this module */ static const char SysKonnectFileId[] = "@(#)$Id: skvpd.c,v 1.37 2003/01/13 10:42:45 rschmidt Exp $ (C) SK"; diff --git a/trunk/drivers/net/sk_mca.c b/trunk/drivers/net/sk_mca.c index 799e09801934..e5d6d95960c7 100644 --- a/trunk/drivers/net/sk_mca.c +++ b/trunk/drivers/net/sk_mca.c @@ -824,7 +824,7 @@ static int skmca_open(struct net_device *dev) /* register resources - only necessary for IRQ */ result = request_irq(priv->realirq, irq_handler, - IRQF_SHARED | IRQF_SAMPLE_RANDOM, "sk_mca", dev); + SA_SHIRQ | SA_SAMPLE_RANDOM, "sk_mca", dev); if (result != 0) { printk("%s: failed to register irq %d\n", dev->name, dev->irq); diff --git a/trunk/drivers/net/skfp/h/sba.h b/trunk/drivers/net/skfp/h/sba.h index 638cf0283bc4..df716cd5784a 100644 --- a/trunk/drivers/net/skfp/h/sba.h +++ b/trunk/drivers/net/skfp/h/sba.h @@ -13,7 +13,7 @@ ******************************************************************************/ /* - * Synchronous Bandwidth Allocation (SBA) structs + * Synchronous Bandwith Allocation (SBA) structs */ #ifndef _SBA_ diff --git a/trunk/drivers/net/skfp/skfddi.c b/trunk/drivers/net/skfp/skfddi.c index b5714a60237d..c7fb6133047e 100644 --- a/trunk/drivers/net/skfp/skfddi.c +++ b/trunk/drivers/net/skfp/skfddi.c @@ -497,7 +497,7 @@ static int skfp_open(struct net_device *dev) PRINTK(KERN_INFO "entering skfp_open\n"); /* Register IRQ - support shared interrupts by passing device ptr */ - err = request_irq(dev->irq, (void *) skfp_interrupt, IRQF_SHARED, + err = request_irq(dev->irq, (void *) skfp_interrupt, SA_SHIRQ, dev->name, dev); if (err) return err; diff --git a/trunk/drivers/net/skge.c b/trunk/drivers/net/skge.c index 82200bfaa8ed..1608efab4e3d 100644 --- a/trunk/drivers/net/skge.c +++ b/trunk/drivers/net/skge.c @@ -24,6 +24,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -3341,7 +3342,7 @@ static int __devinit skge_probe(struct pci_dev *pdev, goto err_out_free_hw; } - err = request_irq(pdev->irq, skge_intr, IRQF_SHARED, DRV_NAME, hw); + err = request_irq(pdev->irq, skge_intr, SA_SHIRQ, DRV_NAME, hw); if (err) { printk(KERN_ERR PFX "%s: cannot assign irq %d\n", pci_name(pdev), pdev->irq); diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c index 418f169a6a31..e122007e16da 100644 --- a/trunk/drivers/net/sky2.c +++ b/trunk/drivers/net/sky2.c @@ -23,6 +23,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -3188,7 +3189,7 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw) sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW); - err = request_irq(pdev->irq, sky2_test_intr, IRQF_SHARED, DRV_NAME, hw); + err = request_irq(pdev->irq, sky2_test_intr, SA_SHIRQ, DRV_NAME, hw); if (err) { printk(KERN_ERR PFX "%s: cannot assign irq %d\n", pci_name(pdev), pdev->irq); @@ -3348,7 +3349,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev, goto err_out_unregister; } - err = request_irq(pdev->irq, sky2_intr, IRQF_SHARED, DRV_NAME, hw); + err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw); if (err) { printk(KERN_ERR PFX "%s: cannot assign irq %d\n", pci_name(pdev), pdev->irq); diff --git a/trunk/drivers/net/slhc.c b/trunk/drivers/net/slhc.c index 3a1b7131681c..c6fbb1ede0ed 100644 --- a/trunk/drivers/net/slhc.c +++ b/trunk/drivers/net/slhc.c @@ -50,6 +50,7 @@ * driver code belonging close to PPP and SLIP */ +#include #include #include #include diff --git a/trunk/drivers/net/slip.c b/trunk/drivers/net/slip.c index 1588cb7f6c83..b2e18d28850d 100644 --- a/trunk/drivers/net/slip.c +++ b/trunk/drivers/net/slip.c @@ -55,6 +55,7 @@ */ #define SL_CHECK_TRANSMIT +#include #include #include diff --git a/trunk/drivers/net/slip.h b/trunk/drivers/net/slip.h index 29d87dd45a24..ab3efe66a642 100644 --- a/trunk/drivers/net/slip.h +++ b/trunk/drivers/net/slip.h @@ -22,6 +22,7 @@ #ifndef _LINUX_SLIP_H #define _LINUX_SLIP_H +#include #if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED) # define SL_INCLUDE_CSLIP diff --git a/trunk/drivers/net/smc-ultra.c b/trunk/drivers/net/smc-ultra.c index 45449353a958..5b4e8529d4ab 100644 --- a/trunk/drivers/net/smc-ultra.c +++ b/trunk/drivers/net/smc-ultra.c @@ -57,6 +57,7 @@ static const char version[] = "smc-ultra.c:v2.02 2/3/98 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n"; +#include #include #include #include diff --git a/trunk/drivers/net/smc-ultra32.c b/trunk/drivers/net/smc-ultra32.c index 85be22a05973..ff9bd97746dc 100644 --- a/trunk/drivers/net/smc-ultra32.c +++ b/trunk/drivers/net/smc-ultra32.c @@ -290,7 +290,7 @@ static int __init ultra32_probe1(struct net_device *dev, int ioaddr) static int ultra32_open(struct net_device *dev) { int ioaddr = dev->base_addr - ULTRA32_NIC_OFFSET; /* ASIC addr */ - int irq_flags = (inb(ioaddr + ULTRA32_CFG5) & 0x08) ? 0 : IRQF_SHARED; + int irq_flags = (inb(ioaddr + ULTRA32_CFG5) & 0x08) ? 0 : SA_SHIRQ; int retval; retval = request_irq(dev->irq, ei_interrupt, irq_flags, dev->name, dev); diff --git a/trunk/drivers/net/smc911x.c b/trunk/drivers/net/smc911x.c index d37bd860b336..bdd8702ead54 100644 --- a/trunk/drivers/net/smc911x.c +++ b/trunk/drivers/net/smc911x.c @@ -2081,7 +2081,7 @@ static int __init smc911x_probe(struct net_device *dev, unsigned long ioaddr) lp->ctl_rspeed = 100; /* Grab the IRQ */ - retval = request_irq(dev->irq, &smc911x_interrupt, IRQF_SHARED, dev->name, dev); + retval = request_irq(dev->irq, &smc911x_interrupt, SA_SHIRQ, dev->name, dev); if (retval) goto err_out; diff --git a/trunk/drivers/net/smc91x.c b/trunk/drivers/net/smc91x.c index 3d8dcb6c8758..0e9833adf9fe 100644 --- a/trunk/drivers/net/smc91x.c +++ b/trunk/drivers/net/smc91x.c @@ -66,6 +66,7 @@ static const char version[] = #endif +#include #include #include #include diff --git a/trunk/drivers/net/smc91x.h b/trunk/drivers/net/smc91x.h index b4028049ed76..bf776125ca38 100644 --- a/trunk/drivers/net/smc91x.h +++ b/trunk/drivers/net/smc91x.h @@ -207,7 +207,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) machine_is_omap_h2() \ || machine_is_omap_h3() \ || (machine_is_omap_innovator() && !cpu_is_omap1510()) \ - ) ? IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING) + ) ? SA_TRIGGER_FALLING : SA_TRIGGER_RISING) #elif defined(CONFIG_SH_SH4202_MICRODEV) @@ -540,7 +540,7 @@ smc_pxa_dma_irq(int dma, void *dummy, struct pt_regs *regs) #endif #ifndef SMC_IRQ_FLAGS -#define SMC_IRQ_FLAGS IRQF_TRIGGER_RISING +#define SMC_IRQ_FLAGS SA_TRIGGER_RISING #endif #ifndef SMC_INTERRUPT_PREAMBLE diff --git a/trunk/drivers/net/sonic.h b/trunk/drivers/net/sonic.h index 7f5c4ebcc17a..cede969a8baa 100644 --- a/trunk/drivers/net/sonic.h +++ b/trunk/drivers/net/sonic.h @@ -22,6 +22,7 @@ #ifndef SONIC_H #define SONIC_H +#include /* * SONIC register offsets diff --git a/trunk/drivers/net/spider_net.c b/trunk/drivers/net/spider_net.c index fb1d5a8a45cf..394339d5e87c 100644 --- a/trunk/drivers/net/spider_net.c +++ b/trunk/drivers/net/spider_net.c @@ -21,6 +21,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -1744,7 +1745,7 @@ spider_net_open(struct net_device *netdev) result = -EBUSY; if (request_irq(netdev->irq, spider_net_interrupt, - IRQF_SHARED, netdev->name, netdev)) + SA_SHIRQ, netdev->name, netdev)) goto register_int_failed; spider_net_enable_card(card); diff --git a/trunk/drivers/net/starfire.c b/trunk/drivers/net/starfire.c index ed1f59901ff4..c158eedc7813 100644 --- a/trunk/drivers/net/starfire.c +++ b/trunk/drivers/net/starfire.c @@ -146,6 +146,7 @@ TODO: - fix forced speed/duplexing code (broken a long time ago, when #define DRV_VERSION "1.03+LK1.4.2.1" #define DRV_RELDATE "October 3, 2005" +#include #include #include #include @@ -1070,7 +1071,7 @@ static int netdev_open(struct net_device *dev) /* Do we ever need to reset the chip??? */ - retval = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev); + retval = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev); if (retval) return retval; diff --git a/trunk/drivers/net/stnic.c b/trunk/drivers/net/stnic.c index 74228348995d..b6dfdf8f44da 100644 --- a/trunk/drivers/net/stnic.c +++ b/trunk/drivers/net/stnic.c @@ -7,6 +7,7 @@ * Copyright (C) 1999 kaz Kojima */ +#include #include #include #include diff --git a/trunk/drivers/net/sun3lance.c b/trunk/drivers/net/sun3lance.c index 2dcadb169a22..a2fad50437e6 100644 --- a/trunk/drivers/net/sun3lance.c +++ b/trunk/drivers/net/sun3lance.c @@ -341,7 +341,7 @@ static int __init lance_probe( struct net_device *dev) REGA(CSR0) = CSR0_STOP; - request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev); + request_irq(LANCE_IRQ, lance_interrupt, SA_INTERRUPT, "SUN3 Lance", dev); dev->irq = (unsigned short)LANCE_IRQ; diff --git a/trunk/drivers/net/sunbmac.c b/trunk/drivers/net/sunbmac.c index d46891510767..7127f0f36f0e 100644 --- a/trunk/drivers/net/sunbmac.c +++ b/trunk/drivers/net/sunbmac.c @@ -918,7 +918,7 @@ static int bigmac_open(struct net_device *dev) struct bigmac *bp = (struct bigmac *) dev->priv; int ret; - ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp); + ret = request_irq(dev->irq, &bigmac_interrupt, SA_SHIRQ, dev->name, bp); if (ret) { printk(KERN_ERR "BIGMAC: Can't order irq %d to go.\n", dev->irq); return ret; diff --git a/trunk/drivers/net/sundance.c b/trunk/drivers/net/sundance.c index 643fceae3db5..f13b2a195c70 100644 --- a/trunk/drivers/net/sundance.c +++ b/trunk/drivers/net/sundance.c @@ -870,7 +870,7 @@ static int netdev_open(struct net_device *dev) /* Do we need to reset the chip??? */ - i = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev); + i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev); if (i) return i; diff --git a/trunk/drivers/net/sungem.c b/trunk/drivers/net/sungem.c index b70bbd748978..5248670d29f7 100644 --- a/trunk/drivers/net/sungem.c +++ b/trunk/drivers/net/sungem.c @@ -2220,7 +2220,7 @@ static int gem_do_start(struct net_device *dev) spin_unlock_irqrestore(&gp->lock, flags); if (request_irq(gp->pdev->irq, gem_interrupt, - IRQF_SHARED, dev->name, (void *)dev)) { + SA_SHIRQ, dev->name, (void *)dev)) { printk(KERN_ERR "%s: failed to request irq !\n", gp->dev->name); spin_lock_irqsave(&gp->lock, flags); diff --git a/trunk/drivers/net/sungem_phy.c b/trunk/drivers/net/sungem_phy.c index 278c7cb22216..9282b4b0c022 100644 --- a/trunk/drivers/net/sungem_phy.c +++ b/trunk/drivers/net/sungem_phy.c @@ -19,6 +19,7 @@ * of darwin, still need to reverse engineer that */ +#include #include diff --git a/trunk/drivers/net/sunhme.c b/trunk/drivers/net/sunhme.c index 8673fd4c08c7..9b246e44f756 100644 --- a/trunk/drivers/net/sunhme.c +++ b/trunk/drivers/net/sunhme.c @@ -13,6 +13,7 @@ * argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50 */ +#include #include #include #include @@ -2194,7 +2195,7 @@ static int happy_meal_open(struct net_device *dev) */ if ((hp->happy_flags & (HFLAG_QUATTRO|HFLAG_PCI)) != HFLAG_QUATTRO) { if (request_irq(dev->irq, &happy_meal_interrupt, - IRQF_SHARED, dev->name, (void *)dev)) { + SA_SHIRQ, dev->name, (void *)dev)) { HMD(("EAGAIN\n")); printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n", dev->irq); @@ -2608,7 +2609,7 @@ static void __init quattro_sbus_register_irqs(void) err = request_irq(sdev->irqs[0], quattro_sbus_interrupt, - IRQF_SHARED, "Quattro", + SA_SHIRQ, "Quattro", qp); if (err != 0) { printk(KERN_ERR "Quattro: Fatal IRQ registery error %d.\n", err); diff --git a/trunk/drivers/net/sunhme.h b/trunk/drivers/net/sunhme.h index 90f446db9ba2..9b7ccaeeee89 100644 --- a/trunk/drivers/net/sunhme.h +++ b/trunk/drivers/net/sunhme.h @@ -8,6 +8,7 @@ #ifndef _SUNHME_H #define _SUNHME_H +#include #include /* Happy Meal global registers. */ diff --git a/trunk/drivers/net/sunlance.c b/trunk/drivers/net/sunlance.c index 1ef9fd39a79a..2c239ab63a80 100644 --- a/trunk/drivers/net/sunlance.c +++ b/trunk/drivers/net/sunlance.c @@ -71,6 +71,7 @@ static char lancestr[] = "LANCE"; +#include #include #include #include @@ -930,7 +931,7 @@ static int lance_open(struct net_device *dev) STOP_LANCE(lp); - if (request_irq(dev->irq, &lance_interrupt, IRQF_SHARED, + if (request_irq(dev->irq, &lance_interrupt, SA_SHIRQ, lancestr, (void *) dev)) { printk(KERN_ERR "Lance: Can't get irq %d\n", dev->irq); return -EAGAIN; diff --git a/trunk/drivers/net/sunqe.c b/trunk/drivers/net/sunqe.c index 817a40b66638..9da6d5b87173 100644 --- a/trunk/drivers/net/sunqe.c +++ b/trunk/drivers/net/sunqe.c @@ -811,7 +811,7 @@ static struct sunqec * __init get_qec(struct sbus_dev *child_sdev) qec_init_once(qecp, qec_sdev); if (request_irq(qec_sdev->irqs[0], &qec_interrupt, - IRQF_SHARED, "qec", (void *) qecp)) { + SA_SHIRQ, "qec", (void *) qecp)) { printk(KERN_ERR "qec: Can't register irq.\n"); goto fail; } diff --git a/trunk/drivers/net/tc35815.c b/trunk/drivers/net/tc35815.c index 8b53ded66d37..c2ec9fd8c31d 100644 --- a/trunk/drivers/net/tc35815.c +++ b/trunk/drivers/net/tc35815.c @@ -880,7 +880,7 @@ tc35815_open(struct net_device *dev) */ if (dev->irq == 0 || - request_irq(dev->irq, &tc35815_interrupt, IRQF_SHARED, cardname, dev)) { + request_irq(dev->irq, &tc35815_interrupt, SA_SHIRQ, cardname, dev)) { return -EAGAIN; } diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index f645921aff8b..35f931638750 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -15,6 +15,7 @@ * notice is accompanying it. */ +#include #include #include @@ -68,8 +69,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.62" -#define DRV_MODULE_RELDATE "June 30, 2006" +#define DRV_MODULE_VERSION "3.60" +#define DRV_MODULE_RELDATE "June 17, 2006" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -3194,7 +3195,7 @@ static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag) */ static int tg3_rx(struct tg3 *tp, int budget) { - u32 work_mask, rx_std_posted = 0; + u32 work_mask; u32 sw_idx = tp->rx_rcb_ptr; u16 hw_idx; int received; @@ -3221,7 +3222,6 @@ static int tg3_rx(struct tg3 *tp, int budget) mapping); skb = tp->rx_std_buffers[desc_idx].skb; post_ptr = &tp->rx_std_ptr; - rx_std_posted++; } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) { dma_addr = pci_unmap_addr(&tp->rx_jumbo_buffers[desc_idx], mapping); @@ -3309,15 +3309,6 @@ static int tg3_rx(struct tg3 *tp, int budget) next_pkt: (*post_ptr)++; - - if (unlikely(rx_std_posted >= tp->rx_std_max_post)) { - u32 idx = *post_ptr % TG3_RX_RING_SIZE; - - tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + - TG3_64BIT_REG_LOW, idx); - work_mask &= ~RXD_OPAQUE_RING_STD; - rx_std_posted = 0; - } next_pkt_nopost: sw_idx++; sw_idx %= TG3_RX_RCB_RING_SIZE(tp); @@ -3798,24 +3789,18 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) goto out_unlock; } - if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) - mss |= (skb_headlen(skb) - ETH_HLEN) << 9; - else { - tcp_opt_len = ((skb->h.th->doff - 5) * 4); - ip_tcp_len = (skb->nh.iph->ihl * 4) + - sizeof(struct tcphdr); - - skb->nh.iph->check = 0; - skb->nh.iph->tot_len = htons(mss + ip_tcp_len + - tcp_opt_len); - mss |= (ip_tcp_len + tcp_opt_len) << 9; - } + tcp_opt_len = ((skb->h.th->doff - 5) * 4); + ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr); base_flags |= (TXD_FLAG_CPU_PRE_DMA | TXD_FLAG_CPU_POST_DMA); + skb->nh.iph->check = 0; + skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); + skb->h.th->check = 0; + mss |= (ip_tcp_len + tcp_opt_len) << 9; } else if (skb->ip_summed == CHECKSUM_HW) base_flags |= TXD_FLAG_TCPUDP_CSUM; @@ -3885,40 +3870,6 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) return NETDEV_TX_OK; } -#if TG3_TSO_SUPPORT != 0 -static int tg3_start_xmit_dma_bug(struct sk_buff *, struct net_device *); - -/* Use GSO to workaround a rare TSO bug that may be triggered when the - * TSO header is greater than 80 bytes. - */ -static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb) -{ - struct sk_buff *segs, *nskb; - - /* Estimate the number of fragments in the worst case */ - if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->gso_segs * 3))) { - netif_stop_queue(tp->dev); - return NETDEV_TX_BUSY; - } - - segs = skb_gso_segment(skb, tp->dev->features & ~NETIF_F_TSO); - if (unlikely(IS_ERR(segs))) - goto tg3_tso_bug_end; - - do { - nskb = segs; - segs = segs->next; - nskb->next = NULL; - tg3_start_xmit_dma_bug(nskb, tp->dev); - } while (segs); - -tg3_tso_bug_end: - dev_kfree_skb(skb); - - return NETDEV_TX_OK; -} -#endif - /* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and * support TG3_FLG2_HW_TSO_1 or firmware TSO only. */ @@ -3955,7 +3906,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) mss = 0; if (skb->len > (tp->dev->mtu + ETH_HLEN) && (mss = skb_shinfo(skb)->gso_size) != 0) { - int tcp_opt_len, ip_tcp_len, hdr_len; + int tcp_opt_len, ip_tcp_len; if (skb_header_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { @@ -3966,16 +3917,11 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) tcp_opt_len = ((skb->h.th->doff - 5) * 4); ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr); - hdr_len = ip_tcp_len + tcp_opt_len; - if (unlikely((ETH_HLEN + hdr_len) > 80) && - (tp->tg3_flags2 & TG3_FLG2_HW_TSO_1_BUG)) - return (tg3_tso_bug(tp, skb)); - base_flags |= (TXD_FLAG_CPU_PRE_DMA | TXD_FLAG_CPU_POST_DMA); skb->nh.iph->check = 0; - skb->nh.iph->tot_len = htons(mss + hdr_len); + skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { skb->h.th->check = 0; base_flags &= ~TXD_FLAG_TCPUDP_CSUM; @@ -6035,13 +5981,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) } /* Setup replenish threshold. */ - val = tp->rx_pending / 8; - if (val == 0) - val = 1; - else if (val > tp->rx_std_max_post) - val = tp->rx_std_max_post; - - tw32(RCVBDI_STD_THRESH, val); + tw32(RCVBDI_STD_THRESH, tp->rx_pending / 8); /* Initialize TG3_BDINFO's at: * RCVDBDI_STD_BD: standard eth size rx ring @@ -6201,12 +6141,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) #endif /* Receive/send statistics. */ - if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) { - val = tr32(RCVLPC_STATS_ENABLE); - val &= ~RCVLPC_STATSENAB_DACK_FIX; - tw32(RCVLPC_STATS_ENABLE, val); - } else if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) && - (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) { + if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) && + (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) { val = tr32(RCVLPC_STATS_ENABLE); val &= ~RCVLPC_STATSENAB_LNGBRST_RFIX; tw32(RCVLPC_STATS_ENABLE, val); @@ -6708,12 +6644,12 @@ static int tg3_request_irq(struct tg3 *tp) fn = tg3_msi; if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) fn = tg3_msi_1shot; - flags = IRQF_SAMPLE_RANDOM; + flags = SA_SAMPLE_RANDOM; } else { fn = tg3_interrupt; if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) fn = tg3_interrupt_tagged; - flags = IRQF_SHARED | IRQF_SAMPLE_RANDOM; + flags = SA_SHIRQ | SA_SAMPLE_RANDOM; } return (request_irq(tp->pdev->irq, fn, flags, dev->name, dev)); } @@ -6732,7 +6668,7 @@ static int tg3_test_interrupt(struct tg3 *tp) free_irq(tp->pdev->irq, dev); err = request_irq(tp->pdev->irq, tg3_test_isr, - IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); + SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); if (err) return err; @@ -7893,12 +7829,6 @@ static int tg3_set_tso(struct net_device *dev, u32 value) return -EINVAL; return 0; } - if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) { - if (value) - dev->features |= NETIF_F_TSO6; - else - dev->features &= ~NETIF_F_TSO6; - } return ethtool_op_set_tso(dev, value); } #endif @@ -8808,9 +8738,6 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) { struct tg3 *tp = netdev_priv(dev); - if (netif_running(dev)) - tg3_netif_stop(tp); - tg3_full_lock(tp, 0); tp->vlgrp = grp; @@ -8819,25 +8746,16 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) __tg3_set_rx_mode(dev); tg3_full_unlock(tp); - - if (netif_running(dev)) - tg3_netif_start(tp); } static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) { struct tg3 *tp = netdev_priv(dev); - if (netif_running(dev)) - tg3_netif_stop(tp); - tg3_full_lock(tp, 0); if (tp->vlgrp) tp->vlgrp->vlan_devices[vid] = NULL; tg3_full_unlock(tp); - - if (netif_running(dev)) - tg3_netif_start(tp); } #endif @@ -10242,14 +10160,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) { tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2; tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI; - } else { - tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1 | - TG3_FLG2_HW_TSO_1_BUG; - if (GET_ASIC_REV(tp->pci_chip_rev_id) == - ASIC_REV_5750 && - tp->pci_chip_rev_id >= CHIPREV_ID_5750_C2) - tp->tg3_flags2 &= ~TG3_FLG2_HW_TSO_1_BUG; - } + } else + tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1; } if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 && @@ -10621,16 +10533,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) tp->rx_offset = 0; - tp->rx_std_max_post = TG3_RX_RING_SIZE; - - /* Increment the rx prod index on the rx std ring by at most - * 8 for these chips to workaround hw errata. - */ - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 || - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 || - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) - tp->rx_std_max_post = 8; - /* By default, disable wake-on-lan. User can change this * using ETHTOOL_SWOL. */ @@ -11519,11 +11421,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, * Firmware TSO on older chips gives lower performance, so it * is off by default, but can be enabled using ethtool. */ - if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) dev->features |= NETIF_F_TSO; - if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) - dev->features |= NETIF_F_TSO6; - } #endif diff --git a/trunk/drivers/net/tg3.h b/trunk/drivers/net/tg3.h index ba2c98711c88..8209da5dd15f 100644 --- a/trunk/drivers/net/tg3.h +++ b/trunk/drivers/net/tg3.h @@ -125,7 +125,6 @@ #define CHIPREV_ID_5750_A0 0x4000 #define CHIPREV_ID_5750_A1 0x4001 #define CHIPREV_ID_5750_A3 0x4003 -#define CHIPREV_ID_5750_C2 0x4202 #define CHIPREV_ID_5752_A0_HW 0x5000 #define CHIPREV_ID_5752_A0 0x6000 #define CHIPREV_ID_5752_A1 0x6001 @@ -761,7 +760,6 @@ #define RCVLPC_STATSCTRL_ENABLE 0x00000001 #define RCVLPC_STATSCTRL_FASTUPD 0x00000002 #define RCVLPC_STATS_ENABLE 0x00002018 -#define RCVLPC_STATSENAB_DACK_FIX 0x00040000 #define RCVLPC_STATSENAB_LNGBRST_RFIX 0x00400000 #define RCVLPC_STATS_INCMASK 0x0000201c /* 0x2020 --> 0x2100 unused */ @@ -2139,7 +2137,6 @@ struct tg3 { struct tg3_rx_buffer_desc *rx_std; struct ring_info *rx_std_buffers; dma_addr_t rx_std_mapping; - u32 rx_std_max_post; struct tg3_rx_buffer_desc *rx_jumbo; struct ring_info *rx_jumbo_buffers; @@ -2194,7 +2191,7 @@ struct tg3 { #define TG3_FLAG_INIT_COMPLETE 0x80000000 u32 tg3_flags2; #define TG3_FLG2_RESTART_TIMER 0x00000001 -#define TG3_FLG2_HW_TSO_1_BUG 0x00000002 +/* 0x00000002 available */ #define TG3_FLG2_NO_ETH_WIRE_SPEED 0x00000004 #define TG3_FLG2_IS_5788 0x00000008 #define TG3_FLG2_MAX_RXPEND_64 0x00000010 diff --git a/trunk/drivers/net/tlan.c b/trunk/drivers/net/tlan.c index 23c0017f25a9..12076f8f942c 100644 --- a/trunk/drivers/net/tlan.c +++ b/trunk/drivers/net/tlan.c @@ -943,7 +943,7 @@ static int TLan_Open( struct net_device *dev ) int err; priv->tlanRev = TLan_DioRead8( dev->base_addr, TLAN_DEF_REVISION ); - err = request_irq( dev->irq, TLan_HandleInterrupt, IRQF_SHARED, TLanSignature, dev ); + err = request_irq( dev->irq, TLan_HandleInterrupt, SA_SHIRQ, TLanSignature, dev ); if ( err ) { printk(KERN_ERR "TLAN: Cannot open %s because IRQ %d is already in use.\n", dev->name, dev->irq ); diff --git a/trunk/drivers/net/tokenring/3c359.c b/trunk/drivers/net/tokenring/3c359.c index 465921e3874c..41e0cd8f4786 100644 --- a/trunk/drivers/net/tokenring/3c359.c +++ b/trunk/drivers/net/tokenring/3c359.c @@ -42,6 +42,7 @@ #define XL_DEBUG 0 +#include #include #include #include @@ -576,7 +577,7 @@ static int xl_open(struct net_device *dev) u16 switchsettings, switchsettings_eeprom ; - if(request_irq(dev->irq, &xl_interrupt, IRQF_SHARED , "3c359", dev)) { + if(request_irq(dev->irq, &xl_interrupt, SA_SHIRQ , "3c359", dev)) { return -EAGAIN; } diff --git a/trunk/drivers/net/tokenring/abyss.c b/trunk/drivers/net/tokenring/abyss.c index 1bdd3beefbe5..649d8ea354f5 100644 --- a/trunk/drivers/net/tokenring/abyss.c +++ b/trunk/drivers/net/tokenring/abyss.c @@ -123,7 +123,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_ goto err_out_trdev; } - ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED, + ret = request_irq(pdev->irq, tms380tr_interrupt, SA_SHIRQ, dev->name, dev); if (ret) goto err_out_region; diff --git a/trunk/drivers/net/tokenring/lanstreamer.c b/trunk/drivers/net/tokenring/lanstreamer.c index 28d968ffd5d0..c58a4c31d0dd 100644 --- a/trunk/drivers/net/tokenring/lanstreamer.c +++ b/trunk/drivers/net/tokenring/lanstreamer.c @@ -100,6 +100,7 @@ #define STREAMER_IOCTL 0 +#include #include #include #include @@ -601,7 +602,7 @@ static int streamer_open(struct net_device *dev) rc=streamer_reset(dev); } - if (request_irq(dev->irq, &streamer_interrupt, IRQF_SHARED, "lanstreamer", dev)) { + if (request_irq(dev->irq, &streamer_interrupt, SA_SHIRQ, "lanstreamer", dev)) { return -EAGAIN; } #if STREAMER_DEBUG diff --git a/trunk/drivers/net/tokenring/madgemc.c b/trunk/drivers/net/tokenring/madgemc.c index 666bbaaae82f..19e6f4dfd69c 100644 --- a/trunk/drivers/net/tokenring/madgemc.c +++ b/trunk/drivers/net/tokenring/madgemc.c @@ -311,7 +311,7 @@ static int __devinit madgemc_probe(struct device *device) */ outb(0, dev->base_addr + MC_CONTROL_REG0); /* sanity */ madgemc_setsifsel(dev, 1); - if (request_irq(dev->irq, madgemc_interrupt, IRQF_SHARED, + if (request_irq(dev->irq, madgemc_interrupt, SA_SHIRQ, "madgemc", dev)) { ret = -EBUSY; goto getout3; diff --git a/trunk/drivers/net/tokenring/olympic.c b/trunk/drivers/net/tokenring/olympic.c index 85831484bc40..c3cb8d26cfe3 100644 --- a/trunk/drivers/net/tokenring/olympic.c +++ b/trunk/drivers/net/tokenring/olympic.c @@ -80,6 +80,7 @@ #define OLYMPIC_DEBUG 0 +#include #include #include #include @@ -445,7 +446,7 @@ static int olympic_open(struct net_device *dev) olympic_init(dev); - if(request_irq(dev->irq, &olympic_interrupt, IRQF_SHARED , "olympic", dev)) { + if(request_irq(dev->irq, &olympic_interrupt, SA_SHIRQ , "olympic", dev)) { return -EAGAIN; } diff --git a/trunk/drivers/net/tokenring/smctr.c b/trunk/drivers/net/tokenring/smctr.c index cd2e0251e2bc..67d2b596ce22 100644 --- a/trunk/drivers/net/tokenring/smctr.c +++ b/trunk/drivers/net/tokenring/smctr.c @@ -29,6 +29,7 @@ */ #include +#include #include #include #include @@ -531,7 +532,7 @@ static int __init smctr_chk_mca(struct net_device *dev) dev->irq = 15; break; } - if (request_irq(dev->irq, smctr_interrupt, IRQF_SHARED, smctr_name, dev)) { + if (request_irq(dev->irq, smctr_interrupt, SA_SHIRQ, smctr_name, dev)) { release_region(dev->base_addr, SMCTR_IO_EXTENT); return -ENODEV; } @@ -1061,7 +1062,7 @@ static int __init smctr_chk_isa(struct net_device *dev) goto out2; } - if (request_irq(dev->irq, smctr_interrupt, IRQF_SHARED, smctr_name, dev)) + if (request_irq(dev->irq, smctr_interrupt, SA_SHIRQ, smctr_name, dev)) goto out2; /* Get 58x Rom Base */ diff --git a/trunk/drivers/net/tokenring/smctr_firmware.h b/trunk/drivers/net/tokenring/smctr_firmware.h index 292e50ddf01a..48994b043b7c 100644 --- a/trunk/drivers/net/tokenring/smctr_firmware.h +++ b/trunk/drivers/net/tokenring/smctr_firmware.h @@ -17,6 +17,7 @@ * - Jay Schulist */ +#include #if defined(CONFIG_SMCTR) || defined(CONFIG_SMCTR_MODULE) diff --git a/trunk/drivers/net/tokenring/tmspci.c b/trunk/drivers/net/tokenring/tmspci.c index 7d3e270c4f45..ab47c0547a3b 100644 --- a/trunk/drivers/net/tokenring/tmspci.c +++ b/trunk/drivers/net/tokenring/tmspci.c @@ -122,7 +122,7 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic goto err_out_trdev; } - ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED, + ret = request_irq(pdev->irq, tms380tr_interrupt, SA_SHIRQ, dev->name, dev); if (ret) goto err_out_region; diff --git a/trunk/drivers/net/tulip/de2104x.c b/trunk/drivers/net/tulip/de2104x.c index d05c5aa254ee..fc2468ecce0b 100644 --- a/trunk/drivers/net/tulip/de2104x.c +++ b/trunk/drivers/net/tulip/de2104x.c @@ -31,6 +31,7 @@ #define DRV_VERSION "0.7" #define DRV_RELDATE "Mar 17, 2004" +#include #include #include #include @@ -1371,7 +1372,7 @@ static int de_open (struct net_device *dev) dw32(IntrMask, 0); - rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev); + rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); if (rc) { printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", dev->name, dev->irq, rc); diff --git a/trunk/drivers/net/tulip/de4x5.c b/trunk/drivers/net/tulip/de4x5.c index 75ff14a55239..da8bd0d62a3f 100644 --- a/trunk/drivers/net/tulip/de4x5.c +++ b/trunk/drivers/net/tulip/de4x5.c @@ -292,7 +292,7 @@ 0.41 21-Mar-96 Don't check for get_hw_addr checksum unless DEC card only Fix for multiple PCI cards reported by - Duh, put the IRQF_SHARED flag into request_interrupt(). + Duh, put the SA_SHIRQ flag into request_interrupt(). Fix SMC ethernet address in enet_det[]. Print chip name instead of "UNKNOWN" during boot. 0.42 26-Apr-96 Fix MII write TA bit error. @@ -353,7 +353,7 @@ infoblocks. Added DC21142 and DC21143 functions. Added byte counters from - Added IRQF_DISABLED temporary fix from + Added SA_INTERRUPT temporary fix from . 0.53 12-Nov-97 Fix the *_probe() to include 'eth??' name during module load: bug reported by @@ -443,6 +443,7 @@ ========================================================================= */ +#include #include #include #include @@ -1319,10 +1320,10 @@ de4x5_open(struct net_device *dev) lp->state = OPEN; de4x5_dbg_open(dev); - if (request_irq(dev->irq, (void *)de4x5_interrupt, IRQF_SHARED, + if (request_irq(dev->irq, (void *)de4x5_interrupt, SA_SHIRQ, lp->adapter_name, dev)) { printk("de4x5_open(): Requested IRQ%d is busy - attemping FAST/SHARE...", dev->irq); - if (request_irq(dev->irq, de4x5_interrupt, IRQF_DISABLED | IRQF_SHARED, + if (request_irq(dev->irq, de4x5_interrupt, SA_INTERRUPT | SA_SHIRQ, lp->adapter_name, dev)) { printk("\n Cannot get IRQ- reconfigure your hardware.\n"); disable_ast(dev); diff --git a/trunk/drivers/net/tulip/dmfe.c b/trunk/drivers/net/tulip/dmfe.c index 4e5b0f2acc39..ba5b112093f4 100644 --- a/trunk/drivers/net/tulip/dmfe.c +++ b/trunk/drivers/net/tulip/dmfe.c @@ -506,7 +506,7 @@ static int dmfe_open(struct DEVICE *dev) DMFE_DBUG(0, "dmfe_open", 0); - ret = request_irq(dev->irq, &dmfe_interrupt, IRQF_SHARED, dev->name, dev); + ret = request_irq(dev->irq, &dmfe_interrupt, SA_SHIRQ, dev->name, dev); if (ret) return ret; diff --git a/trunk/drivers/net/tulip/interrupt.c b/trunk/drivers/net/tulip/interrupt.c index 99ccf2ebb342..da4f7593c50f 100644 --- a/trunk/drivers/net/tulip/interrupt.c +++ b/trunk/drivers/net/tulip/interrupt.c @@ -16,6 +16,7 @@ #include #include "tulip.h" +#include #include int tulip_rx_copybreak; diff --git a/trunk/drivers/net/tulip/tulip.h b/trunk/drivers/net/tulip/tulip.h index 3bcfbf3d23ed..d25020da6798 100644 --- a/trunk/drivers/net/tulip/tulip.h +++ b/trunk/drivers/net/tulip/tulip.h @@ -16,6 +16,7 @@ #ifndef __NET_TULIP_H__ #define __NET_TULIP_H__ +#include #include #include #include diff --git a/trunk/drivers/net/tulip/tulip_core.c b/trunk/drivers/net/tulip/tulip_core.c index 7351831f57ce..53fd9b56d0bd 100644 --- a/trunk/drivers/net/tulip/tulip_core.c +++ b/trunk/drivers/net/tulip/tulip_core.c @@ -14,6 +14,7 @@ */ +#include #define DRV_NAME "tulip" #ifdef CONFIG_TULIP_NAPI @@ -489,7 +490,7 @@ tulip_open(struct net_device *dev) { int retval; - if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) + if ((retval = request_irq(dev->irq, &tulip_interrupt, SA_SHIRQ, dev->name, dev))) return retval; tulip_init_ring (dev); @@ -1770,7 +1771,7 @@ static int tulip_resume(struct pci_dev *pdev) pci_enable_device(pdev); - if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) { + if ((retval = request_irq(dev->irq, &tulip_interrupt, SA_SHIRQ, dev->name, dev))) { printk (KERN_ERR "tulip: request_irq failed in resume\n"); return retval; } diff --git a/trunk/drivers/net/tulip/uli526x.c b/trunk/drivers/net/tulip/uli526x.c index fd64b2b3e99c..8b3a28f53c3d 100644 --- a/trunk/drivers/net/tulip/uli526x.c +++ b/trunk/drivers/net/tulip/uli526x.c @@ -436,7 +436,7 @@ static int uli526x_open(struct net_device *dev) ULI526X_DBUG(0, "uli526x_open", 0); - ret = request_irq(dev->irq, &uli526x_interrupt, IRQF_SHARED, dev->name, dev); + ret = request_irq(dev->irq, &uli526x_interrupt, SA_SHIRQ, dev->name, dev); if (ret) return ret; diff --git a/trunk/drivers/net/tulip/winbond-840.c b/trunk/drivers/net/tulip/winbond-840.c index b4c0d101a7d7..602a6e5002a0 100644 --- a/trunk/drivers/net/tulip/winbond-840.c +++ b/trunk/drivers/net/tulip/winbond-840.c @@ -658,7 +658,7 @@ static int netdev_open(struct net_device *dev) iowrite32(0x00000001, ioaddr + PCIBusCfg); /* Reset */ netif_device_detach(dev); - i = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev); + i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev); if (i) goto out_err; diff --git a/trunk/drivers/net/tulip/xircom_cb.c b/trunk/drivers/net/tulip/xircom_cb.c index f874e4f6ccf6..63c2175ed138 100644 --- a/trunk/drivers/net/tulip/xircom_cb.c +++ b/trunk/drivers/net/tulip/xircom_cb.c @@ -457,7 +457,7 @@ static int xircom_open(struct net_device *dev) int retval; enter("xircom_open"); printk(KERN_INFO "xircom cardbus adaptor found, registering as %s, using irq %i \n",dev->name,dev->irq); - retval = request_irq(dev->irq, &xircom_interrupt, IRQF_SHARED, dev->name, dev); + retval = request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev); if (retval) { leave("xircom_open - No IRQ"); return retval; diff --git a/trunk/drivers/net/tulip/xircom_tulip_cb.c b/trunk/drivers/net/tulip/xircom_tulip_cb.c index 091ebb7a62f6..887d7245fe7b 100644 --- a/trunk/drivers/net/tulip/xircom_tulip_cb.c +++ b/trunk/drivers/net/tulip/xircom_tulip_cb.c @@ -98,6 +98,7 @@ static int csr0 = 0x00A00000 | 0x4800; /* PCI registers */ #define PCI_POWERMGMT 0x40 +#include #include #include #include @@ -807,7 +808,7 @@ xircom_open(struct net_device *dev) { struct xircom_private *tp = netdev_priv(dev); - if (request_irq(dev->irq, &xircom_interrupt, IRQF_SHARED, dev->name, dev)) + if (request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev)) return -EAGAIN; xircom_up(dev); diff --git a/trunk/drivers/net/tun.c b/trunk/drivers/net/tun.c index 329d9feb9b89..732c5edec2e5 100644 --- a/trunk/drivers/net/tun.c +++ b/trunk/drivers/net/tun.c @@ -39,6 +39,7 @@ #define DRV_DESCRIPTION "Universal TUN/TAP device driver" #define DRV_COPYRIGHT "(C) 1999-2004 Max Krasnyansky " +#include #include #include #include diff --git a/trunk/drivers/net/typhoon.c b/trunk/drivers/net/typhoon.c index 063816f2b11e..e24d2dafcf6c 100644 --- a/trunk/drivers/net/typhoon.c +++ b/trunk/drivers/net/typhoon.c @@ -2131,7 +2131,7 @@ typhoon_open(struct net_device *dev) goto out_sleep; } - err = request_irq(dev->irq, &typhoon_interrupt, IRQF_SHARED, + err = request_irq(dev->irq, &typhoon_interrupt, SA_SHIRQ, dev->name, dev); if(err < 0) goto out_sleep; diff --git a/trunk/drivers/net/via-rhine.c b/trunk/drivers/net/via-rhine.c index 98b6f3207d3d..c80a4f1d5f7a 100644 --- a/trunk/drivers/net/via-rhine.c +++ b/trunk/drivers/net/via-rhine.c @@ -1210,7 +1210,7 @@ static int rhine_open(struct net_device *dev) void __iomem *ioaddr = rp->base; int rc; - rc = request_irq(rp->pdev->irq, &rhine_interrupt, IRQF_SHARED, dev->name, + rc = request_irq(rp->pdev->irq, &rhine_interrupt, SA_SHIRQ, dev->name, dev); if (rc) return rc; @@ -1999,7 +1999,7 @@ static int rhine_resume(struct pci_dev *pdev) if (!netif_running(dev)) return 0; - if (request_irq(dev->irq, rhine_interrupt, IRQF_SHARED, dev->name, dev)) + if (request_irq(dev->irq, rhine_interrupt, SA_SHIRQ, dev->name, dev)) printk(KERN_ERR "via-rhine %s: request_irq failed\n", dev->name); ret = pci_set_power_state(pdev, PCI_D0); diff --git a/trunk/drivers/net/via-velocity.c b/trunk/drivers/net/via-velocity.c index ba2972ba3757..09e05fe40c38 100644 --- a/trunk/drivers/net/via-velocity.c +++ b/trunk/drivers/net/via-velocity.c @@ -47,6 +47,7 @@ #include #include +#include #include #include #include @@ -64,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -1750,7 +1752,7 @@ static int velocity_open(struct net_device *dev) velocity_init_registers(vptr, VELOCITY_INIT_COLD); - ret = request_irq(vptr->pdev->irq, &velocity_intr, IRQF_SHARED, + ret = request_irq(vptr->pdev->irq, &velocity_intr, SA_SHIRQ, dev->name, dev); if (ret < 0) { /* Power down the chip */ diff --git a/trunk/drivers/net/wan/cosa.c b/trunk/drivers/net/wan/cosa.c index 1f95b4864ea1..be5e33814cb1 100644 --- a/trunk/drivers/net/wan/cosa.c +++ b/trunk/drivers/net/wan/cosa.c @@ -79,6 +79,7 @@ /* ---------- Headers, macros, data structures ---------- */ +#include #include #include #include diff --git a/trunk/drivers/net/wan/dscc4.c b/trunk/drivers/net/wan/dscc4.c index 684af4316ffd..04a376ec0ed8 100644 --- a/trunk/drivers/net/wan/dscc4.c +++ b/trunk/drivers/net/wan/dscc4.c @@ -752,7 +752,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev, priv = pci_get_drvdata(pdev); - rc = request_irq(pdev->irq, dscc4_irq, IRQF_SHARED, DRV_NAME, priv->root); + rc = request_irq(pdev->irq, dscc4_irq, SA_SHIRQ, DRV_NAME, priv->root); if (rc < 0) { printk(KERN_WARNING "%s: IRQ %d busy\n", DRV_NAME, pdev->irq); goto err_release_4; diff --git a/trunk/drivers/net/wan/farsync.c b/trunk/drivers/net/wan/farsync.c index 3705db04a343..7981a2c7906e 100644 --- a/trunk/drivers/net/wan/farsync.c +++ b/trunk/drivers/net/wan/farsync.c @@ -2519,7 +2519,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) dbg(DBG_PCI, "kernel mem %p, ctlmem %p\n", card->mem, card->ctlmem); /* Register the interrupt handler */ - if (request_irq(pdev->irq, fst_intr, IRQF_SHARED, FST_DEV_NAME, card)) { + if (request_irq(pdev->irq, fst_intr, SA_SHIRQ, FST_DEV_NAME, card)) { printk_err("Unable to register interrupt %d\n", card->irq); pci_release_regions(pdev); pci_disable_device(pdev); diff --git a/trunk/drivers/net/wan/hdlc_generic.c b/trunk/drivers/net/wan/hdlc_generic.c index b7da55140fbd..57f9538b8fb5 100644 --- a/trunk/drivers/net/wan/hdlc_generic.c +++ b/trunk/drivers/net/wan/hdlc_generic.c @@ -22,6 +22,7 @@ * - proto.start() and stop() are called with spin_lock_irq held. */ +#include #include #include #include diff --git a/trunk/drivers/net/wan/hostess_sv11.c b/trunk/drivers/net/wan/hostess_sv11.c index a4f735723c41..cf5c805452a3 100644 --- a/trunk/drivers/net/wan/hostess_sv11.c +++ b/trunk/drivers/net/wan/hostess_sv11.c @@ -264,7 +264,7 @@ static struct sv11_device *sv11_init(int iobase, int irq) /* We want a fast IRQ for this device. Actually we'd like an even faster IRQ ;) - This is one driver RtLinux is made for */ - if(request_irq(irq, &z8530_interrupt, IRQF_DISABLED, "Hostess SV11", dev)<0) + if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "Hostess SV11", dev)<0) { printk(KERN_WARNING "hostess: IRQ %d already in use.\n", irq); goto fail1; diff --git a/trunk/drivers/net/wan/lmc/lmc_main.c b/trunk/drivers/net/wan/lmc/lmc_main.c index 39f44241a728..40926d779161 100644 --- a/trunk/drivers/net/wan/lmc/lmc_main.c +++ b/trunk/drivers/net/wan/lmc/lmc_main.c @@ -1058,7 +1058,7 @@ static int lmc_open (struct net_device *dev) /*fold00*/ lmc_softreset (sc); /* Since we have to use PCI bus, this should work on x86,alpha,ppc */ - if (request_irq (dev->irq, &lmc_interrupt, IRQF_SHARED, dev->name, dev)){ + if (request_irq (dev->irq, &lmc_interrupt, SA_SHIRQ, dev->name, dev)){ printk(KERN_WARNING "%s: could not get irq: %d\n", dev->name, dev->irq); lmc_trace(dev, "lmc_open irq failed out"); return -EAGAIN; diff --git a/trunk/drivers/net/wan/lmc/lmc_media.c b/trunk/drivers/net/wan/lmc/lmc_media.c index ae01555d24cf..af8b55fdd9d9 100644 --- a/trunk/drivers/net/wan/lmc/lmc_media.c +++ b/trunk/drivers/net/wan/lmc/lmc_media.c @@ -1,5 +1,6 @@ /* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/net/wan/pc300_drv.c b/trunk/drivers/net/wan/pc300_drv.c index 567effff4a3e..d7897ae89f90 100644 --- a/trunk/drivers/net/wan/pc300_drv.c +++ b/trunk/drivers/net/wan/pc300_drv.c @@ -3600,7 +3600,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } /* Allocate IRQ */ - if (request_irq(card->hw.irq, cpc_intr, IRQF_SHARED, "Cyclades-PC300", card)) { + if (request_irq(card->hw.irq, cpc_intr, SA_SHIRQ, "Cyclades-PC300", card)) { printk ("PC300 found at RAM 0x%08x, but could not allocate IRQ%d.\n", card->hw.ramphys, card->hw.irq); goto err_io_unmap; diff --git a/trunk/drivers/net/wan/pci200syn.c b/trunk/drivers/net/wan/pci200syn.c index 4df61fa3214b..24c3c57c13c9 100644 --- a/trunk/drivers/net/wan/pci200syn.c +++ b/trunk/drivers/net/wan/pci200syn.c @@ -402,7 +402,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, writew(readw(p) | 0x0040, p); /* Allocate IRQ */ - if (request_irq(pdev->irq, sca_intr, IRQF_SHARED, devname, card)) { + if (request_irq(pdev->irq, sca_intr, SA_SHIRQ, devname, card)) { printk(KERN_WARNING "pci200syn: could not allocate IRQ%d.\n", pdev->irq); pci200_pci_remove_one(pdev); diff --git a/trunk/drivers/net/wan/sbni.c b/trunk/drivers/net/wan/sbni.c index fc75bec19029..175ba13bce41 100644 --- a/trunk/drivers/net/wan/sbni.c +++ b/trunk/drivers/net/wan/sbni.c @@ -37,6 +37,7 @@ * Known problem: this driver wasn't tested on multiprocessor machine. */ +#include #include #include #include @@ -1192,7 +1193,7 @@ sbni_open( struct net_device *dev ) } } - if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) { + if( request_irq(dev->irq, sbni_interrupt, SA_SHIRQ, dev->name, dev) ) { printk( KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq ); return -EAGAIN; diff --git a/trunk/drivers/net/wan/sealevel.c b/trunk/drivers/net/wan/sealevel.c index 70fb1b98b1dd..050e854e7774 100644 --- a/trunk/drivers/net/wan/sealevel.c +++ b/trunk/drivers/net/wan/sealevel.c @@ -322,7 +322,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq, /* We want a fast IRQ for this device. Actually we'd like an even faster IRQ ;) - This is one driver RtLinux is made for */ - if(request_irq(irq, &z8530_interrupt, IRQF_DISABLED, "SeaLevel", dev)<0) + if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "SeaLevel", dev)<0) { printk(KERN_WARNING "sealevel: IRQ %d already in use.\n", irq); goto fail1_1; diff --git a/trunk/drivers/net/wan/syncppp.c b/trunk/drivers/net/wan/syncppp.c index c13b459a0137..2d1bba06a085 100644 --- a/trunk/drivers/net/wan/syncppp.c +++ b/trunk/drivers/net/wan/syncppp.c @@ -37,6 +37,7 @@ */ #undef DEBUG +#include #include #include #include diff --git a/trunk/drivers/net/wan/wanxl.c b/trunk/drivers/net/wan/wanxl.c index d564224cdca9..437e0e938e38 100644 --- a/trunk/drivers/net/wan/wanxl.c +++ b/trunk/drivers/net/wan/wanxl.c @@ -755,7 +755,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev, pci_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq); /* Allocate IRQ */ - if (request_irq(pdev->irq, wanxl_intr, IRQF_SHARED, "wanXL", card)) { + if (request_irq(pdev->irq, wanxl_intr, SA_SHIRQ, "wanXL", card)) { printk(KERN_WARNING "wanXL %s: could not allocate IRQ%i.\n", pci_name(pdev), pdev->irq); wanxl_pci_remove_one(pdev); diff --git a/trunk/drivers/net/wireless/airo.c b/trunk/drivers/net/wireless/airo.c index a4dd13942714..4069b79d8259 100644 --- a/trunk/drivers/net/wireless/airo.c +++ b/trunk/drivers/net/wireless/airo.c @@ -19,6 +19,7 @@ ======================================================================*/ +#include #include #include @@ -2848,7 +2849,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port, reset_card (dev, 1); msleep(400); - rc = request_irq( dev->irq, airo_interrupt, IRQF_SHARED, dev->name, dev ); + rc = request_irq( dev->irq, airo_interrupt, SA_SHIRQ, dev->name, dev ); if (rc) { airo_print_err(dev->name, "register interrupt %d failed, rc %d", irq, rc); diff --git a/trunk/drivers/net/wireless/airo_cs.c b/trunk/drivers/net/wireless/airo_cs.c index ac9437d497f0..af0cbb6c5c0c 100644 --- a/trunk/drivers/net/wireless/airo_cs.c +++ b/trunk/drivers/net/wireless/airo_cs.c @@ -20,6 +20,7 @@ ======================================================================*/ +#include #ifdef __IN_PCMCIA_PACKAGE__ #include #endif diff --git a/trunk/drivers/net/wireless/airport.c b/trunk/drivers/net/wireless/airport.c index 38fac3bbcd82..7b321f7cf358 100644 --- a/trunk/drivers/net/wireless/airport.c +++ b/trunk/drivers/net/wireless/airport.c @@ -14,6 +14,7 @@ #define DRIVER_NAME "airport" #define PFX DRIVER_NAME ": " +#include #include #include #include diff --git a/trunk/drivers/net/wireless/arlan-main.c b/trunk/drivers/net/wireless/arlan-main.c index bb6bea4f3233..bed6823d9809 100644 --- a/trunk/drivers/net/wireless/arlan-main.c +++ b/trunk/drivers/net/wireless/arlan-main.c @@ -5,6 +5,7 @@ * This module provides support for the Arlan 655 card made by Aironet */ +#include #include "arlan.h" #if BITS_PER_LONG != 32 diff --git a/trunk/drivers/net/wireless/arlan-proc.c b/trunk/drivers/net/wireless/arlan-proc.c index 5fa985435ffa..a2cca521f444 100644 --- a/trunk/drivers/net/wireless/arlan-proc.c +++ b/trunk/drivers/net/wireless/arlan-proc.c @@ -1,3 +1,4 @@ +#include #include "arlan.h" #include diff --git a/trunk/drivers/net/wireless/arlan.h b/trunk/drivers/net/wireless/arlan.h index 3ed1df75900f..70a6d7b83c4a 100644 --- a/trunk/drivers/net/wireless/arlan.h +++ b/trunk/drivers/net/wireless/arlan.h @@ -5,6 +5,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/net/wireless/atmel.c b/trunk/drivers/net/wireless/atmel.c index 995c7bea5897..8606c88886fc 100644 --- a/trunk/drivers/net/wireless/atmel.c +++ b/trunk/drivers/net/wireless/atmel.c @@ -39,6 +39,7 @@ ******************************************************************************/ +#include #include #include @@ -1577,7 +1578,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port, SET_NETDEV_DEV(dev, sys_dev); - if ((rc = request_irq(dev->irq, service_interrupt, IRQF_SHARED, dev->name, dev))) { + if ((rc = request_irq(dev->irq, service_interrupt, SA_SHIRQ, dev->name, dev))) { printk(KERN_ERR "%s: register interrupt %d failed, rc %d\n", dev->name, irq, rc); goto err_out_free; } diff --git a/trunk/drivers/net/wireless/atmel_cs.c b/trunk/drivers/net/wireless/atmel_cs.c index 785664090bb4..26bf1127524d 100644 --- a/trunk/drivers/net/wireless/atmel_cs.c +++ b/trunk/drivers/net/wireless/atmel_cs.c @@ -29,6 +29,7 @@ ******************************************************************************/ +#include #ifdef __IN_PCMCIA_PACKAGE__ #include #endif diff --git a/trunk/drivers/net/wireless/atmel_pci.c b/trunk/drivers/net/wireless/atmel_pci.c index d425c3cefded..a61b3bc6cccf 100644 --- a/trunk/drivers/net/wireless/atmel_pci.c +++ b/trunk/drivers/net/wireless/atmel_pci.c @@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ +#include #include #include #include diff --git a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c index e386dcc32e8c..b3ffcf501311 100644 --- a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c +++ b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include static void bcm43xx_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) diff --git a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c index d8f5600578b4..27bcf47228e2 100644 --- a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c @@ -2175,7 +2175,7 @@ static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm) } #endif res = request_irq(bcm->irq, bcm43xx_interrupt_handler, - IRQF_SHARED, KBUILD_MODNAME, bcm); + SA_SHIRQ, KBUILD_MODNAME, bcm); if (res) { printk(KERN_ERR PFX "Cannot register IRQ%d\n", bcm->irq); return -ENODEV; diff --git a/trunk/drivers/net/wireless/hermes.c b/trunk/drivers/net/wireless/hermes.c index 29d39105f5b8..2aa2f389c0d5 100644 --- a/trunk/drivers/net/wireless/hermes.c +++ b/trunk/drivers/net/wireless/hermes.c @@ -38,6 +38,7 @@ * under either the MPL or the GPL. */ +#include #include #include #include diff --git a/trunk/drivers/net/wireless/hostap/hostap_cs.c b/trunk/drivers/net/wireless/hostap/hostap_cs.c index 52e6df5c1a92..db03dc2646df 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_cs.c +++ b/trunk/drivers/net/wireless/hostap/hostap_cs.c @@ -1,5 +1,6 @@ #define PRISM2_PCCARD +#include #include #include #include @@ -843,7 +844,7 @@ static struct pcmcia_device_id hostap_cs_ids[] = { PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001), PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001), PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), -/* PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000), conflict with pcnet_cs */ + PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000), PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010), diff --git a/trunk/drivers/net/wireless/hostap/hostap_hw.c b/trunk/drivers/net/wireless/hostap/hostap_hw.c index dafaa5ff5aa6..328e9a1d13b5 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_hw.c +++ b/trunk/drivers/net/wireless/hostap/hostap_hw.c @@ -30,6 +30,7 @@ */ +#include #include #include @@ -3095,14 +3096,6 @@ static void prism2_clear_set_tim_queue(local_info_t *local) } -/* - * HostAP uses two layers of net devices, where the inner - * layer gets called all the time from the outer layer. - * This is a natural nesting, which needs a split lock type. - */ -static struct lock_class_key hostap_netdev_xmit_lock_key; - - static struct net_device * prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, struct device *sdev) @@ -3267,8 +3260,6 @@ while (0) SET_NETDEV_DEV(dev, sdev); if (ret >= 0) ret = register_netdevice(dev); - - lockdep_set_class(&dev->_xmit_lock, &hostap_netdev_xmit_lock_key); rtnl_unlock(); if (ret < 0) { printk(KERN_WARNING "%s: register netdevice failed!\n", diff --git a/trunk/drivers/net/wireless/hostap/hostap_main.c b/trunk/drivers/net/wireless/hostap/hostap_main.c index 53374fcba77e..93786f4218f0 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_main.c +++ b/trunk/drivers/net/wireless/hostap/hostap_main.c @@ -12,6 +12,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/net/wireless/hostap/hostap_pci.c b/trunk/drivers/net/wireless/hostap/hostap_pci.c index c2fa011be291..194f07097581 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_pci.c +++ b/trunk/drivers/net/wireless/hostap/hostap_pci.c @@ -4,6 +4,7 @@ * driver patches from Reyk Floeter and * Andy Warner */ +#include #include #include #include @@ -337,7 +338,7 @@ static int prism2_pci_probe(struct pci_dev *pdev, pci_set_drvdata(pdev, dev); - if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name, + if (request_irq(dev->irq, prism2_interrupt, SA_SHIRQ, dev->name, dev)) { printk(KERN_WARNING "%s: request_irq failed\n", dev->name); goto fail; diff --git a/trunk/drivers/net/wireless/hostap/hostap_plx.c b/trunk/drivers/net/wireless/hostap/hostap_plx.c index 49860fa61c30..edaaa943eb8f 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_plx.c +++ b/trunk/drivers/net/wireless/hostap/hostap_plx.c @@ -7,6 +7,7 @@ */ +#include #include #include #include @@ -550,7 +551,7 @@ static int prism2_plx_probe(struct pci_dev *pdev, pci_set_drvdata(pdev, dev); - if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name, + if (request_irq(dev->irq, prism2_interrupt, SA_SHIRQ, dev->name, dev)) { printk(KERN_WARNING "%s: request_irq failed\n", dev->name); goto fail; diff --git a/trunk/drivers/net/wireless/ipw2100.c b/trunk/drivers/net/wireless/ipw2100.c index e955db435b30..94aeb23a7729 100644 --- a/trunk/drivers/net/wireless/ipw2100.c +++ b/trunk/drivers/net/wireless/ipw2100.c @@ -134,6 +134,7 @@ that only one external action is invoked at a time. */ #include +#include #include #include #include @@ -5357,7 +5358,7 @@ static int ipw2100_set_key(struct ipw2100_priv *priv, idx, keylen, len); /* NOTE: We don't check cached values in case the firmware was reset - * or some other problem is occurring. If the user is setting the key, + * or some other problem is occuring. If the user is setting the key, * then we push the change */ wep_key->idx = idx; @@ -6229,7 +6230,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, ipw2100_queues_initialize(priv); err = request_irq(pci_dev->irq, - ipw2100_interrupt, IRQF_SHARED, dev->name, priv); + ipw2100_interrupt, SA_SHIRQ, dev->name, priv); if (err) { printk(KERN_WARNING DRV_NAME "Error calling request_irq: %d.\n", pci_dev->irq); diff --git a/trunk/drivers/net/wireless/ipw2200.c b/trunk/drivers/net/wireless/ipw2200.c index b3300ffe4eec..a8a8f975432f 100644 --- a/trunk/drivers/net/wireless/ipw2200.c +++ b/trunk/drivers/net/wireless/ipw2200.c @@ -11545,7 +11545,7 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ipw_sw_reset(priv, 1); - err = request_irq(pdev->irq, ipw_isr, IRQF_SHARED, DRV_NAME, priv); + err = request_irq(pdev->irq, ipw_isr, SA_SHIRQ, DRV_NAME, priv); if (err) { IPW_ERROR("Error allocating IRQ %d\n", pdev->irq); goto out_destroy_workqueue; diff --git a/trunk/drivers/net/wireless/ipw2200.h b/trunk/drivers/net/wireless/ipw2200.h index 8b1cd7c749a4..ea12ad66b8e8 100644 --- a/trunk/drivers/net/wireless/ipw2200.h +++ b/trunk/drivers/net/wireless/ipw2200.h @@ -31,6 +31,7 @@ #include #include +#include #include #include diff --git a/trunk/drivers/net/wireless/netwave_cs.c b/trunk/drivers/net/wireless/netwave_cs.c index 36b5e004305e..9343d970537b 100644 --- a/trunk/drivers/net/wireless/netwave_cs.c +++ b/trunk/drivers/net/wireless/netwave_cs.c @@ -37,6 +37,7 @@ /* To have statistics (just packets sent) define this */ #undef NETWAVE_STATS +#include #include #include #include diff --git a/trunk/drivers/net/wireless/orinoco.c b/trunk/drivers/net/wireless/orinoco.c index d6ed5781b93a..8a31b591a901 100644 --- a/trunk/drivers/net/wireless/orinoco.c +++ b/trunk/drivers/net/wireless/orinoco.c @@ -76,6 +76,7 @@ #define DRIVER_NAME "orinoco" +#include #include #include #include diff --git a/trunk/drivers/net/wireless/orinoco_cs.c b/trunk/drivers/net/wireless/orinoco_cs.c index bc14689cbf24..b2aec4d9fbb1 100644 --- a/trunk/drivers/net/wireless/orinoco_cs.c +++ b/trunk/drivers/net/wireless/orinoco_cs.c @@ -13,6 +13,7 @@ #define DRIVER_NAME "orinoco_cs" #define PFX DRIVER_NAME ": " +#include #include #include #include diff --git a/trunk/drivers/net/wireless/orinoco_nortel.c b/trunk/drivers/net/wireless/orinoco_nortel.c index bf05b907747e..74b9d5b2ba9e 100644 --- a/trunk/drivers/net/wireless/orinoco_nortel.c +++ b/trunk/drivers/net/wireless/orinoco_nortel.c @@ -40,6 +40,7 @@ #define DRIVER_NAME "orinoco_nortel" #define PFX DRIVER_NAME ": " +#include #include #include #include @@ -198,7 +199,7 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev, hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); - err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, + err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); diff --git a/trunk/drivers/net/wireless/orinoco_pci.c b/trunk/drivers/net/wireless/orinoco_pci.c index 1759c543fbee..1c105f40f8d5 100644 --- a/trunk/drivers/net/wireless/orinoco_pci.c +++ b/trunk/drivers/net/wireless/orinoco_pci.c @@ -44,6 +44,7 @@ #define DRIVER_NAME "orinoco_pci" #define PFX DRIVER_NAME ": " +#include #include #include #include @@ -153,7 +154,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, hermes_struct_init(&priv->hw, hermes_io, HERMES_32BIT_REGSPACING); - err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, + err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); diff --git a/trunk/drivers/net/wireless/orinoco_pci.h b/trunk/drivers/net/wireless/orinoco_pci.h index be1abea4b64f..7eb1e08113e0 100644 --- a/trunk/drivers/net/wireless/orinoco_pci.h +++ b/trunk/drivers/net/wireless/orinoco_pci.h @@ -63,7 +63,7 @@ static int orinoco_pci_resume(struct pci_dev *pdev) pci_enable_device(pdev); pci_restore_state(pdev); - err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, + err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { printk(KERN_ERR "%s: cannot re-allocate IRQ on resume\n", diff --git a/trunk/drivers/net/wireless/orinoco_plx.c b/trunk/drivers/net/wireless/orinoco_plx.c index 7f006f624171..84f696c77551 100644 --- a/trunk/drivers/net/wireless/orinoco_plx.c +++ b/trunk/drivers/net/wireless/orinoco_plx.c @@ -86,6 +86,7 @@ #define DRIVER_NAME "orinoco_plx" #define PFX DRIVER_NAME ": " +#include #include #include #include @@ -237,7 +238,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); - err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, + err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); diff --git a/trunk/drivers/net/wireless/orinoco_tmd.c b/trunk/drivers/net/wireless/orinoco_tmd.c index 0831721e4d6c..d2b4decb7a7d 100644 --- a/trunk/drivers/net/wireless/orinoco_tmd.c +++ b/trunk/drivers/net/wireless/orinoco_tmd.c @@ -40,6 +40,7 @@ #define DRIVER_NAME "orinoco_tmd" #define PFX DRIVER_NAME ": " +#include #include #include #include @@ -139,7 +140,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); - err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, + err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); diff --git a/trunk/drivers/net/wireless/prism54/islpci_hotplug.c b/trunk/drivers/net/wireless/prism54/islpci_hotplug.c index 09fc17a0f029..bfa0cc319a09 100644 --- a/trunk/drivers/net/wireless/prism54/islpci_hotplug.c +++ b/trunk/drivers/net/wireless/prism54/islpci_hotplug.c @@ -189,7 +189,7 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* request for the interrupt before uploading the firmware */ rvalue = request_irq(pdev->irq, &islpci_interrupt, - IRQF_SHARED, ndev->name, priv); + SA_SHIRQ, ndev->name, priv); if (rvalue) { /* error, could not hook the handler to the irq */ diff --git a/trunk/drivers/net/wireless/prism54/islpci_mgt.c b/trunk/drivers/net/wireless/prism54/islpci_mgt.c index 2e061a80b294..6a60c5970cb5 100644 --- a/trunk/drivers/net/wireless/prism54/islpci_mgt.c +++ b/trunk/drivers/net/wireless/prism54/islpci_mgt.c @@ -18,6 +18,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/net/wireless/prism54/prismcompat.h b/trunk/drivers/net/wireless/prism54/prismcompat.h index d71eca55a302..55541c01752e 100644 --- a/trunk/drivers/net/wireless/prism54/prismcompat.h +++ b/trunk/drivers/net/wireless/prism54/prismcompat.h @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/net/wireless/ray_cs.c b/trunk/drivers/net/wireless/ray_cs.c index 61b83a5e737a..a915fe6c6aa5 100644 --- a/trunk/drivers/net/wireless/ray_cs.c +++ b/trunk/drivers/net/wireless/ray_cs.c @@ -30,6 +30,7 @@ * =============================================================================*/ +#include #include #include #include diff --git a/trunk/drivers/net/wireless/spectrum_cs.c b/trunk/drivers/net/wireless/spectrum_cs.c index 15465278c789..7f9aa139c347 100644 --- a/trunk/drivers/net/wireless/spectrum_cs.c +++ b/trunk/drivers/net/wireless/spectrum_cs.c @@ -21,6 +21,7 @@ #define DRIVER_NAME "spectrum_cs" #define PFX DRIVER_NAME ": " +#include #include #include #include diff --git a/trunk/drivers/net/wireless/strip.c b/trunk/drivers/net/wireless/strip.c index fd31885c6844..18a44580b53b 100644 --- a/trunk/drivers/net/wireless/strip.c +++ b/trunk/drivers/net/wireless/strip.c @@ -81,6 +81,7 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE"; /************************************************************************/ /* Header files */ +#include #include #include #include diff --git a/trunk/drivers/net/wireless/wavelan_cs.p.h b/trunk/drivers/net/wireless/wavelan_cs.p.h index f34a36b0c7b0..c65fe7a391ec 100644 --- a/trunk/drivers/net/wireless/wavelan_cs.p.h +++ b/trunk/drivers/net/wireless/wavelan_cs.p.h @@ -411,6 +411,7 @@ /***************************** INCLUDES *****************************/ /* Linux headers that we need */ +#include #include #include #include diff --git a/trunk/drivers/net/wireless/wl3501_cs.c b/trunk/drivers/net/wireless/wl3501_cs.c index c03e400facee..e52a650f6737 100644 --- a/trunk/drivers/net/wireless/wl3501_cs.c +++ b/trunk/drivers/net/wireless/wl3501_cs.c @@ -28,6 +28,7 @@ */ #undef REALLY_SLOW_IO /* most systems can safely undef this */ +#include #include #include #include diff --git a/trunk/drivers/net/yellowfin.c b/trunk/drivers/net/yellowfin.c index bbbf7e274a2a..569305f57561 100644 --- a/trunk/drivers/net/yellowfin.c +++ b/trunk/drivers/net/yellowfin.c @@ -602,7 +602,7 @@ static int yellowfin_open(struct net_device *dev) /* Reset the chip. */ iowrite32(0x80000000, ioaddr + DMACtrl); - i = request_irq(dev->irq, &yellowfin_interrupt, IRQF_SHARED, dev->name, dev); + i = request_irq(dev->irq, &yellowfin_interrupt, SA_SHIRQ, dev->name, dev); if (i) return i; if (yellowfin_debug > 1) diff --git a/trunk/drivers/net/znet.c b/trunk/drivers/net/znet.c index 9f0291f35290..a7c089df66e6 100644 --- a/trunk/drivers/net/znet.c +++ b/trunk/drivers/net/znet.c @@ -85,6 +85,7 @@ - Understand why some traffic patterns add a 1s latency... */ +#include #include #include #include diff --git a/trunk/drivers/net/zorro8390.c b/trunk/drivers/net/zorro8390.c index df04e050c647..8037e5806d0a 100644 --- a/trunk/drivers/net/zorro8390.c +++ b/trunk/drivers/net/zorro8390.c @@ -201,7 +201,7 @@ static int __devinit zorro8390_init(struct net_device *dev, dev->irq = IRQ_AMIGA_PORTS; /* Install the Interrupt handler */ - i = request_irq(IRQ_AMIGA_PORTS, ei_interrupt, IRQF_SHARED, DRV_NAME, dev); + i = request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, DRV_NAME, dev); if (i) return i; for(i = 0; i < ETHER_ADDR_LEN; i++) { diff --git a/trunk/drivers/nubus/nubus.c b/trunk/drivers/nubus/nubus.c index 3a0a3a734933..14cbe34eb897 100644 --- a/trunk/drivers/nubus/nubus.c +++ b/trunk/drivers/nubus/nubus.c @@ -7,6 +7,7 @@ * and others. */ +#include #include #include #include diff --git a/trunk/drivers/nubus/nubus_syms.c b/trunk/drivers/nubus/nubus_syms.c index 9204f04fbf0b..22c1dc9f87b3 100644 --- a/trunk/drivers/nubus/nubus_syms.c +++ b/trunk/drivers/nubus/nubus_syms.c @@ -2,6 +2,7 @@ (c) 1999 David Huggins-Daines */ +#include #include #include #include diff --git a/trunk/drivers/parisc/ccio-dma.c b/trunk/drivers/parisc/ccio-dma.c index 68cb3a080050..a5d826237b26 100644 --- a/trunk/drivers/parisc/ccio-dma.c +++ b/trunk/drivers/parisc/ccio-dma.c @@ -31,6 +31,7 @@ ** the coherency design originally worked out. Only PCX-W does. */ +#include #include #include #include diff --git a/trunk/drivers/parisc/dino.c b/trunk/drivers/parisc/dino.c index 0d96c50ffe9c..ce0a6ebcff15 100644 --- a/trunk/drivers/parisc/dino.c +++ b/trunk/drivers/parisc/dino.c @@ -43,6 +43,7 @@ ** for PCI drivers devices which implement/use MMIO registers. */ +#include #include #include #include diff --git a/trunk/drivers/parisc/eisa.c b/trunk/drivers/parisc/eisa.c index 884965cedec9..58f0ce8d78e0 100644 --- a/trunk/drivers/parisc/eisa.c +++ b/trunk/drivers/parisc/eisa.c @@ -340,7 +340,7 @@ static int __devinit eisa_probe(struct parisc_device *dev) } pcibios_register_hba(&eisa_dev.hba); - result = request_irq(dev->irq, eisa_irq, IRQF_SHARED, "EISA", &eisa_dev); + result = request_irq(dev->irq, eisa_irq, SA_SHIRQ, "EISA", &eisa_dev); if (result) { printk(KERN_ERR "EISA: request_irq failed!\n"); return result; diff --git a/trunk/drivers/parisc/gsc.c b/trunk/drivers/parisc/gsc.c index b45aa5c675a0..5476ba7709b3 100644 --- a/trunk/drivers/parisc/gsc.c +++ b/trunk/drivers/parisc/gsc.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/parisc/led.c b/trunk/drivers/parisc/led.c index bf00fa2537bb..298f2ddb2c17 100644 --- a/trunk/drivers/parisc/led.c +++ b/trunk/drivers/parisc/led.c @@ -23,6 +23,7 @@ * David Pye */ +#include #include #include /* for offsetof() */ #include @@ -410,17 +411,16 @@ static __inline__ int led_get_net_activity(void) static __inline__ int led_get_diskio_activity(void) { static unsigned long last_pgpgin, last_pgpgout; - unsigned long events[NR_VM_EVENT_ITEMS]; + struct page_state pgstat; int changed; - all_vm_events(events); + get_full_page_state(&pgstat); /* get no of sectors in & out */ /* Just use a very simple calculation here. Do not care about overflow, since we only want to know if there was activity or not. */ - changed = (events[PGPGIN] != last_pgpgin) || - (events[PGPGOUT] != last_pgpgout); - last_pgpgin = events[PGPGIN]; - last_pgpgout = events[PGPGOUT]; + changed = (pgstat.pgpgin != last_pgpgin) || (pgstat.pgpgout != last_pgpgout); + last_pgpgin = pgstat.pgpgin; + last_pgpgout = pgstat.pgpgout; return (changed ? LED_DISK_IO : 0); } diff --git a/trunk/drivers/parisc/power.c b/trunk/drivers/parisc/power.c index fad5a33bf0fa..0bcab83b4080 100644 --- a/trunk/drivers/parisc/power.c +++ b/trunk/drivers/parisc/power.c @@ -35,6 +35,7 @@ * runtime through the "/proc/sys/kernel/power" procfs entry. */ +#include #include #include #include diff --git a/trunk/drivers/parisc/sba_iommu.c b/trunk/drivers/parisc/sba_iommu.c index 8b4732815511..d09e39e39c60 100644 --- a/trunk/drivers/parisc/sba_iommu.c +++ b/trunk/drivers/parisc/sba_iommu.c @@ -19,6 +19,7 @@ ** FIXME: add DMA hint support programming in both sba and lba modules. */ +#include #include #include #include diff --git a/trunk/drivers/parisc/superio.c b/trunk/drivers/parisc/superio.c index 4ee26a6d9e25..a988dc7a9abd 100644 --- a/trunk/drivers/parisc/superio.c +++ b/trunk/drivers/parisc/superio.c @@ -271,7 +271,7 @@ superio_init(struct pci_dev *pcidev) else printk(KERN_ERR PFX "USB regulator not initialized!\n"); - if (request_irq(pdev->irq, superio_interrupt, IRQF_DISABLED, + if (request_irq(pdev->irq, superio_interrupt, SA_INTERRUPT, SUPERIO, (void *)sio)) { printk(KERN_ERR PFX "could not get irq\n"); diff --git a/trunk/drivers/parport/ieee1284.c b/trunk/drivers/parport/ieee1284.c index 7ff09f0f858f..690b239ad3a7 100644 --- a/trunk/drivers/parport/ieee1284.c +++ b/trunk/drivers/parport/ieee1284.c @@ -16,6 +16,7 @@ * Various hacks, Fred Barnes , 04/2000 */ +#include #include #include #include diff --git a/trunk/drivers/parport/ieee1284_ops.c b/trunk/drivers/parport/ieee1284_ops.c index 525312f2fe9c..d6c77658231e 100644 --- a/trunk/drivers/parport/ieee1284_ops.c +++ b/trunk/drivers/parport/ieee1284_ops.c @@ -14,6 +14,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/parport/parport_ax88796.c b/trunk/drivers/parport/parport_ax88796.c index 1850632590fd..4baa719439a2 100644 --- a/trunk/drivers/parport/parport_ax88796.c +++ b/trunk/drivers/parport/parport_ax88796.c @@ -345,7 +345,7 @@ static int parport_ax88796_probe(struct platform_device *pdev) if (irq >= 0) { /* request irq */ ret = request_irq(irq, parport_ax88796_interrupt, - IRQF_TRIGGER_FALLING, pdev->name, pp); + SA_TRIGGER_FALLING, pdev->name, pp); if (ret < 0) goto exit_port; diff --git a/trunk/drivers/parport/parport_mfc3.c b/trunk/drivers/parport/parport_mfc3.c index b2b8092a2b39..c85364765ef8 100644 --- a/trunk/drivers/parport/parport_mfc3.c +++ b/trunk/drivers/parport/parport_mfc3.c @@ -353,7 +353,7 @@ static int __init parport_mfc3_init(void) if (p->irq != PARPORT_IRQ_NONE) { if (use_cnt++ == 0) - if (request_irq(IRQ_AMIGA_PORTS, mfc3_interrupt, IRQF_SHARED, p->name, &pp_mfc3_ops)) + if (request_irq(IRQ_AMIGA_PORTS, mfc3_interrupt, SA_SHIRQ, p->name, &pp_mfc3_ops)) goto out_irq; } diff --git a/trunk/drivers/parport/parport_pc.c b/trunk/drivers/parport/parport_pc.c index fe800dc0be9f..7318e4a9e436 100644 --- a/trunk/drivers/parport/parport_pc.c +++ b/trunk/drivers/parport/parport_pc.c @@ -42,6 +42,7 @@ * but rather will start at port->base_hi. */ +#include #include #include #include diff --git a/trunk/drivers/parport/parport_sunbpp.c b/trunk/drivers/parport/parport_sunbpp.c index fac333b279bf..7c43c5392bed 100644 --- a/trunk/drivers/parport/parport_sunbpp.c +++ b/trunk/drivers/parport/parport_sunbpp.c @@ -322,7 +322,7 @@ static int __devinit init_one_port(struct sbus_dev *sdev) p->size = size; if ((err = request_irq(p->irq, parport_sunbpp_interrupt, - IRQF_SHARED, p->name, p)) != 0) { + SA_SHIRQ, p->name, p)) != 0) { goto out_put_port; } diff --git a/trunk/drivers/parport/procfs.c b/trunk/drivers/parport/procfs.c index 2e744a274517..8610ae88b92d 100644 --- a/trunk/drivers/parport/procfs.c +++ b/trunk/drivers/parport/procfs.c @@ -13,6 +13,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/parport/share.c b/trunk/drivers/parport/share.c index 94dc506b83d1..2cb22c8d3357 100644 --- a/trunk/drivers/parport/share.c +++ b/trunk/drivers/parport/share.c @@ -17,6 +17,7 @@ #undef PARPORT_DEBUG_SHARING /* undef for production */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/Makefile b/trunk/drivers/pci/hotplug/Makefile index 34a1891191fd..421cfffb1756 100644 --- a/trunk/drivers/pci/hotplug/Makefile +++ b/trunk/drivers/pci/hotplug/Makefile @@ -40,7 +40,8 @@ ibmphp-objs := ibmphp_core.o \ ibmphp_hpc.o acpiphp-objs := acpiphp_core.o \ - acpiphp_glue.o + acpiphp_glue.o \ + acpiphp_dock.o rpaphp-objs := rpaphp_core.o \ rpaphp_pci.o \ diff --git a/trunk/drivers/pci/hotplug/acpiphp.h b/trunk/drivers/pci/hotplug/acpiphp.h index be104eced34c..17a93f890dba 100644 --- a/trunk/drivers/pci/hotplug/acpiphp.h +++ b/trunk/drivers/pci/hotplug/acpiphp.h @@ -130,7 +130,7 @@ struct acpiphp_func { struct list_head sibling; struct pci_dev *pci_dev; - struct notifier_block nb; + acpi_handle handle; u8 function; /* pci function# */ @@ -151,6 +151,24 @@ struct acpiphp_attention_info }; +struct dependent_device { + struct list_head device_list; + struct list_head pci_list; + acpi_handle handle; + struct acpiphp_func *func; +}; + + +struct acpiphp_dock_station { + acpi_handle handle; + u32 last_dock_time; + u32 flags; + struct acpiphp_func *dock_bridge; + struct list_head dependent_devices; + struct list_head pci_dependent_devices; +}; + + /* PCI bus bridge HID */ #define ACPI_PCI_HOST_HID "PNP0A03" @@ -189,6 +207,11 @@ struct acpiphp_attention_info #define FUNC_HAS_PS2 (0x00000040) #define FUNC_HAS_PS3 (0x00000080) #define FUNC_HAS_DCK (0x00000100) +#define FUNC_IS_DD (0x00000200) + +/* dock station flags */ +#define DOCK_DOCKING (0x00000001) +#define DOCK_HAS_BRIDGE (0x00000002) /* function prototypes */ @@ -203,6 +226,7 @@ extern int acpiphp_glue_init (void); extern void acpiphp_glue_exit (void); extern int acpiphp_get_num_slots (void); typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); +void handle_hotplug_event_func(acpi_handle, u32, void*); extern int acpiphp_enable_slot (struct acpiphp_slot *slot); extern int acpiphp_disable_slot (struct acpiphp_slot *slot); @@ -212,6 +236,16 @@ extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot); extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); extern u32 acpiphp_get_address (struct acpiphp_slot *slot); +/* acpiphp_dock.c */ +extern int find_dock_station(void); +extern void remove_dock_station(void); +extern void add_dependent_device(struct dependent_device *new_dd); +extern void add_pci_dependent_device(struct dependent_device *new_dd); +extern struct dependent_device *get_dependent_device(acpi_handle handle); +extern int is_dependent_device(acpi_handle handle); +extern int detect_dependent_devices(acpi_handle *bridge_handle); +extern struct dependent_device *alloc_dependent_device(acpi_handle handle); + /* variables */ extern int acpiphp_debug; diff --git a/trunk/drivers/pci/hotplug/acpiphp_core.c b/trunk/drivers/pci/hotplug/acpiphp_core.c index 34de5697983d..4f1b0da8e47e 100644 --- a/trunk/drivers/pci/hotplug/acpiphp_core.c +++ b/trunk/drivers/pci/hotplug/acpiphp_core.c @@ -416,12 +416,27 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot) static int __init acpiphp_init(void) { + int retval; + int docking_station; + info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); acpiphp_debug = debug; + docking_station = find_dock_station(); + /* read all the ACPI info from the system */ - return init_acpi(); + retval = init_acpi(); + + /* if we have found a docking station, we should + * go ahead and load even if init_acpi has found + * no slots. This handles the case when the _DCK + * method not defined under the actual dock bridge + */ + if (docking_station) + return 0; + else + return retval; } @@ -429,6 +444,8 @@ static void __exit acpiphp_exit(void) { /* deallocate internal data structures etc. */ acpiphp_glue_exit(); + + remove_dock_station(); } module_init(acpiphp_init); diff --git a/trunk/drivers/pci/hotplug/acpiphp_dock.c b/trunk/drivers/pci/hotplug/acpiphp_dock.c new file mode 100644 index 000000000000..4f1aaf128312 --- /dev/null +++ b/trunk/drivers/pci/hotplug/acpiphp_dock.c @@ -0,0 +1,438 @@ +/* + * ACPI PCI HotPlug dock functions to ACPI CA subsystem + * + * Copyright (C) 2006 Kristen Carlson Accardi (kristen.c.accardi@intel.com) + * Copyright (C) 2006 Intel Corporation + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or + * NON INFRINGEMENT. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Send feedback to + * + */ +#include +#include + +#include +#include +#include +#include + +#include "../pci.h" +#include "pci_hotplug.h" +#include "acpiphp.h" + +static struct acpiphp_dock_station *ds; +#define MY_NAME "acpiphp_dock" + + +int is_dependent_device(acpi_handle handle) +{ + return (get_dependent_device(handle) ? 1 : 0); +} + + +static acpi_status +find_dependent_device(acpi_handle handle, u32 lvl, void *context, void **rv) +{ + int *count = (int *)context; + + if (is_dependent_device(handle)) { + (*count)++; + return AE_CTRL_TERMINATE; + } else { + return AE_OK; + } +} + + + + +void add_dependent_device(struct dependent_device *new_dd) +{ + list_add_tail(&new_dd->device_list, &ds->dependent_devices); +} + + +void add_pci_dependent_device(struct dependent_device *new_dd) +{ + list_add_tail(&new_dd->pci_list, &ds->pci_dependent_devices); +} + + + +struct dependent_device * get_dependent_device(acpi_handle handle) +{ + struct dependent_device *dd; + + if (!ds) + return NULL; + + list_for_each_entry(dd, &ds->dependent_devices, device_list) { + if (handle == dd->handle) + return dd; + } + return NULL; +} + + + +struct dependent_device *alloc_dependent_device(acpi_handle handle) +{ + struct dependent_device *dd; + + dd = kzalloc(sizeof(*dd), GFP_KERNEL); + if (dd) { + INIT_LIST_HEAD(&dd->pci_list); + INIT_LIST_HEAD(&dd->device_list); + dd->handle = handle; + } + return dd; +} + + + +static int is_dock(acpi_handle handle) +{ + acpi_status status; + acpi_handle tmp; + + status = acpi_get_handle(handle, "_DCK", &tmp); + if (ACPI_FAILURE(status)) { + return 0; + } + return 1; +} + + + +static int dock_present(void) +{ + unsigned long sta; + acpi_status status; + + if (ds) { + status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta); + if (ACPI_SUCCESS(status) && sta) + return 1; + } + return 0; +} + + + +static void eject_dock(void) +{ + struct acpi_object_list arg_list; + union acpi_object arg; + + arg_list.count = 1; + arg_list.pointer = &arg; + arg.type = ACPI_TYPE_INTEGER; + arg.integer.value = 1; + + if (ACPI_FAILURE(acpi_evaluate_object(ds->handle, "_EJ0", + &arg_list, NULL)) || dock_present()) + warn("%s: failed to eject dock!\n", __FUNCTION__); + + return; +} + + + + +static acpi_status handle_dock(int dock) +{ + acpi_status status; + struct acpi_object_list arg_list; + union acpi_object arg; + struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + + dbg("%s: %s\n", __FUNCTION__, dock ? "docking" : "undocking"); + + /* _DCK method has one argument */ + arg_list.count = 1; + arg_list.pointer = &arg; + arg.type = ACPI_TYPE_INTEGER; + arg.integer.value = dock; + status = acpi_evaluate_object(ds->handle, "_DCK", + &arg_list, &buffer); + if (ACPI_FAILURE(status)) + err("%s: failed to execute _DCK\n", __FUNCTION__); + acpi_os_free(buffer.pointer); + + return status; +} + + + +static inline void dock(void) +{ + handle_dock(1); +} + + + +static inline void undock(void) +{ + handle_dock(0); +} + + + +/* + * the _DCK method can do funny things... and sometimes not + * hah-hah funny. + * + * TBD - figure out a way to only call fixups for + * systems that require them. + */ +static void post_dock_fixups(void) +{ + struct pci_bus *bus; + u32 buses; + struct dependent_device *dd; + + list_for_each_entry(dd, &ds->pci_dependent_devices, pci_list) { + bus = dd->func->slot->bridge->pci_bus; + + /* fixup bad _DCK function that rewrites + * secondary bridge on slot + */ + pci_read_config_dword(bus->self, + PCI_PRIMARY_BUS, + &buses); + + if (((buses >> 8) & 0xff) != bus->secondary) { + buses = (buses & 0xff000000) + | ((unsigned int)(bus->primary) << 0) + | ((unsigned int)(bus->secondary) << 8) + | ((unsigned int)(bus->subordinate) << 16); + pci_write_config_dword(bus->self, + PCI_PRIMARY_BUS, + buses); + } + } +} + + + +static void hotplug_pci(u32 type) +{ + struct dependent_device *dd; + + list_for_each_entry(dd, &ds->pci_dependent_devices, pci_list) + handle_hotplug_event_func(dd->handle, type, dd->func); +} + + + +static inline void begin_dock(void) +{ + ds->flags |= DOCK_DOCKING; +} + + +static inline void complete_dock(void) +{ + ds->flags &= ~(DOCK_DOCKING); + ds->last_dock_time = jiffies; +} + + +static int dock_in_progress(void) +{ + if (ds->flags & DOCK_DOCKING || + ds->last_dock_time == jiffies) { + dbg("dock in progress\n"); + return 1; + } + return 0; +} + + + +static void +handle_hotplug_event_dock(acpi_handle handle, u32 type, void *context) +{ + dbg("%s: enter\n", __FUNCTION__); + + switch (type) { + case ACPI_NOTIFY_BUS_CHECK: + dbg("BUS Check\n"); + if (!dock_in_progress() && dock_present()) { + begin_dock(); + dock(); + if (!dock_present()) { + err("Unable to dock!\n"); + break; + } + post_dock_fixups(); + hotplug_pci(type); + complete_dock(); + } + break; + case ACPI_NOTIFY_EJECT_REQUEST: + dbg("EJECT request\n"); + if (!dock_in_progress() && dock_present()) { + hotplug_pci(type); + undock(); + eject_dock(); + if (dock_present()) + err("Unable to undock!\n"); + } + break; + } +} + + + + +static acpi_status +find_dock_ejd(acpi_handle handle, u32 lvl, void *context, void **rv) +{ + acpi_status status; + acpi_handle tmp; + acpi_handle dck_handle = (acpi_handle) context; + char objname[64]; + struct acpi_buffer buffer = { .length = sizeof(objname), + .pointer = objname }; + struct acpi_buffer ejd_buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + union acpi_object *ejd_obj; + + status = acpi_get_handle(handle, "_EJD", &tmp); + if (ACPI_FAILURE(status)) + return AE_OK; + + /* make sure we are dependent on the dock device, + * by executing the _EJD method, then getting a handle + * to the device referenced by that name. If that + * device handle is the same handle as the dock station + * handle, then we are a device dependent on the dock station + */ + acpi_get_name(dck_handle, ACPI_FULL_PATHNAME, &buffer); + status = acpi_evaluate_object(handle, "_EJD", NULL, &ejd_buffer); + if (ACPI_FAILURE(status)) { + err("Unable to execute _EJD!\n"); + goto find_ejd_out; + } + ejd_obj = ejd_buffer.pointer; + status = acpi_get_handle(NULL, ejd_obj->string.pointer, &tmp); + if (ACPI_FAILURE(status)) + goto find_ejd_out; + + if (tmp == dck_handle) { + struct dependent_device *dd; + dbg("%s: found device dependent on dock\n", __FUNCTION__); + dd = alloc_dependent_device(handle); + if (!dd) { + err("Can't allocate memory for dependent device!\n"); + goto find_ejd_out; + } + add_dependent_device(dd); + } + +find_ejd_out: + acpi_os_free(ejd_buffer.pointer); + return AE_OK; +} + + + +int detect_dependent_devices(acpi_handle *bridge_handle) +{ + acpi_status status; + int count; + + count = 0; + + status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle, + (u32)1, find_dependent_device, + (void *)&count, NULL); + + return count; +} + + + + + +static acpi_status +find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) +{ + int *count = (int *)context; + + if (is_dock(handle)) { + dbg("%s: found dock\n", __FUNCTION__); + ds = kzalloc(sizeof(*ds), GFP_KERNEL); + ds->handle = handle; + INIT_LIST_HEAD(&ds->dependent_devices); + INIT_LIST_HEAD(&ds->pci_dependent_devices); + + /* look for devices dependent on dock station */ + acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, find_dock_ejd, handle, NULL); + + acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, + handle_hotplug_event_dock, ds); + (*count)++; + } + + return AE_OK; +} + + + + +int find_dock_station(void) +{ + int num = 0; + + ds = NULL; + + /* start from the root object, because some laptops define + * _DCK methods outside the scope of PCI (IBM x-series laptop) + */ + acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, find_dock, &num, NULL); + + return num; +} + + + +void remove_dock_station(void) +{ + struct dependent_device *dd, *tmp; + if (ds) { + if (ACPI_FAILURE(acpi_remove_notify_handler(ds->handle, + ACPI_SYSTEM_NOTIFY, handle_hotplug_event_dock))) + err("failed to remove dock notify handler\n"); + + /* free all dependent devices */ + list_for_each_entry_safe(dd, tmp, &ds->dependent_devices, + device_list) + kfree(dd); + + /* no need to touch the pci_dependent_device list, + * cause all memory was freed above + */ + kfree(ds); + } +} + + diff --git a/trunk/drivers/pci/hotplug/acpiphp_glue.c b/trunk/drivers/pci/hotplug/acpiphp_glue.c index ef95d12fb32c..d370f999782e 100644 --- a/trunk/drivers/pci/hotplug/acpiphp_glue.c +++ b/trunk/drivers/pci/hotplug/acpiphp_glue.c @@ -59,7 +59,6 @@ static LIST_HEAD(bridge_list); static void handle_hotplug_event_bridge (acpi_handle, u32, void *); static void acpiphp_sanitize_bus(struct pci_bus *bus); static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus); -static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context); /* @@ -117,59 +116,6 @@ is_ejectable_slot(acpi_handle handle, u32 lvl, void *context, void **rv) } } -/* callback routine to check for the existance of a pci dock device */ -static acpi_status -is_pci_dock_device(acpi_handle handle, u32 lvl, void *context, void **rv) -{ - int *count = (int *)context; - - if (is_dock_device(handle)) { - (*count)++; - return AE_CTRL_TERMINATE; - } else { - return AE_OK; - } -} - - - - -/* - * the _DCK method can do funny things... and sometimes not - * hah-hah funny. - * - * TBD - figure out a way to only call fixups for - * systems that require them. - */ -static int post_dock_fixups(struct notifier_block *nb, unsigned long val, - void *v) -{ - struct acpiphp_func *func = container_of(nb, struct acpiphp_func, nb); - struct pci_bus *bus = func->slot->bridge->pci_bus; - u32 buses; - - if (!bus->self) - return NOTIFY_OK; - - /* fixup bad _DCK function that rewrites - * secondary bridge on slot - */ - pci_read_config_dword(bus->self, - PCI_PRIMARY_BUS, - &buses); - - if (((buses >> 8) & 0xff) != bus->secondary) { - buses = (buses & 0xff000000) - | ((unsigned int)(bus->primary) << 0) - | ((unsigned int)(bus->secondary) << 8) - | ((unsigned int)(bus->subordinate) << 16); - pci_write_config_dword(bus->self, PCI_PRIMARY_BUS, buses); - } - return NOTIFY_OK; -} - - - /* callback routine to register each ACPI PCI slot object */ static acpi_status @@ -178,6 +124,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) struct acpiphp_bridge *bridge = (struct acpiphp_bridge *)context; struct acpiphp_slot *slot; struct acpiphp_func *newfunc; + struct dependent_device *dd; acpi_handle tmp; acpi_status status = AE_OK; unsigned long adr, sun; @@ -190,7 +137,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) status = acpi_get_handle(handle, "_EJ0", &tmp); - if (ACPI_FAILURE(status) && !(is_dock_device(handle))) + if (ACPI_FAILURE(status) && !(is_dependent_device(handle))) return AE_OK; device = (adr >> 16) & 0xffff; @@ -215,18 +162,23 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) if (ACPI_SUCCESS(acpi_get_handle(handle, "_PS3", &tmp))) newfunc->flags |= FUNC_HAS_PS3; - if (ACPI_SUCCESS(acpi_get_handle(handle, "_DCK", &tmp))) + if (ACPI_SUCCESS(acpi_get_handle(handle, "_DCK", &tmp))) { newfunc->flags |= FUNC_HAS_DCK; - - status = acpi_evaluate_integer(handle, "_SUN", NULL, &sun); - if (ACPI_FAILURE(status)) { - /* - * use the count of the number of slots we've found - * for the number of the slot + /* add to devices dependent on dock station, + * because this may actually be the dock bridge */ - sun = bridge->nr_slots+1; + dd = alloc_dependent_device(handle); + if (!dd) + err("Can't allocate memory for " + "new dependent device!\n"); + else + add_dependent_device(dd); } + status = acpi_evaluate_integer(handle, "_SUN", NULL, &sun); + if (ACPI_FAILURE(status)) + sun = -1; + /* search for objects that share the same slot */ for (slot = bridge->slots; slot; slot = slot->next) if (slot->device == device) { @@ -273,23 +225,20 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON); } - if (is_dock_device(handle)) { - /* we don't want to call this device's _EJ0 - * because we want the dock notify handler - * to call it after it calls _DCK + /* if this is a device dependent on a dock station, + * associate the acpiphp_func to the dependent_device + * struct. + */ + if ((dd = get_dependent_device(handle))) { + newfunc->flags |= FUNC_IS_DD; + /* + * we don't want any devices which is dependent + * on the dock to have it's _EJ0 method executed. + * because we need to run _DCK first. */ newfunc->flags &= ~FUNC_HAS_EJ0; - if (register_hotplug_dock_device(handle, - handle_hotplug_event_func, newfunc)) - dbg("failed to register dock device\n"); - - /* we need to be notified when dock events happen - * outside of the hotplug operation, since we may - * need to do fixups before we can hotplug. - */ - newfunc->nb.notifier_call = post_dock_fixups; - if (register_dock_notifier(&newfunc->nb)) - dbg("failed to register a dock notifier"); + dd->func = newfunc; + add_pci_dependent_device(dd); } /* install notify handler */ @@ -328,15 +277,6 @@ static int detect_ejectable_slots(acpi_handle *bridge_handle) status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle, (u32)1, is_ejectable_slot, (void *)&count, NULL); - /* - * we also need to add this bridge if there is a dock bridge or - * other pci device on a dock station (removable) - */ - if (!count) - status = acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle, - (u32)1, is_pci_dock_device, (void *)&count, - NULL); - return count; } @@ -547,7 +487,8 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv) goto out; /* check if this bridge has ejectable slots */ - if ((detect_ejectable_slots(handle) > 0)) { + if ((detect_ejectable_slots(handle) > 0) || + (detect_dependent_devices(handle) > 0)) { dbg("found PCI-to-PCI bridge at PCI %s\n", pci_name(dev)); add_p2p_bridge(handle, dev); } @@ -664,10 +605,6 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge) list_for_each_safe (list, tmp, &slot->funcs) { struct acpiphp_func *func; func = list_entry(list, struct acpiphp_func, sibling); - if (is_dock_device(func->handle)) { - unregister_hotplug_dock_device(func->handle); - unregister_dock_notifier(&func->nb); - } if (!(func->flags & FUNC_HAS_DCK)) { status = acpi_remove_notify_handler(func->handle, ACPI_SYSTEM_NOTIFY, @@ -1503,7 +1440,7 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, void *cont * handles ACPI event notification on slots * */ -static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context) +void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context) { struct acpiphp_func *func; char objname[64]; diff --git a/trunk/drivers/pci/hotplug/cpci_hotplug_core.c b/trunk/drivers/pci/hotplug/cpci_hotplug_core.c index d5df5871cfa2..037ce4c91687 100644 --- a/trunk/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/trunk/drivers/pci/hotplug/cpci_hotplug_core.c @@ -25,6 +25,7 @@ * Send feedback to */ +#include #include #include #include @@ -347,7 +348,7 @@ cpci_hp_intr(int irq, void *data, struct pt_regs *regs) dbg("entered cpci_hp_intr"); /* Check to see if it was our interrupt */ - if ((controller->irq_flags & IRQF_SHARED) && + if ((controller->irq_flags & SA_SHIRQ) && !controller->ops->check_irq(controller->dev_id)) { dbg("exited cpci_hp_intr, not our interrupt"); return IRQ_NONE; diff --git a/trunk/drivers/pci/hotplug/cpci_hotplug_pci.c b/trunk/drivers/pci/hotplug/cpci_hotplug_pci.c index 02be74caa89f..225b5e551dd6 100644 --- a/trunk/drivers/pci/hotplug/cpci_hotplug_pci.c +++ b/trunk/drivers/pci/hotplug/cpci_hotplug_pci.c @@ -23,6 +23,7 @@ * Send feedback to */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/cpcihp_generic.c b/trunk/drivers/pci/hotplug/cpcihp_generic.c index e847f0d6c7fe..2d4639d6841f 100644 --- a/trunk/drivers/pci/hotplug/cpcihp_generic.c +++ b/trunk/drivers/pci/hotplug/cpcihp_generic.c @@ -34,6 +34,7 @@ * Send feedback to */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/cpcihp_zt5550.c b/trunk/drivers/pci/hotplug/cpcihp_zt5550.c index 1c12e9171097..1ec165df8522 100644 --- a/trunk/drivers/pci/hotplug/cpcihp_zt5550.c +++ b/trunk/drivers/pci/hotplug/cpcihp_zt5550.c @@ -30,13 +30,13 @@ * Send feedback to */ +#include #include #include #include #include #include -#include -#include /* IRQF_SHARED */ +#include /* SA_SHIRQ */ #include "cpci_hotplug.h" #include "cpcihp_zt5550.h" @@ -220,7 +220,7 @@ static int zt5550_hc_init_one (struct pci_dev *pdev, const struct pci_device_id zt5550_hpc.ops = &zt5550_hpc_ops; if(!poll) { zt5550_hpc.irq = hc_dev->irq; - zt5550_hpc.irq_flags = IRQF_SHARED; + zt5550_hpc.irq_flags = SA_SHIRQ; zt5550_hpc.dev_id = hc_dev; zt5550_hpc_ops.enable_irq = zt5550_hc_enable_irq; diff --git a/trunk/drivers/pci/hotplug/cpqphp_core.c b/trunk/drivers/pci/hotplug/cpqphp_core.c index 1fc259913b68..f8658d63f077 100644 --- a/trunk/drivers/pci/hotplug/cpqphp_core.c +++ b/trunk/drivers/pci/hotplug/cpqphp_core.c @@ -29,6 +29,7 @@ * */ +#include #include #include #include @@ -1188,7 +1189,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* set up the interrupt */ dbg("HPC interrupt = %d \n", ctrl->interrupt); if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr, - IRQF_SHARED, MY_NAME, ctrl)) { + SA_SHIRQ, MY_NAME, ctrl)) { err("Can't get irq %d for the hotplug pci controller\n", ctrl->interrupt); rc = -ENODEV; diff --git a/trunk/drivers/pci/hotplug/cpqphp_ctrl.c b/trunk/drivers/pci/hotplug/cpqphp_ctrl.c index ae2dd36efef2..55d2dc7e39ca 100644 --- a/trunk/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/trunk/drivers/pci/hotplug/cpqphp_ctrl.c @@ -26,6 +26,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/cpqphp_nvram.c b/trunk/drivers/pci/hotplug/cpqphp_nvram.c index cf0878917537..ac98a11bd1eb 100644 --- a/trunk/drivers/pci/hotplug/cpqphp_nvram.c +++ b/trunk/drivers/pci/hotplug/cpqphp_nvram.c @@ -26,6 +26,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/cpqphp_pci.c b/trunk/drivers/pci/hotplug/cpqphp_pci.c index 0d9688952f4a..00b81a7bdd26 100644 --- a/trunk/drivers/pci/hotplug/cpqphp_pci.c +++ b/trunk/drivers/pci/hotplug/cpqphp_pci.c @@ -26,6 +26,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/cpqphp_sysfs.c b/trunk/drivers/pci/hotplug/cpqphp_sysfs.c index 8b3da007e859..bbfeed767ff1 100644 --- a/trunk/drivers/pci/hotplug/cpqphp_sysfs.c +++ b/trunk/drivers/pci/hotplug/cpqphp_sysfs.c @@ -26,6 +26,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/fakephp.c b/trunk/drivers/pci/hotplug/fakephp.c index dd2b762777c4..71b80c23e8ce 100644 --- a/trunk/drivers/pci/hotplug/fakephp.c +++ b/trunk/drivers/pci/hotplug/fakephp.c @@ -32,6 +32,7 @@ * Enabling PCI devices is left as an exercise for the reader... * */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/pci_hotplug_core.c b/trunk/drivers/pci/hotplug/pci_hotplug_core.c index b7b378df89e3..c4282902cb52 100644 --- a/trunk/drivers/pci/hotplug/pci_hotplug_core.c +++ b/trunk/drivers/pci/hotplug/pci_hotplug_core.c @@ -27,6 +27,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/pciehp_hpc.c b/trunk/drivers/pci/hotplug/pciehp_hpc.c index 0d8fb6e607a1..11f7858f0064 100644 --- a/trunk/drivers/pci/hotplug/pciehp_hpc.c +++ b/trunk/drivers/pci/hotplug/pciehp_hpc.c @@ -1458,7 +1458,7 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) start_int_poll_timer( php_ctlr, 10 ); /* start with 10 second delay */ } else { /* Installs the interrupt handler */ - rc = request_irq(php_ctlr->irq, pcie_isr, IRQF_SHARED, MY_NAME, (void *) ctrl); + rc = request_irq(php_ctlr->irq, pcie_isr, SA_SHIRQ, MY_NAME, (void *) ctrl); dbg("%s: request_irq %d for hpc%d (returns %d)\n", __FUNCTION__, php_ctlr->irq, ctlr_seq_num, rc); if (rc) { err("Can't get irq %d for the hotplug controller\n", php_ctlr->irq); diff --git a/trunk/drivers/pci/hotplug/pcihp_skeleton.c b/trunk/drivers/pci/hotplug/pcihp_skeleton.c index 8ad446605f75..0a46f549676a 100644 --- a/trunk/drivers/pci/hotplug/pcihp_skeleton.c +++ b/trunk/drivers/pci/hotplug/pcihp_skeleton.c @@ -28,6 +28,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/rpaphp_core.c b/trunk/drivers/pci/hotplug/rpaphp_core.c index 076bd6dcafae..638004546700 100644 --- a/trunk/drivers/pci/hotplug/rpaphp_core.c +++ b/trunk/drivers/pci/hotplug/rpaphp_core.c @@ -22,6 +22,7 @@ * Send feedback to * */ +#include #include #include #include diff --git a/trunk/drivers/pci/hotplug/shpchp_hpc.c b/trunk/drivers/pci/hotplug/shpchp_hpc.c index 0f9798df4704..45facaad39bd 100644 --- a/trunk/drivers/pci/hotplug/shpchp_hpc.c +++ b/trunk/drivers/pci/hotplug/shpchp_hpc.c @@ -1246,7 +1246,7 @@ int shpc_init(struct controller * ctrl, struct pci_dev * pdev) } else php_ctlr->irq = pdev->irq; - rc = request_irq(php_ctlr->irq, shpc_isr, IRQF_SHARED, MY_NAME, (void *) ctrl); + rc = request_irq(php_ctlr->irq, shpc_isr, SA_SHIRQ, MY_NAME, (void *) ctrl); dbg("%s: request_irq %d for hpc%d (returns %d)\n", __FUNCTION__, php_ctlr->irq, ctlr_seq_num, rc); if (rc) { err("Can't get irq %d for the hotplug controller\n", php_ctlr->irq); diff --git a/trunk/drivers/pci/msi.c b/trunk/drivers/pci/msi.c index 36bc7c415af7..76d023d8a33b 100644 --- a/trunk/drivers/pci/msi.c +++ b/trunk/drivers/pci/msi.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/pci/pci-sysfs.c b/trunk/drivers/pci/pci-sysfs.c index fdefa7dcd156..606f9b6f70eb 100644 --- a/trunk/drivers/pci/pci-sysfs.c +++ b/trunk/drivers/pci/pci-sysfs.c @@ -15,6 +15,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/pci/quirks.c b/trunk/drivers/pci/quirks.c index d1d7333bb71b..4364d793f73b 100644 --- a/trunk/drivers/pci/quirks.c +++ b/trunk/drivers/pci/quirks.c @@ -15,6 +15,7 @@ * use the PowerTweak utility (see http://powertweak.sourceforge.net). */ +#include #include #include #include diff --git a/trunk/drivers/pci/rom.c b/trunk/drivers/pci/rom.c index f5ee7ce16fa6..cbb69cf41311 100644 --- a/trunk/drivers/pci/rom.c +++ b/trunk/drivers/pci/rom.c @@ -6,6 +6,7 @@ * * PCI ROM access routines */ +#include #include #include #include diff --git a/trunk/drivers/pcmcia/at91_cf.c b/trunk/drivers/pcmcia/at91_cf.c index 40569f40e90e..a4d50940ebeb 100644 --- a/trunk/drivers/pcmcia/at91_cf.c +++ b/trunk/drivers/pcmcia/at91_cf.c @@ -214,10 +214,11 @@ static struct pccard_operations at91_cf_ops = { /*--------------------------------------------------------------------------*/ -static int __init at91_cf_probe(struct platform_device *pdev) +static int __init at91_cf_probe(struct device *dev) { struct at91_cf_socket *cf; - struct at91_cf_data *board = pdev->dev.platform_data; + struct at91_cf_data *board = dev->platform_data; + struct platform_device *pdev = to_platform_device(dev); struct resource *io; unsigned int csa; int status; @@ -235,7 +236,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) cf->board = board; cf->pdev = pdev; - platform_set_drvdata(pdev, cf); + dev_set_drvdata(dev, cf); /* CF takes over CS4, CS5, CS6 */ csa = at91_sys_read(AT91_EBI_CSA); @@ -267,10 +268,9 @@ static int __init at91_cf_probe(struct platform_device *pdev) /* must be a GPIO; ergo must trigger on both edges */ status = request_irq(board->det_pin, at91_cf_irq, - IRQF_SAMPLE_RANDOM, driver_name, cf); + SA_SAMPLE_RANDOM, driver_name, cf); if (status < 0) goto fail0; - device_init_wakeup(&pdev->dev, 1); /* * The card driver will request this irq later as needed. @@ -280,7 +280,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) */ if (board->irq_pin) { status = request_irq(board->irq_pin, at91_cf_irq, - IRQF_SHARED, driver_name, cf); + SA_SHIRQ, driver_name, cf); if (status < 0) goto fail0a; cf->socket.pci_irq = board->irq_pin; @@ -301,7 +301,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) board->det_pin, board->irq_pin); cf->socket.owner = THIS_MODULE; - cf->socket.dev.dev = &pdev->dev; + cf->socket.dev.dev = dev; cf->socket.ops = &at91_cf_ops; cf->socket.resource_ops = &pccard_static_ops; cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP @@ -323,25 +323,21 @@ static int __init at91_cf_probe(struct platform_device *pdev) free_irq(board->irq_pin, cf); fail0a: free_irq(board->det_pin, cf); - device_init_wakeup(&pdev->dev, 0); fail0: at91_sys_write(AT91_EBI_CSA, csa); kfree(cf); return status; } -static int __exit at91_cf_remove(struct platform_device *pdev) +static int __exit at91_cf_remove(struct device *dev) { - struct at91_cf_socket *cf = platform_get_drvdata(pdev); - struct at91_cf_data *board = cf->board; + struct at91_cf_socket *cf = dev_get_drvdata(dev); struct resource *io = cf->socket.io[0].res; unsigned int csa; pcmcia_unregister_socket(&cf->socket); - if (board->irq_pin) - free_irq(board->irq_pin, cf); - free_irq(board->det_pin, cf); - device_init_wakeup(&pdev->dev, 0); + free_irq(cf->board->irq_pin, cf); + free_irq(cf->board->det_pin, cf); iounmap((void __iomem *) cf->socket.io_offset); release_mem_region(io->start, io->end + 1 - io->start); @@ -352,65 +348,26 @@ static int __exit at91_cf_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM - -static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg) -{ - struct at91_cf_socket *cf = platform_get_drvdata(pdev); - struct at91_cf_data *board = cf->board; - - pcmcia_socket_dev_suspend(&pdev->dev, mesg); - if (device_may_wakeup(&pdev->dev)) - enable_irq_wake(board->det_pin); - else { - disable_irq_wake(board->det_pin); - disable_irq(board->det_pin); - } - if (board->irq_pin) - disable_irq(board->irq_pin); - return 0; -} - -static int at91_cf_resume(struct platform_device *pdev) -{ - struct at91_cf_socket *cf = platform_get_drvdata(pdev); - struct at91_cf_data *board = cf->board; - - if (board->irq_pin) - enable_irq(board->irq_pin); - if (!device_may_wakeup(&pdev->dev)) - enable_irq(board->det_pin); - pcmcia_socket_dev_resume(&pdev->dev); - return 0; -} - -#else -#define at91_cf_suspend NULL -#define at91_cf_resume NULL -#endif - -static struct platform_driver at91_cf_driver = { - .driver = { - .name = (char *) driver_name, - .owner = THIS_MODULE, - }, +static struct device_driver at91_cf_driver = { + .name = (char *) driver_name, + .bus = &platform_bus_type, .probe = at91_cf_probe, .remove = __exit_p(at91_cf_remove), - .suspend = at91_cf_suspend, - .resume = at91_cf_resume, + .suspend = pcmcia_socket_dev_suspend, + .resume = pcmcia_socket_dev_resume, }; /*--------------------------------------------------------------------------*/ static int __init at91_cf_init(void) { - return platform_driver_register(&at91_cf_driver); + return driver_register(&at91_cf_driver); } module_init(at91_cf_init); static void __exit at91_cf_exit(void) { - platform_driver_unregister(&at91_cf_driver); + driver_unregister(&at91_cf_driver); } module_exit(at91_cf_exit); diff --git a/trunk/drivers/pcmcia/au1000_db1x00.c b/trunk/drivers/pcmcia/au1000_db1x00.c index 74e051535d6c..abc13f28ba3f 100644 --- a/trunk/drivers/pcmcia/au1000_db1x00.c +++ b/trunk/drivers/pcmcia/au1000_db1x00.c @@ -30,6 +30,7 @@ * */ +#include #include #include #include @@ -295,7 +296,7 @@ struct pcmcia_low_level db1x00_pcmcia_ops = { .socket_suspend = db1x00_socket_suspend }; -int au1x_board_init(struct device *dev) +int __init au1x_board_init(struct device *dev) { int ret = -ENODEV; bcsr->pcmcia = 0; /* turn off power, if it's not already off */ diff --git a/trunk/drivers/pcmcia/au1000_generic.c b/trunk/drivers/pcmcia/au1000_generic.c index d5dd0ce65536..971a35281649 100644 --- a/trunk/drivers/pcmcia/au1000_generic.c +++ b/trunk/drivers/pcmcia/au1000_generic.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/pcmcia/au1000_generic.h b/trunk/drivers/pcmcia/au1000_generic.h index 1e467bb54077..f2c970b5f4ff 100644 --- a/trunk/drivers/pcmcia/au1000_generic.h +++ b/trunk/drivers/pcmcia/au1000_generic.h @@ -22,6 +22,7 @@ #define __ASM_AU1000_PCMCIA_H /* include the world */ +#include #include #include diff --git a/trunk/drivers/pcmcia/au1000_pb1x00.c b/trunk/drivers/pcmcia/au1000_pb1x00.c index 86c0808d6a05..fd5522ede867 100644 --- a/trunk/drivers/pcmcia/au1000_pb1x00.c +++ b/trunk/drivers/pcmcia/au1000_pb1x00.c @@ -21,6 +21,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ +#include #include #include #include diff --git a/trunk/drivers/pcmcia/cs.c b/trunk/drivers/pcmcia/cs.c index f9cd831a3f31..3162998579c1 100644 --- a/trunk/drivers/pcmcia/cs.c +++ b/trunk/drivers/pcmcia/cs.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -177,7 +176,6 @@ static int pccardd(void *__skt); */ int pcmcia_register_socket(struct pcmcia_socket *socket) { - struct task_struct *tsk; int ret; if (!socket || !socket->ops || !socket->dev.dev || !socket->resource_ops) @@ -241,18 +239,15 @@ int pcmcia_register_socket(struct pcmcia_socket *socket) mutex_init(&socket->skt_mutex); spin_lock_init(&socket->thread_lock); - tsk = kthread_run(pccardd, socket, "pccardd"); - if (IS_ERR(tsk)) { - ret = PTR_ERR(tsk); + ret = kernel_thread(pccardd, socket, CLONE_KERNEL); + if (ret < 0) goto err; - } wait_for_completion(&socket->thread_done); - if (!socket->thread) { + if(!socket->thread) { printk(KERN_WARNING "PCMCIA: warning: socket thread for socket %p did not start\n", socket); return -EIO; } - pcmcia_parse_events(socket, SS_DETECT); return 0; @@ -277,8 +272,10 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket) cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops); if (socket->thread) { + init_completion(&socket->thread_done); + socket->thread = NULL; wake_up(&socket->thread_wait); - kthread_stop(socket->thread); + wait_for_completion(&socket->thread_done); } release_cis_mem(socket); @@ -633,6 +630,8 @@ static int pccardd(void *__skt) DECLARE_WAITQUEUE(wait, current); int ret; + daemonize("pccardd"); + skt->thread = current; skt->socket = dead_socket; skt->ops->init(skt); @@ -644,8 +643,7 @@ static int pccardd(void *__skt) printk(KERN_WARNING "PCMCIA: unable to register socket 0x%p\n", skt); skt->thread = NULL; - complete(&skt->thread_done); - return 0; + complete_and_exit(&skt->thread_done, 0); } add_wait_queue(&skt->thread_wait, &wait); @@ -676,7 +674,7 @@ static int pccardd(void *__skt) continue; } - if (kthread_should_stop()) + if (!skt->thread) break; schedule(); @@ -690,7 +688,7 @@ static int pccardd(void *__skt) /* remove from the device core */ class_device_unregister(&skt->dev); - return 0; + complete_and_exit(&skt->thread_done, 0); } /* @@ -699,12 +697,11 @@ static int pccardd(void *__skt) */ void pcmcia_parse_events(struct pcmcia_socket *s, u_int events) { - unsigned long flags; cs_dbg(s, 4, "parse_events: events %08x\n", events); if (s->thread) { - spin_lock_irqsave(&s->thread_lock, flags); + spin_lock(&s->thread_lock); s->thread_events |= events; - spin_unlock_irqrestore(&s->thread_lock, flags); + spin_unlock(&s->thread_lock); wake_up(&s->thread_wait); } diff --git a/trunk/drivers/pcmcia/hd64465_ss.c b/trunk/drivers/pcmcia/hd64465_ss.c index ad02629c8be2..c662e4f89d46 100644 --- a/trunk/drivers/pcmcia/hd64465_ss.c +++ b/trunk/drivers/pcmcia/hd64465_ss.c @@ -761,7 +761,7 @@ static int hs_init_socket(hs_socket_t *sp, int irq, unsigned long mem_base, hd64465_register_irq_demux(sp->irq, hs_irq_demux, sp); - if ((err = request_irq(sp->irq, hs_interrupt, IRQF_DISABLED, MODNAME, sp)) < 0) + if ((err = request_irq(sp->irq, hs_interrupt, SA_INTERRUPT, MODNAME, sp)) < 0) return err; if (request_mem_region(sp->mem_base, sp->mem_length, MODNAME) == 0) { sp->mem_base = 0; diff --git a/trunk/drivers/pcmcia/i82092.c b/trunk/drivers/pcmcia/i82092.c index 2163aa75a257..d5f03a338c6c 100644 --- a/trunk/drivers/pcmcia/i82092.c +++ b/trunk/drivers/pcmcia/i82092.c @@ -149,7 +149,7 @@ static int __devinit i82092aa_pci_probe(struct pci_dev *dev, const struct pci_de /* Register the interrupt handler */ dprintk(KERN_DEBUG "Requesting interrupt %i \n",dev->irq); - if ((ret = request_irq(dev->irq, i82092aa_interrupt, IRQF_SHARED, "i82092aa", i82092aa_interrupt))) { + if ((ret = request_irq(dev->irq, i82092aa_interrupt, SA_SHIRQ, "i82092aa", i82092aa_interrupt))) { printk(KERN_ERR "i82092aa: Failed to register IRQ %d, aborting\n", dev->irq); goto err_out_free_res; } diff --git a/trunk/drivers/pcmcia/i82365.c b/trunk/drivers/pcmcia/i82365.c index 1cc2682394b1..ff51a65d9433 100644 --- a/trunk/drivers/pcmcia/i82365.c +++ b/trunk/drivers/pcmcia/i82365.c @@ -509,7 +509,7 @@ static irqreturn_t i365_count_irq(int irq, void *dev, struct pt_regs *regs) static u_int __init test_irq(u_short sock, int irq) { debug(2, " testing ISA irq %d\n", irq); - if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan", + if (request_irq(irq, i365_count_irq, SA_PROBEIRQ, "scan", i365_count_irq) != 0) return 1; irq_hits = 0; irq_sock = sock; @@ -562,7 +562,7 @@ static u_int __init isa_scan(u_short sock, u_int mask0) } else { /* Fallback: just find interrupts that aren't in use */ for (i = 0; i < 16; i++) - if ((mask0 & (1 << i)) && (_check_irq(i, IRQF_PROBE_SHARED) == 0)) + if ((mask0 & (1 << i)) && (_check_irq(i, SA_PROBEIRQ) == 0)) mask1 |= (1 << i); printk("default"); /* If scan failed, default to polled status */ @@ -726,7 +726,7 @@ static void __init add_pcic(int ns, int type) u_int cs_mask = mask & ((cs_irq) ? (1< 0; cs_irq--) if ((cs_mask & (1 << cs_irq)) && - (_check_irq(cs_irq, IRQF_PROBE_SHARED) == 0)) + (_check_irq(cs_irq, SA_PROBEIRQ) == 0)) break; if (cs_irq) { grab_irq = 1; diff --git a/trunk/drivers/pcmcia/m32r_cfc.c b/trunk/drivers/pcmcia/m32r_cfc.c index 9e768eaef17a..071cf485e1a3 100644 --- a/trunk/drivers/pcmcia/m32r_cfc.c +++ b/trunk/drivers/pcmcia/m32r_cfc.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/pcmcia/m32r_pcc.c b/trunk/drivers/pcmcia/m32r_pcc.c index 61d50b5620dd..70d5f0748d55 100644 --- a/trunk/drivers/pcmcia/m32r_pcc.c +++ b/trunk/drivers/pcmcia/m32r_pcc.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/pcmcia/omap_cf.c b/trunk/drivers/pcmcia/omap_cf.c index 420e10aec0ae..2c23d7584399 100644 --- a/trunk/drivers/pcmcia/omap_cf.c +++ b/trunk/drivers/pcmcia/omap_cf.c @@ -232,7 +232,7 @@ static int __init omap_cf_probe(struct device *dev) dev_set_drvdata(dev, cf); /* this primarily just shuts up irq handling noise */ - status = request_irq(irq, omap_cf_irq, IRQF_SHARED, + status = request_irq(irq, omap_cf_irq, SA_SHIRQ, driver_name, cf); if (status < 0) goto fail0; diff --git a/trunk/drivers/pcmcia/pcmcia_resource.c b/trunk/drivers/pcmcia/pcmcia_resource.c index 7bf25b88ea31..3131bb0a0095 100644 --- a/trunk/drivers/pcmcia/pcmcia_resource.c +++ b/trunk/drivers/pcmcia/pcmcia_resource.c @@ -788,7 +788,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) struct pcmcia_socket *s = p_dev->socket; config_t *c; int ret = CS_IN_USE, irq = 0; - int type; if (!(s->state & SOCKET_PRESENT)) return CS_NO_CARD; @@ -798,13 +797,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) if (c->state & CONFIG_IRQ_REQ) return CS_IN_USE; - /* Decide what type of interrupt we are registering */ - type = 0; - if (s->functions > 1) /* All of this ought to be handled higher up */ - type = IRQF_SHARED; - if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) - type = IRQF_SHARED; - #ifdef CONFIG_PCMCIA_PROBE if (s->irq.AssignedIRQ != 0) { /* If the interrupt is already assigned, it must be the same */ @@ -830,7 +822,9 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) * marked as used by the kernel resource management core */ ret = request_irq(irq, (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Handler : test_action, - type, + ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || + (s->functions > 1) || + (irq == s->pci_irq)) ? SA_SHIRQ : 0, p_dev->devname, (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data); if (!ret) { @@ -845,21 +839,18 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) if (ret && !s->irq.AssignedIRQ) { if (!s->pci_irq) return ret; - type = IRQF_SHARED; irq = s->pci_irq; } - if (ret && (req->Attributes & IRQ_HANDLE_PRESENT)) { - if (request_irq(irq, req->Handler, type, p_dev->devname, req->Instance)) + if (ret && req->Attributes & IRQ_HANDLE_PRESENT) { + if (request_irq(irq, req->Handler, + ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || + (s->functions > 1) || + (irq == s->pci_irq)) ? SA_SHIRQ : 0, + p_dev->devname, req->Instance)) return CS_IN_USE; } - /* Make sure the fact the request type was overridden is passed back */ - if (type == IRQF_SHARED && !(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) { - req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING; - printk(KERN_WARNING "pcmcia: request for exclusive IRQ could not be fulfilled.\n"); - printk(KERN_WARNING "pcmcia: the driver needs updating to supported shared IRQ lines.\n"); - } c->irq.Attributes = req->Attributes; s->irq.AssignedIRQ = req->AssignedIRQ = irq; s->irq.Config++; diff --git a/trunk/drivers/pcmcia/pd6729.c b/trunk/drivers/pcmcia/pd6729.c index 22c5e7427ddd..9ee26c1b8635 100644 --- a/trunk/drivers/pcmcia/pd6729.c +++ b/trunk/drivers/pcmcia/pd6729.c @@ -689,7 +689,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev, pci_set_drvdata(dev, socket); if (irq_mode == 1) { /* Register the interrupt handler */ - if ((ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED, + if ((ret = request_irq(dev->irq, pd6729_interrupt, SA_SHIRQ, "pd6729", socket))) { printk(KERN_ERR "pd6729: Failed to register irq %d, " "aborting\n", dev->irq); diff --git a/trunk/drivers/pcmcia/pxa2xx_base.c b/trunk/drivers/pcmcia/pxa2xx_base.c index b3518131ea0d..7fa18fb814bc 100644 --- a/trunk/drivers/pcmcia/pxa2xx_base.c +++ b/trunk/drivers/pcmcia/pxa2xx_base.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/pcmcia/sa1100_generic.c b/trunk/drivers/pcmcia/sa1100_generic.c index c5b2a44b4c37..6d441ec75c6a 100644 --- a/trunk/drivers/pcmcia/sa1100_generic.c +++ b/trunk/drivers/pcmcia/sa1100_generic.c @@ -32,6 +32,7 @@ #include #include +#include #include #include diff --git a/trunk/drivers/pcmcia/sa1111_generic.c b/trunk/drivers/pcmcia/sa1111_generic.c index 658cddfbcf29..81ded52c8959 100644 --- a/trunk/drivers/pcmcia/sa1111_generic.c +++ b/trunk/drivers/pcmcia/sa1111_generic.c @@ -5,6 +5,7 @@ * basically means we handle everything except controlling the * power. Power is machine specific... */ +#include #include #include #include diff --git a/trunk/drivers/pcmcia/sa11xx_base.c b/trunk/drivers/pcmcia/sa11xx_base.c index 31a7abc55b23..59c5d968e9f6 100644 --- a/trunk/drivers/pcmcia/sa11xx_base.c +++ b/trunk/drivers/pcmcia/sa11xx_base.c @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/pcmcia/soc_common.c b/trunk/drivers/pcmcia/soc_common.c index ecaa132fa592..ea7d9ca160b2 100644 --- a/trunk/drivers/pcmcia/soc_common.c +++ b/trunk/drivers/pcmcia/soc_common.c @@ -31,6 +31,7 @@ ======================================================================*/ +#include #include #include #include @@ -38,12 +39,12 @@ #include #include #include -#include #include #include #include #include +#include #include #include "soc_common.h" @@ -523,7 +524,7 @@ int soc_pcmcia_request_irqs(struct soc_pcmcia_socket *skt, if (irqs[i].sock != skt->nr) continue; res = request_irq(irqs[i].irq, soc_common_pcmcia_interrupt, - IRQF_DISABLED, irqs[i].str, skt); + SA_INTERRUPT, irqs[i].str, skt); if (res) break; set_irq_type(irqs[i].irq, IRQT_NOEDGE); diff --git a/trunk/drivers/pcmcia/ti113x.h b/trunk/drivers/pcmcia/ti113x.h index 62e9ebf967f9..7a3d1b8e16b9 100644 --- a/trunk/drivers/pcmcia/ti113x.h +++ b/trunk/drivers/pcmcia/ti113x.h @@ -647,7 +647,6 @@ static int ti12xx_2nd_slot_empty(struct yenta_socket *socket) */ break; - case PCI_DEVICE_ID_TI_XX12: case PCI_DEVICE_ID_TI_X515: case PCI_DEVICE_ID_TI_X420: case PCI_DEVICE_ID_TI_X620: diff --git a/trunk/drivers/pcmcia/vrc4171_card.c b/trunk/drivers/pcmcia/vrc4171_card.c index e076a13db555..459e6e1946fd 100644 --- a/trunk/drivers/pcmcia/vrc4171_card.c +++ b/trunk/drivers/pcmcia/vrc4171_card.c @@ -730,7 +730,7 @@ static int __devinit vrc4171_card_init(void) retval = vrc4171_add_sockets(); if (retval == 0) - retval = request_irq(vrc4171_irq, pccard_interrupt, IRQF_SHARED, + retval = request_irq(vrc4171_irq, pccard_interrupt, SA_SHIRQ, vrc4171_card_name, vrc4171_sockets); if (retval < 0) { diff --git a/trunk/drivers/pcmcia/vrc4173_cardu.c b/trunk/drivers/pcmcia/vrc4173_cardu.c index d19a9138135f..6004196f7cc1 100644 --- a/trunk/drivers/pcmcia/vrc4173_cardu.c +++ b/trunk/drivers/pcmcia/vrc4173_cardu.c @@ -500,7 +500,7 @@ static int __devinit vrc4173_cardu_probe(struct pci_dev *dev, return -ENOMEM; } - if (request_irq(dev->irq, cardu_interrupt, IRQF_SHARED, socket->name, socket) < 0) { + if (request_irq(dev->irq, cardu_interrupt, SA_SHIRQ, socket->name, socket) < 0) { pcmcia_unregister_socket(socket->pcmcia_socket); socket->pcmcia_socket = NULL; iounmap(socket->base); diff --git a/trunk/drivers/pcmcia/yenta_socket.c b/trunk/drivers/pcmcia/yenta_socket.c index 1344746381e8..4145eb83b9b6 100644 --- a/trunk/drivers/pcmcia/yenta_socket.c +++ b/trunk/drivers/pcmcia/yenta_socket.c @@ -287,10 +287,7 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state) struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); u16 bridge; - /* if powering down: do it immediately */ - if (state->Vcc == 0) - yenta_set_power(socket, state); - + yenta_set_power(socket, state); socket->io_irq = state->io_irq; bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~(CB_BRIDGE_CRST | CB_BRIDGE_INTR); if (cb_readl(socket, CB_SOCKET_STATE) & CB_CBCARD) { @@ -342,10 +339,6 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state) /* Socket event mask: get card insert/remove events.. */ cb_writel(socket, CB_SOCKET_EVENT, -1); cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK); - - /* if powering up: do it as the last step when the socket is configured */ - if (state->Vcc != 0) - yenta_set_power(socket, state); return 0; } @@ -923,7 +916,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket) socket->probe_status = 0; - if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED, "yenta", socket)) { + if (request_irq(socket->cb_irq, yenta_probe_handler, SA_SHIRQ, "yenta", socket)) { printk(KERN_WARNING "Yenta: request_irq() in yenta_probe_cb_irq() failed!\n"); return -1; } @@ -1005,77 +998,6 @@ static void yenta_config_init(struct yenta_socket *socket) config_writew(socket, CB_BRIDGE_CONTROL, bridge); } -/** - * yenta_fixup_parent_bridge - Fix subordinate bus# of the parent bridge - * @cardbus_bridge: The PCI bus which the CardBus bridge bridges to - * - * Checks if devices on the bus which the CardBus bridge bridges to would be - * invisible during PCI scans because of a misconfigured subordinate number - * of the parent brige - some BIOSes seem to be too lazy to set it right. - * Does the fixup carefully by checking how far it can go without conflicts. - * See http://bugzilla.kernel.org/show_bug.cgi?id=2944 for more information. - */ -static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) -{ - struct list_head *tmp; - unsigned char upper_limit; - /* - * We only check and fix the parent bridge: All systems which need - * this fixup that have been reviewed are laptops and the only bridge - * which needed fixing was the parent bridge of the CardBus bridge: - */ - struct pci_bus *bridge_to_fix = cardbus_bridge->parent; - - /* Check bus numbers are already set up correctly: */ - if (bridge_to_fix->subordinate >= cardbus_bridge->subordinate) - return; /* The subordinate number is ok, nothing to do */ - - if (!bridge_to_fix->parent) - return; /* Root bridges are ok */ - - /* stay within the limits of the bus range of the parent: */ - upper_limit = bridge_to_fix->parent->subordinate; - - /* check the bus ranges of all silbling bridges to prevent overlap */ - list_for_each(tmp, &bridge_to_fix->parent->children) { - struct pci_bus * silbling = pci_bus_b(tmp); - /* - * If the silbling has a higher secondary bus number - * and it's secondary is equal or smaller than our - * current upper limit, set the new upper limit to - * the bus number below the silbling's range: - */ - if (silbling->secondary > bridge_to_fix->subordinate - && silbling->secondary <= upper_limit) - upper_limit = silbling->secondary - 1; - } - - /* Show that the wanted subordinate number is not possible: */ - if (cardbus_bridge->subordinate > upper_limit) - printk(KERN_WARNING "Yenta: Upper limit for fixing this " - "bridge's parent bridge: #%02x\n", upper_limit); - - /* If we have room to increase the bridge's subordinate number, */ - if (bridge_to_fix->subordinate < upper_limit) { - - /* use the highest number of the hidden bus, within limits */ - unsigned char subordinate_to_assign = - min(cardbus_bridge->subordinate, upper_limit); - - printk(KERN_INFO "Yenta: Raising subordinate bus# of parent " - "bus (#%02x) from #%02x to #%02x\n", - bridge_to_fix->number, - bridge_to_fix->subordinate, subordinate_to_assign); - - /* Save the new subordinate in the bus struct of the bridge */ - bridge_to_fix->subordinate = subordinate_to_assign; - - /* and update the PCI config space with the new subordinate */ - pci_write_config_byte(bridge_to_fix->self, - PCI_SUBORDINATE_BUS, bridge_to_fix->subordinate); - } -} - /* * Initialize a cardbus controller. Make sure we have a usable * interrupt, and that we can map the cardbus area. Fill in the @@ -1172,7 +1094,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i /* We must finish initialization here */ - if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED, "yenta", socket)) { + if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, SA_SHIRQ, "yenta", socket)) { /* No IRQ or request_irq failed. Poll */ socket->cb_irq = 0; /* But zero is a valid IRQ number. */ init_timer(&socket->poll_timer); @@ -1191,8 +1113,6 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i yenta_get_socket_capabilities(socket, isa_interrupts); printk(KERN_INFO "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); - yenta_fixup_parent_bridge(dev->subordinate); - /* Register it with the pcmcia layer.. */ ret = pcmcia_register_socket(&socket->socket); if (ret == 0) { @@ -1312,7 +1232,6 @@ static struct pci_device_id yenta_table [] = { CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX21_XX11, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X515, TI12XX), - CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX12, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X420, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X620, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7410, TI12XX), diff --git a/trunk/drivers/pnp/card.c b/trunk/drivers/pnp/card.c index 227600cd6360..0b4adcb60df4 100644 --- a/trunk/drivers/pnp/card.c +++ b/trunk/drivers/pnp/card.c @@ -5,6 +5,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pnp/driver.c b/trunk/drivers/pnp/driver.c index e161423b4300..e54c15383193 100644 --- a/trunk/drivers/pnp/driver.c +++ b/trunk/drivers/pnp/driver.c @@ -5,6 +5,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pnp/isapnp/compat.c b/trunk/drivers/pnp/isapnp/compat.c index 0697ab88a9ac..3ff7e76b33bd 100644 --- a/trunk/drivers/pnp/isapnp/compat.c +++ b/trunk/drivers/pnp/isapnp/compat.c @@ -8,6 +8,7 @@ /* TODO: see if more isapnp functions are needed here */ +#include #include #include #include diff --git a/trunk/drivers/pnp/isapnp/core.c b/trunk/drivers/pnp/isapnp/core.c index f2e0179962e2..ac7c2bb6c69e 100644 --- a/trunk/drivers/pnp/isapnp/core.c +++ b/trunk/drivers/pnp/isapnp/core.c @@ -34,6 +34,7 @@ * 2003-08-11 Resource Management Updates - Adam Belay */ +#include #include #include #include diff --git a/trunk/drivers/pnp/isapnp/proc.c b/trunk/drivers/pnp/isapnp/proc.c index 958c11bedd0d..cf54b0a3628e 100644 --- a/trunk/drivers/pnp/isapnp/proc.c +++ b/trunk/drivers/pnp/isapnp/proc.c @@ -19,6 +19,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pnp/manager.c b/trunk/drivers/pnp/manager.c index 5026b345cb30..1d7a5b87f4cb 100644 --- a/trunk/drivers/pnp/manager.c +++ b/trunk/drivers/pnp/manager.c @@ -6,6 +6,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pnp/pnpacpi/core.c b/trunk/drivers/pnp/pnpacpi/core.c index 6cf34a63c790..f104577f73e0 100644 --- a/trunk/drivers/pnp/pnpacpi/core.c +++ b/trunk/drivers/pnp/pnpacpi/core.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/drivers/pnp/pnpacpi/rsparser.c b/trunk/drivers/pnp/pnpacpi/rsparser.c index 212268881857..3a4a644c2686 100644 --- a/trunk/drivers/pnp/pnpacpi/rsparser.c +++ b/trunk/drivers/pnp/pnpacpi/rsparser.c @@ -74,7 +74,7 @@ static void decode_irq_flags(int flag, int *triggering, int *polarity) static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi, - int triggering, int polarity, int shareable) + int triggering, int polarity) { int i = 0; int irq; @@ -95,9 +95,6 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi, return; } - if (shareable) - res->irq_resource[i].flags |= IORESOURCE_IRQ_SHAREABLE; - res->irq_resource[i].start = irq; res->irq_resource[i].end = irq; pcibios_penalize_isa_irq(irq, 1); @@ -197,8 +194,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, pnpacpi_parse_allocated_irqresource(res_table, res->data.irq.interrupts[i], res->data.irq.triggering, - res->data.irq.polarity, - res->data.irq.sharable); + res->data.irq.polarity); } break; @@ -259,8 +255,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, pnpacpi_parse_allocated_irqresource(res_table, res->data.extended_irq.interrupts[i], res->data.extended_irq.triggering, - res->data.extended_irq.polarity, - res->data.extended_irq.sharable); + res->data.extended_irq.polarity); } break; diff --git a/trunk/drivers/pnp/pnpbios/rsparser.c b/trunk/drivers/pnp/pnpbios/rsparser.c index ef508a4de557..c89c98a2cca8 100644 --- a/trunk/drivers/pnp/pnpbios/rsparser.c +++ b/trunk/drivers/pnp/pnpbios/rsparser.c @@ -3,6 +3,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/pnp/quirks.c b/trunk/drivers/pnp/quirks.c index e97ecefe8584..8936b0cb2ec3 100644 --- a/trunk/drivers/pnp/quirks.c +++ b/trunk/drivers/pnp/quirks.c @@ -11,6 +11,7 @@ * Copyright (c) 1999 Martin Mares */ +#include #include #include #include diff --git a/trunk/drivers/pnp/resource.c b/trunk/drivers/pnp/resource.c index 5c8ec21e1086..7bb892f58cc0 100644 --- a/trunk/drivers/pnp/resource.c +++ b/trunk/drivers/pnp/resource.c @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -395,8 +396,7 @@ int pnp_check_irq(struct pnp_dev * dev, int idx) /* check if the resource is already in use, skip if the * device is active because it itself may be in use */ if(!dev->active) { - if (request_irq(*irq, pnp_test_handler, - IRQF_DISABLED|IRQF_PROBE_SHARED, "pnp", NULL)) + if (request_irq(*irq, pnp_test_handler, SA_INTERRUPT, "pnp", NULL)) return 0; free_irq(*irq, NULL); } diff --git a/trunk/drivers/pnp/support.c b/trunk/drivers/pnp/support.c index 946a0dcd627d..61fe998944bd 100644 --- a/trunk/drivers/pnp/support.c +++ b/trunk/drivers/pnp/support.c @@ -5,6 +5,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/rapidio/rio-scan.c b/trunk/drivers/rapidio/rio-scan.c index 7bf7b2c88245..94e30fe4b8f3 100644 --- a/trunk/drivers/rapidio/rio-scan.c +++ b/trunk/drivers/rapidio/rio-scan.c @@ -10,6 +10,7 @@ * option) any later version. */ +#include #include #include diff --git a/trunk/drivers/rapidio/rio-sysfs.c b/trunk/drivers/rapidio/rio-sysfs.c index 5687b8fcbf93..bef9316e95df 100644 --- a/trunk/drivers/rapidio/rio-sysfs.c +++ b/trunk/drivers/rapidio/rio-sysfs.c @@ -10,6 +10,7 @@ * option) any later version. */ +#include #include #include #include diff --git a/trunk/drivers/rapidio/rio.c b/trunk/drivers/rapidio/rio.c index f644807da2f9..5e382470faa2 100644 --- a/trunk/drivers/rapidio/rio.c +++ b/trunk/drivers/rapidio/rio.c @@ -11,6 +11,7 @@ * option) any later version. */ +#include #include #include diff --git a/trunk/drivers/rtc/Kconfig b/trunk/drivers/rtc/Kconfig index f5b9f187a930..f2fc81a9074d 100644 --- a/trunk/drivers/rtc/Kconfig +++ b/trunk/drivers/rtc/Kconfig @@ -15,7 +15,7 @@ config RTC_CLASS help Generic RTC class support. If you say yes here, you will be allowed to plug one or more RTCs to your system. You will - probably want to enable one or more of the interfaces below. + probably want to enable one of more of the interfaces below. This driver can also be built as a module. If so, the module will be called rtc-class. @@ -182,22 +182,6 @@ config RTC_DRV_RS5C372 This driver can also be built as a module. If so, the module will be called rtc-rs5c372. -config RTC_DRV_S3C - tristate "Samsung S3C series SoC RTC" - depends on RTC_CLASS && ARCH_S3C2410 - help - RTC (Realtime Clock) driver for the clock inbuilt into the - Samsung S3C24XX series of SoCs. This can provide periodic - interrupt rates from 1Hz to 64Hz for user programs, and - wakeup from Alarm. - - The driver currently supports the common features on all the - S3C24XX range, such as the S3C2410, S3C2412, S3C2413, S3C2440 - and S3C2442. - - This driver can also be build as a module. If so, the module - will be called rtc-s3c. - config RTC_DRV_M48T86 tristate "ST M48T86/Dallas DS12887" depends on RTC_CLASS diff --git a/trunk/drivers/rtc/Makefile b/trunk/drivers/rtc/Makefile index 54220714ff49..da5e38774e13 100644 --- a/trunk/drivers/rtc/Makefile +++ b/trunk/drivers/rtc/Makefile @@ -19,7 +19,6 @@ obj-$(CONFIG_RTC_DRV_DS1742) += rtc-ds1742.o obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o obj-$(CONFIG_RTC_DRV_PCF8583) += rtc-pcf8583.o obj-$(CONFIG_RTC_DRV_RS5C372) += rtc-rs5c372.o -obj-$(CONFIG_RTC_DRV_S3C) += rtc-s3c.o obj-$(CONFIG_RTC_DRV_RS5C348) += rtc-rs5c348.o obj-$(CONFIG_RTC_DRV_M48T86) += rtc-m48t86.o obj-$(CONFIG_RTC_DRV_DS1553) += rtc-ds1553.o diff --git a/trunk/drivers/rtc/rtc-at91.c b/trunk/drivers/rtc/rtc-at91.c index dfd0ce86f6a0..b676f443c17e 100644 --- a/trunk/drivers/rtc/rtc-at91.c +++ b/trunk/drivers/rtc/rtc-at91.c @@ -293,7 +293,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev) AT91_RTC_CALEV); ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt, - IRQF_SHARED, "at91_rtc", pdev); + SA_SHIRQ, "at91_rtc", pdev); if (ret) { printk(KERN_ERR "at91_rtc: IRQ %d already in use.\n", AT91_ID_SYS); diff --git a/trunk/drivers/rtc/rtc-ds1553.c b/trunk/drivers/rtc/rtc-ds1553.c index 209001495474..762521a1419c 100644 --- a/trunk/drivers/rtc/rtc-ds1553.c +++ b/trunk/drivers/rtc/rtc-ds1553.c @@ -341,7 +341,7 @@ static int __init ds1553_rtc_probe(struct platform_device *pdev) if (pdata->irq >= 0) { writeb(0, ioaddr + RTC_INTERRUPTS); - if (request_irq(pdata->irq, ds1553_rtc_interrupt, IRQF_SHARED, + if (request_irq(pdata->irq, ds1553_rtc_interrupt, SA_SHIRQ, pdev->name, pdev) < 0) { dev_warn(&pdev->dev, "interrupt not available.\n"); pdata->irq = -1; diff --git a/trunk/drivers/rtc/rtc-pl031.c b/trunk/drivers/rtc/rtc-pl031.c index d6d1c5726b0e..ee538632660b 100644 --- a/trunk/drivers/rtc/rtc-pl031.c +++ b/trunk/drivers/rtc/rtc-pl031.c @@ -173,7 +173,7 @@ static int pl031_probe(struct amba_device *adev, void *id) goto out_no_remap; } - if (request_irq(adev->irq[0], pl031_interrupt, IRQF_DISABLED, + if (request_irq(adev->irq[0], pl031_interrupt, SA_INTERRUPT, "rtc-pl031", ldata->rtc)) { ret = -EIO; goto out_no_irq; diff --git a/trunk/drivers/rtc/rtc-s3c.c b/trunk/drivers/rtc/rtc-s3c.c deleted file mode 100644 index d6d1bff52b8e..000000000000 --- a/trunk/drivers/rtc/rtc-s3c.c +++ /dev/null @@ -1,607 +0,0 @@ -/* drivers/rtc/rtc-s3c.c - * - * Copyright (c) 2004,2006 Simtec Electronics - * Ben Dooks, - * http://armlinux.simtec.co.uk/ - * - * 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. - * - * S3C2410/S3C2440/S3C24XX Internal RTC Driver -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include - -/* I have yet to find an S3C implementation with more than one - * of these rtc blocks in */ - -static struct resource *s3c_rtc_mem; - -static void __iomem *s3c_rtc_base; -static int s3c_rtc_alarmno = NO_IRQ; -static int s3c_rtc_tickno = NO_IRQ; -static int s3c_rtc_freq = 1; - -static DEFINE_SPINLOCK(s3c_rtc_pie_lock); -static unsigned int tick_count; - -/* IRQ Handlers */ - -static irqreturn_t s3c_rtc_alarmirq(int irq, void *id, struct pt_regs *r) -{ - struct rtc_device *rdev = id; - - rtc_update_irq(&rdev->class_dev, 1, RTC_AF | RTC_IRQF); - return IRQ_HANDLED; -} - -static irqreturn_t s3c_rtc_tickirq(int irq, void *id, struct pt_regs *r) -{ - struct rtc_device *rdev = id; - - rtc_update_irq(&rdev->class_dev, tick_count++, RTC_PF | RTC_IRQF); - return IRQ_HANDLED; -} - -/* Update control registers */ -static void s3c_rtc_setaie(int to) -{ - unsigned int tmp; - - pr_debug("%s: aie=%d\n", __FUNCTION__, to); - - tmp = readb(S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN; - - if (to) - tmp |= S3C2410_RTCALM_ALMEN; - - writeb(tmp, S3C2410_RTCALM); -} - -static void s3c_rtc_setpie(int to) -{ - unsigned int tmp; - - pr_debug("%s: pie=%d\n", __FUNCTION__, to); - - spin_lock_irq(&s3c_rtc_pie_lock); - tmp = readb(S3C2410_TICNT) & ~S3C2410_TICNT_ENABLE; - - if (to) - tmp |= S3C2410_TICNT_ENABLE; - - writeb(tmp, S3C2410_TICNT); - spin_unlock_irq(&s3c_rtc_pie_lock); -} - -static void s3c_rtc_setfreq(int freq) -{ - unsigned int tmp; - - spin_lock_irq(&s3c_rtc_pie_lock); - tmp = readb(S3C2410_TICNT) & S3C2410_TICNT_ENABLE; - - s3c_rtc_freq = freq; - - tmp |= (128 / freq)-1; - - writeb(tmp, S3C2410_TICNT); - spin_unlock_irq(&s3c_rtc_pie_lock); -} - -/* Time read/write */ - -static int s3c_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) -{ - unsigned int have_retried = 0; - - retry_get_time: - rtc_tm->tm_min = readb(S3C2410_RTCMIN); - rtc_tm->tm_hour = readb(S3C2410_RTCHOUR); - rtc_tm->tm_mday = readb(S3C2410_RTCDATE); - rtc_tm->tm_mon = readb(S3C2410_RTCMON); - rtc_tm->tm_year = readb(S3C2410_RTCYEAR); - rtc_tm->tm_sec = readb(S3C2410_RTCSEC); - - /* the only way to work out wether the system was mid-update - * when we read it is to check the second counter, and if it - * is zero, then we re-try the entire read - */ - - if (rtc_tm->tm_sec == 0 && !have_retried) { - have_retried = 1; - goto retry_get_time; - } - - pr_debug("read time %02x.%02x.%02x %02x/%02x/%02x\n", - rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday, - rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec); - - BCD_TO_BIN(rtc_tm->tm_sec); - BCD_TO_BIN(rtc_tm->tm_min); - BCD_TO_BIN(rtc_tm->tm_hour); - BCD_TO_BIN(rtc_tm->tm_mday); - BCD_TO_BIN(rtc_tm->tm_mon); - BCD_TO_BIN(rtc_tm->tm_year); - - rtc_tm->tm_year += 100; - rtc_tm->tm_mon -= 1; - - return 0; -} - -static int s3c_rtc_settime(struct device *dev, struct rtc_time *tm) -{ - /* the rtc gets round the y2k problem by just not supporting it */ - - if (tm->tm_year < 100) - return -EINVAL; - - writeb(BIN2BCD(tm->tm_sec), S3C2410_RTCSEC); - writeb(BIN2BCD(tm->tm_min), S3C2410_RTCMIN); - writeb(BIN2BCD(tm->tm_hour), S3C2410_RTCHOUR); - writeb(BIN2BCD(tm->tm_mday), S3C2410_RTCDATE); - writeb(BIN2BCD(tm->tm_mon + 1), S3C2410_RTCMON); - writeb(BIN2BCD(tm->tm_year - 100), S3C2410_RTCYEAR); - - return 0; -} - -static int s3c_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm) -{ - struct rtc_time *alm_tm = &alrm->time; - unsigned int alm_en; - - alm_tm->tm_sec = readb(S3C2410_ALMSEC); - alm_tm->tm_min = readb(S3C2410_ALMMIN); - alm_tm->tm_hour = readb(S3C2410_ALMHOUR); - alm_tm->tm_mon = readb(S3C2410_ALMMON); - alm_tm->tm_mday = readb(S3C2410_ALMDATE); - alm_tm->tm_year = readb(S3C2410_ALMYEAR); - - alm_en = readb(S3C2410_RTCALM); - - pr_debug("read alarm %02x %02x.%02x.%02x %02x/%02x/%02x\n", - alm_en, - alm_tm->tm_year, alm_tm->tm_mon, alm_tm->tm_mday, - alm_tm->tm_hour, alm_tm->tm_min, alm_tm->tm_sec); - - - /* decode the alarm enable field */ - - if (alm_en & S3C2410_RTCALM_SECEN) - BCD_TO_BIN(alm_tm->tm_sec); - else - alm_tm->tm_sec = 0xff; - - if (alm_en & S3C2410_RTCALM_MINEN) - BCD_TO_BIN(alm_tm->tm_min); - else - alm_tm->tm_min = 0xff; - - if (alm_en & S3C2410_RTCALM_HOUREN) - BCD_TO_BIN(alm_tm->tm_hour); - else - alm_tm->tm_hour = 0xff; - - if (alm_en & S3C2410_RTCALM_DAYEN) - BCD_TO_BIN(alm_tm->tm_mday); - else - alm_tm->tm_mday = 0xff; - - if (alm_en & S3C2410_RTCALM_MONEN) { - BCD_TO_BIN(alm_tm->tm_mon); - alm_tm->tm_mon -= 1; - } else { - alm_tm->tm_mon = 0xff; - } - - if (alm_en & S3C2410_RTCALM_YEAREN) - BCD_TO_BIN(alm_tm->tm_year); - else - alm_tm->tm_year = 0xffff; - - return 0; -} - -static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) -{ - struct rtc_time *tm = &alrm->time; - unsigned int alrm_en; - - pr_debug("s3c_rtc_setalarm: %d, %02x/%02x/%02x %02x.%02x.%02x\n", - alrm->enabled, - tm->tm_mday & 0xff, tm->tm_mon & 0xff, tm->tm_year & 0xff, - tm->tm_hour & 0xff, tm->tm_min & 0xff, tm->tm_sec); - - - alrm_en = readb(S3C2410_RTCALM) & S3C2410_RTCALM_ALMEN; - writeb(0x00, S3C2410_RTCALM); - - if (tm->tm_sec < 60 && tm->tm_sec >= 0) { - alrm_en |= S3C2410_RTCALM_SECEN; - writeb(BIN2BCD(tm->tm_sec), S3C2410_ALMSEC); - } - - if (tm->tm_min < 60 && tm->tm_min >= 0) { - alrm_en |= S3C2410_RTCALM_MINEN; - writeb(BIN2BCD(tm->tm_min), S3C2410_ALMMIN); - } - - if (tm->tm_hour < 24 && tm->tm_hour >= 0) { - alrm_en |= S3C2410_RTCALM_HOUREN; - writeb(BIN2BCD(tm->tm_hour), S3C2410_ALMHOUR); - } - - pr_debug("setting S3C2410_RTCALM to %08x\n", alrm_en); - - writeb(alrm_en, S3C2410_RTCALM); - - if (0) { - alrm_en = readb(S3C2410_RTCALM); - alrm_en &= ~S3C2410_RTCALM_ALMEN; - writeb(alrm_en, S3C2410_RTCALM); - disable_irq_wake(s3c_rtc_alarmno); - } - - if (alrm->enabled) - enable_irq_wake(s3c_rtc_alarmno); - else - disable_irq_wake(s3c_rtc_alarmno); - - return 0; -} - -static int s3c_rtc_ioctl(struct device *dev, - unsigned int cmd, unsigned long arg) -{ - unsigned int ret = -ENOIOCTLCMD; - - switch (cmd) { - case RTC_AIE_OFF: - case RTC_AIE_ON: - s3c_rtc_setaie((cmd == RTC_AIE_ON) ? 1 : 0); - ret = 0; - break; - - case RTC_PIE_OFF: - case RTC_PIE_ON: - tick_count = 0; - s3c_rtc_setpie((cmd == RTC_PIE_ON) ? 1 : 0); - ret = 0; - break; - - case RTC_IRQP_READ: - ret = put_user(s3c_rtc_freq, (unsigned long __user *)arg); - break; - - case RTC_IRQP_SET: - /* check for power of 2 */ - - if ((arg & (arg-1)) != 0 || arg < 1) { - ret = -EINVAL; - goto exit; - } - - pr_debug("s3c2410_rtc: setting frequency %ld\n", arg); - - s3c_rtc_setfreq(arg); - ret = 0; - break; - - case RTC_UIE_ON: - case RTC_UIE_OFF: - ret = -EINVAL; - } - - exit: - return ret; -} - -static int s3c_rtc_proc(struct device *dev, struct seq_file *seq) -{ - unsigned int rtcalm = readb(S3C2410_RTCALM); - unsigned int ticnt = readb (S3C2410_TICNT); - - seq_printf(seq, "alarm_IRQ\t: %s\n", - (rtcalm & S3C2410_RTCALM_ALMEN) ? "yes" : "no" ); - - seq_printf(seq, "periodic_IRQ\t: %s\n", - (ticnt & S3C2410_TICNT_ENABLE) ? "yes" : "no" ); - - seq_printf(seq, "periodic_freq\t: %d\n", s3c_rtc_freq); - - return 0; -} - -static int s3c_rtc_open(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct rtc_device *rtc_dev = platform_get_drvdata(pdev); - int ret; - - ret = request_irq(s3c_rtc_alarmno, s3c_rtc_alarmirq, - SA_INTERRUPT, "s3c2410-rtc alarm", rtc_dev); - - if (ret) { - dev_err(dev, "IRQ%d error %d\n", s3c_rtc_alarmno, ret); - return ret; - } - - ret = request_irq(s3c_rtc_tickno, s3c_rtc_tickirq, - SA_INTERRUPT, "s3c2410-rtc tick", rtc_dev); - - if (ret) { - dev_err(dev, "IRQ%d error %d\n", s3c_rtc_tickno, ret); - goto tick_err; - } - - return ret; - - tick_err: - free_irq(s3c_rtc_alarmno, rtc_dev); - return ret; -} - -static void s3c_rtc_release(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct rtc_device *rtc_dev = platform_get_drvdata(pdev); - - /* do not clear AIE here, it may be needed for wake */ - - s3c_rtc_setpie(0); - free_irq(s3c_rtc_alarmno, rtc_dev); - free_irq(s3c_rtc_tickno, rtc_dev); -} - -static struct rtc_class_ops s3c_rtcops = { - .open = s3c_rtc_open, - .release = s3c_rtc_release, - .ioctl = s3c_rtc_ioctl, - .read_time = s3c_rtc_gettime, - .set_time = s3c_rtc_settime, - .read_alarm = s3c_rtc_getalarm, - .set_alarm = s3c_rtc_setalarm, - .proc = s3c_rtc_proc, -}; - -static void s3c_rtc_enable(struct platform_device *pdev, int en) -{ - unsigned int tmp; - - if (s3c_rtc_base == NULL) - return; - - if (!en) { - tmp = readb(S3C2410_RTCCON); - writeb(tmp & ~S3C2410_RTCCON_RTCEN, S3C2410_RTCCON); - - tmp = readb(S3C2410_TICNT); - writeb(tmp & ~S3C2410_TICNT_ENABLE, S3C2410_TICNT); - } else { - /* re-enable the device, and check it is ok */ - - if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_RTCEN) == 0){ - dev_info(&pdev->dev, "rtc disabled, re-enabling\n"); - - tmp = readb(S3C2410_RTCCON); - writeb(tmp | S3C2410_RTCCON_RTCEN , S3C2410_RTCCON); - } - - if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CNTSEL)){ - dev_info(&pdev->dev, "removing RTCCON_CNTSEL\n"); - - tmp = readb(S3C2410_RTCCON); - writeb(tmp& ~S3C2410_RTCCON_CNTSEL , S3C2410_RTCCON); - } - - if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CLKRST)){ - dev_info(&pdev->dev, "removing RTCCON_CLKRST\n"); - - tmp = readb(S3C2410_RTCCON); - writeb(tmp & ~S3C2410_RTCCON_CLKRST, S3C2410_RTCCON); - } - } -} - -static int s3c_rtc_remove(struct platform_device *dev) -{ - struct rtc_device *rtc = platform_get_drvdata(dev); - - platform_set_drvdata(dev, NULL); - rtc_device_unregister(rtc); - - s3c_rtc_setpie(0); - s3c_rtc_setaie(0); - - iounmap(s3c_rtc_base); - release_resource(s3c_rtc_mem); - kfree(s3c_rtc_mem); - - return 0; -} - -static int s3c_rtc_probe(struct platform_device *pdev) -{ - struct rtc_device *rtc; - struct resource *res; - int ret; - - pr_debug("%s: probe=%p\n", __FUNCTION__, pdev); - - /* find the IRQs */ - - s3c_rtc_tickno = platform_get_irq(pdev, 1); - if (s3c_rtc_tickno < 0) { - dev_err(&pdev->dev, "no irq for rtc tick\n"); - return -ENOENT; - } - - s3c_rtc_alarmno = platform_get_irq(pdev, 0); - if (s3c_rtc_alarmno < 0) { - dev_err(&pdev->dev, "no irq for alarm\n"); - return -ENOENT; - } - - pr_debug("s3c2410_rtc: tick irq %d, alarm irq %d\n", - s3c_rtc_tickno, s3c_rtc_alarmno); - - /* get the memory region */ - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res == NULL) { - dev_err(&pdev->dev, "failed to get memory region resource\n"); - return -ENOENT; - } - - s3c_rtc_mem = request_mem_region(res->start, - res->end-res->start+1, - pdev->name); - - if (s3c_rtc_mem == NULL) { - dev_err(&pdev->dev, "failed to reserve memory region\n"); - ret = -ENOENT; - goto err_nores; - } - - s3c_rtc_base = ioremap(res->start, res->end - res->start + 1); - if (s3c_rtc_base == NULL) { - dev_err(&pdev->dev, "failed ioremap()\n"); - ret = -EINVAL; - goto err_nomap; - } - - /* check to see if everything is setup correctly */ - - s3c_rtc_enable(pdev, 1); - - pr_debug("s3c2410_rtc: RTCCON=%02x\n", readb(S3C2410_RTCCON)); - - s3c_rtc_setfreq(s3c_rtc_freq); - - /* register RTC and exit */ - - rtc = rtc_device_register("s3c", &pdev->dev, &s3c_rtcops, - THIS_MODULE); - - if (IS_ERR(rtc)) { - dev_err(&pdev->dev, "cannot attach rtc\n"); - ret = PTR_ERR(rtc); - goto err_nortc; - } - - rtc->max_user_freq = 128; - - platform_set_drvdata(pdev, rtc); - return 0; - - err_nortc: - s3c_rtc_enable(pdev, 0); - iounmap(s3c_rtc_base); - - err_nomap: - release_resource(s3c_rtc_mem); - - err_nores: - return ret; -} - -#ifdef CONFIG_PM - -/* RTC Power management control */ - -static struct timespec s3c_rtc_delta; - -static int ticnt_save; - -static int s3c_rtc_suspend(struct platform_device *pdev, pm_message_t state) -{ - struct rtc_time tm; - struct timespec time; - - time.tv_nsec = 0; - - /* save TICNT for anyone using periodic interrupts */ - - ticnt_save = readb(S3C2410_TICNT); - - /* calculate time delta for suspend */ - - s3c_rtc_gettime(&pdev->dev, &tm); - rtc_tm_to_time(&tm, &time.tv_sec); - save_time_delta(&s3c_rtc_delta, &time); - s3c_rtc_enable(pdev, 0); - - return 0; -} - -static int s3c_rtc_resume(struct platform_device *pdev) -{ - struct rtc_time tm; - struct timespec time; - - time.tv_nsec = 0; - - s3c_rtc_enable(pdev, 1); - s3c_rtc_gettime(&pdev->dev, &tm); - rtc_tm_to_time(&tm, &time.tv_sec); - restore_time_delta(&s3c_rtc_delta, &time); - - writeb(ticnt_save, S3C2410_TICNT); - return 0; -} -#else -#define s3c_rtc_suspend NULL -#define s3c_rtc_resume NULL -#endif - -static struct platform_driver s3c2410_rtcdrv = { - .probe = s3c_rtc_probe, - .remove = s3c_rtc_remove, - .suspend = s3c_rtc_suspend, - .resume = s3c_rtc_resume, - .driver = { - .name = "s3c2410-rtc", - .owner = THIS_MODULE, - }, -}; - -static char __initdata banner[] = "S3C24XX RTC, (c) 2004,2006 Simtec Electronics\n"; - -static int __init s3c_rtc_init(void) -{ - printk(banner); - return platform_driver_register(&s3c2410_rtcdrv); -} - -static void __exit s3c_rtc_exit(void) -{ - platform_driver_unregister(&s3c2410_rtcdrv); -} - -module_init(s3c_rtc_init); -module_exit(s3c_rtc_exit); - -MODULE_DESCRIPTION("Samsung S3C RTC Driver"); -MODULE_AUTHOR("Ben Dooks "); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/rtc/rtc-sa1100.c b/trunk/drivers/rtc/rtc-sa1100.c index ee4b61ee67b0..9cd1cb304bb2 100644 --- a/trunk/drivers/rtc/rtc-sa1100.c +++ b/trunk/drivers/rtc/rtc-sa1100.c @@ -157,19 +157,19 @@ static int sa1100_rtc_open(struct device *dev) { int ret; - ret = request_irq(IRQ_RTC1Hz, sa1100_rtc_interrupt, IRQF_DISABLED, + ret = request_irq(IRQ_RTC1Hz, sa1100_rtc_interrupt, SA_INTERRUPT, "rtc 1Hz", dev); if (ret) { dev_err(dev, "IRQ %d already in use.\n", IRQ_RTC1Hz); goto fail_ui; } - ret = request_irq(IRQ_RTCAlrm, sa1100_rtc_interrupt, IRQF_DISABLED, + ret = request_irq(IRQ_RTCAlrm, sa1100_rtc_interrupt, SA_INTERRUPT, "rtc Alrm", dev); if (ret) { dev_err(dev, "IRQ %d already in use.\n", IRQ_RTCAlrm); goto fail_ai; } - ret = request_irq(IRQ_OST1, timer1_interrupt, IRQF_DISABLED, + ret = request_irq(IRQ_OST1, timer1_interrupt, SA_INTERRUPT, "rtc timer", dev); if (ret) { dev_err(dev, "IRQ %d already in use.\n", IRQ_OST1); diff --git a/trunk/drivers/rtc/rtc-vr41xx.c b/trunk/drivers/rtc/rtc-vr41xx.c index bb6d5ff24fd0..4b9291dd4443 100644 --- a/trunk/drivers/rtc/rtc-vr41xx.c +++ b/trunk/drivers/rtc/rtc-vr41xx.c @@ -345,11 +345,11 @@ static int __devinit rtc_probe(struct platform_device *pdev) spin_unlock_irq(&rtc_lock); irq = ELAPSEDTIME_IRQ; - retval = request_irq(irq, elapsedtime_interrupt, IRQF_DISABLED, + retval = request_irq(irq, elapsedtime_interrupt, SA_INTERRUPT, "elapsed_time", pdev); if (retval == 0) { irq = RTCLONG1_IRQ; - retval = request_irq(irq, rtclong1_interrupt, IRQF_DISABLED, + retval = request_irq(irq, rtclong1_interrupt, SA_INTERRUPT, "rtclong1", pdev); } diff --git a/trunk/drivers/s390/block/dasd.c b/trunk/drivers/s390/block/dasd.c index 4bf03fb67f8d..2dc179b14ce6 100644 --- a/trunk/drivers/s390/block/dasd.c +++ b/trunk/drivers/s390/block/dasd.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/s390/block/dasd_devmap.c b/trunk/drivers/s390/block/dasd_devmap.c index d7295386821c..9e9ae7179602 100644 --- a/trunk/drivers/s390/block/dasd_devmap.c +++ b/trunk/drivers/s390/block/dasd_devmap.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/s390/block/dasd_diag.c b/trunk/drivers/s390/block/dasd_diag.c index 23fa0b289173..4002f6c1c1b3 100644 --- a/trunk/drivers/s390/block/dasd_diag.c +++ b/trunk/drivers/s390/block/dasd_diag.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/s390/block/dasd_eckd.c b/trunk/drivers/s390/block/dasd_eckd.c index 2e655f466743..0dfab30e8089 100644 --- a/trunk/drivers/s390/block/dasd_eckd.c +++ b/trunk/drivers/s390/block/dasd_eckd.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/s390/block/dasd_erp.c b/trunk/drivers/s390/block/dasd_erp.c index 58a65097922b..4108d96f6a5a 100644 --- a/trunk/drivers/s390/block/dasd_erp.c +++ b/trunk/drivers/s390/block/dasd_erp.c @@ -9,6 +9,7 @@ * */ +#include #include #include diff --git a/trunk/drivers/s390/block/dasd_fba.c b/trunk/drivers/s390/block/dasd_fba.c index 808434d38526..bb7755b9b19d 100644 --- a/trunk/drivers/s390/block/dasd_fba.c +++ b/trunk/drivers/s390/block/dasd_fba.c @@ -6,6 +6,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/s390/block/dasd_genhd.c b/trunk/drivers/s390/block/dasd_genhd.c index 12c7d296eaa8..61ffde718a7a 100644 --- a/trunk/drivers/s390/block/dasd_genhd.c +++ b/trunk/drivers/s390/block/dasd_genhd.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/s390/block/dasd_ioctl.c b/trunk/drivers/s390/block/dasd_ioctl.c index e97f5316ad2d..302bcd0f28be 100644 --- a/trunk/drivers/s390/block/dasd_ioctl.c +++ b/trunk/drivers/s390/block/dasd_ioctl.c @@ -9,6 +9,7 @@ * * i/o controls for the dasd driver. */ +#include #include #include #include diff --git a/trunk/drivers/s390/block/dasd_proc.c b/trunk/drivers/s390/block/dasd_proc.c index bfa010f6dab2..ad23aede356c 100644 --- a/trunk/drivers/s390/block/dasd_proc.c +++ b/trunk/drivers/s390/block/dasd_proc.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/con3215.c b/trunk/drivers/s390/char/con3215.c index f25c6d116f6f..606f6ad285a0 100644 --- a/trunk/drivers/s390/char/con3215.c +++ b/trunk/drivers/s390/char/con3215.c @@ -11,6 +11,7 @@ * Dan Morrison, IBM Corporation (dmorriso@cse.buffalo.edu) */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/con3270.c b/trunk/drivers/s390/char/con3270.c index 7566be890688..ef607a1de55a 100644 --- a/trunk/drivers/s390/char/con3270.c +++ b/trunk/drivers/s390/char/con3270.c @@ -8,6 +8,7 @@ * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/ctrlchar.c b/trunk/drivers/s390/char/ctrlchar.c index 0ea6f36a2527..be463242cf0f 100644 --- a/trunk/drivers/s390/char/ctrlchar.c +++ b/trunk/drivers/s390/char/ctrlchar.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/fs3270.c b/trunk/drivers/s390/char/fs3270.c index 6099c14de429..a6415377bc73 100644 --- a/trunk/drivers/s390/char/fs3270.c +++ b/trunk/drivers/s390/char/fs3270.c @@ -8,6 +8,7 @@ * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/keyboard.c b/trunk/drivers/s390/char/keyboard.c index 547ef906ae2c..d4d2ff0a9da2 100644 --- a/trunk/drivers/s390/char/keyboard.c +++ b/trunk/drivers/s390/char/keyboard.c @@ -7,6 +7,7 @@ * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/raw3270.c b/trunk/drivers/s390/char/raw3270.c index e95b56f810db..3c1314b7391b 100644 --- a/trunk/drivers/s390/char/raw3270.c +++ b/trunk/drivers/s390/char/raw3270.c @@ -8,6 +8,7 @@ * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/sclp.c b/trunk/drivers/s390/char/sclp.c index 985d1613baaa..4138564402b8 100644 --- a/trunk/drivers/s390/char/sclp.c +++ b/trunk/drivers/s390/char/sclp.c @@ -383,7 +383,6 @@ void sclp_sync_wait(void) { unsigned long psw_mask; - unsigned long flags; unsigned long cr0, cr0_sync; u64 timeout; @@ -396,11 +395,9 @@ sclp_sync_wait(void) sclp_tod_from_jiffies(sclp_request_timer.expires - jiffies); } - local_irq_save(flags); /* Prevent bottom half from executing once we force interrupts open */ local_bh_disable(); /* Enable service-signal interruption, disable timer interrupts */ - trace_hardirqs_on(); __ctl_store(cr0, 0, 0); cr0_sync = cr0; cr0_sync |= 0x00000200; @@ -418,10 +415,11 @@ sclp_sync_wait(void) barrier(); cpu_relax(); } - local_irq_disable(); + /* Restore interrupt settings */ + asm volatile ("SSM 0(%0)" + : : "a" (&psw_mask) : "memory"); __ctl_load(cr0, 0, 0); - _local_bh_enable(); - local_irq_restore(flags); + __local_bh_enable(); } EXPORT_SYMBOL(sclp_sync_wait); diff --git a/trunk/drivers/s390/char/sclp_con.c b/trunk/drivers/s390/char/sclp_con.c index 86864f641716..10ef22f13541 100644 --- a/trunk/drivers/s390/char/sclp_con.c +++ b/trunk/drivers/s390/char/sclp_con.c @@ -8,6 +8,7 @@ * Martin Schwidefsky */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/sclp_cpi.c b/trunk/drivers/s390/char/sclp_cpi.c index 732dfbdb85c4..80f7f31310e6 100644 --- a/trunk/drivers/s390/char/sclp_cpi.c +++ b/trunk/drivers/s390/char/sclp_cpi.c @@ -5,6 +5,7 @@ * SCLP Control-Program Identification. */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/sclp_quiesce.c b/trunk/drivers/s390/char/sclp_quiesce.c index 32004aae95c1..a4c53c172db6 100644 --- a/trunk/drivers/s390/char/sclp_quiesce.c +++ b/trunk/drivers/s390/char/sclp_quiesce.c @@ -7,6 +7,7 @@ * Peter Oberparleiter */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/sclp_rw.c b/trunk/drivers/s390/char/sclp_rw.c index 0c92d3909cca..91e93c78f57a 100644 --- a/trunk/drivers/s390/char/sclp_rw.c +++ b/trunk/drivers/s390/char/sclp_rw.c @@ -8,6 +8,7 @@ * Martin Schwidefsky */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/sclp_tty.c b/trunk/drivers/s390/char/sclp_tty.c index f6cf9023039e..6cbf067f1a8f 100644 --- a/trunk/drivers/s390/char/sclp_tty.c +++ b/trunk/drivers/s390/char/sclp_tty.c @@ -8,6 +8,7 @@ * Martin Schwidefsky */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/sclp_vt220.c b/trunk/drivers/s390/char/sclp_vt220.c index 54fba6f17188..9e02625c82cf 100644 --- a/trunk/drivers/s390/char/sclp_vt220.c +++ b/trunk/drivers/s390/char/sclp_vt220.c @@ -7,6 +7,7 @@ * Author(s): Peter Oberparleiter */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/tape.h b/trunk/drivers/s390/char/tape.h index 1f4c89967be4..cd51ace8b610 100644 --- a/trunk/drivers/s390/char/tape.h +++ b/trunk/drivers/s390/char/tape.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/s390/char/tape_34xx.c b/trunk/drivers/s390/char/tape_34xx.c index 48b4d30a7256..d4f2da738078 100644 --- a/trunk/drivers/s390/char/tape_34xx.c +++ b/trunk/drivers/s390/char/tape_34xx.c @@ -8,6 +8,7 @@ * Martin Schwidefsky */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/tape_3590.c b/trunk/drivers/s390/char/tape_3590.c index 928cbefc49d5..d71ef1adea59 100644 --- a/trunk/drivers/s390/char/tape_3590.c +++ b/trunk/drivers/s390/char/tape_3590.c @@ -8,6 +8,7 @@ * Martin Schwidefsky */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/tape_block.c b/trunk/drivers/s390/char/tape_block.c index 3225fcd1dcb4..b70d92690242 100644 --- a/trunk/drivers/s390/char/tape_block.c +++ b/trunk/drivers/s390/char/tape_block.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/s390/char/tape_char.c b/trunk/drivers/s390/char/tape_char.c index 97f75237bed6..5ce7ca38ace0 100644 --- a/trunk/drivers/s390/char/tape_char.c +++ b/trunk/drivers/s390/char/tape_char.c @@ -10,6 +10,7 @@ * Martin Schwidefsky */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/tape_core.c b/trunk/drivers/s390/char/tape_core.c index 122b4d8965c3..e6e4086d3224 100644 --- a/trunk/drivers/s390/char/tape_core.c +++ b/trunk/drivers/s390/char/tape_core.c @@ -11,6 +11,7 @@ * Stefan Bader */ +#include #include #include // for kernel parameters #include // for requesting modules diff --git a/trunk/drivers/s390/char/tape_proc.c b/trunk/drivers/s390/char/tape_proc.c index 655d375ab22b..5fec0a10cc3d 100644 --- a/trunk/drivers/s390/char/tape_proc.c +++ b/trunk/drivers/s390/char/tape_proc.c @@ -11,6 +11,7 @@ * PROCFS Functions */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/tape_std.c b/trunk/drivers/s390/char/tape_std.c index 7a76ec413a3a..99cf881f41db 100644 --- a/trunk/drivers/s390/char/tape_std.c +++ b/trunk/drivers/s390/char/tape_std.c @@ -11,6 +11,7 @@ * Stefan Bader */ +#include #include #include #include diff --git a/trunk/drivers/s390/char/tty3270.c b/trunk/drivers/s390/char/tty3270.c index f496f236b9c0..7d26a3e4cb80 100644 --- a/trunk/drivers/s390/char/tty3270.c +++ b/trunk/drivers/s390/char/tty3270.c @@ -8,6 +8,7 @@ * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation */ +#include #include #include #include diff --git a/trunk/drivers/s390/cio/blacklist.c b/trunk/drivers/s390/cio/blacklist.c index 12c2d6b746e6..15b895496a45 100644 --- a/trunk/drivers/s390/cio/blacklist.c +++ b/trunk/drivers/s390/cio/blacklist.c @@ -9,6 +9,7 @@ * Arnd Bergmann (arndb@de.ibm.com) */ +#include #include #include #include diff --git a/trunk/drivers/s390/cio/chsc.c b/trunk/drivers/s390/cio/chsc.c index a01f3bba4a7b..b00f3ed051a0 100644 --- a/trunk/drivers/s390/cio/chsc.c +++ b/trunk/drivers/s390/cio/chsc.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/s390/cio/cio.c b/trunk/drivers/s390/cio/cio.c index 6fec90eab00e..5b20d8c9c025 100644 --- a/trunk/drivers/s390/cio/cio.c +++ b/trunk/drivers/s390/cio/cio.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -147,7 +148,7 @@ cio_tpi(void) sch->driver->irq(&sch->dev); spin_unlock(&sch->lock); irq_exit (); - _local_bh_enable(); + __local_bh_enable(); return 1; } diff --git a/trunk/drivers/s390/cio/device.c b/trunk/drivers/s390/cio/device.c index 67f0de6aed33..eafde43e8410 100644 --- a/trunk/drivers/s390/cio/device.c +++ b/trunk/drivers/s390/cio/device.c @@ -8,6 +8,7 @@ * Cornelia Huck (cornelia.huck@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com) */ +#include #include #include #include diff --git a/trunk/drivers/s390/cio/device_fsm.c b/trunk/drivers/s390/cio/device_fsm.c index cb1af0b6f033..7d0dd72635eb 100644 --- a/trunk/drivers/s390/cio/device_fsm.c +++ b/trunk/drivers/s390/cio/device_fsm.c @@ -9,6 +9,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/s390/cio/device_id.c b/trunk/drivers/s390/cio/device_id.c index 438db483035d..e60b2d8103b8 100644 --- a/trunk/drivers/s390/cio/device_id.c +++ b/trunk/drivers/s390/cio/device_id.c @@ -10,6 +10,7 @@ */ #include +#include #include #include diff --git a/trunk/drivers/s390/cio/device_ops.c b/trunk/drivers/s390/cio/device_ops.c index a60124264bee..b266ad8e14ff 100644 --- a/trunk/drivers/s390/cio/device_ops.c +++ b/trunk/drivers/s390/cio/device_ops.c @@ -6,6 +6,7 @@ * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) * Cornelia Huck (cornelia.huck@de.ibm.com) */ +#include #include #include #include diff --git a/trunk/drivers/s390/cio/device_pgid.c b/trunk/drivers/s390/cio/device_pgid.c index 54cb64ed0786..85b1020a1fcc 100644 --- a/trunk/drivers/s390/cio/device_pgid.c +++ b/trunk/drivers/s390/cio/device_pgid.c @@ -9,6 +9,7 @@ * Path Group ID functions. */ +#include #include #include diff --git a/trunk/drivers/s390/cio/device_status.c b/trunk/drivers/s390/cio/device_status.c index 14bef2c179bf..6c762b43f921 100644 --- a/trunk/drivers/s390/cio/device_status.c +++ b/trunk/drivers/s390/cio/device_status.c @@ -9,6 +9,7 @@ * Status accumulation and basic sense functions. */ +#include #include #include diff --git a/trunk/drivers/s390/cio/qdio.c b/trunk/drivers/s390/cio/qdio.c index b70039af70d6..96f519281d92 100644 --- a/trunk/drivers/s390/cio/qdio.c +++ b/trunk/drivers/s390/cio/qdio.c @@ -30,6 +30,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include diff --git a/trunk/drivers/s390/net/fsm.c b/trunk/drivers/s390/net/fsm.c index 2c1db8036b7c..7145e2134cf0 100644 --- a/trunk/drivers/s390/net/fsm.c +++ b/trunk/drivers/s390/net/fsm.c @@ -4,6 +4,7 @@ */ #include "fsm.h" +#include #include #include diff --git a/trunk/drivers/s390/net/iucv.c b/trunk/drivers/s390/net/iucv.c index 189a49275433..e0c7deb98831 100644 --- a/trunk/drivers/s390/net/iucv.c +++ b/trunk/drivers/s390/net/iucv.c @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/trunk/drivers/s390/net/qeth_eddp.c b/trunk/drivers/s390/net/qeth_eddp.c index 8491598f9149..38aad8321456 100644 --- a/trunk/drivers/s390/net/qeth_eddp.c +++ b/trunk/drivers/s390/net/qeth_eddp.c @@ -8,6 +8,7 @@ * Author(s): Thomas Spatzier * */ +#include #include #include #include diff --git a/trunk/drivers/s390/net/qeth_main.c b/trunk/drivers/s390/net/qeth_main.c index 8e8963f15731..56009d768326 100644 --- a/trunk/drivers/s390/net/qeth_main.c +++ b/trunk/drivers/s390/net/qeth_main.c @@ -27,6 +27,7 @@ */ +#include #include #include #include @@ -84,8 +85,6 @@ static debug_info_t *qeth_dbf_qerr = NULL; DEFINE_PER_CPU(char[256], qeth_dbf_txt_buf); -static struct lock_class_key qdio_out_skb_queue_key; - /** * some more definitions and declarations */ @@ -3231,9 +3230,6 @@ qeth_alloc_qdio_buffers(struct qeth_card *card) &card->qdio.out_qs[i]->qdio_bufs[j]; skb_queue_head_init(&card->qdio.out_qs[i]->bufs[j]. skb_list); - lockdep_set_class( - &card->qdio.out_qs[i]->bufs[j].skb_list.lock, - &qdio_out_skb_queue_key); INIT_LIST_HEAD(&card->qdio.out_qs[i]->bufs[j].ctx_list); } } @@ -5277,7 +5273,6 @@ qeth_free_vlan_buffer(struct qeth_card *card, struct qeth_qdio_out_buffer *buf, struct sk_buff_head tmp_list; skb_queue_head_init(&tmp_list); - lockdep_set_class(&tmp_list.lock, &qdio_out_skb_queue_key); for(i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i){ while ((skb = skb_dequeue(&buf->skb_list))){ if (vlan_tx_tag_present(skb) && diff --git a/trunk/drivers/s390/s390mach.c b/trunk/drivers/s390/s390mach.c index ffb3677e354f..8dc75002acbe 100644 --- a/trunk/drivers/s390/s390mach.c +++ b/trunk/drivers/s390/s390mach.c @@ -8,6 +8,7 @@ * Martin Schwidefsky (schwidefsky@de.ibm.com) */ +#include #include #include #include @@ -378,8 +379,6 @@ s390_do_machine_check(struct pt_regs *regs) struct mcck_struct *mcck; int umode; - lockdep_off(); - mci = (struct mci *) &S390_lowcore.mcck_interruption_code; mcck = &__get_cpu_var(cpu_mcck); umode = user_mode(regs); @@ -484,7 +483,6 @@ s390_do_machine_check(struct pt_regs *regs) mcck->warning = 1; set_thread_flag(TIF_MCCK_PENDING); } - lockdep_on(); } /* diff --git a/trunk/drivers/s390/scsi/zfcp_erp.c b/trunk/drivers/s390/scsi/zfcp_erp.c index 8ec8da0beaa8..909731b99d26 100644 --- a/trunk/drivers/s390/scsi/zfcp_erp.c +++ b/trunk/drivers/s390/scsi/zfcp_erp.c @@ -2168,9 +2168,9 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, &adapter->status); ZFCP_LOG_DEBUG("Doing exchange config data\n"); - write_lock_irq(&adapter->erp_lock); + write_lock(&adapter->erp_lock); zfcp_erp_action_to_running(erp_action); - write_unlock_irq(&adapter->erp_lock); + write_unlock(&adapter->erp_lock); zfcp_erp_timeout_init(erp_action); if (zfcp_fsf_exchange_config_data(erp_action)) { retval = ZFCP_ERP_FAILED; @@ -2236,9 +2236,9 @@ zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) adapter = erp_action->adapter; atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); - write_lock_irq(&adapter->erp_lock); + write_lock(&adapter->erp_lock); zfcp_erp_action_to_running(erp_action); - write_unlock_irq(&adapter->erp_lock); + write_unlock(&adapter->erp_lock); zfcp_erp_timeout_init(erp_action); ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL); diff --git a/trunk/drivers/s390/scsi/zfcp_qdio.c b/trunk/drivers/s390/scsi/zfcp_qdio.c index 49ea5add4abc..345a191926a4 100644 --- a/trunk/drivers/s390/scsi/zfcp_qdio.c +++ b/trunk/drivers/s390/scsi/zfcp_qdio.c @@ -427,7 +427,6 @@ int zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr) { struct zfcp_fsf_req *fsf_req; - unsigned long flags; /* invalid (per convention used in this driver) */ if (unlikely(!sbale_addr)) { @@ -439,15 +438,15 @@ zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr) fsf_req = (struct zfcp_fsf_req *) sbale_addr; /* serialize with zfcp_fsf_req_dismiss_all */ - spin_lock_irqsave(&adapter->fsf_req_list_lock, flags); + spin_lock(&adapter->fsf_req_list_lock); if (list_empty(&adapter->fsf_req_list_head)) { - spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); + spin_unlock(&adapter->fsf_req_list_lock); return 0; } list_del(&fsf_req->list); atomic_dec(&adapter->fsf_reqs_active); - spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); - + spin_unlock(&adapter->fsf_req_list_lock); + if (unlikely(adapter != fsf_req->adapter)) { ZFCP_LOG_NORMAL("bug: invalid reqid (fsf_req=%p, " "fsf_req->adapter=%p, adapter=%p)\n", diff --git a/trunk/drivers/s390/sysinfo.c b/trunk/drivers/s390/sysinfo.c index d1c1e75bfd60..66da840c9316 100644 --- a/trunk/drivers/s390/sysinfo.c +++ b/trunk/drivers/s390/sysinfo.c @@ -5,6 +5,7 @@ * Author(s): Ulrich Weigand (Ulrich.Weigand@de.ibm.com) */ +#include #include #include #include diff --git a/trunk/drivers/sbus/char/aurora.c b/trunk/drivers/sbus/char/aurora.c index 4fdb2c932210..015db40ad8a4 100644 --- a/trunk/drivers/sbus/char/aurora.c +++ b/trunk/drivers/sbus/char/aurora.c @@ -337,19 +337,19 @@ static int aurora_probe(void) printk("intr pri %d\n", grrr); #endif if ((bp->irq=irqs[bn]) && valid_irq(bp->irq) && - !request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED, "sio16", bp)) { + !request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) { free_irq(bp->irq|0x30, bp); } else if ((bp->irq=prom_getint(sdev->prom_node, "bintr")) && valid_irq(bp->irq) && - !request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED, "sio16", bp)) { + !request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) { free_irq(bp->irq|0x30, bp); } else if ((bp->irq=prom_getint(sdev->prom_node, "intr")) && valid_irq(bp->irq) && - !request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED, "sio16", bp)) { + !request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) { free_irq(bp->irq|0x30, bp); } else for(grrr=0;grrrirq=type_1_irq[grrr])&&!request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED, "sio16", bp)) { + if ((bp->irq=type_1_irq[grrr])&&!request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) { free_irq(bp->irq|0x30, bp); break; } else { @@ -909,14 +909,14 @@ static int aurora_setup_board(struct Aurora_board * bp) #ifdef AURORA_ALLIRQ int i; for (i = 0; i < AURORA_ALLIRQ; i++) { - error = request_irq(allirq[i]|0x30, aurora_interrupt, IRQF_SHARED, + error = request_irq(allirq[i]|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp); if (error) printk(KERN_ERR "IRQ%d request error %d\n", allirq[i], error); } #else - error = request_irq(bp->irq|0x30, aurora_interrupt, IRQF_SHARED, + error = request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp); if (error) { printk(KERN_ERR "IRQ request error %d\n", error); diff --git a/trunk/drivers/sbus/char/bbc_i2c.c b/trunk/drivers/sbus/char/bbc_i2c.c index 7186235594f9..73634371393b 100644 --- a/trunk/drivers/sbus/char/bbc_i2c.c +++ b/trunk/drivers/sbus/char/bbc_i2c.c @@ -377,7 +377,7 @@ static int __init attach_one_i2c(struct linux_ebus_device *edev, int index) bp->waiting = 0; init_waitqueue_head(&bp->wq); if (request_irq(edev->irqs[0], bbc_i2c_interrupt, - IRQF_SHARED, "bbc_i2c", bp)) + SA_SHIRQ, "bbc_i2c", bp)) goto fail; bp->index = index; diff --git a/trunk/drivers/sbus/char/cpwatchdog.c b/trunk/drivers/sbus/char/cpwatchdog.c index 836a58bb0305..21737b7e86a1 100644 --- a/trunk/drivers/sbus/char/cpwatchdog.c +++ b/trunk/drivers/sbus/char/cpwatchdog.c @@ -301,7 +301,7 @@ static int wd_open(struct inode *inode, struct file *f) { if (request_irq(wd_dev.irq, &wd_interrupt, - IRQF_SHARED, + SA_SHIRQ, WD_OBPNAME, (void *)wd_dev.regs)) { printk("%s: Cannot register IRQ %d\n", diff --git a/trunk/drivers/sbus/char/envctrl.c b/trunk/drivers/sbus/char/envctrl.c index 063e676a3ac0..cf97e9efe9b6 100644 --- a/trunk/drivers/sbus/char/envctrl.c +++ b/trunk/drivers/sbus/char/envctrl.c @@ -22,6 +22,7 @@ #define __KERNEL_SYSCALLS__ static int errno; +#include #include #include #include diff --git a/trunk/drivers/sbus/char/flash.c b/trunk/drivers/sbus/char/flash.c index fa2418f7ad39..31b8a5f6116f 100644 --- a/trunk/drivers/sbus/char/flash.c +++ b/trunk/drivers/sbus/char/flash.c @@ -4,6 +4,7 @@ * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) */ +#include #include #include #include diff --git a/trunk/drivers/sbus/char/openprom.c b/trunk/drivers/sbus/char/openprom.c index 293bb2fdb1d5..d7e4bb41bd79 100644 --- a/trunk/drivers/sbus/char/openprom.c +++ b/trunk/drivers/sbus/char/openprom.c @@ -29,6 +29,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/sbus/dvma.c b/trunk/drivers/sbus/dvma.c index 57e1526746a2..378a1d68024d 100644 --- a/trunk/drivers/sbus/dvma.c +++ b/trunk/drivers/sbus/dvma.c @@ -3,6 +3,7 @@ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include #include diff --git a/trunk/drivers/sbus/sbus.c b/trunk/drivers/sbus/sbus.c index 16b59773c0bb..387a6aa8c020 100644 --- a/trunk/drivers/sbus/sbus.c +++ b/trunk/drivers/sbus/sbus.c @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/trunk/drivers/scsi/3w-9xxx.c b/trunk/drivers/scsi/3w-9xxx.c index 5a9475e56d0e..b003baf8d404 100644 --- a/trunk/drivers/scsi/3w-9xxx.c +++ b/trunk/drivers/scsi/3w-9xxx.c @@ -2122,7 +2122,7 @@ static int __devinit twa_probe(struct pci_dev *pdev, const struct pci_device_id TW_PARAM_PORTCOUNT, TW_PARAM_PORTCOUNT_LENGTH))); /* Now setup the interrupt handler */ - retval = request_irq(pdev->irq, twa_interrupt, IRQF_SHARED, "3w-9xxx", tw_dev); + retval = request_irq(pdev->irq, twa_interrupt, SA_SHIRQ, "3w-9xxx", tw_dev); if (retval) { TW_PRINTK(tw_dev->host, TW_DRIVER, 0x30, "Error requesting IRQ"); goto out_remove_host; diff --git a/trunk/drivers/scsi/3w-xxxx.c b/trunk/drivers/scsi/3w-xxxx.c index f3a5f422a8e4..17dbd4ac8692 100644 --- a/trunk/drivers/scsi/3w-xxxx.c +++ b/trunk/drivers/scsi/3w-xxxx.c @@ -2397,7 +2397,7 @@ static int __devinit tw_probe(struct pci_dev *pdev, const struct pci_device_id * printk(KERN_WARNING "3w-xxxx: scsi%d: Found a 3ware Storage Controller at 0x%x, IRQ: %d.\n", host->host_no, tw_dev->base_addr, pdev->irq); /* Now setup the interrupt handler */ - retval = request_irq(pdev->irq, tw_interrupt, IRQF_SHARED, "3w-xxxx", tw_dev); + retval = request_irq(pdev->irq, tw_interrupt, SA_SHIRQ, "3w-xxxx", tw_dev); if (retval) { printk(KERN_WARNING "3w-xxxx: Error requesting IRQ."); goto out_remove_host; diff --git a/trunk/drivers/scsi/53c700.c b/trunk/drivers/scsi/53c700.c index 657a3ab75399..3c683dc23541 100644 --- a/trunk/drivers/scsi/53c700.c +++ b/trunk/drivers/scsi/53c700.c @@ -114,6 +114,7 @@ * */ #define NCR_700_VERSION "2.8" +#include #include #include #include @@ -173,7 +174,6 @@ STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); STATIC void NCR_700_chip_setup(struct Scsi_Host *host); STATIC void NCR_700_chip_reset(struct Scsi_Host *host); -STATIC int NCR_700_slave_alloc(struct scsi_device *SDpnt); STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt); STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt); static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth); @@ -183,6 +183,10 @@ STATIC struct device_attribute *NCR_700_dev_attrs[]; STATIC struct scsi_transport_template *NCR_700_transport_template = NULL; +struct NCR_700_sense { + unsigned char cmnd[MAX_COMMAND_SIZE]; +}; + static char *NCR_700_phase[] = { "", "after selection", @@ -330,7 +334,6 @@ NCR_700_detect(struct scsi_host_template *tpnt, tpnt->use_clustering = ENABLE_CLUSTERING; tpnt->slave_configure = NCR_700_slave_configure; tpnt->slave_destroy = NCR_700_slave_destroy; - tpnt->slave_alloc = NCR_700_slave_alloc; tpnt->change_queue_depth = NCR_700_change_queue_depth; tpnt->change_queue_type = NCR_700_change_queue_type; @@ -609,10 +612,9 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata, struct NCR_700_command_slot *slot = (struct NCR_700_command_slot *)SCp->host_scribble; - dma_unmap_single(hostdata->dev, slot->pCmd, - sizeof(SCp->cmnd), DMA_TO_DEVICE); + NCR_700_unmap(hostdata, SCp, slot); if (slot->flags == NCR_700_FLAG_AUTOSENSE) { - char *cmnd = NCR_700_get_sense_cmnd(SCp->device); + struct NCR_700_sense *sense = SCp->device->hostdata; #ifdef NCR_700_DEBUG printk(" ORIGINAL CMD %p RETURNED %d, new return is %d sense is\n", SCp, SCp->cmnd[7], result); @@ -623,9 +625,10 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata, /* restore the old result if the request sense was * successful */ if(result == 0) - result = cmnd[7]; + result = sense->cmnd[7]; } else - NCR_700_unmap(hostdata, SCp, slot); + dma_unmap_single(hostdata->dev, slot->pCmd, + sizeof(SCp->cmnd), DMA_TO_DEVICE); free_slot(slot, hostdata); #ifdef NCR_700_DEBUG @@ -967,15 +970,14 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, status_byte(hostdata->status[0]) == COMMAND_TERMINATED) { struct NCR_700_command_slot *slot = (struct NCR_700_command_slot *)SCp->host_scribble; - if(slot->flags == NCR_700_FLAG_AUTOSENSE) { + if(SCp->cmnd[0] == REQUEST_SENSE) { /* OOPS: bad device, returning another * contingent allegiance condition */ scmd_printk(KERN_ERR, SCp, "broken device is looping in contingent allegiance: ignoring\n"); NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); } else { - char *cmnd = - NCR_700_get_sense_cmnd(SCp->device); + struct NCR_700_sense *sense = SCp->device->hostdata; #ifdef NCR_DEBUG scsi_print_command(SCp); printk(" cmd %p has status %d, requesting sense\n", @@ -993,21 +995,21 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, sizeof(SCp->cmnd), DMA_TO_DEVICE); - cmnd[0] = REQUEST_SENSE; - cmnd[1] = (SCp->device->lun & 0x7) << 5; - cmnd[2] = 0; - cmnd[3] = 0; - cmnd[4] = sizeof(SCp->sense_buffer); - cmnd[5] = 0; + sense->cmnd[0] = REQUEST_SENSE; + sense->cmnd[1] = (SCp->device->lun & 0x7) << 5; + sense->cmnd[2] = 0; + sense->cmnd[3] = 0; + sense->cmnd[4] = sizeof(SCp->sense_buffer); + sense->cmnd[5] = 0; /* Here's a quiet hack: the * REQUEST_SENSE command is six bytes, * so store a flag indicating that * this was an internal sense request * and the original status at the end * of the command */ - cmnd[6] = NCR_700_INTERNAL_SENSE_MAGIC; - cmnd[7] = hostdata->status[0]; - slot->pCmd = dma_map_single(hostdata->dev, cmnd, MAX_COMMAND_SIZE, DMA_TO_DEVICE); + sense->cmnd[6] = NCR_700_INTERNAL_SENSE_MAGIC; + sense->cmnd[7] = hostdata->status[0]; + slot->pCmd = dma_map_single(hostdata->dev, sense->cmnd, sizeof(sense->cmnd), DMA_TO_DEVICE); slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, sizeof(SCp->sense_buffer), DMA_FROM_DEVICE); slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer)); slot->SG[0].pAddr = bS_to_host(slot->dma_handle); @@ -1529,7 +1531,7 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs) /* clear all the negotiated parameters */ __shost_for_each_device(SDp, host) - NCR_700_clear_flag(SDp, ~0); + SDp->hostdata = NULL; /* clear all the slots and their pending commands */ for(i = 0; i < NCR_700_COMMAND_SLOTS_PER_HOST; i++) { @@ -2034,17 +2036,7 @@ NCR_700_set_offset(struct scsi_target *STp, int offset) spi_flags(STp) |= NCR_700_DEV_PRINT_SYNC_NEGOTIATION; } -STATIC int -NCR_700_slave_alloc(struct scsi_device *SDp) -{ - SDp->hostdata = kzalloc(sizeof(struct NCR_700_Device_Parameters), - GFP_KERNEL); - if (!SDp->hostdata) - return -ENOMEM; - - return 0; -} STATIC int NCR_700_slave_configure(struct scsi_device *SDp) @@ -2052,6 +2044,11 @@ NCR_700_slave_configure(struct scsi_device *SDp) struct NCR_700_Host_Parameters *hostdata = (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0]; + SDp->hostdata = kmalloc(GFP_KERNEL, sizeof(struct NCR_700_sense)); + + if (!SDp->hostdata) + return -ENOMEM; + /* to do here: allocate memory; build a queue_full list */ if(SDp->tagged_supported) { scsi_set_tag_type(SDp, MSG_ORDERED_TAG); diff --git a/trunk/drivers/scsi/53c700.h b/trunk/drivers/scsi/53c700.h index 97ebe71b701b..7f22a06fe5ec 100644 --- a/trunk/drivers/scsi/53c700.h +++ b/trunk/drivers/scsi/53c700.h @@ -12,7 +12,7 @@ #include #include -#include + /* Turn on for general debugging---too verbose for normal use */ #undef NCR_700_DEBUG @@ -76,16 +76,11 @@ struct NCR_700_SG_List { #define SCRIPT_RETURN 0x90080000 }; -struct NCR_700_Device_Parameters { - /* space for creating a request sense command. Really, except - * for the annoying SCSI-2 requirement for LUN information in - * cmnd[1], this could be in static storage */ - unsigned char cmnd[MAX_COMMAND_SIZE]; - __u8 depth; -}; - - -/* The SYNC negotiation sequence looks like: +/* We use device->hostdata to store negotiated parameters. This is + * supposed to be a pointer to a device private area, but we cannot + * really use it as such since it will never be freed, so just use the + * 32 bits to cram the information. The SYNC negotiation sequence looks + * like: * * If DEV_NEGOTIATED_SYNC not set, tack and SDTR message on to the * initial identify for the device and set DEV_BEGIN_SYNC_NEGOTATION @@ -103,26 +98,19 @@ struct NCR_700_Device_Parameters { #define NCR_700_DEV_BEGIN_SYNC_NEGOTIATION (1<<17) #define NCR_700_DEV_PRINT_SYNC_NEGOTIATION (1<<19) -static inline char *NCR_700_get_sense_cmnd(struct scsi_device *SDp) -{ - struct NCR_700_Device_Parameters *hostdata = SDp->hostdata; - - return hostdata->cmnd; -} - static inline void NCR_700_set_depth(struct scsi_device *SDp, __u8 depth) { - struct NCR_700_Device_Parameters *hostdata = SDp->hostdata; + long l = (long)SDp->hostdata; - hostdata->depth = depth; + l &= 0xffff00ff; + l |= 0xff00 & (depth << 8); + SDp->hostdata = (void *)l; } static inline __u8 NCR_700_get_depth(struct scsi_device *SDp) { - struct NCR_700_Device_Parameters *hostdata = SDp->hostdata; - - return hostdata->depth; + return ((((unsigned long)SDp->hostdata) & 0xff00)>>8); } static inline int NCR_700_is_flag_set(struct scsi_device *SDp, __u32 flag) diff --git a/trunk/drivers/scsi/53c7xx.c b/trunk/drivers/scsi/53c7xx.c index c690c2b89e41..765769a629e4 100644 --- a/trunk/drivers/scsi/53c7xx.c +++ b/trunk/drivers/scsi/53c7xx.c @@ -232,6 +232,7 @@ #include +#include #include #include @@ -1070,7 +1071,7 @@ NCR53c7x0_init (struct Scsi_Host *host) { NCR53c7x0_driver_init (host); - if (request_irq(host->irq, NCR53c7x0_intr, IRQF_SHARED, "53c7xx", host)) + if (request_irq(host->irq, NCR53c7x0_intr, SA_SHIRQ, "53c7xx", host)) { printk("scsi%d : IRQ%d not free, detaching\n", host->host_no, host->irq); @@ -4232,7 +4233,7 @@ NCR53c7x0_intfly (struct Scsi_Host *host) * Purpose : handle NCR53c7x0 interrupts for all NCR devices sharing * the same IRQ line. * - * Inputs : Since we're using the IRQF_DISABLED interrupt handler + * Inputs : Since we're using the SA_INTERRUPT interrupt handler * semantics, irq indicates the interrupt which invoked * this handler. * diff --git a/trunk/drivers/scsi/BusLogic.c b/trunk/drivers/scsi/BusLogic.c index 16a12a3b7b2b..bde3d5834ade 100644 --- a/trunk/drivers/scsi/BusLogic.c +++ b/trunk/drivers/scsi/BusLogic.c @@ -29,6 +29,7 @@ #define BusLogic_DriverVersion "2.1.16" #define BusLogic_DriverDate "18 July 2002" +#include #include #include #include @@ -1844,7 +1845,7 @@ static boolean __init BusLogic_AcquireResources(struct BusLogic_HostAdapter *Hos /* Acquire shared access to the IRQ Channel. */ - if (request_irq(HostAdapter->IRQ_Channel, BusLogic_InterruptHandler, IRQF_SHARED, HostAdapter->FullModelName, HostAdapter) < 0) { + if (request_irq(HostAdapter->IRQ_Channel, BusLogic_InterruptHandler, SA_SHIRQ, HostAdapter->FullModelName, HostAdapter) < 0) { BusLogic_Error("UNABLE TO ACQUIRE IRQ CHANNEL %d - DETACHING\n", HostAdapter, HostAdapter->IRQ_Channel); return false; } diff --git a/trunk/drivers/scsi/BusLogic.h b/trunk/drivers/scsi/BusLogic.h index 9792e5af5252..1aaa6569edac 100644 --- a/trunk/drivers/scsi/BusLogic.h +++ b/trunk/drivers/scsi/BusLogic.h @@ -28,6 +28,7 @@ #ifndef _BUSLOGIC_H #define _BUSLOGIC_H +#include #ifndef PACKED #define PACKED __attribute__((packed)) diff --git a/trunk/drivers/scsi/FlashPoint.c b/trunk/drivers/scsi/FlashPoint.c index 7c0068049586..8e3d949b7118 100644 --- a/trunk/drivers/scsi/FlashPoint.c +++ b/trunk/drivers/scsi/FlashPoint.c @@ -15,6 +15,7 @@ */ +#include #ifndef CONFIG_SCSI_OMIT_FLASHPOINT diff --git a/trunk/drivers/scsi/NCR5380.c b/trunk/drivers/scsi/NCR5380.c index 616810ad17d8..75f2f7ae2a8e 100644 --- a/trunk/drivers/scsi/NCR5380.c +++ b/trunk/drivers/scsi/NCR5380.c @@ -585,7 +585,7 @@ static int __init NCR5380_probe_irq(struct Scsi_Host *instance, int possible) NCR5380_setup(instance); for (trying_irqs = i = 0, mask = 1; i < 16; ++i, mask <<= 1) - if ((mask & possible) && (request_irq(i, &probe_intr, IRQF_DISABLED, "NCR-probe", NULL) == 0)) + if ((mask & possible) && (request_irq(i, &probe_intr, SA_INTERRUPT, "NCR-probe", NULL) == 0)) trying_irqs |= mask; timeout = jiffies + (250 * HZ / 1000); diff --git a/trunk/drivers/scsi/NCR53C9x.c b/trunk/drivers/scsi/NCR53C9x.c index 8a4659e94105..c7dd0154d012 100644 --- a/trunk/drivers/scsi/NCR53C9x.c +++ b/trunk/drivers/scsi/NCR53C9x.c @@ -23,6 +23,7 @@ #include +#include #include #include #include diff --git a/trunk/drivers/scsi/NCR53C9x.h b/trunk/drivers/scsi/NCR53C9x.h index 481653c977cf..65a9b377a410 100644 --- a/trunk/drivers/scsi/NCR53C9x.h +++ b/trunk/drivers/scsi/NCR53C9x.h @@ -13,6 +13,7 @@ #ifndef NCR53C9X_H #define NCR53C9X_H +#include #include /* djweis for mac driver */ diff --git a/trunk/drivers/scsi/NCR_D700.c b/trunk/drivers/scsi/NCR_D700.c index a06f547e87f7..577e63499778 100644 --- a/trunk/drivers/scsi/NCR_D700.c +++ b/trunk/drivers/scsi/NCR_D700.c @@ -320,7 +320,7 @@ NCR_D700_probe(struct device *dev) memset(p, '\0', sizeof(*p)); p->dev = dev; snprintf(p->name, sizeof(p->name), "D700(%s)", dev->bus_id); - if (request_irq(irq, NCR_D700_intr, IRQF_SHARED, p->name, p)) { + if (request_irq(irq, NCR_D700_intr, SA_SHIRQ, p->name, p)) { printk(KERN_ERR "D700: request_irq failed\n"); kfree(p); return -EBUSY; diff --git a/trunk/drivers/scsi/NCR_Q720.c b/trunk/drivers/scsi/NCR_Q720.c index c39ffbb86e39..9d18ec90510f 100644 --- a/trunk/drivers/scsi/NCR_Q720.c +++ b/trunk/drivers/scsi/NCR_Q720.c @@ -265,7 +265,7 @@ NCR_Q720_probe(struct device *dev) p->irq = irq; p->siops = siops; - if (request_irq(irq, NCR_Q720_intr, IRQF_SHARED, "NCR_Q720", p)) { + if (request_irq(irq, NCR_Q720_intr, SA_SHIRQ, "NCR_Q720", p)) { printk(KERN_ERR "NCR_Q720: request irq %d failed\n", irq); goto out_release; } diff --git a/trunk/drivers/scsi/a100u2w.c b/trunk/drivers/scsi/a100u2w.c index d7e9fab54c60..3dce21c78737 100644 --- a/trunk/drivers/scsi/a100u2w.c +++ b/trunk/drivers/scsi/a100u2w.c @@ -1120,7 +1120,7 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev, shost->sg_tablesize = TOTAL_SG_ENTRY; /* Initial orc chip */ - error = request_irq(pdev->irq, inia100_intr, IRQF_SHARED, + error = request_irq(pdev->irq, inia100_intr, SA_SHIRQ, "inia100", shost); if (error < 0) { printk(KERN_WARNING "inia100: unable to get irq %d\n", diff --git a/trunk/drivers/scsi/a2091.c b/trunk/drivers/scsi/a2091.c index fddfa2ebcd70..54996eaae979 100644 --- a/trunk/drivers/scsi/a2091.c +++ b/trunk/drivers/scsi/a2091.c @@ -208,7 +208,7 @@ int __init a2091_detect(struct scsi_host_template *tpnt) regs.SASR = &(DMA(instance)->SASR); regs.SCMD = &(DMA(instance)->SCMD); wd33c93_init(instance, regs, dma_setup, dma_stop, WD33C93_FS_8_10); - request_irq(IRQ_AMIGA_PORTS, a2091_intr, IRQF_SHARED, "A2091 SCSI", + request_irq(IRQ_AMIGA_PORTS, a2091_intr, SA_SHIRQ, "A2091 SCSI", instance); DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN; num_a2091++; diff --git a/trunk/drivers/scsi/a3000.c b/trunk/drivers/scsi/a3000.c index ae9ab4b136ac..f425d424bf08 100644 --- a/trunk/drivers/scsi/a3000.c +++ b/trunk/drivers/scsi/a3000.c @@ -190,7 +190,7 @@ int __init a3000_detect(struct scsi_host_template *tpnt) regs.SASR = &(DMA(a3000_host)->SASR); regs.SCMD = &(DMA(a3000_host)->SCMD); wd33c93_init(a3000_host, regs, dma_setup, dma_stop, WD33C93_FS_12_15); - if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, IRQF_SHARED, "A3000 SCSI", + if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, SA_SHIRQ, "A3000 SCSI", a3000_intr)) goto fail_irq; DMA(a3000_host)->CNTR = CNTR_PDMD | CNTR_INTEN; diff --git a/trunk/drivers/scsi/aacraid/comminit.c b/trunk/drivers/scsi/aacraid/comminit.c index 1cd3584ba7ff..7cea514e810a 100644 --- a/trunk/drivers/scsi/aacraid/comminit.c +++ b/trunk/drivers/scsi/aacraid/comminit.c @@ -92,7 +92,31 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co init->AdapterFibsPhysicalAddress = cpu_to_le32((u32)phys); init->AdapterFibsSize = cpu_to_le32(fibsize); init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib)); - init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES); + /* + * number of 4k pages of host physical memory. The aacraid fw needs + * this number to be less than 4gb worth of pages. num_physpages is in + * system page units. New firmware doesn't have any issues with the + * mapping system, but older Firmware did, and had *troubles* dealing + * with the math overloading past 32 bits, thus we must limit this + * field. + * + * This assumes the memory is mapped zero->n, which isnt + * always true on real computers. It also has some slight problems + * with the GART on x86-64. I've btw never tried DMA from PCI space + * on this platform but don't be surprised if its problematic. + * [AK: something is very very wrong when a driver tests this symbol. + * Someone should figure out what the comment writer really meant here and fix + * the code. Or just remove that bad code. ] + */ +#ifndef CONFIG_IOMMU + if ((num_physpages << (PAGE_SHIFT - 12)) <= AAC_MAX_HOSTPHYSMEMPAGES) { + init->HostPhysMemPages = + cpu_to_le32(num_physpages << (PAGE_SHIFT-12)); + } else +#endif + { + init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES); + } init->InitFlags = 0; if (dev->new_comm_interface) { diff --git a/trunk/drivers/scsi/aacraid/rkt.c b/trunk/drivers/scsi/aacraid/rkt.c index 458ea897fd72..5b52966bbbf3 100644 --- a/trunk/drivers/scsi/aacraid/rkt.c +++ b/trunk/drivers/scsi/aacraid/rkt.c @@ -453,7 +453,7 @@ int aac_rkt_init(struct aac_dev *dev) } msleep(1); } - if (request_irq(dev->scsi_host_ptr->irq, aac_rkt_intr, IRQF_SHARED|IRQF_DISABLED, "aacraid", (void *)dev)<0) + if (request_irq(dev->scsi_host_ptr->irq, aac_rkt_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev)<0) { printk(KERN_ERR "%s%d: Interrupt unavailable.\n", name, instance); goto error_iounmap; diff --git a/trunk/drivers/scsi/aacraid/rx.c b/trunk/drivers/scsi/aacraid/rx.c index 035018db69b1..9dadfb28b3f1 100644 --- a/trunk/drivers/scsi/aacraid/rx.c +++ b/trunk/drivers/scsi/aacraid/rx.c @@ -453,7 +453,7 @@ int aac_rx_init(struct aac_dev *dev) } msleep(1); } - if (request_irq(dev->scsi_host_ptr->irq, aac_rx_intr, IRQF_SHARED|IRQF_DISABLED, "aacraid", (void *)dev)<0) + if (request_irq(dev->scsi_host_ptr->irq, aac_rx_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev)<0) { printk(KERN_ERR "%s%d: Interrupt unavailable.\n", name, instance); goto error_iounmap; diff --git a/trunk/drivers/scsi/aacraid/sa.c b/trunk/drivers/scsi/aacraid/sa.c index cd586cc8f9be..88d400fccc94 100644 --- a/trunk/drivers/scsi/aacraid/sa.c +++ b/trunk/drivers/scsi/aacraid/sa.c @@ -327,7 +327,7 @@ int aac_sa_init(struct aac_dev *dev) msleep(1); } - if (request_irq(dev->scsi_host_ptr->irq, aac_sa_intr, IRQF_SHARED|IRQF_DISABLED, "aacraid", (void *)dev ) < 0) { + if (request_irq(dev->scsi_host_ptr->irq, aac_sa_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev ) < 0) { printk(KERN_WARNING "%s%d: Interrupt unavailable.\n", name, instance); goto error_iounmap; } diff --git a/trunk/drivers/scsi/advansys.c b/trunk/drivers/scsi/advansys.c index e32b4ab2f8fb..dd9fb3d91000 100644 --- a/trunk/drivers/scsi/advansys.c +++ b/trunk/drivers/scsi/advansys.c @@ -371,7 +371,7 @@ 1.5 (8/8/96): 1. Add support for ABP-940U (PCI Ultra) adapter. - 2. Add support for IRQ sharing by setting the IRQF_SHARED flag for + 2. Add support for IRQ sharing by setting the SA_SHIRQ flag for request_irq and supplying a dev_id pointer to both request_irq() and free_irq(). 3. In AscSearchIOPortAddr11() restore a call to check_region() which @@ -504,9 +504,9 @@ 3. For v2.1.93 and newer kernels use CONFIG_PCI and new PCI BIOS access functions. 4. Update board serial number printing. - 5. Try allocating an IRQ both with and without the IRQF_DISABLED + 5. Try allocating an IRQ both with and without the SA_INTERRUPT flag set to allow IRQ sharing with drivers that do not set - the IRQF_DISABLED flag. Also display a more descriptive error + the SA_INTERRUPT flag. Also display a more descriptive error message if request_irq() fails. 6. Update to latest Asc and Adv Libraries. @@ -754,6 +754,7 @@ * --- Linux Include Files */ +#include #include #if defined(CONFIG_X86) && !defined(CONFIG_ISA) @@ -5202,19 +5203,19 @@ advansys_detect(struct scsi_host_template *tpnt) /* Register IRQ Number. */ ASC_DBG1(2, "advansys_detect: request_irq() %d\n", shp->irq); /* - * If request_irq() fails with the IRQF_DISABLED flag set, - * then try again without the IRQF_DISABLED flag set. This + * If request_irq() fails with the SA_INTERRUPT flag set, + * then try again without the SA_INTERRUPT flag set. This * allows IRQ sharing to work even with other drivers that - * do not set the IRQF_DISABLED flag. + * do not set the SA_INTERRUPT flag. * - * If IRQF_DISABLED is not set, then interrupts are enabled + * If SA_INTERRUPT is not set, then interrupts are enabled * before the driver interrupt function is called. */ if (((ret = request_irq(shp->irq, advansys_interrupt, - IRQF_DISABLED | (share_irq == TRUE ? IRQF_SHARED : 0), + SA_INTERRUPT | (share_irq == TRUE ? SA_SHIRQ : 0), "advansys", boardp)) != 0) && ((ret = request_irq(shp->irq, advansys_interrupt, - (share_irq == TRUE ? IRQF_SHARED : 0), + (share_irq == TRUE ? SA_SHIRQ : 0), "advansys", boardp)) != 0)) { if (ret == -EBUSY) { diff --git a/trunk/drivers/scsi/aha152x.c b/trunk/drivers/scsi/aha152x.c index 36e63f82d9f8..de80cdfb5b9d 100644 --- a/trunk/drivers/scsi/aha152x.c +++ b/trunk/drivers/scsi/aha152x.c @@ -855,7 +855,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup) SETPORT(SIMODE0, 0); SETPORT(SIMODE1, 0); - if( request_irq(shpnt->irq, swintr, IRQF_DISABLED|IRQF_SHARED, "aha152x", shpnt) ) { + if( request_irq(shpnt->irq, swintr, SA_INTERRUPT|SA_SHIRQ, "aha152x", shpnt) ) { printk(KERN_ERR "aha152x%d: irq %d busy.\n", shpnt->host_no, shpnt->irq); goto out_host_put; } @@ -889,7 +889,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup) SETPORT(SSTAT0, 0x7f); SETPORT(SSTAT1, 0xef); - if ( request_irq(shpnt->irq, intr, IRQF_DISABLED|IRQF_SHARED, "aha152x", shpnt) ) { + if ( request_irq(shpnt->irq, intr, SA_INTERRUPT|SA_SHIRQ, "aha152x", shpnt) ) { printk(KERN_ERR "aha152x%d: failed to reassign irq %d.\n", shpnt->host_no, shpnt->irq); goto out_host_put; } diff --git a/trunk/drivers/scsi/aha1542.c b/trunk/drivers/scsi/aha1542.c index 24f0f5461792..86c6bd234591 100644 --- a/trunk/drivers/scsi/aha1542.c +++ b/trunk/drivers/scsi/aha1542.c @@ -25,6 +25,7 @@ * Added proper detection of the AHA-1640 (MCA version of AHA-1540) */ +#include #include #include #include diff --git a/trunk/drivers/scsi/aha1740.c b/trunk/drivers/scsi/aha1740.c index 0e4a7ebe300a..4b8c6a543925 100644 --- a/trunk/drivers/scsi/aha1740.c +++ b/trunk/drivers/scsi/aha1740.c @@ -634,7 +634,7 @@ static int aha1740_probe (struct device *dev) } DEB(printk("aha1740_probe: enable interrupt channel %d\n",irq_level)); - if (request_irq(irq_level,aha1740_intr_handle,irq_type ? 0 : IRQF_SHARED, + if (request_irq(irq_level,aha1740_intr_handle,irq_type ? 0 : SA_SHIRQ, "aha1740",shpnt)) { printk(KERN_ERR "aha1740_probe: Unable to allocate IRQ %d.\n", irq_level); diff --git a/trunk/drivers/scsi/ahci.c b/trunk/drivers/scsi/ahci.c index 15f6cd4279b7..f05946777718 100644 --- a/trunk/drivers/scsi/ahci.c +++ b/trunk/drivers/scsi/ahci.c @@ -1371,7 +1371,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) probe_ent->port_ops = ahci_port_info[board_idx].port_ops; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->mmio_base = mmio_base; probe_ent->private_data = hpriv; diff --git a/trunk/drivers/scsi/aic7xxx/aic7770_osm.c b/trunk/drivers/scsi/aic7xxx/aic7770_osm.c index 867cbe23579b..d754b3267863 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7770_osm.c +++ b/trunk/drivers/scsi/aic7xxx/aic7770_osm.c @@ -65,7 +65,7 @@ aic7770_map_int(struct ahc_softc *ahc, u_int irq) shared = 0; if ((ahc->flags & AHC_EDGE_INTERRUPT) == 0) - shared = IRQF_SHARED; + shared = SA_SHIRQ; error = request_irq(irq, ahc_linux_isr, shared, "aic7xxx", ahc); if (error == 0) diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx.h b/trunk/drivers/scsi/aic7xxx/aic79xx.h index df3346b5caf8..eb7745692682 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx.h +++ b/trunk/drivers/scsi/aic7xxx/aic79xx.h @@ -1487,7 +1487,6 @@ typedef enum { } ahd_queue_alg; void ahd_set_tags(struct ahd_softc *ahd, - struct scsi_cmnd *cmd, struct ahd_devinfo *devinfo, ahd_queue_alg alg); diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_core.c b/trunk/drivers/scsi/aic7xxx/aic79xx_core.c index a1e8ca758594..801fc81d0b20 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_core.c @@ -1090,7 +1090,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) /* Notify XPT */ ahd_send_async(ahd, devinfo.channel, devinfo.target, - CAM_LUN_WILDCARD, AC_SENT_BDR); + CAM_LUN_WILDCARD, AC_SENT_BDR, NULL); /* * Allow the sequencer to continue with @@ -3062,7 +3062,7 @@ ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, tinfo->curr.ppr_options = ppr_options; ahd_send_async(ahd, devinfo->channel, devinfo->target, - CAM_LUN_WILDCARD, AC_TRANSFER_NEG); + CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL); if (bootverbose) { if (offset != 0) { int options; @@ -3184,7 +3184,7 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, tinfo->curr.width = width; ahd_send_async(ahd, devinfo->channel, devinfo->target, - CAM_LUN_WILDCARD, AC_TRANSFER_NEG); + CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL); if (bootverbose) { printf("%s: target %d using %dbit transfers\n", ahd_name(ahd), devinfo->target, @@ -3211,14 +3211,12 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, * Update the current state of tagged queuing for a given target. */ void -ahd_set_tags(struct ahd_softc *ahd, struct scsi_cmnd *cmd, - struct ahd_devinfo *devinfo, ahd_queue_alg alg) +ahd_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, + ahd_queue_alg alg) { - struct scsi_device *sdev = cmd->device; - - ahd_platform_set_tags(ahd, sdev, devinfo, alg); + ahd_platform_set_tags(ahd, devinfo, alg); ahd_send_async(ahd, devinfo->channel, devinfo->target, - devinfo->lun, AC_TRANSFER_NEG); + devinfo->lun, AC_TRANSFER_NEG, &alg); } static void @@ -4748,7 +4746,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) printf("(%s:%c:%d:%d): refuses tagged commands. " "Performing non-tagged I/O\n", ahd_name(ahd), devinfo->channel, devinfo->target, devinfo->lun); - ahd_set_tags(ahd, scb->io_ctx, devinfo, AHD_QUEUE_NONE); + ahd_set_tags(ahd, devinfo, AHD_QUEUE_NONE); mask = ~0x23; } else { printf("(%s:%c:%d:%d): refuses %s tagged commands. " @@ -4756,7 +4754,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) ahd_name(ahd), devinfo->channel, devinfo->target, devinfo->lun, tag_type == MSG_ORDERED_TASK ? "ordered" : "head of queue"); - ahd_set_tags(ahd, scb->io_ctx, devinfo, AHD_QUEUE_BASIC); + ahd_set_tags(ahd, devinfo, AHD_QUEUE_BASIC); mask = ~0x03; } @@ -5100,7 +5098,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, if (status != CAM_SEL_TIMEOUT) ahd_send_async(ahd, devinfo->channel, devinfo->target, - CAM_LUN_WILDCARD, AC_SENT_BDR); + CAM_LUN_WILDCARD, AC_SENT_BDR, NULL); if (message != NULL && bootverbose) printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd), @@ -7954,7 +7952,7 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset) #endif /* Notify the XPT that a bus reset occurred */ ahd_send_async(ahd, devinfo.channel, CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD, AC_BUS_RESET); + CAM_LUN_WILDCARD, AC_BUS_RESET, NULL); /* * Revert to async/narrow transfers until we renegotiate. diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c index b244c7124179..e0ccdf362200 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -484,6 +484,7 @@ ahd_linux_target_alloc(struct scsi_target *starget) struct seeprom_config *sc = ahd->seep_config; unsigned long flags; struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget); + struct ahd_linux_target *targ = scsi_transport_target_data(starget); struct ahd_devinfo devinfo; struct ahd_initiator_tinfo *tinfo; struct ahd_tmode_tstate *tstate; @@ -494,6 +495,7 @@ ahd_linux_target_alloc(struct scsi_target *starget) BUG_ON(*ahd_targp != NULL); *ahd_targp = starget; + memset(targ, 0, sizeof(*targ)); if (sc) { int flags = sc->device_flags[starget->id]; @@ -549,11 +551,15 @@ ahd_linux_slave_alloc(struct scsi_device *sdev) { struct ahd_softc *ahd = *((struct ahd_softc **)sdev->host->hostdata); + struct scsi_target *starget = sdev->sdev_target; + struct ahd_linux_target *targ = scsi_transport_target_data(starget); struct ahd_linux_device *dev; if (bootverbose) printf("%s: Slave Alloc %d\n", ahd_name(ahd), sdev->id); + BUG_ON(targ->sdev[sdev->lun] != NULL); + dev = scsi_transport_device_data(sdev); memset(dev, 0, sizeof(*dev)); @@ -570,6 +576,8 @@ ahd_linux_slave_alloc(struct scsi_device *sdev) */ dev->maxtags = 0; + targ->sdev[sdev->lun] = sdev; + return (0); } @@ -591,6 +599,23 @@ ahd_linux_slave_configure(struct scsi_device *sdev) return 0; } +static void +ahd_linux_slave_destroy(struct scsi_device *sdev) +{ + struct ahd_softc *ahd; + struct ahd_linux_device *dev = scsi_transport_device_data(sdev); + struct ahd_linux_target *targ = scsi_transport_target_data(sdev->sdev_target); + + ahd = *((struct ahd_softc **)sdev->host->hostdata); + if (bootverbose) + printf("%s: Slave Destroy %d\n", ahd_name(ahd), sdev->id); + + BUG_ON(dev->active); + + targ->sdev[sdev->lun] = NULL; + +} + #if defined(__i386__) /* * Return the disk geometry for the given SCSI device. @@ -797,6 +822,7 @@ struct scsi_host_template aic79xx_driver_template = { .use_clustering = ENABLE_CLUSTERING, .slave_alloc = ahd_linux_slave_alloc, .slave_configure = ahd_linux_slave_configure, + .slave_destroy = ahd_linux_slave_destroy, .target_alloc = ahd_linux_target_alloc, .target_destroy = ahd_linux_target_destroy, }; @@ -1223,13 +1249,20 @@ void ahd_platform_free(struct ahd_softc *ahd) { struct scsi_target *starget; - int i; + int i, j; if (ahd->platform_data != NULL) { /* destroy all of the device and target objects */ for (i = 0; i < AHD_NUM_TARGETS; i++) { starget = ahd->platform_data->starget[i]; if (starget != NULL) { + for (j = 0; j < AHD_NUM_LUNS; j++) { + struct ahd_linux_target *targ = + scsi_transport_target_data(starget); + if (targ->sdev[j] == NULL) + continue; + targ->sdev[j] = NULL; + } ahd->platform_data->starget[i] = NULL; } } @@ -1285,13 +1318,20 @@ ahd_platform_freeze_devq(struct ahd_softc *ahd, struct scb *scb) } void -ahd_platform_set_tags(struct ahd_softc *ahd, struct scsi_device *sdev, - struct ahd_devinfo *devinfo, ahd_queue_alg alg) +ahd_platform_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, + ahd_queue_alg alg) { + struct scsi_target *starget; + struct ahd_linux_target *targ; struct ahd_linux_device *dev; + struct scsi_device *sdev; int was_queuing; int now_queuing; + starget = ahd->platform_data->starget[devinfo->target]; + targ = scsi_transport_target_data(starget); + BUG_ON(targ == NULL); + sdev = targ->sdev[devinfo->lun]; if (sdev == NULL) return; @@ -1427,15 +1467,11 @@ ahd_linux_device_queue_depth(struct scsi_device *sdev) tags = ahd_linux_user_tagdepth(ahd, &devinfo); if (tags != 0 && sdev->tagged_supported != 0) { - ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_TAGGED); - ahd_send_async(ahd, devinfo.channel, devinfo.target, - devinfo.lun, AC_TRANSFER_NEG); + ahd_set_tags(ahd, &devinfo, AHD_QUEUE_TAGGED); ahd_print_devinfo(ahd, &devinfo); printf("Tagged Queuing enabled. Depth %d\n", tags); } else { - ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_NONE); - ahd_send_async(ahd, devinfo.channel, devinfo.target, - devinfo.lun, AC_TRANSFER_NEG); + ahd_set_tags(ahd, &devinfo, AHD_QUEUE_NONE); } } @@ -1593,7 +1629,7 @@ ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs) void ahd_send_async(struct ahd_softc *ahd, char channel, - u_int target, u_int lun, ac_code code) + u_int target, u_int lun, ac_code code, void *arg) { switch (code) { case AC_TRANSFER_NEG: @@ -1920,7 +1956,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, } ahd_set_transaction_status(scb, CAM_REQUEUE_REQ); ahd_set_scsi_status(scb, SCSI_STATUS_OK); - ahd_platform_set_tags(ahd, sdev, &devinfo, + ahd_platform_set_tags(ahd, &devinfo, (dev->flags & AHD_DEV_Q_BASIC) ? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED); break; @@ -1930,7 +1966,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, * as if the target returned BUSY SCSI status. */ dev->openings = 1; - ahd_platform_set_tags(ahd, sdev, &devinfo, + ahd_platform_set_tags(ahd, &devinfo, (dev->flags & AHD_DEV_Q_BASIC) ? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED); ahd_set_scsi_status(scb, SCSI_STATUS_BUSY); @@ -2742,6 +2778,8 @@ ahd_linux_init(void) if (!ahd_linux_transport_template) return -ENODEV; + scsi_transport_reserve_target(ahd_linux_transport_template, + sizeof(struct ahd_linux_target)); scsi_transport_reserve_device(ahd_linux_transport_template, sizeof(struct ahd_linux_device)); diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.h b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.h index 9e871de23835..2b8331649eeb 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.h +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.h @@ -42,6 +42,7 @@ #ifndef _AIC79XX_LINUX_H_ #define _AIC79XX_LINUX_H_ +#include #include #include #include @@ -262,6 +263,7 @@ typedef enum { AHD_DEV_PERIODIC_OTAG = 0x40, /* Send OTAG to prevent starvation */ } ahd_linux_dev_flags; +struct ahd_linux_target; struct ahd_linux_device { TAILQ_ENTRY(ahd_linux_device) links; @@ -341,6 +343,12 @@ struct ahd_linux_device { #define AHD_OTAG_THRESH 500 }; +struct ahd_linux_target { + struct scsi_device *sdev[AHD_NUM_LUNS]; + struct ahd_transinfo last_tinfo; + struct ahd_softc *ahd; +}; + /********************* Definitions Required by the Core ***********************/ /* * Number of SG segments we require. So long as the S/G segments for @@ -857,7 +865,7 @@ ahd_freeze_scb(struct scb *scb) } } -void ahd_platform_set_tags(struct ahd_softc *ahd, struct scsi_device *sdev, +void ahd_platform_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, ahd_queue_alg); int ahd_platform_abort_scbs(struct ahd_softc *ahd, int target, char channel, int lun, u_int tag, @@ -866,7 +874,7 @@ irqreturn_t ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs); void ahd_done(struct ahd_softc*, struct scb*); void ahd_send_async(struct ahd_softc *, char channel, - u_int target, u_int lun, ac_code); + u_int target, u_int lun, ac_code, void *); void ahd_print_path(struct ahd_softc *, struct scb *); #ifdef CONFIG_PCI diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/trunk/drivers/scsi/aic7xxx/aic79xx_osm_pci.c index 50a41eda580e..ebbf7e4ff4cc 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_osm_pci.c +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_osm_pci.c @@ -342,7 +342,7 @@ ahd_pci_map_int(struct ahd_softc *ahd) int error; error = request_irq(ahd->dev_softc->irq, ahd_linux_isr, - IRQF_SHARED, "aic79xx", ahd); + SA_SHIRQ, "aic79xx", ahd); if (!error) ahd->platform_data->irq = ahd->dev_softc->irq; diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_proc.c b/trunk/drivers/scsi/aic7xxx/aic79xx_proc.c index c5f0ee591509..24fd59a230bf 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_proc.c +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_proc.c @@ -47,7 +47,7 @@ static int copy_info(struct info_str *info, char *fmt, ...); static void ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, u_int our_id, char channel, - u_int target_id); + u_int target_id, u_int target_offset); static void ahd_dump_device_state(struct info_str *info, struct scsi_device *sdev); static int ahd_proc_write_seeprom(struct ahd_softc *ahd, @@ -204,8 +204,10 @@ ahd_format_transinfo(struct info_str *info, struct ahd_transinfo *tinfo) static void ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, - u_int our_id, char channel, u_int target_id) + u_int our_id, char channel, u_int target_id, + u_int target_offset) { + struct ahd_linux_target *targ; struct scsi_target *starget; struct ahd_initiator_tinfo *tinfo; struct ahd_tmode_tstate *tstate; @@ -216,9 +218,10 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, copy_info(info, "Target %d Negotiation Settings\n", target_id); copy_info(info, "\tUser: "); ahd_format_transinfo(info, &tinfo->user); - starget = ahd->platform_data->starget[target_id]; + starget = ahd->platform_data->starget[target_offset]; if (starget == NULL) return; + targ = scsi_transport_target_data(starget); copy_info(info, "\tGoal: "); ahd_format_transinfo(info, &tinfo->goal); @@ -228,7 +231,7 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, for (lun = 0; lun < AHD_NUM_LUNS; lun++) { struct scsi_device *dev; - dev = scsi_device_lookup_by_target(starget, lun); + dev = targ->sdev[lun]; if (dev == NULL) continue; @@ -352,7 +355,7 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start, copy_info(&info, "Allocated SCBs: %d, SG List Length: %d\n\n", ahd->scb_data.numscbs, AHD_NSEG); - max_targ = 16; + max_targ = 15; if (ahd->seep_config == NULL) copy_info(&info, "No Serial EEPROM\n"); @@ -370,12 +373,12 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start, copy_info(&info, "\n"); if ((ahd->features & AHD_WIDE) == 0) - max_targ = 8; + max_targ = 7; - for (i = 0; i < max_targ; i++) { + for (i = 0; i <= max_targ; i++) { ahd_dump_target_state(ahd, &info, ahd->our_id, 'A', - /*target_id*/i); + /*target_id*/i, /*target_offset*/i); } retval = info.pos > info.offset ? info.pos - info.offset : 0; done: diff --git a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.h b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.h index d42a71ee076d..a20b08c9ff15 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.h @@ -59,6 +59,7 @@ #ifndef _AIC7XXX_LINUX_H_ #define _AIC7XXX_LINUX_H_ +#include #include #include #include diff --git a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index 7e42f07a27f3..0c9c2f400bf6 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c @@ -375,7 +375,7 @@ ahc_pci_map_int(struct ahc_softc *ahc) int error; error = request_irq(ahc->dev_softc->irq, ahc_linux_isr, - IRQF_SHARED, "aic7xxx", ahc); + SA_SHIRQ, "aic7xxx", ahc); if (error == 0) ahc->platform_data->irq = ahc->dev_softc->irq; diff --git a/trunk/drivers/scsi/aic7xxx_old.c b/trunk/drivers/scsi/aic7xxx_old.c index 3f85b5e978f1..5dba1c63122e 100644 --- a/trunk/drivers/scsi/aic7xxx_old.c +++ b/trunk/drivers/scsi/aic7xxx_old.c @@ -8322,11 +8322,11 @@ aic7xxx_register(struct scsi_host_template *template, struct aic7xxx_host *p, } else { - result = (request_irq(p->irq, do_aic7xxx_isr, IRQF_SHARED, + result = (request_irq(p->irq, do_aic7xxx_isr, SA_SHIRQ, "aic7xxx", p)); if (result < 0) { - result = (request_irq(p->irq, do_aic7xxx_isr, IRQF_DISABLED | IRQF_SHARED, + result = (request_irq(p->irq, do_aic7xxx_isr, SA_INTERRUPT | SA_SHIRQ, "aic7xxx", p)); } } diff --git a/trunk/drivers/scsi/aic7xxx_old/aic7xxx_proc.c b/trunk/drivers/scsi/aic7xxx_old/aic7xxx_proc.c index b07e4f04fd00..3bf334931a8a 100644 --- a/trunk/drivers/scsi/aic7xxx_old/aic7xxx_proc.c +++ b/trunk/drivers/scsi/aic7xxx_old/aic7xxx_proc.c @@ -29,6 +29,7 @@ * $Id: aic7xxx_proc.c,v 4.1 1997/06/97 08:23:42 deang Exp $ *-M*************************************************************************/ +#include #define BLS (&aic7xxx_buffer[size]) #define HDRB \ diff --git a/trunk/drivers/scsi/amiga7xx.c b/trunk/drivers/scsi/amiga7xx.c index 9099d531d5a4..c0844fa32c5d 100644 --- a/trunk/drivers/scsi/amiga7xx.c +++ b/trunk/drivers/scsi/amiga7xx.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/trunk/drivers/scsi/arm/acornscsi.c b/trunk/drivers/scsi/arm/acornscsi.c index 7621e3fa37b1..dda5a5f79c53 100644 --- a/trunk/drivers/scsi/arm/acornscsi.c +++ b/trunk/drivers/scsi/arm/acornscsi.c @@ -129,6 +129,7 @@ #define STRx(x) STRINGIFY(x) #define NO_WRITE_STR STRx(NO_WRITE) +#include #include #include #include @@ -3030,7 +3031,7 @@ acornscsi_probe(struct expansion_card *ec, const struct ecard_id *id) if (!request_region(host->io_port, 2048, "acornscsi(ram)")) goto err_5; - ret = request_irq(host->irq, acornscsi_intr, IRQF_DISABLED, "acornscsi", ashost); + ret = request_irq(host->irq, acornscsi_intr, SA_INTERRUPT, "acornscsi", ashost); if (ret) { printk(KERN_CRIT "scsi%d: IRQ%d not free: %d\n", host->host_no, ashost->scsi.irq, ret); diff --git a/trunk/drivers/scsi/arm/cumana_1.c b/trunk/drivers/scsi/arm/cumana_1.c index 3bdfc36481ae..e6c9491dc5c0 100644 --- a/trunk/drivers/scsi/arm/cumana_1.c +++ b/trunk/drivers/scsi/arm/cumana_1.c @@ -277,7 +277,7 @@ cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id) ((struct NCR5380_hostdata *)host->hostdata)->ctrl = 0; outb(0x00, host->io_port - 577); - ret = request_irq(host->irq, cumanascsi_intr, IRQF_DISABLED, + ret = request_irq(host->irq, cumanascsi_intr, SA_INTERRUPT, "CumanaSCSI-1", host); if (ret) { printk("scsi%d: IRQ%d not free: %d\n", diff --git a/trunk/drivers/scsi/arm/cumana_2.c b/trunk/drivers/scsi/arm/cumana_2.c index 719af0dcc0e5..fad2109268bb 100644 --- a/trunk/drivers/scsi/arm/cumana_2.c +++ b/trunk/drivers/scsi/arm/cumana_2.c @@ -460,7 +460,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) goto out_free; ret = request_irq(ec->irq, cumanascsi_2_intr, - IRQF_DISABLED, "cumanascsi2", info); + SA_INTERRUPT, "cumanascsi2", info); if (ret) { printk("scsi%d: IRQ%d not free: %d\n", host->host_no, ec->irq, ret); diff --git a/trunk/drivers/scsi/arm/powertec.c b/trunk/drivers/scsi/arm/powertec.c index b2c346a47052..3d69f6c45a6b 100644 --- a/trunk/drivers/scsi/arm/powertec.c +++ b/trunk/drivers/scsi/arm/powertec.c @@ -373,7 +373,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) goto out_free; ret = request_irq(ec->irq, powertecscsi_intr, - IRQF_DISABLED, "powertec", info); + SA_INTERRUPT, "powertec", info); if (ret) { printk("scsi%d: IRQ%d not free: %d\n", host->host_no, ec->irq, ret); diff --git a/trunk/drivers/scsi/atari_NCR5380.c b/trunk/drivers/scsi/atari_NCR5380.c index 007a14e5c3fd..57295bcea3e7 100644 --- a/trunk/drivers/scsi/atari_NCR5380.c +++ b/trunk/drivers/scsi/atari_NCR5380.c @@ -524,6 +524,7 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd) } } +#include #include #if NDEBUG diff --git a/trunk/drivers/scsi/atari_scsi.c b/trunk/drivers/scsi/atari_scsi.c index e1be4a4387cd..f677c5a32a68 100644 --- a/trunk/drivers/scsi/atari_scsi.c +++ b/trunk/drivers/scsi/atari_scsi.c @@ -65,6 +65,7 @@ +#include #include #define NDEBUG (0) diff --git a/trunk/drivers/scsi/atp870u.c b/trunk/drivers/scsi/atp870u.c index 0ec41f34f462..3ee4d4d3f445 100644 --- a/trunk/drivers/scsi/atp870u.c +++ b/trunk/drivers/scsi/atp870u.c @@ -2625,32 +2625,29 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) unsigned int base_io, tmport, error,n; unsigned char host_id; struct Scsi_Host *shpnt = NULL; - struct atp_unit *atpdev, *p; + struct atp_unit atp_dev, *p; unsigned char setupdata[2][16]; int count = 0; - - atpdev = kzalloc(sizeof(*atpdev), GFP_KERNEL); - if (!atpdev) - return -ENOMEM; - + if (pci_enable_device(pdev)) - goto err_eio; + return -EIO; if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { printk(KERN_INFO "atp870u: use 32bit DMA mask.\n"); } else { printk(KERN_ERR "atp870u: DMA mask required but not available.\n"); - goto err_eio; + return -EIO; } + memset(&atp_dev, 0, sizeof atp_dev); /* * It's probably easier to weed out some revisions like * this than via the PCI device table */ if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610) { - error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atpdev->chip_ver); - if (atpdev->chip_ver < 2) - goto err_eio; + error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atp_dev.chip_ver); + if (atp_dev.chip_ver < 2) + return -EIO; } switch (ent->device) { @@ -2659,15 +2656,15 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) case ATP880_DEVID1: case ATP880_DEVID2: case ATP885_DEVID: - atpdev->chip_ver = 0x04; + atp_dev.chip_ver = 0x04; default: break; } base_io = pci_resource_start(pdev, 0); base_io &= 0xfffffff8; - + if ((ent->device == ATP880_DEVID1)||(ent->device == ATP880_DEVID2)) { - error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atpdev->chip_ver); + error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atp_dev.chip_ver); pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x80);//JCC082803 host_id = inb(base_io + 0x39); @@ -2675,17 +2672,17 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) printk(KERN_INFO " ACARD AEC-67160 PCI Ultra3 LVD Host Adapter: %d" " IO:%x, IRQ:%d.\n", count, base_io, pdev->irq); - atpdev->ioport[0] = base_io + 0x40; - atpdev->pciport[0] = base_io + 0x28; - atpdev->dev_id = ent->device; - atpdev->host_id[0] = host_id; + atp_dev.ioport[0] = base_io + 0x40; + atp_dev.pciport[0] = base_io + 0x28; + atp_dev.dev_id = ent->device; + atp_dev.host_id[0] = host_id; tmport = base_io + 0x22; - atpdev->scam_on = inb(tmport); + atp_dev.scam_on = inb(tmport); tmport += 0x13; - atpdev->global_map[0] = inb(tmport); + atp_dev.global_map[0] = inb(tmport); tmport += 0x07; - atpdev->ultra_map[0] = inw(tmport); + atp_dev.ultra_map[0] = inw(tmport); n = 0x3f09; next_fblk_880: @@ -2698,63 +2695,63 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (inb(base_io + 0x30) == 0xff) goto flash_ok_880; - atpdev->sp[0][m++] = inb(base_io + 0x30); - atpdev->sp[0][m++] = inb(base_io + 0x31); - atpdev->sp[0][m++] = inb(base_io + 0x32); - atpdev->sp[0][m++] = inb(base_io + 0x33); + atp_dev.sp[0][m++] = inb(base_io + 0x30); + atp_dev.sp[0][m++] = inb(base_io + 0x31); + atp_dev.sp[0][m++] = inb(base_io + 0x32); + atp_dev.sp[0][m++] = inb(base_io + 0x33); outw(n, base_io + 0x34); n += 0x0002; - atpdev->sp[0][m++] = inb(base_io + 0x30); - atpdev->sp[0][m++] = inb(base_io + 0x31); - atpdev->sp[0][m++] = inb(base_io + 0x32); - atpdev->sp[0][m++] = inb(base_io + 0x33); + atp_dev.sp[0][m++] = inb(base_io + 0x30); + atp_dev.sp[0][m++] = inb(base_io + 0x31); + atp_dev.sp[0][m++] = inb(base_io + 0x32); + atp_dev.sp[0][m++] = inb(base_io + 0x33); outw(n, base_io + 0x34); n += 0x0002; - atpdev->sp[0][m++] = inb(base_io + 0x30); - atpdev->sp[0][m++] = inb(base_io + 0x31); - atpdev->sp[0][m++] = inb(base_io + 0x32); - atpdev->sp[0][m++] = inb(base_io + 0x33); + atp_dev.sp[0][m++] = inb(base_io + 0x30); + atp_dev.sp[0][m++] = inb(base_io + 0x31); + atp_dev.sp[0][m++] = inb(base_io + 0x32); + atp_dev.sp[0][m++] = inb(base_io + 0x33); outw(n, base_io + 0x34); n += 0x0002; - atpdev->sp[0][m++] = inb(base_io + 0x30); - atpdev->sp[0][m++] = inb(base_io + 0x31); - atpdev->sp[0][m++] = inb(base_io + 0x32); - atpdev->sp[0][m++] = inb(base_io + 0x33); + atp_dev.sp[0][m++] = inb(base_io + 0x30); + atp_dev.sp[0][m++] = inb(base_io + 0x31); + atp_dev.sp[0][m++] = inb(base_io + 0x32); + atp_dev.sp[0][m++] = inb(base_io + 0x33); n += 0x0018; goto next_fblk_880; flash_ok_880: outw(0, base_io + 0x34); - atpdev->ultra_map[0] = 0; - atpdev->async[0] = 0; + atp_dev.ultra_map[0] = 0; + atp_dev.async[0] = 0; for (k = 0; k < 16; k++) { n = 1; n = n << k; - if (atpdev->sp[0][k] > 1) { - atpdev->ultra_map[0] |= n; + if (atp_dev.sp[0][k] > 1) { + atp_dev.ultra_map[0] |= n; } else { - if (atpdev->sp[0][k] == 0) - atpdev->async[0] |= n; + if (atp_dev.sp[0][k] == 0) + atp_dev.async[0] |= n; } } - atpdev->async[0] = ~(atpdev->async[0]); - outb(atpdev->global_map[0], base_io + 0x35); + atp_dev.async[0] = ~(atp_dev.async[0]); + outb(atp_dev.global_map[0], base_io + 0x35); shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit)); if (!shpnt) - goto err_nomem; + return -ENOMEM; p = (struct atp_unit *)&shpnt->hostdata; - atpdev->host = shpnt; - atpdev->pdev = pdev; + atp_dev.host = shpnt; + atp_dev.pdev = pdev; pci_set_drvdata(pdev, p); - memcpy(p, atpdev, sizeof(*atpdev)); + memcpy(p, &atp_dev, sizeof atp_dev); if (atp870u_init_tables(shpnt) < 0) { printk(KERN_ERR "Unable to allocate tables for Acard controller\n"); goto unregister; } - if (request_irq(pdev->irq, atp870u_intr_handle, IRQF_SHARED, "atp880i", shpnt)) { + if (request_irq(pdev->irq, atp870u_intr_handle, SA_SHIRQ, "atp880i", shpnt)) { printk(KERN_ERR "Unable to allocate IRQ%d for Acard controller.\n", pdev->irq); goto free_tables; } @@ -2801,31 +2798,31 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) printk(KERN_INFO " ACARD AEC-67162 PCI Ultra3 LVD Host Adapter: IO:%x, IRQ:%d.\n" , base_io, pdev->irq); - atpdev->pdev = pdev; - atpdev->dev_id = ent->device; - atpdev->baseport = base_io; - atpdev->ioport[0] = base_io + 0x80; - atpdev->ioport[1] = base_io + 0xc0; - atpdev->pciport[0] = base_io + 0x40; - atpdev->pciport[1] = base_io + 0x50; + atp_dev.pdev = pdev; + atp_dev.dev_id = ent->device; + atp_dev.baseport = base_io; + atp_dev.ioport[0] = base_io + 0x80; + atp_dev.ioport[1] = base_io + 0xc0; + atp_dev.pciport[0] = base_io + 0x40; + atp_dev.pciport[1] = base_io + 0x50; shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit)); if (!shpnt) - goto err_nomem; + return -ENOMEM; p = (struct atp_unit *)&shpnt->hostdata; - atpdev->host = shpnt; - atpdev->pdev = pdev; + atp_dev.host = shpnt; + atp_dev.pdev = pdev; pci_set_drvdata(pdev, p); - memcpy(p, atpdev, sizeof(struct atp_unit)); + memcpy(p, &atp_dev, sizeof(struct atp_unit)); if (atp870u_init_tables(shpnt) < 0) goto unregister; #ifdef ED_DBGP printk("request_irq() shpnt %p hostdata %p\n", shpnt, p); #endif - if (request_irq(pdev->irq, atp870u_intr_handle, IRQF_SHARED, "atp870u", shpnt)) { + if (request_irq(pdev->irq, atp870u_intr_handle, SA_SHIRQ, "atp870u", shpnt)) { printk(KERN_ERR "Unable to allocate IRQ for Acard controller.\n"); goto free_tables; } @@ -2977,43 +2974,43 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) printk(KERN_INFO " ACARD AEC-671X PCI Ultra/W SCSI-2/3 Host Adapter: %d " "IO:%x, IRQ:%d.\n", count, base_io, pdev->irq); - atpdev->ioport[0] = base_io; - atpdev->pciport[0] = base_io + 0x20; - atpdev->dev_id = ent->device; + atp_dev.ioport[0] = base_io; + atp_dev.pciport[0] = base_io + 0x20; + atp_dev.dev_id = ent->device; host_id &= 0x07; - atpdev->host_id[0] = host_id; + atp_dev.host_id[0] = host_id; tmport = base_io + 0x22; - atpdev->scam_on = inb(tmport); + atp_dev.scam_on = inb(tmport); tmport += 0x0b; - atpdev->global_map[0] = inb(tmport++); - atpdev->ultra_map[0] = inw(tmport); + atp_dev.global_map[0] = inb(tmport++); + atp_dev.ultra_map[0] = inw(tmport); - if (atpdev->ultra_map[0] == 0) { - atpdev->scam_on = 0x00; - atpdev->global_map[0] = 0x20; - atpdev->ultra_map[0] = 0xffff; + if (atp_dev.ultra_map[0] == 0) { + atp_dev.scam_on = 0x00; + atp_dev.global_map[0] = 0x20; + atp_dev.ultra_map[0] = 0xffff; } shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit)); if (!shpnt) - goto err_nomem; + return -ENOMEM; p = (struct atp_unit *)&shpnt->hostdata; - atpdev->host = shpnt; - atpdev->pdev = pdev; + atp_dev.host = shpnt; + atp_dev.pdev = pdev; pci_set_drvdata(pdev, p); - memcpy(p, atpdev, sizeof(*atpdev)); + memcpy(p, &atp_dev, sizeof atp_dev); if (atp870u_init_tables(shpnt) < 0) goto unregister; - if (request_irq(pdev->irq, atp870u_intr_handle, IRQF_SHARED, "atp870i", shpnt)) { + if (request_irq(pdev->irq, atp870u_intr_handle, SA_SHIRQ, "atp870i", shpnt)) { printk(KERN_ERR "Unable to allocate IRQ%d for Acard controller.\n", pdev->irq); goto free_tables; } spin_lock_irqsave(shpnt->host_lock, flags); - if (atpdev->chip_ver > 0x07) { /* check if atp876 chip then enable terminator */ + if (atp_dev.chip_ver > 0x07) { /* check if atp876 chip then enable terminator */ tmport = base_io + 0x3e; outb(0x00, tmport); } @@ -3047,7 +3044,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) outb((inb(tmport) & 0xef), tmport); tmport++; outb((inb(tmport) | 0x20), tmport); - if (atpdev->chip_ver == 4) + if (atp_dev.chip_ver == 4) shpnt->max_id = 16; else shpnt->max_id = 8; @@ -3096,12 +3093,6 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) printk("atp870u_prob:unregister\n"); scsi_host_put(shpnt); return -1; -err_eio: - kfree(atpdev); - return -EIO; -err_nomem: - kfree(atpdev); - return -ENOMEM; } /* The abort command does not leave the device in a clean state where diff --git a/trunk/drivers/scsi/blz1230.c b/trunk/drivers/scsi/blz1230.c index 329a8f297b31..3867ac2de4c2 100644 --- a/trunk/drivers/scsi/blz1230.c +++ b/trunk/drivers/scsi/blz1230.c @@ -172,7 +172,7 @@ int __init blz1230_esp_detect(struct scsi_host_template *tpnt) esp->irq = IRQ_AMIGA_PORTS; esp->slot = board+REAL_BLZ1230_ESP_ADDR; - if (request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED, + if (request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ, "Blizzard 1230 SCSI IV", esp->ehost)) goto err_out; diff --git a/trunk/drivers/scsi/blz2060.c b/trunk/drivers/scsi/blz2060.c index b6c137b97350..4ebe69e32756 100644 --- a/trunk/drivers/scsi/blz2060.c +++ b/trunk/drivers/scsi/blz2060.c @@ -146,7 +146,7 @@ int __init blz2060_esp_detect(struct scsi_host_template *tpnt) esp->esp_command_dvma = virt_to_bus((void *)cmd_buffer); esp->irq = IRQ_AMIGA_PORTS; - request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED, + request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ, "Blizzard 2060 SCSI", esp->ehost); /* Figure out our scsi ID on the bus */ diff --git a/trunk/drivers/scsi/ch.c b/trunk/drivers/scsi/ch.c index f6caa4307768..d9abd1645d15 100644 --- a/trunk/drivers/scsi/ch.c +++ b/trunk/drivers/scsi/ch.c @@ -7,6 +7,7 @@ #define VERSION "0.25" +#include #include #include #include diff --git a/trunk/drivers/scsi/constants.c b/trunk/drivers/scsi/constants.c index dddd2acce76f..d92d5040a9fe 100644 --- a/trunk/drivers/scsi/constants.c +++ b/trunk/drivers/scsi/constants.c @@ -7,6 +7,7 @@ * Additions for SPC-3 T10/1416-D Rev 21 22 Sept 2004, D. Gilbert 20041025 */ +#include #include #include #include diff --git a/trunk/drivers/scsi/cyberstorm.c b/trunk/drivers/scsi/cyberstorm.c index 7c7cfb54e897..a4a4fac5c0a1 100644 --- a/trunk/drivers/scsi/cyberstorm.c +++ b/trunk/drivers/scsi/cyberstorm.c @@ -172,7 +172,7 @@ int __init cyber_esp_detect(struct scsi_host_template *tpnt) esp->esp_command_dvma = virt_to_bus((void *)cmd_buffer); esp->irq = IRQ_AMIGA_PORTS; - request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED, + request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ, "CyberStorm SCSI", esp->ehost); /* Figure out our scsi ID on the bus */ /* The DMA cond flag contains a hardcoded jumper bit diff --git a/trunk/drivers/scsi/cyberstormII.c b/trunk/drivers/scsi/cyberstormII.c index d88cb9cf091e..3a803d73bc5f 100644 --- a/trunk/drivers/scsi/cyberstormII.c +++ b/trunk/drivers/scsi/cyberstormII.c @@ -153,7 +153,7 @@ int __init cyberII_esp_detect(struct scsi_host_template *tpnt) esp->esp_command_dvma = virt_to_bus((void *)cmd_buffer); esp->irq = IRQ_AMIGA_PORTS; - request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED, + request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ, "CyberStorm SCSI Mk II", esp->ehost); /* Figure out our scsi ID on the bus */ diff --git a/trunk/drivers/scsi/dc395x.c b/trunk/drivers/scsi/dc395x.c index ff2b1796fa34..58b0748045ee 100644 --- a/trunk/drivers/scsi/dc395x.c +++ b/trunk/drivers/scsi/dc395x.c @@ -4562,7 +4562,7 @@ static int __devinit adapter_init(struct AdapterCtlBlk *acb, acb->io_port_base = io_port; acb->io_port_len = io_port_len; - if (request_irq(irq, dc395x_interrupt, IRQF_SHARED, DC395X_NAME, acb)) { + if (request_irq(irq, dc395x_interrupt, SA_SHIRQ, DC395X_NAME, acb)) { /* release the region we just claimed */ dprintkl(KERN_INFO, "Failed to register IRQ\n"); goto failed; diff --git a/trunk/drivers/scsi/dec_esp.c b/trunk/drivers/scsi/dec_esp.c index eb32062f7e68..a35ee43a48df 100644 --- a/trunk/drivers/scsi/dec_esp.c +++ b/trunk/drivers/scsi/dec_esp.c @@ -202,19 +202,19 @@ static int dec_esp_detect(struct scsi_host_template * tpnt) esp_initialize(esp); - if (request_irq(esp->irq, esp_intr, IRQF_DISABLED, + if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, "ncr53c94", esp->ehost)) goto err_dealloc; if (request_irq(dec_interrupt[DEC_IRQ_ASC_MERR], - scsi_dma_merr_int, IRQF_DISABLED, + scsi_dma_merr_int, SA_INTERRUPT, "ncr53c94 error", esp->ehost)) goto err_free_irq; if (request_irq(dec_interrupt[DEC_IRQ_ASC_ERR], - scsi_dma_err_int, IRQF_DISABLED, + scsi_dma_err_int, SA_INTERRUPT, "ncr53c94 overrun", esp->ehost)) goto err_free_irq_merr; if (request_irq(dec_interrupt[DEC_IRQ_ASC_DMA], - scsi_dma_int, IRQF_DISABLED, + scsi_dma_int, SA_INTERRUPT, "ncr53c94 dma", esp->ehost)) goto err_free_irq_err; @@ -276,7 +276,7 @@ static int dec_esp_detect(struct scsi_host_template * tpnt) esp->dma_mmu_release_scsi_sgl = 0; esp->dma_advance_sg = 0; - if (request_irq(esp->irq, esp_intr, IRQF_DISABLED, + if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, "PMAZ_AA", esp->ehost)) { esp_deallocate(esp); release_tc_card(slot); diff --git a/trunk/drivers/scsi/dmx3191d.c b/trunk/drivers/scsi/dmx3191d.c index 879a26657676..38e4010eff96 100644 --- a/trunk/drivers/scsi/dmx3191d.c +++ b/trunk/drivers/scsi/dmx3191d.c @@ -94,7 +94,7 @@ static int __devinit dmx3191d_probe_one(struct pci_dev *pdev, NCR5380_init(shost, FLAG_NO_PSEUDO_DMA | FLAG_DTC3181E); - if (request_irq(pdev->irq, NCR5380_intr, IRQF_SHARED, + if (request_irq(pdev->irq, NCR5380_intr, SA_SHIRQ, DMX3191D_DRIVER_NAME, shost)) { /* * Steam powered scsi controllers run without an IRQ anyway diff --git a/trunk/drivers/scsi/dpt/dpti_i2o.h b/trunk/drivers/scsi/dpt/dpti_i2o.h index d84a281ad944..a9585f5235d9 100644 --- a/trunk/drivers/scsi/dpt/dpti_i2o.h +++ b/trunk/drivers/scsi/dpt/dpti_i2o.h @@ -23,6 +23,7 @@ #include /* Needed for MUTEX init macros */ #include +#include #include #include diff --git a/trunk/drivers/scsi/dpt_i2o.c b/trunk/drivers/scsi/dpt_i2o.c index e1337339cacc..b1b704a42efd 100644 --- a/trunk/drivers/scsi/dpt_i2o.c +++ b/trunk/drivers/scsi/dpt_i2o.c @@ -1009,7 +1009,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev printk(KERN_INFO" BAR1 %p - size= %x\n",msg_addr_virt,hba_map1_area_size); } - if (request_irq (pDev->irq, adpt_isr, IRQF_SHARED, pHba->name, pHba)) { + if (request_irq (pDev->irq, adpt_isr, SA_SHIRQ, pHba->name, pHba)) { printk(KERN_ERR"%s: Couldn't register IRQ %d\n", pHba->name, pDev->irq); adpt_i2o_delete_hba(pHba); return -EINVAL; diff --git a/trunk/drivers/scsi/dtc.c b/trunk/drivers/scsi/dtc.c index 0d5713dfa204..c5108c8c887b 100644 --- a/trunk/drivers/scsi/dtc.c +++ b/trunk/drivers/scsi/dtc.c @@ -280,7 +280,7 @@ static int __init dtc_detect(struct scsi_host_template * tpnt) /* With interrupts enabled, it will sometimes hang when doing heavy * reads. So better not enable them until I finger it out. */ if (instance->irq != SCSI_IRQ_NONE) - if (request_irq(instance->irq, dtc_intr, IRQF_DISABLED, "dtc", instance)) { + if (request_irq(instance->irq, dtc_intr, SA_INTERRUPT, "dtc", instance)) { printk(KERN_ERR "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); instance->irq = SCSI_IRQ_NONE; } diff --git a/trunk/drivers/scsi/eata.c b/trunk/drivers/scsi/eata.c index a5ff43b1b263..059eeee4b554 100644 --- a/trunk/drivers/scsi/eata.c +++ b/trunk/drivers/scsi/eata.c @@ -477,6 +477,7 @@ * the driver sets host->wish_block = 1 for all ISA boards. */ +#include #include #include #include @@ -1221,7 +1222,7 @@ static int port_detect(unsigned long port_base, unsigned int j, /* Board detected, allocate its IRQ */ if (request_irq(irq, do_interrupt_handler, - IRQF_DISABLED | ((subversion == ESA) ? IRQF_SHARED : 0), + SA_INTERRUPT | ((subversion == ESA) ? SA_SHIRQ : 0), driver_name, (void *)&sha[j])) { printk("%s: unable to allocate IRQ %u, detaching.\n", name, irq); diff --git a/trunk/drivers/scsi/eata_pio.c b/trunk/drivers/scsi/eata_pio.c index 771b01984cbc..23beb48c79c5 100644 --- a/trunk/drivers/scsi/eata_pio.c +++ b/trunk/drivers/scsi/eata_pio.c @@ -46,6 +46,7 @@ * last change: 2002/11/02 OS: Linux 2.5.45 * ************************************************************/ +#include #include #include #include @@ -731,7 +732,7 @@ static int register_pio_HBA(long base, struct get_conf *gc) return 0; if (!reg_IRQ[gc->IRQ]) { /* Interrupt already registered ? */ - if (!request_irq(gc->IRQ, do_eata_pio_int_handler, IRQF_DISABLED, "EATA-PIO", sh)) { + if (!request_irq(gc->IRQ, do_eata_pio_int_handler, SA_INTERRUPT, "EATA-PIO", sh)) { reg_IRQ[gc->IRQ]++; if (!gc->IRQ_TR) reg_IRQL[gc->IRQ] = 1; /* IRQ is edge triggered */ @@ -965,7 +966,7 @@ static int eata_pio_detect(struct scsi_host_template *tpnt) for (i = 0; i <= MAXIRQ; i++) if (reg_IRQ[i]) - request_irq(i, do_eata_pio_int_handler, IRQF_DISABLED, "EATA-PIO", NULL); + request_irq(i, do_eata_pio_int_handler, SA_INTERRUPT, "EATA-PIO", NULL); HBA_ptr = first_HBA; diff --git a/trunk/drivers/scsi/esp.c b/trunk/drivers/scsi/esp.c index 10573c24a50b..ddb512463b45 100644 --- a/trunk/drivers/scsi/esp.c +++ b/trunk/drivers/scsi/esp.c @@ -12,6 +12,7 @@ * 3) Add tagged queueing. */ +#include #include #include #include @@ -778,7 +779,7 @@ static int __init esp_register_irq(struct esp *esp) * sanely maintain. */ if (request_irq(esp->ehost->irq, esp_intr, - IRQF_SHARED, "ESP SCSI", esp)) { + SA_SHIRQ, "ESP SCSI", esp)) { printk("esp%d: Cannot acquire irq line\n", esp->esp_id); return -1; diff --git a/trunk/drivers/scsi/fastlane.c b/trunk/drivers/scsi/fastlane.c index 2a1c5c22b9e0..8ae9c406a83b 100644 --- a/trunk/drivers/scsi/fastlane.c +++ b/trunk/drivers/scsi/fastlane.c @@ -210,7 +210,7 @@ int __init fastlane_esp_detect(struct scsi_host_template *tpnt) esp->irq = IRQ_AMIGA_PORTS; esp->slot = board+FASTLANE_ESP_ADDR; - if (request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED, + if (request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ, "Fastlane SCSI", esp->ehost)) { printk(KERN_WARNING "Fastlane: Could not get IRQ%d, aborting.\n", IRQ_AMIGA_PORTS); goto err_unmap; diff --git a/trunk/drivers/scsi/fcal.c b/trunk/drivers/scsi/fcal.c index 7f891023aa15..03416548f20c 100644 --- a/trunk/drivers/scsi/fcal.c +++ b/trunk/drivers/scsi/fcal.c @@ -13,6 +13,7 @@ #include #include #include +#include #ifdef CONFIG_KMOD #include #endif diff --git a/trunk/drivers/scsi/fd_mcs.c b/trunk/drivers/scsi/fd_mcs.c index dde3edf35c03..70a1606bd580 100644 --- a/trunk/drivers/scsi/fd_mcs.c +++ b/trunk/drivers/scsi/fd_mcs.c @@ -400,7 +400,7 @@ static int fd_mcs_detect(struct scsi_host_template * tpnt) mca_set_adapter_name(slot - 1, fd_mcs_adapters[loop].name); /* check irq/region */ - if (request_irq(irq, fd_mcs_intr, IRQF_SHARED, "fd_mcs", hosts)) { + if (request_irq(irq, fd_mcs_intr, SA_SHIRQ, "fd_mcs", hosts)) { printk(KERN_ERR "fd_mcs: interrupt is not available, skipping...\n"); continue; } diff --git a/trunk/drivers/scsi/fdomain.c b/trunk/drivers/scsi/fdomain.c index b0694dcce246..e16013f0ad6e 100644 --- a/trunk/drivers/scsi/fdomain.c +++ b/trunk/drivers/scsi/fdomain.c @@ -266,6 +266,7 @@ **************************************************************************/ +#include #include #include #include @@ -949,7 +950,7 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) /* Register the IRQ with the kernel */ retcode = request_irq( interrupt_level, - do_fdomain_16x0_intr, pdev?IRQF_SHARED:0, "fdomain", shpnt); + do_fdomain_16x0_intr, pdev?SA_SHIRQ:0, "fdomain", shpnt); if (retcode < 0) { if (retcode == -EINVAL) { diff --git a/trunk/drivers/scsi/g_NCR5380.c b/trunk/drivers/scsi/g_NCR5380.c index 67f1100f3103..5f313c93b7a9 100644 --- a/trunk/drivers/scsi/g_NCR5380.c +++ b/trunk/drivers/scsi/g_NCR5380.c @@ -91,6 +91,7 @@ #define AUTOPROBE_IRQ #define AUTOSENSE +#include #ifdef CONFIG_SCSI_GENERIC_NCR53C400 #define NCR53C400_PSEUDO_DMA 1 @@ -461,7 +462,7 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) instance->irq = NCR5380_probe_irq(instance, 0xffff); if (instance->irq != SCSI_IRQ_NONE) - if (request_irq(instance->irq, generic_NCR5380_intr, IRQF_DISABLED, "NCR5380", instance)) { + if (request_irq(instance->irq, generic_NCR5380_intr, SA_INTERRUPT, "NCR5380", instance)) { printk(KERN_WARNING "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); instance->irq = SCSI_IRQ_NONE; } diff --git a/trunk/drivers/scsi/g_NCR5380.h b/trunk/drivers/scsi/g_NCR5380.h index df0b3f69ef63..d60a89cb8052 100644 --- a/trunk/drivers/scsi/g_NCR5380.h +++ b/trunk/drivers/scsi/g_NCR5380.h @@ -32,6 +32,7 @@ #ifndef GENERIC_NCR5380_H #define GENERIC_NCR5380_H +#include #define GENERIC_NCR5380_PUBLIC_RELEASE 1 diff --git a/trunk/drivers/scsi/gdth.c b/trunk/drivers/scsi/gdth.c index 43afd476e606..76071a158306 100644 --- a/trunk/drivers/scsi/gdth.c +++ b/trunk/drivers/scsi/gdth.c @@ -4350,7 +4350,7 @@ static int __init gdth_detect(Scsi_Host_Template *shtp) printk("Configuring GDT-ISA HA at BIOS 0x%05X IRQ %u DRQ %u\n", isa_bios,ha->irq,ha->drq); - if (request_irq(ha->irq,gdth_interrupt,IRQF_DISABLED,"gdth",ha)) { + if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha)) { printk("GDT-ISA: Unable to allocate IRQ\n"); scsi_unregister(shp); continue; @@ -4476,7 +4476,7 @@ static int __init gdth_detect(Scsi_Host_Template *shtp) printk("Configuring GDT-EISA HA at Slot %d IRQ %u\n", eisa_slot>>12,ha->irq); - if (request_irq(ha->irq,gdth_interrupt,IRQF_DISABLED,"gdth",ha)) { + if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha)) { printk("GDT-EISA: Unable to allocate IRQ\n"); scsi_unregister(shp); continue; @@ -4603,7 +4603,7 @@ static int __init gdth_detect(Scsi_Host_Template *shtp) pcistr[ctr].bus,PCI_SLOT(pcistr[ctr].device_fn),ha->irq); if (request_irq(ha->irq, gdth_interrupt, - IRQF_DISABLED|IRQF_SHARED, "gdth", ha)) + SA_INTERRUPT|SA_SHIRQ, "gdth", ha)) { printk("GDT-PCI: Unable to allocate IRQ\n"); scsi_unregister(shp); diff --git a/trunk/drivers/scsi/gvp11.c b/trunk/drivers/scsi/gvp11.c index a0d831b1bada..5b154498056d 100644 --- a/trunk/drivers/scsi/gvp11.c +++ b/trunk/drivers/scsi/gvp11.c @@ -328,7 +328,7 @@ int __init gvp11_detect(struct scsi_host_template *tpnt) (epc & GVP_SCSICLKMASK) ? WD33C93_FS_8_10 : WD33C93_FS_12_15); - request_irq(IRQ_AMIGA_PORTS, gvp11_intr, IRQF_SHARED, "GVP11 SCSI", + request_irq(IRQ_AMIGA_PORTS, gvp11_intr, SA_SHIRQ, "GVP11 SCSI", instance); DMA(instance)->CNTR = GVP11_DMAC_INT_ENABLE; num_gvp11++; diff --git a/trunk/drivers/scsi/hptiop.c b/trunk/drivers/scsi/hptiop.c index ab2f8b267908..f77808329e7c 100644 --- a/trunk/drivers/scsi/hptiop.c +++ b/trunk/drivers/scsi/hptiop.c @@ -1304,7 +1304,7 @@ static int __devinit hptiop_probe(struct pci_dev *pcidev, pci_set_drvdata(pcidev, host); - if (request_irq(pcidev->irq, hptiop_intr, IRQF_SHARED, + if (request_irq(pcidev->irq, hptiop_intr, SA_SHIRQ, driver_name, hba)) { printk(KERN_ERR "scsi%d: request irq %d failed\n", hba->host->host_no, pcidev->irq); diff --git a/trunk/drivers/scsi/ibmmca.c b/trunk/drivers/scsi/ibmmca.c index 2be1dc5d852a..497f6642b2dc 100644 --- a/trunk/drivers/scsi/ibmmca.c +++ b/trunk/drivers/scsi/ibmmca.c @@ -17,6 +17,7 @@ */ +#include #include #include #include @@ -1510,7 +1511,7 @@ int ibmmca_detect(struct scsi_host_template * scsi_template) #endif /* get interrupt request level */ - if (request_irq(IM_IRQ, interrupt_handler, IRQF_SHARED, "ibmmcascsi", hosts)) { + if (request_irq(IM_IRQ, interrupt_handler, SA_SHIRQ, "ibmmcascsi", hosts)) { printk(KERN_ERR "IBM MCA SCSI: Unable to get shared IRQ %d.\n", IM_IRQ); return 0; } else @@ -1635,7 +1636,7 @@ int ibmmca_detect(struct scsi_host_template * scsi_template) /* IRQ11 is used by SCSI-2 F/W Adapter/A */ printk(KERN_DEBUG "IBM MCA SCSI: SCSI-2 F/W adapter needs IRQ 11.\n"); /* get interrupt request level */ - if (request_irq(IM_IRQ_FW, interrupt_handler, IRQF_SHARED, "ibmmcascsi", hosts)) { + if (request_irq(IM_IRQ_FW, interrupt_handler, SA_SHIRQ, "ibmmcascsi", hosts)) { printk(KERN_ERR "IBM MCA SCSI: Unable to get shared IRQ %d.\n", IM_IRQ_FW); } else IRQ11_registered++; @@ -1696,7 +1697,7 @@ int ibmmca_detect(struct scsi_host_template * scsi_template) /* IRQ11 is used by SCSI-2 F/W Adapter/A */ printk(KERN_DEBUG "IBM MCA SCSI: SCSI-2 F/W adapter needs IRQ 11.\n"); /* get interrupt request level */ - if (request_irq(IM_IRQ_FW, interrupt_handler, IRQF_SHARED, "ibmmcascsi", hosts)) + if (request_irq(IM_IRQ_FW, interrupt_handler, SA_SHIRQ, "ibmmcascsi", hosts)) printk(KERN_ERR "IBM MCA SCSI: Unable to get shared IRQ %d.\n", IM_IRQ_FW); else IRQ11_registered++; diff --git a/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c b/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c index 669ea4fff166..944fc1203ebd 100644 --- a/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -535,7 +535,6 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, struct ibmvscsi_host_data *hostdata) { u64 *crq_as_u64 = (u64 *) &evt_struct->crq; - int request_status; int rc; /* If we have exhausted our request limit, just fail this request. @@ -543,18 +542,9 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, * (such as task management requests) that the mid layer may think we * can handle more requests (can_queue) when we actually can't */ - if (evt_struct->crq.format == VIOSRP_SRP_FORMAT) { - request_status = - atomic_dec_if_positive(&hostdata->request_limit); - /* If request limit was -1 when we started, it is now even - * less than that - */ - if (request_status < -1) - goto send_error; - /* Otherwise, if we have run out of requests */ - else if (request_status < 0) - goto send_busy; - } + if ((evt_struct->crq.format == VIOSRP_SRP_FORMAT) && + (atomic_dec_if_positive(&hostdata->request_limit) < 0)) + goto send_error; /* Copy the IU into the transfer area */ *evt_struct->xfer_iu = evt_struct->iu; @@ -577,23 +567,11 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, return 0; - send_busy: - unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev); - - free_event_struct(&hostdata->pool, evt_struct); - return SCSI_MLQUEUE_HOST_BUSY; - send_error: unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev); - if (evt_struct->cmnd != NULL) { - evt_struct->cmnd->result = DID_ERROR << 16; - evt_struct->cmnd_done(evt_struct->cmnd); - } else if (evt_struct->done) - evt_struct->done(evt_struct); - free_event_struct(&hostdata->pool, evt_struct); - return 0; + return SCSI_MLQUEUE_HOST_BUSY; } /** @@ -1206,37 +1184,27 @@ void ibmvscsi_handle_crq(struct viosrp_crq *crq, return; case 0xFF: /* Hypervisor telling us the connection is closed */ scsi_block_requests(hostdata->host); - atomic_set(&hostdata->request_limit, 0); if (crq->format == 0x06) { /* We need to re-setup the interpartition connection */ printk(KERN_INFO "ibmvscsi: Re-enabling adapter!\n"); + atomic_set(&hostdata->request_limit, -1); purge_requests(hostdata, DID_REQUEUE); - if ((ibmvscsi_reenable_crq_queue(&hostdata->queue, - hostdata) == 0) || - (ibmvscsi_send_crq(hostdata, - 0xC001000000000000LL, 0))) { - atomic_set(&hostdata->request_limit, - -1); + if (ibmvscsi_reenable_crq_queue(&hostdata->queue, + hostdata) == 0) + if (ibmvscsi_send_crq(hostdata, + 0xC001000000000000LL, 0)) printk(KERN_ERR - "ibmvscsi: error after" + "ibmvscsi: transmit error after" " enable\n"); - } } else { printk(KERN_INFO "ibmvscsi: Virtual adapter failed rc %d!\n", crq->format); + atomic_set(&hostdata->request_limit, -1); purge_requests(hostdata, DID_ERROR); - if ((ibmvscsi_reset_crq_queue(&hostdata->queue, - hostdata)) || - (ibmvscsi_send_crq(hostdata, - 0xC001000000000000LL, 0))) { - atomic_set(&hostdata->request_limit, - -1); - printk(KERN_ERR - "ibmvscsi: error after reset\n"); - } + ibmvscsi_reset_crq_queue(&hostdata->queue, hostdata); } scsi_unblock_requests(hostdata->host); return; @@ -1499,7 +1467,6 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) struct Scsi_Host *host; struct device *dev = &vdev->dev; unsigned long wait_switch = 0; - int rc; vdev->dev.driver_data = NULL; @@ -1517,8 +1484,8 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) atomic_set(&hostdata->request_limit, -1); hostdata->host->max_sectors = 32 * 8; /* default max I/O 32 pages */ - rc = ibmvscsi_init_crq_queue(&hostdata->queue, hostdata, max_requests); - if (rc != 0 && rc != H_RESOURCE) { + if (ibmvscsi_init_crq_queue(&hostdata->queue, hostdata, + max_requests) != 0) { printk(KERN_ERR "ibmvscsi: couldn't initialize crq\n"); goto init_crq_failed; } @@ -1538,8 +1505,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) * to fail if the other end is not acive. In that case we don't * want to scan */ - if (ibmvscsi_send_crq(hostdata, 0xC001000000000000LL, 0) == 0 - || rc == H_RESOURCE) { + if (ibmvscsi_send_crq(hostdata, 0xC001000000000000LL, 0) == 0) { /* * Wait around max init_timeout secs for the adapter to finish * initializing. When we are done initializing, we will have a diff --git a/trunk/drivers/scsi/ibmvscsi/rpa_vscsi.c b/trunk/drivers/scsi/ibmvscsi/rpa_vscsi.c index 242b8873b333..1a9992bdfef8 100644 --- a/trunk/drivers/scsi/ibmvscsi/rpa_vscsi.c +++ b/trunk/drivers/scsi/ibmvscsi/rpa_vscsi.c @@ -208,7 +208,6 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, int max_requests) { int rc; - int retrc; struct vio_dev *vdev = to_vio_dev(hostdata->dev); queue->msgs = (struct viosrp_crq *)get_zeroed_page(GFP_KERNEL); @@ -227,7 +226,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, gather_partition_info(); set_adapter_info(hostdata); - retrc = rc = plpar_hcall_norets(H_REG_CRQ, + rc = plpar_hcall_norets(H_REG_CRQ, vdev->unit_address, queue->msg_token, PAGE_SIZE); if (rc == H_RESOURCE) @@ -264,7 +263,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, tasklet_init(&hostdata->srp_task, (void *)ibmvscsi_task, (unsigned long)hostdata); - return retrc; + return 0; req_irq_failed: do { diff --git a/trunk/drivers/scsi/ide-scsi.c b/trunk/drivers/scsi/ide-scsi.c index f7b5d7372d26..988e6f7af01a 100644 --- a/trunk/drivers/scsi/ide-scsi.c +++ b/trunk/drivers/scsi/ide-scsi.c @@ -34,6 +34,7 @@ #define IDESCSI_VERSION "0.92" #include +#include #include #include #include diff --git a/trunk/drivers/scsi/imm.c b/trunk/drivers/scsi/imm.c index 2d95ac9c32c1..681bd18493f3 100644 --- a/trunk/drivers/scsi/imm.c +++ b/trunk/drivers/scsi/imm.c @@ -8,6 +8,7 @@ * future expansion to five letters. */ +#include #include #include #include diff --git a/trunk/drivers/scsi/in2000.c b/trunk/drivers/scsi/in2000.c index 59a4097f1254..883bc92b4d9a 100644 --- a/trunk/drivers/scsi/in2000.c +++ b/trunk/drivers/scsi/in2000.c @@ -2015,7 +2015,7 @@ static int __init in2000_detect(struct scsi_host_template * tpnt) write1_io(0, IO_FIFO_READ); /* start fifo out in read mode */ write1_io(0, IO_INTR_MASK); /* allow all ints */ x = int_tab[(switches & (SW_INT0 | SW_INT1)) >> SW_INT_SHIFT]; - if (request_irq(x, in2000_intr, IRQF_DISABLED, "in2000", instance)) { + if (request_irq(x, in2000_intr, SA_INTERRUPT, "in2000", instance)) { printk("in2000_detect: Unable to allocate IRQ.\n"); detect_count--; continue; diff --git a/trunk/drivers/scsi/initio.c b/trunk/drivers/scsi/initio.c index 9e10dac61cfd..913ba95f85bd 100644 --- a/trunk/drivers/scsi/initio.c +++ b/trunk/drivers/scsi/initio.c @@ -118,6 +118,7 @@ #include #include #include +#include #include #include #include @@ -2867,7 +2868,7 @@ static int i91u_detect(struct scsi_host_template * tpnt) hreg->sg_tablesize = TOTAL_SG_ENTRY; /* Maximun support is 32 */ /* Initial tulip chip */ - ok = request_irq(pHCB->HCS_Intr, i91u_intr, IRQF_DISABLED | IRQF_SHARED, "i91u", hreg); + ok = request_irq(pHCB->HCS_Intr, i91u_intr, SA_INTERRUPT | SA_SHIRQ, "i91u", hreg); if (ok < 0) { printk(KERN_WARNING "i91u: unable to request IRQ %d\n\n", pHCB->HCS_Intr); return 0; diff --git a/trunk/drivers/scsi/initio.h b/trunk/drivers/scsi/initio.h index acb67a4af2cc..3efb1184fc39 100644 --- a/trunk/drivers/scsi/initio.h +++ b/trunk/drivers/scsi/initio.h @@ -54,6 +54,7 @@ **************************************************************************/ +#include #include #define ULONG unsigned long @@ -192,13 +193,13 @@ typedef struct { #define TSC_SEL_ATN_DIRECT_OUT 0x15 /* Select With ATN Sequence */ #define TSC_SEL_ATN3_DIRECT_IN 0xB5 /* Select With ATN3 Sequence */ #define TSC_SEL_ATN3_DIRECT_OUT 0x35 /* Select With ATN3 Sequence */ -#define TSC_XF_DMA_OUT_DIRECT 0x06 /* DMA Xfer Information out */ -#define TSC_XF_DMA_IN_DIRECT 0x86 /* DMA Xfer Information in */ +#define TSC_XF_DMA_OUT_DIRECT 0x06 /* DMA Xfer Infomation out */ +#define TSC_XF_DMA_IN_DIRECT 0x86 /* DMA Xfer Infomation in */ -#define TSC_XF_DMA_OUT 0x43 /* DMA Xfer Information out */ -#define TSC_XF_DMA_IN 0xC3 /* DMA Xfer Information in */ -#define TSC_XF_FIFO_OUT 0x03 /* FIFO Xfer Information out */ -#define TSC_XF_FIFO_IN 0x83 /* FIFO Xfer Information in */ +#define TSC_XF_DMA_OUT 0x43 /* DMA Xfer Infomation out */ +#define TSC_XF_DMA_IN 0xC3 /* DMA Xfer Infomation in */ +#define TSC_XF_FIFO_OUT 0x03 /* FIFO Xfer Infomation out */ +#define TSC_XF_FIFO_IN 0x83 /* FIFO Xfer Infomation in */ #define TSC_MSG_ACCEPT 0x0F /* Message Accept */ diff --git a/trunk/drivers/scsi/ipr.c b/trunk/drivers/scsi/ipr.c index 01080b3acf5e..96b65b307dd0 100644 --- a/trunk/drivers/scsi/ipr.c +++ b/trunk/drivers/scsi/ipr.c @@ -54,6 +54,7 @@ * */ +#include #include #include #include @@ -6428,7 +6429,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev, ioa_cfg->needs_hard_reset = 1; ipr_mask_and_clear_interrupts(ioa_cfg, ~IPR_PCII_IOA_TRANS_TO_OPER); - rc = request_irq(pdev->irq, ipr_isr, IRQF_SHARED, IPR_NAME, ioa_cfg); + rc = request_irq(pdev->irq, ipr_isr, SA_SHIRQ, IPR_NAME, ioa_cfg); if (rc) { dev_err(&pdev->dev, "Couldn't register IRQ %d! rc=%d\n", diff --git a/trunk/drivers/scsi/ips.c b/trunk/drivers/scsi/ips.c index 3c639286ec1e..78f2ff736c3e 100644 --- a/trunk/drivers/scsi/ips.c +++ b/trunk/drivers/scsi/ips.c @@ -196,6 +196,7 @@ #include #include +#include #include #include @@ -7007,7 +7008,7 @@ ips_register_scsi(int index) memcpy(ha, oldha, sizeof (ips_ha_t)); free_irq(oldha->irq, oldha); /* Install the interrupt handler with the new ha */ - if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { + if (request_irq(ha->irq, do_ipsintr, SA_SHIRQ, ips_name, ha)) { IPS_PRINTK(KERN_WARNING, ha->pcidev, "Unable to install interrupt handler\n"); scsi_host_put(sh); @@ -7419,7 +7420,7 @@ ips_init_phase2(int index) } /* Install the interrupt handler */ - if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { + if (request_irq(ha->irq, do_ipsintr, SA_SHIRQ, ips_name, ha)) { IPS_PRINTK(KERN_WARNING, ha->pcidev, "Unable to install interrupt handler\n"); return ips_abort_init(ha, index); diff --git a/trunk/drivers/scsi/iscsi_tcp.c b/trunk/drivers/scsi/iscsi_tcp.c index 848fb2aa4ca3..b4743a9ecc80 100644 --- a/trunk/drivers/scsi/iscsi_tcp.c +++ b/trunk/drivers/scsi/iscsi_tcp.c @@ -2130,21 +2130,19 @@ iscsi_r2tpool_free(struct iscsi_session *session) static int iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param, - char *buf, int buflen) + uint32_t value) { struct iscsi_conn *conn = cls_conn->dd_data; struct iscsi_session *session = conn->session; struct iscsi_tcp_conn *tcp_conn = conn->dd_data; - int value; switch(param) { case ISCSI_PARAM_MAX_RECV_DLENGTH: { char *saveptr = tcp_conn->data; gfp_t flags = GFP_KERNEL; - sscanf(buf, "%d", &value); if (tcp_conn->data_size >= value) { - iscsi_set_param(cls_conn, param, buf, buflen); + conn->max_recv_dlength = value; break; } @@ -2167,12 +2165,15 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param, else free_pages((unsigned long)saveptr, get_order(tcp_conn->data_size)); - iscsi_set_param(cls_conn, param, buf, buflen); + conn->max_recv_dlength = value; tcp_conn->data_size = value; - break; } + break; + case ISCSI_PARAM_MAX_XMIT_DLENGTH: + conn->max_xmit_dlength = value; + break; case ISCSI_PARAM_HDRDGST_EN: - iscsi_set_param(cls_conn, param, buf, buflen); + conn->hdrdgst_en = value; tcp_conn->hdr_size = sizeof(struct iscsi_hdr); if (conn->hdrdgst_en) { tcp_conn->hdr_size += sizeof(__u32); @@ -2196,7 +2197,7 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param, } break; case ISCSI_PARAM_DATADGST_EN: - iscsi_set_param(cls_conn, param, buf, buflen); + conn->datadgst_en = value; if (conn->datadgst_en) { if (!tcp_conn->data_tx_tfm) tcp_conn->data_tx_tfm = @@ -2219,36 +2220,121 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param, tcp_conn->sendpage = conn->datadgst_en ? sock_no_sendpage : tcp_conn->sock->ops->sendpage; break; + case ISCSI_PARAM_INITIAL_R2T_EN: + session->initial_r2t_en = value; + break; case ISCSI_PARAM_MAX_R2T: - sscanf(buf, "%d", &value); if (session->max_r2t == roundup_pow_of_two(value)) break; iscsi_r2tpool_free(session); - iscsi_set_param(cls_conn, param, buf, buflen); + session->max_r2t = value; if (session->max_r2t & (session->max_r2t - 1)) session->max_r2t = roundup_pow_of_two(session->max_r2t); if (iscsi_r2tpool_alloc(session)) return -ENOMEM; break; + case ISCSI_PARAM_IMM_DATA_EN: + session->imm_data_en = value; + break; + case ISCSI_PARAM_FIRST_BURST: + session->first_burst = value; + break; + case ISCSI_PARAM_MAX_BURST: + session->max_burst = value; + break; + case ISCSI_PARAM_PDU_INORDER_EN: + session->pdu_inorder_en = value; + break; + case ISCSI_PARAM_DATASEQ_INORDER_EN: + session->dataseq_inorder_en = value; + break; + case ISCSI_PARAM_ERL: + session->erl = value; + break; + case ISCSI_PARAM_IFMARKER_EN: + BUG_ON(value); + session->ifmarker_en = value; + break; + case ISCSI_PARAM_OFMARKER_EN: + BUG_ON(value); + session->ofmarker_en = value; + break; + case ISCSI_PARAM_EXP_STATSN: + conn->exp_statsn = value; + break; default: - return iscsi_set_param(cls_conn, param, buf, buflen); + break; } return 0; } static int -iscsi_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn, - enum iscsi_param param, char *buf) +iscsi_session_get_param(struct iscsi_cls_session *cls_session, + enum iscsi_param param, uint32_t *value) +{ + struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); + struct iscsi_session *session = iscsi_hostdata(shost->hostdata); + + switch(param) { + case ISCSI_PARAM_INITIAL_R2T_EN: + *value = session->initial_r2t_en; + break; + case ISCSI_PARAM_MAX_R2T: + *value = session->max_r2t; + break; + case ISCSI_PARAM_IMM_DATA_EN: + *value = session->imm_data_en; + break; + case ISCSI_PARAM_FIRST_BURST: + *value = session->first_burst; + break; + case ISCSI_PARAM_MAX_BURST: + *value = session->max_burst; + break; + case ISCSI_PARAM_PDU_INORDER_EN: + *value = session->pdu_inorder_en; + break; + case ISCSI_PARAM_DATASEQ_INORDER_EN: + *value = session->dataseq_inorder_en; + break; + case ISCSI_PARAM_ERL: + *value = session->erl; + break; + case ISCSI_PARAM_IFMARKER_EN: + *value = session->ifmarker_en; + break; + case ISCSI_PARAM_OFMARKER_EN: + *value = session->ofmarker_en; + break; + default: + return -EINVAL; + } + + return 0; +} + +static int +iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, + enum iscsi_param param, uint32_t *value) { struct iscsi_conn *conn = cls_conn->dd_data; struct iscsi_tcp_conn *tcp_conn = conn->dd_data; struct inet_sock *inet; - struct ipv6_pinfo *np; - struct sock *sk; - int len; switch(param) { + case ISCSI_PARAM_MAX_RECV_DLENGTH: + *value = conn->max_recv_dlength; + break; + case ISCSI_PARAM_MAX_XMIT_DLENGTH: + *value = conn->max_xmit_dlength; + break; + case ISCSI_PARAM_HDRDGST_EN: + *value = conn->hdrdgst_en; + break; + case ISCSI_PARAM_DATADGST_EN: + *value = conn->datadgst_en; + break; case ISCSI_PARAM_CONN_PORT: mutex_lock(&conn->xmitmutex); if (!tcp_conn->sock) { @@ -2257,9 +2343,30 @@ iscsi_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn, } inet = inet_sk(tcp_conn->sock->sk); - len = sprintf(buf, "%hu\n", be16_to_cpu(inet->dport)); + *value = be16_to_cpu(inet->dport); mutex_unlock(&conn->xmitmutex); + case ISCSI_PARAM_EXP_STATSN: + *value = conn->exp_statsn; break; + default: + return -EINVAL; + } + + return 0; +} + +static int +iscsi_conn_get_str_param(struct iscsi_cls_conn *cls_conn, + enum iscsi_param param, char *buf) +{ + struct iscsi_conn *conn = cls_conn->dd_data; + struct iscsi_tcp_conn *tcp_conn = conn->dd_data; + struct sock *sk; + struct inet_sock *inet; + struct ipv6_pinfo *np; + int len = 0; + + switch (param) { case ISCSI_PARAM_CONN_ADDRESS: mutex_lock(&conn->xmitmutex); if (!tcp_conn->sock) { @@ -2281,7 +2388,7 @@ iscsi_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn, mutex_unlock(&conn->xmitmutex); break; default: - return iscsi_conn_get_param(cls_conn, param, buf); + return -EINVAL; } return len; @@ -2394,11 +2501,7 @@ static struct iscsi_transport iscsi_tcp_transport = { ISCSI_ERL | ISCSI_CONN_PORT | ISCSI_CONN_ADDRESS | - ISCSI_EXP_STATSN | - ISCSI_PERSISTENT_PORT | - ISCSI_PERSISTENT_ADDRESS | - ISCSI_TARGET_NAME | - ISCSI_TPGT, + ISCSI_EXP_STATSN, .host_template = &iscsi_sht, .conndata_size = sizeof(struct iscsi_conn), .max_conn = 1, @@ -2411,7 +2514,8 @@ static struct iscsi_transport iscsi_tcp_transport = { .bind_conn = iscsi_tcp_conn_bind, .destroy_conn = iscsi_tcp_conn_destroy, .set_param = iscsi_conn_set_param, - .get_conn_param = iscsi_tcp_conn_get_param, + .get_conn_param = iscsi_conn_get_param, + .get_conn_str_param = iscsi_conn_get_str_param, .get_session_param = iscsi_session_get_param, .start_conn = iscsi_conn_start, .stop_conn = iscsi_conn_stop, diff --git a/trunk/drivers/scsi/jazz_esp.c b/trunk/drivers/scsi/jazz_esp.c index 3fd8a96f2af3..fc031c76dade 100644 --- a/trunk/drivers/scsi/jazz_esp.c +++ b/trunk/drivers/scsi/jazz_esp.c @@ -131,7 +131,7 @@ static int jazz_esp_detect(struct scsi_host_template *tpnt) esp->esp_command_dvma = vdma_alloc(CPHYSADDR(cmd_buffer), sizeof (cmd_buffer)); esp->irq = JAZZ_SCSI_IRQ; - request_irq(JAZZ_SCSI_IRQ, esp_intr, IRQF_DISABLED, "JAZZ SCSI", + request_irq(JAZZ_SCSI_IRQ, esp_intr, SA_INTERRUPT, "JAZZ SCSI", esp->ehost); /* diff --git a/trunk/drivers/scsi/lasi700.c b/trunk/drivers/scsi/lasi700.c index f0871c3ac3d9..eb7bd310cc82 100644 --- a/trunk/drivers/scsi/lasi700.c +++ b/trunk/drivers/scsi/lasi700.c @@ -131,7 +131,7 @@ lasi700_probe(struct parisc_device *dev) host->this_id = 7; host->base = base; host->irq = dev->irq; - if(request_irq(dev->irq, NCR_700_intr, IRQF_SHARED, "lasi700", host)) { + if(request_irq(dev->irq, NCR_700_intr, SA_SHIRQ, "lasi700", host)) { printk(KERN_ERR "lasi700: request_irq failed!\n"); goto out_put_host; } diff --git a/trunk/drivers/scsi/libata-bmdma.c b/trunk/drivers/scsi/libata-bmdma.c index 9ce221f25954..004e1a0d8b71 100644 --- a/trunk/drivers/scsi/libata-bmdma.c +++ b/trunk/drivers/scsi/libata-bmdma.c @@ -32,6 +32,7 @@ * */ +#include #include #include #include @@ -853,7 +854,7 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int return NULL; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->private_data = port[0]->private_data; if (ports & ATA_PORT_PRIMARY) { diff --git a/trunk/drivers/scsi/libata-core.c b/trunk/drivers/scsi/libata-core.c index 1c960ac1617f..d1c1c30d123f 100644 --- a/trunk/drivers/scsi/libata-core.c +++ b/trunk/drivers/scsi/libata-core.c @@ -32,6 +32,7 @@ * */ +#include #include #include #include @@ -1001,7 +1002,7 @@ unsigned ata_exec_internal(struct ata_device *dev, struct ata_queued_cmd *qc; unsigned int tag, preempted_tag; u32 preempted_sactive, preempted_qc_active; - DECLARE_COMPLETION_ONSTACK(wait); + DECLARE_COMPLETION(wait); unsigned long flags; unsigned int err_mask; int rc; diff --git a/trunk/drivers/scsi/libiscsi.c b/trunk/drivers/scsi/libiscsi.c index 7e6e031cc41b..2673a11a9495 100644 --- a/trunk/drivers/scsi/libiscsi.c +++ b/trunk/drivers/scsi/libiscsi.c @@ -1287,18 +1287,13 @@ iscsi_session_setup(struct iscsi_transport *iscsit, if (scsi_add_host(shost, NULL)) goto add_host_fail; - if (!try_module_get(iscsit->owner)) - goto cls_session_fail; - cls_session = iscsi_create_session(shost, iscsit, 0); if (!cls_session) - goto module_put; + goto cls_session_fail; *(unsigned long*)shost->hostdata = (unsigned long)cls_session; return cls_session; -module_put: - module_put(iscsit->owner); cls_session_fail: scsi_remove_host(shost); add_host_fail: @@ -1330,7 +1325,6 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) iscsi_destroy_session(cls_session); scsi_host_put(shost); - module_put(cls_session->transport->owner); } EXPORT_SYMBOL_GPL(iscsi_session_teardown); @@ -1703,185 +1697,6 @@ int iscsi_conn_bind(struct iscsi_cls_session *cls_session, } EXPORT_SYMBOL_GPL(iscsi_conn_bind); - -int iscsi_set_param(struct iscsi_cls_conn *cls_conn, - enum iscsi_param param, char *buf, int buflen) -{ - struct iscsi_conn *conn = cls_conn->dd_data; - struct iscsi_session *session = conn->session; - uint32_t value; - - switch(param) { - case ISCSI_PARAM_MAX_RECV_DLENGTH: - sscanf(buf, "%d", &conn->max_recv_dlength); - break; - case ISCSI_PARAM_MAX_XMIT_DLENGTH: - sscanf(buf, "%d", &conn->max_xmit_dlength); - break; - case ISCSI_PARAM_HDRDGST_EN: - sscanf(buf, "%d", &conn->hdrdgst_en); - break; - case ISCSI_PARAM_DATADGST_EN: - sscanf(buf, "%d", &conn->datadgst_en); - break; - case ISCSI_PARAM_INITIAL_R2T_EN: - sscanf(buf, "%d", &session->initial_r2t_en); - break; - case ISCSI_PARAM_MAX_R2T: - sscanf(buf, "%d", &session->max_r2t); - break; - case ISCSI_PARAM_IMM_DATA_EN: - sscanf(buf, "%d", &session->imm_data_en); - break; - case ISCSI_PARAM_FIRST_BURST: - sscanf(buf, "%d", &session->first_burst); - break; - case ISCSI_PARAM_MAX_BURST: - sscanf(buf, "%d", &session->max_burst); - break; - case ISCSI_PARAM_PDU_INORDER_EN: - sscanf(buf, "%d", &session->pdu_inorder_en); - break; - case ISCSI_PARAM_DATASEQ_INORDER_EN: - sscanf(buf, "%d", &session->dataseq_inorder_en); - break; - case ISCSI_PARAM_ERL: - sscanf(buf, "%d", &session->erl); - break; - case ISCSI_PARAM_IFMARKER_EN: - sscanf(buf, "%d", &value); - BUG_ON(value); - break; - case ISCSI_PARAM_OFMARKER_EN: - sscanf(buf, "%d", &value); - BUG_ON(value); - break; - case ISCSI_PARAM_EXP_STATSN: - sscanf(buf, "%u", &conn->exp_statsn); - break; - case ISCSI_PARAM_TARGET_NAME: - /* this should not change between logins */ - if (session->targetname) - break; - - session->targetname = kstrdup(buf, GFP_KERNEL); - if (!session->targetname) - return -ENOMEM; - break; - case ISCSI_PARAM_TPGT: - sscanf(buf, "%d", &session->tpgt); - break; - case ISCSI_PARAM_PERSISTENT_PORT: - sscanf(buf, "%d", &conn->persistent_port); - break; - case ISCSI_PARAM_PERSISTENT_ADDRESS: - /* - * this is the address returned in discovery so it should - * not change between logins. - */ - if (conn->persistent_address) - break; - - conn->persistent_address = kstrdup(buf, GFP_KERNEL); - if (!conn->persistent_address) - return -ENOMEM; - break; - default: - return -ENOSYS; - } - - return 0; -} -EXPORT_SYMBOL_GPL(iscsi_set_param); - -int iscsi_session_get_param(struct iscsi_cls_session *cls_session, - enum iscsi_param param, char *buf) -{ - struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); - struct iscsi_session *session = iscsi_hostdata(shost->hostdata); - int len; - - switch(param) { - case ISCSI_PARAM_INITIAL_R2T_EN: - len = sprintf(buf, "%d\n", session->initial_r2t_en); - break; - case ISCSI_PARAM_MAX_R2T: - len = sprintf(buf, "%hu\n", session->max_r2t); - break; - case ISCSI_PARAM_IMM_DATA_EN: - len = sprintf(buf, "%d\n", session->imm_data_en); - break; - case ISCSI_PARAM_FIRST_BURST: - len = sprintf(buf, "%u\n", session->first_burst); - break; - case ISCSI_PARAM_MAX_BURST: - len = sprintf(buf, "%u\n", session->max_burst); - break; - case ISCSI_PARAM_PDU_INORDER_EN: - len = sprintf(buf, "%d\n", session->pdu_inorder_en); - break; - case ISCSI_PARAM_DATASEQ_INORDER_EN: - len = sprintf(buf, "%d\n", session->dataseq_inorder_en); - break; - case ISCSI_PARAM_ERL: - len = sprintf(buf, "%d\n", session->erl); - break; - case ISCSI_PARAM_TARGET_NAME: - len = sprintf(buf, "%s\n", session->targetname); - break; - case ISCSI_PARAM_TPGT: - len = sprintf(buf, "%d\n", session->tpgt); - break; - default: - return -ENOSYS; - } - - return len; -} -EXPORT_SYMBOL_GPL(iscsi_session_get_param); - -int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, - enum iscsi_param param, char *buf) -{ - struct iscsi_conn *conn = cls_conn->dd_data; - int len; - - switch(param) { - case ISCSI_PARAM_MAX_RECV_DLENGTH: - len = sprintf(buf, "%u\n", conn->max_recv_dlength); - break; - case ISCSI_PARAM_MAX_XMIT_DLENGTH: - len = sprintf(buf, "%u\n", conn->max_xmit_dlength); - break; - case ISCSI_PARAM_HDRDGST_EN: - len = sprintf(buf, "%d\n", conn->hdrdgst_en); - break; - case ISCSI_PARAM_DATADGST_EN: - len = sprintf(buf, "%d\n", conn->datadgst_en); - break; - case ISCSI_PARAM_IFMARKER_EN: - len = sprintf(buf, "%d\n", conn->ifmarker_en); - break; - case ISCSI_PARAM_OFMARKER_EN: - len = sprintf(buf, "%d\n", conn->ofmarker_en); - break; - case ISCSI_PARAM_EXP_STATSN: - len = sprintf(buf, "%u\n", conn->exp_statsn); - break; - case ISCSI_PARAM_PERSISTENT_PORT: - len = sprintf(buf, "%d\n", conn->persistent_port); - break; - case ISCSI_PARAM_PERSISTENT_ADDRESS: - len = sprintf(buf, "%s\n", conn->persistent_address); - break; - default: - return -ENOSYS; - } - - return len; -} -EXPORT_SYMBOL_GPL(iscsi_conn_get_param); - MODULE_AUTHOR("Mike Christie"); MODULE_DESCRIPTION("iSCSI library functions"); MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/scsi/lpfc/lpfc.h b/trunk/drivers/scsi/lpfc/lpfc.h index f81691fcf177..087c44539a16 100644 --- a/trunk/drivers/scsi/lpfc/lpfc.h +++ b/trunk/drivers/scsi/lpfc/lpfc.h @@ -174,6 +174,7 @@ struct lpfc_hba { dma_addr_t slim2p_mapping; uint16_t pci_cfg_value; + struct semaphore hba_can_block; int32_t hba_state; #define LPFC_STATE_UNKNOWN 0 /* HBA state is unknown */ diff --git a/trunk/drivers/scsi/lpfc/lpfc_els.c b/trunk/drivers/scsi/lpfc/lpfc_els.c index 4126fd87956f..283b7d824c34 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_els.c +++ b/trunk/drivers/scsi/lpfc/lpfc_els.c @@ -821,7 +821,7 @@ lpfc_issue_els_plogi(struct lpfc_hba * phba, uint32_t did, uint8_t retry) pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */ cmdsize = (sizeof (uint32_t) + sizeof (struct serv_parm)); - elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, NULL, did, + elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, 0, did, ELS_CMD_PLOGI); if (!elsiocb) return 1; @@ -2791,8 +2791,8 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb) ndlp = (struct lpfc_nodelist *) pmb->context2; xri = (uint16_t) ((unsigned long)(pmb->context1)); - pmb->context1 = NULL; - pmb->context2 = NULL; + pmb->context1 = 0; + pmb->context2 = 0; if (mb->mbxStatus) { mempool_free( pmb, phba->mbox_mem_pool); diff --git a/trunk/drivers/scsi/lpfc/lpfc_init.c b/trunk/drivers/scsi/lpfc/lpfc_init.c index 81755a3f7c68..908d0f27706f 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_init.c +++ b/trunk/drivers/scsi/lpfc/lpfc_init.c @@ -939,12 +939,12 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) "10-port ", "PCIe"}; break; default: - m = (typeof(m)){ NULL }; + m = (typeof(m)){ 0 }; break; } break; default: - m = (typeof(m)){ NULL }; + m = (typeof(m)){ 0 }; break; } @@ -1451,6 +1451,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) goto out_put_host; host->unique_id = phba->brd_no; + init_MUTEX(&phba->hba_can_block); INIT_LIST_HEAD(&phba->ctrspbuflist); INIT_LIST_HEAD(&phba->rnidrspbuflist); INIT_LIST_HEAD(&phba->freebufList); @@ -1619,7 +1620,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) if (error) goto out_remove_host; - error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED, + error = request_irq(phba->pcidev->irq, lpfc_intr_handler, SA_SHIRQ, LPFC_DRIVER_NAME, phba); if (error) { lpfc_printf_log(phba, KERN_ERR, LOG_INIT, diff --git a/trunk/drivers/scsi/lpfc/lpfc_scsi.c b/trunk/drivers/scsi/lpfc/lpfc_scsi.c index aea1ee472f3d..7dc4c2e6bed2 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_scsi.c +++ b/trunk/drivers/scsi/lpfc/lpfc_scsi.c @@ -41,6 +41,20 @@ #define LPFC_ABORT_WAIT 2 +static inline void +lpfc_block_requests(struct lpfc_hba * phba) +{ + down(&phba->hba_can_block); + scsi_block_requests(phba->host); +} + +static inline void +lpfc_unblock_requests(struct lpfc_hba * phba) +{ + scsi_unblock_requests(phba->host); + up(&phba->hba_can_block); +} + /* * This routine allocates a scsi buffer, which contains all the necessary * information needed to initiate a SCSI I/O. The non-DMAable buffer region @@ -845,6 +859,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) unsigned int loop_count = 0; int ret = SUCCESS; + lpfc_block_requests(phba); spin_lock_irq(shost->host_lock); lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble; @@ -930,6 +945,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) cmnd->device->lun, cmnd->serial_number); spin_unlock_irq(shost->host_lock); + lpfc_unblock_requests(phba); return ret; } @@ -947,6 +963,7 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) int ret = FAILED; int cnt, loopcnt; + lpfc_block_requests(phba); spin_lock_irq(shost->host_lock); /* * If target is not in a MAPPED state, delay the reset until @@ -1048,6 +1065,7 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) out: spin_unlock_irq(shost->host_lock); + lpfc_unblock_requests(phba); return ret; } @@ -1062,6 +1080,7 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) int cnt, loopcnt; struct lpfc_scsi_buf * lpfc_cmd; + lpfc_block_requests(phba); spin_lock_irq(shost->host_lock); lpfc_cmd = lpfc_get_scsi_buf(phba); @@ -1144,6 +1163,7 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) phba->brd_no, ret); out: spin_unlock_irq(shost->host_lock); + lpfc_unblock_requests(phba); return ret; } diff --git a/trunk/drivers/scsi/megaraid.c b/trunk/drivers/scsi/megaraid.c index 76edbb639d37..5d2cefb5e52d 100644 --- a/trunk/drivers/scsi/megaraid.c +++ b/trunk/drivers/scsi/megaraid.c @@ -4714,7 +4714,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) if (request_irq(irq, (adapter->flag & BOARD_MEMMAP) ? megaraid_isr_memmapped : megaraid_isr_iomapped, - IRQF_SHARED, "megaraid", adapter)) { + SA_SHIRQ, "megaraid", adapter)) { printk(KERN_WARNING "megaraid: Couldn't register IRQ %d!\n", irq); goto out_free_scb_list; diff --git a/trunk/drivers/scsi/megaraid/megaraid_mbox.c b/trunk/drivers/scsi/megaraid/megaraid_mbox.c index 92715130ac09..b7caf60638e8 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_mbox.c +++ b/trunk/drivers/scsi/megaraid/megaraid_mbox.c @@ -767,7 +767,7 @@ megaraid_init_mbox(adapter_t *adapter) // // request IRQ and register the interrupt service routine - if (request_irq(adapter->irq, megaraid_isr, IRQF_SHARED, "megaraid", + if (request_irq(adapter->irq, megaraid_isr, SA_SHIRQ, "megaraid", adapter)) { con_log(CL_ANN, (KERN_WARNING diff --git a/trunk/drivers/scsi/megaraid/megaraid_sas.c b/trunk/drivers/scsi/megaraid/megaraid_sas.c index a8c9627a15c4..0c9516ff636f 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_sas.c +++ b/trunk/drivers/scsi/megaraid/megaraid_sas.c @@ -10,7 +10,7 @@ * 2 of the License, or (at your option) any later version. * * FILE : megaraid_sas.c - * Version : v00.00.03.01 + * Version : v00.00.02.04 * * Authors: * Sreenivas Bagalkote @@ -55,25 +55,19 @@ static struct pci_device_id megasas_pci_table[] = { { PCI_VENDOR_ID_LSI_LOGIC, - PCI_DEVICE_ID_LSI_SAS1064R, /* xscale IOP */ + PCI_DEVICE_ID_LSI_SAS1064R, // xscale IOP PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_LSI_LOGIC, - PCI_DEVICE_ID_LSI_SAS1078R, /* ppc IOP */ + PCI_DEVICE_ID_LSI_SAS1078R, // ppc IOP PCI_ANY_ID, PCI_ANY_ID, }, - { - PCI_VENDOR_ID_LSI_LOGIC, - PCI_DEVICE_ID_LSI_VERDE_ZCR, /* xscale IOP, vega */ - PCI_ANY_ID, - PCI_ANY_ID, - }, { PCI_VENDOR_ID_DELL, - PCI_DEVICE_ID_DELL_PERC5, /* xscale IOP */ + PCI_DEVICE_ID_DELL_PERC5, // xscale IOP PCI_ANY_ID, PCI_ANY_ID, }, @@ -295,14 +289,9 @@ static struct megasas_instance_template megasas_instance_template_ppc = { * @regs: MFI register set */ static inline void -megasas_disable_intr(struct megasas_instance *instance) +megasas_disable_intr(struct megasas_register_set __iomem * regs) { u32 mask = 0x1f; - struct megasas_register_set __iomem *regs = instance->reg_set; - - if(instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078R) - mask = 0xffffffff; - writel(mask, ®s->outbound_intr_mask); /* Dummy readl to force pci flush */ @@ -1271,7 +1260,7 @@ megasas_transition_to_ready(struct megasas_instance* instance) /* * Bring it to READY state; assuming max wait 2 secs */ - megasas_disable_intr(instance); + megasas_disable_intr(instance->reg_set); writel(MFI_INIT_READY, &instance->reg_set->inbound_doorbell); max_wait = 10; @@ -1767,11 +1756,6 @@ static int megasas_init_mfi(struct megasas_instance *instance) init_frame->data_xfer_len = sizeof(struct megasas_init_queue_info); - /* - * disable the intr before firing the init frame to FW - */ - megasas_disable_intr(instance); - /* * Issue the init frame in polled mode */ @@ -2207,7 +2191,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) /* * Register IRQ */ - if (request_irq(pdev->irq, megasas_isr, IRQF_SHARED, "megasas", instance)) { + if (request_irq(pdev->irq, megasas_isr, SA_SHIRQ, "megasas", instance)) { printk(KERN_DEBUG "megasas: Failed to register IRQ\n"); goto fail_irq; } @@ -2250,7 +2234,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) megasas_mgmt_info.max_index--; pci_set_drvdata(pdev, NULL); - megasas_disable_intr(instance); + megasas_disable_intr(instance->reg_set); free_irq(instance->pdev->irq, instance); megasas_release_mfi(instance); @@ -2380,7 +2364,7 @@ static void megasas_detach_one(struct pci_dev *pdev) pci_set_drvdata(instance->pdev, NULL); - megasas_disable_intr(instance); + megasas_disable_intr(instance->reg_set); free_irq(instance->pdev->irq, instance); diff --git a/trunk/drivers/scsi/megaraid/megaraid_sas.h b/trunk/drivers/scsi/megaraid/megaraid_sas.h index 3531a14222a7..927d6ffef05f 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_sas.h +++ b/trunk/drivers/scsi/megaraid/megaraid_sas.h @@ -18,16 +18,9 @@ /** * MegaRAID SAS Driver meta data */ -#define MEGASAS_VERSION "00.00.03.01" -#define MEGASAS_RELDATE "May 14, 2006" -#define MEGASAS_EXT_VERSION "Sun May 14 22:49:52 PDT 2006" - -/* - * Device IDs - */ -#define PCI_DEVICE_ID_LSI_SAS1078R 0x0060 -#define PCI_DEVICE_ID_LSI_VERDE_ZCR 0x0413 - +#define MEGASAS_VERSION "00.00.02.04" +#define MEGASAS_RELDATE "Feb 03, 2006" +#define MEGASAS_EXT_VERSION "Fri Feb 03 14:31:44 PST 2006" /* * ===================================== * MegaRAID SAS MFI firmware definitions @@ -561,11 +554,7 @@ struct megasas_ctrl_info { #define MFI_POLL_TIMEOUT_SECS 10 #define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000 - -/* -* register set for both 1068 and 1078 controllers -* structure extended for 1078 registers -*/ +#define PCI_DEVICE_ID_LSI_SAS1078R 0x00000060 struct megasas_register_set { u32 reserved_0[4]; /*0000h*/ @@ -1161,10 +1150,10 @@ struct compat_megasas_iocpacket { struct compat_iovec sgl[MAX_IOCTL_SGE]; } __attribute__ ((packed)); -#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket) #endif #define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket) +#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket) #define MEGASAS_IOC_GET_AEN _IOW('M', 3, struct megasas_aen) struct megasas_mgmt_info { diff --git a/trunk/drivers/scsi/mesh.c b/trunk/drivers/scsi/mesh.c index c88717727be8..f852421002ef 100644 --- a/trunk/drivers/scsi/mesh.c +++ b/trunk/drivers/scsi/mesh.c @@ -18,6 +18,7 @@ * - retry arbitration if lost (unless higher levels do this for us) * - power down the chip when no device is detected */ +#include #include #include #include diff --git a/trunk/drivers/scsi/ncr53c8xx.h b/trunk/drivers/scsi/ncr53c8xx.h index 78818b6684f8..0e4e46a01336 100644 --- a/trunk/drivers/scsi/ncr53c8xx.h +++ b/trunk/drivers/scsi/ncr53c8xx.h @@ -53,8 +53,10 @@ #ifndef NCR53C8XX_H #define NCR53C8XX_H +#include #include +#include /* ** If you want a driver as small as possible, donnot define the diff --git a/trunk/drivers/scsi/nsp32.c b/trunk/drivers/scsi/nsp32.c index bfb4f49e125d..5c55e152e718 100644 --- a/trunk/drivers/scsi/nsp32.c +++ b/trunk/drivers/scsi/nsp32.c @@ -2866,7 +2866,8 @@ static int nsp32_detect(struct scsi_host_template *sht) */ nsp32_do_bus_reset(data); - ret = request_irq(host->irq, do_nsp32_isr, IRQF_SHARED, "nsp32", data); + ret = request_irq(host->irq, do_nsp32_isr, + SA_SHIRQ | SA_SAMPLE_RANDOM, "nsp32", data); if (ret < 0) { nsp32_msg(KERN_ERR, "Unable to allocate IRQ for NinjaSCSI32 " "SCSI PCI controller. Interrupt: %d", host->irq); @@ -2885,19 +2886,12 @@ static int nsp32_detect(struct scsi_host_template *sht) } #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) - ret = scsi_add_host(host, &PCIDEV->dev); - if (ret) { - nsp32_msg(KERN_ERR, "failed to add scsi host"); - goto free_region; - } + scsi_add_host (host, &PCIDEV->dev); scsi_scan_host(host); #endif pci_set_drvdata(PCIDEV, host); return DETECT_OK; - free_region: - release_region(host->io_port, host->n_io_port); - free_irq: free_irq(host->irq, data); diff --git a/trunk/drivers/scsi/oktagon_esp.c b/trunk/drivers/scsi/oktagon_esp.c index dd67a68c5c23..dee426f8c07b 100644 --- a/trunk/drivers/scsi/oktagon_esp.c +++ b/trunk/drivers/scsi/oktagon_esp.c @@ -6,6 +6,7 @@ * Based on cyber_esp.c */ +#include #if defined(CONFIG_AMIGA) || defined(CONFIG_APUS) #define USE_BOTTOM_HALF @@ -197,7 +198,7 @@ int oktagon_esp_detect(struct scsi_host_template *tpnt) esp->esp_command_dvma = (__u32) cmd_buffer; esp->irq = IRQ_AMIGA_PORTS; - request_irq(IRQ_AMIGA_PORTS, esp_intr, IRQF_SHARED, + request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ, "BSC Oktagon SCSI", esp->ehost); /* Figure out our scsi ID on the bus */ diff --git a/trunk/drivers/scsi/oktagon_io.S b/trunk/drivers/scsi/oktagon_io.S index 8a7340b02707..08ce8d80d8f5 100644 --- a/trunk/drivers/scsi/oktagon_io.S +++ b/trunk/drivers/scsi/oktagon_io.S @@ -23,6 +23,7 @@ int oktag_from_io(long *addr,long *paddr,long len) * is moved to/from the IO register. */ +#include #ifdef CONFIG_APUS diff --git a/trunk/drivers/scsi/osst.h b/trunk/drivers/scsi/osst.h index 1e426f5d0ed8..011d4d6ca9f9 100644 --- a/trunk/drivers/scsi/osst.h +++ b/trunk/drivers/scsi/osst.h @@ -3,6 +3,7 @@ */ #include +#include #include /* FIXME - rename and use the following two types or delete them! diff --git a/trunk/drivers/scsi/pas16.c b/trunk/drivers/scsi/pas16.c index 1434209a8ac5..1bf96ed8f935 100644 --- a/trunk/drivers/scsi/pas16.c +++ b/trunk/drivers/scsi/pas16.c @@ -454,7 +454,7 @@ int __init pas16_detect(struct scsi_host_template * tpnt) instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS); if (instance->irq != SCSI_IRQ_NONE) - if (request_irq(instance->irq, pas16_intr, IRQF_DISABLED, "pas16", instance)) { + if (request_irq(instance->irq, pas16_intr, SA_INTERRUPT, "pas16", instance)) { printk("scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); instance->irq = SCSI_IRQ_NONE; diff --git a/trunk/drivers/scsi/pcmcia/nsp_cs.c b/trunk/drivers/scsi/pcmcia/nsp_cs.c index 0d4c04e1f3de..231f9c311c69 100644 --- a/trunk/drivers/scsi/pcmcia/nsp_cs.c +++ b/trunk/drivers/scsi/pcmcia/nsp_cs.c @@ -1623,7 +1623,7 @@ static int nsp_cs_probe(struct pcmcia_device *link) /* Interrupt handler */ link->irq.Handler = &nspintr; link->irq.Instance = info; - link->irq.Attributes |= IRQF_SHARED; + link->irq.Attributes |= (SA_SHIRQ | SA_SAMPLE_RANDOM); /* General socket configuration */ link->conf.Attributes = CONF_ENABLE_IRQ; diff --git a/trunk/drivers/scsi/pcmcia/sym53c500_cs.c b/trunk/drivers/scsi/pcmcia/sym53c500_cs.c index 0b65099acb1a..9f59827707f0 100644 --- a/trunk/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/trunk/drivers/scsi/pcmcia/sym53c500_cs.c @@ -799,7 +799,7 @@ SYM53C500_config(struct pcmcia_device *link) data = (struct sym53c500_data *)host->hostdata; if (irq_level > 0) { - if (request_irq(irq_level, SYM53C500_intr, IRQF_SHARED, "SYM53C500", host)) { + if (request_irq(irq_level, SYM53C500_intr, SA_SHIRQ, "SYM53C500", host)) { printk("SYM53C500: unable to allocate IRQ %d\n", irq_level); goto err_free_scsi; } diff --git a/trunk/drivers/scsi/pdc_adma.c b/trunk/drivers/scsi/pdc_adma.c index d1f38c32aa15..7ebe8e03aa96 100644 --- a/trunk/drivers/scsi/pdc_adma.c +++ b/trunk/drivers/scsi/pdc_adma.c @@ -690,7 +690,7 @@ static int adma_ata_init_one(struct pci_dev *pdev, probe_ent->port_ops = adma_port_info[board_idx].port_ops; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->mmio_base = mmio_base; probe_ent->n_ports = ADMA_PORTS; diff --git a/trunk/drivers/scsi/pluto.c b/trunk/drivers/scsi/pluto.c index 7abf64d1bfc9..83a671799934 100644 --- a/trunk/drivers/scsi/pluto.c +++ b/trunk/drivers/scsi/pluto.c @@ -13,6 +13,7 @@ #include #include #include +#include #ifdef CONFIG_KMOD #include #endif diff --git a/trunk/drivers/scsi/ppa.c b/trunk/drivers/scsi/ppa.c index b0eba39f208a..d58ac5ad509d 100644 --- a/trunk/drivers/scsi/ppa.c +++ b/trunk/drivers/scsi/ppa.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/scsi/qla1280.c b/trunk/drivers/scsi/qla1280.c index 8953991462d7..680f6063954b 100644 --- a/trunk/drivers/scsi/qla1280.c +++ b/trunk/drivers/scsi/qla1280.c @@ -192,7 +192,7 @@ - Don't walk the entire list in qla1280_putq_t() just to directly grab the pointer to the last element afterwards Rev 3.23.5 Beta August 9, 2001, Jes Sorensen - - Don't use IRQF_DISABLED, it's use is deprecated for this kinda driver + - Don't use SA_INTERRUPT, it's use is deprecated for this kinda driver Rev 3.23.4 Beta August 8, 2001, Jes Sorensen - Set dev->max_sectors to 1024 Rev 3.23.3 Beta August 6, 2001, Jes Sorensen @@ -331,6 +331,7 @@ *****************************************************************************/ +#include #include #include @@ -4209,7 +4210,7 @@ qla1280_setup(char *s) } -static int __init +static int qla1280_get_token(char *str) { char *sep; @@ -4369,7 +4370,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) /* Disable ISP interrupts. */ qla1280_disable_intrs(ha); - if (request_irq(pdev->irq, qla1280_intr_handler, IRQF_SHARED, + if (request_irq(pdev->irq, qla1280_intr_handler, SA_SHIRQ, "qla1280", ha)) { printk("qla1280 : Failed to reserve interrupt %d already " "in use\n", pdev->irq); diff --git a/trunk/drivers/scsi/qla2xxx/qla_attr.c b/trunk/drivers/scsi/qla2xxx/qla_attr.c index 87f90c4f08e9..e96d58ded57c 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_attr.c +++ b/trunk/drivers/scsi/qla2xxx/qla_attr.c @@ -16,16 +16,15 @@ qla2x00_sysfs_read_fw_dump(struct kobject *kobj, char *buf, loff_t off, { struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct device, kobj))); - char *rbuf = (char *)ha->fw_dump; if (ha->fw_dump_reading == 0) return 0; - if (off > ha->fw_dump_len) - return 0; - if (off + count > ha->fw_dump_len) - count = ha->fw_dump_len - off; + if (off > ha->fw_dump_buffer_len) + return 0; + if (off + count > ha->fw_dump_buffer_len) + count = ha->fw_dump_buffer_len - off; - memcpy(buf, &rbuf[off], count); + memcpy(buf, &ha->fw_dump_buffer[off], count); return (count); } @@ -37,6 +36,7 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off, struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct device, kobj))); int reading; + uint32_t dump_size; if (off != 0) return (0); @@ -44,27 +44,46 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off, reading = simple_strtol(buf, NULL, 10); switch (reading) { case 0: - if (!ha->fw_dump_reading) - break; - - qla_printk(KERN_INFO, ha, - "Firmware dump cleared on (%ld).\n", ha->host_no); + if (ha->fw_dump_reading == 1) { + qla_printk(KERN_INFO, ha, + "Firmware dump cleared on (%ld).\n", ha->host_no); - ha->fw_dump_reading = 0; - ha->fw_dumped = 0; + vfree(ha->fw_dump_buffer); + ha->fw_dump_buffer = NULL; + ha->fw_dump_reading = 0; + ha->fw_dumped = 0; + } break; case 1: if (ha->fw_dumped && !ha->fw_dump_reading) { ha->fw_dump_reading = 1; + if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) + dump_size = FW_DUMP_SIZE_24XX; + else { + dump_size = FW_DUMP_SIZE_1M; + if (ha->fw_memory_size < 0x20000) + dump_size = FW_DUMP_SIZE_128K; + else if (ha->fw_memory_size < 0x80000) + dump_size = FW_DUMP_SIZE_512K; + } + ha->fw_dump_buffer = (char *)vmalloc(dump_size); + if (ha->fw_dump_buffer == NULL) { + qla_printk(KERN_WARNING, ha, + "Unable to allocate memory for firmware " + "dump buffer (%d).\n", dump_size); + + ha->fw_dump_reading = 0; + return (count); + } qla_printk(KERN_INFO, ha, - "Raw firmware dump ready for read on (%ld).\n", + "Firmware dump ready for read on (%ld).\n", ha->host_no); + memset(ha->fw_dump_buffer, 0, dump_size); + ha->isp_ops.ascii_fw_dump(ha); + ha->fw_dump_buffer_len = strlen(ha->fw_dump_buffer); } break; - case 2: - qla2x00_alloc_fw_dump(ha); - break; } return (count); } @@ -294,6 +313,9 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, char *buf, loff_t off, if (!capable(CAP_SYS_ADMIN) || off != 0) return 0; + if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) + return -ENOTSUPP; + /* Read NVRAM. */ spin_lock_irqsave(&ha->hardware_lock, flags); ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->vpd_base, ha->vpd_size); @@ -313,6 +335,9 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, char *buf, loff_t off, if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size) return 0; + if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) + return -ENOTSUPP; + /* Write NVRAM. */ spin_lock_irqsave(&ha->hardware_lock, flags); ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count); @@ -332,53 +357,6 @@ static struct bin_attribute sysfs_vpd_attr = { .write = qla2x00_sysfs_write_vpd, }; -static ssize_t -qla2x00_sysfs_read_sfp(struct kobject *kobj, char *buf, loff_t off, - size_t count) -{ - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, - struct device, kobj))); - uint16_t iter, addr, offset; - int rval; - - if (!capable(CAP_SYS_ADMIN) || off != 0 || count != SFP_DEV_SIZE * 2) - return 0; - - addr = 0xa0; - for (iter = 0, offset = 0; iter < (SFP_DEV_SIZE * 2) / SFP_BLOCK_SIZE; - iter++, offset += SFP_BLOCK_SIZE) { - if (iter == 4) { - /* Skip to next device address. */ - addr = 0xa2; - offset = 0; - } - - rval = qla2x00_read_sfp(ha, ha->sfp_data_dma, addr, offset, - SFP_BLOCK_SIZE); - if (rval != QLA_SUCCESS) { - qla_printk(KERN_WARNING, ha, - "Unable to read SFP data (%x/%x/%x).\n", rval, - addr, offset); - count = 0; - break; - } - memcpy(buf, ha->sfp_data, SFP_BLOCK_SIZE); - buf += SFP_BLOCK_SIZE; - } - - return count; -} - -static struct bin_attribute sysfs_sfp_attr = { - .attr = { - .name = "sfp", - .mode = S_IRUSR | S_IWUSR, - .owner = THIS_MODULE, - }, - .size = SFP_DEV_SIZE * 2, - .read = qla2x00_sysfs_read_sfp, -}; - void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha) { @@ -389,12 +367,7 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha) sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr); sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_ctl_attr); - if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { - sysfs_create_bin_file(&host->shost_gendev.kobj, - &sysfs_vpd_attr); - sysfs_create_bin_file(&host->shost_gendev.kobj, - &sysfs_sfp_attr); - } + sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr); } void @@ -407,12 +380,7 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha) sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr); sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_ctl_attr); - if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { - sysfs_remove_bin_file(&host->shost_gendev.kobj, - &sysfs_vpd_attr); - sysfs_remove_bin_file(&host->shost_gendev.kobj, - &sysfs_sfp_attr); - } + sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr); if (ha->beacon_blink_led == 1) ha->isp_ops.beacon_off(ha); diff --git a/trunk/drivers/scsi/qla2xxx/qla_dbg.c b/trunk/drivers/scsi/qla2xxx/qla_dbg.c index f6ed6962bc2b..74e54713aa7c 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_dbg.c +++ b/trunk/drivers/scsi/qla2xxx/qla_dbg.c @@ -8,34 +8,7 @@ #include -static inline void -qla2xxx_prep_dump(scsi_qla_host_t *ha, struct qla2xxx_fw_dump *fw_dump) -{ - fw_dump->fw_major_version = htonl(ha->fw_major_version); - fw_dump->fw_minor_version = htonl(ha->fw_minor_version); - fw_dump->fw_subminor_version = htonl(ha->fw_subminor_version); - fw_dump->fw_attributes = htonl(ha->fw_attributes); - - fw_dump->vendor = htonl(ha->pdev->vendor); - fw_dump->device = htonl(ha->pdev->device); - fw_dump->subsystem_vendor = htonl(ha->pdev->subsystem_vendor); - fw_dump->subsystem_device = htonl(ha->pdev->subsystem_device); -} - -static inline void * -qla2xxx_copy_queues(scsi_qla_host_t *ha, void *ptr) -{ - /* Request queue. */ - memcpy(ptr, ha->request_ring, ha->request_q_length * - sizeof(request_t)); - - /* Response queue. */ - ptr += ha->request_q_length * sizeof(request_t); - memcpy(ptr, ha->response_ring, ha->response_q_length * - sizeof(response_t)); - - return ptr + (ha->response_q_length * sizeof(response_t)); -} +static int qla_uprintf(char **, char *, ...); /** * qla2300_fw_dump() - Dumps binary data from the 2300 firmware. @@ -76,11 +49,10 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked) "request...\n", ha->fw_dump); goto qla2300_fw_dump_failed; } - fw = &ha->fw_dump->isp.isp23; - qla2xxx_prep_dump(ha, ha->fw_dump); + fw = ha->fw_dump; rval = QLA_SUCCESS; - fw->hccr = htons(RD_REG_WORD(®->hccr)); + fw->hccr = RD_REG_WORD(®->hccr); /* Pause RISC. */ WRT_REG_WORD(®->hccr, HCCR_PAUSE_RISC); @@ -101,86 +73,85 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (rval == QLA_SUCCESS) { dmp_reg = (uint16_t __iomem *)(reg + 0); for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++) - fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->pbiu_reg[cnt] = RD_REG_WORD(dmp_reg++); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x10); for (cnt = 0; cnt < sizeof(fw->risc_host_reg) / 2; cnt++) - fw->risc_host_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_host_reg[cnt] = RD_REG_WORD(dmp_reg++); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x40); for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++) - fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->mailbox_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x40); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->resp_dma_reg) / 2; cnt++) - fw->resp_dma_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->resp_dma_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x50); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++) - fw->dma_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->dma_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x00); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0xA0); for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++) - fw->risc_hdw_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2000); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++) - fw->risc_gp0_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp0_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2200); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++) - fw->risc_gp1_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp1_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2400); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++) - fw->risc_gp2_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp2_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2600); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++) - fw->risc_gp3_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp3_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2800); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++) - fw->risc_gp4_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp4_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2A00); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++) - fw->risc_gp5_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp5_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2C00); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++) - fw->risc_gp6_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp6_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2E00); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++) - fw->risc_gp7_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp7_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x10); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++) - fw->frame_buf_hdw_reg[cnt] = - htons(RD_REG_WORD(dmp_reg++)); + fw->frame_buf_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x20); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++) - fw->fpm_b0_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->fpm_b0_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x30); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++) - fw->fpm_b1_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->fpm_b1_reg[cnt] = RD_REG_WORD(dmp_reg++); /* Reset RISC. */ WRT_REG_WORD(®->ctrl_status, CSR_ISP_SOFT_RESET); @@ -255,7 +226,7 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { rval = mb0 & MBS_MASK; - fw->risc_ram[cnt] = htons(mb2); + fw->risc_ram[cnt] = mb2; } else { rval = QLA_FUNCTION_FAILED; } @@ -314,7 +285,7 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { rval = mb0 & MBS_MASK; - fw->stack_ram[cnt] = htons(mb2); + fw->stack_ram[cnt] = mb2; } else { rval = QLA_FUNCTION_FAILED; } @@ -374,15 +345,12 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { rval = mb0 & MBS_MASK; - fw->data_ram[cnt] = htons(mb2); + fw->data_ram[cnt] = mb2; } else { rval = QLA_FUNCTION_FAILED; } } - if (rval == QLA_SUCCESS) - qla2xxx_copy_queues(ha, &fw->data_ram[cnt]); - if (rval != QLA_SUCCESS) { qla_printk(KERN_WARNING, ha, "Failed to dump firmware (%x)!!!\n", rval); @@ -400,6 +368,193 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked) spin_unlock_irqrestore(&ha->hardware_lock, flags); } +/** + * qla2300_ascii_fw_dump() - Converts a binary firmware dump to ASCII. + * @ha: HA context + */ +void +qla2300_ascii_fw_dump(scsi_qla_host_t *ha) +{ + uint32_t cnt; + char *uiter; + char fw_info[30]; + struct qla2300_fw_dump *fw; + uint32_t data_ram_cnt; + + uiter = ha->fw_dump_buffer; + fw = ha->fw_dump; + + qla_uprintf(&uiter, "%s Firmware Version %s\n", ha->model_number, + ha->isp_ops.fw_version_str(ha, fw_info)); + + qla_uprintf(&uiter, "\n[==>BEG]\n"); + + qla_uprintf(&uiter, "HCCR Register:\n%04x\n\n", fw->hccr); + + qla_uprintf(&uiter, "PBIU Registers:"); + for (cnt = 0; cnt < sizeof (fw->pbiu_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->pbiu_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nReqQ-RspQ-Risc2Host Status registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_host_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_host_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nMailbox Registers:"); + for (cnt = 0; cnt < sizeof (fw->mailbox_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->mailbox_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nAuto Request Response DMA Registers:"); + for (cnt = 0; cnt < sizeof (fw->resp_dma_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->resp_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nDMA Registers:"); + for (cnt = 0; cnt < sizeof (fw->dma_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC Hardware Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_hdw_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_hdw_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP0 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp0_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp0_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP1 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp1_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp1_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP2 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp2_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp2_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP3 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp3_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp3_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP4 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp4_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp4_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP5 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp5_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp5_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP6 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp6_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp6_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP7 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp7_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp7_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nFrame Buffer Hardware Registers:"); + for (cnt = 0; cnt < sizeof (fw->frame_buf_hdw_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->frame_buf_hdw_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nFPM B0 Registers:"); + for (cnt = 0; cnt < sizeof (fw->fpm_b0_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->fpm_b0_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nFPM B1 Registers:"); + for (cnt = 0; cnt < sizeof (fw->fpm_b1_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->fpm_b1_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nCode RAM Dump:"); + for (cnt = 0; cnt < sizeof (fw->risc_ram) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n%04x: ", cnt + 0x0800); + } + qla_uprintf(&uiter, "%04x ", fw->risc_ram[cnt]); + } + + qla_uprintf(&uiter, "\n\nStack RAM Dump:"); + for (cnt = 0; cnt < sizeof (fw->stack_ram) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n%05x: ", cnt + 0x10000); + } + qla_uprintf(&uiter, "%04x ", fw->stack_ram[cnt]); + } + + qla_uprintf(&uiter, "\n\nData RAM Dump:"); + data_ram_cnt = ha->fw_memory_size - 0x11000 + 1; + for (cnt = 0; cnt < data_ram_cnt; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n%05x: ", cnt + 0x11000); + } + qla_uprintf(&uiter, "%04x ", fw->data_ram[cnt]); + } + + qla_uprintf(&uiter, "\n\n[<==END] ISP Debug Dump."); +} + /** * qla2100_fw_dump() - Dumps binary data from the 2100/2200 firmware. * @ha: HA context @@ -436,11 +591,10 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked) "request...\n", ha->fw_dump); goto qla2100_fw_dump_failed; } - fw = &ha->fw_dump->isp.isp21; - qla2xxx_prep_dump(ha, ha->fw_dump); + fw = ha->fw_dump; rval = QLA_SUCCESS; - fw->hccr = htons(RD_REG_WORD(®->hccr)); + fw->hccr = RD_REG_WORD(®->hccr); /* Pause RISC. */ WRT_REG_WORD(®->hccr, HCCR_PAUSE_RISC); @@ -454,81 +608,79 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (rval == QLA_SUCCESS) { dmp_reg = (uint16_t __iomem *)(reg + 0); for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++) - fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->pbiu_reg[cnt] = RD_REG_WORD(dmp_reg++); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x10); for (cnt = 0; cnt < ha->mbx_count; cnt++) { if (cnt == 8) { - dmp_reg = (uint16_t __iomem *) - ((uint8_t __iomem *)reg + 0xe0); + dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0xe0); } - fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->mailbox_reg[cnt] = RD_REG_WORD(dmp_reg++); } dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x20); for (cnt = 0; cnt < sizeof(fw->dma_reg) / 2; cnt++) - fw->dma_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->dma_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x00); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0xA0); for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++) - fw->risc_hdw_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2000); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp0_reg) / 2; cnt++) - fw->risc_gp0_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp0_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2100); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp1_reg) / 2; cnt++) - fw->risc_gp1_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp1_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2200); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp2_reg) / 2; cnt++) - fw->risc_gp2_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp2_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2300); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp3_reg) / 2; cnt++) - fw->risc_gp3_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp3_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2400); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp4_reg) / 2; cnt++) - fw->risc_gp4_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp4_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2500); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp5_reg) / 2; cnt++) - fw->risc_gp5_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp5_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2600); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp6_reg) / 2; cnt++) - fw->risc_gp6_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp6_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->pcr, 0x2700); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->risc_gp7_reg) / 2; cnt++) - fw->risc_gp7_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->risc_gp7_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x10); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->frame_buf_hdw_reg) / 2; cnt++) - fw->frame_buf_hdw_reg[cnt] = - htons(RD_REG_WORD(dmp_reg++)); + fw->frame_buf_hdw_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x20); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->fpm_b0_reg) / 2; cnt++) - fw->fpm_b0_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->fpm_b0_reg[cnt] = RD_REG_WORD(dmp_reg++); WRT_REG_WORD(®->ctrl_status, 0x30); dmp_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++) - fw->fpm_b1_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); + fw->fpm_b1_reg[cnt] = RD_REG_WORD(dmp_reg++); /* Reset the ISP. */ WRT_REG_WORD(®->ctrl_status, CSR_ISP_SOFT_RESET); @@ -603,15 +755,12 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { rval = mb0 & MBS_MASK; - fw->risc_ram[cnt] = htons(mb2); + fw->risc_ram[cnt] = mb2; } else { rval = QLA_FUNCTION_FAILED; } } - if (rval == QLA_SUCCESS) - qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]); - if (rval != QLA_SUCCESS) { qla_printk(KERN_WARNING, ha, "Failed to dump firmware (%x)!!!\n", rval); @@ -629,6 +778,179 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked) spin_unlock_irqrestore(&ha->hardware_lock, flags); } +/** + * qla2100_ascii_fw_dump() - Converts a binary firmware dump to ASCII. + * @ha: HA context + */ +void +qla2100_ascii_fw_dump(scsi_qla_host_t *ha) +{ + uint32_t cnt; + char *uiter; + char fw_info[30]; + struct qla2100_fw_dump *fw; + + uiter = ha->fw_dump_buffer; + fw = ha->fw_dump; + + qla_uprintf(&uiter, "%s Firmware Version %s\n", ha->model_number, + ha->isp_ops.fw_version_str(ha, fw_info)); + + qla_uprintf(&uiter, "\n[==>BEG]\n"); + + qla_uprintf(&uiter, "HCCR Register:\n%04x\n\n", fw->hccr); + + qla_uprintf(&uiter, "PBIU Registers:"); + for (cnt = 0; cnt < sizeof (fw->pbiu_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->pbiu_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nMailbox Registers:"); + for (cnt = 0; cnt < sizeof (fw->mailbox_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->mailbox_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nDMA Registers:"); + for (cnt = 0; cnt < sizeof (fw->dma_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC Hardware Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_hdw_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_hdw_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP0 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp0_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp0_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP1 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp1_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp1_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP2 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp2_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp2_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP3 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp3_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp3_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP4 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp4_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp4_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP5 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp5_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp5_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP6 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp6_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp6_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP7 Registers:"); + for (cnt = 0; cnt < sizeof (fw->risc_gp7_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->risc_gp7_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nFrame Buffer Hardware Registers:"); + for (cnt = 0; cnt < sizeof (fw->frame_buf_hdw_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->frame_buf_hdw_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nFPM B0 Registers:"); + for (cnt = 0; cnt < sizeof (fw->fpm_b0_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->fpm_b0_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nFPM B1 Registers:"); + for (cnt = 0; cnt < sizeof (fw->fpm_b1_reg) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n"); + } + qla_uprintf(&uiter, "%04x ", fw->fpm_b1_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC SRAM:"); + for (cnt = 0; cnt < sizeof (fw->risc_ram) / 2; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n%04x: ", cnt + 0x1000); + } + qla_uprintf(&uiter, "%04x ", fw->risc_ram[cnt]); + } + + qla_uprintf(&uiter, "\n\n[<==END] ISP Debug Dump."); + + return; +} + +static int +qla_uprintf(char **uiter, char *fmt, ...) +{ + int iter, len; + char buf[128]; + va_list args; + + va_start(args, fmt); + len = vsprintf(buf, fmt, args); + va_end(args); + + for (iter = 0; iter < len; iter++, *uiter += 1) + *uiter[0] = buf[iter]; + + return (len); +} + + void qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) { @@ -645,7 +967,6 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) unsigned long flags; struct qla24xx_fw_dump *fw; uint32_t ext_mem_cnt; - void *eft; risc_address = ext_mem_cnt = 0; memset(mb, 0, sizeof(mb)); @@ -666,11 +987,10 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) "request...\n", ha->fw_dump); goto qla24xx_fw_dump_failed; } - fw = &ha->fw_dump->isp.isp24; - qla2xxx_prep_dump(ha, ha->fw_dump); + fw = ha->fw_dump; rval = QLA_SUCCESS; - fw->host_status = htonl(RD_REG_DWORD(®->host_status)); + fw->host_status = RD_REG_DWORD(®->host_status); /* Pause RISC. */ if ((RD_REG_DWORD(®->hccr) & HCCRX_RISC_PAUSE) == 0) { @@ -692,7 +1012,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) /* Host interface registers. */ dmp_reg = (uint32_t __iomem *)(reg + 0); for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++) - fw->host_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++)); + fw->host_reg[cnt] = RD_REG_DWORD(dmp_reg++); /* Disable interrupts. */ WRT_REG_DWORD(®->ictrl, 0); @@ -704,471 +1024,470 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); WRT_REG_DWORD(dmp_reg, 0xB0000000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); - fw->shadow_reg[0] = htonl(RD_REG_DWORD(dmp_reg)); + fw->shadow_reg[0] = RD_REG_DWORD(dmp_reg); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); WRT_REG_DWORD(dmp_reg, 0xB0100000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); - fw->shadow_reg[1] = htonl(RD_REG_DWORD(dmp_reg)); + fw->shadow_reg[1] = RD_REG_DWORD(dmp_reg); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); WRT_REG_DWORD(dmp_reg, 0xB0200000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); - fw->shadow_reg[2] = htonl(RD_REG_DWORD(dmp_reg)); + fw->shadow_reg[2] = RD_REG_DWORD(dmp_reg); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); WRT_REG_DWORD(dmp_reg, 0xB0300000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); - fw->shadow_reg[3] = htonl(RD_REG_DWORD(dmp_reg)); + fw->shadow_reg[3] = RD_REG_DWORD(dmp_reg); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); WRT_REG_DWORD(dmp_reg, 0xB0400000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); - fw->shadow_reg[4] = htonl(RD_REG_DWORD(dmp_reg)); + fw->shadow_reg[4] = RD_REG_DWORD(dmp_reg); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); WRT_REG_DWORD(dmp_reg, 0xB0500000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); - fw->shadow_reg[5] = htonl(RD_REG_DWORD(dmp_reg)); + fw->shadow_reg[5] = RD_REG_DWORD(dmp_reg); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); WRT_REG_DWORD(dmp_reg, 0xB0600000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); - fw->shadow_reg[6] = htonl(RD_REG_DWORD(dmp_reg)); + fw->shadow_reg[6] = RD_REG_DWORD(dmp_reg); /* Mailbox registers. */ mbx_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++) - fw->mailbox_reg[cnt] = htons(RD_REG_WORD(mbx_reg++)); + fw->mailbox_reg[cnt] = RD_REG_WORD(mbx_reg++); /* Transfer sequence registers. */ iter_reg = fw->xseq_gp_reg; WRT_REG_DWORD(®->iobase_addr, 0xBF00); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xBF10); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xBF20); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xBF30); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xBF40); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xBF50); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xBF60); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xBF70); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xBFE0); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < sizeof(fw->xseq_0_reg) / 4; cnt++) - fw->xseq_0_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++)); + fw->xseq_0_reg[cnt] = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xBFF0); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < sizeof(fw->xseq_1_reg) / 4; cnt++) - fw->xseq_1_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++)); + fw->xseq_1_reg[cnt] = RD_REG_DWORD(dmp_reg++); /* Receive sequence registers. */ iter_reg = fw->rseq_gp_reg; WRT_REG_DWORD(®->iobase_addr, 0xFF00); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFF10); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFF20); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFF30); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFF40); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFF50); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFF60); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFF70); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFFD0); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < sizeof(fw->rseq_0_reg) / 4; cnt++) - fw->rseq_0_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++)); + fw->rseq_0_reg[cnt] = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFFE0); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < sizeof(fw->rseq_1_reg) / 4; cnt++) - fw->rseq_1_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++)); + fw->rseq_1_reg[cnt] = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0xFFF0); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < sizeof(fw->rseq_2_reg) / 4; cnt++) - fw->rseq_2_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++)); + fw->rseq_2_reg[cnt] = RD_REG_DWORD(dmp_reg++); /* Command DMA registers. */ WRT_REG_DWORD(®->iobase_addr, 0x7100); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < sizeof(fw->cmd_dma_reg) / 4; cnt++) - fw->cmd_dma_reg[cnt] = htonl(RD_REG_DWORD(dmp_reg++)); + fw->cmd_dma_reg[cnt] = RD_REG_DWORD(dmp_reg++); /* Queues. */ iter_reg = fw->req0_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7200); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 8; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xE4); for (cnt = 0; cnt < 7; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); iter_reg = fw->resp0_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7300); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 8; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xE4); for (cnt = 0; cnt < 7; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); iter_reg = fw->req1_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7400); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 8; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xE4); for (cnt = 0; cnt < 7; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); /* Transmit DMA registers. */ iter_reg = fw->xmt0_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7600); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x7610); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); iter_reg = fw->xmt1_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7620); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x7630); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); iter_reg = fw->xmt2_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7640); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x7650); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); iter_reg = fw->xmt3_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7660); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x7670); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); iter_reg = fw->xmt4_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7680); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x7690); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x76A0); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < sizeof(fw->xmt_data_dma_reg) / 4; cnt++) - fw->xmt_data_dma_reg[cnt] = - htonl(RD_REG_DWORD(dmp_reg++)); + fw->xmt_data_dma_reg[cnt] = RD_REG_DWORD(dmp_reg++); /* Receive DMA registers. */ iter_reg = fw->rcvt0_data_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7700); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x7710); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); iter_reg = fw->rcvt1_data_dma_reg; WRT_REG_DWORD(®->iobase_addr, 0x7720); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x7730); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); /* RISC registers. */ iter_reg = fw->risc_gp_reg; WRT_REG_DWORD(®->iobase_addr, 0x0F00); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x0F10); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x0F20); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x0F30); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x0F40); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x0F50); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x0F60); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x0F70); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); /* Local memory controller registers. */ iter_reg = fw->lmc_reg; WRT_REG_DWORD(®->iobase_addr, 0x3000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x3010); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x3020); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x3030); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x3040); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x3050); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x3060); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); /* Fibre Protocol Module registers. */ iter_reg = fw->fpm_hdw_reg; WRT_REG_DWORD(®->iobase_addr, 0x4000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x4010); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x4020); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x4030); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x4040); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x4050); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x4060); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x4070); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x4080); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x4090); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x40A0); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x40B0); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); /* Frame Buffer registers. */ iter_reg = fw->fb_hdw_reg; WRT_REG_DWORD(®->iobase_addr, 0x6000); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x6010); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x6020); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x6030); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x6040); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x6100); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x6130); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x6150); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x6170); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x6190); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); WRT_REG_DWORD(®->iobase_addr, 0x61B0); dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); for (cnt = 0; cnt < 16; cnt++) - *iter_reg++ = htonl(RD_REG_DWORD(dmp_reg++)); + *iter_reg++ = RD_REG_DWORD(dmp_reg++); /* Reset RISC. */ WRT_REG_DWORD(®->ctrl_status, @@ -1258,7 +1577,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { rval = mb[0] & MBS_MASK; - fw->code_ram[cnt] = htonl((mb[3] << 16) | mb[2]); + fw->code_ram[cnt] = (mb[3] << 16) | mb[2]; } else { rval = QLA_FUNCTION_FAILED; } @@ -1308,18 +1627,12 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) { rval = mb[0] & MBS_MASK; - fw->ext_mem[cnt] = htonl((mb[3] << 16) | mb[2]); + fw->ext_mem[cnt] = (mb[3] << 16) | mb[2]; } else { rval = QLA_FUNCTION_FAILED; } } - if (rval == QLA_SUCCESS) { - eft = qla2xxx_copy_queues(ha, &fw->ext_mem[cnt]); - if (ha->eft) - memcpy(eft, ha->eft, ntohl(ha->fw_dump->eft_size)); - } - if (rval != QLA_SUCCESS) { qla_printk(KERN_WARNING, ha, "Failed to dump firmware (%x)!!!\n", rval); @@ -1337,6 +1650,252 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) spin_unlock_irqrestore(&ha->hardware_lock, flags); } +void +qla24xx_ascii_fw_dump(scsi_qla_host_t *ha) +{ + uint32_t cnt; + char *uiter; + struct qla24xx_fw_dump *fw; + uint32_t ext_mem_cnt; + + uiter = ha->fw_dump_buffer; + fw = ha->fw_dump; + + qla_uprintf(&uiter, "ISP FW Version %d.%02d.%02d Attributes %04x\n", + ha->fw_major_version, ha->fw_minor_version, + ha->fw_subminor_version, ha->fw_attributes); + + qla_uprintf(&uiter, "\nR2H Status Register\n%04x\n", fw->host_status); + + qla_uprintf(&uiter, "\nHost Interface Registers"); + for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->host_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nShadow Registers"); + for (cnt = 0; cnt < sizeof(fw->shadow_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->shadow_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nMailbox Registers"); + for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->mailbox_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nXSEQ GP Registers"); + for (cnt = 0; cnt < sizeof(fw->xseq_gp_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->xseq_gp_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nXSEQ-0 Registers"); + for (cnt = 0; cnt < sizeof(fw->xseq_0_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->xseq_0_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nXSEQ-1 Registers"); + for (cnt = 0; cnt < sizeof(fw->xseq_1_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->xseq_1_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRSEQ GP Registers"); + for (cnt = 0; cnt < sizeof(fw->rseq_gp_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->rseq_gp_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRSEQ-0 Registers"); + for (cnt = 0; cnt < sizeof(fw->rseq_0_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->rseq_0_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRSEQ-1 Registers"); + for (cnt = 0; cnt < sizeof(fw->rseq_1_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->rseq_1_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRSEQ-2 Registers"); + for (cnt = 0; cnt < sizeof(fw->rseq_2_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->rseq_2_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nCommand DMA Registers"); + for (cnt = 0; cnt < sizeof(fw->cmd_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->cmd_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRequest0 Queue DMA Channel Registers"); + for (cnt = 0; cnt < sizeof(fw->req0_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->req0_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nResponse0 Queue DMA Channel Registers"); + for (cnt = 0; cnt < sizeof(fw->resp0_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->resp0_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRequest1 Queue DMA Channel Registers"); + for (cnt = 0; cnt < sizeof(fw->req1_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->req1_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nXMT0 Data DMA Registers"); + for (cnt = 0; cnt < sizeof(fw->xmt0_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->xmt0_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nXMT1 Data DMA Registers"); + for (cnt = 0; cnt < sizeof(fw->xmt1_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->xmt1_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nXMT2 Data DMA Registers"); + for (cnt = 0; cnt < sizeof(fw->xmt2_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->xmt2_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nXMT3 Data DMA Registers"); + for (cnt = 0; cnt < sizeof(fw->xmt3_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->xmt3_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nXMT4 Data DMA Registers"); + for (cnt = 0; cnt < sizeof(fw->xmt4_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->xmt4_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nXMT Data DMA Common Registers"); + for (cnt = 0; cnt < sizeof(fw->xmt_data_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->xmt_data_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRCV Thread 0 Data DMA Registers"); + for (cnt = 0; cnt < sizeof(fw->rcvt0_data_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->rcvt0_data_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRCV Thread 1 Data DMA Registers"); + for (cnt = 0; cnt < sizeof(fw->rcvt1_data_dma_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->rcvt1_data_dma_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nRISC GP Registers"); + for (cnt = 0; cnt < sizeof(fw->risc_gp_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->risc_gp_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nLMC Registers"); + for (cnt = 0; cnt < sizeof(fw->lmc_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->lmc_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nFPM Hardware Registers"); + for (cnt = 0; cnt < sizeof(fw->fpm_hdw_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->fpm_hdw_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nFB Hardware Registers"); + for (cnt = 0; cnt < sizeof(fw->fb_hdw_reg) / 4; cnt++) { + if (cnt % 8 == 0) + qla_uprintf(&uiter, "\n"); + + qla_uprintf(&uiter, "%08x ", fw->fb_hdw_reg[cnt]); + } + + qla_uprintf(&uiter, "\n\nCode RAM"); + for (cnt = 0; cnt < sizeof (fw->code_ram) / 4; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n%08x: ", cnt + 0x20000); + } + qla_uprintf(&uiter, "%08x ", fw->code_ram[cnt]); + } + + qla_uprintf(&uiter, "\n\nExternal Memory"); + ext_mem_cnt = ha->fw_memory_size - 0x100000 + 1; + for (cnt = 0; cnt < ext_mem_cnt; cnt++) { + if (cnt % 8 == 0) { + qla_uprintf(&uiter, "\n%08x: ", cnt + 0x100000); + } + qla_uprintf(&uiter, "%08x ", fw->ext_mem[cnt]); + } + + qla_uprintf(&uiter, "\n[<==END] ISP Debug Dump"); +} + + /****************************************************************************/ /* Driver Debug Functions. */ /****************************************************************************/ diff --git a/trunk/drivers/scsi/qla2xxx/qla_dbg.h b/trunk/drivers/scsi/qla2xxx/qla_dbg.h index 533425338e05..ab6afeaa2f2c 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_dbg.h +++ b/trunk/drivers/scsi/qla2xxx/qla_dbg.h @@ -37,86 +37,134 @@ /* * Macros use for debugging the driver. */ +#undef ENTER_TRACE +#if defined(ENTER_TRACE) +#define ENTER(x) do { printk("qla2100 : Entering %s()\n", x); } while (0) +#define LEAVE(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0) +#define ENTER_INTR(x) do { printk("qla2100 : Entering %s()\n", x); } while (0) +#define LEAVE_INTR(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0) +#else +#define ENTER(x) do {} while (0) +#define LEAVE(x) do {} while (0) +#define ENTER_INTR(x) do {} while (0) +#define LEAVE_INTR(x) do {} while (0) +#endif -#define DEBUG(x) do { if (extended_error_logging) { x; } } while (0) +#if DEBUG_QLA2100 +#define DEBUG(x) do {x;} while (0); +#else +#define DEBUG(x) do {} while (0); +#endif #if defined(QL_DEBUG_LEVEL_1) -#define DEBUG1(x) do {x;} while (0) +#define DEBUG1(x) do {x;} while (0); #else -#define DEBUG1(x) do {} while (0) +#define DEBUG1(x) do {} while (0); #endif -#define DEBUG2(x) do { if (extended_error_logging) { x; } } while (0) -#define DEBUG2_3(x) do { if (extended_error_logging) { x; } } while (0) -#define DEBUG2_3_11(x) do { if (extended_error_logging) { x; } } while (0) -#define DEBUG2_9_10(x) do { if (extended_error_logging) { x; } } while (0) -#define DEBUG2_11(x) do { if (extended_error_logging) { x; } } while (0) -#define DEBUG2_13(x) do { if (extended_error_logging) { x; } } while (0) +#if defined(QL_DEBUG_LEVEL_2) +#define DEBUG2(x) do {x;} while (0); +#define DEBUG2_3(x) do {x;} while (0); +#define DEBUG2_3_11(x) do {x;} while (0); +#define DEBUG2_9_10(x) do {x;} while (0); +#define DEBUG2_11(x) do {x;} while (0); +#define DEBUG2_13(x) do {x;} while (0); +#else +#define DEBUG2(x) do {} while (0); +#endif #if defined(QL_DEBUG_LEVEL_3) -#define DEBUG3(x) do {x;} while (0) -#define DEBUG3_11(x) do {x;} while (0) +#define DEBUG3(x) do {x;} while (0); +#define DEBUG2_3(x) do {x;} while (0); +#define DEBUG2_3_11(x) do {x;} while (0); +#define DEBUG3_11(x) do {x;} while (0); #else -#define DEBUG3(x) do {} while (0) +#define DEBUG3(x) do {} while (0); + #if !defined(QL_DEBUG_LEVEL_2) + #define DEBUG2_3(x) do {} while (0); + #endif #endif #if defined(QL_DEBUG_LEVEL_4) -#define DEBUG4(x) do {x;} while (0) +#define DEBUG4(x) do {x;} while (0); #else -#define DEBUG4(x) do {} while (0) +#define DEBUG4(x) do {} while (0); #endif #if defined(QL_DEBUG_LEVEL_5) -#define DEBUG5(x) do {x;} while (0) +#define DEBUG5(x) do {x;} while (0); #else -#define DEBUG5(x) do {} while (0) +#define DEBUG5(x) do {} while (0); #endif #if defined(QL_DEBUG_LEVEL_7) -#define DEBUG7(x) do {x;} while (0) +#define DEBUG7(x) do {x;} while (0); #else -#define DEBUG7(x) do {} while (0) +#define DEBUG7(x) do {} while (0); #endif #if defined(QL_DEBUG_LEVEL_9) -#define DEBUG9(x) do {x;} while (0) -#define DEBUG9_10(x) do {x;} while (0) +#define DEBUG9(x) do {x;} while (0); +#define DEBUG9_10(x) do {x;} while (0); +#define DEBUG2_9_10(x) do {x;} while (0); #else -#define DEBUG9(x) do {} while (0) +#define DEBUG9(x) do {} while (0); #endif #if defined(QL_DEBUG_LEVEL_10) -#define DEBUG10(x) do {x;} while (0) -#define DEBUG9_10(x) do {x;} while (0) +#define DEBUG10(x) do {x;} while (0); +#define DEBUG2_9_10(x) do {x;} while (0); +#define DEBUG9_10(x) do {x;} while (0); #else -#define DEBUG10(x) do {} while (0) +#define DEBUG10(x) do {} while (0); + #if !defined(DEBUG2_9_10) + #define DEBUG2_9_10(x) do {} while (0); + #endif #if !defined(DEBUG9_10) - #define DEBUG9_10(x) do {} while (0) + #define DEBUG9_10(x) do {} while (0); #endif #endif #if defined(QL_DEBUG_LEVEL_11) -#define DEBUG11(x) do{x;} while(0) +#define DEBUG11(x) do{x;} while(0); +#if !defined(DEBUG2_11) +#define DEBUG2_11(x) do{x;} while(0); +#endif +#if !defined(DEBUG2_3_11) +#define DEBUG2_3_11(x) do{x;} while(0); +#endif #if !defined(DEBUG3_11) -#define DEBUG3_11(x) do{x;} while(0) +#define DEBUG3_11(x) do{x;} while(0); #endif #else -#define DEBUG11(x) do{} while(0) +#define DEBUG11(x) do{} while(0); + #if !defined(QL_DEBUG_LEVEL_2) + #define DEBUG2_11(x) do{} while(0); + #if !defined(QL_DEBUG_LEVEL_3) + #define DEBUG2_3_11(x) do{} while(0); + #endif + #endif #if !defined(QL_DEBUG_LEVEL_3) - #define DEBUG3_11(x) do{} while(0) + #define DEBUG3_11(x) do{} while(0); #endif #endif #if defined(QL_DEBUG_LEVEL_12) -#define DEBUG12(x) do {x;} while (0) +#define DEBUG12(x) do {x;} while (0); #else -#define DEBUG12(x) do {} while (0) +#define DEBUG12(x) do {} while (0); #endif #if defined(QL_DEBUG_LEVEL_13) #define DEBUG13(x) do {x;} while (0) +#if !defined(DEBUG2_13) +#define DEBUG2_13(x) do {x;} while(0) +#endif #else #define DEBUG13(x) do {} while (0) +#if !defined(QL_DEBUG_LEVEL_2) +#define DEBUG2_13(x) do {} while(0) +#endif #endif #if defined(QL_DEBUG_LEVEL_14) @@ -128,6 +176,9 @@ /* * Firmware Dump structure definition */ +#define FW_DUMP_SIZE_128K 0xBC000 +#define FW_DUMP_SIZE_512K 0x2FC000 +#define FW_DUMP_SIZE_1M 0x5FC000 struct qla2300_fw_dump { uint16_t hccr; @@ -173,6 +224,8 @@ struct qla2100_fw_dump { uint16_t risc_ram[0xf000]; }; +#define FW_DUMP_SIZE_24XX 0x2B0000 + struct qla24xx_fw_dump { uint32_t host_status; uint32_t host_reg[32]; @@ -204,39 +257,3 @@ struct qla24xx_fw_dump { uint32_t code_ram[0x2000]; uint32_t ext_mem[1]; }; - -#define EFT_NUM_BUFFERS 4 -#define EFT_BYTES_PER_BUFFER 0x4000 -#define EFT_SIZE ((EFT_BYTES_PER_BUFFER) * (EFT_NUM_BUFFERS)) - -struct qla2xxx_fw_dump { - uint8_t signature[4]; - uint32_t version; - - uint32_t fw_major_version; - uint32_t fw_minor_version; - uint32_t fw_subminor_version; - uint32_t fw_attributes; - - uint32_t vendor; - uint32_t device; - uint32_t subsystem_vendor; - uint32_t subsystem_device; - - uint32_t fixed_size; - uint32_t mem_size; - uint32_t req_q_size; - uint32_t rsp_q_size; - - uint32_t eft_size; - uint32_t eft_addr_l; - uint32_t eft_addr_h; - - uint32_t header_size; - - union { - struct qla2100_fw_dump isp21; - struct qla2300_fw_dump isp23; - struct qla24xx_fw_dump isp24; - } isp; -}; diff --git a/trunk/drivers/scsi/qla2xxx/qla_def.h b/trunk/drivers/scsi/qla2xxx/qla_def.h index 139ea0e27fd7..d6f6579cfd27 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_def.h +++ b/trunk/drivers/scsi/qla2xxx/qla_def.h @@ -608,9 +608,7 @@ typedef struct { #define MBC_SERDES_PARAMS 0x10 /* Serdes Tx Parameters. */ #define MBC_GET_IOCB_STATUS 0x12 /* Get IOCB status command. */ #define MBC_GET_TIMEOUT_PARAMS 0x22 /* Get FW timeouts. */ -#define MBC_TRACE_CONTROL 0x27 /* Trace control command. */ #define MBC_GEN_SYSTEM_ERROR 0x2a /* Generate System Error. */ -#define MBC_READ_SFP 0x31 /* Read SFP Data. */ #define MBC_SET_TIMEOUT_PARAMS 0x32 /* Set FW timeouts. */ #define MBC_MID_INITIALIZE_FIRMWARE 0x48 /* MID Initialize firmware. */ #define MBC_MID_GET_VP_DATABASE 0x49 /* MID Get VP Database. */ @@ -620,9 +618,6 @@ typedef struct { #define MBC_GET_LINK_PRIV_STATS 0x6d /* Get link & private data. */ #define MBC_SET_VENDOR_ID 0x76 /* Set Vendor ID. */ -#define TC_ENABLE 4 -#define TC_DISABLE 5 - /* Firmware return data sizes */ #define FCAL_MAP_SIZE 128 @@ -2002,6 +1997,7 @@ struct isp_operations { uint32_t); void (*fw_dump) (struct scsi_qla_host *, int); + void (*ascii_fw_dump) (struct scsi_qla_host *); int (*beacon_on) (struct scsi_qla_host *); int (*beacon_off) (struct scsi_qla_host *); @@ -2045,7 +2041,6 @@ typedef struct scsi_qla_host { uint32_t enable_led_scheme :1; uint32_t msi_enabled :1; uint32_t msix_enabled :1; - uint32_t disable_serdes :1; } flags; atomic_t loop_state; @@ -2139,7 +2134,7 @@ typedef struct scsi_qla_host { mempool_t *srb_mempool; /* This spinlock is used to protect "io transactions", you must - * acquire it before doing any IO to the card, eg with RD_REG*() and + * aquire it before doing any IO to the card, eg with RD_REG*() and * WRT_REG*() for the duration of your entire commandtransaction. * * This spinlock is of lower priority than the io request lock. @@ -2243,11 +2238,6 @@ typedef struct scsi_qla_host { struct sns_cmd_pkt *sns_cmd; dma_addr_t sns_cmd_dma; -#define SFP_DEV_SIZE 256 -#define SFP_BLOCK_SIZE 64 - void *sfp_data; - dma_addr_t sfp_data_dma; - struct task_struct *dpc_thread; uint8_t dpc_active; /* DPC routine is active */ @@ -2313,12 +2303,11 @@ typedef struct scsi_qla_host { uint16_t fw_seriallink_options24[4]; /* Firmware dump information. */ - struct qla2xxx_fw_dump *fw_dump; - uint32_t fw_dump_len; + void *fw_dump; int fw_dumped; int fw_dump_reading; - dma_addr_t eft_dma; - void *eft; + char *fw_dump_buffer; + int fw_dump_buffer_len; uint8_t host_str[16]; uint32_t pci_attr; diff --git a/trunk/drivers/scsi/qla2xxx/qla_devtbl.h b/trunk/drivers/scsi/qla2xxx/qla_devtbl.h index dd435410dfa2..a8fc0ffc7fc5 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_devtbl.h +++ b/trunk/drivers/scsi/qla2xxx/qla_devtbl.h @@ -1,4 +1,4 @@ -#define QLA_MODEL_NAMES 0x57 +#define QLA_MODEL_NAMES 0x4A /* * Adapter model names and descriptions. @@ -76,19 +76,6 @@ static char *qla2x00_model_name[QLA_MODEL_NAMES*2] = { "QLE2440", "PCI-Express to 4Gb FC, Single Channel", /* 0x145 */ "QLE2464", "PCI-Express to 4Gb FC, Quad Channel", /* 0x146 */ "QLA2440", "PCI-X 2.0 to 4Gb FC, Single Channel", /* 0x147 */ - "HP AE369A", "PCI-X 2.0 to 4Gb FC, Dual Channel", /* 0x148 */ + " ", " ", /* 0x148 */ "QLA2340", "Sun 133MHz PCI-X to 2Gb FC, Single Channel", /* 0x149 */ - " ", " ", /* 0x14a */ - " ", " ", /* 0x14b */ - "QMC2432M", "IBM eServer BC 4Gb FC Expansion Card CFFE", /* 0x14c */ - "QMC2422M", "IBM eServer BC 4Gb FC Expansion Card CFFX", /* 0x14d */ - "QLE220", "Sun PCI-Express to 4Gb FC, Single Channel", /* 0x14e */ - " ", " ", /* 0x14f */ - " ", " ", /* 0x150 */ - " ", " ", /* 0x151 */ - "QME2462", "PCI-Express to 4Gb FC, Dual Channel Mezz HBA", /* 0x152 */ - "QMH2462", "PCI-Express to 4Gb FC, Dual Channel Mezz HBA", /* 0x153 */ - " ", " ", /* 0x154 */ - "QLE220", "PCI-Express to 4Gb FC, Single Channel", /* 0x155 */ - "QLE220", "PCI-Express to 4Gb FC, Single Channel", /* 0x156 */ }; diff --git a/trunk/drivers/scsi/qla2xxx/qla_fw.h b/trunk/drivers/scsi/qla2xxx/qla_fw.h index a0a722cf4237..3af478663be7 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_fw.h +++ b/trunk/drivers/scsi/qla2xxx/qla_fw.h @@ -141,7 +141,7 @@ struct nvram_24xx { * BIT 2 = Enable Memory Map BIOS * BIT 3 = Enable Selectable Boot * BIT 4 = Disable RISC code load - * BIT 5 = Disable Serdes + * BIT 5 = * BIT 6 = * BIT 7 = * @@ -278,7 +278,7 @@ struct init_cb_24xx { uint16_t response_q_length; uint16_t request_q_length; - uint16_t link_down_on_nos; /* Milliseconds. */ + uint16_t link_down_timeout; /* Milliseconds. */ uint16_t prio_request_q_length; diff --git a/trunk/drivers/scsi/qla2xxx/qla_gbl.h b/trunk/drivers/scsi/qla2xxx/qla_gbl.h index 8311ac2b93a8..164d53ccbfd0 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_gbl.h +++ b/trunk/drivers/scsi/qla2xxx/qla_gbl.h @@ -31,9 +31,13 @@ extern void qla2x00_update_fw_options(struct scsi_qla_host *); extern void qla24xx_update_fw_options(scsi_qla_host_t *); extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *); extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *); +extern int qla24xx_load_risc_flash(scsi_qla_host_t *, uint32_t *); + +extern fc_port_t *qla2x00_alloc_fcport(scsi_qla_host_t *, gfp_t); extern int qla2x00_loop_resync(scsi_qla_host_t *); +extern int qla2x00_find_new_loop_id(scsi_qla_host_t *, fc_port_t *); extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *); extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *); @@ -47,8 +51,6 @@ extern int qla2x00_abort_isp(scsi_qla_host_t *); extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *); extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *); -extern void qla2x00_alloc_fw_dump(scsi_qla_host_t *); - /* * Global Data in qla_os.c source file. */ @@ -59,8 +61,6 @@ extern int qlport_down_retry; extern int ql2xplogiabsentdevice; extern int ql2xloginretrycount; extern int ql2xfdmienable; -extern int ql2xallocfwdump; -extern int extended_error_logging; extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *); @@ -80,6 +80,8 @@ extern void qla2xxx_wake_dpc(scsi_qla_host_t *); /* * Global Function Prototypes in qla_iocb.c source file. */ +extern void qla2x00_isp_cmd(scsi_qla_host_t *); + extern uint16_t qla2x00_calc_iocbs_32(uint16_t); extern uint16_t qla2x00_calc_iocbs_64(uint16_t); extern void qla2x00_build_scsi_iocbs_32(srb_t *, cmd_entry_t *, uint16_t); @@ -202,12 +204,6 @@ qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t); extern int qla2x00_stop_firmware(scsi_qla_host_t *); -extern int -qla2x00_trace_control(scsi_qla_host_t *, uint16_t, dma_addr_t, uint16_t); - -extern int -qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t); - /* * Global Function Prototypes in qla_isr.c source file. */ @@ -258,6 +254,9 @@ extern int qla24xx_write_optrom_data(struct scsi_qla_host *, uint8_t *, extern void qla2100_fw_dump(scsi_qla_host_t *, int); extern void qla2300_fw_dump(scsi_qla_host_t *, int); extern void qla24xx_fw_dump(scsi_qla_host_t *, int); +extern void qla2100_ascii_fw_dump(scsi_qla_host_t *); +extern void qla2300_ascii_fw_dump(scsi_qla_host_t *); +extern void qla24xx_ascii_fw_dump(scsi_qla_host_t *); extern void qla2x00_dump_regs(scsi_qla_host_t *); extern void qla2x00_dump_buffer(uint8_t *, uint32_t); extern void qla2x00_print_scsi_cmd(struct scsi_cmnd *); @@ -280,6 +279,13 @@ extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t); extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t); extern int qla2x00_fdmi_register(scsi_qla_host_t *); +/* + * Global Function Prototypes in qla_xioctl.c source file. + */ +#define qla2x00_enqueue_aen(ha, cmd, mode) do { } while (0) +#define qla2x00_alloc_ioctl_mem(ha) (0) +#define qla2x00_free_ioctl_mem(ha) do { } while (0) + /* * Global Function Prototypes in qla_attr.c source file. */ diff --git a/trunk/drivers/scsi/qla2xxx/qla_init.c b/trunk/drivers/scsi/qla2xxx/qla_init.c index 9758dba95542..3d4487eac9b7 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_init.c +++ b/trunk/drivers/scsi/qla2xxx/qla_init.c @@ -39,8 +39,6 @@ static int qla2x00_fabric_dev_login(scsi_qla_host_t *, fc_port_t *, static int qla2x00_restart_isp(scsi_qla_host_t *); -static int qla2x00_find_new_loop_id(scsi_qla_host_t *ha, fc_port_t *dev); - /****************************************************************************/ /* QLogic ISP2x00 Hardware Support Functions. */ /****************************************************************************/ @@ -91,17 +89,6 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha) ha->isp_ops.nvram_config(ha); - if (ha->flags.disable_serdes) { - /* Mask HBA via NVRAM settings? */ - qla_printk(KERN_INFO, ha, "Masking HBA WWPN " - "%02x%02x%02x%02x%02x%02x%02x%02x (via NVRAM).\n", - ha->port_name[0], ha->port_name[1], - ha->port_name[2], ha->port_name[3], - ha->port_name[4], ha->port_name[5], - ha->port_name[6], ha->port_name[7]); - return QLA_FUNCTION_FAILED; - } - qla_printk(KERN_INFO, ha, "Verifying loaded RISC code...\n"); retry = 10; @@ -783,104 +770,29 @@ qla24xx_chip_diag(scsi_qla_host_t *ha) return rval; } -void +static void qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) { - int rval; - uint32_t dump_size, fixed_size, mem_size, req_q_size, rsp_q_size, - eft_size; - dma_addr_t eft_dma; - void *eft; - - if (ha->fw_dump) { - qla_printk(KERN_WARNING, ha, - "Firmware dump previously allocated.\n"); - return; - } + uint32_t dump_size = 0; ha->fw_dumped = 0; - fixed_size = mem_size = eft_size = 0; if (IS_QLA2100(ha) || IS_QLA2200(ha)) { - fixed_size = sizeof(struct qla2100_fw_dump); + dump_size = sizeof(struct qla2100_fw_dump); } else if (IS_QLA23XX(ha)) { - fixed_size = offsetof(struct qla2300_fw_dump, data_ram); - mem_size = (ha->fw_memory_size - 0x11000 + 1) * - sizeof(uint16_t); - } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { - fixed_size = offsetof(struct qla24xx_fw_dump, ext_mem); - mem_size = (ha->fw_memory_size - 0x100000 + 1) * - sizeof(uint32_t); - - /* Allocate memory for Extended Trace Buffer. */ - eft = dma_alloc_coherent(&ha->pdev->dev, EFT_SIZE, &eft_dma, - GFP_KERNEL); - if (!eft) { - qla_printk(KERN_WARNING, ha, "Unable to allocate " - "(%d KB) for EFT.\n", EFT_SIZE / 1024); - goto cont_alloc; - } - - rval = qla2x00_trace_control(ha, TC_ENABLE, eft_dma, - EFT_NUM_BUFFERS); - if (rval) { - qla_printk(KERN_WARNING, ha, "Unable to initialize " - "EFT (%d).\n", rval); - dma_free_coherent(&ha->pdev->dev, EFT_SIZE, eft, - eft_dma); - goto cont_alloc; - } - - qla_printk(KERN_INFO, ha, "Allocated (%d KB) for EFT...\n", - EFT_SIZE / 1024); - - eft_size = EFT_SIZE; - memset(eft, 0, eft_size); - ha->eft_dma = eft_dma; - ha->eft = eft; + dump_size = sizeof(struct qla2300_fw_dump); + dump_size += (ha->fw_memory_size - 0x11000) * sizeof(uint16_t); + } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { + dump_size = sizeof(struct qla24xx_fw_dump); + dump_size += (ha->fw_memory_size - 0x100000) * sizeof(uint32_t); } -cont_alloc: - req_q_size = ha->request_q_length * sizeof(request_t); - rsp_q_size = ha->response_q_length * sizeof(response_t); - - dump_size = offsetof(struct qla2xxx_fw_dump, isp); - dump_size += fixed_size + mem_size + req_q_size + rsp_q_size + - eft_size; ha->fw_dump = vmalloc(dump_size); - if (!ha->fw_dump) { + if (ha->fw_dump) + qla_printk(KERN_INFO, ha, "Allocated (%d KB) for firmware " + "dump...\n", dump_size / 1024); + else qla_printk(KERN_WARNING, ha, "Unable to allocate (%d KB) for " "firmware dump!!!\n", dump_size / 1024); - - if (ha->eft) { - dma_free_coherent(&ha->pdev->dev, eft_size, ha->eft, - ha->eft_dma); - ha->eft = NULL; - ha->eft_dma = 0; - } - return; - } - - qla_printk(KERN_INFO, ha, "Allocated (%d KB) for firmware dump...\n", - dump_size / 1024); - - ha->fw_dump_len = dump_size; - ha->fw_dump->signature[0] = 'Q'; - ha->fw_dump->signature[1] = 'L'; - ha->fw_dump->signature[2] = 'G'; - ha->fw_dump->signature[3] = 'C'; - ha->fw_dump->version = __constant_htonl(1); - - ha->fw_dump->fixed_size = htonl(fixed_size); - ha->fw_dump->mem_size = htonl(mem_size); - ha->fw_dump->req_q_size = htonl(req_q_size); - ha->fw_dump->rsp_q_size = htonl(rsp_q_size); - - ha->fw_dump->eft_size = htonl(eft_size); - ha->fw_dump->eft_addr_l = htonl(LSD(ha->eft_dma)); - ha->fw_dump->eft_addr_h = htonl(MSD(ha->eft_dma)); - - ha->fw_dump->header_size = - htonl(offsetof(struct qla2xxx_fw_dump, isp)); } /** @@ -898,6 +810,8 @@ qla2x00_resize_request_q(scsi_qla_host_t *ha) dma_addr_t request_dma; request_t *request_ring; + qla2x00_alloc_fw_dump(ha); + /* Valid only on recent ISPs. */ if (IS_QLA2100(ha) || IS_QLA2200(ha)) return; @@ -969,9 +883,6 @@ qla2x00_setup_chip(scsi_qla_host_t *ha) &ha->fw_subminor_version, &ha->fw_attributes, &ha->fw_memory_size); qla2x00_resize_request_q(ha); - - if (ql2xallocfwdump) - qla2x00_alloc_fw_dump(ha); } } else { DEBUG2(printk(KERN_INFO @@ -1275,7 +1186,8 @@ qla2x00_fw_ready(scsi_qla_host_t *ha) rval = QLA_FUNCTION_FAILED; if (atomic_read(&ha->loop_down_timer) && - fw_state != FSTATE_READY) { + (fw_state >= FSTATE_LOSS_OF_SYNC || + fw_state == FSTATE_WAIT_AL_PA)) { /* Loop down. Timeout on min_wait for states * other than Wait for Login. */ @@ -1643,8 +1555,6 @@ qla2x00_nvram_config(scsi_qla_host_t *ha) /* * Set host adapter parameters. */ - if (nv->host_p[0] & BIT_7) - extended_error_logging = 1; ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0); /* Always load RISC code on non ISP2[12]00 chips. */ if (!IS_QLA2100(ha) && !IS_QLA2200(ha)) @@ -1653,7 +1563,6 @@ qla2x00_nvram_config(scsi_qla_host_t *ha) ha->flags.enable_lip_full_login = ((nv->host_p[1] & BIT_2) ? 1 : 0); ha->flags.enable_target_reset = ((nv->host_p[1] & BIT_3) ? 1 : 0); ha->flags.enable_led_scheme = (nv->special_options[1] & BIT_4) ? 1 : 0; - ha->flags.disable_serdes = 0; ha->operating_mode = (icb->add_firmware_options[0] & (BIT_6 | BIT_5 | BIT_4)) >> 4; @@ -1792,7 +1701,7 @@ qla2x00_rport_del(void *data) * * Returns a pointer to the allocated fcport, or NULL, if none available. */ -static fc_port_t * +fc_port_t * qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags) { fc_port_t *fcport; @@ -2588,7 +2497,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports) * Context: * Kernel context. */ -static int +int qla2x00_find_new_loop_id(scsi_qla_host_t *ha, fc_port_t *dev) { int rval; @@ -3139,14 +3048,14 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) ha->isp_abort_cnt--; DEBUG(printk("qla%ld: ISP abort - " "retry remaining %d\n", - ha->host_no, ha->isp_abort_cnt)); + ha->host_no, ha->isp_abort_cnt);) status = 1; } } else { ha->isp_abort_cnt = MAX_RETRIES_OF_ISP_ABORT; DEBUG(printk("qla2x00(%ld): ISP error recovery " "- retrying (%d) more times\n", - ha->host_no, ha->isp_abort_cnt)); + ha->host_no, ha->isp_abort_cnt);) set_bit(ISP_ABORT_RETRY, &ha->dpc_flags); status = 1; } @@ -3160,7 +3069,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) } else { DEBUG(printk(KERN_INFO "qla2x00_abort_isp(%ld): exiting.\n", - ha->host_no)); + ha->host_no);) } return(status); @@ -3236,7 +3145,7 @@ qla2x00_restart_isp(scsi_qla_host_t *ha) clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); if (!(status = qla2x00_fw_ready(ha))) { DEBUG(printk("%s(): Start configure loop, " - "status = %d\n", __func__, status)); + "status = %d\n", __func__, status);) /* Issue a marker after FW becomes ready. */ qla2x00_marker(ha, 0, 0, MK_SYNC_ALL); @@ -3260,7 +3169,7 @@ qla2x00_restart_isp(scsi_qla_host_t *ha) DEBUG(printk("%s(): Configure loop done, status = 0x%x\n", __func__, - status)); + status);) } return (status); } @@ -3380,6 +3289,7 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) nv->node_name[6] = 0x55; nv->node_name[7] = 0x86; nv->login_retry_count = __constant_cpu_to_le16(8); + nv->link_down_timeout = __constant_cpu_to_le16(200); nv->interrupt_delay_timer = __constant_cpu_to_le16(0); nv->login_timeout = __constant_cpu_to_le16(0); nv->firmware_options_1 = @@ -3408,7 +3318,7 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) *dptr1++ = *dptr2++; icb->login_retry_count = nv->login_retry_count; - icb->link_down_on_nos = nv->link_down_on_nos; + icb->link_down_timeout = nv->link_down_timeout; /* Copy 2nd segment. */ dptr1 = (uint8_t *)&icb->interrupt_delay_timer; @@ -3463,7 +3373,6 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) ha->flags.enable_lip_full_login = 1; ha->flags.enable_target_reset = 1; ha->flags.enable_led_scheme = 0; - ha->flags.disable_serdes = le32_to_cpu(nv->host_p) & BIT_5 ? 1: 0; ha->operating_mode = (le32_to_cpu(icb->firmware_options_2) & (BIT_6 | BIT_5 | BIT_4)) >> 4; @@ -3563,7 +3472,7 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) return (rval); } -static int +int qla24xx_load_risc_flash(scsi_qla_host_t *ha, uint32_t *srisc_addr) { int rval; diff --git a/trunk/drivers/scsi/qla2xxx/qla_iocb.c b/trunk/drivers/scsi/qla2xxx/qla_iocb.c index 2b60a27eff0b..8c769cfaa14c 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_iocb.c +++ b/trunk/drivers/scsi/qla2xxx/qla_iocb.c @@ -15,7 +15,6 @@ static inline uint16_t qla2x00_get_cmd_direction(struct scsi_cmnd *cmd); static inline cont_entry_t *qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *); static inline cont_a64_entry_t *qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *); static request_t *qla2x00_req_pkt(scsi_qla_host_t *ha); -static void qla2x00_isp_cmd(scsi_qla_host_t *ha); /** * qla2x00_get_cmd_direction() - Determine control_flag data direction. @@ -575,7 +574,7 @@ qla2x00_req_pkt(scsi_qla_host_t *ha) * * Note: The caller must hold the hardware lock before calling this routine. */ -static void +void qla2x00_isp_cmd(scsi_qla_host_t *ha) { device_reg_t __iomem *reg = ha->iobase; diff --git a/trunk/drivers/scsi/qla2xxx/qla_isr.c b/trunk/drivers/scsi/qla2xxx/qla_isr.c index 795bf15b1b8f..b28ac0a27e25 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_isr.c +++ b/trunk/drivers/scsi/qla2xxx/qla_isr.c @@ -395,6 +395,10 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); ha->flags.management_server_logged_in = 0; + + /* Update AEN queue. */ + qla2x00_enqueue_aen(ha, MBA_LIP_OCCURRED, NULL); + break; case MBA_LOOP_UP: /* Loop Up Event */ @@ -414,6 +418,9 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) link_speed); ha->flags.management_server_logged_in = 0; + + /* Update AEN queue. */ + qla2x00_enqueue_aen(ha, MBA_LOOP_UP, NULL); break; case MBA_LOOP_DOWN: /* Loop Down Event */ @@ -432,6 +439,9 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) ha->link_data_rate = LDR_UNKNOWN; if (ql2xfdmienable) set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); + + /* Update AEN queue. */ + qla2x00_enqueue_aen(ha, MBA_LOOP_DOWN, NULL); break; case MBA_LIP_RESET: /* LIP reset occurred */ @@ -450,6 +460,10 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) ha->operating_mode = LOOP; ha->flags.management_server_logged_in = 0; + + /* Update AEN queue. */ + qla2x00_enqueue_aen(ha, MBA_LIP_RESET, NULL); + break; case MBA_POINT_TO_POINT: /* Point-to-Point */ @@ -531,6 +545,9 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); + + /* Update AEN queue. */ + qla2x00_enqueue_aen(ha, MBA_PORT_UPDATE, NULL); break; case MBA_RSCN_UPDATE: /* State Change Registration */ @@ -567,6 +584,9 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); set_bit(RSCN_UPDATE, &ha->dpc_flags); + + /* Update AEN queue. */ + qla2x00_enqueue_aen(ha, MBA_RSCN_UPDATE, &mb[0]); break; /* case MBA_RIO_RESPONSE: */ @@ -1432,8 +1452,8 @@ qla24xx_ms_entry(scsi_qla_host_t *ha, struct ct_entry_24xx *pkt) DEBUG3(printk("%s(%ld): pkt=%p pkthandle=%d.\n", __func__, ha->host_no, pkt, pkt->handle)); - DEBUG9(printk("%s: ct pkt dump:\n", __func__)); - DEBUG9(qla2x00_dump_buffer((void *)pkt, sizeof(struct ct_entry_24xx))); + DEBUG9(printk("%s: ct pkt dump:\n", __func__);) + DEBUG9(qla2x00_dump_buffer((void *)pkt, sizeof(struct ct_entry_24xx));) /* Validate handle. */ if (pkt->handle < MAX_OUTSTANDING_COMMANDS) diff --git a/trunk/drivers/scsi/qla2xxx/qla_mbx.c b/trunk/drivers/scsi/qla2xxx/qla_mbx.c index 879f281e2ea2..d6cb3bd1a29a 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_mbx.c +++ b/trunk/drivers/scsi/qla2xxx/qla_mbx.c @@ -13,13 +13,13 @@ qla2x00_mbx_sem_timeout(unsigned long data) { struct semaphore *sem_ptr = (struct semaphore *)data; - DEBUG11(printk("qla2x00_sem_timeout: entered.\n")); + DEBUG11(printk("qla2x00_sem_timeout: entered.\n");) if (sem_ptr != NULL) { up(sem_ptr); } - DEBUG11(printk("qla2x00_mbx_sem_timeout: exiting.\n")); + DEBUG11(printk("qla2x00_mbx_sem_timeout: exiting.\n");) } /* @@ -61,7 +61,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) rval = QLA_SUCCESS; abort_active = test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags); - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) /* * Wait for active mailbox commands to finish by waiting at most tov @@ -72,7 +72,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) if (qla2x00_down_timeout(&ha->mbx_cmd_sem, mcp->tov * HZ)) { /* Timeout occurred. Return error. */ DEBUG2_3_11(printk("%s(%ld): cmd access timeout. " - "Exiting.\n", __func__, ha->host_no)); + "Exiting.\n", __func__, ha->host_no);) return QLA_FUNCTION_TIMEOUT; } } @@ -86,7 +86,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags); DEBUG11(printk("scsi(%ld): prepare to issue mbox cmd=0x%x.\n", - ha->host_no, mcp->mb[0])); + ha->host_no, mcp->mb[0]);) spin_lock_irqsave(&ha->hardware_lock, flags); @@ -131,14 +131,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) /* Unlock mbx registers and wait for interrupt */ DEBUG11(printk("%s(%ld): going to unlock irq & waiting for interrupt. " - "jiffies=%lx.\n", __func__, ha->host_no, jiffies)); + "jiffies=%lx.\n", __func__, ha->host_no, jiffies);) /* Wait for mbx cmd completion until timeout */ if (!abort_active && io_lock_on) { /* sleep on completion semaphore */ DEBUG11(printk("%s(%ld): INTERRUPT MODE. Initializing timer.\n", - __func__, ha->host_no)); + __func__, ha->host_no);) init_timer(&tmp_intr_timer); tmp_intr_timer.data = (unsigned long)&ha->mbx_intr_sem; @@ -147,11 +147,11 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) (void (*)(unsigned long))qla2x00_mbx_sem_timeout; DEBUG11(printk("%s(%ld): Adding timer.\n", __func__, - ha->host_no)); + ha->host_no);) add_timer(&tmp_intr_timer); DEBUG11(printk("%s(%ld): going to unlock & sleep. " - "time=0x%lx.\n", __func__, ha->host_no, jiffies)); + "time=0x%lx.\n", __func__, ha->host_no, jiffies);) set_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); @@ -170,14 +170,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) down(&ha->mbx_intr_sem); DEBUG11(printk("%s(%ld): waking up. time=0x%lx\n", __func__, - ha->host_no, jiffies)); + ha->host_no, jiffies);) clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); /* delete the timer */ del_timer(&tmp_intr_timer); } else { DEBUG3_11(printk("%s(%ld): cmd=%x POLLING MODE.\n", __func__, - ha->host_no, command)); + ha->host_no, command);) if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) WRT_REG_DWORD(®->isp24.hccr, HCCRX_SET_HOST_INT); @@ -209,7 +209,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) uint16_t *iptr2; DEBUG3_11(printk("%s(%ld): cmd %x completed.\n", __func__, - ha->host_no, command)); + ha->host_no, command);) /* Got interrupt. Clear the flag. */ ha->flags.mbox_int = 0; @@ -266,7 +266,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) if (!abort_active) { DEBUG11(printk("%s(%ld): checking for additional resp " - "interrupt.\n", __func__, ha->host_no)); + "interrupt.\n", __func__, ha->host_no);) /* polling mode for non isp_abort commands. */ qla2x00_poll(ha); @@ -277,9 +277,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) if (!io_lock_on || (mcp->flags & IOCTL_CMD)) { /* not in dpc. schedule it for dpc to take over. */ DEBUG(printk("%s(%ld): timeout schedule " - "isp_abort_needed.\n", __func__, ha->host_no)); + "isp_abort_needed.\n", __func__, ha->host_no);) DEBUG2_3_11(printk("%s(%ld): timeout schedule " - "isp_abort_needed.\n", __func__, ha->host_no)); + "isp_abort_needed.\n", __func__, ha->host_no);) qla_printk(KERN_WARNING, ha, "Mailbox command timeout occured. Scheduling ISP " "abort.\n"); @@ -288,9 +288,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) } else if (!abort_active) { /* call abort directly since we are in the DPC thread */ DEBUG(printk("%s(%ld): timeout calling abort_isp\n", - __func__, ha->host_no)); + __func__, ha->host_no);) DEBUG2_3_11(printk("%s(%ld): timeout calling " - "abort_isp\n", __func__, ha->host_no)); + "abort_isp\n", __func__, ha->host_no);) qla_printk(KERN_WARNING, ha, "Mailbox command timeout occured. Issuing ISP " "abort.\n"); @@ -303,9 +303,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) } clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags); DEBUG(printk("%s(%ld): finished abort_isp\n", __func__, - ha->host_no)); + ha->host_no);) DEBUG2_3_11(printk("%s(%ld): finished abort_isp\n", - __func__, ha->host_no)); + __func__, ha->host_no);) } } @@ -316,9 +316,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp) if (rval) { DEBUG2_3_11(printk("%s(%ld): **** FAILED. mbx0=%x, mbx1=%x, " "mbx2=%x, cmd=%x ****\n", __func__, ha->host_no, - mcp->mb[0], mcp->mb[1], mcp->mb[2], command)); + mcp->mb[0], mcp->mb[1], mcp->mb[2], command);) } else { - DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);) } return rval; @@ -394,7 +394,7 @@ qla2x00_execute_fw(scsi_qla_host_t *ha, uint32_t risc_addr) mbx_cmd_t mc; mbx_cmd_t *mcp = &mc; - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) mcp->mb[0] = MBC_EXECUTE_FIRMWARE; mcp->out_mb = MBX_0; @@ -424,10 +424,10 @@ qla2x00_execute_fw(scsi_qla_host_t *ha, uint32_t risc_addr) } else { if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { DEBUG11(printk("%s(%ld): done exchanges=%x.\n", - __func__, ha->host_no, mcp->mb[1])); + __func__, ha->host_no, mcp->mb[1]);) } else { DEBUG11(printk("%s(%ld): done.\n", __func__, - ha->host_no)); + ha->host_no);) } } @@ -611,7 +611,7 @@ qla2x00_mbx_reg_test(scsi_qla_host_t *ha) mbx_cmd_t mc; mbx_cmd_t *mcp = &mc; - DEBUG11(printk("qla2x00_mbx_reg_test(%ld): entered.\n", ha->host_no)); + DEBUG11(printk("qla2x00_mbx_reg_test(%ld): entered.\n", ha->host_no);) mcp->mb[0] = MBC_MAILBOX_REGISTER_TEST; mcp->mb[1] = 0xAAAA; @@ -639,11 +639,11 @@ qla2x00_mbx_reg_test(scsi_qla_host_t *ha) if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_mbx_reg_test(%ld): failed=%x.\n", - ha->host_no, rval)); + ha->host_no, rval);) } else { /*EMPTY*/ DEBUG11(printk("qla2x00_mbx_reg_test(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -671,7 +671,7 @@ qla2x00_verify_checksum(scsi_qla_host_t *ha, uint32_t risc_addr) mbx_cmd_t mc; mbx_cmd_t *mcp = &mc; - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) mcp->mb[0] = MBC_VERIFY_CHECKSUM; mcp->out_mb = MBX_0; @@ -694,9 +694,9 @@ qla2x00_verify_checksum(scsi_qla_host_t *ha, uint32_t risc_addr) if (rval != QLA_SUCCESS) { DEBUG2_3_11(printk("%s(%ld): failed=%x chk sum=%x.\n", __func__, ha->host_no, rval, (IS_QLA24XX(ha) || IS_QLA54XX(ha) ? - (mcp->mb[2] << 16) | mcp->mb[1]: mcp->mb[1]))); + (mcp->mb[2] << 16) | mcp->mb[1]: mcp->mb[1]));) } else { - DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);) } return rval; @@ -743,9 +743,9 @@ qla2x00_issue_iocb(scsi_qla_host_t *ha, void* buffer, dma_addr_t phys_addr, if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG(printk("qla2x00_issue_iocb(%ld): failed rval 0x%x\n", - ha->host_no, rval)); + ha->host_no, rval);) DEBUG2(printk("qla2x00_issue_iocb(%ld): failed rval 0x%x\n", - ha->host_no, rval)); + ha->host_no, rval);) } else { sts_entry_t *sts_entry = (sts_entry_t *) buffer; @@ -781,7 +781,7 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp) mbx_cmd_t mc; mbx_cmd_t *mcp = &mc; - DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no)); + DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);) fcport = sp->fcport; @@ -813,11 +813,11 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp) if (rval != QLA_SUCCESS) { DEBUG2_3_11(printk("qla2x00_abort_command(%ld): failed=%x.\n", - ha->host_no, rval)); + ha->host_no, rval);) } else { sp->flags |= SRB_ABORT_PENDING; DEBUG11(printk("qla2x00_abort_command(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -848,7 +848,7 @@ qla2x00_abort_target(fc_port_t *fcport) if (fcport == NULL) return 0; - DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->ha->host_no);) ha = fcport->ha; mcp->mb[0] = MBC_ABORT_TARGET; @@ -872,11 +872,11 @@ qla2x00_abort_target(fc_port_t *fcport) if (rval != QLA_SUCCESS) { DEBUG2_3_11(printk("qla2x00_abort_target(%ld): failed=%x.\n", - ha->host_no, rval)); + ha->host_no, rval);) } else { /*EMPTY*/ DEBUG11(printk("qla2x00_abort_target(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -912,7 +912,7 @@ qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa, mbx_cmd_t *mcp = &mc; DEBUG11(printk("qla2x00_get_adapter_id(%ld): entered.\n", - ha->host_no)); + ha->host_no);) mcp->mb[0] = MBC_GET_ADAPTER_LOOP_ID; mcp->out_mb = MBX_0; @@ -933,11 +933,11 @@ qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa, if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_get_adapter_id(%ld): failed=%x.\n", - ha->host_no, rval)); + ha->host_no, rval);) } else { /*EMPTY*/ DEBUG11(printk("qla2x00_get_adapter_id(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -968,7 +968,7 @@ qla2x00_get_retry_cnt(scsi_qla_host_t *ha, uint8_t *retry_cnt, uint8_t *tov, mbx_cmd_t *mcp = &mc; DEBUG11(printk("qla2x00_get_retry_cnt(%ld): entered.\n", - ha->host_no)); + ha->host_no);) mcp->mb[0] = MBC_GET_RETRY_COUNT; mcp->out_mb = MBX_0; @@ -980,7 +980,7 @@ qla2x00_get_retry_cnt(scsi_qla_host_t *ha, uint8_t *retry_cnt, uint8_t *tov, if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_get_retry_cnt(%ld): failed = %x.\n", - ha->host_no, mcp->mb[0])); + ha->host_no, mcp->mb[0]);) } else { /* Convert returned data and check our values. */ *r_a_tov = mcp->mb[3] / 2; @@ -992,7 +992,7 @@ qla2x00_get_retry_cnt(scsi_qla_host_t *ha, uint8_t *retry_cnt, uint8_t *tov, } DEBUG11(printk("qla2x00_get_retry_cnt(%ld): done. mb3=%d " - "ratov=%d.\n", ha->host_no, mcp->mb[3], ratov)); + "ratov=%d.\n", ha->host_no, mcp->mb[3], ratov);) } return rval; @@ -1023,7 +1023,7 @@ qla2x00_init_firmware(scsi_qla_host_t *ha, uint16_t size) mbx_cmd_t *mcp = &mc; DEBUG11(printk("qla2x00_init_firmware(%ld): entered.\n", - ha->host_no)); + ha->host_no);) mcp->mb[0] = MBC_INITIALIZE_FIRMWARE; mcp->mb[2] = MSW(ha->init_cb_dma); @@ -1043,11 +1043,11 @@ qla2x00_init_firmware(scsi_qla_host_t *ha, uint16_t size) /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_init_firmware(%ld): failed=%x " "mb0=%x.\n", - ha->host_no, rval, mcp->mb[0])); + ha->host_no, rval, mcp->mb[0]);) } else { /*EMPTY*/ DEBUG11(printk("qla2x00_init_firmware(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -1079,7 +1079,7 @@ qla2x00_get_port_database(scsi_qla_host_t *ha, fc_port_t *fcport, uint8_t opt) struct port_database_24xx *pd24; dma_addr_t pd_dma; - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) pd24 = NULL; pd = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &pd_dma); @@ -1220,7 +1220,7 @@ qla2x00_get_firmware_state(scsi_qla_host_t *ha, uint16_t *dptr) mbx_cmd_t *mcp = &mc; DEBUG11(printk("qla2x00_get_firmware_state(%ld): entered.\n", - ha->host_no)); + ha->host_no);) mcp->mb[0] = MBC_GET_FIRMWARE_STATE; mcp->out_mb = MBX_0; @@ -1235,11 +1235,11 @@ qla2x00_get_firmware_state(scsi_qla_host_t *ha, uint16_t *dptr) if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_get_firmware_state(%ld): " - "failed=%x.\n", ha->host_no, rval)); + "failed=%x.\n", ha->host_no, rval);) } else { /*EMPTY*/ DEBUG11(printk("qla2x00_get_firmware_state(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -1272,7 +1272,7 @@ qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t *name, mbx_cmd_t *mcp = &mc; DEBUG11(printk("qla2x00_get_port_name(%ld): entered.\n", - ha->host_no)); + ha->host_no);) mcp->mb[0] = MBC_GET_PORT_NAME; mcp->out_mb = MBX_1|MBX_0; @@ -1292,7 +1292,7 @@ qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t *name, if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_get_port_name(%ld): failed=%x.\n", - ha->host_no, rval)); + ha->host_no, rval);) } else { if (name != NULL) { /* This function returns name in big endian. */ @@ -1307,7 +1307,7 @@ qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t *name, } DEBUG11(printk("qla2x00_get_port_name(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -1335,7 +1335,7 @@ qla2x00_lip_reset(scsi_qla_host_t *ha) mbx_cmd_t mc; mbx_cmd_t *mcp = &mc; - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { mcp->mb[0] = MBC_LIP_FULL_LOGIN; @@ -1364,10 +1364,10 @@ qla2x00_lip_reset(scsi_qla_host_t *ha) if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", - __func__, ha->host_no, rval)); + __func__, ha->host_no, rval);) } else { /*EMPTY*/ - DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);) } return rval; @@ -1400,10 +1400,10 @@ qla2x00_send_sns(scsi_qla_host_t *ha, dma_addr_t sns_phys_address, mbx_cmd_t *mcp = &mc; DEBUG11(printk("qla2x00_send_sns(%ld): entered.\n", - ha->host_no)); + ha->host_no);) DEBUG11(printk("qla2x00_send_sns: retry cnt=%d ratov=%d total " - "tov=%d.\n", ha->retry_count, ha->login_timeout, mcp->tov)); + "tov=%d.\n", ha->retry_count, ha->login_timeout, mcp->tov);) mcp->mb[0] = MBC_SEND_SNS_COMMAND; mcp->mb[1] = cmd_size; @@ -1421,12 +1421,12 @@ qla2x00_send_sns(scsi_qla_host_t *ha, dma_addr_t sns_phys_address, if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG(printk("qla2x00_send_sns(%ld): failed=%x mb[0]=%x " - "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1])); + "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1]);) DEBUG2_3_11(printk("qla2x00_send_sns(%ld): failed=%x mb[0]=%x " - "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1])); + "mb[1]=%x.\n", ha->host_no, rval, mcp->mb[0], mcp->mb[1]);) } else { /*EMPTY*/ - DEBUG11(printk("qla2x00_send_sns(%ld): done.\n", ha->host_no)); + DEBUG11(printk("qla2x00_send_sns(%ld): done.\n", ha->host_no);) } return rval; @@ -1442,7 +1442,7 @@ qla24xx_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, dma_addr_t lg_dma; uint32_t iop[2]; - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) lg = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &lg_dma); if (lg == NULL) { @@ -1458,15 +1458,13 @@ qla24xx_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, lg->control_flags = __constant_cpu_to_le16(LCF_COMMAND_PLOGI); if (opt & BIT_0) lg->control_flags |= __constant_cpu_to_le16(LCF_COND_PLOGI); - if (opt & BIT_1) - lg->control_flags |= __constant_cpu_to_le16(LCF_SKIP_PRLI); lg->port_id[0] = al_pa; lg->port_id[1] = area; lg->port_id[2] = domain; rval = qla2x00_issue_iocb(ha, lg, lg_dma, 0); if (rval != QLA_SUCCESS) { DEBUG2_3_11(printk("%s(%ld): failed to issue Login IOCB " - "(%x).\n", __func__, ha->host_no, rval)); + "(%x).\n", __func__, ha->host_no, rval);) } else if (lg->entry_status != 0) { DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB " "-- error status (%x).\n", __func__, ha->host_no, @@ -1507,7 +1505,7 @@ qla24xx_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, break; } } else { - DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);) iop[0] = le32_to_cpu(lg->io_parameter[0]); @@ -1561,7 +1559,7 @@ qla2x00_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, mbx_cmd_t mc; mbx_cmd_t *mcp = &mc; - DEBUG11(printk("qla2x00_login_fabric(%ld): entered.\n", ha->host_no)); + DEBUG11(printk("qla2x00_login_fabric(%ld): entered.\n", ha->host_no);) mcp->mb[0] = MBC_LOGIN_FABRIC_PORT; mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; @@ -1606,11 +1604,11 @@ qla2x00_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_login_fabric(%ld): failed=%x " "mb[0]=%x mb[1]=%x mb[2]=%x.\n", ha->host_no, rval, - mcp->mb[0], mcp->mb[1], mcp->mb[2])); + mcp->mb[0], mcp->mb[1], mcp->mb[2]);) } else { /*EMPTY*/ DEBUG11(printk("qla2x00_login_fabric(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -1645,7 +1643,7 @@ qla2x00_login_local_device(scsi_qla_host_t *ha, fc_port_t *fcport, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, mb_ret, opt); - DEBUG3(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG3(printk("%s(%ld): entered.\n", __func__, ha->host_no);) mcp->mb[0] = MBC_LOGIN_LOOP_PORT; if (HAS_EXTENDED_IDS(ha)) @@ -1679,13 +1677,13 @@ qla2x00_login_local_device(scsi_qla_host_t *ha, fc_port_t *fcport, DEBUG(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x " "mb[6]=%x mb[7]=%x.\n", __func__, ha->host_no, rval, - mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7])); + mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7]);) DEBUG2_3(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x " "mb[6]=%x mb[7]=%x.\n", __func__, ha->host_no, rval, - mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7])); + mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7]);) } else { /*EMPTY*/ - DEBUG3(printk("%s(%ld): done.\n", __func__, ha->host_no)); + DEBUG3(printk("%s(%ld): done.\n", __func__, ha->host_no);) } return (rval); @@ -1699,7 +1697,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, struct logio_entry_24xx *lg; dma_addr_t lg_dma; - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) lg = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &lg_dma); if (lg == NULL) { @@ -1720,7 +1718,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, rval = qla2x00_issue_iocb(ha, lg, lg_dma, 0); if (rval != QLA_SUCCESS) { DEBUG2_3_11(printk("%s(%ld): failed to issue Logout IOCB " - "(%x).\n", __func__, ha->host_no, rval)); + "(%x).\n", __func__, ha->host_no, rval);) } else if (lg->entry_status != 0) { DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB " "-- error status (%x).\n", __func__, ha->host_no, @@ -1731,10 +1729,10 @@ qla24xx_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, "-- completion status (%x) ioparam=%x/%x.\n", __func__, ha->host_no, le16_to_cpu(lg->comp_status), le32_to_cpu(lg->io_parameter[0]), - le32_to_cpu(lg->io_parameter[1]))); + le32_to_cpu(lg->io_parameter[1]));) } else { /*EMPTY*/ - DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);) } dma_pool_free(ha->s_dma_pool, lg, lg_dma); @@ -1767,7 +1765,7 @@ qla2x00_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, mbx_cmd_t *mcp = &mc; DEBUG11(printk("qla2x00_fabric_logout(%ld): entered.\n", - ha->host_no)); + ha->host_no);) mcp->mb[0] = MBC_LOGOUT_FABRIC_PORT; mcp->out_mb = MBX_1|MBX_0; @@ -1787,11 +1785,11 @@ qla2x00_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_fabric_logout(%ld): failed=%x " - "mbx1=%x.\n", ha->host_no, rval, mcp->mb[1])); + "mbx1=%x.\n", ha->host_no, rval, mcp->mb[1]);) } else { /*EMPTY*/ DEBUG11(printk("qla2x00_fabric_logout(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -1820,7 +1818,7 @@ qla2x00_full_login_lip(scsi_qla_host_t *ha) mbx_cmd_t *mcp = &mc; DEBUG11(printk("qla2x00_full_login_lip(%ld): entered.\n", - ha->host_no)); + ha->host_no);) mcp->mb[0] = MBC_LIP_FULL_LOGIN; mcp->mb[1] = 0; @@ -1835,11 +1833,11 @@ qla2x00_full_login_lip(scsi_qla_host_t *ha) if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_full_login_lip(%ld): failed=%x.\n", - ha->host_no, rval)); + ha->host_no, rval);) } else { /*EMPTY*/ DEBUG11(printk("qla2x00_full_login_lip(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -1866,7 +1864,7 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma, mbx_cmd_t *mcp = &mc; DEBUG11(printk("qla2x00_get_id_list(%ld): entered.\n", - ha->host_no)); + ha->host_no);) if (id_list == NULL) return QLA_FUNCTION_FAILED; @@ -1895,11 +1893,11 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma, if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("qla2x00_get_id_list(%ld): failed=%x.\n", - ha->host_no, rval)); + ha->host_no, rval);) } else { *entries = mcp->mb[1]; DEBUG11(printk("qla2x00_get_id_list(%ld): done.\n", - ha->host_no)); + ha->host_no);) } return rval; @@ -1938,7 +1936,7 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, if (rval != QLA_SUCCESS) { /*EMPTY*/ DEBUG2_3_11(printk("%s(%ld): failed = %x.\n", __func__, - ha->host_no, mcp->mb[0])); + ha->host_no, mcp->mb[0]);) } else { DEBUG11(printk("%s(%ld): done. mb1=%x mb2=%x mb3=%x mb6=%x " "mb7=%x mb10=%x.\n", __func__, ha->host_no, @@ -2047,7 +2045,7 @@ qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id, link_stat_t *stat_buf; dma_addr_t stat_buf_dma; - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) stat_buf = dma_pool_alloc(ha->s_dma_pool, GFP_ATOMIC, &stat_buf_dma); if (stat_buf == NULL) { @@ -2085,7 +2083,7 @@ qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id, if (rval == QLA_SUCCESS) { if (mcp->mb[0] != MBS_COMMAND_COMPLETE) { DEBUG2_3_11(printk("%s(%ld): cmd failed. mbx0=%x.\n", - __func__, ha->host_no, mcp->mb[0])); + __func__, ha->host_no, mcp->mb[0]);) status[0] = mcp->mb[0]; rval = BIT_1; } else { @@ -2110,12 +2108,12 @@ qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id, stat_buf->loss_sync_cnt, stat_buf->loss_sig_cnt, stat_buf->prim_seq_err_cnt, stat_buf->inval_xmit_word_cnt, - stat_buf->inval_crc_cnt)); + stat_buf->inval_crc_cnt);) } } else { /* Failed. */ DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__, - ha->host_no, rval)); + ha->host_no, rval);) rval = BIT_1; } @@ -2134,7 +2132,7 @@ qla24xx_get_isp_stats(scsi_qla_host_t *ha, uint32_t *dwbuf, uint32_t dwords, uint32_t *sbuf, *siter; dma_addr_t sbuf_dma; - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) if (dwords > (DMA_POOL_SIZE / 4)) { DEBUG2_3_11(printk("%s(%ld): Unabled to retrieve %d DWORDs " @@ -2198,7 +2196,7 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp) dma_addr_t abt_dma; uint32_t handle; - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) fcport = sp->fcport; @@ -2231,7 +2229,7 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp) rval = qla2x00_issue_iocb(ha, abt, abt_dma, 0); if (rval != QLA_SUCCESS) { DEBUG2_3_11(printk("%s(%ld): failed to issue IOCB (%x).\n", - __func__, ha->host_no, rval)); + __func__, ha->host_no, rval);) } else if (abt->entry_status != 0) { DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB " "-- error status (%x).\n", __func__, ha->host_no, @@ -2240,10 +2238,10 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp) } else if (abt->nport_handle != __constant_cpu_to_le16(0)) { DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB " "-- completion status (%x).\n", __func__, ha->host_no, - le16_to_cpu(abt->nport_handle))); + le16_to_cpu(abt->nport_handle));) rval = QLA_FUNCTION_FAILED; } else { - DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);) sp->flags |= SRB_ABORT_PENDING; } @@ -2270,7 +2268,7 @@ qla24xx_abort_target(fc_port_t *fcport) if (fcport == NULL) return 0; - DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->ha->host_no)); + DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->ha->host_no);) ha = fcport->ha; tsk = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &tsk_dma); @@ -2292,7 +2290,7 @@ qla24xx_abort_target(fc_port_t *fcport) rval = qla2x00_issue_iocb(ha, tsk, tsk_dma, 0); if (rval != QLA_SUCCESS) { DEBUG2_3_11(printk("%s(%ld): failed to issue Target Reset IOCB " - "(%x).\n", __func__, ha->host_no, rval)); + "(%x).\n", __func__, ha->host_no, rval);) goto atarget_done; } else if (tsk->p.sts.entry_status != 0) { DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB " @@ -2304,7 +2302,7 @@ qla24xx_abort_target(fc_port_t *fcport) __constant_cpu_to_le16(CS_COMPLETE)) { DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB " "-- completion status (%x).\n", __func__, - ha->host_no, le16_to_cpu(tsk->p.sts.comp_status))); + ha->host_no, le16_to_cpu(tsk->p.sts.comp_status));) rval = QLA_FUNCTION_FAILED; goto atarget_done; } @@ -2313,9 +2311,9 @@ qla24xx_abort_target(fc_port_t *fcport) rval = qla2x00_marker(ha, fcport->loop_id, 0, MK_SYNC_ID); if (rval != QLA_SUCCESS) { DEBUG2_3_11(printk("%s(%ld): failed to issue Marker IOCB " - "(%x).\n", __func__, ha->host_no, rval)); + "(%x).\n", __func__, ha->host_no, rval);) } else { - DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); + DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no);) } atarget_done: @@ -2462,81 +2460,3 @@ qla2x00_stop_firmware(scsi_qla_host_t *ha) return rval; } - -int -qla2x00_trace_control(scsi_qla_host_t *ha, uint16_t ctrl, dma_addr_t eft_dma, - uint16_t buffers) -{ - int rval; - mbx_cmd_t mc; - mbx_cmd_t *mcp = &mc; - - if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) - return QLA_FUNCTION_FAILED; - - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); - - mcp->mb[0] = MBC_TRACE_CONTROL; - mcp->mb[1] = ctrl; - mcp->out_mb = MBX_1|MBX_0; - mcp->in_mb = MBX_1|MBX_0; - if (ctrl == TC_ENABLE) { - mcp->mb[2] = LSW(eft_dma); - mcp->mb[3] = MSW(eft_dma); - mcp->mb[4] = LSW(MSD(eft_dma)); - mcp->mb[5] = MSW(MSD(eft_dma)); - mcp->mb[6] = buffers; - mcp->mb[7] = buffers; - mcp->out_mb |= MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2; - } - mcp->tov = 30; - mcp->flags = 0; - rval = qla2x00_mailbox_command(ha, mcp); - - if (rval != QLA_SUCCESS) { - DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x.\n", - __func__, ha->host_no, rval, mcp->mb[0], mcp->mb[1])); - } else { - DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); - } - - return rval; -} - -int -qla2x00_read_sfp(scsi_qla_host_t *ha, dma_addr_t sfp_dma, uint16_t addr, - uint16_t off, uint16_t count) -{ - int rval; - mbx_cmd_t mc; - mbx_cmd_t *mcp = &mc; - - if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) - return QLA_FUNCTION_FAILED; - - DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); - - mcp->mb[0] = MBC_READ_SFP; - mcp->mb[1] = addr; - mcp->mb[2] = MSW(sfp_dma); - mcp->mb[3] = LSW(sfp_dma); - mcp->mb[6] = MSW(MSD(sfp_dma)); - mcp->mb[7] = LSW(MSD(sfp_dma)); - mcp->mb[8] = count; - mcp->mb[9] = off; - mcp->mb[10] = 0; - mcp->out_mb = MBX_10|MBX_9|MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; - mcp->in_mb = MBX_0; - mcp->tov = 30; - mcp->flags = 0; - rval = qla2x00_mailbox_command(ha, mcp); - - if (rval != QLA_SUCCESS) { - DEBUG2_3_11(printk("%s(%ld): failed=%x (%x).\n", __func__, - ha->host_no, rval, mcp->mb[0])); - } else { - DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); - } - - return rval; -} diff --git a/trunk/drivers/scsi/qla2xxx/qla_os.c b/trunk/drivers/scsi/qla2xxx/qla_os.c index ec7ebb6037e6..ccaad0b08d35 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_os.c +++ b/trunk/drivers/scsi/qla2xxx/qla_os.c @@ -39,14 +39,14 @@ MODULE_PARM_DESC(ql2xlogintimeout, int qlport_down_retry = 30; module_param(qlport_down_retry, int, S_IRUGO|S_IRUSR); MODULE_PARM_DESC(qlport_down_retry, - "Maximum number of command retries to a port that returns " + "Maximum number of command retries to a port that returns" "a PORT-DOWN status."); int ql2xplogiabsentdevice; module_param(ql2xplogiabsentdevice, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(ql2xplogiabsentdevice, "Option to enable PLOGI to devices that are not present after " - "a Fabric scan. This is needed for several broken switches. " + "a Fabric scan. This is needed for several broken switches." "Default is 0 - no PLOGI. 1 - perfom PLOGI."); int ql2xloginretrycount = 0; @@ -54,19 +54,6 @@ module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR); MODULE_PARM_DESC(ql2xloginretrycount, "Specify an alternate value for the NVRAM login retry count."); -int ql2xallocfwdump = 1; -module_param(ql2xallocfwdump, int, S_IRUGO|S_IRUSR); -MODULE_PARM_DESC(ql2xallocfwdump, - "Option to enable allocation of memory for a firmware dump " - "during HBA initialization. Memory allocation requirements " - "vary by ISP type. Default is 1 - allocate memory."); - -int extended_error_logging; -module_param(extended_error_logging, int, S_IRUGO|S_IRUSR); -MODULE_PARM_DESC(extended_error_logging, - "Option to enable extended error logging, " - "Default is 0 - no logging. 1 - log errors."); - static void qla2x00_free_device(scsi_qla_host_t *); static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha); @@ -637,7 +624,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) DEBUG2(printk("%s(%ld): aborting sp %p from RISC. pid=%ld.\n", __func__, ha->host_no, sp, serial)); - DEBUG3(qla2x00_print_scsi_cmd(cmd)); + DEBUG3(qla2x00_print_scsi_cmd(cmd);) spin_unlock_irqrestore(&ha->hardware_lock, flags); if (ha->isp_ops.abort_command(ha, sp)) { @@ -779,7 +766,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) #endif } else { DEBUG2(printk(KERN_INFO - "%s failed: loop not ready\n",__func__)); + "%s failed: loop not ready\n",__func__);) } if (ret == FAILED) { @@ -1034,12 +1021,12 @@ qla2x00_loop_reset(scsi_qla_host_t *ha) /* Empty */ DEBUG2_3(printk("%s(%ld): **** FAILED ****\n", __func__, - ha->host_no)); + ha->host_no);) } else { /* Empty */ DEBUG3(printk("%s(%ld): exiting normally.\n", __func__, - ha->host_no)); + ha->host_no);) } return(status); @@ -1337,8 +1324,7 @@ qla24xx_disable_intrs(scsi_qla_host_t *ha) /* * PCI driver interface */ -static int __devinit -qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) +static int qla2x00_probe_one(struct pci_dev *pdev) { int ret = -ENODEV; device_reg_t __iomem *reg; @@ -1419,6 +1405,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->isp_ops.read_nvram = qla2x00_read_nvram_data; ha->isp_ops.write_nvram = qla2x00_write_nvram_data; ha->isp_ops.fw_dump = qla2100_fw_dump; + ha->isp_ops.ascii_fw_dump = qla2100_ascii_fw_dump; ha->isp_ops.read_optrom = qla2x00_read_optrom_data; ha->isp_ops.write_optrom = qla2x00_write_optrom_data; if (IS_QLA2100(ha)) { @@ -1445,6 +1432,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->isp_ops.pci_config = qla2300_pci_config; ha->isp_ops.intr_handler = qla2300_intr_handler; ha->isp_ops.fw_dump = qla2300_fw_dump; + ha->isp_ops.ascii_fw_dump = qla2300_ascii_fw_dump; ha->isp_ops.beacon_on = qla2x00_beacon_on; ha->isp_ops.beacon_off = qla2x00_beacon_off; ha->isp_ops.beacon_blink = qla2x00_beacon_blink; @@ -1481,6 +1469,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->isp_ops.read_nvram = qla24xx_read_nvram_data; ha->isp_ops.write_nvram = qla24xx_write_nvram_data; ha->isp_ops.fw_dump = qla24xx_fw_dump; + ha->isp_ops.ascii_fw_dump = qla24xx_ascii_fw_dump; ha->isp_ops.read_optrom = qla24xx_read_optrom_data; ha->isp_ops.write_optrom = qla24xx_write_optrom_data; ha->isp_ops.beacon_on = qla24xx_beacon_on; @@ -1552,7 +1541,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) host->transportt = qla2xxx_transport_template; ret = request_irq(pdev->irq, ha->isp_ops.intr_handler, - IRQF_DISABLED|IRQF_SHARED, QLA2XXX_DRIVER_NAME, ha); + SA_INTERRUPT|SA_SHIRQ, QLA2XXX_DRIVER_NAME, ha); if (ret) { qla_printk(KERN_WARNING, ha, "Failed to reserve interrupt %d already in use.\n", @@ -1651,8 +1640,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) return ret; } -static void __devexit -qla2x00_remove_one(struct pci_dev *pdev) +static void qla2x00_remove_one(struct pci_dev *pdev) { scsi_qla_host_t *ha; @@ -1690,9 +1678,6 @@ qla2x00_free_device(scsi_qla_host_t *ha) kthread_stop(t); } - if (ha->eft) - qla2x00_trace_control(ha, TC_DISABLE, 0, 0); - /* Stop currently executing firmware. */ qla2x00_stop_firmware(ha); @@ -1914,6 +1899,17 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) } memset(ha->init_cb, 0, ha->init_cb_size); + /* Allocate ioctl related memory. */ + if (qla2x00_alloc_ioctl_mem(ha)) { + qla_printk(KERN_WARNING, ha, + "Memory Allocation failed - ioctl_mem\n"); + + qla2x00_mem_free(ha); + msleep(100); + + continue; + } + if (qla2x00_allocate_sp_pool(ha)) { qla_printk(KERN_WARNING, ha, "Memory Allocation failed - " @@ -1976,26 +1972,6 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) continue; } memset(ha->ct_sns, 0, sizeof(struct ct_sns_pkt)); - - if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { - /* - * Get consistent memory allocated for SFP - * block. - */ - ha->sfp_data = dma_pool_alloc(ha->s_dma_pool, - GFP_KERNEL, &ha->sfp_data_dma); - if (ha->sfp_data == NULL) { - qla_printk(KERN_WARNING, ha, - "Memory Allocation failed - " - "sfp_data\n"); - - qla2x00_mem_free(ha); - msleep(100); - - continue; - } - memset(ha->sfp_data, 0, SFP_BLOCK_SIZE); - } } /* Done all allocations without any error. */ @@ -2030,16 +2006,12 @@ qla2x00_mem_free(scsi_qla_host_t *ha) return; } + /* free ioctl memory */ + qla2x00_free_ioctl_mem(ha); + /* free sp pool */ qla2x00_free_sp_pool(ha); - if (ha->fw_dump) { - if (ha->eft) - dma_free_coherent(&ha->pdev->dev, - ntohl(ha->fw_dump->eft_size), ha->eft, ha->eft_dma); - vfree(ha->fw_dump); - } - if (ha->sns_cmd) dma_free_coherent(&ha->pdev->dev, sizeof(struct sns_cmd_pkt), ha->sns_cmd, ha->sns_cmd_dma); @@ -2048,9 +2020,6 @@ qla2x00_mem_free(scsi_qla_host_t *ha) dma_free_coherent(&ha->pdev->dev, sizeof(struct ct_sns_pkt), ha->ct_sns, ha->ct_sns_dma); - if (ha->sfp_data) - dma_pool_free(ha->s_dma_pool, ha->sfp_data, ha->sfp_data_dma); - if (ha->ms_iocb) dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma); @@ -2074,8 +2043,6 @@ qla2x00_mem_free(scsi_qla_host_t *ha) (ha->request_q_length + 1) * sizeof(request_t), ha->request_ring, ha->request_dma); - ha->eft = NULL; - ha->eft_dma = 0; ha->sns_cmd = NULL; ha->sns_cmd_dma = 0; ha->ct_sns = NULL; @@ -2104,9 +2071,13 @@ qla2x00_mem_free(scsi_qla_host_t *ha) } INIT_LIST_HEAD(&ha->fcports); + vfree(ha->fw_dump); + vfree(ha->fw_dump_buffer); + ha->fw_dump = NULL; ha->fw_dumped = 0; ha->fw_dump_reading = 0; + ha->fw_dump_buffer = NULL; vfree(ha->optrom_buffer); } @@ -2646,16 +2617,40 @@ static struct pci_device_id qla2xxx_pci_tbl[] = { }; MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl); +static int __devinit +qla2xxx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) +{ + return qla2x00_probe_one(pdev); +} + +static void __devexit +qla2xxx_remove_one(struct pci_dev *pdev) +{ + qla2x00_remove_one(pdev); +} + static struct pci_driver qla2xxx_pci_driver = { .name = QLA2XXX_DRIVER_NAME, .driver = { .owner = THIS_MODULE, }, .id_table = qla2xxx_pci_tbl, - .probe = qla2x00_probe_one, - .remove = __devexit_p(qla2x00_remove_one), + .probe = qla2xxx_probe_one, + .remove = __devexit_p(qla2xxx_remove_one), }; +static inline int +qla2x00_pci_module_init(void) +{ + return pci_module_init(&qla2xxx_pci_driver); +} + +static inline void +qla2x00_pci_module_exit(void) +{ + pci_unregister_driver(&qla2xxx_pci_driver); +} + /** * qla2x00_module_init - Module initialization. **/ @@ -2675,16 +2670,16 @@ qla2x00_module_init(void) /* Derive version string. */ strcpy(qla2x00_version_str, QLA2XXX_VERSION); - if (extended_error_logging) - strcat(qla2x00_version_str, "-debug"); - +#if DEBUG_QLA2100 + strcat(qla2x00_version_str, "-debug"); +#endif qla2xxx_transport_template = fc_attach_transport(&qla2xxx_transport_functions); if (!qla2xxx_transport_template) return -ENODEV; printk(KERN_INFO "QLogic Fibre Channel HBA Driver\n"); - ret = pci_register_driver(&qla2xxx_pci_driver); + ret = qla2x00_pci_module_init(); if (ret) { kmem_cache_destroy(srb_cachep); fc_release_transport(qla2xxx_transport_template); @@ -2698,7 +2693,7 @@ qla2x00_module_init(void) static void __exit qla2x00_module_exit(void) { - pci_unregister_driver(&qla2xxx_pci_driver); + qla2x00_pci_module_exit(); qla2x00_release_firmware(); kmem_cache_destroy(srb_cachep); fc_release_transport(qla2xxx_transport_template); diff --git a/trunk/drivers/scsi/qla2xxx/qla_version.h b/trunk/drivers/scsi/qla2xxx/qla_version.h index d2d683440659..6b315521bd89 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_version.h +++ b/trunk/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION "8.01.05-k3" +#define QLA2XXX_VERSION "8.01.05-k2" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 1 diff --git a/trunk/drivers/scsi/qlogicpti.c b/trunk/drivers/scsi/qlogicpti.c index 69e0551a81d2..329ead263714 100644 --- a/trunk/drivers/scsi/qlogicpti.c +++ b/trunk/drivers/scsi/qlogicpti.c @@ -718,7 +718,7 @@ static int __init qpti_register_irq(struct qlogicpti *qpti) * sanely maintain. */ if (request_irq(qpti->irq, qpti_intr, - IRQF_SHARED, "Qlogic/PTI", qpti)) + SA_SHIRQ, "Qlogic/PTI", qpti)) goto fail; printk("qpti%d: IRQ %d ", qpti->qpti_id, qpti->irq); diff --git a/trunk/drivers/scsi/sata_mv.c b/trunk/drivers/scsi/sata_mv.c index 1053c7c76b7d..4a71578df3c1 100644 --- a/trunk/drivers/scsi/sata_mv.c +++ b/trunk/drivers/scsi/sata_mv.c @@ -2395,7 +2395,7 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) probe_ent->port_ops = mv_port_info[board_idx].port_ops; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->mmio_base = mmio_base; probe_ent->private_data = hpriv; diff --git a/trunk/drivers/scsi/sata_nv.c b/trunk/drivers/scsi/sata_nv.c index 56da25581f31..5cc42c6054eb 100644 --- a/trunk/drivers/scsi/sata_nv.c +++ b/trunk/drivers/scsi/sata_nv.c @@ -31,6 +31,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/scsi/sata_promise.c b/trunk/drivers/scsi/sata_promise.c index 64631bd38952..b2b6ed5216e0 100644 --- a/trunk/drivers/scsi/sata_promise.c +++ b/trunk/drivers/scsi/sata_promise.c @@ -743,7 +743,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e probe_ent->port_ops = pdc_port_info[board_idx].port_ops; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->mmio_base = mmio_base; pdc_ata_setup_port(&probe_ent->port[0], base + 0x200); diff --git a/trunk/drivers/scsi/sata_qstor.c b/trunk/drivers/scsi/sata_qstor.c index d374c1db0cf3..98ddc25655f0 100644 --- a/trunk/drivers/scsi/sata_qstor.c +++ b/trunk/drivers/scsi/sata_qstor.c @@ -680,7 +680,7 @@ static int qs_ata_init_one(struct pci_dev *pdev, probe_ent->port_ops = qs_port_info[board_idx].port_ops; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->mmio_base = mmio_base; probe_ent->n_ports = QS_PORTS; diff --git a/trunk/drivers/scsi/sata_sil.c b/trunk/drivers/scsi/sata_sil.c index 7aabb45c35e5..51d86d750e84 100644 --- a/trunk/drivers/scsi/sata_sil.c +++ b/trunk/drivers/scsi/sata_sil.c @@ -608,7 +608,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) probe_ent->mwdma_mask = sil_port_info[ent->driver_data].mwdma_mask; probe_ent->udma_mask = sil_port_info[ent->driver_data].udma_mask; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->host_flags = sil_port_info[ent->driver_data].host_flags; mmio_base = pci_iomap(pdev, 5, 0); diff --git a/trunk/drivers/scsi/sata_sil24.c b/trunk/drivers/scsi/sata_sil24.c index 07a1c6a8a414..b5f8fa955679 100644 --- a/trunk/drivers/scsi/sata_sil24.c +++ b/trunk/drivers/scsi/sata_sil24.c @@ -1041,7 +1041,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) probe_ent->n_ports = SIL24_FLAG2NPORTS(pinfo->host_flags); probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->mmio_base = port_base; probe_ent->private_data = hpriv; diff --git a/trunk/drivers/scsi/sata_sis.c b/trunk/drivers/scsi/sata_sis.c index ee6b5df41d30..809d337ed641 100644 --- a/trunk/drivers/scsi/sata_sis.c +++ b/trunk/drivers/scsi/sata_sis.c @@ -30,6 +30,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/scsi/sata_svw.c b/trunk/drivers/scsi/sata_svw.c index 7d0858095e1f..7566c2cabaf7 100644 --- a/trunk/drivers/scsi/sata_svw.c +++ b/trunk/drivers/scsi/sata_svw.c @@ -36,6 +36,7 @@ * */ +#include #include #include #include @@ -428,7 +429,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e probe_ent->port_ops = &k2_sata_ops; probe_ent->n_ports = 4; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->mmio_base = mmio_base; /* We don't care much about the PIO/UDMA masks, but the core won't like us diff --git a/trunk/drivers/scsi/sata_sx4.c b/trunk/drivers/scsi/sata_sx4.c index ccc8cad24f7d..7f864410f7c2 100644 --- a/trunk/drivers/scsi/sata_sx4.c +++ b/trunk/drivers/scsi/sata_sx4.c @@ -1436,7 +1436,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id * probe_ent->port_ops = pdc_port_info[board_idx].port_ops; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->mmio_base = mmio_base; probe_ent->private_data = hpriv; diff --git a/trunk/drivers/scsi/sata_uli.c b/trunk/drivers/scsi/sata_uli.c index 33cdb4867ef1..64f3c1aeed21 100644 --- a/trunk/drivers/scsi/sata_uli.c +++ b/trunk/drivers/scsi/sata_uli.c @@ -24,6 +24,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/scsi/sata_via.c b/trunk/drivers/scsi/sata_via.c index 03baec2191bf..501ce1791782 100644 --- a/trunk/drivers/scsi/sata_via.c +++ b/trunk/drivers/scsi/sata_via.c @@ -242,7 +242,7 @@ static struct ata_probe_ent *vt6421_init_probe_ent(struct pci_dev *pdev) probe_ent->port_ops = &svia_sata_ops; probe_ent->n_ports = N_PORTS; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->pio_mask = 0x1f; probe_ent->mwdma_mask = 0x07; probe_ent->udma_mask = 0x7f; diff --git a/trunk/drivers/scsi/sata_vsc.c b/trunk/drivers/scsi/sata_vsc.c index 916fe6fba756..616fd9634b4b 100644 --- a/trunk/drivers/scsi/sata_vsc.c +++ b/trunk/drivers/scsi/sata_vsc.c @@ -400,7 +400,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d probe_ent->port_ops = &vsc_sata_ops; probe_ent->n_ports = 4; probe_ent->irq = pdev->irq; - probe_ent->irq_flags = IRQF_SHARED; + probe_ent->irq_flags = SA_SHIRQ; probe_ent->mmio_base = mmio_base; /* We don't care much about the PIO/UDMA masks, but the core won't like us diff --git a/trunk/drivers/scsi/scsi_debug.c b/trunk/drivers/scsi/scsi_debug.c index 9c63b00773c4..5a5d2af8ee43 100644 --- a/trunk/drivers/scsi/scsi_debug.c +++ b/trunk/drivers/scsi/scsi_debug.c @@ -24,6 +24,7 @@ * module options to "modprobe scsi_debug num_tgts=2" [20021221] */ +#include #include #include @@ -50,22 +51,18 @@ #include "scsi_logging.h" #include "scsi_debug.h" -#define SCSI_DEBUG_VERSION "1.79" -static const char * scsi_debug_version_date = "20060604"; +#define SCSI_DEBUG_VERSION "1.75" +static const char * scsi_debug_version_date = "20050113"; /* Additional Sense Code (ASC) used */ -#define NO_ADDITIONAL_SENSE 0x0 -#define LOGICAL_UNIT_NOT_READY 0x4 +#define NO_ADDED_SENSE 0x0 #define UNRECOVERED_READ_ERR 0x11 -#define PARAMETER_LIST_LENGTH_ERR 0x1a #define INVALID_OPCODE 0x20 #define ADDR_OUT_OF_RANGE 0x21 #define INVALID_FIELD_IN_CDB 0x24 -#define INVALID_FIELD_IN_PARAM_LIST 0x26 #define POWERON_RESET 0x29 #define SAVING_PARAMS_UNSUP 0x39 -#define THRESHOLD_EXCEEDED 0x5d -#define LOW_POWER_COND_ON 0x5e +#define THRESHHOLD_EXCEEDED 0x5d #define SDEBUG_TAGGED_QUEUING 0 /* 0 | MSG_SIMPLE_TAG | MSG_ORDERED_TAG */ @@ -84,8 +81,6 @@ static const char * scsi_debug_version_date = "20060604"; #define DEF_SCSI_LEVEL 5 /* INQUIRY, byte2 [5->SPC-3] */ #define DEF_PTYPE 0 #define DEF_D_SENSE 0 -#define DEF_NO_LUN_0 0 -#define DEF_VIRTUAL_GB 0 /* bit mask values for scsi_debug_opts */ #define SCSI_DEBUG_OPT_NOISE 1 @@ -112,7 +107,6 @@ static const char * scsi_debug_version_date = "20060604"; /* If REPORT LUNS has luns >= 256 it can choose "flat space" (value 1) * or "peripheral device" addressing (value 0) */ #define SAM2_LUN_ADDRESS_METHOD 0 -#define SAM2_WLUN_REPORT_LUNS 0xc101 static int scsi_debug_add_host = DEF_NUM_HOST; static int scsi_debug_delay = DEF_DELAY; @@ -125,16 +119,13 @@ static int scsi_debug_opts = DEF_OPTS; static int scsi_debug_scsi_level = DEF_SCSI_LEVEL; static int scsi_debug_ptype = DEF_PTYPE; /* SCSI peripheral type (0==disk) */ static int scsi_debug_dsense = DEF_D_SENSE; -static int scsi_debug_no_lun_0 = DEF_NO_LUN_0; -static int scsi_debug_virtual_gb = DEF_VIRTUAL_GB; static int scsi_debug_cmnd_count = 0; #define DEV_READONLY(TGT) (0) #define DEV_REMOVEABLE(TGT) (0) -static unsigned int sdebug_store_size; /* in bytes */ -static unsigned int sdebug_store_sectors; +static unsigned long sdebug_store_size; /* in bytes */ static sector_t sdebug_capacity; /* in sectors */ /* old BIOS stuff, kernel may get rid of them but some mode sense pages @@ -159,9 +150,7 @@ struct sdebug_dev_info { unsigned int target; unsigned int lun; struct sdebug_host_info *sdbg_host; - unsigned int wlun; char reset; - char stopped; char used; }; @@ -205,11 +194,11 @@ static struct scsi_host_template sdebug_driver_template = { .bios_param = scsi_debug_biosparam, .can_queue = SCSI_DEBUG_CANQUEUE, .this_id = 7, - .sg_tablesize = 256, - .cmd_per_lun = 16, - .max_sectors = 0xffff, + .sg_tablesize = 64, + .cmd_per_lun = 3, + .max_sectors = 4096, .unchecked_isa_dma = 0, - .use_clustering = ENABLE_CLUSTERING, + .use_clustering = DISABLE_CLUSTERING, .module = THIS_MODULE, }; @@ -237,32 +226,19 @@ static struct device_driver sdebug_driverfs_driver = { static const int check_condition_result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; -static unsigned char ctrl_m_pg[] = {0xa, 10, 2, 0, 0, 0, 0, 0, - 0, 0, 0x2, 0x4b}; -static unsigned char iec_m_pg[] = {0x1c, 0xa, 0x08, 0, 0, 0, 0, 0, - 0, 0, 0x0, 0x0}; - /* function declarations */ static int resp_inquiry(struct scsi_cmnd * SCpnt, int target, struct sdebug_dev_info * devip); static int resp_requests(struct scsi_cmnd * SCpnt, struct sdebug_dev_info * devip); -static int resp_start_stop(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip); static int resp_readcap(struct scsi_cmnd * SCpnt, struct sdebug_dev_info * devip); -static int resp_readcap16(struct scsi_cmnd * SCpnt, - struct sdebug_dev_info * devip); -static int resp_mode_sense(struct scsi_cmnd * scp, int target, +static int resp_mode_sense(struct scsi_cmnd * SCpnt, int target, struct sdebug_dev_info * devip); -static int resp_mode_select(struct scsi_cmnd * scp, int mselect6, - struct sdebug_dev_info * devip); -static int resp_log_sense(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip); -static int resp_read(struct scsi_cmnd * SCpnt, unsigned long long lba, - unsigned int num, struct sdebug_dev_info * devip); -static int resp_write(struct scsi_cmnd * SCpnt, unsigned long long lba, - unsigned int num, struct sdebug_dev_info * devip); +static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block, + int num, struct sdebug_dev_info * devip); +static int resp_write(struct scsi_cmnd * SCpnt, int upper_blk, int block, + int num, struct sdebug_dev_info * devip); static int resp_report_luns(struct scsi_cmnd * SCpnt, struct sdebug_dev_info * devip); static int fill_from_dev_buffer(struct scsi_cmnd * scp, unsigned char * arr, @@ -273,8 +249,8 @@ static void timer_intr_handler(unsigned long); static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev); static void mk_sense_buffer(struct sdebug_dev_info * devip, int key, int asc, int asq); -static int check_readiness(struct scsi_cmnd * SCpnt, int reset_only, - struct sdebug_dev_info * devip); +static int check_reset(struct scsi_cmnd * SCpnt, + struct sdebug_dev_info * devip); static int schedule_resp(struct scsi_cmnd * cmnd, struct sdebug_dev_info * devip, done_funct_t done, int scsi_result, int delta_jiff); @@ -282,10 +258,8 @@ static void __init sdebug_build_parts(unsigned char * ramp); static void __init init_all_queued(void); static void stop_all_queued(void); static int stop_queued_cmnd(struct scsi_cmnd * cmnd); -static int inquiry_evpd_83(unsigned char * arr, int target_dev_id, - int dev_id_num, const char * dev_id_str, - int dev_id_str_len); -static int inquiry_evpd_88(unsigned char * arr, int target_dev_id); +static int inquiry_evpd_83(unsigned char * arr, int dev_id_num, + const char * dev_id_str, int dev_id_str_len); static void do_create_driverfs_files(void); static void do_remove_driverfs_files(void); @@ -301,22 +275,18 @@ static int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done) { unsigned char *cmd = (unsigned char *) SCpnt->cmnd; - int len, k, j; - unsigned int num; - unsigned long long lba; + int block, upper_blk, num, k; int errsts = 0; - int target = SCpnt->device->id; + int target = scmd_id(SCpnt); struct sdebug_dev_info * devip = NULL; int inj_recovered = 0; - int delay_override = 0; if (done == NULL) return 0; /* assume mid level reprocessing command */ - SCpnt->resid = 0; if ((SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) && cmd) { printk(KERN_INFO "scsi_debug: cmd "); - for (k = 0, len = SCpnt->cmd_len; k < len; ++k) + for (k = 0, num = SCpnt->cmd_len; k < num; ++k) printk("%02x ", (int)cmd[k]); printk("\n"); } @@ -327,8 +297,7 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done) DID_NO_CONNECT << 16, 0); } - if ((SCpnt->device->lun >= scsi_debug_max_luns) && - (SCpnt->device->lun != SAM2_WLUN_REPORT_LUNS)) + if (SCpnt->device->lun >= scsi_debug_max_luns) return schedule_resp(SCpnt, NULL, done, DID_NO_CONNECT << 16, 0); devip = devInfoReg(SCpnt->device); @@ -347,150 +316,118 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done) inj_recovered = 1; /* to reads and writes below */ } - if (devip->wlun) { - switch (*cmd) { - case INQUIRY: - case REQUEST_SENSE: - case TEST_UNIT_READY: - case REPORT_LUNS: - break; /* only allowable wlun commands */ - default: - if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) - printk(KERN_INFO "scsi_debug: Opcode: 0x%x " - "not supported for wlun\n", *cmd); - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_OPCODE, 0); - errsts = check_condition_result; - return schedule_resp(SCpnt, devip, done, errsts, - 0); - } - } - switch (*cmd) { case INQUIRY: /* mandatory, ignore unit attention */ - delay_override = 1; errsts = resp_inquiry(SCpnt, target, devip); break; case REQUEST_SENSE: /* mandatory, ignore unit attention */ - delay_override = 1; errsts = resp_requests(SCpnt, devip); break; case REZERO_UNIT: /* actually this is REWIND for SSC */ case START_STOP: - errsts = resp_start_stop(SCpnt, devip); + errsts = check_reset(SCpnt, devip); break; case ALLOW_MEDIUM_REMOVAL: - if ((errsts = check_readiness(SCpnt, 1, devip))) + if ((errsts = check_reset(SCpnt, devip))) break; if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) printk(KERN_INFO "scsi_debug: Medium removal %s\n", cmd[4] ? "inhibited" : "enabled"); break; case SEND_DIAGNOSTIC: /* mandatory */ - errsts = check_readiness(SCpnt, 1, devip); + errsts = check_reset(SCpnt, devip); break; case TEST_UNIT_READY: /* mandatory */ - delay_override = 1; - errsts = check_readiness(SCpnt, 0, devip); + errsts = check_reset(SCpnt, devip); break; case RESERVE: - errsts = check_readiness(SCpnt, 1, devip); + errsts = check_reset(SCpnt, devip); break; case RESERVE_10: - errsts = check_readiness(SCpnt, 1, devip); + errsts = check_reset(SCpnt, devip); break; case RELEASE: - errsts = check_readiness(SCpnt, 1, devip); + errsts = check_reset(SCpnt, devip); break; case RELEASE_10: - errsts = check_readiness(SCpnt, 1, devip); + errsts = check_reset(SCpnt, devip); break; case READ_CAPACITY: errsts = resp_readcap(SCpnt, devip); break; - case SERVICE_ACTION_IN: - if (SAI_READ_CAPACITY_16 != cmd[1]) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_OPCODE, 0); - errsts = check_condition_result; - break; - } - errsts = resp_readcap16(SCpnt, devip); - break; case READ_16: case READ_12: case READ_10: case READ_6: - if ((errsts = check_readiness(SCpnt, 0, devip))) + if ((errsts = check_reset(SCpnt, devip))) break; + upper_blk = 0; if ((*cmd) == READ_16) { - for (lba = 0, j = 0; j < 8; ++j) { - if (j > 0) - lba <<= 8; - lba += cmd[2 + j]; - } + upper_blk = cmd[5] + (cmd[4] << 8) + + (cmd[3] << 16) + (cmd[2] << 24); + block = cmd[9] + (cmd[8] << 8) + + (cmd[7] << 16) + (cmd[6] << 24); num = cmd[13] + (cmd[12] << 8) + (cmd[11] << 16) + (cmd[10] << 24); } else if ((*cmd) == READ_12) { - lba = cmd[5] + (cmd[4] << 8) + + block = cmd[5] + (cmd[4] << 8) + (cmd[3] << 16) + (cmd[2] << 24); num = cmd[9] + (cmd[8] << 8) + (cmd[7] << 16) + (cmd[6] << 24); } else if ((*cmd) == READ_10) { - lba = cmd[5] + (cmd[4] << 8) + + block = cmd[5] + (cmd[4] << 8) + (cmd[3] << 16) + (cmd[2] << 24); num = cmd[8] + (cmd[7] << 8); - } else { /* READ (6) */ - lba = cmd[3] + (cmd[2] << 8) + + } else { + block = cmd[3] + (cmd[2] << 8) + ((cmd[1] & 0x1f) << 16); - num = (0 == cmd[4]) ? 256 : cmd[4]; + num = cmd[4]; } - errsts = resp_read(SCpnt, lba, num, devip); + errsts = resp_read(SCpnt, upper_blk, block, num, devip); if (inj_recovered && (0 == errsts)) { mk_sense_buffer(devip, RECOVERED_ERROR, - THRESHOLD_EXCEEDED, 0); + THRESHHOLD_EXCEEDED, 0); errsts = check_condition_result; } break; case REPORT_LUNS: /* mandatory, ignore unit attention */ - delay_override = 1; errsts = resp_report_luns(SCpnt, devip); break; case VERIFY: /* 10 byte SBC-2 command */ - errsts = check_readiness(SCpnt, 0, devip); + errsts = check_reset(SCpnt, devip); break; case WRITE_16: case WRITE_12: case WRITE_10: case WRITE_6: - if ((errsts = check_readiness(SCpnt, 0, devip))) + if ((errsts = check_reset(SCpnt, devip))) break; + upper_blk = 0; if ((*cmd) == WRITE_16) { - for (lba = 0, j = 0; j < 8; ++j) { - if (j > 0) - lba <<= 8; - lba += cmd[2 + j]; - } + upper_blk = cmd[5] + (cmd[4] << 8) + + (cmd[3] << 16) + (cmd[2] << 24); + block = cmd[9] + (cmd[8] << 8) + + (cmd[7] << 16) + (cmd[6] << 24); num = cmd[13] + (cmd[12] << 8) + (cmd[11] << 16) + (cmd[10] << 24); } else if ((*cmd) == WRITE_12) { - lba = cmd[5] + (cmd[4] << 8) + + block = cmd[5] + (cmd[4] << 8) + (cmd[3] << 16) + (cmd[2] << 24); num = cmd[9] + (cmd[8] << 8) + (cmd[7] << 16) + (cmd[6] << 24); } else if ((*cmd) == WRITE_10) { - lba = cmd[5] + (cmd[4] << 8) + + block = cmd[5] + (cmd[4] << 8) + (cmd[3] << 16) + (cmd[2] << 24); num = cmd[8] + (cmd[7] << 8); - } else { /* WRITE (6) */ - lba = cmd[3] + (cmd[2] << 8) + + } else { + block = cmd[3] + (cmd[2] << 8) + ((cmd[1] & 0x1f) << 16); - num = (0 == cmd[4]) ? 256 : cmd[4]; + num = cmd[4]; } - errsts = resp_write(SCpnt, lba, num, devip); + errsts = resp_write(SCpnt, upper_blk, block, num, devip); if (inj_recovered && (0 == errsts)) { mk_sense_buffer(devip, RECOVERED_ERROR, - THRESHOLD_EXCEEDED, 0); + THRESHHOLD_EXCEEDED, 0); errsts = check_condition_result; } break; @@ -498,31 +435,20 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done) case MODE_SENSE_10: errsts = resp_mode_sense(SCpnt, target, devip); break; - case MODE_SELECT: - errsts = resp_mode_select(SCpnt, 1, devip); - break; - case MODE_SELECT_10: - errsts = resp_mode_select(SCpnt, 0, devip); - break; - case LOG_SENSE: - errsts = resp_log_sense(SCpnt, devip); - break; case SYNCHRONIZE_CACHE: - delay_override = 1; - errsts = check_readiness(SCpnt, 0, devip); + errsts = check_reset(SCpnt, devip); break; default: if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) printk(KERN_INFO "scsi_debug: Opcode: 0x%x not " "supported\n", *cmd); - if ((errsts = check_readiness(SCpnt, 1, devip))) + if ((errsts = check_reset(SCpnt, devip))) break; /* Unit attention takes precedence */ mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_OPCODE, 0); errsts = check_condition_result; break; } - return schedule_resp(SCpnt, devip, done, errsts, - (delay_override ? 0 : scsi_debug_delay)); + return schedule_resp(SCpnt, devip, done, errsts, scsi_debug_delay); } static int scsi_debug_ioctl(struct scsi_device *dev, int cmd, void __user *arg) @@ -534,8 +460,7 @@ static int scsi_debug_ioctl(struct scsi_device *dev, int cmd, void __user *arg) /* return -ENOTTY; // correct return but upsets fdisk */ } -static int check_readiness(struct scsi_cmnd * SCpnt, int reset_only, - struct sdebug_dev_info * devip) +static int check_reset(struct scsi_cmnd * SCpnt, struct sdebug_dev_info * devip) { if (devip->reset) { if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) @@ -545,14 +470,6 @@ static int check_readiness(struct scsi_cmnd * SCpnt, int reset_only, mk_sense_buffer(devip, UNIT_ATTENTION, POWERON_RESET, 0); return check_condition_result; } - if ((0 == reset_only) && devip->stopped) { - if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) - printk(KERN_INFO "scsi_debug: Reporting Not " - "ready: initializing command required\n"); - mk_sense_buffer(devip, NOT_READY, LOGICAL_UNIT_NOT_READY, - 0x2); - return check_condition_result; - } return 0; } @@ -576,10 +493,7 @@ static int fill_from_dev_buffer(struct scsi_cmnd * scp, unsigned char * arr, req_len = scp->request_bufflen; act_len = (req_len < arr_len) ? req_len : arr_len; memcpy(scp->request_buffer, arr, act_len); - if (scp->resid) - scp->resid -= act_len; - else - scp->resid = req_len - act_len; + scp->resid = req_len - act_len; return 0; } sgpnt = (struct scatterlist *)scp->request_buffer; @@ -602,10 +516,7 @@ static int fill_from_dev_buffer(struct scsi_cmnd * scp, unsigned char * arr, } req_len += sgpnt->length; } - if (scp->resid) - scp->resid -= act_len; - else - scp->resid = req_len - act_len; + scp->resid = req_len - act_len; return 0; } @@ -656,14 +567,12 @@ static const char * inq_vendor_id = "Linux "; static const char * inq_product_id = "scsi_debug "; static const char * inq_product_rev = "0004"; -static int inquiry_evpd_83(unsigned char * arr, int target_dev_id, - int dev_id_num, const char * dev_id_str, - int dev_id_str_len) +static int inquiry_evpd_83(unsigned char * arr, int dev_id_num, + const char * dev_id_str, int dev_id_str_len) { - int num, port_a; - char b[32]; + int num; - port_a = target_dev_id + 1; + /* Two identification descriptors: */ /* T10 vendor identifier field format (faked) */ arr[0] = 0x2; /* ASCII */ arr[1] = 0x1; @@ -674,246 +583,25 @@ static int inquiry_evpd_83(unsigned char * arr, int target_dev_id, num = 8 + 16 + dev_id_str_len; arr[3] = num; num += 4; - if (dev_id_num >= 0) { - /* NAA-5, Logical unit identifier (binary) */ - arr[num++] = 0x1; /* binary (not necessarily sas) */ - arr[num++] = 0x3; /* PIV=0, lu, naa */ - arr[num++] = 0x0; - arr[num++] = 0x8; - arr[num++] = 0x53; /* naa-5 ieee company id=0x333333 (fake) */ - arr[num++] = 0x33; - arr[num++] = 0x33; - arr[num++] = 0x30; - arr[num++] = (dev_id_num >> 24); - arr[num++] = (dev_id_num >> 16) & 0xff; - arr[num++] = (dev_id_num >> 8) & 0xff; - arr[num++] = dev_id_num & 0xff; - /* Target relative port number */ - arr[num++] = 0x61; /* proto=sas, binary */ - arr[num++] = 0x94; /* PIV=1, target port, rel port */ - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x4; /* length */ - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x0; - arr[num++] = 0x1; /* relative port A */ - } - /* NAA-5, Target port identifier */ - arr[num++] = 0x61; /* proto=sas, binary */ - arr[num++] = 0x93; /* piv=1, target port, naa */ - arr[num++] = 0x0; - arr[num++] = 0x8; - arr[num++] = 0x52; /* naa-5, company id=0x222222 (fake) */ - arr[num++] = 0x22; - arr[num++] = 0x22; - arr[num++] = 0x20; - arr[num++] = (port_a >> 24); - arr[num++] = (port_a >> 16) & 0xff; - arr[num++] = (port_a >> 8) & 0xff; - arr[num++] = port_a & 0xff; - /* NAA-5, Target device identifier */ - arr[num++] = 0x61; /* proto=sas, binary */ - arr[num++] = 0xa3; /* piv=1, target device, naa */ - arr[num++] = 0x0; - arr[num++] = 0x8; - arr[num++] = 0x52; /* naa-5, company id=0x222222 (fake) */ - arr[num++] = 0x22; - arr[num++] = 0x22; - arr[num++] = 0x20; - arr[num++] = (target_dev_id >> 24); - arr[num++] = (target_dev_id >> 16) & 0xff; - arr[num++] = (target_dev_id >> 8) & 0xff; - arr[num++] = target_dev_id & 0xff; - /* SCSI name string: Target device identifier */ - arr[num++] = 0x63; /* proto=sas, UTF-8 */ - arr[num++] = 0xa8; /* piv=1, target device, SCSI name string */ - arr[num++] = 0x0; - arr[num++] = 24; - memcpy(arr + num, "naa.52222220", 12); - num += 12; - snprintf(b, sizeof(b), "%08X", target_dev_id); - memcpy(arr + num, b, 8); - num += 8; - memset(arr + num, 0, 4); - num += 4; - return num; -} - - -static unsigned char vpd84_data[] = { -/* from 4th byte */ 0x22,0x22,0x22,0x0,0xbb,0x0, - 0x22,0x22,0x22,0x0,0xbb,0x1, - 0x22,0x22,0x22,0x0,0xbb,0x2, -}; - -static int inquiry_evpd_84(unsigned char * arr) -{ - memcpy(arr, vpd84_data, sizeof(vpd84_data)); - return sizeof(vpd84_data); -} - -static int inquiry_evpd_85(unsigned char * arr) -{ - int num = 0; - const char * na1 = "https://www.kernel.org/config"; - const char * na2 = "http://www.kernel.org/log"; - int plen, olen; - - arr[num++] = 0x1; /* lu, storage config */ - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x0; - olen = strlen(na1); - plen = olen + 1; - if (plen % 4) - plen = ((plen / 4) + 1) * 4; - arr[num++] = plen; /* length, null termianted, padded */ - memcpy(arr + num, na1, olen); - memset(arr + num + olen, 0, plen - olen); - num += plen; - - arr[num++] = 0x4; /* lu, logging */ - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x0; - olen = strlen(na2); - plen = olen + 1; - if (plen % 4) - plen = ((plen / 4) + 1) * 4; - arr[num++] = plen; /* length, null terminated, padded */ - memcpy(arr + num, na2, olen); - memset(arr + num + olen, 0, plen - olen); - num += plen; - - return num; -} - -/* SCSI ports VPD page */ -static int inquiry_evpd_88(unsigned char * arr, int target_dev_id) -{ - int num = 0; - int port_a, port_b; - - port_a = target_dev_id + 1; - port_b = port_a + 1; - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x0; - arr[num++] = 0x1; /* relative port 1 (primary) */ - memset(arr + num, 0, 6); - num += 6; - arr[num++] = 0x0; - arr[num++] = 12; /* length tp descriptor */ - /* naa-5 target port identifier (A) */ - arr[num++] = 0x61; /* proto=sas, binary */ - arr[num++] = 0x93; /* PIV=1, target port, NAA */ - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x8; /* length */ - arr[num++] = 0x52; /* NAA-5, company_id=0x222222 (fake) */ - arr[num++] = 0x22; - arr[num++] = 0x22; - arr[num++] = 0x20; - arr[num++] = (port_a >> 24); - arr[num++] = (port_a >> 16) & 0xff; - arr[num++] = (port_a >> 8) & 0xff; - arr[num++] = port_a & 0xff; - - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x0; - arr[num++] = 0x2; /* relative port 2 (secondary) */ - memset(arr + num, 0, 6); - num += 6; - arr[num++] = 0x0; - arr[num++] = 12; /* length tp descriptor */ - /* naa-5 target port identifier (B) */ - arr[num++] = 0x61; /* proto=sas, binary */ - arr[num++] = 0x93; /* PIV=1, target port, NAA */ - arr[num++] = 0x0; /* reserved */ - arr[num++] = 0x8; /* length */ - arr[num++] = 0x52; /* NAA-5, company_id=0x222222 (fake) */ - arr[num++] = 0x22; - arr[num++] = 0x22; - arr[num++] = 0x20; - arr[num++] = (port_b >> 24); - arr[num++] = (port_b >> 16) & 0xff; - arr[num++] = (port_b >> 8) & 0xff; - arr[num++] = port_b & 0xff; - - return num; -} - - -static unsigned char vpd89_data[] = { -/* from 4th byte */ 0,0,0,0, -'l','i','n','u','x',' ',' ',' ', -'S','A','T',' ','s','c','s','i','_','d','e','b','u','g',' ',' ', -'1','2','3','4', -0x34,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, -0xec,0,0,0, -0x5a,0xc,0xff,0x3f,0x37,0xc8,0x10,0,0,0,0,0,0x3f,0,0,0, -0,0,0,0,0x58,0x58,0x58,0x58,0x58,0x58,0x58,0x58,0x20,0x20,0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0,0,0,0x40,0x4,0,0x2e,0x33, -0x38,0x31,0x20,0x20,0x20,0x20,0x54,0x53,0x38,0x33,0x30,0x30,0x33,0x31, -0x53,0x41, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x20,0x20, -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, -0x10,0x80, -0,0,0,0x2f,0,0,0,0x2,0,0x2,0x7,0,0xff,0xff,0x1,0, -0x3f,0,0xc1,0xff,0x3e,0,0x10,0x1,0xb0,0xf8,0x50,0x9,0,0,0x7,0, -0x3,0,0x78,0,0x78,0,0xf0,0,0x78,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0x2,0,0,0,0,0,0,0, -0x7e,0,0x1b,0,0x6b,0x34,0x1,0x7d,0x3,0x40,0x69,0x34,0x1,0x3c,0x3,0x40, -0x7f,0x40,0,0,0,0,0xfe,0xfe,0,0,0,0,0,0xfe,0,0, -0,0,0,0,0,0,0,0,0xb0,0xf8,0x50,0x9,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0x1,0,0xb0,0xf8,0x50,0x9,0xb0,0xf8,0x50,0x9,0x20,0x20,0x2,0,0xb6,0x42, -0,0x80,0x8a,0,0x6,0x3c,0xa,0x3c,0xff,0xff,0xc6,0x7,0,0x1,0,0x8, -0xf0,0xf,0,0x10,0x2,0,0x30,0,0,0,0,0,0,0,0x6,0xfe, -0,0,0x2,0,0x50,0,0x8a,0,0x4f,0x95,0,0,0x21,0,0xb,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xa5,0x51, -}; - -static int inquiry_evpd_89(unsigned char * arr) -{ - memcpy(arr, vpd89_data, sizeof(vpd89_data)); - return sizeof(vpd89_data); -} - - -static unsigned char vpdb0_data[] = { - /* from 4th byte */ 0,0,0,4, - 0,0,0x4,0, - 0,0,0,64, -}; - -static int inquiry_evpd_b0(unsigned char * arr) -{ - memcpy(arr, vpdb0_data, sizeof(vpdb0_data)); - if (sdebug_store_sectors > 0x400) { - arr[4] = (sdebug_store_sectors >> 24) & 0xff; - arr[5] = (sdebug_store_sectors >> 16) & 0xff; - arr[6] = (sdebug_store_sectors >> 8) & 0xff; - arr[7] = sdebug_store_sectors & 0xff; - } - return sizeof(vpdb0_data); + /* NAA IEEE registered identifier (faked) */ + arr[num] = 0x1; /* binary */ + arr[num + 1] = 0x3; + arr[num + 2] = 0x0; + arr[num + 3] = 0x8; + arr[num + 4] = 0x51; /* ieee company id=0x123456 (faked) */ + arr[num + 5] = 0x23; + arr[num + 6] = 0x45; + arr[num + 7] = 0x60; + arr[num + 8] = (dev_id_num >> 24); + arr[num + 9] = (dev_id_num >> 16) & 0xff; + arr[num + 10] = (dev_id_num >> 8) & 0xff; + arr[num + 11] = dev_id_num & 0xff; + return num + 12; } #define SDEBUG_LONG_INQ_SZ 96 -#define SDEBUG_MAX_INQ_ARR_SZ 584 +#define SDEBUG_MAX_INQ_ARR_SZ 128 static int resp_inquiry(struct scsi_cmnd * scp, int target, struct sdebug_dev_info * devip) @@ -921,113 +609,64 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target, unsigned char pq_pdt; unsigned char arr[SDEBUG_MAX_INQ_ARR_SZ]; unsigned char *cmd = (unsigned char *)scp->cmnd; - int alloc_len, n; + int alloc_len; alloc_len = (cmd[3] << 8) + cmd[4]; memset(arr, 0, SDEBUG_MAX_INQ_ARR_SZ); - if (devip->wlun) - pq_pdt = 0x1e; /* present, wlun */ - else if (scsi_debug_no_lun_0 && (0 == devip->lun)) - pq_pdt = 0x7f; /* not present, no device type */ - else - pq_pdt = (scsi_debug_ptype & 0x1f); + pq_pdt = (scsi_debug_ptype & 0x1f); arr[0] = pq_pdt; if (0x2 & cmd[1]) { /* CMDDT bit set */ mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, 0); return check_condition_result; } else if (0x1 & cmd[1]) { /* EVPD bit set */ - int lu_id_num, target_dev_id, len; - char lu_id_str[6]; - int host_no = devip->sdbg_host->shost->host_no; + int dev_id_num, len; + char dev_id_str[6]; - lu_id_num = devip->wlun ? -1 : (((host_no + 1) * 2000) + - (devip->target * 1000) + devip->lun); - target_dev_id = ((host_no + 1) * 2000) + - (devip->target * 1000) - 3; - len = scnprintf(lu_id_str, 6, "%d", lu_id_num); + dev_id_num = ((devip->sdbg_host->shost->host_no + 1) * 2000) + + (devip->target * 1000) + devip->lun; + len = scnprintf(dev_id_str, 6, "%d", dev_id_num); if (0 == cmd[2]) { /* supported vital product data pages */ - arr[1] = cmd[2]; /*sanity */ - n = 4; - arr[n++] = 0x0; /* this page */ - arr[n++] = 0x80; /* unit serial number */ - arr[n++] = 0x83; /* device identification */ - arr[n++] = 0x84; /* software interface ident. */ - arr[n++] = 0x85; /* management network addresses */ - arr[n++] = 0x86; /* extended inquiry */ - arr[n++] = 0x87; /* mode page policy */ - arr[n++] = 0x88; /* SCSI ports */ - arr[n++] = 0x89; /* ATA information */ - arr[n++] = 0xb0; /* Block limits (SBC) */ - arr[3] = n - 4; /* number of supported VPD pages */ + arr[3] = 3; + arr[4] = 0x0; /* this page */ + arr[5] = 0x80; /* unit serial number */ + arr[6] = 0x83; /* device identification */ } else if (0x80 == cmd[2]) { /* unit serial number */ - arr[1] = cmd[2]; /*sanity */ + arr[1] = 0x80; arr[3] = len; - memcpy(&arr[4], lu_id_str, len); + memcpy(&arr[4], dev_id_str, len); } else if (0x83 == cmd[2]) { /* device identification */ - arr[1] = cmd[2]; /*sanity */ - arr[3] = inquiry_evpd_83(&arr[4], target_dev_id, - lu_id_num, lu_id_str, len); - } else if (0x84 == cmd[2]) { /* Software interface ident. */ - arr[1] = cmd[2]; /*sanity */ - arr[3] = inquiry_evpd_84(&arr[4]); - } else if (0x85 == cmd[2]) { /* Management network addresses */ - arr[1] = cmd[2]; /*sanity */ - arr[3] = inquiry_evpd_85(&arr[4]); - } else if (0x86 == cmd[2]) { /* extended inquiry */ - arr[1] = cmd[2]; /*sanity */ - arr[3] = 0x3c; /* number of following entries */ - arr[4] = 0x0; /* no protection stuff */ - arr[5] = 0x7; /* head of q, ordered + simple q's */ - } else if (0x87 == cmd[2]) { /* mode page policy */ - arr[1] = cmd[2]; /*sanity */ - arr[3] = 0x8; /* number of following entries */ - arr[4] = 0x2; /* disconnect-reconnect mp */ - arr[6] = 0x80; /* mlus, shared */ - arr[8] = 0x18; /* protocol specific lu */ - arr[10] = 0x82; /* mlus, per initiator port */ - } else if (0x88 == cmd[2]) { /* SCSI Ports */ - arr[1] = cmd[2]; /*sanity */ - arr[3] = inquiry_evpd_88(&arr[4], target_dev_id); - } else if (0x89 == cmd[2]) { /* ATA information */ - arr[1] = cmd[2]; /*sanity */ - n = inquiry_evpd_89(&arr[4]); - arr[2] = (n >> 8); - arr[3] = (n & 0xff); - } else if (0xb0 == cmd[2]) { /* Block limits (SBC) */ - arr[1] = cmd[2]; /*sanity */ - arr[3] = inquiry_evpd_b0(&arr[4]); + arr[1] = 0x83; + arr[3] = inquiry_evpd_83(&arr[4], dev_id_num, + dev_id_str, len); } else { /* Illegal request, invalid field in cdb */ mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, 0); return check_condition_result; } - len = min(((arr[2] << 8) + arr[3]) + 4, alloc_len); return fill_from_dev_buffer(scp, arr, - min(len, SDEBUG_MAX_INQ_ARR_SZ)); + min(alloc_len, SDEBUG_MAX_INQ_ARR_SZ)); } /* drops through here for a standard inquiry */ arr[1] = DEV_REMOVEABLE(target) ? 0x80 : 0; /* Removable disk */ arr[2] = scsi_debug_scsi_level; arr[3] = 2; /* response_data_format==2 */ arr[4] = SDEBUG_LONG_INQ_SZ - 5; - arr[6] = 0x10; /* claim: MultiP */ + arr[6] = 0x1; /* claim: ADDR16 */ /* arr[6] |= 0x40; ... claim: EncServ (enclosure services) */ - arr[7] = 0xa; /* claim: LINKED + CMDQUE */ + arr[7] = 0x3a; /* claim: WBUS16, SYNC, LINKED + CMDQUE */ memcpy(&arr[8], inq_vendor_id, 8); memcpy(&arr[16], inq_product_id, 16); memcpy(&arr[32], inq_product_rev, 4); /* version descriptors (2 bytes each) follow */ - arr[58] = 0x0; arr[59] = 0x77; /* SAM-3 ANSI */ - arr[60] = 0x3; arr[61] = 0x14; /* SPC-3 ANSI */ - n = 62; + arr[58] = 0x0; arr[59] = 0x40; /* SAM-2 */ + arr[60] = 0x3; arr[61] = 0x0; /* SPC-3 */ if (scsi_debug_ptype == 0) { - arr[n++] = 0x3; arr[n++] = 0x3d; /* SBC-2 ANSI */ + arr[62] = 0x1; arr[63] = 0x80; /* SBC */ } else if (scsi_debug_ptype == 1) { - arr[n++] = 0x3; arr[n++] = 0x60; /* SSC-2 no version */ + arr[62] = 0x2; arr[63] = 0x00; /* SSC */ } - arr[n++] = 0xc; arr[n++] = 0xf; /* SAS-1.1 rev 10 */ return fill_from_dev_buffer(scp, arr, min(alloc_len, SDEBUG_LONG_INQ_SZ)); } @@ -1038,141 +677,46 @@ static int resp_requests(struct scsi_cmnd * scp, unsigned char * sbuff; unsigned char *cmd = (unsigned char *)scp->cmnd; unsigned char arr[SDEBUG_SENSE_LEN]; - int want_dsense; int len = 18; - memset(arr, 0, sizeof(arr)); + memset(arr, 0, SDEBUG_SENSE_LEN); if (devip->reset == 1) - mk_sense_buffer(devip, 0, NO_ADDITIONAL_SENSE, 0); - want_dsense = !!(cmd[1] & 1) || scsi_debug_dsense; + mk_sense_buffer(devip, 0, NO_ADDED_SENSE, 0); sbuff = devip->sense_buff; - if ((iec_m_pg[2] & 0x4) && (6 == (iec_m_pg[3] & 0xf))) { - if (want_dsense) { - arr[0] = 0x72; - arr[1] = 0x0; /* NO_SENSE in sense_key */ - arr[2] = THRESHOLD_EXCEEDED; - arr[3] = 0xff; /* TEST set and MRIE==6 */ - } else { - arr[0] = 0x70; - arr[2] = 0x0; /* NO_SENSE in sense_key */ - arr[7] = 0xa; /* 18 byte sense buffer */ - arr[12] = THRESHOLD_EXCEEDED; - arr[13] = 0xff; /* TEST set and MRIE==6 */ - } - } else if (devip->stopped) { - if (want_dsense) { - arr[0] = 0x72; - arr[1] = 0x0; /* NO_SENSE in sense_key */ - arr[2] = LOW_POWER_COND_ON; - arr[3] = 0x0; /* TEST set and MRIE==6 */ - } else { - arr[0] = 0x70; - arr[2] = 0x0; /* NO_SENSE in sense_key */ - arr[7] = 0xa; /* 18 byte sense buffer */ - arr[12] = LOW_POWER_COND_ON; - arr[13] = 0x0; /* TEST set and MRIE==6 */ - } - } else { + if ((cmd[1] & 1) && (! scsi_debug_dsense)) { + /* DESC bit set and sense_buff in fixed format */ + arr[0] = 0x72; + arr[1] = sbuff[2]; /* sense key */ + arr[2] = sbuff[12]; /* asc */ + arr[3] = sbuff[13]; /* ascq */ + len = 8; + } else memcpy(arr, sbuff, SDEBUG_SENSE_LEN); - if ((cmd[1] & 1) && (! scsi_debug_dsense)) { - /* DESC bit set and sense_buff in fixed format */ - memset(arr, 0, sizeof(arr)); - arr[0] = 0x72; - arr[1] = sbuff[2]; /* sense key */ - arr[2] = sbuff[12]; /* asc */ - arr[3] = sbuff[13]; /* ascq */ - len = 8; - } - } - mk_sense_buffer(devip, 0, NO_ADDITIONAL_SENSE, 0); + mk_sense_buffer(devip, 0, NO_ADDED_SENSE, 0); return fill_from_dev_buffer(scp, arr, len); } -static int resp_start_stop(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) -{ - unsigned char *cmd = (unsigned char *)scp->cmnd; - int power_cond, errsts, start; - - if ((errsts = check_readiness(scp, 1, devip))) - return errsts; - power_cond = (cmd[4] & 0xf0) >> 4; - if (power_cond) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, - 0); - return check_condition_result; - } - start = cmd[4] & 1; - if (start == devip->stopped) - devip->stopped = !start; - return 0; -} - #define SDEBUG_READCAP_ARR_SZ 8 static int resp_readcap(struct scsi_cmnd * scp, struct sdebug_dev_info * devip) { unsigned char arr[SDEBUG_READCAP_ARR_SZ]; - unsigned int capac; + unsigned long capac; int errsts; - if ((errsts = check_readiness(scp, 1, devip))) + if ((errsts = check_reset(scp, devip))) return errsts; - /* following just in case virtual_gb changed */ - if (scsi_debug_virtual_gb > 0) { - sdebug_capacity = 2048 * 1024; - sdebug_capacity *= scsi_debug_virtual_gb; - } else - sdebug_capacity = sdebug_store_sectors; memset(arr, 0, SDEBUG_READCAP_ARR_SZ); - if (sdebug_capacity < 0xffffffff) { - capac = (unsigned int)sdebug_capacity - 1; - arr[0] = (capac >> 24); - arr[1] = (capac >> 16) & 0xff; - arr[2] = (capac >> 8) & 0xff; - arr[3] = capac & 0xff; - } else { - arr[0] = 0xff; - arr[1] = 0xff; - arr[2] = 0xff; - arr[3] = 0xff; - } + capac = (unsigned long)sdebug_capacity - 1; + arr[0] = (capac >> 24); + arr[1] = (capac >> 16) & 0xff; + arr[2] = (capac >> 8) & 0xff; + arr[3] = capac & 0xff; arr[6] = (SECT_SIZE_PER(target) >> 8) & 0xff; arr[7] = SECT_SIZE_PER(target) & 0xff; return fill_from_dev_buffer(scp, arr, SDEBUG_READCAP_ARR_SZ); } -#define SDEBUG_READCAP16_ARR_SZ 32 -static int resp_readcap16(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) -{ - unsigned char *cmd = (unsigned char *)scp->cmnd; - unsigned char arr[SDEBUG_READCAP16_ARR_SZ]; - unsigned long long capac; - int errsts, k, alloc_len; - - if ((errsts = check_readiness(scp, 1, devip))) - return errsts; - alloc_len = ((cmd[10] << 24) + (cmd[11] << 16) + (cmd[12] << 8) - + cmd[13]); - /* following just in case virtual_gb changed */ - if (scsi_debug_virtual_gb > 0) { - sdebug_capacity = 2048 * 1024; - sdebug_capacity *= scsi_debug_virtual_gb; - } else - sdebug_capacity = sdebug_store_sectors; - memset(arr, 0, SDEBUG_READCAP16_ARR_SZ); - capac = sdebug_capacity - 1; - for (k = 0; k < 8; ++k, capac >>= 8) - arr[7 - k] = capac & 0xff; - arr[8] = (SECT_SIZE_PER(target) >> 24) & 0xff; - arr[9] = (SECT_SIZE_PER(target) >> 16) & 0xff; - arr[10] = (SECT_SIZE_PER(target) >> 8) & 0xff; - arr[11] = SECT_SIZE_PER(target) & 0xff; - return fill_from_dev_buffer(scp, arr, - min(alloc_len, SDEBUG_READCAP16_ARR_SZ)); -} - /* <> */ static int resp_err_recov_pg(unsigned char * p, int pcontrol, int target) @@ -1228,98 +772,27 @@ static int resp_caching_pg(unsigned char * p, int pcontrol, int target) static int resp_ctrl_m_pg(unsigned char * p, int pcontrol, int target) { /* Control mode page for mode_sense */ - unsigned char ch_ctrl_m_pg[] = {/* 0xa, 10, */ 0x6, 0, 0, 0, 0, 0, - 0, 0, 0, 0}; - unsigned char d_ctrl_m_pg[] = {0xa, 10, 2, 0, 0, 0, 0, 0, + unsigned char ctrl_m_pg[] = {0xa, 10, 2, 0, 0, 0, 0, 0, 0, 0, 0x2, 0x4b}; if (scsi_debug_dsense) ctrl_m_pg[2] |= 0x4; - else - ctrl_m_pg[2] &= ~0x4; memcpy(p, ctrl_m_pg, sizeof(ctrl_m_pg)); if (1 == pcontrol) - memcpy(p + 2, ch_ctrl_m_pg, sizeof(ch_ctrl_m_pg)); - else if (2 == pcontrol) - memcpy(p, d_ctrl_m_pg, sizeof(d_ctrl_m_pg)); + memset(p + 2, 0, sizeof(ctrl_m_pg) - 2); return sizeof(ctrl_m_pg); } - static int resp_iec_m_pg(unsigned char * p, int pcontrol, int target) { /* Informational Exceptions control mode page for mode_sense */ - unsigned char ch_iec_m_pg[] = {/* 0x1c, 0xa, */ 0x4, 0xf, 0, 0, 0, 0, - 0, 0, 0x0, 0x0}; - unsigned char d_iec_m_pg[] = {0x1c, 0xa, 0x08, 0, 0, 0, 0, 0, - 0, 0, 0x0, 0x0}; - + unsigned char iec_m_pg[] = {0x1c, 0xa, 0x08, 0, 0, 0, 0, 0, + 0, 0, 0x0, 0x0}; memcpy(p, iec_m_pg, sizeof(iec_m_pg)); if (1 == pcontrol) - memcpy(p + 2, ch_iec_m_pg, sizeof(ch_iec_m_pg)); - else if (2 == pcontrol) - memcpy(p, d_iec_m_pg, sizeof(d_iec_m_pg)); + memset(p + 2, 0, sizeof(iec_m_pg) - 2); return sizeof(iec_m_pg); } -static int resp_sas_sf_m_pg(unsigned char * p, int pcontrol, int target) -{ /* SAS SSP mode page - short format for mode_sense */ - unsigned char sas_sf_m_pg[] = {0x19, 0x6, - 0x6, 0x0, 0x7, 0xd0, 0x0, 0x0}; - - memcpy(p, sas_sf_m_pg, sizeof(sas_sf_m_pg)); - if (1 == pcontrol) - memset(p + 2, 0, sizeof(sas_sf_m_pg) - 2); - return sizeof(sas_sf_m_pg); -} - - -static int resp_sas_pcd_m_spg(unsigned char * p, int pcontrol, int target, - int target_dev_id) -{ /* SAS phy control and discover mode page for mode_sense */ - unsigned char sas_pcd_m_pg[] = {0x59, 0x1, 0, 0x64, 0, 0x6, 0, 2, - 0, 0, 0, 0, 0x10, 0x9, 0x8, 0x0, - 0x52, 0x22, 0x22, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x51, 0x11, 0x11, 0x10, 0x0, 0x0, 0x0, 0x1, - 0x2, 0, 0, 0, 0, 0, 0, 0, - 0x88, 0x99, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0x10, 0x9, 0x8, 0x0, - 0x52, 0x22, 0x22, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x51, 0x11, 0x11, 0x10, 0x0, 0x0, 0x0, 0x1, - 0x3, 0, 0, 0, 0, 0, 0, 0, - 0x88, 0x99, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - int port_a, port_b; - - port_a = target_dev_id + 1; - port_b = port_a + 1; - memcpy(p, sas_pcd_m_pg, sizeof(sas_pcd_m_pg)); - p[20] = (port_a >> 24); - p[21] = (port_a >> 16) & 0xff; - p[22] = (port_a >> 8) & 0xff; - p[23] = port_a & 0xff; - p[48 + 20] = (port_b >> 24); - p[48 + 21] = (port_b >> 16) & 0xff; - p[48 + 22] = (port_b >> 8) & 0xff; - p[48 + 23] = port_b & 0xff; - if (1 == pcontrol) - memset(p + 4, 0, sizeof(sas_pcd_m_pg) - 4); - return sizeof(sas_pcd_m_pg); -} - -static int resp_sas_sha_m_spg(unsigned char * p, int pcontrol) -{ /* SAS SSP shared protocol specific port mode subpage */ - unsigned char sas_sha_m_pg[] = {0x59, 0x2, 0, 0xc, 0, 0x6, 0x10, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - - memcpy(p, sas_sha_m_pg, sizeof(sas_sha_m_pg)); - if (1 == pcontrol) - memset(p + 4, 0, sizeof(sas_sha_m_pg) - 4); - return sizeof(sas_sha_m_pg); -} - #define SDEBUG_MAX_MSENSE_SZ 256 static int resp_mode_sense(struct scsi_cmnd * scp, int target, @@ -1328,12 +801,12 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target, unsigned char dbd; int pcontrol, pcode, subpcode; unsigned char dev_spec; - int alloc_len, msense_6, offset, len, errsts, target_dev_id; + int alloc_len, msense_6, offset, len, errsts; unsigned char * ap; unsigned char arr[SDEBUG_MAX_MSENSE_SZ]; unsigned char *cmd = (unsigned char *)scp->cmnd; - if ((errsts = check_readiness(scp, 1, devip))) + if ((errsts = check_reset(scp, devip))) return errsts; dbd = cmd[1] & 0x8; pcontrol = (cmd[2] & 0xc0) >> 6; @@ -1347,8 +820,6 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target, 0); return check_condition_result; } - target_dev_id = ((devip->sdbg_host->shost->host_no + 1) * 2000) + - (devip->target * 1000) - 3; dev_spec = DEV_READONLY(target) ? 0x80 : 0x0; if (msense_6) { arr[2] = dev_spec; @@ -1359,8 +830,7 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target, } ap = arr + offset; - if ((subpcode > 0x0) && (subpcode < 0xff) && (0x19 != pcode)) { - /* TODO: Control Extension page */ + if (0 != subpcode) { /* TODO: Control Extension page */ mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, 0); return check_condition_result; @@ -1386,45 +856,17 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target, len = resp_ctrl_m_pg(ap, pcontrol, target); offset += len; break; - case 0x19: /* if spc==1 then sas phy, control+discover */ - if ((subpcode > 0x2) && (subpcode < 0xff)) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_FIELD_IN_CDB, 0); - return check_condition_result; - } - len = 0; - if ((0x0 == subpcode) || (0xff == subpcode)) - len += resp_sas_sf_m_pg(ap + len, pcontrol, target); - if ((0x1 == subpcode) || (0xff == subpcode)) - len += resp_sas_pcd_m_spg(ap + len, pcontrol, target, - target_dev_id); - if ((0x2 == subpcode) || (0xff == subpcode)) - len += resp_sas_sha_m_spg(ap + len, pcontrol); - offset += len; - break; case 0x1c: /* Informational Exceptions Mode page, all devices */ len = resp_iec_m_pg(ap, pcontrol, target); offset += len; break; case 0x3f: /* Read all Mode pages */ - if ((0 == subpcode) || (0xff == subpcode)) { - len = resp_err_recov_pg(ap, pcontrol, target); - len += resp_disconnect_pg(ap + len, pcontrol, target); - len += resp_format_pg(ap + len, pcontrol, target); - len += resp_caching_pg(ap + len, pcontrol, target); - len += resp_ctrl_m_pg(ap + len, pcontrol, target); - len += resp_sas_sf_m_pg(ap + len, pcontrol, target); - if (0xff == subpcode) { - len += resp_sas_pcd_m_spg(ap + len, pcontrol, - target, target_dev_id); - len += resp_sas_sha_m_spg(ap + len, pcontrol); - } - len += resp_iec_m_pg(ap + len, pcontrol, target); - } else { - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_FIELD_IN_CDB, 0); - return check_condition_result; - } + len = resp_err_recov_pg(ap, pcontrol, target); + len += resp_disconnect_pg(ap + len, pcontrol, target); + len += resp_format_pg(ap + len, pcontrol, target); + len += resp_caching_pg(ap + len, pcontrol, target); + len += resp_ctrl_m_pg(ap + len, pcontrol, target); + len += resp_iec_m_pg(ap + len, pcontrol, target); offset += len; break; default: @@ -1441,274 +883,71 @@ static int resp_mode_sense(struct scsi_cmnd * scp, int target, return fill_from_dev_buffer(scp, arr, min(alloc_len, offset)); } -#define SDEBUG_MAX_MSELECT_SZ 512 - -static int resp_mode_select(struct scsi_cmnd * scp, int mselect6, - struct sdebug_dev_info * devip) -{ - int pf, sp, ps, md_len, bd_len, off, spf, pg_len; - int param_len, res, errsts, mpage; - unsigned char arr[SDEBUG_MAX_MSELECT_SZ]; - unsigned char *cmd = (unsigned char *)scp->cmnd; - - if ((errsts = check_readiness(scp, 1, devip))) - return errsts; - memset(arr, 0, sizeof(arr)); - pf = cmd[1] & 0x10; - sp = cmd[1] & 0x1; - param_len = mselect6 ? cmd[4] : ((cmd[7] << 8) + cmd[8]); - if ((0 == pf) || sp || (param_len > SDEBUG_MAX_MSELECT_SZ)) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_FIELD_IN_CDB, 0); - return check_condition_result; - } - res = fetch_to_dev_buffer(scp, arr, param_len); - if (-1 == res) - return (DID_ERROR << 16); - else if ((res < param_len) && - (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)) - printk(KERN_INFO "scsi_debug: mode_select: cdb indicated=%d, " - " IO sent=%d bytes\n", param_len, res); - md_len = mselect6 ? (arr[0] + 1) : ((arr[0] << 8) + arr[1] + 2); - bd_len = mselect6 ? arr[3] : ((arr[6] << 8) + arr[7]); - if ((md_len > 2) || (0 != bd_len)) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_FIELD_IN_PARAM_LIST, 0); - return check_condition_result; - } - off = bd_len + (mselect6 ? 4 : 8); - mpage = arr[off] & 0x3f; - ps = !!(arr[off] & 0x80); - if (ps) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_FIELD_IN_PARAM_LIST, 0); - return check_condition_result; - } - spf = !!(arr[off] & 0x40); - pg_len = spf ? ((arr[off + 2] << 8) + arr[off + 3] + 4) : - (arr[off + 1] + 2); - if ((pg_len + off) > param_len) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, - PARAMETER_LIST_LENGTH_ERR, 0); - return check_condition_result; - } - switch (mpage) { - case 0xa: /* Control Mode page */ - if (ctrl_m_pg[1] == arr[off + 1]) { - memcpy(ctrl_m_pg + 2, arr + off + 2, - sizeof(ctrl_m_pg) - 2); - scsi_debug_dsense = !!(ctrl_m_pg[2] & 0x4); - return 0; - } - break; - case 0x1c: /* Informational Exceptions Mode page */ - if (iec_m_pg[1] == arr[off + 1]) { - memcpy(iec_m_pg + 2, arr + off + 2, - sizeof(iec_m_pg) - 2); - return 0; - } - break; - default: - break; - } - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_FIELD_IN_PARAM_LIST, 0); - return check_condition_result; -} - -static int resp_temp_l_pg(unsigned char * arr) -{ - unsigned char temp_l_pg[] = {0x0, 0x0, 0x3, 0x2, 0x0, 38, - 0x0, 0x1, 0x3, 0x2, 0x0, 65, - }; - - memcpy(arr, temp_l_pg, sizeof(temp_l_pg)); - return sizeof(temp_l_pg); -} - -static int resp_ie_l_pg(unsigned char * arr) -{ - unsigned char ie_l_pg[] = {0x0, 0x0, 0x3, 0x3, 0x0, 0x0, 38, - }; - - memcpy(arr, ie_l_pg, sizeof(ie_l_pg)); - if (iec_m_pg[2] & 0x4) { /* TEST bit set */ - arr[4] = THRESHOLD_EXCEEDED; - arr[5] = 0xff; - } - return sizeof(ie_l_pg); -} - -#define SDEBUG_MAX_LSENSE_SZ 512 - -static int resp_log_sense(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) -{ - int ppc, sp, pcontrol, pcode, alloc_len, errsts, len, n; - unsigned char arr[SDEBUG_MAX_LSENSE_SZ]; - unsigned char *cmd = (unsigned char *)scp->cmnd; - - if ((errsts = check_readiness(scp, 1, devip))) - return errsts; - memset(arr, 0, sizeof(arr)); - ppc = cmd[1] & 0x2; - sp = cmd[1] & 0x1; - if (ppc || sp) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_FIELD_IN_CDB, 0); - return check_condition_result; - } - pcontrol = (cmd[2] & 0xc0) >> 6; - pcode = cmd[2] & 0x3f; - alloc_len = (cmd[7] << 8) + cmd[8]; - arr[0] = pcode; - switch (pcode) { - case 0x0: /* Supported log pages log page */ - n = 4; - arr[n++] = 0x0; /* this page */ - arr[n++] = 0xd; /* Temperature */ - arr[n++] = 0x2f; /* Informational exceptions */ - arr[3] = n - 4; - break; - case 0xd: /* Temperature log page */ - arr[3] = resp_temp_l_pg(arr + 4); - break; - case 0x2f: /* Informational exceptions log page */ - arr[3] = resp_ie_l_pg(arr + 4); - break; - default: - mk_sense_buffer(devip, ILLEGAL_REQUEST, - INVALID_FIELD_IN_CDB, 0); - return check_condition_result; - } - len = min(((arr[2] << 8) + arr[3]) + 4, alloc_len); - return fill_from_dev_buffer(scp, arr, - min(len, SDEBUG_MAX_INQ_ARR_SZ)); -} - -static int resp_read(struct scsi_cmnd * SCpnt, unsigned long long lba, - unsigned int num, struct sdebug_dev_info * devip) +static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block, + int num, struct sdebug_dev_info * devip) { unsigned long iflags; - unsigned int block, from_bottom; - unsigned long long u; int ret; - if (lba + num > sdebug_capacity) { + if (upper_blk || (block + num > sdebug_capacity)) { mk_sense_buffer(devip, ILLEGAL_REQUEST, ADDR_OUT_OF_RANGE, 0); return check_condition_result; } - /* transfer length excessive (tie in to block limits VPD page) */ - if (num > sdebug_store_sectors) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, - 0); - return check_condition_result; - } if ((SCSI_DEBUG_OPT_MEDIUM_ERR & scsi_debug_opts) && - (lba <= OPT_MEDIUM_ERR_ADDR) && - ((lba + num) > OPT_MEDIUM_ERR_ADDR)) { - /* claim unrecoverable read error */ + (block <= OPT_MEDIUM_ERR_ADDR) && + ((block + num) > OPT_MEDIUM_ERR_ADDR)) { mk_sense_buffer(devip, MEDIUM_ERROR, UNRECOVERED_READ_ERR, 0); - /* set info field and valid bit for fixed descriptor */ - if (0x70 == (devip->sense_buff[0] & 0x7f)) { - devip->sense_buff[0] |= 0x80; /* Valid bit */ - ret = OPT_MEDIUM_ERR_ADDR; - devip->sense_buff[3] = (ret >> 24) & 0xff; - devip->sense_buff[4] = (ret >> 16) & 0xff; - devip->sense_buff[5] = (ret >> 8) & 0xff; - devip->sense_buff[6] = ret & 0xff; - } + /* claim unrecoverable read error */ return check_condition_result; } read_lock_irqsave(&atomic_rw, iflags); - if ((lba + num) <= sdebug_store_sectors) - ret = fill_from_dev_buffer(SCpnt, - fake_storep + (lba * SECT_SIZE), - num * SECT_SIZE); - else { - /* modulo when one arg is 64 bits needs do_div() */ - u = lba; - block = do_div(u, sdebug_store_sectors); - from_bottom = 0; - if ((block + num) > sdebug_store_sectors) - from_bottom = (block + num) - sdebug_store_sectors; - ret = fill_from_dev_buffer(SCpnt, - fake_storep + (block * SECT_SIZE), - (num - from_bottom) * SECT_SIZE); - if ((0 == ret) && (from_bottom > 0)) - ret = fill_from_dev_buffer(SCpnt, fake_storep, - from_bottom * SECT_SIZE); - } + ret = fill_from_dev_buffer(SCpnt, fake_storep + (block * SECT_SIZE), + num * SECT_SIZE); read_unlock_irqrestore(&atomic_rw, iflags); return ret; } -static int resp_write(struct scsi_cmnd * SCpnt, unsigned long long lba, - unsigned int num, struct sdebug_dev_info * devip) +static int resp_write(struct scsi_cmnd * SCpnt, int upper_blk, int block, + int num, struct sdebug_dev_info * devip) { unsigned long iflags; - unsigned int block, to_bottom; - unsigned long long u; int res; - if (lba + num > sdebug_capacity) { + if (upper_blk || (block + num > sdebug_capacity)) { mk_sense_buffer(devip, ILLEGAL_REQUEST, ADDR_OUT_OF_RANGE, 0); return check_condition_result; } - /* transfer length excessive (tie in to block limits VPD page) */ - if (num > sdebug_store_sectors) { - mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, - 0); - return check_condition_result; - } write_lock_irqsave(&atomic_rw, iflags); - if ((lba + num) <= sdebug_store_sectors) - res = fetch_to_dev_buffer(SCpnt, - fake_storep + (lba * SECT_SIZE), - num * SECT_SIZE); - else { - /* modulo when one arg is 64 bits needs do_div() */ - u = lba; - block = do_div(u, sdebug_store_sectors); - to_bottom = 0; - if ((block + num) > sdebug_store_sectors) - to_bottom = (block + num) - sdebug_store_sectors; - res = fetch_to_dev_buffer(SCpnt, - fake_storep + (block * SECT_SIZE), - (num - to_bottom) * SECT_SIZE); - if ((0 == res) && (to_bottom > 0)) - res = fetch_to_dev_buffer(SCpnt, fake_storep, - to_bottom * SECT_SIZE); - } + res = fetch_to_dev_buffer(SCpnt, fake_storep + (block * SECT_SIZE), + num * SECT_SIZE); write_unlock_irqrestore(&atomic_rw, iflags); if (-1 == res) return (DID_ERROR << 16); else if ((res < (num * SECT_SIZE)) && (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)) - printk(KERN_INFO "scsi_debug: write: cdb indicated=%u, " + printk(KERN_INFO "scsi_debug: write: cdb indicated=%d, " " IO sent=%d bytes\n", num * SECT_SIZE, res); return 0; } -#define SDEBUG_RLUN_ARR_SZ 256 +#define SDEBUG_RLUN_ARR_SZ 128 static int resp_report_luns(struct scsi_cmnd * scp, struct sdebug_dev_info * devip) { unsigned int alloc_len; - int lun_cnt, i, upper, num, n, wlun, lun; + int lun_cnt, i, upper; unsigned char *cmd = (unsigned char *)scp->cmnd; int select_report = (int)cmd[2]; struct scsi_lun *one_lun; unsigned char arr[SDEBUG_RLUN_ARR_SZ]; - unsigned char * max_addr; alloc_len = cmd[9] + (cmd[8] << 8) + (cmd[7] << 16) + (cmd[6] << 24); - if ((alloc_len < 4) || (select_report > 2)) { + if ((alloc_len < 16) || (select_report > 2)) { mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, 0); return check_condition_result; @@ -1716,37 +955,18 @@ static int resp_report_luns(struct scsi_cmnd * scp, /* can produce response with up to 16k luns (lun 0 to lun 16383) */ memset(arr, 0, SDEBUG_RLUN_ARR_SZ); lun_cnt = scsi_debug_max_luns; - if (1 == select_report) - lun_cnt = 0; - else if (scsi_debug_no_lun_0 && (lun_cnt > 0)) - --lun_cnt; - wlun = (select_report > 0) ? 1 : 0; - num = lun_cnt + wlun; - arr[2] = ((sizeof(struct scsi_lun) * num) >> 8) & 0xff; - arr[3] = (sizeof(struct scsi_lun) * num) & 0xff; - n = min((int)((SDEBUG_RLUN_ARR_SZ - 8) / - sizeof(struct scsi_lun)), num); - if (n < num) { - wlun = 0; - lun_cnt = n; - } + arr[2] = ((sizeof(struct scsi_lun) * lun_cnt) >> 8) & 0xff; + arr[3] = (sizeof(struct scsi_lun) * lun_cnt) & 0xff; + lun_cnt = min((int)((SDEBUG_RLUN_ARR_SZ - 8) / + sizeof(struct scsi_lun)), lun_cnt); one_lun = (struct scsi_lun *) &arr[8]; - max_addr = arr + SDEBUG_RLUN_ARR_SZ; - for (i = 0, lun = (scsi_debug_no_lun_0 ? 1 : 0); - ((i < lun_cnt) && ((unsigned char *)(one_lun + i) < max_addr)); - i++, lun++) { - upper = (lun >> 8) & 0x3f; + for (i = 0; i < lun_cnt; i++) { + upper = (i >> 8) & 0x3f; if (upper) one_lun[i].scsi_lun[0] = (upper | (SAM2_LUN_ADDRESS_METHOD << 6)); - one_lun[i].scsi_lun[1] = lun & 0xff; - } - if (wlun) { - one_lun[i].scsi_lun[0] = (SAM2_WLUN_REPORT_LUNS >> 8) & 0xff; - one_lun[i].scsi_lun[1] = SAM2_WLUN_REPORT_LUNS & 0xff; - i++; + one_lun[i].scsi_lun[1] = i & 0xff; } - alloc_len = (unsigned char *)(one_lun + i) - arr; return fill_from_dev_buffer(scp, arr, min((int)alloc_len, SDEBUG_RLUN_ARR_SZ)); } @@ -1782,8 +1002,7 @@ static void timer_intr_handler(unsigned long indx) static int scsi_debug_slave_alloc(struct scsi_device * sdp) { if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) - printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %u>\n", - sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); + sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_alloc\n"); return 0; } @@ -1792,8 +1011,7 @@ static int scsi_debug_slave_configure(struct scsi_device * sdp) struct sdebug_dev_info * devip; if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) - printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %u>\n", - sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); + sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_configure\n"); if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN) sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN; devip = devInfoReg(sdp); @@ -1801,7 +1019,6 @@ static int scsi_debug_slave_configure(struct scsi_device * sdp) if (sdp->host->cmd_per_lun) scsi_adjust_queue_depth(sdp, SDEBUG_TAGGED_QUEUING, sdp->host->cmd_per_lun); - blk_queue_max_segment_size(sdp->request_queue, 256 * 1024); return 0; } @@ -1811,8 +1028,7 @@ static void scsi_debug_slave_destroy(struct scsi_device * sdp) (struct sdebug_dev_info *)sdp->hostdata; if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) - printk(KERN_INFO "scsi_debug: slave_destroy <%u %u %u %u>\n", - sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); + sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_destroy\n"); if (devip) { /* make this slot avaliable for re-use */ devip->used = 0; @@ -1869,8 +1085,6 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev) open_devip->sense_buff[0] = 0x70; open_devip->sense_buff[7] = 0xa; } - if (sdev->lun == SAM2_WLUN_REPORT_LUNS) - open_devip->wlun = SAM2_WLUN_REPORT_LUNS & 0xff; return open_devip; } return NULL; @@ -2059,7 +1273,7 @@ static void __init sdebug_build_parts(unsigned char * ramp) printk(KERN_WARNING "scsi_debug:build_parts: reducing " "partitions to %d\n", SDEBUG_MAX_PARTS); } - num_sectors = (int)sdebug_store_sectors; + num_sectors = (int)(sdebug_store_size / SECT_SIZE); sectors_per_part = (num_sectors - sdebug_sectors_per) / scsi_debug_num_parts; heads_by_sects = sdebug_heads * sdebug_sectors_per; @@ -2102,9 +1316,9 @@ static int schedule_resp(struct scsi_cmnd * cmnd, if (scsi_result) { struct scsi_device * sdp = cmnd->device; - printk(KERN_INFO "scsi_debug: <%u %u %u %u> " - "non-zero result=0x%x\n", sdp->host->host_no, - sdp->channel, sdp->id, sdp->lun, scsi_result); + sdev_printk(KERN_INFO, sdp, + "non-zero result=0x%x\n", + scsi_result); } } if (cmnd && devip) { @@ -2151,19 +1365,21 @@ static int schedule_resp(struct scsi_cmnd * cmnd, } } -module_param_named(add_host, scsi_debug_add_host, int, S_IRUGO | S_IWUSR); -module_param_named(delay, scsi_debug_delay, int, S_IRUGO | S_IWUSR); -module_param_named(dev_size_mb, scsi_debug_dev_size_mb, int, S_IRUGO); -module_param_named(dsense, scsi_debug_dsense, int, S_IRUGO | S_IWUSR); -module_param_named(every_nth, scsi_debug_every_nth, int, S_IRUGO | S_IWUSR); -module_param_named(max_luns, scsi_debug_max_luns, int, S_IRUGO | S_IWUSR); -module_param_named(no_lun_0, scsi_debug_no_lun_0, int, S_IRUGO | S_IWUSR); -module_param_named(num_parts, scsi_debug_num_parts, int, S_IRUGO); -module_param_named(num_tgts, scsi_debug_num_tgts, int, S_IRUGO | S_IWUSR); -module_param_named(opts, scsi_debug_opts, int, S_IRUGO | S_IWUSR); -module_param_named(ptype, scsi_debug_ptype, int, S_IRUGO | S_IWUSR); -module_param_named(scsi_level, scsi_debug_scsi_level, int, S_IRUGO); -module_param_named(virtual_gb, scsi_debug_virtual_gb, int, S_IRUGO | S_IWUSR); +/* Set 'perm' (4th argument) to 0 to disable module_param's definition + * of sysfs parameters (which module_param doesn't yet support). + * Sysfs parameters defined explicitly below. + */ +module_param_named(add_host, scsi_debug_add_host, int, 0); /* perm=0644 */ +module_param_named(delay, scsi_debug_delay, int, 0); /* perm=0644 */ +module_param_named(dev_size_mb, scsi_debug_dev_size_mb, int, 0); +module_param_named(dsense, scsi_debug_dsense, int, 0); +module_param_named(every_nth, scsi_debug_every_nth, int, 0); +module_param_named(max_luns, scsi_debug_max_luns, int, 0); +module_param_named(num_parts, scsi_debug_num_parts, int, 0); +module_param_named(num_tgts, scsi_debug_num_tgts, int, 0); +module_param_named(opts, scsi_debug_opts, int, 0); /* perm=0644 */ +module_param_named(ptype, scsi_debug_ptype, int, 0); +module_param_named(scsi_level, scsi_debug_scsi_level, int, 0); MODULE_AUTHOR("Eric Youngdale + Douglas Gilbert"); MODULE_DESCRIPTION("SCSI debug adapter driver"); @@ -2172,17 +1388,15 @@ MODULE_VERSION(SCSI_DEBUG_VERSION); MODULE_PARM_DESC(add_host, "0..127 hosts allowed(def=1)"); MODULE_PARM_DESC(delay, "# of jiffies to delay response(def=1)"); -MODULE_PARM_DESC(dev_size_mb, "size in MB of ram shared by devs(def=8)"); -MODULE_PARM_DESC(dsense, "use descriptor sense format(def=0 -> fixed)"); +MODULE_PARM_DESC(dev_size_mb, "size in MB of ram shared by devs"); +MODULE_PARM_DESC(dsense, "use descriptor sense format(def: fixed)"); MODULE_PARM_DESC(every_nth, "timeout every nth command(def=100)"); -MODULE_PARM_DESC(max_luns, "number of LUNs per target to simulate(def=1)"); -MODULE_PARM_DESC(no_lun_0, "no LU number 0 (def=0 -> have lun 0)"); +MODULE_PARM_DESC(max_luns, "number of SCSI LUNs per target to simulate"); MODULE_PARM_DESC(num_parts, "number of partitions(def=0)"); -MODULE_PARM_DESC(num_tgts, "number of targets per host to simulate(def=1)"); -MODULE_PARM_DESC(opts, "1->noise, 2->medium_error, 4->... (def=0)"); +MODULE_PARM_DESC(num_tgts, "number of SCSI targets per host to simulate"); +MODULE_PARM_DESC(opts, "1->noise, 2->medium_error, 4->..."); MODULE_PARM_DESC(ptype, "SCSI peripheral type(def=0[disk])"); MODULE_PARM_DESC(scsi_level, "SCSI level to simulate(def=5[SPC-3])"); -MODULE_PARM_DESC(virtual_gb, "virtual gigabyte size (def=0 -> use dev_size_mb)"); static char sdebug_info[256]; @@ -2334,24 +1548,6 @@ static ssize_t sdebug_dsense_store(struct device_driver * ddp, DRIVER_ATTR(dsense, S_IRUGO | S_IWUSR, sdebug_dsense_show, sdebug_dsense_store); -static ssize_t sdebug_no_lun_0_show(struct device_driver * ddp, char * buf) -{ - return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_no_lun_0); -} -static ssize_t sdebug_no_lun_0_store(struct device_driver * ddp, - const char * buf, size_t count) -{ - int n; - - if ((count > 0) && (1 == sscanf(buf, "%d", &n)) && (n >= 0)) { - scsi_debug_no_lun_0 = n; - return count; - } - return -EINVAL; -} -DRIVER_ATTR(no_lun_0, S_IRUGO | S_IWUSR, sdebug_no_lun_0_show, - sdebug_no_lun_0_store); - static ssize_t sdebug_num_tgts_show(struct device_driver * ddp, char * buf) { return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_num_tgts); @@ -2427,29 +1623,6 @@ static ssize_t sdebug_scsi_level_show(struct device_driver * ddp, char * buf) } DRIVER_ATTR(scsi_level, S_IRUGO, sdebug_scsi_level_show, NULL); -static ssize_t sdebug_virtual_gb_show(struct device_driver * ddp, char * buf) -{ - return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_virtual_gb); -} -static ssize_t sdebug_virtual_gb_store(struct device_driver * ddp, - const char * buf, size_t count) -{ - int n; - - if ((count > 0) && (1 == sscanf(buf, "%d", &n)) && (n >= 0)) { - scsi_debug_virtual_gb = n; - if (scsi_debug_virtual_gb > 0) { - sdebug_capacity = 2048 * 1024; - sdebug_capacity *= scsi_debug_virtual_gb; - } else - sdebug_capacity = sdebug_store_sectors; - return count; - } - return -EINVAL; -} -DRIVER_ATTR(virtual_gb, S_IRUGO | S_IWUSR, sdebug_virtual_gb_show, - sdebug_virtual_gb_store); - static ssize_t sdebug_add_host_show(struct device_driver * ddp, char * buf) { return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_add_host); @@ -2519,19 +1692,14 @@ static void do_remove_driverfs_files(void) static int __init scsi_debug_init(void) { - unsigned int sz; + unsigned long sz; int host_to_add; int k; if (scsi_debug_dev_size_mb < 1) scsi_debug_dev_size_mb = 1; /* force minimum 1 MB ramdisk */ - sdebug_store_size = (unsigned int)scsi_debug_dev_size_mb * 1048576; - sdebug_store_sectors = sdebug_store_size / SECT_SIZE; - if (scsi_debug_virtual_gb > 0) { - sdebug_capacity = 2048 * 1024; - sdebug_capacity *= scsi_debug_virtual_gb; - } else - sdebug_capacity = sdebug_store_sectors; + sdebug_store_size = (unsigned long)scsi_debug_dev_size_mb * 1048576; + sdebug_capacity = sdebug_store_size / SECT_SIZE; /* play around with geometry, don't waste too much on track 0 */ sdebug_heads = 8; @@ -2645,7 +1813,7 @@ static int sdebug_add_adapter(void) struct sdebug_dev_info *sdbg_devinfo; struct list_head *lh, *lh_sf; - sdbg_host = kzalloc(sizeof(*sdbg_host),GFP_KERNEL); + sdbg_host = kzalloc(sizeof(*sdbg_host), GFP_KERNEL); if (NULL == sdbg_host) { printk(KERN_ERR "%s: out of memory at line %d\n", @@ -2657,7 +1825,7 @@ static int sdebug_add_adapter(void) devs_per_host = scsi_debug_num_tgts * scsi_debug_max_luns; for (k = 0; k < devs_per_host; k++) { - sdbg_devinfo = kzalloc(sizeof(*sdbg_devinfo),GFP_KERNEL); + sdbg_devinfo = kzalloc(sizeof(*sdbg_devinfo), GFP_KERNEL); if (NULL == sdbg_devinfo) { printk(KERN_ERR "%s: out of memory at line %d\n", __FUNCTION__, __LINE__); @@ -2738,7 +1906,7 @@ static int sdebug_driver_probe(struct device * dev) hpnt->max_id = scsi_debug_num_tgts + 1; else hpnt->max_id = scsi_debug_num_tgts; - hpnt->max_lun = SAM2_WLUN_REPORT_LUNS; /* = scsi_debug_max_luns; */ + hpnt->max_lun = scsi_debug_max_luns; error = scsi_add_host(hpnt, &sdbg_host->dev); if (error) { @@ -2792,7 +1960,7 @@ static void sdebug_max_tgts_luns(void) hpnt->max_id = scsi_debug_num_tgts + 1; else hpnt->max_id = scsi_debug_num_tgts; - hpnt->max_lun = SAM2_WLUN_REPORT_LUNS; /* scsi_debug_max_luns; */ + hpnt->max_lun = scsi_debug_max_luns; } spin_unlock(&sdebug_host_list_lock); } diff --git a/trunk/drivers/scsi/scsi_devinfo.c b/trunk/drivers/scsi/scsi_devinfo.c index 3d0429bc14ab..fb5cb4c9ac65 100644 --- a/trunk/drivers/scsi/scsi_devinfo.c +++ b/trunk/drivers/scsi/scsi_devinfo.c @@ -162,7 +162,7 @@ static struct { {"HITACHI", "DISK-SUBSYSTEM", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN}, {"HITACHI", "OPEN-E", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN}, {"HP", "A6189A", NULL, BLIST_SPARSELUN | BLIST_LARGELUN}, /* HP VA7400 */ - {"HP", "OPEN-", "*", BLIST_REPORTLUN2}, /* HP XP Arrays */ + {"HP", "OPEN-", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, /* HP XP Arrays */ {"HP", "NetRAID-4M", NULL, BLIST_FORCELUN}, {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD}, {"HP", "C1557A", NULL, BLIST_FORCELUN}, diff --git a/trunk/drivers/scsi/scsi_error.c b/trunk/drivers/scsi/scsi_error.c index 6683d596234a..6a7a60fc0a4e 100644 --- a/trunk/drivers/scsi/scsi_error.c +++ b/trunk/drivers/scsi/scsi_error.c @@ -1672,9 +1672,7 @@ int scsi_reset_provider(struct scsi_device *dev, int flag) { struct scsi_cmnd *scmd = scsi_get_command(dev, GFP_KERNEL); - struct Scsi_Host *shost = dev->host; struct request req; - unsigned long flags; int rtn; scmd->request = &req; @@ -1701,10 +1699,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag) */ scmd->pid = 0; - spin_lock_irqsave(shost->host_lock, flags); - shost->tmf_in_progress = 1; - spin_unlock_irqrestore(shost->host_lock, flags); - switch (flag) { case SCSI_TRY_RESET_DEVICE: rtn = scsi_try_bus_device_reset(scmd); @@ -1723,22 +1717,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag) rtn = FAILED; } - spin_lock_irqsave(shost->host_lock, flags); - shost->tmf_in_progress = 0; - spin_unlock_irqrestore(shost->host_lock, flags); - - /* - * be sure to wake up anyone who was sleeping or had their queue - * suspended while we performed the TMF. - */ - SCSI_LOG_ERROR_RECOVERY(3, - printk("%s: waking up host to restart after TMF\n", - __FUNCTION__)); - - wake_up(&shost->host_wait); - - scsi_run_host_queues(shost); - scsi_next_command(scmd); return rtn; } diff --git a/trunk/drivers/scsi/scsi_lib.c b/trunk/drivers/scsi/scsi_lib.c index 08af9aae7df3..3d04a9f386ac 100644 --- a/trunk/drivers/scsi/scsi_lib.c +++ b/trunk/drivers/scsi/scsi_lib.c @@ -855,7 +855,8 @@ static void scsi_release_buffers(struct scsi_cmnd *cmd) * b) We can just use scsi_requeue_command() here. This would * be used if we just wanted to retry, for example. */ -void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) +void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes, + unsigned int block_bytes) { int result = cmd->result; int this_count = cmd->bufflen; @@ -920,70 +921,87 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) * Next deal with any sectors which we were able to correctly * handle. */ - SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, " - "%d bytes done.\n", - req->nr_sectors, good_bytes)); - SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg)); + if (good_bytes >= 0) { + SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, %d bytes done.\n", + req->nr_sectors, good_bytes)); + SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg)); - if (clear_errors) - req->errors = 0; - - /* A number of bytes were successfully read. If there - * are leftovers and there is some kind of error - * (result != 0), retry the rest. - */ - if (scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL) - return; + if (clear_errors) + req->errors = 0; + /* + * If multiple sectors are requested in one buffer, then + * they will have been finished off by the first command. + * If not, then we have a multi-buffer command. + * + * If block_bytes != 0, it means we had a medium error + * of some sort, and that we want to mark some number of + * sectors as not uptodate. Thus we want to inhibit + * requeueing right here - we will requeue down below + * when we handle the bad sectors. + */ - /* good_bytes = 0, or (inclusive) there were leftovers and - * result = 0, so scsi_end_request couldn't retry. + /* + * If the command completed without error, then either + * finish off the rest of the command, or start a new one. + */ + if (scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL) + return; + } + /* + * Now, if we were good little boys and girls, Santa left us a request + * sense buffer. We can extract information from this, so we + * can choose a block to remap, etc. */ if (sense_valid && !sense_deferred) { switch (sshdr.sense_key) { case UNIT_ATTENTION: if (cmd->device->removable) { - /* Detected disc change. Set a bit + /* detected disc change. set a bit * and quietly refuse further access. */ cmd->device->changed = 1; - scsi_end_request(cmd, 0, this_count, 1); + scsi_end_request(cmd, 0, + this_count, 1); return; } else { - /* Must have been a power glitch, or a - * bus reset. Could not have been a - * media change, so we just retry the - * request and see what happens. - */ + /* + * Must have been a power glitch, or a + * bus reset. Could not have been a + * media change, so we just retry the + * request and see what happens. + */ scsi_requeue_command(q, cmd); return; } break; case ILLEGAL_REQUEST: - /* If we had an ILLEGAL REQUEST returned, then - * we may have performed an unsupported - * command. The only thing this should be - * would be a ten byte read where only a six - * byte read was supported. Also, on a system - * where READ CAPACITY failed, we may have - * read past the end of the disk. - */ + /* + * If we had an ILLEGAL REQUEST returned, then we may + * have performed an unsupported command. The only + * thing this should be would be a ten byte read where + * only a six byte read was supported. Also, on a + * system where READ CAPACITY failed, we may have read + * past the end of the disk. + */ if ((cmd->device->use_10_for_rw && sshdr.asc == 0x20 && sshdr.ascq == 0x00) && (cmd->cmnd[0] == READ_10 || cmd->cmnd[0] == WRITE_10)) { cmd->device->use_10_for_rw = 0; - /* This will cause a retry with a - * 6-byte command. + /* + * This will cause a retry with a 6-byte + * command. */ scsi_requeue_command(q, cmd); - return; + result = 0; } else { scsi_end_request(cmd, 0, this_count, 1); return; } break; case NOT_READY: - /* If the device is in the process of becoming + /* + * If the device is in the process of becoming * ready, or has a temporary blockage, retry. */ if (sshdr.asc == 0x04) { @@ -1003,7 +1021,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) } if (!(req->flags & REQ_QUIET)) { scmd_printk(KERN_INFO, cmd, - "Device not ready: "); + "Device not ready: "); scsi_print_sense_hdr("", &sshdr); } scsi_end_request(cmd, 0, this_count, 1); @@ -1011,21 +1029,21 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) case VOLUME_OVERFLOW: if (!(req->flags & REQ_QUIET)) { scmd_printk(KERN_INFO, cmd, - "Volume overflow, CDB: "); + "Volume overflow, CDB: "); __scsi_print_command(cmd->data_cmnd); scsi_print_sense("", cmd); } - /* See SSC3rXX or current. */ - scsi_end_request(cmd, 0, this_count, 1); + scsi_end_request(cmd, 0, block_bytes, 1); return; default: break; } - } + } /* driver byte != 0 */ if (host_byte(result) == DID_RESET) { - /* Third party bus reset or reset for error recovery - * reasons. Just retry the request and see what - * happens. + /* + * Third party bus reset or reset for error + * recovery reasons. Just retry the request + * and see what happens. */ scsi_requeue_command(q, cmd); return; @@ -1033,13 +1051,21 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) if (result) { if (!(req->flags & REQ_QUIET)) { scmd_printk(KERN_INFO, cmd, - "SCSI error: return code = 0x%08x\n", - result); + "SCSI error: return code = 0x%x\n", result); + if (driver_byte(result) & DRIVER_SENSE) scsi_print_sense("", cmd); } + /* + * Mark a single buffer as not uptodate. Queue the remainder. + * We sometimes get this cruft in the event that a medium error + * isn't properly reported. + */ + block_bytes = req->hard_cur_sectors << 9; + if (!block_bytes) + block_bytes = req->data_len; + scsi_end_request(cmd, 0, block_bytes, 1); } - scsi_end_request(cmd, 0, this_count, !result); } EXPORT_SYMBOL(scsi_io_completion); @@ -1143,7 +1169,7 @@ static void scsi_blk_pc_done(struct scsi_cmnd *cmd) * successfully. Since this is a REQ_BLOCK_PC command the * caller should check the request's errors value */ - scsi_io_completion(cmd, cmd->bufflen); + scsi_io_completion(cmd, cmd->bufflen, 0); } static void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd) @@ -2024,7 +2050,6 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) switch (oldstate) { case SDEV_CREATED: case SDEV_RUNNING: - case SDEV_QUIESCE: case SDEV_OFFLINE: case SDEV_BLOCK: break; @@ -2035,9 +2060,6 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) case SDEV_DEL: switch (oldstate) { - case SDEV_CREATED: - case SDEV_RUNNING: - case SDEV_OFFLINE: case SDEV_CANCEL: break; default: diff --git a/trunk/drivers/scsi/scsi_logging.h b/trunk/drivers/scsi/scsi_logging.h index 1f65139e14f8..a3e2af6a846c 100644 --- a/trunk/drivers/scsi/scsi_logging.h +++ b/trunk/drivers/scsi/scsi_logging.h @@ -1,6 +1,7 @@ #ifndef _SCSI_LOGGING_H #define _SCSI_LOGGING_H +#include /* * This defines the scsi logging feature. It is a means by which the user diff --git a/trunk/drivers/scsi/scsi_priv.h b/trunk/drivers/scsi/scsi_priv.h index e2fbe9a9d5a9..a1727a0e1bdd 100644 --- a/trunk/drivers/scsi/scsi_priv.h +++ b/trunk/drivers/scsi/scsi_priv.h @@ -1,6 +1,7 @@ #ifndef _SCSI_PRIV_H #define _SCSI_PRIV_H +#include #include struct request_queue; @@ -116,7 +117,7 @@ extern struct bus_type scsi_bus_type; * classes. */ -#define SCSI_DEVICE_BLOCK_MAX_TIMEOUT 600 /* units in seconds */ +#define SCSI_DEVICE_BLOCK_MAX_TIMEOUT (HZ*60) extern int scsi_internal_device_block(struct scsi_device *sdev); extern int scsi_internal_device_unblock(struct scsi_device *sdev); diff --git a/trunk/drivers/scsi/scsi_sas_internal.h b/trunk/drivers/scsi/scsi_sas_internal.h index e1edab45a37b..d76e6e3d8ca5 100644 --- a/trunk/drivers/scsi/scsi_sas_internal.h +++ b/trunk/drivers/scsi/scsi_sas_internal.h @@ -2,8 +2,7 @@ #define _SCSI_SAS_INTERNAL_H #define SAS_HOST_ATTRS 0 -#define SAS_PHY_ATTRS 17 -#define SAS_PORT_ATTRS 1 +#define SAS_PORT_ATTRS 17 #define SAS_RPORT_ATTRS 7 #define SAS_END_DEV_ATTRS 3 #define SAS_EXPANDER_ATTRS 7 @@ -14,14 +13,12 @@ struct sas_internal { struct sas_domain_function_template *dft; struct class_device_attribute private_host_attrs[SAS_HOST_ATTRS]; - struct class_device_attribute private_phy_attrs[SAS_PHY_ATTRS]; - struct class_device_attribute private_port_attrs[SAS_PORT_ATTRS]; + struct class_device_attribute private_phy_attrs[SAS_PORT_ATTRS]; struct class_device_attribute private_rphy_attrs[SAS_RPORT_ATTRS]; struct class_device_attribute private_end_dev_attrs[SAS_END_DEV_ATTRS]; struct class_device_attribute private_expander_attrs[SAS_EXPANDER_ATTRS]; struct transport_container phy_attr_cont; - struct transport_container port_attr_cont; struct transport_container rphy_attr_cont; struct transport_container end_dev_attr_cont; struct transport_container expander_attr_cont; @@ -31,8 +28,7 @@ struct sas_internal { * needed by scsi_sysfs.c */ struct class_device_attribute *host_attrs[SAS_HOST_ATTRS + 1]; - struct class_device_attribute *phy_attrs[SAS_PHY_ATTRS + 1]; - struct class_device_attribute *port_attrs[SAS_PORT_ATTRS + 1]; + struct class_device_attribute *phy_attrs[SAS_PORT_ATTRS + 1]; struct class_device_attribute *rphy_attrs[SAS_RPORT_ATTRS + 1]; struct class_device_attribute *end_dev_attrs[SAS_END_DEV_ATTRS + 1]; struct class_device_attribute *expander_attrs[SAS_EXPANDER_ATTRS + 1]; diff --git a/trunk/drivers/scsi/scsi_scan.c b/trunk/drivers/scsi/scsi_scan.c index 1bd92b9b46d9..0f7e6f94d66b 100644 --- a/trunk/drivers/scsi/scsi_scan.c +++ b/trunk/drivers/scsi/scsi_scan.c @@ -25,6 +25,7 @@ * or a LUN is seen that cannot have a device attached to it. */ +#include #include #include #include @@ -809,7 +810,6 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags) static inline void scsi_destroy_sdev(struct scsi_device *sdev) { - scsi_device_set_state(sdev, SDEV_DEL); if (sdev->host->hostt->slave_destroy) sdev->host->hostt->slave_destroy(sdev); transport_destroy_device(&sdev->sdev_gendev); diff --git a/trunk/drivers/scsi/scsi_sysfs.c b/trunk/drivers/scsi/scsi_sysfs.c index e7fe565b96de..5ec7a4fb0145 100644 --- a/trunk/drivers/scsi/scsi_sysfs.c +++ b/trunk/drivers/scsi/scsi_sysfs.c @@ -6,6 +6,7 @@ * Created to pull SCSI mid layer sysfs routines into one file. */ +#include #include #include #include diff --git a/trunk/drivers/scsi/scsi_transport_fc.c b/trunk/drivers/scsi/scsi_transport_fc.c index b03aa85108e5..f2db7a41cf1d 100644 --- a/trunk/drivers/scsi/scsi_transport_fc.c +++ b/trunk/drivers/scsi/scsi_transport_fc.c @@ -368,7 +368,7 @@ static DECLARE_TRANSPORT_CLASS(fc_rport_class, * should insulate the loss of a remote port. * The maximum will be capped by the value of SCSI_DEVICE_BLOCK_MAX_TIMEOUT. */ -static unsigned int fc_dev_loss_tmo = 60; /* seconds */ +static unsigned int fc_dev_loss_tmo = SCSI_DEVICE_BLOCK_MAX_TIMEOUT; module_param_named(dev_loss_tmo, fc_dev_loss_tmo, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(dev_loss_tmo, @@ -1284,9 +1284,7 @@ EXPORT_SYMBOL(fc_release_transport); * @work: Work to queue for execution. * * Return value: - * 1 - work queued for execution - * 0 - work is already queued - * -EINVAL - work queue doesn't exist + * 0 on success / != 0 for error **/ static int fc_queue_work(struct Scsi_Host *shost, struct work_struct *work) @@ -1436,6 +1434,8 @@ fc_starget_delete(void *data) struct Scsi_Host *shost = rport_to_shost(rport); unsigned long flags; + scsi_target_unblock(&rport->dev); + spin_lock_irqsave(shost->host_lock, flags); if (rport->flags & FC_RPORT_DEVLOSS_PENDING) { spin_unlock_irqrestore(shost->host_lock, flags); @@ -1476,8 +1476,7 @@ fc_rport_final_delete(void *data) transport_remove_device(dev); device_del(dev); transport_destroy_device(dev); - put_device(&shost->shost_gendev); /* for fc_host->rport list */ - put_device(dev); /* for self-reference */ + put_device(&shost->shost_gendev); } @@ -1538,13 +1537,13 @@ fc_rport_create(struct Scsi_Host *shost, int channel, else rport->scsi_target_id = -1; list_add_tail(&rport->peers, &fc_host->rports); - get_device(&shost->shost_gendev); /* for fc_host->rport list */ + get_device(&shost->shost_gendev); spin_unlock_irqrestore(shost->host_lock, flags); dev = &rport->dev; - device_initialize(dev); /* takes self reference */ - dev->parent = get_device(&shost->shost_gendev); /* parent reference */ + device_initialize(dev); + dev->parent = get_device(&shost->shost_gendev); dev->release = fc_rport_dev_release; sprintf(dev->bus_id, "rport-%d:%d-%d", shost->host_no, channel, rport->number); @@ -1568,9 +1567,10 @@ fc_rport_create(struct Scsi_Host *shost, int channel, delete_rport: transport_destroy_device(dev); + put_device(dev->parent); spin_lock_irqsave(shost->host_lock, flags); list_del(&rport->peers); - put_device(&shost->shost_gendev); /* for fc_host->rport list */ + put_device(&shost->shost_gendev); spin_unlock_irqrestore(shost->host_lock, flags); put_device(dev->parent); kfree(rport); @@ -1707,8 +1707,6 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel, spin_unlock_irqrestore(shost->host_lock, flags); - scsi_target_unblock(&rport->dev); - return rport; } } @@ -1764,10 +1762,9 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel, /* initiate a scan of the target */ rport->flags |= FC_RPORT_SCAN_PENDING; scsi_queue_work(shost, &rport->scan_work); - spin_unlock_irqrestore(shost->host_lock, flags); - scsi_target_unblock(&rport->dev); - } else - spin_unlock_irqrestore(shost->host_lock, flags); + } + + spin_unlock_irqrestore(shost->host_lock, flags); return rport; } @@ -1941,7 +1938,6 @@ fc_remote_port_rolechg(struct fc_rport *rport, u32 roles) rport->flags |= FC_RPORT_SCAN_PENDING; scsi_queue_work(shost, &rport->scan_work); spin_unlock_irqrestore(shost->host_lock, flags); - scsi_target_unblock(&rport->dev); } } EXPORT_SYMBOL(fc_remote_port_rolechg); @@ -1974,9 +1970,8 @@ fc_timeout_deleted_rport(void *data) dev_printk(KERN_ERR, &rport->dev, "blocked FC remote port time out: no longer" " a FCP target, removing starget\n"); - spin_unlock_irqrestore(shost->host_lock, flags); - scsi_target_unblock(&rport->dev); fc_queue_work(shost, &rport->stgt_delete_work); + spin_unlock_irqrestore(shost->host_lock, flags); return; } @@ -2040,15 +2035,17 @@ fc_timeout_deleted_rport(void *data) * went away and didn't come back - we'll remove * all attached scsi devices. */ - spin_unlock_irqrestore(shost->host_lock, flags); - - scsi_target_unblock(&rport->dev); fc_queue_work(shost, &rport->stgt_delete_work); + + spin_unlock_irqrestore(shost->host_lock, flags); } /** * fc_scsi_scan_rport - called to perform a scsi scan on a remote port. * + * Will unblock the target (in case it went away and has now come back), + * then invoke a scan. + * * @data: remote port to be scanned. **/ static void @@ -2060,6 +2057,7 @@ fc_scsi_scan_rport(void *data) if ((rport->port_state == FC_PORTSTATE_ONLINE) && (rport->roles & FC_RPORT_ROLE_FCP_TARGET)) { + scsi_target_unblock(&rport->dev); scsi_scan_target(&rport->dev, rport->channel, rport->scsi_target_id, SCAN_WILD_CARD, 1); } diff --git a/trunk/drivers/scsi/scsi_transport_iscsi.c b/trunk/drivers/scsi/scsi_transport_iscsi.c index 7b9e8fa1a4e0..5569fdcfd621 100644 --- a/trunk/drivers/scsi/scsi_transport_iscsi.c +++ b/trunk/drivers/scsi/scsi_transport_iscsi.c @@ -228,11 +228,14 @@ static struct iscsi_cls_conn *iscsi_conn_lookup(uint32_t sid, uint32_t cid) static void iscsi_session_release(struct device *dev) { struct iscsi_cls_session *session = iscsi_dev_to_session(dev); + struct iscsi_transport *transport = session->transport; struct Scsi_Host *shost; shost = iscsi_session_to_shost(session); scsi_host_put(shost); + kfree(session->targetname); kfree(session); + module_put(transport->owner); } static int iscsi_is_session_dev(const struct device *dev) @@ -248,9 +251,10 @@ static int iscsi_user_scan(struct Scsi_Host *shost, uint channel, mutex_lock(&ihost->mutex); list_for_each_entry(session, &ihost->sessions, host_list) { - if ((channel == SCAN_WILD_CARD || channel == 0) && + if ((channel == SCAN_WILD_CARD || + channel == session->channel) && (id == SCAN_WILD_CARD || id == session->target_id)) - scsi_scan_target(&session->dev, 0, + scsi_scan_target(&session->dev, session->channel, session->target_id, lun, 1); } mutex_unlock(&ihost->mutex); @@ -287,92 +291,80 @@ void iscsi_block_session(struct iscsi_cls_session *session) } EXPORT_SYMBOL_GPL(iscsi_block_session); +/** + * iscsi_create_session - create iscsi class session + * @shost: scsi host + * @transport: iscsi transport + * + * This can be called from a LLD or iscsi_transport. + **/ struct iscsi_cls_session * -iscsi_alloc_session(struct Scsi_Host *shost, - struct iscsi_transport *transport) +iscsi_create_session(struct Scsi_Host *shost, + struct iscsi_transport *transport, int channel) { + struct iscsi_host *ihost; struct iscsi_cls_session *session; + int err; + + if (!try_module_get(transport->owner)) + return NULL; session = kzalloc(sizeof(*session) + transport->sessiondata_size, GFP_KERNEL); if (!session) - return NULL; - + goto module_put; session->transport = transport; session->recovery_tmo = 120; INIT_WORK(&session->recovery_work, session_recovery_timedout, session); INIT_LIST_HEAD(&session->host_list); INIT_LIST_HEAD(&session->sess_list); - /* this is released in the dev's release function */ - scsi_host_get(shost); - session->dev.parent = &shost->shost_gendev; - session->dev.release = iscsi_session_release; - device_initialize(&session->dev); if (transport->sessiondata_size) session->dd_data = &session[1]; - return session; -} -EXPORT_SYMBOL_GPL(iscsi_alloc_session); - -int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id) -{ - struct Scsi_Host *shost = iscsi_session_to_shost(session); - struct iscsi_host *ihost; - int err; + /* this is released in the dev's release function */ + scsi_host_get(shost); ihost = shost->shost_data; + session->sid = iscsi_session_nr++; - session->target_id = target_id; + session->channel = channel; + session->target_id = ihost->next_target_id++; snprintf(session->dev.bus_id, BUS_ID_SIZE, "session%u", session->sid); - err = device_add(&session->dev); + session->dev.parent = &shost->shost_gendev; + session->dev.release = iscsi_session_release; + err = device_register(&session->dev); if (err) { dev_printk(KERN_ERR, &session->dev, "iscsi: could not " "register session's dev\n"); - goto release_host; + goto free_session; } transport_register_device(&session->dev); mutex_lock(&ihost->mutex); list_add(&session->host_list, &ihost->sessions); mutex_unlock(&ihost->mutex); - return 0; -release_host: - scsi_host_put(shost); - return err; + return session; + +free_session: + kfree(session); +module_put: + module_put(transport->owner); + return NULL; } -EXPORT_SYMBOL_GPL(iscsi_add_session); + +EXPORT_SYMBOL_GPL(iscsi_create_session); /** - * iscsi_create_session - create iscsi class session - * @shost: scsi host - * @transport: iscsi transport + * iscsi_destroy_session - destroy iscsi session + * @session: iscsi_session * - * This can be called from a LLD or iscsi_transport. + * Can be called by a LLD or iscsi_transport. There must not be + * any running connections. **/ -struct iscsi_cls_session * -iscsi_create_session(struct Scsi_Host *shost, - struct iscsi_transport *transport, - unsigned int target_id) -{ - struct iscsi_cls_session *session; - - session = iscsi_alloc_session(shost, transport); - if (!session) - return NULL; - - if (iscsi_add_session(session, target_id)) { - iscsi_free_session(session); - return NULL; - } - return session; -} -EXPORT_SYMBOL_GPL(iscsi_create_session); - -void iscsi_remove_session(struct iscsi_cls_session *session) +int iscsi_destroy_session(struct iscsi_cls_session *session) { struct Scsi_Host *shost = iscsi_session_to_shost(session); struct iscsi_host *ihost = shost->shost_data; @@ -384,88 +376,19 @@ void iscsi_remove_session(struct iscsi_cls_session *session) list_del(&session->host_list); mutex_unlock(&ihost->mutex); - scsi_remove_target(&session->dev); - transport_unregister_device(&session->dev); - device_del(&session->dev); -} -EXPORT_SYMBOL_GPL(iscsi_remove_session); - -void iscsi_free_session(struct iscsi_cls_session *session) -{ - put_device(&session->dev); -} - -EXPORT_SYMBOL_GPL(iscsi_free_session); - -/** - * iscsi_destroy_session - destroy iscsi session - * @session: iscsi_session - * - * Can be called by a LLD or iscsi_transport. There must not be - * any running connections. - **/ -int iscsi_destroy_session(struct iscsi_cls_session *session) -{ - iscsi_remove_session(session); - iscsi_free_session(session); + device_unregister(&session->dev); return 0; } -EXPORT_SYMBOL_GPL(iscsi_destroy_session); - -static void mempool_zone_destroy(struct mempool_zone *zp) -{ - mempool_destroy(zp->pool); - kfree(zp); -} - -static void* -mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data) -{ - struct mempool_zone *zone = pool_data; - return alloc_skb(zone->size, gfp_mask); -} - -static void -mempool_zone_free_skb(void *element, void *pool_data) -{ - kfree_skb(element); -} - -static struct mempool_zone * -mempool_zone_init(unsigned max, unsigned size, unsigned hiwat) -{ - struct mempool_zone *zp; - - zp = kzalloc(sizeof(*zp), GFP_KERNEL); - if (!zp) - return NULL; - - zp->size = size; - zp->hiwat = hiwat; - INIT_LIST_HEAD(&zp->freequeue); - spin_lock_init(&zp->freelock); - atomic_set(&zp->allocated, 0); - - zp->pool = mempool_create(max, mempool_zone_alloc_skb, - mempool_zone_free_skb, zp); - if (!zp->pool) { - kfree(zp); - return NULL; - } - - return zp; -} +EXPORT_SYMBOL_GPL(iscsi_destroy_session); static void iscsi_conn_release(struct device *dev) { struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev); struct device *parent = conn->dev.parent; - mempool_zone_destroy(conn->z_pdu); - mempool_zone_destroy(conn->z_error); - + kfree(conn->persistent_address); kfree(conn); put_device(parent); } @@ -475,31 +398,6 @@ static int iscsi_is_conn_dev(const struct device *dev) return dev->release == iscsi_conn_release; } -static int iscsi_create_event_pools(struct iscsi_cls_conn *conn) -{ - conn->z_pdu = mempool_zone_init(Z_MAX_PDU, - NLMSG_SPACE(sizeof(struct iscsi_uevent) + - sizeof(struct iscsi_hdr) + - DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH), - Z_HIWAT_PDU); - if (!conn->z_pdu) { - dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate " - "pdu zone for new conn\n"); - return -ENOMEM; - } - - conn->z_error = mempool_zone_init(Z_MAX_ERROR, - NLMSG_SPACE(sizeof(struct iscsi_uevent)), - Z_HIWAT_ERROR); - if (!conn->z_error) { - dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate " - "error zone for new conn\n"); - mempool_zone_destroy(conn->z_pdu); - return -ENOMEM; - } - return 0; -} - /** * iscsi_create_conn - create iscsi class connection * @session: iscsi cls session @@ -532,12 +430,9 @@ iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid) conn->transport = transport; conn->cid = cid; - if (iscsi_create_event_pools(conn)) - goto free_conn; - /* this is released in the dev's release function */ if (!get_device(&session->dev)) - goto free_conn_pools; + goto free_conn; snprintf(conn->dev.bus_id, BUS_ID_SIZE, "connection%d:%u", session->sid, cid); @@ -554,8 +449,6 @@ iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid) release_parent_ref: put_device(&session->dev); -free_conn_pools: - free_conn: kfree(conn); return NULL; @@ -603,6 +496,20 @@ static inline struct list_head *skb_to_lh(struct sk_buff *skb) return (struct list_head *)&skb->cb; } +static void* +mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data) +{ + struct mempool_zone *zone = pool_data; + + return alloc_skb(zone->size, gfp_mask); +} + +static void +mempool_zone_free_skb(void *element, void *pool_data) +{ + kfree_skb(element); +} + static void mempool_zone_complete(struct mempool_zone *zone) { @@ -622,6 +529,37 @@ mempool_zone_complete(struct mempool_zone *zone) spin_unlock_irqrestore(&zone->freelock, flags); } +static struct mempool_zone * +mempool_zone_init(unsigned max, unsigned size, unsigned hiwat) +{ + struct mempool_zone *zp; + + zp = kzalloc(sizeof(*zp), GFP_KERNEL); + if (!zp) + return NULL; + + zp->size = size; + zp->hiwat = hiwat; + INIT_LIST_HEAD(&zp->freequeue); + spin_lock_init(&zp->freelock); + atomic_set(&zp->allocated, 0); + + zp->pool = mempool_create(max, mempool_zone_alloc_skb, + mempool_zone_free_skb, zp); + if (!zp->pool) { + kfree(zp); + return NULL; + } + + return zp; +} + +static void mempool_zone_destroy(struct mempool_zone *zp) +{ + mempool_destroy(zp->pool); + kfree(zp); +} + static struct sk_buff* mempool_zone_get_skb(struct mempool_zone *zone) { @@ -633,27 +571,6 @@ mempool_zone_get_skb(struct mempool_zone *zone) return skb; } -static int -iscsi_broadcast_skb(struct mempool_zone *zone, struct sk_buff *skb) -{ - unsigned long flags; - int rc; - - skb_get(skb); - rc = netlink_broadcast(nls, skb, 0, 1, GFP_KERNEL); - if (rc < 0) { - mempool_free(skb, zone->pool); - printk(KERN_ERR "iscsi: can not broadcast skb (%d)\n", rc); - return rc; - } - - spin_lock_irqsave(&zone->freelock, flags); - INIT_LIST_HEAD(skb_to_lh(skb)); - list_add(skb_to_lh(skb), &zone->freequeue); - spin_unlock_irqrestore(&zone->freelock, flags); - return 0; -} - static int iscsi_unicast_skb(struct mempool_zone *zone, struct sk_buff *skb, int pid) { @@ -749,7 +666,7 @@ void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error) ev->r.connerror.cid = conn->cid; ev->r.connerror.sid = iscsi_conn_get_sid(conn); - iscsi_broadcast_skb(conn->z_error, skb); + iscsi_unicast_skb(conn->z_error, skb, priv->daemon_pid); dev_printk(KERN_INFO, &conn->dev, "iscsi: detected conn error (%d)\n", error); @@ -850,131 +767,6 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh) return err; } -/** - * iscsi_if_destroy_session_done - send session destr. completion event - * @conn: last connection for session - * - * This is called by HW iscsi LLDs to notify userpsace that its HW has - * removed a session. - **/ -int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn) -{ - struct iscsi_internal *priv; - struct iscsi_cls_session *session; - struct Scsi_Host *shost; - struct iscsi_uevent *ev; - struct sk_buff *skb; - struct nlmsghdr *nlh; - unsigned long flags; - int rc, len = NLMSG_SPACE(sizeof(*ev)); - - priv = iscsi_if_transport_lookup(conn->transport); - if (!priv) - return -EINVAL; - - session = iscsi_dev_to_session(conn->dev.parent); - shost = iscsi_session_to_shost(session); - - mempool_zone_complete(conn->z_pdu); - - skb = mempool_zone_get_skb(conn->z_pdu); - if (!skb) { - dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of " - "session creation event\n"); - return -ENOMEM; - } - - nlh = __nlmsg_put(skb, priv->daemon_pid, 0, 0, (len - sizeof(*nlh)), 0); - ev = NLMSG_DATA(nlh); - ev->transport_handle = iscsi_handle(conn->transport); - ev->type = ISCSI_KEVENT_DESTROY_SESSION; - ev->r.d_session.host_no = shost->host_no; - ev->r.d_session.sid = session->sid; - - /* - * this will occur if the daemon is not up, so we just warn - * the user and when the daemon is restarted it will handle it - */ - rc = iscsi_broadcast_skb(conn->z_pdu, skb); - if (rc < 0) - dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of " - "session destruction event. Check iscsi daemon\n"); - - spin_lock_irqsave(&sesslock, flags); - list_del(&session->sess_list); - spin_unlock_irqrestore(&sesslock, flags); - - spin_lock_irqsave(&connlock, flags); - conn->active = 0; - list_del(&conn->conn_list); - spin_unlock_irqrestore(&connlock, flags); - - return rc; -} -EXPORT_SYMBOL_GPL(iscsi_if_destroy_session_done); - -/** - * iscsi_if_create_session_done - send session creation completion event - * @conn: leading connection for session - * - * This is called by HW iscsi LLDs to notify userpsace that its HW has - * created a session or a existing session is back in the logged in state. - **/ -int iscsi_if_create_session_done(struct iscsi_cls_conn *conn) -{ - struct iscsi_internal *priv; - struct iscsi_cls_session *session; - struct Scsi_Host *shost; - struct iscsi_uevent *ev; - struct sk_buff *skb; - struct nlmsghdr *nlh; - unsigned long flags; - int rc, len = NLMSG_SPACE(sizeof(*ev)); - - priv = iscsi_if_transport_lookup(conn->transport); - if (!priv) - return -EINVAL; - - session = iscsi_dev_to_session(conn->dev.parent); - shost = iscsi_session_to_shost(session); - - mempool_zone_complete(conn->z_pdu); - - skb = mempool_zone_get_skb(conn->z_pdu); - if (!skb) { - dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of " - "session creation event\n"); - return -ENOMEM; - } - - nlh = __nlmsg_put(skb, priv->daemon_pid, 0, 0, (len - sizeof(*nlh)), 0); - ev = NLMSG_DATA(nlh); - ev->transport_handle = iscsi_handle(conn->transport); - ev->type = ISCSI_UEVENT_CREATE_SESSION; - ev->r.c_session_ret.host_no = shost->host_no; - ev->r.c_session_ret.sid = session->sid; - - /* - * this will occur if the daemon is not up, so we just warn - * the user and when the daemon is restarted it will handle it - */ - rc = iscsi_broadcast_skb(conn->z_pdu, skb); - if (rc < 0) - dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of " - "session creation event. Check iscsi daemon\n"); - - spin_lock_irqsave(&sesslock, flags); - list_add(&session->sess_list, &sesslist); - spin_unlock_irqrestore(&sesslock, flags); - - spin_lock_irqsave(&connlock, flags); - list_add(&conn->conn_list, &connlist); - conn->active = 1; - spin_unlock_irqrestore(&connlock, flags); - return rc; -} -EXPORT_SYMBOL_GPL(iscsi_if_create_session_done); - static int iscsi_if_create_session(struct iscsi_internal *priv, struct iscsi_uevent *ev) { @@ -1020,6 +812,26 @@ iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev) return -ENOMEM; } + conn->z_pdu = mempool_zone_init(Z_MAX_PDU, + NLMSG_SPACE(sizeof(struct iscsi_uevent) + + sizeof(struct iscsi_hdr) + + DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH), + Z_HIWAT_PDU); + if (!conn->z_pdu) { + dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate " + "pdu zone for new conn\n"); + goto destroy_conn; + } + + conn->z_error = mempool_zone_init(Z_MAX_ERROR, + NLMSG_SPACE(sizeof(struct iscsi_uevent)), + Z_HIWAT_ERROR); + if (!conn->z_error) { + dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate " + "error zone for new conn\n"); + goto free_pdu_pool; + } + ev->r.c_conn_ret.sid = session->sid; ev->r.c_conn_ret.cid = conn->cid; @@ -1029,6 +841,13 @@ iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev) spin_unlock_irqrestore(&connlock, flags); return 0; + +free_pdu_pool: + mempool_zone_destroy(conn->z_pdu); +destroy_conn: + if (transport->destroy_conn) + transport->destroy_conn(conn->dd_data); + return -ENOMEM; } static int @@ -1036,6 +855,7 @@ iscsi_if_destroy_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev { unsigned long flags; struct iscsi_cls_conn *conn; + struct mempool_zone *z_error, *z_pdu; conn = iscsi_conn_lookup(ev->u.d_conn.sid, ev->u.d_conn.cid); if (!conn) @@ -1045,18 +865,35 @@ iscsi_if_destroy_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev list_del(&conn->conn_list); spin_unlock_irqrestore(&connlock, flags); + z_pdu = conn->z_pdu; + z_error = conn->z_error; + if (transport->destroy_conn) transport->destroy_conn(conn); + + mempool_zone_destroy(z_pdu); + mempool_zone_destroy(z_error); + return 0; } +static void +iscsi_copy_param(struct iscsi_uevent *ev, uint32_t *value, char *data) +{ + if (ev->u.set_param.len != sizeof(uint32_t)) + BUG(); + memcpy(value, data, min_t(uint32_t, sizeof(uint32_t), + ev->u.set_param.len)); +} + static int iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev) { char *data = (char*)ev + sizeof(*ev); struct iscsi_cls_conn *conn; struct iscsi_cls_session *session; - int err = 0, value = 0; + int err = 0; + uint32_t value = 0; session = iscsi_session_lookup(ev->u.set_param.sid); conn = iscsi_conn_lookup(ev->u.set_param.sid, ev->u.set_param.cid); @@ -1065,13 +902,42 @@ iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev) switch (ev->u.set_param.param) { case ISCSI_PARAM_SESS_RECOVERY_TMO: - sscanf(data, "%d", &value); + iscsi_copy_param(ev, &value, data); if (value != 0) session->recovery_tmo = value; break; + case ISCSI_PARAM_TARGET_NAME: + /* this should not change between logins */ + if (session->targetname) + return 0; + + session->targetname = kstrdup(data, GFP_KERNEL); + if (!session->targetname) + return -ENOMEM; + break; + case ISCSI_PARAM_TPGT: + iscsi_copy_param(ev, &value, data); + session->tpgt = value; + break; + case ISCSI_PARAM_PERSISTENT_PORT: + iscsi_copy_param(ev, &value, data); + conn->persistent_port = value; + break; + case ISCSI_PARAM_PERSISTENT_ADDRESS: + /* + * this is the address returned in discovery so it should + * not change between logins. + */ + if (conn->persistent_address) + return 0; + + conn->persistent_address = kstrdup(data, GFP_KERNEL); + if (!conn->persistent_address) + return -ENOMEM; + break; default: - err = transport->set_param(conn, ev->u.set_param.param, - data, ev->u.set_param.len); + iscsi_copy_param(ev, &value, data); + err = transport->set_param(conn, ev->u.set_param.param, value); } return err; @@ -1111,21 +977,6 @@ iscsi_if_transport_ep(struct iscsi_transport *transport, return rc; } -static int -iscsi_tgt_dscvr(struct iscsi_transport *transport, - struct iscsi_uevent *ev) -{ - struct sockaddr *dst_addr; - - if (!transport->tgt_dscvr) - return -EINVAL; - - dst_addr = (struct sockaddr *)((char*)ev + sizeof(*ev)); - return transport->tgt_dscvr(ev->u.tgt_dscvr.type, - ev->u.tgt_dscvr.host_no, - ev->u.tgt_dscvr.enable, dst_addr); -} - static int iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) { @@ -1214,9 +1065,6 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) case ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT: err = iscsi_if_transport_ep(transport, ev, nlh->nlmsg_type); break; - case ISCSI_UEVENT_TGT_DSCVR: - err = iscsi_tgt_dscvr(transport, ev); - break; default: err = -EINVAL; break; @@ -1299,31 +1147,49 @@ struct class_device_attribute class_device_attr_##_prefix##_##_name = \ /* * iSCSI connection attrs */ -#define iscsi_conn_attr_show(param) \ +#define iscsi_conn_int_attr_show(param, format) \ +static ssize_t \ +show_conn_int_param_##param(struct class_device *cdev, char *buf) \ +{ \ + uint32_t value = 0; \ + struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev); \ + struct iscsi_transport *t = conn->transport; \ + \ + t->get_conn_param(conn, param, &value); \ + return snprintf(buf, 20, format"\n", value); \ +} + +#define iscsi_conn_int_attr(field, param, format) \ + iscsi_conn_int_attr_show(param, format) \ +static ISCSI_CLASS_ATTR(conn, field, S_IRUGO, show_conn_int_param_##param, \ + NULL); + +iscsi_conn_int_attr(max_recv_dlength, ISCSI_PARAM_MAX_RECV_DLENGTH, "%u"); +iscsi_conn_int_attr(max_xmit_dlength, ISCSI_PARAM_MAX_XMIT_DLENGTH, "%u"); +iscsi_conn_int_attr(header_digest, ISCSI_PARAM_HDRDGST_EN, "%d"); +iscsi_conn_int_attr(data_digest, ISCSI_PARAM_DATADGST_EN, "%d"); +iscsi_conn_int_attr(ifmarker, ISCSI_PARAM_IFMARKER_EN, "%d"); +iscsi_conn_int_attr(ofmarker, ISCSI_PARAM_OFMARKER_EN, "%d"); +iscsi_conn_int_attr(persistent_port, ISCSI_PARAM_PERSISTENT_PORT, "%d"); +iscsi_conn_int_attr(port, ISCSI_PARAM_CONN_PORT, "%d"); +iscsi_conn_int_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN, "%u"); + +#define iscsi_conn_str_attr_show(param) \ static ssize_t \ -show_conn_param_##param(struct class_device *cdev, char *buf) \ +show_conn_str_param_##param(struct class_device *cdev, char *buf) \ { \ struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev); \ struct iscsi_transport *t = conn->transport; \ - return t->get_conn_param(conn, param, buf); \ + return t->get_conn_str_param(conn, param, buf); \ } -#define iscsi_conn_attr(field, param) \ - iscsi_conn_attr_show(param) \ -static ISCSI_CLASS_ATTR(conn, field, S_IRUGO, show_conn_param_##param, \ +#define iscsi_conn_str_attr(field, param) \ + iscsi_conn_str_attr_show(param) \ +static ISCSI_CLASS_ATTR(conn, field, S_IRUGO, show_conn_str_param_##param, \ NULL); -iscsi_conn_attr(max_recv_dlength, ISCSI_PARAM_MAX_RECV_DLENGTH); -iscsi_conn_attr(max_xmit_dlength, ISCSI_PARAM_MAX_XMIT_DLENGTH); -iscsi_conn_attr(header_digest, ISCSI_PARAM_HDRDGST_EN); -iscsi_conn_attr(data_digest, ISCSI_PARAM_DATADGST_EN); -iscsi_conn_attr(ifmarker, ISCSI_PARAM_IFMARKER_EN); -iscsi_conn_attr(ofmarker, ISCSI_PARAM_OFMARKER_EN); -iscsi_conn_attr(persistent_port, ISCSI_PARAM_PERSISTENT_PORT); -iscsi_conn_attr(port, ISCSI_PARAM_CONN_PORT); -iscsi_conn_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN); -iscsi_conn_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS); -iscsi_conn_attr(address, ISCSI_PARAM_CONN_ADDRESS); +iscsi_conn_str_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS); +iscsi_conn_str_attr(address, ISCSI_PARAM_CONN_ADDRESS); #define iscsi_cdev_to_session(_cdev) \ iscsi_dev_to_session(_cdev->dev) @@ -1331,36 +1197,61 @@ iscsi_conn_attr(address, ISCSI_PARAM_CONN_ADDRESS); /* * iSCSI session attrs */ -#define iscsi_session_attr_show(param) \ +#define iscsi_session_int_attr_show(param, format) \ +static ssize_t \ +show_session_int_param_##param(struct class_device *cdev, char *buf) \ +{ \ + uint32_t value = 0; \ + struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev); \ + struct iscsi_transport *t = session->transport; \ + \ + t->get_session_param(session, param, &value); \ + return snprintf(buf, 20, format"\n", value); \ +} + +#define iscsi_session_int_attr(field, param, format) \ + iscsi_session_int_attr_show(param, format) \ +static ISCSI_CLASS_ATTR(sess, field, S_IRUGO, show_session_int_param_##param, \ + NULL); + +iscsi_session_int_attr(initial_r2t, ISCSI_PARAM_INITIAL_R2T_EN, "%d"); +iscsi_session_int_attr(max_outstanding_r2t, ISCSI_PARAM_MAX_R2T, "%hu"); +iscsi_session_int_attr(immediate_data, ISCSI_PARAM_IMM_DATA_EN, "%d"); +iscsi_session_int_attr(first_burst_len, ISCSI_PARAM_FIRST_BURST, "%u"); +iscsi_session_int_attr(max_burst_len, ISCSI_PARAM_MAX_BURST, "%u"); +iscsi_session_int_attr(data_pdu_in_order, ISCSI_PARAM_PDU_INORDER_EN, "%d"); +iscsi_session_int_attr(data_seq_in_order, ISCSI_PARAM_DATASEQ_INORDER_EN, "%d"); +iscsi_session_int_attr(erl, ISCSI_PARAM_ERL, "%d"); +iscsi_session_int_attr(tpgt, ISCSI_PARAM_TPGT, "%d"); + +#define iscsi_session_str_attr_show(param) \ static ssize_t \ -show_session_param_##param(struct class_device *cdev, char *buf) \ +show_session_str_param_##param(struct class_device *cdev, char *buf) \ { \ struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev); \ struct iscsi_transport *t = session->transport; \ - return t->get_session_param(session, param, buf); \ + return t->get_session_str_param(session, param, buf); \ } -#define iscsi_session_attr(field, param) \ - iscsi_session_attr_show(param) \ -static ISCSI_CLASS_ATTR(sess, field, S_IRUGO, show_session_param_##param, \ +#define iscsi_session_str_attr(field, param) \ + iscsi_session_str_attr_show(param) \ +static ISCSI_CLASS_ATTR(sess, field, S_IRUGO, show_session_str_param_##param, \ NULL); -iscsi_session_attr(targetname, ISCSI_PARAM_TARGET_NAME); -iscsi_session_attr(initial_r2t, ISCSI_PARAM_INITIAL_R2T_EN); -iscsi_session_attr(max_outstanding_r2t, ISCSI_PARAM_MAX_R2T); -iscsi_session_attr(immediate_data, ISCSI_PARAM_IMM_DATA_EN); -iscsi_session_attr(first_burst_len, ISCSI_PARAM_FIRST_BURST); -iscsi_session_attr(max_burst_len, ISCSI_PARAM_MAX_BURST); -iscsi_session_attr(data_pdu_in_order, ISCSI_PARAM_PDU_INORDER_EN); -iscsi_session_attr(data_seq_in_order, ISCSI_PARAM_DATASEQ_INORDER_EN); -iscsi_session_attr(erl, ISCSI_PARAM_ERL); -iscsi_session_attr(tpgt, ISCSI_PARAM_TPGT); +iscsi_session_str_attr(targetname, ISCSI_PARAM_TARGET_NAME); +/* + * Private session and conn attrs. userspace uses several iscsi values + * to identify each session between reboots. Some of these values may not + * be present in the iscsi_transport/LLD driver becuase userspace handles + * login (and failback for login redirect) so for these type of drivers + * the class manages the attrs and values for the iscsi_transport/LLD + */ #define iscsi_priv_session_attr_show(field, format) \ static ssize_t \ -show_priv_session_##field(struct class_device *cdev, char *buf) \ +show_priv_session_##field(struct class_device *cdev, char *buf) \ { \ - struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev);\ + struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev); \ return sprintf(buf, format"\n", session->field); \ } @@ -1368,15 +1259,31 @@ show_priv_session_##field(struct class_device *cdev, char *buf) \ iscsi_priv_session_attr_show(field, format) \ static ISCSI_CLASS_ATTR(priv_sess, field, S_IRUGO, show_priv_session_##field, \ NULL) +iscsi_priv_session_attr(targetname, "%s"); +iscsi_priv_session_attr(tpgt, "%d"); iscsi_priv_session_attr(recovery_tmo, "%d"); +#define iscsi_priv_conn_attr_show(field, format) \ +static ssize_t \ +show_priv_conn_##field(struct class_device *cdev, char *buf) \ +{ \ + struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev); \ + return sprintf(buf, format"\n", conn->field); \ +} + +#define iscsi_priv_conn_attr(field, format) \ + iscsi_priv_conn_attr_show(field, format) \ +static ISCSI_CLASS_ATTR(priv_conn, field, S_IRUGO, show_priv_conn_##field, \ + NULL) +iscsi_priv_conn_attr(persistent_address, "%s"); +iscsi_priv_conn_attr(persistent_port, "%d"); + #define SETUP_PRIV_SESSION_RD_ATTR(field) \ do { \ priv->session_attrs[count] = &class_device_attr_priv_sess_##field; \ count++; \ } while (0) - #define SETUP_SESSION_RD_ATTR(field, param_flag) \ do { \ if (tt->param_mask & param_flag) { \ @@ -1385,6 +1292,12 @@ do { \ } \ } while (0) +#define SETUP_PRIV_CONN_RD_ATTR(field) \ +do { \ + priv->conn_attrs[count] = &class_device_attr_priv_conn_##field; \ + count++; \ +} while (0) + #define SETUP_CONN_RD_ATTR(field, param_flag) \ do { \ if (tt->param_mask & param_flag) { \ @@ -1475,7 +1388,6 @@ iscsi_register_transport(struct iscsi_transport *tt) if (!priv) return NULL; INIT_LIST_HEAD(&priv->list); - priv->daemon_pid = -1; priv->iscsi_transport = tt; priv->t.user_scan = iscsi_user_scan; @@ -1512,8 +1424,16 @@ iscsi_register_transport(struct iscsi_transport *tt) SETUP_CONN_RD_ATTR(address, ISCSI_CONN_ADDRESS); SETUP_CONN_RD_ATTR(port, ISCSI_CONN_PORT); SETUP_CONN_RD_ATTR(exp_statsn, ISCSI_EXP_STATSN); - SETUP_CONN_RD_ATTR(persistent_address, ISCSI_PERSISTENT_ADDRESS); - SETUP_CONN_RD_ATTR(persistent_port, ISCSI_PERSISTENT_PORT); + + if (tt->param_mask & ISCSI_PERSISTENT_ADDRESS) + SETUP_CONN_RD_ATTR(persistent_address, ISCSI_PERSISTENT_ADDRESS); + else + SETUP_PRIV_CONN_RD_ATTR(persistent_address); + + if (tt->param_mask & ISCSI_PERSISTENT_PORT) + SETUP_CONN_RD_ATTR(persistent_port, ISCSI_PERSISTENT_PORT); + else + SETUP_PRIV_CONN_RD_ATTR(persistent_port); BUG_ON(count > ISCSI_CONN_ATTRS); priv->conn_attrs[count] = NULL; @@ -1533,10 +1453,18 @@ iscsi_register_transport(struct iscsi_transport *tt) SETUP_SESSION_RD_ATTR(data_pdu_in_order, ISCSI_PDU_INORDER_EN); SETUP_SESSION_RD_ATTR(data_seq_in_order, ISCSI_DATASEQ_INORDER_EN); SETUP_SESSION_RD_ATTR(erl, ISCSI_ERL); - SETUP_SESSION_RD_ATTR(targetname, ISCSI_TARGET_NAME); - SETUP_SESSION_RD_ATTR(tpgt, ISCSI_TPGT); SETUP_PRIV_SESSION_RD_ATTR(recovery_tmo); + if (tt->param_mask & ISCSI_TARGET_NAME) + SETUP_SESSION_RD_ATTR(targetname, ISCSI_TARGET_NAME); + else + SETUP_PRIV_SESSION_RD_ATTR(targetname); + + if (tt->param_mask & ISCSI_TPGT) + SETUP_SESSION_RD_ATTR(tpgt, ISCSI_TPGT); + else + SETUP_PRIV_SESSION_RD_ATTR(tpgt); + BUG_ON(count > ISCSI_SESSION_ATTRS); priv->session_attrs[count] = NULL; diff --git a/trunk/drivers/scsi/scsi_transport_sas.c b/trunk/drivers/scsi/scsi_transport_sas.c index dd075627e605..1fe6b2d01853 100644 --- a/trunk/drivers/scsi/scsi_transport_sas.c +++ b/trunk/drivers/scsi/scsi_transport_sas.c @@ -174,28 +174,11 @@ static int sas_host_match(struct attribute_container *cont, static int do_sas_phy_delete(struct device *dev, void *data) { - int pass = (int)(unsigned long)data; - - if (pass == 0 && scsi_is_sas_port(dev)) - sas_port_delete(dev_to_sas_port(dev)); - else if (pass == 1 && scsi_is_sas_phy(dev)) + if (scsi_is_sas_phy(dev)) sas_phy_delete(dev_to_phy(dev)); return 0; } -/** - * sas_remove_children -- tear down a devices SAS data structures - * @dev: device belonging to the sas object - * - * Removes all SAS PHYs and remote PHYs for a given object - */ -void sas_remove_children(struct device *dev) -{ - device_for_each_child(dev, (void *)0, do_sas_phy_delete); - device_for_each_child(dev, (void *)1, do_sas_phy_delete); -} -EXPORT_SYMBOL(sas_remove_children); - /** * sas_remove_host -- tear down a Scsi_Host's SAS data structures * @shost: Scsi Host that is torn down @@ -205,13 +188,13 @@ EXPORT_SYMBOL(sas_remove_children); */ void sas_remove_host(struct Scsi_Host *shost) { - sas_remove_children(&shost->shost_gendev); + device_for_each_child(&shost->shost_gendev, NULL, do_sas_phy_delete); } EXPORT_SYMBOL(sas_remove_host); /* - * SAS Phy attributes + * SAS Port attributes */ #define sas_phy_show_simple(field, name, format_string, cast) \ @@ -327,7 +310,7 @@ sas_phy_protocol_attr(identify.target_port_protocols, sas_phy_simple_attr(identify.sas_address, sas_address, "0x%016llx\n", unsigned long long); sas_phy_simple_attr(identify.phy_identifier, phy_identifier, "%d\n", u8); -//sas_phy_simple_attr(port_identifier, port_identifier, "%d\n", u8); +sas_phy_simple_attr(port_identifier, port_identifier, "%d\n", u8); sas_phy_linkspeed_attr(negotiated_linkrate); sas_phy_linkspeed_attr(minimum_linkrate_hw); sas_phy_linkspeed_attr(minimum_linkrate); @@ -395,10 +378,9 @@ struct sas_phy *sas_phy_alloc(struct device *parent, int number) device_initialize(&phy->dev); phy->dev.parent = get_device(parent); phy->dev.release = sas_phy_release; - INIT_LIST_HEAD(&phy->port_siblings); if (scsi_is_sas_expander_device(parent)) { struct sas_rphy *rphy = dev_to_rphy(parent); - sprintf(phy->dev.bus_id, "phy-%d:%d:%d", shost->host_no, + sprintf(phy->dev.bus_id, "phy-%d-%d:%d", shost->host_no, rphy->scsi_target_id, number); } else sprintf(phy->dev.bus_id, "phy-%d:%d", shost->host_no, number); @@ -458,8 +440,8 @@ sas_phy_delete(struct sas_phy *phy) { struct device *dev = &phy->dev; - /* this happens if the phy is still part of a port when deleted */ - BUG_ON(!list_empty(&phy->port_siblings)); + if (phy->rphy) + sas_rphy_delete(phy->rphy); transport_remove_device(dev); device_del(dev); @@ -481,258 +463,6 @@ int scsi_is_sas_phy(const struct device *dev) } EXPORT_SYMBOL(scsi_is_sas_phy); -/* - * SAS Port attributes - */ -#define sas_port_show_simple(field, name, format_string, cast) \ -static ssize_t \ -show_sas_port_##name(struct class_device *cdev, char *buf) \ -{ \ - struct sas_port *port = transport_class_to_sas_port(cdev); \ - \ - return snprintf(buf, 20, format_string, cast port->field); \ -} - -#define sas_port_simple_attr(field, name, format_string, type) \ - sas_port_show_simple(field, name, format_string, (type)) \ -static CLASS_DEVICE_ATTR(name, S_IRUGO, show_sas_port_##name, NULL) - -sas_port_simple_attr(num_phys, num_phys, "%d\n", int); - -static DECLARE_TRANSPORT_CLASS(sas_port_class, - "sas_port", NULL, NULL, NULL); - -static int sas_port_match(struct attribute_container *cont, struct device *dev) -{ - struct Scsi_Host *shost; - struct sas_internal *i; - - if (!scsi_is_sas_port(dev)) - return 0; - shost = dev_to_shost(dev->parent); - - if (!shost->transportt) - return 0; - if (shost->transportt->host_attrs.ac.class != - &sas_host_class.class) - return 0; - - i = to_sas_internal(shost->transportt); - return &i->port_attr_cont.ac == cont; -} - - -static void sas_port_release(struct device *dev) -{ - struct sas_port *port = dev_to_sas_port(dev); - - BUG_ON(!list_empty(&port->phy_list)); - - put_device(dev->parent); - kfree(port); -} - -static void sas_port_create_link(struct sas_port *port, - struct sas_phy *phy) -{ - sysfs_create_link(&port->dev.kobj, &phy->dev.kobj, phy->dev.bus_id); - sysfs_create_link(&phy->dev.kobj, &port->dev.kobj, "port"); -} - -static void sas_port_delete_link(struct sas_port *port, - struct sas_phy *phy) -{ - sysfs_remove_link(&port->dev.kobj, phy->dev.bus_id); - sysfs_remove_link(&phy->dev.kobj, "port"); -} - -/** sas_port_alloc - allocate and initialize a SAS port structure - * - * @parent: parent device - * @port_id: port number - * - * Allocates a SAS port structure. It will be added to the device tree - * below the device specified by @parent which must be either a Scsi_Host - * or a sas_expander_device. - * - * Returns %NULL on error - */ -struct sas_port *sas_port_alloc(struct device *parent, int port_id) -{ - struct Scsi_Host *shost = dev_to_shost(parent); - struct sas_port *port; - - port = kzalloc(sizeof(*port), GFP_KERNEL); - if (!port) - return NULL; - - port->port_identifier = port_id; - - device_initialize(&port->dev); - - port->dev.parent = get_device(parent); - port->dev.release = sas_port_release; - - mutex_init(&port->phy_list_mutex); - INIT_LIST_HEAD(&port->phy_list); - - if (scsi_is_sas_expander_device(parent)) { - struct sas_rphy *rphy = dev_to_rphy(parent); - sprintf(port->dev.bus_id, "port-%d:%d:%d", shost->host_no, - rphy->scsi_target_id, port->port_identifier); - } else - sprintf(port->dev.bus_id, "port-%d:%d", shost->host_no, - port->port_identifier); - - transport_setup_device(&port->dev); - - return port; -} -EXPORT_SYMBOL(sas_port_alloc); - -/** - * sas_port_add - add a SAS port to the device hierarchy - * - * @port: port to be added - * - * publishes a port to the rest of the system - */ -int sas_port_add(struct sas_port *port) -{ - int error; - - /* No phys should be added until this is made visible */ - BUG_ON(!list_empty(&port->phy_list)); - - error = device_add(&port->dev); - - if (error) - return error; - - transport_add_device(&port->dev); - transport_configure_device(&port->dev); - - return 0; -} -EXPORT_SYMBOL(sas_port_add); - -/** - * sas_port_free -- free a SAS PORT - * @port: SAS PORT to free - * - * Frees the specified SAS PORT. - * - * Note: - * This function must only be called on a PORT that has not - * sucessfully been added using sas_port_add(). - */ -void sas_port_free(struct sas_port *port) -{ - transport_destroy_device(&port->dev); - put_device(&port->dev); -} -EXPORT_SYMBOL(sas_port_free); - -/** - * sas_port_delete -- remove SAS PORT - * @port: SAS PORT to remove - * - * Removes the specified SAS PORT. If the SAS PORT has an - * associated phys, unlink them from the port as well. - */ -void sas_port_delete(struct sas_port *port) -{ - struct device *dev = &port->dev; - struct sas_phy *phy, *tmp_phy; - - if (port->rphy) { - sas_rphy_delete(port->rphy); - port->rphy = NULL; - } - - mutex_lock(&port->phy_list_mutex); - list_for_each_entry_safe(phy, tmp_phy, &port->phy_list, - port_siblings) { - sas_port_delete_link(port, phy); - list_del_init(&phy->port_siblings); - } - mutex_unlock(&port->phy_list_mutex); - - transport_remove_device(dev); - device_del(dev); - transport_destroy_device(dev); - put_device(dev); -} -EXPORT_SYMBOL(sas_port_delete); - -/** - * scsi_is_sas_port -- check if a struct device represents a SAS port - * @dev: device to check - * - * Returns: - * %1 if the device represents a SAS Port, %0 else - */ -int scsi_is_sas_port(const struct device *dev) -{ - return dev->release == sas_port_release; -} -EXPORT_SYMBOL(scsi_is_sas_port); - -/** - * sas_port_add_phy - add another phy to a port to form a wide port - * @port: port to add the phy to - * @phy: phy to add - * - * When a port is initially created, it is empty (has no phys). All - * ports must have at least one phy to operated, and all wide ports - * must have at least two. The current code makes no difference - * between ports and wide ports, but the only object that can be - * connected to a remote device is a port, so ports must be formed on - * all devices with phys if they're connected to anything. - */ -void sas_port_add_phy(struct sas_port *port, struct sas_phy *phy) -{ - mutex_lock(&port->phy_list_mutex); - if (unlikely(!list_empty(&phy->port_siblings))) { - /* make sure we're already on this port */ - struct sas_phy *tmp; - - list_for_each_entry(tmp, &port->phy_list, port_siblings) - if (tmp == phy) - break; - /* If this trips, you added a phy that was already - * part of a different port */ - if (unlikely(tmp != phy)) { - dev_printk(KERN_ERR, &port->dev, "trying to add phy %s fails: it's already part of another port\n", phy->dev.bus_id); - BUG(); - } - } else { - sas_port_create_link(port, phy); - list_add_tail(&phy->port_siblings, &port->phy_list); - port->num_phys++; - } - mutex_unlock(&port->phy_list_mutex); -} -EXPORT_SYMBOL(sas_port_add_phy); - -/** - * sas_port_delete_phy - remove a phy from a port or wide port - * @port: port to remove the phy from - * @phy: phy to remove - * - * This operation is used for tearing down ports again. It must be - * done to every port or wide port before calling sas_port_delete. - */ -void sas_port_delete_phy(struct sas_port *port, struct sas_phy *phy) -{ - mutex_lock(&port->phy_list_mutex); - sas_port_delete_link(port, phy); - list_del_init(&phy->port_siblings); - port->num_phys--; - mutex_unlock(&port->phy_list_mutex); -} -EXPORT_SYMBOL(sas_port_delete_phy); - /* * SAS remote PHY attributes. */ @@ -1037,7 +767,7 @@ static void sas_rphy_initialize(struct sas_rphy *rphy) * Returns: * SAS PHY allocated or %NULL if the allocation failed. */ -struct sas_rphy *sas_end_device_alloc(struct sas_port *parent) +struct sas_rphy *sas_end_device_alloc(struct sas_phy *parent) { struct Scsi_Host *shost = dev_to_shost(&parent->dev); struct sas_end_device *rdev; @@ -1050,13 +780,8 @@ struct sas_rphy *sas_end_device_alloc(struct sas_port *parent) device_initialize(&rdev->rphy.dev); rdev->rphy.dev.parent = get_device(&parent->dev); rdev->rphy.dev.release = sas_end_device_release; - if (scsi_is_sas_expander_device(parent->dev.parent)) { - struct sas_rphy *rphy = dev_to_rphy(parent->dev.parent); - sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d:%d", - shost->host_no, rphy->scsi_target_id, parent->port_identifier); - } else - sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d", - shost->host_no, parent->port_identifier); + sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d-%d", + shost->host_no, parent->port_identifier, parent->number); rdev->rphy.identify.device_type = SAS_END_DEVICE; sas_rphy_initialize(&rdev->rphy); transport_setup_device(&rdev->rphy.dev); @@ -1073,7 +798,7 @@ EXPORT_SYMBOL(sas_end_device_alloc); * Returns: * SAS PHY allocated or %NULL if the allocation failed. */ -struct sas_rphy *sas_expander_alloc(struct sas_port *parent, +struct sas_rphy *sas_expander_alloc(struct sas_phy *parent, enum sas_device_type type) { struct Scsi_Host *shost = dev_to_shost(&parent->dev); @@ -1112,7 +837,7 @@ EXPORT_SYMBOL(sas_expander_alloc); */ int sas_rphy_add(struct sas_rphy *rphy) { - struct sas_port *parent = dev_to_sas_port(rphy->dev.parent); + struct sas_phy *parent = dev_to_phy(rphy->dev.parent); struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); struct sas_identify *identify = &rphy->identify; @@ -1185,7 +910,7 @@ void sas_rphy_delete(struct sas_rphy *rphy) { struct device *dev = &rphy->dev; - struct sas_port *parent = dev_to_sas_port(dev->parent); + struct sas_phy *parent = dev_to_phy(dev->parent); struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); @@ -1195,7 +920,7 @@ sas_rphy_delete(struct sas_rphy *rphy) break; case SAS_EDGE_EXPANDER_DEVICE: case SAS_FANOUT_EXPANDER_DEVICE: - sas_remove_children(dev); + device_for_each_child(dev, NULL, do_sas_phy_delete); break; default: break; @@ -1242,7 +967,7 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel, mutex_lock(&sas_host->lock); list_for_each_entry(rphy, &sas_host->rphy_list, list) { - struct sas_port *parent = dev_to_sas_port(rphy->dev.parent); + struct sas_phy *parent = dev_to_phy(rphy->dev.parent); if (rphy->identify.device_type != SAS_END_DEVICE || rphy->scsi_target_id == -1) @@ -1278,19 +1003,16 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel, #define SETUP_OPTIONAL_RPORT_ATTRIBUTE(field, func) \ SETUP_TEMPLATE(rphy_attrs, field, S_IRUGO, i->f->func) -#define SETUP_PHY_ATTRIBUTE(field) \ - SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, 1) - #define SETUP_PORT_ATTRIBUTE(field) \ - SETUP_TEMPLATE(port_attrs, field, S_IRUGO, 1) + SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, 1) -#define SETUP_OPTIONAL_PHY_ATTRIBUTE(field, func) \ +#define SETUP_OPTIONAL_PORT_ATTRIBUTE(field, func) \ SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, i->f->func) -#define SETUP_PHY_ATTRIBUTE_WRONLY(field) \ +#define SETUP_PORT_ATTRIBUTE_WRONLY(field) \ SETUP_TEMPLATE(phy_attrs, field, S_IWUGO, 1) -#define SETUP_OPTIONAL_PHY_ATTRIBUTE_WRONLY(field, func) \ +#define SETUP_OPTIONAL_PORT_ATTRIBUTE_WRONLY(field, func) \ SETUP_TEMPLATE(phy_attrs, field, S_IWUGO, i->f->func) #define SETUP_END_DEV_ATTRIBUTE(field) \ @@ -1326,11 +1048,6 @@ sas_attach_transport(struct sas_function_template *ft) i->phy_attr_cont.ac.match = sas_phy_match; transport_container_register(&i->phy_attr_cont); - i->port_attr_cont.ac.class = &sas_port_class.class; - i->port_attr_cont.ac.attrs = &i->port_attrs[0]; - i->port_attr_cont.ac.match = sas_port_match; - transport_container_register(&i->port_attr_cont); - i->rphy_attr_cont.ac.class = &sas_rphy_class.class; i->rphy_attr_cont.ac.attrs = &i->rphy_attrs[0]; i->rphy_attr_cont.ac.match = sas_rphy_match; @@ -1349,34 +1066,29 @@ sas_attach_transport(struct sas_function_template *ft) i->f = ft; count = 0; - SETUP_PORT_ATTRIBUTE(num_phys); i->host_attrs[count] = NULL; count = 0; - SETUP_PHY_ATTRIBUTE(initiator_port_protocols); - SETUP_PHY_ATTRIBUTE(target_port_protocols); - SETUP_PHY_ATTRIBUTE(device_type); - SETUP_PHY_ATTRIBUTE(sas_address); - SETUP_PHY_ATTRIBUTE(phy_identifier); - //SETUP_PHY_ATTRIBUTE(port_identifier); - SETUP_PHY_ATTRIBUTE(negotiated_linkrate); - SETUP_PHY_ATTRIBUTE(minimum_linkrate_hw); - SETUP_PHY_ATTRIBUTE(minimum_linkrate); - SETUP_PHY_ATTRIBUTE(maximum_linkrate_hw); - SETUP_PHY_ATTRIBUTE(maximum_linkrate); - - SETUP_PHY_ATTRIBUTE(invalid_dword_count); - SETUP_PHY_ATTRIBUTE(running_disparity_error_count); - SETUP_PHY_ATTRIBUTE(loss_of_dword_sync_count); - SETUP_PHY_ATTRIBUTE(phy_reset_problem_count); - SETUP_OPTIONAL_PHY_ATTRIBUTE_WRONLY(link_reset, phy_reset); - SETUP_OPTIONAL_PHY_ATTRIBUTE_WRONLY(hard_reset, phy_reset); + SETUP_PORT_ATTRIBUTE(initiator_port_protocols); + SETUP_PORT_ATTRIBUTE(target_port_protocols); + SETUP_PORT_ATTRIBUTE(device_type); + SETUP_PORT_ATTRIBUTE(sas_address); + SETUP_PORT_ATTRIBUTE(phy_identifier); + SETUP_PORT_ATTRIBUTE(port_identifier); + SETUP_PORT_ATTRIBUTE(negotiated_linkrate); + SETUP_PORT_ATTRIBUTE(minimum_linkrate_hw); + SETUP_PORT_ATTRIBUTE(minimum_linkrate); + SETUP_PORT_ATTRIBUTE(maximum_linkrate_hw); + SETUP_PORT_ATTRIBUTE(maximum_linkrate); + + SETUP_PORT_ATTRIBUTE(invalid_dword_count); + SETUP_PORT_ATTRIBUTE(running_disparity_error_count); + SETUP_PORT_ATTRIBUTE(loss_of_dword_sync_count); + SETUP_PORT_ATTRIBUTE(phy_reset_problem_count); + SETUP_OPTIONAL_PORT_ATTRIBUTE_WRONLY(link_reset, phy_reset); + SETUP_OPTIONAL_PORT_ATTRIBUTE_WRONLY(hard_reset, phy_reset); i->phy_attrs[count] = NULL; - count = 0; - SETUP_PORT_ATTRIBUTE(num_phys); - i->port_attrs[count] = NULL; - count = 0; SETUP_RPORT_ATTRIBUTE(rphy_initiator_port_protocols); SETUP_RPORT_ATTRIBUTE(rphy_target_port_protocols); @@ -1419,7 +1131,6 @@ void sas_release_transport(struct scsi_transport_template *t) transport_container_unregister(&i->t.host_attrs); transport_container_unregister(&i->phy_attr_cont); - transport_container_unregister(&i->port_attr_cont); transport_container_unregister(&i->rphy_attr_cont); transport_container_unregister(&i->end_dev_attr_cont); transport_container_unregister(&i->expander_attr_cont); @@ -1438,12 +1149,9 @@ static __init int sas_transport_init(void) error = transport_class_register(&sas_phy_class); if (error) goto out_unregister_transport; - error = transport_class_register(&sas_port_class); - if (error) - goto out_unregister_phy; error = transport_class_register(&sas_rphy_class); if (error) - goto out_unregister_port; + goto out_unregister_phy; error = transport_class_register(&sas_end_dev_class); if (error) goto out_unregister_rphy; @@ -1457,8 +1165,6 @@ static __init int sas_transport_init(void) transport_class_unregister(&sas_end_dev_class); out_unregister_rphy: transport_class_unregister(&sas_rphy_class); - out_unregister_port: - transport_class_unregister(&sas_port_class); out_unregister_phy: transport_class_unregister(&sas_phy_class); out_unregister_transport: @@ -1472,7 +1178,6 @@ static void __exit sas_transport_exit(void) { transport_class_unregister(&sas_host_class); transport_class_unregister(&sas_phy_class); - transport_class_unregister(&sas_port_class); transport_class_unregister(&sas_rphy_class); transport_class_unregister(&sas_end_dev_class); transport_class_unregister(&sas_expander_class); diff --git a/trunk/drivers/scsi/scsi_transport_spi.c b/trunk/drivers/scsi/scsi_transport_spi.c index 29a9a53cdd1a..ace49d5bd9c4 100644 --- a/trunk/drivers/scsi/scsi_transport_spi.c +++ b/trunk/drivers/scsi/scsi_transport_spi.c @@ -18,6 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/drivers/scsi/scsicam.c b/trunk/drivers/scsi/scsicam.c index cd68a66c7bb3..b78354fc4b17 100644 --- a/trunk/drivers/scsi/scsicam.c +++ b/trunk/drivers/scsi/scsicam.c @@ -57,7 +57,6 @@ EXPORT_SYMBOL(scsi_bios_ptable); int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) { unsigned char *p; - u64 capacity64 = capacity; /* Suppress gcc warning */ int ret; p = scsi_bios_ptable(bdev); @@ -69,7 +68,7 @@ int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) (unsigned int *)ip + 0, (unsigned int *)ip + 1); kfree(p); - if (ret == -1 && capacity64 < (1ULL << 32)) { + if (ret == -1) { /* pick some standard mapping with at most 1024 cylinders, and at most 62 sectors per track - this works up to 7905 MB */ diff --git a/trunk/drivers/scsi/sd.c b/trunk/drivers/scsi/sd.c index 3225d31449e1..354199011246 100644 --- a/trunk/drivers/scsi/sd.c +++ b/trunk/drivers/scsi/sd.c @@ -32,6 +32,7 @@ * than the level indicated above to trigger output. */ +#include #include #include #include @@ -207,23 +208,6 @@ static ssize_t sd_store_cache_type(struct class_device *cdev, const char *buf, return count; } -static ssize_t sd_store_allow_restart(struct class_device *cdev, const char *buf, - size_t count) -{ - struct scsi_disk *sdkp = to_scsi_disk(cdev); - struct scsi_device *sdp = sdkp->device; - - if (!capable(CAP_SYS_ADMIN)) - return -EACCES; - - if (sdp->type != TYPE_DISK) - return -EINVAL; - - sdp->allow_restart = simple_strtoul(buf, NULL, 10); - - return count; -} - static ssize_t sd_show_cache_type(struct class_device *cdev, char *buf) { struct scsi_disk *sdkp = to_scsi_disk(cdev); @@ -239,19 +223,10 @@ static ssize_t sd_show_fua(struct class_device *cdev, char *buf) return snprintf(buf, 20, "%u\n", sdkp->DPOFUA); } -static ssize_t sd_show_allow_restart(struct class_device *cdev, char *buf) -{ - struct scsi_disk *sdkp = to_scsi_disk(cdev); - - return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart); -} - static struct class_device_attribute sd_disk_attrs[] = { __ATTR(cache_type, S_IRUGO|S_IWUSR, sd_show_cache_type, sd_store_cache_type), __ATTR(FUA, S_IRUGO, sd_show_fua, NULL), - __ATTR(allow_restart, S_IRUGO|S_IWUSR, sd_show_allow_restart, - sd_store_allow_restart), __ATTR_NULL, }; @@ -916,10 +891,11 @@ static struct block_device_operations sd_fops = { static void sd_rw_intr(struct scsi_cmnd * SCpnt) { int result = SCpnt->result; - unsigned int xfer_size = SCpnt->request_bufflen; - unsigned int good_bytes = result ? 0 : xfer_size; - u64 start_lba = SCpnt->request->sector; - u64 bad_lba; + int this_count = SCpnt->request_bufflen; + int good_bytes = (result == 0 ? this_count : 0); + sector_t block_sectors = 1; + u64 first_err_block; + sector_t error_sector; struct scsi_sense_hdr sshdr; int sense_valid = 0; int sense_deferred = 0; @@ -930,6 +906,7 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt) if (sense_valid) sense_deferred = scsi_sense_is_deferred(&sshdr); } + #ifdef CONFIG_SCSI_LOGGING SCSI_LOG_HLCOMPLETE(1, printk("sd_rw_intr: %s: res=0x%x\n", SCpnt->request->rq_disk->disk_name, result)); @@ -939,72 +916,89 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt) sshdr.sense_key, sshdr.asc, sshdr.ascq)); } #endif - if (driver_byte(result) != DRIVER_SENSE && - (!sense_valid || sense_deferred)) - goto out; + /* + Handle MEDIUM ERRORs that indicate partial success. Since this is a + relatively rare error condition, no care is taken to avoid + unnecessary additional work such as memcpy's that could be avoided. + */ + if (driver_byte(result) != 0 && + sense_valid && !sense_deferred) { + switch (sshdr.sense_key) { + case MEDIUM_ERROR: + if (!blk_fs_request(SCpnt->request)) + break; + info_valid = scsi_get_sense_info_fld( + SCpnt->sense_buffer, SCSI_SENSE_BUFFERSIZE, + &first_err_block); + /* + * May want to warn and skip if following cast results + * in actual truncation (if sector_t < 64 bits) + */ + error_sector = (sector_t)first_err_block; + if (SCpnt->request->bio != NULL) + block_sectors = bio_sectors(SCpnt->request->bio); + switch (SCpnt->device->sector_size) { + case 1024: + error_sector <<= 1; + if (block_sectors < 2) + block_sectors = 2; + break; + case 2048: + error_sector <<= 2; + if (block_sectors < 4) + block_sectors = 4; + break; + case 4096: + error_sector <<=3; + if (block_sectors < 8) + block_sectors = 8; + break; + case 256: + error_sector >>= 1; + break; + default: + break; + } - switch (sshdr.sense_key) { - case HARDWARE_ERROR: - case MEDIUM_ERROR: - if (!blk_fs_request(SCpnt->request)) - goto out; - info_valid = scsi_get_sense_info_fld(SCpnt->sense_buffer, - SCSI_SENSE_BUFFERSIZE, - &bad_lba); - if (!info_valid) - goto out; - if (xfer_size <= SCpnt->device->sector_size) - goto out; - switch (SCpnt->device->sector_size) { - case 256: - start_lba <<= 1; + error_sector &= ~(block_sectors - 1); + good_bytes = (error_sector - SCpnt->request->sector) << 9; + if (good_bytes < 0 || good_bytes >= this_count) + good_bytes = 0; break; - case 512: - break; - case 1024: - start_lba >>= 1; - break; - case 2048: - start_lba >>= 2; + + case RECOVERED_ERROR: /* an error occurred, but it recovered */ + case NO_SENSE: /* LLDD got sense data */ + /* + * Inform the user, but make sure that it's not treated + * as a hard error. + */ + scsi_print_sense("sd", SCpnt); + SCpnt->result = 0; + memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); + good_bytes = this_count; break; - case 4096: - start_lba >>= 3; + + case ILLEGAL_REQUEST: + if (SCpnt->device->use_10_for_rw && + (SCpnt->cmnd[0] == READ_10 || + SCpnt->cmnd[0] == WRITE_10)) + SCpnt->device->use_10_for_rw = 0; + if (SCpnt->device->use_10_for_ms && + (SCpnt->cmnd[0] == MODE_SENSE_10 || + SCpnt->cmnd[0] == MODE_SELECT_10)) + SCpnt->device->use_10_for_ms = 0; break; + default: - /* Print something here with limiting frequency. */ - goto out; break; } - /* This computation should always be done in terms of - * the resolution of the device's medium. - */ - good_bytes = (bad_lba - start_lba)*SCpnt->device->sector_size; - break; - case RECOVERED_ERROR: - case NO_SENSE: - /* Inform the user, but make sure that it's not treated - * as a hard error. - */ - scsi_print_sense("sd", SCpnt); - SCpnt->result = 0; - memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); - good_bytes = xfer_size; - break; - case ILLEGAL_REQUEST: - if (SCpnt->device->use_10_for_rw && - (SCpnt->cmnd[0] == READ_10 || - SCpnt->cmnd[0] == WRITE_10)) - SCpnt->device->use_10_for_rw = 0; - if (SCpnt->device->use_10_for_ms && - (SCpnt->cmnd[0] == MODE_SENSE_10 || - SCpnt->cmnd[0] == MODE_SELECT_10)) - SCpnt->device->use_10_for_ms = 0; - break; - default: - break; } - out: - scsi_io_completion(SCpnt, good_bytes); + /* + * This calls the generic completion function, now that we know + * how many actual sectors finished, and how many sectors we need + * to say have failed. + */ + scsi_io_completion(SCpnt, good_bytes, block_sectors << 9); } static int media_not_present(struct scsi_disk *sdkp, diff --git a/trunk/drivers/scsi/seagate.c b/trunk/drivers/scsi/seagate.c index 3f312a84c6a7..7fa4da4ea64f 100644 --- a/trunk/drivers/scsi/seagate.c +++ b/trunk/drivers/scsi/seagate.c @@ -497,7 +497,7 @@ int __init seagate_st0x_detect (struct scsi_host_template * tpnt) return 0; hostno = instance->host_no; - if (request_irq (irq, do_seagate_reconnect_intr, IRQF_DISABLED, (controller_type == SEAGATE) ? "seagate" : "tmc-8xx", instance)) { + if (request_irq (irq, do_seagate_reconnect_intr, SA_INTERRUPT, (controller_type == SEAGATE) ? "seagate" : "tmc-8xx", instance)) { printk(KERN_ERR "scsi%d : unable to allocate IRQ%d\n", hostno, irq); return 0; } diff --git a/trunk/drivers/scsi/sg.c b/trunk/drivers/scsi/sg.c index 65eef33846bb..98b9312ba8da 100644 --- a/trunk/drivers/scsi/sg.c +++ b/trunk/drivers/scsi/sg.c @@ -28,6 +28,7 @@ static int sg_version_num = 30533; /* 2 digits for each component */ * (otherwise the macros compile to empty statements). * */ +#include #include #include @@ -1401,7 +1402,6 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf) Sg_device *sdp = NULL; struct cdev * cdev = NULL; int error, k; - unsigned long iflags; disk = alloc_disk(1); if (!disk) { @@ -1429,7 +1429,7 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf) error = cdev_add(cdev, MKDEV(SCSI_GENERIC_MAJOR, k), 1); if (error) - goto cdev_add_err; + goto out; sdp->cdev = cdev; if (sg_sysfs_valid) { @@ -1456,13 +1456,6 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf) return 0; -cdev_add_err: - write_lock_irqsave(&sg_dev_arr_lock, iflags); - kfree(sg_dev_arr[k]); - sg_dev_arr[k] = NULL; - sg_nr_dev--; - write_unlock_irqrestore(&sg_dev_arr_lock, iflags); - out: put_disk(disk); if (cdev) diff --git a/trunk/drivers/scsi/sim710.c b/trunk/drivers/scsi/sim710.c index b27e85428daa..255886a9ac55 100644 --- a/trunk/drivers/scsi/sim710.c +++ b/trunk/drivers/scsi/sim710.c @@ -26,6 +26,7 @@ * */ +#include #include #include @@ -133,7 +134,7 @@ sim710_probe_common(struct device *dev, unsigned long base_addr, host->this_id = scsi_id; host->base = base_addr; host->irq = irq; - if (request_irq(irq, NCR_700_intr, IRQF_SHARED, "sim710", host)) { + if (request_irq(irq, NCR_700_intr, SA_SHIRQ, "sim710", host)) { printk(KERN_ERR "sim710: request_irq failed\n"); goto out_put_host; } diff --git a/trunk/drivers/scsi/sr.c b/trunk/drivers/scsi/sr.c index fd94408577e5..ebf6579ed698 100644 --- a/trunk/drivers/scsi/sr.c +++ b/trunk/drivers/scsi/sr.c @@ -292,7 +292,7 @@ static void rw_intr(struct scsi_cmnd * SCpnt) * how many actual sectors finished, and how many sectors we need * to say have failed. */ - scsi_io_completion(SCpnt, good_bytes); + scsi_io_completion(SCpnt, good_bytes, block_sectors << 9); } static int sr_init_command(struct scsi_cmnd * SCpnt) diff --git a/trunk/drivers/scsi/sr_vendor.c b/trunk/drivers/scsi/sr_vendor.c index a3e9d0f2eb5b..9dde8df2f5c9 100644 --- a/trunk/drivers/scsi/sr_vendor.c +++ b/trunk/drivers/scsi/sr_vendor.c @@ -34,6 +34,7 @@ * HP 6020 writers now supported. */ +#include #include #include #include diff --git a/trunk/drivers/scsi/st.c b/trunk/drivers/scsi/st.c index 756ceb93ddc8..b5218fc0ac86 100644 --- a/trunk/drivers/scsi/st.c +++ b/trunk/drivers/scsi/st.c @@ -3599,6 +3599,7 @@ static struct st_buffer * tb->use_sg = max_sg; tb->frp = (struct st_buf_fragment *)(&(tb->sg[0]) + max_sg); + tb->in_use = 1; tb->dma = need_dma; tb->buffer_size = got; diff --git a/trunk/drivers/scsi/st.h b/trunk/drivers/scsi/st.h index 05a5cae126ec..411209048d74 100644 --- a/trunk/drivers/scsi/st.h +++ b/trunk/drivers/scsi/st.h @@ -31,6 +31,7 @@ struct st_request { /* The tape buffer descriptor. */ struct st_buffer { + unsigned char in_use; unsigned char dma; /* DMA-able buffer */ unsigned char do_dio; /* direct i/o set up? */ int buffer_size; diff --git a/trunk/drivers/scsi/sun3_NCR5380.c b/trunk/drivers/scsi/sun3_NCR5380.c index 2ebe0d663899..25cced91c8a6 100644 --- a/trunk/drivers/scsi/sun3_NCR5380.c +++ b/trunk/drivers/scsi/sun3_NCR5380.c @@ -535,6 +535,7 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd) } +#include #include #if 1 diff --git a/trunk/drivers/scsi/sun3x_esp.c b/trunk/drivers/scsi/sun3x_esp.c index 1f328cae5c05..2e2c1eb15636 100644 --- a/trunk/drivers/scsi/sun3x_esp.c +++ b/trunk/drivers/scsi/sun3x_esp.c @@ -97,7 +97,7 @@ int sun3x_esp_detect(struct scsi_host_template *tpnt) esp->esp_command_dvma = dvma_vtob((unsigned long)esp->esp_command); esp->irq = 2; - if (request_irq(esp->irq, esp_intr, IRQF_DISABLED, + if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, "SUN3X SCSI", esp->ehost)) { esp_deallocate(esp); return 0; diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym53c8xx.h b/trunk/drivers/scsi/sym53c8xx_2/sym53c8xx.h index 7519728dfc38..481103769729 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym53c8xx.h +++ b/trunk/drivers/scsi/sym53c8xx_2/sym53c8xx.h @@ -40,6 +40,7 @@ #ifndef SYM53C8XX_H #define SYM53C8XX_H +#include /* * DMA addressing mode. diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c index 8c505076c0eb..ea82d3df63af 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c @@ -1547,7 +1547,7 @@ static struct Scsi_Host * __devinit sym_attach(struct scsi_host_template *tpnt, * If we synchonize the C code with SCRIPTS on interrupt, * we do not want to share the INTR line at all. */ - if (request_irq(pdev->irq, sym53c8xx_intr, IRQF_SHARED, NAME53C8XX, np)) { + if (request_irq(pdev->irq, sym53c8xx_intr, SA_SHIRQ, NAME53C8XX, np)) { printf_err("%s: request irq %d failure\n", sym_name(np), pdev->irq); goto attach_failed; diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.h b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.h index e022d3c71b59..a446cda3f64c 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.h +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.h @@ -40,6 +40,7 @@ #ifndef SYM_GLUE_H #define SYM_GLUE_H +#include #include #include #include diff --git a/trunk/drivers/scsi/t128.c b/trunk/drivers/scsi/t128.c index 2df6747cb76f..a24f661b0270 100644 --- a/trunk/drivers/scsi/t128.c +++ b/trunk/drivers/scsi/t128.c @@ -260,7 +260,7 @@ int __init t128_detect(struct scsi_host_template * tpnt){ instance->irq = NCR5380_probe_irq(instance, T128_IRQS); if (instance->irq != SCSI_IRQ_NONE) - if (request_irq(instance->irq, t128_intr, IRQF_DISABLED, "t128", instance)) { + if (request_irq(instance->irq, t128_intr, SA_INTERRUPT, "t128", instance)) { printk("scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); instance->irq = SCSI_IRQ_NONE; diff --git a/trunk/drivers/scsi/tmscsim.c b/trunk/drivers/scsi/tmscsim.c index 9404ff3d4c79..91322aff241d 100644 --- a/trunk/drivers/scsi/tmscsim.c +++ b/trunk/drivers/scsi/tmscsim.c @@ -218,6 +218,7 @@ #endif #define DCBDEBUG1(x) C_NOP +#include #include #include #include @@ -2584,7 +2585,7 @@ static int __devinit dc390_probe_one(struct pci_dev *pdev, /* Reset Pending INT */ DC390_read8_(INT_Status, io_port); - if (request_irq(pdev->irq, do_DC390_Interrupt, IRQF_SHARED, + if (request_irq(pdev->irq, do_DC390_Interrupt, SA_SHIRQ, "tmscsim", pACB)) { printk(KERN_ERR "DC390: register IRQ error!\n"); goto out_release_region; diff --git a/trunk/drivers/scsi/tmscsim.h b/trunk/drivers/scsi/tmscsim.h index 9b66fa8d38d9..d4495272fb40 100644 --- a/trunk/drivers/scsi/tmscsim.h +++ b/trunk/drivers/scsi/tmscsim.h @@ -9,6 +9,7 @@ #define _TMSCSIM_H #include +#include #define SCSI_IRQ_NONE 255 diff --git a/trunk/drivers/scsi/u14-34f.c b/trunk/drivers/scsi/u14-34f.c index 57449611e714..33cd90fc657b 100644 --- a/trunk/drivers/scsi/u14-34f.c +++ b/trunk/drivers/scsi/u14-34f.c @@ -405,6 +405,7 @@ * the driver sets host->wish_block = TRUE for all ISA boards. */ +#include #include #include #include @@ -872,7 +873,7 @@ static int port_detect \ /* Board detected, allocate its IRQ */ if (request_irq(irq, do_interrupt_handler, - IRQF_DISABLED | ((subversion == ESA) ? IRQF_SHARED : 0), + SA_INTERRUPT | ((subversion == ESA) ? SA_SHIRQ : 0), driver_name, (void *) &sha[j])) { printk("%s: unable to allocate IRQ %u, detaching.\n", name, irq); goto freelock; diff --git a/trunk/drivers/scsi/wd33c93.c b/trunk/drivers/scsi/wd33c93.c index 680f38ab60d8..27307fe5a4c8 100644 --- a/trunk/drivers/scsi/wd33c93.c +++ b/trunk/drivers/scsi/wd33c93.c @@ -71,6 +71,7 @@ * Richard Hirst August 2000 */ +#include #include #include diff --git a/trunk/drivers/scsi/wd33c93.h b/trunk/drivers/scsi/wd33c93.h index edcb0365cf0c..193ec517d252 100644 --- a/trunk/drivers/scsi/wd33c93.h +++ b/trunk/drivers/scsi/wd33c93.h @@ -22,6 +22,7 @@ #ifndef WD33C93_H #define WD33C93_H +#include #define PROC_INTERFACE /* add code for /proc/scsi/wd33c93/xxx interface */ #ifdef PROC_INTERFACE diff --git a/trunk/drivers/scsi/wd7000.c b/trunk/drivers/scsi/wd7000.c index a0b61af48f1c..574955b78a24 100644 --- a/trunk/drivers/scsi/wd7000.c +++ b/trunk/drivers/scsi/wd7000.c @@ -1250,7 +1250,7 @@ static int wd7000_init(Adapter * host) return 0; - if (request_irq(host->irq, wd7000_intr, IRQF_DISABLED, "wd7000", host)) { + if (request_irq(host->irq, wd7000_intr, SA_INTERRUPT, "wd7000", host)) { printk("wd7000_init: can't get IRQ %d.\n", host->irq); return (0); } diff --git a/trunk/drivers/scsi/zalon.c b/trunk/drivers/scsi/zalon.c index 4b5f908d35c3..a6cfbb3b361c 100644 --- a/trunk/drivers/scsi/zalon.c +++ b/trunk/drivers/scsi/zalon.c @@ -136,7 +136,7 @@ zalon_probe(struct parisc_device *dev) if (!host) goto fail; - if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) { + if (request_irq(dev->irq, ncr53c8xx_intr, SA_SHIRQ, "zalon", host)) { printk(KERN_ERR "%s: irq problem with %d, detaching\n ", dev->dev.bus_id, dev->irq); goto fail; diff --git a/trunk/drivers/serial/21285.c b/trunk/drivers/serial/21285.c index 57438326b07f..9fd0de4b7afd 100644 --- a/trunk/drivers/serial/21285.c +++ b/trunk/drivers/serial/21285.c @@ -7,6 +7,7 @@ * * $Id: 21285.c,v 1.37 2002/07/28 10:03:27 rmk Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/serial/68328serial.c b/trunk/drivers/serial/68328serial.c index 993a702422ec..bff94541991c 100644 --- a/trunk/drivers/serial/68328serial.c +++ b/trunk/drivers/serial/68328serial.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/serial/68328serial.h b/trunk/drivers/serial/68328serial.h index 58aa2154655b..978f8a609f3d 100644 --- a/trunk/drivers/serial/68328serial.h +++ b/trunk/drivers/serial/68328serial.h @@ -11,6 +11,7 @@ #ifndef _MC683XX_SERIAL_H #define _MC683XX_SERIAL_H +#include struct serial_struct { int type; diff --git a/trunk/drivers/serial/68360serial.c b/trunk/drivers/serial/68360serial.c index e80e70e9b126..9843ae3d420e 100644 --- a/trunk/drivers/serial/68360serial.c +++ b/trunk/drivers/serial/68360serial.c @@ -20,6 +20,7 @@ * int rs_360_init(void); */ +#include #include #include #include diff --git a/trunk/drivers/serial/8250.c b/trunk/drivers/serial/8250.c index 0995430e4cf1..f361b356bd1d 100644 --- a/trunk/drivers/serial/8250.c +++ b/trunk/drivers/serial/8250.c @@ -19,6 +19,7 @@ * mapbase is the physical address of the IO port. * membase is an 'ioremapped' cookie. */ +#include #if defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -48,7 +49,7 @@ /* * Configuration: - * share_irqs - whether we pass IRQF_SHARED to request_irq(). This option + * share_irqs - whether we pass SA_SHIRQ to request_irq(). This option * is unsafe when used on edge-triggered interrupts. */ static unsigned int share_irqs = SERIAL8250_SHARE_IRQS; @@ -1400,7 +1401,7 @@ static void serial_do_unlink(struct irq_info *i, struct uart_8250_port *up) static int serial_link_irq_chain(struct uart_8250_port *up) { struct irq_info *i = irq_lists + up->port.irq; - int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? IRQF_SHARED : 0; + int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? SA_SHIRQ : 0; spin_lock_irq(&i->lock); diff --git a/trunk/drivers/serial/8250.h b/trunk/drivers/serial/8250.h index 91bd28f2bb47..490606b87095 100644 --- a/trunk/drivers/serial/8250.h +++ b/trunk/drivers/serial/8250.h @@ -15,6 +15,7 @@ * $Id: 8250.h,v 1.8 2002/07/21 21:32:30 rmk Exp $ */ +#include #include struct old_serial_port { diff --git a/trunk/drivers/serial/8250_mca.c b/trunk/drivers/serial/8250_mca.c index d10be944ad44..ac205256d5f3 100644 --- a/trunk/drivers/serial/8250_mca.c +++ b/trunk/drivers/serial/8250_mca.c @@ -8,6 +8,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/serial/8250_pci.c b/trunk/drivers/serial/8250_pci.c index a1d322f8a16c..864ef859be56 100644 --- a/trunk/drivers/serial/8250_pci.c +++ b/trunk/drivers/serial/8250_pci.c @@ -134,7 +134,7 @@ afavlab_setup(struct serial_private *priv, struct pciserial_board *board, * and Keystone have one Diva chip with 3 UARTs. Some later machines have * one Diva chip, but it has been expanded to 5 UARTs. */ -static int pci_hp_diva_init(struct pci_dev *dev) +static int __devinit pci_hp_diva_init(struct pci_dev *dev) { int rc = 0; @@ -194,7 +194,7 @@ pci_hp_diva_setup(struct serial_private *priv, struct pciserial_board *board, /* * Added for EKF Intel i960 serial boards */ -static int pci_inteli960ni_init(struct pci_dev *dev) +static int __devinit pci_inteli960ni_init(struct pci_dev *dev) { unsigned long oldval; @@ -216,7 +216,7 @@ static int pci_inteli960ni_init(struct pci_dev *dev) * seems to be mainly needed on card using the PLX which also use I/O * mapped memory. */ -static int pci_plx9050_init(struct pci_dev *dev) +static int __devinit pci_plx9050_init(struct pci_dev *dev) { u8 irq_config; void __iomem *p; @@ -314,7 +314,7 @@ sbs_setup(struct serial_private *priv, struct pciserial_board *board, /* global control register offset for SBS PMC-OctalPro */ #define OCT_REG_CR_OFF 0x500 -static int sbs_init(struct pci_dev *dev) +static int __devinit sbs_init(struct pci_dev *dev) { u8 __iomem *p; @@ -493,7 +493,7 @@ static const struct timedia_struct { { 0, NULL } }; -static int pci_timedia_init(struct pci_dev *dev) +static int __devinit pci_timedia_init(struct pci_dev *dev) { unsigned short *ids; int i, j; @@ -566,13 +566,13 @@ titan_400l_800l_setup(struct serial_private *priv, return setup_port(priv, port, bar, offset, board->reg_shift); } -static int pci_xircom_init(struct pci_dev *dev) +static int __devinit pci_xircom_init(struct pci_dev *dev) { msleep(100); return 0; } -static int pci_netmos_init(struct pci_dev *dev) +static int __devinit pci_netmos_init(struct pci_dev *dev) { /* subdevice 0x00PS means

parallel, serial */ unsigned int num_serial = dev->subsystem_device & 0xf; @@ -622,7 +622,7 @@ pci_default_setup(struct serial_private *priv, struct pciserial_board *board, */ static struct pci_serial_quirk pci_serial_quirks[] = { /* - * AFAVLAB cards - these may be called via parport_serial + * AFAVLAB cards. * It is not clear whether this applies to all products. */ { @@ -754,7 +754,7 @@ static struct pci_serial_quirk pci_serial_quirks[] = { .exit = __devexit_p(sbs_exit), }, /* - * SIIG cards - these may be called via parport_serial + * SIIG cards. */ { .vendor = PCI_VENDOR_ID_SIIG, @@ -811,7 +811,7 @@ static struct pci_serial_quirk pci_serial_quirks[] = { .setup = pci_default_setup, }, /* - * Netmos cards - these may be called via parport_serial + * Netmos cards */ { .vendor = PCI_VENDOR_ID_NETMOS, diff --git a/trunk/drivers/serial/8250_pnp.c b/trunk/drivers/serial/8250_pnp.c index 632f62d6ec7e..739bc84f91e9 100644 --- a/trunk/drivers/serial/8250_pnp.c +++ b/trunk/drivers/serial/8250_pnp.c @@ -431,8 +431,6 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) #endif port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; - if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE) - port.flags |= UPF_SHARE_IRQ; port.uartclk = 1843200; port.dev = &dev->dev; diff --git a/trunk/drivers/serial/amba-pl010.c b/trunk/drivers/serial/amba-pl010.c index 7311d8487c96..e920d196d0b1 100644 --- a/trunk/drivers/serial/amba-pl010.c +++ b/trunk/drivers/serial/amba-pl010.c @@ -31,6 +31,7 @@ * required, these have to be supplied via some other means (eg, GPIO) * and hooked into this driver. */ +#include #if defined(CONFIG_SERIAL_AMBA_PL010_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/trunk/drivers/serial/amba-pl011.c b/trunk/drivers/serial/amba-pl011.c index a8d7124e84a1..3d966cfc9a38 100644 --- a/trunk/drivers/serial/amba-pl011.c +++ b/trunk/drivers/serial/amba-pl011.c @@ -31,6 +31,7 @@ * required, these have to be supplied via some other means (eg, GPIO) * and hooked into this driver. */ +#include #if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/trunk/drivers/serial/at91_serial.c b/trunk/drivers/serial/at91_serial.c index a7d664383dae..df9500bdaded 100644 --- a/trunk/drivers/serial/at91_serial.c +++ b/trunk/drivers/serial/at91_serial.c @@ -22,6 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#include #include #include #include @@ -387,7 +388,7 @@ static int at91_startup(struct uart_port *port) /* * Allocate the IRQ */ - retval = request_irq(port->irq, at91_interrupt, IRQF_SHARED, "at91_serial", port); + retval = request_irq(port->irq, at91_interrupt, SA_SHIRQ, "at91_serial", port); if (retval) { printk("at91_serial: at91_startup - Can't get irq\n"); return retval; diff --git a/trunk/drivers/serial/clps711x.c b/trunk/drivers/serial/clps711x.c index f27d852ce50d..2691112c84ad 100644 --- a/trunk/drivers/serial/clps711x.c +++ b/trunk/drivers/serial/clps711x.c @@ -25,6 +25,7 @@ * $Id: clps711x.c,v 1.42 2002/07/28 10:03:28 rmk Exp $ * */ +#include #if defined(CONFIG_SERIAL_CLPS711X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c index 90ff96e3339b..5cba59ad7dc5 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c @@ -31,6 +31,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm1.c index 95afc37297a8..17406a05ce1f 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm1.c @@ -27,6 +27,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c index ef3bb476c432..cdba128250a9 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c @@ -27,6 +27,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/serial/crisv10.c b/trunk/drivers/serial/crisv10.c index cabd048c8636..b84137cdeb2b 100644 --- a/trunk/drivers/serial/crisv10.c +++ b/trunk/drivers/serial/crisv10.c @@ -415,7 +415,7 @@ * Fixed DEF_TX value that caused the serial transmitter pin (txd) to go to 0 when * closing the last filehandle, NASTY!. * Added break generation, not tested though! - * Use IRQF_SHARED when request_irq() for ser2 and ser3 (shared with) par0 and par1. + * Use SA_SHIRQ when request_irq() for ser2 and ser3 (shared with) par0 and par1. * You can't use them at the same time (yet..), but you can hopefully switch * between ser2/par0, ser3/par1 with the same kernel config. * Replaced some magic constants with defines @@ -425,6 +425,7 @@ static char *serial_version = "$Revision: 1.25 $"; +#include #include #include #include @@ -4942,55 +4943,55 @@ rs_init(void) /* Not needed in simulator. May only complicate stuff. */ /* hook the irq's for DMA channel 6 and 7, serial output and input, and some more... */ - if (request_irq(SERIAL_IRQ_NBR, ser_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial ", NULL)) + if (request_irq(SERIAL_IRQ_NBR, ser_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial ", NULL)) panic("irq8"); #ifdef CONFIG_ETRAX_SERIAL_PORT0 #ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT - if (request_irq(SER0_DMA_TX_IRQ_NBR, tr_interrupt, IRQF_DISABLED, "serial 0 dma tr", NULL)) + if (request_irq(SER0_DMA_TX_IRQ_NBR, tr_interrupt, SA_INTERRUPT, "serial 0 dma tr", NULL)) panic("irq22"); #endif #ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN - if (request_irq(SER0_DMA_RX_IRQ_NBR, rec_interrupt, IRQF_DISABLED, "serial 0 dma rec", NULL)) + if (request_irq(SER0_DMA_RX_IRQ_NBR, rec_interrupt, SA_INTERRUPT, "serial 0 dma rec", NULL)) panic("irq23"); #endif #endif #ifdef CONFIG_ETRAX_SERIAL_PORT1 #ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA8_OUT - if (request_irq(SER1_DMA_TX_IRQ_NBR, tr_interrupt, IRQF_DISABLED, "serial 1 dma tr", NULL)) + if (request_irq(SER1_DMA_TX_IRQ_NBR, tr_interrupt, SA_INTERRUPT, "serial 1 dma tr", NULL)) panic("irq24"); #endif #ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA9_IN - if (request_irq(SER1_DMA_RX_IRQ_NBR, rec_interrupt, IRQF_DISABLED, "serial 1 dma rec", NULL)) + if (request_irq(SER1_DMA_RX_IRQ_NBR, rec_interrupt, SA_INTERRUPT, "serial 1 dma rec", NULL)) panic("irq25"); #endif #endif #ifdef CONFIG_ETRAX_SERIAL_PORT2 /* DMA Shared with par0 (and SCSI0 and ATA) */ #ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT - if (request_irq(SER2_DMA_TX_IRQ_NBR, tr_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial 2 dma tr", NULL)) + if (request_irq(SER2_DMA_TX_IRQ_NBR, tr_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial 2 dma tr", NULL)) panic("irq18"); #endif #ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN - if (request_irq(SER2_DMA_RX_IRQ_NBR, rec_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial 2 dma rec", NULL)) + if (request_irq(SER2_DMA_RX_IRQ_NBR, rec_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial 2 dma rec", NULL)) panic("irq19"); #endif #endif #ifdef CONFIG_ETRAX_SERIAL_PORT3 /* DMA Shared with par1 (and SCSI1 and Extern DMA 0) */ #ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA4_OUT - if (request_irq(SER3_DMA_TX_IRQ_NBR, tr_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial 3 dma tr", NULL)) + if (request_irq(SER3_DMA_TX_IRQ_NBR, tr_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial 3 dma tr", NULL)) panic("irq20"); #endif #ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA5_IN - if (request_irq(SER3_DMA_RX_IRQ_NBR, rec_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial 3 dma rec", NULL)) + if (request_irq(SER3_DMA_RX_IRQ_NBR, rec_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial 3 dma rec", NULL)) panic("irq21"); #endif #endif #ifdef CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST - if (request_irq(TIMER1_IRQ_NBR, timeout_interrupt, IRQF_SHARED | IRQF_DISABLED, + if (request_irq(TIMER1_IRQ_NBR, timeout_interrupt, SA_SHIRQ | SA_INTERRUPT, "fast serial dma timeout", NULL)) { printk(KERN_CRIT "err: timer1 irq\n"); } diff --git a/trunk/drivers/serial/crisv10.h b/trunk/drivers/serial/crisv10.h index f30b93d6ef79..1800c0e7531a 100644 --- a/trunk/drivers/serial/crisv10.h +++ b/trunk/drivers/serial/crisv10.h @@ -7,6 +7,7 @@ #ifndef _ETRAX_SERIAL_H #define _ETRAX_SERIAL_H +#include #include #include diff --git a/trunk/drivers/serial/dz.c b/trunk/drivers/serial/dz.c index d119c8296a78..466d06cc7d37 100644 --- a/trunk/drivers/serial/dz.c +++ b/trunk/drivers/serial/dz.c @@ -26,6 +26,7 @@ #undef DEBUG_DZ +#include #include #include #include @@ -797,7 +798,7 @@ int __init dz_init(void) restore_flags(flags); if (request_irq(dz_ports[0].port.irq, dz_interrupt, - IRQF_DISABLED, "DZ", &dz_ports[0])) + SA_INTERRUPT, "DZ", &dz_ports[0])) panic("Unable to register DZ interrupt"); ret = uart_register_driver(&dz_reg); diff --git a/trunk/drivers/serial/icom.c b/trunk/drivers/serial/icom.c index a3c00a252149..144a7a352b28 100644 --- a/trunk/drivers/serial/icom.c +++ b/trunk/drivers/serial/icom.c @@ -24,6 +24,7 @@ */ #define SERIAL_DO_RESTART #include +#include #include #include #include @@ -1563,7 +1564,7 @@ static int __devinit icom_probe(struct pci_dev *dev, /* save off irq and request irq line */ if ( (retval = request_irq(dev->irq, icom_interrupt, - IRQF_DISABLED | IRQF_SHARED, ICOM_DRIVER_NAME, + SA_INTERRUPT | SA_SHIRQ, ICOM_DRIVER_NAME, (void *) icom_adapter))) { goto probe_exit2; } diff --git a/trunk/drivers/serial/imx.c b/trunk/drivers/serial/imx.c index 4a142d6b8f38..da85bafa0942 100644 --- a/trunk/drivers/serial/imx.c +++ b/trunk/drivers/serial/imx.c @@ -25,6 +25,7 @@ * [29-Mar-2005] Mike Lee * Added hardware handshake */ +#include #if defined(CONFIG_SERIAL_IMX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -404,7 +405,7 @@ static int imx_startup(struct uart_port *port) if (retval) goto error_out2; retval = request_irq(sport->rtsirq, imx_rtsint, - IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, + SA_TRIGGER_FALLING | SA_TRIGGER_RISING, DRIVER_NAME, sport); if (retval) goto error_out3; diff --git a/trunk/drivers/serial/ioc4_serial.c b/trunk/drivers/serial/ioc4_serial.c index 576ca1eaa2b6..717e47bbd784 100644 --- a/trunk/drivers/serial/ioc4_serial.c +++ b/trunk/drivers/serial/ioc4_serial.c @@ -2855,7 +2855,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd) control->ic_soft = soft; /* Hook up interrupt handler */ - if (!request_irq(idd->idd_pdev->irq, ioc4_intr, IRQF_SHARED, + if (!request_irq(idd->idd_pdev->irq, ioc4_intr, SA_SHIRQ, "sgi-ioc4serial", soft)) { control->ic_irq = idd->idd_pdev->irq; } else { diff --git a/trunk/drivers/serial/ip22zilog.c b/trunk/drivers/serial/ip22zilog.c index 342042889f6e..56b093ecd779 100644 --- a/trunk/drivers/serial/ip22zilog.c +++ b/trunk/drivers/serial/ip22zilog.c @@ -12,6 +12,7 @@ * Copyright (C) 2002 Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2002 David S. Miller (davem@redhat.com) */ +#include #include #include #include diff --git a/trunk/drivers/serial/jsm/jsm_driver.c b/trunk/drivers/serial/jsm/jsm_driver.c index 244f63be3a03..b3e1f71be4da 100644 --- a/trunk/drivers/serial/jsm/jsm_driver.c +++ b/trunk/drivers/serial/jsm/jsm_driver.c @@ -121,7 +121,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) } rc = request_irq(brd->irq, brd->bd_ops->intr, - IRQF_DISABLED|IRQF_SHARED, "JSM", brd); + SA_INTERRUPT|SA_SHIRQ, "JSM", brd); if (rc) { printk(KERN_WARNING "Failed to hook IRQ %d\n",brd->irq); goto out_iounmap; diff --git a/trunk/drivers/serial/m32r_sio.c b/trunk/drivers/serial/m32r_sio.c index e7fe4bb46eca..6a2a25d9b596 100644 --- a/trunk/drivers/serial/m32r_sio.c +++ b/trunk/drivers/serial/m32r_sio.c @@ -25,6 +25,7 @@ * membase is an 'ioremapped' cookie. This is compatible with the old * serial.c driver, and is currently the preferred form. */ +#include #if defined(CONFIG_SERIAL_M32R_SIO_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -542,7 +543,7 @@ static void serial_do_unlink(struct irq_info *i, struct uart_sio_port *up) static int serial_link_irq_chain(struct uart_sio_port *up) { struct irq_info *i = irq_lists + up->port.irq; - int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? IRQF_SHARED : 0; + int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? SA_SHIRQ : 0; spin_lock_irq(&i->lock); diff --git a/trunk/drivers/serial/m32r_sio.h b/trunk/drivers/serial/m32r_sio.h index 849f1b2c2531..7c3ec24f7e50 100644 --- a/trunk/drivers/serial/m32r_sio.h +++ b/trunk/drivers/serial/m32r_sio.h @@ -15,6 +15,7 @@ * (at your option) any later version. */ +#include struct m32r_sio_probe { struct module *owner; diff --git a/trunk/drivers/serial/m32r_sio_reg.h b/trunk/drivers/serial/m32r_sio_reg.h index 4671473793e3..9c864529451b 100644 --- a/trunk/drivers/serial/m32r_sio_reg.h +++ b/trunk/drivers/serial/m32r_sio_reg.h @@ -15,6 +15,7 @@ #ifndef _M32R_SIO_REG_H #define _M32R_SIO_REG_H +#include #ifdef CONFIG_SERIAL_M32R_PLDSIO diff --git a/trunk/drivers/serial/mcfserial.c b/trunk/drivers/serial/mcfserial.c index 832abd3c4706..29c0630e3e64 100644 --- a/trunk/drivers/serial/mcfserial.c +++ b/trunk/drivers/serial/mcfserial.c @@ -1596,7 +1596,7 @@ static void mcfrs_irqinit(struct mcf_serial *info) /* Clear mask, so no surprise interrupts. */ uartp[MCFUART_UIMR] = 0; - if (request_irq(info->irq, mcfrs_interrupt, IRQF_DISABLED, + if (request_irq(info->irq, mcfrs_interrupt, SA_INTERRUPT, "ColdFire UART", NULL)) { printk("MCFRS: Unable to attach ColdFire UART %d interrupt " "vector=%d\n", info->line, info->irq); diff --git a/trunk/drivers/serial/mcfserial.h b/trunk/drivers/serial/mcfserial.h index 56420e2cb110..a2b28e8629f9 100644 --- a/trunk/drivers/serial/mcfserial.h +++ b/trunk/drivers/serial/mcfserial.h @@ -14,6 +14,7 @@ #ifndef _MCF_SERIAL_H #define _MCF_SERIAL_H +#include #include #ifdef __KERNEL__ diff --git a/trunk/drivers/serial/mpc52xx_uart.c b/trunk/drivers/serial/mpc52xx_uart.c index 7708e5dd3656..1aa34844218c 100644 --- a/trunk/drivers/serial/mpc52xx_uart.c +++ b/trunk/drivers/serial/mpc52xx_uart.c @@ -44,6 +44,7 @@ * will be mapped to. */ +#include #include #include #include @@ -190,7 +191,7 @@ mpc52xx_uart_startup(struct uart_port *port) /* Request IRQ */ ret = request_irq(port->irq, mpc52xx_uart_int, - IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "mpc52xx_psc_uart", port); + SA_INTERRUPT | SA_SAMPLE_RANDOM, "mpc52xx_psc_uart", port); if (ret) return ret; @@ -726,7 +727,8 @@ mpc52xx_uart_probe(struct platform_device *dev) spin_lock_init(&port->lock); port->uartclk = __res.bi_ipbfreq / 2; /* Look at CTLR doc */ - port->fifosize = 512; + port->fifosize = 255; /* Should be 512 ! But it can't be */ + /* stored in a unsigned char */ port->iotype = UPIO_MEM; port->flags = UPF_BOOT_AUTOCONF | ( uart_console(port) ? 0 : UPF_IOREMAP ); diff --git a/trunk/drivers/serial/mpsc.c b/trunk/drivers/serial/mpsc.c index 63d2a66e563b..1cd102f84bfa 100644 --- a/trunk/drivers/serial/mpsc.c +++ b/trunk/drivers/serial/mpsc.c @@ -50,6 +50,7 @@ * 4) AFAICT, hardware flow control isn't supported by the controller --MAG. */ +#include #if defined(CONFIG_SERIAL_MPSC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -1412,7 +1413,7 @@ mpsc_startup(struct uart_port *port) /* If irq's are shared, need to set flag */ if (mpsc_ports[0].port.irq == mpsc_ports[1].port.irq) - flag = IRQF_SHARED; + flag = SA_SHIRQ; if (request_irq(pi->port.irq, mpsc_sdma_intr, flag, "mpsc-sdma", pi)) diff --git a/trunk/drivers/serial/mux.c b/trunk/drivers/serial/mux.c index 4a1c9983f38f..64c0e89124c9 100644 --- a/trunk/drivers/serial/mux.c +++ b/trunk/drivers/serial/mux.c @@ -16,6 +16,7 @@ ** */ +#include #include #include #include diff --git a/trunk/drivers/serial/pmac_zilog.c b/trunk/drivers/serial/pmac_zilog.c index bfd2a22759eb..e3ba7e17a240 100644 --- a/trunk/drivers/serial/pmac_zilog.c +++ b/trunk/drivers/serial/pmac_zilog.c @@ -42,6 +42,7 @@ #undef DEBUG_HARD #undef USE_CTRL_O_SYSRQ +#include #include #include @@ -934,7 +935,7 @@ static int pmz_startup(struct uart_port *port) } pmz_get_port_A(uap)->flags |= PMACZILOG_FLAG_IS_IRQ_ON; - if (request_irq(uap->port.irq, pmz_interrupt, IRQF_SHARED, "PowerMac Zilog", uap)) { + if (request_irq(uap->port.irq, pmz_interrupt, SA_SHIRQ, "PowerMac Zilog", uap)) { dev_err(&uap->dev->ofdev.dev, "Unable to register zs interrupt handler.\n"); pmz_set_scc_power(uap, 0); @@ -1443,8 +1444,8 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) uap->flags &= ~PMACZILOG_FLAG_HAS_DMA; goto no_dma; } - uap->tx_dma_irq = irq_of_parse_and_map(np, 1); - uap->rx_dma_irq = irq_of_parse_and_map(np, 2); + uap->tx_dma_irq = np->intrs[1].line; + uap->rx_dma_irq = np->intrs[2].line; } no_dma: @@ -1491,7 +1492,7 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) * Init remaining bits of "port" structure */ uap->port.iotype = UPIO_MEM; - uap->port.irq = irq_of_parse_and_map(np, 0); + uap->port.irq = np->intrs[0].line; uap->port.uartclk = ZS_CLOCK; uap->port.fifosize = 1; uap->port.ops = &pmz_pops; diff --git a/trunk/drivers/serial/pxa.c b/trunk/drivers/serial/pxa.c index a720953a404e..0fa0ccc9ed27 100644 --- a/trunk/drivers/serial/pxa.c +++ b/trunk/drivers/serial/pxa.c @@ -24,6 +24,7 @@ * with the serial core maintainer satisfaction to appear soon. */ +#include #if defined(CONFIG_SERIAL_PXA_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -389,7 +390,7 @@ static int serial_pxa_startup(struct uart_port *port) /* * Finally, enable interrupts. Note: Modem status interrupts - * are set via set_termios(), which will be occurring imminently + * are set via set_termios(), which will be occuring imminently * anyway, so we don't enable them here. */ up->ier = UART_IER_RLSI | UART_IER_RDI | UART_IER_RTOIE | UART_IER_UUE; diff --git a/trunk/drivers/serial/s3c2410.c b/trunk/drivers/serial/s3c2410.c index 392bffcf96e8..4c62ab949ecc 100644 --- a/trunk/drivers/serial/s3c2410.c +++ b/trunk/drivers/serial/s3c2410.c @@ -55,6 +55,7 @@ * BJD, 04-Nov-2004 */ +#include #if defined(CONFIG_SERIAL_S3C2410_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/trunk/drivers/serial/sa1100.c b/trunk/drivers/serial/sa1100.c index db3486d33870..8bbd8567669c 100644 --- a/trunk/drivers/serial/sa1100.c +++ b/trunk/drivers/serial/sa1100.c @@ -24,6 +24,7 @@ * $Id: sa1100.c,v 1.50 2002/07/29 14:41:04 rmk Exp $ * */ +#include #if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/trunk/drivers/serial/serial_core.c b/trunk/drivers/serial/serial_core.c index d5f636fbf29a..7dc1e67b6851 100644 --- a/trunk/drivers/serial/serial_core.c +++ b/trunk/drivers/serial/serial_core.c @@ -22,6 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -49,12 +50,6 @@ */ static DEFINE_MUTEX(port_mutex); -/* - * lockdep: port->lock is initialized in two places, but we - * want only one lock-class: - */ -static struct lock_class_key port_lock_key; - #define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) #define uart_users(state) ((state)->count + ((state)->info ? (state)->info->blocked_open : 0)) @@ -696,8 +691,7 @@ static int uart_set_info(struct uart_state *state, (new_serial.baud_base != port->uartclk / 16) || (close_delay != state->close_delay) || (closing_wait != state->closing_wait) || - (new_serial.xmit_fifo_size && - new_serial.xmit_fifo_size != port->fifosize) || + (new_serial.xmit_fifo_size != port->fifosize) || (((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0)) goto exit; port->flags = ((port->flags & ~UPF_USR_MASK) | @@ -802,8 +796,7 @@ static int uart_set_info(struct uart_state *state, port->custom_divisor = new_serial.custom_divisor; state->close_delay = close_delay; state->closing_wait = closing_wait; - if (new_serial.xmit_fifo_size) - port->fifosize = new_serial.xmit_fifo_size; + port->fifosize = new_serial.xmit_fifo_size; if (state->info->tty) state->info->tty->low_latency = (port->flags & UPF_LOW_LATENCY) ? 1 : 0; @@ -1873,7 +1866,6 @@ uart_set_options(struct uart_port *port, struct console *co, * early. */ spin_lock_init(&port->lock); - lockdep_set_class(&port->lock, &port_lock_key); memset(&termios, 0, sizeof(struct termios)); @@ -2256,10 +2248,8 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) * If this port is a console, then the spinlock is already * initialised. */ - if (!(uart_console(port) && (port->cons->flags & CON_ENABLED))) { + if (!(uart_console(port) && (port->cons->flags & CON_ENABLED))) spin_lock_init(&port->lock); - lockdep_set_class(&port->lock, &port_lock_key); - } uart_configure_port(drv, state, port); diff --git a/trunk/drivers/serial/serial_cs.c b/trunk/drivers/serial/serial_cs.c index cbf260bc225d..2c70773543e0 100644 --- a/trunk/drivers/serial/serial_cs.c +++ b/trunk/drivers/serial/serial_cs.c @@ -786,7 +786,6 @@ static struct pcmcia_device_id serial_ids[] = { PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "COMpad4.cis"), PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"), PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "RS-COM-2P.cis"), - PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "GLOBETROTTER.cis"), /* too generic */ /* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */ /* PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0160, 0x0002), */ diff --git a/trunk/drivers/serial/serial_lh7a40x.c b/trunk/drivers/serial/serial_lh7a40x.c index 23ddedbaec08..776d4ff06084 100644 --- a/trunk/drivers/serial/serial_lh7a40x.c +++ b/trunk/drivers/serial/serial_lh7a40x.c @@ -27,6 +27,7 @@ * */ +#include #if defined(CONFIG_SERIAL_LH7A40X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/trunk/drivers/serial/serial_txx9.c b/trunk/drivers/serial/serial_txx9.c index b361669f85a1..a901a7e446f3 100644 --- a/trunk/drivers/serial/serial_txx9.c +++ b/trunk/drivers/serial/serial_txx9.c @@ -38,6 +38,7 @@ * Fix some spin_locks. * Do not call uart_add_one_port for absent ports. */ +#include #if defined(CONFIG_SERIAL_TXX9_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -495,7 +496,7 @@ static int serial_txx9_startup(struct uart_port *port) sio_out(up, TXX9_SIDISR, 0); retval = request_irq(up->port.irq, serial_txx9_interrupt, - IRQF_SHARED, "serial_txx9", up); + SA_SHIRQ, "serial_txx9", up); if (retval) return retval; diff --git a/trunk/drivers/serial/sh-sci.c b/trunk/drivers/serial/sh-sci.c index 301573373c30..d97f3ca6cc29 100644 --- a/trunk/drivers/serial/sh-sci.c +++ b/trunk/drivers/serial/sh-sci.c @@ -20,6 +20,7 @@ #undef DEBUG +#include #include #include #include @@ -841,7 +842,7 @@ static int sci_request_irq(struct sci_port *port) printk(KERN_ERR "sci: Cannot allocate irq.(IRQ=0)\n"); return -ENODEV; } - if (request_irq(port->irqs[0], sci_mpxed_interrupt, IRQF_DISABLED, + if (request_irq(port->irqs[0], sci_mpxed_interrupt, SA_INTERRUPT, "sci", port)) { printk(KERN_ERR "sci: Cannot allocate irq.\n"); return -ENODEV; @@ -850,7 +851,7 @@ static int sci_request_irq(struct sci_port *port) for (i = 0; i < ARRAY_SIZE(handlers); i++) { if (!port->irqs[i]) continue; - if (request_irq(port->irqs[i], handlers[i], IRQF_DISABLED, + if (request_irq(port->irqs[i], handlers[i], SA_INTERRUPT, desc[i], port)) { printk(KERN_ERR "sci: Cannot allocate irq.\n"); return -ENODEV; diff --git a/trunk/drivers/serial/sh-sci.h b/trunk/drivers/serial/sh-sci.h index ab320fa3237c..1f14bb4382f6 100644 --- a/trunk/drivers/serial/sh-sci.h +++ b/trunk/drivers/serial/sh-sci.h @@ -10,6 +10,7 @@ * Modified to support SH7300(SH-Mobile) SCIF. Takashi Kusuda (Jun 2003). * Modified to support H8/300 Series Yoshinori Sato (Feb 2004). */ +#include #include #if defined(__H8300H__) || defined(__H8300S__) diff --git a/trunk/drivers/serial/sn_console.c b/trunk/drivers/serial/sn_console.c index 2f148e5b9255..60ea4a3f0713 100644 --- a/trunk/drivers/serial/sn_console.c +++ b/trunk/drivers/serial/sn_console.c @@ -37,6 +37,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan */ +#include #include #include #include @@ -648,7 +649,7 @@ static irqreturn_t sn_sal_interrupt(int irq, void *dev_id, struct pt_regs *regs) static int sn_sal_connect_interrupt(struct sn_cons_port *port) { if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt, - IRQF_DISABLED | IRQF_SHARED, + SA_INTERRUPT | SA_SHIRQ, "SAL console driver", port) >= 0) { return SGI_UART_VECTOR; } diff --git a/trunk/drivers/serial/suncore.c b/trunk/drivers/serial/suncore.c index e35d9ab359f1..fa4ae94243c2 100644 --- a/trunk/drivers/serial/suncore.c +++ b/trunk/drivers/serial/suncore.c @@ -10,6 +10,7 @@ * Copyright (C) 2002 David S. Miller (davem@redhat.com) */ +#include #include #include #include diff --git a/trunk/drivers/serial/sunhv.c b/trunk/drivers/serial/sunhv.c index f851f0f44f9b..d36bc4003399 100644 --- a/trunk/drivers/serial/sunhv.c +++ b/trunk/drivers/serial/sunhv.c @@ -20,8 +20,8 @@ #include #include -#include -#include +#include +#include #include #if defined(CONFIG_MAGIC_SYSRQ) @@ -407,120 +407,144 @@ static inline struct console *SUNHV_CONSOLE(void) return &sunhv_console; } -static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match) +static int __init hv_console_compatible(char *buf, int len) +{ + while (len) { + int this_len; + + if (!strcmp(buf, "qcn")) + return 1; + + this_len = strlen(buf) + 1; + + buf += this_len; + len -= this_len; + } + + return 0; +} + +static unsigned int __init get_interrupt(void) +{ + struct device_node *dev_node; + + dev_node = sun4v_vdev_root->child; + while (dev_node != NULL) { + struct property *prop; + + if (strcmp(dev_node->name, "console")) + goto next_sibling; + + prop = of_find_property(dev_node, "compatible", NULL); + if (!prop) + goto next_sibling; + + if (hv_console_compatible(prop->value, prop->length)) + break; + + next_sibling: + dev_node = dev_node->sibling; + } + if (!dev_node) + return 0; + + /* Ok, the this is the OBP node for the sun4v hypervisor + * console device. Decode the interrupt. + */ + return sun4v_vdev_device_interrupt(dev_node); +} + +static int __init sunhv_init(void) { struct uart_port *port; - int err; + int ret; - if (op->irqs[0] == 0xffffffff) + if (tlb_type != hypervisor) return -ENODEV; - port = kzalloc(sizeof(struct uart_port), GFP_KERNEL); + port = kmalloc(sizeof(struct uart_port), GFP_KERNEL); if (unlikely(!port)) return -ENOMEM; - sunhv_port = port; + memset(port, 0, sizeof(struct uart_port)); port->line = 0; port->ops = &sunhv_pops; port->type = PORT_SUNHV; port->uartclk = ( 29491200 / 16 ); /* arbitrary */ + /* Set this just to make uart_configure_port() happy. */ port->membase = (unsigned char __iomem *) __pa(port); - port->irq = op->irqs[0]; - - port->dev = &op->dev; + port->irq = get_interrupt(); + if (!port->irq) { + kfree(port); + return -ENODEV; + } sunhv_reg.minor = sunserial_current_minor; sunhv_reg.nr = 1; - err = uart_register_driver(&sunhv_reg); - if (err) - goto out_free_port; + ret = uart_register_driver(&sunhv_reg); + if (ret < 0) { + printk(KERN_ERR "SUNHV: uart_register_driver() failed %d\n", + ret); + kfree(port); + + return ret; + } sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64; sunserial_current_minor += 1; sunhv_reg.cons = SUNHV_CONSOLE(); - err = uart_add_one_port(&sunhv_reg, port); - if (err) - goto out_unregister_driver; + sunhv_port = port; - err = request_irq(port->irq, sunhv_interrupt, 0, "hvcons", port); - if (err) - goto out_remove_port; + ret = uart_add_one_port(&sunhv_reg, port); + if (ret < 0) { + printk(KERN_ERR "SUNHV: uart_add_one_port() failed %d\n", ret); + sunserial_current_minor -= 1; + uart_unregister_driver(&sunhv_reg); + kfree(port); + sunhv_port = NULL; + return -ENODEV; + } - dev_set_drvdata(&op->dev, port); + if (request_irq(port->irq, sunhv_interrupt, + SA_SHIRQ, "serial(sunhv)", port)) { + printk(KERN_ERR "sunhv: Cannot register IRQ\n"); + uart_remove_one_port(&sunhv_reg, port); + sunserial_current_minor -= 1; + uart_unregister_driver(&sunhv_reg); + kfree(port); + sunhv_port = NULL; + return -ENODEV; + } return 0; - -out_remove_port: - uart_remove_one_port(&sunhv_reg, port); - -out_unregister_driver: - sunserial_current_minor -= 1; - uart_unregister_driver(&sunhv_reg); - -out_free_port: - kfree(port); - sunhv_port = NULL; - return err; } -static int __devexit hv_remove(struct of_device *dev) +static void __exit sunhv_exit(void) { - struct uart_port *port = dev_get_drvdata(&dev->dev); + struct uart_port *port = sunhv_port; + + BUG_ON(!port); free_irq(port->irq, port); uart_remove_one_port(&sunhv_reg, port); - sunserial_current_minor -= 1; + uart_unregister_driver(&sunhv_reg); - kfree(port); + kfree(sunhv_port); sunhv_port = NULL; - - dev_set_drvdata(&dev->dev, NULL); - - return 0; -} - -static struct of_device_id hv_match[] = { - { - .name = "console", - .compatible = "qcn", - }, - {}, -}; -MODULE_DEVICE_TABLE(of, hv_match); - -static struct of_platform_driver hv_driver = { - .name = "hv", - .match_table = hv_match, - .probe = hv_probe, - .remove = __devexit_p(hv_remove), -}; - -static int __init sunhv_init(void) -{ - if (tlb_type != hypervisor) - return -ENODEV; - - return of_register_driver(&hv_driver, &of_bus_type); -} - -static void __exit sunhv_exit(void) -{ - of_unregister_driver(&hv_driver); } module_init(sunhv_init); module_exit(sunhv_exit); MODULE_AUTHOR("David S. Miller"); -MODULE_DESCRIPTION("SUN4V Hypervisor console driver"); -MODULE_VERSION("2.0"); +MODULE_DESCRIPTION("SUN4V Hypervisor console driver") MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/serial/sunsab.c b/trunk/drivers/serial/sunsab.c index 0dbd4df44c05..141fedbefbc4 100644 --- a/trunk/drivers/serial/sunsab.c +++ b/trunk/drivers/serial/sunsab.c @@ -15,6 +15,7 @@ * David S. Miller */ +#include #include #include #include @@ -1027,7 +1028,7 @@ static int __devinit sunsab_init_one(struct uart_sunsab_port *up, int err; err = request_irq(up->port.irq, sunsab_interrupt, - IRQF_SHARED, "sab", up); + SA_SHIRQ, "sab", up); if (err) { of_iounmap(up->port.membase, sizeof(union sab82532_async_regs)); diff --git a/trunk/drivers/serial/sunsu.c b/trunk/drivers/serial/sunsu.c index f9013baba05b..73a043b914ef 100644 --- a/trunk/drivers/serial/sunsu.c +++ b/trunk/drivers/serial/sunsu.c @@ -15,6 +15,7 @@ * David S. Miller (davem@davemloft.net), 2002-Jul-29 */ +#include #include #include #include @@ -667,10 +668,10 @@ static int sunsu_startup(struct uart_port *port) if (up->su_type != SU_PORT_PORT) { retval = request_irq(up->port.irq, sunsu_kbd_ms_interrupt, - IRQF_SHARED, su_typev[up->su_type], up); + SA_SHIRQ, su_typev[up->su_type], up); } else { retval = request_irq(up->port.irq, sunsu_serial_interrupt, - IRQF_SHARED, su_typev[up->su_type], up); + SA_SHIRQ, su_typev[up->su_type], up); } if (retval) { printk("su: Cannot register IRQ %d\n", up->port.irq); @@ -1438,8 +1439,6 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m err = sunsu_kbd_ms_init(up); if (err) goto out_unmap; - - return 0; } up->port.flags |= UPF_BOOT_AUTOCONF; diff --git a/trunk/drivers/serial/sunzilog.c b/trunk/drivers/serial/sunzilog.c index a1456d9352cb..1caa286a6be6 100644 --- a/trunk/drivers/serial/sunzilog.c +++ b/trunk/drivers/serial/sunzilog.c @@ -12,6 +12,7 @@ * Copyright (C) 2002, 2006 David S. Miller (davem@davemloft.net) */ +#include #include #include #include @@ -1354,7 +1355,7 @@ static int __devinit zs_probe(struct of_device *dev, const struct of_device_id * if (zilog_irq == -1) { zilog_irq = op->irqs[0]; - err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED, + err = request_irq(zilog_irq, sunzilog_interrupt, SA_SHIRQ, "zs", sunzilog_irq_chain); if (err) { of_iounmap(rp, sizeof(struct zilog_layout)); diff --git a/trunk/drivers/serial/v850e_uart.c b/trunk/drivers/serial/v850e_uart.c index f802867c95c5..a0da2aaf71c4 100644 --- a/trunk/drivers/serial/v850e_uart.c +++ b/trunk/drivers/serial/v850e_uart.c @@ -372,13 +372,13 @@ static int v850e_uart_startup (struct uart_port *port) /* Alloc RX irq. */ err = request_irq (V850E_UART_RX_IRQ (port->line), v850e_uart_rx_irq, - IRQF_DISABLED, "v850e_uart", port); + SA_INTERRUPT, "v850e_uart", port); if (err) return err; /* Alloc TX irq. */ err = request_irq (V850E_UART_TX_IRQ (port->line), v850e_uart_tx_irq, - IRQF_DISABLED, "v850e_uart", port); + SA_INTERRUPT, "v850e_uart", port); if (err) { free_irq (V850E_UART_RX_IRQ (port->line), port); return err; diff --git a/trunk/drivers/serial/vr41xx_siu.c b/trunk/drivers/serial/vr41xx_siu.c index e93d0edc2e08..017571ffa19c 100644 --- a/trunk/drivers/serial/vr41xx_siu.c +++ b/trunk/drivers/serial/vr41xx_siu.c @@ -19,6 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #if defined(CONFIG_SERIAL_VR41XX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/trunk/drivers/sn/ioc3.c b/trunk/drivers/sn/ioc3.c index 6c7e0352d561..ed946311d3a4 100644 --- a/trunk/drivers/sn/ioc3.c +++ b/trunk/drivers/sn/ioc3.c @@ -7,6 +7,7 @@ * Pat Gefre - IOC3 serial port IRQ demuxer */ +#include #include #include #include @@ -706,7 +707,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) writel(~0, &idd->vma->eisr); idd->dual_irq = 1; - if (!request_irq(pdev->irq, ioc3_intr_eth, IRQF_SHARED, + if (!request_irq(pdev->irq, ioc3_intr_eth, SA_SHIRQ, "ioc3-eth", (void *)idd)) { idd->irq_eth = pdev->irq; } else { @@ -714,7 +715,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) "%s : request_irq fails for IRQ 0x%x\n ", __FUNCTION__, pdev->irq); } - if (!request_irq(pdev->irq+2, ioc3_intr_io, IRQF_SHARED, + if (!request_irq(pdev->irq+2, ioc3_intr_io, SA_SHIRQ, "ioc3-io", (void *)idd)) { idd->irq_io = pdev->irq+2; } else { @@ -723,7 +724,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) __FUNCTION__, pdev->irq+2); } } else { - if (!request_irq(pdev->irq, ioc3_intr_io, IRQF_SHARED, + if (!request_irq(pdev->irq, ioc3_intr_io, SA_SHIRQ, "ioc3", (void *)idd)) { idd->irq_io = pdev->irq; } else { diff --git a/trunk/drivers/spi/spi.c b/trunk/drivers/spi/spi.c index 146298ad7371..ed1cdf6ac8f3 100644 --- a/trunk/drivers/spi/spi.c +++ b/trunk/drivers/spi/spi.c @@ -510,7 +510,7 @@ static void spi_complete(void *arg) */ int spi_sync(struct spi_device *spi, struct spi_message *message) { - DECLARE_COMPLETION_ONSTACK(done); + DECLARE_COMPLETION(done); int status; message->complete = spi_complete; diff --git a/trunk/drivers/spi/spi_bitbang.c b/trunk/drivers/spi/spi_bitbang.c index a23862ef72b2..dd2f950b21a7 100644 --- a/trunk/drivers/spi/spi_bitbang.c +++ b/trunk/drivers/spi/spi_bitbang.c @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/drivers/spi/spi_butterfly.c b/trunk/drivers/spi/spi_butterfly.c index 39d9b20f2038..a006a1ee27ac 100644 --- a/trunk/drivers/spi/spi_butterfly.c +++ b/trunk/drivers/spi/spi_butterfly.c @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/tc/lk201.c b/trunk/drivers/tc/lk201.c index 757dec9c7ee9..cf10d5cdfb93 100644 --- a/trunk/drivers/tc/lk201.c +++ b/trunk/drivers/tc/lk201.c @@ -8,6 +8,7 @@ * Copyright (C) 2001, 2002, 2003, 2004 Maciej W. Rozycki */ +#include #include #include diff --git a/trunk/drivers/tc/zs.c b/trunk/drivers/tc/zs.c index 5e8a27620f6f..7f27b356eaf7 100644 --- a/trunk/drivers/tc/zs.c +++ b/trunk/drivers/tc/zs.c @@ -39,6 +39,7 @@ * is shared with DSRS(DTE) at pin 23. */ +#include #include #include #include @@ -1791,7 +1792,7 @@ int __init zs_init(void) zs_soft[channel].clk_divisor = 16; zs_soft[channel].zs_baud = get_zsbaud(&zs_soft[channel]); - if (request_irq(zs_soft[channel].irq, rs_interrupt, IRQF_SHARED, + if (request_irq(zs_soft[channel].irq, rs_interrupt, SA_SHIRQ, "scc", &zs_soft[channel])) printk(KERN_ERR "decserial: can't get irq %d\n", zs_soft[channel].irq); diff --git a/trunk/drivers/usb/core/buffer.c b/trunk/drivers/usb/core/buffer.c index f4f4ef0f377a..ad742cec94fa 100644 --- a/trunk/drivers/usb/core/buffer.c +++ b/trunk/drivers/usb/core/buffer.c @@ -5,6 +5,7 @@ * and should work with all USB controllers, regardles of bus type. */ +#include #include #include #include diff --git a/trunk/drivers/usb/core/config.c b/trunk/drivers/usb/core/config.c index 4c9e63e665b6..a9d89c78cc20 100644 --- a/trunk/drivers/usb/core/config.c +++ b/trunk/drivers/usb/core/config.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/drivers/usb/core/devio.c b/trunk/drivers/usb/core/devio.c index f7bdd94b3aa8..bcbeaf7101d1 100644 --- a/trunk/drivers/usb/core/devio.c +++ b/trunk/drivers/usb/core/devio.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -69,7 +68,6 @@ struct async { void __user *userbuffer; void __user *userurb; struct urb *urb; - u32 secid; }; static int usbfs_snoop = 0; @@ -314,7 +312,7 @@ static void async_completed(struct urb *urb, struct pt_regs *regs) sinfo.si_code = SI_ASYNCIO; sinfo.si_addr = as->userurb; kill_proc_info_as_uid(as->signr, &sinfo, as->pid, as->uid, - as->euid, as->secid); + as->euid); } snoop(&urb->dev->dev, "urb complete\n"); snoop_urb(urb, as->userurb); @@ -574,7 +572,6 @@ static int usbdev_open(struct inode *inode, struct file *file) ps->disc_euid = current->euid; ps->disccontext = NULL; ps->ifclaimed = 0; - security_task_getsecid(current, &ps->secid); wmb(); list_add_tail(&ps->list, &dev->filelist); file->private_data = ps; @@ -1056,7 +1053,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, as->pid = current->pid; as->uid = current->uid; as->euid = current->euid; - security_task_getsecid(current, &as->secid); if (!(uurb->endpoint & USB_DIR_IN)) { if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) { free_async(as); diff --git a/trunk/drivers/usb/core/driver.c b/trunk/drivers/usb/core/driver.c index ec8906501415..c196f3845305 100644 --- a/trunk/drivers/usb/core/driver.c +++ b/trunk/drivers/usb/core/driver.c @@ -21,6 +21,7 @@ * */ +#include #include #include #include "hcd.h" diff --git a/trunk/drivers/usb/core/file.c b/trunk/drivers/usb/core/file.c index abee0f5b6a66..f65b193cde3d 100644 --- a/trunk/drivers/usb/core/file.c +++ b/trunk/drivers/usb/core/file.c @@ -15,6 +15,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/core/hcd-pci.c b/trunk/drivers/usb/core/hcd-pci.c index 5078fb3375e3..66b78404ab34 100644 --- a/trunk/drivers/usb/core/hcd-pci.c +++ b/trunk/drivers/usb/core/hcd-pci.c @@ -16,6 +16,7 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -125,7 +126,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id) pci_set_master (dev); - retval = usb_add_hcd (hcd, dev->irq, IRQF_SHARED); + retval = usb_add_hcd (hcd, dev->irq, SA_SHIRQ); if (retval != 0) goto err4; return retval; diff --git a/trunk/drivers/usb/core/hcd.c b/trunk/drivers/usb/core/hcd.c index fb4d058bbde0..4bf914d00a14 100644 --- a/trunk/drivers/usb/core/hcd.c +++ b/trunk/drivers/usb/core/hcd.c @@ -22,6 +22,7 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index 875596e98e42..e1731ff8af4d 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -8,6 +8,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/core/inode.c b/trunk/drivers/usb/core/inode.c index f48c3dbc367a..bfc9b28a7242 100644 --- a/trunk/drivers/usb/core/inode.c +++ b/trunk/drivers/usb/core/inode.c @@ -27,6 +27,7 @@ /*****************************************************************************/ +#include #include #include #include @@ -200,7 +201,7 @@ static void update_sb(struct super_block *sb) if (!root) return; - mutex_lock_nested(&root->d_inode->i_mutex, I_MUTEX_PARENT); + mutex_lock(&root->d_inode->i_mutex); list_for_each_entry(bus, &root->d_subdirs, d_u.d_child) { if (bus->d_inode) { @@ -527,7 +528,7 @@ static void fs_remove_file (struct dentry *dentry) if (!parent || !parent->d_inode) return; - mutex_lock_nested(&parent->d_inode->i_mutex, I_MUTEX_PARENT); + mutex_lock(&parent->d_inode->i_mutex); if (usbfs_positive(dentry)) { if (dentry->d_inode) { if (S_ISDIR(dentry->d_inode->i_mode)) @@ -699,7 +700,7 @@ static void usbfs_remove_device(struct usb_device *dev) sinfo.si_errno = EPIPE; sinfo.si_code = SI_ASYNCIO; sinfo.si_addr = ds->disccontext; - kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid, ds->secid); + kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid); } } } diff --git a/trunk/drivers/usb/core/message.c b/trunk/drivers/usb/core/message.c index 4cc8d3e67db7..8569600f3130 100644 --- a/trunk/drivers/usb/core/message.c +++ b/trunk/drivers/usb/core/message.c @@ -2,6 +2,7 @@ * message.c - synchronous message handling */ +#include #include /* for scatterlist macros */ #include #include diff --git a/trunk/drivers/usb/core/notify.c b/trunk/drivers/usb/core/notify.c index b042676af0a5..fe0ed54fa0ae 100644 --- a/trunk/drivers/usb/core/notify.c +++ b/trunk/drivers/usb/core/notify.c @@ -9,6 +9,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/usb/core/sysfs.c b/trunk/drivers/usb/core/sysfs.c index dec973affb0f..3f49bf51cff7 100644 --- a/trunk/drivers/usb/core/sysfs.c +++ b/trunk/drivers/usb/core/sysfs.c @@ -10,6 +10,7 @@ */ +#include #include #include #include "usb.h" diff --git a/trunk/drivers/usb/core/urb.c b/trunk/drivers/usb/core/urb.c index 9864988377c7..dad4d8fd8180 100644 --- a/trunk/drivers/usb/core/urb.c +++ b/trunk/drivers/usb/core/urb.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/drivers/usb/core/usb.c b/trunk/drivers/usb/core/usb.c index 184c24660a4c..fb488c8a860c 100644 --- a/trunk/drivers/usb/core/usb.c +++ b/trunk/drivers/usb/core/usb.c @@ -21,6 +21,7 @@ * are evil. */ +#include #include #include #include diff --git a/trunk/drivers/usb/core/usb.h b/trunk/drivers/usb/core/usb.h index 49f69236b420..7a650c763a62 100644 --- a/trunk/drivers/usb/core/usb.h +++ b/trunk/drivers/usb/core/usb.h @@ -80,7 +80,6 @@ struct dev_state { uid_t disc_uid, disc_euid; void __user *disccontext; unsigned long ifclaimed; - u32 secid; }; /* internal notify stuff */ diff --git a/trunk/drivers/usb/gadget/at91_udc.c b/trunk/drivers/usb/gadget/at91_udc.c index 1c459ff037ce..b8d0b7825bf3 100644 --- a/trunk/drivers/usb/gadget/at91_udc.c +++ b/trunk/drivers/usb/gadget/at91_udc.c @@ -25,6 +25,7 @@ #undef VERBOSE #undef PACKET_TRACE +#include #include #include #include @@ -1653,13 +1654,13 @@ static int __devinit at91udc_probe(struct platform_device *pdev) pullup(udc, 0); /* request UDC and maybe VBUS irqs */ - if (request_irq(AT91_ID_UDP, at91_udc_irq, IRQF_DISABLED, driver_name, udc)) { + if (request_irq(AT91_ID_UDP, at91_udc_irq, SA_INTERRUPT, driver_name, udc)) { DBG("request irq %d failed\n", AT91_ID_UDP); retval = -EBUSY; goto fail1; } if (udc->board.vbus_pin > 0) { - if (request_irq(udc->board.vbus_pin, at91_vbus_irq, IRQF_DISABLED, driver_name, udc)) { + if (request_irq(udc->board.vbus_pin, at91_vbus_irq, SA_INTERRUPT, driver_name, udc)) { DBG("request vbus irq %d failed\n", udc->board.vbus_pin); free_irq(AT91_ID_UDP, udc); retval = -EBUSY; diff --git a/trunk/drivers/usb/gadget/dummy_hcd.c b/trunk/drivers/usb/gadget/dummy_hcd.c index 4be47195bd38..42ce41d71b7f 100644 --- a/trunk/drivers/usb/gadget/dummy_hcd.c +++ b/trunk/drivers/usb/gadget/dummy_hcd.c @@ -36,6 +36,7 @@ #define DEBUG +#include #include #include #include diff --git a/trunk/drivers/usb/gadget/ether.c b/trunk/drivers/usb/gadget/ether.c index 8320fcef0425..078daa026718 100644 --- a/trunk/drivers/usb/gadget/ether.c +++ b/trunk/drivers/usb/gadget/ether.c @@ -23,6 +23,7 @@ // #define DEBUG 1 // #define VERBOSE +#include #include #include #include diff --git a/trunk/drivers/usb/gadget/file_storage.c b/trunk/drivers/usb/gadget/file_storage.c index b1a9cf06f3e6..a43dc908ac59 100644 --- a/trunk/drivers/usb/gadget/file_storage.c +++ b/trunk/drivers/usb/gadget/file_storage.c @@ -221,6 +221,7 @@ #undef VERBOSE #undef DUMP_MSGS +#include #include #include diff --git a/trunk/drivers/usb/gadget/goku_udc.c b/trunk/drivers/usb/gadget/goku_udc.c index 7cf2999e8616..5378c1757292 100644 --- a/trunk/drivers/usb/gadget/goku_udc.c +++ b/trunk/drivers/usb/gadget/goku_udc.c @@ -24,6 +24,7 @@ // #define VERBOSE /* extra debug messages (success too) */ // #define USB_TRACE /* packet-level success messages */ +#include #include #include #include @@ -1916,7 +1917,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* init to known state, then setup irqs */ udc_reset(dev); udc_reinit (dev); - if (request_irq(pdev->irq, goku_irq, IRQF_SHARED/*|IRQF_SAMPLE_RANDOM*/, + if (request_irq(pdev->irq, goku_irq, SA_SHIRQ/*|SA_SAMPLE_RANDOM*/, driver_name, dev) != 0) { DBG(dev, "request interrupt %d failed\n", pdev->irq); retval = -EBUSY; diff --git a/trunk/drivers/usb/gadget/lh7a40x_udc.c b/trunk/drivers/usb/gadget/lh7a40x_udc.c index 36db72579377..0d3424eda038 100644 --- a/trunk/drivers/usb/gadget/lh7a40x_udc.c +++ b/trunk/drivers/usb/gadget/lh7a40x_udc.c @@ -2107,7 +2107,7 @@ static int lh7a40x_udc_probe(struct platform_device *pdev) /* irq setup after old hardware state is cleaned up */ retval = - request_irq(IRQ_USBINTR, lh7a40x_udc_irq, IRQF_DISABLED, driver_name, + request_irq(IRQ_USBINTR, lh7a40x_udc_irq, SA_INTERRUPT, driver_name, dev); if (retval != 0) { DEBUG(KERN_ERR "%s: can't get irq %i, err %d\n", driver_name, @@ -2143,7 +2143,7 @@ static int lh7a40x_udc_remove(struct platform_device *pdev) static struct platform_driver udc_driver = { .probe = lh7a40x_udc_probe, - .remove = lh7a40x_udc_remove, + .remove = lh7a40x_udc_remove /* FIXME power management support */ /* .suspend = ... disable UDC */ /* .resume = ... re-enable UDC */ diff --git a/trunk/drivers/usb/gadget/lh7a40x_udc.h b/trunk/drivers/usb/gadget/lh7a40x_udc.h index e3bb78524c88..9b2e6f7cbb8b 100644 --- a/trunk/drivers/usb/gadget/lh7a40x_udc.h +++ b/trunk/drivers/usb/gadget/lh7a40x_udc.h @@ -24,6 +24,7 @@ #ifndef __LH7A40X_H_ #define __LH7A40X_H_ +#include #include #include #include diff --git a/trunk/drivers/usb/gadget/net2280.c b/trunk/drivers/usb/gadget/net2280.c index 09243239d948..1facdea56a8a 100644 --- a/trunk/drivers/usb/gadget/net2280.c +++ b/trunk/drivers/usb/gadget/net2280.c @@ -46,6 +46,7 @@ #undef DEBUG /* messages on error and most fault paths */ #undef VERBOSE /* extra debug messages (success too) */ +#include #include #include #include @@ -2895,7 +2896,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id) goto done; } - if (request_irq (pdev->irq, net2280_irq, IRQF_SHARED, driver_name, dev) + if (request_irq (pdev->irq, net2280_irq, SA_SHIRQ, driver_name, dev) != 0) { ERROR (dev, "request interrupt %d failed\n", pdev->irq); retval = -EBUSY; diff --git a/trunk/drivers/usb/gadget/omap_udc.c b/trunk/drivers/usb/gadget/omap_udc.c index 2de9748ee673..fbea51448909 100644 --- a/trunk/drivers/usb/gadget/omap_udc.c +++ b/trunk/drivers/usb/gadget/omap_udc.c @@ -22,6 +22,7 @@ #undef DEBUG #undef VERBOSE +#include #include #include #include @@ -772,7 +773,7 @@ static void dma_error(int lch, u16 ch_status, void *data) struct omap_ep *ep = data; /* if ch_status & OMAP_DMA_DROP_IRQ ... */ - /* if ch_status & OMAP1_DMA_TOUT_IRQ ... */ + /* if ch_status & OMAP_DMA_TOUT_IRQ ... */ ERR("%s dma error, lch %d status %02x\n", ep->ep.name, lch, ch_status); /* complete current transfer ... */ @@ -2818,7 +2819,7 @@ static int __init omap_udc_probe(struct platform_device *pdev) /* USB general purpose IRQ: ep0, state changes, dma, etc */ status = request_irq(pdev->resource[1].start, omap_udc_irq, - IRQF_SAMPLE_RANDOM, driver_name, udc); + SA_SAMPLE_RANDOM, driver_name, udc); if (status != 0) { ERR( "can't get irq %ld, err %d\n", pdev->resource[1].start, status); @@ -2827,7 +2828,7 @@ static int __init omap_udc_probe(struct platform_device *pdev) /* USB "non-iso" IRQ (PIO for all but ep0) */ status = request_irq(pdev->resource[2].start, omap_udc_pio_irq, - IRQF_SAMPLE_RANDOM, "omap_udc pio", udc); + SA_SAMPLE_RANDOM, "omap_udc pio", udc); if (status != 0) { ERR( "can't get irq %ld, err %d\n", pdev->resource[2].start, status); @@ -2835,7 +2836,7 @@ static int __init omap_udc_probe(struct platform_device *pdev) } #ifdef USE_ISO status = request_irq(pdev->resource[3].start, omap_udc_iso_irq, - IRQF_DISABLED, "omap_udc iso", udc); + SA_INTERRUPT, "omap_udc iso", udc); if (status != 0) { ERR("can't get irq %ld, err %d\n", pdev->resource[3].start, status); diff --git a/trunk/drivers/usb/gadget/pxa2xx_udc.c b/trunk/drivers/usb/gadget/pxa2xx_udc.c index fff027d30a09..735e9dbd39fd 100644 --- a/trunk/drivers/usb/gadget/pxa2xx_udc.c +++ b/trunk/drivers/usb/gadget/pxa2xx_udc.c @@ -27,6 +27,7 @@ #undef DEBUG // #define VERBOSE DBG_VERBOSE +#include #include #include #include @@ -2521,7 +2522,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) /* irq setup after old hardware state is cleaned up */ retval = request_irq(IRQ_USB, pxa2xx_udc_irq, - IRQF_DISABLED, driver_name, dev); + SA_INTERRUPT, driver_name, dev); if (retval != 0) { printk(KERN_ERR "%s: can't get irq %i, err %d\n", driver_name, IRQ_USB, retval); @@ -2533,7 +2534,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) if (machine_is_lubbock()) { retval = request_irq(LUBBOCK_USB_DISC_IRQ, lubbock_vbus_irq, - IRQF_DISABLED | IRQF_SAMPLE_RANDOM, + SA_INTERRUPT | SA_SAMPLE_RANDOM, driver_name, dev); if (retval != 0) { printk(KERN_ERR "%s: can't get irq %i, err %d\n", @@ -2544,7 +2545,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) } retval = request_irq(LUBBOCK_USB_IRQ, lubbock_vbus_irq, - IRQF_DISABLED | IRQF_SAMPLE_RANDOM, + SA_INTERRUPT | SA_SAMPLE_RANDOM, driver_name, dev); if (retval != 0) { printk(KERN_ERR "%s: can't get irq %i, err %d\n", diff --git a/trunk/drivers/usb/gadget/rndis.c b/trunk/drivers/usb/gadget/rndis.c index 354670d12308..3ff6db7828a0 100644 --- a/trunk/drivers/usb/gadget/rndis.c +++ b/trunk/drivers/usb/gadget/rndis.c @@ -23,6 +23,7 @@ * updates to merge with Linux 2.6, better match RNDIS spec */ +#include #include #include #include diff --git a/trunk/drivers/usb/gadget/serial.c b/trunk/drivers/usb/gadget/serial.c index 30d7664d449d..416acac879df 100644 --- a/trunk/drivers/usb/gadget/serial.c +++ b/trunk/drivers/usb/gadget/serial.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/gadget/zero.c b/trunk/drivers/usb/gadget/zero.c index 3a08a7ab4ce0..68e3d8f5da89 100644 --- a/trunk/drivers/usb/gadget/zero.c +++ b/trunk/drivers/usb/gadget/zero.c @@ -62,6 +62,7 @@ #define DEBUG 1 // #define VERBOSE +#include #include #include #include diff --git a/trunk/drivers/usb/host/ehci-au1xxx.c b/trunk/drivers/usb/host/ehci-au1xxx.c index d66867aa527e..9b4697add313 100644 --- a/trunk/drivers/usb/host/ehci-au1xxx.c +++ b/trunk/drivers/usb/host/ehci-au1xxx.c @@ -148,7 +148,7 @@ int usb_ehci_au1xxx_probe(const struct hc_driver *driver, /* ehci_hcd_init(hcd_to_ehci(hcd)); */ retval = - usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED | IRQF_SHARED); + usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT | SA_SHIRQ); if (retval == 0) return retval; diff --git a/trunk/drivers/usb/host/ehci-fsl.c b/trunk/drivers/usb/host/ehci-fsl.c index d030516edfb9..a49a689bf423 100644 --- a/trunk/drivers/usb/host/ehci-fsl.c +++ b/trunk/drivers/usb/host/ehci-fsl.c @@ -121,7 +121,7 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver, temp = in_le32(hcd->regs + 0x1a8); out_le32(hcd->regs + 0x1a8, temp | 0x3); - retval = usb_add_hcd(hcd, irq, IRQF_SHARED); + retval = usb_add_hcd(hcd, irq, SA_SHIRQ); if (retval != 0) goto err4; return retval; diff --git a/trunk/drivers/usb/host/ehci-hcd.c b/trunk/drivers/usb/host/ehci-hcd.c index cee6f538de0a..9b37e508ada3 100644 --- a/trunk/drivers/usb/host/ehci-hcd.c +++ b/trunk/drivers/usb/host/ehci-hcd.c @@ -16,6 +16,7 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/usb/host/hc_crisv10.c b/trunk/drivers/usb/host/hc_crisv10.c index 61e571782cf7..4a22909518f5 100644 --- a/trunk/drivers/usb/host/hc_crisv10.c +++ b/trunk/drivers/usb/host/hc_crisv10.c @@ -4,6 +4,7 @@ * Copyright (c) 2002, 2003 Axis Communications AB. */ +#include #include #include #include diff --git a/trunk/drivers/usb/host/isp116x-hcd.c b/trunk/drivers/usb/host/isp116x-hcd.c index 5147ed4a6662..14386254c870 100644 --- a/trunk/drivers/usb/host/isp116x-hcd.c +++ b/trunk/drivers/usb/host/isp116x-hcd.c @@ -1653,7 +1653,7 @@ static int __init isp116x_probe(struct platform_device *pdev) goto err6; } - ret = usb_add_hcd(hcd, irq, IRQF_DISABLED); + ret = usb_add_hcd(hcd, irq, SA_INTERRUPT); if (ret) goto err6; diff --git a/trunk/drivers/usb/host/ohci-at91.c b/trunk/drivers/usb/host/ohci-at91.c index cdbafb710000..6b7350b52419 100644 --- a/trunk/drivers/usb/host/ohci-at91.c +++ b/trunk/drivers/usb/host/ohci-at91.c @@ -125,7 +125,7 @@ int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device * at91_start_hc(pdev); ohci_hcd_init(hcd_to_ohci(hcd)); - retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_DISABLED); + retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT); if (retval == 0) return retval; diff --git a/trunk/drivers/usb/host/ohci-au1xxx.c b/trunk/drivers/usb/host/ohci-au1xxx.c index 689261e44018..a1c8b3b2fcc7 100644 --- a/trunk/drivers/usb/host/ohci-au1xxx.c +++ b/trunk/drivers/usb/host/ohci-au1xxx.c @@ -191,7 +191,7 @@ static int usb_ohci_au1xxx_probe(const struct hc_driver *driver, au1xxx_start_ohc(dev); ohci_hcd_init(hcd_to_ohci(hcd)); - retval = usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED | IRQF_SHARED); + retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT | SA_SHIRQ); if (retval == 0) return retval; diff --git a/trunk/drivers/usb/host/ohci-hcd.c b/trunk/drivers/usb/host/ohci-hcd.c index 8fb842ed5f6e..73f5a379d9b3 100644 --- a/trunk/drivers/usb/host/ohci-hcd.c +++ b/trunk/drivers/usb/host/ohci-hcd.c @@ -74,6 +74,7 @@ * This file is licenced under the GPL. */ +#include #include #include #include diff --git a/trunk/drivers/usb/host/ohci-lh7a404.c b/trunk/drivers/usb/host/ohci-lh7a404.c index 5602da9bd52c..0020ed7a39d0 100644 --- a/trunk/drivers/usb/host/ohci-lh7a404.c +++ b/trunk/drivers/usb/host/ohci-lh7a404.c @@ -100,7 +100,7 @@ int usb_hcd_lh7a404_probe (const struct hc_driver *driver, lh7a404_start_hc(dev); ohci_hcd_init(hcd_to_ohci(hcd)); - retval = usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED); + retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT); if (retval == 0) return retval; diff --git a/trunk/drivers/usb/host/ohci-omap.c b/trunk/drivers/usb/host/ohci-omap.c index c4c4babd4767..ca19abe01c53 100644 --- a/trunk/drivers/usb/host/ohci-omap.c +++ b/trunk/drivers/usb/host/ohci-omap.c @@ -14,7 +14,7 @@ * This file is licenced under the GPL. */ -#include /* IRQF_DISABLED */ +#include /* SA_INTERRUPT */ #include #include #include @@ -334,7 +334,7 @@ int usb_hcd_omap_probe (const struct hc_driver *driver, retval = -ENXIO; goto err2; } - retval = usb_add_hcd(hcd, irq, IRQF_DISABLED); + retval = usb_add_hcd(hcd, irq, SA_INTERRUPT); if (retval == 0) return retval; diff --git a/trunk/drivers/usb/host/ohci-ppc-soc.c b/trunk/drivers/usb/host/ohci-ppc-soc.c index 9fe56ff1615d..b2a8dfa48870 100644 --- a/trunk/drivers/usb/host/ohci-ppc-soc.c +++ b/trunk/drivers/usb/host/ohci-ppc-soc.c @@ -75,7 +75,7 @@ static int usb_hcd_ppc_soc_probe(const struct hc_driver *driver, ohci->flags |= OHCI_BIG_ENDIAN; ohci_hcd_init(ohci); - retval = usb_add_hcd(hcd, irq, IRQF_DISABLED); + retval = usb_add_hcd(hcd, irq, SA_INTERRUPT); if (retval == 0) return retval; diff --git a/trunk/drivers/usb/host/ohci-pxa27x.c b/trunk/drivers/usb/host/ohci-pxa27x.c index 6f559e102789..fafe7c1265b3 100644 --- a/trunk/drivers/usb/host/ohci-pxa27x.c +++ b/trunk/drivers/usb/host/ohci-pxa27x.c @@ -190,7 +190,7 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device ohci_hcd_init(hcd_to_ohci(hcd)); - retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_DISABLED); + retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT); if (retval == 0) return retval; diff --git a/trunk/drivers/usb/host/ohci-s3c2410.c b/trunk/drivers/usb/host/ohci-s3c2410.c index d2fc6969a9f7..1da5de573a6f 100644 --- a/trunk/drivers/usb/host/ohci-s3c2410.c +++ b/trunk/drivers/usb/host/ohci-s3c2410.c @@ -388,7 +388,7 @@ static int usb_hcd_s3c2410_probe (const struct hc_driver *driver, ohci_hcd_init(hcd_to_ohci(hcd)); - retval = usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED); + retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT); if (retval != 0) goto err_ioremap; diff --git a/trunk/drivers/usb/host/ohci-sa1111.c b/trunk/drivers/usb/host/ohci-sa1111.c index ce3de106cadc..fb3221ebbb29 100644 --- a/trunk/drivers/usb/host/ohci-sa1111.c +++ b/trunk/drivers/usb/host/ohci-sa1111.c @@ -143,7 +143,7 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, sa1111_start_hc(dev); ohci_hcd_init(hcd_to_ohci(hcd)); - retval = usb_add_hcd(hcd, dev->irq[1], IRQF_DISABLED); + retval = usb_add_hcd(hcd, dev->irq[1], SA_INTERRUPT); if (retval == 0) return retval; diff --git a/trunk/drivers/usb/host/pci-quirks.c b/trunk/drivers/usb/host/pci-quirks.c index dff60568b4a1..1045f846fbe2 100644 --- a/trunk/drivers/usb/host/pci-quirks.c +++ b/trunk/drivers/usb/host/pci-quirks.c @@ -8,6 +8,7 @@ * (and others) */ +#include #include #include #include diff --git a/trunk/drivers/usb/host/sl811-hcd.c b/trunk/drivers/usb/host/sl811-hcd.c index fa34092bbcde..89bcda5a3298 100644 --- a/trunk/drivers/usb/host/sl811-hcd.c +++ b/trunk/drivers/usb/host/sl811-hcd.c @@ -31,6 +31,7 @@ #undef VERBOSE #undef PACKET_TRACE +#include #include #include #include @@ -1749,7 +1750,7 @@ sl811h_probe(struct platform_device *dev) * was on a system with single edge triggering, so most sorts of * triggering arrangement should work. */ - retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED); + retval = usb_add_hcd(hcd, irq, SA_INTERRUPT | SA_SHIRQ); if (retval != 0) goto err6; diff --git a/trunk/drivers/usb/host/uhci-debug.c b/trunk/drivers/usb/host/uhci-debug.c index dc286a48cafd..6637a0e49978 100644 --- a/trunk/drivers/usb/host/uhci-debug.c +++ b/trunk/drivers/usb/host/uhci-debug.c @@ -9,6 +9,7 @@ * (C) Copyright 1999-2001 Johannes Erdfelt */ +#include #include #include #include diff --git a/trunk/drivers/usb/host/uhci-hcd.c b/trunk/drivers/usb/host/uhci-hcd.c index 4151f618602d..7b48567622ef 100644 --- a/trunk/drivers/usb/host/uhci-hcd.c +++ b/trunk/drivers/usb/host/uhci-hcd.c @@ -22,6 +22,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/input/appletouch.c b/trunk/drivers/usb/input/appletouch.c index 9e3f13903371..36855062eacc 100644 --- a/trunk/drivers/usb/input/appletouch.c +++ b/trunk/drivers/usb/input/appletouch.c @@ -27,6 +27,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/input/ati_remote.c b/trunk/drivers/usb/input/ati_remote.c index 05d2d6012eb2..07c8c0e665dd 100644 --- a/trunk/drivers/usb/input/ati_remote.c +++ b/trunk/drivers/usb/input/ati_remote.c @@ -85,6 +85,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/input/hiddev.c b/trunk/drivers/usb/input/hiddev.c index 70477f02cc29..c4670e1d4654 100644 --- a/trunk/drivers/usb/input/hiddev.c +++ b/trunk/drivers/usb/input/hiddev.c @@ -25,6 +25,7 @@ * e-mail - mail your message to Paul Stewart */ +#include #include #include #include diff --git a/trunk/drivers/usb/input/itmtouch.c b/trunk/drivers/usb/input/itmtouch.c index 86acb5f1907a..5c570cc703f3 100644 --- a/trunk/drivers/usb/input/itmtouch.c +++ b/trunk/drivers/usb/input/itmtouch.c @@ -39,6 +39,7 @@ * *****************************************************************************/ +#include #include #include #include diff --git a/trunk/drivers/usb/input/keyspan_remote.c b/trunk/drivers/usb/input/keyspan_remote.c index 4723b310f277..70af985b5db9 100644 --- a/trunk/drivers/usb/input/keyspan_remote.c +++ b/trunk/drivers/usb/input/keyspan_remote.c @@ -11,6 +11,7 @@ * and Keyspan, Inc the manufacturers of the Keyspan USB DMR product. */ +#include #include #include #include diff --git a/trunk/drivers/usb/input/mtouchusb.c b/trunk/drivers/usb/input/mtouchusb.c index a9ccda8810e0..4fdee4db0729 100644 --- a/trunk/drivers/usb/input/mtouchusb.c +++ b/trunk/drivers/usb/input/mtouchusb.c @@ -39,6 +39,7 @@ * *****************************************************************************/ +#include #include #include #include diff --git a/trunk/drivers/usb/input/touchkitusb.c b/trunk/drivers/usb/input/touchkitusb.c index 0149043ffb97..da7b0bf51aff 100644 --- a/trunk/drivers/usb/input/touchkitusb.c +++ b/trunk/drivers/usb/input/touchkitusb.c @@ -24,6 +24,7 @@ //#define DEBUG +#include #include #include #include diff --git a/trunk/drivers/usb/input/xpad.c b/trunk/drivers/usb/input/xpad.c index 9889b1cda05b..cfd4a4e04334 100644 --- a/trunk/drivers/usb/input/xpad.c +++ b/trunk/drivers/usb/input/xpad.c @@ -54,6 +54,7 @@ * 2002-07-17 - 0.0.5 : simplified d-pad handling */ +#include #include #include #include diff --git a/trunk/drivers/usb/input/yealink.c b/trunk/drivers/usb/input/yealink.c index 575a4e672e96..24aedbb20f03 100644 --- a/trunk/drivers/usb/input/yealink.c +++ b/trunk/drivers/usb/input/yealink.c @@ -46,6 +46,7 @@ * 20050816 henk Merge 2.6.13-rc6 */ +#include #include #include #include diff --git a/trunk/drivers/usb/misc/cytherm.c b/trunk/drivers/usb/misc/cytherm.c index b20bec445552..a04204292aa3 100644 --- a/trunk/drivers/usb/misc/cytherm.c +++ b/trunk/drivers/usb/misc/cytherm.c @@ -14,6 +14,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/usb/misc/idmouse.c b/trunk/drivers/usb/misc/idmouse.c index fcd69c52aea9..d0b167256699 100644 --- a/trunk/drivers/usb/misc/idmouse.c +++ b/trunk/drivers/usb/misc/idmouse.c @@ -16,6 +16,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/usb/misc/ldusb.c b/trunk/drivers/usb/misc/ldusb.c index f30ab1fbb3c8..966acb474f67 100644 --- a/trunk/drivers/usb/misc/ldusb.c +++ b/trunk/drivers/usb/misc/ldusb.c @@ -27,6 +27,7 @@ * V0.13 (mh) Added support for LD X-Ray and Machine Test System */ +#include #include #include #include diff --git a/trunk/drivers/usb/misc/legousbtower.c b/trunk/drivers/usb/misc/legousbtower.c index 7699d970e680..779bcf0373ad 100644 --- a/trunk/drivers/usb/misc/legousbtower.c +++ b/trunk/drivers/usb/misc/legousbtower.c @@ -75,6 +75,7 @@ * - move reset into open to clean out spurious data */ +#include #include #include #include diff --git a/trunk/drivers/usb/misc/phidgetkit.c b/trunk/drivers/usb/misc/phidgetkit.c index bfbbbfbb92bc..13aeea2026cc 100644 --- a/trunk/drivers/usb/misc/phidgetkit.c +++ b/trunk/drivers/usb/misc/phidgetkit.c @@ -13,6 +13,7 @@ * This is a driver for the USB PhidgetInterfaceKit. */ +#include #include #include #include diff --git a/trunk/drivers/usb/misc/phidgetservo.c b/trunk/drivers/usb/misc/phidgetservo.c index c0df79c96538..5a040c205eed 100644 --- a/trunk/drivers/usb/misc/phidgetservo.c +++ b/trunk/drivers/usb/misc/phidgetservo.c @@ -25,6 +25,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/misc/sisusbvga/sisusb_init.c b/trunk/drivers/usb/misc/sisusbvga/sisusb_init.c index 9b30f8962814..968f0d38cff7 100644 --- a/trunk/drivers/usb/misc/sisusbvga/sisusb_init.c +++ b/trunk/drivers/usb/misc/sisusbvga/sisusb_init.c @@ -36,6 +36,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/misc/usbled.c b/trunk/drivers/usb/misc/usbled.c index 0c5ee0ad6bb9..f441964132c0 100644 --- a/trunk/drivers/usb/misc/usbled.c +++ b/trunk/drivers/usb/misc/usbled.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/misc/usbtest.c b/trunk/drivers/usb/misc/usbtest.c index 786e1dbe88ec..81ba14c73dc7 100644 --- a/trunk/drivers/usb/misc/usbtest.c +++ b/trunk/drivers/usb/misc/usbtest.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/drivers/usb/net/asix.c b/trunk/drivers/usb/net/asix.c index 2e2bbc003e93..37111acec875 100644 --- a/trunk/drivers/usb/net/asix.c +++ b/trunk/drivers/usb/net/asix.c @@ -22,6 +22,7 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages +#include #include #include #include diff --git a/trunk/drivers/usb/net/cdc_ether.c b/trunk/drivers/usb/net/cdc_ether.c index 82ce0358d9a3..efd195b5912c 100644 --- a/trunk/drivers/usb/net/cdc_ether.c +++ b/trunk/drivers/usb/net/cdc_ether.c @@ -20,6 +20,7 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages +#include #include #include #include diff --git a/trunk/drivers/usb/net/cdc_subset.c b/trunk/drivers/usb/net/cdc_subset.c index e2fae85851a3..ec801e8bb1bb 100644 --- a/trunk/drivers/usb/net/cdc_subset.c +++ b/trunk/drivers/usb/net/cdc_subset.c @@ -17,6 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/trunk/drivers/usb/net/gl620a.c b/trunk/drivers/usb/net/gl620a.c index 3155f25f1d48..faf1e86be687 100644 --- a/trunk/drivers/usb/net/gl620a.c +++ b/trunk/drivers/usb/net/gl620a.c @@ -21,6 +21,7 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages +#include #include #include #include diff --git a/trunk/drivers/usb/net/net1080.c b/trunk/drivers/usb/net/net1080.c index a9b6eeac3e3f..78e6a43b1087 100644 --- a/trunk/drivers/usb/net/net1080.c +++ b/trunk/drivers/usb/net/net1080.c @@ -20,6 +20,7 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages +#include #include #include #include diff --git a/trunk/drivers/usb/net/plusb.c b/trunk/drivers/usb/net/plusb.c index 5d17cdfc7bab..4fe863389cb7 100644 --- a/trunk/drivers/usb/net/plusb.c +++ b/trunk/drivers/usb/net/plusb.c @@ -20,6 +20,7 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages +#include #include #include #include diff --git a/trunk/drivers/usb/net/rndis_host.c b/trunk/drivers/usb/net/rndis_host.c index c2a28d88ef3c..f551546d7521 100644 --- a/trunk/drivers/usb/net/rndis_host.c +++ b/trunk/drivers/usb/net/rndis_host.c @@ -20,6 +20,7 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages +#include #include #include #include diff --git a/trunk/drivers/usb/net/rtl8150.c b/trunk/drivers/usb/net/rtl8150.c index 718f8e2b552b..1bbbae283c0b 100644 --- a/trunk/drivers/usb/net/rtl8150.c +++ b/trunk/drivers/usb/net/rtl8150.c @@ -6,6 +6,7 @@ * version 2 as published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/usb/net/usbnet.c b/trunk/drivers/usb/net/usbnet.c index 54183e173a6d..362d6907c9bb 100644 --- a/trunk/drivers/usb/net/usbnet.c +++ b/trunk/drivers/usb/net/usbnet.c @@ -33,6 +33,7 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages +#include #include #include #include diff --git a/trunk/drivers/usb/net/zaurus.c b/trunk/drivers/usb/net/zaurus.c index 144566bda583..813e470d0600 100644 --- a/trunk/drivers/usb/net/zaurus.c +++ b/trunk/drivers/usb/net/zaurus.c @@ -20,6 +20,7 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages +#include #include #include #include diff --git a/trunk/drivers/usb/serial/belkin_sa.c b/trunk/drivers/usb/serial/belkin_sa.c index 3faa7aa0111a..4144777ea18b 100644 --- a/trunk/drivers/usb/serial/belkin_sa.c +++ b/trunk/drivers/usb/serial/belkin_sa.c @@ -63,6 +63,7 @@ * UsbSnoop on Windows2000 and from examining the other USB drivers. */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/bus.c b/trunk/drivers/usb/serial/bus.c index f2d993b70c18..e9f9f4bafa17 100644 --- a/trunk/drivers/usb/serial/bus.c +++ b/trunk/drivers/usb/serial/bus.c @@ -8,6 +8,7 @@ * 2 as published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/console.c b/trunk/drivers/usb/serial/console.c index 3d456b32c316..f3404e10afb4 100644 --- a/trunk/drivers/usb/serial/console.c +++ b/trunk/drivers/usb/serial/console.c @@ -11,6 +11,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/cp2101.c b/trunk/drivers/usb/serial/cp2101.c index df0a4f98b4ae..f8c0cb287736 100644 --- a/trunk/drivers/usb/serial/cp2101.c +++ b/trunk/drivers/usb/serial/cp2101.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/cyberjack.c b/trunk/drivers/usb/serial/cyberjack.c index 49b51ab0d4cb..1fd5c5a9f2ef 100644 --- a/trunk/drivers/usb/serial/cyberjack.c +++ b/trunk/drivers/usb/serial/cyberjack.c @@ -28,6 +28,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/cypress_m8.c b/trunk/drivers/usb/serial/cypress_m8.c index 4ff2dfb299bd..5de76efe1b37 100644 --- a/trunk/drivers/usb/serial/cypress_m8.c +++ b/trunk/drivers/usb/serial/cypress_m8.c @@ -48,6 +48,7 @@ /* Code originates and was built up from ftdi_sio, belkin, pl2303 and others. */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/digi_acceleport.c b/trunk/drivers/usb/serial/digi_acceleport.c index 6953d3ef5738..b3f776a90c93 100644 --- a/trunk/drivers/usb/serial/digi_acceleport.c +++ b/trunk/drivers/usb/serial/digi_acceleport.c @@ -233,6 +233,7 @@ * $Id: digi_acceleport.c,v 1.80.1.2 2000/11/02 05:45:08 root Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/empeg.c b/trunk/drivers/usb/serial/empeg.c index 1e2b31eeb497..afca1eae5fb5 100644 --- a/trunk/drivers/usb/serial/empeg.c +++ b/trunk/drivers/usb/serial/empeg.c @@ -51,6 +51,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/ezusb.c b/trunk/drivers/usb/serial/ezusb.c index debc3b0f9662..1e419c8d7392 100644 --- a/trunk/drivers/usb/serial/ezusb.c +++ b/trunk/drivers/usb/serial/ezusb.c @@ -8,6 +8,7 @@ * 2 as published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/ftdi_sio.c b/trunk/drivers/usb/serial/ftdi_sio.c index 8a74b19f1283..b2bfea7c815a 100644 --- a/trunk/drivers/usb/serial/ftdi_sio.c +++ b/trunk/drivers/usb/serial/ftdi_sio.c @@ -245,6 +245,7 @@ /* to talk to the device */ /* Thanx to gkh and the rest of the usb dev group for all code I have assimilated :-) */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/garmin_gps.c b/trunk/drivers/usb/serial/garmin_gps.c index 1f5d1620baa1..04767759cf8a 100644 --- a/trunk/drivers/usb/serial/garmin_gps.c +++ b/trunk/drivers/usb/serial/garmin_gps.c @@ -23,6 +23,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/generic.c b/trunk/drivers/usb/serial/generic.c index 945b8bb38c92..07a478c59fb2 100644 --- a/trunk/drivers/usb/serial/generic.c +++ b/trunk/drivers/usb/serial/generic.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/hp4x.c b/trunk/drivers/usb/serial/hp4x.c index 7e06358b0310..e9719da2aca1 100644 --- a/trunk/drivers/usb/serial/hp4x.c +++ b/trunk/drivers/usb/serial/hp4x.c @@ -12,6 +12,7 @@ * See Documentation/usb/usb-serial.txt for more information on using this driver */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/io_edgeport.c b/trunk/drivers/usb/serial/io_edgeport.c index bd2c05dac2a9..b85d2156dfdc 100644 --- a/trunk/drivers/usb/serial/io_edgeport.c +++ b/trunk/drivers/usb/serial/io_edgeport.c @@ -29,6 +29,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/io_ti.c b/trunk/drivers/usb/serial/io_ti.c index 723a12ae87b5..8e1e2253748b 100644 --- a/trunk/drivers/usb/serial/io_ti.c +++ b/trunk/drivers/usb/serial/io_ti.c @@ -24,6 +24,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/ipaq.c b/trunk/drivers/usb/serial/ipaq.c index dbcfe172a5cc..9da6d2a8f2b0 100644 --- a/trunk/drivers/usb/serial/ipaq.c +++ b/trunk/drivers/usb/serial/ipaq.c @@ -44,6 +44,7 @@ * Thanks to info from Heath Robinson and Arieh Davidoff. */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/ir-usb.c b/trunk/drivers/usb/serial/ir-usb.c index 2cf1fed3de43..d7f3f736a692 100644 --- a/trunk/drivers/usb/serial/ir-usb.c +++ b/trunk/drivers/usb/serial/ir-usb.c @@ -46,6 +46,7 @@ * initial version released. */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/keyspan.c b/trunk/drivers/usb/serial/keyspan.c index d7c58f1bc960..2cf6ade704e4 100644 --- a/trunk/drivers/usb/serial/keyspan.c +++ b/trunk/drivers/usb/serial/keyspan.c @@ -95,6 +95,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/keyspan_pda.c b/trunk/drivers/usb/serial/keyspan_pda.c index 03ab3c0f3cce..b0441c35f98f 100644 --- a/trunk/drivers/usb/serial/keyspan_pda.c +++ b/trunk/drivers/usb/serial/keyspan_pda.c @@ -66,6 +66,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/kl5kusb105.c b/trunk/drivers/usb/serial/kl5kusb105.c index b45ff3e7ab40..65d79f630fa4 100644 --- a/trunk/drivers/usb/serial/kl5kusb105.c +++ b/trunk/drivers/usb/serial/kl5kusb105.c @@ -45,6 +45,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/kobil_sct.c b/trunk/drivers/usb/serial/kobil_sct.c index 457733374772..87dfcd89ffab 100644 --- a/trunk/drivers/usb/serial/kobil_sct.c +++ b/trunk/drivers/usb/serial/kobil_sct.c @@ -35,6 +35,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/mct_u232.c b/trunk/drivers/usb/serial/mct_u232.c index ca05d3275f3e..35bd29b6c408 100644 --- a/trunk/drivers/usb/serial/mct_u232.c +++ b/trunk/drivers/usb/serial/mct_u232.c @@ -64,6 +64,7 @@ * (via linux-usb-devel). */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/omninet.c b/trunk/drivers/usb/serial/omninet.c index cfb711a21a45..6dcdb5f598b8 100644 --- a/trunk/drivers/usb/serial/omninet.c +++ b/trunk/drivers/usb/serial/omninet.c @@ -35,6 +35,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/option.c b/trunk/drivers/usb/serial/option.c index 78ad4b3126a6..b0861b61bba7 100644 --- a/trunk/drivers/usb/serial/option.c +++ b/trunk/drivers/usb/serial/option.c @@ -57,6 +57,7 @@ #define DRIVER_AUTHOR "Matthias Urlichs " #define DRIVER_DESC "USB Driver for GSM modems" +#include #include #include #include diff --git a/trunk/drivers/usb/serial/pl2303.c b/trunk/drivers/usb/serial/pl2303.c index de93a2b909e7..d88704387202 100644 --- a/trunk/drivers/usb/serial/pl2303.c +++ b/trunk/drivers/usb/serial/pl2303.c @@ -14,6 +14,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/safe_serial.c b/trunk/drivers/usb/serial/safe_serial.c index 897d8447252b..f0215f850d2d 100644 --- a/trunk/drivers/usb/serial/safe_serial.c +++ b/trunk/drivers/usb/serial/safe_serial.c @@ -60,6 +60,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/ti_usb_3410_5052.c b/trunk/drivers/usb/serial/ti_usb_3410_5052.c index a9afff31a921..c3a2071b802d 100644 --- a/trunk/drivers/usb/serial/ti_usb_3410_5052.c +++ b/trunk/drivers/usb/serial/ti_usb_3410_5052.c @@ -68,6 +68,7 @@ * fi */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/usb-serial.c b/trunk/drivers/usb/serial/usb-serial.c index b59a0536ea5c..f466f89eeb6d 100644 --- a/trunk/drivers/usb/serial/usb-serial.c +++ b/trunk/drivers/usb/serial/usb-serial.c @@ -16,6 +16,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/usb-serial.h b/trunk/drivers/usb/serial/usb-serial.h index 0f2802a60194..d53ea9b11e81 100644 --- a/trunk/drivers/usb/serial/usb-serial.h +++ b/trunk/drivers/usb/serial/usb-serial.h @@ -14,6 +14,7 @@ #ifndef __LINUX_USB_SERIAL_H #define __LINUX_USB_SERIAL_H +#include #include #include diff --git a/trunk/drivers/usb/serial/visor.c b/trunk/drivers/usb/serial/visor.c index 95a2936e902e..9e89b8d54f72 100644 --- a/trunk/drivers/usb/serial/visor.c +++ b/trunk/drivers/usb/serial/visor.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/serial/whiteheat.c b/trunk/drivers/usb/serial/whiteheat.c index 540438c3f381..56ffc81302fc 100644 --- a/trunk/drivers/usb/serial/whiteheat.c +++ b/trunk/drivers/usb/serial/whiteheat.c @@ -65,6 +65,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/storage/debug.h b/trunk/drivers/usb/storage/debug.h index 77e244a8c376..cd2096acc723 100644 --- a/trunk/drivers/usb/storage/debug.h +++ b/trunk/drivers/usb/storage/debug.h @@ -44,6 +44,7 @@ #ifndef _DEBUG_H_ #define _DEBUG_H_ +#include #include #define USB_STORAGE "usb-storage: " diff --git a/trunk/drivers/usb/storage/dpcm.c b/trunk/drivers/usb/storage/dpcm.c index 1628cb258562..92b69e4c8047 100644 --- a/trunk/drivers/usb/storage/dpcm.c +++ b/trunk/drivers/usb/storage/dpcm.c @@ -29,6 +29,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/usb/storage/freecom.c b/trunk/drivers/usb/storage/freecom.c index 88aa59ab7563..30e96050fe0c 100644 --- a/trunk/drivers/usb/storage/freecom.c +++ b/trunk/drivers/usb/storage/freecom.c @@ -28,6 +28,7 @@ * (http://www.freecom.de/) */ +#include #include #include diff --git a/trunk/drivers/usb/storage/initializers.h b/trunk/drivers/usb/storage/initializers.h index 927f7781080f..f9907a5cf129 100644 --- a/trunk/drivers/usb/storage/initializers.h +++ b/trunk/drivers/usb/storage/initializers.h @@ -37,6 +37,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include "usb.h" #include "transport.h" diff --git a/trunk/drivers/usb/storage/onetouch.c b/trunk/drivers/usb/storage/onetouch.c index 313920d980c9..026a587eb8dd 100644 --- a/trunk/drivers/usb/storage/onetouch.c +++ b/trunk/drivers/usb/storage/onetouch.c @@ -28,6 +28,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/usb/storage/transport.c b/trunk/drivers/usb/storage/transport.c index eb7188b3565c..19b25c5cafd4 100644 --- a/trunk/drivers/usb/storage/transport.c +++ b/trunk/drivers/usb/storage/transport.c @@ -45,6 +45,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/usb/storage/unusual_devs.h b/trunk/drivers/usb/storage/unusual_devs.h index c7e84e653df9..543244d421c1 100644 --- a/trunk/drivers/usb/storage/unusual_devs.h +++ b/trunk/drivers/usb/storage/unusual_devs.h @@ -31,6 +31,7 @@ * the following thing for it to work: * The macro UNUSUAL_DEV() must be defined before this file is included */ +#include /* If you edit this file, please try to keep it sorted first by VendorID, * then by ProductID. diff --git a/trunk/drivers/usb/storage/usb.c b/trunk/drivers/usb/storage/usb.c index 1185acac4b21..e232c7c89909 100644 --- a/trunk/drivers/usb/storage/usb.c +++ b/trunk/drivers/usb/storage/usb.c @@ -47,6 +47,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/usb/usb-skeleton.c b/trunk/drivers/usb/usb-skeleton.c index b362039792b3..4de9fb56ebfc 100644 --- a/trunk/drivers/usb/usb-skeleton.c +++ b/trunk/drivers/usb/usb-skeleton.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/video/Kconfig b/trunk/drivers/video/Kconfig index 3badb48d662b..17de4c84db69 100644 --- a/trunk/drivers/video/Kconfig +++ b/trunk/drivers/video/Kconfig @@ -1557,21 +1557,6 @@ config FB_S3C2410_DEBUG Turn on debugging messages. Note that you can set/unset at run time through sysfs -config FB_PNX4008_DUM - tristate "Display Update Module support on Philips PNX4008 board" - depends on FB && ARCH_PNX4008 - ---help--- - Say Y here to enable support for PNX4008 Display Update Module (DUM) - -config FB_PNX4008_DUM_RGB - tristate "RGB Framebuffer support on Philips PNX4008 board" - depends on FB_PNX4008_DUM - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Say Y here to enable support for PNX4008 RGB Framebuffer - config FB_VIRTUAL tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)" depends on FB diff --git a/trunk/drivers/video/Makefile b/trunk/drivers/video/Makefile index 6283d015f8f5..c335e9bc3b20 100644 --- a/trunk/drivers/video/Makefile +++ b/trunk/drivers/video/Makefile @@ -94,8 +94,6 @@ obj-$(CONFIG_FB_TX3912) += tx3912fb.o obj-$(CONFIG_FB_S1D13XXX) += s1d13xxxfb.o obj-$(CONFIG_FB_IMX) += imxfb.o obj-$(CONFIG_FB_S3C2410) += s3c2410fb.o -obj-$(CONFIG_FB_PNX4008_DUM) += pnx4008/ -obj-$(CONFIG_FB_PNX4008_DUM_RGB) += pnx4008/ # Platform or fallback drivers go here obj-$(CONFIG_FB_VESA) += vesafb.o diff --git a/trunk/drivers/video/S3triofb.c b/trunk/drivers/video/S3triofb.c index e714e8449c1d..455fda990ff7 100644 --- a/trunk/drivers/video/S3triofb.c +++ b/trunk/drivers/video/S3triofb.c @@ -23,6 +23,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/video/acornfb.c b/trunk/drivers/video/acornfb.c index 61a8bf159cb0..98baecccb3fd 100644 --- a/trunk/drivers/video/acornfb.c +++ b/trunk/drivers/video/acornfb.c @@ -17,6 +17,7 @@ * - Blanking 8bpp displays with VIDC */ +#include #include #include #include diff --git a/trunk/drivers/video/amifb.c b/trunk/drivers/video/amifb.c index f9bc9f777e75..3033c72dea20 100644 --- a/trunk/drivers/video/amifb.c +++ b/trunk/drivers/video/amifb.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/arcfb.c b/trunk/drivers/video/arcfb.c index fd95c2dbd4f7..466042808daf 100644 --- a/trunk/drivers/video/arcfb.c +++ b/trunk/drivers/video/arcfb.c @@ -561,7 +561,7 @@ static int __init arcfb_probe(struct platform_device *dev) platform_set_drvdata(dev, info); if (irq) { par->irq = irq; - if (request_irq(par->irq, &arcfb_interrupt, IRQF_SHARED, + if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ, "arcfb", info)) { printk(KERN_INFO "arcfb: Failed req IRQ %d\n", par->irq); diff --git a/trunk/drivers/video/asiliantfb.c b/trunk/drivers/video/asiliantfb.c index eaeaf4d1a094..29f9f0dfe3b4 100644 --- a/trunk/drivers/video/asiliantfb.c +++ b/trunk/drivers/video/asiliantfb.c @@ -29,6 +29,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/aty/aty128fb.c b/trunk/drivers/video/aty/aty128fb.c index 72c589109471..11cf7fcb1d55 100644 --- a/trunk/drivers/video/aty/aty128fb.c +++ b/trunk/drivers/video/aty/aty128fb.c @@ -46,6 +46,7 @@ */ +#include #include #include #include diff --git a/trunk/drivers/video/aty/atyfb.h b/trunk/drivers/video/aty/atyfb.h index 55fb8b04489b..43d2cb58af87 100644 --- a/trunk/drivers/video/aty/atyfb.h +++ b/trunk/drivers/video/aty/atyfb.h @@ -2,6 +2,7 @@ * ATI Frame Buffer Device Driver Core Definitions */ +#include #include #include /* diff --git a/trunk/drivers/video/aty/atyfb_base.c b/trunk/drivers/video/aty/atyfb_base.c index 0c9706746d79..22e720611bf6 100644 --- a/trunk/drivers/video/aty/atyfb_base.c +++ b/trunk/drivers/video/aty/atyfb_base.c @@ -49,6 +49,7 @@ ******************************************************************************/ +#include #include #include #include @@ -1567,7 +1568,7 @@ static int aty_enable_irq(struct atyfb_par *par, int reenable) u32 int_cntl; if (!test_and_set_bit(0, &par->irq_flags)) { - if (request_irq(par->irq, aty_irq, IRQF_SHARED, "atyfb", par)) { + if (request_irq(par->irq, aty_irq, SA_SHIRQ, "atyfb", par)) { clear_bit(0, &par->irq_flags); return -EINVAL; } diff --git a/trunk/drivers/video/aty/radeon_base.c b/trunk/drivers/video/aty/radeon_base.c index 51b78f8de949..68b15645b893 100644 --- a/trunk/drivers/video/aty/radeon_base.c +++ b/trunk/drivers/video/aty/radeon_base.c @@ -52,6 +52,7 @@ #define RADEON_VERSION "0.2.0" +#include #include #include #include diff --git a/trunk/drivers/video/aty/radeon_i2c.c b/trunk/drivers/video/aty/radeon_i2c.c index 9aaca58c074a..a9d0414e4655 100644 --- a/trunk/drivers/video/aty/radeon_i2c.c +++ b/trunk/drivers/video/aty/radeon_i2c.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/trunk/drivers/video/aty/radeonfb.h b/trunk/drivers/video/aty/radeonfb.h index 38657b2d10eb..1645943b1123 100644 --- a/trunk/drivers/video/aty/radeonfb.h +++ b/trunk/drivers/video/aty/radeonfb.h @@ -1,6 +1,7 @@ #ifndef __RADEONFB_H__ #define __RADEONFB_H__ +#include #include #include #include @@ -381,7 +382,7 @@ struct radeonfb_info { /* Note about this function: we have some rare cases where we must not schedule, * this typically happen with our special "wake up early" hook which allows us to * wake up the graphic chip (and thus get the console back) before everything else - * on some machines that support that mechanism. At this point, interrupts are off + * on some machines that support that mecanism. At this point, interrupts are off * and scheduling is not permitted */ static inline void _radeon_msleep(struct radeonfb_info *rinfo, unsigned long ms) diff --git a/trunk/drivers/video/au1100fb.c b/trunk/drivers/video/au1100fb.c index a92a91fef16f..9ef68cd83bb4 100644 --- a/trunk/drivers/video/au1100fb.c +++ b/trunk/drivers/video/au1100fb.c @@ -40,6 +40,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff --git a/trunk/drivers/video/au1200fb.c b/trunk/drivers/video/au1200fb.c index c6a5f0ccc107..600d3e0e08b7 100644 --- a/trunk/drivers/video/au1200fb.c +++ b/trunk/drivers/video/au1200fb.c @@ -1694,7 +1694,7 @@ static int au1200fb_drv_probe(struct device *dev) /* Now hook interrupt too */ if ((ret = request_irq(AU1200_LCD_INT, au1200fb_handle_irq, - IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev)) < 0) { + SA_INTERRUPT | SA_SHIRQ, "lcd", (void *)dev)) < 0) { print_err("fail to request interrupt line %d (err: %d)", AU1200_LCD_INT, ret); goto failed; diff --git a/trunk/drivers/video/backlight/locomolcd.c b/trunk/drivers/video/backlight/locomolcd.c index caf1eca199b0..bd879b7ec119 100644 --- a/trunk/drivers/video/backlight/locomolcd.c +++ b/trunk/drivers/video/backlight/locomolcd.c @@ -11,6 +11,7 @@ */ /* LCD power functions */ +#include #include #include #include diff --git a/trunk/drivers/video/cfbcopyarea.c b/trunk/drivers/video/cfbcopyarea.c index 6faea4034e3d..74415325b016 100644 --- a/trunk/drivers/video/cfbcopyarea.c +++ b/trunk/drivers/video/cfbcopyarea.c @@ -24,6 +24,7 @@ +#include #include #include #include diff --git a/trunk/drivers/video/cfbfillrect.c b/trunk/drivers/video/cfbfillrect.c index f00b50aab606..e5ff62e9cfb8 100644 --- a/trunk/drivers/video/cfbfillrect.c +++ b/trunk/drivers/video/cfbfillrect.c @@ -17,6 +17,7 @@ * the native cpu endians. I also need to deal with MSB position in the word. * */ +#include #include #include #include diff --git a/trunk/drivers/video/cfbimgblt.c b/trunk/drivers/video/cfbimgblt.c index 51d35386a945..ad8a89bf8eae 100644 --- a/trunk/drivers/video/cfbimgblt.c +++ b/trunk/drivers/video/cfbimgblt.c @@ -29,6 +29,7 @@ * Also need to add code to deal with cards endians that are different than * the native cpu endians. I also need to deal with MSB position in the word. */ +#include #include #include #include diff --git a/trunk/drivers/video/chipsfb.c b/trunk/drivers/video/chipsfb.c index 0e465c80ef24..d76bbfac92cc 100644 --- a/trunk/drivers/video/chipsfb.c +++ b/trunk/drivers/video/chipsfb.c @@ -14,6 +14,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/cirrusfb.c b/trunk/drivers/video/cirrusfb.c index 7355da09c721..dda240eb7360 100644 --- a/trunk/drivers/video/cirrusfb.c +++ b/trunk/drivers/video/cirrusfb.c @@ -36,6 +36,7 @@ #define CIRRUSFB_VERSION "2.0-pre2" +#include #include #include #include diff --git a/trunk/drivers/video/console/bitblit.c b/trunk/drivers/video/console/bitblit.c index 308850df16fe..eea422eb1ab5 100644 --- a/trunk/drivers/video/console/bitblit.c +++ b/trunk/drivers/video/console/bitblit.c @@ -10,6 +10,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/console/dummycon.c b/trunk/drivers/video/console/dummycon.c index 878707a04398..1ecda91e5a9c 100644 --- a/trunk/drivers/video/console/dummycon.c +++ b/trunk/drivers/video/console/dummycon.c @@ -22,6 +22,7 @@ #define DUMMY_ROWS ORIG_VIDEO_LINES #elif defined(__hppa__) /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */ +#include #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS #define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS #else diff --git a/trunk/drivers/video/console/fbcon.c b/trunk/drivers/video/console/fbcon.c index 94e9f7069bef..5dc4083552d8 100644 --- a/trunk/drivers/video/console/fbcon.c +++ b/trunk/drivers/video/console/fbcon.c @@ -58,6 +58,7 @@ #undef FBCONDEBUG +#include #include #include #include diff --git a/trunk/drivers/video/console/fbcon.h b/trunk/drivers/video/console/fbcon.h index f244ad066d68..3487a636370a 100644 --- a/trunk/drivers/video/console/fbcon.h +++ b/trunk/drivers/video/console/fbcon.h @@ -11,6 +11,7 @@ #ifndef _VIDEO_FBCON_H #define _VIDEO_FBCON_H +#include #include #include #include diff --git a/trunk/drivers/video/console/fbcon_ccw.c b/trunk/drivers/video/console/fbcon_ccw.c index 4481c80b8b2a..990289a69b78 100644 --- a/trunk/drivers/video/console/fbcon_ccw.c +++ b/trunk/drivers/video/console/fbcon_ccw.c @@ -8,6 +8,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/console/fbcon_cw.c b/trunk/drivers/video/console/fbcon_cw.c index 7f92c06afea7..d44c5fa515fb 100644 --- a/trunk/drivers/video/console/fbcon_cw.c +++ b/trunk/drivers/video/console/fbcon_cw.c @@ -8,6 +8,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/console/fbcon_rotate.c b/trunk/drivers/video/console/fbcon_rotate.c index 00884e013f0f..2dc091fbd5c9 100644 --- a/trunk/drivers/video/console/fbcon_rotate.c +++ b/trunk/drivers/video/console/fbcon_rotate.c @@ -8,6 +8,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/console/fbcon_ud.c b/trunk/drivers/video/console/fbcon_ud.c index ab91005e64dc..f56ed068a5bc 100644 --- a/trunk/drivers/video/console/fbcon_ud.c +++ b/trunk/drivers/video/console/fbcon_ud.c @@ -8,6 +8,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/console/font_acorn_8x8.c b/trunk/drivers/video/console/font_acorn_8x8.c index 40f3d4eeb198..2d2e39632e2d 100644 --- a/trunk/drivers/video/console/font_acorn_8x8.c +++ b/trunk/drivers/video/console/font_acorn_8x8.c @@ -1,5 +1,6 @@ /* Acorn-like font definition, with PC graphics characters */ +#include #include static const unsigned char acorndata_8x8[] = { diff --git a/trunk/drivers/video/console/fonts.c b/trunk/drivers/video/console/fonts.c index c960728b7e82..0cc1bfda76a6 100644 --- a/trunk/drivers/video/console/fonts.c +++ b/trunk/drivers/video/console/fonts.c @@ -12,6 +12,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/console/promcon.c b/trunk/drivers/video/console/promcon.c index 5cd5e114d1e6..d6e6ad537f9f 100644 --- a/trunk/drivers/video/console/promcon.c +++ b/trunk/drivers/video/console/promcon.c @@ -5,6 +5,7 @@ * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ +#include #include #include #include diff --git a/trunk/drivers/video/console/sticore.c b/trunk/drivers/video/console/sticore.c index 88e7038eab88..74ac2acaf72c 100644 --- a/trunk/drivers/video/console/sticore.c +++ b/trunk/drivers/video/console/sticore.c @@ -13,6 +13,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/video/console/tileblit.c b/trunk/drivers/video/console/tileblit.c index d981fe4d86c6..153352ca9461 100644 --- a/trunk/drivers/video/console/tileblit.c +++ b/trunk/drivers/video/console/tileblit.c @@ -8,6 +8,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/console/vgacon.c b/trunk/drivers/video/console/vgacon.c index 05735ff4e9c5..01401cd63ac0 100644 --- a/trunk/drivers/video/console/vgacon.c +++ b/trunk/drivers/video/console/vgacon.c @@ -33,6 +33,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/controlfb.c b/trunk/drivers/video/controlfb.c index acdd6a103dbb..655301a8671c 100644 --- a/trunk/drivers/video/controlfb.c +++ b/trunk/drivers/video/controlfb.c @@ -31,6 +31,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/cyber2000fb.c b/trunk/drivers/video/cyber2000fb.c index 2e2924957d8f..55a3514157ed 100644 --- a/trunk/drivers/video/cyber2000fb.c +++ b/trunk/drivers/video/cyber2000fb.c @@ -36,6 +36,7 @@ * (which, incidentally, is about the same saving as a 2.5in hard disk * entering standby mode.) */ +#include #include #include #include diff --git a/trunk/drivers/video/cyber2000fb.h b/trunk/drivers/video/cyber2000fb.h index de4fc43e51c1..bd7e1c040781 100644 --- a/trunk/drivers/video/cyber2000fb.h +++ b/trunk/drivers/video/cyber2000fb.h @@ -9,6 +9,7 @@ * * Integraphics Cyber2000 frame buffer device */ +#include /* * Internal CyberPro sizes and offsets. diff --git a/trunk/drivers/video/cyblafb.c b/trunk/drivers/video/cyblafb.c index 94a66c2d2cf5..0ae0a97b0fed 100644 --- a/trunk/drivers/video/cyblafb.c +++ b/trunk/drivers/video/cyblafb.c @@ -14,6 +14,7 @@ #define CYBLAFB_PIXMAPSIZE 8192 +#include #include #include #include diff --git a/trunk/drivers/video/fbmem.c b/trunk/drivers/video/fbmem.c index 33034f81114d..a171daab0ad0 100644 --- a/trunk/drivers/video/fbmem.c +++ b/trunk/drivers/video/fbmem.c @@ -11,6 +11,7 @@ * for more details. */ +#include #include #include diff --git a/trunk/drivers/video/gbefb.c b/trunk/drivers/video/gbefb.c index bf0e60b5a3b6..5e25b9860196 100644 --- a/trunk/drivers/video/gbefb.c +++ b/trunk/drivers/video/gbefb.c @@ -9,6 +9,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/hitfb.c b/trunk/drivers/video/hitfb.c index 01864767450d..f04ca721f94c 100644 --- a/trunk/drivers/video/hitfb.c +++ b/trunk/drivers/video/hitfb.c @@ -11,6 +11,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/i810/i810-i2c.c b/trunk/drivers/video/i810/i810-i2c.c index c1f7b49975dd..3fe3ae1aff12 100644 --- a/trunk/drivers/video/i810/i810-i2c.c +++ b/trunk/drivers/video/i810/i810-i2c.c @@ -8,6 +8,7 @@ * License. See the file COPYING in the main directory of this archive for * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/i810/i810_main.c b/trunk/drivers/video/i810/i810_main.c index fbe8a2c4b04c..a1f7d80f0ac1 100644 --- a/trunk/drivers/video/i810/i810_main.c +++ b/trunk/drivers/video/i810/i810_main.c @@ -29,6 +29,7 @@ */ #include +#include #include #include #include diff --git a/trunk/drivers/video/imacfb.c b/trunk/drivers/video/imacfb.c index cdbae173d69a..7b1c168c834d 100644 --- a/trunk/drivers/video/imacfb.c +++ b/trunk/drivers/video/imacfb.c @@ -207,6 +207,10 @@ static int __init imacfb_probe(struct platform_device *dev) size_remap = size_total; imacfb_fix.smem_len = size_remap; +#ifndef __i386__ + screen_info.imacpm_seg = 0; +#endif + if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) { printk(KERN_WARNING "imacfb: cannot reserve video memory at 0x%lx\n", diff --git a/trunk/drivers/video/imsttfb.c b/trunk/drivers/video/imsttfb.c index 5f393d985b11..f73c642b50c2 100644 --- a/trunk/drivers/video/imsttfb.c +++ b/trunk/drivers/video/imsttfb.c @@ -16,6 +16,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/imxfb.c b/trunk/drivers/video/imxfb.c index 0f9b2fdc28b1..1718baaeed2a 100644 --- a/trunk/drivers/video/imxfb.c +++ b/trunk/drivers/video/imxfb.c @@ -18,6 +18,7 @@ //#define DEBUG 1 +#include #include #include #include diff --git a/trunk/drivers/video/intelfb/intelfbdrv.c b/trunk/drivers/video/intelfb/intelfbdrv.c index 3f39d84015f1..0a0a8b199ecc 100644 --- a/trunk/drivers/video/intelfb/intelfbdrv.c +++ b/trunk/drivers/video/intelfb/intelfbdrv.c @@ -108,6 +108,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/video/intelfb/intelfbhw.c b/trunk/drivers/video/intelfb/intelfbhw.c index 3b78a57924f0..7533b3dd08ac 100644 --- a/trunk/drivers/video/intelfb/intelfbhw.c +++ b/trunk/drivers/video/intelfb/intelfbhw.c @@ -19,6 +19,7 @@ /* $DHD: intelfb/intelfbhw.c,v 1.9 2003/06/27 15:06:25 dawes Exp $ */ +#include #include #include #include diff --git a/trunk/drivers/video/kyro/fbdev.c b/trunk/drivers/video/kyro/fbdev.c index 2fdbe9b2b04b..477ad297de4e 100644 --- a/trunk/drivers/video/kyro/fbdev.c +++ b/trunk/drivers/video/kyro/fbdev.c @@ -9,6 +9,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/logo/logo.c b/trunk/drivers/video/logo/logo.c index 80c03618eb53..788fa812c871 100644 --- a/trunk/drivers/video/logo/logo.c +++ b/trunk/drivers/video/logo/logo.c @@ -9,6 +9,7 @@ * Copyright (C) 2003 Geert Uytterhoeven */ +#include #include #include #include diff --git a/trunk/drivers/video/macmodes.c b/trunk/drivers/video/macmodes.c index ab2149531a04..d21321ca7c39 100644 --- a/trunk/drivers/video/macmodes.c +++ b/trunk/drivers/video/macmodes.c @@ -15,6 +15,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/matrox/matroxfb_DAC1064.c b/trunk/drivers/video/matrox/matroxfb_DAC1064.c index c4b570b4a4df..a456e67a5b00 100644 --- a/trunk/drivers/video/matrox/matroxfb_DAC1064.c +++ b/trunk/drivers/video/matrox/matroxfb_DAC1064.c @@ -12,6 +12,7 @@ * */ +#include #include "matroxfb_DAC1064.h" #include "matroxfb_misc.h" diff --git a/trunk/drivers/video/matrox/matroxfb_DAC1064.h b/trunk/drivers/video/matrox/matroxfb_DAC1064.h index df39c3193735..56513a5d220b 100644 --- a/trunk/drivers/video/matrox/matroxfb_DAC1064.h +++ b/trunk/drivers/video/matrox/matroxfb_DAC1064.h @@ -1,6 +1,7 @@ #ifndef __MATROXFB_DAC1064_H__ #define __MATROXFB_DAC1064_H__ +#include #include "matroxfb_base.h" diff --git a/trunk/drivers/video/matrox/matroxfb_Ti3026.c b/trunk/drivers/video/matrox/matroxfb_Ti3026.c index a5690a5f29d5..23ebad0a12d8 100644 --- a/trunk/drivers/video/matrox/matroxfb_Ti3026.c +++ b/trunk/drivers/video/matrox/matroxfb_Ti3026.c @@ -78,6 +78,7 @@ * */ +#include #include "matroxfb_Ti3026.h" #include "matroxfb_misc.h" diff --git a/trunk/drivers/video/matrox/matroxfb_Ti3026.h b/trunk/drivers/video/matrox/matroxfb_Ti3026.h index 27872aaa0a17..536e5f69de9f 100644 --- a/trunk/drivers/video/matrox/matroxfb_Ti3026.h +++ b/trunk/drivers/video/matrox/matroxfb_Ti3026.h @@ -1,6 +1,7 @@ #ifndef __MATROXFB_TI3026_H__ #define __MATROXFB_TI3026_H__ +#include #include "matroxfb_base.h" diff --git a/trunk/drivers/video/matrox/matroxfb_base.c b/trunk/drivers/video/matrox/matroxfb_base.c index 4a57dabb77d4..f4ddd3431f17 100644 --- a/trunk/drivers/video/matrox/matroxfb_base.c +++ b/trunk/drivers/video/matrox/matroxfb_base.c @@ -99,6 +99,7 @@ * */ +#include #include #define __OLD_VIDIOC_ @@ -233,7 +234,7 @@ int matroxfb_enable_irq(WPMINFO int reenable) { if (!test_and_set_bit(0, &ACCESS_FBINFO(irq_flags))) { if (request_irq(ACCESS_FBINFO(pcidev)->irq, matrox_irq, - IRQF_SHARED, "matroxfb", MINFO)) { + SA_SHIRQ, "matroxfb", MINFO)) { clear_bit(0, &ACCESS_FBINFO(irq_flags)); return -EINVAL; } diff --git a/trunk/drivers/video/matrox/matroxfb_base.h b/trunk/drivers/video/matrox/matroxfb_base.h index b95779b57c06..b71737178d0d 100644 --- a/trunk/drivers/video/matrox/matroxfb_base.h +++ b/trunk/drivers/video/matrox/matroxfb_base.h @@ -25,6 +25,7 @@ /* Guard accelerator accesses with spin_lock_irqsave... */ #undef MATROXFB_USE_SPINLOCKS +#include #include #include #include diff --git a/trunk/drivers/video/matrox/matroxfb_misc.c b/trunk/drivers/video/matrox/matroxfb_misc.c index 18886b629cb1..263d801ef78f 100644 --- a/trunk/drivers/video/matrox/matroxfb_misc.c +++ b/trunk/drivers/video/matrox/matroxfb_misc.c @@ -84,6 +84,7 @@ * */ +#include #include "matroxfb_misc.h" #include diff --git a/trunk/drivers/video/neofb.c b/trunk/drivers/video/neofb.c index 773855a311e8..2f156b724d1c 100644 --- a/trunk/drivers/video/neofb.c +++ b/trunk/drivers/video/neofb.c @@ -54,6 +54,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/video/nvidia/nv_i2c.c b/trunk/drivers/video/nvidia/nv_i2c.c index 19eef3a09023..1edb1c432b75 100644 --- a/trunk/drivers/video/nvidia/nv_i2c.c +++ b/trunk/drivers/video/nvidia/nv_i2c.c @@ -10,6 +10,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/nvidia/nv_of.c b/trunk/drivers/video/nvidia/nv_of.c index 8209106e26ee..7a03d040b1a3 100644 --- a/trunk/drivers/video/nvidia/nv_of.c +++ b/trunk/drivers/video/nvidia/nv_of.c @@ -10,6 +10,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/nvidia/nvidia.c b/trunk/drivers/video/nvidia/nvidia.c index b02d6033cc0c..7b5cffb27851 100644 --- a/trunk/drivers/video/nvidia/nvidia.c +++ b/trunk/drivers/video/nvidia/nvidia.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/video/offb.c b/trunk/drivers/video/offb.c index 71ce1fa45cf4..ad1434e3f227 100644 --- a/trunk/drivers/video/offb.c +++ b/trunk/drivers/video/offb.c @@ -12,6 +12,7 @@ * more details. */ +#include #include #include #include @@ -97,43 +98,14 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { struct offb_par *par = (struct offb_par *) info->par; - int i, depth; - u32 *pal = info->pseudo_palette; - depth = info->var.bits_per_pixel; - if (depth == 16) - depth = (info->var.green.length == 5) ? 15 : 16; - - if (regno > 255 || - (depth == 16 && regno > 63) || - (depth == 15 && regno > 31)) + if (!par->cmap_adr || regno > 255) return 1; - if (regno < 16) { - switch (depth) { - case 15: - pal[regno] = (regno << 10) | (regno << 5) | regno; - break; - case 16: - pal[regno] = (regno << 11) | (regno << 5) | regno; - break; - case 24: - pal[regno] = (regno << 16) | (regno << 8) | regno; - break; - case 32: - i = (regno << 8) | regno; - pal[regno] = (i << 16) | i; - break; - } - } - red >>= 8; green >>= 8; blue >>= 8; - if (!par->cmap_adr) - return 0; - switch (par->cmap_type) { case cmap_m64: writeb(regno, par->cmap_adr); @@ -170,6 +142,20 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, break; } + if (regno < 16) + switch (info->var.bits_per_pixel) { + case 16: + ((u16 *) (info->pseudo_palette))[regno] = + (regno << 10) | (regno << 5) | regno; + break; + case 32: + { + int i = (regno << 8) | regno; + ((u32 *) (info->pseudo_palette))[regno] = + (i << 16) | i; + break; + } + } return 0; } @@ -238,9 +224,81 @@ int __init offb_init(void) { struct device_node *dp = NULL, *boot_disp = NULL; +#if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) + struct device_node *macos_display = NULL; +#endif if (fb_get_options("offb", NULL)) return -ENODEV; +#if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) + /* If we're booted from BootX... */ + if (boot_infos != 0) { + unsigned long addr = + (unsigned long) boot_infos->dispDeviceBase; + u32 *addrp; + u64 daddr, dsize; + unsigned int flags; + + /* find the device node corresponding to the macos display */ + while ((dp = of_find_node_by_type(dp, "display"))) { + int i; + + /* + * Look for an AAPL,address property first. + */ + unsigned int na; + unsigned int *ap = + (unsigned int *)get_property(dp, "AAPL,address", + &na); + if (ap != 0) { + for (na /= sizeof(unsigned int); na > 0; + --na, ++ap) + if (*ap <= addr && + addr < *ap + 0x1000000) { + macos_display = dp; + goto foundit; + } + } + + /* + * See if the display address is in one of the address + * ranges for this display. + */ + i = 0; + for (;;) { + addrp = of_get_address(dp, i++, &dsize, &flags); + if (addrp == NULL) + break; + if (!(flags & IORESOURCE_MEM)) + continue; + daddr = of_translate_address(dp, addrp); + if (daddr == OF_BAD_ADDR) + continue; + if (daddr <= addr && addr < (daddr + dsize)) { + macos_display = dp; + goto foundit; + } + } + foundit: + if (macos_display) { + printk(KERN_INFO "MacOS display is %s\n", + dp->full_name); + break; + } + } + + /* initialize it */ + offb_init_fb(macos_display ? macos_display-> + name : "MacOS display", + macos_display ? macos_display-> + full_name : "MacOS display", + boot_infos->dispDeviceRect[2], + boot_infos->dispDeviceRect[3], + boot_infos->dispDeviceDepth, + boot_infos->dispDeviceRowBytes, addr, NULL); + } +#endif /* defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) */ + for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { if (get_property(dp, "linux,opened", NULL) && get_property(dp, "linux,boot-display", NULL)) { @@ -260,93 +318,94 @@ int __init offb_init(void) static void __init offb_init_nodriver(struct device_node *dp) { + int *pp, i; unsigned int len; - int i, width = 640, height = 480, depth = 8, pitch = 640; - unsigned int flags, rsize, addr_prop = 0; - unsigned long max_size = 0; - u64 rstart, address = OF_BAD_ADDR; - u32 *pp, *addrp, *up; + int width = 640, height = 480, depth = 8, pitch; + unsigned int flags, rsize, *up; + u64 address = OF_BAD_ADDR; + u32 *addrp; u64 asize; - pp = (u32 *)get_property(dp, "linux,bootx-depth", &len); - if (pp == NULL) - pp = (u32 *)get_property(dp, "depth", &len); - if (pp && len == sizeof(u32)) + if ((pp = (int *) get_property(dp, "depth", &len)) != NULL + && len == sizeof(int)) depth = *pp; - - pp = (u32 *)get_property(dp, "linux,bootx-width", &len); - if (pp == NULL) - pp = (u32 *)get_property(dp, "width", &len); - if (pp && len == sizeof(u32)) + if ((pp = (int *) get_property(dp, "width", &len)) != NULL + && len == sizeof(int)) width = *pp; - - pp = (u32 *)get_property(dp, "linux,bootx-height", &len); - if (pp == NULL) - pp = (u32 *)get_property(dp, "height", &len); - if (pp && len == sizeof(u32)) + if ((pp = (int *) get_property(dp, "height", &len)) != NULL + && len == sizeof(int)) height = *pp; - - pp = (u32 *)get_property(dp, "linux,bootx-linebytes", &len); - if (pp == NULL) - pp = (u32 *)get_property(dp, "linebytes", &len); - if (pp && len == sizeof(u32)) + if ((pp = (int *) get_property(dp, "linebytes", &len)) != NULL + && len == sizeof(int)) { pitch = *pp; - else - pitch = width * ((depth + 7) / 8); - - rsize = (unsigned long)pitch * (unsigned long)height; - - /* Ok, now we try to figure out the address of the framebuffer. - * - * Unfortunately, Open Firmware doesn't provide a standard way to do - * so. All we can do is a dodgy heuristic that happens to work in - * practice. On most machines, the "address" property contains what - * we need, though not on Matrox cards found in IBM machines. What I've - * found that appears to give good results is to go through the PCI - * ranges and pick one that is both big enough and if possible encloses - * the "address" property. If none match, we pick the biggest - */ - up = (u32 *)get_property(dp, "linux,bootx-addr", &len); - if (up == NULL) - up = (u32 *)get_property(dp, "address", &len); - if (up && len == sizeof(u32)) - addr_prop = *up; - - for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags)) - != NULL; i++) { - int match_addrp = 0; - - if (!(flags & IORESOURCE_MEM)) - continue; - if (asize < rsize) - continue; - rstart = of_translate_address(dp, addrp); - if (rstart == OF_BAD_ADDR) - continue; - if (addr_prop && (rstart <= addr_prop) && - ((rstart + asize) >= (addr_prop + rsize))) - match_addrp = 1; - if (match_addrp) { - address = addr_prop; - break; + if (pitch == 1) + pitch = 0x1000; + } else + pitch = width; + + rsize = (unsigned long)pitch * (unsigned long)height * + (unsigned long)(depth / 8); + + /* Try to match device to a PCI device in order to get a properly + * translated address rather then trying to decode the open firmware + * stuff in various incorrect ways + */ +#ifdef CONFIG_PCI + /* First try to locate the PCI device if any */ + { + struct pci_dev *pdev = NULL; + + for_each_pci_dev(pdev) { + if (dp == pci_device_to_OF_node(pdev)) + break; + } + if (pdev) { + for (i = 0; i < 6 && address == OF_BAD_ADDR; i++) { + if ((pci_resource_flags(pdev, i) & + IORESOURCE_MEM) && + (pci_resource_len(pdev, i) >= rsize)) + address = pci_resource_start(pdev, i); + } + pci_dev_put(pdev); + } + } +#endif /* CONFIG_PCI */ + + /* This one is dodgy, we may drop it ... */ + if (address == OF_BAD_ADDR && + (up = (unsigned *) get_property(dp, "address", &len)) != NULL && + len == sizeof(unsigned int)) + address = (u64) * up; + + if (address == OF_BAD_ADDR) { + for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags)) + != NULL; i++) { + if (!(flags & IORESOURCE_MEM)) + continue; + if (asize >= pitch * height * depth / 8) + break; + } + if (addrp == NULL) { + printk(KERN_ERR + "no framebuffer address found for %s\n", + dp->full_name); + return; + } + address = of_translate_address(dp, addrp); + if (address == OF_BAD_ADDR) { + printk(KERN_ERR + "can't translate framebuffer address for %s\n", + dp->full_name); + return; } - if (rsize > max_size) { - max_size = rsize; - address = OF_BAD_ADDR; - } - if (address == OF_BAD_ADDR) - address = rstart; - } - if (address == OF_BAD_ADDR && addr_prop) - address = (u64)addr_prop; - if (address != OF_BAD_ADDR) { /* kludge for valkyrie */ if (strcmp(dp->name, "valkyrie") == 0) address += 0x1000; - offb_init_fb(dp->name, dp->full_name, width, height, depth, - pitch, address, dp); } + offb_init_fb(dp->name, dp->full_name, width, height, depth, + pitch, address, dp); + } static void __init offb_init_fb(const char *name, const char *full_name, @@ -354,7 +413,7 @@ static void __init offb_init_fb(const char *name, const char *full_name, int pitch, unsigned long address, struct device_node *dp) { - unsigned long res_size = pitch * height * (depth + 7) / 8; + unsigned long res_size = pitch * height * depth / 8; struct offb_par *par = &default_par; unsigned long res_start = address; struct fb_fix_screeninfo *fix; @@ -368,7 +427,7 @@ static void __init offb_init_fb(const char *name, const char *full_name, printk(KERN_INFO "Using unsupported %dx%d %s at %lx, depth=%d, pitch=%d\n", width, height, name, address, depth, pitch); - if (depth != 8 && depth != 15 && depth != 16 && depth != 32) { + if (depth != 8 && depth != 16 && depth != 32) { printk(KERN_ERR "%s: can't use depth = %d\n", full_name, depth); release_mem_region(res_start, res_size); @@ -444,6 +503,7 @@ static void __init offb_init_fb(const char *name, const char *full_name, : */ FB_VISUAL_TRUECOLOR; var->xoffset = var->yoffset = 0; + var->bits_per_pixel = depth; switch (depth) { case 8: var->bits_per_pixel = 8; @@ -456,7 +516,7 @@ static void __init offb_init_fb(const char *name, const char *full_name, var->transp.offset = 0; var->transp.length = 0; break; - case 15: /* RGB 555 */ + case 16: /* RGB 555 */ var->bits_per_pixel = 16; var->red.offset = 10; var->red.length = 5; @@ -467,17 +527,6 @@ static void __init offb_init_fb(const char *name, const char *full_name, var->transp.offset = 0; var->transp.length = 0; break; - case 16: /* RGB 565 */ - var->bits_per_pixel = 16; - var->red.offset = 11; - var->red.length = 5; - var->green.offset = 5; - var->green.length = 6; - var->blue.offset = 0; - var->blue.length = 5; - var->transp.offset = 0; - var->transp.length = 0; - break; case 32: /* RGB 888 */ var->bits_per_pixel = 32; var->red.offset = 16; diff --git a/trunk/drivers/video/platinumfb.c b/trunk/drivers/video/platinumfb.c index 450e802e0aa8..335e37465559 100644 --- a/trunk/drivers/video/platinumfb.c +++ b/trunk/drivers/video/platinumfb.c @@ -17,6 +17,7 @@ * more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/pm2fb.c b/trunk/drivers/video/pm2fb.c index 49a203e1591c..4e963930b50a 100644 --- a/trunk/drivers/video/pm2fb.c +++ b/trunk/drivers/video/pm2fb.c @@ -27,6 +27,7 @@ * */ +#include #include #include #include diff --git a/trunk/drivers/video/pm3fb.c b/trunk/drivers/video/pm3fb.c index 0e0f977b05ee..52c18a35fb41 100644 --- a/trunk/drivers/video/pm3fb.c +++ b/trunk/drivers/video/pm3fb.c @@ -52,6 +52,7 @@ * Wed Feb 21 14:47:06 CET 2001, v 1.0.0: First working version */ +#include #include #include #include diff --git a/trunk/drivers/video/pnx4008/Makefile b/trunk/drivers/video/pnx4008/Makefile deleted file mode 100644 index 636aaccf01fd..000000000000 --- a/trunk/drivers/video/pnx4008/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -# Makefile for the new PNX4008 framebuffer device driver -# - -obj-$(CONFIG_FB_PNX4008_DUM) += sdum.o -obj-$(CONFIG_FB_PNX4008_DUM_RGB) += pnxrgbfb.o - diff --git a/trunk/drivers/video/pnx4008/dum.h b/trunk/drivers/video/pnx4008/dum.h deleted file mode 100644 index d80a614d89ed..000000000000 --- a/trunk/drivers/video/pnx4008/dum.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * linux/drivers/video/pnx4008/dum.h - * - * Internal header for SDUM - * - * 2005 (c) Koninklijke Philips N.V. This file is licensed under - * the terms of the GNU General Public License version 2. This program - * is licensed "as is" without any warranty of any kind, whether express - * or implied. - */ - -#ifndef __PNX008_DUM_H__ -#define __PNX008_DUM_H__ - -#include - -#define PNX4008_DUMCONF_VA_BASE IO_ADDRESS(PNX4008_DUMCONF_BASE) -#define PNX4008_DUM_MAIN_VA_BASE IO_ADDRESS(PNX4008_DUM_MAINCFG_BASE) - -/* DUM CFG ADDRESSES */ -#define DUM_CH_BASE_ADR (PNX4008_DUMCONF_VA_BASE + 0x00) -#define DUM_CH_MIN_ADR (PNX4008_DUMCONF_VA_BASE + 0x00) -#define DUM_CH_MAX_ADR (PNX4008_DUMCONF_VA_BASE + 0x04) -#define DUM_CH_CONF_ADR (PNX4008_DUMCONF_VA_BASE + 0x08) -#define DUM_CH_STAT_ADR (PNX4008_DUMCONF_VA_BASE + 0x0C) -#define DUM_CH_CTRL_ADR (PNX4008_DUMCONF_VA_BASE + 0x10) - -#define CH_MARG (0x100 / sizeof(u32)) -#define DUM_CH_MIN(i) (*((volatile u32 *)DUM_CH_MIN_ADR + (i) * CH_MARG)) -#define DUM_CH_MAX(i) (*((volatile u32 *)DUM_CH_MAX_ADR + (i) * CH_MARG)) -#define DUM_CH_CONF(i) (*((volatile u32 *)DUM_CH_CONF_ADR + (i) * CH_MARG)) -#define DUM_CH_STAT(i) (*((volatile u32 *)DUM_CH_STAT_ADR + (i) * CH_MARG)) -#define DUM_CH_CTRL(i) (*((volatile u32 *)DUM_CH_CTRL_ADR + (i) * CH_MARG)) - -#define DUM_CONF_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x00) -#define DUM_CTRL_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x04) -#define DUM_STAT_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x08) -#define DUM_DECODE_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x0C) -#define DUM_COM_BASE_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x10) -#define DUM_SYNC_C_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x14) -#define DUM_CLK_DIV_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x18) -#define DUM_DIRTY_LOW_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x20) -#define DUM_DIRTY_HIGH_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x24) -#define DUM_FORMAT_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x28) -#define DUM_WTCFG1_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x30) -#define DUM_RTCFG1_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x34) -#define DUM_WTCFG2_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x38) -#define DUM_RTCFG2_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x3C) -#define DUM_TCFG_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x40) -#define DUM_OUTP_FORMAT1_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x44) -#define DUM_OUTP_FORMAT2_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x48) -#define DUM_SYNC_MODE_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x4C) -#define DUM_SYNC_OUT_C_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x50) - -#define DUM_CONF (*(volatile u32 *)(DUM_CONF_ADR)) -#define DUM_CTRL (*(volatile u32 *)(DUM_CTRL_ADR)) -#define DUM_STAT (*(volatile u32 *)(DUM_STAT_ADR)) -#define DUM_DECODE (*(volatile u32 *)(DUM_DECODE_ADR)) -#define DUM_COM_BASE (*(volatile u32 *)(DUM_COM_BASE_ADR)) -#define DUM_SYNC_C (*(volatile u32 *)(DUM_SYNC_C_ADR)) -#define DUM_CLK_DIV (*(volatile u32 *)(DUM_CLK_DIV_ADR)) -#define DUM_DIRTY_LOW (*(volatile u32 *)(DUM_DIRTY_LOW_ADR)) -#define DUM_DIRTY_HIGH (*(volatile u32 *)(DUM_DIRTY_HIGH_ADR)) -#define DUM_FORMAT (*(volatile u32 *)(DUM_FORMAT_ADR)) -#define DUM_WTCFG1 (*(volatile u32 *)(DUM_WTCFG1_ADR)) -#define DUM_RTCFG1 (*(volatile u32 *)(DUM_RTCFG1_ADR)) -#define DUM_WTCFG2 (*(volatile u32 *)(DUM_WTCFG2_ADR)) -#define DUM_RTCFG2 (*(volatile u32 *)(DUM_RTCFG2_ADR)) -#define DUM_TCFG (*(volatile u32 *)(DUM_TCFG_ADR)) -#define DUM_OUTP_FORMAT1 (*(volatile u32 *)(DUM_OUTP_FORMAT1_ADR)) -#define DUM_OUTP_FORMAT2 (*(volatile u32 *)(DUM_OUTP_FORMAT2_ADR)) -#define DUM_SYNC_MODE (*(volatile u32 *)(DUM_SYNC_MODE_ADR)) -#define DUM_SYNC_OUT_C (*(volatile u32 *)(DUM_SYNC_OUT_C_ADR)) - -/* DUM SLAVE ADDRESSES */ -#define DUM_SLAVE_WRITE_ADR (PNX4008_DUM_MAINCFG_BASE + 0x0000000) -#define DUM_SLAVE_READ1_I_ADR (PNX4008_DUM_MAINCFG_BASE + 0x1000000) -#define DUM_SLAVE_READ1_R_ADR (PNX4008_DUM_MAINCFG_BASE + 0x1000004) -#define DUM_SLAVE_READ2_I_ADR (PNX4008_DUM_MAINCFG_BASE + 0x1000008) -#define DUM_SLAVE_READ2_R_ADR (PNX4008_DUM_MAINCFG_BASE + 0x100000C) - -#define DUM_SLAVE_WRITE_W ((volatile u32 *)(DUM_SLAVE_WRITE_ADR)) -#define DUM_SLAVE_WRITE_HW ((volatile u16 *)(DUM_SLAVE_WRITE_ADR)) -#define DUM_SLAVE_READ1_I ((volatile u8 *)(DUM_SLAVE_READ1_I_ADR)) -#define DUM_SLAVE_READ1_R ((volatile u16 *)(DUM_SLAVE_READ1_R_ADR)) -#define DUM_SLAVE_READ2_I ((volatile u8 *)(DUM_SLAVE_READ2_I_ADR)) -#define DUM_SLAVE_READ2_R ((volatile u16 *)(DUM_SLAVE_READ2_R_ADR)) - -/* Sony display register addresses */ -#define DISP_0_REG (0x00) -#define DISP_1_REG (0x01) -#define DISP_CAL_REG (0x20) -#define DISP_ID_REG (0x2A) -#define DISP_XMIN_L_REG (0x30) -#define DISP_XMIN_H_REG (0x31) -#define DISP_YMIN_REG (0x32) -#define DISP_XMAX_L_REG (0x34) -#define DISP_XMAX_H_REG (0x35) -#define DISP_YMAX_REG (0x36) -#define DISP_SYNC_EN_REG (0x38) -#define DISP_SYNC_RISE_L_REG (0x3C) -#define DISP_SYNC_RISE_H_REG (0x3D) -#define DISP_SYNC_FALL_L_REG (0x3E) -#define DISP_SYNC_FALL_H_REG (0x3F) -#define DISP_PIXEL_REG (0x0B) -#define DISP_DUMMY1_REG (0x28) -#define DISP_DUMMY2_REG (0x29) -#define DISP_TIMING_REG (0x98) -#define DISP_DUMP_REG (0x99) - -/* Sony display constants */ -#define SONY_ID1 (0x22) -#define SONY_ID2 (0x23) - -/* Philips display register addresses */ -#define PH_DISP_ORIENT_REG (0x003) -#define PH_DISP_YPOINT_REG (0x200) -#define PH_DISP_XPOINT_REG (0x201) -#define PH_DISP_PIXEL_REG (0x202) -#define PH_DISP_YMIN_REG (0x406) -#define PH_DISP_YMAX_REG (0x407) -#define PH_DISP_XMIN_REG (0x408) -#define PH_DISP_XMAX_REG (0x409) - -/* Misc constants */ -#define NO_VALID_DISPLAY_FOUND (0) -#define DISPLAY2_IS_NOT_CONNECTED (0) - -/* register values */ -#define V_BAC_ENABLE (BIT(0)) -#define V_BAC_DISABLE_IDLE (BIT(1)) -#define V_BAC_DISABLE_TRIG (BIT(2)) -#define V_DUM_RESET (BIT(3)) -#define V_MUX_RESET (BIT(4)) -#define BAC_ENABLED (BIT(0)) -#define BAC_DISABLED 0 - -/* Sony LCD commands */ -#define V_LCD_STANDBY_OFF ((BIT(25)) | (0 << 16) | DISP_0_REG) -#define V_LCD_USE_9BIT_BUS ((BIT(25)) | (2 << 16) | DISP_1_REG) -#define V_LCD_SYNC_RISE_L ((BIT(25)) | (0 << 16) | DISP_SYNC_RISE_L_REG) -#define V_LCD_SYNC_RISE_H ((BIT(25)) | (0 << 16) | DISP_SYNC_RISE_H_REG) -#define V_LCD_SYNC_FALL_L ((BIT(25)) | (160 << 16) | DISP_SYNC_FALL_L_REG) -#define V_LCD_SYNC_FALL_H ((BIT(25)) | (0 << 16) | DISP_SYNC_FALL_H_REG) -#define V_LCD_SYNC_ENABLE ((BIT(25)) | (128 << 16) | DISP_SYNC_EN_REG) -#define V_LCD_DISPLAY_ON ((BIT(25)) | (64 << 16) | DISP_0_REG) - -enum { - PAD_NONE, - PAD_512, - PAD_1024 -}; - -enum { - RGB888, - RGB666, - RGB565, - BGR565, - ARGB1555, - ABGR1555, - ARGB4444, - ABGR4444 -}; - -struct dum_setup { - int sync_neg_edge; - int round_robin; - int mux_int; - int synced_dirty_flag_int; - int dirty_flag_int; - int error_int; - int pf_empty_int; - int sf_empty_int; - int bac_dis_int; - u32 dirty_base_adr; - u32 command_base_adr; - u32 sync_clk_div; - int sync_output; - u32 sync_restart_val; - u32 set_sync_high; - u32 set_sync_low; -}; - -struct dum_ch_setup { - int disp_no; - u32 xmin; - u32 ymin; - u32 xmax; - u32 ymax; - int xmirror; - int ymirror; - int rotate; - u32 minadr; - u32 maxadr; - u32 dirtybuffer; - int pad; - int format; - int hwdirty; - int slave_trans; -}; - -struct disp_window { - u32 xmin_l; - u32 xmin_h; - u32 ymin; - u32 xmax_l; - u32 xmax_h; - u32 ymax; -}; - -#endif /* #ifndef __PNX008_DUM_H__ */ diff --git a/trunk/drivers/video/pnx4008/fbcommon.h b/trunk/drivers/video/pnx4008/fbcommon.h deleted file mode 100644 index 4ebc87dafafb..000000000000 --- a/trunk/drivers/video/pnx4008/fbcommon.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2005 Philips Semiconductors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA, or http://www.gnu.org/licenses/gpl.html -*/ - -#define QCIF_W (176) -#define QCIF_H (144) - -#define CIF_W (352) -#define CIF_H (288) - -#define LCD_X_RES 208 -#define LCD_Y_RES 320 -#define LCD_X_PAD 256 -#define LCD_BBP 4 /* Bytes Per Pixel */ - -#define DISP_MAX_X_SIZE (320) -#define DISP_MAX_Y_SIZE (208) - -#define RETURNVAL_BASE (0x400) - -enum fb_ioctl_returntype { - ENORESOURCESLEFT = RETURNVAL_BASE, - ERESOURCESNOTFREED, - EPROCNOTOWNER, - EFBNOTOWNER, - ECOPYFAILED, - EIOREMAPFAILED, -}; diff --git a/trunk/drivers/video/pnx4008/pnxrgbfb.c b/trunk/drivers/video/pnx4008/pnxrgbfb.c deleted file mode 100644 index 7d9453c91a42..000000000000 --- a/trunk/drivers/video/pnx4008/pnxrgbfb.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - * drivers/video/pnx4008/pnxrgbfb.c - * - * PNX4008's framebuffer support - * - * Author: Grigory Tolstolytkin - * Based on Philips Semiconductors's code - * - * Copyrght (c) 2005 MontaVista Software, Inc. - * Copyright (c) 2005 Philips Semiconductors - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "sdum.h" -#include "fbcommon.h" - -static u32 colreg[16]; - -static struct fb_var_screeninfo rgbfb_var __initdata = { - .xres = LCD_X_RES, - .yres = LCD_Y_RES, - .xres_virtual = LCD_X_RES, - .yres_virtual = LCD_Y_RES, - .bits_per_pixel = 32, - .red.offset = 16, - .red.length = 8, - .green.offset = 8, - .green.length = 8, - .blue.offset = 0, - .blue.length = 8, - .left_margin = 0, - .right_margin = 0, - .upper_margin = 0, - .lower_margin = 0, - .vmode = FB_VMODE_NONINTERLACED, -}; -static struct fb_fix_screeninfo rgbfb_fix __initdata = { - .id = "RGBFB", - .line_length = LCD_X_RES * LCD_BBP, - .type = FB_TYPE_PACKED_PIXELS, - .visual = FB_VISUAL_TRUECOLOR, - .xpanstep = 0, - .ypanstep = 0, - .ywrapstep = 0, - .accel = FB_ACCEL_NONE, -}; - -static int channel_owned; - -static int no_cursor(struct fb_info *info, struct fb_cursor *cursor) -{ - return 0; -} - -static int rgbfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info) -{ - if (regno > 15) - return 1; - - colreg[regno] = ((red & 0xff00) << 8) | (green & 0xff00) | - ((blue & 0xff00) >> 8); - return 0; -} - -static int rgbfb_mmap(struct fb_info *info, struct vm_area_struct *vma) -{ - return pnx4008_sdum_mmap(info, vma, NULL); -} - -static struct fb_ops rgbfb_ops = { - .fb_mmap = rgbfb_mmap, - .fb_setcolreg = rgbfb_setcolreg, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, -}; - -static int rgbfb_remove(struct platform_device *pdev) -{ - struct fb_info *info = platform_get_drvdata(pdev); - - if (info) { - unregister_framebuffer(info); - fb_dealloc_cmap(&info->cmap); - framebuffer_release(info); - platform_set_drvdata(pdev, NULL); - kfree(info); - } - - pnx4008_free_dum_channel(channel_owned, pdev->id); - pnx4008_set_dum_exit_notification(pdev->id); - - return 0; -} - -static int __devinit rgbfb_probe(struct platform_device *pdev) -{ - struct fb_info *info; - struct dumchannel_uf chan_uf; - int ret; - char *option; - - info = framebuffer_alloc(sizeof(u32) * 16, &pdev->dev); - if (!info) { - ret = -ENOMEM; - goto err; - } - - pnx4008_get_fb_addresses(FB_TYPE_RGB, (void **)&info->screen_base, - (dma_addr_t *) &rgbfb_fix.smem_start, - &rgbfb_fix.smem_len); - - if ((ret = pnx4008_alloc_dum_channel(pdev->id)) < 0) - goto err0; - else { - channel_owned = ret; - chan_uf.channelnr = channel_owned; - chan_uf.dirty = (u32 *) NULL; - chan_uf.source = (u32 *) rgbfb_fix.smem_start; - chan_uf.x_offset = 0; - chan_uf.y_offset = 0; - chan_uf.width = LCD_X_RES; - chan_uf.height = LCD_Y_RES; - - if ((ret = pnx4008_put_dum_channel_uf(chan_uf, pdev->id))< 0) - goto err1; - - if ((ret = - pnx4008_set_dum_channel_sync(channel_owned, CONF_SYNC_ON, - pdev->id)) < 0) - goto err1; - - if ((ret = - pnx4008_set_dum_channel_dirty_detect(channel_owned, - CONF_DIRTYDETECTION_ON, - pdev->id)) < 0) - goto err1; - } - - if (!fb_get_options("pnxrgbfb", &option) && !strcmp(option, "nocursor")) - rgbfb_ops.fb_cursor = no_cursor; - - info->node = -1; - info->flags = FBINFO_FLAG_DEFAULT; - info->fbops = &rgbfb_ops; - info->fix = rgbfb_fix; - info->var = rgbfb_var; - info->screen_size = rgbfb_fix.smem_len; - info->pseudo_palette = info->par; - info->par = NULL; - - ret = fb_alloc_cmap(&info->cmap, 256, 0); - if (ret < 0) - goto err2; - - ret = register_framebuffer(info); - if (ret < 0) - goto err3; - platform_set_drvdata(pdev, info); - - return 0; - -err3: - fb_dealloc_cmap(&info->cmap); -err2: - framebuffer_release(info); -err1: - pnx4008_free_dum_channel(channel_owned, pdev->id); -err0: - kfree(info); -err: - return ret; -} - -static struct platform_driver rgbfb_driver = { - .driver = { - .name = "rgbfb", - }, - .probe = rgbfb_probe, - .remove = rgbfb_remove, -}; - -static int __init rgbfb_init(void) -{ - return platform_driver_register(&rgbfb_driver); -} - -static void __exit rgbfb_exit(void) -{ - platform_driver_unregister(&rgbfb_driver); -} - -module_init(rgbfb_init); -module_exit(rgbfb_exit); - -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/video/pnx4008/sdum.c b/trunk/drivers/video/pnx4008/sdum.c deleted file mode 100644 index 51f0ecc2a511..000000000000 --- a/trunk/drivers/video/pnx4008/sdum.c +++ /dev/null @@ -1,872 +0,0 @@ -/* - * drivers/video/pnx4008/sdum.c - * - * Display Update Master support - * - * Authors: Grigory Tolstolytkin - * Vitaly Wool - * Based on Philips Semiconductors's code - * - * Copyrght (c) 2005-2006 MontaVista Software, Inc. - * Copyright (c) 2005 Philips Semiconductors - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "sdum.h" -#include "fbcommon.h" -#include "dum.h" - -/* Framebuffers we have */ - -static struct pnx4008_fb_addr { - int fb_type; - long addr_offset; - long fb_length; -} fb_addr[] = { - [0] = { - FB_TYPE_YUV, 0, 0xB0000 - }, - [1] = { - FB_TYPE_RGB, 0xB0000, 0x50000 - }, -}; - -static struct dum_data { - u32 lcd_phys_start; - u32 lcd_virt_start; - u32 slave_phys_base; - u32 *slave_virt_base; - int fb_owning_channel[MAX_DUM_CHANNELS]; - struct dumchannel_uf chan_uf_store[MAX_DUM_CHANNELS]; -} dum_data; - -/* Different local helper functions */ - -static u32 nof_pixels_dx(struct dum_ch_setup *ch_setup) -{ - return (ch_setup->xmax - ch_setup->xmin + 1); -} - -static u32 nof_pixels_dy(struct dum_ch_setup *ch_setup) -{ - return (ch_setup->ymax - ch_setup->ymin + 1); -} - -static u32 nof_pixels_dxy(struct dum_ch_setup *ch_setup) -{ - return (nof_pixels_dx(ch_setup) * nof_pixels_dy(ch_setup)); -} - -static u32 nof_bytes(struct dum_ch_setup *ch_setup) -{ - u32 r = nof_pixels_dxy(ch_setup); - switch (ch_setup->format) { - case RGB888: - case RGB666: - r *= 4; - break; - - default: - r *= 2; - break; - } - return r; -} - -static u32 build_command(int disp_no, u32 reg, u32 val) -{ - return ((disp_no << 26) | BIT(25) | (val << 16) | (disp_no << 10) | - (reg << 0)); -} - -static u32 build_double_index(int disp_no, u32 val) -{ - return ((disp_no << 26) | (val << 16) | (disp_no << 10) | (val << 0)); -} - -static void build_disp_window(struct dum_ch_setup * ch_setup, struct disp_window * dw) -{ - dw->ymin = ch_setup->ymin; - dw->ymax = ch_setup->ymax; - dw->xmin_l = ch_setup->xmin & 0xFF; - dw->xmin_h = (ch_setup->xmin & BIT(8)) >> 8; - dw->xmax_l = ch_setup->xmax & 0xFF; - dw->xmax_h = (ch_setup->xmax & BIT(8)) >> 8; -} - -static int put_channel(struct dumchannel chan) -{ - int i = chan.channelnr; - - if (i < 0 || i > MAX_DUM_CHANNELS) - return -EINVAL; - else { - DUM_CH_MIN(i) = chan.dum_ch_min; - DUM_CH_MAX(i) = chan.dum_ch_max; - DUM_CH_CONF(i) = chan.dum_ch_conf; - DUM_CH_CTRL(i) = chan.dum_ch_ctrl; - } - - return 0; -} - -static void clear_channel(int channr) -{ - struct dumchannel chan; - - chan.channelnr = channr; - chan.dum_ch_min = 0; - chan.dum_ch_max = 0; - chan.dum_ch_conf = 0; - chan.dum_ch_ctrl = 0; - - put_channel(chan); -} - -static int put_cmd_string(struct cmdstring cmds) -{ - u16 *cmd_str_virtaddr; - u32 *cmd_ptr0_virtaddr; - u32 cmd_str_physaddr; - - int i = cmds.channelnr; - - if (i < 0 || i > MAX_DUM_CHANNELS) - return -EINVAL; - else if ((cmd_ptr0_virtaddr = - (int *)ioremap_nocache(DUM_COM_BASE, - sizeof(int) * MAX_DUM_CHANNELS)) == - NULL) - return -EIOREMAPFAILED; - else { - cmd_str_physaddr = ioread32(&cmd_ptr0_virtaddr[cmds.channelnr]); - if ((cmd_str_virtaddr = - (u16 *) ioremap_nocache(cmd_str_physaddr, - sizeof(cmds))) == NULL) { - iounmap(cmd_ptr0_virtaddr); - return -EIOREMAPFAILED; - } else { - int t; - for (t = 0; t < 8; t++) - iowrite16(*((u16 *)&cmds.prestringlen + t), - cmd_str_virtaddr + t); - - for (t = 0; t < cmds.prestringlen / 2; t++) - iowrite16(*((u16 *)&cmds.precmd + t), - cmd_str_virtaddr + t + 8); - - for (t = 0; t < cmds.poststringlen / 2; t++) - iowrite16(*((u16 *)&cmds.postcmd + t), - cmd_str_virtaddr + t + 8 + - cmds.prestringlen / 2); - - iounmap(cmd_ptr0_virtaddr); - iounmap(cmd_str_virtaddr); - } - } - - return 0; -} - -static u32 dum_ch_setup(int ch_no, struct dum_ch_setup * ch_setup) -{ - struct cmdstring cmds_c; - struct cmdstring *cmds = &cmds_c; - struct disp_window dw; - int standard; - u32 orientation = 0; - struct dumchannel chan = { 0 }; - int ret; - - if ((ch_setup->xmirror) || (ch_setup->ymirror) || (ch_setup->rotate)) { - standard = 0; - - orientation = BIT(1); /* always set 9-bit-bus */ - if (ch_setup->xmirror) - orientation |= BIT(4); - if (ch_setup->ymirror) - orientation |= BIT(3); - if (ch_setup->rotate) - orientation |= BIT(0); - } else - standard = 1; - - cmds->channelnr = ch_no; - - /* build command string header */ - if (standard) { - cmds->prestringlen = 32; - cmds->poststringlen = 0; - } else { - cmds->prestringlen = 48; - cmds->poststringlen = 16; - } - - cmds->format = - (u16) ((ch_setup->disp_no << 4) | (BIT(3)) | (ch_setup->format)); - cmds->reserved = 0x0; - cmds->startaddr_low = (ch_setup->minadr & 0xFFFF); - cmds->startaddr_high = (ch_setup->minadr >> 16); - - if ((ch_setup->minadr == 0) && (ch_setup->maxadr == 0) - && (ch_setup->xmin == 0) - && (ch_setup->ymin == 0) && (ch_setup->xmax == 0) - && (ch_setup->ymax == 0)) { - cmds->pixdatlen_low = 0; - cmds->pixdatlen_high = 0; - } else { - u32 nbytes = nof_bytes(ch_setup); - cmds->pixdatlen_low = (nbytes & 0xFFFF); - cmds->pixdatlen_high = (nbytes >> 16); - } - - if (ch_setup->slave_trans) - cmds->pixdatlen_high |= BIT(15); - - /* build pre-string */ - build_disp_window(ch_setup, &dw); - - if (standard) { - cmds->precmd[0] = - build_command(ch_setup->disp_no, DISP_XMIN_L_REG, 0x99); - cmds->precmd[1] = - build_command(ch_setup->disp_no, DISP_XMIN_L_REG, - dw.xmin_l); - cmds->precmd[2] = - build_command(ch_setup->disp_no, DISP_XMIN_H_REG, - dw.xmin_h); - cmds->precmd[3] = - build_command(ch_setup->disp_no, DISP_YMIN_REG, dw.ymin); - cmds->precmd[4] = - build_command(ch_setup->disp_no, DISP_XMAX_L_REG, - dw.xmax_l); - cmds->precmd[5] = - build_command(ch_setup->disp_no, DISP_XMAX_H_REG, - dw.xmax_h); - cmds->precmd[6] = - build_command(ch_setup->disp_no, DISP_YMAX_REG, dw.ymax); - cmds->precmd[7] = - build_double_index(ch_setup->disp_no, DISP_PIXEL_REG); - } else { - if (dw.xmin_l == ch_no) - cmds->precmd[0] = - build_command(ch_setup->disp_no, DISP_XMIN_L_REG, - 0x99); - else - cmds->precmd[0] = - build_command(ch_setup->disp_no, DISP_XMIN_L_REG, - ch_no); - - cmds->precmd[1] = - build_command(ch_setup->disp_no, DISP_XMIN_L_REG, - dw.xmin_l); - cmds->precmd[2] = - build_command(ch_setup->disp_no, DISP_XMIN_H_REG, - dw.xmin_h); - cmds->precmd[3] = - build_command(ch_setup->disp_no, DISP_YMIN_REG, dw.ymin); - cmds->precmd[4] = - build_command(ch_setup->disp_no, DISP_XMAX_L_REG, - dw.xmax_l); - cmds->precmd[5] = - build_command(ch_setup->disp_no, DISP_XMAX_H_REG, - dw.xmax_h); - cmds->precmd[6] = - build_command(ch_setup->disp_no, DISP_YMAX_REG, dw.ymax); - cmds->precmd[7] = - build_command(ch_setup->disp_no, DISP_1_REG, orientation); - cmds->precmd[8] = - build_double_index(ch_setup->disp_no, DISP_PIXEL_REG); - cmds->precmd[9] = - build_double_index(ch_setup->disp_no, DISP_PIXEL_REG); - cmds->precmd[0xA] = - build_double_index(ch_setup->disp_no, DISP_PIXEL_REG); - cmds->precmd[0xB] = - build_double_index(ch_setup->disp_no, DISP_PIXEL_REG); - cmds->postcmd[0] = - build_command(ch_setup->disp_no, DISP_1_REG, BIT(1)); - cmds->postcmd[1] = - build_command(ch_setup->disp_no, DISP_DUMMY1_REG, 1); - cmds->postcmd[2] = - build_command(ch_setup->disp_no, DISP_DUMMY1_REG, 2); - cmds->postcmd[3] = - build_command(ch_setup->disp_no, DISP_DUMMY1_REG, 3); - } - - if ((ret = put_cmd_string(cmds_c)) != 0) { - return ret; - } - - chan.channelnr = cmds->channelnr; - chan.dum_ch_min = ch_setup->dirtybuffer + ch_setup->minadr; - chan.dum_ch_max = ch_setup->dirtybuffer + ch_setup->maxadr; - chan.dum_ch_conf = 0x002; - chan.dum_ch_ctrl = 0x04; - - put_channel(chan); - - return 0; -} - -static u32 display_open(int ch_no, int auto_update, u32 * dirty_buffer, - u32 * frame_buffer, u32 xpos, u32 ypos, u32 w, u32 h) -{ - - struct dum_ch_setup k; - int ret; - - /* keep width & height within display area */ - if ((xpos + w) > DISP_MAX_X_SIZE) - w = DISP_MAX_X_SIZE - xpos; - - if ((ypos + h) > DISP_MAX_Y_SIZE) - h = DISP_MAX_Y_SIZE - ypos; - - /* assume 1 display only */ - k.disp_no = 0; - k.xmin = xpos; - k.ymin = ypos; - k.xmax = xpos + (w - 1); - k.ymax = ypos + (h - 1); - - /* adjust min and max values if necessary */ - if (k.xmin > DISP_MAX_X_SIZE - 1) - k.xmin = DISP_MAX_X_SIZE - 1; - if (k.ymin > DISP_MAX_Y_SIZE - 1) - k.ymin = DISP_MAX_Y_SIZE - 1; - - if (k.xmax > DISP_MAX_X_SIZE - 1) - k.xmax = DISP_MAX_X_SIZE - 1; - if (k.ymax > DISP_MAX_Y_SIZE - 1) - k.ymax = DISP_MAX_Y_SIZE - 1; - - k.xmirror = 0; - k.ymirror = 0; - k.rotate = 0; - k.minadr = (u32) frame_buffer; - k.maxadr = (u32) frame_buffer + (((w - 1) << 10) | ((h << 2) - 2)); - k.pad = PAD_1024; - k.dirtybuffer = (u32) dirty_buffer; - k.format = RGB888; - k.hwdirty = 0; - k.slave_trans = 0; - - ret = dum_ch_setup(ch_no, &k); - - return ret; -} - -static void lcd_reset(void) -{ - u32 *dum_pio_base = (u32 *)IO_ADDRESS(PNX4008_PIO_BASE); - - udelay(1); - iowrite32(BIT(19), &dum_pio_base[2]); - udelay(1); - iowrite32(BIT(19), &dum_pio_base[1]); - udelay(1); -} - -static int dum_init(struct platform_device *pdev) -{ - struct clk *clk; - - /* enable DUM clock */ - clk = clk_get(&pdev->dev, "dum_ck"); - if (IS_ERR(clk)) { - printk(KERN_ERR "pnx4008_dum: Unable to access DUM clock\n"); - return PTR_ERR(clk); - } - - clk_set_rate(clk, 1); - clk_put(clk); - - DUM_CTRL = V_DUM_RESET; - - /* set priority to "round-robin". All other params to "false" */ - DUM_CONF = BIT(9); - - /* Display 1 */ - DUM_WTCFG1 = PNX4008_DUM_WT_CFG; - DUM_RTCFG1 = PNX4008_DUM_RT_CFG; - DUM_TCFG = PNX4008_DUM_T_CFG; - - return 0; -} - -static void dum_chan_init(void) -{ - int i = 0, ch = 0; - u32 *cmdptrs; - u32 *cmdstrings; - - DUM_COM_BASE = - CMDSTRING_BASEADDR + BYTES_PER_CMDSTRING * NR_OF_CMDSTRINGS; - - if ((cmdptrs = - (u32 *) ioremap_nocache(DUM_COM_BASE, - sizeof(u32) * NR_OF_CMDSTRINGS)) == NULL) - return; - - for (ch = 0; ch < NR_OF_CMDSTRINGS; ch++) - iowrite32(CMDSTRING_BASEADDR + BYTES_PER_CMDSTRING * ch, - cmdptrs + ch); - - for (ch = 0; ch < MAX_DUM_CHANNELS; ch++) - clear_channel(ch); - - /* Clear the cmdstrings */ - cmdstrings = - (u32 *)ioremap_nocache(*cmdptrs, - BYTES_PER_CMDSTRING * NR_OF_CMDSTRINGS); - - if (!cmdstrings) - goto out; - - for (i = 0; i < NR_OF_CMDSTRINGS * BYTES_PER_CMDSTRING / sizeof(u32); - i++) - iowrite32(0, cmdstrings + i); - - iounmap((u32 *)cmdstrings); - -out: - iounmap((u32 *)cmdptrs); -} - -static void lcd_init(void) -{ - lcd_reset(); - - DUM_OUTP_FORMAT1 = 0; /* RGB666 */ - - udelay(1); - iowrite32(V_LCD_STANDBY_OFF, dum_data.slave_virt_base); - udelay(1); - iowrite32(V_LCD_USE_9BIT_BUS, dum_data.slave_virt_base); - udelay(1); - iowrite32(V_LCD_SYNC_RISE_L, dum_data.slave_virt_base); - udelay(1); - iowrite32(V_LCD_SYNC_RISE_H, dum_data.slave_virt_base); - udelay(1); - iowrite32(V_LCD_SYNC_FALL_L, dum_data.slave_virt_base); - udelay(1); - iowrite32(V_LCD_SYNC_FALL_H, dum_data.slave_virt_base); - udelay(1); - iowrite32(V_LCD_SYNC_ENABLE, dum_data.slave_virt_base); - udelay(1); - iowrite32(V_LCD_DISPLAY_ON, dum_data.slave_virt_base); - udelay(1); -} - -/* Interface exported to framebuffer drivers */ - -int pnx4008_get_fb_addresses(int fb_type, void **virt_addr, - dma_addr_t *phys_addr, int *fb_length) -{ - int i; - int ret = -1; - for (i = 0; i < ARRAY_SIZE(fb_addr); i++) - if (fb_addr[i].fb_type == fb_type) { - *virt_addr = (void *)(dum_data.lcd_virt_start + - fb_addr[i].addr_offset); - *phys_addr = - dum_data.lcd_phys_start + fb_addr[i].addr_offset; - *fb_length = fb_addr[i].fb_length; - ret = 0; - break; - } - - return ret; -} - -EXPORT_SYMBOL(pnx4008_get_fb_addresses); - -int pnx4008_alloc_dum_channel(int dev_id) -{ - int i = 0; - - while ((i < MAX_DUM_CHANNELS) && (dum_data.fb_owning_channel[i] != -1)) - i++; - - if (i == MAX_DUM_CHANNELS) - return -ENORESOURCESLEFT; - else { - dum_data.fb_owning_channel[i] = dev_id; - return i; - } -} - -EXPORT_SYMBOL(pnx4008_alloc_dum_channel); - -int pnx4008_free_dum_channel(int channr, int dev_id) -{ - if (channr < 0 || channr > MAX_DUM_CHANNELS) - return -EINVAL; - else if (dum_data.fb_owning_channel[channr] != dev_id) - return -EFBNOTOWNER; - else { - clear_channel(channr); - dum_data.fb_owning_channel[channr] = -1; - } - - return 0; -} - -EXPORT_SYMBOL(pnx4008_free_dum_channel); - -int pnx4008_put_dum_channel_uf(struct dumchannel_uf chan_uf, int dev_id) -{ - int i = chan_uf.channelnr; - int ret; - - if (i < 0 || i > MAX_DUM_CHANNELS) - return -EINVAL; - else if (dum_data.fb_owning_channel[i] != dev_id) - return -EFBNOTOWNER; - else if ((ret = - display_open(chan_uf.channelnr, 0, chan_uf.dirty, - chan_uf.source, chan_uf.y_offset, - chan_uf.x_offset, chan_uf.height, - chan_uf.width)) != 0) - return ret; - else { - dum_data.chan_uf_store[i].dirty = chan_uf.dirty; - dum_data.chan_uf_store[i].source = chan_uf.source; - dum_data.chan_uf_store[i].x_offset = chan_uf.x_offset; - dum_data.chan_uf_store[i].y_offset = chan_uf.y_offset; - dum_data.chan_uf_store[i].width = chan_uf.width; - dum_data.chan_uf_store[i].height = chan_uf.height; - } - - return 0; -} - -EXPORT_SYMBOL(pnx4008_put_dum_channel_uf); - -int pnx4008_set_dum_channel_sync(int channr, int val, int dev_id) -{ - if (channr < 0 || channr > MAX_DUM_CHANNELS) - return -EINVAL; - else if (dum_data.fb_owning_channel[channr] != dev_id) - return -EFBNOTOWNER; - else { - if (val == CONF_SYNC_ON) { - DUM_CH_CONF(channr) |= CONF_SYNCENABLE; - DUM_CH_CONF(channr) |= DUM_CHANNEL_CFG_SYNC_MASK | - DUM_CHANNEL_CFG_SYNC_MASK_SET; - } else if (val == CONF_SYNC_OFF) - DUM_CH_CONF(channr) &= ~CONF_SYNCENABLE; - else - return -EINVAL; - } - - return 0; -} - -EXPORT_SYMBOL(pnx4008_set_dum_channel_sync); - -int pnx4008_set_dum_channel_dirty_detect(int channr, int val, int dev_id) -{ - if (channr < 0 || channr > MAX_DUM_CHANNELS) - return -EINVAL; - else if (dum_data.fb_owning_channel[channr] != dev_id) - return -EFBNOTOWNER; - else { - if (val == CONF_DIRTYDETECTION_ON) - DUM_CH_CONF(channr) |= CONF_DIRTYENABLE; - else if (val == CONF_DIRTYDETECTION_OFF) - DUM_CH_CONF(channr) &= ~CONF_DIRTYENABLE; - else - return -EINVAL; - } - - return 0; -} - -EXPORT_SYMBOL(pnx4008_set_dum_channel_dirty_detect); - -#if 0 /* Functions not used currently, but likely to be used in future */ - -static int get_channel(struct dumchannel *p_chan) -{ - int i = p_chan->channelnr; - - if (i < 0 || i > MAX_DUM_CHANNELS) - return -EINVAL; - else { - p_chan->dum_ch_min = DUM_CH_MIN(i); - p_chan->dum_ch_max = DUM_CH_MAX(i); - p_chan->dum_ch_conf = DUM_CH_CONF(i); - p_chan->dum_ch_stat = DUM_CH_STAT(i); - p_chan->dum_ch_ctrl = 0; /* WriteOnly control register */ - } - - return 0; -} - -int pnx4008_get_dum_channel_uf(struct dumchannel_uf *p_chan_uf, int dev_id) -{ - int i = p_chan_uf->channelnr; - - if (i < 0 || i > MAX_DUM_CHANNELS) - return -EINVAL; - else if (dum_data.fb_owning_channel[i] != dev_id) - return -EFBNOTOWNER; - else { - p_chan_uf->dirty = dum_data.chan_uf_store[i].dirty; - p_chan_uf->source = dum_data.chan_uf_store[i].source; - p_chan_uf->x_offset = dum_data.chan_uf_store[i].x_offset; - p_chan_uf->y_offset = dum_data.chan_uf_store[i].y_offset; - p_chan_uf->width = dum_data.chan_uf_store[i].width; - p_chan_uf->height = dum_data.chan_uf_store[i].height; - } - - return 0; -} - -EXPORT_SYMBOL(pnx4008_get_dum_channel_uf); - -int pnx4008_get_dum_channel_config(int channr, int dev_id) -{ - int ret; - struct dumchannel chan; - - if (channr < 0 || channr > MAX_DUM_CHANNELS) - return -EINVAL; - else if (dum_data.fb_owning_channel[channr] != dev_id) - return -EFBNOTOWNER; - else { - chan.channelnr = channr; - if ((ret = get_channel(&chan)) != 0) - return ret; - } - - return (chan.dum_ch_conf & DUM_CHANNEL_CFG_MASK); -} - -EXPORT_SYMBOL(pnx4008_get_dum_channel_config); - -int pnx4008_force_update_dum_channel(int channr, int dev_id) -{ - if (channr < 0 || channr > MAX_DUM_CHANNELS) - return -EINVAL; - - else if (dum_data.fb_owning_channel[channr] != dev_id) - return -EFBNOTOWNER; - else - DUM_CH_CTRL(channr) = CTRL_SETDIRTY; - - return 0; -} - -EXPORT_SYMBOL(pnx4008_force_update_dum_channel); - -#endif - -int pnx4008_sdum_mmap(struct fb_info *info, struct vm_area_struct *vma, - struct device *dev) -{ - unsigned long off = vma->vm_pgoff << PAGE_SHIFT; - - if (off < info->fix.smem_len) { - vma->vm_pgoff += 1; - return dma_mmap_writecombine(dev, vma, - (void *)dum_data.lcd_virt_start, - dum_data.lcd_phys_start, - FB_DMA_SIZE); - } - return -EINVAL; -} - -EXPORT_SYMBOL(pnx4008_sdum_mmap); - -int pnx4008_set_dum_exit_notification(int dev_id) -{ - int i; - - for (i = 0; i < MAX_DUM_CHANNELS; i++) - if (dum_data.fb_owning_channel[i] == dev_id) - return -ERESOURCESNOTFREED; - - return 0; -} - -EXPORT_SYMBOL(pnx4008_set_dum_exit_notification); - -/* Platform device driver for DUM */ - -static int sdum_suspend(struct platform_device *pdev, pm_message_t state) -{ - int retval = 0; - struct clk *clk; - - clk = clk_get(0, "dum_ck"); - if (!IS_ERR(clk)) { - clk_set_rate(clk, 0); - clk_put(clk); - } else - retval = PTR_ERR(clk); - - /* disable BAC */ - DUM_CTRL = V_BAC_DISABLE_IDLE; - - /* LCD standby & turn off display */ - lcd_reset(); - - return retval; -} - -static int sdum_resume(struct platform_device *pdev) -{ - int retval = 0; - struct clk *clk; - - clk = clk_get(0, "dum_ck"); - if (!IS_ERR(clk)) { - clk_set_rate(clk, 1); - clk_put(clk); - } else - retval = PTR_ERR(clk); - - /* wait for BAC disable */ - DUM_CTRL = V_BAC_DISABLE_TRIG; - - while (DUM_CTRL & BAC_ENABLED) - udelay(10); - - /* re-init LCD */ - lcd_init(); - - /* enable BAC and reset MUX */ - DUM_CTRL = V_BAC_ENABLE; - udelay(1); - DUM_CTRL = V_MUX_RESET; - return 0; -} - -static int __devinit sdum_probe(struct platform_device *pdev) -{ - int ret = 0, i = 0; - - /* map frame buffer */ - dum_data.lcd_virt_start = (u32) dma_alloc_writecombine(&pdev->dev, - FB_DMA_SIZE, - &dum_data.lcd_phys_start, - GFP_KERNEL); - - if (!dum_data.lcd_virt_start) { - ret = -ENOMEM; - goto out_3; - } - - /* map slave registers */ - dum_data.slave_phys_base = PNX4008_DUM_SLAVE_BASE; - dum_data.slave_virt_base = - (u32 *) ioremap_nocache(dum_data.slave_phys_base, sizeof(u32)); - - if (dum_data.slave_virt_base == NULL) { - ret = -ENOMEM; - goto out_2; - } - - /* initialize DUM and LCD display */ - ret = dum_init(pdev); - if (ret) - goto out_1; - - dum_chan_init(); - lcd_init(); - - DUM_CTRL = V_BAC_ENABLE; - udelay(1); - DUM_CTRL = V_MUX_RESET; - - /* set decode address and sync clock divider */ - DUM_DECODE = dum_data.lcd_phys_start & DUM_DECODE_MASK; - DUM_CLK_DIV = PNX4008_DUM_CLK_DIV; - - for (i = 0; i < MAX_DUM_CHANNELS; i++) - dum_data.fb_owning_channel[i] = -1; - - /*setup wakeup interrupt */ - start_int_set_rising_edge(SE_DISP_SYNC_INT); - start_int_ack(SE_DISP_SYNC_INT); - start_int_umask(SE_DISP_SYNC_INT); - - return 0; - -out_1: - iounmap((void *)dum_data.slave_virt_base); -out_2: - dma_free_writecombine(&pdev->dev, FB_DMA_SIZE, - (void *)dum_data.lcd_virt_start, - dum_data.lcd_phys_start); -out_3: - return ret; -} - -static int sdum_remove(struct platform_device *pdev) -{ - struct clk *clk; - - start_int_mask(SE_DISP_SYNC_INT); - - clk = clk_get(0, "dum_ck"); - if (!IS_ERR(clk)) { - clk_set_rate(clk, 0); - clk_put(clk); - } - - iounmap((void *)dum_data.slave_virt_base); - - dma_free_writecombine(&pdev->dev, FB_DMA_SIZE, - (void *)dum_data.lcd_virt_start, - dum_data.lcd_phys_start); - - return 0; -} - -static struct platform_driver sdum_driver = { - .driver = { - .name = "sdum", - }, - .probe = sdum_probe, - .remove = sdum_remove, - .suspend = sdum_suspend, - .resume = sdum_resume, -}; - -int __init sdum_init(void) -{ - return platform_driver_register(&sdum_driver); -} - -static void __exit sdum_exit(void) -{ - platform_driver_unregister(&sdum_driver); -}; - -module_init(sdum_init); -module_exit(sdum_exit); - -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/video/pnx4008/sdum.h b/trunk/drivers/video/pnx4008/sdum.h deleted file mode 100644 index e8c5dcdd8813..000000000000 --- a/trunk/drivers/video/pnx4008/sdum.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2005 Philips Semiconductors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA, or http://www.gnu.org/licenses/gpl.html -*/ - -#define MAX_DUM_CHANNELS 64 - -#define RGB_MEM_WINDOW(x) (0x10000000 + (x)*0x00100000) - -#define QCIF_OFFSET(x) (((x) == 0) ? 0x00000: ((x) == 1) ? 0x30000: -1) -#define CIF_OFFSET(x) (((x) == 0) ? 0x00000: ((x) == 1) ? 0x60000: -1) - -#define CTRL_SETDIRTY (0x00000001) -#define CONF_DIRTYENABLE (0x00000020) -#define CONF_SYNCENABLE (0x00000004) - -#define DIRTY_ENABLED(conf) ((conf) & 0x0020) -#define SYNC_ENABLED(conf) ((conf) & 0x0004) - -/* Display 1 & 2 Write Timing Configuration */ -#define PNX4008_DUM_WT_CFG 0x00372000 - -/* Display 1 & 2 Read Timing Configuration */ -#define PNX4008_DUM_RT_CFG 0x00003A47 - -/* DUM Transit State Timing Configuration */ -#define PNX4008_DUM_T_CFG 0x1D /* 29 HCLK cycles */ - -/* DUM Sync count clock divider */ -#define PNX4008_DUM_CLK_DIV 0x02DD - -/* Memory size for framebuffer, allocated through dma_alloc_writecombine(). - * Must be PAGE aligned - */ -#define FB_DMA_SIZE (PAGE_ALIGN(SZ_1M + PAGE_SIZE)) - -#define OFFSET_RGBBUFFER (0xB0000) -#define OFFSET_YUVBUFFER (0x00000) - -#define YUVBUFFER (lcd_video_start + OFFSET_YUVBUFFER) -#define RGBBUFFER (lcd_video_start + OFFSET_RGBBUFFER) - -#define CMDSTRING_BASEADDR (0x00C000) /* iram */ -#define BYTES_PER_CMDSTRING (0x80) -#define NR_OF_CMDSTRINGS (64) - -#define MAX_NR_PRESTRINGS (0x40) -#define MAX_NR_POSTSTRINGS (0x40) - -/* various mask definitions */ -#define DUM_CLK_ENABLE 0x01 -#define DUM_CLK_DISABLE 0 -#define DUM_DECODE_MASK 0x1FFFFFFF -#define DUM_CHANNEL_CFG_MASK 0x01FF -#define DUM_CHANNEL_CFG_SYNC_MASK 0xFFFE00FF -#define DUM_CHANNEL_CFG_SYNC_MASK_SET 0x0CA00 - -#define SDUM_RETURNVAL_BASE (0x500) - -#define CONF_SYNC_OFF (0x602) -#define CONF_SYNC_ON (0x603) - -#define CONF_DIRTYDETECTION_OFF (0x600) -#define CONF_DIRTYDETECTION_ON (0x601) - -/* Set the corresponding bit. */ -#define BIT(n) (0x1U << (n)) - -struct dumchannel_uf { - int channelnr; - u32 *dirty; - u32 *source; - u32 x_offset; - u32 y_offset; - u32 width; - u32 height; -}; - -enum { - FB_TYPE_YUV, - FB_TYPE_RGB -}; - -struct cmdstring { - int channelnr; - uint16_t prestringlen; - uint16_t poststringlen; - uint16_t format; - uint16_t reserved; - uint16_t startaddr_low; - uint16_t startaddr_high; - uint16_t pixdatlen_low; - uint16_t pixdatlen_high; - u32 precmd[MAX_NR_PRESTRINGS]; - u32 postcmd[MAX_NR_POSTSTRINGS]; - -}; - -struct dumchannel { - int channelnr; - int dum_ch_min; - int dum_ch_max; - int dum_ch_conf; - int dum_ch_stat; - int dum_ch_ctrl; -}; - -int pnx4008_alloc_dum_channel(int dev_id); -int pnx4008_free_dum_channel(int channr, int dev_id); - -int pnx4008_get_dum_channel_uf(struct dumchannel_uf *pChan_uf, int dev_id); -int pnx4008_put_dum_channel_uf(struct dumchannel_uf chan_uf, int dev_id); - -int pnx4008_set_dum_channel_sync(int channr, int val, int dev_id); -int pnx4008_set_dum_channel_dirty_detect(int channr, int val, int dev_id); - -int pnx4008_force_dum_update_channel(int channr, int dev_id); - -int pnx4008_get_dum_channel_config(int channr, int dev_id); - -int pnx4008_sdum_mmap(struct fb_info *info, struct vm_area_struct *vma, struct device *dev); -int pnx4008_set_dum_exit_notification(int dev_id); - -int pnx4008_get_fb_addresses(int fb_type, void **virt_addr, - dma_addr_t * phys_addr, int *fb_length); diff --git a/trunk/drivers/video/pvr2fb.c b/trunk/drivers/video/pvr2fb.c index 4a1e0e856920..ec4bacf9dd2e 100644 --- a/trunk/drivers/video/pvr2fb.c +++ b/trunk/drivers/video/pvr2fb.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/video/pxafb.c b/trunk/drivers/video/pxafb.c index bbb07106cd54..809fc5eefc15 100644 --- a/trunk/drivers/video/pxafb.c +++ b/trunk/drivers/video/pxafb.c @@ -22,6 +22,7 @@ * */ +#include #include #include #include @@ -1334,7 +1335,7 @@ int __init pxafb_probe(struct platform_device *dev) goto failed; } - ret = request_irq(IRQ_LCD, pxafb_handle_irq, IRQF_DISABLED, "LCD", fbi); + ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); if (ret) { dev_err(&dev->dev, "request_irq failed: %d\n", ret); ret = -EBUSY; diff --git a/trunk/drivers/video/riva/fbdev.c b/trunk/drivers/video/riva/fbdev.c index 2788655e6e7d..12af58c5cf1f 100644 --- a/trunk/drivers/video/riva/fbdev.c +++ b/trunk/drivers/video/riva/fbdev.c @@ -29,6 +29,7 @@ * doublescan modes are broken */ +#include #include #include #include diff --git a/trunk/drivers/video/riva/rivafb-i2c.c b/trunk/drivers/video/riva/rivafb-i2c.c index 9751c37c0bfd..8b1967fc116a 100644 --- a/trunk/drivers/video/riva/rivafb-i2c.c +++ b/trunk/drivers/video/riva/rivafb-i2c.c @@ -12,6 +12,7 @@ * for more details. */ +#include #include #include #include diff --git a/trunk/drivers/video/riva/rivafb.h b/trunk/drivers/video/riva/rivafb.h index 7fa13fc9c413..440ff445689b 100644 --- a/trunk/drivers/video/riva/rivafb.h +++ b/trunk/drivers/video/riva/rivafb.h @@ -1,6 +1,7 @@ #ifndef __RIVAFB_H #define __RIVAFB_H +#include #include #include