Skip to content
Snippets Groups Projects
Commit c6498b82 authored by Ronny Nilsson's avatar Ronny Nilsson
Browse files

brcm_fw_tool: only activate an inactive bank.

Prevent user to manually activate an already active flash
bank due to otherwise the metadata sequnce numbers become
out of sync.
parent 13354559
No related branches found
No related tags found
No related merge requests found
...@@ -835,6 +835,31 @@ static int meta_manage_vols(int readonly, int forcedBank) ...@@ -835,6 +835,31 @@ static int meta_manage_vols(int readonly, int forcedBank)
break; break;
} }
/* Prevent user to manually activate an already active flash
* bank due to otherwise the metadata sequnce numbers become
* out of sync. */
if(forcedBank >= 0 && metaInfos[highMeta].committed) {
switch(metaInfos[highMeta].volInfo.vol_id) {
case METAVOLID0:
case METAVOLID1:
if(newBank == 0) newBank = -1;
break;
case METAVOLID2:
case METAVOLID3:
if(newBank == 1) newBank = -1;
break;
default:
break;
}
if(newBank == -1) {
if(verbose) printf("Forced bank is already active, nothing to do.\n");
return 0;
}
}
if (verbose) { if (verbose) {
printf("Highest sequence number found is %d.\n", highSeqNo); printf("Highest sequence number found is %d.\n", highSeqNo);
printf("Will create volume %d", newMeta); printf("Will create volume %d", newMeta);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment