Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Mar 2009 13:20:23 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/kern subr_bus.c
Message-ID:  <200903091320.n29DKYwb079391@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
imp         2009-03-09 13:20:23 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             subr_bus.c 
  Log:
  SVN rev 189574 on 2009-03-09 13:20:23Z by imp
  
  Fix a long-standing bug in newbus.  It was introduced when subclassing
  was introduced.  If you have a bus, say cardbus, that is derived from
  a base-bus (say PCI), then ordinarily all PCI drivers would attach to
  cardbus devices.  However, there had been one exception: kldload
  wouldn't work.
  
  The problem is in devclass_add_driver.  In this routine, all we did
  was call to the pci device's BUS_DRIVER_ADDED routine.  However, since
  cardbus bus instances had a different devclass, none of them were
  called.
  
  The solution is to call all subclass devclasses, recursively down the
  tree, of the class that was loaded.  Since we don't have a 'children
  class' pointer, we search the whole list of devclasses for a class
  whose parent matches.  Since just done a kldload time, this isn't as
  bad as it sounds.  In addition, we short-circuit the whole process by
  marking those classes with subclasses with a flag.  We'll likely have
  to reevaluate this method the number of devclasses with subclasses
  gets large.
  
  This means we can remove the "cardbus" lines from all the PCI drivers
  since we have no cardbus specific attach device attachments in the
  tree.
  
  # Also: minor tweak to an error message
  
  Revision  Changes    Path
  1.216     +53 -9     src/sys/kern/subr_bus.c



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