mbox series

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

Message ID 20220609084957.3684698-1-tzungbi@kernel.org (mailing list archive)
Headers show
Series platform/chrome: Kunit tests and refactor for cros_ec_query_all() | expand

Message

Tzung-Bi Shih June 9, 2022, 8:49 a.m. UTC
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/20220608110734.2928245-1-tzungbi@kernel.org/)
- 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/20220607145639.2362750-1-tzungbi@kernel.org/)
- Split patches into smaller pieces.

Changes from v1:
(https://patchwork.kernel.org/project/chrome-platform/cover/20220606141051.285823-1-tzungbi@kernel.org/)
- Fix review comments.
- Split and reorder patches.

Comments

patchwork-bot+chrome-platform@kernel.org June 10, 2022, 2:40 a.m. UTC | #1
Hello:

This series was applied to chrome-platform/linux.git (for-kernelci)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Thu,  9 Jun 2022 08:49:36 +0000 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [v4,01/21] platform/chrome: cros_ec_commands: fix compile errors
    https://git.kernel.org/chrome-platform/c/ea7f0f777d28
  - [v4,02/21] platform/chrome: cros_ec_proto: add Kunit tests for cros_ec_query_all()
    https://git.kernel.org/chrome-platform/c/b99eb596efbd
  - [v4,03/21] platform/chrome: use macros for passthru indexes
    https://git.kernel.org/chrome-platform/c/3db0c9e5de7b
  - [v4,04/21] platform/chrome: cros_ec_proto: assign buffer size from protocol info
    https://git.kernel.org/chrome-platform/c/e796c0c4b1ad
  - [v4,05/21] platform/chrome: cros_ec_proto: remove redundant NULL check
    https://git.kernel.org/chrome-platform/c/8e3991610ba5
  - [v4,06/21] platform/chrome: cros_ec_proto: use cros_ec_map_error()
    https://git.kernel.org/chrome-platform/c/93bea2faed63
  - [v4,07/21] platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info()
    https://git.kernel.org/chrome-platform/c/b4d0836e8160
  - [v4,08/21] platform/chrome: cros_ec_proto: add Kunit tests for getting proto info
    https://git.kernel.org/chrome-platform/c/3e97581ed9a2
  - [v4,09/21] platform/chrome: cros_ec_proto: handle empty payload in getting proto info
    https://git.kernel.org/chrome-platform/c/878c36f6caa4
  - [v4,10/21] platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info_legacy()
    https://git.kernel.org/chrome-platform/c/a88f79666d14
  - [v4,11/21] platform/chrome: cros_ec_proto: add Kunit test for getting legacy info
    https://git.kernel.org/chrome-platform/c/cce5d551809c
  - [v4,12/21] platform/chrome: cros_ec_proto: handle empty payload in getting info legacy
    https://git.kernel.org/chrome-platform/c/d394ab5c062a
  - [v4,13/21] platform/chrome: cros_ec_proto: don't show MKBP version if unsupported
    https://git.kernel.org/chrome-platform/c/b36f0643ff14
  - [v4,14/21] platform/chrome: cros_ec_proto: return 0 on getting cmd mask success
    https://git.kernel.org/chrome-platform/c/f91183aa459a
  - [v4,15/21] platform/chrome: cros_ec_proto: add Kunit test for getting cmd mask error
    https://git.kernel.org/chrome-platform/c/a8f77c63baec
  - [v4,16/21] platform/chrome: cros_ec_proto: check `msg->result` in getting cmd mask
    https://git.kernel.org/chrome-platform/c/ec5134899335
  - [v4,17/21] platform/chrome: cros_ec_proto: add Kunit tests for getting cmd mask
    https://git.kernel.org/chrome-platform/c/8120febafccb
  - [v4,18/21] platform/chrome: cros_ec_proto: handle empty payload in getting cmd mask
    https://git.kernel.org/chrome-platform/c/aac29b04dc3f
  - [v4,19/21] platform/chrome: cros_ec_proto: return 0 on getting wake mask success
    https://git.kernel.org/chrome-platform/c/d65da5f9bb0a
  - [v4,20/21] platform/chrome: cros_ec_proto: add Kunit test for getting wake mask
    https://git.kernel.org/chrome-platform/c/e43772294246
  - [v4,21/21] platform/chrome: cros_ec_proto: handle empty payload in getting wake mask
    https://git.kernel.org/chrome-platform/c/cfed691b80dc

You are awesome, thank you!
patchwork-bot+chrome-platform@kernel.org June 10, 2022, 4:40 a.m. UTC | #2
Hello:

This series was applied to chrome-platform/linux.git (for-next)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Thu,  9 Jun 2022 08:49:36 +0000 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [v4,01/21] platform/chrome: cros_ec_commands: fix compile errors
    https://git.kernel.org/chrome-platform/c/ea7f0f777d28
  - [v4,02/21] platform/chrome: cros_ec_proto: add Kunit tests for cros_ec_query_all()
    https://git.kernel.org/chrome-platform/c/b99eb596efbd
  - [v4,03/21] platform/chrome: use macros for passthru indexes
    https://git.kernel.org/chrome-platform/c/3db0c9e5de7b
  - [v4,04/21] platform/chrome: cros_ec_proto: assign buffer size from protocol info
    https://git.kernel.org/chrome-platform/c/e796c0c4b1ad
  - [v4,05/21] platform/chrome: cros_ec_proto: remove redundant NULL check
    https://git.kernel.org/chrome-platform/c/8e3991610ba5
  - [v4,06/21] platform/chrome: cros_ec_proto: use cros_ec_map_error()
    https://git.kernel.org/chrome-platform/c/93bea2faed63
  - [v4,07/21] platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info()
    https://git.kernel.org/chrome-platform/c/b4d0836e8160
  - [v4,08/21] platform/chrome: cros_ec_proto: add Kunit tests for getting proto info
    https://git.kernel.org/chrome-platform/c/3e97581ed9a2
  - [v4,09/21] platform/chrome: cros_ec_proto: handle empty payload in getting proto info
    https://git.kernel.org/chrome-platform/c/878c36f6caa4
  - [v4,10/21] platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info_legacy()
    https://git.kernel.org/chrome-platform/c/a88f79666d14
  - [v4,11/21] platform/chrome: cros_ec_proto: add Kunit test for getting legacy info
    https://git.kernel.org/chrome-platform/c/cce5d551809c
  - [v4,12/21] platform/chrome: cros_ec_proto: handle empty payload in getting info legacy
    https://git.kernel.org/chrome-platform/c/d394ab5c062a
  - [v4,13/21] platform/chrome: cros_ec_proto: don't show MKBP version if unsupported
    https://git.kernel.org/chrome-platform/c/b36f0643ff14
  - [v4,14/21] platform/chrome: cros_ec_proto: return 0 on getting cmd mask success
    https://git.kernel.org/chrome-platform/c/f91183aa459a
  - [v4,15/21] platform/chrome: cros_ec_proto: add Kunit test for getting cmd mask error
    https://git.kernel.org/chrome-platform/c/a8f77c63baec
  - [v4,16/21] platform/chrome: cros_ec_proto: check `msg->result` in getting cmd mask
    https://git.kernel.org/chrome-platform/c/ec5134899335
  - [v4,17/21] platform/chrome: cros_ec_proto: add Kunit tests for getting cmd mask
    https://git.kernel.org/chrome-platform/c/8120febafccb
  - [v4,18/21] platform/chrome: cros_ec_proto: handle empty payload in getting cmd mask
    https://git.kernel.org/chrome-platform/c/aac29b04dc3f
  - [v4,19/21] platform/chrome: cros_ec_proto: return 0 on getting wake mask success
    https://git.kernel.org/chrome-platform/c/d65da5f9bb0a
  - [v4,20/21] platform/chrome: cros_ec_proto: add Kunit test for getting wake mask
    https://git.kernel.org/chrome-platform/c/e43772294246
  - [v4,21/21] platform/chrome: cros_ec_proto: handle empty payload in getting wake mask
    https://git.kernel.org/chrome-platform/c/cfed691b80dc

You are awesome, thank you!