Skip to content

Commit 2edc66e

Browse files
committed
habanalabs: block WREG_BULK packet on PDMA
WREG_BULK is a special packet that has a variable length. Therefore, we can't parse it when validating CBs that go to the PCI DMA queue. In case the user needs to use it, it can put multiple WREG32 packets instead. Signed-off-by: Oded Gabbay <[email protected]> Reviewed-by: Omer Shpigelman <[email protected]>
1 parent 897c44f commit 2edc66e

File tree

1 file changed

+6
-1
lines changed
  • drivers/misc/habanalabs/gaudi

1 file changed

+6
-1
lines changed

drivers/misc/habanalabs/gaudi/gaudi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3865,6 +3865,12 @@ static int gaudi_validate_cb(struct hl_device *hdev,
38653865
rc = -EPERM;
38663866
break;
38673867

3868+
case PACKET_WREG_BULK:
3869+
dev_err(hdev->dev,
3870+
"User not allowed to use WREG_BULK\n");
3871+
rc = -EPERM;
3872+
break;
3873+
38683874
case PACKET_LOAD_AND_EXE:
38693875
rc = gaudi_validate_load_and_exe_pkt(hdev, parser,
38703876
(struct packet_load_and_exe *) user_pkt);
@@ -3880,7 +3886,6 @@ static int gaudi_validate_cb(struct hl_device *hdev,
38803886
break;
38813887

38823888
case PACKET_WREG_32:
3883-
case PACKET_WREG_BULK:
38843889
case PACKET_MSG_LONG:
38853890
case PACKET_MSG_SHORT:
38863891
case PACKET_REPEAT:

0 commit comments

Comments
 (0)