The patch did not work. However, I do not think it's an alignment issue. pci_map_single on x86_64 with >3G memory and no IOMMU uses the swiotlb by default. swiotlb provides "bounce buffers" for physical addresses over 4GB. So for memory where the kmalloc value is at a physical address over 2**32, pci_map_single will copy to a swiotlb slot. That means the dma_handle return value of pci_map_single is not necessarily the physical address of the virtual address. In iwl3945_tx_skb (iwl3945-base.c line 1099) use the pci_map_single which copies the memory of out_cmd at that time. However, iwl3945_build_tx_cmd_basic, iwl3945_hw_build_tx_cmd_rate, and iwl3945_build_tx_cmd_hwcrypto are all passed out_cmd and modify memory located there. These modifications are not reflected in the memory located at txcmd_phys. pci_map_single should only be called once the tx command structures are completely written. Additionally, pci_unmap_single should be called once the memory is no longer needed to free the swiotlb entry for that command. I am not sure if this is currently handled for all cases. Previous use of pci_alloc_coherent meant that memory would allocated at an physical address below 4GB and kept in-sync both the device and cpu. Refer to Documentation/x86/x86_64/boot-options.txt and lib/swiotlb.c for information on IOMMU and swiotlb Jason On Fri, Mar 20, 2009 at 4:39 PM, Abhijeet Kolekar <abhijeet.kolekar@xxxxxxxxx> wrote: > Can you try this patch? > > Thanks > Abhijeet > > On Thu, 2009-03-19 at 18:22 -0700, Jason Andryuk wrote: > >> There is a bug related to the use of DMA. Using wireless-testing >> 2.6.29-rc7 from ~3/15, and booting with "iommu=off mem=2G" gives me a >> working iwl3945. I also confirmed >> 78bb4a96d0d4ab2860df5f0fdfde58cd7a3ad642 "iwl3945: use iwl3945_tx_cmd >> instead of iwl_tx_cmd" plus previously posted "rb_stts and BUG to >> WARN" patch as working when iommu is disabled. >> >> So swiotlb exposes iwl3945 dma breakage. >> >> From 78bb4a96d0d4ab2860df5f0fdfde58cd7a3ad642 "iwl3945: use >> iwl3945_tx_cmd instead of iwl_tx_cmd" the most obvious problem is the >> change to pci_map_single from pci_alloc_consistent. >> >> As previously noted, problems brought along by that include the >> modification of data to be DMAed after the _map_single call. The lack >> of associated un-mapping of memory may also be a problem. >> >> For testing, swiotlb use can be forced with "swiotlb=force" which >> should reproduce the error. >> >> Jason >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in >> the body of a message to majordomo@xxxxxxxxxxxxxxx >> More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html