Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Mar 2000 10:27:02 -0800 (PST)
From:      Joerg Wunsch <joerg@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/isa fd.c fdc.h
Message-ID:  <200003181827.KAA70328@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
joerg       2000/03/18 10:27:02 PST

  Modified files:
    sys/isa              fd.c fdc.h 
  Log:
  Make the Y-E Data PCMCIA floppy of the Toshiba Libretto work under
  -current.  It doesn't work yet as stable as the 3.x/PAO version of the
  driver does, however, i get occasional `FDC direction bit not set' and
  other weird messages, but it basically works at least.
  
  The old (defunct) #ifdef FDC_YE stuff has been eliminated completely
  now, PCMCIA-FDC specific functions have been implemented differently
  where needed.
  
  Unfortunately, due to the fact that the traditional PeeCee FDC with
  its funny non-contiguous register space (one register for WD1003
  harddisk controllers is interleaved into the FDC register set), and
  Peter's subsequent changes involving two different bus space handles
  for normal FDCs, the changes required for the Y-E stuff are more
  complex than i'd love them to be.  I've done my best to keep the logic
  for normal FDCs intact.
  
  Since the Y-E FDC seems to lose interrupts after a FDC reset
  sometimes, i've also replaced the timeout logic in fd_turnoff() to
  generate an artificial pseudo interrupt in case of a timeout while the
  drive has still outstanding transfers waiting.  This avoids the total
  starvation of the driver that could be observed with highly damaged
  media under 3.x/PAO.  This part of the patch has been revied by bde
  previously.
  
  I've fixed a number of occasions where previous commits have been
  missing the encapuslation of ISA DMA related functions inside
  FDC_NODMA checks.
  
  I've added one call to SET_BCDR() during preparation of the format
  floppy operation.  Floppy formatting has been totally broken before in
  3.x/PAO (garbage ID fields have been written to the medium, causing
  `wrong cylinder' errors upon media reading).  This is just black
  magic, i don't have the slightes idea _why_ this needs to be but just
  copied over the hack that has been used by the PAO folks in the normal
  read/write case anyway.
  
  The entired device_busy() stuff seems to be pointless to me.  In any
  case, i had to add device_unbusy() calls symmetrical to the
  device_busy() calls, otherwise the PCMCIA floppy driver could never be
  deactivated.  (As it used to be, it caused a `mark the device busier
  and busier' situation.)  IMHO, all block device drivers should be
  marked busy based on active buffers still waiting for the driver, so
  the device_unbusy() calls should probably go to biodone().  Only one
  other driver (whose name escapes me at the moment) uses device_busy()
  calls at all, so i question the value of all this...
  
  I think this entire `device busy' logic simply doesn't fit for PCMCIA
  &al.  It cannot be the decision of some piece of kernel software to
  declare a device `busy by now, you can't remove it', when the actual
  physical power of removing it is the user pulling the card.  The
  kernel simply has to cope with the removal, however busy the device
  might have been by the time of the removal, period.  Perhaps a force
  flag needs to be added?
  
  Upon inserting the card a second time, i get:
  
  WARNING: "fd" is usurping "fd"'s cdevsw[]
  WARNING: "fd" is usurping "fd"'s bmaj
  
  I suspect this is related to the XXX comment at the call to
  cdevsw_add().  Does anybody know what the correct way is to cleanup
  this?
  
  Revision  Changes    Path
  1.177     +244 -245  src/sys/isa/fd.c
  1.21      +4 -2      src/sys/isa/fdc.h



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003181827.KAA70328>