All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	linux-usb@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>
Subject: [PATCH v2 02/11] usb: gadget: f_tcm: Inform last stream request
Date: Tue, 05 May 2020 19:46:19 -0700	[thread overview]
Message-ID: <b0d80021efedbf189b85f8c0f1e0baeaf7543d2c.1588732815.git.thinhn@synopsys.com> (raw)
In-Reply-To: <cover.1588732815.git.thinhn@synopsys.com>

Set the request->is_last to each stream request to indicate that the
request is the last stream request of a transfer. The DWC3 controller
needs to know this info to properly switch streams. The current
implementation of f_tcm uses a single request per transfer, so every
stream request is the last of its stream.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
 drivers/usb/gadget/function/f_tcm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c
index 36504931b2d1..2979cbe4d95f 100644
--- a/drivers/usb/gadget/function/f_tcm.c
+++ b/drivers/usb/gadget/function/f_tcm.c
@@ -531,6 +531,7 @@ static int uasp_prepare_r_request(struct usbg_cmd *cmd)
 		stream->req_in->sg = se_cmd->t_data_sg;
 	}
 
+	stream->req_in->is_last = 1;
 	stream->req_in->complete = uasp_status_data_cmpl;
 	stream->req_in->length = se_cmd->data_length;
 	stream->req_in->context = cmd;
@@ -554,6 +555,7 @@ static void uasp_prepare_status(struct usbg_cmd *cmd)
 	 */
 	iu->len = cpu_to_be16(se_cmd->scsi_sense_length);
 	iu->status = se_cmd->scsi_status;
+	stream->req_status->is_last = 1;
 	stream->req_status->context = cmd;
 	stream->req_status->length = se_cmd->scsi_sense_length + 16;
 	stream->req_status->buf = iu;
@@ -991,6 +993,7 @@ static int usbg_prepare_w_request(struct usbg_cmd *cmd, struct usb_request *req)
 		req->sg = se_cmd->t_data_sg;
 	}
 
+	req->is_last = 1;
 	req->complete = usbg_data_write_cmpl;
 	req->length = se_cmd->data_length;
 	req->context = cmd;
-- 
2.11.0


  parent reply	other threads:[~2020-05-06  2:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06  2:46 [PATCH v2 00/11] usb: dwc3: gadget: Handle streams Thinh Nguyen
2020-05-06  2:46 ` [PATCH v2 01/11] usb: gadget: Introduce usb_request->is_last Thinh Nguyen
2020-05-06  2:46 ` Thinh Nguyen [this message]
2020-05-06  2:46 ` [PATCH v2 03/11] usb: dwc3: gadget: Continue to process pending requests Thinh Nguyen
2020-05-06  2:46 ` [PATCH v2 04/11] usb: dwc3: gadget: Check for in-progress END_TRANSFER Thinh Nguyen
2020-05-06  2:46 ` [PATCH v2 05/11] usb: dwc3: gadget: Refactor TRB completion handler Thinh Nguyen
2020-05-06  2:46 ` [PATCH v2 06/11] usb: dwc3: gadget: Enable XferComplete event Thinh Nguyen
2020-05-06  2:46 ` [PATCH v2 07/11] usb: dwc3: gadget: Handle XferComplete for streams Thinh Nguyen
2020-05-06  2:46 ` [PATCH v2 08/11] usb: dwc3: gadget: Wait for transfer completion Thinh Nguyen
2020-05-06  2:47 ` [PATCH v2 09/11] usb: dwc3: gadget: Don't prepare beyond a transfer Thinh Nguyen
2020-05-06  2:47 ` [PATCH v2 10/11] usb: dwc3: gadget: Handle stream transfers Thinh Nguyen
2020-05-06  2:47 ` [PATCH v2 11/11] usb: dwc3: gadget: Use SET_EP_PRIME for NoStream Thinh Nguyen
2020-05-14 10:43 ` [PATCH v2 00/11] usb: dwc3: gadget: Handle streams Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0d80021efedbf189b85f8c0f1e0baeaf7543d2c.1588732815.git.thinhn@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.