It seems to me like a lot of drivers wind up getting their pci_set_dma_mask stuff wrong, occasionally in subtle ways. So, I created a "give me 64-bit PCI DMA" helper function. The attached patch demonstrates its use in tg3, from which the logic originated. It also fixes a tiny bug in tg3, whereby it might return zero on error (rather than -EFOO) if the pci_set_dma_mask succeeds but pci_set_consistent_dma_mask fails.