habanalabs/gaudi: don't use disabled ports in collective wait
authorOfir Bitton <obitton@habana.ai>
Mon, 24 May 2021 19:58:44 +0000 (22:58 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Fri, 18 Jun 2021 12:23:41 +0000 (15:23 +0300)
commita39725819c816c87c6b4eeca4c10197a41e2a928
treed601015c086bd19151bfe3db92fdc48d2e9e6385
parent5a967fb3a74113724cf3f5fd9021d43fe2bda32e
habanalabs/gaudi: don't use disabled ports in collective wait

In the collective wait, we put jobs on the QMANs of all the NICs. The
code takes into account if a port is disabled only in case of PCI card.
When this info arrives from the f/w, the code doesn't take it into
account, and it tries to schedule jobs on NICs that aren't enabled and
thats a bug.

To fix this, after the f/w sends us the list of disabled ports, we
update the state of the QMANs according to that list. In addition,
we need to update the HW_CAP bits so the collective wait operation
will not try to use those QMANs. We also need to update the collective
master monitor mask.

Moreover, we need to add a protection for such future cases and in case
the user will try to submit work to those QMANs.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/gaudi/gaudi.c