Intel IOMMU: Iommu floppy workaround

This config option (DMAR_FLPY_WA) sets up 1:1 mapping for the floppy device so
that the floppy device which does not use DMA api's will continue to work.

Once the floppy driver starts using DMA api's this config option can be turn
off or this patch can be yanked out of kernel at that time.

[[email protected]: cleanups, rename things, build fix]
[[email protected]: Kconfig fixes]
Signed-off-by: Anil S Keshavamurthy <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Muli Ben-Yehuda <[email protected]>
Cc: "Siddha, Suresh B" <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Ashok Raj <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Jan Engelhardt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Keshavamurthy, Anil S 2007-10-21 16:41:57 -07:00 • committed by Linus Torvalds
commit 49a0429e53
2 changed files with 37 additions and 0 deletions

View file

@ -1632,6 +1632,31 @@ error:
}
#endif
#ifdef CONFIG_DMAR_FLOPPY_WA
static inline void iommu_prepare_isa(void)
{
struct pci_dev *pdev;
int ret;
pdev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
if (!pdev)
return;
printk(KERN_INFO "IOMMU: Prepare 0-16M unity mapping for LPC\n");
ret = iommu_prepare_identity_map(pdev, 0, 16*1024*1024);
if (ret)
printk("IOMMU: Failed to create 0-64M identity map, "
"floppy might not work\n");
}
#else
static inline void iommu_prepare_isa(void)
{
return;
}
#endif /* !CONFIG_DMAR_FLPY_WA */
int __init init_dmars(void)
{
struct dmar_drhd_unit *drhd;
@ -1697,6 +1722,8 @@ int __init init_dmars(void)
iommu_prepare_gfx_mapping();
iommu_prepare_isa();
/*
* for each drhd
* enable fault log