Hacker News new | past | comments | ask | show | jobs | submit login

The USB2.0 ports are driven by an ip block called dwc2. It's always been a potato. I suppose it was designed for ancient phones that mainly needed it to be as device(aka gadgets) to other usb hosts (eg: a phone connected to a computer, where dwc2 was inside a phone), it just happened that it had this feature called OTG (which is a fancy way to say you can reverse the data direction, so you have host capabilities as well). Because these host capabilities were an after thought (pretty much designed only for flash drives at most) for a niche feature of a phone, it wasn't ever implemented properly.

Another fun thing that happens is that a lot of DWC2's functionality has to be delegated to software instead of the fast hardware. In USB the host needs to send out a packet toward to devices every 1ms. In other USB implementations this happens in the background, driver/kernel doesn't even get notified about it until there's something interesting to do. In DWC2, every 1ms the driver has to do some work, I think it even has to handle 8 interrupts per 1ms. You'll notice that whenever you have any usb device connected, and you `cat /proc/interrupts` you'll probably see a steady increase of 8000/second, this is not normal.

On higher speed hardware like the rk3288, DWC2 doesn't use that much CPU, but for the lower power RPI cpu, this is a significant amount.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: