# Re: \[PATCH net-next 04/15\] net: mlx5: Replace in\_irq() usage.

- From: Jakub Kicinski \<kuba@kernel.org\>
- Date: 2020-10-31 16:59:42 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2020/10/8489426
- Thread: https://ratatoskr.run/netdev/2020/10/8489385/t.md

```text
On Tue, 27 Oct 2020 23:54:43 +0100 Sebastian Andrzej Siewior wrote:
> mlx5_eq_async_int() uses in_irq() to decide whether eq::lock needs to be
> acquired and released with spin_[un]lock() or the irq saving/restoring
> variants.
> 
> The usage of in_*() in drivers is phased out and Linus clearly requested
> that code which changes behaviour depending on context should either be
> seperated or the context be conveyed in an argument passed by the caller,
> which usually knows the context.
> 
> mlx5_eq_async_int() knows the context via the action argument already so
> using it for the lock variant decision is a straight forward replacement
> for in_irq().
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Saeed Mahameed <saeedm@nvidia.com>
> Cc: Leon Romanovsky <leon@kernel.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: <redacted>

Saeed, please pick this up into your tree.
```
