Bug 113851

Summary: floppy0: unexpected interrupt writing to floppy drive
Product: IO/Storage Reporter: Jacob Thompson (jakethompson1)
Component: OtherAssignee: io_other
Status: NEW ---    
Severity: normal CC: szg00000
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 4.4.4 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg

Description Jacob Thompson 2016-03-07 02:51:56 UTC
Created attachment 207891 [details]
dmesg

Overview
========

When writing to a PC-style floppy drive (/dev/fd0), the following kernel messages appear and all future access to the drive fails until reboot:

     floppy0: disk removed during i/o
     floppy0: unexpected interrupt repl[0]=4 repl[1]=0 repl[2]=0 repl[3]=1 repl[4]=1 repl[5]=1 repl[6]=2

Reading, on contrast, does seem to work but is glitchy.  For example, the disk activity LED remains on long after the read is complete.

Steps to Reproduce
==================

Copy a disk image directly to the /dev/fd0 device.  Formatting a floppy with fdformat or mounting and writing to it do not work either, but a write directly to the device is the simplest case.

Moving a PS/2 mouse during the write seems to cause it to fail faster, and in fact, sometimes the kernel will generate i8042 parity errors and the like, although it is not consistently reproducible.  I even tried unplugging the mouse and the failure still occurs.

I have tried various combinations of the following boot options to no avail: acpi=noirq nosmp noapic nolapic acpi_irq_nobalance acpi_irq_isa=1,6,8,12 irqpoll pnpacpi=off i8042.noaux i8042.nopnp floppy=0,daring floppy=nodma floppy=nofifo floppy=broken_dcl


Build Date & Hardware
=====================

Sun Mar 6 19:27:35 EST 2016
ASRock 980DE3/U3S3
Note:  The drive does not work in older kernels either, at least those included with Debian 8.x, although I have not checked any kernels older than that.

Additional Builds & Platforms
=============================

Formatting and writing to the drive works fine when booted from the Windows 10 install DVD into a command prompt, so it does not seem to be a hardware problem.
Comment 1 Jacob Thompson 2016-03-22 04:43:18 UTC
I did some more extensive testing with the floppy=nodma option being passed to the floppy module.  It seems to cut back on the number of "unexpected interrupt" messages, but they do still occur.

I found this issue that affects the same chipset and involves floppy DMA corruption.  I wonder if it is related.  http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=73472a46b5b28116b145fb5fc05242c1aa8e1461

Here is a sample of dmesg with floppy=nodma:

[   67.279796] floppy0: unexpected interrupt 
[   67.279876] floppy0: sensei repl[0]=80 
[   67.279909] floppy0: -- FDC reply error
[   73.904408] floppy0: unexpected interrupt 
[   73.904533] floppy0: sensei repl[0]=80 
[   75.790445] floppy0: unexpected interrupt 
[   75.790542] floppy0: sensei repl[0]=80 
[  132.701252] floppy0: unexpected interrupt 
[  132.701350] floppy0: sensei repl[0]=80 
[  149.915949] floppy0: Unable to send byte 8 to FDC. Fdc=0 Status=d0

[  149.915958] floppy driver state
[  149.915960] -------------------
[  149.915971] now=4294929745 last interrupt=4294929745 diff=0 last called handler=main_command_interrupt [floppy]
[  149.915974] timeout_message=floppy start
[  149.915976] last output bytes:
[  149.915979]  9 90 4294929572
[  149.915981]  0 90 4294929572
[  149.915984]  d 90 4294929572
[  149.915986]  2 90 4294929572
[  149.915989] 12 90 4294929572
[  149.915991] 1b 90 4294929572
[  149.915993] ff 90 4294929572
[  149.915995]  f 80 4294929695
[  149.915997]  0 90 4294929695
[  149.915999]  a 91 4294929695
[  149.916001]  8 81 4294929696
[  149.916003] e6 80 4294929696
[  149.916005]  0 90 4294929696
[  149.916007]  a 90 4294929696
[  149.916009]  0 90 4294929696
[  149.916011] 11 90 4294929696
[  149.916013]  2 90 4294929696
[  149.916015] 12 90 4294929696
[  149.916017] 1b 90 4294929696
[  149.916019] ff 90 4294929696
[  149.916021] last result at 4294929745
[  149.916024] last redo_fd_request at 4294929695
[  149.916035] status=d0
[  149.916037] fdc_busy=1
[  149.916040] delayed work.function=ffffffffa02092b0 expires=1
[  149.916043] timer_function=ffffffffa020eb50 expires=701
[  149.916045] cont=ffffffffa0211420
[  149.916047] current_req=ffff880807e4d180
[  149.916049] command_status=-1

[  149.916054] floppy0: get result error. Fdc=0 Last status=ffffffff Read bytes=0

[  149.916058] floppy driver state
[  149.916059] -------------------
[  149.916065] now=4294929745 last interrupt=4294929745 diff=0 last called handler=main_command_interrupt [floppy]
[  149.916067] timeout_message=floppy start
[  149.916069] last output bytes:
[  149.916071]  9 90 4294929572
[  149.916073]  0 90 4294929572
[  149.916076]  d 90 4294929572
[  149.916078]  2 90 4294929572
[  149.916080] 12 90 4294929572
[  149.916082] 1b 90 4294929572
[  149.916084] ff 90 4294929572
[  149.916086]  f 80 4294929695
[  149.916088]  0 90 4294929695
[  149.916090]  a 91 4294929695
[  149.916092]  8 81 4294929696
[  149.916094] e6 80 4294929696
[  149.916096]  0 90 4294929696
[  149.916098]  a 90 4294929696
[  149.916100]  0 90 4294929696
[  149.916102] 11 90 4294929696
[  149.916104]  2 90 4294929696
[  149.916106] 12 90 4294929696
[  149.916108] 1b 90 4294929696
[  149.916110] ff 90 4294929696
[  149.916112] last result at 4294929745
[  149.916114] last redo_fd_request at 4294929695
[  149.916125] status=d0
[  149.916127] fdc_busy=1
[  149.916130] delayed work.function=ffffffffa02092b0 expires=1
[  149.916132] timer_function=ffffffffa020eb50 expires=701
[  149.916134] cont=ffffffffa0211420
[  149.916136] current_req=ffff880807e4d180
[  149.916138] command_status=-1

[  149.916319] floppy0: unexpected interrupt repl[0]=44 repl[1]=10 repl[2]=0 repl[3]=a repl[4]=1 repl[5]=9 repl[6]=2 
[  151.910432] floppy0: unexpected interrupt 
[  151.910555] floppy0: sensei repl[0]=80 
[  151.910564] floppy0: -- FDC reply error