Home | History | Annotate | Download | only in pci
History log of /src/sys/arch/x86/pci/pcib.c
RevisionDateAuthorComments
 1.21  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.20  24-Apr-2021  thorpej branches: 1.20.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.19  04-Oct-2019  mrg branches: 1.19.10;
add missing break.

surely it is not intended to treat viatech devices with
non VT82C686A's device id as maybe cyrix pci bridges.
 1.18  17-Jun-2019  msaitoh KNF. No functional change.
 1.17  11-Feb-2019  cherry We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.
 1.16  04-Mar-2018  jdolecek branches: 1.16.4;
according to VT82C686A chip specs, the VIA Technologies device 0x3057
is more a Power Management controller, rename the pcidevs entry and device
macro

PR kern/31963 by Nicolas Joly
 1.15  06-Apr-2012  plunky device_pmf_is_registered() is not required
 1.14  30-Jan-2012  drochner Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.
 1.13  01-Jul-2011  dyoung branches: 1.13.2; 1.13.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.12  28-Apr-2010  dyoung On x86, change the bus_space_tag_t to a pointer to a struct
bus_space_tag. For now, bus_space_tag's only member is
bst_type, the type of space, which is either X86_BUS_SPACE_IO
or X86_BUS_SPACE_MEM. In the future, new bus_space_tag members
will refer to override-functions installed by a new function,
bus_space_tag_create(9).

Add pointers to constant struct bus_space_tag, x86_bus_space_io and
x86_bus_space_mem. Use them to replace most uses of X86_BUS_SPACE_IO
and X86_BUS_SPACE_MEM.

Add an x86-specific bus_space_is_equal(9) implementation that compares
the two tags' bst_type.
 1.11  08-Jan-2010  dyoung branches: 1.11.2; 1.11.4;
Move all copies of ifattr_match() to sys/kern/subr_autoconf.c.
 1.10  23-Aug-2009  jmcneill Save a line of dmesg by printing the vendor/product info on the same line
as the locators.
 1.9  18-Aug-2009  dyoung Allow detachment and re-attachment of an ISA bus at an PCI-ISA bus
bridge, isa0 at pcib0.
 1.8  02-Apr-2009  dyoung During shutdown, detach devices in an orderly fashion.

Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks. For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown. Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags. Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag. The default for kern.detachall is 0. SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress. In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs. Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
 1.7  04-Aug-2008  cegger branches: 1.7.2; 1.7.8;
struct cfdata -> cfdata_t
 1.6  03-Aug-2008  joerg Move some MD declarations from x86/pci/files.pci to x86/conf/files.x86,
so that Xen can use the former.

Drop Xen's pcib.c in favor of the x86 code and thereby unbreak ichlpcib.
 1.5  20-Jul-2008  martin Make the softc externally visible, so other bridges reusing this code
don't have to "get it right" manually.
 1.4  28-Apr-2008  martin branches: 1.4.2; 1.4.4; 1.4.6;
Remove clause 3 and 4 from TNF licenses
 1.3  22-Feb-2008  dyoung branches: 1.3.2; 1.3.4;
Add methods to detach self and children.

Use device_t and accessors. Use aprint_*_dev().
 1.2  09-Dec-2007  jmcneill branches: 1.2.6; 1.2.10;
Merge jmcneill-pm branch.
 1.1  26-Oct-2007  xtraeme branches: 1.1.2; 1.1.4; 1.1.8; 1.1.10; 1.1.12; 1.1.14; 1.1.16;
Share pcib(4) and amdpcib(4) between i386 and amd64; one copy is enough.
 1.1.16.1  11-Dec-2007  yamt sync with head.
 1.1.14.1  26-Dec-2007  ad Sync with head.
 1.1.12.2  03-Dec-2007  ad Sync with HEAD.
 1.1.12.1  26-Oct-2007  ad file pcib.c was added on branch vmlocking on 2007-12-03 19:04:29 +0000
 1.1.10.2  13-Nov-2007  bouyer Sync with HEAD
 1.1.10.1  26-Oct-2007  bouyer file pcib.c was added on branch bouyer-xenamd64 on 2007-11-13 16:00:20 +0000
 1.1.8.4  23-Mar-2008  matt sync with HEAD
 1.1.8.3  09-Jan-2008  matt sync with HEAD
 1.1.8.2  06-Nov-2007  matt sync with HEAD
 1.1.8.1  26-Oct-2007  matt file pcib.c was added on branch matt-armv6 on 2007-11-06 23:23:44 +0000
 1.1.4.5  08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.1.4.4  12-Nov-2007  joerg CG unused softc fields.
 1.1.4.3  06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.1.4.2  28-Oct-2007  joerg Sync with HEAD.
 1.1.4.1  26-Oct-2007  joerg file pcib.c was added on branch jmcneill-pm on 2007-10-28 20:11:00 +0000
 1.1.2.4  27-Feb-2008  yamt sync with head.
 1.1.2.3  21-Jan-2008  yamt sync with head
 1.1.2.2  27-Oct-2007  yamt sync with head.
 1.1.2.1  26-Oct-2007  yamt file pcib.c was added on branch yamt-lazymbuf on 2007-10-27 11:28:58 +0000
 1.2.10.3  28-Sep-2008  mjf Sync with HEAD.
 1.2.10.2  02-Jun-2008  mjf Sync with HEAD.
 1.2.10.1  03-Apr-2008  mjf Sync with HEAD.
 1.2.6.1  24-Mar-2008  keiichi sync with head.
 1.3.4.6  11-Aug-2010  yamt sync with head.
 1.3.4.5  11-Mar-2010  yamt sync with head
 1.3.4.4  16-Sep-2009  yamt sync with head
 1.3.4.3  19-Aug-2009  yamt sync with head.
 1.3.4.2  04-May-2009  yamt sync with head.
 1.3.4.1  16-May-2008  yamt sync with head.
 1.3.2.1  18-May-2008  yamt sync with head.
 1.4.6.1  19-Oct-2008  haad Sync with HEAD.
 1.4.4.1  28-Jul-2008  simonb Sync with head.
 1.4.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.7.8.4  27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.7.8.3  24-Oct-2010  jym Sync with HEAD
 1.7.8.2  01-Nov-2009  jym Sync with HEAD.
 1.7.8.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.2.1  28-Apr-2009  skrll Sync with HEAD.
 1.11.4.1  30-May-2010  rmind sync with head
 1.11.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.13.6.2  29-Apr-2012  mrg sync to latest -current.
 1.13.6.1  18-Feb-2012  mrg merge to -current.
 1.13.2.1  17-Apr-2012  yamt sync with head
 1.16.4.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16.4.1  10-Jun-2019  christos Sync with HEAD
 1.19.10.1  24-Mar-2021  thorpej Don't filter interface attributes in rescan functions for devices that
carry only a single interface attribute. The autoconfiguration machinery
already considers interface attributes when searching for possible parents.
 1.20.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed