Commit ac078e5
SDMMCv1: fix system hang issues
1. SDMMCv1: unlock before waiting for DMA completion
Avoids system hanging forever when an error interrupt is signaled and
the controller is in a state where the DMA can never complete.
2. SDMMCv1: wait for DMA completion only when it will complete
In certain error states (e.g. CRC error in the middle of a multi-block
transmission), the DMA may never complete. Therefore, only wait for its
completion if the transfer was successful. We do need to wait for
completion on read as some words may still be in flight from the receive
FIFO to RAM.
The STM32F7 reference manual (RM0385 Rev 9 Section 35.3.2 SDMMC APB2
interface) mentions that it is possible for a receive FIFO overflow on
the last word to be signaled only after the DATAEND flag is set.
Therefore we also have to check that the FIFO does not have data in it
and confirm there is no RXOVERR error too.
3. SDMMCv1: listen for reserved start bit error
Sometimes this is the only interrupt that gets signaled in certain error
cases. We need to listen for it so we don't sleep forever waiting for an
interrupt from the controller.
The STM32F7 reference manual RM0385 documents this bit as reserved but
evidently it can still be triggered in some cases. The logic has been
copied from the SDIOv1 driver where it is not reserved.1 parent 2e60c06 commit ac078e5
1 file changed
Lines changed: 35 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
52 | 65 | | |
53 | 66 | | |
54 | 67 | | |
| |||
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
| 187 | + | |
174 | 188 | | |
175 | 189 | | |
176 | 190 | | |
| |||
286 | 300 | | |
287 | 301 | | |
288 | 302 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 303 | + | |
| 304 | + | |
294 | 305 | | |
| 306 | + | |
295 | 307 | | |
296 | | - | |
297 | 308 | | |
298 | 309 | | |
299 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
300 | 325 | | |
301 | 326 | | |
302 | 327 | | |
303 | | - | |
304 | | - | |
305 | 328 | | |
306 | 329 | | |
307 | 330 | | |
| |||
332 | 355 | | |
333 | 356 | | |
334 | 357 | | |
335 | | - | |
336 | | - | |
| 358 | + | |
| 359 | + | |
337 | 360 | | |
338 | 361 | | |
339 | 362 | | |
| |||
859 | 882 | | |
860 | 883 | | |
861 | 884 | | |
| 885 | + | |
862 | 886 | | |
863 | 887 | | |
864 | 888 | | |
| |||
927 | 951 | | |
928 | 952 | | |
929 | 953 | | |
| 954 | + | |
930 | 955 | | |
931 | 956 | | |
932 | 957 | | |
| |||
0 commit comments