aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi
AgeCommit message (Collapse)Author
2008-10-23[SCSI] sd: remove command-size switching codeAlan Stern
This patch (as1138) removes from sd.c some old code for switching from 10-byte commands to 6-byte commands. This code is redundant -- the switching for READ and WRITE is already handled in scsi_io_completion() and the switching for MODE SENSE is already handled in scsi_mode_sense(). (There is no comparable switch for MODE SELECT, but I doubt one is needed.) Furthermore the other handlers do a better job; they check for appropriate ASC and ASCQ values before blindly switching the size. The code in sd.c is known to cause problems with some devices by switching when it shouldn't. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] 3w-9xxx: remove unnecessary local_irq_save/restore for scsi sg copy APIFUJITA Tomonori
Since the commit 50bed2e2862a8f3a4f7d683d0d27292e71ef18b9 (sg: disable interrupts inside sg_copy_buffer), no need to disable interrupts before calling scsi_sg_copy_from_buffer. So we can simplify twa_scsiop_execute_scsi_complete() a bit, which disables interrupts just for scsi_sg_copy_from_buffer. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Adam Radford <linuxraid@amcc.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] 3w-xxxx: remove unnecessary local_irq_save/restore for scsi sg copy APIFUJITA Tomonori
Since the commit 50bed2e2862a8f3a4f7d683d0d27292e71ef18b9 (sg: disable interrupts inside sg_copy_buffer), no need to disable interrupts before calling scsi_sg_copy_from_buffer. So we can simplify tw_transfer_internal, which disables interrupts just for scsi_sg_copy_from_buffer. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>\ Acked-by: Adam Radford <linuxraid@amcc.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] fix netlink kernel-docRandy Dunlap
Fix kernel-doc warning: the function short description must be on one line and the previous comment is not kernel-doc but it was confusing scripts/kernel-doc. Warning(lin2627-g3-kdocfixes//drivers/scsi/scsi_netlink.c:221): No description found for parameter 'skb' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] sd: Fix handling of NO_SENSE check conditionJamie Wellnitz
The current handling of NO_SENSE check condition is the same as RECOVERED_ERROR, and assumes that in both cases, the I/O was fully transferred. We have seen cases of arrays returning with NO_SENSE (no error), but the I/O was not completely transferred, thus residual set. Thus, rather than return good_bytes as the entire transfer, set good_bytes to 0, so that the midlayer then applies the residual in calculating the transfer, and for sd, will fail the I/O and fall into a retry path. Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] export busy state via q->lld_busy_fn()Kiyoshi Ueda
This patch implements q->lld_busy_fn() for scsi mid layer to export its busy state for request stacking drivers. For efficiency, no lock is taken to check the busy state of shost/starget/sdev, since the returned value is not guaranteed and may be changed after request stacking drivers call the function, regardless of taking lock or not. When scsi can't dispatch I/Os anymore and needs to kill I/Os (e.g. !sdev), scsi needs to return 'not busy'. Otherwise, request stacking drivers may hold requests forever. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] refactor sdev/starget/shost busy checkingKiyoshi Ueda
This patch refactors the busy checking codes of scsi_device, Scsi_Host and scsi_target. There should be no functional change. This is a preparation for another patch which exports scsi's busy state to the block layer for request stacking drivers. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] aic7xxx: Take the LED out of diagnostic mode on PM resumethomas schorpp
Take the Diag/Activity-LED of the HBA out of diagnostic mode on PM resume after successful PM resume from standby and HBA restart, it remained always on before. If something fails before complete recovery, it should remain on, since it is a diagnostics LED, reason for the used higher layer for the clear. Signed-off-by: thomas.schorpp@gmail.com Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] aic79xx: user visible misuse wrong SI units (not disk size!)Alan Cox
MHZ not Mhz for SI unit pedants Closes bug #6422 Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] ipr: use memory_read_from_buffer()Akinobu Mita
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Brian King <brking@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] aic79xx: fix shadowed variablesHarvey Harrison
OK to just reuse the outer declaration as it is never used again. drivers/scsi/aic7xxx/aic79xx_pci.c:340:12: warning: symbol 'devconfig' shadows an earlier one drivers/scsi/aic7xxx/aic79xx_pci.c:299:12: originally declared here targpcistat is always assigned just before use, remove the inner declaration. drivers/scsi/aic7xxx/aic79xx_pci.c:486:9: warning: symbol 'targpcistat' shadows an earlier one drivers/scsi/aic7xxx/aic79xx_pci.c:429:9: originally declared here Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] aic79xx: fix shadowed variables, add staticsHarvey Harrison
Redeclared within different if/else blocks, safe to reuse the original from beginning of function. drivers/scsi/aic7xxx/aic79xx_core.c:2475:10: warning: symbol 'scbid' shadows an earlier one drivers/scsi/aic7xxx/aic79xx_core.c:2399:10: originally declared here drivers/scsi/aic7xxx/aic79xx_core.c:2586:10: warning: symbol 'scbid' shadows an earlier one drivers/scsi/aic7xxx/aic79xx_core.c:2399:10: originally declared here drivers/scsi/aic7xxx/aic79xx_core.c:2587:15: warning: symbol 'scb' shadows an earlier one drivers/scsi/aic7xxx/aic79xx_core.c:2393:13: originally declared here Use caminfo for the outer declaration, the redeclared version is iterating over all initiator/target pairs (devices) which. drivers/scsi/aic7xxx/aic79xx_core.c:8857:23: warning: symbol 'devinfo' shadows an earlier one drivers/scsi/aic7xxx/aic79xx_core.c:8711:21: originally declared here Forward declaration was already marked static, make the definition match. drivers/scsi/aic7xxx/aic79xx_core.c:3693:1: warning: symbol 'ahd_devlimited_syncrate' was not declared. Should it be static? Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] aic7xxx: update *_shipped filesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] aic7xxx: update .reg filesDenys Vlasenko
Update .reg files, marking unused registers with dont_generate_debug_code. Comment explains how to use it. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] aic7xxx: introduce "dont_generate_debug_code" keyword in aicasm parserDenys Vlasenko
aic7xxx still contains ~30kb of dead code if pretty printing of registers is requested. These patches deal with it. Size differences: text data bss dec hex filename DEBUG_ENABLE+PRETTY_PRINT: 234697 2362 1188 238247 3a2a7 linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o 205092 2362 1188 208642 32f02 linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o NO_DEBUG_ENABLE+PRETTY_PRINT: 227272 2362 1172 230806 38596 linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o 197671 2362 1172 201205 311f5 linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o DEBUG_ENABLE+NO_PRETTY_PRINT: 192457 2362 1188 196007 2fda7 linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o 192457 2362 1188 196007 2fda7 linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o NO_DEBUG_ENABLE+NO_PRETTY_PRINT: 185040 2362 1172 188574 2e09e linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o 185040 2362 1172 188574 2e09e linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o This patch: Introduce "dont_generate_debug_code" keyword in aicasm parser. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] scsi_dh: Initialize path state to be passive when path is not ownedChandra Seetharaman
Set the path state to be passive when we learn that the controller does not own the path to the LUN. This will avoid sending even a single i/o thru the passive path at the probe time. Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23[SCSI] fix removable device inability to detect disk changesJames Bottomley
On Tue, 12 Aug 2008 15:08:14 +0200 Giuliano Pochini <pochini@shiny.it> wrote: > Fujitsu magneto-optical drive, Adaptec 29160 and > Linux Jay 2.6.26 #7 SMP Sun Aug 10 18:34:22 CEST 2008 ppc 7455, altivec supported PowerMac3,6 GNU/Linux > > When I insert a disk and I mount it, scsi_test_unit_ready() is called and > the do-while loop gets sshdr->sense_key == UNIT_ATTENTION in the first > cycle and 0 in the second one. So the if below misses the UNIT_ATTENTION > and sdev->changed = 1 is not executed. At this point bad things can > happen... I'm not sure how to fix this. Any clue ? The problem is essentially caused by us eating UNIT_ATTENTION conditions in scsi_test_unit_ready(). Fix by updating the ->changed flag when this happens if the media is removable. [pochini@shiny.it: updates to tidy up patch] Signed-off-by: Giuliano Pochini <pochini@shiny.it> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-17Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (39 commits) [SCSI] sd: fix compile failure with CONFIG_BLK_DEV_INTEGRITY=n libiscsi: fix locking in iscsi_eh_device_reset libiscsi: check reason why we are stopping iscsi session to determine error value [SCSI] iscsi_tcp: return a descriptive error value during connection errors [SCSI] libiscsi: rename host reset to target reset [SCSI] iscsi class: fix endpoint id handling [SCSI] libiscsi: Support drivers initiating session removal [SCSI] libiscsi: fix data corruption when target has to resend data-in packets [SCSI] sd: Switch kernel printing level for DIF messages [SCSI] sd: Correctly handle all combinations of DIF and DIX [SCSI] sd: Always print actual protection_type [SCSI] sd: Issue correct protection operation [SCSI] scsi_error: fix target reset handling [SCSI] lpfc 8.2.8 v2 : Add statistical reporting control and additional fc vendor events [SCSI] lpfc 8.2.8 v2 : Add sysfs control of target queue depth handling [SCSI] lpfc 8.2.8 v2 : Revert target busy in favor of transport disrupted [SCSI] scsi_dh_alua: remove REQ_NOMERGE [SCSI] lpfc 8.2.8 : update driver version to 8.2.8 [SCSI] lpfc 8.2.8 : Add MSI-X support [SCSI] lpfc 8.2.8 : Update driver to use new Host byte error code DID_TRANSPORT_DISRUPTED ...
2008-10-16device create: scsi: convert device_create_drvdata to device_createGreg Kroah-Hartman
Now that device_create() has been audited, rename things back to the original call to be sane. Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-15[SCSI] sd: fix compile failure with CONFIG_BLK_DEV_INTEGRITY=nJames Bottomley
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-14m68k: Atari SCSI needs NVRAMGeert Uytterhoeven
ERROR: "nvram_read_byte" [drivers/scsi/atari_scsi.ko] undefined! ERROR: "nvram_check_checksum" [drivers/scsi/atari_scsi.ko] undefined! Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-14m68k: Remove the broken Hades supportAdrian Bunk
This patch removes the Hades support that was marked as BROKEN 5 years ago. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-13Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (66 commits) ata: Add documentation for hard disk shock protection interface (v3) ide: Implement disk shock protection support (v4) ide-cd: fix printk format warning piix: add Hercules EC-900 mini-notebook to ich_laptop short cable list ide-atapi: assign taskfile flags per device type ide-cd: move cdrom_info.dma to ide_drive_t.dma ide: add ide_drive_t.dma flag ide-cd: add a debug_mask module parameter ide-cd: convert driver to new ide debugging macro (v3) ide: move SFF DMA code to ide-dma-sff.c ide: cleanup ide-dma.c ide: cleanup ide_build_dmatable() ide: remove needless includes from ide-dma.c ide: switch to DMA-mapping API part #2 ide: make ide_dma_timeout() available also for CONFIG_BLK_DEV_IDEDMA_SFF=n ide: make ide_dma_lost_irq() available also for CONFIG_BLK_DEV_IDEDMA_SFF=n ide: __ide_dma_end() -> ide_dma_end() pmac: remove needless pmac_ide_destroy_dmatable() wrapper pmac: remove superfluous pmif == NULL checks ide: Two fixes regarding memory allocation ...
2008-10-13Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (49 commits) pcmcia: ioctl-internal definitions pcmcia: cistpl header cleanup pcmcia: remove unused argument to pcmcia_parse_tuple() pcmcia: card services header cleanup pcmcia: device_id header cleanup pcmcia: encapsulate ioaddr_t pcmcia: cleanup device driver header file pcmcia: cleanup socket services header file pcmcia: merge ds_internal.h into cs_internal.h pcmcia: cleanup cs_internal.h pcmcia: cs_internal.h is internal pcmcia: use dev_printk for cs_error() pcmcia: remove CS_ error codes alltogether pcmcia: deprecate CS_BAD_TUPLE pcmcia: deprecate CS_BAD_ARGS pcmcia: deprecate CS_BAD_BASE, CS_BAD_IRQ, CS_BAD_OFFSET and CS_BAD_SIZE pcmcia: deprecate CS_BAD_ATTRIBUTE, CS_BAD_TYPE and CS_BAD_PAGE pcmcia: deprecate CS_NO_MORE_ITEMS pcmcia: deprecate CS_IN_USE pcmcia: deprecate CS_CONFIGURATION_LOCKED ... Fix trivial conflict in drivers/pcmcia/ds.c manually
2008-10-13ide: set IDE_AFLAG_DRQ_INTERRUPT in do_identify()Bartlomiej Zolnierkiewicz
Set IDE_AFLAG_DRQ_INTERRUPT in do_identify() instead of ATAPI device drivers *_setup() methods. While at it: - use ata_id_cdb_intr() There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: remove superfluous ->media field from ide_driver_tBartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: add device flagsBartlomiej Zolnierkiewicz
Add 'unsigned long dev_flags' to ide_drive_t and convert bitfields to IDE_DFLAG_* flags. While at it: - IDE_DFLAG_ADDRESSING -> IDE_DFLAG_LBA48 - fixup some comments - remove needless g->flags zeroing from ide*_probe() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: make ide_transfer_pc() staticBartlomiej Zolnierkiewicz
* Move ->ticks field from struct ide_floppy_obj to ide_drive_t. * Move idefloppy_transfer_pc() to ide-atapi.c and make ide_transfer_pc() use it. * Always use ide_transfer_pc as a handler in ide_issue_pc(). * Remove no longer used idefloppy_start_pc_transfer(), ide*_transfer_pc() and 'handler' argument from ide_issue_pc(). * Make ide_transfer_pc() static. While at it: * idefloppy_transfer_pc() -> ide_delayed_transfer_pc() * IDEFLOPPY_TICKS_DELAY -> IDEFLOPPY_PC_DELAY * ->ticks -> ->pc_delay There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: make ide_pc_intr() staticBartlomiej Zolnierkiewicz
* Always use ide_pc_intr as a handler in ide_pc_intr(). * Remove no longer used ide*_pc_intr() and 'handler' argument from ide_{transfer_pc,pc_intr}(). * Make ide_pc_intr() static. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: add ->pc_{update,io}_buffers methodsBartlomiej Zolnierkiewicz
Add ->pc_{update,io}_buffers methods to ide_drive_t and use them instead of {update,io}_buffers ide_pc_intr() arguments. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: add ide_retry_pc() helperBartlomiej Zolnierkiewicz
* Add ide_create_request_sense_cmd() and ide_retry_pc() helpers and convert ide-{atapi,floppy,tape}.c to use them. * Remove no longer used ide*_create_request_sense_cmd(), ide*_retry_pc() and 'retry_pc' argument from ide_pc_intr(). * Make ide_queue_pc_head() static. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: drop 'timeout' and 'expiry' arguments from ide_pc_intr()Bartlomiej Zolnierkiewicz
* Move idescsi_expiry() to ide-atapi.c. * Move get_timeout() to <linux/ide.h>. * Drop 'timeout' and 'expiry' arguments from ide_pc_intr(). While at it: * idescsi_expiry() -> ide_scsi_expiry() * get_timeout() -> ide_scsi_get_timeout() There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: add pointer to the current packet command to ide_drive_tBartlomiej Zolnierkiewicz
* Add pointer to the current packet command (struct ide_atapi_pc *pc) to ide_drive_t and use it instead of the pointer in struct ide_*_obj. * Use drive->pc in ide_{issue,transfer}_pc() and ide_pc_intr() instead of 'pc' argument. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: drop dsc_handle argument from ide_pc_intr()Bartlomiej Zolnierkiewicz
* Add 'int dsc' argument to ->pc_callback method. * Call ide_tape_handle_dsc() internally in ide_tape_callback() if dsc argument is set and update ide_pc_intr() accordingly. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13libiscsi: fix locking in iscsi_eh_device_resetMike Christie
We must be using the bh spin locking functions in iscsi_eh_device_reset becuase the session lock interacts with a thread and softirq. This patch also fixes up a bogus comment and check in fail_command, because no one drops the lock (bnx2i did but it is not going upstream yet and there were other refcount changes for that). Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13libiscsi: check reason why we are stopping iscsi session to determine error ↵Mike Christie
value Some wires got crossed on some patches and I messed up in the code below when rebuilding a patch. We want to be checking if flag equaled the value indicating if we killing the session due to final logout or if we just trying to relogin. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] iscsi_tcp: return a descriptive error value during connection errorsMike Christie
The segment->done functions return a iscsi error value which gives a lot more info than conn failed, so this patch has us return that value. I also add a new one for xmit failures. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] libiscsi: rename host reset to target resetMike Christie
I had this in my patchset to add target reset support, but it got dropped due to patching conflicts. This initial patch just renames the function and users. We are actually just dropping the session, and so this does not have anything to do with the host exactly. It does for software iscsi because we allocate a host per session, but for cxgb3i this makes no sense. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] iscsi class: fix endpoint id handlingMike Christie
Some endpoint code was using unsigned int and some was using uint64_t. This converts it all to uint64_t. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] libiscsi: Support drivers initiating session removalMike Christie
If the driver knows when hardware is removed like with cxgb3i, bnx2i, qla4xxx and iser then we will want to remove the sessions/devices that are bound to that device before removing the host. cxgb3i and in the future bnx2i will remove the host and that will remove all the sessions on the hba. iser can call iscsi_kill_session when it gets an event that indicates that a hca is removed. And when qla4xxx is hooked in to the lib (it is only hooked into the class right now) it can call iscsi remove host like the partial offload card drivers. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] libiscsi: fix data corruption when target has to resend data-in packetsMike Christie
iscsi_tcp was updating the exp_statsn (exp_statsn acknowledges status and tells the target it is ok to let the resources for a iscsi pdu to be reused) before it got all the data for pdu read into OS buffers. Data corruption was occuring if something happens to a packet and the network layer requests a retransmit, and the initiator has told the target about the udpated exp_statsn ack, then the target may be sending data from a buffer it has reused for a new iscsi pdu. This fixes the problem by having the LLD (iscsi_tcp in this case) just handle the transferring of data, and has libiscsi handle the processing of status (libiscsi completion processing is done after LLD data transfers are complete). Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] sd: Switch kernel printing level for DIF messagesMartin K. Petersen
For some reason these messages ended up being printed with KERN_INFO rendering them invisible to pretty much everyone. Switch to KERN_NOTICE. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] sd: Correctly handle all combinations of DIF and DIXMartin K. Petersen
The old detection code couldn't handle all possible combinations of DIX and DIF. This version does, giving priority to DIX if the controller is capable. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] sd: Always print actual protection_typeMartin K. Petersen
Now that we no longer use protection_type as trigger for preparing protected CDBs we can remove the places that set it to zero. This allows userland to see which protection type the device is formatted with regardless of whether the HBA supports DIF or not. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] sd: Issue correct protection operationMartin K. Petersen
Use the same logic to prepare RD/WRPROTECT and the protection operation. Fixes a corner case where we could issue an unprotected CDB and yet tell the HBA to do DIF to the drive. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] scsi_error: fix target reset handlingJames Bottomley
There's a target reset bug. This loop: for (id = 0; id <= shost->max_id; id++) { Never terminates if shost->max_id is set to ~0, like aic94xx does. It's also pretty inefficient since you mostly have compact target numbers, but the max_id can be very high. The best way would be to sort the recovery list by target id and skip them if they're equal, but even a worst case O(N^2) traversal is probably OK here, so fix it by finding the next highest target number (assuming n+1) and terminating when there isn't one. Cc: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] lpfc 8.2.8 v2 : Add statistical reporting control and additional fc ↵James Smart
vendor events Added support for new sysfs attributes: lpfc_stat_data_ctrl and lpfc_max_scsicmpl_time. The attributes control statistical reporting of io load. Added support for new fc vendor events for error reporting. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] lpfc 8.2.8 v2 : Add sysfs control of target queue depth handlingJames Smart
Added new sysfs attribute lpfc_max_scsicmpl_time. Attribute, when enabled, will control target queue depth based on I/O completion time. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] lpfc 8.2.8 v2 : Revert target busy in favor of transport disruptedJames Smart
Revert the target busy response in favor of the transport disrupted response for node state transitions. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13[SCSI] scsi_dh_alua: remove REQ_NOMERGEMike Christie
We do not need to set REQ_NOMERGE because when the module calls blk_execute_rq -> blk_execute_rq_nowait, blk_execute_rq_nowait sets it for us. This brings all the modules in sync for those bits. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>