Skip to content

platform/chrome: Kunit tests and refactor for cros_ec_query_all()

Tzung-Bi Shih chrome-platform lkml 4 versions – Applied

Status from this message: This series was applied to chrome-platform/linux.git (for-kernelci)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest21 patches 0 repliesApplied 21/21
  2. v323 patches 18 repliesSuperseded
  3. v215 patches 12 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v113 patches21 repliesSuperseded

Changes in v4 from the cover letter

(https://patchwork.kernel.org/project/chrome-platform/cover/[email protected]/)
- Drop 2 patches regarding din and dout. One of them crashes kernel.
- Fix typo in commit message.

Patches in v4 All 21 applied

#Subject and filesSizeRepliesApplied
1/21platform/chrome: cros_ec_commands: fix compile errorsinclude/linux/platform_data/cros_ec_commands.h+2 -20 repliesApplied
2/21platform/chrome: cros_ec_proto: add Kunit tests for cros_ec_query_all()drivers/platform/chrome/Kconfig drivers/platform/chrome/Makefile drivers/platform/chrome/cros_ec_proto_test.c +2 more+943 -00 repliesApplied
3/21platform/chrome: use macros for passthru indexesdrivers/platform/chrome/cros_ec.c drivers/platform/chrome/cros_ec_proto.c drivers/platform/chrome/cros_ec_proto_test.c +2 more+20 -150 repliesApplied
4/21platform/chrome: cros_ec_proto: assign buffer size from protocol infodrivers/platform/chrome/cros_ec_proto.c+2 -60 repliesApplied
5/21platform/chrome: cros_ec_proto: remove redundant NULL checkdrivers/platform/chrome/cros_ec_proto.c+0 -30 repliesApplied
6/21platform/chrome: cros_ec_proto: use cros_ec_map_error()drivers/platform/chrome/cros_ec_proto.c+4 -50 repliesApplied
7/21platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info()drivers/platform/chrome/cros_ec_proto.c drivers/platform/chrome/cros_ec_proto_test.c+93 -970 repliesApplied
8/21platform/chrome: cros_ec_proto: add Kunit tests for getting proto infodrivers/platform/chrome/cros_ec_proto_test.c+132 -00 repliesApplied
9/21platform/chrome: cros_ec_proto: handle empty payload in getting proto infodrivers/platform/chrome/cros_ec_proto.c+5 -00 repliesApplied
10/21platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info_legacy()drivers/platform/chrome/cros_ec_proto.c drivers/platform/chrome/cros_ec_proto_test.c+44 -500 repliesApplied
11/21platform/chrome: cros_ec_proto: add Kunit test for getting legacy infodrivers/platform/chrome/cros_ec_proto_test.c+49 -00 repliesApplied
12/21platform/chrome: cros_ec_proto: handle empty payload in getting info legacydrivers/platform/chrome/cros_ec_proto.c+9 -30 repliesApplied
13/21platform/chrome: cros_ec_proto: don't show MKBP version if unsupporteddrivers/platform/chrome/cros_ec_proto.c+4 -40 repliesApplied
14/21platform/chrome: cros_ec_proto: return 0 on getting cmd mask successdrivers/platform/chrome/cros_ec_proto.c+5 -80 repliesApplied
15/21platform/chrome: cros_ec_proto: add Kunit test for getting cmd mask errordrivers/platform/chrome/cros_ec_proto_test.c+89 -00 repliesApplied
16/21platform/chrome: cros_ec_proto: check `msg->result` in getting cmd maskdrivers/platform/chrome/cros_ec_proto.c+13 -80 repliesApplied
17/21platform/chrome: cros_ec_proto: add Kunit tests for getting cmd maskdrivers/platform/chrome/cros_ec_proto_test.c+197 -00 repliesApplied
18/21platform/chrome: cros_ec_proto: handle empty payload in getting cmd maskdrivers/platform/chrome/cros_ec_proto.c+5 -00 repliesApplied
19/21platform/chrome: cros_ec_proto: return 0 on getting wake mask successdrivers/platform/chrome/cros_ec_proto.c+2 -10 repliesApplied
20/21platform/chrome: cros_ec_proto: add Kunit test for getting wake maskdrivers/platform/chrome/cros_ec_proto_test.c+128 -00 repliesApplied
21/21platform/chrome: cros_ec_proto: handle empty payload in getting wake maskdrivers/platform/chrome/cros_ec_proto.c+14 -100 repliesApplied

Reviews trailers per patch

All 21 patches have a Reviewed-by or Acked-by.

PatchGuenter Roeck
1/21R-b
2/21R-b
3/21R-b
4/21R-b
5/21R-b
6/21R-b
7/21R-b
8/21R-b
9/21R-b
10/21R-b
11/21R-b
12/21R-b
13/21R-b
14/21R-b
15/21R-b
16/21R-b
17/21R-b
18/21R-b
19/21R-b
20/21R-b
21/21R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/21] platform/chrome: Kunit tests and refactor for cros_ec_query_all()

The series adds Kunit tests, refactors, and clean-ups for cros_ec_query_all().

Tzung-Bi Shih (21):
platform/chrome: cros_ec_commands: fix compile errors
-> Fixes compile errors when including cros_ec_commands.h.

platform/chrome: cros_ec_proto: add Kunit tests for

    cros_ec_query_all()

-> Adds Kunit tests for cros_ec_query_all(). They are baseline tests
for the following refactor patches. They are designed to pass current code.

platform/chrome: use macros for passthru indexes platform/chrome: cros_ec_proto: assign buffer size from protocol info
-> Refactors.

platform/chrome: cros_ec_proto: remove redundant NULL check
-> Clean up.

platform/chrome: cros_ec_proto: use cros_ec_map_error()
-> Changes the internal return code.

platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info()
-> Move refactor.

platform/chrome: cros_ec_proto: add Kunit tests for getting proto info platform/chrome: cros_ec_proto: handle empty payload in getting proto
info
-> Test and handle if send_command() returns 0 in cros_ec_get_proto_info().

platform/chrome: cros_ec_proto: separate
cros_ec_get_proto_info_legacy()
-> Move refactor.

platform/chrome: cros_ec_proto: add Kunit test for getting legacy info platform/chrome: cros_ec_proto: handle empty payload in getting info
legacy
-> Test and handle if send_command() returns 0 in
cros_ec_get_proto_info_legacy().

platform/chrome: cros_ec_proto: don't show MKBP version if unsupported
-> Minor fix up.

platform/chrome: cros_ec_proto: return 0 on getting cmd mask success
-> Conform to kernel convention: return 0 on success;
otherwise, negative integers.

platform/chrome: cros_ec_proto: add Kunit test for getting cmd mask
error
platform/chrome: cros_ec_proto: check msg->result in getting cmd
mask
-> Test and handle if msg->result isn't EC_RES_SUCCESS in
cros_ec_get_host_command_version_mask().

platform/chrome: cros_ec_proto: add Kunit tests for getting cmd mask platform/chrome: cros_ec_proto: handle empty payload in getting cmd
mask
-> Test and handle if send_command() returns 0 in
cros_ec_get_host_command_version_mask().

platform/chrome: cros_ec_proto: return 0 on getting wake mask success
-> Conform to kernel convention: return 0 on success;
otherwise, negative integers.

platform/chrome: cros_ec_proto: add Kunit test for getting wake mask platform/chrome: cros_ec_proto: handle empty payload in getting wake
mask
-> Test and handle if send_command() returns 0 in
cros_ec_get_host_event_wake_mask().

 drivers/platform/chrome/Kconfig               |    6 +
 drivers/platform/chrome/Makefile              |    1 +
 drivers/platform/chrome/cros_ec.c             |    3 -
 drivers/platform/chrome/cros_ec_proto.c       |  291 ++--
 drivers/platform/chrome/cros_ec_proto_test.c  | 1402 +++++++++++++++++
 drivers/platform/chrome/cros_ec_trace.h       |    8 +-
 drivers/platform/chrome/cros_kunit_util.c     |   98 ++
 drivers/platform/chrome/cros_kunit_util.h     |   36 +
 .../linux/platform_data/cros_ec_commands.h    |    4 +-
 include/linux/platform_data/cros_ec_proto.h   |    3 +
 10 files changed, 1700 insertions(+), 152 deletions(-)
 create mode 100644 drivers/platform/chrome/cros_kunit_util.c
 create mode 100644 drivers/platform/chrome/cros_kunit_util.h

Changes from v3:
(https://patchwork.kernel.org/project/chrome-platform/cover/[email protected]/)
- Drop 2 patches regarding din and dout. One of them crashes kernel.
- Fix typo in commit message.

Changes from v2:
(https://patchwork.kernel.org/project/chrome-platform/cover/[email protected]/)
- Split patches into smaller pieces.

Changes from v1:
(https://patchwork.kernel.org/project/chrome-platform/cover/[email protected]/)
- Fix review comments.
- Split and reorder patches.

Signature · 1 line
2.36.1.255.ge46751e96f-goog