cvs commit: src/sys/sys fdcio.h src/usr.sbin/fdcontrol fdcontrol.c src/usr.sbin/fdformat fdformat.c src/usr.sbin/fdread fdutil.c src/sys/dev/fdc fdc.c fdc_acpi.c fdc_isa.c fdc_pccard.c fdcvar.h

Poul-Henning Kamp phk at FreeBSD.org
Fri Aug 20 08:14:26 PDT 2004


phk         2004-08-20 15:14:25 UTC

  FreeBSD src repository

  Modified files:
    sys/sys              fdcio.h 
    usr.sbin/fdcontrol   fdcontrol.c 
    usr.sbin/fdformat    fdformat.c 
    usr.sbin/fdread      fdutil.c 
    sys/dev/fdc          fdc.c fdc_acpi.c fdc_isa.c fdc_pccard.c 
                         fdcvar.h 
  Log:
  Rewrite of the floppy driver to make it MPsafe & GEOM friendly:
  
          Centralize the fdctl_wr() function by adding the offset in
          the resource to the softc structure.
  
          Bugfix: Read the drive-change signal from the correct place:
          same place as the ctl register.
  
          Remove the cdevsw{} related code and implement a GEOM class.
  
          Ditch the state-engine and park a thread on each controller
          to service the queue.
  
          Make the interrupt FAST & MPSAFE since it is just a simple
          wakeup(9) call.
  
          Rely on a per controller mutex to protect the bioqueues.
          Grab GEOMs topology lock when we have to and Giant when
          ISADMA needs it.  Since all access to the hardware is
          isolated in the per controller thread, the rest of the
          driver is lock & Giant free.
  
          Create a per-drive queue where requests are parked while
          the motor spins up.  When the motor is running the requests
          are purged to the per controller queue.  This allows
          requests to other drives to be serviced during spin-up.
  
          Only setup the motor-off timeout when we finish the last
          request on the queue and cancel it when a new request
          arrives.  This fixes the bug in the old code where the motor
          turned off while we were still retrying a request.
  
          Make the "drive-change" work reliably.  Probe the drive on
          first opens.  Probe with a recal and a seek to cyl=1 to
          reset the drive change line and check again to see if we
          have a media.
  
          When we see the media disappear we destroy the geom provider,
          create a new one, and flag that autodetection should happen
          next time we see a media (unless a specific format is configured).
  
          Add sysctl tunables for a lot of drive related parameters.
          If you spend a lot of time waiting for floppies you can
          grab the i82078 pdf from Intels web-page and try tuning
          these.
  
          Add sysctl debug.fdc.debugflags which will enable various
          kinds of debugging printfs.
  
          Add central definitions of our well known floppy formats.
  
          Simplify datastructures for autoselection of format and
          call the code at the right times.
  
          Bugfix: Remove at least one piece of code which would have
          made 2.88M floppies not work.
  
          Use implied seeks on enhanced controllers.
  
          Use multisector transfers on all controllers.  Increase
          ISADMA bounce buffers accordingly.
  
          Fall back to single sector when retrying.  Reset retry count
          on every successful transaction.
  
          Sort functions in a more sensible order and generally tidy
          up a fair bit here and there.
  
          Assorted related fixes and adjustments in userland utilities.
  
  WORKAROUNDS:
          Do allow r/w opens of r/o media but refuse actual write
          operations.  This is necessary until the p4::phk_bufwork
          branch gets integrated (This problem relates to remounting
          not reopening devices, see sys/*/*/${fs}_vfsops.c for details).
  
          Keep PC98's private copy of the old floppy driver compiling
          and presumably working (see below).
  
  TODO (planned)
  
          Move probing of drives until after interrupts/timeouts work
          (like for ATA/SCSI drives).
  
  TODO (unplanned)
  
          This driver should be made to work on PC98 as well.
  
          Test on YE-DATA PCMCIA floppy drive.
  
          Fix 2.88M media.
  
  This is a MT5 candidate (depends on the bioq_takefirst() addition).
  
  Revision  Changes      Path
  1.284     +1460 -1846  src/sys/dev/fdc/fdc.c
  1.3       +1 -30       src/sys/dev/fdc/fdc_acpi.c
  1.10      +12 -61      src/sys/dev/fdc/fdc_isa.c
  1.9       +7 -16       src/sys/dev/fdc/fdc_pccard.c
  1.4       +8 -61       src/sys/dev/fdc/fdcvar.h
  1.18      +61 -33      src/sys/sys/fdcio.h
  1.12      +15 -18      src/usr.sbin/fdcontrol/fdcontrol.c
  1.22      +2 -7        src/usr.sbin/fdformat/fdformat.c
  1.6       +49 -90      src/usr.sbin/fdread/fdutil.c


More information about the cvs-src mailing list