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

Mohamed Khalfella posted 1 patch 1 year, 1 month ago
drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] PCI: endpoint: Set RX DMA channel to NULL aftre freeing it
Posted by Mohamed Khalfella 1 year, 1 month ago
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")

Signed-off-by: Mohamed Khalfella <khalfella@gmail.com>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index ef6677f34116..d90c8be7371e 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -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);
-- 
2.45.2
Re: [PATCH] PCI: endpoint: Set RX DMA channel to NULL aftre freeing it
Posted by Markus Elfring 1 year, 1 month ago
> Fixed a small bug in pci-epf-test driver. …

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

Regards,
Markus
Re: [PATCH] PCI: endpoint: Set RX DMA channel to NULL aftre freeing it
Posted by Mohamed Khalfella 1 year, 1 month ago
On 2024-12-21 20:18:24 +0100, Markus Elfring wrote:
> > 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.
Re: [PATCH] PCI: endpoint: Set RX DMA channel to NULL aftre freeing it
Posted by Niklas Cassel 1 year, 1 month ago
Hello Mohamed,

in subject s/aftre/after/

On Fri, Dec 20, 2024 at 07:00:00PM -0800, Mohamed Khalfella wrote:
> 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 .."

> 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:
Reviewed-by: Niklas Cassel <cassel@kernel.org>
when sending out V2.

> Signed-off-by: Mohamed Khalfella <khalfella@gmail.com>
> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index ef6677f34116..d90c8be7371e 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -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);
> -- 
> 2.45.2
>
[PATCH v2] PCI: endpoint: Set RX DMA channel to NULL after freeing it
Posted by Mohamed Khalfella 1 year, 1 month ago
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")
Signed-off-by: Mohamed Khalfella <khalfella@gmail.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index ef6677f34116..d90c8be7371e 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -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);
-- 
2.45.2
Re: [PATCH v2] PCI: endpoint: Set RX DMA channel to NULL after freeing it
Posted by Manivannan Sadhasivam 1 year, 1 month ago
On Sat, Dec 21, 2024 at 09:34:42AM -0800, Mohamed Khalfella wrote:
> 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

> Fixes: 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")
> Signed-off-by: Mohamed Khalfella <khalfella@gmail.com>
> Reviewed-by: Niklas Cassel <cassel@kernel.org>
> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index ef6677f34116..d90c8be7371e 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -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);
> -- 
> 2.45.2
> 

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH v2] PCI: endpoint: Set RX DMA channel to NULL after freeing it
Posted by Mohamed Khalfella 1 year, 1 month ago
On 2024-12-26 22:01:21 +0530, Manivannan Sadhasivam wrote:
> On Sat, Dec 21, 2024 at 09:34:42AM -0800, Mohamed Khalfella wrote:
> > 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?
Re: [PATCH v2] PCI: endpoint: Set RX DMA channel to NULL after freeing it
Posted by Manivannan Sadhasivam 1 year, 1 month ago
On Thu, Dec 26, 2024 at 09:51:37AM -0800, Mohamed Khalfella wrote:
> On 2024-12-26 22:01:21 +0530, Manivannan Sadhasivam wrote:
> > On Sat, Dec 21, 2024 at 09:34:42AM -0800, Mohamed Khalfella wrote:
> > > 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.
> 

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

- Mani

-- 
மணிவண்ணன் சதாசிவம்
[PATCH v3] PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx
Posted by Mohamed Khalfella 1 year, 1 month ago
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")
Signed-off-by: Mohamed Khalfella <khalfella@gmail.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index ef6677f34116..d90c8be7371e 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -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);
-- 
2.45.2
Re: [PATCH v3] PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx
Posted by Krzysztof Wilczyński 1 year ago
Hello,

> 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
Re: [PATCH v3] PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx
Posted by Manivannan Sadhasivam 1 year, 1 month ago
On Fri, Dec 27, 2024 at 08:08:41AM -0800, Mohamed Khalfella wrote:
> 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")
> Signed-off-by: Mohamed Khalfella <khalfella@gmail.com>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

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

- Mani

> Reviewed-by: Niklas Cassel <cassel@kernel.org>
> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index ef6677f34116..d90c8be7371e 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -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);
> -- 
> 2.45.2
> 

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH v3] PCI: endpoint: pci-epf-test: Fix NULL ptr assignment to dma_chan_rx
Posted by Mohamed Khalfella 1 year, 1 month ago
On 2024-12-30 12:56:45 +0530, Manivannan Sadhasivam wrote:
> On Fri, Dec 27, 2024 at 08:08:41AM -0800, Mohamed Khalfella wrote:
> > 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")
> > Signed-off-by: Mohamed Khalfella <khalfella@gmail.com>
> 
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> 
> 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.