Skip to content

Commit 614f4d1

Browse files
Pavan Chebbikuba-moo
authored andcommitted
tg3: Set coherent DMA mask bits to 31 for BCM57766 chipsets
The hardware on Broadcom 1G chipsets have a known limitation where they cannot handle DMA addresses that cross over 4GB. When such an address is encountered, the hardware sets the address overflow error bit in the DMA status register and triggers a reset. However, BCM57766 hardware is setting the overflow bit and triggering a reset in some cases when there is no actual underlying address overflow. The hardware team analyzed the issue and concluded that it is happening when the status block update has an address with higher (b16 to b31) bits as 0xffff following a previous update that had lowest bits as 0xffff. To work around this bug in the BCM57766 hardware, set the coherent dma mask from the current 64b to 31b. This will ensure that upper bits of the status block DMA address are always at most 0x7fff, thus avoiding the improper overflow check described above. This work around is intended for only status block and ring memories and has no effect on TX and RX buffers as they do not require coherent memory. Fixes: 72f2afb ("[TG3]: Add DMA address workaround") Reported-by: Salam Noureddine <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Reviewed-by: Somnath Kotur <[email protected]> Signed-off-by: Pavan Chebbi <[email protected]> Reviewed-by: Michal Kubiak <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9b234a9 commit 614f4d1

File tree

1 file changed

+3
-0
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+3
-0
lines changed

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17839,6 +17839,9 @@ static int tg3_init_one(struct pci_dev *pdev,
1783917839
} else
1784017840
persist_dma_mask = dma_mask = DMA_BIT_MASK(64);
1784117841

17842+
if (tg3_asic_rev(tp) == ASIC_REV_57766)
17843+
persist_dma_mask = DMA_BIT_MASK(31);
17844+
1784217845
/* Configure DMA attributes. */
1784317846
if (dma_mask > DMA_BIT_MASK(32)) {
1784417847
err = dma_set_mask(&pdev->dev, dma_mask);

0 commit comments

Comments
 (0)