ice: don't allow to run ice_send_event_to_aux() in atomic ctx
authorAlexander Lobakin <alexandr.lobakin@intel.com>
Wed, 23 Mar 2022 12:43:53 +0000 (13:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:43 +0000 (14:23 +0200)
commiteec20eea27a089eacde240e1661c0da2b29fef4e
tree3c708239c22cdaf79cc199c9bc1fe10a9afaef49
parent9b77c8cf69a41d1e3851370aeaa04a9ea83b865c
ice: don't allow to run ice_send_event_to_aux() in atomic ctx

[ Upstream commit 5a3156932da06f09953764de113419f254086faf ]

ice_send_event_to_aux() eventually descends to mutex_lock()
(-> might_sched()), so it must not be called under non-task
context. However, at least two fixes have happened already for the
bug splats occurred due to this function being called from atomic
context.
To make the emergency landings softer, bail out early when executed
in non-task context emitting a warn splat only once. This way we
trade some events being potentially lost for system stability and
avoid any related hangs and crashes.

Fixes: 348048e724a0e ("ice: Implement iidc operations")
Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Tested-by: Michal Kubiak <michal.kubiak@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Acked-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_idc.c