Changeset 621 for GPL/branches/uniaud32-next/lib32/pci.c
- Timestamp:
- Jan 1, 2021, 11:45:33 PM (5 years ago)
- File:
-
- 1 edited
-
GPL/branches/uniaud32-next/lib32/pci.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-next/lib32/pci.c
r615 r621 205 205 pcidev->dev.dma_mask = &pcidev->dma_mask; 206 206 pcidev->dev.coherent_dma_mask = 0xffffffffull; 207 pr_warn("params set");208 207 209 208 // Subsystem ID … … 652 651 dprintf(("pci_alloc_consistent %d mask %x", size, (hwdev) ? hwdev->dma_mask : 0)); 653 652 if (hwdev == NULL || hwdev->dma_mask != 0xffffffff) { 654 dprintf(("pci_alloc_consistent"));655 pr_warn("dma_mask = %x",hwdev->dma_mask);656 653 //try not to exhaust low memory (< 16mb) so allocate from the high region first 657 654 //if that doesn't satisfy the dma mask requirement, then get it from the low 658 655 //region anyway 659 656 if(hwdev->dma_mask > 0x00ffffff) { 660 dprintf(("pci_alloc_consistent2"));661 657 order = __compat_get_order(size); 662 dprintf(("pci_alloc_consistent3"));663 658 ret = (void *)__get_free_pages(gfp|GFP_DMAHIGHMEM, order); 664 dprintf(("pci_alloc_consistent4"));665 659 *dma_handle = virt_to_bus(ret); 666 660 if(*dma_handle > hwdev->dma_mask) { 667 dprintf(("pci_alloc_consistent5"));668 661 free_pages((unsigned long)ret, __compat_get_order(size)); 669 dprintf(("pci_alloc_consistent6"));670 662 //be sure and allocate below 16 mb 671 663 gfp |= GFP_DMA; 672 664 ret = NULL; 673 665 } 674 dprintf(("pci_alloc_consistent6a"));675 666 } 676 667 else { //must always allocate below 16 mb 677 dprintf(("pci_alloc_consistent7"));678 668 gfp |= GFP_DMA; 679 669 } 680 dprintf(("pci_alloc_consistent7a")); 681 } 682 dprintf(("pci_alloc_consistent8")); 670 } 683 671 if(ret == NULL) { 684 dprintf(("pci_alloc_consistent9"));685 672 ret = (void *)__get_free_pages(gfp, __compat_get_order(size)); 686 673 } 687 dprintf(("pci_alloc_consistent10"));688 674 if (ret != NULL) { 689 dprintf(("pci_alloc_consistent11"));690 675 memset(ret, 0, size); 691 676 *dma_handle = virt_to_bus(ret); … … 749 734 int dma_supported(struct device *dev, u64 mask) 750 735 { 751 pr_warn("dma_supported");752 736 return 1; 753 737 } … … 755 739 int dma_set_coherent_mask(struct device *dev, u64 mask) 756 740 { 757 pr_warn("dma_set_coherent_mask");758 741 /* 759 742 * Truncate the mask to the actually supported dma_addr_t width to … … 771 754 int dma_set_mask(struct device *dev, u64 mask) 772 755 { 773 pr_warn("dma_set_mask");774 756 /* 775 757 * Truncate the mask to the actually supported dma_addr_t width to
Note:
See TracChangeset
for help on using the changeset viewer.
