OpenBSD cvs log

created 2020-11-19T18:18:18Z
begin 2020-06-11T00:00:00Z
end 2020-06-12T00:00:00Z
path src/sys
commits 21

date 2020-06-11T00:00:01Z
author dlg
files src/sys/kern/kern_sched.c log diff annotate
message get rid of a vestigial bit of the sbartq.

i should have removed the sbartq pointer in r1.47 when i removed
the sbartq.

date 2020-06-11T00:02:08Z
author patrick
files src/sys/dev/fdt/files.fdt log diff annotate
src/sys/dev/fdt/rkiis.c log diff annotate
message Add rkiis(4), a driver for the I2S controller found on the Rockchip
RK3399.

Driver written by Jared McNeill at NetBSD
ok kettenis@

date 2020-06-11T00:04:28Z
author patrick
files src/sys/dev/fdt/es8316ac.c log diff annotate
src/sys/dev/fdt/files.fdt log diff annotate
message Add escodec(4), a driver for the Everest ES8316 audio codec,
which is used on the Pinebook Pro.

Driver written by Jared McNeill at NetBSD
ok kettenis@

date 2020-06-11T00:05:55Z
author patrick
files src/sys/arch/arm64/conf/GENERIC log diff annotate
message Enable simpleamp(4), simpleaudio(4), rkiis(4) and escodec(4).

ok kettenis@

date 2020-06-11T00:07:34Z
author patrick
files src/sys/dev/fdt/rkclock.c log diff annotate
src/sys/dev/fdt/rkclock_clocks.h log diff annotate
message Add RK3399 audio clocks.

ok kettenis@

date 2020-06-11T00:56:12Z
author jmatthew
files src/sys/dev/ic/r92creg.h log diff annotate
src/sys/dev/ic/rtwn.c log diff annotate
src/sys/dev/usb/if_urtwn.c log diff annotate
message Make use of hardware crypto for CCMP. The tricky bits had been lying
dormant in the driver for years, we just needed to insert the IV before
transmission and do packet number checks on received frames.

tested by kevlo@ solene@ benno@ and me on a variety of hardware
ok kevlo@ stsp@

date 2020-06-11T06:03:54Z
author dlg
files src/sys/kern/kern_task.c log diff annotate
message make taskq_barrier wait for pending tasks, not just the running tasks.

I wrote taskq_barrier with the behaviour described in the manpage:

taskq_barrier() guarantees that any task that was running on the tq taskq
when the barrier was called has finished by the time the barrier returns.

Note that it talks about the currently running task, not pending tasks.

It just so happens that the original implementation just used task_add
to put a condvar on the list and waited for it to run. Because task_add
uses TAILQ_INSERT_TAIL, you ended up waiting for all pending to work to
run too, not just the currently running task.

The new implementation took advantage of already holding the lock and
used TAILQ_INSERT_HEAD to put the barrier work at the front of the queue
so it would run next, which is closer to the stated behaviour.

Using the tail insert here restores the previous accidental behaviour.

jsg@ points out the following:

> The linux functions like flush_workqueue() we use this for in drm want
> to wait on all scheduled work not just currently running.
>
> ie a comment from one of the linux functions:
>
> /**
> * flush_workqueue - ensure that any scheduled work has run to completion.
> * @wq: workqueue to flush
> *
> * This function sleeps until all work items which were queued on entry
> * have finished execution, but it is not livelocked by new incoming ones.
> */
>
> our implementation of this in drm is
>
> void
> flush_workqueue(struct workqueue_struct *wq)
> {
> if (cold)
> return;
>
> taskq_barrier((struct taskq *)wq);
> }

I don't think it's worth complicating the taskq API, so I'm just
going to make taskq_barrier wait for pending work too.

tested by tb@
ok jsg@

date 2020-06-11T06:06:55Z
author dlg
files src/sys/kern/kern_task.c log diff annotate
message whitespace and speeling fix in a comment. no functional change.

date 2020-06-11T08:17:32Z
author stsp
files src/sys/dev/pci/if_iwx.c log diff annotate
src/sys/dev/pci/if_iwxreg.h log diff annotate
src/sys/dev/pci/if_iwxvar.h log diff annotate
message Use the NVM_GET_INFO command in iwx(4) instead of the manual NVM data
parser inherited from iwm(4).

The old parsing code is merely disabled for now and will be deleted later.
Deleting the old code at the same time would result in a very untidy diff.

Tested by jcs@, sven falempin, and myself.

date 2020-06-11T08:18:24Z
author stsp
files src/sys/dev/pci/if_iwx.c log diff annotate
src/sys/dev/pci/if_iwxreg.h log diff annotate
message Add initial support for regulatory domain updates in iwx(4).

iwx(4) devices have a hardware component (the "communications hub")
that can detect which country it is running in. The firmware will
then inform the driver about the auto-detected regulatory domain.

For now, just print a message which shows the detected regulatory domain
if 'ifconfig iwx0 debug' is enabled. It is up to the driver whether it
wants to react to regulatory domain updates.

Tested by jcs@, sven falempin, and myself.

date 2020-06-11T08:19:17Z
author stsp
files src/sys/dev/pci/if_iwx.c log diff annotate
message Load iwx(4) firmware just once.

On iwx(4) devices there is no two-step firmware loading process with an
INIT and RT image, as was the case with iwn(4) and iwm(4).

Loading the image twice leaves firmware in a semi-operational state with
problems such as fatal firmware errors and missing regulatory domain
update notifications.

Tested by jcs@, sven falempin, and myself.

ok patrick@

date 2020-06-11T08:20:33Z
author stsp
files src/sys/dev/pci/if_iwxreg.h log diff annotate
message Increase iwx(4) command queue size. Otherwise the firmware sends duplicate
"command done" notifications for earlier commands and then crashes.

There might be an underlying issue that we still need to figure out. But as
of this change the device becomes functional with -48 firmware, which is a
good first step towards switching to -48 firmware eventually.

Tested by jcs@, sven falempin, and myself.

ok patrick@

date 2020-06-11T08:30:03Z
author stsp
files src/sys/dev/pci/if_iwx.c log diff annotate
message Make iwx(4) update the Tx ring byte count table.

With iwn(4) and iwm(4) this was only required for Tx aggregation, which
we don't use yet in iwx(4). But it looks like iwx(4) firmware will run
into fatal errors if we neglect to update this table. The Linux iwlwifi
driver always updates this table so firmware could be relying on it.

Tested by jcs@, sven falempin, and myself.

date 2020-06-11T09:06:29Z
author mpi
files src/sys/kern/spec_vnops.c log diff annotate
src/sys/kern/tty_tty.c log diff annotate
message Make spec_kqfilter() and cttykqfilter() behave like their corresponding
poll handler if the EV_OLDAPI flag is set.

ok visa@

date 2020-06-11T09:18:43Z
author mpi
files src/sys/isofs/cd9660/cd9660_vnops.c log diff annotate
src/sys/kern/kern_event.c log diff annotate
src/sys/kern/spec_vnops.c log diff annotate
src/sys/kern/tty_tty.c log diff annotate
src/sys/miscfs/fuse/fuse_vnops.c log diff annotate
src/sys/msdosfs/msdosfs_vnops.c log diff annotate
src/sys/nfs/nfs_kq.c log diff annotate
src/sys/sys/event.h log diff annotate
src/sys/tmpfs/tmpfs_vnops.c log diff annotate
src/sys/ufs/ufs/ufs_vnops.c log diff annotate
message Rename poll-compatibility flag to better reflect what it is.

While here prefix kernel-only EV flags with two underbars.

Suggested by kettenis@, ok visa@

date 2020-06-11T11:27:44Z
author stsp
files src/sys/dev/pci/if_iwm.c log diff annotate
src/sys/dev/pci/if_iwn.c log diff annotate
src/sys/dev/pci/if_iwx.c log diff annotate
message In iwn(4), iwm(4), and iwx(4), don't set the interface's MAC address again
while building a scan command for the firmware. This isn't the right place
to set our address, which has already been set during driver initialization.

ok mpi@ kettenis@

date 2020-06-11T11:28:12Z
author jsg
files src/sys/dev/pci/drm/include/linux/scatterlist.h log diff annotate
message handle sg_set_page() with NULL page argument

should fix problem reported by Laurence Tratt on bugs@
tweak and ok kettenis@

date 2020-06-11T13:23:18Z
author visa
files src/sys/kern/kern_descrip.c log diff annotate
message Move FRELE() outside fdplock in dup*(2) code. This avoids a potential
lock order issue with the file close path.

The FRELE() can trigger the close path during dup*(2) if another thread
manages to close the file descriptor simultaneously. This race is
possible because the file reference is taken before the file descriptor
table is locked for write access.

Vitaliy Makkoveev agrees
OK anton@ mpi@

date 2020-06-11T16:00:10Z
author ratchov
files src/sys/dev/usb/uaudio.c log diff annotate
message When detaching uaudio, wait for device ref counter to drop to 0

To maintain the correct refs count, blocking calls to uaudio are
wrapped in usbd_ref_incr() and usbd_ref_decr() calls.

suggested by mpi@ and ok visa@

date 2020-06-11T18:13:53Z
author kettenis
files src/sys/arch/arm64/dev/acpipci.c log diff annotate
message Fix small bug in parsing the IORT tables. Mapping entries specify the number
of IDs in a range minus one.

ok patrick@

date 2020-06-11T23:11:26Z
author dlg
files src/sys/dev/pci/if_mcx.c log diff annotate
message wrap some long lines. no functional change.