> Peter Chen writes: > > That's very strange, that means the SoC doesn't know VBUS fails down after > detaching from the host. > > You could measure the VBUS value at the board, then read the VBUS value at > register to confirm it. > > I have put a scope on VBUS. With kernel 4.9 after detaching, it discharges > all the > way down to about 500 mV, with 4.19 this discharging stops after about 4 > seconds > at about 2.4V and remains there. >
I suspect it is not related to USB, would you please disable USB node at DTS to measure again? > > I just tried my board (imx6sx-sdb), it worked OK at at v5.2-rc5. If > > you have memtool (the tool to read physical memory), you could read > > register OTGSC at that time using below command: > > It's already part of /sys/kernel/debug/ci_hdrc.0/registers, but reading from > its > memory address works equally well. > > 0x021841A4: 09242F20 > Yup, I have 021841a4: 09240f20, which only differs by TOG_1MS. > > > # cable detach > > 0x021841A4: 09341120 > 021841a4: 09340d20 > With BSV reflecting the stopped discharge. > > > You could poll the /sys/class/udc/ci_hdrc.0/state to know the connection. > > > > root@imx6qpdlsolox:~# [ 230.074850] configfs-gadget gadget: > > high-speed config #1: c > > > > root@imx6qpdlsolox:~# cat /sys/class/udc/ci_hdrc.0/state <=== cable > > attached configured root@imx6qpdlsolox:~# cat > > /sys/class/udc/ci_hdrc.0/state <=== cable detached not attached > > Good to know. The latter turns out as "suspended", though. > Yes, the bus is "suspended" due to there is no SoF within 3ms, but the disconnection is not detected due to VBUS is still higher than BSV. Peter