Commit Graph

1153 Commits (b9a33cebac70d6f67a769ce8d4078fee2b254ada)

Author SHA1 Message Date
Al Viro 4897080077 [PATCH] sd: fix memory corruption with broken mode page headers
There's a problem in sd where we blindly believe the length of the
headers and block descriptors.  Some devices return insane values for
these and cause our length to end up greater than the actual buffer
size, so check to make sure.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Also removed the buffer size magic number (512) and added DPOFUA of
zero to the defaults

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-26 09:09:49 -08:00
Christoph Hellwig a6ceda7457 [SCSI] esp: fix eh locking
esp_reset didn't get fixed when the EH locking changed.
->eh_bus_reset_handler is now called without the host lock held.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-02-22 14:35:52 -08:00
Tejun Heo 2e242fa994 [PATCH] libata: make ata_sg_setup_one() trim zero length sg
This patch makes ata_sg_setup_one() trim sg entry (thus making
qc->n_elem zero) if padding results in zero length sg entry.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 16:48:18 -05:00
Tejun Heo 9ae61c6cb6 [PATCH] libata: fix WARN_ON() condition in *_fill_sg()
For ATAPI commands, padding can reduce qc->n_elem by one and thus to
zero making assert(qc->n_elem > 0)'s in ata_fill_sg() and qs_fill_sg()
fail for legal commands.  This patch fixes the assert()'s to take
qc->pad_len into account.

Although the condition check seems a bit excessive, as this part of
code isn't still stable yet, I think it's worth to keep those.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-20 16:48:17 -05:00
Jens Axboe c15d85c8f3 [PATCH] Add missing FUA write to sata_mv dma command list
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-17 16:31:18 -05:00
Albert Lee 0565c26de7 [PATCH] libata: minor fix for 2.6.16-rc3
- Fix the array index value in ata_rwcmd_protocol() for the added FUA commands.
 - Filter out ATAPI packet command error messages in ata_pio_error()

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-17 16:29:07 -05:00
Dan Williams 2ae5b30ff0 [PATCH] Necessary evil to get sata_vsc to initialize with Intel iq3124h hba
* libata does not care about error interrupts, so handle them locally
* the interrupts that are ignored only appear to happen at init time

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2006-02-17 16:27:19 -05:00
Linus Torvalds 26d451b603 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2006-02-16 12:47:44 -08:00
James Bottomley 65110b2168 [SCSI] fix wrong context bugs in SCSI
There's a bug in releasing scsi_device where the release function
actually frees the block queue.  However, the block queue release
calls flush_work(), which requires process context (the scsi_device
structure may release from irq context).  Update the release function
to invoke via the execute_in_process_context() API.

Also clean up the scsi_target structure releasing via this API.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-14 11:15:11 -06:00
James Bottomley faead26d7a [PATCH] add scsi_execute_in_process_context() API
We have several points in the SCSI stack (primarily for our device
functions) where we need to guarantee process context, but (given the
place where the last reference was released) we cannot guarantee this.

This API gets around the issue by executing the function directly if
the caller has process context, but scheduling a workqueue to execute
in process context if the caller doesn't have it.  Unfortunately, it
requires memory allocation in interrupt context, but it's better than
what we have previously.  The true solution will require a bit of
re-engineering, so isn't appropriate for 2.6.16.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-14 11:14:26 -06:00
Matthew Wilcox e2230eac17 [SCSI] sym2: Mask off opcode from RBC
pm->sg.size is set from the Residual Byte Count register.  However,
the upper byte of the RBC is the opcode of the instruction that was
executing, so we need to mask it off.  This fixes some spurious rejects
of IGNORE WIDE RESIDUE messages.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-12 11:13:09 -06:00
Ju, Seokmann 3542adcb35 [SCSI] megaraid_legacy: kobject_register failure
Attached patch fixes problem that cause kobject_register failure
during loading.  Kobject_register would fail when there are more than
1 module with same module name.  This patch will change module name of
megaraid_legacy from 'megaraid' to 'megaraid_legacy'.

Signed-Off-by: Seokmann Ju <seokmann.ju@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-12 11:11:09 -06:00
Brian King 4733804c9f [SCSI] ipr: Fix adapter initialization failure
Since scsi core is always sending scatterlists now, remove
some code which was written with the bad assumption that
a small transfer would not be sent down in a scatterlist.
Without this fix, the ipr driver ends up sending garbage
data to the adapter following a reset, causing it to
fail the reset and take the adapter offline.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-12 11:05:44 -06:00
Jeff Garzik 9caafa6c86 Merge branch 'upstream-fixes' 2006-02-09 04:29:00 -05:00
Jeff Garzik cac0e8e8bb Merge branch 'master' 2006-02-09 00:58:59 -05:00
Al Viro 2d20eaf942 [PATCH] sg gfp_t annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-02-07 20:58:27 -05:00
Al Viro e5fb81bd89 [PATCH] scsi_transport_iscsi gfp_t annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-02-07 20:58:21 -05:00
Al Viro 7be7cbf684 [PATCH] drivers/scsi/mac53c94.c __iomem annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-02-07 20:57:14 -05:00
Al Viro 164006da31 [PATCH] bogus asm/delay.h includes
asm/delay.h is non-portable; linux/delay.h should be used in generic code.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-02-07 20:56:41 -05:00
andrew.vasquez@qlogic.com 0d4be1240b [PATCH] qla2xxx: Correct lun assignment during IOCB submission.
4gb products require an IOCB's FCP-LUN to be formatted in
wire-format prior to submission.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-07 10:54:07 -06:00
andrew.vasquez@qlogic.com 247ec457ce [PATCH] qla2xxx: Pass input-buffer length to Get-ID-List mailbox command.
Recent ISP24xx firmwares require that mailbox register 8 be
set to the maximum number of bytes to transfer during DMA
copying of the list.  We safely set this value to zero
(infinite), since the call is *only* made in FCAL
topologies.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-07 10:54:05 -06:00
andrew.vasquez@qlogic.com f7757a5f0f [PATCH] qla2xxx: Remove bogus debug-code.
Commit 854165f424
inadvertently added some code meant only for testing -- the
driver was ignoring the non-zero function numbers of a
multi-port HBA.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-07 10:54:02 -06:00
andrew.vasquez@qlogic.com 387f96b4d9 [PATCH] qla2xxx: Close window on race between rport removal and fcport transition.
Fcport visibility is recognized during interrupt time, but,
rport removal can only occur during a process
(sleeping)-context.  Return a DID_IMM_RETRY status for
commands submitted within this window to insure I/Os do not
prematurely run-out of retries.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-07 10:53:56 -06:00
adam radford 62288f105b [SCSI] 3ware 9000 driver >4GB memory fix
The attached patch fixes a bug in the 3ware 9000 series driver:

- Fix use_sg == 0 mapping on systems with 4GB or higher.

  This fixes REPORT_LUNS (0xa0) failing with 3ware 9000 controllers on systems
  with lots of ram, mentioned in bugzilla # 6009:

      http://bugzilla.kernel.org/show_bug.cgi?id=6009

Signed-off-by: Adam Radford <linuxraid@amcc.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-05 17:15:15 -06:00
Eric Dumazet 88a2a4ac6b [PATCH] percpu data: only iterate over possible CPUs
percpu_data blindly allocates bootmem memory to store NR_CPUS instances of
cpudata, instead of allocating memory only for possible cpus.

As a preparation for changing that, we need to convert various 0 -> NR_CPUS
loops to use for_each_cpu().

(The above only applies to users of asm-generic/percpu.h.  powerpc has gone it
alone and is presently only allocating memory for present CPUs, so it's
currently corrupting memory).

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Jens Axboe <axboe@suse.de>
Cc: Anton Blanchard <anton@samba.org>
Acked-by: William Irwin <wli@holomorphy.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-05 11:06:51 -08:00
Jenx Axboe 40cdc840dc [SCSI] gdth: don't map zero-length requests
Don't map zero-length requests in gdth, zome architectures don't like
that in their dma mapping routines.

[ I'm pretty sure Jens posted this before, but for some reason it got
  forgotten  --hch ]

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-05 12:59:29 -06:00
Sumant Patro f9876f0b67 [SCSI] megaraid_sas: support for 1078 type controller added
This patch adds support for 1078 type controller (device id : 0x60).

Signed-off-by: Sumant Patro <Sumant.Patro@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:38:41 -06:00
Joshua Giles 122da30223 [SCSI] megaraid_sas: register 16 byte CDB capability
This patch properly registers the 16 byte command length capability of
the megaraid_sas controlled hardware with the scsi midlayer.  All
megaraid_sas hardware supports 16 byte CDB's.

Signed-off-by: Joshua Giles <joshua_giles@dell.com>
Signed-off-by: Sumant Patro <Sumant.Patro@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:37:29 -06:00
Mike Christie b5b8101653 [SCSI] iscsi update: rm unused sessions list
rm unused sessions list.

This patch is last becuase I was not sure if this patchset was
going to be applied over the kmalloc2kzalloc one by JesS. If it
is then this patch will not apply and can be dropped for now. I will
resend later when things setttle down.

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>
2006-02-04 16:30:37 -06:00
Mike Christie 28e5554df6 [SCSI] iscsi update: use gfp_t
Use gfp_t. I accidentally removed this in our last update.

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>
2006-02-04 16:20:12 -06:00
Mike Christie b36ae07cb7 [SCSI] iscsi update: fix mgmt pool err path release
>From ogerlitz@voltaire.com:

mgmtpool shoild be frees in immdata_alloc_fail label.

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>
2006-02-04 16:19:53 -06:00
Mike Christie 351f739e68 [SCSI] iscsi update: set correct state at creation time
>From erezz@voltaire.com:

We are still in ISCSI_STATE_FREE state at create time. The addition
of the first connection puts us in ISCSI_STATE_LOGGED_IN.

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>
2006-02-04 16:19:31 -06:00
Mike Christie 1fd459e367 [SCSI] iscsi update: rm conn lock
>From erezz@voltaire.com:

rm conn->lock since it is not used anymore. The dataqueue is protected
by the session lock and xmitmutex.

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>
2006-02-04 16:19:08 -06:00
Mike Christie ee7f8e4053 [SCSI] iscsi update: set deamon pid earlier
>From michaelc@cs.wisc.edu:

If the transport lookup fails we set the daemon pid too late.
This can cause us deadlock since the netlink code will think we
meant to call back into our iscsi_if_rx function.

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>
2006-02-04 16:18:51 -06:00
Mike Christie 142e301fc8 [SCSI] iscsi update: setup pool before using
>From andmike@us.ibm.com:

 Ensure that pool data is setup prior to calling mempool_create as it will
 call the the alloc function during create.

Signed-off-by: Mike Anderson <andmike@us.ibm.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>
2006-02-04 16:18:27 -06:00
Mike Christie 5b940adf5b [SCSI] iscsi update: pass correct skb to skb_trim
>From da-x@monatomic.org:

Wrong skb is passed to skb_trim in iscsi_if_get_stats.

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>
2006-02-04 16:18:09 -06:00
Mike Christie 7b7232f3fb [SCSI] iscsi update: cleanup iscsi class interface
From:
michaelc@cs.wisc.edu
fujita.tomonori@lab.ntt.co.jp
da-x@monatomic.org

and err path fixup from:
ogerlitz@voltaire.com

This patch cleans up that interface by having the lld and class
pass a iscsi_cls_session or iscsi_cls_conn between each other when
the function is used by HW and SW iscsi llds. This way the lld
does not have to remember if it has to send a handle or pointer
and a handle or pointer to connection, session or host.

This also has the class verify the session handle that gets passed from
userspace instead of using the pointer passed into the kernel directly.

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>
2006-02-04 16:17:03 -06:00
Mark Haverkamp bb08f92ebd [SCSI] aacraid: use no_uld_attach flag
Received From Mark Salyzyn.

In order to support user tools accessing the array components (SMART,
Mode Page information, Cache page adjustments, WWN determination,
Firmware updates etc), we take advantage of the no_uld_attach flag and
deprecate the code that filters Inquiries to block the requests to array
components. The quirk prevents the sd layer from attaching to the
components.

We also took the opportunity to balance the queue depths based on the
total adapter queue depth to the array devices to reduce the chances of
starvation.

Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:16:14 -06:00
Mark Haverkamp bfb35aa850 [SCSI] aacraid: Update global function names
Received from Mark Salyzyn,

Reduce the possibility of namespace collision.  Prefix with aac_.

Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:16:07 -06:00
Mark Haverkamp d8a571135a [SCSI] aacraid: reduce device probe warnings
Received from Mark Salyzyn.

This patch sets up some device quirks surrounding arrays to inform the
scsi layer that various mode pages are not supported. This reduces the
severity of the complaints that show up in the logs as the array devices
are enumerated.

Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:15:56 -06:00
andrew.vasquez@qlogic.com 854165f424 [SCSI] qla2xxx: Add support to retrieve/update HBA option-rom.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:12:41 -06:00
andrew.vasquez@qlogic.com 1b3f63659b [SCSI] qla2xxx: Return correct data-len during NVRAM retrieval.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:12:19 -06:00
andrew.vasquez@qlogic.com f6df144cca [SCSI] qla2xxx: Add beacon support via class-device attribute.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:11:57 -06:00
andrew.vasquez@qlogic.com 392e2f651c [SCSI] qla2xxx: Add host-statistics FC transport attributes.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:11:35 -06:00
andrew.vasquez@qlogic.com 8d067623ad [SCSI] qla2xxx: Add host port-type FC transport attribute.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:10:28 -06:00
andrew.vasquez@qlogic.com 04414013bb [SCSI] qla2xxx: Add port-speed FC transport attribute.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-04 16:10:07 -06:00
Jeff Garzik ddef9bb367 [libata sata_mv] do not enable PCI MSI by default
Several bug reports have come in, noting that disabling CONFIG_PCI_MSI
has fixed their problems with this driver.  This may be generic system
issues, but there is also the probability of unimplemented hardware
errata workarounds.  Until this ream of bug reports is sorted out, we
can get them going in non-MSI interrupt mode.

As such, this change adds an 'msi' module option, which defaults to off.
2006-02-02 16:17:06 -05:00
Mikael Pettersson b62735d9c6 [PATCH] ide-scsi: fix for IDE probe/remove ops changes
Kernel 2.6.16-rc1 broke the ide-scsi driver: ide-scsi loads but fails to
find any devices to bind to.  It also triggers a message "Driver 'ide-scsi'
needs updating - please use bus_type methods" from the driver core.

The IDE core in 2.6.16-rc1 changed the location of an IDE driver's
->probe()/->remove()/->shutdown() methods: they are now in the ide_driver_t
struct not in the gen_driver sub-struct.  drivers/ide/ was updated for this
change but ide-scsi.c wasn't.  Hence the breakage.

This patch repairs ide-scsi and also eliminates the driver core warning.

Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Greg KH <greg@kroah.com>
Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-01 08:53:09 -08:00
Linus Torvalds 2f4c5416b3 Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev 2006-01-31 21:22:45 -08:00
Linus Torvalds e0ae23550f Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2006-01-31 13:12:41 -08:00