Commit c6e77aa
net/mlx5: Register devlink first under devlink lock
In case device is having a non fatal FW error during probe, the
driver will report the error to user via devlink. This will trigger
a WARN_ON, since mlx5 is calling devlink_register() last.
In order to avoid the WARN_ON[1], change mlx5 to invoke devl_register()
first under devlink lock.
[1]
WARNING: CPU: 5 PID: 227 at net/devlink/health.c:483 devlink_recover_notify.constprop.0+0xb8/0xc0
CPU: 5 PID: 227 Comm: kworker/u16:3 Not tainted 6.4.0-rc5_for_upstream_min_debug_2023_06_12_12_38 #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
Workqueue: mlx5_health0000:08:00.0 mlx5_fw_reporter_err_work [mlx5_core]
RIP: 0010:devlink_recover_notify.constprop.0+0xb8/0xc0
Call Trace:
<TASK>
? __warn+0x79/0x120
? devlink_recover_notify.constprop.0+0xb8/0xc0
? report_bug+0x17c/0x190
? handle_bug+0x3c/0x60
? exc_invalid_op+0x14/0x70
? asm_exc_invalid_op+0x16/0x20
? devlink_recover_notify.constprop.0+0xb8/0xc0
devlink_health_report+0x4a/0x1c0
mlx5_fw_reporter_err_work+0xa4/0xd0 [mlx5_core]
process_one_work+0x1bb/0x3c0
? process_one_work+0x3c0/0x3c0
worker_thread+0x4d/0x3c0
? process_one_work+0x3c0/0x3c0
kthread+0xc6/0xf0
? kthread_complete_and_exit+0x20/0x20
ret_from_fork+0x1f/0x30
</TASK>
Fixes: cf53021 ("devlink: Notify users when objects are accessible")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20240409190820.227554-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 0553e75 commit c6e77aa
2 files changed
Lines changed: 20 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1480 | 1480 | | |
1481 | 1481 | | |
1482 | 1482 | | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
1483 | 1491 | | |
1484 | 1492 | | |
1485 | 1493 | | |
| |||
1505 | 1513 | | |
1506 | 1514 | | |
1507 | 1515 | | |
| 1516 | + | |
1508 | 1517 | | |
| 1518 | + | |
| 1519 | + | |
1509 | 1520 | | |
1510 | 1521 | | |
1511 | 1522 | | |
| |||
1517 | 1528 | | |
1518 | 1529 | | |
1519 | 1530 | | |
| 1531 | + | |
| 1532 | + | |
1520 | 1533 | | |
1521 | 1534 | | |
1522 | 1535 | | |
| |||
1534 | 1547 | | |
1535 | 1548 | | |
1536 | 1549 | | |
| 1550 | + | |
1537 | 1551 | | |
1538 | 1552 | | |
1539 | 1553 | | |
| |||
1680 | 1694 | | |
1681 | 1695 | | |
1682 | 1696 | | |
| 1697 | + | |
| 1698 | + | |
1683 | 1699 | | |
1684 | | - | |
1685 | 1700 | | |
1686 | 1701 | | |
1687 | 1702 | | |
1688 | 1703 | | |
1689 | 1704 | | |
| 1705 | + | |
1690 | 1706 | | |
1691 | 1707 | | |
1692 | 1708 | | |
| 1709 | + | |
| 1710 | + | |
1693 | 1711 | | |
1694 | 1712 | | |
1695 | 1713 | | |
| |||
1702 | 1720 | | |
1703 | 1721 | | |
1704 | 1722 | | |
| 1723 | + | |
1705 | 1724 | | |
1706 | 1725 | | |
1707 | 1726 | | |
| |||
1943 | 1962 | | |
1944 | 1963 | | |
1945 | 1964 | | |
1946 | | - | |
1947 | | - | |
1948 | | - | |
1949 | | - | |
1950 | | - | |
1951 | | - | |
1952 | | - | |
1953 | | - | |
1954 | 1965 | | |
1955 | | - | |
1956 | 1966 | | |
1957 | 1967 | | |
1958 | 1968 | | |
| |||
1973 | 1983 | | |
1974 | 1984 | | |
1975 | 1985 | | |
1976 | | - | |
1977 | | - | |
1978 | | - | |
1979 | | - | |
1980 | 1986 | | |
1981 | 1987 | | |
1982 | | - | |
1983 | 1988 | | |
1984 | | - | |
1985 | | - | |
1986 | 1989 | | |
1987 | 1990 | | |
1988 | 1991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
| |||
0 commit comments