Commit Graph

144748 Commits

Author SHA1 Message Date
Ed Schouten
c0086bf202 Serialize write() calls on TTYs.
Just like the old TTY layer, the current MPSAFE TTY layer does not make
any attempt to serialize calls of write(). Data is copied into the
kernel in 256 (TTY_STACKBUF) byte chunks. If a write() call occurs at
the same time, the data may interleave. This is especially likely when
the TTY starts blocking, because the output queue reaches the high
watermark.

I've implemented this by adding a new flag, TTY_BUSY_OUT, which is used
to mark a TTY as having a thread stuck in write(). Because I don't want
non-blocking processes to be possibly blocked by a sleeping thread, I'm
still allowing it to bypass the protection. According to this message,
the Linux kernel returns EAGAIN in such cases, but I think that's a
little too restrictive:

	http://kerneltrap.org/index.php?q=mailarchive/linux-kernel/2007/5/2/85418/thread

PR:		kern/118287
2009-02-11 16:28:49 +00:00
Robert Watson
54fffe2d67 Modify fdcopy() so that, during fork(2), it won't copy file descriptors
from the parent to the child process if they have an operation vector
of &badfileops.  This narrows a set of races involving system calls that
allocate a new file descriptor, potentially block for some extended
period, and then return the file descriptor, when invoked by a threaded
program that concurrently invokes fork(2).  Similar approches are used
in both Solaris and Linux, and the wideness of this race was introduced
in FreeBSD when we moved to a more optimistic implementation of
accept(2) in order to simplify locking.

A small race necessarily remains because the fork(2) might occur after
the finit() in accept(2) but before the system call has returned, but
that appears unavoidable using current APIs.  However, this race is
vastly narrower.

The fix can be validated using the newfileops_on_fork regression test.

PR:		kern/130348
Reported by:	Ivan Shcheklein <shcheklein at gmail dot com>
Reviewed by:	jhb, kib
MFC after:	1 week
2009-02-11 15:22:01 +00:00
John Baldwin
84f9a0e5c5 Fix lptopen() and lptclose() to not trash the state of the HAVEBUS flag
in 'sc_state'.  This allows the lpt_release_ppbus() calls in those two
routines to actually release the ppbus and thus fixes the hangs noticed
with the lpt(4) driver since the recent ppbus changes.  The old lpt(4)
driver didn't actually check the HAVEBUS flag in lpt_release_ppbus() which
is why these bugs weren't noticed before.
2009-02-11 14:25:09 +00:00
Robert Watson
d0e723a10c Add a regresion test to determine whether or not a file descriptor is
allocated in a fork(2)-inheritable way at the beginning or end of an
accept(2) system call.  This test creates a test thread and blocks it
in accept(2), then forks a child process which tests to see if the
next available file descriptor is defined or not (EBADF vs EINVAL for
ftruncate(2)).

This detects a regression introduced during the network stack locking
work, in which a very narrow race during which fork(2) from one
thread during accept(2) in a second thread lead to an extra inherited
file descriptor turned into a very wide race ensuring that a
descriptor was leaked into the child even though it hadn't been
returned.

PR:		kern/130348
2009-02-11 13:44:27 +00:00
Michael Reifenberger
624b8a5152 Add files to build i386/amd64 bootable rescue ISO images using the
nanobsd framework.
2009-02-11 12:15:35 +00:00
Maxim Konovalov
df8a2f1a4b o Print an octal representation of suid, sgid and sticky bits with -x flag.
PR:		bin/131569
Submitted by:	Jaakko Heinonen
Reported by:	Yannick Cadin
MFC after:	1 week
2009-02-11 10:50:26 +00:00
Alexander Leidinger
3141a8dcd1 All open fixes and improvements from Konstantin for which users had to
use patches so far:
 + Envy24:
   - fix: broken init data for M Audio Delta DiO 2496
   - add: support for M Audio Delta 44
   - add: support for M Audio Delta 1010LT
     Tested by:	Dominique Goncalves, dominique.goncalves at gmail.com
   - add: support for Terratec EWX 2496
     Tested by:	Stefan Sperling, stsp at stsp.name
   - add: support for M Audio Delta 66
     Tested by:	Richard Bown, richard.bown at blueyonder.co.uk
   - add: support for M Audio Delta 1010
     Tested by:	Andrew Reilly, areilly at bigpond.net.au
 + Envy24HT:
   - add: support for Terrasoniq TS22PCI
   - fix: M-Audio Revolution 5.1 sound volume is very low
     Reported by:	Oliver Hartmann, ohartman at zedat.fu-berlin.de
                 	Andrey Slusar, anrays at gmail.com
     Tested by:		Andrey Slusar, anrays at gmail.com
               		Rusu Silviu, arol.the at gmail.com
   - fix: M-Audio Revolution 7.1 sound is distorted and very quiet
     Reported by:	Olev Hannula, hannula at gmail.com
     Tested by:		Olev Hannula, hannula at gmail.com
               		Stanislav Belansky, stanislav at icmail.ru
   - fix: Terratec PHASE 22 codec is power-off due to wrong init data
     Reported by:	Philipp Ost, pj at smo.de
     Tested by:		Philipp Ost, pj at smo.de
 + SpicDS:
   - fix: AK4381 produce hiss sound on 192kHz sample rate
   - fix: stupid bug with volume control for AK4396

Submitted by:	 	Konstantin Dimitrov <kosio.dimitrov@gmail.com>
2009-02-11 10:29:45 +00:00
Mike Makonnen
0dca64d80d Reword informational message by rc.d/defaultroute.
PR:		conf/131458
2009-02-11 09:18:09 +00:00
Marius Strobl
638ed2cf8e - Use the generally more appropriate PROM base rather than the
kernel one as the non-faulting flush address in the loader so
  we can can change KERNBASE and VM_MIN_KERNEL_ADDRESS if we
  ever want to without needing to worry about using a compatible
  loader.
- Correctly check for LOADER_DEBUG.
- Add a missing const for page_sizes[].

This file was missed in r188455.
2009-02-11 07:50:07 +00:00
Warner Losh
c9584ebe61 o Use NULL in pereference to 0 in pointer contexts.
o Use newly minted KOBJMETHOD_END as appropriate
o fix prototype for root_setup_intr.
2009-02-11 04:54:02 +00:00
Warner Losh
6354e4f0ed o Introduce KOBJMETHOD_END for the end of the kobj list.
o Fix a minor indentation problem.
o Put in the extra-strict KOBJMETHOD define, but commented out since
  the tree isn't yet ready.

Reviewed by:	(1) was posted to arch@ without objection (and 1 go for it)
2009-02-11 04:52:46 +00:00
Pyun YongHyeon
f1bb696a81 Allocating 2 MSI messages do not seem to work on certain controllers
so use just 1 MSI message. This fixes regression introduced in
r188381.

Tested by:	many
2009-02-11 00:23:56 +00:00
Kai Wang
64fc5491db Added entries for Lava SP-PCI (1 serial + 1 parallel) PCI card. The
card is a multifunction PCI and report itself as two logical devices.
2009-02-11 00:08:03 +00:00
Sam Leffler
60d5654464 when operating as a slave, clear neighbor entries and the peer bss node
on beacon miss

while here, remove a stray pointless write of iv_bmiss_count
2009-02-10 23:52:28 +00:00
Sam Leffler
f09cf33f40 clean neighbor entries on beacon miss 2009-02-10 23:51:18 +00:00
Sam Leffler
59fbb2570a don't do phantom beacon miss checking for s/w beacon miss handling,
this can mistakenly drop events that cause the s/w bmiss timer to
never get re-armed
2009-02-10 23:48:29 +00:00
Alexander Motin
e05e00bcae Check for device_set_devclass() errors and skip driver probe/attach if any.
Attach call without devclass set crashes the system.

On resume AHCI driver sometimes tries to create duplicate adX device.
It is surely his own problem, but IMHO it is not a reason to crash here.
Other reasons are also possible.
2009-02-10 23:22:29 +00:00
Warner Losh
e436c38238 Fix shutdown prototypes. 2009-02-10 23:17:20 +00:00
Warner Losh
507a69a927 Fix read_ivar prototype. 2009-02-10 23:13:48 +00:00
Warner Losh
b23193a559 Fix iicbus_intr, iicbus_write and device_read_ivar prototypes... 2009-02-10 22:50:23 +00:00
Warner Losh
f2aa0e9f88 fix arcmsr_attach, probe, detach, and shutdown prototypes to match newbus. 2009-02-10 22:46:36 +00:00
John Baldwin
b7208da623 Adding dynamic sysctls no longer requires Giant.
Submitted by:	rdivacky
2009-02-10 22:39:44 +00:00
Marius Strobl
4012d104cd Don't reset the PHY probe retry counter within the loop so
it will eventually terminate as intended.

Submitted by:	Helen Zhang
2009-02-10 21:54:23 +00:00
Marius Strobl
9223a606d0 Improve r185008 so the streaming cache is only flushed when
a mapping actually met the threshold.
2009-02-10 21:51:33 +00:00
Marius Strobl
ceab1bee37 - Use the generally more appropriate PROM base rather than the
kernel one as the non-faulting flush address in the loader so
  we can can change KERNBASE and VM_MIN_KERNEL_ADDRESS if we
  ever want to without needing to worry about using a compatible
  loader.
- Correctly check for LOADER_DEBUG.
- Add a missing const for page_sizes[].
2009-02-10 21:48:42 +00:00
Marcel Moolenaar
5d1df4b56d Mark the BSP as being awake. This supresses the message
that not all usable CPUs could be woken up...
2009-02-10 20:29:57 +00:00
Maksim Yevmenkin
320a819087 Update comment. soalloc() is no longer performing M_WAITOK memory allocations.
Submitted by:	ru
MFC after:	3 days
2009-02-10 20:27:05 +00:00
Sam Leffler
330528331c mark the CLR key installed for open auth stations such that it is reclaimed
when net80211 tears down station state; without this we leak keycache slots
2009-02-10 19:27:50 +00:00
Sam Leffler
a32ac9d3a9 add hw.ath.bstuck to control the stuck beacon threshold 2009-02-10 19:26:42 +00:00
Sam Leffler
054d7b6979 on resume ah_curchan may be NULL if no channel change has been done;
workaround this by passing net80211's channel as we know it'll never
be null

Submitted by:	trasz
2009-02-10 19:25:11 +00:00
Sam Leffler
41576ce6db consolidate conditional code 2009-02-10 19:23:25 +00:00
Attilio Rao
a1d7ce03ea Scanning all the formats for binary translation of modules loading can
result in errors for a format loading but subsequent correct recognizing
for another format.

File format loading functions should avoid printing any additional
informations but just returning appropriate (and different between each
other) error condition, characterizing different informations.
Additively, the linker should handle appropriately different format
loading errors.

While a general mechanism is desired, fix a simple and common case on
amd64: file type is not recognized for link elf and confuses the linker.
Printout an error if all the registered linker classes can't recognize
and load the module.

Reviewed by:	jhb
Sponsored by:	Sandvine Incorporated
2009-02-10 15:50:19 +00:00
Ken Smith
fc94457307 Turn off the parallel make options accidentally turned on by the previous
commit.  Sigh.

Noticed by:	rdivacky
2009-02-10 15:11:26 +00:00
Ken Smith
48a0e75812 Due to some recent-ish work on GEOM/G_PART the c partition (by tradition
the whole disk) isn't available any more since it was redundant.  Just
use /dev/md0 instead of /dev/md0c to build the filesystem on.

Consulted-with:		marcel
2009-02-10 15:07:57 +00:00
Ken Smith
b8db5085d2 Turn off the building of boot floppies for amd64/i386. 2009-02-10 15:03:08 +00:00
Alan Cox
11bd9105b6 Eliminate an unused definition. 2009-02-10 06:08:28 +00:00
Warner Losh
51f53a08e0 Fix g_part_dumpconf and g_part_name prototpyes.
Submitted by:	marcel@
2009-02-10 02:43:07 +00:00
Sam Leffler
24a90e6b81 correctly fixup iv_des_chan after installing a new channel table; if the
previous channel is now invalid we must set it to IEEE80211_CHAN_ANYC
2009-02-10 01:37:55 +00:00
Marcel Moolenaar
91e1be8baf Add option GEOM_PART_EBR by default on amd64 and i386. 2009-02-10 00:08:39 +00:00
Olivier Houchard
cd5c163926 Hmm... "base? base : 0" and "base" should be equivalent.
Pointy hat to:	cognet

MFC after:	3 days
2009-02-09 22:59:22 +00:00
Andrew Thompson
2a1eb33aac Hook uslcom2 up to the build. 2009-02-09 22:38:55 +00:00
Andrew Thompson
78ba73614f Remove usb2_config_td.[ch], they are no longer used. 2009-02-09 22:23:01 +00:00
Andrew Thompson
41f3098786 MFp4 //depot/projects/usb; 157429, 157433, 157443
Various changes wrt. usb procs and tasks.

Submitted by:	Hans Petter Selasky
2009-02-09 22:18:11 +00:00
Andrew Thompson
1b216d3626 Correct sources for r188417
MFp4 //depot/projects/usb; 157412

Sync from svn.freebsd.org/base/user/thompsa/usb which is a minimal changeset
from oldUSB (no config_td).

This excludes the taskqueue changes (for the moment) as requested.
2009-02-09 22:14:38 +00:00
Andrew Thompson
caba0185f0 MFp4 //depot/projects/usb; 157412
Sync from svn.freebsd.org/base/user/thompsa/usb which is a minimal changeset
from oldUSB (no config_td).

This excludes the taskqueue changes (for the moment) as requested.
2009-02-09 22:12:47 +00:00
Andrew Thompson
3630903af2 MFp4 //depot/projects/usb; 157069, 157255
- Change "usb2_pause_mtx" so that it takes the timeout value in ticks
 - Make sure that attach waits for the generic probe to leave room for firware
   loader drivers and device specific USB Audio drivers like USB phone adapters

Submitted by:	Hans Petter Selasky
2009-02-09 22:11:02 +00:00
Andrew Thompson
d102bcfd1b MFp4 //depot/projects/usb; 157203
- Remove CAM layer quirks

Submitted by:	Hans Petter Selasky
2009-02-09 22:09:21 +00:00
Andrew Thompson
fc7ca11552 MFp4 //depot/projects/usb; 157069
- Change "usb2_pause_mtx" so that it takes the timeout value in ticks

Submitted by:	Hans Petter Selasky
2009-02-09 22:06:52 +00:00
Andrew Thompson
1c39f075ce MFp4 //depot/projects/usb; 157069, 157136, 157143, 157145, 157429
- USB serial drivers cleanup, factor out code
 - Simplify line state programming
 - Integrate uslcom from old USB stack

Submitted by:	Hans Petter Selasky
2009-02-09 22:05:25 +00:00
Andrew Thompson
9b90005109 MFp4 //depot/projects/usb; 157100
1. Move most of the ifnet logic into the usb2_ethernet module, this includes,
 - make all usb ethernet interfaces named ue%d
 - handle all threading in usb2_ethernet
 - provide default ioctl handler
 - handle mbuf rx
 - provide locked callbacks for init,start,stop,etc

2. Cleanup CDC-Ethernet driver.

Submitted by:	Hans Petter Selasky
Obtained from:	svn.freebsd.org/base/user/thompsa/usb [1]
2009-02-09 22:02:38 +00:00