## Automatically generated incremental diff ## From: linux-2.5.69-bk10 ## To: linux-2.5.69-bk11 ## Robot: $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $ diff -urN linux-2.5.69-bk10/Documentation/driver-model/binding.txt linux-2.5.69-bk11/Documentation/driver-model/binding.txt --- linux-2.5.69-bk10/Documentation/driver-model/binding.txt 2003-05-04 16:53:13.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/driver-model/binding.txt 2003-05-16 04:44:34.000000000 -0700 @@ -11,11 +11,11 @@ Bus ~~~ -The bus type structure contains a list of all devices that on that bus +The bus type structure contains a list of all devices that are on that bus type in the system. When device_register is called for a device, it is inserted into the end of this list. The bus object also contains a list of all drivers of that bus type. When driver_register is called -for a driver, it is inserted into the end of this list. These are the +for a driver, it is inserted at the end of this list. These are the two events which trigger driver binding. @@ -42,7 +42,7 @@ ~~~~~~~~~~~~ Upon the successful completion of probe, the device is registered with -the class to which it belongs. Device drivers belong to one and only +the class to which it belongs. Device drivers belong to one and only one class, and that is set in the driver's devclass field. devclass_add_device is called to enumerate the device within the class and actually register it with the class, which happens with the @@ -61,7 +61,7 @@ sysfs -~~~~~~~~ +~~~~~ A symlink is created in the bus's 'devices' directory that points to the device's directory in the physical hierarchy. diff -urN linux-2.5.69-bk10/Documentation/driver-model/bus.txt linux-2.5.69-bk11/Documentation/driver-model/bus.txt --- linux-2.5.69-bk10/Documentation/driver-model/bus.txt 2003-05-04 16:53:32.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/driver-model/bus.txt 2003-05-16 04:44:34.000000000 -0700 @@ -58,7 +58,7 @@ The format of device ID structures and the semantics for comparing them are inherently bus-specific. Drivers typically declare an array -of device IDs of device they support that reside in a bus-specific +of device IDs of devices they support that reside in a bus-specific driver structure. The purpose of the match callback is provide the bus an opportunity to @@ -153,7 +153,7 @@ |-- agpgart `-- e100 -Each device that is discovered a bus of that type gets a symlink in +Each device that is discovered on a bus of that type gets a symlink in the bus's devices directory to the device's directory in the physical hierarchy: diff -urN linux-2.5.69-bk10/Documentation/driver-model/class.txt linux-2.5.69-bk11/Documentation/driver-model/class.txt --- linux-2.5.69-bk10/Documentation/driver-model/class.txt 2003-05-04 16:53:01.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/driver-model/class.txt 2003-05-16 04:44:34.000000000 -0700 @@ -105,7 +105,7 @@ Drivers registered with the class get a symlink in the drivers/ directory -that points the driver's directory (under its bus directory): +that points to the driver's directory (under its bus directory): class/ `-- input diff -urN linux-2.5.69-bk10/Documentation/driver-model/device.txt linux-2.5.69-bk11/Documentation/driver-model/device.txt --- linux-2.5.69-bk10/Documentation/driver-model/device.txt 2003-05-04 16:53:31.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/driver-model/device.txt 2003-05-16 04:44:34.000000000 -0700 @@ -47,11 +47,13 @@ children: List of child devices. +parent: *** FIXME *** + name: ASCII description of device. Example: " 3Com Corporation 3c905 100BaseTX [Boomerang]" bus_id: ASCII representation of device's bus position. This - field should a name unique across all devices on the + field should be a name unique across all devices on the bus type the device belongs to. Example: PCI bus_ids are in the form of @@ -66,12 +68,12 @@ dir: Device's sysfs directory. +class_num: Class-enumerated value of the device. + driver: Pointer to struct device_driver that controls the device. driver_data: Driver-specific data. -class_num: Class-enumerated value of the device. - platform_data: Platform data specific to the device. current_state: Current power state of the device. @@ -108,7 +110,7 @@ if the reference is not already 0 (if it's in the process of being removed already). -A driver can take use the lock in the device structure using: +A driver can access the lock in the device structure using: void lock_device(struct device * dev); void unlock_device(struct device * dev); diff -urN linux-2.5.69-bk10/Documentation/driver-model/driver.txt linux-2.5.69-bk11/Documentation/driver-model/driver.txt --- linux-2.5.69-bk10/Documentation/driver-model/driver.txt 2003-05-04 16:53:31.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/driver-model/driver.txt 2003-05-16 04:44:34.000000000 -0700 @@ -63,9 +63,9 @@ model because the bus they belong to has a bus-specific structure with bus-specific fields that cannot be generalized. -The most common example this are device ID structures. A driver +The most common example of this are device ID structures. A driver typically defines an array of device IDs that it supports. The format -of this structure and the semantics for comparing device IDs is +of these structures and the semantics for comparing device IDs are completely bus-specific. Defining them as bus-specific entities would sacrifice type-safety, so we keep bus-specific structures around. @@ -77,8 +77,8 @@ struct device_driver driver; }; -A definition that included bus-specific fields would look something -like (using the eepro100 driver again): +A definition that included bus-specific fields would look like +(using the eepro100 driver again): static struct pci_driver eepro100_driver = { .id_table = eepro100_pci_tbl, @@ -109,7 +109,7 @@ Most drivers, however, will have a bus-specific structure and will need to register with the bus using something like pci_driver_register. -It is important that drivers register their drivers as early as +It is important that drivers register their driver structure as early as possible. Registration with the core initializes several fields in the struct device_driver object, including the reference count and the lock. These fields are assumed to be valid at all times and may be @@ -148,7 +148,7 @@ sysfs -~~~~~~~~ +~~~~~ When a driver is registered, a sysfs directory is created in its bus's directory. In this directory, the driver can export an interface @@ -205,7 +205,7 @@ user-defined policy. SUSPEND_NOTIFY notifies the device that a suspend transition is about -to happen. This happens on system power state transition to verify +to happen. This happens on system power state transitions to verify that all devices can successfully suspend. A driver may choose to fail on this call, which should cause the diff -urN linux-2.5.69-bk10/Documentation/driver-model/interface.txt linux-2.5.69-bk11/Documentation/driver-model/interface.txt --- linux-2.5.69-bk10/Documentation/driver-model/interface.txt 2003-05-04 16:53:31.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/driver-model/interface.txt 2003-05-16 04:44:34.000000000 -0700 @@ -82,7 +82,7 @@ and the enumerated value is stored in the struct intf_data for that device. sysfs -~~~~~~~~ +~~~~~ Each interface is given a directory in the directory of the device class it belongs to: @@ -120,10 +120,10 @@ Many interfaces have a major number associated with them and each device gets a minor number. Or, multiple interfaces might share one -major number, and each get receive a range of minor numbers (like in +major number, and each will receive a range of minor numbers (like in the case of input devices). These major and minor numbers could be stored in the interface -structure. Major and minor allocation could happen when the interface +structure. Major and minor allocations could happen when the interface is registered with the class, or via a helper function. diff -urN linux-2.5.69-bk10/Documentation/driver-model/overview.txt linux-2.5.69-bk11/Documentation/driver-model/overview.txt --- linux-2.5.69-bk10/Documentation/driver-model/overview.txt 2003-05-04 16:53:08.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/driver-model/overview.txt 2003-05-16 04:44:34.000000000 -0700 @@ -9,7 +9,7 @@ ~~~~~~~~ This driver model is a unification of all the current, disparate driver models -that are currently in the kernel. It is intended is to augment the +that are currently in the kernel. It is intended to augment the bus-specific drivers for bridges and devices by consolidating a set of data and operations into globally accessible data structures. @@ -23,7 +23,7 @@ of the global tree. Common data fields can also be moved out of the local bus models into the -global model. Some of the manipulation of these fields can also be +global model. Some of the manipulations of these fields can also be consolidated. Most likely, manipulation functions will become a set of helper functions, which the bus drivers wrap around to include any bus-specific items. @@ -71,7 +71,7 @@ This abstraction is prevention of unnecessary pain during transitional phases. If the name of the field changes or is removed, then every downstream driver will break. On the other hand, if only the bus layer (and not the device -layer) accesses struct device, it is only those that need to change. +layer) accesses struct device, it is only that layer that needs to change. User Interface @@ -96,9 +96,9 @@ This directory may be populated at each layer of discovery - the global layer, the bus layer, or the device layer. -The global layer currently creates two files - name and 'power'. The +The global layer currently creates two files - 'name' and 'power'. The former only reports the name of the device. The latter reports the -current power state of the device. It also be used to set the current +current power state of the device. It will also be used to set the current power state. The bus layer may also create files for the devices it finds while probing the diff -urN linux-2.5.69-bk10/Documentation/driver-model/platform.txt linux-2.5.69-bk11/Documentation/driver-model/platform.txt --- linux-2.5.69-bk10/Documentation/driver-model/platform.txt 2003-05-04 16:53:40.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/driver-model/platform.txt 2003-05-16 04:44:34.000000000 -0700 @@ -10,9 +10,9 @@ Platform drivers ~~~~~~~~~~~~~~~~ -Drivers for platform devices have typically very simple and +Drivers for platform devices are typically very simple and unstructured. Either the device was present at a particular I/O port -and the driver was loaded, or there was not. There was no possibility +and the driver was loaded, or it was not. There was no possibility of hotplugging or alternative discovery besides probing at a specific I/O address and expecting a specific response. @@ -49,7 +49,7 @@ Bus IDs ~~~~~~~ -Bus IDs are the canonical name for the device. There is no globally +Bus IDs are the canonical names for the devices. There is no globally standard addressing mechanism for legacy devices. In the IA-32 world, we have Pnp IDs to use, as well as the legacy I/O ports. However, neither tell what the device really is or have any meaning on other @@ -62,7 +62,7 @@ For example, a serial driver might find a device at I/O 0x3f8. The ACPI firmware might also discover a device with PnP ID (_HID) -PNP0501. Both correspond to the same device should be mapped to the +PNP0501. Both correspond to the same device and should be mapped to the canonical name 'serial'. The bus_id field should be a concatenation of the canonical name and @@ -88,7 +88,7 @@ ~~~~~~~~~~~~~~ Legacy drivers assume they are bound to the device once they start up and probe an I/O port. Divorcing them from this will be a difficult -process. However, that shouldn't prevent us from impelementing +process. However, that shouldn't prevent us from implementing firmware-based enumeration. The firmware should notify the platform bus about devices before the diff -urN linux-2.5.69-bk10/Documentation/driver-model/porting.txt linux-2.5.69-bk11/Documentation/driver-model/porting.txt --- linux-2.5.69-bk10/Documentation/driver-model/porting.txt 2003-05-04 16:53:35.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/driver-model/porting.txt 2003-05-16 04:44:34.000000000 -0700 @@ -128,7 +128,7 @@ The bus_id is an ASCII string that contains the device's address on the bus. The format of this string is bus-specific. This is - necessary for representing device in sysfs. + necessary for representing devices in sysfs. parent is the physical parent of the device. It is important that the bus driver sets this field correctly. @@ -286,7 +286,7 @@ It would be difficult and tedious to force every driver on a bus to simultaneously convert their drivers to generic format. Instead, the bus driver should define single instances of the generic methods that -forward calls to the bus-specific drivers. For instance: +forward call to the bus-specific drivers. For instance: static int pci_device_remove(struct device * dev) @@ -330,8 +330,8 @@ devices must be bound to a driver, or drivers must be bound to all devices that it supports. -Drivers typically contain a list of device IDs that it supports. The -bus driver compares this ID to the ID of devices registered with it. +A driver typically contains a list of device IDs that it supports. The +bus driver compares these IDs to the IDs of devices registered with it. The format of the device IDs, and the semantics for comparing them are bus-specific, so the generic model does attempt to generalize them. @@ -396,7 +396,7 @@ Step 7: Cleaning up the bus driver. The generic bus, device, and driver structures provide several fields -that can replace those define privately to the bus driver. +that can replace those defined privately to the bus driver. - Device list. diff -urN linux-2.5.69-bk10/Documentation/kobject.txt linux-2.5.69-bk11/Documentation/kobject.txt --- linux-2.5.69-bk10/Documentation/kobject.txt 2003-05-04 16:53:08.000000000 -0700 +++ linux-2.5.69-bk11/Documentation/kobject.txt 2003-05-16 04:44:34.000000000 -0700 @@ -9,7 +9,7 @@ The kobject infrastructure performs basic object management that larger data structures and subsystems can leverage, rather than reimplement -similar functionality. This functionality consists primarily concerns: +similar functionality. This functionality primarily concerns: - Object reference counting. - Maintaining lists (sets) of objects. @@ -45,7 +45,7 @@ struct kobject is a simple data type that provides a foundation for more complex object types. It provides a set of basic fields that almost all complex data types share. kobjects are intended to be -embedded in larger data structures and replace fields it duplicates. +embedded in larger data structures and replace fields they duplicate. 1.2 Defintion @@ -77,7 +77,7 @@ includes inserting the kobject in the list of its dominant kset and creating a directory for it in sysfs. -Alternatively, one may use a kobject without adding to its kset's list +Alternatively, one may use a kobject without adding it to its kset's list or exporting it via sysfs, by simply calling kobject_init(). An initialized kobject may later be added to the object hierarchy by calling kobject_add(). An initialized kobject may be used for @@ -87,8 +87,8 @@ equivalent to calling kobject_register(). When a kobject is unregistered, it is removed from its kset's list, -removed from the sysfs filesystem, and its reference decremented. List -and sysfs removal happen in kobject_del(), and may be called +removed from the sysfs filesystem, and its reference count is decremented. +List and sysfs removal happen in kobject_del(), and may be called manually. kobject_put() decrements the reference count, and may also be called manually. @@ -98,8 +98,8 @@ it is already positive. When a kobject's reference count reaches 0, the method struct -ktype::release() (which the kobject's kset points to) is called. This -allows any memory allocated for the object to be freed. +kobj_type::release() (which the kobject's kset points to) is called. +This allows any memory allocated for the object to be freed. 1.4 sysfs @@ -118,7 +118,7 @@ 2. ksets -2.1 Desecription +2.1 Description A kset is a set of kobjects that are embedded in the same type. @@ -163,9 +163,9 @@ kset_register(&disk->kset); - The kset that the disk's embedded object belongs to is the - block_kset, and is pointed to disk->kset.kobj.kset. + block_kset, and is pointed to by disk->kset.kobj.kset. -- The type of object of the disk's _subordinate_ list are partitions, +- The type of objects on the disk's _subordinate_ list are partitions, and is set in disk->kset.ktype. - The kset is then registered, which handles initializing and adding @@ -218,13 +218,13 @@ - sysfs_ops: Provides conversion functions for sysfs access. Please see the sysfs documentation for more information. -- default_attrs: Default attributes to exported via sysfs when the +- default_attrs: Default attributes to be exported via sysfs when the object is registered. Instances of struct kobj_type are not registered; only referenced by the kset. A kobj_type may be referenced by an arbitrary number of -ksets, as their may be disparate sets of identical objects. +ksets, as there may be disparate sets of identical objects. diff -urN linux-2.5.69-bk10/Makefile linux-2.5.69-bk11/Makefile --- linux-2.5.69-bk10/Makefile 2003-05-16 04:44:29.000000000 -0700 +++ linux-2.5.69-bk11/Makefile 2003-05-16 04:44:34.000000000 -0700 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 SUBLEVEL = 69 -EXTRAVERSION = -bk10 +EXTRAVERSION = -bk11 # *DOCUMENTATION* # To see a list of typical targets execute "make help" diff -urN linux-2.5.69-bk10/arch/i386/kernel/cpu/mtrr/if.c linux-2.5.69-bk11/arch/i386/kernel/cpu/mtrr/if.c --- linux-2.5.69-bk10/arch/i386/kernel/cpu/mtrr/if.c 2003-05-16 04:44:29.000000000 -0700 +++ linux-2.5.69-bk11/arch/i386/kernel/cpu/mtrr/if.c 2003-05-16 04:44:34.000000000 -0700 @@ -49,7 +49,7 @@ struct file *file, int page) { int reg; - unsigned int *fcount = file->private_data; + unsigned int *fcount = FILE_FCOUNT(file); if (!page) { if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) diff -urN linux-2.5.69-bk10/arch/i386/kernel/io_apic.c linux-2.5.69-bk11/arch/i386/kernel/io_apic.c --- linux-2.5.69-bk10/arch/i386/kernel/io_apic.c 2003-05-16 04:44:29.000000000 -0700 +++ linux-2.5.69-bk11/arch/i386/kernel/io_apic.c 2003-05-16 04:44:34.000000000 -0700 @@ -219,6 +219,14 @@ { struct IO_APIC_route_entry entry; unsigned long flags; + + /* Check delivery_mode to be sure we're not clearing an SMI pin */ + spin_lock_irqsave(&ioapic_lock, flags); + *(((int*)&entry) + 0) = io_apic_read(apic, 0x10 + 2 * pin); + *(((int*)&entry) + 1) = io_apic_read(apic, 0x11 + 2 * pin); + spin_unlock_irqrestore(&ioapic_lock, flags); + if (entry.delivery_mode == dest_SMI) + return; /* * Disable it in the IO-APIC irq-routing table: diff -urN linux-2.5.69-bk10/arch/i386/kernel/smpboot.c linux-2.5.69-bk11/arch/i386/kernel/smpboot.c --- linux-2.5.69-bk10/arch/i386/kernel/smpboot.c 2003-05-16 04:44:29.000000000 -0700 +++ linux-2.5.69-bk11/arch/i386/kernel/smpboot.c 2003-05-16 04:44:34.000000000 -0700 @@ -1149,7 +1149,9 @@ void __init smp_cpus_done(unsigned int max_cpus) { +#ifdef CONFIG_X86_IO_APIC setup_ioapic_dest(TARGET_CPUS); +#endif zap_low_mappings(); } diff -urN linux-2.5.69-bk10/arch/i386/kernel/sysenter.c linux-2.5.69-bk11/arch/i386/kernel/sysenter.c --- linux-2.5.69-bk10/arch/i386/kernel/sysenter.c 2003-05-04 16:53:57.000000000 -0700 +++ linux-2.5.69-bk11/arch/i386/kernel/sysenter.c 2003-05-16 04:44:34.000000000 -0700 @@ -21,21 +21,6 @@ extern asmlinkage void sysenter_entry(void); -/* - * Create a per-cpu fake "SEP thread" stack, so that we can - * enter the kernel without having to worry about things like - * "current" etc not working (debug traps and NMI's can happen - * before we can switch over to the "real" thread). - * - * Return the resulting fake stack pointer. - */ -struct fake_sep_struct { - struct thread_info thread; - struct task_struct task; - unsigned char trampoline[32] __attribute__((aligned(1024))); - unsigned char stack[0]; -} __attribute__((aligned(8192))); - void enable_sep_cpu(void *info) { int cpu = get_cpu(); diff -urN linux-2.5.69-bk10/arch/i386/mm/hugetlbpage.c linux-2.5.69-bk11/arch/i386/mm/hugetlbpage.c --- linux-2.5.69-bk10/arch/i386/mm/hugetlbpage.c 2003-05-04 16:53:41.000000000 -0700 +++ linux-2.5.69-bk11/arch/i386/mm/hugetlbpage.c 2003-05-16 04:44:34.000000000 -0700 @@ -20,8 +20,6 @@ #include #include -#include - static long htlbpagemem; int htlbpage_max; static long htlbzone_pages; @@ -398,8 +396,6 @@ { int lcount; struct page *page; - extern long htlbzone_pages; - extern struct list_head htlbpage_freelist; if (count < 0) lcount = count; diff -urN linux-2.5.69-bk10/arch/ia64/ia32/binfmt_elf32.c linux-2.5.69-bk11/arch/ia64/ia32/binfmt_elf32.c --- linux-2.5.69-bk10/arch/ia64/ia32/binfmt_elf32.c 2003-05-04 16:53:41.000000000 -0700 +++ linux-2.5.69-bk11/arch/ia64/ia32/binfmt_elf32.c 2003-05-16 04:44:34.000000000 -0700 @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -40,7 +41,6 @@ #define CLOCKS_PER_SEC IA32_CLOCKS_PER_SEC extern void ia64_elf32_init (struct pt_regs *regs); -extern void put_dirty_page (struct task_struct * tsk, struct page *page, unsigned long address); static void elf32_set_personality (void); @@ -200,7 +200,7 @@ struct page *page = bprm->page[i]; if (page) { bprm->page[i] = NULL; - put_dirty_page(current, page, stack_base); + put_dirty_page(current, page, stack_base, PAGE_COPY); } stack_base += PAGE_SIZE; } diff -urN linux-2.5.69-bk10/arch/ia64/mm/hugetlbpage.c linux-2.5.69-bk11/arch/ia64/mm/hugetlbpage.c --- linux-2.5.69-bk10/arch/ia64/mm/hugetlbpage.c 2003-05-04 16:53:31.000000000 -0700 +++ linux-2.5.69-bk11/arch/ia64/mm/hugetlbpage.c 2003-05-16 04:44:34.000000000 -0700 @@ -12,13 +12,12 @@ #include #include #include +#include #include #include #include #include -#include - #define TASK_HPAGE_BASE (REGION_HPAGE << REGION_SHIFT) static long htlbpagemem; @@ -392,8 +391,6 @@ { int lcount; struct page *page ; - extern long htlbzone_pages; - extern struct list_head htlbpage_freelist; if (count < 0) lcount = count; diff -urN linux-2.5.69-bk10/arch/s390/kernel/compat_exec.c linux-2.5.69-bk11/arch/s390/kernel/compat_exec.c --- linux-2.5.69-bk10/arch/s390/kernel/compat_exec.c 2003-05-04 16:53:41.000000000 -0700 +++ linux-2.5.69-bk11/arch/s390/kernel/compat_exec.c 2003-05-16 04:44:34.000000000 -0700 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -32,8 +33,6 @@ #endif -extern void put_dirty_page(struct task_struct * tsk, struct page *page, unsigned long address); - #undef STACK_TOP #define STACK_TOP TASK31_SIZE @@ -81,7 +80,7 @@ struct page *page = bprm->page[i]; if (page) { bprm->page[i] = NULL; - put_dirty_page(current,page,stack_base); + put_dirty_page(current,page,stack_base,PAGE_COPY); } stack_base += PAGE_SIZE; } diff -urN linux-2.5.69-bk10/arch/x86_64/ia32/ia32_binfmt.c linux-2.5.69-bk11/arch/x86_64/ia32/ia32_binfmt.c --- linux-2.5.69-bk10/arch/x86_64/ia32/ia32_binfmt.c 2003-05-04 16:52:50.000000000 -0700 +++ linux-2.5.69-bk11/arch/x86_64/ia32/ia32_binfmt.c 2003-05-16 04:44:34.000000000 -0700 @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -272,9 +273,6 @@ set_thread_flag(TIF_IA32); } -extern void put_dirty_page(struct task_struct * tsk, struct page *page, unsigned long address); - - int setup_arg_pages(struct linux_binprm *bprm) { unsigned long stack_base; @@ -319,7 +317,7 @@ struct page *page = bprm->page[i]; if (page) { bprm->page[i] = NULL; - put_dirty_page(current,page,stack_base); + put_dirty_page(current,page,stack_base,PAGE_COPY_EXEC); } stack_base += PAGE_SIZE; } diff -urN linux-2.5.69-bk10/drivers/base/base.h linux-2.5.69-bk11/drivers/base/base.h --- linux-2.5.69-bk10/drivers/base/base.h 2003-05-04 16:53:12.000000000 -0700 +++ linux-2.5.69-bk11/drivers/base/base.h 2003-05-16 04:44:34.000000000 -0700 @@ -1,5 +1,3 @@ -extern struct semaphore device_sem; - extern int bus_add_device(struct device * dev); extern void bus_remove_device(struct device * dev); diff -urN linux-2.5.69-bk10/drivers/base/core.c linux-2.5.69-bk11/drivers/base/core.c --- linux-2.5.69-bk10/drivers/base/core.c 2003-05-04 16:53:01.000000000 -0700 +++ linux-2.5.69-bk11/drivers/base/core.c 2003-05-16 04:44:34.000000000 -0700 @@ -21,9 +21,6 @@ int (*platform_notify)(struct device * dev) = NULL; int (*platform_notify_remove)(struct device * dev) = NULL; -DECLARE_MUTEX(device_sem); - - /* * sysfs bindings for devices. */ @@ -180,6 +177,7 @@ void device_initialize(struct device *dev) { + kobj_set_kset_s(dev,devices_subsys); kobject_init(&dev->kobj); INIT_LIST_HEAD(&dev->node); INIT_LIST_HEAD(&dev->children); @@ -214,7 +212,6 @@ /* first, register with generic layer. */ strncpy(dev->kobj.name,dev->bus_id,KOBJ_NAME_LEN); - kobj_set_kset_s(dev,devices_subsys); if (parent) dev->kobj.parent = &parent->kobj; @@ -222,11 +219,11 @@ goto register_done; /* now take care of our own registration */ - if (parent) { - down(&device_sem); + + down_write(&devices_subsys.rwsem); + if (parent) list_add_tail(&dev->node,&parent->children); - up(&device_sem); - } + up_write(&devices_subsys.rwsem); bus_add_device(dev); @@ -304,11 +301,10 @@ { struct device * parent = dev->parent; - if (parent) { - down(&device_sem); + down_write(&devices_subsys.rwsem); + if (parent) list_del_init(&dev->node); - up(&device_sem); - } + up_write(&devices_subsys.rwsem); /* Notify the platform of the removal, in case they * need to do anything... diff -urN linux-2.5.69-bk10/drivers/block/DAC960.c linux-2.5.69-bk11/drivers/block/DAC960.c --- linux-2.5.69-bk10/drivers/block/DAC960.c 2003-05-04 16:53:36.000000000 -0700 +++ linux-2.5.69-bk11/drivers/block/DAC960.c 2003-05-16 04:44:34.000000000 -0700 @@ -48,8 +48,7 @@ static DAC960_Controller_T *DAC960_Controllers[DAC960_MaxControllers]; static int DAC960_ControllerCount; -static PROC_DirectoryEntry_T *DAC960_ProcDirectoryEntry; - +static struct proc_dir_entry *DAC960_ProcDirectoryEntry; static long disk_size(DAC960_Controller_T *p, int drive_nr) { @@ -759,12 +758,15 @@ { DAC960_Controller_T *Controller = Command->Controller; DECLARE_COMPLETION(Completion); - unsigned long ProcessorFlags; + unsigned long flags; Command->Completion = &Completion; - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_QueueCommand(Command); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); - if (in_interrupt()) return; + spin_unlock_irqrestore(&Controller->queue_lock, flags); + + if (in_interrupt()) + return; wait_for_completion(&Completion); } @@ -1132,7 +1134,7 @@ { void *ControllerBaseAddress = Controller->BaseAddress; DAC960_HardwareType_T hw_type = Controller->HardwareType; - PCI_Device_T *PCI_Device = Controller->PCIDevice; + struct pci_dev *PCI_Device = Controller->PCIDevice; struct dma_loaf *DmaPages = &Controller->DmaPages; size_t DmaPagesSize; size_t CommandMailboxesSize; @@ -1337,7 +1339,7 @@ *Controller) { void *ControllerBaseAddress = Controller->BaseAddress; - PCI_Device_T *PCI_Device = Controller->PCIDevice; + struct pci_dev *PCI_Device = Controller->PCIDevice; struct dma_loaf *DmaPages = &Controller->DmaPages; size_t DmaPagesSize; size_t CommandMailboxesSize; @@ -1915,8 +1917,8 @@ dma_addr_t SCSI_NewInquiryUnitSerialNumberDMA[DAC960_V1_MaxChannels]; DAC960_SCSI_Inquiry_UnitSerialNumber_T *SCSI_NewInquiryUnitSerialNumberCPU[DAC960_V1_MaxChannels]; - Completion_T Completions[DAC960_V1_MaxChannels]; - unsigned long ProcessorFlags; + struct completion Completions[DAC960_V1_MaxChannels]; + unsigned long flags; int Channel, TargetID; if (!init_dma_loaf(Controller->PCIDevice, &local_dma, @@ -1951,7 +1953,7 @@ DAC960_V1_DCDB_T *DCDB = DCDBs_cpu[Channel]; dma_addr_t DCDB_dma = DCDBs_dma[Channel]; DAC960_Command_T *Command = Controller->Commands[Channel]; - Completion_T *Completion = &Completions[Channel]; + struct completion *Completion = &Completions[Channel]; init_completion(Completion); DAC960_V1_ClearCommand(Command); @@ -1977,9 +1979,10 @@ DCDB->CDB[3] = 0; /* Reserved */ DCDB->CDB[4] = sizeof(DAC960_SCSI_Inquiry_T); DCDB->CDB[5] = 0; /* Control */ - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_QueueCommand(Command); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); } /* * Wait for the problems submitted in the previous loop @@ -1999,7 +2002,7 @@ &Controller->V1.InquiryUnitSerialNumber[Channel][TargetID]; DAC960_Command_T *Command = Controller->Commands[Channel]; DAC960_V1_DCDB_T *DCDB = DCDBs_cpu[Channel]; - Completion_T *Completion = &Completions[Channel]; + struct completion *Completion = &Completions[Channel]; wait_for_completion(Completion); @@ -2021,9 +2024,10 @@ DCDB->CDB[3] = 0; /* Reserved */ DCDB->CDB[4] = sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T); DCDB->CDB[5] = 0; /* Control */ - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_QueueCommand(Command); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); wait_for_completion(Completion); if (Command->V1.CommandStatus != DAC960_V1_NormalCompletion) { @@ -2457,7 +2461,7 @@ static boolean DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller) { int MajorNumber = DAC960_MAJOR + Controller->ControllerNumber; - RequestQueue_T *RequestQueue; + struct request_queue *RequestQueue; int n; /* @@ -2642,11 +2646,13 @@ */ static DAC960_Controller_T * -DAC960_DetectController(PCI_Device_T *PCI_Device, - const struct pci_device_id *entry) +DAC960_DetectController(struct pci_dev *PCI_Device, + const struct pci_device_id *entry) { - struct DAC960_privdata *privdata = (struct DAC960_privdata *)entry->driver_data; - irqreturn_t (*InterruptHandler)(int, void *, Registers_T *) = privdata->InterruptHandler; + struct DAC960_privdata *privdata = + (struct DAC960_privdata *)entry->driver_data; + irqreturn_t (*InterruptHandler)(int, void *, struct pt_regs *) = + privdata->InterruptHandler; unsigned int MemoryWindowSize = privdata->MemoryWindowSize; DAC960_Controller_T *Controller = NULL; unsigned char DeviceFunction = PCI_Device->devfn; @@ -3001,7 +3007,7 @@ { if (Controller->ControllerInitialized) { - unsigned long ProcessorFlags; + unsigned long flags; /* * Acquiring and releasing lock here eliminates @@ -3019,9 +3025,11 @@ * commands that complete from this time on will NOT return * their command structure to the free list. */ - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + + spin_lock_irqsave(&Controller->queue_lock, flags); Controller->ShutdownMonitoringTimer = 1; - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); + del_timer_sync(&Controller->MonitoringTimer); if (Controller->FirmwareType == DAC960_V1_Controller) { @@ -3088,7 +3096,7 @@ DAC960_Finalize finalizes the DAC960 Driver. */ -static void DAC960_Remove(PCI_Device_T *PCI_Device) +static void DAC960_Remove(struct pci_dev *PCI_Device) { int Controller_Number = (int)pci_get_drvdata(PCI_Device); DAC960_Controller_T *Controller = DAC960_Controllers[Controller_Number]; @@ -3236,8 +3244,8 @@ static boolean DAC960_ProcessRequest(DAC960_Controller_T *Controller, boolean WaitForCommand) { - RequestQueue_T *RequestQueue = &Controller->RequestQueue; - IO_Request_T *Request; + struct request_queue *RequestQueue = &Controller->RequestQueue; + struct request *Request; DAC960_Command_T *Command; if (!Controller->ControllerInitialized) @@ -3293,7 +3301,7 @@ static void DAC960_queue_partial_rw(DAC960_Command_T *Command) { DAC960_Controller_T *Controller = Command->Controller; - IO_Request_T *Request = Command->Request; + struct request *Request = Command->Request; if (Command->DmaDirection == PCI_DMA_FROMDEVICE) Command->CommandType = DAC960_ReadRetryCommand; @@ -3324,43 +3332,17 @@ return; } - -/* - DAC960_ProcessRequests attempts to remove as many I/O Requests as possible - from Controller's I/O Request Queue and queue them to the Controller. -*/ - -static inline void DAC960_ProcessRequests(DAC960_Controller_T *Controller) -{ - int Counter = 0; - while (DAC960_ProcessRequest(Controller, Counter++ == 0)) ; -} - - /* DAC960_RequestFunction is the I/O Request Function for DAC960 Controllers. */ -static void DAC960_RequestFunction(RequestQueue_T *RequestQueue) +static void DAC960_RequestFunction(struct request_queue *RequestQueue) { - DAC960_Controller_T *Controller = - (DAC960_Controller_T *) RequestQueue->queuedata; - ProcessorFlags_T ProcessorFlags; - /* - Acquire exclusive access to Controller. - */ - DAC960_AcquireControllerLockRF(Controller, &ProcessorFlags); - /* - Process I/O Requests for Controller. - */ - DAC960_ProcessRequests(Controller); - /* - Release exclusive access to Controller. - */ - DAC960_ReleaseControllerLockRF(Controller, &ProcessorFlags); + int i = 0; + while (DAC960_ProcessRequest(RequestQueue->queuedata, (i++ == 0))) + ; } - /* DAC960_ProcessCompletedBuffer performs completion processing for an individual Buffer. @@ -3369,7 +3351,7 @@ static inline boolean DAC960_ProcessCompletedRequest(DAC960_Command_T *Command, boolean SuccessfulIO) { - IO_Request_T *Request = Command->Request; + struct request *Request = Command->Request; int UpToDate; UpToDate = 0; @@ -5174,20 +5156,14 @@ static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, - Registers_T *InterruptRegisters) + struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; void *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; - ProcessorFlags_T ProcessorFlags; + unsigned long flags; - /* - Acquire exclusive access to Controller. - */ - DAC960_AcquireControllerLockIH(Controller, &ProcessorFlags); - /* - Process Hardware Interrupts for Controller. - */ + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_BA_AcknowledgeInterrupt(ControllerBaseAddress); NextStatusMailbox = Controller->V2.NextStatusMailbox; while (NextStatusMailbox->Fields.CommandIdentifier > 0) @@ -5210,11 +5186,9 @@ Attempt to remove additional I/O Requests from the Controller's I/O Request Queue and queue them to the Controller. */ - while (DAC960_ProcessRequest(Controller, false)) ; - /* - Release exclusive access to Controller. - */ - DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + while (DAC960_ProcessRequest(Controller, false)) + ; + spin_unlock_irqrestore(&Controller->queue_lock, flags); return IRQ_HANDLED; } @@ -5226,19 +5200,14 @@ static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, - Registers_T *InterruptRegisters) + struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; void *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; - ProcessorFlags_T ProcessorFlags; - /* - Acquire exclusive access to Controller. - */ - DAC960_AcquireControllerLockIH(Controller, &ProcessorFlags); - /* - Process Hardware Interrupts for Controller. - */ + unsigned long flags; + + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_LP_AcknowledgeInterrupt(ControllerBaseAddress); NextStatusMailbox = Controller->V2.NextStatusMailbox; while (NextStatusMailbox->Fields.CommandIdentifier > 0) @@ -5261,11 +5230,9 @@ Attempt to remove additional I/O Requests from the Controller's I/O Request Queue and queue them to the Controller. */ - while (DAC960_ProcessRequest(Controller, false)) ; - /* - Release exclusive access to Controller. - */ - DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + while (DAC960_ProcessRequest(Controller, false)) + ; + spin_unlock_irqrestore(&Controller->queue_lock, flags); return IRQ_HANDLED; } @@ -5277,19 +5244,14 @@ static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, - Registers_T *InterruptRegisters) + struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; void *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_StatusMailbox_T *NextStatusMailbox; - ProcessorFlags_T ProcessorFlags; - /* - Acquire exclusive access to Controller. - */ - DAC960_AcquireControllerLockIH(Controller, &ProcessorFlags); - /* - Process Hardware Interrupts for Controller. - */ + unsigned long flags; + + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_LA_AcknowledgeInterrupt(ControllerBaseAddress); NextStatusMailbox = Controller->V1.NextStatusMailbox; while (NextStatusMailbox->Fields.Valid) @@ -5308,11 +5270,9 @@ Attempt to remove additional I/O Requests from the Controller's I/O Request Queue and queue them to the Controller. */ - while (DAC960_ProcessRequest(Controller, false)) ; - /* - Release exclusive access to Controller. - */ - DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + while (DAC960_ProcessRequest(Controller, false)) + ; + spin_unlock_irqrestore(&Controller->queue_lock, flags); return IRQ_HANDLED; } @@ -5324,19 +5284,14 @@ static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, - Registers_T *InterruptRegisters) + struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; void *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_StatusMailbox_T *NextStatusMailbox; - ProcessorFlags_T ProcessorFlags; - /* - Acquire exclusive access to Controller. - */ - DAC960_AcquireControllerLockIH(Controller, &ProcessorFlags); - /* - Process Hardware Interrupts for Controller. - */ + unsigned long flags; + + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_PG_AcknowledgeInterrupt(ControllerBaseAddress); NextStatusMailbox = Controller->V1.NextStatusMailbox; while (NextStatusMailbox->Fields.Valid) @@ -5355,11 +5310,9 @@ Attempt to remove additional I/O Requests from the Controller's I/O Request Queue and queue them to the Controller. */ - while (DAC960_ProcessRequest(Controller, false)) ; - /* - Release exclusive access to Controller. - */ - DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + while (DAC960_ProcessRequest(Controller, false)) + ; + spin_unlock_irqrestore(&Controller->queue_lock, flags); return IRQ_HANDLED; } @@ -5371,18 +5324,13 @@ static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, - Registers_T *InterruptRegisters) + struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; void *ControllerBaseAddress = Controller->BaseAddress; - ProcessorFlags_T ProcessorFlags; - /* - Acquire exclusive access to Controller. - */ - DAC960_AcquireControllerLockIH(Controller, &ProcessorFlags); - /* - Process Hardware Interrupts for Controller. - */ + unsigned long flags; + + spin_lock_irqsave(&Controller->queue_lock, flags); while (DAC960_PD_StatusAvailableP(ControllerBaseAddress)) { DAC960_V1_CommandIdentifier_T CommandIdentifier = @@ -5398,11 +5346,9 @@ Attempt to remove additional I/O Requests from the Controller's I/O Request Queue and queue them to the Controller. */ - while (DAC960_ProcessRequest(Controller, false)) ; - /* - Release exclusive access to Controller. - */ - DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + while (DAC960_ProcessRequest(Controller, false)) + ; + spin_unlock_irqrestore(&Controller->queue_lock, flags); return IRQ_HANDLED; } @@ -5418,18 +5364,13 @@ static irqreturn_t DAC960_P_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, - Registers_T *InterruptRegisters) + struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; void *ControllerBaseAddress = Controller->BaseAddress; - ProcessorFlags_T ProcessorFlags; - /* - Acquire exclusive access to Controller. - */ - DAC960_AcquireControllerLockIH(Controller, &ProcessorFlags); - /* - Process Hardware Interrupts for Controller. - */ + unsigned long flags; + + spin_lock_irqsave(&Controller->queue_lock, flags); while (DAC960_PD_StatusAvailableP(ControllerBaseAddress)) { DAC960_V1_CommandIdentifier_T CommandIdentifier = @@ -5480,11 +5421,9 @@ Attempt to remove additional I/O Requests from the Controller's I/O Request Queue and queue them to the Controller. */ - while (DAC960_ProcessRequest(Controller, false)) ; - /* - Release exclusive access to Controller. - */ - DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + while (DAC960_ProcessRequest(Controller, false)) + ; + spin_unlock_irqrestore(&Controller->queue_lock, flags); return IRQ_HANDLED; } @@ -5547,13 +5486,11 @@ { DAC960_Controller_T *Controller = (DAC960_Controller_T *) TimerData; DAC960_Command_T *Command; - ProcessorFlags_T ProcessorFlags; + unsigned long flags; + if (Controller->FirmwareType == DAC960_V1_Controller) { - /* - Acquire exclusive access to Controller. - */ - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + spin_lock_irqsave(&Controller->queue_lock, flags); /* Queue a Status Monitoring Command to Controller. */ @@ -5561,10 +5498,7 @@ if (Command != NULL) DAC960_V1_QueueMonitoringCommand(Command); else Controller->MonitoringCommandDeferred = true; - /* - Release exclusive access to Controller. - */ - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); } else { @@ -5613,10 +5547,8 @@ } Controller->V2.StatusChangeCounter = StatusChangeCounter; Controller->PrimaryMonitoringTime = jiffies; - /* - Acquire exclusive access to Controller. - */ - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + + spin_lock_irqsave(&Controller->queue_lock, flags); /* Queue a Status Monitoring Command to Controller. */ @@ -5624,10 +5556,7 @@ if (Command != NULL) DAC960_V2_QueueMonitoringCommand(Command); else Controller->MonitoringCommandDeferred = true; - /* - Release exclusive access to Controller. - */ - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); /* Wake up any processes waiting on a Health Status Buffer change. */ @@ -5639,7 +5568,7 @@ DAC960_UserIOCTL is the User IOCTL Function for the DAC960 Driver. */ -static int DAC960_UserIOCTL(Inode_T *Inode, File_T *File, +static int DAC960_UserIOCTL(struct inode *inode, struct file *file, unsigned int Request, unsigned long Argument) { int ErrorCode = 0; @@ -5691,7 +5620,7 @@ DAC960_V1_DCDB_T DCDB; DAC960_V1_DCDB_T *DCDB_IOBUF = NULL; dma_addr_t DCDB_IOBUFDMA; - ProcessorFlags_T ProcessorFlags; + unsigned long flags; int ControllerNumber, DataTransferLength; unsigned char *DataTransferBuffer = NULL; dma_addr_t DataTransferBufferDMA; @@ -5764,7 +5693,7 @@ } if (CommandOpcode == DAC960_V1_DCDB) { - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + spin_lock_irqsave(&Controller->queue_lock, flags); while ((Command = DAC960_AllocateCommand(Controller)) == NULL) DAC960_WaitForCommand(Controller); while (Controller->V1.DirectCommandActive[DCDB.Channel] @@ -5778,7 +5707,7 @@ } Controller->V1.DirectCommandActive[DCDB.Channel] [DCDB.TargetID] = true; - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); DAC960_V1_ClearCommand(Command); Command->CommandType = DAC960_ImmediateCommand; memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox, @@ -5789,10 +5718,10 @@ } else { - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + spin_lock_irqsave(&Controller->queue_lock, flags); while ((Command = DAC960_AllocateCommand(Controller)) == NULL) DAC960_WaitForCommand(Controller); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); DAC960_V1_ClearCommand(Command); Command->CommandType = DAC960_ImmediateCommand; memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox, @@ -5803,9 +5732,9 @@ } DAC960_ExecuteCommand(Command); CommandStatus = Command->V1.CommandStatus; - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_DeallocateCommand(Command); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); if (DataTransferLength > 0) { if (copy_to_user(UserCommand.DataTransferBuffer, @@ -5848,7 +5777,7 @@ DAC960_Command_T *Command = NULL; DAC960_V2_CommandMailbox_T *CommandMailbox; DAC960_V2_CommandStatus_T CommandStatus; - ProcessorFlags_T ProcessorFlags; + unsigned long flags; int ControllerNumber, DataTransferLength; int DataTransferResidue, RequestSenseLength; unsigned char *DataTransferBuffer = NULL; @@ -5900,10 +5829,10 @@ } memset(RequestSenseBuffer, 0, RequestSenseLength); } - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + spin_lock_irqsave(&Controller->queue_lock, flags); while ((Command = DAC960_AllocateCommand(Controller)) == NULL) DAC960_WaitForCommand(Controller); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); DAC960_V2_ClearCommand(Command); Command->CommandType = DAC960_ImmediateCommand; CommandMailbox = &Command->V2.CommandMailbox; @@ -5951,9 +5880,9 @@ CommandStatus = Command->V2.CommandStatus; RequestSenseLength = Command->V2.RequestSenseLength; DataTransferResidue = Command->V2.DataTransferResidue; - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_DeallocateCommand(Command); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); if (RequestSenseLength > UserCommand.RequestSenseLength) RequestSenseLength = UserCommand.RequestSenseLength; if (copy_to_user(&UserSpaceUserCommand->DataTransferLength, @@ -6302,12 +6231,13 @@ { DAC960_Command_T *Command; DAC960_V1_CommandMailbox_T *CommandMailbox; - ProcessorFlags_T ProcessorFlags; + unsigned long flags; unsigned char Channel, TargetID, LogicalDriveNumber; - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + + spin_lock_irqsave(&Controller->queue_lock, flags); while ((Command = DAC960_AllocateCommand(Controller)) == NULL) DAC960_WaitForCommand(Controller); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); Controller->UserStatusLength = 0; DAC960_V1_ClearCommand(Command); Command->CommandType = DAC960_ImmediateCommand; @@ -6497,9 +6427,10 @@ } else DAC960_UserCritical("Illegal User Command: '%s'\n", Controller, UserCommand); - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_DeallocateCommand(Command); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); return true; } @@ -6562,13 +6493,14 @@ { DAC960_Command_T *Command; DAC960_V2_CommandMailbox_T *CommandMailbox; - ProcessorFlags_T ProcessorFlags; + unsigned long flags; unsigned char Channel, TargetID, LogicalDriveNumber; unsigned short LogicalDeviceNumber; - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + + spin_lock_irqsave(&Controller->queue_lock, flags); while ((Command = DAC960_AllocateCommand(Controller)) == NULL) DAC960_WaitForCommand(Controller); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); Controller->UserStatusLength = 0; DAC960_V2_ClearCommand(Command); Command->CommandType = DAC960_ImmediateCommand; @@ -6758,9 +6690,10 @@ Controller->SuppressEnclosureMessages = true; else DAC960_UserCritical("Illegal User Command: '%s'\n", Controller, UserCommand); - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + + spin_lock_irqsave(&Controller->queue_lock, flags); DAC960_DeallocateCommand(Command); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); + spin_unlock_irqrestore(&Controller->queue_lock, flags); return true; } @@ -6893,7 +6826,7 @@ DAC960_ProcWriteUserCommand implements writing /proc/rd/cN/user_command. */ -static int DAC960_ProcWriteUserCommand(File_T *File, const char *Buffer, +static int DAC960_ProcWriteUserCommand(struct file *file, const char *Buffer, unsigned long Count, void *Data) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) Data; @@ -6921,9 +6854,9 @@ static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller) { - PROC_DirectoryEntry_T *StatusProcEntry; - PROC_DirectoryEntry_T *ControllerProcEntry; - PROC_DirectoryEntry_T *UserCommandProcEntry; + struct proc_dir_entry *StatusProcEntry; + struct proc_dir_entry *ControllerProcEntry; + struct proc_dir_entry *UserCommandProcEntry; if (DAC960_ProcDirectoryEntry == NULL) { DAC960_ProcDirectoryEntry = proc_mkdir("rd", NULL); diff -urN linux-2.5.69-bk10/drivers/block/DAC960.h linux-2.5.69-bk11/drivers/block/DAC960.h --- linux-2.5.69-bk10/drivers/block/DAC960.h 2003-05-04 16:53:36.000000000 -0700 +++ linux-2.5.69-bk11/drivers/block/DAC960.h 2003-05-16 04:44:34.000000000 -0700 @@ -2203,33 +2203,10 @@ DAC960_Message(DAC960_UserCriticalLevel, Format, ##Arguments) -/* - Define types for some of the structures that interface with the rest - of the Linux Kernel and I/O Subsystem. -*/ - -typedef struct file File_T; -typedef struct block_device_operations BlockDeviceOperations_T; -typedef struct completion Completion_T; -typedef struct hd_geometry DiskGeometry_T; -typedef struct inode Inode_T; -typedef struct inode_operations InodeOperations_T; -typedef kdev_t KernelDevice_T; -typedef struct list_head ListHead_T; -typedef struct pci_dev PCI_Device_T; -typedef struct proc_dir_entry PROC_DirectoryEntry_T; -typedef unsigned long ProcessorFlags_T; -typedef struct pt_regs Registers_T; -typedef struct request IO_Request_T; -typedef request_queue_t RequestQueue_T; -typedef struct super_block SuperBlock_T; -typedef struct timer_list Timer_T; -typedef wait_queue_head_t WaitQueue_T; - struct DAC960_privdata { DAC960_HardwareType_T HardwareType; DAC960_FirmwareType_T FirmwareType; - irqreturn_t (*InterruptHandler)(int, void *, Registers_T *); + irqreturn_t (*InterruptHandler)(int, void *, struct pt_regs *); unsigned int MemoryWindowSize; }; @@ -2295,14 +2272,14 @@ DAC960_CommandType_T CommandType; struct DAC960_Controller *Controller; struct DAC960_Command *Next; - Completion_T *Completion; + struct completion *Completion; unsigned int LogicalDriveNumber; unsigned int BlockNumber; unsigned int BlockCount; unsigned int SegmentCount; int DmaDirection; struct scatterlist *cmd_sglist; - IO_Request_T *Request; + struct request *Request; struct pci_dev *PciDevice; union { struct { @@ -2344,7 +2321,7 @@ DAC960_HardwareType_T HardwareType; DAC960_IO_Address_T IO_Address; DAC960_PCI_Address_T PCI_Address; - PCI_Device_T *PCIDevice; + struct pci_dev *PCIDevice; unsigned char ControllerNumber; unsigned char ControllerName[4]; unsigned char ModelName[20]; @@ -2383,19 +2360,19 @@ boolean DriveSpinUpMessageDisplayed; boolean MonitoringAlertMode; boolean SuppressEnclosureMessages; - Timer_T MonitoringTimer; + struct timer_list MonitoringTimer; struct gendisk *disks[DAC960_MaxLogicalDrives]; struct pci_pool *ScatterGatherPool; DAC960_Command_T *FreeCommands; unsigned char *CombinedStatusBuffer; unsigned char *CurrentStatusBuffer; - RequestQueue_T RequestQueue; + struct request_queue RequestQueue; spinlock_t queue_lock; - WaitQueue_T CommandWaitQueue; - WaitQueue_T HealthStatusWaitQueue; + wait_queue_head_t CommandWaitQueue; + wait_queue_head_t HealthStatusWaitQueue; DAC960_Command_T InitialCommand; DAC960_Command_T *Commands[DAC960_MaxDriverQueueDepth]; - PROC_DirectoryEntry_T *ControllerProcEntry; + struct proc_dir_entry *ControllerProcEntry; boolean LogicalDriveInitiallyAccessible[DAC960_MaxLogicalDrives]; void (*QueueCommand)(DAC960_Command_T *Command); boolean (*ReadControllerConfiguration)(struct DAC960_Controller *); @@ -2596,85 +2573,6 @@ } /* - DAC960_AcquireControllerLock acquires exclusive access to Controller. - Reference the queue_lock through the controller structure, - rather than through the request queue. These macros are - used to mutex on the controller structure during initialization, - BEFORE the request queue is allocated and initialized in - DAC960_RegisterBlockDevice(). -*/ - -static inline -void DAC960_AcquireControllerLock(DAC960_Controller_T *Controller, - ProcessorFlags_T *ProcessorFlags) -{ - spin_lock_irqsave(&Controller->queue_lock, *ProcessorFlags); -} - - -/* - DAC960_ReleaseControllerLock releases exclusive access to Controller. -*/ - -static inline -void DAC960_ReleaseControllerLock(DAC960_Controller_T *Controller, - ProcessorFlags_T *ProcessorFlags) -{ - spin_unlock_irqrestore(&Controller->queue_lock, *ProcessorFlags); -} - - -/* - DAC960_AcquireControllerLockRF acquires exclusive access to Controller, - but is only called from the request function with the queue lock held. -*/ - -static inline -void DAC960_AcquireControllerLockRF(DAC960_Controller_T *Controller, - ProcessorFlags_T *ProcessorFlags) -{ -} - - -/* - DAC960_ReleaseControllerLockRF releases exclusive access to Controller, - but is only called from the request function with the queue lock held. -*/ - -static inline -void DAC960_ReleaseControllerLockRF(DAC960_Controller_T *Controller, - ProcessorFlags_T *ProcessorFlags) -{ -} - - -/* - DAC960_AcquireControllerLockIH acquires exclusive access to Controller, - but is only called from the interrupt handler. -*/ - -static inline -void DAC960_AcquireControllerLockIH(DAC960_Controller_T *Controller, - ProcessorFlags_T *ProcessorFlags) -{ - spin_lock_irqsave(&Controller->queue_lock, *ProcessorFlags); -} - - -/* - DAC960_ReleaseControllerLockIH releases exclusive access to Controller, - but is only called from the interrupt handler. -*/ - -static inline -void DAC960_ReleaseControllerLockIH(DAC960_Controller_T *Controller, - ProcessorFlags_T *ProcessorFlags) -{ - spin_unlock_irqrestore(&Controller->queue_lock, *ProcessorFlags); -} - - -/* Define the DAC960 BA Series Controller Interface Register Offsets. */ @@ -4230,17 +4128,18 @@ static void DAC960_FinalizeController(DAC960_Controller_T *); static void DAC960_V1_QueueReadWriteCommand(DAC960_Command_T *); static void DAC960_V2_QueueReadWriteCommand(DAC960_Command_T *); -static void DAC960_RequestFunction(RequestQueue_T *); -static irqreturn_t DAC960_BA_InterruptHandler(int, void *, Registers_T *); -static irqreturn_t DAC960_LP_InterruptHandler(int, void *, Registers_T *); -static irqreturn_t DAC960_LA_InterruptHandler(int, void *, Registers_T *); -static irqreturn_t DAC960_PG_InterruptHandler(int, void *, Registers_T *); -static irqreturn_t DAC960_PD_InterruptHandler(int, void *, Registers_T *); -static irqreturn_t DAC960_P_InterruptHandler(int, void *, Registers_T *); +static void DAC960_RequestFunction(struct request_queue *); +static irqreturn_t DAC960_BA_InterruptHandler(int, void *, struct pt_regs *); +static irqreturn_t DAC960_LP_InterruptHandler(int, void *, struct pt_regs *); +static irqreturn_t DAC960_LA_InterruptHandler(int, void *, struct pt_regs *); +static irqreturn_t DAC960_PG_InterruptHandler(int, void *, struct pt_regs *); +static irqreturn_t DAC960_PD_InterruptHandler(int, void *, struct pt_regs *); +static irqreturn_t DAC960_P_InterruptHandler(int, void *, struct pt_regs *); static void DAC960_V1_QueueMonitoringCommand(DAC960_Command_T *); static void DAC960_V2_QueueMonitoringCommand(DAC960_Command_T *); static void DAC960_MonitoringTimerFunction(unsigned long); -static int DAC960_UserIOCTL(Inode_T *, File_T *, unsigned int, unsigned long); +static int DAC960_UserIOCTL(struct inode *, struct file *, + unsigned int, unsigned long); static void DAC960_Message(DAC960_MessageLevel_T, unsigned char *, DAC960_Controller_T *, ...); static void DAC960_CreateProcEntries(DAC960_Controller_T *); diff -urN linux-2.5.69-bk10/drivers/block/cciss_scsi.c linux-2.5.69-bk11/drivers/block/cciss_scsi.c --- linux-2.5.69-bk10/drivers/block/cciss_scsi.c 2003-05-16 04:44:29.000000000 -0700 +++ linux-2.5.69-bk11/drivers/block/cciss_scsi.c 2003-05-16 04:44:34.000000000 -0700 @@ -1046,7 +1046,7 @@ } else { printk(KERN_ERR "cciss: Report physical LUNs failed.\n"); - return; + goto out; } @@ -1091,7 +1091,7 @@ } adjust_cciss_scsi_table(cntl_num, hostno, currentsd, ncurrent); - +out: kfree(inq_buff); kfree(ld_buff); return; diff -urN linux-2.5.69-bk10/drivers/block/loop.c linux-2.5.69-bk11/drivers/block/loop.c --- linux-2.5.69-bk10/drivers/block/loop.c 2003-05-04 16:53:32.000000000 -0700 +++ linux-2.5.69-bk11/drivers/block/loop.c 2003-05-16 04:44:34.000000000 -0700 @@ -651,7 +651,8 @@ int lo_flags = 0; int error; - MOD_INC_USE_COUNT; + /* This is safe, since we have a reference from open(). */ + __module_get(THIS_MODULE); error = -EBUSY; if (lo->lo_state != Lo_unbound) @@ -751,7 +752,8 @@ out_putf: fput(file); out: - MOD_DEC_USE_COUNT; + /* This is safe: open() is still holding a reference. */ + module_put(THIS_MODULE); return error; } @@ -824,7 +826,8 @@ filp->f_dentry->d_inode->i_mapping->gfp_mask = gfp; lo->lo_state = Lo_unbound; fput(filp); - MOD_DEC_USE_COUNT; + /* This is safe: open() is still holding a reference. */ + module_put(THIS_MODULE); return 0; } diff -urN linux-2.5.69-bk10/drivers/char/ipmi/ipmi_msghandler.c linux-2.5.69-bk11/drivers/char/ipmi/ipmi_msghandler.c --- linux-2.5.69-bk10/drivers/char/ipmi/ipmi_msghandler.c 2003-05-04 16:53:32.000000000 -0700 +++ linux-2.5.69-bk11/drivers/char/ipmi/ipmi_msghandler.c 2003-05-16 04:44:35.000000000 -0700 @@ -174,7 +174,7 @@ int ipmi_register_all_cmd_rcvr(ipmi_user_t user) { - int flags; + unsigned long flags; int rv = -EBUSY; write_lock_irqsave(&(user->intf->users_lock), flags); @@ -193,7 +193,7 @@ int ipmi_unregister_all_cmd_rcvr(ipmi_user_t user) { - int flags; + unsigned long flags; int rv = -EINVAL; write_lock_irqsave(&(user->intf->users_lock), flags); @@ -1023,7 +1023,7 @@ int rv; ipmi_smi_t new_intf; struct list_head *entry; - unsigned int flags; + unsigned long flags; /* Make sure the driver is actually initialized, this handles @@ -1148,7 +1148,7 @@ int rv = -ENODEV; int i; struct list_head *entry; - unsigned int flags; + unsigned long flags; down_write(&interfaces_sem); if (list_empty(&(intf->users))) diff -urN linux-2.5.69-bk10/drivers/char/mem.c linux-2.5.69-bk11/drivers/char/mem.c --- linux-2.5.69-bk10/drivers/char/mem.c 2003-05-16 04:44:29.000000000 -0700 +++ linux-2.5.69-bk11/drivers/char/mem.c 2003-05-16 04:44:35.000000000 -0700 @@ -522,7 +522,7 @@ */ static loff_t memory_lseek(struct file * file, loff_t offset, int orig) { - int ret; + loff_t ret; lock_kernel(); switch (orig) { diff -urN linux-2.5.69-bk10/drivers/char/pcmcia/synclink_cs.c linux-2.5.69-bk11/drivers/char/pcmcia/synclink_cs.c --- linux-2.5.69-bk10/drivers/char/pcmcia/synclink_cs.c 2003-05-04 16:53:10.000000000 -0700 +++ linux-2.5.69-bk11/drivers/char/pcmcia/synclink_cs.c 2003-05-16 04:44:35.000000000 -0700 @@ -1,7 +1,7 @@ /* * linux/drivers/char/pcmcia/synclink_cs.c * - * $Id: synclink_cs.c,v 4.6 2003/04/21 17:46:55 paulkf Exp $ + * $Id: synclink_cs.c,v 4.10 2003/05/13 16:06:03 paulkf Exp $ * * Device driver for Microgate SyncLink PC Card * multiprotocol serial adapter. @@ -430,7 +430,7 @@ static int rx_alloc_buffers(MGSLPC_INFO *info); static void rx_free_buffers(MGSLPC_INFO *info); -static void mgslpc_isr(int irq, void *dev_id, struct pt_regs * regs); +static irqreturn_t mgslpc_isr(int irq, void *dev_id, struct pt_regs * regs); /* * Bottom half interrupt handlers @@ -476,6 +476,7 @@ static int debug_level = 0; static int maxframe[MAX_DEVICE_COUNT] = {0,}; +static int dosyncppp[MAX_DEVICE_COUNT] = {1,1,1,1}; /* The old way: bit map of interrupts to choose from */ /* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */ @@ -492,11 +493,12 @@ MODULE_PARM(cuamajor,"i"); MODULE_PARM(debug_level,"i"); MODULE_PARM(maxframe,"1-" __MODULE_STRING(MAX_DEVICE_COUNT) "i"); +MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_DEVICE_COUNT) "i"); MODULE_LICENSE("GPL"); static char *driver_name = "SyncLink PC Card driver"; -static char *driver_version = "$Revision: 4.6 $"; +static char *driver_version = "$Revision: 4.10 $"; static struct tty_driver serial_driver, callout_driver; static int serial_refcount; @@ -574,9 +576,6 @@ link->priv = info; /* Initialize the dev_link_t structure */ - init_timer(&link->release); - link->release.function = &mgslpc_release; - link->release.data = (u_long)link; /* Interrupt setup */ link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; @@ -813,7 +812,7 @@ link->state &= ~DEV_PRESENT; if (link->state & DEV_CONFIG) { ((MGSLPC_INFO *)link->priv)->stop = 1; - mod_timer(&link->release, jiffies + HZ/20); + mgslpc_release((u_long)link); } break; case CS_EVENT_CARD_INSERTION: @@ -1356,7 +1355,7 @@ * dev_id device ID supplied during interrupt registration * regs interrupted processor context */ -static void mgslpc_isr(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t mgslpc_isr(int irq, void *dev_id, struct pt_regs * regs) { MGSLPC_INFO * info = (MGSLPC_INFO *)dev_id; unsigned short isr; @@ -1366,10 +1365,10 @@ if (debug_level >= DEBUG_LEVEL_ISR) printk("mgslpc_isr(%d) entry.\n", irq); if (!info) - return; + return IRQ_NONE; if (!(info->link.state & DEV_CONFIG)) - return; + return IRQ_HANDLED; spin_lock(&info->lock); @@ -1459,6 +1458,8 @@ if (debug_level >= DEBUG_LEVEL_ISR) printk("%s(%d):mgslpc_isr(%d)exit.\n", __FILE__,__LINE__,irq); + + return IRQ_HANDLED; } /* Initialize and start device. @@ -3113,8 +3114,7 @@ if (info->line < MAX_DEVICE_COUNT) { if (maxframe[info->line]) info->max_frame_size = maxframe[info->line]; -// info->dosyncppp = dosyncppp[info->line]; - info->dosyncppp = 1; + info->dosyncppp = dosyncppp[info->line]; } mgslpc_device_count++; @@ -3276,7 +3276,6 @@ unregister_pccard_driver(&dev_info); while (dev_list != NULL) { - del_timer(&dev_list->release); if (dev_list->state & DEV_CONFIG) mgslpc_release((u_long)dev_list); mgslpc_detach(dev_list); diff -urN linux-2.5.69-bk10/drivers/hotplug/acpiphp_glue.c linux-2.5.69-bk11/drivers/hotplug/acpiphp_glue.c --- linux-2.5.69-bk10/drivers/hotplug/acpiphp_glue.c 2003-05-16 04:44:29.000000000 -0700 +++ linux-2.5.69-bk11/drivers/hotplug/acpiphp_glue.c 2003-05-16 04:44:35.000000000 -0700 @@ -203,6 +203,7 @@ if (ACPI_FAILURE(status)) { err("failed to register interrupt notify handler\n"); + kfree(newfunc); return status; } diff -urN linux-2.5.69-bk10/drivers/isdn/i4l/isdn_x25iface.c linux-2.5.69-bk11/drivers/isdn/i4l/isdn_x25iface.c --- linux-2.5.69-bk10/drivers/isdn/i4l/isdn_x25iface.c 2003-05-04 16:53:12.000000000 -0700 +++ linux-2.5.69-bk11/drivers/isdn/i4l/isdn_x25iface.c 2003-05-16 04:44:35.000000000 -0700 @@ -222,6 +222,8 @@ printk(KERN_WARNING "isdn_x25iface_connect_ind while unconfigured %s\n" , MY_DEVNAME(cprot->net_dev) ); + if (skb) + dev_kfree_skb(skb); return -1; } *state_p = WAN_CONNECTED; diff -urN linux-2.5.69-bk10/drivers/isdn/pcbit/drv.c linux-2.5.69-bk11/drivers/isdn/pcbit/drv.c --- linux-2.5.69-bk10/drivers/isdn/pcbit/drv.c 2003-05-04 16:53:36.000000000 -0700 +++ linux-2.5.69-bk11/drivers/isdn/pcbit/drv.c 2003-05-16 04:44:35.000000000 -0700 @@ -1071,6 +1071,7 @@ ptr->msn = kmalloc(len, GFP_ATOMIC); if (!ptr->msn) { printk(KERN_WARNING "kmalloc failed\n"); + kfree(ptr); return; } diff -urN linux-2.5.69-bk10/drivers/md/dm-ioctl.c linux-2.5.69-bk11/drivers/md/dm-ioctl.c --- linux-2.5.69-bk10/drivers/md/dm-ioctl.c 2003-05-04 16:53:08.000000000 -0700 +++ linux-2.5.69-bk11/drivers/md/dm-ioctl.c 2003-05-16 04:44:35.000000000 -0700 @@ -278,6 +278,7 @@ DMWARN("asked to rename to an already existing name %s -> %s", old, new); up_write(&_hash_lock); + kfree(new_name); return -EBUSY; } @@ -289,6 +290,7 @@ DMWARN("asked to rename a non existent device %s -> %s", old, new); up_write(&_hash_lock); + kfree(new_name); return -ENXIO; } diff -urN linux-2.5.69-bk10/drivers/md/dm-target.c linux-2.5.69-bk11/drivers/md/dm-target.c --- linux-2.5.69-bk10/drivers/md/dm-target.c 2003-05-04 16:53:56.000000000 -0700 +++ linux-2.5.69-bk11/drivers/md/dm-target.c 2003-05-16 04:44:35.000000000 -0700 @@ -122,6 +122,8 @@ list_add(&ti->list, &_targets); up_write(&_lock); + if (rv) + kfree(ti); return rv; } diff -urN linux-2.5.69-bk10/drivers/media/radio/miropcm20-rds.c linux-2.5.69-bk11/drivers/media/radio/miropcm20-rds.c --- linux-2.5.69-bk10/drivers/media/radio/miropcm20-rds.c 2003-05-04 16:53:02.000000000 -0700 +++ linux-2.5.69-bk11/drivers/media/radio/miropcm20-rds.c 2003-05-16 04:44:36.000000000 -0700 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include "miropcm20-rds-core.h" diff -urN linux-2.5.69-bk10/drivers/media/video/bt819.c linux-2.5.69-bk11/drivers/media/video/bt819.c --- linux-2.5.69-bk10/drivers/media/video/bt819.c 2003-05-04 16:53:02.000000000 -0700 +++ linux-2.5.69-bk11/drivers/media/video/bt819.c 2003-05-16 04:44:36.000000000 -0700 @@ -167,6 +167,7 @@ decoder = kmalloc(sizeof(struct bt819), GFP_KERNEL); if (decoder == NULL) { MOD_DEC_USE_COUNT; + kfree(client); return -ENOMEM; } diff -urN linux-2.5.69-bk10/drivers/media/video/videodev.c linux-2.5.69-bk11/drivers/media/video/videodev.c --- linux-2.5.69-bk10/drivers/media/video/videodev.c 2003-05-16 04:44:29.000000000 -0700 +++ linux-2.5.69-bk11/drivers/media/video/videodev.c 2003-05-16 04:44:36.000000000 -0700 @@ -311,8 +311,10 @@ return; p = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, video_dev_proc_entry); - if (!p) + if (!p) { + kfree(d); return; + } p->data = vfd; p->read_proc = videodev_proc_read; diff -urN linux-2.5.69-bk10/drivers/message/i2o/i2o_core.c linux-2.5.69-bk11/drivers/message/i2o/i2o_core.c --- linux-2.5.69-bk10/drivers/message/i2o/i2o_core.c 2003-05-04 16:53:32.000000000 -0700 +++ linux-2.5.69-bk11/drivers/message/i2o/i2o_core.c 2003-05-16 04:44:36.000000000 -0700 @@ -2018,15 +2018,14 @@ { printk(KERN_ERR "%s: Unable to set SysTab (status=%#x).\n", iop->name, -ret); - kfree(privbuf); } else { dprintk(KERN_INFO "%s: SysTab set.\n", iop->name); - kfree(privbuf); } i2o_status_get(iop); // Entered READY state + kfree(privbuf); return ret; } diff -urN linux-2.5.69-bk10/drivers/mtd/chips/cfi_cmdset_0001.c linux-2.5.69-bk11/drivers/mtd/chips/cfi_cmdset_0001.c --- linux-2.5.69-bk10/drivers/mtd/chips/cfi_cmdset_0001.c 2003-05-04 16:53:08.000000000 -0700 +++ linux-2.5.69-bk11/drivers/mtd/chips/cfi_cmdset_0001.c 2003-05-16 04:44:36.000000000 -0700 @@ -203,6 +203,7 @@ if (!mtd->eraseregions) { printk(KERN_ERR "Failed to allocate memory for MTD erase region info\n"); kfree(cfi->cmdset_priv); + kfree(mtd); return NULL; } @@ -227,6 +228,7 @@ printk(KERN_WARNING "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize); kfree(mtd->eraseregions); kfree(cfi->cmdset_priv); + kfree(mtd); return NULL; } diff -urN linux-2.5.69-bk10/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.5.69-bk11/drivers/mtd/chips/cfi_cmdset_0002.c --- linux-2.5.69-bk10/drivers/mtd/chips/cfi_cmdset_0002.c 2003-05-04 16:53:13.000000000 -0700 +++ linux-2.5.69-bk11/drivers/mtd/chips/cfi_cmdset_0002.c 2003-05-16 04:44:36.000000000 -0700 @@ -174,6 +174,7 @@ if (!mtd->eraseregions) { printk(KERN_WARNING "Failed to allocate memory for MTD erase region info\n"); kfree(cfi->cmdset_priv); + kfree(mtd); return NULL; } @@ -197,6 +198,7 @@ printk(KERN_WARNING "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize); kfree(mtd->eraseregions); kfree(cfi->cmdset_priv); + kfree(mtd); return NULL; } #if 0 diff -urN linux-2.5.69-bk10/drivers/mtd/chips/sharp.c linux-2.5.69-bk11/drivers/mtd/chips/sharp.c --- linux-2.5.69-bk10/drivers/mtd/chips/sharp.c 2003-05-04 16:53:32.000000000 -0700 +++ linux-2.5.69-bk11/drivers/mtd/chips/sharp.c 2003-05-16 04:44:36.000000000 -0700 @@ -116,8 +116,10 @@ return NULL; sharp = kmalloc(sizeof(*sharp), GFP_KERNEL); - if(!sharp) + if(!sharp) { + kfree(mtd); return NULL; + } memset(mtd, 0, sizeof(*mtd)); diff -urN linux-2.5.69-bk10/drivers/net/cs89x0.c linux-2.5.69-bk11/drivers/net/cs89x0.c --- linux-2.5.69-bk10/drivers/net/cs89x0.c 2003-05-04 16:53:37.000000000 -0700 +++ linux-2.5.69-bk11/drivers/net/cs89x0.c 2003-05-16 04:44:36.000000000 -0700 @@ -1630,16 +1630,21 @@ } -static int set_mac_address(struct net_device *dev, void *addr) +static int set_mac_address(struct net_device *dev, void *p) { int i; + struct sockaddr *addr = p; + if (netif_running(dev)) return -EBUSY; + + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); + if (net_debug) { printk("%s: Setting MAC address to ", dev->name); - for (i = 0; i < 6; i++) - printk(" %2.2x", dev->dev_addr[i] = ((unsigned char *)addr)[i]); + for (i = 0; i < dev->addr_len; i++) + printk(" %2.2x", dev->dev_addr[i]); printk(".\n"); } /* set the Ethernet address */ diff -urN linux-2.5.69-bk10/fs/exec.c linux-2.5.69-bk11/fs/exec.c --- linux-2.5.69-bk10/fs/exec.c 2003-05-04 16:53:13.000000000 -0700 +++ linux-2.5.69-bk11/fs/exec.c 2003-05-16 04:44:39.000000000 -0700 @@ -287,7 +287,8 @@ * * tsk->mmap_sem is held for writing. */ -void put_dirty_page(struct task_struct * tsk, struct page *page, unsigned long address) +void put_dirty_page(struct task_struct *tsk, struct page *page, + unsigned long address, pgprot_t prot) { pgd_t * pgd; pmd_t * pmd; @@ -295,7 +296,8 @@ struct pte_chain *pte_chain; if (page_count(page) != 1) - printk(KERN_ERR "mem_map disagrees with %p at %08lx\n", page, address); + printk(KERN_ERR "mem_map disagrees with %p at %08lx\n", + page, address); pgd = pgd_offset(tsk->mm, address); pte_chain = pte_chain_alloc(GFP_KERNEL); @@ -314,7 +316,7 @@ } lru_cache_add_active(page); flush_dcache_page(page); - set_pte(pte, pte_mkdirty(pte_mkwrite(mk_pte(page, PAGE_COPY)))); + set_pte(pte, pte_mkdirty(pte_mkwrite(mk_pte(page, prot)))); pte_chain = page_add_rmap(page, pte, pte_chain); pte_unmap(pte); tsk->mm->rss++; @@ -421,7 +423,8 @@ struct page *page = bprm->page[i]; if (page) { bprm->page[i] = NULL; - put_dirty_page(current,page,stack_base); + put_dirty_page(current, page, stack_base, + mpnt->vm_page_prot); } stack_base += PAGE_SIZE; } @@ -434,8 +437,6 @@ #else -#define put_dirty_page(tsk, page, address) -#define setup_arg_pages(bprm) (0) static inline void free_arg_pages(struct linux_binprm *bprm) { int i; diff -urN linux-2.5.69-bk10/fs/sysfs/bin.c linux-2.5.69-bk11/fs/sysfs/bin.c --- linux-2.5.69-bk10/fs/sysfs/bin.c 2003-05-04 16:53:28.000000000 -0700 +++ linux-2.5.69-bk11/fs/sysfs/bin.c 2003-05-16 04:44:39.000000000 -0700 @@ -2,170 +2,118 @@ * bin.c - binary file operations for sysfs. */ +#include #include -#include #include +#include +#include #include #include "sysfs.h" -static struct file_operations bin_fops; - -static int fill_read(struct file * file, struct sysfs_bin_buffer * buffer) +static int +fill_read(struct dentry *dentry, char *buffer, loff_t off, size_t count) { - struct bin_attribute * attr = file->f_dentry->d_fsdata; - struct kobject * kobj = file->f_dentry->d_parent->d_fsdata; + struct bin_attribute * attr = dentry->d_fsdata; + struct kobject * kobj = dentry->d_parent->d_fsdata; - if (!buffer->data) - attr->read(kobj,buffer); - return buffer->size ? 0 : -ENOENT; -} - -static int flush_read(struct file * file, char * userbuf, - struct sysfs_bin_buffer * buffer) -{ - return copy_to_user(userbuf,buffer->data + buffer->offset,buffer->count) ? - -EFAULT : 0; + return attr->read(kobj, buffer, off, count); } static ssize_t read(struct file * file, char * userbuf, size_t count, loff_t * off) { - struct sysfs_bin_buffer * buffer = file->private_data; + char *buffer = file->private_data; + struct dentry *dentry = file->f_dentry; + int size = dentry->d_inode->i_size; + loff_t offs = *off; int ret; - ret = fill_read(file,buffer); - if (ret) - goto Done; + if (offs > size) + return 0; + if (offs + count > size) + count = size - offs; - buffer->offset = *off; + ret = fill_read(dentry, buffer, offs, count); + if (ret < 0) + goto Done; + count = ret; - if (count > (buffer->size - *off)) - count = buffer->size - *off; + ret = -EFAULT; + if (copy_to_user(userbuf, buffer + offs, count) != 0) + goto Done; - buffer->count = count; + *off = offs + count; + ret = count; - ret = flush_read(file,userbuf,buffer); - if (!ret) { - *off += count; - ret = count; - } Done: - if (buffer && buffer->data) { - kfree(buffer->data); - buffer->data = NULL; - } return ret; } -int alloc_buf_data(struct sysfs_bin_buffer * buffer) -{ - buffer->data = kmalloc(buffer->count,GFP_KERNEL); - if (buffer->data) { - memset(buffer->data,0,buffer->count); - return 0; - } else - return -ENOMEM; -} - -static int fill_write(struct file * file, const char * userbuf, - struct sysfs_bin_buffer * buffer) -{ - return copy_from_user(buffer->data,userbuf,buffer->count) ? - -EFAULT : 0; -} - -static int flush_write(struct file * file, const char * userbuf, - struct sysfs_bin_buffer * buffer) +static int +flush_write(struct dentry *dentry, char *buffer, loff_t offset, size_t count) { - struct bin_attribute * attr = file->f_dentry->d_fsdata; - struct kobject * kobj = file->f_dentry->d_parent->d_fsdata; + struct bin_attribute *attr = dentry->d_fsdata; + struct kobject *kobj = dentry->d_parent->d_fsdata; - return attr->write(kobj,buffer); + return attr->write(kobj, buffer, offset, count); } static ssize_t write(struct file * file, const char * userbuf, size_t count, loff_t * off) { - struct sysfs_bin_buffer * buffer = file->private_data; + char *buffer = file->private_data; + struct dentry *dentry = file->f_dentry; + int size = dentry->d_inode->i_size; + loff_t offs = *off; int ret; - if (count > PAGE_SIZE) - count = PAGE_SIZE; - buffer->count = count; - - ret = alloc_buf_data(buffer); - if (ret) - goto Done; + if (offs > size) + return 0; + if (offs + count > size) + count = size - offs; - ret = fill_write(file,userbuf,buffer); - if (ret) + ret = -EFAULT; + if (copy_from_user(buffer + offs, userbuf, count)) goto Done; - ret = flush_write(file,userbuf,buffer); - if (ret > 0) - *off += count; + count = flush_write(dentry, buffer, offs, count); + if (count > 0) + *off = offs + count; + ret = 0; Done: - if (buffer->data) { - kfree(buffer->data); - buffer->data = NULL; - } return ret; } -static int check_perm(struct inode * inode, struct file * file) +static int open(struct inode * inode, struct file * file) { struct kobject * kobj = kobject_get(file->f_dentry->d_parent->d_fsdata); struct bin_attribute * attr = file->f_dentry->d_fsdata; - struct sysfs_bin_buffer * buffer; - int error = 0; + int error = -EINVAL; if (!kobj || !attr) - goto Einval; - - /* File needs write support. - * The inode's perms must say it's ok, - * and we must have a store method. - */ - if (file->f_mode & FMODE_WRITE) { - if (!(inode->i_mode & S_IWUGO) || !attr->write) - goto Eaccess; - } - - /* File needs read support. - * The inode's perms must say it's ok, and we there - * must be a show method for it. - */ - if (file->f_mode & FMODE_READ) { - if (!(inode->i_mode & S_IRUGO) || !attr->read) - goto Eaccess; - } - - buffer = kmalloc(sizeof(struct sysfs_bin_buffer),GFP_KERNEL); - if (buffer) { - memset(buffer,0,sizeof(struct sysfs_bin_buffer)); - file->private_data = buffer; - } else - error = -ENOMEM; - goto Done; + goto Done; - Einval: - error = -EINVAL; - goto Done; - Eaccess: error = -EACCES; + if ((file->f_mode & FMODE_WRITE) && !attr->write) + goto Done; + if ((file->f_mode & FMODE_READ) && !attr->read) + goto Done; + + error = -ENOMEM; + file->private_data = kmalloc(attr->size, GFP_KERNEL); + if (!file->private_data) + goto Done; + + error = 0; + Done: if (error && kobj) kobject_put(kobj); return error; } -static int open(struct inode * inode, struct file * file) -{ - return check_perm(inode,file); -} - static int release(struct inode * inode, struct file * file) { struct kobject * kobj = file->f_dentry->d_parent->d_fsdata; @@ -173,8 +121,7 @@ if (kobj) kobject_put(kobj); - if (buffer) - kfree(buffer); + kfree(buffer); return 0; } diff -urN linux-2.5.69-bk10/include/asm-i386/mach-visws/mach_apic.h linux-2.5.69-bk11/include/asm-i386/mach-visws/mach_apic.h --- linux-2.5.69-bk10/include/asm-i386/mach-visws/mach_apic.h 2003-05-16 04:44:30.000000000 -0700 +++ linux-2.5.69-bk11/include/asm-i386/mach-visws/mach_apic.h 2003-05-16 04:44:39.000000000 -0700 @@ -19,6 +19,14 @@ #define check_apicid_used(bitmap, apicid) (bitmap & (1 << apicid)) #define check_apicid_present(bit) (phys_cpu_present_map & (1 << bit)) +#define APIC_ID_MASK (0xF<<24) + +static inline unsigned get_apic_id(unsigned long x) +{ + return (((x)>>24)&0xF); +} +#define GET_APIC_ID(x) get_apic_id(x) + static inline int apic_id_registered(void) { return (test_bit(GET_APIC_ID(apic_read(APIC_ID)), diff -urN linux-2.5.69-bk10/include/linux/device.h linux-2.5.69-bk11/include/linux/device.h --- linux-2.5.69-bk10/include/linux/device.h 2003-05-04 16:53:41.000000000 -0700 +++ linux-2.5.69-bk11/include/linux/device.h 2003-05-16 04:44:39.000000000 -0700 @@ -29,13 +29,14 @@ #include #include #include +#include #include #include #define DEVICE_NAME_SIZE 50 #define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */ #define DEVICE_ID_SIZE 32 -#define BUS_ID_SIZE 20 +#define BUS_ID_SIZE KOBJ_NAME_LEN enum { @@ -388,6 +389,8 @@ char * name; u32 id; struct device dev; + u32 num_resources; + struct resource * resource; }; extern int platform_device_register(struct platform_device *); diff -urN linux-2.5.69-bk10/include/linux/mm.h linux-2.5.69-bk11/include/linux/mm.h --- linux-2.5.69-bk10/include/linux/mm.h 2003-05-16 04:44:30.000000000 -0700 +++ linux-2.5.69-bk11/include/linux/mm.h 2003-05-16 04:44:39.000000000 -0700 @@ -111,10 +111,14 @@ #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ +#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ +#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS +#endif + #ifdef CONFIG_STACK_GROWSUP -#define VM_STACK_FLAGS (VM_GROWSUP | VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT) +#define VM_STACK_FLAGS (VM_GROWSUP | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) #else -#define VM_STACK_FLAGS (VM_GROWSDOWN | VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT) +#define VM_STACK_FLAGS (VM_GROWSDOWN | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) #endif #define VM_READHINTMASK (VM_SEQ_READ | VM_RAND_READ) @@ -426,7 +430,8 @@ extern int make_pages_present(unsigned long addr, unsigned long end); extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); extern long sys_remap_file_pages(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long nonblock); - +void put_dirty_page(struct task_struct *tsk, struct page *page, + unsigned long address, pgprot_t prot); int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); diff -urN linux-2.5.69-bk10/include/linux/smp.h linux-2.5.69-bk11/include/linux/smp.h --- linux-2.5.69-bk10/include/linux/smp.h 2003-05-04 16:53:31.000000000 -0700 +++ linux-2.5.69-bk11/include/linux/smp.h 2003-05-16 04:44:39.000000000 -0700 @@ -74,10 +74,6 @@ */ extern int smp_threads_ready; -extern volatile unsigned long smp_msg_data; -extern volatile int smp_src_cpu; -extern volatile int smp_msg_id; - #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ #define MSG_ALL 0x8001 diff -urN linux-2.5.69-bk10/include/linux/spinlock.h linux-2.5.69-bk11/include/linux/spinlock.h --- linux-2.5.69-bk10/include/linux/spinlock.h 2003-05-04 16:53:15.000000000 -0700 +++ linux-2.5.69-bk11/include/linux/spinlock.h 2003-05-16 04:44:39.000000000 -0700 @@ -79,10 +79,10 @@ do { \ CHECK_LOCK(x); \ if ((x)->lock&&(x)->babble) { \ + (x)->babble--; \ printk("%s:%d: spin_lock(%s:%p) already locked by %s/%d\n", \ __FILE__,__LINE__, (x)->module, \ (x), (x)->owner, (x)->oline); \ - (x)->babble--; \ } \ (x)->lock = 1; \ (x)->owner = __FILE__; \ @@ -95,10 +95,10 @@ ({ \ CHECK_LOCK(x); \ if ((x)->lock&&(x)->babble) { \ + (x)->babble--; \ printk("%s:%d: spin_is_locked(%s:%p) already locked by %s/%d\n", \ __FILE__,__LINE__, (x)->module, \ (x), (x)->owner, (x)->oline); \ - (x)->babble--; \ } \ 0; \ }) @@ -109,10 +109,10 @@ ({ \ CHECK_LOCK(x); \ if ((x)->lock&&(x)->babble) { \ + (x)->babble--; \ printk("%s:%d: spin_trylock(%s:%p) already locked by %s/%d\n", \ __FILE__,__LINE__, (x)->module, \ (x), (x)->owner, (x)->oline); \ - (x)->babble--; \ } \ (x)->lock = 1; \ (x)->owner = __FILE__; \ @@ -124,10 +124,10 @@ do { \ CHECK_LOCK(x); \ if ((x)->lock&&(x)->babble) { \ + (x)->babble--; \ printk("%s:%d: spin_unlock_wait(%s:%p) owned by %s/%d\n", \ __FILE__,__LINE__, (x)->module, (x), \ (x)->owner, (x)->oline); \ - (x)->babble--; \ }\ } while (0) @@ -135,9 +135,9 @@ do { \ CHECK_LOCK(x); \ if (!(x)->lock&&(x)->babble) { \ + (x)->babble--; \ printk("%s:%d: spin_unlock(%s:%p) not locked\n", \ __FILE__,__LINE__, (x)->module, (x));\ - (x)->babble--; \ } \ (x)->lock = 0; \ } while (0) diff -urN linux-2.5.69-bk10/include/linux/sysfs.h linux-2.5.69-bk11/include/linux/sysfs.h --- linux-2.5.69-bk10/include/linux/sysfs.h 2003-05-04 16:53:12.000000000 -0700 +++ linux-2.5.69-bk11/include/linux/sysfs.h 2003-05-16 04:44:39.000000000 -0700 @@ -16,18 +16,11 @@ mode_t mode; }; -struct sysfs_bin_buffer { - u8 * data; - size_t size; - size_t count; - loff_t offset; -}; - struct bin_attribute { struct attribute attr; size_t size; - ssize_t (*read)(struct kobject *, struct sysfs_bin_buffer *); - ssize_t (*write)(struct kobject *, struct sysfs_bin_buffer *); + ssize_t (*read)(struct kobject *, char *, loff_t, size_t); + ssize_t (*write)(struct kobject *, char *, loff_t, size_t); }; struct sysfs_ops { diff -urN linux-2.5.69-bk10/lib/kobject.c linux-2.5.69-bk11/lib/kobject.c --- linux-2.5.69-bk10/lib/kobject.c 2003-05-04 16:53:41.000000000 -0700 +++ linux-2.5.69-bk11/lib/kobject.c 2003-05-16 04:44:39.000000000 -0700 @@ -290,7 +290,11 @@ if (kobj) { kobject_init(kobj); error = kobject_add(kobj); - WARN_ON(error); + if (error) { + printk("kobject_register failed for %s (%d)\n", + kobj->name,error); + dump_stack(); + } } else error = -EINVAL; return error; diff -urN linux-2.5.69-bk10/sound/core/info.c linux-2.5.69-bk11/sound/core/info.c --- linux-2.5.69-bk10/sound/core/info.c 2003-05-16 04:44:31.000000000 -0700 +++ linux-2.5.69-bk11/sound/core/info.c 2003-05-16 04:44:40.000000000 -0700 @@ -1080,7 +1080,7 @@ entry->p = p; up(&info_mutex); - if (strncmp(name, "controlC", 8) == 0) /* created in sound.c */ + if (strncmp(name, "controlC", 8) != 0) /* created in sound.c */ devfs_mk_cdev(MKDEV(_major, minor), mode, "snd/%s", name); return entry; }