crypto: crypto4xx - use GFP_KERNEL for big allocations
The driver should use GFP_KERNEL for the bigger allocation during the driver's crypto4xx_probe() and not GFP_ATOMIC in my opinion. Signed-off-by: Christian Lamparter <chunkeey@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
b87b2c4d91
commit
30a50e44f9
@ -169,7 +169,7 @@ static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev)
|
|||||||
int i;
|
int i;
|
||||||
dev->pdr = dma_alloc_coherent(dev->core_dev->device,
|
dev->pdr = dma_alloc_coherent(dev->core_dev->device,
|
||||||
sizeof(struct ce_pd) * PPC4XX_NUM_PD,
|
sizeof(struct ce_pd) * PPC4XX_NUM_PD,
|
||||||
&dev->pdr_pa, GFP_ATOMIC);
|
&dev->pdr_pa, GFP_KERNEL);
|
||||||
if (!dev->pdr)
|
if (!dev->pdr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -185,13 +185,13 @@ static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev)
|
|||||||
dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device,
|
dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device,
|
||||||
sizeof(union shadow_sa_buf) * PPC4XX_NUM_PD,
|
sizeof(union shadow_sa_buf) * PPC4XX_NUM_PD,
|
||||||
&dev->shadow_sa_pool_pa,
|
&dev->shadow_sa_pool_pa,
|
||||||
GFP_ATOMIC);
|
GFP_KERNEL);
|
||||||
if (!dev->shadow_sa_pool)
|
if (!dev->shadow_sa_pool)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
dev->shadow_sr_pool = dma_alloc_coherent(dev->core_dev->device,
|
dev->shadow_sr_pool = dma_alloc_coherent(dev->core_dev->device,
|
||||||
sizeof(struct sa_state_record) * PPC4XX_NUM_PD,
|
sizeof(struct sa_state_record) * PPC4XX_NUM_PD,
|
||||||
&dev->shadow_sr_pool_pa, GFP_ATOMIC);
|
&dev->shadow_sr_pool_pa, GFP_KERNEL);
|
||||||
if (!dev->shadow_sr_pool)
|
if (!dev->shadow_sr_pool)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
for (i = 0; i < PPC4XX_NUM_PD; i++) {
|
for (i = 0; i < PPC4XX_NUM_PD; i++) {
|
||||||
@ -277,7 +277,7 @@ static u32 crypto4xx_build_gdr(struct crypto4xx_device *dev)
|
|||||||
{
|
{
|
||||||
dev->gdr = dma_alloc_coherent(dev->core_dev->device,
|
dev->gdr = dma_alloc_coherent(dev->core_dev->device,
|
||||||
sizeof(struct ce_gd) * PPC4XX_NUM_GD,
|
sizeof(struct ce_gd) * PPC4XX_NUM_GD,
|
||||||
&dev->gdr_pa, GFP_ATOMIC);
|
&dev->gdr_pa, GFP_KERNEL);
|
||||||
if (!dev->gdr)
|
if (!dev->gdr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -358,14 +358,14 @@ static u32 crypto4xx_build_sdr(struct crypto4xx_device *dev)
|
|||||||
dev->scatter_buffer_va =
|
dev->scatter_buffer_va =
|
||||||
dma_alloc_coherent(dev->core_dev->device,
|
dma_alloc_coherent(dev->core_dev->device,
|
||||||
PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD,
|
PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD,
|
||||||
&dev->scatter_buffer_pa, GFP_ATOMIC);
|
&dev->scatter_buffer_pa, GFP_KERNEL);
|
||||||
if (!dev->scatter_buffer_va)
|
if (!dev->scatter_buffer_va)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* alloc memory for scatter descriptor ring */
|
/* alloc memory for scatter descriptor ring */
|
||||||
dev->sdr = dma_alloc_coherent(dev->core_dev->device,
|
dev->sdr = dma_alloc_coherent(dev->core_dev->device,
|
||||||
sizeof(struct ce_sd) * PPC4XX_NUM_SD,
|
sizeof(struct ce_sd) * PPC4XX_NUM_SD,
|
||||||
&dev->sdr_pa, GFP_ATOMIC);
|
&dev->sdr_pa, GFP_KERNEL);
|
||||||
if (!dev->sdr)
|
if (!dev->sdr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user