} spin_unlock_irqrestore(&ap->host_set->lock, flags); 
} else { assert(!(EDMA_EN & readl(port_mmio + EDMA_CMD_OFS))); } 
static void mv_stop_dma(struct ata_port *ap){	void __iomem *port_mmio = mv_ap_base(ap);	struct mv_port_priv *pp	= ap->private_data;	unsigned long flags;	u32 reg;	int i;	spin_lock_irqsave(&ap->host_set->lock, flags);		if (!(MV_PP_FLAG_EDMA_DS_ACT & pp->pp_flags) &&	    ((MV_PP_FLAG_EDMA_EN & pp->pp_flags) ||	     (EDMA_EN & readl(port_mmio + EDMA_CMD_OFS)))) {		/* Disable EDMA if we're not already trying to disable it		 * and it is currently active.   The disable bit auto clears.		 */		pp->pp_flags |= MV_PP_FLAG_EDMA_DS_ACT;		writelfl(EDMA_DS, port_mmio + EDMA_CMD_OFS);		pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN;	}	spin_unlock_irqrestore(&ap->host_set->lock, flags);		/* now properly wait for the eDMA to stop */	for (i = 1000; i > 0; i--) {		reg = readl(port_mmio + EDMA_CMD_OFS);		if (!(EDMA_EN & reg)) {			break;		}		udelay(100);	}	spin_lock_irqsave(&ap->host_set->lock, flags);	pp->pp_flags &= ~MV_PP_FLAG_EDMA_DS_ACT;	spin_unlock_irqrestore(&ap->host_set->lock, flags);	if (EDMA_EN & reg) {		printk(KERN_ERR "ata%u: Unable to stop eDMA\n", ap->id);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/afb0edd922c7ed6e73678730921dfcccebec17e8/sata_mv.c/clean/drivers/scsi/sata_mv.c