Archived
14
0
Fork 0
Commit graph

1070 commits

Author SHA1 Message Date
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
Jeff Garzik
67cb6e842e Merge branch 'upstream-fixes' 2005-11-17 11:16:39 -05:00
Jeff Garzik
a2c91a8819 [libata sata_mv] handle lack of hardware nIEN support
Handle errata (it was unintentional on this h/w, whereas its intentional
on others) whereby the nIEN bit in Device Control is ignored, leading to
a situation where a hardware interrupt completes the qc before the
polling code has a chance to.

This will get fixed The Right Way(tm) once Albert Lee's irq-pio
branch is merged, as the more natural PIO method on this hardware is
interrupt-driven.
2005-11-17 05:44:44 -05:00
Jeff Garzik
22374677d1 [libata sata_mv] SATA probe, DMA boundary fixes
- DMA boundary was being handled incorrectly.  Copied the code from
  ata_fill_sg(), since Marvell has the same DMA boundary needs.
  (we can't use ata_fill_sg directly since we have different hardware
   descriptors)
- cleaned up the SATA phy reset code, to deal with various errata
2005-11-17 10:59:48 -05:00
Jeff Garzik
64f043d807 [libata] add timeout to commands for which we call wait_completion() 2005-11-17 10:50:01 -05:00
Jeff Garzik
3be4bb06b5 Merge branch 'upstream-fixes' 2005-11-16 15:12:58 -05:00
Jeff Garzik
8bb6030b62 Merge branch 'upstream-fixes' 2005-11-16 11:07:14 -05:00
Jeff Garzik
7bdd720869 [libata] bump versions 2005-11-16 11:06:59 -05:00
Jeff Garzik
c2cd76ff10 [libata ahci] tone down ATAPI errors
ATA devices don't generate many errors, so the preferred method is to
printk() when they occur.

ATAPI devices generate tons of exceptions during the normal course
of operation, so this change skips logging the most common class of
errors.
2005-11-16 09:23:30 -05:00
Albert Lee
75b1f2f865 [PATCH] libata: honor the transfer cycle time speficied by the EIDE device
The following code segment is not functional because the transfer cycle time speficied by
  the EIDE device is later overwritten by ata_timing_quantize():

	/*
	 * If the drive is an EIDE drive, it can tell us it needs extended
	 * PIO/MW_DMA cycle timing.
	 */
	if (adev->id[ATA_ID_FIELD_VALID] & 2) {	/* EIDE drive */
		memset(&p, 0, sizeof(p));
		(snip)
		ata_timing_merge(&p, t, t, ATA_TIMING_CYCLE | ATA_TIMING_CYC8B);
               <== uninitialized "t" is used here
	}

	/*
	 * Convert the timing to bus clock counts.
	 */
	ata_timing_quantize(s, t, T, UT);  <== t is overwritten by quantized s

  The patch has been submitted for ide-timing.h before:
  http://marc.theaimsgroup.com/?l=linux-ide&m=110820013425454&w=2
  Resubmitted for libata.

Changes:
  - Minor fix to honor the following transfer cycle time speficied by the device
    - id[65]: Minimum Multiword DMA transfer cycle time per word
    - id[67]: Minimum PIO transfer cycle time without flow control
    - id[68]: Minimum PIO transfer cycle time with IORDY

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

=======
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-16 07:59:22 -05:00
Tejun Heo
d10cb35a87 [PATCH] sil24: add constants
Adds constants for ATAPI support to sata_sil24.  This patch is
originally from Jeff Garzik <jgarzik@pobox.com>.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-16 07:11:42 -05:00
Jeff Garzik
68bdbdf0b3 Merge branch 'upstream-fixes' 2005-11-15 14:25:12 -05:00
Jeff Garzik
9f68a24853 [libata ahci] command completion fixes, improved debug msgs
- Fix a regression in command completion, which prevented
  the restart of the DMA engine after the device throws
  an error.
- Pack more hardware info into the port-reset error message.
- Promote "welcome to our timeout" message from debug msg
  to normal printk.
2005-11-15 14:03:47 -05:00
Jeff Garzik
1c24a412fd [libata ata_piix] cleanup: remove duplicate ata_port_info records 2005-11-14 18:20:23 -05:00
Jeff Garzik
c6e6e666cb [libata] REQUEST SENSE handling fixes
- Move ATAPI check-condition handling out of the timeout handler
- Use multi-qc-issue feature to issue REQUEST SENSE ATAPI PACKET
  command upon receiving an ATAPI check-condition.

This cleans things up a lot, and eliminates a nasty recursion bug.
2005-11-14 14:50:05 -05:00
Jeff Garzik
2c13b7cee0 [libata] minor fixes, new helpers
- in ata_dev_identify(), don't assume that all devices are either
  ATA or ATAPI.  In the future, this code will see port multipliers
  and other devices.
- make a debugging printk less verbose
- add new helper ata_qc_reinit()
- add new helper BPRINTK() and port flag ATA_FLAG_DEBUGMSG, for
  fine-grained debugging use.
2005-11-14 14:14:16 -05:00
Jeff Garzik
e1410f2d95 [libata] fix bugs in ATAPI padding DMA mapping code
The ATAPI pad-to-next-32bit-boundary code modifies the scatterlist's
length variable, sometimes to zero.  x86-64 platform would oops if a
zero-length scatterlist entry was asked to be mapped.  Work around this
by ensuring that we never DMA-map a zero length buffer or SG entry.
2005-11-14 14:06:26 -05:00
Jeff Garzik
ad36d1a533 [libata ahci] error handling fixes
Needed to get ATAPI working.

- dump hardware error bits, if hardware signals an error
- only reset hardware during timeout if a command was active
- call ata_qc_complete() with a fine-grained error mask.
  Needed so that atapi_qc_complete() can distinguish between
  device errors and other errors.
2005-11-14 13:56:37 -05:00
Jeff Garzik
85d6162d6c Merge branch 'master' 2005-11-13 23:20:16 -05:00
Jeff Garzik
c9d3913012 [libata sata_mv] fix tons of 50XX bugs 2005-11-13 17:47:51 -05:00
Mark Lord
dcc2d1e7f0 [libata passthru] address slave devices correctly 2005-11-13 16:22:06 -05:00
Mark Lord
e12a1be6e8 [PATCH] libata: fix comments on ata_tf_from_fis()
Fix description on comments for ata_tf_from_fis().

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-13 16:19:26 -05:00
Tejun Heo
e9c05afa80 [PATCH] sil24: add missing ata_pad_free()
sil24_port_stop() is missing call to ata_pad_free() thus leaking pad
buffer when a port is stopped.  This patch adds it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-13 10:31:43 -05:00
Jeff Garzik
2a47ce06d5 [libata sata_mv] call phy fixups during init, as well as phy reset 2005-11-12 23:05:14 -05:00
Jeff Garzik
101ffae26c [libata sata_mv] move code around
No content changes.  Move 60xx code to be closer to other 60xx code.
2005-11-12 22:17:49 -05:00
Jeff Garzik
522479fb98 [libata sata_mv] hardware initialization work
Implement flash reset and PCI reset on 50xx and 60xx.
Implement LED enable on 50xx.
2005-11-12 22:14:02 -05:00
Jeff Garzik
47c2b677da [libata sata_mv] mv_hw_ops for hardware families; new errata
- eliminate a bunch of redundant tests by creating a per-chip-family
  set of hooks, mv_hw_ops
- implement more errata, from newer Marvell GPL'd driver
2005-11-12 21:13:17 -05:00
Jeff Garzik
ba3fe8fb6a [libata sata_mv] move code around
No content change, just prepping up future mv_hw_ops modularization.
2005-11-12 19:08:48 -05:00
Jeff Garzik
bca1c4eb94 [libata sata_mv] implement a bunch of errata workarounds
Based largely on the GPL'd Marvell vendor driver.
2005-11-12 12:48:15 -05:00
Jeff Garzik
9a68c1b958 [libata sata_mv] note driver is "HIGHLY EXPERIMENTAL" in Kconfig 2005-11-12 12:40:41 -05:00
Jeff Garzik
8b260248d9 [libata sata_mv] trim trailing whitespace 2005-11-12 12:32:50 -05:00
Jeff Garzik
095fec887e [libata sata_mv] minor fixes
- clear SError and EDMA irq cause registers, after re-init'ing the phy
- move enums with type suffix 'U' to their own enum
2005-11-12 09:50:49 -05:00
Jeff Garzik
02eaa66629 [libata ahci] set port ATAPI bit correctly
Although according to the documentation this largely only affects
desktop LED control, let's make sure we set the ATAPI bit when we
have an ATAPI device attached to the port.
2005-11-12 01:32:19 -05:00
Jeff Garzik
828d09de4a [libata ahci, qstor] fix miscount of scatter/gather entries
Don't directly reference qc->n_elem, as that might cause an off-by-one
error for misaligned (padded) ATAPI transfers.
2005-11-12 01:27:07 -05:00
Mike Christie
85837ebdd7 [PATCH] kill libata scsi_wait_req usage (make libata compile with scsi-misc changes)
scsi_wait_req does not exist any more in the SCSI layer.  This patch
makes it so libata can compile again.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-11 14:57:05 -08:00
Linus Torvalds
d72d6f1b56 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6 2005-11-11 14:04:37 -08:00