Skip to content

Commit f007643

Browse files
Ard Biesheuveldavem330
Ard Biesheuvel
authored andcommitted
r8169: set coherent DMA mask as well as streaming DMA mask
PCI devices that are 64-bit DMA capable should set the coherent DMA mask as well as the streaming DMA mask. On some architectures, these are managed separately, and so the coherent DMA mask will be left at its default value of 32 if it is not set explicitly. This results in errors such as r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded hwdev DMA mask = 0x00000000ffffffff, dev_addr = 0x00000080fbfff000 swiotlb: coherent allocation failed for device 0000:02:00.0 size=4096 CPU: 0 PID: 1062 Comm: systemd-udevd Not tainted 4.8.0+ #35 Hardware name: AMD Seattle/Seattle, BIOS 10:53:24 Oct 13 2016 on systems without memory that is 32-bit addressable by PCI devices. Signed-off-by: Ard Biesheuvel <[email protected]> Acked-by: Francois Romieu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9e55d0f commit f007643

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+2
-1
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8273,7 +8273,8 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
82738273
if ((sizeof(dma_addr_t) > 4) &&
82748274
(use_dac == 1 || (use_dac == -1 && pci_is_pcie(pdev) &&
82758275
tp->mac_version >= RTL_GIGA_MAC_VER_18)) &&
8276-
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
8276+
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
8277+
!pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
82778278

82788279
/* CPlusCmd Dual Access Cycle is only needed for non-PCIe */
82798280
if (!pci_is_pcie(pdev))

0 commit comments

Comments
 (0)