Commit 8e41bfa
NVIDIA: VR: SAUCE: firmware: smccc: lfa: handle LFA_BUSY and improve SMC retry pacing
Align LFA_PRIME and LFA_ACTIVATE polling with DEN0147 and reduce
long udelay-based busy-waiting where the calling context allows it.
LFA_BUSY:
- PRIME (§2.5): unexpected for this driver; log with pr_warn and return
(concurrent LFA_PRIME on another CPU). No retry loop.
- ACTIVATE (§2.6): activation was postponed; retry within the time
budget using an implementation-defined delay. Use udelay
(LFA_SMC_RETRY_SLEEP_MIN_US) for every attempt so the same path is
valid under stop_machine / IRQs off (usleep_range would not be). On
budget expiry, return -ETIMEDOUT.
LFA_ACTIVATE call_again:
- drop udelay between SMC calls; progress is driven by re-invoking
LFA_ACTIVATE. Use cpu_relax() between attempts (include
linux/preempt.h).
LFA_PRIME call_again:
- replace tight udelay polling with usleep_range() over
LFA_SMC_RETRY_SLEEP_{MIN,MAX}_US so multi-second priming does not
burn CPU.
Consolidate timing:
- one 20s wall-clock budget (LFA_SMC_BUDGET_US) for both PRIME and
ACTIVATE retry loops; shared min/max for PRIME usleep_range and
ACTIVATE LFA_BUSY udelay length.
Fix prime_fw_image() success path returning an uninitialized value; return 0
on success.
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Acked-by: Matthew R. Ochs <mochs@nvidia.com>
Acked-by: Carol L. Soto <csoto@nvidia.com>
Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>1 parent 93cd522 commit 8e41bfa
1 file changed
Lines changed: 48 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
| 118 | + | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
| |||
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
236 | | - | |
| 241 | + | |
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
| |||
252 | 257 | | |
253 | 258 | | |
254 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
255 | 276 | | |
256 | 277 | | |
257 | 278 | | |
258 | 279 | | |
259 | 280 | | |
260 | 281 | | |
261 | 282 | | |
262 | | - | |
| 283 | + | |
263 | 284 | | |
264 | | - | |
| 285 | + | |
265 | 286 | | |
266 | 287 | | |
267 | 288 | | |
| |||
297 | 318 | | |
298 | 319 | | |
299 | 320 | | |
300 | | - | |
| 321 | + | |
301 | 322 | | |
302 | 323 | | |
303 | 324 | | |
| |||
330 | 351 | | |
331 | 352 | | |
332 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
333 | 367 | | |
334 | 368 | | |
335 | 369 | | |
| |||
341 | 375 | | |
342 | 376 | | |
343 | 377 | | |
344 | | - | |
| 378 | + | |
| 379 | + | |
345 | 380 | | |
346 | 381 | | |
347 | 382 | | |
| |||
355 | 390 | | |
356 | 391 | | |
357 | 392 | | |
358 | | - | |
| 393 | + | |
359 | 394 | | |
360 | 395 | | |
361 | 396 | | |
| |||
0 commit comments