dragonfly.git
6 years agodrm - Fix hrtimer, don't reset timer->function to NULL in timeout handler.
Imre Vadász [Wed, 7 Jun 2017 21:21:01 +0000 (23:21 +0200)]
drm - Fix hrtimer, don't reset timer->function to NULL in timeout handler.

* The same hrtimer object is activated multiple times by i915(4), so we
  mustn't clear timer->function in the timeout handler.

* This seems to fix the powersaving issues in i915(4) from the update to
  Linux 4.7.10 code in 8621f4070e7cb342161183c980ae7fce2fd8124e.

6 years agokernel - Move PAT indices 4, 5 to 5, 6
Matthew Dillon [Wed, 7 Jun 2017 18:59:15 +0000 (11:59 -0700)]
kernel - Move PAT indices 4, 5 to 5, 6

* Move the PAT indices to solve a stale cache issue on MacBooks that
  prevents proper booting.

Submitted-by: profmakx, peeter
Taken-from: FreeBSD

6 years agokernel - Add quirk for additional MCP79 AHCI chipset
Matthew Dillon [Wed, 7 Jun 2017 18:21:10 +0000 (11:21 -0700)]
kernel - Add quirk for additional MCP79 AHCI chipset

* Add quirk to ignore FIS status to yet another MCP79 chipset.  These NVidia
  chipsets do not implement the AHCI spec properly and need a quirk to probe
  properly.

Reported-by: peeter
6 years agoipfw3sync: comment out the printing
Bill Yuan [Thu, 8 Jun 2017 00:59:10 +0000 (08:59 +0800)]
ipfw3sync: comment out the printing

6 years agoipfw3_basic: move netisr_domsg out of callout func
Bill Yuan [Wed, 7 Jun 2017 13:02:55 +0000 (21:02 +0800)]
ipfw3_basic: move netisr_domsg out of callout func

6 years agosdhci - Add missing BROKEN_DMA quirk for Apollo Lake in sdhci_acpi(4).
Imre Vadász [Mon, 5 Jun 2017 19:48:36 +0000 (21:48 +0200)]
sdhci - Add missing BROKEN_DMA quirk for Apollo Lake in sdhci_acpi(4).

* Because of the APL18 erratum, DMA should be disabled on the Apollo Lake
  controllers for now, until we have 64bit ADMA2, which should work
  reliably on these models. I forgot to add this flag in sdhci_acpi(4) in
  commit 7ba10b88109826f7f4b59e318458760d74f2452e.

6 years agodhclient - Fix bug last commit
Matthew Dillon [Sat, 3 Jun 2017 22:05:18 +0000 (15:05 -0700)]
dhclient - Fix bug last commit

* Missing 'fi' in script prevented it from working properly.

6 years agodrm/radeon: Sync firmware with Linux
Michael Neumann [Fri, 2 Jun 2017 23:17:55 +0000 (01:17 +0200)]
drm/radeon: Sync firmware with Linux

6 years agodrm/radeon: Add missing radeon firmware
Michael Neumann [Fri, 2 Jun 2017 22:39:05 +0000 (00:39 +0200)]
drm/radeon: Add missing radeon firmware

6 years agodrm/radeon: Fix firmware paths and add missing modules
Michael Neumann [Fri, 2 Jun 2017 22:25:57 +0000 (00:25 +0200)]
drm/radeon: Fix firmware paths and add missing modules

6 years agodrm/linux: Add work_busy()
François Tigeot [Fri, 2 Jun 2017 19:13:31 +0000 (21:13 +0200)]
drm/linux: Add work_busy()

6 years agodhclient - Implement RFC 3442
Matthew Dillon [Fri, 2 Jun 2017 17:57:44 +0000 (10:57 -0700)]
dhclient - Implement RFC 3442

* Implement RFC 3442

Taken-from: FreeBSD

6 years agobce: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Tue, 30 May 2017 13:09:46 +0000 (21:09 +0800)]
bce: Use ringmap to do MSI-X cpu assignment and fill redirect table.

6 years agodrm/linux: make flush_work() more robust
François Tigeot [Thu, 1 Jun 2017 08:28:04 +0000 (10:28 +0200)]
drm/linux: make flush_work() more robust

6 years agoifnet: Fix regression if netisr_ncpus consisted of a large primary number
Sepherosa Ziehau [Thu, 1 Jun 2017 03:28:26 +0000 (11:28 +0800)]
ifnet: Fix regression if netisr_ncpus consisted of a large primary number

e.g. # of rings == 8, and netisr_ncpus == 22

Previous algorithm will only use 2 rings instead of 8 rings.

6 years agoifnet: Stringent if_ringmap assertion
Sepherosa Ziehau [Thu, 1 Jun 2017 03:22:34 +0000 (11:22 +0800)]
ifnet: Stringent if_ringmap assertion

6 years agoacpi - The UniqueId (from the _UID method) can be a string as well.
Imre Vadász [Tue, 30 May 2017 21:35:53 +0000 (23:35 +0200)]
acpi - The UniqueId (from the _UID method) can be a string as well.

* So converting the UniqueId.String value to a number, and back to a
  string for generating the pnpinfo string is a bad idea.

6 years agojme: Enable RSS only after Toeplitz key and redirect table are configured
Sepherosa Ziehau [Wed, 31 May 2017 13:34:26 +0000 (21:34 +0800)]
jme: Enable RSS only after Toeplitz key and redirect table are configured

6 years agojme: Use callout_init_mp
Sepherosa Ziehau [Wed, 31 May 2017 13:19:07 +0000 (21:19 +0800)]
jme: Use callout_init_mp

6 years agojme: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Sun, 28 May 2017 11:35:23 +0000 (19:35 +0800)]
jme: Use ringmap to do MSI-X cpu assignment and fill redirect table.

6 years agoifnet: Remove redundant check.
Sepherosa Ziehau [Sun, 28 May 2017 11:07:40 +0000 (19:07 +0800)]
ifnet: Remove redundant check.

6 years agoifnet: Add support to create ringmap requiring power-of-2 ring count.
Sepherosa Ziehau [Sun, 28 May 2017 11:04:08 +0000 (19:04 +0800)]
ifnet: Add support to create ringmap requiring power-of-2 ring count.

6 years agoPort initial UHS-1 support from FreeBSD (Only DDR52 for eMMC so far).
Imre Vadász [Sun, 21 May 2017 12:11:44 +0000 (14:11 +0200)]
Port initial UHS-1 support from FreeBSD (Only DDR52 for eMMC so far).

* Fix typo from FreeBSD commit:
  SDHCI_CTRL2_DRIVER_TYPE_A/_C_D vs. SDHCI_CAN_DRIVE_TYPE_A/_C/_D.
  And these Driver Type capability bits are in the CAPABILITIES2 register.

* Hide 1.8V VDD capability when the slot is detected as a removable card
  slot, as the spec explicitly states that the 1.8V VDD is only meant to
  be for embedded slots.

* This gives ca. 75 MiB/s read speed with the eMMC in my HP X2 210
  detachable with the Intel Cherry Trail eMMC controller, in DDR52 mode.

Taken-From: FreeBSD (svn r315598)

6 years agoefivar.8: Fix typo.
Sascha Wildner [Tue, 30 May 2017 20:49:10 +0000 (22:49 +0200)]
efivar.8: Fix typo.

6 years agokernel/boot: Bring in a number of TianoCore EDK II headers.
Sascha Wildner [Tue, 30 May 2017 19:31:46 +0000 (21:31 +0200)]
kernel/boot: Bring in a number of TianoCore EDK II headers.

No need to maintain our own here, which were just extracts
of Intel's headers anyway.

Taken from the MdePkg of the UDK2017 branch of the
git://github.com/tianocore/edk2 repository.
All I modified was killing CRs using 'tr -d "\015"'.

FreeBSD has been doing some similar work recently, so I went
with their sys/contrib directory path choice.

This is a work in progress.

6 years agokernel - Change default kern.ipc.shm_allow_removed=1
Matthew Dillon [Tue, 30 May 2017 19:13:41 +0000 (12:13 -0700)]
kernel - Change default kern.ipc.shm_allow_removed=1

* Change kern.ipc.shm_allow_removed to default to enabled.  This feature
  allows a shared memory segment to be located by its shmid after being
  deleted, as long as some prior reference to the segment is still active.

* Primarily used by chrome these days, this trick is convenient in that
  it allows applications to attach shared memory segments in a manner that
  do ensures they are deleted if the application is killed or seg-faults
  unexpectedly.

6 years agoAdd a small vga_switcheroo/apple_gmux manual page.
Sascha Wildner [Tue, 30 May 2017 17:05:36 +0000 (19:05 +0200)]
Add a small vga_switcheroo/apple_gmux manual page.

Submitted-by: Peeter Must <karu.pruun@gmail.com>
6 years agodrm/linux: Add list_empty_careful()
François Tigeot [Mon, 29 May 2017 12:15:48 +0000 (14:15 +0200)]
drm/linux: Add list_empty_careful()

6 years agoAdjust various manual pages for recent work etc.
Sascha Wildner [Mon, 29 May 2017 07:37:54 +0000 (09:37 +0200)]
Adjust various manual pages for recent work etc.

6 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sun, 28 May 2017 01:46:17 +0000 (03:46 +0200)]
Update the pciconf(8) database.

May 25, 2017 snapshot from http://pciids.sourceforge.net/

6 years agoifnet: Split ringmap declaration into their own header.
Sepherosa Ziehau [Fri, 26 May 2017 11:01:52 +0000 (19:01 +0800)]
ifnet: Split ringmap declaration into their own header.

Avoid bus.h -> device_if.h+bus_if.h pollution.

Suggested-by: swildner
6 years agoemx: Use ringmap to do polling cpu assignment and fill redirect table.
Sepherosa Ziehau [Fri, 26 May 2017 14:46:20 +0000 (22:46 +0800)]
emx: Use ringmap to do polling cpu assignment and fill redirect table.

6 years agomxge: Share same redirect table for RSS and non-RSS mode.
Sepherosa Ziehau [Fri, 26 May 2017 06:15:22 +0000 (14:15 +0800)]
mxge: Share same redirect table for RSS and non-RSS mode.

6 years agokern: Bump __DragonFly_version.
Sepherosa Ziehau [Fri, 26 May 2017 05:21:33 +0000 (13:21 +0800)]
kern: Bump __DragonFly_version.

- Change CPU_SETSIZE to signed int.
- Allow process to change selft CPU affinity.

6 years agousched: Allow process to change self cpu affinity
Sepherosa Ziehau [Fri, 26 May 2017 05:21:06 +0000 (13:21 +0800)]
usched: Allow process to change self cpu affinity

6 years agosched: Change CPU_SETSIZE to signed int, same as FreeBSD/Linux.
Sepherosa Ziehau [Fri, 26 May 2017 05:20:23 +0000 (13:20 +0800)]
sched: Change CPU_SETSIZE to signed int, same as FreeBSD/Linux.

6 years agoemx: Remove unapplied comment
Sepherosa Ziehau [Thu, 25 May 2017 05:53:51 +0000 (13:53 +0800)]
emx: Remove unapplied comment

6 years agomxge: Number of entries of the indirect table must be power-of-2
Sepherosa Ziehau [Thu, 25 May 2017 05:48:26 +0000 (13:48 +0800)]
mxge: Number of entries of the indirect table must be power-of-2

6 years agomxge: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Thu, 25 May 2017 04:59:57 +0000 (12:59 +0800)]
mxge: Use ringmap to do MSI-X cpu assignment and fill redirect table.

6 years agoifnet: Add comment for ringmap
Sepherosa Ziehau [Thu, 25 May 2017 03:19:49 +0000 (11:19 +0800)]
ifnet: Add comment for ringmap

6 years agomxge.4: Firmware images can also be embedded into a system.
Jan Sucan [Wed, 24 May 2017 20:35:34 +0000 (20:35 +0000)]
mxge.4: Firmware images can also be embedded into a system.

6 years agoigb.4: Update year.
Sepherosa Ziehau [Wed, 24 May 2017 09:37:43 +0000 (17:37 +0800)]
igb.4: Update year.

6 years ago<netproto/smb/smb_conn.h>: Add missing include guard.
Sascha Wildner [Wed, 24 May 2017 21:03:38 +0000 (23:03 +0200)]
<netproto/smb/smb_conn.h>: Add missing include guard.

6 years agomxge: Unify firmware handling with the rest of the system.
Jan Sucan [Wed, 17 May 2017 11:27:12 +0000 (11:27 +0000)]
mxge: Unify firmware handling with the rest of the system.

* Convert firmware binary data from C arrays in a header files to
  uuencode .uu files.

* Move the .uu images to a sys/contrib/dev/mxge.

* Make it possible to embed the firmware images into a system.

6 years agoem: Enable MSI by default on devices has PCI advanced features capability.
Sepherosa Ziehau [Wed, 24 May 2017 06:30:37 +0000 (14:30 +0800)]
em: Enable MSI by default on devices has PCI advanced features capability.

Some versions of I219 does not PCI express capability, but only
PCI advanced features capability.

Dragonfly-bug: http://bugs.dragonflybsd.org/issues/3038

6 years agoigb: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Mon, 15 May 2017 09:15:18 +0000 (17:15 +0800)]
igb: Use ringmap to do MSI-X cpu assignment and fill redirect table.

6 years agoifnet: Rework if_ringmap_match
Sepherosa Ziehau [Thu, 18 May 2017 06:55:08 +0000 (14:55 +0800)]
ifnet: Rework if_ringmap_match

Original version is kinda broken, if ring count != ringmap grid.
This version fixes it and gives more even ring distribution.

6 years agoA step to correctly handling command timeouts in the MMC layer.
Imre Vadász [Sun, 21 May 2017 14:02:20 +0000 (16:02 +0200)]
A step to correctly handling command timeouts in the MMC layer.

    - Now that properly issuing CMD6 is crucial (so data isn't written to
      the wrong partition for example), make a step into the direction of
      correctly handling the timeout for these commands in the MMC layer.
      Also, do a SEND_STATUS when CMD6 is invoked with an R1B response as
      recommended by relevant specifications. However, quite some work is
      left to be done in this regard; all other R1B-type commands done by
      the MMC layer also should be followed by a SEND_STATUS (CMD13), the
      erase timeout calculations/handling as documented in specifications
      are entirely ignored so far, the MMC layer doesn't provide timeouts
      applicable up to the bridge drivers and at least sdhci(4) currently
      is hardcoding 1 s as timeout for all command types unconditionally.
      Let alone already available return codes often not being checked in
      the MMC layer ...

    - For devices following the eMMC specification v4.41 or later, year 0
      is 2013 rather than 1997; so correct this for assembling the device
      ID string properly.

* This omits all the parts specific to eMMC "partitions" from the FreeBSD
  change.

* Add the Intel sdhci controller ids to sdhci_pci.c to set the
  SDHCI_QUIRK_WAIT_WHILE_BUSY quirk there.
  This also disables DMA on apollo lake sdhci, while there and whitelists
  ADMA2 on Bay Trail and Braswell sdhci controllers.

Taken-From: FreeBSD (svn r315430)

6 years agoMore style, comments, includes and unused params fixes for sdhci and mmc.
Imre Vadász [Sun, 21 May 2017 10:53:03 +0000 (12:53 +0200)]
More style, comments, includes and unused params fixes for sdhci and mmc.

Taken-From: FreeBSD (svn r314811)

6 years agoStyle fixes for sdhci(4) and mmc(4) in comments, includes, unused params.
Imre Vadász [Sat, 20 May 2017 22:06:59 +0000 (00:06 +0200)]
Style fixes for sdhci(4) and mmc(4) in comments, includes, unused params.

Taken-From: FreeBSD (svn r315466)

6 years agonvme - Fix interrupt pin support when MSI-X is unavailable.
Matthew Dillon [Fri, 19 May 2017 17:55:10 +0000 (10:55 -0700)]
nvme - Fix interrupt pin support when MSI-X is unavailable.

* Real hardware (so far) all supports MSI-X, but VMs emulating NVMe
  have been found not to.

* Fix numerous assertions that were getting hit due to the non-MSI-X
  case not installing the sc->cputovect[i] mapping.

  Install a fake cputovect[] mapping.  This mapping is primarily to allow
  multiple submission queues (per-cpu when possible).  Completion queues
  will be further limited to reduce loop-check overheads.

* For the non-MSI-X case, limit the number of completion queues to 4,
  since there is really no point having more there being only one interrupt
  vector.  We use 4 to allow the chipset side to run optimally even though
  it is not necessarily useful to have that many on the cpu side.  Though
  to be fair, in cases where the cpu-side driver polls for completions,
  having multiple completion queues CAN help even if there is only one
  interrupt as each completion queue is separately locked.

* Properly set the interrupt masking registers in the non-MSI-X case
  (probably not needed).  Note that these registers are explicitly not
  supposed to be accessed by the host when MSI-X is used.

* Fix a bug where the maximum number of queues possible was one too high.
  This limit is *never* reached anyway, but fix the code just in case.

* Fix a bug where we assumed that the number of queues returned by the
  NVME_FID_NUMQUEUES command would always be <= the number of queues
  requested.  In fact, this is not the case for at least one chipset
  or for some VM emulations.  Limit the returned values to no more than
  the requested values.

* Set the queue->nqe field last when creating a completion queue.  This
  prevents interrupts which poll multiple completion queues from attempting
  to poll a completion queue that has not finished getting set up.  This
  case always occurs when pin-based interrupts are used and sometimes
  occurs when MSI-X vectors are used, depending on the topology.

* NOTES ON DISABLING MSI-X.  Not all chipsets implement pin-based interrupts
  properly for NVMe.  The BPX NVMe card, for example, appears to just leave
  the pin interrupt in a stuck state (the chipset docs say the level
  interrupt is cleared once all doorbell heads are synchronized for the
  completion queues, but this does not happen).  So NVMe users should not
  explicitly disable MSI-X when it is nominally supported, except for
  testing.

Reported-by: sinetek
6 years agokernel - Fix excessive call stack depth on stuck interrupt
Matthew Dillon [Fri, 19 May 2017 17:51:55 +0000 (10:51 -0700)]
kernel - Fix excessive call stack depth on stuck interrupt

* Fix an issue where a stuck level interrupt can result in an excessively
  deep call-stack and possible panic.

* Fixed by disallow thread preemption when curthread->td_nest_count
  is >= 2.  The critical section count test is not sufficient for the
  fast-interrupt unpend -> preemption case.

6 years agoImprove markup in some manual pages.
Sascha Wildner [Tue, 16 May 2017 21:42:07 +0000 (23:42 +0200)]
Improve markup in some manual pages.

Use .Fa uniformly for struct members (see mdoc(7)).

6 years agosdhci - Define some easy bits from Simplified Controller Spec v4.20.
Imre Vadász [Sun, 14 May 2017 16:19:41 +0000 (18:19 +0200)]
sdhci - Define some easy bits from Simplified Controller Spec v4.20.

* New HOST_CONTROL2 fields, and new controller version values.

6 years agosdhci - Check slot type cap, set SDHCI_SLOT_EMBEDDED for an embedded slot.
Imre Vadász [Tue, 17 Jan 2017 23:12:05 +0000 (00:12 +0100)]
sdhci - Check slot type cap, set SDHCI_SLOT_EMBEDDED for an embedded slot.

* Fail in sdhci(4) initialization for slot type shared, which is completely
  unsupported by this driver at the moment.

* We shouldn't need to do any card insertion handling for embedded slots.
  XXX We could also do a couple of consistency checks, if the configuration
      selected by the driver actually makes sense for the slot type.

6 years agosdhci - Add tunables for disabling SDMA and/or ADMA2, and for testing ADMA2.
Imre Vadász [Fri, 6 Jan 2017 21:53:26 +0000 (22:53 +0100)]
sdhci - Add tunables for disabling SDMA and/or ADMA2, and for testing ADMA2.

* Also document hw.sdhci.debug tunable while there.

* Limit ADMA2 support to the already tested and working Intel sdhci
  controllers for now. Currently we only explicitly match against the Intel
  models in sdhci_acpi(4).
  XXX sdhci_pci(4) should explicitly match against the Intel sdhci
      controllers as well to whitelist ADMA2 support, via the
      SDHCI_QUIRK_WHITELIST_ADMA2 flag.

* For testing on not-yet whitelisted models, add the hw.sdhci.adma2_test
  tunable to skip the whitelist check.

6 years agosdhci - Handle ADMA error interrupt, similar to ACMD12 error interrupt.
Imre Vadász [Sat, 7 Jan 2017 22:53:43 +0000 (23:53 +0100)]
sdhci - Handle ADMA error interrupt, similar to ACMD12 error interrupt.

* Print the DMA descriptor entry that is likely at fault.

6 years agosdhci - Implement ADMA2 transfer support. Keep SDMA support for now.
Imre Vadász [Sat, 7 Jan 2017 21:44:07 +0000 (22:44 +0100)]
sdhci - Implement ADMA2 transfer support. Keep SDMA support for now.

* Using ADMA2 transfers, only generates 1 or 2 interrupts for each
  bio transfer, whereas the existing SDMA code was only transferring
  in 4K blocks (with a completion interrupt for each 4K block).

* Since support for UHS high-speed modes is still missing this might
  only give a small performance increase in many cases.
  With very aggressive CPU C-state power-management and/or very slow
  CPUs, this can improve performance a lot however. e.g. on an Atom
  x5-Z8300 at 480MHz using deepest mwait c-state setting:
    - eMMC read speed: ca. 17 MiB/s --> 30 MiB/s
    - SD-card read speed: ca. 11MiB/s --> 18MiB/s

6 years agosdhci - Add data structure definitions for ADMA2 DMA descriptors.
Imre Vadász [Fri, 6 Jan 2017 21:50:12 +0000 (22:50 +0100)]
sdhci - Add data structure definitions for ADMA2 DMA descriptors.

6 years agobnx: Free ringmap in device_detach device method
Sepherosa Ziehau [Sun, 14 May 2017 05:08:20 +0000 (13:08 +0800)]
bnx: Free ringmap in device_detach device method

6 years agobnx: Use modulo to map TX rings.
Sepherosa Ziehau [Sun, 14 May 2017 01:45:38 +0000 (09:45 +0800)]
bnx: Use modulo to map TX rings.

6 years agobnx: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Fri, 12 May 2017 07:06:52 +0000 (15:06 +0800)]
bnx: Use ringmap to do MSI-X cpu assignment and fill redirect table.

6 years agopf: Normalized, i.e. defragged, packets requiring rehash.
Sepherosa Ziehau [Fri, 12 May 2017 04:42:24 +0000 (12:42 +0800)]
pf: Normalized, i.e. defragged, packets requiring rehash.

DragonFly-bug: https://bugs.dragonflybsd.org/issues/3036
Tested-by: tautology
6 years agodevattr.3: Some minor adjustments.
Sascha Wildner [Thu, 11 May 2017 18:56:26 +0000 (20:56 +0200)]
devattr.3: Some minor adjustments.

* Do not point to itself with .Xr

* Add missing space.

6 years agotools/toeplitz: Add option to do modulo
Sepherosa Ziehau [Sun, 7 May 2017 06:42:28 +0000 (14:42 +0800)]
tools/toeplitz: Add option to do modulo

6 years agonetisr: Add tunable for netisr_ncpus.
Sepherosa Ziehau [Sun, 7 May 2017 02:35:22 +0000 (10:35 +0800)]
netisr: Add tunable for netisr_ncpus.

6 years agoix: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Tue, 18 Apr 2017 06:06:43 +0000 (14:06 +0800)]
ix: Use ringmap to do MSI-X cpu assignment and fill redirect table.

6 years agoifnet: Add ringmap, which does ring/cpu map and generates redirect table.
Sepherosa Ziehau [Tue, 18 Apr 2017 05:43:26 +0000 (13:43 +0800)]
ifnet: Add ringmap, which does ring/cpu map and generates redirect table.

6 years agoinet: Local group index is not assigned in jail.
Sepherosa Ziehau [Wed, 10 May 2017 10:47:25 +0000 (18:47 +0800)]
inet: Local group index is not assigned in jail.

Dragonfly-bug: https://bugs.dragonflybsd.org/issues/3035

6 years agokernel/vga_switcheroo: Hook vga_switcheroo to i915.
Peeter Must [Tue, 9 May 2017 12:36:13 +0000 (15:36 +0300)]
kernel/vga_switcheroo: Hook vga_switcheroo to i915.

* When i915 loads, call vga_switcheroo to switch gmux so the
  integrated graphics device will output both to the laptop panel
  and the external monitor.
  For now, we do not power off the discrete graphics device.

6 years agoClean up SEE ALSO in various manual pages.
Sascha Wildner [Wed, 10 May 2017 06:36:21 +0000 (08:36 +0200)]
Clean up SEE ALSO in various manual pages.

6 years agokernel/apple_gmux: Fix compilation when VGA_SWITCHEROO is in the config.
Sascha Wildner [Tue, 9 May 2017 04:04:26 +0000 (06:04 +0200)]
kernel/apple_gmux: Fix compilation when VGA_SWITCHEROO is in the config.

We would get a redefinition warning/error, because opt_drm.h has
VGA_SWITCHEROO defined to 1 in this case, which is not the same as
merely defining it. To be on the safe side, define to 1 here, too,
and also add an #ifndef and a comment.

Discussed-with: Peeter Must <karu.pruun@gmail.com>

6 years agokernel: Move apple_gmux to sys/gnu/dev/misc/
Sascha Wildner [Mon, 8 May 2017 08:51:37 +0000 (10:51 +0200)]
kernel: Move apple_gmux to sys/gnu/dev/misc/

6 years agoResolve some mdoc issues in manual pages.
Sascha Wildner [Mon, 8 May 2017 13:47:38 +0000 (15:47 +0200)]
Resolve some mdoc issues in manual pages.

6 years agosound/hda: Fix an invalid corb size (0) panic
François Tigeot [Mon, 8 May 2017 11:34:52 +0000 (13:34 +0200)]
sound/hda: Fix an invalid corb size (0) panic

* This allows HDMI audio to be used with problematic Radeon
  graphics card models such as Radeon R7 240

* This commit is based on a patch from Andriy Gapon posted in
  freebsd-current@ back in July 2010:
  https://lists.freebsd.org/pipermail/freebsd-current/2010-July/018764.html

Submitted-by: davshao, issue #3026
6 years agoRemove a no longer used header (scsi_iu.h).
Sascha Wildner [Mon, 8 May 2017 06:54:18 +0000 (08:54 +0200)]
Remove a no longer used header (scsi_iu.h).

The last consumer was removed in 82faf7935980d0b4e443ff7bbff806e3d6e2a10f.

6 years ago<sys/un.h>: Stop including <sys/file.h>.
Sascha Wildner [Sat, 6 May 2017 18:33:18 +0000 (20:33 +0200)]
<sys/un.h>: Stop including <sys/file.h>.

It is no longer needed since f635d1746140d0f4915af3adb8314f4759377d3b.

While here, remove a forward declaration of struct sockopt (no longer
needed since 002c1265bf9676475d08e73e8d873cea9ee4a82e) and adjust a
bit of whitespace.

Also adjust ng_ksocket.c where DragonFly specific code was assuming
that including <sys/un.h> would bring in <sys/fcntl.h>.

6 years agoUpdate drm/radeon to Linux 4.7.10 as much as possible...
David Shao [Sat, 1 Apr 2017 23:32:06 +0000 (16:32 -0700)]
Update drm/radeon to Linux 4.7.10 as much as possible...

...before other kernel changes.

6 years agohier.7: Some adjustments to match current layout.
Sascha Wildner [Wed, 3 May 2017 07:24:23 +0000 (09:24 +0200)]
hier.7: Some adjustments to match current layout.

6 years agokernel/acpi_srat: Remove some unused code.
Sascha Wildner [Sun, 30 Apr 2017 22:19:05 +0000 (00:19 +0200)]
kernel/acpi_srat: Remove some unused code.

6 years agoRemove some old UUCP remains and adjust better to net/freebsd-uucp pkg.
Sascha Wildner [Sun, 30 Apr 2017 18:32:24 +0000 (20:32 +0200)]
Remove some old UUCP remains and adjust better to net/freebsd-uucp pkg.

6 years agolinux/apple-gmux.h: Fix permissions.
Sascha Wildner [Sat, 29 Apr 2017 08:56:55 +0000 (10:56 +0200)]
linux/apple-gmux.h: Fix permissions.

6 years agokernel/acpica: Remove obsolete comment in the Makefile.
Sascha Wildner [Fri, 28 Apr 2017 16:46:08 +0000 (18:46 +0200)]
kernel/acpica: Remove obsolete comment in the Makefile.

6 years agokernel: Import the apple-gmux driver from Linux 4.8
Peeter Must [Thu, 13 Apr 2017 07:17:43 +0000 (10:17 +0300)]
kernel: Import the apple-gmux driver from Linux 4.8

Some Apple laptop models with dual GPUs use a special gmux device
in order to connect video outputs to a particular GPU or the other
one.
This driver allows the use of Intel graphics on Macbooks having an
on-board additional Nvidia GPU.

Rename the driver to "apple_gmux" since hyphens are not welcome in
DragonFly's kernel module names.

6 years agodrm/linux: Remove no longer needed iic includes
François Tigeot [Thu, 27 Apr 2017 11:12:29 +0000 (13:12 +0200)]
drm/linux: Remove no longer needed iic includes

6 years agotuning.7: Fix typo.
Sascha Wildner [Thu, 27 Apr 2017 07:50:11 +0000 (09:50 +0200)]
tuning.7: Fix typo.

6 years agotuning.7: Fix .Fx/.Dx confusion a bit better.
Sascha Wildner [Thu, 27 Apr 2017 06:53:02 +0000 (08:53 +0200)]
tuning.7: Fix .Fx/.Dx confusion a bit better.

* Remove a rather meaningless sentence about the VM.

* In HISTORY, it is indeed FreeBSD that we are referring to. Add some
  info about DragonFly.

* Add an AUTHORS section.

6 years agodocs - Fix name type-o
Matthew Dillon [Wed, 26 Apr 2017 19:51:12 +0000 (12:51 -0700)]
docs - Fix name type-o

* Fix .Fx use that was supposed to be .Dx.

Reported-by: kerma
6 years ago<fcntl.h>: Add some missing defines (required by POSIX).
Sascha Wildner [Mon, 24 Apr 2017 17:22:39 +0000 (19:22 +0200)]
<fcntl.h>: Add some missing defines (required by POSIX).

   SEEK_SET   S_ISUID   S_IRWXU   S_IRWXG   S_IRWXO
   SEEK_CUR   S_ISGID   S_IRUSR   S_IRGRP   S_IROTH
   SEEK_END             S_IWUSR   S_IWGRP   S_IWOTH
                        S_IXUSR   S_IXGRP   S_IXOTH

Adjust <stat.h>, <stdio.h> and <unistd.h> accordingly.

See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html

6 years agokernel - Fix double-free in if_ath, fix lost rcvif.
Matthew Dillon [Mon, 24 Apr 2017 17:06:32 +0000 (10:06 -0700)]
kernel - Fix double-free in if_ath, fix lost rcvif.

* Reassign rcvif in ieee80211_vap_pkt_send_dest() prior to calling
  ic_transmit().  The rcvif assignment can get lost from packet
  manipulation above that section of code.

* Fix a double-free in if_ath in the error path for ath_transmit().
  Callers of ic_transmit (aka ath_transmit in this case) expect the
  mbuf to remain intact on a non-zero error return.

* Document confusing code in WPI.

Reported-by: marino
Reviewed-by: sephe
6 years agokernel - Fix i915 deadlock
Matthew Dillon [Sun, 23 Apr 2017 00:30:54 +0000 (17:30 -0700)]
kernel - Fix i915 deadlock

* (Attempt to) fix a deadlock in the i915 code.  The device lock retry
  code does not release the PG_BUSY on the passed-in placeholder page,
  so the fact that the lock is obtained non-blocking is irrelevant.

  Try to fix this by immediately releasing the placeholder page.  The
  code already checks for an insertion race later on.

6 years agox86_64: Identify HWP in "Thermal and PM features"
François Tigeot [Sat, 22 Apr 2017 08:29:45 +0000 (10:29 +0200)]
x86_64: Identify HWP in "Thermal and PM features"

Also known as Hardware-managed P-states.

7 years agoix: Fixup TX/RX ring settings for X550, which supports 64/64 TX/RX rings.
Sepherosa Ziehau [Tue, 18 Apr 2017 04:22:26 +0000 (12:22 +0800)]
ix: Fixup TX/RX ring settings for X550, which supports 64/64 TX/RX rings.

7 years agosys/vfs/hammer: Drop typedefs for struct hammer_ioc_{hist_entry,mrecord_head}
Tomohiro Kusumi [Mon, 17 Apr 2017 18:48:22 +0000 (21:48 +0300)]
sys/vfs/hammer: Drop typedefs for struct hammer_ioc_{hist_entry,mrecord_head}

These are the only two ioctl structs with pointer typedefs. All the
rest of ioctl structs aren't typedef'd, and there isn't really any
reason that these two need to be typedef'd.

Note that almost all non ioctl HAMMER structs have pointer typedef,
and majority of variables have been typedef'd ones from the beginning
(since they were mostly pointers). Rest were changed to use typedef'd
at some point in 2016, to avoid mix of these for no reason, though
typedef'd pointers have ugliness when used as const.

7 years agosbin/*hammer: Add missing braces to conform to code style
Tomohiro Kusumi [Mon, 17 Apr 2017 11:18:10 +0000 (14:18 +0300)]
sbin/*hammer: Add missing braces to conform to code style

These were the missing ones due to
1. the code were written by several devs
2. they were missing ever since originally written by dillon@

7 years agosbin/mount_hammer: Use calloc(3) and cleanups
Tomohiro Kusumi [Mon, 17 Apr 2017 11:17:48 +0000 (14:17 +0300)]
sbin/mount_hammer: Use calloc(3) and cleanups

7 years agokernel: Remove TCPDEBUG checks in tcp_debug.c.
Sascha Wildner [Sun, 16 Apr 2017 23:04:20 +0000 (01:04 +0200)]
kernel: Remove TCPDEBUG checks in tcp_debug.c.

This file is only compiled in when TCPDEBUG is specified, so the check
is always true.

7 years agokernel: Fix building with options TCPDEBUG.
Sascha Wildner [Sun, 16 Apr 2017 23:00:53 +0000 (01:00 +0200)]
kernel: Fix building with options TCPDEBUG.

7 years agosys/vfs/autofs: Value returned by taskqueue_enqueue_timeout(9) is not an error; ...
Tomohiro Kusumi [Sun, 16 Apr 2017 22:01:29 +0000 (01:01 +0300)]
sys/vfs/autofs: Value returned by taskqueue_enqueue_timeout(9) is not an error; (FreeBSD@GitHub e61af21d)

7 years agosys/vfs/autofs: Sync with FreeBSD's .vop_print format (FreeBSD@GitHub d8ce902a)
Tomohiro Kusumi [Sun, 16 Apr 2017 21:56:47 +0000 (00:56 +0300)]
sys/vfs/autofs: Sync with FreeBSD's .vop_print format (FreeBSD@GitHub d8ce902a)

FreeBSD@GitHub d8ce902a4769ab96ae8e86a730221d92a5978e4a
Implement autofs_print(), for improved debugging experience.

added .vop_print after autofs had been ported to DragonFlyBSD,
and it had anp->an_wildcards which we didn't, so just add it.