Re: Deprecating / Removing floppy drive support

From: Warner Losh <imp_at_bsdimp.com>
Date: Mon, 4 Dec 2017 13:54:00 -0700
On Mon, Dec 4, 2017 at 1:23 PM, Cy Schubert <Cy.Schubert_at_komquats.com>
wrote:

> In message <CANCZdfqzHLme1AMUO0Z_+z951hSfi0PV_CWgPdxThi92iLZa7A_at_
> mail.gmail.c
> om>
> , Warner Losh writes:
> > --089e0825fdccb5682d055f87a50b
> > Content-Type: text/plain; charset="UTF-8"
> >
> > On Mon, Dec 4, 2017 at 11:07 AM, Cy Schubert <Cy.Schubert_at_komquats.com>
> > wrote:
> >
> > > My test showed that MP i386 works as well. Amd64 is broken.
> >
> >
> > What's the pathology on amd64?
>
> Not really much except for I/O error.
>
> g_vfs_done():fd0[READ(offset=184320, length=512)]error = 5
>
> I can dig into it unless someone else beats me to it.
>

OK. EIO is 5. The only EIO I see in the driver is where we've had too many
retries.

Set debug.fdc=-1 and see what you get for the error.

If isa_dma_init can't get lomem, it returns 0 which will cause the driver
to not attach, which isn't what we're seeing.

However, if configmalloc() bogusly returns an address too large, we don't
check for that in isa_dma.c. I don't think that's the bug, since I'd expect
different pathology.

diff --git a/sys/x86/isa/isa_dma.c b/sys/x86/isa/isa_dma.c
index 58601f85ae2..5c314863718 100644
--- a/sys/x86/isa/isa_dma.c
+++ b/sys/x86/isa/isa_dma.c
_at__at_ -107,6 +107,12 _at__at_ isa_dma_init(int chan, u_int bouncebufsize, int flag)
        if (buf == NULL) {
                buf = contigmalloc(bouncebufsize, M_DEVBUF, flag, 0ul,
0xfffffful,
                           1ul, chan & 4 ? 0x20000ul : 0x10000ul);
+               if (buf != NULL &&
+                   isa_dmarangecheck(buf, bouncebufsize, chan) != 0) {
+                       printf("isa_dma_init: %p failed range check\n",
buf);
+                       contigfree(buf, bouncebufsize, M_DEVBUF);
+                       buf = NULL;
+               }
                contig = 1;
        }

But EIO suggests we're timing out or getting repeated errors on the
command, and debug.fdc will get to the bottom of that. Might be nice to
have isa_dma_init print out the buffer it gets always, just to rule out
badness. I don't know if I have a box that can run amd64, but has a floppy
anymore... I'll have to check my boneyard.

Anyway, good luck.

Warner
Received on Mon Dec 04 2017 - 20:54:03 UTC