Skip to contentSkip to conversation

Lock warning cleanup

PATCH In review Jules Irenge 2 participants 5 messages Apr 29, 2020 – Apr 30, 2020

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

cover Lock warning cleanup

This patchset proposes a solution to functions that regiter context imbalance warnin, we add annotations to fix the warnings.

Jules Irenge (2):
cxgb4: Add missing annotation for service_ofldq()
spi: atmel: Add missing annotation for
atmel_spi_next_xfer_dma_submit()

 drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 +
 drivers/spi/spi-atmel.c                  | 1 +
 2 files changed, 2 insertions(+)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/2 cxgb4: Add missing annotation for service_ofldq()

Sparse reports a warning at service_ofldq()

warning: context imbalance in service_ofldq() - unexpected unlock

The root cause is the missing annotation at service_ofldq()

Add the missing __must_hold(&q->sendq.lock) annotation

---
 drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/chelsio/cxgb4/sge.c +1 -0
index 97cda501e7e8..5da8eb6eb9b3 100644
@@ -2702,6 +2702,7 @@ static void ofldtxq_stop(struct sge_uld_txq *q, struct fw_wr_hdr *wr)
  *	is ever running at a time ...
  */
 static void service_ofldq(struct sge_uld_txq *q)
+	__must_hold(&q->sendq.lock)
 {
 	u64 *pos, *before, *end;
 	int credits;
Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/2 spi: atmel: Add missing annotation for atmel_spi_next_xfer_dma_submit()

In reply to Jules Irenge

Sparse reports a warning at atmel_spi_next_xfer_dma_submit()

warning: context imbalance in atmel_spi_next_xfer_dma_submit()
- unexpected unlock

The root cause is the missing annotation
at atmel_spi_next_xfer_dma_submit()

Add the missing __must_hold(&as->lock) annotation

---
 drivers/spi/spi-atmel.c | 1 +
 1 file changed, 1 insertion(+)
drivers/spi/spi-atmel.c +1 -0
index 013458cabe3c..57ee8c3b7972 100644
@@ -706,6 +706,7 @@ static void atmel_spi_next_xfer_pio(struct spi_master *master,
 static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
 				struct spi_transfer *xfer,
 				u32 *plen)
+	__must_hold(&as->lock)
 {
 	struct atmel_spi	*as = spi_master_get_devdata(master);
 	struct dma_chan		*rxchan = master->dma_rx;
Signature · 1 line
2.26.2
maintainer
#3 lore raw
In reply to Jules Irenge
Quoted 9 lines · Jules Irenge

This patchset proposes a solution to functions that regiter context imbalance warnin, we add annotations to fix the warnings.

Jules Irenge (2):
cxgb4: Add missing annotation for service_ofldq()
spi: atmel: Add missing annotation for
atmel_spi_next_xfer_dma_submit()

[...]

Applied to

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

Thanks!

[1/2] cxgb4: Add missing annotation for service_ofldq()

      commit: d7f27df50eea54fd00c26c5dda7bc12d2541e5e4
[2/2] spi: atmel: Add missing annotation for atmel_spi_next_xfer_dma_submit()
      commit: e124e205124c7ab1d35ab19a45b9a70fe4f17d49

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

maintainer
#4 lore raw
Quoted 2 lines · Mark Brown

[1/2] cxgb4: Add missing annotation for service_ofldq()

      commit: d7f27df50eea54fd00c26c5dda7bc12d2541e5e4

Sorry, I didn't register that this was part of a series when I downloaded the mailbox - I'll drop that commit. When sending small cleanups like this to unrelated subsystems putting them in a series, it makes it look like there's dependencies. This is especially true if you're not CCing the whole series to everyone, that's often a sign that you can just separate the cleanups.