Author: cgutman
Date: Sat Oct 29 14:19:30 2011
New Revision: 54267
URL:
http://svn.reactos.org/svn/reactos?rev=54267&view=rev
Log:
[FLOPPY]
- Prevent a deadlock on very old controllers by sending the configure and version commands
before resetting the controller
Modified:
trunk/reactos/drivers/storage/floppy/floppy.c
Modified: trunk/reactos/drivers/storage/floppy/floppy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/floppy/flo…
==============================================================================
--- trunk/reactos/drivers/storage/floppy/floppy.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/floppy/floppy.c [iso-8859-1] Sat Oct 29 14:19:30 2011
@@ -666,15 +666,22 @@
UCHAR HeadLoadTime;
UCHAR HeadUnloadTime;
UCHAR StepRateTime;
+ UCHAR ControllerVersion;
PAGED_CODE();
ASSERT(ControllerInfo);
TRACE_(FLOPPY, "InitController called with Controller 0x%p\n",
ControllerInfo);
+ /* Get controller in a known state */
+ HwConfigure(ControllerInfo, FALSE, TRUE, TRUE, 0, 0);
+
+ /* Get the controller version */
+ ControllerVersion = HwGetVersion(ControllerInfo);
+
KeClearEvent(&ControllerInfo->SynchEvent);
- /* Reset the controller to avoid interrupt garbage on certain controllers */
+ /* Reset the controller */
if(HwReset(ControllerInfo) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "InitController: unable to reset controller\n");
@@ -701,10 +708,10 @@
INFO_(FLOPPY, "InitController: done sensing interrupts\n");
/* Next, see if we have the right version to do implied seek */
- if(HwGetVersion(ControllerInfo) == VERSION_ENHANCED)
+ if(ControllerVersion == VERSION_ENHANCED)
{
/* If so, set that up -- all defaults below except first TRUE for EIS */
- if(HwConfigure(ControllerInfo, TRUE, TRUE, FALSE, 0, 0) != STATUS_SUCCESS)
+ if(HwConfigure(ControllerInfo, TRUE, TRUE, TRUE, 0, 0) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "InitController: unable to set up implied seek\n");
ControllerInfo->ImpliedSeeks = FALSE;