Eric Moore [Wed, 7 Feb 2007 23:51:40 +0000 (16:51 -0700)]
[SCSI] fusion: fix domain validation loops
After host reset, the device are programmed to default asyn narrow nego.
We need to reprogram the parameter back to previous values. If the host
reset is called as a result of spi_dv_device() commands timing out, its
possible to get into an infinite loop of dv to host reset. This will
prevent that case, as we merely program old values. If host reset is
called outside context of domain validation, then we can call
spi_dv_device.
Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
David Miller [Mon, 16 Apr 2007 19:37:43 +0000 (12:37 -0700)]
[SCSI] qla2xxx: fix regression on sparc64
Some sparc64 boxes don't have a valid NVRAM (from which the driver
takes its WWPN) try to extract this from open firmware instead and if
that fails, fall back to a default, which would be invalid if more
than one machine on the same SAN does this, since two machines with
the same WWPN would be illegal, so warn when taking this potentially
invalid default.
Tested on SunBlade-1000:
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Michael Tokarev [Fri, 27 Oct 2006 12:02:37 +0000 (16:02 +0400)]
[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>
Alan Stern [Tue, 20 Feb 2007 16:01:57 +0000 (11:01 -0500)]
[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>
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>
Salyzyn, Mark [Fri, 13 Apr 2007 12:35:25 +0000 (08:35 -0400)]
[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>
Salyzyn, Mark [Wed, 4 Apr 2007 19:49:54 +0000 (15:49 -0400)]
[SCSI] aacraid: Correct SMC products in aacraid.txt
Correct a spelling mistake for the SMC product names (replace 'B' with
'R') in the Documentation/scsi/aacraid.txt file. This is a follow-up to
a documentation patch '[PATCH] aacraid: Add SMC and SUN products to
README' submitted and accepted to scsi-misc-2.6 on March 27 2007.
Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Brian King [Thu, 29 Mar 2007 20:25:52 +0000 (15:25 -0500)]
[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>
Salyzyn, Mark [Fri, 30 Mar 2007 14:30:48 +0000 (10:30 -0400)]
[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>
Brian King [Thu, 29 Mar 2007 17:43:50 +0000 (12:43 -0500)]
[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>
Brian King [Thu, 29 Mar 2007 17:43:17 +0000 (12:43 -0500)]
[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>
Brian King [Thu, 29 Mar 2007 17:43:01 +0000 (12:43 -0500)]
[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>
Brian King [Thu, 29 Mar 2007 17:42:40 +0000 (12:42 -0500)]
[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>
Robert Jennings [Wed, 28 Mar 2007 17:45:46 +0000 (12:45 -0500)]
[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>
Salyzyn, Mark [Wed, 28 Mar 2007 17:44:54 +0000 (13:44 -0400)]
[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>
Salyzyn, Mark [Wed, 28 Mar 2007 13:22:39 +0000 (09:22 -0400)]
[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>
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>
Salyzyn, Mark [Tue, 27 Mar 2007 19:07:28 +0000 (15:07 -0400)]
[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>
Adrian Bunk [Tue, 27 Mar 2007 05:59:29 +0000 (21:59 -0800)]
[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>
Adrian Bunk [Tue, 27 Mar 2007 05:59:46 +0000 (21:59 -0800)]
[SCSI] fusion: make mptspi_target_destroy() static
Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
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>
Robert P. J. Day [Mon, 26 Mar 2007 20:06:45 +0000 (16:06 -0400)]
[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>
Salyzyn, Mark [Mon, 26 Mar 2007 13:21:14 +0000 (09:21 -0400)]
[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>
Richard Lary [Thu, 22 Mar 2007 15:53:19 +0000 (10:53 -0500)]
[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>
Anton Blanchard [Wed, 21 Mar 2007 13:41:47 +0000 (08:41 -0500)]
[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>
Salyzyn, Mark [Wed, 21 Mar 2007 17:49:47 +0000 (13:49 -0400)]
[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>
Salyzyn, Mark [Wed, 21 Mar 2007 17:22:56 +0000 (13:22 -0400)]
[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>
James Bottomley [Tue, 20 Mar 2007 19:44:04 +0000 (14:44 -0500)]
[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>
Tejun Heo [Tue, 20 Mar 2007 15:13:59 +0000 (00:13 +0900)]
[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>
Eric Moore [Mon, 19 Mar 2007 16:31:51 +0000 (10:31 -0600)]
[SCSI] fusion: remove VMWare guest OS remounted as read only work around
This address the issue of VMWare guest OS being remounted as read-only
becuase the underlying device was held busy too long and at the
same time address Engenio MPP driver concerns over infinite retries.
This patch removes the code that snoops the SAM STATUS on busy, which
would be returning DID_BUS_BUSY, instead we return the status as is.
Retry hanlding seems to be properly handled in scsi_softirq_done,
where a busy sam status would only occurr for the time specified by
(cmd->allowed +1) * cmd->timeout_per_command.
Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
CC [M] drivers/message/fusion/mptbase.o
drivers/message/fusion/mptbase.c: In function `mpt_resume':
drivers/message/fusion/mptbase.c:1541: warning: ignoring return value
of `pci_enable_device', declared with attribute warn_unused_result
It also in turn has mptscsih_resume() honour the return value of
mpt_resume()
I'm not sure about the handling of the other potential error cases
in mpt_resume(), of which there appear to be many. But this does
seem to be a good start.
Signed-off-by: Simon Horman <horms@verge.net.au> Acked-by: "Moore, Eric" <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
James Bottomley [Fri, 16 Mar 2007 22:44:41 +0000 (17:44 -0500)]
[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>
Mark Haverkamp [Thu, 15 Mar 2007 17:27:45 +0000 (10:27 -0700)]
[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>
Mark Haverkamp [Thu, 15 Mar 2007 17:27:32 +0000 (10:27 -0700)]
[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>
Mark Haverkamp [Thu, 15 Mar 2007 17:26:55 +0000 (10:26 -0700)]
[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>
Mark Haverkamp [Thu, 15 Mar 2007 17:27:21 +0000 (10:27 -0700)]
[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>
Mark Haverkamp [Thu, 15 Mar 2007 19:55:07 +0000 (12:55 -0700)]
[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>
Mark Haverkamp [Thu, 15 Mar 2007 17:26:22 +0000 (10:26 -0700)]
[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>
Mark Haverkamp [Thu, 15 Mar 2007 17:26:05 +0000 (10:26 -0700)]
[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>
Pete Wyckoff [Tue, 13 Mar 2007 20:53:28 +0000 (16:53 -0400)]
[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>
FUJITA Tomonori [Tue, 13 Mar 2007 01:07:15 +0000 (10:07 +0900)]
[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>
James Smart [Mon, 12 Mar 2007 19:16:35 +0000 (14:16 -0500)]
[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>
Andrew Vasquez [Mon, 12 Mar 2007 17:41:29 +0000 (10:41 -0700)]
[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>
Malahal Naineni [Mon, 12 Mar 2007 17:41:26 +0000 (10:41 -0700)]
[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>
James Bottomley [Sun, 11 Mar 2007 19:16:43 +0000 (14:16 -0500)]
[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>
FUJITA Tomonori [Sat, 3 Mar 2007 00:55:55 +0000 (09:55 +0900)]
[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>
FUJITA Tomonori [Sat, 3 Mar 2007 00:55:54 +0000 (09:55 +0900)]
[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>
Mike Christie [Sat, 3 Mar 2007 00:55:54 +0000 (09:55 +0900)]
[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>
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>
Mike Christie [Wed, 28 Feb 2007 23:32:20 +0000 (17:32 -0600)]
[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>
Mike Christie [Wed, 28 Feb 2007 23:32:19 +0000 (17:32 -0600)]
[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>
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>
Russell King points out that it's obviously bogus, and I have to agree.
Not only does "irq" not even exist in that scope, but we obviously need
to free the irq that we actually requested, and that's IRQ_USB.
Reported-by: Russell King <rmk@arm.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Greg KH <greg@kroah.com> Cc: David Brownell <david-b@pacbell.net>, Cc: Milan Svoboda <msvoboda@ra.rockwell.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (23 commits)
USB Elan FTDI: check for workqueue creation
USB: fix spinlock recursion in cdc-acm.c
USB: fix Unaligned access in EHCI driver
USB: Product ID for FT232RL in ftdi_sio
USBNET: DM9501: Add Corega FEther USB-TXC support.
USB: ipaq.c: Additional devices
USB: further fix for usb-serial
USB: fix usb-serial device naming bug
USB: RTS/DTR signal patch for airprime driver
USB: ftdi_sio: use port_probe / port_remove thereby fixing access to the latency_timer
usb-serial: fix shutdown / device_unregister order
USB: add Additional PIDs in ftdi_sio
USB: add QL355P power supply ids to fdti_sio
USB: New device IDs for cp2101 driver
USB: kill dead code from hub.c
USB: ratelimit debounce error messages
USB: pxa2xx_udc: fix hardcoded irq number
UHCI: fix port resume problem
USB: set the correct interval for interrupt URBs
USB: goku_udc: Remove crude cache coherency code
...