Commit 5c9f9884 authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Lipeng Sang
Browse files

ata: pata_legacy: fix pdc20230_set_piomode()

stable inclusion
from stable-v5.10.154
commit 24f9c41435a89d73846dbb06b8ba85824bcf9fea
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I64YCB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=24f9c41435a89d73846dbb06b8ba85824bcf9fea



--------------------------------

[ Upstream commit 171a9318 ]

Clang gives a warning when compiling pata_legacy.c with 'make W=1' about
the 'rt' local variable in pdc20230_set_piomode() being set but unused.
Quite obviously, there is an outb() call missing to write back the updated
variable. Moreover, checking the docs by Petr Soucek revealed that bitwise
AND should have been done with a negated timing mask and the master/slave
timing masks were swapped while updating...

Fixes: 669a5db4 ("[libata] Add a bunch of PATA drivers.")
Reported-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLipeng Sang <sanglipeng1@jd.com>
parent a989dc3b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment