diff mbox series

[net] octeon_ep: initialize mbox mutexes

Message ID 20230729151516.24153-1-mschmidt@redhat.com (mailing list archive)
State Accepted
Commit 611e1b016c7beceec5ae82ac62d4a7ca224c8f9d
Delegated to: Netdev Maintainers
Headers show
Series [net] octeon_ep: initialize mbox mutexes | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 3 maintainers not CCed: kuba@kernel.org edumazet@google.com pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 1351 this patch: 1351
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1351 this patch: 1351
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Michal Schmidt July 29, 2023, 3:15 p.m. UTC
The two mbox-related mutexes are destroyed in octep_ctrl_mbox_uninit(),
but the corresponding mutex_init calls were missing.
A "DEBUG_LOCKS_WARN_ON(lock->magic != lock)" warning was emitted with
CONFIG_DEBUG_MUTEXES on.

Initialize the two mutexes in octep_ctrl_mbox_init().

Fixes: 577f0d1b1c5f ("octeon_ep: add separate mailbox command and response queues")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Leon Romanovsky July 30, 2023, 1:36 p.m. UTC | #1
On Sat, Jul 29, 2023 at 05:15:16PM +0200, Michal Schmidt wrote:
> The two mbox-related mutexes are destroyed in octep_ctrl_mbox_uninit(),
> but the corresponding mutex_init calls were missing.
> A "DEBUG_LOCKS_WARN_ON(lock->magic != lock)" warning was emitted with
> CONFIG_DEBUG_MUTEXES on.
> 
> Initialize the two mutexes in octep_ctrl_mbox_init().
> 
> Fixes: 577f0d1b1c5f ("octeon_ep: add separate mailbox command and response queues")
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> ---
>  drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c | 3 +++
>  1 file changed, 3 insertions(+)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
patchwork-bot+netdevbpf@kernel.org July 31, 2023, 9:40 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 29 Jul 2023 17:15:16 +0200 you wrote:
> The two mbox-related mutexes are destroyed in octep_ctrl_mbox_uninit(),
> but the corresponding mutex_init calls were missing.
> A "DEBUG_LOCKS_WARN_ON(lock->magic != lock)" warning was emitted with
> CONFIG_DEBUG_MUTEXES on.
> 
> Initialize the two mutexes in octep_ctrl_mbox_init().
> 
> [...]

Here is the summary with links:
  - [net] octeon_ep: initialize mbox mutexes
    https://git.kernel.org/netdev/net/c/611e1b016c7b

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c b/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c
index 035ead7935c7..dab61cc1acb5 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_mbox.c
@@ -98,6 +98,9 @@  int octep_ctrl_mbox_init(struct octep_ctrl_mbox *mbox)
 	writeq(OCTEP_CTRL_MBOX_STATUS_INIT,
 	       OCTEP_CTRL_MBOX_INFO_HOST_STATUS(mbox->barmem));
 
+	mutex_init(&mbox->h2fq_lock);
+	mutex_init(&mbox->f2hq_lock);
+
 	mbox->h2fq.sz = readl(OCTEP_CTRL_MBOX_H2FQ_SZ(mbox->barmem));
 	mbox->h2fq.hw_prod = OCTEP_CTRL_MBOX_H2FQ_PROD(mbox->barmem);
 	mbox->h2fq.hw_cons = OCTEP_CTRL_MBOX_H2FQ_CONS(mbox->barmem);