Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest to use udev for loading sg #87

Open
frosteyes opened this issue Jan 28, 2025 · 3 comments · Fixed by #88
Open

Suggest to use udev for loading sg #87

frosteyes opened this issue Jan 28, 2025 · 3 comments · Fixed by #88

Comments

@frosteyes
Copy link

In the documentation it is suggested that sg is loaded using /etc/modules if it is not loaded when a mux is connected.
https://linux-automation.com/usbsdmux-M01/product-troubleshooting.html

Instead of always loading it - just use udev with a rule like below.
A udev rules is already created for plugdev - so just add it.

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0424", ATTRS{idProduct}=="4041", RUN{builtin}+="kmod load sg"

hnez added a commit to hnez/usbsdmux that referenced this issue Jan 29, 2025
We never got around to figuring out why the `sg` module is auto-loaded on
some systems/distributions (e.g. Debian) but not on others (e.g. Arch).
We have since used workarounds like adding `sg` to `/etc/modules`.

Instead just use udev to load the module if a new USB-SD-Mux is connected,
as suggested by @frosteyes in [1].

[1]: linux-automation#87

Signed-off-by: Leonard Göhrs <[email protected]>
@hnez
Copy link
Member

hnez commented Jan 29, 2025

Hi @frosteyes,

thanks for the suggestion! I've opened #88, which adds this change to contrib/udev/99-usbsdmux.rules, which we already recommend to install in the README.

The USB vendor and product IDs are not unique to the USB-SD-Mux, since they are the defaults for the SD Card reader IC we use on the USB-SD-Mux, so I've decided to match on ATTRS{manufacturer}=="Linux Automation GmbH", ATTRS{product}=="usb-sd-mux*" instead.

@frosteyes
Copy link
Author

Hi @hnez

Thanks for quick reply, and cool with your patch. And good point with the matching ATTRS.
Will test it on Gentoo.

hnez added a commit to hnez/usbsdmux that referenced this issue Jan 30, 2025
We never got around to figuring out why the `sg` module is auto-loaded on
some systems/distributions (e.g. Debian) but not on others (e.g. Arch).
We have since used workarounds like adding `sg` to `/etc/modules`.

Instead just use udev to load the module if a new USB-SD-Mux is connected,
as suggested by @frosteyes in [1].

[1]: linux-automation#87

Signed-off-by: Leonard Göhrs <[email protected]>
@SmithChart
Copy link
Member

I'll repoen this issue until I've updated the manual for the USB-SD-Mux.

@SmithChart SmithChart reopened this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants