search for: pci_alloc_consist

Displaying 20 results from an estimated 30 matches for "pci_alloc_consist".

2007 Mar 16
7
Physical address mapping to user space in dom0 problem
I have a PCI device which can perform bus master DMA. I developed a PCI device driver which can allocate DMA buffer and provide mmap operation to map the I/O and DMA buffer to user space. The PCI device driver works well under Linux 2.6.20. However it brokes under XEN 3.0.4. It appears that mmap map to the wrong memory. remap_pfn_range in mmap function return no error when it is used to map
2007 Jul 09
21
mthca use of dma_sync_single is bogus
It seems the problems running mthca in a Xen domU have uncovered a bug in mthca: mthca uses dma_sync_single in mthca_arbel_write_mtt_seg() and mthca_arbel_map_phys_fmr() to sync the MTTs that get written. However, Documentation/DMA-API.txt says: void dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) synchronise a single
2013 Aug 20
2
[PATCH] VMXNET3: Add support for virtual IOMMU
We can't just do virt_to_phys() on memory that we pass to the device and expect it to work in presence of a virtual IOMMU. We need to add IOMMU mappings for such DMAs to work correctly. Fix that with pci_alloc_consistent() where possible, or pci_map_single() where the mapping is short-lived or we don't control the allocation (netdev). Also fix two small bugs: 1) use after free of rq->buf_info in vmxnet3_rq_destroy() 2) a cpu_to_le32() that should have been a cpu_to_le64() Acked-by: George Zhang <geor...
2013 Aug 20
2
[PATCH] VMXNET3: Add support for virtual IOMMU
We can't just do virt_to_phys() on memory that we pass to the device and expect it to work in presence of a virtual IOMMU. We need to add IOMMU mappings for such DMAs to work correctly. Fix that with pci_alloc_consistent() where possible, or pci_map_single() where the mapping is short-lived or we don't control the allocation (netdev). Also fix two small bugs: 1) use after free of rq->buf_info in vmxnet3_rq_destroy() 2) a cpu_to_le32() that should have been a cpu_to_le64() Acked-by: George Zhang <geor...
2013 Aug 23
1
[PATCH] VMXNET3: Add support for virtual IOMMU
...buf_info = NULL; + } } @@ -496,37 +500,38 @@ static int vmxnet3_tq_create(struct vmxnet3_tx_queue *tq, struct vmxnet3_adapter *adapter) { + size_t sz; + BUG_ON(tq->tx_ring.base || tq->data_ring.base || tq->comp_ring.base || tq->buf_info); - tq->tx_ring.base = pci_alloc_consistent(adapter->pdev, tq->tx_ring.size - * sizeof(struct Vmxnet3_TxDesc), - &tq->tx_ring.basePA); + tq->tx_ring.base = dma_alloc_coherent(&adapter->pdev->dev, + tq->tx_ring.size * sizeof(struct Vmxnet3_TxDesc), + &tq->tx_ring.basePA, GFP_KERNEL); if (...
2013 Aug 23
1
[PATCH] VMXNET3: Add support for virtual IOMMU
...buf_info = NULL; + } } @@ -496,37 +500,38 @@ static int vmxnet3_tq_create(struct vmxnet3_tx_queue *tq, struct vmxnet3_adapter *adapter) { + size_t sz; + BUG_ON(tq->tx_ring.base || tq->data_ring.base || tq->comp_ring.base || tq->buf_info); - tq->tx_ring.base = pci_alloc_consistent(adapter->pdev, tq->tx_ring.size - * sizeof(struct Vmxnet3_TxDesc), - &tq->tx_ring.basePA); + tq->tx_ring.base = dma_alloc_coherent(&adapter->pdev->dev, + tq->tx_ring.size * sizeof(struct Vmxnet3_TxDesc), + &tq->tx_ring.basePA, GFP_KERNEL); if (...
2005 Oct 04
2
Question regarding behavior of virt_to_bus ....
...to virt_to_bus returns 0x14d6000. This result is baffling me, since that''s what it would look like in a normal 32-bit i386 world, and not in xenified world. Am I doing something stupid, or is there some technicality of memory subsystem that I don''t get. Ofcourse, if I just use pci_alloc_consistent (for a small buffer), everything works fine, since there is no bootmem related contortion involved. I will highly appreciate any input on this. --Himanshu ------------------------------------------------------------------------- Himanshu Raj PhD Student, GaTech (www.cc.gatech.edu/~rhim) I pr...
2023 Jul 06
1
problem getting dahdi-linux to work with kernel 6.1.0-10
Hi. I have run into a problem compiling dahdi-linux in kernel 6.1.0-10. Apparently there was a change, so I found a patch to fix stdbool.h but now I have an implicit declaration of pci_alloc_consistent in drivers/dahdi/wct4xxp/base.c I don't see any other references to that name anywhere. I am using version from git 5c840cf43838e0690873e73409491c392333b3b8 . So, the question, how to fix, so I can get the tompile to work? Thanks in advance for any suggestions. -- Your life is like a p...
2013 Aug 20
3
[PATCH 0/2] VMCI: Add support for virtual IOMMU
This patchset adds support for virtual IOMMU to the VMCI module. We switch to DMA consistent mappings for queuepair and doorbell pages that are passed to the device, which allows the module to work in the presence of vIOMMU/VT-d. Andy King (2): VMCI: Remove non-blocking/pinned queuepair support VMCI: Add support for virtual IOMMU drivers/misc/vmw_vmci/vmci_driver.c | 2 +-
2013 Aug 20
3
[PATCH 0/2] VMCI: Add support for virtual IOMMU
This patchset adds support for virtual IOMMU to the VMCI module. We switch to DMA consistent mappings for queuepair and doorbell pages that are passed to the device, which allows the module to work in the presence of vIOMMU/VT-d. Andy King (2): VMCI: Remove non-blocking/pinned queuepair support VMCI: Add support for virtual IOMMU drivers/misc/vmw_vmci/vmci_driver.c | 2 +-
2007 Oct 03
4
Problem with mISDN and HFC-Cards in Asterisk-DomU
...will find the following snippet of code in /drivers/isdn/hardware/mISDN/hfc_pci.c, which produces the above error: /* Allocate memory for FIFOS */ /* the memory needs to be on a 32k boundary within the first 4G */ pci_set_dma_mask(dev_hfcpci, 0xFFFF8000); buffer = pci_alloc_consistent(dev_hfcpci, 0x8000, &hc->hw.dmahandle); /* We silently assume the address is okay if nonzero */ if(!buffer) { printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n"); return 1; } But what is even more strange...
2005 Apr 15
0
[PATCH] Eliminate kernel version checks from i386/kernel/pci-dma.c
...#else -#define pte_offset_kernel pte_offset -#define pud_t pgd_t -#define pud_offset(d, va) d -#endif struct dma_coherent_mem { void *virt_base; @@ -85,24 +78,13 @@ xen_contig_memory(unsigned long vstart, balloon_unlock(flags); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t *dma_handle) -#else void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, int gfp) -#endif { void *ret; unsigned int order = get_order(size); unsigned long vstart; -#if LINUX_VERSION_CODE < KERN...
2013 Aug 21
0
[PATCH] VMXNET3: Add support for virtual IOMMU
...King <acking at vmware.com> Date: Tue, 20 Aug 2013 10:33:32 -0700 > We can't just do virt_to_phys() on memory that we pass to the device and > expect it to work in presence of a virtual IOMMU. We need to add IOMMU > mappings for such DMAs to work correctly. Fix that with > pci_alloc_consistent() where possible, or pci_map_single() where the > mapping is short-lived or we don't control the allocation (netdev). > > Also fix two small bugs: > 1) use after free of rq->buf_info in vmxnet3_rq_destroy() > 2) a cpu_to_le32() that should have been a cpu_to_le64() > &...
2005 Jul 28
10
dma_alloc_coherent issue with tg3 in x86_64 build
During boot of dom0, I get the following. Box is remote, so I''m now waiting for proxy power button pusher ;-) tg3 init fails doing dma_alloc_coherent (I assume this is from tg3_init_one -> tg3_test_dma -> pci_alloc_consistent -> dma_alloc_coherent). Looks like an issue with the amount of memory in dom0. Is this known? thanks, -chris root (hd0,0) Filesystem type is ext2fs, partition type 0x83 kernel /xen.gz com1=115200,8n1 console=com1,vga [Multiboot-elf, <0x100000:0x7c3e0:0x29c20>, shtab=0x1a6078, en...
2009 Sep 30
1
SCSI driver for VMware's virtual HBA - V5.
...tion); > + } > + if (cmd->sense_buffer) > + pci_unmap_single(adapter->dev, ctx->sensePA, > + SCSI_SENSE_BUFFERSIZE, PCI_DMA_FROMDEVICE); > +} > + > +static int __devinit pvscsi_allocate_rings(struct pvscsi_adapter *adapter) > +{ > + adapter->rings_state = pci_alloc_consistent(adapter->dev, PAGE_SIZE, > + &adapter->ringStatePA); > + if (!adapter->rings_state) > + return -ENOMEM; > + > + adapter->req_pages = min(PVSCSI_MAX_NUM_PAGES_REQ_RING, > + pvscsi_ring_pages); > + adapter->req_depth = adapter->req_pages &gt...
2009 Sep 30
1
SCSI driver for VMware's virtual HBA - V5.
...tion); > + } > + if (cmd->sense_buffer) > + pci_unmap_single(adapter->dev, ctx->sensePA, > + SCSI_SENSE_BUFFERSIZE, PCI_DMA_FROMDEVICE); > +} > + > +static int __devinit pvscsi_allocate_rings(struct pvscsi_adapter *adapter) > +{ > + adapter->rings_state = pci_alloc_consistent(adapter->dev, PAGE_SIZE, > + &adapter->ringStatePA); > + if (!adapter->rings_state) > + return -ENOMEM; > + > + adapter->req_pages = min(PVSCSI_MAX_NUM_PAGES_REQ_RING, > + pvscsi_ring_pages); > + adapter->req_depth = adapter->req_pages &gt...
2009 Oct 13
1
SCSI driver for VMware's virtual HBA - V6.
...dataPA, bufflen, + cmd->sc_data_direction); + } + if (cmd->sense_buffer) + pci_unmap_single(adapter->dev, ctx->sensePA, + SCSI_SENSE_BUFFERSIZE, PCI_DMA_FROMDEVICE); +} + +static int __devinit pvscsi_allocate_rings(struct pvscsi_adapter *adapter) +{ + adapter->rings_state = pci_alloc_consistent(adapter->dev, PAGE_SIZE, + &adapter->ringStatePA); + if (!adapter->rings_state) + return -ENOMEM; + + adapter->req_pages = min(PVSCSI_MAX_NUM_PAGES_REQ_RING, + pvscsi_ring_pages); + adapter->req_depth = adapter->req_pages + * PVSCSI_MAX_NUM_REQ_ENTRIES_PER...
2009 Oct 13
1
SCSI driver for VMware's virtual HBA - V6.
...dataPA, bufflen, + cmd->sc_data_direction); + } + if (cmd->sense_buffer) + pci_unmap_single(adapter->dev, ctx->sensePA, + SCSI_SENSE_BUFFERSIZE, PCI_DMA_FROMDEVICE); +} + +static int __devinit pvscsi_allocate_rings(struct pvscsi_adapter *adapter) +{ + adapter->rings_state = pci_alloc_consistent(adapter->dev, PAGE_SIZE, + &adapter->ringStatePA); + if (!adapter->rings_state) + return -ENOMEM; + + adapter->req_pages = min(PVSCSI_MAX_NUM_PAGES_REQ_RING, + pvscsi_ring_pages); + adapter->req_depth = adapter->req_pages + * PVSCSI_MAX_NUM_REQ_ENTRIES_PER...
2009 Oct 06
1
[PATCH 2.6.32-rc3] net: VMware virtual Ethernet NIC driver: vmxnet3
...p_type = VMXNET3_MAP_NONE; + + /* stats are not reset */ +} + + +static int +vmxnet3_tq_create(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + BUG_ON(tq->tx_ring.base || tq->data_ring.base || + tq->comp_ring.base || tq->buf_info); + + tq->tx_ring.base = pci_alloc_consistent(adapter->pdev, tq->tx_ring.size + * sizeof(struct Vmxnet3_TxDesc), + &tq->tx_ring.basePA); + if (!tq->tx_ring.base) { + printk(KERN_ERR "%s: failed to allocate tx ring\n", + adapter->netdev->name); + goto err; + } + + tq->data_ring.base = pc...
2009 Oct 06
1
[PATCH 2.6.32-rc3] net: VMware virtual Ethernet NIC driver: vmxnet3
...p_type = VMXNET3_MAP_NONE; + + /* stats are not reset */ +} + + +static int +vmxnet3_tq_create(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + BUG_ON(tq->tx_ring.base || tq->data_ring.base || + tq->comp_ring.base || tq->buf_info); + + tq->tx_ring.base = pci_alloc_consistent(adapter->pdev, tq->tx_ring.size + * sizeof(struct Vmxnet3_TxDesc), + &tq->tx_ring.basePA); + if (!tq->tx_ring.base) { + printk(KERN_ERR "%s: failed to allocate tx ring\n", + adapter->netdev->name); + goto err; + } + + tq->data_ring.base = pc...