From: Felipe Balbi <balbi@kernel.org>
To: Lipengcheng <lpc.li@hisilicon.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: usb: dwc3: gadget: decrease the queued_requests in removal
Date: Mon, 08 Jan 2018 13:52:13 +0200 [thread overview]
Message-ID: <877esslg9e.fsf@linux.intel.com> (raw)
Hi,
Lipengcheng <lpc.li@hisilicon.com> writes:
> In removal requests, it is necessary to make the corresponding trb
> disable state (HWO = 1) and dep->queued_requests a corresponding reduction.
> It is better to use a alone funtion to disable trb (HWO = 0).
this shouldn't be necessary. What problem are you facing? what happens?
Where are the tracepoint logs? Which kernel are you using? did you try
mainline?
> Signed-off-by: Pengcheng Li <lpc.li@hisilicon.com>
> ---
> drivers/usb/dwc3/gadget.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 1e6c42e..273b51d 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -707,6 +707,36 @@ static void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep)
> while (!list_empty(&dep->started_list)) {
why all these underscore characters? Are you sending html emails?
> req = next_request(&dep->started_list);
>
> + if (req->trb) {
> + if (req->num_pending_sgs) {
> + struct dwc3_trb *trb;
> + int i = 0;
> +
> + for (i = 0; i < req->num_pending_sgs; i++) {
> + trb = req->trb + i;
> + trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
> + dwc3_ep_inc_deq(dep);
> + }
> +
> + if (req->unaligned || req->zero) {
> + trb = req->trb + req->num_pending_sgs + 1;
> + trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
> + dwc3_ep_inc_deq(dep);
> + }
> + } else {
> + struct dwc3_trb *trb = req->trb;
> +
> + trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
> + dwc3_ep_inc_deq(dep);
> +
> + if (req->unaligned || req->zero) {
> + trb = req->trb + 1;
> + trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
> + dwc3_ep_inc_deq(dep);
> + }
> + }
> + }
> + dep->queued_requests--;
> dwc3_gadget_giveback(dep, req, -ESHUTDOWN);
> }
you have a lot to fix here.
--
balbi
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@kernel.org>
To: Lipengcheng <lpc.li@hisilicon.com>
Cc: "gregkh\@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-usb\@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Lipengcheng <lpc.li@hisilicon.com>
Subject: Re: [PATCH] usb: dwc3: gadget: decrease the queued_requests in removal
Date: Mon, 08 Jan 2018 13:52:13 +0200 [thread overview]
Message-ID: <877esslg9e.fsf@linux.intel.com> (raw)
In-Reply-To: <637796ED17F7774FB27D6AAE3C6951584B38CE36@dggeml508-mbx.china.huawei.com>
[-- Attachment #1: Type: text/plain, Size: 2613 bytes --]
Hi,
Lipengcheng <lpc.li@hisilicon.com> writes:
> In removal requests, it is necessary to make the corresponding trb
> disable state (HWO = 1) and dep->queued_requests a corresponding reduction.
> It is better to use a alone funtion to disable trb (HWO = 0).
this shouldn't be necessary. What problem are you facing? what happens?
Where are the tracepoint logs? Which kernel are you using? did you try
mainline?
> Signed-off-by: Pengcheng Li <lpc.li@hisilicon.com>
> ---
> drivers/usb/dwc3/gadget.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 1e6c42e..273b51d 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -707,6 +707,36 @@ static void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep)
> while (!list_empty(&dep->started_list)) {
why all these underscore characters? Are you sending html emails?
> req = next_request(&dep->started_list);
>
> + if (req->trb) {
> + if (req->num_pending_sgs) {
> + struct dwc3_trb *trb;
> + int i = 0;
> +
> + for (i = 0; i < req->num_pending_sgs; i++) {
> + trb = req->trb + i;
> + trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
> + dwc3_ep_inc_deq(dep);
> + }
> +
> + if (req->unaligned || req->zero) {
> + trb = req->trb + req->num_pending_sgs + 1;
> + trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
> + dwc3_ep_inc_deq(dep);
> + }
> + } else {
> + struct dwc3_trb *trb = req->trb;
> +
> + trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
> + dwc3_ep_inc_deq(dep);
> +
> + if (req->unaligned || req->zero) {
> + trb = req->trb + 1;
> + trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
> + dwc3_ep_inc_deq(dep);
> + }
> + }
> + }
> + dep->queued_requests--;
> dwc3_gadget_giveback(dep, req, -ESHUTDOWN);
> }
you have a lot to fix here.
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next reply other threads:[~2018-01-08 11:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 11:52 Felipe Balbi [this message]
2018-01-08 11:52 ` [PATCH] usb: dwc3: gadget: decrease the queued_requests in removal Felipe Balbi
-- strict thread matches above, loose matches on Subject: below --
2017-12-25 3:41 Lipengcheng
2017-12-25 3:41 ` [PATCH] " Lipengcheng
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=877esslg9e.fsf@linux.intel.com \
--to=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lpc.li@hisilicon.com \
/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.