ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
Subsystems (3)
PATCH 1/1 ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
During driver probe we allocate a dma region for our event pool. Currently, zero is passed for the gfp_flags parameter. Driver probe callbacks run in process context and we hold no locks so we can sleep here if necessary.
Fix by passing GFP_KERNEL explicitly to dma_alloc_coherent().
--- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmvscsi/ibmvscsi.c +1 -1
@@ -465,7 +465,7 @@ static int initialize_event_pool(struct event_pool *pool, pool->iu_storage =dma_alloc_coherent (hostdata->dev, pool->size *sizeof (*pool->iu_storage), - &pool->iu_token,0 ); + &pool->iu_token,GFP_KERNEL );if (!pool->iu_storage) {kfree (pool->events);return -ENOMEM ;
Signature · 1 line
1.8.3.1
Quoted 18 lines · Tyrel Datwyler
During driver probe we allocate a dma region for our event pool. Currently, zero is passed for the
gfp_flagsparameter. Driver probe callbacks run in process context and we hold no locks so we can sleep here if necessary.Fix by passing
GFP_KERNELexplicitly todma_alloc_coherent().Signed-off-by Tyrel Datwyler <[email protected]>--- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/ibmvscsi/ibmvscsi.c +0
-0
drivers/scsi/ibmvscsi/ibmvscsi.c static int initialize_event_pool(struct event_pool *pool, · line 471
Quoted 8 lines
drivers/scsi/ibmvscsi/ibmvscsi.c +1
-1@@ -465,7 +465,7 @@ static int initialize_event_pool(struct event_pool *pool, pool->iu_storage =dma_alloc_coherent (hostdata->dev, pool->size *sizeof (*pool->iu_storage), - &pool->iu_token,0 ); + &pool->iu_token,GFP_KERNEL );if (!pool->iu_storage) {kfree (pool->events);return -ENOMEM ;
Signature · 3 lines
Brian King Power Linux I/O IBM Linux Technology Center
Tyrel Datwyler
maintainerJust stumbled upon this trivial little patch that looks to have gotten lost in the shuffle. Seems it even got a reviewed-by from Brian [1].
So, uh I guess after almost 3 years...ping?
-Tyrel
[1]
https://yhbt.net/lore/all/[email protected]/
Quoted 26 lines · Tyrel Datwyler
During driver probe we allocate a dma region for our event pool. Currently, zero is passed for the
gfp_flagsparameter. Driver probe callbacks run in process context and we hold no locks so we can sleep here if necessary.Fix by passing
GFP_KERNELexplicitly todma_alloc_coherent().Signed-off-by Tyrel Datwyler <[email protected]>--- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/ibmvscsi/ibmvscsi.c +1
-1@@ -465,7 +465,7 @@ static int initialize_event_pool(struct event_pool *pool, pool->iu_storage =dma_alloc_coherent (hostdata->dev, pool->size *sizeof (*pool->iu_storage), - &pool->iu_token,0 ); + &pool->iu_token,GFP_KERNEL );if (!pool->iu_storage) {kfree (pool->events);return -ENOMEM ;
Michael Ellerman
reviewerQuoted 4 lines · Tyrel Datwyler
Just stumbled upon this trivial little patch that looks to have gotten lost in the shuffle. Seems it even got a reviewed-by from Brian [1].
So, uh I guess after almost 3 years...ping?
It's marked "Changes Requested" here:
https://patchwork.kernel.org/project/linux-scsi/patch/[email protected]/
If it isn't picked up in a few days you should probably do a resend so that it reappears in patchwork.
cheers
Tyrel Datwyler
maintainerQuoted 9 lines · Michael Ellerman
Quoted 4 lines · Tyrel Datwyler
Just stumbled upon this trivial little patch that looks to have gotten lost in the shuffle. Seems it even got a reviewed-by from Brian [1].
So, uh I guess after almost 3 years...ping?
It's marked "Changes Requested" here:
https://patchwork.kernel.org/project/linux-scsi/patch/[email protected]/
Interesting
Quoted 4 lines
If it isn't picked up in a few days you should probably do a resend so that it reappears in patchwork.
Fair enough
-Tyrel
Quoted 3 lines
cheers
Martin K. Petersen
AppliedMichael,
Quoted 1 line
It's marked "Changes Requested" here:
Not sure why.
Applied to 5.16/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 8 lines · Tyrel Datwyler
During driver probe we allocate a dma region for our event pool. Currently, zero is passed for the
gfp_flagsparameter. Driver probe callbacks run in process context and we hold no locks so we can sleep here if necessary.Fix by passing
GFP_KERNELexplicitly todma_alloc_coherent().[...]
Applied to 5.16/scsi-queue, thanks!
[1/1] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
https://git.kernel.org/mkp/scsi/c/3319a8ba82b9
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering