Doug Anderson has posted comments on this change.
Change subject: samsung: snow: bitfix: Recover from bit errors across sleep/wake
......................................................................
Patch Set 14: (36 inline comments)
....................................................
File arch/arm/mach-exynos/bitfix-snow.c
Line 47: * - The 0x00000003 bit has to do with byte. Each byte in a 32-bit word goes
Done
Line 68: * (unless we get a double-corruption which should be extremely rate).
Not going to change terminology now...
From Bryan: s/rate/rare
Done
Line 75: * We'll then rely on an out-of-band singnal (CRC) to identify bad chunks (8K)
Done
Line 75: * We'll then rely on an out-of-band singnal (CRC) to identify bad chunks (8K)
pm-check
Line 77: * will recompute it. Since all bad chunks are in a single corrutpion unit
Done
Line 77: * will recompute it. Since all bad chunks are in a single corrutpion unit
Done
Line 196: #define SUPERCHUNK_SIZE (1 << CORRUPTION_UNIT_OFFSET)
From Bryan: should be based on SUPERCHUNK_BITS for clarity.
Done.
Line 232: * @size: Size of region 1.
Done
Line 234: * @whatsz: Size of region 2.
Done
Line 244: if (what >= (ptr + size))
No, there shouldn't be. We are comparing if two chunks of memory overlap and those chunks must fit fully within phys_addr_t.
Line 287: * elements.
I'll put a BUG_ON() for the count but not for the dest/src. In fact, I'll remove the comment for dest/src. The fact that they are "u32 *" means that they must be aligned. Validating at that level doesn't make sense to me.
Line 290: static void bitfix_xor32(u32 *dest, u32 *src, size_t count)
Done
Line 299: * Run xor on the given page; storing in the given corruption unit.
Hopefully I've clarified this now.
Line 301: * We'll xor the given page into the equivalnet page in the given corruption
Done
Line 325: * Print out comparisons of which bits were fixed in a page.
Done
Line 347: * - Only pages that have been processed can be recovered.
Done
Line 349: * should indicate that it was skipped.
Done
Line 355: * page instead of on a chunk-by-chunk.
Done
Line 375: * This is the start of the bad chunk.
Could, but this an internal function called in one place.
Line 376: * @skip_fn: This will be called chunk at a time. If a chunk was never
Done
Line 381: static void _bitfix_recover_chunk(phys_addr_t dest_chunk,
Done
Line 384: const u32 dest_corruption_unit = bitfix_get_corruption_unit(dest_chunk);
Happy with that. Done.
Line 400: * need to process it now for recovery.
Done
Line 406: for (pgnum = 0; pgnum < (CHUNK_SIZE / PAGE_SIZE); pgnum++) {
Done
Line 422: * We can only recovery a chunk whose pages were processed originally with
Done
Line 446: if (recover_chunk == NULL)
Done
Line 446: if (recover_chunk == NULL)
Code is gone. Memory is allocated in globals now.
Line 453: * We recover to recover_chunk instead of directly to memory and then
Reworded. See what you think.
Line 456: * weren't super serious enough to prevent bitfix from running. In
Reworded whole section.
Line 463: * Do comparisons to characterize the corruption.
We don't get bit errors often (3.5% of the time?). When we do we don't seem to get more than 100 in an extreme case. The extra speed impact here doesn't seem huge compared to processing all 2 gigs of memory.
Line 510: recover_chunk = kmalloc(CHUNK_SIZE, GFP_KERNEL);
Sure. It does make things simpler, and it's only 8K. The nice thing is that it can now go in the special suspend_volatile section.
Line 513: * Zero out all of the xor superchunk.
Done
Line 513: * Zero out all of the xor superchunk.
Done
Line 615: #ifdef CONFIG_SNOW_BITFIX_FORCE
Done
....................................................
File arch/arm/plat-samsung/pm-check.c
Line 372: bitfix_recover_chunk(addr, s3c_pm_should_skip);
Not completely paranoia:
* In the case of the failure of 2 chips at the same time bitfix will actually do the wrong thing. ...but it has no way of knowing--it just xors stuff together with no real checksum.
* There is a possibility that something more drastic could go wrong also. We can get bit flips in the code that runs bitfix or in other places. I'd rather be sure that we really fixed things.
....................................................
Commit Message
Line 67: [ 0.000000] bitfix_reserve: Reserved 00200000 bytes
With Olof's feedback we're actually going to allocate memory always.
...but yes, new bios shouldn't be getting automatically enabled.
Gerrit-MessageType: comment
Gerrit-Change-Id: I9c7ac2f85b8d9398c93f486f9401daee1526f571
Gerrit-PatchSet: 14
Gerrit-Project: chromiumos/third_party/kernel
Gerrit-Branch: chromeos-3.4
Gerrit-Owner: Doug Anderson <
dian...@chromium.org>