1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/qlogic/qed
Konstantin Khorenko e346e231b4 qed: Fix scheduling in a tasklet while getting stats
Here we've got to a situation when tasklet called usleep_range() in PTT
acquire logic, thus welcome to the "scheduling while atomic" BUG().

  BUG: scheduling while atomic: swapper/24/0/0x00000100

   [<ffffffffb41c6199>] schedule+0x29/0x70
   [<ffffffffb41c5512>] schedule_hrtimeout_range_clock+0xb2/0x150
   [<ffffffffb41c55c3>] schedule_hrtimeout_range+0x13/0x20
   [<ffffffffb41c3bcf>] usleep_range+0x4f/0x70
   [<ffffffffc08d3e58>] qed_ptt_acquire+0x38/0x100 [qed]
   [<ffffffffc08eac48>] _qed_get_vport_stats+0x458/0x580 [qed]
   [<ffffffffc08ead8c>] qed_get_vport_stats+0x1c/0xd0 [qed]
   [<ffffffffc08dffd3>] qed_get_protocol_stats+0x93/0x100 [qed]
                        qed_mcp_send_protocol_stats
            case MFW_DRV_MSG_GET_LAN_STATS:
            case MFW_DRV_MSG_GET_FCOE_STATS:
            case MFW_DRV_MSG_GET_ISCSI_STATS:
            case MFW_DRV_MSG_GET_RDMA_STATS:
   [<ffffffffc08e36d8>] qed_mcp_handle_events+0x2d8/0x890 [qed]
                        qed_int_assertion
                        qed_int_attentions
   [<ffffffffc08d9490>] qed_int_sp_dpc+0xa50/0xdc0 [qed]
   [<ffffffffb3aa7623>] tasklet_action+0x83/0x140
   [<ffffffffb41d9125>] __do_softirq+0x125/0x2bb
   [<ffffffffb41d560c>] call_softirq+0x1c/0x30
   [<ffffffffb3a30645>] do_softirq+0x65/0xa0
   [<ffffffffb3aa78d5>] irq_exit+0x105/0x110
   [<ffffffffb41d8996>] do_IRQ+0x56/0xf0

Fix this by making caller to provide the context whether it could be in
atomic context flow or not when getting stats from QED driver.
QED driver based on the context provided decide to schedule out or not
when acquiring the PTT BAR window.

We faced the BUG_ON() while getting vport stats, but according to the
code same issue could happen for fcoe and iscsi statistics as well, so
fixing them too.

Fixes: 6c75424612 ("qed: Add support for NCSI statistics.")
Fixes: 1e128c8129 ("qed: Add support for hardware offloaded FCoE.")
Fixes: 2f2b2614e8 ("qed: Provide iSCSI statistics to management")
Cc: Sudarsana Kalluru <skalluru@marvell.com>
Cc: David Miller <davem@davemloft.net>
Cc: Manish Chopra <manishc@marvell.com>

Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-07-29 17:09:18 +01:00
..
Makefile qed: Remove IP services API. 2022-04-22 15:15:23 -07:00
qed.h qed: Update debug related changes 2021-10-04 12:55:49 +01:00
qed_chain.c qed: fix the allocation of the chains with an external PBL 2020-07-27 12:17:14 -07:00
qed_cxt.c qed: Use the bitmap API to simplify some functions 2021-11-22 14:30:57 +00:00
qed_cxt.h qed: Update debug related changes 2021-10-04 12:55:49 +01:00
qed_dbg_hsi.h qed: fix typos in comments 2022-05-22 20:44:30 +01:00
qed_dcbx.c net: qed: remove unneeded return variables 2021-07-27 11:55:19 +01:00
qed_dcbx.h qed: Split huge qed_hsi.h header file 2021-10-04 12:55:48 +01:00
qed_debug.c qed: allow sleep in qed_mcp_trace_dump() 2023-01-04 20:32:56 -08:00
qed_debug.h qed: Update debug related changes 2021-10-04 12:55:49 +01:00
qed_dev.c qed/qed_dev: guard against a possible division by zero 2023-03-13 16:55:02 -07:00
qed_dev_api.h qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qed_devlink.c qed: remove pointless call to devlink_param_driverinit_value_set() 2023-01-27 12:32:02 +00:00
qed_devlink.h qed: use devlink logic to report errors 2020-08-24 18:01:33 -07:00
qed_fcoe.c qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qed_fcoe.h qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qed_hsi.h qed: Enhance rammod debug prints to provide pretty details 2021-12-02 12:22:17 +00:00
qed_hw.c qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qed_hw.h qed: Fix kernel-doc warnings 2021-10-04 12:55:48 +01:00
qed_init_fw_funcs.c qed: remove unnecessary memset in qed_init_fw_funcs 2022-03-21 10:59:56 +00:00
qed_init_ops.c qed: Update FW init functions to support FW 8.59.1.0 2021-10-04 12:55:49 +01:00
qed_init_ops.h qed: Update FW init functions to support FW 8.59.1.0 2021-10-04 12:55:49 +01:00
qed_int.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
qed_int.h qed*: enhance tx timeout debug info 2021-12-03 18:24:20 -08:00
qed_iro_hsi.h qed: Add '_GTT' suffix to the IRO RAM macros 2021-10-04 12:55:49 +01:00
qed_iscsi.c qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qed_iscsi.h qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qed_iwarp.c qed: Update the TCP active termination 2 MSL timer ("TIME_WAIT") 2021-10-04 12:55:49 +01:00
qed_iwarp.h net: qed: update copyright years 2020-06-30 15:51:40 -07:00
qed_l2.c qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qed_l2.h qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qed_ll2.c qed: remove unused num_ooo_add_to_peninsula variable 2023-03-27 19:43:45 -07:00
qed_ll2.h qed: Split huge qed_hsi.h header file 2021-10-04 12:55:48 +01:00
qed_main.c qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qed_mcp.c qed: avoid defines prefixed with CONFIG 2022-11-25 08:13:09 +00:00
qed_mcp.h qed: prevent a fw assert during device shutdown 2022-02-10 15:27:44 +00:00
qed_mfw_hsi.h treewide: Replace zero-length arrays with flexible-array members 2022-02-17 07:00:39 -06:00
qed_mng_tlv.c qed/qed_mng_tlv: correctly zero out ->min instead of ->hour 2023-03-16 21:08:36 -07:00
qed_nvmetcp.c qed: Add NVMeTCP Offload IO Level FW Initializations 2021-06-03 14:04:17 -07:00
qed_nvmetcp.h qed: Add NVMeTCP Offload Connection Level FW and HW HSI 2021-06-03 14:04:17 -07:00
qed_nvmetcp_fw_funcs.c qed: Remove duplicated include of kernel.h 2021-08-03 11:49:28 +01:00
qed_nvmetcp_fw_funcs.h qed: Fix duplicate included linux/kernel.h 2021-06-07 13:29:50 -07:00
qed_ooo.c qed: Optimize the ll2 ooo flow 2021-10-18 15:58:21 -07:00
qed_ooo.h net: qed: update copyright years 2020-06-30 15:51:40 -07:00
qed_ptp.c net: qed_ptp: fix check of true !rc expression 2021-10-25 19:11:13 -07:00
qed_ptp.h net: qed: cleanup global structs declarations 2020-07-06 13:18:55 -07:00
qed_rdma.c qed: Use bitmap_empty() 2022-07-06 19:55:14 -07:00
qed_rdma.h qed: Split huge qed_hsi.h header file 2021-10-04 12:55:48 +01:00
qed_reg_addr.h qed*: enhance tx timeout debug info 2021-12-03 18:24:20 -08:00
qed_roce.c qed: replace bitmap_weight with bitmap_empty in qed_roce_stop() 2022-05-02 06:30:40 -07:00
qed_roce.h net: qed: update copyright years 2020-06-30 15:51:40 -07:00
qed_selftest.c net: qed: update copyright years 2020-06-30 15:51:40 -07:00
qed_selftest.h qed: Fix kernel-doc warnings 2021-10-04 12:55:48 +01:00
qed_sp.h qed: Update qed_hsi.h for fw 8.59.1.0 2021-10-04 12:55:49 +01:00
qed_sp_commands.c qed: Enhance rammod debug prints to provide pretty details 2021-12-02 12:22:17 +00:00
qed_spq.c qed: Enhance rammod debug prints to provide pretty details 2021-12-02 12:22:17 +00:00
qed_sriov.c qed/qed_sriov: guard against NULL derefs from qed_iov_get_vf_info 2023-03-19 08:40:48 +00:00
qed_sriov.h qed: validate and restrict untrusted VFs vlan promisc mode 2022-03-03 10:26:20 +00:00
qed_vf.c net: qlogic: check the return value of dma_alloc_coherent() in qed_vf_hw_prepare() 2022-03-07 11:28:38 +00:00
qed_vf.h qed: fix typos in comments 2022-05-22 20:44:30 +01:00