/* make sure IDE0/1 interrupts are not masked */ irq_mask = (1 << 22) | (1 << 23); tmp = readl(ioaddr + 0x48); if (tmp & irq_mask) { tmp &= ~irq_mask; writel(tmp, ioaddr + 0x48); readl(ioaddr + 0x48); /* flush */ } 
static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name){	unsigned long bar5	= pci_resource_start(dev, 5);	unsigned long barsize	= pci_resource_len(dev, 5);	u8 tmpbyte	= 0;	void __iomem *ioaddr;	/*	 *	Drop back to PIO if we can't map the mmio. Some	 *	systems seem to get terminally confused in the PCI	 *	spaces.	 */	 	if(!request_mem_region(bar5, barsize, name))	{		printk(KERN_WARNING "siimage: IDE controller MMIO ports not available.\n");		return 0;	}			ioaddr = ioremap(bar5, barsize);	if (ioaddr == NULL)	{		release_mem_region(bar5, barsize);		return 0;	}	pci_set_master(dev);	pci_set_drvdata(dev, (void *) ioaddr);	if (pdev_is_sata(dev)) {		writel(0, ioaddr + 0x148);		writel(0, ioaddr + 0x1C8);	}	writeb(0, ioaddr + 0xB4);	writeb(0, ioaddr + 0xF4);	tmpbyte = readb(ioaddr + 0x4A);	switch(tmpbyte & 0x30) {		case 0x00:			/* In 100 MHz clocking, try and switch to 133 */			writeb(tmpbyte|0x10, ioaddr + 0x4A);			break;		case 0x10:			/* On 133Mhz clocking */			break;		case 0x20:			/* On PCIx2 clocking */			break;		case 0x30:			/* Clocking is disabled */			/* 133 clock attempt to force it on */			writeb(tmpbyte & ~0x20, ioaddr + 0x4A);			break;	}		writeb(      0x72, ioaddr + 0xA1);	writew(    0x328A, ioaddr + 0xA2);	writel(0x62DD62DD, ioaddr + 0xA4);	writel(0x43924392, ioaddr + 0xA8);	writel(0x40094009, ioaddr + 0xAC);	writeb(      0x72, ioaddr + 0xE1);	writew(    0x328A, ioaddr + 0xE2);	writel(0x62DD62DD, ioaddr + 0xE4);	writel(0x43924392, ioaddr + 0xE8);	writel(0x40094009, ioaddr + 0xEC);	if (pdev_is_sata(dev)) {		writel(0xFFFF0000, ioaddr + 0x108);		writel(0xFFFF0000, ioaddr + 0x188);		writel(0x00680000, ioaddr + 0x148);		writel(0x00680000, ioaddr + 0x1C8);	}	tmpbyte = readb(ioaddr + 0x4A);	proc_reports_siimage(dev, (tmpbyte>>4), name);	return 1;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/d868dd19ad0828b1b3b56f3b06bd4a39971847be/siimage.c/buggy/drivers/ide/pci/siimage.c