- Dec 03, 2014
-
-
Dan Carpenter authored
One of the two callers passes an unintialized pointer as "fmt" and expects it to be set to NULL if there is no format string. Let's make this function work as expected. Fixes: d811b848 ('scsi: use sdev as argument for sense code printing') Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by:
James Bottomley <JBottomley@Parallels.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
- Nov 25, 2014
-
-
Hannes Reinecke authored
SPC-3 defines SERVICE ACTION IN(12), SERVICE_ACTION OUT(12), SERVICE ACTION OUT(16), and SERVICE ACTION BIDIRECTIONAL. And READ MEDIA SERIAL NUMBER has long since been deprecated. So update callers to refer to the new cdb name. Signed-off-by:
Hannes Reinecke <hare@suse.de> Tested-by:
Robert Elliott <elliott@hp.com> Reviewed-by:
Robert Elliott <elliott@hp.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Hannes Reinecke authored
SPC-3 defines SERVICE ACTION IN(12) and SERVICE ACTION IN(16). So rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 to be consistent with SPC and to allow for better distinction. Signed-off-by:
Hannes Reinecke <hare@suse.de> Tested-by:
Robert Elliott <elliott@hp.com> Reviewed-by:
Robert Elliott <elliott@hp.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
The driver core driver structure has grown an owner field and now requires it to be set for all modular drivers. Set it up for all scsi_driver instances and get rid of the now superflous scsi_driver owner field. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reported-by:
Shane M Seymour <shane.seymour@hp.com> Reviewed-by:
Ewan D. Milne <emilne@redhat.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
scsi_lib.c is where the rest of the I/O submission path lives, so move scsi_dispatch_cmd there and mark it static. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
There is no reason for ULDs to pass in a flag on how to allocate the S/G lists. While we don't need GFP_ATOMIC for the blk-mq case because we don't hold locks, that decision can be made way down the chain without having to pass a pointless gfp_mask argument. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
There's only one caller left, so inline it and reduce the blk-mq vs !blk-mq diff a litte bit. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
scsi_reset_provider already manually runs all queues for the given host, so it doesn't need the scsi_run_queues call from it, and it doesn't need a reference on the device because it's synchronous. So let's just call scsi_put_command directly and avoid the device reference dance to simplify the code. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
- Nov 12, 2014
-
-
Christoph Hellwig authored
ufs never looks at the tag type, so there is no need to set it either. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Now that we also get proper values in cmd->request->tag for untagged commands, there is no need to force tagged_supported to on in drivers that need host-wide tags. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Remove the tagged argument from scsi_adjust_queue_depth, and just let it handle the queue depth. For most drivers those two are fairly separate, given that most modern drivers don't care about the SCSI "tagged" status of a command at all, and many old drivers allow queuing of multiple untagged commands in the driver. Instead we start out with the ->simple_tags flag set before calling ->slave_configure, which is how all drivers actually looking at ->simple_tags except for one worke anyway. The one other case looks broken, but I've kept the behavior as-is for now. Except for that we only change ->simple_tags from the ->change_queue_type, and when rejecting a tag message in a single driver, so keeping this churn out of scsi_adjust_queue_depth is a clear win. Now that the usage of scsi_adjust_queue_depth is more obvious we can also remove all the trivial instances in ->slave_alloc or ->slave_configure that just set it to the cmd_per_lun default. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Christoph Hellwig authored
Allow a driver to ask for block layer tags by setting .use_blk_tags in the host template, in which case it will always see a valid value in request->tag, similar to the behavior when using blk-mq. This means even SCSI "untagged" commands will now have a tag, which is especially useful when using a host-wide tag map. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Christoph Hellwig authored
This function shouldn't change the queue type, just the depth. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Unless we want to build a SPI tag message we should just check SCMD_TAGGED instead of reverse engineering a tag type through the use of scsi_populate_tag_msg. Also rename the function to spi_populate_tag_msg, make it behave like the other spi message helpers, and move it to the spi transport class. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Remove the ordered_tags field, we haven't been issuing ordered tags based on it since the big barrier rework in 2010. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Christoph Hellwig authored
Currently scsi piggy backs on the block layer to define the concept of a tagged command. But we want to be able to have block-level host-wide tags assigned even for untagged commands like the initial INQUIRY, so add a new SCSI-level flag for commands that are tagged at the scsi level, so that even commands without that set can have tags assigned to them. Note that this alredy is the case for the blk-mq code path, and this just lets the old path catch up with it. We also set this flag based upon sdev->simple_tags instead of the block queue flag, so that it is entirely independent of the block layer tagging, and thus always correct even if a driver doesn't use block level tagging yet. Also remove the old blk_rq_tagged; it was only used by SCSI drivers, and removing it forces them to look for the proper replacement. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Most drivers use exactly the same implementation, so provide it as a library function. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Move all code to set up and tear down sdev->scsi_dh_data to common code. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
All drivers now do their own matching, so there is no more need to expose a device list as part of the interface. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
We need to grab a reference to the module before calling the attach routines to avoid a small race vs module removal. It also cleans up the code significantly as a side effect. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mike Christie <michaelc@cs.wisc.edu> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Martin K. Petersen authored
The T10 SBC UNMAP command does not provide any hard guarantees that blocks will return zeroes on a subsequent READ. This is due to the fact that the device server is free to silently ignore all or parts of the request. The only way to ensure that a block consistently returns zeroes after being unmapped is to use WRITE SAME with the UNMAP bit set. Should the device be unable to unmap one or more blocks described by the command it is required to manually write zeroes to them. Until now we have preferred UNMAP over the WRITE SAME variants to accommodate thinly provisioned devices that predated the final SBC-3 spec. This patch changes the heuristic so that we favor WRITE SAME(16) or (10) over UNMAP if these commands are marked as supported in the Logical Block Provisioning VPD page. The patch also disables discard_zeroes_data for devices operating in UNMAP mode. Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
No need to verify the passthrough ioctls, the real handler will take care of that. Also make sure not to block for resets on O_NONBLOCK fds. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
The calling conventions for this function are bad as it could return -ENODEV both for a device not currently online and a not recognized ioctl. Add a new scsi_ioctl_block_when_processing_errors function that wraps scsi_block_when_processing_errors with the a special case for the SG_SCSI_RESET ioctl command, and handle the SG_SCSI_RESET case itself in scsi_ioctl. All callers of scsi_ioctl now must call the above helper to check for the EH state, so that the ioctl handler itself doesn't have to. Reported-by:
Robert Elliott <Elliott@hp.com> Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Christoph Hellwig authored
Pull the common code from the two callers into the function, and rename it to scsi_ioctl_reset. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Hannes Reinecke <hare@suse.de>
-
Bart Van Assche authored
Modify scsi_find_tag() and scsi_host_find_tag() such that these functions can translate a tag generated by blk_mq_unique_tag(). Signed-off-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Bart Van Assche authored
Allow a SCSI LLD to declare how many hardware queues it supports by setting Scsi_Host.nr_hw_queues before calling scsi_add_host(). Signed-off-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Sagi Grimberg <sagig@mellanox.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Bart Van Assche authored
The queuecommand() callback functions in SCSI low-level drivers need to know which hardware context has been selected by the block layer. Since this information is not available in the request structure, and since passing the hctx pointer directly to the queuecommand callback function would require modification of all SCSI LLDs, add a function to the block layer that allows to query the hardware context index. Signed-off-by:
Bart Van Assche <bvanassche@acm.org> Acked-by:
Jens Axboe <axboe@kernel.dk> Reviewed-by:
Sagi Grimberg <sagig@mellanox.com> Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Hannes Reinecke authored
There can be quite a lot of I/O error messages, even on smaller machines. So we need to ratelimit them to not overwhelm logging. Signed-off-by:
Hannes Reinecke <hare@suse.de> Tested-by:
Robert Elliott <elliott@hp.com> Reviewed-by:
Robert Elliott <elliott@hp.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Hannes Reinecke authored
The .eh_abort_handler needs to return SUCCESS, FAILED, or FAST_IO_FAIL. So fixup all callers to adhere to this requirement. Reviewed-by:
Robert Elliott <elliott@hp.com> Cc: <stable@vger.kernel.org> Signed-off-by:
Hannes Reinecke <hare@suse.de> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Hannes Reinecke authored
scsi_try_to_abort_cmd() should only return SUCCESS, FAILED, or FAST_IO_FAIL. So document that in the function description and simplify the logging message. Signed-off-by:
Hannes Reinecke <hare@suse.de> Suggested-by:
Christoph Hellwig <hch@infradead.org> Reviewed-by:
Robert Elliott <elliott@hp.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Hannes Reinecke authored
The EH statistics are per host, so we should be using shost_printk() here. Signed-off-by:
Hannes Reinecke <hare@suse.de> Suggested-by:
Robert Elliott <elliott@hp.com> Reviewed-by:
Robert Elliott <elliott@hp.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Hannes Reinecke authored
Use the matching scope for logging messages to allow for better command tracing. Signed-off-by:
Hannes Reinecke <hare@suse.de> Suggested-by:
Robert Elliott <elliott@hp.com> Reviewed-by:
Robert Elliott <elliott@hp.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-