peter [Sun, 22 Jun 2008 00:13:19 +0000 (00:13 +0000)]
MFC: revs 175291,175384. Add .POSIX: to break timestamp-sensitive problems
between Makefile and Makefile.in that was disturbed by changes in
src/usr.bin/make/main.c rev 167330 (1.161).
yongari [Thu, 19 Jun 2008 01:36:31 +0000 (01:36 +0000)]
MFC: r179647
Ethernet hardware address stored in DC_AL_PAR0/DC_AL_PAR1 register
is in little endian form. Likewise setting DC_AL_PAR0/DC_AL_PAR1
register expect the address to be in little endian form. For big
endian architectures the address should be swapped to get correct
one.
Change setting/getting ethernet hardware address to big endian
architecture frendly.
Reported by: Robert Murillo ( billypilgrim782001 at yahoo dot com )
Tested by: Robert Murillo ( billypilgrim782001 at yahoo dot com )
jasone [Mon, 16 Jun 2008 23:42:05 +0000 (23:42 +0000)]
MFC allocator improvements and fixes:
* Implement more compact red-black trees, thus reducing memory usage
by ~0.5-1%.
* Add a separate tree to track dirty-page-containing chunks, thus
improving worst case allocation performance.
* Fix a deadlock in base_alloc() for the error (OOM) path.
* Catch integer overflow for huge allocations when using sbrk(2).
* Fix bit vector initialization for run headers. This fix has no
practical impact for correct programs. Incorrect programs will
potentially experience allocation failures rather than memory
corruption, both of which are "undefined behavior".
ambrisko [Fri, 13 Jun 2008 15:45:48 +0000 (15:45 +0000)]
MFC: All changes in current to 7.X.
- Native 32bit compat modes for amd64
- Limit max commands to 128
- Add in compat mode for using mfi0 to talk to any card
marius [Wed, 11 Jun 2008 21:10:06 +0000 (21:10 +0000)]
MFC: r176996, r177560
- Fix some style bugs and remove another banal comment missed in
rev. 1.46.
- Move the KASSERT on gem_add_rxbuf() to the right spot and add an
equivalent one to gem_disable_tx().
- Split the registers into two halves in preparation for SBus
support. [1]
marius [Wed, 11 Jun 2008 20:52:34 +0000 (20:52 +0000)]
MFC: r178589
- Use the revamped code from the gem(4) PCI front-end, which
doesn't require parts of the Expansion ROM to be copied around,
for obtaining the MAC address on !OFW platforms.
- Don't unnecessarily cache bus space tag and handle nor RIDs
in the softcs of the front-ends.
- Don't use function calls in initializers.
- Let the SBus front-end depend on sbus(4).
marius [Wed, 11 Jun 2008 19:48:35 +0000 (19:48 +0000)]
MFC: r178470
o Disable HMEDEBUG by default.
o Add CTASSERTs ensuring that HME_NRXDESC and HME_NTXDESC are set to
legal values.
o Use appropriate maxsize, nsegments and maxsegsize parameters when
creating DMA tags and correct some comments related to them.
o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite
some time now so collapse calls accordingly.
o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in
hme_rint() and hme_start_locked().
o Keep state of the link state and use it to enable or disable the MAC
in hme_mii_statchg() accordingly as well as to return early from
hme_start_locked() in case the link is down.
o Introduce a sc_flags and use it to replace individual members like
sc_pci.
o Add bus_barrier(9) calls to hme_mac_bitflip(), hme_mii_readreg(),
hme_mii_writereg() and hme_stop() to ensure the respective bit
has been written before we starting polling on it and for the right
bits to change.
o Rather just returning in case hme_mac_bitflip() fails and leaving us
in an undefined state report the problem and move on; chances are
the requested configuration will become active shortly after.
o Don't call hme_start_locked() in hme_init_locked() unconditionally
but only after calls to hme_init_locked() when it's appropriate, i.e.
in hme_watchdog().
o Add a KASSERT which asserts nsegs is valid also to hme_load_txmbuf().
o In hme_load_txmbuf():
- use a maximum of the newly introduced HME_NTXSEGS segments instead
of the incorrect HME_NTXQ, which reflects the maximum TX queue
length, for loading the mbufs and put the DMA segments back onto
the stack instead of the softc as 16 should be ok there.
- use the common errno(2) return values instead of homegrown ones,
- given that hme_load_txmbuf() is allowed to fail resulting in a
packet drop for quite some time now implement the functionality of
hme_txcksum() by means of m_pullup(9), which de-obfuscates the code
and allows to always retrieve the correct length of the IP header, [1]
- also add a KASSERT which asserts nsegs is valid,
- take advantage of m_collapse(9) instead of m_defrag(9) for
performance reasons.
o Don't bother to check whether the interface is running or whether its
queue is empty before calling hme_start_locked() in hme_tint(), the
former will check these anyway.
o In hme_intr() call hme_rint() before hme_tint() as gem_tint() may
take quite a while to return when it calls hme_start_locked().
o Get rid of sc_debug and just check if_flags for IFF_DEBUG directly.
o Add a shadow sc_ifflags so we don't reset the chip when unnecessary.
o Handle IFF_ALLMULTI correctly. [2]
o Use PCIR_BAR instead of a homegrown macro.
o Replace sc_enaddr[6] with sc_enaddr[ETHER_ADDR_LEN].
o Use the maximum of 256 TX descriptors for better performance as using
all of them has no additional static cost rather than using just half
of them.
marcel [Tue, 10 Jun 2008 03:19:33 +0000 (03:19 +0000)]
MFC revisions 172857 through 179688:
o Allow building a rescue version (not applicable yet)
o Add the bootcode verb for installing bootcode.
o Various manpage updates.
marcel [Mon, 9 Jun 2008 18:51:30 +0000 (18:51 +0000)]
MFC r177223 through r179684:
o Redefine G_PART_SCHEME_DECLARE() from populating a private
linker set to declaring a proper module.
o Add support for PC-9800 partition tables.
o Change the order from SI_ORDER_FIRST to SI_ORDER_ANY (within
SI_SUB_DRIVERS) to avoid loading schemes before all the GEOM
classes have been loaded and initialized.
o Add the bootcode verb for installing boot code.
o Implement the G_PART_DUMPCONF method for all 6 schemes.
dwmalone [Sun, 8 Jun 2008 21:00:25 +0000 (21:00 +0000)]
MFC: Sync restore in RELENG_7 with -current.
Fix remaining nits from PR bin/39905.
Check for write failure while building temp files.
Correctly set file group when restore is run by a user other than root.
Use safer string handling.
Fixes the "getfile: lost data" panic when restoring older dumps.
Fix spurious "Header with wrong dumpdate" message.
philip [Sun, 8 Jun 2008 09:06:45 +0000 (09:06 +0000)]
MFC r179474:
Try to detect a Synaptics touchpad before IntelliMouse. Some touchpads will
pretend to be IntelliMouse (which have a few more features than generic mice)
causing the IntelliMouse probe to work and the Synaptics code never to be
called.
This should not break "real" IntelliMouse because the Synaptics detection code
is fairly specific.
kib [Fri, 6 Jun 2008 12:17:28 +0000 (12:17 +0000)]
MFC rev. 1.198 of sys/kern/sys_pipe.c,
rev. 1.30 of sys/sys/pipe.h
AKA r179243.
Another problem caused by the knlist_cleardel() potentially dropping
PIPE_MTX().
Since the pipe_present is cleared before (potentially) sleeping, the
second thread may enter the pipeclose() for the reciprocal pipe end.
The test at the end of the pipeclose() for the pipe_present == 0 would
succeed, allowing the second thread to free the pipe memory. First
threads then accesses the freed memory after being woken up.
Properly track the closing state of the pipe in the pipe_present.
Introduce the intermediate state that marks the pipe as mostly
dismantled but might be sleeping waiting for the knote list to be
cleared. Free the pipe pair memory only when both ends pass that point.
kib [Fri, 6 Jun 2008 12:04:31 +0000 (12:04 +0000)]
MFC rev. 1.197 AKA r179242:
The pipe_peer that has the knote for write shall be present. Ignore the
pipe_present value for EVFILT_WRITE in filt_pipedetach().
dougb [Mon, 2 Jun 2008 20:52:28 +0000 (20:52 +0000)]
Add proper mime-types for files that they are relevant for.
This is useful for things like *.pdf files that svn needs
to know about, and will probably be useful down the road
for other things.
marcel [Sun, 1 Jun 2008 18:04:29 +0000 (18:04 +0000)]
Merge rev 179173:
We can call ia64_flush_dirty() when the corresponding process is
locked or not. As such, use PROC_LOCKED() to determine which case
it is and lock the process when not.
This is a manual merge. No merge history is created.
Remove the MD isa_irq_pending() and the underlying PCI-specific
infrastructure. Its only consumer ever was sio(4) and thus was
unused on sparc64 since removing the last traces of sio(4) in
sparc64 configuration files in favor for uart(4) over three
years ago. If similar functionality is required again it should
be brought back as an MD intr_pending() which works for all
busses by using for example interrupt controller hooks.
- Const'ify firmware and lookup-tables.
- Obsolete redundant inst_name and unit members of struct sym_hcb.
- Fix three more NULL vs. 0 confusions.
- Use device_set_softc(9) to tell the bus layer that this driver
allocates a instance of struct sym_hcb itself.
marius [Fri, 30 May 2008 20:02:06 +0000 (20:02 +0000)]
MFC: 1.69
- Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9)
in order to get rid of bus space handle and tag in struct sym_hcb.
- Remove unused members related to bus addresses in struct sym_hcb.
- sym(4) takes care of allocating an instance of struct sym_hcb
itself so don't let newbus allocate it as an unused softc also.
- Add basic MPSAFE locking. This includes changing the sym(4) CCBs
to be allocated up-front instead of on demand as needed. Besides
making these allocations more likely to succeed, this also solves
the problem of calling bus_dmamap_create(9) with the SIM mutex
held.
marius [Fri, 30 May 2008 19:58:23 +0000 (19:58 +0000)]
MFC: 1.68
- Use NULL instead of 0 for pointers.
- Remove superfluous returns in functions returning void.
- In sym_alloc_lcb_tags() return directly instead of jumping
to a label which just returns.
- Fix some spelling in comments.
- Remove trailing whitespace.
marius [Fri, 30 May 2008 19:31:44 +0000 (19:31 +0000)]
MFC: 1.20
- Make failure to route a ISA interrupt non fatal. Apparently the
Blade 1500/SX1500 boards have inherited the firmware bug of the
AX1105 mainboards to not include an interrupt map entry for the
parallel port controller (for the AX1105 the heuristic code for
E450s probably erroneously kicks in and guesses an interrupt).
- Take advantage of bus_generic_setup_intr(9).
- Fix some whitespace bugs.
o Rename ic_eoi to ic_clear to emphasize the functions it points
don't send and EOI which works like on amd64/i386 and blocks all
interrupts on the relevant interrupt controller.
o Replace the post_filter and post_inthread hooks registered when
creating the interrupt events with just ic_clear as on sparc64 we
don't need to do any disable->EOI->enable dance to unblock all but
the relevant interrupt while running the filter or handler; just
not clearing the interrupt already has the same effect.
o Merge from amd64/i386:
- Split the intr_table_lock into an sx lock used for most things,
and a spin lock to protect intrcnt_index.
- Add support for binding interrupts to CPUs and initial shuffling
interrupts arround in a round-robin fashion.
kib [Fri, 30 May 2008 11:13:30 +0000 (11:13 +0000)]
MFC rev. 1.280:
Rev. 1.274 put the ttyrel() call before the destroy_dev() in the
ttyfree(), freeing the tty. Since destroy_dev() may call d_purge()
cdevsw method, that is the ttypurge() for the tty, the code ends up
accessing freed tty structure.
Put the ttyrel() after destroy_dev() in the ttyfree. To prevent the
panic the rev. 1.274 provided fix for, check the TS_GONE in sysctl
handler and refuse to provide information on such tty.
kib [Fri, 30 May 2008 11:12:26 +0000 (11:12 +0000)]
MFC rev. 1.279:
The dev_refthread() in the tty_gettp() may fail, because Giant is taken
in the giant_trick routines after the dev_refthread increments the
si_threadcount. Remove assert, do not perform dev_relthread() for failed
dev_refthread(), and handle failure in the tty_gettp() callers (cdevsw
tty methods).
emax [Fri, 30 May 2008 00:37:41 +0000 (00:37 +0000)]
MFC:
Bluetooth SIG is being difficult and keep moving specification
documents away from being public accessible. Replace link to
the Bluetooth specification document with the document name.
Pointed out by: SoftLover < slserg at uic dot tula dot ru >
ariff [Wed, 28 May 2008 14:45:05 +0000 (14:45 +0000)]
MFC (revision 1.109, requested by kib):
Release pcm mutex before calling snd_clone_unref(), which in turns might
calling destroy_dev() with sleepable malloc(9). The entire opetation
is being serialized through pcm cv from top down, so dropping mutex is
rather safe.
antoine [Tue, 27 May 2008 18:34:20 +0000 (18:34 +0000)]
MFC to RELENG_7:
Move "1000baseT" from IFM_SUBTYPE_ETHERNET_DESCRIPTIONS to
IFM_SUBTYPE_ETHERNET_ALIASES: there is already "1000baseTX" in
IFM_SUBTYPE_ETHERNET_DESCRIPTIONS. This doesn't change ifconfig
behaviour.
rpaulo [Sun, 25 May 2008 14:37:33 +0000 (14:37 +0000)]
MFC r1.208:
devctl_process_running(): Check for devsoftc.inuse == 1 instead of
devsoftc.async_proc != NULL because the latter might not be true
sometimes.
This way /etc/rc.suspend gets executed.
Reviwed by: njl
Submitted by: Mitsuru IWASAKI <iwasaki at jp.FreeBSD.org>
Tested also by: Andreas Wetzel <mickey242 at gmx.net>
Summary:
In some situations we were not clearing pending link state attentions.
Because of this we were not getting further interrupts for link state
changes, thus never went into iface UP state and thus could not transmit.
The only way out of this was an incoming packet generating an rx interrupt
and making us call into bge_link_upd.
What we do now is force an interrupt at the end of bge_ifmedia_upd_locked
so we will call bge_link_upd, clear the link state attention and get
further interrupts.
While the initial version was not expected to work with all chips
the later update in rev. 1.210 is.
PR: kern/111804
Tested by: phk, scottl (initial version)
Thanks for your help to: davidch, Broadcom