Commit Graph

85053 Commits

Author SHA1 Message Date
Sergey Kandaurov
86872b65ef Isolate v_caddr_t in the ie driver.
Submitted by:	Bruce Evans on net@
2012-01-31 13:00:40 +00:00
Alexander Motin
c6c4eaa848 Just in case, clear stream interrupts before enabling them. 2012-01-31 12:57:21 +00:00
Rick Macklem
87b633678b When a "mount -u" switches an NFS mount point from TCP to UDP,
any thread doing an I/O RPC with a transfer size greater than
NFS_UDPMAXDATA will be hung indefinitely, retrying the RPC.
After a discussion on freebsd-fs@, I decided to add a warning
message for this case, as suggested by Jeremy Chadwick.

Suggested by:	freebsd at jdc.parodius.com (Jeremy Chadwick)
MFC after:	2 weeks
2012-01-31 03:58:26 +00:00
Rick Macklem
a8122d16b5 jwd@ reported a problem via email to freebsd-fs@ on Aug 25, 2011
under the subject "F_RDLCK lock to FreeBSD NFS fails to R/O target file".
This occurred because the server side NLM always checked for VWRITE
access, irrespective of the type of lock request. This patch
replaces VOP_ACCESS(..VWRITE..) with one appropriate to
the lock operation. It allows unlock and lock cancellation
to be done without a check of VOP_ACCESS(), so that files
can't be left locked indefinitely after the file permissions
have been changed.

Discussed with:	zack
Submitted by:	jwd (earlier version)
Reviewed by:	dfr
MFC after:	2 weeks
2012-01-31 02:11:05 +00:00
Adrian Chadd
62f8a13a75 Add a DFS debugging mode which is useful when doing automated DFS
compliance testing.

In order to allow for radar pattern matching to occur, the DFS CAC/NOL
handling needs to be made configurable.  This commit introduces a new
sysctl, "net.wlan.dfs_debug", which controls which DFS debug mode
net80211 is in.

* 0 = default, CSA/NOL handling as per normal.
* 1 = announce a CSA, but don't add the channel to the non-occupy list
  (NOL.)
* 2 = disable both CSA and NOL - only print that a radar event occured.

This code is not compiled/enabled by default as it breaks regulatory
handling.  A user must enable IEEE80211_DFS_DEBUG in their kernel
configuration file for this option to become available.

Obtained from:	Atheros
2012-01-31 00:03:49 +00:00
Adrian Chadd
7f925de11a Radar API related fixes.
* For legacy NICs, the combined RSSI should be used.
  For earlier AR5416 NICs, use control chain 0 RSSI rather than combined
  RSSI.
  For AR5416 > version 2.1, use the combined RSSI again.

* Add in a missing AR5212 HAL method (get11nextbusy) which may be called
  by radar code.

This serves no functional change for what's currently in FreeBSD.
2012-01-30 23:07:27 +00:00
Jack F Vogel
3e52ad9cc6 Wrap the bool typedef 2012-01-30 23:03:21 +00:00
Warner Losh
1b1dd1f89e Improve media status reporting, when the driver knows... 2012-01-30 22:47:02 +00:00
Konstantin Belousov
6ad1ff09cc A debugger which requested PT_FOLLOW_FORK should get the notification
about new child not only when doing PT_TO_SCX, but also for PT_CONTINUE.
If TDB_FORK flag is set, always issue a stop, the same as is done for
TDB_EXEC.

Reported by:	Dmitry Mikulin <dmitrym juniper net>
MFC after:	1 week
2012-01-30 20:00:29 +00:00
Konstantin Belousov
1b38b22739 Add definition for PT_GNU_RELRO.
MFC after:	3 days
2012-01-30 19:50:13 +00:00
John Baldwin
2bd3e4c2c2 Refine the implementation of POSIX_FADV_NOREUSE for the read(2) case such
that instead of using direct I/O it allows read-ahead similar to
POSIX_FADV_NORMAL, but invokes VOP_ADVISE(POSIX_FADV_DONTNEED) after the
read(2) has completed to purge just-read data.  The write(2) path continues
to use direct I/O for POSIX_FADV_NOREUSE for now.  Note that NOREUSE works
optimally if an application reads and writes full fs blocks.
2012-01-30 19:35:15 +00:00
Konstantin Belousov
75ce221fa1 Fix build for the case of powerpc64 kernel without COMPAT_FREEBSD32.
MFC after:	2 months
2012-01-30 19:31:17 +00:00
Doug Ambrisko
8e9fc27818 When detaching an AIO or LIO requests grab the lock and tell knlist_remove
that we have the lock now.  This cleans up a locking panic ASSERT when
knlist_empty is called without a lock when INVARIANTS etc. are turned.

Reviewed by:	kib jhb
MFC after:	1 week
2012-01-30 19:19:22 +00:00
Jung-uk Kim
bc536d5ac5 Naturally align a newly added wakeup_fpusave. 2012-01-30 18:28:56 +00:00
Jack F Vogel
85d0a26ed4 New hardware support: Intel X540 adapter support added.
Some shared code reorganization along with the new adapter.
Sync changes to OACTIVE in igb into this driver.
Misc small fixes.
2012-01-30 16:42:02 +00:00
John Baldwin
c7e6732dde Add a constant for the PCI-e surprise link down uncorrectable error. 2012-01-30 15:09:03 +00:00
Alexander Motin
4bff0fc61b Fix typo in comments. 2012-01-30 09:59:33 +00:00
Konstantin Belousov
62c625fdd2 Finally, try to enable the nxstacks on amd64 and powerpc64 for both 64bit
and 32bit ABIs. Also try to enable nxstacks for PAE/i386 when supported,
and some variants of powerpc32.

MFC after:	2 months (if ever)
2012-01-30 07:56:00 +00:00
Konstantin Belousov
94818d19c3 Move xrstor/xsave/xsetbv into fpu.c and reorder them.
Requested by:	bde
MFC after:	1 month
2012-01-30 07:53:33 +00:00
Konstantin Belousov
a045432a58 Synchronize the struct sigcontext definitions on x86 with mcontext_t.
Pointed out by:	bde
MFC after:	1 month
2012-01-30 07:51:52 +00:00
Adrian Chadd
dfdcd4c733 Missing code for receiving MESH PREP that should be part of r230409.
Submitted by:	<monthadar@gmail.com>
2012-01-29 19:35:40 +00:00
Eitan Adler
c6618b7f79 GS105v3 exhibit the same behavior
PR:			docs/135999
Submitted by:	Boris Kochergin <spawky@acm.poly.edu>
No objection from:	jfv
Approved by:	cperciva
MFC after:		3 days
2012-01-29 14:52:42 +00:00
Kip Macy
ad69d4e266 always exclude data bufs regardless of debug settings 2012-01-29 00:19:19 +00:00
Marius Strobl
96459db58f As it turns out r227960 may still be insufficient with PREEMPTION
so try harder to get the CDMA sync interrupt delivered and also in
a more efficient way:
- wrap the whole process of sending and receiving the CDMA sync
  interrupt in a critical section so we don't get preempted,
- send the CDMA sync interrupt to the CPU that is actually waiting
  for it to happen so we don't take a detour via another CPU,
- instead of waiting for up to 15 seconds for the interrupt to
  trigger try the whole process for up to 15 times using a one
  second timeout (the code was also changed to just ignore belated
  interrupts of a previous tries should they appear).

According to testing done by Peter Jeremy with the debugging also
added as part of this commit the first two changes apparently are
sufficient to now properly get the CDMA sync interrupts delivered
at the first try though.
2012-01-28 22:42:33 +00:00
Adrian Chadd
bfa5e92751 Oops, commit a missing implementation change.
Whilst I'm here, add a comment about what would happen in this function
if hypothetically you had a radar pattern matching detector written.
2012-01-28 22:24:59 +00:00
Marius Strobl
3c0f8828f4 Fully disable interrupts while we fiddle with the FP context in the
VIS-based block copy/zero implementations. While with 4BSD it's
sufficient to just disable the tick interrupts, with ULE+PREEMPTION
it's otherwise also possible that these are preempted via IPIs.
2012-01-28 22:22:05 +00:00
Adrian Chadd
ead404d417 Change the prototype so the radar enable can fail. 2012-01-28 21:44:42 +00:00
Adrian Chadd
06fc4a109d Two changes from my DFS work:
* Grab the net80211com lock when calling ieee80211_dfs_notify_radar().
* Use the tsf extend function to turn the 64 bit base TSF into a per-
  frame 64 bit TSF.  This will improve radiotap logging (which will
  now have a (more) correct per-frame TSF, rather then the single TSF64
  value read at the beginning of ath_rx_proc().
2012-01-28 21:37:33 +00:00
Kip Macy
cc0021eb34 add tunable for developers working on areas outside of ZFS
to further reduce core size by excluding ARC metadata buffers
from core dumps
2012-01-28 17:41:42 +00:00
Attilio Rao
5d7380f8e3 Avoid to check the same cache line/variable from all the locking
primitives by breaking stop_scheduler into a per-thread variable.
Also, store the new td_stopsched very close to td_*locks members as
they will be accessed mostly in the same codepaths as td_stopsched and
this results in avoiding a further cache-line pollution, possibly.

STOP_SCHEDULER() was pondered to use a new 'thread' argument, in order to
take advantage of already cached curthread, but in the end there should
not really be a performance benefit, while introducing a KPI breakage.

In collabouration with:	flo
Reviewed by:	avg
MFC after:	3 months (or never)
X-MFC:		r228424
2012-01-28 14:00:21 +00:00
Alexander Motin
f4cb8238fd Fix HBR enabling condition. cchs is from 0 to 7, not from 1 to 8. 2012-01-28 09:24:57 +00:00
Ed Maste
158c4475c8 pmc_*_initialize may return NULL if the CPU is not supported, so check
that md is not null before dereferencing it.

PR:		kern/156540
2012-01-28 01:38:48 +00:00
Marius Strobl
ad21bcec21 Commit file missed in r230633. 2012-01-27 23:25:24 +00:00
Marius Strobl
546e977edb Now that we have a working OF_printf() since r230631 and a OF_panic()
helper since r230632, use these for output and panicing during the
early cycles and move cninit() until after the static per-CPU data
has been set up. This solves a couple of issue regarding the non-
availability of the static per-CPU data:
- panic() not working and only making things worse when called,
- having to supply a special DELAY() implementation to the low-level
  console drivers,
- curthread accesses of mutex(9) usage in low-level console drivers
  that aren't conditional due to compiler optimizations (basically,
  this is the problem described in r227537 but in this case for
  keyboards attached via uart(4)). [1]

PR:	164123 [1]
2012-01-27 23:21:54 +00:00
Marius Strobl
a500e985ad - Now that we have a working OF_printf() since r230631, use it for
implementing a simple OF_panic() that may be used during the early
  cycles when panic() isn't available, yet.
- Mark cpu_{exit,shutdown}() as __dead2 as appropriate.
2012-01-27 22:35:53 +00:00
Marius Strobl
1cbb2a2408 Implement OF_printf() using kvprintf() directly, avoiding to use a
buffer and allowing to handle newlines properly
2012-01-27 22:29:29 +00:00
Marius Strobl
21bbe2ac13 For machines where the kernel address space is unrestricted increase
VM_KMEM_SIZE_SCALE to 2, awaiting more insight from alc@. As it turns
out, the VM apparently has problems with machines that have large holes
in the physical address space, causing the kmem_suballoc() call in
kmeminit() to fail with a VM_KMEM_SIZE_SCALE of 1. Using a value of 2
allows these, namely Blade 1500 with 2GB of RAM, to boot.

PR:	164227
2012-01-27 22:25:46 +00:00
Marius Strobl
733ce5d25e Mark cpu_{halt,reset}() as __dead2 as appropriate. 2012-01-27 22:04:43 +00:00
Marius Strobl
c7edae4bc2 Using ATA_CAM along with ATAPI DMA causes data corruption with ALI_NEW
and CMD controllers for reasons unknown so disable it.

PR:	164226
2012-01-27 21:52:59 +00:00
Warner Losh
dbd618bf56 Some laptops have weak power controllers that cannot tolerate multiple
cards powering up at once.  Work around the easy case (multiple cards
inserted on boot) with a short sleep and a long comment.  This
improves reliability on those laptops with power hungry cards.
2012-01-27 21:49:02 +00:00
Kip Macy
263811f724 exclude kmem_alloc'ed ARC data buffers from kernel minidumps on amd64
excluding other allocations including UMA now entails the addition of
a single flag to kmem_alloc or uma zone create

Reviewed by:	alc, avg
MFC after:	2 weeks
2012-01-27 20:18:31 +00:00
Bernhard Schmidt
0f7a9c77e3 On state changes from RUN to anything else the AGGR sessions are
cleared/dropped leading to qid2tap[n] being NULL as there no longer
is a tap. Now, if there have been lots of frames queued the firmware
processes and returns those after the tap is gone.

Tested by:	osa
MFC after:	1 week
2012-01-27 17:39:02 +00:00
Luigi Rizzo
7dec311e83 a variable was erroneously declared as 32 bit instead of 64.
MFC after:	3 days
2012-01-27 13:26:25 +00:00
Gleb Smirnoff
94fce84763 Fix size check, that prevents getting negative after casting
to a signed type

Reviewed by:	bde
2012-01-27 08:58:58 +00:00
Rick Macklem
7f763fc39c A problem with respect to data read through the buffer cache for both
NFS clients was reported to freebsd-fs@ under the subject "NFS
corruption in recent HEAD" on Nov. 26, 2011. This problem occurred when
a TCP mounted root fs was changed to using UDP. I believe that this
problem was caused by the change in mnt_stat.f_iosize that occurred
because rsize was decreased to the maximum supported by UDP. This
patch fixes the problem by using v_bufobj.bo_bsize instead of f_iosize,
since the latter is set to f_iosize when the vnode is allocated, but
does not change for a given vnode when f_iosize changes.

Reported by:	pjd
Reviewed by:	kib
MFC after:	2 weeks
2012-01-27 02:46:12 +00:00
Pedro F. Giffuni
bb9e5fb3bd Minor cleanups to the csa snd driver.
Remove unneeded temporary variable (data) to better match the OSS code.
Remove some unused constants and type definitions.

Tested by:	joel
Approved by:	jhb (mentor)
MFC after:	3 weeks
2012-01-26 21:43:11 +00:00
Kip Macy
0fe48d670f A flowtable entry can continue referencing an llentry indefinitely if the entry is repeatedly
referenced within its timeout window. This change clears the LLE_VALID flag when an llentry
is removed from an interface's hash table and adds an extra check to the flowtable code
for the LLE_VALID flag in llentry to avoid retaining and using a stale reference.

Reviewed by:	qingli@
MFC after:	2 weeks
2012-01-26 20:02:40 +00:00
Kenneth D. Merry
d043c56453 Bring in the LSI-supported version of the mps(4) driver.
This involves significant changes to the mps(4) driver, but is not a
complete rewrite.

Some of the changes in this version of the driver:
 - Integrated RAID (IR) support.
 - Support for WarpDrive controllers.
 - Support for SCSI protection information (EEDP).
 - Support for TLR (Transport Level Retries), needed for tape drives.
 - Improved error recovery code.
 - ioctl interface compatible with LSI utilities.

mps.4:		Update the mps(4) driver man page somewhat for the driver
		changes.  The list of supported hardware still needs to be
		updated to reflect the full list of supported cards.

conf/files:	Add the new driver files.

mps/mpi/*:	Updated version of the MPI header files, with a BSD style
		copyright.

mps/*:		See above for a description of the new driver features.

modules/mps/Makefile:
		Add the new mps(4) driver files.

Submitted by:	Kashyap Desai <Kashyap.Desai@lsi.com>
Reviewed by:	ken
MFC after:	1 week
2012-01-26 18:17:21 +00:00
Kenneth D. Merry
e6bd5983ca Add CAM infrastructure to allow reporting when a drive's long read capacity
data changes.

cam_ccb.h:	Add a new advanced information type, CDAI_TYPE_RCAPLONG,
		for long read capacity data.

cam_xpt_internal.h:
		Add a read capacity data pointer and length to struct cam_ed.

cam_xpt.c:	Free the read capacity buffer when a device goes away.
		While we're here, make sure we don't leak memory for other
		malloced fields in struct cam_ed.

scsi_all.c:	Update the scsi_read_capacity_16() to take a uint8_t * and
		a length instead of just a pointer to the parameter data
		structure.  This will hopefully make this function somewhat
		immune to future changes in the parameter data.

scsi_all.h:	Add some extra bit definitions to struct
		scsi_read_capacity_data_long, and bump up the structure
		size to the full size specified by SBC-3.

		Change the prototype for scsi_read_capacity_16().

scsi_da.c:	Register changes in read capacity data with the transport
		layer.  This allows the transport layer to send out an
		async notification to interested parties.  Update the
		dasetgeom() API.

		Use scsi_extract_sense_len() instead of
		scsi_extract_sense().

scsi_xpt.c:	Add support for the new CDAI_TYPE_RCAPLONG advanced
		information type.

		Make sure we set the physpath pointer to NULL after freeing
		it.  This allows blindly freeing it in the struct cam_ed
		destructor.

sys/param.h:	Bump __FreeBSD_version from 1000005 to 1000006 to make it
		easier for third party drivers to determine that the read
		capacity data async notification is available.

camcontrol.c,
mptutil/mpt_cam.c:
		Update these for the new scsi_read_capacity_16() argument
		structure.

Sponsored by:	Spectra Logic
2012-01-26 18:09:28 +00:00
Sean Bruno
e17ef00528 Update PCI IDs for ciss controllers that are supported by this driver.
Submitted by:	scott.benesh@hp.com
Obtained from:	Yahoo! Inc and HP
MFC after:	1 week
2012-01-26 17:04:17 +00:00