Commit 83beece
committed
firmware: microchip: auto-update: fix poll_complete() to not report spurious timeout errors
fw_upload's poll_complete() is really intended for use with
asynchronous write() implementations - or at least those where the
write() loop may terminate without the kernel yet being aware of whether
or not the firmware upload has succeeded. For auto-update, write() is
only ever called once and will only return when uploading has completed,
be that by passing or failing. The core fw_upload code only calls
poll_complete() after the final call to write() has returned.
However, the poll_complete() implementation in the auto-update driver
was written to expect poll_complete() to be called from another context,
and it waits for a completion signalled from write(). Since
poll_complete() is actually called from the same context, after the
write() loop has terminated, wait_for_completion() never sees the
completion get signalled and always times out, causing programming to
always report a failing.
Since write() is full synchronous, and its return value will indicate
whether or not programming passed or failed, poll_complete() serves no
purpose and can be cut down to simply return FW_UPLOAD_ERR_NONE.
Cc: [email protected]
Fixes: ec5b0f1 ("firmware: microchip: add PolarFire SoC Auto Update support")
Reported-by: Jamie Gibbons <[email protected]>
Tested-by: Jamie Gibbons <[email protected]>
Signed-off-by: Conor Dooley <[email protected]>1 parent 8e929cb commit 83beece
1 file changed
+7
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
86 | | - | |
87 | 84 | | |
88 | 85 | | |
89 | 86 | | |
| |||
156 | 153 | | |
157 | 154 | | |
158 | 155 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 156 | | |
173 | 157 | | |
174 | 158 | | |
| |||
349 | 333 | | |
350 | 334 | | |
351 | 335 | | |
352 | | - | |
353 | 336 | | |
354 | 337 | | |
355 | | - | |
356 | | - | |
357 | 338 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
| 339 | + | |
| 340 | + | |
362 | 341 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 342 | + | |
| 343 | + | |
367 | 344 | | |
368 | 345 | | |
369 | | - | |
| 346 | + | |
370 | 347 | | |
371 | 348 | | |
372 | 349 | | |
373 | | - | |
| 350 | + | |
374 | 351 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 352 | + | |
379 | 353 | | |
380 | 354 | | |
381 | 355 | | |
| |||
461 | 435 | | |
462 | 436 | | |
463 | 437 | | |
464 | | - | |
465 | | - | |
466 | 438 | | |
467 | 439 | | |
468 | 440 | | |
| |||
0 commit comments