summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2020-03-25Grab the NET_LOCK() before calling pipex_iface_stop().Martin Pieuchot
This function calls pipex_destroy_session() which requires the lock and pipex_ioctl() already calls it with the NET_LOCK() held. From Vitaliy Makkoveev.
2020-03-25Indicate that the case handling data underruns falls through to the caseJonathan Matthew
handling overruns and normal completions. CID 1452878.
2020-03-24Use FALLTHROUGH in uvm_total() like it is done in uvm_loadav().Martin Pieuchot
CID 1453262.
2020-03-24Kill some dead code that tests bits immediately after setting them.Kenneth R Westerback
CID 1452873
2020-03-24Remove redundant 'NULL' check for 'rtm'.tobhe
CID 1453252 ok claudio@ mpi@
2020-03-24Backout the rename, it was more confusing then helpful.anton
2020-03-24Put MSI-X stuff under !SMALL_KERNEL to reduce the growth for i386 floppy.Martin Pieuchot
2020-03-24Remove a chatty debug printf (not enabled by default) in wskbdopen() andanton
wsmouseopen(); bringing them closer to wsmuxopen(). No functional change.
2020-03-24Rename wsmousedoioctl() -> wmouse_do_ioctl() and follow the sameanton
convention for the open routine. This increases the consistency between wskbd, wsmouse and wsmux.
2020-03-24Ensure that me_evp is still NULL before assignment during open of wsconsanton
devices. This condition is checked early on during open but since the same routine could end up sleeping before assigning me_evp, a race against adding the same wscons device to a wsmux could be lost. This in turn can cause a NULL deference during close. ok mpi@ Reported-by: syzbot+34c3041bfd96c888c8bd@syzkaller.appspotmail.com
2020-03-24cope with growth, sighTheo de Raadt
2020-03-23UART 1-3 support for Allwinner H3 (maybe H5/H2+).SASANO Takayoshi
- add reset signal definition - add reset signal de-assert code ok kettenis@
2020-03-23If samples per frame is larger than the device usb packet size,Alexander Bluhm
fail early in uaudio(4). This prevents negative safe_blksz and integer overflow in nframes_max in case of a bad call to uaudio_stream_open() or a hardware bug. OK ratchov@
2020-03-23Check the outcome of ktrstart() and skip tracing if the trace fileVisa Hankala
header could not be written. OK anton@ mpi@
2020-03-23Prevent tsleep(9) with PCATCH from returning immediately without errorVisa Hankala
when called during execve(2). This was a caused by initializing sls_sig with value 0 in r1.164 of kern_synch.c. Previously, tsleep(9) returned immediately with EINTR in similar circumstances. The immediate return without error can cause a system hang. For example, vwaitforio() could end up spinning if called during execve(2) because the thread did not enter sleep and other threads were not able to finish the I/O. tsleep vwaitforio nfs_flush nfs_close VOP_CLOSE vn_closefile fdrop closef fdcloseexec sys_execve Fix the issue by checking (p->p_flag & P_SUSPSINGLE) instead of (p->p_p->ps_single != NULL) in sleep_setup_signal(). The former is more selective than the latter and allows the thread that invokes execve(2) enter sleep normally. Bug report, change bisecting and testing help by Pavel Korovin OK claudio@ mpi@
2020-03-23Make it possible to use em(4) with MSI-X, currently disabled by default.Martin Pieuchot
The current implementation still uses a single queue but already establishes a different handler for link interrupts. This is done in preparation for multi-queues support. Based on a bigger diff from haesbaert@ and on the FreeBSD code. Tested by Hrvoje Popovski and jmatthew@, ok jmatthew@
2020-03-23Make it possible to use ix(4) with MSI-X, currently disabled by default.Martin Pieuchot
The current implementation still uses a single queue but already establishes a different handler for link interrupts. This is done in preparation for multi-queues support. Based on a bigger diff from haesbaert@ and on the FreeBSD code. Tested by Hrvoje Popovski and jmatthew@, ok jmatthew@
2020-03-23If an USB audio device supports less rates for recording than forAlexander Bluhm
playing, the uaudio(4) driver selected a wrong rate. Then recording failed with "block size too large". The v1_rates field of the parameters contains the correct intersection of valid rates. Use it for v1 devices. OK ratchov@
2020-03-23Fix brightness control on machines where initial brigness unknown.Alexandre Ratchov
On certain machines (like the ASUS 1001PXD) _BQC returns an out of range value. Make acpivout_get_brightness() always return a valid value in order to not break brightness controls, like the display.brightness control in wsconsctl(8). ok patrick
2020-03-22remove unused variable; ok beck@ mpi@anton
2020-03-22Mark omissions of break statements as intentional.Ulf Brosziewski
CID 1453207 (Missing break in switch)
2020-03-22Implement WSDISPLAYIO GET/SET ioctls in rkdrm. This allows backlight ↵Brandon Mercer
controls on the pinebook pro through wsconsctl. Thanks, Mark. ok kettenis@, patrick@
2020-03-22Make efi_device_path_depth() return the full device path depth if we don'tMark Kettenis
find a media device path node. Fixes booting OpenBSD on some older U-Boot versions that are in wide circulation such as 2017.09 and 2017.11. ok patrick@
2020-03-22Don't allocate a framebuffer if no interface ports have been configured.Mark Kettenis
ok patrick@
2020-03-22zap trailing whitespaceanton
2020-03-21The #pwm-cells attribute describes the amount of flags in additionPatrick Wildt
to the phandle, so adjust the check to be more inclusive. ok kettenis@
2020-03-21Simplify some goto'ing that jumps a single line orKenneth R Westerback
does nothing at all. The first one spotted as CID 1452976. Reads good to millert@ ok mpi@
2020-03-21r1.244 introduced rt_hash() with careful checks of src for NULL atKenneth R Westerback
each dereference. r1.275 added a check at the top of the function, with an immediate "return (-1)" if src == NULL. Thus making the repeated checks in the body superfluous. CID 1452932. ok millert@ mpi@
2020-03-21Fix crash when no device ports have been registered. Remove unused variableMark Kettenis
while I'm there. ok patrick@
2020-03-21Teach i386 boot98) and friends about ffs2. fdboot(8) is the exception:Otto Moerbeek
ffs2 support does not fit there. But the the kernel loaded by the floppy ramdisk does support ffs2.
2020-03-21Add clock support for i.MX8MM. The CCM is based on the i.MX8MQ version,Patrick Wildt
so we can re-use the same mechanisms. It's not the same though, which means that some code is duplicated. There's some room for refactoring. The PLLs, on the other hand, work quite differently. This allows most of our supported peripherals to work, including clock frequency scaling. Feedback from and ok kettenis@
2020-03-21Instead of passing the flags as part of a struct that's supposed to bePatrick Wildt
filled by the callee, change the usb_allocmem() API to take another argument for the flags. ok mpi@
2020-03-21drm/amd/display: remove duplicated assignment to grph_obj_typeJonathan Gray
From Colin Ian King bef7177cefad180b9776ed49290d42bfb873da1e in linux 4.19.y/4.19.111 d785476c608c621b345dd9396e8b21e90375cb0e in mainline linux
2020-03-21Stop tracing if vget(9) fails.Martin Pieuchot
Make sure to release the last reference of the vnode after all other traced processes have given up on it. CID 1453020 Unchecked return value. Inputs from guenther@, ok visa@
2020-03-20pccbb.c: tsleep(9) -> tsleep_nsec(9), timeout_add(9) -> timeout_add_nsec(9)cheloha
Straightforward ticks -> milliseconds conversions.
2020-03-20The i.MX8MQ 32K clock is always on.Patrick Wildt
2020-03-20futex(2): futex_wait(): ensure timeout is set when calling rwsleep_nsec(9)cheloha
rwsleep_nsec(9) will not set a timeout if the nsecs parameter is equal to INFSLP (UINT64_MAX). We need to limit the duration to MAXTSLP (UINT64_MAX - 1) to ensure a timeout is set.
2020-03-20__thrsleep(2): ensure timeout is set when calling tsleep_nsec(9)cheloha
tsleep_nsec(9) will not set a timeout if the nsecs parameter is equal to INFSLP (UINT64_MAX). We need to limit the duration to MAXTSLP (UINT64_MAX - 1) to ensure a timeout is set.
2020-03-20Disable apm(4) on the floppy ramdisk and keep the cd one in sync.Otto Moerbeek
This allows FFS2 to be enabled. Has been in snaps for quite some days. With and ok deraadt@
2020-03-20Declare pci_intr_map_msix() as static inline instead of using a define.Martin Pieuchot
This makes compiler no longer complain about unused variables. ok kettenis@, patrick@
2020-03-20Add bdpmic(4), a driver for the ROHM BD71837 and BD71847 PowerPatrick Wildt
Management IC. For now this only allows reading and changing the BD71847's BUCK2 voltage regulator, as used on the i.MX8MM EVK, to allow CPU frequency scaling. ok kettenis@
2020-03-20Add bdpmic(4), a driver for the ROHM BD71837 and BD71847 PowerPatrick Wildt
Management IC. For now this only allows reading and changing the BD71847's BUCK2 voltage regulator, as used on the i.MX8MM EVK, to allow CPU frequency scaling. ok kettenis@
2020-03-20Both i.MX8MM and i.MX8MQ use the same uSDHC as the i.MX7D, andPatrick Wildt
thus also use the same compatible. So replace the i.MX8MQ check with one for the i.MX7D to catch them all. ok kettenis@
2020-03-20Add support for reading the i.MX8MM temperature sensors.Patrick Wildt
ok kettenis@
2020-03-20Use atomic operations to update ps_singlecount. This makesClaudio Jeker
single_thread_check() safe to be called without KERNEL_LOCK(). single_thread_wait() needs to use sleep_setup() and sleep_finish() instead of tsleep() to make sure no wakeup() is lost. Input kettenis@, with and OK visa@
2020-03-20__thrsleep(2): fix absolute timeout checkcheloha
An absolute timeout T elapses when the clock has reached time T, i.e. when T is less than or equal to the clock's current time. But the current code thinks T elapses only when the clock is strictly greater than T. For example, if my absolute timeout is 1.00000000, the current code will not return EWOULDBLOCK until the clock reaches 1.00000001. This is wrong: my absolute timeout elapses a nanosecond prior to that point. So the timespeccmp(3) here should be timespeccmp(tsp, &now, <=) and not timespeccmp(tsp, &now, <) as it is currently.
2020-03-20kevent(2): tsleep(9) -> tsleep_nsec(9)cheloha
With input from visa@. ok visa@
2020-03-20poll(2), ppoll(2), pselect(2), select(2): tsleep(9) -> tsleep_nsec(9)cheloha
With input from visa@. ok visa@
2020-03-20nanosleep(2): tsleep(9) -> tsleep_nsec(9)cheloha
While here, rename the wait channel so the tsleep_nsec(9) call will fit onto a single line. It isn't a global channel so the name is arbitrary anyway. With input from visa@. ok visa@
2020-03-20tsleep_nsec(9): add MAXTSLP macro, the maximum sleep durationcheloha
This macro will be useful for truncating durations below INFSLP (UINT64_MAX) when converting from a timespec or timeval to a count of nanoseconds before calling tsleep_nsec(9), msleep_nsec(9), or rwsleep_nsec(9). A relative timespec can hold many more nanoseconds than a uint64_t can. TIMESPEC_TO_NSEC() and TIMEVAL_TO_NSEC() check for overflow, returning UINT64_MAX if the conversion would overflow a uint64_t. Thus, MAXTSLP will make it easy to avoid inadvertently passing INFSLP to tsleep_nsec(9) et al. when the caller intended to set a timeout. The code in such a case might look something like this: uint64_t nsecs = MIN(TIMESPEC_TO_NSEC(&ts), MAXTSLP); The macro may also be useful for rejecting intervals that are "too large", e.g. for sockets with timeouts, if the timeout duration is to be stored as a uint64_t in an object in the kernel. The code in such a case might look something like this: case SIOCTIMEOUT: { struct timeval *tv = (struct timeval *)data; uint64_t nsecs; if (tv->tv_sec < 0 || !timerisvalid(tv)) return EINVAL; nsecs = TIMEVAL_TO_NSEC(tv); if (nsecs > MAXTSLP) return EOVERFLOW; obj.timeout = nsecs; break; } Idea suggested by visa@. ok visa@