Skip to contentSkip to conversation

SCSI fixes for 3.18-rc2

GIT PULL James Bottomley 1 participant 2 messages Nov 2, 2014

Subsystems (3)
lore
Share & tools
lore

James Bottomley

author maintainer
#0 lore raw

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) and a fix for a memory leak in scatterlist traversal caused by a preallocation update in 3.17) and an ipv6 fix for cxgbi.

The patch is available here:

git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-for-linus

The short changelog is:

Anish Bhatt (1):
libcxgbi : support ipv6 address host_param

Christoph Hellwig (2):
scsi: set REQ_QUEUE for the blk-mq case Revert "block: all blk-mq requests are tagged"

Don Brace (1):
MAINTAINERS: change hpsa and cciss maintainer

Santosh Y (1):
MAINTAINERS: ufs - remove self

Tony Battersby (1):
lib/scatterlist: fix memory leak with scsi-mq

The diffstat is:

 MAINTAINERS                   |  9 ++++++---
 drivers/scsi/cxgbi/libcxgbi.c | 42 +++++++++++++++++++++++++++++++++++++-----
 drivers/scsi/cxgbi/libcxgbi.h |  5 -----
 drivers/scsi/scsi_lib.c       |  5 +++++
 include/linux/blkdev.h        |  3 +--
 include/scsi/scsi_tcq.h       |  8 ++++----
 lib/scatterlist.c             |  6 +++---
 7 files changed, 56 insertions(+), 22 deletions(-)

With full diff below.

James

---

MAINTAINERS +3 -6
index 82d4ad2..dab92a7 100644
@@ -4312,10 +4312,8 @@ F:	Documentation/blockdev/cpqarray.txt
 F:	drivers/block/cpqarray.*
 
 HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
-M:	Don Brace <[email protected]>
+M:	"Stephen M. Cameron" <[email protected]>
 L:	[email protected]
-L:	[email protected]
-L:	[email protected]
 S:	Supported
 F:	Documentation/scsi/hpsa.txt
 F:	drivers/scsi/hpsa*.[ch]
@@ -4323,10 +4321,8 @@ F:	include/linux/cciss*.h
 F:	include/uapi/linux/cciss*.h
 
 HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
-M:	Don Brace <[email protected]>
+M:	Mike Miller <[email protected]>
 L:	[email protected]
-L:	[email protected]
-L:	[email protected]
 S:	Supported
 F:	Documentation/blockdev/cciss.txt
 F:	drivers/block/cciss*
@@ -9610,6 +9606,7 @@ F:     drivers/staging/unisys/
 
 UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER
 M:	Vinayak Holikatti <[email protected]>
+M:	Santosh Y <[email protected]>
 L:	[email protected]
 S:	Supported
 F:	Documentation/scsi/ufs.txt
drivers/scsi/cxgbi/libcxgbi.c +5 -37

61 lines not on this page · raw message

drivers/scsi/cxgbi/libcxgbi.h +5 -0
index 2c7cb1c..1d98fad 100644
@@ -700,6 +700,11 @@ static inline void cxgbi_set_iscsi_ipv4(struct cxgbi_hba *chba, __be32 ipaddr)
 			chba->ndev->name);
 }
 
+static inline __be32 cxgbi_get_iscsi_ipv4(struct cxgbi_hba *chba)
+{
+	return chba->ipv4addr;
+}
+
 struct cxgbi_device *cxgbi_device_register(unsigned int, unsigned int);
 void cxgbi_device_unregister(struct cxgbi_device *);
 void cxgbi_device_unregister_all(unsigned int flag);
drivers/scsi/scsi_lib.c +0 -5
index 50a6e1a..9eff8a3 100644
@@ -1893,11 +1893,6 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req,
 		blk_mq_start_request(req);
 	}
 
-	if (blk_queue_tagged(q))
-		req->cmd_flags |= REQ_QUEUED;
-	else
-		req->cmd_flags &= ~REQ_QUEUED;
-
 	scsi_init_cmd_errh(cmd);
 	cmd->scsi_done = scsi_mq_done;
 
include/linux/blkdev.h +2 -1
index 51d0dc2..0207a78 100644
@@ -1136,7 +1136,8 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk)
 /*
  * tag stuff
  */
-#define blk_rq_tagged(rq)		((rq)->cmd_flags & REQ_QUEUED)
+#define blk_rq_tagged(rq) \
+	((rq)->mq_ctx || ((rq)->cmd_flags & REQ_QUEUED))
 extern int blk_queue_start_tag(struct request_queue *, struct request *);
 extern struct request *blk_queue_find_tag(struct request_queue *, int);
 extern void blk_queue_end_tag(struct request_queue *, struct request *);
include/scsi/scsi_tcq.h +4 -4
index 56ed843..e645835 100644
@@ -67,9 +67,8 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
 	if (!sdev->tagged_supported)
 		return;
 
-	if (shost_use_blk_mq(sdev->host))
-		queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, sdev->request_queue);
-	else if (!blk_queue_tagged(sdev->request_queue))
+	if (!shost_use_blk_mq(sdev->host) &&
+	    !blk_queue_tagged(sdev->request_queue))
 		blk_queue_init_tags(sdev->request_queue, depth,
 				    sdev->host->bqt);
 
@@ -82,7 +81,8 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
  **/
 static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)
 {
-	if (blk_queue_tagged(sdev->request_queue))
+	if (!shost_use_blk_mq(sdev->host) &&
+	    blk_queue_tagged(sdev->request_queue))
 		blk_queue_free_tags(sdev->request_queue);
 	scsi_adjust_queue_depth(sdev, 0, depth);
 }
lib/scatterlist.c +3 -3
index c9f2e8c..9cdf62f 100644
@@ -203,10 +203,10 @@ void __sg_free_table(struct sg_table *table, unsigned int max_ents,
 		}
 
 		table->orig_nents -= sg_size;
-		if (skip_first_chunk)
-			skip_first_chunk = false;
-		else
+		if (!skip_first_chunk) {
 			free_fn(sgl, alloc_size);
+			skip_first_chunk = false;
+		}
 		sgl = next;
 	}
 
author maintainer
#1 lore raw
Quoted 1 line · James Bottomley

With full diff below.

For those of you paying attention, I managed to generate a reverse diff. The actual forward diff is below.

James

---

MAINTAINERS +6 -3
index dab92a7..82d4ad2 100644
@@ -4312,8 +4312,10 @@ F:	Documentation/blockdev/cpqarray.txt
 F:	drivers/block/cpqarray.*
 
 HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
-M:	"Stephen M. Cameron" <[email protected]>
+M:	Don Brace <[email protected]>
 L:	[email protected]
+L:	[email protected]
+L:	[email protected]
 S:	Supported
 F:	Documentation/scsi/hpsa.txt
 F:	drivers/scsi/hpsa*.[ch]
@@ -4321,8 +4323,10 @@ F:	include/linux/cciss*.h
 F:	include/uapi/linux/cciss*.h
 
 HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
-M:	Mike Miller <[email protected]>
+M:	Don Brace <[email protected]>
 L:	[email protected]
+L:	[email protected]
+L:	[email protected]
 S:	Supported
 F:	Documentation/blockdev/cciss.txt
 F:	drivers/block/cciss*
@@ -9606,7 +9610,6 @@ F:     drivers/staging/unisys/
 
 UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER
 M:	Vinayak Holikatti <[email protected]>
-M:	Santosh Y <[email protected]>
 L:	[email protected]
 S:	Supported
 F:	Documentation/scsi/ufs.txt
drivers/scsi/cxgbi/libcxgbi.c +37 -5

61 lines not on this page · raw message

drivers/scsi/cxgbi/libcxgbi.h +0 -5
index 1d98fad..2c7cb1c 100644
@@ -700,11 +700,6 @@ static inline void cxgbi_set_iscsi_ipv4(struct cxgbi_hba *chba, __be32 ipaddr)
 			chba->ndev->name);
 }
 
-static inline __be32 cxgbi_get_iscsi_ipv4(struct cxgbi_hba *chba)
-{
-	return chba->ipv4addr;
-}
-
 struct cxgbi_device *cxgbi_device_register(unsigned int, unsigned int);
 void cxgbi_device_unregister(struct cxgbi_device *);
 void cxgbi_device_unregister_all(unsigned int flag);
drivers/scsi/scsi_lib.c +5 -0
index 9eff8a3..50a6e1a 100644
@@ -1893,6 +1893,11 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req,
 		blk_mq_start_request(req);
 	}
 
+	if (blk_queue_tagged(q))
+		req->cmd_flags |= REQ_QUEUED;
+	else
+		req->cmd_flags &= ~REQ_QUEUED;
+
 	scsi_init_cmd_errh(cmd);
 	cmd->scsi_done = scsi_mq_done;
 
include/linux/blkdev.h +1 -2
index 0207a78..51d0dc2 100644
@@ -1136,8 +1136,7 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk)
 /*
  * tag stuff
  */
-#define blk_rq_tagged(rq) \
-	((rq)->mq_ctx || ((rq)->cmd_flags & REQ_QUEUED))
+#define blk_rq_tagged(rq)		((rq)->cmd_flags & REQ_QUEUED)
 extern int blk_queue_start_tag(struct request_queue *, struct request *);
 extern struct request *blk_queue_find_tag(struct request_queue *, int);
 extern void blk_queue_end_tag(struct request_queue *, struct request *);
include/scsi/scsi_tcq.h +4 -4
index e645835..56ed843 100644
@@ -67,8 +67,9 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
 	if (!sdev->tagged_supported)
 		return;
 
-	if (!shost_use_blk_mq(sdev->host) &&
-	    !blk_queue_tagged(sdev->request_queue))
+	if (shost_use_blk_mq(sdev->host))
+		queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, sdev->request_queue);
+	else if (!blk_queue_tagged(sdev->request_queue))
 		blk_queue_init_tags(sdev->request_queue, depth,
 				    sdev->host->bqt);
 
@@ -81,8 +82,7 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
  **/
 static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)
 {
-	if (!shost_use_blk_mq(sdev->host) &&
-	    blk_queue_tagged(sdev->request_queue))
+	if (blk_queue_tagged(sdev->request_queue))
 		blk_queue_free_tags(sdev->request_queue);
 	scsi_adjust_queue_depth(sdev, 0, depth);
 }
lib/scatterlist.c +3 -3
index 9cdf62f..c9f2e8c 100644
@@ -203,10 +203,10 @@ void __sg_free_table(struct sg_table *table, unsigned int max_ents,
 		}
 
 		table->orig_nents -= sg_size;
-		if (!skip_first_chunk) {
-			free_fn(sgl, alloc_size);
+		if (skip_first_chunk)
 			skip_first_chunk = false;
-		}
+		else
+			free_fn(sgl, alloc_size);
 		sgl = next;
 	}