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

T5949: Add option to disable USB autosuspend #3677

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Conversation

HollyGurza
Copy link
Contributor

@HollyGurza HollyGurza commented Jun 18, 2024

Change Summary

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

Proposed changes

https://docs.kernel.org/driver-api/usb/power-management.html

By default used the option auto is the normal state in which the kernel is allowed to autosuspend and autoresume the device.

command set system option disable-usb-autosuspend used option on to disallow autosuspend

How to test

set system option disable-usb-autosuspend
commit
cat /etc/udev/rules.d/40-usb-autosuspend.rules

ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="on"

del system option disable-usb-autosuspend
commit
cat /etc/udev/rules.d/40-usb-autosuspend.rules

ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="auto"

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Jun 18, 2024

👍
No issues in PR Title / Commit Title

interface-definitions/system_option.xml.in Outdated Show resolved Hide resolved
@HollyGurza HollyGurza force-pushed the T5949 branch 2 times, most recently from 01b7f43 to 3bc4768 Compare June 18, 2024 07:22
@HollyGurza HollyGurza requested a review from sever-sever June 18, 2024 07:28
@HollyGurza HollyGurza force-pushed the T5949 branch 2 times, most recently from ec102e7 to aede86f Compare June 18, 2024 08:42
@HollyGurza HollyGurza requested a review from Apachez- June 18, 2024 08:53
Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title and the commit messages are wrong, as @Apachez- noted above: the change adds a way to disable USB autosuspend, and doesn't disable it in the system unless the user chooses to.

Please change the title and the commit message to reflect that.

@HollyGurza HollyGurza changed the title T5949: Disable USB autosuspend T5949: Allow to disable USB autosuspend Jun 18, 2024
@HollyGurza HollyGurza changed the title T5949: Allow to disable USB autosuspend T5949: Add option to disable USB autosuspend Jun 18, 2024
@HollyGurza HollyGurza requested a review from dmbaturin June 18, 2024 09:49
@c-po
Copy link
Member

c-po commented Jun 18, 2024

You add the file src/etc/udev/rules.d/40-usb-autosuspend.rules in this commit with explicit content, but also a template which will override that file.

I think you try to "overcome" the issue that the file is not populated during boot-time if there is no CLI node set under set system option.

We already have a solution for this, during system startup the system_option.py helper is already called https://github.com/vyos/vyos-1x/blob/current/src/init/vyos-router#L456 and will thus populate your template.

Please drop the src/etc/udev/rules.d/40-usb-autosuspend.rules file and let everything magically work.

@c-po c-po enabled auto-merge June 20, 2024 10:49
@c-po c-po dismissed sever-sever’s stale review June 20, 2024 10:49

Change was adressed

@c-po c-po merged commit 109e094 into vyos:current Jun 20, 2024
9 checks passed
@c-po
Copy link
Member

c-po commented Jun 22, 2024

@Mergifyio backport circinus sagitta

Copy link
Contributor

mergify bot commented Jun 22, 2024

backport circinus sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request Jun 24, 2024
T5949: Add option to disable USB autosuspend (backport #3677)
@github-actions github-actions bot mentioned this pull request Jun 24, 2024
12 tasks
c-po added a commit that referenced this pull request Jun 24, 2024
T5949: Add option to disable USB autosuspend (backport #3677)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants