Commit 86e7567
cxl/port: Move decoder setup before dport creation
There are port setup actions that run on first dport arrival, and there are
setup actions that run per dport.
RAS register setup is a future additional setup action to run per-port
(once the first dport arrives), and each dport also has RAS registers to
map.
Before adding that, flip the order of "first dport" and "per-dport"
actions. This makes allocation symmetric with teardown, "first dport"
actions unwind after last dport removed. It also allows for using a devres
group to collect the unrelated decoder, RAS, and dport setup actions into
one group release action.
The new cxl_port_open_group() collects "first dport" and "per-dport" into
one group that can be released on any failure. This group's lifetime only
needs to span the short duration of cxl_port_add_dport() to cleanup all
potential damage from failing to add a dport. Contrast that to the "dport"
devres group that is called upon to destruct fully formed dport objects.
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Tested-by: Terry Bowman <terry.bowman@amd.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Link: https://patch.msgid.link/20260131000403.2135324-5-dan.j.williams@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>1 parent afa2bdb commit 86e7567
1 file changed
Lines changed: 21 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1651 | 1651 | | |
1652 | 1652 | | |
1653 | 1653 | | |
1654 | | - | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
1655 | 1658 | | |
1656 | 1659 | | |
1657 | 1660 | | |
| 1661 | + | |
1658 | 1662 | | |
1659 | 1663 | | |
1660 | 1664 | | |
| |||
1664 | 1668 | | |
1665 | 1669 | | |
1666 | 1670 | | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
1673 | 1676 | | |
1674 | | - | |
| 1677 | + | |
1675 | 1678 | | |
1676 | 1679 | | |
1677 | 1680 | | |
| |||
1684 | 1687 | | |
1685 | 1688 | | |
1686 | 1689 | | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
1690 | 1690 | | |
1691 | 1691 | | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
1692 | 1701 | | |
1693 | 1702 | | |
1694 | 1703 | | |
1695 | 1704 | | |
1696 | 1705 | | |
1697 | 1706 | | |
1698 | | - | |
| 1707 | + | |
1699 | 1708 | | |
1700 | 1709 | | |
1701 | 1710 | | |
| |||
0 commit comments