Commit da2b4ae
e1000e: Fix link check race condition
commit e2710db upstream.
Alex reported the following race condition:
/* link goes up... interrupt... schedule watchdog */
\ e1000_watchdog_task
\ e1000e_has_link
\ hw->mac.ops.check_for_link() === e1000e_check_for_copper_link
\ e1000e_phy_has_link_generic(..., &link)
link = true
/* link goes down... interrupt */
\ e1000_msix_other
hw->mac.get_link_status = true
/* link is up */
mac->get_link_status = false
link_active = true
/* link_active is true, wrongly, and stays so because
* get_link_status is false */
Avoid this problem by making sure that we don't set get_link_status = false
after having checked the link.
It seems this problem has been present since the introduction of e1000e.
Link: https://lkml.org/lkml/2018/1/29/338
Reported-by: Alexander Duyck <alexander.duyck@gmail.com>
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent dc2aa33 commit da2b4ae
2 files changed
Lines changed: 24 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1383 | 1383 | | |
1384 | 1384 | | |
1385 | 1385 | | |
| 1386 | + | |
1386 | 1387 | | |
1387 | 1388 | | |
1388 | 1389 | | |
1389 | 1390 | | |
1390 | 1391 | | |
1391 | 1392 | | |
1392 | 1393 | | |
1393 | | - | |
| 1394 | + | |
1394 | 1395 | | |
1395 | 1396 | | |
1396 | 1397 | | |
1397 | 1398 | | |
1398 | | - | |
| 1399 | + | |
1399 | 1400 | | |
1400 | 1401 | | |
1401 | 1402 | | |
| |||
1428 | 1429 | | |
1429 | 1430 | | |
1430 | 1431 | | |
1431 | | - | |
| 1432 | + | |
1432 | 1433 | | |
1433 | 1434 | | |
1434 | 1435 | | |
| |||
1450 | 1451 | | |
1451 | 1452 | | |
1452 | 1453 | | |
1453 | | - | |
| 1454 | + | |
1454 | 1455 | | |
1455 | 1456 | | |
1456 | 1457 | | |
| |||
1459 | 1460 | | |
1460 | 1461 | | |
1461 | 1462 | | |
1462 | | - | |
| 1463 | + | |
1463 | 1464 | | |
1464 | 1465 | | |
1465 | 1466 | | |
1466 | 1467 | | |
1467 | 1468 | | |
1468 | 1469 | | |
1469 | | - | |
| 1470 | + | |
1470 | 1471 | | |
1471 | 1472 | | |
1472 | 1473 | | |
| |||
1480 | 1481 | | |
1481 | 1482 | | |
1482 | 1483 | | |
1483 | | - | |
| 1484 | + | |
1484 | 1485 | | |
1485 | 1486 | | |
1486 | 1487 | | |
1487 | | - | |
| 1488 | + | |
1488 | 1489 | | |
1489 | 1490 | | |
1490 | 1491 | | |
1491 | 1492 | | |
1492 | 1493 | | |
1493 | 1494 | | |
1494 | | - | |
| 1495 | + | |
1495 | 1496 | | |
1496 | 1497 | | |
1497 | 1498 | | |
| |||
1518 | 1519 | | |
1519 | 1520 | | |
1520 | 1521 | | |
1521 | | - | |
| 1522 | + | |
1522 | 1523 | | |
1523 | 1524 | | |
1524 | 1525 | | |
1525 | 1526 | | |
1526 | 1527 | | |
1527 | 1528 | | |
1528 | 1529 | | |
1529 | | - | |
| 1530 | + | |
1530 | 1531 | | |
1531 | 1532 | | |
1532 | 1533 | | |
| |||
1549 | 1550 | | |
1550 | 1551 | | |
1551 | 1552 | | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
| 1553 | + | |
1555 | 1554 | | |
1556 | 1555 | | |
1557 | 1556 | | |
| |||
1617 | 1616 | | |
1618 | 1617 | | |
1619 | 1618 | | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
1620 | 1623 | | |
1621 | 1624 | | |
1622 | 1625 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
430 | 431 | | |
431 | 432 | | |
432 | 433 | | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
| 434 | + | |
| 435 | + | |
440 | 436 | | |
441 | 437 | | |
442 | 438 | | |
| |||
465 | 461 | | |
466 | 462 | | |
467 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| |||
0 commit comments