summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorMichael Schmitz <schmitzmic@gmail.com>2021-10-19 19:13:21 +1300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-17 09:48:38 +0100
commit3446e5ecdf91b945b7b741d372a26f19897380ac (patch)
tree04b5b96e44830dbce4b8278f15d6670470989d31 /drivers/platform
parent2918a29fc8ba42841ddc8046032fd9fa046af5df (diff)
downloadlinux-3446e5ecdf91b945b7b741d372a26f19897380ac.tar.gz
linux-3446e5ecdf91b945b7b741d372a26f19897380ac.tar.bz2
linux-3446e5ecdf91b945b7b741d372a26f19897380ac.zip
block: ataflop: fix breakage introduced at blk-mq refactoring
[ Upstream commit 86d46fdaa12ae5befc16b8d73fc85a3ca0399ea6 ] Refactoring of the Atari floppy driver when converting to blk-mq has broken the state machine in not-so-subtle ways: finish_fdc() must be called when operations on the floppy device have completed. This is crucial in order to relase the ST-DMA lock, which protects against concurrent access to the ST-DMA controller by other drivers (some DMA related, most just related to device register access - broken beyond compare, I know). When rewriting the driver's old do_request() function, the fact that finish_fdc() was called only when all queued requests had completed appears to have been overlooked. Instead, the new request function calls finish_fdc() immediately after the last request has been queued. finish_fdc() executes a dummy seek after most requests, and this overwrites the state machine's interrupt hander that was set up to wait for completion of the read/write request just prior. To make matters worse, finish_fdc() is called before device interrupts are re-enabled, making certain that the read/write interupt is missed. Shifting the finish_fdc() call into the read/write request completion handler ensures the driver waits for the request to actually complete. With a queue depth of 2, we won't see long request sequences, so calling finish_fdc() unconditionally just adds a little overhead for the dummy seeks, and keeps the code simple. While we're at it, kill ataflop_commit_rqs() which does nothing but run finish_fdc() unconditionally, again likely wiping out an in-flight request. Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> Fixes: 6ec3938cff95 ("ataflop: convert to blk-mq") CC: linux-block@vger.kernel.org CC: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Link: https://lore.kernel.org/r/20211019061321.26425-1-schmitzmic@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/platform')
0 files changed, 0 insertions, 0 deletions