]> www.infradead.org Git - users/jedix/linux-maple.git/commit
accel/habanalabs/gaudi2: use single function to compare FW versions
authorOhad Sharabi <osharabi@habana.ai>
Wed, 10 Jan 2024 12:27:44 +0000 (14:27 +0200)
committerOfir Bitton <obitton@habana.ai>
Sun, 23 Jun 2024 06:42:24 +0000 (09:42 +0300)
commit892bc64827ddc021be9e9a402b96c6cc7eed89c6
tree569642b49f8235168cc6b17b01ab5bef738a2a71
parent1ddaaa244021aba8496536a6627b4ad2bc0f936a
accel/habanalabs/gaudi2: use single function to compare FW versions

Currently, the code contains 2 types of FW version comparison functions:
- hl_is_fw_sw_ver_[below/equal_or_greater]()
- gaudi2 specific function of the type
  gaudi2_is_fw_ver_[below/above]x_y_z()

Moreover, some functions use the inner FW version which shuold be only
stage during development but not version dependencies.

Finally, some tests are done to deprecated FW version to which LKD
should hold no compatibility.

This commit aligns all APIs to a single function that just compares the
version and return an integers indicator (similar in some way to
strcmp()).

In addition, this generic function now considers also the sub-minor FW
version and also remove dead code resulting in deprecated FW versions
compatibility.

Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
Reviewed-by: Ofir Bitton <obitton@habana.ai>
Signed-off-by: Ofir Bitton <obitton@habana.ai>
drivers/accel/habanalabs/common/firmware_if.c
drivers/accel/habanalabs/common/habanalabs.h
drivers/accel/habanalabs/gaudi2/gaudi2.c