delphij [Fri, 26 Oct 2012 00:28:29 +0000 (00:28 +0000)]
MFC r240210:
It seems that what the code really meant is that when a write is completed,
do a BUS_DMASYNC_POSTWRITE over the DMA map. The way it currently is would
only do POSTREAD for read transactions.
gavin [Wed, 24 Oct 2012 19:22:43 +0000 (19:22 +0000)]
Merge r240680 from head:
Align the PCI Express #defines with the style used for the PCI-X
#defines. This has the advantage that it makes the names more
compact, and also allows us to correct the non-uniform naming of
the PCIM_LINK_* defines, making them all consistent amongst themselves.
This is a mostly mechanical rename:
s/PCIR_EXPRESS_/PCIER_/g
s/PCIM_EXP_/PCIEM_/g
s/PCIM_LINK_/PCIEM_LINK_/g
In this MFC, #defines have been added for the old names to assist
out-of-tree drivers.
gavin [Wed, 24 Oct 2012 19:04:17 +0000 (19:04 +0000)]
Merge r240680 from head:
Align the PCI Express #defines with the style used for the PCI-X
#defines. This has the advantage that it makes the names more
compact, and also allows us to correct the non-uniform naming of
the PCIM_LINK_* defines, making them all consistent amongst themselves.
This is a mostly mechanical rename:
s/PCIR_EXPRESS_/PCIER_/g
s/PCIM_EXP_/PCIEM_/g
s/PCIM_LINK_/PCIEM_LINK_/g
In this MFC, #defines have been added for the old names to assist
out-of-tree drivers.
glebius [Wed, 24 Oct 2012 10:32:39 +0000 (10:32 +0000)]
Merge r240385 from head:
Describe in detail required conditions for receiving the SCM_CREDS
control message and suggest to use LOCAL_CREDS setsockopt() for
reliability.
glebius [Wed, 24 Oct 2012 10:28:12 +0000 (10:28 +0000)]
Merge r240234, r240271, r240734 from head:
r240234:
The first part of check_priv() function, that attempts to obtain creds
from the control message, actually never worked. This means check_priv()
didn't work for local dgram sockets.
The SCM_CREDS control messages is received only in two cases:
1) If we did setsockopt(LOCAL_CREDS) on our socket, and in this case
the message is struct sockcred.
2) If sender did supplied SCM_CREDS control message in his sendmsg()
syscall. In this case the message is struct cmsgcred.
We can't rely on 2), so we will use 1) for dgram sockets. For stream
sockets it is more reliable to obtain accept-time credentials, since
SCM_CREDS control message is attached only on first read. Thus:
o Do setsockopt(LOCAL_CREDS) on local dgram sockets.
o Split check_priv() into check_priv_stream() and check_priv_dgram(),
and call them from recv_stream() and recv_dgram() respectively.
o Don't provide space for SCM_CREDS control message in recv_stream().
o Provide space for SCM_CREDS control message in recv_dgram(), but there
is no need to initialize anything in it.
o In recv_dgram() do not blindly expect that first message is SCM_CREDS,
instead use correct search cycle through control messages.
r240271:
For UDP transport set IP_RECVDSTADDR sockopt on the socket, and provide
IP_SENDSRCADDR control with datagram message we reply with. This makes
bsnmpd reply from exactly same address that request was sent to, thus
successfully bypassing stateful firewalls or other kinds of strict checking.
r240734:
Re-do r240271:
- Set IP_RECVDSTADDR sockopt on the socket only in case if
it is INADDR_ANY bound.
- Supply IP_SENDSRCADDR control message only if we did receive
IP_RECVDSTADDR control message.
This fixes operation of snmpd bound to a specific local IP address.
glebius [Wed, 24 Oct 2012 09:53:34 +0000 (09:53 +0000)]
Merge 240073 from head:
Provide a sysctl switch that allows to install ARP entries
with multicast bit set. FreeBSD refuses to install such
entries since 9.0, and this broke installations running
Microsoft NLB, which are violating standards.
mav [Tue, 23 Oct 2012 15:37:57 +0000 (15:37 +0000)]
MFC r241536:
Add explicit check for not set time inside cam_periph_freeze_after_event().
System time is set later on boot process then initial bus scan by CAM.
Until that moment microtime() is equal to microuptime(), and if system
boots quickly, the value can be close to zero. That causes settle time
waiting even for buses that don't use reset during probe.
On my test system this reduces boot time by 1 second if USB enabled, or
by 4 seconds if USB disabled. CAM waited for ctl2cam0 bus "settle".
mav [Tue, 23 Oct 2012 15:36:23 +0000 (15:36 +0000)]
MFC r241510:
Don't exclude XPT SIM from locking in xpt_create_path_unlocked().
We don't want xpt periph, device, target or bus disappeared because of
incorrect reference counting.
mav [Tue, 23 Oct 2012 15:31:50 +0000 (15:31 +0000)]
MFC r241504:
Fix XPT_DEBUG paths operations locking:
- Extend the lock to cover xpt_path_release() for the new path.
- While xpt_action() is called while holding right SIM lock for the new
bus, the old path release may require different SIM lock. So we have
to temporary drop the new lock and get the old one.
mav [Tue, 23 Oct 2012 15:25:19 +0000 (15:25 +0000)]
MFC r241456:
Use separate malloc buckets for CAM devices, CCBs and paths. This will
make it easier to track down the source of any use after free problems.
mav [Tue, 23 Oct 2012 15:20:59 +0000 (15:20 +0000)]
MFC r241410:
There are SCSI conditions that are not an errors. In those cases cderror()
returns zero while request status is not CAM_REQ_CMP. That could cause
partial device attach or other unexpected results.
mav [Tue, 23 Oct 2012 15:18:16 +0000 (15:18 +0000)]
MFC r241405:
Really handle xpt_compile_path() error in xpt_bus_register() instead of
print error message and probably crash just after it on NULL dereference.
mav [Tue, 23 Oct 2012 15:16:50 +0000 (15:16 +0000)]
MFC r241404:
Remove 'periph == NULL' check from bunch of periph drivers.
This condition can never be true as functions are called from single place
and the checks just pollute the code and confuse Clang Static Analyzer.
mav [Tue, 23 Oct 2012 15:15:16 +0000 (15:15 +0000)]
MFC r241028:
Change queue overflow checks from DIAGNOSTIC+panic() to KASSERT() to make
them enabled on HEAD by default. It is probably better to do single compare
then hunt for unexpected memory corruption.
jhb [Tue, 23 Oct 2012 12:37:02 +0000 (12:37 +0000)]
MFC 228157:
- Fix segmentation fault when running "+command" when run with -jX -n due
to Compat_RunCommand() being called with `cmd' that is not on the
node->commands list
- Make ellipsis ("..." command) handling consistent: check for "..." command
in job make after variables expansion to match compat make behavior
- Fix empty command handling (after variables expansion and @+- modifiers
are processed): now empty commands are ignored in compat make and are not
printed in job make case
marius [Mon, 22 Oct 2012 11:07:59 +0000 (11:07 +0000)]
MFC: r241734
Let SCHED_ULE give affinity to the CPU the tick interrupt triggered on
when running tick_process(), similarly to what the x86 equivalents of
this function do, however employing the less racy sequence also used in
intr_event_handle().
marius [Sun, 21 Oct 2012 11:43:43 +0000 (11:43 +0000)]
MFC: r241679
It turns out that as documented, PCF8563_R_SECOND_VL (i.e. battery low)
doesn't automatically clear when VDD rises above Vlow again and needs to be
cleared manually. However, apparently this needs all of the time registers
to be set, i.e. pcf8563_settime(), and not just PCF8563_R_SECOND in order
for PCF8563_R_SECOND_VL to stick. Thus, we just issue a warning during
pcf8563_attach() rather than failing with ENXIO in case it is set.
brooks [Sun, 21 Oct 2012 09:31:48 +0000 (09:31 +0000)]
MFC r228120:
Allow NO_FOO to override WITH_FOO that could be specified in /etc/src.conf.
This is required to override knobs (e.g. WITH_PROFILE) during buildworld
stages in Makefile.inc1 (otherwise the build is stopped due to both WITH_FOO
and WITHOUT_FOO defined).
mav [Fri, 19 Oct 2012 19:27:33 +0000 (19:27 +0000)]
MFC r241444:
Increase device CCB queue array size by CAM_RL_VALUES - 1 (4) elements.
It is required to store extra recovery requests in case of bus resets.
On ATA/SATA this fixes assertion panics on HEAD with INVARIANTS enabled or
possible memory corruptions otherwise if timeout/reset happens when device
CCB queue is already full.
mav [Fri, 19 Oct 2012 17:39:15 +0000 (17:39 +0000)]
MFC r241375:
Cast vendor-specific spell on VIA VT1818S codecs alike to VT1708S to
make analog input loopback and dual-stream playback work by enabling
signal mixing by nid 22, as it should be according to info returned by
the CODEC. Otherwise pin nid 28 receives only signal from DAC nid 16.
jhb [Fri, 19 Oct 2012 00:22:09 +0000 (00:22 +0000)]
MFC 227429,228121,228124,228137,228140,228141,228147,228153,228158,228311,
241395,241396:
Various fixes to WITH_CTF:
- Conditionalize ctfconvert/ctfmerge runs on make level (.if/.endif)
instead of executing a shell on every object or executable/library file.
- CTF knob is now implemented using common scheme: MK_CTF=yes/no is
defined based on WITH/WITHOUT_CTF settings, default is WITHOUT_CTF,
NO_CTF overrides WITH_CTF (used by Makefile.inc1)
- Add missing calls to ctfconvert/ctfmerge for various edge cases.
marius [Thu, 18 Oct 2012 15:20:37 +0000 (15:20 +0000)]
MFC: r239089
- Merge from NetBSD:
When issuing a non-DMA command, make sure to set the "remaining length of
command to be transferred via DMA" (sc_cmdlen) to zero up-front, otherwise
we might get confused on command competition interrupt (no DMA active but
still data left to transfer).
- Implement handling of MSG_IGN_WIDE_RESIDUE which some targets produce, as
just rejecting these leads to a resend and disconnect loop.
Reported and tested by: mjacob
marius [Thu, 18 Oct 2012 12:06:26 +0000 (12:06 +0000)]
MFC: r239864
- Unlike cache invalidation and TLB demapping IPIs, reading registers from
other CPUs doesn't require locking so get rid of it. As the latter is used
for the timecounter on certain machine models, using a spin lock in this
case can lead to a deadlock with the upcoming callout(9) rework.
- Merge r134227/r167250 from x86:
Avoid cross-IPI SMP deadlock by using the smp_ipi_mtx spin lock not only
for smp_rendezvous_cpus() but also for the MD cache invalidation and TLB
demapping IPIs.
- Mark some unused function arguments as such.
pfg [Tue, 16 Oct 2012 01:37:17 +0000 (01:37 +0000)]
MFC r241143:
rpc: be sure to free cl_netid and cl_tp.
When creating a client with clnt_tli_create, it uses strdup to copy
strings for these fields if nconf is passed in. clnt_dg_destroy frees
these strings already. Make sure clnt_vc_destroy frees them in the same
way.
np [Mon, 15 Oct 2012 06:48:50 +0000 (06:48 +0000)]
MFC r241401, r241416.
r241401:
Add an "i2c" subcommand to cxgbetool. You can use this to read
information from the transceivers connected to the ports of a
cxgbe(4) based card.
np [Mon, 15 Oct 2012 06:41:54 +0000 (06:41 +0000)]
MFC r241397-241399, r241409, r241493-24194.
r241397:
Remove unused item. cxgbe's rx queue's lock was removed a long time ago.
r241398:
There is no need to report the same error twice.
r241399:
Add a driver ioctl to read a byte from any device on a port's i2c bus.
This lets userspace read arbitrary information from the SFP+ modules
etc. on this bus.
Reading multiple bytes in the same transaction isn't possible right now.
I'll update the driver once the chip's firmware supports this.
r241409:
Add a driver ioctl to clear a port's MAC statistics.
r241493:
Use global knob in the TP_PARA_REG3 register to disable congestion
drops if the user has chosen this behaviour.
rmacklem [Mon, 15 Oct 2012 01:09:33 +0000 (01:09 +0000)]
MFC: r241097
Attila Bogar and Herbert Poeckl both reported similar problems
w.r.t. a Linux NFS client doing a krb5 NFS mount against the
FreeBSD server. We determined this was a Linux bug:
http://www.spinics.net/lists/linux-nfs/msg32466.html, however
the mount failed to work, because the Destroy operation with a
bogus encrypted checksum destroyed the authenticator handle.
This patch changes the rpcsec_gss code so that it doesn't
Destroy the authenticator handle for this case and, as such,
the Linux mount will work.