crypto: caam - don't hardcode inpentry size
Using dma_addr_t for elements of JobR input ring is not appropriate on all 64-bit SoCs, some of which, like i.MX8MQ, use only 32-bit wide pointers there. Convert all of the code to use explicit helper function that can be later extended to support i.MX8MQ. No functional change intended. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Spencer <christopher.spencer@sea.co.uk> Cc: Cory Tusar <cory.tusar@zii.aero> Cc: Chris Healy <cphealy@gmail.com> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Horia Geantă <horia.geanta@nxp.com> Cc: Aymen Sghaier <aymen.sghaier@nxp.com> Cc: Leonard Crestez <leonard.crestez@nxp.com> Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:

committed by
Herbert Xu

orang tua
6c5f898f12
melakukan
dff36801a9
@@ -388,7 +388,7 @@ int caam_jr_enqueue(struct device *dev, u32 *desc,
|
||||
head_entry->cbkarg = areq;
|
||||
head_entry->desc_addr_dma = desc_dma;
|
||||
|
||||
jrp->inpring[head] = cpu_to_caam_dma(desc_dma);
|
||||
jr_inpentry_set(jrp->inpring, head, cpu_to_caam_dma(desc_dma));
|
||||
|
||||
/*
|
||||
* Guarantee that the descriptor's DMA address has been written to
|
||||
@@ -434,7 +434,7 @@ static int caam_jr_init(struct device *dev)
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
jrp->inpring = dmam_alloc_coherent(dev, sizeof(*jrp->inpring) *
|
||||
jrp->inpring = dmam_alloc_coherent(dev, SIZEOF_JR_INPENTRY *
|
||||
JOBR_DEPTH, &inpbusaddr,
|
||||
GFP_KERNEL);
|
||||
if (!jrp->inpring)
|
||||
|
Reference in New Issue
Block a user