tty: convert tty_lock_assert to tty_assert_locked to hide lock typeA later change, currently being iterated on in D24459, will in-fact changethe lock type to an sx so that TTY drivers can sleep on
tty: convert tty_lock_assert to tty_assert_locked to hide lock typeA later change, currently being iterated on in D24459, will in-fact changethe lock type to an sx so that TTY drivers can sleep on it if they need to.Committing this ahead of time to make the review in question a little morepalatable.tty_lock_assert() is unfortunately still needed for now in two places tomake sure that the tty lock has not been recursed upon, for those scenarioswhere it's supplied by the TTY driver and possibly a mutex that is allowedto recurse.Suggested by: markj
show more ...
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that arestill not MPSAFE (or already are but aren’t properly mark
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that arestill not MPSAFE (or already are but aren’t properly marked).Use it in preparation for a general review of all nodes.This is non-functional change that adds annotations to SYSCTL_NODE andSYSCTL_PROC nodes using one of the soon-to-be-required flags.Mark all obvious cases as MPSAFE. All entries that haven't been markedas MPSAFE before are by default marked as NEEDGIANTApproved by: kib (mentor, blanket)Commented by: kib, gallatin, melifaroDifferential Revision: https://reviews.freebsd.org/D23718
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Merge robustness improvements for the ALTERA JTAG UART driver fromCheriBSD, which attempt to work around an inherent race in the UART'scontrol-register design in detecting whether JTAG is currently
Merge robustness improvements for the ALTERA JTAG UART driver fromCheriBSD, which attempt to work around an inherent race in the UART'scontrol-register design in detecting whether JTAG is currently,present, which will otherwise lead to moderately frequent outputdrops when running in polled rather than interrupt-driven operation.Now, these drops are quite infrequent.commit 9f33fddac9215e32781a4f016ba17eab804fb6d4Author: Robert N. M. Watson <[email protected]>Date: Thu Jul 16 17:34:12 2015 +0000 Add a new sysctl, hw.altera_jtag_uart.ac_poll_delay, which allows the (default 10ms) delay associated with a full JTAG UART buffer combined with a lack of a JTAG-present flag to be tuned. Setting this higher may cause some JTAG configurations to be more reliable when printing out low-level console output at a speed greater than the JTAG UART is willing to carry data. Or it may not.commit 73992ef7607738b2973736e409ccd644b30eadbaAuthor: Robert N. M. Watson <[email protected]>Date: Sun Jan 1 15:13:07 2017 +0000 Minor improvements to the Altera JTAG UART device driver: - Minor rework to the logic to detect JTAG presence in order to be a bit more resilient to inevitable races: increase the retry period from two seconds to four seconds for trying to find JTAG, and more agressively clear the miss counter if JTAG has been reconnected. Once JTAG has vanished, stop prodding the miss counter. - Do a bit of reworking of the output code to frob the control register less by checking whether write interrupts are enabled/disabled before changing their state. This should reduce the opportunity for races with JTAG discovery (which are inherent to the Altera hardware-software interface, but can at least be minimised). - Add statistics relating to interrupt enable/disable/JTAG discovery/etc. With these changes, polled-mode JTAG UART ttys appear substantially more robust.MFC after: 1 weekSponsored by: DARPA, AFRL
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenyears for head. However, it is continuously misused as the mpsafe argumentfor callout_init(9). Deprecate the flag and cle
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenyears for head. However, it is continuously misused as the mpsafe argumentfor callout_init(9). Deprecate the flag and clean up callout_init() callsto make them more consistent.Differential Revision: https://reviews.freebsd.org/D2613Reviewed by: jhbMFC after: 2 weeks
Merge from CheriBSD:commit d0c7d235c09fc65dbdb278e7016a96f79c6a49cc Make the Altera JTAG UART device driver slightly more forgiving of the foibles of a sub-par hrdware interface by increasi
Merge from CheriBSD:commit d0c7d235c09fc65dbdb278e7016a96f79c6a49cc Make the Altera JTAG UART device driver slightly more forgiving of the foibles of a sub-par hrdware interface by increasing the timeout for spotting JTAG polling from one to two seconds.commit 19ed45a18832560dab967c179d83b71081c3a220 Update comment.commit 8edfe803f033cc8e33229f99894c2b7496a44d5f Add a comment about a device-driver race condition that could cause the BERI pipeline to wedge awaiting JTAG in the event that both the low-level console and the tty layer decide to write to the JTAG FIFO just before JTAG is disconnected. Resolving this race is a bit tricky as it looks like there isn't a way to 'give the character back' to the tty layer when we discover the race. The easy fix is to drop the character, which we don't yet do, but perhaps should as that is a better outcome than wedging the pipeline.commit 2ea26cf579c9defcf31e413e7c9b0fbc159237fc Add a comment about an inherent race with hardware in the Altera JTAG UART's low-level console code.Submitted by: rwatsonMFC after: 1 weekSponsored by: DARPA, AFRL
Follow r261352 by updating all drivers which are children of simplebusto check the status property in their probe routines.Simplebus used to only instantiate its children whose status="okay"but t
Follow r261352 by updating all drivers which are children of simplebusto check the status property in their probe routines.Simplebus used to only instantiate its children whose status="okay"but that was improper behavior, fixed in r261352. Now that it doesn'tcheck anymore and probes all its children; the children all have todo the check because really only the children know how to properlyinterpret their status property strings.Right now all existing drivers only understand "okay" versus something-that's-not-okay, so they all use the new ofw_bus_status_okay() helper.
These nexus attachments do not execute a real probe and so needBUS_PROBE_NOWILDCARD set.
Partial MFC of change 228122:Due to the requirement that tty prefixes be unique per driver, renamethe Altera JTAG UART devices to ttyj#.Sponsored by: DARPA, AFRL
Merge Perforce changeset 219952 to head: Make different bus attachments for Altera and Terasice device drivers share the same devclass_t.Sponsored by: DARPA, AFRL
Merge Perforce changeset 219918 to head: Naive first cut at an FDT bus attachment for the Altera JTAG UART.Sponsored by: DARPA, AFRL
Merge Perforce changeset 219917 to head: Copy Altera JTAG UART nexus bus attachment as a starting point for an FDT bus attachment.Sponsored by: DARPA, AFRL
Correct double "the the"Approved by: cpercivaMFC after: 3 days
Add altera_jtag_uart(4), a device driver for Altera's JTAG UART soft core,which presents a UART-like interface over the Avalon bus that can beaddressed over JTAG. This IP core proves extremely use
Add altera_jtag_uart(4), a device driver for Altera's JTAG UART soft core,which presents a UART-like interface over the Avalon bus that can beaddressed over JTAG. This IP core proves extremely useful, allowing us toconnect trivially to the FreeBSD console over JTAG for FPGA-embedded hardand soft cores. As interrupts are optionally configured for this softcore, we support both interrupt-driven and polled modes of operation,which must be selected using device.hints. UART instances appear in /devas ttyu0, ttyu1, etc.However, it also contains a number of quirks, which make it difficult totell when JTAG is connected, and some buffering issues. We work aroundthese as best we can, using various heuristics.While the majority of this device driver is not only not BERI-specific,but also not MIPS-specific, for now add its defines in the BERI fileslist, as the console-level parts are aware of where the first JTAG UARTis mapped on Avalon, and contain MIPS-specific address translation, touse before Newbus and device.hints are available.Sponsored by: DARPA, AFRL