Subject: L68K: patch for new amiflop
To: linux-m68k@lists.linux-m68k.org (linux-list),
        Jes.Sorensen@cern.ch (Jes Sorensen)
Date: Wed, 7 Jan 1998 22:20:00 +0100 (MET)
From: "J." Dorchain <dorchain@gate.moebelwalther.de>
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: jdorchain@i-con.de

,

not really out, here is the first patch. It should solve some problem
when writing.

Jes, does it help?

Joerg

--- amiflop.c.06011998	Tue Jan  6 00:00:00 1998
+++ amiflop.c	Wed Jan  7 01:18:48 1998
@@ -1278,6 +1278,9 @@
  * different kernel versions.
  */
 
+/* FIXME: this assumes the drive is still spinning -
+ * which is only true if we complete writing a track within three seconds
+ */
 static void flush_track_callback(unsigned long nr)
 {
 	nr&=3;
@@ -1438,6 +1441,12 @@
 				goto repeat;
 			}
 			memcpy(unit[drive].trackbuf + sector * 512, data, 512);
+
+			/* keep the drive spinning while writes are scheduled */
+			if (!fd_motor_on(drive)) {
+				end_request(0);
+				goto repeat;
+			}
 			/*
 			 * setup a callback to write the track buffer
 			 * after a short (1 tick) delay.
