linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Grzeschik <mgr@pengutronix.de>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Jeff Vanhoof <jdv1029@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dan Vacura <w36195@motorola.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Daniel Scally <dan.scally@ideasonboard.com>,
	Jeff Vanhoof <qjv001@motorola.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Felipe Balbi <balbi@kernel.org>,
	Paul Elder <paul.elder@ideasonboard.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH v4 2/6] usb: dwc3: gadget: cancel requests instead of release after missed isoc
Date: Tue, 19 Sep 2023 11:18:06 +0200	[thread overview]
Message-ID: <ZQlnTsLriLGvZPfo@pengutronix.de> (raw)
In-Reply-To: <ZQlln94I7MPlX0ff@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 4107 bytes --]

On Tue, Sep 19, 2023 at 11:10:55AM +0200, Michael Grzeschik wrote:
>On Mon, Oct 24, 2022 at 10:47:53PM +0000, Thinh Nguyen wrote:
>>On Sat, Oct 22, 2022, Jeff Vanhoof wrote:
>>>Hi Greg,
>>>
>>>On Sat, Oct 22, 2022 at 01:31:24PM +0200, Greg Kroah-Hartman wrote:
>>>> On Tue, Oct 18, 2022 at 04:50:38PM -0500, Dan Vacura wrote:
>>>> > From: Jeff Vanhoof <qjv001@motorola.com>
>>>> >
>>>> > arm-smmu related crashes seen after a Missed ISOC interrupt when
>>>> > no_interrupt=1 is used. This can happen if the hardware is still using
>>>> > the data associated with a TRB after the usb_request's ->complete call
>>>> > has been made.  Instead of immediately releasing a request when a Missed
>>>> > ISOC interrupt has occurred, this change will add logic to cancel the
>>>> > request instead where it will eventually be released when the
>>>> > END_TRANSFER command has completed. This logic is similar to some of the
>>>> > cleanup done in dwc3_gadget_ep_dequeue.
>>>> >
>>>> > Fixes: 6d8a019614f3 ("usb: dwc3: gadget: check for Missed Isoc from event status")
>>>> > Cc: <stable@vger.kernel.org>
>>>> > Signed-off-by: Jeff Vanhoof <qjv001@motorola.com>
>>>> > Co-developed-by: Dan Vacura <w36195@motorola.com>
>>>> > Signed-off-by: Dan Vacura <w36195@motorola.com>
>>>> > ---
>>>> > V1 -> V3:
>>>> > - no change, new patch in series
>>>> > V3 -> V4:
>>>> > - no change
>>>>
>>>> I need an ack from the dwc3 maintainer before I can take this one.
>>>>
>>>> thanks,
>>>>
>>>> greg k-h
>>>
>>>Thinh has rejected this version of the patch. He has provided an alternative
>>>implementation which has been testing well for us so far. Either Thinh or Dan
>>>will formalize this patch within the next few days.
>>>The latest proposed changes are:
>>>
>>>diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>>>index dfaf9ac24c4f..50287437d6de 100644
>>>--- a/drivers/usb/dwc3/gadget.c
>>>+++ b/drivers/usb/dwc3/gadget.c
>>>@@ -3195,6 +3195,9 @@ static int dwc3_gadget_ep_reclaim_completed_trb(struct dwc3_ep *dep,
>>>        if (event->status & DEPEVT_STATUS_SHORT && !chain)
>>>                return 1;
>>>
>>>+       if (DWC3_TRB_SIZE_TRBSTS(trb->size) == DWC3_TRBSTS_MISSED_ISOC && !chain)
>>>+               return 1;
>>>+
>>>        if ((trb->ctrl & DWC3_TRB_CTRL_IOC) ||
>>>            (trb->ctrl & DWC3_TRB_CTRL_LST))
>>>                return 1;
>>>@@ -3211,6 +3214,7 @@ static int dwc3_gadget_ep_reclaim_trb_sg(struct dwc3_ep *dep,
>>>        struct scatterlist *s;
>>>        unsigned int num_queued = req->num_queued_sgs;
>>>        unsigned int i;
>>>+       bool missed_isoc = false;
>>>        int ret = 0;
>>>
>>>        for_each_sg(sg, s, num_queued, i) {
>>>@@ -3219,12 +3223,18 @@ static int dwc3_gadget_ep_reclaim_trb_sg(struct dwc3_ep *dep,
>>>                req->sg = sg_next(s);
>>>                req->num_queued_sgs--;
>>>
>>>+               if (DWC3_TRB_SIZE_TRBSTS(trb->size) == DWC3_TRBSTS_MISSED_ISOC)
>>>+                       missed_isoc = true;
>>>+
>>>                ret = dwc3_gadget_ep_reclaim_completed_trb(dep, req,
>>>                                trb, event, status, true);
>>>                if (ret)
>>>                        break;
>>>        }
>>>
>>>+       if (missed_isoc)
>>>+               ret = 1;
>>>+
>>>        return ret;
>>> }
>>>
>>>
>>
>>That's just a debug patch. I'll send out proper fix patches.
>
>Ping!
>
>While digging out this thread, I did not find any followup patch
>for this suggestion. Did it hit the mailinglist anywhere?
>
>If not, will you send one?

Nevermind, I think I found the hunk in a variated version in this series.

https://lore.kernel.org/linux-usb/cover.1666735451.git.Thinh.Nguyen@synopsys.com/

Michael

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-09-19  9:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 21:50 [PATCH v4 0/6] uvc gadget performance issues Dan Vacura
2022-10-18 21:50 ` [PATCH v4 1/6] usb: gadget: uvc: fix dropped frame after missed isoc Dan Vacura
2022-10-18 21:50 ` [PATCH v4 2/6] usb: dwc3: gadget: cancel requests instead of release " Dan Vacura
2022-10-22 11:31   ` Greg Kroah-Hartman
2022-10-22 13:35     ` Jeff Vanhoof
2022-10-24 22:47       ` Thinh Nguyen
2023-09-19  9:10         ` Michael Grzeschik
2023-09-19  9:18           ` Michael Grzeschik [this message]
2022-10-18 21:50 ` [PATCH v4 3/6] usb: gadget: uvc: fix sg handling in error case Dan Vacura
2022-10-18 21:50 ` [PATCH v4 4/6] usb: gadget: uvc: fix sg handling during video encode Dan Vacura
2022-10-18 21:50 ` [PATCH v4 5/6] usb: gadget: uvc: make interrupt skip logic configurable Dan Vacura
2022-10-22 11:32   ` Greg Kroah-Hartman
2022-10-18 21:50 ` [PATCH v4 6/6] usb: gadget: uvc: add configfs option for sg support Dan Vacura
2022-10-22 11:34   ` Greg Kroah-Hartman

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=ZQlnTsLriLGvZPfo@pengutronix.de \
    --to=mgr@pengutronix.de \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dan.scally@ideasonboard.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jdv1029@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=paul.elder@ideasonboard.com \
    --cc=qjv001@motorola.com \
    --cc=stable@vger.kernel.org \
    --cc=w36195@motorola.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).