Skip to content

Commit 5a31569

Browse files
alobakinkuba-moo
authored andcommitted
ice: don't allow to run ice_send_event_to_aux() in atomic ctx
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: 348048e ("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>
1 parent 32d53c0 commit 5a31569

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/net/ethernet/intel/ice/ice_idc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_event *event)
3434
{
3535
struct iidc_auxiliary_drv *iadrv;
3636

37+
if (WARN_ON_ONCE(!in_task()))
38+
return;
39+
3740
if (!pf->adev)
3841
return;
3942

0 commit comments

Comments
 (0)