linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PROBLEM: floppy motor spins when floppy module not installed
@ 2003-12-12 13:57 Dale Mellor
  2003-12-12 14:18 ` Måns Rullgård
  2003-12-12 14:59 ` Richard B. Johnson
  0 siblings, 2 replies; 20+ messages in thread
From: Dale Mellor @ 2003-12-12 13:57 UTC (permalink / raw)
  To: linux-kernel

1. Floppy motor spins when floppy module not installed.

2. From the moment of bootup, the floppy drive motor spins when the kernel is
   compiled to use the floppy driver as a module and this is not installed (the
   motor stops as soon as the module is installed).

3. Keywords: floppy, module, kernel, boot.

4. Kernel version 2.6.0-test11

5. 

6.

7.

7.1 Gnu C                  3.2.1
    Gnu make               3.80
    util-linux             2.11y
    mount                  2.11y
    module-init-tools      0.9.8
    e2fsprogs              1.28
    reiserfsprogs          3.x.1b
    pcmcia-cs              3.2.5
    PPP                    2.4.2b3
    nfs-utils              1.0.6
    Linux C Library        2.3.2
    Dynamic linker (ldd)   2.3.2
    Procps                 2.0.7
    Net-tools              1.60
    Kbd                    command
    Sh-utils               5.0
    Modules Loaded         ymfpci ac97_codec soundcore pcnet_cs 8390 crc32 ipv6 pegasus


7.2 processor	: 0
    vendor_id	: GenuineTMx86
    cpu family	: 6
    model		: 4
    model name	: Transmeta(tm) Crusoe(tm) Processor TM5600
    stepping	: 3
    cpu MHz		: 595.732
    cache size	: 512 KB
    fdiv_bug	: no
    hlt_bug		: no
    f00f_bug	: no
    coma_bug	: no
    fpu		: yes
    fpu_exception	: yes
    cpuid level	: 1
    wp		: yes
    flags		: fpu vme de pse tsc msr cx8 cmov mmx longrun
    bogomips	: 1085.44


7.3 ymfpci 49280 0 - Live 0xc78ed000
    ac97_codec 18080 1 ymfpci, Live 0xc78d2000
    soundcore 8064 1 ymfpci, Live 0xc78bc000
    pcnet_cs 16484 1 - Live 0xc78d8000
    8390 9824 1 pcnet_cs, Live 0xc78ce000
    crc32 4096 1 8390, Live 0xc78bf000
    ipv6 238400 20 - Live 0xc790f000
    pegasus 21024 0 - Live 0xc78c3000


7.4 0000-001f : dma1
    0020-0021 : pic1
    0040-005f : timer
    0060-006f : keyboard
    0080-008f : dma page reg
    00a0-00a1 : pic2
    00c0-00df : dma2
    00f0-00ff : fpu
    01f0-01f7 : ide0
    02f8-02ff : pcnet_cs
    0300-031f : pcnet_cs
    03c0-03df : vga+
    03f6-03f6 : ide0
    0cf8-0cff : PCI conf1
    1000-100f : 0000:00:07.1
      1000-1007 : ide0
      1008-100f : ide1
    1010-1013 : 0000:00:09.0
    1020-103f : 0000:00:07.2
      1020-103f : uhci_hcd
    1040-105f : 0000:00:07.3
    1080-10bf : 0000:00:09.0
    10c0-10c7 : Sony Programable I/O Device
    1400-14ff : 0000:00:0d.0
    4000-40ff : PCI CardBus #01
    4400-44ff : PCI CardBus #01
    8000-803f : 0000:00:07.3

    00000000-0009b7ff : System RAM
    0009b800-0009ffff : reserved
    000a0000-000bffff : Video RAM area
    000c0000-000c7fff : Video ROM
    000f0000-000fffff : System ROM
    00100000-06feffff : System RAM
      00100000-002b4d37 : Kernel code
      002b4d38-0035ff9f : Kernel data
    06ff0000-06fff7ff : ACPI Tables
    06fff800-06ffffff : ACPI Non-volatile Storage
    10000000-10000fff : 0000:00:0c.0
      10000000-10000fff : yenta_socket
    10400000-107fffff : PCI CardBus #01
    10800000-10bfffff : PCI CardBus #01
    a0000000-a0000fff : card services
    fc000000-fc0fffff : 0000:00:00.0
    fc100000-fc103fff : 0000:00:08.0
    fc104000-fc1047ff : 0000:00:08.0
    fc104800-fc1049ff : 0000:00:0b.0
    fc105000-fc105fff : 0000:00:0d.0
    fc108000-fc10ffff : 0000:00:09.0
      fc108000-fc10ffff : ymfpci
    fd000000-fdffffff : 0000:00:0d.0
    fff80000-ffffffff : reserved


7.5

7.6

7.7

X. Workaround: either install the module and then uninstall it;
                   or kill the penguin ;-)  (sorry, couldn't resist...)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 13:57 PROBLEM: floppy motor spins when floppy module not installed Dale Mellor
@ 2003-12-12 14:18 ` Måns Rullgård
  2003-12-12 15:04   ` Richard B. Johnson
  2003-12-13 13:18   ` Helge Hafting
  2003-12-12 14:59 ` Richard B. Johnson
  1 sibling, 2 replies; 20+ messages in thread
From: Måns Rullgård @ 2003-12-12 14:18 UTC (permalink / raw)
  To: linux-kernel

Dale Mellor <dale@dmellor.dabsol.co.uk> writes:

> 1. Floppy motor spins when floppy module not installed.

It's a known problem.  Some broken BIOSes don't turn off the motor
after probing for a disk.  One solution is to change the boot priority
in the BIOS settings so the hard disk is tried before floppy.  If you
ever need to boot from a floppy, you can change it back.

-- 
Måns Rullgård
mru@kth.se


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 13:57 PROBLEM: floppy motor spins when floppy module not installed Dale Mellor
  2003-12-12 14:18 ` Måns Rullgård
@ 2003-12-12 14:59 ` Richard B. Johnson
  1 sibling, 0 replies; 20+ messages in thread
From: Richard B. Johnson @ 2003-12-12 14:59 UTC (permalink / raw)
  To: Dale Mellor; +Cc: linux-kernel

On Fri, 12 Dec 2003, Dale Mellor wrote:

> 1. Floppy motor spins when floppy module not installed.
>
> 2. From the moment of bootup, the floppy drive motor spins when the kernel is
>    compiled to use the floppy driver as a module and this is not installed (the
>    motor stops as soon as the module is installed).
>
> 3. Keywords: floppy, module, kernel, boot.
>

Kernel version 2.6.0-test11

[SNIPPED...]

This was reported a long time ago and there were some patches
around to fix it. I guess it didn't get into the "main-line",
perhaps because people don't think it's important.

Your temporary fix is to disable the "floppy-seek" on boot and
to change the boot-sequence so the floppy is not accessed on
boot (change the BIOS to boot C: before A:). That will "fix"
the problem for the moment.

The correct fix, that nobody wanted to do, is to reset the
motor control bit in the FDC motor control register upon
startup. This was previously shown and patches exist.

There were doom-sayers that claimed that the earth may stop
turning (or something like that) if this was done which is
probably why it didn't get fixed. If you are bold and want
to try again, somewhere convenient in
              ../linux-nn.nn/arch/i386/boot/setup.S
write a zero byte out port 0x3f2. This port is used only
for the FDC motor so it won't hurt if the controller's not
even there.

Something like:

--- setup.S.orig	Tue Oct  7 09:24:33 2003
+++ setup.S	Fri Dec 12 09:52:32 2003
@@ -777,6 +777,10 @@
 	movb	$0xFB, %al			# mask all irq's but irq2 which
 	outb	%al, $0x21			# is cascaded

+	movw	$0x3f2, %dx
+	xorb	%al, %al			# Turn OFF FDC motor
+	outb	%al, %dx
+
 # Well, that certainly wasn't fun :-(. Hopefully it works, and we don't
 # need no steenking BIOS anyway (except for the initial loading :-).
 # The BIOS-routine wants lots of unnecessary data, and it's less



Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 14:18 ` Måns Rullgård
@ 2003-12-12 15:04   ` Richard B. Johnson
  2003-12-12 15:11     ` Måns Rullgård
  2003-12-12 19:28     ` John Bradford
  2003-12-13 13:18   ` Helge Hafting
  1 sibling, 2 replies; 20+ messages in thread
From: Richard B. Johnson @ 2003-12-12 15:04 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: linux-kernel

On Fri, 12 Dec 2003, [iso-8859-1] Måns Rullgård wrote:

> Dale Mellor <dale@dmellor.dabsol.co.uk> writes:
>
> > 1. Floppy motor spins when floppy module not installed.
>
> It's a known problem.  Some broken BIOSes don't turn off the motor
> after probing for a disk.  One solution is to change the boot priority
> in the BIOS settings so the hard disk is tried before floppy.  If you
> ever need to boot from a floppy, you can change it back.
>
> --
> Måns Rullgård
> mru@kth.se

It is not a broken BIOS! The BIOS timer that ticks 18.206 times
per second has an ISR that, in addition to keeping time, turns
OFF the FDC motor after two seconds of inactivity. This ISR is taken
away by Linux. Therefore Linux must turn off that motor! It is a
Linux bug, not a BIOS bug. Linux took control away from the BIOS
during boot.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 15:04   ` Richard B. Johnson
@ 2003-12-12 15:11     ` Måns Rullgård
  2003-12-12 15:20       ` Richard B. Johnson
  2003-12-12 16:00       ` Matthew Kirkwood
  2003-12-12 19:28     ` John Bradford
  1 sibling, 2 replies; 20+ messages in thread
From: Måns Rullgård @ 2003-12-12 15:11 UTC (permalink / raw)
  To: linux-kernel

"Richard B. Johnson" <root@chaos.analogic.com> writes:

> On Fri, 12 Dec 2003, [iso-8859-1] Måns Rullgård wrote:
>
>> Dale Mellor <dale@dmellor.dabsol.co.uk> writes:
>>
>> > 1. Floppy motor spins when floppy module not installed.
>>
>> It's a known problem.  Some broken BIOSes don't turn off the motor
>> after probing for a disk.  One solution is to change the boot priority
>> in the BIOS settings so the hard disk is tried before floppy.  If you
>> ever need to boot from a floppy, you can change it back.
>
> It is not a broken BIOS! The BIOS timer that ticks 18.206 times
> per second has an ISR that, in addition to keeping time, turns
> OFF the FDC motor after two seconds of inactivity. This ISR is taken
> away by Linux. Therefore Linux must turn off that motor! It is a
> Linux bug, not a BIOS bug. Linux took control away from the BIOS
> during boot.

OK, but why doesn't it affect all machines?

-- 
Måns Rullgård
mru@kth.se


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 15:11     ` Måns Rullgård
@ 2003-12-12 15:20       ` Richard B. Johnson
  2003-12-12 15:33         ` Måns Rullgård
  2003-12-12 16:00       ` Matthew Kirkwood
  1 sibling, 1 reply; 20+ messages in thread
From: Richard B. Johnson @ 2003-12-12 15:20 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: linux-kernel

On Fri, 12 Dec 2003, [iso-8859-1] Måns Rullgård wrote:

> "Richard B. Johnson" <root@chaos.analogic.com> writes:
>
> > On Fri, 12 Dec 2003, [iso-8859-1] Måns Rullgård wrote:
> >
> >> Dale Mellor <dale@dmellor.dabsol.co.uk> writes:
> >>
> >> > 1. Floppy motor spins when floppy module not installed.
> >>
> >> It's a known problem.  Some broken BIOSes don't turn off the motor
> >> after probing for a disk.  One solution is to change the boot priority
> >> in the BIOS settings so the hard disk is tried before floppy.  If you
> >> ever need to boot from a floppy, you can change it back.
> >
> > It is not a broken BIOS! The BIOS timer that ticks 18.206 times
> > per second has an ISR that, in addition to keeping time, turns
> > OFF the FDC motor after two seconds of inactivity. This ISR is taken
> > away by Linux. Therefore Linux must turn off that motor! It is a
> > Linux bug, not a BIOS bug. Linux took control away from the BIOS
> > during boot.
>
> OK, but why doesn't it affect all machines?
>
If you leave the FDC software in the kernel, the FDC software
sets up everything and turns off the motor. If you have the
FDC as a module, you have nothing in there to turn off the
motor until you install the module.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 15:20       ` Richard B. Johnson
@ 2003-12-12 15:33         ` Måns Rullgård
  2003-12-12 16:05           ` Petr Vandrovec
  0 siblings, 1 reply; 20+ messages in thread
From: Måns Rullgård @ 2003-12-12 15:33 UTC (permalink / raw)
  To: linux-kernel

"Richard B. Johnson" <root@chaos.analogic.com> writes:

> On Fri, 12 Dec 2003, [iso-8859-1] Måns Rullgård wrote:
>
>> "Richard B. Johnson" <root@chaos.analogic.com> writes:
>>
>> > It is not a broken BIOS! The BIOS timer that ticks 18.206 times
>> > per second has an ISR that, in addition to keeping time, turns
>> > OFF the FDC motor after two seconds of inactivity.

IMHO a ridiculous design, as is most of the PC.

>> > This ISR is taken away by Linux. Therefore Linux must turn off
>> > that motor! It is a Linux bug, not a BIOS bug. Linux took control
>> > away from the BIOS during boot.
>>
>> OK, but why doesn't it affect all machines?
>>
> If you leave the FDC software in the kernel, the FDC software
> sets up everything and turns off the motor. If you have the
> FDC as a module, you have nothing in there to turn off the
> motor until you install the module.

I'm running 2.6.0-test11 on a machine with modular floppy driver,
without any spinning motors.  I think it boots from floppy before HD,
but I'm not certain (can't check right now).

-- 
Måns Rullgård
mru@kth.se


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 15:11     ` Måns Rullgård
  2003-12-12 15:20       ` Richard B. Johnson
@ 2003-12-12 16:00       ` Matthew Kirkwood
  1 sibling, 0 replies; 20+ messages in thread
From: Matthew Kirkwood @ 2003-12-12 16:00 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: linux-kernel

On Fri, 12 Dec 2003, Måns Rullgård wrote:

> > It is not a broken BIOS! The BIOS timer that ticks 18.206 times per
> > second has an ISR that, in addition to keeping time, turns OFF the FDC
> > motor after two seconds of inactivity. This ISR is taken away by
> > Linux. Therefore Linux must turn off that motor! It is a Linux bug,
> > not a BIOS bug. Linux took control away from the BIOS during boot.
>
> OK, but why doesn't it affect all machines?

Most likely, other machines take longer than two seconds from
probing the floppy to booting the kernel.

Matthew.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 15:33         ` Måns Rullgård
@ 2003-12-12 16:05           ` Petr Vandrovec
  2003-12-12 16:27             ` Måns Rullgård
  0 siblings, 1 reply; 20+ messages in thread
From: Petr Vandrovec @ 2003-12-12 16:05 UTC (permalink / raw)
  To: M?ns Rullg?rd; +Cc: linux-kernel

On Fri, Dec 12, 2003 at 04:33:57PM +0100, M?ns Rullg?rd wrote:
> "Richard B. Johnson" <root@chaos.analogic.com> writes:
> 
> > On Fri, 12 Dec 2003, [iso-8859-1] M?ns Rullg?rd wrote:
> >
> >> "Richard B. Johnson" <root@chaos.analogic.com> writes:
> >>
> >> > It is not a broken BIOS! The BIOS timer that ticks 18.206 times
> >> > per second has an ISR that, in addition to keeping time, turns
> >> > OFF the FDC motor after two seconds of inactivity.
> 
> IMHO a ridiculous design, as is most of the PC.
> 
> >> > This ISR is taken away by Linux. Therefore Linux must turn off
> >> > that motor! It is a Linux bug, not a BIOS bug. Linux took control
> >> > away from the BIOS during boot.
> >>
> >> OK, but why doesn't it affect all machines?
> >>
> > If you leave the FDC software in the kernel, the FDC software
> > sets up everything and turns off the motor. If you have the
> > FDC as a module, you have nothing in there to turn off the
> > motor until you install the module.
> 
> I'm running 2.6.0-test11 on a machine with modular floppy driver,
> without any spinning motors.  I think it boots from floppy before HD,
> but I'm not certain (can't check right now).

Maybe because you run patched LILO which works around this 2.6.x
brokeness. Debian's #221967 says that 'reset disk subsystem' should
stop floppy motor. I'd like to see this black on white...

Fortunately Andreas Roland accepted patch instead of reassigning
bug to 2.6.x kernel package where it belongs - if kernel does
not pass timer IRQ to the BIOS, it is kernel's responsibility
to do tasks which BIOS scheduled for future...


lilo (1:22.5.8-6) unstable; urgency=low

  * Now LILO can disable FDC on (weird?) BIOS using 2.6 kernel.
    (closes: #221967)

						Petr Vandrovec


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 16:05           ` Petr Vandrovec
@ 2003-12-12 16:27             ` Måns Rullgård
  2003-12-12 16:41               ` Petr Vandrovec
  0 siblings, 1 reply; 20+ messages in thread
From: Måns Rullgård @ 2003-12-12 16:27 UTC (permalink / raw)
  To: linux-kernel

Petr Vandrovec <vandrove@vc.cvut.cz> writes:

> On Fri, Dec 12, 2003 at 04:33:57PM +0100, M?ns Rullg?rd wrote:
>> 
>> I'm running 2.6.0-test11 on a machine with modular floppy driver,
>> without any spinning motors.  I think it boots from floppy before HD,
>> but I'm not certain (can't check right now).
>
> Maybe because you run patched LILO which works around this 2.6.x

GRUB, actually.  Does it mess with the floppy drive?

-- 
Måns Rullgård
mru@kth.se


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 16:27             ` Måns Rullgård
@ 2003-12-12 16:41               ` Petr Vandrovec
  0 siblings, 0 replies; 20+ messages in thread
From: Petr Vandrovec @ 2003-12-12 16:41 UTC (permalink / raw)
  To: M?ns Rullg?rd; +Cc: linux-kernel

On Fri, Dec 12, 2003 at 05:27:45PM +0100, M?ns Rullg?rd wrote:
> Petr Vandrovec <vandrove@vc.cvut.cz> writes:
> 
> > On Fri, Dec 12, 2003 at 04:33:57PM +0100, M?ns Rullg?rd wrote:
> >> 
> >> I'm running 2.6.0-test11 on a machine with modular floppy driver,
> >> without any spinning motors.  I think it boots from floppy before HD,
> >> but I'm not certain (can't check right now).
> >
> > Maybe because you run patched LILO which works around this 2.6.x
> 
> GRUB, actually.  Does it mess with the floppy drive?

AFAIK yes:

NEWS:

New in 0.5 - 1998-08-20, Erich Boleyn:

 * GRUB now shuts off the floppy before transferring control to any
   other programs/modules/loaders.  (chain-loading doesn't matter here,
   just loading 32-bit modules/kernels)


stage2/asm.S:

/*
 * stop_floppy()
 *
 * Stops the floppy drive from spinning, so that other software is
 * jumped to with a known state.
 */
ENTRY(stop_floppy)
       movw    $0x3F2, %dx
       xorb    %al, %al
       outb    %al, %dx
       ret

						Petr Vandrovec


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 15:04   ` Richard B. Johnson
  2003-12-12 15:11     ` Måns Rullgård
@ 2003-12-12 19:28     ` John Bradford
  2003-12-12 19:47       ` Richard B. Johnson
  1 sibling, 1 reply; 20+ messages in thread
From: John Bradford @ 2003-12-12 19:28 UTC (permalink / raw)
  To: Richard B. Johnson, Måns Rullgård; +Cc: linux-kernel

Quote from "Richard B. Johnson" <root@chaos.analogic.com>:
> On Fri, 12 Dec 2003, [iso-8859-1] M=E5ns Rullg=E5rd wrote:
> 
> > Dale Mellor <dale@dmellor.dabsol.co.uk> writes:
> >
> > > 1. Floppy motor spins when floppy module not installed.
> >
> > It's a known problem.  Some broken BIOSes don't turn off the motor
> > after probing for a disk.  One solution is to change the boot priorit=
> y
> > in the BIOS settings so the hard disk is tried before floppy.  If you
> > ever need to boot from a floppy, you can change it back.
> >
> > --
> > M=E5ns Rullg=E5rd
> > mru@kth.se
> 
> It is not a broken BIOS! The BIOS timer that ticks 18.206 times
> per second has an ISR that, in addition to keeping time, turns
> OFF the FDC motor after two seconds of inactivity. This ISR is taken
> away by Linux. Therefore Linux must turn off that motor! It is a
> Linux bug, not a BIOS bug. Linux took control away from the BIOS
> during boot.

We discussed almost exactly the same problem at length on LKML just
two months ago:

http://marc.theaimsgroup.com/?l=linux-kernel&m=106545766213063&w=2

John.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 19:28     ` John Bradford
@ 2003-12-12 19:47       ` Richard B. Johnson
  2003-12-13  6:18         ` Joshua Schmidlkofer
  2003-12-13 10:40         ` John Bradford
  0 siblings, 2 replies; 20+ messages in thread
From: Richard B. Johnson @ 2003-12-12 19:47 UTC (permalink / raw)
  To: John Bradford; +Cc: Måns Rullgård, linux-kernel

On Fri, 12 Dec 2003, John Bradford wrote:

> Quote from "Richard B. Johnson" <root@chaos.analogic.com>:
> > On Fri, 12 Dec 2003, [iso-8859-1] M=E5ns Rullg=E5rd wrote:
> >
> > > Dale Mellor <dale@dmellor.dabsol.co.uk> writes:
> > >
> > > > 1. Floppy motor spins when floppy module not installed.
> > >
> > > It's a known problem.  Some broken BIOSes don't turn off the motor
> > > after probing for a disk.  One solution is to change the boot priorit=
> > y
> > > in the BIOS settings so the hard disk is tried before floppy.  If you
> > > ever need to boot from a floppy, you can change it back.
> > >
> > > --
> > > M=E5ns Rullg=E5rd
> > > mru@kth.se
> >
> > It is not a broken BIOS! The BIOS timer that ticks 18.206 times
> > per second has an ISR that, in addition to keeping time, turns
> > OFF the FDC motor after two seconds of inactivity. This ISR is taken
> > away by Linux. Therefore Linux must turn off that motor! It is a
> > Linux bug, not a BIOS bug. Linux took control away from the BIOS
> > during boot.
>
> We discussed almost exactly the same problem at length on LKML just
> two months ago:
>
> http://marc.theaimsgroup.com/?l=linux-kernel&m=106545766213063&w=2
>
> John.

Yes, and I recall we agreed to disagree where the FDC stop must
be put, but we both agreed that it must be stopped. I still contend
that since the Linux startup code takes control away from the BIOS,
it's that codes responsibility to turn OFF things that the BIOS
might have left ON.

Funny thing. It's so trivial, anybody/everybody could turn the
floppy motor off, but all the fingers point to somebody else's
code.

It's a bug in Linux, not in a boot-loader. That bug was covered up
until the FDC code got modularized. Once we were able to compile
a kernel without the FDC, the bug was exposed. So, I suggest that
we just fix the bug and be done with it. It's not a performance
problem, the write to the port occurs exactly once during the nest
999 days of up-time. It's just an attempt to make a mountain out
of a mole-hill.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 19:47       ` Richard B. Johnson
@ 2003-12-13  6:18         ` Joshua Schmidlkofer
  2003-12-15 14:37           ` Richard B. Johnson
  2003-12-13 10:40         ` John Bradford
  1 sibling, 1 reply; 20+ messages in thread
From: Joshua Schmidlkofer @ 2003-12-13  6:18 UTC (permalink / raw)
  To: root; +Cc: John Bradford, Måns Rullgård, Linux Kernel Mailing List

> Yes, and I recall we agreed to disagree where the FDC stop must
> be put, but we both agreed that it must be stopped. I still contend
> that since the Linux startup code takes control away from the BIOS,
> it's that codes responsibility to turn OFF things that the BIOS
> might have left ON.
> 
> Funny thing. It's so trivial, anybody/everybody could turn the
> floppy motor off, but all the fingers point to somebody else's
> code.
> 
> It's a bug in Linux, not in a boot-loader. That bug was covered up
> until the FDC code got modularized. Once we were able to compile
> a kernel without the FDC, the bug was exposed. So, I suggest that
> we just fix the bug and be done with it. It's not a performance
> problem, the write to the port occurs exactly once during the nest
> 999 days of up-time. It's just an attempt to make a mountain out
> of a mole-hill.


We have had (do have?) several cases of optional "this workaround", or
"that workaround" as per-hardware config options.  If this is that
objectionable for genral consumption then someone ought to submit a
patch to do the dirty deed but put it in as a configurable workaround
(CONFIG_TURNFLOPPYOFF=Y/N), and leave it at that. [For maximum
perversity, it could also be a MODULE.] This does not affect everyone
right?  I have never tried booting w/o the floppy module, so I really
don't know about my system.   


js


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 19:47       ` Richard B. Johnson
  2003-12-13  6:18         ` Joshua Schmidlkofer
@ 2003-12-13 10:40         ` John Bradford
  2003-12-15 14:50           ` Richard B. Johnson
  1 sibling, 1 reply; 20+ messages in thread
From: John Bradford @ 2003-12-13 10:40 UTC (permalink / raw)
  To: Richard B. Johnson; +Cc: Måns Rullgård, linux-kernel

Quote from "Richard B. Johnson" <root@chaos.analogic.com>:

> Yes, and I recall we agreed to disagree where the FDC stop must
> be put, but we both agreed that it must be stopped. I still contend
> that since the Linux startup code takes control away from the BIOS,
> it's that codes responsibility to turn OFF things that the BIOS
> might have left ON.

Well, on a practical level, yes, I agree with you, it is the easiest
way to solve the problem.

On a technical level, I still think that the BIOS configuration is
broken if it leaves the floppy motor on, on a system running a kernel
without the floppy code compiled in.

John.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-12 14:18 ` Måns Rullgård
  2003-12-12 15:04   ` Richard B. Johnson
@ 2003-12-13 13:18   ` Helge Hafting
  2003-12-13 16:42     ` Joshua Schmidlkofer
  1 sibling, 1 reply; 20+ messages in thread
From: Helge Hafting @ 2003-12-13 13:18 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: linux-kernel

On Fri, Dec 12, 2003 at 03:18:03PM +0100, Måns Rullgård wrote:
> Dale Mellor <dale@dmellor.dabsol.co.uk> writes:
> 
> > 1. Floppy motor spins when floppy module not installed.
> 
> It's a known problem.  Some broken BIOSes don't turn off the motor
> after probing for a disk.  One solution is to change the boot priority
> in the BIOS settings so the hard disk is tried before floppy.  If you
> ever need to boot from a floppy, you can change it back.
> 
The kernel stops the spinning floppy _if_ you gives it a driver
for the floppy hardware.

This is not a problem at all, considering that linux comes
with such a driver.

Compile it in, or arranger for the module to be loaded at
boot time.  You may of course arrange to unload it a little
later if you want to save the memory.

Helge Hafting 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-13 13:18   ` Helge Hafting
@ 2003-12-13 16:42     ` Joshua Schmidlkofer
  0 siblings, 0 replies; 20+ messages in thread
From: Joshua Schmidlkofer @ 2003-12-13 16:42 UTC (permalink / raw)
  To: Helge Hafting; +Cc: Måns Rullgård, Linux Kernel Mailing List

On Sat, 2003-12-13 at 05:18, Helge Hafting wrote:
> On Fri, Dec 12, 2003 at 03:18:03PM +0100, Måns Rullgård wrote:
> > Dale Mellor <dale@dmellor.dabsol.co.uk> writes:
> > 
> > > 1. Floppy motor spins when floppy module not installed.
> > 
> > It's a known problem.  Some broken BIOSes don't turn off the motor
> > after probing for a disk.  One solution is to change the boot priority
> > in the BIOS settings so the hard disk is tried before floppy.  If you
> > ever need to boot from a floppy, you can change it back.
> > 
> The kernel stops the spinning floppy _if_ you gives it a driver
> for the floppy hardware.
> 
> This is not a problem at all, considering that linux comes
> with such a driver.
> 
> Compile it in, or arranger for the module to be loaded at
> boot time.  You may of course arrange to unload it a little
> later if you want to save the memory.

This seems like the correct solution to me.

-- 
VB programmers ask why no one takes them seriously, 
it's somewhat akin to a McDonalds manager asking employees 
why they don't take their 'career' seriously.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-13  6:18         ` Joshua Schmidlkofer
@ 2003-12-15 14:37           ` Richard B. Johnson
  0 siblings, 0 replies; 20+ messages in thread
From: Richard B. Johnson @ 2003-12-15 14:37 UTC (permalink / raw)
  To: Joshua Schmidlkofer
  Cc: John Bradford, Måns Rullgård, Linux Kernel Mailing List

On Fri, 12 Dec 2003, Joshua Schmidlkofer wrote:

> > Yes, and I recall we agreed to disagree where the FDC stop must
> > be put, but we both agreed that it must be stopped. I still contend
> > that since the Linux startup code takes control away from the BIOS,
> > it's that codes responsibility to turn OFF things that the BIOS
> > might have left ON.
> >
> > Funny thing. It's so trivial, anybody/everybody could turn the
> > floppy motor off, but all the fingers point to somebody else's
> > code.
> >
> > It's a bug in Linux, not in a boot-loader. That bug was covered up
> > until the FDC code got modularized. Once we were able to compile
> > a kernel without the FDC, the bug was exposed. So, I suggest that
> > we just fix the bug and be done with it. It's not a performance
> > problem, the write to the port occurs exactly once during the nest
> > 999 days of up-time. It's just an attempt to make a mountain out
> > of a mole-hill.
>
>
> We have had (do have?) several cases of optional "this workaround", or
> "that workaround" as per-hardware config options.  If this is that
> objectionable for genral consumption then someone ought to submit a
> patch to do the dirty deed but put it in as a configurable workaround
> (CONFIG_TURNFLOPPYOFF=Y/N), and leave it at that. [For maximum
> perversity, it could also be a MODULE.] This does not affect everyone
> right?  I have never tried booting w/o the floppy module, so I really
> don't know about my system.
>

Well It's NOT a workaround. In the IBM/Intel/PC platform, the
floppy motor is turned OFF in a simple timer-queue that runs
off the PIT Channel 0. If some operating system decides to tear
down that queue, it MUST perform the function(s) that the
queue was performing or else it's a BUG, plain and simple.
This long-time BUG was hidden as long as the floppy-disk
code remained in the kernel. Now, since the floppy disk
code is no longer permanently coded into the kernel, the
BUG is exposed. Failure to fix this known BUG, in spite of
the patches sent, is an obvious example of child-like
misbehavior.

Again, the patch is provided:

--- linux-2.4.22/arch/i386/boot/setup.S.orig	Tue Oct  7 09:24:33 2003
+++ linux-2.4.22/arch/i386/boot/setup.S	Fri Dec 12 09:52:32 2003
@@ -777,6 +777,10 @@
 	movb	$0xFB, %al			# mask all irq's but irq2 which
 	outb	%al, $0x21			# is cascaded

+	movw	$0x3f2, %dx
+	xorb	%al, %al			# Turn OFF FDC motor
+	outb	%al, %dx
+
 # Well, that certainly wasn't fun :-(. Hopefully it works, and we don't
 # need no steenking BIOS anyway (except for the initial loading :-).
 # The BIOS-routine wants lots of unnecessary data, and it's less




Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-13 10:40         ` John Bradford
@ 2003-12-15 14:50           ` Richard B. Johnson
  2003-12-15 20:24             ` John Bradford
  0 siblings, 1 reply; 20+ messages in thread
From: Richard B. Johnson @ 2003-12-15 14:50 UTC (permalink / raw)
  To: John Bradford; +Cc: Måns Rullgård, linux-kernel

On Sat, 13 Dec 2003, John Bradford wrote:

> Quote from "Richard B. Johnson" <root@chaos.analogic.com>:
>
> > Yes, and I recall we agreed to disagree where the FDC stop must
> > be put, but we both agreed that it must be stopped. I still contend
> > that since the Linux startup code takes control away from the BIOS,
> > it's that codes responsibility to turn OFF things that the BIOS
> > might have left ON.
>
> Well, on a practical level, yes, I agree with you, it is the easiest
> way to solve the problem.
>
> On a technical level, I still think that the BIOS configuration is
> broken if it leaves the floppy motor on, on a system running a kernel
> without the floppy code compiled in.
>
> John.
>

Hmmm. The BIOS doesn't know that you have a kernel without any
floppy code. The BIOS also doesn't know that its timer queue
is going to be destroyed by the data (code) that it's properly
reading from some disk. All it knows is that every time the
floppy is accessed, the motor must be turn ON before access
and must be turned OFF two seconds after the last access. Since
it doesn't know when the last access will be (it doesn't know the
future), it resets a timer-variable upon every access. The timer-
queue bumps the variable and if it gets to zero, turns OFF the
FDC motor.

The BIOS code is properly doing its job. When control is
taken away from the BIOS, the code that took control must
tie up any loose-ends that the BIOS wasn't able to finish.

It's not the job of the boot-loader because it didn't alter
the BIOS in any way. It used the BIOS to put the kernel in
it's correct place. Then it gives control to the kernel
code. It's that kernel code that takes control away from
the BIOS. It's the responsibility of that kernel code
to handle the consequences of doing that.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: PROBLEM: floppy motor spins when floppy module not installed
  2003-12-15 14:50           ` Richard B. Johnson
@ 2003-12-15 20:24             ` John Bradford
  0 siblings, 0 replies; 20+ messages in thread
From: John Bradford @ 2003-12-15 20:24 UTC (permalink / raw)
  To: Richard B. Johnson; +Cc: Måns Rullgård, linux-kernel

> > > Yes, and I recall we agreed to disagree where the FDC stop must
> > > be put, but we both agreed that it must be stopped. I still contend
> > > that since the Linux startup code takes control away from the BIOS,
> > > it's that codes responsibility to turn OFF things that the BIOS
> > > might have left ON.
> >
> > Well, on a practical level, yes, I agree with you, it is the easiest
> > way to solve the problem.
> >
> > On a technical level, I still think that the BIOS configuration is
> > broken if it leaves the floppy motor on, on a system running a kernel
> > without the floppy code compiled in.
> 
> Hmmm. The BIOS doesn't know that you have a kernel without any
> floppy code.

No, but the user does, and if the machine in question boots fast
enough that interrupts are disabled less than two seconds after the
last BIOS floppy access, they should currently avoid configuring the
BIOS in such a way that it accesses floppy drive if there is not going
to be any code to turn it off, which currently means having floppy
support compiled in, (or as a module).

> The BIOS also doesn't know that its timer queue
> is going to be destroyed by the data (code) that it's properly
> reading from some disk. All it knows is that every time the
> floppy is accessed, the motor must be turn ON before access
> and must be turned OFF two seconds after the last access. Since
> it doesn't know when the last access will be (it doesn't know the
> future), it resets a timer-variable upon every access. The timer-
> queue bumps the variable and if it gets to zero, turns OFF the
> FDC motor.
> 
> The BIOS code is properly doing its job. When control is
> taken away from the BIOS, the code that took control

The code that took control is the bootloader, which may never load a
Linux kernel.  Imagine a theoretical future bootloader which disabled
interrupts, thereby stopping the two second floppy motor timeout, and
offered things such as a serial console, monitor, or other diagnostic
features.

> must
> tie up any loose-ends that the BIOS wasn't able to finish.

Possibly, but I still consider the BIOS configuration broken if there
are infact any loose-ends to tie up.

> It's not the job of the boot-loader because it didn't alter
> the BIOS in any way. It used the BIOS to put the kernel in
> it's correct place. Then it gives control to the kernel
> code. It's that kernel code that takes control away from
> the BIOS. It's the responsibility of that kernel code
> to handle the consequences of doing that.

At the end of the day, though, I agree that it's the best way to fix
it, but we shouldn't convince ourselves that it's particularly
elegant.

John.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2003-12-15 20:19 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-12 13:57 PROBLEM: floppy motor spins when floppy module not installed Dale Mellor
2003-12-12 14:18 ` Måns Rullgård
2003-12-12 15:04   ` Richard B. Johnson
2003-12-12 15:11     ` Måns Rullgård
2003-12-12 15:20       ` Richard B. Johnson
2003-12-12 15:33         ` Måns Rullgård
2003-12-12 16:05           ` Petr Vandrovec
2003-12-12 16:27             ` Måns Rullgård
2003-12-12 16:41               ` Petr Vandrovec
2003-12-12 16:00       ` Matthew Kirkwood
2003-12-12 19:28     ` John Bradford
2003-12-12 19:47       ` Richard B. Johnson
2003-12-13  6:18         ` Joshua Schmidlkofer
2003-12-15 14:37           ` Richard B. Johnson
2003-12-13 10:40         ` John Bradford
2003-12-15 14:50           ` Richard B. Johnson
2003-12-15 20:24             ` John Bradford
2003-12-13 13:18   ` Helge Hafting
2003-12-13 16:42     ` Joshua Schmidlkofer
2003-12-12 14:59 ` Richard B. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).