[PATCH v2 3/5] PCI: epf-mhi: Use a define for the DMA transfer timeout
Sumit Kumar <[email protected]> Mon, 03 Aug 2026 16:01:45 +0530
| Newsgroups | org.kernel.vger.dmaengine,dev.linux.lists.mhi,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <[email protected]> |
The eDMA read and write paths open-code a 1000 ms completion timeout as a msecs_to_jiffies(1000) literal. Replace both with a PCI_EPF_MHI_DMA_TIMEOUT_MS define so the value is named and shared. No functional change. Signed-off-by: Sumit Kumar <[email protected]> --- drivers/pci/endpoint/functions/pci-epf-mhi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index c3e3b58fb86cd75e175b69ca45530610c500b99e..6bac69fc84b472c5f1abbeede2b441b5db73c784 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -21,6 +21,8 @@ /* Platform specific flags */ #define MHI_EPF_USE_DMA BIT(0) +#define PCI_EPF_MHI_DMA_TIMEOUT_MS 1000 + struct pci_epf_mhi_dma_transfer { struct pci_epf_mhi *epf_mhi; struct mhi_ep_buf_info buf_info; @@ -357,7 +359,7 @@ static int pci_epf_mhi_edma_read(struct mhi_ep_cntrl *mhi_cntrl, } dma_async_issue_pending(chan); - ret = wait_for_completion_timeout(&complete, msecs_to_jiffies(1000)); + ret = wait_for_completion_timeout(&complete, msecs_to_jiffies(PCI_EPF_MHI_DMA_TIMEOUT_MS)); if (!ret) { dev_err(dev, "DMA transfer timeout\n"); dmaengine_terminate_sync(chan); @@ -425,7 +427,7 @@ static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl, } dma_async_issue_pending(chan); - ret = wait_for_completion_timeout(&complete, msecs_to_jiffies(1000)); + ret = wait_for_completion_timeout(&complete, msecs_to_jiffies(PCI_EPF_MHI_DMA_TIMEOUT_MS)); if (!ret) { dev_err(dev, "DMA transfer timeout\n"); dmaengine_terminate_sync(chan); -- 2.34.1