Commit graph

1105 commits

Author SHA1 Message Date
Russell King
e9368f8288 [ARM] Remove asm/irq.h includes from ARM drivers
Many ARM drivers do not need to include asm/irq.h - remove this
unnecessary include from some ARM drivers.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-09 13:56:42 +00:00
Christoph Hellwig
a885c8c431 [PATCH] Add block_device_operations.getgeo block device method
HDIO_GETGEO is implemented in most block drivers, and all of them have to
duplicate the code to copy the structure to userspace, as well as getting
the start sector.  This patch moves that to common code [1] and adds a
->getgeo method to fill out the raw kernel hd_geometry structure.  For many
drivers this means ->ioctl can go away now.

[1] the s390 block drivers are odd in this respect.  xpram sets ->start
    to 4 always which seems more than odd, and the dasd driver shifts
    the start offset around, probably because of it's non-standard
    sector size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@suse.de>
Cc: <mike.miller@hp.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:13:54 -08:00
Benjamin Herrenschmidt
cc5d0189b9 [PATCH] powerpc: Remove device_node addrs/n_addr
The pre-parsed addrs/n_addrs fields in struct device_node are finally
gone. Remove the dodgy heuristics that did that parsing at boot and
remove the fields themselves since we now have a good replacement with
the new OF parsing code. This patch also fixes a bunch of drivers to use
the new code instead, so that at least pmac32, pseries, iseries and g5
defconfigs build.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:55 +11:00
Linus Torvalds
d99cf9d679 Merge branch 'post-2.6.15' of git://brick.kernel.dk/data/git/linux-2.6-block
Manual fixup for merge with Jens' "Suspend support for libata", commit
ID 9b84754866.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-06 09:01:25 -08:00
Jens Axboe
9b84754866 [PATCH] Suspend support for libata
This patch adds suspend patch to libata, and ata_piix in particular. For
most low level drivers, they should just need to add the 4 hooks to
work. As I can only test ata_piix, I didn't enable it for more
though.

Suspend support is the single most important feature on a notebook, and
most new notebooks have sata drives. It's quite embarrassing that we
_still_ do not support this. Right now, it's perfectly possible to
suspend the drive in mid-transfer.

Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-06 08:36:09 -08:00
Marko Kohtala
6a19b41b35 [PATCH] parport: Kconfig dependency fixes
Make drivers that use directly PC parport HW depend on PARPORT_PC rather than
HW independent PARPORT.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-06 08:33:57 -08:00
Martin Schwidefsky
347a8dc3b8 [PATCH] s390: cleanup Kconfig
Sanitize some s390 Kconfig options.  We have ARCH_S390, ARCH_S390X,
ARCH_S390_31, 64BIT, S390_SUPPORT and COMPAT.  Replace these 6 options by
S390, 64BIT and COMPAT.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-06 08:33:53 -08:00
Jens Axboe
e650c305ec [SCSI] scsi_end_async() needs to take an uptodate parameter
Signed-off-by: Jens Axboe <axboe@suse.de>
2006-01-06 12:38:30 +01:00
Tejun Heo
9a3dccc425 [BLOCK] add FUA support to libata
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
2006-01-06 09:56:18 +01:00
Tejun Heo
93c9338713 [BLOCK] update libata to use new blk_ordered for barriers
Reflect changes in SCSI midlayer and updated to use new
ordered request implementation

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
2006-01-06 09:55:00 +01:00
Tejun Heo
007365ad60 [BLOCK] scsi: add FUA support to sd
Add FUA support for barriers to SCSI disk.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
2006-01-06 09:53:52 +01:00
Tejun Heo
461d4e90c8 [BLOCK] update SCSI to use new blk_ordered for barriers
All ordered request related stuff delegated to HLD.  Midlayer
now doens't deal with ordered setting or prepare_flush
callback.  sd.c updated to deal with blk_queue_ordered
setting.  Currently, ordered tag isn't used as SCSI midlayer
cannot guarantee request ordering.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
2006-01-06 09:52:55 +01:00
Tejun Heo
8ffdc6550c [BLOCK] add @uptodate to end_that_request_last() and @error to rq_end_io_fn()
add @uptodate argument to end_that_request_last() and @error
to rq_end_io_fn().  there's no generic way to pass error code
to request completion function, making generic error handling
of non-fs request difficult (rq->errors is driver-specific and
each driver uses it differently).  this patch adds @uptodate
to end_that_request_last() and @error to rq_end_io_fn().

for fs requests, this doesn't really matter, so just using the
same uptodate argument used in the last call to
end_that_request_first() should suffice.  imho, this can also
help the generic command-carrying request jens is working on.

Signed-off-by: tejun heo <htejun@gmail.com>
Signed-Off-By: Jens Axboe <axboe@suse.de>
2006-01-06 09:49:03 +01:00
Dominik Brodowski
f8cfa618dc [PATCH] pcmcia: unify attach, EVENT_CARD_INSERTION handlers into one probe callback
Unify the EVENT_CARD_INSERTION and "attach" callbacks to one unified
probe() callback. As all in-kernel drivers are changed to this new
callback, there will be no temporary backwards-compatibility. Inside a
probe() function, each driver _must_ set struct pcmcia_device
*p_dev->instance and instance->handle correctly.

With these patches, the basic driver interface for 16-bit PCMCIA drivers
now has the classic four callbacks known also from other buses:

        int (*probe)            (struct pcmcia_device *dev);
        void (*remove)          (struct pcmcia_device *dev);

        int (*suspend)          (struct pcmcia_device *dev);
        int (*resume)           (struct pcmcia_device *dev);

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06 00:03:24 +01:00
Dominik Brodowski
b463581154 [PATCH] pcmcia: remove dev_list from drivers
The linked list of devices managed by each PCMCIA driver is, in very most
cases, unused. Therefore, remove it from many drivers.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06 00:03:20 +01:00
Dominik Brodowski
cc3b4866be [PATCH] pcmcia: unify detach, REMOVAL_EVENT handlers into one remove callback
Unify the "detach" and REMOVAL_EVENT handlers to one "remove" function.
Old functionality is preserved, for the moment.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06 00:03:10 +01:00
Dominik Brodowski
98e4c28b7e [PATCH] pcmcia: new suspend core
Move the suspend and resume methods out of the event handler, and into
special functions. Also use these functions for pre- and post-reset, as
almost all drivers already do, and the remaining ones can easily be
converted.

Bugfix to include/pcmcia/ds.c
Signed-off-by: Andrew Morton <akpm@osdl.org>

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-05 23:59:02 +01:00
Linus Torvalds
db9edfd7e3 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
Trivial manual merge fixup for usb_find_interface clashes.
2006-01-04 18:44:12 -08:00
Linus Torvalds
25c862cc9e Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2006-01-04 16:36:52 -08:00
Linus Torvalds
1cb9e8e01d Merge branch 'upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev 2006-01-04 16:32:33 -08:00
Linus Torvalds
f61ea1b0c8 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2006-01-04 16:30:12 -08:00
Kay Sievers
312c004d36 [PATCH] driver core: replace "hotplug" by "uevent"
Leave the overloaded "hotplug" word to susbsystems which are handling
real devices. The driver core does not "plug" anything, it just exports
the state to userspace and generates events.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 16:18:08 -08:00
Kay Sievers
5f123fbd80 [PATCH] merge kobject_uevent and kobject_hotplug
The distinction between hotplug and uevent does not make sense these
days, netlink events are the default.

udev depends entirely on netlink uevents. Only during early boot and
in initramfs, /sbin/hotplug is needed. So merge the two functions and
provide only one interface without all the options.

The netlink layer got a nice generic interface with named slots
recently, which is probably a better facility to plug events for
subsystem specific events.
Also the new poll() interface to /proc/mounts is a nicer way to
notify about changes than sending events through the core.
The uevents should only be used for driver core related requests to
userspace now.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 16:18:07 -08:00
Jeff Garzik
a18ceba7b4 Merge branch 'master' 2006-01-03 10:58:53 -05:00
Brian Gerst
352dd1df32 gitignore: misc files
Ignore all files generated from *_shipped files, plus a few others.

Signed-off-by: Brian Gerst <bgerst@didntduck.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-01-01 22:21:50 +01:00
James Bottomley
04333393b9 [PATCH] Fix Fibre Channel boot oops
The oops is characteristic of the underlying device being removed from
visibility before the class device, and sure enough we do device_del()
before transport_unregister() in the scsi_target_reap() routines.  I've
no idea why this is suddenly showing up, since the code has been in
there since that function was first invented.  However, I've confirmed
this fixes Andrew Vasquez's boot oops.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-26 10:17:43 -08:00
Linus Torvalds
cdcdb28623 Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev 2005-12-24 12:40:43 -08:00
Tony Battersby
fd71da468d [PATCH] fix libata inquiry VPD for ATAPI devices
The following patch prevents libata from incorrectly modifying inquiry
VPD pages and command support data from ATAPI devices.  I have tested
the patch with a SATA ATAPI tape drive on an AHCI controller.

Patch is against kernel 2.4.32 with 2.4.32-libata1.patch applied.

Anthony J. Battersby
Cybernetics

Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-24 10:02:24 -05:00
Jeff Garzik
aaadff8119 Merge branch 'master' 2005-12-24 09:31:05 -05:00
Linus Torvalds
d5ea4e2660 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2005-12-21 15:09:50 -08:00
Salyzyn, Mark
e5508c13ac [PATCH] dpt_i2o fix for deadlock condition
Miquel van Smoorenburg <miquels@cistron.nl> forwarded me this fix to
resolve a deadlock condition that occurs due to the API change in
2.6.13+ kernels dropping the host locking when entering the error
handling.  They all end up calling adpt_i2o_post_wait(), which if you
call it unlocked, might return with host_lock locked anyway and that
causes a deadlock.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-18 11:19:44 -08:00
Matthew Wilcox
7b32b8e018 [SCSI] Missing const in sr_vendor
Fix compile warnings with current scsi-misc git tree

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-17 10:50:23 -06:00
James Bottomley
863a930a40 [SCSI] fix scsi_reap_target() device_del from atomic context
scsi_reap_target() was desgined to be called from any context.
However it must do a device_del() of the target device, which may only
be called from user context.  Thus we have to reimplement
scsi_reap_target() via a workqueue.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-17 10:48:08 -06:00
Matthew Wilcox
19c65091c1 [SCSI] Merge sym53c8xx_comm.h and sym53c8xx_defs.h into ncr driver
When the sym1 driver was in the tree, it used to share various parts of
its infrastructure with the ncr driver.  Now it's gone, these files are
just an annoyance, so merge sym53c8xx_comm.h into ncr53c8xx.c and merge
sym53c8xx_defs.h into ncr53c8xx.h.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-16 10:53:47 -08:00
Matthew Wilcox
cd453c6353 [SCSI] Use spi_print_msg in ncr53c8xx driver
The ncr53c8xx driver had its own loop to print scsi messages.  Use the
SPI one instead.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-16 10:52:38 -08:00
James Bottomley
8f23d47558 [SCSI] 53c700: update endian processing macros
This update now allows this driver to be used on big endian bus
machines that aren't parisc.  To do that, the driver must set a
CONFIG_53C700_BE_BUS in Kconfig to compile the right macro versions.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-16 09:51:01 -08:00
James.Smart@Emulex.Com
42e33148df [SCSI] fix for fc transport recursion problem.
In the scenario that a link was broken, the devloss timer for each
rport was expire at roughly the same time, causing lots of "delete"
workqueue items being queued. Depth is dependent upon the number of
rports that were on the link.

The rport target remove calls were calling flush_scheduled_work(),
which would interrupt the stream, and start the next workqueue item,
which did the same thing, and so on until recursion depth was large.

This fix stops the recursion in the initial delete path, and pushes it
off to a host-level work item that reaps the dead rports.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15 19:22:14 -08:00
Matthew Wilcox
ef72582e7a [SCSI] Add PPR support to spi_print_msg
Introduce a new helper, print_nego() to handle SDTR/WDTR/PPR.
Split out the guts of show_spi_transport_period_helper() into period_to_str()
and use it in print_nego to get the period factor conversion right.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15 18:42:39 -08:00
Matthew Wilcox
b32aaffcdc [SCSI] Use ARRAY_SIZE in spi_print_msg
Replace the custom NO_*_MSGS definitions with uses of ARRAY_SIZE.
This fixes a bug in the definition of NO_EXTENDED_MSGS.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15 18:42:18 -08:00
Matthew Wilcox
4797215389 [SCSI] Fix printing of two-byte messages
A missing comma meant that "Ordered Queue Tag" and "Ignore Wide Residue"
were being concatenated together.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15 18:41:55 -08:00
Matthew Wilcox
1abfd37013 [SCSI] Rename scsi_print_msg to spi_print_msg
Rename scsi_print_msg to spi_print_msg and move its prototype from
scsi_dbg.h to scsi_transport_spi.h

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15 18:41:27 -08:00
Matthew Wilcox
410ca5c7c6 [SCSI] Move scsi_print_msg to SPI class
scsi_print_msg() is an SPI-specific concept.  This patch moves it from
constants.c to scsi_transport_spi.c and updates the Kconfig to link in
the SPI class for the drivers which use scsi_print_msg().

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15 18:41:13 -08:00
James Bottomley
7b16318dea Fix up SCSI mismerge
I forgot to do a git-update-cache on the merged files ...
2005-12-15 20:17:02 -06:00
James Bottomley
2a1e1379ba Merge by hand (conflicts in scsi_lib.c)
This merge is pretty extensive.  The conflict is over the new
req->retries parameter, so I had to change the prototype to
scsi_setup_blk_pc_cmnd() and the usage in sd, sr and st.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15 17:35:24 -06:00
Kai Makisara
787926b1b2 [SCSI] Fix st oops with new scsi_execute infrastructure
Patch from Kai minus last sg_segs clearing which was merged already.

> > Was there a oops or lockup or any debug output you can send me? I will try
> > some more large request tests with scsi_debug. You also have to compile your
> > kernel with SCSI_MAX_PHYS_SEGMENTS == 255 to get larger requests now.
>
It was an oops in sgl_unmap_user_pages(). The reason is this:

		/* XXX: just for debug. Remove when PageReserved is removed */
		BUG_ON(PageReserved(page));

I was using /dev/zero as input and it triggers this. When I used a file as
input, this did not trigger. Should this BUG_ON be removed?

In the same log I noticed that there was another ->sg_segs inconsistency.
Also, the field ->last_SRpnt was not reset when scsi_execute_async()
failed. This caused the error message "Async command already active"
later and prevented proper close.

While doing the changes, I noticed that the current code (since
2.6.0-test4) does not set the pages dirty when reading with direct i/o.

All of these st problems (including the one I sent earlier) are fixed in
the patch at the end of this message. These fixes should probably be
included already in 2.6.15.

After these fixes, the tape seems to operate as expected. Without other
changes, the largest block size with sym53c896 SCSI adapter is 384 kB. The
maximum number of sg segments is set to 96 and clustering is disabled in
the driver. 96 x 4 kB = 384 kB. OK.

I enabled clustering and set max_sectors to 10000 in the SCSI HBA driver.
Now the block size limit is 5000 kB as expected.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15 15:17:03 -08:00
Mike Christie
defd94b754 [SCSI] seperate max_sectors from max_hw_sectors
- export __blk_put_request and blk_execute_rq_nowait
needed for async REQ_BLOCK_PC requests
- seperate max_hw_sectors and max_sectors for block/scsi_ioctl.c and
SG_IO bio.c helpers per Jens's last comments. Since block/scsi_ioctl.c SG_IO was
already testing against max_sectors and SCSI-ml was setting max_sectors and
max_hw_sectors to the same value this does not change any scsi SG_IO behavior. It only
prepares ll_rw_blk.c, scsi_ioctl.c and bio.c for when SCSI-ml begins to set
a valid max_hw_sectors for all LLDs. Today if a LLD does not set it
SCSI-ml sets it to a safe default and some LLDs set it to a artificial low
value to overcome memory and feedback issues.

Note: Since we now cap max_sectors to BLK_DEF_MAX_SECTORS, which is 1024,
drivers that used to call blk_queue_max_sectors with a large value of
max_sectors will now see the fs requests capped to BLK_DEF_MAX_SECTORS.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15 15:11:40 -08:00
Al Viro
b53cb2a4ab [PATCH] iscsi gfp_t annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-15 10:04:29 -08:00
Mike Christie
8b05b773b6 [SCSI] convert st to use scsi_execute_async
convert st to always send scatterlists and kill scsi_request
usage.

This is the same as last time as it was posted, but with Kai's patches
merged and we now pass the bytes value to scsi_execute_async.

TODO:

- move DIO code to common place or make block layers usable for ULDs.
- move buffer allocation code to common place for all ULDs to use. And
make buffer allocation code handle all queue limits so we can find
out about problems before calling scsi_execute_async.
- move indirect (copy_to/from_user) paths commone place or make block
layers usable for ULDs.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-14 19:16:31 -08:00
Mike Christie
d6b10348f9 [SCSI] convert sg to scsi_execute_async
Convert sg to always send scatterlists, and kill scsi_request usage.

TODO:

- move DIO code to common place or make block layers usable for ULDs.
- move buffer allocation code to common place for all ULDs to use. And
make buffer allocation code obey all queue limits so we can find
out about problems before calling scsi_execute_async. Currently, sg.c
could allocate a buffer that is too large, and send the request
to scsi_execute_async. scsi_execute_async will then check it against
all the queue limits and return a failure in this case. It would nicer
to know about the queue limit violation right away.
- move indirect (copy_to/from_user) paths commone place or make block
layers usable for ULDs.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-14 19:15:45 -08:00
Mike Christie
aa7b5cd750 [SCSI] add kmemcache for scsi_io_context
Add kmemcache of scsi io contexts.

In the future when we finalize on where these functions will live
we can add a mempool for it and do a bioset for out REQ_BLOCK_PC
bios. This is needed becuase the dm-multipath handlers will
want to use the scsi_exectute* functions for failover and we cannot
have them and the bio device allocating from the same mempool.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-14 19:09:09 -08:00
Mike Christie
0d95716d6a [SCSI] complete the whole command when it is REQ_BLOCK_PC
sd does not allow scsi_io_completion to retry commands for
SG_IO requests, and it make sense that it should not happen for st
SG_IO commands too. If for st we hit the bottom of scsi_io_completion
we will probably screw things up pretty bad. This patch returns to the
block layer that the whole command completed and relies on the caller to check
the request errors field. For initialization commands like in sd, this adds
the previous behavior where scsi_io_completion did not process the error.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-14 19:08:16 -08:00
Mike Christie
17e01f216b [SCSI] add retries field to request for REQ_BLOCK_PC use
For tape we need to control the retries. This patch adds a retries
counter on the request for REQ_BLOCK_PC commands originating from
scsi_execute* to use. REQ_BLOCK_PC commands comming from the block
layer SG_IO path continue to use the retires set in the ULD init_command.
(scsi_execute* does not set the gendisk so we do not execute
the init_command in that path).

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-14 19:04:11 -08:00
Mike Christie
6e68af666f [SCSI] Convert SCSI mid-layer to scsi_execute_async
Add scsi helpers to create really-large-requests and convert
scsi-ml to scsi_execute_async().

Per Jens's previous comments, I placed this function in scsi_lib.c.
I made it follow all the queue's limits - I think I did at least :), so
I removed the warning on the function header.

I think the scsi_execute_* functions should eventually take a request_queue
and be placed some place where the dm-multipath hw_handler can use them
if that failover code is going to stay in the kernel. That conversion
patch will be sent in another mail though.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-14 19:03:35 -08:00
Jesper Juhl
9e1fe9314c [SCSI] handle scsi_add_host failure for aic7xxx and fix compiler warning
Add scsi_add_host() failure handling for aic7xxx
Also silence a compiler warning :
 drivers/scsi/aic7xxx/aic7xxx_osm.c: In function `ahc_linux_register_host':
 drivers/scsi/aic7xxx/aic7xxx_osm.c:1100: warning: ignoring return value of `scsi_add_host', declared with attribute warn_unused_result

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-14 18:52:45 -08:00
Jesper Juhl
e7a1ca1d27 [SCSI] handle scsi_add_host failure for aic79xx and fix compiler warning
Add scsi_add_host() failure handling for aic79xx
Also silence a compiler warning :
 drivers/scsi/aic7xxx/aic79xx_osm.c: In function `ahd_linux_register_host':
 drivers/scsi/aic7xxx/aic79xx_osm.c:1099: warning: ignoring return value of `scsi_add_host', declared with attribute warn_unused_result

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-14 18:52:24 -08:00
Linus Torvalds
a50e2cc7c8 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2005-12-14 18:40:02 -08:00
James Bottomley
c9526497cf [SCSI] Consolidate REQ_BLOCK_PC handling path (fix ipod panic)
This follows on from Jens' patch and consolidates all of the ULD
separate handlers for REQ_BLOCK_PC into a single call which has his
fix for our direction bug.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 21:29:27 -08:00
Alan Stern
38d76df2f5 [SCSI] sd: Always do write-protect check
Since nobody has offered an explanation for why the sd driver makes a
write-protect check only for devices with removable media, I'm submitting
this patch to get rid of the removable-media test.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:49:18 -07:00
James.Smart@Emulex.Com
1cb25a27d0 [SCSI] lpfc 8.1.1 : Change version number to 8.1.1
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:36:15 -07:00
James.Smart@Emulex.Com
fefcb2b677 [SCSI] lpfc 8.1.1 : kill use of pci_read_config_xxx
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:35:50 -07:00
James.Smart@Emulex.Com
445cf4f4d2 [SCSI] lpfc 8.1.1 : Added code to adjust lun queue depth to avoid target overloading
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:35:09 -07:00
James.Smart@Emulex.Com
875fbdfe9b [SCSI] lpfc 8.1.1 : Add polled-mode support
- Add functionality to run in polled mode only. Includes run time
  attribute to enable mode.
- Enable runtime writable hba settings for coallescing and delay parameters

Customers have requested a mode in the driver to run strictly polled.
This is generally to support an environment where the server is extremely
loaded and is looking to reclaim some cpu cycles from adapter interrupt
handling.

This patch adds a new "poll" attribute, and the following behavior:

if value is 0 (default):
  The driver uses the normal method for i/o completion. It uses the
  firmware feature of interrupt coalesing. The firmware allows a
  minimum number of i/o completions before an interrupt, or a maximum
  time delay between interrupts.  By default, the driver sets these
  to no delay (disabled) or 1 i/o - meaning coalescing is disabled.

  Attributes were provided to change the coalescing values, but it was
  a module-load time only and global across all adapters.
  This patch allows them to be writable on a per-adapter basis.

if value is 1 :
  Interrupts are left enabled, expecting that the user has tuned the
  interrupt coalescing values. When this setting is enabled, the driver
  will attempt to service completed i/o whenever new i/o is submitted
  to the adapter. If the coalescing values are large, and the i/o
  generation rate steady, an interrupt will be avoided by servicing
  completed i/o prior to the coalescing thresholds kicking in. However,
  if the i/o completion load is high enough or i/o generation slow, the
  coalescion values will ensure that completed i/o is serviced in a timely
  fashion.

if value is 3 :
  Turns off FCP i/o interrupts altogether. The coalescing values now have
  no effect. A new attribute "poll_tmo" (default 10ms) exists to set
  the polling interval for i/o completion. When this setting is enabled,
  the driver will attempt to service completed i/o and restart the
  interval timer whenever new i/o is submitted. This behavior allows for
  servicing of completed i/o sooner than the interval timer, but ensures
  that if no i/o is being issued, then the interval timer will kick in
  to service the outstanding i/o.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:34:14 -07:00
James.Smart@Emulex.Com
5cc36b3cd0 [SCSI] lpfc 8.1.1 : Bring model descriptions in sync with Emulex standard generic names
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:27:57 -07:00
James.Smart@Emulex.Com
e4adb20406 [SCSI] lpfc 8.1.1 : Add support for more members of the Light Pulse 11xxx (4Gb) family
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:27:22 -07:00
James.Smart@Emulex.Com
6175c02a0b [SCSI] lpfc 8.1.1 : Fixes to error handlers
- Release task management command before counting outstanding commands.
  TMF was being erroneously counted as an active outstanding command.
- Serialize EH calls and block requests when EH function is running.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:26:47 -07:00
James.Smart@Emulex.Com
63c59c3b8f [SCSI] lpfc 8.1.1 : Remove locking wrappers around error handlers
Remove locking wrappers around error handlers. Wrappers were added in
early 2.6.13 api change

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:20:22 -07:00
James.Smart@Emulex.Com
23dc04f1ec [SCSI] lpfc 8.1.1 : Adjust use of scsi_block_requests and interaction w/ FC transport
- Remove unnecessary scsi_block_requests calls on rport deletes.
  This was deadlocking the sdev removals as they wanted to flush commands.
- No longer block requests when adding the remote port (to block
  discovery). Instead, register, then change port role. Maps to Qlogic
  behavior, and closer to the register-node-upon-first-ELS behavior.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:18:47 -07:00
James.Smart@Emulex.Com
6281bfe000 [SCSI] lpfc 8.1.1 : Fixes for short cable pulls
Cause: Link bounces were causing discovery ELS's to be killed.
Driver was not properly flushing ELS commands upon the subsequent
link bounces. Thus, processing of ELS post link bounce erroneously
assumed discovery failure and device loss.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:16:01 -07:00
James.Smart@Emulex.Com
2fb70f7993 [SCSI] lpfc 8.1.1 : Correct some 8bit to 16bit field conversions/comparisons
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:15:40 -07:00
James.Smart@Emulex.Com
1de933f35b [SCSI] lpfc 8.1.1: Miscellaneous Cleanups
Miscellaneous Cleanups:
- Remove ProgType READ_REV mailbox command value check in lpfc_config_port_prep.
- Convert simple printk to an lpfc_printf_log in queuecommand.
- Modify lpfc_abort_handler message 0749 to display more accurate text and data.
- Minor style cleanup: fix 3 long lines in lpfc_hw.h

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:14:08 -07:00
James Bottomley
0a21ef1e60 [SCSI] qla2xxx: fix compile error caused by pci_dev.owner move
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:12:07 -07:00
James Bottomley
7f23e146a1 [SCSI] correct some dropped const compiler warnings
Make the vendor, model and rev fields in scsi_device pointers to const
and update a few prototypes of functions using them.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:12:05 -07:00
Mike Christie
8a47cd340b [SCSI] iscsi: check header digests for mgmt tasks
From Wang Zhenyu:

check header digest for cmd and mgmt tasks

Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:12:03 -07:00
Mike Christie
4d841d6bd9 [SCSI] iscsi: update version
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:12:02 -07:00
Mike Christie
9e3961ba2b [SCSI] iscsi: lower queue depth
From Wang Zhenyu:

High queue depth was a problem for some targets so make queue_depth adjustable

From Mike Christie

Make default queue_depth a little lower

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:12:00 -07:00
Mike Christie
f6cfba1d21 [SCSI] iscsi: data digest calculation fix
From Wang Zhenyu:

data digest fix (the bug caused data corruption w/Wasabi StorageBuilder target)

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:58 -07:00
Mike Christie
733bb6a70c [SCSI] iscsi: iscsi response fix
from Wang Zhenyu:

Must check SCSI CMD and R2T response according to the spec

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:56 -07:00
Mike Christie
e6273993db [SCSI] iscsi: redirect fix
From tomof@acm.org:

There is one more issue about Equallogic systems. They send
re-direction info with FIN. I think that the kernel module needs to
let iscsid to read data from the socket before killing it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:55 -07:00
Mike Christie
0d2f16559a [SCSI] iscsi: opcode check fix
Must check only valid opcode bits.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:53 -07:00
Matthew Wilcox
ad94c9340a [SCSI] sym2: Version 2.2.2
Update version number to 2.2.2

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:50 -07:00
Matthew Wilcox
66e8d1cc64 [SCSI] sym2: Report disabled devices and LUNs more attractively
Rather than print a list of targets at driver init time, print each
disabled target as we attempt to scan it.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:47 -07:00
Matthew Wilcox
b37df48923 [SCSI] sym2: Allow NVRAM settings to limit speed and width
The NVRAM for both Tekram and Symbios boards allows the user to set the
speed and width for individual targets.  I took that code out in March
2004 when we introduced Domain Validation, but it seems there's still
a legitimate need for it in some configurations.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:45 -07:00
Matthew Wilcox
33333bacf5 [SCSI] sym2: Use scsi_print_msg
sym_show_msg was almost a duplicate of scsi_print_msg, except not as
featureful.  So use the common code instead.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:43 -07:00
Matthew Wilcox
1e8eb21ea7 [SCSI] sym2: Use DMA_40BIT_MASK constant
Now that this constant has been added to dma-mapping.h, we don't need our
own definition

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:41 -07:00
Matthew Wilcox
44f30b0f59 [SCSI] sym2: Remove code to handle DMA_BIDIRECTION requests
The upper layer doesn't send these down since 2.4.x (or 2.6 in
practice), so no need to handle it.  Inline sym_setup_data_pointers
into its only caller so we can fail gracefully in the case we'd get
one neverless.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:39 -07:00
Matthew Wilcox
84e203a279 [SCSI] sym2: Manage sym_lcb properly
Allocate the lcb in slave_alloc and free it in slave_destroy.  This allows
us to remove all the code that checks to see if it's already been allocated.

From: Christoph Hellwig <hch@lst.de>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:33 -07:00
Matthew Wilcox
760c9de589 [SCSI] sym2: Remove last vestiges of sym_sniff_inquiry
The SYM_OPT_SNIFF_INQUIRY define is never set any more, and the
sym_sniff_inquiry() function doesn't exist

From: Christoph Hellwig <hch@lst.de>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:29 -07:00
Matthew Wilcox
47be1e0ee1 [SCSI] sym2: Remove FreeBSD ifdefs
Remove FreeBSD ifdefs from sym2 driver

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:27 -07:00
Andrew Vasquez
c6ce15d7cd [SCSI] qla2xxx: Resync with latest released ISP24xx firmware -- 4.00.16.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:23 -07:00
Andrew Vasquez
331e347686 [SCSI] qla2xxx: Add support for embedded ISP24xx firmware.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:19 -07:00
Andrew Vasquez
5433383ef3 [SCSI] qla2xxx: Add full firmware(-request) hotplug support for all ISPs.
Transition driver to exclusively use the request_firmware()
interfaces to retrieve firmware-blobs from user-space.  This
will be the default behaviour going forward until the
embedded firmware-binary images are removed from the
upstream kernel.

Upon request, the driver caches the firmware image until the
driver is unloaded.

NOTE: The option is present to allow the user to continue to
use the firmware-loader modules, but, should be considered
deprecated.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

Rejections fixed up and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:16 -07:00
Jens Axboe
26a68019c8 [SCSI] scsi_lib: stricter checks for clearing use_10_for_rw
Check the asc and ascq for being "invalid command opcode" as well.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:11 -07:00
Matthew Wilcox
493ff4ee7f [SCSI] Delete trailing full stop
None of the other domain validation messages have a trailing full stop,
so I don't see why this one should.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:09 -07:00
Arjan van de Ven
0ad78200ba [SCSI] Mark some core scsi data structures const
patch below marks a few scsi core datastructures as const, so that they end up
in the .rodata section and don't cacheline share with things that get dirtied

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:11:01 -07:00
brking@us.ibm.com
ce155ccecd [SCSI] ipr: Driver initialization fix for kexec/kdump
When kexec booting a kernel when the previous kernel did not
call ipr's shutdown method, the ipr adapter does not get
properly initialized, which can result in the ipr adapter
completing commands issued by the previous kernel. Fix ipr
to detect this scenario by reading the adapter's interrupt
mask register and the microprocessor interrupt register.
If the interrupt mask register indicates that interrupts
are enabled or the reset alert bit is set when the card is
probed, this means the card is in an unknown state and we
hard reset the card.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:10:58 -07:00
Ju, Seokmann
ed7e8ef7f1 [SCSI] megaraid_{mbox,mm} : remove PCI Id overlaping between megaraid_legacy and megaraid_{mbox,mm}
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:10:56 -07:00
Ju, Seokmann
3492b32883 [SCSI] megaraid_legacy: removed PCI ID overlap from the driv er
This patch fixes
	- PCI ID overlap issue
	- node name changed to 'megaraid_legacy'
I hope this patch addresses concerns brought by Daniel Drake.

Signed-off by: Seokmann Ju <seokmann.ju@enginio.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 18:10:52 -07:00
Matthew Wilcox
322e079f1b [SCSI] Negotiate correctly with async-only devices
When we got a device only capable of async, we would zero out goal->period
which would cause us to try PPR negotiations.  Leave goal->period alone,
and check goal->offset before doing PPR.  Kudos to Daniel Forsgren for
figuring this out.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13 17:27:10 -07:00
Jeff Garzik
e508a391a0 Merge branch 'upstream-fixes' 2005-12-13 02:30:04 -05:00
Jeff Garzik
50630195bb [libata] mark certain hardware (or drivers) with a no-atapi flag
Some hardware does not support the PACKET command at all.
Other hardware supports ATAPI, but the driver does something nasty such
as calling BUG() when an ATAPI command is issued.

For these such cases, we mark them with a new flag, ATA_FLAG_NO_ATAPI.

Initial version contributed by Ben Collins.
2005-12-13 02:29:45 -05:00
Tejun Heo
b563230340 [PATCH] libata: remove unused qc->waiting
There is no user of qc->waiting left after ata_exec_internal()
changes.  Kill the field.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-13 01:34:46 -05:00
Tejun Heo
82033adf0a [PATCH] libata: remove unused functions
There is no user of ata_qc_wait_err() and ata_qc_complete_noop() after
ata_exec_internal() changes.  Remove unused functions.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-13 01:34:45 -05:00
Tejun Heo
a012370322 [PATCH] libata: use ata_exec_internal()
This patch converts all users of libata internal commands to use
ata_exec_internal().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-13 01:34:45 -05:00
Tejun Heo
a2a7a662f8 [PATCH] libata: implement ata_exec_internal()
This patch implements ata_exec_internal() function which performs
libata internal command execution.  Previously, this was done by each
user by manually initializing a qc, issueing it, waiting for its
completion and handling errors.  In addition to obvious code
factoring, using ata_exec_internal() fixes the following bugs.

* qc not freed on issue failure
* ap->qactive clearing could race with the next internal command
* race between timeout handling and irq
* ignoring error condition not represented in tf->status

Also, qc & hardware are not accessed anymore once it's completed,
making internal commands more conformant with general semantics.
ata_exec_internal() also makes it easy to issue internal commands from
multiple threads if that becomes necessary.

This patch only implements ata_exec_internal().  A following patch
will convert all users.

Signed-off-by: Tejun Heo <htejun@gmail.com>

--

Jeff, all patches have been regenerated against upstream branch as of
today.  (575ab52a21)

Also, I took out a debug printk from ata_exec_internal (don't know how
that one got left there).  Other than that, all patches are identical
to the previous posting.

Thanks. :-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-13 01:34:45 -05:00
Jeff Garzik
575ab52a21 Merge branch 'upstream-fixes' 2005-12-12 23:51:01 -05:00
Alan Cox
c621b14060 [PATCH] libata: ata_piix 450NX errata
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-12 23:23:03 -05:00
Mark Lord
dfa159886f [PATCH] libata-core.c: fix parameter bug on kunmap_atomic() calls
Fix incorrect pointer usage on two calls to kunmap_atomic().
This seems to happen a lot, because kunmap() wants the struct page *,
whereas kunmap_atomic() instead wants the mapped virtual address.

Signed-off-by: Mark Lord <liml@rtr.ca>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-12 23:19:28 -05:00
Jeff Garzik
9da305eb08 Merge branch 'master' 2005-12-12 22:03:53 -05:00
Brian King
66e0522526 [PATCH] Fix SCSI scanning slab corruption
There is a double free in the scsi scan code if a LLDD's slave_alloc()
call fails.  There is a direct call to scsi_free_queue and then the
following put_device calls the release function, which also frees the
queue.

Remove the redundant scsi_free_queue.

Signed-off-by: Brian King <brking@us.ibm.com>
Tested-by: Nathan Lynch <ntl@pobox.com>
[ Also removed some strange whitespace artifacts in that area ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-12 12:35:39 -08:00
Alan Cox
d96212ed87 [PATCH] libata: add ata_piix notes
Ok lets start with the 'easy' stuff. This includes my research and
summary of chip errata into the new driver so that people can refer to
it when updating ata_piix.

No code changes

Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-12 15:33:28 -05:00
Brian King
1a68de5c08 [SCSI] fix double free of scsi request queue
Current scsi scanning code appears to have a use after free
bug is a LLDD's slave_alloc fails. Remove the redundant
scsi_free_queue.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-12 14:27:05 -06:00
Linus Torvalds
49d7bc6428 Revert revert of "[SCSI] fix usb storage oops"
This reverts commit 1b0997f561, which in
turn reverted 34ea80ec6a (which is thus
re-instated).

Quoth James Bottomley:

  "All it's doing is deferring the device_put() from the
   scsi_put_command() to after the scsi_run_queue(), which doesn't fix
   the sleep while atomic problem of the device release method.  In both
   cases we still get the semaphore in atomic context problem which is
   caused by scsi_reap_target() doing a device_del(), which I assumed
   (wrongly) was valid from atomic context."

who also promised to fix scsi_reap_target().

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-12 11:25:04 -08:00
Jens Axboe
a8c730e85e [SCSI] fix panic when ejecting ieee1394 ipod
The scsi_library routines don't correctly set DMA_NONE when
req->data_len is zero (instead they check the command type first, so
if it's write, we end up with req->data_len == 0 and direction as
DMA_TO_DEVICE which confuses some drivers)

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-09 13:50:53 -05:00
Michael Reed
85631672e6 [SCSI] fix OOPS due to clearing eh_action prior to aborting eh command
The eh_action semaphore in scsi_eh_send_command is cleared after a
command timeout.  The command is subsequently aborted and the abort
will try to call scsi_done() on it.  Unfortunately, the scsi_eh_done()
routine unconditinally completes the semaphore (which is now null).
Fix this race by makiong the scsi_eh_done() routine check that the
semaphore is non null before completing it (mirroring the ordinary
command done/timeout logic).

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-08 09:13:29 -05:00
Mark Lord
f0353301e6 [SCSI] Fix incorrect pointer in megaraid.c MODE_SENSE emulation
The SCSI megaraid drive goes to great effort to kmap
the scatterlist buffer (if used), but then uses the
wrong pointer when copying to it afterward.

Signed-off-by:  Mark Lord <lkml@rtr.ca>
Acked by: Ju, Seokmann <Seokmann.Ju@engenio.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-08 09:08:54 -05:00
Andrew Vasquez
0da69df1e5 [SCSI] qla2xxx: Correct short-WRITE status handling.
Properly check FC_RESID for any non-transfered bytes
regardless of firmware completion status.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-07 09:33:17 -05:00
Andrew Vasquez
23443b1d61 [SCSI] qla2xxx: Correct mis-handling of AENs.
A regression in a recent change
33135aa2a5 caused the driver
to mistakenly drop handling of AENs.  Due to the incorrect
handling, ports would not reappear after RSCNs and LIPs.

Drops unused/incorrect compound #define from qla_def.h.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-07 09:30:49 -05:00
Dave C Boutcher
bb58596f68 [SCSI] ibmvscsi kexec fix
This makes ibmvscsi work correctly with the recent set of kexec
patches that went in.  This is based on work by Michael Ellerman, who
chased this initially.  He validated that it works during kexec.

Handle kexec correctly in ibmvscsi.   During kexec the adapter
will not get cleaned up correctly, so we may need to reset it
to make it sane again.

Signed-off-by: Dave Boutcher <sleddog@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-07 09:30:01 -05:00
Albert Lee
fe79e683cc [PATCH] libata: err_mask misc fix
1. ata_pio_complete():
     It seems unnecessary to wait for the clearing of the DRQ bit.
     (Waiting for BSY=0 should be enough.
     ata_ok() also checks the correctness of the status bits later.)

  2. ata_pio_block():
     - added error checking, before transfering data.
     - minor comments fix

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:23 -05:00
Albert Lee
d8fe452b3e [PATCH] libata: determine the err_mask directly in atapi_packet_task()
- set qc->err_mask directly when we found the error
  - remove the code to determine err_mask from device status

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:23 -05:00
Albert Lee
1c8489840e [PATCH] libata: determine the err_mask when the error is found
- move "qc->err_mask |= AC_ERR_ATA_BUS" to where the error is found
  - add "assert(qc->err_mask)" to ata_pio_error() to make sure qc->err_mask was available when we enter the error state

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:23 -05:00
Albert Lee
a22e2eb071 [PATCH] libata: move err_mask to ata_queued_cmd
- remove err_mask from the parameter list of the complete functions
  - move err_mask to ata_queued_cmd
  - initialize qc->err_mask when needed
  - for each function call to ata_qc_complete(), replace the err_mask parameter with qc->err_mask.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

===============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:22 -05:00
Albert Lee
c14b8331ec [PATCH] libata: minor patch before moving err_mask
- add qc to ata_pio_poll()
  - reorder the initialization of qc in ata_pio_complete()

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

===================
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-06 04:49:22 -05:00
Jeff Garzik
4ef679e6ca Merge branch 'upstream-fixes' 2005-12-03 20:34:14 -05:00
Tejun Heo
9a40525788 [PATCH] libata: fix ata_scsi_pass_thru error handling
This patch makes ata_scsi_pass_thru() properly set result code and
sense data on translation failures.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-03 20:31:16 -05:00
Linus Torvalds
1b0997f561 Revert "[SCSI] fix usb storage oops"
This reverts commit 34ea80ec6a.

It does a put_device() from softirq context, which is bad since it gets
a semaphore for reading.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-02 15:54:37 -08:00
Linus Torvalds
2741049e66 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2005-12-02 14:32:44 -08:00
Hugh Dickins
4d5cda069b [SCSI] sg: fix a bug in st_map_user_pages failure path
sg's st_map_user_pages is modelled on an earlier version of st's
sgl_map_user_pages, and has the same bug: if get_user_pages got some but
not all of the pages, then those got were released, but the positive res
code returned implied that they were still to be freed.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-02 10:24:22 -06:00
Hugh Dickins
032c09d76c [SCSI] sg and st unmap_user_pages allow PageReserved
2.6.15-rc1 made sg's st_unmap_user_pages and st's sgl_unmap_user_pages
BUG on a PageReserved page.  But that's wrong: they could be unmapping
the ZERO_PAGE, which is marked PG_reserved; and perhaps others (while
get_user_pages is still permitted on VM_PFNMAP areas - that may change).

More change is needed here: sg claims to dirty even pages written from,
and st claims not to dirty even pages read into; and SetPageDirty is not
adequate for this nowadays.  Fixes to those follow in a later patch: for
the moment just fix the 2.6.15 regression.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-02 10:24:14 -06:00
Hugh Dickins
6bc733e9f7 [SCSI] st: fix a bug in sgl_map_user_pages failure path
Nick and I had already been looking at drivers/scsi/{sg.c,st.c},
brought there by __put_page in sg.c's peculiar sg_rb_correct4mmap,
which we'd like to remove.  But that's irrelevant to your pain, except...

One extract from the patches I'd like to send Doug and Kai for 2.6.15
or 2.6.16 is this below: since the incomplete get_user_pages path omits
to reset res, but has already released all the pages, it will result in
premature freeing of user pages, and behaviour just like you've seen.

Though I'd have thought incomplete get_user_pages was an exceptional
case, and a bit surprised you'd encounter it.  Perhaps there's some
other premature freeing in the driver, and this instance has nothing
whatever to do with it.

If the problem were easily reproducible, it'd be great if you could
try this patch; but I think you've said it's not :-(

Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-01 16:16:06 -06:00
Matthew Wilcox
8b2f81385a [SCSI] sym2: Disable IU and QAS negotiation
Enabling these features causes problems with some drives, so disable
them until they're debugged

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-01 15:59:50 -06:00
Mark Haverkamp
8bdf810f89 [SCSI] aacraid: Check scsi_bios_ptabe return code
Received from Mark Salyzyn.

scsi_bios_ptable return value is not being checked in aac_biosparm.

Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-01 15:59:44 -06:00
James Bottomley
349cd7cfe6 [SCSI] SPI DV: be more conservative about echo buffer usage
Some SCSI devices apparently get very confused if we try to use the
echo buffer on a non-DT negotiated bus (this mirrors the problems of
using PPR on non-LVD for some devices).  The fix is to be far more
conservative about when we use an echo buffer.  With this patch, we'll
now see what parameters are negotiated by the read only test, and only
look for an echo buffer if DT is negotiated.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-01 15:59:43 -06:00
Arjan van de Ven
98ac62defe [PATCH] mark several libata datastructures const
Hi,

the patch below marks several libata (and libata-driver) structures
const so that they end up in the .rodata segment and don't false-share
cachelines with things that get dirtied often.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-12-01 02:29:35 -05:00
Jeff Garzik
6946d28a9f Merge branch 'master' 2005-12-01 01:58:36 -05:00
Jeff Garzik
6c9e5eb522 [libata sata_promise] minor whitespace cleanup 2005-11-30 16:42:55 -05:00
Christoph Hellwig
238f9b063d [PATCH] fix megaraid.c locking
This fixes locking in megaraid.c, namely:

 (1) make sure megaraid_queue release the adapter lock by changing the
     code to have a single return
 (2) remove the errornous scsi_assign_lock call

Testing by Burton Windle.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Burton Windle <bwindle@fint.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-29 13:03:01 -08:00
Jeff Garzik
b71d4da092 Merge branch 'master' 2005-11-29 03:55:47 -05:00
Vasily Averin
dce200670d [SCSI] aic7xxx: reset handler selects a wrong command
To transport scsi reset command to device aic7xxx reset handler looks
at the driver's pending_list and searches any proper command. However
the search condition has been inverted: ahc_match_scb() returns TRUE
if a matched command is found. As a result the reset on required
devices did not turn out well, a correctly working neighbour device
may be surprised by the reset. aic7xxx reset handler reports about the
success, but really the original situation is not corrected yet.

Signed-off-by: Vasily Averin <vvs@sw.ru>

Naturally, there's a corresponding problem in the aic79xx driver, so
I've also added the same fix for that.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-11-28 12:28:26 -06:00
Adrian Bunk
458af5439f [PATCH] drivers/scsi/dpt_i2o.c: fix a NULL pointer dereference
The Coverity checker spotted this obvious NULL pointer dereference.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-27 20:23:46 -08:00
Matthew Dobson
79e448bf2d [PATCH] Fix a bug in scsi_get_command
scsi_get_command() attempts to write into a structure that may not have
been successfully allocated.  Move this write inside the if statement that
ensures we won't panic the kernel with a NULL pointer dereference.

Signed-off-by: Matthew Dobson <colpatch@us.ibm.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-22 09:13:44 -08:00
Jeff Garzik
656563e32c [libata] Print out SATA speed, if link is up
Make the SATA phy probe messages a bit more informative.

Note this only applies to drivers that use __sata_phy_reset(),
which excludes some drivers.
2005-11-20 03:36:45 -05:00
Jeff Garzik
4b317d212c Merge branch 'master' 2005-11-18 19:55:06 -05:00
Linus Torvalds
b286e39207 Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6 2005-11-18 15:58:38 -08:00
Laurent Riffard
4ef3b8f4a5 [PATCH] ide: remove ide_driver_t.owner field
The structure ide_driver_t have a .owner field which is a duplicate
of .gendriver.owner field (.gen_driver is a struct device_driver).

This patch removes ide_driver_t's owner field.

Signed-off-by: Laurent Riffard <laurent.riffard@free.fr>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-11-18 22:15:40 +01:00
Jeff Garzik
e2b1be56c5 [libata sata_mv] update copyright, driver version 2005-11-18 14:04:23 -05:00
Tejun Heo
c0ab424238 [PATCH] sil24: make error_intr less verbose
sil24_error_intr logs all error interrupts.  ATAPI devices generates
many harmless errors which can be ignored and all serious ones are
reported via sense data by SCSI layer.  Don't log device errors from
ATAPI devices.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-18 13:11:39 -05:00
Tejun Heo
69ad185fa1 [PATCH] sil24: add ATAPI support
This patch implements ATAPI support for sil24 and bumps driver version
to 0.23.

Signed-off-by: Tejun Heo <htejun@gmail.com>

--

Jeff, it has been converted to use ->dev_config as pointed out.
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-18 13:11:39 -05:00
Tejun Heo
ca45160db7 [PATCH] sil24: use SRST for phy_reset
There seems to be no way to obtain device signature from sil24 after
SATA phy reset and SRST is needed anyway for later port multiplier
suppport.  This patch converts sil24_phy_reset to use SRST instaed.

Signed-off-by: Tejun Heo <htejun@gmail.com>

--

Jeff, I didn't remove the 10ms sleep just to be on the safe side.  I
think we can live with 10ms sleep on SRST.
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-18 13:11:39 -05:00
Tejun Heo
7d1ce682d0 [PATCH] sil24: add sil24_restart_controller
When an error condition is raised by device via D2H FIS or SDB.  sil24
controller should be restarted by setting PORT_CS_INIT and waiting
until PORT_CS_RDY is asserted instead of resetting the controller.
This patch implements sil24_restart_controller for those cases.  This
patch also makes sure that PORT_CS_RDY is asserted on
sil24_reset_controller completion.

Signed-off-by: Tejun Heo <htejun@gmail.com>

--

Jeff, delay is reduced to 1us and cnt increased to 10k.  My sil3124
turns on PORT_CS_RDY on the second iteration even without any delay.
I think 10k * 1us should be more than enough.

I tried to convert both restart and reset to use msleep's with work
queue, but if we do that, host_set lock should be released after
initiating restart or reset, leading to race condition among
reset/restart, other interrupts and timeout.  Implementing
synchronization among those in low-level driver doesn't seem right.
Well, reduced timeout should work for the time being.

Thanks.
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-18 13:11:39 -05:00