Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jan 2009 23:10:06 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/dev/ppbus if_plip.c immio.c lpbb.c lpt.c pcfclock.c ppb_1284.c ppb_base.c ppb_msq.c ppbconf.c ppbconf.h ppi.c pps.c vpo.c vpoio.c src/sys/dev/ppc ppc.c ppc_acpi.c ppc_isa.c ppc_pci.c ppc_puc.c ppcreg.h ppcvar.h
Message-ID:  <200901212311.n0LNBjPI089245@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
jhb         2009-01-21 23:10:06 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/ppbus        if_plip.c immio.c lpbb.c lpt.c pcfclock.c 
                         ppb_1284.c ppb_base.c ppb_msq.c ppbconf.c 
                         ppbconf.h ppi.c pps.c vpo.c vpoio.c 
    sys/dev/ppc          ppc.c ppc_acpi.c ppc_isa.c ppc_pci.c 
                         ppc_puc.c ppcreg.h ppcvar.h 
  Log:
  SVN rev 187576 on 2009-01-21 23:10:06Z by jhb
  
  Add locking to ppc and ppbus and mark the whole lot MPSAFE:
  - To avoid having a bunch of locks that end up always getting acquired as
    a group, give each ppc(4) device a mutex which it shares with all the
    child devices including ppbus(4), lpt(4), plip(4), etc.  This mutex
    is then used for all the locking.
  - Rework the interrupt handling stuff yet again.  Now ppbus drivers setup
    their interrupt handler during attach and tear it down during detach
    like most other drivers.  ppbus(4) only invokes the interrupt handler
    of the device that currently owns the bus (if any) when an interrupt
    occurs, however.  Also, interrupt handlers in general now accept their
    softc pointers as their argument rather than the device_t.  Another
    feature of the ppbus interrupt handlers is that they are called with
    the parent ppc device's lock already held.  This minimizes the number
    of lock operations during an interrupt.
  - Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE.
  - lpbb(4) uses the ppc lock instead of Giant.
  - Other plip(4) changes:
    - Add a mutex to protect the global tables in plip(4) and free them on
      module unload.
    - Add a detach routine.
    - Split out the init/stop code from the ioctl routine into separate
      functions.
  - Other lpt(4) changes:
    - Use device_printf().
    - Use a dedicated callout for the lptout timer.
    - Allocate the I/O buffers at attach and detach rather than during
      open and close as this simplifies the locking at the cost of
      1024+32 bytes when the driver is attached.
  - Other ppi(4) changes:
    - Use an sx lock to serialize open and close.
    - Remove unused HADBUS flag.
    - Add a detach routine.
    - Use a malloc'd buffer for each read and write to avoid races with
      concurrent read/write.
  - Other pps(4) changes:
    - Use a callout rather than a callout handle with timeout().
    - Conform to the new ppbus requirements (regular mutex, non-filter
      interrupt handler).  pps(4) is probably going to have to become a
      standalone driver that doesn't use ppbus(4) to satisfy it's
      requirements for low latency as a result.
    - Use an sx lock to serialize open and close.
  - Other vpo(4) changes:
    - Use the parent ppc device's lock to create the CAM sim instead of
      Giant.
  - Other ppc(4) changes:
    - Fix ppc_isa's detach method to detach instead of calling attach.
  
  Tested by:        no one :-(
  
  Revision  Changes    Path
  1.50      +168 -85   src/sys/dev/ppbus/if_plip.c
  1.21      +2 -0      src/sys/dev/ppbus/immio.c
  1.23      +36 -23    src/sys/dev/ppbus/lpbb.c
  1.46      +157 -130  src/sys/dev/ppbus/lpt.c
  1.24      +13 -13    src/sys/dev/ppbus/pcfclock.c
  1.16      +6 -1      src/sys/dev/ppbus/ppb_1284.c
  1.17      +79 -16    src/sys/dev/ppbus/ppb_base.c
  1.17      +7 -0      src/sys/dev/ppbus/ppb_msq.c
  1.32      +76 -44    src/sys/dev/ppbus/ppbconf.c
  1.24      +24 -10    src/sys/dev/ppbus/ppbconf.h
  1.47      +105 -49   src/sys/dev/ppbus/ppi.c
  1.56      +56 -33    src/sys/dev/ppbus/pps.c
  1.39      +17 -13    src/sys/dev/ppbus/vpo.c
  1.22      +2 -0      src/sys/dev/ppbus/vpoio.c
  1.63      +58 -64    src/sys/dev/ppc/ppc.c
  1.5       +1 -2      src/sys/dev/ppc/ppc_acpi.c
  1.5       +9 -5      src/sys/dev/ppc/ppc_isa.c
  1.3       +1 -2      src/sys/dev/ppc/ppc_pci.c
  1.7       +1 -2      src/sys/dev/ppc/ppc_puc.c
  1.20      +11 -2     src/sys/dev/ppc/ppcreg.h
  1.7       +1 -3      src/sys/dev/ppc/ppcvar.h



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