]> git.baikalelectronics.ru Git - kernel.git/commit
via-cuda: Fix re-initialization of reply_ptr and reading_reply
authorFinn Thain <fthain@telegraphics.com.au>
Sun, 1 Jan 2017 00:56:26 +0000 (19:56 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 Feb 2017 05:56:20 +0000 (16:56 +1100)
commitdedd82c7c1f4ae07fe8896ae026d4450cdf09a07
tree894246ad083181307bfde948e0ab41b2cc75b3da
parent57947d2a4204c9b403411c2f07f3de8f8dc48386
via-cuda: Fix re-initialization of reply_ptr and reading_reply

When reading_reply is set, reply_ptr points into an adb_request struct.
Conversely, when reply_ptr instead points into the global cuda_rbuf,
reading_reply must be false.

Unfortunately, this rule can be violated because re-initialization
of reply_ptr and reading_reply presently depends on the TREQ input.

Fix this by re-initializing reply_ptr and reading_reply as soon as they
are known to be invalid.

Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/macintosh/via-cuda.c