Oops, hit send too early. A small nit:
On 21/11/2014 10:27, Hannes Reinecke wrote:
> +static void pci_esp_dma_drain(struct esp *esp)
> +{
> + u8 resid;
> + int lim = 1000;
> +
> +
> + if ((esp->sreg & ESP_STAT_PMASK) == ESP_DOP ||
> + (esp->sreg & ESP_STAT_PMASK) == ESP_DIP)
> + /* Data-In or Data-Out, nothing to be done */
> + return;
> +
> + while (--lim > 0) {
> + resid = pci_esp_read8(esp, ESP_FFLAGS) & ESP_FF_FBYTES;
> + if (resid <= 1)
> + break;
cpu_relax()?
> + }
> + if (resid > 1) {
> + /* FIFO not cleared */
> + shost_printk(KERN_INFO, esp->host,
> + "FIFO not cleared, %d bytes left\n",
> + resid);
> + }
> +
> + /*
> + * When there is a residual BCMPLT will never be set
> + * (obviously). But we still have to issue the BLAST
> + * command, otherwise the data will not being transferred.
> + * But we'll never know when the BLAST operation is
> + * finished. So check for some time and give up eventually.
> + */
> + lim = 1000;
> + pci_esp_write8(esp, ESP_DMA_CMD_DIR | ESP_DMA_CMD_BLAST, ESP_DMA_CMD);
> + while (pci_esp_read8(esp, ESP_DMA_STATUS) & ESP_DMA_STAT_BCMPLT) {
> + if (--lim == 0)
> + break;
cpu_relax()?
Otherwise looks sane.
Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html