Deprecating / Removing floppy drive support

Warner Losh imp at bsdimp.com
Mon Dec 4 20:54:03 UTC 2017


On Mon, Dec 4, 2017 at 1:23 PM, Cy Schubert <Cy.Schubert at komquats.com>
wrote:

> In message <CANCZdfqzHLme1AMUO0Z_+z951hSfi0PV_CWgPdxThi92iLZa7A@
> 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
@@ -107,6 +107,12 @@ 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


More information about the freebsd-arch mailing list