kernel: mtk_bmt: remap blocks after reaching bitflip threshold
This ensures that blocks are remapped before data becomes corrupt Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
		@@ -529,6 +529,10 @@ mtk_bmt_read(struct mtd_info *mtd, loff_t from,
 | 
				
			|||||||
			goto out;
 | 
								goto out;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (cur_ret >= mtd->bitflip_threshold &&
 | 
				
			||||||
 | 
							    mapping_block_in_range(block))
 | 
				
			||||||
 | 
								update_bmt(block, mtd->erasesize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ops->retlen += cur_ops.retlen;
 | 
							ops->retlen += cur_ops.retlen;
 | 
				
			||||||
		ops->oobretlen += cur_ops.oobretlen;
 | 
							ops->oobretlen += cur_ops.oobretlen;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user