summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2014-09-23add Bay Trail and Braswell SMBusJonathan Gray
2014-09-23Fix high capacity (> 2GB) eMMC support.Raphael Graf
Based on a diff by Cedric Tessier, nezetic at gmail dot com, thanks! Discussed with and ok jsg@
2014-09-23Make use of the red-black tree as the original Linux code did insteadJonathan Gray
of interating over the tree like a list. From Andriy Gapon in FreeBSD. ok kettenis@
2014-09-23dont need to call bpfdetach cos if_detach does it for you.David Gwynne
delete some stupid comments while there. ok deraadt@ brad@
2014-09-23lock around the sysctl code that sets the bpf buffer sizes so if we everDavid Gwynne
get multiple processes in the kernel these sets cant race and allow people to set the default greater than the max.
2014-09-22remove a stupid comment above bpfilterattach about how we dont do anythingDavid Gwynne
in it cos its only called on new systems, when it actually does. we dont care about old or new systems, just ours. the code is called, the fact that it exists is enough to demonstrate that.
2014-09-22stash a pointer to bpf_d in the knotes kn_hook instead of the device id.David Gwynne
we refcount the bpf_d memory correctly so it cant go away. possibly worse is the bpf minor id could be reused between the kq calls, so this seems safer to me. also avoids a list walk on each op cos the ptr is just there.
2014-09-22it's easy to allow bpfwrites bigger than MCLBYTES now that we haveDavid Gwynne
large cluster pools and MCLGETI. we could chain mbufs if we want to go even bigger. with a fix from Mathieu- <naabed at poolp dot org>
2014-09-22if you request a read timeout and then use kqueues to wait for them, youDavid Gwynne
end up waiting until the ring is full cos the timeout doesnt get set up when the knote is registered.
2014-09-22add Winchiphead CH382 support.sasano
CH382 has 2S/2S1P/1P configuration, the diff supports 2S/2S1P only (2S1P works as 2S). ok by deraadt@ and kettenis@
2014-09-22implement atomic_{cas,swap}_{uint,ulong,ptr} andDavid Gwynne
atomic_{add,sub}_{int,long}_nv. sys/atomic.h turns these into the rest of the atomic api. on uniprocessor hppa systems "atomic" operations are implemented as a non-interruptable sequence by disabling all interrupts on the cpu, doing the operation, and then restoring the interrupt mask. this isnt enough on MP systems, so we added a global atomic memory mutex that is taken inside the interrupt disabling above to coordinate operations between cpus. this is a lot of overhead though cos mutexes dance around with ipls, which is unecessary in our case because of the interrupt disabling that is already done. also, hppa spinlocks are implemented with ldcw which requires the word it operates on to be 16 byte aligned. mutexes arent guaranteed to have this alignment so they compensate by having lots of words inside themselves so they can hit the appropriate one to use for the ldcw op. with this in mind, this change pulls __cpu_simple_locks, which are simply ldcw spinlocks with a 16 byte aligned word, out of src/sys/arch/hppa/include/lock.h into src/sys/arch/hppa/include/atomic.h so atomic.h can use them. lock.h includes atomic.h, so it still gets and provides the same functionality as before. finally, this also pulls the rwlock cas implementation apart. cas ops now share the same serialising lock on MP systems as the other memory operations, and rw_cas is defined as a wrapper around atomic_cas_uint. ok kettenis@
2014-09-22Enable power saving modes for IBM PowerPC 970 CPUs.Martin Pieuchot
ok miod@
2014-09-22Drop the kernel lock when copying data to/from the other domain duringMark Kettenis
read/write operations.
2014-09-22Add missing format specifier.Brad Smith
Pointed out by LLVM. db_disasm.c:1018:13: error: format string is not a string literal (potentially insecure) ok miod@
2014-09-22the kn_hook member of a knote is a void *, so we dont have to castDavid Gwynne
to or from it. ok gcc
2014-09-22rework the pool code to make the locking more obvious (to me atDavid Gwynne
least). after this i am confident that pools are mpsafe, ie, can be called without the kernel biglock being held. the page allocation and setup code has been split into four parts: pool_p_alloc is called without any locks held to ask the pool_allocator backend to get a page and page header and set up the item list. pool_p_insert is called with the pool lock held to insert the newly minted page on the pools internal free page list and update its internal accounting. once the pool has finished with a page it calls the following: pool_p_remove is called with the pool lock help to take the now unnecessary page off the free page list and uncount it. pool_p_free is called without the pool lock and does a bunch of checks to verify that the items arent corrupted and have all been returned to the page before giving it back to the pool_allocator to be freed. instead of pool_do_get doing all the work for pool_get, it is now only responsible for doing a single item allocation. if for any reason it cant get an item, it just returns NULL. pool_get is now responsible for checking if the allocation is allowed (according to hi watermarks etc), and for potentially sleeping waiting for resources if required. sleeping for resources is now built on top of pool_requests, which are modelled on how the scsi midlayer schedules access to scsibus resources. the pool code now calls pool_allocator backends inside its own calls to KERNEL_LOCK and KERNEL_UNLOCK, so users of pools dont have to hold biglock to call pool_get or pool_put. tested by krw@ (who found a SMALL_KERNEL issue, thank you) noone objected
2014-09-21add a missing break statement in the RL_HWREV_8168E_VL caseJonathan Gray
ok brad@
2014-09-21Reset fault status registers to zero after reading them, even in the 2:1Miod Vallat
CMMU-to-CPU ratio case. This is necessary at least on the AV530 family.
2014-09-21Don't check LAPIC_DLSTAT_BUSY again after an IPIStefan Fritsch
Depending on DIAGNOSTICS, i82489_icr_wait() will either spin or panic in this case. Therefore there is no need to check the flag again. On virtualization, this saves one VMEXIT per IPI. ok kettenis@
2014-09-21Don't request an ACK from the server if we're polling.Mark Kettenis
2014-09-21Decouple polled commands from the interrupt handler.Mark Kettenis
2014-09-21regensasano
2014-09-21add Winchiphead CH382 vendor/device IDsasano
ok by henning@
2014-09-21Directly include sys/timeout.h so we don't depend onJonathan Gray
indirectly including it via dev/ic/pckbcvar.h Fixes kernel builds without ukbd(4) and pckbd(4). From Atticus on tech@
2014-09-20Make another fast path properly atomic.Mark Kettenis
2014-09-20Fix bug in taskq conversion that would lead to a null pointer dereference.Mark Kettenis
ok krw@, jsg@
2014-09-20On i386, agp_map_subregion might sleep, which is not allowed in some ofMark Kettenis
the inteldrm code. Fix this by adding new interfaces that can map a single page without sleeping and use that in the execbuffer fast path that needs this "atomic" behaviour. Should fix the panic I've seen under memory pressure on i386.
2014-09-20Use config_suspend_all(9).Mark Kettenis
ok mpi@, uebayasi@, dlg@
2014-09-19Use config_suspend_all(9).Mark Kettenis
2014-09-19Use config_suspend_all(9).Mark Kettenis
2014-09-19Use config_suspend_all(9).Mark Kettenis
2014-09-19Move EHOSTUNREACH, EOVERFLOW and ECANCELED out from under __BSD_VISIBLETodd C. Miller
since modern POSIX specifies them. OK guenther@
2014-09-19add missing break statements giving alaw encodingJonathan Gray
a chance of working instead of returning EINVAL. ok miod@
2014-09-19add missing break statements to imxccm_get_fecclk()Jonathan Gray
tested by matthieu@ on Sabre lite
2014-09-19better boundchecks in validation; from Guy Harris; ok millert@ dlg@Otto Moerbeek
2014-09-19Use correct printf format when MP_LOCKDEBUG is defined.Martin Pieuchot
2014-09-19passing M_NOWAIT to m_tag_get means it can fail, which could hitDavid Gwynne
the failure path which leaks all the stuff the previous code in bpf_movein allocates. since it's only called from bpfwrite, use M_WAIT instead to make it reliable and just get rid of the bogus failure code. ok miod@
2014-09-18Use config_suspend_all(9).Mark Kettenis
ok dlg@
2014-09-18Introduce config_suspend_all(9) a function that invokes config_suspend(9)Mark Kettenis
on all relevant device hierarchies in the appropriate order. For now this means mpath(4) and mainbus(4), doing mpath(4) before mainbus(4) when suspending or powering down and doing mpath(4) after mainbus(4) when resuming such that mpath(4) can realy on the underlying hardware being in a functional state. Fixes problems with unflushed disk caches on machines where mpath(4) takes control of some of your disks. ok dlg@
2014-09-18Some disks, such as the Seagate Cheetah 73LP FC with Sun firmwareMark Kettenis
(ST373405FSUN72G) respond to a START STOP UNIT command that spins down the disk with a "Logical Unit Not Ready, Initialization Command Required". Besides causing some dmesg spam, our sd(4) driver responds to such a response by spinning the disk back up. Prevent this from happening by respecting the SCSI_IGNORE_NOT_READY flag and using that flag when spinning down the disk. ok miod@
2014-09-18ansify function declaration things.David Gwynne
ok mpi@ henning@ krw@
2014-09-18regenMasao Uebayashi
2014-09-18Correct argument name (int flags -> int amode) in sys_access().Masao Uebayashi
OK guenther@
2014-09-17regenTodd C. Miller
2014-09-17The 2nd arg of setpgid(2) should be pid_t, not int.Todd C. Miller
No functional change as pid_t is defined as int32_t. OK miod@
2014-09-17be less confusing to the compiler when setting up the sge.David Gwynne
2014-09-17if userland asks for an unknown sysctl, return EOPNOTSUPP insteadDavid Gwynne
of EINVAL like other sysctl things do.
2014-09-16disable taking the mutex to read pool stats.David Gwynne
some pool users (eg, mbufs and mbuf clusters) protect calls to pools with their own locks that operate at high spl levels, rather than pool_setipl() to have pools protect themselves. this means pools mtx_enter doesnt necessarily prevent interrupts that will use a pool, so we get code paths that try to mtx_enter twice, which blows up. reported by vlado at bsdbg dot net and matt bettinger diagnosed by kettenis@
2014-09-16tweak panics so they use __func__ consistently.David Gwynne
2014-09-16Check the right descriptor field when polling for completion.Mark Kettenis