linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
@ 2023-09-19  7:46 Dhruva Gole
  2023-09-21 12:03 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dhruva Gole @ 2023-09-19  7:46 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, Dhruva Gole,
	kernel test robot, Dan Carpenter

The following smatch warnings [0] were recently introduced:

drivers/spi/spi-cadence-quadspi.c:1882 cqspi_probe() warn: missing
unwind goto?

Fix these warnings by releasing dma channel and adding a goto fail probe.

[0] https://lore.kernel.org/all/5e21c351-cd08-443e-8509-aecf242a4da9@kadam.mountain/

Fixes: 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202309140543.03dMbMM5-lkp@intel.com/
Signed-off-by: Dhruva Gole <d-gole@ti.com>
---

Link to V1:
https://lore.kernel.org/all/20230915123103.2493640-1-d-gole@ti.com/

Changelog:
* added dma_release_channel
* added a fixes tag.

 drivers/spi/spi-cadence-quadspi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 4828da4587c5..3d7bf62da11c 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1878,8 +1878,11 @@ static int cqspi_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_pm_runtime_enable(dev);
-	if (ret)
-		return ret;
+	if (ret) {
+		if (cqspi->rx_chan)
+			dma_release_channel(cqspi->rx_chan);
+		goto probe_setup_failed;
+	}
 
 	pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT);
 	pm_runtime_use_autosuspend(dev);

base-commit: 21f252cd29f08892d48739fd7513ad79c1cff96a
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
  2023-09-19  7:46 [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings Dhruva Gole
@ 2023-09-21 12:03 ` Dan Carpenter
  2023-09-26 11:21 ` Mark Brown
  2023-09-26 15:07 ` Mark Brown
  2 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2023-09-21 12:03 UTC (permalink / raw)
  To: Dhruva Gole
  Cc: Mark Brown, linux-spi, linux-kernel, Vignesh Raghavendra,
	kernel test robot

On Tue, Sep 19, 2023 at 01:16:59PM +0530, Dhruva Gole wrote:
> The following smatch warnings [0] were recently introduced:
> 
> drivers/spi/spi-cadence-quadspi.c:1882 cqspi_probe() warn: missing
> unwind goto?
> 
> Fix these warnings by releasing dma channel and adding a goto fail probe.
> 
> [0] https://lore.kernel.org/all/5e21c351-cd08-443e-8509-aecf242a4da9@kadam.mountain/

Really this should be the Closes: link.  I should edit the zero day
bot emails to send the correct link.

That's going to be slightly more complicated than you might assume...

I'm travelling now so I won't do it today.

regards,
dan carpenter

> 
> Fixes: 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support")
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/r/202309140543.03dMbMM5-lkp@intel.com/
> Signed-off-by: Dhruva Gole <d-gole@ti.com>
> ---
> 
> Link to V1:
> https://lore.kernel.org/all/20230915123103.2493640-1-d-gole@ti.com/
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
  2023-09-19  7:46 [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings Dhruva Gole
  2023-09-21 12:03 ` Dan Carpenter
@ 2023-09-26 11:21 ` Mark Brown
  2023-09-26 11:34   ` Dhruva Gole
  2023-09-26 11:40   ` Dhruva Gole
  2023-09-26 15:07 ` Mark Brown
  2 siblings, 2 replies; 10+ messages in thread
From: Mark Brown @ 2023-09-26 11:21 UTC (permalink / raw)
  To: Dhruva Gole
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, kernel test robot,
	Dan Carpenter

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

On Tue, Sep 19, 2023 at 01:16:59PM +0530, Dhruva Gole wrote:
> The following smatch warnings [0] were recently introduced:
> 
> drivers/spi/spi-cadence-quadspi.c:1882 cqspi_probe() warn: missing
> unwind goto?

This doesn't apply against current code, please check and resend.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
  2023-09-26 11:21 ` Mark Brown
@ 2023-09-26 11:34   ` Dhruva Gole
  2023-09-26 11:40   ` Dhruva Gole
  1 sibling, 0 replies; 10+ messages in thread
From: Dhruva Gole @ 2023-09-26 11:34 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, kernel test robot,
	Dan Carpenter

On Sep 26, 2023 at 13:21:04 +0200, Mark Brown wrote:
> On Tue, Sep 19, 2023 at 01:16:59PM +0530, Dhruva Gole wrote:
> > The following smatch warnings [0] were recently introduced:
> > 
> > drivers/spi/spi-cadence-quadspi.c:1882 cqspi_probe() warn: missing
> > unwind goto?
> 
> This doesn't apply against current code, please check and resend.

OK, will rebase and send along with the fixed closes tag.



-- 
Best regards,
Dhruva Gole <d-gole@ti.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
  2023-09-26 11:21 ` Mark Brown
  2023-09-26 11:34   ` Dhruva Gole
@ 2023-09-26 11:40   ` Dhruva Gole
  2023-09-26 11:58     ` Mark Brown
  1 sibling, 1 reply; 10+ messages in thread
From: Dhruva Gole @ 2023-09-26 11:40 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, kernel test robot,
	Dan Carpenter

On Sep 26, 2023 at 13:21:04 +0200, Mark Brown wrote:
> On Tue, Sep 19, 2023 at 01:16:59PM +0530, Dhruva Gole wrote:
> > The following smatch warnings [0] were recently introduced:
> > 
> > drivers/spi/spi-cadence-quadspi.c:1882 cqspi_probe() warn: missing
> > unwind goto?
> 
> This doesn't apply against current code, please check and resend.

Pardon, which branch is this being applied on?

I am on the following base and it applies OK:
commit b643e6268c8f466ebb08a594b8ec8a1e2fd275a2 (spi-broonie/for-next)
Merge: 3b4e5194138b da6de6d3ecc1
Author: Mark Brown <broonie@kernel.org>
Date:   Tue Sep 26 13:08:30 2023 +0200

    Merge remote-tracking branch 'spi/for-6.7' into spi-next


origin: spi-broonie https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git


-- 
Best regards,
Dhruva Gole <d-gole@ti.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
  2023-09-26 11:40   ` Dhruva Gole
@ 2023-09-26 11:58     ` Mark Brown
  2023-09-26 12:19       ` Dhruva Gole
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2023-09-26 11:58 UTC (permalink / raw)
  To: Dhruva Gole
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, kernel test robot,
	Dan Carpenter

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

On Tue, Sep 26, 2023 at 05:10:46PM +0530, Dhruva Gole wrote:

> Pardon, which branch is this being applied on?

It'll have been applied as a fix so against 6.6.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
  2023-09-26 11:58     ` Mark Brown
@ 2023-09-26 12:19       ` Dhruva Gole
  2023-09-26 12:48         ` Mark Brown
  0 siblings, 1 reply; 10+ messages in thread
From: Dhruva Gole @ 2023-09-26 12:19 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, kernel test robot,
	Dan Carpenter

On Sep 26, 2023 at 13:58:13 +0200, Mark Brown wrote:
> On Tue, Sep 26, 2023 at 05:10:46PM +0530, Dhruva Gole wrote:
> 
> > Pardon, which branch is this being applied on?
> 
> It'll have been applied as a fix so against 6.6.

Umm I don't think the commit being fixed is there in 6.6?
I am not really sure how I should base/format the patch? Please can you
tell me what's expected in such a case ideally?

-- 
Best regards,
Dhruva Gole <d-gole@ti.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
  2023-09-26 12:19       ` Dhruva Gole
@ 2023-09-26 12:48         ` Mark Brown
  2023-09-26 13:13           ` Dhruva Gole
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2023-09-26 12:48 UTC (permalink / raw)
  To: Dhruva Gole
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, kernel test robot,
	Dan Carpenter

[-- Attachment #1: Type: text/plain, Size: 439 bytes --]

On Tue, Sep 26, 2023 at 05:49:08PM +0530, Dhruva Gole wrote:

> Umm I don't think the commit being fixed is there in 6.6?
> I am not really sure how I should base/format the patch? Please can you
> tell me what's expected in such a case ideally?

Including a full 12 character commit hash would help with matching,
there were only 10 there.  Not mix'n'matching Link:/Close: with links in
the body of the commit message would help as well.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
  2023-09-26 12:48         ` Mark Brown
@ 2023-09-26 13:13           ` Dhruva Gole
  0 siblings, 0 replies; 10+ messages in thread
From: Dhruva Gole @ 2023-09-26 13:13 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, kernel test robot,
	Dan Carpenter

On Sep 26, 2023 at 14:48:27 +0200, Mark Brown wrote:
> On Tue, Sep 26, 2023 at 05:49:08PM +0530, Dhruva Gole wrote:
> 
> > Umm I don't think the commit being fixed is there in 6.6?
> > I am not really sure how I should base/format the patch? Please can you
> > tell me what's expected in such a case ideally?
> 
> Including a full 12 character commit hash would help with matching,

I have given the full 12 chars, else checkpatch would've caught me :)

> there were only 10 there.  Not mix'n'matching Link:/Close: with links in
> the body of the commit message would help as well.

OK, I have fixed the links and sent the patch V3

Again, I have based on your for-next, as I don't see the fixes: commit in
the 6.6 tree.



-- 
Best regards,
Dhruva Gole <d-gole@ti.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
  2023-09-19  7:46 [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings Dhruva Gole
  2023-09-21 12:03 ` Dan Carpenter
  2023-09-26 11:21 ` Mark Brown
@ 2023-09-26 15:07 ` Mark Brown
  2 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2023-09-26 15:07 UTC (permalink / raw)
  To: Dhruva Gole
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, kernel test robot,
	Dan Carpenter

On Tue, 19 Sep 2023 13:16:59 +0530, Dhruva Gole wrote:
> The following smatch warnings [0] were recently introduced:
> 
> drivers/spi/spi-cadence-quadspi.c:1882 cqspi_probe() warn: missing
> unwind goto?
> 
> Fix these warnings by releasing dma channel and adding a goto fail probe.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
      commit: 86401132d7bbb550d80df0959ad9fa356ebc168d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-09-26 15:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-19  7:46 [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings Dhruva Gole
2023-09-21 12:03 ` Dan Carpenter
2023-09-26 11:21 ` Mark Brown
2023-09-26 11:34   ` Dhruva Gole
2023-09-26 11:40   ` Dhruva Gole
2023-09-26 11:58     ` Mark Brown
2023-09-26 12:19       ` Dhruva Gole
2023-09-26 12:48         ` Mark Brown
2023-09-26 13:13           ` Dhruva Gole
2023-09-26 15:07 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).