Commit f682b44
iommu/amd: Reduce domain lock scope in attach device path
[ Upstream commit d6b47de ]
Currently attach device path takes protection domain lock followed by
dev_data lock. Most of the operations in this function is specific to
device data except pdom_attach_iommu() where it updates protection
domain structure. Hence reduce the scope of protection domain lock.
Note that this changes the locking order. Now it takes device lock
before taking doamin lock (group->mutex -> dev_data->lock ->
pdom->lock). dev_data->lock is used only in device attachment path.
So changing order is fine. It will not create any issue.
Finally move numa node assignment to pdom_attach_iommu().
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20241030063556.6104-8-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Stable-dep-of: faad224 ("iommu/amd: Fix clone_alias() to use the original device's devid")
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 596bb22 commit f682b44
1 file changed
Lines changed: 30 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2057 | 2057 | | |
2058 | 2058 | | |
2059 | 2059 | | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
2060 | 2065 | | |
2061 | 2066 | | |
2062 | 2067 | | |
2063 | 2068 | | |
2064 | | - | |
| 2069 | + | |
2065 | 2070 | | |
2066 | 2071 | | |
2067 | 2072 | | |
2068 | | - | |
2069 | | - | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
2070 | 2077 | | |
2071 | 2078 | | |
2072 | 2079 | | |
| |||
2075 | 2082 | | |
2076 | 2083 | | |
2077 | 2084 | | |
2078 | | - | |
| 2085 | + | |
| 2086 | + | |
2079 | 2087 | | |
2080 | 2088 | | |
2081 | | - | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
2082 | 2096 | | |
2083 | 2097 | | |
2084 | 2098 | | |
2085 | 2099 | | |
2086 | 2100 | | |
2087 | 2101 | | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
2088 | 2105 | | |
2089 | 2106 | | |
2090 | | - | |
| 2107 | + | |
| 2108 | + | |
2091 | 2109 | | |
| 2110 | + | |
2092 | 2111 | | |
2093 | 2112 | | |
2094 | 2113 | | |
2095 | 2114 | | |
2096 | 2115 | | |
2097 | 2116 | | |
| 2117 | + | |
| 2118 | + | |
2098 | 2119 | | |
2099 | 2120 | | |
2100 | 2121 | | |
2101 | 2122 | | |
2102 | 2123 | | |
2103 | 2124 | | |
2104 | | - | |
2105 | 2125 | | |
2106 | 2126 | | |
2107 | 2127 | | |
2108 | 2128 | | |
2109 | 2129 | | |
2110 | 2130 | | |
2111 | | - | |
2112 | | - | |
2113 | | - | |
2114 | | - | |
2115 | 2131 | | |
2116 | 2132 | | |
2117 | 2133 | | |
| |||
2133 | 2149 | | |
2134 | 2150 | | |
2135 | 2151 | | |
| 2152 | + | |
2136 | 2153 | | |
2137 | 2154 | | |
2138 | 2155 | | |
2139 | 2156 | | |
2140 | 2157 | | |
| 2158 | + | |
2141 | 2159 | | |
| 2160 | + | |
2142 | 2161 | | |
2143 | 2162 | | |
2144 | 2163 | | |
| |||
2160 | 2179 | | |
2161 | 2180 | | |
2162 | 2181 | | |
2163 | | - | |
2164 | 2182 | | |
2165 | 2183 | | |
2166 | | - | |
2167 | | - | |
2168 | 2184 | | |
2169 | 2185 | | |
2170 | 2186 | | |
| |||
2179 | 2195 | | |
2180 | 2196 | | |
2181 | 2197 | | |
2182 | | - | |
2183 | | - | |
2184 | 2198 | | |
2185 | 2199 | | |
2186 | 2200 | | |
| |||
2190 | 2204 | | |
2191 | 2205 | | |
2192 | 2206 | | |
2193 | | - | |
2194 | 2207 | | |
2195 | | - | |
2196 | 2208 | | |
2197 | 2209 | | |
2198 | | - | |
2199 | | - | |
2200 | 2210 | | |
2201 | 2211 | | |
2202 | 2212 | | |
| |||
2220 | 2230 | | |
2221 | 2231 | | |
2222 | 2232 | | |
2223 | | - | |
2224 | | - | |
2225 | 2233 | | |
2226 | 2234 | | |
2227 | 2235 | | |
| |||
0 commit comments