]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv: opal_put_chars partial write fix
authorNicholas Piggin <npiggin@gmail.com>
Mon, 30 Apr 2018 14:55:44 +0000 (00:55 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 24 Jul 2018 12:09:54 +0000 (22:09 +1000)
commit51f90313b67fba76c6b20b608581d695d5cbd97a
treeac70869f8ae7993b873bc63c240f0147a774abca
parenta6cde2c1332c853732e830d6aed046082a625450
powerpc/powernv: opal_put_chars partial write fix

The intention here is to consume and discard the remaining buffer
upon error. This works if there has not been a previous partial write.
If there has been, then total_len is no longer total number of bytes
to copy. total_len is always "bytes left to copy", so it should be
added to written bytes.

This code may not be exercised any more if partial writes will not be
hit, but this is a small bugfix before a larger change.

Reviewed-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/opal.c