git: aaf0a7302d10 - main - sdhci: Use bus_topo_lock and taskqueue_bus for hotplug events
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aaf0a7302d10912e62dcd8e047798b4a2aefa039 commit aaf0a7302d10912e62dcd8e047798b4a2aefa039 Author: John Baldwin AuthorDate: 2025-03-10 17:33:49 + Commit: John Baldwin CommitDate: 2025-03-10 17:33:49 + sdhci: Use bus_topo_lock and taskqueue_bus for hotplug events Drop SDHCI_LOCK and instead acquire bus_topo_lock when adding and removing new-bus devices. Reviewed by:imp Differential Revision: https://reviews.freebsd.org/D49271 --- sys/dev/sdhci/sdhci.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 0be20e7aa523..2f79d3099f47 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -700,12 +700,14 @@ sdhci_card_task(void *arg, int pending __unused) mmccam_start_discovery(slot->sim); SDHCI_UNLOCK(slot); #else - d = slot->dev = device_add_child(slot->bus, "mmc", DEVICE_UNIT_ANY); SDHCI_UNLOCK(slot); + bus_topo_lock(); + d = slot->dev = device_add_child(slot->bus, "mmc", DEVICE_UNIT_ANY); if (d) { device_set_ivars(d, slot); (void)device_probe_and_attach(d); } + bus_topo_unlock(); #endif } else SDHCI_UNLOCK(slot); @@ -731,7 +733,9 @@ sdhci_card_task(void *arg, int pending __unused) slot->opt &= ~SDHCI_TUNING_ENABLED; SDHCI_UNLOCK(slot); callout_drain(&slot->retune_callout); + bus_topo_lock(); device_delete_child(slot->bus, d); + bus_topo_unlock(); #endif } else SDHCI_UNLOCK(slot); @@ -760,10 +764,10 @@ sdhci_handle_card_present_locked(struct sdhci_slot *slot, bool is_present) was_present = slot->dev != NULL; #endif if (!was_present && is_present) { - taskqueue_enqueue_timeout(taskqueue_swi_giant, + taskqueue_enqueue_timeout(taskqueue_bus, &slot->card_delayed_task, -SDHCI_INSERT_DELAY_TICKS); } else if (was_present && !is_present) { - taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); + taskqueue_enqueue(taskqueue_bus, &slot->card_task); } } @@ -1129,7 +1133,7 @@ no_tuning: "timeout", CTLFLAG_RWTUN, &slot->timeout, 0, "Maximum timeout for SDHCI transfers (in secs)"); TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); - TIMEOUT_TASK_INIT(taskqueue_swi_giant, &slot->card_delayed_task, 0, + TIMEOUT_TASK_INIT(taskqueue_bus, &slot->card_delayed_task, 0, sdhci_card_task, slot); callout_init(&slot->card_poll_callout, 1); callout_init_mtx(&slot->timeout_callout, &slot->mtx, 0); @@ -1186,8 +1190,8 @@ sdhci_cleanup_slot(struct sdhci_slot *slot) callout_drain(&slot->timeout_callout); callout_drain(&slot->card_poll_callout); callout_drain(&slot->retune_callout); - taskqueue_drain(taskqueue_swi_giant, &slot->card_task); - taskqueue_drain_timeout(taskqueue_swi_giant, &slot->card_delayed_task); + taskqueue_drain(taskqueue_bus, &slot->card_task); + taskqueue_drain_timeout(taskqueue_bus, &slot->card_delayed_task); SDHCI_LOCK(slot); d = slot->dev;
git: f27afbd85002 - main - nfsd.8: Note that the -n option is deprecated
The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f27afbd850021b9cb7cf4e66f0621c793ad37de0 commit f27afbd850021b9cb7cf4e66f0621c793ad37de0 Author: Rick Macklem AuthorDate: 2025-03-10 13:35:23 + Commit: Rick Macklem CommitDate: 2025-03-10 13:35:23 + nfsd.8: Note that the -n option is deprecated PR#284616 reported that --maxthreads did not obey the 256 thread limit defined as MAXNFSDCNT in nfsd.c. This is actually a feature and not a bug, since many NFS servers will now want to run more than 256 threads and --maxthreads can be used to set the upper bound on the number of threads. (MAXNFSDCNT was used long ago to define how many daemons would be forked, before daemons were replaced by kernel threads.) However, the nfsd.8 man page was misleading, since it indicated that "-n" was the equivalent to setting both --minthreads and --maxthreads to the same value. This patch fixes the man page. This is a content change. PR: 284616 Reviewed by:0mp (manpages) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D49102 --- usr.sbin/nfsd/nfsd.8 | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/usr.sbin/nfsd/nfsd.8 b/usr.sbin/nfsd/nfsd.8 index 10aba5c8d845..992228fba752 100644 --- a/usr.sbin/nfsd/nfsd.8 +++ b/usr.sbin/nfsd/nfsd.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 5, 2024 +.Dd February 21, 2025 .Dt NFSD 8 .Os .Sh NAME @@ -88,13 +88,20 @@ without creating any servers. Specifies a hostname to be used as a principal name, instead of the default hostname. .It Fl n Ar threads -Specifies how many servers to create. -This option is equivalent to specifying +This option is deprecated and is limited to a maximum of 256 threads. +The options .Fl Fl maxthreads and .Fl Fl minthreads -with their respective arguments to -.Ar threads . +should now be used. +The +.Ar threads +argument for +.Fl Fl minthreads +and +.Fl Fl maxthreads +may be set to the same value to avoid dynamic +changes to the number of threads. .It Fl Fl maxthreads Ar threads Specifies the maximum servers that will be kept around to service requests. .It Fl Fl minthreads Ar threads @@ -223,12 +230,15 @@ to execute in the foreground instead of in daemon mode. .El .Pp For example, -.Dq Li "nfsd -u -t -n 6" -serves UDP and TCP transports using six daemons. +.Dq Li "nfsd -u -t --minthreads 6 --maxthreads 6" +serves UDP and TCP transports using six kernel threads (servers). .Pp -A server should run enough daemons to handle -the maximum level of concurrency from its clients, -typically four to six. +For a system dedicated to servicing NFS RPCs, the number of +threads (servers) should be sufficient to handle the peak +client RPC load. +For systems that perform other services, the number of +threads (servers) may need to be limited, so that resources +are available for these other services. .Pp The .Nm
Re: 78cd83e4017b - main - devclass_alloc_unit: Go back to using M_WAITOK
Ah, I see. Thanks, Ravi (rpokala@) -Original Message- From: John Baldwin mailto:j...@freebsd.org>> Date: Monday, March 10, 2025 at 11:15 To: Ravi Pokala mailto:rpok...@freebsd.org>>, mailto:src-committ...@freebsd.org>>, mailto:dev-commits-src-...@freebsd.org>>, mailto:dev-commits-src-main@FreeBSD.org>> Subject: Re: git: 78cd83e4017b - main - devclass_alloc_unit: Go back to using M_WAITOK On 3/10/25 13:41, Ravi Pokala wrote: > Hi John, > >> This reverts commit 234683726708cf5212d672d676d30056d4133859. > > The commit message for that change says that this allocation might be done > while holding a lock, and so M_WAITOK is not valid. So then why is this > change okay? > > Thanks, Because the earlier commit to sdhci in this same push fixed it to create devices in a sleepable context. -- John Baldwin
git: b73b5f70e9f6 - main - sound: Remove feed_matrix_apply_generic()
The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b73b5f70e9f6be951e66531f6f57249eea4ba4dc commit b73b5f70e9f6be951e66531f6f57249eea4ba4dc Author: Christos Margiolis AuthorDate: 2025-03-10 20:19:46 + Commit: Christos Margiolis CommitDate: 2025-03-10 20:19:46 + sound: Remove feed_matrix_apply_generic() It does what feed_matrix_apply() already does, so it is redundant. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48036 --- sys/dev/sound/pcm/feeder_matrix.c | 49 --- 1 file changed, 49 deletions(-) diff --git a/sys/dev/sound/pcm/feeder_matrix.c b/sys/dev/sound/pcm/feeder_matrix.c index ab7922179867..2fee2be8bf5b 100644 --- a/sys/dev/sound/pcm/feeder_matrix.c +++ b/sys/dev/sound/pcm/feeder_matrix.c @@ -169,55 +169,6 @@ feed_matrix_reset(struct feed_matrix_info *info) } } -#ifdef FEEDMATRIX_GENERIC -static void -feed_matrix_apply_generic(struct feed_matrix_info *info, -uint8_t *src, uint8_t *dst, uint32_t count) -{ - intpcm64_t accum; - intpcm_t v; - int i, j; - - do { - for (i = 0; info->matrix[i].chn[0] != SND_CHN_T_EOF; - i++) { - if (info->matrix[i].chn[0] == SND_CHN_T_NULL) { - pcm_sample_write_norm(dst, 0, info->out); - dst += info->bps; - continue; - } else if (info->matrix[i].chn[1] == - SND_CHN_T_EOF) { - v = pcm_sample_read_norm(src + - info->matrix[i].chn[0], info->in); - pcm_sample_write_norm(dst, v, info->out); - dst += info->bps; - continue; - } - - accum = 0; - for (j = 0; - info->matrix[i].chn[j] != SND_CHN_T_EOF; - j++) { - v = pcm_sample_read_norm(src + - info->matrix[i].chn[j], info->in); - accum += v; - } - - accum = (accum * info->matrix[i].mul) >> - info->matrix[i].shift; - - FEEDMATRIX_CLIP_CHECK(accum, 32); - - v = (accum > PCM_S32_MAX) ? PCM_S32_MAX : - ((accum < PCM_S32_MIN) ? PCM_S32_MIN : accum); - pcm_sample_write_norm(dst, v, info->out); - dst += info->bps; - } - src += info->ialign; - } while (--count != 0); -} -#endif - static int feed_matrix_setup(struct feed_matrix_info *info, struct pcmchan_matrix *m_in, struct pcmchan_matrix *m_out)
git: 78cd83e4017b - main - devclass_alloc_unit: Go back to using M_WAITOK
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=78cd83e4017bccf62a291e57f0cceccf80e50423 commit 78cd83e4017bccf62a291e57f0cceccf80e50423 Author: John Baldwin AuthorDate: 2025-03-10 17:34:44 + Commit: John Baldwin CommitDate: 2025-03-10 17:34:44 + devclass_alloc_unit: Go back to using M_WAITOK This restores a change made earlier in f3d3c63442fff. This reverts commit 234683726708cf5212d672d676d30056d4133859. Reviewed by:imp Differential Revision: https://reviews.freebsd.org/D49273 --- sys/kern/subr_bus.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 38a8cab639e4..63de61262554 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1211,7 +1211,6 @@ devclass_get_sysctl_tree(devclass_t dc) static int devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) { - device_t *devices; const char *s; int unit = *unitp; @@ -1268,11 +1267,8 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) int newsize; newsize = unit + 1; - devices = reallocf(dc->devices, - newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); - if (devices == NULL) - return (ENOMEM); - dc->devices = devices; + dc->devices = reallocf(dc->devices, + newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); memset(dc->devices + dc->maxunit, 0, sizeof(device_t) * (newsize - dc->maxunit)); dc->maxunit = newsize;
git: 394605c057ad - main - ip_output(): style
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=394605c057ade5e1f9975e278dbb7693f44f commit 394605c057ade5e1f9975e278dbb7693f44f Author: Konstantin Belousov AuthorDate: 2025-03-06 17:59:44 + Commit: Konstantin Belousov CommitDate: 2025-03-10 20:16:58 + ip_output(): style Reviewed by:glebius Sponsored by: NVidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D49305 --- sys/netinet/ip_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index eb5d50bd4570..ec6ba8d92015 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -859,7 +859,7 @@ sendit: done: return (error); - bad: +bad: m_freem(m); goto done; }
git: 4918fc2e238b - main - sound: Turn clamp macros into a function
The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4918fc2e238b581aaf1f63e20003d5fa957f0b09 commit 4918fc2e238b581aaf1f63e20003d5fa957f0b09 Author: Christos Margiolis AuthorDate: 2025-03-10 20:19:27 + Commit: Christos Margiolis CommitDate: 2025-03-10 20:19:27 + sound: Turn clamp macros into a function This makes some subsequent feeder refactors easier to implement. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48421 --- sys/dev/sound/pcm/feeder_eq.c | 8 ++--- sys/dev/sound/pcm/feeder_mixer.c | 2 +- sys/dev/sound/pcm/feeder_rate.c | 8 ++--- sys/dev/sound/pcm/feeder_volume.c | 3 +- sys/dev/sound/pcm/pcm.h | 64 +++ 5 files changed, 45 insertions(+), 40 deletions(-) diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c index df34ee44a2ab..c5f82a2f18fc 100644 --- a/sys/dev/sound/pcm/feeder_eq.c +++ b/sys/dev/sound/pcm/feeder_eq.c @@ -135,10 +135,6 @@ struct feed_eq_info { #define FEEDEQ_ERR_CLIP_CHECK(...) #endif -#define FEEDEQ_CLAMP(v)(((v) > PCM_S32_MAX) ? PCM_S32_MAX : \ - (((v) < PCM_S32_MIN) ? PCM_S32_MIN :\ - (v))) - #define FEEDEQ_DECLARE(SIGN, BIT, ENDIAN) \ static void \ feed_eq_biquad_##SIGN##BIT##ENDIAN(struct feed_eq_info *info, \ @@ -187,7 +183,7 @@ feed_eq_biquad_##SIGN##BIT##ENDIAN(struct feed_eq_info *info, \ info->treble.o2[i] = info->treble.o1[i]; \ w >>= FEEDEQ_COEFF_SHIFT; \ FEEDEQ_ERR_CLIP_CHECK(treble, w); \ - v = FEEDEQ_CLAMP(w); \ + v = pcm_clamp(w, AFMT_S32_NE); \ info->treble.o1[i] = v; \ \ w = (intpcm64_t)v * bass->b0; \ @@ -200,7 +196,7 @@ feed_eq_biquad_##SIGN##BIT##ENDIAN(struct feed_eq_info *info, \ info->bass.o2[i] = info->bass.o1[i]; \ w >>= FEEDEQ_COEFF_SHIFT; \ FEEDEQ_ERR_CLIP_CHECK(bass, w); \ - v = FEEDEQ_CLAMP(w); \ + v = pcm_clamp(w, AFMT_S32_NE); \ info->bass.o1[i] = v; \ \ pcm_sample_write_norm(dst, v, \ diff --git a/sys/dev/sound/pcm/feeder_mixer.c b/sys/dev/sound/pcm/feeder_mixer.c index 7640b09400ed..9a7d75198692 100644 --- a/sys/dev/sound/pcm/feeder_mixer.c +++ b/sys/dev/sound/pcm/feeder_mixer.c @@ -64,7 +64,7 @@ feed_mixer_##SIGN##BIT##ENDIAN(uint8_t *src, uint8_t *dst, \ y = pcm_sample_read_calc(dst, \ AFMT_##SIGN##BIT##_##ENDIAN); \ z = INTPCM##BIT##_T(x) + y; \ - x = PCM_CLAMP_##SIGN##BIT(z); \ + x = pcm_clamp_calc(z, AFMT_##SIGN##BIT##_##ENDIAN); \ pcm_sample_write(dst, x,\ AFMT_##SIGN##BIT##_##ENDIAN); \ } while (count != 0); \ diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c index e1b4076e248e..1610211ff5f5 100644 --- a/sys/dev/sound/pcm/feeder_rate.c +++ b/sys/dev/sound/pcm/feeder_rate.c @@ -502,10 +502,6 @@ z_feed_linear_##SIGN##BIT##ENDIAN(struct z_info *info, uint8_t *dst) \ #define Z_CLIP_CHECK(...) #endif -#define Z_CLAMP(v, BIT) \ - (((v) > PCM_S##BIT##_MAX) ? PCM_S##BIT##_MAX : \ - (((v) < PCM_S##BIT##_MIN) ? PCM_S##BIT##_MIN : (v))) - /* * Sine Cardinal (SINC) Interpolation. Scaling is done in 64 bit, so * there's no point to hold the plate any longer. All samples will be @@ -574,7 +570,7 @@ z_feed_sinc_##SIGN##BIT##ENDIAN(struct z_info *info, uint8_t *dst) \ else \ v >>= Z_COEFF_SHIFT - Z_GUARD_BIT_##BIT;
git: 048d6ca31d96 - main - umass: Remove some 20-year-old dead code
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=048d6ca31d968a79cfcde30295eff475582b1915 commit 048d6ca31d968a79cfcde30295eff475582b1915 Author: Warner Losh AuthorDate: 2025-03-10 20:46:48 + Commit: Warner Losh CommitDate: 2025-03-11 02:33:15 + umass: Remove some 20-year-old dead code A REQUEST SENSE CDB was just copied into the cmd buffer, so testing for INQUIRY will always fail. Remove the dead code. This code was added, apparently by mistake in 2003. 8541fbec7900e merged changes from NetBSD's umass_scsipi.c 1.8 to address some BBB bulk-in clear problems. NetBSD had fixed a problem in the FORCE_SHORT_INQUIRY quirk code they had ported from FreeBSD that FreeBSD also needed. That merge also included the dead code, which was not in NetBSD. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49311 --- sys/dev/usb/storage/umass.c | 4 1 file changed, 4 deletions(-) diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c index 58f36e756dce..3e5cc9a7e084 100644 --- a/sys/dev/usb/storage/umass.c +++ b/sys/dev/usb/storage/umass.c @@ -2523,10 +2523,6 @@ umass_cam_cb(struct umass_softc *sc, union ccb *ccb, uint32_t residue, if (umass_std_transform(sc, ccb, &sc->cam_scsi_sense.opcode, sizeof(sc->cam_scsi_sense))) { - if ((sc->sc_quirks & FORCE_SHORT_INQUIRY) && - (sc->sc_transfer.cmd_data[0] == INQUIRY)) { - ccb->csio.sense_len = SHORT_INQUIRY_LENGTH; - } umass_command_start(sc, DIR_IN, &ccb->csio.sense_data.error_code, ccb->csio.sense_len, ccb->ccb_h.timeout, &umass_cam_sense_cb, ccb);
git: bf317e9f1037 - main - Fix a typo in the updated copyright comment
The branch main has been updated by marck: URL: https://cgit.FreeBSD.org/src/commit/?id=bf317e9f1037d4647913a4fbf0904ff84d3f7894 commit bf317e9f1037d4647913a4fbf0904ff84d3f7894 Author: Dmitry Morozovsky AuthorDate: 2025-03-10 08:49:35 + Commit: Dmitry Morozovsky CommitDate: 2025-03-10 08:49:35 + Fix a typo in the updated copyright comment --- sys/cam/scsi/scsi_all.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h index 4feaee081e55..944f70e03da6 100644 --- a/sys/cam/scsi/scsi_all.h +++ b/sys/cam/scsi/scsi_all.h @@ -6,7 +6,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Original scsi_all.h from 386BSD was by Julian Elischer at TRW Financial - * Services has been transformed into a new work by subsequent contribtuors. + * Services has been transformed into a new work by subsequent contributors. */ /*
git: ac24c9da8bb7 - main - sound: Remove macro magic from pcm/feeder_matrix.c
The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ac24c9da8bb7af731646dd7924841a28e2ad7ad7 commit ac24c9da8bb7af731646dd7924841a28e2ad7ad7 Author: Christos Margiolis AuthorDate: 2025-03-10 20:19:41 + Commit: Christos Margiolis CommitDate: 2025-03-10 20:19:41 + sound: Remove macro magic from pcm/feeder_matrix.c Turn the FEEDMATRIX_DECLARE macro into a single inline function (feed_matrix_apply()). There is no reason to have this as a macro, it only complicated the code. An advantage of this patch is that, because we no longer call the functions created by the macro through function pointers (apply field of feed_matrix_info), we can call feed_matrix_apply() directly in feed_matrix_feed(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48035 --- sys/dev/sound/pcm/feeder_matrix.c | 185 -- 1 file changed, 56 insertions(+), 129 deletions(-) diff --git a/sys/dev/sound/pcm/feeder_matrix.c b/sys/dev/sound/pcm/feeder_matrix.c index b63b5841ff7f..ab7922179867 100644 --- a/sys/dev/sound/pcm/feeder_matrix.c +++ b/sys/dev/sound/pcm/feeder_matrix.c @@ -60,16 +60,11 @@ #define SND_CHN_T_EOF 0x00e0fe0f #define SND_CHN_T_NULL 0x0e0e0e0e -struct feed_matrix_info; - -typedef void (*feed_matrix_t)(struct feed_matrix_info *, uint8_t *, -uint8_t *, uint32_t); - struct feed_matrix_info { + uint32_t fmt; uint32_t bps; uint32_t ialign, oalign; uint32_t in, out; - feed_matrix_t apply; struct { int chn[SND_CHN_T_MAX + 1]; int mul, shift; @@ -115,114 +110,48 @@ static int feeder_matrix_default_ids[9] = { } while (0) #endif -#define FEEDMATRIX_DECLARE(SIGN, BIT, ENDIAN) \ -static void\ -feed_matrix_##SIGN##BIT##ENDIAN(struct feed_matrix_info *info, \ -uint8_t *src, uint8_t *dst, uint32_t count) \ -{ \ - intpcm64_t accum; \ - intpcm_t v; \ - int i, j; \ - \ - do {\ - for (i = 0; info->matrix[i].chn[0] != SND_CHN_T_EOF;\ - i++) { \ - if (info->matrix[i].chn[0] == SND_CHN_T_NULL) { \ - pcm_sample_write(dst, 0,\ - AFMT_##SIGN##BIT##_##ENDIAN); \ - dst += PCM_##BIT##_BPS; \ - continue; \ - } else if (info->matrix[i].chn[1] ==\ - SND_CHN_T_EOF) {\ - v = pcm_sample_read(\ - src + info->matrix[i].chn[0], \ - AFMT_##SIGN##BIT##_##ENDIAN); \ - pcm_sample_write(dst, v,\ - AFMT_##SIGN##BIT##_##ENDIAN); \ - dst += PCM_##BIT##_BPS; \ - continue; \ - } \ - \ - accum = 0; \ - for (j = 0; \ - info->matrix[i].chn[j] != SND_CHN_T_EOF;\ - j++) { \ - v = pcm_sample_read(\ - src + info->matrix[i].chn[j], \ - AFMT_##SIGN##BIT##_##ENDIAN); \ - accum += v; \ - } \ - \ - accum = (accum * info->matrix[i].mul) >>\ - info->matrix[i].shift; \ - \ - FEEDMATRIX_CLIP_CHECK(accum, BIT); \ -
git: 2fda8597116e - main - sound: Take dsp_cdevsw out of header file
The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2fda8597116e760c32f07af43d260041f975b650 commit 2fda8597116e760c32f07af43d260041f975b650 Author: Christos Margiolis AuthorDate: 2025-03-10 20:47:28 + Commit: Christos Margiolis CommitDate: 2025-03-10 20:47:28 + sound: Take dsp_cdevsw out of header file Not used outside of pcm/dsp.c. MFC after: 1 week Sponsored by: The FreeBSD Foundation Reviewed by:imp, markj Differential Revision: https://reviews.freebsd.org/D49217 --- sys/dev/sound/pcm/dsp.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.h b/sys/dev/sound/pcm/dsp.h index 1eab42ca91c8..8a4f5f869acc 100644 --- a/sys/dev/sound/pcm/dsp.h +++ b/sys/dev/sound/pcm/dsp.h @@ -31,8 +31,6 @@ #ifndef _PCMDSP_H_ #define _PCMDSP_H_ -extern struct cdevsw dsp_cdevsw; - int dsp_make_dev(device_t); void dsp_destroy_dev(device_t); int dsp_oss_audioinfo(struct cdev *, oss_audioinfo *, bool);
git: b768f2c7773b - main - sound: Retire SD_F_AUTOVCHAN
The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b768f2c7773b6e306fb43687657414f9f42a27d4 commit b768f2c7773b6e306fb43687657414f9f42a27d4 Author: Christos Margiolis AuthorDate: 2025-03-10 20:47:35 + Commit: Christos Margiolis CommitDate: 2025-03-10 20:47:35 + sound: Retire SD_F_AUTOVCHAN This flag is redundant and essentially a no-op, as it is set when the device supports at least playback or recording, which is almost always the case. But even if the device is mixer-only (i.e., 0 channels), there is no reason to keep this flag; it is only used to bail out of the vchan sysctl handlers, but we already bail out anyway if we try to use the sysctl in a vchan direction that is not supported. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49021 --- sys/dev/sound/pcm/sound.c | 7 +-- sys/dev/sound/pcm/sound.h | 4 ++-- sys/dev/sound/pcm/vchan.c | 8 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 3e76626f5c57..5759c06725ce 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -369,8 +369,7 @@ pcm_sysinit(device_t dev) OID_AUTO, "mode", CTLFLAG_RD, NULL, mode, "mode (1=mixer, 2=play, 4=rec. The values are OR'ed if more than " "one mode is supported)"); - if (d->flags & SD_F_AUTOVCHAN) - vchan_initsys(dev); + vchan_initsys(dev); if (d->flags & SD_F_EQ) feeder_eq_initsys(dev); } @@ -430,10 +429,6 @@ pcm_register(device_t dev, char *str) if (d->playcount == 0 || d->reccount == 0) d->flags |= SD_F_SIMPLEX; - - if (d->playcount > 0 || d->reccount > 0) - d->flags |= SD_F_AUTOVCHAN; - if (d->playcount > 0) d->flags |= SD_F_PVCHANS; if (d->reccount > 0) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index df08b1700869..7f17c710038a 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -99,7 +99,7 @@ struct snd_mixer; #define SOUND_MAXVER SOUND_MODVER #define SD_F_SIMPLEX 0x0001 -#define SD_F_AUTOVCHAN 0x0002 +/* unused 0x0002 */ #define SD_F_SOFTPCMVOL0x0004 #define SD_F_BUSY 0x0008 #define SD_F_MPSAFE0x0010 @@ -122,7 +122,7 @@ struct snd_mixer; #define SD_F_BITS "\020" \ "\001SIMPLEX" \ - "\002AUTOVCHAN" \ + /* "\002 */ \ "\003SOFTPCMVOL"\ "\004BUSY" \ "\005MPSAFE"\ diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 27739fe68852..2b300e90ea4d 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -260,7 +260,7 @@ sysctl_dev_pcm_vchans(SYSCTL_HANDLER_ARGS) int err, enabled, flag; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); - if (!PCM_REGISTERED(d) || !(d->flags & SD_F_AUTOVCHAN)) + if (!PCM_REGISTERED(d)) return (EINVAL); PCM_LOCK(d); @@ -318,7 +318,7 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) char dtype[16]; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); - if (!PCM_REGISTERED(d) || !(d->flags & SD_F_AUTOVCHAN)) + if (!PCM_REGISTERED(d)) return (EINVAL); PCM_LOCK(d); @@ -409,7 +409,7 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) int *vchanrate, direction, ret, newspd, restart; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); - if (!PCM_REGISTERED(d) || !(d->flags & SD_F_AUTOVCHAN)) + if (!PCM_REGISTERED(d)) return (EINVAL); PCM_LOCK(d); @@ -508,7 +508,7 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) char fmtstr[AFMTSTR_LEN]; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); - if (!PCM_REGISTERED(d) || !(d->flags & SD_F_AUTOVCHAN)) + if (!PCM_REGISTERED(d)) return (EINVAL); PCM_LOCK(d);
git: ab95710f30f7 - main - sound: Make dev.pcm.X.mode dynamic
The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ab95710f30f7255d3a6be22a1a2c375ee0f96868 commit ab95710f30f7255d3a6be22a1a2c375ee0f96868 Author: Christos Margiolis AuthorDate: 2025-03-10 20:47:39 + Commit: Christos Margiolis CommitDate: 2025-03-10 20:47:39 + sound: Make dev.pcm.X.mode dynamic Currently dev.pcm.X.mode is calculated only once in pcm_sysinit(), which is called by pcm_register() during attach, but this can result in inconsistencies. For some context, what pcm_mode_init() does is, it checks if "playcount" is positive, in which case we assume the device supports playback. The same is done for "reccount" for recording, and if "mixer_dev" is not NULL, we know the device has a mixer. The "playcount" and "reccount" variables correspond to the number of _primary_ playback/recording channels, so we can assume that the primary channels have been created before reaching pcm_mode_init(). However, for the mixer that's not always the case. If the mixer is created _after_ pcm_register(), as is the case for snd_dummy(4) for example, pcm_mode_init() will see that "mixer_dev" is NULL, and report that the device does not have a mixer, whereas in reality we just created it afterwards. While this could be fixed by simply creating the mixers always before pcm_register(), it is better to be robust and calculate the mode dynamically. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49024 --- sys/dev/sound/pcm/sound.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 5759c06725ce..c262a57ea5f1 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -322,28 +322,32 @@ sysctl_dev_pcm_bitperfect(SYSCTL_HANDLER_ARGS) return (err); } -static u_int8_t -pcm_mode_init(struct snddev_info *d) +static int +sysctl_dev_pcm_mode(SYSCTL_HANDLER_ARGS) { - u_int8_t mode = 0; + struct snddev_info *d; + int mode = 0; + d = oidp->oid_arg1; + if (!PCM_REGISTERED(d)) + return (ENODEV); + + PCM_LOCK(d); if (d->playcount > 0) mode |= PCM_MODE_PLAY; if (d->reccount > 0) mode |= PCM_MODE_REC; if (d->mixer_dev != NULL) mode |= PCM_MODE_MIXER; + PCM_UNLOCK(d); - return (mode); + return (sysctl_handle_int(oidp, &mode, 0, req)); } static void pcm_sysinit(device_t dev) { struct snddev_info *d = device_get_softc(dev); - u_int8_t mode; - - mode = pcm_mode_init(d); sysctl_ctx_init(&d->play_sysctl_ctx); d->play_sysctl_tree = SYSCTL_ADD_NODE(&d->play_sysctl_ctx, @@ -364,9 +368,10 @@ pcm_sysinit(device_t dev) "bitperfect", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, d, sizeof(d), sysctl_dev_pcm_bitperfect, "I", "bit-perfect playback/recording (0=disable, 1=enable)"); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "mode", CTLFLAG_RD, NULL, mode, + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "mode", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, d, sizeof(d), + sysctl_dev_pcm_mode, "I", "mode (1=mixer, 2=play, 4=rec. The values are OR'ed if more than " "one mode is supported)"); vchan_initsys(dev);
git: c824383b269d - main - sound: Update COPYRIGHT notices
The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c824383b269d8abe175ea4751194660716d5600e commit c824383b269d8abe175ea4751194660716d5600e Author: Christos Margiolis AuthorDate: 2025-03-10 20:47:44 + Commit: Christos Margiolis CommitDate: 2025-03-10 20:47:44 + sound: Update COPYRIGHT notices Only to files I've currently made significant contributions to. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/dev/sound/dummy.c | 2 +- sys/dev/sound/pcm/channel.c | 4 sys/dev/sound/pcm/channel.h | 4 sys/dev/sound/pcm/dsp.c | 2 +- sys/dev/sound/pcm/dsp.h | 4 sys/dev/sound/pcm/feeder.c| 4 sys/dev/sound/pcm/feeder_eq.c | 4 sys/dev/sound/pcm/feeder_format.c | 4 sys/dev/sound/pcm/feeder_matrix.c | 4 sys/dev/sound/pcm/feeder_mixer.c | 4 sys/dev/sound/pcm/pcm.h | 4 sys/dev/sound/pcm/sndstat.c | 2 +- sys/dev/sound/pcm/sound.c | 2 +- sys/dev/sound/pcm/sound.h | 4 sys/dev/sound/pcm/vchan.c | 2 +- sys/dev/sound/pcm/vchan.h | 4 16 files changed, 49 insertions(+), 5 deletions(-) diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c index b637171d82e4..ae2af6fa61ed 100644 --- a/sys/dev/sound/dummy.c +++ b/sys/dev/sound/dummy.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2024 The FreeBSD Foundation + * Copyright (c) 2024-2025 The FreeBSD Foundation * * This software was developed by Christos Margiolis * under sponsorship from the FreeBSD Foundation. diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 0a0059411399..287e2f07d8a1 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -6,6 +6,10 @@ * Copyright (c) 1999 Cameron Grant * Portions Copyright (c) Luigi Rizzo - 1997-99 * All rights reserved. + * Copyright (c) 2024-2025 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 31c617a6df78..fab182b22774 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -5,6 +5,10 @@ * Portions Copyright (c) Ryan Beasley - GSoC 2006 * Copyright (c) 1999 Cameron Grant * All rights reserved. + * Copyright (c) 2024-2025 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 88e0580c5c45..422c64c1b880 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -5,7 +5,7 @@ * Portions Copyright (c) Ryan Beasley - GSoC 2006 * Copyright (c) 1999 Cameron Grant * All rights reserved. - * Copyright (c) 2024 The FreeBSD Foundation + * Copyright (c) 2024-2025 The FreeBSD Foundation * * Portions of this software were developed by Christos Margiolis * under sponsorship from the FreeBSD Foundation. diff --git a/sys/dev/sound/pcm/dsp.h b/sys/dev/sound/pcm/dsp.h index 8a4f5f869acc..8c0786aad474 100644 --- a/sys/dev/sound/pcm/dsp.h +++ b/sys/dev/sound/pcm/dsp.h @@ -5,6 +5,10 @@ * Portions Copyright (c) Ryan Beasley - GSoC 2006 * Copyright (c) 1999 Cameron Grant * All rights reserved. + * Copyright (c) 2024-2025 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index 6a6d8c80a34a..af3ada441e48 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -4,6 +4,10 @@ * Copyright (c) 2005-2009 Ariff Abdullah * Copyright (c) 1999 Cameron Grant * All rights reserved. + * Copyright (c) 2024-2025 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c index 4ed5fa57a485..23e27b922486 100644 --- a/sys/dev/sound/pcm/feeder_eq.c +++ b/sys/dev/sound/pcm/feeder_eq.c @@ -3,6 +3,10 @@ * * Copyright (c) 2008-2009 Ariff Abdullah * All rights reserved. + * Copyright (c) 2024-
git: 4021fa32d92d - main - sound: Simplify pcm/feeder_mixer.c
The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4021fa32d92d656d3d43186cc231695c7ad53d33 commit 4021fa32d92d656d3d43186cc231695c7ad53d33 Author: Christos Margiolis AuthorDate: 2025-03-10 20:38:23 + Commit: Christos Margiolis CommitDate: 2025-03-10 20:38:23 + sound: Simplify pcm/feeder_mixer.c - Get rid of macro magic. - Make feed_mixer_info handling similar to most feeders. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48394 --- sys/dev/sound/pcm/feeder_mixer.c | 173 +++ 1 file changed, 68 insertions(+), 105 deletions(-) diff --git a/sys/dev/sound/pcm/feeder_mixer.c b/sys/dev/sound/pcm/feeder_mixer.c index 9a7d75198692..f5f2b9bc9c36 100644 --- a/sys/dev/sound/pcm/feeder_mixer.c +++ b/sys/dev/sound/pcm/feeder_mixer.c @@ -42,136 +42,83 @@ #undef SND_FEEDER_MULTIFORMAT #define SND_FEEDER_MULTIFORMAT 1 -typedef void (*feed_mixer_t)(uint8_t *, uint8_t *, uint32_t); - -#define FEEDMIXER_DECLARE(SIGN, BIT, ENDIAN) \ -static void\ -feed_mixer_##SIGN##BIT##ENDIAN(uint8_t *src, uint8_t *dst, \ -uint32_t count)\ -{ \ - intpcm##BIT##_t z; \ - intpcm_t x, y; \ - \ - src += count; \ - dst += count; \ - \ - do {\ - src -= PCM_##BIT##_BPS; \ - dst -= PCM_##BIT##_BPS; \ - count -= PCM_##BIT##_BPS; \ - x = pcm_sample_read_calc(src, \ - AFMT_##SIGN##BIT##_##ENDIAN); \ - y = pcm_sample_read_calc(dst, \ - AFMT_##SIGN##BIT##_##ENDIAN); \ - z = INTPCM##BIT##_T(x) + y; \ - x = pcm_clamp_calc(z, AFMT_##SIGN##BIT##_##ENDIAN); \ - pcm_sample_write(dst, x,\ - AFMT_##SIGN##BIT##_##ENDIAN); \ - } while (count != 0); \ -} - -#if BYTE_ORDER == LITTLE_ENDIAN || defined(SND_FEEDER_MULTIFORMAT) -FEEDMIXER_DECLARE(S, 16, LE) -FEEDMIXER_DECLARE(S, 32, LE) -#endif -#if BYTE_ORDER == BIG_ENDIAN || defined(SND_FEEDER_MULTIFORMAT) -FEEDMIXER_DECLARE(S, 16, BE) -FEEDMIXER_DECLARE(S, 32, BE) -#endif -#ifdef SND_FEEDER_MULTIFORMAT -FEEDMIXER_DECLARE(S, 8, NE) -FEEDMIXER_DECLARE(S, 24, LE) -FEEDMIXER_DECLARE(S, 24, BE) -FEEDMIXER_DECLARE(U, 8, NE) -FEEDMIXER_DECLARE(U, 16, LE) -FEEDMIXER_DECLARE(U, 24, LE) -FEEDMIXER_DECLARE(U, 32, LE) -FEEDMIXER_DECLARE(U, 16, BE) -FEEDMIXER_DECLARE(U, 24, BE) -FEEDMIXER_DECLARE(U, 32, BE) -#endif - struct feed_mixer_info { uint32_t format; + uint32_t channels; int bps; - feed_mixer_t mix; }; -#define FEEDMIXER_ENTRY(SIGN, BIT, ENDIAN) \ - { \ - AFMT_##SIGN##BIT##_##ENDIAN, PCM_##BIT##_BPS, \ - feed_mixer_##SIGN##BIT##ENDIAN \ - } - -static struct feed_mixer_info feed_mixer_info_tab[] = { - FEEDMIXER_ENTRY(S, 8, NE), -#if BYTE_ORDER == LITTLE_ENDIAN || defined(SND_FEEDER_MULTIFORMAT) - FEEDMIXER_ENTRY(S, 16, LE), - FEEDMIXER_ENTRY(S, 32, LE), -#endif -#if BYTE_ORDER == BIG_ENDIAN || defined(SND_FEEDER_MULTIFORMAT) - FEEDMIXER_ENTRY(S, 16, BE), - FEEDMIXER_ENTRY(S, 32, BE), -#endif -#ifdef SND_FEEDER_MULTIFORMAT - FEEDMIXER_ENTRY(S, 24, LE), - FEEDMIXER_ENTRY(S, 24, BE), - FEEDMIXER_ENTRY(U, 8, NE), - FEEDMIXER_ENTRY(U, 16, LE), - FEEDMIXER_ENTRY(U, 24, LE), - FEEDMIXER_ENTRY(U, 32, LE), - FEEDMIXER_ENTRY(U, 16, BE), - FEEDMIXER_ENTRY(U, 24, BE), - FEEDMIXER_ENTRY(U, 32, BE), -#endif - {AFMT_AC3, PCM_16_BPS, NULL }, - { AFMT_MU_LAW, PCM_8_BPS, feed_mixer_U8NE }, /* dummy */ - { AFMT_A_LAW, PCM_8_BPS, feed_mixer_U8NE }/* dummy */ -}; +static void +feed_mixer_apply(uint8_t *src, uint8_t *dst, uint32_t count, const uint32_t fmt) +{ + intpcm32_t z; + intpcm_t x, y; -#define
git: db6f2bb93a97 - main - Makefile.inc1: Conditionalize some package related variables
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=db6f2bb93a9706963f66d270edb5ee62c37a9296 commit db6f2bb93a9706963f66d270edb5ee62c37a9296 Author: John Baldwin AuthorDate: 2025-03-10 17:30:26 + Commit: John Baldwin CommitDate: 2025-03-10 17:30:26 + Makefile.inc1: Conditionalize some package related variables In particular, don't invoke git to compute SOURCE_DATE_EPOCH for unrelated targets like check-old or delete-old. If the git invocation fails (e.g. when using a git worktree mounted over NFS) it can generate a lot of irrelevant warning spam. Reviewed by:emaste Fixes: 8a3537aaf7c1 ("Makefile.inc1: Make package timestamps reproducible by default") Differential Revision: https://reviews.freebsd.org/D49278 --- Makefile.inc1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 0b4167790133..9cd4d3b63cae 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -596,6 +596,7 @@ PKG_VERSION:= ${_PKG_REVISION}${EXTRA_REVISION:C/[[:space:]]//g} .endif .endif # !defined(_MKSHOWCONFIG) +.if make(*package*) .if !defined(PKG_TIMESTAMP) .if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git) SOURCE_DATE_EPOCH!=${GIT_CMD} -C ${SRCDIR} show -s --format=%ct HEAD @@ -614,6 +615,7 @@ PKG_WWW?= https://www.FreeBSD.org .export PKG_NAME_PREFIX .export PKG_MAINTAINER .export PKG_WWW +.endif .if !defined(_MKSHOWCONFIG) _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \
git: b8b5cc330490 - main - new-bus: Use M_WAITOK in more places
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b8b5cc330490810fc28621ac16d8147d9c53c276 commit b8b5cc330490810fc28621ac16d8147d9c53c276 Author: John Baldwin AuthorDate: 2025-03-10 17:35:21 + Commit: John Baldwin CommitDate: 2025-03-10 17:35:21 + new-bus: Use M_WAITOK in more places M_NOWAIT is now only used for devclass_get_devices, devclass_get_drivers, and device_get_children. Other functions are generally called from sleepable contexts such as module event handlers, attach/detach routines, and the ioctl handler for /dev/devctl2. Suggested by: mjg (devclass_add_device) Differential Revision: https://reviews.freebsd.org/D49274 --- sys/kern/subr_bus.c | 31 +++ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 63de61262554..1cbb91634d43 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -575,9 +575,7 @@ devclass_find_internal(const char *classname, const char *parentname, if (create && !dc) { PDEBUG(("creating %s", classname)); dc = malloc(sizeof(struct devclass) + strlen(classname) + 1, - M_BUS, M_NOWAIT | M_ZERO); - if (!dc) - return (NULL); + M_BUS, M_WAITOK | M_ZERO); dc->parent = NULL; dc->name = (char*) (dc + 1); strcpy(dc->name, classname); @@ -711,9 +709,7 @@ devclass_add_driver(devclass_t dc, driver_t *driver, int pass, devclass_t *dcp) if (pass <= BUS_PASS_ROOT) return (EINVAL); - dl = malloc(sizeof *dl, M_BUS, M_NOWAIT|M_ZERO); - if (!dl) - return (ENOMEM); + dl = malloc(sizeof *dl, M_BUS, M_WAITOK|M_ZERO); /* * Compile the driver's methods. Also increase the reference count @@ -1306,9 +1302,7 @@ devclass_add_device(devclass_t dc, device_t dev) buflen = snprintf(NULL, 0, "%s%d$", dc->name, INT_MAX); if (buflen < 0) return (ENOMEM); - dev->nameunit = malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); - if (!dev->nameunit) - return (ENOMEM); + dev->nameunit = malloc(buflen, M_BUS, M_WAITOK|M_ZERO); if ((error = devclass_alloc_unit(dc, dev, &dev->unit)) != 0) { free(dev->nameunit, M_BUS); @@ -1385,10 +1379,7 @@ make_device(device_t parent, const char *name, int unit) dc = NULL; } - dev = malloc(sizeof(*dev), M_BUS, M_NOWAIT|M_ZERO); - if (!dev) - return (NULL); - + dev = malloc(sizeof(*dev), M_BUS, M_WAITOK|M_ZERO); dev->parent = parent; TAILQ_INIT(&dev->children); kobj_init((kobj_t) dev, &null_class); @@ -2116,7 +2107,7 @@ device_set_desc_copy(device_t dev, const char *desc) { char *buf; - buf = strdup_flags(desc, M_BUS, M_NOWAIT); + buf = strdup_flags(desc, M_BUS, M_WAITOK); device_set_desc_internal(dev, buf, true); } @@ -2476,13 +2467,7 @@ device_set_driver(device_t dev, driver_t *driver) else policy = DOMAINSET_RR(); dev->softc = malloc_domainset(driver->size, M_BUS_SC, - policy, M_NOWAIT | M_ZERO); - if (!dev->softc) { - kobj_delete((kobj_t) dev, NULL); - kobj_init((kobj_t) dev, &null_class); - dev->driver = NULL; - return (ENOMEM); - } + policy, M_WAITOK | M_ZERO); } } else { kobj_init((kobj_t) dev, &null_class); @@ -2935,9 +2920,7 @@ resource_list_add(struct resource_list *rl, int type, int rid, rle = resource_list_find(rl, type, rid); if (!rle) { rle = malloc(sizeof(struct resource_list_entry), M_BUS, - M_NOWAIT); - if (!rle) - panic("resource_list_add: can't record entry"); + M_WAITOK); STAILQ_INSERT_TAIL(rl, rle, link); rle->type = type; rle->rid = rid;
git: 186dc094cf1c - main - linux: Handle IP_RECVTOS cmsg type
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=186dc094cf1ce14b26c6dfa329a445357121238a commit 186dc094cf1ce14b26c6dfa329a445357121238a Author: Alex S AuthorDate: 2025-03-10 18:12:36 + Commit: Gleb Smirnoff CommitDate: 2025-03-10 18:12:36 + linux: Handle IP_RECVTOS cmsg type This unbreaks apps using GameNetworkingSockets from Valve. --- sys/compat/linux/linux_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index a33b502f2201..539d153431c4 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -135,7 +135,6 @@ linux_to_bsd_ip_sockopt(int opt) LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_RECVTTL"); return (IP_RECVTTL); case LINUX_IP_RECVTOS: - LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_RECVTOS"); return (IP_RECVTOS); case LINUX_IP_FREEBIND: LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_FREEBIND"); @@ -663,6 +662,8 @@ bsd_to_linux_ip_cmsg_type(int cmsg_type) switch (cmsg_type) { case IP_RECVORIGDSTADDR: return (LINUX_IP_RECVORIGDSTADDR); + case IP_RECVTOS: + return (LINUX_IP_TOS); } return (-1); }