[PATCH] remove ide_dma_queued_* ops from ide_hwif_t
TCQ code is host independent so remove redundant ide_dma_queued_* ops from
ide_hwif_t. If we ever decide to bring back TCQ support this will fix OOPS
in ide-disk driver with CONFIG_BLK_DEV_IDE_TCQ_DEFAULT=y and icside/sgiioc4
host drivers (it will also enable TCQ support for these host drivers).
[PATCH] fix 'cat /proc/ide/<cd|dvd>/identify' hang (CONFIG_IDE_TASKFILE=y)
Some devices need more time to become non-busy after command completion,
so use the same timeout in wait_drive_not_busy() (called from task_in_intr()
if CONFIG_IDE_TASKFILE_IO=y) as in drive_cmd_intr().
Thanks to Mark Haverkamp <markh@osdl.org> for help in fixing this.
Alexander Viro [Thu, 5 Feb 2004 01:47:21 +0000 (17:47 -0800)]
[PATCH] scsi/ppa.c cleanup and fixes (6/9)
* fixed missing wakeups in ppa_pb_claim()/ppa_wakeup() - if the
former had been called just as current holder of port was giving it up,
we could set "I'm waiting" flag too late. Cleaned up the timeout logics.
Alexander Viro [Thu, 5 Feb 2004 01:47:09 +0000 (17:47 -0800)]
[PATCH] scsi/ppa.c cleanup and fixes (5/9)
* starting to kill ppa_detect - we move the "probe a single port"
logics into a separate function and shift scanning into ppa_driver_init().
Later that will give us a parport_driver ->attach().
Alexander Viro [Thu, 5 Feb 2004 01:46:34 +0000 (17:46 -0800)]
[PATCH] scsi/ppa.c cleanup and fixes (4/9)
* killed include of scsi_module.h and switched from scsi_register()
to scsi_alloc_host(). We still keep the old detect logics at that point,
it will be gone later.
Alexander Viro [Thu, 5 Feb 2004 01:40:55 +0000 (17:40 -0800)]
[PATCH] scsi/imm.c cleanup and fixes (6/8)
* fixed missing wakeups in imm_pb_claim()/imm_wakeup() - if the
former had been called just as current holder of port was giving it up,
we could set "I'm waiting" flag too late. Cleaned up the timeout logics.
Alexander Viro [Thu, 5 Feb 2004 01:39:40 +0000 (17:39 -0800)]
[PATCH] scsi/imm.c cleanup and fixes (5/8)
* starting to kill imm_detect - we move the "probe a single port"
logics into a separate function and shift scanning into imm_driver_init().
Later that will give us a parport_driver ->attach().
Alexander Viro [Thu, 5 Feb 2004 01:38:20 +0000 (17:38 -0800)]
[PATCH] scsi/imm.c cleanup and fixes (4/8)
* killed include of scsi_module.h and switched from scsi_register()
to scsi_alloc_host(). We still keep the old detect logics at that point,
it will be gone later.
Alexander Viro [Thu, 5 Feb 2004 01:32:24 +0000 (17:32 -0800)]
[PATCH] paride cleanup and fixes (25/25)
paride has a ->private field for use by low-level drivers. It's not
64bit-clean - it's int, but is used to store a pointer (bpck6).
Fix: replace with unsigned long, update typecasts in users.
Alexander Viro [Thu, 5 Feb 2004 01:27:09 +0000 (17:27 -0800)]
[PATCH] paride cleanup and fixes (22/25)
Now disk->present is not needed - we can always check for disk->gd.
Field removed, pd_probe_drive() became void(struct pd_unit *), pd_detect()
cleaned up,
Alexander Viro [Thu, 5 Feb 2004 01:23:39 +0000 (17:23 -0800)]
[PATCH] paride cleanup and fixes (20/25)
Switched everything except pd_identify() to use of special requests.
New helper: pd_special_command() - builds special request, feeds it
into queue and waits for completion.
Moved pi_connect()/pi_disconnect() to the beginning/end of pi_identify.
Alexander Viro [Thu, 5 Feb 2004 01:22:02 +0000 (17:22 -0800)]
[PATCH] paride cleanup and fixes (19/25)
Reordered stuff
made pd_ready() inlined
renamed ps_timeout to pd_timeout
renamed ps_tq to fsm_tq
renamed ps_set_intr to fsm_schedule
removed unused pd_wait_open.
Alexander Viro [Thu, 5 Feb 2004 01:18:42 +0000 (17:18 -0800)]
[PATCH] paride cleanup and fixes (17/25)
Equivalent transformation:
now that all phase functions are called claimed, we can
simplify the logics around claiming - new variable (pd_claimed)
keeps track of claim/unclaim we'd done. We check it in the
beginning of the loop and do claiming if it's not set.
Alexander Viro [Thu, 5 Feb 2004 01:11:09 +0000 (17:11 -0800)]
[PATCH] paride cleanup and fixes (12/25)
Equivalent transformation:
* calls of pi_disconnect() in phase functions expanded.
* since both do_pd_read_start() and do_pd_write_start()
are always called claimed (as the matter of fact,
all phase functions except do_pd_io() are), we can
replace call of pi_connect() with direct method call -
pi_claim() is no-op there.
Alexander Viro [Thu, 5 Feb 2004 01:09:53 +0000 (17:09 -0800)]
[PATCH] paride cleanup and fixes (11/25)
Equivalent transformation:
* new type - enum action. phase functions return it now.
run_fsm() looks at the result of phase() and does the
corresponding action - next_request(), pi_do_claimed()
or ps_set_intr().
Alexander Viro [Thu, 5 Feb 2004 01:08:47 +0000 (17:08 -0800)]
[PATCH] paride cleanup and fixes (10/25)
Equivalent transformation:
* ps_continuation renamed - it's "phase" now.
* run_fsm() does what ps_tq_int() used to do
* calls of pi_do_claimed(..., func) replaced with
phase = func; pi_do_claimed(..., run_fsm);
Now all phase functions are called from run_fsm() and we
can start pulling the common code into it.
Alexander Viro [Thu, 5 Feb 2004 01:07:39 +0000 (17:07 -0800)]
[PATCH] paride cleanup and fixes (9/25)
Equivalent transformation:
do_pd_reqeust1() calls lambda-expanded, function killed.
resulting call of ps_set_intr() in next_request() has been
moved past dropping pd_lock.
Alexander Viro [Thu, 5 Feb 2004 01:06:25 +0000 (17:06 -0800)]
[PATCH] paride cleanup and fixes (8/25)
Equivalent transformation:
instead of having do_pd_request1() calling do_pd_io() via
pi_do_claimed() and do_pd_io() calling do_pd_io_start() via
ps_set_intr(), do it the other way round.
Alexander Viro [Thu, 5 Feb 2004 01:05:25 +0000 (17:05 -0800)]
[PATCH] paride cleanup and fixes (7/25)
Equivalent transformation:
Handling of bogus requests taken into do_pd_io_start() - we
call next_request(0) as we would for any other error. We
need to call pi_unclaim() before that - on other paths that
would happen as a side effect of pi_disconnect().
Setting variables moved into do_pd_io_start() - they don't
need pd_lock being held, so we can shift that outside.
Alexander Viro [Thu, 5 Feb 2004 01:04:29 +0000 (17:04 -0800)]
[PATCH] paride cleanup and fixes (6/25)
Equivalent transformation:
* new function: do_pd_io_start(). Checks pd_cmd and calls
do_pd_read_start() or do_pd_write_start().
* do_pd_read() and do_pd_write() merged into do_pd_io(), which
schedules execution of do_pd_io_start().
Alexander Viro [Thu, 5 Feb 2004 01:01:27 +0000 (17:01 -0800)]
[PATCH] paride cleanup and fixes (2/25)
Preparation to crapectomy - expanded include of pseudo.h, split
the part of pd_do_request() into pd_do_request1(), leaving in pd_do_request()
only the check that FSM is not running and call of pd_do_request1().
Added locking analysis - it's in drivers/block/paride/Transition-notes
and it will be used on the next step. Even though the subsequent steps are
small, they rely on properties of the damn thing and proof of these properties
is hairy. Amazing perversions people manage to produce when writing a trivial
FSM - the code is very convoluted for no good reason...
Alexander Viro [Thu, 5 Feb 2004 01:00:52 +0000 (17:00 -0800)]
[PATCH] paride cleanup and fixes (1/25)
* new helper: pi_schedule_claimed() - pi_do_claimed() sans the call
of continuation if we don't have to wait; returns 1 if we don't
have to wait and 0 otherwise.
Alexander Viro [Thu, 5 Feb 2004 01:00:21 +0000 (17:00 -0800)]
[PATCH] parport fixes (6/6)
daisy.c used to access the topology list with no locking whatsoever.
Protected by spinlock, fixed numerous bugs in handling of the single-linked
list (I'm not kidding - just take a look at the old parport_daisy_fini()
and weep; it is supposed to go through a simple list and remove all entries
that satisfy a condition).
Alexander Viro [Thu, 5 Feb 2004 00:59:29 +0000 (16:59 -0800)]
[PATCH] parport fixes (4/6)
parport_gsc.c turned into proper parisc driver; instead of scanning
the list of ports upon rmmod in search of ones that had been created by us,
we do cleanup where it belongs - in parisc driver ->remove().
Alexander Viro [Thu, 5 Feb 2004 00:59:07 +0000 (16:59 -0800)]
[PATCH] parport fixes (3/6)
A bunch of parport_enumerate() users was duplicating parport_find_...()
without proper locking. Replaced with use of appropriate helpers, races closed.
Alexander Viro [Thu, 5 Feb 2004 00:58:49 +0000 (16:58 -0800)]
[PATCH] parport fixes (2/6)
We use a new mutex to protect all additions/removals of drivers and
ports. That cures a lot of insanity:
* driver removals can't hit us in the middle of attach_driver_chain().
Old code simply dies on that.
* port removals can't hit us in the middle of driver registration.
Again, old code dies on that.
* driver ->detach() is allowed to block now.
* we are guaranteed that by the time when parport_unregister_driver()
returns, all ->detach() calls are finished. Old code did _not_ guarantee
that (read: was inherently racy since rmmod of driver could race with port
removal and get driver->detach(port) called after the module was gone).
* we are guaranteed that driver->attach(port) won't be called
more than once. With the old code that was a matter of luck.
* removed piles and piles of braindead code.
Alexander Viro [Thu, 5 Feb 2004 00:58:34 +0000 (16:58 -0800)]
[PATCH] parport fixes (1/6)
Current tree has all allocated ports on portlist. However,
most of the portlist users assume that we only have announced ports
there and break badly if they happen to see the list after port driver
has created a port (parport_register_port()) but before it finishes
the setup (and calls parport_announce_port()).
The only place that wants to see all allocated port is
parport_register_port() itself and only to pick the first unused
port number.
We add a new list (all_ports) and put ports there when allocated;
that list is kept ordered by port->number. Ports are placed on portlist
only by parport_announce_port().
Gobs of shite in parport_register_port() removed, pile of races
closed...
I didn't include that with the bitkeeper based PowerMac updates so Jeff
can assume his role as maintainer/filter of network driver updates :)
Here's my latest update to this pmac-only driver, please apply if you
are ok with it. The driver now uses the macio infrastructure for
detection & power management notifications, getting into sysfs at
the same time.
Ben.
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/01/23 09:38:35+11:00 benh@kernel.crashing.org
# Update PowerMac "bmac" driver to the "macio" device so it fits in sysfs
# and gets proper power management ordering
#
# drivers/net/bmac.c
# 2004/01/23 09:38:22+11:00 benh@kernel.crashing.org +185 -203
# Update PowerMac "bmac" driver to the "macio" device so it fits in sysfs
# and gets proper power management ordering
#
I've been chasing a weird SELinux bug which shows up mostly when doing
installs of a dev-* rpm (ie. creating and overwriting lots of block
device inodes), but which I've also seen when doing mkinitrd.
It turned out not to be an SELinux problem at all, but a core VFS
S_ISBLK bug. It seems that SELinux simply widens the race window.
The code at fault is fs/fs-writeback.c:__mark_inode_dirty():
/*
* Only add valid (hashed) inodes to the superblock's
* dirty list. Add blockdev inodes as well.
*/
if (!S_ISBLK(inode->i_mode)) {
if (hlist_unhashed(&inode->i_hash))
goto out;
if (inode->i_state & (I_FREEING|I_CLEAR))
goto out;
}
The "I_FREEING|I_CLEAR" condition was added after the ISBLK/unhashed
tests were already in the source, but I can't see any reason why we'd
want the I_FREEING test not to apply to block devices. And indeed, this
results in all sorts of inode list corruptions. Simply moving the
I_FREEING|I_CLEAR test out of the protection of the S_ISBLK() condition
fixes things entirely.
The existing 2.6 kernel will reliably fail on me in about 2 seconds once
"rpm -Uvh --force dev*.rpm" starts its actual installation of the new
inodes. With the patch below I can't reproduce it at all.
Andrew Morton [Wed, 4 Feb 2004 02:54:15 +0000 (18:54 -0800)]
[PATCH] Fix ptrace in the vsyscall dso area
From: Roland McGrath <roland@redhat.com>
The #include is the part of this patch that matters, so the #ifdef below
works.
The rest of the patch removes gratuitous duplication due to some strange
aversion to concision in the presence of #ifdef, the kind that is all too
common, utterly pointless, and error prone.
Andrew Morton [Wed, 4 Feb 2004 02:53:48 +0000 (18:53 -0800)]
[PATCH] Altix update: irq fixes
From: Pat Gefre <pfg@sgi.com>
arch/ia64/sn/kernel/irq.c
Need to get the cpu from the passed in pcibr struct
Made the interrupt list static and gave it a better name - credit jes
Some lindent'isms
Took out some code that isn't used ..... yet