]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
crypto: omap-sham - Enable Polling mode if DMA fails
authorLokesh Vutla <lokeshvutla@ti.com>
Tue, 20 Aug 2013 15:02:34 +0000 (20:32 +0530)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 21 Aug 2013 11:28:07 +0000 (21:28 +1000)
commitb8411ccd613fc7c504104f56265bd640b6c42d8e
treedad54820ba4a34f10671f586178609409d34c27e
parent5bc357037476bf8d4623ab4ef0d1640b947c4625
crypto: omap-sham - Enable Polling mode if DMA fails

For writing input buffer into DATA_IN register current driver
has the following state machine:
-> if input buffer < 9 : use fallback driver
-> else if input buffer < block size : Copy input buffer into data_in regs
-> else use dma transfer.

In cases where requesting for DMA channels fails for some reason,
or channel numbers are not provided in DT or platform data, probe
also fails. Instead of returning from driver use cpu polling mode.
In this mode processor polls on INPUT_READY bit and writes data into
data_in regs when it equals 1. This operation is repeated until the
length of message.

Now the state machine looks like:
-> if input buffer < 9 : use fallback driver
-> else if input buffer < block size : Copy input buffer into data_in regs
-> else if dma enabled: use dma transfer
   else use cpu polling mode.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-sham.c