Commit eaff145
platform: msm_shared: qpic_nand: Skip writing trailing 0xFF pages for EFS
At the moment, attempting to restore a backup of the EFS2 partitions for
the modem corrupts it, e.g.
$ fastboot fetch efs2 efs2.img
$ fasbtoot flash efs2 efs2.img
$ fastboot reboot
qcom-q6v5-mss 4080000.remoteproc: fatal error received:
fs_logr.c:114:Ran out of good blocks in log-rgn XY
It looks like the mdoem relies on having erased ("good") blocks to write
to. The current flash_write() routine blindly writes all pages, so if there
was an erased page with all 0xFF in the input, it is still explicitly
written rather than leaving the page erased. To write these pages, the
modem would need to erase the whole block (consisting of multiple pages)
and re-write all pages in the beginning.
We can't reliably distinguish between an explicitly written all-0xFF page
and an erased page in the image, so let's just assume that all trailing
0xFF pages at the end of a block were erased and leave them that way when
flashing. Apply this behavior only for the "efs2" partition, since most
other partitions (e.g. "boot", "aboot", "sbl1" etc) contain actual file
images were explicitly writing all-0xFF pages makes more sense.
This is similar to the "nandwrite --skip-all-ffs" option on Linux, except
that we only consider trailing all-0xFF pages in a block. This is unlikely
to make much difference in practice, but it seems to be closer to how the
modem firmware is managing the EFS partition.1 parent f08af0c commit eaff145
1 file changed
Lines changed: 38 additions & 1 deletion
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2105 | 2105 | | |
2106 | 2106 | | |
2107 | 2107 | | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
2108 | 2123 | | |
2109 | 2124 | | |
2110 | 2125 | | |
2111 | 2126 | | |
2112 | 2127 | | |
2113 | 2128 | | |
| 2129 | + | |
| 2130 | + | |
2114 | 2131 | | |
2115 | 2132 | | |
| 2133 | + | |
2116 | 2134 | | |
2117 | 2135 | | |
2118 | 2136 | | |
2119 | 2137 | | |
| 2138 | + | |
2120 | 2139 | | |
2121 | 2140 | | |
2122 | 2141 | | |
| |||
2130 | 2149 | | |
2131 | 2150 | | |
2132 | 2151 | | |
| 2152 | + | |
| 2153 | + | |
2133 | 2154 | | |
2134 | 2155 | | |
2135 | 2156 | | |
| |||
2145 | 2166 | | |
2146 | 2167 | | |
2147 | 2168 | | |
2148 | | - | |
| 2169 | + | |
| 2170 | + | |
2149 | 2171 | | |
2150 | 2172 | | |
2151 | 2173 | | |
| |||
2156 | 2178 | | |
2157 | 2179 | | |
2158 | 2180 | | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
2159 | 2196 | | |
2160 | 2197 | | |
2161 | 2198 | | |
| |||
0 commit comments