Skip to contentSkip to conversation

alpha: small PCI fixes (test11-ac3)

PATCH Ivan Kokshaysky 1 participant 1 message Nov 24, 2000 Alpha port

lore
Share & tools
lore
#0 lore raw

Just out of curiosity I tried S3 Sonic Vibes sound card, which has only 24 address lines connected, on sx164. This revealed two bugs in the pci code:
- dma mask 0x00ffffff (24 bits) exactly fits the ISA scatter-gather window, but was rejected by pci_dma_supported() due to off-by-one bug.
- this card has some non-standard set of I/O ports, and driver tries to allocate resource for it at the runtime. At this time pcibios_update_resource() already has been vanished.

With these fixes the card started to work to the best of its ability, i.e. screechy and noisy, so after being so helpful the poor thing went back into the rubbish bin...

Ivan.

arch/alpha/kernel/pci_iommu.c +2 -2
@@ -613,10 +613,10 @@ pci_dma_supported(struct pci_dev *pdev, 
 	/* Check that we have a scatter-gather arena that fits.  */
 	hose = pdev ? pdev->sysdata : pci_isa_hose;
 	arena = hose->sg_isa;
-	if (arena && arena->dma_base + arena->size <= mask)
+	if (arena && arena->dma_base + arena->size - 1 <= mask)
 		return 1;
 	arena = hose->sg_pci;
-	if (arena && arena->dma_base + arena->size <= mask)
+	if (arena && arena->dma_base + arena->size - 1 <= mask)
 		return 1;
 
 	return 0;
arch/alpha/kernel/pci.c +1 -1
@@ -282,7 +282,7 @@ pcibios_fixup_bus(struct pci_bus *bus)
 	}
 }
 
-void __init
+void
 pcibios_update_resource(struct pci_dev *dev, struct resource *root,
 			struct resource *res, int resource)
 {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/