[PATCH] nvmet: pci-epf: fix DMA channel debug print
Damien Le Moal
dlemoal at kernel.org
Fri Sep 12 05:14:24 PDT 2025
On 9/12/25 20:17, 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 so that one
> call prints the RX channel as intended.
>
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>
> ---
> drivers/nvme/target/pci-epf.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/nvme/target/pci-epf.c b/drivers/nvme/target/pci-epf.c
> index 2e78397a7373..cee3ae6f5be7 100644
> --- a/drivers/nvme/target/pci-epf.c
> +++ b/drivers/nvme/target/pci-epf.c
> @@ -310,6 +310,10 @@ static void nvmet_pci_epf_init_dma(struct nvmet_pci_epf *nvme_epf)
>
> nvme_epf->dma_rx_chan = chan;
>
> + 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)));
> +
It would be better to keep this message after "nvme_epf->dma_enabled = true" so
that it is not misleading. So I think you need to have 2 channel variables (e.g.
rxchan and txchan).
> filter.dma_mask = BIT(DMA_MEM_TO_DEV);
> chan = dma_request_channel(mask, nvmet_pci_epf_dma_filter, &filter);
> if (!chan)
> @@ -319,10 +323,6 @@ 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)));
> -
> 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)));
--
Damien Le Moal
Western Digital Research
More information about the Linux-nvme
mailing list