Re: [PATCH] esp_scsi: Clear Transfer Count registers before PIO transfers

From: Kars de Jong
Date: Sun Nov 17 2019 - 01:29:06 EST


Hi Finn,

Op za 16 nov. 2019 om 04:36 schreef Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx>:
>
> The zorro_esp driver uses both PIO and DMA transfers. If a failed DMA
> transfer happened to be followed by a PIO transfer, the TCLOW and TCMED
> registers would not get cleared. It is theoretically possible that the
> stale value from the transfer counter or the TCLOW/TCMED registers
> could then be used by the controller and the driver. Avoid that by
> clearing these registers before each PIO transfer.

Are you sure this is really needed?

The only place where the driver reads these registers is after a data
transfer. These are done using DMA on all Zorro boards, so I donât
think thereâs a risk of stale values from a PIO transfer there.

The only place the controller reads these registers is when a DMA
command is issued. The only place where that is done is in the
zorro_esp send_dma_command() functions. These all set both registers
explicitly before issuing the DMA command to the controller, so I
donât think thereâs a risk there either.

Kind regards,

Kars.