Commit 5f4ce26
committed
ACPI: scan: Fix race related to dropping dependencies
If acpi_add_single_object() runs concurrently with respect to
acpi_scan_clear_dep() which deletes a dependencies list entry where
the device being added is the consumer, the device's dep_unmet
counter may not be updated to reflect that change.
Namely, if the dependencies list entry is deleted right after
calling acpi_scan_dep_init() and before calling acpi_device_add(),
acpi_scan_clear_dep() will not find the device object corresponding
to the consumer device ACPI handle and it will not update its
dep_unmet counter to reflect the deletion of the list entry.
Consequently, the dep_unmet counter of the device will never
become zero going forward which may prevent it from being
completely enumerated.
To address this problem, modify acpi_add_single_object() to run
acpi_tie_acpi_dev(), to attach the ACPI device object created by it
to the corresponding ACPI namespace node, under acpi_dep_list_lock
along with acpi_scan_dep_init() whenever the latter is called.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>1 parent c6a493a commit 5f4ce26
1 file changed
Lines changed: 32 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | | - | |
654 | | - | |
| 653 | + | |
| 654 | + | |
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | 659 | | |
664 | 660 | | |
665 | 661 | | |
| |||
748 | 744 | | |
749 | 745 | | |
750 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
751 | 758 | | |
752 | 759 | | |
753 | 760 | | |
| |||
1675 | 1682 | | |
1676 | 1683 | | |
1677 | 1684 | | |
1678 | | - | |
1679 | | - | |
1680 | 1685 | | |
1681 | 1686 | | |
1682 | 1687 | | |
1683 | 1688 | | |
1684 | | - | |
1685 | | - | |
1686 | 1689 | | |
1687 | 1690 | | |
1688 | 1691 | | |
| |||
1701 | 1704 | | |
1702 | 1705 | | |
1703 | 1706 | | |
| 1707 | + | |
1704 | 1708 | | |
1705 | 1709 | | |
1706 | 1710 | | |
| |||
1714 | 1718 | | |
1715 | 1719 | | |
1716 | 1720 | | |
1717 | | - | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
1718 | 1730 | | |
1719 | | - | |
| 1731 | + | |
1720 | 1732 | | |
1721 | 1733 | | |
1722 | 1734 | | |
1723 | 1735 | | |
1724 | 1736 | | |
1725 | 1737 | | |
1726 | | - | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
1727 | 1746 | | |
1728 | 1747 | | |
1729 | 1748 | | |
| |||
0 commit comments