Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 310722 Details for
Bug 453680
Error in the uhci code causes usb not to work with iommu=calgary boot option
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Creates Fallback DMA ops for devices that are not handled by Calgary
fallback_dma_ops_for_calgary.diff (text/plain), 4.95 KB, created by
IBM Bug Proxy
on 2008-07-01 21:00:34 UTC
(
hide
)
Description:
Creates Fallback DMA ops for devices that are not handled by Calgary
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2008-07-01 21:00:34 UTC
Size:
4.95 KB
patch
obsolete
>Index: linux-2.6.18.x86_64/arch/x86_64/kernel/pci-nommu.c >=================================================================== >--- linux-2.6.18.x86_64.orig/arch/x86_64/kernel/pci-nommu.c >+++ linux-2.6.18.x86_64/arch/x86_64/kernel/pci-nommu.c >@@ -9,6 +9,7 @@ > #include <asm/proto.h> > #include <asm/processor.h> > #include <asm/dma.h> >+#include <asm/calgary.h> > > static int > check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size) >@@ -90,6 +91,8 @@ struct dma_mapping_ops nommu_dma_ops = { > > void __init no_iommu_init(void) > { >+ if (use_calgary && (end_pfn < MAX_DMA32_PFN)) >+ fallback_dma_ops = &nommu_dma_ops; > if (dma_ops) > return; > >Index: linux-2.6.18.x86_64/arch/x86_64/kernel/pci-swiotlb.c >=================================================================== >--- linux-2.6.18.x86_64.orig/arch/x86_64/kernel/pci-swiotlb.c >+++ linux-2.6.18.x86_64/arch/x86_64/kernel/pci-swiotlb.c >@@ -7,6 +7,7 @@ > #include <asm/proto.h> > #include <asm/swiotlb.h> > #include <asm/dma.h> >+#include <asm/calgary.h> > > int swiotlb __read_mostly; > EXPORT_SYMBOL(swiotlb); >@@ -39,5 +40,8 @@ void pci_swiotlb_init(void) > printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n"); > swiotlb_init(); > dma_ops = &swiotlb_dma_ops; >+ } else if (use_calgary && (end_pfn > MAX_DMA32_PFN)) { >+ swiotlb_init(); >+ fallback_dma_ops = &swiotlb_dma_ops; > } > } >Index: linux-2.6.18.x86_64/include/asm-x86_64/calgary.h >=================================================================== >--- linux-2.6.18.x86_64.orig/include/asm-x86_64/calgary.h >+++ linux-2.6.18.x86_64/include/asm-x86_64/calgary.h >@@ -60,6 +60,7 @@ struct cal_chipset_ops { > #define TCE_TABLE_SIZE_8M 7 > > extern int use_calgary; >+extern const struct dma_mapping_ops* fallback_dma_ops; > > #ifdef CONFIG_CALGARY_IOMMU > extern int calgary_iommu_init(void); >Index: linux-2.6.18.x86_64/arch/x86_64/kernel/pci-calgary.c >=================================================================== >--- linux-2.6.18.x86_64.orig/arch/x86_64/kernel/pci-calgary.c >+++ linux-2.6.18.x86_64/arch/x86_64/kernel/pci-calgary.c >@@ -48,6 +48,7 @@ int use_calgary __read_mostly = 1; > #else > int use_calgary __read_mostly = 0; > #endif /* CONFIG_CALGARY_DEFAULT_ENABLED */ >+const struct dma_mapping_ops* fallback_dma_ops; > > #define PCI_DEVICE_ID_IBM_CALGARY 0x02a1 > #define PCI_DEVICE_ID_IBM_CALIOC2 0x0308 >@@ -406,20 +407,6 @@ static void calgary_unmap_sg(struct devi > } > } > >-static int calgary_nontranslate_map_sg(struct device* dev, >- struct scatterlist *sg, int nelems, int direction) >-{ >- int i; >- >- for (i = 0; i < nelems; i++ ) { >- struct scatterlist *s = &sg[i]; >- BUG_ON(!s->page); >- s->dma_address = virt_to_bus(page_address(s->page) +s->offset); >- s->dma_length = s->length; >- } >- return nelems; >-} >- > static int calgary_map_sg(struct device *dev, struct scatterlist *sg, > int nelems, int direction) > { >@@ -430,7 +417,7 @@ static int calgary_map_sg(struct device > int i; > > if (!translation_enabled(tbl)) >- return calgary_nontranslate_map_sg(dev, sg, nelems, direction); >+ return fallback_dma_ops->map_sg(dev, sg, nelems, direction); > > for (i = 0; i < nelems; i++ ) { > struct scatterlist *s = &sg[i]; >@@ -473,13 +460,13 @@ static dma_addr_t calgary_map_single(str > unsigned int npages; > struct iommu_table *tbl = find_iommu_table(dev); > >+ if (!translation_enabled(tbl)) >+ return fallback_dma_ops->map_single(dev, vaddr, size, direction); >+ > uaddr = (unsigned long)vaddr; > npages = num_dma_pages(uaddr, size); > >- if (translation_enabled(tbl)) >- dma_handle = iommu_alloc(tbl, vaddr, npages, direction); >- else >- dma_handle = virt_to_bus(vaddr); >+ dma_handle = iommu_alloc(tbl, vaddr, npages, direction); > > return dma_handle; > } >@@ -490,8 +477,10 @@ static void calgary_unmap_single(struct > struct iommu_table *tbl = find_iommu_table(dev); > unsigned int npages; > >- if (!translation_enabled(tbl)) >+ if (!translation_enabled(tbl)) { >+ fallback_dma_ops->unmap_single(dev, dma_handle, size, direction); > return; >+ } > > npages = num_dma_pages(dma_handle, size); > iommu_free(tbl, dma_handle, npages); >@@ -505,6 +494,9 @@ static void* calgary_alloc_coherent(stru > unsigned int npages, order; > struct iommu_table *tbl = find_iommu_table(dev); > >+ if (!translation_enabled(tbl)) >+ return fallback_dma_ops->alloc_coherent(dev, size, dma_handle, flag); >+ > size = PAGE_ALIGN(size); /* size rounded up to full pages */ > npages = size >> PAGE_SHIFT; > order = get_order(size); >@@ -515,15 +507,12 @@ static void* calgary_alloc_coherent(stru > goto error; > memset(ret, 0, size); > >- if (translation_enabled(tbl)) { >- /* set up tces to cover the allocated range */ >- mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL); >- if (mapping == bad_dma_address) >- goto free; >- >- *dma_handle = mapping; >- } else /* non translated slot */ >- *dma_handle = virt_to_bus(ret); >+ /* set up tces to cover the allocated range */ >+ mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL); >+ if (mapping == bad_dma_address) >+ goto free; >+ >+ *dma_handle = mapping; > > return ret; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 453680
: 310722 |
310723
|
315160
|
316513
|
316864
|
324530