linux/drivers/net/ethernet/intel
Alexander Lobakin 32d53c0aa3 ice: fix 'scheduling while atomic' on aux critical err interrupt
There's a kernel BUG splat on processing aux critical error
interrupts in ice_misc_intr():

[ 2100.917085] BUG: scheduling while atomic: swapper/15/0/0x00010000
...
[ 2101.060770] Call Trace:
[ 2101.063229]  <IRQ>
[ 2101.065252]  dump_stack+0x41/0x60
[ 2101.068587]  __schedule_bug.cold.100+0x4c/0x58
[ 2101.073060]  __schedule+0x6a4/0x830
[ 2101.076570]  schedule+0x35/0xa0
[ 2101.079727]  schedule_preempt_disabled+0xa/0x10
[ 2101.084284]  __mutex_lock.isra.7+0x310/0x420
[ 2101.088580]  ? ice_misc_intr+0x201/0x2e0 [ice]
[ 2101.093078]  ice_send_event_to_aux+0x25/0x70 [ice]
[ 2101.097921]  ice_misc_intr+0x220/0x2e0 [ice]
[ 2101.102232]  __handle_irq_event_percpu+0x40/0x180
[ 2101.106965]  handle_irq_event_percpu+0x30/0x80
[ 2101.111434]  handle_irq_event+0x36/0x53
[ 2101.115292]  handle_edge_irq+0x82/0x190
[ 2101.119148]  handle_irq+0x1c/0x30
[ 2101.122480]  do_IRQ+0x49/0xd0
[ 2101.125465]  common_interrupt+0xf/0xf
[ 2101.129146]  </IRQ>
...

As Andrew correctly mentioned previously[0], the following call
ladder happens:

ice_misc_intr() <- hardirq
  ice_send_event_to_aux()
    device_lock()
      mutex_lock()
        might_sleep()
          might_resched() <- oops

Add a new PF state bit which indicates that an aux critical error
occurred and serve it in ice_service_task() in process context.
The new ice_pf::oicr_err_reg is read-write in both hardirq and
process contexts, but only 3 bits of non-critical data probably
aren't worth explicit synchronizing (and they're even in the same
byte [31:24]).

[0] https://lore.kernel.org/all/YeSRUVmrdmlUXHDn@lunn.ch

Fixes: 348048e724 ("ice: Implement iidc operations")
Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Tested-by: Michal Kubiak <michal.kubiak@intel.com>
Acked-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-03-23 10:40:40 -07:00
..
e1000 e1000: switch to napi_build_skb() 2021-12-28 09:42:25 -08:00
e1000e e1000e: Correct NVM checksum verification flow 2022-02-28 13:43:00 -08:00
fm10k fm10k: Fix syntax errors in comments 2021-12-21 09:17:47 -08:00
i40e i40e: stop disabling VFs due to PF error responses 2022-03-08 13:31:08 -08:00
iavf iavf: Fix hang during reboot/shutdown 2022-03-17 09:37:37 -07:00
ice ice: fix 'scheduling while atomic' on aux critical err interrupt 2022-03-23 10:40:40 -07:00
igb Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00
igbvf igbvf: Refactor trace 2021-12-21 09:17:47 -08:00
igc igc: igc_write_phy_reg_gpy: drop premature return 2022-02-28 08:48:45 -08:00
ixgb ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
ixgbe ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc() 2022-03-03 08:26:55 -08:00
ixgbevf ixgbevf: Require large buffers for build_skb on 82599VF 2022-02-04 10:23:21 +00:00
e100.c ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
Kconfig ice: support crosstimestamping on E822 devices if supported 2021-12-21 09:11:40 -08:00
Makefile