diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-02 17:39:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-02 17:39:35 -0500 |
commit | ad2be3796ff4c834e5c102d5455e76ee07dcf71d (patch) | |
tree | f3cfa4950b401cb011069fb7bd1b16eb741ce687 | |
parent | 12267166c582f43a41829ffa77be2e7e72d5d4dd (diff) | |
parent | ff150a76ae782a2d8730945c869869f77f2fcd39 (diff) |
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley:
"This is a set of six patches consisting of:
- two MAINTAINER updates
- two scsi-mq fixs for the old parallel interface (not every request
is tagged and we need to set the right flags to populate the SPI
tag message)
- a fix for a memory leak in scatterlist traversal caused by a
preallocation update in 3.17
- an ipv6 fix for cxgbi"
[ The scatterlist fix also came in separately through the block layer tree ]
* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
MAINTAINERS: ufs - remove self
MAINTAINERS: change hpsa and cciss maintainer
libcxgbi : support ipv6 address host_param
scsi: set REQ_QUEUE for the blk-mq case
Revert "block: all blk-mq requests are tagged"
lib/scatterlist: fix memory leak with scsi-mq
-rw-r--r-- | MAINTAINERS | 9 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 42 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.h | 5 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 5 | ||||
-rw-r--r-- | include/linux/blkdev.h | 3 | ||||
-rw-r--r-- | include/scsi/scsi_tcq.h | 8 |
6 files changed, 53 insertions, 19 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 1cfabdd1d23f..3c6427190be2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -4312,8 +4312,10 @@ F: Documentation/blockdev/cpqarray.txt | |||
4312 | F: drivers/block/cpqarray.* | 4312 | F: drivers/block/cpqarray.* |
4313 | 4313 | ||
4314 | HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa) | 4314 | HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa) |
4315 | M: "Stephen M. Cameron" <scameron@beardog.cce.hp.com> | 4315 | M: Don Brace <don.brace@pmcs.com> |
4316 | L: iss_storagedev@hp.com | 4316 | L: iss_storagedev@hp.com |
4317 | L: storagedev@pmcs.com | ||
4318 | L: linux-scsi@vger.kernel.org | ||
4317 | S: Supported | 4319 | S: Supported |
4318 | F: Documentation/scsi/hpsa.txt | 4320 | F: Documentation/scsi/hpsa.txt |
4319 | F: drivers/scsi/hpsa*.[ch] | 4321 | F: drivers/scsi/hpsa*.[ch] |
@@ -4321,8 +4323,10 @@ F: include/linux/cciss*.h | |||
4321 | F: include/uapi/linux/cciss*.h | 4323 | F: include/uapi/linux/cciss*.h |
4322 | 4324 | ||
4323 | HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss) | 4325 | HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss) |
4324 | M: Mike Miller <mike.miller@hp.com> | 4326 | M: Don Brace <don.brace@pmcs.com> |
4325 | L: iss_storagedev@hp.com | 4327 | L: iss_storagedev@hp.com |
4328 | L: storagedev@pmcs.com | ||
4329 | L: linux-scsi@vger.kernel.org | ||
4326 | S: Supported | 4330 | S: Supported |
4327 | F: Documentation/blockdev/cciss.txt | 4331 | F: Documentation/blockdev/cciss.txt |
4328 | F: drivers/block/cciss* | 4332 | F: drivers/block/cciss* |
@@ -9606,7 +9610,6 @@ F: drivers/staging/unisys/ | |||
9606 | 9610 | ||
9607 | UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER | 9611 | UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER |
9608 | M: Vinayak Holikatti <vinholikatti@gmail.com> | 9612 | M: Vinayak Holikatti <vinholikatti@gmail.com> |
9609 | M: Santosh Y <santoshsy@gmail.com> | ||
9610 | L: linux-scsi@vger.kernel.org | 9613 | L: linux-scsi@vger.kernel.org |
9611 | S: Supported | 9614 | S: Supported |
9612 | F: Documentation/scsi/ufs.txt | 9615 | F: Documentation/scsi/ufs.txt |
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 54fa6e0bc1bb..674d498b46ab 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c | |||
@@ -399,6 +399,35 @@ EXPORT_SYMBOL_GPL(cxgbi_hbas_add); | |||
399 | * If the source port is outside our allocation range, the caller is | 399 | * If the source port is outside our allocation range, the caller is |
400 | * responsible for keeping track of their port usage. | 400 | * responsible for keeping track of their port usage. |
401 | */ | 401 | */ |
402 | |||
403 | static struct cxgbi_sock *find_sock_on_port(struct cxgbi_device *cdev, | ||
404 | unsigned char port_id) | ||
405 | { | ||
406 | struct cxgbi_ports_map *pmap = &cdev->pmap; | ||
407 | unsigned int i; | ||
408 | unsigned int used; | ||
409 | |||
410 | if (!pmap->max_connect || !pmap->used) | ||
411 | return NULL; | ||
412 | |||
413 | spin_lock_bh(&pmap->lock); | ||
414 | used = pmap->used; | ||
415 | for (i = 0; used && i < pmap->max_connect; i++) { | ||
416 | struct cxgbi_sock *csk = pmap->port_csk[i]; | ||
417 | |||
418 | if (csk) { | ||
419 | if (csk->port_id == port_id) { | ||
420 | spin_unlock_bh(&pmap->lock); | ||
421 | return csk; | ||
422 | } | ||
423 | used--; | ||
424 | } | ||
425 | } | ||
426 | spin_unlock_bh(&pmap->lock); | ||
427 | |||
428 | return NULL; | ||
429 | } | ||
430 | |||
402 | static int sock_get_port(struct cxgbi_sock *csk) | 431 | static int sock_get_port(struct cxgbi_sock *csk) |
403 | { | 432 | { |
404 | struct cxgbi_device *cdev = csk->cdev; | 433 | struct cxgbi_device *cdev = csk->cdev; |
@@ -749,6 +778,7 @@ static struct cxgbi_sock *cxgbi_check_route6(struct sockaddr *dst_addr) | |||
749 | csk->daddr6.sin6_addr = daddr6->sin6_addr; | 778 | csk->daddr6.sin6_addr = daddr6->sin6_addr; |
750 | csk->daddr6.sin6_port = daddr6->sin6_port; | 779 | csk->daddr6.sin6_port = daddr6->sin6_port; |
751 | csk->daddr6.sin6_family = daddr6->sin6_family; | 780 | csk->daddr6.sin6_family = daddr6->sin6_family; |
781 | csk->saddr6.sin6_family = daddr6->sin6_family; | ||
752 | csk->saddr6.sin6_addr = pref_saddr; | 782 | csk->saddr6.sin6_addr = pref_saddr; |
753 | 783 | ||
754 | neigh_release(n); | 784 | neigh_release(n); |
@@ -2647,12 +2677,14 @@ int cxgbi_get_host_param(struct Scsi_Host *shost, enum iscsi_host_param param, | |||
2647 | break; | 2677 | break; |
2648 | case ISCSI_HOST_PARAM_IPADDRESS: | 2678 | case ISCSI_HOST_PARAM_IPADDRESS: |
2649 | { | 2679 | { |
2650 | __be32 addr; | 2680 | struct cxgbi_sock *csk = find_sock_on_port(chba->cdev, |
2651 | 2681 | chba->port_id); | |
2652 | addr = cxgbi_get_iscsi_ipv4(chba); | 2682 | if (csk) { |
2653 | len = sprintf(buf, "%pI4", &addr); | 2683 | len = sprintf(buf, "%pIS", |
2684 | (struct sockaddr *)&csk->saddr); | ||
2685 | } | ||
2654 | log_debug(1 << CXGBI_DBG_ISCSI, | 2686 | log_debug(1 << CXGBI_DBG_ISCSI, |
2655 | "hba %s, ipv4 %pI4.\n", chba->ndev->name, &addr); | 2687 | "hba %s, addr %s.\n", chba->ndev->name, buf); |
2656 | break; | 2688 | break; |
2657 | } | 2689 | } |
2658 | default: | 2690 | default: |
diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h index 1d98fad6a0ab..2c7cb1c0c453 100644 --- a/drivers/scsi/cxgbi/libcxgbi.h +++ b/drivers/scsi/cxgbi/libcxgbi.h | |||
@@ -700,11 +700,6 @@ static inline void cxgbi_set_iscsi_ipv4(struct cxgbi_hba *chba, __be32 ipaddr) | |||
700 | chba->ndev->name); | 700 | chba->ndev->name); |
701 | } | 701 | } |
702 | 702 | ||
703 | static inline __be32 cxgbi_get_iscsi_ipv4(struct cxgbi_hba *chba) | ||
704 | { | ||
705 | return chba->ipv4addr; | ||
706 | } | ||
707 | |||
708 | struct cxgbi_device *cxgbi_device_register(unsigned int, unsigned int); | 703 | struct cxgbi_device *cxgbi_device_register(unsigned int, unsigned int); |
709 | void cxgbi_device_unregister(struct cxgbi_device *); | 704 | void cxgbi_device_unregister(struct cxgbi_device *); |
710 | void cxgbi_device_unregister_all(unsigned int flag); | 705 | void cxgbi_device_unregister_all(unsigned int flag); |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9eff8a375132..50a6e1ac8d9c 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1893,6 +1893,11 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req, | |||
1893 | blk_mq_start_request(req); | 1893 | blk_mq_start_request(req); |
1894 | } | 1894 | } |
1895 | 1895 | ||
1896 | if (blk_queue_tagged(q)) | ||
1897 | req->cmd_flags |= REQ_QUEUED; | ||
1898 | else | ||
1899 | req->cmd_flags &= ~REQ_QUEUED; | ||
1900 | |||
1896 | scsi_init_cmd_errh(cmd); | 1901 | scsi_init_cmd_errh(cmd); |
1897 | cmd->scsi_done = scsi_mq_done; | 1902 | cmd->scsi_done = scsi_mq_done; |
1898 | 1903 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 6cbee8395f60..aac0f9ea952a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1136,8 +1136,7 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk) | |||
1136 | /* | 1136 | /* |
1137 | * tag stuff | 1137 | * tag stuff |
1138 | */ | 1138 | */ |
1139 | #define blk_rq_tagged(rq) \ | 1139 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) |
1140 | ((rq)->mq_ctx || ((rq)->cmd_flags & REQ_QUEUED)) | ||
1141 | extern int blk_queue_start_tag(struct request_queue *, struct request *); | 1140 | extern int blk_queue_start_tag(struct request_queue *, struct request *); |
1142 | extern struct request *blk_queue_find_tag(struct request_queue *, int); | 1141 | extern struct request *blk_queue_find_tag(struct request_queue *, int); |
1143 | extern void blk_queue_end_tag(struct request_queue *, struct request *); | 1142 | extern void blk_queue_end_tag(struct request_queue *, struct request *); |
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index e64583560701..56ed843969ca 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -67,8 +67,9 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | |||
67 | if (!sdev->tagged_supported) | 67 | if (!sdev->tagged_supported) |
68 | return; | 68 | return; |
69 | 69 | ||
70 | if (!shost_use_blk_mq(sdev->host) && | 70 | if (shost_use_blk_mq(sdev->host)) |
71 | !blk_queue_tagged(sdev->request_queue)) | 71 | queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, sdev->request_queue); |
72 | else if (!blk_queue_tagged(sdev->request_queue)) | ||
72 | blk_queue_init_tags(sdev->request_queue, depth, | 73 | blk_queue_init_tags(sdev->request_queue, depth, |
73 | sdev->host->bqt); | 74 | sdev->host->bqt); |
74 | 75 | ||
@@ -81,8 +82,7 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | |||
81 | **/ | 82 | **/ |
82 | static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) | 83 | static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) |
83 | { | 84 | { |
84 | if (!shost_use_blk_mq(sdev->host) && | 85 | if (blk_queue_tagged(sdev->request_queue)) |
85 | blk_queue_tagged(sdev->request_queue)) | ||
86 | blk_queue_free_tags(sdev->request_queue); | 86 | blk_queue_free_tags(sdev->request_queue); |
87 | scsi_adjust_queue_depth(sdev, 0, depth); | 87 | scsi_adjust_queue_depth(sdev, 0, depth); |
88 | } | 88 | } |