On Fri, 2023-03-10 at 22:58 +0000, Thinh Nguyen wrote: > On Fri, Mar 10, 2023, Joakim Tjernlund wrote: > > On Thu, 2023-03-09 at 21:09 +0000, Thinh Nguyen wrote: > > > On Thu, Mar 09, 2023, Joakim Tjernlund wrote: > > > > On Thu, 2023-03-09 at 19:56 +0000, Thinh Nguyen wrote: > > > > > On Thu, Mar 09, 2023, Joakim Tjernlund wrote: > > > > > > On Thu, 2023-03-09 at 17:32 +0100, Joakim Tjernlund wrote: > > > > > > > On Wed, 2023-03-08 at 22:26 +0100, Joakim Tjernlund wrote: > > > > > > > > On Wed, 2023-03-08 at 19:58 +0100, gregkh@xxxxxxxxxxxxxxxxxxx wrote: > > > > > > > > > On Wed, Mar 08, 2023 at 06:12:51PM +0000, Joakim Tjernlund wrote: > > > > > > > > > > On Wed, 2023-03-08 at 18:25 +0100, Greg KH wrote: > > > > > > > > > > > On Wed, Mar 08, 2023 at 05:10:17PM +0000, Joakim Tjernlund wrote: > > > > > > > > > > > > we are using fsl-ls1043a-rdb based design but with a ls1023a SOC and > > > > > > > > > > > > use USB0 in gadget mode running either NCM or RNDIS ethernet on top. > > > > > > > > > > > > > > > > > > > > > > > > When we connect the gadget to a PC(Linux of Windows) over an USB2 hub, > > > > > > > > > > > > networking(NCM or RNDIS) works well. > > > > > > > > > > > > > > > > > > > > > > > > However, when we connect the gadget directly to the PC/laptop which uses USB3 > > > > > > > > > > > > we see something odd: > > > > > > > > > > > > Ping from PC to gadget works. > > > > > > > > > > > > Ping from gadget to laptop does not. However if we also ping from PC at the same time we > > > > > > > > > > > > see gadget to PC start working. > > > > > > > > > > > > Seems like ping from the PC tiggers the gadget to see incoming pkgs somehow. > > > > > > > > > > > > > > > > > > > > > > > > Any idea what might be wrong or how to debug this? > > > > > > > > > > > > Kernel 5.15.87 > > > > > > > > > > > > > > > > > > > > > > 5.15.y is very old, does this also happen on 6.2? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I just tried 6.1.15 and the problem remains, I hope that is close enough ? > > > > > > > > > > > > > > > > > > It's good enough :) > > > > > > > > > > > > > > > > > > Have any logs at all that show any problems? > > > > > > > > > > > > > > > > > No, don't know where to start. There are no errors logged. > > > > > > > > > > > > > > > > > Also, you might want to > > > > > > > > > cc: the dwc3 maintainer... > > > > > > > > > > > > > > > > I thought I did but that look like old info, added Thinh Nguyen now, thanks > > > > > > > > > > > > > > > > Jocke > > > > > > > > > > > > > > > > > > > > > > > > > > thanks, > > > > > > > > > > > > > > > > > > greg k-hj > > > > > > > > > > > > > > > > > > > > > > Found and USBC Dock and connected that between gadget an PC and this also works well. > > > > > > > Seems like a hub, regardless of USB2/USB3, make the usb network function in both directions. > > > > > > > > > > > > > > Found out something interesting, on PC: > > > > > > > cd /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/power # Where my gadget is connected > > > > > > > echo 0 > usb2_hardware_lpm > > > > > > > > > > > > > > Now ping works normally. > > > > > > > > > > > > > > So LPM does not seem to work properly on gadget. Can I disable LPM somehow > > > > > > > on gadget side? > > > > > > > > > > > > > > > > > There's no option in gadget configfs to allow you to do that at the > > > > > moment. You can disable LPM in dwc3 controller in the devicetree with > > > > > "snps,dis_enblslpm_quirk" instead. > > > > > > > > Yes, I found that. Thanks. > > > > > > Also note that LPM is for device operating in usb2 speed. If it's usb3 > > > speeds, then you need to disable U3 suspend. > > Actually, you can't disable U3. The device has to obey the host if it > requests for U3 entry. > > > > > ATM I have: > > snps,dis_enblslpm_quirk; > > snps,dis_u2_susphy_quirk; > > snps,dis_u3_susphy_quirk; > > snps,usb2-gadget-lpm-disable; > > > > That fixes it, I have no need for any LPM/suspend > > Note that adding these 2 won't help if the host send U3 request. > snps,dis_u2_susphy_quirk; > snps,dis_u3_susphy_quirk; > > That's just disabling the phy from going into lower power state. You > need to prevent the host from autosuspending and put the device in U3. > > For usb2 speed, you only need "snps,usb2-gadget-lpm-disable". Just checked with HW and out USB device is only wired for USB2. Jocke