summaryrefslogtreecommitdiff
path: root/sys/dev
AgeCommit message (Collapse)Author
2022-08-28Don't fetch data beyond end of inquiry buffer, which, here, is notmlelstv
NUL-terminated. Reduce target buffer to needed size (product name + NUL terminator).
2022-08-28cons(9): Need sys/types.h for dev_t, u_int.riastradh
2022-08-28se(4): don't set if_watchdog as it's not used.skrll
if_timer is never set in this driver and so if_watchdog will never be called.
2022-08-28Sprinkle constskrll
2022-08-28Empty if_watchdog functions are useless and now waste resources. Let'sskrll
remove them.
2022-08-28Trailing whitespaceskrll
2022-08-28Simplify the check for what ioctls can be done in raidioctl() withoutoster
the device being initialized.
2022-08-28RAIDframe must be initialized for the RAIDFRAME_SET_LAST_UNIToster
and RAIDFRAME_SHUTDOWN ioctls. XXX Pullup-9 Reported-by: syzbot+1c20fcbe34d72cd7fbda@syzkaller.appspotmail.com
2022-08-27Convert bge_pending_rxintr_change to a bool (from int)skrll
2022-08-27Include headers once (and don't pretend this compiles without INET)skrll
2022-08-27Correct the abbreviation of approximately to 'approx.'skrll
2022-08-27Trailing whitespaceskrll
2022-08-26G/C unused softc membersskrll
2022-08-25audio(4): Fix bug in detaching audio16 and beyond.riastradh
The minor numbers have only four bits for the unit number, so unit numbers past 15 can't be represented as is. Attempting to revoke them was once harmless, when the system made no attempt to avoid open/detach races; now it crashes because vdevgone assumes that the minor number can be mapped back to an autoconf device, but it's the wrong one. With this change, we stop trying to revoke units beyond 15, because they can't be opened anyway (which may be a bug in its own right, requiring expansion of the minor number encoding!). Reported-by: syzbot+6634ffd48997ae9b1eb0@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=db40a795a0b078f9b3b9fa0d3b7a9addcd2534de Reported-by: syzbot+d2df39bb3f72975c0a97@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=cbdd598287529cff9a8c4230263f7414df88db4b Reported-by: syzbot+1404969f68424f8f6e4b@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=6e4782408d0351769215fe433986f1844a546774 Reported-by: syzbot+2a4174a65609b3a00abb@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=886bbee544c2337683e24c801f9b632630a24681 Reported-by: syzbot+c0d9e49f22e571650736@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=7fb2e5576ebae731e859283f85c97747d2824f35 Reported-by: syzbot+583ba2cdb8aa6e59a4bf@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=2af44f5245eba572ebfb222070b9fd1378854303
2022-08-25Tune number of Rx descriptors for ixl(4), ok'ed by yamaguchi@n.o.knakahara
In some tunneling measurement cases, that improve performance. In other cases, that keep up performance.
2022-08-25G/Cskrll
2022-08-25add missing bus_dmamap_unload().ryo
I deleted it in the previous commit, oops.
2022-08-24jumboframe support for eqos(4)ryo
Tested up to mtu=9000. Hardware may allow up to mtu=16364 (frame length=16382), but this has not been tested. - Separate calls to eqos_setup_rxdesc() from eqos_setup_rxbuf(). if m_getcl() fails, discard the packets received at that time and reuse for the next buffer. - Restore m_adj(m, ETHER_ALIGN) with limited conditions. Only if MCLBYTES is greater than 2050, so it is not normally aligned.
2022-08-24rename EQOS_TDES3_* macro to EQOS_TDES3_{TX,RX}_*, and add more defs.ryo
Avoid confusion because some definitions are different bits with the same name for TX and RX. no functional changes.
2022-08-24pmf(9): *_child_register never fails. Make it return void.riastradh
No kernel bump because this isn't documented or used in any modules, only in dev/pci/pci.c and dev/cardbus/cardbus.c which are as far as I know always statically linked into the kernel. The next change, however, will require a revbump -- to make pmf_device_register return void so we can prune vast swaths of dead error branches.
2022-08-24Giving up adjusting ETHER_ALIGN.ryo
Even if the jumbo frame setting is off, eqos will DMA transfer frames of 2048 bytes or more in increments of 2048 bytes if they are received. If the start position of the mbuf data is shifted by ETHER_ALIGN bytes in m_adj(), up to 2048 bytes of data will be written from the +ETHER_ALIGN position, causing overflow of the mbuf cluster.
2022-08-23xhci(4): Fix error branch for failed suspend.riastradh
If suspend failed, at least we can stop it from blocking all subsequent xhci commands or making a second suspend crash.
2022-08-23Fix eqos(4) to work on RK3588 as well.ryo
- Several registers needed to be initialized - Add some register definitions
2022-08-23usbnet(9): Don't touch ifp->if_flags in usbnet_start_locked.riastradh
Instead, consult unp->unp_txstopped -- but the caller already guarantees it is not stopped, so turn the conditional into an assertion anyway.
2022-08-23mii(9): Make mii_phy_down clear the flag if it prevented the callout.riastradh
This fixes a bug in the previous change to make mii_down wait for the mii auto timeout to complete.
2022-08-22iwi_start(): Replace "IFQ_DEQUEUE() -> IF_PREPEND() on failure" withthorpej
"IFQ_POLL() -> IFQ_DEQUEUE() on success (or fatal error)".
2022-08-22ipw_start(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" withthorpej
"IF_POLL() -> IF_DEQUEUE() on success".
2022-08-22We come into our if_start routine via ether_output(), therefore there isthorpej
no need to check-and-pullup to sizeof(struct ether_header). Instead, we can simply assert it.
2022-08-22age_start(): Replace "IFQ_DEQUEUE() -> IF_PREPEND() on failure" withthorpej
"IFQ_POLL() -> IFQ_DEQUEUE() on success (or fatal error)".
2022-08-22age_encap(): Use m_defrag(), not m_pullup(), to compact an mbuf chainthorpej
if it has too many DMA segments. Let the caller handle dispose of the packet on fatal errors.
2022-08-22ale_encap(): Fix error logic in previous change for when the defrag works,thorpej
but DMA mapping fails to use DMA resource shortage.
2022-08-22ale_start(): Replace "IFQ_DEQUEUE() -> IF_PREPEND() on failure" withthorpej
"IFQ_POLL() -> IFQ_DEQUEUE() on success (or fatal error)".
2022-08-22ale_encap(): Use m_defrag(), not m_pullup(), to compact an mbuf chainthorpej
if it has too many DMA segments. Let the caller handle dispose of the packet on fatal errors.
2022-08-22usbnet(9): Update comments about locking to reflect current reality.riastradh
No functional change.
2022-08-22dk(4): Assert about dk_openmask under the lock.riastradh
This serves two purposes: 1. Pacifies data race sanitizers. 2. Ensures that we don't spuriously trip over the assertion if dkclose happens concurrently with dkopen due to a revoke call.
2022-08-22Revert "dk(4): Narrow scope of dk_rawlock on close to dklastclose."riastradh
dkfirstopen relies on reading from dk_openmask of _other_ wedges, writes to dk_openmask must be serialized by dk_rawlock in addition to dk_openlock. (However, reads from dk_openlock only require one or the other).
2022-08-22cons(4): Don't barge ahead if cdevvp has failed -- return error now.riastradh
2022-08-22cons(4): Ignore error from vn_lock(vp, LK_EXCUSIVE|LK_RETRY).riastradh
This never fails, as is asserted in vn_lock whenever LK_RETRY is set and LK_NOWAIT is not.
2022-08-22dk(4): dklastclose never fails. Make it return void.riastradh
2022-08-22dk(4): Simplify dklastclose.riastradh
No functional change intended.
2022-08-22dk(4): Assert parent is open in dklastclose.riastradh
It is not possible for us to be closing a wedge whose parent is not open by at least this wedge.
2022-08-22dk(4): Move first-open logic to new dkfirstopen function.riastradh
Makes the logic more clearly pair with dklastclose.
2022-08-22dk(4): Turn locking contract comment into assertions in dklastclose.riastradh
2022-08-22dk(4): Narrow scope of dk_rawlock on close to dklastclose.riastradh
No need to take it if we're not actually going to close the parent. No functional change intended; dk_rawlock is only supposed to serialize dk_rawopens access and open/close of the parent, after all.
2022-08-22dk(4): Factor common mutex_exit out of branches to keep it balanced.riastradh
No functional change intended.
2022-08-22dk(4): Move lock release out of dklastclose into caller.riastradh
No longer necessary to have this unbalanced logic now that dk_close_parent correctly happens under the lock in order to serialize with dk_open_parent. No functional change intended.
2022-08-22dk(4): Serialize closing parent's dk_rawvp with opening it.riastradh
Otherwise, the following events might happen: - process 123 had /dev/rdkN open, starts close, enters dk_close_parent - process 456 opens /dev/rdkM (same parent, different wedge), calls dk_open_parent At this point, the block device hasn't yet closed, so dk_open_parent will fail with EBUSY. This is incorrect -- the chardev is never supposed to fail with EBUSY, and dkopen/dkclose carefully manage state to avoid opening the block device while it's still open. The problem is that dkopen in process 456 didn't wait for vn_close in process 123 to finish before calling VOP_OPEN. (Note: If it were the _same_ chardev /dev/rdkN in both processes, then spec_open/close would prevent this. But since it's a _different_ chardev, spec_open/close assume that concurrency is OK, and it's the driver's responsibility to serialize access to the parent disk which, unbeknownst to spec_open/close, is shared between dkN and dkM.) It appears that the vn_close call was previously moved outside dk_rawlock in 2010 to work around an unrelated bug in raidframe that had already been fixed in HEAD: Crash pointing to dk_rawlock and raidclose: https://mail-index.netbsd.org/tech-kern/2010/07/27/msg008612.html Change working around that crash: https://mail-index.netbsd.org/source-changes/2010/08/04/msg012270.html Change removing raidclose -> mutex_destroy(&dk_rawlock) path: https://mail-index.netbsd.org/source-changes/2009/07/23/msg223381.html
2022-08-21jme_ifstart(): Replace "IFQ_DEQUEUE() -> IF_PREPEND() on failure" withthorpej
"IFQ_POLL() -> IFQ_DEQUEUE() on success (and fatal-to-packet errors)".
2022-08-21Don't allow jme_encap() to modify the head-of-mbuf-chain pointer. Instead,thorpej
act on fatal packet errors in jme_ifstart().
2022-08-21jme_encap(): Fix up some botched formatting, and don't use (*m_head)thorpej
all over the place (just assign m = *m_head earlier). NFCI.