2020-04-29 23:01:12

by Jules Irenge

[permalink] [raw]
Subject: [PATCH 0/2] 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(+)

--
2.26.2


2020-04-29 23:02:33

by Jules Irenge

[permalink] [raw]
Subject: [PATCH 2/2] spi: atmel: Add missing annotation for atmel_spi_next_xfer_dma_submit()

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

Signed-off-by: Jules Irenge <[email protected]>
---
drivers/spi/spi-atmel.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 013458cabe3c..57ee8c3b7972 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -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;
--
2.26.2

2020-04-29 23:02:40

by Jules Irenge

[permalink] [raw]
Subject: [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

Signed-off-by: Jules Irenge <[email protected]>
---
drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 97cda501e7e8..5da8eb6eb9b3 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -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;
--
2.26.2

2020-04-30 14:28:26

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/2] Lock warning cleanup

On Wed, 29 Apr 2020 23:57:21 +0100, Jules Irenge wrote:
> 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

2020-04-30 14:46:35

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/2] Lock warning cleanup

On Thu, Apr 30, 2020 at 03:23:17PM +0100, Mark Brown wrote:

> [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.


Attachments:
(No filename) (568.00 B)
signature.asc (499.00 B)
Download all attachments