From: Mark Brown <broonie@xxxxxxxxxx> Sent: Friday, April 4, 2025 7:03 PM > >On Fri, Apr 04, 2025 at 03:40:06PM +0200, Johann Neuhauser wrote: >> This series adds support for regulator event reporting via uevents to the >> userspace-consumer regulator driver. The goal is to provide userspace with >> a straightforward mechanism to monitor and respond to important regulator >> events such as overcurrent conditions, voltage changes, and enable/disable >> transitions. > >This sounds like you're trying to use userspace-consumer in production >rather than as a test bodge... what's the actual use case here? Hi Mark, Thank you for your feedback and question. We have a hardware setup where the USB-A port is directly connected (D+/D- lines) to the SoC, while its VBUS line is driven by an external I²C-based PMIC. If a connected USB device attempts to draw more than approximately 800mA, the PMIC detects an overcurrent condition, automatically disables the output, and communicates an overcurrent event via the regulator framework. Currently, the generic USB HCD drivers lack a built-in mechanism for handling or recovering from such regulator-related events, particularly for reporting or re-enabling regulator outputs after an OC condition occurs. The DA8xx OHCI driver is one exception, as it indeed provides such functionality, but integrating similar support into the generic USB HCD drivers seemed unlikely to be accepted upstream. I came across the userspace-consumer driver and believed it could help manage this specific scenario. With this driver, I was able to manually toggle the regulator off and back on, successfully clearing the error state. However, the driver lacked proper event reporting, making it difficult to identify when the regulator had entered an error state. Therefore, I proposed adding regulator event reporting to enable userspace to detect these regulator events via udev rules and subsequently restore regular USB power operation. While I was aware that using the userspace-consumer driver might be seen as somewhat of a workaround for special cases, I did not fully consider that it was intended primarily as a temporary testing solution and perhaps not suitable for this kind of production usage. I'd be grateful for any suggestions or advice you might have on the appropriate approach or alternative solutions you could recommend for upstream integration. Thanks for again your input and guidance! Best regards, Johann