Skip to contentSkip to conversation

PCI: endpoint: Set RX DMA channel to NULL aftre freeing it

PATCH Superseded Mohamed Khalfella 5 participants 12 messages Dec 21, 2024 – Jan 15, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: endpoint: Set RX DMA channel to NULL aftre freeing it

Fixed a small bug in pci-epf-test driver. When requesting TX DMA channel fails, free already allocated RX channel and set it to NULL.

Fixes 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-test.c +1 -1
index ef6677f34116..d90c8be7371e 100644
@@ -251,7 +251,7 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test)
 
 fail_back_rx:
 	dma_release_channel(epf_test->dma_chan_rx);
-	epf_test->dma_chan_tx = NULL;
+	epf_test->dma_chan_rx = NULL;
 
 fail_back_tx:
 	dma_cap_zero(mask);
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#1 lore raw

Hello Mohamed,

in subject s/aftre/after/

Quoted 3 lines · Mohamed Khalfella

Fixed a small bug in pci-epf-test driver. When requesting TX DMA channel fails, free already allocated RX channel and set it to NULL.

Commit messages should be written in imperative.

I.e. "Fix .." instead of Fixed .."

Quoted 2 lines
Fixes 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")

There should be no empty line between the Fixes: tag and your
Signed-off-by: tag, see:
https://docs.kernel.org/process/submitting-patches.html

With the three comments fixed, feel free to add:

when sending out V2.

Quoted 21 lines
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-test.c +1 -1
index ef6677f34116..d90c8be7371e 100644
@@ -251,7 +251,7 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test)
 
 fail_back_rx:
 	dma_release_channel(epf_test->dma_chan_rx);
-	epf_test->dma_chan_tx = NULL;
+	epf_test->dma_chan_rx = NULL;
 
 fail_back_tx:
 	dma_cap_zero(mask);
Signature · 1 line
2.45.2
#2 lore raw

PATCH v2 1/1 PCI: endpoint: Set RX DMA channel to NULL after freeing it

Fix a small bug in pci-epf-test driver. When requesting TX DMA channel fails, free already allocated RX channel and set it to NULL.

Fixes 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-test.c +1 -1
index ef6677f34116..d90c8be7371e 100644
@@ -251,7 +251,7 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test)
 
 fail_back_rx:
 	dma_release_channel(epf_test->dma_chan_rx);
-	epf_test->dma_chan_tx = NULL;
+	epf_test->dma_chan_rx = NULL;
 
 fail_back_tx:
 	dma_cap_zero(mask);
Signature · 1 line
2.45.2
#3 lore raw

Re: [PATCH v2] PCI: endpoint: Set RX DMA channel to NULL after freeing it

Quoted 3 lines · Mohamed Khalfella

Fix a small bug in pci-epf-test driver. When requesting TX DMA channel fails, free already allocated RX channel and set it to NULL.

Patch description should accurately describe what the patch does. Here, the patch is fixing the NULL ptr assignment to dma_chan_rx pointer and that's it.

Reword it as such.

- Mani

Quoted 23 lines
Fixes 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-test.c +1 -1
index ef6677f34116..d90c8be7371e 100644
@@ -251,7 +251,7 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test)
 
 fail_back_rx:
 	dma_release_channel(epf_test->dma_chan_rx);
-	epf_test->dma_chan_tx = NULL;
+	epf_test->dma_chan_rx = NULL;
 
 fail_back_tx:
 	dma_cap_zero(mask);
Signature · 1 line
2.45.2
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#4 lore raw

Re: [PATCH v2] PCI: endpoint: Set RX DMA channel to NULL after freeing it

Quoted 9 lines · Manivannan Sadhasivam
Quoted 3 lines · Mohamed Khalfella

Fix a small bug in pci-epf-test driver. When requesting TX DMA channel fails, free already allocated RX channel and set it to NULL.

Patch description should accurately describe what the patch does. Here, the patch is fixing the NULL ptr assignment to dma_chan_rx pointer and that's it.

Reword it as such.

PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx

When allocating dma_chan_tx fails set dma_chan_rx to NULL after it is freed.

How about the updated subject line and commit message above?

#5 lore raw

Re: [PATCH v2] PCI: endpoint: Set RX DMA channel to NULL after freeing it

Quoted 9 lines · Mohamed Khalfella
Quoted 8 lines · Manivannan Sadhasivam
Quoted 3 lines · Mohamed Khalfella

Fix a small bug in pci-epf-test driver. When requesting TX DMA channel fails, free already allocated RX channel and set it to NULL.

Patch description should accurately describe what the patch does. Here, the patch is fixing the NULL ptr assignment to dma_chan_rx pointer and that's it.

Quoted 7 lines
Quoted 1 line

Reword it as such.

PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx

When allocating dma_chan_tx fails set dma_chan_rx to NULL after it is freed.

s/"When allocating dma_chan_tx fails"/"If dma_chan_tx allocation fails,"

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்
#6 lore raw

PATCH v3 1/1 PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx

If dma_chan_tx allocation fails, set dma_chan_rx to NULL after it is freed.

Fixes 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-test.c +1 -1
index ef6677f34116..d90c8be7371e 100644
@@ -251,7 +251,7 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test)
 
 fail_back_rx:
 	dma_release_channel(epf_test->dma_chan_rx);
-	epf_test->dma_chan_tx = NULL;
+	epf_test->dma_chan_rx = NULL;
 
 fail_back_tx:
 	dma_cap_zero(mask);
Signature · 1 line
2.45.2
Reviewed-by on v3 1/1
#7 lore raw

Re: [PATCH v3] PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx

Quoted 5 lines · Mohamed Khalfella

If dma_chan_tx allocation fails, set dma_chan_rx to NULL after it is freed.

Fixes 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")

Btw, you are sending next version as a reply to the previous one. But you should send it separately.

- Mani

Quoted 21 lines
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-test.c +1 -1
index ef6677f34116..d90c8be7371e 100644
@@ -251,7 +251,7 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test)
 
 fail_back_rx:
 	dma_release_channel(epf_test->dma_chan_rx);
-	epf_test->dma_chan_tx = NULL;
+	epf_test->dma_chan_rx = NULL;
 
 fail_back_tx:
 	dma_cap_zero(mask);
Signature · 1 line
2.45.2
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#8 lore raw

Re: [PATCH v3] PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx

Quoted 4 lines · Manivannan Sadhasivam
Quoted 3 lines · Mohamed Khalfella

If dma_chan_tx allocation fails, set dma_chan_rx to NULL after it is freed.

Quoted 8 lines
Quoted 2 lines
Fixes 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")

Btw, you are sending next version as a reply to the previous one. But you should send it separately.

Noted. Next time will try to do that.

#9 lore raw

Re: [PATCH v3] PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx

In reply to Mohamed Khalfella

Hello,

Quoted 2 lines

If dma_chan_tx allocation fails, set dma_chan_rx to NULL after it is freed.

Applied to endpoint for v6.14, thank you!

Krzysztof

#11 lore raw
Quoted 3 lines · Markus Elfring
Quoted 1 line

Fixed a small bug in pci-epf-test driver. …

Please avoid a typo in the summary phrase for the final commit.

"Fixed" was changed to "Fix" in v2 of this patch. Does the typo still exist in v2? If so, please point it out.