aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-09 00:19:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-09 00:19:19 -0500
commitf3f62a38ceda4e4d34a1dc3ebbc0f8d426c9e8d9 (patch)
tree4f912f41c84017559376435c313987bdf8630b2c /block
parent140dfc9299c33bbfc9350fa061f5ab65cb83df13 (diff)
parent096cbc35eaecf5865a3274f21eae26955b32861b (diff)
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "This patch is the usual mix of driver updates (srp, ipr, scsi_debug, NCR5380, fnic, 53c974, ses, wd719x, hpsa, megaraid_sas). Of those, wd7a9x is new and 53c974 is a rewrite of the old tmscsim driver and the extensive work by Finn Thain rewrites all the NCR5380 based drivers. There's also extensive infrastructure updates: a new logging infrastructure for sense information and a rewrite of the tagged command queue API and an assortment of minor updates" * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (183 commits) scsi: set fmt to NULL scsi_extd_sense_format() by default libsas: remove task_collector mode wd719x: remove dma_cache_sync call scsi_debug: add Report supported opcodes+tmfs; Compare and write scsi_debug: change SCSI command parser to table driven scsi_debug: add Capacity Changed Unit Attention scsi_debug: append inject error flags onto scsi_cmnd object scsi_debug: pinpoint invalid field in sense data wd719x: Add firmware documentation wd719x: Introduce Western Digital WD7193/7197/7296 PCI SCSI card driver eeprom-93cx6: Add (read-only) support for 8-bit mode esas2r: fix an oversight in setting return value esas2r: fix an error path in esas2r_ioctl_handler esas2r: fir error handling in do_fm_api scsi: add SPC-3 command definitions scsi: rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 scsi: remove scsi_driver owner field scsi: move scsi_dispatch_cmd to scsi_lib.c scsi: stop passing a gfp_mask argument down the command setup path scsi: remove scsi_next_command ...
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c4
-rw-r--r--block/blk-mq-tag.c28
-rw-r--r--block/blk-mq.c2
-rw-r--r--block/scsi_ioctl.c2
4 files changed, 33 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 0421b53e6431..2e7424b42947 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1266,7 +1266,7 @@ void blk_requeue_request(struct request_queue *q, struct request *rq)
1266 blk_clear_rq_complete(rq); 1266 blk_clear_rq_complete(rq);
1267 trace_block_rq_requeue(q, rq); 1267 trace_block_rq_requeue(q, rq);
1268 1268
1269 if (blk_rq_tagged(rq)) 1269 if (rq->cmd_flags & REQ_QUEUED)
1270 blk_queue_end_tag(q, rq); 1270 blk_queue_end_tag(q, rq);
1271 1271
1272 BUG_ON(blk_queued_rq(rq)); 1272 BUG_ON(blk_queued_rq(rq));
@@ -2554,7 +2554,7 @@ EXPORT_SYMBOL_GPL(blk_unprep_request);
2554 */ 2554 */
2555void blk_finish_request(struct request *req, int error) 2555void blk_finish_request(struct request *req, int error)
2556{ 2556{
2557 if (blk_rq_tagged(req)) 2557 if (req->cmd_flags & REQ_QUEUED)
2558 blk_queue_end_tag(req->q, req); 2558 blk_queue_end_tag(req->q, req);
2559 2559
2560 BUG_ON(blk_queued_rq(req)); 2560 BUG_ON(blk_queued_rq(req));
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 8317175a3009..728b9a4d5f56 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -584,6 +584,34 @@ int blk_mq_tag_update_depth(struct blk_mq_tags *tags, unsigned int tdepth)
584 return 0; 584 return 0;
585} 585}
586 586
587/**
588 * blk_mq_unique_tag() - return a tag that is unique queue-wide
589 * @rq: request for which to compute a unique tag
590 *
591 * The tag field in struct request is unique per hardware queue but not over
592 * all hardware queues. Hence this function that returns a tag with the
593 * hardware context index in the upper bits and the per hardware queue tag in
594 * the lower bits.
595 *
596 * Note: When called for a request that is queued on a non-multiqueue request
597 * queue, the hardware context index is set to zero.
598 */
599u32 blk_mq_unique_tag(struct request *rq)
600{
601 struct request_queue *q = rq->q;
602 struct blk_mq_hw_ctx *hctx;
603 int hwq = 0;
604
605 if (q->mq_ops) {
606 hctx = q->mq_ops->map_queue(q, rq->mq_ctx->cpu);
607 hwq = hctx->queue_num;
608 }
609
610 return (hwq << BLK_MQ_UNIQUE_TAG_BITS) |
611 (rq->tag & BLK_MQ_UNIQUE_TAG_MASK);
612}
613EXPORT_SYMBOL(blk_mq_unique_tag);
614
587ssize_t blk_mq_tag_sysfs_show(struct blk_mq_tags *tags, char *page) 615ssize_t blk_mq_tag_sysfs_show(struct blk_mq_tags *tags, char *page)
588{ 616{
589 char *orig_page = page; 617 char *orig_page = page;
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 1d016fc9a8b6..92ceef0d2ab9 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2049,6 +2049,8 @@ static int blk_mq_alloc_rq_maps(struct blk_mq_tag_set *set)
2049 */ 2049 */
2050int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) 2050int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
2051{ 2051{
2052 BUILD_BUG_ON(BLK_MQ_MAX_DEPTH > 1 << BLK_MQ_UNIQUE_TAG_BITS);
2053
2052 if (!set->nr_hw_queues) 2054 if (!set->nr_hw_queues)
2053 return -EINVAL; 2055 return -EINVAL;
2054 if (!set->queue_depth) 2056 if (!set->queue_depth)
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index b0c2a616c8f9..28163fad3c5d 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -142,7 +142,7 @@ static void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter)
142 __set_bit(GPCMD_VERIFY_10, filter->read_ok); 142 __set_bit(GPCMD_VERIFY_10, filter->read_ok);
143 __set_bit(VERIFY_16, filter->read_ok); 143 __set_bit(VERIFY_16, filter->read_ok);
144 __set_bit(REPORT_LUNS, filter->read_ok); 144 __set_bit(REPORT_LUNS, filter->read_ok);
145 __set_bit(SERVICE_ACTION_IN, filter->read_ok); 145 __set_bit(SERVICE_ACTION_IN_16, filter->read_ok);
146 __set_bit(RECEIVE_DIAGNOSTIC, filter->read_ok); 146 __set_bit(RECEIVE_DIAGNOSTIC, filter->read_ok);
147 __set_bit(MAINTENANCE_IN, filter->read_ok); 147 __set_bit(MAINTENANCE_IN, filter->read_ok);
148 __set_bit(GPCMD_READ_BUFFER_CAPACITY, filter->read_ok); 148 __set_bit(GPCMD_READ_BUFFER_CAPACITY, filter->read_ok);