* [PATCH net] octeon_ep: initialize mbox mutexes
@ 2023-07-29 15:15 Michal Schmidt
2023-07-30 13:36 ` Leon Romanovsky
2023-07-31 21:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Michal Schmidt @ 2023-07-29 15:15 UTC (permalink / raw)
To: netdev
Cc: Abhijit Ayarekar, Veerasenareddy Burru, Vimlesh Kumar,
Shinas Rasheed, Sathesh Edara, David S. Miller
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(+)
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);
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] octeon_ep: initialize mbox mutexes
2023-07-29 15:15 [PATCH net] octeon_ep: initialize mbox mutexes Michal Schmidt
@ 2023-07-30 13:36 ` Leon Romanovsky
2023-07-31 21:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2023-07-30 13:36 UTC (permalink / raw)
To: Michal Schmidt
Cc: netdev, Abhijit Ayarekar, Veerasenareddy Burru, Vimlesh Kumar,
Shinas Rasheed, Sathesh Edara, David S. Miller
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] octeon_ep: initialize mbox mutexes
2023-07-29 15:15 [PATCH net] octeon_ep: initialize mbox mutexes Michal Schmidt
2023-07-30 13:36 ` Leon Romanovsky
@ 2023-07-31 21:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-07-31 21:40 UTC (permalink / raw)
To: Michal Schmidt
Cc: netdev, aayarekar, vburru, vimleshk, srasheed, sedara, davem
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-31 21:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-29 15:15 [PATCH net] octeon_ep: initialize mbox mutexes Michal Schmidt
2023-07-30 13:36 ` Leon Romanovsky
2023-07-31 21:40 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.