Patrick Mochel [Thu, 14 Aug 2003 05:34:30 +0000 (22:34 -0700)]
[driver model] Allow per-device shutdown or suspend on driver detach.
- Add struct device::detach_state, which tells the core what state to put
the device in when it's detached from its driver (on module removal).
This is a value in the range of 0-4, with 0 being On and meaning 'Do
Nothing', 4 being Off, meaing calling ->shutdown() for the device, and
1-3 being low-power states, meaning call ->suspend() for the device.
- Add per-device sysfs file 'detach_state' to control the value of the
field.
- Add device_device_shutdown() function, and call it from bus.c::
device_detach_driver().
Corey Minyard [Wed, 13 Aug 2003 16:47:17 +0000 (09:47 -0700)]
[PATCH] IPMI updates for 2.6.0-test3
Here are some minor updates to the IPMI driver. They fix the following:
* A missing check for copy_to_user() in the watchdog driver.
* Removal of unnecessary check_region() calls.
* Fixes for the ACPI configuration. The previous one would only work
with memory addresses, this will work with memory addresses,
ports, and hadle checking that the type is correct.
Neil Brown [Wed, 13 Aug 2003 16:38:25 +0000 (09:38 -0700)]
[PATCH] Fix bug in sunrpc/server code.
When a socket has a request ready it notifies a server thread.
When the thread has 'received' the request it calls svc_sock_received
to confirm the fact.
In some cases, svc_sock_received would be called an extra time and
this could lead to linked-list corruption and bad problems.
Andi Kleen [Wed, 13 Aug 2003 16:38:10 +0000 (09:38 -0700)]
[PATCH] x86-64 merge for 2.6.0test3
Without these changes an x86-64 NUMA kernel won't boot in many
configurations.
The main change is the improved IOMMU code which supports merging of
mappings and has various bugfixes.
- Update defconfig
- Use argument ptregs in 32bit elf_core_copy_task_fpregs
- Harden aperture fixup code: read aperture from the AGP bridge if needed,
better error checking.
- Support nmi_watchdog=panic to panic on watchdog trigger
- IOMMU: Support panic on IOMMU overflow (iommu=panic)
- IOMMU: Force SAC for mappings >40bits when iommu=force is active
(this can potentially give better performance)
- IOMMU: Cache northbridges for faster TLB flush
- IOMMU: Fix SMP race in TLB flush
- IOMMU: Merge pci_alloc_consistent and pci_map_single
- IOMMU: Clean up leak tracing
- IOMMU: Rewrite pci_map_sg, support merging of mappings
On overflow fall back to piece-by-piece mapping.
- IOMMU: Tell block layer to assume merging when iommu force is active
(this gives better performance with MTP fusion, drawback is that the
overflow/fragmentation handling of the IOMMU area is still a big
dubious with that)
- Fix/clean up per cpu data
- Add 64bit clean time(2)
- Export cpu_callout_map for IPv6
- Handle nodes with no own memory in NUMA discovery.
This fixes boot on various newer Opteron motherboards where the memory
is only connected to a single CPU.
- Fix fallback path for failed NUMA discovery. numnodes has to be reset.
- Check for enabled nodes in NUMA discovery (Eric Biederman)
- Remove NUMA emunodes support. Has badly bitrotted.
- Add __clear_bit_string for IOMMU code
- Add new 32bit system calls to ia32_unistd.h
- Remove duplicate default_do_nmi prototype
- Make PCI_DMA_BUS_IS_PHYS dependent on no_iommu
- Fix padding length of siginfo_t to match glibc
- More pci direct access functions.
Muli Ben-Yehuda [Wed, 13 Aug 2003 16:37:54 +0000 (09:37 -0700)]
[PATCH] fix trident.c lockup on module load 2.6.0-test2
This patch fixes a kernel lockup with 2.6.0-test2 when the trident.c
OSS driver is loaded and the driver attempts to initialize the
card. The problem is that in ali_ac97_get() we lock the card->lock
spinlock, but never release it on the good path, only on the error
path. This patch adds the missing spin_unlock_irqrestore().
This bug snuck in in a 2.4 sync from Alan, and 2.4 appears to suffer
from the same problem. A patch for that will be send to Marcelo
momentarily.
Jamie Lokier [Wed, 13 Aug 2003 16:37:46 +0000 (09:37 -0700)]
[PATCH] Fix protocol bugs with NFS and nanoseconds
NFS with 2.5.75 as both client and server is broken with GNU Make.
The nanosecond field of timestamps of newly touched files is often
negative on the client, which is probably why Make fails. The value
also bears no relation to the file's nanosecond field on the server.
The culprit is htons() used where htonl() should be:
The rest of this patch corrects nfsd to use microseconds in NFSv2, not
nanoseconds. (The client already gets this right, but I have
optimised it slightly to avoid division when possible).
Matt Wilson [Wed, 13 Aug 2003 16:37:38 +0000 (09:37 -0700)]
[PATCH] zap_other_threads() detaches thread group leader
The change to detach the threads in zap_other_threads() broke the case
where the non-thread-group-leader is the cause of de_thread().
In this case the group leader will be detached and freed before
switch_exec_pids() is complete and invalid data will be used. This is a
patch that makes sure that the group leader does not get detached and
reaped.
This disables the local APIC before reboot. This fixes BIOS reboot
problems reported by a few people.
disable_local_APIC() now checks if detect_init_APIC() enabled the
local APIC via the APIC_BASE MSR, and if so it now disables APIC_BASE.
Previously we would leave APIC_BASE enabled, and that made some
BIOSen unhappy.
The SMP reboot code calls disable_local_APIC(). On SMP HW there is
no change since detect_init_APIC() isn't called and APIC_BASE isn't
enabled by us. An SMP kernel on UP HW behaves just like an UP_APIC
kernel, so it disables APIC_BASE if we enabled it at boot.
The UP_APIC disable-before-suspend code is simplified since the existing
code to disable APIC_BASE is moved into disable_local_APIC().
(Felix Kühling originally reported the BIOS reboot problem. This is a
fixed-up version of his preliminary patch.)
Dave Jones [Wed, 13 Aug 2003 16:08:35 +0000 (09:08 -0700)]
[PATCH] Fix x87 FPU exception status check
From Dave Richards (drichards@mahinetworks.com)
"While diagnosing an MMX/FPU problem I found a minor problem in the
code which diagnoses and generates signals for FPU exceptions. On
x86 Stack Fault Exception are a subclass of Invalid Operation. Thus,
the FPU status register will have both the SF and IF bits set when a
stack fault occurs. The code which turns FPU exceptions into signals
was assuming IF would be clear".
Patrick Mochel [Wed, 13 Aug 2003 04:59:26 +0000 (21:59 -0700)]
[power] Various swsusp cleanups.
- Move SMP check to software_suspend() (from software_resume()), so we will
not even attempt to sleep with it enabled.
- Make software_resume() a late initcall, removing the explicit call from
prepare_namespace().
- Initialize software_suspend_enabled to 1, instead of doing it manually in
software_resume().
- Don't explicitly initialzie resume_file.
- Remove resume_status variable, as we can simply check for (non-) NULL
resume_file string.
- "noresume" setup function changed to simply zero first byte of resume_file
string, simplifying logic.
- Don't attempt to reset swap signature if noresume is specified.
- Downstream function (bdev_write_page() wasn't implemented anyway, so we
can just remove that also).
If noresume is specified, there will still be a suspend image left on the
swap partition. It may behoove us to never reset the swap signature, and
always leave the image intact on the disk, since it is a valid snapshot
that we can resume from at anytime.
This unconditional behavior would force the user to add 'mkswap <part>' to
their init scripts to reset the partition to swap use. IMO, this is better
anyway.
Patrick Mochel [Wed, 13 Aug 2003 03:55:13 +0000 (20:55 -0700)]
[swsusp] Remove two panic()s.
- Make software_suspend() return an int, so caller can tell what happened.
- Do check for HIGHMEM and DISCONTIGMEM early in software_suspend() and
fail gracefully, instead of checking far down the call chain and having
to call panic().
Patrick Mochel [Tue, 12 Aug 2003 02:47:08 +0000 (19:47 -0700)]
[power] Begin to add sysfs files for controlling device power states.
- Moves sysfs controls to drivers/base/power/sysfs.c
- Creates dpm_sysfs_{add,remove} to add/remove sysfs attribute group.
- Creates 'state' file in 'pm' directory that properly controls device
power state at runtime.
Patrick Mochel [Tue, 12 Aug 2003 02:25:20 +0000 (19:25 -0700)]
[power] Add hooks for runtime device power control.
dpm_runtime_{suspend,resume} control the power state of a single device
while the system is running.
dpm_runtime_suspend() will save state of the device, then attempt to power
it down. This happens with interrupts enabled, so if the device does not
support that, the device's state is restored, and we continue on our merry
way.
dpm_runtime_resume() powers the device back on, then restores state of the
device.
dpm_set_power_state() simply notifies the core of the power state the
device is in. Drivers can use this, since they are the only ones that can
really tell.
Patrick Mochel [Tue, 12 Aug 2003 02:15:14 +0000 (19:15 -0700)]
[driver model] Check for probing errors in drivers/base/bus.c
From Janice Girouard.
Currently if an error is detected when probing a device,
this error is not reported. Generally, an error value from
errno.h will be returned when the driver->probe function
fails. However, these errors are not logged, and the device
fails silently.
Patrick Mochel [Sun, 10 Aug 2003 04:58:35 +0000 (21:58 -0700)]
[power] Add PM usage counting
- Add ->pm_users and ->pm_parent fields to struct dev_pm_info.
- Add function device_pm_set_parent()
The default power parent for a device is the device's physical parent, but
a driver may change it to represent a tranversal power dependency.
Though it's not incorporated into the suspend/resume sequences yet, the
core will respect the power tree, rather than the physical/electrical one.
Also added is a power usage count for devices, which indicates how many
devices are dependent on that one for power (how many children it has in
the power tree). The core will use this count to determine whether or not
a device can be put into a low power state or not.