All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] uas: Reduce number of function arguments for uas_alloc_foo functions
@ 2014-10-03 10:08 Hans de Goede
  2014-10-03 10:08 ` [PATCH v2 2/2] uas: Make uas work with blk-mq Hans de Goede
  0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2014-10-03 10:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Christoph Hellwig, Douglas Gilbert,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA, Hans de Goede

The stream_id and pipe are already present in uas_cmd_info resp uas_dev_info,
so there is no need to pass a copy along.

Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Reviewed-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 drivers/usb/storage/uas.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index f62ef61..89b2434 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -412,20 +412,22 @@ static void uas_cmd_cmplt(struct urb *urb)
 }
 
 static struct urb *uas_alloc_data_urb(struct uas_dev_info *devinfo, gfp_t gfp,
-				      unsigned int pipe, u16 stream_id,
 				      struct scsi_cmnd *cmnd,
 				      enum dma_data_direction dir)
 {
 	struct usb_device *udev = devinfo->udev;
+	struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp;
 	struct urb *urb = usb_alloc_urb(0, gfp);
 	struct scsi_data_buffer *sdb = (dir == DMA_FROM_DEVICE)
 		? scsi_in(cmnd) : scsi_out(cmnd);
+	unsigned int pipe = (dir == DMA_FROM_DEVICE)
+		? devinfo->data_in_pipe : devinfo->data_out_pipe;
 
 	if (!urb)
 		goto out;
 	usb_fill_bulk_urb(urb, udev, pipe, NULL, sdb->length,
 			  uas_data_cmplt, cmnd);
-	urb->stream_id = stream_id;
+	urb->stream_id = cmdinfo->stream;
 	urb->num_sgs = udev->bus->sg_tablesize ? sdb->table.nents : 0;
 	urb->sg = sdb->table.sgl;
  out:
@@ -433,9 +435,10 @@ static struct urb *uas_alloc_data_urb(struct uas_dev_info *devinfo, gfp_t gfp,
 }
 
 static struct urb *uas_alloc_sense_urb(struct uas_dev_info *devinfo, gfp_t gfp,
-				       struct Scsi_Host *shost, u16 stream_id)
+				       struct scsi_cmnd *cmnd)
 {
 	struct usb_device *udev = devinfo->udev;
+	struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp;
 	struct urb *urb = usb_alloc_urb(0, gfp);
 	struct sense_iu *iu;
 
@@ -447,8 +450,8 @@ static struct urb *uas_alloc_sense_urb(struct uas_dev_info *devinfo, gfp_t gfp,
 		goto free;
 
 	usb_fill_bulk_urb(urb, udev, devinfo->status_pipe, iu, sizeof(*iu),
-						uas_stat_cmplt, shost);
-	urb->stream_id = stream_id;
+			  uas_stat_cmplt, cmnd->device->host);
+	urb->stream_id = cmdinfo->stream;
 	urb->transfer_flags |= URB_FREE_BUFFER;
  out:
 	return urb;
@@ -500,15 +503,13 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp,
  * daft to me.
  */
 
-static struct urb *uas_submit_sense_urb(struct scsi_cmnd *cmnd,
-					gfp_t gfp, unsigned int stream)
+static struct urb *uas_submit_sense_urb(struct scsi_cmnd *cmnd, gfp_t gfp)
 {
-	struct Scsi_Host *shost = cmnd->device->host;
-	struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata;
+	struct uas_dev_info *devinfo = cmnd->device->hostdata;
 	struct urb *urb;
 	int err;
 
-	urb = uas_alloc_sense_urb(devinfo, gfp, shost, stream);
+	urb = uas_alloc_sense_urb(devinfo, gfp, cmnd);
 	if (!urb)
 		return NULL;
 	usb_anchor_urb(urb, &devinfo->sense_urbs);
@@ -531,7 +532,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
 
 	lockdep_assert_held(&devinfo->lock);
 	if (cmdinfo->state & SUBMIT_STATUS_URB) {
-		urb = uas_submit_sense_urb(cmnd, gfp, cmdinfo->stream);
+		urb = uas_submit_sense_urb(cmnd, gfp);
 		if (!urb)
 			return SCSI_MLQUEUE_DEVICE_BUSY;
 		cmdinfo->state &= ~SUBMIT_STATUS_URB;
@@ -539,8 +540,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
 
 	if (cmdinfo->state & ALLOC_DATA_IN_URB) {
 		cmdinfo->data_in_urb = uas_alloc_data_urb(devinfo, gfp,
-					devinfo->data_in_pipe, cmdinfo->stream,
-					cmnd, DMA_FROM_DEVICE);
+							cmnd, DMA_FROM_DEVICE);
 		if (!cmdinfo->data_in_urb)
 			return SCSI_MLQUEUE_DEVICE_BUSY;
 		cmdinfo->state &= ~ALLOC_DATA_IN_URB;
@@ -560,8 +560,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
 
 	if (cmdinfo->state & ALLOC_DATA_OUT_URB) {
 		cmdinfo->data_out_urb = uas_alloc_data_urb(devinfo, gfp,
-					devinfo->data_out_pipe, cmdinfo->stream,
-					cmnd, DMA_TO_DEVICE);
+							cmnd, DMA_TO_DEVICE);
 		if (!cmdinfo->data_out_urb)
 			return SCSI_MLQUEUE_DEVICE_BUSY;
 		cmdinfo->state &= ~ALLOC_DATA_OUT_URB;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/2] uas: Make uas work with blk-mq
  2014-10-03 10:08 [PATCH v2 1/2] uas: Reduce number of function arguments for uas_alloc_foo functions Hans de Goede
@ 2014-10-03 10:08 ` Hans de Goede
       [not found]   ` <1412330937-22630-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2014-10-03 10:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Christoph Hellwig, Douglas Gilbert, linux-usb, linux-scsi, Hans de Goede

With uas over usb-3 the tags inside the uas iu-s must match the usb-3 stream
ids, and those go from 1 - qdepth.

Before blk-mq calling scsi_activate_tcq(sdev, qdepth) guaranteed that we would
only get cmnd->request->tag from 0 - (qdepth - 1), and we used those as
uas-tags / stream-ids.

With blk-mq however we are guaranteed to never get more then qdepth commands
queued at the same time, but the cmnd->request->tag values may be much larger,
which breaks uas.

This commit fixes this by generating uas tags in the 1 - qdepth range ourselves
instead of using cmnd->request->tag.

While touching all involved code anyways also rename the uas_cmd_info stream
field to uas_tag, because when using uas over usb-2 streams are not used.

Cc: Christoph Hellwig <hch@infradead.org>
Reported-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>

--
Changes in v2:
-Remove ".disable_blk_mq = true" from uas_host_template
---
 drivers/usb/storage/uas.c | 64 +++++++++++++++++------------------------------
 1 file changed, 23 insertions(+), 41 deletions(-)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 89b2434..004ebc1 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -66,7 +66,7 @@ enum {
 /* Overrides scsi_pointer */
 struct uas_cmd_info {
 	unsigned int state;
-	unsigned int stream;
+	unsigned int uas_tag;
 	struct urb *cmd_urb;
 	struct urb *data_in_urb;
 	struct urb *data_out_urb;
@@ -173,30 +173,15 @@ static void uas_sense(struct urb *urb, struct scsi_cmnd *cmnd)
 	cmnd->result = sense_iu->status;
 }
 
-/*
- * scsi-tags go from 0 - (nr_tags - 1), uas tags need to match stream-ids,
- * which go from 1 - nr_streams. And we use 1 for untagged commands.
- */
-static int uas_get_tag(struct scsi_cmnd *cmnd)
-{
-	int tag;
-
-	if (blk_rq_tagged(cmnd->request))
-		tag = cmnd->request->tag + 2;
-	else
-		tag = 1;
-
-	return tag;
-}
-
 static void uas_log_cmd_state(struct scsi_cmnd *cmnd, const char *prefix,
 			      int status)
 {
 	struct uas_cmd_info *ci = (void *)&cmnd->SCp;
+	struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp;
 
 	scmd_printk(KERN_INFO, cmnd,
-		    "%s %d tag %d inflight:%s%s%s%s%s%s%s%s%s%s%s%s ",
-		    prefix, status, uas_get_tag(cmnd),
+		    "%s %d uas-tag %d inflight:%s%s%s%s%s%s%s%s%s%s%s%s ",
+		    prefix, status, cmdinfo->uas_tag,
 		    (ci->state & SUBMIT_STATUS_URB)     ? " s-st"  : "",
 		    (ci->state & ALLOC_DATA_IN_URB)     ? " a-in"  : "",
 		    (ci->state & SUBMIT_DATA_IN_URB)    ? " s-in"  : "",
@@ -242,7 +227,7 @@ static int uas_try_complete(struct scsi_cmnd *cmnd, const char *caller)
 			      DATA_OUT_URB_INFLIGHT |
 			      COMMAND_ABORTED))
 		return -EBUSY;
-	devinfo->cmnd[uas_get_tag(cmnd) - 1] = NULL;
+	devinfo->cmnd[cmdinfo->uas_tag - 1] = NULL;
 	uas_free_unsubmitted_urbs(cmnd);
 	cmnd->scsi_done(cmnd);
 	return 0;
@@ -289,7 +274,7 @@ static void uas_stat_cmplt(struct urb *urb)
 	idx = be16_to_cpup(&iu->tag) - 1;
 	if (idx >= MAX_CMNDS || !devinfo->cmnd[idx]) {
 		dev_err(&urb->dev->dev,
-			"stat urb: no pending cmd for tag %d\n", idx + 1);
+			"stat urb: no pending cmd for uas-tag %d\n", idx + 1);
 		goto out;
 	}
 
@@ -427,7 +412,8 @@ static struct urb *uas_alloc_data_urb(struct uas_dev_info *devinfo, gfp_t gfp,
 		goto out;
 	usb_fill_bulk_urb(urb, udev, pipe, NULL, sdb->length,
 			  uas_data_cmplt, cmnd);
-	urb->stream_id = cmdinfo->stream;
+	if (devinfo->use_streams)
+		urb->stream_id = cmdinfo->uas_tag;
 	urb->num_sgs = udev->bus->sg_tablesize ? sdb->table.nents : 0;
 	urb->sg = sdb->table.sgl;
  out:
@@ -451,7 +437,8 @@ static struct urb *uas_alloc_sense_urb(struct uas_dev_info *devinfo, gfp_t gfp,
 
 	usb_fill_bulk_urb(urb, udev, devinfo->status_pipe, iu, sizeof(*iu),
 			  uas_stat_cmplt, cmnd->device->host);
-	urb->stream_id = cmdinfo->stream;
+	if (devinfo->use_streams)
+		urb->stream_id = cmdinfo->uas_tag;
 	urb->transfer_flags |= URB_FREE_BUFFER;
  out:
 	return urb;
@@ -465,6 +452,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp,
 {
 	struct usb_device *udev = devinfo->udev;
 	struct scsi_device *sdev = cmnd->device;
+	struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp;
 	struct urb *urb = usb_alloc_urb(0, gfp);
 	struct command_iu *iu;
 	int len;
@@ -481,7 +469,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp,
 		goto free;
 
 	iu->iu_id = IU_ID_COMMAND;
-	iu->tag = cpu_to_be16(uas_get_tag(cmnd));
+	iu->tag = cpu_to_be16(cmdinfo->uas_tag);
 	iu->prio_attr = UAS_SIMPLE_TAG;
 	iu->len = len;
 	int_to_scsilun(sdev->lun, &iu->lun);
@@ -608,8 +596,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
 	struct uas_dev_info *devinfo = sdev->hostdata;
 	struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp;
 	unsigned long flags;
-	unsigned int stream;
-	int err;
+	int idx, err;
 
 	BUILD_BUG_ON(sizeof(struct uas_cmd_info) > sizeof(struct scsi_pointer));
 
@@ -635,8 +622,12 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
 		return 0;
 	}
 
-	stream = uas_get_tag(cmnd);
-	if (devinfo->cmnd[stream - 1]) {
+	/* Find a free uas-tag */
+	for (idx = 0; idx < devinfo->qdepth; idx++) {
+		if (!devinfo->cmnd[idx])
+			break;
+	}
+	if (idx == devinfo->qdepth) {
 		spin_unlock_irqrestore(&devinfo->lock, flags);
 		return SCSI_MLQUEUE_DEVICE_BUSY;
 	}
@@ -644,7 +635,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
 	cmnd->scsi_done = done;
 
 	memset(cmdinfo, 0, sizeof(*cmdinfo));
-	cmdinfo->stream = stream;
+	cmdinfo->uas_tag = idx + 1; /* uas-tag == usb-stream-id, so 1 based */
 	cmdinfo->state = SUBMIT_STATUS_URB | ALLOC_CMD_URB | SUBMIT_CMD_URB;
 
 	switch (cmnd->sc_data_direction) {
@@ -659,10 +650,8 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
 		break;
 	}
 
-	if (!devinfo->use_streams) {
+	if (!devinfo->use_streams)
 		cmdinfo->state &= ~(SUBMIT_DATA_IN_URB | SUBMIT_DATA_OUT_URB);
-		cmdinfo->stream = 0;
-	}
 
 	err = uas_submit_urbs(cmnd, devinfo, GFP_ATOMIC);
 	if (err) {
@@ -674,7 +663,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
 		uas_add_work(cmdinfo);
 	}
 
-	devinfo->cmnd[stream - 1] = cmnd;
+	devinfo->cmnd[idx] = cmnd;
 	spin_unlock_irqrestore(&devinfo->lock, flags);
 	return 0;
 }
@@ -702,7 +691,7 @@ static int uas_eh_abort_handler(struct scsi_cmnd *cmnd)
 	cmdinfo->state |= COMMAND_ABORTED;
 
 	/* Drop all refs to this cmnd, kill data urbs to break their ref */
-	devinfo->cmnd[uas_get_tag(cmnd) - 1] = NULL;
+	devinfo->cmnd[cmdinfo->uas_tag - 1] = NULL;
 	if (cmdinfo->state & DATA_IN_URB_INFLIGHT)
 		data_in_urb = usb_get_urb(cmdinfo->data_in_urb);
 	if (cmdinfo->state & DATA_OUT_URB_INFLIGHT)
@@ -818,13 +807,6 @@ static struct scsi_host_template uas_host_template = {
 	.cmd_per_lun = 1,	/* until we override it */
 	.skip_settle_delay = 1,
 	.ordered_tag = 1,
-
-	/*
-	 * The uas drivers expects tags not to be bigger than the maximum
-	 * per-device queue depth, which is not true with the blk-mq tag
-	 * allocator.
-	 */
-	.disable_blk_mq = true,
 };
 
 #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] uas: Make uas work with blk-mq
       [not found]   ` <1412330937-22630-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-10-03 21:47     ` Greg Kroah-Hartman
  2014-10-04  8:53       ` Hans de Goede
  0 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2014-10-03 21:47 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Christoph Hellwig, Douglas Gilbert,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA

On Fri, Oct 03, 2014 at 12:08:57PM +0200, Hans de Goede wrote:
> With uas over usb-3 the tags inside the uas iu-s must match the usb-3 stream
> ids, and those go from 1 - qdepth.
> 
> Before blk-mq calling scsi_activate_tcq(sdev, qdepth) guaranteed that we would
> only get cmnd->request->tag from 0 - (qdepth - 1), and we used those as
> uas-tags / stream-ids.
> 
> With blk-mq however we are guaranteed to never get more then qdepth commands
> queued at the same time, but the cmnd->request->tag values may be much larger,
> which breaks uas.
> 
> This commit fixes this by generating uas tags in the 1 - qdepth range ourselves
> instead of using cmnd->request->tag.
> 
> While touching all involved code anyways also rename the uas_cmd_info stream
> field to uas_tag, because when using uas over usb-2 streams are not used.
> 
> Cc: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
> Reported-by: Douglas Gilbert <dgilbert-qazKcTl6WRFWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Reviewed-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>

This doesn't apply to my usb-next branch of usb.git, care to refresh it
and resend?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] uas: Make uas work with blk-mq
  2014-10-03 21:47     ` Greg Kroah-Hartman
@ 2014-10-04  8:53       ` Hans de Goede
  2014-10-04 14:46         ` James Bottomley
  0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2014-10-04  8:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Christoph Hellwig, Douglas Gilbert, linux-usb, linux-scsi,
	James E.J. Bottomley

Hi,

On 10/03/2014 11:47 PM, Greg Kroah-Hartman wrote:
> On Fri, Oct 03, 2014 at 12:08:57PM +0200, Hans de Goede wrote:
>> With uas over usb-3 the tags inside the uas iu-s must match the usb-3 stream
>> ids, and those go from 1 - qdepth.
>>
>> Before blk-mq calling scsi_activate_tcq(sdev, qdepth) guaranteed that we would
>> only get cmnd->request->tag from 0 - (qdepth - 1), and we used those as
>> uas-tags / stream-ids.
>>
>> With blk-mq however we are guaranteed to never get more then qdepth commands
>> queued at the same time, but the cmnd->request->tag values may be much larger,
>> which breaks uas.
>>
>> This commit fixes this by generating uas tags in the 1 - qdepth range ourselves
>> instead of using cmnd->request->tag.
>>
>> While touching all involved code anyways also rename the uas_cmd_info stream
>> field to uas_tag, because when using uas over usb-2 streams are not used.
>>
>> Cc: Christoph Hellwig <hch@infradead.org>
>> Reported-by: Douglas Gilbert <dgilbert@interlog.com>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> This doesn't apply to my usb-next branch of usb.git, care to refresh it
> and resend?

I did this v2 to resolve a conflict with a last minute fix for 3.17 which
James Bottomley pushed out yesterday. So if this does not apply that likely
is because that fix is not (yet) in next. See:

https://git.kernel.org/cgit/linux/kernel/git/jejb/scsi.git/log/?h=fixes

And specifically:

https://git.kernel.org/cgit/linux/kernel/git/jejb/scsi.git/commit/?h=fixes&id=2c2d831c81ec75a7b0d8e28caa8e3d9c1fe546f9

I'm not sure how to proceed here, maybe the best thing is to cherry pick
that fix into usb-next (should disappear on merge), and then apply
this one on top ?

Regards,

Hans

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] uas: Make uas work with blk-mq
  2014-10-04  8:53       ` Hans de Goede
@ 2014-10-04 14:46         ` James Bottomley
       [not found]           ` <1412433981.21548.6.camel-doHRWNlmrt9+urZeOPWqwQ@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: James Bottomley @ 2014-10-04 14:46 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Greg Kroah-Hartman, Christoph Hellwig, Douglas Gilbert,
	linux-usb, linux-scsi

On Sat, 2014-10-04 at 10:53 +0200, Hans de Goede wrote:
> Hi,
> 
> On 10/03/2014 11:47 PM, Greg Kroah-Hartman wrote:
> > On Fri, Oct 03, 2014 at 12:08:57PM +0200, Hans de Goede wrote:
> >> With uas over usb-3 the tags inside the uas iu-s must match the usb-3 stream
> >> ids, and those go from 1 - qdepth.
> >>
> >> Before blk-mq calling scsi_activate_tcq(sdev, qdepth) guaranteed that we would
> >> only get cmnd->request->tag from 0 - (qdepth - 1), and we used those as
> >> uas-tags / stream-ids.
> >>
> >> With blk-mq however we are guaranteed to never get more then qdepth commands
> >> queued at the same time, but the cmnd->request->tag values may be much larger,
> >> which breaks uas.
> >>
> >> This commit fixes this by generating uas tags in the 1 - qdepth range ourselves
> >> instead of using cmnd->request->tag.
> >>
> >> While touching all involved code anyways also rename the uas_cmd_info stream
> >> field to uas_tag, because when using uas over usb-2 streams are not used.
> >>
> >> Cc: Christoph Hellwig <hch@infradead.org>
> >> Reported-by: Douglas Gilbert <dgilbert@interlog.com>
> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >> Reviewed-by: Christoph Hellwig <hch@lst.de>
> > 
> > This doesn't apply to my usb-next branch of usb.git, care to refresh it
> > and resend?
> 
> I did this v2 to resolve a conflict with a last minute fix for 3.17 which
> James Bottomley pushed out yesterday. So if this does not apply that likely
> is because that fix is not (yet) in next. See:
> 
> https://git.kernel.org/cgit/linux/kernel/git/jejb/scsi.git/log/?h=fixes
> 
> And specifically:
> 
> https://git.kernel.org/cgit/linux/kernel/git/jejb/scsi.git/commit/?h=fixes&id=2c2d831c81ec75a7b0d8e28caa8e3d9c1fe546f9
> 
> I'm not sure how to proceed here, maybe the best thing is to cherry pick
> that fix into usb-next (should disappear on merge), and then apply
> this one on top ?

Depends:  The fixes tree is based on -rc1, so you could just use that as
the base for the topic branch uas goes in.  That's the usual way.  Or we
could just do it via the SCSI tree, which will have the necessary base.

Which would you prefer?

James



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] uas: Make uas work with blk-mq
       [not found]           ` <1412433981.21548.6.camel-doHRWNlmrt9+urZeOPWqwQ@public.gmane.org>
@ 2014-10-05  9:06             ` Hans de Goede
       [not found]               ` <543109F8.3030303-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2014-10-05  9:06 UTC (permalink / raw)
  To: James Bottomley
  Cc: Greg Kroah-Hartman, Christoph Hellwig, Douglas Gilbert,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA

Hi,

On 10/04/2014 04:46 PM, James Bottomley wrote:
> On Sat, 2014-10-04 at 10:53 +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 10/03/2014 11:47 PM, Greg Kroah-Hartman wrote:
>>> On Fri, Oct 03, 2014 at 12:08:57PM +0200, Hans de Goede wrote:
>>>> With uas over usb-3 the tags inside the uas iu-s must match the usb-3 stream
>>>> ids, and those go from 1 - qdepth.
>>>>
>>>> Before blk-mq calling scsi_activate_tcq(sdev, qdepth) guaranteed that we would
>>>> only get cmnd->request->tag from 0 - (qdepth - 1), and we used those as
>>>> uas-tags / stream-ids.
>>>>
>>>> With blk-mq however we are guaranteed to never get more then qdepth commands
>>>> queued at the same time, but the cmnd->request->tag values may be much larger,
>>>> which breaks uas.
>>>>
>>>> This commit fixes this by generating uas tags in the 1 - qdepth range ourselves
>>>> instead of using cmnd->request->tag.
>>>>
>>>> While touching all involved code anyways also rename the uas_cmd_info stream
>>>> field to uas_tag, because when using uas over usb-2 streams are not used.
>>>>
>>>> Cc: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
>>>> Reported-by: Douglas Gilbert <dgilbert-qazKcTl6WRFWk0Htik3J/w@public.gmane.org>
>>>> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>>> Reviewed-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
>>>
>>> This doesn't apply to my usb-next branch of usb.git, care to refresh it
>>> and resend?
>>
>> I did this v2 to resolve a conflict with a last minute fix for 3.17 which
>> James Bottomley pushed out yesterday. So if this does not apply that likely
>> is because that fix is not (yet) in next. See:
>>
>> https://git.kernel.org/cgit/linux/kernel/git/jejb/scsi.git/log/?h=fixes
>>
>> And specifically:
>>
>> https://git.kernel.org/cgit/linux/kernel/git/jejb/scsi.git/commit/?h=fixes&id=2c2d831c81ec75a7b0d8e28caa8e3d9c1fe546f9
>>
>> I'm not sure how to proceed here, maybe the best thing is to cherry pick
>> that fix into usb-next (should disappear on merge), and then apply
>> this one on top ?
> 
> Depends:  The fixes tree is based on -rc1, so you could just use that as
> the base for the topic branch uas goes in.  That's the usual way.  Or we
> could just do it via the SCSI tree, which will have the necessary base.
> 
> Which would you prefer?

This patch sits on top of a lot of other uas fixes which are already
in usb-next, so this needs to go in through usb-next.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] uas: Make uas work with blk-mq
       [not found]               ` <543109F8.3030303-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-10-05  9:10                 ` Christoph Hellwig
       [not found]                   ` <20141005091015.GA29855-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2014-10-05  9:10 UTC (permalink / raw)
  To: Hans de Goede
  Cc: James Bottomley, Greg Kroah-Hartman, Christoph Hellwig,
	Douglas Gilbert, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA

On Sun, Oct 05, 2014 at 11:06:00AM +0200, Hans de Goede wrote:
> This patch sits on top of a lot of other uas fixes which are already
> in usb-next, so this needs to go in through usb-next.

What is the actual conflict?  If it's just your revert of the
disable_blk_mq flag you might want to skip that for this pull request
and send it on after both scsi and usb trees make it to Linus.

If there's more conflict around the host template you could cherry pick
my patch for your tree.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] uas: Make uas work with blk-mq
       [not found]                   ` <20141005091015.GA29855-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
@ 2014-10-05  9:18                     ` Hans de Goede
  2014-10-06  0:10                       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2014-10-05  9:18 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: James Bottomley, Greg Kroah-Hartman, Douglas Gilbert,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA

Hi,

On 10/05/2014 11:10 AM, Christoph Hellwig wrote:
> On Sun, Oct 05, 2014 at 11:06:00AM +0200, Hans de Goede wrote:
>> This patch sits on top of a lot of other uas fixes which are already
>> in usb-next, so this needs to go in through usb-next.
> 
> What is the actual conflict? If it's just your revert of the
> disable_blk_mq flag

Yes, the conclict is just my revert of the disable_blk_mq flag

> you might want to skip that for this pull request
> and send it on after both scsi and usb trees make it to Linus.

Since the patch with the conclict actually makes the flag unnecessary,
to me this belongs in the same patch.

> If there's more conflict around the host template you could cherry pick
> my patch for your tree.

Yes, Greg cherry picking the patch in question into his tree to resolv
the conflict would be my preferred solution to this, but ultimately
that is Greg's call.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] uas: Make uas work with blk-mq
  2014-10-05  9:18                     ` Hans de Goede
@ 2014-10-06  0:10                       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2014-10-06  0:10 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Christoph Hellwig, James Bottomley, Douglas Gilbert, linux-usb,
	linux-scsi

On Sun, Oct 05, 2014 at 11:18:49AM +0200, Hans de Goede wrote:
> Hi,
> 
> On 10/05/2014 11:10 AM, Christoph Hellwig wrote:
> > On Sun, Oct 05, 2014 at 11:06:00AM +0200, Hans de Goede wrote:
> >> This patch sits on top of a lot of other uas fixes which are already
> >> in usb-next, so this needs to go in through usb-next.
> > 
> > What is the actual conflict? If it's just your revert of the
> > disable_blk_mq flag
> 
> Yes, the conclict is just my revert of the disable_blk_mq flag
> 
> > you might want to skip that for this pull request
> > and send it on after both scsi and usb trees make it to Linus.
> 
> Since the patch with the conclict actually makes the flag unnecessary,
> to me this belongs in the same patch.
> 
> > If there's more conflict around the host template you could cherry pick
> > my patch for your tree.
> 
> Yes, Greg cherry picking the patch in question into his tree to resolv
> the conflict would be my preferred solution to this, but ultimately
> that is Greg's call.

I'm not going to do that, just resend it to me after 3.18-rc1 is out, my
tree is closed for the -rc1 merge window now anyway.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-10-06  0:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-03 10:08 [PATCH v2 1/2] uas: Reduce number of function arguments for uas_alloc_foo functions Hans de Goede
2014-10-03 10:08 ` [PATCH v2 2/2] uas: Make uas work with blk-mq Hans de Goede
     [not found]   ` <1412330937-22630-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-03 21:47     ` Greg Kroah-Hartman
2014-10-04  8:53       ` Hans de Goede
2014-10-04 14:46         ` James Bottomley
     [not found]           ` <1412433981.21548.6.camel-doHRWNlmrt9+urZeOPWqwQ@public.gmane.org>
2014-10-05  9:06             ` Hans de Goede
     [not found]               ` <543109F8.3030303-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-05  9:10                 ` Christoph Hellwig
     [not found]                   ` <20141005091015.GA29855-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-10-05  9:18                     ` Hans de Goede
2014-10-06  0:10                       ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.