Commit Graph

368 Commits

Author SHA1 Message Date
andvar 1cd43426d5 Fix various typos in comments, log messages and documentation. 2024-02-10 18:43:51 +00:00
andvar 100a3398b8 fix spelling mistakes, mainly in comments and log messages. 2024-02-09 22:08:30 +00:00
andvar d378954346 fix misplaced or missing "e" in words with "ment" ending (argument, implement,
increment, decrement, alignment), in comments, documentation, log messages.
2024-02-08 20:51:24 +00:00
andvar 96c646f762 fix tripple/quadruple "r" letter typos in comments and log messages. 2024-02-04 18:52:35 +00:00
andvar 34908c4889 fix various typos in comments. 2024-02-02 22:39:09 +00:00
andvar 947fbafb45 fix typos, mainly s/unsupport/unsupported/ in log messages. 2024-02-02 22:33:42 +00:00
riastradh 63db4ce4f3 marvell: Reconcile arm vs powerpc marvell_intr_establish.
If there's a better way to do this without #ifdef __powerpc__, please
have at it!
2023-07-13 16:51:33 +00:00
msaitoh 4e7cd69809 Fix typo. unknwon -> unknown 2023-06-19 08:40:29 +00:00
andvar 176f1e87ce s/sessoin/session/ in warning message. 2023-05-28 08:01:46 +00:00
andvar ab9bc2ade4 fix few typos in comments. 2022-12-31 21:15:20 +00:00
andvar daa7d68ea3 fix various typos in comments and messages. 2022-11-02 20:38:21 +00:00
thorpej 13d4bb4cc8 Remove unnecessary include of <sys/malloc.h>. 2022-09-25 17:52:25 +00:00
thorpej ae121a9956 gfe_ifstart(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".
2022-08-20 19:04:07 +00:00
andvar 6913cbefe0 fix typos in comments and log messages, mainly s/intrrupt/interrupt/. 2022-07-21 10:09:20 +00:00
skrll afda606fbe alredy -> already 2022-07-08 07:02:47 +00:00
riastradh 8449a122ed mvxpsec(4): Fix missing change to freesession return type.
Not sure how this didn't get committed before -- it was supposed to be
part of this change:

https://mail-index.netbsd.org/source-changes/2022/05/22/msg138764.html
2022-06-01 15:40:15 +00:00
riastradh ee55792f15 opencrypto: Make freesession callback return void.
No functional change intended: all drivers already return zero
unconditionally.
2022-05-22 11:39:26 +00:00
riastradh f32a8269ae mvxpsec(4): Prune dead branches. Assert session id validity. 2022-05-22 11:38:51 +00:00
riastradh 4b175f2550 mvcesa(4): Prune dead branches. Assert session id validity. 2022-05-22 11:38:26 +00:00
rin 4318e600c0 Correct byte-order for bufsize field of RX descriptor.
XXX
This bug affected only armeb. Unfortunately, the systems including
armel still lock up eventually with NFS root on mvgbe(4)...
2022-05-21 10:33:05 +00:00
rin 225d4a6d39 m_freem() *after* bus_dmamap_sync() and bus_dmamap_load() for
that mbuf. This is mandatory for some archs.
2022-05-21 10:27:30 +00:00
rin 98c5320acd Add DPRINTF() to catch failure of m_defrag() in mvgbe_encap(). 2022-05-21 10:24:50 +00:00
rin 29c35fffae Raise threshold of debug level to 3 for DPRINTF() in non-error path of
mvgbe_encap(). Without this change, debug level 2 is almost unusable...
2022-05-21 10:22:27 +00:00
andvar de0a2812df s/sould/should/ and s/shoud/should/ 2022-04-12 21:05:36 +00:00
riastradh ef3476fb57 sys: Use membar_release/acquire around reference drop.
This just goes through my recent reference count membar audit and
changes membar_exit to membar_release and membar_enter to
membar_acquire -- this should make everything cheaper on most CPUs
without hurting correctness, because membar_acquire is generally
cheaper than membar_enter.
2022-04-09 23:38:31 +00:00
riastradh 35e313aabb mvxpsec(4): Nix trailing whitespace. 2022-04-06 22:48:09 +00:00
andvar e82c4d9bb4 fix various typos, mainly in comments. 2022-04-04 19:33:44 +00:00
andvar 2532bf9bb5 s/hander/handler/ and s/hader/header/ in comments and documentation. 2022-03-13 17:50:54 +00:00
riastradh 122a3e8a60 sys: Membar audit around reference count releases.
If two threads are using an object that is freed when the reference
count goes to zero, we need to ensure that all memory operations
related to the object happen before freeing the object.

Using an atomic_dec_uint_nv(&refcnt) == 0 ensures that only one
thread takes responsibility for freeing, but it's not enough to
ensure that the other thread's memory operations happen before the
freeing.

Consider:

	  Thread A			  Thread B
	obj->foo = 42;			obj->baz = 73;
	mumble(&obj->bar);		grumble(&obj->quux);
	/* membar_exit(); */		/* membar_exit(); */
	atomic_dec -- not last		atomic_dec -- last
					/* membar_enter(); */
					KASSERT(invariant(obj->foo,
					    obj->bar));
					free_stuff(obj);

The memory barriers ensure that

	obj->foo = 42;
	mumble(&obj->bar);

in thread A happens before

	KASSERT(invariant(obj->foo, obj->bar));
	free_stuff(obj);

in thread B.  Without them, this ordering is not guaranteed.

So in general it is necessary to do

	membar_exit();
	if (atomic_dec_uint_nv(&obj->refcnt) != 0)
		return;
	membar_enter();

to release a reference, for the `last one out hit the lights' style
of reference counting.  (This is in contrast to the style where one
thread blocks new references and then waits under a lock for existing
ones to drain with a condvar -- no membar needed thanks to mutex(9).)

I searched for atomic_dec to find all these.  Obviously we ought to
have a better abstraction for this because there's so much copypasta.
This is a stop-gap measure to fix actual bugs until we have that.  It
would be nice if an abstraction could gracefully handle the different
styles of reference counting in use -- some years ago I drafted an
API for this, but making it cover everything got a little out of hand
(particularly with struct vnode::v_usecount) and I ended up setting
it aside to work on psref/localcount instead for better scalability.

I got bored of adding #ifdef __HAVE_ATOMIC_AS_MEMBAR everywhere, so I
only put it on things that look performance-critical on 5sec review.
We should really adopt membar_enter_preatomic/membar_exit_postatomic
or something (except they are applicable only to atomic r/m/w, not to
atomic_load/store_*, making the naming annoying) and get rid of all
the ifdefs.
2022-03-12 15:32:30 +00:00
andvar 7f4592413f fix various typos, mainly in comments. 2022-02-16 22:00:55 +00:00
riastradh 94af175da5 sys: Omit vestigial struct devices in softcs after device_t split. 2022-02-12 17:09:43 +00:00
riastradh 3aa5a3ae30 sys: Fix various abuse of struct device internals.
Will help to make struct device opaque later.
2022-02-12 03:24:34 +00:00
andvar cbf5c65aff s/occured/occurred/ in comments, log messages and man pages. 2021-12-10 20:36:02 +00:00
msaitoh 65f668f966 s/sumary/summary/ 2021-12-05 07:57:38 +00:00
msaitoh e067b4e4e4 s/initialz/initializ/ in comment. 2021-12-05 03:04:41 +00:00
msaitoh 0706dce334 s/decriptor/descriptor/ in comment. 2021-12-05 02:47:01 +00:00
msaitoh 602777964f s/decript/decrypt/ in comment. 2021-12-05 02:41:44 +00:00
msaitoh fead0fdcaf s/endianess/endianness/ 2021-11-10 17:19:29 +00:00
msaitoh ed6f10c0f8 s/Erorr/Error/ in comment. 2021-11-10 15:55:35 +00:00
andvar 56d66eb030 "no affect" -> "no effect" in man pages and comments. 2021-10-30 21:08:58 +00:00
andvar c46bd13f44 some love to double letters (in comments). 2021-09-17 08:13:06 +00:00
andvar 80f2027016 sysinst/partitions.h: fix typos comments, also fix same typos in other files. 2021-09-11 21:30:46 +00:00
rin f63a3328af Add ARMEB support to mvgbe(4).
For ARMEB, peripheral is configured to little-endian mode, even if
CPU itself is in big-endian mode. Therefore, we need to configure
the device to little-endian mode, and byte-swap descriptor fields
(unlike the case of powerpc).
2021-08-30 00:08:28 +00:00
andvar 2e0bf311b3 fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected. 2021-08-17 22:00:26 +00:00
andvar 35bc95c886 s/fame/frame in mvxpe_mib_def with assumption that it was not intentional typo. 2021-08-13 21:04:44 +00:00
andvar c74fd0bbf0 s/struture/structure/ s/structre/structure/ 2021-08-13 20:26:07 +00:00
thorpej c7fb772b85 Merge thorpej-cfargs2. 2021-08-07 16:18:40 +00:00
andvar 077d1c0f36 fix various typos in comments and log messages. 2021-08-02 12:56:22 +00:00
andvar 7991f5a7b8 Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
2021-07-24 21:31:31 +00:00
thorpej 2685996b0e Merge thorpej-cfargs branch:
Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
2021-04-24 23:36:23 +00:00