Commit Graph

2897 Commits (6bb0417074e914e8d002df20c419e67732ae103e)

Author SHA1 Message Date
Stephen Rothwell 8c8dc32248 [POWERPC] Remove old interface find_path_device
Replaced by of_find_node_by_path.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-24 22:08:59 +10:00
Michael Tokarev d7b8bcb0a0 [SCSI] modalias for scsi devices
The following patch adds support for sysfs/uevent modalias
attribute for scsi devices (like disks, tapes, cdroms etc),
based on whatever current sd.c, sr.c, st.c and osst.c drivers
supports.

The modalias format is like this:

 scsi:type-0x04

(for TYPE_WORM, handled by sr.c now).

Several comments.

o This hexadecimal type value is because all TYPE_XXX constants
  in include/scsi/scsi.h are given in hex, but __stringify() will
  not convert them to decimal (so it will NOT be scsi:type-4).
  Since it does not really matter in which format it is, while
  both modalias in module and modalias attribute match each other,
  I descided to go for that 0x%02x format (and added a comment in
  include/scsi/scsi.h to keep them that way), instead of changing
  them all to decimal.

o There was no .uevent routine for SCSI bus.  It might be a good
  idea to add some more ueven environment variables in there.

o osst.c driver handles tapes too, like st.c, but only SOME tapes.
  With this setup, hotplug scripts (or whatever is used by the
  user) will try to load both st and osst modules for all SCSI
  tapes found, because both modules have scsi:type-0x01 alias).
  It is not harmful, but one extra module is no good either.
  It is possible to solve this, by exporting more info in
  modalias attribute, including vendor and device identification
  strings, so that modalias becomes something like
    scsi:type-0x12:vendor-Adaptec LTD:device-OnStream Tape Drive
  and having that, match for all 3 attributes, not only device
  type.  But oh well, vendor and device strings may be large,
  and they do contain spaces and whatnot.
  So I left them for now, awaiting for comments first.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-17 18:15:04 -04:00
Alan Stern 44ec95425c [SCSI] sg: cap reserved_size values at max_sectors
This patch (as857) modifies the SG_GET_RESERVED_SIZE and
SG_SET_RESERVED_SIZE ioctls in the sg driver, capping the values at
the device's request_queue's max_sectors value.  This will permit
cdrecord to obtain a legal value for the maximum transfer length,
fixing Bugzilla #7026.

The patch also caps the initial reserved_size value.  There's no
reason to have a reserved buffer larger than max_sectors, since it
would be impossible to use the extra space.

The corresponding ioctls in the block layer are modified similarly,
and the initial value for the reserved_size is set as large as
possible.  This will effectively make it default to max_sectors.
Note that the actual value is meaningless anyway, since block devices
don't have a reserved buffer.

Finally, the BLKSECTGET ioctl is added to sg, so that there will be a
uniform way for users to determine the actual max_sectors value for
any raw SCSI transport.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-17 18:09:56 -04:00
Zachary Amsden 1079a2d251 [SCSI] BusLogic: stop using check_region
I got so sick of seing the check_region warnings from BusLogic.c I actually
fixed it properly.  Never use check region, reserve it before the probe
with request region instead and check the error result; free region if
setup fails.  Should be functionally identical to the original except for
fixing the potential race.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-17 18:04:20 -04:00
Bastian Blank ad1331a792 [SCSI] tgt: fix rdma transfer bugs
- ibmstgt hits the max rdma transfer size (128k).
- libsrp returns a rdma transfer error properly.

Signed-off-by: Bastian Blank <bastian@waldi.eu.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-17 18:03:31 -04:00
Salyzyn, Mark 4def7fa112 [SCSI] aacraid: fix aacraid not finding device
Thanks for the help from Steve Fox and Duane Cox investigating this
issue, I'd like to report that we found the problem. The issue is with
the patch Steve Fox isolated below, by not accommodating older adapters
properly and issuing a command they do not support when retrieving
storage parameters about the arrays. This simple patch resolves the
problem (and more accurately mimics the logic of the original code
before the patch).

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-17 18:02:22 -04:00
Brian King ed773e6648 [SCSI] scsi_error.c: Add EH Start Unit retry
Currently, the scsi error handler will issue a START_UNIT
command if the drive indicates it needs its motor started
and the allow_restart flag is set in the scsi_device. If,
after the scsi error handler invokes a host adapter reset
due to error recovery, a device is in a unit attention
state AND also needs a START_UNIT, that device will be placed
offline. The disk array devices on an ipr RAID adapter
will do exactly this when in a dual initiator configuration.
This patch adds a single retry to the EH initiated
START_UNIT.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>

Patch modified and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-17 17:55:36 -04:00
Linus Torvalds ff99e40230 Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.
2007-04-14 21:41:12 -07:00
David S. Miller 8d3ee2cb0a [SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.
We only map DMA when cmd->request_bufflen is non-zero for non-sg
buffers, we thus should make the same check when unmapping.

Based upon a report from Pasi Pirhonen.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-14 10:29:10 -07:00
James Bottomley 6e3b2bbb19 [SCSI] 3w-xxxx: fix oops caused by incorrect REQUEST_SENSE handling
3w-xxxx emulates a REQUEST_SENSE response by simply returning nothing.
Unfortunately, it's assuming that the REQUEST_SENSE command is
implemented with use_sg == 0, which is no longer the case.  The oops
occurs because it's clearing the scatterlist in request_buffer instead
of the memory region.

This is fixed by using tw_transfer_internal() to transfer correctly to
the scatterlist.

Acked-by: adam radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-14 08:49:03 -05:00
Stephen Rothwell d05c7a80cf [POWERPC] Rename get_property to of_get_property: drivers
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13 03:55:19 +10:00
Stephen Rothwell a7edd0e676 [POWERPC] get_property returns const
This just tidies up some of the remains.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13 03:55:17 +10:00
David S. Miller 8cc574a3c5 [SCSI]: Fix scsi_send_eh_cmnd scatterlist handling
This fixes a regression caused by commit:

2dc611de5a

The sense buffer code in scsi_send_eh_cmnd was changed to use
alloc_page() and a scatter list, but the sense data copy was not
updated to match so what we actually get in the sense buffer is total
grabage starting with the kernel address of the struct page we got.
Basically the stack frame of scsi_send_eh_cmd() is what ends up
in the sense buffer.

Depending upon how pointers look on a given platform, you can
end up getting sr_ioctl.c errors when you mount a cdrom.  If
the CDROM gives a check condition for GPCMD_GET_CONFIGURATION issued
by drivers/cdrom/cdrom.c:cdrom_mmc_profile(), sr_ioctl will
spit out this error message in sr_do_ioctl() with the way pointers
are on sparc64:

		default:
			printk(KERN_ERR "%s: CDROM (ioctl) error, command: ", cd->cdi.name);
			__scsi_print_command(cgc->cmd);
			scsi_print_sense_hdr("sr", &sshdr);
			err = -EIO;

This is the error Tom Callaway reported in:

http://marc.info/?l=linux-sparc&m=117407453208101&w=2

Anyways, fix this by using page_address(sgl.page) which is OK
because we know this is low-mem due to GFP_ATOMIC.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Christoph Hellwig <hch@lst.de>
2007-04-02 14:26:22 -07:00
Salyzyn, Mark 18a6598f2d [SCSI] aacraid: [Fastboot] Panics for AACRAID driver during 'insmod' for kexec test.
Attached is the patch I feel will address this issue. As an added
'perk' I have also added the code to detect if the controller was
previously initialized for interrupted operations by ANY operating
system should the reset_devices kernel parameter not be set and we are
dealing with a naïve kexec without the addition of this kernel
parameter. The reset handler is also improved. Related to reset
operations, but not pertinent specifically to this issue, I have also
altered the handling somewhat so that we reset the adapter if we feel
it is taking too long (three minutes) to start up.

We have not unit tested the reset_devices flag propagation to this
driver code, nor have we unit tested the check for the interrupted
operations under the conditions of a naively issued kexec. We are
submitting this modified driver to our Q/A department for integration
testing in our current programs. I would appreciate an ACK to this
patch should it resolve the issue described in this thread...

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 12:44:57 -05:00
Brian King aa2e07b4c2 [SCSI] ipr: Driver version to 2.3.2
Bump driver version.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:19:39 -05:00
Brian King 51b1c7e19e [SCSI] ipr: Faster sg list fetch
Improve overall command performance by embedding the scatterlist
in the command block used by the adapter. This decreases
the overall number of DMAs required for a single command.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:19:12 -05:00
Brian King 0feeed823a [SCSI] ipr: Return better qc_issue errors
If qc_issue fails for some reason, return a better error
to libata.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:18:56 -05:00
Brian King e435340c4b [SCSI] ipr: Disrupt device error
Add entry in ipr error translation table for an error
received when a device is forced into the failed state
by the user.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:18:37 -05:00
Brian King 933916f365 [SCSI] ipr: Improve async error logging level control
Add the ability to control how much error data gets logged
on a per error basis.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:18:11 -05:00
Brian King a9aedb0984 [SCSI] ipr: PCI unblock config access fix
Fix to make sure user config accesses get re-enabled if the
PCI config write to start BIST fails.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:17:42 -05:00
Brian King 24d6f2b50b [SCSI] ipr: Fix for oops following SATA request sense
This patch fixes a problem discovered on a system with some
bad SATA devices attached. If a command to a SATAPI device
times out and the device gets reset as part of error recovery,
its possible that ipr will set err_mask to indicate a device
error has occurred. If this happens, a request sense will get
issued by libata. Since scsi core thinks this scsi command is
now completed, because the device reset handler completed successfully,
scsi core will free the associated scsi command, which may
cause an oops when that request sense is completed later
by ipr. This patch ensures that any commands that get aborted
as a result of a device reset set err_mask appropriately so
that the request sense does not get sent.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:17:22 -05:00
Brian King b0692dd4d7 [SCSI] ipr: Log error for SAS dual path switch
For ipr SAS adapters that support dual pathing, this
patch modifies ipr to log an error when a path fails.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:16:58 -05:00
Brian King cc9bd5d425 [SCSI] ipr: Enable logging of debug error data for all devices
The ipr driver has a sysfs attribute which can be used to
adjust the logging level of the driver for error events.
The error response data for commands can be dumped by
increasing the logging level of the ipr driver. This
currently only works for JBOD passthrough devices.
This patch enables this function for all devices, including
RAID devices, to aid in debugging problems.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:16:34 -05:00
Brian King 185eb31cc2 [SCSI] ipr: Add new PCI-E IDs to device table
Adds support for some new PCI-E ipr adapters.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:16:14 -05:00
Brian King 7d2267bb9d [SCSI] ipr: Remove auto RAID create module parameter
Remove the auto RAID 0 array creation module parameter, since
support for this function has been removed from the firmware.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:15:45 -05:00
Brian King 5469cb5bde [SCSI] ipr: Make adapter operational timeout be per adapter type
Some ipr adapters may take longer than others to come operational.
This patch makes this timeout different for different adapters,
while still preserving the module parameter which can be used
to globally override the default.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 11:15:26 -05:00
Robert Jennings 0979c84b4a [SCSI] ibmvscsi: add slave_configure to allow device restart
Fixed the kernel-doc comment for ibmvscsi_slave_configure.  Thanks to
Randy Dunlap for pointing this out.

Adding a slave_configure function for the driver. Now the disks can be
restarted by the scsi mid-layer when the are disconnected and reconnected.

Signed-off-by: "Robert Jennings" <rcj@linux.vnet.ibm.com>
Signed-off-by: "Santiago Leon" <santil@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:37:02 -05:00
Robert Jennings a897ff2a63 [SCSI] ibmvscsi: allow for dynamic adjustment of server request_limit
The request limit calculations used previously on the client failed to
mirror the state of the server.  Additionally, when a value < 3 was provided
there could be problems setting can_queue and handling abort and reset
commands.

Signed-off-by: "Robert Jennings" <rcj@linux.vnet.ibm.com>
Signed-off-by: Santiago Leon <santil@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:36:39 -05:00
Salyzyn, Mark a45c863f02 [SCSI] aacraid: fix print of Firmware Build Date and add TSID
The Adapter build date that is to be printed on instantiation was not
displayed as a result of the supplemental adapter information structure
not being in sync with the Firmware; the driver took an early test cycle
version that had a miss-sized padded region at the head and the
structure was not re-checked at the end of qualification. The Build Date
was not a priority and is merely a cosmetic enhancement, and the wrong
location for the start of the structure member would not induce any
side-effect problems. We updated the structure to match the actual
format, and added the TSID (Tech Support Identification) value print,
should it be present, to the adapter instantiation announcements during
driver load.

This later enhancement should improve the relationship between Service
folk & Tech Support if the printed value of the TSID found it's way into
the circular file labeled G...

Neither of these values show in sysfs (yet).

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:35:44 -05:00
Salyzyn, Mark 74ee9d52cf [SCSI] aacraid: remove unused or deprecated firmware constants
Just sweeping the floor clean in one spot. Some of these constants have
never been used in the driver or in the firmware (and thus are
meaningless). Triggered this patch because I discovered one of the
unused constants was actually incorrect and figured it was better to
clean them out than correct and update. There are no side effects at all
regarding this patch, it is purely cosmetic.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:34:31 -05:00
Bernhard Walle 665db93b8a [SCSI] qla2xxx: Remove duplicate pci_disable_device() call
On the path qla2x00_probe_one() -> probe_failed -> qla2x00_free_device(),
pci_disable_device() is executed twice, once in qla2x00_free_device()
and once in qla2x00_probe_one().

This patch removes the unnecessary call.

Signed-off-by: Bernhard Walle <bwalle@suse.de>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:27:29 -05:00
Salyzyn, Mark 4dfb7cbef8 [SCSI] aacraid: resolve compiler warnings using ptrdiff_t
Unsigned long is not always the same size as a pointer, namely on 32 bit
systems with 64 bit address space. Ptrdiff_t is the same size as a
pointer in all configurations. By using ptrdiff_t we can mitigate the
warning messages on these configurations. There should be no side
effects of this patch.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:25:21 -05:00
Adrian Bunk e3e0ca5143 [SCSI] aic7xxx: make functions static
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:17:10 -05:00
Adrian Bunk 9695a25dbf [SCSI] aacraid: cleanups
- proper prototypes for global code in aacraid.h
- aac_rx_start_adapter() can now become static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:16:35 -05:00
Adrian Bunk 3cfff0fc74 [SCSI] dpt_i2o: remove dead code
The Coverity checker spotted this dead code introduced by
commit a07f353701.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:12:51 -05:00
Robert P. J. Day b73c3d7786 [SCSI] Remove some unused SCSI-related kernel config variables.
Remove the unused SCSI-related kernel config variables

	SCSI_NCR53C8XX_PROFILE_SUPPORT
	SCSI_NCR53C8XX_PROFILE
	53C700_IO_MAPPED
	AIC79XX_ENABLE_RD_STRM
	AIC7XXX_PROBE_EISA_VL

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:11:16 -05:00
Henne 0d06b281a1 [SCSI] dpt: whitespace cleanup
Remove some trailing whitespaces and some replace whitespaces with tabs.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:10:04 -05:00
Robert P. J. Day 023ae61999 [SCSI] pcmcia: allow drivers to be built non-modular
Remove the Kconfig requirement that the PCMCIA SCSI drivers be built
only as modules, and allow them to be built into the kernel.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:07:14 -05:00
Salyzyn, Mark 912d4e8851 [SCSI] aacraid: Add likely() and unlikely()
Add some likely() and unlikely() compiler hints in some of the aacraid
hardware interface layers. There should be no operational side effects
resulting from this patch and the changes should be mostly benign on x86
platforms.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:04:02 -05:00
Richard Lary 1196ae025b [SCSI] qla2xxx: fix for byteswap in fc_host fabric_name
This patch fixes byte swap issue in qla2xxx driver
to fix corrupted fabric_name passed to
/sys/class/fc_host/host*/fabric_name.

Signed-off-by: Richard Lary <rlary@us.ibm.com>
Acked-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:03:00 -05:00
Anton Blanchard 07da60c1f4 [SCSI] lpfc: fix oops when parsing dodgy VPD
We have seen two cases where VPD on an emulex card has been incorrect
and we end up walking off the end of memory. It looks like someone made
an update (increased the length of a string) without increasing the
Length field. Then we do:

	Length -= (3+i);

And since Length is unsigned it becomes very large and we loop forever
in the encapsulating:

	while (Length > 0) {

If we make Length signed then we fall out of the loop and proceed on.

Its important to note we have only seen this in the lab and it may be
the only two cases of this in existence, but since the rest of the code
has been written to be resilient against bad VPD we may as well fix this
too.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: James Smart <James.Smart@Emulex.Com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01 10:02:00 -05:00
Linus Torvalds d459094083 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] gdth: fix oops in gdth_copy_cmd()
  [SCSI] mptsas: Fix oops for insmod during kexec
  [SCSI] lpfc: avoid double-free during PCI error failure
2007-03-27 10:06:30 -07:00
Salyzyn, Mark 802ae2f05b [SCSI] aacraid: cleanup and version stamp driver
There is some residual cleanup of the last series of patches and the
need to bump the revision number to draw the line in the sand.

The cmd->SCp.phase is set in the aac_valid_context routine, then set
again to the same value following it's return. The cmd->scsi_done is set
twice in the aac_queuecommand routine. Free up the scsidev FILO in
aac_probe_container as it is not needed further down the function in any
case. Improve the efficiency of the abort handler kernel print
parameters. Bump revision number of driver to approximate the equivalent
in the Adaptec supplied version.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-21 12:03:52 -06:00
Salyzyn, Mark 20235f3522 [SCSI] aacraid: check buffer address in aac_internal_transfer
Captured a panic on an older kernel where an application issuing
commands via sg was sending requests that lacked a request_buffer, thus
the buffer pointer used in aac_internal_transer was NULL. The
application was fixed closing the issue, but felt it was advised to
immunize the driver against the eventuality.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-21 11:45:15 -06:00
James Bottomley 0272bf7271 [SCSI] fix scsi_wait_scan build problem
The #ifdef MODULE around the export of scsi_complete_async_scans()
which is the API the scsi_wait_scan module uses is incorrect and
causes the symbol to be undefined in certain circumstances leading to
a build failure.  Remove the defines.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-21 08:15:41 -06:00
James Bottomley cc5d2c8c64 [SCSI] sd: fix up start/stop messages for new sd_printk() API
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 12:44:52 -05:00
Tejun Heo c3c94c5a2f [SCSI] sd: implement START/STOP management
Implement SBC START/STOP management.  sdev->mange_start_stop is added.
When it's set to one, sd STOPs the device on suspend and shutdown and
STARTs it on resume.  sdev->manage_start_stop defaults is in sdev
instead of scsi_disk cdev to allow ->slave_config() override the
default configuration but is exported under scsi_disk sysfs node as
sdev->allow_restart is.

When manage_start_stop is zero (the default value), this patch doesn't
introduce any behavior change.

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

Rejections fixed and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 12:06:20 -05:00
Tejun Heo 3721050afc [SCSI] sd: fix return value of sd_sync_cache()
sd_sync_cache() should return -errno on error, fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 11:33:32 -05:00
Richard Knutsson 5f9279f239 [SCSI] eata_pio: Remove FALSE/TRUE defines
eata_generic.h is only included by eata_pio.c and it only uses
FALSE/TRUE in comments.

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 11:27:03 -05:00
James Bottomley 6c5f8ce1fb [SCSI] expose eh_timed_out to the host template
It looks like megaraid_sas at least needs this to throttle its commands
as they begin to time out.  The code keeps the existing transport
template use of eh_timed_out (and allows the transport to override the
host if they both have this callback).

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:56:49 -05:00
Mark Haverkamp 03d4433721 [SCSI] aacraid: Improved error handling
Received from Mark Salyzyn,

This set of fixes improve error handling stability of the driver. A popular
manifestation of the problems is an NULL pointer reference in the interrupt
handler when referencing portions of the scsi command context, or in the
scsi_done handling when an offlined device is referenced.

The aacraid driver currently does not get notification of orphaned command
completions due to devices going offline. The driver also fails to handle the
commands that are finished by the error handler, and thus can complete again
later at the hands of the adapter causing situations of completion of an
invalid scsi command context. Test Unit Ready calls abort assuming that the
abort was successful, but are not, and thus when the interrupt from the adapter
occurs, they reference invalid command contexts. We add in a TIMED_OUT flag to
inform the aacraid FIB context that the interrupt service should merely release
the driver resources and not complete the command up. We take advantage of this
with the abort handler as well for select abortable commands. And we detect and
react if a command that can not be aborted is currently still outstanding to
the controller when reissued by the retry mechanism.

Signed-off-by: Mark Haverkamp <markh@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:56:03 -05:00
Mark Haverkamp f2b1a06ad4 [SCSI] aacraid: fix srb ioctl for 64 bits
Received from Mark Salyzyn,

The raw srb ioctl is supposed to be able to take packets with 32 and 64 bit
virtual address SG elements, it did not handle the frames with 64 bit SG
elements well when communicating with 64 bit DMA capable adapters, and it did
not handle the 32 bit limited DMA adapters at all.  The enclosed patch now
handles all four quadrants (32 bit / 64 bit SG elements in SRB requests + 32
bit or 64 bit DMA capable adapters)

This fix is required before Java based management applications in a 64 bit user
space can submit raw srb requests to the array physical components via the
ioctl mechanism, the allocated user memory pool on 64 bit machines under this
environment forced the management software's hands to submit 64 bit user space
virtual address SG elements in via the ioctl.

Signed-off-by: Mark Haverkamp <markh@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:55:40 -05:00
Mark Haverkamp 9e7c349c91 [SCSI] aacraid: remove un-needed references to container id (cid)
Received from Mark Salyzyn,

This little patch removes the ',cid)' container identification argument
from some of the functions. The argument is used in some cases as merely
a debug helper and thus not used, and in others, the value can be
quickly acquired from the scsi command in their single solitary use in
the procedure rather than wasting resources on passing the argument in
from above.

Signed-off-by: Mark Haverkamp <markh@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:55:18 -05:00
Mark Haverkamp 33bb3b2962 [SCSI] aacraid: Fix ioctl handling when adapter resets
Received from Mark Salyzyn,

Outstanding ioctl calls still have some problems with aborting cleanly
in the face of a reset iop recovery action should the adapter ever enter
into a Firmware Assert (BlinkLED) condition. The enclosed patch resolves
some uncovered flawed handling.

Signed-off-by: Mark Haverkamp <markh@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:55:05 -05:00
Mark Haverkamp fe76df4235 [SCSI] aacraid: Fix blocking issue with container probing function (cast update)
Received from Mark Salyzyn,

The aac_probe_container call blocks. This is an issue because it is called on
occasion in the context of the queuecommand handler. Once in a blue moon this
has resulted in a kernel panic sleeping during interrupt; or problems with some
embedded system versions of the kernel that depend on queuecommand to not
block. This ugly patch rewrites the aac_probe_container call into a new routine
_aac_probe_container that is an asynchronous state machine to complete the
series of operations. The legacy blocking aac_probe_container call used in
other areas of the driver (during initialization scanning for all targets and
in the separate hot-add/remove [aacraid] thread) merely issues
_aac_probe_container and then simple spins calling schedule() waiting for
completion.

Signed-off-by: Mark Haverkamp <markh@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:54:49 -05:00
Mark Haverkamp a8166a5296 [SCSI] aacraid: Fix struct element name issue
Received from Mark Salyzyn,

This patch is to resolve a namespace issue that will result from a patch
expected in the future that adds a new interface; rationalized as
correcting a long term issue where hw_fib, instead of hw_fib_va, refers
to the virtual address space and hw_fib_pa refers to the physical
address space. A small fragment of this patch also cleans up an unused
variable that was close to the patch fragments.

Signed-off-by: Mark Haverkamp <markh@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:54:25 -05:00
Mark Haverkamp 8418852d11 [SCSI] aacraid: add restart adapter platform function
Received from Mark Salyzyn,

This patch updates the adapter restart function to deal with some
adapters that have specific IOP reset needs. Since the code for
restarting the adapter was in two places, changed over to utilizing a
platform function in one place.

Signed-off-by: Mark Haverkamp <markh@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:54:11 -05:00
Pete Wyckoff b22f687dd2 [SCSI] set resid in scsi_io_completion() even for check condition
Some targets can return both valid data and sense information.
Always update the request data_len from the SCSI command residual.
Callers should interpret sense data to determine what parts of the
data are valid in case of a CHECK CONDITION status.

Signed-off-by: Pete Wyckoff <pw@osc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:53:51 -05:00
FUJITA Tomonori a52decafbe [SCSI] tgt: remove the code to build sense
tgt notifies a LLD of the failure with sense when it hits the
user-space daemon bugs. However, tgt doesn't know anything about SCSI
devices that initiators talks to. So it's impossible to send proper
sense buffer (format and contents).

This patch changes tgt not to notify a LLD of the failure with bogus
sense. Instead, tgt just re-queues the failure command to the internal
list so that it will be freed cleanly later on when the scsi_host is
removed.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:52:59 -05:00
James Smart c3d2350a84 [SCSI] fc_transport: update potential link speeds
This patch updates the FC transport for all speeds identified in
SM-HBA.  Note: it does not sync the "bit" definitions, as that is
actually insulated from user-space via the sysfs text string. (I could
do it, but it does introduce a potential binary-incompatibility).

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:52:04 -05:00
Andrew Vasquez 457620b47a [SCSI] qla2xxx: Update version number to 8.01.07-k6.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:51:36 -05:00
Andrew Vasquez 27d9403528 [SCSI] qla2xxx: Allow the extended-error-logging flag to be dynamic.
The module parameter, ql2xextended_error_logging, can now be
set dynamically by writing to the following sysfs entry:

	/sys/module/qla2xxx/parameters/ql2xextended_error_logging

This alleviates the need for the driver to be unloaded and
reloaded in order to enable logging.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:51:20 -05:00
Andrew Vasquez fecf97882a [SCSI] qla2xxx: Drop acquisition of hardware_lock during flash manipulations.
There's no need given, I/O has been quiesced, RISC
interrupts have been disabled, and finally the RISC has been
paused.  Flash manipulation on ISP21xx, ISP22xx, and ISP23xx
parts requires the RISC to go through a full reset to
recover.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:50:50 -05:00
Andrew Vasquez 40a2e34a94 [SCSI] qla2xxx: Add cond_resched() calls during HBA flash manipulation.
We're observing soft lockups during HBA FLASH retrieval and
update.  Add cond_resched() each time around the tight-loops
during flash read()s/write()s.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:50:30 -05:00
Andrew Vasquez ed67708639 [SCSI] qla2xxx: Add scan_[start|finish]() callbacks for ISP24xx HBAs.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:50:05 -05:00
Malahal Naineni b889d531b6 [SCSI] qla2xxx: fix RSCN handling on big-endian systems
qla2xxx driver fails to handle RSCN events affecting area or domain due
to an endian issue on big endian systems.  This fixes the port_id_t
structure on big endian systems.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:49:40 -05:00
James Bottomley 840c2835a1 [SCSI] make scsi_wait_scan always modular
Currently scsi_wait_scan is only built modular if SCSI is modular.
However, it's perfectly possible for a built in SCSI still to have
modular drivers and thus need scsi_wait_scan as a module.  Therefore,
scsi_wait_scan should always be built as a module (unless the kernel
doesn't support modules).

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-20 10:48:23 -05:00
Alan Stern d9a9cdfb07 [PATCH] sysfs and driver core: add callback helper, used by SCSI and S390
This patch (as868) adds a helper routine for device drivers that need
to set up a callback to perform some action in a different process's
context.  This is intended for use by attribute methods that want to
unregister themselves or their parent device.  Attribute method calls
are mutually exclusive with unregistration, so such actions cannot be
taken directly.

Two attribute methods are converted to use the new helper routine: one
for SCSI device deletion and one for System/390 ccwgroup devices.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-15 15:29:26 -07:00
James Bottomley 56937f7b78 [SCSI] sd: typo fix: sdkp_printk should be sd_printk
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 12:25:33 -05:00
Robert P. J. Day 38891cb6b0 [SCSI] pci2000: Delete unused header file.
This driver was removed a while ago by commit

099175c94a

However, it seems that pci2000.h wasn't properly eliminated, so remove
it now.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:42:10 -05:00
FUJITA Tomonori e8f8248cba [SCSI] tgt: fix scsi command leak
The failure to map user-space pages leads to scsi command leak. It can
happens mostly because of user-space daemon bugs (or OOM). This patch
makes tgt just notify a LLD of the failure with sense when
blk_rq_map_user() fails.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:39:39 -05:00
FUJITA Tomonori bc7e380a6a [SCSI] tgt: fix sesnse buffer problems
This patch simplify the way to notify LLDs of the command completion
and addresses the following sense buffer problems:

- can't handle both data and sense.
- forces user-space to use aligned sense buffer

tgt copies sense_data from userspace to cmnd->sense_buffer (if
necessary), maps user-space pages (if necessary) and then calls
host->transfer_response (host->transfer_data is removed).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:39:27 -05:00
Mike Christie 181011e04a [SCSI] tgt: rm bio hacks in scsi tgt
scsi tgt breaks up a command into multple scatterlists
if we cannot fit all the data in one. This was because
the block rq helpers did not support large requests and
because we can get a command of any old size so it is
hard to preallocate pages for scatterlist large enough
(we cannot really preallocate pages with the bio map
user path). In 2.6.20, we added large request support to
the block layer helper, blk_rq_map_user. And at LSF,
we talked about increasing SCSI_MAX_PHYS_SEGMENTS for
scsi tgt if we want to support really really :) large
(greater than 256 * PAGE_SIZE in the worst mapping case)
requests.

The only target currently implemented does not even support
the multiple scatterlists stuff and only supports smaller
requests, so this patch just coverts scsi tgt to use
blk_rq_map_user.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:31:33 -05:00
Mike Christie 0f238418b6 [SCSI] iscsi_tcp: print useful error message when iscsi crc23c allocation fails
People do not read the README and seem to like to
unselect the crc32c module even though iscsi_tcp selects
it for them. This patch spits a error that tells the user
that they really do need the module. Hopefully, we will
get fewer people asking about this now.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:30:11 -05:00
Mike Christie 8231f0eddb [SCSI] iscsi_tcp: increase max_sectors
For a while now, the block layer has seperated max sectors
and max hw sectors. Software iscsi has no limit so this patch
increases max hw sectors, so we can support large pass through
commands.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:28:49 -05:00
Mike Christie 8eb00539d9 [SCSI] libiscsi: use get_unaligned
Dave Miller meantioned that the data buffer in a past
sense fixup patch was not gauranteed to be aligned
properly for ia64. This patch has libiscsi use get_unalinged
to make sure. There are a couple more places in the
digest handling we may need to do this, but we are in the middle
of fixing that code for big endien systems so just the sense
access is fixed here.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:28:09 -05:00
Mike Christie 41be144422 [SCSI] iscsi transport: use atomic for session_nr allocations
qla4xxx and iscsi_tcp or iser could be creating
sessions at the same time, so make session_nr id
allocation atomic.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:27:28 -05:00
Mike Christie bf32ed33e9 [SCSI] iscsi: rename DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH
This patch renames DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH to avoid
confusion with the drivers default values (DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH
is the iscsi RFC specific default).

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:26:50 -05:00
Mike Christie 05db888a46 [SCSI] libiscsi: clear mtask
Consolidate the mtask clearing code.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:26:05 -05:00
Mike Christie 779ea1207b [SCSI] libiscsi: flush work before freeing connection
It's possible that we call iscsi_xmitworker after iscsi_conn_release
which causes a oops. This patch flushes the workqueue.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:24:12 -05:00
Martin K. Petersen 62d42a6277 [SCSI] constants.c: Update ASC list and make it const
Add missing additional sense code and provide pointer to upstream
reference (from Doug Gilbert).

Add missing const (from Michael Tokarev).

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:21:25 -05:00
Martin K. Petersen fa0d34be06 [SCSI] sd: convert logging to new printk helpers
Convert the sd.c SCSI logging calls to scmd_printk()/sd_printk()
instead of plain printk().

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:20:55 -05:00
Martin K. Petersen e73aec8247 [SCSI] sd: make printing use a common prefix
Make SCSI disk printing more consistent:

 - Define sd_printk(), sd_print_sense_hdr() and sd_print_result()

 - Move relevant header bits into sd.h

 - Remove all the legacy disk_name passing and use scsi_disk pointers
   where possible

 - Switch printk() lines to the new sd_ functions so that output is
   consistent

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:20:17 -05:00
Martin K. Petersen a4d04a4cd9 [SCSI] Make error printing more verbose
This patch enhances SCSI error printing by:

 - Making use of scsi_print_result() in the completion functions.

 - Having scmd_printk() output the disk name (when applicable).

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:17:49 -05:00
Martin K. Petersen 684b7fe976 [SCSI] constants.c: cleanup, verbose result printing
Clean up constants.c and make result printing more user friendly:

 - Refactor the command and sense functions so that the actual
   formatting can be called from the various helper functions with the
   correct prefix.

 - Replace scsi_print_hostbyte() and scsi_print_driverbyte() with
   scsi_print_result() which is verbose when CONFIG_SCSI_CONSTANTS is
   on.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 11:14:02 -05:00
Joerg Dorchain bb9ba31ca3 [SCSI] gdth: fix oops in gdth_copy_cmd()
Recent alterations to the gdth_fill_raw_cmd() path no longer set the
sg_ranz field for zero transfer commands. However, this field is used
lower down in the function to initialise ha->cmd_len to the size of
the firmware packet.  If this uninitialised field contains a bogus
value, ha->cmd_len can become much larger than the actual firmware
packet and end up oopsing in gdth_copy_cmd() as it tries to copy this
huge packet to the device (usually because it runs into an unallocated
page).

The fix is to initialise the sg_ranz field to zero at the start of
gdth_fill_raw_cmd().

Signed-off-by: Joerg Dorchain <joerg@dorchain.net>
Acked-by: "Leubner, Achim" <Achim_Leubner@adaptec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 10:58:49 -05:00
Linas Vepstas 5daa49ef05 [SCSI] lpfc: avoid double-free during PCI error failure
If a PCI error is detected that cannot be recovered from, there
will be a double call of lpfc_pci_remove_one(), with the second call
resulting in a null-pointer dereference. The first call occurs in
lpfc_io_error_detected(), and the second call during pci device
remove. This patch eliminates the first call; its un-needed.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: James Smart <James.Smart@Emulex.Com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-03-11 10:42:17 -05:00
Russell King 23d046f43a [ARM] ARM SCSI: Don't try to dma_map_sg too many scatterlist entries
An off-by-one bug meant we were always trying to map one too many
scatterlist entries.  This was mostly harmless prior to the checks
going in to consistent_sync(), but now causes the kernel to BUG.

Also, powertec.c was missing an assignment to info->ec.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-03-04 20:33:31 +00:00
Russell King 6b4df7ee1f [ARM] ARM FAS216: don't modify scsi_cmnd request_bufflen
SCSI doesn't want drivers to modify request_bufflen, so keep a
driver-private copy of this in the scsi_pointer structure instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-03-04 20:33:20 +00:00
Linus Torvalds 5fc77247f7 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6:
  [SCSI] SCSI core: better initialization for sdev->scsi_level
  [SCSI] scsi_proc.c: display sdev->scsi_level correctly
  [SCSI] megaraid_sas: update version and author info
  [SCSI] megaraid_sas: return sync cache call with success
  [SCSI] megaraid_sas: replace pci_alloc_consitent with dma_alloc_coherent in ioctl path
  [SCSI] megaraid_sas: add bios_param in scsi_host_template
  [SCSI] megaraid_sas: do not process cmds if hw_crit_error is set
  [SCSI] scsi_transport.h should include scsi_device.h
  [SCSI] aic79xx: remove extra newline from info message
  [SCSI] scsi_scan.c: handle bad inquiry responses
  [SCSI] aic94xx: tie driver to the major number of the sequencer firmware
  [SCSI] lpfc: add PCI error recovery support
  [SCSI] megaraid: pci_module_init to pci_register_driver
  [SCSI] tgt: fix the user/kernel ring buffer interface
  [SCSI] sgiwd93: interfacing to wd33c93
  [SCSI] wd33c93: Fast SCSI with WD33C93B
2007-02-19 13:32:28 -08:00
Linus Torvalds 874ff01bd9 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (25 commits)
  Documentation/kernel-docs.txt update.
  arch/cris: typo in KERN_INFO
  Storage class should be before const qualifier
  kernel/printk.c: comment fix
  update I/O sched Kconfig help texts - CFQ is now default, not AS.
  Remove duplicate listing of Cris arch from README
  kbuild: more doc. cleanups
  doc: make doc. for maxcpus= more visible
  drivers/net/eexpress.c: remove duplicate comment
  add a help text for BLK_DEV_GENERIC
  correct a dead URL in the IP_MULTICAST help text
  fix the BAYCOM_SER_HDX help text
  fix SCSI_SCAN_ASYNC help text
  trivial documentation patch for platform.txt
  Fix typos concerning hierarchy
  Fix comment typo "spin_lock_irqrestore".
  Fix misspellings of "agressive".
  drivers/scsi/a100u2w.c: trivial typo patch
  Correct trivial typo in log2.h.
  Remove useless FIND_FIRST_BIT() macro from cardbus.c.
  ...
2007-02-19 13:29:02 -08:00
Linus Torvalds dd397a6d1a Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6: (30 commits)
  ide: make ide_hwif_t.ide_dma_host_on void (v2)
  ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2)
  ide: add ide_set_dma() helper (v2)
  sgiioc4: fix sgiioc4_ide_dma_check() to enable/disable DMA properly
  ide: disable DMA in ->ide_dma_check for "no IORDY" case (v2)
  ide: convert ide_hwif_t.mmio into flag (v2)
  ide: use PIO/MMIO operations directly where possible (v2)
  ide: add ide_use_fast_pio() helper (v3)
  ide: unexport ide_set_xfer_rate() (v2)
  ide: remove ide_drive_t.usage
  ide: remove ide_pci_device_t tables with only one entry
  ide: remove write-only ide_hwif_t.no_dsc flag
  ide: remove write-only ide_pio_data_t.blacklisted
  sis5513: sis5513_config_xfer_rate() cleanup
  piix: cleanup
  svwks: small cleanup
  cs5530: small cleanup
  hpt366: remove redundant check from init_dma_hpt366()
  trm290: remove redundant CONFIG_BLK_DEV_IDEDMA #ifdef-s
  au1xxx-ide: remove dead code
  ...
2007-02-19 13:01:30 -08:00
Tobias Klauser c5a69d57eb Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-02-17 20:11:19 +01:00
Matthew Wilcox 082f6f9ddc fix SCSI_SCAN_ASYNC help text
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-02-17 19:36:33 +01:00
Uwe Kleine-König 1b3c3714cb Fix typos concerning hierarchy
heirarchical, hierachical -> hierarchical
        heirarchy, hierachy -> hierarchy

Signed-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-02-17 19:23:03 +01:00
Robert P. J. Day bbf2f9fb1c Fix misspellings of "agressive".
Fix the various misspellings of "agressive", as well as a couple
other things on the same lines while we're there.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-02-17 19:20:16 +01:00
Robert P. J. Day 4c3ee82663 drivers/scsi/a100u2w.c: trivial typo patch
Trivial typo fix.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-02-17 19:18:52 +01:00
Robert P. J. Day 405ae7d381 Replace remaining references to "driverfs" with "sysfs".
Globally, s/driverfs/sysfs/g.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-02-17 19:13:42 +01:00
Bartlomiej Zolnierkiewicz c94964a455 ide: remove ide_drive_t.usage
This field is no longer used by the core IDE code so fix ide-{disk,floppy}
drivers to keep openers count in the driver specific objects and remove
it from ide-{cd,scsi,tape} drivers (it was write-only).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-02-17 02:40:24 +01:00
Oliver Neukum 61bf54b71d USB Storage: indistinguishable devices with broken and unbroken firmware
there's a USB mass storage device which exists in two version. One
reports the correct size and the other does not. Apart from that they
are identical and cannot be told apart. Here's a heuristic based on the
empirical finding that drives have even sizes.


Signed-off-by: Oliver Neukum <oneukum@suse.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-02-16 15:32:19 -08:00