提交 6111a4f9 编写于 作者: W Willy Tarreau 提交者: Denis Efremov

floppy: make sure to reset all FDCs upon resume()

In floppy_resume() we don't properly reinitialize all FDCs, instead
we reinitialize the current FDC once per available FDC because value
-1 is passed to user_reset_fdc(). Let's simply save the current drive
and properly reinitialize each FDC.

Link: https://lore.kernel.org/r/20200410101904.14652-1-w@1wt.euSigned-off-by: NWilly Tarreau <w@1wt.eu>
Signed-off-by: NDenis Efremov <efremov@linux.com>
上级 05f5e319
...@@ -4545,11 +4545,13 @@ static void floppy_device_release(struct device *dev) ...@@ -4545,11 +4545,13 @@ static void floppy_device_release(struct device *dev)
static int floppy_resume(struct device *dev) static int floppy_resume(struct device *dev)
{ {
int fdc; int fdc;
int saved_drive;
saved_drive = current_drive;
for (fdc = 0; fdc < N_FDC; fdc++) for (fdc = 0; fdc < N_FDC; fdc++)
if (fdc_state[fdc].address != -1) if (fdc_state[fdc].address != -1)
user_reset_fdc(-1, FD_RESET_ALWAYS, false); user_reset_fdc(REVDRIVE(fdc, 0), FD_RESET_ALWAYS, false);
set_fdc(saved_drive);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册