John Baldwin 1ffd07bde6 Various fixes for PCI _OSC handling so HotPlug works again.
- Rename the default implementation of 'pcib_request_feature' and add
  a pcib_request_feature() wrapper function (as is often done for
  new-bus APIs implemented via kobj) that accepts a single function.
  Previously the call to pcib_request_feature() ended up invoking the
  method on the great-great-grandparent of the bridge device instead
  of the grandparent.  For a bridge that was a direct child of pci0 on
  x86 this resulted in the method skipping over the Host-PCI bridge
  driver and being invoked against nexus0
- When invoking _OSC from a Host-PCI bridge driver, invoke
  device_get_softc() against the Host-PCI bridge device instead of the
  child bridge that is requesting HotPlug.  Using the wrong softc data
  resulted in garbage being passed for the ACPI handle causing the
  _OSC call to fail.
- While here, perform some other cleanups to _OSC handling in the ACPI
  Host-PCI bridge driver:
  - Don't invoke _OSC when requesting a control that has already been
    granted by the firmware.
  - Don't set the first word of the capability array before invoking
    _OSC.  This word is always set explicitly by acpi_EvaluateOSC()
    since it is UUID-independent.
  - Don't modify the set of granted controls unless _OSC doesn't exist
    (which is treated as always successful), or the _OSC method
    doesn't fail.
  - Don't require an _OSC status of 0 for success.  _OSC always
    returns the updated control mask even if it returns a non-zero
    status in the first word.
  - Whine if _OSC ever tries to revoke a previously-granted control.
    (It is not supposed to do that.)
- While here, add constants for the _OSC status word in acpivar.h
  (though currently unused).

Reported by:	adrian
Reviewed by:	imp
MFC after:	1 week
Tested on:	Lenovo x220
Differential Revision:	https://reviews.freebsd.org/D10520
2017-04-27 16:32:42 +00:00
..
2017-04-14 02:24:02 +00:00
2017-04-14 08:27:42 +00:00
2017-01-28 02:22:15 +00:00
2017-01-16 03:03:47 +00:00
2016-05-03 03:41:25 +00:00
2016-08-09 19:32:06 +00:00
2016-10-25 16:28:30 +00:00
2017-02-23 16:18:57 +00:00
2017-04-07 16:15:50 +00:00
2017-04-06 17:08:59 +00:00
2016-05-03 03:41:25 +00:00
2017-02-23 15:30:21 +00:00
2016-05-03 03:41:25 +00:00
2016-05-03 03:41:25 +00:00
2017-03-14 20:57:54 +00:00
2017-04-27 16:14:32 +00:00
2016-11-17 14:43:13 +00:00
2016-05-03 03:41:25 +00:00
2017-01-28 02:22:15 +00:00
2017-02-28 23:42:47 +00:00
2016-07-21 15:48:41 +00:00
2017-04-14 02:33:26 +00:00
2017-02-06 11:37:20 +00:00
2016-05-03 03:41:25 +00:00
2017-02-28 23:42:47 +00:00
2017-03-01 05:18:43 +00:00
2016-05-03 03:41:25 +00:00
2016-05-03 03:41:25 +00:00
2017-03-27 07:02:27 +00:00
2017-02-10 01:04:11 +00:00
2017-04-14 08:11:50 +00:00
2017-01-28 02:22:15 +00:00
2016-05-03 03:41:25 +00:00
2017-02-28 23:42:47 +00:00
2016-05-03 03:41:25 +00:00
2016-05-03 03:41:25 +00:00
2017-01-23 21:09:27 +00:00
2017-01-28 02:22:15 +00:00
2017-04-14 07:27:23 +00:00
2016-05-03 03:41:25 +00:00
2017-02-28 23:42:47 +00:00
2016-05-03 03:41:25 +00:00
2016-09-22 22:51:11 +00:00
2017-01-28 02:22:15 +00:00
2016-05-03 03:41:25 +00:00
2016-10-17 10:20:38 +00:00
2016-05-03 03:41:25 +00:00
2017-04-20 03:41:42 +00:00
2016-05-03 03:41:25 +00:00
2017-02-23 18:15:04 +00:00
2016-05-03 03:41:25 +00:00
2017-02-28 23:42:47 +00:00
2016-05-03 03:41:25 +00:00
2016-05-03 03:41:25 +00:00
2016-05-03 03:41:25 +00:00
2017-04-06 22:21:49 +00:00
2016-05-03 03:41:25 +00:00
2016-05-03 03:41:25 +00:00
2016-05-02 16:47:28 +00:00
2016-05-02 16:47:28 +00:00
2016-12-30 16:26:54 +00:00
2016-05-03 03:41:25 +00:00
2017-04-17 16:51:04 +00:00
2016-05-03 03:41:25 +00:00