How to reset a SOC usb hub from snap

In a normal linux distro, I would use /sys/bus/usb/devices/usb3/authorized to re-init a usb hub, thereby re-enumerating all the devices. Is there a way that I could do that from a snap?

The reason behind the question is a modem that is behaving badly at startup. Not properly enumerating perhaps due to power-on sequencing. It is a pcie modem that uses the usb bus. From the command line two options are available for re-enumerating. Using the authorized trick, or simply reading the contents of /dev/bus/usb/003/001. Unfortunately that is also not available from inside a snap. “Permission denied” etc.

I have tried solutions like usb-reset, but that caters more for devices than usb hubs. Concerning /dev/bus/usb, even usbutils-lool.usbhid-dump gives the “Permission denied” message for accessing it.

you will likely have to use the raw-usb interface in your snap (and connect it using snap connect ...) to gain access to /sys/bus/usb/devices …

Thanks @ogra . I was under a wrong impression that usb-raw would only allow usb activities through something like libusb. Unfortunately it looks like the authorized file is only writable by root, and I suspect most snaps will not be running with root privileges. Time to go hack the kernel for our device…