Re: [PATCH 2/2] Fix a dead loop on dw shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10-10-15, 19:29, Figo wrote:
> @@ -1115,8 +1116,11 @@ static void dw_dma_off(struct dw_dma *dw)
>  	channel_clear_bit(dw, MASK.DST_TRAN, dw->all_chan_mask);
>  	channel_clear_bit(dw, MASK.ERROR, dw->all_chan_mask);
>  
> -	while (dma_readl(dw, CFG) & DW_CFG_DMA_EN)
> -		cpu_relax();
> +	while ((dma_readl(dw, CFG) & DW_CFG_DMA_EN) && retry--) {
> +		udelay(100);
> +		if (retry == 0)
> +			dev_err(&dw->dma.dev, "%s error :timeout\n", __func__);
> +	}

I will rather write it as:

	while ((dma_readl(dw, CFG) & DW_CFG_DMA_EN) && --retry)
		udelay(100);

        if (retry == 0)
                dev_err(&dw->dma.dev, "%s error :timeout\n", __func__);
-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux