On 12/14/2018 2:26 PM, Andrzej Pietrasiewicz wrote: > W dniu 14.12.2018 o 09:55, Minas Harutyunyan pisze: >> Hi Andrzej, >> >> On 12/4/2018 9:54 PM, Andrzej Pietrasiewicz wrote: >>> Hi All, >>> >>> I have recently noticed a problem with dwc2 and audio gadget. >>> >>> TICK_TIME: 0 >>> >>> Any ideas on how to test it further to identify the problem? >>> >>> Definitely the commit identified with bisect was a problem at least >>> until 4.13. Perhaps it still is the root cause, but I can't tell. >>> It is difficult to revert it, because there were later changes which >>> depend on it. >>> >>> Andrzej >>> >> >> Which DMA (BDMA or DDMA) or Slave mode in dwc2 you use for testing? >> > > Currently the default available in upstream dwc2, which is, I guess, BDMA. Currently gadget default mode is DDMA. DDMA support by default set starting from 4.10, of course, if core supported DDMA. > > >> By changing UAC2_DEF_REQ_NUM to 4 all audio gadget tests passed smoothly. >> Could you please apply this patch and run tests in DDMA mode: >> >> diff --git a/drivers/usb/gadget/function/u_uac2.h >> b/drivers/usb/gadget/function/u_uac2.h >> index 8362ee572e1e..5e649259ab76 100644 >> --- a/drivers/usb/gadget/function/u_uac2.h >> +++ b/drivers/usb/gadget/function/u_uac2.h >> @@ -21,7 +21,7 @@ >> #define UAC2_DEF_CCHMASK 0x3 >> #define UAC2_DEF_CSRATE 64000 >> #define UAC2_DEF_CSSIZE 2 >> -#define UAC2_DEF_REQ_NUM 2 >> +#define UAC2_DEF_REQ_NUM 4 >> >> struct f_uac2_opts { >> struct usb_function_instance func_inst; >> > This patch applied to current mainline seems to help in case the board > boots correctly - no problems playing from the host using the USB gadget - > but it still sometimes hangs at boot. I tried tracing the problems > back and identified 381fc8f8228923026b3d75c8230fa2ee4d688f32 at 4.8 as the first It's for BDMA and that commit have a bug which fixed by d5d5f079138254e4d641de2f36760d0d0fc9f510. Please apply and test. DDMA mode for ISOCs support in gadget added starting from 4.10 > commit at which they happen. Applying the above patch is not possible at 4.8, 4.8 should be BDMA > because at that point there was no such #define. It does apply though at 4.11, > but does not help, so I it seems there are some more co-existing problems. DDMA ISOC support for gadget cardinally changed starting from 4.18 by follow commits: 729cac693eecfebdb9e152eaddddd358ae2decb7, 37981e00503f6bdeb99108ff90199002c3eec2f5,1ffba9058737af2ddeebc813faa8ea9b16bc892a, 21cbbc6bb7b4ba6aee303a3b4aef1578253724d8,1d8e5c00275825fc42aaa5597dab1d0b5b26bb64, 4d4f1e79b800c80313280eec1af25a242a50dce5 Finally fully fixed from 4.19 Thanks, Minas > > The board is an Odroid U3 (Exynos 4412). > > Andrzej >