We used to lock (ind mod use count) all drivers just in case, but
it makes more sense to only lock the one we're just using, in
particular since the old scheme was rather broken when insmod'ing
a new driver later.
Again, use a per ttyI timer handler to feed arrived data into the
ttyI. Really, there shouldn't be the need for any timer at all,
rather working flow control, but that'll take a bit to fix.
ISDN: New timer handling for "+++" escape sequence
Instead of having one common timer and walking the list of
all ISDN channels, which might be possibly associated with a
ttyI and even more possibly so waiting for the silence period
after "+++", just use a per ttyI timer, which only gets activated
when necessary.
The common way in the kernel is to pass around the struct (e.g.
struct net_device), and leave the user the possibility to add
its private data using ::priv, so do it the same way when accessing
an ISDN channel.
ISDN: stat_callback() and recv_callback() -> event_callback()
Merge the two different types of callbacks into just one, there's no
good reasons for the receive callback to be different, in particular since
we pass things through the same state machine later anyway.
For some reason, isdnloop didn't support the transparent encoding,
which is necessary for testing V.110. Testing also found a typo
causing an oops in isdn_common.c. Fixed.
It'd probably make more sense to provide it in library form
to the hardware drivers which don't support V.110 natively, but for
now it's at least collected in one place.
ISDN: Move the tty receive queue out of generic code
Moving the tty receive queue into the tty-specific data in fact
simplifies the common code (which doesn't need to know it at all, now),
and the tty code, which can access the queue more directly.
ISDN: Route all driver callbacks through the driver state machine
We used to intercept status callbacks which were for specific channels
instead of the driver before passing them to the driver and short-cutting
to them to the per-channel state machine. Do it correctly for now,
i.e. callback -> driver -> channel, even though that might have a small
performance hit. Correctness first.
ISDN: Remove ttyI specific from global "dev" variable
ISDN still has a huge global struct called "dev", which is a mess
of parts which should be private to their respective subsystem.
It's supposed to die, this is another step in making that happen.
Change the incoming call logic: Incoming calls are signalled to
the net interface code first, then the tty code. It's the lower level's
responsibility to claim the call by issueing ISDN_CMD_ACCEPTD now.
Remove some crud which is handled by isdn_common state machines now.
They were never used except for passing the state to userspace,
but not used in any application I know of. If necessary, the information
can easily be recovered by looking at fi.state == ST_ACTIVE
Since we unfortunately cannot rely on the hardware drivers to get
their states always correct, have the common layer keep track of the
states and sanitize them before passing them on to applications
as network interfaces / ttyIs.
It's useless information, we need to iterate over all potential
drivers anyway, since possibly the first one has unregistered before
the second, leaving a hole.
ISDN: Make array of drivers private to isdn_common.c
Currently, we need to provide a couple of helper functions to avoid
breaking isdn_tty with this change, as that gets cleaned up, the need
for those helpers should vanish as well.
read() should be safe against missed wake-ups now. These devices
should actually be implemented by the hardware drivers directly, would
make for much cleaner code. Unfortunately, isdnctrl is
using /dev/isdnctrl for the common ioctls, which are handled by the link
layer, so that's not easily possible. Too bad.
ISDN: Make raw-IP, CISCO HDLC, ... support optional
They'll still get compiled all into one module, but now you can choose
what you need - it's not hard to go from here to individual modules,
but most protocol-specific code is so small that it's probably not worth
it.
Though I've been mostly moving stuff out of include/linux and into
drivers/isdn/i4l, the finite state machine definitions actually need
to be more wildly accessible, so they go the opposite way.
ISDN: Fix the workqueue changes for the HiSax driver
Whoever did the tqueue -> workqueue changes didn't really care to look
at how it was used in the HiSax driver, making the driver compile but
oops with NULL pointer derefs.
Oh, and workqueues are really not the right solution here, tasklets are.
But that's for later.
The reset routines are not called concurrently with other call paths,
and holding a spinlock over schedule_timeout() is plain wrong anyway.
Unfortunately, there's still quite a lot of cli() etc left, which however
are not so easy to kill since they protect IRQ handlers against filling
the tx queue, but don't even live in the same file.
Andrew Morton [Mon, 28 Oct 2002 08:00:36 +0000 (00:00 -0800)]
[PATCH] RCU idle detection fix
Patch from Dipankar Sarma <dipankar@in.ibm.com>
There is a check in RCU for idle CPUs which signifies quiescent state
(and hence no reference to RCU protected data) which was broken when
interrupt counters were changed to use thread_info->preempt_count.
Martin's 32 CPU machine with many idle CPUs was not completing any RCU
grace period because RCU was forever waiting for idle CPUs to context
switch. Had the idle check worked, this would not have happened. With
no RCU happening, the dentries were getting "freed" (dentry stats
showing that) but not getting returned to slab. This would not show up
in systems that are generally busy as context switches then would
happen in all CPUs and the per-CPU quiescent state counter would get
incremented during context switch.
Andrew Morton [Mon, 28 Oct 2002 08:00:27 +0000 (00:00 -0800)]
[PATCH] fix failure to write ext2 indirects under load
This patch fixes a filesystem corrupting bug, present in 2.5.41 through
2.5.44. It can cause ext2 indirect blocks to not be written out. A
fsck will fix it up.
Under heavy memory pressure a PF_MEMALLOC task attemtps to write out a
blockdev page whose buffers are already under writeback and which were
dirtied while under writeback.
The writepage call returns -EAGAIN but because the caller is
PF_MEMALLOC, the page was not being marked dirty again.
The page sits on mapping->clean_pages for ever and it not written out.
The fix is to mark that page dirty again for all callers, regardless of
PF_MEMALLOC state.
Linus Torvalds [Mon, 28 Oct 2002 07:10:58 +0000 (23:10 -0800)]
Merge penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/alan
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
kbuild: Allow UTS_MACHINE to be different from $(ARCH)
parisc builds parisc / parisc64 from arch/parisc, but wants different
strings for uname -m, which it can now provide by overwriting
UTS_MACHINE in arch/parisc/Makefile.
Alan Cox [Mon, 28 Oct 2002 06:48:18 +0000 (22:48 -0800)]
[PATCH] Digital TV framework
DVB is very different in its need to analogue video. This merges the
cleaned up version of the DVB framework from Convergence, which has been
around for a couple of years.