aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* Add TUNABLE_INT to radeonkms driver parameters.Yoshihiro Takahashi2017-04-291-0/+17
| | | | | | | | | | | They are required by PowerMac G5 DP. PR: 217852 Submitted by: Hiroo Ono MFC after: 1 week Notes: svn path=/head/; revision=317591
* Fix some cases where an index was used before its limits check.Pedro F. Giffuni2017-04-291-2/+2
| | | | | | | | Obtained from: DragonFlyBSD (git 799ba435) MFC after: 5 days Notes: svn path=/head/; revision=317583
* Improve sysadmin visibility of physical port error counters in theHans Petter Selasky2017-04-281-3/+32
| | | | | | | | | | mlx5en driver. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=317568
* Simplify the code a bit. No functional change.Jung-uk Kim2017-04-281-9/+8
| | | | Notes: svn path=/head/; revision=317561
* Fix end coordinate of the drawable area of border. Although the name tr_endJung-uk Kim2017-04-281-3/+3
| | | | | | | | | | suggests it is the end coordinate, tr_end.tp_row is width and tr_end.tp_col is height of the drawable area in reality. PR: 202288 Notes: svn path=/head/; revision=317560
* Various fixes for PCI _OSC handling so HotPlug works again.John Baldwin2017-04-274-16/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=317510
* Revert r317446 and bring back cy(4).John Baldwin2017-04-275-0/+2695
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=317509
* Don't free uninitialized sysctl contexts in the mlx4en driver. ThisHans Petter Selasky2017-04-272-8/+8
| | | | | | | | | | | can cause NULL pointer panics during failed device attach. Differential Revision: https://reviews.freebsd.org/D8876 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=317505
* Remove the cy(4) driver for Cyclades serial adapters.John Baldwin2017-04-265-2695/+0
| | | | | | | | This driver has been disconnected from the build since the new tty layer was introduced in 8.0 and was never updated for new tty. Notes: svn path=/head/; revision=317446
* Check if the device is marked as dma-coherent in the FDT, and if so, letOlivier Houchard2017-04-263-1/+7
| | | | | | | | | | busdma know, so that on architectures where dma isn't always coherent, we know we don't have to write-back/invalidates cachelines on DMA operations. Reviewed by: andrew, mav Notes: svn path=/head/; revision=317441
* Remove the source to digi(4).John Baldwin2017-04-2528-28776/+0
| | | | | | | This was forgotten when the driver was removed in r305235. Notes: svn path=/head/; revision=317426
* cxgbe/iw_cxgbe: Pull in some updates to c4iw_wait_for_reply from theNavdeep Parhar2017-04-251-21/+42
| | | | | | | | | | | iw_cxgb4 Linux driver. Obtained from: Chelsio Communications MFC after: 3 days Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=317410
* Remove the NATM framework including the en(4), fatm(4), hatm(4), andBrooks Davis2017-04-2435-36276/+0
| | | | | | | | | | | | | | | | | | | | | | | | patm(4) devices. Maintaining an address family and framework has real costs when we make infrastructure improvements. In the case of NATM we support no devices manufactured in the last 20 years and some will not even work in modern motherboards (some newer devices that patm(4) could be updated to support apparently exist, but we do not currently have support). With this change, support remains for some netgraph modules that don't require NATM support code. It is unclear if all these should remain, though ng_atmllc certainly stands alone. Note well: FreeBSD 11 supports NATM and will continue to do so until at least September 30, 2021. Improvements to the code in FreeBSD 11 are certainly welcome. Reviewed by: philip Approved by: harti Notes: svn path=/head/; revision=317383
* Add support for dumping bcma/siba EROM tables to the console via a newLandon J. Fuller2017-04-244-0/+240
| | | | | | | | | | | | | | | | BHND_EROM_DUMP() method. Dump the EROM tables to the coneole on mips/broadcom devices if bootverbose is enabled; this functionality is primarily useful when debugging SoC EROM parsing and device matching issues during early boot. Reviewed by: mizhka Approved by: adrian (mentor) Sponsored by: Plausible Labs Differential Revision: https://reviews.freebsd.org/D10122 Notes: svn path=/head/; revision=317380
* Drop unused/unnecessary return statement.Landon J. Fuller2017-04-241-1/+0
| | | | | | | | | Reported by: Coverity CID: 1373118 Approved by: adrian (mentor, implicit) Notes: svn path=/head/; revision=317379
* Call the PSCI reset from cpu_reset on arm64. When rebooting from DDB theAndrew Turner2017-04-242-1/+8
| | | | | | | | | | | | kernel calls this directly so the event handler is not called, meaning the computer fails to reboot. Tested by: cognet MFC after: 1 week Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=317361
* Switch isp_reset to scratchpad not requiring ISP_MBOXDMASETUP.Alexander Motin2017-04-241-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=317356
* Use proper alignment constant for uma_zcreate().Alexander Motin2017-04-241-1/+1
| | | | | | | | | Previous code panicked on KASSERT with INVARIANTS enabled. MFC after: 2 weeks Notes: svn path=/head/; revision=317355
* hyperv/hn: Use channel0, i.e. TX ring0, for TCP SYN/SYN|ACK.Sepherosa Ziehau2017-04-241-11/+91
| | | | | | | | | | | | | | | | | Hyper-V hot channel effect: Operation latency on hot channel is only _half_ of the operation latency on cold channels. This commit takes the advantage of the above Hyper-V host channel effect, and can reduce more than 75% latency and more than 50% latency stdev, i.e. lower and more stable/predictable latency, for various types of web server workloads. MFC after: 3 days Sponsored by: Microsoft Notes: svn path=/head/; revision=317353
* Report NTB link speed to console and interface.Alexander Motin2017-04-235-16/+56
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=317340
* Change the drawing method for the mouse cursor in planar mode to supportBruce Evans2017-04-231-11/+33
| | | | | | | | | | | | | | | | | | colors. Colors are still hard-coded as 15 (normally lightwhite) for the interior and 0 (normally black) for the border, but these are now values used in 2 expressions instead of built in to the algorithm. The algorithm used a fancy and/or method, but this gives no control over the colors except and'ing all color planes off gives black and or'ing all color planes on gives lightwhite. Just draw the border and interior in separate colors using the same method as for characters, including its complications to optimize for VGA adaptors. Optimization is not really needed here, but for the VGA case it avoids being slower than the and/or method. The optimization is worth about 30%. Notes: svn path=/head/; revision=317334
* Optimize setting of the foreground color in the main planar method muchBruce Evans2017-04-211-3/+7
| | | | | | | | | like for the background color. This is a about 5% faster for output that actually reaches the screen. Notes: svn path=/head/; revision=317264
* Merge the main ega drawing method into the main vga planar method andBruce Evans2017-04-211-67/+18
| | | | | | | | | | | | | | | | | remove the former. All other EGA/VGA methods were already shared, with VGA-only features mostly not used and no decisions in inner loops to optimize fof VGA, but this method was split up because it is the only important one and using VGA methods if possible is about twice as fast. The speed is mostly not from splitting to reduce branches but from doing half as many bus accesses, so make this easier to maintain by not splitting. There is now 1 extra branch in an inner loop where it costs less than 1% of the bus access overhead on Haswell even if the compiler schedules it poorly. Notes: svn path=/head/; revision=317256
* Oops, the previous commit swapped the main ega method with the mainBruce Evans2017-04-211-5/+3
| | | | | | | | | | | | | | | vga planar method (for testing that was supposed to be local that the former still works). The ega method works on vga but is about twice as slow. The vga method doesn't work on ega. Optimize the main vga planar method a little. For changing the background color (which was otherwise optimized better than most things), don't switch the write mode from 3 to 0 just to select the pixel mask of 0xff obscurely by writing 0. Just write 0xff directly. Notes: svn path=/head/; revision=317245
* Eliminate the ega renderer switch. It did nothing useful except holdBruce Evans2017-04-201-14/+5
| | | | | | | | | | a pointer to the main ega drawing method which is misoptimized be in a different function than the main vga planar mode drawing method. Vga initialization handles everything with no extra code except for selecting the different function. Notes: svn path=/head/; revision=317199
* When the character width is 9, remove vertical lines in the mouse cursorBruce Evans2017-04-202-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | corresponding to the gaps between characters. This fixes distortion of the cursor due to expanding it across the gaps. Again for character width 9, when the cursor characters are not in the graphics range (0xb0-0xdf), the gaps were always there (filled in the background color for the previous char). They still look strange, but don't cause distortion. When the cursor characters are in the graphics range, the gaps are filled by repeating the previous line. This gives distortion with cilia. Removing vertical lines reduces the distortion to vertical cilia. Move the default for the cursor characters out of the graphics range. With character width 9, this gives gaps instead of distortion and other problems. With character width 8, it just fixes a smaller set of other problems. Some distortion and other problems can be recovered using vidcontrol -M. Presumably the default was to fill the gaps intentionally, but it is much better to leave gaps. The gaps can even be considered as a feature for text processing -- they give sub-pointers to character boundaries. The other problems are: (1) with character width 9, characters near the cursor are moved into the graphics range and thus distorted if any of their 8th bits is set; (2) conflicts with national characters in the graphics range. The default range for the graphics cursor characters is now 8-11. This doesn't conflict with anything, since the glyphs for the characters in this range are unreachable. Use the 10x16 mouse cursor in text mode too (if the font size is >= 14). When the character width is 9, removal of 1 or 2 vertical lines makes 10x16 cursor no wider than the 9x13 one usually was. We could even handle cursors 1 pixel wider in 2 character cells and gaps without more clipping than given by the gaps (the worst case is 1 pixel in the left cell, 1 removed in the middle gap, 8 in the right cell and 1 removed in the right gap. The pixel in the right gap is removed so it doesn't matter if it is in the font). When the character width is 8, we now clip the 10-wide cursor by 1 pixel in the worst case. This clipping is usually invisible since it is of the border and and the border usually merges with the background so is invisible. There should be an option to use reverse video to highlight the border and its tip instead of the interior (graphics mode can do better using separate colors). This needs the 9x13 cursor again. Ideas from: ache (especially about the bad default character range) Notes: svn path=/head/; revision=317198
* Write-combine framebuffer writes through user-space mappings, if possible.Konstantin Belousov2017-04-201-0/+3
| | | | | | | | | | | | | | Note that KVA mapping of the framebuffer already uses write-combining mode, so the change, besides improving speed of user mode writes, also satisfies requirement of the IA32 architecture of using consistent caching modes for multiple mappings of the same page. Reported and tested by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=317196
* Update comment ot reflect realilty, we know also take care of CPUs thatOlivier Houchard2017-04-201-1/+2
| | | | | | | | | provide a enable-method. Suggested by: jhibbits Notes: svn path=/head/; revision=317195
* ePAPR states that any non-boot CPU will come in "disabled" state. So we shouldOlivier Houchard2017-04-201-2/+4
| | | | | | | | | | | | not consider a "disabled" cpu as a CPU we have to ignore, and we should use them if they provide a "enable-method". While I'm there, support "ok" as well as "okay", while ePAPR only accepts "okay", linux accepts "ok" too so we can expect it to be used. Reviewed by: andrew (partially) Notes: svn path=/head/; revision=317191
* Attempt to determine the modes in which 8-bit wide characters are actuallyBruce Evans2017-04-202-0/+27
| | | | | | | | | | | | | | | | | | | 9 wide. I only need this to improve the mouse cursor, but it has always been needed to select and/or adjust fonts. This is complicated because there are no standard parameter tables giving this bit of information directly, and the device register bit giving the information can't be trusted even if it is read from the hardware. Use a heuristic to guess if the device register can be trusted. (The device register is normally read from the BIOS mode table, but on my system where the device register is wrong, the mode table doesn't match the hardware and is not used; the device registers are used in this case.) Notes: svn path=/head/; revision=317190
* Some cosmetic polishing for pre-timeouts.Alexander Motin2017-04-201-4/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=317185
* Cleanup QLA_LOCK/QLA_UNLOCK macrosDavid C Somayajulu2017-04-204-60/+63
| | | | | | | | | | remove unused QLA_TX_LOCK/QLA_TX_UNLOCK macros format qla_error_recovery() MFC after:3 days Notes: svn path=/head/; revision=317180
* Fix build without SC_PIXEL_MODE defined.Gleb Smirnoff2017-04-191-1/+2
| | | | Notes: svn path=/head/; revision=317175
* Revert r316796. It is not necessary since r317173.Jung-uk Kim2017-04-191-7/+1
| | | | Notes: svn path=/head/; revision=317174
* Always clear borders when the terminal is flushed.Jung-uk Kim2017-04-191-29/+29
| | | | | | | PR: 202288 Notes: svn path=/head/; revision=317173
* Micro-optimize vt_set_border().Jung-uk Kim2017-04-191-30/+19
| | | | Notes: svn path=/head/; revision=317171
* Fix missing support for drawing the mouse cursor in depth 24 of directBruce Evans2017-04-191-46/+6
| | | | | | | | | | | | | | | | | | | | | | | mode. Use the general DRAWPIXEL() macro with its bigger case statement (twice) instead of our big case statement (once). DRAWPIXEL() is more complicated since it is not missing support for depth 24 or complications for colors in depth 16 (we currently hard-code black and white so the complications for colors are not needed). DRAWPIXEL() also does the bpp calculation in the inner loop. Compilers optimize DRAWPIXEL() well enough, and the main text drawing method always depended on this. In direct mode, mouse cursor drawing is now similar to normal text drawing except it draws in 2 hard-coded colors instead of 1 variable color. This also fixes a nested hard-coding of colors. DRAWPIXEL() uses the palette in all cases, but the direct code didn't use the palette for its hard-coded black. This only had an effect in depth 8, since changing the palette is not supported in other depths. Notes: svn path=/head/; revision=317157
* Stop using a saveunder method for mouse cursor drawing in the vgaBruce Evans2017-04-191-49/+5
| | | | | | | | | | | | | | | | | | | | | direct mode renderer. I thought that reads were not much slower than writes, so that the method only tripled the time for the whole function, but I recently measured that video memory reads can be up to 53 times slower than writes in tighter loops than here. Loop overheap here reduces the multiplier to only 16-20 on Haswell. Start cleaning up and fixing larger bugs in this function. Only replace the 22-line removal loop by a 3-line one for now, since adjusting the old loop would have required many palette calculations which are better done in the DRAW_PIXEL() macro. This also fixes missing support for depth 24, but only for removal. Removal is currently sloppy at the right bottom corner. It sometimes leaks border color into the text window. This is soon cleaned up by the caller. The planar renderer has complications to clip at the corner. Notes: svn path=/head/; revision=317150
* When we don't use the parameter table in the BIOS, also don't use mostBruce Evans2017-04-191-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | of our tweaked modes based on it. In practice, this means limiting the tweaked modes to at most 80x50 based on 80x25, so there are no 90-column, 80x30 or 80x60 modes. This happens when the the initial mode is is not in the parameter table. We always detected this case, but assumed that the (necessarily nonstandard) parameters of the initial mode could be tweaked just as blindly as the probably-standard parameters of initial modes in the table. On 1 laptop system with near-VGA where the initial mode is nonstandard, this is because the hardware apparently doesn't support 9-bit mode, but otherwise has standard timing. The initial mode has 8-bit mode CRTC horizontal parameters similar to those in syscons' 90-column modes and in EGA modes. Tweaking these values for the 90-column modes has little effect except to print the extra 10 columns off the screen. Tweaking from 80x25 to 80x30 requires changing from 400 scan lines to 480. This can probably be made to work, but syscons blindly applies values based on standard timing. This gives blank output. Tweaking from 80x25 to 80x50 doesn't change the CRTC timing and works. Notes: svn path=/head/; revision=317142
* hyperv: Use kmem_malloc for hypercall memory due to NX bit change.Sepherosa Ziehau2017-04-191-12/+19
| | | | | | | | | Reported by: dexuan@ MFC after: now Sponsored by: Microsoft Notes: svn path=/head/; revision=317107
* Block FPDMA TRIM for ASMedia HBAs.Alexander Motin2017-04-183-11/+15
| | | | | | | | | | Experiments show FPDMA TRIM command timeouts on ASMedia HBAs, while the same SSDs working fine on Intel HBAs. MFC after: 2 weeks Notes: svn path=/head/; revision=317080
* All these files need sys/vmmeter.h, but now they got it implicitlyGleb Smirnoff2017-04-172-0/+2
| | | | | | | included via sys/pcpu.h. Notes: svn path=/head/; revision=317055
* Remove unneeded include of vm_phys.h.Gleb Smirnoff2017-04-172-2/+0
| | | | Notes: svn path=/head/; revision=317053
* cxgbe: Add tunables to control the number of LRO entries and the numberNavdeep Parhar2017-04-172-10/+58
| | | | | | | | | | | of rx mbufs that should be presorted before LRO. There is no change in default behavior. MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=317041
* Replace the RC4 algorithm for generating in-kernel secure randomMark Murray2017-04-162-4/+11
| | | | | | | | | | | | | | | | | numbers with Chacha20. Keep the API, though, as that is what the other *BSD's have done. Use the boot-time entropy stash (if present) to bootstrap the in-kernel entropy source. Reviewed by: delphij,rwatson Approved by: so(delphij) MFC after: 2 months Relnotes: yes Differential Revision: https://reviews.freebsd.org/D10048 Notes: svn path=/head/; revision=317015
* Add imx6ul SoC support, and get the PHY number from the FDT data. If thereIan Lepore2017-04-161-2/+8
| | | | | | | | | | | | | is no phy-handle property, fall back to using MII_PHY_ANY. This still doesn't support an mdio bus with multiple PHYs on it, or the possibility that the PHY being used by this instance of ffec is on the mdio bus of some other instance (which is now a possibility with imx6ul). Adding that support will require changes in fdt_get_phyaddr(), which is currently making some assumptions that don't work with modern fdt data. Notes: svn path=/head/; revision=316996
* Add support for the Micrel KSZ8081 ethernet PHY.Ian Lepore2017-04-162-1/+28
| | | | | | | | | | | | The only thing this phy needs that the ukphy driver doesn't provide is that the value in the proprietary Phy Control 2 Register must be saved before doing a soft reset and restored afterwards. Most modern phys have "sticky bits" for low-level config that survive a reset, but on this one the values in all registers go back to defaults, wiping out any board- specific config set up by the bootloader/bios/whatever. Notes: svn path=/head/; revision=316995
* Add a 10x16 mouse cursor and use it in all graphics (strictly, pixel)Bruce Evans2017-04-151-3/+11
| | | | | | | | | | | | | | | modes if the font size is >= 14. This is the X cursor XC_left_ptr (#68) (glyph #45 in an X cursor font). Also found in vt. The old 9x13 cursor is the 10x16 one trimmed not very well. 8x8 fonts need a smaller cursor instead of a larger one, except when the pixel size is small. Text mode is still limited to width and height 1 more than the font (so the 9x13 is already 4 pixels too high for it). Notes: svn path=/head/; revision=316977
* Structure the mouse cursor data so that it is easier to switch, andBruce Evans2017-04-151-24/+39
| | | | | | | | | | | | | | | | access it via pointers (still to only 1 instance, now with a less generic name). Restructure the "and" and "or" masks as border and interior masks (where the "and" mask was for the union of the border and the interior). "and" and "or" were only a detail in a not very good implementation, and after fixing that the union was only used to calculate the border at runtime. Use the metric data in more places to clip to active pixels earlier. Notes: svn path=/head/; revision=316974
* cxgbe: Add a tunable to configure the SGE time scaler, which isNavdeep Parhar2017-04-153-8/+39
| | | | | | | | | | | | | | available starting with T6. The values in the timer holdoff registers are multiplied by the scaling factor before use. dev.<nexus>.<n>.holdoff_timers shows the final values of the timers in microseconds. MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=316971