Rusty Russell [Sun, 9 Feb 2003 11:00:00 +0000 (03:00 -0800)]
[PATCH] remove LinuxVersionCode from de4x5.h
From: Adrian Bunk <bunk@fs.tum.de>
drivers/net/tulip/de4x5.h in 2.5.54 contains a definition of
LinuxVersionCode. LinuxVersionCode isn't used and it's anyway obsoleted
by KERNEL_VERSION in version.h.
Rusty Russell [Sun, 9 Feb 2003 10:59:46 +0000 (02:59 -0800)]
[PATCH] Fix return code of init_module in drivers_net_arlan.c (2)
From: Pablo Menichini <pablo@menichini.com.ar>
This patch returns correct error codes if init_modules fail.
Because of this, we can take the printks indicating the error as these
corrected error codes return miningfull information.
Rusty Russell [Sun, 9 Feb 2003 10:59:32 +0000 (02:59 -0800)]
[PATCH] RTC alarm and wildcards
(Included in 2.4)
From: Paul Gortmaker <p_gortmaker@yahoo.com>
Summary: Wildcards in RTC alarm settings failed to work
Description:
The RTC has provision for wildcards when setting the alarm; to
use them you have to write a value higher than 0xc0 to the
appropriate hr/min/sec entry. The driver used 0xff, which is
fine, but it mistakenly fed the 0xff through BIN_TO_BCD before
writing them (which is < 0xc0) and so wildcards didn't work.
(Thanks to Gerhard Kurz for reporting the bug.)
Rusty Russell [Sun, 9 Feb 2003 10:58:40 +0000 (02:58 -0800)]
[PATCH] scripts_ver_linux
From: Frank Davis <fdavis@si.rr.com>
The ver_linux script is still using rmmod to determine
module-init-tools version. The following patch uses depmod,
which produces the appropriate result.
Rusty Russell [Sun, 9 Feb 2003 10:58:12 +0000 (02:58 -0800)]
[PATCH] remove check_region from drivers_net_irda_irport.c
From: william stinson <wstinson@wanadoo.fr>
this patch for drivers/net/irda/irport.c IRDA driver removes one call
to check_region using request_region instead. The patch also moves
the call to request_region to before the allocation of the driver
instance.
Jaroslav Kysela [Sun, 9 Feb 2003 20:47:59 +0000 (21:47 +0100)]
ALSA update
- moved inclusion of <linux/interrupt.h> from <sound/asound.h> to <sound/timer.h>
- pmac driver - removed beep stuff for 2.5 kernels
- USB driver - fixed compilation
James Bottomley [Sun, 9 Feb 2003 04:07:51 +0000 (22:07 -0600)]
[SCSI] Migrate sim710 to 53c700 chip driver
This should add synchronous support and Tagged Command Queueing.
At the moment, it cuts down on the number of command line options,
but we can add those back in later.
This patch also migrates the driver to the new device model for
both MCA and EISA.
James Bottomley [Sun, 9 Feb 2003 03:36:18 +0000 (21:36 -0600)]
Restore device command queue functionality
The recent slab allocation changes mean that we no longer keep a
permanent list of commands on the device_queue list. However,
certain pieces of SCSI code relied on being able to traverse this
list to find details of all outstanding commands (the error handler
being the prime example). This code adds back a new dynamic cmd_list
which keeps the list of commands currently allocated to the device.
Since the list is dynamic, it is protected by a lock (list_lock).
Jamie Lokier [Sat, 8 Feb 2003 18:41:34 +0000 (10:41 -0800)]
[PATCH] CONFIG_PREEMPT fix of do_debug()
If CONFIG_PREEMPT is enabled, and the kernel is preempted just before
do_debug() has a chance to save the debug register values, DR6 could be
read from the wrong CPU.
It is exactly the same problem as reading %cr2 in the page fault
handler. Same fix: make the handler a interrupt gate, and enable
interrupts only once safe.
Linus Torvalds [Sat, 8 Feb 2003 14:02:27 +0000 (06:02 -0800)]
More signal handling fixups for the threaded signal fix upheavals.
This fixes the signal code to not wake up threads with blocked signals,
especially noticeable with kernel threads that may not be able to handle
signals at all.
We also don't unnecessarily wake processes in TASK_UNINTERRUPTIBLE.
kbuild: Add a bug trap for people playing with SUBDIRS too much
If SUBDIRS is set manually on the command line, the contents of
.tmp_versions are not deleted before descending and can accumulate
stale entries. Print a warning if that case is detected, but deal with
it gracefully.
We're still using the old genksyms binary, that's why we have to
postprocess the output to convert it into a linker script - that
postprocessing got confused by "__verify_write".
Kick out the grep, do it all and correctly within sed.
Setting export-objs is not necessary anymore, so warn on encountering it
to prevent it from creeping back in ;)
Also, make the error when we find someone still using O_TARGET non-fatal,
so that people sharing stuff between 2.4 and 2.5 don't have more hassle
than necessary.
We need to collect a list of all modules during the recursive build. I used
a "touch .tmp_versions/<path/to/module.ko>" to do so, which however doesn't
work so well, when path/to isn't inside the kernel tree.
The best way to build external modules is currently using kbuild by saying
"make SUBDIRS=/some/external/dir modules", which was thus broken. While this
way is not all that optimal and I hope to come up with something better
before 2.6, it works and should keep working, so this patch fixes the usage
above.
Instead of touching files with the entire path added, we just create a
<module>.mod file in $(MODVERDIR) now, and save the path to the module.ko
in it. Since module names are unique, a flat hierarchy is actually fine here.
Roland McGrath [Fri, 7 Feb 2003 08:31:37 +0000 (00:31 -0800)]
[PATCH] TASK_STOPPED wakeup cleanup
For handle_stop_signal to do the special case for SIGKILL and have it
work right in all SMP cases (without changing all the existing ptrace
stops), it needs to at least set TIF_SIGPENDING on each thread before
resuming it.
handle_stop_signal addresses a related race for SIGCONT by setting
TIF_SIGPENDING already, so having SIGKILL handled the same way makes
sense.
Now it seems pretty clean to have handle_stop_signal resume threads for
SIGKILL, and have on SIGKILL special case in group_send_sig_info.
There is also an SMP race issue with cases like do_syscall_trace, i.e.
TASK_STOPPED state set without holding the siglock. So I think
handle_stop_signal should call wake_up_process unconditionally.
Linus Torvalds [Fri, 7 Feb 2003 04:25:24 +0000 (20:25 -0800)]
Split up "struct signal_struct" into "signal" and "sighand" parts.
This is required to get make the old LinuxThread semantics work
together with the fixed-for-POSIX full signal sharing. A traditional
CLONE_SIGHAND thread (LinuxThread) will not see any other shared
signal state, while a new-style CLONE_THREAD thread will share all
of it.
This way the two methods don't confuse each other.
Roland McGrath [Fri, 7 Feb 2003 00:22:30 +0000 (16:22 -0800)]
[PATCH] do_sigaction locking cleanup
This changes do_sigaction to avoid read_lock(&tasklist_lock) on every
call. Only in the fairly uncommon cases where it's really needed will
it take that lock (which requires unlocking and relocking the siglock
for locking order).
I also changed the ERESTARTSYS added in my earlier patch to ERESTARTNOINTR.
That is an "instantaneous" case, and there is no reason to have it possibly
return EINTR if !SA_RESTART (which AFAIK sigaction never could before, and
it might not be kosher by POSIX); rollback is always better.
Andrew Morton [Thu, 6 Feb 2003 08:22:04 +0000 (00:22 -0800)]
[PATCH] revert extra sendfile security hook patch
hm. It seems that I sent this patch twice.
After resyncing with your tree I go through and try to reapply all the sent
patches, throwing out the ones which get a lot of rejects. Just to make sure
that everything got through OK.
But it appears that that particular patch happily applied on top of itself,
so I assumed it was not applied...
Roland McGrath [Thu, 6 Feb 2003 07:39:31 +0000 (23:39 -0800)]
[PATCH] Make sys_wait4() more readable
I cleaned up sys_wait4; it was straightforward and I think a definite
improvement. While at it, I noticed that one of the races I fixed in the
TASK_STOPPED case actually can happen earlier. Between read_unlock and
write_lock_irq, another thread could reap the process and make P invalid,
so now I do get_task_struct before read_unlock and then the existing race
checks catch all scenarios.
Aside from the aforementioned race tweak, the code should be the same as
in the previous patch (that Ingo and I have tested more thoroughly)
modulo being moved into functions and some reformatting and comment
changes.
Oh, my old patch had one case where it failed to retake the read lock after
a race bailout that I just noticed reading over it. That's fixed too.
These exit fixes were something I noticed incidentally and spent less time
on than the signals changes. Another few passes of eyeballs over them are
certainly warranted. (In particular, there are code paths like that one
that check for specific races that have probably never been seen in
practice, so those code paths have never run once.)
Matthew Dobson [Thu, 6 Feb 2003 06:55:32 +0000 (22:55 -0800)]
[PATCH] Broken CLEAR_BITMAP() macro
The CLEAR_BITMAP() macro in include/linux/types.h is broken and doesn't
round the bitmap size to the proper 'long' boundary.
This fixes it by creating a macro BITS_TO_LONGS that just rounds a
number of bits up to the closest number of unsigned longs. This makes
the DECLARE & CLEAR _BITMAP macros more readable and fixes the bug.
Ingo Molnar [Thu, 6 Feb 2003 04:49:30 +0000 (20:49 -0800)]
[PATCH] signal-fixes-2.5.59-A4
this is the current threading patchset, which accumulated up during the
past two weeks. It consists of a biggest set of changes from Roland, to
make threaded signals work. There were still tons of testcases and
boundary conditions (mostly in the signal/exit/ptrace area) that we did
not handle correctly.
- fix signal delivery race with do_exit() => signals are re-queued to the
'process' if do_exit() finds pending unhandled ones. This prevents
signals getting lost upon thread-sys_exit().
- a non-main thread has died on one processor and gone to TASK_ZOMBIE,
but before it's gotten to release_task a sys_wait4 on the other
processor reaps it. It's only because it's ptraced that this gets
through eligible_child. Somewhere in there the main thread is also
dying so it reparents the child thread to hit that case. This means
that there is a race where P might be totally invalid.
- forget_original_parent is not doing the right thing when the group
leader dies, i.e. reparenting threads to init when there is a zombie
group leader. Perhaps it doesn't matter for any practical purpose
without ptrace, though it makes for ppid=1 for each thread in core
dumps, which looks funny. Incidentally, SIGCHLD here really should be
p->exit_signal.
- one of the gdb tests makes a questionable assumption about what kill
will do when it has some threads stopped by ptrace and others running.
exit races:
1. Processor A is in sys_wait4 case TASK_STOPPED considering task P.
Processor B is about to resume P and then switch to it.
While A is inside that case block, B starts running P and it clears
P->exit_code, or takes a pending fatal signal and sets it to a new
value. Depending on the interleaving, the possible failure modes are:
a. A gets to its put_user after B has cleared P->exit_code
=> returns with WIFSTOPPED, WSTOPSIG==0
b. A gets to its put_user after B has set P->exit_code anew
=> returns with e.g. WIFSTOPPED, WSTOPSIG==SIGKILL
A can spend an arbitrarily long time in that case block, because
there's getrusage and put_user that can take page faults, and
write_lock'ing of the tasklist_lock that can block. But even if it's
short the race is there in principle.
2. This is new with NPTL, i.e. CLONE_THREAD.
Two processors A and B are both in sys_wait4 case TASK_STOPPED
considering task P.
Both get through their tests and fetches of P->exit_code before either
gets to P->exit_code = 0. => two threads return the same pid from
waitpid.
In other interleavings where one processor gets to its put_user after
the other has cleared P->exit_code, it's like case 1(a).
3. SMP races with stop/cont signals
First, take:
kill(pid, SIGSTOP);
kill(pid, SIGCONT);
or:
kill(pid, SIGSTOP);
kill(pid, SIGKILL);
It's possible for this to leave the process stopped with a pending
SIGCONT/SIGKILL. That's a state that should never be possible.
Moreover, kill(pid, SIGKILL) without any repetition should always be
enough to kill a process. (Likewise SIGCONT when you know it's
sequenced after the last stop signal, must be sufficient to resume a
process.)
4. take:
kill(pid, SIGKILL); // or any fatal signal
kill(pid, SIGCONT); // or SIGKILL
it's possible for this to cause pid to be reaped with status 0
instead of its true termination status. The equivalent scenario
happens when the process being killed is in an _exit call or a
trap-induced fatal signal before the kills.
plus i've done stability fixes for bugs that popped up during
beta-testing, and minor tidying of Roland's changes:
- a rare tasklist corruption during exec, causing some very spurious and
colorful crashes.
- a copy_process()-related dereference of already freed thread structure
if hit with a SIGKILL in the wrong moment.
- SMP spinlock deadlocks in the signal code
this patchset has been tested quite well in the 2.4 backport of the
threading changes - and i've done some stresstesting on 2.5.59 SMP as
well, and did an x86 UP testcompile + testboot as well.
David Jeffery [Thu, 6 Feb 2003 02:23:48 +0000 (18:23 -0800)]
[PATCH] ips driver 4/4: error messages
This small patch does 2 things. It reworks the firmware/driver
versioning messages to make them more understandable, and it
fixes one case where the 64bit addressing changes caused
error/success to not be properly reported to the serveraid tools.
David Jeffery [Thu, 6 Feb 2003 02:23:35 +0000 (18:23 -0800)]
[PATCH] ips driver 2/4: initialization reordering
This large patch reworks much of the adapter initialization
code.
It splits the scsi initialization code from the pci
initialization. It adds support for working with some
future cards. It also removes the use of multiple pci_driver
registrations and instead does its own adapter ordering.
David Jeffery [Thu, 6 Feb 2003 02:23:29 +0000 (18:23 -0800)]
[PATCH] ips driver 1/4: fix struct length and remove dead code
This small patch fixes the length of the IPS_ENQ
struct. It was too short which can cause the adapter
to write beyond the the end of the struct during
driver initialization and corrupt part of memory.