Commit e4eca2a1 authored by Laurent FERT's avatar Laurent FERT Committed by Greg Kroah-Hartman

intel_th: msu: Fix offset for wrapped block

Fix offset for the second pass on the wrapped block when iterating over
memory in multi-block mode, otherwise wrong part of the block will get
copied.
Signed-off-by: default avatarLaurent FERT <laurent.fert@intel.com>
Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4d02ceff
...@@ -408,7 +408,7 @@ msc_buffer_iterate(struct msc_iter *iter, size_t size, void *data, ...@@ -408,7 +408,7 @@ msc_buffer_iterate(struct msc_iter *iter, size_t size, void *data,
* Second time (wrap_count==1), it's just like any other block, * Second time (wrap_count==1), it's just like any other block,
* containing data in the range of [MSC_BDESC..data_bytes]. * containing data in the range of [MSC_BDESC..data_bytes].
*/ */
if (iter->block == iter->start_block && iter->wrap_count) { if (iter->block == iter->start_block && iter->wrap_count == 2) {
tocopy = DATA_IN_PAGE - data_bytes; tocopy = DATA_IN_PAGE - data_bytes;
src += data_bytes; src += data_bytes;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment