Commit Graph

88 Commits

Author SHA1 Message Date
Albert Lee
6952df0355 [PATCH] sg traverse fix for __atapi_pio_bytes()
Problem:
Incorrect md5sum when using ATAPI PIO mode to verify a distro CD.

Root cause:  sg traverse problem.
In __atapi_pio_bytes(), if qc->cursg++ is increased and "goto
next_page" is executed, then sg is not updated to the new qc->cursg
and the old sg is overwritten with the new data.

Changes:
- Replace "goto next_page" with "goto next_sg" to make sg updated.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
2005-06-09 03:14:59 -04:00
Jens Axboe
e1dd23a001 [PATCH] sata_sil: Fix FIFO PCI Bus Arbitration kernel oops
Correct this.

diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
2005-06-09 03:06:22 -04:00
Linus Torvalds
d8d088d258 Automatic merge of rsync://www.parisc-linux.org/~jejb/git/scsi-for-linus-2.6 2005-06-03 08:54:02 -07:00
Nathan Lynch
c92715b3c2 [SCSI] fix slab corruption during ipr probe
With CONFIG_DEBUG_SLAB=y I see slab corruption messages during boot on
pSeries machines with IPR adapters with any 2.6.12-rc kernel.

The change which seems to have introduced the problem is "SCSI: revamp
target scanning routines" and may be found at:
http://marc.theaimsgroup.com/?l=bk-commits-head&m=111093946426333&w=2

In order to revert that in a 2.6.12-rc1 tree, I had to revert "target
code updates to support scanned targets" first:
http://marc.theaimsgroup.com/?l=bk-commits-head&m=111094132524649&w=2

With both patches reverted, the corruption messages go away.

ipr: IBM Power RAID SCSI Device Driver version: 2.0.13 (February 21,
2005)
ipr 0001:d0:01.0: Found IOA with IRQ: 167
ipr 0001:d0:01.0: Starting IOA initialization sequence.
ipr 0001:d0:01.0: Adapter firmware version: 020A005C
ipr 0001:d0:01.0: IOA initialized.
scsi0 : IBM 570B Storage Adapter
  Vendor: IBM       Model: VSBPD4E1  U4SCSI  Rev: 4770
  Type:   Enclosure                          ANSI SCSI revision: 02
  Vendor: IBM   H0  Model: HUS103036FL3800   Rev: RPQF
  Type:   Direct-Access                      ANSI SCSI revision: 04
  Vendor: IBM   H0  Model: HUS103036FL3800   Rev: RPQF
  Type:   Direct-Access                      ANSI SCSI revision: 04
  Vendor: IBM   H0  Model: HUS103036FL3800   Rev: RPQF
  Type:   Direct-Access                      ANSI SCSI revision: 04
  Vendor: IBM   H0  Model: HUS103036FL3800   Rev: RPQF
  Type:   Direct-Access                      ANSI SCSI revision: 04
  Vendor: IBM       Model: VSBPD4E1  U4SCSI  Rev: 4770
  Type:   Enclosure                          ANSI SCSI revision: 02
Slab corruption: start=c0000001e8de5268, len=512
Redzone: 0x5a2cf071/0x5a2cf071.
Last user: [<c00000000029c3a0>](.scsi_target_dev_release+0x28/0x50)
080: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6a
Prev obj: start=c0000001e8de5050, len=512
Redzone: 0x5a2cf071/0x5a2cf071.
Last user: [<0000000000000000>](0x0)
000: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
Next obj: start=c0000001e8de5480, len=512
Redzone: 0x170fc2a5/0x170fc2a5.
Last user: [<c000000000228d7c>](.as_init_queue+0x5c/0x228)
000: c0 00 00 01 e8 83 26 08 00 00 00 00 00 00 00 00
010: 00 00 00 00 00 00 00 00 c0 00 00 01 e8 de 54 98
Slab corruption: start=c0000001e8de5268, len=512
Redzone: 0x5a2cf071/0x5a2cf071.
Last user: [<c00000000029c3a0>](.scsi_target_dev_release+0x28/0x50)
080: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6a
Prev obj: start=c0000001e8de5050, len=512
Redzone: 0x5a2cf071/0x5a2cf071.
Last user: [<0000000000000000>](0x0)
000: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
Next obj: start=c0000001e8de5480, len=512
Redzone: 0x170fc2a5/0x170fc2a5.
Last user: [<c000000000228d7c>](.as_init_queue+0x5c/0x228)
000: c0 00 00 01 e8 83 26 08 00 00 00 00 00 00 00 00
010: 00 00 00 00 00 00 00 00 c0 00 00 01 e8 de 54 98
...

I did some digging and the problem seems to be a refcounting issue in
__scsi_add_device.  The target gets freed in scsi_target_reap, and
then __scsi_add_device tries to do another device_put on it.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-03 09:38:55 -05:00
Andrew Vasquez
18e144d32c [SCSI] qla2xxx: fix bad locking during eh_abort
Correct incorrect locking order in qla2xxx_eh_abort() handler which
would case a hang during certain code-paths.

With extra pieces to fix the irq state in the locks.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-03 09:37:53 -05:00
d7aaf48128 Automatic merge of /spare/repo/linux-2.6/.git branch HEAD 2005-06-02 18:43:09 -04:00
Jeff Garzik
decc6d0b68 libata: kernel-doc warning fixes 2005-06-02 18:42:33 -04:00
Edward Falk
0baab86b00 libata: update inline source docs 2005-06-02 18:17:13 -04:00
Jeff Garzik
0cba632b73 libata: doc updates 2005-05-30 19:49:12 -04:00
Jeff Garzik
780a87f718 libata: more doc updates
Document recently-added ata_port_operations hooks.

Fill several doc stubs in libata-core.c.
2005-05-30 15:41:05 -04:00
Linus Torvalds
79158229b0 Automatic merge of 'misc-fixes' branch from
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
2005-05-29 19:30:03 -07:00
Jeff Garzik
7238cfb334 libata: bump version 2005-05-29 14:48:20 -04:00
d582c4ea30 Automatic merge of /spare/repo/netdev-2.6 branch use-after-unmap 2005-05-29 14:24:57 -04:00
Shaohua Li
8bd7f125e2 [PATCH] swsusp: ahd_dv_0 can't be stopped
This driver wants to set PF_NOFREEZE.

Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-28 11:14:01 -07:00
domen@coderock.org
87507cfdd2 [PATCH] drivers/scsi/ahci: add #include req'd for the DMA_{64,32}BIT_MASK constants
The previous patch did not compile cleanly on all architectures so
here's a fixed one which #includes <linux/dma-mapping.h>.

Use the DMA_{64,32}BIT_MASK constants from dma-mapping.h when calling
pci_set_dma_mask() or pci_set_consistent_dma_mask()
This patch includes dma-mapping.h explicitly because it caused errors
on some architectures otherwise.
See http://marc.theaimsgroup.com/?t=108001993000001&r=1&w=2 for details

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Domen Puncer <domen@coderock.org>

diff -puN drivers/scsi/ahci.c~dma_mask-drivers_scsi_ahci drivers/scsi/ahci.c
2005-05-27 23:59:16 -04:00
domen@coderock.org
7003c05d77 [PATCH] drivers/scsi/sata_vsc: add #include req'd for DMA_32BIT_MASK constant
The previous patch did not compile cleanly on all architectures so
here's a fixed one which #includes <linux/dma-mapping.h>.

Use the DMA_{64,32}BIT_MASK constants from dma-mapping.h when calling
pci_set_dma_mask() or pci_set_consistent_dma_mask()
This patch includes dma-mapping.h explicitly because it caused errors
on some architectures otherwise.
See http://marc.theaimsgroup.com/?t=108001993000001&r=1&w=2 for details

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Domen Puncer <domen@coderock.org>

diff -puN drivers/scsi/sata_vsc.c~dma_mask-drivers_scsi_sata_vsc drivers/scsi/sata_vsc.c
2005-05-27 23:59:16 -04:00
Jeff Garzik
aa8f0dc6c3 libata: Fix use-after-iounmap
Jens Axboe pointed out that the iounmap() call in libata was occurring
too early, and some drivers (ahci, probably others) were using ioremap'd
memory after it had been unmapped.

The patch should address that problem by way of improving the libata
driver API:

* move ->host_stop() call after all ->port_stop() calls have occurred.

* create default helper function ata_host_stop(), and move iounmap()
call there.

* add ->host_stop_prewalk() hook, use it in sata_qstor.c (hi Mark).
sata_qstor appears to require the host-stop-before-port-stop ordering
that existed prior to applying the attached patch.
2005-05-26 21:54:27 -04:00
Linus Torvalds
cdbbde14cb Merge of 'misc-fixes' branch from
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
2005-05-26 10:02:30 -07:00
Stuart Hayes
41bb4c43b3 [PATCH] ide-scsi: kmap scatter/gather before doing PIO
From: Stuart Hayes <Stuart_Hayes@dell.com>

The system can panic with a null pointer dereference using ide-scsi if
PIO is being done on scatter gather pages that are in high memory,
because page_address() returns 0.  We are actually seeing this using a
tape drive.  This patch will kmap_atomic() the pages before performing
PIO.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
2005-05-26 15:38:45 +02:00
Bartlomiej Zolnierkiewicz
8604affde9 [PATCH] convert IDE device drivers to driver-model
* add ide_bus_match() and export ide_bus_type
* split ide_remove_driver_from_hwgroup() out of ide_unregister()
* move device cleanup from ide_unregister() to drive_release_dev()
* convert ide_driver_t->name to driver->name
* convert ide_driver_t->{attach,cleanup} to driver->{probe,remove}
* remove ide_driver_t->busy as ide_bus_type->subsys.rwsem
  protects against concurrent ->{probe,remove} calls
* make ide_{un}register_driver() void as it cannot fail now
* use driver_{un}register() directly, remove ide_{un}register_driver()
* use device_register() instead of ata_attach(), remove ata_attach()
* add proc_print_driver() and ide_drivers_show(), remove ide_drivers_op
* fix ide_replace_subdriver() and move it to ide-proc.c
* remove ide_driver_t->drives, ide_drives and drives_lock
* remove ide_driver_t->drivers, drivers and drivers_lock
* remove ide_drive_t->driver and DRIVER() macro

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
2005-05-26 14:55:34 +02:00
Albert Lee
32529e0128 [PATCH] libata: Fix zero sg_dma_len() on 64-bit platform
When testing ATAPI PIO data transfer on the ppc64 platform,  __atapi_pio_bytes() got zero when
sg_dma_len() is used. I checked the <asm-ppc64/scatterlish.h>, the struct scatterlist is defined as:

struct scatterlist {
	struct page *page;
	unsigned int offset;
	unsigned int length;

	/* For TCE support */
	u32 dma_address;
	u32 dma_length;
};

#define sg_dma_address(sg)	((sg)->dma_address)
#define sg_dma_len(sg)		((sg)->dma_length)

So, if the scatterlist is not DMA mapped, sg_dma_len() will return zero on ppc64.
The same problem should occur on the x86-64 platform.
On the i386 platform, sg_dma_len() returns sg->length, that's why the problem does not occur on an i386.

Changes:
- Use sg->length if the scatterlist is not DMA mapped (yet).

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
2005-05-26 03:49:42 -04:00
Francisco Javier
4c3a53d410 [PATCH] sata_promise: add PCI ID for FastTrak TX2200 2-ports 2005-05-25 19:29:37 -04:00
NAKAMURA Kenta
525a099771 [PATCH] sata_sil: new ID 1002:437A for ATI IXP400 2005-05-25 19:28:38 -04:00
Andrew Morton
d981289627 [PATCH] aic7xxx_osm build fix
Fix a c99ism.

Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-24 20:08:14 -07:00
Linus Torvalds
9636273dae Automatic merge of rsync://www.parisc-linux.org/~jejb/git/scsi-for-linus-2.6.git 2005-05-20 17:21:03 -07:00
James Bottomley
2bf2c568c8 [SCSI] aic7xxx: fix U160 mode
The new period/dt setting routines don't get the coupling of these
parameters correct.  This means that Domain Validation never gets DT
set, and thus the drive gets restricted to U80.

Fix this by restoring the couplings in the set routines.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 16:43:51 -05:00
James Bottomley
fb3089dfb5 [SCSI] aic7xxx: add back locking
Tampering with the settings has to be done under the host lock ...
slave_alloc isn't called under any lock, so this has to be done
explicitly.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:43 -05:00
James Bottomley
c7525233d2 [SCSI] aic7xxx: make correct use of slave_alloc/destroy and remove the per device timer
The allocation of all of our components should be done in slave alloc.
Currently it's rather fancifully refcounted in the queuecommand
callback.  This patch moves allocation and destroy to their correct
places in slave_alloc/slave_destory.  Now we can guarantee that
everywhere a device is requested, it's actually been allocated, so don't
check for this anymore.

Additionally, the per device busy timer was the only source of potential
use after free.  It's been deleted because Linux does the correct thing
with busy returns, so there's no need to implement a separate timer in
the driver.

Finally, implement code that forces all the device parameters to zero
(i.e. async and narrow) in the slave alloc, inform the spi class of the
bios recorded maximums and wait until slave configure before trying
anything more adventurous.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:42 -05:00
James Bottomley
8e45ebcc66 [SCSI] aic7xxx: remove the completeq
This should finish the spurious queue removal from aic7xxx (there are
other queues that are probably unnecessary, but at least the major and
obviously unnecessary ones are done with).

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:40 -05:00
James Bottomley
38c29ce06d [SCSI] aic7xxx: remove the last vestiges of the runq
This was rendered obsolete by the busyq removal; remove some of the last
remnants of its presence.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:39 -05:00
Christoph Hellwig
013791ee01 [SCSI] aic7xxx: remove usage of obsolete typedefs
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:38 -05:00
Christoph Hellwig
7dfa0f2673 [SCSI] remove dma_mask hacks
pci_alloc_consistent is under 4G by default.  Also simplify the
definition of bus_dmamap_t.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:37 -05:00
Christoph Hellwig
dedd831081 [SCSI] aic7xxx: remove Linux 2.4 ifdefs
There's not much sense in sharing code anymore now that aic7xxx uses
various transport class facilities.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:36 -05:00
Christoph Hellwig
c06716fe1c [SCSI] aic7xxx: remove some DV leftovers
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:35 -05:00
James Bottomley
e4e360c325 [SCSI] remove aic7xxx busyq
The aic7xxx driver has two spurious queues in it's linux glue code: the
busyq which queues incoming commands to the driver and the completeq
which queues finished commands before sending them back to the mid-layer

This patch just removes the busyq and makes the aic finally return the
correct status to get the mid-layer to manage its queueing, so a command
is either committed to the sequencer or returned to the midlayer for
requeue.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:34 -05:00
James Bottomley
fad01ef88d [SCSI] correct aic7xxx period setting routines
This is similar to the previous sym2 problem.  For Domain Validation to
work we can't allow any period setting to turn wide on if it was
previously off.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:33 -05:00
James Bottomley
62a8612972 [SCSI] implement parameter limits in the SPI transport class
There's a basic need not to have parameters go under or over certain
values when doing domain validation.  The basic ones are

max_offset, max_width and min_period

This patch makes the transport class take and enforce these three
limits.  Currently they can be set by the user, although they could
obviously be read from the HBA's on-board NVRAM area during
slave_configure (if it has one).

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-20 15:54:32 -05:00
f3ac91cf52 Merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 2005-05-17 11:30:39 -04:00
Brett Russ
cdcca89e1a [PATCH] libata: flush COMRESET set and clear
Updated patch to fix erroneous flush of COMRESET set and missing flush
of COMRESET clear.  Created a new routine scr_write_flush() to try to
prevent this in the future.  Also, this patch is based on libata-2.6
instead of the previous libata-dev-2.6 based patch.

Signed-off-by: Brett Russ <russb@emc.com>

Index: libata-2.6/drivers/scsi/libata-core.c
===================================================================
2005-05-15 19:00:51 -04:00
Albert Lee
21b1ed74ee [PATCH] libata: Prevent the interrupt handler from completing a command twice
Problem:
   During the libata CD-ROM stress test, sometimes the "BUG: timeout
without command" error is seen.

Root cause:
  Unexpected interrupt occurs after the ata_qc_complete() is called,
but before the SCSI error handler.  The interrupt handler is invoked
before the SCSI error handler, and it clears the command by calling
ata_qc_complete() again.  Later when the SCSI error handler is run,
the ata_queued_cmd is already gone, causing the "BUG: timeout without
command" error.

Changes:
  - Use the ATA_QCFLAG_ACTIVE flag to prevent the interrupt handler
from completing the command twice, before the scsi_error_handler.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
2005-05-15 18:46:59 -04:00
John W. Linville
f85bdb9ce9 [PATCH] libata: stop setting sdev->host->max_sectors for lba48 drives
Avoid changing sdev->host->max_sectors because it can prevent use of
non-lba48 drives on other ports of the same adapter.

Signed-off-by: Stuart Hayes <stuart_hayes@Dell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2005-05-15 18:01:22 -04:00
Rolf Eike Beer
104e50108c [PATCH] typo fix in drivers/scsi/sata_svw.c comment
Add missing brace.
2005-05-12 12:36:04 -04:00
Linus Torvalds
07342d623b Automatic merge of rsync://www.parisc-linux.org/~jejb/git/scsi-for-linus-2.6.git 2005-05-06 16:46:40 -07:00
James Bottomley
e4862fedbc [SCSI] correct the sym2 period setting routines
There's a slight bug in the routines in that if the period requires dt,
then the routine will unconditionally set it.  DT may only be set if
Wide is also set, so this turns back on the wide bit.

For domain validation to work correctly, we need to observe the wide bit
absolutely.

Acked by: Matthew Wilcox <willy@debian.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-06 15:12:02 -05:00
Adrian Bunk
b6f0b0d016 [PATCH] drivers/scsi/sym53c416.c: fix a wrong check
The Coverity checker found that this for loop was wrong.

This patch changes it to what seems to be intended.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Matthew Wilcox <willy@debian.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-05 16:36:51 -07:00
Adrian Bunk
cad359c684 [PATCH] fix NCR53C9x.c compile warning
drivers/scsi/NCR53C9x.c: In function `esp_do_data':
drivers/scsi/NCR53C9x.c:1838: warning: unused variable `flags'

Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-05 16:36:50 -07:00
James Bottomley
949bf79759 [SCSI] fix command retries in spi_transport class
The premise is that domain validation is likely to trigger errors which
it wants to know about, so the only time it should be retrying them is
when it gets a unit attention (likely as the result of a previous bus or
device reset).  Ironically, the previous coding retried three times in
all cases except those of unit attention.  The attached fixes this to do
the right thing.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-05 16:08:59 -05:00
Al Viro
a553260618 [PATCH] ISA DMA Kconfig fixes - part 3
Drivers that expect ISA DMA API are marked as such in Kconfig.

Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-04 07:33:14 -07:00
Mike Christie
69b528936b [SCSI] call correct scsi_done function in scsi_dispatch_cmd
scsi_dispatch_cmd currently calls scsi_done when the device is in the
SDEV_DEL state, but at this point the command has not had a timer added 
to it (this is done a couple lines down) so scsi_done just returns and 
the command is lost. The attached patch made against 2.6.12-rc3 calls 
__scsi_done in this case so the comamnd will be returned upwards.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-05-01 14:47:15 -05:00
Adrian Bunk
408b664a7d [PATCH] make lots of things static
Another large rollup of various patches from Adrian which make things static
where they were needlessly exported.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-01 08:59:29 -07:00