]> git.karo-electronics.de Git - karo-tx-linux.git/commit
crypto: nx - fix limits to sg lists for SHA-2
authorMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
Fri, 2 Aug 2013 12:09:52 +0000 (12:09 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Aug 2013 06:39:44 +0000 (16:39 +1000)
commitd311149337f93ae4de60a2f1c24a0d856089903f
treec22b0de3c6d7b21b3655e8cfdc3dc6c4bc24c516
parent2b7c15ca17128f7c11ebb3d4480f917829703b01
crypto: nx - fix limits to sg lists for SHA-2

The co-processor has several limits regarding the length of
scatter/gather lists and the total number of bytes in it. These limits
are available in the device tree, as following:

 - "ibm,max-sg-len": maximum number of bytes of each scatter/gather
   list.

 - "ibm,max-sync-cop": used for synchronous operations, it is an array
   of structures that contains information regarding the limits that
   must be considered for each mode and operation. The most important
   limits in it are:
    - The total number of bytes that a scatter/gather list can hold.
- The maximum number of elements that a scatter/gather list can
  have.

This patch updates the NX driver to perform several hyper calls if
needed in order to always respect the length limits for scatter/gather
lists.

Reviewed-by: Fionnuala Gunter <fin@linux.vnet.ibm.com>
Reviewed-by: Joel Schopp <jschopp@linux.vnet.ibm.com>
Reviewed-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/nx/nx-sha256.c
drivers/crypto/nx/nx-sha512.c