FreeBSD/src 8878417sys/cam/ctl scsi_ctl.c

ctl: Use CAM_PRIORITY_NORMAL for queued CCBs

Previously this was using CAM_PRIORITY_NONE which tripped over the
assertion added in b4b166b8c46b8.

PR:             293076
Reported by:    Ken J. Thomson <thomsonk at yandex.com>
Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56995
DeltaFile
+5-3sys/cam/ctl/scsi_ctl.c
+5-31 files

FreeBSD/src d1a8fa2usr.sbin/ctld ctld.cc ctld.hh

ctld: Only check physical port linking in a single configuration context

Commit 969876fcee57 moved struct pport from being per-configuration to
being a "global" object shared across multiple configurations.  As a
result, the check for duplicate ports actually spanned across
configurations, such that reloading a configuration would now think
that existing physical ports were already linked.

The linking field in pport added in the C++-ification (commit
6acc7afa34aa) faithfully replicated this bug (albeit simpler as I had
noticed that the TAILQ links weren't used after the earlier commit).

To restore the desired behavior, remove the linking field from struct
pport entirely and use a local unordered_map in conf::add_pports which
tracks if a given pport is claimed by more than one target.

PR:             293076
Reported by:    Ken J. Thomson <thomsonk at yandex.com>
Fixes:          969876fcee57 ("ctld: parse config file independently of getting kernel info")

    [2 lines not shown]
DeltaFile
+7-5usr.sbin/ctld/ctld.cc
+0-4usr.sbin/ctld/ctld.hh
+7-92 files

FreeBSD/src caef3c5usr.sbin/ctld ctld.cc kernel.cc

ctld: Refactor ioctl port handling

- Normalize ioctl port names when the port name is first added to
  the configuration.  This can catch potential duplicate port names
  sooner and helps with other parts of this change.

- When recognizing existing ioctl ports, always expand the name to
  include the physical and virtual port numbers.  This permits binding
  ioctl/0/0 or ioctl/1/0 to a target, for example.

- When adding physical ports to a target, first check for an existing
  kernel port to reuse.  This handles both ioctl and non-ioctl ports
  and removes the need for the conf::add_port method for ioctl ports
  to check in kports.

- If an existing kport isn't found when adding physical ports, check
  to see if the port name is an ioctl port.  If so, call conf::add_port
  to add an ioctl port.  This add_port method overload is now simpler
  as it always creates a new port.

    [9 lines not shown]
DeltaFile
+49-31usr.sbin/ctld/ctld.cc
+4-1usr.sbin/ctld/kernel.cc
+1-1usr.sbin/ctld/ctld.hh
+54-333 files

FreeBSD/src 7a436d3usr.sbin/ctld kernel.cc

ctld: Don't ignore pp/vp values of kernel ports with pp == 0 but vp != 0

Fixes:          c6f1e9b8a412 ("ctld: Simplify XML parsing memory management")
Sponsored by:   Chelsio Communications
DeltaFile
+1-1usr.sbin/ctld/kernel.cc
+1-11 files

FreeBSD/src 40c846dsys/dev/uart uart_dev_ns8250.c uart_dev_pl011.c

uart: Tidy the compat tables

No functional change intended.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    royger
Differential Revision:  https://reviews.freebsd.org/D57269
DeltaFile
+22-22sys/dev/uart/uart_dev_ns8250.c
+15-15sys/dev/uart/uart_dev_pl011.c
+37-372 files

FreeBSD/src ccda002sys/arm64/rockchip rk_gpio.c

rk_gpio: implement PIC masking methods and mask unhandled IRQs

The Rockchip GPIO controller implements PIC operations for the INTRNG
framework but is missing four masking methods that INTRNG calls during
the filter/ithread handoff: pic_disable_intr, pic_enable_intr,
pic_pre_ithread, pic_post_ithread.

Without them, level-sensitive interrupt sources connected to a
Rockchip GPIO pin re-fire continuously while their ithread runs.  On
a RockPro64 with a FUSB302B Type-C controller (i2c) attached to
gpio1 INT_N, the system enters a ~210 kHz interrupt storm the moment
the fusb302 driver attaches and INT_N goes low.

Two complementary changes:

1. Add the four pic_disable_intr/pic_enable_intr/pic_pre_ithread/
   pic_post_ithread method bodies.  Each toggles the pin's
   RK_GPIO_INTMASK bit so the source is masked during the in-flight
   ithread window and unmasked on return, honouring the generic

    [17 lines not shown]
DeltaFile
+100-6sys/arm64/rockchip/rk_gpio.c
+100-61 files

FreeBSD/src d1488cdsys/arm/broadcom/bcm2835 bcm2835_sdhci.c

bcm2835_sdhci: Clean up DMA resources on attach failure

bcm_sdhci_attach() allocates a DMA channel with bcm_dma_allocate()
before creating the bus_dma tag and map.  If a later initialization
step fails, the common error path releases the interrupt and memory
resources, but leaves the DMA channel allocated.

Call bcm_dma_free() for cleanup, as it already performs the required
internal checks and can therefore be invoked directly.

Signed-off-by:  Haoxiang Li <lihaoxiang at isrc.iscas.ac.cn>
Reviewed by:    mhorne
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2241
DeltaFile
+1-0sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
+1-01 files

FreeBSD/src 6880405usr.bin/cap_mkdb cap_mkdb.c

cap_mkdb: Fix memory leak

This is not a big deal since it only iterates once before exiting, but
that's no reason to set a bad example.

PR:             195128
MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D57251
DeltaFile
+2-1usr.bin/cap_mkdb/cap_mkdb.c
+2-11 files

FreeBSD/src f2a89e7sys/sys resource.h, usr.bin/limits limits.c

limits: Improve consistency

Historical precedent seems pretty consistent: size limits have singular
names, number limits have plural names.  RLIMIT_VMM broke this, and I
made matters worse by referring to this limit as “vmms” in limits(1).
Consistently use “vms” everywhere user-visible, while leaving the
question of whether or not to rename RLIMIT_VMM itself for another day.

Fixes:          1092ec8b3375 ("kern: Introduce RLIMIT_VMM")
Fixes:          53af2026f213 ("limits: Unbreak after RLIMIT_VMM addition")
Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D57265
DeltaFile
+1-1sys/sys/resource.h
+1-1usr.bin/limits/limits.c
+2-22 files

FreeBSD/src 773bbfcsys/dev/sound/pcm mixer.c mixer.h

sound: Update mixer.c LICENSE header

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+4-0sys/dev/sound/pcm/mixer.c
+4-0sys/dev/sound/pcm/mixer.h
+8-02 files

FreeBSD/src 5589a74sys/dev/sound/pcm mixer.c

sound: Retire snd_mixer->enuminfo

Instead of caching this when mix_setrecdevs() is called (which many
drivers never call), calculate it when we need it. After all, it is
quite rare that this structure is used by applications.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+23-55sys/dev/sound/pcm/mixer.c
+23-551 files

FreeBSD/src 6a3a42csys/dev/sound/pcm mixer.c mixer.h

sound: Retire unused mixer_get_lock()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+0-10sys/dev/sound/pcm/mixer.c
+0-1sys/dev/sound/pcm/mixer.h
+0-112 files

FreeBSD/src 7485519sys/dev/sound/pcm mixer.c

sound: Do not lock before destroying snd_mixer->lock

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+0-1sys/dev/sound/pcm/mixer.c
+0-11 files

FreeBSD/src 64ebbb1sys/dev/sound/pcm mixer.h mixer.c

sound: Retire MIXER_SIZE and use correct size in DEFINE_CLASS

I am not sure why this hack was needed, but the size should be
sizeof(struct snd_mixer). Unfortunately, we have to expose snd_mixer,
but it should be better than relying on a hack.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+24-8sys/dev/sound/pcm/mixer.h
+0-22sys/dev/sound/pcm/mixer.c
+24-302 files

FreeBSD/src 1e72608sys/arm/allwinner/a64 sun50i_a64_acodec.c, sys/arm64/rockchip rk3328_codec.c

sound: Remove all remaining uses of mixer_get_lock()

These functions are called from sound(4) through MIXER_SET() in
mixer_set(), but nothing mixer-related is used or needs to be locked in
these cases.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+0-17sys/dev/sound/macio/onyx.c
+0-17sys/dev/sound/macio/snapper.c
+0-17sys/dev/sound/macio/tumbler.c
+0-14sys/arm/allwinner/a64/sun50i_a64_acodec.c
+0-14sys/arm64/rockchip/rk3328_codec.c
+0-795 files

FreeBSD/src 8e804f3share/man/man4 pcm.4, sys/dev/sound/pcm mixer.c

sound: Retire unused hw.snd.vpc_mixer_bypass

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+0-9share/man/man4/pcm.4
+0-5sys/dev/sound/pcm/mixer.c
+0-142 files

FreeBSD/src 22730c4sys/dev/sound/pcm dsp.c mixer.h

sound: Remove unused "from" mixer_ioctl_cmd() argument

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+3-6sys/dev/sound/pcm/dsp.c
+1-4sys/dev/sound/pcm/mixer.h
+2-2sys/dev/sound/pcm/mixer.c
+6-123 files

FreeBSD/src e87654dsys/dev/sound/usb uaudio_pcm.c

snd_uaudio: Stop using mixer_get_lock()

There is no reason to lock snd_mixer->lock here, since the only thing we
are doing with snd_mixer is to call mix_getdevinfo() and mix_get_dev(),
which are one-line getters, which are needed to eventually call
uaudio_get_child_index_by_dev().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+2-23sys/dev/sound/usb/uaudio_pcm.c
+2-231 files

FreeBSD/src 9a00e0bsys/dev/sound/usb uaudio.c

snd_uaudio: Do not use snd_mixer->lock as mixer_lock

In similar fashion to c234740c9d34 ("snd_uaudio: Do not use
pcm_channel->lock to protect uaudio_chan"), stop this layering
violation, and introduce a snd_uaudio(4)-internal mixer_lock.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+11-20sys/dev/sound/usb/uaudio.c
+11-201 files

FreeBSD/src f61e65esys/dev/sound/pcm mixer.c

sound: Retire mixer_ioctl_channel()

This function never succeeds when it is not called from the same process
that has opened the file descriptor (e.g., mixer(8)). The reason is that
the CHN_FOREACH() loop tries to match the pid of each channel with the
pid of the process performing the ioctl, which will not be the same,
unless it's the same process that both opened the channel and performed
the ioctl.

In the case that the same process opens the channels and performs the
ioctl, however, we still do not need to worry, because mixer_ioctl_cmd()
essentially does the same thing anyway. Additionally, this scenario
should be quite rare, given that most applications do not open both
/dev/dsp* and /dev/mixer*, and in fact, it is actively encouraged by the
official OSSv4 specification not to do that.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+1-116sys/dev/sound/pcm/mixer.c
+1-1161 files

FreeBSD/src e8ea976sys/dev/sound/pcm mixer.c

sound: Retire M_MIXER

Even though harmless, it is not really useful, as there is essentially
only one allocation with M_MIXER.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
DeltaFile
+4-6sys/dev/sound/pcm/mixer.c
+4-61 files

FreeBSD/src 8b8dbc6usr.sbin/sndctl sndctl.c sndctl.8

sndctl(8): Implement EQ controls

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
DeltaFile
+41-0usr.sbin/sndctl/sndctl.c
+3-1usr.sbin/sndctl/sndctl.8
+44-12 files

FreeBSD/src 98a62ccshare/man/man4 pcm.4

pcm.4: Document dev.pcm.%d.eq*

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
DeltaFile
+11-0share/man/man4/pcm.4
+11-01 files

FreeBSD/src 3a3cb16sys/dev/sound/pcm feeder_eq.c

sound: Retire hint.pcm.%d.eq_preamp

It wasn't documented in the first place, but it is easier to just use
the sysctl.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
DeltaFile
+1-7sys/dev/sound/pcm/feeder_eq.c
+1-71 files

FreeBSD/src 6f130b2sys/dev/sound/pcm feeder_eq.c

sound: Remove dead EQ FEEDEQ_DISABLE code

If EQ is disabled, we never reach those code paths in the first place.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
DeltaFile
+0-16sys/dev/sound/pcm/feeder_eq.c
+0-161 files

FreeBSD/src dfa52e8sys/dev/sound/pcm feeder_eq.c

sound: Update feeder_eq.c LICENSE header

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
DeltaFile
+1-1sys/dev/sound/pcm/feeder_eq.c
+1-11 files

FreeBSD/src f5d6e5csys/dev/sound/pcm channel.c feeder_eq.c

sound: Retire FEEDEQ_DISABLE

We can do this more efficiently by just using the SD_F_EQ* flags. In
fact, the dev.pcm.%d.eq handler will (un)set SD_F_EQ_ENABLED and this is
what we actually test with when choosing to creating the EQ feeder or
not, so setting the state to FEEDEQ_DISABLE does not really an effect in
the first place.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
DeltaFile
+4-8sys/dev/sound/pcm/channel.c
+2-3sys/dev/sound/pcm/feeder_eq.c
+0-1sys/dev/sound/pcm/feeder.h
+6-123 files

FreeBSD/src a0011c7share/man/man4 pcm.4, sys/dev/sound/pcm mixer.c sound.h

sound: Expose EQ by default

The dev.pcm.%d.eq* sysctls and mixer "bass" and "treble" controls are
exposed only if hint.pcm.%d.eq is set. However, there is no good reason
why we shouldn't at least expose the controls, and let the user
enable/disable/bypass equalization through the sysctl.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
DeltaFile
+3-14sys/dev/sound/pcm/mixer.c
+0-9share/man/man4/pcm.4
+2-6sys/dev/sound/pcm/sound.h
+1-2sys/dev/sound/pcm/sound.c
+1-1sys/dev/sound/pcm/feeder_chain.c
+7-325 files

FreeBSD/src 88bc1d7sys/dev/sound/pcm feeder_eq.c channel.c

sound: Retire EQ states

The SD_F_EQ_ENABLED does the same thing, and is actually what we test
against in order to create the EQ feeder.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
DeltaFile
+2-23sys/dev/sound/pcm/feeder_eq.c
+0-3sys/dev/sound/pcm/channel.c
+0-3sys/dev/sound/pcm/feeder.h
+2-293 files

FreeBSD/src 54a03b4sys/dev/sound/pcm feeder_eq.c sound.h

sound: Retire FEEDEQ_BYPASS

In effect, this is the same as the disable state. There is a comment
that says the bypass state skips EQ altogether, which is what the
disable should be. The disable state according to the comment disables
EQ but keeps the EQ preamp (dev.pcm.%d.eq_preamp), however after testing
it seems that the preamp does not really take effect, because with EQ
disabled, feeder_eq is non existent, so we never execute any EQ code in
the first place.

Make things simpler and clearer and have 2 states; enable and disable,
and do what they should do intuitively.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
DeltaFile
+7-19sys/dev/sound/pcm/feeder_eq.c
+2-2sys/dev/sound/pcm/sound.h
+1-3sys/dev/sound/pcm/channel.c
+0-1sys/dev/sound/pcm/feeder.h
+10-254 files