Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] nvmet: pci-epf: fix DMA channel debug print
@ 2025-09-13  6:53 Shin'ichiro Kawasaki
  2025-09-13  6:58 ` Damien Le Moal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shin'ichiro Kawasaki @ 2025-09-13  6:53 UTC (permalink / raw)
  To: linux-nvme, Keith Busch
  Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni,
	Niklas Cassel, Damien Le Moal, Shin'ichiro Kawasaki

Currently, nvmet_pci_epf_init_dma() has two dev_dbg() calls intended to
print debug information about the DMA channels for RX and TX. However,
both calls mistakenly are made for the TX channel. Fix it by referreing
to 'nvme_epf->rx_chan' and 'nvme_epf->tx_chan' and instead of the local
variable 'chan'.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
Changes from v1:
* Refer to nvme_epf->dma_[rt]x_chan and do not move the dev_dbg() call

 drivers/nvme/target/pci-epf.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/target/pci-epf.c b/drivers/nvme/target/pci-epf.c
index 2e78397a7373..4bfecb0c7ee4 100644
--- a/drivers/nvme/target/pci-epf.c
+++ b/drivers/nvme/target/pci-epf.c
@@ -320,12 +320,14 @@ static void nvmet_pci_epf_init_dma(struct nvmet_pci_epf *nvme_epf)
 	nvme_epf->dma_enabled = true;
 
 	dev_dbg(dev, "Using DMA RX channel %s, maximum segment size %u B\n",
-		dma_chan_name(chan),
-		dma_get_max_seg_size(dmaengine_get_dma_device(chan)));
+		dma_chan_name(nvme_epf->dma_rx_chan),
+		dma_get_max_seg_size(dmaengine_get_dma_device(nvme_epf->
+							      dma_rx_chan)));
 
 	dev_dbg(dev, "Using DMA TX channel %s, maximum segment size %u B\n",
-		dma_chan_name(chan),
-		dma_get_max_seg_size(dmaengine_get_dma_device(chan)));
+		dma_chan_name(nvme_epf->dma_tx_chan),
+		dma_get_max_seg_size(dmaengine_get_dma_device(nvme_epf->
+							      dma_tx_chan)));
 
 	return;
 
-- 
2.51.0



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

* Re: [PATCH v2] nvmet: pci-epf: fix DMA channel debug print
  2025-09-13  6:53 [PATCH v2] nvmet: pci-epf: fix DMA channel debug print Shin'ichiro Kawasaki
@ 2025-09-13  6:58 ` Damien Le Moal
  2025-10-09 12:45 ` Niklas Cassel
  2025-10-09 15:05 ` Keith Busch
  2 siblings, 0 replies; 4+ messages in thread
From: Damien Le Moal @ 2025-09-13  6:58 UTC (permalink / raw)
  To: Shin'ichiro Kawasaki, linux-nvme, Keith Busch
  Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni,
	Niklas Cassel

On 9/13/25 15:53, Shin'ichiro Kawasaki wrote:
> Currently, nvmet_pci_epf_init_dma() has two dev_dbg() calls intended to
> print debug information about the DMA channels for RX and TX. However,
> both calls mistakenly are made for the TX channel. Fix it by referreing
> to 'nvme_epf->rx_chan' and 'nvme_epf->tx_chan' and instead of the local
> variable 'chan'.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

Looks good.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research


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

* Re: [PATCH v2] nvmet: pci-epf: fix DMA channel debug print
  2025-09-13  6:53 [PATCH v2] nvmet: pci-epf: fix DMA channel debug print Shin'ichiro Kawasaki
  2025-09-13  6:58 ` Damien Le Moal
@ 2025-10-09 12:45 ` Niklas Cassel
  2025-10-09 15:05 ` Keith Busch
  2 siblings, 0 replies; 4+ messages in thread
From: Niklas Cassel @ 2025-10-09 12:45 UTC (permalink / raw)
  To: Shin'ichiro Kawasaki
  Cc: linux-nvme, Keith Busch, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Damien Le Moal

On Sat, Sep 13, 2025 at 03:53:50PM +0900, Shin'ichiro Kawasaki wrote:
> Currently, nvmet_pci_epf_init_dma() has two dev_dbg() calls intended to
> print debug information about the DMA channels for RX and TX. However,
> both calls mistakenly are made for the TX channel. Fix it by referreing
> to 'nvme_epf->rx_chan' and 'nvme_epf->tx_chan' and instead of the local
> variable 'chan'.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---
> Changes from v1:
> * Refer to nvme_epf->dma_[rt]x_chan and do not move the dev_dbg() call
> 
>  drivers/nvme/target/pci-epf.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/nvme/target/pci-epf.c b/drivers/nvme/target/pci-epf.c
> index 2e78397a7373..4bfecb0c7ee4 100644
> --- a/drivers/nvme/target/pci-epf.c
> +++ b/drivers/nvme/target/pci-epf.c
> @@ -320,12 +320,14 @@ static void nvmet_pci_epf_init_dma(struct nvmet_pci_epf *nvme_epf)
>  	nvme_epf->dma_enabled = true;
>  
>  	dev_dbg(dev, "Using DMA RX channel %s, maximum segment size %u B\n",
> -		dma_chan_name(chan),
> -		dma_get_max_seg_size(dmaengine_get_dma_device(chan)));
> +		dma_chan_name(nvme_epf->dma_rx_chan),
> +		dma_get_max_seg_size(dmaengine_get_dma_device(nvme_epf->
> +							      dma_rx_chan)));
>  
>  	dev_dbg(dev, "Using DMA TX channel %s, maximum segment size %u B\n",
> -		dma_chan_name(chan),
> -		dma_get_max_seg_size(dmaengine_get_dma_device(chan)));
> +		dma_chan_name(nvme_epf->dma_tx_chan),
> +		dma_get_max_seg_size(dmaengine_get_dma_device(nvme_epf->
> +							      dma_tx_chan)));
>  
>  	return;
>  
> -- 
> 2.51.0

Gentle ping


Kind regards,
Niklas


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

* Re: [PATCH v2] nvmet: pci-epf: fix DMA channel debug print
  2025-09-13  6:53 [PATCH v2] nvmet: pci-epf: fix DMA channel debug print Shin'ichiro Kawasaki
  2025-09-13  6:58 ` Damien Le Moal
  2025-10-09 12:45 ` Niklas Cassel
@ 2025-10-09 15:05 ` Keith Busch
  2 siblings, 0 replies; 4+ messages in thread
From: Keith Busch @ 2025-10-09 15:05 UTC (permalink / raw)
  To: Shin'ichiro Kawasaki
  Cc: linux-nvme, Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni,
	Niklas Cassel, Damien Le Moal

On Sat, Sep 13, 2025 at 03:53:50PM +0900, Shin'ichiro Kawasaki wrote:
> Currently, nvmet_pci_epf_init_dma() has two dev_dbg() calls intended to
> print debug information about the DMA channels for RX and TX. However,
> both calls mistakenly are made for the TX channel. Fix it by referreing
> to 'nvme_epf->rx_chan' and 'nvme_epf->tx_chan' and instead of the local
> variable 'chan'.

Thanks, applied to nvme-6.19.


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

end of thread, other threads:[~2025-10-09 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-13  6:53 [PATCH v2] nvmet: pci-epf: fix DMA channel debug print Shin'ichiro Kawasaki
2025-09-13  6:58 ` Damien Le Moal
2025-10-09 12:45 ` Niklas Cassel
2025-10-09 15:05 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox