aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi
AgeCommit message (Collapse)AuthorFilesLines
2014-07-25qlogicfas: don't call free_dma()Arnd Bergmann1-2/+0
The qlogicfas scsi driver does not use DMA, and the call to free_dma() in its exit function seems to have been copied incorrectly from another driver but never caused trouble. One case where it gets in the way is randconfig builds on ARM, which depending on the configuration does not provide a free_dma() function, causing this build error: drivers/scsi/qlogicfas.c: In function 'qlogicfas_release': drivers/scsi/qlogicfas.c:175:3: error: implicit declaration of function 'free_dma' [-Werror=implicit-function-declaration] free_dma(shost->dma_channel); ^ Removing the incorrect function calls should be the obvious fix for this, with no downsides. Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Finn Thain <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25pas16: don't call free_dma()Arnd Bergmann1-2/+0
The pas16 scsi driver does not use DMA, and the call to free_dma() in its exit function seems to have been copied incorrectly from another driver but never caused trouble. One case where it gets in the way is randconfig builds on ARM, which depending on the configuration does not provide a free_dma() function, causing this build error: drivers/scsi/pas16.c: In function 'pas16_release': drivers/scsi/pas16.c:611:3: error: implicit declaration of function 'free_dma' [-Werror=implicit-function-declaration] free_dma(shost->dma_channel); Removing the incorrect function calls should be the obvious fix for this, with no downsides. Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Finn Thain <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25advansys: don't build ARMArnd Bergmann1-1/+1
The advansys SCSI driver uses the dma_cache_sync function, which is not available on the ARM architecture, and cannot be implemented correctly, so we always get this build error: drivers/scsi/advansys.c: In function 'advansys_get_sense_buffer_dma': drivers/scsi/advansys.c:7882:2: error: implicit declaration of function 'dma_cache_sync' [-Werror=implicit-function-declaration] dma_cache_sync(board->dev, scp->sense_buffer, ^ It seems nobody has missed this driver so far, so let's just disable it for ARM to help randconfig builds. Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Finn Thain <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25ibmvfc: fix little endian issuesTyrel Datwyler2-367/+374
Added big endian annotations to relevant data structure fields, and necessary byte swappings to support little endian builds. Signed-off-by: Brian King <[email protected]> Signed-off-by: Tyrel Datwyler <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25qla2xxx: Use dma_zalloc_coherentJoe Perches1-6/+4
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches <[email protected]> Acked-by: Saurav Kashyap <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]Fabian Frederick1-3/+3
Use macro definition Signed-off-by: Fabian Frederick <[email protected]> Acked-by: Anil Gurumurthy <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25bfa: remove useless return variablesPeter Senna Tschudin1-6/+4
This patch remove variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Verified by compilation only. The coccinelle script that find and fixes this issue is: // <smpl> @@ type T; constant C; identifier ret; @@ - T ret = C; ... when != ret when strict return - ret + C ; // </smpl> Signed-off-by: Peter Senna Tschudin <[email protected]> Acked-by: Sudarsana Kalluru <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25bfa: Fix undefined bit shift on big-endian architectures with 32-bit DMA addressBen Hutchings1-1/+1
bfa_swap_words() shifts its argument (assumed to be 64-bit) by 32 bits each way. In two places the argument type is dma_addr_t, which may be 32-bit, in which case the effect of the bit shift is undefined: drivers/scsi/bfa/bfa_fcpim.c: In function 'bfa_ioim_send_ioreq': drivers/scsi/bfa/bfa_fcpim.c:2497:4: warning: left shift count >= width of type [enabled by default] addr = bfa_sgaddr_le(sg_dma_address(sg)); ^ drivers/scsi/bfa/bfa_fcpim.c:2497:4: warning: right shift count >= width of type [enabled by default] drivers/scsi/bfa/bfa_fcpim.c:2509:4: warning: left shift count >= width of type [enabled by default] addr = bfa_sgaddr_le(sg_dma_address(sg)); ^ drivers/scsi/bfa/bfa_fcpim.c:2509:4: warning: right shift count >= width of type [enabled by default] Avoid this by adding casts to u64 in bfa_swap_words(). Compile-tested only. Signed-off-by: Ben Hutchings <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Acked-by: Anil Gurumurthy <[email protected]> Cc: [email protected] Fixes: f16a17507b09 ('[SCSI] bfa: remove all OS wrappers') Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25bfa: Use dma_zalloc_coherentJoe Perches1-3/+3
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches <[email protected]> Acked-by: Anil Gurumurthy <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25aic7xxx: Use kstrdupHimangi Saraogi3-6/+3
Use kstrdup when the goal of an allocation is copy a string into the allocated region. The Coccinelle semantic patch that makes this change is as follows: // <smpl> @@ expression from,to; expression flag,E1,E2; statement S; @@ - to = kmalloc(strlen(from) + 1,flag); + to = kstrdup(from, flag); ... when != \(from = E1 \| to = E1 \) if (to==NULL || ...) S ... when != \(from = E2 \| to = E2 \) - strcpy(to, from); // </smpl> Signed-off-by: Himangi Saraogi <[email protected]> Acked-by: Julia Lawall <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25scsi: add defines for new FC port speeds.Dick Kennedy1-0/+4
These speeds are to support the next generation of FCoE port speeds. Signed-off-by: Dick Kennedy <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25bnx2i, be2iscsi: fix custom stats lengthMike Christie2-5/+4
The custom stats is an array with custom_length indicating the length of the array. This patch fixes bnx2i and be2iscsi's setting of the custom stats length. They both just have the one, eh_abort_cnt, so that should be in the first entry of the custom array and custom_length should then be one. Reported-by: Rickard Strandqvist <[email protected]> Signed-off-by: Mike Christie <[email protected]> Acked-by: Vikas Chaudhary <[email protected]> Acked-by: Eddie Wai <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25iscsi: kill redundant castsNick Black' via open-iscsi1-2/+2
Remove two redundant casts from char * to char *. Signed-off-by: Nick Black <[email protected]> Signed-off-by: Mike Christie <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25tgt: remove SCSI_TGT and SCSI_FC_TGT_ATTRSPaul Bolle1-14/+0
The Kconfig symbols SCSI_TGT and SCSI_FC_TGT_ATTRS are unused since "tgt: removal". Setting them has no effect. Remove these symbols. Signed-off-by: Paul Bolle <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25sd: fix a bug in deriving the FLUSH_TIMEOUT from the basic I/O timeoutK. Y. Srinivasan1-1/+1
Commit ID: 7e660100d85af860e7ad763202fff717adcdaacd added code to derive the FLUSH_TIMEOUT from the basic I/O timeout. However, this patch did not use the basic I/O timeout of the device. Fix this bug. Signed-off-by: K. Y. Srinivasan <[email protected]> Reviewed-by: James Bottomley <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25scsi: add a blacklist flag which enables VPD page inquiriesMartin K. Petersen2-1/+8
Despite supporting modern SCSI features some storage devices continue to claim conformance to an older version of the SPC spec. This is done for compatibility with legacy operating systems. Linux by default will not attempt to read VPD pages on devices that claim SPC-2 or older. Introduce a blacklist flag that can be used to trigger VPD page inquiries on devices that are known to support them. Reported-by: KY Srinivasan <[email protected]> Tested-by: KY Srinivasan <[email protected]> Reviewed-by: KY Srinivasan <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> CC: <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-25scsi: move the writeable field from struct scsi_device to struct scsi_cdChristoph Hellwig4-29/+3
We currently set the field in common code based on the device type, but then only use it in the cdrom driver which also overrides the value previously set in the generic code. Just leave this entirely to the CDROM driver to make everyones life simpler. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]>
2014-07-25scsi: update scsi_device_typesChristoph Hellwig1-0/+2
Add two new device types, most importantly the zoned block device one. Split from an earlier patch by Hannes Reinecke. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]>
2014-07-25fnic: reject device resets without assigned tags for the blk-mq caseChristoph Hellwig1-0/+16
Current the midlayer fakes up a struct request for the explicit reset ioctls, and those don't have a tag allocated to them. The fnic driver pokes into midlayer structures to paper over this design issue, but that won't work for the blk-mq case. Either someone who can actually test the hardware will have to come up with a similar hack for the blk-mq case, or we'll have to bite the bullet and fix the way the EH ioctls work for real, but until that happens we fail these explicit requests here. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]> Cc: Hiral Patel <[email protected]> Cc: Suma Ramars <[email protected]> Cc: Brian Uchino <[email protected]>
2014-07-25scsi: add support for a blk-mq based I/O path.Christoph Hellwig6-68/+446
This patch adds support for an alternate I/O path in the scsi midlayer which uses the blk-mq infrastructure instead of the legacy request code. Use of blk-mq is fully transparent to drivers, although for now a host template field is provided to opt out of blk-mq usage in case any unforseen incompatibilities arise. In general replacing the legacy request code with blk-mq is a simple and mostly mechanical transformation. The biggest exception is the new code that deals with the fact the I/O submissions in blk-mq must happen from process context, which slightly complicates the I/O completion handler. The second biggest differences is that blk-mq is build around the concept of preallocated requests that also include driver specific data, which in SCSI context means the scsi_cmnd structure. This completely avoids dynamic memory allocations for the fast path through I/O submission. Due the preallocated requests the MQ code path exclusively uses the host-wide shared tag allocator instead of a per-LUN one. This only affects drivers actually using the block layer provided tag allocator instead of their own. Unlike the old path blk-mq always provides a tag, although drivers don't have to use it. For now the blk-mq path is disable by defauly and must be enabled using the "use_blk_mq" module parameter. Once the remaining work in the block layer to make blk-mq more suitable for slow devices is complete I hope to make it the default and eventually even remove the old code path. Based on the earlier scsi-mq prototype by Nicholas Bellinger. Thanks to Bart Van Assche and Robert Elliot for testing, benchmarking and various sugestions and code contributions. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scatterlist: allow chaining to preallocated chunksChristoph Hellwig1-9/+7
Blk-mq drivers usually preallocate their S/G list as part of the request, but if we want to support the very large S/G lists currently supported by the SCSI code that would tie up a lot of memory in the preallocated request pool. Add support to the scatterlist code so that it can initialize a S/G list that uses a preallocated first chunks and dynamically allocated additional chunks. That way the scsi-mq code can preallocate a first page worth of S/G entries as part of the request, and dynamically extend the S/G list when needed. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: unwind blk_end_request_all and blk_end_request_err callsChristoph Hellwig1-19/+42
Replace the calls to the various blk_end_request variants with opencode equivalents. Blk-mq is using a model that gives the driver control between the bio updates and the actual completion, and making the old code follow that same model allows us to keep the code more similar for both paths. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: only maintain target_blocked if the driver has a target queue limitChristoph Hellwig1-10/+18
This saves us an atomic operation for each I/O submission and completion for the usual case where the driver doesn't set a per-target can_queue value. Only a few iscsi hardware offload drivers set the per-target can_queue value at the moment. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: fix the {host,target,device}_blocked counter messChristoph Hellwig3-45/+52
Seems like these counters are missing any sort of synchronization for updates, as a over 10 year old comment from me noted. Fix this by using atomic counters, and while we're at it also make sure they are in the same cacheline as the _busy counters and not needlessly stored to in every I/O completion. With the new model the _busy counters can temporarily go negative, so all the readers are updated to check for > 0 values. Longer term every successful I/O completion will reset the counters to zero, so the temporarily negative values will not cause any harm. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: convert device_busy to atomic_tChristoph Hellwig3-24/+38
Avoid taking the queue_lock to check the per-device queue limit. Instead we do an atomic_inc_return early on to grab our slot in the queue, and if necessary decrement it after finishing all checks. Unlike the host and target busy counters this doesn't allow us to avoid the queue_lock in the request_fn due to the way the interface works, but it'll allow us to prepare for using the blk-mq code, which doesn't use the queue_lock at all, and it at least avoids a queue_lock round trip in scsi_device_unbusy, which is still important given how busy the queue_lock is. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: convert host_busy to atomic_tChristoph Hellwig8-41/+66
Avoid taking the host-wide host_lock to check the per-host queue limit. Instead we do an atomic_inc_return early on to grab our slot in the queue, and if necessary decrement it after finishing all checks. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: convert target_busy to an atomic_tChristoph Hellwig1-21/+32
Avoid taking the host-wide host_lock to check the per-target queue limit. Instead we do an atomic_inc_return early on to grab our slot in the queue, and if necessary decrement it after finishing all checks. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: push host_lock down into scsi_{host,target}_queue_readyChristoph Hellwig1-36/+39
Prepare for not taking a host-wide lock in the dispatch path by pushing the lock down into the places that actually need it. Note that this patch is just a preparation step, as it will actually increase lock roundtrips and thus decrease performance on its own. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: set ->scsi_done before calling scsi_dispatch_cmdChristoph Hellwig2-22/+21
The blk-mq code path will set this to a different function, so make the code simpler by setting it up in a legacy-request specific place. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: centralize command re-queueing in scsi_dispatch_fnChristoph Hellwig2-26/+18
Make sure we only have the logic for requeing commands in one place. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: split __scsi_queue_insertChristoph Hellwig1-18/+26
Factor out a helper to set the _blocked values, which we'll reuse for the blk-mq code path. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Webb Scales <[email protected]> Acked-by: Jens Axboe <[email protected]> Tested-by: Bart Van Assche <[email protected]> Tested-by: Robert Elliott <[email protected]>
2014-07-25scsi: add scsi_setup_cmnd helperChristoph Hellwig1-18/+22
Factor out command setup code that will be shared with the blk-mq code path. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Webb Scales <[email protected]>
2014-07-20libcxgbi:cxgb4i Guard ipv6 code with a config checkAnish Bhatt2-3/+19
Fixes: fc8d0590d914 ("libcxgbi: Add ipv6 api to driver") Fixes: 759a0cc5a3e1 ("cxgb4i: Add ipv6 code to driver, call into libcxgbi ipv6 api") Signed-off-by: Anish Bhatt <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-07-17cxgb4i: Add ipv6 code to driver, call into libcxgbi ipv6 apiAnish Bhatt1-39/+314
Signed-off-by: Anish Bhatt <[email protected]> Signed-off-by: Karen Xie <[email protected]> Signed-off-by: Manoj Malviya <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-07-17libcxgbi: Add ipv6 api to driverAnish Bhatt2-21/+237
Signed-off-by: Anish Bhatt <[email protected]> Signed-off-by: Karen Xie <[email protected]> Signed-off-by: Manoj Malviya <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-07-17scsi: mark scsi_setup_blk_pc_cmnd staticChristoph Hellwig1-2/+1
Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17sd: split sd_init_commandChristoph Hellwig1-29/+29
Factor out a function to initialize regular read/write commands and leave sd_init_command as a simple dispatcher to the different prepare routines. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17sd: retry discard commandsChristoph Hellwig1-1/+1
Currently cmd->allowed is initialized from rq->retries for discard commands, but retries is always 0 for non-BLOCK_PC requests. Set it to the standard number of retries instead. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17sd: retry write same commandsChristoph Hellwig1-1/+1
Currently cmd->allowed is initialized from rq->retries for write same commands, but retries is always 0 for non-BLOCK_PC requests. Set it to the standard number of retries instead. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17sd: don't use scsi_setup_blk_pc_cmnd for discard requestsChristoph Hellwig1-19/+31
Simplify handling of discard requests by setting up the command directly instead of initializing request fields and then calling scsi_setup_blk_pc_cmnd to propagate the information into the command. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17sd: don't use scsi_setup_blk_pc_cmnd for write same requestsChristoph Hellwig1-16/+28
Simplify handling of write same requests by setting up the command directly instead of initializing request fields and then calling scsi_setup_blk_pc_cmnd to propagate the information into the command. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Webb Scales <[email protected]>
2014-07-17sd: don't use scsi_setup_blk_pc_cmnd for flush requestsChristoph Hellwig1-7/+13
Simplify handling of flush requests by setting up the command directly instead of initializing request fields and then calling scsi_setup_blk_pc_cmnd to propagate the information into the command. Also rename scsi_setup_flush_cmnd to sd_setup_flush_cmnd for consistency. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17scsi: set sc_data_direction in common codeChristoph Hellwig3-11/+7
The data direction fiel in the SCSI command is derived only from the block request structure. Move setting it up into common code instead of duplicating it in the ULDs. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17scsi: restructure command initialization for TYPE_FS requestsChristoph Hellwig3-13/+14
We should call the device handler prep_fn for all TYPE_FS requests, not just simple read/write calls that are handled by the disk driver. Restructure the common I/O code to call the prep_fn handler and zero out the CDB, and just leave the call to scsi_init_io to the ULDs. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17scsi: move the nr_phys_segments assert into scsi_init_ioChristoph Hellwig1-11/+5
scsi_init_io should only be called for requests that transfer data, so move the assert that a request has segments from the callers into scsi_init_io. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17scsi_lib: remove the description string in scsi_io_completion()Maurizio Lombardi1-36/+4
During IO with fabric faults, one generally sees several "Unhandled error code" messages in the syslog as shown below: sd 4:0:6:2: [sdbw] Unhandled error code sd 4:0:6:2: [sdbw] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK sd 4:0:6:2: [sdbw] CDB: Read(10): 28 00 00 00 00 00 00 00 08 00 end_request: I/O error, dev sdbw, sector 0 This comes from scsi_io_completion (in scsi_lib.c) while handling error codes other than DID_RESET or not deferred sense keys i.e. this is actually handled by the SCSI mid layer. But what gets displayed here is "Unhandled error code" which is quite misleading as it indicates something that is not addressed by the mid layer. The description string is based on the sense key and sometimes on the additional sense code; since the ACTION_FAIL case always prints the sense key and the additional sense code, this patch removes the description string completely because it does not add useful information. Signed-off-by: Maurizio Lombardi <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-17scsi: cleanup switch in scsi_adjust_queue_depthDouglas Gilbert1-4/+6
While checking what scsi_adjust_queue_depth() did I thought its switch statement could be clearer: - remove redundant assignment (to sdev->queue_depth) - re-order cases (thus removing the fall-through) Signed-off-by: Douglas Gilbert <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Robert Elliott <[email protected]> Tested-by: Robert Elliott <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-07-17scsi: remove various exports that were only used by scsi_tgtChristoph Hellwig2-11/+5
Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17tgt: removalBart Van Assche9-1183/+0
Now that the ibmvstgt driver as the only user of scsi_tgt is gone, the scsi_tgt kernel module, the CONFIG_SCSI_TGT, CONFIG_SCSI_SRP_TGT_ATTRS and CONFIG_SCSI_FC_TGT_ATTRS kbuild variable, the scsi_host_template transfer_response method are no longer needed. [hch: minor updates to the current tree, changelog update] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
2014-07-17libsrp: removalChristoph Hellwig3-458/+0
Remove the libsrp module which was only used by the now removed ibmvstgt driver. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>