kernel: bcm47xxpart: fix getting user-space data partition name
authorRafał Miłecki <rafal@milecki.pl>
Tue, 10 Jul 2018 12:02:00 +0000 (14:02 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Tue, 10 Jul 2018 12:05:02 +0000 (14:05 +0200)
Partition name is picked by a parser_trx_data_part_name(). It has to
get correct partition offset (taking care of bad blocks) to work
properly.

This fixes UBI support for devices that have kernel flashed on partition
with a bad block.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
target/linux/generic/pending-4.14/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch
target/linux/generic/pending-4.9/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch

index 9299e886712401ce4418bd3eb97b509cd4c32de9..d54c284c343b5c71040d9b76b485ea0d870fd684 100644 (file)
@@ -59,9 +59,10 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  
        if (trx.offset[i]) {
                part = &parts[curr_part++];
-               part->name = parser_trx_data_part_name(mtd, trx.offset[i]);
+-              part->name = parser_trx_data_part_name(mtd, trx.offset[i]);
 -              part->offset = trx.offset[i];
 +              part->offset = parser_trx_real_offset(mtd, trx.offset[i]);
++              part->name = parser_trx_data_part_name(mtd, part->offset);
                i++;
        }
  
index 9299e886712401ce4418bd3eb97b509cd4c32de9..d54c284c343b5c71040d9b76b485ea0d870fd684 100644 (file)
@@ -59,9 +59,10 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  
        if (trx.offset[i]) {
                part = &parts[curr_part++];
-               part->name = parser_trx_data_part_name(mtd, trx.offset[i]);
+-              part->name = parser_trx_data_part_name(mtd, trx.offset[i]);
 -              part->offset = trx.offset[i];
 +              part->offset = parser_trx_real_offset(mtd, trx.offset[i]);
++              part->name = parser_trx_data_part_name(mtd, part->offset);
                i++;
        }