]> git.baikalelectronics.ru Git - uboot.git/commit
blk: Invalidate block cache when switching hwpart
authorWeijie Gao <weijie.gao@mediatek.com>
Thu, 11 Jul 2019 07:10:23 +0000 (15:10 +0800)
committerTom Rini <trini@konsulko.com>
Thu, 18 Jul 2019 15:31:31 +0000 (11:31 -0400)
commit49efe4994db6b69a9cf8cb93a78db848a42c9174
tree6ef07a51f392f9d84bd2082550486b6f38cd13be
parentbf31db36de1fedc70561f141288fce121b050f54
blk: Invalidate block cache when switching hwpart

Some storage devices have multiple hw partitions and both address from
zero, for example eMMC.
However currently block cache invalidation only applies to block
write/erase.
This can cause a problem that data of current hw partition is cached
before switching to another hw partition. And the following read
operation of the latter hw partition will get wrong data when reading
from the addresses that have been cached previously.

To solve this problem, invalidate block cache after a successful
select_hwpart operation.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
drivers/block/blk-uclass.c