New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 869335 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 841121



Sign in to add a comment

servod: clean up RPC calls in favor of drv/config model

Project Member Reported by coconutruben@chromium.org, Jul 31

Issue description

This is a tracker bug for the efforts described at go/simpleservo
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/9548333e016102204eb0d46714acecd5d65b66fc

commit 9548333e016102204eb0d46714acecd5d65b66fc
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Thu Aug 02 20:53:28 2018

servod: add README & FAQ

This adds

- README explaining as a small introduction how servod is structured,
to aid making modifications to servod.

- FAQ answering a couple basic questions that frequently come up
regarding servod & servod configurations

BUG=chromium:869335
TEST=renders as expected on gitiles

Change-Id: I71c7090dfbfa7efe6ded3b102a4c9890410594e0
Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1156424
Reviewed-by: Mengqi Guo <mqg@chromium.org>

[add] https://crrev.com/9548333e016102204eb0d46714acecd5d65b66fc/servo/control_flow.png
[add] https://crrev.com/9548333e016102204eb0d46714acecd5d65b66fc/servo/FAQ.md
[add] https://crrev.com/9548333e016102204eb0d46714acecd5d65b66fc/servo/README.md

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 29

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/0f467941c6224dcd30e986ecb45ceac8cc87390f

commit 0f467941c6224dcd30e986ecb45ceac8cc87390f
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Wed Aug 29 18:15:31 2018

servod: remove keyboard servod functions in favor of keyboard drv

This CL is an intermediate step. It sets everything up with the keyboard
driver model, but leaves the RPC calls in place, to avoid breaking
auototest. After autotest is migrated to using the drv interface, the
RPCs will be removed.

BUG=chromium:869335
TEST=manual testing, dut-control versions seem to do their job

Change-Id: I081e7104dabb4c601929829ea33ff2f0b16b7e37
Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1158322
Reviewed-by: Todd Broch <tbroch@chromium.org>

[modify] https://crrev.com/0f467941c6224dcd30e986ecb45ceac8cc87390f/servo/keyboard_handlers.py
[modify] https://crrev.com/0f467941c6224dcd30e986ecb45ceac8cc87390f/servo/servo_server.py
[modify] https://crrev.com/0f467941c6224dcd30e986ecb45ceac8cc87390f/servo/drv/kb.py
[modify] https://crrev.com/0f467941c6224dcd30e986ecb45ceac8cc87390f/servo/data/keyboard.xml

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 29

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/a26406596778d15f0836681850a51867a9b2e843

commit a26406596778d15f0836681850a51867a9b2e843
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Wed Aug 29 18:15:40 2018

servod: HwDriver logger named after driver class

This change names the driver loggers after their actual class, instead
of simply 'Driver'.

BUG=chromium:869335
TEST=seems to work fine

Change-Id: I933b9cfad90955770c3ac1f10354316310061889
Reviewed-on: https://chromium-review.googlesource.com/1162096
Commit-Ready: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Tested-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>

[modify] https://crrev.com/a26406596778d15f0836681850a51867a9b2e843/servo/drv/hw_driver.py

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 29

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/f0c9630870e49ed6ce843a5dd221211f3a492dfc

commit f0c9630870e49ed6ce843a5dd221211f3a492dfc
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Wed Aug 29 18:16:01 2018

servod: breaking out UsbHierarchy logic from postinit into utility

The logic inside UsbHierarchy is more generally useful for servod so
this breaks it out into a servodutil file.

BUG=chromium:869335
TEST=servo v4 still starts

Change-Id: I5f7accb34e57a1dd15c90900299fec917606a6a8
Reviewed-on: https://chromium-review.googlesource.com/1162098
Commit-Ready: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Tested-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>

[modify] https://crrev.com/f0c9630870e49ed6ce843a5dd221211f3a492dfc/servo/servo_postinit.py
[add] https://crrev.com/f0c9630870e49ed6ce843a5dd221211f3a492dfc/servo/servodutil.py

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 30

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/072013316fe8ccc8425e66de3ec59492d76c4178

commit 072013316fe8ccc8425e66de3ec59492d76c4178
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Thu Aug 30 16:53:11 2018

servo: pull ftdii2c commands into servod drv structure

This CL removes the special casing from ftdii2c controls in servod
by creating a drv for them & a config file.

This reduces code complexity in dut-control & servo_server, and reduces the
number of exposed rpcs. Lastly, these controls are only relevant for
servo v2. This only includes them in the servo v2 scenario. Lastly, it
doesn't crash the servod instance if an error occurs.

BUG=chromium:869335
TEST=manual testing servo v2
dut-control ftdii2c_cmd:close
dut-control ftdii2c_cmd:init
dut-control ftdii2c_cmd:open
no errors reported

Change-Id: I01548a5ebb92150a8cf0ca1773412e5663b42508
Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1156425
Tested-by: Matthew Blecker <matthewb@chromium.org>
Reviewed-by: Matthew Blecker <matthewb@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>

[modify] https://crrev.com/072013316fe8ccc8425e66de3ec59492d76c4178/servo/dut_control.py
[modify] https://crrev.com/072013316fe8ccc8425e66de3ec59492d76c4178/servo/servo_server.py
[add] https://crrev.com/072013316fe8ccc8425e66de3ec59492d76c4178/servo/drv/ftdii2c_cmd.py
[add] https://crrev.com/072013316fe8ccc8425e66de3ec59492d76c4178/servo/data/ftdii2c_cmd.xml
[modify] https://crrev.com/072013316fe8ccc8425e66de3ec59492d76c4178/servo/drv/__init__.py
[modify] https://crrev.com/072013316fe8ccc8425e66de3ec59492d76c4178/servo/data/servo_v2_r0.xml

Project Member

Comment 6 by bugdroid1@chromium.org, Aug 31

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/a127ae219416e6352aafaf2498299715047852e1

commit a127ae219416e6352aafaf2498299715047852e1
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Fri Aug 31 18:20:07 2018

flash_ec: leverage new ftdii2c_cmd interface for ite flash

This adopts the change to the ftdii2c controls

CQ-DEPEND=CL:1156425

BRANCH=None
BUG=chromium:869335
TEST=None

Change-Id: Ic5c5dbf0404db354834e1148e527353667ec25f9
Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1186385
Tested-by: Matthew Blecker <matthewb@chromium.org>
Reviewed-by: Matthew Blecker <matthewb@chromium.org>

[modify] https://crrev.com/a127ae219416e6352aafaf2498299715047852e1/util/flash_ec

Project Member

Comment 7 by bugdroid1@chromium.org, Sep 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/00cda74112247ffa6f08e07a8f513cf7bf67317c

commit 00cda74112247ffa6f08e07a8f513cf7bf67317c
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Sat Sep 15 00:06:05 2018

servod: fix missing ctrl_key keyboard handler ctrl

This adds the missing control key for servod.

BUG=chromium:869335
TEST=None yet

Change-Id: Id0125e0ce0d8bd70dcf41d3d2f17a93027be0d4f
Reviewed-on: https://chromium-review.googlesource.com/1220846
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>

[modify] https://crrev.com/00cda74112247ffa6f08e07a8f513cf7bf67317c/servo/data/keyboard.xml

Project Member

Comment 8 by bugdroid1@chromium.org, Sep 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/247d88f5802047f8c7690c979a7f861475b854b8

commit 247d88f5802047f8c7690c979a7f861475b854b8
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Sun Sep 16 11:04:28 2018

servod: add usb image management logic

This is the first CL in a sequence of CLs (that are to be considered one
change really) to move the usb image management logic into a driver.

This CL introduces two common aliases on V2 and V4:
image_usbkey_mux
image_usbkey_pwr

It also introduces the usb_image_management driver that can safely
switch the direction of the image_usbkey by power-cycling before
switching.

BUG=chromium:869335
TEST=works on v2, v3 & v4 as expected

Change-Id: Ia242143f5b859bf8b68e264a7edd519b25d4e878
Reviewed-on: https://chromium-review.googlesource.com/1162097
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>

[modify] https://crrev.com/247d88f5802047f8c7690c979a7f861475b854b8/servo/data/servo_v3_r0.xml
[modify] https://crrev.com/247d88f5802047f8c7690c979a7f861475b854b8/servo/servo_server.py
[add] https://crrev.com/247d88f5802047f8c7690c979a7f861475b854b8/servo/drv/usb_image_manager.py
[modify] https://crrev.com/247d88f5802047f8c7690c979a7f861475b854b8/servo/data/servo_v4.xml
[modify] https://crrev.com/247d88f5802047f8c7690c979a7f861475b854b8/servo/drv/__init__.py
[add] https://crrev.com/247d88f5802047f8c7690c979a7f861475b854b8/servo/data/usb_image_management.xml
[modify] https://crrev.com/247d88f5802047f8c7690c979a7f861475b854b8/servo/data/servo_v2_r0.xml

Project Member

Comment 9 by bugdroid1@chromium.org, Sep 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/68958f8cda155a2765d7af7872c8a32cfe604ca6

commit 68958f8cda155a2765d7af7872c8a32cfe604ca6
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Sun Sep 16 11:04:28 2018

servod: new logic to get device file for image_usbkey

This change pulls the logic out of servo_server into the new
image_manager driver.

The new logic relies on the fact that the port number on the servo hub
is constant. So the flow is:
- find the servo device's /sys/bus/usb path
- replace the port number of the servo device with the usb port's
- check if that path exists
- if it exists get the realpath to see a hw device path name
- iterate over all devices in /sys/block
  - if the realpath (hw device path) of one of these starts with
    the realpath from our usb device that's the /dev/ device.
- ensure the device exists before returning

This improves on the previous logic as it does not require power cycling
of the usb port, thus also doesn't need to block other servods.

BUG=chromium:869335
TEST=manual on servod
dut-control image_usbkey_direction:servo_sees_usbkey
dut-control image_usbkey_dev
> /dev/sdb
(unplug stick)
dut-control image_usbkey_dev
> ''
(plug stick back in)
dut-control image_usbkey_dev
> /dev/sdb
dut-control image_usbkey_direction:servo_sees_usbkey
dut-control image_usbkey_dev
> ''

This works on v2, v3, and v4

Change-Id: I4158e886bdafb7eeb124808eeaddde5ed864544e
Reviewed-on: https://chromium-review.googlesource.com/1162099
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>

[modify] https://crrev.com/68958f8cda155a2765d7af7872c8a32cfe604ca6/servo/data/servo_v3_r0.xml
[modify] https://crrev.com/68958f8cda155a2765d7af7872c8a32cfe604ca6/servo/servo_server.py
[modify] https://crrev.com/68958f8cda155a2765d7af7872c8a32cfe604ca6/servo/drv/usb_image_manager.py
[modify] https://crrev.com/68958f8cda155a2765d7af7872c8a32cfe604ca6/servo/data/servo_v2_r1.xml
[modify] https://crrev.com/68958f8cda155a2765d7af7872c8a32cfe604ca6/servo/data/servo_v4.xml

Project Member

Comment 10 by bugdroid1@chromium.org, Sep 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/4e00f0eeafba92b0076c85c87a4644d4f93c5735

commit 4e00f0eeafba92b0076c85c87a4644d4f93c5735
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Wed Sep 19 15:59:23 2018

servod: move image download logic to usb_image_manager driver

This move the logic almost verbatim from servo_server.py to
the new driver. The changes are to:
- Raise an Exception instead of returning False as for a Set control
that's the way to indicate an error
- explicitly check after transfer if the device is still attached as
shutil.copy fails silently
- invalidate the cache-path on any errors or if the usb device cannot be
found
- reorganize the Exceptions to not let IOError cover too much

BUG=chromium:869335
TEST=dut-control download_image_to_usb_dev:/path/to/image.bin
(wait for a while)
(unplug & plug into chromebook)
boots fine

Change-Id: I62d6c8b00017b23635ef4f5219ed482820faef94
Reviewed-on: https://chromium-review.googlesource.com/1162100
Commit-Ready: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Tested-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>

[modify] https://crrev.com/4e00f0eeafba92b0076c85c87a4644d4f93c5735/servo/servo_server.py
[modify] https://crrev.com/4e00f0eeafba92b0076c85c87a4644d4f93c5735/servo/drv/usb_image_manager.py
[modify] https://crrev.com/4e00f0eeafba92b0076c85c87a4644d4f93c5735/servo/data/usb_image_management.xml

Project Member

Comment 11 by bugdroid1@chromium.org, Sep 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/1a3a7ecedb27a3c874dd3486a75753edd457d3e6

commit 1a3a7ecedb27a3c874dd3486a75753edd457d3e6
Author: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Date: Wed Sep 19 15:59:23 2018

servod: move make_image_noninteractive logic into usb_image_manager drv

This CL concludes the migration of the usb image management code into
its own driver by moving the make_image_noninteractive logic into the
driver. This can now be used by calling
dut-control make_usb_dev_image_noninteractive
RPC call still left in that for autotest API compliance.

BUG=chromium:869335
TEST=manual on servod
dut-control image_usbkey_dev
> /dev/sdb
dut-control make_usb_dev_image_noninteractive:/dev/sdb1
mkdir test
sudo mount -t ext4 /dev/sdb1 test/
ls test | grep non_interactive
> non_interactive

Change-Id: I4ba281229951466880c5230137c20cacb15ea1d8
Reviewed-on: https://chromium-review.googlesource.com/1163041
Commit-Ready: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Tested-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>

[modify] https://crrev.com/1a3a7ecedb27a3c874dd3486a75753edd457d3e6/servo/servo_server.py
[modify] https://crrev.com/1a3a7ecedb27a3c874dd3486a75753edd457d3e6/servo/drv/usb_image_manager.py
[modify] https://crrev.com/1a3a7ecedb27a3c874dd3486a75753edd457d3e6/servo/data/usb_image_management.xml

Components: Tools>ChromeOSDebugBoards

Sign in to add a comment