Commit 7e38d96
committed
firmware: qcom: scm: request the waitqueue irq *after* initializing SCM
JIRA: https://issues.redhat.com/browse/RHEL-117514
commit 7ab36b5
Author: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Date: Mon Jun 30 14:12:05 2025 +0200
firmware: qcom: scm: request the waitqueue irq *after* initializing SCM
There's a subtle race in the SCM driver: we assign the __scm pointer
before requesting the waitqueue interrupt. Assigning __scm marks the SCM
API as ready to accept calls. It's possible that a user makes a call
right after we set __scm and the firmware raises an interrupt before the
driver's ready to service it. Move the __scm assignment after we request
the interrupt.
This has the added benefit of allowing us to drop the goto label.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-4-fa3851c98611@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Eric Chanudet <echanude@redhat.com>1 parent 5df6bf8 commit 7e38d96
1 file changed
+14
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2276 | 2276 | | |
2277 | 2277 | | |
2278 | 2278 | | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
2279 | 2291 | | |
2280 | 2292 | | |
2281 | 2293 | | |
2282 | 2294 | | |
2283 | | - | |
| 2295 | + | |
| 2296 | + | |
2284 | 2297 | | |
2285 | 2298 | | |
2286 | 2299 | | |
2287 | | - | |
2288 | | - | |
2289 | | - | |
2290 | | - | |
2291 | | - | |
2292 | | - | |
2293 | | - | |
2294 | | - | |
2295 | | - | |
2296 | | - | |
2297 | | - | |
2298 | | - | |
2299 | | - | |
2300 | | - | |
2301 | | - | |
2302 | 2300 | | |
2303 | 2301 | | |
2304 | 2302 | | |
| |||
2328 | 2326 | | |
2329 | 2327 | | |
2330 | 2328 | | |
2331 | | - | |
2332 | | - | |
2333 | | - | |
2334 | | - | |
2335 | | - | |
2336 | | - | |
2337 | 2329 | | |
2338 | 2330 | | |
2339 | 2331 | | |
| |||
0 commit comments