Patch "PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pci-endpoint-functions-pci-epf-test-fix-dma_chan-dir.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 847a6fb2b9da4117d687f2ad0f59cd44aced7a84
Author: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
Date:   Wed Apr 12 15:34:47 2023 +0900

    PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction
    
    [ Upstream commit 880d51c729a3fa944794feb19f605eefe55916fc ]
    
    In pci_epf_test_init_dma_chan() epf_test->dma_chan_rx is assigned from
    dma_request_channel() with DMA_DEV_TO_MEM as filter.dma_mask.
    
    However, in pci_epf_test_data_transfer() if the dir is DMA_DEV_TO_MEM,
    epf->dma_chan_rx should be used but instead we are using
    epf_test->dma_chan_tx.
    
    Fix it.
    
    Link: https://lore.kernel.org/r/20230412063447.2841177-1-yoshihiro.shimoda.uh@xxxxxxxxxxx
    Fixes: 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")
    Tested-by: Kunihiko Hayashi <hayashi.kunihiko@xxxxxxxxxxxxx>
    Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
    Signed-off-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
    Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
    Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 0f9d2ec822ac6..172e5ac0bd96c 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -112,7 +112,7 @@ static int pci_epf_test_data_transfer(struct pci_epf_test *epf_test,
 				      size_t len, dma_addr_t dma_remote,
 				      enum dma_transfer_direction dir)
 {
-	struct dma_chan *chan = (dir == DMA_DEV_TO_MEM) ?
+	struct dma_chan *chan = (dir == DMA_MEM_TO_DEV) ?
 				 epf_test->dma_chan_tx : epf_test->dma_chan_rx;
 	dma_addr_t dma_local = (dir == DMA_MEM_TO_DEV) ? dma_src : dma_dst;
 	enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux