linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
@ 2019-01-10  2:59 Tyrel Datwyler
  2019-01-10 14:56 ` Brian King
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tyrel Datwyler @ 2019-01-10  2:59 UTC (permalink / raw)
  To: james.bottomley
  Cc: brking, linuxppc-dev, linux-scsi, martin.petersen, Tyrel Datwyler

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().

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
---
 drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index cb8535e..10d5e77 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -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;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
  2019-01-10  2:59 [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool Tyrel Datwyler
@ 2019-01-10 14:56 ` Brian King
  2021-10-14 23:15 ` Tyrel Datwyler
  2021-10-21  3:42 ` Martin K. Petersen
  2 siblings, 0 replies; 7+ messages in thread
From: Brian King @ 2019-01-10 14:56 UTC (permalink / raw)
  To: Tyrel Datwyler, james.bottomley; +Cc: linuxppc-dev, linux-scsi, martin.petersen

On 01/09/2019 08:59 PM, Tyrel Datwyler wrote:
> 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().
> 
> Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
> ---
>  drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
> index cb8535e..10d5e77 100644
> --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
> +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
> @@ -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;
> 

Reviewed-by: Brian King <brking@linux.vnet.ibm.com>

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
  2019-01-10  2:59 [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool Tyrel Datwyler
  2019-01-10 14:56 ` Brian King
@ 2021-10-14 23:15 ` Tyrel Datwyler
  2021-10-15  4:36   ` Michael Ellerman
  2021-10-21  3:42 ` Martin K. Petersen
  2 siblings, 1 reply; 7+ messages in thread
From: Tyrel Datwyler @ 2021-10-14 23:15 UTC (permalink / raw)
  To: tyreld; +Cc: brking, james.bottomley, linuxppc-dev, martin.petersen, linux-scsi

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?

-Tyrel

[1]
https://yhbt.net/lore/all/fd33df0e-012b-e437-c6e9-29cd0883808d@linux.vnet.ibm.com/

On 01/09/2019 08:59 PM, Tyrel Datwyler wrote:
> 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().
>
> Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
> ---
>  drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
> index cb8535e..10d5e77 100644
> --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
> +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
> @@ -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;
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
  2021-10-14 23:15 ` Tyrel Datwyler
@ 2021-10-15  4:36   ` Michael Ellerman
  2021-10-15 19:37     ` Tyrel Datwyler
  2021-10-17  2:20     ` Martin K. Petersen
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Ellerman @ 2021-10-15  4:36 UTC (permalink / raw)
  To: Tyrel Datwyler, tyreld
  Cc: brking, james.bottomley, linuxppc-dev, linux-scsi, martin.petersen

Tyrel Datwyler <tyreld@linux.ibm.com> writes:
> 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/1547089149-20577-1-git-send-email-tyreld@linux.vnet.ibm.com/


If it isn't picked up in a few days you should probably do a resend so
that it reappears in patchwork.

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
  2021-10-15  4:36   ` Michael Ellerman
@ 2021-10-15 19:37     ` Tyrel Datwyler
  2021-10-17  2:20     ` Martin K. Petersen
  1 sibling, 0 replies; 7+ messages in thread
From: Tyrel Datwyler @ 2021-10-15 19:37 UTC (permalink / raw)
  To: Michael Ellerman, tyreld
  Cc: brking, james.bottomley, linuxppc-dev, linux-scsi, martin.petersen

On 10/14/21 9:36 PM, Michael Ellerman wrote:
> Tyrel Datwyler <tyreld@linux.ibm.com> writes:
>> 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/1547089149-20577-1-git-send-email-tyreld@linux.vnet.ibm.com/

Interesting

> 
> 
> 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

> 
> cheers
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
  2021-10-15  4:36   ` Michael Ellerman
  2021-10-15 19:37     ` Tyrel Datwyler
@ 2021-10-17  2:20     ` Martin K. Petersen
  1 sibling, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2021-10-17  2:20 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Tyrel Datwyler, linux-scsi, martin.petersen, james.bottomley,
	tyreld, brking, linuxppc-dev


Michael,

> It's marked "Changes Requested" here:

Not sure why.

Applied to 5.16/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool
  2019-01-10  2:59 [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool Tyrel Datwyler
  2019-01-10 14:56 ` Brian King
  2021-10-14 23:15 ` Tyrel Datwyler
@ 2021-10-21  3:42 ` Martin K. Petersen
  2 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2021-10-21  3:42 UTC (permalink / raw)
  To: james.bottomley, Tyrel Datwyler
  Cc: brking, linuxppc-dev, linux-scsi, Martin K . Petersen

On Wed, 9 Jan 2019 18:59:09 -0800, Tyrel Datwyler wrote:

> 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().
> 
> [...]

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

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-21  3:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10  2:59 [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool Tyrel Datwyler
2019-01-10 14:56 ` Brian King
2021-10-14 23:15 ` Tyrel Datwyler
2021-10-15  4:36   ` Michael Ellerman
2021-10-15 19:37     ` Tyrel Datwyler
2021-10-17  2:20     ` Martin K. Petersen
2021-10-21  3:42 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).