All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] uio: uio_dmem_genirq: Catch the Exception
@ 2021-12-02  9:18 Jiasheng Jiang
  2021-12-03 14:17 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jiasheng Jiang @ 2021-12-02  9:18 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Jiasheng Jiang

The return value of dma_set_coherent_mask() is not always 0.
To catch the exception in case that dma is not support the mask.

Fixes: 0a0c3b5a24bd ("Add new uio device for dynamic memory allocation")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 drivers/uio/uio_dmem_genirq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c
index 6b5cfa5b0673..570f5be64b46 100644
--- a/drivers/uio/uio_dmem_genirq.c
+++ b/drivers/uio/uio_dmem_genirq.c
@@ -188,7 +188,9 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+	ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+	if (ret)
+		return ret;
 
 	priv->uioinfo = uioinfo;
 	spin_lock_init(&priv->lock);
-- 
2.25.1


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

* Re: [PATCH RESEND] uio: uio_dmem_genirq: Catch the Exception
  2021-12-02  9:18 [PATCH RESEND] uio: uio_dmem_genirq: Catch the Exception Jiasheng Jiang
@ 2021-12-03 14:17 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-12-03 14:17 UTC (permalink / raw)
  To: Jiasheng Jiang; +Cc: linux-kernel

On Thu, Dec 02, 2021 at 05:18:39PM +0800, Jiasheng Jiang wrote:
> The return value of dma_set_coherent_mask() is not always 0.
> To catch the exception in case that dma is not support the mask.
> 
> Fixes: 0a0c3b5a24bd ("Add new uio device for dynamic memory allocation")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>  drivers/uio/uio_dmem_genirq.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c
> index 6b5cfa5b0673..570f5be64b46 100644
> --- a/drivers/uio/uio_dmem_genirq.c
> +++ b/drivers/uio/uio_dmem_genirq.c
> @@ -188,7 +188,9 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	}
>  
> -	dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
> +	ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
> +	if (ret)
> +		return ret;

Please print out an error like the other failures above this in the
function.

And why is this a RESEND?  When was it sent before?

thanks,

greg k-h

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

end of thread, other threads:[~2021-12-03 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02  9:18 [PATCH RESEND] uio: uio_dmem_genirq: Catch the Exception Jiasheng Jiang
2021-12-03 14:17 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.