Commit f4c67e8
committed
sdcard: solve backup bug when sd is re-inserted
This issue was existent for a long time. While using the BitBox02,
when the sdcard is plugged into the device and the user unplugs
and replugs it, backup operations (e.g., list backups, restore
from backup) failed and throwed error from the firmware side.
Sdcard backup operations first check if the sdcard is inserted
before calling sdcard interface funtions. This commit fixes
the re-insertion problem by reinitializing the sdcard whenever
it is checked if it is inserted.
The problem earlier most probably stems from sdcard being in an
unexpected state when it is re-inserted. The forced initialization
step fixes the broken states.
Signed-off-by: asi345 <inanata15@gmail.com>1 parent 6494a12 commit f4c67e8
2 files changed
+15
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
110 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
| |||
117 | 125 | | |
118 | 126 | | |
119 | 127 | | |
120 | | - | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
124 | | - | |
| 132 | + | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| |||
268 | 276 | | |
269 | 277 | | |
270 | 278 | | |
271 | | - | |
| 279 | + | |
| 280 | + | |
272 | 281 | | |
273 | 282 | | |
274 | 283 | | |
| |||
295 | 304 | | |
296 | 305 | | |
297 | 306 | | |
298 | | - | |
| 307 | + | |
299 | 308 | | |
300 | 309 | | |
301 | 310 | | |
| |||
0 commit comments