summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
Commit message (Collapse)AuthorAgeFilesLines
...
| * [SCSI] qla2xxx: Add a filter to compare port_name against the physical on ↵Seokmann Ju2008-01-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | vport creation. During vport creation, there was a possibility to get create a vport with same port_name as pport. A new filter has added to compare given port_name with the port_name of the pport. Signed-Off-by: Seokmann Ju <seokmann.ju@qlogic.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Use completion routines.Marcus Barrow2008-01-236-69/+16Star
| | | | | | | | | | | | | | | | | | Instead of abusing the semaphore interfaces for mailbox command completions. Additional cleanups and Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Don't schedule the DPC routine to perform an issue-lip request.Andrew Vasquez2008-01-233-3/+4
| | | | | | | | | | | | | | | | | | | | As the driver depends on the DPC routine to handle bottom-half loop resynchronization in order to recover from the issue-lip request. The issue_lip call is sleeping context capable, so just issue the reset function there. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Restrict MSI/MSI-X enablement on select ISP2432-type HBAs.Andrew Vasquez2008-01-231-0/+12
| | | | | | | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Wait for FLASH write-protection to complete after a write.Andrew Vasquez2008-01-231-2/+8
| | | | | | | | | | | | | | | | | | | | Some flash parts have a slow enable write-protection (WP) operation whereby subsequent FLASH accesses would fail if the WP operation had not completed. Software now polls the SPI's status-register for WP completion. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Fix for 32-bit platforms with 64-bit resources.Andrew Vasquez2008-01-232-17/+8Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver stores the contents of PCI resources into unsigned long's before ioremapping. This breaks on 32-bit platforms which support 64-bit MMIO resources. Correct code by removing the temporary variables used during MMIO PIO mapping and using resource_size_t where applicable. Also correct a small typo in a printk() where the wrong region number was displayed. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Retrieve additional HBA port statistics from recent ISPs.Andrew Vasquez2008-01-234-98/+74Star
| | | | | | | | | | | | | | | | HBAs supporting these additional counters include ISP24xx and ISP25xx type boards. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Consolidate duplicate sense-data handling codes.Andrew Vasquez2008-01-231-54/+31Star
| | | | | | | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] st: convert to unlocked_ioctlKai Makisara2008-01-231-5/+4Star
| | | | | | | | | | | | | | Convert st to unlocked_ioctl. The necessary locking was already in place. Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: remove pigs in spaceSalyzyn, Mark2008-01-235-464/+458Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was amazed at how much embedded space was present in the aacraid driver source files. Just selected five files from the set to clean up for now and the attached patch swelled to 73K in size! - Removed trailing space or tabs - Removed spaces embedded within tabs - Replaced leading 8 spaces with tabs - Removed spaces before ) - Removed ClusterCommand as it was unused (noticed it as one triggered by above) - Replaced scsi_status comparison with 0x02, to compare against SAM_STATUS_CHECK_CONDITION. - Replaced a long series of spaces with tabs - Replaced some simple if...defined() with ifdef/ifndef Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] sg: handle class_device_create failure properlyFUJITA Tomonori2008-01-231-4/+7
| | | | | | | | | | | | Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] sg: set class_data after successFUJITA Tomonori2008-01-231-1/+2
| | | | | | | | | | | | | | | | | | If cdev_add fails in sg_add, sg_remove crashes since class_data is bogus. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] dpt_i2o: use constant instead of bare valueSalyzyn, Mark2008-01-231-1/+1
| | | | | | | | | | | | | | 0x02 becomes SAM_STAT_CHECK_CONDITION Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] ch: Convert to use unlocked_ioctlMathieu Segaud2008-01-231-10/+8Star
| | | | | | | | | | | | | | | | | | | | | | As of now, compat_ioctl already runs without the BKL, whereas ioctl runs with the BKL. This patch first converts changer_fops to use a .unlocked_ioctl member. It applies the same locking rationale than ch_ioctl_compat() uses to ch_ioctl(). Signed-off-by: Mathieu Segaud <mathieu.segaud@regala.cx> Reviewed-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] sg: Only print SCSI data direction warning once for a commandAndi Kleen2008-01-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I use cdparanoia my logs get spammed a lot by printk: 464 messages suppressed. sg_write: data in/out 30576/30576 bytes for SCSI command 0xbe--guessing data in; program cdparanoia not setting count and/or reply_len properly printk: 1078 messages suppressed. and many more of those. With this patch the message is only printed once for a command in a row. v1->v2: Prevent rate limit messages too (pointed out by jejb) Signed-off-by: Andi Kleen <ak@suse.de> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: fix security weaknessAlan Cox2008-01-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actually there are several but one is trivially fixed 1. FSACTL_GET_NEXT_ADAPTER_FIB ioctl does not lock dev->fib_list but needs to 2. Ditto for FSACTL_CLOSE_GET_ADAPTER_FIB 3. It is possible to construct an attack via the SRB ioctls where the user obtains assorted elevated privileges. Various approaches are possible, the trivial ones being things like writing to the raw media via scsi commands and the swap image of other executing programs with higher privileges. So the ioctls should be CAP_SYS_RAWIO - at least all the FIB manipulating ones. This is a bandaid fix for #3 but probably the ioctls should grow their own capable checks. The other two bugs need someone competent in that driver to fix them. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: replace '<?:' with min_t()Salyzyn, Mark2008-01-231-24/+16Star
| | | | | | | | | | | | | | The promised min_t() cleanup. Purely cosmetic. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] replace sizeof sense_buffer with SCSI_SENSE_BUFFERSIZEFUJITA Tomonori2008-01-2326-95/+88Star
| | | | | | | | | | | | | | | | | | This replaces sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE in several LLDs. It's a preparation for the future changes to remove sense_buffer array in scsi_cmnd structure. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aic7xxx_old, eata_pio, ips, libsas: don't zero out sense_buffer in ↵FUJITA Tomonori2008-01-234-6/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | queuecommand LLDs don't need to zero out scsi_cmnd::sense_buffer in queuecommand since scsi-ml does. This is a preparation of the future changes to allocate the sense_buffer only when necessary. Many LLDs zero out the sense_buffer before touching it on the error case. This patch lets them alone for now because new APIs for them would be added later on. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: "Salyzyn, Mark" <Mark_Salyzyn@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] megaraid: fix section mismatchRandy Dunlap2008-01-231-3/+3
| | | | | | | | | | | | | | | | | | | | Change megaraid_pci_driver_g variable name so that it matches the modpost whitelist that allows pointers to init text/data. WARNING: vmlinux.o(.data+0x1a8e30): Section mismatch: reference to .init.text:megaraid_probe_one (between 'megaraid_pci_driver_g' and 'class_device_attr_megaraid_mbox_app_hndl') Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] libsas: fix sense_buffer overrunFUJITA Tomonori2008-01-231-1/+1
| | | | | | | | | | Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: SMC vendor identificationSalyzyn, Mark2008-01-231-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to an internal limit associated with the AdapterTypeText field, SMC required a product ID that overloaded the combined vendor and product ID. A decision was made to ship the SMC products without a vendor string dropping the defacto space that used to delineate vendor and product to boot. To correct this, we needed to adjust the code in the driver to parse out the vendor and product strings for the adapter. We match of 'AOC' in the AdapterTypeText, if so we set the vendor to SMC and place the entire AdapterTypeText into the product field. This only affects the cosmetic presentation of the Adapter vendor and product in the logs and in sysfs. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: respond to enclosure service eventsSalyzyn, Mark2008-01-232-22/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | Added support to respond to enclosure service events (controller AIFs) to add, online or offline physical targets reported to sg. Also added online and offlining of arrays. Removed an automatic variable definition in a sub block that hid an earlier definition, determined to be inert as the sub-block use did not interfere. Bumped the driver versioning to stamp the addition of this feature. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] sym53c8xx: fixes two bugs related to chip resetKrzysztof Helt2008-01-231-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes two bugs pointed by James Bottomley: 1. the if (!sym_data->io_reset). That variable is only ever filled by a stack based completion. If we find it non empty it means this code has been entered twice and we have a severe problem, so that should just become a BUG_ON(sym_data->io_reset). 2. sym_data->io_reset should be set to NULL before the routine is exited otherwise the PCI recovery code could end up completing what will be a bogus pointer into the stack. Big thanks to James Bottomley for help with the patch. Signed-off-by: Krzysztof Helt <krzysztof.h1@w.pl> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: add call to flush_kernel_dcache_pageSalyzyn, Mark2008-01-231-1/+2
| | | | | | | | | | | | | | | | Some architectures require a call to flush_kernel_dcache_page for processor spoofed DMA operations. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Update lpfc driver version to 8.2.4James Smart2008-01-231-3/+3
| | | | | | | | | | | | | | Update lpfc driver version to 8.2.4 Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Rework misplaced reference taking on node structureJames Smart2008-01-235-58/+157
| | | | | | | | | | | | | | Rework misplaced reference taking on node structure Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Enhance debugfs useJames Smart2008-01-232-25/+122
| | | | | | | | | | | | | | Enhance debugfs to dump HBA SLIM as well as Host SLIM Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Fix Unsolicited Data itemsJames Smart2008-01-234-111/+121
| | | | | | | | | | | | | | | | | | Fix Drivers Unsolicited CT command handling - we did not handle multiframe sequences well. Fix error due to delay in replenishing buffers for unsolicited data. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Add additional sysfs and module parametersJames Smart2008-01-233-14/+106
| | | | | | | | | | | | | | | | Made link speed and link topology modifiable via sysfs Make scatter gather Segment Count into a module parameter. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Make lpfc legacy I/O port freeTomohiro Kusumi2008-01-231-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a patch written by Tomohiro Kusumi and submitted to linux-scsi: http://marc.info/?l=linux-scsi&m=118673720712152&w=2 The original patch comment: This patch makes Emulex lpfc driver legacy I/O port free. It has already been acked quite long time ago. So I resubmit the patch. http://lkml.org/lkml/2006/11/22/28 Current lpfc driver is already using pci_select_bars() and pci_enable_device_bars() when the PCI bus has been reset. So I think this patch should also be acked. Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com> Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Miscellaneous FixesJames Smart2008-01-2313-169/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Miscellaneous Fixes: - Fix a couple of sparse complaints - Reset the FCP recovery flag when the node is not a FCP2 device. - Speed up offline prep delays - Fixed a memory leak in lpfc_mem_alloc failure path - Fixed external loopback test. - Fixed error code returned from the driver when HBA is over heated. - Correct Max NPIV vport to limits read from adapter - Add missing locks around fc_flag and FC_NEEDS_REG_VPI - Add missing hba ids for device identification - Added support for SET_VARIABLE and MBX_WRITE_WWN mailbox commands - Changed all temperature event messages from warning to error - Fix reporting of link speed when link is down - Added support for MBX_WRITE_WWN mailbox command - Change del_timer_sync() in ISR to del_timer() in interrupt handler - Correct instances of beXX_to_cpu() that should be cpu_to_beXX() - Perform target flush before releasing node references on module unload - Avoid bogus devloss_tmo messages when driver unloads - Fix panic when HBA generates ERATT interupt - Fix mbox race condition and a workaround on back-to-back mailbox commands - Force NPIV off for pt2pt mode between 2 NPorts - Stop worker thread before removing fc_host. - Fix up discovery timeout error case due to missing clear_la - Tighten mailbox polling code to speed up detection of fast completions - Only allow DUMP_MEMORY if adapter offline due to overtemp errors - Added extended error information to the log messages in chip init. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Add parameters to enable and disable heartbeat and hba ↵James Smart2008-01-234-38/+73
| | | | | | | | | | | | | | | | | | resets Add parameters to enable and disable heartbeat and hba resets Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Correct abort handler logicJames Smart2008-01-232-10/+29
| | | | | | | | | | | | | | | | Correct Abort handler logic. It was unconditionally waiting a minimum of 2 seconds rather than looking for abort completion. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] lpfc 8.2.4 : Miscellaneous Discovery/ELS FixesJames Smart2008-01-239-15/+224
| | | | | | | | | | | | | | | | | | | | | | | | Miscellaneous Discovery/ELS Fixes: - Delay free's of ELS requests if adapter reject conditions - Fix concurrent PLOGI vs ADISC state handling - Add retry mechanism for GFF_ID - Correct some illegal state transitions around RSCN timeouts - Fix missing return in FAN handling Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: improve queue balancingSalyzyn, Mark2008-01-231-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The adapter queue is divided up equally to all the arrays to prevent command starvation to any individual array. On the other hand, physical targets are only granted a queue depth of one each. The code prior to this patch used to deal with the incremental discovery of targets, but the driver knows how many arrays are present prior to the scan so this knowledge is used to generate a better estimate for the queue depth. Remove the capability of 'physical=0' from preventing access to the class of adapters that have the RAID/SCSI mode of operation since none of the physicals on the SCSI channel are candidates ever for an array. As always, the user can override this default queue depth policy by making the appropriate adjustments utilizing sysfs. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: OS panic after Adapter panic (hardening).Salyzyn, Mark2008-01-234-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In experiments in the lab we managed to trigger an Adapter firmware panic (BlinkLED) coincidentally while several pass-through ioctl command from the management software were outstanding on a bug only present on a class of RAID Adapters that require a hardware reset rather than a commanded reset. The net result was an attempt to time out the management software command as if it came from the SCSI layer resulting in an OS panic. Adapters that use commanded reset, management commands are returned failed by the Adapter correctly. The adapter firmware panic that resulted in this condition was also resolved, and there were no adapters in the field with this specific firmware bug so we do not expect any field reports. This is a rare or unlikely corner condition, and no reports have ever been forwarded from the field. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: fix multiple definition of automatic variable warning.Salyzyn, Mark2008-01-231-5/+4Star
| | | | | | | | | | | | | | | | | | | | The 'entry' automatic variable was defined at the top and within a block that uses it, removed the definition from the block that uses it. Some cosmetic changes were made while in the same file. This patch should be inert. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: fix big endian issuesSalyzyn, Mark2008-01-236-24/+22Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Big endian systems issues discovered in the aacraid driver. Somewhat reverses a patch from November 7th of last year that removed swap operations because they formerly were being assigned to an u8 array when they should have been assigned to an le32 array. This patch is largely inert for any little endian processor architecture. It resolves a bug in delivering the BlinkLED AIF event to registered applications when the adapter or associated hardware was reset due to ill health. A rare corner case occurrence, also largely unnoticed by any as it was a new (untested!) feature. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: variable redefinition hides earlier warningSalyzyn, Mark2008-01-231-5/+5
| | | | | | | | | | | | | | | | | | The parameter 'info' is reused, renamed the second to sinfo to represent supplemental adapter info, to suppress compile warning message. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: add sysfs report of RAID levelSalyzyn, Mark2008-01-233-1/+32
| | | | | | | | | | | | | | | | Report the RAID level string for the SCSI device representing the array. Report is in /sys/class/scsi_device/#:#:#:#/device/level. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aacraid: add parameter to control FUA and SYNCHRONIZE_CACHE policySalyzyn, Mark2008-01-233-12/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aacraid.cache parameter, Disable Queue Flush commands: bit 0 - Disable FUA in WRITE SCSI commands bit 1 - Disable SYNCHRONIZE_CACHE SCSI command bit 2 - Disable only if Battery not protecting adapter supplied Cache e.g.: aacraid.cache=7 will disable the FUA and SYNCHRONIZE_CACHE commands if the adapter has reported that it's cache is battery backed up. This parameter permits experimentation with tradeoffs between performance and caching policy. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] scsi_transport_spi: convert to attribute groupsJames Bottomley2008-01-231-82/+176
| | | | | | | | | | | | | | | | | | | | | | This conversion makes full use of the is_visible() callback on attribute groups. Now, each device appears only with its capability flags in the transport class directory. Previously each device appeared with the capability of the host, so this is a functionality improvement. Converting to attribute groups allows us to sweep away most of the home grown #defines that were effectively doing the same thing. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] add missing transport configure points for target and hostJames Bottomley2008-01-232-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | While trying to convert the SPI transport class to attribute groups, I discovered that we don't actually have any transport configure points for either the target or the host. This patch adds these missing transport class triggers. The host one is simply done after the add, the target one tries to be more clever and add it after devices may have been placed on the target (so the device configure will have set up the target parameters). Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] relax scsi dma alignmentJames Bottomley2008-01-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch relaxes the default SCSI DMA alignment from 512 bytes to 4 bytes. I remember from previous discussions that usb and firewire have sector size alignment requirements, so I upped their alignments in the respective slave allocs. The reason for doing this is so that we don't get such a huge amount of copy overhead in bio_copy_user() for udev. (basically all inquiries it issues can now be directly mapped). Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] fix scsi_setup_command_freelist failure path raceFUJITA Tomonori2008-01-121-3/+2Star
| | | | | | | | | | | | | | Looks like that host_cmd_pool_mutex are necessary here. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] sr: update to follow tray status correctlyJames Bottomley2008-01-123-16/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on an original patch from: David Martin <tasio@tasio.net> When trying to get the drive status via ioctl CDROM_DRIVE_STATUS, with no disk it gives CDS_TRAY_OPEN even if the tray is closed. ioctl works as expected with ide-cd driver. Gentoo bug report: http://bugs.gentoo.org/show_bug.cgi?id=196879 Cc: Maarten Bressers <mbres@gentoo.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] libsas: don't use made up error codesJames Bottomley2008-01-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is bad for two reasons: 1. If they're returned to outside applications, no-one knows what they mean. 2. Eventually they'll clash with the ever expanding standard error codes. The problem error code in question is ETASK. I've replaced this by ECOMM (communications error on send) a network error code that seems to most closely relay what ETASK meant. Acked-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] libsas, bsg: pass errors through correctlyJames Bottomley2008-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently in BSG, errors returned in req->errors aren't passed back to the calling programme (either via SG_IO or via read/write). Fix this, while preserving the SCSI convention of returning status in req->errors. Now update libsas to return errors correctly instead of to ignore them. Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] libsas: don't treat underrun as an error on SMP tasksJames Bottomley2008-01-121-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | All SMP tasks sent through bsg generate messages like: sas: smp_execute_task: task to dev 500605b000001450 response: 0x0 status 0x81 Three times (because the task gets retried). Firstly, don't retry either overrun or underrun (the data buffer isn't going to change size) and secondly, just report the underrun but don't set an error for it. This is necessary so bsg can report back the residual. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>