Skip to content

Commit 9354f1b

Browse files
ofirbittogabbay
authored andcommitted
habanalabs: zero pci counters packet before submit to FW
Driver does not zero some pci counters packets before sending to FW. This causes an out of sync PI/CI between driver and FW. Signed-off-by: Ofir Bitton <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
1 parent cb5c681 commit 9354f1b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/misc/habanalabs/common/firmware_if.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ int hl_fw_cpucp_pci_counters_get(struct hl_device *hdev,
402402
}
403403
counters->rx_throughput = result;
404404

405+
memset(&pkt, 0, sizeof(pkt));
406+
pkt.ctl = cpu_to_le32(CPUCP_PACKET_PCIE_THROUGHPUT_GET <<
407+
CPUCP_PKT_CTL_OPCODE_SHIFT);
408+
405409
/* Fetch PCI tx counter */
406410
pkt.index = cpu_to_le32(cpucp_pcie_throughput_tx);
407411
rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
@@ -414,6 +418,7 @@ int hl_fw_cpucp_pci_counters_get(struct hl_device *hdev,
414418
counters->tx_throughput = result;
415419

416420
/* Fetch PCI replay counter */
421+
memset(&pkt, 0, sizeof(pkt));
417422
pkt.ctl = cpu_to_le32(CPUCP_PACKET_PCIE_REPLAY_CNT_GET <<
418423
CPUCP_PKT_CTL_OPCODE_SHIFT);
419424

0 commit comments

Comments
 (0)