Re: [PATCH v2 3/9] powerpc/powernv: opal_put_chars partial write fix

2018-04-09 Thread Benjamin Herrenschmidt
On Mon, 2018-04-09 at 15:24 +1000, Nicholas Piggin wrote: > 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

[PATCH v2 3/9] powerpc/powernv: opal_put_chars partial write fix

2018-04-08 Thread Nicholas Piggin
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.