summaryrefslogtreecommitdiff
path: root/sys/dev
AgeCommit message (Collapse)Author
2020-05-17restore VGA fonts on VT switchJonathan Gray
Avoids an unusable screen when switching to a VT with a custom VGA font from X. While it is possible to modify the xserver to invoke an ioctl for this kettenis@ points out the xserver may have crashed so doing it in the kernel is preferred. Problem reported by and patch from John Carmack. Changed slightly to do the vga_restore_fonts() (write to video memory) call before vga_setfont() (pointing the character generator at it) at the suggestion of kettenis@. ok kettenis@
2020-05-17Add function for attaching RTC drivers, to reduce direct useVisa Hankala
of todr_handle. OK kettenis@
2020-05-17Prevent kcov from collecting coverage after the kernel has panicked.anton
This could happen if curproc had kcov enabled while panicking. ok mpi@ visa@
2020-05-17fix typo in a commentJonathan Gray
from Delyan Raychev
2020-05-16entropy_add_ptr and entropy_input_rotate are only used insideTheo de Raadt
enqueue_randomness(), so make them local static instead of global.
2020-05-16be more consistant about with using sizeof(object) rather than the constantTheo de Raadt
defining the [size]
2020-05-16Fix PHY_CONTEXT commands sent to iwx(4) firmware.Stefan Sperling
iwx(4) firmware understands two different variants of these commands. Both variants are documented with the same command API version number, but they use different sizes for an embedded struct which contains information about channels. Which variant to use depends on whether the firmware advertises support for the "ULTRA_HB_CHANNELS" feature. The code I wrote to handle both cases had a bug in case this feature is not supported: The channel info size difference was only accounted for while computing the command's length, but not while writing command data. This bug does not affect devices presently matched by iwx(4). But it is possible that other devices may need this fix in the future. So, for now, fix the buggy code path instead of removing it. ok mpi@
2020-05-16Don't attempt to reset the state of the flip-flop associated with theJonathan Gray
vga attribute controller index or set the enable/'palette address source' bit when saving and restoring 256 colour vga palette with 0x3c6-0x3c9 as this does not touch the attribute registers. When this code was ported from FreeBSD in vga.c rev 1.48 the flip-flop reset parts were mistakenly made to read 0x3ca instead of 0x3da. Fixes a problem with VirtualBox where the text mode background was a dim red colour instead of black after VT switch. Problem reported by and patch from John Carmack. ok matthieu@ who notes this also fixes a similiar problem with a KVM / virt-manager virtual machine.
2020-05-16Use softintr to call selwakeup() in the mixer code code-pathAlexandre Ratchov
ok mpi
2020-05-16Implement kqueue(2) support.Martin Pieuchot
ok visa@
2020-05-16remove unused debug statementsanton
2020-05-16In preparation for stopping coverage collection once the kernel hasanton
panicked, extract common parts between the two coverage collection functions to a new helper called kd_curproc(). While here, sprinkle a few branch prediction hints borrowed from NetBSD. ok mpi@ visa@
2020-05-15Fix CCMP replay check with 11n Rx aggregation and CCMP hardware offloading.Stefan Sperling
So far, drivers using hardware CCMP decryption were expected to keep the most recently seen CCMP packet number (PN) up-to-date, and to discard frames with lower PNs as replays. A-MPDU subframes may legitimately arrive out of order, and the drivers skipped CCMP replay checking for such frames. Re-ordering happens in ieee80211_inputm(), after the driver is done with a frame. Drivers cannot tell replayed frames apart from legitimate out-of-order retransmissions. To fix this, update the PN value in ieee80211_inputm() after subframes have been reordered into their proper sequence. Drivers still perform replay checks but they no longer have to worry about updating the last seen PN value. The 802.11 spec confirms that replay checking is supposed to happen after A-MPDU re-ordering. Tested by jmc@, benno@, solene@, and myself with the following drivers: athn(4), iwn(4), iwm(4), wpi(4), urtwn(4) ok solene@
2020-05-15Some newer bwfm(4) chips from Cypress hold their regulatoryPatrick Wildt
constraints in a separate blob, instead of in the firmware. This .clm_blob needs to be loaded as well.
2020-05-15Describe the purpose of add_entropy_words() in simpler terms.Theo de Raadt
2020-05-15The description of the enqueue_randomness() input parameter was crazy untrue.Theo de Raadt
2020-05-15Explain enqueue_randomness() better. It is the supply-entropy function,Theo de Raadt
and change wording from 'entropy queue', what we have is a ring which collects 'damage' from successive calls until drawn down
2020-05-15The long explanation for CRC stirring isn't helping. If anythingTheo de Raadt
it suggests we should reconsider this mechanism and do something simpler... delete the explanation for now.
2020-05-15The main comment block from 1996 has become highly inaccurate andTheo de Raadt
misleading, so rewrite it. The interesting parts are bootblock-seeding from file + hwrng, arc4random() being available incredibly early, and seperate timeouts to pull entropy data forward into a stir of the chacha state (one for entropy ring crc whitening into a buffer, the 2nd for buffer folding into the chacha) Now that it is better documented, I can try to improve each component.
2020-05-15remove unneccessary include filesTheo de Raadt
2020-05-15Fix wrong firmware API documentation comments for iwm(4) and iwx(4).Stefan Sperling
Both drivers currently use SCAN_CHANNEL_CFG_S_VER1, not VER2.
2020-05-15drm/amdgpu: Change VCE booting with firmware loaded by PSPJonathan Gray
From James Zhu aa5873dca46385454d36c3dca31d66d7b64574be in mainline linux prevents hang on boot with vega10_sos.bin firmware from linux-firmware 20200421 https://bugs.freedesktop.org/show_bug.cgi?id=110733
2020-05-15drm/amdgpu:change VEGA booting with firmware loaded by PSPJonathan Gray
From Feifei Xu bfcea5204287b0a09dac71fa56a5d066d94d9bb1 in mainline linux prevents hang on boot with vega10_sos.bin firmware from linux-firmware 20200421 https://bugs.freedesktop.org/show_bug.cgi?id=110733
2020-05-14The dwctwo(4) FDT glue is now identical on armv7 and arm64. Move it toMark Kettenis
/dev/fdt. ok patrick@, visa@
2020-05-14Bring back the acpi(4) changes. This time around only use the ACPI _CRSMark Kettenis
information on ACPI 5.0 and later. ok krw@, patrick@
2020-05-13sdhc(4), sdmmc(4): tsleep(9) -> tsleep_nsec(9); ok patrick@cheloha
2020-05-13Use seltrue_kqfilter() instead of hand-rolling it in multiple drivers.Martin Pieuchot
ok visa@
2020-05-12Set timeout(9) to refill the receive ring descriptors if the amount ofjan
descriptors runs below the low watermark. The em(4) firmware seems not to work properly with just a few descriptors in the receive ring. Thus, we use the low water mark as an indicator instead of zero descriptors, which causes deadlocks. ok kettenis@
2020-05-11More accurate remaining power reporting with disparate batteriesJeremie Courreges-Anglas
Overall remaining power was computed as the average of the remaining power of each battery, in percents. This doesn't work with batteries of different capacity, so use the total capacity and remaining power instead. Reported by lidstah, successful tests by lidstah and benno@, ok kettenis@
2020-05-11drm/atomic: Take the atomic toys away from XJonathan Gray
From Daniel Vetter 7c9af5cd6a7df58f47eac607cc5ab770d808ba82 in linux 4.19.y/4.19.122 26b1d3b527e7bf3e24b814d617866ac5199ce68d in mainline linux
2020-05-11drm/amdgpu: Fix oops when pp_funcs is unset in ACPI eventJonathan Gray
From Aaron Ma 74edc32fda52b684a9af99dd65aa7745a170a18d in linux 4.19.y/4.19.122 5932d260a8d85a103bd6c504fbb85ff58b156bf9 in mainline linux
2020-05-11drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay ↵Jonathan Gray
table v0 (e.g Hawaii) From Sandeep Raghuraman 65d5ea5f20f76ecedcc470df45fe0d92146f8e8e in linux 4.19.y/4.19.122 bbc25dadc7ed19f9d6b2e30980f0eb4c741bb8bf in mainline linux
2020-05-11drm/edid: Fix off-by-one in DispID DTD pixel clockJonathan Gray
From Ville Syrjala 85b1efa12a7fa209e0e3e254d6ea466c8ec3d083 in linux 4.19.y/4.19.121 6292b8efe32e6be408af364132f09572aed14382 in mainline linux
2020-05-10Fix two out-of-bounds array accesses in ioctl code pats. One found byMark Kettenis
johnc@armadilloaerospace.com and another one spotted by matthieu@. ok benno@, matthieu@, deraadt@
2020-05-09aml_die() doesn't return, hint the compilerJeremie Courreges-Anglas
Avoids an uninitialized variable warning. ok kettenis@
2020-05-09Use MSI-X interrupts where available. The first vector is used forJonathan Matthew
events and command completions as that's the only vector they can go to. tx/rx queues are mapped to subsequent vectors. ok mpi@ dlg@
2020-05-09No need to look at _STA here, all we care about is _PSR.Jeremie Courreges-Anglas
Rename surrounding code to reflect that. ok kettenis@
2020-05-08Move parsing of _CRS into acpi(4) and pass the parsed address and interruptMark Kettenis
information in struct acpi_attach_args. ok mpi@
2020-05-05Revert parts of CVS commit Jdqd26bn9Ev6aFMc ("Fix processing of compressedStefan Sperling
block ack notifications sent by iwn(4) firmware"). This effectively reverts changes in how the driver interacts with firmware and fixes connections getting stuck for unknown reasons, in two known cases: One with an Airport Extreme 6th gen AP and another with a b-box 3V+ modem using a Sagemcom MAC address for its built-in AP. The Sagemcom case was observed by myself. The Airport case was reported by Jeremy O'Brien via abieber@. I am committing this now to prevent the problem from affecting 6.7 release even though we don't yet understand what caused the problem. ok mpi@
2020-05-04Remove redundant code testing if a terminal is a usb stream.Alexandre Ratchov
Fixes coverity CID 1492830. ok sthen, deraadt
2020-05-04Check v6 availablilty mask instead of v4.Gerhard Roth
go for it deraadt@
2020-05-01Prevent divide-by-zero in MiRA which I managed to trigger with iwn(4).Stefan Sperling
ok deraadt@
2020-04-30If there's only one input (output) name it simply "input" ("output")Alexandre Ratchov
Besides making things simpler, this allows libsndio to figure out that this is a control affecting all inputs (outputs) that needs to be exposed.
2020-04-30Fix return value of dma_fence_wait(). Seems to fix occasionalMark Kettenis
synchroniation problems when playing youtube videos in chrome. ok jsg@
2020-04-30Use "inputs" class instead of "record"Alexandre Ratchov
There's no reliable way to decide whether a control must belong to "inputs" or to "record". In other words both classes were used for the same thing. Furthermore we've no "play" class which tends to make things more confusing.
2020-04-30Use "dac" instead of "play" in mixer control namesAlexandre Ratchov
All other drivers use "dac" and libsndio needs the control name to be "dac" for the control to be exposed.
2020-04-30Set terminal and clock names after all units are parsedAlexandre Ratchov
Makes the code simpler and more flexible as the naming is done in a single place where the full units list is available.
2020-04-30Use macros instead of hardcoded "play" and "record" string constantsAlexandre Ratchov
No object change.
2020-04-30Fix use of uninitialized 'wh' variable in error path of ar5008_rx_process().Stefan Sperling
This fix simplifies HW decrytion error checking: Frame header contents aren't relevant because we are going to drop frames that had errors in any case. I made a mistake by trying to add an exception for multicast frames at this point. Frame header contents might not even be valid. This problem was introduced with CCMP hardware offload support and detected by Coverity (CID 1492755). ok mestre@ kevlo@
2020-04-30drm/amd/display: Not doing optimize bandwidth if flip pending.Jonathan Gray
From Yongqiang Sun de32c6ad7a4fcb986e0e4f39d7497948b734b8c7 in linux 4.19.y/4.19.119 9941b8129030c9202aaf39114477a0e58c0d6ffc in mainline linux