summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2021-09-25Fix a possible race condition in spc_msgin().Kenji Aoyama
This comes from NetBSD:sys/dev/ic/mb89352.c fix by tsutsui: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/ic/mb89352.c.diff?r1=1.57&r2=1.58&f=h Tested on LUNA-88K2 by me.
2021-09-25Add $OpenBSD$ keyword and correct spelling.Kenji Aoyama
2021-09-25Add gpiocharger(4) for arm64Klemens Nanni
This driver provides support for battery chargers connected to GPIO pins, such as those found on the Pinebook Pro. OK kettenis
2021-09-25Add gpioleds(4) for arm64Klemens Nanni
This driver provides support for LEDs connected to GPIO pins, such as those found on the Pinebook Pro. OK kettenis
2021-09-24Reset the Tx timer when iwm(4) firmware sends a BA notification.Stefan Sperling
This prevents a bogus "device timeout" if firmware sends a IWM_BA_NOTIF instead of IWM_TX_CMD in order to let us know that a frame has been sent on a Tx aggregation queue. Such behaviour was observed on iwx(4), and there is reason to believe that iwm(4) might also be affected by this issue. Tested by Jean-Michel Bessot on 7265 via bugs@ where this change seems to prevent random device timeouts. Tested by myself on 8265 with no apparent behaviour change seen.
2021-09-24Fix two bugs in m88k fcmp{,u} emulation.Kenji Aoyama
- Use of goto will skip zeroing of 88110-specific comparison bits (bitn 12-17) in some cases. (Move their zeroing closer to the point of their computation.) - Computing of the "in interval" bits should not be performed when the S2 operand is negative. Spotted by Tetsuya Isaki (nono project), suggested diff and description from Miod Vallat. Tested on the real hardware by Isaki and me.
2021-09-24regenKevin Lo
2021-09-24Add support for SIMCom SIM7600.Kevin Lo
To issue AT commands (AT+CUSBPIDSWITCH=9003,1,1 and AT+CLANMODE=1) to change to MBIM mode. ok deraadt@
2021-09-23Reset the Tx timer when iwx(4) firmware sends a BA notification.Stefan Sperling
When multiple frames are sent in a batch on a Tx aggregation queue our current firmware version does not provide the IWX_TX_CMD notification. Older versions used to provide this (as observed on iwm(4) devices), but our current firmware only sends IWX_BA_NOTIF. This means we need to reset the Tx timer upon BA_NOTIF in order to avoid a bogus "device timeout" trigger from our watchdog handler. Do this as soon as the BA notification has been validated.
2021-09-23Revert ieee80211_proto.c r1.97 (cvs commit ID 8vKZsdvvkjTr5BG5).Stefan Sperling
My assumption that frames which are buffered on the power save queue were already encrypted was wrong. And the issue which this change intended to fix is still present (reported by Mikolaj Kucharski).
2021-09-23Add support for Tx aggregation to the iwx(4) driver.Stefan Sperling
Throughput goes up to 100 Mbit/s under ideal conditions. This is mostly working and stable, however rare occasional hangs may occur where the device stops giving us interrupts for reasons which are not yet understood. In such cases ifconfig down/up will recover the interface. Regardless, this code seems to be stable enough for remaining issues to be resolved in-tree. My working assumption is that the remaining issues were always present but only trigger under increased load when firmware is driven with Tx agg enabled. Feedback is welcome, especially if stability issues turn out to be worse than expected! As usual, please enable "ifconfig iwx0 debug" when reporting issues. Tests on ax200/ax201: myself, dv, hrvoje, Stefan Hagen, kevlo, Eric Auge, mlarkin, jmc, Mark Patruck Of which only me and jmc have reported seeing a small amount of hangs during continuous usage over about 2 weeks.
2021-09-23Add an ADDBA_OFFLOAD capability for wifi devices manage Tx block ackStefan Sperling
sessions entirely in firmware. This will be used by iwx(4).
2021-09-22enable POOL_DEBUG again.Sebastian Benoit
2021-09-22we are now working on 7.0-currentTheo de Raadt
2021-09-22Add a workaround for machines where the framebuffer size reported by theMark Kettenis
hardware is incorrect. In this case, make sure the amount of "stolen" memory is at least as large as the EFI framebuffer such that the driver doesn't use this memory until we've switched to the framebuffer allocated by the amdgpu(4) driver. Needs further investigation why the size reported by the hardware is incorrect. Tested by djm@ ok jsg@, deraadt@
2021-09-22Prevent ucc keyboards from changing the wsmux keyboard layout.Anton Lindqvist
ok deraadt@
2021-09-21During resume, also restore pins that we configured as GPIO interrupt pins.Mark Kettenis
Fixes issues with dead touchpads after resume on some machines. ok jcs@, deraadt@
2021-09-20Changing the encoding of a ucc keyboard doesn't make sense as only oneAnton Lindqvist
encoding is supported. Instead, silently ignore such requests. Gets rid of the following warning emitted by kbd(8) while booting with a ucc keyboard attached and /etc/kbdtype being present: kbd: unsupported encoding uk on /dev/wskbd2 I ended up repurposing KB_MACHDEP as is became unused back in 2008. Note that running a kernel with this commit applied requires kbd and wsconsctl to be recompiled in order to show correct encodings. Problem reported by landry@ and ok deraadt@
2021-09-20wire up bpf correctlyJonathan Matthew
ok dlg@ deraadt@
2021-09-20pci_mapreg_map() will assign an address to the BAR if it doesn't have oneJonathan Matthew
already, so we shouldn't refuse to attach in that case. noticed by kevlo@ on arm64 ok dlg@ deraadt@
2021-09-19disable pool debug for releaseSebastian Benoit
ok deraadt@
2021-09-19adjust dateTheo de Raadt
2021-09-19Unlock top part of the VM fault handler.Martin Pieuchot
This is possible now that pmap_extract() is serialized with pmap_remove(). ok sthen@, deraadt@
2021-09-18Work around a BIOS bug on Lenovo Thinkpads based on Intel's Tiger LakeMark Kettenis
platforms where the GPIO pin that is used for the touchpad interrupt gets reset when entering S3 and isn't properly restored upon resume. ok deraadt@, jcs@
2021-09-17Sync 1bpp initial palette setting with NetBSD/luna68k.Kenji Aoyama
Tested by me on 1bpp framebuffer got recently.
2021-09-16drm/amdgpu/acp: Make PM domain really workJonathan Gray
From Kai-Heng Feng 1f60072320b5f8071946e4b765cbf78a34d22a67 in linux 5.10.y/5.10.65 aff890288de2d818e4f83ec40c9315e2d735df07 in mainline linux
2021-09-15Change the errno to ENOTTY when encountering an unknown ioctl command asAnton Lindqvist
opposed of using EINVAL which is ambiguous in this context. ok deraadt@
2021-09-14Cleanup some style issues and remove some unused code. In particular,Mark Kettenis
remove the half-finished code to support the SV48 MMU page table layout. Currently there is no hardware that supports that model and I don't expect any hardware that does support it to show up anytime soon. ok mlarkin@
2021-09-14Cleanup some style issues.Mark Kettenis
ok mlarkin@
2021-09-14Make pmap_extract() mpsafe by grabbing the kernel lock for userland pmapsMark Kettenis
while walking the page tables. ok deraadt@
2021-09-14Make pmap_extract() mpsafe by grabbing the kernel lock for userland pmapsMark Kettenis
while walking the page tables. ok mpi@, deraadt@
2021-09-14Provide instruction cache invalidation through sysarch(RISCV_ICACHE_SYNC)Jeremie Courreges-Anglas
Modelled after the arm implementation. The first consumer would be __builtin___clear_cache() in libcompiler_rt. Input from kettenis@ and deraadt@, ok kettenis@
2021-09-14Add missing kernel lock for Bi-directional Forwarding Detection data.Vitaliy Makkoveev
Also bfdset() calls pool_get(9) with PR_WAITOK flag so it should be done before we check the existence of this `bfd', otherwise it could be added multiple times. We have BFD disabled in the default kernel so this diff is for consistency mostly. ok mpi@
2021-09-14Enable cy(4) on amd64.Jan Klemkow
ok deraadt
2021-09-13vmm(4): add limit to number of vcpusDave Voutila
After fixing previous syzbot issues related to lock contention, the reproducer code managed to hit an issue where it can exhaust kernel memory by allocating vcpus. Since each vcpu (regardless if it's SVM or VMX-capable) requires wiring some number of pages of memory, it was possible to starve other parts of the kernel. This change limits the total number of vcpus to 512, a conservative number given vmm(4) only supports single vcpu guests at the moment. ok mlarkin@
2021-09-13Remember to lock user pmap in pmap_extract()Visa Hankala
pmap_extract() has to lock user pmap to prevent concurrent pruning of the page table. The kernel pmap is exempt from this because it uses a fixed page table structure.
2021-09-13Consistently use unsigned long for CPU masks in pmap.c.Visa Hankala
2021-09-13Enable uaq(4) on amd64. Investigations into problems on other platformsJonathan Matthew
are ongoing.
2021-09-13take us out of betaTheo de Raadt
2021-09-12Revert recent uhidev report size changes. It's reported to break fido devicesAnton Lindqvist
for as of now unknown reasons.
2021-09-11Identify TPM2.0 devices and perform the 2.0-specific "suspend" commandTheo de Raadt
(researched by mlarkin). With this, and the latest BIOS which added S3, the lenovo x1r9 and x1nano can resume. ok kettenis mlarkin
2021-09-11Don't set the highspeed bit on bcm2835-sdhci sdhc(4) controllers.Marcus Glocker
Same approach as on Linux and NetBSD. This fixes bwfm(4) Wi-Fi on the Raspberry Pi 3 Model B Plus. help and ok kettenis@
2021-09-11Change the scope of the locking in pmap_extract() to prevent a race betweenMark Kettenis
walking the page tables and another thread calling pmap_remove() that ends up removing a page table page. tested by sthen@ ok deraadt@, mpi@
2021-09-11Zero out iwx(4) Tx descriptors of frames which are done.Stefan Sperling
This will hopefully prevent the device from ever writing to the former DMA address of a buffer which has been taken off the Tx ring. As far as I understand, the Linux driver unmaps (parts of) Tx descriptors that are done. We use a static DMA mapping for the entire descriptor array, so unmapping is not an option for us. Tested by several as part of my Tx aggregation support patch.
2021-09-11Fix a bug in iwx(4) Tx done interrupt processing.Stefan Sperling
Clear the byte-count for the correct frame while taking frames off the ring. This should fix some 'fatal firmware errors' seen under load, and prevent memory corruption: The device could access an mbuf we have freed, but which is still marked as used in the byte count table and which still has a DMA address in its Tx descriptor. Problem observed by mlarkin with NFS while testing my patch for Tx aggregation support.
2021-09-10Let iwx(4) resume directly in DVACT_WAKEUP instead of running the init task.Stefan Sperling
Suggested by deraadt@ during discussion at k2k21. With additional input from mlarkin. And deraadt spotted some pointless splnet() calls which this patch is removing. Resume from S3 tested by me on an x250 thinkpad with a compatible ax200 wifi card provided by mlarkin. Hibernate tested by deraadt. Sync comments about the PCI retry timeout workaround with Linux while here. ok mlarkin@
2021-09-10Minor KNF nit, align struct field.Anton Lindqvist
2021-09-10Instead of letting uhidev drivers get the report sizes, do it once inAnton Lindqvist
uhidev and pass the same sizes as part of the attach arguments. Makes the uhidev drivers a bit less repetitive. It might look tempting to let uhidev assign the sizes after a driver has attached, removing the need to repeat this logic in each driver. This does however not work since the input size must be known while calling uhidev_open() in order to open the interrupt pipe; and uhidev_open() is called from several attach routines. Note that this change only works and applies to when attaching to a single report ID. ok jcs@
2021-09-10Remove unused repsizes array.Anton Lindqvist
ok jcs@ as part of a larger diff
2021-09-09Adjust for DT binding changes. Add some temporary backwards compatibilityMark Kettenis
code to help making the transition. This will be removed in a few weeks.