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

runtime switching of the USB Mass Storage function #226

Merged
merged 5 commits into from
Dec 1, 2022

Conversation

chombourger
Copy link
Collaborator

No description provided.

@chombourger chombourger added this to the 0.17 milestone Mar 4, 2022
@jan-kiszka
Copy link
Contributor

This also seems to address at least some aspects of #223.

@chombourger
Copy link
Collaborator Author

This also seems to address at least some aspects of #223.

right. will look at the other issues you have found

@chombourger
Copy link
Collaborator Author

seeing some sporadic hangs in _stop_composite. need to debug this further

@chombourger chombourger mentioned this pull request Mar 6, 2022
@chombourger chombourger removed the check label Mar 6, 2022
@ricbha
Copy link
Contributor

ricbha commented Mar 10, 2022

@chombourger Following issue is observed with the deb file provided by you:

mtda@mtda:~$ sudo mtda-cli target on
# debug3: main.load_timeouts_config()
# debug3: main.load_timeouts_config: None

mtda@mtda:~$ sudo mtda-cli target off
# debug3: main.load_timeouts_config()
# debug3: main.load_timeouts_config: None
Traceback (most recent call last):
  File "/usr/bin/mtda-cli", line 825, in <module>
    app.main()
  File "/usr/bin/mtda-cli", line 814, in main
    status = cmds[cmd](stuff)
  File "/usr/bin/mtda-cli", line 694, in target_cmd
    return cmds[cmd](args)
  File "/usr/bin/mtda-cli", line 651, in target_off
    status = self.client().target_off()
  File "/usr/lib/python3/dist-packages/mtda/client.py", line 309, in target_off
    return self._impl.target_off(self._session)
  File "/usr/lib/python3/dist-packages/zerorpc/core.py", line 278, in <lambda>
    return lambda *args, **kargs: self(method, *args, **kargs)
  File "/usr/lib/python3/dist-packages/zerorpc/core.py", line 270, in __call__
    return self._process_response(request_event, bufchan, timeout)
  File "/usr/lib/python3/dist-packages/zerorpc/core.py", line 227, in _process_response
    reply_event = bufchan.recv(timeout=timeout)
  File "/usr/lib/python3/dist-packages/zerorpc/channel.py", line 255, in recv
    event = self._input_queue.get(timeout=timeout)
  File "src/gevent/queue.py", line 334, in gevent._gevent_cqueue.Queue.get
  File "src/gevent/queue.py", line 349, in gevent._gevent_cqueue.Queue.get
  File "src/gevent/queue.py", line 326, in gevent._gevent_cqueue.Queue.__get_or_peek
    SimpleQueue = _PySimpleQueue
  File "src/gevent/_waiter.py", line 151, in gevent._gevent_c_waiter.Waiter.get
  File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_greenlet_primitives.py", line 65, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_gevent_c_greenlet_primitives.pxd", line 35, in gevent._gevent_c_greenlet_primitives._greenlet_switch
zerorpc.exceptions.LostRemote: Lost remote after 40s heartbeat

The RX thread may receive an exception while the main thread is
pausing consoles (e.g. while powering off the DUT). Check the
rx_active event in the reset code before re-opening the console.

Signed-off-by: Cedric Hombourger <[email protected]>
Prepare support for runtime enabling/disabling of USB functions
and no longer check whether the emulated serial device exists
in probe() since it will be created later.

Signed-off-by: Cedric Hombourger <[email protected]>
Prepare support for runtime enabling/disabling of USB functions
and no longer check whether the emulated HID device exists in
probe() since it will be created later.

Signed-off-by: Cedric Hombourger <[email protected]>
Re-create USB functions that are needed from target_on() and
uninstall all of them from target_off().

Closes: siemens#214
Signed-off-by: Cedric Hombourger <[email protected]>
@chombourger chombourger merged commit fb621b7 into siemens:master Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants