All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma
@ 2022-02-16  7:21 Jie Hai
  2022-02-23  3:30 ` Zhou Wang
  2022-03-23 11:10 ` Dongdong Liu
  0 siblings, 2 replies; 4+ messages in thread
From: Jie Hai @ 2022-02-16  7:21 UTC (permalink / raw)
  To: wangzhou1, vkoul; +Cc: dmaengine, linux-kernel

Remove the loaded hisi_dma driver and reload it, the driver fails
to work properly. The following error is reported in the kernel log:

[ 1475.597609] hisi_dma 0000:7b:00.0: Failed to allocate MSI vectors!
[ 1475.604915] hisi_dma: probe of 0000:7b:00.0 failed with error -28

As noted in "The MSI Driver Guide HOWTO"[1], the number of MSI
interrupt must be a power of two. The Kunpeng DMA driver allocates 30
MSI interrupts. As a result, no space left on device is reported
when the driver is reloaded and allocates interrupt vectors from the
interrupt domain.

This patch changes the number of interrupt vectors allocated by
hisi_dma driver to 32 to avoid this problem.

[1] https://www.kernel.org/doc/html/latest/PCI/msi-howto.html

Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine support")

Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/dma/hisi_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c
index 97c87a7cba87..43817ced3a3e 100644
--- a/drivers/dma/hisi_dma.c
+++ b/drivers/dma/hisi_dma.c
@@ -30,7 +30,7 @@
 #define HISI_DMA_MODE			0x217c
 #define HISI_DMA_OFFSET			0x100
 
-#define HISI_DMA_MSI_NUM		30
+#define HISI_DMA_MSI_NUM		32
 #define HISI_DMA_CHAN_NUM		30
 #define HISI_DMA_Q_DEPTH_VAL		1024
 
-- 
2.33.0


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

* Re: [PATCH] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma
  2022-02-16  7:21 [PATCH] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma Jie Hai
@ 2022-02-23  3:30 ` Zhou Wang
  2022-03-09  4:05   ` haijie
  2022-03-23 11:10 ` Dongdong Liu
  1 sibling, 1 reply; 4+ messages in thread
From: Zhou Wang @ 2022-02-23  3:30 UTC (permalink / raw)
  To: Jie Hai, vkoul; +Cc: dmaengine, linux-kernel

> Remove the loaded hisi_dma driver and reload it, the driver fails
> to work properly. The following error is reported in the kernel log:
> 
> [ 1475.597609] hisi_dma 0000:7b:00.0: Failed to allocate MSI vectors!
> [ 1475.604915] hisi_dma: probe of 0000:7b:00.0 failed with error -28
> 
> As noted in "The MSI Driver Guide HOWTO"[1], the number of MSI
> interrupt must be a power of two. The Kunpeng DMA driver allocates 30
> MSI interrupts. As a result, no space left on device is reported
> when the driver is reloaded and allocates interrupt vectors from the
> interrupt domain.
> 
> This patch changes the number of interrupt vectors allocated by
> hisi_dma driver to 32 to avoid this problem.
> 
> [1] https://www.kernel.org/doc/html/latest/PCI/msi-howto.html
> 
> Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine support")
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>

Thanks for fixing it.

Acked-by: Zhou Wang <wangzhou1@hisilicon.com>

Best,
Zhou

> ---
>  drivers/dma/hisi_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c
> index 97c87a7cba87..43817ced3a3e 100644
> --- a/drivers/dma/hisi_dma.c
> +++ b/drivers/dma/hisi_dma.c
> @@ -30,7 +30,7 @@
>  #define HISI_DMA_MODE			0x217c
>  #define HISI_DMA_OFFSET			0x100
>  
> -#define HISI_DMA_MSI_NUM		30
> +#define HISI_DMA_MSI_NUM		32
>  #define HISI_DMA_CHAN_NUM		30
>  #define HISI_DMA_Q_DEPTH_VAL		1024
>  
> 

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

* RE: [PATCH] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma
  2022-02-23  3:30 ` Zhou Wang
@ 2022-03-09  4:05   ` haijie
  0 siblings, 0 replies; 4+ messages in thread
From: haijie @ 2022-03-09  4:05 UTC (permalink / raw)
  To: vkoul; +Cc: dmaengine, linux-kernel

hello, kindly ping for review status. :)

-----Original Message-----
From: Wangzhou (B) 
Sent: Wednesday, February 23, 2022 11:30 AM
To: haijie <haijie1@huawei.com>; vkoul@kernel.org
Cc: dmaengine@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma

> Remove the loaded hisi_dma driver and reload it, the driver fails to 
> work properly. The following error is reported in the kernel log:
> 
> [ 1475.597609] hisi_dma 0000:7b:00.0: Failed to allocate MSI vectors!
> [ 1475.604915] hisi_dma: probe of 0000:7b:00.0 failed with error -28
> 
> As noted in "The MSI Driver Guide HOWTO"[1], the number of MSI 
> interrupt must be a power of two. The Kunpeng DMA driver allocates 30 
> MSI interrupts. As a result, no space left on device is reported when 
> the driver is reloaded and allocates interrupt vectors from the 
> interrupt domain.
> 
> This patch changes the number of interrupt vectors allocated by 
> hisi_dma driver to 32 to avoid this problem.
> 
> [1] https://www.kernel.org/doc/html/latest/PCI/msi-howto.html
> 
> Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine 
> support")
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>

Thanks for fixing it.

Acked-by: Zhou Wang <wangzhou1@hisilicon.com>

Best,
Zhou

> ---
>  drivers/dma/hisi_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c index 
> 97c87a7cba87..43817ced3a3e 100644
> --- a/drivers/dma/hisi_dma.c
> +++ b/drivers/dma/hisi_dma.c
> @@ -30,7 +30,7 @@
>  #define HISI_DMA_MODE			0x217c
>  #define HISI_DMA_OFFSET			0x100
>  
> -#define HISI_DMA_MSI_NUM		30
> +#define HISI_DMA_MSI_NUM		32
>  #define HISI_DMA_CHAN_NUM		30
>  #define HISI_DMA_Q_DEPTH_VAL		1024
>  
> 

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

* Re: [PATCH] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma
  2022-02-16  7:21 [PATCH] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma Jie Hai
  2022-02-23  3:30 ` Zhou Wang
@ 2022-03-23 11:10 ` Dongdong Liu
  1 sibling, 0 replies; 4+ messages in thread
From: Dongdong Liu @ 2022-03-23 11:10 UTC (permalink / raw)
  To: Jie Hai, wangzhou1, vkoul; +Cc: dmaengine, linux-kernel

Looks good.

Reviewed-by: Dongdong Liu <liudongdong3@huawei.com>

Thanks,
Dongdong
On 2022/2/16 15:21, Jie Hai wrote:
> Remove the loaded hisi_dma driver and reload it, the driver fails
> to work properly. The following error is reported in the kernel log:
>
> [ 1475.597609] hisi_dma 0000:7b:00.0: Failed to allocate MSI vectors!
> [ 1475.604915] hisi_dma: probe of 0000:7b:00.0 failed with error -28
>
> As noted in "The MSI Driver Guide HOWTO"[1], the number of MSI
> interrupt must be a power of two. The Kunpeng DMA driver allocates 30
> MSI interrupts. As a result, no space left on device is reported
> when the driver is reloaded and allocates interrupt vectors from the
> interrupt domain.
>
> This patch changes the number of interrupt vectors allocated by
> hisi_dma driver to 32 to avoid this problem.
>
> [1] https://www.kernel.org/doc/html/latest/PCI/msi-howto.html
>
> Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine support")
>
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> ---
>  drivers/dma/hisi_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c
> index 97c87a7cba87..43817ced3a3e 100644
> --- a/drivers/dma/hisi_dma.c
> +++ b/drivers/dma/hisi_dma.c
> @@ -30,7 +30,7 @@
>  #define HISI_DMA_MODE			0x217c
>  #define HISI_DMA_OFFSET			0x100
>
> -#define HISI_DMA_MSI_NUM		30
> +#define HISI_DMA_MSI_NUM		32
>  #define HISI_DMA_CHAN_NUM		30
>  #define HISI_DMA_Q_DEPTH_VAL		1024
>
>

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

end of thread, other threads:[~2022-03-23 11:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16  7:21 [PATCH] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma Jie Hai
2022-02-23  3:30 ` Zhou Wang
2022-03-09  4:05   ` haijie
2022-03-23 11:10 ` Dongdong Liu

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.