diff options
author | Tero Kristo <t-kristo@ti.com> | 2018-02-27 15:30:34 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-03-09 22:45:36 +0800 |
commit | 4c219855a595d0af599b1f9558ccfc8a0d812e2b (patch) | |
tree | 3848e9cdbdfb44d255e70f3fd55ed8fc4c853a71 | |
parent | 6a4967c3e1fc1f2fd19283e5c98076a65f7b29ff (diff) | |
download | linux-4c219855a595d0af599b1f9558ccfc8a0d812e2b.tar.gz linux-4c219855a595d0af599b1f9558ccfc8a0d812e2b.tar.bz2 linux-4c219855a595d0af599b1f9558ccfc8a0d812e2b.zip |
crypto: omap-sham - Verify page zone of scatterlists before starting DMA
In certain platforms like DRA7xx having memory > 2GB with LPAE enabled
has a constraint that DMA can be done with the initial 2GB and marks it
as ZONE_DMA. But openssl when used with cryptodev does not make sure that
input buffer is DMA capable. So, adding a check to verify if the input
buffer is capable of DMA.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Reported-by: Aparna Balasubramanian <aparnab@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/omap-sham.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index 86b89ace836f..ce398b7a2b1c 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -759,6 +759,13 @@ static int omap_sham_align_sgs(struct scatterlist *sg, while (nbytes > 0 && sg_tmp) { n++; +#ifdef CONFIG_ZONE_DMA + if (page_zonenum(sg_page(sg_tmp)) != ZONE_DMA) { + aligned = false; + break; + } +#endif + if (offset < sg_tmp->length) { if (!IS_ALIGNED(offset + sg_tmp->offset, 4)) { aligned = false; |