summaryrefslogtreecommitdiff
path: root/sys/dev
AgeCommit message (Collapse)Author
2017-02-14asmc: on system resume, restore the keyboard backlight valueJoshua Stein
ok various
2017-02-13properly set BGE_HCC_STATS_ADDR_HI by using BGE_HOSTADDR.David Gwynne
this makes it consistent with the rest of the code.
2017-02-12Replace dummy mutex asserts with real ones.Visa Hankala
OK stsp@
2017-02-12Remove dead assignment and now unused variable.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok dlg@
2017-02-12Remove incorrect if statementMike Belopuhov
Pointed out by jsg@ and Nathanael Rensen, <nathanael at list ! polymorpheus ! com>, thanks!
2017-02-12The videocore portion of the raspberry pi which boots the arm cores andJonathan Gray
runs the mailbox interface knows about a MAC address that appears to be derived from a unique serial number along with the raspberry pi foundation oui. It modifies the device tree when booting to store the MAC address in /axi/usb/hub/ethernet/mac-address so fetch and use this value for the integrated smsc(4) Ethernet. A different smsc adapter plugged into one of the USB ports probes later with a different unit number and skips this path.
2017-02-12Fix an uninitialised return value in rtwn_ra_init(). Though nothingJonathan Gray
currently tests the return value. ok stsp@
2017-02-11disable aen handling.David Gwynne
on some or all original mfii boards (2208) the aen path fires repeatedly without reporting anything, causes enough load to start actual io. found by naddy@
2017-02-10Update link to intel HDA spec. FromAlexandre Ratchov
Alexey Suslikov <alexey.suslikov at gmail.com>. Thanks.
2017-02-10Fix links to usb-audio specs. From Michael Reed <m.reed at mykolab.com>.Alexandre Ratchov
Thanks.
2017-02-10Use __func__ for DPRINTF's as we do in other parts of theAlexandre Ratchov
code. From Michael W. Bombardieri" <mb at ii.net>. Thanks.
2017-02-10Remove unused variable. From Michael W. Bombardieri <mb at ii.net>.Alexandre Ratchov
Thanks.
2017-02-08Improve error handling for poll timeoutsMike Belopuhov
2017-02-08Specify the read/write DMA flag for bounce buffersMike Belopuhov
2017-02-08Cleanup the device removal pathMike Belopuhov
When destroying the ring all transfers should be already gone so there should be no need to repeat ourselves after xbf_stop has done its work. Get rid of the yield() that was probably masking some issues that have been since fixed.
2017-02-08Switch to Xen interrupt barrier and improve state transitionsMike Belopuhov
2017-02-08Abort transactions with non-retriable error when device is stoppedMike Belopuhov
2017-02-08Switch to Xen interrupt barrierMike Belopuhov
2017-02-08Introduce Xen interrupt barriersMike Belopuhov
intr_barrier(9) is useful to make sure that after an interrupt is masked, the interrupt handler for the device has finished executing before proceeding with further device configuration. However, since Xen interrupt handlers run in the thread context, we need to make sure that they have finished as well. By scheduling a xen_barrier_task modelled after (or rather copied ;) ifq_barrier_task we can ensure that the interrupt handler is no longer running.
2017-02-08Fixup incorrect test when allocating grant table entriesMike Belopuhov
An xnf & xbf attach/detach loop has revealed that sometimes when we're about to free a grant table entry that is still in use which is a grave mistake code wise. Turned out we could allocate an entry twice because of an incorrect test that took flags value into account when making the decision regarding availability of a given entry. At the same time, upon releasing the entry we explicitly CAS in 0 into the flags making this check bogus. While here be explicit about starting flags by initializing them to 0 and always panic when the "double free" condition is encountered. rzalamena@ has lent me his eyes and has double-checked the condition.
2017-02-08fix a mixup of lengths of addresses and lengths in the aen_start sglDavid Gwynne
basically use htolem64 to set the address and htolem32 for the length, not the other way round. lucky this is mostly run on x86. found by Jon Kloske
2017-02-07Reduce the per-packet allocation costs for crypto operations (cryptop)Patrick Wildt
by pre-allocating two cryptodesc objects and storing them in an array instead of a linked list. If more than two cryptodesc objects are required use mallocarray to fetch them. Adapt the drivers to the new API. This change results in one pool-get per ESP packet instead of three. It also simplifies softraid crypto where more cryptodesc objects are allocated than used. From, with and ok markus@, ok bluhm@ "looks sane" mpi@
2017-02-07The return code of crp_callback is never checked, so it is notAlexander Bluhm
useful to propagate the error. When an error occurs in an asynchronous network path, incrementing a counter is the right thing. There are four places where an error is not accounted, just add a comment for now. OK mpi@ visa@
2017-02-07Make the 'incomplete header' message debug onlyMike Belopuhov
2017-02-07Release the NET_LOCK() before entering per-driver ioctl() routine.Martin Pieuchot
This prevents a deadlock with the X server and some wireless drivers. The real fix is to take unix domain socket code out of the NET_LOCK(). Issue reported by pirofti@ and ajacoutot@ ok tb@, stsp@, pirofti@
2017-02-07pull struct mfi_evtarg_pd_state out of struct mfi_evt_detail.David Gwynne
this lets me pass the specific argument to an aen handler in mfii. it also unbreaks the tree. found by jmatthew@
2017-02-07move the mbuf pools to m_pool_init and a single global memory limitDavid Gwynne
this replaces individual calls to pool_init, pool_set_constraints, and pool_sethardlimit with calls to m_pool_init. m_pool_init inits the mbuf pools with the mbuf pool allocator, and because of that doesnt set per pool limits. ok bluhm@ as part of a larger diff
2017-02-07Test for NULL before dereferencing a pointer not after.Jonathan Gray
2017-02-07handle physical disk state changes.David Gwynne
more specificially we probe the disk if it goes from UNCONFIGURED_GOOD to a SYSTEM disk, and detach it if goes from being a SYSTEM disk to anything else. this semantic comes from the lsi^Wavago code in the illumos mr_sas driver. seems to work fine. i think this covers all the ways a passthru disk can transition on these boards.
2017-02-07i got the MFII_TASK_MGMT flags round the wrong way.David Gwynne
2017-02-07support hotplug of physical disks.David Gwynne
this only handles MFI_EVT_PD_INSERTED_EXT and MFI_EVT_PD_REMOVED_EXT so far. if this code is to be reused in mfi, it should probably change to use MFI_EVT_PD_INSERTED and MFI_EVT_PD_REMOVED instead. unlike mpii and mpi, it looks like the firmware aborts outstanding commands against a disk when it's physically removed, so we dont have to explicitly abort them. this is probably a carry over from mfi generation boards which dont have an explicit abort command they can use.
2017-02-07add the framework around asynchronous event notifications.David Gwynne
this submits MR_DCMD_CTRL_EVENT_WAIT commands via the async dcmd path to read all events from boot onward, and eventually ends up waiting after the boot messages are consumed. right now none of the events are handled, but this can be added now this framework is in place. the board does generate human readable log messages for every event. we can send them somewhere (dmesg or syslog for example), but for now theyre masked by #if 0.
2017-02-07provide support for submitting async dcmd frames.David Gwynne
async dcmds are submitted via an mpii request (like the scsi commands are) which uses the ccb_request buffer, meaning that the dcmd itself has to go somewhere else. this reuses the sense buffer on the ccb for the dcmd, and provides wrappers for accessing that space and submitting a dcmd via the passthru command.
2017-02-07whitespace fixes. no functional change.David Gwynne
2017-02-06Add proper locking for the interrupt source listMike Belopuhov
Now that we can attach and detach devices, we need to make sure we can do so while interrupts are running. Thankfully, in the meantime the refcnt_init(9) API came around to help us out.
2017-02-06XST_POLL turned out to be pretty useless since it's only set when coldMike Belopuhov
2017-02-06Fixup a few errors, make detaching more robustMike Belopuhov
2017-02-06Use separate compile time debug flags for xen, xnf and xbfMike Belopuhov
2017-02-06implement scsi command timeouts.David Gwynne
there's a struct timeout in scsi_xfer for this purpose, which is used to schedule a timeout of the command in the future. the timeout adds the xs to a list in mfii_softc of outstanding commands that are to be aborted. this list is processed in a task so we can sleep for an mfii_ccb. the new ccb is used to issue an abort against the specific command that timed out. to avoid having a timeout complete at the same time as a command on the chip, a refcnt is added to ccbs. the chip and the timeout get a ref each. the mfii completion path will attempt to timeout_del, and if that's succesful it will subtract the timeouts ref as well as its own. if it fails, the abort path owns the ccb and becomes responsible for calling scsi_done on behalf of the mfii completion path.
2017-02-06megaraid sas fusion chips have their own command for aborting tasksDavid Gwynne
2017-02-04Prefer <sys/endian.h> to <machine/endian.h>Philip Guenther
ok visa@
2017-02-04Prefer <sys/endian.h> to <machine/endian.h>Philip Guenther
ok stsp@
2017-02-04Prevent netlock related deadlock with the X server during iwm(4) scans.Paul Irofti
The issue appears at least with 7265 and 8260 chips as confirmed by stsp@, tb@ and myself. Fixed by unlocking NET_LOCK() at the beginning of iwmioctl() and relocking it at the end. Guidance and ok mpi@, ok stsp@.
2017-02-03yasuoka@ reported that a "guest shutdown" resulted in a reboot insteadJonathan Gray
of a shutdown. Correct a mistake in rev 1.11 to make this trigger a shutdown again. ok reyk@
2017-02-02Remove dead assignments and now unused variables.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok mpi@
2017-02-02copy the mbox into the dcmd struct, not the pointer to the mbox.David Gwynne
makes bioctl work on mfi(4) again. while here memset a few mboxes before using them. bioctl breakage reported by jason george
2017-02-01Fix format strings in cy(4), allows to compile with CY_DEBUG.Alexander Bluhm
From Jan Klemkow
2017-02-01Add AMRR support to rtwn(4). Based on code from FreeBSD.Stefan Sperling
Works much better than firmware-based rate scaling in my testing. ok mpi@
2017-02-01In athn(4), if multi-rate retry is disabled due to RTS being used, then doStefan Sperling
not tell rate scaling algos about failed retries. All attempts use the same rate anyway, so checking whether the frame succeeded or failed is good enough. ok mpi@
2017-01-31Configure rtwn's ACMHWCTRL register correctly. Bits in this registerStefan Sperling
correspond to the flag stored in our stack as ac->ac_acm. ok mpi@