All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: Palak SHAH <palak.shah@raritan.com>,
	Maynard CABIENTE <maynard.cabiente@raritan.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: RE: usb: gadget: dwc2: not getting audio data
Date: Wed, 14 Dec 2022 06:11:14 +0000	[thread overview]
Message-ID: <BYAPR12MB3399793344D7A0C7F85FAF3DA7E09@BYAPR12MB3399.namprd12.prod.outlook.com> (raw)
In-Reply-To: <HE1PR0601MB2586AFC1102D078A26615CBC8DE29@HE1PR0601MB2586.eurprd06.prod.outlook.com>

Hi Palak,

On 12/12/2022 11:44 PM, Palak SHAH wrote:
>From: Palak SHAH <palak.shah@raritan.com>
>Sent: Monday, December 12, 2022 11:44 PM
>To: Minas Harutyunyan <hminas@synopsys.com>; Maynard CABIENTE
><maynard.cabiente@raritan.com>
>Cc: linux-usb@vger.kernel.org
>Subject: RE: usb: gadget: dwc2: not getting audio data
>
>Hi Minas,
>I applied the patch you sent this morning and attached the logs, I have also
>attached the USB sniffer data collected using the Ellisys software. The
>previous email delivery failed because I attached the usb sniffer data (txt
>file) which was 14 MB.
>
>I am attaching the USB sniffer log file here in the .ufo format, which can
>be viewed by downloading the ellisys software.
>
>Link to download the software -
>https://urldefense.com/v3/__https://www.ellisys.com/products/usbex200/index.
>php__;!!A4F2R9G_pg!dy4zWJkC54FVl2XV1ItXNh8mqShA5i_kTiC8ZUSbap-
>7vK1yNeFrI9_cB72IdRISlzd4ajzH-a8UYdtRstfheBb1_cUR$
>
>Thanks,
>Palak
>

Please apply new patch below and test:

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 8b15742d9e8a..c88c084be189 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -1355,12 +1355,16 @@ static bool dwc2_gadget_target_frame_elapsed(struct
 dwc2_hsotg_ep *hs_ep)
        if (hsotg->gadget.speed != USB_SPEED_HIGH)
                limit >>= 3;
 
-       if (!frame_overrun && current_frame >= target_frame)
+       if (!frame_overrun && current_frame >= target_frame) {
+               dev_dbg(hsotg->dev, "%s: target = 0x%08x current = =0x%08x\n",
 __func__, target_frame, current_frame);
                return true;
+       }
 
        if (frame_overrun && current_frame >= target_frame &&
-           ((current_frame - target_frame) < limit / 2))
+           ((current_frame - target_frame) < limit / 2)) {
+               dev_dbg(hsotg->dev, "%s: target = 0x%08x current = =0x%08x\n",
 __func__, target_frame, current_frame);
                return true;
+       }
 
        return false;
 }
@@ -2218,6 +2222,8 @@ static void dwc2_gadget_complete_isoc_request_ddma(struct
 dwc2_hsotg_ep *hs_ep)
 
                dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0);
 
+               dev_dbg(hsotg->dev, "%s: compl_desc # %d\n", __func__,
 hs_ep->compl_desc);
+
                hs_ep->compl_desc++;
                if (hs_ep->compl_desc > (MAX_DMA_DESC_NUM_HS_ISOC - 1))
                        hs_ep->compl_desc = 0;
@@ -2892,11 +2898,14 @@ static void dwc2_gadget_handle_out_token_ep_disabled(struct
 dwc2_hsotg_ep *ep)
                return;
 
        if (using_desc_dma(hsotg)) {
-               if (ep->target_frame == TARGET_FRAME_INITIAL) {
+
+               dev_dbg(hsotg->dev, "%s: target_frame = 0x%08x\n",
 __func__, ep->target_frame);
+
+//             if (ep->target_frame == TARGET_FRAME_INITIAL) {
                        /* Start first ISO Out */
                        ep->target_frame = hsotg->frame_number;
                        dwc2_gadget_start_isoc_ddma(ep);
-               }
+//             }
                return;
        }
 
@@ -3159,8 +3168,12 @@ static void dwc2_hsotg_epint(struct dwc2_hsotg
 *hsotg, unsigned int idx,
 
        if (ints & DXEPINT_BNAINTR) {
                dev_dbg(hsotg->dev, "%s: BNA interrupt\n", __func__);
-               if (hs_ep->isochronous)
+               if (hs_ep->isochronous) {
+                       dev_dbg(hsotg->dev, "%s: DxEPCTL 0x%08x\n",
 __func__, dwc2_readl(hsotg, epctl_reg));
+                       dev_dbg(hsotg->dev, "%s: before GRXSTSR 0x%08x\n",
 __func__, dwc2_readl(hsotg, GRXSTSR));
                        dwc2_gadget_handle_isoc_bna(hs_ep);
+                       dev_dbg(hsotg->dev, "%s: after  GRXSTSR 0x%08x\n",
 __func__, dwc2_readl(hsotg, GRXSTSR));
+               }
        }
 
        if (dir_in && !hs_ep->isochronous) {
@@ -4277,6 +4290,12 @@ static int dwc2_hsotg_ep_disable(struct usb_ep *ep)
        hs_ep->fifo_index = 0;
        hs_ep->fifo_size = 0;
 
+       if (using_desc_dma(hsotg) && hs_ep->isochronous) {
+               hs_ep->target_frame = TARGET_FRAME_INITIAL;
+               hs_ep->next_desc = 0;
+               hs_ep->compl_desc = 0;
+       }
+
        return 0;
 }


Thanks,
Minas


  parent reply	other threads:[~2022-12-14  6:11 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <HE1PR0601MB2586962582F222B5B889416A8D1B9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
     [not found] ` <AS8PR06MB7976A91E44D7DCDAACC723F7971B9@AS8PR06MB7976.eurprd06.prod.outlook.com>
     [not found]   ` <HE1PR0601MB258625B74749B2DB1242E0048D1B9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
     [not found]     ` <HE1PR0601MB2586E4A641ECA0D0D043A3798D1D9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
     [not found]       ` <HE1PR0601MB258685C64D46C08C978C37EB8D1D9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2022-12-09 11:32         ` usb: gadget: dwc2: not getting audio data Minas Harutyunyan
     [not found]           ` <HE1PR0601MB25861FC1248FF0A61DDBC8F58D1C9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2022-12-12 12:27             ` Minas Harutyunyan
     [not found]               ` <HE1PR0601MB2586D03B6D11FDF5F513E2488DE29@HE1PR0601MB2586.eurprd06.prod.outlook.com>
     [not found]                 ` <HE1PR0601MB2586AFC1102D078A26615CBC8DE29@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2022-12-14  6:11                   ` Minas Harutyunyan [this message]
2022-12-15 21:16               ` Palak SHAH
2022-12-16  7:03                 ` Minas Harutyunyan
2023-01-06 21:37                   ` Palak SHAH
2023-01-12 10:52                     ` Minas Harutyunyan
2023-01-12 20:22                       ` Palak SHAH
2023-01-13  8:08                         ` Minas Harutyunyan
     [not found] <HE1PR0601MB25868E34AF4BA6CEAFE06F5F8DA39@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2023-02-22  6:39 ` Minas Harutyunyan
     [not found]   ` <HE1PR0601MB2586BFAE94813BA86BAB12708DAA9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2023-02-23  6:31     ` Minas Harutyunyan
     [not found]       ` <HE1PR0601MB25868FC836C3CD2D07B342958DAB9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2023-02-24 10:32         ` Minas Harutyunyan
2023-02-27  2:02           ` Palak SHAH
2023-02-27 10:18             ` Minas Harutyunyan
     [not found]               ` <HE1PR0601MB2586DB1CA3D0B4B45E7720A68DAF9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2023-03-01 19:29                 ` Palak SHAH
2023-03-02 21:38                 ` Palak SHAH
2023-03-03  4:35                 ` Minas Harutyunyan
2023-03-06 16:25                   ` Palak SHAH
2023-03-07  4:30                     ` Minas Harutyunyan
2023-03-08 21:42                       ` Palak SHAH
2023-03-09 10:03                         ` Minas Harutyunyan
2023-03-09 16:21                           ` Palak SHAH
2023-03-10  9:03                             ` Minas Harutyunyan
2023-04-06  1:42                               ` PALAK SHAH
2023-04-06  4:56                                 ` Minas Harutyunyan
2023-04-06 18:06                                   ` PALAK SHAH
     [not found]       ` <PAXPR06MB85319DCC50F69D0790D5F4198D719@PAXPR06MB8531.eurprd06.prod.outlook.com>
     [not found]         ` <PAXPR06MB8531E23298F9BA26C1E651AC8D769@PAXPR06MB8531.eurprd06.prod.outlook.com>
     [not found]           ` <PAXPR06MB8531BF29DA170252843DD5598D769@PAXPR06MB8531.eurprd06.prod.outlook.com>
     [not found]             ` <PAXPR06MB8531D31F642598C1D9B8555B8D749@PAXPR06MB8531.eurprd06.prod.outlook.com>
2023-05-16  7:51               ` Minas Harutyunyan
2023-05-16  7:53               ` Minas Harutyunyan
2023-05-16 20:43                 ` PALAK SHAH
2023-05-17  6:04                   ` Minas Harutyunyan
2023-05-17 19:02                     ` PALAK SHAH
2023-05-18 11:22                       ` Minas Harutyunyan
2023-05-18 18:32                         ` PALAK SHAH
2023-05-19 13:22                           ` Minas Harutyunyan
     [not found]                     ` <PAXPR06MB85314C9FAD4BFEA5ED1B6F828D0DA@PAXPR06MB8531.eurprd06.prod.outlook.com>
2023-08-14 14:47                       ` PALAK SHAH
2023-08-15  8:44                       ` Minas Harutyunyan
     [not found]                         ` <PAXPR06MB85318E88964FE24F74139C678D14A@PAXPR06MB8531.eurprd06.prod.outlook.com>
2023-08-25 18:32                           ` PALAK SHAH
2023-08-28 10:46                             ` Minas Harutyunyan

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=BYAPR12MB3399793344D7A0C7F85FAF3DA7E09@BYAPR12MB3399.namprd12.prod.outlook.com \
    --to=minas.harutyunyan@synopsys.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=maynard.cabiente@raritan.com \
    --cc=palak.shah@raritan.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.